From 174075efb7e06bbbb1ade131a7d61b0da1eab500 Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 18 Jun 2026 16:23:48 +0000 Subject: [PATCH 1/5] chore: generate initial Go client draft from OpenAPI spec v2-2026-06-16T064758Z Generated with openapi-generator 7.23.0 (go generator). Co-Authored-By: Claude Opus 4.8 --- .gitignore | 44 +- .openapi-generator-ignore | 23 + .openapi-generator/FILES | 593 + .openapi-generator/VERSION | 1 + .travis.yml | 8 + README.md | 1090 +- api/openapi.yaml | 23400 ++++++++++++++++ api_actor_builds.go | 1144 + api_actor_runs.go | 2192 ++ api_actor_tasks.go | 4086 +++ api_actors.go | 1303 + api_actors_actor_builds.go | 1199 + api_actors_actor_runs.go | 3255 +++ api_actors_actor_versions.go | 2562 ++ api_actors_webhook_collection.go | 244 + api_default_dataset.go | 1415 + api_default_key_value_store.go | 1921 ++ api_default_request_queue.go | 3226 +++ api_last_actor_runs_abort.go | 233 + api_last_actor_runs_default_dataset.go | 1475 + ...last_actor_runs_default_key_value_store.go | 2010 ++ api_last_actor_runs_default_request_queue.go | 3376 +++ api_last_actor_runs_log.go | 239 + api_last_actor_runs_metamorph.go | 242 + api_last_actor_runs_reboot.go | 223 + api_last_actor_task_runs_abort.go | 233 + api_last_actor_task_runs_default_dataset.go | 1475 + ...actor_task_runs_default_key_value_store.go | 2009 ++ ...t_actor_task_runs_default_request_queue.go | 3376 +++ api_last_actor_task_runs_log.go | 239 + api_last_actor_task_runs_metamorph.go | 242 + api_last_actor_task_runs_reboot.go | 223 + api_logs.go | 237 + api_schedules.go | 1236 + api_storage_datasets.go | 2385 ++ api_storage_key_value_stores.go | 2470 ++ api_storage_request_queues.go | 1503 + api_storage_request_queues_requests.go | 1114 + api_storage_request_queues_requests_locks.go | 1076 + api_store.go | 284 + api_tools.go | 985 + api_users.go | 915 + api_webhooks_webhook_dispatches.go | 410 + api_webhooks_webhooks.go | 1437 + client.go | 775 + configuration.go | 221 + docs/AccountLimits.md | 93 + .../ActRunsLastDatasetItemsPost400Response.md | 51 + docs/ActRunsLastDatasetItemsPostRequest.md | 30 + docs/ActValidateInputPost200Response.md | 51 + docs/Actor.md | 886 + docs/ActorBuildsAPI.md | 438 + docs/ActorChargeEvent.md | 176 + docs/ActorDefinition.md | 420 + docs/ActorDefinitionDefaultMemoryMbytes.md | 30 + docs/ActorDefinitionStorages.md | 56 + docs/ActorJobStatus.md | 25 + docs/ActorPermissionLevel.md | 13 + docs/ActorResponse.md | 51 + docs/ActorRunFailedError.md | 56 + docs/ActorRunPricingInfo.md | 380 + docs/ActorRunTimeoutExceededError.md | 56 + docs/ActorRunsAPI.md | 755 + docs/ActorShort.md | 197 + docs/ActorStandby.md | 318 + docs/ActorStats.md | 342 + docs/ActorStatsPublicActorRunStats30Days.md | 160 + docs/ActorTaskGet200Response.md | 51 + docs/ActorTaskRunsGet200Response.md | 51 + docs/ActorTaskRunsGet200ResponseData.md | 156 + docs/ActorTaskRunsPost201Response.md | 51 + docs/ActorTaskWebhooksGet200Response.md | 51 + docs/ActorTaskWebhooksGet200ResponseData.md | 156 + docs/ActorTasksAPI.md | 1257 + docs/ActorsAPI.md | 440 + docs/ActorsActorBuildsAPI.md | 463 + docs/ActorsActorRunsAPI.md | 1010 + docs/ActorsActorVersionsAPI.md | 914 + docs/ActorsWebhookCollectionAPI.md | 85 + docs/AddRequestResponse.md | 51 + docs/AddedRequest.md | 114 + docs/BatchAddResponse.md | 51 + docs/BatchAddResult.md | 72 + docs/BatchDeleteResponse.md | 51 + docs/BatchDeleteResult.md | 72 + docs/BrowserInfoResponse.md | 186 + docs/BrowserInfoResponseHeadersValue.md | 30 + docs/Build.md | 527 + docs/BuildActVersion.md | 160 + docs/BuildOptions.md | 174 + docs/BuildResponse.md | 51 + docs/BuildShort.md | 275 + docs/BuildStats.md | 129 + docs/BuildTag.md | 51 + docs/BuildUsage.md | 66 + docs/BuildsMeta.md | 103 + docs/CallsInner.md | 210 + docs/ChargeRunRequest.md | 72 + docs/CommonActorPricingInfo.md | 253 + docs/CreateActorRequest.md | 504 + docs/CreateOrUpdateVersionRequest.md | 344 + docs/CreateTaskRequest.md | 221 + docs/Current.md | 266 + docs/CurrentPricingInfo.md | 495 + docs/DailyServiceUsages.md | 93 + docs/Dataset.md | 492 + docs/DatasetFieldStatistics.md | 174 + docs/DatasetListItem.md | 384 + docs/DatasetResponse.md | 51 + docs/DatasetSchemaValidationError.md | 108 + docs/DatasetStatistics.md | 56 + docs/DatasetStatisticsResponse.md | 51 + docs/DatasetStats.md | 134 + docs/DecodeAndVerifyData.md | 113 + docs/DecodeAndVerifyRequest.md | 51 + docs/DecodeAndVerifyResponse.md | 51 + docs/DefaultDatasetAPI.md | 484 + docs/DefaultKeyValueStoreAPI.md | 685 + docs/DefaultRequestQueueAPI.md | 1142 + docs/DefaultRunOptions.md | 206 + docs/DeletedRequest.md | 72 + docs/DeletedRequestById.md | 77 + docs/DeletedRequestByUniqueKey.md | 77 + docs/EffectivePlatformFeature.md | 165 + docs/EffectivePlatformFeatures.md | 240 + docs/EncodeAndSignData.md | 51 + docs/EncodeAndSignResponse.md | 51 + docs/EnvVar.md | 113 + docs/EnvVarRequest.md | 103 + docs/EnvVarResponse.md | 51 + docs/ErrorDetail.md | 82 + docs/ErrorResponse.md | 51 + docs/ErrorType.md | 791 + docs/EventData.md | 72 + docs/ExampleRunInput.md | 82 + docs/ExampleWebhookDispatch.md | 123 + docs/FlatPricePerMonthActorPricingInfo.md | 286 + docs/FreeActorPricingInfo.md | 244 + docs/GeneralAccess.md | 17 + docs/HeadAndLockResponse.md | 51 + docs/HeadRequest.md | 145 + docs/HeadResponse.md | 51 + docs/HttpMethod.md | 27 + docs/InvalidItem.md | 82 + docs/KeyValueStore.md | 496 + docs/KeyValueStoreKey.md | 93 + docs/KeyValueStoreResponse.md | 51 + docs/KeyValueStoreStats.md | 166 + docs/LastActorRunsAbortAPI.md | 83 + docs/LastActorRunsDefaultDatasetAPI.md | 496 + docs/LastActorRunsDefaultKeyValueStoreAPI.md | 703 + docs/LastActorRunsDefaultRequestQueueAPI.md | 1172 + docs/LastActorRunsLogAPI.md | 85 + docs/LastActorRunsMetamorphAPI.md | 85 + docs/LastActorRunsRebootAPI.md | 81 + docs/LastActorTaskRunsAbortAPI.md | 83 + docs/LastActorTaskRunsDefaultDatasetAPI.md | 496 + ...astActorTaskRunsDefaultKeyValueStoreAPI.md | 703 + ...LastActorTaskRunsDefaultRequestQueueAPI.md | 1172 + docs/LastActorTaskRunsLogAPI.md | 85 + docs/LastActorTaskRunsMetamorphAPI.md | 85 + docs/LastActorTaskRunsRebootAPI.md | 81 + docs/Limits.md | 287 + docs/LimitsResponse.md | 51 + docs/ListOfActors.md | 156 + docs/ListOfActorsInStoreResponse.md | 51 + docs/ListOfActorsResponse.md | 51 + docs/ListOfBuilds.md | 156 + docs/ListOfBuildsResponse.md | 51 + docs/ListOfDatasets.md | 182 + docs/ListOfDatasetsResponse.md | 51 + docs/ListOfEnvVars.md | 72 + docs/ListOfEnvVarsResponse.md | 51 + docs/ListOfKeyValueStores.md | 182 + docs/ListOfKeyValueStoresResponse.md | 51 + docs/ListOfKeys.md | 186 + docs/ListOfKeysResponse.md | 51 + docs/ListOfRequestQueues.md | 182 + docs/ListOfRequestQueuesResponse.md | 51 + docs/ListOfRequests.md | 150 + docs/ListOfRequestsResponse.md | 51 + docs/ListOfRuns.md | 156 + docs/ListOfRunsResponse.md | 51 + docs/ListOfSchedules.md | 156 + docs/ListOfSchedulesResponse.md | 51 + docs/ListOfStoreActors.md | 156 + docs/ListOfTasks.md | 156 + docs/ListOfTasksResponse.md | 51 + docs/ListOfVersions.md | 72 + docs/ListOfVersionsResponse.md | 51 + docs/ListOfWebhookDispatches.md | 156 + docs/ListOfWebhookDispatchesResponse.md | 51 + docs/ListOfWebhooks.md | 156 + docs/ListOfWebhooksResponse.md | 51 + docs/LockedHeadRequest.md | 166 + docs/LockedRequestQueueHead.md | 187 + docs/LogsAPI.md | 85 + docs/Metamorph.md | 129 + docs/MonthlyUsage.md | 135 + docs/MonthlyUsageResponse.md | 51 + docs/PaginationResponse.md | 135 + docs/PayPerEventActorPricingInfo.md | 301 + ...entActorPricingInfoAllOfPricingPerEvent.md | 56 + docs/Plan.md | 585 + docs/PricePerDatasetItemActorPricingInfo.md | 317 + docs/PriceTiers.md | 135 + docs/PrivateUserDataResponse.md | 51 + docs/Profile.md | 186 + docs/ProlongRequestLockResponse.md | 51 + docs/Proxy.md | 72 + docs/ProxyGroup.md | 103 + docs/PublicUserDataResponse.md | 51 + docs/PutItemResponseError.md | 51 + docs/Request.md | 352 + docs/RequestBase.md | 376 + docs/RequestBasePayload.md | 30 + docs/RequestDraft.md | 124 + docs/RequestDraftDelete.md | 72 + docs/RequestDraftDeleteById.md | 77 + docs/RequestDraftDeleteByUniqueKey.md | 77 + docs/RequestLockInfo.md | 51 + docs/RequestQueue.md | 400 + docs/RequestQueueHead.md | 114 + docs/RequestQueueResponse.md | 51 + docs/RequestQueueShort.md | 411 + docs/RequestQueueStats.md | 160 + docs/RequestRegistration.md | 93 + docs/RequestResponse.md | 51 + docs/Run.md | 865 + docs/RunFailedErrorDetail.md | 92 + docs/RunMeta.md | 195 + docs/RunOptions.md | 176 + docs/RunOrigin.md | 29 + docs/RunResponse.md | 51 + docs/RunShort.md | 390 + docs/RunStats.md | 467 + docs/RunStorageIds.md | 108 + docs/RunStorageIdsDatasets.md | 56 + docs/RunTimeoutExceededErrorDetail.md | 92 + docs/RunUsage.md | 462 + docs/RunUsageUsd.md | 462 + docs/Schedule.md | 390 + docs/ScheduleAction.md | 202 + docs/ScheduleActionRunActor.md | 175 + docs/ScheduleActionRunActorTask.md | 139 + docs/ScheduleActionRunInput.md | 102 + docs/ScheduleActionShort.md | 124 + docs/ScheduleActionShortRunActor.md | 103 + docs/ScheduleActionShortRunActorTask.md | 103 + docs/ScheduleBase.md | 291 + docs/ScheduleCreate.md | 318 + docs/ScheduleCreateAction.md | 181 + docs/ScheduleCreateActionRunActor.md | 154 + docs/ScheduleCreateActionRunActorTask.md | 118 + docs/ScheduleInvoked.md | 93 + docs/ScheduleLogResponse.md | 51 + docs/ScheduleNotifications.md | 56 + docs/ScheduleResponse.md | 51 + docs/ScheduleShort.md | 292 + docs/SchedulesAPI.md | 432 + docs/SchemaValidationErrorData.md | 51 + docs/SourceCodeFile.md | 103 + docs/SourceCodeFileFormat.md | 13 + docs/SourceCodeFolder.md | 72 + docs/StorageDatasetsAPI.md | 743 + docs/StorageKeyValueStoresAPI.md | 899 + docs/StorageOwnership.md | 13 + docs/StorageRequestQueuesAPI.md | 517 + docs/StorageRequestQueuesRequestsAPI.md | 394 + docs/StorageRequestQueuesRequestsLocksAPI.md | 389 + docs/StoreAPI.md | 93 + docs/StoreListActor.md | 534 + docs/TaggedBuildInfo.md | 144 + docs/TaggedBuildsValue.md | 144 + docs/Task.md | 444 + docs/TaskOptions.md | 246 + docs/TaskResponse.md | 51 + docs/TaskShort.md | 300 + docs/TaskStats.md | 56 + docs/TestWebhookResponse.md | 51 + docs/TieredPricingPerDatasetItemEntry.md | 51 + docs/TieredPricingPerEventEntry.md | 51 + docs/ToolsAPI.md | 418 + docs/UnlockRequestsResponse.md | 51 + docs/UnlockRequestsResult.md | 51 + docs/UpdateActorRequest.md | 546 + docs/UpdateDatasetRequest.md | 92 + docs/UpdateLimitsRequest.md | 82 + docs/UpdateRequestQueueRequest.md | 92 + docs/UpdateRequestResponse.md | 51 + docs/UpdateRunRequest.md | 134 + docs/UpdateStoreRequest.md | 92 + docs/UpdateTaskRequest.md | 200 + docs/UsageCycle.md | 72 + docs/UsageItem.md | 150 + docs/UserPrivateInfo.md | 219 + docs/UserPublicInfo.md | 77 + docs/UsersAPI.md | 337 + docs/ValidationError.md | 160 + docs/Version.md | 314 + docs/VersionResponse.md | 51 + docs/VersionSourceFilesInner.md | 124 + docs/VersionSourceType.md | 19 + docs/Webhook.md | 486 + docs/WebhookCondition.md | 138 + docs/WebhookCreate.md | 381 + docs/WebhookDispatch.md | 244 + docs/WebhookDispatchResponse.md | 51 + docs/WebhookDispatchStatus.md | 15 + docs/WebhookDispatchWebhookSummary.md | 134 + docs/WebhookEventType.md | 33 + docs/WebhookRepresentation.md | 288 + docs/WebhookResponse.md | 51 + docs/WebhookShort.md | 441 + docs/WebhookStats.md | 51 + docs/WebhookUpdate.md | 390 + docs/WebhooksWebhookDispatchesAPI.md | 150 + docs/WebhooksWebhooksAPI.md | 503 + git_push.sh | 57 + go.mod | 7 + go.sum | 13 + model_account_limits.go | 214 + ...ns_last_dataset_items_post_400_response.go | 107 + ...ct_runs_last_dataset_items_post_request.go | 171 + model_act_validate_input_post_200_response.go | 159 + model_actor.go | 1265 + model_actor_charge_event.go | 336 + model_actor_definition.go | 643 + ..._actor_definition_default_memory_mbytes.go | 171 + model_actor_definition_storages.go | 127 + model_actor_job_status.go | 123 + model_actor_permission_level.go | 111 + model_actor_response.go | 158 + model_actor_run_failed_error.go | 126 + model_actor_run_pricing_info.go | 247 + model_actor_run_timeout_exceeded_error.go | 126 + model_actor_short.go | 353 + model_actor_standby.go | 458 + model_actor_stats.go | 523 + ...tor_stats_public_actor_run_stats30_days.go | 270 + model_actor_task_get_200_response.go | 158 + model_actor_task_runs_get_200_response.go | 158 + ...l_actor_task_runs_get_200_response_data.go | 303 + model_actor_task_runs_post_201_response.go | 158 + model_actor_task_webhooks_get_200_response.go | 158 + ...tor_task_webhooks_get_200_response_data.go | 303 + model_add_request_response.go | 158 + model_added_request.go | 246 + model_batch_add_response.go | 158 + model_batch_add_result.go | 188 + model_batch_delete_response.go | 158 + model_batch_delete_result.go | 188 + model_browser_info_response.go | 324 + model_browser_info_response_headers_value.go | 171 + model_build.go | 787 + model_build_act_version.go | 272 + model_build_options.go | 274 + model_build_response.go | 158 + model_build_short.go | 461 + model_build_stats.go | 266 + model_build_tag.go | 158 + model_build_usage.go | 136 + model_builds_meta.go | 232 + model_calls_inner.go | 321 + model_charge_run_request.go | 186 + model_common_actor_pricing_info.go | 428 + model_create_actor_request.go | 692 + model_create_or_update_version_request.go | 489 + model_create_task_request.go | 370 + model_current.go | 446 + model_current_pricing_info.go | 735 + model_daily_service_usages.go | 215 + model_dataset.go | 725 + model_dataset_field_statistics.go | 278 + model_dataset_list_item.go | 601 + model_dataset_response.go | 158 + model_dataset_schema_validation_error.go | 200 + model_dataset_statistics.go | 127 + model_dataset_statistics_response.go | 158 + model_dataset_stats.go | 236 + model_decode_and_verify_data.go | 220 + model_decode_and_verify_request.go | 158 + model_decode_and_verify_response.go | 158 + model_default_run_options.go | 326 + model_deleted_request.go | 107 + model_deleted_request_by_id.go | 196 + model_deleted_request_by_unique_key.go | 196 + model_effective_platform_feature.go | 277 + model_effective_platform_features.go | 410 + model_encode_and_sign_data.go | 158 + model_encode_and_sign_response.go | 158 + model_env_var.go | 241 + model_env_var_request.go | 231 + model_env_var_response.go | 158 + model_error_detail.go | 163 + model_error_response.go | 158 + model_error_type.go | 889 + model_event_data.go | 186 + model_example_run_input.go | 162 + model_example_webhook_dispatch.go | 251 + ...flat_price_per_month_actor_pricing_info.go | 484 + model_free_actor_pricing_info.go | 426 + model_general_access.go | 115 + model_head_and_lock_response.go | 158 + model_head_request.go | 290 + model_head_response.go | 158 + model_http_method.go | 125 + model_invalid_item.go | 164 + model_key_value_store.go | 740 + model_key_value_store_key.go | 215 + model_key_value_store_response.go | 158 + model_key_value_store_stats.go | 314 + model_limits.go | 474 + model_limits_response.go | 158 + model_list_of_actors.go | 303 + model_list_of_actors_in_store_response.go | 158 + model_list_of_actors_response.go | 158 + model_list_of_builds.go | 303 + model_list_of_builds_response.go | 158 + model_list_of_datasets.go | 340 + model_list_of_datasets_response.go | 158 + model_list_of_env_vars.go | 187 + model_list_of_env_vars_response.go | 158 + model_list_of_key_value_stores.go | 340 + model_list_of_key_value_stores_response.go | 158 + model_list_of_keys.go | 335 + model_list_of_keys_response.go | 158 + model_list_of_request_queues.go | 341 + model_list_of_request_queues_response.go | 158 + model_list_of_requests.go | 303 + model_list_of_requests_response.go | 158 + model_list_of_runs.go | 303 + model_list_of_runs_response.go | 158 + model_list_of_schedules.go | 303 + model_list_of_schedules_response.go | 158 + model_list_of_store_actors.go | 303 + model_list_of_tasks.go | 303 + model_list_of_tasks_response.go | 158 + model_list_of_versions.go | 187 + model_list_of_versions_response.go | 158 + model_list_of_webhook_dispatches.go | 303 + model_list_of_webhook_dispatches_response.go | 158 + model_list_of_webhooks.go | 303 + model_list_of_webhooks_response.go | 158 + model_locked_head_request.go | 320 + model_locked_request_queue_head.go | 350 + model_metamorph.go | 265 + model_monthly_usage.go | 272 + model_monthly_usage_response.go | 158 + model_pagination_response.go | 275 + model_pay_per_event_actor_pricing_info.go | 500 + ...r_pricing_info_all_of_pricing_per_event.go | 126 + model_plan.go | 880 + ...ice_per_dataset_item_actor_pricing_info.go | 529 + model_price_tiers.go | 270 + model_private_user_data_response.go | 158 + model_profile.go | 306 + model_prolong_request_lock_response.go | 158 + model_proxy.go | 186 + model_proxy_group.go | 216 + model_public_user_data_response.go | 158 + model_put_item_response_error.go | 158 + model_request.go | 543 + model_request_base.go | 538 + model_request_base_payload.go | 94 + model_request_draft.go | 261 + model_request_draft_delete.go | 107 + model_request_draft_delete_by_id.go | 196 + model_request_draft_delete_by_unique_key.go | 196 + model_request_lock_info.go | 160 + model_request_queue.go | 634 + model_request_queue_head.go | 247 + model_request_queue_response.go | 158 + model_request_queue_short.go | 653 + model_request_queue_stats.go | 275 + model_request_registration.go | 217 + model_request_response.go | 158 + model_run.go | 1247 + model_run_failed_error_detail.go | 164 + model_run_meta.go | 347 + model_run_options.go | 324 + model_run_origin.go | 127 + model_run_response.go | 158 + model_run_short.go | 611 + model_run_stats.go | 728 + model_run_storage_ids.go | 198 + model_run_storage_ids_datasets.go | 156 + model_run_timeout_exceeded_error_detail.go | 164 + model_run_usage.go | 642 + model_run_usage_usd.go | 642 + model_schedule.go | 612 + model_schedule_action.go | 171 + model_schedule_action_run_actor.go | 310 + model_schedule_action_run_actor_task.go | 255 + model_schedule_action_run_input.go | 182 + model_schedule_action_short.go | 171 + model_schedule_action_short_run_actor.go | 218 + model_schedule_action_short_run_actor_task.go | 218 + model_schedule_base.go | 475 + model_schedule_create.go | 450 + model_schedule_create_action.go | 171 + model_schedule_create_action_run_actor.go | 282 + ...l_schedule_create_action_run_actor_task.go | 227 + model_schedule_invoked.go | 215 + model_schedule_log_response.go | 159 + model_schedule_notifications.go | 126 + model_schedule_response.go | 158 + model_schedule_short.go | 484 + model_schema_validation_error_data.go | 159 + model_source_code_file.go | 230 + model_source_code_file_format.go | 111 + model_source_code_folder.go | 188 + model_storage_ownership.go | 111 + model_store_list_actor.go | 802 + model_tagged_build_info.go | 249 + model_tagged_builds_value.go | 94 + model_task.go | 659 + model_task_options.go | 366 + model_task_response.go | 158 + model_task_short.go | 483 + model_task_stats.go | 126 + model_test_webhook_response.go | 158 + ...l_tiered_pricing_per_dataset_item_entry.go | 159 + model_tiered_pricing_per_event_entry.go | 159 + model_unlock_requests_response.go | 158 + model_unlock_requests_result.go | 159 + model_update_actor_request.go | 764 + model_update_dataset_request.go | 172 + model_update_limits_request.go | 164 + model_update_request_queue_request.go | 173 + model_update_request_response.go | 158 + model_update_run_request.go | 234 + model_update_store_request.go | 172 + model_update_task_request.go | 302 + model_usage_cycle.go | 187 + model_usage_item.go | 295 + model_user_private_info.go | 383 + model_user_public_info.go | 194 + model_validation_error.go | 275 + model_version.go | 485 + model_version_response.go | 158 + model_version_source_files_inner.go | 107 + model_version_source_type.go | 117 + model_webhook.go | 723 + model_webhook_condition.go | 228 + model_webhook_create.go | 582 + model_webhook_dispatch.go | 417 + model_webhook_dispatch_response.go | 158 + model_webhook_dispatch_status.go | 113 + model_webhook_dispatch_webhook_summary.go | 234 + model_webhook_event_type.go | 131 + model_webhook_representation.go | 469 + model_webhook_response.go | 158 + model_webhook_short.go | 675 + model_webhook_stats.go | 158 + model_webhook_update.go | 542 + openapitools.json | 7 + response.go | 47 + test/api_actor_builds_test.go | 106 + test/api_actor_runs_test.go | 162 + test/api_actor_tasks_test.go | 231 + test/api_actors_actor_builds_test.go | 112 + test/api_actors_actor_runs_test.go | 183 + test/api_actors_actor_versions_test.go | 207 + test/api_actors_test.go | 105 + test/api_actors_webhook_collection_test.go | 39 + test/api_default_dataset_test.go | 108 + test/api_default_key_value_store_test.go | 153 + test/api_default_request_queue_test.go | 237 + test/api_last_actor_runs_abort_test.go | 39 + ...pi_last_actor_runs_default_dataset_test.go | 108 + ...actor_runs_default_key_value_store_test.go | 153 + ...t_actor_runs_default_request_queue_test.go | 237 + test/api_last_actor_runs_log_test.go | 39 + test/api_last_actor_runs_metamorph_test.go | 39 + test/api_last_actor_runs_reboot_test.go | 39 + test/api_last_actor_task_runs_abort_test.go | 39 + ...st_actor_task_runs_default_dataset_test.go | 108 + ..._task_runs_default_key_value_store_test.go | 153 + ...or_task_runs_default_request_queue_test.go | 237 + test/api_last_actor_task_runs_log_test.go | 39 + ...api_last_actor_task_runs_metamorph_test.go | 39 + test/api_last_actor_task_runs_reboot_test.go | 39 + test/api_logs_test.go | 39 + test/api_schedules_test.go | 105 + test/api_storage_datasets_test.go | 145 + test/api_storage_key_value_stores_test.go | 191 + ...rage_request_queues_requests_locks_test.go | 96 + ...pi_storage_request_queues_requests_test.go | 97 + test/api_storage_request_queues_test.go | 118 + test/api_store_test.go | 37 + test/api_tools_test.go | 97 + test/api_users_test.go | 87 + test/api_webhooks_webhook_dispatches_test.go | 51 + test/api_webhooks_webhooks_test.go | 119 + utils.go | 361 + 596 files changed, 204674 insertions(+), 28 deletions(-) create mode 100644 .openapi-generator-ignore create mode 100644 .openapi-generator/FILES create mode 100644 .openapi-generator/VERSION create mode 100644 .travis.yml create mode 100644 api/openapi.yaml create mode 100644 api_actor_builds.go create mode 100644 api_actor_runs.go create mode 100644 api_actor_tasks.go create mode 100644 api_actors.go create mode 100644 api_actors_actor_builds.go create mode 100644 api_actors_actor_runs.go create mode 100644 api_actors_actor_versions.go create mode 100644 api_actors_webhook_collection.go create mode 100644 api_default_dataset.go create mode 100644 api_default_key_value_store.go create mode 100644 api_default_request_queue.go create mode 100644 api_last_actor_runs_abort.go create mode 100644 api_last_actor_runs_default_dataset.go create mode 100644 api_last_actor_runs_default_key_value_store.go create mode 100644 api_last_actor_runs_default_request_queue.go create mode 100644 api_last_actor_runs_log.go create mode 100644 api_last_actor_runs_metamorph.go create mode 100644 api_last_actor_runs_reboot.go create mode 100644 api_last_actor_task_runs_abort.go create mode 100644 api_last_actor_task_runs_default_dataset.go create mode 100644 api_last_actor_task_runs_default_key_value_store.go create mode 100644 api_last_actor_task_runs_default_request_queue.go create mode 100644 api_last_actor_task_runs_log.go create mode 100644 api_last_actor_task_runs_metamorph.go create mode 100644 api_last_actor_task_runs_reboot.go create mode 100644 api_logs.go create mode 100644 api_schedules.go create mode 100644 api_storage_datasets.go create mode 100644 api_storage_key_value_stores.go create mode 100644 api_storage_request_queues.go create mode 100644 api_storage_request_queues_requests.go create mode 100644 api_storage_request_queues_requests_locks.go create mode 100644 api_store.go create mode 100644 api_tools.go create mode 100644 api_users.go create mode 100644 api_webhooks_webhook_dispatches.go create mode 100644 api_webhooks_webhooks.go create mode 100644 client.go create mode 100644 configuration.go create mode 100644 docs/AccountLimits.md create mode 100644 docs/ActRunsLastDatasetItemsPost400Response.md create mode 100644 docs/ActRunsLastDatasetItemsPostRequest.md create mode 100644 docs/ActValidateInputPost200Response.md create mode 100644 docs/Actor.md create mode 100644 docs/ActorBuildsAPI.md create mode 100644 docs/ActorChargeEvent.md create mode 100644 docs/ActorDefinition.md create mode 100644 docs/ActorDefinitionDefaultMemoryMbytes.md create mode 100644 docs/ActorDefinitionStorages.md create mode 100644 docs/ActorJobStatus.md create mode 100644 docs/ActorPermissionLevel.md create mode 100644 docs/ActorResponse.md create mode 100644 docs/ActorRunFailedError.md create mode 100644 docs/ActorRunPricingInfo.md create mode 100644 docs/ActorRunTimeoutExceededError.md create mode 100644 docs/ActorRunsAPI.md create mode 100644 docs/ActorShort.md create mode 100644 docs/ActorStandby.md create mode 100644 docs/ActorStats.md create mode 100644 docs/ActorStatsPublicActorRunStats30Days.md create mode 100644 docs/ActorTaskGet200Response.md create mode 100644 docs/ActorTaskRunsGet200Response.md create mode 100644 docs/ActorTaskRunsGet200ResponseData.md create mode 100644 docs/ActorTaskRunsPost201Response.md create mode 100644 docs/ActorTaskWebhooksGet200Response.md create mode 100644 docs/ActorTaskWebhooksGet200ResponseData.md create mode 100644 docs/ActorTasksAPI.md create mode 100644 docs/ActorsAPI.md create mode 100644 docs/ActorsActorBuildsAPI.md create mode 100644 docs/ActorsActorRunsAPI.md create mode 100644 docs/ActorsActorVersionsAPI.md create mode 100644 docs/ActorsWebhookCollectionAPI.md create mode 100644 docs/AddRequestResponse.md create mode 100644 docs/AddedRequest.md create mode 100644 docs/BatchAddResponse.md create mode 100644 docs/BatchAddResult.md create mode 100644 docs/BatchDeleteResponse.md create mode 100644 docs/BatchDeleteResult.md create mode 100644 docs/BrowserInfoResponse.md create mode 100644 docs/BrowserInfoResponseHeadersValue.md create mode 100644 docs/Build.md create mode 100644 docs/BuildActVersion.md create mode 100644 docs/BuildOptions.md create mode 100644 docs/BuildResponse.md create mode 100644 docs/BuildShort.md create mode 100644 docs/BuildStats.md create mode 100644 docs/BuildTag.md create mode 100644 docs/BuildUsage.md create mode 100644 docs/BuildsMeta.md create mode 100644 docs/CallsInner.md create mode 100644 docs/ChargeRunRequest.md create mode 100644 docs/CommonActorPricingInfo.md create mode 100644 docs/CreateActorRequest.md create mode 100644 docs/CreateOrUpdateVersionRequest.md create mode 100644 docs/CreateTaskRequest.md create mode 100644 docs/Current.md create mode 100644 docs/CurrentPricingInfo.md create mode 100644 docs/DailyServiceUsages.md create mode 100644 docs/Dataset.md create mode 100644 docs/DatasetFieldStatistics.md create mode 100644 docs/DatasetListItem.md create mode 100644 docs/DatasetResponse.md create mode 100644 docs/DatasetSchemaValidationError.md create mode 100644 docs/DatasetStatistics.md create mode 100644 docs/DatasetStatisticsResponse.md create mode 100644 docs/DatasetStats.md create mode 100644 docs/DecodeAndVerifyData.md create mode 100644 docs/DecodeAndVerifyRequest.md create mode 100644 docs/DecodeAndVerifyResponse.md create mode 100644 docs/DefaultDatasetAPI.md create mode 100644 docs/DefaultKeyValueStoreAPI.md create mode 100644 docs/DefaultRequestQueueAPI.md create mode 100644 docs/DefaultRunOptions.md create mode 100644 docs/DeletedRequest.md create mode 100644 docs/DeletedRequestById.md create mode 100644 docs/DeletedRequestByUniqueKey.md create mode 100644 docs/EffectivePlatformFeature.md create mode 100644 docs/EffectivePlatformFeatures.md create mode 100644 docs/EncodeAndSignData.md create mode 100644 docs/EncodeAndSignResponse.md create mode 100644 docs/EnvVar.md create mode 100644 docs/EnvVarRequest.md create mode 100644 docs/EnvVarResponse.md create mode 100644 docs/ErrorDetail.md create mode 100644 docs/ErrorResponse.md create mode 100644 docs/ErrorType.md create mode 100644 docs/EventData.md create mode 100644 docs/ExampleRunInput.md create mode 100644 docs/ExampleWebhookDispatch.md create mode 100644 docs/FlatPricePerMonthActorPricingInfo.md create mode 100644 docs/FreeActorPricingInfo.md create mode 100644 docs/GeneralAccess.md create mode 100644 docs/HeadAndLockResponse.md create mode 100644 docs/HeadRequest.md create mode 100644 docs/HeadResponse.md create mode 100644 docs/HttpMethod.md create mode 100644 docs/InvalidItem.md create mode 100644 docs/KeyValueStore.md create mode 100644 docs/KeyValueStoreKey.md create mode 100644 docs/KeyValueStoreResponse.md create mode 100644 docs/KeyValueStoreStats.md create mode 100644 docs/LastActorRunsAbortAPI.md create mode 100644 docs/LastActorRunsDefaultDatasetAPI.md create mode 100644 docs/LastActorRunsDefaultKeyValueStoreAPI.md create mode 100644 docs/LastActorRunsDefaultRequestQueueAPI.md create mode 100644 docs/LastActorRunsLogAPI.md create mode 100644 docs/LastActorRunsMetamorphAPI.md create mode 100644 docs/LastActorRunsRebootAPI.md create mode 100644 docs/LastActorTaskRunsAbortAPI.md create mode 100644 docs/LastActorTaskRunsDefaultDatasetAPI.md create mode 100644 docs/LastActorTaskRunsDefaultKeyValueStoreAPI.md create mode 100644 docs/LastActorTaskRunsDefaultRequestQueueAPI.md create mode 100644 docs/LastActorTaskRunsLogAPI.md create mode 100644 docs/LastActorTaskRunsMetamorphAPI.md create mode 100644 docs/LastActorTaskRunsRebootAPI.md create mode 100644 docs/Limits.md create mode 100644 docs/LimitsResponse.md create mode 100644 docs/ListOfActors.md create mode 100644 docs/ListOfActorsInStoreResponse.md create mode 100644 docs/ListOfActorsResponse.md create mode 100644 docs/ListOfBuilds.md create mode 100644 docs/ListOfBuildsResponse.md create mode 100644 docs/ListOfDatasets.md create mode 100644 docs/ListOfDatasetsResponse.md create mode 100644 docs/ListOfEnvVars.md create mode 100644 docs/ListOfEnvVarsResponse.md create mode 100644 docs/ListOfKeyValueStores.md create mode 100644 docs/ListOfKeyValueStoresResponse.md create mode 100644 docs/ListOfKeys.md create mode 100644 docs/ListOfKeysResponse.md create mode 100644 docs/ListOfRequestQueues.md create mode 100644 docs/ListOfRequestQueuesResponse.md create mode 100644 docs/ListOfRequests.md create mode 100644 docs/ListOfRequestsResponse.md create mode 100644 docs/ListOfRuns.md create mode 100644 docs/ListOfRunsResponse.md create mode 100644 docs/ListOfSchedules.md create mode 100644 docs/ListOfSchedulesResponse.md create mode 100644 docs/ListOfStoreActors.md create mode 100644 docs/ListOfTasks.md create mode 100644 docs/ListOfTasksResponse.md create mode 100644 docs/ListOfVersions.md create mode 100644 docs/ListOfVersionsResponse.md create mode 100644 docs/ListOfWebhookDispatches.md create mode 100644 docs/ListOfWebhookDispatchesResponse.md create mode 100644 docs/ListOfWebhooks.md create mode 100644 docs/ListOfWebhooksResponse.md create mode 100644 docs/LockedHeadRequest.md create mode 100644 docs/LockedRequestQueueHead.md create mode 100644 docs/LogsAPI.md create mode 100644 docs/Metamorph.md create mode 100644 docs/MonthlyUsage.md create mode 100644 docs/MonthlyUsageResponse.md create mode 100644 docs/PaginationResponse.md create mode 100644 docs/PayPerEventActorPricingInfo.md create mode 100644 docs/PayPerEventActorPricingInfoAllOfPricingPerEvent.md create mode 100644 docs/Plan.md create mode 100644 docs/PricePerDatasetItemActorPricingInfo.md create mode 100644 docs/PriceTiers.md create mode 100644 docs/PrivateUserDataResponse.md create mode 100644 docs/Profile.md create mode 100644 docs/ProlongRequestLockResponse.md create mode 100644 docs/Proxy.md create mode 100644 docs/ProxyGroup.md create mode 100644 docs/PublicUserDataResponse.md create mode 100644 docs/PutItemResponseError.md create mode 100644 docs/Request.md create mode 100644 docs/RequestBase.md create mode 100644 docs/RequestBasePayload.md create mode 100644 docs/RequestDraft.md create mode 100644 docs/RequestDraftDelete.md create mode 100644 docs/RequestDraftDeleteById.md create mode 100644 docs/RequestDraftDeleteByUniqueKey.md create mode 100644 docs/RequestLockInfo.md create mode 100644 docs/RequestQueue.md create mode 100644 docs/RequestQueueHead.md create mode 100644 docs/RequestQueueResponse.md create mode 100644 docs/RequestQueueShort.md create mode 100644 docs/RequestQueueStats.md create mode 100644 docs/RequestRegistration.md create mode 100644 docs/RequestResponse.md create mode 100644 docs/Run.md create mode 100644 docs/RunFailedErrorDetail.md create mode 100644 docs/RunMeta.md create mode 100644 docs/RunOptions.md create mode 100644 docs/RunOrigin.md create mode 100644 docs/RunResponse.md create mode 100644 docs/RunShort.md create mode 100644 docs/RunStats.md create mode 100644 docs/RunStorageIds.md create mode 100644 docs/RunStorageIdsDatasets.md create mode 100644 docs/RunTimeoutExceededErrorDetail.md create mode 100644 docs/RunUsage.md create mode 100644 docs/RunUsageUsd.md create mode 100644 docs/Schedule.md create mode 100644 docs/ScheduleAction.md create mode 100644 docs/ScheduleActionRunActor.md create mode 100644 docs/ScheduleActionRunActorTask.md create mode 100644 docs/ScheduleActionRunInput.md create mode 100644 docs/ScheduleActionShort.md create mode 100644 docs/ScheduleActionShortRunActor.md create mode 100644 docs/ScheduleActionShortRunActorTask.md create mode 100644 docs/ScheduleBase.md create mode 100644 docs/ScheduleCreate.md create mode 100644 docs/ScheduleCreateAction.md create mode 100644 docs/ScheduleCreateActionRunActor.md create mode 100644 docs/ScheduleCreateActionRunActorTask.md create mode 100644 docs/ScheduleInvoked.md create mode 100644 docs/ScheduleLogResponse.md create mode 100644 docs/ScheduleNotifications.md create mode 100644 docs/ScheduleResponse.md create mode 100644 docs/ScheduleShort.md create mode 100644 docs/SchedulesAPI.md create mode 100644 docs/SchemaValidationErrorData.md create mode 100644 docs/SourceCodeFile.md create mode 100644 docs/SourceCodeFileFormat.md create mode 100644 docs/SourceCodeFolder.md create mode 100644 docs/StorageDatasetsAPI.md create mode 100644 docs/StorageKeyValueStoresAPI.md create mode 100644 docs/StorageOwnership.md create mode 100644 docs/StorageRequestQueuesAPI.md create mode 100644 docs/StorageRequestQueuesRequestsAPI.md create mode 100644 docs/StorageRequestQueuesRequestsLocksAPI.md create mode 100644 docs/StoreAPI.md create mode 100644 docs/StoreListActor.md create mode 100644 docs/TaggedBuildInfo.md create mode 100644 docs/TaggedBuildsValue.md create mode 100644 docs/Task.md create mode 100644 docs/TaskOptions.md create mode 100644 docs/TaskResponse.md create mode 100644 docs/TaskShort.md create mode 100644 docs/TaskStats.md create mode 100644 docs/TestWebhookResponse.md create mode 100644 docs/TieredPricingPerDatasetItemEntry.md create mode 100644 docs/TieredPricingPerEventEntry.md create mode 100644 docs/ToolsAPI.md create mode 100644 docs/UnlockRequestsResponse.md create mode 100644 docs/UnlockRequestsResult.md create mode 100644 docs/UpdateActorRequest.md create mode 100644 docs/UpdateDatasetRequest.md create mode 100644 docs/UpdateLimitsRequest.md create mode 100644 docs/UpdateRequestQueueRequest.md create mode 100644 docs/UpdateRequestResponse.md create mode 100644 docs/UpdateRunRequest.md create mode 100644 docs/UpdateStoreRequest.md create mode 100644 docs/UpdateTaskRequest.md create mode 100644 docs/UsageCycle.md create mode 100644 docs/UsageItem.md create mode 100644 docs/UserPrivateInfo.md create mode 100644 docs/UserPublicInfo.md create mode 100644 docs/UsersAPI.md create mode 100644 docs/ValidationError.md create mode 100644 docs/Version.md create mode 100644 docs/VersionResponse.md create mode 100644 docs/VersionSourceFilesInner.md create mode 100644 docs/VersionSourceType.md create mode 100644 docs/Webhook.md create mode 100644 docs/WebhookCondition.md create mode 100644 docs/WebhookCreate.md create mode 100644 docs/WebhookDispatch.md create mode 100644 docs/WebhookDispatchResponse.md create mode 100644 docs/WebhookDispatchStatus.md create mode 100644 docs/WebhookDispatchWebhookSummary.md create mode 100644 docs/WebhookEventType.md create mode 100644 docs/WebhookRepresentation.md create mode 100644 docs/WebhookResponse.md create mode 100644 docs/WebhookShort.md create mode 100644 docs/WebhookStats.md create mode 100644 docs/WebhookUpdate.md create mode 100644 docs/WebhooksWebhookDispatchesAPI.md create mode 100644 docs/WebhooksWebhooksAPI.md create mode 100644 git_push.sh create mode 100644 go.mod create mode 100644 go.sum create mode 100644 model_account_limits.go create mode 100644 model_act_runs_last_dataset_items_post_400_response.go create mode 100644 model_act_runs_last_dataset_items_post_request.go create mode 100644 model_act_validate_input_post_200_response.go create mode 100644 model_actor.go create mode 100644 model_actor_charge_event.go create mode 100644 model_actor_definition.go create mode 100644 model_actor_definition_default_memory_mbytes.go create mode 100644 model_actor_definition_storages.go create mode 100644 model_actor_job_status.go create mode 100644 model_actor_permission_level.go create mode 100644 model_actor_response.go create mode 100644 model_actor_run_failed_error.go create mode 100644 model_actor_run_pricing_info.go create mode 100644 model_actor_run_timeout_exceeded_error.go create mode 100644 model_actor_short.go create mode 100644 model_actor_standby.go create mode 100644 model_actor_stats.go create mode 100644 model_actor_stats_public_actor_run_stats30_days.go create mode 100644 model_actor_task_get_200_response.go create mode 100644 model_actor_task_runs_get_200_response.go create mode 100644 model_actor_task_runs_get_200_response_data.go create mode 100644 model_actor_task_runs_post_201_response.go create mode 100644 model_actor_task_webhooks_get_200_response.go create mode 100644 model_actor_task_webhooks_get_200_response_data.go create mode 100644 model_add_request_response.go create mode 100644 model_added_request.go create mode 100644 model_batch_add_response.go create mode 100644 model_batch_add_result.go create mode 100644 model_batch_delete_response.go create mode 100644 model_batch_delete_result.go create mode 100644 model_browser_info_response.go create mode 100644 model_browser_info_response_headers_value.go create mode 100644 model_build.go create mode 100644 model_build_act_version.go create mode 100644 model_build_options.go create mode 100644 model_build_response.go create mode 100644 model_build_short.go create mode 100644 model_build_stats.go create mode 100644 model_build_tag.go create mode 100644 model_build_usage.go create mode 100644 model_builds_meta.go create mode 100644 model_calls_inner.go create mode 100644 model_charge_run_request.go create mode 100644 model_common_actor_pricing_info.go create mode 100644 model_create_actor_request.go create mode 100644 model_create_or_update_version_request.go create mode 100644 model_create_task_request.go create mode 100644 model_current.go create mode 100644 model_current_pricing_info.go create mode 100644 model_daily_service_usages.go create mode 100644 model_dataset.go create mode 100644 model_dataset_field_statistics.go create mode 100644 model_dataset_list_item.go create mode 100644 model_dataset_response.go create mode 100644 model_dataset_schema_validation_error.go create mode 100644 model_dataset_statistics.go create mode 100644 model_dataset_statistics_response.go create mode 100644 model_dataset_stats.go create mode 100644 model_decode_and_verify_data.go create mode 100644 model_decode_and_verify_request.go create mode 100644 model_decode_and_verify_response.go create mode 100644 model_default_run_options.go create mode 100644 model_deleted_request.go create mode 100644 model_deleted_request_by_id.go create mode 100644 model_deleted_request_by_unique_key.go create mode 100644 model_effective_platform_feature.go create mode 100644 model_effective_platform_features.go create mode 100644 model_encode_and_sign_data.go create mode 100644 model_encode_and_sign_response.go create mode 100644 model_env_var.go create mode 100644 model_env_var_request.go create mode 100644 model_env_var_response.go create mode 100644 model_error_detail.go create mode 100644 model_error_response.go create mode 100644 model_error_type.go create mode 100644 model_event_data.go create mode 100644 model_example_run_input.go create mode 100644 model_example_webhook_dispatch.go create mode 100644 model_flat_price_per_month_actor_pricing_info.go create mode 100644 model_free_actor_pricing_info.go create mode 100644 model_general_access.go create mode 100644 model_head_and_lock_response.go create mode 100644 model_head_request.go create mode 100644 model_head_response.go create mode 100644 model_http_method.go create mode 100644 model_invalid_item.go create mode 100644 model_key_value_store.go create mode 100644 model_key_value_store_key.go create mode 100644 model_key_value_store_response.go create mode 100644 model_key_value_store_stats.go create mode 100644 model_limits.go create mode 100644 model_limits_response.go create mode 100644 model_list_of_actors.go create mode 100644 model_list_of_actors_in_store_response.go create mode 100644 model_list_of_actors_response.go create mode 100644 model_list_of_builds.go create mode 100644 model_list_of_builds_response.go create mode 100644 model_list_of_datasets.go create mode 100644 model_list_of_datasets_response.go create mode 100644 model_list_of_env_vars.go create mode 100644 model_list_of_env_vars_response.go create mode 100644 model_list_of_key_value_stores.go create mode 100644 model_list_of_key_value_stores_response.go create mode 100644 model_list_of_keys.go create mode 100644 model_list_of_keys_response.go create mode 100644 model_list_of_request_queues.go create mode 100644 model_list_of_request_queues_response.go create mode 100644 model_list_of_requests.go create mode 100644 model_list_of_requests_response.go create mode 100644 model_list_of_runs.go create mode 100644 model_list_of_runs_response.go create mode 100644 model_list_of_schedules.go create mode 100644 model_list_of_schedules_response.go create mode 100644 model_list_of_store_actors.go create mode 100644 model_list_of_tasks.go create mode 100644 model_list_of_tasks_response.go create mode 100644 model_list_of_versions.go create mode 100644 model_list_of_versions_response.go create mode 100644 model_list_of_webhook_dispatches.go create mode 100644 model_list_of_webhook_dispatches_response.go create mode 100644 model_list_of_webhooks.go create mode 100644 model_list_of_webhooks_response.go create mode 100644 model_locked_head_request.go create mode 100644 model_locked_request_queue_head.go create mode 100644 model_metamorph.go create mode 100644 model_monthly_usage.go create mode 100644 model_monthly_usage_response.go create mode 100644 model_pagination_response.go create mode 100644 model_pay_per_event_actor_pricing_info.go create mode 100644 model_pay_per_event_actor_pricing_info_all_of_pricing_per_event.go create mode 100644 model_plan.go create mode 100644 model_price_per_dataset_item_actor_pricing_info.go create mode 100644 model_price_tiers.go create mode 100644 model_private_user_data_response.go create mode 100644 model_profile.go create mode 100644 model_prolong_request_lock_response.go create mode 100644 model_proxy.go create mode 100644 model_proxy_group.go create mode 100644 model_public_user_data_response.go create mode 100644 model_put_item_response_error.go create mode 100644 model_request.go create mode 100644 model_request_base.go create mode 100644 model_request_base_payload.go create mode 100644 model_request_draft.go create mode 100644 model_request_draft_delete.go create mode 100644 model_request_draft_delete_by_id.go create mode 100644 model_request_draft_delete_by_unique_key.go create mode 100644 model_request_lock_info.go create mode 100644 model_request_queue.go create mode 100644 model_request_queue_head.go create mode 100644 model_request_queue_response.go create mode 100644 model_request_queue_short.go create mode 100644 model_request_queue_stats.go create mode 100644 model_request_registration.go create mode 100644 model_request_response.go create mode 100644 model_run.go create mode 100644 model_run_failed_error_detail.go create mode 100644 model_run_meta.go create mode 100644 model_run_options.go create mode 100644 model_run_origin.go create mode 100644 model_run_response.go create mode 100644 model_run_short.go create mode 100644 model_run_stats.go create mode 100644 model_run_storage_ids.go create mode 100644 model_run_storage_ids_datasets.go create mode 100644 model_run_timeout_exceeded_error_detail.go create mode 100644 model_run_usage.go create mode 100644 model_run_usage_usd.go create mode 100644 model_schedule.go create mode 100644 model_schedule_action.go create mode 100644 model_schedule_action_run_actor.go create mode 100644 model_schedule_action_run_actor_task.go create mode 100644 model_schedule_action_run_input.go create mode 100644 model_schedule_action_short.go create mode 100644 model_schedule_action_short_run_actor.go create mode 100644 model_schedule_action_short_run_actor_task.go create mode 100644 model_schedule_base.go create mode 100644 model_schedule_create.go create mode 100644 model_schedule_create_action.go create mode 100644 model_schedule_create_action_run_actor.go create mode 100644 model_schedule_create_action_run_actor_task.go create mode 100644 model_schedule_invoked.go create mode 100644 model_schedule_log_response.go create mode 100644 model_schedule_notifications.go create mode 100644 model_schedule_response.go create mode 100644 model_schedule_short.go create mode 100644 model_schema_validation_error_data.go create mode 100644 model_source_code_file.go create mode 100644 model_source_code_file_format.go create mode 100644 model_source_code_folder.go create mode 100644 model_storage_ownership.go create mode 100644 model_store_list_actor.go create mode 100644 model_tagged_build_info.go create mode 100644 model_tagged_builds_value.go create mode 100644 model_task.go create mode 100644 model_task_options.go create mode 100644 model_task_response.go create mode 100644 model_task_short.go create mode 100644 model_task_stats.go create mode 100644 model_test_webhook_response.go create mode 100644 model_tiered_pricing_per_dataset_item_entry.go create mode 100644 model_tiered_pricing_per_event_entry.go create mode 100644 model_unlock_requests_response.go create mode 100644 model_unlock_requests_result.go create mode 100644 model_update_actor_request.go create mode 100644 model_update_dataset_request.go create mode 100644 model_update_limits_request.go create mode 100644 model_update_request_queue_request.go create mode 100644 model_update_request_response.go create mode 100644 model_update_run_request.go create mode 100644 model_update_store_request.go create mode 100644 model_update_task_request.go create mode 100644 model_usage_cycle.go create mode 100644 model_usage_item.go create mode 100644 model_user_private_info.go create mode 100644 model_user_public_info.go create mode 100644 model_validation_error.go create mode 100644 model_version.go create mode 100644 model_version_response.go create mode 100644 model_version_source_files_inner.go create mode 100644 model_version_source_type.go create mode 100644 model_webhook.go create mode 100644 model_webhook_condition.go create mode 100644 model_webhook_create.go create mode 100644 model_webhook_dispatch.go create mode 100644 model_webhook_dispatch_response.go create mode 100644 model_webhook_dispatch_status.go create mode 100644 model_webhook_dispatch_webhook_summary.go create mode 100644 model_webhook_event_type.go create mode 100644 model_webhook_representation.go create mode 100644 model_webhook_response.go create mode 100644 model_webhook_short.go create mode 100644 model_webhook_stats.go create mode 100644 model_webhook_update.go create mode 100644 openapitools.json create mode 100644 response.go create mode 100644 test/api_actor_builds_test.go create mode 100644 test/api_actor_runs_test.go create mode 100644 test/api_actor_tasks_test.go create mode 100644 test/api_actors_actor_builds_test.go create mode 100644 test/api_actors_actor_runs_test.go create mode 100644 test/api_actors_actor_versions_test.go create mode 100644 test/api_actors_test.go create mode 100644 test/api_actors_webhook_collection_test.go create mode 100644 test/api_default_dataset_test.go create mode 100644 test/api_default_key_value_store_test.go create mode 100644 test/api_default_request_queue_test.go create mode 100644 test/api_last_actor_runs_abort_test.go create mode 100644 test/api_last_actor_runs_default_dataset_test.go create mode 100644 test/api_last_actor_runs_default_key_value_store_test.go create mode 100644 test/api_last_actor_runs_default_request_queue_test.go create mode 100644 test/api_last_actor_runs_log_test.go create mode 100644 test/api_last_actor_runs_metamorph_test.go create mode 100644 test/api_last_actor_runs_reboot_test.go create mode 100644 test/api_last_actor_task_runs_abort_test.go create mode 100644 test/api_last_actor_task_runs_default_dataset_test.go create mode 100644 test/api_last_actor_task_runs_default_key_value_store_test.go create mode 100644 test/api_last_actor_task_runs_default_request_queue_test.go create mode 100644 test/api_last_actor_task_runs_log_test.go create mode 100644 test/api_last_actor_task_runs_metamorph_test.go create mode 100644 test/api_last_actor_task_runs_reboot_test.go create mode 100644 test/api_logs_test.go create mode 100644 test/api_schedules_test.go create mode 100644 test/api_storage_datasets_test.go create mode 100644 test/api_storage_key_value_stores_test.go create mode 100644 test/api_storage_request_queues_requests_locks_test.go create mode 100644 test/api_storage_request_queues_requests_test.go create mode 100644 test/api_storage_request_queues_test.go create mode 100644 test/api_store_test.go create mode 100644 test/api_tools_test.go create mode 100644 test/api_users_test.go create mode 100644 test/api_webhooks_webhook_dispatches_test.go create mode 100644 test/api_webhooks_webhooks_test.go create mode 100644 utils.go diff --git a/.gitignore b/.gitignore index aaadf73..daf913b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,32 +1,24 @@ -# If you prefer the allow list template instead of the deny list, see community template: -# https://github.com/github/gitignore/blob/main/community/Golang/Go.AllowList.gitignore -# -# Binaries for programs and plugins -*.exe -*.exe~ -*.dll +# Compiled Object files, Static and Dynamic libs (Shared Objects) +*.o +*.a *.so -*.dylib - -# Test binary, built with `go test -c` -*.test -# Code coverage profiles and other test artifacts -*.out -coverage.* -*.coverprofile -profile.cov +# Folders +_obj +_test -# Dependency directories (remove the comment below to include it) -# vendor/ +# Architecture specific extensions/prefixes +*.[568vq] +[568vq].out -# Go workspace file -go.work -go.work.sum +*.cgo1.go +*.cgo2.c +_cgo_defun.c +_cgo_gotypes.go +_cgo_export.* -# env file -.env +_testmain.go -# Editor/IDE -# .idea/ -# .vscode/ +*.exe +*.test +*.prof diff --git a/.openapi-generator-ignore b/.openapi-generator-ignore new file mode 100644 index 0000000..7484ee5 --- /dev/null +++ b/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES new file mode 100644 index 0000000..67cf02c --- /dev/null +++ b/.openapi-generator/FILES @@ -0,0 +1,593 @@ +.gitignore +.openapi-generator-ignore +.travis.yml +README.md +api/openapi.yaml +api_actor_builds.go +api_actor_runs.go +api_actor_tasks.go +api_actors.go +api_actors_actor_builds.go +api_actors_actor_runs.go +api_actors_actor_versions.go +api_actors_webhook_collection.go +api_default_dataset.go +api_default_key_value_store.go +api_default_request_queue.go +api_last_actor_runs_abort.go +api_last_actor_runs_default_dataset.go +api_last_actor_runs_default_key_value_store.go +api_last_actor_runs_default_request_queue.go +api_last_actor_runs_log.go +api_last_actor_runs_metamorph.go +api_last_actor_runs_reboot.go +api_last_actor_task_runs_abort.go +api_last_actor_task_runs_default_dataset.go +api_last_actor_task_runs_default_key_value_store.go +api_last_actor_task_runs_default_request_queue.go +api_last_actor_task_runs_log.go +api_last_actor_task_runs_metamorph.go +api_last_actor_task_runs_reboot.go +api_logs.go +api_schedules.go +api_storage_datasets.go +api_storage_key_value_stores.go +api_storage_request_queues.go +api_storage_request_queues_requests.go +api_storage_request_queues_requests_locks.go +api_store.go +api_tools.go +api_users.go +api_webhooks_webhook_dispatches.go +api_webhooks_webhooks.go +client.go +configuration.go +docs/AccountLimits.md +docs/ActRunsLastDatasetItemsPost400Response.md +docs/ActRunsLastDatasetItemsPostRequest.md +docs/ActValidateInputPost200Response.md +docs/Actor.md +docs/ActorBuildsAPI.md +docs/ActorChargeEvent.md +docs/ActorDefinition.md +docs/ActorDefinitionDefaultMemoryMbytes.md +docs/ActorDefinitionStorages.md +docs/ActorJobStatus.md +docs/ActorPermissionLevel.md +docs/ActorResponse.md +docs/ActorRunFailedError.md +docs/ActorRunPricingInfo.md +docs/ActorRunTimeoutExceededError.md +docs/ActorRunsAPI.md +docs/ActorShort.md +docs/ActorStandby.md +docs/ActorStats.md +docs/ActorStatsPublicActorRunStats30Days.md +docs/ActorTaskGet200Response.md +docs/ActorTaskRunsGet200Response.md +docs/ActorTaskRunsGet200ResponseData.md +docs/ActorTaskRunsPost201Response.md +docs/ActorTaskWebhooksGet200Response.md +docs/ActorTaskWebhooksGet200ResponseData.md +docs/ActorTasksAPI.md +docs/ActorsAPI.md +docs/ActorsActorBuildsAPI.md +docs/ActorsActorRunsAPI.md +docs/ActorsActorVersionsAPI.md +docs/ActorsWebhookCollectionAPI.md +docs/AddRequestResponse.md +docs/AddedRequest.md +docs/BatchAddResponse.md +docs/BatchAddResult.md +docs/BatchDeleteResponse.md +docs/BatchDeleteResult.md +docs/BrowserInfoResponse.md +docs/BrowserInfoResponseHeadersValue.md +docs/Build.md +docs/BuildActVersion.md +docs/BuildOptions.md +docs/BuildResponse.md +docs/BuildShort.md +docs/BuildStats.md +docs/BuildTag.md +docs/BuildUsage.md +docs/BuildsMeta.md +docs/CallsInner.md +docs/ChargeRunRequest.md +docs/CommonActorPricingInfo.md +docs/CreateActorRequest.md +docs/CreateOrUpdateVersionRequest.md +docs/CreateTaskRequest.md +docs/Current.md +docs/CurrentPricingInfo.md +docs/DailyServiceUsages.md +docs/Dataset.md +docs/DatasetFieldStatistics.md +docs/DatasetListItem.md +docs/DatasetResponse.md +docs/DatasetSchemaValidationError.md +docs/DatasetStatistics.md +docs/DatasetStatisticsResponse.md +docs/DatasetStats.md +docs/DecodeAndVerifyData.md +docs/DecodeAndVerifyRequest.md +docs/DecodeAndVerifyResponse.md +docs/DefaultDatasetAPI.md +docs/DefaultKeyValueStoreAPI.md +docs/DefaultRequestQueueAPI.md +docs/DefaultRunOptions.md +docs/DeletedRequest.md +docs/DeletedRequestById.md +docs/DeletedRequestByUniqueKey.md +docs/EffectivePlatformFeature.md +docs/EffectivePlatformFeatures.md +docs/EncodeAndSignData.md +docs/EncodeAndSignResponse.md +docs/EnvVar.md +docs/EnvVarRequest.md +docs/EnvVarResponse.md +docs/ErrorDetail.md +docs/ErrorResponse.md +docs/ErrorType.md +docs/EventData.md +docs/ExampleRunInput.md +docs/ExampleWebhookDispatch.md +docs/FlatPricePerMonthActorPricingInfo.md +docs/FreeActorPricingInfo.md +docs/GeneralAccess.md +docs/HeadAndLockResponse.md +docs/HeadRequest.md +docs/HeadResponse.md +docs/HttpMethod.md +docs/InvalidItem.md +docs/KeyValueStore.md +docs/KeyValueStoreKey.md +docs/KeyValueStoreResponse.md +docs/KeyValueStoreStats.md +docs/LastActorRunsAbortAPI.md +docs/LastActorRunsDefaultDatasetAPI.md +docs/LastActorRunsDefaultKeyValueStoreAPI.md +docs/LastActorRunsDefaultRequestQueueAPI.md +docs/LastActorRunsLogAPI.md +docs/LastActorRunsMetamorphAPI.md +docs/LastActorRunsRebootAPI.md +docs/LastActorTaskRunsAbortAPI.md +docs/LastActorTaskRunsDefaultDatasetAPI.md +docs/LastActorTaskRunsDefaultKeyValueStoreAPI.md +docs/LastActorTaskRunsDefaultRequestQueueAPI.md +docs/LastActorTaskRunsLogAPI.md +docs/LastActorTaskRunsMetamorphAPI.md +docs/LastActorTaskRunsRebootAPI.md +docs/Limits.md +docs/LimitsResponse.md +docs/ListOfActors.md +docs/ListOfActorsInStoreResponse.md +docs/ListOfActorsResponse.md +docs/ListOfBuilds.md +docs/ListOfBuildsResponse.md +docs/ListOfDatasets.md +docs/ListOfDatasetsResponse.md +docs/ListOfEnvVars.md +docs/ListOfEnvVarsResponse.md +docs/ListOfKeyValueStores.md +docs/ListOfKeyValueStoresResponse.md +docs/ListOfKeys.md +docs/ListOfKeysResponse.md +docs/ListOfRequestQueues.md +docs/ListOfRequestQueuesResponse.md +docs/ListOfRequests.md +docs/ListOfRequestsResponse.md +docs/ListOfRuns.md +docs/ListOfRunsResponse.md +docs/ListOfSchedules.md +docs/ListOfSchedulesResponse.md +docs/ListOfStoreActors.md +docs/ListOfTasks.md +docs/ListOfTasksResponse.md +docs/ListOfVersions.md +docs/ListOfVersionsResponse.md +docs/ListOfWebhookDispatches.md +docs/ListOfWebhookDispatchesResponse.md +docs/ListOfWebhooks.md +docs/ListOfWebhooksResponse.md +docs/LockedHeadRequest.md +docs/LockedRequestQueueHead.md +docs/LogsAPI.md +docs/Metamorph.md +docs/MonthlyUsage.md +docs/MonthlyUsageResponse.md +docs/PaginationResponse.md +docs/PayPerEventActorPricingInfo.md +docs/PayPerEventActorPricingInfoAllOfPricingPerEvent.md +docs/Plan.md +docs/PricePerDatasetItemActorPricingInfo.md +docs/PriceTiers.md +docs/PrivateUserDataResponse.md +docs/Profile.md +docs/ProlongRequestLockResponse.md +docs/Proxy.md +docs/ProxyGroup.md +docs/PublicUserDataResponse.md +docs/PutItemResponseError.md +docs/Request.md +docs/RequestBase.md +docs/RequestBasePayload.md +docs/RequestDraft.md +docs/RequestDraftDelete.md +docs/RequestDraftDeleteById.md +docs/RequestDraftDeleteByUniqueKey.md +docs/RequestLockInfo.md +docs/RequestQueue.md +docs/RequestQueueHead.md +docs/RequestQueueResponse.md +docs/RequestQueueShort.md +docs/RequestQueueStats.md +docs/RequestRegistration.md +docs/RequestResponse.md +docs/Run.md +docs/RunFailedErrorDetail.md +docs/RunMeta.md +docs/RunOptions.md +docs/RunOrigin.md +docs/RunResponse.md +docs/RunShort.md +docs/RunStats.md +docs/RunStorageIds.md +docs/RunStorageIdsDatasets.md +docs/RunTimeoutExceededErrorDetail.md +docs/RunUsage.md +docs/RunUsageUsd.md +docs/Schedule.md +docs/ScheduleAction.md +docs/ScheduleActionRunActor.md +docs/ScheduleActionRunActorTask.md +docs/ScheduleActionRunInput.md +docs/ScheduleActionShort.md +docs/ScheduleActionShortRunActor.md +docs/ScheduleActionShortRunActorTask.md +docs/ScheduleBase.md +docs/ScheduleCreate.md +docs/ScheduleCreateAction.md +docs/ScheduleCreateActionRunActor.md +docs/ScheduleCreateActionRunActorTask.md +docs/ScheduleInvoked.md +docs/ScheduleLogResponse.md +docs/ScheduleNotifications.md +docs/ScheduleResponse.md +docs/ScheduleShort.md +docs/SchedulesAPI.md +docs/SchemaValidationErrorData.md +docs/SourceCodeFile.md +docs/SourceCodeFileFormat.md +docs/SourceCodeFolder.md +docs/StorageDatasetsAPI.md +docs/StorageKeyValueStoresAPI.md +docs/StorageOwnership.md +docs/StorageRequestQueuesAPI.md +docs/StorageRequestQueuesRequestsAPI.md +docs/StorageRequestQueuesRequestsLocksAPI.md +docs/StoreAPI.md +docs/StoreListActor.md +docs/TaggedBuildInfo.md +docs/TaggedBuildsValue.md +docs/Task.md +docs/TaskOptions.md +docs/TaskResponse.md +docs/TaskShort.md +docs/TaskStats.md +docs/TestWebhookResponse.md +docs/TieredPricingPerDatasetItemEntry.md +docs/TieredPricingPerEventEntry.md +docs/ToolsAPI.md +docs/UnlockRequestsResponse.md +docs/UnlockRequestsResult.md +docs/UpdateActorRequest.md +docs/UpdateDatasetRequest.md +docs/UpdateLimitsRequest.md +docs/UpdateRequestQueueRequest.md +docs/UpdateRequestResponse.md +docs/UpdateRunRequest.md +docs/UpdateStoreRequest.md +docs/UpdateTaskRequest.md +docs/UsageCycle.md +docs/UsageItem.md +docs/UserPrivateInfo.md +docs/UserPublicInfo.md +docs/UsersAPI.md +docs/ValidationError.md +docs/Version.md +docs/VersionResponse.md +docs/VersionSourceFilesInner.md +docs/VersionSourceType.md +docs/Webhook.md +docs/WebhookCondition.md +docs/WebhookCreate.md +docs/WebhookDispatch.md +docs/WebhookDispatchResponse.md +docs/WebhookDispatchStatus.md +docs/WebhookDispatchWebhookSummary.md +docs/WebhookEventType.md +docs/WebhookRepresentation.md +docs/WebhookResponse.md +docs/WebhookShort.md +docs/WebhookStats.md +docs/WebhookUpdate.md +docs/WebhooksWebhookDispatchesAPI.md +docs/WebhooksWebhooksAPI.md +git_push.sh +go.mod +go.sum +model_account_limits.go +model_act_runs_last_dataset_items_post_400_response.go +model_act_runs_last_dataset_items_post_request.go +model_act_validate_input_post_200_response.go +model_actor.go +model_actor_charge_event.go +model_actor_definition.go +model_actor_definition_default_memory_mbytes.go +model_actor_definition_storages.go +model_actor_job_status.go +model_actor_permission_level.go +model_actor_response.go +model_actor_run_failed_error.go +model_actor_run_pricing_info.go +model_actor_run_timeout_exceeded_error.go +model_actor_short.go +model_actor_standby.go +model_actor_stats.go +model_actor_stats_public_actor_run_stats30_days.go +model_actor_task_get_200_response.go +model_actor_task_runs_get_200_response.go +model_actor_task_runs_get_200_response_data.go +model_actor_task_runs_post_201_response.go +model_actor_task_webhooks_get_200_response.go +model_actor_task_webhooks_get_200_response_data.go +model_add_request_response.go +model_added_request.go +model_batch_add_response.go +model_batch_add_result.go +model_batch_delete_response.go +model_batch_delete_result.go +model_browser_info_response.go +model_browser_info_response_headers_value.go +model_build.go +model_build_act_version.go +model_build_options.go +model_build_response.go +model_build_short.go +model_build_stats.go +model_build_tag.go +model_build_usage.go +model_builds_meta.go +model_calls_inner.go +model_charge_run_request.go +model_common_actor_pricing_info.go +model_create_actor_request.go +model_create_or_update_version_request.go +model_create_task_request.go +model_current.go +model_current_pricing_info.go +model_daily_service_usages.go +model_dataset.go +model_dataset_field_statistics.go +model_dataset_list_item.go +model_dataset_response.go +model_dataset_schema_validation_error.go +model_dataset_statistics.go +model_dataset_statistics_response.go +model_dataset_stats.go +model_decode_and_verify_data.go +model_decode_and_verify_request.go +model_decode_and_verify_response.go +model_default_run_options.go +model_deleted_request.go +model_deleted_request_by_id.go +model_deleted_request_by_unique_key.go +model_effective_platform_feature.go +model_effective_platform_features.go +model_encode_and_sign_data.go +model_encode_and_sign_response.go +model_env_var.go +model_env_var_request.go +model_env_var_response.go +model_error_detail.go +model_error_response.go +model_error_type.go +model_event_data.go +model_example_run_input.go +model_example_webhook_dispatch.go +model_flat_price_per_month_actor_pricing_info.go +model_free_actor_pricing_info.go +model_general_access.go +model_head_and_lock_response.go +model_head_request.go +model_head_response.go +model_http_method.go +model_invalid_item.go +model_key_value_store.go +model_key_value_store_key.go +model_key_value_store_response.go +model_key_value_store_stats.go +model_limits.go +model_limits_response.go +model_list_of_actors.go +model_list_of_actors_in_store_response.go +model_list_of_actors_response.go +model_list_of_builds.go +model_list_of_builds_response.go +model_list_of_datasets.go +model_list_of_datasets_response.go +model_list_of_env_vars.go +model_list_of_env_vars_response.go +model_list_of_key_value_stores.go +model_list_of_key_value_stores_response.go +model_list_of_keys.go +model_list_of_keys_response.go +model_list_of_request_queues.go +model_list_of_request_queues_response.go +model_list_of_requests.go +model_list_of_requests_response.go +model_list_of_runs.go +model_list_of_runs_response.go +model_list_of_schedules.go +model_list_of_schedules_response.go +model_list_of_store_actors.go +model_list_of_tasks.go +model_list_of_tasks_response.go +model_list_of_versions.go +model_list_of_versions_response.go +model_list_of_webhook_dispatches.go +model_list_of_webhook_dispatches_response.go +model_list_of_webhooks.go +model_list_of_webhooks_response.go +model_locked_head_request.go +model_locked_request_queue_head.go +model_metamorph.go +model_monthly_usage.go +model_monthly_usage_response.go +model_pagination_response.go +model_pay_per_event_actor_pricing_info.go +model_pay_per_event_actor_pricing_info_all_of_pricing_per_event.go +model_plan.go +model_price_per_dataset_item_actor_pricing_info.go +model_price_tiers.go +model_private_user_data_response.go +model_profile.go +model_prolong_request_lock_response.go +model_proxy.go +model_proxy_group.go +model_public_user_data_response.go +model_put_item_response_error.go +model_request.go +model_request_base.go +model_request_base_payload.go +model_request_draft.go +model_request_draft_delete.go +model_request_draft_delete_by_id.go +model_request_draft_delete_by_unique_key.go +model_request_lock_info.go +model_request_queue.go +model_request_queue_head.go +model_request_queue_response.go +model_request_queue_short.go +model_request_queue_stats.go +model_request_registration.go +model_request_response.go +model_run.go +model_run_failed_error_detail.go +model_run_meta.go +model_run_options.go +model_run_origin.go +model_run_response.go +model_run_short.go +model_run_stats.go +model_run_storage_ids.go +model_run_storage_ids_datasets.go +model_run_timeout_exceeded_error_detail.go +model_run_usage.go +model_run_usage_usd.go +model_schedule.go +model_schedule_action.go +model_schedule_action_run_actor.go +model_schedule_action_run_actor_task.go +model_schedule_action_run_input.go +model_schedule_action_short.go +model_schedule_action_short_run_actor.go +model_schedule_action_short_run_actor_task.go +model_schedule_base.go +model_schedule_create.go +model_schedule_create_action.go +model_schedule_create_action_run_actor.go +model_schedule_create_action_run_actor_task.go +model_schedule_invoked.go +model_schedule_log_response.go +model_schedule_notifications.go +model_schedule_response.go +model_schedule_short.go +model_schema_validation_error_data.go +model_source_code_file.go +model_source_code_file_format.go +model_source_code_folder.go +model_storage_ownership.go +model_store_list_actor.go +model_tagged_build_info.go +model_tagged_builds_value.go +model_task.go +model_task_options.go +model_task_response.go +model_task_short.go +model_task_stats.go +model_test_webhook_response.go +model_tiered_pricing_per_dataset_item_entry.go +model_tiered_pricing_per_event_entry.go +model_unlock_requests_response.go +model_unlock_requests_result.go +model_update_actor_request.go +model_update_dataset_request.go +model_update_limits_request.go +model_update_request_queue_request.go +model_update_request_response.go +model_update_run_request.go +model_update_store_request.go +model_update_task_request.go +model_usage_cycle.go +model_usage_item.go +model_user_private_info.go +model_user_public_info.go +model_validation_error.go +model_version.go +model_version_response.go +model_version_source_files_inner.go +model_version_source_type.go +model_webhook.go +model_webhook_condition.go +model_webhook_create.go +model_webhook_dispatch.go +model_webhook_dispatch_response.go +model_webhook_dispatch_status.go +model_webhook_dispatch_webhook_summary.go +model_webhook_event_type.go +model_webhook_representation.go +model_webhook_response.go +model_webhook_short.go +model_webhook_stats.go +model_webhook_update.go +response.go +test/api_actor_builds_test.go +test/api_actor_runs_test.go +test/api_actor_tasks_test.go +test/api_actors_actor_builds_test.go +test/api_actors_actor_runs_test.go +test/api_actors_actor_versions_test.go +test/api_actors_test.go +test/api_actors_webhook_collection_test.go +test/api_default_dataset_test.go +test/api_default_key_value_store_test.go +test/api_default_request_queue_test.go +test/api_last_actor_runs_abort_test.go +test/api_last_actor_runs_default_dataset_test.go +test/api_last_actor_runs_default_key_value_store_test.go +test/api_last_actor_runs_default_request_queue_test.go +test/api_last_actor_runs_log_test.go +test/api_last_actor_runs_metamorph_test.go +test/api_last_actor_runs_reboot_test.go +test/api_last_actor_task_runs_abort_test.go +test/api_last_actor_task_runs_default_dataset_test.go +test/api_last_actor_task_runs_default_key_value_store_test.go +test/api_last_actor_task_runs_default_request_queue_test.go +test/api_last_actor_task_runs_log_test.go +test/api_last_actor_task_runs_metamorph_test.go +test/api_last_actor_task_runs_reboot_test.go +test/api_logs_test.go +test/api_schedules_test.go +test/api_storage_datasets_test.go +test/api_storage_key_value_stores_test.go +test/api_storage_request_queues_requests_locks_test.go +test/api_storage_request_queues_requests_test.go +test/api_storage_request_queues_test.go +test/api_store_test.go +test/api_tools_test.go +test/api_users_test.go +test/api_webhooks_webhook_dispatches_test.go +test/api_webhooks_webhooks_test.go +utils.go diff --git a/.openapi-generator/VERSION b/.openapi-generator/VERSION new file mode 100644 index 0000000..14d6b5d --- /dev/null +++ b/.openapi-generator/VERSION @@ -0,0 +1 @@ +7.23.0 diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..f5cb2ce --- /dev/null +++ b/.travis.yml @@ -0,0 +1,8 @@ +language: go + +install: + - go get -d -v . + +script: + - go build -v ./ + diff --git a/README.md b/README.md index 9b27573..21c00e0 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,1088 @@ -# apify-client-go -Apify API client for Go—Programmatically run Actors, manage and stream data from storages (datasets, key-value stores, request queues), schedule and monitor runs, and access the full Apify platform API. Sync and async interfaces with automatic retries and pagination +# Go API client for apifyclient + + +The Apify API (version 2) provides programmatic access to the [Apify +platform](https://docs.apify.com). The API is organized +around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) +HTTP endpoints. + +You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). + +All requests and responses (including errors) are encoded in +[JSON](http://www.json.org/) format with UTF-8 encoding, +with a few exceptions that are explicitly described in the reference. + +- To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM +package](https://www.npmjs.com/package/apify-client). +- To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI +package](https://pypi.org/project/apify-client/). + +The clients' functions correspond to the API endpoints and have the same +parameters. This simplifies development of apps that depend on the Apify +platform. + +:::note Important Request Details + +- `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. + +- Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. + +::: + +## Authentication + + +**You can find your API token on the +[Integrations](https://console.apify.com/settings/integrations) page in the +Apify Console.** + +To use your token in a request, either: + +- Add the token to your request's `Authorization` header as `Bearer `. +E.g., `Authorization: Bearer xxxxxxx`. +[More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). +(Recommended). +- Add it as the `token` parameter to your request URL. (Less secure). + +Using your token in the request header is more secure than using it as a URL +parameter because URLs are often stored +in browser history and server logs. This creates a chance for someone +unauthorized to access your API token. + +**Never share your API token or password with untrusted parties!** + +For more information, see our +[integrations](https://docs.apify.com/platform/integrations) documentation. + +### Agentic payments + +AI agents can authenticate and pay for Actor runs without an Apify account +using agentic payments. Instead of an API token, the request carries a +payment credential that both authorizes and pays for the call. Apify supports +the [x402 protocol](https://docs.apify.com/platform/integrations/x402) +(`PAYMENT-SIGNATURE` header) and +[Skyfire](https://docs.apify.com/platform/integrations/skyfire) +(`skyfire-pay-id` header). + +## Basic usage + + +To run an Actor, send a POST request to the [Run +Actor](#/reference/actors/run-collection/run-actor) endpoint using either the +Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. +`janedoe~my-actor`): + +`https://api.apify.com/v2/actors/[actor_id]/runs` + +If the Actor is not runnable anonymously, you will receive a 401 or 403 +[response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). +This means you need to add your [secret API +token](https://console.apify.com/account#/integrations) to the request's +`Authorization` header ([recommended](#/introduction/authentication)) or as a +URL query parameter `?token=[your_token]` (less secure). + +Optionally, you can include the query parameters described in the [Run +Actor](#/reference/actors/run-collection/run-actor) section to customize your +run. + +If you're using Node.js, the best way to run an Actor is using the +`Apify.call()` method from the [Apify +SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It +runs the Actor using the account you are currently logged into (determined +by the [secret API token](https://console.apify.com/account#/integrations)). +The result is an [Actor run +object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if +any). + +A typical workflow is as follows: + +1. Run an Actor or task using the [Run +Actor](#/reference/actors/run-collection/run-actor) or [Run +task](#/reference/actor-tasks/run-collection/run-task) API endpoints. +2. Monitor the Actor run by periodically polling its progress using the [Get +run](#/reference/actor-runs/run-object-and-its-storages/get-run) API +endpoint. +3. Fetch the results from the [Get +items](#/reference/datasets/item-collection/get-items) API endpoint using the +`defaultDatasetId`, which you receive in the Run request response. +Additional data may be stored in a key-value store. You can fetch them from +the [Get record](#/reference/key-value-stores/record/get-record) API endpoint +using the `defaultKeyValueStoreId` and the store's `key`. + +**Note**: Instead of periodic polling, you can also run your +[Actor](#/reference/actors/run-actor-synchronously) or +[task](#/reference/actor-tasks/runs-collection/run-task-synchronously) +synchronously. This will ensure that the request waits for 300 seconds (5 +minutes) for the run to finish and returns its output. If the run takes +longer, the request will time out and throw an error. + +## Legacy `/v2/acts/` URL prefix + + +The `/v2/acts/` prefix is deprecated but still fully functional, and +such endpoint routes to the same handler as its `/v2/actors/...` counterpart. +New integrations should use the canonical /v2/actors/ prefix, +but existing clients keep working without changes. + +## Response structure + + +Most API endpoints return a JSON object with the `data` property: + +``` +{ + \"data\": { + ... + } +} +``` + +However, there are a few explicitly described exceptions, such as +[Get dataset items](#/reference/datasets/item-collection/get-items) or +Key-value store [Get record](#/reference/key-value-stores/record/get-record) +API endpoints, which return data in other formats. +In case of an error, the response has the HTTP status code in the range of +4xx or 5xx and the `data` property is replaced with `error`. For example: + +``` +{ + \"error\": { + \"type\": \"record-not-found\", + \"message\": \"Store was not found.\" + } +} +``` + +See [Errors](#/introduction/errors) for more details. + +## Pagination + + +All API endpoints that return a list of records +(e.g. [Get list of +Actors](#/reference/actors/actor-collection/get-list-of-actors)) +enforce pagination in order to limit the size of their responses. + +Most of these API endpoints are paginated using the `offset` and `limit` +query parameters. +The only exception is [Get list of +keys](#/reference/key-value-stores/key-collection/get-list-of-keys), +which is paginated using the `exclusiveStartKey` query parameter. + +**IMPORTANT**: Each API endpoint that supports pagination enforces a certain +maximum value for the `limit` parameter, +in order to reduce the load on Apify servers. +The maximum limit could change in future so you should never +rely on a specific value and check the responses of these API endpoints. + +### Using offset + + +Most API endpoints that return a list of records enable pagination using the +following query parameters: + + + + + + + + + + + + + + +
limitLimits the response to contain a specific maximum number of items, e.g. limit=20.
offsetSkips a number of items from the beginning of the list, e.g. offset=100.
desc + By default, items are sorted in the order in which they were created or added to the list. + This feature is useful when fetching all the items, because it ensures that items + created after the client started the pagination will not be skipped. + If you specify the desc=1 parameter, the items will be returned in the reverse order, + i.e. from the newest to the oldest items. +
+ +The response of these API endpoints is always a JSON object with the +following structure: + +``` +{ + \"data\": { + \"total\": 2560, + \"offset\": 250, + \"limit\": 1000, + \"count\": 1000, + \"desc\": false, + \"items\": [ + { 1st object }, + { 2nd object }, + ... + { 1000th object } + ] + } +} +``` + +The following table describes the meaning of the response properties: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
PropertyDescription
totalThe total number of items available in the list.
offsetThe number of items that were skipped at the start. + This is equal to the offset query parameter if it was provided, otherwise it is 0.
limitThe maximum number of items that can be returned in the HTTP response. + It equals to the limit query parameter if it was provided or + the maximum limit enforced for the particular API endpoint, whichever is smaller.
countThe actual number of items returned in the HTTP response.
desctrue if data were requested in descending order and false otherwise.
itemsAn array of requested items.
+ +### Using key + + +The records in the [key-value +store](https://docs.apify.com/platform/storage/key-value-store) +are not ordered based on numerical indexes, +but rather by their keys in the UTF-8 binary order. +Therefore the [Get list of +keys](#/reference/key-value-stores/key-collection/get-list-of-keys) +API endpoint only supports pagination using the following query parameters: + + + + + + + + + + +
limitLimits the response to contain a specific maximum number items, e.g. limit=20.
exclusiveStartKeySkips all records with keys up to the given key including the given key, + in the UTF-8 binary order.
+ +The response of the API endpoint is always a JSON object with following +structure: + +``` +{ + \"data\": { + \"limit\": 1000, + \"isTruncated\": true, + \"exclusiveStartKey\": \"my-key\", + \"nextExclusiveStartKey\": \"some-other-key\", + \"items\": [ + { 1st object }, + { 2nd object }, + ... + { 1000th object } + ] + } +} +``` + +The following table describes the meaning of the response properties: + + + + + + + + + + + + + + + + + + + + + + +
PropertyDescription
limitThe maximum number of items that can be returned in the HTTP response. + It equals to the limit query parameter if it was provided or + the maximum limit enforced for the particular endpoint, whichever is smaller.
isTruncatedtrue if there are more items left to be queried. Otherwise false.
exclusiveStartKeyThe last key that was skipped at the start. Is `null` for the first page.
nextExclusiveStartKeyThe value for the exclusiveStartKey parameter to query the next page of items.
+ +## Errors + + +The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` +range for errors caused by the caller +(invalid requests) and `5xx` range for server errors (these are rare). +Each error response contains a JSON object defining the `error` property, +which is an object with +the `type` and `message` properties that contain the error code and a +human-readable error description, respectively. + +For example: + +``` +{ + \"error\": { + \"type\": \"record-not-found\", + \"message\": \"Store was not found.\" + } +} +``` + +Here is the table of the most common errors that can occur for many API +endpoints: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
statustypemessage
400invalid-requestPOST data must be a JSON object
400invalid-valueInvalid value provided: Comments required
400invalid-record-keyRecord key contains invalid character
401token-not-providedAuthentication token was not provided
404record-not-foundStore was not found
429rate-limit-exceededYou have exceeded the rate limit of ... requests per second
405method-not-allowedThis API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST
+ +## Rate limiting + + +All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. + +There are two kinds of rate limits - a global rate limit and a per-resource rate limit. + +### Global rate limit + + +The global rate limit is set to _250 000 requests per minute_. +For [authenticated](#/introduction/authentication) requests, it is counted per user, +and for unauthenticated requests, it is counted per IP address. + +### Per-resource rate limit + + +The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. +The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. +Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. + +These endpoints have a rate limit of _200 requests per second per resource_: + +* CRUD ([get](#/reference/key-value-stores/record/get-record), + [put](#/reference/key-value-stores/record/put-record), + [delete](#/reference/key-value-stores/record/delete-record)) + operations on key-value store records + +These endpoints have a rate limit of _400 requests per second per resource_: +* [Run Actor](#/reference/actors/run-collection/run-actor) +* [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) +* [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) +* [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) +* [Push items](#/reference/datasets/item-collection/put-items) to dataset +* CRUD + ([add](#/reference/request-queues/request-collection/add-request), + [get](#/reference/request-queues/request-collection/get-request), + [update](#/reference/request-queues/request-collection/update-request), + [delete](#/reference/request-queues/request-collection/delete-request)) + operations on requests in request queues + +### Rate limit exceeded errors + + +If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` +and the following body: + +``` +{ + \"error\": { + \"type\": \"rate-limit-exceeded\", + \"message\": \"You have exceeded the rate limit of ... requests per second\" + } +} +``` + +### Retrying rate-limited requests with exponential backoff + + +If the client receives the rate limit error, it should wait a certain period of time and then retry the request. +If the error happens again, the client should double the wait period and retry the request, +and so on. This algorithm is known as _exponential backoff_ +and it can be described using the following pseudo-code: + +1. Define a variable `DELAY=500` +2. Send the HTTP request to the API endpoint +3. If the response has status code not equal to `429` then you are done. Otherwise: + * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds + * Double the future wait period by setting `DELAY = 2*DELAY` + * Continue with step 2 + +If all requests sent by the client implement the above steps, +the client will automatically use the maximum available bandwidth for its requests. + +Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) +and [for Python](https://docs.apify.com/api/client/python) +use the exponential backoff algorithm transparently, so that you do not need to worry about it. + +## Referring to resources + + +There are three main ways to refer to a resource you're accessing via API. + +- the resource ID (e.g. `iKkPcIgVvwmztduf8`) +- `username~resourcename` - when using this access method, you will need to +use your API token, and access will only work if you have the correct +permissions. +- `~resourcename` - for this, you need to use an API token, and the +`resourcename` refers to a resource in the API token owner's account. + + +## Overview +This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client. + +- API version: v2-2026-06-16T064758Z +- Package version: 1.0.0 +- Generator version: 7.23.0 +- Build package: org.openapitools.codegen.languages.GoClientCodegen + +## Installation + +Import the package in a go file in your project and run `go mod tidy`: + +```go +import apifyclient "github.com/apify/apify-client-go" +``` + +To use a proxy, set the environment variable `HTTP_PROXY`: + +```go +os.Setenv("HTTP_PROXY", "http://proxy_name:proxy_port") +``` + +## Configuration of Server URL + +Default configuration comes with `Servers` field that contains server objects as defined in the OpenAPI specification. + +### Select Server Configuration + +For using other server than the one defined on index 0 set context value `apifyclient.ContextServerIndex` of type `int`. + +```go +ctx := context.WithValue(context.Background(), apifyclient.ContextServerIndex, 1) +``` + +### Templated Server URL + +Templated server URL is formatted using default variables from configuration or from context value `apifyclient.ContextServerVariables` of type `map[string]string`. + +```go +ctx := context.WithValue(context.Background(), apifyclient.ContextServerVariables, map[string]string{ + "basePath": "v2", +}) +``` + +Note, enum values are always validated and all unused variables are silently ignored. + +### URLs Configuration per Operation + +Each operation can use different server URL defined using `OperationServers` map in the `Configuration`. +An operation is uniquely identified by `"{classname}Service.{nickname}"` string. +Similar rules for overriding default operation server index and variables applies by using `apifyclient.ContextOperationServerIndices` and `apifyclient.ContextOperationServerVariables` context maps. + +```go +ctx := context.WithValue(context.Background(), apifyclient.ContextOperationServerIndices, map[string]int{ + "{classname}Service.{nickname}": 2, +}) +ctx = context.WithValue(context.Background(), apifyclient.ContextOperationServerVariables, map[string]map[string]string{ + "{classname}Service.{nickname}": { + "port": "8443", + }, +}) +``` + +## Documentation for API Endpoints + +All URIs are relative to *https://api.apify.com* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*ActorBuildsAPI* | [**ActorBuildAbortPost**](docs/ActorBuildsAPI.md#actorbuildabortpost) | **Post** /v2/actor-builds/{buildId}/abort | Abort build +*ActorBuildsAPI* | [**ActorBuildDelete**](docs/ActorBuildsAPI.md#actorbuilddelete) | **Delete** /v2/actor-builds/{buildId} | Delete build +*ActorBuildsAPI* | [**ActorBuildGet**](docs/ActorBuildsAPI.md#actorbuildget) | **Get** /v2/actor-builds/{buildId} | Get build +*ActorBuildsAPI* | [**ActorBuildLogGet**](docs/ActorBuildsAPI.md#actorbuildlogget) | **Get** /v2/actor-builds/{buildId}/log | Get build's Log +*ActorBuildsAPI* | [**ActorBuildOpenapiJsonGet**](docs/ActorBuildsAPI.md#actorbuildopenapijsonget) | **Get** /v2/actor-builds/{buildId}/openapi.json | Get OpenAPI definition +*ActorBuildsAPI* | [**ActorBuildsGet**](docs/ActorBuildsAPI.md#actorbuildsget) | **Get** /v2/actor-builds | Get user builds list +*ActorRunsAPI* | [**ActorRunAbortPost**](docs/ActorRunsAPI.md#actorrunabortpost) | **Post** /v2/actor-runs/{runId}/abort | Abort run +*ActorRunsAPI* | [**ActorRunDelete**](docs/ActorRunsAPI.md#actorrundelete) | **Delete** /v2/actor-runs/{runId} | Delete run +*ActorRunsAPI* | [**ActorRunGet**](docs/ActorRunsAPI.md#actorrunget) | **Get** /v2/actor-runs/{runId} | Get run +*ActorRunsAPI* | [**ActorRunLogGet**](docs/ActorRunsAPI.md#actorrunlogget) | **Get** /v2/actor-runs/{runId}/log | Get run's log +*ActorRunsAPI* | [**ActorRunMetamorphPost**](docs/ActorRunsAPI.md#actorrunmetamorphpost) | **Post** /v2/actor-runs/{runId}/metamorph | Metamorph run +*ActorRunsAPI* | [**ActorRunPut**](docs/ActorRunsAPI.md#actorrunput) | **Put** /v2/actor-runs/{runId} | Update run +*ActorRunsAPI* | [**ActorRunRebootPost**](docs/ActorRunsAPI.md#actorrunrebootpost) | **Post** /v2/actor-runs/{runId}/reboot | Reboot run +*ActorRunsAPI* | [**ActorRunsGet**](docs/ActorRunsAPI.md#actorrunsget) | **Get** /v2/actor-runs | Get user runs list +*ActorRunsAPI* | [**PostChargeRun**](docs/ActorRunsAPI.md#postchargerun) | **Post** /v2/actor-runs/{runId}/charge | Charge events in run +*ActorRunsAPI* | [**PostResurrectRun**](docs/ActorRunsAPI.md#postresurrectrun) | **Post** /v2/actor-runs/{runId}/resurrect | Resurrect run +*ActorTasksAPI* | [**ActorTaskDelete**](docs/ActorTasksAPI.md#actortaskdelete) | **Delete** /v2/actor-tasks/{actorTaskId} | Delete task +*ActorTasksAPI* | [**ActorTaskGet**](docs/ActorTasksAPI.md#actortaskget) | **Get** /v2/actor-tasks/{actorTaskId} | Get task +*ActorTasksAPI* | [**ActorTaskInputGet**](docs/ActorTasksAPI.md#actortaskinputget) | **Get** /v2/actor-tasks/{actorTaskId}/input | Get task input +*ActorTasksAPI* | [**ActorTaskInputPut**](docs/ActorTasksAPI.md#actortaskinputput) | **Put** /v2/actor-tasks/{actorTaskId}/input | Update task input +*ActorTasksAPI* | [**ActorTaskPut**](docs/ActorTasksAPI.md#actortaskput) | **Put** /v2/actor-tasks/{actorTaskId} | Update task +*ActorTasksAPI* | [**ActorTaskRunSyncGet**](docs/ActorTasksAPI.md#actortaskrunsyncget) | **Get** /v2/actor-tasks/{actorTaskId}/run-sync | Run task synchronously +*ActorTasksAPI* | [**ActorTaskRunSyncGetDatasetItemsGet**](docs/ActorTasksAPI.md#actortaskrunsyncgetdatasetitemsget) | **Get** /v2/actor-tasks/{actorTaskId}/run-sync-get-dataset-items | Run task synchronously and get dataset items +*ActorTasksAPI* | [**ActorTaskRunSyncGetDatasetItemsPost**](docs/ActorTasksAPI.md#actortaskrunsyncgetdatasetitemspost) | **Post** /v2/actor-tasks/{actorTaskId}/run-sync-get-dataset-items | Run task synchronously and get dataset items +*ActorTasksAPI* | [**ActorTaskRunSyncPost**](docs/ActorTasksAPI.md#actortaskrunsyncpost) | **Post** /v2/actor-tasks/{actorTaskId}/run-sync | Run task synchronously +*ActorTasksAPI* | [**ActorTaskRunsGet**](docs/ActorTasksAPI.md#actortaskrunsget) | **Get** /v2/actor-tasks/{actorTaskId}/runs | Get list of task runs +*ActorTasksAPI* | [**ActorTaskRunsLastGet**](docs/ActorTasksAPI.md#actortaskrunslastget) | **Get** /v2/actor-tasks/{actorTaskId}/runs/last | Get last run +*ActorTasksAPI* | [**ActorTaskRunsPost**](docs/ActorTasksAPI.md#actortaskrunspost) | **Post** /v2/actor-tasks/{actorTaskId}/runs | Run task +*ActorTasksAPI* | [**ActorTaskWebhooksGet**](docs/ActorTasksAPI.md#actortaskwebhooksget) | **Get** /v2/actor-tasks/{actorTaskId}/webhooks | Get list of webhooks +*ActorTasksAPI* | [**ActorTasksGet**](docs/ActorTasksAPI.md#actortasksget) | **Get** /v2/actor-tasks | Get list of tasks +*ActorTasksAPI* | [**ActorTasksPost**](docs/ActorTasksAPI.md#actortaskspost) | **Post** /v2/actor-tasks | Create task +*ActorsAPI* | [**ActDelete**](docs/ActorsAPI.md#actdelete) | **Delete** /v2/actors/{actorId} | Delete Actor +*ActorsAPI* | [**ActGet**](docs/ActorsAPI.md#actget) | **Get** /v2/actors/{actorId} | Get Actor +*ActorsAPI* | [**ActPut**](docs/ActorsAPI.md#actput) | **Put** /v2/actors/{actorId} | Update Actor +*ActorsAPI* | [**ActValidateInputPost**](docs/ActorsAPI.md#actvalidateinputpost) | **Post** /v2/actors/{actorId}/validate-input | Validate Actor input +*ActorsAPI* | [**ActsGet**](docs/ActorsAPI.md#actsget) | **Get** /v2/actors | Get list of Actors +*ActorsAPI* | [**ActsPost**](docs/ActorsAPI.md#actspost) | **Post** /v2/actors | Create Actor +*ActorsActorBuildsAPI* | [**ActBuildAbortPost**](docs/ActorsActorBuildsAPI.md#actbuildabortpost) | **Post** /v2/actors/{actorId}/builds/{buildId}/abort | Abort build +*ActorsActorBuildsAPI* | [**ActBuildDefaultGet**](docs/ActorsActorBuildsAPI.md#actbuilddefaultget) | **Get** /v2/actors/{actorId}/builds/default | Get default build +*ActorsActorBuildsAPI* | [**ActBuildGet**](docs/ActorsActorBuildsAPI.md#actbuildget) | **Get** /v2/actors/{actorId}/builds/{buildId} | Get build +*ActorsActorBuildsAPI* | [**ActBuildsGet**](docs/ActorsActorBuildsAPI.md#actbuildsget) | **Get** /v2/actors/{actorId}/builds | Get list of builds +*ActorsActorBuildsAPI* | [**ActBuildsPost**](docs/ActorsActorBuildsAPI.md#actbuildspost) | **Post** /v2/actors/{actorId}/builds | Build Actor +*ActorsActorBuildsAPI* | [**ActOpenapiJsonGet**](docs/ActorsActorBuildsAPI.md#actopenapijsonget) | **Get** /v2/actors/{actorId}/builds/{buildId}/openapi.json | Get OpenAPI definition +*ActorsActorRunsAPI* | [**ActRunAbortPost**](docs/ActorsActorRunsAPI.md#actrunabortpost) | **Post** /v2/actors/{actorId}/runs/{runId}/abort | Abort run +*ActorsActorRunsAPI* | [**ActRunGet**](docs/ActorsActorRunsAPI.md#actrunget) | **Get** /v2/actors/{actorId}/runs/{runId} | Get run +*ActorsActorRunsAPI* | [**ActRunMetamorphPost**](docs/ActorsActorRunsAPI.md#actrunmetamorphpost) | **Post** /v2/actors/{actorId}/runs/{runId}/metamorph | Metamorph run +*ActorsActorRunsAPI* | [**ActRunResurrectPost**](docs/ActorsActorRunsAPI.md#actrunresurrectpost) | **Post** /v2/actors/{actorId}/runs/{runId}/resurrect | Resurrect run +*ActorsActorRunsAPI* | [**ActRunSyncGet**](docs/ActorsActorRunsAPI.md#actrunsyncget) | **Get** /v2/actors/{actorId}/run-sync | Run Actor synchronously without input +*ActorsActorRunsAPI* | [**ActRunSyncGetDatasetItemsGet**](docs/ActorsActorRunsAPI.md#actrunsyncgetdatasetitemsget) | **Get** /v2/actors/{actorId}/run-sync-get-dataset-items | Run Actor synchronously without input and get dataset items +*ActorsActorRunsAPI* | [**ActRunSyncGetDatasetItemsPost**](docs/ActorsActorRunsAPI.md#actrunsyncgetdatasetitemspost) | **Post** /v2/actors/{actorId}/run-sync-get-dataset-items | Run Actor synchronously and get dataset items +*ActorsActorRunsAPI* | [**ActRunSyncPost**](docs/ActorsActorRunsAPI.md#actrunsyncpost) | **Post** /v2/actors/{actorId}/run-sync | Run Actor synchronously and return output +*ActorsActorRunsAPI* | [**ActRunsGet**](docs/ActorsActorRunsAPI.md#actrunsget) | **Get** /v2/actors/{actorId}/runs | Get list of runs +*ActorsActorRunsAPI* | [**ActRunsLastGet**](docs/ActorsActorRunsAPI.md#actrunslastget) | **Get** /v2/actors/{actorId}/runs/last | Get last run +*ActorsActorRunsAPI* | [**ActRunsPost**](docs/ActorsActorRunsAPI.md#actrunspost) | **Post** /v2/actors/{actorId}/runs | Run Actor +*ActorsActorVersionsAPI* | [**ActVersionDelete**](docs/ActorsActorVersionsAPI.md#actversiondelete) | **Delete** /v2/actors/{actorId}/versions/{versionNumber} | Delete version +*ActorsActorVersionsAPI* | [**ActVersionEnvVarDelete**](docs/ActorsActorVersionsAPI.md#actversionenvvardelete) | **Delete** /v2/actors/{actorId}/versions/{versionNumber}/env-vars/{envVarName} | Delete environment variable +*ActorsActorVersionsAPI* | [**ActVersionEnvVarGet**](docs/ActorsActorVersionsAPI.md#actversionenvvarget) | **Get** /v2/actors/{actorId}/versions/{versionNumber}/env-vars/{envVarName} | Get environment variable +*ActorsActorVersionsAPI* | [**ActVersionEnvVarPost**](docs/ActorsActorVersionsAPI.md#actversionenvvarpost) | **Post** /v2/actors/{actorId}/versions/{versionNumber}/env-vars/{envVarName} | Update environment variable (POST) +*ActorsActorVersionsAPI* | [**ActVersionEnvVarPut**](docs/ActorsActorVersionsAPI.md#actversionenvvarput) | **Put** /v2/actors/{actorId}/versions/{versionNumber}/env-vars/{envVarName} | Update environment variable +*ActorsActorVersionsAPI* | [**ActVersionEnvVarsGet**](docs/ActorsActorVersionsAPI.md#actversionenvvarsget) | **Get** /v2/actors/{actorId}/versions/{versionNumber}/env-vars | Get list of environment variables +*ActorsActorVersionsAPI* | [**ActVersionEnvVarsPost**](docs/ActorsActorVersionsAPI.md#actversionenvvarspost) | **Post** /v2/actors/{actorId}/versions/{versionNumber}/env-vars | Create environment variable +*ActorsActorVersionsAPI* | [**ActVersionGet**](docs/ActorsActorVersionsAPI.md#actversionget) | **Get** /v2/actors/{actorId}/versions/{versionNumber} | Get version +*ActorsActorVersionsAPI* | [**ActVersionPost**](docs/ActorsActorVersionsAPI.md#actversionpost) | **Post** /v2/actors/{actorId}/versions/{versionNumber} | Update version (POST) +*ActorsActorVersionsAPI* | [**ActVersionPut**](docs/ActorsActorVersionsAPI.md#actversionput) | **Put** /v2/actors/{actorId}/versions/{versionNumber} | Update version +*ActorsActorVersionsAPI* | [**ActVersionsGet**](docs/ActorsActorVersionsAPI.md#actversionsget) | **Get** /v2/actors/{actorId}/versions | Get list of versions +*ActorsActorVersionsAPI* | [**ActVersionsPost**](docs/ActorsActorVersionsAPI.md#actversionspost) | **Post** /v2/actors/{actorId}/versions | Create version +*ActorsWebhookCollectionAPI* | [**ActWebhooksGet**](docs/ActorsWebhookCollectionAPI.md#actwebhooksget) | **Get** /v2/actors/{actorId}/webhooks | Get list of webhooks +*DefaultDatasetAPI* | [**ActorRunDatasetDelete**](docs/DefaultDatasetAPI.md#actorrundatasetdelete) | **Delete** /v2/actor-runs/{runId}/dataset | Delete default dataset +*DefaultDatasetAPI* | [**ActorRunDatasetGet**](docs/DefaultDatasetAPI.md#actorrundatasetget) | **Get** /v2/actor-runs/{runId}/dataset | Get default dataset +*DefaultDatasetAPI* | [**ActorRunDatasetItemsGet**](docs/DefaultDatasetAPI.md#actorrundatasetitemsget) | **Get** /v2/actor-runs/{runId}/dataset/items | Get default dataset items +*DefaultDatasetAPI* | [**ActorRunDatasetItemsPost**](docs/DefaultDatasetAPI.md#actorrundatasetitemspost) | **Post** /v2/actor-runs/{runId}/dataset/items | Store items +*DefaultDatasetAPI* | [**ActorRunDatasetPut**](docs/DefaultDatasetAPI.md#actorrundatasetput) | **Put** /v2/actor-runs/{runId}/dataset | Update default dataset +*DefaultDatasetAPI* | [**ActorRunDatasetStatisticsGet**](docs/DefaultDatasetAPI.md#actorrundatasetstatisticsget) | **Get** /v2/actor-runs/{runId}/dataset/statistics | Get default dataset statistics +*DefaultKeyValueStoreAPI* | [**ActorRunKeyValueStoreDelete**](docs/DefaultKeyValueStoreAPI.md#actorrunkeyvaluestoredelete) | **Delete** /v2/actor-runs/{runId}/key-value-store | Delete default store +*DefaultKeyValueStoreAPI* | [**ActorRunKeyValueStoreGet**](docs/DefaultKeyValueStoreAPI.md#actorrunkeyvaluestoreget) | **Get** /v2/actor-runs/{runId}/key-value-store | Get default store +*DefaultKeyValueStoreAPI* | [**ActorRunKeyValueStoreKeysGet**](docs/DefaultKeyValueStoreAPI.md#actorrunkeyvaluestorekeysget) | **Get** /v2/actor-runs/{runId}/key-value-store/keys | Get default store's list of keys +*DefaultKeyValueStoreAPI* | [**ActorRunKeyValueStorePut**](docs/DefaultKeyValueStoreAPI.md#actorrunkeyvaluestoreput) | **Put** /v2/actor-runs/{runId}/key-value-store | Update default store +*DefaultKeyValueStoreAPI* | [**ActorRunKeyValueStoreRecordDelete**](docs/DefaultKeyValueStoreAPI.md#actorrunkeyvaluestorerecorddelete) | **Delete** /v2/actor-runs/{runId}/key-value-store/records/{recordKey} | Delete default store's record +*DefaultKeyValueStoreAPI* | [**ActorRunKeyValueStoreRecordGet**](docs/DefaultKeyValueStoreAPI.md#actorrunkeyvaluestorerecordget) | **Get** /v2/actor-runs/{runId}/key-value-store/records/{recordKey} | Get default store's record +*DefaultKeyValueStoreAPI* | [**ActorRunKeyValueStoreRecordPost**](docs/DefaultKeyValueStoreAPI.md#actorrunkeyvaluestorerecordpost) | **Post** /v2/actor-runs/{runId}/key-value-store/records/{recordKey} | Store record in default store (POST) +*DefaultKeyValueStoreAPI* | [**ActorRunKeyValueStoreRecordPut**](docs/DefaultKeyValueStoreAPI.md#actorrunkeyvaluestorerecordput) | **Put** /v2/actor-runs/{runId}/key-value-store/records/{recordKey} | Store record in default store +*DefaultKeyValueStoreAPI* | [**ActorRunKeyValueStoreRecordsGet**](docs/DefaultKeyValueStoreAPI.md#actorrunkeyvaluestorerecordsget) | **Get** /v2/actor-runs/{runId}/key-value-store/records | Download default store's records +*DefaultRequestQueueAPI* | [**ActorRunRequestQueueDelete**](docs/DefaultRequestQueueAPI.md#actorrunrequestqueuedelete) | **Delete** /v2/actor-runs/{runId}/request-queue | Delete default request queue +*DefaultRequestQueueAPI* | [**ActorRunRequestQueueGet**](docs/DefaultRequestQueueAPI.md#actorrunrequestqueueget) | **Get** /v2/actor-runs/{runId}/request-queue | Get default request queue +*DefaultRequestQueueAPI* | [**ActorRunRequestQueueHeadGet**](docs/DefaultRequestQueueAPI.md#actorrunrequestqueueheadget) | **Get** /v2/actor-runs/{runId}/request-queue/head | Get default request queue head +*DefaultRequestQueueAPI* | [**ActorRunRequestQueueHeadLockPost**](docs/DefaultRequestQueueAPI.md#actorrunrequestqueueheadlockpost) | **Post** /v2/actor-runs/{runId}/request-queue/head/lock | Get and lock default request queue head +*DefaultRequestQueueAPI* | [**ActorRunRequestQueuePut**](docs/DefaultRequestQueueAPI.md#actorrunrequestqueueput) | **Put** /v2/actor-runs/{runId}/request-queue | Update default request queue +*DefaultRequestQueueAPI* | [**ActorRunRequestQueueRequestDelete**](docs/DefaultRequestQueueAPI.md#actorrunrequestqueuerequestdelete) | **Delete** /v2/actor-runs/{runId}/request-queue/requests/{requestId} | Delete request from default request queue +*DefaultRequestQueueAPI* | [**ActorRunRequestQueueRequestGet**](docs/DefaultRequestQueueAPI.md#actorrunrequestqueuerequestget) | **Get** /v2/actor-runs/{runId}/request-queue/requests/{requestId} | Get request from default request queue +*DefaultRequestQueueAPI* | [**ActorRunRequestQueueRequestLockDelete**](docs/DefaultRequestQueueAPI.md#actorrunrequestqueuerequestlockdelete) | **Delete** /v2/actor-runs/{runId}/request-queue/requests/{requestId}/lock | Delete lock on request in default request queue +*DefaultRequestQueueAPI* | [**ActorRunRequestQueueRequestLockPut**](docs/DefaultRequestQueueAPI.md#actorrunrequestqueuerequestlockput) | **Put** /v2/actor-runs/{runId}/request-queue/requests/{requestId}/lock | Prolong lock on request in default request queue +*DefaultRequestQueueAPI* | [**ActorRunRequestQueueRequestPut**](docs/DefaultRequestQueueAPI.md#actorrunrequestqueuerequestput) | **Put** /v2/actor-runs/{runId}/request-queue/requests/{requestId} | Update request in default request queue +*DefaultRequestQueueAPI* | [**ActorRunRequestQueueRequestsBatchDelete**](docs/DefaultRequestQueueAPI.md#actorrunrequestqueuerequestsbatchdelete) | **Delete** /v2/actor-runs/{runId}/request-queue/requests/batch | Batch delete requests from default request queue +*DefaultRequestQueueAPI* | [**ActorRunRequestQueueRequestsBatchPost**](docs/DefaultRequestQueueAPI.md#actorrunrequestqueuerequestsbatchpost) | **Post** /v2/actor-runs/{runId}/request-queue/requests/batch | Batch add requests to default request queue +*DefaultRequestQueueAPI* | [**ActorRunRequestQueueRequestsGet**](docs/DefaultRequestQueueAPI.md#actorrunrequestqueuerequestsget) | **Get** /v2/actor-runs/{runId}/request-queue/requests | List default request queue's requests +*DefaultRequestQueueAPI* | [**ActorRunRequestQueueRequestsPost**](docs/DefaultRequestQueueAPI.md#actorrunrequestqueuerequestspost) | **Post** /v2/actor-runs/{runId}/request-queue/requests | Add request to default request queue +*DefaultRequestQueueAPI* | [**ActorRunRequestQueueRequestsUnlockPost**](docs/DefaultRequestQueueAPI.md#actorrunrequestqueuerequestsunlockpost) | **Post** /v2/actor-runs/{runId}/request-queue/requests/unlock | Unlock requests in default request queue +*LastActorRunsAbortAPI* | [**ActRunsLastAbortPost**](docs/LastActorRunsAbortAPI.md#actrunslastabortpost) | **Post** /v2/actors/{actorId}/runs/last/abort | Abort Actor's last run +*LastActorRunsDefaultDatasetAPI* | [**ActRunsLastDatasetDelete**](docs/LastActorRunsDefaultDatasetAPI.md#actrunslastdatasetdelete) | **Delete** /v2/actors/{actorId}/runs/last/dataset | Delete last run's default dataset +*LastActorRunsDefaultDatasetAPI* | [**ActRunsLastDatasetGet**](docs/LastActorRunsDefaultDatasetAPI.md#actrunslastdatasetget) | **Get** /v2/actors/{actorId}/runs/last/dataset | Get last run's default dataset +*LastActorRunsDefaultDatasetAPI* | [**ActRunsLastDatasetItemsGet**](docs/LastActorRunsDefaultDatasetAPI.md#actrunslastdatasetitemsget) | **Get** /v2/actors/{actorId}/runs/last/dataset/items | Get last run's dataset items +*LastActorRunsDefaultDatasetAPI* | [**ActRunsLastDatasetItemsPost**](docs/LastActorRunsDefaultDatasetAPI.md#actrunslastdatasetitemspost) | **Post** /v2/actors/{actorId}/runs/last/dataset/items | Store items in last run's dataset +*LastActorRunsDefaultDatasetAPI* | [**ActRunsLastDatasetPut**](docs/LastActorRunsDefaultDatasetAPI.md#actrunslastdatasetput) | **Put** /v2/actors/{actorId}/runs/last/dataset | Update last run's default dataset +*LastActorRunsDefaultDatasetAPI* | [**ActRunsLastDatasetStatisticsGet**](docs/LastActorRunsDefaultDatasetAPI.md#actrunslastdatasetstatisticsget) | **Get** /v2/actors/{actorId}/runs/last/dataset/statistics | Get last run's dataset statistics +*LastActorRunsDefaultKeyValueStoreAPI* | [**ActRunsLastKeyValueStoreDelete**](docs/LastActorRunsDefaultKeyValueStoreAPI.md#actrunslastkeyvaluestoredelete) | **Delete** /v2/actors/{actorId}/runs/last/key-value-store | Delete last run's default store +*LastActorRunsDefaultKeyValueStoreAPI* | [**ActRunsLastKeyValueStoreGet**](docs/LastActorRunsDefaultKeyValueStoreAPI.md#actrunslastkeyvaluestoreget) | **Get** /v2/actors/{actorId}/runs/last/key-value-store | Get last run's default store +*LastActorRunsDefaultKeyValueStoreAPI* | [**ActRunsLastKeyValueStoreKeysGet**](docs/LastActorRunsDefaultKeyValueStoreAPI.md#actrunslastkeyvaluestorekeysget) | **Get** /v2/actors/{actorId}/runs/last/key-value-store/keys | Get last run's default store's list of keys +*LastActorRunsDefaultKeyValueStoreAPI* | [**ActRunsLastKeyValueStorePut**](docs/LastActorRunsDefaultKeyValueStoreAPI.md#actrunslastkeyvaluestoreput) | **Put** /v2/actors/{actorId}/runs/last/key-value-store | Update last run's default store +*LastActorRunsDefaultKeyValueStoreAPI* | [**ActRunsLastKeyValueStoreRecordDelete**](docs/LastActorRunsDefaultKeyValueStoreAPI.md#actrunslastkeyvaluestorerecorddelete) | **Delete** /v2/actors/{actorId}/runs/last/key-value-store/records/{recordKey} | Delete last run's default store's record +*LastActorRunsDefaultKeyValueStoreAPI* | [**ActRunsLastKeyValueStoreRecordGet**](docs/LastActorRunsDefaultKeyValueStoreAPI.md#actrunslastkeyvaluestorerecordget) | **Get** /v2/actors/{actorId}/runs/last/key-value-store/records/{recordKey} | Get last run's default store's record +*LastActorRunsDefaultKeyValueStoreAPI* | [**ActRunsLastKeyValueStoreRecordPost**](docs/LastActorRunsDefaultKeyValueStoreAPI.md#actrunslastkeyvaluestorerecordpost) | **Post** /v2/actors/{actorId}/runs/last/key-value-store/records/{recordKey} | Store record in last run's default store (POST) +*LastActorRunsDefaultKeyValueStoreAPI* | [**ActRunsLastKeyValueStoreRecordPut**](docs/LastActorRunsDefaultKeyValueStoreAPI.md#actrunslastkeyvaluestorerecordput) | **Put** /v2/actors/{actorId}/runs/last/key-value-store/records/{recordKey} | Store record in last run's default store +*LastActorRunsDefaultKeyValueStoreAPI* | [**ActRunsLastKeyValueStoreRecordsGet**](docs/LastActorRunsDefaultKeyValueStoreAPI.md#actrunslastkeyvaluestorerecordsget) | **Get** /v2/actors/{actorId}/runs/last/key-value-store/records | Download last run's default store's records +*LastActorRunsDefaultRequestQueueAPI* | [**ActRunsLastRequestQueueDelete**](docs/LastActorRunsDefaultRequestQueueAPI.md#actrunslastrequestqueuedelete) | **Delete** /v2/actors/{actorId}/runs/last/request-queue | Delete last run's default request queue +*LastActorRunsDefaultRequestQueueAPI* | [**ActRunsLastRequestQueueGet**](docs/LastActorRunsDefaultRequestQueueAPI.md#actrunslastrequestqueueget) | **Get** /v2/actors/{actorId}/runs/last/request-queue | Get last run's default request queue +*LastActorRunsDefaultRequestQueueAPI* | [**ActRunsLastRequestQueueHeadGet**](docs/LastActorRunsDefaultRequestQueueAPI.md#actrunslastrequestqueueheadget) | **Get** /v2/actors/{actorId}/runs/last/request-queue/head | Get last run's default request queue head +*LastActorRunsDefaultRequestQueueAPI* | [**ActRunsLastRequestQueueHeadLockPost**](docs/LastActorRunsDefaultRequestQueueAPI.md#actrunslastrequestqueueheadlockpost) | **Post** /v2/actors/{actorId}/runs/last/request-queue/head/lock | Get and lock last run's default request queue head +*LastActorRunsDefaultRequestQueueAPI* | [**ActRunsLastRequestQueuePut**](docs/LastActorRunsDefaultRequestQueueAPI.md#actrunslastrequestqueueput) | **Put** /v2/actors/{actorId}/runs/last/request-queue | Update last run's default request queue +*LastActorRunsDefaultRequestQueueAPI* | [**ActRunsLastRequestQueueRequestDelete**](docs/LastActorRunsDefaultRequestQueueAPI.md#actrunslastrequestqueuerequestdelete) | **Delete** /v2/actors/{actorId}/runs/last/request-queue/requests/{requestId} | Delete request from last run's default request queue +*LastActorRunsDefaultRequestQueueAPI* | [**ActRunsLastRequestQueueRequestGet**](docs/LastActorRunsDefaultRequestQueueAPI.md#actrunslastrequestqueuerequestget) | **Get** /v2/actors/{actorId}/runs/last/request-queue/requests/{requestId} | Get request from last run's default request queue +*LastActorRunsDefaultRequestQueueAPI* | [**ActRunsLastRequestQueueRequestLockDelete**](docs/LastActorRunsDefaultRequestQueueAPI.md#actrunslastrequestqueuerequestlockdelete) | **Delete** /v2/actors/{actorId}/runs/last/request-queue/requests/{requestId}/lock | Delete lock on request in last run's default request queue +*LastActorRunsDefaultRequestQueueAPI* | [**ActRunsLastRequestQueueRequestLockPut**](docs/LastActorRunsDefaultRequestQueueAPI.md#actrunslastrequestqueuerequestlockput) | **Put** /v2/actors/{actorId}/runs/last/request-queue/requests/{requestId}/lock | Prolong lock on request in last run's default request queue +*LastActorRunsDefaultRequestQueueAPI* | [**ActRunsLastRequestQueueRequestPut**](docs/LastActorRunsDefaultRequestQueueAPI.md#actrunslastrequestqueuerequestput) | **Put** /v2/actors/{actorId}/runs/last/request-queue/requests/{requestId} | Update request in last run's default request queue +*LastActorRunsDefaultRequestQueueAPI* | [**ActRunsLastRequestQueueRequestsBatchDelete**](docs/LastActorRunsDefaultRequestQueueAPI.md#actrunslastrequestqueuerequestsbatchdelete) | **Delete** /v2/actors/{actorId}/runs/last/request-queue/requests/batch | Batch delete requests from last run's default request queue +*LastActorRunsDefaultRequestQueueAPI* | [**ActRunsLastRequestQueueRequestsBatchPost**](docs/LastActorRunsDefaultRequestQueueAPI.md#actrunslastrequestqueuerequestsbatchpost) | **Post** /v2/actors/{actorId}/runs/last/request-queue/requests/batch | Batch add requests to last run's default request queue +*LastActorRunsDefaultRequestQueueAPI* | [**ActRunsLastRequestQueueRequestsGet**](docs/LastActorRunsDefaultRequestQueueAPI.md#actrunslastrequestqueuerequestsget) | **Get** /v2/actors/{actorId}/runs/last/request-queue/requests | List last run's default request queue's requests +*LastActorRunsDefaultRequestQueueAPI* | [**ActRunsLastRequestQueueRequestsPost**](docs/LastActorRunsDefaultRequestQueueAPI.md#actrunslastrequestqueuerequestspost) | **Post** /v2/actors/{actorId}/runs/last/request-queue/requests | Add request to last run's default request queue +*LastActorRunsDefaultRequestQueueAPI* | [**ActRunsLastRequestQueueRequestsUnlockPost**](docs/LastActorRunsDefaultRequestQueueAPI.md#actrunslastrequestqueuerequestsunlockpost) | **Post** /v2/actors/{actorId}/runs/last/request-queue/requests/unlock | Unlock requests in last run's default request queue +*LastActorRunsLogAPI* | [**ActRunsLastLogGet**](docs/LastActorRunsLogAPI.md#actrunslastlogget) | **Get** /v2/actors/{actorId}/runs/last/log | Get last Actor run's log +*LastActorRunsMetamorphAPI* | [**ActRunsLastMetamorphPost**](docs/LastActorRunsMetamorphAPI.md#actrunslastmetamorphpost) | **Post** /v2/actors/{actorId}/runs/last/metamorph | Metamorph Actor's last run +*LastActorRunsRebootAPI* | [**ActRunsLastRebootPost**](docs/LastActorRunsRebootAPI.md#actrunslastrebootpost) | **Post** /v2/actors/{actorId}/runs/last/reboot | Reboot Actor's last run +*LastActorTaskRunsAbortAPI* | [**ActorTaskRunsLastAbortPost**](docs/LastActorTaskRunsAbortAPI.md#actortaskrunslastabortpost) | **Post** /v2/actor-tasks/{actorTaskId}/runs/last/abort | Abort Actor task's last run +*LastActorTaskRunsDefaultDatasetAPI* | [**ActorTaskRunsLastDatasetDelete**](docs/LastActorTaskRunsDefaultDatasetAPI.md#actortaskrunslastdatasetdelete) | **Delete** /v2/actor-tasks/{actorTaskId}/runs/last/dataset | Delete last task run's default dataset +*LastActorTaskRunsDefaultDatasetAPI* | [**ActorTaskRunsLastDatasetGet**](docs/LastActorTaskRunsDefaultDatasetAPI.md#actortaskrunslastdatasetget) | **Get** /v2/actor-tasks/{actorTaskId}/runs/last/dataset | Get last task run's default dataset +*LastActorTaskRunsDefaultDatasetAPI* | [**ActorTaskRunsLastDatasetItemsGet**](docs/LastActorTaskRunsDefaultDatasetAPI.md#actortaskrunslastdatasetitemsget) | **Get** /v2/actor-tasks/{actorTaskId}/runs/last/dataset/items | Get last task run's dataset items +*LastActorTaskRunsDefaultDatasetAPI* | [**ActorTaskRunsLastDatasetItemsPost**](docs/LastActorTaskRunsDefaultDatasetAPI.md#actortaskrunslastdatasetitemspost) | **Post** /v2/actor-tasks/{actorTaskId}/runs/last/dataset/items | Store items in last task run's dataset +*LastActorTaskRunsDefaultDatasetAPI* | [**ActorTaskRunsLastDatasetPut**](docs/LastActorTaskRunsDefaultDatasetAPI.md#actortaskrunslastdatasetput) | **Put** /v2/actor-tasks/{actorTaskId}/runs/last/dataset | Update last task run's default dataset +*LastActorTaskRunsDefaultDatasetAPI* | [**ActorTaskRunsLastDatasetStatisticsGet**](docs/LastActorTaskRunsDefaultDatasetAPI.md#actortaskrunslastdatasetstatisticsget) | **Get** /v2/actor-tasks/{actorTaskId}/runs/last/dataset/statistics | Get last task run's dataset statistics +*LastActorTaskRunsDefaultKeyValueStoreAPI* | [**ActorTaskRunsLastKeyValueStoreDelete**](docs/LastActorTaskRunsDefaultKeyValueStoreAPI.md#actortaskrunslastkeyvaluestoredelete) | **Delete** /v2/actor-tasks/{actorTaskId}/runs/last/key-value-store | Delete last task run's default store +*LastActorTaskRunsDefaultKeyValueStoreAPI* | [**ActorTaskRunsLastKeyValueStoreGet**](docs/LastActorTaskRunsDefaultKeyValueStoreAPI.md#actortaskrunslastkeyvaluestoreget) | **Get** /v2/actor-tasks/{actorTaskId}/runs/last/key-value-store | Get last task run's default store +*LastActorTaskRunsDefaultKeyValueStoreAPI* | [**ActorTaskRunsLastKeyValueStoreKeysGet**](docs/LastActorTaskRunsDefaultKeyValueStoreAPI.md#actortaskrunslastkeyvaluestorekeysget) | **Get** /v2/actor-tasks/{actorTaskId}/runs/last/key-value-store/keys | Get last task run's default store's list of keys +*LastActorTaskRunsDefaultKeyValueStoreAPI* | [**ActorTaskRunsLastKeyValueStorePut**](docs/LastActorTaskRunsDefaultKeyValueStoreAPI.md#actortaskrunslastkeyvaluestoreput) | **Put** /v2/actor-tasks/{actorTaskId}/runs/last/key-value-store | Update last task run's default store +*LastActorTaskRunsDefaultKeyValueStoreAPI* | [**ActorTaskRunsLastKeyValueStoreRecordDelete**](docs/LastActorTaskRunsDefaultKeyValueStoreAPI.md#actortaskrunslastkeyvaluestorerecorddelete) | **Delete** /v2/actor-tasks/{actorTaskId}/runs/last/key-value-store/records/{recordKey} | Delete last task run's default store's record +*LastActorTaskRunsDefaultKeyValueStoreAPI* | [**ActorTaskRunsLastKeyValueStoreRecordGet**](docs/LastActorTaskRunsDefaultKeyValueStoreAPI.md#actortaskrunslastkeyvaluestorerecordget) | **Get** /v2/actor-tasks/{actorTaskId}/runs/last/key-value-store/records/{recordKey} | Get last task run's default store's record +*LastActorTaskRunsDefaultKeyValueStoreAPI* | [**ActorTaskRunsLastKeyValueStoreRecordPost**](docs/LastActorTaskRunsDefaultKeyValueStoreAPI.md#actortaskrunslastkeyvaluestorerecordpost) | **Post** /v2/actor-tasks/{actorTaskId}/runs/last/key-value-store/records/{recordKey} | Store record in last task run's default store (POST) +*LastActorTaskRunsDefaultKeyValueStoreAPI* | [**ActorTaskRunsLastKeyValueStoreRecordPut**](docs/LastActorTaskRunsDefaultKeyValueStoreAPI.md#actortaskrunslastkeyvaluestorerecordput) | **Put** /v2/actor-tasks/{actorTaskId}/runs/last/key-value-store/records/{recordKey} | Store record in last task run's default store +*LastActorTaskRunsDefaultKeyValueStoreAPI* | [**ActorTaskRunsLastKeyValueStoreRecordsGet**](docs/LastActorTaskRunsDefaultKeyValueStoreAPI.md#actortaskrunslastkeyvaluestorerecordsget) | **Get** /v2/actor-tasks/{actorTaskId}/runs/last/key-value-store/records | Download last task run's default store's records +*LastActorTaskRunsDefaultRequestQueueAPI* | [**ActorTaskRunsLastRequestQueueDelete**](docs/LastActorTaskRunsDefaultRequestQueueAPI.md#actortaskrunslastrequestqueuedelete) | **Delete** /v2/actor-tasks/{actorTaskId}/runs/last/request-queue | Delete last task run's default request queue +*LastActorTaskRunsDefaultRequestQueueAPI* | [**ActorTaskRunsLastRequestQueueGet**](docs/LastActorTaskRunsDefaultRequestQueueAPI.md#actortaskrunslastrequestqueueget) | **Get** /v2/actor-tasks/{actorTaskId}/runs/last/request-queue | Get last task run's default request queue +*LastActorTaskRunsDefaultRequestQueueAPI* | [**ActorTaskRunsLastRequestQueueHeadGet**](docs/LastActorTaskRunsDefaultRequestQueueAPI.md#actortaskrunslastrequestqueueheadget) | **Get** /v2/actor-tasks/{actorTaskId}/runs/last/request-queue/head | Get last task run's default request queue head +*LastActorTaskRunsDefaultRequestQueueAPI* | [**ActorTaskRunsLastRequestQueueHeadLockPost**](docs/LastActorTaskRunsDefaultRequestQueueAPI.md#actortaskrunslastrequestqueueheadlockpost) | **Post** /v2/actor-tasks/{actorTaskId}/runs/last/request-queue/head/lock | Get and lock last task run's default request queue head +*LastActorTaskRunsDefaultRequestQueueAPI* | [**ActorTaskRunsLastRequestQueuePut**](docs/LastActorTaskRunsDefaultRequestQueueAPI.md#actortaskrunslastrequestqueueput) | **Put** /v2/actor-tasks/{actorTaskId}/runs/last/request-queue | Update last task run's default request queue +*LastActorTaskRunsDefaultRequestQueueAPI* | [**ActorTaskRunsLastRequestQueueRequestDelete**](docs/LastActorTaskRunsDefaultRequestQueueAPI.md#actortaskrunslastrequestqueuerequestdelete) | **Delete** /v2/actor-tasks/{actorTaskId}/runs/last/request-queue/requests/{requestId} | Delete request from last task run's default request queue +*LastActorTaskRunsDefaultRequestQueueAPI* | [**ActorTaskRunsLastRequestQueueRequestGet**](docs/LastActorTaskRunsDefaultRequestQueueAPI.md#actortaskrunslastrequestqueuerequestget) | **Get** /v2/actor-tasks/{actorTaskId}/runs/last/request-queue/requests/{requestId} | Get request from last task run's default request queue +*LastActorTaskRunsDefaultRequestQueueAPI* | [**ActorTaskRunsLastRequestQueueRequestLockDelete**](docs/LastActorTaskRunsDefaultRequestQueueAPI.md#actortaskrunslastrequestqueuerequestlockdelete) | **Delete** /v2/actor-tasks/{actorTaskId}/runs/last/request-queue/requests/{requestId}/lock | Delete lock on request in last task run's default request queue +*LastActorTaskRunsDefaultRequestQueueAPI* | [**ActorTaskRunsLastRequestQueueRequestLockPut**](docs/LastActorTaskRunsDefaultRequestQueueAPI.md#actortaskrunslastrequestqueuerequestlockput) | **Put** /v2/actor-tasks/{actorTaskId}/runs/last/request-queue/requests/{requestId}/lock | Prolong lock on request in last task run's default request queue +*LastActorTaskRunsDefaultRequestQueueAPI* | [**ActorTaskRunsLastRequestQueueRequestPut**](docs/LastActorTaskRunsDefaultRequestQueueAPI.md#actortaskrunslastrequestqueuerequestput) | **Put** /v2/actor-tasks/{actorTaskId}/runs/last/request-queue/requests/{requestId} | Update request in last task run's default request queue +*LastActorTaskRunsDefaultRequestQueueAPI* | [**ActorTaskRunsLastRequestQueueRequestsBatchDelete**](docs/LastActorTaskRunsDefaultRequestQueueAPI.md#actortaskrunslastrequestqueuerequestsbatchdelete) | **Delete** /v2/actor-tasks/{actorTaskId}/runs/last/request-queue/requests/batch | Batch delete requests from last task run's default request queue +*LastActorTaskRunsDefaultRequestQueueAPI* | [**ActorTaskRunsLastRequestQueueRequestsBatchPost**](docs/LastActorTaskRunsDefaultRequestQueueAPI.md#actortaskrunslastrequestqueuerequestsbatchpost) | **Post** /v2/actor-tasks/{actorTaskId}/runs/last/request-queue/requests/batch | Batch add requests to last task run's default request queue +*LastActorTaskRunsDefaultRequestQueueAPI* | [**ActorTaskRunsLastRequestQueueRequestsGet**](docs/LastActorTaskRunsDefaultRequestQueueAPI.md#actortaskrunslastrequestqueuerequestsget) | **Get** /v2/actor-tasks/{actorTaskId}/runs/last/request-queue/requests | List last task run's default request queue's requests +*LastActorTaskRunsDefaultRequestQueueAPI* | [**ActorTaskRunsLastRequestQueueRequestsPost**](docs/LastActorTaskRunsDefaultRequestQueueAPI.md#actortaskrunslastrequestqueuerequestspost) | **Post** /v2/actor-tasks/{actorTaskId}/runs/last/request-queue/requests | Add request to last task run's default request queue +*LastActorTaskRunsDefaultRequestQueueAPI* | [**ActorTaskRunsLastRequestQueueRequestsUnlockPost**](docs/LastActorTaskRunsDefaultRequestQueueAPI.md#actortaskrunslastrequestqueuerequestsunlockpost) | **Post** /v2/actor-tasks/{actorTaskId}/runs/last/request-queue/requests/unlock | Unlock requests in last task run's default request queue +*LastActorTaskRunsLogAPI* | [**ActorTaskLastLogGet**](docs/LastActorTaskRunsLogAPI.md#actortasklastlogget) | **Get** /v2/actor-tasks/{actorTaskId}/runs/last/log | Get last Actor task run's log +*LastActorTaskRunsMetamorphAPI* | [**ActorTaskRunsLastMetamorphPost**](docs/LastActorTaskRunsMetamorphAPI.md#actortaskrunslastmetamorphpost) | **Post** /v2/actor-tasks/{actorTaskId}/runs/last/metamorph | Metamorph Actor task's last run +*LastActorTaskRunsRebootAPI* | [**ActorTaskRunsLastRebootPost**](docs/LastActorTaskRunsRebootAPI.md#actortaskrunslastrebootpost) | **Post** /v2/actor-tasks/{actorTaskId}/runs/last/reboot | Reboot Actor task's last run +*LogsAPI* | [**LogGet**](docs/LogsAPI.md#logget) | **Get** /v2/logs/{buildOrRunId} | Get log +*SchedulesAPI* | [**ScheduleDelete**](docs/SchedulesAPI.md#scheduledelete) | **Delete** /v2/schedules/{scheduleId} | Delete schedule +*SchedulesAPI* | [**ScheduleGet**](docs/SchedulesAPI.md#scheduleget) | **Get** /v2/schedules/{scheduleId} | Get schedule +*SchedulesAPI* | [**ScheduleLogGet**](docs/SchedulesAPI.md#schedulelogget) | **Get** /v2/schedules/{scheduleId}/log | Get schedule log +*SchedulesAPI* | [**SchedulePut**](docs/SchedulesAPI.md#scheduleput) | **Put** /v2/schedules/{scheduleId} | Update schedule +*SchedulesAPI* | [**SchedulesGet**](docs/SchedulesAPI.md#schedulesget) | **Get** /v2/schedules | Get list of schedules +*SchedulesAPI* | [**SchedulesPost**](docs/SchedulesAPI.md#schedulespost) | **Post** /v2/schedules | Create schedule +*StorageDatasetsAPI* | [**DatasetDelete**](docs/StorageDatasetsAPI.md#datasetdelete) | **Delete** /v2/datasets/{datasetId} | Delete dataset +*StorageDatasetsAPI* | [**DatasetGet**](docs/StorageDatasetsAPI.md#datasetget) | **Get** /v2/datasets/{datasetId} | Get dataset +*StorageDatasetsAPI* | [**DatasetItemsGet**](docs/StorageDatasetsAPI.md#datasetitemsget) | **Get** /v2/datasets/{datasetId}/items | Get dataset items +*StorageDatasetsAPI* | [**DatasetItemsHead**](docs/StorageDatasetsAPI.md#datasetitemshead) | **Head** /v2/datasets/{datasetId}/items | Get dataset items headers +*StorageDatasetsAPI* | [**DatasetItemsPost**](docs/StorageDatasetsAPI.md#datasetitemspost) | **Post** /v2/datasets/{datasetId}/items | Store items +*StorageDatasetsAPI* | [**DatasetPut**](docs/StorageDatasetsAPI.md#datasetput) | **Put** /v2/datasets/{datasetId} | Update dataset +*StorageDatasetsAPI* | [**DatasetStatisticsGet**](docs/StorageDatasetsAPI.md#datasetstatisticsget) | **Get** /v2/datasets/{datasetId}/statistics | Get dataset statistics +*StorageDatasetsAPI* | [**DatasetsGet**](docs/StorageDatasetsAPI.md#datasetsget) | **Get** /v2/datasets | Get list of datasets +*StorageDatasetsAPI* | [**DatasetsPost**](docs/StorageDatasetsAPI.md#datasetspost) | **Post** /v2/datasets | Create dataset +*StorageKeyValueStoresAPI* | [**KeyValueStoreDelete**](docs/StorageKeyValueStoresAPI.md#keyvaluestoredelete) | **Delete** /v2/key-value-stores/{storeId} | Delete store +*StorageKeyValueStoresAPI* | [**KeyValueStoreGet**](docs/StorageKeyValueStoresAPI.md#keyvaluestoreget) | **Get** /v2/key-value-stores/{storeId} | Get store +*StorageKeyValueStoresAPI* | [**KeyValueStoreKeysGet**](docs/StorageKeyValueStoresAPI.md#keyvaluestorekeysget) | **Get** /v2/key-value-stores/{storeId}/keys | Get list of keys +*StorageKeyValueStoresAPI* | [**KeyValueStorePut**](docs/StorageKeyValueStoresAPI.md#keyvaluestoreput) | **Put** /v2/key-value-stores/{storeId} | Update store +*StorageKeyValueStoresAPI* | [**KeyValueStoreRecordDelete**](docs/StorageKeyValueStoresAPI.md#keyvaluestorerecorddelete) | **Delete** /v2/key-value-stores/{storeId}/records/{recordKey} | Delete record +*StorageKeyValueStoresAPI* | [**KeyValueStoreRecordGet**](docs/StorageKeyValueStoresAPI.md#keyvaluestorerecordget) | **Get** /v2/key-value-stores/{storeId}/records/{recordKey} | Get record +*StorageKeyValueStoresAPI* | [**KeyValueStoreRecordHead**](docs/StorageKeyValueStoresAPI.md#keyvaluestorerecordhead) | **Head** /v2/key-value-stores/{storeId}/records/{recordKey} | Check if a record exists +*StorageKeyValueStoresAPI* | [**KeyValueStoreRecordPost**](docs/StorageKeyValueStoresAPI.md#keyvaluestorerecordpost) | **Post** /v2/key-value-stores/{storeId}/records/{recordKey} | Store record (POST) +*StorageKeyValueStoresAPI* | [**KeyValueStoreRecordPut**](docs/StorageKeyValueStoresAPI.md#keyvaluestorerecordput) | **Put** /v2/key-value-stores/{storeId}/records/{recordKey} | Store record +*StorageKeyValueStoresAPI* | [**KeyValueStoreRecordsGet**](docs/StorageKeyValueStoresAPI.md#keyvaluestorerecordsget) | **Get** /v2/key-value-stores/{storeId}/records | Download records +*StorageKeyValueStoresAPI* | [**KeyValueStoresGet**](docs/StorageKeyValueStoresAPI.md#keyvaluestoresget) | **Get** /v2/key-value-stores | Get list of key-value stores +*StorageKeyValueStoresAPI* | [**KeyValueStoresPost**](docs/StorageKeyValueStoresAPI.md#keyvaluestorespost) | **Post** /v2/key-value-stores | Create key-value store +*StorageRequestQueuesAPI* | [**RequestQueueDelete**](docs/StorageRequestQueuesAPI.md#requestqueuedelete) | **Delete** /v2/request-queues/{queueId} | Delete request queue +*StorageRequestQueuesAPI* | [**RequestQueueGet**](docs/StorageRequestQueuesAPI.md#requestqueueget) | **Get** /v2/request-queues/{queueId} | Get request queue +*StorageRequestQueuesAPI* | [**RequestQueuePut**](docs/StorageRequestQueuesAPI.md#requestqueueput) | **Put** /v2/request-queues/{queueId} | Update request queue +*StorageRequestQueuesAPI* | [**RequestQueueRequestsBatchDelete**](docs/StorageRequestQueuesAPI.md#requestqueuerequestsbatchdelete) | **Delete** /v2/request-queues/{queueId}/requests/batch | Delete requests +*StorageRequestQueuesAPI* | [**RequestQueueRequestsBatchPost**](docs/StorageRequestQueuesAPI.md#requestqueuerequestsbatchpost) | **Post** /v2/request-queues/{queueId}/requests/batch | Add requests +*StorageRequestQueuesAPI* | [**RequestQueuesGet**](docs/StorageRequestQueuesAPI.md#requestqueuesget) | **Get** /v2/request-queues | Get list of request queues +*StorageRequestQueuesAPI* | [**RequestQueuesPost**](docs/StorageRequestQueuesAPI.md#requestqueuespost) | **Post** /v2/request-queues | Create request queue +*StorageRequestQueuesRequestsAPI* | [**RequestQueueRequestDelete**](docs/StorageRequestQueuesRequestsAPI.md#requestqueuerequestdelete) | **Delete** /v2/request-queues/{queueId}/requests/{requestId} | Delete request +*StorageRequestQueuesRequestsAPI* | [**RequestQueueRequestGet**](docs/StorageRequestQueuesRequestsAPI.md#requestqueuerequestget) | **Get** /v2/request-queues/{queueId}/requests/{requestId} | Get request +*StorageRequestQueuesRequestsAPI* | [**RequestQueueRequestPut**](docs/StorageRequestQueuesRequestsAPI.md#requestqueuerequestput) | **Put** /v2/request-queues/{queueId}/requests/{requestId} | Update request +*StorageRequestQueuesRequestsAPI* | [**RequestQueueRequestsGet**](docs/StorageRequestQueuesRequestsAPI.md#requestqueuerequestsget) | **Get** /v2/request-queues/{queueId}/requests | List requests +*StorageRequestQueuesRequestsAPI* | [**RequestQueueRequestsPost**](docs/StorageRequestQueuesRequestsAPI.md#requestqueuerequestspost) | **Post** /v2/request-queues/{queueId}/requests | Add request +*StorageRequestQueuesRequestsLocksAPI* | [**RequestQueueHeadGet**](docs/StorageRequestQueuesRequestsLocksAPI.md#requestqueueheadget) | **Get** /v2/request-queues/{queueId}/head | Get head +*StorageRequestQueuesRequestsLocksAPI* | [**RequestQueueHeadLockPost**](docs/StorageRequestQueuesRequestsLocksAPI.md#requestqueueheadlockpost) | **Post** /v2/request-queues/{queueId}/head/lock | Get head and lock +*StorageRequestQueuesRequestsLocksAPI* | [**RequestQueueRequestLockDelete**](docs/StorageRequestQueuesRequestsLocksAPI.md#requestqueuerequestlockdelete) | **Delete** /v2/request-queues/{queueId}/requests/{requestId}/lock | Delete request lock +*StorageRequestQueuesRequestsLocksAPI* | [**RequestQueueRequestLockPut**](docs/StorageRequestQueuesRequestsLocksAPI.md#requestqueuerequestlockput) | **Put** /v2/request-queues/{queueId}/requests/{requestId}/lock | Prolong request lock +*StorageRequestQueuesRequestsLocksAPI* | [**RequestQueueRequestsUnlockPost**](docs/StorageRequestQueuesRequestsLocksAPI.md#requestqueuerequestsunlockpost) | **Post** /v2/request-queues/{queueId}/requests/unlock | Unlock requests +*StoreAPI* | [**StoreGet**](docs/StoreAPI.md#storeget) | **Get** /v2/store | Get list of Actors in Store +*ToolsAPI* | [**ToolsBrowserInfoDelete**](docs/ToolsAPI.md#toolsbrowserinfodelete) | **Delete** /v2/browser-info | Get browser info +*ToolsAPI* | [**ToolsBrowserInfoGet**](docs/ToolsAPI.md#toolsbrowserinfoget) | **Get** /v2/browser-info | Get browser info +*ToolsAPI* | [**ToolsBrowserInfoPost**](docs/ToolsAPI.md#toolsbrowserinfopost) | **Post** /v2/browser-info | Get browser info +*ToolsAPI* | [**ToolsBrowserInfoPut**](docs/ToolsAPI.md#toolsbrowserinfoput) | **Put** /v2/browser-info | Get browser info +*ToolsAPI* | [**ToolsDecodeAndVerifyPost**](docs/ToolsAPI.md#toolsdecodeandverifypost) | **Post** /v2/tools/decode-and-verify | Decode and verify object +*ToolsAPI* | [**ToolsEncodeAndSignPost**](docs/ToolsAPI.md#toolsencodeandsignpost) | **Post** /v2/tools/encode-and-sign | Encode and sign object +*UsersAPI* | [**UserGet**](docs/UsersAPI.md#userget) | **Get** /v2/users/{userId} | Get public user data +*UsersAPI* | [**UsersMeGet**](docs/UsersAPI.md#usersmeget) | **Get** /v2/users/me | Get private user data +*UsersAPI* | [**UsersMeLimitsGet**](docs/UsersAPI.md#usersmelimitsget) | **Get** /v2/users/me/limits | Get limits +*UsersAPI* | [**UsersMeLimitsPut**](docs/UsersAPI.md#usersmelimitsput) | **Put** /v2/users/me/limits | Update limits +*UsersAPI* | [**UsersMeUsageMonthlyGet**](docs/UsersAPI.md#usersmeusagemonthlyget) | **Get** /v2/users/me/usage/monthly | Get monthly usage +*WebhooksWebhookDispatchesAPI* | [**WebhookDispatchGet**](docs/WebhooksWebhookDispatchesAPI.md#webhookdispatchget) | **Get** /v2/webhook-dispatches/{dispatchId} | Get webhook dispatch +*WebhooksWebhookDispatchesAPI* | [**WebhookDispatchesGet**](docs/WebhooksWebhookDispatchesAPI.md#webhookdispatchesget) | **Get** /v2/webhook-dispatches | Get list of webhook dispatches +*WebhooksWebhooksAPI* | [**WebhookDelete**](docs/WebhooksWebhooksAPI.md#webhookdelete) | **Delete** /v2/webhooks/{webhookId} | Delete webhook +*WebhooksWebhooksAPI* | [**WebhookGet**](docs/WebhooksWebhooksAPI.md#webhookget) | **Get** /v2/webhooks/{webhookId} | Get webhook +*WebhooksWebhooksAPI* | [**WebhookPut**](docs/WebhooksWebhooksAPI.md#webhookput) | **Put** /v2/webhooks/{webhookId} | Update webhook +*WebhooksWebhooksAPI* | [**WebhookTestPost**](docs/WebhooksWebhooksAPI.md#webhooktestpost) | **Post** /v2/webhooks/{webhookId}/test | Test webhook +*WebhooksWebhooksAPI* | [**WebhookWebhookDispatchesGet**](docs/WebhooksWebhooksAPI.md#webhookwebhookdispatchesget) | **Get** /v2/webhooks/{webhookId}/dispatches | Get collection +*WebhooksWebhooksAPI* | [**WebhooksGet**](docs/WebhooksWebhooksAPI.md#webhooksget) | **Get** /v2/webhooks | Get list of webhooks +*WebhooksWebhooksAPI* | [**WebhooksPost**](docs/WebhooksWebhooksAPI.md#webhookspost) | **Post** /v2/webhooks | Create webhook + + +## Documentation For Models + + - [AccountLimits](docs/AccountLimits.md) + - [ActRunsLastDatasetItemsPost400Response](docs/ActRunsLastDatasetItemsPost400Response.md) + - [ActRunsLastDatasetItemsPostRequest](docs/ActRunsLastDatasetItemsPostRequest.md) + - [ActValidateInputPost200Response](docs/ActValidateInputPost200Response.md) + - [Actor](docs/Actor.md) + - [ActorChargeEvent](docs/ActorChargeEvent.md) + - [ActorDefinition](docs/ActorDefinition.md) + - [ActorDefinitionDefaultMemoryMbytes](docs/ActorDefinitionDefaultMemoryMbytes.md) + - [ActorDefinitionStorages](docs/ActorDefinitionStorages.md) + - [ActorJobStatus](docs/ActorJobStatus.md) + - [ActorPermissionLevel](docs/ActorPermissionLevel.md) + - [ActorResponse](docs/ActorResponse.md) + - [ActorRunFailedError](docs/ActorRunFailedError.md) + - [ActorRunPricingInfo](docs/ActorRunPricingInfo.md) + - [ActorRunTimeoutExceededError](docs/ActorRunTimeoutExceededError.md) + - [ActorShort](docs/ActorShort.md) + - [ActorStandby](docs/ActorStandby.md) + - [ActorStats](docs/ActorStats.md) + - [ActorStatsPublicActorRunStats30Days](docs/ActorStatsPublicActorRunStats30Days.md) + - [ActorTaskGet200Response](docs/ActorTaskGet200Response.md) + - [ActorTaskRunsGet200Response](docs/ActorTaskRunsGet200Response.md) + - [ActorTaskRunsGet200ResponseData](docs/ActorTaskRunsGet200ResponseData.md) + - [ActorTaskRunsPost201Response](docs/ActorTaskRunsPost201Response.md) + - [ActorTaskWebhooksGet200Response](docs/ActorTaskWebhooksGet200Response.md) + - [ActorTaskWebhooksGet200ResponseData](docs/ActorTaskWebhooksGet200ResponseData.md) + - [AddRequestResponse](docs/AddRequestResponse.md) + - [AddedRequest](docs/AddedRequest.md) + - [BatchAddResponse](docs/BatchAddResponse.md) + - [BatchAddResult](docs/BatchAddResult.md) + - [BatchDeleteResponse](docs/BatchDeleteResponse.md) + - [BatchDeleteResult](docs/BatchDeleteResult.md) + - [BrowserInfoResponse](docs/BrowserInfoResponse.md) + - [BrowserInfoResponseHeadersValue](docs/BrowserInfoResponseHeadersValue.md) + - [Build](docs/Build.md) + - [BuildActVersion](docs/BuildActVersion.md) + - [BuildOptions](docs/BuildOptions.md) + - [BuildResponse](docs/BuildResponse.md) + - [BuildShort](docs/BuildShort.md) + - [BuildStats](docs/BuildStats.md) + - [BuildTag](docs/BuildTag.md) + - [BuildUsage](docs/BuildUsage.md) + - [BuildsMeta](docs/BuildsMeta.md) + - [CallsInner](docs/CallsInner.md) + - [ChargeRunRequest](docs/ChargeRunRequest.md) + - [CommonActorPricingInfo](docs/CommonActorPricingInfo.md) + - [CreateActorRequest](docs/CreateActorRequest.md) + - [CreateOrUpdateVersionRequest](docs/CreateOrUpdateVersionRequest.md) + - [CreateTaskRequest](docs/CreateTaskRequest.md) + - [Current](docs/Current.md) + - [CurrentPricingInfo](docs/CurrentPricingInfo.md) + - [DailyServiceUsages](docs/DailyServiceUsages.md) + - [Dataset](docs/Dataset.md) + - [DatasetFieldStatistics](docs/DatasetFieldStatistics.md) + - [DatasetListItem](docs/DatasetListItem.md) + - [DatasetResponse](docs/DatasetResponse.md) + - [DatasetSchemaValidationError](docs/DatasetSchemaValidationError.md) + - [DatasetStatistics](docs/DatasetStatistics.md) + - [DatasetStatisticsResponse](docs/DatasetStatisticsResponse.md) + - [DatasetStats](docs/DatasetStats.md) + - [DecodeAndVerifyData](docs/DecodeAndVerifyData.md) + - [DecodeAndVerifyRequest](docs/DecodeAndVerifyRequest.md) + - [DecodeAndVerifyResponse](docs/DecodeAndVerifyResponse.md) + - [DefaultRunOptions](docs/DefaultRunOptions.md) + - [DeletedRequest](docs/DeletedRequest.md) + - [DeletedRequestById](docs/DeletedRequestById.md) + - [DeletedRequestByUniqueKey](docs/DeletedRequestByUniqueKey.md) + - [EffectivePlatformFeature](docs/EffectivePlatformFeature.md) + - [EffectivePlatformFeatures](docs/EffectivePlatformFeatures.md) + - [EncodeAndSignData](docs/EncodeAndSignData.md) + - [EncodeAndSignResponse](docs/EncodeAndSignResponse.md) + - [EnvVar](docs/EnvVar.md) + - [EnvVarRequest](docs/EnvVarRequest.md) + - [EnvVarResponse](docs/EnvVarResponse.md) + - [ErrorDetail](docs/ErrorDetail.md) + - [ErrorResponse](docs/ErrorResponse.md) + - [ErrorType](docs/ErrorType.md) + - [EventData](docs/EventData.md) + - [ExampleRunInput](docs/ExampleRunInput.md) + - [ExampleWebhookDispatch](docs/ExampleWebhookDispatch.md) + - [FlatPricePerMonthActorPricingInfo](docs/FlatPricePerMonthActorPricingInfo.md) + - [FreeActorPricingInfo](docs/FreeActorPricingInfo.md) + - [GeneralAccess](docs/GeneralAccess.md) + - [HeadAndLockResponse](docs/HeadAndLockResponse.md) + - [HeadRequest](docs/HeadRequest.md) + - [HeadResponse](docs/HeadResponse.md) + - [HttpMethod](docs/HttpMethod.md) + - [InvalidItem](docs/InvalidItem.md) + - [KeyValueStore](docs/KeyValueStore.md) + - [KeyValueStoreKey](docs/KeyValueStoreKey.md) + - [KeyValueStoreResponse](docs/KeyValueStoreResponse.md) + - [KeyValueStoreStats](docs/KeyValueStoreStats.md) + - [Limits](docs/Limits.md) + - [LimitsResponse](docs/LimitsResponse.md) + - [ListOfActors](docs/ListOfActors.md) + - [ListOfActorsInStoreResponse](docs/ListOfActorsInStoreResponse.md) + - [ListOfActorsResponse](docs/ListOfActorsResponse.md) + - [ListOfBuilds](docs/ListOfBuilds.md) + - [ListOfBuildsResponse](docs/ListOfBuildsResponse.md) + - [ListOfDatasets](docs/ListOfDatasets.md) + - [ListOfDatasetsResponse](docs/ListOfDatasetsResponse.md) + - [ListOfEnvVars](docs/ListOfEnvVars.md) + - [ListOfEnvVarsResponse](docs/ListOfEnvVarsResponse.md) + - [ListOfKeyValueStores](docs/ListOfKeyValueStores.md) + - [ListOfKeyValueStoresResponse](docs/ListOfKeyValueStoresResponse.md) + - [ListOfKeys](docs/ListOfKeys.md) + - [ListOfKeysResponse](docs/ListOfKeysResponse.md) + - [ListOfRequestQueues](docs/ListOfRequestQueues.md) + - [ListOfRequestQueuesResponse](docs/ListOfRequestQueuesResponse.md) + - [ListOfRequests](docs/ListOfRequests.md) + - [ListOfRequestsResponse](docs/ListOfRequestsResponse.md) + - [ListOfRuns](docs/ListOfRuns.md) + - [ListOfRunsResponse](docs/ListOfRunsResponse.md) + - [ListOfSchedules](docs/ListOfSchedules.md) + - [ListOfSchedulesResponse](docs/ListOfSchedulesResponse.md) + - [ListOfStoreActors](docs/ListOfStoreActors.md) + - [ListOfTasks](docs/ListOfTasks.md) + - [ListOfTasksResponse](docs/ListOfTasksResponse.md) + - [ListOfVersions](docs/ListOfVersions.md) + - [ListOfVersionsResponse](docs/ListOfVersionsResponse.md) + - [ListOfWebhookDispatches](docs/ListOfWebhookDispatches.md) + - [ListOfWebhookDispatchesResponse](docs/ListOfWebhookDispatchesResponse.md) + - [ListOfWebhooks](docs/ListOfWebhooks.md) + - [ListOfWebhooksResponse](docs/ListOfWebhooksResponse.md) + - [LockedHeadRequest](docs/LockedHeadRequest.md) + - [LockedRequestQueueHead](docs/LockedRequestQueueHead.md) + - [Metamorph](docs/Metamorph.md) + - [MonthlyUsage](docs/MonthlyUsage.md) + - [MonthlyUsageResponse](docs/MonthlyUsageResponse.md) + - [PaginationResponse](docs/PaginationResponse.md) + - [PayPerEventActorPricingInfo](docs/PayPerEventActorPricingInfo.md) + - [PayPerEventActorPricingInfoAllOfPricingPerEvent](docs/PayPerEventActorPricingInfoAllOfPricingPerEvent.md) + - [Plan](docs/Plan.md) + - [PricePerDatasetItemActorPricingInfo](docs/PricePerDatasetItemActorPricingInfo.md) + - [PriceTiers](docs/PriceTiers.md) + - [PrivateUserDataResponse](docs/PrivateUserDataResponse.md) + - [Profile](docs/Profile.md) + - [ProlongRequestLockResponse](docs/ProlongRequestLockResponse.md) + - [Proxy](docs/Proxy.md) + - [ProxyGroup](docs/ProxyGroup.md) + - [PublicUserDataResponse](docs/PublicUserDataResponse.md) + - [PutItemResponseError](docs/PutItemResponseError.md) + - [Request](docs/Request.md) + - [RequestBase](docs/RequestBase.md) + - [RequestBasePayload](docs/RequestBasePayload.md) + - [RequestDraft](docs/RequestDraft.md) + - [RequestDraftDelete](docs/RequestDraftDelete.md) + - [RequestDraftDeleteById](docs/RequestDraftDeleteById.md) + - [RequestDraftDeleteByUniqueKey](docs/RequestDraftDeleteByUniqueKey.md) + - [RequestLockInfo](docs/RequestLockInfo.md) + - [RequestQueue](docs/RequestQueue.md) + - [RequestQueueHead](docs/RequestQueueHead.md) + - [RequestQueueResponse](docs/RequestQueueResponse.md) + - [RequestQueueShort](docs/RequestQueueShort.md) + - [RequestQueueStats](docs/RequestQueueStats.md) + - [RequestRegistration](docs/RequestRegistration.md) + - [RequestResponse](docs/RequestResponse.md) + - [Run](docs/Run.md) + - [RunFailedErrorDetail](docs/RunFailedErrorDetail.md) + - [RunMeta](docs/RunMeta.md) + - [RunOptions](docs/RunOptions.md) + - [RunOrigin](docs/RunOrigin.md) + - [RunResponse](docs/RunResponse.md) + - [RunShort](docs/RunShort.md) + - [RunStats](docs/RunStats.md) + - [RunStorageIds](docs/RunStorageIds.md) + - [RunStorageIdsDatasets](docs/RunStorageIdsDatasets.md) + - [RunTimeoutExceededErrorDetail](docs/RunTimeoutExceededErrorDetail.md) + - [RunUsage](docs/RunUsage.md) + - [RunUsageUsd](docs/RunUsageUsd.md) + - [Schedule](docs/Schedule.md) + - [ScheduleAction](docs/ScheduleAction.md) + - [ScheduleActionRunActor](docs/ScheduleActionRunActor.md) + - [ScheduleActionRunActorTask](docs/ScheduleActionRunActorTask.md) + - [ScheduleActionRunInput](docs/ScheduleActionRunInput.md) + - [ScheduleActionShort](docs/ScheduleActionShort.md) + - [ScheduleActionShortRunActor](docs/ScheduleActionShortRunActor.md) + - [ScheduleActionShortRunActorTask](docs/ScheduleActionShortRunActorTask.md) + - [ScheduleBase](docs/ScheduleBase.md) + - [ScheduleCreate](docs/ScheduleCreate.md) + - [ScheduleCreateAction](docs/ScheduleCreateAction.md) + - [ScheduleCreateActionRunActor](docs/ScheduleCreateActionRunActor.md) + - [ScheduleCreateActionRunActorTask](docs/ScheduleCreateActionRunActorTask.md) + - [ScheduleInvoked](docs/ScheduleInvoked.md) + - [ScheduleLogResponse](docs/ScheduleLogResponse.md) + - [ScheduleNotifications](docs/ScheduleNotifications.md) + - [ScheduleResponse](docs/ScheduleResponse.md) + - [ScheduleShort](docs/ScheduleShort.md) + - [SchemaValidationErrorData](docs/SchemaValidationErrorData.md) + - [SourceCodeFile](docs/SourceCodeFile.md) + - [SourceCodeFileFormat](docs/SourceCodeFileFormat.md) + - [SourceCodeFolder](docs/SourceCodeFolder.md) + - [StorageOwnership](docs/StorageOwnership.md) + - [StoreListActor](docs/StoreListActor.md) + - [TaggedBuildInfo](docs/TaggedBuildInfo.md) + - [TaggedBuildsValue](docs/TaggedBuildsValue.md) + - [Task](docs/Task.md) + - [TaskOptions](docs/TaskOptions.md) + - [TaskResponse](docs/TaskResponse.md) + - [TaskShort](docs/TaskShort.md) + - [TaskStats](docs/TaskStats.md) + - [TestWebhookResponse](docs/TestWebhookResponse.md) + - [TieredPricingPerDatasetItemEntry](docs/TieredPricingPerDatasetItemEntry.md) + - [TieredPricingPerEventEntry](docs/TieredPricingPerEventEntry.md) + - [UnlockRequestsResponse](docs/UnlockRequestsResponse.md) + - [UnlockRequestsResult](docs/UnlockRequestsResult.md) + - [UpdateActorRequest](docs/UpdateActorRequest.md) + - [UpdateDatasetRequest](docs/UpdateDatasetRequest.md) + - [UpdateLimitsRequest](docs/UpdateLimitsRequest.md) + - [UpdateRequestQueueRequest](docs/UpdateRequestQueueRequest.md) + - [UpdateRequestResponse](docs/UpdateRequestResponse.md) + - [UpdateRunRequest](docs/UpdateRunRequest.md) + - [UpdateStoreRequest](docs/UpdateStoreRequest.md) + - [UpdateTaskRequest](docs/UpdateTaskRequest.md) + - [UsageCycle](docs/UsageCycle.md) + - [UsageItem](docs/UsageItem.md) + - [UserPrivateInfo](docs/UserPrivateInfo.md) + - [UserPublicInfo](docs/UserPublicInfo.md) + - [ValidationError](docs/ValidationError.md) + - [Version](docs/Version.md) + - [VersionResponse](docs/VersionResponse.md) + - [VersionSourceFilesInner](docs/VersionSourceFilesInner.md) + - [VersionSourceType](docs/VersionSourceType.md) + - [Webhook](docs/Webhook.md) + - [WebhookCondition](docs/WebhookCondition.md) + - [WebhookCreate](docs/WebhookCreate.md) + - [WebhookDispatch](docs/WebhookDispatch.md) + - [WebhookDispatchResponse](docs/WebhookDispatchResponse.md) + - [WebhookDispatchStatus](docs/WebhookDispatchStatus.md) + - [WebhookDispatchWebhookSummary](docs/WebhookDispatchWebhookSummary.md) + - [WebhookEventType](docs/WebhookEventType.md) + - [WebhookRepresentation](docs/WebhookRepresentation.md) + - [WebhookResponse](docs/WebhookResponse.md) + - [WebhookShort](docs/WebhookShort.md) + - [WebhookStats](docs/WebhookStats.md) + - [WebhookUpdate](docs/WebhookUpdate.md) + + +## Documentation For Authorization + + +Authentication schemes defined for the API: +### httpBearer + +- **Type**: HTTP Bearer token authentication + +Example + +```go +auth := context.WithValue(context.Background(), apifyclient.ContextAccessToken, "BEARER_TOKEN_STRING") +r, err := client.Service.Operation(auth, args) +``` + +### apiKey + +- **Type**: API key +- **API key parameter name**: token +- **Location**: URL query string + +Note, each API key must be added to a map of `map[string]APIKey` where the key is: apiKey and passed in as the auth context for each request. + +Example + +```go +auth := context.WithValue( + context.Background(), + apifyclient.ContextAPIKeys, + map[string]apifyclient.APIKey{ + "apiKey": {Key: "API_KEY_STRING"}, + }, + ) +r, err := client.Service.Operation(auth, args) +``` + + +## Documentation for Utility Methods + +Due to the fact that model structure members are all pointers, this package contains +a number of utility functions to easily obtain pointers to values of basic types. +Each of these functions takes a value of the given basic type and returns a pointer to it: + +* `PtrBool` +* `PtrInt` +* `PtrInt32` +* `PtrInt64` +* `PtrFloat` +* `PtrFloat32` +* `PtrFloat64` +* `PtrString` +* `PtrTime` + +## Author + + + diff --git a/api/openapi.yaml b/api/openapi.yaml new file mode 100644 index 0000000..ae73517 --- /dev/null +++ b/api/openapi.yaml @@ -0,0 +1,23400 @@ +openapi: 3.1.2 +info: + contact: {} + description: "\nThe Apify API (version 2) provides programmatic access to the [Apify\n\ + platform](https://docs.apify.com). The API is organized\naround [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer)\n\ + HTTP endpoints.\n\nYou can download the complete OpenAPI schema of Apify API in\ + \ the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json)\ + \ formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi).\n\ + \nAll requests and responses (including errors) are encoded in\n[JSON](http://www.json.org/)\ + \ format with UTF-8 encoding,\nwith a few exceptions that are explicitly described\ + \ in the reference.\n\n- To access the API using [Node.js](https://nodejs.org/en/),\ + \ we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM\n\ + package](https://www.npmjs.com/package/apify-client).\n- To access the API using\ + \ [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python)\ + \ [PyPI\npackage](https://pypi.org/project/apify-client/).\n\nThe clients' functions\ + \ correspond to the API endpoints and have the same\nparameters. This simplifies\ + \ development of apps that depend on the Apify\nplatform.\n\n:::note Important\ + \ Request Details\n\n- `Content-Type` header: For requests with a JSON body, you\ + \ must include the `Content-Type: application/json` header.\n\n- Method override:\ + \ You can override the HTTP method using the `method` query parameter. This is\ + \ useful for clients that can only send `GET` requests. For example, to call a\ + \ `POST` endpoint, append `?method=POST` to the URL of your `GET` request.\n\n\ + :::\n\n## Authentication\n\n\n\ + **You can find your API token on the\n[Integrations](https://console.apify.com/settings/integrations)\ + \ page in the\nApify Console.**\n\nTo use your token in a request, either:\n\n\ + - Add the token to your request's `Authorization` header as `Bearer `.\n\ + E.g., `Authorization: Bearer xxxxxxx`.\n[More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization).\n\ + (Recommended).\n- Add it as the `token` parameter to your request URL. (Less secure).\n\ + \nUsing your token in the request header is more secure than using it as a URL\n\ + parameter because URLs are often stored\nin browser history and server logs. This\ + \ creates a chance for someone\nunauthorized to access your API token.\n\n**Never\ + \ share your API token or password with untrusted parties!**\n\nFor more information,\ + \ see our\n[integrations](https://docs.apify.com/platform/integrations) documentation.\n\ + \n### Agentic payments\n\nAI agents can authenticate and pay for Actor runs without\ + \ an Apify account\nusing agentic payments. Instead of an API token, the request\ + \ carries a\npayment credential that both authorizes and pays for the call. Apify\ + \ supports\nthe [x402 protocol](https://docs.apify.com/platform/integrations/x402)\n\ + (`PAYMENT-SIGNATURE` header) and\n[Skyfire](https://docs.apify.com/platform/integrations/skyfire)\n\ + (`skyfire-pay-id` header).\n\n## Basic usage\n\n\nTo run an Actor, send a POST request to the [Run\nActor](#/reference/actors/run-collection/run-actor)\ + \ endpoint using either the\nActor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name\ + \ (e.g.\n`janedoe~my-actor`):\n\n`https://api.apify.com/v2/actors/[actor_id]/runs`\n\ + \nIf the Actor is not runnable anonymously, you will receive a 401 or 403\n[response\ + \ code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status).\nThis means\ + \ you need to add your [secret API\ntoken](https://console.apify.com/account#/integrations)\ + \ to the request's\n`Authorization` header ([recommended](#/introduction/authentication))\ + \ or as a\nURL query parameter `?token=[your_token]` (less secure).\n\nOptionally,\ + \ you can include the query parameters described in the [Run\nActor](#/reference/actors/run-collection/run-actor)\ + \ section to customize your\nrun.\n\nIf you're using Node.js, the best way to\ + \ run an Actor is using the\n`Apify.call()` method from the [Apify\nSDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options).\ + \ It\nruns the Actor using the account you are currently logged into (determined\n\ + by the [secret API token](https://console.apify.com/account#/integrations)).\n\ + The result is an [Actor run\nobject](https://sdk.apify.com/docs/typedefs/actor-run)\ + \ and its output (if\nany).\n\nA typical workflow is as follows:\n\n1. Run an\ + \ Actor or task using the [Run\nActor](#/reference/actors/run-collection/run-actor)\ + \ or [Run\ntask](#/reference/actor-tasks/run-collection/run-task) API endpoints.\n\ + 2. Monitor the Actor run by periodically polling its progress using the [Get\n\ + run](#/reference/actor-runs/run-object-and-its-storages/get-run) API\nendpoint.\n\ + 3. Fetch the results from the [Get\nitems](#/reference/datasets/item-collection/get-items)\ + \ API endpoint using the\n`defaultDatasetId`, which you receive in the Run request\ + \ response.\nAdditional data may be stored in a key-value store. You can fetch\ + \ them from\nthe [Get record](#/reference/key-value-stores/record/get-record)\ + \ API endpoint\nusing the `defaultKeyValueStoreId` and the store's `key`.\n\n\ + **Note**: Instead of periodic polling, you can also run your\n[Actor](#/reference/actors/run-actor-synchronously)\ + \ or\n[task](#/reference/actor-tasks/runs-collection/run-task-synchronously)\n\ + synchronously. This will ensure that the request waits for 300 seconds (5\nminutes)\ + \ for the run to finish and returns its output. If the run takes\nlonger, the\ + \ request will time out and throw an error.\n\n## Legacy `/v2/acts/` URL prefix\n\ + \n\nThe `/v2/acts/` prefix\ + \ is deprecated but still fully functional, and \nsuch endpoint routes to the\ + \ same handler as its `/v2/actors/...` counterpart. \nNew integrations should\ + \ use the canonical /v2/actors/ prefix, \nbut existing clients keep working without\ + \ changes.\n\n## Response structure\n\n\nMost API endpoints return a JSON object with the `data` property:\n\ + \n```\n{\n \"data\": {\n ...\n }\n}\n```\n\nHowever, there are a\ + \ few explicitly described exceptions, such as\n[Get dataset items](#/reference/datasets/item-collection/get-items)\ + \ or\nKey-value store [Get record](#/reference/key-value-stores/record/get-record)\n\ + API endpoints, which return data in other formats.\nIn case of an error, the response\ + \ has the HTTP status code in the range of\n4xx or 5xx and the `data` property\ + \ is replaced with `error`. For example:\n\n```\n{\n \"error\": {\n \ + \ \"type\": \"record-not-found\",\n \"message\": \"Store was not found.\"\ + \n }\n}\n```\n\nSee [Errors](#/introduction/errors) for more details.\n\n##\ + \ Pagination\n\n\nAll API endpoints\ + \ that return a list of records\n(e.g. [Get list of\nActors](#/reference/actors/actor-collection/get-list-of-actors))\n\ + enforce pagination in order to limit the size of their responses.\n\nMost of these\ + \ API endpoints are paginated using the `offset` and `limit`\nquery parameters.\n\ + The only exception is [Get list of\nkeys](#/reference/key-value-stores/key-collection/get-list-of-keys),\n\ + which is paginated using the `exclusiveStartKey` query parameter.\n\n**IMPORTANT**:\ + \ Each API endpoint that supports pagination enforces a certain\nmaximum value\ + \ for the `limit` parameter,\nin order to reduce the load on Apify servers.\n\ + The maximum limit could change in future so you should never\nrely on a specific\ + \ value and check the responses of these API endpoints.\n\n### Using offset\n\ + \n\nMost API endpoints\ + \ that return a list of records enable pagination using the\nfollowing query parameters:\n\ + \n\n \n \n \n\ + \ \n \n \n \n \ + \ \n \n \n \n\ + \ \n
limitLimits the response\ + \ to contain a specific maximum number of items, e.g. limit=20.
offsetSkips a number of\ + \ items from the beginning of the list, e.g. offset=100.
desc\n By default, items\ + \ are sorted in the order in which they were created or added to the list.\n \ + \ This feature is useful when fetching all the items, because it ensures that\ + \ items\n created after the client started the pagination will not be skipped.\n\ + \ If you specify the desc=1 parameter, the items will be returned\ + \ in the reverse order,\n i.e. from the newest to the oldest items.\n
\n\nThe response of these API endpoints is always a JSON object\ + \ with the\nfollowing structure:\n\n```\n{\n \"data\": {\n \"total\"\ + : 2560,\n \"offset\": 250,\n \"limit\": 1000,\n \"count\"\ + : 1000,\n \"desc\": false,\n \"items\": [\n { 1st object\ + \ },\n { 2nd object },\n ...\n { 1000th object\ + \ }\n ]\n }\n}\n```\n\nThe following table describes the meaning of\ + \ the response properties:\n\n\n \n \n \n\ + \ \n \n \n \n \n \n \n\ + \ \n \n \n \n\ + \ \n \n \n \n \n \n \n\ + \ \n \n \n \n\ + \ \n \n\ + \ \n
PropertyDescription
totalThe total number of\ + \ items available in the list.
offsetThe number of items that were skipped at the start.\n This is equal\ + \ to the offset query parameter if it was provided, otherwise it\ + \ is 0.
limitThe maximum number of items that can be returned in the HTTP response.\n\ + \ It equals to the limit query parameter if it was provided or\n\ + \ the maximum limit enforced for the particular API endpoint, whichever is\ + \ smaller.
countThe\ + \ actual number of items returned in the HTTP response.
desctrue if data were requested\ + \ in descending order and false otherwise.
itemsAn array of requested items.
\n\n### Using key\n\n\nThe records in the [key-value\nstore](https://docs.apify.com/platform/storage/key-value-store)\n\ + are not ordered based on numerical indexes,\nbut rather by their keys in the UTF-8\ + \ binary order.\nTherefore the [Get list of\nkeys](#/reference/key-value-stores/key-collection/get-list-of-keys)\n\ + API endpoint only supports pagination using the following query parameters:\n\n\ + \n \n \n \n\ + \ \n \n \n \n \n
limitLimits the response\ + \ to contain a specific maximum number items, e.g. limit=20.
exclusiveStartKeySkips all\ + \ records with keys up to the given key including the given key,\n in the UTF-8\ + \ binary order.
\n\nThe response of the API endpoint is\ + \ always a JSON object with following\nstructure:\n\n```\n{\n \"data\": {\n\ + \ \"limit\": 1000,\n \"isTruncated\": true,\n \"exclusiveStartKey\"\ + : \"my-key\",\n \"nextExclusiveStartKey\": \"some-other-key\",\n \ + \ \"items\": [\n { 1st object },\n { 2nd object },\n \ + \ ...\n { 1000th object }\n ]\n }\n}\n```\n\nThe\ + \ following table describes the meaning of the response properties:\n\n\n\ + \ \n \n \n \n \n \ + \ \n \n \n \n \n\ + \ \n \n \n \n\ + \ \n\ + \ \n \n \n \n \n
PropertyDescription
limitThe maximum number of items that can be\ + \ returned in the HTTP response.\n It equals to the limit query\ + \ parameter if it was provided or\n the maximum limit enforced for the particular\ + \ endpoint, whichever is smaller.
isTruncatedtrue if there are more items left to be queried. Otherwise\ + \ false.
exclusiveStartKeyThe last key that was skipped at the start. Is `null` for the first page.
nextExclusiveStartKeyThe\ + \ value for the exclusiveStartKey parameter to query the next page\ + \ of items.
\n\n## Errors\n\n\nThe Apify API uses common HTTP status codes: `2xx` range for success,\ + \ `4xx`\nrange for errors caused by the caller\n(invalid requests) and `5xx` range\ + \ for server errors (these are rare).\nEach error response contains a JSON object\ + \ defining the `error` property,\nwhich is an object with\nthe `type` and `message`\ + \ properties that contain the error code and a\nhuman-readable error description,\ + \ respectively.\n\nFor example:\n\n```\n{\n \"error\": {\n \"type\"\ + : \"record-not-found\",\n \"message\": \"Store was not found.\"\n }\n\ + }\n```\n\nHere is the table of the most common errors that can occur for many\ + \ API\nendpoints:\n\n\n \n \n \n\ + \ \n \n \n \n \n\ + \ \n \n \n \n\ + \ \n \n \n \n \n \n\ + \ \n \n \n \n\ + \ \n \n \n \n \n \n\ + \ \n \n \n \n\ + \ \n \n \n \n \n\ + \ \n \n \n\ +
statustypemessage
400invalid-requestPOST data must be a JSON object
400invalid-valueInvalid value provided: Comments\ + \ required
400invalid-record-keyRecord key contains invalid character
401token-not-providedAuthentication token was\ + \ not provided
404record-not-foundStore was not found
429rate-limit-exceededYou have exceeded the\ + \ rate limit of ... requests per second
405method-not-allowedThis API endpoint can only\ + \ be accessed using the following HTTP methods: OPTIONS, POST
\n\n## Rate limiting\n\n\ + \nAll API endpoints limit the rate of requests in order to prevent overloading\ + \ of Apify servers by misbehaving clients.\n\nThere are two kinds of rate limits\ + \ - a global rate limit and a per-resource rate limit.\n\n### Global rate limit\n\ + \n\nThe global\ + \ rate limit is set to _250 000 requests per minute_.\nFor [authenticated](#/introduction/authentication)\ + \ requests, it is counted per user,\nand for unauthenticated requests, it is counted\ + \ per IP address.\n\n### Per-resource rate limit\n\n\nThe default per-resource rate limit is _60 requests per second per\ + \ resource_, which in this context means a single Actor, a single Actor run, a\ + \ single dataset, single key-value store etc.\nThe default rate limit is applied\ + \ to every API endpoint except a few select ones, which have higher rate limits.\n\ + Each API endpoint returns its rate limit in `X-RateLimit-Limit` header.\n\nThese\ + \ endpoints have a rate limit of _200 requests per second per resource_:\n\n*\ + \ CRUD ([get](#/reference/key-value-stores/record/get-record),\n [put](#/reference/key-value-stores/record/put-record),\n\ + \ [delete](#/reference/key-value-stores/record/delete-record))\n operations\ + \ on key-value store records\n\nThese endpoints have a rate limit of _400 requests\ + \ per second per resource_:\n* [Run Actor](#/reference/actors/run-collection/run-actor)\n\ + * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously)\n\ + * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously)\n\ + * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run)\n* [Push\ + \ items](#/reference/datasets/item-collection/put-items) to dataset\n* CRUD\n\ + \ ([add](#/reference/request-queues/request-collection/add-request),\n [get](#/reference/request-queues/request-collection/get-request),\n\ + \ [update](#/reference/request-queues/request-collection/update-request),\n \ + \ [delete](#/reference/request-queues/request-collection/delete-request))\n operations\ + \ on requests in request queues\n\n### Rate limit exceeded errors\n\n\nIf the client\ + \ is sending too many requests, the API endpoints respond with the HTTP status\ + \ code `429 Too Many Requests`\nand the following body:\n\n```\n{\n \"error\"\ + : {\n \"type\": \"rate-limit-exceeded\",\n \"message\": \"You have\ + \ exceeded the rate limit of ... requests per second\"\n }\n}\n```\n\n### Retrying\ + \ rate-limited requests with exponential backoff\n\n\nIf the client receives the rate limit error, it should wait a certain\ + \ period of time and then retry the request.\nIf the error happens again, the\ + \ client should double the wait period and retry the request,\nand so on. This\ + \ algorithm is known as _exponential backoff_\nand it can be described using the\ + \ following pseudo-code:\n\n1. Define a variable `DELAY=500`\n2. Send the HTTP\ + \ request to the API endpoint\n3. If the response has status code not equal to\ + \ `429` then you are done. Otherwise:\n * Wait for a period of time chosen randomly\ + \ from the interval `DELAY` to `2*DELAY` milliseconds\n * Double the future\ + \ wait period by setting `DELAY = 2*DELAY`\n * Continue with step 2\n\nIf all\ + \ requests sent by the client implement the above steps,\nthe client will automatically\ + \ use the maximum available bandwidth for its requests.\n\nNote that the Apify\ + \ API clients [for JavaScript](https://docs.apify.com/api/client/js)\nand [for\ + \ Python](https://docs.apify.com/api/client/python)\nuse the exponential backoff\ + \ algorithm transparently, so that you do not need to worry about it.\n\n## Referring\ + \ to resources\n\n\n\ + There are three main ways to refer to a resource you're accessing via API.\n\n\ + - the resource ID (e.g. `iKkPcIgVvwmztduf8`)\n- `username~resourcename` - when\ + \ using this access method, you will need to\nuse your API token, and access will\ + \ only work if you have the correct\npermissions.\n- `~resourcename` - for this,\ + \ you need to use an API token, and the\n`resourcename` refers to a resource in\ + \ the API token owner's account.\n" + license: + name: Apache 2.0 + url: https://www.apache.org/licenses/LICENSE-2.0.html + title: Apify API + version: v2-2026-06-16T064758Z +servers: +- url: https://api.apify.com +security: +- httpBearer: [] +- apiKey: [] +tags: +- description: | + The API endpoints in this section allow you to manage Apify Actors. For more details about Actors, refer to the [Actor documentation](https://docs.apify.com/platform/actors). + + For API endpoints that require the `actorId` parameter to identify an Actor, you can provide either: + - The Actor ID (e.g., `HG7ML7M8z78YcAPEB`), or + - A tilde-separated combination of the Actor owner's username and the Actor name (e.g., `janedoe~my-actor`). + name: Actors + x-displayName: Actors - Introduction + x-legacy-doc-urls: + - "#/reference/actors" + - "#tag/Actors" + - "#/reference/actors/actor-collection" + - "#tag/ActorsActor-collection" + - "#/reference/actors/actor-object" + - "#tag/ActorsActor-object" +- description: | + The API endpoints in this section allow you to manage your Apify Actors versions. + + - The version object contains the source code of a specific version of an Actor. + - The `sourceType` property indicates where the source code is hosted, and based + on its value the Version object has the following additional property: + + | **Value** | **Description** | + |---|---| + | `"SOURCE_FILES"` | Source code is comprised of multiple files specified in the `sourceFiles` array. Each item of the array is an object with the following fields:
- `name`: File path and name
- `format`: Format of the content, can be either `"TEXT"` or `"BASE64"`
- `content`: File content

Source files can be shown and edited in the Apify Console's Web IDE. | + | `"GIT_REPO"` | Source code is cloned from a Git repository, whose URL is specified in the `gitRepoUrl` field. | + | `"TARBALL"` | Source code is downloaded using a tarball or Zip file from a URL specified in the `tarballUrl` field. | + |`"GITHUB_GIST"`| Source code is taken from a GitHub Gist, whose URL is specified in the `gitHubGistUrl` field. | + + For more information about source code and Actor versions, check out [Source code](https://docs.apify.com/platform/actors/development/actor-definition/source-code) + in Actors documentation. + name: Actors/Actor versions + x-displayName: Actor versions - Introduction + x-parent-tag-name: Actors + x-legacy-doc-urls: + - "#/reference/actors/version-collection" + - "#tag/ActorsVersion-collection" + - "#/reference/actors/version-object" + - "#tag/ActorsVersion-object" + - "#/reference/actors/environment-variable-collection" + - "#tag/ActorsEnvironment-variable-collection" + - "#/reference/actors/environment-variable-object" + - "#tag/ActorsEnvironment-variable-object" + x-trait: "true" +- description: | + The API endpoints in this section allow you to manage your Apify Actors builds. + name: Actors/Actor builds + x-displayName: Actor builds - Introduction + x-parent-tag-name: Actors + x-legacy-doc-urls: + - "#/reference/actors/build-collection" + - "#tag/ActorsBuild-collection" + - "#/reference/actors/build-object" + - "#tag/ActorsBuild-object" + - "#tag/ActorsAbort-build" + x-trait: "true" +- description: | + The API endpoints in this section allow you to manage your Apify Actors runs. + + Some API endpoints return run objects. If a run object includes usage costs in dollars, note that these values are calculated based on your effective unit pricing at the time of the query. As a result, the dollar amounts should be treated as informational only and not as exact figures. + + For completed runs, aggregated fields such as `stats` or dollar usage totals are eventually consistent and update within a few seconds. For values that must match finalized totals, wait about 10 seconds after the run completed, then fetch the run again. + + For more information about platform usage and resource calculations, see the [Usage and Resources documentation](https://docs.apify.com/platform/actors/running/usage-and-resources#usage). + name: Actors/Actor runs + x-displayName: Actor runs - Introduction + x-parent-tag-name: Actors + x-legacy-doc-urls: + - "#/reference/actors/run-collection" + - "#tag/ActorsRun-collection" + - "#tag/ActorsResurrect-run" + - "#tag/ActorsMetamorph-run" + - "#tag/ActorsAbort-run" + - "#/reference/actors/run-object" + - "#tag/ActorsRun-object" + - "#/reference/actors/run-actor-synchronously" + - "#tag/ActorsRun-actor-synchronously" + - "#/reference/actors/run-actor-synchronously-and-get-dataset-items" + - "#tag/ActorsRun-Actor-synchronously-and-get-dataset-items" + - "#/reference/actors/last-run-object-and-its-storages" + - "#tag/ActorsLast-run-object-and-its-storages" + x-trait: "true" +- description: | + The API endpoint in this section allows you to get a list of webhooks of a specific Actor. + name: Actors/Webhook collection + x-displayName: Webhook collection - Introduction + x-parent-tag-name: Actors + x-legacy-doc-urls: + - "#/reference/actors/webhook-collection" + - "#tag/ActorsWebhook-collection" + x-trait: "true" +- description: | + The API endpoints described in this section enable you to manage, and delete Apify Actor builds. + + Note that if any returned build object contains usage in dollars, your effective + unit pricing at the time of query has been used for computation of this dollar equivalent, and hence it should be + used only for informative purposes. + + You can learn more about platform usage in the [documentation](https://docs.apify.com/platform/actors/running/usage-and-resources#usage). + name: Actor builds + x-displayName: Actor builds - Introduction + x-legacy-doc-urls: + - "#/reference/actor-builds" + - "#tag/Actor-builds" + - "#/reference/actor-builds/build-collection" + - "#tag/Actor-buildsBuild-collection" + - "#/reference/actor-builds/build-object" + - "#tag/Actor-buildsBuild-object" + - "#tag/Actor-buildsDelete-build" + - "#tag/Actor-buildsAbort-build" + - "#/reference/actor-builds/build-log" + - "#tag/Actor-buildsBuild-log" +- description: | + The API endpoints described in this section enable you to manage, and delete Apify Actor runs. + + If any returned run object contains usage in dollars, your effective unit pricing at the time of query + has been used for computation of this dollar equivalent, and hence it should be used only for informative purposes. + + For completed runs, aggregated fields such as `stats` or dollar usage totals are eventually consistent and update within a few seconds. For values that must match finalized totals, wait about 10 seconds after the run completed, then fetch the run again. + + You can learn more about platform usage in the [documentation](https://docs.apify.com/platform/actors/running/usage-and-resources#usage). + name: Actor runs + x-displayName: Actor runs - Introduction + x-legacy-doc-urls: + - "#/reference/actor-runs" + - "#tag/Actor-runs" + - "#/reference/actor-runs/run-collection" + - "#tag/Actor-runsRun-collection" + - "#/reference/actor-runs/run-object-and-its-storages" + - "#tag/Actor-runsRun-object-and-its-storages" +- description: | + The API endpoints described in this section enable you to create, manage, delete, and run Apify Actor tasks. + For more information, see the [Actor tasts documentation](https://docs.apify.com/platform/actors/running/tasks). + + :::note + + For all the API endpoints that accept the `actorTaskId` parameter to + specify a task, you can pass either the task ID (e.g. `HG7ML7M8z78YcAPEB`) or a tilde-separated + username of the task's owner and the task's name (e.g. `janedoe~my-task`). + + ::: + + Some of the API endpoints return run objects. If any such run object + contains usage in dollars, your effective unit pricing at the time of query + has been used for computation of this dollar equivalent, and hence it should be + used only for informative purposes. + + You can learn more about platform usage in the [documentation](https://docs.apify.com/platform/actors/running/usage-and-resources#usage). + name: Actor tasks + x-displayName: Actor tasks - Introduction + x-legacy-doc-urls: + - "#/reference/actor-tasks" + - "#tag/Actor-tasks" + - "#/reference/actor-tasks/task-collection" + - "#tag/Actor-tasksTask-collection" + - "#/reference/actor-tasks/task-object" + - "#tag/Actor-tasksTask-object" + - "#/reference/actor-tasks/task-input-object" + - "#tag/Actor-tasksTask-input-object" + - "#/reference/actor-tasks/webhook-collection" + - "#tag/Actor-tasksWebhook-collection" + - "#/reference/actor-tasks/run-collection" + - "#tag/Actor-tasksRun-collection" + - "#/reference/actor-tasks/run-task-synchronously" + - "#tag/Actor-tasksRun-task-synchronously" + - "#/reference/actor-tasks/run-task-synchronously-and-get-dataset-items" + - "#tag/Actor-tasksRun-task-synchronously-and-get-dataset-items" + - "#/reference/actor-tasks/last-run-object-and-its-storages" + - "#tag/Actor-tasksLast-run-object-and-its-storages" +- description: "Storage-related API endpoints for managing datasets, key-value stores,\ + \ and request queues." + name: Storage + x-displayName: "" +- description: | + This section describes API endpoints to manage Datasets. + + Dataset is a storage for structured data, where each record stored has the same attributes, + such as online store products or real estate offers. You can imagine it as a table, + where each object is a row and its attributes are columns. Dataset is an append-only + storage - you can only add new records to it but you cannot modify or remove existing + records. Typically it is used to store crawling results. + + For more information, see the [Datasets documentation](https://docs.apify.com/platform/storage/dataset). + + :::note + + Some of the endpoints do not require the authentication token, the calls + are authenticated using the hard-to-guess ID of the dataset. + + ::: + name: Storage/Datasets + x-displayName: Datasets - Introduction + x-parent-tag-name: Storage + x-legacy-doc-urls: + - "#/reference/datasets" + - "#tag/Datasets" + - "#/reference/datasets/dataset-collection" + - "#tag/DatasetsDataset-collection" + - "#/reference/datasets/dataset" + - "#tag/DatasetsDataset" + - "#/reference/datasets/item-collection" + - "#tag/DatasetsItem-collection" + x-trait: "true" +- description: | + This section describes API endpoints to manage Key-value stores. + Key-value store is a simple storage for saving and reading data records or files. + Each data record is represented by a unique key and associated with a MIME content type. + Key-value stores are ideal for saving screenshots, Actor inputs and outputs, web pages, + PDFs or to persist the state of crawlers. + + For more information, see the [Key-value store documentation](https://docs.apify.com/platform/storage/key-value-store). + + :::note + + Some of the endpoints do not require the authentication token, the calls + are authenticated using a hard-to-guess ID of the key-value store. + + ::: + name: Storage/Key-value stores + x-displayName: Key-value stores - Introduction + x-parent-tag-name: Storage + x-legacy-doc-urls: + - "#/reference/key-value-stores/key-collection" + - "#tag/Key-value-storesKey-collection" + - "#/reference/key-value-stores/store-collection" + - "#tag/Key-value-storesStore-collection" + - "#/reference/key-value-stores/store-object" + - "#tag/Key-value-storesStore-object" + - "#/reference/key-value-stores/record" + - "#tag/Key-value-storesRecord" + - "#/reference/key-value-stores" + - "#tag/Key-value-stores" + x-trait: "true" +- description: | + This section describes API endpoints to create, manage, and delete request queues. + + Request queue is a storage for a queue of HTTP URLs to crawl, which is typically + used for deep crawling of websites where you + start with several URLs and then recursively follow links to other pages. + The storage supports both breadth-first and depth-first crawling orders. + + For more information, see the [Request queue documentation](https://docs.apify.com/platform/storage/request-queue). + + :::note + + Some of the endpoints do not require the authentication token, the calls + are authenticated using the hard-to-guess ID of the queue. + + ::: + name: Storage/Request queues + x-displayName: Request queues - Introduction + x-parent-tag-name: Storage + x-legacy-doc-urls: + - "#/reference/request-queues" + - "#tag/Request-queues" + - "#/reference/request-queues/queue-collection" + - "#tag/Request-queuesQueue-collection" + - "#/reference/request-queues/queue" + - "#tag/Request-queuesQueue" + - "#/reference/request-queues/batch-request-operations" + - "#tag/Request-queuesBatch-request-operations" +- description: | + This section describes API endpoints to create, manage, and delete requests within request queues. + + Request queue is a storage for a queue of HTTP URLs to crawl, which is typically + used for deep crawling of websites where you + start with several URLs and then recursively follow links to other pages. + The storage supports both breadth-first and depth-first crawling orders. + + For more information, see the [Request queue documentation](https://docs.apify.com/platform/storage/request-queue). + + :::note + + Some of the endpoints do not require the authentication token, the calls + are authenticated using the hard-to-guess ID of the queue. + + ::: + name: Storage/Request queues/Requests + x-displayName: Requests - Introduction + x-parent-tag-name: Storage + x-legacy-doc-urls: + - "#/reference/request-queues/request-collection" + - "#tag/Request-queuesRequest-collection" + - "#/reference/request-queues/request" + - "#tag/Request-queuesRequest" +- description: | + This section describes API endpoints to create, manage, and delete request locks within request queues. + + Request queue is a storage for a queue of HTTP URLs to crawl, which is typically + used for deep crawling of websites where you + start with several URLs and then recursively follow links to other pages. + The storage supports both breadth-first and depth-first crawling orders. + + For more information, see the [Request queue documentation](https://docs.apify.com/platform/storage/request-queue). + + :::note + + Some of the endpoints do not require the authentication token, the calls + are authenticated using the hard-to-guess ID of the queue. + + ::: + name: Storage/Request queues/Requests locks + x-displayName: Requests locks - Introduction + x-parent-tag-name: Storage + x-legacy-doc-urls: + - "#/reference/request-queues/request-lock" + - "#tag/Request-queuesRequest-lock" + - "#/reference/request-queues/queue-head" + - "#tag/Request-queuesQueue-head" + - "#/reference/request-queues/queue-head-with-locks" + - "#tag/Request-queuesQueue-head-with-locks" +- description: Webhook-related API endpoints for configuring automated notifications. + name: Webhooks + x-displayName: "" +- description: | + This section describes API endpoints to manage webhooks. + + Webhooks provide an easy and reliable way to configure the Apify platform + to carry out an action (e.g. a HTTP request to another service) when a certain + system event occurs. + For example, you can use webhooks to start another Actor when an Actor run finishes + or fails. + + For more information see [Webhooks documentation](https://docs.apify.com/platform/integrations/webhooks). + name: Webhooks/Webhooks + x-displayName: Webhooks - Introduction + x-parent-tag-name: Webhooks + x-legacy-doc-urls: + - "#/reference/webhooks" + - "#tag/Webhooks" + - "#/reference/webhooks/webhook-collection" + - "#tag/WebhooksWebhook-collection" + - "#/reference/webhooks/webhook-object" + - "#tag/WebhooksWebhook-object" + - "#/reference/webhooks/webhook-test" + - "#tag/WebhooksWebhook-test" + - "#/reference/webhooks/dispatches-collection" + - "#tag/WebhooksDispatches-collection" +- description: This section describes API endpoints to get webhook dispatches. + name: Webhooks/Webhook dispatches + x-displayName: Webhook dispatches - Introduction + x-parent-tag-name: Webhooks + x-legacy-doc-urls: + - "#/reference/webhook-dispatches" + - "#tag/Webhook-dispatches" + - "#/reference/webhook-dispatches/webhook-dispatches-collection" + - "#tag/Webhook-dispatchesWebhook-dispatches-collection" + - "#/reference/webhook-dispatches/webhook-dispatch-object" + - "#tag/Webhook-dispatchesWebhook-dispatch-object" +- description: | + This section describes API endpoints for managing schedules. + + Schedules are used to automatically start your Actors at certain times. Each schedule + can be associated with a number of Actors and Actor tasks. It is also possible + to override the settings of each Actor (task) similarly to when invoking the Actor + (task) using the API. + For more information, see [Schedules documentation](https://docs.apify.com/platform/schedules). + + Each schedule is assigned actions for it to perform. Actions can be of two types + - `RUN_ACTOR` and `RUN_ACTOR_TASK`. + + For details, see the documentation of the [Get schedule](#/reference/schedules/schedule-object/get-schedule) endpoint. + name: Schedules + x-displayName: Schedules - Introduction + x-legacy-doc-urls: + - "#/reference/schedules" + - "#tag/Schedules" + - "#/reference/schedules/schedules-collection" + - "#tag/SchedulesSchedules-collection" + - "#/reference/schedules/schedule-object" + - "#tag/SchedulesSchedule-object" + - "#/reference/schedules/schedule-log" + - "#tag/SchedulesSchedule-log" + x-trait: "true" +- description: | + [Apify Store](https://apify.com/store) is home to thousands of public Actors available + to the Apify community. + The API endpoints described in this section are used to retrieve these Actors. + + :::note + + These endpoints do not require the authentication token. + + ::: + name: Store + x-displayName: Store - Introduction + x-legacy-doc-urls: + - "#/reference/store" + - "#tag/Store" + - "#/reference/store/store-actors-collection" + - "#tag/StoreStore-Actors-collection" + x-trait: true +- description: | + The API endpoints described in this section are used the download the logs + generated by Actor builds and runs. Note that only the trailing 5M characters + of the log are stored, the rest is discarded. + + :::note + + Note that the endpoints do not require the authentication token, the calls + are authenticated using a hard-to-guess ID of the Actor build or run. + + ::: + name: Logs + x-displayName: Logs - Introduction + x-legacy-doc-urls: + - "#/reference/logs" + - "#tag/Logs" + - "#/reference/logs/log" + - "#tag/LogsLog" + x-trait: true +- description: The API endpoints described in this section return information about + user accounts. + name: Users + x-displayName: Users - Introduction + x-legacy-doc-urls: + - "#/reference/users" + - "#tag/Users" + - "#/reference/users/public-data" + - "#tag/UsersPublic-data" + - "#/reference/users/private-data" + - "#tag/UsersPrivate-data" + - "#/reference/users/monthly-usage" + - "#tag/UsersMonthly-usage" + - "#/reference/users/account-and-usage-limits" + - "#tag/UsersAccount-and-usage-limits" + x-trait: true +- description: | + The API endpoints described in this section provide utility tools for encoding, + signing, and verifying data, as well as inspecting HTTP request details. + name: Tools + x-displayName: Tools - Introduction +- description: | + The API endpoints described in this section are convenience endpoints that provide access to Actor run's default dataset without the need to resolve the dataset ID first. + + Subset of functionality described in: [Datasets](/api/v2/storage-datasets) + name: Default dataset + x-displayName: Default dataset - Introduction +- description: | + The API endpoints described in this section are convenience endpoints that provide access to Actor run's default key-value store without the need to resolve the key-value store ID first. + + Subset of functionality described in: [Key-value stores](/api/v2/storage-key-value-stores) + name: Default key-value store + x-displayName: Default key-value store - Introduction +- description: | + The API endpoints described in this section are convenience endpoints that provide access to Actor run's default request queue without the need to resolve the request queue ID first. + + Subset of functionality described in: [Request queues](/api/v2/storage-request-queues) + name: Default request queue + x-displayName: Default request queue - Introduction +- description: | + The API endpoints described in this section are convenience endpoints that provide access to Actor's last run's default dataset without the need to resolve the dataset ID first. + + Subset of functionality described in: [Datasets](/api/v2/storage-datasets) + name: Last Actor run's default dataset + x-displayName: Last Actor run's default dataset - Introduction +- description: | + The API endpoints described in this section are convenience endpoints that provide access to Actor's last run's default key-value store without the need to resolve the key-value store ID first. + + Subset of functionality described in: [Key-value stores](/api/v2/storage-key-value-stores) + name: Last Actor run's default key-value store + x-displayName: Last Actor run's default key-value store - Introduction +- description: | + The API endpoints described in this section are convenience endpoints that provide access to Actor's last run's default request queue without the need to resolve the request queue ID first. + + Subset of functionality described in: [Request queues](/api/v2/storage-request-queues) + name: Last Actor run's default request queue + x-displayName: Last Actor run's default request queue - Introduction +- description: | + The API endpoint described in this section is convenience endpoint that provides access to last Actor run's log. + + Same as of functionality described in: [Logs](/api/v2/logs) + name: Last Actor run's log + x-displayName: Last Actor run's log - Introduction +- description: | + The API endpoint described in this section is a convenience endpoint that aborts the Actor's last run. + + Same as of functionality described in: [Abort run](/api/v2/actor-run-abort-post) + name: Last Actor run's abort + x-displayName: Last Actor run's abort - Introduction +- description: | + The API endpoint described in this section is a convenience endpoint that metamorphs the Actor's last run into a run of another Actor. + + Same as of functionality described in: [Metamorph run](/api/v2/actor-run-metamorph-post) + name: Last Actor run's metamorph + x-displayName: Last Actor run's metamorph - Introduction +- description: | + The API endpoint described in this section is a convenience endpoint that reboots the Actor's last run. + + Same as of functionality described in: [Reboot run](/api/v2/actor-run-reboot-post) + name: Last Actor run's reboot + x-displayName: Last Actor run's reboot - Introduction +- description: | + The API endpoint described in this section is convenience endpoint that provides access to last Actor task run's log. + + Same as of functionality described in: [Logs](/api/v2/logs) + name: Last Actor task run's log + x-displayName: Last Actor task run's log - Introduction +- description: | + The API endpoint described in this section is a convenience endpoint that aborts the Actor task's last run. + + Same as of functionality described in: [Abort run](/api/v2/actor-run-abort-post) + name: Last Actor task run's abort + x-displayName: Last Actor task run's abort - Introduction +- description: | + The API endpoint described in this section is a convenience endpoint that metamorphs the Actor task's last run into a run of another Actor. + + Same as of functionality described in: [Metamorph run](/api/v2/actor-run-metamorph-post) + name: Last Actor task run's metamorph + x-displayName: Last Actor task run's metamorph - Introduction +- description: | + The API endpoint described in this section is a convenience endpoint that reboots the Actor task's last run. + + Same as of functionality described in: [Reboot run](/api/v2/actor-run-reboot-post) + name: Last Actor task run's reboot + x-displayName: Last Actor task run's reboot - Introduction +- description: | + The API endpoints described in this section are convenience endpoints that provide access to Actor task's last run's default dataset without the need to resolve the dataset ID first. + + Subset of functionality described in: [Datasets](/api/v2/storage-datasets) + name: Last Actor task run's default dataset + x-displayName: Last Actor task run's default dataset - Introduction +- description: | + The API endpoints described in this section are convenience endpoints that provide access to Actor task's last run's default key-value store without the need to resolve the key-value store ID first. + + Subset of functionality described in: [Key-value stores](/api/v2/storage-key-value-stores) + name: Last Actor task run's default key-value store + x-displayName: Last Actor task run's default key-value store - Introduction +- description: | + The API endpoints described in this section are convenience endpoints that provide access to Actor task's last run's default request queue without the need to resolve the request queue ID first. + + Subset of functionality described in: [Request queues](/api/v2/storage-request-queues) + name: Last Actor task run's default request queue + x-displayName: Last Actor task run's default request queue - Introduction +paths: + /v2/actors: + get: + deprecated: false + description: | + Gets the list of all Actors that the user created or used. The response is a + list of objects, where each object contains a basic information about a single Actor. + + To only get Actors created by the user, add the `my=1` query parameter. + + The endpoint supports pagination using the `limit` and `offset` parameters + and it will not return more than 1000 records. + + By default, the records are sorted by the `createdAt` field in ascending + order, therefore you can use pagination to incrementally fetch all Actors while new + ones are still being created. To sort the records in descending order, use the `desc=1` parameter. + + You can also sort by your last run by using the `sortBy=stats.lastRunStartedAt` query parameter. + In this case, descending order means the most recently run Actor appears first. + operationId: acts_get + parameters: + - description: | + If `true` or `1` then the returned list only contains Actors owned by the user. The default value is `false`. + explode: true + in: query + name: my + required: false + schema: + example: true + type: boolean + style: form + - $ref: "#/components/parameters/offset" + - $ref: "#/components/parameters/limit" + - $ref: "#/components/parameters/descCreatedAt" + - description: | + Field to sort the records by. The default is `createdAt`. You can also use `stats.lastRunStartedAt` to sort + by the most recently ran Actors. + explode: true + in: query + name: sortBy + required: false + schema: + enum: + - createdAt + - stats.lastRunStartedAt + example: createdAt + type: string + style: form + responses: + "200": + content: + application/json: + example: + data: + total: 2 + count: 2 + offset: 0 + limit: 1000 + desc: false + items: + - id: br9CKmk457 + createdAt: 2019-10-29T07:34:24.202Z + modifiedAt: 2019-10-30T07:34:24.202Z + name: MyAct + username: janedoe + - id: ksiEKo23pz + createdAt: 2019-11-30T07:34:24.202Z + modifiedAt: 2019-12-12T07:34:24.202Z + name: MySecondAct + username: janedoe + schema: + $ref: "#/components/schemas/ListOfActorsResponse" + description: "" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Get list of Actors + tags: + - Actors + x-legacy-doc-urls: + - https://docs.apify.com/api/v2#/reference/actors/actor-collection/get-list-of-actors + - https://docs.apify.com/api/v2#/reference/actors/get-list-of-actors + - https://docs.apify.com/api/v2#tag/ActorsActor-collection/operation/acts_get + x-js-parent: ActorCollectionClient + x-js-name: list + x-js-doc-url: https://docs.apify.com/api/client/js/reference/class/ActorCollectionClient#list + x-py-parent: ActorCollectionClientAsync + x-py-name: list + x-py-doc-url: https://docs.apify.com/api/client/python/reference/class/ActorCollectionClientAsync#list + post: + deprecated: false + description: | + Creates a new Actor with settings specified in an Actor object passed as + JSON in the POST payload. + The response is the full Actor object as returned by the + [Get Actor](#/reference/actors/actor-object/get-actor) endpoint. + + The HTTP request must have the `Content-Type: application/json` HTTP header! + + The Actor needs to define at least one version of the source code. + For more information, see [Version object](#/reference/actors/version-object). + + If you want to make your Actor + [public](https://docs.apify.com/platform/actors/publishing) using `isPublic: + true`, you will need to provide the Actor's `title` and the `categories` + under which that Actor will be classified in Apify Store. For this, it's + best to use the [constants from our `apify-shared-js` + package](https://github.com/apify/apify-shared-js/blob/2d43ebc41ece9ad31cd6525bd523fb86939bf860/packages/consts/src/consts.ts#L452-L471). + operationId: acts_post + requestBody: + content: + application/json: + example: + name: MyActor + description: My favourite Actor! + title: My Actor + isPublic: false + seoTitle: My Actor + seoDescription: My Actor is the best + versions: + - versionNumber: "0.0" + sourceType: SOURCE_FILES + envVars: + - name: DOMAIN + value: http://example.com + isSecret: false + - name: SECRET_PASSWORD + value: MyTopSecretPassword123 + isSecret: true + applyEnvVarsToBuild: false + buildTag: latest + sourceFiles: [] + categories: [] + defaultRunOptions: + build: latest + timeoutSecs: 3600 + memoryMbytes: 2048 + restartOnError: false + schema: + $ref: "#/components/schemas/CreateActorRequest" + description: "" + required: true + responses: + "201": + content: + application/json: + example: + data: + id: zdc3Pyhyz3m8vjDeM + userId: wRsJZtadYvn4mBZmm + name: MyActor + username: jane35 + description: My favourite Actor! + isPublic: false + createdAt: 2019-07-08T11:27:57.401Z + modifiedAt: 2019-07-08T14:01:05.546Z + stats: + totalBuilds: 9 + totalRuns: 16 + totalUsers: 6 + totalUsers7Days: 2 + totalUsers30Days: 6 + totalUsers90Days: 6 + totalMetamorphs: 2 + lastRunStartedAt: 2019-07-08T14:01:05.546Z + versions: + - versionNumber: "0.1" + envVars: null + sourceType: SOURCE_FILES + applyEnvVarsToBuild: false + buildTag: latest + sourceFiles: [] + - versionNumber: "0.2" + sourceType: GIT_REPO + envVars: null + applyEnvVarsToBuild: false + buildTag: latest + gitRepoUrl: https://github.com/jane35/my-actor + - versionNumber: "0.3" + sourceType: TARBALL + envVars: null + applyEnvVarsToBuild: false + buildTag: latest + tarballUrl: https://github.com/jane35/my-actor/archive/master.zip + - versionNumber: "0.4" + sourceType: GITHUB_GIST + envVars: null + applyEnvVarsToBuild: false + buildTag: latest + gitHubGistUrl: https://gist.github.com/jane35/e51feb784yu89 + defaultRunOptions: + build: latest + timeoutSecs: 3600 + memoryMbytes: 2048 + restartOnError: false + exampleRunInput: + body: "{ \"helloWorld\": 123 }" + contentType: application/json; charset=utf-8 + isDeprecated: false + deploymentKey: ssh-rsa AAAA ... + title: My Actor + taggedBuilds: + latest: + buildId: z2EryhbfhgSyqj6Hn + buildNumber: 0.0.2 + finishedAt: 2019-06-10T11:15:49.286Z + schema: + $ref: "#/components/schemas/ActorResponse" + description: "" + headers: + Location: + content: + text/plain: + example: https://api.apify.com/v2/actors/zdc3Pyhyz3m8vjDeM + schema: + type: string + explode: false + style: simple + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "413": + $ref: "#/components/responses/PayloadTooLarge" + "415": + $ref: "#/components/responses/UnsupportedMediaType" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Create Actor + tags: + - Actors + x-legacy-doc-urls: + - https://docs.apify.com/api/v2#/reference/actors/actor-collection/create-actor + - https://docs.apify.com/api/v2#/reference/actors/create-actor + - https://docs.apify.com/api/v2#tag/ActorsActor-collection/operation/acts_post + x-js-parent: ActorCollectionClient + x-js-name: create + x-js-doc-url: https://docs.apify.com/api/client/js/reference/class/ActorCollectionClient#create + x-py-parent: ActorCollectionClientAsync + x-py-name: create + x-py-doc-url: https://docs.apify.com/api/client/python/reference/class/ActorCollectionClientAsync#create + /v2/actors/{actorId}: + delete: + deprecated: false + description: Deletes an Actor. + operationId: act_delete + parameters: + - $ref: "#/components/parameters/actorId" + responses: + "204": + content: + application/json: + example: {} + schema: + example: {} + type: object + description: "" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Delete Actor + tags: + - Actors + x-legacy-doc-urls: + - https://docs.apify.com/api/v2#/reference/actors/actor-object/delete-actor + - https://docs.apify.com/api/v2#/reference/actors/delete-actor + - https://docs.apify.com/api/v2#tag/ActorsActor-object/operation/act_delete + x-js-parent: ActorClient + x-js-name: delete + x-js-doc-url: https://docs.apify.com/api/client/js/reference/class/ActorClient#delete + get: + deprecated: false + description: Gets an object that contains all the details about a specific Actor. + operationId: act_get + parameters: + - $ref: "#/components/parameters/actorId" + responses: + "200": + content: + application/json: + example: + data: + id: zdc3Pyhyz3m8vjDeM + userId: wRsJZtadYvn4mBZmm + name: MyActor + username: jane35 + description: My favourite Actor! + isPublic: false + createdAt: 2019-07-08T11:27:57.401Z + modifiedAt: 2019-07-08T14:01:05.546Z + stats: + totalBuilds: 9 + totalRuns: 16 + totalUsers: 6 + totalUsers7Days: 2 + totalUsers30Days: 6 + totalUsers90Days: 6 + totalMetamorphs: 2 + lastRunStartedAt: 2019-07-08T14:01:05.546Z + versions: + - versionNumber: "0.1" + envVars: null + sourceType: SOURCE_FILES + applyEnvVarsToBuild: false + buildTag: latest + sourceFiles: [] + - versionNumber: "0.2" + sourceType: GIT_REPO + envVars: null + applyEnvVarsToBuild: false + buildTag: latest + gitRepoUrl: https://github.com/jane35/my-actor + - versionNumber: "0.3" + sourceType: TARBALL + envVars: null + applyEnvVarsToBuild: false + buildTag: latest + tarballUrl: https://github.com/jane35/my-actor/archive/master.zip + - versionNumber: "0.4" + sourceType: GITHUB_GIST + envVars: null + applyEnvVarsToBuild: false + buildTag: latest + gitHubGistUrl: https://gist.github.com/jane35/e51feb784yu89 + defaultRunOptions: + build: latest + timeoutSecs: 3600 + memoryMbytes: 2048 + restartOnError: false + exampleRunInput: + body: "{ \"helloWorld\": 123 }" + contentType: application/json; charset=utf-8 + isDeprecated: false + deploymentKey: ssh-rsa AAAA ... + title: My Actor + taggedBuilds: + latest: + buildId: z2EryhbfhgSyqj6Hn + buildNumber: 0.0.2 + finishedAt: 2019-06-10T11:15:49.286Z + schema: + $ref: "#/components/schemas/ActorResponse" + description: "" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Get Actor + tags: + - Actors + x-legacy-doc-urls: + - https://docs.apify.com/api/v2#/reference/actors/actor-object/get-actor + - https://docs.apify.com/api/v2#/reference/actors/get-actor + - https://docs.apify.com/api/v2#tag/ActorsActor-object/operation/act_get + x-js-parent: ActorClient + x-js-name: get + x-js-doc-url: https://docs.apify.com/api/client/js/reference/class/ActorClient#get + x-py-parent: ActorClientAsync + x-py-name: get + x-py-doc-url: https://docs.apify.com/api/client/python/reference/class/ActorClientAsync#get + put: + deprecated: false + description: | + Updates settings of an Actor using values specified by an Actor object + passed as JSON in the POST payload. + If the object does not define a specific property, its value will not be + updated. + + The response is the full Actor object as returned by the + [Get Actor](#/reference/actors/actor-object/get-actor) endpoint. + + The request needs to specify the `Content-Type: application/json` HTTP header! + + When providing your API authentication token, we recommend using the + request's `Authorization` header, rather than the URL. ([More + info](#/introduction/authentication)). + + If you want to make your Actor + [public](https://docs.apify.com/platform/actors/publishing) using `isPublic: + true`, you will need to provide the Actor's `title` and the `categories` + under which that Actor will be classified in Apify Store. For this, it's + best to use the [constants from our `apify-shared-js` + package](https://github.com/apify/apify-shared-js/blob/2d43ebc41ece9ad31cd6525bd523fb86939bf860/packages/consts/src/consts.ts#L452-L471). + operationId: act_put + parameters: + - $ref: "#/components/parameters/actorId" + requestBody: + content: + application/json: + examples: + common: + summary: Common example + value: + name: MyActor + description: My favourite Actor! + isPublic: false + actorPermissionLevel: LIMITED_PERMISSIONS + seoTitle: My Actor + seoDescription: My Actor is the best + title: My Actor + versions: + - versionNumber: "0.0" + sourceType: SOURCE_FILES + envVars: + - name: DOMAIN + value: http://example.com + isSecret: false + - name: SECRET_PASSWORD + value: MyTopSecretPassword123 + isSecret: true + applyEnvVarsToBuild: false + buildTag: latest + sourceFiles: [] + categories: [] + defaultRunOptions: + build: latest + timeoutSecs: 3600 + memoryMbytes: 2048 + restartOnError: false + taggedBuildsCreateOrReassignTag: + summary: Create or reassign a build tag + value: + name: MyActor + isPublic: false + versions: [] + taggedBuilds: + latest: + buildId: z2EryhbfhgSyqj6Hn + taggedBuildsRemoveTag: + summary: Remove a build tag + value: + name: MyActor + isPublic: false + versions: [] + taggedBuilds: + latest: null + taggedBuildsMultipleOperations: + summary: Update multiple build tags at once + value: + name: MyActor + isPublic: false + versions: [] + taggedBuilds: + latest: + buildId: z2EryhbfhgSyqj6Hn + beta: null + schema: + $ref: "#/components/schemas/UpdateActorRequest" + description: "" + required: true + responses: + "200": + content: + application/json: + example: + data: + id: zdc3Pyhyz3m8vjDeM + userId: wRsJZtadYvn4mBZmm + name: MyActor + username: jane35 + description: My favourite Actor! + isPublic: false + actorPermissionLevel: LIMITED_PERMISSIONS + createdAt: 2019-07-08T11:27:57.401Z + modifiedAt: 2019-07-08T14:01:05.546Z + stats: + totalBuilds: 9 + totalRuns: 16 + totalUsers: 6 + totalUsers7Days: 2 + totalUsers30Days: 6 + totalUsers90Days: 6 + totalMetamorphs: 2 + lastRunStartedAt: 2019-07-08T14:01:05.546Z + versions: + - versionNumber: "0.1" + envVars: null + sourceType: SOURCE_FILES + applyEnvVarsToBuild: false + buildTag: latest + sourceFiles: [] + - versionNumber: "0.2" + sourceType: GIT_REPO + envVars: null + applyEnvVarsToBuild: false + buildTag: latest + gitRepoUrl: https://github.com/jane35/my-actor + - versionNumber: "0.3" + sourceType: TARBALL + envVars: null + applyEnvVarsToBuild: false + buildTag: latest + tarballUrl: https://github.com/jane35/my-actor/archive/master.zip + - versionNumber: "0.4" + sourceType: GITHUB_GIST + envVars: null + applyEnvVarsToBuild: false + buildTag: latest + gitHubGistUrl: https://gist.github.com/jane35/e51feb784yu89 + defaultRunOptions: + build: latest + timeoutSecs: 3600 + memoryMbytes: 2048 + restartOnError: false + exampleRunInput: + body: "{ \"helloWorld\": 123 }" + contentType: application/json; charset=utf-8 + isDeprecated: false + deploymentKey: ssh-rsa AAAA ... + title: My Actor + taggedBuilds: + latest: + buildId: z2EryhbfhgSyqj6Hn + buildNumber: 0.0.2 + finishedAt: 2019-06-10T11:15:49.286Z + schema: + $ref: "#/components/schemas/ActorResponse" + description: "" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "413": + $ref: "#/components/responses/PayloadTooLarge" + "415": + $ref: "#/components/responses/UnsupportedMediaType" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Update Actor + tags: + - Actors + x-legacy-doc-urls: + - https://docs.apify.com/api/v2#/reference/actors/actor-object/update-actor + - https://docs.apify.com/api/v2#/reference/actors/update-actor + - https://docs.apify.com/api/v2#tag/ActorsActor-object/operation/act_put + x-js-parent: ActorClient + x-js-name: update + x-js-doc-url: https://docs.apify.com/api/client/js/reference/class/ActorClient#update + x-py-parent: ActorClientAsync + x-py-name: update + x-py-doc-url: https://docs.apify.com/api/client/python/reference/class/ActorClientAsync#update + /v2/actors/{actorId}/versions: + get: + deprecated: false + description: | + Gets the list of versions of a specific Actor. The response is a JSON object + with the list of [Version objects](#/reference/actors/version-object), where each + contains basic information about a single version. + operationId: act_versions_get + parameters: + - $ref: "#/components/parameters/actorId" + responses: + "200": + content: + application/json: + example: + data: + total: 5 + items: + - versionNumber: "0.1" + envVars: null + sourceType: SOURCE_FILES + applyEnvVarsToBuild: false + buildTag: latest + sourceFiles: [] + - versionNumber: "0.2" + sourceType: GIT_REPO + envVars: null + applyEnvVarsToBuild: false + buildTag: latest + gitRepoUrl: https://github.com/jane35/my-actor + - versionNumber: "0.3" + sourceType: TARBALL + envVars: null + applyEnvVarsToBuild: false + buildTag: latest + tarballUrl: https://github.com/jane35/my-actor/archive/master.zip + - versionNumber: "0.4" + sourceType: GITHUB_GIST + envVars: null + applyEnvVarsToBuild: false + buildTag: latest + gitHubGistUrl: https://gist.github.com/jane35/e51feb784yu89 + schema: + $ref: "#/components/schemas/ListOfVersionsResponse" + description: "" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Get list of versions + tags: + - Actors/Actor versions + x-legacy-doc-urls: + - https://docs.apify.com/api/v2#/reference/actors/version-collection/get-list-of-versions + - https://docs.apify.com/api/v2#/reference/actors/get-list-of-versions + - https://docs.apify.com/api/v2#tag/ActorsVersion-collection/operation/act_versions_get + x-py-parent: ActorVersionCollectionClientAsync + x-py-name: list + x-py-doc-url: https://docs.apify.com/api/client/python/reference/class/ActorVersionCollectionClientAsync#list + post: + deprecated: false + description: | + Creates a version of an Actor using values specified in a [Version + object](#/reference/actors/version-object) passed as JSON in the POST + payload. + + The request must specify `versionNumber` and `sourceType` parameters (as + strings) in the JSON payload and a `Content-Type: application/json` HTTP + header. + + Each `sourceType` requires its own additional properties to be passed to the + JSON payload object. These are outlined in the [Version + object](#/reference/actors/version-object) table below and in more detail in + the [Apify + documentation](https://docs.apify.com/platform/actors/development/deployment/source-types). + + For example, if an Actor's source code is stored in a [GitHub + repository](https://docs.apify.com/platform/actors/development/deployment/source-types#git-repository), + you will set the `sourceType` to `GIT_REPO` and pass the repository's URL in + the `gitRepoUrl` property. + + ``` + { + "versionNumber": "0.1", + "sourceType": "GIT_REPO", + "gitRepoUrl": "https://github.com/my-github-account/actor-repo" + } + ``` + + The response is the [Version object](#/reference/actors/version-object) as + returned by the [Get version](#/reference/actors/version-object/get-version) endpoint. + operationId: act_versions_post + parameters: + - $ref: "#/components/parameters/actorId" + requestBody: + content: + application/json: + example: + versionNumber: "0.1" + sourceType: GIT_REPO + gitRepoUrl: https://github.com/my-github-account/actor-repo + schema: + $ref: "#/components/schemas/CreateOrUpdateVersionRequest" + description: "" + required: true + responses: + "201": + content: + application/json: + schema: + $ref: "#/components/schemas/VersionResponse" + description: "" + headers: + Location: + content: + text/plain: + example: https://api.apify.com/v2/actors/zdc3Pyhyz3m8vjDeM/versions/0.0 + schema: + type: string + explode: false + style: simple + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "413": + $ref: "#/components/responses/PayloadTooLarge" + "415": + $ref: "#/components/responses/UnsupportedMediaType" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Create version + tags: + - Actors/Actor versions + x-legacy-doc-urls: + - https://docs.apify.com/api/v2#/reference/actors/version-collection/create-version + - https://docs.apify.com/api/v2#/reference/actors/create-version + - https://docs.apify.com/api/v2#tag/ActorsVersion-collection/operation/act_versions_post + x-py-parent: ActorVersionCollectionClientAsync + x-py-name: create + x-py-doc-url: https://docs.apify.com/api/client/python/reference/class/ActorVersionCollectionClientAsync#create + /v2/actors/{actorId}/versions/{versionNumber}: + delete: + deprecated: false + description: | + Deletes a specific version of Actor's source code. + operationId: act_version_delete + parameters: + - $ref: "#/components/parameters/actorId" + - $ref: "#/components/parameters/versionNumber" + responses: + "204": + content: + application/json: + example: {} + schema: + example: {} + type: object + description: "" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Delete version + tags: + - Actors/Actor versions + x-legacy-doc-urls: + - https://docs.apify.com/api/v2#/reference/actors/version-object/delete-version + - https://docs.apify.com/api/v2#/reference/actors/delete-version + - https://docs.apify.com/api/v2#tag/ActorsVersion-object/operation/act_version_delete + get: + deprecated: false + description: | + Gets a [Version object](#/reference/actors/version-object) that contains all the details about a specific version of an Actor. + operationId: act_version_get + parameters: + - $ref: "#/components/parameters/actorId" + - $ref: "#/components/parameters/versionNumber" + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/VersionResponse" + description: "" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Get version + tags: + - Actors/Actor versions + x-legacy-doc-urls: + - https://docs.apify.com/api/v2#/reference/actors/version-object/get-version + - https://docs.apify.com/api/v2#/reference/actors/get-version + - https://docs.apify.com/api/v2#tag/ActorsVersion-object/operation/act_version_get + x-py-parent: ActorVersionClientAsync + x-py-name: get + x-py-doc-url: https://docs.apify.com/api/client/python/reference/class/ActorVersionClientAsync#get + post: + deprecated: false + description: | + Updates Actor version using values specified by a [Version object](#/reference/actors/version-object) passed as JSON in the POST payload. + This endpoint is an alias for the [`PUT` update version](#tag/ActorsVersion-object/operation/act_version_put) method and behaves identically. + operationId: act_version_post + parameters: + - $ref: "#/components/parameters/actorId" + - $ref: "#/components/parameters/versionNumber" + requestBody: + content: + application/json: + example: + versionNumber: "0.0" + sourceType: SOURCE_FILES + envVars: + - name: DOMAIN + value: http://example.com + isSecret: false + - name: SECRET_PASSWORD + value: MyTopSecretPassword123 + isSecret: true + applyEnvVarsToBuild: false + buildTag: latest + sourceFiles: [] + schema: + $ref: "#/components/schemas/CreateOrUpdateVersionRequest" + description: "" + required: true + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/VersionResponse" + description: "" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "413": + $ref: "#/components/responses/PayloadTooLarge" + "415": + $ref: "#/components/responses/UnsupportedMediaType" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Update version (POST) + tags: + - Actors/Actor versions + x-py-parent: ActorVersionClientAsync + x-py-name: update + x-py-doc-url: https://docs.apify.com/api/client/python/reference/class/ActorVersionClientAsync#update + x-legacy-doc-urls: + - https://docs.apify.com/api/v2#/reference/actors/version-object/update-version + - https://docs.apify.com/api/v2#/reference/actors/update-version + - https://docs.apify.com/api/v2#tag/ActorsVersion-object/operation/act_version_post + put: + deprecated: false + description: | + Updates Actor version using values specified by a [Version object](#/reference/actors/version-object) passed as JSON in the POST payload. + + If the object does not define a specific property, its value will not be + updated. + + The request needs to specify the `Content-Type: application/json` HTTP + header! + + When providing your API authentication token, we recommend using the + request's `Authorization` header, rather than the URL. ([More + info](#/introduction/authentication)). + + The response is the [Version object](#/reference/actors/version-object) as + returned by the [Get version](#/reference/actors/version-object/get-version) endpoint. + operationId: act_version_put + parameters: + - $ref: "#/components/parameters/actorId" + - $ref: "#/components/parameters/versionNumber" + requestBody: + content: + application/json: + example: + versionNumber: "0.0" + sourceType: SOURCE_FILES + envVars: + - name: DOMAIN + value: http://example.com + isSecret: false + - name: SECRET_PASSWORD + value: MyTopSecretPassword123 + isSecret: true + applyEnvVarsToBuild: false + buildTag: latest + sourceFiles: [] + schema: + $ref: "#/components/schemas/CreateOrUpdateVersionRequest" + description: "" + required: true + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/VersionResponse" + description: "" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "413": + $ref: "#/components/responses/PayloadTooLarge" + "415": + $ref: "#/components/responses/UnsupportedMediaType" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Update version + tags: + - Actors/Actor versions + x-py-parent: ActorVersionClientAsync + x-py-name: update + x-py-doc-url: https://docs.apify.com/api/client/python/reference/class/ActorVersionClientAsync#update + x-legacy-doc-urls: + - https://docs.apify.com/api/v2#/reference/actors/version-object/update-version + - https://docs.apify.com/api/v2#/reference/actors/update-version + - https://docs.apify.com/api/v2#tag/ActorsVersion-object/operation/act_version_put + /v2/actors/{actorId}/versions/{versionNumber}/env-vars: + get: + deprecated: false + description: | + Gets the list of environment variables for a specific version of an Actor. + The response is a JSON object with the list of [EnvVar objects](#/reference/actors/environment-variable-object), where each contains basic information about a single environment variable. + operationId: act_version_envVars_get + parameters: + - $ref: "#/components/parameters/actorId" + - $ref: "#/components/parameters/versionNumber" + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/ListOfEnvVarsResponse" + description: "" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Get list of environment variables + tags: + - Actors/Actor versions + x-legacy-doc-urls: + - https://docs.apify.com/api/v2#/reference/actors/environment-variable-collection/get-list-of-environment-variables + - https://docs.apify.com/api/v2#/reference/actors/get-list-of-environment-variables + - https://docs.apify.com/api/v2#tag/ActorsEnvironment-variable-collection/operation/act_version_envVars_get + x-py-parent: ActorEnvVarCollectionClientAsync + x-py-name: list + x-py-doc-url: https://docs.apify.com/api/client/python/reference/class/ActorEnvVarCollectionClientAsync#list + post: + deprecated: false + description: | + Creates an environment variable of an Actor using values specified in a + [EnvVar object](#/reference/actors/environment-variable-object) passed as + JSON in the POST payload. + + The request must specify `name` and `value` parameters (as strings) in the + JSON payload and a `Content-Type: application/json` HTTP header. + + ``` + { + "name": "ENV_VAR_NAME", + "value": "my-env-var" + } + ``` + + The response is the [EnvVar + object](#/reference/actors/environment-variable-object) as returned by the [Get environment + variable](#/reference/actors/environment-variable-object/get-environment-variable) + endpoint. + operationId: act_version_envVars_post + parameters: + - $ref: "#/components/parameters/actorId" + - $ref: "#/components/parameters/versionNumber" + requestBody: + content: + application/json: + example: + name: ENV_VAR_NAME + value: my-env-var + schema: + $ref: "#/components/schemas/EnvVarRequest" + description: "" + required: true + responses: + "201": + content: + application/json: + example: + data: + name: MY_ENV_VAR + value: my-value + isSecret: false + schema: + $ref: "#/components/schemas/EnvVarResponse" + description: "" + headers: + Location: + content: + text/plain: + example: https://api.apify.com/v2/actors/zdc3Pyhyz3m8vjDeM/versions/1.0/env-vars/ENV_VAR_NAME + schema: + type: string + explode: false + style: simple + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "413": + $ref: "#/components/responses/PayloadTooLarge" + "415": + $ref: "#/components/responses/UnsupportedMediaType" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Create environment variable + tags: + - Actors/Actor versions + x-legacy-doc-urls: + - https://docs.apify.com/api/v2#/reference/actors/environment-variable-collection/create-environment-variable + - https://docs.apify.com/api/v2#/reference/actors/create-environment-variable + - https://docs.apify.com/api/v2#tag/ActorsEnvironment-variable-collection/operation/act_version_envVars_post + x-py-parent: ActorEnvVarCollectionClientAsync + x-py-name: create + x-py-doc-url: https://docs.apify.com/api/client/python/reference/class/ActorEnvVarCollectionClientAsync#create + /v2/actors/{actorId}/versions/{versionNumber}/env-vars/{envVarName}: + delete: + deprecated: false + description: Deletes a specific environment variable. + operationId: act_version_envVar_delete + parameters: + - $ref: "#/components/parameters/actorId" + - $ref: "#/components/parameters/versionNumber" + - description: The name of the environment variable + explode: false + in: path + name: envVarName + required: true + schema: + example: MY_ENV_VAR + type: string + style: simple + responses: + "204": + content: + application/json: + example: {} + schema: + example: {} + type: object + description: "" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Delete environment variable + tags: + - Actors/Actor versions + x-legacy-doc-urls: + - https://docs.apify.com/api/v2#/reference/actors/environment-variable-object/delete-environment-variable + - https://docs.apify.com/api/v2#/reference/actors/delete-environment-variable + - https://docs.apify.com/api/v2#tag/ActorsEnvironment-variable-object/operation/act_version_envVar_delete + get: + deprecated: false + description: | + Gets a [EnvVar object](#/reference/actors/environment-variable-object) that + contains all the details about a specific environment variable of an Actor. + + If `isSecret` is set to `true`, then `value` will never be returned. + operationId: act_version_envVar_get + parameters: + - $ref: "#/components/parameters/actorId" + - $ref: "#/components/parameters/versionNumber" + - description: The name of the environment variable + explode: false + in: path + name: envVarName + required: true + schema: + example: MY_ENV_VAR + type: string + style: simple + responses: + "200": + content: + application/json: + example: + data: + name: MY_ENV_VAR + value: my-value + isSecret: false + schema: + $ref: "#/components/schemas/EnvVarResponse" + description: "" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Get environment variable + tags: + - Actors/Actor versions + x-legacy-doc-urls: + - https://docs.apify.com/api/v2#/reference/actors/environment-variable-object/get-environment-variable + - https://docs.apify.com/api/v2#/reference/actors/get-environment-variable + - https://docs.apify.com/api/v2#tag/ActorsEnvironment-variable-object/operation/act_version_envVar_get + x-py-parent: ActorEnvVarClientAsync + x-py-name: get + x-py-doc-url: https://docs.apify.com/api/client/python/reference/class/ActorEnvVarClientAsync#get + post: + deprecated: false + description: | + Updates Actor environment variable using values specified by a [EnvVar + object](#/reference/actors/environment-variable-object) + passed as JSON in the POST payload. + This endpoint is an alias for the [`PUT` update environment variable](#tag/ActorsEnvironment-variable-object/operation/act_version_envVar_put) method and behaves identically. + operationId: act_version_envVar_post + parameters: + - $ref: "#/components/parameters/actorId" + - $ref: "#/components/parameters/versionNumber" + - description: The name of the environment variable + explode: false + in: path + name: envVarName + required: true + schema: + example: MY_ENV_VAR + type: string + style: simple + requestBody: + content: + application/json: + example: + name: MY_ENV_VAR + value: my-new-value + isSecret: false + schema: + $ref: "#/components/schemas/EnvVarRequest" + description: "" + required: true + responses: + "200": + content: + application/json: + example: + data: + name: MY_ENV_VAR + value: my-value + isSecret: false + schema: + $ref: "#/components/schemas/EnvVarResponse" + description: "" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "413": + $ref: "#/components/responses/PayloadTooLarge" + "415": + $ref: "#/components/responses/UnsupportedMediaType" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Update environment variable (POST) + tags: + - Actors/Actor versions + x-py-parent: ActorEnvVarClientAsync + x-py-name: update + x-py-doc-url: https://docs.apify.com/api/client/python/reference/class/ActorEnvVarClientAsync#update + x-legacy-doc-urls: + - https://docs.apify.com/api/v2#/reference/actors/environment-variable-object/update-environment-variable + - https://docs.apify.com/api/v2#/reference/actors/update-environment-variable + - https://docs.apify.com/api/v2#tag/ActorsEnvironment-variable-object/operation/act_version_envVar_post + put: + deprecated: false + description: | + Updates Actor environment variable using values specified by a [EnvVar + object](#/reference/actors/environment-variable-object) + passed as JSON in the POST payload. + If the object does not define a specific property, its value will not be + updated. + + The request needs to specify the `Content-Type: application/json` HTTP + header! + + When providing your API authentication token, we recommend using the + request's `Authorization` header, rather than the URL. ([More + info](#/introduction/authentication)). + + The response is the [EnvVar object](#/reference/actors/environment-variable-object) as returned by the + [Get environment variable](#/reference/actors/environment-variable-object/get-environment-variable) + endpoint. + operationId: act_version_envVar_put + parameters: + - $ref: "#/components/parameters/actorId" + - $ref: "#/components/parameters/versionNumber" + - description: The name of the environment variable + explode: false + in: path + name: envVarName + required: true + schema: + example: MY_ENV_VAR + type: string + style: simple + requestBody: + content: + application/json: + example: + name: MY_ENV_VAR + value: my-new-value + isSecret: false + schema: + $ref: "#/components/schemas/EnvVarRequest" + description: "" + required: true + responses: + "200": + content: + application/json: + example: + data: + name: MY_ENV_VAR + value: my-value + isSecret: false + schema: + $ref: "#/components/schemas/EnvVarResponse" + description: "" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "413": + $ref: "#/components/responses/PayloadTooLarge" + "415": + $ref: "#/components/responses/UnsupportedMediaType" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Update environment variable + tags: + - Actors/Actor versions + x-py-parent: ActorEnvVarClientAsync + x-py-name: update + x-py-doc-url: https://docs.apify.com/api/client/python/reference/class/ActorEnvVarClientAsync#update + x-legacy-doc-urls: + - https://docs.apify.com/api/v2#/reference/actors/environment-variable-object/update-environment-variable + - https://docs.apify.com/api/v2#/reference/actors/update-environment-variable + - https://docs.apify.com/api/v2#tag/ActorsEnvironment-variable-object/operation/act_version_envVar_put + /v2/actors/{actorId}/webhooks: + get: + deprecated: false + description: | + Gets the list of webhooks of a specific Actor. The response is a JSON with + the list of objects, where each object contains basic information about a single webhook. + + The endpoint supports pagination using the `limit` and `offset` parameters + and it will not return more than 1000 records. + + By default, the records are sorted by the `createdAt` field in ascending + order, to sort the records in descending order, use the `desc=1` parameter. + operationId: act_webhooks_get + parameters: + - $ref: "#/components/parameters/actorId" + - $ref: "#/components/parameters/offset" + - $ref: "#/components/parameters/limit" + - $ref: "#/components/parameters/descCreatedAt" + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/ListOfWebhooksResponse" + description: "" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Get list of webhooks + tags: + - Actors/Webhook collection + x-legacy-doc-urls: + - https://docs.apify.com/api/v2#/reference/actors/webhook-collection/get-list-of-webhooks + - https://docs.apify.com/api/v2#/reference/actors/get-list-of-webhooks + - https://docs.apify.com/api/v2#tag/ActorsWebhook-collection/operation/act_webhooks_get + /v2/actors/{actorId}/builds: + get: + deprecated: false + description: | + Gets the list of builds of a specific Actor. The response is a JSON with the + list of objects, where each object contains basic information about a single build. + + The endpoint supports pagination using the `limit` and `offset` parameters + and it will not return more than 1000 records. + + By default, the records are sorted by the `startedAt` field in ascending order, + therefore you can use pagination to incrementally fetch all builds while new + ones are still being started. To sort the records in descending order, use + the `desc=1` parameter. + operationId: act_builds_get + parameters: + - $ref: "#/components/parameters/actorId" + - $ref: "#/components/parameters/offset" + - $ref: "#/components/parameters/limit" + - $ref: "#/components/parameters/descStartedAt" + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/ListOfBuildsResponse" + description: "" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Get list of builds + tags: + - Actors/Actor builds + x-legacy-doc-urls: + - https://docs.apify.com/api/v2#/reference/actors/build-collection/get-list-of-builds + - https://docs.apify.com/api/v2#/reference/actors/get-list-of-builds + - https://docs.apify.com/api/v2#tag/ActorsBuild-collection/operation/act_builds_get + x-js-parent: BuildCollectionClient + x-js-name: list + x-js-doc-url: https://docs.apify.com/api/client/js/reference/class/BuildCollectionClient#list + x-py-parent: BuildCollectionClientAsync + x-py-name: list + x-py-doc-url: https://docs.apify.com/api/client/python/reference/class/BuildCollectionClientAsync#list + post: + deprecated: false + description: | + Builds an Actor. + The response is the build object as returned by the + [Get build](#/reference/actors/build-object/get-build) endpoint. + operationId: act_builds_post + parameters: + - $ref: "#/components/parameters/actorId" + - description: Actor version number to be built. + explode: true + in: query + name: version + required: true + schema: + example: "0.0" + type: string + style: form + - description: | + If `true` or `1`, the system will use a cache to speed up the build + process. By default, cache is not used. + explode: true + in: query + name: useCache + required: false + schema: + example: true + type: boolean + style: form + - description: | + If `true` or `1` then the Actor is built with beta versions of Apify NPM + packages. By default, the build uses `latest` packages. + explode: true + in: query + name: betaPackages + required: false + schema: + example: true + type: boolean + style: form + - description: | + Tag to be applied to the build on success. By default, the tag is taken + from Actor version's `buildTag` property. + explode: true + in: query + name: tag + required: false + schema: + example: latest + type: string + style: form + - $ref: "#/components/parameters/waitForFinishBuild" + responses: + "201": + content: + application/json: + schema: + $ref: "#/components/schemas/BuildResponse" + description: "" + headers: + Location: + content: + text/plain: + example: https://api.apify.com/v2/actors/zdc3Pyhyz3m8vjDeM/runs/HG7ML7M8z78YcAPEB + schema: + type: string + explode: false + style: simple + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Build Actor + tags: + - Actors/Actor builds + x-legacy-doc-urls: + - https://docs.apify.com/api/v2#/reference/actors/build-collection/build-actor + - https://docs.apify.com/api/v2#/reference/actors/build-actor + - https://docs.apify.com/api/v2#tag/ActorsBuild-collection/operation/act_builds_post + x-js-parent: ActorClient + x-js-name: build + x-js-doc-url: https://docs.apify.com/api/client/js/reference/class/ActorClient#build + x-py-parent: ActorClientAsync + x-py-name: build + x-py-doc-url: https://docs.apify.com/api/client/python/reference/class/ActorClientAsync#build + /v2/actors/{actorId}/builds/default: + get: + description: | + Get the default build for an Actor. + + Use the optional `waitForFinish` parameter to synchronously wait for the build to finish. + This avoids the need for periodic polling when waiting for the build to complete. + + This endpoint does not require an authentication token. Instead, calls are authenticated using the Actor's unique ID. + However, if you access the endpoint without a token, certain attributes (e.g., `usageUsd` and `usageTotalUsd`) will be hidden. + operationId: act_build_default_get + parameters: + - $ref: "#/components/parameters/actorId" + - $ref: "#/components/parameters/waitForFinishBuild" + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/BuildResponse" + description: "" + "400": + $ref: "#/components/responses/BadRequest" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "429": + $ref: "#/components/responses/TooManyRequests" + security: [] + summary: Get default build + tags: + - Actors/Actor builds + x-js-parent: ActorClient + x-js-name: defaultBuild + x-js-doc-url: https://docs.apify.com/api/client/js/reference/class/ActorClient#defaultBuild + x-py-parent: ActorClient + x-py-name: default_build + x-py-doc-url: https://docs.apify.com/api/client/python/reference/class/ActorClient#default_build + /v2/actors/{actorId}/builds/{buildId}/openapi.json: + get: + description: | + Get the OpenAPI definition for Actor builds. Two similar endpoints are available: + + - [First endpoint](/api/v2/act-openapi-json-get): Requires both `actorId` and `buildId`. Use `default` as the `buildId` to get the OpenAPI schema for the default Actor build. + + - [Second endpoint](/api/v2/actor-build-openapi-json-get): Requires only `buildId`. + + Get the OpenAPI definition for a specific Actor build. + + To fetch the default Actor build, simply pass `default` as the `buildId`. + Authentication is based on the build's unique ID. No authentication token is required. + + :::note + + You can also use the [`/api/v2/actor-build-openapi-json-get`](/api/v2/actor-build-openapi-json-get) endpoint to get the OpenAPI definition for a build. + + ::: + operationId: act_openapi_json_get + parameters: + - $ref: "#/components/parameters/actorId" + - $ref: "#/components/parameters/buildIdWithDefault" + responses: + "200": + content: + application/json: + schema: + description: A standard OpenAPI 3.x JSON document. + type: object + description: The OpenAPI specification document for the Actor build. + "400": + $ref: "#/components/responses/BadRequest" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "429": + $ref: "#/components/responses/TooManyRequests" + security: [] + summary: Get OpenAPI definition + tags: + - Actors/Actor builds + /v2/actors/{actorId}/builds/{buildId}: + get: + deprecated: true + description: | + By passing the optional `waitForFinish` parameter the API endpoint will + synchronously wait for the build to finish. + This is useful to avoid periodic polling when waiting for an Actor build to + finish. + + This endpoint does not require the authentication token. Instead, calls are authenticated using a hard-to-guess ID of the build. However, + if you access the endpoint without the token, certain attributes, such as `usageUsd` and `usageTotalUsd`, will be hidden. + operationId: act_build_get + parameters: + - $ref: "#/components/parameters/actorId" + - $ref: "#/components/parameters/buildId" + - $ref: "#/components/parameters/waitForFinishBuild" + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/BuildResponse" + description: "" + "400": + $ref: "#/components/responses/BadRequest" + "404": + $ref: "#/components/responses/NotFound" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "429": + $ref: "#/components/responses/TooManyRequests" + security: [] + summary: Get build + tags: + - Actors/Actor builds + x-deprecated-description: "API endpoints related to build of the Actor were\ + \ moved under new namespace [`actor-builds`](#/reference/actor-builds). Gets\ + \ an object that contains all the details about a specific build of an Actor." + x-legacy-doc-urls: + - https://docs.apify.com/api/v2#/reference/actors/build-object/get-build + - https://docs.apify.com/api/v2#/reference/actors/get-build + - https://docs.apify.com/api/v2#tag/ActorsBuild-object/operation/act_build_get + /v2/actors/{actorId}/builds/{buildId}/abort: + post: + deprecated: true + description: | + **[DEPRECATED]** API endpoints related to build of the Actor were moved + under new namespace [`actor-builds`](#/reference/actor-builds). Aborts an + Actor build and returns an object that contains all the details about the + build. + + Only builds that are starting or running are aborted. For builds with status + `FINISHED`, `FAILED`, `ABORTING` and `TIMED-OUT` this call does nothing. + operationId: act_build_abort_post + parameters: + - $ref: "#/components/parameters/actorId" + - $ref: "#/components/parameters/buildId" + responses: + "200": + content: + application/json: + example: + data: + id: HG7ML7M8z78YcAPEB + actId: janedoe~my-actor + userId: klmdEpoiojmdEMlk3 + startedAt: 2019-11-30T07:34:24.202Z + finishedAt: 2019-12-12T09:30:12.202Z + status: ABORTED + meta: + origin: WEB + userAgent: Mozilla/5.0 (iPad) + stats: + durationMillis: 1000 + runTimeSecs: 5.718 + computeUnits: 0.012699444444444444 + options: + useCache: false + memoryMbytes: 1024 + diskMbytes: 2048 + usage: + ACTOR_COMPUTE_UNITS: 0.08 + usageTotalUsd: 0.02 + usageUsd: + ACTOR_COMPUTE_UNITS: 0.02 + buildNumber: 0.1.1 + schema: + $ref: "#/components/schemas/BuildResponse" + description: "" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Abort build + tags: + - Actors/Actor builds + x-legacy-doc-urls: + - https://docs.apify.com/api/v2#/reference/actors/abort-build/abort-build + - https://docs.apify.com/api/v2#/reference/actors/abort-build + - https://docs.apify.com/api/v2#tag/ActorsAbort-build/operation/act_build_abort_post + /v2/actors/{actorId}/runs: + get: + deprecated: false + description: | + Gets the list of runs of a specific Actor. The response is a list of + objects, where each object contains basic information about a single Actor run. + + The endpoint supports pagination using the `limit` and `offset` parameters + and it will not return more than 1000 array elements. + + By default, the records are sorted by the `startedAt` field in ascending + order, therefore you can use pagination to incrementally fetch all records while + new ones are still being created. To sort the records in descending order, use + `desc=1` parameter. You can also filter runs by status ([available + statuses](https://docs.apify.com/platform/actors/running/runs-and-builds#lifecycle)). + operationId: act_runs_get + parameters: + - $ref: "#/components/parameters/actorId" + - $ref: "#/components/parameters/offset" + - $ref: "#/components/parameters/limit" + - $ref: "#/components/parameters/descStartedAt" + - $ref: "#/components/parameters/status" + - $ref: "#/components/parameters/startedAfter" + - $ref: "#/components/parameters/startedBefore" + responses: + "200": + content: + application/json: + examples: + example: + $ref: "#/components/examples/ListOfRunsResponseExample" + schema: + $ref: "#/components/schemas/ListOfRunsResponse" + description: "" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Get list of runs + tags: + - Actors/Actor runs + x-legacy-doc-urls: + - https://docs.apify.com/api/v2#/reference/actors/run-collection/get-list-of-runs + - https://docs.apify.com/api/v2#/reference/actors/get-list-of-runs + - https://docs.apify.com/api/v2#tag/ActorsRun-collection/operation/act_runs_get + x-js-parent: RunCollectionClient + x-js-name: list + x-js-doc-url: https://docs.apify.com/api/client/js/reference/class/RunCollectionClient#list + x-py-parent: RunCollectionClientAsync + x-py-name: list + x-py-doc-url: https://docs.apify.com/api/client/python/reference/class/RunCollectionClientAsync#list + post: + deprecated: false + description: | + Runs an Actor and immediately returns without waiting for the run to finish. + + The POST payload including its `Content-Type` header is passed as `INPUT` to + the Actor (usually `application/json`). + + The Actor is started with the default options; you can override them using + various URL query parameters. + + The response is the Run object as returned by the [Get + run](#/reference/actor-runs/run-object-and-its-storages/get-run) API + endpoint. + + If you want to wait for the run to finish and receive the actual output of + the Actor as the response, please use one of the [Run Actor + synchronously](#/reference/actors/run-actor-synchronously) API endpoints + instead. + + To fetch the Actor run results that are typically stored in the default + dataset, you'll need to pass the ID received in the `defaultDatasetId` field + received in the response JSON to the [Get dataset items](#/reference/datasets/item-collection/get-items) + API endpoint. + operationId: act_runs_post + parameters: + - $ref: "#/components/parameters/actorId" + - $ref: "#/components/parameters/timeout" + - $ref: "#/components/parameters/memory" + - $ref: "#/components/parameters/maxItems" + - $ref: "#/components/parameters/maxTotalChargeUsd" + - $ref: "#/components/parameters/restartOnError" + - $ref: "#/components/parameters/build" + - $ref: "#/components/parameters/waitForFinishRun" + - $ref: "#/components/parameters/webhooks" + - description: | + Overrides the Actor's permission level for this specific run. Use to test restricted permissions + before deploying changes to your Actor or to temporarily elevate or restrict access. If you don't specify this + parameter, the Actor uses its configured default permission level. For more information on permissions, see the + [documentation](https://docs.apify.com/platform/actors/development/permissions). + explode: true + in: query + name: forcePermissionLevel + required: false + schema: + enum: + - LIMITED_PERMISSIONS + - FULL_PERMISSIONS + example: LIMITED_PERMISSIONS + type: string + style: form + requestBody: + content: + application/json: + example: + foo: bar + schema: + type: object + '*/*': + schema: {} + description: "" + required: true + responses: + "201": + content: + application/json: + schema: + $ref: "#/components/schemas/RunResponse" + description: "" + headers: + Location: + content: + text/plain: + example: https://api.apify.com/v2/actors/zdc3Pyhyz3m8vjDeM/runs/HG7ML7M8z78YcAPEB + schema: {} + explode: false + style: simple + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "402": + $ref: "#/components/responses/PaymentRequired" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "413": + $ref: "#/components/responses/PayloadTooLarge" + "415": + $ref: "#/components/responses/UnsupportedMediaType" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Run Actor + tags: + - Actors/Actor runs + x-legacy-doc-urls: + - https://docs.apify.com/api/v2#/reference/actors/run-collection/run-actor + - https://docs.apify.com/api/v2#/reference/actors/run-actor + - https://docs.apify.com/api/v2#tag/ActorsRun-collection/operation/act_runs_post + x-js-parent: ActorClient + x-js-name: start + x-js-doc-url: https://docs.apify.com/api/client/js/reference/class/ActorClient#start + x-py-parent: ActorClientAsync + x-py-name: call + x-py-doc-url: https://docs.apify.com/api/client/python/reference/class/ActorClientAsync#call + /v2/actors/{actorId}/run-sync: + get: + deprecated: false + description: | + Runs a specific Actor and returns its output. + The run must finish in 300 seconds + otherwise the API endpoint returns a timeout error. + The Actor is not passed any input. + + Beware that it might be impossible to maintain an idle HTTP connection for a + long period of time, + due to client timeout or network conditions. Make sure your HTTP client is + configured to have a long enough connection timeout. + If the connection breaks, you will not receive any information about the run + and its status. + + To run the Actor asynchronously, use the [Run + Actor](#/reference/actors/run-collection/run-actor) API endpoint instead. + operationId: act_runSync_get + parameters: + - $ref: "#/components/parameters/actorId" + - $ref: "#/components/parameters/outputRecordKey" + - $ref: "#/components/parameters/timeout" + - $ref: "#/components/parameters/memory" + - $ref: "#/components/parameters/maxItems" + - $ref: "#/components/parameters/maxTotalChargeUsd" + - $ref: "#/components/parameters/restartOnError" + - $ref: "#/components/parameters/build" + - $ref: "#/components/parameters/webhooks" + responses: + "201": + content: + application/json: + example: + foo: bar + schema: + type: object + description: "" + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/ActorRunFailedError" + description: "" + "404": + $ref: "#/components/responses/NotFound" + "408": + content: + application/json: + schema: + $ref: "#/components/schemas/ActorRunTimeoutExceededError" + description: "" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Run Actor synchronously without input + tags: + - Actors/Actor runs + x-legacy-doc-urls: + - https://docs.apify.com/api/v2#/reference/actors/run-actor-synchronously/without-input + - https://docs.apify.com/api/v2#/reference/actors/without-input + - https://docs.apify.com/api/v2#tag/ActorsRun-actor-synchronously/operation/act_runSync_get + post: + deprecated: false + description: | + Runs a specific Actor and returns its output. + + The POST payload including its `Content-Type` header is passed as `INPUT` to + the Actor (usually application/json). + The HTTP response contains Actors `OUTPUT` record from its default + key-value store. + + The Actor is started with the default options; you can override them using + various URL query parameters. + If the Actor run exceeds 300 seconds, + the HTTP response will have status 408 (Request Timeout). + + Beware that it might be impossible to maintain an idle HTTP connection for a + long period of time, due to client timeout or network conditions. Make sure your HTTP client is + configured to have a long enough connection timeout. + If the connection breaks, you will not receive any information about the run + and its status. + + To run the Actor asynchronously, use the [Run + Actor](#/reference/actors/run-collection/run-actor) API endpoint instead. + operationId: act_runSync_post + parameters: + - $ref: "#/components/parameters/actorId" + - $ref: "#/components/parameters/outputRecordKey" + - $ref: "#/components/parameters/timeout" + - $ref: "#/components/parameters/memory" + - $ref: "#/components/parameters/maxItems" + - $ref: "#/components/parameters/maxTotalChargeUsd" + - $ref: "#/components/parameters/restartOnError" + - $ref: "#/components/parameters/build" + - $ref: "#/components/parameters/webhooks" + requestBody: + content: + application/json: + example: + foo: bar + schema: + type: object + '*/*': + schema: {} + description: "" + required: true + responses: + "201": + content: + application/json: + example: + bar: foo + schema: + type: object + description: "" + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/ActorRunFailedError" + description: "" + "402": + $ref: "#/components/responses/PaymentRequired" + "404": + $ref: "#/components/responses/NotFound" + "408": + content: + application/json: + schema: + $ref: "#/components/schemas/ActorRunTimeoutExceededError" + description: "" + "415": + $ref: "#/components/responses/UnsupportedMediaType" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Run Actor synchronously and return output + tags: + - Actors/Actor runs + x-legacy-doc-urls: + - https://docs.apify.com/api/v2#/reference/actors/run-actor-synchronously/with-input + - https://docs.apify.com/api/v2#/reference/actors/with-input + - https://docs.apify.com/api/v2#tag/ActorsRun-actor-synchronously/operation/act_runSync_post + /v2/actors/{actorId}/run-sync-get-dataset-items: + get: + deprecated: false + description: | + Runs a specific Actor and returns its dataset items. + The run must finish in 300 seconds + otherwise the API endpoint returns a timeout error. + The Actor is not passed any input. + + It allows to send all possible options in parameters from [Get Dataset + Items](#/reference/datasets/item-collection/get-items) API endpoint. + + Beware that it might be impossible to maintain an idle HTTP connection for a + long period of time, + due to client timeout or network conditions. Make sure your HTTP client is + configured to have a long enough connection timeout. + If the connection breaks, you will not receive any information about the run + and its status. + + To run the Actor asynchronously, use the [Run + Actor](#/reference/actors/run-collection/run-actor) API endpoint instead. + operationId: act_runSyncGetDatasetItems_get + parameters: + - $ref: "#/components/parameters/actorId" + - $ref: "#/components/parameters/timeout" + - $ref: "#/components/parameters/memory" + - $ref: "#/components/parameters/maxItems" + - $ref: "#/components/parameters/maxTotalChargeUsd" + - $ref: "#/components/parameters/restartOnError" + - $ref: "#/components/parameters/build" + - $ref: "#/components/parameters/webhooks" + - $ref: "#/components/parameters/format" + - $ref: "#/components/parameters/clean" + - $ref: "#/components/parameters/offset" + - $ref: "#/components/parameters/datasetParameters_limit" + - $ref: "#/components/parameters/fields" + - $ref: "#/components/parameters/outputFields" + - $ref: "#/components/parameters/omit" + - $ref: "#/components/parameters/unwind" + - $ref: "#/components/parameters/flatten" + - $ref: "#/components/parameters/descDataset" + - $ref: "#/components/parameters/attachment" + - $ref: "#/components/parameters/delimiter" + - $ref: "#/components/parameters/bom" + - $ref: "#/components/parameters/xmlRoot" + - $ref: "#/components/parameters/xmlRow" + - $ref: "#/components/parameters/skipHeaderRow" + - $ref: "#/components/parameters/skipHidden" + - $ref: "#/components/parameters/skipEmpty" + - $ref: "#/components/parameters/simplified" + - $ref: "#/components/parameters/view" + - $ref: "#/components/parameters/skipFailedPages" + - $ref: "#/components/parameters/feedTitle" + - $ref: "#/components/parameters/feedDescription" + responses: + "201": + content: + application/json: + example: + - myValue: some value + myOtherValue: some other value + schema: + items: + type: object + type: array + default: null + description: "" + headers: + X-Apify-Pagination-Offset: + content: + text/plain: + example: "0" + schema: + type: string + description: The offset of the first item in the current page. + explode: false + style: simple + X-Apify-Pagination-Limit: + content: + text/plain: + example: "100" + schema: + type: string + description: The maximum number of items returned per page. + explode: false + style: simple + X-Apify-Pagination-Count: + content: + text/plain: + example: "100" + schema: + type: string + description: The number of items returned in the current page. + explode: false + style: simple + X-Apify-Pagination-Total: + content: + text/plain: + example: "10204" + schema: + type: string + description: The total number of items in the dataset. + explode: false + style: simple + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/ActorRunFailedError" + description: "" + "404": + $ref: "#/components/responses/NotFound" + "408": + content: + application/json: + schema: + $ref: "#/components/schemas/ActorRunTimeoutExceededError" + description: "" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Run Actor synchronously without input and get dataset items + tags: + - Actors/Actor runs + x-legacy-doc-urls: + - https://docs.apify.com/api/v2#/reference/actors/run-actor-synchronously-and-get-dataset-items/run-actor-synchronously-without-input-and-get-dataset-items + - https://docs.apify.com/api/v2#/reference/actors/run-actor-synchronously-without-input-and-get-dataset-items + - https://docs.apify.com/api/v2#tag/ActorsRun-Actor-synchronously-and-get-dataset-items/operation/act_runSyncGetDatasetItems_get + post: + deprecated: false + description: | + Runs a specific Actor and returns its dataset items. + + The POST payload including its `Content-Type` header is passed as `INPUT` to + the Actor (usually `application/json`). + The HTTP response contains the Actors dataset items, while the format of + items depends on specifying dataset items' `format` parameter. + + You can send all the same options in parameters as the [Get Dataset + Items](#/reference/datasets/item-collection/get-items) API endpoint. + + The Actor is started with the default options; you can override them using + URL query parameters. + If the Actor run exceeds 300 seconds, + the HTTP response will return the 408 status code (Request Timeout). + + Beware that it might be impossible to maintain an idle HTTP connection for a + long period of time, + due to client timeout or network conditions. Make sure your HTTP client is + configured to have a long enough connection timeout. + If the connection breaks, you will not receive any information about the run + and its status. + + To run the Actor asynchronously, use the [Run + Actor](#/reference/actors/run-collection/run-actor) API endpoint instead. + operationId: act_runSyncGetDatasetItems_post + parameters: + - $ref: "#/components/parameters/actorId" + - $ref: "#/components/parameters/timeout" + - $ref: "#/components/parameters/memory" + - $ref: "#/components/parameters/maxItems" + - $ref: "#/components/parameters/maxTotalChargeUsd" + - $ref: "#/components/parameters/restartOnError" + - $ref: "#/components/parameters/build" + - $ref: "#/components/parameters/webhooks" + - $ref: "#/components/parameters/format" + - $ref: "#/components/parameters/clean" + - $ref: "#/components/parameters/offset" + - $ref: "#/components/parameters/datasetParameters_limit" + - $ref: "#/components/parameters/fields" + - $ref: "#/components/parameters/outputFields" + - $ref: "#/components/parameters/omit" + - $ref: "#/components/parameters/unwind" + - $ref: "#/components/parameters/flatten" + - $ref: "#/components/parameters/descDataset" + - $ref: "#/components/parameters/attachment" + - $ref: "#/components/parameters/delimiter" + - $ref: "#/components/parameters/bom" + - $ref: "#/components/parameters/xmlRoot" + - $ref: "#/components/parameters/xmlRow" + - $ref: "#/components/parameters/skipHeaderRow" + - $ref: "#/components/parameters/skipHidden" + - $ref: "#/components/parameters/skipEmpty" + - $ref: "#/components/parameters/simplified" + - $ref: "#/components/parameters/view" + - $ref: "#/components/parameters/skipFailedPages" + - $ref: "#/components/parameters/feedTitle" + - $ref: "#/components/parameters/feedDescription" + requestBody: + content: + application/json: + example: + foo: bar + schema: + type: object + '*/*': + schema: {} + description: "" + required: true + responses: + "201": + content: + application/json: + example: + - myValue: some value + myOtherValue: some other value + schema: + items: + type: object + type: array + default: null + description: "" + headers: + X-Apify-Pagination-Offset: + content: + text/plain: + example: "0" + schema: {} + description: The offset of the first item in the current page. + explode: false + style: simple + X-Apify-Pagination-Limit: + content: + text/plain: + example: "100" + schema: {} + description: The maximum number of items returned per page. + explode: false + style: simple + X-Apify-Pagination-Count: + content: + text/plain: + example: "100" + schema: {} + description: The number of items returned in the current page. + explode: false + style: simple + X-Apify-Pagination-Total: + content: + text/plain: + example: "10204" + schema: {} + description: The total number of items in the dataset. + explode: false + style: simple + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/ActorRunFailedError" + description: "" + "402": + $ref: "#/components/responses/PaymentRequired" + "404": + $ref: "#/components/responses/NotFound" + "408": + content: + application/json: + schema: + $ref: "#/components/schemas/ActorRunTimeoutExceededError" + description: "" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Run Actor synchronously and get dataset items + tags: + - Actors/Actor runs + x-legacy-doc-urls: + - https://docs.apify.com/api/v2#/reference/actors/run-actor-synchronously-and-get-dataset-items/run-actor-synchronously-with-input-and-get-dataset-items + - https://docs.apify.com/api/v2#/reference/actors/run-actor-synchronously-with-input-and-get-dataset-items + - https://docs.apify.com/api/v2#tag/ActorsRun-Actor-synchronously-and-get-dataset-items/operation/act_runSyncGetDatasetItems_post + /v2/actors/{actorId}/validate-input: + post: + deprecated: false + description: | + Validates the provided input against the Actor's input schema for the specified build. + + The endpoint checks whether the JSON payload conforms to the input schema + defined in the Actor's build. If no `build` query parameter is provided, + the `latest` build tag is used by default. + operationId: act_validateInput_post + parameters: + - $ref: "#/components/parameters/actorId" + - description: | + Optional tag or number of the Actor build to use for input schema validation. + By default, the `latest` build tag is used. + explode: true + in: query + name: build + required: false + schema: + example: latest + type: string + style: form + requestBody: + content: + application/json: + schema: + type: object + description: JSON input to validate against the Actor's input schema. + required: true + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/act_validateInput_post_200_response" + description: "" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "413": + $ref: "#/components/responses/PayloadTooLarge" + "415": + $ref: "#/components/responses/UnsupportedMediaType" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Validate Actor input + tags: + - Actors + /v2/actors/{actorId}/runs/{runId}/resurrect: + post: + deprecated: false + description: | + **[DEPRECATED]** API endpoints related to run of the Actor were moved under + new namespace [`actor-runs`](#/reference/actor-runs).Resurrects a finished + Actor run and returns an object that contains all the details about the + resurrected run. + + Only finished runs, i.e. runs with status `FINISHED`, `FAILED`, `ABORTED` + and `TIMED-OUT` can be resurrected. + Run status will be updated to RUNNING and its container will be restarted + with the same storages + (the same behaviour as when the run gets migrated to the new server). + + For more information, see the [Actor + docs](https://docs.apify.com/platform/actors/running/runs-and-builds#resurrection-of-finished-run). + operationId: act_run_resurrect_post + parameters: + - $ref: "#/components/parameters/actorId" + - $ref: "#/components/parameters/runId" + - $ref: "#/components/parameters/buildResurrect" + - $ref: "#/components/parameters/timeoutResurrect" + - $ref: "#/components/parameters/memoryResurrect" + - $ref: "#/components/parameters/restartOnErrorResurrect" + responses: + "200": + content: + application/json: + schema: + allOf: + - $ref: "#/components/schemas/RunResponse" + description: "" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Resurrect run + tags: + - Actors/Actor runs + x-legacy-doc-urls: + - https://docs.apify.com/api/v2#/reference/actors/resurrect-run/resurrect-run + - https://docs.apify.com/api/v2#/reference/actors/resurrect-run + - https://docs.apify.com/api/v2#tag/ActorsResurrect-run/operation/act_run_resurrect_post + /v2/actors/{actorId}/runs/last: + get: + deprecated: false + description: | + This is not a single endpoint, but an entire group of endpoints that lets you to + retrieve and manage the last run of given Actor or any of its default storages. + All the endpoints require an authentication token. + + The base path represents the last Actor run object is: + + `/v2/actors/{actorId}/runs/last{?token,status}` + + Using the `status` query parameter you can ensure to only get a run with a certain status + (e.g. `status=SUCCEEDED`). The output of this endpoint and other query parameters + are the same as in the [Run object](#/reference/actors/run-object) endpoint. + + ##### Convenience endpoints for last Actor run + + * [Dataset](/api/v2/last-actor-runs-default-dataset) + + * [Key-value store](/api/v2/last-actor-runs-default-key-value-store) + + * [Request queue](/api/v2/last-actor-runs-default-request-queue) + + * [Log](/api/v2/last-actor-runs-log) + operationId: act_runs_last_get + parameters: + - $ref: "#/components/parameters/actorId" + - $ref: "#/components/parameters/statusLastRun" + - $ref: "#/components/parameters/waitForFinishRun" + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/RunResponse" + description: "" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Get last run + tags: + - Actors/Actor runs + x-legacy-doc-urls: + - https://docs.apify.com/api/v2#/reference/actors/last-run-object-and-its-storages/get-last-run + - https://docs.apify.com/api/v2#tag/ActorsLast-run-object-and-its-storages/operation/act_runs_last_get + /v2/actors/{actorId}/runs/last/dataset: + delete: + deprecated: false + description: | + Deletes the default dataset associated with the last Actor run. + + This endpoint is a shortcut for getting the last run's `defaultDatasetId` and then using the + [Delete dataset](/api/v2/dataset-delete) endpoint. + operationId: act_runs_last_dataset_delete + parameters: + - $ref: "#/components/parameters/actorId" + - $ref: "#/components/parameters/statusLastRun" + responses: + "204": + $ref: "#/components/responses/NoContent" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Delete last run's default dataset + tags: + - Last Actor run's default dataset + get: + deprecated: false + description: | + Returns the default dataset associated with the last Actor run. + + This endpoint is a shortcut for getting the last run's `defaultDatasetId` and then using the + [Get dataset](/api/v2/dataset-get) endpoint. + operationId: act_runs_last_dataset_get + parameters: + - $ref: "#/components/parameters/actorId" + - $ref: "#/components/parameters/statusLastRun" + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/DatasetResponse" + description: "" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Get last run's default dataset + tags: + - Last Actor run's default dataset + put: + deprecated: false + description: | + Updates the default dataset associated with the last Actor run. + + This endpoint is a shortcut for getting the last run's `defaultDatasetId` and then using the + [Update dataset](/api/v2/dataset-put) endpoint. + operationId: act_runs_last_dataset_put + parameters: + - $ref: "#/components/parameters/actorId" + - $ref: "#/components/parameters/statusLastRun" + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/UpdateDatasetRequest" + description: "" + required: true + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/DatasetResponse" + description: "" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "413": + $ref: "#/components/responses/PayloadTooLarge" + "415": + $ref: "#/components/responses/UnsupportedMediaType" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Update last run's default dataset + tags: + - Last Actor run's default dataset + /v2/actors/{actorId}/runs/last/dataset/items: + get: + deprecated: false + description: | + Returns data stored in the default dataset of the last Actor run in the desired format. + + This endpoint is a shortcut that resolves the last run's `defaultDatasetId` and proxies to the + [Get dataset items](/api/v2/dataset-items-get) endpoint. + operationId: act_runs_last_dataset_items_get + parameters: + - $ref: "#/components/parameters/actorId" + - $ref: "#/components/parameters/statusLastRun" + - $ref: "#/components/parameters/format" + - $ref: "#/components/parameters/clean" + - $ref: "#/components/parameters/offset" + - $ref: "#/components/parameters/datasetParameters_limit" + - $ref: "#/components/parameters/fields" + - $ref: "#/components/parameters/outputFields" + - $ref: "#/components/parameters/omit" + - $ref: "#/components/parameters/unwind" + - $ref: "#/components/parameters/flatten" + - $ref: "#/components/parameters/descDataset" + - $ref: "#/components/parameters/attachment" + - $ref: "#/components/parameters/delimiter" + - $ref: "#/components/parameters/bom" + - $ref: "#/components/parameters/xmlRoot" + - $ref: "#/components/parameters/xmlRow" + - $ref: "#/components/parameters/skipHeaderRow" + - $ref: "#/components/parameters/skipHidden" + - $ref: "#/components/parameters/skipEmpty" + - $ref: "#/components/parameters/simplified" + - $ref: "#/components/parameters/view" + - $ref: "#/components/parameters/skipFailedPages" + - $ref: "#/components/parameters/feedTitle" + - $ref: "#/components/parameters/feedDescription" + - $ref: "#/components/parameters/signature" + responses: + "200": + content: + application/json: + schema: + example: + - foo: bar + - foo2: bar2 + items: + type: object + type: array + default: null + application/jsonl: + example: "{\"foo\":\"bar\"}\\n{\"foo2\":\"bar2\"}\\n" + schema: + type: string + text/csv: + example: "foo,bar\\nfoo2,bar2\\n" + schema: + type: string + text/html: + example:
foobar
foobar
foo2bar2
+ schema: + type: string + application/vnd.openxmlformats-officedocument.spreadsheetml.sheet: + schema: + type: string + application/rss+xml: + example: barbar2 + schema: + type: string + application/xml: + example: barbar2 + schema: + type: string + description: "" + headers: + X-Apify-Pagination-Offset: + content: + text/plain: + example: "0" + schema: {} + description: The offset of the first item in the current page. + explode: false + style: simple + X-Apify-Pagination-Limit: + content: + text/plain: + example: "100" + schema: {} + description: The maximum number of items returned per page. + explode: false + style: simple + X-Apify-Pagination-Count: + content: + text/plain: + example: "100" + schema: {} + description: The number of items returned in the current page. + explode: false + style: simple + X-Apify-Pagination-Total: + content: + text/plain: + example: "10204" + schema: {} + description: The total number of items in the dataset. + explode: false + style: simple + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Get last run's dataset items + tags: + - Last Actor run's default dataset + post: + deprecated: false + description: | + Appends an item or an array of items to the end of the last Actor run's default dataset. + + This endpoint is a shortcut that resolves the last run's `defaultDatasetId` and proxies to the + [Store items](/api/v2/dataset-items-post) endpoint. + operationId: act_runs_last_dataset_items_post + parameters: + - $ref: "#/components/parameters/actorId" + - $ref: "#/components/parameters/statusLastRun" + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/act_runs_last_dataset_items_post_request" + description: "" + required: true + responses: + "201": + content: + application/json: + schema: + example: {} + type: object + description: "" + headers: + Location: + content: + text/plain: + example: https://api.apify.com/v2/datasets/WkzbQMuFYuamGv3YF/items + schema: + type: string + explode: false + style: simple + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/act_runs_last_dataset_items_post_400_response" + description: "" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Store items in last run's dataset + tags: + - Last Actor run's default dataset + /v2/actors/{actorId}/runs/last/dataset/statistics: + get: + description: | + Returns statistics for the last Actor run's default dataset. + + This endpoint is a shortcut that resolves the last run's `defaultDatasetId` and proxies to the + [Get dataset statistics](/api/v2/dataset-statistics-get) endpoint. + operationId: act_runs_last_dataset_statistics_get + parameters: + - $ref: "#/components/parameters/actorId" + - $ref: "#/components/parameters/statusLastRun" + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/DatasetStatisticsResponse" + description: "" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Get last run's dataset statistics + tags: + - Last Actor run's default dataset + /v2/actors/{actorId}/runs/last/key-value-store: + delete: + deprecated: false + description: | + Deletes the last Actor run key-value store. + + This endpoint is a shortcut for getting the run's `defaultKeyValueStoreId` and then using the + [Delete store](/api/v2/key-value-store-delete) endpoint. + operationId: act_runs_last_keyValueStore_delete + parameters: + - $ref: "#/components/parameters/actorId" + - $ref: "#/components/parameters/statusLastRun" + responses: + "204": + $ref: "#/components/responses/NoContent" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Delete last run's default store + tags: + - Last Actor run's default key-value store + get: + deprecated: false + description: | + Gets an object that contains all the details about the default key-value store associated with the last Actor run. + + This endpoint is a shortcut for getting the run's `defaultKeyValueStoreId` and then using the + [Get store](/api/v2/key-value-store-get) endpoint. + operationId: act_runs_last_keyValueStore_get + parameters: + - $ref: "#/components/parameters/actorId" + - $ref: "#/components/parameters/statusLastRun" + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/KeyValueStoreResponse" + description: "" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Get last run's default store + tags: + - Last Actor run's default key-value store + put: + deprecated: false + description: | + Updates the last Actor run key-value store's name and general resource access level using a value specified by a JSON object + passed in the PUT payload. + + This endpoint is a shortcut for getting the run's `defaultKeyValueStoreId` and then using the + [Update store](/api/v2/key-value-store-put) endpoint. + operationId: act_runs_last_keyValueStore_put + parameters: + - $ref: "#/components/parameters/actorId" + - $ref: "#/components/parameters/statusLastRun" + requestBody: + content: + application/json: + example: + name: new-store-name + schema: + $ref: "#/components/schemas/UpdateStoreRequest" + description: "" + required: true + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/KeyValueStoreResponse" + description: "" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "413": + $ref: "#/components/responses/PayloadTooLarge" + "415": + $ref: "#/components/responses/UnsupportedMediaType" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Update last run's default store + tags: + - Last Actor run's default key-value store + /v2/actors/{actorId}/runs/last/key-value-store/keys: + get: + deprecated: false + description: | + Returns a list of keys for the default key-value store of the last Actor run. + + This endpoint is a shortcut for getting the last run's `defaultKeyValueStoreId` and then using the + [Get list of keys](/api/v2/key-value-store-keys-get) endpoint. + operationId: act_runs_last_keyValueStore_keys_get + parameters: + - $ref: "#/components/parameters/actorId" + - $ref: "#/components/parameters/statusLastRun" + - $ref: "#/components/parameters/exclusiveStartKey" + - $ref: "#/components/parameters/keyValueStoreParameters_limit" + - $ref: "#/components/parameters/collectionKeys" + - $ref: "#/components/parameters/prefixKeys" + - $ref: "#/components/parameters/signature" + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/ListOfKeysResponse" + description: "" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Get last run's default store's list of keys + tags: + - Last Actor run's default key-value store + /v2/actors/{actorId}/runs/last/key-value-store/records: + get: + deprecated: false + description: | + Downloads all records from the default key-value store of the last Actor run as a ZIP archive. + + This endpoint is a shortcut for getting the last run's `defaultKeyValueStoreId` and then using the + [Download records](/api/v2/key-value-store-records-get) endpoint. + operationId: act_runs_last_keyValueStore_records_get + parameters: + - $ref: "#/components/parameters/actorId" + - $ref: "#/components/parameters/statusLastRun" + - $ref: "#/components/parameters/collectionRecords" + - $ref: "#/components/parameters/prefixRecords" + - $ref: "#/components/parameters/signature" + responses: + "200": + content: + application/zip: + schema: + format: binary + type: string + description: A ZIP archive containing the requested records. + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Download last run's default store's records + tags: + - Last Actor run's default key-value store + /v2/actors/{actorId}/runs/last/key-value-store/records/{recordKey}: + delete: + deprecated: false + description: | + Removes a record specified by a key from the default key-value store of the last Actor run. + + This endpoint is a shortcut for getting the last run's `defaultKeyValueStoreId` and then using the + [Delete record](/api/v2/key-value-store-record-delete) endpoint. + operationId: act_runs_last_keyValueStore_record_delete + parameters: + - $ref: "#/components/parameters/actorId" + - $ref: "#/components/parameters/statusLastRun" + - $ref: "#/components/parameters/recordKey" + responses: + "204": + $ref: "#/components/responses/NoContent" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Delete last run's default store's record + tags: + - Last Actor run's default key-value store + get: + deprecated: false + description: | + Gets a value stored under a specific key in the default key-value store of the last Actor run. + + This endpoint is a shortcut for getting the last run's `defaultKeyValueStoreId` and then using the + [Get record](/api/v2/key-value-store-record-get) endpoint. + operationId: act_runs_last_keyValueStore_record_get + parameters: + - $ref: "#/components/parameters/actorId" + - $ref: "#/components/parameters/statusLastRun" + - $ref: "#/components/parameters/recordKey" + - $ref: "#/components/parameters/signature" + - $ref: "#/components/parameters/keyValueStoreParameters_attachment" + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/RecordResponse" + '*/*': + schema: {} + description: "" + "302": + content: {} + description: "" + headers: + Location: + content: + text/plain: + example: https://apifier-key-value-store-prod.s3.amazonaws.com/tqx6jeMia43gYY6eE/INPUT?AWSAccessKeyId=NKDOUN&Expires=1502720992&Signature=DKLVPI4lDDKC + schema: + type: string + explode: false + style: simple + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Get last run's default store's record + tags: + - Last Actor run's default key-value store + post: + deprecated: false + description: | + Stores a value under a specific key in the default key-value store of the last Actor run. + + This endpoint is a shortcut for getting the last run's `defaultKeyValueStoreId` and then using the + [Store record](/api/v2/key-value-store-record-post) endpoint. + operationId: act_runs_last_keyValueStore_record_post + parameters: + - $ref: "#/components/parameters/actorId" + - $ref: "#/components/parameters/statusLastRun" + - $ref: "#/components/parameters/recordKey" + - $ref: "#/components/parameters/Content-Encoding" + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/PutRecordRequest" + '*/*': + schema: {} + description: "" + required: true + responses: + "201": + content: + application/json: + example: {} + schema: + type: object + description: "" + headers: + Location: + content: + text/plain: + example: https://api.apify.com/v2/key-value-stores/WkzbQMuFYuamGv3YF/records/some-key + schema: + type: string + explode: false + style: simple + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "413": + $ref: "#/components/responses/PayloadTooLarge" + "415": + $ref: "#/components/responses/UnsupportedMediaType" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Store record in last run's default store (POST) + tags: + - Last Actor run's default key-value store + put: + deprecated: false + description: | + Stores a value under a specific key in the default key-value store of the last Actor run. + + This endpoint is a shortcut for getting the last run's `defaultKeyValueStoreId` and then using the + [Store record](/api/v2/key-value-store-record-put) endpoint. + operationId: act_runs_last_keyValueStore_record_put + parameters: + - $ref: "#/components/parameters/actorId" + - $ref: "#/components/parameters/statusLastRun" + - $ref: "#/components/parameters/recordKey" + - $ref: "#/components/parameters/Content-Encoding" + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/PutRecordRequest" + '*/*': + schema: {} + description: "" + required: true + responses: + "201": + content: + application/json: + example: {} + schema: + type: object + description: "" + headers: + Location: + content: + text/plain: + example: https://api.apify.com/v2/key-value-stores/WkzbQMuFYuamGv3YF/records/some-key + schema: + type: string + explode: false + style: simple + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "413": + $ref: "#/components/responses/PayloadTooLarge" + "415": + $ref: "#/components/responses/UnsupportedMediaType" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Store record in last run's default store + tags: + - Last Actor run's default key-value store + /v2/actors/{actorId}/runs/last/request-queue: + delete: + deprecated: false + description: | + Deletes the default request queue associated with the last Actor run. + + This endpoint is a shortcut for getting the last run's `defaultRequestQueueId` and then using the + [Delete request queue](/api/v2/request-queue-delete) endpoint. + operationId: act_runs_last_requestQueue_delete + parameters: + - $ref: "#/components/parameters/actorId" + - $ref: "#/components/parameters/statusLastRun" + responses: + "204": + $ref: "#/components/responses/NoContent" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Delete last run's default request queue + tags: + - Last Actor run's default request queue + get: + deprecated: false + description: | + Returns the default request queue associated with the last Actor run. + + This endpoint is a shortcut for getting the last run's `defaultRequestQueueId` and then using the + [Get request queue](/api/v2/request-queue-get) endpoint. + operationId: act_runs_last_requestQueue_get + parameters: + - $ref: "#/components/parameters/actorId" + - $ref: "#/components/parameters/statusLastRun" + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/RequestQueueResponse" + description: "" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Get last run's default request queue + tags: + - Last Actor run's default request queue + put: + deprecated: false + description: | + Updates the default request queue associated with the last Actor run. + + This endpoint is a shortcut for getting the last run's `defaultRequestQueueId` and then using the + [Update request queue](/api/v2/request-queue-put) endpoint. + operationId: act_runs_last_requestQueue_put + parameters: + - $ref: "#/components/parameters/actorId" + - $ref: "#/components/parameters/statusLastRun" + requestBody: + content: + application/json: + example: + name: new-request-queue-name + schema: + allOf: + - $ref: "#/components/schemas/UpdateRequestQueueRequest" + example: + name: new-request-queue-name + description: "" + required: true + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/RequestQueueResponse" + description: "" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "413": + $ref: "#/components/responses/PayloadTooLarge" + "415": + $ref: "#/components/responses/UnsupportedMediaType" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Update last run's default request queue + tags: + - Last Actor run's default request queue + /v2/actors/{actorId}/runs/last/request-queue/requests: + get: + deprecated: false + description: | + Returns a list of requests from the default request queue of the last Actor run. + + This endpoint is a shortcut for getting the last run's `defaultRequestQueueId` and then using the + [List requests](/api/v2/request-queue-requests-get) endpoint. + operationId: act_runs_last_requestQueue_requests_get + parameters: + - $ref: "#/components/parameters/actorId" + - $ref: "#/components/parameters/statusLastRun" + - $ref: "#/components/parameters/clientKey" + - $ref: "#/components/parameters/exclusiveStartId" + - $ref: "#/components/parameters/listLimit" + - $ref: "#/components/parameters/cursor" + - $ref: "#/components/parameters/filter" + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/ListOfRequestsResponse" + description: "" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: List last run's default request queue's requests + tags: + - Last Actor run's default request queue + post: + deprecated: false + description: | + Adds a request to the default request queue of the last Actor run. + + This endpoint is a shortcut for getting the last run's `defaultRequestQueueId` and then using the + [Add request](/api/v2/request-queue-requests-post) endpoint. + operationId: act_runs_last_requestQueue_requests_post + parameters: + - $ref: "#/components/parameters/actorId" + - $ref: "#/components/parameters/statusLastRun" + - $ref: "#/components/parameters/clientKey" + - $ref: "#/components/parameters/forefront" + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/RequestBase" + description: "" + required: true + responses: + "201": + content: + application/json: + schema: + $ref: "#/components/schemas/AddRequestResponse" + description: "" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "413": + $ref: "#/components/responses/PayloadTooLarge" + "415": + $ref: "#/components/responses/UnsupportedMediaType" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Add request to last run's default request queue + tags: + - Last Actor run's default request queue + /v2/actors/{actorId}/runs/last/request-queue/requests/batch: + delete: + deprecated: false + description: | + Batch-deletes requests from the default request queue of the last Actor run. + + This endpoint is a shortcut for getting the last run's `defaultRequestQueueId` and then using the + [Delete requests](/api/v2/request-queue-requests-batch-delete) endpoint. + operationId: act_runs_last_requestQueue_requests_batch_delete + parameters: + - $ref: "#/components/parameters/actorId" + - $ref: "#/components/parameters/statusLastRun" + - $ref: "#/components/parameters/contentTypeJson" + - $ref: "#/components/parameters/clientKey" + requestBody: + content: + application/json: + schema: + items: + $ref: "#/components/schemas/RequestDraftDelete" + type: array + default: null + description: "" + required: true + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/BatchDeleteResponse" + description: "" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "413": + $ref: "#/components/responses/PayloadTooLarge" + "415": + $ref: "#/components/responses/UnsupportedMediaType" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Batch delete requests from last run's default request queue + tags: + - Last Actor run's default request queue + post: + deprecated: false + description: | + Adds requests to the default request queue of the last Actor run in batch. + + This endpoint is a shortcut for getting the last run's `defaultRequestQueueId` and then using the + [Add requests](/api/v2/request-queue-requests-batch-post) endpoint. + operationId: act_runs_last_requestQueue_requests_batch_post + parameters: + - $ref: "#/components/parameters/actorId" + - $ref: "#/components/parameters/statusLastRun" + - $ref: "#/components/parameters/clientKey" + - $ref: "#/components/parameters/forefront" + requestBody: + content: + application/json: + schema: + description: "" + items: + $ref: "#/components/schemas/RequestBase" + type: array + default: null + description: "" + required: true + responses: + "201": + content: + application/json: + schema: + $ref: "#/components/schemas/BatchAddResponse" + description: "" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "413": + $ref: "#/components/responses/PayloadTooLarge" + "415": + $ref: "#/components/responses/UnsupportedMediaType" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Batch add requests to last run's default request queue + tags: + - Last Actor run's default request queue + /v2/actors/{actorId}/runs/last/request-queue/requests/unlock: + post: + deprecated: false + description: | + Unlocks requests in the default request queue of the last Actor run that are currently locked by the client. + + This endpoint is a shortcut for getting the last run's `defaultRequestQueueId` and then using the + [Unlock requests](/api/v2/request-queue-requests-unlock-post) endpoint. + operationId: act_runs_last_requestQueue_requests_unlock_post + parameters: + - $ref: "#/components/parameters/actorId" + - $ref: "#/components/parameters/statusLastRun" + - $ref: "#/components/parameters/clientKey" + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/UnlockRequestsResponse" + description: Number of requests that were unlocked + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Unlock requests in last run's default request queue + tags: + - Last Actor run's default request queue + /v2/actors/{actorId}/runs/last/request-queue/requests/{requestId}: + delete: + deprecated: false + description: | + Deletes a request from the default request queue of the last Actor run. + + This endpoint is a shortcut for getting the last run's `defaultRequestQueueId` and then using the + [Delete request](/api/v2/request-queue-request-delete) endpoint. + operationId: act_runs_last_requestQueue_request_delete + parameters: + - $ref: "#/components/parameters/actorId" + - $ref: "#/components/parameters/statusLastRun" + - $ref: "#/components/parameters/requestId" + - $ref: "#/components/parameters/clientKey" + responses: + "204": + $ref: "#/components/responses/NoContent" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Delete request from last run's default request queue + tags: + - Last Actor run's default request queue + get: + deprecated: false + description: | + Returns a request from the default request queue of the last Actor run. + + This endpoint is a shortcut for getting the last run's `defaultRequestQueueId` and then using the + [Get request](/api/v2/request-queue-request-get) endpoint. + operationId: act_runs_last_requestQueue_request_get + parameters: + - $ref: "#/components/parameters/actorId" + - $ref: "#/components/parameters/statusLastRun" + - $ref: "#/components/parameters/requestId" + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/RequestResponse" + description: "" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Get request from last run's default request queue + tags: + - Last Actor run's default request queue + put: + deprecated: false + description: | + Updates a request in the default request queue of the last Actor run. + + This endpoint is a shortcut for getting the last run's `defaultRequestQueueId` and then using the + [Update request](/api/v2/request-queue-request-put) endpoint. + operationId: act_runs_last_requestQueue_request_put + parameters: + - $ref: "#/components/parameters/actorId" + - $ref: "#/components/parameters/statusLastRun" + - $ref: "#/components/parameters/requestId" + - $ref: "#/components/parameters/forefront" + - $ref: "#/components/parameters/clientKey" + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/Request" + description: "" + required: true + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/UpdateRequestResponse" + description: "" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "413": + $ref: "#/components/responses/PayloadTooLarge" + "415": + $ref: "#/components/responses/UnsupportedMediaType" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Update request in last run's default request queue + tags: + - Last Actor run's default request queue + /v2/actors/{actorId}/runs/last/request-queue/requests/{requestId}/lock: + delete: + deprecated: false + description: | + Deletes a request lock in the default request queue of the last Actor run. + + This endpoint is a shortcut for getting the last run's `defaultRequestQueueId` and then using the + [Delete request lock](/api/v2/request-queue-request-lock-delete) endpoint. + operationId: act_runs_last_requestQueue_request_lock_delete + parameters: + - $ref: "#/components/parameters/actorId" + - $ref: "#/components/parameters/statusLastRun" + - $ref: "#/components/parameters/requestId" + - $ref: "#/components/parameters/clientKey" + - $ref: "#/components/parameters/deleteForefront" + responses: + "204": + $ref: "#/components/responses/NoContent" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Delete lock on request in last run's default request queue + tags: + - Last Actor run's default request queue + put: + deprecated: false + description: | + Prolongs a request lock in the default request queue of the last Actor run. + + This endpoint is a shortcut for getting the last run's `defaultRequestQueueId` and then using the + [Prolong request lock](/api/v2/request-queue-request-lock-put) endpoint. + operationId: act_runs_last_requestQueue_request_lock_put + parameters: + - $ref: "#/components/parameters/actorId" + - $ref: "#/components/parameters/statusLastRun" + - $ref: "#/components/parameters/requestId" + - $ref: "#/components/parameters/lockSecs" + - $ref: "#/components/parameters/clientKey" + - $ref: "#/components/parameters/lockForefront" + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/ProlongRequestLockResponse" + description: "" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Prolong lock on request in last run's default request queue + tags: + - Last Actor run's default request queue + /v2/actors/{actorId}/runs/last/request-queue/head: + get: + deprecated: false + description: | + Returns the given number of first requests from the default request queue of the last Actor run. + + This endpoint is a shortcut for getting the last run's `defaultRequestQueueId` and then using the + [Get head](/api/v2/request-queue-head-get) endpoint. + operationId: act_runs_last_requestQueue_head_get + parameters: + - $ref: "#/components/parameters/actorId" + - $ref: "#/components/parameters/statusLastRun" + - $ref: "#/components/parameters/headLimit" + - $ref: "#/components/parameters/clientKey" + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/HeadResponse" + description: "" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Get last run's default request queue head + tags: + - Last Actor run's default request queue + /v2/actors/{actorId}/runs/last/request-queue/head/lock: + post: + deprecated: false + description: | + Returns the given number of first requests from the default request queue of the last Actor run + and locks them for the given time. + + This endpoint is a shortcut for getting the last run's `defaultRequestQueueId` and then using the + [Get head and lock](/api/v2/request-queue-head-lock-post) endpoint. + operationId: act_runs_last_requestQueue_head_lock_post + parameters: + - $ref: "#/components/parameters/actorId" + - $ref: "#/components/parameters/statusLastRun" + - $ref: "#/components/parameters/lockSecs" + - $ref: "#/components/parameters/headLockLimit" + - $ref: "#/components/parameters/clientKey" + responses: + "201": + content: + application/json: + schema: + $ref: "#/components/schemas/HeadAndLockResponse" + description: "" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Get and lock last run's default request queue head + tags: + - Last Actor run's default request queue + /v2/actors/{actorId}/runs/last/log: + get: + deprecated: false + description: | + Retrieves last Actor run's logs. + + This endpoint is a shortcut for getting last Actor run's log. Same as [Get log](/api/v2/log-get) endpoint. + operationId: act_runs_last_log_get + parameters: + - $ref: "#/components/parameters/actorId" + - $ref: "#/components/parameters/stream" + - $ref: "#/components/parameters/download" + - $ref: "#/components/parameters/raw" + responses: + "200": + content: + text/plain: + schema: + example: | + 2017-07-14T06:00:49.733Z Application started. + 2017-07-14T06:00:49.741Z Input: { test: 123 } + 2017-07-14T06:00:49.752Z Some useful debug information follows. + type: string + description: "" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Get last Actor run's log + tags: + - Last Actor run's log + /v2/actors/{actorId}/runs/last/abort: + post: + deprecated: false + description: | + Aborts the last run of the specified Actor and returns an object that + contains all the details about the run. + + This endpoint is a shortcut for [Abort run](#/reference/actor-runs/abort-run/abort-run) + on the Actor's last run. Only runs that are starting or running are aborted. + For runs with status `FINISHED`, `FAILED`, `ABORTING` and `TIMED-OUT` this call + does nothing. + operationId: act_runs_last_abort_post + parameters: + - $ref: "#/components/parameters/actorId" + - $ref: "#/components/parameters/statusLastRun" + - $ref: "#/components/parameters/gracefully" + responses: + "200": + content: + application/json: + example: + data: + id: HG7ML7M8z78YcAPEB + actId: janedoe~my-actor + userId: BPWZBd7Z9c746JAng + actorTaskId: rANaydYhUxjsnA3oz + startedAt: 2019-11-30T07:34:24.202Z + finishedAt: 2019-12-12T09:30:12.202Z + status: ABORTED + statusMessage: Actor was aborted + isStatusMessageTerminal: true + meta: + origin: WEB + clientIp: 172.234.12.34 + userAgent: Mozilla/5.0 (iPad) + stats: + inputBodyLen: 240 + migrationCount: 0 + restartCount: 0 + resurrectCount: 1 + memAvgBytes: 3.59142284E7 + memMaxBytes: 38244352 + memCurrentBytes: 0 + cpuAvgUsage: 0.00955965 + cpuMaxUsage: 3.1546 + cpuCurrentUsage: 0 + netRxBytes: 2652 + netTxBytes: 1338 + durationMillis: 26239 + runTimeSecs: 26.239 + metamorph: 0 + computeUnits: 0.0072886 + options: + build: latest + timeoutSecs: 300 + memoryMbytes: 1024 + diskMbytes: 2048 + buildId: 7sT5jcggjjA9fNcxF + exitCode: 0 + generalAccess: RESTRICTED + defaultKeyValueStoreId: eJNzqsbPiopwJcgGQ + defaultDatasetId: wmKPijuyDnPZAPRMk + defaultRequestQueueId: FL35cSF7jrxr3BY39 + storageIds: + datasets: + default: wmKPijuyDnPZAPRMk + keyValueStores: + default: eJNzqsbPiopwJcgGQ + requestQueues: + default: FL35cSF7jrxr3BY39 + isContainerServerReady: false + gitBranchName: master + usage: + ACTOR_COMPUTE_UNITS: 3 + DATASET_READS: 4 + DATASET_WRITES: 4 + KEY_VALUE_STORE_READS: 5 + KEY_VALUE_STORE_WRITES: 3 + KEY_VALUE_STORE_LISTS: 5 + REQUEST_QUEUE_READS: 2 + REQUEST_QUEUE_WRITES: 1 + DATA_TRANSFER_INTERNAL_GBYTES: 1 + DATA_TRANSFER_EXTERNAL_GBYTES: 3 + PROXY_RESIDENTIAL_TRANSFER_GBYTES: 34 + PROXY_SERPS: 3 + usageTotalUsd: 0.2654 + usageUsd: + ACTOR_COMPUTE_UNITS: 0.072 + DATASET_READS: 4.0E-4 + DATASET_WRITES: 2.0E-4 + KEY_VALUE_STORE_READS: 6.0E-4 + KEY_VALUE_STORE_WRITES: 0.002 + KEY_VALUE_STORE_LISTS: 0.004 + REQUEST_QUEUE_READS: 0.005 + REQUEST_QUEUE_WRITES: 0.02 + DATA_TRANSFER_INTERNAL_GBYTES: 4.0E-4 + DATA_TRANSFER_EXTERNAL_GBYTES: 2.0E-4 + PROXY_RESIDENTIAL_TRANSFER_GBYTES: 0.16 + PROXY_SERPS: 6.0E-4 + schema: + $ref: "#/components/schemas/RunResponse" + description: "" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Abort Actor's last run + tags: + - Last Actor run's abort + /v2/actors/{actorId}/runs/last/metamorph: + post: + deprecated: false + description: | + Transforms the last run of the specified Actor into a run of another Actor with + a new input. + + This endpoint is a shortcut for [Metamorph run](#/reference/actor-runs/metamorph-run/metamorph-run) + on the Actor's last run. + operationId: act_runs_last_metamorph_post + parameters: + - $ref: "#/components/parameters/actorId" + - $ref: "#/components/parameters/statusLastRun" + - $ref: "#/components/parameters/targetActorId" + - description: | + Optional build of the target Actor. + + It can be either a build tag or build number. By default, the run uses + the build specified in the default run configuration for the target + Actor (typically `latest`). + explode: true + in: query + name: build + required: false + schema: + example: beta + type: string + style: form + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/RunResponse" + description: "" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Metamorph Actor's last run + tags: + - Last Actor run's metamorph + /v2/actors/{actorId}/runs/last/reboot: + post: + deprecated: false + description: | + Reboots the last run of the specified Actor and returns an object that + contains all the details about the rebooted run. + + This endpoint is a shortcut for [Reboot run](#/reference/actor-runs/reboot-run/reboot-run) + on the Actor's last run. Only runs with status `RUNNING` can be rebooted. The run's + container will be restarted, so any data not persisted in the key-value store, dataset, + or request queue will be lost. + operationId: act_runs_last_reboot_post + parameters: + - $ref: "#/components/parameters/actorId" + - $ref: "#/components/parameters/statusLastRun" + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/RunResponse" + description: "" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Reboot Actor's last run + tags: + - Last Actor run's reboot + /v2/actors/{actorId}/runs/{runId}: + get: + deprecated: true + description: | + **[DEPRECATED]** API endpoints related to run of the Actor were moved under + new namespace [`actor-runs`](#/reference/actor-runs). + + Gets an object that contains all the details about a specific run of an Actor. + + By passing the optional `waitForFinish` parameter the API endpoint will + synchronously wait for the run to finish. + This is useful to avoid periodic polling when waiting for Actor run to + complete. + + This endpoint does not require the authentication token. Instead, calls are authenticated using a hard-to-guess ID of the run. However, + if you access the endpoint without the token, certain attributes, such as `usageUsd` and `usageTotalUsd`, will be hidden. + operationId: act_run_get + parameters: + - $ref: "#/components/parameters/actorId" + - $ref: "#/components/parameters/runId" + - $ref: "#/components/parameters/waitForFinishRun" + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/RunResponse" + description: "" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Get run + tags: + - Actors/Actor runs + x-legacy-doc-urls: + - https://docs.apify.com/api/v2#/reference/actors/run-object/get-run + - https://docs.apify.com/api/v2#/reference/actors/get-run + - https://docs.apify.com/api/v2#tag/ActorsRun-object/operation/act_run_get + /v2/actors/{actorId}/runs/{runId}/abort: + post: + deprecated: true + description: | + **[DEPRECATED]** API endpoints related to run of the Actor were moved under + new namespace [`actor-runs`](#/reference/actor-runs). Aborts an Actor run and + returns an object that contains all the details about the run. + + Only runs that are starting or running are aborted. For runs with status + `FINISHED`, `FAILED`, `ABORTING` and `TIMED-OUT` this call does nothing. + operationId: act_run_abort_post + parameters: + - $ref: "#/components/parameters/actorId" + - $ref: "#/components/parameters/runId" + - $ref: "#/components/parameters/gracefully" + responses: + "200": + content: + application/json: + example: + data: + id: HG7ML7M8z78YcAPEB + actId: janedoe~my-actor + userId: BPWZBd7Z9c746JAng + actorTaskId: rANaydYhUxjsnA3oz + startedAt: 2019-11-30T07:34:24.202Z + finishedAt: 2019-12-12T09:30:12.202Z + status: ABORTED + statusMessage: Actor was aborted + isStatusMessageTerminal: true + meta: + origin: WEB + clientIp: 172.234.12.34 + userAgent: Mozilla/5.0 (iPad) + stats: + inputBodyLen: 240 + migrationCount: 0 + restartCount: 0 + resurrectCount: 1 + memAvgBytes: 3.59142284E7 + memMaxBytes: 38244352 + memCurrentBytes: 0 + cpuAvgUsage: 0.00955965 + cpuMaxUsage: 3.1546 + cpuCurrentUsage: 0 + netRxBytes: 2652 + netTxBytes: 1338 + durationMillis: 26239 + runTimeSecs: 26.239 + metamorph: 0 + computeUnits: 0.0072886 + options: + build: latest + timeoutSecs: 300 + memoryMbytes: 1024 + diskMbytes: 2048 + buildId: 7sT5jcggjjA9fNcxF + exitCode: 0 + generalAccess: RESTRICTED + defaultKeyValueStoreId: eJNzqsbPiopwJcgGQ + defaultDatasetId: wmKPijuyDnPZAPRMk + defaultRequestQueueId: FL35cSF7jrxr3BY39 + storageIds: + datasets: + default: wmKPijuyDnPZAPRMk + keyValueStores: + default: eJNzqsbPiopwJcgGQ + requestQueues: + default: FL35cSF7jrxr3BY39 + isContainerServerReady: false + gitBranchName: master + usage: + ACTOR_COMPUTE_UNITS: 3 + DATASET_READS: 4 + DATASET_WRITES: 4 + KEY_VALUE_STORE_READS: 5 + KEY_VALUE_STORE_WRITES: 3 + KEY_VALUE_STORE_LISTS: 5 + REQUEST_QUEUE_READS: 2 + REQUEST_QUEUE_WRITES: 1 + DATA_TRANSFER_INTERNAL_GBYTES: 1 + DATA_TRANSFER_EXTERNAL_GBYTES: 3 + PROXY_RESIDENTIAL_TRANSFER_GBYTES: 34 + PROXY_SERPS: 3 + usageTotalUsd: 0.2654 + usageUsd: + ACTOR_COMPUTE_UNITS: 0.072 + DATASET_READS: 4.0E-4 + DATASET_WRITES: 2.0E-4 + KEY_VALUE_STORE_READS: 6.0E-4 + KEY_VALUE_STORE_WRITES: 0.002 + KEY_VALUE_STORE_LISTS: 0.004 + REQUEST_QUEUE_READS: 0.005 + REQUEST_QUEUE_WRITES: 0.02 + DATA_TRANSFER_INTERNAL_GBYTES: 4.0E-4 + DATA_TRANSFER_EXTERNAL_GBYTES: 2.0E-4 + PROXY_RESIDENTIAL_TRANSFER_GBYTES: 0.16 + PROXY_SERPS: 6.0E-4 + schema: + $ref: "#/components/schemas/RunResponse" + description: "" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Abort run + tags: + - Actors/Actor runs + x-legacy-doc-urls: + - https://docs.apify.com/api/v2#/reference/actors/abort-run/abort-run + - https://docs.apify.com/api/v2#/reference/actors/abort-run + - https://docs.apify.com/api/v2#tag/ActorsAbort-run/operation/act_run_abort_post + /v2/actors/{actorId}/runs/{runId}/metamorph: + post: + deprecated: true + description: | + **[DEPRECATED]** API endpoints related to run of the Actor were moved under + new namespace [`actor-runs`](#/reference/actor-runs). Transforms an Actor run + into a run of another Actor with a new input. + + This is useful if you want to use another Actor to finish the work + of your current Actor run, without the need to create a completely new run + and waiting for its finish. + For the users of your Actors, the metamorph operation is transparent, they + will just see your Actor got the work done. + + There is a limit on how many times you can metamorph a single run. You can + check the limit in [the Actor runtime limits](https://docs.apify.com/platform/limits#actor-limits). + + Internally, the system stops the Docker container corresponding to the Actor + run and starts a new container using a different Docker image. + All the default storages are preserved and the new input is stored under the + `INPUT-METAMORPH-1` key in the same default key-value store. + + For more information, see the [Actor docs](https://docs.apify.com/platform/actors/development/programming-interface/metamorph). + operationId: act_run_metamorph_post + parameters: + - $ref: "#/components/parameters/actorId" + - $ref: "#/components/parameters/runId" + - $ref: "#/components/parameters/targetActorId" + - description: | + Optional build of the target Actor. + + It can be either a build tag or build number. By default, the run uses + the build specified in the default run configuration for the target + Actor (typically `latest`). + explode: true + in: query + name: build + required: false + schema: + example: beta + type: string + style: form + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/RunResponse" + description: "" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Metamorph run + tags: + - Actors/Actor runs + x-legacy-doc-urls: + - https://docs.apify.com/api/v2#/reference/actors/metamorph-run/metamorph-run + - https://docs.apify.com/api/v2#/reference/actors/metamorph-run + - https://docs.apify.com/api/v2#tag/ActorsMetamorph-run/operation/act_run_metamorph_post + /v2/actor-tasks: + get: + deprecated: false + description: | + Gets the complete list of tasks that a user has created or used. + + The response is a list of objects in which each object contains essential + information about a single task. + + The endpoint supports pagination using the `limit` and `offset` parameters, + and it does not return more than a 1000 records. + + By default, the records are sorted by the `createdAt` field in ascending + order; therefore you can use pagination to incrementally fetch all tasks while new + ones are still being created. To sort the records in descending order, use + the `desc=1` parameter. + operationId: actorTasks_get + parameters: + - $ref: "#/components/parameters/offset" + - $ref: "#/components/parameters/limit" + - $ref: "#/components/parameters/descCreatedAt" + responses: + "200": + content: + application/json: + example: + data: + total: 2 + offset: 0 + limit: 1000 + desc: false + count: 2 + items: + - id: zdc3Pyhyz3m8vjDeM + userId: wRsJZtadYvn4mBZmm + actId: asADASadYvn4mBZmm + actName: my-actor + name: my-task + username: janedoe + actUsername: janedoe + createdAt: 2018-10-26T07:23:14.855Z + modifiedAt: 2018-10-26T13:30:49.578Z + stats: + totalRuns: 15 + - id: aWE3asdas3m8vjDeM + userId: wRsJZtadYvn4mBZmm + actId: asADASadYvn4mBZmm + actName: my-actor + actUsername: janedoe + name: my-task-2 + username: janedoe + createdAt: 2018-10-26T07:23:14.855Z + modifiedAt: 2018-10-26T13:30:49.578Z + stats: + totalRuns: 4 + schema: + $ref: "#/components/schemas/ListOfTasksResponse" + description: "" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Get list of tasks + tags: + - Actor tasks + x-legacy-doc-urls: + - https://docs.apify.com/api/v2#/reference/actor-tasks/task-collection/get-list-of-tasks + - https://docs.apify.com/api/v2#/reference/actor-tasks/get-list-of-tasks + - https://docs.apify.com/api/v2#tag/Actor-tasksTask-collection/operation/actorTasks_get + x-js-parent: TaskCollectionClient + x-js-name: list + x-js-doc-url: https://docs.apify.com/api/client/js/reference/class/TaskCollectionClient#list + x-py-parent: TaskCollectionClientAsync + x-py-name: list + x-py-doc-url: https://docs.apify.com/api/client/python/reference/class/TaskCollectionClientAsync#list + post: + deprecated: false + description: | + Create a new task with settings specified by the object passed as JSON in + the POST payload. + + The response is the full task object as returned by the + [Get task](/api/v2/actor-task-get) endpoint. + + The request needs to specify the `Content-Type: application/json` HTTP header! + + When providing your API authentication token, we recommend using the + request's `Authorization` header, rather than the URL. + operationId: actorTasks_post + requestBody: + content: + application/json: + example: + actId: asADASadYvn4mBZmm + name: my-task + options: + build: latest + timeoutSecs: 300 + memoryMbytes: 128 + schema: + allOf: + - $ref: "#/components/schemas/CreateTaskRequest" + example: + actId: asADASadYvn4mBZmm + name: my-task + options: + build: latest + timeoutSecs: 300 + memoryMbytes: 128 + input: + hello: world + description: "" + required: true + responses: + "201": + content: + application/json: + schema: + $ref: "#/components/schemas/TaskResponse" + description: "" + headers: + Location: + content: + text/plain: + example: https://api.apify.com/v2/actor-tasks/zdc3Pyhyz3m8vjDeM + schema: + type: string + explode: false + style: simple + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "409": + $ref: "#/components/responses/Conflict" + "413": + $ref: "#/components/responses/PayloadTooLarge" + "415": + $ref: "#/components/responses/UnsupportedMediaType" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Create task + tags: + - Actor tasks + x-legacy-doc-urls: + - https://docs.apify.com/api/v2#/reference/actor-tasks/task-collection/create-task + - https://docs.apify.com/api/v2#/reference/actor-tasks/create-task + - https://docs.apify.com/api/v2#tag/Actor-tasksTask-collection/operation/actorTasks_post + x-js-parent: TaskCollectionClient + x-js-name: create + x-js-doc-url: https://docs.apify.com/api/client/js/reference/class/TaskCollectionClient#create + x-py-parent: TaskCollectionClientAsync + x-py-name: create + x-py-doc-url: https://docs.apify.com/api/client/python/reference/class/TaskCollectionClientAsync#create + /v2/actor-tasks/{actorTaskId}: + delete: + deprecated: false + description: Delete the task specified through the `actorTaskId` parameter. + operationId: actorTask_delete + parameters: + - $ref: "#/components/parameters/actorTaskId" + responses: + "204": + content: + application/json: + example: {} + schema: + type: object + description: "" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Delete task + tags: + - Actor tasks + x-legacy-doc-urls: + - https://docs.apify.com/api/v2#/reference/actor-tasks/task-object/delete-task + - https://docs.apify.com/api/v2#/reference/actor-tasks/delete-task + - https://docs.apify.com/api/v2#tag/Actor-tasksTask-object/operation/actorTask_delete + x-js-parent: TaskClient + x-js-name: delete + x-js-doc-url: https://docs.apify.com/api/client/js/reference/class/TaskClient#delete + get: + deprecated: false + description: Get an object that contains all the details about a task. + operationId: actorTask_get + parameters: + - $ref: "#/components/parameters/actorTaskId" + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/actorTask_get_200_response" + description: "" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Get task + tags: + - Actor tasks + x-legacy-doc-urls: + - https://docs.apify.com/api/v2#/reference/actor-tasks/task-object/get-task + - https://docs.apify.com/api/v2#/reference/actor-tasks/get-task + - https://docs.apify.com/api/v2#tag/Actor-tasksTask-object/operation/actorTask_get + x-js-parent: TaskClient + x-js-name: get + x-js-doc-url: https://docs.apify.com/api/client/js/reference/class/TaskClient#get + x-py-parent: TaskClientAsync + x-py-name: get + x-py-doc-url: https://docs.apify.com/api/client/python/reference/class/TaskClientAsync#get + put: + deprecated: false + description: | + Update settings of a task using values specified by an object passed as JSON + in the POST payload. + + If the object does not define a specific property, its value is not updated. + + The response is the full task object as returned by the + [Get task](/api/v2/actor-task-get) endpoint. + + The request needs to specify the `Content-Type: application/json` HTTP + header! + + When providing your API authentication token, we recommend using the + request's `Authorization` header, rather than the URL. + operationId: actorTask_put + parameters: + - $ref: "#/components/parameters/actorTaskId" + requestBody: + content: + application/json: + example: + name: my-task + options: + build: latest + timeoutSecs: 300 + memoryMbytes: 128 + input: + hello: world + schema: + $ref: "#/components/schemas/UpdateTaskRequest" + description: "" + required: true + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/actorTask_get_200_response" + description: "" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "413": + $ref: "#/components/responses/PayloadTooLarge" + "415": + $ref: "#/components/responses/UnsupportedMediaType" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Update task + tags: + - Actor tasks + x-legacy-doc-urls: + - https://docs.apify.com/api/v2#/reference/actor-tasks/task-object/update-task + - https://docs.apify.com/api/v2#/reference/actor-tasks/update-task + - https://docs.apify.com/api/v2#tag/Actor-tasksTask-object/operation/actorTask_put + x-js-parent: TaskClient + x-js-name: update + x-js-doc-url: https://docs.apify.com/api/client/js/reference/class/TaskClient#update + x-py-parent: TaskClientAsync + x-py-name: update + x-py-doc-url: https://docs.apify.com/api/client/python/reference/class/TaskClientAsync#update + /v2/actor-tasks/{actorTaskId}/input: + get: + deprecated: false + description: Returns the input of a given task. + operationId: actorTask_input_get + parameters: + - $ref: "#/components/parameters/actorTaskId" + responses: + "200": + content: + application/json: + example: + myField1: some-value + myField2: another-value + myField3: 1 + schema: + type: object + description: "" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Get task input + tags: + - Actor tasks + x-legacy-doc-urls: + - https://docs.apify.com/api/v2#/reference/actor-tasks/task-input-object/get-task-input + - https://docs.apify.com/api/v2#/reference/actor-tasks/get-task-input + - https://docs.apify.com/api/v2#tag/Actor-tasksTask-input-object/operation/actorTask_input_get + x-js-parent: TaskClient + x-js-name: getInput + x-js-doc-url: https://docs.apify.com/api/client/js/reference/class/TaskClient#getInput + x-py-parent: TaskClientAsync + x-py-name: get_input + x-py-doc-url: https://docs.apify.com/api/client/python/reference/class/TaskClientAsync#get_input + put: + deprecated: false + description: | + Updates the input of a task using values specified by an object passed as + JSON in the PUT payload. + + If the object does not define a specific property, its value is not updated. + + The response is the full task input as returned by the + [Get task input](#/reference/tasks/task-input-object/get-task-input) endpoint. + + The request needs to specify the `Content-Type: application/json` HTTP + header! + + When providing your API authentication token, we recommend using the + request's `Authorization` header, rather than the URL. ([More + info](#/introduction/authentication)). + operationId: actorTask_input_put + parameters: + - $ref: "#/components/parameters/actorTaskId" + requestBody: + content: + application/json: + example: + myField2: updated-value + schema: + type: object + description: "" + required: true + responses: + "200": + content: + application/json: + example: + myField1: some-value + myField2: updated-value + myField3: 1 + schema: + type: object + description: "" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "413": + $ref: "#/components/responses/PayloadTooLarge" + "415": + $ref: "#/components/responses/UnsupportedMediaType" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Update task input + tags: + - Actor tasks + x-legacy-doc-urls: + - https://docs.apify.com/api/v2#/reference/actor-tasks/task-input-object/update-task-input + - https://docs.apify.com/api/v2#/reference/actor-tasks/update-task-input + - https://docs.apify.com/api/v2#tag/Actor-tasksTask-input-object/operation/actorTask_input_put + x-js-parent: TaskClient + x-js-name: updateInput + x-js-doc-url: https://docs.apify.com/api/client/js/reference/class/TaskClient#updateInput + x-py-parent: TaskClientAsync + x-py-name: update_input + x-py-doc-url: https://docs.apify.com/api/client/python/reference/class/TaskClientAsync#update_input + /v2/actor-tasks/{actorTaskId}/webhooks: + get: + deprecated: false + description: | + Gets the list of webhooks of a specific Actor task. The response is a JSON + with the list of objects, where each object contains basic information about a single webhook. + + The endpoint supports pagination using the `limit` and `offset` parameters + and it will not return more than 1000 records. + + By default, the records are sorted by the `createdAt` field in ascending + order, to sort the records in descending order, use the `desc=1` parameter. + operationId: actorTask_webhooks_get + parameters: + - $ref: "#/components/parameters/actorTaskId" + - $ref: "#/components/parameters/offset" + - $ref: "#/components/parameters/limit" + - $ref: "#/components/parameters/descCreatedAt" + responses: + "200": + content: + application/json: + example: + data: + total: 2 + offset: 0 + limit: 1000 + desc: false + count: 2 + items: + - id: YiKoxjkaS9gjGTqhF + createdAt: 2019-12-12T07:34:14.202Z + modifiedAt: 2019-12-13T08:36:13.202Z + userId: wRsJZtadYvn4mBZmm + isAdHoc: false + shouldInterpolateStrings: false + eventTypes: + - ACTOR.RUN.SUCCEEDED + condition: + actorId: hksJZtadYvn4mBuin + actorTaskId: asdLZtadYvn4mBZmm + actorRunId: hgdKZtadYvn4mBpoi + ignoreSslErrors: false + doNotRetry: false + requestUrl: http://example.com/ + payloadTemplate: "{\\n \\\"userId\\\": {{userId}}..." + headersTemplate: "{\\n \\\"Authorization\\\": Bearer..." + description: this is webhook description + lastDispatch: + status: SUCCEEDED + finishedAt: 2019-12-13T08:36:13.202Z + stats: + totalDispatches: 1 + - id: YiKoxjkaS9gjGTqhF + createdAt: 2019-12-12T07:34:14.202Z + modifiedAt: 2019-12-13T08:36:13.202Z + userId: wRsJZtadYvn4mBZmm + isAdHoc: false + shouldInterpolateStrings: false + eventTypes: + - ACTOR.RUN.SUCCEEDED + condition: + actorId: hksJZtadYvn4mBuin + actorTaskId: asdLZtadYvn4mBZmm + actorRunId: hgdKZtadYvn4mBpoi + ignoreSslErrors: false + doNotRetry: false + requestUrl: http://example.com/ + payloadTemplate: "{\\n \\\"userId\\\": {{userId}}..." + headersTemplate: "{\\n \\\"Authorization\\\": Bearer..." + description: this is webhook description + lastDispatch: + status: SUCCEEDED + finishedAt: 2019-12-13T08:36:13.202Z + stats: + totalDispatches: 1 + schema: + $ref: "#/components/schemas/actorTask_webhooks_get_200_response" + description: "" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Get list of webhooks + tags: + - Actor tasks + x-legacy-doc-urls: + - https://docs.apify.com/api/v2#/reference/actor-tasks/webhook-collection/get-list-of-webhooks + - https://docs.apify.com/api/v2#/reference/actor-tasks/get-list-of-webhooks + - https://docs.apify.com/api/v2#tag/Actor-tasksWebhook-collection/operation/actorTask_webhooks_get + /v2/actor-tasks/{actorTaskId}/runs: + get: + deprecated: false + description: | + Get a list of runs of a specific task. The response is a list of objects, + where each object contains essential information about a single task run. + + The endpoint supports pagination using the `limit` and `offset` parameters, + and it does not return more than a 1000 array elements. + + By default, the records are sorted by the `startedAt` field in ascending + order; therefore you can use pagination to incrementally fetch all records while + new ones are still being created. To sort the records in descending order, use + the `desc=1` parameter. You can also filter runs by status ([available + statuses](https://docs.apify.com/platform/actors/running/runs-and-builds#lifecycle)). + operationId: actorTask_runs_get + parameters: + - $ref: "#/components/parameters/actorTaskId" + - $ref: "#/components/parameters/offset" + - $ref: "#/components/parameters/limit" + - $ref: "#/components/parameters/descStartedAt" + - $ref: "#/components/parameters/status" + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/actorTask_runs_get_200_response" + description: "" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Get list of task runs + tags: + - Actor tasks + x-legacy-doc-urls: + - https://docs.apify.com/api/v2#/reference/actor-tasks/run-collection/get-list-of-task-runs + - https://docs.apify.com/api/v2#/reference/actor-tasks/get-list-of-task-runs + - https://docs.apify.com/api/v2#tag/Actor-tasksRun-collection/operation/actorTask_runs_get + post: + deprecated: false + description: | + Runs an Actor task and immediately returns without waiting for the run to + finish. + + Optionally, you can override the Actor input configuration by passing a JSON + object as the POST payload and setting the `Content-Type: application/json` HTTP header. + + Note that if the object in the POST payload does not define a particular + input property, the Actor run uses the default value defined by the task (or Actor's input + schema if not defined by the task). + + The response is the Actor Run object as returned by the [Get + run](#/reference/actor-runs/run-object-and-its-storages/get-run) endpoint. + + If you want to wait for the run to finish and receive the actual output of + the Actor run as the response, use one of the [Run task + synchronously](#/reference/actor-tasks/run-task-synchronously) API endpoints + instead. + + To fetch the Actor run results that are typically stored in the default + dataset, you'll need to pass the ID received in the `defaultDatasetId` field + received in the response JSON to the + [Get dataset items](#/reference/datasets/item-collection/get-items) API endpoint. + operationId: actorTask_runs_post + parameters: + - $ref: "#/components/parameters/actorTaskId" + - $ref: "#/components/parameters/timeout" + - $ref: "#/components/parameters/memory" + - $ref: "#/components/parameters/maxItems" + - $ref: "#/components/parameters/maxTotalChargeUsd" + - $ref: "#/components/parameters/restartOnError" + - $ref: "#/components/parameters/build" + - $ref: "#/components/parameters/waitForFinishRun" + - $ref: "#/components/parameters/webhooks" + requestBody: + content: + application/json: + example: + foo: bar + schema: + type: object + '*/*': + schema: {} + description: "" + required: true + responses: + "201": + content: + application/json: + schema: + $ref: "#/components/schemas/actorTask_runs_post_201_response" + description: "" + headers: + Location: + content: + text/plain: + example: https://api.apify.com/v2/actor-tasks/zdc3Pyhyz3m8vjDeM/runs/HG7ML7M8z78YcAPEB + schema: + type: string + explode: false + style: simple + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "413": + $ref: "#/components/responses/PayloadTooLarge" + "415": + $ref: "#/components/responses/UnsupportedMediaType" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Run task + tags: + - Actor tasks + x-legacy-doc-urls: + - https://docs.apify.com/api/v2#/reference/actor-tasks/run-collection/run-task + - https://docs.apify.com/api/v2#/reference/actor-tasks/run-task + - https://docs.apify.com/api/v2#tag/Actor-tasksRun-collection/operation/actorTask_runs_post + x-js-parent: TaskClient + x-js-name: start + x-js-doc-url: https://docs.apify.com/api/client/js/reference/class/TaskClient#start + x-py-parent: TaskClientAsync + x-py-name: call + x-py-doc-url: https://docs.apify.com/api/client/python/reference/class/TaskClientAsync#call + /v2/actor-tasks/{actorTaskId}/run-sync: + get: + deprecated: false + description: | + Run a specific task and return its output. + + The run must finish in 300 seconds + otherwise the HTTP request fails with a timeout error (this won't abort + the run itself). + + Beware that it might be impossible to maintain an idle HTTP connection for + an extended period, due to client timeout or network conditions. Make sure your HTTP client is + configured to have a long enough connection timeout. + + If the connection breaks, you will not receive any information about the run + and its status. + + To run the Task asynchronously, use the + [Run task asynchronously](#/reference/actor-tasks/run-collection/run-task) + endpoint instead. + operationId: actorTask_runSync_get + parameters: + - $ref: "#/components/parameters/actorTaskId" + - $ref: "#/components/parameters/timeout" + - $ref: "#/components/parameters/memory" + - $ref: "#/components/parameters/maxItems" + - $ref: "#/components/parameters/build" + - $ref: "#/components/parameters/outputRecordKey" + - $ref: "#/components/parameters/webhooks" + responses: + "201": + content: + application/json: + example: + bar: foo + schema: + type: object + description: "" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "408": + $ref: "#/components/responses/RunTimeout" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Run task synchronously + tags: + - Actor tasks + x-legacy-doc-urls: + - https://docs.apify.com/api/v2#/reference/actor-tasks/run-task-synchronously/run-task-synchronously-get + - https://docs.apify.com/api/v2#/reference/actor-tasks/run-task-synchronously-get + - https://docs.apify.com/api/v2#tag/Actor-tasksRun-task-synchronously/operation/actorTask_runSync_get + post: + deprecated: false + description: | + Runs an Actor task and synchronously returns its output. + + The run must finish in 300 seconds + otherwise the HTTP request fails with a timeout error (this won't abort + the run itself). + + Optionally, you can override the Actor input configuration by passing a JSON + object as the POST payload and setting the `Content-Type: application/json` HTTP header. + + Note that if the object in the POST payload does not define a particular + input property, the Actor run uses the default value defined by the task (or Actor's input + schema if not defined by the task). + + Beware that it might be impossible to maintain an idle HTTP connection for + an extended period, due to client timeout or network conditions. Make sure your HTTP client is + configured to have a long enough connection timeout. + + If the connection breaks, you will not receive any information about the run + and its status. + + Input fields from Actor task configuration can be overloaded with values + passed as the POST payload. + + Just make sure to specify `Content-Type` header to be `application/json` and + input to be an object. + + To run the task asynchronously, use the [Run + task](#/reference/actor-tasks/run-collection/run-task) API endpoint instead. + operationId: actorTask_runSync_post + parameters: + - $ref: "#/components/parameters/actorTaskId" + - $ref: "#/components/parameters/timeout" + - $ref: "#/components/parameters/memory" + - $ref: "#/components/parameters/maxItems" + - $ref: "#/components/parameters/maxTotalChargeUsd" + - $ref: "#/components/parameters/restartOnError" + - $ref: "#/components/parameters/build" + - $ref: "#/components/parameters/outputRecordKey" + - $ref: "#/components/parameters/webhooks" + requestBody: + content: + application/json: + example: + foo: bar + schema: + type: object + '*/*': + schema: {} + description: "" + required: true + responses: + "201": + content: + application/json: + example: + bar: foo + schema: + type: object + description: "" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "413": + $ref: "#/components/responses/PayloadTooLarge" + "415": + $ref: "#/components/responses/UnsupportedMediaType" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Run task synchronously + tags: + - Actor tasks + x-legacy-doc-urls: + - https://docs.apify.com/api/v2#/reference/actor-tasks/run-task-synchronously/run-task-synchronously-post + - https://docs.apify.com/api/v2#/reference/actor-tasks/run-task-synchronously-post + - https://docs.apify.com/api/v2#tag/Actor-tasksRun-task-synchronously/operation/actorTask_runSync_post + /v2/actor-tasks/{actorTaskId}/run-sync-get-dataset-items: + get: + deprecated: false + description: | + Run a specific task and return its dataset items. + + The run must finish in 300 seconds + otherwise the HTTP request fails with a timeout error (this won't abort + the run itself). + + You can send all the same options in parameters as the [Get Dataset + Items](#/reference/datasets/item-collection/get-items) API endpoint. + + Beware that it might be impossible to maintain an idle HTTP connection for + an extended period, due to client timeout or network conditions. Make sure your HTTP client is + configured to have a long enough connection timeout. + + If the connection breaks, you will not receive any information about the run + and its status. + + To run the Task asynchronously, use the [Run task + asynchronously](#/reference/actor-tasks/run-collection/run-task) endpoint + instead. + operationId: actorTask_runSyncGetDatasetItems_get + parameters: + - $ref: "#/components/parameters/actorTaskId" + - $ref: "#/components/parameters/timeout" + - $ref: "#/components/parameters/memory" + - $ref: "#/components/parameters/maxItems" + - $ref: "#/components/parameters/build" + - $ref: "#/components/parameters/webhooks" + - $ref: "#/components/parameters/format" + - $ref: "#/components/parameters/clean" + - $ref: "#/components/parameters/offset" + - $ref: "#/components/parameters/datasetParameters_limit" + - $ref: "#/components/parameters/fields" + - $ref: "#/components/parameters/outputFields" + - $ref: "#/components/parameters/omit" + - $ref: "#/components/parameters/unwind" + - $ref: "#/components/parameters/flatten" + - $ref: "#/components/parameters/descDataset" + - $ref: "#/components/parameters/attachment" + - $ref: "#/components/parameters/delimiter" + - $ref: "#/components/parameters/bom" + - $ref: "#/components/parameters/xmlRoot" + - $ref: "#/components/parameters/xmlRow" + - $ref: "#/components/parameters/skipHeaderRow" + - $ref: "#/components/parameters/skipHidden" + - $ref: "#/components/parameters/skipEmpty" + - $ref: "#/components/parameters/simplified" + - $ref: "#/components/parameters/view" + - $ref: "#/components/parameters/skipFailedPages" + - $ref: "#/components/parameters/feedTitle" + - $ref: "#/components/parameters/feedDescription" + responses: + "201": + content: + application/json: + schema: + type: object + description: "" + headers: + X-Apify-Pagination-Offset: + content: + text/plain: + example: "0" + schema: {} + description: The offset of the first item in the current page. + explode: false + style: simple + X-Apify-Pagination-Limit: + content: + text/plain: + example: "100" + schema: {} + description: The maximum number of items returned per page. + explode: false + style: simple + X-Apify-Pagination-Count: + content: + text/plain: + example: "100" + schema: {} + description: The number of items returned in the current page. + explode: false + style: simple + X-Apify-Pagination-Total: + content: + text/plain: + example: "10204" + schema: {} + description: The total number of items in the dataset. + explode: false + style: simple + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "408": + $ref: "#/components/responses/RunTimeout" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Run task synchronously and get dataset items + tags: + - Actor tasks + x-legacy-doc-urls: + - https://docs.apify.com/api/v2#/reference/actor-tasks/run-task-synchronously-and-get-dataset-items/run-task-synchronously-and-get-dataset-items-get + - https://docs.apify.com/api/v2#/reference/actor-tasks/run-task-synchronously-and-get-dataset-items-get + - https://docs.apify.com/api/v2#tag/Actor-tasksRun-task-synchronously-and-get-dataset-items/operation/actorTask_runSyncGetDatasetItems_get + post: + deprecated: false + description: | + Runs an Actor task and synchronously returns its dataset items. + + The run must finish in 300 seconds + otherwise the HTTP request fails with a timeout error (this won't abort + the run itself). + + Optionally, you can override the Actor input configuration by passing a JSON + object as the POST payload and setting the `Content-Type: application/json` HTTP header. + + Note that if the object in the POST payload does not define a particular + input property, the Actor run uses the default value defined by the task (or the Actor's + input schema if not defined by the task). + + You can send all the same options in parameters as the [Get Dataset + Items](#/reference/datasets/item-collection/get-items) API endpoint. + + Beware that it might be impossible to maintain an idle HTTP connection for + an extended period, due to client timeout or network conditions. Make sure your HTTP client is + configured to have a long enough connection timeout. + + If the connection breaks, you will not receive any information about the run + and its status. + + Input fields from Actor task configuration can be overloaded with values + passed as the POST payload. + + Just make sure to specify the `Content-Type` header as `application/json` + and that the input is an object. + + To run the task asynchronously, use the [Run + task](#/reference/actor-tasks/run-collection/run-task) API endpoint instead. + operationId: actorTask_runSyncGetDatasetItems_post + parameters: + - $ref: "#/components/parameters/actorTaskId" + - $ref: "#/components/parameters/timeout" + - $ref: "#/components/parameters/memory" + - $ref: "#/components/parameters/maxItems" + - $ref: "#/components/parameters/maxTotalChargeUsd" + - $ref: "#/components/parameters/restartOnError" + - $ref: "#/components/parameters/build" + - $ref: "#/components/parameters/webhooks" + - $ref: "#/components/parameters/format" + - $ref: "#/components/parameters/clean" + - $ref: "#/components/parameters/offset" + - $ref: "#/components/parameters/datasetParameters_limit" + - $ref: "#/components/parameters/fields" + - $ref: "#/components/parameters/outputFields" + - $ref: "#/components/parameters/omit" + - $ref: "#/components/parameters/unwind" + - $ref: "#/components/parameters/flatten" + - $ref: "#/components/parameters/descDataset" + - $ref: "#/components/parameters/attachment" + - $ref: "#/components/parameters/delimiter" + - $ref: "#/components/parameters/bom" + - $ref: "#/components/parameters/xmlRoot" + - $ref: "#/components/parameters/xmlRow" + - $ref: "#/components/parameters/skipHeaderRow" + - $ref: "#/components/parameters/skipHidden" + - $ref: "#/components/parameters/skipEmpty" + - $ref: "#/components/parameters/simplified" + - $ref: "#/components/parameters/view" + - $ref: "#/components/parameters/skipFailedPages" + - $ref: "#/components/parameters/feedTitle" + - $ref: "#/components/parameters/feedDescription" + requestBody: + content: + application/json: + example: + foo: bar + schema: + type: object + '*/*': + schema: {} + description: "" + required: true + responses: + "201": + content: + application/json: + schema: + type: object + description: "" + headers: + X-Apify-Pagination-Offset: + content: + text/plain: + example: "0" + schema: {} + description: The offset of the first item in the current page. + explode: false + style: simple + X-Apify-Pagination-Limit: + content: + text/plain: + example: "100" + schema: {} + description: The maximum number of items returned per page. + explode: false + style: simple + X-Apify-Pagination-Count: + content: + text/plain: + example: "100" + schema: {} + description: The number of items returned in the current page. + explode: false + style: simple + X-Apify-Pagination-Total: + content: + text/plain: + example: "10204" + schema: {} + description: The total number of items in the dataset. + explode: false + style: simple + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "413": + $ref: "#/components/responses/PayloadTooLarge" + "415": + $ref: "#/components/responses/UnsupportedMediaType" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Run task synchronously and get dataset items + tags: + - Actor tasks + x-legacy-doc-urls: + - https://docs.apify.com/api/v2#/reference/actor-tasks/run-task-synchronously-and-get-dataset-items/run-task-synchronously-and-get-dataset-items-post + - https://docs.apify.com/api/v2#/reference/actor-tasks/run-task-synchronously-and-get-dataset-items-post + - https://docs.apify.com/api/v2#tag/Actor-tasksRun-task-synchronously-and-get-dataset-items/operation/actorTask_runSyncGetDatasetItems_post + /v2/actor-tasks/{actorTaskId}/runs/last: + get: + deprecated: false + description: | + This is not a single endpoint, but an entire group of endpoints that lets you to + retrieve and manage the last run of given actor task or any of its default storages. + All the endpoints require an authentication token. + + The base path represents the last actor task run object is: + + `/v2/actor-tasks/{actorTaskId}/runs/last{?token,status}` + + Using the `status` query parameter you can ensure to only get a run with a certain status + (e.g. `status=SUCCEEDED`). The output of this endpoint and other query parameters + are the same as in the [Run object](/api/v2/actor-run-get) endpoint. + + ##### Convenience endpoints for last Actor task run + + * [Dataset](/api/v2/last-actor-task-runs-default-dataset) + + * [Key-value store](/api/v2/last-actor-task-runs-default-key-value-store) + + * [Request queue](/api/v2/last-actor-task-runs-default-request-queue) + + * [Log](/api/v2/last-actor-task-runs-log) + operationId: actorTask_runs_last_get + parameters: + - $ref: "#/components/parameters/actorTaskId" + - $ref: "#/components/parameters/statusLastRun" + - $ref: "#/components/parameters/waitForFinishRun" + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/actorTask_runs_post_201_response" + description: "" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Get last run + tags: + - Actor tasks + x-legacy-doc-urls: + - https://docs.apify.com/api/v2#/reference/actor-tasks/last-run-object-and-its-storages + /v2/actor-tasks/{actorTaskId}/runs/last/log: + get: + deprecated: false + description: | + Retrieves last Actor task run's logs. + + This endpoint is a shortcut for getting last Actor task run's log. Same as [Get log](/api/v2/log-get) endpoint. + operationId: actorTask_last_log_get + parameters: + - $ref: "#/components/parameters/actorTaskId" + - $ref: "#/components/parameters/stream" + - $ref: "#/components/parameters/download" + - $ref: "#/components/parameters/raw" + responses: + "200": + content: + text/plain: + schema: + example: | + 2017-07-14T06:00:49.733Z Application started. + 2017-07-14T06:00:49.741Z Input: { test: 123 } + 2017-07-14T06:00:49.752Z Some useful debug information follows. + type: string + description: "" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Get last Actor task run's log + tags: + - Last Actor task run's log + /v2/actor-tasks/{actorTaskId}/runs/last/abort: + post: + deprecated: false + description: | + Aborts the last run of the specified Actor task and returns an object that + contains all the details about the run. + + This endpoint is a shortcut for [Abort run](#/reference/actor-runs/abort-run/abort-run) + on the Actor task's last run. Only runs that are starting or running are aborted. + For runs with status `FINISHED`, `FAILED`, `ABORTING` and `TIMED-OUT` this call + does nothing. + operationId: actorTask_runs_last_abort_post + parameters: + - $ref: "#/components/parameters/actorTaskId" + - $ref: "#/components/parameters/statusLastRun" + - $ref: "#/components/parameters/gracefully" + responses: + "200": + content: + application/json: + example: + data: + id: HG7ML7M8z78YcAPEB + actId: janedoe~my-actor + userId: BPWZBd7Z9c746JAng + actorTaskId: rANaydYhUxjsnA3oz + startedAt: 2019-11-30T07:34:24.202Z + finishedAt: 2019-12-12T09:30:12.202Z + status: ABORTED + statusMessage: Actor was aborted + isStatusMessageTerminal: true + meta: + origin: WEB + clientIp: 172.234.12.34 + userAgent: Mozilla/5.0 (iPad) + stats: + inputBodyLen: 240 + migrationCount: 0 + restartCount: 0 + resurrectCount: 1 + memAvgBytes: 3.59142284E7 + memMaxBytes: 38244352 + memCurrentBytes: 0 + cpuAvgUsage: 0.00955965 + cpuMaxUsage: 3.1546 + cpuCurrentUsage: 0 + netRxBytes: 2652 + netTxBytes: 1338 + durationMillis: 26239 + runTimeSecs: 26.239 + metamorph: 0 + computeUnits: 0.0072886 + options: + build: latest + timeoutSecs: 300 + memoryMbytes: 1024 + diskMbytes: 2048 + buildId: 7sT5jcggjjA9fNcxF + exitCode: 0 + generalAccess: RESTRICTED + defaultKeyValueStoreId: eJNzqsbPiopwJcgGQ + defaultDatasetId: wmKPijuyDnPZAPRMk + defaultRequestQueueId: FL35cSF7jrxr3BY39 + storageIds: + datasets: + default: wmKPijuyDnPZAPRMk + keyValueStores: + default: eJNzqsbPiopwJcgGQ + requestQueues: + default: FL35cSF7jrxr3BY39 + isContainerServerReady: false + gitBranchName: master + usage: + ACTOR_COMPUTE_UNITS: 3 + DATASET_READS: 4 + DATASET_WRITES: 4 + KEY_VALUE_STORE_READS: 5 + KEY_VALUE_STORE_WRITES: 3 + KEY_VALUE_STORE_LISTS: 5 + REQUEST_QUEUE_READS: 2 + REQUEST_QUEUE_WRITES: 1 + DATA_TRANSFER_INTERNAL_GBYTES: 1 + DATA_TRANSFER_EXTERNAL_GBYTES: 3 + PROXY_RESIDENTIAL_TRANSFER_GBYTES: 34 + PROXY_SERPS: 3 + usageTotalUsd: 0.2654 + usageUsd: + ACTOR_COMPUTE_UNITS: 0.072 + DATASET_READS: 4.0E-4 + DATASET_WRITES: 2.0E-4 + KEY_VALUE_STORE_READS: 6.0E-4 + KEY_VALUE_STORE_WRITES: 0.002 + KEY_VALUE_STORE_LISTS: 0.004 + REQUEST_QUEUE_READS: 0.005 + REQUEST_QUEUE_WRITES: 0.02 + DATA_TRANSFER_INTERNAL_GBYTES: 4.0E-4 + DATA_TRANSFER_EXTERNAL_GBYTES: 2.0E-4 + PROXY_RESIDENTIAL_TRANSFER_GBYTES: 0.16 + PROXY_SERPS: 6.0E-4 + schema: + $ref: "#/components/schemas/RunResponse" + description: "" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Abort Actor task's last run + tags: + - Last Actor task run's abort + /v2/actor-tasks/{actorTaskId}/runs/last/metamorph: + post: + deprecated: false + description: | + Transforms the last run of the specified Actor task into a run of another Actor with + a new input. + + This endpoint is a shortcut for [Metamorph run](#/reference/actor-runs/metamorph-run/metamorph-run) + on the Actor task's last run. + operationId: actorTask_runs_last_metamorph_post + parameters: + - $ref: "#/components/parameters/actorTaskId" + - $ref: "#/components/parameters/statusLastRun" + - $ref: "#/components/parameters/targetActorId" + - description: | + Optional build of the target Actor. + + It can be either a build tag or build number. By default, the run uses + the build specified in the default run configuration for the target + Actor (typically `latest`). + explode: true + in: query + name: build + required: false + schema: + example: beta + type: string + style: form + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/RunResponse" + description: "" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Metamorph Actor task's last run + tags: + - Last Actor task run's metamorph + /v2/actor-tasks/{actorTaskId}/runs/last/reboot: + post: + deprecated: false + description: | + Reboots the last run of the specified Actor task and returns an object that + contains all the details about the rebooted run. + + This endpoint is a shortcut for [Reboot run](#/reference/actor-runs/reboot-run/reboot-run) + on the Actor task's last run. Only runs with status `RUNNING` can be rebooted. The run's + container will be restarted, so any data not persisted in the key-value store, dataset, + or request queue will be lost. + operationId: actorTask_runs_last_reboot_post + parameters: + - $ref: "#/components/parameters/actorTaskId" + - $ref: "#/components/parameters/statusLastRun" + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/RunResponse" + description: "" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Reboot Actor task's last run + tags: + - Last Actor task run's reboot + /v2/actor-tasks/{actorTaskId}/runs/last/dataset: + delete: + deprecated: false + description: | + Deletes the default dataset associated with the last Actor task run. + + This endpoint is a shortcut for getting the last task run's `defaultDatasetId` and then using the + [Delete dataset](/api/v2/dataset-delete) endpoint. + operationId: actorTask_runs_last_dataset_delete + parameters: + - $ref: "#/components/parameters/actorTaskId" + - $ref: "#/components/parameters/statusLastRun" + responses: + "204": + $ref: "#/components/responses/NoContent" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Delete last task run's default dataset + tags: + - Last Actor task run's default dataset + get: + deprecated: false + description: | + Returns the default dataset associated with the last Actor task run. + + This endpoint is a shortcut for getting the last task run's `defaultDatasetId` and then using the + [Get dataset](/api/v2/dataset-get) endpoint. + operationId: actorTask_runs_last_dataset_get + parameters: + - $ref: "#/components/parameters/actorTaskId" + - $ref: "#/components/parameters/statusLastRun" + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/DatasetResponse" + description: "" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Get last task run's default dataset + tags: + - Last Actor task run's default dataset + put: + deprecated: false + description: | + Updates the default dataset associated with the last Actor task run. + + This endpoint is a shortcut for getting the last task run's `defaultDatasetId` and then using the + [Update dataset](/api/v2/dataset-put) endpoint. + operationId: actorTask_runs_last_dataset_put + parameters: + - $ref: "#/components/parameters/actorTaskId" + - $ref: "#/components/parameters/statusLastRun" + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/UpdateDatasetRequest" + description: "" + required: true + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/DatasetResponse" + description: "" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "413": + $ref: "#/components/responses/PayloadTooLarge" + "415": + $ref: "#/components/responses/UnsupportedMediaType" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Update last task run's default dataset + tags: + - Last Actor task run's default dataset + /v2/actor-tasks/{actorTaskId}/runs/last/dataset/items: + get: + deprecated: false + description: | + Returns data stored in the default dataset of the last Actor task run in the desired format. + + This endpoint is a shortcut that resolves the last task run's `defaultDatasetId` and proxies to the + [Get dataset items](/api/v2/dataset-items-get) endpoint. + operationId: actorTask_runs_last_dataset_items_get + parameters: + - $ref: "#/components/parameters/actorTaskId" + - $ref: "#/components/parameters/statusLastRun" + - $ref: "#/components/parameters/format" + - $ref: "#/components/parameters/clean" + - $ref: "#/components/parameters/offset" + - $ref: "#/components/parameters/datasetParameters_limit" + - $ref: "#/components/parameters/fields" + - $ref: "#/components/parameters/outputFields" + - $ref: "#/components/parameters/omit" + - $ref: "#/components/parameters/unwind" + - $ref: "#/components/parameters/flatten" + - $ref: "#/components/parameters/descDataset" + - $ref: "#/components/parameters/attachment" + - $ref: "#/components/parameters/delimiter" + - $ref: "#/components/parameters/bom" + - $ref: "#/components/parameters/xmlRoot" + - $ref: "#/components/parameters/xmlRow" + - $ref: "#/components/parameters/skipHeaderRow" + - $ref: "#/components/parameters/skipHidden" + - $ref: "#/components/parameters/skipEmpty" + - $ref: "#/components/parameters/simplified" + - $ref: "#/components/parameters/view" + - $ref: "#/components/parameters/skipFailedPages" + - $ref: "#/components/parameters/feedTitle" + - $ref: "#/components/parameters/feedDescription" + - $ref: "#/components/parameters/signature" + responses: + "200": + content: + application/json: + schema: + example: + - foo: bar + - foo2: bar2 + items: + type: object + type: array + default: null + application/jsonl: + example: "{\"foo\":\"bar\"}\\n{\"foo2\":\"bar2\"}\\n" + schema: + type: string + text/csv: + example: "foo,bar\\nfoo2,bar2\\n" + schema: + type: string + text/html: + example:
foobar
foobar
foo2bar2
+ schema: + type: string + application/vnd.openxmlformats-officedocument.spreadsheetml.sheet: + schema: + type: string + application/rss+xml: + example: barbar2 + schema: + type: string + application/xml: + example: barbar2 + schema: + type: string + description: "" + headers: + X-Apify-Pagination-Offset: + content: + text/plain: + example: "0" + schema: {} + description: The offset of the first item in the current page. + explode: false + style: simple + X-Apify-Pagination-Limit: + content: + text/plain: + example: "100" + schema: {} + description: The maximum number of items returned per page. + explode: false + style: simple + X-Apify-Pagination-Count: + content: + text/plain: + example: "100" + schema: {} + description: The number of items returned in the current page. + explode: false + style: simple + X-Apify-Pagination-Total: + content: + text/plain: + example: "10204" + schema: {} + description: The total number of items in the dataset. + explode: false + style: simple + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Get last task run's dataset items + tags: + - Last Actor task run's default dataset + post: + deprecated: false + description: | + Appends an item or an array of items to the end of the last Actor task run's default dataset. + + This endpoint is a shortcut that resolves the last task run's `defaultDatasetId` and proxies to the + [Store items](/api/v2/dataset-items-post) endpoint. + operationId: actorTask_runs_last_dataset_items_post + parameters: + - $ref: "#/components/parameters/actorTaskId" + - $ref: "#/components/parameters/statusLastRun" + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/act_runs_last_dataset_items_post_request" + description: "" + required: true + responses: + "201": + content: + application/json: + schema: + example: {} + type: object + description: "" + headers: + Location: + content: + text/plain: + example: https://api.apify.com/v2/datasets/WkzbQMuFYuamGv3YF/items + schema: + type: string + explode: false + style: simple + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/act_runs_last_dataset_items_post_400_response" + description: "" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Store items in last task run's dataset + tags: + - Last Actor task run's default dataset + /v2/actor-tasks/{actorTaskId}/runs/last/dataset/statistics: + get: + description: | + Returns statistics for the last Actor task run's default dataset. + + This endpoint is a shortcut that resolves the last task run's `defaultDatasetId` and proxies to the + [Get dataset statistics](/api/v2/dataset-statistics-get) endpoint. + operationId: actorTask_runs_last_dataset_statistics_get + parameters: + - $ref: "#/components/parameters/actorTaskId" + - $ref: "#/components/parameters/statusLastRun" + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/DatasetStatisticsResponse" + description: "" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Get last task run's dataset statistics + tags: + - Last Actor task run's default dataset + /v2/actor-tasks/{actorTaskId}/runs/last/key-value-store: + delete: + deprecated: false + description: | + Deletes the default key-value store of the last Actor task run. + + This endpoint is a shortcut for getting the last task run's `defaultKeyValueStoreId` and then using the + [Delete store](/api/v2/key-value-store-delete) endpoint. + operationId: actorTask_runs_last_keyValueStore_delete + parameters: + - $ref: "#/components/parameters/actorTaskId" + - $ref: "#/components/parameters/statusLastRun" + responses: + "204": + $ref: "#/components/responses/NoContent" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Delete last task run's default store + tags: + - Last Actor task run's default key-value store + get: + deprecated: false + description: | + Gets an object that contains all the details about the default key-value store of the last Actor task run. + + This endpoint is a shortcut for getting the last task run's `defaultKeyValueStoreId` and then using the + [Get store](/api/v2/key-value-store-get) endpoint. + operationId: actorTask_runs_last_keyValueStore_get + parameters: + - $ref: "#/components/parameters/actorTaskId" + - $ref: "#/components/parameters/statusLastRun" + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/KeyValueStoreResponse" + description: "" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Get last task run's default store + tags: + - Last Actor task run's default key-value store + put: + deprecated: false + description: | + Updates the default key-value store associated with the last Actor task run. + + This endpoint is a shortcut for getting the last task run's `defaultKeyValueStoreId` and then using the + [Update store](/api/v2/key-value-store-put) endpoint. + operationId: actorTask_runs_last_keyValueStore_put + parameters: + - $ref: "#/components/parameters/actorTaskId" + - $ref: "#/components/parameters/statusLastRun" + requestBody: + content: + application/json: + example: + name: new-store-name + schema: + $ref: "#/components/schemas/UpdateStoreRequest" + description: "" + required: true + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/KeyValueStoreResponse" + description: "" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "413": + $ref: "#/components/responses/PayloadTooLarge" + "415": + $ref: "#/components/responses/UnsupportedMediaType" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Update last task run's default store + tags: + - Last Actor task run's default key-value store + /v2/actor-tasks/{actorTaskId}/runs/last/key-value-store/keys: + get: + deprecated: false + description: | + Returns a list of keys for the default key-value store of the last Actor task run. + + This endpoint is a shortcut for getting the last task run's `defaultKeyValueStoreId` and then using the + [Get list of keys](/api/v2/key-value-store-keys-get) endpoint. + operationId: actorTask_runs_last_keyValueStore_keys_get + parameters: + - $ref: "#/components/parameters/actorTaskId" + - $ref: "#/components/parameters/statusLastRun" + - $ref: "#/components/parameters/exclusiveStartKey" + - $ref: "#/components/parameters/keyValueStoreParameters_limit" + - $ref: "#/components/parameters/collectionKeys" + - $ref: "#/components/parameters/prefixKeys" + - $ref: "#/components/parameters/signature" + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/ListOfKeysResponse" + description: "" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Get last task run's default store's list of keys + tags: + - Last Actor task run's default key-value store + /v2/actor-tasks/{actorTaskId}/runs/last/key-value-store/records: + get: + deprecated: false + description: | + Downloads all records from the default key-value store of the last Actor task run as a ZIP archive. + + This endpoint is a shortcut for getting the last task run's `defaultKeyValueStoreId` and then using the + [Download records](/api/v2/key-value-store-records-get) endpoint. + operationId: actorTask_runs_last_keyValueStore_records_get + parameters: + - $ref: "#/components/parameters/actorTaskId" + - $ref: "#/components/parameters/statusLastRun" + - $ref: "#/components/parameters/collectionRecords" + - $ref: "#/components/parameters/prefixRecords" + - $ref: "#/components/parameters/signature" + responses: + "200": + content: + application/zip: + schema: + format: binary + type: string + description: A ZIP archive containing the requested records. + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Download last task run's default store's records + tags: + - Last Actor task run's default key-value store + /v2/actor-tasks/{actorTaskId}/runs/last/key-value-store/records/{recordKey}: + delete: + deprecated: false + description: | + Removes a record specified by a key from the default key-value store of the last Actor task run. + + This endpoint is a shortcut for getting the last task run's `defaultKeyValueStoreId` and then using the + [Delete record](/api/v2/key-value-store-record-delete) endpoint. + operationId: actorTask_runs_last_keyValueStore_record_delete + parameters: + - $ref: "#/components/parameters/actorTaskId" + - $ref: "#/components/parameters/statusLastRun" + - $ref: "#/components/parameters/recordKey" + responses: + "204": + $ref: "#/components/responses/NoContent" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Delete last task run's default store's record + tags: + - Last Actor task run's default key-value store + get: + deprecated: false + description: | + Gets a value stored under a specific key in the default key-value store of the last Actor task run. + + This endpoint is a shortcut for getting the last task run's `defaultKeyValueStoreId` and then using the + [Get record](/api/v2/key-value-store-record-get) endpoint. + operationId: actorTask_runs_last_keyValueStore_record_get + parameters: + - $ref: "#/components/parameters/actorTaskId" + - $ref: "#/components/parameters/statusLastRun" + - $ref: "#/components/parameters/recordKey" + - $ref: "#/components/parameters/signature" + - $ref: "#/components/parameters/keyValueStoreParameters_attachment" + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/RecordResponse" + '*/*': + schema: {} + description: "" + "302": + content: {} + description: "" + headers: + Location: + content: + text/plain: + example: https://apifier-key-value-store-prod.s3.amazonaws.com/tqx6jeMia43gYY6eE/INPUT?AWSAccessKeyId=NKDOUN&Expires=1502720992&Signature=DKLVPI4lDDKC + schema: + type: string + explode: false + style: simple + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Get last task run's default store's record + tags: + - Last Actor task run's default key-value store + post: + deprecated: false + description: | + Stores a value under a specific key in the default key-value store of the last Actor task run. + + This endpoint is a shortcut for getting the last task run's `defaultKeyValueStoreId` and then using the + [Store record](/api/v2/key-value-store-record-post) endpoint. + operationId: actorTask_runs_last_keyValueStore_record_post + parameters: + - $ref: "#/components/parameters/actorTaskId" + - $ref: "#/components/parameters/statusLastRun" + - $ref: "#/components/parameters/recordKey" + - $ref: "#/components/parameters/Content-Encoding" + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/PutRecordRequest" + '*/*': + schema: {} + description: "" + required: true + responses: + "201": + content: + application/json: + example: {} + schema: + type: object + description: "" + headers: + Location: + content: + text/plain: + example: https://api.apify.com/v2/key-value-stores/WkzbQMuFYuamGv3YF/records/some-key + schema: + type: string + explode: false + style: simple + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "413": + $ref: "#/components/responses/PayloadTooLarge" + "415": + $ref: "#/components/responses/UnsupportedMediaType" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Store record in last task run's default store (POST) + tags: + - Last Actor task run's default key-value store + put: + deprecated: false + description: | + Stores a value under a specific key in the default key-value store of the last Actor task run. + + This endpoint is a shortcut for getting the last task run's `defaultKeyValueStoreId` and then using the + [Store record](/api/v2/key-value-store-record-put) endpoint. + operationId: actorTask_runs_last_keyValueStore_record_put + parameters: + - $ref: "#/components/parameters/actorTaskId" + - $ref: "#/components/parameters/statusLastRun" + - $ref: "#/components/parameters/recordKey" + - $ref: "#/components/parameters/Content-Encoding" + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/PutRecordRequest" + '*/*': + schema: {} + description: "" + required: true + responses: + "201": + content: + application/json: + example: {} + schema: + type: object + description: "" + headers: + Location: + content: + text/plain: + example: https://api.apify.com/v2/key-value-stores/WkzbQMuFYuamGv3YF/records/some-key + schema: + type: string + explode: false + style: simple + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "413": + $ref: "#/components/responses/PayloadTooLarge" + "415": + $ref: "#/components/responses/UnsupportedMediaType" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Store record in last task run's default store + tags: + - Last Actor task run's default key-value store + /v2/actor-tasks/{actorTaskId}/runs/last/request-queue: + delete: + deprecated: false + description: | + Deletes the default request queue associated with the last Actor task run. + + This endpoint is a shortcut for getting the last task run's `defaultRequestQueueId` and then using the + [Delete request queue](/api/v2/request-queue-delete) endpoint. + operationId: actorTask_runs_last_requestQueue_delete + parameters: + - $ref: "#/components/parameters/actorTaskId" + - $ref: "#/components/parameters/statusLastRun" + responses: + "204": + $ref: "#/components/responses/NoContent" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Delete last task run's default request queue + tags: + - Last Actor task run's default request queue + get: + deprecated: false + description: | + Returns the default request queue associated with the last Actor task run. + + This endpoint is a shortcut for getting the last task run's `defaultRequestQueueId` and then using the + [Get request queue](/api/v2/request-queue-get) endpoint. + operationId: actorTask_runs_last_requestQueue_get + parameters: + - $ref: "#/components/parameters/actorTaskId" + - $ref: "#/components/parameters/statusLastRun" + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/RequestQueueResponse" + description: "" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Get last task run's default request queue + tags: + - Last Actor task run's default request queue + put: + deprecated: false + description: | + Updates the default request queue associated with the last Actor task run. + + This endpoint is a shortcut for getting the last task run's `defaultRequestQueueId` and then using the + [Update request queue](/api/v2/request-queue-put) endpoint. + operationId: actorTask_runs_last_requestQueue_put + parameters: + - $ref: "#/components/parameters/actorTaskId" + - $ref: "#/components/parameters/statusLastRun" + requestBody: + content: + application/json: + example: + name: new-request-queue-name + schema: + allOf: + - $ref: "#/components/schemas/UpdateRequestQueueRequest" + example: + name: new-request-queue-name + description: "" + required: true + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/RequestQueueResponse" + description: "" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "413": + $ref: "#/components/responses/PayloadTooLarge" + "415": + $ref: "#/components/responses/UnsupportedMediaType" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Update last task run's default request queue + tags: + - Last Actor task run's default request queue + /v2/actor-tasks/{actorTaskId}/runs/last/request-queue/head: + get: + deprecated: false + description: | + Returns the given number of first requests from the default request queue of the last Actor task run. + + This endpoint is a shortcut for getting the last task run's `defaultRequestQueueId` and then using the + [Get head](/api/v2/request-queue-head-get) endpoint. + operationId: actorTask_runs_last_requestQueue_head_get + parameters: + - $ref: "#/components/parameters/actorTaskId" + - $ref: "#/components/parameters/statusLastRun" + - $ref: "#/components/parameters/headLimit" + - $ref: "#/components/parameters/clientKey" + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/HeadResponse" + description: "" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Get last task run's default request queue head + tags: + - Last Actor task run's default request queue + /v2/actor-tasks/{actorTaskId}/runs/last/request-queue/head/lock: + post: + deprecated: false + description: | + Returns the given number of first requests from the default request queue of the last Actor task run + and locks them for the given time. + + This endpoint is a shortcut for getting the last task run's `defaultRequestQueueId` and then using the + [Get head and lock](/api/v2/request-queue-head-lock-post) endpoint. + operationId: actorTask_runs_last_requestQueue_head_lock_post + parameters: + - $ref: "#/components/parameters/actorTaskId" + - $ref: "#/components/parameters/statusLastRun" + - $ref: "#/components/parameters/lockSecs" + - $ref: "#/components/parameters/headLockLimit" + - $ref: "#/components/parameters/clientKey" + responses: + "201": + content: + application/json: + schema: + $ref: "#/components/schemas/HeadAndLockResponse" + description: "" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Get and lock last task run's default request queue head + tags: + - Last Actor task run's default request queue + /v2/actor-tasks/{actorTaskId}/runs/last/request-queue/requests: + get: + deprecated: false + description: | + Returns a list of requests from the default request queue of the last Actor task run. + + This endpoint is a shortcut for getting the last task run's `defaultRequestQueueId` and then using the + [List requests](/api/v2/request-queue-requests-get) endpoint. + operationId: actorTask_runs_last_requestQueue_requests_get + parameters: + - $ref: "#/components/parameters/actorTaskId" + - $ref: "#/components/parameters/statusLastRun" + - $ref: "#/components/parameters/clientKey" + - $ref: "#/components/parameters/exclusiveStartId" + - $ref: "#/components/parameters/listLimit" + - $ref: "#/components/parameters/cursor" + - $ref: "#/components/parameters/filter" + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/ListOfRequestsResponse" + description: "" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: List last task run's default request queue's requests + tags: + - Last Actor task run's default request queue + post: + deprecated: false + description: | + Adds a request to the default request queue of the last Actor task run. + + This endpoint is a shortcut for getting the last task run's `defaultRequestQueueId` and then using the + [Add request](/api/v2/request-queue-requests-post) endpoint. + operationId: actorTask_runs_last_requestQueue_requests_post + parameters: + - $ref: "#/components/parameters/actorTaskId" + - $ref: "#/components/parameters/statusLastRun" + - $ref: "#/components/parameters/clientKey" + - $ref: "#/components/parameters/forefront" + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/RequestBase" + description: "" + required: true + responses: + "201": + content: + application/json: + schema: + $ref: "#/components/schemas/AddRequestResponse" + description: "" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "413": + $ref: "#/components/responses/PayloadTooLarge" + "415": + $ref: "#/components/responses/UnsupportedMediaType" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Add request to last task run's default request queue + tags: + - Last Actor task run's default request queue + /v2/actor-tasks/{actorTaskId}/runs/last/request-queue/requests/batch: + delete: + deprecated: false + description: | + Batch-deletes requests from the default request queue of the last Actor task run. + + This endpoint is a shortcut for getting the last task run's `defaultRequestQueueId` and then using the + [Delete requests](/api/v2/request-queue-requests-batch-delete) endpoint. + operationId: actorTask_runs_last_requestQueue_requests_batch_delete + parameters: + - $ref: "#/components/parameters/actorTaskId" + - $ref: "#/components/parameters/statusLastRun" + - $ref: "#/components/parameters/contentTypeJson" + - $ref: "#/components/parameters/clientKey" + requestBody: + content: + application/json: + schema: + items: + $ref: "#/components/schemas/RequestDraftDelete" + type: array + default: null + description: "" + required: true + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/BatchDeleteResponse" + description: "" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "413": + $ref: "#/components/responses/PayloadTooLarge" + "415": + $ref: "#/components/responses/UnsupportedMediaType" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Batch delete requests from last task run's default request queue + tags: + - Last Actor task run's default request queue + post: + deprecated: false + description: | + Adds requests to the default request queue of the last Actor task run in batch. + + This endpoint is a shortcut for getting the last task run's `defaultRequestQueueId` and then using the + [Add requests](/api/v2/request-queue-requests-batch-post) endpoint. + operationId: actorTask_runs_last_requestQueue_requests_batch_post + parameters: + - $ref: "#/components/parameters/actorTaskId" + - $ref: "#/components/parameters/statusLastRun" + - $ref: "#/components/parameters/clientKey" + - $ref: "#/components/parameters/forefront" + requestBody: + content: + application/json: + schema: + description: "" + items: + $ref: "#/components/schemas/RequestBase" + type: array + default: null + description: "" + required: true + responses: + "201": + content: + application/json: + schema: + $ref: "#/components/schemas/BatchAddResponse" + description: "" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "413": + $ref: "#/components/responses/PayloadTooLarge" + "415": + $ref: "#/components/responses/UnsupportedMediaType" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Batch add requests to last task run's default request queue + tags: + - Last Actor task run's default request queue + /v2/actor-tasks/{actorTaskId}/runs/last/request-queue/requests/unlock: + post: + deprecated: false + description: | + Unlocks requests in the default request queue of the last Actor task run that are currently locked by the client. + + This endpoint is a shortcut for getting the last task run's `defaultRequestQueueId` and then using the + [Unlock requests](/api/v2/request-queue-requests-unlock-post) endpoint. + operationId: actorTask_runs_last_requestQueue_requests_unlock_post + parameters: + - $ref: "#/components/parameters/actorTaskId" + - $ref: "#/components/parameters/statusLastRun" + - $ref: "#/components/parameters/clientKey" + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/UnlockRequestsResponse" + description: Number of requests that were unlocked + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Unlock requests in last task run's default request queue + tags: + - Last Actor task run's default request queue + /v2/actor-tasks/{actorTaskId}/runs/last/request-queue/requests/{requestId}: + delete: + deprecated: false + description: | + Deletes a request from the default request queue of the last Actor task run. + + This endpoint is a shortcut for getting the last task run's `defaultRequestQueueId` and then using the + [Delete request](/api/v2/request-queue-request-delete) endpoint. + operationId: actorTask_runs_last_requestQueue_request_delete + parameters: + - $ref: "#/components/parameters/actorTaskId" + - $ref: "#/components/parameters/statusLastRun" + - $ref: "#/components/parameters/requestId" + - $ref: "#/components/parameters/clientKey" + responses: + "204": + $ref: "#/components/responses/NoContent" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Delete request from last task run's default request queue + tags: + - Last Actor task run's default request queue + get: + deprecated: false + description: | + Returns a request from the default request queue of the last Actor task run. + + This endpoint is a shortcut for getting the last task run's `defaultRequestQueueId` and then using the + [Get request](/api/v2/request-queue-request-get) endpoint. + operationId: actorTask_runs_last_requestQueue_request_get + parameters: + - $ref: "#/components/parameters/actorTaskId" + - $ref: "#/components/parameters/statusLastRun" + - $ref: "#/components/parameters/requestId" + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/RequestResponse" + description: "" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Get request from last task run's default request queue + tags: + - Last Actor task run's default request queue + put: + deprecated: false + description: | + Updates a request in the default request queue of the last Actor task run. + + This endpoint is a shortcut for getting the last task run's `defaultRequestQueueId` and then using the + [Update request](/api/v2/request-queue-request-put) endpoint. + operationId: actorTask_runs_last_requestQueue_request_put + parameters: + - $ref: "#/components/parameters/actorTaskId" + - $ref: "#/components/parameters/statusLastRun" + - $ref: "#/components/parameters/requestId" + - $ref: "#/components/parameters/forefront" + - $ref: "#/components/parameters/clientKey" + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/Request" + description: "" + required: true + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/UpdateRequestResponse" + description: "" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "413": + $ref: "#/components/responses/PayloadTooLarge" + "415": + $ref: "#/components/responses/UnsupportedMediaType" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Update request in last task run's default request queue + tags: + - Last Actor task run's default request queue + /v2/actor-tasks/{actorTaskId}/runs/last/request-queue/requests/{requestId}/lock: + delete: + deprecated: false + description: | + Deletes a request lock in the default request queue of the last Actor task run. + + This endpoint is a shortcut for getting the last task run's `defaultRequestQueueId` and then using the + [Delete request lock](/api/v2/request-queue-request-lock-delete) endpoint. + operationId: actorTask_runs_last_requestQueue_request_lock_delete + parameters: + - $ref: "#/components/parameters/actorTaskId" + - $ref: "#/components/parameters/statusLastRun" + - $ref: "#/components/parameters/requestId" + - $ref: "#/components/parameters/clientKey" + - $ref: "#/components/parameters/deleteForefront" + responses: + "204": + $ref: "#/components/responses/NoContent" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Delete lock on request in last task run's default request queue + tags: + - Last Actor task run's default request queue + put: + deprecated: false + description: | + Prolongs a request lock in the default request queue of the last Actor task run. + + This endpoint is a shortcut for getting the last task run's `defaultRequestQueueId` and then using the + [Prolong request lock](/api/v2/request-queue-request-lock-put) endpoint. + operationId: actorTask_runs_last_requestQueue_request_lock_put + parameters: + - $ref: "#/components/parameters/actorTaskId" + - $ref: "#/components/parameters/statusLastRun" + - $ref: "#/components/parameters/requestId" + - $ref: "#/components/parameters/lockSecs" + - $ref: "#/components/parameters/clientKey" + - $ref: "#/components/parameters/lockForefront" + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/ProlongRequestLockResponse" + description: "" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Prolong lock on request in last task run's default request queue + tags: + - Last Actor task run's default request queue + /v2/actor-runs: + get: + deprecated: false + description: | + Gets a list of all runs for a user. The response is a list of objects, where + each object contains basic information about a single Actor run. + + The endpoint supports pagination using the `limit` and `offset` parameters + and it will not return more than 1000 array elements. + + By default, the records are sorted by the `startedAt` field in ascending + order. Therefore, you can use pagination to incrementally fetch all records while + new ones are still being created. To sort the records in descending order, use + `desc=1` parameter. You can also filter runs by `startedAt`` and `status`` fields ([available + statuses](https://docs.apify.com/platform/actors/running/runs-and-builds#lifecycle)). + operationId: actorRuns_get + parameters: + - $ref: "#/components/parameters/offset" + - $ref: "#/components/parameters/limit" + - $ref: "#/components/parameters/descStartedAt" + - $ref: "#/components/parameters/status" + - $ref: "#/components/parameters/startedAfter" + - $ref: "#/components/parameters/startedBefore" + responses: + "200": + content: + application/json: + examples: + example: + $ref: "#/components/examples/ListOfRunsResponseExample" + schema: + allOf: + - $ref: "#/components/schemas/ListOfRunsResponse" + description: "" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Get user runs list + tags: + - Actor runs + x-legacy-doc-urls: + - https://docs.apify.com/api/v2#/reference/actor-runs/run-collection/get-user-runs-list + - https://docs.apify.com/api/v2#/reference/actor-runs/get-user-runs-list + - https://docs.apify.com/api/v2#tag/Actor-runsRun-collection/operation/actorRuns_get + /v2/actor-runs/{runId}: + delete: + deprecated: false + description: | + Delete the run. Only finished runs can be deleted. Only the person or + organization that initiated the run can delete it. + operationId: actorRun_delete + parameters: + - $ref: "#/components/parameters/runId" + responses: + "204": + $ref: "#/components/responses/NoContent" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Delete run + tags: + - Actor runs + x-legacy-doc-urls: + - https://docs.apify.com/api/v2#/reference/actor-runs/delete-run/delete-run + - https://docs.apify.com/api/v2#/reference/actor-runs/delete-run + - https://docs.apify.com/api/v2#tag/Actor-runsDelete-run/operation/actorRun_delete + x-js-parent: RunClient + x-js-name: delete + x-js-doc-url: https://docs.apify.com/api/client/js/reference/class/RunClient#delete + get: + deprecated: false + description: | + This is not a single endpoint, but an entire group of endpoints that lets + you retrieve the run or any of its default storages. + + ##### Convenience endpoints for Actor run default storages + + * [Dataset](/api/v2/default-dataset) + + * [Key-value store](/api/v2/default-key-value-store) + + * [Request queue](/api/v2/default-request-queue) + + Gets an object that contains all the details about a + specific run of an Actor. + + By passing the optional `waitForFinish` parameter the API endpoint will synchronously wait + for the run to finish. This is useful to avoid periodic polling when waiting for Actor run to complete. + Note that the first response after completion can still show preliminary `stats`, costs, and event counts. + For stable figures, wait about 10 seconds and call the endpoint again. + + This endpoint does not require the authentication token. Instead, calls are authenticated using a hard-to-guess ID of the run. However, + if you access the endpoint without the token, certain attributes, such as `usageUsd` and `usageTotalUsd`, will be hidden. + operationId: actorRun_get + parameters: + - $ref: "#/components/parameters/runId" + - $ref: "#/components/parameters/waitForFinishRun" + responses: + "200": + content: + application/json: + schema: + allOf: + - $ref: "#/components/schemas/RunResponse" + description: "" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Get run + tags: + - Actor runs + x-legacy-doc-urls: + - https://docs.apify.com/api/v2#/reference/actor-runs/run-object-and-its-storages/get-run + - https://docs.apify.com/api/v2#/reference/actor-runs/get-run + - https://docs.apify.com/api/v2#tag/Actor-runsRun-object-and-its-storages/operation/actorRun_get + put: + deprecated: false + description: | + This endpoint can be used to update both the run's status message and to configure its general resource access level. + + **Status message:** + + You can set a single status message on your run that will be displayed in + the Apify Console UI. During an Actor run, you will typically do this in order + to inform users of your Actor about the Actor's progress. + + The request body must contain `runId` and `statusMessage` properties. The + `isStatusMessageTerminal` property is optional and it indicates if the + status message is the very last one. In the absence of a status message, the + platform will try to substitute sensible defaults. + + **General resource access:** + + You can also update the run's general resource access setting, which determines who can view the run and its related data. + + Allowed values: + + * `FOLLOW_USER_SETTING` - The run inherits the general access setting from the account level. + * `ANYONE_WITH_ID_CAN_READ` - The run can be viewed anonymously by anyone who has its ID. + * `RESTRICTED` - Only users with explicit access to the resource can access the run. + + When a run is accessible anonymously, all of the run's default storages and logs also become accessible anonymously. + operationId: actorRun_put + parameters: + - $ref: "#/components/parameters/runId" + requestBody: + content: + application/json: + example: + runId: 3KH8gEpp4d8uQSe8T + statusMessage: Actor has finished + isStatusMessageTerminal: true + schema: + allOf: + - $ref: "#/components/schemas/UpdateRunRequest" + example: + runId: 3KH8gEpp4d8uQSe8T + statusMessage: Actor has finished + isStatusMessageTerminal: true + description: "" + required: true + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/RunResponse" + description: "" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "413": + $ref: "#/components/responses/PayloadTooLarge" + "415": + $ref: "#/components/responses/UnsupportedMediaType" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Update run + tags: + - Actor runs + x-legacy-doc-urls: + - https://docs.apify.com/api/v2#/reference/actor-runs/update-status-message/update-status-message + - https://docs.apify.com/api/v2#/reference/actor-runs/update-status-message + - https://docs.apify.com/api/v2#tag/Actor-runsUpdate-status-message/operation/actorRun_put + /v2/actor-runs/{runId}/abort: + post: + deprecated: false + description: | + Aborts an Actor run and returns an object that contains all the details + about the run. + + Only runs that are starting or running are aborted. For runs with status + `FINISHED`, `FAILED`, `ABORTING` and `TIMED-OUT` this call does nothing. + operationId: actorRun_abort_post + parameters: + - $ref: "#/components/parameters/runId" + - $ref: "#/components/parameters/gracefully" + responses: + "200": + content: + application/json: + example: + data: + id: HG7ML7M8z78YcAPEB + actId: janedoe~my-actor + userId: BPWZBd7Z9c746JAng + actorTaskId: rANaydYhUxjsnA3oz + startedAt: 2019-11-30T07:34:24.202Z + finishedAt: 2019-12-12T09:30:12.202Z + status: ABORTED + statusMessage: Actor was aborted + isStatusMessageTerminal: true + meta: + origin: WEB + clientIp: 172.234.12.34 + userAgent: Mozilla/5.0 (iPad) + stats: + inputBodyLen: 240 + migrationCount: 0 + restartCount: 0 + resurrectCount: 1 + memAvgBytes: 3.59142284E7 + memMaxBytes: 38244352 + memCurrentBytes: 0 + cpuAvgUsage: 0.00955965 + cpuMaxUsage: 3.1546 + cpuCurrentUsage: 0 + netRxBytes: 2652 + netTxBytes: 1338 + durationMillis: 26239 + runTimeSecs: 26.239 + metamorph: 0 + computeUnits: 0.0072886 + options: + build: latest + timeoutSecs: 300 + memoryMbytes: 1024 + diskMbytes: 2048 + buildId: 7sT5jcggjjA9fNcxF + exitCode: 0 + generalAccess: RESTRICTED + defaultKeyValueStoreId: eJNzqsbPiopwJcgGQ + defaultDatasetId: wmKPijuyDnPZAPRMk + defaultRequestQueueId: FL35cSF7jrxr3BY39 + storageIds: + datasets: + default: wmKPijuyDnPZAPRMk + keyValueStores: + default: eJNzqsbPiopwJcgGQ + requestQueues: + default: FL35cSF7jrxr3BY39 + isContainerServerReady: false + gitBranchName: master + usage: + ACTOR_COMPUTE_UNITS: 3 + DATASET_READS: 4 + DATASET_WRITES: 4 + KEY_VALUE_STORE_READS: 5 + KEY_VALUE_STORE_WRITES: 3 + KEY_VALUE_STORE_LISTS: 5 + REQUEST_QUEUE_READS: 2 + REQUEST_QUEUE_WRITES: 1 + DATA_TRANSFER_INTERNAL_GBYTES: 1 + DATA_TRANSFER_EXTERNAL_GBYTES: 3 + PROXY_RESIDENTIAL_TRANSFER_GBYTES: 34 + PROXY_SERPS: 3 + usageTotalUsd: 0.2654 + usageUsd: + ACTOR_COMPUTE_UNITS: 0.072 + DATASET_READS: 4.0E-4 + DATASET_WRITES: 2.0E-4 + KEY_VALUE_STORE_READS: 6.0E-4 + KEY_VALUE_STORE_WRITES: 0.002 + KEY_VALUE_STORE_LISTS: 0.004 + REQUEST_QUEUE_READS: 0.005 + REQUEST_QUEUE_WRITES: 0.02 + DATA_TRANSFER_INTERNAL_GBYTES: 4.0E-4 + DATA_TRANSFER_EXTERNAL_GBYTES: 2.0E-4 + PROXY_RESIDENTIAL_TRANSFER_GBYTES: 0.16 + PROXY_SERPS: 6.0E-4 + schema: + $ref: "#/components/schemas/RunResponse" + description: "" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Abort run + tags: + - Actor runs + x-legacy-doc-urls: + - https://docs.apify.com/api/v2#/reference/actor-runs/abort-run/abort-run + - https://docs.apify.com/api/v2#/reference/actor-runs/abort-run + - https://docs.apify.com/api/v2#tag/Actor-runsAbort-run/operation/actorRun_abort_post + x-js-parent: RunClient + x-js-name: abort + x-js-doc-url: https://docs.apify.com/api/client/js/reference/class/RunClient#abort + x-py-parent: RunClientAsync + x-py-name: abort + x-py-doc-url: https://docs.apify.com/api/client/python/reference/class/RunClientAsync#abort + /v2/actor-runs/{runId}/metamorph: + post: + deprecated: false + description: | + Transforms an Actor run into a run of another Actor with a new input. + + This is useful if you want to use another Actor to finish the work + of your current Actor run, without the need to create a completely new run + and waiting for its finish. + + For the users of your Actors, the metamorph operation is transparent, they + will just see your Actor got the work done. + + Internally, the system stops the Docker container corresponding to the Actor + run and starts a new container using a different Docker image. + + All the default storages are preserved and the new input is stored under the + `INPUT-METAMORPH-1` key in the same default key-value store. + + For more information, see the [Actor docs](https://docs.apify.com/platform/actors/development/programming-interface/metamorph). + operationId: actorRun_metamorph_post + parameters: + - $ref: "#/components/parameters/runId" + - $ref: "#/components/parameters/targetActorId" + - description: | + Optional build of the target Actor. + + It can be either a build tag or build number. By default, the run uses + the build specified in the default run configuration for the target + Actor (typically `latest`). + explode: true + in: query + name: build + required: false + schema: + example: beta + type: string + style: form + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/RunResponse" + description: "" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Metamorph run + tags: + - Actor runs + x-legacy-doc-urls: + - https://docs.apify.com/api/v2#/reference/actor-runs/metamorph-run/metamorph-run + - https://docs.apify.com/api/v2#/reference/actor-runs/metamorph-run + - https://docs.apify.com/api/v2#tag/Actor-runsMetamorph-run/operation/actorRun_metamorph_post + x-js-parent: RunClient + x-js-name: metamorph + x-js-doc-url: https://docs.apify.com/api/client/js/reference/class/RunClient#metamorph + x-py-parent: RunClientAsync + x-py-name: metamorph + x-py-doc-url: https://docs.apify.com/api/client/python/reference/class/RunClientAsync#metamorph + /v2/actor-runs/{runId}/reboot: + post: + deprecated: false + description: | + Reboots an Actor run and returns an object that contains all the details + about the rebooted run. + + Only runs that are running, i.e. runs with status `RUNNING` can be rebooted. + + The run's container will be restarted, so any data not persisted in the + key-value store, dataset, or request queue will be lost. + operationId: actorRun_reboot_post + parameters: + - $ref: "#/components/parameters/runId" + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/RunResponse" + description: "" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Reboot run + tags: + - Actor runs + x-legacy-doc-urls: + - https://docs.apify.com/api/v2#/reference/actor-runs/reboot-run/reboot-run + - https://docs.apify.com/api/v2#/reference/actor-runs/reboot-run + - https://docs.apify.com/api/v2#tag/Actor-runsReboot-run/operation/actorRun_reboot_post + x-js-parent: RunClient + x-js-name: reboot + x-js-doc-url: https://docs.apify.com/api/client/js/reference/class/RunClient#reboot + x-py-parent: RunClientAsync + x-py-name: reboot + x-py-doc-url: https://docs.apify.com/api/client/python/reference/class/RunClientAsync#reboot + /v2/actor-runs/{runId}/resurrect: + post: + deprecated: false + description: | + Resurrects a finished Actor run and returns an object that contains all the details about the resurrected run. + Only finished runs, i.e. runs with status `FINISHED`, `FAILED`, `ABORTED` and `TIMED-OUT` can be resurrected. + Run status will be updated to RUNNING and its container will be restarted with the same storages + (the same behaviour as when the run gets migrated to the new server). + + For more information, see the [Actor docs](https://docs.apify.com/platform/actors/running/runs-and-builds#resurrection-of-finished-run). + operationId: PostResurrectRun + parameters: + - $ref: "#/components/parameters/runId" + - $ref: "#/components/parameters/buildResurrect" + - $ref: "#/components/parameters/timeoutResurrect" + - $ref: "#/components/parameters/memoryResurrect" + - $ref: "#/components/parameters/maxItems" + - $ref: "#/components/parameters/maxTotalChargeUsd" + - $ref: "#/components/parameters/restartOnErrorResurrect" + responses: + "200": + content: + application/json: + schema: + allOf: + - $ref: "#/components/schemas/RunResponse" + description: "" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Resurrect run + tags: + - Actor runs + x-legacy-doc-urls: + - https://docs.apify.com/api/v2#/reference/actor-runs/resurrect-run/resurrect-run + - https://docs.apify.com/api/v2#/reference/actor-runs/resurrect-run + - https://docs.apify.com/api/v2#tag/Actor-runsResurrect-run/operation/PostResurrectRun + x-js-parent: RunClient + x-js-name: resurrect + x-js-doc-url: https://docs.apify.com/api/client/js/reference/class/RunClient#resurrect + x-py-parent: RunClientAsync + x-py-name: resurrect + x-py-doc-url: https://docs.apify.com/api/client/python/reference/class/RunClientAsync#resurrect + /v2/actor-runs/{runId}/charge: + post: + deprecated: false + description: | + Charge for events in the run of your [pay per event Actor](https://docs.apify.com/platform/actors/running/actors-in-store#pay-per-event). + The event you are charging for must be one of the configured events in your Actor. If the Actor is not set up as pay per event, or if the event is not configured, + the endpoint will return an error. The endpoint must be called from the Actor run itself, with the same API token that the run was started with. + + :::info Learn more about pay-per-event pricing + + For more details about pay-per-event (PPE) pricing, refer to our [PPE documentation](/platform/actors/publishing/monetize/pay-per-event). + + ::: + operationId: PostChargeRun + parameters: + - $ref: "#/components/parameters/runId" + - description: Always pass a unique idempotency key (any unique string) for + each charge to avoid double charging in case of retries or network errors. + example: 2024-12-09T01:23:45.000Z-random-uuid + explode: false + in: header + name: idempotency-key + required: false + schema: + type: string + style: simple + requestBody: + content: + application/json: + example: + eventName: ANALYZE_PAGE + count: 1 + schema: + $ref: "#/components/schemas/ChargeRunRequest" + description: "Define which event, and how many times, you want to charge for." + required: true + responses: + "201": + content: + application/json: + schema: + additionalProperties: {} + description: "The charge was successful. Note that you still have to make\ + \ sure in your Actor that the total charge for the run respects the maximum\ + \ value set by the user, as the API does not check this. Above the limit,\ + \ the charges reported as successful in API will not be added to your\ + \ payouts, but you will still bear the associated costs. Use the Apify\ + \ charge manager or SDK to avoid having to deal with this manually." + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "413": + $ref: "#/components/responses/PayloadTooLarge" + "415": + $ref: "#/components/responses/UnsupportedMediaType" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Charge events in run + tags: + - Actor runs + x-js-parent: RunClient + x-js-name: charge + x-js-doc-url: https://docs.apify.com/api/client/js/reference/class/RunClient#charge + x-py-parent: RunClientAsync + x-py-name: charge + x-py-doc-url: https://docs.apify.com/api/client/python/reference/class/RunClientAsync#charge + x-legacy-doc-urls: + - https://docs.apify.com/api/v2#/reference/actor-runs/charge-events-in-run + - https://docs.apify.com/api/v2#tag/Actor-runsCharge-events-in-run/operation/PostChargeRun + /v2/actor-runs/{runId}/dataset: + delete: + deprecated: false + description: | + Deletes default dataset associated with an Actor run. + + This endpoint is a shortcut for getting the last run's `defaultDatasetId` and then using the + [ Delete dataset ](/api/v2/dataset-delete) endpoint. + operationId: actorRun_dataset_delete + parameters: + - $ref: "#/components/parameters/runId" + responses: + "204": + $ref: "#/components/responses/NoContent" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Delete default dataset + tags: + - Default dataset + get: + deprecated: false + description: | + Returns the default dataset associated with an Actor run. + + This endpoint is a shortcut for getting the run's `defaultDatasetId` and then using the + [Get dataset](/api/v2/dataset-get) endpoint. + operationId: actorRun_dataset_get + parameters: + - $ref: "#/components/parameters/runId" + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/DatasetResponse" + description: "" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Get default dataset + tags: + - Default dataset + put: + deprecated: false + description: | + Updates the default dataset associated with an Actor run. + + This endpoint is a shortcut for getting the run's `defaultDatasetId` and then using the + [Put dataset](/api/v2/dataset-put) endpoint. + operationId: actorRun_dataset_put + parameters: + - $ref: "#/components/parameters/runId" + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/UpdateDatasetRequest" + description: "" + required: true + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/DatasetResponse" + description: "" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "413": + $ref: "#/components/responses/PayloadTooLarge" + "415": + $ref: "#/components/responses/UnsupportedMediaType" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Update default dataset + tags: + - Default dataset + /v2/actor-runs/{runId}/dataset/items: + get: + deprecated: false + description: | + Returns data stored in the default dataset of the Actor run in the desired format. + + This endpoint is a shortcut that resolves the run's `defaultDatasetId` and proxies to the + [Get dataset items](/api/v2/dataset-items-get) endpoint. + operationId: actorRun_dataset_items_get + parameters: + - $ref: "#/components/parameters/runId" + - $ref: "#/components/parameters/format" + - $ref: "#/components/parameters/clean" + - $ref: "#/components/parameters/offset" + - $ref: "#/components/parameters/datasetParameters_limit" + - $ref: "#/components/parameters/fields" + - $ref: "#/components/parameters/outputFields" + - $ref: "#/components/parameters/omit" + - $ref: "#/components/parameters/unwind" + - $ref: "#/components/parameters/flatten" + - $ref: "#/components/parameters/descDataset" + - $ref: "#/components/parameters/attachment" + - $ref: "#/components/parameters/delimiter" + - $ref: "#/components/parameters/bom" + - $ref: "#/components/parameters/xmlRoot" + - $ref: "#/components/parameters/xmlRow" + - $ref: "#/components/parameters/skipHeaderRow" + - $ref: "#/components/parameters/skipHidden" + - $ref: "#/components/parameters/skipEmpty" + - $ref: "#/components/parameters/simplified" + - $ref: "#/components/parameters/view" + - $ref: "#/components/parameters/skipFailedPages" + - $ref: "#/components/parameters/feedTitle" + - $ref: "#/components/parameters/feedDescription" + - $ref: "#/components/parameters/signature" + responses: + "200": + content: + application/json: + schema: + example: + - foo: bar + - foo2: bar2 + items: + type: object + type: array + default: null + application/jsonl: + example: "{\"foo\":\"bar\"}\\n{\"foo2\":\"bar2\"}\\n" + schema: + type: string + text/csv: + example: "foo,bar\\nfoo2,bar2\\n" + schema: + type: string + text/html: + example:
foobar
foobar
foo2bar2
+ schema: + type: string + application/vnd.openxmlformats-officedocument.spreadsheetml.sheet: + schema: + type: string + application/rss+xml: + example: barbar2 + schema: + type: string + application/xml: + example: barbar2 + schema: + type: string + description: "" + headers: + X-Apify-Pagination-Offset: + content: + text/plain: + example: "0" + schema: {} + description: The offset of the first item in the current page. + explode: false + style: simple + X-Apify-Pagination-Limit: + content: + text/plain: + example: "100" + schema: {} + description: The maximum number of items returned per page. + explode: false + style: simple + X-Apify-Pagination-Count: + content: + text/plain: + example: "100" + schema: {} + description: The number of items returned in the current page. + explode: false + style: simple + X-Apify-Pagination-Total: + content: + text/plain: + example: "10204" + schema: {} + description: The total number of items in the dataset. + explode: false + style: simple + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Get default dataset items + tags: + - Default dataset + post: + deprecated: false + description: | + Appends an item or an array of items to the end of the Actor run's default dataset. + + This endpoint is a shortcut that resolves the run's `defaultDatasetId` and proxies to the + [Store items](/api/v2/dataset-items-post) endpoint. + operationId: actorRun_dataset_items_post + parameters: + - $ref: "#/components/parameters/runId" + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/act_runs_last_dataset_items_post_request" + description: "" + required: true + responses: + "201": + content: + application/json: + schema: + example: {} + type: object + description: "" + headers: + Location: + content: + text/plain: + example: https://api.apify.com/v2/datasets/WkzbQMuFYuamGv3YF/items + schema: + type: string + explode: false + style: simple + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/act_runs_last_dataset_items_post_400_response" + description: "" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Store items + tags: + - Default dataset + /v2/actor-runs/{runId}/dataset/statistics: + get: + description: | + Returns statistics for the Actor run's default dataset. + + This endpoint is a shortcut that resolves the run's `defaultDatasetId` and proxies to the + [Get dataset statistics](/api/v2/dataset-statistics-get) endpoint. + operationId: actorRun_dataset_statistics_get + parameters: + - $ref: "#/components/parameters/runId" + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/DatasetStatisticsResponse" + description: "" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Get default dataset statistics + tags: + - Default dataset + /v2/actor-runs/{runId}/key-value-store: + delete: + deprecated: false + description: | + Delete the default key-value store. + + This endpoint is a shortcut for getting the run's `defaultKeyValueStoreId` and then using the + [Delete store](/api/v2/key-value-store-delete) endpoint. + operationId: actorRun_keyValueStore_delete + parameters: + - $ref: "#/components/parameters/runId" + responses: + "204": + $ref: "#/components/responses/NoContent" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Delete default store + tags: + - Default key-value store + get: + deprecated: false + description: | + Gets an object that contains all the details about the default key-value + store. + + This endpoint is a shortcut for getting the run's `defaultKeyValueStoreId` and then using the + [Get store](/api/v2/key-value-store-get) endpoint. + operationId: actorRun_keyValueStore_get + parameters: + - $ref: "#/components/parameters/runId" + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/KeyValueStoreResponse" + description: "" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Get default store + tags: + - Default key-value store + put: + deprecated: false + description: | + Updates the default key-value store's name and general resource access level using a value specified by a JSON object + passed in the PUT payload. + + This endpoint is a shortcut for getting the run's `defaultKeyValueStoreId` and then using the + [Update store](/api/v2/key-value-store-put) endpoint. + operationId: actorRun_keyValueStore_put + parameters: + - $ref: "#/components/parameters/runId" + requestBody: + content: + application/json: + example: + name: new-store-name + schema: + $ref: "#/components/schemas/UpdateStoreRequest" + description: "" + required: true + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/KeyValueStoreResponse" + description: "" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "413": + $ref: "#/components/responses/PayloadTooLarge" + "415": + $ref: "#/components/responses/UnsupportedMediaType" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Update default store + tags: + - Default key-value store + /v2/actor-runs/{runId}/key-value-store/keys: + get: + deprecated: false + description: | + Returns a list of keys for the default key-value store of the Actor run. + + This endpoint is a shortcut for getting the run's `defaultKeyValueStoreId` and then using the + [Get list of keys](/api/v2/key-value-store-keys-get) endpoint. + operationId: actorRun_keyValueStore_keys_get + parameters: + - $ref: "#/components/parameters/runId" + - $ref: "#/components/parameters/exclusiveStartKey" + - $ref: "#/components/parameters/keyValueStoreParameters_limit" + - $ref: "#/components/parameters/collectionKeys" + - $ref: "#/components/parameters/prefixKeys" + - $ref: "#/components/parameters/signature" + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/ListOfKeysResponse" + description: "" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Get default store's list of keys + tags: + - Default key-value store + /v2/actor-runs/{runId}/key-value-store/records: + get: + deprecated: false + description: | + Downloads all records from the default key-value store of the Actor run as a ZIP archive. + + This endpoint is a shortcut for getting the run's `defaultKeyValueStoreId` and then using the + [Download records](/api/v2/key-value-store-records-get) endpoint. + operationId: actorRun_keyValueStore_records_get + parameters: + - $ref: "#/components/parameters/runId" + - $ref: "#/components/parameters/collectionRecords" + - $ref: "#/components/parameters/prefixRecords" + - $ref: "#/components/parameters/signature" + responses: + "200": + content: + application/zip: + schema: + format: binary + type: string + description: A ZIP archive containing the requested records. + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Download default store's records + tags: + - Default key-value store + /v2/actor-runs/{runId}/key-value-store/records/{recordKey}: + delete: + deprecated: false + description: | + Removes a record specified by a key from the default key-value store of the Actor run. + + This endpoint is a shortcut for getting the run's `defaultKeyValueStoreId` and then using the + [Delete record](/api/v2/key-value-store-record-delete) endpoint. + operationId: actorRun_keyValueStore_record_delete + parameters: + - $ref: "#/components/parameters/runId" + - $ref: "#/components/parameters/recordKey" + responses: + "204": + $ref: "#/components/responses/NoContent" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Delete default store's record + tags: + - Default key-value store + get: + deprecated: false + description: | + Gets a value stored under a specific key in the default key-value store of the Actor run. + + This endpoint is a shortcut for getting the run's `defaultKeyValueStoreId` and then using the + [Get record](/api/v2/key-value-store-record-get) endpoint. + operationId: actorRun_keyValueStore_record_get + parameters: + - $ref: "#/components/parameters/runId" + - $ref: "#/components/parameters/recordKey" + - $ref: "#/components/parameters/signature" + - $ref: "#/components/parameters/keyValueStoreParameters_attachment" + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/RecordResponse" + '*/*': + schema: {} + description: "" + "302": + content: {} + description: "" + headers: + Location: + content: + text/plain: + example: https://apifier-key-value-store-prod.s3.amazonaws.com/tqx6jeMia43gYY6eE/INPUT?AWSAccessKeyId=NKDOUN&Expires=1502720992&Signature=DKLVPI4lDDKC + schema: + type: string + explode: false + style: simple + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Get default store's record + tags: + - Default key-value store + post: + deprecated: false + description: | + Stores a value under a specific key in the default key-value store of the Actor run. + + This endpoint is a shortcut for getting the run's `defaultKeyValueStoreId` and then using the + [Store record](/api/v2/key-value-store-record-post) endpoint. + operationId: actorRun_keyValueStore_record_post + parameters: + - $ref: "#/components/parameters/runId" + - $ref: "#/components/parameters/recordKey" + - $ref: "#/components/parameters/Content-Encoding" + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/PutRecordRequest" + '*/*': + schema: {} + description: "" + required: true + responses: + "201": + content: + application/json: + example: {} + schema: + type: object + description: "" + headers: + Location: + content: + text/plain: + example: https://api.apify.com/v2/key-value-stores/WkzbQMuFYuamGv3YF/records/some-key + schema: + type: string + explode: false + style: simple + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "413": + $ref: "#/components/responses/PayloadTooLarge" + "415": + $ref: "#/components/responses/UnsupportedMediaType" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Store record in default store (POST) + tags: + - Default key-value store + put: + deprecated: false + description: | + Stores a value under a specific key in the default key-value store of the Actor run. + + This endpoint is a shortcut for getting the run's `defaultKeyValueStoreId` and then using the + [Store record](/api/v2/key-value-store-record-put) endpoint. + operationId: actorRun_keyValueStore_record_put + parameters: + - $ref: "#/components/parameters/runId" + - $ref: "#/components/parameters/recordKey" + - $ref: "#/components/parameters/Content-Encoding" + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/PutRecordRequest" + '*/*': + schema: {} + description: "" + required: true + responses: + "201": + content: + application/json: + example: {} + schema: + type: object + description: "" + headers: + Location: + content: + text/plain: + example: https://api.apify.com/v2/key-value-stores/WkzbQMuFYuamGv3YF/records/some-key + schema: + type: string + explode: false + style: simple + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "413": + $ref: "#/components/responses/PayloadTooLarge" + "415": + $ref: "#/components/responses/UnsupportedMediaType" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Store record in default store + tags: + - Default key-value store + /v2/actor-runs/{runId}/request-queue: + delete: + deprecated: false + description: | + Deletes the default request queue associated with an Actor run. + + This endpoint is a shortcut for getting the run's `defaultRequestQueueId` and then using the + [Delete request queue](/api/v2/request-queue-delete) endpoint. + operationId: actorRun_requestQueue_delete + parameters: + - $ref: "#/components/parameters/runId" + responses: + "204": + $ref: "#/components/responses/NoContent" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Delete default request queue + tags: + - Default request queue + get: + deprecated: false + description: | + Returns the default request queue associated with an Actor run. + + This endpoint is a shortcut for getting the run's `defaultRequestQueueId` and then using the + [Get request queue](/api/v2/request-queue-get) endpoint. + operationId: actorRun_requestQueue_get + parameters: + - $ref: "#/components/parameters/runId" + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/RequestQueueResponse" + description: "" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Get default request queue + tags: + - Default request queue + put: + deprecated: false + description: | + Updates the default request queue associated with an Actor run. + + This endpoint is a shortcut for getting the run's `defaultRequestQueueId` and then using the + [Update request queue](/api/v2/request-queue-put) endpoint. + operationId: actorRun_requestQueue_put + parameters: + - $ref: "#/components/parameters/runId" + requestBody: + content: + application/json: + example: + name: new-request-queue-name + schema: + allOf: + - $ref: "#/components/schemas/UpdateRequestQueueRequest" + example: + name: new-request-queue-name + description: "" + required: true + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/RequestQueueResponse" + description: "" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "413": + $ref: "#/components/responses/PayloadTooLarge" + "415": + $ref: "#/components/responses/UnsupportedMediaType" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Update default request queue + tags: + - Default request queue + /v2/actor-runs/{runId}/request-queue/requests: + get: + deprecated: false + description: | + Returns a list of requests from the default request queue of the Actor run. + + This endpoint is a shortcut for getting the run's `defaultRequestQueueId` and then using the + [List requests](/api/v2/request-queue-requests-get) endpoint. + operationId: actorRun_requestQueue_requests_get + parameters: + - $ref: "#/components/parameters/runId" + - $ref: "#/components/parameters/clientKey" + - $ref: "#/components/parameters/exclusiveStartId" + - $ref: "#/components/parameters/listLimit" + - $ref: "#/components/parameters/cursor" + - $ref: "#/components/parameters/filter" + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/ListOfRequestsResponse" + description: "" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: List default request queue's requests + tags: + - Default request queue + post: + deprecated: false + description: | + Adds a request to the default request queue of the Actor run. + + This endpoint is a shortcut for getting the run's `defaultRequestQueueId` and then using the + [Add request](/api/v2/request-queue-requests-post) endpoint. + operationId: actorRun_requestQueue_requests_post + parameters: + - $ref: "#/components/parameters/runId" + - $ref: "#/components/parameters/clientKey" + - $ref: "#/components/parameters/forefront" + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/RequestBase" + description: "" + required: true + responses: + "201": + content: + application/json: + schema: + $ref: "#/components/schemas/AddRequestResponse" + description: "" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "413": + $ref: "#/components/responses/PayloadTooLarge" + "415": + $ref: "#/components/responses/UnsupportedMediaType" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Add request to default request queue + tags: + - Default request queue + /v2/actor-runs/{runId}/request-queue/requests/batch: + delete: + deprecated: false + description: | + Batch-deletes requests from the default request queue of the Actor run. + + This endpoint is a shortcut for getting the run's `defaultRequestQueueId` and then using the + [Delete requests](/api/v2/request-queue-requests-batch-delete) endpoint. + operationId: actorRun_requestQueue_requests_batch_delete + parameters: + - $ref: "#/components/parameters/runId" + - $ref: "#/components/parameters/contentTypeJson" + - $ref: "#/components/parameters/clientKey" + requestBody: + content: + application/json: + schema: + items: + $ref: "#/components/schemas/RequestDraftDelete" + type: array + default: null + description: "" + required: true + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/BatchDeleteResponse" + description: "" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "413": + $ref: "#/components/responses/PayloadTooLarge" + "415": + $ref: "#/components/responses/UnsupportedMediaType" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Batch delete requests from default request queue + tags: + - Default request queue + post: + deprecated: false + description: | + Adds requests to the default request queue of the Actor run in batch. + + This endpoint is a shortcut for getting the run's `defaultRequestQueueId` and then using the + [Add requests](/api/v2/request-queue-requests-batch-post) endpoint. + operationId: actorRun_requestQueue_requests_batch_post + parameters: + - $ref: "#/components/parameters/runId" + - $ref: "#/components/parameters/clientKey" + - $ref: "#/components/parameters/forefront" + requestBody: + content: + application/json: + schema: + description: "" + items: + $ref: "#/components/schemas/RequestBase" + type: array + default: null + description: "" + required: true + responses: + "201": + content: + application/json: + schema: + $ref: "#/components/schemas/BatchAddResponse" + description: "" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "413": + $ref: "#/components/responses/PayloadTooLarge" + "415": + $ref: "#/components/responses/UnsupportedMediaType" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Batch add requests to default request queue + tags: + - Default request queue + /v2/actor-runs/{runId}/request-queue/requests/unlock: + post: + deprecated: false + description: | + Unlocks requests in the default request queue of the Actor run that are currently locked by the client. + + This endpoint is a shortcut for getting the run's `defaultRequestQueueId` and then using the + [Unlock requests](/api/v2/request-queue-requests-unlock-post) endpoint. + operationId: actorRun_requestQueue_requests_unlock_post + parameters: + - $ref: "#/components/parameters/runId" + - $ref: "#/components/parameters/clientKey" + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/UnlockRequestsResponse" + description: Number of requests that were unlocked + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Unlock requests in default request queue + tags: + - Default request queue + /v2/actor-runs/{runId}/request-queue/requests/{requestId}: + delete: + deprecated: false + description: | + Deletes a request from the default request queue of the Actor run. + + This endpoint is a shortcut for getting the run's `defaultRequestQueueId` and then using the + [Delete request](/api/v2/request-queue-request-delete) endpoint. + operationId: actorRun_requestQueue_request_delete + parameters: + - $ref: "#/components/parameters/runId" + - $ref: "#/components/parameters/requestId" + - $ref: "#/components/parameters/clientKey" + responses: + "204": + $ref: "#/components/responses/NoContent" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Delete request from default request queue + tags: + - Default request queue + get: + deprecated: false + description: | + Returns a request from the default request queue of the Actor run. + + This endpoint is a shortcut for getting the run's `defaultRequestQueueId` and then using the + [Get request](/api/v2/request-queue-request-get) endpoint. + operationId: actorRun_requestQueue_request_get + parameters: + - $ref: "#/components/parameters/runId" + - $ref: "#/components/parameters/requestId" + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/RequestResponse" + description: "" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Get request from default request queue + tags: + - Default request queue + put: + deprecated: false + description: | + Updates a request in the default request queue of the Actor run. + + This endpoint is a shortcut for getting the run's `defaultRequestQueueId` and then using the + [Update request](/api/v2/request-queue-request-put) endpoint. + operationId: actorRun_requestQueue_request_put + parameters: + - $ref: "#/components/parameters/runId" + - $ref: "#/components/parameters/requestId" + - $ref: "#/components/parameters/forefront" + - $ref: "#/components/parameters/clientKey" + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/Request" + description: "" + required: true + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/UpdateRequestResponse" + description: "" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "413": + $ref: "#/components/responses/PayloadTooLarge" + "415": + $ref: "#/components/responses/UnsupportedMediaType" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Update request in default request queue + tags: + - Default request queue + /v2/actor-runs/{runId}/request-queue/requests/{requestId}/lock: + delete: + deprecated: false + description: | + Deletes a request lock in the default request queue of the Actor run. + + This endpoint is a shortcut for getting the run's `defaultRequestQueueId` and then using the + [Delete request lock](/api/v2/request-queue-request-lock-delete) endpoint. + operationId: actorRun_requestQueue_request_lock_delete + parameters: + - $ref: "#/components/parameters/runId" + - $ref: "#/components/parameters/requestId" + - $ref: "#/components/parameters/clientKey" + - $ref: "#/components/parameters/deleteForefront" + responses: + "204": + $ref: "#/components/responses/NoContent" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Delete lock on request in default request queue + tags: + - Default request queue + put: + deprecated: false + description: | + Prolongs a request lock in the default request queue of the Actor run. + + This endpoint is a shortcut for getting the run's `defaultRequestQueueId` and then using the + [Prolong request lock](/api/v2/request-queue-request-lock-put) endpoint. + operationId: actorRun_requestQueue_request_lock_put + parameters: + - $ref: "#/components/parameters/runId" + - $ref: "#/components/parameters/requestId" + - $ref: "#/components/parameters/lockSecs" + - $ref: "#/components/parameters/clientKey" + - $ref: "#/components/parameters/lockForefront" + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/ProlongRequestLockResponse" + description: "" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Prolong lock on request in default request queue + tags: + - Default request queue + /v2/actor-runs/{runId}/request-queue/head: + get: + deprecated: false + description: | + Returns the given number of first requests from the default request queue of the Actor run. + + This endpoint is a shortcut for getting the run's `defaultRequestQueueId` and then using the + [Get head](/api/v2/request-queue-head-get) endpoint. + operationId: actorRun_requestQueue_head_get + parameters: + - $ref: "#/components/parameters/runId" + - $ref: "#/components/parameters/headLimit" + - $ref: "#/components/parameters/clientKey" + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/HeadResponse" + description: "" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Get default request queue head + tags: + - Default request queue + /v2/actor-runs/{runId}/request-queue/head/lock: + post: + deprecated: false + description: | + Returns the given number of first requests from the default request queue of the Actor run + and locks them for the given time. + + This endpoint is a shortcut for getting the run's `defaultRequestQueueId` and then using the + [Get head and lock](/api/v2/request-queue-head-lock-post) endpoint. + operationId: actorRun_requestQueue_head_lock_post + parameters: + - $ref: "#/components/parameters/runId" + - $ref: "#/components/parameters/lockSecs" + - $ref: "#/components/parameters/headLockLimit" + - $ref: "#/components/parameters/clientKey" + responses: + "201": + content: + application/json: + schema: + $ref: "#/components/schemas/HeadAndLockResponse" + description: "" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Get and lock default request queue head + tags: + - Default request queue + /v2/actor-runs/{runId}/log: + get: + deprecated: false + description: | + Retrieves Actor run's logs. + + This endpoint is a shortcut for getting the run's log. Same as [Get log](/api/v2/log-get) endpoint. + operationId: actorRun_log_get + parameters: + - $ref: "#/components/parameters/runId" + - $ref: "#/components/parameters/stream" + - $ref: "#/components/parameters/download" + - $ref: "#/components/parameters/raw" + responses: + "200": + content: + text/plain: + schema: + example: | + 2017-07-14T06:00:49.733Z Application started. + 2017-07-14T06:00:49.741Z Input: { test: 123 } + 2017-07-14T06:00:49.752Z Some useful debug information follows. + type: string + description: "" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Get run's log + tags: + - Actor runs + /v2/actor-builds: + get: + deprecated: false + description: | + Gets a list of all builds for a user. The response is a JSON array of + objects, where each object contains basic information about a single build. + + The endpoint supports pagination using the `limit` and `offset` parameters + and it will not return more than 1000 records. + + By default, the records are sorted by the `startedAt` field in ascending + order. Therefore, you can use pagination to incrementally fetch all builds while + new ones are still being started. To sort the records in descending order, use + the `desc=1` parameter. + operationId: actorBuilds_get + parameters: + - $ref: "#/components/parameters/offset" + - $ref: "#/components/parameters/limit" + - $ref: "#/components/parameters/descStartedAt" + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/ListOfBuildsResponse" + description: "" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Get user builds list + tags: + - Actor builds + x-legacy-doc-urls: + - https://docs.apify.com/api/v2#/reference/actor-builds/build-collection/get-user-builds-list + - https://docs.apify.com/api/v2#/reference/actor-builds/get-user-builds-list + - https://docs.apify.com/api/v2#tag/Actor-buildsBuild-collection/operation/actorBuilds_get + /v2/actor-builds/{buildId}: + delete: + deprecated: false + description: | + Delete the build. The build that is the current default build for the Actor + cannot be deleted. + + Only users with build permissions for the Actor can delete builds. + operationId: actorBuild_delete + parameters: + - $ref: "#/components/parameters/buildId" + responses: + "204": + $ref: "#/components/responses/NoContent" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Delete build + tags: + - Actor builds + x-legacy-doc-urls: + - https://docs.apify.com/api/v2#/reference/actor-builds/delete-build/delete-build + - https://docs.apify.com/api/v2#/reference/actor-builds/delete-build + - https://docs.apify.com/api/v2#tag/Actor-builds/operation/actorBuild_delete + x-js-parent: BuildClient + x-js-name: delete + x-js-doc-url: https://docs.apify.com/api/client/js/reference/class/BuildClient#delete + get: + deprecated: false + description: | + Gets an object that contains all the details about a specific build of an + Actor. + + By passing the optional `waitForFinish` parameter the API endpoint will + synchronously wait for the build to finish. This is useful to avoid periodic + polling when waiting for an Actor build to finish. + + This endpoint does not require the authentication token. Instead, calls are authenticated using a hard-to-guess ID of the build. However, + if you access the endpoint without the token, certain attributes, such as `usageUsd` and `usageTotalUsd`, will be hidden. + operationId: actorBuild_get + parameters: + - $ref: "#/components/parameters/buildId" + - $ref: "#/components/parameters/waitForFinishBuild" + responses: + "200": + content: + application/json: + schema: + allOf: + - $ref: "#/components/schemas/BuildResponse" + description: "" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "429": + $ref: "#/components/responses/TooManyRequests" + security: [] + summary: Get build + tags: + - Actor builds + x-legacy-doc-urls: + - https://docs.apify.com/api/v2#/reference/actor-builds/build-object/get-build + - https://docs.apify.com/api/v2#/reference/actor-builds/get-build + - https://docs.apify.com/api/v2#tag/Actor-buildsBuild-object/operation/actorBuild_get + x-js-parent: BuildClient + x-js-name: get + x-js-doc-url: https://docs.apify.com/api/client/js/reference/class/BuildClient#get + x-py-parent: BuildClientAsync + x-py-name: get + x-py-doc-url: https://docs.apify.com/api/client/python/reference/class/BuildClientAsync#get + /v2/actor-builds/{buildId}/abort: + post: + deprecated: false + description: | + Aborts an Actor build and returns an object that contains all the details + about the build. + + Only builds that are starting or running are aborted. For builds with status + `FINISHED`, `FAILED`, `ABORTING` and `TIMED-OUT` this call does nothing. + operationId: actorBuild_abort_post + parameters: + - $ref: "#/components/parameters/buildId" + responses: + "200": + content: + application/json: + schema: + allOf: + - $ref: "#/components/schemas/BuildResponse" + description: "" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Abort build + tags: + - Actor builds + x-legacy-doc-urls: + - https://docs.apify.com/api/v2#/reference/actor-builds/abort-build/abort-build + - https://docs.apify.com/api/v2#/reference/actor-builds/abort-build + - https://docs.apify.com/api/v2#tag/Actor-buildsAbort-build/operation/actorBuild_abort_post + x-js-parent: BuildClient + x-js-name: abort + x-js-doc-url: https://docs.apify.com/api/client/js/reference/class/BuildClient#abort + x-py-parent: BuildClientAsync + x-py-name: abort + x-py-doc-url: https://docs.apify.com/api/client/python/reference/class/BuildClientAsync#abort + /v2/actor-builds/{buildId}/log: + get: + deprecated: false + description: | + Retrieves Actor build's logs. + + This endpoint is a shortcut for getting the build's log. Same as [Get log](/api/v2/log-get) endpoint. + operationId: actorBuild_log_get + parameters: + - $ref: "#/components/parameters/buildId" + - $ref: "#/components/parameters/stream" + - $ref: "#/components/parameters/download" + responses: + "200": + content: + text/plain: + schema: + example: | + 2017-07-14T06:00:49.733Z Application started. + 2017-07-14T06:00:49.741Z Input: { test: 123 } + 2017-07-14T06:00:49.752Z Some useful debug information follows. + type: string + description: "" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Get build's Log + tags: + - Actor builds + x-legacy-doc-urls: + - https://docs.apify.com/api/v2#/reference/actor-builds/build-log/get-log + - https://docs.apify.com/api/v2#/reference/actor-builds/get-log + - https://docs.apify.com/api/v2#tag/Actor-buildsBuild-log/operation/actorBuild_log_get + /v2/actor-builds/{buildId}/openapi.json: + get: + description: | + Get the OpenAPI definition for Actor builds. Two similar endpoints are available: + + - [First endpoint](/api/v2/act-openapi-json-get): Requires both `actorId` and `buildId`. Use `default` as the `buildId` to get the OpenAPI schema for the default Actor build. + - [Second endpoint](/api/v2/actor-build-openapi-json-get): Requires only `buildId`. + + Get the OpenAPI definition for a specific Actor build. + Authentication is based on the build's unique ID. No authentication token is required. + + :::note + + You can also use the [`/api/v2/act-openapi-json-get`](/api/v2/act-openapi-json-get) endpoint to get the OpenAPI definition for a build. + + ::: + operationId: actorBuild_openapi_json_get + parameters: + - $ref: "#/components/parameters/buildIdWithDefault" + responses: + "200": + content: + application/json: + schema: + description: A standard OpenAPI 3.x JSON document. + type: object + description: The OpenAPI specification document for the Actor build. + "400": + $ref: "#/components/responses/BadRequest" + "404": + $ref: "#/components/responses/NotFound" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "429": + $ref: "#/components/responses/TooManyRequests" + security: [] + summary: Get OpenAPI definition + tags: + - Actor builds + x-js-parent: BuildClient + x-js-name: getOpenApiDefinition + x-js-doc-url: https://docs.apify.com/api/client/js/reference/class/BuildClient#getOpenApiDefinition + x-py-parent: BuildClient + x-py-name: get_open_api_definition + x-py-doc-url: https://docs.apify.com/api/client/python/reference/class/BuildClient#get_open_api_definition + /v2/key-value-stores: + get: + deprecated: false + description: | + Gets the list of key-value stores owned by the user. + + The response is a list of objects, where each objects contains a basic + information about a single key-value store. + + The endpoint supports pagination using the `limit` and `offset` parameters + and it will not return more than 1000 array elements. + + By default, the records are sorted by the `createdAt` field in ascending + order, therefore you can use pagination to incrementally fetch all key-value stores + while new ones are still being created. To sort the records in descending order, use + the `desc=1` parameter. + operationId: keyValueStores_get + parameters: + - $ref: "#/components/parameters/offset" + - $ref: "#/components/parameters/limit" + - $ref: "#/components/parameters/descCreatedAt" + - $ref: "#/components/parameters/unnamed" + - description: | + Filter by ownership. If this parameter is omitted, all accessible key-value stores are returned. + + - `ownedByMe`: Return only key-value stores owned by the user. + - `sharedWithMe`: Return only key-value stores shared with the user by other users. + explode: true + in: query + name: ownership + required: false + schema: + $ref: "#/components/schemas/StorageOwnership" + style: form + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/ListOfKeyValueStoresResponse" + description: "" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Get list of key-value stores + tags: + - Storage/Key-value stores + x-legacy-doc-urls: + - https://docs.apify.com/api/v2#/reference/key-value-stores/store-collection/get-list-of-key-value-stores + - https://docs.apify.com/api/v2#/reference/key-value-stores/get-list-of-key-value-stores + - https://docs.apify.com/api/v2#tag/Key-value-storesStore-collection/operation/keyValueStores_get + x-js-parent: KeyValueStoreCollectionClient + x-js-name: list + x-js-doc-url: https://docs.apify.com/api/client/js/reference/class/KeyValueStoreCollectionClient#list + x-py-parent: KeyValueStoreCollectionClientAsync + x-py-name: list + x-py-doc-url: https://docs.apify.com/api/client/python/reference/class/KeyValueStoreCollectionClientAsync#list + post: + deprecated: false + description: | + Creates a key-value store and returns its object. The response is the same + object as returned by the [Get store](#/reference/key-value-stores/store-object/get-store) + endpoint. + + Keep in mind that data stored under unnamed store follows [data retention + period](https://docs.apify.com/platform/storage#data-retention). + + It creates a store with the given name if the parameter name is used. + If there is another store with the same name, the endpoint does not create a + new one and returns the existing object instead. + operationId: keyValueStores_post + parameters: + - description: Custom unique name to easily identify the store in the future. + explode: true + in: query + name: name + required: false + schema: + example: eshop-values + type: string + style: form + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/KeyValueStoreResponse" + description: Returns the existing key-value store object if a store with + the given name already exists. + "201": + content: + application/json: + schema: + $ref: "#/components/schemas/KeyValueStoreResponse" + description: "" + headers: + Location: + content: + text/plain: + example: https://api.apify.com/v2/key-value-stores/WkzbQMuFYuamGv3YF + schema: + type: string + explode: false + style: simple + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Create key-value store + tags: + - Storage/Key-value stores + x-legacy-doc-urls: + - https://docs.apify.com/api/v2#/reference/key-value-stores/store-collection/create-key-value-store + - https://docs.apify.com/api/v2#/reference/key-value-stores/create-key-value-store + - https://docs.apify.com/api/v2#tag/Key-value-storesStore-collection/operation/keyValueStores_post + x-js-parent: KeyValueStoreCollectionClient + x-js-name: getOrCreate + x-js-doc-url: https://docs.apify.com/api/client/js/reference/class/KeyValueStoreCollectionClient#getOrCreate + x-py-parent: KeyValueStoreCollectionClientAsync + x-py-name: get_or_create + x-py-doc-url: https://docs.apify.com/api/client/python/reference/class/KeyValueStoreCollectionClientAsync#get_or_create + /v2/key-value-stores/{storeId}: + delete: + deprecated: false + description: Deletes a key-value store. + operationId: keyValueStore_delete + parameters: + - $ref: "#/components/parameters/storeId" + responses: + "204": + $ref: "#/components/responses/NoContent" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Delete store + tags: + - Storage/Key-value stores + x-legacy-doc-urls: + - https://docs.apify.com/api/v2#/reference/key-value-stores/store-object/delete-store + - https://docs.apify.com/api/v2#/reference/key-value-stores/delete-store + - https://docs.apify.com/api/v2#tag/Key-value-storesStore-object/operation/keyValueStore_delete + x-js-parent: KeyValueStoreClient + x-js-name: delete + x-js-doc-url: https://docs.apify.com/api/client/js/reference/class/KeyValueStoreClient#delete + get: + deprecated: false + description: | + Gets an object that contains all the details about a specific key-value + store. + operationId: keyValueStore_get + parameters: + - $ref: "#/components/parameters/storeId" + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/KeyValueStoreResponse" + description: "" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Get store + tags: + - Storage/Key-value stores + x-legacy-doc-urls: + - https://docs.apify.com/api/v2#/reference/key-value-stores/store-object/get-store + - https://docs.apify.com/api/v2#/reference/key-value-stores/get-store + - https://docs.apify.com/api/v2#tag/Key-value-storesStore-object/operation/keyValueStore_get + x-js-parent: KeyValueStoreClient + x-js-name: get + x-js-doc-url: https://docs.apify.com/api/client/js/reference/class/KeyValueStoreClient#get + x-py-parent: KeyValueStoreClientAsync + x-py-name: get + x-py-doc-url: https://docs.apify.com/api/client/python/reference/class/KeyValueStoreClientAsync#get + put: + deprecated: false + description: | + Updates a key-value store's name and general resource access level using a value specified by a JSON object + passed in the PUT payload. + + The response is the updated key-value store object, as returned by the [Get + store](#/reference/key-value-stores/store-object/get-store) API endpoint. + operationId: keyValueStore_put + parameters: + - $ref: "#/components/parameters/storeId" + requestBody: + content: + application/json: + example: + name: new-store-name + schema: + $ref: "#/components/schemas/UpdateStoreRequest" + description: "" + required: true + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/KeyValueStoreResponse" + description: "" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "413": + $ref: "#/components/responses/PayloadTooLarge" + "415": + $ref: "#/components/responses/UnsupportedMediaType" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Update store + tags: + - Storage/Key-value stores + x-legacy-doc-urls: + - https://docs.apify.com/api/v2#/reference/key-value-stores/store-object/update-store + - https://docs.apify.com/api/v2#/reference/key-value-stores/update-store + - https://docs.apify.com/api/v2#tag/Key-value-storesStore-object/operation/keyValueStore_put + x-js-parent: KeyValueStoreClient + x-js-name: update + x-js-doc-url: https://docs.apify.com/api/client/js/reference/class/KeyValueStoreClient#update + x-py-parent: KeyValueStoreClientAsync + x-py-name: update + x-py-doc-url: https://docs.apify.com/api/client/python/reference/class/KeyValueStoreClientAsync#update + /v2/key-value-stores/{storeId}/keys: + get: + deprecated: false + description: | + Returns a list of objects describing keys of a given key-value store, as + well as some information about the values (e.g. size). + + This endpoint is paginated using `exclusiveStartKey` and `limit` parameters + - see [Pagination](/api/v2#using-key) for more details. + operationId: keyValueStore_keys_get + parameters: + - $ref: "#/components/parameters/storeId" + - $ref: "#/components/parameters/exclusiveStartKey" + - $ref: "#/components/parameters/keyValueStoreParameters_limit" + - $ref: "#/components/parameters/collectionKeys" + - $ref: "#/components/parameters/prefixKeys" + - $ref: "#/components/parameters/signature" + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/ListOfKeysResponse" + description: "" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Get list of keys + tags: + - Storage/Key-value stores + x-legacy-doc-urls: + - https://docs.apify.com/api/v2#/reference/key-value-stores/key-collection/get-list-of-keys + - https://docs.apify.com/api/v2#/reference/key-value-stores/get-list-of-keys + - https://docs.apify.com/api/v2#tag/Key-value-storesKey-collection/operation/keyValueStore_keys_get + x-js-parent: KeyValueStoreClient + x-js-name: listKeys + x-js-doc-url: https://docs.apify.com/api/client/js/reference/class/KeyValueStoreClient#listKeys + x-py-parent: KeyValueStoreClientAsync + x-py-name: list_keys + x-py-doc-url: https://docs.apify.com/api/client/python/reference/class/KeyValueStoreClientAsync#list_keys + /v2/key-value-stores/{storeId}/records: + get: + deprecated: false + description: | + Downloads all records from the key-value store as a ZIP archive. + Each record is stored as a separate file in the archive, with the filename equal to the record key. + + You can optionally filter the records by `collection` or `prefix` to download only a subset of the store. + operationId: keyValueStore_records_get + parameters: + - $ref: "#/components/parameters/storeId" + - $ref: "#/components/parameters/collectionRecords" + - $ref: "#/components/parameters/prefixRecords" + - $ref: "#/components/parameters/signature" + responses: + "200": + content: + application/zip: + schema: + format: binary + type: string + description: A ZIP archive containing the requested records. + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Download records + tags: + - Storage/Key-value stores + /v2/key-value-stores/{storeId}/records/{recordKey}: + delete: + deprecated: false + description: Removes a record specified by a key from the key-value store. + operationId: keyValueStore_record_delete + parameters: + - $ref: "#/components/parameters/storeId" + - $ref: "#/components/parameters/recordKey" + responses: + "204": + $ref: "#/components/responses/NoContent" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Delete record + tags: + - Storage/Key-value stores + x-legacy-doc-urls: + - https://docs.apify.com/api/v2#/reference/key-value-stores/record/delete-record + - https://docs.apify.com/api/v2#/reference/key-value-stores/delete-record + - https://docs.apify.com/api/v2#tag/Key-value-storesRecord/operation/keyValueStore_record_delete + x-js-parent: KeyValueStoreClient + x-js-name: deleteRecord + x-js-doc-url: https://docs.apify.com/api/client/js/reference/class/KeyValueStoreClient#deleteRecord + x-py-parent: KeyValueStoreClientAsync + x-py-name: delete_record + x-py-doc-url: https://docs.apify.com/api/client/python/reference/class/KeyValueStoreClientAsync#delete_record + get: + deprecated: false + description: | + Gets a value stored in the key-value store under a specific key. + + The response body has the same `Content-Encoding` header as it was set in + [Put record](#tag/Key-value-storesRecord/operation/keyValueStore_record_put). + + If the request does not define the `Accept-Encoding` HTTP header with the + right encoding, the record will be decompressed. + + Most HTTP clients support decompression by default. After using the HTTP + client with decompression support, the `Accept-Encoding` header is set by + the client and body is decompressed automatically. + + Please note that for security reasons, Apify API can perform small modifications + to HTML documents before they are served via this endpoint. To fetch the raw HTML + content without any modifications, use the `attachment` query parameter. + operationId: keyValueStore_record_get + parameters: + - $ref: "#/components/parameters/storeId" + - $ref: "#/components/parameters/recordKey" + - $ref: "#/components/parameters/keyValueStoreParameters_attachment" + - $ref: "#/components/parameters/signature" + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/RecordResponse" + '*/*': + schema: {} + description: "" + "302": + content: {} + description: "" + headers: + Location: + content: + text/plain: + example: https://apifier-key-value-store-prod.s3.amazonaws.com/tqx6jeMia43gYY6eE/INPUT?AWSAccessKeyId=NKDOUN&Expires=1502720992&Signature=DKLVPI4lDDKC + schema: + type: string + explode: false + style: simple + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Get record + tags: + - Storage/Key-value stores + x-legacy-doc-urls: + - https://docs.apify.com/api/v2#/reference/key-value-stores/record/get-record + - https://docs.apify.com/api/v2#/reference/key-value-stores/get-record + - https://docs.apify.com/api/v2#tag/Key-value-storesRecord/operation/keyValueStore_record_get + x-js-parent: KeyValueStoreClient + x-js-name: getRecord + x-js-doc-url: https://docs.apify.com/api/client/js/reference/class/KeyValueStoreClient#getRecord + x-py-parent: KeyValueStoreClientAsync + x-py-name: get_record + x-py-doc-url: https://docs.apify.com/api/client/python/reference/class/KeyValueStoreClientAsync#get_record + head: + deprecated: false + description: | + Check if a value is stored in the key-value store under a specific key. + operationId: keyValueStore_record_head + parameters: + - $ref: "#/components/parameters/storeId" + - $ref: "#/components/parameters/recordKey" + responses: + "200": + description: The record exists + "404": + $ref: "#/components/responses/NotFound" + summary: Check if a record exists + tags: + - Storage/Key-value stores + x-js-parent: KeyValueStoreClient + x-js-name: recordExists + x-js-doc-url: https://docs.apify.com/api/client/js/reference/class/KeyValueStoreClient#recordExists + x-py-parent: KeyValueStoreClientAsync + x-py-name: record_exists + x-py-doc-url: https://docs.apify.com/api/client/python/reference/class/KeyValueStoreClientAsync#record_exists + post: + deprecated: false + description: | + Stores a value under a specific key to the key-value store. + + This endpoint is an alias for the [`PUT` record](#tag/Key-value-storesRecord/operation/keyValueStore_record_put) method and behaves identically. + operationId: keyValueStore_record_post + parameters: + - $ref: "#/components/parameters/storeId" + - $ref: "#/components/parameters/recordKey" + - $ref: "#/components/parameters/Content-Encoding" + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/PutRecordRequest" + '*/*': + schema: {} + description: "" + required: true + responses: + "201": + content: + application/json: + example: {} + schema: + type: object + description: "" + headers: + Location: + content: + text/plain: + example: https://api.apify.com/v2/key-value-stores/WkzbQMuFYuamGv3YF/records/some-key + schema: + type: string + explode: false + style: simple + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "413": + $ref: "#/components/responses/PayloadTooLarge" + "415": + $ref: "#/components/responses/UnsupportedMediaType" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Store record (POST) + tags: + - Storage/Key-value stores + x-legacy-doc-urls: + - https://docs.apify.com/api/v2#/reference/key-value-stores/record/put-record + - https://docs.apify.com/api/v2#/reference/key-value-stores/put-record + - https://docs.apify.com/api/v2#tag/Key-value-storesRecord/operation/keyValueStore_record_post + put: + deprecated: false + description: | + Stores a value under a specific key to the key-value store. + + The value is passed as the PUT payload and it is stored with a MIME content + type defined by the `Content-Type` header and with encoding defined by the + `Content-Encoding` header. + + To save bandwidth, storage, and speed up your upload, send the request + payload compressed with Gzip compression and add the `Content-Encoding: gzip` + header. It is possible to set up another compression type with `Content-Encoding` + request header. + + Below is a list of supported `Content-Encoding` types. + + * Gzip compression: `Content-Encoding: gzip` + * Deflate compression: `Content-Encoding: deflate` + * Brotli compression: `Content-Encoding: br` + operationId: keyValueStore_record_put + parameters: + - $ref: "#/components/parameters/storeId" + - $ref: "#/components/parameters/recordKey" + - $ref: "#/components/parameters/Content-Encoding" + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/PutRecordRequest" + '*/*': + schema: {} + description: "" + required: true + responses: + "201": + content: + application/json: + example: {} + schema: + type: object + description: "" + headers: + Location: + content: + text/plain: + example: https://api.apify.com/v2/key-value-stores/WkzbQMuFYuamGv3YF/records/some-key + schema: + type: string + explode: false + style: simple + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "413": + $ref: "#/components/responses/PayloadTooLarge" + "415": + $ref: "#/components/responses/UnsupportedMediaType" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Store record + tags: + - Storage/Key-value stores + x-legacy-doc-urls: + - https://docs.apify.com/api/v2#/reference/key-value-stores/record/put-record + - https://docs.apify.com/api/v2#/reference/key-value-stores/put-record + - https://docs.apify.com/api/v2#tag/Key-value-storesRecord/operation/keyValueStore_record_put + x-js-parent: KeyValueStoreClient + x-js-name: setRecord + x-js-doc-url: https://docs.apify.com/api/client/js/reference/class/KeyValueStoreClient#setRecord + x-py-parent: KeyValueStoreClientAsync + x-py-name: set_record + x-py-doc-url: https://docs.apify.com/api/client/python/reference/class/KeyValueStoreClientAsync#set_record + /v2/datasets: + get: + deprecated: false + description: | + Lists all of a user's datasets. + + The response is a JSON array of objects, + where each object contains basic information about one dataset. + + By default, the objects are sorted by the `createdAt` field in ascending + order, therefore you can use pagination to incrementally fetch all datasets while new + ones are still being created. To sort them in descending order, use `desc=1` + parameter. The endpoint supports pagination using `limit` and `offset` + parameters and it will not return more than 1000 array elements. + operationId: datasets_get + parameters: + - $ref: "#/components/parameters/offset" + - $ref: "#/components/parameters/limit" + - $ref: "#/components/parameters/descCreatedAt" + - $ref: "#/components/parameters/unnamed" + - description: | + Filter by ownership. If this parameter is omitted, all accessible datasets are returned. + + - `ownedByMe`: Return only datasets owned by the user. + - `sharedWithMe`: Return only datasets shared with the user by other users. + explode: true + in: query + name: ownership + required: false + schema: + $ref: "#/components/schemas/StorageOwnership" + style: form + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/ListOfDatasetsResponse" + description: "" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Get list of datasets + tags: + - Storage/Datasets + x-legacy-doc-urls: + - https://docs.apify.com/api/v2#/reference/datasets/dataset-collection/get-list-of-datasets + - https://docs.apify.com/api/v2#/reference/datasets/get-list-of-datasets + - https://docs.apify.com/api/v2#tag/DatasetsDataset-collection/operation/datasets_get + x-js-parent: DatasetCollectionClient + x-js-name: list + x-js-doc-url: https://docs.apify.com/api/client/js/reference/class/DatasetCollectionClient#list + x-py-parent: DatasetCollectionClientAsync + x-py-name: list + x-py-doc-url: https://docs.apify.com/api/client/python/reference/class/DatasetCollectionClientAsync#list + post: + deprecated: false + description: | + Creates a dataset and returns its object. + Keep in mind that data stored under unnamed dataset follows [data retention period](https://docs.apify.com/platform/storage#data-retention). + It creates a dataset with the given name if the parameter name is used. + If a dataset with the given name already exists then returns its object. + operationId: datasets_post + parameters: + - description: Custom unique name to easily identify the dataset in the future. + explode: true + in: query + name: name + required: false + schema: + example: eshop-items + type: string + style: form + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/DatasetResponse" + description: Returns the existing dataset object if a dataset with the given + name already exists. + "201": + content: + application/json: + schema: + $ref: "#/components/schemas/DatasetResponse" + description: "" + headers: + Location: + content: + text/plain: + example: https://api.apify.com/v2/datasets/WkzbQMuFYuamGv3YF + schema: + type: string + explode: false + style: simple + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Create dataset + tags: + - Storage/Datasets + x-legacy-doc-urls: + - https://docs.apify.com/api/v2#/reference/datasets/dataset-collection/create-dataset + - https://docs.apify.com/api/v2#/reference/datasets/create-dataset + - https://docs.apify.com/api/v2#tag/DatasetsDataset-collection/operation/datasets_post + x-js-parent: DatasetCollectionClient + x-js-name: getOrCreate + x-js-doc-url: https://docs.apify.com/api/client/js/reference/class/DatasetCollectionClient#getOrCreate + x-py-parent: DatasetCollectionClientAsync + x-py-name: get_or_create + x-py-doc-url: https://docs.apify.com/api/client/python/reference/class/DatasetCollectionClientAsync#get_or_create + /v2/datasets/{datasetId}: + delete: + deprecated: false + description: Deletes a specific dataset. + operationId: dataset_delete + parameters: + - $ref: "#/components/parameters/datasetId" + responses: + "204": + $ref: "#/components/responses/NoContent" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Delete dataset + tags: + - Storage/Datasets + x-legacy-doc-urls: + - https://docs.apify.com/api/v2#/reference/datasets/dataset/delete-dataset + - https://docs.apify.com/api/v2#/reference/datasets/delete-dataset + - https://docs.apify.com/api/v2#tag/DatasetsDataset/operation/dataset_delete + x-js-parent: DatasetClient + x-js-name: delete + x-js-doc-url: https://docs.apify.com/api/client/js/reference/class/DatasetClient#delete + get: + deprecated: false + description: | + Returns dataset object for given dataset ID. + + This does not return dataset items, only information about the storage itself. + To retrieve dataset items, use the [List dataset items](/api/v2/dataset-items-get) endpoint. + + :::note + + Keep in mind that attributes `itemCount` and `cleanItemCount` are not propagated right away after data are pushed into a dataset. + + ::: + + There is a short period (up to 5 seconds) during which these counters may not match with exact counts in dataset items. + operationId: dataset_get + parameters: + - $ref: "#/components/parameters/datasetId" + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/DatasetResponse" + description: "" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Get dataset + tags: + - Storage/Datasets + x-legacy-doc-urls: + - https://docs.apify.com/api/v2#/reference/datasets/dataset/get-dataset + - https://docs.apify.com/api/v2#/reference/datasets/get-dataset + - https://docs.apify.com/api/v2#tag/DatasetsDataset/operation/dataset_get + x-js-parent: DatasetClient + x-js-name: get + x-js-doc-url: https://docs.apify.com/api/client/js/reference/class/DatasetClient#get + x-py-parent: DatasetClientAsync + x-py-name: get + x-py-doc-url: https://docs.apify.com/api/client/python/reference/class/DatasetClientAsync#get + put: + deprecated: false + description: | + Updates a dataset's name and general resource access level using a value specified by a JSON object passed in the PUT payload. + The response is the updated dataset object, as returned by the [Get dataset](/api/v2/dataset-get) API endpoint. + operationId: dataset_put + parameters: + - $ref: "#/components/parameters/datasetId" + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/UpdateDatasetRequest" + description: "" + required: true + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/DatasetResponse" + description: "" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "413": + $ref: "#/components/responses/PayloadTooLarge" + "415": + $ref: "#/components/responses/UnsupportedMediaType" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Update dataset + tags: + - Storage/Datasets + x-legacy-doc-urls: + - https://docs.apify.com/api/v2#/reference/datasets/dataset/update-dataset + - https://docs.apify.com/api/v2#/reference/datasets/update-dataset + - https://docs.apify.com/api/v2#tag/DatasetsDataset/operation/dataset_put + x-js-parent: DatasetClient + x-js-name: update + x-js-doc-url: https://docs.apify.com/api/client/js/reference/class/DatasetClient#update + x-py-parent: DatasetClientAsync + x-py-name: update + x-py-doc-url: https://docs.apify.com/api/client/python/reference/class/DatasetClientAsync#update + /v2/datasets/{datasetId}/items: + get: + deprecated: false + description: | + Returns data stored in the dataset in a desired format. + + ### Response format + + The format of the response depends on format query parameter. + + The format parameter can have one of the following values: + json, jsonl, xml, html, + csv, xlsx and rss. + + The following table describes how each format is treated. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FormatItems
jsonThe response is a JSON, JSONL or XML array of raw item objects.
jsonl
xml
htmlThe response is a HTML, CSV or XLSX table, where columns correspond to the + properties of the item and rows correspond to each dataset item.
csv
xlsx
rssThe response is a RSS file. Each item is displayed as child elements of one + <item>.
+ + Note that CSV, XLSX and HTML tables are limited to 2000 columns and the column names cannot be longer than 200 characters. + JSON, XML and RSS formats do not have such restrictions. + + ### Hidden fields + + The top-level fields starting with the `#` character are considered hidden. + These are useful to store debugging information and can be omitted from the output by providing the `skipHidden=1` or `clean=1` query parameters. + For example, if you store the following object to the dataset: + + ``` + { + productName: "iPhone Xs", + description: "Welcome to the big screens." + #debug: { + url: "https://www.apple.com/lae/iphone-xs/", + crawledAt: "2019-01-21T16:06:03.683Z" + } + } + ``` + + The `#debug` field will be considered as hidden and can be omitted from the + results. This is useful to + provide nice cleaned data to end users, while keeping debugging info + available if needed. The Dataset object + returned by the API contains the number of such clean items in the`dataset.cleanItemCount` property. + + ### XML format extension + + When exporting results to XML or RSS formats, the names of object properties become XML tags and the corresponding values become tag's children. For example, the following JavaScript object: + + ``` + { + name: "Paul Newman", + address: [ + { type: "home", street: "21st", city: "Chicago" }, + { type: "office", street: null, city: null } + ] + } + ``` + + will be transformed to the following XML snippet: + + ``` + Paul Newman +
+ home + 21st + Chicago +
+
+ office + + +
+ ``` + + If the JavaScript object contains a property named `@` then its sub-properties are exported as attributes of the parent XML + element. + If the parent XML element does not have any child elements then its value is taken from a JavaScript object property named `#`. + + For example, the following JavaScript object: + + ``` + { + "address": [{ + "@": { + "type": "home" + }, + "street": "21st", + "city": "Chicago" + }, + { + "@": { + "type": "office" + }, + "#": 'unknown' + }] + } + ``` + + will be transformed to the following XML snippet: + + ``` +
+ 21st + Chicago +
+
unknown
+ ``` + + This feature is also useful to customize your RSS feeds generated for various websites. + + By default the whole result is wrapped in a `` element and each page object is wrapped in a `` element. + You can change this using xmlRoot and xmlRow url parameters. + + ### Pagination + + The generated response supports [pagination](#/introduction/pagination). + The pagination is always performed with the granularity of a single item, regardless whether unwind parameter was provided. + By default, the **Items** in the response are sorted by the time they were stored to the database, therefore you can use pagination to incrementally fetch the items as they are being added. + No limit exists to how many items can be returned in one response. + + If you specify `desc=1` query parameter, the results are returned in the reverse order than they were stored (i.e. from newest to oldest items). + Note that only the order of **Items** is reversed, but not the order of the `unwind` array elements. + operationId: dataset_items_get + parameters: + - $ref: "#/components/parameters/datasetId" + - $ref: "#/components/parameters/format" + - $ref: "#/components/parameters/clean" + - $ref: "#/components/parameters/offset" + - $ref: "#/components/parameters/datasetParameters_limit" + - $ref: "#/components/parameters/fields" + - $ref: "#/components/parameters/outputFields" + - $ref: "#/components/parameters/omit" + - $ref: "#/components/parameters/unwind" + - $ref: "#/components/parameters/flatten" + - $ref: "#/components/parameters/descDataset" + - $ref: "#/components/parameters/attachment" + - $ref: "#/components/parameters/delimiter" + - $ref: "#/components/parameters/bom" + - $ref: "#/components/parameters/xmlRoot" + - $ref: "#/components/parameters/xmlRow" + - $ref: "#/components/parameters/skipHeaderRow" + - $ref: "#/components/parameters/skipHidden" + - $ref: "#/components/parameters/skipEmpty" + - $ref: "#/components/parameters/simplified" + - $ref: "#/components/parameters/view" + - $ref: "#/components/parameters/skipFailedPages" + - $ref: "#/components/parameters/feedTitle" + - $ref: "#/components/parameters/feedDescription" + - $ref: "#/components/parameters/signature" + responses: + "200": + content: + application/json: + schema: + example: + - foo: bar + - foo2: bar2 + items: + type: object + type: array + default: null + application/jsonl: + example: "{\"foo\":\"bar\"}\\n{\"foo2\":\"bar2\"}\\n" + schema: + type: string + text/csv: + example: "foo,bar\\nfoo2,bar2\\n" + schema: + type: string + text/html: + example:
foobar
foobar
foo2bar2
+ schema: + type: string + application/vnd.openxmlformats-officedocument.spreadsheetml.sheet: + schema: + type: string + application/rss+xml: + example: barbar2 + schema: + type: string + application/xml: + example: barbar2 + schema: + type: string + description: "" + headers: + X-Apify-Pagination-Offset: + content: + text/plain: + example: "0" + schema: {} + description: The offset of the first item in the current page. + explode: false + style: simple + X-Apify-Pagination-Limit: + content: + text/plain: + example: "100" + schema: {} + description: The maximum number of items returned per page. + explode: false + style: simple + X-Apify-Pagination-Count: + content: + text/plain: + example: "100" + schema: {} + description: The number of items returned in the current page. + explode: false + style: simple + X-Apify-Pagination-Total: + content: + text/plain: + example: "10204" + schema: {} + description: The total number of items in the dataset. + explode: false + style: simple + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Get dataset items + tags: + - Storage/Datasets + x-legacy-doc-urls: + - https://docs.apify.com/api/v2#/reference/datasets/item-collection/get-items + - https://docs.apify.com/api/v2#/reference/datasets/get-items + - https://docs.apify.com/api/v2#tag/DatasetsItem-collection/operation/dataset_items_get + x-js-parent: DatasetClient + x-js-name: listItems + x-js-doc-url: https://docs.apify.com/api/client/js/reference/class/DatasetClient#listItems + x-py-parent: DatasetClientAsync + x-py-name: stream_items + x-py-doc-url: https://docs.apify.com/api/client/python/reference/class/DatasetClientAsync#stream_items + head: + deprecated: false + description: | + Returns only the HTTP headers for the dataset items endpoint, without the response body. + This is useful to check pagination metadata or verify access without downloading the full dataset. + operationId: dataset_items_head + parameters: + - $ref: "#/components/parameters/datasetId" + - $ref: "#/components/parameters/format" + - $ref: "#/components/parameters/clean" + - $ref: "#/components/parameters/offset" + - $ref: "#/components/parameters/datasetParameters_limit" + - $ref: "#/components/parameters/fields" + - $ref: "#/components/parameters/outputFields" + - $ref: "#/components/parameters/omit" + - $ref: "#/components/parameters/unwind" + - $ref: "#/components/parameters/flatten" + - $ref: "#/components/parameters/descDataset" + - $ref: "#/components/parameters/attachment" + - $ref: "#/components/parameters/delimiter" + - $ref: "#/components/parameters/bom" + - $ref: "#/components/parameters/xmlRoot" + - $ref: "#/components/parameters/xmlRow" + - $ref: "#/components/parameters/skipHeaderRow" + - $ref: "#/components/parameters/skipHidden" + - $ref: "#/components/parameters/skipEmpty" + - $ref: "#/components/parameters/simplified" + - $ref: "#/components/parameters/view" + - $ref: "#/components/parameters/skipFailedPages" + - $ref: "#/components/parameters/feedTitle" + - $ref: "#/components/parameters/feedDescription" + - $ref: "#/components/parameters/signature" + responses: + "200": + content: {} + description: "" + headers: + X-Apify-Pagination-Offset: + content: + text/plain: + example: "0" + schema: {} + description: The offset of the first item in the current page. + explode: false + style: simple + X-Apify-Pagination-Limit: + content: + text/plain: + example: "100" + schema: {} + description: The maximum number of items returned per page. + explode: false + style: simple + X-Apify-Pagination-Count: + content: + text/plain: + example: "100" + schema: {} + description: The number of items returned in the current page. + explode: false + style: simple + X-Apify-Pagination-Total: + content: + text/plain: + example: "10204" + schema: {} + description: The total number of items in the dataset. + explode: false + style: simple + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Get dataset items headers + tags: + - Storage/Datasets + post: + deprecated: false + description: | + Appends an item or an array of items to the end of the dataset. + The POST payload is a JSON object or a JSON array of objects to save into the dataset. + + If the data you attempt to store in the dataset is invalid (meaning any of the items received by the API fails the validation), the whole request is discarded and the API will return a response with status code 400. + For more information about dataset schema validation, see [Dataset schema](https://docs.apify.com/platform/actors/development/actor-definition/dataset-schema/validation). + + **IMPORTANT:** The limit of request payload size for the dataset is 5 MB. If the array exceeds the size, you'll need to split it into a number of smaller arrays. + operationId: dataset_items_post + parameters: + - $ref: "#/components/parameters/datasetId" + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/act_runs_last_dataset_items_post_request" + description: "" + required: true + responses: + "201": + content: + application/json: + schema: + example: {} + type: object + description: "" + headers: + Location: + content: + text/plain: + example: https://api.apify.com/v2/datasets/WkzbQMuFYuamGv3YF/items + schema: + type: string + explode: false + style: simple + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/act_runs_last_dataset_items_post_400_response" + description: "" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Store items + tags: + - Storage/Datasets + x-legacy-doc-urls: + - https://docs.apify.com/api/v2#/reference/datasets/item-collection/put-items + - https://docs.apify.com/api/v2#/reference/datasets/put-items + - https://docs.apify.com/api/v2#tag/DatasetsItem-collection/operation/dataset_items_post + x-js-parent: DatasetClient + x-js-name: pushItems + x-js-doc-url: https://docs.apify.com/api/client/js/reference/class/DatasetClient#pushItems + x-py-parent: DatasetClientAsync + x-py-name: push_items + x-py-doc-url: https://docs.apify.com/api/client/python/reference/class/DatasetClientAsync#push_items + /v2/datasets/{datasetId}/statistics: + get: + description: | + Returns statistics for given dataset. + + Provides only [field statistics](https://docs.apify.com/platform/actors/development/actor-definition/dataset-schema/validation#dataset-field-statistics). + operationId: dataset_statistics_get + parameters: + - $ref: "#/components/parameters/datasetId" + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/DatasetStatisticsResponse" + description: "" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Get dataset statistics + tags: + - Storage/Datasets + /v2/request-queues: + get: + deprecated: false + description: | + Lists all of a user's request queues. The response is a JSON array of + objects, where each object + contains basic information about one queue. + + By default, the objects are sorted by the `createdAt` field in ascending order, + therefore you can use pagination to incrementally fetch all queues while new + ones are still being created. To sort them in descending order, use `desc=1` + parameter. The endpoint supports pagination using `limit` and `offset` + parameters and it will not return more than 1000 + array elements. + operationId: requestQueues_get + parameters: + - $ref: "#/components/parameters/offset" + - $ref: "#/components/parameters/limit" + - $ref: "#/components/parameters/descCreatedAt" + - $ref: "#/components/parameters/unnamed" + - description: | + Filter by ownership. If this parameter is omitted, all accessible request queues are returned. + + - `ownedByMe`: Return only request queues owned by the user. + - `sharedWithMe`: Return only request queues shared with the user by other users. + explode: true + in: query + name: ownership + required: false + schema: + $ref: "#/components/schemas/StorageOwnership" + style: form + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/ListOfRequestQueuesResponse" + description: "" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Get list of request queues + tags: + - Storage/Request queues + x-legacy-doc-urls: + - https://docs.apify.com/api/v2#/reference/request-queues/queue-collection/get-list-of-request-queues + - https://docs.apify.com/api/v2#/reference/request-queues/get-list-of-request-queues + - https://docs.apify.com/api/v2#tag/Request-queuesQueue-collection/operation/requestQueues_get + x-js-parent: RequestQueueCollectionClient + x-js-name: list + x-js-doc-url: https://docs.apify.com/api/client/js/reference/class/RequestQueueCollectionClient#list + x-py-parent: RequestQueueCollectionClientAsync + x-py-name: list + x-py-doc-url: https://docs.apify.com/api/client/python/reference/class/RequestQueueCollectionClientAsync#list + post: + deprecated: false + description: | + Creates a request queue and returns its object. + Keep in mind that requests stored under unnamed queue follows [data + retention period](https://docs.apify.com/platform/storage#data-retention). + + It creates a queue of given name if the parameter name is used. If a queue + with the given name already exists then the endpoint returns + its object. + operationId: requestQueues_post + parameters: + - description: Custom unique name to easily identify the queue in the future. + explode: true + in: query + name: name + required: false + schema: + example: example-com + type: string + style: form + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/RequestQueueResponse" + description: Returns the existing request queue object if a queue with the + given name already exists. + "201": + content: + application/json: + schema: + $ref: "#/components/schemas/RequestQueueResponse" + description: "" + headers: + Location: + content: + text/plain: + example: https://api.apify.com/v2/request-queues/WkzbQMuFYuamGv3YF + schema: + type: string + explode: false + style: simple + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Create request queue + tags: + - Storage/Request queues + x-legacy-doc-urls: + - https://docs.apify.com/api/v2#/reference/request-queues/queue-collection/create-request-queue + - https://docs.apify.com/api/v2#/reference/request-queues/create-request-queue + - https://docs.apify.com/api/v2#tag/Request-queuesQueue-collection/operation/requestQueues_post + x-js-parent: RequestQueueCollectionClient + x-js-name: getOrCreate + x-js-doc-url: https://docs.apify.com/api/client/js/reference/class/RequestQueueCollectionClient#getOrCreate + x-py-parent: RequestQueueCollectionClientAsync + x-py-name: get_or_create + x-py-doc-url: https://docs.apify.com/api/client/python/reference/class/RequestQueueCollectionClientAsync#get_or_create + /v2/request-queues/{queueId}: + delete: + deprecated: false + description: Deletes given queue. + operationId: requestQueue_delete + parameters: + - $ref: "#/components/parameters/queueId" + responses: + "204": + $ref: "#/components/responses/NoContent" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Delete request queue + tags: + - Storage/Request queues + x-legacy-doc-urls: + - https://docs.apify.com/api/v2#/reference/request-queues/queue/delete-request-queue + - https://docs.apify.com/api/v2#/reference/request-queues/delete-request-queue + - https://docs.apify.com/api/v2#tag/Request-queuesQueue/operation/requestQueue_delete + x-js-parent: RequestQueueClient + x-js-name: delete + x-js-doc-url: https://docs.apify.com/api/client/js/reference/class/RequestQueueClient#delete + get: + deprecated: false + description: Returns queue object for given queue ID. + operationId: requestQueue_get + parameters: + - $ref: "#/components/parameters/queueId" + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/RequestQueueResponse" + description: "" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Get request queue + tags: + - Storage/Request queues + x-legacy-doc-urls: + - https://docs.apify.com/api/v2#/reference/request-queues/queue/get-request-queue + - https://docs.apify.com/api/v2#/reference/request-queues/get-request-queue + - https://docs.apify.com/api/v2#tag/Request-queuesQueue/operation/requestQueue_get + x-js-parent: RequestQueueClient + x-js-name: get + x-js-doc-url: https://docs.apify.com/api/client/js/reference/class/RequestQueueClient#get + x-py-parent: RequestQueueClientAsync + x-py-name: get + x-py-doc-url: https://docs.apify.com/api/client/python/reference/class/RequestQueueClientAsync#get + put: + deprecated: false + description: | + Updates a request queue's name and general resource access level using a value specified by a JSON object + passed in the PUT payload. + + The response is the updated request queue object, as returned by the + [Get request queue](#/reference/request-queues/queue-collection/get-request-queue) API endpoint. + operationId: requestQueue_put + parameters: + - $ref: "#/components/parameters/queueId" + requestBody: + content: + application/json: + example: + name: new-request-queue-name + schema: + allOf: + - $ref: "#/components/schemas/UpdateRequestQueueRequest" + example: + name: new-request-queue-name + description: "" + required: true + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/RequestQueueResponse" + description: "" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "413": + $ref: "#/components/responses/PayloadTooLarge" + "415": + $ref: "#/components/responses/UnsupportedMediaType" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Update request queue + tags: + - Storage/Request queues + x-legacy-doc-urls: + - https://docs.apify.com/api/v2#/reference/request-queues/queue/update-request-queue + - https://docs.apify.com/api/v2#/reference/request-queues/update-request-queue + - https://docs.apify.com/api/v2#tag/Request-queuesQueue/operation/requestQueue_put + x-js-parent: RequestQueueClient + x-js-name: update + x-js-doc-url: https://docs.apify.com/api/client/js/reference/class/RequestQueueClient#update + x-py-parent: RequestQueueClientAsync + x-py-name: update + x-py-doc-url: https://docs.apify.com/api/client/python/reference/class/RequestQueueClientAsync#update + /v2/request-queues/{queueId}/requests/batch: + delete: + deprecated: false + description: | + Batch-deletes given requests from the queue. The number of requests in a + batch is limited to 25. The response contains an array of unprocessed and + processed requests. + If any delete operation fails because the request queue rate limit is + exceeded or an internal failure occurs, + the failed request is returned in the `unprocessedRequests` response + parameter. + You can re-send these delete requests. It is recommended to use an + exponential backoff algorithm for these retries. + Each request is identified by its ID or uniqueKey parameter. You can use + either of them to identify the request. + operationId: requestQueue_requests_batch_delete + parameters: + - $ref: "#/components/parameters/queueId" + - $ref: "#/components/parameters/contentTypeJson" + - $ref: "#/components/parameters/clientKey" + requestBody: + content: + application/json: + schema: + items: + $ref: "#/components/schemas/RequestDraftDelete" + type: array + default: null + description: "" + required: true + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/BatchDeleteResponse" + description: "" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "413": + $ref: "#/components/responses/PayloadTooLarge" + "415": + $ref: "#/components/responses/UnsupportedMediaType" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Delete requests + tags: + - Storage/Request queues + x-legacy-doc-urls: + - https://docs.apify.com/api/v2#/reference/request-queues/batch-request-operations/delete-requests + - https://docs.apify.com/api/v2#/reference/request-queues/delete-requests + - https://docs.apify.com/api/v2#tag/Request-queuesBatch-request-operations/operation/requestQueue_requests_batch_delete + x-js-parent: RequestQueueClient + x-js-name: batchDeleteRequests + x-js-doc-url: https://docs.apify.com/api/client/js/reference/class/RequestQueueClient#batchDeleteRequests + x-py-parent: RequestQueueClientAsync + x-py-name: batch_delete_requests + x-py-doc-url: https://docs.apify.com/api/client/python/reference/class/RequestQueueClientAsync#batch_delete_requests + post: + deprecated: false + description: | + Adds requests to the queue in batch. The maximum requests in batch is limited + to 25. The response contains an array of unprocessed and processed requests. + If any add operation fails because the request queue rate limit is exceeded + or an internal failure occurs, + the failed request is returned in the unprocessedRequests response + parameter. + You can resend these requests to add. It is recommended to use an + exponential backoff algorithm for these retries. + If a request with the same `uniqueKey` was already present in the queue, + then it returns an ID of the existing request. + operationId: requestQueue_requests_batch_post + parameters: + - $ref: "#/components/parameters/queueId" + - $ref: "#/components/parameters/clientKey" + - $ref: "#/components/parameters/forefront" + requestBody: + content: + application/json: + schema: + description: "" + items: + $ref: "#/components/schemas/RequestBase" + type: array + default: null + description: "" + required: true + responses: + "201": + content: + application/json: + schema: + $ref: "#/components/schemas/BatchAddResponse" + description: "" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "413": + $ref: "#/components/responses/PayloadTooLarge" + "415": + $ref: "#/components/responses/UnsupportedMediaType" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Add requests + tags: + - Storage/Request queues + x-legacy-doc-urls: + - https://docs.apify.com/api/v2#/reference/request-queues/batch-request-operations/add-requests + - https://docs.apify.com/api/v2#/reference/request-queues/add-requests + - https://docs.apify.com/api/v2#tag/Request-queuesBatch-request-operations/operation/requestQueue_requests_batch_post + x-js-parent: RequestQueueClient + x-js-name: batchAddRequests + x-js-doc-url: https://docs.apify.com/api/client/js/reference/class/RequestQueueClient#batchAddRequests + x-py-parent: RequestQueueClientAsync + x-py-name: batch_add_requests + x-py-doc-url: https://docs.apify.com/api/client/python/reference/class/RequestQueueClientAsync#batch_add_requests + /v2/request-queues/{queueId}/requests/unlock: + post: + deprecated: false + description: | + Unlocks requests in the queue that are currently locked by the client. + + * If the client is within an Actor run, it unlocks all requests locked by that specific run plus all requests locked by the same clientKey. + * If the client is outside of an Actor run, it unlocks all requests locked using the same clientKey. + operationId: requestQueue_requests_unlock_post + parameters: + - $ref: "#/components/parameters/queueId" + - $ref: "#/components/parameters/clientKey" + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/UnlockRequestsResponse" + description: Number of requests that were unlocked + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Unlock requests + tags: + - Storage/Request queues/Requests locks + x-js-parent: RequestQueueClient + x-js-name: unlockRequests + x-js-doc-url: https://docs.apify.com/api/client/js/reference/class/RequestQueueClient#unlockRequests + x-py-parent: RequestQueueClientAsync + x-py-name: unlock_requests + x-py-doc-url: https://docs.apify.com/api/client/python/reference/class/RequestQueueClientAsync#unlock_requests + /v2/request-queues/{queueId}/requests: + get: + deprecated: false + description: | + Returns a list of requests. This endpoint is paginated using + cursor (pagination by `exclusiveStartId` is deprecated) and limit parameters. + operationId: requestQueue_requests_get + parameters: + - $ref: "#/components/parameters/queueId" + - $ref: "#/components/parameters/clientKey" + - $ref: "#/components/parameters/exclusiveStartId" + - $ref: "#/components/parameters/listLimit" + - $ref: "#/components/parameters/cursor" + - $ref: "#/components/parameters/filter" + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/ListOfRequestsResponse" + description: "" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: List requests + tags: + - Storage/Request queues/Requests + x-legacy-doc-urls: + - https://docs.apify.com/api/v2#/reference/request-queues/request-collection/list-requests + - https://docs.apify.com/api/v2#/reference/request-queues/list-requests + - https://docs.apify.com/api/v2#tag/Request-queuesRequest-collection/operation/requestQueue_requests_get + x-js-parent: RequestQueueClient + x-js-name: paginateRequests + x-js-doc-url: https://docs.apify.com/api/client/js/reference/class/RequestQueueClient#paginateRequests + x-py-parent: RequestQueueClientAsync + x-py-name: list_requests + x-py-doc-url: https://docs.apify.com/api/client/python/reference/class/RequestQueueClientAsync#list_requests + post: + deprecated: false + description: | + Adds request to the queue. Response contains ID of the request and info if + request was already present in the queue or handled. + + If request with same `uniqueKey` was already present in the queue then + returns an ID of existing request. + operationId: requestQueue_requests_post + parameters: + - $ref: "#/components/parameters/queueId" + - $ref: "#/components/parameters/clientKey" + - $ref: "#/components/parameters/forefront" + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/RequestBase" + description: "" + required: true + responses: + "201": + content: + application/json: + schema: + $ref: "#/components/schemas/AddRequestResponse" + description: "" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "413": + $ref: "#/components/responses/PayloadTooLarge" + "415": + $ref: "#/components/responses/UnsupportedMediaType" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Add request + tags: + - Storage/Request queues/Requests + x-legacy-doc-urls: + - https://docs.apify.com/api/v2#/reference/request-queues/request-collection/add-request + - https://docs.apify.com/api/v2#/reference/request-queues/add-request + - https://docs.apify.com/api/v2#tag/Request-queuesRequest-collection/operation/requestQueue_requests_post + x-js-parent: RequestQueueClient + x-js-name: addRequest + x-js-doc-url: https://docs.apify.com/api/client/js/reference/class/RequestQueueClient#addRequest + x-py-parent: RequestQueueClientAsync + x-py-name: add_request + x-py-doc-url: https://docs.apify.com/api/client/python/reference/class/RequestQueueClientAsync#add_request + /v2/request-queues/{queueId}/requests/{requestId}: + delete: + deprecated: false + description: Deletes given request from queue. + operationId: requestQueue_request_delete + parameters: + - $ref: "#/components/parameters/queueId" + - $ref: "#/components/parameters/requestId" + - $ref: "#/components/parameters/clientKey" + responses: + "204": + $ref: "#/components/responses/NoContent" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Delete request + tags: + - Storage/Request queues/Requests + x-legacy-doc-urls: + - https://docs.apify.com/api/v2#/reference/request-queues/queue/delete-request + - https://docs.apify.com/api/v2#/reference/request-queues/delete-request + - https://docs.apify.com/api/v2#tag/Request-queuesQueue/operation/requestQueue_request_delete + x-js-parent: RequestQueueClient + x-js-name: delete + x-js-doc-url: https://docs.apify.com/api/client/js/reference/class/RequestQueueClient#delete + get: + deprecated: false + description: Returns request from queue. + operationId: requestQueue_request_get + parameters: + - $ref: "#/components/parameters/queueId" + - $ref: "#/components/parameters/requestId" + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/RequestResponse" + description: "" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Get request + tags: + - Storage/Request queues/Requests + x-legacy-doc-urls: + - https://docs.apify.com/api/v2#/reference/request-queues/queue/get-request + - https://docs.apify.com/api/v2#/reference/request-queues/get-request + - https://docs.apify.com/api/v2#tag/Request-queuesQueue/operation/requestQueue_request_get + x-js-parent: RequestQueueClient + x-js-name: get + x-js-doc-url: https://docs.apify.com/api/client/js/reference/class/RequestQueueClient#get + x-py-parent: RequestQueueClientAsync + x-py-name: get + x-py-doc-url: https://docs.apify.com/api/client/python/reference/class/RequestQueueClientAsync#get + put: + deprecated: false + description: | + Updates a request in a queue. Mark request as handled by setting + `request.handledAt = new Date()`. + If `handledAt` is set, the request will be removed from head of the queue (and unlocked, if applicable). + operationId: requestQueue_request_put + parameters: + - $ref: "#/components/parameters/queueId" + - $ref: "#/components/parameters/requestId" + - $ref: "#/components/parameters/forefront" + - $ref: "#/components/parameters/clientKey" + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/Request" + description: "" + required: true + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/UpdateRequestResponse" + description: "" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "413": + $ref: "#/components/responses/PayloadTooLarge" + "415": + $ref: "#/components/responses/UnsupportedMediaType" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Update request + tags: + - Storage/Request queues/Requests + x-legacy-doc-urls: + - https://docs.apify.com/api/v2#/reference/request-queues/queue/update-request + - https://docs.apify.com/api/v2#/reference/request-queues/update-request + - https://docs.apify.com/api/v2#tag/Request-queuesQueue/operation/requestQueue_request_put + x-js-parent: RequestQueueClient + x-js-name: update + x-js-doc-url: https://docs.apify.com/api/client/js/reference/class/RequestQueueClient#update + x-py-parent: RequestQueueClientAsync + x-py-name: update + x-py-doc-url: https://docs.apify.com/api/client/python/reference/class/RequestQueueClientAsync#update + /v2/request-queues/{queueId}/head: + get: + deprecated: false + description: | + Returns given number of first requests from the queue. + + The response contains the `hadMultipleClients` boolean field which indicates + that the queue was accessed by more than one client (with unique or empty + `clientKey`). + This field is used by [Apify SDK](https://sdk.apify.com) to determine + whether the local cache is consistent with the request queue, and thus + optimize performance of certain operations. + operationId: requestQueue_head_get + parameters: + - $ref: "#/components/parameters/queueId" + - $ref: "#/components/parameters/headLimit" + - $ref: "#/components/parameters/clientKey" + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/HeadResponse" + description: "" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Get head + tags: + - Storage/Request queues/Requests locks + x-legacy-doc-urls: + - https://docs.apify.com/api/v2#/reference/request-queues/queue-head/get-head + - https://docs.apify.com/api/v2#/reference/request-queues/get-head + - https://docs.apify.com/api/v2#tag/Request-queuesQueue-head/operation/requestQueue_head_get + x-js-parent: RequestQueueClient + x-js-name: listHead + x-js-doc-url: https://docs.apify.com/api/client/js/reference/class/RequestQueueClient#listHead + x-py-parent: RequestQueueClientAsync + x-py-name: list_head + x-py-doc-url: https://docs.apify.com/api/client/python/reference/class/RequestQueueClientAsync#list_head + /v2/request-queues/{queueId}/head/lock: + post: + deprecated: false + description: | + Returns the given number of first requests from the queue and locks them for + the given time. + + If this endpoint locks the request, no other client or run will be able to get and + lock these requests. + + The response contains the `hadMultipleClients` boolean field which indicates + that the queue was accessed by more than one client (with unique or empty + `clientKey`). + operationId: requestQueue_head_lock_post + parameters: + - $ref: "#/components/parameters/queueId" + - $ref: "#/components/parameters/lockSecs" + - $ref: "#/components/parameters/headLockLimit" + - $ref: "#/components/parameters/clientKey" + responses: + "201": + content: + application/json: + schema: + $ref: "#/components/schemas/HeadAndLockResponse" + description: "" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Get head and lock + tags: + - Storage/Request queues/Requests locks + x-legacy-doc-urls: + - https://docs.apify.com/api/v2#/reference/request-queues/queue-head-with-locks/get-head-and-lock + - https://docs.apify.com/api/v2#/reference/request-queues/get-head-and-lock + - https://docs.apify.com/api/v2#tag/Request-queuesQueue-head-with-locks/operation/requestQueue_head_lock_post + x-js-parent: RequestQueueClient + x-js-name: listAndLockHead + x-js-doc-url: https://docs.apify.com/api/client/js/reference/class/RequestQueueClient#listAndLockHead + x-py-parent: RequestQueueClientAsync + x-py-name: list_and_lock_head + x-py-doc-url: https://docs.apify.com/api/client/python/reference/class/RequestQueueClientAsync#list_and_lock_head + /v2/request-queues/{queueId}/requests/{requestId}/lock: + delete: + deprecated: false + description: | + Deletes a request lock. The request lock can be deleted only by the client + that has locked it using [Get and lock head + operation](#/request-queue-head-lock-post). + + The clientKey identifier is used for locking and unlocking requests. + You can delete or prolong the lock only for requests that were locked by the same client key or from the same Actor run. + operationId: requestQueue_request_lock_delete + parameters: + - $ref: "#/components/parameters/queueId" + - $ref: "#/components/parameters/requestId" + - $ref: "#/components/parameters/clientKey" + - $ref: "#/components/parameters/deleteForefront" + responses: + "204": + $ref: "#/components/responses/NoContent" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Delete request lock + tags: + - Storage/Request queues/Requests locks + x-legacy-doc-urls: + - https://docs.apify.com/api/v2#/reference/request-queues/request-lock/delete-request-lock + - https://docs.apify.com/api/v2#/reference/request-queues/delete-request-lock + - https://docs.apify.com/api/v2#tag/Request-queuesRequest-lock/operation/requestQueue_request_lock_delete + x-js-parent: RequestQueueClient + x-js-name: deleteRequestLock + x-js-doc-url: https://docs.apify.com/api/client/js/reference/class/RequestQueueClient#deleteRequestLock + x-py-parent: RequestQueueClientAsync + x-py-name: delete_request_lock + x-py-doc-url: https://docs.apify.com/api/client/python/reference/class/RequestQueueClientAsync#delete_request_lock + put: + deprecated: false + description: | + Prolongs request lock. The request lock can be prolonged only by the client + that has locked it using [Get and lock head + operation](#/request-queue-head-lock-post). + + The clientKey identifier is used for locking and unlocking requests. + You can delete or prolong the lock only for requests that were locked by the same client key or from the same Actor run. + operationId: requestQueue_request_lock_put + parameters: + - $ref: "#/components/parameters/queueId" + - $ref: "#/components/parameters/requestId" + - $ref: "#/components/parameters/lockSecs" + - $ref: "#/components/parameters/clientKey" + - $ref: "#/components/parameters/lockForefront" + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/ProlongRequestLockResponse" + description: "" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Prolong request lock + tags: + - Storage/Request queues/Requests locks + x-legacy-doc-urls: + - https://docs.apify.com/api/v2#/reference/request-queues/request-lock/prolong-request-lock + - https://docs.apify.com/api/v2#/reference/request-queues/prolong-request-lock + - https://docs.apify.com/api/v2#tag/Request-queuesRequest-lock/operation/requestQueue_request_lock_put + x-js-parent: RequestQueueClient + x-js-name: prolongRequestLock + x-js-doc-url: https://docs.apify.com/api/client/js/reference/class/RequestQueueClient#prolongRequestLock + x-py-parent: RequestQueueClientAsync + x-py-name: prolong_request_lock + x-py-doc-url: https://docs.apify.com/api/client/python/reference/class/RequestQueueClientAsync#prolong_request_lock + /v2/webhooks: + get: + deprecated: false + description: | + Gets the list of webhooks that the user created. + + The endpoint supports pagination using the `limit` and `offset` parameters + and it will not return more than 1000 records. + By default, the records are sorted by the `createdAt` field in ascending + order. To sort the records in descending order, use the `desc=1` + parameter. + operationId: webhooks_get + parameters: + - $ref: "#/components/parameters/offset" + - $ref: "#/components/parameters/limit" + - $ref: "#/components/parameters/descCreatedAt" + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/ListOfWebhooksResponse" + description: "" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Get list of webhooks + tags: + - Webhooks/Webhooks + x-legacy-doc-urls: + - https://docs.apify.com/api/v2#/reference/webhooks/webhook-collection/get-list-of-webhooks + - https://docs.apify.com/api/v2#/reference/webhooks/get-list-of-webhooks + - https://docs.apify.com/api/v2#tag/WebhooksWebhook-collection/operation/webhooks_get + x-js-parent: WebhookCollectionClient + x-js-name: list + x-js-doc-url: https://docs.apify.com/api/client/js/reference/class/WebhookCollectionClient#list + x-py-parent: WebhookCollectionClientAsync + x-py-name: list + x-py-doc-url: https://docs.apify.com/api/client/python/reference/class/WebhookCollectionClientAsync#list + post: + deprecated: false + description: | + Creates a new webhook with settings provided by the webhook object passed as + JSON in the payload. + The response is the created webhook object. + + To avoid duplicating a webhook, use the `idempotencyKey` parameter in the + request body. + Multiple calls to create a webhook with the same `idempotencyKey` will only + create the webhook with the first call and return the existing webhook on + subsequent calls. + Idempotency keys must be unique, so use a UUID or another random string with + enough entropy. + + To assign the new webhook to an Actor or task, the request body must contain + `requestUrl`, `eventTypes`, and `condition` properties. + + * `requestUrl` is the webhook's target URL, to which data is sent as a POST + request with a JSON payload. + * `eventTypes` is a list of events that will trigger the webhook, e.g. when + the Actor run succeeds. + * `condition` should be an object containing the ID of the Actor or task to + which the webhook will be assigned. + * `payloadTemplate` is a JSON-like string, whose syntax is extended with the + use of variables. + * `headersTemplate` is a JSON-like string, whose syntax is extended with the + use of variables. Following values will be re-written to defaults: "host", + "Content-Type", "X-Apify-Webhook", "X-Apify-Webhook-Dispatch-Id", + "X-Apify-Request-Origin" + * `description` is an optional string. + * `shouldInterpolateStrings` is a boolean indicating whether to interpolate + variables contained inside strings in the `payloadTemplate` + + ``` + "isAdHoc" : false, + "requestUrl" : "https://example.com", + "eventTypes" : [ + "ACTOR.RUN.SUCCEEDED", + "ACTOR.RUN.ABORTED" + ], + "condition" : { + "actorId": "5sTMwDQywwsLzKRRh", + "actorTaskId" : "W9bs9JE9v7wprjAnJ" + }, + "payloadTemplate": "", + "headersTemplate": "", + "description": "my awesome webhook", + "shouldInterpolateStrings": false, + ``` + + **Important**: The request must specify the `Content-Type: application/json` + HTTP header. + operationId: webhooks_post + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/WebhookCreate" + description: "" + required: true + responses: + "201": + content: + application/json: + schema: + $ref: "#/components/schemas/WebhookResponse" + description: "" + headers: + Location: + content: + text/plain: + example: https://api.apify.com/v2/webhook/zdc3Pyhyz3m8vjDeM + schema: + type: string + explode: false + style: simple + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "413": + $ref: "#/components/responses/PayloadTooLarge" + "415": + $ref: "#/components/responses/UnsupportedMediaType" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Create webhook + tags: + - Webhooks/Webhooks + x-legacy-doc-urls: + - https://docs.apify.com/api/v2#/reference/webhooks/webhook-collection/create-webhook + - https://docs.apify.com/api/v2#/reference/webhooks/create-webhook + - https://docs.apify.com/api/v2#tag/WebhooksWebhook-collection/operation/webhooks_post + x-js-parent: WebhookCollectionClient + x-js-name: create + x-js-doc-url: https://docs.apify.com/api/client/js/reference/class/WebhookCollectionClient#create + x-py-parent: WebhookCollectionClientAsync + x-py-name: create + x-py-doc-url: https://docs.apify.com/api/client/python/reference/class/WebhookCollectionClientAsync#create + /v2/webhooks/{webhookId}: + delete: + deprecated: false + description: Deletes a webhook. + operationId: webhook_delete + parameters: + - $ref: "#/components/parameters/webhookId" + responses: + "204": + content: + application/json: + example: {} + schema: + type: object + description: "" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Delete webhook + tags: + - Webhooks/Webhooks + x-legacy-doc-urls: + - https://docs.apify.com/api/v2#/reference/webhooks/webhook-object/delete-webhook + - https://docs.apify.com/api/v2#/reference/webhooks/delete-webhook + - https://docs.apify.com/api/v2#tag/WebhooksWebhook-object/operation/webhook_delete + x-js-parent: WebhookClient + x-js-name: delete + x-js-doc-url: https://docs.apify.com/api/client/js/reference/class/WebhookClient#delete + get: + deprecated: false + description: Gets webhook object with all details. + operationId: webhook_get + parameters: + - $ref: "#/components/parameters/webhookId" + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/WebhookResponse" + description: "" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Get webhook + tags: + - Webhooks/Webhooks + x-legacy-doc-urls: + - https://docs.apify.com/api/v2#/reference/webhooks/webhook-object/get-webhook + - https://docs.apify.com/api/v2#/reference/webhooks/get-webhook + - https://docs.apify.com/api/v2#tag/WebhooksWebhook-object/operation/webhook_get + x-js-parent: WebhookClient + x-js-name: get + x-js-doc-url: https://docs.apify.com/api/client/js/reference/class/WebhookClient#get + x-py-parent: WebhookClientAsync + x-py-name: get + x-py-doc-url: https://docs.apify.com/api/client/python/reference/class/WebhookClientAsync#get + put: + deprecated: false + description: | + Updates a webhook using values specified by a webhook object passed as JSON + in the POST payload. + If the object does not define a specific property, its value will not be + updated. + + The response is the full webhook object as returned by the + [Get webhook](#/reference/webhooks/webhook-object/get-webhook) endpoint. + + The request needs to specify the `Content-Type: application/json` HTTP + header! + + When providing your API authentication token, we recommend using the + request's `Authorization` header, rather than the URL. ([More + info](#/introduction/authentication)). + operationId: webhook_put + parameters: + - $ref: "#/components/parameters/webhookId" + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/WebhookUpdate" + description: "" + required: true + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/WebhookResponse" + description: "" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "413": + $ref: "#/components/responses/PayloadTooLarge" + "415": + $ref: "#/components/responses/UnsupportedMediaType" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Update webhook + tags: + - Webhooks/Webhooks + x-legacy-doc-urls: + - https://docs.apify.com/api/v2#/reference/webhooks/webhook-object/update-webhook + - https://docs.apify.com/api/v2#/reference/webhooks/update-webhook + - https://docs.apify.com/api/v2#tag/WebhooksWebhook-object/operation/webhook_put + x-js-parent: WebhookClient + x-js-name: update + x-js-doc-url: https://docs.apify.com/api/client/js/reference/class/WebhookClient#update + x-py-parent: WebhookClientAsync + x-py-name: update + x-py-doc-url: https://docs.apify.com/api/client/python/reference/class/WebhookClientAsync#update + /v2/webhooks/{webhookId}/test: + post: + deprecated: false + description: Tests a webhook. Creates a webhook dispatch with a dummy payload. + operationId: webhook_test_post + parameters: + - $ref: "#/components/parameters/webhookId" + responses: + "201": + content: + application/json: + schema: + $ref: "#/components/schemas/TestWebhookResponse" + description: "" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Test webhook + tags: + - Webhooks/Webhooks + x-legacy-doc-urls: + - https://docs.apify.com/api/v2#/reference/webhooks/webhook-test/test-webhook + - https://docs.apify.com/api/v2#/reference/webhooks/test-webhook + - https://docs.apify.com/api/v2#tag/WebhooksWebhook-test/operation/webhook_test_post + x-js-parent: WebhookClient + x-js-name: test + x-js-doc-url: https://docs.apify.com/api/client/js/reference/class/WebhookClient#test + x-py-parent: WebhookClientAsync + x-py-name: test + x-py-doc-url: https://docs.apify.com/api/client/python/reference/class/WebhookClientAsync#test + /v2/webhooks/{webhookId}/dispatches: + get: + deprecated: false + description: Gets a given webhook's list of dispatches. + operationId: webhook_webhookDispatches_get + parameters: + - $ref: "#/components/parameters/webhookId" + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/ListOfWebhookDispatchesResponse" + description: "" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Get collection + tags: + - Webhooks/Webhooks + x-legacy-doc-urls: + - https://docs.apify.com/api/v2#/reference/webhooks/dispatches-collection/get-collection + - https://docs.apify.com/api/v2#/reference/webhooks/get-collection + - https://docs.apify.com/api/v2#tag/WebhooksDispatches-collection/operation/webhook_dispatches_get + x-py-parent: WebhookClientAsync + x-py-name: dispatches + x-py-doc-url: https://docs.apify.com/api/client/python/reference/class/WebhookClientAsync#dispatches + /v2/webhook-dispatches: + get: + deprecated: false + description: | + Gets the list of webhook dispatches that the user have. + + The endpoint supports pagination using the `limit` and `offset` parameters + and it will not return more than 1000 records. + By default, the records are sorted by the `createdAt` field in ascending + order. To sort the records in descending order, use the `desc=1` + parameter. + operationId: webhookDispatches_get + parameters: + - $ref: "#/components/parameters/offset" + - $ref: "#/components/parameters/limit" + - $ref: "#/components/parameters/descCreatedAt" + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/ListOfWebhookDispatchesResponse" + description: "" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Get list of webhook dispatches + tags: + - Webhooks/Webhook dispatches + x-legacy-doc-urls: + - https://docs.apify.com/api/v2#/reference/webhook-dispatches/webhook-dispatches-collection/get-list-of-webhook-dispatches + - https://docs.apify.com/api/v2#/reference/webhook-dispatches/get-list-of-webhook-dispatches + - https://docs.apify.com/api/v2#tag/Webhook-dispatchesWebhook-dispatches-collection/operation/webhookDispatches_get + x-js-parent: WebhookDispatchCollectionClient + x-js-name: list + x-js-doc-url: https://docs.apify.com/api/client/js/reference/class/WebhookDispatchCollectionClient#list + x-py-parent: WebhookDispatchCollectionClientAsync + x-py-name: list + x-py-doc-url: https://docs.apify.com/api/client/python/reference/class/WebhookDispatchCollectionClientAsync#list + /v2/webhook-dispatches/{dispatchId}: + get: + deprecated: false + description: Gets webhook dispatch object with all details. + operationId: webhookDispatch_get + parameters: + - description: Webhook dispatch ID. + explode: false + in: path + name: dispatchId + required: true + schema: + example: Zib4xbZsmvZeK55ua + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/WebhookDispatchResponse" + description: "" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Get webhook dispatch + tags: + - Webhooks/Webhook dispatches + x-legacy-doc-urls: + - https://docs.apify.com/api/v2#/reference/webhook-dispatches/webhook-dispatch-object/get-webhook-dispatch + - https://docs.apify.com/api/v2#/reference/webhook-dispatches/get-webhook-dispatch + - https://docs.apify.com/api/v2#tag/Webhook-dispatchesWebhook-dispatch-object/operation/webhookDispatch_get + x-js-parent: WebhookDispatchClient + x-js-name: get + x-js-doc-url: https://docs.apify.com/api/client/js/reference/class/WebhookDispatchClient#get + x-py-parent: WebhookDispatchClientAsync + x-py-name: get + x-py-doc-url: https://docs.apify.com/api/client/python/reference/class/WebhookDispatchClientAsync#get + /v2/schedules: + get: + deprecated: false + description: | + Gets the list of schedules that the user created. + + The endpoint supports pagination using the `limit` and `offset` parameters. + It will not return more than 1000 records. + + By default, the records are sorted by the `createdAt` field in ascending + order. To sort the records in descending order, use the `desc=1` parameter. + operationId: schedules_get + parameters: + - $ref: "#/components/parameters/offset" + - $ref: "#/components/parameters/limit" + - $ref: "#/components/parameters/descCreatedAt" + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/ListOfSchedulesResponse" + description: "" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Get list of schedules + tags: + - Schedules + x-legacy-doc-urls: + - https://docs.apify.com/api/v2#/reference/schedules/schedules-collection/get-list-of-schedules + - https://docs.apify.com/api/v2#/reference/schedules/get-list-of-schedules + - https://docs.apify.com/api/v2#tag/SchedulesSchedules-collection/operation/schedules_get + x-js-parent: ScheduleCollectionClient + x-js-name: list + x-js-doc-url: https://docs.apify.com/api/client/js/reference/class/ScheduleCollectionClient#list + x-py-parent: ScheduleCollectionClientAsync + x-py-name: list + x-py-doc-url: https://docs.apify.com/api/client/python/reference/class/ScheduleCollectionClientAsync#list + post: + deprecated: false + description: | + Creates a new schedule with settings provided by the schedule object passed + as JSON in the payload. The response is the created schedule object. + + The request needs to specify the `Content-Type: application/json` HTTP header! + + When providing your API authentication token, we recommend using the + request's `Authorization` header, rather than the URL. ([More + info](#/introduction/authentication)). + operationId: schedules_post + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/ScheduleCreate" + description: "" + required: true + responses: + "201": + content: + application/json: + schema: + $ref: "#/components/schemas/ScheduleResponse" + description: "" + headers: + Location: + content: + text/plain: + example: https://api.apify.com/v2/schedules/asdLZtadYvn4mBZmm + schema: + type: string + explode: false + style: simple + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "409": + $ref: "#/components/responses/Conflict" + "413": + $ref: "#/components/responses/PayloadTooLarge" + "415": + $ref: "#/components/responses/UnsupportedMediaType" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Create schedule + tags: + - Schedules + x-legacy-doc-urls: + - https://docs.apify.com/api/v2#/reference/schedules/schedules-collection/create-schedule + - https://docs.apify.com/api/v2#/reference/schedules/create-schedule + - https://docs.apify.com/api/v2#tag/SchedulesSchedules-collection/operation/schedules_post + x-js-parent: ScheduleCollectionClient + x-js-name: create + x-js-doc-url: https://docs.apify.com/api/client/js/reference/class/ScheduleCollectionClient#create + x-py-parent: ScheduleCollectionClientAsync + x-py-name: create + x-py-doc-url: https://docs.apify.com/api/client/python/reference/class/ScheduleCollectionClientAsync#create + /v2/schedules/{scheduleId}: + delete: + deprecated: false + description: Deletes a schedule. + operationId: schedule_delete + parameters: + - $ref: "#/components/parameters/scheduleId" + responses: + "204": + content: + application/json: + example: {} + schema: + example: {} + type: object + description: "" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Delete schedule + tags: + - Schedules + x-legacy-doc-urls: + - https://docs.apify.com/api/v2#/reference/schedules/schedule-object/delete-schedule + - https://docs.apify.com/api/v2#/reference/schedules/delete-schedule + - https://docs.apify.com/api/v2#tag/SchedulesSchedule-object/operation/schedule_delete + x-js-parent: ScheduleClient + x-js-name: delete + x-js-doc-url: https://docs.apify.com/api/client/js/reference/class/ScheduleClient#delete + get: + deprecated: false + description: Gets the schedule object with all details. + operationId: schedule_get + parameters: + - $ref: "#/components/parameters/scheduleId" + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/ScheduleResponse" + description: "" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Get schedule + tags: + - Schedules + x-legacy-doc-urls: + - https://docs.apify.com/api/v2#/reference/schedules/schedule-object/get-schedule + - https://docs.apify.com/api/v2#/reference/schedules/get-schedule + - https://docs.apify.com/api/v2#tag/SchedulesSchedule-object/operation/schedule_get + x-js-parent: ScheduleClient + x-js-name: get + x-js-doc-url: https://docs.apify.com/api/client/js/reference/class/ScheduleClient#get + x-py-parent: ScheduleClientAsync + x-py-name: get + x-py-doc-url: https://docs.apify.com/api/client/python/reference/class/ScheduleClientAsync#get + put: + deprecated: false + description: | + Updates a schedule using values specified by a schedule object passed as + JSON in the POST payload. If the object does not define a specific property, + its value will not be updated. + + The response is the full schedule object as returned by the + [Get schedule](#/reference/schedules/schedule-object/get-schedule) endpoint. + + **The request needs to specify the `Content-Type: application/json` HTTP + header!** + + When providing your API authentication token, we recommend using the + request's `Authorization` header, rather than the URL. ([More + info](#/introduction/authentication)). + operationId: schedule_put + parameters: + - $ref: "#/components/parameters/scheduleId" + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/ScheduleCreate" + description: "" + required: true + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/ScheduleResponse" + description: "" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "413": + $ref: "#/components/responses/PayloadTooLarge" + "415": + $ref: "#/components/responses/UnsupportedMediaType" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Update schedule + tags: + - Schedules + x-legacy-doc-urls: + - https://docs.apify.com/api/v2#/reference/schedules/schedule-object/update-schedule + - https://docs.apify.com/api/v2#/reference/schedules/update-schedule + - https://docs.apify.com/api/v2#tag/SchedulesSchedule-object/operation/schedule_put + x-js-parent: ScheduleClient + x-js-name: update + x-js-doc-url: https://docs.apify.com/api/client/js/reference/class/ScheduleClient#update + x-py-parent: ScheduleClientAsync + x-py-name: update + x-py-doc-url: https://docs.apify.com/api/client/python/reference/class/ScheduleClientAsync#update + /v2/schedules/{scheduleId}/log: + get: + deprecated: false + description: | + Gets the schedule log as a JSON array containing information about up to a + 1000 invocations of the schedule. + operationId: schedule_log_get + parameters: + - $ref: "#/components/parameters/scheduleId" + responses: + "200": + content: + application/json: + example: + data: + - message: Schedule invoked + level: INFO + createdAt: 2019-03-26T12:28:00.370Z + - message: "Cannot start Actor task \\\"iEvfA6pm6DWjRTGxS\\\": Provided\ + \ input must be object, got \\\"string\\\" instead." + level: ERROR + createdAt: 2019-03-26T12:30:00.325Z + schema: + $ref: "#/components/schemas/ScheduleLogResponse" + description: "" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Get schedule log + tags: + - Schedules + x-legacy-doc-urls: + - https://docs.apify.com/api/v2#/reference/schedules/schedule-log/get-schedule-log + - https://docs.apify.com/api/v2#/reference/schedules/get-schedule-log + - https://docs.apify.com/api/v2#tag/SchedulesSchedule-log/operation/schedule_log_get + x-js-parent: ScheduleClient + x-js-name: getLog + x-js-doc-url: https://docs.apify.com/api/client/js/reference/class/ScheduleClient#getLog + x-py-parent: ScheduleClientAsync + x-py-name: get_log + x-py-doc-url: https://docs.apify.com/api/client/python/reference/class/ScheduleClientAsync#get_log + /v2/store: + get: + deprecated: false + description: | + Gets the list of public Actors in Apify Store. You can use `search` + parameter to search Actors by string in title, name, description, username + and readme. + If you need detailed info about a specific Actor, use the [Get + Actor](#/reference/actors/actor-object/get-actor) endpoint. + + The endpoint supports pagination using the `limit` and `offset` parameters. + It will not return more than 1,000 records. + operationId: store_get + parameters: + - $ref: "#/components/parameters/limit" + - $ref: "#/components/parameters/offset" + - description: | + String to search by. The search runs on the following fields: `title`, + `name`, `description`, `username`, `readme`. + explode: true + in: query + name: search + required: false + schema: + example: web scraper + type: string + style: form + - description: | + Specifies the field by which to sort the results. The supported values + are `relevance` (default), `popularity`, `newest` and `lastUpdate`. + explode: true + in: query + name: sortBy + required: false + schema: + example: '''popularity''' + type: string + style: form + - description: Filters the results by the specified category. + explode: true + in: query + name: category + required: false + schema: + example: '''AI''' + type: string + style: form + - description: Filters the results by the specified username. + explode: true + in: query + name: username + required: false + schema: + example: '''apify''' + type: string + style: form + - description: | + Only return Actors with the specified pricing model. + explode: true + in: query + name: pricingModel + required: false + schema: + enum: + - FREE + - FLAT_PRICE_PER_MONTH + - PRICE_PER_DATASET_ITEM + - PAY_PER_EVENT + example: FREE + type: string + style: form + - description: | + If true, only return Actors that allow agentic users. If false, only + return Actors that do not allow agentic users. + explode: true + in: query + name: allowsAgenticUsers + required: false + schema: + example: true + type: boolean + style: form + - description: | + Controls the shape of the response. Use `full` (default) for the + complete response including image URLs and all fields. Use `agent` + for a reduced field set optimized for LLM consumers, which only + includes `id`, `title`, `name`, `username`, `description`, `notice`, + `badge`, `categories`, and minimal `stats`. + explode: true + in: query + name: responseFormat + required: false + schema: + default: full + enum: + - full + - agent + example: agent + type: string + style: form + - description: | + By default, search results exclude Actors that are not safe to run + automatically (e.g. Actors from developers who haven't passed KYC, or + full-permission Actors without a large user base). Set to `true` to + bypass this safety filtering and include all Actors in the results. + explode: true + in: query + name: includeUnrunnableActors + required: false + schema: + default: false + example: true + type: boolean + style: form + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/ListOfActorsInStoreResponse" + description: "" + "400": + $ref: "#/components/responses/BadRequest" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Get list of Actors in Store + tags: + - Store + x-legacy-doc-urls: + - https://docs.apify.com/api/v2#/reference/store/store-actors-collection/get-list-of-actors-in-store + - https://docs.apify.com/api/v2#/reference/store/get-list-of-actors-in-store + - https://docs.apify.com/api/v2#tag/StoreStore-Actors-collection/operation/store_get + /v2/logs/{buildOrRunId}: + get: + deprecated: false + description: | + Retrieves logs for a specific Actor build or run. + operationId: log_get + parameters: + - $ref: "#/components/parameters/buildOrRunId" + - $ref: "#/components/parameters/stream" + - $ref: "#/components/parameters/download" + - $ref: "#/components/parameters/raw" + responses: + "200": + content: + text/plain: + schema: + example: | + 2017-07-14T06:00:49.733Z Application started. + 2017-07-14T06:00:49.741Z Input: { test: 123 } + 2017-07-14T06:00:49.752Z Some useful debug information follows. + type: string + description: "" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "429": + $ref: "#/components/responses/TooManyRequests" + security: + - httpBearer: [] + - apiKey: [] + - {} + summary: Get log + tags: + - Logs + x-legacy-doc-urls: + - https://docs.apify.com/api/v2#/reference/logs/log/get-log + - https://docs.apify.com/api/v2#/reference/logs/get-log + - https://docs.apify.com/api/v2#tag/LogsLog/operation/log_get + x-js-parent: LogClient + x-js-name: stream + x-js-doc-url: https://docs.apify.com/api/client/js/reference/class/LogClient#stream + x-py-parent: LogClientAsync + x-py-name: stream + x-py-doc-url: https://docs.apify.com/api/client/python/reference/class/LogClientAsync#stream + /v2/users/{userId}: + get: + deprecated: false + description: | + Returns public information about a specific user account, similar to what + can be seen on public profile pages (e.g. https://apify.com/apify). + + This operation requires no authentication token. + operationId: user_get + parameters: + - description: User ID or username. + explode: false + in: path + name: userId + required: true + schema: + example: HGzIk8z78YcAPEB + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/PublicUserDataResponse" + description: "" + "400": + $ref: "#/components/responses/BadRequest" + "404": + $ref: "#/components/responses/NotFound" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Get public user data + tags: + - Users + x-legacy-doc-urls: + - https://docs.apify.com/api/v2#/reference/users/public-data/get-public-user-data + - https://docs.apify.com/api/v2#/reference/users/get-public-user-data + - https://docs.apify.com/api/v2#tag/UsersPublic-data/operation/user_get + /v2/users/me: + get: + deprecated: false + description: | + Returns information about the current user account, including both public + and private information. + + The user account is identified by the provided authentication token. + + The fields `plan`, `email` and `profile` are omitted when this endpoint is accessed from Actor run. + operationId: users_me_get + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/PrivateUserDataResponse" + description: "" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Get private user data + tags: + - Users + x-legacy-doc-urls: + - https://docs.apify.com/api/v2#/reference/users/private-data/get-private-user-data + - https://docs.apify.com/api/v2#/reference/users/get-private-user-data + - https://docs.apify.com/api/v2#tag/UsersPrivate-data/operation/users_me_get + /v2/users/me/usage/monthly: + get: + deprecated: false + description: | + Returns a complete summary of your usage for the current monthly usage cycle, + an overall sum, as well as a daily breakdown of usage. It is the same + information you will see on your account's [Billing > Historical usage page](https://console.apify.com/billing/historical-usage). The information + includes your use of Actors, compute, data transfer, and storage. + + Using the `date` parameter will show your usage in the monthly usage cycle that + includes that date. + operationId: users_me_usage_monthly_get + parameters: + - description: Date in the YYYY-MM-DD format. + explode: true + in: query + name: date + required: false + schema: + example: 2020-06-14 + type: string + style: form + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/MonthlyUsageResponse" + description: "" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Get monthly usage + tags: + - Users + x-legacy-doc-urls: + - https://docs.apify.com/api/v2#/reference/users/monthly-usage/get-monthly-usage + - https://docs.apify.com/api/v2#/reference/users/get-monthly-usage + - https://docs.apify.com/api/v2#tag/UsersMonthly-usage/operation/users_me_usage_monthly_get + /v2/users/me/limits: + get: + deprecated: false + description: | + Returns a complete summary of your account's limits. It is the same + information you will see on your account's [Limits page](https://console.apify.com/billing#/limits). The returned data + includes the current usage cycle, a summary of your limits, and your current usage. + operationId: users_me_limits_get + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/LimitsResponse" + description: "" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Get limits + tags: + - Users + x-legacy-doc-urls: + - https://docs.apify.com/api/v2#/reference/users/account-and-usage-limits/get-limits + - https://docs.apify.com/api/v2#/reference/users/get-limits + - https://docs.apify.com/api/v2#tag/UsersAccount-and-usage-limits/operation/users_me_limits_get + put: + deprecated: false + description: | + Updates the account's limits manageable on your account's [Limits page](https://console.apify.com/billing#/limits). + Specifically the: `maxMonthlyUsageUsd` and `dataRetentionDays` limits (see request body schema for more details). + operationId: users_me_limits_put + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/UpdateLimitsRequest" + description: "" + responses: + "201": + content: + application/json: + schema: + type: object + description: "" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "413": + $ref: "#/components/responses/PayloadTooLarge" + "415": + $ref: "#/components/responses/UnsupportedMediaType" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Update limits + tags: + - Users + x-legacy-doc-urls: + - https://docs.apify.com/api/v2#/reference/users/account-and-usage-limits/update-limits + - https://docs.apify.com/api/v2#/reference/users/update-limits + - https://docs.apify.com/api/v2#tag/UsersAccount-and-usage-limits/operation/users_me_limits_put + /v2/browser-info: + delete: + deprecated: false + description: | + Returns information about the HTTP request, including the client IP address, + country code, request headers, and body length. + + This endpoint is designed for proxy testing. It accepts any HTTP method so you + can verify that your proxy correctly forwards requests of any type and that + client IP addresses are anonymized. + operationId: tools_browser_info_delete + parameters: + - description: "If `true` or `1`, the response omits the `headers` field." + explode: true + in: query + name: skipHeaders + required: false + schema: + type: boolean + style: form + - description: "If `true` or `1`, the response includes the `rawHeaders` field\ + \ with the raw request headers." + explode: true + in: query + name: rawHeaders + required: false + schema: + type: boolean + style: form + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/BrowserInfoResponse" + description: "" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "429": + $ref: "#/components/responses/TooManyRequests" + security: [] + summary: Get browser info + tags: + - Tools + get: + deprecated: false + description: | + Returns information about the HTTP request, including the client IP address, + country code, request headers, and body length. + + This endpoint is designed for proxy testing. It accepts any HTTP method so you + can verify that your proxy correctly forwards requests of any type and that + client IP addresses are anonymized. + operationId: tools_browser_info_get + parameters: + - description: "If `true` or `1`, the response omits the `headers` field." + explode: true + in: query + name: skipHeaders + required: false + schema: + type: boolean + style: form + - description: "If `true` or `1`, the response includes the `rawHeaders` field\ + \ with the raw request headers." + explode: true + in: query + name: rawHeaders + required: false + schema: + type: boolean + style: form + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/BrowserInfoResponse" + description: "" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "429": + $ref: "#/components/responses/TooManyRequests" + security: [] + summary: Get browser info + tags: + - Tools + post: + deprecated: false + description: | + Returns information about the HTTP request, including the client IP address, + country code, request headers, and body length. + + This endpoint is designed for proxy testing. It accepts any HTTP method so you + can verify that your proxy correctly forwards requests of any type and that + client IP addresses are anonymized. + operationId: tools_browser_info_post + parameters: + - description: "If `true` or `1`, the response omits the `headers` field." + explode: true + in: query + name: skipHeaders + required: false + schema: + type: boolean + style: form + - description: "If `true` or `1`, the response includes the `rawHeaders` field\ + \ with the raw request headers." + explode: true + in: query + name: rawHeaders + required: false + schema: + type: boolean + style: form + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/BrowserInfoResponse" + description: "" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "429": + $ref: "#/components/responses/TooManyRequests" + security: [] + summary: Get browser info + tags: + - Tools + put: + deprecated: false + description: | + Returns information about the HTTP request, including the client IP address, + country code, request headers, and body length. + + This endpoint is designed for proxy testing. It accepts any HTTP method so you + can verify that your proxy correctly forwards requests of any type and that + client IP addresses are anonymized. + operationId: tools_browser_info_put + parameters: + - description: "If `true` or `1`, the response omits the `headers` field." + explode: true + in: query + name: skipHeaders + required: false + schema: + type: boolean + style: form + - description: "If `true` or `1`, the response includes the `rawHeaders` field\ + \ with the raw request headers." + explode: true + in: query + name: rawHeaders + required: false + schema: + type: boolean + style: form + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/BrowserInfoResponse" + description: "" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "429": + $ref: "#/components/responses/TooManyRequests" + security: [] + summary: Get browser info + tags: + - Tools + /v2/tools/encode-and-sign: + post: + deprecated: false + description: | + Encodes and signs any JSON object. The encoded value includes a signature + tied to the authenticated user's ID, which can later be verified using the + decode-and-verify endpoint. + + **Important**: The request must specify the `Content-Type: application/json` + HTTP header. + operationId: tools_encode_and_sign_post + requestBody: + content: + application/json: + example: + key: value + schema: + type: object + description: "" + required: true + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/EncodeAndSignResponse" + description: "" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "413": + $ref: "#/components/responses/PayloadTooLarge" + "415": + $ref: "#/components/responses/UnsupportedMediaType" + "429": + $ref: "#/components/responses/TooManyRequests" + summary: Encode and sign object + tags: + - Tools + /v2/tools/decode-and-verify: + post: + deprecated: false + description: | + Decodes and verifies an encoded value previously created by the + encode-and-sign endpoint. Returns the original decoded object along with + information about the user who encoded it and whether that user is verified. + + **Important**: The request must specify the `Content-Type: application/json` + HTTP header. + operationId: tools_decode_and_verify_post + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/DecodeAndVerifyRequest" + description: "" + required: true + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/DecodeAndVerifyResponse" + description: "" + "400": + $ref: "#/components/responses/BadRequest" + "405": + $ref: "#/components/responses/MethodNotAllowed" + "413": + $ref: "#/components/responses/PayloadTooLarge" + "415": + $ref: "#/components/responses/UnsupportedMediaType" + "429": + $ref: "#/components/responses/TooManyRequests" + security: [] + summary: Decode and verify object + tags: + - Tools +components: + examples: + ListOfRunsResponseExample: + value: + data: + total: 2 + offset: 0 + limit: 1000 + desc: false + count: 2 + items: + - id: HG7ML7M8z78YcAPEB + actId: HDSasDasz78YcAPEB + actorTaskId: KJHSKHausidyaJKHs + status: SUCCEEDED + startedAt: 2019-11-30T07:34:24.202Z + finishedAt: 2019-12-12T09:30:12.202Z + buildId: HG7ML7M8z78YcAPEB + buildNumber: 0.0.2 + meta: + origin: WEB + usageTotalUsd: 0.2 + defaultKeyValueStoreId: sfAjeR4QmeJCQzTfe + defaultDatasetId: 3ZojQDdFTsyE7Moy4 + defaultRequestQueueId: so93g2shcDzK3pA85 + - id: HG7ML7M8z78YcAPEB + actId: HDSasDasz78YcAPEB + actorTaskId: KJHSKHausidyaJKHs + status: FAILED + startedAt: 2019-12-12T07:34:14.202Z + finishedAt: 2019-12-13T08:36:13.202Z + buildId: u78dML7M8z78YcAPEB + buildNumber: 0.2.2 + meta: + origin: DEVELOPMENT + usageTotalUsd: 0.6 + defaultKeyValueStoreId: sffsouqlseJCQzTfe + defaultDatasetId: CFGggdjQDsyE7Moyw + defaultRequestQueueId: soowucklrmDzKpA8x + parameters: + offset: + description: | + Number of items that should be skipped at the start. The default value is `0`. + explode: true + in: query + name: offset + required: false + schema: + example: 0 + format: double + type: number + style: form + limit: + description: | + Maximum number of items to return. The default value as well as the maximum is `1000`. + explode: true + in: query + name: limit + required: false + schema: + example: 1000 + format: double + type: number + style: form + descCreatedAt: + description: | + If `true` or `1` then the objects are sorted by the `createdAt` field in + descending order. By default, they are sorted in ascending order. + explode: true + in: query + name: desc + required: false + schema: + example: true + type: boolean + style: form + actorId: + description: Actor ID or a tilde-separated owner's username and Actor name. + explode: false + in: path + name: actorId + required: true + schema: + example: janedoe~my-actor + type: string + style: simple + versionNumber: + description: Actor version. + explode: false + in: path + name: versionNumber + required: true + schema: + example: "0.1" + type: string + style: simple + descStartedAt: + description: | + If `true` or `1` then the objects are sorted by the `startedAt` field in + descending order. By default, they are sorted in ascending order. + explode: true + in: query + name: desc + required: false + schema: + example: true + type: boolean + style: form + waitForFinishBuild: + description: | + The maximum number of seconds the server waits for the build to finish. + By default it is `0`, the maximum value is `60`. + If the build finishes in time then the returned build object will have a + terminal status (e.g. `SUCCEEDED`), otherwise it will have a transitional status (e.g. `RUNNING`). + explode: true + in: query + name: waitForFinish + required: false + schema: + example: 60 + format: double + type: number + style: form + buildIdWithDefault: + description: | + ID of the build, found in the build's Info tab. + Use the special value `default` to get the OpenAPI schema for the Actor's default build. + explode: false + in: path + name: buildId + required: true + schema: + example: soSkq9ekdmfOslopH + type: string + style: simple + buildId: + description: "ID of the build, found in the build's Info tab." + explode: false + in: path + name: buildId + required: true + schema: + example: soSkq9ekdmfOslopH + type: string + style: simple + status: + description: | + Single status or comma-separated list of statuses, see ([available + statuses](https://docs.apify.com/platform/actors/running/runs-and-builds#lifecycle)). Used to filter runs by the specified statuses only. + explode: false + in: query + name: status + required: false + schema: + example: + - SUCCEEDED + items: + type: string + type: array + default: null + style: form + startedAfter: + allowReserved: true + description: | + Filter runs that started after the specified date and time (inclusive). + The value must be a valid ISO 8601 datetime string (UTC). + explode: true + in: query + name: startedAfter + required: false + schema: + example: 2025-09-01T00:00:00.000Z + format: date-time + type: string + style: form + startedBefore: + allowReserved: true + description: | + Filter runs that started before the specified date and time (inclusive). + The value must be a valid ISO 8601 datetime string (UTC). + explode: true + in: query + name: startedBefore + required: false + schema: + example: 2025-09-17T23:59:59.000Z + format: date-time + type: string + style: form + timeout: + description: | + Optional timeout for the run, in seconds. By default, the run uses the timeout from its configuration. + explode: true + in: query + name: timeout + required: false + schema: + example: 60 + format: double + type: number + style: form + memory: + description: | + Memory limit for the run, in megabytes. The amount of memory can be set to a power of 2 with a minimum of 128. + By default, the run uses the memory limit from its configuration. + explode: true + in: query + name: memory + required: false + schema: + example: 256 + format: double + type: number + style: form + maxItems: + description: | + Specifies the maximum number of dataset items that will be charged for pay-per-result Actors. + This does NOT guarantee that the Actor will return only this many items. + It only ensures you won't be charged for more than this number of items. + Only works for pay-per-result Actors. + Value can be accessed in the actor run using `ACTOR_MAX_PAID_DATASET_ITEMS` environment variable. + explode: true + in: query + name: maxItems + required: false + schema: + example: 1000 + format: double + type: number + style: form + maxTotalChargeUsd: + description: | + Specifies the maximum cost of the run. This parameter is + useful for pay-per-event Actors, as it allows you to limit the amount + charged to your subscription. You can access the maximum cost in your Actor + by using the `ACTOR_MAX_TOTAL_CHARGE_USD` environment variable. + explode: true + in: query + name: maxTotalChargeUsd + required: false + schema: + example: 5 + format: double + type: number + style: form + restartOnError: + description: | + Determines whether the run will be restarted if it fails. + explode: true + in: query + name: restartOnError + required: false + schema: + example: false + type: boolean + style: form + build: + description: | + Specifies the Actor build to run. It can be either a build tag or build number. + By default, the run uses the build from its configuration (typically `latest`). + explode: true + in: query + name: build + required: false + schema: + example: 0.1.234 + type: string + style: form + waitForFinishRun: + description: | + The maximum number of seconds the server waits for the run to finish. By + default it is `0`, the maximum value is `60`. + If the run finishes in time then the returned run object will have a terminal status (e.g. `SUCCEEDED`), + otherwise it will have a transitional status (e.g. `RUNNING`). + explode: true + in: query + name: waitForFinish + required: false + schema: + example: 60 + format: double + type: number + style: form + webhooks: + description: | + Specifies optional webhooks associated with the Actor run, which can be used to receive a notification + e.g. when the Actor finished or failed. The value is a Base64-encoded JSON array whose items follow + the WebhookRepresentation schema. For more information, see + [Webhooks documentation](https://docs.apify.com/platform/integrations/webhooks). + explode: true + in: query + name: webhooks + required: false + schema: + example: dGhpcyBpcyBqdXN0IGV4YW1wbGUK... + type: string + style: form + outputRecordKey: + description: | + Key of the record from run's default key-value store to be returned + in the response. By default, it is `OUTPUT`. + explode: true + in: query + name: outputRecordKey + required: false + schema: + example: OUTPUT + type: string + style: form + format: + description: | + Format of the results, possible values are: `json`, `jsonl`, `csv`, `html`, `xlsx`, `xml` and `rss`. The default value is `json`. + explode: true + in: query + name: format + required: false + schema: + example: json + type: string + style: form + clean: + description: | + If `true` or `1` then the API endpoint returns only non-empty items and skips hidden fields (i.e. fields starting with the # character). + The `clean` parameter is just a shortcut for `skipHidden=true` and `skipEmpty=true` parameters. + Note that since some objects might be skipped from the output, that the result might contain less items than the `limit` value. + explode: true + in: query + name: clean + required: false + schema: + example: false + type: boolean + style: form + datasetParameters_limit: + description: Maximum number of items to return. By default there is no limit. + explode: true + in: query + name: limit + required: false + schema: + format: double + type: number + style: form + fields: + description: | + A comma-separated list of fields which should be picked from the items, only these fields will remain in the resulting record objects. + Note that the fields in the outputted items are sorted the same way as they are specified in the `fields` query parameter. + You can use this feature to effectively fix the output format. + explode: true + in: query + name: fields + required: false + schema: + example: "myValue,myOtherValue" + type: string + style: form + outputFields: + description: | + A comma-separated list of output field names that positionally rename the fields specified in the `fields` parameter. + For example, `?fields=headline,url&outputFields=title,link` renames `headline` to `title` and `url` to `link` in the output. + The number of names in `outputFields` must match the number of names in `fields`. + Requires the `fields` parameter to be specified as well. + explode: true + in: query + name: outputFields + required: false + schema: + example: "title,link" + type: string + style: form + omit: + description: A comma-separated list of fields which should be omitted from the + items. + explode: true + in: query + name: omit + required: false + schema: + example: "myValue,myOtherValue" + type: string + style: form + unwind: + description: | + A comma-separated list of fields which should be unwound, in order which they should be processed. Each field should be either an array or an object. + If the field is an array then every element of the array will become a separate record and merged with parent object. + If the unwound field is an object then it is merged with the parent object. + If the unwound field is missing or its value is neither an array nor an object and therefore cannot be merged with a parent object then the item gets preserved as it is. + Note that the unwound items ignore the `desc` parameter. + explode: true + in: query + name: unwind + required: false + schema: + example: "myValue,myOtherValue" + type: string + style: form + flatten: + description: | + A comma-separated list of fields which should transform nested objects into flat structures. + + For example, with `flatten="foo"` the object `{"foo":{"bar": "hello"}}` is turned into `{"foo.bar": "hello"}`. + + The original object with properties is replaced with the flattened object. + explode: true + in: query + name: flatten + required: false + schema: + example: myValue + type: string + style: form + descDataset: + description: | + By default, results are returned in the same order as they were stored. + To reverse the order, set this parameter to `true` or `1`. + explode: true + in: query + name: desc + required: false + schema: + example: true + type: boolean + style: form + attachment: + description: | + If `true` or `1` then the response will define the `Content-Disposition: + attachment` header, forcing a web browser to download the file rather + than to display it. By default this header is not present. + explode: true + in: query + name: attachment + required: false + schema: + example: true + type: boolean + style: form + delimiter: + description: | + A delimiter character for CSV files, only used if `format=csv`. You + might need to URL-encode the character (e.g. use `%09` for tab or `%3B` + for semicolon). The default delimiter is a simple comma (`,`). + explode: true + in: query + name: delimiter + required: false + schema: + example: ; + type: string + style: form + bom: + description: | + All text responses are encoded in UTF-8 encoding. By default, the + `format=csv` files are prefixed with the UTF-8 Byte Order Mark (BOM), while `json`, `jsonl`, `xml`, `html` and `rss` files are not. + + If you want to override this default behavior, specify `bom=1` query parameter to include the BOM or `bom=0` to skip it. + explode: true + in: query + name: bom + required: false + schema: + example: false + type: boolean + style: form + xmlRoot: + description: | + Overrides default root element name of `xml` output. By default the root element is `items`. + explode: true + in: query + name: xmlRoot + required: false + schema: + example: items + type: string + style: form + xmlRow: + description: | + Overrides default element name that wraps each page or page function result object in `xml` output. By default the element name is `item`. + explode: true + in: query + name: xmlRow + required: false + schema: + example: item + type: string + style: form + skipHeaderRow: + description: If `true` or `1` then header row in the `csv` format is skipped. + explode: true + in: query + name: skipHeaderRow + required: false + schema: + example: true + type: boolean + style: form + skipHidden: + description: | + If `true` or `1` then hidden fields are skipped from the output, i.e. fields starting with the `#` character. + explode: true + in: query + name: skipHidden + required: false + schema: + example: false + type: boolean + style: form + skipEmpty: + description: | + If `true` or `1` then empty items are skipped from the output. + + Note that if used, the results might contain less items than the limit value. + explode: true + in: query + name: skipEmpty + required: false + schema: + example: false + type: boolean + style: form + simplified: + description: | + If `true` or `1` then, the endpoint applies the `fields=url,pageFunctionResult,errorInfo` + and `unwind=pageFunctionResult` query parameters. This feature is used to emulate simplified results provided by the + legacy Apify Crawler product and it's not recommended to use it in new integrations. + explode: true + in: query + name: simplified + required: false + schema: + example: false + type: boolean + style: form + view: + description: | + Defines the view configuration for dataset items based on the schema definition. + This parameter determines how the data will be filtered and presented. + For complete specification details, see the [dataset schema documentation](/platform/actors/development/actor-definition/dataset-schema). + explode: true + in: query + name: view + required: false + schema: + example: overview + type: string + style: form + skipFailedPages: + description: | + If `true` or `1` then, the all the items with errorInfo property will be skipped from the output. + + This feature is here to emulate functionality of API version 1 used for the legacy Apify Crawler product and it's not recommended to use it in new integrations. + explode: true + in: query + name: skipFailedPages + required: false + schema: + example: false + type: boolean + style: form + feedTitle: + description: | + Overrides the auto-generated RSS channel `` element. + Only used when `format=rss`. If not provided, the title defaults to `Dataset <label>`. + explode: true + in: query + name: feedTitle + required: false + schema: + example: Latest posts from r/pasta + type: string + style: form + feedDescription: + description: | + Overrides the auto-generated RSS channel `<description>` element. + Only used when `format=rss`. If not provided, the description defaults to `Items in dataset with id "<datasetId>".` + explode: true + in: query + name: feedDescription + required: false + schema: + example: Scraped forum posts + type: string + style: form + runId: + description: Actor run ID. + explode: false + in: path + name: runId + required: true + schema: + example: 3KH8gEpp4d8uQSe8T + type: string + style: simple + buildResurrect: + description: | + Specifies the Actor build to run. It can be either a build tag or build number. + By default, the run is resurrected with the same build it originally used. Specifically, + if a run was first started with the `latest` tag, which resolves to version `0.0.3` at the + time, a run resurrected without this parameter will continue running with `0.0.3`, even if + `latest` already points to a newer build. + explode: true + in: query + name: build + required: false + schema: + example: 0.1.234 + type: string + style: form + timeoutResurrect: + description: | + Optional timeout for the run, in seconds. By default, the run uses the timeout + specified in the run that is being resurrected. + explode: true + in: query + name: timeout + required: false + schema: + example: 60 + format: double + type: number + style: form + memoryResurrect: + description: | + Memory limit for the run, in megabytes. The amount of memory can be set to a power of 2 + with a minimum of 128. By default, the run uses the memory limit specified in the run + that is being resurrected. + explode: true + in: query + name: memory + required: false + schema: + example: 256 + format: double + type: number + style: form + restartOnErrorResurrect: + description: | + Determines whether the resurrected run will be restarted if it fails. + By default, the resurrected run uses the same setting as before. + explode: true + in: query + name: restartOnError + required: false + schema: + example: false + type: boolean + style: form + statusLastRun: + description: Filter for the run status. + explode: true + in: query + name: status + required: false + schema: + example: SUCCEEDED + type: string + style: form + signature: + description: Signature used for the access. + explode: true + in: query + name: signature + required: false + schema: + example: 2wTI46Bg8qWQrV7tavlPI + type: string + style: form + exclusiveStartKey: + description: All keys up to this one (including) are skipped from the result. + explode: true + in: query + name: exclusiveStartKey + required: false + schema: + example: Ihnsp8YrvJ8102Kj + type: string + style: form + keyValueStoreParameters_limit: + description: Number of keys to be returned. + explode: true + in: query + name: limit + required: false + schema: + default: 1000 + example: 100 + format: int32 + maximum: 1000 + minimum: 1 + type: number + style: form + collectionKeys: + description: Limit the results to keys that belong to a specific collection + from the key-value store schema. The key-value store need to have a schema + defined for this parameter to work. + explode: true + in: query + name: collection + required: false + schema: + example: postImages + type: string + style: form + prefixKeys: + description: Limit the results to keys that start with a specific prefix. + explode: true + in: query + name: prefix + required: false + schema: + example: post-images- + type: string + style: form + collectionRecords: + description: | + If specified, only records belonging to a specific collection from the key-value store schema. The key-value store need to have a schema defined for this parameter to work. + explode: true + in: query + name: collection + required: false + schema: + example: my-collection + type: string + style: form + prefixRecords: + description: | + If specified, only records whose key starts with the given prefix are included in the archive. + explode: true + in: query + name: prefix + required: false + schema: + example: my-prefix/ + type: string + style: form + recordKey: + description: Key of the record. + explode: false + in: path + name: recordKey + required: true + schema: + example: someKey + type: string + style: simple + keyValueStoreParameters_attachment: + description: | + If `true` or `1`, the response will be served with `Content-Disposition: attachment` header, + causing web browsers to offer downloading HTML records instead of displaying them. + explode: true + in: query + name: attachment + required: false + schema: + example: true + type: boolean + style: form + Content-Encoding: + description: "" + explode: false + in: header + name: Content-Encoding + required: false + schema: + enum: + - gzip + - deflate + - br + - identity + type: string + style: simple + clientKey: + description: | + A unique identifier of the client accessing the request queue. It must + be a string between 1 and 32 characters long. This identifier is used to + determine whether the queue was accessed by multiple clients. If + `clientKey` is not provided, + the system considers this API call to come from a new client. For + details, see the `hadMultipleClients` field returned by the [Get + head](#/reference/request-queues/queue-head) operation. + explode: true + in: query + name: clientKey + required: false + schema: + example: client-abc + type: string + style: form + exclusiveStartId: + deprecated: true + description: "All requests up to this one (including) are skipped from the result.\ + \ (Deprecated, use `cursor` instead.)" + explode: true + in: query + name: exclusiveStartId + required: false + schema: + example: Ihnsp8YrvJ8102Kj + type: string + style: form + listLimit: + description: Number of keys to be returned. Maximum value is `10000`. + explode: true + in: query + name: limit + required: false + schema: + example: 100 + format: double + type: number + style: form + cursor: + description: "A cursor string for pagination, returned in the previous response\ + \ as `nextCursor`. Use this to retrieve the next page of requests." + explode: true + in: query + name: cursor + required: false + schema: + example: eyJyZXF1ZXN0SWQiOiI2OFRqQ2RaTDNvM2hiUU0ifQ + type: string + style: form + filter: + description: "Filter requests by their state. Possible values are `locked` and\ + \ `pending`. You can combine multiple values separated by commas, which will\ + \ mean the union of these filters – requests matching any of the specified\ + \ states will be returned. (Not compatible with deprecated `exclusiveStartId`\ + \ parameter.)" + explode: false + in: query + name: filter + required: false + schema: + example: + - locked + items: + enum: + - locked + - pending + type: string + type: array + default: null + style: form + forefront: + description: | + Determines if request should be added to the head of the queue or to the + end. Default value is `false` (end of queue). + explode: true + in: query + name: forefront + required: false + schema: + example: "false" + type: string + style: form + contentTypeJson: + description: "" + explode: false + in: header + name: Content-Type + required: true + schema: + enum: + - application/json + type: string + style: simple + requestId: + description: Request ID. + explode: false + in: path + name: requestId + required: true + schema: + example: xpsmkDlspokDSmklS + type: string + style: simple + lockSecs: + description: How long the requests will be locked for (in seconds). + explode: true + in: query + name: lockSecs + required: true + schema: + example: 60 + format: double + type: number + style: form + lockForefront: + description: | + Determines if request should be added to the head of the queue or to the + end after lock expires. + explode: true + in: query + name: forefront + required: false + schema: + example: "false" + type: string + style: form + deleteForefront: + description: | + Determines if request should be added to the head of the queue or to the + end after lock was removed. + explode: true + in: query + name: forefront + required: false + schema: + example: "false" + type: string + style: form + headLimit: + description: How many items from queue should be returned. + explode: true + in: query + name: limit + required: false + schema: + example: 100 + format: double + type: number + style: form + headLockLimit: + description: How many items from the queue should be returned. + explode: true + in: query + name: limit + required: false + schema: + example: 25 + format: double + maximum: 25 + type: number + style: form + stream: + description: | + If `true` or `1` then the logs will be streamed as long as the run or build is running. + explode: true + in: query + name: stream + required: false + schema: + example: false + type: boolean + style: form + download: + description: | + If `true` or `1` then the web browser will download the log file rather than open it in a tab. + explode: true + in: query + name: download + required: false + schema: + example: false + type: boolean + style: form + raw: + description: | + If `true` or `1`, the logs will be kept verbatim. By default, the API removes + ANSI escape codes from the logs, keeping only printable characters. + explode: true + in: query + name: raw + required: false + schema: + example: false + type: boolean + style: form + gracefully: + description: | + If true passed, the Actor run will abort gracefully. + It will send `aborting` and `persistState` event into run and force-stop the run after 30 seconds. + It is helpful in cases where you plan to resurrect the run later. + explode: true + in: query + name: gracefully + required: false + schema: + example: true + type: boolean + style: form + targetActorId: + description: ID of a target Actor that the run should be transformed into. + explode: true + in: query + name: targetActorId + required: true + schema: + example: HDSasDasz78YcAPEB + type: string + style: form + actorTaskId: + description: Task ID or a tilde-separated owner's username and task's name. + explode: false + in: path + name: actorTaskId + required: true + schema: + example: janedoe~my-task + type: string + style: simple + unnamed: + description: | + If `true` or `1` then all the storages are returned. By default, only + named storages are returned. + explode: true + in: query + name: unnamed + required: false + schema: + example: true + type: boolean + style: form + storeId: + description: Key-value store ID or `username~store-name`. + explode: false + in: path + name: storeId + required: true + schema: + example: WkzbQMuFYuamGv3YF + type: string + style: simple + datasetId: + description: Dataset ID or `username~dataset-name`. + explode: false + in: path + name: datasetId + required: true + schema: + example: WkzbQMuFYuamGv3YF + type: string + style: simple + queueId: + description: Queue ID or `username~queue-name`. + explode: false + in: path + name: queueId + required: true + schema: + example: WkzbQMuFYuamGv3YF + type: string + style: simple + webhookId: + description: Webhook ID. + explode: false + in: path + name: webhookId + required: true + schema: + example: pVJtoTelgYUq4qJOt + type: string + style: simple + scheduleId: + description: Schedule ID. + explode: false + in: path + name: scheduleId + required: true + schema: + example: asdLZtadYvn4mBZmm + type: string + style: simple + buildOrRunId: + description: ID of the Actor build or run. + explode: false + in: path + name: buildOrRunId + required: true + schema: + example: HG7ML7M8z78YcAPE + type: string + style: simple + responses: + BadRequest: + content: + application/json: + example: + error: + type: invalid-input + message: "Invalid input: The request body contains invalid data." + schema: + $ref: "#/components/schemas/ErrorResponse" + description: Bad request - invalid input parameters or request body. + Unauthorized: + content: + application/json: + example: + error: + type: invalid-token + message: Authentication token is not valid. + schema: + $ref: "#/components/schemas/ErrorResponse" + description: Unauthorized - authentication required or invalid token. + Forbidden: + content: + application/json: + example: + error: + type: insufficient-permissions + message: You do not have permission to perform this action. + schema: + $ref: "#/components/schemas/ErrorResponse" + description: Forbidden - insufficient permissions to perform this action. + MethodNotAllowed: + content: + application/json: + example: + error: + type: method-not-allowed + message: "This API end-point can only be accessed using the following\ + \ HTTP methods: OPTIONS,GET" + schema: + $ref: "#/components/schemas/ErrorResponse" + description: Method not allowed. + TooManyRequests: + content: + application/json: + example: + error: + type: rate-limit-exceeded + message: You have exceeded the rate limit. Please try again later. + schema: + $ref: "#/components/schemas/ErrorResponse" + description: Too many requests - rate limit exceeded. + PayloadTooLarge: + content: + application/json: + example: + error: + type: request-too-large + message: "The POST payload is too large (limit: 9437184 bytes, actual\ + \ length: 10485760 bytes)." + schema: + $ref: "#/components/schemas/ErrorResponse" + description: Payload too large - the request body exceeds the size limit. + UnsupportedMediaType: + content: + application/json: + example: + error: + type: unsupported-content-encoding + message: Content-Encoding "bla" is not supported. + schema: + $ref: "#/components/schemas/ErrorResponse" + description: Unsupported media type - the Content-Encoding of the request is + not supported. + NotFound: + content: + application/json: + example: + error: + type: record-not-found + message: The requested resource was not found. + schema: + $ref: "#/components/schemas/ErrorResponse" + description: Not found - the requested resource does not exist. + PaymentRequired: + content: + application/json: + example: + error: + type: x402-payment-required + message: Please provide X402-PAYMENT-SIGNATURE header with the payment. + See https://x402.org. + schema: + $ref: "#/components/schemas/ErrorResponse" + description: "Payment required - the user has exceeded their usage limit, does\ + \ not have enough credits, or the request lacks authentication and payment\ + \ credentials." + NoContent: + description: No content + Conflict: + content: + application/json: + example: + error: + type: actor-name-not-unique + message: Record with the given name already exists. + schema: + $ref: "#/components/schemas/ErrorResponse" + description: Conflict - the request could not be completed due to a conflict + with the current state of the resource. + RunTimeout: + content: + application/json: + example: + error: + type: run-timeout-exceeded + message: Actor run exceeded the timeout of 300 seconds for this API + endpoint + schema: + $ref: "#/components/schemas/ErrorResponse" + description: The HTTP request exceeded the timeout limit + schemas: + PaginationResponse: + description: Common pagination fields for list responses. + properties: + total: + description: The total number of items available across all pages. + minimum: 0 + type: integer + offset: + description: The starting position for this page of results. + minimum: 0 + type: integer + limit: + description: The maximum number of items returned per page. + minimum: 1 + type: integer + desc: + description: Whether the results are sorted in descending order. + type: boolean + count: + description: The number of items returned in this response. + minimum: 0 + type: integer + required: + - count + - desc + - limit + - offset + - total + title: PaginationResponse + ActorStats: + example: + totalBuilds: 0 + totalRuns: 6 + totalUsers: 1 + totalUsers7Days: 5 + totalUsers30Days: 5 + totalUsers90Days: 2 + totalMetamorphs: 7 + lastRunStartedAt: 2000-01-23T04:56:07.000+00:00 + actorReviewCount: 9 + actorReviewRating: 3.616076749251911 + bookmarkCount: 2 + publicActorRunStats30Days: + ABORTED: 4 + FAILED: 7 + SUCCEEDED: 1 + TIMED-OUT: 1 + TOTAL: 1 + properties: + totalBuilds: + type: integer + totalRuns: + type: integer + totalUsers: + type: integer + totalUsers7Days: + type: integer + totalUsers30Days: + type: integer + totalUsers90Days: + type: integer + totalMetamorphs: + type: integer + lastRunStartedAt: + format: date-time + type: string + actorReviewCount: + type: integer + actorReviewRating: + type: number + bookmarkCount: + type: integer + publicActorRunStats30Days: + $ref: "#/components/schemas/ActorStats_publicActorRunStats30Days" + title: ActorStats + ActorShort: + example: + id: id + createdAt: 2000-01-23T04:56:07.000+00:00 + modifiedAt: 2000-01-23T04:56:07.000+00:00 + name: name + username: username + title: title + stats: "" + properties: + id: + type: string + createdAt: + format: date-time + type: string + modifiedAt: + format: date-time + type: string + name: + type: string + username: + type: string + title: + type: string + stats: + allOf: + - $ref: "#/components/schemas/ActorStats" + nullable: true + required: + - createdAt + - id + - modifiedAt + - name + - username + title: ActorShort + ListOfActors: + allOf: + - $ref: "#/components/schemas/PaginationResponse" + - properties: + items: + items: + $ref: "#/components/schemas/ActorShort" + type: array + default: null + required: + - items + example: + total: 0 + offset: 0 + limit: 1 + desc: true + count: 0 + items: + - id: id + createdAt: 2000-01-23T04:56:07.000+00:00 + modifiedAt: 2000-01-23T04:56:07.000+00:00 + name: name + username: username + title: title + stats: "" + - id: id + createdAt: 2000-01-23T04:56:07.000+00:00 + modifiedAt: 2000-01-23T04:56:07.000+00:00 + name: name + username: username + title: title + stats: "" + title: ListOfActors + ListOfActorsResponse: + example: + data: + total: 0 + offset: 0 + limit: 1 + desc: true + count: 0 + items: + - id: id + createdAt: 2000-01-23T04:56:07.000+00:00 + modifiedAt: 2000-01-23T04:56:07.000+00:00 + name: name + username: username + title: title + stats: "" + - id: id + createdAt: 2000-01-23T04:56:07.000+00:00 + modifiedAt: 2000-01-23T04:56:07.000+00:00 + name: name + username: username + title: title + stats: "" + properties: + data: + $ref: "#/components/schemas/ListOfActors" + required: + - data + title: ListOfActorsResponse + ErrorType: + description: Machine-processable error type identifier. + enum: + - 3d-secure-auth-failed + - access-right-already-exists + - action-not-found + - actor-already-rented + - actor-can-not-be-rented + - actor-disabled + - actor-is-not-rented + - actor-memory-limit-exceeded + - actor-name-exists-new-owner + - actor-name-not-unique + - actor-not-found + - actor-not-github-actor + - actor-not-public + - actor-permission-level-not-supported-for-agentic-payments + - actor-review-already-exists + - actor-run-failed + - actor-standby-not-supported-for-agentic-payments + - actor-task-name-not-unique + - agentic-payment-info-retrieval-error + - agentic-payment-information-missing + - agentic-payment-insufficient-amount + - agentic-payment-provider-internal-error + - agentic-payment-provider-unauthorized + - airtable-webhook-deprecated + - already-subscribed-to-paid-actor + - apify-plan-required-to-use-paid-actor + - apify-signup-not-allowed + - auth-method-not-supported + - authorization-server-not-found + - auto-issue-date-invalid + - background-check-required + - billing-system-error + - black-friday-plan-expired + - braintree-error + - braintree-not-linked + - braintree-operation-timed-out + - braintree-unsupported-currency + - build-not-found + - build-outdated + - cannot-add-apify-events-to-ppe-actor + - cannot-add-multiple-pricing-infos + - cannot-add-pricing-info-that-alters-past + - cannot-add-second-future-pricing-info + - cannot-build-actor-from-webhook + - cannot-change-billing-interval + - cannot-change-owner + - cannot-charge-apify-event + - cannot-charge-non-pay-per-event-actor + - cannot-comment-as-other-user + - cannot-copy-actor-task + - cannot-create-payout + - cannot-create-public-actor + - cannot-create-tax-transaction + - cannot-delete-critical-actor + - cannot-delete-invoice + - cannot-delete-paid-actor + - cannot-disable-one-time-event-for-apify-start-event + - cannot-disable-organization-with-enabled-members + - cannot-disable-user-with-subscription + - cannot-link-oauth-to-unverified-email + - cannot-metamorph-to-pay-per-result-actor + - cannot-modify-actor-pricing-too-frequently + - cannot-modify-actor-pricing-with-immediate-effect + - cannot-override-paid-actor-trial + - cannot-permanently-delete-subscription + - cannot-publish-actor + - cannot-reduce-last-full-token + - cannot-reimburse-more-than-original-charge + - cannot-reimburse-non-rental-charge + - cannot-remove-own-actor-from-recently-used + - cannot-remove-payment-method + - cannot-remove-pricing-info + - cannot-remove-running-run + - cannot-remove-user-with-public-actors + - cannot-remove-user-with-subscription + - cannot-remove-user-with-unpaid-invoice + - cannot-rename-env-var + - cannot-rent-paid-actor + - cannot-review-own-actor + - cannot-set-access-rights-for-owner + - cannot-set-is-status-message-terminal + - cannot-unpublish-critical-actor + - cannot-unpublish-paid-actor + - cannot-unpublish-profile + - cannot-update-invoice-field + - concurrent-runs-limit-exceeded + - concurrent-update-detected + - conference-token-not-found + - content-encoding-forbidden-for-html + - coupon-already-redeemed + - coupon-expired + - coupon-for-new-customers + - coupon-for-subscribed-users + - coupon-limits-are-in-conflict-with-current-limits + - coupon-max-number-of-redemptions-reached + - coupon-not-found + - coupon-not-unique + - coupons-disabled + - create-github-issue-not-allowed + - creator-plan-not-available + - cron-expression-invalid + - daily-ai-token-limit-exceeded + - daily-publication-limit-exceeded + - dataset-does-not-have-fields-schema + - dataset-does-not-have-schema + - dataset-locked + - dataset-schema-invalid + - dcr-not-supported + - default-dataset-not-found + - deleting-default-build + - deleting-unfinished-build + - email-already-taken + - email-already-taken-removed-user + - email-domain-not-allowed-for-coupon + - email-invalid + - email-not-allowed + - email-not-valid + - email-update-too-soon + - elevated-permissions-needed + - env-var-already-exists + - exchange-rate-fetch-failed + - expired-conference-token + - failed-to-charge-user + - final-invoice-negative + - full-permission-actor-not-approved + - github-branch-empty + - github-issue-already-exists + - github-public-key-not-found + - github-repository-not-found + - github-signature-does-not-match-payload + - github-user-not-authorized-for-issues + - gmail-not-allowed + - id-does-not-match + - incompatible-billing-interval + - incomplete-payout-billing-info + - inconsistent-currencies + - incorrect-pricing-modifier-prefix + - input-json-invalid-characters + - input-json-not-object + - input-json-too-long + - input-update-collision + - insufficient-permissions + - insufficient-permissions-to-change-field + - insufficient-security-measures + - insufficient-tax-country-evidence + - integration-auth-error + - internal-server-error + - invalid-billing-info + - invalid-billing-period-for-payout + - invalid-build + - invalid-client-key + - invalid-collection + - invalid-conference-login-password + - invalid-content-type-header + - invalid-credentials + - invalid-git-auth-token + - invalid-github-issue-url + - invalid-header + - invalid-id + - invalid-idempotency-key + - invalid-input + - invalid-input-schema + - invalid-invoice + - invalid-invoice-type + - invalid-issue-date + - invalid-label-params + - invalid-main-account-user-id + - invalid-oauth-app + - invalid-oauth-scope + - invalid-one-time-invoice + - invalid-parameter + - invalid-payout-status + - invalid-picture-url + - invalid-record-key + - invalid-request + - invalid-resource-type + - invalid-signature + - invalid-subscription-plan + - invalid-tax-number + - invalid-tax-number-format + - invalid-token + - invalid-token-type + - invalid-two-factor-code + - invalid-two-factor-code-or-recovery-code + - invalid-two-factor-recovery-code + - invalid-username + - invalid-value + - invitation-invalid-resource-type + - invitation-no-longer-valid + - invoice-canceled + - invoice-cannot-be-refunded-due-to-too-high-amount + - invoice-incomplete + - invoice-is-draft + - invoice-locked + - invoice-must-be-buffer + - invoice-not-canceled + - invoice-not-draft + - invoice-not-found + - invoice-outdated + - invoice-paid-already + - issue-already-connected-to-github + - issue-not-found + - issues-bad-request + - issuer-not-registered + - job-finished + - label-already-linked + - last-api-token + - limit-reached + - max-items-must-be-greater-than-zero + - max-metamorphs-exceeded + - max-total-charge-usd-below-minimum + - max-total-charge-usd-must-be-greater-than-zero + - method-not-allowed + - migration-disabled + - missing-actor-rights + - missing-api-token + - missing-billing-info + - missing-line-items + - missing-payment-date + - missing-payout-billing-info + - missing-proxy-password + - missing-reporting-fields + - missing-resource-name + - missing-settings + - missing-username + - monthly-usage-limit-too-low + - more-than-one-update-not-allowed + - multiple-records-found + - must-be-admin + - name-not-unique + - next-runtime-computation-failed + - no-columns-in-exported-dataset + - no-payment-attempt-for-refund-found + - no-payment-method-available + - no-team-account-seats-available + - non-temporary-email + - not-enough-usage-to-run-paid-actor + - not-implemented + - not-supported-currencies + - o-auth-service-already-connected + - o-auth-service-not-connected + - oauth-resource-access-failed + - one-time-invoice-already-marked-paid + - only-drafts-can-be-deleted + - operation-canceled + - operation-not-allowed + - operation-timed-out + - organization-cannot-own-itself + - organization-role-not-found + - overlapping-payout-billing-periods + - own-token-required + - page-not-found + - param-not-one-of + - parameter-required + - parameters-mismatched + - password-reset-email-already-sent + - password-reset-token-expired + - pay-as-you-go-without-monthly-interval + - payment-attempt-status-message-required + - payout-already-paid + - payout-canceled + - payout-invalid-state + - payout-must-be-approved-to-be-marked-paid + - payout-not-found + - payout-number-already-exists + - phone-number-invalid + - phone-number-landline + - phone-number-opted-out + - phone-verification-disabled + - platform-feature-disabled + - price-overrides-validation-failed + - pricing-model-not-supported + - promotional-plan-not-available + - proxy-auth-ip-not-unique + - public-actor-disabled + - query-timeout + - quoted-price-outdated + - rate-limit-exceeded + - recaptcha-invalid + - recaptcha-required + - record-not-found + - record-not-public + - record-or-token-not-found + - record-too-large + - redirect-uri-mismatch + - reduced-plan-not-available + - rental-charge-already-reimbursed + - rental-not-allowed + - request-aborted-prematurely + - request-handled-or-locked + - request-id-invalid + - request-queue-duplicate-requests + - request-too-large + - requested-dataset-view-does-not-exist + - resume-token-expired + - run-failed + - run-input-body-not-valid-json + - run-timeout-exceeded + - russia-is-evil + - same-user + - schedule-actor-not-found + - schedule-actor-task-not-found + - schedule-name-not-unique + - schema-validation + - schema-validation-error + - schema-validation-failed + - sign-up-method-not-allowed + - slack-integration-not-custom + - socket-closed + - socket-destroyed + - store-schema-invalid + - store-terms-not-accepted + - stripe-enabled + - stripe-generic-decline + - stripe-not-enabled + - stripe-not-enabled-for-user + - tagged-build-required + - tax-country-invalid + - tax-number-invalid + - tax-number-validation-failed + - taxamo-call-failed + - taxamo-request-failed + - testing-error + - token-not-provided + - too-few-versions + - too-many-actor-tasks + - too-many-actors + - too-many-labels-on-resource + - too-many-mcp-connectors + - too-many-o-auth-apps + - too-many-organizations + - too-many-requests + - too-many-schedules + - too-many-ui-access-keys + - too-many-user-labels + - too-many-values + - too-many-versions + - too-many-webhooks + - unexpected-route + - unknown-build-tag + - unknown-payment-provider + - unsubscribe-token-invalid + - unsupported-actor-pricing-model-for-agentic-payments + - unsupported-content-encoding + - unsupported-file-type-for-issue + - unsupported-file-type-image-expected + - unsupported-file-type-text-or-json-expected + - unsupported-permission + - upcoming-subscription-bill-not-up-to-date + - user-already-exists + - user-already-verified + - user-creates-organizations-too-fast + - user-disabled + - user-email-is-disposable + - user-email-not-set + - user-email-not-verified + - user-has-no-subscription + - user-integration-not-found + - user-is-already-invited + - user-is-already-organization-member + - user-is-not-member-of-organization + - user-is-not-organization + - user-is-organization + - user-is-organization-owner + - user-is-removed + - user-not-found + - user-not-logged-in + - user-not-verified + - user-or-token-not-found + - user-plan-not-allowed-for-coupon + - user-problem-with-card + - user-record-not-found + - username-already-taken + - username-missing + - username-not-allowed + - username-removal-forbidden + - username-required + - verification-email-already-sent + - verification-token-expired + - version-already-exists + - versions-size-exceeded + - weak-password + - x402-agentic-payment-already-finalized + - x402-agentic-payment-insufficient-amount + - x402-agentic-payment-malformed-token + - x402-agentic-payment-settlement-failed + - x402-agentic-payment-settlement-in-progress + - x402-agentic-payment-settlement-stuck + - x402-agentic-payment-unauthorized + - x402-payment-required + - zero-invoice + title: ErrorType + type: string + ErrorDetail: + example: + type: 3d-secure-auth-failed + message: message + properties: + type: + $ref: "#/components/schemas/ErrorType" + message: + description: Human-readable error message describing what went wrong. + type: string + title: ErrorDetail + ErrorResponse: + example: + error: + type: 3d-secure-auth-failed + message: message + properties: + error: + $ref: "#/components/schemas/ErrorDetail" + required: + - error + title: ErrorResponse + VersionSourceType: + enum: + - SOURCE_FILES + - GIT_REPO + - TARBALL + - GITHUB_GIST + - SOURCE_CODE + title: VersionSourceType + type: string + EnvVar: + example: + name: name + value: value + isSecret: true + properties: + name: + type: string + value: + description: "The environment variable value. This field is absent in responses\ + \ when `isSecret` is `true`, as secret values are never returned by the\ + \ API." + type: string + isSecret: + nullable: true + type: boolean + required: + - name + title: EnvVar + SourceCodeFileFormat: + enum: + - BASE64 + - TEXT + type: string + SourceCodeFile: + example: + format: BASE64 + content: content + name: name + properties: + format: + $ref: "#/components/schemas/SourceCodeFileFormat" + content: + type: string + name: + type: string + required: + - name + title: SourceCodeFile + SourceCodeFolder: + description: | + Represents a folder in the Actor's source code structure. Distinguished from + SourceCodeFile by the presence of the `folder` property set to `true`. + properties: + name: + description: The folder path relative to the Actor's root directory. + type: string + folder: + description: Always `true` for folders. Used to distinguish folders from + files. + type: boolean + required: + - folder + - name + title: SourceCodeFolder + VersionSourceFiles: + items: + $ref: "#/components/schemas/VersionSourceFiles_inner" + title: VersionSourceFiles + type: array + default: null + Version: + example: + versionNumber: versionNumber + sourceType: "" + envVars: + - name: name + value: value + isSecret: true + - name: name + value: value + isSecret: true + applyEnvVarsToBuild: true + buildTag: buildTag + sourceFiles: + - format: BASE64 + content: content + name: name + - format: BASE64 + content: content + name: name + gitRepoUrl: gitRepoUrl + tarballUrl: tarballUrl + gitHubGistUrl: gitHubGistUrl + properties: + versionNumber: + pattern: "^([0-9]|[1-9][0-9])\\.([0-9]|[1-9][0-9])$" + type: string + sourceType: + allOf: + - $ref: "#/components/schemas/VersionSourceType" + nullable: true + envVars: + description: "" + items: + $ref: "#/components/schemas/EnvVar" + nullable: true + type: array + default: null + applyEnvVarsToBuild: + nullable: true + type: boolean + buildTag: + type: string + sourceFiles: + items: + $ref: "#/components/schemas/VersionSourceFiles_inner" + title: VersionSourceFiles + type: array + default: null + gitRepoUrl: + description: URL of the Git repository when sourceType is GIT_REPO. + nullable: true + type: string + tarballUrl: + description: URL of the tarball when sourceType is TARBALL. + nullable: true + type: string + gitHubGistUrl: + description: URL of the GitHub Gist when sourceType is GITHUB_GIST. + nullable: true + type: string + required: + - sourceType + - versionNumber + title: Version + CommonActorPricingInfo: + properties: + apifyMarginPercentage: + description: "In [0, 1], fraction of pricePerUnitUsd that goes to Apify" + type: number + createdAt: + description: When this pricing info record has been created + format: date-time + type: string + startedAt: + description: Since when is this pricing info record effective for a given + Actor + format: date-time + type: string + notifiedAboutFutureChangeAt: + format: date-time + nullable: true + type: string + x-internal: true + notifiedAboutChangeAt: + format: date-time + nullable: true + type: string + x-internal: true + reasonForChange: + nullable: true + type: string + x-internal: true + isPriceChangeNotificationSuppressed: + type: boolean + x-internal: true + forceContainsSignificantPriceChange: + type: boolean + x-internal: true + required: + - apifyMarginPercentage + - createdAt + - startedAt + title: CommonActorPricingInfo + TieredPricingPerEventEntry: + description: A single tier's price-per-event entry. + example: + tieredEventPriceUsd: 1.1730742509559433 + properties: + tieredEventPriceUsd: + description: Price per event in USD for this tier. + type: number + required: + - tieredEventPriceUsd + title: TieredPricingPerEventEntry + TieredPricingPerEvent: + additionalProperties: + $ref: "#/components/schemas/TieredPricingPerEventEntry" + description: | + Tiered price-per-event pricing for a single charge event, keyed by subscription tier (e.g. `FREE`, `BRONZE`, + `SILVER`, `GOLD`, `PLATINUM`, `DIAMOND`). The actual price applied is resolved from the user's tier. + title: TieredPricingPerEvent + ActorChargeEvent: + description: | + Definition of a single chargeable event for a pay-per-event Actor. Each event is either flat-priced + (`eventPriceUsd` is set) or tier-priced (`eventTieredPricingUsd` is set); the two are mutually exclusive. + example: + eventTitle: eventTitle + eventDescription: eventDescription + eventPriceUsd: 7.457744773683766 + eventTieredPricingUsd: + key: + tieredEventPriceUsd: 1.1730742509559433 + isPrimaryEvent: true + isOneTimeEvent: true + properties: + eventTitle: + description: Human-readable title shown to users in the billing UI. + type: string + eventDescription: + description: Human-readable description of what triggers this event. + type: string + eventPriceUsd: + description: | + Flat price per event in USD. Present only for non-tiered events. Mutually exclusive with `eventTieredPricingUsd`. + type: number + eventTieredPricingUsd: + additionalProperties: + $ref: "#/components/schemas/TieredPricingPerEventEntry" + description: | + Tiered price-per-event pricing for a single charge event, keyed by subscription tier (e.g. `FREE`, `BRONZE`, + `SILVER`, `GOLD`, `PLATINUM`, `DIAMOND`). The actual price applied is resolved from the user's tier. + title: TieredPricingPerEvent + isPrimaryEvent: + description: Whether this event is the Actor's primary chargeable event. + type: boolean + isOneTimeEvent: + description: Whether this event can only be charged once per Actor run. + type: boolean + required: + - eventDescription + - eventTitle + title: ActorChargeEvent + PayPerEventActorPricingInfo: + allOf: + - $ref: "#/components/schemas/CommonActorPricingInfo" + - properties: + pricingModel: + enum: + - PAY_PER_EVENT + type: string + pricingPerEvent: + $ref: "#/components/schemas/PayPerEventActorPricingInfo_allOf_pricingPerEvent" + minimalMaxTotalChargeUsd: + nullable: true + type: number + required: + - pricingModel + - pricingPerEvent + example: + apifyMarginPercentage: 6.84685269835264 + createdAt: 2000-01-23T04:56:07.000+00:00 + startedAt: 2000-01-23T04:56:07.000+00:00 + notifiedAboutFutureChangeAt: 2000-01-23T04:56:07.000+00:00 + notifiedAboutChangeAt: 2000-01-23T04:56:07.000+00:00 + reasonForChange: reasonForChange + isPriceChangeNotificationSuppressed: true + forceContainsSignificantPriceChange: true + pricingModel: PAY_PER_EVENT + pricingPerEvent: + actorChargeEvents: + key: + eventTitle: eventTitle + eventDescription: eventDescription + eventPriceUsd: 7.457744773683766 + eventTieredPricingUsd: + key: + tieredEventPriceUsd: 1.1730742509559433 + isPrimaryEvent: true + isOneTimeEvent: true + minimalMaxTotalChargeUsd: 4.965218492984954 + title: PayPerEventActorPricingInfo + TieredPricingPerDatasetItemEntry: + description: A single tier's price-per-dataset-item entry. + properties: + tieredPricePerUnitUsd: + description: Price per unit in USD for this tier. + type: number + required: + - tieredPricePerUnitUsd + title: TieredPricingPerDatasetItemEntry + TieredPricingPerDatasetItem: + additionalProperties: + $ref: "#/components/schemas/TieredPricingPerDatasetItemEntry" + description: | + Tiered price-per-dataset-item pricing, keyed by subscription tier (e.g. `FREE`, `BRONZE`, `SILVER`, `GOLD`, + `PLATINUM`, `DIAMOND`). The actual price applied to a run is resolved from the user's tier. + title: TieredPricingPerDatasetItem + PricePerDatasetItemActorPricingInfo: + allOf: + - $ref: "#/components/schemas/CommonActorPricingInfo" + - properties: + pricingModel: + enum: + - PRICE_PER_DATASET_ITEM + type: string + unitName: + description: Name of the unit that is being charged + type: string + pricePerUnitUsd: + description: | + Price per unit in USD. Mutually exclusive with `tieredPricing` - exactly one of the two is present + on a pricing record. + type: number + tieredPricing: + $ref: "#/components/schemas/TieredPricingPerDatasetItem" + required: + - pricingModel + - unitName + title: PricePerDatasetItemActorPricingInfo + FlatPricePerMonthActorPricingInfo: + allOf: + - $ref: "#/components/schemas/CommonActorPricingInfo" + - properties: + pricingModel: + enum: + - FLAT_PRICE_PER_MONTH + type: string + trialMinutes: + description: For how long this Actor can be used for free in trial period + type: integer + pricePerUnitUsd: + description: Monthly flat price in USD + type: number + required: + - pricePerUnitUsd + - pricingModel + - trialMinutes + title: FlatPricePerMonthActorPricingInfo + FreeActorPricingInfo: + allOf: + - $ref: "#/components/schemas/CommonActorPricingInfo" + - properties: + pricingModel: + enum: + - FREE + type: string + required: + - pricingModel + title: FreeActorPricingInfo + ActorRunPricingInfo: + discriminator: + mapping: + PAY_PER_EVENT: "#/components/schemas/PayPerEventActorPricingInfo" + PRICE_PER_DATASET_ITEM: "#/components/schemas/PricePerDatasetItemActorPricingInfo" + FLAT_PRICE_PER_MONTH: "#/components/schemas/FlatPricePerMonthActorPricingInfo" + FREE: "#/components/schemas/FreeActorPricingInfo" + propertyName: pricingModel + oneOf: + - $ref: "#/components/schemas/PayPerEventActorPricingInfo" + - $ref: "#/components/schemas/PricePerDatasetItemActorPricingInfo" + - $ref: "#/components/schemas/FlatPricePerMonthActorPricingInfo" + - $ref: "#/components/schemas/FreeActorPricingInfo" + title: ActorRunPricingInfo + ActorPermissionLevel: + description: | + Determines permissions that the Actor requires to run. For more information, see the [Actor permissions documentation](https://docs.apify.com/platform/actors/development/permissions). + enum: + - LIMITED_PERMISSIONS + - FULL_PERMISSIONS + type: string + DefaultRunOptions: + example: + build: build + timeoutSecs: 5 + memoryMbytes: 9 + restartOnError: true + maxItems: 9 + forcePermissionLevel: "" + properties: + build: + type: string + timeoutSecs: + type: integer + memoryMbytes: + type: integer + restartOnError: + type: boolean + maxItems: + nullable: true + type: integer + forcePermissionLevel: + allOf: + - $ref: "#/components/schemas/ActorPermissionLevel" + nullable: true + title: DefaultRunOptions + ActorStandby: + properties: + isEnabled: + nullable: true + type: boolean + desiredRequestsPerActorRun: + nullable: true + type: integer + maxRequestsPerActorRun: + nullable: true + type: integer + idleTimeoutSecs: + nullable: true + type: integer + build: + nullable: true + type: string + memoryMbytes: + nullable: true + type: integer + disableStandbyFieldsOverride: + nullable: true + type: boolean + shouldPassActorInput: + nullable: true + type: boolean + title: ActorStandby + ExampleRunInput: + properties: + body: + example: "{ \"helloWorld\": 123 }" + type: string + contentType: + type: string + title: ExampleRunInput + CreateActorRequest: + example: + name: name + description: description + title: title + isPublic: true + seoTitle: seoTitle + seoDescription: seoDescription + restartOnError: true + versions: + - versionNumber: versionNumber + sourceType: "" + envVars: + - name: name + value: value + isSecret: true + - name: name + value: value + isSecret: true + applyEnvVarsToBuild: true + buildTag: buildTag + sourceFiles: + - format: BASE64 + content: content + name: name + - format: BASE64 + content: content + name: name + gitRepoUrl: gitRepoUrl + tarballUrl: tarballUrl + gitHubGistUrl: gitHubGistUrl + - versionNumber: versionNumber + sourceType: "" + envVars: + - name: name + value: value + isSecret: true + - name: name + value: value + isSecret: true + applyEnvVarsToBuild: true + buildTag: buildTag + sourceFiles: + - format: BASE64 + content: content + name: name + - format: BASE64 + content: content + name: name + gitRepoUrl: gitRepoUrl + tarballUrl: tarballUrl + gitHubGistUrl: gitHubGistUrl + pricingInfos: + - apifyMarginPercentage: 6.84685269835264 + createdAt: 2000-01-23T04:56:07.000+00:00 + startedAt: 2000-01-23T04:56:07.000+00:00 + notifiedAboutFutureChangeAt: 2000-01-23T04:56:07.000+00:00 + notifiedAboutChangeAt: 2000-01-23T04:56:07.000+00:00 + reasonForChange: reasonForChange + isPriceChangeNotificationSuppressed: true + forceContainsSignificantPriceChange: true + pricingModel: PAY_PER_EVENT + pricingPerEvent: + actorChargeEvents: + key: + eventTitle: eventTitle + eventDescription: eventDescription + eventPriceUsd: 7.457744773683766 + eventTieredPricingUsd: + key: + tieredEventPriceUsd: 1.1730742509559433 + isPrimaryEvent: true + isOneTimeEvent: true + minimalMaxTotalChargeUsd: 4.965218492984954 + - apifyMarginPercentage: 6.84685269835264 + createdAt: 2000-01-23T04:56:07.000+00:00 + startedAt: 2000-01-23T04:56:07.000+00:00 + notifiedAboutFutureChangeAt: 2000-01-23T04:56:07.000+00:00 + notifiedAboutChangeAt: 2000-01-23T04:56:07.000+00:00 + reasonForChange: reasonForChange + isPriceChangeNotificationSuppressed: true + forceContainsSignificantPriceChange: true + pricingModel: PAY_PER_EVENT + pricingPerEvent: + actorChargeEvents: + key: + eventTitle: eventTitle + eventDescription: eventDescription + eventPriceUsd: 7.457744773683766 + eventTieredPricingUsd: + key: + tieredEventPriceUsd: 1.1730742509559433 + isPrimaryEvent: true + isOneTimeEvent: true + minimalMaxTotalChargeUsd: 4.965218492984954 + categories: + - categories + - categories + defaultRunOptions: + build: build + timeoutSecs: 5 + memoryMbytes: 9 + restartOnError: true + maxItems: 9 + forcePermissionLevel: "" + actorStandby: "" + exampleRunInput: "" + isDeprecated: true + properties: + name: + nullable: true + type: string + description: + nullable: true + type: string + title: + nullable: true + type: string + isPublic: + nullable: true + type: boolean + seoTitle: + nullable: true + type: string + seoDescription: + nullable: true + type: string + restartOnError: + deprecated: true + type: boolean + versions: + description: "" + items: + $ref: "#/components/schemas/Version" + nullable: true + type: array + default: null + pricingInfos: + items: + $ref: "#/components/schemas/ActorRunPricingInfo" + type: array + default: null + categories: + description: "" + items: + type: string + nullable: true + type: array + default: null + defaultRunOptions: + $ref: "#/components/schemas/DefaultRunOptions" + actorStandby: + allOf: + - $ref: "#/components/schemas/ActorStandby" + nullable: true + exampleRunInput: + allOf: + - $ref: "#/components/schemas/ExampleRunInput" + nullable: true + isDeprecated: + nullable: true + type: boolean + title: CreateActorRequest + TaggedBuildInfo: + description: Information about a tagged build. + properties: + buildId: + description: The ID of the build associated with this tag. + type: string + buildNumber: + description: The build number/version string. + pattern: "^([0-9]|[1-9][0-9])\\.([0-9]|[1-9][0-9])(\\.[1-9][0-9]{0,4})$" + type: string + buildNumberInt: + description: The build number encoded as a single integer. + type: integer + finishedAt: + description: The timestamp when the build finished. + format: date-time + nullable: true + type: string + title: TaggedBuildInfo + TaggedBuilds: + additionalProperties: + $ref: "#/components/schemas/TaggedBuilds_value" + description: "A dictionary mapping build tag names (e.g., \"latest\", \"beta\"\ + ) to their build information." + example: + latest: + buildId: z2EryhbfhgSyqj6Hn + buildNumber: 0.0.2 + finishedAt: 2019-06-10T11:15:49.286Z + beta: + buildId: abc123def456 + buildNumber: 1.0.5 + finishedAt: 2019-07-15T14:30:00.000Z + title: TaggedBuilds + Actor: + example: + id: id + userId: userId + name: name + username: username + description: description + restartOnError: true + isPublic: true + actorPermissionLevel: LIMITED_PERMISSIONS + createdAt: 2000-01-23T04:56:07.000+00:00 + modifiedAt: 2000-01-23T04:56:07.000+00:00 + stats: + totalBuilds: 0 + totalRuns: 6 + totalUsers: 1 + totalUsers7Days: 5 + totalUsers30Days: 5 + totalUsers90Days: 2 + totalMetamorphs: 7 + lastRunStartedAt: 2000-01-23T04:56:07.000+00:00 + actorReviewCount: 9 + actorReviewRating: 3.616076749251911 + bookmarkCount: 2 + publicActorRunStats30Days: + ABORTED: 4 + FAILED: 7 + SUCCEEDED: 1 + TIMED-OUT: 1 + TOTAL: 1 + versions: + - versionNumber: versionNumber + sourceType: "" + envVars: + - name: name + value: value + isSecret: true + - name: name + value: value + isSecret: true + applyEnvVarsToBuild: true + buildTag: buildTag + sourceFiles: + - format: BASE64 + content: content + name: name + - format: BASE64 + content: content + name: name + gitRepoUrl: gitRepoUrl + tarballUrl: tarballUrl + gitHubGistUrl: gitHubGistUrl + - versionNumber: versionNumber + sourceType: "" + envVars: + - name: name + value: value + isSecret: true + - name: name + value: value + isSecret: true + applyEnvVarsToBuild: true + buildTag: buildTag + sourceFiles: + - format: BASE64 + content: content + name: name + - format: BASE64 + content: content + name: name + gitRepoUrl: gitRepoUrl + tarballUrl: tarballUrl + gitHubGistUrl: gitHubGistUrl + pricingInfos: + - apifyMarginPercentage: 6.84685269835264 + createdAt: 2000-01-23T04:56:07.000+00:00 + startedAt: 2000-01-23T04:56:07.000+00:00 + notifiedAboutFutureChangeAt: 2000-01-23T04:56:07.000+00:00 + notifiedAboutChangeAt: 2000-01-23T04:56:07.000+00:00 + reasonForChange: reasonForChange + isPriceChangeNotificationSuppressed: true + forceContainsSignificantPriceChange: true + pricingModel: PAY_PER_EVENT + pricingPerEvent: + actorChargeEvents: + key: + eventTitle: eventTitle + eventDescription: eventDescription + eventPriceUsd: 7.457744773683766 + eventTieredPricingUsd: + key: + tieredEventPriceUsd: 1.1730742509559433 + isPrimaryEvent: true + isOneTimeEvent: true + minimalMaxTotalChargeUsd: 4.965218492984954 + - apifyMarginPercentage: 6.84685269835264 + createdAt: 2000-01-23T04:56:07.000+00:00 + startedAt: 2000-01-23T04:56:07.000+00:00 + notifiedAboutFutureChangeAt: 2000-01-23T04:56:07.000+00:00 + notifiedAboutChangeAt: 2000-01-23T04:56:07.000+00:00 + reasonForChange: reasonForChange + isPriceChangeNotificationSuppressed: true + forceContainsSignificantPriceChange: true + pricingModel: PAY_PER_EVENT + pricingPerEvent: + actorChargeEvents: + key: + eventTitle: eventTitle + eventDescription: eventDescription + eventPriceUsd: 7.457744773683766 + eventTieredPricingUsd: + key: + tieredEventPriceUsd: 1.1730742509559433 + isPrimaryEvent: true + isOneTimeEvent: true + minimalMaxTotalChargeUsd: 4.965218492984954 + defaultRunOptions: + build: build + timeoutSecs: 5 + memoryMbytes: 9 + restartOnError: true + maxItems: 9 + forcePermissionLevel: "" + exampleRunInput: "" + isDeprecated: true + deploymentKey: deploymentKey + title: title + taggedBuilds: "" + actorStandby: "" + readmeSummary: readmeSummary + seoTitle: seoTitle + seoDescription: seoDescription + pictureUrl: pictureUrl + standbyUrl: standbyUrl + notice: notice + categories: + - categories + - categories + isCritical: true + isGeneric: true + isSourceCodeHidden: true + hasNoDataset: true + properties: + id: + type: string + userId: + type: string + name: + type: string + username: + type: string + description: + nullable: true + type: string + restartOnError: + deprecated: true + type: boolean + isPublic: + type: boolean + actorPermissionLevel: + $ref: "#/components/schemas/ActorPermissionLevel" + createdAt: + format: date-time + type: string + modifiedAt: + format: date-time + type: string + stats: + $ref: "#/components/schemas/ActorStats" + versions: + description: "" + items: + $ref: "#/components/schemas/Version" + type: array + default: null + pricingInfos: + items: + $ref: "#/components/schemas/ActorRunPricingInfo" + type: array + default: null + defaultRunOptions: + $ref: "#/components/schemas/DefaultRunOptions" + exampleRunInput: + allOf: + - $ref: "#/components/schemas/ExampleRunInput" + nullable: true + isDeprecated: + nullable: true + type: boolean + deploymentKey: + type: string + title: + nullable: true + type: string + taggedBuilds: + allOf: + - $ref: "#/components/schemas/TaggedBuilds" + nullable: true + actorStandby: + allOf: + - $ref: "#/components/schemas/ActorStandby" + nullable: true + readmeSummary: + description: "A brief, LLM-generated readme summary" + type: string + seoTitle: + nullable: true + type: string + seoDescription: + nullable: true + type: string + pictureUrl: + nullable: true + type: string + standbyUrl: + nullable: true + type: string + notice: + type: string + categories: + items: + type: string + type: array + default: null + isCritical: + type: boolean + isGeneric: + type: boolean + isSourceCodeHidden: + type: boolean + hasNoDataset: + type: boolean + required: + - createdAt + - defaultRunOptions + - id + - isPublic + - modifiedAt + - name + - stats + - userId + - username + - versions + title: Actor + ActorResponse: + description: Response containing Actor data. + example: + data: + id: id + userId: userId + name: name + username: username + description: description + restartOnError: true + isPublic: true + actorPermissionLevel: LIMITED_PERMISSIONS + createdAt: 2000-01-23T04:56:07.000+00:00 + modifiedAt: 2000-01-23T04:56:07.000+00:00 + stats: + totalBuilds: 0 + totalRuns: 6 + totalUsers: 1 + totalUsers7Days: 5 + totalUsers30Days: 5 + totalUsers90Days: 2 + totalMetamorphs: 7 + lastRunStartedAt: 2000-01-23T04:56:07.000+00:00 + actorReviewCount: 9 + actorReviewRating: 3.616076749251911 + bookmarkCount: 2 + publicActorRunStats30Days: + ABORTED: 4 + FAILED: 7 + SUCCEEDED: 1 + TIMED-OUT: 1 + TOTAL: 1 + versions: + - versionNumber: versionNumber + sourceType: "" + envVars: + - name: name + value: value + isSecret: true + - name: name + value: value + isSecret: true + applyEnvVarsToBuild: true + buildTag: buildTag + sourceFiles: + - format: BASE64 + content: content + name: name + - format: BASE64 + content: content + name: name + gitRepoUrl: gitRepoUrl + tarballUrl: tarballUrl + gitHubGistUrl: gitHubGistUrl + - versionNumber: versionNumber + sourceType: "" + envVars: + - name: name + value: value + isSecret: true + - name: name + value: value + isSecret: true + applyEnvVarsToBuild: true + buildTag: buildTag + sourceFiles: + - format: BASE64 + content: content + name: name + - format: BASE64 + content: content + name: name + gitRepoUrl: gitRepoUrl + tarballUrl: tarballUrl + gitHubGistUrl: gitHubGistUrl + pricingInfos: + - apifyMarginPercentage: 6.84685269835264 + createdAt: 2000-01-23T04:56:07.000+00:00 + startedAt: 2000-01-23T04:56:07.000+00:00 + notifiedAboutFutureChangeAt: 2000-01-23T04:56:07.000+00:00 + notifiedAboutChangeAt: 2000-01-23T04:56:07.000+00:00 + reasonForChange: reasonForChange + isPriceChangeNotificationSuppressed: true + forceContainsSignificantPriceChange: true + pricingModel: PAY_PER_EVENT + pricingPerEvent: + actorChargeEvents: + key: + eventTitle: eventTitle + eventDescription: eventDescription + eventPriceUsd: 7.457744773683766 + eventTieredPricingUsd: + key: + tieredEventPriceUsd: 1.1730742509559433 + isPrimaryEvent: true + isOneTimeEvent: true + minimalMaxTotalChargeUsd: 4.965218492984954 + - apifyMarginPercentage: 6.84685269835264 + createdAt: 2000-01-23T04:56:07.000+00:00 + startedAt: 2000-01-23T04:56:07.000+00:00 + notifiedAboutFutureChangeAt: 2000-01-23T04:56:07.000+00:00 + notifiedAboutChangeAt: 2000-01-23T04:56:07.000+00:00 + reasonForChange: reasonForChange + isPriceChangeNotificationSuppressed: true + forceContainsSignificantPriceChange: true + pricingModel: PAY_PER_EVENT + pricingPerEvent: + actorChargeEvents: + key: + eventTitle: eventTitle + eventDescription: eventDescription + eventPriceUsd: 7.457744773683766 + eventTieredPricingUsd: + key: + tieredEventPriceUsd: 1.1730742509559433 + isPrimaryEvent: true + isOneTimeEvent: true + minimalMaxTotalChargeUsd: 4.965218492984954 + defaultRunOptions: + build: build + timeoutSecs: 5 + memoryMbytes: 9 + restartOnError: true + maxItems: 9 + forcePermissionLevel: "" + exampleRunInput: "" + isDeprecated: true + deploymentKey: deploymentKey + title: title + taggedBuilds: "" + actorStandby: "" + readmeSummary: readmeSummary + seoTitle: seoTitle + seoDescription: seoDescription + pictureUrl: pictureUrl + standbyUrl: standbyUrl + notice: notice + categories: + - categories + - categories + isCritical: true + isGeneric: true + isSourceCodeHidden: true + hasNoDataset: true + properties: + data: + $ref: "#/components/schemas/Actor" + required: + - data + title: ActorResponse + EnvVarRequest: + allOf: + - $ref: "#/components/schemas/EnvVar" + example: + name: name + value: value + isSecret: true + title: EnvVarRequest + CreateOrUpdateVersionRequest: + example: + versionNumber: versionNumber + sourceType: "" + envVars: + - name: name + value: value + isSecret: true + - name: name + value: value + isSecret: true + applyEnvVarsToBuild: true + buildTag: buildTag + sourceFiles: + - format: BASE64 + content: content + name: name + - format: BASE64 + content: content + name: name + gitRepoUrl: gitRepoUrl + tarballUrl: tarballUrl + gitHubGistUrl: gitHubGistUrl + properties: + versionNumber: + nullable: true + pattern: "^([0-9]|[1-9][0-9])\\.([0-9]|[1-9][0-9])$" + type: string + sourceType: + allOf: + - $ref: "#/components/schemas/VersionSourceType" + nullable: true + envVars: + description: "" + items: + $ref: "#/components/schemas/EnvVarRequest" + nullable: true + type: array + default: null + applyEnvVarsToBuild: + nullable: true + type: boolean + buildTag: + nullable: true + type: string + sourceFiles: + items: + $ref: "#/components/schemas/VersionSourceFiles_inner" + title: VersionSourceFiles + type: array + default: null + gitRepoUrl: + description: URL of the Git repository when sourceType is GIT_REPO. + nullable: true + type: string + tarballUrl: + description: URL of the tarball when sourceType is TARBALL. + nullable: true + type: string + gitHubGistUrl: + description: URL of the GitHub Gist when sourceType is GITHUB_GIST. + nullable: true + type: string + title: CreateOrUpdateVersionRequest + BuildTag: + properties: + buildId: + type: string + required: + - buildId + title: BuildTag + UpdateActorRequest: + example: + name: name + description: description + isPublic: true + actorPermissionLevel: "" + seoTitle: seoTitle + seoDescription: seoDescription + title: title + restartOnError: true + versions: + - versionNumber: versionNumber + sourceType: "" + envVars: + - name: name + value: value + isSecret: true + - name: name + value: value + isSecret: true + applyEnvVarsToBuild: true + buildTag: buildTag + sourceFiles: + - format: BASE64 + content: content + name: name + - format: BASE64 + content: content + name: name + gitRepoUrl: gitRepoUrl + tarballUrl: tarballUrl + gitHubGistUrl: gitHubGistUrl + - versionNumber: versionNumber + sourceType: "" + envVars: + - name: name + value: value + isSecret: true + - name: name + value: value + isSecret: true + applyEnvVarsToBuild: true + buildTag: buildTag + sourceFiles: + - format: BASE64 + content: content + name: name + - format: BASE64 + content: content + name: name + gitRepoUrl: gitRepoUrl + tarballUrl: tarballUrl + gitHubGistUrl: gitHubGistUrl + pricingInfos: + - apifyMarginPercentage: 6.84685269835264 + createdAt: 2000-01-23T04:56:07.000+00:00 + startedAt: 2000-01-23T04:56:07.000+00:00 + notifiedAboutFutureChangeAt: 2000-01-23T04:56:07.000+00:00 + notifiedAboutChangeAt: 2000-01-23T04:56:07.000+00:00 + reasonForChange: reasonForChange + isPriceChangeNotificationSuppressed: true + forceContainsSignificantPriceChange: true + pricingModel: PAY_PER_EVENT + pricingPerEvent: + actorChargeEvents: + key: + eventTitle: eventTitle + eventDescription: eventDescription + eventPriceUsd: 7.457744773683766 + eventTieredPricingUsd: + key: + tieredEventPriceUsd: 1.1730742509559433 + isPrimaryEvent: true + isOneTimeEvent: true + minimalMaxTotalChargeUsd: 4.965218492984954 + - apifyMarginPercentage: 6.84685269835264 + createdAt: 2000-01-23T04:56:07.000+00:00 + startedAt: 2000-01-23T04:56:07.000+00:00 + notifiedAboutFutureChangeAt: 2000-01-23T04:56:07.000+00:00 + notifiedAboutChangeAt: 2000-01-23T04:56:07.000+00:00 + reasonForChange: reasonForChange + isPriceChangeNotificationSuppressed: true + forceContainsSignificantPriceChange: true + pricingModel: PAY_PER_EVENT + pricingPerEvent: + actorChargeEvents: + key: + eventTitle: eventTitle + eventDescription: eventDescription + eventPriceUsd: 7.457744773683766 + eventTieredPricingUsd: + key: + tieredEventPriceUsd: 1.1730742509559433 + isPrimaryEvent: true + isOneTimeEvent: true + minimalMaxTotalChargeUsd: 4.965218492984954 + categories: + - categories + - categories + defaultRunOptions: "" + taggedBuilds: + latest: + buildId: z2EryhbfhgSyqj6Hn + beta: null + actorStandby: "" + exampleRunInput: "" + isDeprecated: true + properties: + name: + type: string + description: + nullable: true + type: string + isPublic: + type: boolean + actorPermissionLevel: + allOf: + - $ref: "#/components/schemas/ActorPermissionLevel" + nullable: true + seoTitle: + nullable: true + type: string + seoDescription: + nullable: true + type: string + title: + nullable: true + type: string + restartOnError: + deprecated: true + type: boolean + versions: + description: "" + items: + $ref: "#/components/schemas/CreateOrUpdateVersionRequest" + type: array + default: null + pricingInfos: + items: + $ref: "#/components/schemas/ActorRunPricingInfo" + type: array + default: null + categories: + description: "" + items: + type: string + nullable: true + type: array + default: null + defaultRunOptions: + allOf: + - $ref: "#/components/schemas/DefaultRunOptions" + nullable: true + taggedBuilds: + additionalProperties: + $ref: "#/components/schemas/BuildTag" + description: | + An object to modify tags on the Actor's builds. The key is the tag name (e.g., _latest_), and the value is either an object with a `buildId` or `null`. + + This operation is a patch; any existing tags that you omit from this object will be preserved. + + - **To create or reassign a tag**, provide the tag name with a `buildId`. e.g., to assign the _latest_ tag: + +   + + ```json + { + "latest": { + "buildId": "z2EryhbfhgSyqj6Hn" + } + } + ``` + + - **To remove a tag**, provide the tag name with a `null` value. e.g., to remove the _beta_ tag: + +   + + ```json + { + "beta": null + } + ``` + + - **To perform multiple operations**, combine them. The following reassigns _latest_ and removes _beta_, while preserving any other existing tags. + +   + + ```json + { + "latest": { + "buildId": "z2EryhbfhgSyqj6Hn" + }, + "beta": null + } + ``` + example: + latest: + buildId: z2EryhbfhgSyqj6Hn + beta: null + actorStandby: + allOf: + - $ref: "#/components/schemas/ActorStandby" + nullable: true + exampleRunInput: + allOf: + - $ref: "#/components/schemas/ExampleRunInput" + nullable: true + isDeprecated: + nullable: true + type: boolean + title: UpdateActorRequest + ListOfVersions: + example: + total: 0 + items: + - versionNumber: versionNumber + sourceType: "" + envVars: + - name: name + value: value + isSecret: true + - name: name + value: value + isSecret: true + applyEnvVarsToBuild: true + buildTag: buildTag + sourceFiles: + - format: BASE64 + content: content + name: name + - format: BASE64 + content: content + name: name + gitRepoUrl: gitRepoUrl + tarballUrl: tarballUrl + gitHubGistUrl: gitHubGistUrl + - versionNumber: versionNumber + sourceType: "" + envVars: + - name: name + value: value + isSecret: true + - name: name + value: value + isSecret: true + applyEnvVarsToBuild: true + buildTag: buildTag + sourceFiles: + - format: BASE64 + content: content + name: name + - format: BASE64 + content: content + name: name + gitRepoUrl: gitRepoUrl + tarballUrl: tarballUrl + gitHubGistUrl: gitHubGistUrl + properties: + total: + type: integer + items: + description: "" + items: + $ref: "#/components/schemas/Version" + type: array + default: null + required: + - items + - total + title: ListOfVersions + ListOfVersionsResponse: + example: + data: + total: 0 + items: + - versionNumber: versionNumber + sourceType: "" + envVars: + - name: name + value: value + isSecret: true + - name: name + value: value + isSecret: true + applyEnvVarsToBuild: true + buildTag: buildTag + sourceFiles: + - format: BASE64 + content: content + name: name + - format: BASE64 + content: content + name: name + gitRepoUrl: gitRepoUrl + tarballUrl: tarballUrl + gitHubGistUrl: gitHubGistUrl + - versionNumber: versionNumber + sourceType: "" + envVars: + - name: name + value: value + isSecret: true + - name: name + value: value + isSecret: true + applyEnvVarsToBuild: true + buildTag: buildTag + sourceFiles: + - format: BASE64 + content: content + name: name + - format: BASE64 + content: content + name: name + gitRepoUrl: gitRepoUrl + tarballUrl: tarballUrl + gitHubGistUrl: gitHubGistUrl + properties: + data: + $ref: "#/components/schemas/ListOfVersions" + required: + - data + title: ListOfVersionsResponse + VersionResponse: + example: + data: + versionNumber: versionNumber + sourceType: "" + envVars: + - name: name + value: value + isSecret: true + - name: name + value: value + isSecret: true + applyEnvVarsToBuild: true + buildTag: buildTag + sourceFiles: + - format: BASE64 + content: content + name: name + - format: BASE64 + content: content + name: name + gitRepoUrl: gitRepoUrl + tarballUrl: tarballUrl + gitHubGistUrl: gitHubGistUrl + properties: + data: + $ref: "#/components/schemas/Version" + required: + - data + title: VersionResponse + ListOfEnvVars: + example: + total: 0 + items: + - name: name + value: value + isSecret: true + - name: name + value: value + isSecret: true + properties: + total: + type: integer + items: + description: "" + items: + $ref: "#/components/schemas/EnvVar" + type: array + default: null + required: + - items + - total + title: ListOfEnvVars + ListOfEnvVarsResponse: + example: + data: + total: 0 + items: + - name: name + value: value + isSecret: true + - name: name + value: value + isSecret: true + properties: + data: + $ref: "#/components/schemas/ListOfEnvVars" + required: + - data + title: ListOfEnvVarsResponse + EnvVarResponse: + example: + data: + name: name + value: value + isSecret: true + properties: + data: + $ref: "#/components/schemas/EnvVar" + required: + - data + title: EnvVarResponse + WebhookEventType: + description: Type of event that triggers the webhook. + enum: + - ACTOR.BUILD.ABORTED + - ACTOR.BUILD.CREATED + - ACTOR.BUILD.FAILED + - ACTOR.BUILD.SUCCEEDED + - ACTOR.BUILD.TIMED_OUT + - ACTOR.RUN.ABORTED + - ACTOR.RUN.CREATED + - ACTOR.RUN.FAILED + - ACTOR.RUN.RESURRECTED + - ACTOR.RUN.SUCCEEDED + - ACTOR.RUN.TIMED_OUT + - TEST + title: WebhookEventType + type: string + WebhookCondition: + example: + actorId: actorId + actorTaskId: actorTaskId + actorRunId: actorRunId + properties: + actorId: + nullable: true + type: string + actorTaskId: + nullable: true + type: string + actorRunId: + nullable: true + type: string + title: WebhookCondition + WebhookDispatchStatus: + description: Status of the webhook dispatch indicating whether the HTTP request + was successful. + enum: + - ACTIVE + - SUCCEEDED + - FAILED + title: WebhookDispatchStatus + type: string + ExampleWebhookDispatch: + properties: + status: + $ref: "#/components/schemas/WebhookDispatchStatus" + finishedAt: + format: date-time + nullable: true + type: string + removedAt: + format: date-time + nullable: true + type: string + required: + - status + title: ExampleWebhookDispatch + WebhookStats: + properties: + totalDispatches: + type: integer + required: + - totalDispatches + title: WebhookStats + WebhookShort: + example: + id: id + createdAt: 2000-01-23T04:56:07.000+00:00 + modifiedAt: 2000-01-23T04:56:07.000+00:00 + userId: userId + isAdHoc: true + isApifyIntegration: true + isEnabled: true + actionType: actionType + shouldInterpolateStrings: true + eventTypes: + - ACTOR.BUILD.ABORTED + - ACTOR.BUILD.ABORTED + condition: + actorId: actorId + actorTaskId: actorTaskId + actorRunId: actorRunId + ignoreSslErrors: true + doNotRetry: true + requestUrl: https://openapi-generator.tech + lastDispatch: "" + stats: "" + properties: + id: + type: string + createdAt: + format: date-time + type: string + modifiedAt: + format: date-time + type: string + userId: + type: string + isAdHoc: + nullable: true + type: boolean + isApifyIntegration: + type: boolean + isEnabled: + type: boolean + actionType: + type: string + shouldInterpolateStrings: + nullable: true + type: boolean + eventTypes: + items: + $ref: "#/components/schemas/WebhookEventType" + type: array + default: null + condition: + $ref: "#/components/schemas/WebhookCondition" + ignoreSslErrors: + type: boolean + doNotRetry: + type: boolean + requestUrl: + format: uri + type: string + lastDispatch: + allOf: + - $ref: "#/components/schemas/ExampleWebhookDispatch" + nullable: true + stats: + allOf: + - $ref: "#/components/schemas/WebhookStats" + nullable: true + required: + - condition + - createdAt + - doNotRetry + - eventTypes + - id + - ignoreSslErrors + - modifiedAt + - requestUrl + - userId + title: WebhookShort + ListOfWebhooks: + allOf: + - $ref: "#/components/schemas/PaginationResponse" + - properties: + items: + items: + $ref: "#/components/schemas/WebhookShort" + type: array + default: null + required: + - items + example: + total: 0 + offset: 0 + limit: 1 + desc: true + count: 0 + items: + - id: id + createdAt: 2000-01-23T04:56:07.000+00:00 + modifiedAt: 2000-01-23T04:56:07.000+00:00 + userId: userId + isAdHoc: true + isApifyIntegration: true + isEnabled: true + actionType: actionType + shouldInterpolateStrings: true + eventTypes: + - ACTOR.BUILD.ABORTED + - ACTOR.BUILD.ABORTED + condition: + actorId: actorId + actorTaskId: actorTaskId + actorRunId: actorRunId + ignoreSslErrors: true + doNotRetry: true + requestUrl: https://openapi-generator.tech + lastDispatch: "" + stats: "" + - id: id + createdAt: 2000-01-23T04:56:07.000+00:00 + modifiedAt: 2000-01-23T04:56:07.000+00:00 + userId: userId + isAdHoc: true + isApifyIntegration: true + isEnabled: true + actionType: actionType + shouldInterpolateStrings: true + eventTypes: + - ACTOR.BUILD.ABORTED + - ACTOR.BUILD.ABORTED + condition: + actorId: actorId + actorTaskId: actorTaskId + actorRunId: actorRunId + ignoreSslErrors: true + doNotRetry: true + requestUrl: https://openapi-generator.tech + lastDispatch: "" + stats: "" + title: ListOfWebhooks + ListOfWebhooksResponse: + example: + data: + total: 0 + offset: 0 + limit: 1 + desc: true + count: 0 + items: + - id: id + createdAt: 2000-01-23T04:56:07.000+00:00 + modifiedAt: 2000-01-23T04:56:07.000+00:00 + userId: userId + isAdHoc: true + isApifyIntegration: true + isEnabled: true + actionType: actionType + shouldInterpolateStrings: true + eventTypes: + - ACTOR.BUILD.ABORTED + - ACTOR.BUILD.ABORTED + condition: + actorId: actorId + actorTaskId: actorTaskId + actorRunId: actorRunId + ignoreSslErrors: true + doNotRetry: true + requestUrl: https://openapi-generator.tech + lastDispatch: "" + stats: "" + - id: id + createdAt: 2000-01-23T04:56:07.000+00:00 + modifiedAt: 2000-01-23T04:56:07.000+00:00 + userId: userId + isAdHoc: true + isApifyIntegration: true + isEnabled: true + actionType: actionType + shouldInterpolateStrings: true + eventTypes: + - ACTOR.BUILD.ABORTED + - ACTOR.BUILD.ABORTED + condition: + actorId: actorId + actorTaskId: actorTaskId + actorRunId: actorRunId + ignoreSslErrors: true + doNotRetry: true + requestUrl: https://openapi-generator.tech + lastDispatch: "" + stats: "" + properties: + data: + $ref: "#/components/schemas/ListOfWebhooks" + required: + - data + title: ListOfWebhooksResponse + ActorJobStatus: + description: Status of an Actor job (run or build). + enum: + - READY + - RUNNING + - SUCCEEDED + - FAILED + - TIMING-OUT + - TIMED-OUT + - ABORTING + - ABORTED + title: ActorJobStatus + type: string + RunOrigin: + enum: + - DEVELOPMENT + - WEB + - API + - SCHEDULER + - TEST + - WEBHOOK + - ACTOR + - CLI + - CI + - STANDBY + title: RunOrigin + type: string + BuildsMeta: + example: + origin: DEVELOPMENT + clientIp: clientIp + userAgent: userAgent + properties: + origin: + $ref: "#/components/schemas/RunOrigin" + clientIp: + description: IP address of the client that started the build. + type: string + userAgent: + description: User agent of the client that started the build. + type: string + required: + - origin + title: BuildsMeta + BuildShort: + example: + id: id + actId: actId + userId: userId + status: READY + startedAt: 2000-01-23T04:56:07.000+00:00 + finishedAt: 2000-01-23T04:56:07.000+00:00 + usageTotalUsd: 5.637376656633329 + buildNumber: buildNumber + buildNumberInt: 2 + meta: + origin: DEVELOPMENT + clientIp: clientIp + userAgent: userAgent + properties: + id: + type: string + actId: + type: string + userId: + type: string + status: + $ref: "#/components/schemas/ActorJobStatus" + startedAt: + format: date-time + type: string + finishedAt: + format: date-time + nullable: true + type: string + usageTotalUsd: + type: number + buildNumber: + pattern: "^([0-9]|[1-9][0-9])\\.([0-9]|[1-9][0-9])(\\.[1-9][0-9]{0,4})$" + type: string + buildNumberInt: + type: integer + meta: + $ref: "#/components/schemas/BuildsMeta" + required: + - buildNumber + - id + - startedAt + - status + - usageTotalUsd + title: BuildShort + ListOfBuilds: + allOf: + - $ref: "#/components/schemas/PaginationResponse" + - properties: + items: + items: + $ref: "#/components/schemas/BuildShort" + type: array + default: null + required: + - items + example: + total: 0 + offset: 0 + limit: 1 + desc: true + count: 0 + items: + - id: id + actId: actId + userId: userId + status: READY + startedAt: 2000-01-23T04:56:07.000+00:00 + finishedAt: 2000-01-23T04:56:07.000+00:00 + usageTotalUsd: 5.637376656633329 + buildNumber: buildNumber + buildNumberInt: 2 + meta: + origin: DEVELOPMENT + clientIp: clientIp + userAgent: userAgent + - id: id + actId: actId + userId: userId + status: READY + startedAt: 2000-01-23T04:56:07.000+00:00 + finishedAt: 2000-01-23T04:56:07.000+00:00 + usageTotalUsd: 5.637376656633329 + buildNumber: buildNumber + buildNumberInt: 2 + meta: + origin: DEVELOPMENT + clientIp: clientIp + userAgent: userAgent + title: ListOfBuilds + ListOfBuildsResponse: + example: + data: + total: 0 + offset: 0 + limit: 1 + desc: true + count: 0 + items: + - id: id + actId: actId + userId: userId + status: READY + startedAt: 2000-01-23T04:56:07.000+00:00 + finishedAt: 2000-01-23T04:56:07.000+00:00 + usageTotalUsd: 5.637376656633329 + buildNumber: buildNumber + buildNumberInt: 2 + meta: + origin: DEVELOPMENT + clientIp: clientIp + userAgent: userAgent + - id: id + actId: actId + userId: userId + status: READY + startedAt: 2000-01-23T04:56:07.000+00:00 + finishedAt: 2000-01-23T04:56:07.000+00:00 + usageTotalUsd: 5.637376656633329 + buildNumber: buildNumber + buildNumberInt: 2 + meta: + origin: DEVELOPMENT + clientIp: clientIp + userAgent: userAgent + properties: + data: + $ref: "#/components/schemas/ListOfBuilds" + required: + - data + title: ListOfBuildsResponse + BuildStats: + properties: + durationMillis: + type: integer + runTimeSecs: + type: number + computeUnits: + type: number + imageSizeBytes: + type: integer + required: + - computeUnits + title: BuildStats + BuildOptions: + properties: + useCache: + nullable: true + type: boolean + betaPackages: + nullable: true + type: boolean + memoryMbytes: + nullable: true + type: integer + diskMbytes: + nullable: true + type: integer + title: BuildOptions + BuildUsage: + properties: + ACTOR_COMPUTE_UNITS: + nullable: true + type: number + title: BuildUsage + ActorDefinition: + description: "The definition of the Actor, the full specification of this field\ + \ can be found in [Apify docs](https://docs.apify.com/platform/actors/development/actor-definition/actor-json)" + properties: + actorSpecification: + description: The Actor specification version that this Actor follows. This + property must be set to 1. + enum: + - 1 + type: integer + name: + description: The name of the Actor. + type: string + version: + description: "The version of the Actor, typically a dot-separated sequence\ + \ of numbers (e.g., `0.1`, `1.0`, or `0.0.1`)." + pattern: "^[0-9]+(\\.[0-9]+)+$" + type: string + buildTag: + description: The tag name to be applied to a successful build of the Actor. + Defaults to 'latest' if not specified. + type: string + environmentVariables: + additionalProperties: + type: string + description: A map of environment variables to be used during local development + and deployment. + dockerfile: + description: The path to the Dockerfile used for building the Actor on the + platform. + type: string + dockerContextDir: + description: The path to the directory used as the Docker context when building + the Actor. + type: string + readme: + description: The path to the README file for the Actor. + type: string + input: + description: "The input schema object, the full specification can be found\ + \ in [Apify docs](https://docs.apify.com/platform/actors/development/actor-definition/input-schema)" + type: object + changelog: + description: The path to the CHANGELOG file displayed in the Actor's information + tab. + type: string + storages: + $ref: "#/components/schemas/ActorDefinition_storages" + defaultMemoryMbytes: + $ref: "#/components/schemas/ActorDefinition_defaultMemoryMbytes" + minMemoryMbytes: + description: Specifies the minimum amount of memory in megabytes required + by the Actor. + minimum: 128 + type: integer + maxMemoryMbytes: + description: Specifies the maximum amount of memory in megabytes required + by the Actor. + minimum: 128 + type: integer + usesStandbyMode: + description: Specifies whether Standby mode is enabled for the Actor. + type: boolean + title: ActorDefinition + Build: + example: + id: HG7ML7M8z78YcAPEB + actId: janedoe~my-actor + userId: klmdEpoiojmdEMlk3 + startedAt: 2019-11-30T07:34:24.202Z + finishedAt: 2019-12-12T09:30:12.202Z + status: SUCCEEDED + meta: + origin: WEB + clientIp: 172.234.12.34 + userAgent: Mozilla/5.0 (iPad) + stats: + durationMillis: 1000 + runTimeSecs: 45.718 + computeUnits: 0.012699444444444444 + options: + useCache: false + betaPackages: false + memoryMbytes: 1024 + diskMbytes: 2048 + usage: + ACTOR_COMPUTE_UNITS: 0.08 + usageTotalUsd: 0.02 + usageUsd: + ACTOR_COMPUTE_UNITS: 0.02 + inputSchema: "{\\n \"title\": \"Schema for ...\"}" + readme: "# Magic Actor\\nThis Actor is magic." + buildNumber: 0.1.1 + actorDefinition: + actorSpecification: 1 + name: example-actor + version: "1.0" + buildTag: latest + environmentVariables: + DEBUG_MODE: "false" + input: + type: object + properties: + prompt: + type: string + description: The text prompt to generate completions for. + maxTokens: + type: integer + description: The maximum number of tokens to generate. + required: + - prompt + storages: + dataset: + type: object + $schema: http://json-schema.org/draft-07/schema# + properties: + id: + type: string + description: Unique identifier for the generated text. + text: + type: string + description: The generated text output from the model. + required: + - id + - text + minMemoryMbytes: 512 + maxMemoryMbytes: 2048 + usesStandbyMode: false + properties: + id: + type: string + actId: + type: string + userId: + type: string + startedAt: + format: date-time + type: string + finishedAt: + format: date-time + nullable: true + type: string + status: + $ref: "#/components/schemas/ActorJobStatus" + meta: + $ref: "#/components/schemas/BuildsMeta" + stats: + allOf: + - $ref: "#/components/schemas/BuildStats" + nullable: true + options: + allOf: + - $ref: "#/components/schemas/BuildOptions" + nullable: true + usage: + allOf: + - $ref: "#/components/schemas/BuildUsage" + nullable: true + usageTotalUsd: + description: Total cost in USD for this build. Requires authentication token + to access. + nullable: true + type: number + usageUsd: + allOf: + - $ref: "#/components/schemas/BuildUsage" + description: Platform usage costs breakdown in USD for this build. Requires + authentication token to access. + nullable: true + inputSchema: + deprecated: true + nullable: true + type: string + readme: + deprecated: true + nullable: true + type: string + buildNumber: + pattern: "^([0-9]|[1-9][0-9])\\.([0-9]|[1-9][0-9])(\\.[1-9][0-9]{0,4})$" + type: string + actVersion: + $ref: "#/components/schemas/BuildActVersion" + actorDefinition: + allOf: + - $ref: "#/components/schemas/ActorDefinition" + nullable: true + required: + - actId + - buildNumber + - id + - meta + - startedAt + - status + - userId + title: Build + BuildResponse: + description: Response containing Actor build data. + example: + data: + id: HG7ML7M8z78YcAPEB + actId: janedoe~my-actor + userId: klmdEpoiojmdEMlk3 + startedAt: 2019-11-30T07:34:24.202Z + finishedAt: 2019-12-12T09:30:12.202Z + status: SUCCEEDED + meta: + origin: WEB + clientIp: 172.234.12.34 + userAgent: Mozilla/5.0 (iPad) + stats: + durationMillis: 1000 + runTimeSecs: 45.718 + computeUnits: 0.012699444444444444 + options: + useCache: false + betaPackages: false + memoryMbytes: 1024 + diskMbytes: 2048 + usage: + ACTOR_COMPUTE_UNITS: 0.08 + usageTotalUsd: 0.02 + usageUsd: + ACTOR_COMPUTE_UNITS: 0.02 + inputSchema: "{\\n \"title\": \"Schema for ...\"}" + readme: "# Magic Actor\\nThis Actor is magic." + buildNumber: 0.1.1 + actorDefinition: + actorSpecification: 1 + name: example-actor + version: "1.0" + buildTag: latest + environmentVariables: + DEBUG_MODE: "false" + input: + type: object + properties: + prompt: + type: string + description: The text prompt to generate completions for. + maxTokens: + type: integer + description: The maximum number of tokens to generate. + required: + - prompt + storages: + dataset: + type: object + $schema: http://json-schema.org/draft-07/schema# + properties: + id: + type: string + description: Unique identifier for the generated text. + text: + type: string + description: The generated text output from the model. + required: + - id + - text + minMemoryMbytes: 512 + maxMemoryMbytes: 2048 + usesStandbyMode: false + properties: + data: + $ref: "#/components/schemas/Build" + required: + - data + title: BuildResponse + RunMeta: + example: + origin: DEVELOPMENT + clientIp: clientIp + userAgent: userAgent + scheduleId: scheduleId + scheduledAt: 2000-01-23T04:56:07.000+00:00 + properties: + origin: + $ref: "#/components/schemas/RunOrigin" + clientIp: + description: IP address of the client that started the run. + nullable: true + type: string + userAgent: + description: User agent of the client that started the run. + nullable: true + type: string + scheduleId: + description: ID of the schedule that triggered the run. + nullable: true + type: string + scheduledAt: + description: Time when the run was scheduled. + format: date-time + nullable: true + type: string + required: + - origin + title: RunMeta + RunShort: + example: + id: id + actId: actId + userId: userId + actorTaskId: actorTaskId + status: READY + startedAt: 2000-01-23T04:56:07.000+00:00 + finishedAt: 2000-01-23T04:56:07.000+00:00 + buildId: buildId + buildNumber: buildNumber + buildNumberInt: 5 + meta: + origin: DEVELOPMENT + clientIp: clientIp + userAgent: userAgent + scheduleId: scheduleId + scheduledAt: 2000-01-23T04:56:07.000+00:00 + usageTotalUsd: 2.3021358869347655 + defaultKeyValueStoreId: defaultKeyValueStoreId + defaultDatasetId: defaultDatasetId + defaultRequestQueueId: defaultRequestQueueId + properties: + id: + type: string + actId: + type: string + userId: + type: string + actorTaskId: + nullable: true + type: string + status: + $ref: "#/components/schemas/ActorJobStatus" + startedAt: + format: date-time + type: string + finishedAt: + format: date-time + nullable: true + type: string + buildId: + type: string + buildNumber: + pattern: "^([0-9]|[1-9][0-9])\\.([0-9]|[1-9][0-9])(\\.[1-9][0-9]{0,4})$" + type: string + buildNumberInt: + type: integer + meta: + $ref: "#/components/schemas/RunMeta" + usageTotalUsd: + type: number + defaultKeyValueStoreId: + type: string + defaultDatasetId: + type: string + defaultRequestQueueId: + type: string + required: + - actId + - buildId + - defaultDatasetId + - defaultKeyValueStoreId + - defaultRequestQueueId + - id + - meta + - startedAt + - status + - usageTotalUsd + title: RunShort + ListOfRuns: + allOf: + - $ref: "#/components/schemas/PaginationResponse" + - properties: + items: + items: + $ref: "#/components/schemas/RunShort" + type: array + default: null + required: + - items + example: + total: 0 + offset: 0 + limit: 1 + desc: true + count: 0 + items: + - id: id + actId: actId + userId: userId + actorTaskId: actorTaskId + status: READY + startedAt: 2000-01-23T04:56:07.000+00:00 + finishedAt: 2000-01-23T04:56:07.000+00:00 + buildId: buildId + buildNumber: buildNumber + buildNumberInt: 5 + meta: + origin: DEVELOPMENT + clientIp: clientIp + userAgent: userAgent + scheduleId: scheduleId + scheduledAt: 2000-01-23T04:56:07.000+00:00 + usageTotalUsd: 2.3021358869347655 + defaultKeyValueStoreId: defaultKeyValueStoreId + defaultDatasetId: defaultDatasetId + defaultRequestQueueId: defaultRequestQueueId + - id: id + actId: actId + userId: userId + actorTaskId: actorTaskId + status: READY + startedAt: 2000-01-23T04:56:07.000+00:00 + finishedAt: 2000-01-23T04:56:07.000+00:00 + buildId: buildId + buildNumber: buildNumber + buildNumberInt: 5 + meta: + origin: DEVELOPMENT + clientIp: clientIp + userAgent: userAgent + scheduleId: scheduleId + scheduledAt: 2000-01-23T04:56:07.000+00:00 + usageTotalUsd: 2.3021358869347655 + defaultKeyValueStoreId: defaultKeyValueStoreId + defaultDatasetId: defaultDatasetId + defaultRequestQueueId: defaultRequestQueueId + title: ListOfRuns + ListOfRunsResponse: + example: + data: + total: 0 + offset: 0 + limit: 1 + desc: true + count: 0 + items: + - id: id + actId: actId + userId: userId + actorTaskId: actorTaskId + status: READY + startedAt: 2000-01-23T04:56:07.000+00:00 + finishedAt: 2000-01-23T04:56:07.000+00:00 + buildId: buildId + buildNumber: buildNumber + buildNumberInt: 5 + meta: + origin: DEVELOPMENT + clientIp: clientIp + userAgent: userAgent + scheduleId: scheduleId + scheduledAt: 2000-01-23T04:56:07.000+00:00 + usageTotalUsd: 2.3021358869347655 + defaultKeyValueStoreId: defaultKeyValueStoreId + defaultDatasetId: defaultDatasetId + defaultRequestQueueId: defaultRequestQueueId + - id: id + actId: actId + userId: userId + actorTaskId: actorTaskId + status: READY + startedAt: 2000-01-23T04:56:07.000+00:00 + finishedAt: 2000-01-23T04:56:07.000+00:00 + buildId: buildId + buildNumber: buildNumber + buildNumberInt: 5 + meta: + origin: DEVELOPMENT + clientIp: clientIp + userAgent: userAgent + scheduleId: scheduleId + scheduledAt: 2000-01-23T04:56:07.000+00:00 + usageTotalUsd: 2.3021358869347655 + defaultKeyValueStoreId: defaultKeyValueStoreId + defaultDatasetId: defaultDatasetId + defaultRequestQueueId: defaultRequestQueueId + properties: + data: + $ref: "#/components/schemas/ListOfRuns" + required: + - data + title: ListOfRunsResponse + WebhookRepresentation: + description: | + Minimal representation of an ad-hoc webhook attached to a single Actor run or build via the + `webhooks` query parameter. The query parameter value is a Base64-encoded JSON array whose + items match this schema. Persistent webhook fields (e.g. `condition`) are not used here. + properties: + eventTypes: + items: + $ref: "#/components/schemas/WebhookEventType" + type: array + default: null + requestUrl: + description: The URL to which the webhook sends its payload. + type: string + payloadTemplate: + description: Optional template for the JSON payload sent by the webhook. + nullable: true + type: string + headersTemplate: + description: Optional template for the HTTP headers sent by the webhook. + nullable: true + type: string + shouldInterpolateStrings: + description: "Flag to also interpolate `{{...}}` variables inside string\ + \ values of the payload and headers templates." + nullable: true + type: boolean + idempotencyKey: + description: "Key that prevents creating duplicate webhooks, e.g. when the\ + \ run-starting request is retried." + nullable: true + type: string + ignoreSslErrors: + description: Flag to ignore SSL errors when the webhook sends the request. + nullable: true + type: boolean + doNotRetry: + description: Flag to skip retrying the webhook request on failure. + nullable: true + type: boolean + required: + - eventTypes + - requestUrl + title: WebhookRepresentation + RunStats: + properties: + inputBodyLen: + minimum: 0 + nullable: true + type: integer + migrationCount: + minimum: 0 + type: integer + rebootCount: + minimum: 0 + type: integer + restartCount: + minimum: 0 + type: integer + resurrectCount: + minimum: 0 + type: integer + memAvgBytes: + type: number + memMaxBytes: + minimum: 0 + type: integer + memCurrentBytes: + minimum: 0 + type: integer + cpuAvgUsage: + type: number + cpuMaxUsage: + type: number + cpuCurrentUsage: + type: number + netRxBytes: + minimum: 0 + type: integer + netTxBytes: + minimum: 0 + type: integer + durationMillis: + minimum: 0 + type: integer + runTimeSecs: + minimum: 0 + type: number + metamorph: + minimum: 0 + type: integer + computeUnits: + minimum: 0 + type: number + required: + - computeUnits + - restartCount + - resurrectCount + title: RunStats + RunOptions: + properties: + build: + type: string + timeoutSecs: + minimum: 0 + type: integer + memoryMbytes: + maximum: 32768 + minimum: 128 + type: integer + diskMbytes: + minimum: 0 + type: integer + maxItems: + minimum: 1 + nullable: true + type: integer + maxTotalChargeUsd: + minimum: 0 + type: number + required: + - build + - diskMbytes + - memoryMbytes + - timeoutSecs + title: RunOptions + GeneralAccess: + description: Defines the general access level for the resource. + enum: + - ANYONE_WITH_ID_CAN_READ + - ANYONE_WITH_NAME_CAN_READ + - FOLLOW_USER_SETTING + - RESTRICTED + title: GeneralAccess + type: string + RunUsage: + properties: + ACTOR_COMPUTE_UNITS: + nullable: true + type: number + DATASET_READS: + nullable: true + type: integer + DATASET_WRITES: + nullable: true + type: integer + KEY_VALUE_STORE_READS: + nullable: true + type: integer + KEY_VALUE_STORE_WRITES: + nullable: true + type: integer + KEY_VALUE_STORE_LISTS: + nullable: true + type: integer + REQUEST_QUEUE_READS: + nullable: true + type: integer + REQUEST_QUEUE_WRITES: + nullable: true + type: integer + DATA_TRANSFER_INTERNAL_GBYTES: + nullable: true + type: number + DATA_TRANSFER_EXTERNAL_GBYTES: + nullable: true + type: number + PROXY_RESIDENTIAL_TRANSFER_GBYTES: + nullable: true + type: number + PROXY_SERPS: + nullable: true + type: integer + title: RunUsage + RunUsageUsd: + description: Resource usage costs in USD. All values are monetary amounts in + US dollars. + properties: + ACTOR_COMPUTE_UNITS: + nullable: true + type: number + DATASET_READS: + nullable: true + type: number + DATASET_WRITES: + nullable: true + type: number + KEY_VALUE_STORE_READS: + nullable: true + type: number + KEY_VALUE_STORE_WRITES: + nullable: true + type: number + KEY_VALUE_STORE_LISTS: + nullable: true + type: number + REQUEST_QUEUE_READS: + nullable: true + type: number + REQUEST_QUEUE_WRITES: + nullable: true + type: number + DATA_TRANSFER_INTERNAL_GBYTES: + nullable: true + type: number + DATA_TRANSFER_EXTERNAL_GBYTES: + nullable: true + type: number + PROXY_RESIDENTIAL_TRANSFER_GBYTES: + nullable: true + type: number + PROXY_SERPS: + nullable: true + type: number + title: RunUsageUsd + Metamorph: + description: Information about a metamorph event that occurred during the run. + example: + createdAt: 2000-01-23T04:56:07.000+00:00 + actorId: actorId + buildId: buildId + inputKey: inputKey + properties: + createdAt: + description: Time when the metamorph occurred. + format: date-time + type: string + actorId: + description: ID of the Actor that the run was metamorphed to. + type: string + buildId: + description: ID of the build used for the metamorphed Actor. + type: string + inputKey: + description: Key of the input record in the key-value store. + nullable: true + type: string + required: + - actorId + - buildId + - createdAt + title: Metamorph + Run: + description: Represents an Actor run and its associated data. + example: + id: id + actId: actId + userId: userId + actorTaskId: actorTaskId + startedAt: 2000-01-23T04:56:07.000+00:00 + finishedAt: 2000-01-23T04:56:07.000+00:00 + status: "" + statusMessage: statusMessage + isStatusMessageTerminal: true + meta: "" + pricingInfo: "" + stats: "" + chargedEventCounts: + actor-start: 1 + page-crawled: 150 + data-extracted: 75 + options: "" + buildId: buildId + exitCode: 0 + generalAccess: "" + defaultKeyValueStoreId: defaultKeyValueStoreId + defaultDatasetId: defaultDatasetId + defaultRequestQueueId: defaultRequestQueueId + storageIds: + datasets: + default: wmKPijuyDnPZAPRMk + keyValueStores: + default: wmKPijuyDnPZAPRMk + requestQueues: + default: wmKPijuyDnPZAPRMk + buildNumber: buildNumber + containerUrl: https://openapi-generator.tech + isContainerServerReady: true + gitBranchName: gitBranchName + usage: "" + usageTotalUsd: 6.027456183070403 + usageUsd: "" + metamorphs: + - createdAt: 2000-01-23T04:56:07.000+00:00 + actorId: actorId + buildId: buildId + inputKey: inputKey + - createdAt: 2000-01-23T04:56:07.000+00:00 + actorId: actorId + buildId: buildId + inputKey: inputKey + platformUsageBillingModel: platformUsageBillingModel + properties: + id: + description: Unique identifier of the Actor run. + type: string + actId: + description: ID of the Actor that was run. + type: string + userId: + description: ID of the user who started the run. + type: string + actorTaskId: + description: "ID of the Actor task, if the run was started from a task." + nullable: true + type: string + startedAt: + description: Time when the Actor run started. + format: date-time + type: string + finishedAt: + description: Time when the Actor run finished. + format: date-time + nullable: true + type: string + status: + allOf: + - $ref: "#/components/schemas/ActorJobStatus" + description: Current status of the Actor run. + statusMessage: + description: Detailed message about the run status. + nullable: true + type: string + isStatusMessageTerminal: + description: Whether the status message is terminal (final). + nullable: true + type: boolean + meta: + allOf: + - $ref: "#/components/schemas/RunMeta" + description: Metadata about the Actor run. + pricingInfo: + allOf: + - $ref: "#/components/schemas/ActorRunPricingInfo" + description: Pricing information for the Actor. + stats: + allOf: + - $ref: "#/components/schemas/RunStats" + description: Statistics of the Actor run. + chargedEventCounts: + additionalProperties: + type: integer + description: "A map of charged event types to their counts. The keys are\ + \ event type identifiers defined by the Actor's pricing model (pay-per-event),\ + \ and the values are the number of times each event was charged during\ + \ this run." + example: + actor-start: 1 + page-crawled: 150 + data-extracted: 75 + options: + allOf: + - $ref: "#/components/schemas/RunOptions" + description: Configuration options for the Actor run. + buildId: + description: ID of the Actor build used for this run. + type: string + exitCode: + description: Exit code of the Actor run process. + nullable: true + type: integer + generalAccess: + allOf: + - $ref: "#/components/schemas/GeneralAccess" + description: General access level for the Actor run. + defaultKeyValueStoreId: + description: ID of the default key-value store for this run. + type: string + defaultDatasetId: + description: ID of the default dataset for this run. + type: string + defaultRequestQueueId: + description: ID of the default request queue for this run. + type: string + storageIds: + $ref: "#/components/schemas/Run_storageIds" + buildNumber: + description: Build number of the Actor build used for this run. + nullable: true + pattern: "^([0-9]|[1-9][0-9])\\.([0-9]|[1-9][0-9])(\\.[1-9][0-9]{0,4})$" + type: string + containerUrl: + description: URL of the container running the Actor. + format: uri + type: string + isContainerServerReady: + description: Whether the container's HTTP server is ready to accept requests. + nullable: true + type: boolean + gitBranchName: + description: Name of the git branch used for the Actor build. + nullable: true + type: string + usage: + allOf: + - $ref: "#/components/schemas/RunUsage" + description: Resource usage statistics for the run. + nullable: true + usageTotalUsd: + description: "Total cost in USD for this run. Represents what you actually\ + \ pay. For run owners: includes platform usage (compute units) and/or\ + \ event costs depending on the Actor's pricing model. For run non-owners:\ + \ only available for Pay-Per-Event Actors (event costs only). Requires\ + \ authentication token to access." + nullable: true + type: number + usageUsd: + allOf: + - $ref: "#/components/schemas/RunUsageUsd" + description: "Platform usage costs breakdown in USD. Only present if you\ + \ own the run AND are paying for platform usage (Pay-Per-Usage, Rental,\ + \ or Pay-Per-Event with usage costs like standby Actors). Not available\ + \ for standard Pay-Per-Event Actors. Requires authentication token to\ + \ access." + nullable: true + metamorphs: + description: List of metamorph events that occurred during the run. + items: + $ref: "#/components/schemas/Metamorph" + nullable: true + type: array + default: null + platformUsageBillingModel: + description: Indicates which party covers platform usage costs for this + run. + type: string + required: + - actId + - buildId + - defaultDatasetId + - defaultKeyValueStoreId + - defaultRequestQueueId + - generalAccess + - id + - meta + - options + - startedAt + - stats + - status + - userId + title: Run + RunResponse: + example: + data: + id: id + actId: actId + userId: userId + actorTaskId: actorTaskId + startedAt: 2000-01-23T04:56:07.000+00:00 + finishedAt: 2000-01-23T04:56:07.000+00:00 + status: "" + statusMessage: statusMessage + isStatusMessageTerminal: true + meta: "" + pricingInfo: "" + stats: "" + chargedEventCounts: + actor-start: 1 + page-crawled: 150 + data-extracted: 75 + options: "" + buildId: buildId + exitCode: 0 + generalAccess: "" + defaultKeyValueStoreId: defaultKeyValueStoreId + defaultDatasetId: defaultDatasetId + defaultRequestQueueId: defaultRequestQueueId + storageIds: + datasets: + default: wmKPijuyDnPZAPRMk + keyValueStores: + default: wmKPijuyDnPZAPRMk + requestQueues: + default: wmKPijuyDnPZAPRMk + buildNumber: buildNumber + containerUrl: https://openapi-generator.tech + isContainerServerReady: true + gitBranchName: gitBranchName + usage: "" + usageTotalUsd: 6.027456183070403 + usageUsd: "" + metamorphs: + - createdAt: 2000-01-23T04:56:07.000+00:00 + actorId: actorId + buildId: buildId + inputKey: inputKey + - createdAt: 2000-01-23T04:56:07.000+00:00 + actorId: actorId + buildId: buildId + inputKey: inputKey + platformUsageBillingModel: platformUsageBillingModel + properties: + data: + $ref: "#/components/schemas/Run" + required: + - data + title: RunResponse + RunFailedErrorDetail: + allOf: + - $ref: "#/components/schemas/ErrorDetail" + - properties: + type: {} + ActorRunFailedError: + example: + error: + type: run-failed + message: "Actor run did not succeed (run ID: 55uatRrZib4xbZs, status: FAILED)" + properties: + error: + $ref: "#/components/schemas/RunFailedErrorDetail" + RunTimeoutExceededErrorDetail: + allOf: + - $ref: "#/components/schemas/ErrorDetail" + - properties: + type: {} + ActorRunTimeoutExceededError: + example: + error: + type: run-timeout-exceeded + message: Actor run exceeded the timeout of 300 seconds for this API endpoint + properties: + error: + $ref: "#/components/schemas/RunTimeoutExceededErrorDetail" + DatasetStats: + example: + readCount: 1 + writeCount: 5 + storageBytes: 5 + inflatedBytes: 2 + properties: + readCount: + type: integer + writeCount: + type: integer + storageBytes: + description: Total storage size in bytes. Only returned by the single-dataset + endpoint. + type: integer + inflatedBytes: + description: Uncompressed size in bytes. Only returned by the dataset list + endpoint. + type: integer + title: DatasetStats + Dataset: + example: + id: id + name: name + userId: userId + createdAt: 2000-01-23T04:56:07.000+00:00 + modifiedAt: 2000-01-23T04:56:07.000+00:00 + accessedAt: 2000-01-23T04:56:07.000+00:00 + itemCount: 0 + cleanItemCount: 0 + actId: actId + actRunId: actRunId + fields: + - fields + - fields + schema: + actorSpecification: 1 + title: My dataset + views: + overview: + title: Overview + transformation: + fields: + - linkUrl + display: + component: table + properties: + linkUrl: + label: Link URL + format: link + consoleUrl: https://openapi-generator.tech + itemsPublicUrl: https://openapi-generator.tech + urlSigningSecretKey: urlSigningSecretKey + generalAccess: ANYONE_WITH_ID_CAN_READ + stats: + readCount: 1 + writeCount: 5 + storageBytes: 5 + inflatedBytes: 2 + properties: + id: + type: string + name: + nullable: true + type: string + userId: + type: string + createdAt: + format: date-time + type: string + modifiedAt: + format: date-time + type: string + accessedAt: + format: date-time + type: string + itemCount: + minimum: 0 + type: integer + cleanItemCount: + minimum: 0 + type: integer + actId: + nullable: true + type: string + actRunId: + nullable: true + type: string + fields: + description: "" + items: + type: string + nullable: true + type: array + default: null + schema: + description: "Defines the schema of items in your dataset, the full specification\ + \ can be found in [Apify docs](/platform/actors/development/actor-definition/dataset-schema)" + example: + actorSpecification: 1 + title: My dataset + views: + overview: + title: Overview + transformation: + fields: + - linkUrl + display: + component: table + properties: + linkUrl: + label: Link URL + format: link + nullable: true + type: object + consoleUrl: + format: uri + type: string + itemsPublicUrl: + description: A public link to access the dataset items directly. + format: uri + type: string + urlSigningSecretKey: + description: A secret key for generating signed public URLs. It is only + provided to clients with WRITE permission for the dataset. + nullable: true + type: string + generalAccess: + $ref: "#/components/schemas/GeneralAccess" + stats: + $ref: "#/components/schemas/DatasetStats" + required: + - accessedAt + - cleanItemCount + - consoleUrl + - createdAt + - id + - itemCount + - modifiedAt + - userId + title: Dataset + DatasetResponse: + description: Response containing dataset metadata. + example: + data: + id: id + name: name + userId: userId + createdAt: 2000-01-23T04:56:07.000+00:00 + modifiedAt: 2000-01-23T04:56:07.000+00:00 + accessedAt: 2000-01-23T04:56:07.000+00:00 + itemCount: 0 + cleanItemCount: 0 + actId: actId + actRunId: actRunId + fields: + - fields + - fields + schema: + actorSpecification: 1 + title: My dataset + views: + overview: + title: Overview + transformation: + fields: + - linkUrl + display: + component: table + properties: + linkUrl: + label: Link URL + format: link + consoleUrl: https://openapi-generator.tech + itemsPublicUrl: https://openapi-generator.tech + urlSigningSecretKey: urlSigningSecretKey + generalAccess: ANYONE_WITH_ID_CAN_READ + stats: + readCount: 1 + writeCount: 5 + storageBytes: 5 + inflatedBytes: 2 + properties: + data: + $ref: "#/components/schemas/Dataset" + required: + - data + title: DatasetResponse + UpdateDatasetRequest: + example: + name: new-dataset-name + generalAccess: RESTRICTED + properties: + name: + nullable: true + type: string + generalAccess: + $ref: "#/components/schemas/GeneralAccess" + title: UpdateDatasetRequest + PutItemsRequest: + additionalProperties: true + description: | + The request body containing the item(s) to add to the dataset. Can be a single + object or an array of objects. Each object represents one dataset item. + example: + title: Example Item + url: https://example.com + price: 19.99 + title: PutItemsRequest + type: object + ValidationError: + properties: + instancePath: + description: The path to the instance being validated. + type: string + schemaPath: + description: The path to the schema that failed the validation. + type: string + keyword: + description: The validation keyword that caused the error. + type: string + message: + description: A message describing the validation error. + type: string + params: + description: Additional parameters specific to the validation error. + type: object + title: ValidationError + InvalidItem: + properties: + itemPosition: + description: The position of the invalid item in the array. + type: integer + validationErrors: + description: A complete list of AJV validation error objects for the invalid + item. + items: + $ref: "#/components/schemas/ValidationError" + type: array + default: null + title: InvalidItem + SchemaValidationErrorData: + properties: + invalidItems: + description: A list of invalid items in the received array of items. + items: + $ref: "#/components/schemas/InvalidItem" + type: array + default: null + required: + - invalidItems + title: SchemaValidationErrorData + DatasetSchemaValidationError: + properties: + type: + description: The type of the error. + type: string + message: + description: A human-readable message describing the error. + type: string + data: + $ref: "#/components/schemas/SchemaValidationErrorData" + title: DatasetSchemaValidationError + PutItemResponseError: + example: + error: + type: schema-validation-error + message: Schema validation failed + data: + invalidItems: + - itemPosition: 2 + validationErrors: + - instancePath: /1/stringField + schemaPath: /items/properties/stringField/type + keyword: type + params: + type: string + message: must be string + properties: + error: + $ref: "#/components/schemas/DatasetSchemaValidationError" + required: + - error + title: PutItemResponseError + DatasetFieldStatistics: + properties: + min: + description: "Minimum value of the field. For numbers, this is calculated\ + \ directly. For strings, this is the length of the shortest string. For\ + \ arrays, this is the length of the shortest array. For objects, this\ + \ is the number of keys in the smallest object." + nullable: true + type: number + max: + description: "Maximum value of the field. For numbers, this is calculated\ + \ directly. For strings, this is the length of the longest string. For\ + \ arrays, this is the length of the longest array. For objects, this is\ + \ the number of keys in the largest object." + nullable: true + type: number + nullCount: + description: How many items in the dataset have a null value for this field. + nullable: true + type: integer + emptyCount: + description: "How many items in the dataset are `undefined`, meaning that\ + \ for example empty string is not considered empty." + nullable: true + type: integer + title: DatasetFieldStatistics + DatasetStatistics: + example: + fieldStatistics: + name: + nullCount: 122 + price: + min: 59 + max: 89 + properties: + fieldStatistics: + additionalProperties: + $ref: "#/components/schemas/DatasetFieldStatistics" + description: "When you configure the dataset [fields schema](https://docs.apify.com/platform/actors/development/actor-definition/dataset-schema/validation),\ + \ we measure the statistics such as `min`, `max`, `nullCount` and `emptyCount`\ + \ for each field. This property provides statistics for each field from\ + \ dataset fields schema. <br/></br>See dataset field statistics [documentation](https://docs.apify.com/platform/actors/development/actor-definition/dataset-schema/validation#dataset-field-statistics)\ + \ for more information." + title: DatasetStatistics + DatasetStatisticsResponse: + example: + data: + fieldStatistics: + name: + nullCount: 122 + price: + min: 59 + max: 89 + properties: + data: + $ref: "#/components/schemas/DatasetStatistics" + required: + - data + title: DatasetStatisticsResponse + KeyValueStoreStats: + example: + readCount: 0 + writeCount: 6 + deleteCount: 1 + listCount: 5 + s3StorageBytes: 5 + storageBytes: 2 + properties: + readCount: + type: integer + writeCount: + type: integer + deleteCount: + type: integer + listCount: + type: integer + s3StorageBytes: + type: integer + storageBytes: + type: integer + required: + - deleteCount + - listCount + - readCount + - writeCount + title: KeyValueStoreStats + KeyValueStore: + example: + id: id + name: name + userId: userId + username: username + createdAt: 2000-01-23T04:56:07.000+00:00 + modifiedAt: 2000-01-23T04:56:07.000+00:00 + accessedAt: 2000-01-23T04:56:07.000+00:00 + actId: actId + actRunId: actRunId + consoleUrl: https://openapi-generator.tech + keysPublicUrl: https://openapi-generator.tech + recordsPublicUrl: https://openapi-generator.tech + schema: "{}" + urlSigningSecretKey: urlSigningSecretKey + generalAccess: ANYONE_WITH_ID_CAN_READ + stats: + readCount: 0 + writeCount: 6 + deleteCount: 1 + listCount: 5 + s3StorageBytes: 5 + storageBytes: 2 + properties: + id: + type: string + name: + nullable: true + type: string + userId: + nullable: true + type: string + username: + nullable: true + type: string + createdAt: + format: date-time + type: string + modifiedAt: + format: date-time + type: string + accessedAt: + format: date-time + type: string + actId: + nullable: true + type: string + actRunId: + nullable: true + type: string + consoleUrl: + format: uri + type: string + keysPublicUrl: + description: A public link to access keys of the key-value store directly. + format: uri + type: string + recordsPublicUrl: + description: A public link to access records of the key-value store directly. + format: uri + type: string + schema: + description: Optional JSON schema describing the keys stored in the key-value + store. + nullable: true + type: object + urlSigningSecretKey: + description: A secret key for generating signed public URLs. It is only + provided to clients with WRITE permission for the key-value store. + nullable: true + type: string + generalAccess: + $ref: "#/components/schemas/GeneralAccess" + stats: + $ref: "#/components/schemas/KeyValueStoreStats" + required: + - accessedAt + - createdAt + - id + - modifiedAt + title: KeyValueStore + KeyValueStoreResponse: + description: Response containing key-value store data. + example: + data: + id: id + name: name + userId: userId + username: username + createdAt: 2000-01-23T04:56:07.000+00:00 + modifiedAt: 2000-01-23T04:56:07.000+00:00 + accessedAt: 2000-01-23T04:56:07.000+00:00 + actId: actId + actRunId: actRunId + consoleUrl: https://openapi-generator.tech + keysPublicUrl: https://openapi-generator.tech + recordsPublicUrl: https://openapi-generator.tech + schema: "{}" + urlSigningSecretKey: urlSigningSecretKey + generalAccess: ANYONE_WITH_ID_CAN_READ + stats: + readCount: 0 + writeCount: 6 + deleteCount: 1 + listCount: 5 + s3StorageBytes: 5 + storageBytes: 2 + properties: + data: + $ref: "#/components/schemas/KeyValueStore" + required: + - data + title: KeyValueStoreResponse + UpdateStoreRequest: + example: + name: new-store-name + generalAccess: RESTRICTED + properties: + name: + nullable: true + type: string + generalAccess: + $ref: "#/components/schemas/GeneralAccess" + title: UpdateStoreRequest + KeyValueStoreKey: + properties: + key: + type: string + size: + type: integer + recordPublicUrl: + description: A public link to access this record directly. + format: uri + type: string + required: + - key + - recordPublicUrl + - size + title: KeyValueStoreKey + ListOfKeys: + properties: + items: + description: "" + items: + $ref: "#/components/schemas/KeyValueStoreKey" + type: array + default: null + count: + type: integer + limit: + type: integer + exclusiveStartKey: + nullable: true + type: string + isTruncated: + type: boolean + nextExclusiveStartKey: + nullable: true + type: string + required: + - count + - isTruncated + - items + - limit + title: ListOfKeys + ListOfKeysResponse: + example: + data: + items: + - key: second-key + size: 36 + recordPublicUrl: https://api.apify.com/v2/key-value-stores/WkzbQMuFYuamGv3YF/records/second-key?signature=abc123 + - key: third-key + size: 128 + recordPublicUrl: https://api.apify.com/v2/key-value-stores/WkzbQMuFYuamGv3YF/records/third-key?signature=abc123 + count: 2 + limit: 2 + exclusiveStartKey: some-key + isTruncated: true + nextExclusiveStartKey: third-key + properties: + data: + $ref: "#/components/schemas/ListOfKeys" + required: + - data + title: ListOfKeysResponse + RecordResponse: + additionalProperties: true + description: | + The response body contains the value of the record. The content type of the response + is determined by the Content-Type header stored with the record. + example: + message: "Hello, world!" + count: 42 + title: RecordResponse + type: object + PutRecordRequest: + additionalProperties: true + description: | + The request body contains the value to store in the record. The content type + should be specified in the Content-Type header. + example: + message: "Hello, world!" + count: 42 + title: PutRecordRequest + type: object + QueueId: + description: A unique identifier assigned to the request queue. + type: string + QueueUserId: + description: The ID of the user who owns the request queue. + type: string + QueueCreatedAt: + description: The timestamp when the request queue was created. + format: date-time + type: string + QueueModifiedAt: + description: "The timestamp when the request queue was last modified. Modifications\ + \ include adding, updating, or removing requests, as well as locking or unlocking\ + \ requests in the request queue." + format: date-time + type: string + QueueAccessedAt: + description: The timestamp when the request queue was last accessed. + format: date-time + type: string + TotalRequestCount: + description: The total number of requests in the request queue. + minimum: 0 + type: integer + HandledRequestCount: + description: The number of requests that have been handled. + minimum: 0 + type: integer + PendingRequestCount: + description: The number of requests that are pending and have not been handled + yet. + type: integer + HadMultipleClients: + description: Whether the request queue has been accessed by multiple different + clients. + type: boolean + RequestQueueStats: + description: Statistics about request queue operations and storage. + example: + deleteCount: 5 + headItemReadCount: 5 + readCount: 2 + storageBytes: 7 + writeCount: 9 + properties: + deleteCount: + description: The number of delete operations performed on the request queue. + type: integer + headItemReadCount: + description: The number of times requests from the head were read. + type: integer + readCount: + description: The total number of read operations performed on the request + queue. + type: integer + storageBytes: + description: The total storage size in bytes used by the request queue. + type: integer + writeCount: + description: The total number of write operations performed on the request + queue. + type: integer + title: RequestQueueStats + RequestQueue: + description: A request queue object containing metadata and statistics. + example: + id: id + name: name + userId: userId + actId: actId + actRunId: actRunId + createdAt: 2000-01-23T04:56:07.000+00:00 + modifiedAt: 2000-01-23T04:56:07.000+00:00 + accessedAt: 2000-01-23T04:56:07.000+00:00 + totalRequestCount: 0 + handledRequestCount: 0 + pendingRequestCount: 1 + hadMultipleClients: true + consoleUrl: https://openapi-generator.tech + stats: + deleteCount: 5 + headItemReadCount: 5 + readCount: 2 + storageBytes: 7 + writeCount: 9 + generalAccess: ANYONE_WITH_ID_CAN_READ + properties: + id: + description: A unique identifier assigned to the request queue. + type: string + name: + description: The name of the request queue. + nullable: true + type: string + userId: + description: The ID of the user who owns the request queue. + type: string + actId: + description: The ID of the Actor that created this request queue. + nullable: true + type: string + actRunId: + description: The ID of the Actor run that created this request queue. + nullable: true + type: string + createdAt: + description: The timestamp when the request queue was created. + format: date-time + type: string + modifiedAt: + description: "The timestamp when the request queue was last modified. Modifications\ + \ include adding, updating, or removing requests, as well as locking or\ + \ unlocking requests in the request queue." + format: date-time + type: string + accessedAt: + description: The timestamp when the request queue was last accessed. + format: date-time + type: string + totalRequestCount: + description: The total number of requests in the request queue. + minimum: 0 + type: integer + handledRequestCount: + description: The number of requests that have been handled. + minimum: 0 + type: integer + pendingRequestCount: + description: The number of requests that are pending and have not been handled + yet. + type: integer + hadMultipleClients: + description: Whether the request queue has been accessed by multiple different + clients. + type: boolean + consoleUrl: + description: The URL to view the request queue in the Apify console. + format: uri + type: string + stats: + $ref: "#/components/schemas/RequestQueueStats" + generalAccess: + $ref: "#/components/schemas/GeneralAccess" + required: + - accessedAt + - consoleUrl + - createdAt + - hadMultipleClients + - handledRequestCount + - id + - modifiedAt + - pendingRequestCount + - totalRequestCount + - userId + title: RequestQueue + RequestQueueResponse: + description: Response containing request queue data. + example: + data: + id: id + name: name + userId: userId + actId: actId + actRunId: actRunId + createdAt: 2000-01-23T04:56:07.000+00:00 + modifiedAt: 2000-01-23T04:56:07.000+00:00 + accessedAt: 2000-01-23T04:56:07.000+00:00 + totalRequestCount: 0 + handledRequestCount: 0 + pendingRequestCount: 1 + hadMultipleClients: true + consoleUrl: https://openapi-generator.tech + stats: + deleteCount: 5 + headItemReadCount: 5 + readCount: 2 + storageBytes: 7 + writeCount: 9 + generalAccess: ANYONE_WITH_ID_CAN_READ + properties: + data: + $ref: "#/components/schemas/RequestQueue" + required: + - data + title: RequestQueueResponse + UpdateRequestQueueRequest: + description: Request object for updating a request queue. + example: + name: new-request-queue-name + generalAccess: RESTRICTED + properties: + name: + description: The new name for the request queue. + nullable: true + type: string + generalAccess: + $ref: "#/components/schemas/GeneralAccess" + title: UpdateRequestQueueRequest + UniqueKey: + description: A unique key used for request de-duplication. Requests with the + same unique key are considered identical. + type: string + RequestUrl: + description: The URL of the request. + type: string + HttpMethod: + enum: + - GET + - HEAD + - POST + - PUT + - DELETE + - CONNECT + - OPTIONS + - TRACE + - PATCH + type: string + RetryCount: + description: The number of times this request has been retried. + type: integer + RequestUserData: + additionalProperties: true + description: Custom user data attached to the request. Can contain arbitrary + fields. + example: + label: DETAIL + customField: custom-value + title: RequestUserData + type: object + RequestBase: + example: + uniqueKey: uniqueKey + url: url + method: GET + retryCount: 0 + loadedUrl: loadedUrl + payload: RequestBase_payload + headers: "{}" + userData: + label: DETAIL + customField: custom-value + noRetry: true + errorMessages: + - errorMessages + - errorMessages + handledAt: 2000-01-23T04:56:07.000+00:00 + properties: + uniqueKey: + description: A unique key used for request de-duplication. Requests with + the same unique key are considered identical. + type: string + url: + description: The URL of the request. + type: string + method: + $ref: "#/components/schemas/HttpMethod" + retryCount: + description: The number of times this request has been retried. + type: integer + loadedUrl: + description: "The final URL that was loaded, after redirects (if any)." + nullable: true + type: string + payload: + $ref: "#/components/schemas/RequestBase_payload" + headers: + description: HTTP headers sent with the request. + nullable: true + type: object + userData: + additionalProperties: true + description: Custom user data attached to the request. Can contain arbitrary + fields. + example: + label: DETAIL + customField: custom-value + title: RequestUserData + type: object + noRetry: + description: Indicates whether the request should not be retried if processing + fails. + nullable: true + type: boolean + errorMessages: + description: Error messages recorded from failed processing attempts. + items: + type: string + nullable: true + type: array + default: null + handledAt: + description: "The timestamp when the request was marked as handled, if applicable." + format: date-time + nullable: true + type: string + title: RequestBase + RequestId: + description: A unique identifier assigned to the request. + type: string + Request: + allOf: + - $ref: "#/components/schemas/RequestBase" + - properties: + id: + $ref: "#/components/schemas/RequestId" + description: "A request stored in the request queue, including its metadata\ + \ and processing state." + example: + uniqueKey: uniqueKey + url: url + method: GET + retryCount: 0 + loadedUrl: loadedUrl + payload: RequestBase_payload + headers: "{}" + userData: + label: DETAIL + customField: custom-value + noRetry: true + errorMessages: + - errorMessages + - errorMessages + handledAt: 2000-01-23T04:56:07.000+00:00 + id: null + title: Request + ListOfRequests: + description: A paginated list of requests from the request queue. + properties: + items: + description: The array of requests. + items: + $ref: "#/components/schemas/Request" + type: array + default: null + limit: + description: The maximum number of requests returned in this response. + type: integer + exclusiveStartId: + deprecated: true + description: "The ID of the last request from the previous page, used for\ + \ pagination." + type: string + cursor: + description: A cursor string used for current page of results. + type: string + nextCursor: + description: A cursor string to be used to continue pagination. + type: string + required: + - items + - limit + title: ListOfRequests + ListOfRequestsResponse: + description: Response containing a list of requests from the request queue. + example: + data: + items: + - id: dnjkDMKLmdlkmlkmld + retryCount: 0 + uniqueKey: http://example.com + url: http://example.com + method: GET + loadedUrl: http://example.com/example-1 + payload: null + noRetry: false + errorMessages: null + headers: null + userData: + label: DETAIL + image: https://picserver1.eu + handledAt: 2019-06-16T10:23:31.607Z + - id: dnjkDMKLmdlkmlkmld + retryCount: 0 + uniqueKey: http://example.com + url: http://example.com + method: GET + loadedUrl: http://example.com/example-1 + payload: null + noRetry: false + errorMessages: null + headers: null + userData: + label: DETAIL + image: https://picserver1.eu + handledAt: 2019-06-16T10:23:31.607Z + limit: 2 + exclusiveStartId: Ihnsp8YrvJ8102Kj + properties: + data: + $ref: "#/components/schemas/ListOfRequests" + required: + - data + title: ListOfRequestsResponse + WasAlreadyPresent: + description: "Indicates whether a request with the same unique key already existed\ + \ in the request queue. If true, no new request was created." + type: boolean + WasAlreadyHandled: + description: Indicates whether a request with the same unique key has already + been processed by the request queue. + type: boolean + RequestRegistration: + description: "Result of registering a request in the request queue, either by\ + \ adding a new request or updating an existing one." + example: + requestId: requestId + wasAlreadyPresent: true + wasAlreadyHandled: true + properties: + requestId: + description: A unique identifier assigned to the request. + type: string + wasAlreadyPresent: + description: "Indicates whether a request with the same unique key already\ + \ existed in the request queue. If true, no new request was created." + type: boolean + wasAlreadyHandled: + description: Indicates whether a request with the same unique key has already + been processed by the request queue. + type: boolean + required: + - requestId + - wasAlreadyHandled + - wasAlreadyPresent + title: RequestRegistration + AddRequestResponse: + description: Response containing the result of adding a request to the request + queue. + example: + data: + requestId: requestId + wasAlreadyPresent: true + wasAlreadyHandled: true + properties: + data: + $ref: "#/components/schemas/RequestRegistration" + required: + - data + title: AddRequestResponse + AddedRequest: + description: Information about a request that was successfully added to a request + queue. + properties: + requestId: + description: A unique identifier assigned to the request. + type: string + uniqueKey: + description: A unique key used for request de-duplication. Requests with + the same unique key are considered identical. + type: string + wasAlreadyPresent: + description: "Indicates whether a request with the same unique key already\ + \ existed in the request queue. If true, no new request was created." + type: boolean + wasAlreadyHandled: + description: Indicates whether a request with the same unique key has already + been processed by the request queue. + type: boolean + required: + - requestId + - uniqueKey + - wasAlreadyHandled + - wasAlreadyPresent + title: AddedRequest + RequestDraft: + description: A request that failed to be processed during a request queue operation + and can be retried. + example: + id: id + uniqueKey: uniqueKey + url: url + method: GET + properties: + id: + description: A unique identifier assigned to the request. + type: string + uniqueKey: + description: A unique key used for request de-duplication. Requests with + the same unique key are considered identical. + type: string + url: + description: The URL of the request. + type: string + method: + $ref: "#/components/schemas/HttpMethod" + required: + - uniqueKey + - url + title: RequestDraft + BatchAddResult: + description: Result of a batch add operation containing successfully processed + and failed requests. + properties: + processedRequests: + description: Requests that were successfully added to the request queue. + items: + $ref: "#/components/schemas/AddedRequest" + type: array + default: null + unprocessedRequests: + description: Requests that failed to be added and can be retried. + items: + $ref: "#/components/schemas/RequestDraft" + type: array + default: null + required: + - processedRequests + - unprocessedRequests + title: BatchAddResult + BatchAddResponse: + description: Response containing the result of a batch add operation. + example: + data: + processedRequests: + - requestId: YiKoxjkaS9gjGTqhF + uniqueKey: http://example.com + wasAlreadyPresent: true + wasAlreadyHandled: false + unprocessedRequests: + - uniqueKey: http://example.com/2 + url: http://example.com/2 + method: GET + properties: + data: + $ref: "#/components/schemas/BatchAddResult" + required: + - data + title: BatchAddResponse + RequestDraftDeleteById: + description: "A request that should be deleted, identified by its ID." + example: + id: id + uniqueKey: uniqueKey + properties: + id: + description: A unique identifier assigned to the request. + type: string + uniqueKey: + description: A unique key used for request de-duplication. Requests with + the same unique key are considered identical. + type: string + required: + - id + title: RequestDraftDeleteById + RequestDraftDeleteByUniqueKey: + description: "A request that should be deleted, identified by its unique key." + properties: + id: + description: A unique identifier assigned to the request. + type: string + uniqueKey: + description: A unique key used for request de-duplication. Requests with + the same unique key are considered identical. + type: string + required: + - uniqueKey + title: RequestDraftDeleteByUniqueKey + RequestDraftDelete: + anyOf: + - $ref: "#/components/schemas/RequestDraftDeleteById" + - $ref: "#/components/schemas/RequestDraftDeleteByUniqueKey" + description: A request that should be deleted. + title: RequestDraftDelete + DeletedRequestById: + description: "Confirmation of a request that was successfully deleted, identified\ + \ by its ID." + example: + uniqueKey: uniqueKey + id: id + properties: + uniqueKey: + description: A unique key used for request de-duplication. Requests with + the same unique key are considered identical. + type: string + id: + description: A unique identifier assigned to the request. + type: string + required: + - id + title: DeletedRequestById + DeletedRequestByUniqueKey: + description: "Confirmation of a request that was successfully deleted, identified\ + \ by its unique key." + properties: + uniqueKey: + description: A unique key used for request de-duplication. Requests with + the same unique key are considered identical. + type: string + id: + description: A unique identifier assigned to the request. + type: string + required: + - uniqueKey + title: DeletedRequestByUniqueKey + DeletedRequest: + anyOf: + - $ref: "#/components/schemas/DeletedRequestById" + - $ref: "#/components/schemas/DeletedRequestByUniqueKey" + description: Confirmation of a request that was successfully deleted from a + request queue. + title: DeletedRequest + BatchDeleteResult: + description: Result of a batch delete operation containing successfully deleted + and failed requests. + example: + processedRequests: + - uniqueKey: uniqueKey + id: id + - uniqueKey: uniqueKey + id: id + unprocessedRequests: + - id: id + uniqueKey: uniqueKey + url: url + method: GET + - id: id + uniqueKey: uniqueKey + url: url + method: GET + properties: + processedRequests: + description: Requests that were successfully deleted from the request queue. + items: + $ref: "#/components/schemas/DeletedRequest" + type: array + default: null + unprocessedRequests: + description: Requests that failed to be deleted and can be retried. + items: + $ref: "#/components/schemas/RequestDraft" + type: array + default: null + required: + - processedRequests + - unprocessedRequests + title: BatchDeleteResult + BatchDeleteResponse: + description: Response containing the result of a batch delete operation. + example: + data: + processedRequests: + - uniqueKey: uniqueKey + id: id + - uniqueKey: uniqueKey + id: id + unprocessedRequests: + - id: id + uniqueKey: uniqueKey + url: url + method: GET + - id: id + uniqueKey: uniqueKey + url: url + method: GET + properties: + data: + $ref: "#/components/schemas/BatchDeleteResult" + required: + - data + title: BatchDeleteResponse + UnlockRequestsResult: + description: Result of unlocking requests in the request queue. + example: + unlockedCount: 0 + properties: + unlockedCount: + description: Number of requests that were successfully unlocked. + type: integer + required: + - unlockedCount + title: UnlockRequestsResult + UnlockRequestsResponse: + description: Response containing the result of unlocking requests. + example: + data: + unlockedCount: 0 + properties: + data: + $ref: "#/components/schemas/UnlockRequestsResult" + required: + - data + title: UnlockRequestsResponse + RequestResponse: + description: Response containing a single request from the request queue. + example: + data: + uniqueKey: uniqueKey + url: url + method: GET + retryCount: 0 + loadedUrl: loadedUrl + payload: RequestBase_payload + headers: "{}" + userData: + label: DETAIL + customField: custom-value + noRetry: true + errorMessages: + - errorMessages + - errorMessages + handledAt: 2000-01-23T04:56:07.000+00:00 + id: null + properties: + data: + $ref: "#/components/schemas/Request" + required: + - data + title: RequestResponse + UpdateRequestResponse: + description: Response containing the result of updating a request in the request + queue. + example: + data: + requestId: requestId + wasAlreadyPresent: true + wasAlreadyHandled: true + properties: + data: + $ref: "#/components/schemas/RequestRegistration" + required: + - data + title: UpdateRequestResponse + LockExpiresAt: + description: The timestamp when the lock on this request expires. + format: date-time + type: string + RequestLockInfo: + description: Information about a request lock. + example: + lockExpiresAt: 2000-01-23T04:56:07.000+00:00 + properties: + lockExpiresAt: + description: The timestamp when the lock on this request expires. + format: date-time + type: string + required: + - lockExpiresAt + title: RequestLockInfo + ProlongRequestLockResponse: + description: Response containing updated lock information after prolonging a + request lock. + example: + data: + lockExpiresAt: 2000-01-23T04:56:07.000+00:00 + properties: + data: + $ref: "#/components/schemas/RequestLockInfo" + required: + - data + title: ProlongRequestLockResponse + HeadLimit: + description: The maximum number of requests returned. + type: integer + HeadRequest: + description: A request from the request queue head without lock information. + properties: + id: + description: A unique identifier assigned to the request. + type: string + uniqueKey: + description: A unique key used for request de-duplication. Requests with + the same unique key are considered identical. + type: string + url: + description: The URL of the request. + type: string + method: + $ref: "#/components/schemas/HttpMethod" + retryCount: + description: The number of times this request has been retried. + type: integer + required: + - id + - uniqueKey + - url + title: HeadRequest + RequestQueueHead: + description: A batch of requests from the request queue head without locking. + properties: + limit: + description: The maximum number of requests returned. + type: integer + queueModifiedAt: + description: "The timestamp when the request queue was last modified. Modifications\ + \ include adding, updating, or removing requests, as well as locking or\ + \ unlocking requests in the request queue." + format: date-time + type: string + hadMultipleClients: + description: Whether the request queue has been accessed by multiple different + clients. + type: boolean + items: + description: The array of requests from the request queue head. + items: + $ref: "#/components/schemas/HeadRequest" + type: array + default: null + required: + - hadMultipleClients + - items + - limit + - queueModifiedAt + title: RequestQueueHead + HeadResponse: + description: Response containing requests from the request queue head without + locking. + example: + data: + limit: 1000 + queueModifiedAt: 2018-03-14T23:00:00.000Z + hadMultipleClients: false + items: + - id: 8OamqXBCpPHxyH9 + retryCount: 0 + uniqueKey: http://example.com + url: http://example.com + method: GET + - id: ZJAoqlRijenMQIn + retryCount: 0 + uniqueKey: http://example.com/a/b + url: http://example.com/a/b + method: GET + - id: hAhkwyk5oOBHKQC + retryCount: 1 + uniqueKey: http://example.com/c/d + url: http://example.com/c/d + method: GET + properties: + data: + $ref: "#/components/schemas/RequestQueueHead" + required: + - data + title: HeadResponse + LockedHeadRequest: + description: A request from the request queue head that has been locked for + processing. + properties: + id: + description: A unique identifier assigned to the request. + type: string + uniqueKey: + description: A unique key used for request de-duplication. Requests with + the same unique key are considered identical. + type: string + url: + description: The URL of the request. + type: string + method: + $ref: "#/components/schemas/HttpMethod" + retryCount: + description: The number of times this request has been retried. + type: integer + lockExpiresAt: + description: The timestamp when the lock on this request expires. + format: date-time + type: string + required: + - id + - lockExpiresAt + - uniqueKey + - url + title: LockedHeadRequest + LockedRequestQueueHead: + description: A batch of locked requests from the request queue head. + properties: + limit: + description: The maximum number of requests returned. + type: integer + queueModifiedAt: + description: "The timestamp when the request queue was last modified. Modifications\ + \ include adding, updating, or removing requests, as well as locking or\ + \ unlocking requests in the request queue." + format: date-time + type: string + queueHasLockedRequests: + description: Whether the request queue contains requests locked by any client + (either the one calling the endpoint or a different one). + type: boolean + clientKey: + description: The client key used for locking the requests. + type: string + hadMultipleClients: + description: Whether the request queue has been accessed by multiple different + clients. + type: boolean + lockSecs: + description: The number of seconds the locks will be held. + type: integer + items: + description: The array of locked requests from the request queue head. + items: + $ref: "#/components/schemas/LockedHeadRequest" + type: array + default: null + required: + - hadMultipleClients + - items + - limit + - lockSecs + - queueModifiedAt + title: LockedRequestQueueHead + HeadAndLockResponse: + description: Response containing locked requests from the request queue head. + example: + data: + limit: 3 + queueModifiedAt: 2018-03-14T23:00:00.000Z + hadMultipleClients: true + lockSecs: 60 + items: + - id: 8OamqXBCpPHxyj9 + retryCount: 0 + uniqueKey: http://example.com + url: http://example.com + method: GET + lockExpiresAt: 2022-06-14T23:00:00.000Z + - id: 8OamqXBCpPHxyx9 + retryCount: 0 + uniqueKey: http://example.com/a + url: http://example.com/a + method: GET + lockExpiresAt: 2022-06-14T23:00:00.000Z + - id: 8OamqXBCpPHxy08 + retryCount: 0 + uniqueKey: http://example.com/a/b + url: http://example.com/a/b + method: GET + lockExpiresAt: 2022-06-14T23:00:00.000Z + properties: + data: + $ref: "#/components/schemas/LockedRequestQueueHead" + required: + - data + title: HeadAndLockResponse + TaskStats: + properties: + totalRuns: + type: integer + title: TaskStats + TaskShort: + example: + id: id + userId: userId + actId: actId + actName: actName + name: name + username: username + actUsername: actUsername + createdAt: 2000-01-23T04:56:07.000+00:00 + modifiedAt: 2000-01-23T04:56:07.000+00:00 + stats: "" + properties: + id: + type: string + userId: + type: string + actId: + type: string + actName: + nullable: true + type: string + name: + type: string + username: + nullable: true + type: string + actUsername: + nullable: true + type: string + createdAt: + format: date-time + type: string + modifiedAt: + format: date-time + type: string + stats: + allOf: + - $ref: "#/components/schemas/TaskStats" + nullable: true + required: + - actId + - createdAt + - id + - modifiedAt + - name + - userId + title: TaskShort + ListOfTasks: + allOf: + - $ref: "#/components/schemas/PaginationResponse" + - properties: + items: + items: + $ref: "#/components/schemas/TaskShort" + type: array + default: null + required: + - items + example: + total: 0 + offset: 0 + limit: 1 + desc: true + count: 0 + items: + - id: id + userId: userId + actId: actId + actName: actName + name: name + username: username + actUsername: actUsername + createdAt: 2000-01-23T04:56:07.000+00:00 + modifiedAt: 2000-01-23T04:56:07.000+00:00 + stats: "" + - id: id + userId: userId + actId: actId + actName: actName + name: name + username: username + actUsername: actUsername + createdAt: 2000-01-23T04:56:07.000+00:00 + modifiedAt: 2000-01-23T04:56:07.000+00:00 + stats: "" + title: ListOfTasks + ListOfTasksResponse: + example: + data: + total: 0 + offset: 0 + limit: 1 + desc: true + count: 0 + items: + - id: id + userId: userId + actId: actId + actName: actName + name: name + username: username + actUsername: actUsername + createdAt: 2000-01-23T04:56:07.000+00:00 + modifiedAt: 2000-01-23T04:56:07.000+00:00 + stats: "" + - id: id + userId: userId + actId: actId + actName: actName + name: name + username: username + actUsername: actUsername + createdAt: 2000-01-23T04:56:07.000+00:00 + modifiedAt: 2000-01-23T04:56:07.000+00:00 + stats: "" + properties: + data: + $ref: "#/components/schemas/ListOfTasks" + required: + - data + title: ListOfTasksResponse + TaskOptions: + properties: + build: + nullable: true + type: string + timeoutSecs: + nullable: true + type: integer + memoryMbytes: + nullable: true + type: integer + maxItems: + nullable: true + type: integer + maxTotalChargeUsd: + nullable: true + type: number + restartOnError: + nullable: true + type: boolean + title: TaskOptions + TaskInput: + additionalProperties: true + description: | + The input configuration for the Actor task. This is a user-defined JSON object + that will be passed to the Actor when the task is run. + example: + startUrls: + - url: https://example.com + maxRequestsPerCrawl: 100 + title: TaskInput + type: object + CreateTaskRequest: + example: + actId: actId + name: name + options: "" + input: "" + title: title + actorStandby: "" + properties: + actId: + type: string + name: + type: string + options: + allOf: + - $ref: "#/components/schemas/TaskOptions" + nullable: true + input: + allOf: + - $ref: "#/components/schemas/TaskInput" + nullable: true + title: + nullable: true + type: string + actorStandby: + allOf: + - $ref: "#/components/schemas/ActorStandby" + nullable: true + required: + - actId + title: CreateTaskRequest + Task: + example: + id: id + userId: userId + actId: actId + name: name + username: username + createdAt: 2000-01-23T04:56:07.000+00:00 + modifiedAt: 2000-01-23T04:56:07.000+00:00 + removedAt: 2000-01-23T04:56:07.000+00:00 + stats: "" + options: "" + input: "" + title: title + actorStandby: "" + standbyUrl: https://openapi-generator.tech + properties: + id: + type: string + userId: + type: string + actId: + type: string + name: + type: string + username: + nullable: true + type: string + createdAt: + format: date-time + type: string + modifiedAt: + format: date-time + type: string + removedAt: + format: date-time + nullable: true + type: string + stats: + allOf: + - $ref: "#/components/schemas/TaskStats" + nullable: true + options: + allOf: + - $ref: "#/components/schemas/TaskOptions" + nullable: true + input: + allOf: + - $ref: "#/components/schemas/TaskInput" + nullable: true + title: + nullable: true + type: string + actorStandby: + allOf: + - $ref: "#/components/schemas/ActorStandby" + nullable: true + standbyUrl: + format: uri + nullable: true + type: string + required: + - actId + - createdAt + - id + - modifiedAt + - name + - userId + title: Task + TaskResponse: + description: Response containing Actor task data. + example: + data: + id: zdc3Pyhyz3m8vjDeM + userId: wRsJZtadYvn4mBZmm + actId: asADASadYvn4mBZmm + name: my-task + username: janedoe + createdAt: 2018-10-26T07:23:14.855Z + modifiedAt: 2018-10-26T13:30:49.578Z + removedAt: null + stats: + totalRuns: 15 + options: + build: latest + timeoutSecs: 300 + memoryMbytes: 128 + input: + hello: world + properties: + data: + $ref: "#/components/schemas/Task" + required: + - data + title: TaskResponse + UpdateTaskRequest: + example: + name: name + options: "" + input: "" + title: title + actorStandby: "" + properties: + name: + type: string + options: + allOf: + - $ref: "#/components/schemas/TaskOptions" + nullable: true + input: + allOf: + - $ref: "#/components/schemas/TaskInput" + nullable: true + title: + nullable: true + type: string + actorStandby: + allOf: + - $ref: "#/components/schemas/ActorStandby" + nullable: true + title: UpdateTaskRequest + Webhook: + example: + id: id + createdAt: 2000-01-23T04:56:07.000+00:00 + modifiedAt: 2000-01-23T04:56:07.000+00:00 + userId: userId + isAdHoc: true + shouldInterpolateStrings: true + eventTypes: + - ACTOR.BUILD.ABORTED + - ACTOR.BUILD.ABORTED + condition: + actorId: actorId + actorTaskId: actorTaskId + actorRunId: actorRunId + ignoreSslErrors: true + doNotRetry: true + requestUrl: https://openapi-generator.tech + payloadTemplate: payloadTemplate + headersTemplate: headersTemplate + description: description + lastDispatch: "" + stats: "" + properties: + id: + type: string + createdAt: + format: date-time + type: string + modifiedAt: + format: date-time + type: string + userId: + type: string + isAdHoc: + nullable: true + type: boolean + shouldInterpolateStrings: + nullable: true + type: boolean + eventTypes: + items: + $ref: "#/components/schemas/WebhookEventType" + type: array + default: null + condition: + $ref: "#/components/schemas/WebhookCondition" + ignoreSslErrors: + type: boolean + doNotRetry: + nullable: true + type: boolean + requestUrl: + format: uri + type: string + payloadTemplate: + nullable: true + type: string + headersTemplate: + nullable: true + type: string + description: + nullable: true + type: string + lastDispatch: + allOf: + - $ref: "#/components/schemas/ExampleWebhookDispatch" + nullable: true + stats: + allOf: + - $ref: "#/components/schemas/WebhookStats" + nullable: true + required: + - condition + - createdAt + - eventTypes + - id + - ignoreSslErrors + - modifiedAt + - requestUrl + - userId + title: Webhook + UpdateRunRequest: + example: + runId: runId + statusMessage: statusMessage + isStatusMessageTerminal: true + generalAccess: ANYONE_WITH_ID_CAN_READ + properties: + runId: + type: string + statusMessage: + type: string + isStatusMessageTerminal: + type: boolean + generalAccess: + $ref: "#/components/schemas/GeneralAccess" + title: UpdateRunRequest + ChargeRunRequest: + example: + eventName: eventName + count: 0 + properties: + eventName: + type: string + count: + type: integer + required: + - count + - eventName + title: ChargeRunRequest + StorageOwnership: + enum: + - ownedByMe + - sharedWithMe + type: string + ListOfKeyValueStores: + allOf: + - $ref: "#/components/schemas/PaginationResponse" + - properties: + unnamed: + description: Whether the listing was filtered to only unnamed key-value + stores. + type: boolean + items: + items: + $ref: "#/components/schemas/KeyValueStore" + type: array + default: null + required: + - items + example: + total: 0 + offset: 0 + limit: 1 + desc: true + count: 0 + unnamed: true + items: + - id: id + name: name + userId: userId + username: username + createdAt: 2000-01-23T04:56:07.000+00:00 + modifiedAt: 2000-01-23T04:56:07.000+00:00 + accessedAt: 2000-01-23T04:56:07.000+00:00 + actId: actId + actRunId: actRunId + consoleUrl: https://openapi-generator.tech + keysPublicUrl: https://openapi-generator.tech + recordsPublicUrl: https://openapi-generator.tech + schema: "{}" + urlSigningSecretKey: urlSigningSecretKey + generalAccess: ANYONE_WITH_ID_CAN_READ + stats: + readCount: 0 + writeCount: 6 + deleteCount: 1 + listCount: 5 + s3StorageBytes: 5 + storageBytes: 2 + - id: id + name: name + userId: userId + username: username + createdAt: 2000-01-23T04:56:07.000+00:00 + modifiedAt: 2000-01-23T04:56:07.000+00:00 + accessedAt: 2000-01-23T04:56:07.000+00:00 + actId: actId + actRunId: actRunId + consoleUrl: https://openapi-generator.tech + keysPublicUrl: https://openapi-generator.tech + recordsPublicUrl: https://openapi-generator.tech + schema: "{}" + urlSigningSecretKey: urlSigningSecretKey + generalAccess: ANYONE_WITH_ID_CAN_READ + stats: + readCount: 0 + writeCount: 6 + deleteCount: 1 + listCount: 5 + s3StorageBytes: 5 + storageBytes: 2 + title: ListOfKeyValueStores + ListOfKeyValueStoresResponse: + example: + data: + total: 0 + offset: 0 + limit: 1 + desc: true + count: 0 + unnamed: true + items: + - id: id + name: name + userId: userId + username: username + createdAt: 2000-01-23T04:56:07.000+00:00 + modifiedAt: 2000-01-23T04:56:07.000+00:00 + accessedAt: 2000-01-23T04:56:07.000+00:00 + actId: actId + actRunId: actRunId + consoleUrl: https://openapi-generator.tech + keysPublicUrl: https://openapi-generator.tech + recordsPublicUrl: https://openapi-generator.tech + schema: "{}" + urlSigningSecretKey: urlSigningSecretKey + generalAccess: ANYONE_WITH_ID_CAN_READ + stats: + readCount: 0 + writeCount: 6 + deleteCount: 1 + listCount: 5 + s3StorageBytes: 5 + storageBytes: 2 + - id: id + name: name + userId: userId + username: username + createdAt: 2000-01-23T04:56:07.000+00:00 + modifiedAt: 2000-01-23T04:56:07.000+00:00 + accessedAt: 2000-01-23T04:56:07.000+00:00 + actId: actId + actRunId: actRunId + consoleUrl: https://openapi-generator.tech + keysPublicUrl: https://openapi-generator.tech + recordsPublicUrl: https://openapi-generator.tech + schema: "{}" + urlSigningSecretKey: urlSigningSecretKey + generalAccess: ANYONE_WITH_ID_CAN_READ + stats: + readCount: 0 + writeCount: 6 + deleteCount: 1 + listCount: 5 + s3StorageBytes: 5 + storageBytes: 2 + properties: + data: + $ref: "#/components/schemas/ListOfKeyValueStores" + required: + - data + title: ListOfKeyValueStoresResponse + DatasetListItem: + example: + id: id + name: name + userId: userId + createdAt: 2000-01-23T04:56:07.000+00:00 + modifiedAt: 2000-01-23T04:56:07.000+00:00 + accessedAt: 2000-01-23T04:56:07.000+00:00 + itemCount: 5 + cleanItemCount: 2 + actId: actId + actRunId: actRunId + title: title + username: username + generalAccess: ANYONE_WITH_ID_CAN_READ + stats: + readCount: 1 + writeCount: 5 + storageBytes: 5 + inflatedBytes: 2 + properties: + id: + type: string + name: + type: string + userId: + type: string + createdAt: + format: date-time + type: string + modifiedAt: + format: date-time + type: string + accessedAt: + format: date-time + type: string + itemCount: + type: integer + cleanItemCount: + type: integer + actId: + nullable: true + type: string + actRunId: + nullable: true + type: string + title: + nullable: true + type: string + username: + type: string + generalAccess: + $ref: "#/components/schemas/GeneralAccess" + stats: + $ref: "#/components/schemas/DatasetStats" + required: + - accessedAt + - cleanItemCount + - createdAt + - id + - itemCount + - modifiedAt + - name + - userId + title: DatasetListItem + ListOfDatasets: + allOf: + - $ref: "#/components/schemas/PaginationResponse" + - properties: + unnamed: + description: Whether the listing was filtered to only unnamed datasets. + type: boolean + items: + items: + $ref: "#/components/schemas/DatasetListItem" + type: array + default: null + required: + - items + example: + total: 0 + offset: 0 + limit: 1 + desc: true + count: 0 + unnamed: true + items: + - id: id + name: name + userId: userId + createdAt: 2000-01-23T04:56:07.000+00:00 + modifiedAt: 2000-01-23T04:56:07.000+00:00 + accessedAt: 2000-01-23T04:56:07.000+00:00 + itemCount: 5 + cleanItemCount: 2 + actId: actId + actRunId: actRunId + title: title + username: username + generalAccess: ANYONE_WITH_ID_CAN_READ + stats: + readCount: 1 + writeCount: 5 + storageBytes: 5 + inflatedBytes: 2 + - id: id + name: name + userId: userId + createdAt: 2000-01-23T04:56:07.000+00:00 + modifiedAt: 2000-01-23T04:56:07.000+00:00 + accessedAt: 2000-01-23T04:56:07.000+00:00 + itemCount: 5 + cleanItemCount: 2 + actId: actId + actRunId: actRunId + title: title + username: username + generalAccess: ANYONE_WITH_ID_CAN_READ + stats: + readCount: 1 + writeCount: 5 + storageBytes: 5 + inflatedBytes: 2 + title: ListOfDatasets + ListOfDatasetsResponse: + example: + data: + total: 0 + offset: 0 + limit: 1 + desc: true + count: 0 + unnamed: true + items: + - id: id + name: name + userId: userId + createdAt: 2000-01-23T04:56:07.000+00:00 + modifiedAt: 2000-01-23T04:56:07.000+00:00 + accessedAt: 2000-01-23T04:56:07.000+00:00 + itemCount: 5 + cleanItemCount: 2 + actId: actId + actRunId: actRunId + title: title + username: username + generalAccess: ANYONE_WITH_ID_CAN_READ + stats: + readCount: 1 + writeCount: 5 + storageBytes: 5 + inflatedBytes: 2 + - id: id + name: name + userId: userId + createdAt: 2000-01-23T04:56:07.000+00:00 + modifiedAt: 2000-01-23T04:56:07.000+00:00 + accessedAt: 2000-01-23T04:56:07.000+00:00 + itemCount: 5 + cleanItemCount: 2 + actId: actId + actRunId: actRunId + title: title + username: username + generalAccess: ANYONE_WITH_ID_CAN_READ + stats: + readCount: 1 + writeCount: 5 + storageBytes: 5 + inflatedBytes: 2 + properties: + data: + $ref: "#/components/schemas/ListOfDatasets" + required: + - data + title: ListOfDatasetsResponse + RequestQueueShort: + description: A shortened request queue object for list responses. + example: + id: id + name: name + userId: userId + username: username + createdAt: 2000-01-23T04:56:07.000+00:00 + modifiedAt: 2000-01-23T04:56:07.000+00:00 + accessedAt: 2000-01-23T04:56:07.000+00:00 + expireAt: 2000-01-23T04:56:07.000+00:00 + totalRequestCount: 0 + handledRequestCount: 0 + pendingRequestCount: 7 + actId: actId + actRunId: actRunId + hadMultipleClients: true + generalAccess: ANYONE_WITH_ID_CAN_READ + stats: + deleteCount: 5 + headItemReadCount: 5 + readCount: 2 + storageBytes: 7 + writeCount: 9 + properties: + id: + description: A unique identifier assigned to the request queue. + type: string + name: + description: The name of the request queue. + type: string + userId: + description: The ID of the user who owns the request queue. + type: string + username: + description: The username of the user who owns the request queue. + type: string + createdAt: + description: The timestamp when the request queue was created. + format: date-time + type: string + modifiedAt: + description: "The timestamp when the request queue was last modified. Modifications\ + \ include adding, updating, or removing requests, as well as locking or\ + \ unlocking requests in the request queue." + format: date-time + type: string + accessedAt: + description: The timestamp when the request queue was last accessed. + format: date-time + type: string + expireAt: + description: The timestamp when the request queue will expire and be deleted. + format: date-time + type: string + totalRequestCount: + description: The total number of requests in the request queue. + minimum: 0 + type: integer + handledRequestCount: + description: The number of requests that have been handled. + minimum: 0 + type: integer + pendingRequestCount: + description: The number of requests that are pending and have not been handled + yet. + type: integer + actId: + description: The ID of the Actor that created this request queue. + nullable: true + type: string + actRunId: + description: The ID of the Actor run that created this request queue. + nullable: true + type: string + hadMultipleClients: + description: Whether the request queue has been accessed by multiple different + clients. + type: boolean + generalAccess: + $ref: "#/components/schemas/GeneralAccess" + stats: + $ref: "#/components/schemas/RequestQueueStats" + required: + - accessedAt + - createdAt + - hadMultipleClients + - handledRequestCount + - id + - modifiedAt + - name + - pendingRequestCount + - totalRequestCount + - userId + - username + title: RequestQueueShort + ListOfRequestQueues: + allOf: + - $ref: "#/components/schemas/PaginationResponse" + - properties: + unnamed: + description: Whether the listing was filtered to only unnamed request + queues. + type: boolean + items: + description: The array of request queues. + items: + $ref: "#/components/schemas/RequestQueueShort" + type: array + default: null + required: + - items + description: A paginated list of request queues. + example: + total: 0 + offset: 0 + limit: 1 + desc: true + count: 0 + unnamed: true + items: + - id: id + name: name + userId: userId + username: username + createdAt: 2000-01-23T04:56:07.000+00:00 + modifiedAt: 2000-01-23T04:56:07.000+00:00 + accessedAt: 2000-01-23T04:56:07.000+00:00 + expireAt: 2000-01-23T04:56:07.000+00:00 + totalRequestCount: 0 + handledRequestCount: 0 + pendingRequestCount: 7 + actId: actId + actRunId: actRunId + hadMultipleClients: true + generalAccess: ANYONE_WITH_ID_CAN_READ + stats: + deleteCount: 5 + headItemReadCount: 5 + readCount: 2 + storageBytes: 7 + writeCount: 9 + - id: id + name: name + userId: userId + username: username + createdAt: 2000-01-23T04:56:07.000+00:00 + modifiedAt: 2000-01-23T04:56:07.000+00:00 + accessedAt: 2000-01-23T04:56:07.000+00:00 + expireAt: 2000-01-23T04:56:07.000+00:00 + totalRequestCount: 0 + handledRequestCount: 0 + pendingRequestCount: 7 + actId: actId + actRunId: actRunId + hadMultipleClients: true + generalAccess: ANYONE_WITH_ID_CAN_READ + stats: + deleteCount: 5 + headItemReadCount: 5 + readCount: 2 + storageBytes: 7 + writeCount: 9 + title: ListOfRequestQueues + ListOfRequestQueuesResponse: + description: Response containing a list of request queues. + example: + data: + total: 0 + offset: 0 + limit: 1 + desc: true + count: 0 + unnamed: true + items: + - id: id + name: name + userId: userId + username: username + createdAt: 2000-01-23T04:56:07.000+00:00 + modifiedAt: 2000-01-23T04:56:07.000+00:00 + accessedAt: 2000-01-23T04:56:07.000+00:00 + expireAt: 2000-01-23T04:56:07.000+00:00 + totalRequestCount: 0 + handledRequestCount: 0 + pendingRequestCount: 7 + actId: actId + actRunId: actRunId + hadMultipleClients: true + generalAccess: ANYONE_WITH_ID_CAN_READ + stats: + deleteCount: 5 + headItemReadCount: 5 + readCount: 2 + storageBytes: 7 + writeCount: 9 + - id: id + name: name + userId: userId + username: username + createdAt: 2000-01-23T04:56:07.000+00:00 + modifiedAt: 2000-01-23T04:56:07.000+00:00 + accessedAt: 2000-01-23T04:56:07.000+00:00 + expireAt: 2000-01-23T04:56:07.000+00:00 + totalRequestCount: 0 + handledRequestCount: 0 + pendingRequestCount: 7 + actId: actId + actRunId: actRunId + hadMultipleClients: true + generalAccess: ANYONE_WITH_ID_CAN_READ + stats: + deleteCount: 5 + headItemReadCount: 5 + readCount: 2 + storageBytes: 7 + writeCount: 9 + properties: + data: + $ref: "#/components/schemas/ListOfRequestQueues" + required: + - data + title: ListOfRequestQueuesResponse + WebhookCreate: + example: + isAdHoc: true + eventTypes: + - ACTOR.BUILD.ABORTED + - ACTOR.BUILD.ABORTED + condition: + actorId: actorId + actorTaskId: actorTaskId + actorRunId: actorRunId + idempotencyKey: idempotencyKey + ignoreSslErrors: true + doNotRetry: true + requestUrl: requestUrl + payloadTemplate: payloadTemplate + headersTemplate: headersTemplate + description: description + shouldInterpolateStrings: true + properties: + isAdHoc: + nullable: true + type: boolean + eventTypes: + items: + $ref: "#/components/schemas/WebhookEventType" + type: array + default: null + condition: + $ref: "#/components/schemas/WebhookCondition" + idempotencyKey: + nullable: true + type: string + ignoreSslErrors: + nullable: true + type: boolean + doNotRetry: + nullable: true + type: boolean + requestUrl: + type: string + payloadTemplate: + nullable: true + type: string + headersTemplate: + nullable: true + type: string + description: + nullable: true + type: string + shouldInterpolateStrings: + nullable: true + type: boolean + required: + - condition + - eventTypes + - requestUrl + title: WebhookCreate + WebhookResponse: + description: Response containing webhook data. + example: + data: + id: id + createdAt: 2000-01-23T04:56:07.000+00:00 + modifiedAt: 2000-01-23T04:56:07.000+00:00 + userId: userId + isAdHoc: true + shouldInterpolateStrings: true + eventTypes: + - ACTOR.BUILD.ABORTED + - ACTOR.BUILD.ABORTED + condition: + actorId: actorId + actorTaskId: actorTaskId + actorRunId: actorRunId + ignoreSslErrors: true + doNotRetry: true + requestUrl: https://openapi-generator.tech + payloadTemplate: payloadTemplate + headersTemplate: headersTemplate + description: description + lastDispatch: "" + stats: "" + properties: + data: + $ref: "#/components/schemas/Webhook" + required: + - data + title: WebhookResponse + WebhookUpdate: + example: + isAdHoc: true + eventTypes: + - ACTOR.BUILD.ABORTED + - ACTOR.BUILD.ABORTED + condition: "" + ignoreSslErrors: true + doNotRetry: true + requestUrl: https://openapi-generator.tech + payloadTemplate: payloadTemplate + headersTemplate: headersTemplate + description: description + shouldInterpolateStrings: true + properties: + isAdHoc: + nullable: true + type: boolean + eventTypes: + description: "" + items: + $ref: "#/components/schemas/WebhookEventType" + nullable: true + type: array + default: null + condition: + allOf: + - $ref: "#/components/schemas/WebhookCondition" + nullable: true + ignoreSslErrors: + nullable: true + type: boolean + doNotRetry: + nullable: true + type: boolean + requestUrl: + format: uri + nullable: true + type: string + payloadTemplate: + nullable: true + type: string + headersTemplate: + nullable: true + type: string + description: + nullable: true + type: string + shouldInterpolateStrings: + nullable: true + type: boolean + title: WebhookUpdate + WebhookDispatchWebhookSummary: + description: A summary of the webhook that triggered this dispatch. + properties: + actionType: + type: string + condition: + $ref: "#/components/schemas/WebhookCondition" + requestUrl: + format: uri + type: string + isAdHoc: + type: boolean + title: WebhookDispatchWebhookSummary + WebhookDispatch: + example: + id: id + userId: userId + webhookId: webhookId + createdAt: 2000-01-23T04:56:07.000+00:00 + status: ACTIVE + eventType: ACTOR.BUILD.ABORTED + eventData: + actorId: actorId + actorRunId: actorRunId + webhook: "" + calls: + - startedAt: 2000-01-23T04:56:07.000+00:00 + finishedAt: 2000-01-23T04:56:07.000+00:00 + errorMessage: errorMessage + responseStatus: 0 + responseBody: "{\"foo\": \"bar\"}" + - startedAt: 2000-01-23T04:56:07.000+00:00 + finishedAt: 2000-01-23T04:56:07.000+00:00 + errorMessage: errorMessage + responseStatus: 0 + responseBody: "{\"foo\": \"bar\"}" + properties: + id: + type: string + userId: + type: string + webhookId: + type: string + createdAt: + format: date-time + type: string + status: + $ref: "#/components/schemas/WebhookDispatchStatus" + eventType: + $ref: "#/components/schemas/WebhookEventType" + eventData: + $ref: "#/components/schemas/eventData" + webhook: + allOf: + - $ref: "#/components/schemas/WebhookDispatchWebhookSummary" + nullable: true + calls: + items: + $ref: "#/components/schemas/calls_inner" + title: calls + type: array + default: null + required: + - createdAt + - eventType + - id + - status + - userId + - webhookId + title: WebhookDispatch + TestWebhookResponse: + example: + data: + id: id + userId: userId + webhookId: webhookId + createdAt: 2000-01-23T04:56:07.000+00:00 + status: ACTIVE + eventType: ACTOR.BUILD.ABORTED + eventData: + actorId: actorId + actorRunId: actorRunId + webhook: "" + calls: + - startedAt: 2000-01-23T04:56:07.000+00:00 + finishedAt: 2000-01-23T04:56:07.000+00:00 + errorMessage: errorMessage + responseStatus: 0 + responseBody: "{\"foo\": \"bar\"}" + - startedAt: 2000-01-23T04:56:07.000+00:00 + finishedAt: 2000-01-23T04:56:07.000+00:00 + errorMessage: errorMessage + responseStatus: 0 + responseBody: "{\"foo\": \"bar\"}" + properties: + data: + $ref: "#/components/schemas/WebhookDispatch" + required: + - data + title: TestWebhookResponse + ListOfWebhookDispatches: + allOf: + - $ref: "#/components/schemas/PaginationResponse" + - properties: + items: + items: + $ref: "#/components/schemas/WebhookDispatch" + type: array + default: null + required: + - items + example: + total: 0 + offset: 0 + limit: 1 + desc: true + count: 0 + items: + - id: id + userId: userId + webhookId: webhookId + createdAt: 2000-01-23T04:56:07.000+00:00 + status: ACTIVE + eventType: ACTOR.BUILD.ABORTED + eventData: + actorId: actorId + actorRunId: actorRunId + webhook: "" + calls: + - startedAt: 2000-01-23T04:56:07.000+00:00 + finishedAt: 2000-01-23T04:56:07.000+00:00 + errorMessage: errorMessage + responseStatus: 0 + responseBody: "{\"foo\": \"bar\"}" + - startedAt: 2000-01-23T04:56:07.000+00:00 + finishedAt: 2000-01-23T04:56:07.000+00:00 + errorMessage: errorMessage + responseStatus: 0 + responseBody: "{\"foo\": \"bar\"}" + - id: id + userId: userId + webhookId: webhookId + createdAt: 2000-01-23T04:56:07.000+00:00 + status: ACTIVE + eventType: ACTOR.BUILD.ABORTED + eventData: + actorId: actorId + actorRunId: actorRunId + webhook: "" + calls: + - startedAt: 2000-01-23T04:56:07.000+00:00 + finishedAt: 2000-01-23T04:56:07.000+00:00 + errorMessage: errorMessage + responseStatus: 0 + responseBody: "{\"foo\": \"bar\"}" + - startedAt: 2000-01-23T04:56:07.000+00:00 + finishedAt: 2000-01-23T04:56:07.000+00:00 + errorMessage: errorMessage + responseStatus: 0 + responseBody: "{\"foo\": \"bar\"}" + title: ListOfWebhookDispatches + ListOfWebhookDispatchesResponse: + example: + data: + total: 0 + offset: 0 + limit: 1 + desc: true + count: 0 + items: + - id: id + userId: userId + webhookId: webhookId + createdAt: 2000-01-23T04:56:07.000+00:00 + status: ACTIVE + eventType: ACTOR.BUILD.ABORTED + eventData: + actorId: actorId + actorRunId: actorRunId + webhook: "" + calls: + - startedAt: 2000-01-23T04:56:07.000+00:00 + finishedAt: 2000-01-23T04:56:07.000+00:00 + errorMessage: errorMessage + responseStatus: 0 + responseBody: "{\"foo\": \"bar\"}" + - startedAt: 2000-01-23T04:56:07.000+00:00 + finishedAt: 2000-01-23T04:56:07.000+00:00 + errorMessage: errorMessage + responseStatus: 0 + responseBody: "{\"foo\": \"bar\"}" + - id: id + userId: userId + webhookId: webhookId + createdAt: 2000-01-23T04:56:07.000+00:00 + status: ACTIVE + eventType: ACTOR.BUILD.ABORTED + eventData: + actorId: actorId + actorRunId: actorRunId + webhook: "" + calls: + - startedAt: 2000-01-23T04:56:07.000+00:00 + finishedAt: 2000-01-23T04:56:07.000+00:00 + errorMessage: errorMessage + responseStatus: 0 + responseBody: "{\"foo\": \"bar\"}" + - startedAt: 2000-01-23T04:56:07.000+00:00 + finishedAt: 2000-01-23T04:56:07.000+00:00 + errorMessage: errorMessage + responseStatus: 0 + responseBody: "{\"foo\": \"bar\"}" + properties: + data: + $ref: "#/components/schemas/ListOfWebhookDispatches" + required: + - data + title: ListOfWebhookDispatchesResponse + WebhookDispatchResponse: + example: + data: + id: id + userId: userId + webhookId: webhookId + createdAt: 2000-01-23T04:56:07.000+00:00 + status: ACTIVE + eventType: ACTOR.BUILD.ABORTED + eventData: + actorId: actorId + actorRunId: actorRunId + webhook: "" + calls: + - startedAt: 2000-01-23T04:56:07.000+00:00 + finishedAt: 2000-01-23T04:56:07.000+00:00 + errorMessage: errorMessage + responseStatus: 0 + responseBody: "{\"foo\": \"bar\"}" + - startedAt: 2000-01-23T04:56:07.000+00:00 + finishedAt: 2000-01-23T04:56:07.000+00:00 + errorMessage: errorMessage + responseStatus: 0 + responseBody: "{\"foo\": \"bar\"}" + properties: + data: + $ref: "#/components/schemas/WebhookDispatch" + required: + - data + title: WebhookDispatchResponse + ScheduleBase: + properties: + id: + type: string + userId: + type: string + name: + type: string + cronExpression: + type: string + timezone: + type: string + isEnabled: + type: boolean + isExclusive: + type: boolean + createdAt: + format: date-time + type: string + modifiedAt: + format: date-time + type: string + nextRunAt: + format: date-time + nullable: true + type: string + lastRunAt: + format: date-time + nullable: true + type: string + required: + - createdAt + - cronExpression + - id + - isEnabled + - isExclusive + - modifiedAt + - name + - timezone + - userId + title: ScheduleBase + ScheduleActionShortRunActor: + example: + id: id + type: "" + actorId: actorId + properties: + id: + type: string + type: {} + actorId: + type: string + required: + - actorId + - id + - type + title: ScheduleActionShortRunActor + ScheduleActionShortRunActorTask: + properties: + id: + type: string + type: {} + actorTaskId: + type: string + required: + - actorTaskId + - id + - type + title: ScheduleActionShortRunActorTask + ScheduleActionShort: + discriminator: + mapping: + RUN_ACTOR: "#/components/schemas/ScheduleActionShortRunActor" + RUN_ACTOR_TASK: "#/components/schemas/ScheduleActionShortRunActorTask" + propertyName: type + oneOf: + - $ref: "#/components/schemas/ScheduleActionShortRunActor" + - $ref: "#/components/schemas/ScheduleActionShortRunActorTask" + title: ScheduleActionShort + ScheduleShort: + allOf: + - $ref: "#/components/schemas/ScheduleBase" + - properties: + actions: + description: "" + items: + $ref: "#/components/schemas/ScheduleActionShort" + type: array + default: null + required: + - actions + example: + id: id + userId: userId + name: name + cronExpression: cronExpression + timezone: timezone + isEnabled: true + isExclusive: true + createdAt: 2000-01-23T04:56:07.000+00:00 + modifiedAt: 2000-01-23T04:56:07.000+00:00 + nextRunAt: 2000-01-23T04:56:07.000+00:00 + lastRunAt: 2000-01-23T04:56:07.000+00:00 + actions: + - id: id + type: "" + actorId: actorId + - id: id + type: "" + actorId: actorId + title: ScheduleShort + ListOfSchedules: + allOf: + - $ref: "#/components/schemas/PaginationResponse" + - properties: + items: + items: + $ref: "#/components/schemas/ScheduleShort" + type: array + default: null + required: + - items + example: + total: 0 + offset: 0 + limit: 1 + desc: true + count: 0 + items: + - id: id + userId: userId + name: name + cronExpression: cronExpression + timezone: timezone + isEnabled: true + isExclusive: true + createdAt: 2000-01-23T04:56:07.000+00:00 + modifiedAt: 2000-01-23T04:56:07.000+00:00 + nextRunAt: 2000-01-23T04:56:07.000+00:00 + lastRunAt: 2000-01-23T04:56:07.000+00:00 + actions: + - id: id + type: "" + actorId: actorId + - id: id + type: "" + actorId: actorId + - id: id + userId: userId + name: name + cronExpression: cronExpression + timezone: timezone + isEnabled: true + isExclusive: true + createdAt: 2000-01-23T04:56:07.000+00:00 + modifiedAt: 2000-01-23T04:56:07.000+00:00 + nextRunAt: 2000-01-23T04:56:07.000+00:00 + lastRunAt: 2000-01-23T04:56:07.000+00:00 + actions: + - id: id + type: "" + actorId: actorId + - id: id + type: "" + actorId: actorId + title: ListOfSchedules + ListOfSchedulesResponse: + example: + data: + total: 0 + offset: 0 + limit: 1 + desc: true + count: 0 + items: + - id: id + userId: userId + name: name + cronExpression: cronExpression + timezone: timezone + isEnabled: true + isExclusive: true + createdAt: 2000-01-23T04:56:07.000+00:00 + modifiedAt: 2000-01-23T04:56:07.000+00:00 + nextRunAt: 2000-01-23T04:56:07.000+00:00 + lastRunAt: 2000-01-23T04:56:07.000+00:00 + actions: + - id: id + type: "" + actorId: actorId + - id: id + type: "" + actorId: actorId + - id: id + userId: userId + name: name + cronExpression: cronExpression + timezone: timezone + isEnabled: true + isExclusive: true + createdAt: 2000-01-23T04:56:07.000+00:00 + modifiedAt: 2000-01-23T04:56:07.000+00:00 + nextRunAt: 2000-01-23T04:56:07.000+00:00 + lastRunAt: 2000-01-23T04:56:07.000+00:00 + actions: + - id: id + type: "" + actorId: actorId + - id: id + type: "" + actorId: actorId + properties: + data: + $ref: "#/components/schemas/ListOfSchedules" + required: + - data + title: ListOfSchedulesResponse + ScheduleActionRunInput: + properties: + body: + nullable: true + type: string + contentType: + nullable: true + type: string + title: ScheduleActionRunInput + ScheduleCreateActionRunActor: + example: + type: "" + actorId: actorId + runInput: "" + runOptions: "" + properties: + type: {} + actorId: + type: string + runInput: + allOf: + - $ref: "#/components/schemas/ScheduleActionRunInput" + nullable: true + runOptions: + allOf: + - $ref: "#/components/schemas/TaskOptions" + nullable: true + required: + - actorId + - type + title: ScheduleCreateActionRunActor + ScheduleCreateActionRunActorTask: + properties: + type: {} + actorTaskId: + type: string + input: + nullable: true + type: object + required: + - actorTaskId + - type + title: ScheduleCreateActionRunActorTask + ScheduleCreateAction: + discriminator: + mapping: + RUN_ACTOR: "#/components/schemas/ScheduleCreateActionRunActor" + RUN_ACTOR_TASK: "#/components/schemas/ScheduleCreateActionRunActorTask" + propertyName: type + oneOf: + - $ref: "#/components/schemas/ScheduleCreateActionRunActor" + - $ref: "#/components/schemas/ScheduleCreateActionRunActorTask" + title: ScheduleCreateAction + ScheduleCreate: + example: + name: name + isEnabled: true + isExclusive: true + cronExpression: cronExpression + timezone: timezone + description: description + title: title + actions: + - type: "" + actorId: actorId + runInput: "" + runOptions: "" + - type: "" + actorId: actorId + runInput: "" + runOptions: "" + properties: + name: + nullable: true + type: string + isEnabled: + nullable: true + type: boolean + isExclusive: + nullable: true + type: boolean + cronExpression: + nullable: true + type: string + timezone: + nullable: true + type: string + description: + nullable: true + type: string + title: + nullable: true + type: string + actions: + description: "" + items: + $ref: "#/components/schemas/ScheduleCreateAction" + nullable: true + type: array + default: null + title: ScheduleCreate + ScheduleActionRunActor: + example: + id: id + type: "" + actorId: actorId + runInput: "" + runOptions: "" + properties: + id: + type: string + type: {} + actorId: + type: string + runInput: + allOf: + - $ref: "#/components/schemas/ScheduleActionRunInput" + nullable: true + runOptions: + allOf: + - $ref: "#/components/schemas/TaskOptions" + nullable: true + required: + - actorId + - id + - type + title: ScheduleActionRunActor + ScheduleActionRunActorTask: + properties: + id: + type: string + type: {} + actorTaskId: + type: string + input: + nullable: true + type: object + required: + - actorTaskId + - id + - type + title: ScheduleActionRunActorTask + ScheduleAction: + discriminator: + mapping: + RUN_ACTOR: "#/components/schemas/ScheduleActionRunActor" + RUN_ACTOR_TASK: "#/components/schemas/ScheduleActionRunActorTask" + propertyName: type + oneOf: + - $ref: "#/components/schemas/ScheduleActionRunActor" + - $ref: "#/components/schemas/ScheduleActionRunActorTask" + title: ScheduleAction + Schedule: + allOf: + - $ref: "#/components/schemas/ScheduleBase" + - properties: + description: + nullable: true + type: string + title: + nullable: true + type: string + notifications: + $ref: "#/components/schemas/ScheduleNotifications" + actions: + description: "" + items: + $ref: "#/components/schemas/ScheduleAction" + type: array + default: null + required: + - actions + example: + id: id + userId: userId + name: name + cronExpression: cronExpression + timezone: timezone + isEnabled: true + isExclusive: true + createdAt: 2000-01-23T04:56:07.000+00:00 + modifiedAt: 2000-01-23T04:56:07.000+00:00 + nextRunAt: 2000-01-23T04:56:07.000+00:00 + lastRunAt: 2000-01-23T04:56:07.000+00:00 + description: description + title: title + notifications: + email: true + actions: + - id: id + type: "" + actorId: actorId + runInput: "" + runOptions: "" + - id: id + type: "" + actorId: actorId + runInput: "" + runOptions: "" + title: Schedule + ScheduleResponse: + example: + data: + id: id + userId: userId + name: name + cronExpression: cronExpression + timezone: timezone + isEnabled: true + isExclusive: true + createdAt: 2000-01-23T04:56:07.000+00:00 + modifiedAt: 2000-01-23T04:56:07.000+00:00 + nextRunAt: 2000-01-23T04:56:07.000+00:00 + lastRunAt: 2000-01-23T04:56:07.000+00:00 + description: description + title: title + notifications: + email: true + actions: + - id: id + type: "" + actorId: actorId + runInput: "" + runOptions: "" + - id: id + type: "" + actorId: actorId + runInput: "" + runOptions: "" + properties: + data: + $ref: "#/components/schemas/Schedule" + required: + - data + title: ScheduleResponse + ScheduleInvoked: + example: + message: message + level: level + createdAt: 2000-01-23T04:56:07.000+00:00 + properties: + message: + type: string + level: + type: string + createdAt: + format: date-time + type: string + required: + - createdAt + - level + - message + title: ScheduleInvoked + ScheduleLogResponse: + example: + data: + - message: message + level: level + createdAt: 2000-01-23T04:56:07.000+00:00 + - message: message + level: level + createdAt: 2000-01-23T04:56:07.000+00:00 + properties: + data: + description: "" + items: + $ref: "#/components/schemas/ScheduleInvoked" + type: array + default: null + required: + - data + title: ScheduleLogResponse + CurrentPricingInfo: + properties: + pricingModel: + type: string + apifyMarginPercentage: + type: number + createdAt: + format: date-time + type: string + startedAt: + format: date-time + type: string + notifiedAboutChangeAt: + format: date-time + nullable: true + type: string + notifiedAboutFutureChangeAt: + format: date-time + nullable: true + type: string + isPriceChangeNotificationSuppressed: + type: boolean + forceContainsSignificantPriceChange: + type: boolean + isPPEPlatformUsagePaidByUser: + type: boolean + reasonForChange: + nullable: true + type: string + trialMinutes: + nullable: true + type: integer + unitName: + nullable: true + type: string + pricePerUnitUsd: + nullable: true + type: number + minimalMaxTotalChargeUsd: + nullable: true + type: number + pricingPerEvent: + additionalProperties: true + description: Per-event pricing configuration for pay-per-event Actors. + nullable: true + type: object + required: + - pricingModel + title: CurrentPricingInfo + StoreListActor: + properties: + id: + type: string + title: + type: string + name: + type: string + username: + type: string + userFullName: + type: string + description: + type: string + categories: + example: + - MARKETING + - LEAD_GENERATION + items: + type: string + type: array + default: null + notice: + type: string + pictureUrl: + format: uri + nullable: true + type: string + userPictureUrl: + format: uri + nullable: true + type: string + url: + format: uri + nullable: true + type: string + stats: + $ref: "#/components/schemas/ActorStats" + currentPricingInfo: + $ref: "#/components/schemas/CurrentPricingInfo" + isWhiteListedForAgenticPayments: + description: Whether the Actor is whitelisted for agentic payment processing. + nullable: true + type: boolean + actorReviewCount: + type: integer + actorReviewRating: + type: number + bookmarkCount: + type: integer + badge: + nullable: true + type: string + readmeSummary: + description: "A brief, LLM-generated readme summary" + type: string + required: + - currentPricingInfo + - description + - id + - name + - stats + - title + - userFullName + - username + title: StoreListActor + ListOfStoreActors: + allOf: + - $ref: "#/components/schemas/PaginationResponse" + - properties: + items: + items: + $ref: "#/components/schemas/StoreListActor" + type: array + default: null + required: + - items + title: ListOfStoreActors + ListOfActorsInStoreResponse: + example: + data: + total: 100 + offset: 0 + limit: 1000 + desc: false + count: 1 + items: + - id: zdc3Pyhyz3m8vjDeM + title: My Public Actor + name: my-public-actor + username: jane35 + userFullName: Jane Doe + description: My public Actor! + pictureUrl: https://... + userPictureUrl: https://... + url: https://... + stats: + totalBuilds: 9 + totalRuns: 16 + totalUsers: 6 + totalUsers7Days: 2 + totalUsers30Days: 6 + totalUsers90Days: 6 + totalMetamorphs: 2 + lastRunStartedAt: 2019-07-08T14:01:05.546Z + currentPricingInfo: + pricingModel: FREE + isWhiteListedForAgenticPayments: true + - id: zdc3Pyhyz3m8vjDeM + title: My Public Actor + name: my-public-actor + username: jane35 + userFullName: Jane H. Doe + categories: + - MARKETING + - LEAD_GENERATION + description: My public Actor! + pictureUrl: https://... + userPictureUrl: https://... + url: https://... + stats: + totalBuilds: 9 + totalRuns: 16 + totalUsers: 6 + totalUsers7Days: 2 + totalUsers30Days: 6 + totalUsers90Days: 6 + totalMetamorphs: 2 + lastRunStartedAt: 2019-07-08T14:01:05.546Z + currentPricingInfo: + pricingModel: FREE + isWhiteListedForAgenticPayments: false + properties: + data: + $ref: "#/components/schemas/ListOfStoreActors" + required: + - data + title: ListOfActorsInStoreResponse + Profile: + example: + bio: bio + name: name + pictureUrl: https://openapi-generator.tech + githubUsername: githubUsername + websiteUrl: https://openapi-generator.tech + twitterUsername: twitterUsername + properties: + bio: + type: string + name: + type: string + pictureUrl: + format: uri + type: string + githubUsername: + type: string + websiteUrl: + format: uri + type: string + twitterUsername: + type: string + title: Profile + UserPublicInfo: + example: + username: username + profile: + bio: bio + name: name + pictureUrl: https://openapi-generator.tech + githubUsername: githubUsername + websiteUrl: https://openapi-generator.tech + twitterUsername: twitterUsername + properties: + username: + type: string + profile: + $ref: "#/components/schemas/Profile" + required: + - username + title: UserPublicInfo + PublicUserDataResponse: + example: + data: + username: username + profile: + bio: bio + name: name + pictureUrl: https://openapi-generator.tech + githubUsername: githubUsername + websiteUrl: https://openapi-generator.tech + twitterUsername: twitterUsername + properties: + data: + $ref: "#/components/schemas/UserPublicInfo" + required: + - data + title: PublicUserDataResponse + ProxyGroup: + example: + name: name + description: description + availableCount: 0 + properties: + name: + type: string + description: + nullable: true + type: string + availableCount: + type: integer + required: + - availableCount + - description + - name + title: ProxyGroup + Proxy: + example: + password: password + groups: + - name: name + description: description + availableCount: 0 + - name: name + description: description + availableCount: 0 + properties: + password: + type: string + groups: + items: + $ref: "#/components/schemas/ProxyGroup" + type: array + default: null + required: + - groups + - password + title: Proxy + AvailableProxyGroups: + additionalProperties: + description: The number of available proxies in this group. + type: integer + description: | + A dictionary mapping proxy group names to the number of available proxies in each group. + The keys are proxy group names (e.g., "RESIDENTIAL", "DATACENTER") and values are + the count of available proxies. + example: + RESIDENTIAL: 1000 + DATACENTER: 500 + GOOGLE_SERP: 200 + title: AvailableProxyGroups + Plan: + example: + id: id + description: description + isEnabled: true + monthlyBasePriceUsd: 6.027456183070403 + monthlyUsageCreditsUsd: 1.4658129805029452 + usageDiscountPercent: 5.962133916683182 + enabledPlatformFeatures: + - ACTORS + - STORAGE + - PROXY_SERPS + - SCHEDULER + - WEBHOOKS + maxMonthlyUsageUsd: 5.637376656633329 + maxActorMemoryGbytes: 2.3021358869347655 + maxMonthlyActorComputeUnits: 7.061401241503109 + maxMonthlyResidentialProxyGbytes: 9.301444243932576 + maxMonthlyProxySerps: 3 + maxMonthlyExternalDataTransferGbytes: 2.027123023002322 + maxActorCount: 4 + maxActorTaskCount: 7 + dataRetentionDays: 1 + availableProxyGroups: + RESIDENTIAL: 1000 + DATACENTER: 500 + GOOGLE_SERP: 200 + teamAccountSeatCount: 1 + supportLevel: supportLevel + availableAddOns: + - availableAddOns + - availableAddOns + tier: tier + apiRateLimitBoosts: 1 + maxScheduleCount: 6 + maxConcurrentActorRuns: 7 + planPricing: + key: "" + properties: + id: + type: string + description: + type: string + isEnabled: + type: boolean + monthlyBasePriceUsd: + type: number + monthlyUsageCreditsUsd: + type: number + usageDiscountPercent: + type: number + enabledPlatformFeatures: + example: + - ACTORS + - STORAGE + - PROXY_SERPS + - SCHEDULER + - WEBHOOKS + items: + type: string + type: array + default: null + maxMonthlyUsageUsd: + type: number + maxActorMemoryGbytes: + type: number + maxMonthlyActorComputeUnits: + type: number + maxMonthlyResidentialProxyGbytes: + type: number + maxMonthlyProxySerps: + type: integer + maxMonthlyExternalDataTransferGbytes: + type: number + maxActorCount: + type: integer + maxActorTaskCount: + type: integer + dataRetentionDays: + type: integer + availableProxyGroups: + additionalProperties: + description: The number of available proxies in this group. + type: integer + description: | + A dictionary mapping proxy group names to the number of available proxies in each group. + The keys are proxy group names (e.g., "RESIDENTIAL", "DATACENTER") and values are + the count of available proxies. + example: + RESIDENTIAL: 1000 + DATACENTER: 500 + GOOGLE_SERP: 200 + title: AvailableProxyGroups + teamAccountSeatCount: + type: integer + supportLevel: + type: string + availableAddOns: + items: + type: string + type: array + default: null + tier: + type: string + apiRateLimitBoosts: + type: integer + maxScheduleCount: + type: integer + maxConcurrentActorRuns: + type: integer + planPricing: + additionalProperties: true + description: Pricing details for this plan. + type: object + required: + - availableAddOns + - availableProxyGroups + - dataRetentionDays + - description + - enabledPlatformFeatures + - id + - isEnabled + - maxActorCount + - maxActorMemoryGbytes + - maxActorTaskCount + - maxMonthlyActorComputeUnits + - maxMonthlyExternalDataTransferGbytes + - maxMonthlyProxySerps + - maxMonthlyResidentialProxyGbytes + - maxMonthlyUsageUsd + - monthlyBasePriceUsd + - monthlyUsageCreditsUsd + - supportLevel + - teamAccountSeatCount + title: Plan + EffectivePlatformFeature: + example: + isEnabled: true + disabledReason: disabledReason + disabledReasonType: disabledReasonType + isTrial: true + trialExpirationAt: 2000-01-23T04:56:07.000+00:00 + properties: + isEnabled: + type: boolean + disabledReason: + nullable: true + type: string + disabledReasonType: + nullable: true + type: string + isTrial: + type: boolean + trialExpirationAt: + format: date-time + nullable: true + type: string + required: + - disabledReason + - disabledReasonType + - isEnabled + - isTrial + - trialExpirationAt + title: EffectivePlatformFeature + EffectivePlatformFeatures: + example: + ACTORS: + isEnabled: true + disabledReason: disabledReason + disabledReasonType: disabledReasonType + isTrial: true + trialExpirationAt: 2000-01-23T04:56:07.000+00:00 + STORAGE: + isEnabled: true + disabledReason: disabledReason + disabledReasonType: disabledReasonType + isTrial: true + trialExpirationAt: 2000-01-23T04:56:07.000+00:00 + SCHEDULER: + isEnabled: true + disabledReason: disabledReason + disabledReasonType: disabledReasonType + isTrial: true + trialExpirationAt: 2000-01-23T04:56:07.000+00:00 + PROXY: + isEnabled: true + disabledReason: disabledReason + disabledReasonType: disabledReasonType + isTrial: true + trialExpirationAt: 2000-01-23T04:56:07.000+00:00 + PROXY_EXTERNAL_ACCESS: + isEnabled: true + disabledReason: disabledReason + disabledReasonType: disabledReasonType + isTrial: true + trialExpirationAt: 2000-01-23T04:56:07.000+00:00 + PROXY_RESIDENTIAL: + isEnabled: true + disabledReason: disabledReason + disabledReasonType: disabledReasonType + isTrial: true + trialExpirationAt: 2000-01-23T04:56:07.000+00:00 + PROXY_SERPS: + isEnabled: true + disabledReason: disabledReason + disabledReasonType: disabledReasonType + isTrial: true + trialExpirationAt: 2000-01-23T04:56:07.000+00:00 + WEBHOOKS: + isEnabled: true + disabledReason: disabledReason + disabledReasonType: disabledReasonType + isTrial: true + trialExpirationAt: 2000-01-23T04:56:07.000+00:00 + ACTORS_PUBLIC_ALL: + isEnabled: true + disabledReason: disabledReason + disabledReasonType: disabledReasonType + isTrial: true + trialExpirationAt: 2000-01-23T04:56:07.000+00:00 + ACTORS_PUBLIC_DEVELOPER: + isEnabled: true + disabledReason: disabledReason + disabledReasonType: disabledReasonType + isTrial: true + trialExpirationAt: 2000-01-23T04:56:07.000+00:00 + properties: + ACTORS: + $ref: "#/components/schemas/EffectivePlatformFeature" + STORAGE: + $ref: "#/components/schemas/EffectivePlatformFeature" + SCHEDULER: + $ref: "#/components/schemas/EffectivePlatformFeature" + PROXY: + $ref: "#/components/schemas/EffectivePlatformFeature" + PROXY_EXTERNAL_ACCESS: + $ref: "#/components/schemas/EffectivePlatformFeature" + PROXY_RESIDENTIAL: + $ref: "#/components/schemas/EffectivePlatformFeature" + PROXY_SERPS: + $ref: "#/components/schemas/EffectivePlatformFeature" + WEBHOOKS: + $ref: "#/components/schemas/EffectivePlatformFeature" + ACTORS_PUBLIC_ALL: + $ref: "#/components/schemas/EffectivePlatformFeature" + ACTORS_PUBLIC_DEVELOPER: + $ref: "#/components/schemas/EffectivePlatformFeature" + required: + - ACTORS + - ACTORS_PUBLIC_ALL + - ACTORS_PUBLIC_DEVELOPER + - PROXY + - PROXY_EXTERNAL_ACCESS + - PROXY_RESIDENTIAL + - PROXY_SERPS + - SCHEDULER + - STORAGE + - WEBHOOKS + title: EffectivePlatformFeatures + UserPrivateInfo: + example: + id: id + username: username + profile: + bio: bio + name: name + pictureUrl: https://openapi-generator.tech + githubUsername: githubUsername + websiteUrl: https://openapi-generator.tech + twitterUsername: twitterUsername + email: email + proxy: + password: password + groups: + - name: name + description: description + availableCount: 0 + - name: name + description: description + availableCount: 0 + plan: + id: id + description: description + isEnabled: true + monthlyBasePriceUsd: 6.027456183070403 + monthlyUsageCreditsUsd: 1.4658129805029452 + usageDiscountPercent: 5.962133916683182 + enabledPlatformFeatures: + - ACTORS + - STORAGE + - PROXY_SERPS + - SCHEDULER + - WEBHOOKS + maxMonthlyUsageUsd: 5.637376656633329 + maxActorMemoryGbytes: 2.3021358869347655 + maxMonthlyActorComputeUnits: 7.061401241503109 + maxMonthlyResidentialProxyGbytes: 9.301444243932576 + maxMonthlyProxySerps: 3 + maxMonthlyExternalDataTransferGbytes: 2.027123023002322 + maxActorCount: 4 + maxActorTaskCount: 7 + dataRetentionDays: 1 + availableProxyGroups: + RESIDENTIAL: 1000 + DATACENTER: 500 + GOOGLE_SERP: 200 + teamAccountSeatCount: 1 + supportLevel: supportLevel + availableAddOns: + - availableAddOns + - availableAddOns + tier: tier + apiRateLimitBoosts: 1 + maxScheduleCount: 6 + maxConcurrentActorRuns: 7 + planPricing: + key: "" + effectivePlatformFeatures: + ACTORS: + isEnabled: true + disabledReason: disabledReason + disabledReasonType: disabledReasonType + isTrial: true + trialExpirationAt: 2000-01-23T04:56:07.000+00:00 + STORAGE: + isEnabled: true + disabledReason: disabledReason + disabledReasonType: disabledReasonType + isTrial: true + trialExpirationAt: 2000-01-23T04:56:07.000+00:00 + SCHEDULER: + isEnabled: true + disabledReason: disabledReason + disabledReasonType: disabledReasonType + isTrial: true + trialExpirationAt: 2000-01-23T04:56:07.000+00:00 + PROXY: + isEnabled: true + disabledReason: disabledReason + disabledReasonType: disabledReasonType + isTrial: true + trialExpirationAt: 2000-01-23T04:56:07.000+00:00 + PROXY_EXTERNAL_ACCESS: + isEnabled: true + disabledReason: disabledReason + disabledReasonType: disabledReasonType + isTrial: true + trialExpirationAt: 2000-01-23T04:56:07.000+00:00 + PROXY_RESIDENTIAL: + isEnabled: true + disabledReason: disabledReason + disabledReasonType: disabledReasonType + isTrial: true + trialExpirationAt: 2000-01-23T04:56:07.000+00:00 + PROXY_SERPS: + isEnabled: true + disabledReason: disabledReason + disabledReasonType: disabledReasonType + isTrial: true + trialExpirationAt: 2000-01-23T04:56:07.000+00:00 + WEBHOOKS: + isEnabled: true + disabledReason: disabledReason + disabledReasonType: disabledReasonType + isTrial: true + trialExpirationAt: 2000-01-23T04:56:07.000+00:00 + ACTORS_PUBLIC_ALL: + isEnabled: true + disabledReason: disabledReason + disabledReasonType: disabledReasonType + isTrial: true + trialExpirationAt: 2000-01-23T04:56:07.000+00:00 + ACTORS_PUBLIC_DEVELOPER: + isEnabled: true + disabledReason: disabledReason + disabledReasonType: disabledReasonType + isTrial: true + trialExpirationAt: 2000-01-23T04:56:07.000+00:00 + createdAt: 2000-01-23T04:56:07.000+00:00 + isPaying: true + properties: + id: + type: string + username: + type: string + profile: + $ref: "#/components/schemas/Profile" + email: + format: email + type: string + proxy: + $ref: "#/components/schemas/Proxy" + plan: + $ref: "#/components/schemas/Plan" + effectivePlatformFeatures: + $ref: "#/components/schemas/EffectivePlatformFeatures" + createdAt: + format: date-time + type: string + isPaying: + type: boolean + required: + - createdAt + - effectivePlatformFeatures + - email + - id + - isPaying + - plan + - profile + - proxy + - username + title: UserPrivateInfo + PrivateUserDataResponse: + example: + data: + id: id + username: username + profile: + bio: bio + name: name + pictureUrl: https://openapi-generator.tech + githubUsername: githubUsername + websiteUrl: https://openapi-generator.tech + twitterUsername: twitterUsername + email: email + proxy: + password: password + groups: + - name: name + description: description + availableCount: 0 + - name: name + description: description + availableCount: 0 + plan: + id: id + description: description + isEnabled: true + monthlyBasePriceUsd: 6.027456183070403 + monthlyUsageCreditsUsd: 1.4658129805029452 + usageDiscountPercent: 5.962133916683182 + enabledPlatformFeatures: + - ACTORS + - STORAGE + - PROXY_SERPS + - SCHEDULER + - WEBHOOKS + maxMonthlyUsageUsd: 5.637376656633329 + maxActorMemoryGbytes: 2.3021358869347655 + maxMonthlyActorComputeUnits: 7.061401241503109 + maxMonthlyResidentialProxyGbytes: 9.301444243932576 + maxMonthlyProxySerps: 3 + maxMonthlyExternalDataTransferGbytes: 2.027123023002322 + maxActorCount: 4 + maxActorTaskCount: 7 + dataRetentionDays: 1 + availableProxyGroups: + RESIDENTIAL: 1000 + DATACENTER: 500 + GOOGLE_SERP: 200 + teamAccountSeatCount: 1 + supportLevel: supportLevel + availableAddOns: + - availableAddOns + - availableAddOns + tier: tier + apiRateLimitBoosts: 1 + maxScheduleCount: 6 + maxConcurrentActorRuns: 7 + planPricing: + key: "" + effectivePlatformFeatures: + ACTORS: + isEnabled: true + disabledReason: disabledReason + disabledReasonType: disabledReasonType + isTrial: true + trialExpirationAt: 2000-01-23T04:56:07.000+00:00 + STORAGE: + isEnabled: true + disabledReason: disabledReason + disabledReasonType: disabledReasonType + isTrial: true + trialExpirationAt: 2000-01-23T04:56:07.000+00:00 + SCHEDULER: + isEnabled: true + disabledReason: disabledReason + disabledReasonType: disabledReasonType + isTrial: true + trialExpirationAt: 2000-01-23T04:56:07.000+00:00 + PROXY: + isEnabled: true + disabledReason: disabledReason + disabledReasonType: disabledReasonType + isTrial: true + trialExpirationAt: 2000-01-23T04:56:07.000+00:00 + PROXY_EXTERNAL_ACCESS: + isEnabled: true + disabledReason: disabledReason + disabledReasonType: disabledReasonType + isTrial: true + trialExpirationAt: 2000-01-23T04:56:07.000+00:00 + PROXY_RESIDENTIAL: + isEnabled: true + disabledReason: disabledReason + disabledReasonType: disabledReasonType + isTrial: true + trialExpirationAt: 2000-01-23T04:56:07.000+00:00 + PROXY_SERPS: + isEnabled: true + disabledReason: disabledReason + disabledReasonType: disabledReasonType + isTrial: true + trialExpirationAt: 2000-01-23T04:56:07.000+00:00 + WEBHOOKS: + isEnabled: true + disabledReason: disabledReason + disabledReasonType: disabledReasonType + isTrial: true + trialExpirationAt: 2000-01-23T04:56:07.000+00:00 + ACTORS_PUBLIC_ALL: + isEnabled: true + disabledReason: disabledReason + disabledReasonType: disabledReasonType + isTrial: true + trialExpirationAt: 2000-01-23T04:56:07.000+00:00 + ACTORS_PUBLIC_DEVELOPER: + isEnabled: true + disabledReason: disabledReason + disabledReasonType: disabledReasonType + isTrial: true + trialExpirationAt: 2000-01-23T04:56:07.000+00:00 + createdAt: 2000-01-23T04:56:07.000+00:00 + isPaying: true + properties: + data: + $ref: "#/components/schemas/UserPrivateInfo" + required: + - data + title: PrivateUserDataResponse + UsageCycle: + example: + startAt: 2000-01-23T04:56:07.000+00:00 + endAt: 2000-01-23T04:56:07.000+00:00 + properties: + startAt: + format: date-time + type: string + endAt: + format: date-time + type: string + required: + - endAt + - startAt + title: UsageCycle + PriceTiers: + example: + quantityAbove: 5.637376656633329 + discountPercent: 2.3021358869347655 + tierQuantity: 7.061401241503109 + unitPriceUsd: 9.301444243932576 + priceUsd: 3.616076749251911 + properties: + quantityAbove: + type: number + discountPercent: + type: number + tierQuantity: + type: number + unitPriceUsd: + type: number + priceUsd: + type: number + required: + - discountPercent + - priceUsd + - quantityAbove + - tierQuantity + - unitPriceUsd + title: PriceTiers + UsageItem: + example: + quantity: 0.8008281904610115 + baseAmountUsd: 6.027456183070403 + baseUnitPriceUsd: 1.4658129805029452 + amountAfterVolumeDiscountUsd: 5.962133916683182 + priceTiers: + - quantityAbove: 5.637376656633329 + discountPercent: 2.3021358869347655 + tierQuantity: 7.061401241503109 + unitPriceUsd: 9.301444243932576 + priceUsd: 3.616076749251911 + - quantityAbove: 5.637376656633329 + discountPercent: 2.3021358869347655 + tierQuantity: 7.061401241503109 + unitPriceUsd: 9.301444243932576 + priceUsd: 3.616076749251911 + properties: + quantity: + type: number + baseAmountUsd: + type: number + baseUnitPriceUsd: + type: number + amountAfterVolumeDiscountUsd: + type: number + priceTiers: + description: "" + items: + $ref: "#/components/schemas/PriceTiers" + type: array + default: null + required: + - baseAmountUsd + - quantity + title: UsageItem + MonthlyServiceUsage: + additionalProperties: + $ref: "#/components/schemas/UsageItem" + description: "A map of usage item names (e.g., ACTOR_COMPUTE_UNITS) to their\ + \ usage details." + title: MonthlyServiceUsage + ServiceUsage: + additionalProperties: + $ref: "#/components/schemas/UsageItem" + description: A map of service usage item names to their usage details. + example: + ACTOR_COMPUTE_UNITS: + quantity: 60 + baseAmountUsd: 3.0000000000000003E-4 + baseUnitPriceUsd: 5.0E-6 + amountAfterVolumeDiscountUsd: 3.0000000000000003E-4 + priceTiers: [] + title: ServiceUsage + DailyServiceUsages: + example: + date: date + serviceUsage: + ACTOR_COMPUTE_UNITS: + quantity: 60 + baseAmountUsd: 3.0000000000000003E-4 + baseUnitPriceUsd: 5.0E-6 + amountAfterVolumeDiscountUsd: 3.0000000000000003E-4 + priceTiers: [] + totalUsageCreditsUsd: 2.027123023002322 + properties: + date: + type: string + serviceUsage: + additionalProperties: + $ref: "#/components/schemas/UsageItem" + description: A map of service usage item names to their usage details. + example: + ACTOR_COMPUTE_UNITS: + quantity: 60 + baseAmountUsd: 3.0000000000000003E-4 + baseUnitPriceUsd: 5.0E-6 + amountAfterVolumeDiscountUsd: 3.0000000000000003E-4 + priceTiers: [] + title: ServiceUsage + totalUsageCreditsUsd: + type: number + required: + - date + - serviceUsage + - totalUsageCreditsUsd + title: DailyServiceUsages + MonthlyUsage: + example: + usageCycle: + startAt: 2000-01-23T04:56:07.000+00:00 + endAt: 2000-01-23T04:56:07.000+00:00 + monthlyServiceUsage: + key: + quantity: 0.8008281904610115 + baseAmountUsd: 6.027456183070403 + baseUnitPriceUsd: 1.4658129805029452 + amountAfterVolumeDiscountUsd: 5.962133916683182 + priceTiers: + - quantityAbove: 5.637376656633329 + discountPercent: 2.3021358869347655 + tierQuantity: 7.061401241503109 + unitPriceUsd: 9.301444243932576 + priceUsd: 3.616076749251911 + - quantityAbove: 5.637376656633329 + discountPercent: 2.3021358869347655 + tierQuantity: 7.061401241503109 + unitPriceUsd: 9.301444243932576 + priceUsd: 3.616076749251911 + dailyServiceUsages: + - date: date + serviceUsage: + ACTOR_COMPUTE_UNITS: + quantity: 60 + baseAmountUsd: 3.0000000000000003E-4 + baseUnitPriceUsd: 5.0E-6 + amountAfterVolumeDiscountUsd: 3.0000000000000003E-4 + priceTiers: [] + totalUsageCreditsUsd: 2.027123023002322 + - date: date + serviceUsage: + ACTOR_COMPUTE_UNITS: + quantity: 60 + baseAmountUsd: 3.0000000000000003E-4 + baseUnitPriceUsd: 5.0E-6 + amountAfterVolumeDiscountUsd: 3.0000000000000003E-4 + priceTiers: [] + totalUsageCreditsUsd: 2.027123023002322 + totalUsageCreditsUsdBeforeVolumeDiscount: 4.145608029883936 + totalUsageCreditsUsdAfterVolumeDiscount: 7.386281948385884 + properties: + usageCycle: + $ref: "#/components/schemas/UsageCycle" + monthlyServiceUsage: + additionalProperties: + $ref: "#/components/schemas/UsageItem" + description: "A map of usage item names (e.g., ACTOR_COMPUTE_UNITS) to their\ + \ usage details." + title: MonthlyServiceUsage + dailyServiceUsages: + description: "" + items: + $ref: "#/components/schemas/DailyServiceUsages" + type: array + default: null + totalUsageCreditsUsdBeforeVolumeDiscount: + type: number + totalUsageCreditsUsdAfterVolumeDiscount: + type: number + required: + - dailyServiceUsages + - monthlyServiceUsage + - totalUsageCreditsUsdAfterVolumeDiscount + - totalUsageCreditsUsdBeforeVolumeDiscount + - usageCycle + title: MonthlyUsage + MonthlyUsageResponse: + example: + data: + usageCycle: + startAt: 2000-01-23T04:56:07.000+00:00 + endAt: 2000-01-23T04:56:07.000+00:00 + monthlyServiceUsage: + key: + quantity: 0.8008281904610115 + baseAmountUsd: 6.027456183070403 + baseUnitPriceUsd: 1.4658129805029452 + amountAfterVolumeDiscountUsd: 5.962133916683182 + priceTiers: + - quantityAbove: 5.637376656633329 + discountPercent: 2.3021358869347655 + tierQuantity: 7.061401241503109 + unitPriceUsd: 9.301444243932576 + priceUsd: 3.616076749251911 + - quantityAbove: 5.637376656633329 + discountPercent: 2.3021358869347655 + tierQuantity: 7.061401241503109 + unitPriceUsd: 9.301444243932576 + priceUsd: 3.616076749251911 + dailyServiceUsages: + - date: date + serviceUsage: + ACTOR_COMPUTE_UNITS: + quantity: 60 + baseAmountUsd: 3.0000000000000003E-4 + baseUnitPriceUsd: 5.0E-6 + amountAfterVolumeDiscountUsd: 3.0000000000000003E-4 + priceTiers: [] + totalUsageCreditsUsd: 2.027123023002322 + - date: date + serviceUsage: + ACTOR_COMPUTE_UNITS: + quantity: 60 + baseAmountUsd: 3.0000000000000003E-4 + baseUnitPriceUsd: 5.0E-6 + amountAfterVolumeDiscountUsd: 3.0000000000000003E-4 + priceTiers: [] + totalUsageCreditsUsd: 2.027123023002322 + totalUsageCreditsUsdBeforeVolumeDiscount: 4.145608029883936 + totalUsageCreditsUsdAfterVolumeDiscount: 7.386281948385884 + properties: + data: + $ref: "#/components/schemas/MonthlyUsage" + required: + - data + title: MonthlyUsageResponse + Limits: + example: + maxMonthlyUsageUsd: 0.8008281904610115 + maxMonthlyActorComputeUnits: 6.027456183070403 + maxMonthlyExternalDataTransferGbytes: 1.4658129805029452 + maxMonthlyProxySerps: 5 + maxMonthlyResidentialProxyGbytes: 5.637376656633329 + maxActorMemoryGbytes: 2.3021358869347655 + maxActorCount: 7 + maxActorTaskCount: 9 + maxConcurrentActorJobs: 3 + maxTeamAccountSeatCount: 2 + dataRetentionDays: 4 + maxScheduleCount: 7 + properties: + maxMonthlyUsageUsd: + type: number + maxMonthlyActorComputeUnits: + type: number + maxMonthlyExternalDataTransferGbytes: + type: number + maxMonthlyProxySerps: + type: integer + maxMonthlyResidentialProxyGbytes: + type: number + maxActorMemoryGbytes: + type: number + maxActorCount: + type: integer + maxActorTaskCount: + type: integer + maxConcurrentActorJobs: + type: integer + maxTeamAccountSeatCount: + type: integer + dataRetentionDays: + type: integer + maxScheduleCount: + type: integer + required: + - dataRetentionDays + - maxActorCount + - maxActorMemoryGbytes + - maxActorTaskCount + - maxConcurrentActorJobs + - maxMonthlyActorComputeUnits + - maxMonthlyExternalDataTransferGbytes + - maxMonthlyProxySerps + - maxMonthlyResidentialProxyGbytes + - maxMonthlyUsageUsd + - maxTeamAccountSeatCount + title: Limits + Current: + example: + monthlyUsageUsd: 1.2315135367772556 + monthlyActorComputeUnits: 1.0246457001441578 + monthlyExternalDataTransferGbytes: 1.4894159098541704 + monthlyProxySerps: 6 + monthlyResidentialProxyGbytes: 7.457744773683766 + actorMemoryGbytes: 1.1730742509559433 + actorCount: 4 + actorTaskCount: 5 + activeActorJobCount: 9 + teamAccountSeatCount: 9 + scheduleCount: 6 + properties: + monthlyUsageUsd: + type: number + monthlyActorComputeUnits: + type: number + monthlyExternalDataTransferGbytes: + type: number + monthlyProxySerps: + type: integer + monthlyResidentialProxyGbytes: + type: number + actorMemoryGbytes: + type: number + actorCount: + type: integer + actorTaskCount: + type: integer + activeActorJobCount: + type: integer + teamAccountSeatCount: + type: integer + scheduleCount: + type: integer + required: + - activeActorJobCount + - actorCount + - actorMemoryGbytes + - actorTaskCount + - monthlyActorComputeUnits + - monthlyExternalDataTransferGbytes + - monthlyProxySerps + - monthlyResidentialProxyGbytes + - monthlyUsageUsd + - teamAccountSeatCount + title: Current + AccountLimits: + example: + monthlyUsageCycle: + startAt: 2000-01-23T04:56:07.000+00:00 + endAt: 2000-01-23T04:56:07.000+00:00 + limits: + maxMonthlyUsageUsd: 0.8008281904610115 + maxMonthlyActorComputeUnits: 6.027456183070403 + maxMonthlyExternalDataTransferGbytes: 1.4658129805029452 + maxMonthlyProxySerps: 5 + maxMonthlyResidentialProxyGbytes: 5.637376656633329 + maxActorMemoryGbytes: 2.3021358869347655 + maxActorCount: 7 + maxActorTaskCount: 9 + maxConcurrentActorJobs: 3 + maxTeamAccountSeatCount: 2 + dataRetentionDays: 4 + maxScheduleCount: 7 + current: + monthlyUsageUsd: 1.2315135367772556 + monthlyActorComputeUnits: 1.0246457001441578 + monthlyExternalDataTransferGbytes: 1.4894159098541704 + monthlyProxySerps: 6 + monthlyResidentialProxyGbytes: 7.457744773683766 + actorMemoryGbytes: 1.1730742509559433 + actorCount: 4 + actorTaskCount: 5 + activeActorJobCount: 9 + teamAccountSeatCount: 9 + scheduleCount: 6 + properties: + monthlyUsageCycle: + $ref: "#/components/schemas/UsageCycle" + limits: + $ref: "#/components/schemas/Limits" + current: + $ref: "#/components/schemas/Current" + required: + - current + - limits + - monthlyUsageCycle + title: AccountLimits + LimitsResponse: + example: + data: + monthlyUsageCycle: + startAt: 2000-01-23T04:56:07.000+00:00 + endAt: 2000-01-23T04:56:07.000+00:00 + limits: + maxMonthlyUsageUsd: 0.8008281904610115 + maxMonthlyActorComputeUnits: 6.027456183070403 + maxMonthlyExternalDataTransferGbytes: 1.4658129805029452 + maxMonthlyProxySerps: 5 + maxMonthlyResidentialProxyGbytes: 5.637376656633329 + maxActorMemoryGbytes: 2.3021358869347655 + maxActorCount: 7 + maxActorTaskCount: 9 + maxConcurrentActorJobs: 3 + maxTeamAccountSeatCount: 2 + dataRetentionDays: 4 + maxScheduleCount: 7 + current: + monthlyUsageUsd: 1.2315135367772556 + monthlyActorComputeUnits: 1.0246457001441578 + monthlyExternalDataTransferGbytes: 1.4894159098541704 + monthlyProxySerps: 6 + monthlyResidentialProxyGbytes: 7.457744773683766 + actorMemoryGbytes: 1.1730742509559433 + actorCount: 4 + actorTaskCount: 5 + activeActorJobCount: 9 + teamAccountSeatCount: 9 + scheduleCount: 6 + properties: + data: + $ref: "#/components/schemas/AccountLimits" + required: + - data + title: LimitsResponse + UpdateLimitsRequest: + example: + maxMonthlyUsageUsd: 0.8008281904610115 + dataRetentionDays: 6 + properties: + maxMonthlyUsageUsd: + description: | + If your platform usage in the billing period exceeds the prepaid usage, you will be charged extra. Setting this property you can update your hard limit on monthly platform usage to prevent accidental overage or to limit the extra charges. + type: number + dataRetentionDays: + description: | + Apify securely stores your ten most recent Actor runs indefinitely, ensuring they are always accessible. Unnamed storages and other Actor runs are automatically deleted after the retention period. If you're subscribed, you can change it to keep data for longer or to limit your usage. [Lear more](https://docs.apify.com/platform/storage/usage#data-retention). + type: integer + title: UpdateLimitsRequest + BrowserInfoResponse: + example: + method: GET + clientIp: 1.2.3.4 + countryCode: US + bodyLength: 0 + headers: + key: BrowserInfoResponse_headers_value + rawHeaders: + - rawHeaders + - rawHeaders + properties: + method: + description: HTTP method of the request. + example: GET + type: string + clientIp: + description: IP address of the client. + example: 1.2.3.4 + nullable: true + type: string + countryCode: + description: Two-letter country code resolved from the client IP address. + example: US + nullable: true + type: string + bodyLength: + description: Length of the request body in bytes. + example: 0 + type: integer + headers: + additionalProperties: + $ref: "#/components/schemas/BrowserInfoResponse_headers_value" + description: | + Request headers. Omitted when `skipHeaders=true`. + rawHeaders: + description: | + Raw request headers as a flat list of alternating name/value strings. + Included only when `rawHeaders=true`. + items: + type: string + type: array + default: null + required: + - bodyLength + - clientIp + - countryCode + - method + EncodeAndSignData: + example: + encoded: encoded + properties: + encoded: + type: string + required: + - encoded + title: EncodeAndSignData + EncodeAndSignResponse: + example: + data: + encoded: encoded + properties: + data: + $ref: "#/components/schemas/EncodeAndSignData" + required: + - data + title: EncodeAndSignResponse + DecodeAndVerifyRequest: + example: + encoded: encoded + properties: + encoded: + type: string + required: + - encoded + title: DecodeAndVerifyRequest + DecodeAndVerifyData: + example: + decoded: "" + encodedByUserId: encodedByUserId + isVerifiedUser: true + properties: + decoded: {} + encodedByUserId: + nullable: true + type: string + isVerifiedUser: + type: boolean + required: + - decoded + - encodedByUserId + - isVerifiedUser + title: DecodeAndVerifyData + DecodeAndVerifyResponse: + example: + data: + decoded: "" + encodedByUserId: encodedByUserId + isVerifiedUser: true + properties: + data: + $ref: "#/components/schemas/DecodeAndVerifyData" + required: + - data + title: DecodeAndVerifyResponse + act_validateInput_post_200_response: + example: + valid: true + properties: + valid: + description: Whether the input is valid according to the Actor's input schema. + type: boolean + required: + - valid + act_runs_last_dataset_items_post_request: + description: "" + oneOf: + - $ref: "#/components/schemas/PutItemsRequest" + - items: + $ref: "#/components/schemas/PutItemsRequest" + type: array + default: null + act_runs_last_dataset_items_post_400_response: + anyOf: + - $ref: "#/components/schemas/PutItemResponseError" + - $ref: "#/components/schemas/ErrorResponse" + actorTask_get_200_response: + example: + data: + id: id + userId: userId + actId: actId + name: name + username: username + createdAt: 2000-01-23T04:56:07.000+00:00 + modifiedAt: 2000-01-23T04:56:07.000+00:00 + removedAt: 2000-01-23T04:56:07.000+00:00 + stats: "" + options: "" + input: "" + title: title + actorStandby: "" + standbyUrl: https://openapi-generator.tech + properties: + data: + $ref: "#/components/schemas/Task" + required: + - data + actorTask_webhooks_get_200_response_data: + allOf: + - $ref: "#/components/schemas/PaginationResponse" + - properties: + items: + items: + $ref: "#/components/schemas/Webhook" + type: array + default: null + required: + - items + example: + total: 0 + offset: 0 + limit: 1 + desc: true + count: 0 + items: + - id: id + createdAt: 2000-01-23T04:56:07.000+00:00 + modifiedAt: 2000-01-23T04:56:07.000+00:00 + userId: userId + isAdHoc: true + shouldInterpolateStrings: true + eventTypes: + - ACTOR.BUILD.ABORTED + - ACTOR.BUILD.ABORTED + condition: + actorId: actorId + actorTaskId: actorTaskId + actorRunId: actorRunId + ignoreSslErrors: true + doNotRetry: true + requestUrl: https://openapi-generator.tech + payloadTemplate: payloadTemplate + headersTemplate: headersTemplate + description: description + lastDispatch: "" + stats: "" + - id: id + createdAt: 2000-01-23T04:56:07.000+00:00 + modifiedAt: 2000-01-23T04:56:07.000+00:00 + userId: userId + isAdHoc: true + shouldInterpolateStrings: true + eventTypes: + - ACTOR.BUILD.ABORTED + - ACTOR.BUILD.ABORTED + condition: + actorId: actorId + actorTaskId: actorTaskId + actorRunId: actorRunId + ignoreSslErrors: true + doNotRetry: true + requestUrl: https://openapi-generator.tech + payloadTemplate: payloadTemplate + headersTemplate: headersTemplate + description: description + lastDispatch: "" + stats: "" + actorTask_webhooks_get_200_response: + example: + data: + total: 0 + offset: 0 + limit: 1 + desc: true + count: 0 + items: + - id: id + createdAt: 2000-01-23T04:56:07.000+00:00 + modifiedAt: 2000-01-23T04:56:07.000+00:00 + userId: userId + isAdHoc: true + shouldInterpolateStrings: true + eventTypes: + - ACTOR.BUILD.ABORTED + - ACTOR.BUILD.ABORTED + condition: + actorId: actorId + actorTaskId: actorTaskId + actorRunId: actorRunId + ignoreSslErrors: true + doNotRetry: true + requestUrl: https://openapi-generator.tech + payloadTemplate: payloadTemplate + headersTemplate: headersTemplate + description: description + lastDispatch: "" + stats: "" + - id: id + createdAt: 2000-01-23T04:56:07.000+00:00 + modifiedAt: 2000-01-23T04:56:07.000+00:00 + userId: userId + isAdHoc: true + shouldInterpolateStrings: true + eventTypes: + - ACTOR.BUILD.ABORTED + - ACTOR.BUILD.ABORTED + condition: + actorId: actorId + actorTaskId: actorTaskId + actorRunId: actorRunId + ignoreSslErrors: true + doNotRetry: true + requestUrl: https://openapi-generator.tech + payloadTemplate: payloadTemplate + headersTemplate: headersTemplate + description: description + lastDispatch: "" + stats: "" + properties: + data: + $ref: "#/components/schemas/actorTask_webhooks_get_200_response_data" + required: + - data + actorTask_runs_get_200_response_data: + allOf: + - $ref: "#/components/schemas/PaginationResponse" + - properties: + items: + items: + $ref: "#/components/schemas/RunShort" + type: array + default: null + required: + - items + example: + total: 0 + offset: 0 + limit: 1 + desc: true + count: 0 + items: + - id: id + actId: actId + userId: userId + actorTaskId: actorTaskId + status: READY + startedAt: 2000-01-23T04:56:07.000+00:00 + finishedAt: 2000-01-23T04:56:07.000+00:00 + buildId: buildId + buildNumber: buildNumber + buildNumberInt: 5 + meta: + origin: DEVELOPMENT + clientIp: clientIp + userAgent: userAgent + scheduleId: scheduleId + scheduledAt: 2000-01-23T04:56:07.000+00:00 + usageTotalUsd: 2.3021358869347655 + defaultKeyValueStoreId: defaultKeyValueStoreId + defaultDatasetId: defaultDatasetId + defaultRequestQueueId: defaultRequestQueueId + - id: id + actId: actId + userId: userId + actorTaskId: actorTaskId + status: READY + startedAt: 2000-01-23T04:56:07.000+00:00 + finishedAt: 2000-01-23T04:56:07.000+00:00 + buildId: buildId + buildNumber: buildNumber + buildNumberInt: 5 + meta: + origin: DEVELOPMENT + clientIp: clientIp + userAgent: userAgent + scheduleId: scheduleId + scheduledAt: 2000-01-23T04:56:07.000+00:00 + usageTotalUsd: 2.3021358869347655 + defaultKeyValueStoreId: defaultKeyValueStoreId + defaultDatasetId: defaultDatasetId + defaultRequestQueueId: defaultRequestQueueId + actorTask_runs_get_200_response: + example: + data: + total: 0 + offset: 0 + limit: 1 + desc: true + count: 0 + items: + - id: id + actId: actId + userId: userId + actorTaskId: actorTaskId + status: READY + startedAt: 2000-01-23T04:56:07.000+00:00 + finishedAt: 2000-01-23T04:56:07.000+00:00 + buildId: buildId + buildNumber: buildNumber + buildNumberInt: 5 + meta: + origin: DEVELOPMENT + clientIp: clientIp + userAgent: userAgent + scheduleId: scheduleId + scheduledAt: 2000-01-23T04:56:07.000+00:00 + usageTotalUsd: 2.3021358869347655 + defaultKeyValueStoreId: defaultKeyValueStoreId + defaultDatasetId: defaultDatasetId + defaultRequestQueueId: defaultRequestQueueId + - id: id + actId: actId + userId: userId + actorTaskId: actorTaskId + status: READY + startedAt: 2000-01-23T04:56:07.000+00:00 + finishedAt: 2000-01-23T04:56:07.000+00:00 + buildId: buildId + buildNumber: buildNumber + buildNumberInt: 5 + meta: + origin: DEVELOPMENT + clientIp: clientIp + userAgent: userAgent + scheduleId: scheduleId + scheduledAt: 2000-01-23T04:56:07.000+00:00 + usageTotalUsd: 2.3021358869347655 + defaultKeyValueStoreId: defaultKeyValueStoreId + defaultDatasetId: defaultDatasetId + defaultRequestQueueId: defaultRequestQueueId + properties: + data: + $ref: "#/components/schemas/actorTask_runs_get_200_response_data" + required: + - data + actorTask_runs_post_201_response: + example: + data: + id: id + actId: actId + userId: userId + actorTaskId: actorTaskId + startedAt: 2000-01-23T04:56:07.000+00:00 + finishedAt: 2000-01-23T04:56:07.000+00:00 + status: "" + statusMessage: statusMessage + isStatusMessageTerminal: true + meta: "" + pricingInfo: "" + stats: "" + chargedEventCounts: + actor-start: 1 + page-crawled: 150 + data-extracted: 75 + options: "" + buildId: buildId + exitCode: 0 + generalAccess: "" + defaultKeyValueStoreId: defaultKeyValueStoreId + defaultDatasetId: defaultDatasetId + defaultRequestQueueId: defaultRequestQueueId + storageIds: + datasets: + default: wmKPijuyDnPZAPRMk + keyValueStores: + default: wmKPijuyDnPZAPRMk + requestQueues: + default: wmKPijuyDnPZAPRMk + buildNumber: buildNumber + containerUrl: https://openapi-generator.tech + isContainerServerReady: true + gitBranchName: gitBranchName + usage: "" + usageTotalUsd: 6.027456183070403 + usageUsd: "" + metamorphs: + - createdAt: 2000-01-23T04:56:07.000+00:00 + actorId: actorId + buildId: buildId + inputKey: inputKey + - createdAt: 2000-01-23T04:56:07.000+00:00 + actorId: actorId + buildId: buildId + inputKey: inputKey + platformUsageBillingModel: platformUsageBillingModel + properties: + data: + $ref: "#/components/schemas/Run" + required: + - data + ActorStats_publicActorRunStats30Days: + description: Run status counts over the past 30 days. + example: + ABORTED: 4 + FAILED: 7 + SUCCEEDED: 1 + TIMED-OUT: 1 + TOTAL: 1 + properties: + ABORTED: + type: integer + FAILED: + type: integer + SUCCEEDED: + type: integer + TIMED-OUT: + type: integer + TOTAL: + type: integer + VersionSourceFiles_inner: + anyOf: + - $ref: "#/components/schemas/SourceCodeFile" + - $ref: "#/components/schemas/SourceCodeFolder" + PayPerEventActorPricingInfo_allOf_pricingPerEvent: + example: + actorChargeEvents: + key: + eventTitle: eventTitle + eventDescription: eventDescription + eventPriceUsd: 7.457744773683766 + eventTieredPricingUsd: + key: + tieredEventPriceUsd: 1.1730742509559433 + isPrimaryEvent: true + isOneTimeEvent: true + properties: + actorChargeEvents: + additionalProperties: + $ref: "#/components/schemas/ActorChargeEvent" + TaggedBuilds_value: + anyOf: + - allOf: + - $ref: "#/components/schemas/TaggedBuildInfo" + nullable: true + nullable: true + ActorDefinition_storages: + properties: + dataset: + description: "Defines the schema of items in your dataset, the full specification\ + \ can be found in [Apify docs](https://docs.apify.com/platform/actors/development/actor-definition/dataset-schema)" + type: object + ActorDefinition_defaultMemoryMbytes: + description: "Specifies the default amount of memory in megabytes to be used\ + \ when the Actor is started. Can be an integer or a [dynamic memory expression](/platform/actors/development/actor-definition/dynamic-actor-memory)." + oneOf: + - type: string + - type: integer + BuildActVersion: + description: Snapshot of the Actor version that this build was created from. + properties: + sourceType: + $ref: "#/components/schemas/VersionSourceType" + buildTag: + type: string + versionNumber: + pattern: "^([0-9]|[1-9][0-9])\\.([0-9]|[1-9][0-9])$" + type: string + gitRepoUrl: + description: "URL of the git repository, present when sourceType is GIT_REPO." + type: string + sourceFiles: + description: "Inline source files, present when sourceType is SOURCE_FILES." + items: + $ref: "#/components/schemas/SourceCodeFile" + type: array + default: null + title: BuildActVersion + Run_storageIds_datasets: + additionalProperties: {} + description: Aliased dataset IDs for this run. + example: + default: wmKPijuyDnPZAPRMk + properties: + default: + description: ID of the default dataset for this run. + example: wmKPijuyDnPZAPRMk + type: string + Run_storageIds: + description: "A map of aliased storage IDs associated with this run, grouped\ + \ by storage type." + example: + datasets: + default: wmKPijuyDnPZAPRMk + keyValueStores: + default: wmKPijuyDnPZAPRMk + requestQueues: + default: wmKPijuyDnPZAPRMk + properties: + datasets: + $ref: "#/components/schemas/Run_storageIds_datasets" + keyValueStores: + $ref: "#/components/schemas/Run_storageIds_datasets" + requestQueues: + $ref: "#/components/schemas/Run_storageIds_datasets" + RequestBase_payload: + anyOf: + - type: string + description: "The request payload, typically used with POST or PUT requests." + nullable: true + eventData: + example: + actorId: actorId + actorRunId: actorRunId + properties: + actorId: + type: string + actorRunId: + type: string + required: + - actorId + - actorRunId + title: eventData + calls_inner: + example: + startedAt: 2000-01-23T04:56:07.000+00:00 + finishedAt: 2000-01-23T04:56:07.000+00:00 + errorMessage: errorMessage + responseStatus: 0 + responseBody: "{\"foo\": \"bar\"}" + properties: + startedAt: + format: date-time + nullable: true + type: string + finishedAt: + format: date-time + nullable: true + type: string + errorMessage: + nullable: true + type: string + responseStatus: + nullable: true + type: integer + responseBody: + example: "{\"foo\": \"bar\"}" + nullable: true + type: string + ScheduleNotifications: + description: Notification settings for this schedule. + example: + email: true + properties: + email: + type: boolean + title: ScheduleNotifications + BrowserInfoResponse_headers_value: + oneOf: + - type: string + - items: + type: string + type: array + default: null + securitySchemes: + httpBearer: + description: |- + Bearer token provided in the `Authorization` header (e.g., `Authorization: Bearer your_token`—recommended). [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). + + Use your API token to authenticate requests. You can find it on the [Integrations page](https://console.apify.com/account#/integrations) in Apify Console. This method is more secure than query parameters, as headers are not logged in browser history or server logs. + + :::danger Security + + Do not share your API token (or account password) with untrusted parties. + + ::: + + _When is authentication required?_ + - _Required_ for private Actors, tasks, or resources (e.g., builds of private Actors). + - _Required_ when using named formats for IDs (e.g., `username~store-name` for stores or `username~queue-name` for queues). + - _Optional_ for public Actors or resources (e.g., builds of public Actors can be queried without a token). + + For more information, see our [integrations documentation](https://docs.apify.com/platform/integrations). + scheme: bearer + type: http + apiKey: + description: |- + API token provided as a query parameter (e.g., `?token=your_token`—less secure). + + Use your API token to authenticate requests. You can find it on the [Integrations page](https://console.apify.com/account#/integrations) in Apify Console. + + :::danger Security + + Do not share your API token (or account password) with untrusted parties. + + ::: + + _When is authentication required?_ + - _Required_ for private Actors, tasks, or resources (e.g., builds of private Actors). + - _Required_ when using named formats for IDs (e.g., `username~store-name` for stores or `username~queue-name` for queues). + - _Optional_ for public Actors or resources (e.g., builds of public Actors can be queried without a token). + + For more information, see our [integrations documentation](https://docs.apify.com/platform/integrations). + in: query + name: token + type: apiKey +x-tagGroups: +- name: Actors + tags: + - Actors + - Actors/Actor versions + - Actors/Actor builds + - Actors/Actor runs + - Actors/Webhook collection + - Actors/Last run object and its storages +- name: Actor builds + tags: + - Actor builds +- name: Actor runs + tags: + - Actor runs +- name: Actor tasks + tags: + - Actor tasks +- name: Storage + tags: + - Storage/Datasets + - Storage/Key-value stores + - Storage/Request queues + - Storage/Request queues/Requests + - Storage/Request queues/Requests locks +- name: Webhooks + tags: + - Webhooks/Webhooks + - Webhooks/Webhook dispatches +- name: Schedules + tags: + - Schedules +- name: Store + tags: + - Store +- name: Logs + tags: + - Logs +- name: Users + tags: + - Users +- name: Tools + tags: + - Tools +- name: Convenience endpoints + tags: + - Default dataset + - Default key-value store + - Default request queue + - Last Actor run's default dataset + - Last Actor run's default key-value store + - Last Actor run's default request queue + - Last Actor run's log + - Last Actor run's abort + - Last Actor run's metamorph + - Last Actor run's reboot + - Last Actor task run's default dataset + - Last Actor task run's default key-value store + - Last Actor task run's default request queue + - Last Actor task run's log + - Last Actor task run's abort + - Last Actor task run's metamorph + - Last Actor task run's reboot diff --git a/api_actor_builds.go b/api_actor_builds.go new file mode 100644 index 0000000..5c0d557 --- /dev/null +++ b/api_actor_builds.go @@ -0,0 +1,1144 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" + "strings" +) + + +// ActorBuildsAPIService ActorBuildsAPI service +type ActorBuildsAPIService service + +type ApiActorBuildAbortPostRequest struct { + ctx context.Context + ApiService *ActorBuildsAPIService + buildId string +} + +func (r ApiActorBuildAbortPostRequest) Execute() (*BuildResponse, *http.Response, error) { + return r.ApiService.ActorBuildAbortPostExecute(r) +} + +/* +ActorBuildAbortPost Abort build + +Aborts an Actor build and returns an object that contains all the details +about the build. + +Only builds that are starting or running are aborted. For builds with status +`FINISHED`, `FAILED`, `ABORTING` and `TIMED-OUT` this call does nothing. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param buildId ID of the build, found in the build's Info tab. + @return ApiActorBuildAbortPostRequest +*/ +func (a *ActorBuildsAPIService) ActorBuildAbortPost(ctx context.Context, buildId string) ApiActorBuildAbortPostRequest { + return ApiActorBuildAbortPostRequest{ + ApiService: a, + ctx: ctx, + buildId: buildId, + } +} + +// Execute executes the request +// @return BuildResponse +func (a *ActorBuildsAPIService) ActorBuildAbortPostExecute(r ApiActorBuildAbortPostRequest) (*BuildResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *BuildResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ActorBuildsAPIService.ActorBuildAbortPost") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/actor-builds/{buildId}/abort" + localVarPath = strings.Replace(localVarPath, "{"+"buildId"+"}", url.PathEscape(parameterValueToString(r.buildId, "buildId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiActorBuildDeleteRequest struct { + ctx context.Context + ApiService *ActorBuildsAPIService + buildId string +} + +func (r ApiActorBuildDeleteRequest) Execute() (*http.Response, error) { + return r.ApiService.ActorBuildDeleteExecute(r) +} + +/* +ActorBuildDelete Delete build + +Delete the build. The build that is the current default build for the Actor +cannot be deleted. + +Only users with build permissions for the Actor can delete builds. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param buildId ID of the build, found in the build's Info tab. + @return ApiActorBuildDeleteRequest +*/ +func (a *ActorBuildsAPIService) ActorBuildDelete(ctx context.Context, buildId string) ApiActorBuildDeleteRequest { + return ApiActorBuildDeleteRequest{ + ApiService: a, + ctx: ctx, + buildId: buildId, + } +} + +// Execute executes the request +func (a *ActorBuildsAPIService) ActorBuildDeleteExecute(r ApiActorBuildDeleteRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ActorBuildsAPIService.ActorBuildDelete") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/actor-builds/{buildId}" + localVarPath = strings.Replace(localVarPath, "{"+"buildId"+"}", url.PathEscape(parameterValueToString(r.buildId, "buildId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiActorBuildGetRequest struct { + ctx context.Context + ApiService *ActorBuildsAPIService + buildId string + waitForFinish *float64 +} + +// The maximum number of seconds the server waits for the build to finish. By default it is `0`, the maximum value is `60`. <!-- MAX_ACTOR_JOB_ASYNC_WAIT_SECS --> If the build finishes in time then the returned build object will have a terminal status (e.g. `SUCCEEDED`), otherwise it will have a transitional status (e.g. `RUNNING`). +func (r ApiActorBuildGetRequest) WaitForFinish(waitForFinish float64) ApiActorBuildGetRequest { + r.waitForFinish = &waitForFinish + return r +} + +func (r ApiActorBuildGetRequest) Execute() (*BuildResponse, *http.Response, error) { + return r.ApiService.ActorBuildGetExecute(r) +} + +/* +ActorBuildGet Get build + +Gets an object that contains all the details about a specific build of an +Actor. + +By passing the optional `waitForFinish` parameter the API endpoint will +synchronously wait for the build to finish. This is useful to avoid periodic +polling when waiting for an Actor build to finish. + +This endpoint does not require the authentication token. Instead, calls are authenticated using a hard-to-guess ID of the build. However, +if you access the endpoint without the token, certain attributes, such as `usageUsd` and `usageTotalUsd`, will be hidden. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param buildId ID of the build, found in the build's Info tab. + @return ApiActorBuildGetRequest +*/ +func (a *ActorBuildsAPIService) ActorBuildGet(ctx context.Context, buildId string) ApiActorBuildGetRequest { + return ApiActorBuildGetRequest{ + ApiService: a, + ctx: ctx, + buildId: buildId, + } +} + +// Execute executes the request +// @return BuildResponse +func (a *ActorBuildsAPIService) ActorBuildGetExecute(r ApiActorBuildGetRequest) (*BuildResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *BuildResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ActorBuildsAPIService.ActorBuildGet") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/actor-builds/{buildId}" + localVarPath = strings.Replace(localVarPath, "{"+"buildId"+"}", url.PathEscape(parameterValueToString(r.buildId, "buildId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.waitForFinish != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "waitForFinish", r.waitForFinish, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiActorBuildLogGetRequest struct { + ctx context.Context + ApiService *ActorBuildsAPIService + buildId string + stream *bool + download *bool +} + +// If `true` or `1` then the logs will be streamed as long as the run or build is running. +func (r ApiActorBuildLogGetRequest) Stream(stream bool) ApiActorBuildLogGetRequest { + r.stream = &stream + return r +} + +// If `true` or `1` then the web browser will download the log file rather than open it in a tab. +func (r ApiActorBuildLogGetRequest) Download(download bool) ApiActorBuildLogGetRequest { + r.download = &download + return r +} + +func (r ApiActorBuildLogGetRequest) Execute() (string, *http.Response, error) { + return r.ApiService.ActorBuildLogGetExecute(r) +} + +/* +ActorBuildLogGet Get build's Log + +Retrieves Actor build's logs. + +This endpoint is a shortcut for getting the build's log. Same as [Get log](/api/v2/log-get) endpoint. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param buildId ID of the build, found in the build's Info tab. + @return ApiActorBuildLogGetRequest +*/ +func (a *ActorBuildsAPIService) ActorBuildLogGet(ctx context.Context, buildId string) ApiActorBuildLogGetRequest { + return ApiActorBuildLogGetRequest{ + ApiService: a, + ctx: ctx, + buildId: buildId, + } +} + +// Execute executes the request +// @return string +func (a *ActorBuildsAPIService) ActorBuildLogGetExecute(r ApiActorBuildLogGetRequest) (string, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue string + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ActorBuildsAPIService.ActorBuildLogGet") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/actor-builds/{buildId}/log" + localVarPath = strings.Replace(localVarPath, "{"+"buildId"+"}", url.PathEscape(parameterValueToString(r.buildId, "buildId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.stream != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "stream", r.stream, "form", "") + } + if r.download != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "download", r.download, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"text/plain", "application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiActorBuildOpenapiJsonGetRequest struct { + ctx context.Context + ApiService *ActorBuildsAPIService + buildId string +} + +func (r ApiActorBuildOpenapiJsonGetRequest) Execute() (map[string]interface{}, *http.Response, error) { + return r.ApiService.ActorBuildOpenapiJsonGetExecute(r) +} + +/* +ActorBuildOpenapiJsonGet Get OpenAPI definition + +Get the OpenAPI definition for Actor builds. Two similar endpoints are available: + +- [First endpoint](/api/v2/act-openapi-json-get): Requires both `actorId` and `buildId`. Use `default` as the `buildId` to get the OpenAPI schema for the default Actor build. +- [Second endpoint](/api/v2/actor-build-openapi-json-get): Requires only `buildId`. + +Get the OpenAPI definition for a specific Actor build. +Authentication is based on the build's unique ID. No authentication token is required. + +:::note + +You can also use the [`/api/v2/act-openapi-json-get`](/api/v2/act-openapi-json-get) endpoint to get the OpenAPI definition for a build. + +::: + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param buildId ID of the build, found in the build's Info tab. Use the special value `default` to get the OpenAPI schema for the Actor's default build. + @return ApiActorBuildOpenapiJsonGetRequest +*/ +func (a *ActorBuildsAPIService) ActorBuildOpenapiJsonGet(ctx context.Context, buildId string) ApiActorBuildOpenapiJsonGetRequest { + return ApiActorBuildOpenapiJsonGetRequest{ + ApiService: a, + ctx: ctx, + buildId: buildId, + } +} + +// Execute executes the request +// @return map[string]interface{} +func (a *ActorBuildsAPIService) ActorBuildOpenapiJsonGetExecute(r ApiActorBuildOpenapiJsonGetRequest) (map[string]interface{}, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue map[string]interface{} + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ActorBuildsAPIService.ActorBuildOpenapiJsonGet") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/actor-builds/{buildId}/openapi.json" + localVarPath = strings.Replace(localVarPath, "{"+"buildId"+"}", url.PathEscape(parameterValueToString(r.buildId, "buildId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiActorBuildsGetRequest struct { + ctx context.Context + ApiService *ActorBuildsAPIService + offset *float64 + limit *float64 + desc *bool +} + +// Number of items that should be skipped at the start. The default value is `0`. +func (r ApiActorBuildsGetRequest) Offset(offset float64) ApiActorBuildsGetRequest { + r.offset = &offset + return r +} + +// Maximum number of items to return. The default value as well as the maximum is `1000`. +func (r ApiActorBuildsGetRequest) Limit(limit float64) ApiActorBuildsGetRequest { + r.limit = &limit + return r +} + +// If `true` or `1` then the objects are sorted by the `startedAt` field in descending order. By default, they are sorted in ascending order. +func (r ApiActorBuildsGetRequest) Desc(desc bool) ApiActorBuildsGetRequest { + r.desc = &desc + return r +} + +func (r ApiActorBuildsGetRequest) Execute() (*ListOfBuildsResponse, *http.Response, error) { + return r.ApiService.ActorBuildsGetExecute(r) +} + +/* +ActorBuildsGet Get user builds list + +Gets a list of all builds for a user. The response is a JSON array of +objects, where each object contains basic information about a single build. + +The endpoint supports pagination using the `limit` and `offset` parameters +and it will not return more than 1000 records. + +By default, the records are sorted by the `startedAt` field in ascending +order. Therefore, you can use pagination to incrementally fetch all builds while +new ones are still being started. To sort the records in descending order, use +the `desc=1` parameter. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiActorBuildsGetRequest +*/ +func (a *ActorBuildsAPIService) ActorBuildsGet(ctx context.Context) ApiActorBuildsGetRequest { + return ApiActorBuildsGetRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return ListOfBuildsResponse +func (a *ActorBuildsAPIService) ActorBuildsGetExecute(r ApiActorBuildsGetRequest) (*ListOfBuildsResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ListOfBuildsResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ActorBuildsAPIService.ActorBuildsGet") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/actor-builds" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.offset != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "form", "") + } + if r.limit != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "form", "") + } + if r.desc != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "desc", r.desc, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/api_actor_runs.go b/api_actor_runs.go new file mode 100644 index 0000000..de26178 --- /dev/null +++ b/api_actor_runs.go @@ -0,0 +1,2192 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" + "strings" + "time" +) + + +// ActorRunsAPIService ActorRunsAPI service +type ActorRunsAPIService service + +type ApiActorRunAbortPostRequest struct { + ctx context.Context + ApiService *ActorRunsAPIService + runId string + gracefully *bool +} + +// If true passed, the Actor run will abort gracefully. It will send `aborting` and `persistState` event into run and force-stop the run after 30 seconds. It is helpful in cases where you plan to resurrect the run later. +func (r ApiActorRunAbortPostRequest) Gracefully(gracefully bool) ApiActorRunAbortPostRequest { + r.gracefully = &gracefully + return r +} + +func (r ApiActorRunAbortPostRequest) Execute() (*RunResponse, *http.Response, error) { + return r.ApiService.ActorRunAbortPostExecute(r) +} + +/* +ActorRunAbortPost Abort run + +Aborts an Actor run and returns an object that contains all the details +about the run. + +Only runs that are starting or running are aborted. For runs with status +`FINISHED`, `FAILED`, `ABORTING` and `TIMED-OUT` this call does nothing. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param runId Actor run ID. + @return ApiActorRunAbortPostRequest +*/ +func (a *ActorRunsAPIService) ActorRunAbortPost(ctx context.Context, runId string) ApiActorRunAbortPostRequest { + return ApiActorRunAbortPostRequest{ + ApiService: a, + ctx: ctx, + runId: runId, + } +} + +// Execute executes the request +// @return RunResponse +func (a *ActorRunsAPIService) ActorRunAbortPostExecute(r ApiActorRunAbortPostRequest) (*RunResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *RunResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ActorRunsAPIService.ActorRunAbortPost") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/actor-runs/{runId}/abort" + localVarPath = strings.Replace(localVarPath, "{"+"runId"+"}", url.PathEscape(parameterValueToString(r.runId, "runId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.gracefully != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "gracefully", r.gracefully, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiActorRunDeleteRequest struct { + ctx context.Context + ApiService *ActorRunsAPIService + runId string +} + +func (r ApiActorRunDeleteRequest) Execute() (*http.Response, error) { + return r.ApiService.ActorRunDeleteExecute(r) +} + +/* +ActorRunDelete Delete run + +Delete the run. Only finished runs can be deleted. Only the person or +organization that initiated the run can delete it. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param runId Actor run ID. + @return ApiActorRunDeleteRequest +*/ +func (a *ActorRunsAPIService) ActorRunDelete(ctx context.Context, runId string) ApiActorRunDeleteRequest { + return ApiActorRunDeleteRequest{ + ApiService: a, + ctx: ctx, + runId: runId, + } +} + +// Execute executes the request +func (a *ActorRunsAPIService) ActorRunDeleteExecute(r ApiActorRunDeleteRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ActorRunsAPIService.ActorRunDelete") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/actor-runs/{runId}" + localVarPath = strings.Replace(localVarPath, "{"+"runId"+"}", url.PathEscape(parameterValueToString(r.runId, "runId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiActorRunGetRequest struct { + ctx context.Context + ApiService *ActorRunsAPIService + runId string + waitForFinish *float64 +} + +// The maximum number of seconds the server waits for the run to finish. By default it is `0`, the maximum value is `60`. <!-- MAX_ACTOR_JOB_ASYNC_WAIT_SECS --> If the run finishes in time then the returned run object will have a terminal status (e.g. `SUCCEEDED`), otherwise it will have a transitional status (e.g. `RUNNING`). +func (r ApiActorRunGetRequest) WaitForFinish(waitForFinish float64) ApiActorRunGetRequest { + r.waitForFinish = &waitForFinish + return r +} + +func (r ApiActorRunGetRequest) Execute() (*RunResponse, *http.Response, error) { + return r.ApiService.ActorRunGetExecute(r) +} + +/* +ActorRunGet Get run + +This is not a single endpoint, but an entire group of endpoints that lets +you retrieve the run or any of its default storages. + +##### Convenience endpoints for Actor run default storages + +* [Dataset](/api/v2/default-dataset) + +* [Key-value store](/api/v2/default-key-value-store) + +* [Request queue](/api/v2/default-request-queue) + +Gets an object that contains all the details about a +specific run of an Actor. + +By passing the optional `waitForFinish` parameter the API endpoint will synchronously wait +for the run to finish. This is useful to avoid periodic polling when waiting for Actor run to complete. +Note that the first response after completion can still show preliminary `stats`, costs, and event counts. +For stable figures, wait about 10 seconds and call the endpoint again. + +This endpoint does not require the authentication token. Instead, calls are authenticated using a hard-to-guess ID of the run. However, +if you access the endpoint without the token, certain attributes, such as `usageUsd` and `usageTotalUsd`, will be hidden. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param runId Actor run ID. + @return ApiActorRunGetRequest +*/ +func (a *ActorRunsAPIService) ActorRunGet(ctx context.Context, runId string) ApiActorRunGetRequest { + return ApiActorRunGetRequest{ + ApiService: a, + ctx: ctx, + runId: runId, + } +} + +// Execute executes the request +// @return RunResponse +func (a *ActorRunsAPIService) ActorRunGetExecute(r ApiActorRunGetRequest) (*RunResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *RunResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ActorRunsAPIService.ActorRunGet") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/actor-runs/{runId}" + localVarPath = strings.Replace(localVarPath, "{"+"runId"+"}", url.PathEscape(parameterValueToString(r.runId, "runId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.waitForFinish != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "waitForFinish", r.waitForFinish, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiActorRunLogGetRequest struct { + ctx context.Context + ApiService *ActorRunsAPIService + runId string + stream *bool + download *bool + raw *bool +} + +// If `true` or `1` then the logs will be streamed as long as the run or build is running. +func (r ApiActorRunLogGetRequest) Stream(stream bool) ApiActorRunLogGetRequest { + r.stream = &stream + return r +} + +// If `true` or `1` then the web browser will download the log file rather than open it in a tab. +func (r ApiActorRunLogGetRequest) Download(download bool) ApiActorRunLogGetRequest { + r.download = &download + return r +} + +// If `true` or `1`, the logs will be kept verbatim. By default, the API removes ANSI escape codes from the logs, keeping only printable characters. +func (r ApiActorRunLogGetRequest) Raw(raw bool) ApiActorRunLogGetRequest { + r.raw = &raw + return r +} + +func (r ApiActorRunLogGetRequest) Execute() (string, *http.Response, error) { + return r.ApiService.ActorRunLogGetExecute(r) +} + +/* +ActorRunLogGet Get run's log + +Retrieves Actor run's logs. + +This endpoint is a shortcut for getting the run's log. Same as [Get log](/api/v2/log-get) endpoint. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param runId Actor run ID. + @return ApiActorRunLogGetRequest +*/ +func (a *ActorRunsAPIService) ActorRunLogGet(ctx context.Context, runId string) ApiActorRunLogGetRequest { + return ApiActorRunLogGetRequest{ + ApiService: a, + ctx: ctx, + runId: runId, + } +} + +// Execute executes the request +// @return string +func (a *ActorRunsAPIService) ActorRunLogGetExecute(r ApiActorRunLogGetRequest) (string, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue string + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ActorRunsAPIService.ActorRunLogGet") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/actor-runs/{runId}/log" + localVarPath = strings.Replace(localVarPath, "{"+"runId"+"}", url.PathEscape(parameterValueToString(r.runId, "runId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.stream != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "stream", r.stream, "form", "") + } + if r.download != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "download", r.download, "form", "") + } + if r.raw != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "raw", r.raw, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"text/plain", "application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiActorRunMetamorphPostRequest struct { + ctx context.Context + ApiService *ActorRunsAPIService + runId string + targetActorId *string + build *string +} + +// ID of a target Actor that the run should be transformed into. +func (r ApiActorRunMetamorphPostRequest) TargetActorId(targetActorId string) ApiActorRunMetamorphPostRequest { + r.targetActorId = &targetActorId + return r +} + +// Optional build of the target Actor. It can be either a build tag or build number. By default, the run uses the build specified in the default run configuration for the target Actor (typically `latest`). +func (r ApiActorRunMetamorphPostRequest) Build(build string) ApiActorRunMetamorphPostRequest { + r.build = &build + return r +} + +func (r ApiActorRunMetamorphPostRequest) Execute() (*RunResponse, *http.Response, error) { + return r.ApiService.ActorRunMetamorphPostExecute(r) +} + +/* +ActorRunMetamorphPost Metamorph run + +Transforms an Actor run into a run of another Actor with a new input. + +This is useful if you want to use another Actor to finish the work +of your current Actor run, without the need to create a completely new run +and waiting for its finish. + +For the users of your Actors, the metamorph operation is transparent, they +will just see your Actor got the work done. + +Internally, the system stops the Docker container corresponding to the Actor +run and starts a new container using a different Docker image. + +All the default storages are preserved and the new input is stored under the +`INPUT-METAMORPH-1` key in the same default key-value store. + +For more information, see the [Actor docs](https://docs.apify.com/platform/actors/development/programming-interface/metamorph). + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param runId Actor run ID. + @return ApiActorRunMetamorphPostRequest +*/ +func (a *ActorRunsAPIService) ActorRunMetamorphPost(ctx context.Context, runId string) ApiActorRunMetamorphPostRequest { + return ApiActorRunMetamorphPostRequest{ + ApiService: a, + ctx: ctx, + runId: runId, + } +} + +// Execute executes the request +// @return RunResponse +func (a *ActorRunsAPIService) ActorRunMetamorphPostExecute(r ApiActorRunMetamorphPostRequest) (*RunResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *RunResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ActorRunsAPIService.ActorRunMetamorphPost") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/actor-runs/{runId}/metamorph" + localVarPath = strings.Replace(localVarPath, "{"+"runId"+"}", url.PathEscape(parameterValueToString(r.runId, "runId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.targetActorId == nil { + return localVarReturnValue, nil, reportError("targetActorId is required and must be specified") + } + + parameterAddToHeaderOrQuery(localVarQueryParams, "targetActorId", r.targetActorId, "form", "") + if r.build != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "build", r.build, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiActorRunPutRequest struct { + ctx context.Context + ApiService *ActorRunsAPIService + runId string + updateRunRequest *UpdateRunRequest +} + +// +func (r ApiActorRunPutRequest) UpdateRunRequest(updateRunRequest UpdateRunRequest) ApiActorRunPutRequest { + r.updateRunRequest = &updateRunRequest + return r +} + +func (r ApiActorRunPutRequest) Execute() (*RunResponse, *http.Response, error) { + return r.ApiService.ActorRunPutExecute(r) +} + +/* +ActorRunPut Update run + +This endpoint can be used to update both the run's status message and to configure its general resource access level. + +**Status message:** + +You can set a single status message on your run that will be displayed in +the Apify Console UI. During an Actor run, you will typically do this in order +to inform users of your Actor about the Actor's progress. + +The request body must contain `runId` and `statusMessage` properties. The +`isStatusMessageTerminal` property is optional and it indicates if the +status message is the very last one. In the absence of a status message, the +platform will try to substitute sensible defaults. + +**General resource access:** + +You can also update the run's general resource access setting, which determines who can view the run and its related data. + +Allowed values: + +* `FOLLOW_USER_SETTING` - The run inherits the general access setting from the account level. +* `ANYONE_WITH_ID_CAN_READ` - The run can be viewed anonymously by anyone who has its ID. +* `RESTRICTED` - Only users with explicit access to the resource can access the run. + +When a run is accessible anonymously, all of the run's default storages and logs also become accessible anonymously. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param runId Actor run ID. + @return ApiActorRunPutRequest +*/ +func (a *ActorRunsAPIService) ActorRunPut(ctx context.Context, runId string) ApiActorRunPutRequest { + return ApiActorRunPutRequest{ + ApiService: a, + ctx: ctx, + runId: runId, + } +} + +// Execute executes the request +// @return RunResponse +func (a *ActorRunsAPIService) ActorRunPutExecute(r ApiActorRunPutRequest) (*RunResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *RunResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ActorRunsAPIService.ActorRunPut") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/actor-runs/{runId}" + localVarPath = strings.Replace(localVarPath, "{"+"runId"+"}", url.PathEscape(parameterValueToString(r.runId, "runId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.updateRunRequest == nil { + return localVarReturnValue, nil, reportError("updateRunRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.updateRunRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 413 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 415 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiActorRunRebootPostRequest struct { + ctx context.Context + ApiService *ActorRunsAPIService + runId string +} + +func (r ApiActorRunRebootPostRequest) Execute() (*RunResponse, *http.Response, error) { + return r.ApiService.ActorRunRebootPostExecute(r) +} + +/* +ActorRunRebootPost Reboot run + +Reboots an Actor run and returns an object that contains all the details +about the rebooted run. + +Only runs that are running, i.e. runs with status `RUNNING` can be rebooted. + +The run's container will be restarted, so any data not persisted in the +key-value store, dataset, or request queue will be lost. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param runId Actor run ID. + @return ApiActorRunRebootPostRequest +*/ +func (a *ActorRunsAPIService) ActorRunRebootPost(ctx context.Context, runId string) ApiActorRunRebootPostRequest { + return ApiActorRunRebootPostRequest{ + ApiService: a, + ctx: ctx, + runId: runId, + } +} + +// Execute executes the request +// @return RunResponse +func (a *ActorRunsAPIService) ActorRunRebootPostExecute(r ApiActorRunRebootPostRequest) (*RunResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *RunResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ActorRunsAPIService.ActorRunRebootPost") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/actor-runs/{runId}/reboot" + localVarPath = strings.Replace(localVarPath, "{"+"runId"+"}", url.PathEscape(parameterValueToString(r.runId, "runId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiActorRunsGetRequest struct { + ctx context.Context + ApiService *ActorRunsAPIService + offset *float64 + limit *float64 + desc *bool + status *[]string + startedAfter *time.Time + startedBefore *time.Time +} + +// Number of items that should be skipped at the start. The default value is `0`. +func (r ApiActorRunsGetRequest) Offset(offset float64) ApiActorRunsGetRequest { + r.offset = &offset + return r +} + +// Maximum number of items to return. The default value as well as the maximum is `1000`. +func (r ApiActorRunsGetRequest) Limit(limit float64) ApiActorRunsGetRequest { + r.limit = &limit + return r +} + +// If `true` or `1` then the objects are sorted by the `startedAt` field in descending order. By default, they are sorted in ascending order. +func (r ApiActorRunsGetRequest) Desc(desc bool) ApiActorRunsGetRequest { + r.desc = &desc + return r +} + +// Single status or comma-separated list of statuses, see ([available statuses](https://docs.apify.com/platform/actors/running/runs-and-builds#lifecycle)). Used to filter runs by the specified statuses only. +func (r ApiActorRunsGetRequest) Status(status []string) ApiActorRunsGetRequest { + r.status = &status + return r +} + +// Filter runs that started after the specified date and time (inclusive). The value must be a valid ISO 8601 datetime string (UTC). +func (r ApiActorRunsGetRequest) StartedAfter(startedAfter time.Time) ApiActorRunsGetRequest { + r.startedAfter = &startedAfter + return r +} + +// Filter runs that started before the specified date and time (inclusive). The value must be a valid ISO 8601 datetime string (UTC). +func (r ApiActorRunsGetRequest) StartedBefore(startedBefore time.Time) ApiActorRunsGetRequest { + r.startedBefore = &startedBefore + return r +} + +func (r ApiActorRunsGetRequest) Execute() (*ListOfRunsResponse, *http.Response, error) { + return r.ApiService.ActorRunsGetExecute(r) +} + +/* +ActorRunsGet Get user runs list + +Gets a list of all runs for a user. The response is a list of objects, where +each object contains basic information about a single Actor run. + +The endpoint supports pagination using the `limit` and `offset` parameters +and it will not return more than 1000 array elements. + +By default, the records are sorted by the `startedAt` field in ascending +order. Therefore, you can use pagination to incrementally fetch all records while +new ones are still being created. To sort the records in descending order, use +`desc=1` parameter. You can also filter runs by `startedAt`` and `status`` fields ([available +statuses](https://docs.apify.com/platform/actors/running/runs-and-builds#lifecycle)). + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiActorRunsGetRequest +*/ +func (a *ActorRunsAPIService) ActorRunsGet(ctx context.Context) ApiActorRunsGetRequest { + return ApiActorRunsGetRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return ListOfRunsResponse +func (a *ActorRunsAPIService) ActorRunsGetExecute(r ApiActorRunsGetRequest) (*ListOfRunsResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ListOfRunsResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ActorRunsAPIService.ActorRunsGet") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/actor-runs" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.offset != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "form", "") + } + if r.limit != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "form", "") + } + if r.desc != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "desc", r.desc, "form", "") + } + if r.status != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "status", r.status, "form", "csv") + } + if r.startedAfter != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "startedAfter", r.startedAfter, "form", "") + } + if r.startedBefore != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "startedBefore", r.startedBefore, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiPostChargeRunRequest struct { + ctx context.Context + ApiService *ActorRunsAPIService + runId string + chargeRunRequest *ChargeRunRequest + idempotencyKey *string +} + +// Define which event, and how many times, you want to charge for. +func (r ApiPostChargeRunRequest) ChargeRunRequest(chargeRunRequest ChargeRunRequest) ApiPostChargeRunRequest { + r.chargeRunRequest = &chargeRunRequest + return r +} + +// Always pass a unique idempotency key (any unique string) for each charge to avoid double charging in case of retries or network errors. +func (r ApiPostChargeRunRequest) IdempotencyKey(idempotencyKey string) ApiPostChargeRunRequest { + r.idempotencyKey = &idempotencyKey + return r +} + +func (r ApiPostChargeRunRequest) Execute() (map[string]interface{}, *http.Response, error) { + return r.ApiService.PostChargeRunExecute(r) +} + +/* +PostChargeRun Charge events in run + +Charge for events in the run of your [pay per event Actor](https://docs.apify.com/platform/actors/running/actors-in-store#pay-per-event). +The event you are charging for must be one of the configured events in your Actor. If the Actor is not set up as pay per event, or if the event is not configured, +the endpoint will return an error. The endpoint must be called from the Actor run itself, with the same API token that the run was started with. + +:::info Learn more about pay-per-event pricing + +For more details about pay-per-event (PPE) pricing, refer to our [PPE documentation](/platform/actors/publishing/monetize/pay-per-event). + +::: + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param runId Actor run ID. + @return ApiPostChargeRunRequest +*/ +func (a *ActorRunsAPIService) PostChargeRun(ctx context.Context, runId string) ApiPostChargeRunRequest { + return ApiPostChargeRunRequest{ + ApiService: a, + ctx: ctx, + runId: runId, + } +} + +// Execute executes the request +// @return map[string]interface{} +func (a *ActorRunsAPIService) PostChargeRunExecute(r ApiPostChargeRunRequest) (map[string]interface{}, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue map[string]interface{} + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ActorRunsAPIService.PostChargeRun") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/actor-runs/{runId}/charge" + localVarPath = strings.Replace(localVarPath, "{"+"runId"+"}", url.PathEscape(parameterValueToString(r.runId, "runId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.chargeRunRequest == nil { + return localVarReturnValue, nil, reportError("chargeRunRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.idempotencyKey != nil { + parameterAddToHeaderOrQuery(localVarHeaderParams, "idempotency-key", r.idempotencyKey, "simple", "") + } + // body params + localVarPostBody = r.chargeRunRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 413 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 415 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiPostResurrectRunRequest struct { + ctx context.Context + ApiService *ActorRunsAPIService + runId string + build *string + timeout *float64 + memory *float64 + maxItems *float64 + maxTotalChargeUsd *float64 + restartOnError *bool +} + +// Specifies the Actor build to run. It can be either a build tag or build number. By default, the run is resurrected with the same build it originally used. Specifically, if a run was first started with the `latest` tag, which resolves to version `0.0.3` at the time, a run resurrected without this parameter will continue running with `0.0.3`, even if `latest` already points to a newer build. +func (r ApiPostResurrectRunRequest) Build(build string) ApiPostResurrectRunRequest { + r.build = &build + return r +} + +// Optional timeout for the run, in seconds. By default, the run uses the timeout specified in the run that is being resurrected. +func (r ApiPostResurrectRunRequest) Timeout(timeout float64) ApiPostResurrectRunRequest { + r.timeout = &timeout + return r +} + +// Memory limit for the run, in megabytes. The amount of memory can be set to a power of 2 with a minimum of 128. By default, the run uses the memory limit specified in the run that is being resurrected. +func (r ApiPostResurrectRunRequest) Memory(memory float64) ApiPostResurrectRunRequest { + r.memory = &memory + return r +} + +// Specifies the maximum number of dataset items that will be charged for pay-per-result Actors. This does NOT guarantee that the Actor will return only this many items. It only ensures you won't be charged for more than this number of items. Only works for pay-per-result Actors. Value can be accessed in the actor run using `ACTOR_MAX_PAID_DATASET_ITEMS` environment variable. +func (r ApiPostResurrectRunRequest) MaxItems(maxItems float64) ApiPostResurrectRunRequest { + r.maxItems = &maxItems + return r +} + +// Specifies the maximum cost of the run. This parameter is useful for pay-per-event Actors, as it allows you to limit the amount charged to your subscription. You can access the maximum cost in your Actor by using the `ACTOR_MAX_TOTAL_CHARGE_USD` environment variable. +func (r ApiPostResurrectRunRequest) MaxTotalChargeUsd(maxTotalChargeUsd float64) ApiPostResurrectRunRequest { + r.maxTotalChargeUsd = &maxTotalChargeUsd + return r +} + +// Determines whether the resurrected run will be restarted if it fails. By default, the resurrected run uses the same setting as before. +func (r ApiPostResurrectRunRequest) RestartOnError(restartOnError bool) ApiPostResurrectRunRequest { + r.restartOnError = &restartOnError + return r +} + +func (r ApiPostResurrectRunRequest) Execute() (*RunResponse, *http.Response, error) { + return r.ApiService.PostResurrectRunExecute(r) +} + +/* +PostResurrectRun Resurrect run + +Resurrects a finished Actor run and returns an object that contains all the details about the resurrected run. +Only finished runs, i.e. runs with status `FINISHED`, `FAILED`, `ABORTED` and `TIMED-OUT` can be resurrected. +Run status will be updated to RUNNING and its container will be restarted with the same storages +(the same behaviour as when the run gets migrated to the new server). + +For more information, see the [Actor docs](https://docs.apify.com/platform/actors/running/runs-and-builds#resurrection-of-finished-run). + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param runId Actor run ID. + @return ApiPostResurrectRunRequest +*/ +func (a *ActorRunsAPIService) PostResurrectRun(ctx context.Context, runId string) ApiPostResurrectRunRequest { + return ApiPostResurrectRunRequest{ + ApiService: a, + ctx: ctx, + runId: runId, + } +} + +// Execute executes the request +// @return RunResponse +func (a *ActorRunsAPIService) PostResurrectRunExecute(r ApiPostResurrectRunRequest) (*RunResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *RunResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ActorRunsAPIService.PostResurrectRun") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/actor-runs/{runId}/resurrect" + localVarPath = strings.Replace(localVarPath, "{"+"runId"+"}", url.PathEscape(parameterValueToString(r.runId, "runId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.build != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "build", r.build, "form", "") + } + if r.timeout != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "timeout", r.timeout, "form", "") + } + if r.memory != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "memory", r.memory, "form", "") + } + if r.maxItems != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "maxItems", r.maxItems, "form", "") + } + if r.maxTotalChargeUsd != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "maxTotalChargeUsd", r.maxTotalChargeUsd, "form", "") + } + if r.restartOnError != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "restartOnError", r.restartOnError, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/api_actor_tasks.go b/api_actor_tasks.go new file mode 100644 index 0000000..fc6645a --- /dev/null +++ b/api_actor_tasks.go @@ -0,0 +1,4086 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" + "strings" +) + + +// ActorTasksAPIService ActorTasksAPI service +type ActorTasksAPIService service + +type ApiActorTaskDeleteRequest struct { + ctx context.Context + ApiService *ActorTasksAPIService + actorTaskId string +} + +func (r ApiActorTaskDeleteRequest) Execute() (map[string]interface{}, *http.Response, error) { + return r.ApiService.ActorTaskDeleteExecute(r) +} + +/* +ActorTaskDelete Delete task + +Delete the task specified through the `actorTaskId` parameter. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param actorTaskId Task ID or a tilde-separated owner's username and task's name. + @return ApiActorTaskDeleteRequest +*/ +func (a *ActorTasksAPIService) ActorTaskDelete(ctx context.Context, actorTaskId string) ApiActorTaskDeleteRequest { + return ApiActorTaskDeleteRequest{ + ApiService: a, + ctx: ctx, + actorTaskId: actorTaskId, + } +} + +// Execute executes the request +// @return map[string]interface{} +func (a *ActorTasksAPIService) ActorTaskDeleteExecute(r ApiActorTaskDeleteRequest) (map[string]interface{}, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue map[string]interface{} + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ActorTasksAPIService.ActorTaskDelete") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/actor-tasks/{actorTaskId}" + localVarPath = strings.Replace(localVarPath, "{"+"actorTaskId"+"}", url.PathEscape(parameterValueToString(r.actorTaskId, "actorTaskId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiActorTaskGetRequest struct { + ctx context.Context + ApiService *ActorTasksAPIService + actorTaskId string +} + +func (r ApiActorTaskGetRequest) Execute() (*ActorTaskGet200Response, *http.Response, error) { + return r.ApiService.ActorTaskGetExecute(r) +} + +/* +ActorTaskGet Get task + +Get an object that contains all the details about a task. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param actorTaskId Task ID or a tilde-separated owner's username and task's name. + @return ApiActorTaskGetRequest +*/ +func (a *ActorTasksAPIService) ActorTaskGet(ctx context.Context, actorTaskId string) ApiActorTaskGetRequest { + return ApiActorTaskGetRequest{ + ApiService: a, + ctx: ctx, + actorTaskId: actorTaskId, + } +} + +// Execute executes the request +// @return ActorTaskGet200Response +func (a *ActorTasksAPIService) ActorTaskGetExecute(r ApiActorTaskGetRequest) (*ActorTaskGet200Response, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ActorTaskGet200Response + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ActorTasksAPIService.ActorTaskGet") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/actor-tasks/{actorTaskId}" + localVarPath = strings.Replace(localVarPath, "{"+"actorTaskId"+"}", url.PathEscape(parameterValueToString(r.actorTaskId, "actorTaskId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiActorTaskInputGetRequest struct { + ctx context.Context + ApiService *ActorTasksAPIService + actorTaskId string +} + +func (r ApiActorTaskInputGetRequest) Execute() (map[string]interface{}, *http.Response, error) { + return r.ApiService.ActorTaskInputGetExecute(r) +} + +/* +ActorTaskInputGet Get task input + +Returns the input of a given task. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param actorTaskId Task ID or a tilde-separated owner's username and task's name. + @return ApiActorTaskInputGetRequest +*/ +func (a *ActorTasksAPIService) ActorTaskInputGet(ctx context.Context, actorTaskId string) ApiActorTaskInputGetRequest { + return ApiActorTaskInputGetRequest{ + ApiService: a, + ctx: ctx, + actorTaskId: actorTaskId, + } +} + +// Execute executes the request +// @return map[string]interface{} +func (a *ActorTasksAPIService) ActorTaskInputGetExecute(r ApiActorTaskInputGetRequest) (map[string]interface{}, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue map[string]interface{} + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ActorTasksAPIService.ActorTaskInputGet") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/actor-tasks/{actorTaskId}/input" + localVarPath = strings.Replace(localVarPath, "{"+"actorTaskId"+"}", url.PathEscape(parameterValueToString(r.actorTaskId, "actorTaskId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiActorTaskInputPutRequest struct { + ctx context.Context + ApiService *ActorTasksAPIService + actorTaskId string + body *map[string]interface{} +} + +// +func (r ApiActorTaskInputPutRequest) Body(body map[string]interface{}) ApiActorTaskInputPutRequest { + r.body = &body + return r +} + +func (r ApiActorTaskInputPutRequest) Execute() (map[string]interface{}, *http.Response, error) { + return r.ApiService.ActorTaskInputPutExecute(r) +} + +/* +ActorTaskInputPut Update task input + +Updates the input of a task using values specified by an object passed as +JSON in the PUT payload. + +If the object does not define a specific property, its value is not updated. + +The response is the full task input as returned by the +[Get task input](#/reference/tasks/task-input-object/get-task-input) endpoint. + +The request needs to specify the `Content-Type: application/json` HTTP +header! + +When providing your API authentication token, we recommend using the +request's `Authorization` header, rather than the URL. ([More +info](#/introduction/authentication)). + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param actorTaskId Task ID or a tilde-separated owner's username and task's name. + @return ApiActorTaskInputPutRequest +*/ +func (a *ActorTasksAPIService) ActorTaskInputPut(ctx context.Context, actorTaskId string) ApiActorTaskInputPutRequest { + return ApiActorTaskInputPutRequest{ + ApiService: a, + ctx: ctx, + actorTaskId: actorTaskId, + } +} + +// Execute executes the request +// @return map[string]interface{} +func (a *ActorTasksAPIService) ActorTaskInputPutExecute(r ApiActorTaskInputPutRequest) (map[string]interface{}, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue map[string]interface{} + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ActorTasksAPIService.ActorTaskInputPut") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/actor-tasks/{actorTaskId}/input" + localVarPath = strings.Replace(localVarPath, "{"+"actorTaskId"+"}", url.PathEscape(parameterValueToString(r.actorTaskId, "actorTaskId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.body == nil { + return localVarReturnValue, nil, reportError("body is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.body + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 413 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 415 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiActorTaskPutRequest struct { + ctx context.Context + ApiService *ActorTasksAPIService + actorTaskId string + updateTaskRequest *UpdateTaskRequest +} + +// +func (r ApiActorTaskPutRequest) UpdateTaskRequest(updateTaskRequest UpdateTaskRequest) ApiActorTaskPutRequest { + r.updateTaskRequest = &updateTaskRequest + return r +} + +func (r ApiActorTaskPutRequest) Execute() (*ActorTaskGet200Response, *http.Response, error) { + return r.ApiService.ActorTaskPutExecute(r) +} + +/* +ActorTaskPut Update task + +Update settings of a task using values specified by an object passed as JSON +in the POST payload. + +If the object does not define a specific property, its value is not updated. + +The response is the full task object as returned by the +[Get task](/api/v2/actor-task-get) endpoint. + +The request needs to specify the `Content-Type: application/json` HTTP +header! + +When providing your API authentication token, we recommend using the +request's `Authorization` header, rather than the URL. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param actorTaskId Task ID or a tilde-separated owner's username and task's name. + @return ApiActorTaskPutRequest +*/ +func (a *ActorTasksAPIService) ActorTaskPut(ctx context.Context, actorTaskId string) ApiActorTaskPutRequest { + return ApiActorTaskPutRequest{ + ApiService: a, + ctx: ctx, + actorTaskId: actorTaskId, + } +} + +// Execute executes the request +// @return ActorTaskGet200Response +func (a *ActorTasksAPIService) ActorTaskPutExecute(r ApiActorTaskPutRequest) (*ActorTaskGet200Response, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ActorTaskGet200Response + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ActorTasksAPIService.ActorTaskPut") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/actor-tasks/{actorTaskId}" + localVarPath = strings.Replace(localVarPath, "{"+"actorTaskId"+"}", url.PathEscape(parameterValueToString(r.actorTaskId, "actorTaskId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.updateTaskRequest == nil { + return localVarReturnValue, nil, reportError("updateTaskRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.updateTaskRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 413 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 415 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiActorTaskRunSyncGetRequest struct { + ctx context.Context + ApiService *ActorTasksAPIService + actorTaskId string + timeout *float64 + memory *float64 + maxItems *float64 + build *string + outputRecordKey *string + webhooks *string +} + +// Optional timeout for the run, in seconds. By default, the run uses the timeout from its configuration. +func (r ApiActorTaskRunSyncGetRequest) Timeout(timeout float64) ApiActorTaskRunSyncGetRequest { + r.timeout = &timeout + return r +} + +// Memory limit for the run, in megabytes. The amount of memory can be set to a power of 2 with a minimum of 128. By default, the run uses the memory limit from its configuration. +func (r ApiActorTaskRunSyncGetRequest) Memory(memory float64) ApiActorTaskRunSyncGetRequest { + r.memory = &memory + return r +} + +// Specifies the maximum number of dataset items that will be charged for pay-per-result Actors. This does NOT guarantee that the Actor will return only this many items. It only ensures you won't be charged for more than this number of items. Only works for pay-per-result Actors. Value can be accessed in the actor run using `ACTOR_MAX_PAID_DATASET_ITEMS` environment variable. +func (r ApiActorTaskRunSyncGetRequest) MaxItems(maxItems float64) ApiActorTaskRunSyncGetRequest { + r.maxItems = &maxItems + return r +} + +// Specifies the Actor build to run. It can be either a build tag or build number. By default, the run uses the build from its configuration (typically `latest`). +func (r ApiActorTaskRunSyncGetRequest) Build(build string) ApiActorTaskRunSyncGetRequest { + r.build = &build + return r +} + +// Key of the record from run's default key-value store to be returned in the response. By default, it is `OUTPUT`. +func (r ApiActorTaskRunSyncGetRequest) OutputRecordKey(outputRecordKey string) ApiActorTaskRunSyncGetRequest { + r.outputRecordKey = &outputRecordKey + return r +} + +// Specifies optional webhooks associated with the Actor run, which can be used to receive a notification e.g. when the Actor finished or failed. The value is a Base64-encoded JSON array whose items follow the WebhookRepresentation schema. For more information, see [Webhooks documentation](https://docs.apify.com/platform/integrations/webhooks). +func (r ApiActorTaskRunSyncGetRequest) Webhooks(webhooks string) ApiActorTaskRunSyncGetRequest { + r.webhooks = &webhooks + return r +} + +func (r ApiActorTaskRunSyncGetRequest) Execute() (map[string]interface{}, *http.Response, error) { + return r.ApiService.ActorTaskRunSyncGetExecute(r) +} + +/* +ActorTaskRunSyncGet Run task synchronously + +Run a specific task and return its output. + +The run must finish in 300<!-- MAX_ACTOR_JOB_SYNC_WAIT_SECS --> seconds +otherwise the HTTP request fails with a timeout error (this won't abort +the run itself). + +Beware that it might be impossible to maintain an idle HTTP connection for +an extended period, due to client timeout or network conditions. Make sure your HTTP client is +configured to have a long enough connection timeout. + +If the connection breaks, you will not receive any information about the run +and its status. + +To run the Task asynchronously, use the +[Run task asynchronously](#/reference/actor-tasks/run-collection/run-task) +endpoint instead. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param actorTaskId Task ID or a tilde-separated owner's username and task's name. + @return ApiActorTaskRunSyncGetRequest +*/ +func (a *ActorTasksAPIService) ActorTaskRunSyncGet(ctx context.Context, actorTaskId string) ApiActorTaskRunSyncGetRequest { + return ApiActorTaskRunSyncGetRequest{ + ApiService: a, + ctx: ctx, + actorTaskId: actorTaskId, + } +} + +// Execute executes the request +// @return map[string]interface{} +func (a *ActorTasksAPIService) ActorTaskRunSyncGetExecute(r ApiActorTaskRunSyncGetRequest) (map[string]interface{}, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue map[string]interface{} + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ActorTasksAPIService.ActorTaskRunSyncGet") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/actor-tasks/{actorTaskId}/run-sync" + localVarPath = strings.Replace(localVarPath, "{"+"actorTaskId"+"}", url.PathEscape(parameterValueToString(r.actorTaskId, "actorTaskId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.timeout != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "timeout", r.timeout, "form", "") + } + if r.memory != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "memory", r.memory, "form", "") + } + if r.maxItems != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "maxItems", r.maxItems, "form", "") + } + if r.build != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "build", r.build, "form", "") + } + if r.outputRecordKey != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "outputRecordKey", r.outputRecordKey, "form", "") + } + if r.webhooks != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "webhooks", r.webhooks, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 408 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiActorTaskRunSyncGetDatasetItemsGetRequest struct { + ctx context.Context + ApiService *ActorTasksAPIService + actorTaskId string + timeout *float64 + memory *float64 + maxItems *float64 + build *string + webhooks *string + format *string + clean *bool + offset *float64 + limit *float64 + fields *string + outputFields *string + omit *string + unwind *string + flatten *string + desc *bool + attachment *bool + delimiter *string + bom *bool + xmlRoot *string + xmlRow *string + skipHeaderRow *bool + skipHidden *bool + skipEmpty *bool + simplified *bool + view *string + skipFailedPages *bool + feedTitle *string + feedDescription *string +} + +// Optional timeout for the run, in seconds. By default, the run uses the timeout from its configuration. +func (r ApiActorTaskRunSyncGetDatasetItemsGetRequest) Timeout(timeout float64) ApiActorTaskRunSyncGetDatasetItemsGetRequest { + r.timeout = &timeout + return r +} + +// Memory limit for the run, in megabytes. The amount of memory can be set to a power of 2 with a minimum of 128. By default, the run uses the memory limit from its configuration. +func (r ApiActorTaskRunSyncGetDatasetItemsGetRequest) Memory(memory float64) ApiActorTaskRunSyncGetDatasetItemsGetRequest { + r.memory = &memory + return r +} + +// Specifies the maximum number of dataset items that will be charged for pay-per-result Actors. This does NOT guarantee that the Actor will return only this many items. It only ensures you won't be charged for more than this number of items. Only works for pay-per-result Actors. Value can be accessed in the actor run using `ACTOR_MAX_PAID_DATASET_ITEMS` environment variable. +func (r ApiActorTaskRunSyncGetDatasetItemsGetRequest) MaxItems(maxItems float64) ApiActorTaskRunSyncGetDatasetItemsGetRequest { + r.maxItems = &maxItems + return r +} + +// Specifies the Actor build to run. It can be either a build tag or build number. By default, the run uses the build from its configuration (typically `latest`). +func (r ApiActorTaskRunSyncGetDatasetItemsGetRequest) Build(build string) ApiActorTaskRunSyncGetDatasetItemsGetRequest { + r.build = &build + return r +} + +// Specifies optional webhooks associated with the Actor run, which can be used to receive a notification e.g. when the Actor finished or failed. The value is a Base64-encoded JSON array whose items follow the WebhookRepresentation schema. For more information, see [Webhooks documentation](https://docs.apify.com/platform/integrations/webhooks). +func (r ApiActorTaskRunSyncGetDatasetItemsGetRequest) Webhooks(webhooks string) ApiActorTaskRunSyncGetDatasetItemsGetRequest { + r.webhooks = &webhooks + return r +} + +// Format of the results, possible values are: `json`, `jsonl`, `csv`, `html`, `xlsx`, `xml` and `rss`. The default value is `json`. +func (r ApiActorTaskRunSyncGetDatasetItemsGetRequest) Format(format string) ApiActorTaskRunSyncGetDatasetItemsGetRequest { + r.format = &format + return r +} + +// If `true` or `1` then the API endpoint returns only non-empty items and skips hidden fields (i.e. fields starting with the # character). The `clean` parameter is just a shortcut for `skipHidden=true` and `skipEmpty=true` parameters. Note that since some objects might be skipped from the output, that the result might contain less items than the `limit` value. +func (r ApiActorTaskRunSyncGetDatasetItemsGetRequest) Clean(clean bool) ApiActorTaskRunSyncGetDatasetItemsGetRequest { + r.clean = &clean + return r +} + +// Number of items that should be skipped at the start. The default value is `0`. +func (r ApiActorTaskRunSyncGetDatasetItemsGetRequest) Offset(offset float64) ApiActorTaskRunSyncGetDatasetItemsGetRequest { + r.offset = &offset + return r +} + +// Maximum number of items to return. By default there is no limit. +func (r ApiActorTaskRunSyncGetDatasetItemsGetRequest) Limit(limit float64) ApiActorTaskRunSyncGetDatasetItemsGetRequest { + r.limit = &limit + return r +} + +// A comma-separated list of fields which should be picked from the items, only these fields will remain in the resulting record objects. Note that the fields in the outputted items are sorted the same way as they are specified in the `fields` query parameter. You can use this feature to effectively fix the output format. +func (r ApiActorTaskRunSyncGetDatasetItemsGetRequest) Fields(fields string) ApiActorTaskRunSyncGetDatasetItemsGetRequest { + r.fields = &fields + return r +} + +// A comma-separated list of output field names that positionally rename the fields specified in the `fields` parameter. For example, `?fields=headline,url&outputFields=title,link` renames `headline` to `title` and `url` to `link` in the output. The number of names in `outputFields` must match the number of names in `fields`. Requires the `fields` parameter to be specified as well. +func (r ApiActorTaskRunSyncGetDatasetItemsGetRequest) OutputFields(outputFields string) ApiActorTaskRunSyncGetDatasetItemsGetRequest { + r.outputFields = &outputFields + return r +} + +// A comma-separated list of fields which should be omitted from the items. +func (r ApiActorTaskRunSyncGetDatasetItemsGetRequest) Omit(omit string) ApiActorTaskRunSyncGetDatasetItemsGetRequest { + r.omit = &omit + return r +} + +// A comma-separated list of fields which should be unwound, in order which they should be processed. Each field should be either an array or an object. If the field is an array then every element of the array will become a separate record and merged with parent object. If the unwound field is an object then it is merged with the parent object. If the unwound field is missing or its value is neither an array nor an object and therefore cannot be merged with a parent object then the item gets preserved as it is. Note that the unwound items ignore the `desc` parameter. +func (r ApiActorTaskRunSyncGetDatasetItemsGetRequest) Unwind(unwind string) ApiActorTaskRunSyncGetDatasetItemsGetRequest { + r.unwind = &unwind + return r +} + +// A comma-separated list of fields which should transform nested objects into flat structures. For example, with `flatten=\"foo\"` the object `{\"foo\":{\"bar\": \"hello\"}}` is turned into `{\"foo.bar\": \"hello\"}`. The original object with properties is replaced with the flattened object. +func (r ApiActorTaskRunSyncGetDatasetItemsGetRequest) Flatten(flatten string) ApiActorTaskRunSyncGetDatasetItemsGetRequest { + r.flatten = &flatten + return r +} + +// By default, results are returned in the same order as they were stored. To reverse the order, set this parameter to `true` or `1`. +func (r ApiActorTaskRunSyncGetDatasetItemsGetRequest) Desc(desc bool) ApiActorTaskRunSyncGetDatasetItemsGetRequest { + r.desc = &desc + return r +} + +// If `true` or `1` then the response will define the `Content-Disposition: attachment` header, forcing a web browser to download the file rather than to display it. By default this header is not present. +func (r ApiActorTaskRunSyncGetDatasetItemsGetRequest) Attachment(attachment bool) ApiActorTaskRunSyncGetDatasetItemsGetRequest { + r.attachment = &attachment + return r +} + +// A delimiter character for CSV files, only used if `format=csv`. You might need to URL-encode the character (e.g. use `%09` for tab or `%3B` for semicolon). The default delimiter is a simple comma (`,`). +func (r ApiActorTaskRunSyncGetDatasetItemsGetRequest) Delimiter(delimiter string) ApiActorTaskRunSyncGetDatasetItemsGetRequest { + r.delimiter = &delimiter + return r +} + +// All text responses are encoded in UTF-8 encoding. By default, the `format=csv` files are prefixed with the UTF-8 Byte Order Mark (BOM), while `json`, `jsonl`, `xml`, `html` and `rss` files are not. If you want to override this default behavior, specify `bom=1` query parameter to include the BOM or `bom=0` to skip it. +func (r ApiActorTaskRunSyncGetDatasetItemsGetRequest) Bom(bom bool) ApiActorTaskRunSyncGetDatasetItemsGetRequest { + r.bom = &bom + return r +} + +// Overrides default root element name of `xml` output. By default the root element is `items`. +func (r ApiActorTaskRunSyncGetDatasetItemsGetRequest) XmlRoot(xmlRoot string) ApiActorTaskRunSyncGetDatasetItemsGetRequest { + r.xmlRoot = &xmlRoot + return r +} + +// Overrides default element name that wraps each page or page function result object in `xml` output. By default the element name is `item`. +func (r ApiActorTaskRunSyncGetDatasetItemsGetRequest) XmlRow(xmlRow string) ApiActorTaskRunSyncGetDatasetItemsGetRequest { + r.xmlRow = &xmlRow + return r +} + +// If `true` or `1` then header row in the `csv` format is skipped. +func (r ApiActorTaskRunSyncGetDatasetItemsGetRequest) SkipHeaderRow(skipHeaderRow bool) ApiActorTaskRunSyncGetDatasetItemsGetRequest { + r.skipHeaderRow = &skipHeaderRow + return r +} + +// If `true` or `1` then hidden fields are skipped from the output, i.e. fields starting with the `#` character. +func (r ApiActorTaskRunSyncGetDatasetItemsGetRequest) SkipHidden(skipHidden bool) ApiActorTaskRunSyncGetDatasetItemsGetRequest { + r.skipHidden = &skipHidden + return r +} + +// If `true` or `1` then empty items are skipped from the output. Note that if used, the results might contain less items than the limit value. +func (r ApiActorTaskRunSyncGetDatasetItemsGetRequest) SkipEmpty(skipEmpty bool) ApiActorTaskRunSyncGetDatasetItemsGetRequest { + r.skipEmpty = &skipEmpty + return r +} + +// If `true` or `1` then, the endpoint applies the `fields=url,pageFunctionResult,errorInfo` and `unwind=pageFunctionResult` query parameters. This feature is used to emulate simplified results provided by the legacy Apify Crawler product and it's not recommended to use it in new integrations. +func (r ApiActorTaskRunSyncGetDatasetItemsGetRequest) Simplified(simplified bool) ApiActorTaskRunSyncGetDatasetItemsGetRequest { + r.simplified = &simplified + return r +} + +// Defines the view configuration for dataset items based on the schema definition. This parameter determines how the data will be filtered and presented. For complete specification details, see the [dataset schema documentation](/platform/actors/development/actor-definition/dataset-schema). +func (r ApiActorTaskRunSyncGetDatasetItemsGetRequest) View(view string) ApiActorTaskRunSyncGetDatasetItemsGetRequest { + r.view = &view + return r +} + +// If `true` or `1` then, the all the items with errorInfo property will be skipped from the output. This feature is here to emulate functionality of API version 1 used for the legacy Apify Crawler product and it's not recommended to use it in new integrations. +func (r ApiActorTaskRunSyncGetDatasetItemsGetRequest) SkipFailedPages(skipFailedPages bool) ApiActorTaskRunSyncGetDatasetItemsGetRequest { + r.skipFailedPages = &skipFailedPages + return r +} + +// Overrides the auto-generated RSS channel `<title>` element. Only used when `format=rss`. If not provided, the title defaults to `Dataset <label>`. +func (r ApiActorTaskRunSyncGetDatasetItemsGetRequest) FeedTitle(feedTitle string) ApiActorTaskRunSyncGetDatasetItemsGetRequest { + r.feedTitle = &feedTitle + return r +} + +// Overrides the auto-generated RSS channel `<description>` element. Only used when `format=rss`. If not provided, the description defaults to `Items in dataset with id \"<datasetId>\".` +func (r ApiActorTaskRunSyncGetDatasetItemsGetRequest) FeedDescription(feedDescription string) ApiActorTaskRunSyncGetDatasetItemsGetRequest { + r.feedDescription = &feedDescription + return r +} + +func (r ApiActorTaskRunSyncGetDatasetItemsGetRequest) Execute() (map[string]interface{}, *http.Response, error) { + return r.ApiService.ActorTaskRunSyncGetDatasetItemsGetExecute(r) +} + +/* +ActorTaskRunSyncGetDatasetItemsGet Run task synchronously and get dataset items + +Run a specific task and return its dataset items. + +The run must finish in 300<!-- MAX_ACTOR_JOB_SYNC_WAIT_SECS --> seconds +otherwise the HTTP request fails with a timeout error (this won't abort +the run itself). + +You can send all the same options in parameters as the [Get Dataset +Items](#/reference/datasets/item-collection/get-items) API endpoint. + +Beware that it might be impossible to maintain an idle HTTP connection for +an extended period, due to client timeout or network conditions. Make sure your HTTP client is +configured to have a long enough connection timeout. + +If the connection breaks, you will not receive any information about the run +and its status. + +To run the Task asynchronously, use the [Run task +asynchronously](#/reference/actor-tasks/run-collection/run-task) endpoint +instead. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param actorTaskId Task ID or a tilde-separated owner's username and task's name. + @return ApiActorTaskRunSyncGetDatasetItemsGetRequest +*/ +func (a *ActorTasksAPIService) ActorTaskRunSyncGetDatasetItemsGet(ctx context.Context, actorTaskId string) ApiActorTaskRunSyncGetDatasetItemsGetRequest { + return ApiActorTaskRunSyncGetDatasetItemsGetRequest{ + ApiService: a, + ctx: ctx, + actorTaskId: actorTaskId, + } +} + +// Execute executes the request +// @return map[string]interface{} +func (a *ActorTasksAPIService) ActorTaskRunSyncGetDatasetItemsGetExecute(r ApiActorTaskRunSyncGetDatasetItemsGetRequest) (map[string]interface{}, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue map[string]interface{} + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ActorTasksAPIService.ActorTaskRunSyncGetDatasetItemsGet") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/actor-tasks/{actorTaskId}/run-sync-get-dataset-items" + localVarPath = strings.Replace(localVarPath, "{"+"actorTaskId"+"}", url.PathEscape(parameterValueToString(r.actorTaskId, "actorTaskId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.timeout != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "timeout", r.timeout, "form", "") + } + if r.memory != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "memory", r.memory, "form", "") + } + if r.maxItems != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "maxItems", r.maxItems, "form", "") + } + if r.build != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "build", r.build, "form", "") + } + if r.webhooks != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "webhooks", r.webhooks, "form", "") + } + if r.format != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "format", r.format, "form", "") + } + if r.clean != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "clean", r.clean, "form", "") + } + if r.offset != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "form", "") + } + if r.limit != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "form", "") + } + if r.fields != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "fields", r.fields, "form", "") + } + if r.outputFields != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "outputFields", r.outputFields, "form", "") + } + if r.omit != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "omit", r.omit, "form", "") + } + if r.unwind != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "unwind", r.unwind, "form", "") + } + if r.flatten != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "flatten", r.flatten, "form", "") + } + if r.desc != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "desc", r.desc, "form", "") + } + if r.attachment != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "attachment", r.attachment, "form", "") + } + if r.delimiter != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "delimiter", r.delimiter, "form", "") + } + if r.bom != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "bom", r.bom, "form", "") + } + if r.xmlRoot != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "xmlRoot", r.xmlRoot, "form", "") + } + if r.xmlRow != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "xmlRow", r.xmlRow, "form", "") + } + if r.skipHeaderRow != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "skipHeaderRow", r.skipHeaderRow, "form", "") + } + if r.skipHidden != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "skipHidden", r.skipHidden, "form", "") + } + if r.skipEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "skipEmpty", r.skipEmpty, "form", "") + } + if r.simplified != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "simplified", r.simplified, "form", "") + } + if r.view != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "view", r.view, "form", "") + } + if r.skipFailedPages != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "skipFailedPages", r.skipFailedPages, "form", "") + } + if r.feedTitle != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "feedTitle", r.feedTitle, "form", "") + } + if r.feedDescription != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "feedDescription", r.feedDescription, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 408 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiActorTaskRunSyncGetDatasetItemsPostRequest struct { + ctx context.Context + ApiService *ActorTasksAPIService + actorTaskId string + body *map[string]interface{} + timeout *float64 + memory *float64 + maxItems *float64 + maxTotalChargeUsd *float64 + restartOnError *bool + build *string + webhooks *string + format *string + clean *bool + offset *float64 + limit *float64 + fields *string + outputFields *string + omit *string + unwind *string + flatten *string + desc *bool + attachment *bool + delimiter *string + bom *bool + xmlRoot *string + xmlRow *string + skipHeaderRow *bool + skipHidden *bool + skipEmpty *bool + simplified *bool + view *string + skipFailedPages *bool + feedTitle *string + feedDescription *string +} + +// +func (r ApiActorTaskRunSyncGetDatasetItemsPostRequest) Body(body map[string]interface{}) ApiActorTaskRunSyncGetDatasetItemsPostRequest { + r.body = &body + return r +} + +// Optional timeout for the run, in seconds. By default, the run uses the timeout from its configuration. +func (r ApiActorTaskRunSyncGetDatasetItemsPostRequest) Timeout(timeout float64) ApiActorTaskRunSyncGetDatasetItemsPostRequest { + r.timeout = &timeout + return r +} + +// Memory limit for the run, in megabytes. The amount of memory can be set to a power of 2 with a minimum of 128. By default, the run uses the memory limit from its configuration. +func (r ApiActorTaskRunSyncGetDatasetItemsPostRequest) Memory(memory float64) ApiActorTaskRunSyncGetDatasetItemsPostRequest { + r.memory = &memory + return r +} + +// Specifies the maximum number of dataset items that will be charged for pay-per-result Actors. This does NOT guarantee that the Actor will return only this many items. It only ensures you won't be charged for more than this number of items. Only works for pay-per-result Actors. Value can be accessed in the actor run using `ACTOR_MAX_PAID_DATASET_ITEMS` environment variable. +func (r ApiActorTaskRunSyncGetDatasetItemsPostRequest) MaxItems(maxItems float64) ApiActorTaskRunSyncGetDatasetItemsPostRequest { + r.maxItems = &maxItems + return r +} + +// Specifies the maximum cost of the run. This parameter is useful for pay-per-event Actors, as it allows you to limit the amount charged to your subscription. You can access the maximum cost in your Actor by using the `ACTOR_MAX_TOTAL_CHARGE_USD` environment variable. +func (r ApiActorTaskRunSyncGetDatasetItemsPostRequest) MaxTotalChargeUsd(maxTotalChargeUsd float64) ApiActorTaskRunSyncGetDatasetItemsPostRequest { + r.maxTotalChargeUsd = &maxTotalChargeUsd + return r +} + +// Determines whether the run will be restarted if it fails. +func (r ApiActorTaskRunSyncGetDatasetItemsPostRequest) RestartOnError(restartOnError bool) ApiActorTaskRunSyncGetDatasetItemsPostRequest { + r.restartOnError = &restartOnError + return r +} + +// Specifies the Actor build to run. It can be either a build tag or build number. By default, the run uses the build from its configuration (typically `latest`). +func (r ApiActorTaskRunSyncGetDatasetItemsPostRequest) Build(build string) ApiActorTaskRunSyncGetDatasetItemsPostRequest { + r.build = &build + return r +} + +// Specifies optional webhooks associated with the Actor run, which can be used to receive a notification e.g. when the Actor finished or failed. The value is a Base64-encoded JSON array whose items follow the WebhookRepresentation schema. For more information, see [Webhooks documentation](https://docs.apify.com/platform/integrations/webhooks). +func (r ApiActorTaskRunSyncGetDatasetItemsPostRequest) Webhooks(webhooks string) ApiActorTaskRunSyncGetDatasetItemsPostRequest { + r.webhooks = &webhooks + return r +} + +// Format of the results, possible values are: `json`, `jsonl`, `csv`, `html`, `xlsx`, `xml` and `rss`. The default value is `json`. +func (r ApiActorTaskRunSyncGetDatasetItemsPostRequest) Format(format string) ApiActorTaskRunSyncGetDatasetItemsPostRequest { + r.format = &format + return r +} + +// If `true` or `1` then the API endpoint returns only non-empty items and skips hidden fields (i.e. fields starting with the # character). The `clean` parameter is just a shortcut for `skipHidden=true` and `skipEmpty=true` parameters. Note that since some objects might be skipped from the output, that the result might contain less items than the `limit` value. +func (r ApiActorTaskRunSyncGetDatasetItemsPostRequest) Clean(clean bool) ApiActorTaskRunSyncGetDatasetItemsPostRequest { + r.clean = &clean + return r +} + +// Number of items that should be skipped at the start. The default value is `0`. +func (r ApiActorTaskRunSyncGetDatasetItemsPostRequest) Offset(offset float64) ApiActorTaskRunSyncGetDatasetItemsPostRequest { + r.offset = &offset + return r +} + +// Maximum number of items to return. By default there is no limit. +func (r ApiActorTaskRunSyncGetDatasetItemsPostRequest) Limit(limit float64) ApiActorTaskRunSyncGetDatasetItemsPostRequest { + r.limit = &limit + return r +} + +// A comma-separated list of fields which should be picked from the items, only these fields will remain in the resulting record objects. Note that the fields in the outputted items are sorted the same way as they are specified in the `fields` query parameter. You can use this feature to effectively fix the output format. +func (r ApiActorTaskRunSyncGetDatasetItemsPostRequest) Fields(fields string) ApiActorTaskRunSyncGetDatasetItemsPostRequest { + r.fields = &fields + return r +} + +// A comma-separated list of output field names that positionally rename the fields specified in the `fields` parameter. For example, `?fields=headline,url&outputFields=title,link` renames `headline` to `title` and `url` to `link` in the output. The number of names in `outputFields` must match the number of names in `fields`. Requires the `fields` parameter to be specified as well. +func (r ApiActorTaskRunSyncGetDatasetItemsPostRequest) OutputFields(outputFields string) ApiActorTaskRunSyncGetDatasetItemsPostRequest { + r.outputFields = &outputFields + return r +} + +// A comma-separated list of fields which should be omitted from the items. +func (r ApiActorTaskRunSyncGetDatasetItemsPostRequest) Omit(omit string) ApiActorTaskRunSyncGetDatasetItemsPostRequest { + r.omit = &omit + return r +} + +// A comma-separated list of fields which should be unwound, in order which they should be processed. Each field should be either an array or an object. If the field is an array then every element of the array will become a separate record and merged with parent object. If the unwound field is an object then it is merged with the parent object. If the unwound field is missing or its value is neither an array nor an object and therefore cannot be merged with a parent object then the item gets preserved as it is. Note that the unwound items ignore the `desc` parameter. +func (r ApiActorTaskRunSyncGetDatasetItemsPostRequest) Unwind(unwind string) ApiActorTaskRunSyncGetDatasetItemsPostRequest { + r.unwind = &unwind + return r +} + +// A comma-separated list of fields which should transform nested objects into flat structures. For example, with `flatten=\"foo\"` the object `{\"foo\":{\"bar\": \"hello\"}}` is turned into `{\"foo.bar\": \"hello\"}`. The original object with properties is replaced with the flattened object. +func (r ApiActorTaskRunSyncGetDatasetItemsPostRequest) Flatten(flatten string) ApiActorTaskRunSyncGetDatasetItemsPostRequest { + r.flatten = &flatten + return r +} + +// By default, results are returned in the same order as they were stored. To reverse the order, set this parameter to `true` or `1`. +func (r ApiActorTaskRunSyncGetDatasetItemsPostRequest) Desc(desc bool) ApiActorTaskRunSyncGetDatasetItemsPostRequest { + r.desc = &desc + return r +} + +// If `true` or `1` then the response will define the `Content-Disposition: attachment` header, forcing a web browser to download the file rather than to display it. By default this header is not present. +func (r ApiActorTaskRunSyncGetDatasetItemsPostRequest) Attachment(attachment bool) ApiActorTaskRunSyncGetDatasetItemsPostRequest { + r.attachment = &attachment + return r +} + +// A delimiter character for CSV files, only used if `format=csv`. You might need to URL-encode the character (e.g. use `%09` for tab or `%3B` for semicolon). The default delimiter is a simple comma (`,`). +func (r ApiActorTaskRunSyncGetDatasetItemsPostRequest) Delimiter(delimiter string) ApiActorTaskRunSyncGetDatasetItemsPostRequest { + r.delimiter = &delimiter + return r +} + +// All text responses are encoded in UTF-8 encoding. By default, the `format=csv` files are prefixed with the UTF-8 Byte Order Mark (BOM), while `json`, `jsonl`, `xml`, `html` and `rss` files are not. If you want to override this default behavior, specify `bom=1` query parameter to include the BOM or `bom=0` to skip it. +func (r ApiActorTaskRunSyncGetDatasetItemsPostRequest) Bom(bom bool) ApiActorTaskRunSyncGetDatasetItemsPostRequest { + r.bom = &bom + return r +} + +// Overrides default root element name of `xml` output. By default the root element is `items`. +func (r ApiActorTaskRunSyncGetDatasetItemsPostRequest) XmlRoot(xmlRoot string) ApiActorTaskRunSyncGetDatasetItemsPostRequest { + r.xmlRoot = &xmlRoot + return r +} + +// Overrides default element name that wraps each page or page function result object in `xml` output. By default the element name is `item`. +func (r ApiActorTaskRunSyncGetDatasetItemsPostRequest) XmlRow(xmlRow string) ApiActorTaskRunSyncGetDatasetItemsPostRequest { + r.xmlRow = &xmlRow + return r +} + +// If `true` or `1` then header row in the `csv` format is skipped. +func (r ApiActorTaskRunSyncGetDatasetItemsPostRequest) SkipHeaderRow(skipHeaderRow bool) ApiActorTaskRunSyncGetDatasetItemsPostRequest { + r.skipHeaderRow = &skipHeaderRow + return r +} + +// If `true` or `1` then hidden fields are skipped from the output, i.e. fields starting with the `#` character. +func (r ApiActorTaskRunSyncGetDatasetItemsPostRequest) SkipHidden(skipHidden bool) ApiActorTaskRunSyncGetDatasetItemsPostRequest { + r.skipHidden = &skipHidden + return r +} + +// If `true` or `1` then empty items are skipped from the output. Note that if used, the results might contain less items than the limit value. +func (r ApiActorTaskRunSyncGetDatasetItemsPostRequest) SkipEmpty(skipEmpty bool) ApiActorTaskRunSyncGetDatasetItemsPostRequest { + r.skipEmpty = &skipEmpty + return r +} + +// If `true` or `1` then, the endpoint applies the `fields=url,pageFunctionResult,errorInfo` and `unwind=pageFunctionResult` query parameters. This feature is used to emulate simplified results provided by the legacy Apify Crawler product and it's not recommended to use it in new integrations. +func (r ApiActorTaskRunSyncGetDatasetItemsPostRequest) Simplified(simplified bool) ApiActorTaskRunSyncGetDatasetItemsPostRequest { + r.simplified = &simplified + return r +} + +// Defines the view configuration for dataset items based on the schema definition. This parameter determines how the data will be filtered and presented. For complete specification details, see the [dataset schema documentation](/platform/actors/development/actor-definition/dataset-schema). +func (r ApiActorTaskRunSyncGetDatasetItemsPostRequest) View(view string) ApiActorTaskRunSyncGetDatasetItemsPostRequest { + r.view = &view + return r +} + +// If `true` or `1` then, the all the items with errorInfo property will be skipped from the output. This feature is here to emulate functionality of API version 1 used for the legacy Apify Crawler product and it's not recommended to use it in new integrations. +func (r ApiActorTaskRunSyncGetDatasetItemsPostRequest) SkipFailedPages(skipFailedPages bool) ApiActorTaskRunSyncGetDatasetItemsPostRequest { + r.skipFailedPages = &skipFailedPages + return r +} + +// Overrides the auto-generated RSS channel `<title>` element. Only used when `format=rss`. If not provided, the title defaults to `Dataset <label>`. +func (r ApiActorTaskRunSyncGetDatasetItemsPostRequest) FeedTitle(feedTitle string) ApiActorTaskRunSyncGetDatasetItemsPostRequest { + r.feedTitle = &feedTitle + return r +} + +// Overrides the auto-generated RSS channel `<description>` element. Only used when `format=rss`. If not provided, the description defaults to `Items in dataset with id \"<datasetId>\".` +func (r ApiActorTaskRunSyncGetDatasetItemsPostRequest) FeedDescription(feedDescription string) ApiActorTaskRunSyncGetDatasetItemsPostRequest { + r.feedDescription = &feedDescription + return r +} + +func (r ApiActorTaskRunSyncGetDatasetItemsPostRequest) Execute() (map[string]interface{}, *http.Response, error) { + return r.ApiService.ActorTaskRunSyncGetDatasetItemsPostExecute(r) +} + +/* +ActorTaskRunSyncGetDatasetItemsPost Run task synchronously and get dataset items + +Runs an Actor task and synchronously returns its dataset items. + +The run must finish in 300<!-- MAX_ACTOR_JOB_SYNC_WAIT_SECS --> seconds +otherwise the HTTP request fails with a timeout error (this won't abort +the run itself). + +Optionally, you can override the Actor input configuration by passing a JSON +object as the POST payload and setting the `Content-Type: application/json` HTTP header. + +Note that if the object in the POST payload does not define a particular +input property, the Actor run uses the default value defined by the task (or the Actor's +input schema if not defined by the task). + +You can send all the same options in parameters as the [Get Dataset +Items](#/reference/datasets/item-collection/get-items) API endpoint. + +Beware that it might be impossible to maintain an idle HTTP connection for +an extended period, due to client timeout or network conditions. Make sure your HTTP client is +configured to have a long enough connection timeout. + +If the connection breaks, you will not receive any information about the run +and its status. + +Input fields from Actor task configuration can be overloaded with values +passed as the POST payload. + +Just make sure to specify the `Content-Type` header as `application/json` +and that the input is an object. + +To run the task asynchronously, use the [Run +task](#/reference/actor-tasks/run-collection/run-task) API endpoint instead. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param actorTaskId Task ID or a tilde-separated owner's username and task's name. + @return ApiActorTaskRunSyncGetDatasetItemsPostRequest +*/ +func (a *ActorTasksAPIService) ActorTaskRunSyncGetDatasetItemsPost(ctx context.Context, actorTaskId string) ApiActorTaskRunSyncGetDatasetItemsPostRequest { + return ApiActorTaskRunSyncGetDatasetItemsPostRequest{ + ApiService: a, + ctx: ctx, + actorTaskId: actorTaskId, + } +} + +// Execute executes the request +// @return map[string]interface{} +func (a *ActorTasksAPIService) ActorTaskRunSyncGetDatasetItemsPostExecute(r ApiActorTaskRunSyncGetDatasetItemsPostRequest) (map[string]interface{}, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue map[string]interface{} + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ActorTasksAPIService.ActorTaskRunSyncGetDatasetItemsPost") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/actor-tasks/{actorTaskId}/run-sync-get-dataset-items" + localVarPath = strings.Replace(localVarPath, "{"+"actorTaskId"+"}", url.PathEscape(parameterValueToString(r.actorTaskId, "actorTaskId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.body == nil { + return localVarReturnValue, nil, reportError("body is required and must be specified") + } + + if r.timeout != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "timeout", r.timeout, "form", "") + } + if r.memory != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "memory", r.memory, "form", "") + } + if r.maxItems != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "maxItems", r.maxItems, "form", "") + } + if r.maxTotalChargeUsd != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "maxTotalChargeUsd", r.maxTotalChargeUsd, "form", "") + } + if r.restartOnError != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "restartOnError", r.restartOnError, "form", "") + } + if r.build != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "build", r.build, "form", "") + } + if r.webhooks != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "webhooks", r.webhooks, "form", "") + } + if r.format != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "format", r.format, "form", "") + } + if r.clean != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "clean", r.clean, "form", "") + } + if r.offset != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "form", "") + } + if r.limit != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "form", "") + } + if r.fields != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "fields", r.fields, "form", "") + } + if r.outputFields != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "outputFields", r.outputFields, "form", "") + } + if r.omit != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "omit", r.omit, "form", "") + } + if r.unwind != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "unwind", r.unwind, "form", "") + } + if r.flatten != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "flatten", r.flatten, "form", "") + } + if r.desc != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "desc", r.desc, "form", "") + } + if r.attachment != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "attachment", r.attachment, "form", "") + } + if r.delimiter != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "delimiter", r.delimiter, "form", "") + } + if r.bom != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "bom", r.bom, "form", "") + } + if r.xmlRoot != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "xmlRoot", r.xmlRoot, "form", "") + } + if r.xmlRow != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "xmlRow", r.xmlRow, "form", "") + } + if r.skipHeaderRow != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "skipHeaderRow", r.skipHeaderRow, "form", "") + } + if r.skipHidden != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "skipHidden", r.skipHidden, "form", "") + } + if r.skipEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "skipEmpty", r.skipEmpty, "form", "") + } + if r.simplified != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "simplified", r.simplified, "form", "") + } + if r.view != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "view", r.view, "form", "") + } + if r.skipFailedPages != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "skipFailedPages", r.skipFailedPages, "form", "") + } + if r.feedTitle != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "feedTitle", r.feedTitle, "form", "") + } + if r.feedDescription != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "feedDescription", r.feedDescription, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.body + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 413 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 415 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiActorTaskRunSyncPostRequest struct { + ctx context.Context + ApiService *ActorTasksAPIService + actorTaskId string + body *map[string]interface{} + timeout *float64 + memory *float64 + maxItems *float64 + maxTotalChargeUsd *float64 + restartOnError *bool + build *string + outputRecordKey *string + webhooks *string +} + +// +func (r ApiActorTaskRunSyncPostRequest) Body(body map[string]interface{}) ApiActorTaskRunSyncPostRequest { + r.body = &body + return r +} + +// Optional timeout for the run, in seconds. By default, the run uses the timeout from its configuration. +func (r ApiActorTaskRunSyncPostRequest) Timeout(timeout float64) ApiActorTaskRunSyncPostRequest { + r.timeout = &timeout + return r +} + +// Memory limit for the run, in megabytes. The amount of memory can be set to a power of 2 with a minimum of 128. By default, the run uses the memory limit from its configuration. +func (r ApiActorTaskRunSyncPostRequest) Memory(memory float64) ApiActorTaskRunSyncPostRequest { + r.memory = &memory + return r +} + +// Specifies the maximum number of dataset items that will be charged for pay-per-result Actors. This does NOT guarantee that the Actor will return only this many items. It only ensures you won't be charged for more than this number of items. Only works for pay-per-result Actors. Value can be accessed in the actor run using `ACTOR_MAX_PAID_DATASET_ITEMS` environment variable. +func (r ApiActorTaskRunSyncPostRequest) MaxItems(maxItems float64) ApiActorTaskRunSyncPostRequest { + r.maxItems = &maxItems + return r +} + +// Specifies the maximum cost of the run. This parameter is useful for pay-per-event Actors, as it allows you to limit the amount charged to your subscription. You can access the maximum cost in your Actor by using the `ACTOR_MAX_TOTAL_CHARGE_USD` environment variable. +func (r ApiActorTaskRunSyncPostRequest) MaxTotalChargeUsd(maxTotalChargeUsd float64) ApiActorTaskRunSyncPostRequest { + r.maxTotalChargeUsd = &maxTotalChargeUsd + return r +} + +// Determines whether the run will be restarted if it fails. +func (r ApiActorTaskRunSyncPostRequest) RestartOnError(restartOnError bool) ApiActorTaskRunSyncPostRequest { + r.restartOnError = &restartOnError + return r +} + +// Specifies the Actor build to run. It can be either a build tag or build number. By default, the run uses the build from its configuration (typically `latest`). +func (r ApiActorTaskRunSyncPostRequest) Build(build string) ApiActorTaskRunSyncPostRequest { + r.build = &build + return r +} + +// Key of the record from run's default key-value store to be returned in the response. By default, it is `OUTPUT`. +func (r ApiActorTaskRunSyncPostRequest) OutputRecordKey(outputRecordKey string) ApiActorTaskRunSyncPostRequest { + r.outputRecordKey = &outputRecordKey + return r +} + +// Specifies optional webhooks associated with the Actor run, which can be used to receive a notification e.g. when the Actor finished or failed. The value is a Base64-encoded JSON array whose items follow the WebhookRepresentation schema. For more information, see [Webhooks documentation](https://docs.apify.com/platform/integrations/webhooks). +func (r ApiActorTaskRunSyncPostRequest) Webhooks(webhooks string) ApiActorTaskRunSyncPostRequest { + r.webhooks = &webhooks + return r +} + +func (r ApiActorTaskRunSyncPostRequest) Execute() (map[string]interface{}, *http.Response, error) { + return r.ApiService.ActorTaskRunSyncPostExecute(r) +} + +/* +ActorTaskRunSyncPost Run task synchronously + +Runs an Actor task and synchronously returns its output. + +The run must finish in 300<!-- MAX_ACTOR_JOB_SYNC_WAIT_SECS --> seconds +otherwise the HTTP request fails with a timeout error (this won't abort +the run itself). + +Optionally, you can override the Actor input configuration by passing a JSON +object as the POST payload and setting the `Content-Type: application/json` HTTP header. + +Note that if the object in the POST payload does not define a particular +input property, the Actor run uses the default value defined by the task (or Actor's input +schema if not defined by the task). + +Beware that it might be impossible to maintain an idle HTTP connection for +an extended period, due to client timeout or network conditions. Make sure your HTTP client is +configured to have a long enough connection timeout. + +If the connection breaks, you will not receive any information about the run +and its status. + +Input fields from Actor task configuration can be overloaded with values +passed as the POST payload. + +Just make sure to specify `Content-Type` header to be `application/json` and +input to be an object. + +To run the task asynchronously, use the [Run +task](#/reference/actor-tasks/run-collection/run-task) API endpoint instead. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param actorTaskId Task ID or a tilde-separated owner's username and task's name. + @return ApiActorTaskRunSyncPostRequest +*/ +func (a *ActorTasksAPIService) ActorTaskRunSyncPost(ctx context.Context, actorTaskId string) ApiActorTaskRunSyncPostRequest { + return ApiActorTaskRunSyncPostRequest{ + ApiService: a, + ctx: ctx, + actorTaskId: actorTaskId, + } +} + +// Execute executes the request +// @return map[string]interface{} +func (a *ActorTasksAPIService) ActorTaskRunSyncPostExecute(r ApiActorTaskRunSyncPostRequest) (map[string]interface{}, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue map[string]interface{} + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ActorTasksAPIService.ActorTaskRunSyncPost") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/actor-tasks/{actorTaskId}/run-sync" + localVarPath = strings.Replace(localVarPath, "{"+"actorTaskId"+"}", url.PathEscape(parameterValueToString(r.actorTaskId, "actorTaskId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.body == nil { + return localVarReturnValue, nil, reportError("body is required and must be specified") + } + + if r.timeout != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "timeout", r.timeout, "form", "") + } + if r.memory != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "memory", r.memory, "form", "") + } + if r.maxItems != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "maxItems", r.maxItems, "form", "") + } + if r.maxTotalChargeUsd != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "maxTotalChargeUsd", r.maxTotalChargeUsd, "form", "") + } + if r.restartOnError != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "restartOnError", r.restartOnError, "form", "") + } + if r.build != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "build", r.build, "form", "") + } + if r.outputRecordKey != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "outputRecordKey", r.outputRecordKey, "form", "") + } + if r.webhooks != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "webhooks", r.webhooks, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.body + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 413 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 415 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiActorTaskRunsGetRequest struct { + ctx context.Context + ApiService *ActorTasksAPIService + actorTaskId string + offset *float64 + limit *float64 + desc *bool + status *[]string +} + +// Number of items that should be skipped at the start. The default value is `0`. +func (r ApiActorTaskRunsGetRequest) Offset(offset float64) ApiActorTaskRunsGetRequest { + r.offset = &offset + return r +} + +// Maximum number of items to return. The default value as well as the maximum is `1000`. +func (r ApiActorTaskRunsGetRequest) Limit(limit float64) ApiActorTaskRunsGetRequest { + r.limit = &limit + return r +} + +// If `true` or `1` then the objects are sorted by the `startedAt` field in descending order. By default, they are sorted in ascending order. +func (r ApiActorTaskRunsGetRequest) Desc(desc bool) ApiActorTaskRunsGetRequest { + r.desc = &desc + return r +} + +// Single status or comma-separated list of statuses, see ([available statuses](https://docs.apify.com/platform/actors/running/runs-and-builds#lifecycle)). Used to filter runs by the specified statuses only. +func (r ApiActorTaskRunsGetRequest) Status(status []string) ApiActorTaskRunsGetRequest { + r.status = &status + return r +} + +func (r ApiActorTaskRunsGetRequest) Execute() (*ActorTaskRunsGet200Response, *http.Response, error) { + return r.ApiService.ActorTaskRunsGetExecute(r) +} + +/* +ActorTaskRunsGet Get list of task runs + +Get a list of runs of a specific task. The response is a list of objects, +where each object contains essential information about a single task run. + +The endpoint supports pagination using the `limit` and `offset` parameters, +and it does not return more than a 1000 array elements. + +By default, the records are sorted by the `startedAt` field in ascending +order; therefore you can use pagination to incrementally fetch all records while +new ones are still being created. To sort the records in descending order, use +the `desc=1` parameter. You can also filter runs by status ([available +statuses](https://docs.apify.com/platform/actors/running/runs-and-builds#lifecycle)). + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param actorTaskId Task ID or a tilde-separated owner's username and task's name. + @return ApiActorTaskRunsGetRequest +*/ +func (a *ActorTasksAPIService) ActorTaskRunsGet(ctx context.Context, actorTaskId string) ApiActorTaskRunsGetRequest { + return ApiActorTaskRunsGetRequest{ + ApiService: a, + ctx: ctx, + actorTaskId: actorTaskId, + } +} + +// Execute executes the request +// @return ActorTaskRunsGet200Response +func (a *ActorTasksAPIService) ActorTaskRunsGetExecute(r ApiActorTaskRunsGetRequest) (*ActorTaskRunsGet200Response, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ActorTaskRunsGet200Response + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ActorTasksAPIService.ActorTaskRunsGet") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/actor-tasks/{actorTaskId}/runs" + localVarPath = strings.Replace(localVarPath, "{"+"actorTaskId"+"}", url.PathEscape(parameterValueToString(r.actorTaskId, "actorTaskId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.offset != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "form", "") + } + if r.limit != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "form", "") + } + if r.desc != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "desc", r.desc, "form", "") + } + if r.status != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "status", r.status, "form", "csv") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiActorTaskRunsLastGetRequest struct { + ctx context.Context + ApiService *ActorTasksAPIService + actorTaskId string + status *string + waitForFinish *float64 +} + +// Filter for the run status. +func (r ApiActorTaskRunsLastGetRequest) Status(status string) ApiActorTaskRunsLastGetRequest { + r.status = &status + return r +} + +// The maximum number of seconds the server waits for the run to finish. By default it is `0`, the maximum value is `60`. <!-- MAX_ACTOR_JOB_ASYNC_WAIT_SECS --> If the run finishes in time then the returned run object will have a terminal status (e.g. `SUCCEEDED`), otherwise it will have a transitional status (e.g. `RUNNING`). +func (r ApiActorTaskRunsLastGetRequest) WaitForFinish(waitForFinish float64) ApiActorTaskRunsLastGetRequest { + r.waitForFinish = &waitForFinish + return r +} + +func (r ApiActorTaskRunsLastGetRequest) Execute() (*ActorTaskRunsPost201Response, *http.Response, error) { + return r.ApiService.ActorTaskRunsLastGetExecute(r) +} + +/* +ActorTaskRunsLastGet Get last run + +This is not a single endpoint, but an entire group of endpoints that lets you to +retrieve and manage the last run of given actor task or any of its default storages. +All the endpoints require an authentication token. + +The base path represents the last actor task run object is: + +`/v2/actor-tasks/{actorTaskId}/runs/last{?token,status}` + +Using the `status` query parameter you can ensure to only get a run with a certain status +(e.g. `status=SUCCEEDED`). The output of this endpoint and other query parameters +are the same as in the [Run object](/api/v2/actor-run-get) endpoint. + +##### Convenience endpoints for last Actor task run + +* [Dataset](/api/v2/last-actor-task-runs-default-dataset) + +* [Key-value store](/api/v2/last-actor-task-runs-default-key-value-store) + +* [Request queue](/api/v2/last-actor-task-runs-default-request-queue) + +* [Log](/api/v2/last-actor-task-runs-log) + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param actorTaskId Task ID or a tilde-separated owner's username and task's name. + @return ApiActorTaskRunsLastGetRequest +*/ +func (a *ActorTasksAPIService) ActorTaskRunsLastGet(ctx context.Context, actorTaskId string) ApiActorTaskRunsLastGetRequest { + return ApiActorTaskRunsLastGetRequest{ + ApiService: a, + ctx: ctx, + actorTaskId: actorTaskId, + } +} + +// Execute executes the request +// @return ActorTaskRunsPost201Response +func (a *ActorTasksAPIService) ActorTaskRunsLastGetExecute(r ApiActorTaskRunsLastGetRequest) (*ActorTaskRunsPost201Response, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ActorTaskRunsPost201Response + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ActorTasksAPIService.ActorTaskRunsLastGet") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/actor-tasks/{actorTaskId}/runs/last" + localVarPath = strings.Replace(localVarPath, "{"+"actorTaskId"+"}", url.PathEscape(parameterValueToString(r.actorTaskId, "actorTaskId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.status != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "status", r.status, "form", "") + } + if r.waitForFinish != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "waitForFinish", r.waitForFinish, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiActorTaskRunsPostRequest struct { + ctx context.Context + ApiService *ActorTasksAPIService + actorTaskId string + body *map[string]interface{} + timeout *float64 + memory *float64 + maxItems *float64 + maxTotalChargeUsd *float64 + restartOnError *bool + build *string + waitForFinish *float64 + webhooks *string +} + +// +func (r ApiActorTaskRunsPostRequest) Body(body map[string]interface{}) ApiActorTaskRunsPostRequest { + r.body = &body + return r +} + +// Optional timeout for the run, in seconds. By default, the run uses the timeout from its configuration. +func (r ApiActorTaskRunsPostRequest) Timeout(timeout float64) ApiActorTaskRunsPostRequest { + r.timeout = &timeout + return r +} + +// Memory limit for the run, in megabytes. The amount of memory can be set to a power of 2 with a minimum of 128. By default, the run uses the memory limit from its configuration. +func (r ApiActorTaskRunsPostRequest) Memory(memory float64) ApiActorTaskRunsPostRequest { + r.memory = &memory + return r +} + +// Specifies the maximum number of dataset items that will be charged for pay-per-result Actors. This does NOT guarantee that the Actor will return only this many items. It only ensures you won't be charged for more than this number of items. Only works for pay-per-result Actors. Value can be accessed in the actor run using `ACTOR_MAX_PAID_DATASET_ITEMS` environment variable. +func (r ApiActorTaskRunsPostRequest) MaxItems(maxItems float64) ApiActorTaskRunsPostRequest { + r.maxItems = &maxItems + return r +} + +// Specifies the maximum cost of the run. This parameter is useful for pay-per-event Actors, as it allows you to limit the amount charged to your subscription. You can access the maximum cost in your Actor by using the `ACTOR_MAX_TOTAL_CHARGE_USD` environment variable. +func (r ApiActorTaskRunsPostRequest) MaxTotalChargeUsd(maxTotalChargeUsd float64) ApiActorTaskRunsPostRequest { + r.maxTotalChargeUsd = &maxTotalChargeUsd + return r +} + +// Determines whether the run will be restarted if it fails. +func (r ApiActorTaskRunsPostRequest) RestartOnError(restartOnError bool) ApiActorTaskRunsPostRequest { + r.restartOnError = &restartOnError + return r +} + +// Specifies the Actor build to run. It can be either a build tag or build number. By default, the run uses the build from its configuration (typically `latest`). +func (r ApiActorTaskRunsPostRequest) Build(build string) ApiActorTaskRunsPostRequest { + r.build = &build + return r +} + +// The maximum number of seconds the server waits for the run to finish. By default it is `0`, the maximum value is `60`. <!-- MAX_ACTOR_JOB_ASYNC_WAIT_SECS --> If the run finishes in time then the returned run object will have a terminal status (e.g. `SUCCEEDED`), otherwise it will have a transitional status (e.g. `RUNNING`). +func (r ApiActorTaskRunsPostRequest) WaitForFinish(waitForFinish float64) ApiActorTaskRunsPostRequest { + r.waitForFinish = &waitForFinish + return r +} + +// Specifies optional webhooks associated with the Actor run, which can be used to receive a notification e.g. when the Actor finished or failed. The value is a Base64-encoded JSON array whose items follow the WebhookRepresentation schema. For more information, see [Webhooks documentation](https://docs.apify.com/platform/integrations/webhooks). +func (r ApiActorTaskRunsPostRequest) Webhooks(webhooks string) ApiActorTaskRunsPostRequest { + r.webhooks = &webhooks + return r +} + +func (r ApiActorTaskRunsPostRequest) Execute() (*ActorTaskRunsPost201Response, *http.Response, error) { + return r.ApiService.ActorTaskRunsPostExecute(r) +} + +/* +ActorTaskRunsPost Run task + +Runs an Actor task and immediately returns without waiting for the run to +finish. + +Optionally, you can override the Actor input configuration by passing a JSON +object as the POST payload and setting the `Content-Type: application/json` HTTP header. + +Note that if the object in the POST payload does not define a particular +input property, the Actor run uses the default value defined by the task (or Actor's input +schema if not defined by the task). + +The response is the Actor Run object as returned by the [Get +run](#/reference/actor-runs/run-object-and-its-storages/get-run) endpoint. + +If you want to wait for the run to finish and receive the actual output of +the Actor run as the response, use one of the [Run task +synchronously](#/reference/actor-tasks/run-task-synchronously) API endpoints +instead. + +To fetch the Actor run results that are typically stored in the default +dataset, you'll need to pass the ID received in the `defaultDatasetId` field +received in the response JSON to the +[Get dataset items](#/reference/datasets/item-collection/get-items) API endpoint. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param actorTaskId Task ID or a tilde-separated owner's username and task's name. + @return ApiActorTaskRunsPostRequest +*/ +func (a *ActorTasksAPIService) ActorTaskRunsPost(ctx context.Context, actorTaskId string) ApiActorTaskRunsPostRequest { + return ApiActorTaskRunsPostRequest{ + ApiService: a, + ctx: ctx, + actorTaskId: actorTaskId, + } +} + +// Execute executes the request +// @return ActorTaskRunsPost201Response +func (a *ActorTasksAPIService) ActorTaskRunsPostExecute(r ApiActorTaskRunsPostRequest) (*ActorTaskRunsPost201Response, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ActorTaskRunsPost201Response + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ActorTasksAPIService.ActorTaskRunsPost") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/actor-tasks/{actorTaskId}/runs" + localVarPath = strings.Replace(localVarPath, "{"+"actorTaskId"+"}", url.PathEscape(parameterValueToString(r.actorTaskId, "actorTaskId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.body == nil { + return localVarReturnValue, nil, reportError("body is required and must be specified") + } + + if r.timeout != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "timeout", r.timeout, "form", "") + } + if r.memory != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "memory", r.memory, "form", "") + } + if r.maxItems != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "maxItems", r.maxItems, "form", "") + } + if r.maxTotalChargeUsd != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "maxTotalChargeUsd", r.maxTotalChargeUsd, "form", "") + } + if r.restartOnError != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "restartOnError", r.restartOnError, "form", "") + } + if r.build != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "build", r.build, "form", "") + } + if r.waitForFinish != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "waitForFinish", r.waitForFinish, "form", "") + } + if r.webhooks != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "webhooks", r.webhooks, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.body + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 413 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 415 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiActorTaskWebhooksGetRequest struct { + ctx context.Context + ApiService *ActorTasksAPIService + actorTaskId string + offset *float64 + limit *float64 + desc *bool +} + +// Number of items that should be skipped at the start. The default value is `0`. +func (r ApiActorTaskWebhooksGetRequest) Offset(offset float64) ApiActorTaskWebhooksGetRequest { + r.offset = &offset + return r +} + +// Maximum number of items to return. The default value as well as the maximum is `1000`. +func (r ApiActorTaskWebhooksGetRequest) Limit(limit float64) ApiActorTaskWebhooksGetRequest { + r.limit = &limit + return r +} + +// If `true` or `1` then the objects are sorted by the `createdAt` field in descending order. By default, they are sorted in ascending order. +func (r ApiActorTaskWebhooksGetRequest) Desc(desc bool) ApiActorTaskWebhooksGetRequest { + r.desc = &desc + return r +} + +func (r ApiActorTaskWebhooksGetRequest) Execute() (*ActorTaskWebhooksGet200Response, *http.Response, error) { + return r.ApiService.ActorTaskWebhooksGetExecute(r) +} + +/* +ActorTaskWebhooksGet Get list of webhooks + +Gets the list of webhooks of a specific Actor task. The response is a JSON +with the list of objects, where each object contains basic information about a single webhook. + +The endpoint supports pagination using the `limit` and `offset` parameters +and it will not return more than 1000 records. + +By default, the records are sorted by the `createdAt` field in ascending +order, to sort the records in descending order, use the `desc=1` parameter. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param actorTaskId Task ID or a tilde-separated owner's username and task's name. + @return ApiActorTaskWebhooksGetRequest +*/ +func (a *ActorTasksAPIService) ActorTaskWebhooksGet(ctx context.Context, actorTaskId string) ApiActorTaskWebhooksGetRequest { + return ApiActorTaskWebhooksGetRequest{ + ApiService: a, + ctx: ctx, + actorTaskId: actorTaskId, + } +} + +// Execute executes the request +// @return ActorTaskWebhooksGet200Response +func (a *ActorTasksAPIService) ActorTaskWebhooksGetExecute(r ApiActorTaskWebhooksGetRequest) (*ActorTaskWebhooksGet200Response, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ActorTaskWebhooksGet200Response + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ActorTasksAPIService.ActorTaskWebhooksGet") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/actor-tasks/{actorTaskId}/webhooks" + localVarPath = strings.Replace(localVarPath, "{"+"actorTaskId"+"}", url.PathEscape(parameterValueToString(r.actorTaskId, "actorTaskId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.offset != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "form", "") + } + if r.limit != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "form", "") + } + if r.desc != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "desc", r.desc, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiActorTasksGetRequest struct { + ctx context.Context + ApiService *ActorTasksAPIService + offset *float64 + limit *float64 + desc *bool +} + +// Number of items that should be skipped at the start. The default value is `0`. +func (r ApiActorTasksGetRequest) Offset(offset float64) ApiActorTasksGetRequest { + r.offset = &offset + return r +} + +// Maximum number of items to return. The default value as well as the maximum is `1000`. +func (r ApiActorTasksGetRequest) Limit(limit float64) ApiActorTasksGetRequest { + r.limit = &limit + return r +} + +// If `true` or `1` then the objects are sorted by the `createdAt` field in descending order. By default, they are sorted in ascending order. +func (r ApiActorTasksGetRequest) Desc(desc bool) ApiActorTasksGetRequest { + r.desc = &desc + return r +} + +func (r ApiActorTasksGetRequest) Execute() (*ListOfTasksResponse, *http.Response, error) { + return r.ApiService.ActorTasksGetExecute(r) +} + +/* +ActorTasksGet Get list of tasks + +Gets the complete list of tasks that a user has created or used. + +The response is a list of objects in which each object contains essential +information about a single task. + +The endpoint supports pagination using the `limit` and `offset` parameters, +and it does not return more than a 1000 records. + +By default, the records are sorted by the `createdAt` field in ascending +order; therefore you can use pagination to incrementally fetch all tasks while new +ones are still being created. To sort the records in descending order, use +the `desc=1` parameter. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiActorTasksGetRequest +*/ +func (a *ActorTasksAPIService) ActorTasksGet(ctx context.Context) ApiActorTasksGetRequest { + return ApiActorTasksGetRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return ListOfTasksResponse +func (a *ActorTasksAPIService) ActorTasksGetExecute(r ApiActorTasksGetRequest) (*ListOfTasksResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ListOfTasksResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ActorTasksAPIService.ActorTasksGet") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/actor-tasks" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.offset != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "form", "") + } + if r.limit != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "form", "") + } + if r.desc != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "desc", r.desc, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiActorTasksPostRequest struct { + ctx context.Context + ApiService *ActorTasksAPIService + createTaskRequest *CreateTaskRequest +} + +// +func (r ApiActorTasksPostRequest) CreateTaskRequest(createTaskRequest CreateTaskRequest) ApiActorTasksPostRequest { + r.createTaskRequest = &createTaskRequest + return r +} + +func (r ApiActorTasksPostRequest) Execute() (*TaskResponse, *http.Response, error) { + return r.ApiService.ActorTasksPostExecute(r) +} + +/* +ActorTasksPost Create task + +Create a new task with settings specified by the object passed as JSON in +the POST payload. + +The response is the full task object as returned by the +[Get task](/api/v2/actor-task-get) endpoint. + +The request needs to specify the `Content-Type: application/json` HTTP header! + +When providing your API authentication token, we recommend using the +request's `Authorization` header, rather than the URL. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiActorTasksPostRequest +*/ +func (a *ActorTasksAPIService) ActorTasksPost(ctx context.Context) ApiActorTasksPostRequest { + return ApiActorTasksPostRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return TaskResponse +func (a *ActorTasksAPIService) ActorTasksPostExecute(r ApiActorTasksPostRequest) (*TaskResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *TaskResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ActorTasksAPIService.ActorTasksPost") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/actor-tasks" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.createTaskRequest == nil { + return localVarReturnValue, nil, reportError("createTaskRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.createTaskRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 409 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 413 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 415 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/api_actors.go b/api_actors.go new file mode 100644 index 0000000..75df943 --- /dev/null +++ b/api_actors.go @@ -0,0 +1,1303 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" + "strings" +) + + +// ActorsAPIService ActorsAPI service +type ActorsAPIService service + +type ApiActDeleteRequest struct { + ctx context.Context + ApiService *ActorsAPIService + actorId string +} + +func (r ApiActDeleteRequest) Execute() (map[string]interface{}, *http.Response, error) { + return r.ApiService.ActDeleteExecute(r) +} + +/* +ActDelete Delete Actor + +Deletes an Actor. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param actorId Actor ID or a tilde-separated owner's username and Actor name. + @return ApiActDeleteRequest +*/ +func (a *ActorsAPIService) ActDelete(ctx context.Context, actorId string) ApiActDeleteRequest { + return ApiActDeleteRequest{ + ApiService: a, + ctx: ctx, + actorId: actorId, + } +} + +// Execute executes the request +// @return map[string]interface{} +func (a *ActorsAPIService) ActDeleteExecute(r ApiActDeleteRequest) (map[string]interface{}, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue map[string]interface{} + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ActorsAPIService.ActDelete") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/actors/{actorId}" + localVarPath = strings.Replace(localVarPath, "{"+"actorId"+"}", url.PathEscape(parameterValueToString(r.actorId, "actorId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiActGetRequest struct { + ctx context.Context + ApiService *ActorsAPIService + actorId string +} + +func (r ApiActGetRequest) Execute() (*ActorResponse, *http.Response, error) { + return r.ApiService.ActGetExecute(r) +} + +/* +ActGet Get Actor + +Gets an object that contains all the details about a specific Actor. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param actorId Actor ID or a tilde-separated owner's username and Actor name. + @return ApiActGetRequest +*/ +func (a *ActorsAPIService) ActGet(ctx context.Context, actorId string) ApiActGetRequest { + return ApiActGetRequest{ + ApiService: a, + ctx: ctx, + actorId: actorId, + } +} + +// Execute executes the request +// @return ActorResponse +func (a *ActorsAPIService) ActGetExecute(r ApiActGetRequest) (*ActorResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ActorResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ActorsAPIService.ActGet") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/actors/{actorId}" + localVarPath = strings.Replace(localVarPath, "{"+"actorId"+"}", url.PathEscape(parameterValueToString(r.actorId, "actorId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiActPutRequest struct { + ctx context.Context + ApiService *ActorsAPIService + actorId string + updateActorRequest *UpdateActorRequest +} + +// +func (r ApiActPutRequest) UpdateActorRequest(updateActorRequest UpdateActorRequest) ApiActPutRequest { + r.updateActorRequest = &updateActorRequest + return r +} + +func (r ApiActPutRequest) Execute() (*ActorResponse, *http.Response, error) { + return r.ApiService.ActPutExecute(r) +} + +/* +ActPut Update Actor + +Updates settings of an Actor using values specified by an Actor object +passed as JSON in the POST payload. +If the object does not define a specific property, its value will not be +updated. + +The response is the full Actor object as returned by the +[Get Actor](#/reference/actors/actor-object/get-actor) endpoint. + +The request needs to specify the `Content-Type: application/json` HTTP header! + +When providing your API authentication token, we recommend using the +request's `Authorization` header, rather than the URL. ([More +info](#/introduction/authentication)). + +If you want to make your Actor +[public](https://docs.apify.com/platform/actors/publishing) using `isPublic: +true`, you will need to provide the Actor's `title` and the `categories` +under which that Actor will be classified in Apify Store. For this, it's +best to use the [constants from our `apify-shared-js` +package](https://github.com/apify/apify-shared-js/blob/2d43ebc41ece9ad31cd6525bd523fb86939bf860/packages/consts/src/consts.ts#L452-L471). + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param actorId Actor ID or a tilde-separated owner's username and Actor name. + @return ApiActPutRequest +*/ +func (a *ActorsAPIService) ActPut(ctx context.Context, actorId string) ApiActPutRequest { + return ApiActPutRequest{ + ApiService: a, + ctx: ctx, + actorId: actorId, + } +} + +// Execute executes the request +// @return ActorResponse +func (a *ActorsAPIService) ActPutExecute(r ApiActPutRequest) (*ActorResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ActorResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ActorsAPIService.ActPut") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/actors/{actorId}" + localVarPath = strings.Replace(localVarPath, "{"+"actorId"+"}", url.PathEscape(parameterValueToString(r.actorId, "actorId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.updateActorRequest == nil { + return localVarReturnValue, nil, reportError("updateActorRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.updateActorRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 413 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 415 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiActValidateInputPostRequest struct { + ctx context.Context + ApiService *ActorsAPIService + actorId string + body *map[string]interface{} + build *string +} + +// JSON input to validate against the Actor's input schema. +func (r ApiActValidateInputPostRequest) Body(body map[string]interface{}) ApiActValidateInputPostRequest { + r.body = &body + return r +} + +// Optional tag or number of the Actor build to use for input schema validation. By default, the `latest` build tag is used. +func (r ApiActValidateInputPostRequest) Build(build string) ApiActValidateInputPostRequest { + r.build = &build + return r +} + +func (r ApiActValidateInputPostRequest) Execute() (*ActValidateInputPost200Response, *http.Response, error) { + return r.ApiService.ActValidateInputPostExecute(r) +} + +/* +ActValidateInputPost Validate Actor input + +Validates the provided input against the Actor's input schema for the specified build. + +The endpoint checks whether the JSON payload conforms to the input schema +defined in the Actor's build. If no `build` query parameter is provided, +the `latest` build tag is used by default. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param actorId Actor ID or a tilde-separated owner's username and Actor name. + @return ApiActValidateInputPostRequest +*/ +func (a *ActorsAPIService) ActValidateInputPost(ctx context.Context, actorId string) ApiActValidateInputPostRequest { + return ApiActValidateInputPostRequest{ + ApiService: a, + ctx: ctx, + actorId: actorId, + } +} + +// Execute executes the request +// @return ActValidateInputPost200Response +func (a *ActorsAPIService) ActValidateInputPostExecute(r ApiActValidateInputPostRequest) (*ActValidateInputPost200Response, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ActValidateInputPost200Response + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ActorsAPIService.ActValidateInputPost") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/actors/{actorId}/validate-input" + localVarPath = strings.Replace(localVarPath, "{"+"actorId"+"}", url.PathEscape(parameterValueToString(r.actorId, "actorId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.body == nil { + return localVarReturnValue, nil, reportError("body is required and must be specified") + } + + if r.build != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "build", r.build, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.body + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 413 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 415 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiActsGetRequest struct { + ctx context.Context + ApiService *ActorsAPIService + my *bool + offset *float64 + limit *float64 + desc *bool + sortBy *string +} + +// If `true` or `1` then the returned list only contains Actors owned by the user. The default value is `false`. +func (r ApiActsGetRequest) My(my bool) ApiActsGetRequest { + r.my = &my + return r +} + +// Number of items that should be skipped at the start. The default value is `0`. +func (r ApiActsGetRequest) Offset(offset float64) ApiActsGetRequest { + r.offset = &offset + return r +} + +// Maximum number of items to return. The default value as well as the maximum is `1000`. +func (r ApiActsGetRequest) Limit(limit float64) ApiActsGetRequest { + r.limit = &limit + return r +} + +// If `true` or `1` then the objects are sorted by the `createdAt` field in descending order. By default, they are sorted in ascending order. +func (r ApiActsGetRequest) Desc(desc bool) ApiActsGetRequest { + r.desc = &desc + return r +} + +// Field to sort the records by. The default is `createdAt`. You can also use `stats.lastRunStartedAt` to sort by the most recently ran Actors. +func (r ApiActsGetRequest) SortBy(sortBy string) ApiActsGetRequest { + r.sortBy = &sortBy + return r +} + +func (r ApiActsGetRequest) Execute() (*ListOfActorsResponse, *http.Response, error) { + return r.ApiService.ActsGetExecute(r) +} + +/* +ActsGet Get list of Actors + +Gets the list of all Actors that the user created or used. The response is a +list of objects, where each object contains a basic information about a single Actor. + +To only get Actors created by the user, add the `my=1` query parameter. + +The endpoint supports pagination using the `limit` and `offset` parameters +and it will not return more than 1000 records. + +By default, the records are sorted by the `createdAt` field in ascending +order, therefore you can use pagination to incrementally fetch all Actors while new +ones are still being created. To sort the records in descending order, use the `desc=1` parameter. + +You can also sort by your last run by using the `sortBy=stats.lastRunStartedAt` query parameter. +In this case, descending order means the most recently run Actor appears first. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiActsGetRequest +*/ +func (a *ActorsAPIService) ActsGet(ctx context.Context) ApiActsGetRequest { + return ApiActsGetRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return ListOfActorsResponse +func (a *ActorsAPIService) ActsGetExecute(r ApiActsGetRequest) (*ListOfActorsResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ListOfActorsResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ActorsAPIService.ActsGet") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/actors" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.my != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "my", r.my, "form", "") + } + if r.offset != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "form", "") + } + if r.limit != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "form", "") + } + if r.desc != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "desc", r.desc, "form", "") + } + if r.sortBy != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "sortBy", r.sortBy, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiActsPostRequest struct { + ctx context.Context + ApiService *ActorsAPIService + createActorRequest *CreateActorRequest +} + +// +func (r ApiActsPostRequest) CreateActorRequest(createActorRequest CreateActorRequest) ApiActsPostRequest { + r.createActorRequest = &createActorRequest + return r +} + +func (r ApiActsPostRequest) Execute() (*ActorResponse, *http.Response, error) { + return r.ApiService.ActsPostExecute(r) +} + +/* +ActsPost Create Actor + +Creates a new Actor with settings specified in an Actor object passed as +JSON in the POST payload. +The response is the full Actor object as returned by the +[Get Actor](#/reference/actors/actor-object/get-actor) endpoint. + +The HTTP request must have the `Content-Type: application/json` HTTP header! + +The Actor needs to define at least one version of the source code. +For more information, see [Version object](#/reference/actors/version-object). + +If you want to make your Actor +[public](https://docs.apify.com/platform/actors/publishing) using `isPublic: +true`, you will need to provide the Actor's `title` and the `categories` +under which that Actor will be classified in Apify Store. For this, it's +best to use the [constants from our `apify-shared-js` +package](https://github.com/apify/apify-shared-js/blob/2d43ebc41ece9ad31cd6525bd523fb86939bf860/packages/consts/src/consts.ts#L452-L471). + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiActsPostRequest +*/ +func (a *ActorsAPIService) ActsPost(ctx context.Context) ApiActsPostRequest { + return ApiActsPostRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return ActorResponse +func (a *ActorsAPIService) ActsPostExecute(r ApiActsPostRequest) (*ActorResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ActorResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ActorsAPIService.ActsPost") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/actors" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.createActorRequest == nil { + return localVarReturnValue, nil, reportError("createActorRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.createActorRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 413 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 415 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/api_actors_actor_builds.go b/api_actors_actor_builds.go new file mode 100644 index 0000000..722f4e4 --- /dev/null +++ b/api_actors_actor_builds.go @@ -0,0 +1,1199 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" + "strings" +) + + +// ActorsActorBuildsAPIService ActorsActorBuildsAPI service +type ActorsActorBuildsAPIService service + +type ApiActBuildAbortPostRequest struct { + ctx context.Context + ApiService *ActorsActorBuildsAPIService + actorId string + buildId string +} + +func (r ApiActBuildAbortPostRequest) Execute() (*BuildResponse, *http.Response, error) { + return r.ApiService.ActBuildAbortPostExecute(r) +} + +/* +ActBuildAbortPost Abort build + +**[DEPRECATED]** API endpoints related to build of the Actor were moved +under new namespace [`actor-builds`](#/reference/actor-builds). Aborts an +Actor build and returns an object that contains all the details about the +build. + +Only builds that are starting or running are aborted. For builds with status +`FINISHED`, `FAILED`, `ABORTING` and `TIMED-OUT` this call does nothing. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param actorId Actor ID or a tilde-separated owner's username and Actor name. + @param buildId ID of the build, found in the build's Info tab. + @return ApiActBuildAbortPostRequest + +Deprecated +*/ +func (a *ActorsActorBuildsAPIService) ActBuildAbortPost(ctx context.Context, actorId string, buildId string) ApiActBuildAbortPostRequest { + return ApiActBuildAbortPostRequest{ + ApiService: a, + ctx: ctx, + actorId: actorId, + buildId: buildId, + } +} + +// Execute executes the request +// @return BuildResponse +// Deprecated +func (a *ActorsActorBuildsAPIService) ActBuildAbortPostExecute(r ApiActBuildAbortPostRequest) (*BuildResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *BuildResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ActorsActorBuildsAPIService.ActBuildAbortPost") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/actors/{actorId}/builds/{buildId}/abort" + localVarPath = strings.Replace(localVarPath, "{"+"actorId"+"}", url.PathEscape(parameterValueToString(r.actorId, "actorId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"buildId"+"}", url.PathEscape(parameterValueToString(r.buildId, "buildId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiActBuildDefaultGetRequest struct { + ctx context.Context + ApiService *ActorsActorBuildsAPIService + actorId string + waitForFinish *float64 +} + +// The maximum number of seconds the server waits for the build to finish. By default it is `0`, the maximum value is `60`. <!-- MAX_ACTOR_JOB_ASYNC_WAIT_SECS --> If the build finishes in time then the returned build object will have a terminal status (e.g. `SUCCEEDED`), otherwise it will have a transitional status (e.g. `RUNNING`). +func (r ApiActBuildDefaultGetRequest) WaitForFinish(waitForFinish float64) ApiActBuildDefaultGetRequest { + r.waitForFinish = &waitForFinish + return r +} + +func (r ApiActBuildDefaultGetRequest) Execute() (*BuildResponse, *http.Response, error) { + return r.ApiService.ActBuildDefaultGetExecute(r) +} + +/* +ActBuildDefaultGet Get default build + +Get the default build for an Actor. + +Use the optional `waitForFinish` parameter to synchronously wait for the build to finish. +This avoids the need for periodic polling when waiting for the build to complete. + +This endpoint does not require an authentication token. Instead, calls are authenticated using the Actor's unique ID. +However, if you access the endpoint without a token, certain attributes (e.g., `usageUsd` and `usageTotalUsd`) will be hidden. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param actorId Actor ID or a tilde-separated owner's username and Actor name. + @return ApiActBuildDefaultGetRequest +*/ +func (a *ActorsActorBuildsAPIService) ActBuildDefaultGet(ctx context.Context, actorId string) ApiActBuildDefaultGetRequest { + return ApiActBuildDefaultGetRequest{ + ApiService: a, + ctx: ctx, + actorId: actorId, + } +} + +// Execute executes the request +// @return BuildResponse +func (a *ActorsActorBuildsAPIService) ActBuildDefaultGetExecute(r ApiActBuildDefaultGetRequest) (*BuildResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *BuildResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ActorsActorBuildsAPIService.ActBuildDefaultGet") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/actors/{actorId}/builds/default" + localVarPath = strings.Replace(localVarPath, "{"+"actorId"+"}", url.PathEscape(parameterValueToString(r.actorId, "actorId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.waitForFinish != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "waitForFinish", r.waitForFinish, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiActBuildGetRequest struct { + ctx context.Context + ApiService *ActorsActorBuildsAPIService + actorId string + buildId string + waitForFinish *float64 +} + +// The maximum number of seconds the server waits for the build to finish. By default it is `0`, the maximum value is `60`. <!-- MAX_ACTOR_JOB_ASYNC_WAIT_SECS --> If the build finishes in time then the returned build object will have a terminal status (e.g. `SUCCEEDED`), otherwise it will have a transitional status (e.g. `RUNNING`). +func (r ApiActBuildGetRequest) WaitForFinish(waitForFinish float64) ApiActBuildGetRequest { + r.waitForFinish = &waitForFinish + return r +} + +func (r ApiActBuildGetRequest) Execute() (*BuildResponse, *http.Response, error) { + return r.ApiService.ActBuildGetExecute(r) +} + +/* +ActBuildGet Get build + +By passing the optional `waitForFinish` parameter the API endpoint will +synchronously wait for the build to finish. +This is useful to avoid periodic polling when waiting for an Actor build to +finish. + +This endpoint does not require the authentication token. Instead, calls are authenticated using a hard-to-guess ID of the build. However, +if you access the endpoint without the token, certain attributes, such as `usageUsd` and `usageTotalUsd`, will be hidden. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param actorId Actor ID or a tilde-separated owner's username and Actor name. + @param buildId ID of the build, found in the build's Info tab. + @return ApiActBuildGetRequest + +Deprecated +*/ +func (a *ActorsActorBuildsAPIService) ActBuildGet(ctx context.Context, actorId string, buildId string) ApiActBuildGetRequest { + return ApiActBuildGetRequest{ + ApiService: a, + ctx: ctx, + actorId: actorId, + buildId: buildId, + } +} + +// Execute executes the request +// @return BuildResponse +// Deprecated +func (a *ActorsActorBuildsAPIService) ActBuildGetExecute(r ApiActBuildGetRequest) (*BuildResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *BuildResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ActorsActorBuildsAPIService.ActBuildGet") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/actors/{actorId}/builds/{buildId}" + localVarPath = strings.Replace(localVarPath, "{"+"actorId"+"}", url.PathEscape(parameterValueToString(r.actorId, "actorId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"buildId"+"}", url.PathEscape(parameterValueToString(r.buildId, "buildId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.waitForFinish != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "waitForFinish", r.waitForFinish, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiActBuildsGetRequest struct { + ctx context.Context + ApiService *ActorsActorBuildsAPIService + actorId string + offset *float64 + limit *float64 + desc *bool +} + +// Number of items that should be skipped at the start. The default value is `0`. +func (r ApiActBuildsGetRequest) Offset(offset float64) ApiActBuildsGetRequest { + r.offset = &offset + return r +} + +// Maximum number of items to return. The default value as well as the maximum is `1000`. +func (r ApiActBuildsGetRequest) Limit(limit float64) ApiActBuildsGetRequest { + r.limit = &limit + return r +} + +// If `true` or `1` then the objects are sorted by the `startedAt` field in descending order. By default, they are sorted in ascending order. +func (r ApiActBuildsGetRequest) Desc(desc bool) ApiActBuildsGetRequest { + r.desc = &desc + return r +} + +func (r ApiActBuildsGetRequest) Execute() (*ListOfBuildsResponse, *http.Response, error) { + return r.ApiService.ActBuildsGetExecute(r) +} + +/* +ActBuildsGet Get list of builds + +Gets the list of builds of a specific Actor. The response is a JSON with the +list of objects, where each object contains basic information about a single build. + +The endpoint supports pagination using the `limit` and `offset` parameters +and it will not return more than 1000 records. + +By default, the records are sorted by the `startedAt` field in ascending order, +therefore you can use pagination to incrementally fetch all builds while new +ones are still being started. To sort the records in descending order, use +the `desc=1` parameter. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param actorId Actor ID or a tilde-separated owner's username and Actor name. + @return ApiActBuildsGetRequest +*/ +func (a *ActorsActorBuildsAPIService) ActBuildsGet(ctx context.Context, actorId string) ApiActBuildsGetRequest { + return ApiActBuildsGetRequest{ + ApiService: a, + ctx: ctx, + actorId: actorId, + } +} + +// Execute executes the request +// @return ListOfBuildsResponse +func (a *ActorsActorBuildsAPIService) ActBuildsGetExecute(r ApiActBuildsGetRequest) (*ListOfBuildsResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ListOfBuildsResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ActorsActorBuildsAPIService.ActBuildsGet") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/actors/{actorId}/builds" + localVarPath = strings.Replace(localVarPath, "{"+"actorId"+"}", url.PathEscape(parameterValueToString(r.actorId, "actorId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.offset != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "form", "") + } + if r.limit != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "form", "") + } + if r.desc != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "desc", r.desc, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiActBuildsPostRequest struct { + ctx context.Context + ApiService *ActorsActorBuildsAPIService + actorId string + version *string + useCache *bool + betaPackages *bool + tag *string + waitForFinish *float64 +} + +// Actor version number to be built. +func (r ApiActBuildsPostRequest) Version(version string) ApiActBuildsPostRequest { + r.version = &version + return r +} + +// If `true` or `1`, the system will use a cache to speed up the build process. By default, cache is not used. +func (r ApiActBuildsPostRequest) UseCache(useCache bool) ApiActBuildsPostRequest { + r.useCache = &useCache + return r +} + +// If `true` or `1` then the Actor is built with beta versions of Apify NPM packages. By default, the build uses `latest` packages. +func (r ApiActBuildsPostRequest) BetaPackages(betaPackages bool) ApiActBuildsPostRequest { + r.betaPackages = &betaPackages + return r +} + +// Tag to be applied to the build on success. By default, the tag is taken from Actor version's `buildTag` property. +func (r ApiActBuildsPostRequest) Tag(tag string) ApiActBuildsPostRequest { + r.tag = &tag + return r +} + +// The maximum number of seconds the server waits for the build to finish. By default it is `0`, the maximum value is `60`. <!-- MAX_ACTOR_JOB_ASYNC_WAIT_SECS --> If the build finishes in time then the returned build object will have a terminal status (e.g. `SUCCEEDED`), otherwise it will have a transitional status (e.g. `RUNNING`). +func (r ApiActBuildsPostRequest) WaitForFinish(waitForFinish float64) ApiActBuildsPostRequest { + r.waitForFinish = &waitForFinish + return r +} + +func (r ApiActBuildsPostRequest) Execute() (*BuildResponse, *http.Response, error) { + return r.ApiService.ActBuildsPostExecute(r) +} + +/* +ActBuildsPost Build Actor + +Builds an Actor. +The response is the build object as returned by the +[Get build](#/reference/actors/build-object/get-build) endpoint. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param actorId Actor ID or a tilde-separated owner's username and Actor name. + @return ApiActBuildsPostRequest +*/ +func (a *ActorsActorBuildsAPIService) ActBuildsPost(ctx context.Context, actorId string) ApiActBuildsPostRequest { + return ApiActBuildsPostRequest{ + ApiService: a, + ctx: ctx, + actorId: actorId, + } +} + +// Execute executes the request +// @return BuildResponse +func (a *ActorsActorBuildsAPIService) ActBuildsPostExecute(r ApiActBuildsPostRequest) (*BuildResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *BuildResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ActorsActorBuildsAPIService.ActBuildsPost") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/actors/{actorId}/builds" + localVarPath = strings.Replace(localVarPath, "{"+"actorId"+"}", url.PathEscape(parameterValueToString(r.actorId, "actorId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.version == nil { + return localVarReturnValue, nil, reportError("version is required and must be specified") + } + + parameterAddToHeaderOrQuery(localVarQueryParams, "version", r.version, "form", "") + if r.useCache != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "useCache", r.useCache, "form", "") + } + if r.betaPackages != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "betaPackages", r.betaPackages, "form", "") + } + if r.tag != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag", r.tag, "form", "") + } + if r.waitForFinish != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "waitForFinish", r.waitForFinish, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiActOpenapiJsonGetRequest struct { + ctx context.Context + ApiService *ActorsActorBuildsAPIService + actorId string + buildId string +} + +func (r ApiActOpenapiJsonGetRequest) Execute() (map[string]interface{}, *http.Response, error) { + return r.ApiService.ActOpenapiJsonGetExecute(r) +} + +/* +ActOpenapiJsonGet Get OpenAPI definition + +Get the OpenAPI definition for Actor builds. Two similar endpoints are available: + +- [First endpoint](/api/v2/act-openapi-json-get): Requires both `actorId` and `buildId`. Use `default` as the `buildId` to get the OpenAPI schema for the default Actor build. + +- [Second endpoint](/api/v2/actor-build-openapi-json-get): Requires only `buildId`. + +Get the OpenAPI definition for a specific Actor build. + +To fetch the default Actor build, simply pass `default` as the `buildId`. +Authentication is based on the build's unique ID. No authentication token is required. + +:::note + +You can also use the [`/api/v2/actor-build-openapi-json-get`](/api/v2/actor-build-openapi-json-get) endpoint to get the OpenAPI definition for a build. + +::: + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param actorId Actor ID or a tilde-separated owner's username and Actor name. + @param buildId ID of the build, found in the build's Info tab. Use the special value `default` to get the OpenAPI schema for the Actor's default build. + @return ApiActOpenapiJsonGetRequest +*/ +func (a *ActorsActorBuildsAPIService) ActOpenapiJsonGet(ctx context.Context, actorId string, buildId string) ApiActOpenapiJsonGetRequest { + return ApiActOpenapiJsonGetRequest{ + ApiService: a, + ctx: ctx, + actorId: actorId, + buildId: buildId, + } +} + +// Execute executes the request +// @return map[string]interface{} +func (a *ActorsActorBuildsAPIService) ActOpenapiJsonGetExecute(r ApiActOpenapiJsonGetRequest) (map[string]interface{}, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue map[string]interface{} + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ActorsActorBuildsAPIService.ActOpenapiJsonGet") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/actors/{actorId}/builds/{buildId}/openapi.json" + localVarPath = strings.Replace(localVarPath, "{"+"actorId"+"}", url.PathEscape(parameterValueToString(r.actorId, "actorId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"buildId"+"}", url.PathEscape(parameterValueToString(r.buildId, "buildId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/api_actors_actor_runs.go b/api_actors_actor_runs.go new file mode 100644 index 0000000..1f148ef --- /dev/null +++ b/api_actors_actor_runs.go @@ -0,0 +1,3255 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" + "strings" + "time" +) + + +// ActorsActorRunsAPIService ActorsActorRunsAPI service +type ActorsActorRunsAPIService service + +type ApiActRunAbortPostRequest struct { + ctx context.Context + ApiService *ActorsActorRunsAPIService + actorId string + runId string + gracefully *bool +} + +// If true passed, the Actor run will abort gracefully. It will send `aborting` and `persistState` event into run and force-stop the run after 30 seconds. It is helpful in cases where you plan to resurrect the run later. +func (r ApiActRunAbortPostRequest) Gracefully(gracefully bool) ApiActRunAbortPostRequest { + r.gracefully = &gracefully + return r +} + +func (r ApiActRunAbortPostRequest) Execute() (*RunResponse, *http.Response, error) { + return r.ApiService.ActRunAbortPostExecute(r) +} + +/* +ActRunAbortPost Abort run + +**[DEPRECATED]** API endpoints related to run of the Actor were moved under +new namespace [`actor-runs`](#/reference/actor-runs). Aborts an Actor run and +returns an object that contains all the details about the run. + +Only runs that are starting or running are aborted. For runs with status +`FINISHED`, `FAILED`, `ABORTING` and `TIMED-OUT` this call does nothing. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param actorId Actor ID or a tilde-separated owner's username and Actor name. + @param runId Actor run ID. + @return ApiActRunAbortPostRequest + +Deprecated +*/ +func (a *ActorsActorRunsAPIService) ActRunAbortPost(ctx context.Context, actorId string, runId string) ApiActRunAbortPostRequest { + return ApiActRunAbortPostRequest{ + ApiService: a, + ctx: ctx, + actorId: actorId, + runId: runId, + } +} + +// Execute executes the request +// @return RunResponse +// Deprecated +func (a *ActorsActorRunsAPIService) ActRunAbortPostExecute(r ApiActRunAbortPostRequest) (*RunResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *RunResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ActorsActorRunsAPIService.ActRunAbortPost") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/actors/{actorId}/runs/{runId}/abort" + localVarPath = strings.Replace(localVarPath, "{"+"actorId"+"}", url.PathEscape(parameterValueToString(r.actorId, "actorId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"runId"+"}", url.PathEscape(parameterValueToString(r.runId, "runId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.gracefully != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "gracefully", r.gracefully, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiActRunGetRequest struct { + ctx context.Context + ApiService *ActorsActorRunsAPIService + actorId string + runId string + waitForFinish *float64 +} + +// The maximum number of seconds the server waits for the run to finish. By default it is `0`, the maximum value is `60`. <!-- MAX_ACTOR_JOB_ASYNC_WAIT_SECS --> If the run finishes in time then the returned run object will have a terminal status (e.g. `SUCCEEDED`), otherwise it will have a transitional status (e.g. `RUNNING`). +func (r ApiActRunGetRequest) WaitForFinish(waitForFinish float64) ApiActRunGetRequest { + r.waitForFinish = &waitForFinish + return r +} + +func (r ApiActRunGetRequest) Execute() (*RunResponse, *http.Response, error) { + return r.ApiService.ActRunGetExecute(r) +} + +/* +ActRunGet Get run + +**[DEPRECATED]** API endpoints related to run of the Actor were moved under +new namespace [`actor-runs`](#/reference/actor-runs). + +Gets an object that contains all the details about a specific run of an Actor. + +By passing the optional `waitForFinish` parameter the API endpoint will +synchronously wait for the run to finish. +This is useful to avoid periodic polling when waiting for Actor run to +complete. + +This endpoint does not require the authentication token. Instead, calls are authenticated using a hard-to-guess ID of the run. However, +if you access the endpoint without the token, certain attributes, such as `usageUsd` and `usageTotalUsd`, will be hidden. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param actorId Actor ID or a tilde-separated owner's username and Actor name. + @param runId Actor run ID. + @return ApiActRunGetRequest + +Deprecated +*/ +func (a *ActorsActorRunsAPIService) ActRunGet(ctx context.Context, actorId string, runId string) ApiActRunGetRequest { + return ApiActRunGetRequest{ + ApiService: a, + ctx: ctx, + actorId: actorId, + runId: runId, + } +} + +// Execute executes the request +// @return RunResponse +// Deprecated +func (a *ActorsActorRunsAPIService) ActRunGetExecute(r ApiActRunGetRequest) (*RunResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *RunResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ActorsActorRunsAPIService.ActRunGet") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/actors/{actorId}/runs/{runId}" + localVarPath = strings.Replace(localVarPath, "{"+"actorId"+"}", url.PathEscape(parameterValueToString(r.actorId, "actorId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"runId"+"}", url.PathEscape(parameterValueToString(r.runId, "runId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.waitForFinish != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "waitForFinish", r.waitForFinish, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiActRunMetamorphPostRequest struct { + ctx context.Context + ApiService *ActorsActorRunsAPIService + actorId string + runId string + targetActorId *string + build *string +} + +// ID of a target Actor that the run should be transformed into. +func (r ApiActRunMetamorphPostRequest) TargetActorId(targetActorId string) ApiActRunMetamorphPostRequest { + r.targetActorId = &targetActorId + return r +} + +// Optional build of the target Actor. It can be either a build tag or build number. By default, the run uses the build specified in the default run configuration for the target Actor (typically `latest`). +func (r ApiActRunMetamorphPostRequest) Build(build string) ApiActRunMetamorphPostRequest { + r.build = &build + return r +} + +func (r ApiActRunMetamorphPostRequest) Execute() (*RunResponse, *http.Response, error) { + return r.ApiService.ActRunMetamorphPostExecute(r) +} + +/* +ActRunMetamorphPost Metamorph run + +**[DEPRECATED]** API endpoints related to run of the Actor were moved under +new namespace [`actor-runs`](#/reference/actor-runs). Transforms an Actor run +into a run of another Actor with a new input. + +This is useful if you want to use another Actor to finish the work +of your current Actor run, without the need to create a completely new run +and waiting for its finish. +For the users of your Actors, the metamorph operation is transparent, they +will just see your Actor got the work done. + +There is a limit on how many times you can metamorph a single run. You can +check the limit in [the Actor runtime limits](https://docs.apify.com/platform/limits#actor-limits). + +Internally, the system stops the Docker container corresponding to the Actor +run and starts a new container using a different Docker image. +All the default storages are preserved and the new input is stored under the +`INPUT-METAMORPH-1` key in the same default key-value store. + +For more information, see the [Actor docs](https://docs.apify.com/platform/actors/development/programming-interface/metamorph). + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param actorId Actor ID or a tilde-separated owner's username and Actor name. + @param runId Actor run ID. + @return ApiActRunMetamorphPostRequest + +Deprecated +*/ +func (a *ActorsActorRunsAPIService) ActRunMetamorphPost(ctx context.Context, actorId string, runId string) ApiActRunMetamorphPostRequest { + return ApiActRunMetamorphPostRequest{ + ApiService: a, + ctx: ctx, + actorId: actorId, + runId: runId, + } +} + +// Execute executes the request +// @return RunResponse +// Deprecated +func (a *ActorsActorRunsAPIService) ActRunMetamorphPostExecute(r ApiActRunMetamorphPostRequest) (*RunResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *RunResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ActorsActorRunsAPIService.ActRunMetamorphPost") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/actors/{actorId}/runs/{runId}/metamorph" + localVarPath = strings.Replace(localVarPath, "{"+"actorId"+"}", url.PathEscape(parameterValueToString(r.actorId, "actorId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"runId"+"}", url.PathEscape(parameterValueToString(r.runId, "runId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.targetActorId == nil { + return localVarReturnValue, nil, reportError("targetActorId is required and must be specified") + } + + parameterAddToHeaderOrQuery(localVarQueryParams, "targetActorId", r.targetActorId, "form", "") + if r.build != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "build", r.build, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiActRunResurrectPostRequest struct { + ctx context.Context + ApiService *ActorsActorRunsAPIService + actorId string + runId string + build *string + timeout *float64 + memory *float64 + restartOnError *bool +} + +// Specifies the Actor build to run. It can be either a build tag or build number. By default, the run is resurrected with the same build it originally used. Specifically, if a run was first started with the `latest` tag, which resolves to version `0.0.3` at the time, a run resurrected without this parameter will continue running with `0.0.3`, even if `latest` already points to a newer build. +func (r ApiActRunResurrectPostRequest) Build(build string) ApiActRunResurrectPostRequest { + r.build = &build + return r +} + +// Optional timeout for the run, in seconds. By default, the run uses the timeout specified in the run that is being resurrected. +func (r ApiActRunResurrectPostRequest) Timeout(timeout float64) ApiActRunResurrectPostRequest { + r.timeout = &timeout + return r +} + +// Memory limit for the run, in megabytes. The amount of memory can be set to a power of 2 with a minimum of 128. By default, the run uses the memory limit specified in the run that is being resurrected. +func (r ApiActRunResurrectPostRequest) Memory(memory float64) ApiActRunResurrectPostRequest { + r.memory = &memory + return r +} + +// Determines whether the resurrected run will be restarted if it fails. By default, the resurrected run uses the same setting as before. +func (r ApiActRunResurrectPostRequest) RestartOnError(restartOnError bool) ApiActRunResurrectPostRequest { + r.restartOnError = &restartOnError + return r +} + +func (r ApiActRunResurrectPostRequest) Execute() (*RunResponse, *http.Response, error) { + return r.ApiService.ActRunResurrectPostExecute(r) +} + +/* +ActRunResurrectPost Resurrect run + +**[DEPRECATED]** API endpoints related to run of the Actor were moved under +new namespace [`actor-runs`](#/reference/actor-runs).Resurrects a finished +Actor run and returns an object that contains all the details about the +resurrected run. + +Only finished runs, i.e. runs with status `FINISHED`, `FAILED`, `ABORTED` +and `TIMED-OUT` can be resurrected. +Run status will be updated to RUNNING and its container will be restarted +with the same storages +(the same behaviour as when the run gets migrated to the new server). + +For more information, see the [Actor +docs](https://docs.apify.com/platform/actors/running/runs-and-builds#resurrection-of-finished-run). + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param actorId Actor ID or a tilde-separated owner's username and Actor name. + @param runId Actor run ID. + @return ApiActRunResurrectPostRequest +*/ +func (a *ActorsActorRunsAPIService) ActRunResurrectPost(ctx context.Context, actorId string, runId string) ApiActRunResurrectPostRequest { + return ApiActRunResurrectPostRequest{ + ApiService: a, + ctx: ctx, + actorId: actorId, + runId: runId, + } +} + +// Execute executes the request +// @return RunResponse +func (a *ActorsActorRunsAPIService) ActRunResurrectPostExecute(r ApiActRunResurrectPostRequest) (*RunResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *RunResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ActorsActorRunsAPIService.ActRunResurrectPost") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/actors/{actorId}/runs/{runId}/resurrect" + localVarPath = strings.Replace(localVarPath, "{"+"actorId"+"}", url.PathEscape(parameterValueToString(r.actorId, "actorId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"runId"+"}", url.PathEscape(parameterValueToString(r.runId, "runId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.build != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "build", r.build, "form", "") + } + if r.timeout != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "timeout", r.timeout, "form", "") + } + if r.memory != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "memory", r.memory, "form", "") + } + if r.restartOnError != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "restartOnError", r.restartOnError, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiActRunSyncGetRequest struct { + ctx context.Context + ApiService *ActorsActorRunsAPIService + actorId string + outputRecordKey *string + timeout *float64 + memory *float64 + maxItems *float64 + maxTotalChargeUsd *float64 + restartOnError *bool + build *string + webhooks *string +} + +// Key of the record from run's default key-value store to be returned in the response. By default, it is `OUTPUT`. +func (r ApiActRunSyncGetRequest) OutputRecordKey(outputRecordKey string) ApiActRunSyncGetRequest { + r.outputRecordKey = &outputRecordKey + return r +} + +// Optional timeout for the run, in seconds. By default, the run uses the timeout from its configuration. +func (r ApiActRunSyncGetRequest) Timeout(timeout float64) ApiActRunSyncGetRequest { + r.timeout = &timeout + return r +} + +// Memory limit for the run, in megabytes. The amount of memory can be set to a power of 2 with a minimum of 128. By default, the run uses the memory limit from its configuration. +func (r ApiActRunSyncGetRequest) Memory(memory float64) ApiActRunSyncGetRequest { + r.memory = &memory + return r +} + +// Specifies the maximum number of dataset items that will be charged for pay-per-result Actors. This does NOT guarantee that the Actor will return only this many items. It only ensures you won't be charged for more than this number of items. Only works for pay-per-result Actors. Value can be accessed in the actor run using `ACTOR_MAX_PAID_DATASET_ITEMS` environment variable. +func (r ApiActRunSyncGetRequest) MaxItems(maxItems float64) ApiActRunSyncGetRequest { + r.maxItems = &maxItems + return r +} + +// Specifies the maximum cost of the run. This parameter is useful for pay-per-event Actors, as it allows you to limit the amount charged to your subscription. You can access the maximum cost in your Actor by using the `ACTOR_MAX_TOTAL_CHARGE_USD` environment variable. +func (r ApiActRunSyncGetRequest) MaxTotalChargeUsd(maxTotalChargeUsd float64) ApiActRunSyncGetRequest { + r.maxTotalChargeUsd = &maxTotalChargeUsd + return r +} + +// Determines whether the run will be restarted if it fails. +func (r ApiActRunSyncGetRequest) RestartOnError(restartOnError bool) ApiActRunSyncGetRequest { + r.restartOnError = &restartOnError + return r +} + +// Specifies the Actor build to run. It can be either a build tag or build number. By default, the run uses the build from its configuration (typically `latest`). +func (r ApiActRunSyncGetRequest) Build(build string) ApiActRunSyncGetRequest { + r.build = &build + return r +} + +// Specifies optional webhooks associated with the Actor run, which can be used to receive a notification e.g. when the Actor finished or failed. The value is a Base64-encoded JSON array whose items follow the WebhookRepresentation schema. For more information, see [Webhooks documentation](https://docs.apify.com/platform/integrations/webhooks). +func (r ApiActRunSyncGetRequest) Webhooks(webhooks string) ApiActRunSyncGetRequest { + r.webhooks = &webhooks + return r +} + +func (r ApiActRunSyncGetRequest) Execute() (map[string]interface{}, *http.Response, error) { + return r.ApiService.ActRunSyncGetExecute(r) +} + +/* +ActRunSyncGet Run Actor synchronously without input + +Runs a specific Actor and returns its output. +The run must finish in 300<!-- MAX_ACTOR_JOB_SYNC_WAIT_SECS --> seconds +otherwise the API endpoint returns a timeout error. +The Actor is not passed any input. + +Beware that it might be impossible to maintain an idle HTTP connection for a +long period of time, +due to client timeout or network conditions. Make sure your HTTP client is +configured to have a long enough connection timeout. +If the connection breaks, you will not receive any information about the run +and its status. + +To run the Actor asynchronously, use the [Run +Actor](#/reference/actors/run-collection/run-actor) API endpoint instead. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param actorId Actor ID or a tilde-separated owner's username and Actor name. + @return ApiActRunSyncGetRequest +*/ +func (a *ActorsActorRunsAPIService) ActRunSyncGet(ctx context.Context, actorId string) ApiActRunSyncGetRequest { + return ApiActRunSyncGetRequest{ + ApiService: a, + ctx: ctx, + actorId: actorId, + } +} + +// Execute executes the request +// @return map[string]interface{} +func (a *ActorsActorRunsAPIService) ActRunSyncGetExecute(r ApiActRunSyncGetRequest) (map[string]interface{}, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue map[string]interface{} + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ActorsActorRunsAPIService.ActRunSyncGet") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/actors/{actorId}/run-sync" + localVarPath = strings.Replace(localVarPath, "{"+"actorId"+"}", url.PathEscape(parameterValueToString(r.actorId, "actorId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.outputRecordKey != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "outputRecordKey", r.outputRecordKey, "form", "") + } + if r.timeout != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "timeout", r.timeout, "form", "") + } + if r.memory != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "memory", r.memory, "form", "") + } + if r.maxItems != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "maxItems", r.maxItems, "form", "") + } + if r.maxTotalChargeUsd != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "maxTotalChargeUsd", r.maxTotalChargeUsd, "form", "") + } + if r.restartOnError != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "restartOnError", r.restartOnError, "form", "") + } + if r.build != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "build", r.build, "form", "") + } + if r.webhooks != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "webhooks", r.webhooks, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ActorRunFailedError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 408 { + var v ActorRunTimeoutExceededError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiActRunSyncGetDatasetItemsGetRequest struct { + ctx context.Context + ApiService *ActorsActorRunsAPIService + actorId string + timeout *float64 + memory *float64 + maxItems *float64 + maxTotalChargeUsd *float64 + restartOnError *bool + build *string + webhooks *string + format *string + clean *bool + offset *float64 + limit *float64 + fields *string + outputFields *string + omit *string + unwind *string + flatten *string + desc *bool + attachment *bool + delimiter *string + bom *bool + xmlRoot *string + xmlRow *string + skipHeaderRow *bool + skipHidden *bool + skipEmpty *bool + simplified *bool + view *string + skipFailedPages *bool + feedTitle *string + feedDescription *string +} + +// Optional timeout for the run, in seconds. By default, the run uses the timeout from its configuration. +func (r ApiActRunSyncGetDatasetItemsGetRequest) Timeout(timeout float64) ApiActRunSyncGetDatasetItemsGetRequest { + r.timeout = &timeout + return r +} + +// Memory limit for the run, in megabytes. The amount of memory can be set to a power of 2 with a minimum of 128. By default, the run uses the memory limit from its configuration. +func (r ApiActRunSyncGetDatasetItemsGetRequest) Memory(memory float64) ApiActRunSyncGetDatasetItemsGetRequest { + r.memory = &memory + return r +} + +// Specifies the maximum number of dataset items that will be charged for pay-per-result Actors. This does NOT guarantee that the Actor will return only this many items. It only ensures you won't be charged for more than this number of items. Only works for pay-per-result Actors. Value can be accessed in the actor run using `ACTOR_MAX_PAID_DATASET_ITEMS` environment variable. +func (r ApiActRunSyncGetDatasetItemsGetRequest) MaxItems(maxItems float64) ApiActRunSyncGetDatasetItemsGetRequest { + r.maxItems = &maxItems + return r +} + +// Specifies the maximum cost of the run. This parameter is useful for pay-per-event Actors, as it allows you to limit the amount charged to your subscription. You can access the maximum cost in your Actor by using the `ACTOR_MAX_TOTAL_CHARGE_USD` environment variable. +func (r ApiActRunSyncGetDatasetItemsGetRequest) MaxTotalChargeUsd(maxTotalChargeUsd float64) ApiActRunSyncGetDatasetItemsGetRequest { + r.maxTotalChargeUsd = &maxTotalChargeUsd + return r +} + +// Determines whether the run will be restarted if it fails. +func (r ApiActRunSyncGetDatasetItemsGetRequest) RestartOnError(restartOnError bool) ApiActRunSyncGetDatasetItemsGetRequest { + r.restartOnError = &restartOnError + return r +} + +// Specifies the Actor build to run. It can be either a build tag or build number. By default, the run uses the build from its configuration (typically `latest`). +func (r ApiActRunSyncGetDatasetItemsGetRequest) Build(build string) ApiActRunSyncGetDatasetItemsGetRequest { + r.build = &build + return r +} + +// Specifies optional webhooks associated with the Actor run, which can be used to receive a notification e.g. when the Actor finished or failed. The value is a Base64-encoded JSON array whose items follow the WebhookRepresentation schema. For more information, see [Webhooks documentation](https://docs.apify.com/platform/integrations/webhooks). +func (r ApiActRunSyncGetDatasetItemsGetRequest) Webhooks(webhooks string) ApiActRunSyncGetDatasetItemsGetRequest { + r.webhooks = &webhooks + return r +} + +// Format of the results, possible values are: `json`, `jsonl`, `csv`, `html`, `xlsx`, `xml` and `rss`. The default value is `json`. +func (r ApiActRunSyncGetDatasetItemsGetRequest) Format(format string) ApiActRunSyncGetDatasetItemsGetRequest { + r.format = &format + return r +} + +// If `true` or `1` then the API endpoint returns only non-empty items and skips hidden fields (i.e. fields starting with the # character). The `clean` parameter is just a shortcut for `skipHidden=true` and `skipEmpty=true` parameters. Note that since some objects might be skipped from the output, that the result might contain less items than the `limit` value. +func (r ApiActRunSyncGetDatasetItemsGetRequest) Clean(clean bool) ApiActRunSyncGetDatasetItemsGetRequest { + r.clean = &clean + return r +} + +// Number of items that should be skipped at the start. The default value is `0`. +func (r ApiActRunSyncGetDatasetItemsGetRequest) Offset(offset float64) ApiActRunSyncGetDatasetItemsGetRequest { + r.offset = &offset + return r +} + +// Maximum number of items to return. By default there is no limit. +func (r ApiActRunSyncGetDatasetItemsGetRequest) Limit(limit float64) ApiActRunSyncGetDatasetItemsGetRequest { + r.limit = &limit + return r +} + +// A comma-separated list of fields which should be picked from the items, only these fields will remain in the resulting record objects. Note that the fields in the outputted items are sorted the same way as they are specified in the `fields` query parameter. You can use this feature to effectively fix the output format. +func (r ApiActRunSyncGetDatasetItemsGetRequest) Fields(fields string) ApiActRunSyncGetDatasetItemsGetRequest { + r.fields = &fields + return r +} + +// A comma-separated list of output field names that positionally rename the fields specified in the `fields` parameter. For example, `?fields=headline,url&outputFields=title,link` renames `headline` to `title` and `url` to `link` in the output. The number of names in `outputFields` must match the number of names in `fields`. Requires the `fields` parameter to be specified as well. +func (r ApiActRunSyncGetDatasetItemsGetRequest) OutputFields(outputFields string) ApiActRunSyncGetDatasetItemsGetRequest { + r.outputFields = &outputFields + return r +} + +// A comma-separated list of fields which should be omitted from the items. +func (r ApiActRunSyncGetDatasetItemsGetRequest) Omit(omit string) ApiActRunSyncGetDatasetItemsGetRequest { + r.omit = &omit + return r +} + +// A comma-separated list of fields which should be unwound, in order which they should be processed. Each field should be either an array or an object. If the field is an array then every element of the array will become a separate record and merged with parent object. If the unwound field is an object then it is merged with the parent object. If the unwound field is missing or its value is neither an array nor an object and therefore cannot be merged with a parent object then the item gets preserved as it is. Note that the unwound items ignore the `desc` parameter. +func (r ApiActRunSyncGetDatasetItemsGetRequest) Unwind(unwind string) ApiActRunSyncGetDatasetItemsGetRequest { + r.unwind = &unwind + return r +} + +// A comma-separated list of fields which should transform nested objects into flat structures. For example, with `flatten=\"foo\"` the object `{\"foo\":{\"bar\": \"hello\"}}` is turned into `{\"foo.bar\": \"hello\"}`. The original object with properties is replaced with the flattened object. +func (r ApiActRunSyncGetDatasetItemsGetRequest) Flatten(flatten string) ApiActRunSyncGetDatasetItemsGetRequest { + r.flatten = &flatten + return r +} + +// By default, results are returned in the same order as they were stored. To reverse the order, set this parameter to `true` or `1`. +func (r ApiActRunSyncGetDatasetItemsGetRequest) Desc(desc bool) ApiActRunSyncGetDatasetItemsGetRequest { + r.desc = &desc + return r +} + +// If `true` or `1` then the response will define the `Content-Disposition: attachment` header, forcing a web browser to download the file rather than to display it. By default this header is not present. +func (r ApiActRunSyncGetDatasetItemsGetRequest) Attachment(attachment bool) ApiActRunSyncGetDatasetItemsGetRequest { + r.attachment = &attachment + return r +} + +// A delimiter character for CSV files, only used if `format=csv`. You might need to URL-encode the character (e.g. use `%09` for tab or `%3B` for semicolon). The default delimiter is a simple comma (`,`). +func (r ApiActRunSyncGetDatasetItemsGetRequest) Delimiter(delimiter string) ApiActRunSyncGetDatasetItemsGetRequest { + r.delimiter = &delimiter + return r +} + +// All text responses are encoded in UTF-8 encoding. By default, the `format=csv` files are prefixed with the UTF-8 Byte Order Mark (BOM), while `json`, `jsonl`, `xml`, `html` and `rss` files are not. If you want to override this default behavior, specify `bom=1` query parameter to include the BOM or `bom=0` to skip it. +func (r ApiActRunSyncGetDatasetItemsGetRequest) Bom(bom bool) ApiActRunSyncGetDatasetItemsGetRequest { + r.bom = &bom + return r +} + +// Overrides default root element name of `xml` output. By default the root element is `items`. +func (r ApiActRunSyncGetDatasetItemsGetRequest) XmlRoot(xmlRoot string) ApiActRunSyncGetDatasetItemsGetRequest { + r.xmlRoot = &xmlRoot + return r +} + +// Overrides default element name that wraps each page or page function result object in `xml` output. By default the element name is `item`. +func (r ApiActRunSyncGetDatasetItemsGetRequest) XmlRow(xmlRow string) ApiActRunSyncGetDatasetItemsGetRequest { + r.xmlRow = &xmlRow + return r +} + +// If `true` or `1` then header row in the `csv` format is skipped. +func (r ApiActRunSyncGetDatasetItemsGetRequest) SkipHeaderRow(skipHeaderRow bool) ApiActRunSyncGetDatasetItemsGetRequest { + r.skipHeaderRow = &skipHeaderRow + return r +} + +// If `true` or `1` then hidden fields are skipped from the output, i.e. fields starting with the `#` character. +func (r ApiActRunSyncGetDatasetItemsGetRequest) SkipHidden(skipHidden bool) ApiActRunSyncGetDatasetItemsGetRequest { + r.skipHidden = &skipHidden + return r +} + +// If `true` or `1` then empty items are skipped from the output. Note that if used, the results might contain less items than the limit value. +func (r ApiActRunSyncGetDatasetItemsGetRequest) SkipEmpty(skipEmpty bool) ApiActRunSyncGetDatasetItemsGetRequest { + r.skipEmpty = &skipEmpty + return r +} + +// If `true` or `1` then, the endpoint applies the `fields=url,pageFunctionResult,errorInfo` and `unwind=pageFunctionResult` query parameters. This feature is used to emulate simplified results provided by the legacy Apify Crawler product and it's not recommended to use it in new integrations. +func (r ApiActRunSyncGetDatasetItemsGetRequest) Simplified(simplified bool) ApiActRunSyncGetDatasetItemsGetRequest { + r.simplified = &simplified + return r +} + +// Defines the view configuration for dataset items based on the schema definition. This parameter determines how the data will be filtered and presented. For complete specification details, see the [dataset schema documentation](/platform/actors/development/actor-definition/dataset-schema). +func (r ApiActRunSyncGetDatasetItemsGetRequest) View(view string) ApiActRunSyncGetDatasetItemsGetRequest { + r.view = &view + return r +} + +// If `true` or `1` then, the all the items with errorInfo property will be skipped from the output. This feature is here to emulate functionality of API version 1 used for the legacy Apify Crawler product and it's not recommended to use it in new integrations. +func (r ApiActRunSyncGetDatasetItemsGetRequest) SkipFailedPages(skipFailedPages bool) ApiActRunSyncGetDatasetItemsGetRequest { + r.skipFailedPages = &skipFailedPages + return r +} + +// Overrides the auto-generated RSS channel `<title>` element. Only used when `format=rss`. If not provided, the title defaults to `Dataset <label>`. +func (r ApiActRunSyncGetDatasetItemsGetRequest) FeedTitle(feedTitle string) ApiActRunSyncGetDatasetItemsGetRequest { + r.feedTitle = &feedTitle + return r +} + +// Overrides the auto-generated RSS channel `<description>` element. Only used when `format=rss`. If not provided, the description defaults to `Items in dataset with id \"<datasetId>\".` +func (r ApiActRunSyncGetDatasetItemsGetRequest) FeedDescription(feedDescription string) ApiActRunSyncGetDatasetItemsGetRequest { + r.feedDescription = &feedDescription + return r +} + +func (r ApiActRunSyncGetDatasetItemsGetRequest) Execute() ([]map[string]interface{}, *http.Response, error) { + return r.ApiService.ActRunSyncGetDatasetItemsGetExecute(r) +} + +/* +ActRunSyncGetDatasetItemsGet Run Actor synchronously without input and get dataset items + +Runs a specific Actor and returns its dataset items. +The run must finish in 300<!-- MAX_ACTOR_JOB_SYNC_WAIT_SECS --> seconds +otherwise the API endpoint returns a timeout error. +The Actor is not passed any input. + +It allows to send all possible options in parameters from [Get Dataset +Items](#/reference/datasets/item-collection/get-items) API endpoint. + +Beware that it might be impossible to maintain an idle HTTP connection for a +long period of time, +due to client timeout or network conditions. Make sure your HTTP client is +configured to have a long enough connection timeout. +If the connection breaks, you will not receive any information about the run +and its status. + +To run the Actor asynchronously, use the [Run +Actor](#/reference/actors/run-collection/run-actor) API endpoint instead. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param actorId Actor ID or a tilde-separated owner's username and Actor name. + @return ApiActRunSyncGetDatasetItemsGetRequest +*/ +func (a *ActorsActorRunsAPIService) ActRunSyncGetDatasetItemsGet(ctx context.Context, actorId string) ApiActRunSyncGetDatasetItemsGetRequest { + return ApiActRunSyncGetDatasetItemsGetRequest{ + ApiService: a, + ctx: ctx, + actorId: actorId, + } +} + +// Execute executes the request +// @return []map[string]interface{} +func (a *ActorsActorRunsAPIService) ActRunSyncGetDatasetItemsGetExecute(r ApiActRunSyncGetDatasetItemsGetRequest) ([]map[string]interface{}, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []map[string]interface{} + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ActorsActorRunsAPIService.ActRunSyncGetDatasetItemsGet") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/actors/{actorId}/run-sync-get-dataset-items" + localVarPath = strings.Replace(localVarPath, "{"+"actorId"+"}", url.PathEscape(parameterValueToString(r.actorId, "actorId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.timeout != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "timeout", r.timeout, "form", "") + } + if r.memory != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "memory", r.memory, "form", "") + } + if r.maxItems != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "maxItems", r.maxItems, "form", "") + } + if r.maxTotalChargeUsd != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "maxTotalChargeUsd", r.maxTotalChargeUsd, "form", "") + } + if r.restartOnError != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "restartOnError", r.restartOnError, "form", "") + } + if r.build != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "build", r.build, "form", "") + } + if r.webhooks != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "webhooks", r.webhooks, "form", "") + } + if r.format != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "format", r.format, "form", "") + } + if r.clean != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "clean", r.clean, "form", "") + } + if r.offset != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "form", "") + } + if r.limit != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "form", "") + } + if r.fields != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "fields", r.fields, "form", "") + } + if r.outputFields != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "outputFields", r.outputFields, "form", "") + } + if r.omit != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "omit", r.omit, "form", "") + } + if r.unwind != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "unwind", r.unwind, "form", "") + } + if r.flatten != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "flatten", r.flatten, "form", "") + } + if r.desc != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "desc", r.desc, "form", "") + } + if r.attachment != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "attachment", r.attachment, "form", "") + } + if r.delimiter != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "delimiter", r.delimiter, "form", "") + } + if r.bom != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "bom", r.bom, "form", "") + } + if r.xmlRoot != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "xmlRoot", r.xmlRoot, "form", "") + } + if r.xmlRow != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "xmlRow", r.xmlRow, "form", "") + } + if r.skipHeaderRow != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "skipHeaderRow", r.skipHeaderRow, "form", "") + } + if r.skipHidden != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "skipHidden", r.skipHidden, "form", "") + } + if r.skipEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "skipEmpty", r.skipEmpty, "form", "") + } + if r.simplified != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "simplified", r.simplified, "form", "") + } + if r.view != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "view", r.view, "form", "") + } + if r.skipFailedPages != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "skipFailedPages", r.skipFailedPages, "form", "") + } + if r.feedTitle != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "feedTitle", r.feedTitle, "form", "") + } + if r.feedDescription != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "feedDescription", r.feedDescription, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ActorRunFailedError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 408 { + var v ActorRunTimeoutExceededError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiActRunSyncGetDatasetItemsPostRequest struct { + ctx context.Context + ApiService *ActorsActorRunsAPIService + actorId string + body *map[string]interface{} + timeout *float64 + memory *float64 + maxItems *float64 + maxTotalChargeUsd *float64 + restartOnError *bool + build *string + webhooks *string + format *string + clean *bool + offset *float64 + limit *float64 + fields *string + outputFields *string + omit *string + unwind *string + flatten *string + desc *bool + attachment *bool + delimiter *string + bom *bool + xmlRoot *string + xmlRow *string + skipHeaderRow *bool + skipHidden *bool + skipEmpty *bool + simplified *bool + view *string + skipFailedPages *bool + feedTitle *string + feedDescription *string +} + +// +func (r ApiActRunSyncGetDatasetItemsPostRequest) Body(body map[string]interface{}) ApiActRunSyncGetDatasetItemsPostRequest { + r.body = &body + return r +} + +// Optional timeout for the run, in seconds. By default, the run uses the timeout from its configuration. +func (r ApiActRunSyncGetDatasetItemsPostRequest) Timeout(timeout float64) ApiActRunSyncGetDatasetItemsPostRequest { + r.timeout = &timeout + return r +} + +// Memory limit for the run, in megabytes. The amount of memory can be set to a power of 2 with a minimum of 128. By default, the run uses the memory limit from its configuration. +func (r ApiActRunSyncGetDatasetItemsPostRequest) Memory(memory float64) ApiActRunSyncGetDatasetItemsPostRequest { + r.memory = &memory + return r +} + +// Specifies the maximum number of dataset items that will be charged for pay-per-result Actors. This does NOT guarantee that the Actor will return only this many items. It only ensures you won't be charged for more than this number of items. Only works for pay-per-result Actors. Value can be accessed in the actor run using `ACTOR_MAX_PAID_DATASET_ITEMS` environment variable. +func (r ApiActRunSyncGetDatasetItemsPostRequest) MaxItems(maxItems float64) ApiActRunSyncGetDatasetItemsPostRequest { + r.maxItems = &maxItems + return r +} + +// Specifies the maximum cost of the run. This parameter is useful for pay-per-event Actors, as it allows you to limit the amount charged to your subscription. You can access the maximum cost in your Actor by using the `ACTOR_MAX_TOTAL_CHARGE_USD` environment variable. +func (r ApiActRunSyncGetDatasetItemsPostRequest) MaxTotalChargeUsd(maxTotalChargeUsd float64) ApiActRunSyncGetDatasetItemsPostRequest { + r.maxTotalChargeUsd = &maxTotalChargeUsd + return r +} + +// Determines whether the run will be restarted if it fails. +func (r ApiActRunSyncGetDatasetItemsPostRequest) RestartOnError(restartOnError bool) ApiActRunSyncGetDatasetItemsPostRequest { + r.restartOnError = &restartOnError + return r +} + +// Specifies the Actor build to run. It can be either a build tag or build number. By default, the run uses the build from its configuration (typically `latest`). +func (r ApiActRunSyncGetDatasetItemsPostRequest) Build(build string) ApiActRunSyncGetDatasetItemsPostRequest { + r.build = &build + return r +} + +// Specifies optional webhooks associated with the Actor run, which can be used to receive a notification e.g. when the Actor finished or failed. The value is a Base64-encoded JSON array whose items follow the WebhookRepresentation schema. For more information, see [Webhooks documentation](https://docs.apify.com/platform/integrations/webhooks). +func (r ApiActRunSyncGetDatasetItemsPostRequest) Webhooks(webhooks string) ApiActRunSyncGetDatasetItemsPostRequest { + r.webhooks = &webhooks + return r +} + +// Format of the results, possible values are: `json`, `jsonl`, `csv`, `html`, `xlsx`, `xml` and `rss`. The default value is `json`. +func (r ApiActRunSyncGetDatasetItemsPostRequest) Format(format string) ApiActRunSyncGetDatasetItemsPostRequest { + r.format = &format + return r +} + +// If `true` or `1` then the API endpoint returns only non-empty items and skips hidden fields (i.e. fields starting with the # character). The `clean` parameter is just a shortcut for `skipHidden=true` and `skipEmpty=true` parameters. Note that since some objects might be skipped from the output, that the result might contain less items than the `limit` value. +func (r ApiActRunSyncGetDatasetItemsPostRequest) Clean(clean bool) ApiActRunSyncGetDatasetItemsPostRequest { + r.clean = &clean + return r +} + +// Number of items that should be skipped at the start. The default value is `0`. +func (r ApiActRunSyncGetDatasetItemsPostRequest) Offset(offset float64) ApiActRunSyncGetDatasetItemsPostRequest { + r.offset = &offset + return r +} + +// Maximum number of items to return. By default there is no limit. +func (r ApiActRunSyncGetDatasetItemsPostRequest) Limit(limit float64) ApiActRunSyncGetDatasetItemsPostRequest { + r.limit = &limit + return r +} + +// A comma-separated list of fields which should be picked from the items, only these fields will remain in the resulting record objects. Note that the fields in the outputted items are sorted the same way as they are specified in the `fields` query parameter. You can use this feature to effectively fix the output format. +func (r ApiActRunSyncGetDatasetItemsPostRequest) Fields(fields string) ApiActRunSyncGetDatasetItemsPostRequest { + r.fields = &fields + return r +} + +// A comma-separated list of output field names that positionally rename the fields specified in the `fields` parameter. For example, `?fields=headline,url&outputFields=title,link` renames `headline` to `title` and `url` to `link` in the output. The number of names in `outputFields` must match the number of names in `fields`. Requires the `fields` parameter to be specified as well. +func (r ApiActRunSyncGetDatasetItemsPostRequest) OutputFields(outputFields string) ApiActRunSyncGetDatasetItemsPostRequest { + r.outputFields = &outputFields + return r +} + +// A comma-separated list of fields which should be omitted from the items. +func (r ApiActRunSyncGetDatasetItemsPostRequest) Omit(omit string) ApiActRunSyncGetDatasetItemsPostRequest { + r.omit = &omit + return r +} + +// A comma-separated list of fields which should be unwound, in order which they should be processed. Each field should be either an array or an object. If the field is an array then every element of the array will become a separate record and merged with parent object. If the unwound field is an object then it is merged with the parent object. If the unwound field is missing or its value is neither an array nor an object and therefore cannot be merged with a parent object then the item gets preserved as it is. Note that the unwound items ignore the `desc` parameter. +func (r ApiActRunSyncGetDatasetItemsPostRequest) Unwind(unwind string) ApiActRunSyncGetDatasetItemsPostRequest { + r.unwind = &unwind + return r +} + +// A comma-separated list of fields which should transform nested objects into flat structures. For example, with `flatten=\"foo\"` the object `{\"foo\":{\"bar\": \"hello\"}}` is turned into `{\"foo.bar\": \"hello\"}`. The original object with properties is replaced with the flattened object. +func (r ApiActRunSyncGetDatasetItemsPostRequest) Flatten(flatten string) ApiActRunSyncGetDatasetItemsPostRequest { + r.flatten = &flatten + return r +} + +// By default, results are returned in the same order as they were stored. To reverse the order, set this parameter to `true` or `1`. +func (r ApiActRunSyncGetDatasetItemsPostRequest) Desc(desc bool) ApiActRunSyncGetDatasetItemsPostRequest { + r.desc = &desc + return r +} + +// If `true` or `1` then the response will define the `Content-Disposition: attachment` header, forcing a web browser to download the file rather than to display it. By default this header is not present. +func (r ApiActRunSyncGetDatasetItemsPostRequest) Attachment(attachment bool) ApiActRunSyncGetDatasetItemsPostRequest { + r.attachment = &attachment + return r +} + +// A delimiter character for CSV files, only used if `format=csv`. You might need to URL-encode the character (e.g. use `%09` for tab or `%3B` for semicolon). The default delimiter is a simple comma (`,`). +func (r ApiActRunSyncGetDatasetItemsPostRequest) Delimiter(delimiter string) ApiActRunSyncGetDatasetItemsPostRequest { + r.delimiter = &delimiter + return r +} + +// All text responses are encoded in UTF-8 encoding. By default, the `format=csv` files are prefixed with the UTF-8 Byte Order Mark (BOM), while `json`, `jsonl`, `xml`, `html` and `rss` files are not. If you want to override this default behavior, specify `bom=1` query parameter to include the BOM or `bom=0` to skip it. +func (r ApiActRunSyncGetDatasetItemsPostRequest) Bom(bom bool) ApiActRunSyncGetDatasetItemsPostRequest { + r.bom = &bom + return r +} + +// Overrides default root element name of `xml` output. By default the root element is `items`. +func (r ApiActRunSyncGetDatasetItemsPostRequest) XmlRoot(xmlRoot string) ApiActRunSyncGetDatasetItemsPostRequest { + r.xmlRoot = &xmlRoot + return r +} + +// Overrides default element name that wraps each page or page function result object in `xml` output. By default the element name is `item`. +func (r ApiActRunSyncGetDatasetItemsPostRequest) XmlRow(xmlRow string) ApiActRunSyncGetDatasetItemsPostRequest { + r.xmlRow = &xmlRow + return r +} + +// If `true` or `1` then header row in the `csv` format is skipped. +func (r ApiActRunSyncGetDatasetItemsPostRequest) SkipHeaderRow(skipHeaderRow bool) ApiActRunSyncGetDatasetItemsPostRequest { + r.skipHeaderRow = &skipHeaderRow + return r +} + +// If `true` or `1` then hidden fields are skipped from the output, i.e. fields starting with the `#` character. +func (r ApiActRunSyncGetDatasetItemsPostRequest) SkipHidden(skipHidden bool) ApiActRunSyncGetDatasetItemsPostRequest { + r.skipHidden = &skipHidden + return r +} + +// If `true` or `1` then empty items are skipped from the output. Note that if used, the results might contain less items than the limit value. +func (r ApiActRunSyncGetDatasetItemsPostRequest) SkipEmpty(skipEmpty bool) ApiActRunSyncGetDatasetItemsPostRequest { + r.skipEmpty = &skipEmpty + return r +} + +// If `true` or `1` then, the endpoint applies the `fields=url,pageFunctionResult,errorInfo` and `unwind=pageFunctionResult` query parameters. This feature is used to emulate simplified results provided by the legacy Apify Crawler product and it's not recommended to use it in new integrations. +func (r ApiActRunSyncGetDatasetItemsPostRequest) Simplified(simplified bool) ApiActRunSyncGetDatasetItemsPostRequest { + r.simplified = &simplified + return r +} + +// Defines the view configuration for dataset items based on the schema definition. This parameter determines how the data will be filtered and presented. For complete specification details, see the [dataset schema documentation](/platform/actors/development/actor-definition/dataset-schema). +func (r ApiActRunSyncGetDatasetItemsPostRequest) View(view string) ApiActRunSyncGetDatasetItemsPostRequest { + r.view = &view + return r +} + +// If `true` or `1` then, the all the items with errorInfo property will be skipped from the output. This feature is here to emulate functionality of API version 1 used for the legacy Apify Crawler product and it's not recommended to use it in new integrations. +func (r ApiActRunSyncGetDatasetItemsPostRequest) SkipFailedPages(skipFailedPages bool) ApiActRunSyncGetDatasetItemsPostRequest { + r.skipFailedPages = &skipFailedPages + return r +} + +// Overrides the auto-generated RSS channel `<title>` element. Only used when `format=rss`. If not provided, the title defaults to `Dataset <label>`. +func (r ApiActRunSyncGetDatasetItemsPostRequest) FeedTitle(feedTitle string) ApiActRunSyncGetDatasetItemsPostRequest { + r.feedTitle = &feedTitle + return r +} + +// Overrides the auto-generated RSS channel `<description>` element. Only used when `format=rss`. If not provided, the description defaults to `Items in dataset with id \"<datasetId>\".` +func (r ApiActRunSyncGetDatasetItemsPostRequest) FeedDescription(feedDescription string) ApiActRunSyncGetDatasetItemsPostRequest { + r.feedDescription = &feedDescription + return r +} + +func (r ApiActRunSyncGetDatasetItemsPostRequest) Execute() ([]map[string]interface{}, *http.Response, error) { + return r.ApiService.ActRunSyncGetDatasetItemsPostExecute(r) +} + +/* +ActRunSyncGetDatasetItemsPost Run Actor synchronously and get dataset items + +Runs a specific Actor and returns its dataset items. + +The POST payload including its `Content-Type` header is passed as `INPUT` to +the Actor (usually `application/json`). +The HTTP response contains the Actors dataset items, while the format of +items depends on specifying dataset items' `format` parameter. + +You can send all the same options in parameters as the [Get Dataset +Items](#/reference/datasets/item-collection/get-items) API endpoint. + +The Actor is started with the default options; you can override them using +URL query parameters. +If the Actor run exceeds 300<!-- MAX_ACTOR_JOB_SYNC_WAIT_SECS --> seconds, +the HTTP response will return the 408 status code (Request Timeout). + +Beware that it might be impossible to maintain an idle HTTP connection for a +long period of time, +due to client timeout or network conditions. Make sure your HTTP client is +configured to have a long enough connection timeout. +If the connection breaks, you will not receive any information about the run +and its status. + +To run the Actor asynchronously, use the [Run +Actor](#/reference/actors/run-collection/run-actor) API endpoint instead. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param actorId Actor ID or a tilde-separated owner's username and Actor name. + @return ApiActRunSyncGetDatasetItemsPostRequest +*/ +func (a *ActorsActorRunsAPIService) ActRunSyncGetDatasetItemsPost(ctx context.Context, actorId string) ApiActRunSyncGetDatasetItemsPostRequest { + return ApiActRunSyncGetDatasetItemsPostRequest{ + ApiService: a, + ctx: ctx, + actorId: actorId, + } +} + +// Execute executes the request +// @return []map[string]interface{} +func (a *ActorsActorRunsAPIService) ActRunSyncGetDatasetItemsPostExecute(r ApiActRunSyncGetDatasetItemsPostRequest) ([]map[string]interface{}, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []map[string]interface{} + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ActorsActorRunsAPIService.ActRunSyncGetDatasetItemsPost") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/actors/{actorId}/run-sync-get-dataset-items" + localVarPath = strings.Replace(localVarPath, "{"+"actorId"+"}", url.PathEscape(parameterValueToString(r.actorId, "actorId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.body == nil { + return localVarReturnValue, nil, reportError("body is required and must be specified") + } + + if r.timeout != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "timeout", r.timeout, "form", "") + } + if r.memory != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "memory", r.memory, "form", "") + } + if r.maxItems != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "maxItems", r.maxItems, "form", "") + } + if r.maxTotalChargeUsd != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "maxTotalChargeUsd", r.maxTotalChargeUsd, "form", "") + } + if r.restartOnError != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "restartOnError", r.restartOnError, "form", "") + } + if r.build != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "build", r.build, "form", "") + } + if r.webhooks != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "webhooks", r.webhooks, "form", "") + } + if r.format != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "format", r.format, "form", "") + } + if r.clean != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "clean", r.clean, "form", "") + } + if r.offset != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "form", "") + } + if r.limit != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "form", "") + } + if r.fields != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "fields", r.fields, "form", "") + } + if r.outputFields != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "outputFields", r.outputFields, "form", "") + } + if r.omit != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "omit", r.omit, "form", "") + } + if r.unwind != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "unwind", r.unwind, "form", "") + } + if r.flatten != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "flatten", r.flatten, "form", "") + } + if r.desc != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "desc", r.desc, "form", "") + } + if r.attachment != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "attachment", r.attachment, "form", "") + } + if r.delimiter != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "delimiter", r.delimiter, "form", "") + } + if r.bom != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "bom", r.bom, "form", "") + } + if r.xmlRoot != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "xmlRoot", r.xmlRoot, "form", "") + } + if r.xmlRow != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "xmlRow", r.xmlRow, "form", "") + } + if r.skipHeaderRow != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "skipHeaderRow", r.skipHeaderRow, "form", "") + } + if r.skipHidden != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "skipHidden", r.skipHidden, "form", "") + } + if r.skipEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "skipEmpty", r.skipEmpty, "form", "") + } + if r.simplified != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "simplified", r.simplified, "form", "") + } + if r.view != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "view", r.view, "form", "") + } + if r.skipFailedPages != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "skipFailedPages", r.skipFailedPages, "form", "") + } + if r.feedTitle != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "feedTitle", r.feedTitle, "form", "") + } + if r.feedDescription != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "feedDescription", r.feedDescription, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.body + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ActorRunFailedError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 402 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 408 { + var v ActorRunTimeoutExceededError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiActRunSyncPostRequest struct { + ctx context.Context + ApiService *ActorsActorRunsAPIService + actorId string + body *map[string]interface{} + outputRecordKey *string + timeout *float64 + memory *float64 + maxItems *float64 + maxTotalChargeUsd *float64 + restartOnError *bool + build *string + webhooks *string +} + +// +func (r ApiActRunSyncPostRequest) Body(body map[string]interface{}) ApiActRunSyncPostRequest { + r.body = &body + return r +} + +// Key of the record from run's default key-value store to be returned in the response. By default, it is `OUTPUT`. +func (r ApiActRunSyncPostRequest) OutputRecordKey(outputRecordKey string) ApiActRunSyncPostRequest { + r.outputRecordKey = &outputRecordKey + return r +} + +// Optional timeout for the run, in seconds. By default, the run uses the timeout from its configuration. +func (r ApiActRunSyncPostRequest) Timeout(timeout float64) ApiActRunSyncPostRequest { + r.timeout = &timeout + return r +} + +// Memory limit for the run, in megabytes. The amount of memory can be set to a power of 2 with a minimum of 128. By default, the run uses the memory limit from its configuration. +func (r ApiActRunSyncPostRequest) Memory(memory float64) ApiActRunSyncPostRequest { + r.memory = &memory + return r +} + +// Specifies the maximum number of dataset items that will be charged for pay-per-result Actors. This does NOT guarantee that the Actor will return only this many items. It only ensures you won't be charged for more than this number of items. Only works for pay-per-result Actors. Value can be accessed in the actor run using `ACTOR_MAX_PAID_DATASET_ITEMS` environment variable. +func (r ApiActRunSyncPostRequest) MaxItems(maxItems float64) ApiActRunSyncPostRequest { + r.maxItems = &maxItems + return r +} + +// Specifies the maximum cost of the run. This parameter is useful for pay-per-event Actors, as it allows you to limit the amount charged to your subscription. You can access the maximum cost in your Actor by using the `ACTOR_MAX_TOTAL_CHARGE_USD` environment variable. +func (r ApiActRunSyncPostRequest) MaxTotalChargeUsd(maxTotalChargeUsd float64) ApiActRunSyncPostRequest { + r.maxTotalChargeUsd = &maxTotalChargeUsd + return r +} + +// Determines whether the run will be restarted if it fails. +func (r ApiActRunSyncPostRequest) RestartOnError(restartOnError bool) ApiActRunSyncPostRequest { + r.restartOnError = &restartOnError + return r +} + +// Specifies the Actor build to run. It can be either a build tag or build number. By default, the run uses the build from its configuration (typically `latest`). +func (r ApiActRunSyncPostRequest) Build(build string) ApiActRunSyncPostRequest { + r.build = &build + return r +} + +// Specifies optional webhooks associated with the Actor run, which can be used to receive a notification e.g. when the Actor finished or failed. The value is a Base64-encoded JSON array whose items follow the WebhookRepresentation schema. For more information, see [Webhooks documentation](https://docs.apify.com/platform/integrations/webhooks). +func (r ApiActRunSyncPostRequest) Webhooks(webhooks string) ApiActRunSyncPostRequest { + r.webhooks = &webhooks + return r +} + +func (r ApiActRunSyncPostRequest) Execute() (map[string]interface{}, *http.Response, error) { + return r.ApiService.ActRunSyncPostExecute(r) +} + +/* +ActRunSyncPost Run Actor synchronously and return output + +Runs a specific Actor and returns its output. + +The POST payload including its `Content-Type` header is passed as `INPUT` to +the Actor (usually <code>application/json</code>). +The HTTP response contains Actors `OUTPUT` record from its default +key-value store. + +The Actor is started with the default options; you can override them using +various URL query parameters. +If the Actor run exceeds 300<!-- MAX_ACTOR_JOB_SYNC_WAIT_SECS --> seconds, +the HTTP response will have status 408 (Request Timeout). + +Beware that it might be impossible to maintain an idle HTTP connection for a +long period of time, due to client timeout or network conditions. Make sure your HTTP client is +configured to have a long enough connection timeout. +If the connection breaks, you will not receive any information about the run +and its status. + +To run the Actor asynchronously, use the [Run +Actor](#/reference/actors/run-collection/run-actor) API endpoint instead. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param actorId Actor ID or a tilde-separated owner's username and Actor name. + @return ApiActRunSyncPostRequest +*/ +func (a *ActorsActorRunsAPIService) ActRunSyncPost(ctx context.Context, actorId string) ApiActRunSyncPostRequest { + return ApiActRunSyncPostRequest{ + ApiService: a, + ctx: ctx, + actorId: actorId, + } +} + +// Execute executes the request +// @return map[string]interface{} +func (a *ActorsActorRunsAPIService) ActRunSyncPostExecute(r ApiActRunSyncPostRequest) (map[string]interface{}, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue map[string]interface{} + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ActorsActorRunsAPIService.ActRunSyncPost") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/actors/{actorId}/run-sync" + localVarPath = strings.Replace(localVarPath, "{"+"actorId"+"}", url.PathEscape(parameterValueToString(r.actorId, "actorId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.body == nil { + return localVarReturnValue, nil, reportError("body is required and must be specified") + } + + if r.outputRecordKey != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "outputRecordKey", r.outputRecordKey, "form", "") + } + if r.timeout != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "timeout", r.timeout, "form", "") + } + if r.memory != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "memory", r.memory, "form", "") + } + if r.maxItems != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "maxItems", r.maxItems, "form", "") + } + if r.maxTotalChargeUsd != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "maxTotalChargeUsd", r.maxTotalChargeUsd, "form", "") + } + if r.restartOnError != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "restartOnError", r.restartOnError, "form", "") + } + if r.build != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "build", r.build, "form", "") + } + if r.webhooks != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "webhooks", r.webhooks, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.body + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ActorRunFailedError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 402 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 408 { + var v ActorRunTimeoutExceededError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 415 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiActRunsGetRequest struct { + ctx context.Context + ApiService *ActorsActorRunsAPIService + actorId string + offset *float64 + limit *float64 + desc *bool + status *[]string + startedAfter *time.Time + startedBefore *time.Time +} + +// Number of items that should be skipped at the start. The default value is `0`. +func (r ApiActRunsGetRequest) Offset(offset float64) ApiActRunsGetRequest { + r.offset = &offset + return r +} + +// Maximum number of items to return. The default value as well as the maximum is `1000`. +func (r ApiActRunsGetRequest) Limit(limit float64) ApiActRunsGetRequest { + r.limit = &limit + return r +} + +// If `true` or `1` then the objects are sorted by the `startedAt` field in descending order. By default, they are sorted in ascending order. +func (r ApiActRunsGetRequest) Desc(desc bool) ApiActRunsGetRequest { + r.desc = &desc + return r +} + +// Single status or comma-separated list of statuses, see ([available statuses](https://docs.apify.com/platform/actors/running/runs-and-builds#lifecycle)). Used to filter runs by the specified statuses only. +func (r ApiActRunsGetRequest) Status(status []string) ApiActRunsGetRequest { + r.status = &status + return r +} + +// Filter runs that started after the specified date and time (inclusive). The value must be a valid ISO 8601 datetime string (UTC). +func (r ApiActRunsGetRequest) StartedAfter(startedAfter time.Time) ApiActRunsGetRequest { + r.startedAfter = &startedAfter + return r +} + +// Filter runs that started before the specified date and time (inclusive). The value must be a valid ISO 8601 datetime string (UTC). +func (r ApiActRunsGetRequest) StartedBefore(startedBefore time.Time) ApiActRunsGetRequest { + r.startedBefore = &startedBefore + return r +} + +func (r ApiActRunsGetRequest) Execute() (*ListOfRunsResponse, *http.Response, error) { + return r.ApiService.ActRunsGetExecute(r) +} + +/* +ActRunsGet Get list of runs + +Gets the list of runs of a specific Actor. The response is a list of +objects, where each object contains basic information about a single Actor run. + +The endpoint supports pagination using the `limit` and `offset` parameters +and it will not return more than 1000 array elements. + +By default, the records are sorted by the `startedAt` field in ascending +order, therefore you can use pagination to incrementally fetch all records while +new ones are still being created. To sort the records in descending order, use +`desc=1` parameter. You can also filter runs by status ([available +statuses](https://docs.apify.com/platform/actors/running/runs-and-builds#lifecycle)). + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param actorId Actor ID or a tilde-separated owner's username and Actor name. + @return ApiActRunsGetRequest +*/ +func (a *ActorsActorRunsAPIService) ActRunsGet(ctx context.Context, actorId string) ApiActRunsGetRequest { + return ApiActRunsGetRequest{ + ApiService: a, + ctx: ctx, + actorId: actorId, + } +} + +// Execute executes the request +// @return ListOfRunsResponse +func (a *ActorsActorRunsAPIService) ActRunsGetExecute(r ApiActRunsGetRequest) (*ListOfRunsResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ListOfRunsResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ActorsActorRunsAPIService.ActRunsGet") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/actors/{actorId}/runs" + localVarPath = strings.Replace(localVarPath, "{"+"actorId"+"}", url.PathEscape(parameterValueToString(r.actorId, "actorId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.offset != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "form", "") + } + if r.limit != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "form", "") + } + if r.desc != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "desc", r.desc, "form", "") + } + if r.status != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "status", r.status, "form", "csv") + } + if r.startedAfter != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "startedAfter", r.startedAfter, "form", "") + } + if r.startedBefore != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "startedBefore", r.startedBefore, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiActRunsLastGetRequest struct { + ctx context.Context + ApiService *ActorsActorRunsAPIService + actorId string + status *string + waitForFinish *float64 +} + +// Filter for the run status. +func (r ApiActRunsLastGetRequest) Status(status string) ApiActRunsLastGetRequest { + r.status = &status + return r +} + +// The maximum number of seconds the server waits for the run to finish. By default it is `0`, the maximum value is `60`. <!-- MAX_ACTOR_JOB_ASYNC_WAIT_SECS --> If the run finishes in time then the returned run object will have a terminal status (e.g. `SUCCEEDED`), otherwise it will have a transitional status (e.g. `RUNNING`). +func (r ApiActRunsLastGetRequest) WaitForFinish(waitForFinish float64) ApiActRunsLastGetRequest { + r.waitForFinish = &waitForFinish + return r +} + +func (r ApiActRunsLastGetRequest) Execute() (*RunResponse, *http.Response, error) { + return r.ApiService.ActRunsLastGetExecute(r) +} + +/* +ActRunsLastGet Get last run + +This is not a single endpoint, but an entire group of endpoints that lets you to +retrieve and manage the last run of given Actor or any of its default storages. +All the endpoints require an authentication token. + +The base path represents the last Actor run object is: + +`/v2/actors/{actorId}/runs/last{?token,status}` + +Using the `status` query parameter you can ensure to only get a run with a certain status +(e.g. `status=SUCCEEDED`). The output of this endpoint and other query parameters +are the same as in the [Run object](#/reference/actors/run-object) endpoint. + +##### Convenience endpoints for last Actor run + +* [Dataset](/api/v2/last-actor-runs-default-dataset) + +* [Key-value store](/api/v2/last-actor-runs-default-key-value-store) + +* [Request queue](/api/v2/last-actor-runs-default-request-queue) + +* [Log](/api/v2/last-actor-runs-log) + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param actorId Actor ID or a tilde-separated owner's username and Actor name. + @return ApiActRunsLastGetRequest +*/ +func (a *ActorsActorRunsAPIService) ActRunsLastGet(ctx context.Context, actorId string) ApiActRunsLastGetRequest { + return ApiActRunsLastGetRequest{ + ApiService: a, + ctx: ctx, + actorId: actorId, + } +} + +// Execute executes the request +// @return RunResponse +func (a *ActorsActorRunsAPIService) ActRunsLastGetExecute(r ApiActRunsLastGetRequest) (*RunResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *RunResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ActorsActorRunsAPIService.ActRunsLastGet") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/actors/{actorId}/runs/last" + localVarPath = strings.Replace(localVarPath, "{"+"actorId"+"}", url.PathEscape(parameterValueToString(r.actorId, "actorId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.status != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "status", r.status, "form", "") + } + if r.waitForFinish != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "waitForFinish", r.waitForFinish, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiActRunsPostRequest struct { + ctx context.Context + ApiService *ActorsActorRunsAPIService + actorId string + body *map[string]interface{} + timeout *float64 + memory *float64 + maxItems *float64 + maxTotalChargeUsd *float64 + restartOnError *bool + build *string + waitForFinish *float64 + webhooks *string + forcePermissionLevel *string +} + +// +func (r ApiActRunsPostRequest) Body(body map[string]interface{}) ApiActRunsPostRequest { + r.body = &body + return r +} + +// Optional timeout for the run, in seconds. By default, the run uses the timeout from its configuration. +func (r ApiActRunsPostRequest) Timeout(timeout float64) ApiActRunsPostRequest { + r.timeout = &timeout + return r +} + +// Memory limit for the run, in megabytes. The amount of memory can be set to a power of 2 with a minimum of 128. By default, the run uses the memory limit from its configuration. +func (r ApiActRunsPostRequest) Memory(memory float64) ApiActRunsPostRequest { + r.memory = &memory + return r +} + +// Specifies the maximum number of dataset items that will be charged for pay-per-result Actors. This does NOT guarantee that the Actor will return only this many items. It only ensures you won't be charged for more than this number of items. Only works for pay-per-result Actors. Value can be accessed in the actor run using `ACTOR_MAX_PAID_DATASET_ITEMS` environment variable. +func (r ApiActRunsPostRequest) MaxItems(maxItems float64) ApiActRunsPostRequest { + r.maxItems = &maxItems + return r +} + +// Specifies the maximum cost of the run. This parameter is useful for pay-per-event Actors, as it allows you to limit the amount charged to your subscription. You can access the maximum cost in your Actor by using the `ACTOR_MAX_TOTAL_CHARGE_USD` environment variable. +func (r ApiActRunsPostRequest) MaxTotalChargeUsd(maxTotalChargeUsd float64) ApiActRunsPostRequest { + r.maxTotalChargeUsd = &maxTotalChargeUsd + return r +} + +// Determines whether the run will be restarted if it fails. +func (r ApiActRunsPostRequest) RestartOnError(restartOnError bool) ApiActRunsPostRequest { + r.restartOnError = &restartOnError + return r +} + +// Specifies the Actor build to run. It can be either a build tag or build number. By default, the run uses the build from its configuration (typically `latest`). +func (r ApiActRunsPostRequest) Build(build string) ApiActRunsPostRequest { + r.build = &build + return r +} + +// The maximum number of seconds the server waits for the run to finish. By default it is `0`, the maximum value is `60`. <!-- MAX_ACTOR_JOB_ASYNC_WAIT_SECS --> If the run finishes in time then the returned run object will have a terminal status (e.g. `SUCCEEDED`), otherwise it will have a transitional status (e.g. `RUNNING`). +func (r ApiActRunsPostRequest) WaitForFinish(waitForFinish float64) ApiActRunsPostRequest { + r.waitForFinish = &waitForFinish + return r +} + +// Specifies optional webhooks associated with the Actor run, which can be used to receive a notification e.g. when the Actor finished or failed. The value is a Base64-encoded JSON array whose items follow the WebhookRepresentation schema. For more information, see [Webhooks documentation](https://docs.apify.com/platform/integrations/webhooks). +func (r ApiActRunsPostRequest) Webhooks(webhooks string) ApiActRunsPostRequest { + r.webhooks = &webhooks + return r +} + +// Overrides the Actor's permission level for this specific run. Use to test restricted permissions before deploying changes to your Actor or to temporarily elevate or restrict access. If you don't specify this parameter, the Actor uses its configured default permission level. For more information on permissions, see the [documentation](https://docs.apify.com/platform/actors/development/permissions). +func (r ApiActRunsPostRequest) ForcePermissionLevel(forcePermissionLevel string) ApiActRunsPostRequest { + r.forcePermissionLevel = &forcePermissionLevel + return r +} + +func (r ApiActRunsPostRequest) Execute() (*RunResponse, *http.Response, error) { + return r.ApiService.ActRunsPostExecute(r) +} + +/* +ActRunsPost Run Actor + +Runs an Actor and immediately returns without waiting for the run to finish. + +The POST payload including its `Content-Type` header is passed as `INPUT` to +the Actor (usually `application/json`). + +The Actor is started with the default options; you can override them using +various URL query parameters. + +The response is the Run object as returned by the [Get +run](#/reference/actor-runs/run-object-and-its-storages/get-run) API +endpoint. + +If you want to wait for the run to finish and receive the actual output of +the Actor as the response, please use one of the [Run Actor +synchronously](#/reference/actors/run-actor-synchronously) API endpoints +instead. + +To fetch the Actor run results that are typically stored in the default +dataset, you'll need to pass the ID received in the `defaultDatasetId` field +received in the response JSON to the [Get dataset items](#/reference/datasets/item-collection/get-items) +API endpoint. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param actorId Actor ID or a tilde-separated owner's username and Actor name. + @return ApiActRunsPostRequest +*/ +func (a *ActorsActorRunsAPIService) ActRunsPost(ctx context.Context, actorId string) ApiActRunsPostRequest { + return ApiActRunsPostRequest{ + ApiService: a, + ctx: ctx, + actorId: actorId, + } +} + +// Execute executes the request +// @return RunResponse +func (a *ActorsActorRunsAPIService) ActRunsPostExecute(r ApiActRunsPostRequest) (*RunResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *RunResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ActorsActorRunsAPIService.ActRunsPost") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/actors/{actorId}/runs" + localVarPath = strings.Replace(localVarPath, "{"+"actorId"+"}", url.PathEscape(parameterValueToString(r.actorId, "actorId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.body == nil { + return localVarReturnValue, nil, reportError("body is required and must be specified") + } + + if r.timeout != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "timeout", r.timeout, "form", "") + } + if r.memory != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "memory", r.memory, "form", "") + } + if r.maxItems != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "maxItems", r.maxItems, "form", "") + } + if r.maxTotalChargeUsd != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "maxTotalChargeUsd", r.maxTotalChargeUsd, "form", "") + } + if r.restartOnError != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "restartOnError", r.restartOnError, "form", "") + } + if r.build != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "build", r.build, "form", "") + } + if r.waitForFinish != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "waitForFinish", r.waitForFinish, "form", "") + } + if r.webhooks != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "webhooks", r.webhooks, "form", "") + } + if r.forcePermissionLevel != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "forcePermissionLevel", r.forcePermissionLevel, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.body + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 402 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 413 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 415 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/api_actors_actor_versions.go b/api_actors_actor_versions.go new file mode 100644 index 0000000..03f8661 --- /dev/null +++ b/api_actors_actor_versions.go @@ -0,0 +1,2562 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" + "strings" +) + + +// ActorsActorVersionsAPIService ActorsActorVersionsAPI service +type ActorsActorVersionsAPIService service + +type ApiActVersionDeleteRequest struct { + ctx context.Context + ApiService *ActorsActorVersionsAPIService + actorId string + versionNumber string +} + +func (r ApiActVersionDeleteRequest) Execute() (map[string]interface{}, *http.Response, error) { + return r.ApiService.ActVersionDeleteExecute(r) +} + +/* +ActVersionDelete Delete version + +Deletes a specific version of Actor's source code. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param actorId Actor ID or a tilde-separated owner's username and Actor name. + @param versionNumber Actor version. + @return ApiActVersionDeleteRequest +*/ +func (a *ActorsActorVersionsAPIService) ActVersionDelete(ctx context.Context, actorId string, versionNumber string) ApiActVersionDeleteRequest { + return ApiActVersionDeleteRequest{ + ApiService: a, + ctx: ctx, + actorId: actorId, + versionNumber: versionNumber, + } +} + +// Execute executes the request +// @return map[string]interface{} +func (a *ActorsActorVersionsAPIService) ActVersionDeleteExecute(r ApiActVersionDeleteRequest) (map[string]interface{}, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue map[string]interface{} + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ActorsActorVersionsAPIService.ActVersionDelete") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/actors/{actorId}/versions/{versionNumber}" + localVarPath = strings.Replace(localVarPath, "{"+"actorId"+"}", url.PathEscape(parameterValueToString(r.actorId, "actorId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"versionNumber"+"}", url.PathEscape(parameterValueToString(r.versionNumber, "versionNumber")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiActVersionEnvVarDeleteRequest struct { + ctx context.Context + ApiService *ActorsActorVersionsAPIService + actorId string + versionNumber string + envVarName string +} + +func (r ApiActVersionEnvVarDeleteRequest) Execute() (map[string]interface{}, *http.Response, error) { + return r.ApiService.ActVersionEnvVarDeleteExecute(r) +} + +/* +ActVersionEnvVarDelete Delete environment variable + +Deletes a specific environment variable. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param actorId Actor ID or a tilde-separated owner's username and Actor name. + @param versionNumber Actor version. + @param envVarName The name of the environment variable + @return ApiActVersionEnvVarDeleteRequest +*/ +func (a *ActorsActorVersionsAPIService) ActVersionEnvVarDelete(ctx context.Context, actorId string, versionNumber string, envVarName string) ApiActVersionEnvVarDeleteRequest { + return ApiActVersionEnvVarDeleteRequest{ + ApiService: a, + ctx: ctx, + actorId: actorId, + versionNumber: versionNumber, + envVarName: envVarName, + } +} + +// Execute executes the request +// @return map[string]interface{} +func (a *ActorsActorVersionsAPIService) ActVersionEnvVarDeleteExecute(r ApiActVersionEnvVarDeleteRequest) (map[string]interface{}, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue map[string]interface{} + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ActorsActorVersionsAPIService.ActVersionEnvVarDelete") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/actors/{actorId}/versions/{versionNumber}/env-vars/{envVarName}" + localVarPath = strings.Replace(localVarPath, "{"+"actorId"+"}", url.PathEscape(parameterValueToString(r.actorId, "actorId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"versionNumber"+"}", url.PathEscape(parameterValueToString(r.versionNumber, "versionNumber")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"envVarName"+"}", url.PathEscape(parameterValueToString(r.envVarName, "envVarName")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiActVersionEnvVarGetRequest struct { + ctx context.Context + ApiService *ActorsActorVersionsAPIService + actorId string + versionNumber string + envVarName string +} + +func (r ApiActVersionEnvVarGetRequest) Execute() (*EnvVarResponse, *http.Response, error) { + return r.ApiService.ActVersionEnvVarGetExecute(r) +} + +/* +ActVersionEnvVarGet Get environment variable + +Gets a [EnvVar object](#/reference/actors/environment-variable-object) that +contains all the details about a specific environment variable of an Actor. + +If `isSecret` is set to `true`, then `value` will never be returned. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param actorId Actor ID or a tilde-separated owner's username and Actor name. + @param versionNumber Actor version. + @param envVarName The name of the environment variable + @return ApiActVersionEnvVarGetRequest +*/ +func (a *ActorsActorVersionsAPIService) ActVersionEnvVarGet(ctx context.Context, actorId string, versionNumber string, envVarName string) ApiActVersionEnvVarGetRequest { + return ApiActVersionEnvVarGetRequest{ + ApiService: a, + ctx: ctx, + actorId: actorId, + versionNumber: versionNumber, + envVarName: envVarName, + } +} + +// Execute executes the request +// @return EnvVarResponse +func (a *ActorsActorVersionsAPIService) ActVersionEnvVarGetExecute(r ApiActVersionEnvVarGetRequest) (*EnvVarResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *EnvVarResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ActorsActorVersionsAPIService.ActVersionEnvVarGet") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/actors/{actorId}/versions/{versionNumber}/env-vars/{envVarName}" + localVarPath = strings.Replace(localVarPath, "{"+"actorId"+"}", url.PathEscape(parameterValueToString(r.actorId, "actorId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"versionNumber"+"}", url.PathEscape(parameterValueToString(r.versionNumber, "versionNumber")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"envVarName"+"}", url.PathEscape(parameterValueToString(r.envVarName, "envVarName")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiActVersionEnvVarPostRequest struct { + ctx context.Context + ApiService *ActorsActorVersionsAPIService + actorId string + versionNumber string + envVarName string + envVarRequest *EnvVarRequest +} + +// +func (r ApiActVersionEnvVarPostRequest) EnvVarRequest(envVarRequest EnvVarRequest) ApiActVersionEnvVarPostRequest { + r.envVarRequest = &envVarRequest + return r +} + +func (r ApiActVersionEnvVarPostRequest) Execute() (*EnvVarResponse, *http.Response, error) { + return r.ApiService.ActVersionEnvVarPostExecute(r) +} + +/* +ActVersionEnvVarPost Update environment variable (POST) + +Updates Actor environment variable using values specified by a [EnvVar +object](#/reference/actors/environment-variable-object) +passed as JSON in the POST payload. +This endpoint is an alias for the [`PUT` update environment variable](#tag/ActorsEnvironment-variable-object/operation/act_version_envVar_put) method and behaves identically. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param actorId Actor ID or a tilde-separated owner's username and Actor name. + @param versionNumber Actor version. + @param envVarName The name of the environment variable + @return ApiActVersionEnvVarPostRequest +*/ +func (a *ActorsActorVersionsAPIService) ActVersionEnvVarPost(ctx context.Context, actorId string, versionNumber string, envVarName string) ApiActVersionEnvVarPostRequest { + return ApiActVersionEnvVarPostRequest{ + ApiService: a, + ctx: ctx, + actorId: actorId, + versionNumber: versionNumber, + envVarName: envVarName, + } +} + +// Execute executes the request +// @return EnvVarResponse +func (a *ActorsActorVersionsAPIService) ActVersionEnvVarPostExecute(r ApiActVersionEnvVarPostRequest) (*EnvVarResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *EnvVarResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ActorsActorVersionsAPIService.ActVersionEnvVarPost") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/actors/{actorId}/versions/{versionNumber}/env-vars/{envVarName}" + localVarPath = strings.Replace(localVarPath, "{"+"actorId"+"}", url.PathEscape(parameterValueToString(r.actorId, "actorId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"versionNumber"+"}", url.PathEscape(parameterValueToString(r.versionNumber, "versionNumber")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"envVarName"+"}", url.PathEscape(parameterValueToString(r.envVarName, "envVarName")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.envVarRequest == nil { + return localVarReturnValue, nil, reportError("envVarRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.envVarRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 413 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 415 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiActVersionEnvVarPutRequest struct { + ctx context.Context + ApiService *ActorsActorVersionsAPIService + actorId string + versionNumber string + envVarName string + envVarRequest *EnvVarRequest +} + +// +func (r ApiActVersionEnvVarPutRequest) EnvVarRequest(envVarRequest EnvVarRequest) ApiActVersionEnvVarPutRequest { + r.envVarRequest = &envVarRequest + return r +} + +func (r ApiActVersionEnvVarPutRequest) Execute() (*EnvVarResponse, *http.Response, error) { + return r.ApiService.ActVersionEnvVarPutExecute(r) +} + +/* +ActVersionEnvVarPut Update environment variable + +Updates Actor environment variable using values specified by a [EnvVar +object](#/reference/actors/environment-variable-object) +passed as JSON in the POST payload. +If the object does not define a specific property, its value will not be +updated. + +The request needs to specify the `Content-Type: application/json` HTTP +header! + +When providing your API authentication token, we recommend using the +request's `Authorization` header, rather than the URL. ([More +info](#/introduction/authentication)). + +The response is the [EnvVar object](#/reference/actors/environment-variable-object) as returned by the +[Get environment variable](#/reference/actors/environment-variable-object/get-environment-variable) +endpoint. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param actorId Actor ID or a tilde-separated owner's username and Actor name. + @param versionNumber Actor version. + @param envVarName The name of the environment variable + @return ApiActVersionEnvVarPutRequest +*/ +func (a *ActorsActorVersionsAPIService) ActVersionEnvVarPut(ctx context.Context, actorId string, versionNumber string, envVarName string) ApiActVersionEnvVarPutRequest { + return ApiActVersionEnvVarPutRequest{ + ApiService: a, + ctx: ctx, + actorId: actorId, + versionNumber: versionNumber, + envVarName: envVarName, + } +} + +// Execute executes the request +// @return EnvVarResponse +func (a *ActorsActorVersionsAPIService) ActVersionEnvVarPutExecute(r ApiActVersionEnvVarPutRequest) (*EnvVarResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *EnvVarResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ActorsActorVersionsAPIService.ActVersionEnvVarPut") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/actors/{actorId}/versions/{versionNumber}/env-vars/{envVarName}" + localVarPath = strings.Replace(localVarPath, "{"+"actorId"+"}", url.PathEscape(parameterValueToString(r.actorId, "actorId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"versionNumber"+"}", url.PathEscape(parameterValueToString(r.versionNumber, "versionNumber")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"envVarName"+"}", url.PathEscape(parameterValueToString(r.envVarName, "envVarName")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.envVarRequest == nil { + return localVarReturnValue, nil, reportError("envVarRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.envVarRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 413 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 415 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiActVersionEnvVarsGetRequest struct { + ctx context.Context + ApiService *ActorsActorVersionsAPIService + actorId string + versionNumber string +} + +func (r ApiActVersionEnvVarsGetRequest) Execute() (*ListOfEnvVarsResponse, *http.Response, error) { + return r.ApiService.ActVersionEnvVarsGetExecute(r) +} + +/* +ActVersionEnvVarsGet Get list of environment variables + +Gets the list of environment variables for a specific version of an Actor. +The response is a JSON object with the list of [EnvVar objects](#/reference/actors/environment-variable-object), where each contains basic information about a single environment variable. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param actorId Actor ID or a tilde-separated owner's username and Actor name. + @param versionNumber Actor version. + @return ApiActVersionEnvVarsGetRequest +*/ +func (a *ActorsActorVersionsAPIService) ActVersionEnvVarsGet(ctx context.Context, actorId string, versionNumber string) ApiActVersionEnvVarsGetRequest { + return ApiActVersionEnvVarsGetRequest{ + ApiService: a, + ctx: ctx, + actorId: actorId, + versionNumber: versionNumber, + } +} + +// Execute executes the request +// @return ListOfEnvVarsResponse +func (a *ActorsActorVersionsAPIService) ActVersionEnvVarsGetExecute(r ApiActVersionEnvVarsGetRequest) (*ListOfEnvVarsResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ListOfEnvVarsResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ActorsActorVersionsAPIService.ActVersionEnvVarsGet") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/actors/{actorId}/versions/{versionNumber}/env-vars" + localVarPath = strings.Replace(localVarPath, "{"+"actorId"+"}", url.PathEscape(parameterValueToString(r.actorId, "actorId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"versionNumber"+"}", url.PathEscape(parameterValueToString(r.versionNumber, "versionNumber")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiActVersionEnvVarsPostRequest struct { + ctx context.Context + ApiService *ActorsActorVersionsAPIService + actorId string + versionNumber string + envVarRequest *EnvVarRequest +} + +// +func (r ApiActVersionEnvVarsPostRequest) EnvVarRequest(envVarRequest EnvVarRequest) ApiActVersionEnvVarsPostRequest { + r.envVarRequest = &envVarRequest + return r +} + +func (r ApiActVersionEnvVarsPostRequest) Execute() (*EnvVarResponse, *http.Response, error) { + return r.ApiService.ActVersionEnvVarsPostExecute(r) +} + +/* +ActVersionEnvVarsPost Create environment variable + +Creates an environment variable of an Actor using values specified in a +[EnvVar object](#/reference/actors/environment-variable-object) passed as +JSON in the POST payload. + +The request must specify `name` and `value` parameters (as strings) in the +JSON payload and a `Content-Type: application/json` HTTP header. + +``` +{ + "name": "ENV_VAR_NAME", + "value": "my-env-var" +} +``` + +The response is the [EnvVar +object](#/reference/actors/environment-variable-object) as returned by the [Get environment +variable](#/reference/actors/environment-variable-object/get-environment-variable) +endpoint. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param actorId Actor ID or a tilde-separated owner's username and Actor name. + @param versionNumber Actor version. + @return ApiActVersionEnvVarsPostRequest +*/ +func (a *ActorsActorVersionsAPIService) ActVersionEnvVarsPost(ctx context.Context, actorId string, versionNumber string) ApiActVersionEnvVarsPostRequest { + return ApiActVersionEnvVarsPostRequest{ + ApiService: a, + ctx: ctx, + actorId: actorId, + versionNumber: versionNumber, + } +} + +// Execute executes the request +// @return EnvVarResponse +func (a *ActorsActorVersionsAPIService) ActVersionEnvVarsPostExecute(r ApiActVersionEnvVarsPostRequest) (*EnvVarResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *EnvVarResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ActorsActorVersionsAPIService.ActVersionEnvVarsPost") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/actors/{actorId}/versions/{versionNumber}/env-vars" + localVarPath = strings.Replace(localVarPath, "{"+"actorId"+"}", url.PathEscape(parameterValueToString(r.actorId, "actorId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"versionNumber"+"}", url.PathEscape(parameterValueToString(r.versionNumber, "versionNumber")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.envVarRequest == nil { + return localVarReturnValue, nil, reportError("envVarRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.envVarRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 413 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 415 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiActVersionGetRequest struct { + ctx context.Context + ApiService *ActorsActorVersionsAPIService + actorId string + versionNumber string +} + +func (r ApiActVersionGetRequest) Execute() (*VersionResponse, *http.Response, error) { + return r.ApiService.ActVersionGetExecute(r) +} + +/* +ActVersionGet Get version + +Gets a [Version object](#/reference/actors/version-object) that contains all the details about a specific version of an Actor. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param actorId Actor ID or a tilde-separated owner's username and Actor name. + @param versionNumber Actor version. + @return ApiActVersionGetRequest +*/ +func (a *ActorsActorVersionsAPIService) ActVersionGet(ctx context.Context, actorId string, versionNumber string) ApiActVersionGetRequest { + return ApiActVersionGetRequest{ + ApiService: a, + ctx: ctx, + actorId: actorId, + versionNumber: versionNumber, + } +} + +// Execute executes the request +// @return VersionResponse +func (a *ActorsActorVersionsAPIService) ActVersionGetExecute(r ApiActVersionGetRequest) (*VersionResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *VersionResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ActorsActorVersionsAPIService.ActVersionGet") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/actors/{actorId}/versions/{versionNumber}" + localVarPath = strings.Replace(localVarPath, "{"+"actorId"+"}", url.PathEscape(parameterValueToString(r.actorId, "actorId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"versionNumber"+"}", url.PathEscape(parameterValueToString(r.versionNumber, "versionNumber")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiActVersionPostRequest struct { + ctx context.Context + ApiService *ActorsActorVersionsAPIService + actorId string + versionNumber string + createOrUpdateVersionRequest *CreateOrUpdateVersionRequest +} + +// +func (r ApiActVersionPostRequest) CreateOrUpdateVersionRequest(createOrUpdateVersionRequest CreateOrUpdateVersionRequest) ApiActVersionPostRequest { + r.createOrUpdateVersionRequest = &createOrUpdateVersionRequest + return r +} + +func (r ApiActVersionPostRequest) Execute() (*VersionResponse, *http.Response, error) { + return r.ApiService.ActVersionPostExecute(r) +} + +/* +ActVersionPost Update version (POST) + +Updates Actor version using values specified by a [Version object](#/reference/actors/version-object) passed as JSON in the POST payload. +This endpoint is an alias for the [`PUT` update version](#tag/ActorsVersion-object/operation/act_version_put) method and behaves identically. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param actorId Actor ID or a tilde-separated owner's username and Actor name. + @param versionNumber Actor version. + @return ApiActVersionPostRequest +*/ +func (a *ActorsActorVersionsAPIService) ActVersionPost(ctx context.Context, actorId string, versionNumber string) ApiActVersionPostRequest { + return ApiActVersionPostRequest{ + ApiService: a, + ctx: ctx, + actorId: actorId, + versionNumber: versionNumber, + } +} + +// Execute executes the request +// @return VersionResponse +func (a *ActorsActorVersionsAPIService) ActVersionPostExecute(r ApiActVersionPostRequest) (*VersionResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *VersionResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ActorsActorVersionsAPIService.ActVersionPost") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/actors/{actorId}/versions/{versionNumber}" + localVarPath = strings.Replace(localVarPath, "{"+"actorId"+"}", url.PathEscape(parameterValueToString(r.actorId, "actorId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"versionNumber"+"}", url.PathEscape(parameterValueToString(r.versionNumber, "versionNumber")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.createOrUpdateVersionRequest == nil { + return localVarReturnValue, nil, reportError("createOrUpdateVersionRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.createOrUpdateVersionRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 413 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 415 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiActVersionPutRequest struct { + ctx context.Context + ApiService *ActorsActorVersionsAPIService + actorId string + versionNumber string + createOrUpdateVersionRequest *CreateOrUpdateVersionRequest +} + +// +func (r ApiActVersionPutRequest) CreateOrUpdateVersionRequest(createOrUpdateVersionRequest CreateOrUpdateVersionRequest) ApiActVersionPutRequest { + r.createOrUpdateVersionRequest = &createOrUpdateVersionRequest + return r +} + +func (r ApiActVersionPutRequest) Execute() (*VersionResponse, *http.Response, error) { + return r.ApiService.ActVersionPutExecute(r) +} + +/* +ActVersionPut Update version + +Updates Actor version using values specified by a [Version object](#/reference/actors/version-object) passed as JSON in the POST payload. + +If the object does not define a specific property, its value will not be +updated. + +The request needs to specify the `Content-Type: application/json` HTTP +header! + +When providing your API authentication token, we recommend using the +request's `Authorization` header, rather than the URL. ([More +info](#/introduction/authentication)). + +The response is the [Version object](#/reference/actors/version-object) as +returned by the [Get version](#/reference/actors/version-object/get-version) endpoint. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param actorId Actor ID or a tilde-separated owner's username and Actor name. + @param versionNumber Actor version. + @return ApiActVersionPutRequest +*/ +func (a *ActorsActorVersionsAPIService) ActVersionPut(ctx context.Context, actorId string, versionNumber string) ApiActVersionPutRequest { + return ApiActVersionPutRequest{ + ApiService: a, + ctx: ctx, + actorId: actorId, + versionNumber: versionNumber, + } +} + +// Execute executes the request +// @return VersionResponse +func (a *ActorsActorVersionsAPIService) ActVersionPutExecute(r ApiActVersionPutRequest) (*VersionResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *VersionResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ActorsActorVersionsAPIService.ActVersionPut") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/actors/{actorId}/versions/{versionNumber}" + localVarPath = strings.Replace(localVarPath, "{"+"actorId"+"}", url.PathEscape(parameterValueToString(r.actorId, "actorId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"versionNumber"+"}", url.PathEscape(parameterValueToString(r.versionNumber, "versionNumber")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.createOrUpdateVersionRequest == nil { + return localVarReturnValue, nil, reportError("createOrUpdateVersionRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.createOrUpdateVersionRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 413 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 415 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiActVersionsGetRequest struct { + ctx context.Context + ApiService *ActorsActorVersionsAPIService + actorId string +} + +func (r ApiActVersionsGetRequest) Execute() (*ListOfVersionsResponse, *http.Response, error) { + return r.ApiService.ActVersionsGetExecute(r) +} + +/* +ActVersionsGet Get list of versions + +Gets the list of versions of a specific Actor. The response is a JSON object +with the list of [Version objects](#/reference/actors/version-object), where each +contains basic information about a single version. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param actorId Actor ID or a tilde-separated owner's username and Actor name. + @return ApiActVersionsGetRequest +*/ +func (a *ActorsActorVersionsAPIService) ActVersionsGet(ctx context.Context, actorId string) ApiActVersionsGetRequest { + return ApiActVersionsGetRequest{ + ApiService: a, + ctx: ctx, + actorId: actorId, + } +} + +// Execute executes the request +// @return ListOfVersionsResponse +func (a *ActorsActorVersionsAPIService) ActVersionsGetExecute(r ApiActVersionsGetRequest) (*ListOfVersionsResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ListOfVersionsResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ActorsActorVersionsAPIService.ActVersionsGet") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/actors/{actorId}/versions" + localVarPath = strings.Replace(localVarPath, "{"+"actorId"+"}", url.PathEscape(parameterValueToString(r.actorId, "actorId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiActVersionsPostRequest struct { + ctx context.Context + ApiService *ActorsActorVersionsAPIService + actorId string + createOrUpdateVersionRequest *CreateOrUpdateVersionRequest +} + +// +func (r ApiActVersionsPostRequest) CreateOrUpdateVersionRequest(createOrUpdateVersionRequest CreateOrUpdateVersionRequest) ApiActVersionsPostRequest { + r.createOrUpdateVersionRequest = &createOrUpdateVersionRequest + return r +} + +func (r ApiActVersionsPostRequest) Execute() (*VersionResponse, *http.Response, error) { + return r.ApiService.ActVersionsPostExecute(r) +} + +/* +ActVersionsPost Create version + +Creates a version of an Actor using values specified in a [Version +object](#/reference/actors/version-object) passed as JSON in the POST +payload. + +The request must specify `versionNumber` and `sourceType` parameters (as +strings) in the JSON payload and a `Content-Type: application/json` HTTP +header. + +Each `sourceType` requires its own additional properties to be passed to the +JSON payload object. These are outlined in the [Version +object](#/reference/actors/version-object) table below and in more detail in +the [Apify +documentation](https://docs.apify.com/platform/actors/development/deployment/source-types). + +For example, if an Actor's source code is stored in a [GitHub +repository](https://docs.apify.com/platform/actors/development/deployment/source-types#git-repository), +you will set the `sourceType` to `GIT_REPO` and pass the repository's URL in +the `gitRepoUrl` property. + +``` +{ + "versionNumber": "0.1", + "sourceType": "GIT_REPO", + "gitRepoUrl": "https://github.com/my-github-account/actor-repo" +} +``` + +The response is the [Version object](#/reference/actors/version-object) as +returned by the [Get version](#/reference/actors/version-object/get-version) endpoint. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param actorId Actor ID or a tilde-separated owner's username and Actor name. + @return ApiActVersionsPostRequest +*/ +func (a *ActorsActorVersionsAPIService) ActVersionsPost(ctx context.Context, actorId string) ApiActVersionsPostRequest { + return ApiActVersionsPostRequest{ + ApiService: a, + ctx: ctx, + actorId: actorId, + } +} + +// Execute executes the request +// @return VersionResponse +func (a *ActorsActorVersionsAPIService) ActVersionsPostExecute(r ApiActVersionsPostRequest) (*VersionResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *VersionResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ActorsActorVersionsAPIService.ActVersionsPost") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/actors/{actorId}/versions" + localVarPath = strings.Replace(localVarPath, "{"+"actorId"+"}", url.PathEscape(parameterValueToString(r.actorId, "actorId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.createOrUpdateVersionRequest == nil { + return localVarReturnValue, nil, reportError("createOrUpdateVersionRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.createOrUpdateVersionRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 413 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 415 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/api_actors_webhook_collection.go b/api_actors_webhook_collection.go new file mode 100644 index 0000000..e82c5fc --- /dev/null +++ b/api_actors_webhook_collection.go @@ -0,0 +1,244 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" + "strings" +) + + +// ActorsWebhookCollectionAPIService ActorsWebhookCollectionAPI service +type ActorsWebhookCollectionAPIService service + +type ApiActWebhooksGetRequest struct { + ctx context.Context + ApiService *ActorsWebhookCollectionAPIService + actorId string + offset *float64 + limit *float64 + desc *bool +} + +// Number of items that should be skipped at the start. The default value is `0`. +func (r ApiActWebhooksGetRequest) Offset(offset float64) ApiActWebhooksGetRequest { + r.offset = &offset + return r +} + +// Maximum number of items to return. The default value as well as the maximum is `1000`. +func (r ApiActWebhooksGetRequest) Limit(limit float64) ApiActWebhooksGetRequest { + r.limit = &limit + return r +} + +// If `true` or `1` then the objects are sorted by the `createdAt` field in descending order. By default, they are sorted in ascending order. +func (r ApiActWebhooksGetRequest) Desc(desc bool) ApiActWebhooksGetRequest { + r.desc = &desc + return r +} + +func (r ApiActWebhooksGetRequest) Execute() (*ListOfWebhooksResponse, *http.Response, error) { + return r.ApiService.ActWebhooksGetExecute(r) +} + +/* +ActWebhooksGet Get list of webhooks + +Gets the list of webhooks of a specific Actor. The response is a JSON with +the list of objects, where each object contains basic information about a single webhook. + +The endpoint supports pagination using the `limit` and `offset` parameters +and it will not return more than 1000 records. + +By default, the records are sorted by the `createdAt` field in ascending +order, to sort the records in descending order, use the `desc=1` parameter. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param actorId Actor ID or a tilde-separated owner's username and Actor name. + @return ApiActWebhooksGetRequest +*/ +func (a *ActorsWebhookCollectionAPIService) ActWebhooksGet(ctx context.Context, actorId string) ApiActWebhooksGetRequest { + return ApiActWebhooksGetRequest{ + ApiService: a, + ctx: ctx, + actorId: actorId, + } +} + +// Execute executes the request +// @return ListOfWebhooksResponse +func (a *ActorsWebhookCollectionAPIService) ActWebhooksGetExecute(r ApiActWebhooksGetRequest) (*ListOfWebhooksResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ListOfWebhooksResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ActorsWebhookCollectionAPIService.ActWebhooksGet") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/actors/{actorId}/webhooks" + localVarPath = strings.Replace(localVarPath, "{"+"actorId"+"}", url.PathEscape(parameterValueToString(r.actorId, "actorId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.offset != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "form", "") + } + if r.limit != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "form", "") + } + if r.desc != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "desc", r.desc, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/api_default_dataset.go b/api_default_dataset.go new file mode 100644 index 0000000..2da8987 --- /dev/null +++ b/api_default_dataset.go @@ -0,0 +1,1415 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" + "strings" +) + + +// DefaultDatasetAPIService DefaultDatasetAPI service +type DefaultDatasetAPIService service + +type ApiActorRunDatasetDeleteRequest struct { + ctx context.Context + ApiService *DefaultDatasetAPIService + runId string +} + +func (r ApiActorRunDatasetDeleteRequest) Execute() (*http.Response, error) { + return r.ApiService.ActorRunDatasetDeleteExecute(r) +} + +/* +ActorRunDatasetDelete Delete default dataset + +Deletes default dataset associated with an Actor run. + +This endpoint is a shortcut for getting the last run's `defaultDatasetId` and then using the +[ Delete dataset ](/api/v2/dataset-delete) endpoint. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param runId Actor run ID. + @return ApiActorRunDatasetDeleteRequest +*/ +func (a *DefaultDatasetAPIService) ActorRunDatasetDelete(ctx context.Context, runId string) ApiActorRunDatasetDeleteRequest { + return ApiActorRunDatasetDeleteRequest{ + ApiService: a, + ctx: ctx, + runId: runId, + } +} + +// Execute executes the request +func (a *DefaultDatasetAPIService) ActorRunDatasetDeleteExecute(r ApiActorRunDatasetDeleteRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultDatasetAPIService.ActorRunDatasetDelete") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/actor-runs/{runId}/dataset" + localVarPath = strings.Replace(localVarPath, "{"+"runId"+"}", url.PathEscape(parameterValueToString(r.runId, "runId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiActorRunDatasetGetRequest struct { + ctx context.Context + ApiService *DefaultDatasetAPIService + runId string +} + +func (r ApiActorRunDatasetGetRequest) Execute() (*DatasetResponse, *http.Response, error) { + return r.ApiService.ActorRunDatasetGetExecute(r) +} + +/* +ActorRunDatasetGet Get default dataset + +Returns the default dataset associated with an Actor run. + +This endpoint is a shortcut for getting the run's `defaultDatasetId` and then using the +[Get dataset](/api/v2/dataset-get) endpoint. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param runId Actor run ID. + @return ApiActorRunDatasetGetRequest +*/ +func (a *DefaultDatasetAPIService) ActorRunDatasetGet(ctx context.Context, runId string) ApiActorRunDatasetGetRequest { + return ApiActorRunDatasetGetRequest{ + ApiService: a, + ctx: ctx, + runId: runId, + } +} + +// Execute executes the request +// @return DatasetResponse +func (a *DefaultDatasetAPIService) ActorRunDatasetGetExecute(r ApiActorRunDatasetGetRequest) (*DatasetResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *DatasetResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultDatasetAPIService.ActorRunDatasetGet") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/actor-runs/{runId}/dataset" + localVarPath = strings.Replace(localVarPath, "{"+"runId"+"}", url.PathEscape(parameterValueToString(r.runId, "runId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiActorRunDatasetItemsGetRequest struct { + ctx context.Context + ApiService *DefaultDatasetAPIService + runId string + format *string + clean *bool + offset *float64 + limit *float64 + fields *string + outputFields *string + omit *string + unwind *string + flatten *string + desc *bool + attachment *bool + delimiter *string + bom *bool + xmlRoot *string + xmlRow *string + skipHeaderRow *bool + skipHidden *bool + skipEmpty *bool + simplified *bool + view *string + skipFailedPages *bool + feedTitle *string + feedDescription *string + signature *string +} + +// Format of the results, possible values are: `json`, `jsonl`, `csv`, `html`, `xlsx`, `xml` and `rss`. The default value is `json`. +func (r ApiActorRunDatasetItemsGetRequest) Format(format string) ApiActorRunDatasetItemsGetRequest { + r.format = &format + return r +} + +// If `true` or `1` then the API endpoint returns only non-empty items and skips hidden fields (i.e. fields starting with the # character). The `clean` parameter is just a shortcut for `skipHidden=true` and `skipEmpty=true` parameters. Note that since some objects might be skipped from the output, that the result might contain less items than the `limit` value. +func (r ApiActorRunDatasetItemsGetRequest) Clean(clean bool) ApiActorRunDatasetItemsGetRequest { + r.clean = &clean + return r +} + +// Number of items that should be skipped at the start. The default value is `0`. +func (r ApiActorRunDatasetItemsGetRequest) Offset(offset float64) ApiActorRunDatasetItemsGetRequest { + r.offset = &offset + return r +} + +// Maximum number of items to return. By default there is no limit. +func (r ApiActorRunDatasetItemsGetRequest) Limit(limit float64) ApiActorRunDatasetItemsGetRequest { + r.limit = &limit + return r +} + +// A comma-separated list of fields which should be picked from the items, only these fields will remain in the resulting record objects. Note that the fields in the outputted items are sorted the same way as they are specified in the `fields` query parameter. You can use this feature to effectively fix the output format. +func (r ApiActorRunDatasetItemsGetRequest) Fields(fields string) ApiActorRunDatasetItemsGetRequest { + r.fields = &fields + return r +} + +// A comma-separated list of output field names that positionally rename the fields specified in the `fields` parameter. For example, `?fields=headline,url&outputFields=title,link` renames `headline` to `title` and `url` to `link` in the output. The number of names in `outputFields` must match the number of names in `fields`. Requires the `fields` parameter to be specified as well. +func (r ApiActorRunDatasetItemsGetRequest) OutputFields(outputFields string) ApiActorRunDatasetItemsGetRequest { + r.outputFields = &outputFields + return r +} + +// A comma-separated list of fields which should be omitted from the items. +func (r ApiActorRunDatasetItemsGetRequest) Omit(omit string) ApiActorRunDatasetItemsGetRequest { + r.omit = &omit + return r +} + +// A comma-separated list of fields which should be unwound, in order which they should be processed. Each field should be either an array or an object. If the field is an array then every element of the array will become a separate record and merged with parent object. If the unwound field is an object then it is merged with the parent object. If the unwound field is missing or its value is neither an array nor an object and therefore cannot be merged with a parent object then the item gets preserved as it is. Note that the unwound items ignore the `desc` parameter. +func (r ApiActorRunDatasetItemsGetRequest) Unwind(unwind string) ApiActorRunDatasetItemsGetRequest { + r.unwind = &unwind + return r +} + +// A comma-separated list of fields which should transform nested objects into flat structures. For example, with `flatten=\"foo\"` the object `{\"foo\":{\"bar\": \"hello\"}}` is turned into `{\"foo.bar\": \"hello\"}`. The original object with properties is replaced with the flattened object. +func (r ApiActorRunDatasetItemsGetRequest) Flatten(flatten string) ApiActorRunDatasetItemsGetRequest { + r.flatten = &flatten + return r +} + +// By default, results are returned in the same order as they were stored. To reverse the order, set this parameter to `true` or `1`. +func (r ApiActorRunDatasetItemsGetRequest) Desc(desc bool) ApiActorRunDatasetItemsGetRequest { + r.desc = &desc + return r +} + +// If `true` or `1` then the response will define the `Content-Disposition: attachment` header, forcing a web browser to download the file rather than to display it. By default this header is not present. +func (r ApiActorRunDatasetItemsGetRequest) Attachment(attachment bool) ApiActorRunDatasetItemsGetRequest { + r.attachment = &attachment + return r +} + +// A delimiter character for CSV files, only used if `format=csv`. You might need to URL-encode the character (e.g. use `%09` for tab or `%3B` for semicolon). The default delimiter is a simple comma (`,`). +func (r ApiActorRunDatasetItemsGetRequest) Delimiter(delimiter string) ApiActorRunDatasetItemsGetRequest { + r.delimiter = &delimiter + return r +} + +// All text responses are encoded in UTF-8 encoding. By default, the `format=csv` files are prefixed with the UTF-8 Byte Order Mark (BOM), while `json`, `jsonl`, `xml`, `html` and `rss` files are not. If you want to override this default behavior, specify `bom=1` query parameter to include the BOM or `bom=0` to skip it. +func (r ApiActorRunDatasetItemsGetRequest) Bom(bom bool) ApiActorRunDatasetItemsGetRequest { + r.bom = &bom + return r +} + +// Overrides default root element name of `xml` output. By default the root element is `items`. +func (r ApiActorRunDatasetItemsGetRequest) XmlRoot(xmlRoot string) ApiActorRunDatasetItemsGetRequest { + r.xmlRoot = &xmlRoot + return r +} + +// Overrides default element name that wraps each page or page function result object in `xml` output. By default the element name is `item`. +func (r ApiActorRunDatasetItemsGetRequest) XmlRow(xmlRow string) ApiActorRunDatasetItemsGetRequest { + r.xmlRow = &xmlRow + return r +} + +// If `true` or `1` then header row in the `csv` format is skipped. +func (r ApiActorRunDatasetItemsGetRequest) SkipHeaderRow(skipHeaderRow bool) ApiActorRunDatasetItemsGetRequest { + r.skipHeaderRow = &skipHeaderRow + return r +} + +// If `true` or `1` then hidden fields are skipped from the output, i.e. fields starting with the `#` character. +func (r ApiActorRunDatasetItemsGetRequest) SkipHidden(skipHidden bool) ApiActorRunDatasetItemsGetRequest { + r.skipHidden = &skipHidden + return r +} + +// If `true` or `1` then empty items are skipped from the output. Note that if used, the results might contain less items than the limit value. +func (r ApiActorRunDatasetItemsGetRequest) SkipEmpty(skipEmpty bool) ApiActorRunDatasetItemsGetRequest { + r.skipEmpty = &skipEmpty + return r +} + +// If `true` or `1` then, the endpoint applies the `fields=url,pageFunctionResult,errorInfo` and `unwind=pageFunctionResult` query parameters. This feature is used to emulate simplified results provided by the legacy Apify Crawler product and it's not recommended to use it in new integrations. +func (r ApiActorRunDatasetItemsGetRequest) Simplified(simplified bool) ApiActorRunDatasetItemsGetRequest { + r.simplified = &simplified + return r +} + +// Defines the view configuration for dataset items based on the schema definition. This parameter determines how the data will be filtered and presented. For complete specification details, see the [dataset schema documentation](/platform/actors/development/actor-definition/dataset-schema). +func (r ApiActorRunDatasetItemsGetRequest) View(view string) ApiActorRunDatasetItemsGetRequest { + r.view = &view + return r +} + +// If `true` or `1` then, the all the items with errorInfo property will be skipped from the output. This feature is here to emulate functionality of API version 1 used for the legacy Apify Crawler product and it's not recommended to use it in new integrations. +func (r ApiActorRunDatasetItemsGetRequest) SkipFailedPages(skipFailedPages bool) ApiActorRunDatasetItemsGetRequest { + r.skipFailedPages = &skipFailedPages + return r +} + +// Overrides the auto-generated RSS channel `<title>` element. Only used when `format=rss`. If not provided, the title defaults to `Dataset <label>`. +func (r ApiActorRunDatasetItemsGetRequest) FeedTitle(feedTitle string) ApiActorRunDatasetItemsGetRequest { + r.feedTitle = &feedTitle + return r +} + +// Overrides the auto-generated RSS channel `<description>` element. Only used when `format=rss`. If not provided, the description defaults to `Items in dataset with id \"<datasetId>\".` +func (r ApiActorRunDatasetItemsGetRequest) FeedDescription(feedDescription string) ApiActorRunDatasetItemsGetRequest { + r.feedDescription = &feedDescription + return r +} + +// Signature used for the access. +func (r ApiActorRunDatasetItemsGetRequest) Signature(signature string) ApiActorRunDatasetItemsGetRequest { + r.signature = &signature + return r +} + +func (r ApiActorRunDatasetItemsGetRequest) Execute() ([]map[string]interface{}, *http.Response, error) { + return r.ApiService.ActorRunDatasetItemsGetExecute(r) +} + +/* +ActorRunDatasetItemsGet Get default dataset items + +Returns data stored in the default dataset of the Actor run in the desired format. + +This endpoint is a shortcut that resolves the run's `defaultDatasetId` and proxies to the +[Get dataset items](/api/v2/dataset-items-get) endpoint. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param runId Actor run ID. + @return ApiActorRunDatasetItemsGetRequest +*/ +func (a *DefaultDatasetAPIService) ActorRunDatasetItemsGet(ctx context.Context, runId string) ApiActorRunDatasetItemsGetRequest { + return ApiActorRunDatasetItemsGetRequest{ + ApiService: a, + ctx: ctx, + runId: runId, + } +} + +// Execute executes the request +// @return []map[string]interface{} +func (a *DefaultDatasetAPIService) ActorRunDatasetItemsGetExecute(r ApiActorRunDatasetItemsGetRequest) ([]map[string]interface{}, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []map[string]interface{} + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultDatasetAPIService.ActorRunDatasetItemsGet") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/actor-runs/{runId}/dataset/items" + localVarPath = strings.Replace(localVarPath, "{"+"runId"+"}", url.PathEscape(parameterValueToString(r.runId, "runId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.format != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "format", r.format, "form", "") + } + if r.clean != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "clean", r.clean, "form", "") + } + if r.offset != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "form", "") + } + if r.limit != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "form", "") + } + if r.fields != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "fields", r.fields, "form", "") + } + if r.outputFields != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "outputFields", r.outputFields, "form", "") + } + if r.omit != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "omit", r.omit, "form", "") + } + if r.unwind != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "unwind", r.unwind, "form", "") + } + if r.flatten != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "flatten", r.flatten, "form", "") + } + if r.desc != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "desc", r.desc, "form", "") + } + if r.attachment != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "attachment", r.attachment, "form", "") + } + if r.delimiter != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "delimiter", r.delimiter, "form", "") + } + if r.bom != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "bom", r.bom, "form", "") + } + if r.xmlRoot != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "xmlRoot", r.xmlRoot, "form", "") + } + if r.xmlRow != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "xmlRow", r.xmlRow, "form", "") + } + if r.skipHeaderRow != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "skipHeaderRow", r.skipHeaderRow, "form", "") + } + if r.skipHidden != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "skipHidden", r.skipHidden, "form", "") + } + if r.skipEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "skipEmpty", r.skipEmpty, "form", "") + } + if r.simplified != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "simplified", r.simplified, "form", "") + } + if r.view != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "view", r.view, "form", "") + } + if r.skipFailedPages != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "skipFailedPages", r.skipFailedPages, "form", "") + } + if r.feedTitle != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "feedTitle", r.feedTitle, "form", "") + } + if r.feedDescription != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "feedDescription", r.feedDescription, "form", "") + } + if r.signature != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "signature", r.signature, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json", "application/jsonl", "text/csv", "text/html", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", "application/rss+xml", "application/xml"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiActorRunDatasetItemsPostRequest struct { + ctx context.Context + ApiService *DefaultDatasetAPIService + runId string + actRunsLastDatasetItemsPostRequest *ActRunsLastDatasetItemsPostRequest +} + +// +func (r ApiActorRunDatasetItemsPostRequest) ActRunsLastDatasetItemsPostRequest(actRunsLastDatasetItemsPostRequest ActRunsLastDatasetItemsPostRequest) ApiActorRunDatasetItemsPostRequest { + r.actRunsLastDatasetItemsPostRequest = &actRunsLastDatasetItemsPostRequest + return r +} + +func (r ApiActorRunDatasetItemsPostRequest) Execute() (map[string]interface{}, *http.Response, error) { + return r.ApiService.ActorRunDatasetItemsPostExecute(r) +} + +/* +ActorRunDatasetItemsPost Store items + +Appends an item or an array of items to the end of the Actor run's default dataset. + +This endpoint is a shortcut that resolves the run's `defaultDatasetId` and proxies to the +[Store items](/api/v2/dataset-items-post) endpoint. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param runId Actor run ID. + @return ApiActorRunDatasetItemsPostRequest +*/ +func (a *DefaultDatasetAPIService) ActorRunDatasetItemsPost(ctx context.Context, runId string) ApiActorRunDatasetItemsPostRequest { + return ApiActorRunDatasetItemsPostRequest{ + ApiService: a, + ctx: ctx, + runId: runId, + } +} + +// Execute executes the request +// @return map[string]interface{} +func (a *DefaultDatasetAPIService) ActorRunDatasetItemsPostExecute(r ApiActorRunDatasetItemsPostRequest) (map[string]interface{}, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue map[string]interface{} + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultDatasetAPIService.ActorRunDatasetItemsPost") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/actor-runs/{runId}/dataset/items" + localVarPath = strings.Replace(localVarPath, "{"+"runId"+"}", url.PathEscape(parameterValueToString(r.runId, "runId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.actRunsLastDatasetItemsPostRequest == nil { + return localVarReturnValue, nil, reportError("actRunsLastDatasetItemsPostRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.actRunsLastDatasetItemsPostRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ActRunsLastDatasetItemsPost400Response + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiActorRunDatasetPutRequest struct { + ctx context.Context + ApiService *DefaultDatasetAPIService + runId string + updateDatasetRequest *UpdateDatasetRequest +} + +// +func (r ApiActorRunDatasetPutRequest) UpdateDatasetRequest(updateDatasetRequest UpdateDatasetRequest) ApiActorRunDatasetPutRequest { + r.updateDatasetRequest = &updateDatasetRequest + return r +} + +func (r ApiActorRunDatasetPutRequest) Execute() (*DatasetResponse, *http.Response, error) { + return r.ApiService.ActorRunDatasetPutExecute(r) +} + +/* +ActorRunDatasetPut Update default dataset + +Updates the default dataset associated with an Actor run. + +This endpoint is a shortcut for getting the run's `defaultDatasetId` and then using the +[Put dataset](/api/v2/dataset-put) endpoint. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param runId Actor run ID. + @return ApiActorRunDatasetPutRequest +*/ +func (a *DefaultDatasetAPIService) ActorRunDatasetPut(ctx context.Context, runId string) ApiActorRunDatasetPutRequest { + return ApiActorRunDatasetPutRequest{ + ApiService: a, + ctx: ctx, + runId: runId, + } +} + +// Execute executes the request +// @return DatasetResponse +func (a *DefaultDatasetAPIService) ActorRunDatasetPutExecute(r ApiActorRunDatasetPutRequest) (*DatasetResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *DatasetResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultDatasetAPIService.ActorRunDatasetPut") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/actor-runs/{runId}/dataset" + localVarPath = strings.Replace(localVarPath, "{"+"runId"+"}", url.PathEscape(parameterValueToString(r.runId, "runId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.updateDatasetRequest == nil { + return localVarReturnValue, nil, reportError("updateDatasetRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.updateDatasetRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 413 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 415 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiActorRunDatasetStatisticsGetRequest struct { + ctx context.Context + ApiService *DefaultDatasetAPIService + runId string +} + +func (r ApiActorRunDatasetStatisticsGetRequest) Execute() (*DatasetStatisticsResponse, *http.Response, error) { + return r.ApiService.ActorRunDatasetStatisticsGetExecute(r) +} + +/* +ActorRunDatasetStatisticsGet Get default dataset statistics + +Returns statistics for the Actor run's default dataset. + +This endpoint is a shortcut that resolves the run's `defaultDatasetId` and proxies to the +[Get dataset statistics](/api/v2/dataset-statistics-get) endpoint. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param runId Actor run ID. + @return ApiActorRunDatasetStatisticsGetRequest +*/ +func (a *DefaultDatasetAPIService) ActorRunDatasetStatisticsGet(ctx context.Context, runId string) ApiActorRunDatasetStatisticsGetRequest { + return ApiActorRunDatasetStatisticsGetRequest{ + ApiService: a, + ctx: ctx, + runId: runId, + } +} + +// Execute executes the request +// @return DatasetStatisticsResponse +func (a *DefaultDatasetAPIService) ActorRunDatasetStatisticsGetExecute(r ApiActorRunDatasetStatisticsGetRequest) (*DatasetStatisticsResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *DatasetStatisticsResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultDatasetAPIService.ActorRunDatasetStatisticsGet") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/actor-runs/{runId}/dataset/statistics" + localVarPath = strings.Replace(localVarPath, "{"+"runId"+"}", url.PathEscape(parameterValueToString(r.runId, "runId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/api_default_key_value_store.go b/api_default_key_value_store.go new file mode 100644 index 0000000..b41f89f --- /dev/null +++ b/api_default_key_value_store.go @@ -0,0 +1,1921 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" + "strings" + "os" +) + + +// DefaultKeyValueStoreAPIService DefaultKeyValueStoreAPI service +type DefaultKeyValueStoreAPIService service + +type ApiActorRunKeyValueStoreDeleteRequest struct { + ctx context.Context + ApiService *DefaultKeyValueStoreAPIService + runId string +} + +func (r ApiActorRunKeyValueStoreDeleteRequest) Execute() (*http.Response, error) { + return r.ApiService.ActorRunKeyValueStoreDeleteExecute(r) +} + +/* +ActorRunKeyValueStoreDelete Delete default store + +Delete the default key-value store. + +This endpoint is a shortcut for getting the run's `defaultKeyValueStoreId` and then using the +[Delete store](/api/v2/key-value-store-delete) endpoint. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param runId Actor run ID. + @return ApiActorRunKeyValueStoreDeleteRequest +*/ +func (a *DefaultKeyValueStoreAPIService) ActorRunKeyValueStoreDelete(ctx context.Context, runId string) ApiActorRunKeyValueStoreDeleteRequest { + return ApiActorRunKeyValueStoreDeleteRequest{ + ApiService: a, + ctx: ctx, + runId: runId, + } +} + +// Execute executes the request +func (a *DefaultKeyValueStoreAPIService) ActorRunKeyValueStoreDeleteExecute(r ApiActorRunKeyValueStoreDeleteRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultKeyValueStoreAPIService.ActorRunKeyValueStoreDelete") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/actor-runs/{runId}/key-value-store" + localVarPath = strings.Replace(localVarPath, "{"+"runId"+"}", url.PathEscape(parameterValueToString(r.runId, "runId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiActorRunKeyValueStoreGetRequest struct { + ctx context.Context + ApiService *DefaultKeyValueStoreAPIService + runId string +} + +func (r ApiActorRunKeyValueStoreGetRequest) Execute() (*KeyValueStoreResponse, *http.Response, error) { + return r.ApiService.ActorRunKeyValueStoreGetExecute(r) +} + +/* +ActorRunKeyValueStoreGet Get default store + +Gets an object that contains all the details about the default key-value +store. + +This endpoint is a shortcut for getting the run's `defaultKeyValueStoreId` and then using the +[Get store](/api/v2/key-value-store-get) endpoint. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param runId Actor run ID. + @return ApiActorRunKeyValueStoreGetRequest +*/ +func (a *DefaultKeyValueStoreAPIService) ActorRunKeyValueStoreGet(ctx context.Context, runId string) ApiActorRunKeyValueStoreGetRequest { + return ApiActorRunKeyValueStoreGetRequest{ + ApiService: a, + ctx: ctx, + runId: runId, + } +} + +// Execute executes the request +// @return KeyValueStoreResponse +func (a *DefaultKeyValueStoreAPIService) ActorRunKeyValueStoreGetExecute(r ApiActorRunKeyValueStoreGetRequest) (*KeyValueStoreResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *KeyValueStoreResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultKeyValueStoreAPIService.ActorRunKeyValueStoreGet") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/actor-runs/{runId}/key-value-store" + localVarPath = strings.Replace(localVarPath, "{"+"runId"+"}", url.PathEscape(parameterValueToString(r.runId, "runId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiActorRunKeyValueStoreKeysGetRequest struct { + ctx context.Context + ApiService *DefaultKeyValueStoreAPIService + runId string + exclusiveStartKey *string + limit *float32 + collection *string + prefix *string + signature *string +} + +// All keys up to this one (including) are skipped from the result. +func (r ApiActorRunKeyValueStoreKeysGetRequest) ExclusiveStartKey(exclusiveStartKey string) ApiActorRunKeyValueStoreKeysGetRequest { + r.exclusiveStartKey = &exclusiveStartKey + return r +} + +// Number of keys to be returned. +func (r ApiActorRunKeyValueStoreKeysGetRequest) Limit(limit float32) ApiActorRunKeyValueStoreKeysGetRequest { + r.limit = &limit + return r +} + +// Limit the results to keys that belong to a specific collection from the key-value store schema. The key-value store need to have a schema defined for this parameter to work. +func (r ApiActorRunKeyValueStoreKeysGetRequest) Collection(collection string) ApiActorRunKeyValueStoreKeysGetRequest { + r.collection = &collection + return r +} + +// Limit the results to keys that start with a specific prefix. +func (r ApiActorRunKeyValueStoreKeysGetRequest) Prefix(prefix string) ApiActorRunKeyValueStoreKeysGetRequest { + r.prefix = &prefix + return r +} + +// Signature used for the access. +func (r ApiActorRunKeyValueStoreKeysGetRequest) Signature(signature string) ApiActorRunKeyValueStoreKeysGetRequest { + r.signature = &signature + return r +} + +func (r ApiActorRunKeyValueStoreKeysGetRequest) Execute() (*ListOfKeysResponse, *http.Response, error) { + return r.ApiService.ActorRunKeyValueStoreKeysGetExecute(r) +} + +/* +ActorRunKeyValueStoreKeysGet Get default store's list of keys + +Returns a list of keys for the default key-value store of the Actor run. + +This endpoint is a shortcut for getting the run's `defaultKeyValueStoreId` and then using the +[Get list of keys](/api/v2/key-value-store-keys-get) endpoint. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param runId Actor run ID. + @return ApiActorRunKeyValueStoreKeysGetRequest +*/ +func (a *DefaultKeyValueStoreAPIService) ActorRunKeyValueStoreKeysGet(ctx context.Context, runId string) ApiActorRunKeyValueStoreKeysGetRequest { + return ApiActorRunKeyValueStoreKeysGetRequest{ + ApiService: a, + ctx: ctx, + runId: runId, + } +} + +// Execute executes the request +// @return ListOfKeysResponse +func (a *DefaultKeyValueStoreAPIService) ActorRunKeyValueStoreKeysGetExecute(r ApiActorRunKeyValueStoreKeysGetRequest) (*ListOfKeysResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ListOfKeysResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultKeyValueStoreAPIService.ActorRunKeyValueStoreKeysGet") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/actor-runs/{runId}/key-value-store/keys" + localVarPath = strings.Replace(localVarPath, "{"+"runId"+"}", url.PathEscape(parameterValueToString(r.runId, "runId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.exclusiveStartKey != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "exclusiveStartKey", r.exclusiveStartKey, "form", "") + } + if r.limit != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "form", "") + } else { + var defaultValue float32 = 1000 + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", defaultValue, "form", "") + r.limit = &defaultValue + } + if r.collection != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "collection", r.collection, "form", "") + } + if r.prefix != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "prefix", r.prefix, "form", "") + } + if r.signature != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "signature", r.signature, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiActorRunKeyValueStorePutRequest struct { + ctx context.Context + ApiService *DefaultKeyValueStoreAPIService + runId string + updateStoreRequest *UpdateStoreRequest +} + +// +func (r ApiActorRunKeyValueStorePutRequest) UpdateStoreRequest(updateStoreRequest UpdateStoreRequest) ApiActorRunKeyValueStorePutRequest { + r.updateStoreRequest = &updateStoreRequest + return r +} + +func (r ApiActorRunKeyValueStorePutRequest) Execute() (*KeyValueStoreResponse, *http.Response, error) { + return r.ApiService.ActorRunKeyValueStorePutExecute(r) +} + +/* +ActorRunKeyValueStorePut Update default store + +Updates the default key-value store's name and general resource access level using a value specified by a JSON object +passed in the PUT payload. + +This endpoint is a shortcut for getting the run's `defaultKeyValueStoreId` and then using the +[Update store](/api/v2/key-value-store-put) endpoint. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param runId Actor run ID. + @return ApiActorRunKeyValueStorePutRequest +*/ +func (a *DefaultKeyValueStoreAPIService) ActorRunKeyValueStorePut(ctx context.Context, runId string) ApiActorRunKeyValueStorePutRequest { + return ApiActorRunKeyValueStorePutRequest{ + ApiService: a, + ctx: ctx, + runId: runId, + } +} + +// Execute executes the request +// @return KeyValueStoreResponse +func (a *DefaultKeyValueStoreAPIService) ActorRunKeyValueStorePutExecute(r ApiActorRunKeyValueStorePutRequest) (*KeyValueStoreResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *KeyValueStoreResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultKeyValueStoreAPIService.ActorRunKeyValueStorePut") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/actor-runs/{runId}/key-value-store" + localVarPath = strings.Replace(localVarPath, "{"+"runId"+"}", url.PathEscape(parameterValueToString(r.runId, "runId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.updateStoreRequest == nil { + return localVarReturnValue, nil, reportError("updateStoreRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.updateStoreRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 413 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 415 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiActorRunKeyValueStoreRecordDeleteRequest struct { + ctx context.Context + ApiService *DefaultKeyValueStoreAPIService + runId string + recordKey string +} + +func (r ApiActorRunKeyValueStoreRecordDeleteRequest) Execute() (*http.Response, error) { + return r.ApiService.ActorRunKeyValueStoreRecordDeleteExecute(r) +} + +/* +ActorRunKeyValueStoreRecordDelete Delete default store's record + +Removes a record specified by a key from the default key-value store of the Actor run. + +This endpoint is a shortcut for getting the run's `defaultKeyValueStoreId` and then using the +[Delete record](/api/v2/key-value-store-record-delete) endpoint. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param runId Actor run ID. + @param recordKey Key of the record. + @return ApiActorRunKeyValueStoreRecordDeleteRequest +*/ +func (a *DefaultKeyValueStoreAPIService) ActorRunKeyValueStoreRecordDelete(ctx context.Context, runId string, recordKey string) ApiActorRunKeyValueStoreRecordDeleteRequest { + return ApiActorRunKeyValueStoreRecordDeleteRequest{ + ApiService: a, + ctx: ctx, + runId: runId, + recordKey: recordKey, + } +} + +// Execute executes the request +func (a *DefaultKeyValueStoreAPIService) ActorRunKeyValueStoreRecordDeleteExecute(r ApiActorRunKeyValueStoreRecordDeleteRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultKeyValueStoreAPIService.ActorRunKeyValueStoreRecordDelete") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/actor-runs/{runId}/key-value-store/records/{recordKey}" + localVarPath = strings.Replace(localVarPath, "{"+"runId"+"}", url.PathEscape(parameterValueToString(r.runId, "runId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"recordKey"+"}", url.PathEscape(parameterValueToString(r.recordKey, "recordKey")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiActorRunKeyValueStoreRecordGetRequest struct { + ctx context.Context + ApiService *DefaultKeyValueStoreAPIService + runId string + recordKey string + signature *string + attachment *bool +} + +// Signature used for the access. +func (r ApiActorRunKeyValueStoreRecordGetRequest) Signature(signature string) ApiActorRunKeyValueStoreRecordGetRequest { + r.signature = &signature + return r +} + +// If `true` or `1`, the response will be served with `Content-Disposition: attachment` header, causing web browsers to offer downloading HTML records instead of displaying them. +func (r ApiActorRunKeyValueStoreRecordGetRequest) Attachment(attachment bool) ApiActorRunKeyValueStoreRecordGetRequest { + r.attachment = &attachment + return r +} + +func (r ApiActorRunKeyValueStoreRecordGetRequest) Execute() (map[string]interface{}, *http.Response, error) { + return r.ApiService.ActorRunKeyValueStoreRecordGetExecute(r) +} + +/* +ActorRunKeyValueStoreRecordGet Get default store's record + +Gets a value stored under a specific key in the default key-value store of the Actor run. + +This endpoint is a shortcut for getting the run's `defaultKeyValueStoreId` and then using the +[Get record](/api/v2/key-value-store-record-get) endpoint. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param runId Actor run ID. + @param recordKey Key of the record. + @return ApiActorRunKeyValueStoreRecordGetRequest +*/ +func (a *DefaultKeyValueStoreAPIService) ActorRunKeyValueStoreRecordGet(ctx context.Context, runId string, recordKey string) ApiActorRunKeyValueStoreRecordGetRequest { + return ApiActorRunKeyValueStoreRecordGetRequest{ + ApiService: a, + ctx: ctx, + runId: runId, + recordKey: recordKey, + } +} + +// Execute executes the request +// @return map[string]interface{} +func (a *DefaultKeyValueStoreAPIService) ActorRunKeyValueStoreRecordGetExecute(r ApiActorRunKeyValueStoreRecordGetRequest) (map[string]interface{}, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue map[string]interface{} + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultKeyValueStoreAPIService.ActorRunKeyValueStoreRecordGet") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/actor-runs/{runId}/key-value-store/records/{recordKey}" + localVarPath = strings.Replace(localVarPath, "{"+"runId"+"}", url.PathEscape(parameterValueToString(r.runId, "runId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"recordKey"+"}", url.PathEscape(parameterValueToString(r.recordKey, "recordKey")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.signature != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "signature", r.signature, "form", "") + } + if r.attachment != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "attachment", r.attachment, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json", "*/*"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiActorRunKeyValueStoreRecordPostRequest struct { + ctx context.Context + ApiService *DefaultKeyValueStoreAPIService + runId string + recordKey string + requestBody *map[string]interface{} + contentEncoding *string +} + +// +func (r ApiActorRunKeyValueStoreRecordPostRequest) RequestBody(requestBody map[string]interface{}) ApiActorRunKeyValueStoreRecordPostRequest { + r.requestBody = &requestBody + return r +} + +// +func (r ApiActorRunKeyValueStoreRecordPostRequest) ContentEncoding(contentEncoding string) ApiActorRunKeyValueStoreRecordPostRequest { + r.contentEncoding = &contentEncoding + return r +} + +func (r ApiActorRunKeyValueStoreRecordPostRequest) Execute() (map[string]interface{}, *http.Response, error) { + return r.ApiService.ActorRunKeyValueStoreRecordPostExecute(r) +} + +/* +ActorRunKeyValueStoreRecordPost Store record in default store (POST) + +Stores a value under a specific key in the default key-value store of the Actor run. + +This endpoint is a shortcut for getting the run's `defaultKeyValueStoreId` and then using the +[Store record](/api/v2/key-value-store-record-post) endpoint. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param runId Actor run ID. + @param recordKey Key of the record. + @return ApiActorRunKeyValueStoreRecordPostRequest +*/ +func (a *DefaultKeyValueStoreAPIService) ActorRunKeyValueStoreRecordPost(ctx context.Context, runId string, recordKey string) ApiActorRunKeyValueStoreRecordPostRequest { + return ApiActorRunKeyValueStoreRecordPostRequest{ + ApiService: a, + ctx: ctx, + runId: runId, + recordKey: recordKey, + } +} + +// Execute executes the request +// @return map[string]interface{} +func (a *DefaultKeyValueStoreAPIService) ActorRunKeyValueStoreRecordPostExecute(r ApiActorRunKeyValueStoreRecordPostRequest) (map[string]interface{}, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue map[string]interface{} + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultKeyValueStoreAPIService.ActorRunKeyValueStoreRecordPost") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/actor-runs/{runId}/key-value-store/records/{recordKey}" + localVarPath = strings.Replace(localVarPath, "{"+"runId"+"}", url.PathEscape(parameterValueToString(r.runId, "runId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"recordKey"+"}", url.PathEscape(parameterValueToString(r.recordKey, "recordKey")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.requestBody == nil { + return localVarReturnValue, nil, reportError("requestBody is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.contentEncoding != nil { + parameterAddToHeaderOrQuery(localVarHeaderParams, "Content-Encoding", r.contentEncoding, "simple", "") + } + // body params + localVarPostBody = r.requestBody + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 413 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 415 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiActorRunKeyValueStoreRecordPutRequest struct { + ctx context.Context + ApiService *DefaultKeyValueStoreAPIService + runId string + recordKey string + requestBody *map[string]interface{} + contentEncoding *string +} + +// +func (r ApiActorRunKeyValueStoreRecordPutRequest) RequestBody(requestBody map[string]interface{}) ApiActorRunKeyValueStoreRecordPutRequest { + r.requestBody = &requestBody + return r +} + +// +func (r ApiActorRunKeyValueStoreRecordPutRequest) ContentEncoding(contentEncoding string) ApiActorRunKeyValueStoreRecordPutRequest { + r.contentEncoding = &contentEncoding + return r +} + +func (r ApiActorRunKeyValueStoreRecordPutRequest) Execute() (map[string]interface{}, *http.Response, error) { + return r.ApiService.ActorRunKeyValueStoreRecordPutExecute(r) +} + +/* +ActorRunKeyValueStoreRecordPut Store record in default store + +Stores a value under a specific key in the default key-value store of the Actor run. + +This endpoint is a shortcut for getting the run's `defaultKeyValueStoreId` and then using the +[Store record](/api/v2/key-value-store-record-put) endpoint. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param runId Actor run ID. + @param recordKey Key of the record. + @return ApiActorRunKeyValueStoreRecordPutRequest +*/ +func (a *DefaultKeyValueStoreAPIService) ActorRunKeyValueStoreRecordPut(ctx context.Context, runId string, recordKey string) ApiActorRunKeyValueStoreRecordPutRequest { + return ApiActorRunKeyValueStoreRecordPutRequest{ + ApiService: a, + ctx: ctx, + runId: runId, + recordKey: recordKey, + } +} + +// Execute executes the request +// @return map[string]interface{} +func (a *DefaultKeyValueStoreAPIService) ActorRunKeyValueStoreRecordPutExecute(r ApiActorRunKeyValueStoreRecordPutRequest) (map[string]interface{}, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue map[string]interface{} + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultKeyValueStoreAPIService.ActorRunKeyValueStoreRecordPut") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/actor-runs/{runId}/key-value-store/records/{recordKey}" + localVarPath = strings.Replace(localVarPath, "{"+"runId"+"}", url.PathEscape(parameterValueToString(r.runId, "runId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"recordKey"+"}", url.PathEscape(parameterValueToString(r.recordKey, "recordKey")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.requestBody == nil { + return localVarReturnValue, nil, reportError("requestBody is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.contentEncoding != nil { + parameterAddToHeaderOrQuery(localVarHeaderParams, "Content-Encoding", r.contentEncoding, "simple", "") + } + // body params + localVarPostBody = r.requestBody + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 413 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 415 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiActorRunKeyValueStoreRecordsGetRequest struct { + ctx context.Context + ApiService *DefaultKeyValueStoreAPIService + runId string + collection *string + prefix *string + signature *string +} + +// If specified, only records belonging to a specific collection from the key-value store schema. The key-value store need to have a schema defined for this parameter to work. +func (r ApiActorRunKeyValueStoreRecordsGetRequest) Collection(collection string) ApiActorRunKeyValueStoreRecordsGetRequest { + r.collection = &collection + return r +} + +// If specified, only records whose key starts with the given prefix are included in the archive. +func (r ApiActorRunKeyValueStoreRecordsGetRequest) Prefix(prefix string) ApiActorRunKeyValueStoreRecordsGetRequest { + r.prefix = &prefix + return r +} + +// Signature used for the access. +func (r ApiActorRunKeyValueStoreRecordsGetRequest) Signature(signature string) ApiActorRunKeyValueStoreRecordsGetRequest { + r.signature = &signature + return r +} + +func (r ApiActorRunKeyValueStoreRecordsGetRequest) Execute() (*os.File, *http.Response, error) { + return r.ApiService.ActorRunKeyValueStoreRecordsGetExecute(r) +} + +/* +ActorRunKeyValueStoreRecordsGet Download default store's records + +Downloads all records from the default key-value store of the Actor run as a ZIP archive. + +This endpoint is a shortcut for getting the run's `defaultKeyValueStoreId` and then using the +[Download records](/api/v2/key-value-store-records-get) endpoint. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param runId Actor run ID. + @return ApiActorRunKeyValueStoreRecordsGetRequest +*/ +func (a *DefaultKeyValueStoreAPIService) ActorRunKeyValueStoreRecordsGet(ctx context.Context, runId string) ApiActorRunKeyValueStoreRecordsGetRequest { + return ApiActorRunKeyValueStoreRecordsGetRequest{ + ApiService: a, + ctx: ctx, + runId: runId, + } +} + +// Execute executes the request +// @return *os.File +func (a *DefaultKeyValueStoreAPIService) ActorRunKeyValueStoreRecordsGetExecute(r ApiActorRunKeyValueStoreRecordsGetRequest) (*os.File, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *os.File + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultKeyValueStoreAPIService.ActorRunKeyValueStoreRecordsGet") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/actor-runs/{runId}/key-value-store/records" + localVarPath = strings.Replace(localVarPath, "{"+"runId"+"}", url.PathEscape(parameterValueToString(r.runId, "runId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.collection != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "collection", r.collection, "form", "") + } + if r.prefix != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "prefix", r.prefix, "form", "") + } + if r.signature != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "signature", r.signature, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/zip", "application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/api_default_request_queue.go b/api_default_request_queue.go new file mode 100644 index 0000000..d43fa1a --- /dev/null +++ b/api_default_request_queue.go @@ -0,0 +1,3226 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" + "strings" +) + + +// DefaultRequestQueueAPIService DefaultRequestQueueAPI service +type DefaultRequestQueueAPIService service + +type ApiActorRunRequestQueueDeleteRequest struct { + ctx context.Context + ApiService *DefaultRequestQueueAPIService + runId string +} + +func (r ApiActorRunRequestQueueDeleteRequest) Execute() (*http.Response, error) { + return r.ApiService.ActorRunRequestQueueDeleteExecute(r) +} + +/* +ActorRunRequestQueueDelete Delete default request queue + +Deletes the default request queue associated with an Actor run. + +This endpoint is a shortcut for getting the run's `defaultRequestQueueId` and then using the +[Delete request queue](/api/v2/request-queue-delete) endpoint. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param runId Actor run ID. + @return ApiActorRunRequestQueueDeleteRequest +*/ +func (a *DefaultRequestQueueAPIService) ActorRunRequestQueueDelete(ctx context.Context, runId string) ApiActorRunRequestQueueDeleteRequest { + return ApiActorRunRequestQueueDeleteRequest{ + ApiService: a, + ctx: ctx, + runId: runId, + } +} + +// Execute executes the request +func (a *DefaultRequestQueueAPIService) ActorRunRequestQueueDeleteExecute(r ApiActorRunRequestQueueDeleteRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultRequestQueueAPIService.ActorRunRequestQueueDelete") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/actor-runs/{runId}/request-queue" + localVarPath = strings.Replace(localVarPath, "{"+"runId"+"}", url.PathEscape(parameterValueToString(r.runId, "runId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiActorRunRequestQueueGetRequest struct { + ctx context.Context + ApiService *DefaultRequestQueueAPIService + runId string +} + +func (r ApiActorRunRequestQueueGetRequest) Execute() (*RequestQueueResponse, *http.Response, error) { + return r.ApiService.ActorRunRequestQueueGetExecute(r) +} + +/* +ActorRunRequestQueueGet Get default request queue + +Returns the default request queue associated with an Actor run. + +This endpoint is a shortcut for getting the run's `defaultRequestQueueId` and then using the +[Get request queue](/api/v2/request-queue-get) endpoint. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param runId Actor run ID. + @return ApiActorRunRequestQueueGetRequest +*/ +func (a *DefaultRequestQueueAPIService) ActorRunRequestQueueGet(ctx context.Context, runId string) ApiActorRunRequestQueueGetRequest { + return ApiActorRunRequestQueueGetRequest{ + ApiService: a, + ctx: ctx, + runId: runId, + } +} + +// Execute executes the request +// @return RequestQueueResponse +func (a *DefaultRequestQueueAPIService) ActorRunRequestQueueGetExecute(r ApiActorRunRequestQueueGetRequest) (*RequestQueueResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *RequestQueueResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultRequestQueueAPIService.ActorRunRequestQueueGet") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/actor-runs/{runId}/request-queue" + localVarPath = strings.Replace(localVarPath, "{"+"runId"+"}", url.PathEscape(parameterValueToString(r.runId, "runId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiActorRunRequestQueueHeadGetRequest struct { + ctx context.Context + ApiService *DefaultRequestQueueAPIService + runId string + limit *float64 + clientKey *string +} + +// How many items from queue should be returned. +func (r ApiActorRunRequestQueueHeadGetRequest) Limit(limit float64) ApiActorRunRequestQueueHeadGetRequest { + r.limit = &limit + return r +} + +// A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. +func (r ApiActorRunRequestQueueHeadGetRequest) ClientKey(clientKey string) ApiActorRunRequestQueueHeadGetRequest { + r.clientKey = &clientKey + return r +} + +func (r ApiActorRunRequestQueueHeadGetRequest) Execute() (*HeadResponse, *http.Response, error) { + return r.ApiService.ActorRunRequestQueueHeadGetExecute(r) +} + +/* +ActorRunRequestQueueHeadGet Get default request queue head + +Returns the given number of first requests from the default request queue of the Actor run. + +This endpoint is a shortcut for getting the run's `defaultRequestQueueId` and then using the +[Get head](/api/v2/request-queue-head-get) endpoint. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param runId Actor run ID. + @return ApiActorRunRequestQueueHeadGetRequest +*/ +func (a *DefaultRequestQueueAPIService) ActorRunRequestQueueHeadGet(ctx context.Context, runId string) ApiActorRunRequestQueueHeadGetRequest { + return ApiActorRunRequestQueueHeadGetRequest{ + ApiService: a, + ctx: ctx, + runId: runId, + } +} + +// Execute executes the request +// @return HeadResponse +func (a *DefaultRequestQueueAPIService) ActorRunRequestQueueHeadGetExecute(r ApiActorRunRequestQueueHeadGetRequest) (*HeadResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *HeadResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultRequestQueueAPIService.ActorRunRequestQueueHeadGet") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/actor-runs/{runId}/request-queue/head" + localVarPath = strings.Replace(localVarPath, "{"+"runId"+"}", url.PathEscape(parameterValueToString(r.runId, "runId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.limit != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "form", "") + } + if r.clientKey != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "clientKey", r.clientKey, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiActorRunRequestQueueHeadLockPostRequest struct { + ctx context.Context + ApiService *DefaultRequestQueueAPIService + runId string + lockSecs *float64 + limit *float64 + clientKey *string +} + +// How long the requests will be locked for (in seconds). +func (r ApiActorRunRequestQueueHeadLockPostRequest) LockSecs(lockSecs float64) ApiActorRunRequestQueueHeadLockPostRequest { + r.lockSecs = &lockSecs + return r +} + +// How many items from the queue should be returned. +func (r ApiActorRunRequestQueueHeadLockPostRequest) Limit(limit float64) ApiActorRunRequestQueueHeadLockPostRequest { + r.limit = &limit + return r +} + +// A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. +func (r ApiActorRunRequestQueueHeadLockPostRequest) ClientKey(clientKey string) ApiActorRunRequestQueueHeadLockPostRequest { + r.clientKey = &clientKey + return r +} + +func (r ApiActorRunRequestQueueHeadLockPostRequest) Execute() (*HeadAndLockResponse, *http.Response, error) { + return r.ApiService.ActorRunRequestQueueHeadLockPostExecute(r) +} + +/* +ActorRunRequestQueueHeadLockPost Get and lock default request queue head + +Returns the given number of first requests from the default request queue of the Actor run +and locks them for the given time. + +This endpoint is a shortcut for getting the run's `defaultRequestQueueId` and then using the +[Get head and lock](/api/v2/request-queue-head-lock-post) endpoint. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param runId Actor run ID. + @return ApiActorRunRequestQueueHeadLockPostRequest +*/ +func (a *DefaultRequestQueueAPIService) ActorRunRequestQueueHeadLockPost(ctx context.Context, runId string) ApiActorRunRequestQueueHeadLockPostRequest { + return ApiActorRunRequestQueueHeadLockPostRequest{ + ApiService: a, + ctx: ctx, + runId: runId, + } +} + +// Execute executes the request +// @return HeadAndLockResponse +func (a *DefaultRequestQueueAPIService) ActorRunRequestQueueHeadLockPostExecute(r ApiActorRunRequestQueueHeadLockPostRequest) (*HeadAndLockResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *HeadAndLockResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultRequestQueueAPIService.ActorRunRequestQueueHeadLockPost") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/actor-runs/{runId}/request-queue/head/lock" + localVarPath = strings.Replace(localVarPath, "{"+"runId"+"}", url.PathEscape(parameterValueToString(r.runId, "runId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.lockSecs == nil { + return localVarReturnValue, nil, reportError("lockSecs is required and must be specified") + } + + parameterAddToHeaderOrQuery(localVarQueryParams, "lockSecs", r.lockSecs, "form", "") + if r.limit != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "form", "") + } + if r.clientKey != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "clientKey", r.clientKey, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiActorRunRequestQueuePutRequest struct { + ctx context.Context + ApiService *DefaultRequestQueueAPIService + runId string + updateRequestQueueRequest *UpdateRequestQueueRequest +} + +// +func (r ApiActorRunRequestQueuePutRequest) UpdateRequestQueueRequest(updateRequestQueueRequest UpdateRequestQueueRequest) ApiActorRunRequestQueuePutRequest { + r.updateRequestQueueRequest = &updateRequestQueueRequest + return r +} + +func (r ApiActorRunRequestQueuePutRequest) Execute() (*RequestQueueResponse, *http.Response, error) { + return r.ApiService.ActorRunRequestQueuePutExecute(r) +} + +/* +ActorRunRequestQueuePut Update default request queue + +Updates the default request queue associated with an Actor run. + +This endpoint is a shortcut for getting the run's `defaultRequestQueueId` and then using the +[Update request queue](/api/v2/request-queue-put) endpoint. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param runId Actor run ID. + @return ApiActorRunRequestQueuePutRequest +*/ +func (a *DefaultRequestQueueAPIService) ActorRunRequestQueuePut(ctx context.Context, runId string) ApiActorRunRequestQueuePutRequest { + return ApiActorRunRequestQueuePutRequest{ + ApiService: a, + ctx: ctx, + runId: runId, + } +} + +// Execute executes the request +// @return RequestQueueResponse +func (a *DefaultRequestQueueAPIService) ActorRunRequestQueuePutExecute(r ApiActorRunRequestQueuePutRequest) (*RequestQueueResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *RequestQueueResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultRequestQueueAPIService.ActorRunRequestQueuePut") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/actor-runs/{runId}/request-queue" + localVarPath = strings.Replace(localVarPath, "{"+"runId"+"}", url.PathEscape(parameterValueToString(r.runId, "runId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.updateRequestQueueRequest == nil { + return localVarReturnValue, nil, reportError("updateRequestQueueRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.updateRequestQueueRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 413 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 415 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiActorRunRequestQueueRequestDeleteRequest struct { + ctx context.Context + ApiService *DefaultRequestQueueAPIService + runId string + requestId string + clientKey *string +} + +// A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. +func (r ApiActorRunRequestQueueRequestDeleteRequest) ClientKey(clientKey string) ApiActorRunRequestQueueRequestDeleteRequest { + r.clientKey = &clientKey + return r +} + +func (r ApiActorRunRequestQueueRequestDeleteRequest) Execute() (*http.Response, error) { + return r.ApiService.ActorRunRequestQueueRequestDeleteExecute(r) +} + +/* +ActorRunRequestQueueRequestDelete Delete request from default request queue + +Deletes a request from the default request queue of the Actor run. + +This endpoint is a shortcut for getting the run's `defaultRequestQueueId` and then using the +[Delete request](/api/v2/request-queue-request-delete) endpoint. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param runId Actor run ID. + @param requestId Request ID. + @return ApiActorRunRequestQueueRequestDeleteRequest +*/ +func (a *DefaultRequestQueueAPIService) ActorRunRequestQueueRequestDelete(ctx context.Context, runId string, requestId string) ApiActorRunRequestQueueRequestDeleteRequest { + return ApiActorRunRequestQueueRequestDeleteRequest{ + ApiService: a, + ctx: ctx, + runId: runId, + requestId: requestId, + } +} + +// Execute executes the request +func (a *DefaultRequestQueueAPIService) ActorRunRequestQueueRequestDeleteExecute(r ApiActorRunRequestQueueRequestDeleteRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultRequestQueueAPIService.ActorRunRequestQueueRequestDelete") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/actor-runs/{runId}/request-queue/requests/{requestId}" + localVarPath = strings.Replace(localVarPath, "{"+"runId"+"}", url.PathEscape(parameterValueToString(r.runId, "runId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"requestId"+"}", url.PathEscape(parameterValueToString(r.requestId, "requestId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.clientKey != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "clientKey", r.clientKey, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiActorRunRequestQueueRequestGetRequest struct { + ctx context.Context + ApiService *DefaultRequestQueueAPIService + runId string + requestId string +} + +func (r ApiActorRunRequestQueueRequestGetRequest) Execute() (*RequestResponse, *http.Response, error) { + return r.ApiService.ActorRunRequestQueueRequestGetExecute(r) +} + +/* +ActorRunRequestQueueRequestGet Get request from default request queue + +Returns a request from the default request queue of the Actor run. + +This endpoint is a shortcut for getting the run's `defaultRequestQueueId` and then using the +[Get request](/api/v2/request-queue-request-get) endpoint. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param runId Actor run ID. + @param requestId Request ID. + @return ApiActorRunRequestQueueRequestGetRequest +*/ +func (a *DefaultRequestQueueAPIService) ActorRunRequestQueueRequestGet(ctx context.Context, runId string, requestId string) ApiActorRunRequestQueueRequestGetRequest { + return ApiActorRunRequestQueueRequestGetRequest{ + ApiService: a, + ctx: ctx, + runId: runId, + requestId: requestId, + } +} + +// Execute executes the request +// @return RequestResponse +func (a *DefaultRequestQueueAPIService) ActorRunRequestQueueRequestGetExecute(r ApiActorRunRequestQueueRequestGetRequest) (*RequestResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *RequestResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultRequestQueueAPIService.ActorRunRequestQueueRequestGet") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/actor-runs/{runId}/request-queue/requests/{requestId}" + localVarPath = strings.Replace(localVarPath, "{"+"runId"+"}", url.PathEscape(parameterValueToString(r.runId, "runId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"requestId"+"}", url.PathEscape(parameterValueToString(r.requestId, "requestId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiActorRunRequestQueueRequestLockDeleteRequest struct { + ctx context.Context + ApiService *DefaultRequestQueueAPIService + runId string + requestId string + clientKey *string + forefront *string +} + +// A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. +func (r ApiActorRunRequestQueueRequestLockDeleteRequest) ClientKey(clientKey string) ApiActorRunRequestQueueRequestLockDeleteRequest { + r.clientKey = &clientKey + return r +} + +// Determines if request should be added to the head of the queue or to the end after lock was removed. +func (r ApiActorRunRequestQueueRequestLockDeleteRequest) Forefront(forefront string) ApiActorRunRequestQueueRequestLockDeleteRequest { + r.forefront = &forefront + return r +} + +func (r ApiActorRunRequestQueueRequestLockDeleteRequest) Execute() (*http.Response, error) { + return r.ApiService.ActorRunRequestQueueRequestLockDeleteExecute(r) +} + +/* +ActorRunRequestQueueRequestLockDelete Delete lock on request in default request queue + +Deletes a request lock in the default request queue of the Actor run. + +This endpoint is a shortcut for getting the run's `defaultRequestQueueId` and then using the +[Delete request lock](/api/v2/request-queue-request-lock-delete) endpoint. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param runId Actor run ID. + @param requestId Request ID. + @return ApiActorRunRequestQueueRequestLockDeleteRequest +*/ +func (a *DefaultRequestQueueAPIService) ActorRunRequestQueueRequestLockDelete(ctx context.Context, runId string, requestId string) ApiActorRunRequestQueueRequestLockDeleteRequest { + return ApiActorRunRequestQueueRequestLockDeleteRequest{ + ApiService: a, + ctx: ctx, + runId: runId, + requestId: requestId, + } +} + +// Execute executes the request +func (a *DefaultRequestQueueAPIService) ActorRunRequestQueueRequestLockDeleteExecute(r ApiActorRunRequestQueueRequestLockDeleteRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultRequestQueueAPIService.ActorRunRequestQueueRequestLockDelete") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/actor-runs/{runId}/request-queue/requests/{requestId}/lock" + localVarPath = strings.Replace(localVarPath, "{"+"runId"+"}", url.PathEscape(parameterValueToString(r.runId, "runId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"requestId"+"}", url.PathEscape(parameterValueToString(r.requestId, "requestId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.clientKey != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "clientKey", r.clientKey, "form", "") + } + if r.forefront != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "forefront", r.forefront, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiActorRunRequestQueueRequestLockPutRequest struct { + ctx context.Context + ApiService *DefaultRequestQueueAPIService + runId string + requestId string + lockSecs *float64 + clientKey *string + forefront *string +} + +// How long the requests will be locked for (in seconds). +func (r ApiActorRunRequestQueueRequestLockPutRequest) LockSecs(lockSecs float64) ApiActorRunRequestQueueRequestLockPutRequest { + r.lockSecs = &lockSecs + return r +} + +// A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. +func (r ApiActorRunRequestQueueRequestLockPutRequest) ClientKey(clientKey string) ApiActorRunRequestQueueRequestLockPutRequest { + r.clientKey = &clientKey + return r +} + +// Determines if request should be added to the head of the queue or to the end after lock expires. +func (r ApiActorRunRequestQueueRequestLockPutRequest) Forefront(forefront string) ApiActorRunRequestQueueRequestLockPutRequest { + r.forefront = &forefront + return r +} + +func (r ApiActorRunRequestQueueRequestLockPutRequest) Execute() (*ProlongRequestLockResponse, *http.Response, error) { + return r.ApiService.ActorRunRequestQueueRequestLockPutExecute(r) +} + +/* +ActorRunRequestQueueRequestLockPut Prolong lock on request in default request queue + +Prolongs a request lock in the default request queue of the Actor run. + +This endpoint is a shortcut for getting the run's `defaultRequestQueueId` and then using the +[Prolong request lock](/api/v2/request-queue-request-lock-put) endpoint. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param runId Actor run ID. + @param requestId Request ID. + @return ApiActorRunRequestQueueRequestLockPutRequest +*/ +func (a *DefaultRequestQueueAPIService) ActorRunRequestQueueRequestLockPut(ctx context.Context, runId string, requestId string) ApiActorRunRequestQueueRequestLockPutRequest { + return ApiActorRunRequestQueueRequestLockPutRequest{ + ApiService: a, + ctx: ctx, + runId: runId, + requestId: requestId, + } +} + +// Execute executes the request +// @return ProlongRequestLockResponse +func (a *DefaultRequestQueueAPIService) ActorRunRequestQueueRequestLockPutExecute(r ApiActorRunRequestQueueRequestLockPutRequest) (*ProlongRequestLockResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ProlongRequestLockResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultRequestQueueAPIService.ActorRunRequestQueueRequestLockPut") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/actor-runs/{runId}/request-queue/requests/{requestId}/lock" + localVarPath = strings.Replace(localVarPath, "{"+"runId"+"}", url.PathEscape(parameterValueToString(r.runId, "runId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"requestId"+"}", url.PathEscape(parameterValueToString(r.requestId, "requestId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.lockSecs == nil { + return localVarReturnValue, nil, reportError("lockSecs is required and must be specified") + } + + parameterAddToHeaderOrQuery(localVarQueryParams, "lockSecs", r.lockSecs, "form", "") + if r.clientKey != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "clientKey", r.clientKey, "form", "") + } + if r.forefront != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "forefront", r.forefront, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiActorRunRequestQueueRequestPutRequest struct { + ctx context.Context + ApiService *DefaultRequestQueueAPIService + runId string + requestId string + request *Request + forefront *string + clientKey *string +} + +// +func (r ApiActorRunRequestQueueRequestPutRequest) Request(request Request) ApiActorRunRequestQueueRequestPutRequest { + r.request = &request + return r +} + +// Determines if request should be added to the head of the queue or to the end. Default value is `false` (end of queue). +func (r ApiActorRunRequestQueueRequestPutRequest) Forefront(forefront string) ApiActorRunRequestQueueRequestPutRequest { + r.forefront = &forefront + return r +} + +// A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. +func (r ApiActorRunRequestQueueRequestPutRequest) ClientKey(clientKey string) ApiActorRunRequestQueueRequestPutRequest { + r.clientKey = &clientKey + return r +} + +func (r ApiActorRunRequestQueueRequestPutRequest) Execute() (*UpdateRequestResponse, *http.Response, error) { + return r.ApiService.ActorRunRequestQueueRequestPutExecute(r) +} + +/* +ActorRunRequestQueueRequestPut Update request in default request queue + +Updates a request in the default request queue of the Actor run. + +This endpoint is a shortcut for getting the run's `defaultRequestQueueId` and then using the +[Update request](/api/v2/request-queue-request-put) endpoint. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param runId Actor run ID. + @param requestId Request ID. + @return ApiActorRunRequestQueueRequestPutRequest +*/ +func (a *DefaultRequestQueueAPIService) ActorRunRequestQueueRequestPut(ctx context.Context, runId string, requestId string) ApiActorRunRequestQueueRequestPutRequest { + return ApiActorRunRequestQueueRequestPutRequest{ + ApiService: a, + ctx: ctx, + runId: runId, + requestId: requestId, + } +} + +// Execute executes the request +// @return UpdateRequestResponse +func (a *DefaultRequestQueueAPIService) ActorRunRequestQueueRequestPutExecute(r ApiActorRunRequestQueueRequestPutRequest) (*UpdateRequestResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *UpdateRequestResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultRequestQueueAPIService.ActorRunRequestQueueRequestPut") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/actor-runs/{runId}/request-queue/requests/{requestId}" + localVarPath = strings.Replace(localVarPath, "{"+"runId"+"}", url.PathEscape(parameterValueToString(r.runId, "runId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"requestId"+"}", url.PathEscape(parameterValueToString(r.requestId, "requestId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.request == nil { + return localVarReturnValue, nil, reportError("request is required and must be specified") + } + + if r.forefront != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "forefront", r.forefront, "form", "") + } + if r.clientKey != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "clientKey", r.clientKey, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.request + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 413 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 415 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiActorRunRequestQueueRequestsBatchDeleteRequest struct { + ctx context.Context + ApiService *DefaultRequestQueueAPIService + runId string + contentType *string + requestDraftDelete *[]RequestDraftDelete + clientKey *string +} + +// +func (r ApiActorRunRequestQueueRequestsBatchDeleteRequest) ContentType(contentType string) ApiActorRunRequestQueueRequestsBatchDeleteRequest { + r.contentType = &contentType + return r +} + +// +func (r ApiActorRunRequestQueueRequestsBatchDeleteRequest) RequestDraftDelete(requestDraftDelete []RequestDraftDelete) ApiActorRunRequestQueueRequestsBatchDeleteRequest { + r.requestDraftDelete = &requestDraftDelete + return r +} + +// A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. +func (r ApiActorRunRequestQueueRequestsBatchDeleteRequest) ClientKey(clientKey string) ApiActorRunRequestQueueRequestsBatchDeleteRequest { + r.clientKey = &clientKey + return r +} + +func (r ApiActorRunRequestQueueRequestsBatchDeleteRequest) Execute() (*BatchDeleteResponse, *http.Response, error) { + return r.ApiService.ActorRunRequestQueueRequestsBatchDeleteExecute(r) +} + +/* +ActorRunRequestQueueRequestsBatchDelete Batch delete requests from default request queue + +Batch-deletes requests from the default request queue of the Actor run. + +This endpoint is a shortcut for getting the run's `defaultRequestQueueId` and then using the +[Delete requests](/api/v2/request-queue-requests-batch-delete) endpoint. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param runId Actor run ID. + @return ApiActorRunRequestQueueRequestsBatchDeleteRequest +*/ +func (a *DefaultRequestQueueAPIService) ActorRunRequestQueueRequestsBatchDelete(ctx context.Context, runId string) ApiActorRunRequestQueueRequestsBatchDeleteRequest { + return ApiActorRunRequestQueueRequestsBatchDeleteRequest{ + ApiService: a, + ctx: ctx, + runId: runId, + } +} + +// Execute executes the request +// @return BatchDeleteResponse +func (a *DefaultRequestQueueAPIService) ActorRunRequestQueueRequestsBatchDeleteExecute(r ApiActorRunRequestQueueRequestsBatchDeleteRequest) (*BatchDeleteResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *BatchDeleteResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultRequestQueueAPIService.ActorRunRequestQueueRequestsBatchDelete") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/actor-runs/{runId}/request-queue/requests/batch" + localVarPath = strings.Replace(localVarPath, "{"+"runId"+"}", url.PathEscape(parameterValueToString(r.runId, "runId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.contentType == nil { + return localVarReturnValue, nil, reportError("contentType is required and must be specified") + } + if r.requestDraftDelete == nil { + return localVarReturnValue, nil, reportError("requestDraftDelete is required and must be specified") + } + + if r.clientKey != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "clientKey", r.clientKey, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + parameterAddToHeaderOrQuery(localVarHeaderParams, "Content-Type", r.contentType, "simple", "") + // body params + localVarPostBody = r.requestDraftDelete + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 413 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 415 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiActorRunRequestQueueRequestsBatchPostRequest struct { + ctx context.Context + ApiService *DefaultRequestQueueAPIService + runId string + requestBase *[]RequestBase + clientKey *string + forefront *string +} + +// +func (r ApiActorRunRequestQueueRequestsBatchPostRequest) RequestBase(requestBase []RequestBase) ApiActorRunRequestQueueRequestsBatchPostRequest { + r.requestBase = &requestBase + return r +} + +// A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. +func (r ApiActorRunRequestQueueRequestsBatchPostRequest) ClientKey(clientKey string) ApiActorRunRequestQueueRequestsBatchPostRequest { + r.clientKey = &clientKey + return r +} + +// Determines if request should be added to the head of the queue or to the end. Default value is `false` (end of queue). +func (r ApiActorRunRequestQueueRequestsBatchPostRequest) Forefront(forefront string) ApiActorRunRequestQueueRequestsBatchPostRequest { + r.forefront = &forefront + return r +} + +func (r ApiActorRunRequestQueueRequestsBatchPostRequest) Execute() (*BatchAddResponse, *http.Response, error) { + return r.ApiService.ActorRunRequestQueueRequestsBatchPostExecute(r) +} + +/* +ActorRunRequestQueueRequestsBatchPost Batch add requests to default request queue + +Adds requests to the default request queue of the Actor run in batch. + +This endpoint is a shortcut for getting the run's `defaultRequestQueueId` and then using the +[Add requests](/api/v2/request-queue-requests-batch-post) endpoint. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param runId Actor run ID. + @return ApiActorRunRequestQueueRequestsBatchPostRequest +*/ +func (a *DefaultRequestQueueAPIService) ActorRunRequestQueueRequestsBatchPost(ctx context.Context, runId string) ApiActorRunRequestQueueRequestsBatchPostRequest { + return ApiActorRunRequestQueueRequestsBatchPostRequest{ + ApiService: a, + ctx: ctx, + runId: runId, + } +} + +// Execute executes the request +// @return BatchAddResponse +func (a *DefaultRequestQueueAPIService) ActorRunRequestQueueRequestsBatchPostExecute(r ApiActorRunRequestQueueRequestsBatchPostRequest) (*BatchAddResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *BatchAddResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultRequestQueueAPIService.ActorRunRequestQueueRequestsBatchPost") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/actor-runs/{runId}/request-queue/requests/batch" + localVarPath = strings.Replace(localVarPath, "{"+"runId"+"}", url.PathEscape(parameterValueToString(r.runId, "runId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.requestBase == nil { + return localVarReturnValue, nil, reportError("requestBase is required and must be specified") + } + + if r.clientKey != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "clientKey", r.clientKey, "form", "") + } + if r.forefront != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "forefront", r.forefront, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.requestBase + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 413 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 415 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiActorRunRequestQueueRequestsGetRequest struct { + ctx context.Context + ApiService *DefaultRequestQueueAPIService + runId string + clientKey *string + exclusiveStartId *string + limit *float64 + cursor *string + filter *[]string +} + +// A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. +func (r ApiActorRunRequestQueueRequestsGetRequest) ClientKey(clientKey string) ApiActorRunRequestQueueRequestsGetRequest { + r.clientKey = &clientKey + return r +} + +// All requests up to this one (including) are skipped from the result. (Deprecated, use `cursor` instead.) +// Deprecated +func (r ApiActorRunRequestQueueRequestsGetRequest) ExclusiveStartId(exclusiveStartId string) ApiActorRunRequestQueueRequestsGetRequest { + r.exclusiveStartId = &exclusiveStartId + return r +} + +// Number of keys to be returned. Maximum value is `10000`. +func (r ApiActorRunRequestQueueRequestsGetRequest) Limit(limit float64) ApiActorRunRequestQueueRequestsGetRequest { + r.limit = &limit + return r +} + +// A cursor string for pagination, returned in the previous response as `nextCursor`. Use this to retrieve the next page of requests. +func (r ApiActorRunRequestQueueRequestsGetRequest) Cursor(cursor string) ApiActorRunRequestQueueRequestsGetRequest { + r.cursor = &cursor + return r +} + +// Filter requests by their state. Possible values are `locked` and `pending`. You can combine multiple values separated by commas, which will mean the union of these filters – requests matching any of the specified states will be returned. (Not compatible with deprecated `exclusiveStartId` parameter.) +func (r ApiActorRunRequestQueueRequestsGetRequest) Filter(filter []string) ApiActorRunRequestQueueRequestsGetRequest { + r.filter = &filter + return r +} + +func (r ApiActorRunRequestQueueRequestsGetRequest) Execute() (*ListOfRequestsResponse, *http.Response, error) { + return r.ApiService.ActorRunRequestQueueRequestsGetExecute(r) +} + +/* +ActorRunRequestQueueRequestsGet List default request queue's requests + +Returns a list of requests from the default request queue of the Actor run. + +This endpoint is a shortcut for getting the run's `defaultRequestQueueId` and then using the +[List requests](/api/v2/request-queue-requests-get) endpoint. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param runId Actor run ID. + @return ApiActorRunRequestQueueRequestsGetRequest +*/ +func (a *DefaultRequestQueueAPIService) ActorRunRequestQueueRequestsGet(ctx context.Context, runId string) ApiActorRunRequestQueueRequestsGetRequest { + return ApiActorRunRequestQueueRequestsGetRequest{ + ApiService: a, + ctx: ctx, + runId: runId, + } +} + +// Execute executes the request +// @return ListOfRequestsResponse +func (a *DefaultRequestQueueAPIService) ActorRunRequestQueueRequestsGetExecute(r ApiActorRunRequestQueueRequestsGetRequest) (*ListOfRequestsResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ListOfRequestsResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultRequestQueueAPIService.ActorRunRequestQueueRequestsGet") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/actor-runs/{runId}/request-queue/requests" + localVarPath = strings.Replace(localVarPath, "{"+"runId"+"}", url.PathEscape(parameterValueToString(r.runId, "runId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.clientKey != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "clientKey", r.clientKey, "form", "") + } + if r.exclusiveStartId != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "exclusiveStartId", r.exclusiveStartId, "form", "") + } + if r.limit != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "form", "") + } + if r.cursor != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "cursor", r.cursor, "form", "") + } + if r.filter != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "filter", r.filter, "form", "csv") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiActorRunRequestQueueRequestsPostRequest struct { + ctx context.Context + ApiService *DefaultRequestQueueAPIService + runId string + requestBase *RequestBase + clientKey *string + forefront *string +} + +// +func (r ApiActorRunRequestQueueRequestsPostRequest) RequestBase(requestBase RequestBase) ApiActorRunRequestQueueRequestsPostRequest { + r.requestBase = &requestBase + return r +} + +// A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. +func (r ApiActorRunRequestQueueRequestsPostRequest) ClientKey(clientKey string) ApiActorRunRequestQueueRequestsPostRequest { + r.clientKey = &clientKey + return r +} + +// Determines if request should be added to the head of the queue or to the end. Default value is `false` (end of queue). +func (r ApiActorRunRequestQueueRequestsPostRequest) Forefront(forefront string) ApiActorRunRequestQueueRequestsPostRequest { + r.forefront = &forefront + return r +} + +func (r ApiActorRunRequestQueueRequestsPostRequest) Execute() (*AddRequestResponse, *http.Response, error) { + return r.ApiService.ActorRunRequestQueueRequestsPostExecute(r) +} + +/* +ActorRunRequestQueueRequestsPost Add request to default request queue + +Adds a request to the default request queue of the Actor run. + +This endpoint is a shortcut for getting the run's `defaultRequestQueueId` and then using the +[Add request](/api/v2/request-queue-requests-post) endpoint. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param runId Actor run ID. + @return ApiActorRunRequestQueueRequestsPostRequest +*/ +func (a *DefaultRequestQueueAPIService) ActorRunRequestQueueRequestsPost(ctx context.Context, runId string) ApiActorRunRequestQueueRequestsPostRequest { + return ApiActorRunRequestQueueRequestsPostRequest{ + ApiService: a, + ctx: ctx, + runId: runId, + } +} + +// Execute executes the request +// @return AddRequestResponse +func (a *DefaultRequestQueueAPIService) ActorRunRequestQueueRequestsPostExecute(r ApiActorRunRequestQueueRequestsPostRequest) (*AddRequestResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *AddRequestResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultRequestQueueAPIService.ActorRunRequestQueueRequestsPost") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/actor-runs/{runId}/request-queue/requests" + localVarPath = strings.Replace(localVarPath, "{"+"runId"+"}", url.PathEscape(parameterValueToString(r.runId, "runId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.requestBase == nil { + return localVarReturnValue, nil, reportError("requestBase is required and must be specified") + } + + if r.clientKey != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "clientKey", r.clientKey, "form", "") + } + if r.forefront != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "forefront", r.forefront, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.requestBase + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 413 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 415 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiActorRunRequestQueueRequestsUnlockPostRequest struct { + ctx context.Context + ApiService *DefaultRequestQueueAPIService + runId string + clientKey *string +} + +// A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. +func (r ApiActorRunRequestQueueRequestsUnlockPostRequest) ClientKey(clientKey string) ApiActorRunRequestQueueRequestsUnlockPostRequest { + r.clientKey = &clientKey + return r +} + +func (r ApiActorRunRequestQueueRequestsUnlockPostRequest) Execute() (*UnlockRequestsResponse, *http.Response, error) { + return r.ApiService.ActorRunRequestQueueRequestsUnlockPostExecute(r) +} + +/* +ActorRunRequestQueueRequestsUnlockPost Unlock requests in default request queue + +Unlocks requests in the default request queue of the Actor run that are currently locked by the client. + +This endpoint is a shortcut for getting the run's `defaultRequestQueueId` and then using the +[Unlock requests](/api/v2/request-queue-requests-unlock-post) endpoint. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param runId Actor run ID. + @return ApiActorRunRequestQueueRequestsUnlockPostRequest +*/ +func (a *DefaultRequestQueueAPIService) ActorRunRequestQueueRequestsUnlockPost(ctx context.Context, runId string) ApiActorRunRequestQueueRequestsUnlockPostRequest { + return ApiActorRunRequestQueueRequestsUnlockPostRequest{ + ApiService: a, + ctx: ctx, + runId: runId, + } +} + +// Execute executes the request +// @return UnlockRequestsResponse +func (a *DefaultRequestQueueAPIService) ActorRunRequestQueueRequestsUnlockPostExecute(r ApiActorRunRequestQueueRequestsUnlockPostRequest) (*UnlockRequestsResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *UnlockRequestsResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultRequestQueueAPIService.ActorRunRequestQueueRequestsUnlockPost") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/actor-runs/{runId}/request-queue/requests/unlock" + localVarPath = strings.Replace(localVarPath, "{"+"runId"+"}", url.PathEscape(parameterValueToString(r.runId, "runId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.clientKey != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "clientKey", r.clientKey, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/api_last_actor_runs_abort.go b/api_last_actor_runs_abort.go new file mode 100644 index 0000000..5938d29 --- /dev/null +++ b/api_last_actor_runs_abort.go @@ -0,0 +1,233 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" + "strings" +) + + +// LastActorRunsAbortAPIService LastActorRunsAbortAPI service +type LastActorRunsAbortAPIService service + +type ApiActRunsLastAbortPostRequest struct { + ctx context.Context + ApiService *LastActorRunsAbortAPIService + actorId string + status *string + gracefully *bool +} + +// Filter for the run status. +func (r ApiActRunsLastAbortPostRequest) Status(status string) ApiActRunsLastAbortPostRequest { + r.status = &status + return r +} + +// If true passed, the Actor run will abort gracefully. It will send `aborting` and `persistState` event into run and force-stop the run after 30 seconds. It is helpful in cases where you plan to resurrect the run later. +func (r ApiActRunsLastAbortPostRequest) Gracefully(gracefully bool) ApiActRunsLastAbortPostRequest { + r.gracefully = &gracefully + return r +} + +func (r ApiActRunsLastAbortPostRequest) Execute() (*RunResponse, *http.Response, error) { + return r.ApiService.ActRunsLastAbortPostExecute(r) +} + +/* +ActRunsLastAbortPost Abort Actor's last run + +Aborts the last run of the specified Actor and returns an object that +contains all the details about the run. + +This endpoint is a shortcut for [Abort run](#/reference/actor-runs/abort-run/abort-run) +on the Actor's last run. Only runs that are starting or running are aborted. +For runs with status `FINISHED`, `FAILED`, `ABORTING` and `TIMED-OUT` this call +does nothing. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param actorId Actor ID or a tilde-separated owner's username and Actor name. + @return ApiActRunsLastAbortPostRequest +*/ +func (a *LastActorRunsAbortAPIService) ActRunsLastAbortPost(ctx context.Context, actorId string) ApiActRunsLastAbortPostRequest { + return ApiActRunsLastAbortPostRequest{ + ApiService: a, + ctx: ctx, + actorId: actorId, + } +} + +// Execute executes the request +// @return RunResponse +func (a *LastActorRunsAbortAPIService) ActRunsLastAbortPostExecute(r ApiActRunsLastAbortPostRequest) (*RunResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *RunResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LastActorRunsAbortAPIService.ActRunsLastAbortPost") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/actors/{actorId}/runs/last/abort" + localVarPath = strings.Replace(localVarPath, "{"+"actorId"+"}", url.PathEscape(parameterValueToString(r.actorId, "actorId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.status != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "status", r.status, "form", "") + } + if r.gracefully != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "gracefully", r.gracefully, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/api_last_actor_runs_default_dataset.go b/api_last_actor_runs_default_dataset.go new file mode 100644 index 0000000..8745309 --- /dev/null +++ b/api_last_actor_runs_default_dataset.go @@ -0,0 +1,1475 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" + "strings" +) + + +// LastActorRunsDefaultDatasetAPIService LastActorRunsDefaultDatasetAPI service +type LastActorRunsDefaultDatasetAPIService service + +type ApiActRunsLastDatasetDeleteRequest struct { + ctx context.Context + ApiService *LastActorRunsDefaultDatasetAPIService + actorId string + status *string +} + +// Filter for the run status. +func (r ApiActRunsLastDatasetDeleteRequest) Status(status string) ApiActRunsLastDatasetDeleteRequest { + r.status = &status + return r +} + +func (r ApiActRunsLastDatasetDeleteRequest) Execute() (*http.Response, error) { + return r.ApiService.ActRunsLastDatasetDeleteExecute(r) +} + +/* +ActRunsLastDatasetDelete Delete last run's default dataset + +Deletes the default dataset associated with the last Actor run. + +This endpoint is a shortcut for getting the last run's `defaultDatasetId` and then using the +[Delete dataset](/api/v2/dataset-delete) endpoint. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param actorId Actor ID or a tilde-separated owner's username and Actor name. + @return ApiActRunsLastDatasetDeleteRequest +*/ +func (a *LastActorRunsDefaultDatasetAPIService) ActRunsLastDatasetDelete(ctx context.Context, actorId string) ApiActRunsLastDatasetDeleteRequest { + return ApiActRunsLastDatasetDeleteRequest{ + ApiService: a, + ctx: ctx, + actorId: actorId, + } +} + +// Execute executes the request +func (a *LastActorRunsDefaultDatasetAPIService) ActRunsLastDatasetDeleteExecute(r ApiActRunsLastDatasetDeleteRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LastActorRunsDefaultDatasetAPIService.ActRunsLastDatasetDelete") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/actors/{actorId}/runs/last/dataset" + localVarPath = strings.Replace(localVarPath, "{"+"actorId"+"}", url.PathEscape(parameterValueToString(r.actorId, "actorId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.status != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "status", r.status, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiActRunsLastDatasetGetRequest struct { + ctx context.Context + ApiService *LastActorRunsDefaultDatasetAPIService + actorId string + status *string +} + +// Filter for the run status. +func (r ApiActRunsLastDatasetGetRequest) Status(status string) ApiActRunsLastDatasetGetRequest { + r.status = &status + return r +} + +func (r ApiActRunsLastDatasetGetRequest) Execute() (*DatasetResponse, *http.Response, error) { + return r.ApiService.ActRunsLastDatasetGetExecute(r) +} + +/* +ActRunsLastDatasetGet Get last run's default dataset + +Returns the default dataset associated with the last Actor run. + +This endpoint is a shortcut for getting the last run's `defaultDatasetId` and then using the +[Get dataset](/api/v2/dataset-get) endpoint. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param actorId Actor ID or a tilde-separated owner's username and Actor name. + @return ApiActRunsLastDatasetGetRequest +*/ +func (a *LastActorRunsDefaultDatasetAPIService) ActRunsLastDatasetGet(ctx context.Context, actorId string) ApiActRunsLastDatasetGetRequest { + return ApiActRunsLastDatasetGetRequest{ + ApiService: a, + ctx: ctx, + actorId: actorId, + } +} + +// Execute executes the request +// @return DatasetResponse +func (a *LastActorRunsDefaultDatasetAPIService) ActRunsLastDatasetGetExecute(r ApiActRunsLastDatasetGetRequest) (*DatasetResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *DatasetResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LastActorRunsDefaultDatasetAPIService.ActRunsLastDatasetGet") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/actors/{actorId}/runs/last/dataset" + localVarPath = strings.Replace(localVarPath, "{"+"actorId"+"}", url.PathEscape(parameterValueToString(r.actorId, "actorId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.status != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "status", r.status, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiActRunsLastDatasetItemsGetRequest struct { + ctx context.Context + ApiService *LastActorRunsDefaultDatasetAPIService + actorId string + status *string + format *string + clean *bool + offset *float64 + limit *float64 + fields *string + outputFields *string + omit *string + unwind *string + flatten *string + desc *bool + attachment *bool + delimiter *string + bom *bool + xmlRoot *string + xmlRow *string + skipHeaderRow *bool + skipHidden *bool + skipEmpty *bool + simplified *bool + view *string + skipFailedPages *bool + feedTitle *string + feedDescription *string + signature *string +} + +// Filter for the run status. +func (r ApiActRunsLastDatasetItemsGetRequest) Status(status string) ApiActRunsLastDatasetItemsGetRequest { + r.status = &status + return r +} + +// Format of the results, possible values are: `json`, `jsonl`, `csv`, `html`, `xlsx`, `xml` and `rss`. The default value is `json`. +func (r ApiActRunsLastDatasetItemsGetRequest) Format(format string) ApiActRunsLastDatasetItemsGetRequest { + r.format = &format + return r +} + +// If `true` or `1` then the API endpoint returns only non-empty items and skips hidden fields (i.e. fields starting with the # character). The `clean` parameter is just a shortcut for `skipHidden=true` and `skipEmpty=true` parameters. Note that since some objects might be skipped from the output, that the result might contain less items than the `limit` value. +func (r ApiActRunsLastDatasetItemsGetRequest) Clean(clean bool) ApiActRunsLastDatasetItemsGetRequest { + r.clean = &clean + return r +} + +// Number of items that should be skipped at the start. The default value is `0`. +func (r ApiActRunsLastDatasetItemsGetRequest) Offset(offset float64) ApiActRunsLastDatasetItemsGetRequest { + r.offset = &offset + return r +} + +// Maximum number of items to return. By default there is no limit. +func (r ApiActRunsLastDatasetItemsGetRequest) Limit(limit float64) ApiActRunsLastDatasetItemsGetRequest { + r.limit = &limit + return r +} + +// A comma-separated list of fields which should be picked from the items, only these fields will remain in the resulting record objects. Note that the fields in the outputted items are sorted the same way as they are specified in the `fields` query parameter. You can use this feature to effectively fix the output format. +func (r ApiActRunsLastDatasetItemsGetRequest) Fields(fields string) ApiActRunsLastDatasetItemsGetRequest { + r.fields = &fields + return r +} + +// A comma-separated list of output field names that positionally rename the fields specified in the `fields` parameter. For example, `?fields=headline,url&outputFields=title,link` renames `headline` to `title` and `url` to `link` in the output. The number of names in `outputFields` must match the number of names in `fields`. Requires the `fields` parameter to be specified as well. +func (r ApiActRunsLastDatasetItemsGetRequest) OutputFields(outputFields string) ApiActRunsLastDatasetItemsGetRequest { + r.outputFields = &outputFields + return r +} + +// A comma-separated list of fields which should be omitted from the items. +func (r ApiActRunsLastDatasetItemsGetRequest) Omit(omit string) ApiActRunsLastDatasetItemsGetRequest { + r.omit = &omit + return r +} + +// A comma-separated list of fields which should be unwound, in order which they should be processed. Each field should be either an array or an object. If the field is an array then every element of the array will become a separate record and merged with parent object. If the unwound field is an object then it is merged with the parent object. If the unwound field is missing or its value is neither an array nor an object and therefore cannot be merged with a parent object then the item gets preserved as it is. Note that the unwound items ignore the `desc` parameter. +func (r ApiActRunsLastDatasetItemsGetRequest) Unwind(unwind string) ApiActRunsLastDatasetItemsGetRequest { + r.unwind = &unwind + return r +} + +// A comma-separated list of fields which should transform nested objects into flat structures. For example, with `flatten=\"foo\"` the object `{\"foo\":{\"bar\": \"hello\"}}` is turned into `{\"foo.bar\": \"hello\"}`. The original object with properties is replaced with the flattened object. +func (r ApiActRunsLastDatasetItemsGetRequest) Flatten(flatten string) ApiActRunsLastDatasetItemsGetRequest { + r.flatten = &flatten + return r +} + +// By default, results are returned in the same order as they were stored. To reverse the order, set this parameter to `true` or `1`. +func (r ApiActRunsLastDatasetItemsGetRequest) Desc(desc bool) ApiActRunsLastDatasetItemsGetRequest { + r.desc = &desc + return r +} + +// If `true` or `1` then the response will define the `Content-Disposition: attachment` header, forcing a web browser to download the file rather than to display it. By default this header is not present. +func (r ApiActRunsLastDatasetItemsGetRequest) Attachment(attachment bool) ApiActRunsLastDatasetItemsGetRequest { + r.attachment = &attachment + return r +} + +// A delimiter character for CSV files, only used if `format=csv`. You might need to URL-encode the character (e.g. use `%09` for tab or `%3B` for semicolon). The default delimiter is a simple comma (`,`). +func (r ApiActRunsLastDatasetItemsGetRequest) Delimiter(delimiter string) ApiActRunsLastDatasetItemsGetRequest { + r.delimiter = &delimiter + return r +} + +// All text responses are encoded in UTF-8 encoding. By default, the `format=csv` files are prefixed with the UTF-8 Byte Order Mark (BOM), while `json`, `jsonl`, `xml`, `html` and `rss` files are not. If you want to override this default behavior, specify `bom=1` query parameter to include the BOM or `bom=0` to skip it. +func (r ApiActRunsLastDatasetItemsGetRequest) Bom(bom bool) ApiActRunsLastDatasetItemsGetRequest { + r.bom = &bom + return r +} + +// Overrides default root element name of `xml` output. By default the root element is `items`. +func (r ApiActRunsLastDatasetItemsGetRequest) XmlRoot(xmlRoot string) ApiActRunsLastDatasetItemsGetRequest { + r.xmlRoot = &xmlRoot + return r +} + +// Overrides default element name that wraps each page or page function result object in `xml` output. By default the element name is `item`. +func (r ApiActRunsLastDatasetItemsGetRequest) XmlRow(xmlRow string) ApiActRunsLastDatasetItemsGetRequest { + r.xmlRow = &xmlRow + return r +} + +// If `true` or `1` then header row in the `csv` format is skipped. +func (r ApiActRunsLastDatasetItemsGetRequest) SkipHeaderRow(skipHeaderRow bool) ApiActRunsLastDatasetItemsGetRequest { + r.skipHeaderRow = &skipHeaderRow + return r +} + +// If `true` or `1` then hidden fields are skipped from the output, i.e. fields starting with the `#` character. +func (r ApiActRunsLastDatasetItemsGetRequest) SkipHidden(skipHidden bool) ApiActRunsLastDatasetItemsGetRequest { + r.skipHidden = &skipHidden + return r +} + +// If `true` or `1` then empty items are skipped from the output. Note that if used, the results might contain less items than the limit value. +func (r ApiActRunsLastDatasetItemsGetRequest) SkipEmpty(skipEmpty bool) ApiActRunsLastDatasetItemsGetRequest { + r.skipEmpty = &skipEmpty + return r +} + +// If `true` or `1` then, the endpoint applies the `fields=url,pageFunctionResult,errorInfo` and `unwind=pageFunctionResult` query parameters. This feature is used to emulate simplified results provided by the legacy Apify Crawler product and it's not recommended to use it in new integrations. +func (r ApiActRunsLastDatasetItemsGetRequest) Simplified(simplified bool) ApiActRunsLastDatasetItemsGetRequest { + r.simplified = &simplified + return r +} + +// Defines the view configuration for dataset items based on the schema definition. This parameter determines how the data will be filtered and presented. For complete specification details, see the [dataset schema documentation](/platform/actors/development/actor-definition/dataset-schema). +func (r ApiActRunsLastDatasetItemsGetRequest) View(view string) ApiActRunsLastDatasetItemsGetRequest { + r.view = &view + return r +} + +// If `true` or `1` then, the all the items with errorInfo property will be skipped from the output. This feature is here to emulate functionality of API version 1 used for the legacy Apify Crawler product and it's not recommended to use it in new integrations. +func (r ApiActRunsLastDatasetItemsGetRequest) SkipFailedPages(skipFailedPages bool) ApiActRunsLastDatasetItemsGetRequest { + r.skipFailedPages = &skipFailedPages + return r +} + +// Overrides the auto-generated RSS channel `<title>` element. Only used when `format=rss`. If not provided, the title defaults to `Dataset <label>`. +func (r ApiActRunsLastDatasetItemsGetRequest) FeedTitle(feedTitle string) ApiActRunsLastDatasetItemsGetRequest { + r.feedTitle = &feedTitle + return r +} + +// Overrides the auto-generated RSS channel `<description>` element. Only used when `format=rss`. If not provided, the description defaults to `Items in dataset with id \"<datasetId>\".` +func (r ApiActRunsLastDatasetItemsGetRequest) FeedDescription(feedDescription string) ApiActRunsLastDatasetItemsGetRequest { + r.feedDescription = &feedDescription + return r +} + +// Signature used for the access. +func (r ApiActRunsLastDatasetItemsGetRequest) Signature(signature string) ApiActRunsLastDatasetItemsGetRequest { + r.signature = &signature + return r +} + +func (r ApiActRunsLastDatasetItemsGetRequest) Execute() ([]map[string]interface{}, *http.Response, error) { + return r.ApiService.ActRunsLastDatasetItemsGetExecute(r) +} + +/* +ActRunsLastDatasetItemsGet Get last run's dataset items + +Returns data stored in the default dataset of the last Actor run in the desired format. + +This endpoint is a shortcut that resolves the last run's `defaultDatasetId` and proxies to the +[Get dataset items](/api/v2/dataset-items-get) endpoint. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param actorId Actor ID or a tilde-separated owner's username and Actor name. + @return ApiActRunsLastDatasetItemsGetRequest +*/ +func (a *LastActorRunsDefaultDatasetAPIService) ActRunsLastDatasetItemsGet(ctx context.Context, actorId string) ApiActRunsLastDatasetItemsGetRequest { + return ApiActRunsLastDatasetItemsGetRequest{ + ApiService: a, + ctx: ctx, + actorId: actorId, + } +} + +// Execute executes the request +// @return []map[string]interface{} +func (a *LastActorRunsDefaultDatasetAPIService) ActRunsLastDatasetItemsGetExecute(r ApiActRunsLastDatasetItemsGetRequest) ([]map[string]interface{}, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []map[string]interface{} + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LastActorRunsDefaultDatasetAPIService.ActRunsLastDatasetItemsGet") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/actors/{actorId}/runs/last/dataset/items" + localVarPath = strings.Replace(localVarPath, "{"+"actorId"+"}", url.PathEscape(parameterValueToString(r.actorId, "actorId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.status != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "status", r.status, "form", "") + } + if r.format != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "format", r.format, "form", "") + } + if r.clean != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "clean", r.clean, "form", "") + } + if r.offset != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "form", "") + } + if r.limit != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "form", "") + } + if r.fields != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "fields", r.fields, "form", "") + } + if r.outputFields != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "outputFields", r.outputFields, "form", "") + } + if r.omit != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "omit", r.omit, "form", "") + } + if r.unwind != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "unwind", r.unwind, "form", "") + } + if r.flatten != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "flatten", r.flatten, "form", "") + } + if r.desc != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "desc", r.desc, "form", "") + } + if r.attachment != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "attachment", r.attachment, "form", "") + } + if r.delimiter != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "delimiter", r.delimiter, "form", "") + } + if r.bom != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "bom", r.bom, "form", "") + } + if r.xmlRoot != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "xmlRoot", r.xmlRoot, "form", "") + } + if r.xmlRow != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "xmlRow", r.xmlRow, "form", "") + } + if r.skipHeaderRow != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "skipHeaderRow", r.skipHeaderRow, "form", "") + } + if r.skipHidden != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "skipHidden", r.skipHidden, "form", "") + } + if r.skipEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "skipEmpty", r.skipEmpty, "form", "") + } + if r.simplified != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "simplified", r.simplified, "form", "") + } + if r.view != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "view", r.view, "form", "") + } + if r.skipFailedPages != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "skipFailedPages", r.skipFailedPages, "form", "") + } + if r.feedTitle != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "feedTitle", r.feedTitle, "form", "") + } + if r.feedDescription != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "feedDescription", r.feedDescription, "form", "") + } + if r.signature != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "signature", r.signature, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json", "application/jsonl", "text/csv", "text/html", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", "application/rss+xml", "application/xml"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiActRunsLastDatasetItemsPostRequest struct { + ctx context.Context + ApiService *LastActorRunsDefaultDatasetAPIService + actorId string + actRunsLastDatasetItemsPostRequest *ActRunsLastDatasetItemsPostRequest + status *string +} + +// +func (r ApiActRunsLastDatasetItemsPostRequest) ActRunsLastDatasetItemsPostRequest(actRunsLastDatasetItemsPostRequest ActRunsLastDatasetItemsPostRequest) ApiActRunsLastDatasetItemsPostRequest { + r.actRunsLastDatasetItemsPostRequest = &actRunsLastDatasetItemsPostRequest + return r +} + +// Filter for the run status. +func (r ApiActRunsLastDatasetItemsPostRequest) Status(status string) ApiActRunsLastDatasetItemsPostRequest { + r.status = &status + return r +} + +func (r ApiActRunsLastDatasetItemsPostRequest) Execute() (map[string]interface{}, *http.Response, error) { + return r.ApiService.ActRunsLastDatasetItemsPostExecute(r) +} + +/* +ActRunsLastDatasetItemsPost Store items in last run's dataset + +Appends an item or an array of items to the end of the last Actor run's default dataset. + +This endpoint is a shortcut that resolves the last run's `defaultDatasetId` and proxies to the +[Store items](/api/v2/dataset-items-post) endpoint. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param actorId Actor ID or a tilde-separated owner's username and Actor name. + @return ApiActRunsLastDatasetItemsPostRequest +*/ +func (a *LastActorRunsDefaultDatasetAPIService) ActRunsLastDatasetItemsPost(ctx context.Context, actorId string) ApiActRunsLastDatasetItemsPostRequest { + return ApiActRunsLastDatasetItemsPostRequest{ + ApiService: a, + ctx: ctx, + actorId: actorId, + } +} + +// Execute executes the request +// @return map[string]interface{} +func (a *LastActorRunsDefaultDatasetAPIService) ActRunsLastDatasetItemsPostExecute(r ApiActRunsLastDatasetItemsPostRequest) (map[string]interface{}, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue map[string]interface{} + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LastActorRunsDefaultDatasetAPIService.ActRunsLastDatasetItemsPost") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/actors/{actorId}/runs/last/dataset/items" + localVarPath = strings.Replace(localVarPath, "{"+"actorId"+"}", url.PathEscape(parameterValueToString(r.actorId, "actorId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.actRunsLastDatasetItemsPostRequest == nil { + return localVarReturnValue, nil, reportError("actRunsLastDatasetItemsPostRequest is required and must be specified") + } + + if r.status != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "status", r.status, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.actRunsLastDatasetItemsPostRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ActRunsLastDatasetItemsPost400Response + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiActRunsLastDatasetPutRequest struct { + ctx context.Context + ApiService *LastActorRunsDefaultDatasetAPIService + actorId string + updateDatasetRequest *UpdateDatasetRequest + status *string +} + +// +func (r ApiActRunsLastDatasetPutRequest) UpdateDatasetRequest(updateDatasetRequest UpdateDatasetRequest) ApiActRunsLastDatasetPutRequest { + r.updateDatasetRequest = &updateDatasetRequest + return r +} + +// Filter for the run status. +func (r ApiActRunsLastDatasetPutRequest) Status(status string) ApiActRunsLastDatasetPutRequest { + r.status = &status + return r +} + +func (r ApiActRunsLastDatasetPutRequest) Execute() (*DatasetResponse, *http.Response, error) { + return r.ApiService.ActRunsLastDatasetPutExecute(r) +} + +/* +ActRunsLastDatasetPut Update last run's default dataset + +Updates the default dataset associated with the last Actor run. + +This endpoint is a shortcut for getting the last run's `defaultDatasetId` and then using the +[Update dataset](/api/v2/dataset-put) endpoint. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param actorId Actor ID or a tilde-separated owner's username and Actor name. + @return ApiActRunsLastDatasetPutRequest +*/ +func (a *LastActorRunsDefaultDatasetAPIService) ActRunsLastDatasetPut(ctx context.Context, actorId string) ApiActRunsLastDatasetPutRequest { + return ApiActRunsLastDatasetPutRequest{ + ApiService: a, + ctx: ctx, + actorId: actorId, + } +} + +// Execute executes the request +// @return DatasetResponse +func (a *LastActorRunsDefaultDatasetAPIService) ActRunsLastDatasetPutExecute(r ApiActRunsLastDatasetPutRequest) (*DatasetResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *DatasetResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LastActorRunsDefaultDatasetAPIService.ActRunsLastDatasetPut") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/actors/{actorId}/runs/last/dataset" + localVarPath = strings.Replace(localVarPath, "{"+"actorId"+"}", url.PathEscape(parameterValueToString(r.actorId, "actorId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.updateDatasetRequest == nil { + return localVarReturnValue, nil, reportError("updateDatasetRequest is required and must be specified") + } + + if r.status != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "status", r.status, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.updateDatasetRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 413 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 415 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiActRunsLastDatasetStatisticsGetRequest struct { + ctx context.Context + ApiService *LastActorRunsDefaultDatasetAPIService + actorId string + status *string +} + +// Filter for the run status. +func (r ApiActRunsLastDatasetStatisticsGetRequest) Status(status string) ApiActRunsLastDatasetStatisticsGetRequest { + r.status = &status + return r +} + +func (r ApiActRunsLastDatasetStatisticsGetRequest) Execute() (*DatasetStatisticsResponse, *http.Response, error) { + return r.ApiService.ActRunsLastDatasetStatisticsGetExecute(r) +} + +/* +ActRunsLastDatasetStatisticsGet Get last run's dataset statistics + +Returns statistics for the last Actor run's default dataset. + +This endpoint is a shortcut that resolves the last run's `defaultDatasetId` and proxies to the +[Get dataset statistics](/api/v2/dataset-statistics-get) endpoint. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param actorId Actor ID or a tilde-separated owner's username and Actor name. + @return ApiActRunsLastDatasetStatisticsGetRequest +*/ +func (a *LastActorRunsDefaultDatasetAPIService) ActRunsLastDatasetStatisticsGet(ctx context.Context, actorId string) ApiActRunsLastDatasetStatisticsGetRequest { + return ApiActRunsLastDatasetStatisticsGetRequest{ + ApiService: a, + ctx: ctx, + actorId: actorId, + } +} + +// Execute executes the request +// @return DatasetStatisticsResponse +func (a *LastActorRunsDefaultDatasetAPIService) ActRunsLastDatasetStatisticsGetExecute(r ApiActRunsLastDatasetStatisticsGetRequest) (*DatasetStatisticsResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *DatasetStatisticsResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LastActorRunsDefaultDatasetAPIService.ActRunsLastDatasetStatisticsGet") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/actors/{actorId}/runs/last/dataset/statistics" + localVarPath = strings.Replace(localVarPath, "{"+"actorId"+"}", url.PathEscape(parameterValueToString(r.actorId, "actorId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.status != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "status", r.status, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/api_last_actor_runs_default_key_value_store.go b/api_last_actor_runs_default_key_value_store.go new file mode 100644 index 0000000..ae0c51a --- /dev/null +++ b/api_last_actor_runs_default_key_value_store.go @@ -0,0 +1,2010 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" + "strings" + "os" +) + + +// LastActorRunsDefaultKeyValueStoreAPIService LastActorRunsDefaultKeyValueStoreAPI service +type LastActorRunsDefaultKeyValueStoreAPIService service + +type ApiActRunsLastKeyValueStoreDeleteRequest struct { + ctx context.Context + ApiService *LastActorRunsDefaultKeyValueStoreAPIService + actorId string + status *string +} + +// Filter for the run status. +func (r ApiActRunsLastKeyValueStoreDeleteRequest) Status(status string) ApiActRunsLastKeyValueStoreDeleteRequest { + r.status = &status + return r +} + +func (r ApiActRunsLastKeyValueStoreDeleteRequest) Execute() (*http.Response, error) { + return r.ApiService.ActRunsLastKeyValueStoreDeleteExecute(r) +} + +/* +ActRunsLastKeyValueStoreDelete Delete last run's default store + +Deletes the last Actor run key-value store. + +This endpoint is a shortcut for getting the run's `defaultKeyValueStoreId` and then using the +[Delete store](/api/v2/key-value-store-delete) endpoint. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param actorId Actor ID or a tilde-separated owner's username and Actor name. + @return ApiActRunsLastKeyValueStoreDeleteRequest +*/ +func (a *LastActorRunsDefaultKeyValueStoreAPIService) ActRunsLastKeyValueStoreDelete(ctx context.Context, actorId string) ApiActRunsLastKeyValueStoreDeleteRequest { + return ApiActRunsLastKeyValueStoreDeleteRequest{ + ApiService: a, + ctx: ctx, + actorId: actorId, + } +} + +// Execute executes the request +func (a *LastActorRunsDefaultKeyValueStoreAPIService) ActRunsLastKeyValueStoreDeleteExecute(r ApiActRunsLastKeyValueStoreDeleteRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LastActorRunsDefaultKeyValueStoreAPIService.ActRunsLastKeyValueStoreDelete") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/actors/{actorId}/runs/last/key-value-store" + localVarPath = strings.Replace(localVarPath, "{"+"actorId"+"}", url.PathEscape(parameterValueToString(r.actorId, "actorId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.status != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "status", r.status, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiActRunsLastKeyValueStoreGetRequest struct { + ctx context.Context + ApiService *LastActorRunsDefaultKeyValueStoreAPIService + actorId string + status *string +} + +// Filter for the run status. +func (r ApiActRunsLastKeyValueStoreGetRequest) Status(status string) ApiActRunsLastKeyValueStoreGetRequest { + r.status = &status + return r +} + +func (r ApiActRunsLastKeyValueStoreGetRequest) Execute() (*KeyValueStoreResponse, *http.Response, error) { + return r.ApiService.ActRunsLastKeyValueStoreGetExecute(r) +} + +/* +ActRunsLastKeyValueStoreGet Get last run's default store + +Gets an object that contains all the details about the default key-value store associated with the last Actor run. + +This endpoint is a shortcut for getting the run's `defaultKeyValueStoreId` and then using the +[Get store](/api/v2/key-value-store-get) endpoint. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param actorId Actor ID or a tilde-separated owner's username and Actor name. + @return ApiActRunsLastKeyValueStoreGetRequest +*/ +func (a *LastActorRunsDefaultKeyValueStoreAPIService) ActRunsLastKeyValueStoreGet(ctx context.Context, actorId string) ApiActRunsLastKeyValueStoreGetRequest { + return ApiActRunsLastKeyValueStoreGetRequest{ + ApiService: a, + ctx: ctx, + actorId: actorId, + } +} + +// Execute executes the request +// @return KeyValueStoreResponse +func (a *LastActorRunsDefaultKeyValueStoreAPIService) ActRunsLastKeyValueStoreGetExecute(r ApiActRunsLastKeyValueStoreGetRequest) (*KeyValueStoreResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *KeyValueStoreResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LastActorRunsDefaultKeyValueStoreAPIService.ActRunsLastKeyValueStoreGet") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/actors/{actorId}/runs/last/key-value-store" + localVarPath = strings.Replace(localVarPath, "{"+"actorId"+"}", url.PathEscape(parameterValueToString(r.actorId, "actorId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.status != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "status", r.status, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiActRunsLastKeyValueStoreKeysGetRequest struct { + ctx context.Context + ApiService *LastActorRunsDefaultKeyValueStoreAPIService + actorId string + status *string + exclusiveStartKey *string + limit *float32 + collection *string + prefix *string + signature *string +} + +// Filter for the run status. +func (r ApiActRunsLastKeyValueStoreKeysGetRequest) Status(status string) ApiActRunsLastKeyValueStoreKeysGetRequest { + r.status = &status + return r +} + +// All keys up to this one (including) are skipped from the result. +func (r ApiActRunsLastKeyValueStoreKeysGetRequest) ExclusiveStartKey(exclusiveStartKey string) ApiActRunsLastKeyValueStoreKeysGetRequest { + r.exclusiveStartKey = &exclusiveStartKey + return r +} + +// Number of keys to be returned. +func (r ApiActRunsLastKeyValueStoreKeysGetRequest) Limit(limit float32) ApiActRunsLastKeyValueStoreKeysGetRequest { + r.limit = &limit + return r +} + +// Limit the results to keys that belong to a specific collection from the key-value store schema. The key-value store need to have a schema defined for this parameter to work. +func (r ApiActRunsLastKeyValueStoreKeysGetRequest) Collection(collection string) ApiActRunsLastKeyValueStoreKeysGetRequest { + r.collection = &collection + return r +} + +// Limit the results to keys that start with a specific prefix. +func (r ApiActRunsLastKeyValueStoreKeysGetRequest) Prefix(prefix string) ApiActRunsLastKeyValueStoreKeysGetRequest { + r.prefix = &prefix + return r +} + +// Signature used for the access. +func (r ApiActRunsLastKeyValueStoreKeysGetRequest) Signature(signature string) ApiActRunsLastKeyValueStoreKeysGetRequest { + r.signature = &signature + return r +} + +func (r ApiActRunsLastKeyValueStoreKeysGetRequest) Execute() (*ListOfKeysResponse, *http.Response, error) { + return r.ApiService.ActRunsLastKeyValueStoreKeysGetExecute(r) +} + +/* +ActRunsLastKeyValueStoreKeysGet Get last run's default store's list of keys + +Returns a list of keys for the default key-value store of the last Actor run. + +This endpoint is a shortcut for getting the last run's `defaultKeyValueStoreId` and then using the +[Get list of keys](/api/v2/key-value-store-keys-get) endpoint. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param actorId Actor ID or a tilde-separated owner's username and Actor name. + @return ApiActRunsLastKeyValueStoreKeysGetRequest +*/ +func (a *LastActorRunsDefaultKeyValueStoreAPIService) ActRunsLastKeyValueStoreKeysGet(ctx context.Context, actorId string) ApiActRunsLastKeyValueStoreKeysGetRequest { + return ApiActRunsLastKeyValueStoreKeysGetRequest{ + ApiService: a, + ctx: ctx, + actorId: actorId, + } +} + +// Execute executes the request +// @return ListOfKeysResponse +func (a *LastActorRunsDefaultKeyValueStoreAPIService) ActRunsLastKeyValueStoreKeysGetExecute(r ApiActRunsLastKeyValueStoreKeysGetRequest) (*ListOfKeysResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ListOfKeysResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LastActorRunsDefaultKeyValueStoreAPIService.ActRunsLastKeyValueStoreKeysGet") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/actors/{actorId}/runs/last/key-value-store/keys" + localVarPath = strings.Replace(localVarPath, "{"+"actorId"+"}", url.PathEscape(parameterValueToString(r.actorId, "actorId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.status != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "status", r.status, "form", "") + } + if r.exclusiveStartKey != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "exclusiveStartKey", r.exclusiveStartKey, "form", "") + } + if r.limit != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "form", "") + } else { + var defaultValue float32 = 1000 + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", defaultValue, "form", "") + r.limit = &defaultValue + } + if r.collection != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "collection", r.collection, "form", "") + } + if r.prefix != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "prefix", r.prefix, "form", "") + } + if r.signature != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "signature", r.signature, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiActRunsLastKeyValueStorePutRequest struct { + ctx context.Context + ApiService *LastActorRunsDefaultKeyValueStoreAPIService + actorId string + updateStoreRequest *UpdateStoreRequest + status *string +} + +// +func (r ApiActRunsLastKeyValueStorePutRequest) UpdateStoreRequest(updateStoreRequest UpdateStoreRequest) ApiActRunsLastKeyValueStorePutRequest { + r.updateStoreRequest = &updateStoreRequest + return r +} + +// Filter for the run status. +func (r ApiActRunsLastKeyValueStorePutRequest) Status(status string) ApiActRunsLastKeyValueStorePutRequest { + r.status = &status + return r +} + +func (r ApiActRunsLastKeyValueStorePutRequest) Execute() (*KeyValueStoreResponse, *http.Response, error) { + return r.ApiService.ActRunsLastKeyValueStorePutExecute(r) +} + +/* +ActRunsLastKeyValueStorePut Update last run's default store + +Updates the last Actor run key-value store's name and general resource access level using a value specified by a JSON object +passed in the PUT payload. + +This endpoint is a shortcut for getting the run's `defaultKeyValueStoreId` and then using the +[Update store](/api/v2/key-value-store-put) endpoint. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param actorId Actor ID or a tilde-separated owner's username and Actor name. + @return ApiActRunsLastKeyValueStorePutRequest +*/ +func (a *LastActorRunsDefaultKeyValueStoreAPIService) ActRunsLastKeyValueStorePut(ctx context.Context, actorId string) ApiActRunsLastKeyValueStorePutRequest { + return ApiActRunsLastKeyValueStorePutRequest{ + ApiService: a, + ctx: ctx, + actorId: actorId, + } +} + +// Execute executes the request +// @return KeyValueStoreResponse +func (a *LastActorRunsDefaultKeyValueStoreAPIService) ActRunsLastKeyValueStorePutExecute(r ApiActRunsLastKeyValueStorePutRequest) (*KeyValueStoreResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *KeyValueStoreResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LastActorRunsDefaultKeyValueStoreAPIService.ActRunsLastKeyValueStorePut") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/actors/{actorId}/runs/last/key-value-store" + localVarPath = strings.Replace(localVarPath, "{"+"actorId"+"}", url.PathEscape(parameterValueToString(r.actorId, "actorId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.updateStoreRequest == nil { + return localVarReturnValue, nil, reportError("updateStoreRequest is required and must be specified") + } + + if r.status != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "status", r.status, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.updateStoreRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 413 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 415 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiActRunsLastKeyValueStoreRecordDeleteRequest struct { + ctx context.Context + ApiService *LastActorRunsDefaultKeyValueStoreAPIService + actorId string + recordKey string + status *string +} + +// Filter for the run status. +func (r ApiActRunsLastKeyValueStoreRecordDeleteRequest) Status(status string) ApiActRunsLastKeyValueStoreRecordDeleteRequest { + r.status = &status + return r +} + +func (r ApiActRunsLastKeyValueStoreRecordDeleteRequest) Execute() (*http.Response, error) { + return r.ApiService.ActRunsLastKeyValueStoreRecordDeleteExecute(r) +} + +/* +ActRunsLastKeyValueStoreRecordDelete Delete last run's default store's record + +Removes a record specified by a key from the default key-value store of the last Actor run. + +This endpoint is a shortcut for getting the last run's `defaultKeyValueStoreId` and then using the +[Delete record](/api/v2/key-value-store-record-delete) endpoint. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param actorId Actor ID or a tilde-separated owner's username and Actor name. + @param recordKey Key of the record. + @return ApiActRunsLastKeyValueStoreRecordDeleteRequest +*/ +func (a *LastActorRunsDefaultKeyValueStoreAPIService) ActRunsLastKeyValueStoreRecordDelete(ctx context.Context, actorId string, recordKey string) ApiActRunsLastKeyValueStoreRecordDeleteRequest { + return ApiActRunsLastKeyValueStoreRecordDeleteRequest{ + ApiService: a, + ctx: ctx, + actorId: actorId, + recordKey: recordKey, + } +} + +// Execute executes the request +func (a *LastActorRunsDefaultKeyValueStoreAPIService) ActRunsLastKeyValueStoreRecordDeleteExecute(r ApiActRunsLastKeyValueStoreRecordDeleteRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LastActorRunsDefaultKeyValueStoreAPIService.ActRunsLastKeyValueStoreRecordDelete") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/actors/{actorId}/runs/last/key-value-store/records/{recordKey}" + localVarPath = strings.Replace(localVarPath, "{"+"actorId"+"}", url.PathEscape(parameterValueToString(r.actorId, "actorId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"recordKey"+"}", url.PathEscape(parameterValueToString(r.recordKey, "recordKey")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.status != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "status", r.status, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiActRunsLastKeyValueStoreRecordGetRequest struct { + ctx context.Context + ApiService *LastActorRunsDefaultKeyValueStoreAPIService + actorId string + recordKey string + status *string + signature *string + attachment *bool +} + +// Filter for the run status. +func (r ApiActRunsLastKeyValueStoreRecordGetRequest) Status(status string) ApiActRunsLastKeyValueStoreRecordGetRequest { + r.status = &status + return r +} + +// Signature used for the access. +func (r ApiActRunsLastKeyValueStoreRecordGetRequest) Signature(signature string) ApiActRunsLastKeyValueStoreRecordGetRequest { + r.signature = &signature + return r +} + +// If `true` or `1`, the response will be served with `Content-Disposition: attachment` header, causing web browsers to offer downloading HTML records instead of displaying them. +func (r ApiActRunsLastKeyValueStoreRecordGetRequest) Attachment(attachment bool) ApiActRunsLastKeyValueStoreRecordGetRequest { + r.attachment = &attachment + return r +} + +func (r ApiActRunsLastKeyValueStoreRecordGetRequest) Execute() (map[string]interface{}, *http.Response, error) { + return r.ApiService.ActRunsLastKeyValueStoreRecordGetExecute(r) +} + +/* +ActRunsLastKeyValueStoreRecordGet Get last run's default store's record + +Gets a value stored under a specific key in the default key-value store of the last Actor run. + +This endpoint is a shortcut for getting the last run's `defaultKeyValueStoreId` and then using the +[Get record](/api/v2/key-value-store-record-get) endpoint. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param actorId Actor ID or a tilde-separated owner's username and Actor name. + @param recordKey Key of the record. + @return ApiActRunsLastKeyValueStoreRecordGetRequest +*/ +func (a *LastActorRunsDefaultKeyValueStoreAPIService) ActRunsLastKeyValueStoreRecordGet(ctx context.Context, actorId string, recordKey string) ApiActRunsLastKeyValueStoreRecordGetRequest { + return ApiActRunsLastKeyValueStoreRecordGetRequest{ + ApiService: a, + ctx: ctx, + actorId: actorId, + recordKey: recordKey, + } +} + +// Execute executes the request +// @return map[string]interface{} +func (a *LastActorRunsDefaultKeyValueStoreAPIService) ActRunsLastKeyValueStoreRecordGetExecute(r ApiActRunsLastKeyValueStoreRecordGetRequest) (map[string]interface{}, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue map[string]interface{} + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LastActorRunsDefaultKeyValueStoreAPIService.ActRunsLastKeyValueStoreRecordGet") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/actors/{actorId}/runs/last/key-value-store/records/{recordKey}" + localVarPath = strings.Replace(localVarPath, "{"+"actorId"+"}", url.PathEscape(parameterValueToString(r.actorId, "actorId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"recordKey"+"}", url.PathEscape(parameterValueToString(r.recordKey, "recordKey")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.status != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "status", r.status, "form", "") + } + if r.signature != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "signature", r.signature, "form", "") + } + if r.attachment != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "attachment", r.attachment, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json", "*/*"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiActRunsLastKeyValueStoreRecordPostRequest struct { + ctx context.Context + ApiService *LastActorRunsDefaultKeyValueStoreAPIService + actorId string + recordKey string + requestBody *map[string]interface{} + status *string + contentEncoding *string +} + +// +func (r ApiActRunsLastKeyValueStoreRecordPostRequest) RequestBody(requestBody map[string]interface{}) ApiActRunsLastKeyValueStoreRecordPostRequest { + r.requestBody = &requestBody + return r +} + +// Filter for the run status. +func (r ApiActRunsLastKeyValueStoreRecordPostRequest) Status(status string) ApiActRunsLastKeyValueStoreRecordPostRequest { + r.status = &status + return r +} + +// +func (r ApiActRunsLastKeyValueStoreRecordPostRequest) ContentEncoding(contentEncoding string) ApiActRunsLastKeyValueStoreRecordPostRequest { + r.contentEncoding = &contentEncoding + return r +} + +func (r ApiActRunsLastKeyValueStoreRecordPostRequest) Execute() (map[string]interface{}, *http.Response, error) { + return r.ApiService.ActRunsLastKeyValueStoreRecordPostExecute(r) +} + +/* +ActRunsLastKeyValueStoreRecordPost Store record in last run's default store (POST) + +Stores a value under a specific key in the default key-value store of the last Actor run. + +This endpoint is a shortcut for getting the last run's `defaultKeyValueStoreId` and then using the +[Store record](/api/v2/key-value-store-record-post) endpoint. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param actorId Actor ID or a tilde-separated owner's username and Actor name. + @param recordKey Key of the record. + @return ApiActRunsLastKeyValueStoreRecordPostRequest +*/ +func (a *LastActorRunsDefaultKeyValueStoreAPIService) ActRunsLastKeyValueStoreRecordPost(ctx context.Context, actorId string, recordKey string) ApiActRunsLastKeyValueStoreRecordPostRequest { + return ApiActRunsLastKeyValueStoreRecordPostRequest{ + ApiService: a, + ctx: ctx, + actorId: actorId, + recordKey: recordKey, + } +} + +// Execute executes the request +// @return map[string]interface{} +func (a *LastActorRunsDefaultKeyValueStoreAPIService) ActRunsLastKeyValueStoreRecordPostExecute(r ApiActRunsLastKeyValueStoreRecordPostRequest) (map[string]interface{}, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue map[string]interface{} + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LastActorRunsDefaultKeyValueStoreAPIService.ActRunsLastKeyValueStoreRecordPost") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/actors/{actorId}/runs/last/key-value-store/records/{recordKey}" + localVarPath = strings.Replace(localVarPath, "{"+"actorId"+"}", url.PathEscape(parameterValueToString(r.actorId, "actorId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"recordKey"+"}", url.PathEscape(parameterValueToString(r.recordKey, "recordKey")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.requestBody == nil { + return localVarReturnValue, nil, reportError("requestBody is required and must be specified") + } + + if r.status != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "status", r.status, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.contentEncoding != nil { + parameterAddToHeaderOrQuery(localVarHeaderParams, "Content-Encoding", r.contentEncoding, "simple", "") + } + // body params + localVarPostBody = r.requestBody + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 413 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 415 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiActRunsLastKeyValueStoreRecordPutRequest struct { + ctx context.Context + ApiService *LastActorRunsDefaultKeyValueStoreAPIService + actorId string + recordKey string + requestBody *map[string]interface{} + status *string + contentEncoding *string +} + +// +func (r ApiActRunsLastKeyValueStoreRecordPutRequest) RequestBody(requestBody map[string]interface{}) ApiActRunsLastKeyValueStoreRecordPutRequest { + r.requestBody = &requestBody + return r +} + +// Filter for the run status. +func (r ApiActRunsLastKeyValueStoreRecordPutRequest) Status(status string) ApiActRunsLastKeyValueStoreRecordPutRequest { + r.status = &status + return r +} + +// +func (r ApiActRunsLastKeyValueStoreRecordPutRequest) ContentEncoding(contentEncoding string) ApiActRunsLastKeyValueStoreRecordPutRequest { + r.contentEncoding = &contentEncoding + return r +} + +func (r ApiActRunsLastKeyValueStoreRecordPutRequest) Execute() (map[string]interface{}, *http.Response, error) { + return r.ApiService.ActRunsLastKeyValueStoreRecordPutExecute(r) +} + +/* +ActRunsLastKeyValueStoreRecordPut Store record in last run's default store + +Stores a value under a specific key in the default key-value store of the last Actor run. + +This endpoint is a shortcut for getting the last run's `defaultKeyValueStoreId` and then using the +[Store record](/api/v2/key-value-store-record-put) endpoint. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param actorId Actor ID or a tilde-separated owner's username and Actor name. + @param recordKey Key of the record. + @return ApiActRunsLastKeyValueStoreRecordPutRequest +*/ +func (a *LastActorRunsDefaultKeyValueStoreAPIService) ActRunsLastKeyValueStoreRecordPut(ctx context.Context, actorId string, recordKey string) ApiActRunsLastKeyValueStoreRecordPutRequest { + return ApiActRunsLastKeyValueStoreRecordPutRequest{ + ApiService: a, + ctx: ctx, + actorId: actorId, + recordKey: recordKey, + } +} + +// Execute executes the request +// @return map[string]interface{} +func (a *LastActorRunsDefaultKeyValueStoreAPIService) ActRunsLastKeyValueStoreRecordPutExecute(r ApiActRunsLastKeyValueStoreRecordPutRequest) (map[string]interface{}, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue map[string]interface{} + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LastActorRunsDefaultKeyValueStoreAPIService.ActRunsLastKeyValueStoreRecordPut") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/actors/{actorId}/runs/last/key-value-store/records/{recordKey}" + localVarPath = strings.Replace(localVarPath, "{"+"actorId"+"}", url.PathEscape(parameterValueToString(r.actorId, "actorId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"recordKey"+"}", url.PathEscape(parameterValueToString(r.recordKey, "recordKey")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.requestBody == nil { + return localVarReturnValue, nil, reportError("requestBody is required and must be specified") + } + + if r.status != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "status", r.status, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.contentEncoding != nil { + parameterAddToHeaderOrQuery(localVarHeaderParams, "Content-Encoding", r.contentEncoding, "simple", "") + } + // body params + localVarPostBody = r.requestBody + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 413 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 415 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiActRunsLastKeyValueStoreRecordsGetRequest struct { + ctx context.Context + ApiService *LastActorRunsDefaultKeyValueStoreAPIService + actorId string + status *string + collection *string + prefix *string + signature *string +} + +// Filter for the run status. +func (r ApiActRunsLastKeyValueStoreRecordsGetRequest) Status(status string) ApiActRunsLastKeyValueStoreRecordsGetRequest { + r.status = &status + return r +} + +// If specified, only records belonging to a specific collection from the key-value store schema. The key-value store need to have a schema defined for this parameter to work. +func (r ApiActRunsLastKeyValueStoreRecordsGetRequest) Collection(collection string) ApiActRunsLastKeyValueStoreRecordsGetRequest { + r.collection = &collection + return r +} + +// If specified, only records whose key starts with the given prefix are included in the archive. +func (r ApiActRunsLastKeyValueStoreRecordsGetRequest) Prefix(prefix string) ApiActRunsLastKeyValueStoreRecordsGetRequest { + r.prefix = &prefix + return r +} + +// Signature used for the access. +func (r ApiActRunsLastKeyValueStoreRecordsGetRequest) Signature(signature string) ApiActRunsLastKeyValueStoreRecordsGetRequest { + r.signature = &signature + return r +} + +func (r ApiActRunsLastKeyValueStoreRecordsGetRequest) Execute() (*os.File, *http.Response, error) { + return r.ApiService.ActRunsLastKeyValueStoreRecordsGetExecute(r) +} + +/* +ActRunsLastKeyValueStoreRecordsGet Download last run's default store's records + +Downloads all records from the default key-value store of the last Actor run as a ZIP archive. + +This endpoint is a shortcut for getting the last run's `defaultKeyValueStoreId` and then using the +[Download records](/api/v2/key-value-store-records-get) endpoint. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param actorId Actor ID or a tilde-separated owner's username and Actor name. + @return ApiActRunsLastKeyValueStoreRecordsGetRequest +*/ +func (a *LastActorRunsDefaultKeyValueStoreAPIService) ActRunsLastKeyValueStoreRecordsGet(ctx context.Context, actorId string) ApiActRunsLastKeyValueStoreRecordsGetRequest { + return ApiActRunsLastKeyValueStoreRecordsGetRequest{ + ApiService: a, + ctx: ctx, + actorId: actorId, + } +} + +// Execute executes the request +// @return *os.File +func (a *LastActorRunsDefaultKeyValueStoreAPIService) ActRunsLastKeyValueStoreRecordsGetExecute(r ApiActRunsLastKeyValueStoreRecordsGetRequest) (*os.File, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *os.File + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LastActorRunsDefaultKeyValueStoreAPIService.ActRunsLastKeyValueStoreRecordsGet") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/actors/{actorId}/runs/last/key-value-store/records" + localVarPath = strings.Replace(localVarPath, "{"+"actorId"+"}", url.PathEscape(parameterValueToString(r.actorId, "actorId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.status != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "status", r.status, "form", "") + } + if r.collection != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "collection", r.collection, "form", "") + } + if r.prefix != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "prefix", r.prefix, "form", "") + } + if r.signature != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "signature", r.signature, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/zip", "application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/api_last_actor_runs_default_request_queue.go b/api_last_actor_runs_default_request_queue.go new file mode 100644 index 0000000..eb4fc5f --- /dev/null +++ b/api_last_actor_runs_default_request_queue.go @@ -0,0 +1,3376 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" + "strings" +) + + +// LastActorRunsDefaultRequestQueueAPIService LastActorRunsDefaultRequestQueueAPI service +type LastActorRunsDefaultRequestQueueAPIService service + +type ApiActRunsLastRequestQueueDeleteRequest struct { + ctx context.Context + ApiService *LastActorRunsDefaultRequestQueueAPIService + actorId string + status *string +} + +// Filter for the run status. +func (r ApiActRunsLastRequestQueueDeleteRequest) Status(status string) ApiActRunsLastRequestQueueDeleteRequest { + r.status = &status + return r +} + +func (r ApiActRunsLastRequestQueueDeleteRequest) Execute() (*http.Response, error) { + return r.ApiService.ActRunsLastRequestQueueDeleteExecute(r) +} + +/* +ActRunsLastRequestQueueDelete Delete last run's default request queue + +Deletes the default request queue associated with the last Actor run. + +This endpoint is a shortcut for getting the last run's `defaultRequestQueueId` and then using the +[Delete request queue](/api/v2/request-queue-delete) endpoint. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param actorId Actor ID or a tilde-separated owner's username and Actor name. + @return ApiActRunsLastRequestQueueDeleteRequest +*/ +func (a *LastActorRunsDefaultRequestQueueAPIService) ActRunsLastRequestQueueDelete(ctx context.Context, actorId string) ApiActRunsLastRequestQueueDeleteRequest { + return ApiActRunsLastRequestQueueDeleteRequest{ + ApiService: a, + ctx: ctx, + actorId: actorId, + } +} + +// Execute executes the request +func (a *LastActorRunsDefaultRequestQueueAPIService) ActRunsLastRequestQueueDeleteExecute(r ApiActRunsLastRequestQueueDeleteRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LastActorRunsDefaultRequestQueueAPIService.ActRunsLastRequestQueueDelete") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/actors/{actorId}/runs/last/request-queue" + localVarPath = strings.Replace(localVarPath, "{"+"actorId"+"}", url.PathEscape(parameterValueToString(r.actorId, "actorId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.status != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "status", r.status, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiActRunsLastRequestQueueGetRequest struct { + ctx context.Context + ApiService *LastActorRunsDefaultRequestQueueAPIService + actorId string + status *string +} + +// Filter for the run status. +func (r ApiActRunsLastRequestQueueGetRequest) Status(status string) ApiActRunsLastRequestQueueGetRequest { + r.status = &status + return r +} + +func (r ApiActRunsLastRequestQueueGetRequest) Execute() (*RequestQueueResponse, *http.Response, error) { + return r.ApiService.ActRunsLastRequestQueueGetExecute(r) +} + +/* +ActRunsLastRequestQueueGet Get last run's default request queue + +Returns the default request queue associated with the last Actor run. + +This endpoint is a shortcut for getting the last run's `defaultRequestQueueId` and then using the +[Get request queue](/api/v2/request-queue-get) endpoint. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param actorId Actor ID or a tilde-separated owner's username and Actor name. + @return ApiActRunsLastRequestQueueGetRequest +*/ +func (a *LastActorRunsDefaultRequestQueueAPIService) ActRunsLastRequestQueueGet(ctx context.Context, actorId string) ApiActRunsLastRequestQueueGetRequest { + return ApiActRunsLastRequestQueueGetRequest{ + ApiService: a, + ctx: ctx, + actorId: actorId, + } +} + +// Execute executes the request +// @return RequestQueueResponse +func (a *LastActorRunsDefaultRequestQueueAPIService) ActRunsLastRequestQueueGetExecute(r ApiActRunsLastRequestQueueGetRequest) (*RequestQueueResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *RequestQueueResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LastActorRunsDefaultRequestQueueAPIService.ActRunsLastRequestQueueGet") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/actors/{actorId}/runs/last/request-queue" + localVarPath = strings.Replace(localVarPath, "{"+"actorId"+"}", url.PathEscape(parameterValueToString(r.actorId, "actorId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.status != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "status", r.status, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiActRunsLastRequestQueueHeadGetRequest struct { + ctx context.Context + ApiService *LastActorRunsDefaultRequestQueueAPIService + actorId string + status *string + limit *float64 + clientKey *string +} + +// Filter for the run status. +func (r ApiActRunsLastRequestQueueHeadGetRequest) Status(status string) ApiActRunsLastRequestQueueHeadGetRequest { + r.status = &status + return r +} + +// How many items from queue should be returned. +func (r ApiActRunsLastRequestQueueHeadGetRequest) Limit(limit float64) ApiActRunsLastRequestQueueHeadGetRequest { + r.limit = &limit + return r +} + +// A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. +func (r ApiActRunsLastRequestQueueHeadGetRequest) ClientKey(clientKey string) ApiActRunsLastRequestQueueHeadGetRequest { + r.clientKey = &clientKey + return r +} + +func (r ApiActRunsLastRequestQueueHeadGetRequest) Execute() (*HeadResponse, *http.Response, error) { + return r.ApiService.ActRunsLastRequestQueueHeadGetExecute(r) +} + +/* +ActRunsLastRequestQueueHeadGet Get last run's default request queue head + +Returns the given number of first requests from the default request queue of the last Actor run. + +This endpoint is a shortcut for getting the last run's `defaultRequestQueueId` and then using the +[Get head](/api/v2/request-queue-head-get) endpoint. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param actorId Actor ID or a tilde-separated owner's username and Actor name. + @return ApiActRunsLastRequestQueueHeadGetRequest +*/ +func (a *LastActorRunsDefaultRequestQueueAPIService) ActRunsLastRequestQueueHeadGet(ctx context.Context, actorId string) ApiActRunsLastRequestQueueHeadGetRequest { + return ApiActRunsLastRequestQueueHeadGetRequest{ + ApiService: a, + ctx: ctx, + actorId: actorId, + } +} + +// Execute executes the request +// @return HeadResponse +func (a *LastActorRunsDefaultRequestQueueAPIService) ActRunsLastRequestQueueHeadGetExecute(r ApiActRunsLastRequestQueueHeadGetRequest) (*HeadResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *HeadResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LastActorRunsDefaultRequestQueueAPIService.ActRunsLastRequestQueueHeadGet") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/actors/{actorId}/runs/last/request-queue/head" + localVarPath = strings.Replace(localVarPath, "{"+"actorId"+"}", url.PathEscape(parameterValueToString(r.actorId, "actorId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.status != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "status", r.status, "form", "") + } + if r.limit != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "form", "") + } + if r.clientKey != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "clientKey", r.clientKey, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiActRunsLastRequestQueueHeadLockPostRequest struct { + ctx context.Context + ApiService *LastActorRunsDefaultRequestQueueAPIService + actorId string + lockSecs *float64 + status *string + limit *float64 + clientKey *string +} + +// How long the requests will be locked for (in seconds). +func (r ApiActRunsLastRequestQueueHeadLockPostRequest) LockSecs(lockSecs float64) ApiActRunsLastRequestQueueHeadLockPostRequest { + r.lockSecs = &lockSecs + return r +} + +// Filter for the run status. +func (r ApiActRunsLastRequestQueueHeadLockPostRequest) Status(status string) ApiActRunsLastRequestQueueHeadLockPostRequest { + r.status = &status + return r +} + +// How many items from the queue should be returned. +func (r ApiActRunsLastRequestQueueHeadLockPostRequest) Limit(limit float64) ApiActRunsLastRequestQueueHeadLockPostRequest { + r.limit = &limit + return r +} + +// A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. +func (r ApiActRunsLastRequestQueueHeadLockPostRequest) ClientKey(clientKey string) ApiActRunsLastRequestQueueHeadLockPostRequest { + r.clientKey = &clientKey + return r +} + +func (r ApiActRunsLastRequestQueueHeadLockPostRequest) Execute() (*HeadAndLockResponse, *http.Response, error) { + return r.ApiService.ActRunsLastRequestQueueHeadLockPostExecute(r) +} + +/* +ActRunsLastRequestQueueHeadLockPost Get and lock last run's default request queue head + +Returns the given number of first requests from the default request queue of the last Actor run +and locks them for the given time. + +This endpoint is a shortcut for getting the last run's `defaultRequestQueueId` and then using the +[Get head and lock](/api/v2/request-queue-head-lock-post) endpoint. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param actorId Actor ID or a tilde-separated owner's username and Actor name. + @return ApiActRunsLastRequestQueueHeadLockPostRequest +*/ +func (a *LastActorRunsDefaultRequestQueueAPIService) ActRunsLastRequestQueueHeadLockPost(ctx context.Context, actorId string) ApiActRunsLastRequestQueueHeadLockPostRequest { + return ApiActRunsLastRequestQueueHeadLockPostRequest{ + ApiService: a, + ctx: ctx, + actorId: actorId, + } +} + +// Execute executes the request +// @return HeadAndLockResponse +func (a *LastActorRunsDefaultRequestQueueAPIService) ActRunsLastRequestQueueHeadLockPostExecute(r ApiActRunsLastRequestQueueHeadLockPostRequest) (*HeadAndLockResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *HeadAndLockResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LastActorRunsDefaultRequestQueueAPIService.ActRunsLastRequestQueueHeadLockPost") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/actors/{actorId}/runs/last/request-queue/head/lock" + localVarPath = strings.Replace(localVarPath, "{"+"actorId"+"}", url.PathEscape(parameterValueToString(r.actorId, "actorId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.lockSecs == nil { + return localVarReturnValue, nil, reportError("lockSecs is required and must be specified") + } + + if r.status != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "status", r.status, "form", "") + } + parameterAddToHeaderOrQuery(localVarQueryParams, "lockSecs", r.lockSecs, "form", "") + if r.limit != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "form", "") + } + if r.clientKey != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "clientKey", r.clientKey, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiActRunsLastRequestQueuePutRequest struct { + ctx context.Context + ApiService *LastActorRunsDefaultRequestQueueAPIService + actorId string + updateRequestQueueRequest *UpdateRequestQueueRequest + status *string +} + +// +func (r ApiActRunsLastRequestQueuePutRequest) UpdateRequestQueueRequest(updateRequestQueueRequest UpdateRequestQueueRequest) ApiActRunsLastRequestQueuePutRequest { + r.updateRequestQueueRequest = &updateRequestQueueRequest + return r +} + +// Filter for the run status. +func (r ApiActRunsLastRequestQueuePutRequest) Status(status string) ApiActRunsLastRequestQueuePutRequest { + r.status = &status + return r +} + +func (r ApiActRunsLastRequestQueuePutRequest) Execute() (*RequestQueueResponse, *http.Response, error) { + return r.ApiService.ActRunsLastRequestQueuePutExecute(r) +} + +/* +ActRunsLastRequestQueuePut Update last run's default request queue + +Updates the default request queue associated with the last Actor run. + +This endpoint is a shortcut for getting the last run's `defaultRequestQueueId` and then using the +[Update request queue](/api/v2/request-queue-put) endpoint. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param actorId Actor ID or a tilde-separated owner's username and Actor name. + @return ApiActRunsLastRequestQueuePutRequest +*/ +func (a *LastActorRunsDefaultRequestQueueAPIService) ActRunsLastRequestQueuePut(ctx context.Context, actorId string) ApiActRunsLastRequestQueuePutRequest { + return ApiActRunsLastRequestQueuePutRequest{ + ApiService: a, + ctx: ctx, + actorId: actorId, + } +} + +// Execute executes the request +// @return RequestQueueResponse +func (a *LastActorRunsDefaultRequestQueueAPIService) ActRunsLastRequestQueuePutExecute(r ApiActRunsLastRequestQueuePutRequest) (*RequestQueueResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *RequestQueueResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LastActorRunsDefaultRequestQueueAPIService.ActRunsLastRequestQueuePut") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/actors/{actorId}/runs/last/request-queue" + localVarPath = strings.Replace(localVarPath, "{"+"actorId"+"}", url.PathEscape(parameterValueToString(r.actorId, "actorId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.updateRequestQueueRequest == nil { + return localVarReturnValue, nil, reportError("updateRequestQueueRequest is required and must be specified") + } + + if r.status != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "status", r.status, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.updateRequestQueueRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 413 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 415 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiActRunsLastRequestQueueRequestDeleteRequest struct { + ctx context.Context + ApiService *LastActorRunsDefaultRequestQueueAPIService + actorId string + requestId string + status *string + clientKey *string +} + +// Filter for the run status. +func (r ApiActRunsLastRequestQueueRequestDeleteRequest) Status(status string) ApiActRunsLastRequestQueueRequestDeleteRequest { + r.status = &status + return r +} + +// A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. +func (r ApiActRunsLastRequestQueueRequestDeleteRequest) ClientKey(clientKey string) ApiActRunsLastRequestQueueRequestDeleteRequest { + r.clientKey = &clientKey + return r +} + +func (r ApiActRunsLastRequestQueueRequestDeleteRequest) Execute() (*http.Response, error) { + return r.ApiService.ActRunsLastRequestQueueRequestDeleteExecute(r) +} + +/* +ActRunsLastRequestQueueRequestDelete Delete request from last run's default request queue + +Deletes a request from the default request queue of the last Actor run. + +This endpoint is a shortcut for getting the last run's `defaultRequestQueueId` and then using the +[Delete request](/api/v2/request-queue-request-delete) endpoint. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param actorId Actor ID or a tilde-separated owner's username and Actor name. + @param requestId Request ID. + @return ApiActRunsLastRequestQueueRequestDeleteRequest +*/ +func (a *LastActorRunsDefaultRequestQueueAPIService) ActRunsLastRequestQueueRequestDelete(ctx context.Context, actorId string, requestId string) ApiActRunsLastRequestQueueRequestDeleteRequest { + return ApiActRunsLastRequestQueueRequestDeleteRequest{ + ApiService: a, + ctx: ctx, + actorId: actorId, + requestId: requestId, + } +} + +// Execute executes the request +func (a *LastActorRunsDefaultRequestQueueAPIService) ActRunsLastRequestQueueRequestDeleteExecute(r ApiActRunsLastRequestQueueRequestDeleteRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LastActorRunsDefaultRequestQueueAPIService.ActRunsLastRequestQueueRequestDelete") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/actors/{actorId}/runs/last/request-queue/requests/{requestId}" + localVarPath = strings.Replace(localVarPath, "{"+"actorId"+"}", url.PathEscape(parameterValueToString(r.actorId, "actorId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"requestId"+"}", url.PathEscape(parameterValueToString(r.requestId, "requestId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.status != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "status", r.status, "form", "") + } + if r.clientKey != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "clientKey", r.clientKey, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiActRunsLastRequestQueueRequestGetRequest struct { + ctx context.Context + ApiService *LastActorRunsDefaultRequestQueueAPIService + actorId string + requestId string + status *string +} + +// Filter for the run status. +func (r ApiActRunsLastRequestQueueRequestGetRequest) Status(status string) ApiActRunsLastRequestQueueRequestGetRequest { + r.status = &status + return r +} + +func (r ApiActRunsLastRequestQueueRequestGetRequest) Execute() (*RequestResponse, *http.Response, error) { + return r.ApiService.ActRunsLastRequestQueueRequestGetExecute(r) +} + +/* +ActRunsLastRequestQueueRequestGet Get request from last run's default request queue + +Returns a request from the default request queue of the last Actor run. + +This endpoint is a shortcut for getting the last run's `defaultRequestQueueId` and then using the +[Get request](/api/v2/request-queue-request-get) endpoint. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param actorId Actor ID or a tilde-separated owner's username and Actor name. + @param requestId Request ID. + @return ApiActRunsLastRequestQueueRequestGetRequest +*/ +func (a *LastActorRunsDefaultRequestQueueAPIService) ActRunsLastRequestQueueRequestGet(ctx context.Context, actorId string, requestId string) ApiActRunsLastRequestQueueRequestGetRequest { + return ApiActRunsLastRequestQueueRequestGetRequest{ + ApiService: a, + ctx: ctx, + actorId: actorId, + requestId: requestId, + } +} + +// Execute executes the request +// @return RequestResponse +func (a *LastActorRunsDefaultRequestQueueAPIService) ActRunsLastRequestQueueRequestGetExecute(r ApiActRunsLastRequestQueueRequestGetRequest) (*RequestResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *RequestResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LastActorRunsDefaultRequestQueueAPIService.ActRunsLastRequestQueueRequestGet") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/actors/{actorId}/runs/last/request-queue/requests/{requestId}" + localVarPath = strings.Replace(localVarPath, "{"+"actorId"+"}", url.PathEscape(parameterValueToString(r.actorId, "actorId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"requestId"+"}", url.PathEscape(parameterValueToString(r.requestId, "requestId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.status != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "status", r.status, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiActRunsLastRequestQueueRequestLockDeleteRequest struct { + ctx context.Context + ApiService *LastActorRunsDefaultRequestQueueAPIService + actorId string + requestId string + status *string + clientKey *string + forefront *string +} + +// Filter for the run status. +func (r ApiActRunsLastRequestQueueRequestLockDeleteRequest) Status(status string) ApiActRunsLastRequestQueueRequestLockDeleteRequest { + r.status = &status + return r +} + +// A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. +func (r ApiActRunsLastRequestQueueRequestLockDeleteRequest) ClientKey(clientKey string) ApiActRunsLastRequestQueueRequestLockDeleteRequest { + r.clientKey = &clientKey + return r +} + +// Determines if request should be added to the head of the queue or to the end after lock was removed. +func (r ApiActRunsLastRequestQueueRequestLockDeleteRequest) Forefront(forefront string) ApiActRunsLastRequestQueueRequestLockDeleteRequest { + r.forefront = &forefront + return r +} + +func (r ApiActRunsLastRequestQueueRequestLockDeleteRequest) Execute() (*http.Response, error) { + return r.ApiService.ActRunsLastRequestQueueRequestLockDeleteExecute(r) +} + +/* +ActRunsLastRequestQueueRequestLockDelete Delete lock on request in last run's default request queue + +Deletes a request lock in the default request queue of the last Actor run. + +This endpoint is a shortcut for getting the last run's `defaultRequestQueueId` and then using the +[Delete request lock](/api/v2/request-queue-request-lock-delete) endpoint. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param actorId Actor ID or a tilde-separated owner's username and Actor name. + @param requestId Request ID. + @return ApiActRunsLastRequestQueueRequestLockDeleteRequest +*/ +func (a *LastActorRunsDefaultRequestQueueAPIService) ActRunsLastRequestQueueRequestLockDelete(ctx context.Context, actorId string, requestId string) ApiActRunsLastRequestQueueRequestLockDeleteRequest { + return ApiActRunsLastRequestQueueRequestLockDeleteRequest{ + ApiService: a, + ctx: ctx, + actorId: actorId, + requestId: requestId, + } +} + +// Execute executes the request +func (a *LastActorRunsDefaultRequestQueueAPIService) ActRunsLastRequestQueueRequestLockDeleteExecute(r ApiActRunsLastRequestQueueRequestLockDeleteRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LastActorRunsDefaultRequestQueueAPIService.ActRunsLastRequestQueueRequestLockDelete") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/actors/{actorId}/runs/last/request-queue/requests/{requestId}/lock" + localVarPath = strings.Replace(localVarPath, "{"+"actorId"+"}", url.PathEscape(parameterValueToString(r.actorId, "actorId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"requestId"+"}", url.PathEscape(parameterValueToString(r.requestId, "requestId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.status != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "status", r.status, "form", "") + } + if r.clientKey != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "clientKey", r.clientKey, "form", "") + } + if r.forefront != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "forefront", r.forefront, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiActRunsLastRequestQueueRequestLockPutRequest struct { + ctx context.Context + ApiService *LastActorRunsDefaultRequestQueueAPIService + actorId string + requestId string + lockSecs *float64 + status *string + clientKey *string + forefront *string +} + +// How long the requests will be locked for (in seconds). +func (r ApiActRunsLastRequestQueueRequestLockPutRequest) LockSecs(lockSecs float64) ApiActRunsLastRequestQueueRequestLockPutRequest { + r.lockSecs = &lockSecs + return r +} + +// Filter for the run status. +func (r ApiActRunsLastRequestQueueRequestLockPutRequest) Status(status string) ApiActRunsLastRequestQueueRequestLockPutRequest { + r.status = &status + return r +} + +// A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. +func (r ApiActRunsLastRequestQueueRequestLockPutRequest) ClientKey(clientKey string) ApiActRunsLastRequestQueueRequestLockPutRequest { + r.clientKey = &clientKey + return r +} + +// Determines if request should be added to the head of the queue or to the end after lock expires. +func (r ApiActRunsLastRequestQueueRequestLockPutRequest) Forefront(forefront string) ApiActRunsLastRequestQueueRequestLockPutRequest { + r.forefront = &forefront + return r +} + +func (r ApiActRunsLastRequestQueueRequestLockPutRequest) Execute() (*ProlongRequestLockResponse, *http.Response, error) { + return r.ApiService.ActRunsLastRequestQueueRequestLockPutExecute(r) +} + +/* +ActRunsLastRequestQueueRequestLockPut Prolong lock on request in last run's default request queue + +Prolongs a request lock in the default request queue of the last Actor run. + +This endpoint is a shortcut for getting the last run's `defaultRequestQueueId` and then using the +[Prolong request lock](/api/v2/request-queue-request-lock-put) endpoint. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param actorId Actor ID or a tilde-separated owner's username and Actor name. + @param requestId Request ID. + @return ApiActRunsLastRequestQueueRequestLockPutRequest +*/ +func (a *LastActorRunsDefaultRequestQueueAPIService) ActRunsLastRequestQueueRequestLockPut(ctx context.Context, actorId string, requestId string) ApiActRunsLastRequestQueueRequestLockPutRequest { + return ApiActRunsLastRequestQueueRequestLockPutRequest{ + ApiService: a, + ctx: ctx, + actorId: actorId, + requestId: requestId, + } +} + +// Execute executes the request +// @return ProlongRequestLockResponse +func (a *LastActorRunsDefaultRequestQueueAPIService) ActRunsLastRequestQueueRequestLockPutExecute(r ApiActRunsLastRequestQueueRequestLockPutRequest) (*ProlongRequestLockResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ProlongRequestLockResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LastActorRunsDefaultRequestQueueAPIService.ActRunsLastRequestQueueRequestLockPut") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/actors/{actorId}/runs/last/request-queue/requests/{requestId}/lock" + localVarPath = strings.Replace(localVarPath, "{"+"actorId"+"}", url.PathEscape(parameterValueToString(r.actorId, "actorId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"requestId"+"}", url.PathEscape(parameterValueToString(r.requestId, "requestId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.lockSecs == nil { + return localVarReturnValue, nil, reportError("lockSecs is required and must be specified") + } + + if r.status != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "status", r.status, "form", "") + } + parameterAddToHeaderOrQuery(localVarQueryParams, "lockSecs", r.lockSecs, "form", "") + if r.clientKey != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "clientKey", r.clientKey, "form", "") + } + if r.forefront != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "forefront", r.forefront, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiActRunsLastRequestQueueRequestPutRequest struct { + ctx context.Context + ApiService *LastActorRunsDefaultRequestQueueAPIService + actorId string + requestId string + request *Request + status *string + forefront *string + clientKey *string +} + +// +func (r ApiActRunsLastRequestQueueRequestPutRequest) Request(request Request) ApiActRunsLastRequestQueueRequestPutRequest { + r.request = &request + return r +} + +// Filter for the run status. +func (r ApiActRunsLastRequestQueueRequestPutRequest) Status(status string) ApiActRunsLastRequestQueueRequestPutRequest { + r.status = &status + return r +} + +// Determines if request should be added to the head of the queue or to the end. Default value is `false` (end of queue). +func (r ApiActRunsLastRequestQueueRequestPutRequest) Forefront(forefront string) ApiActRunsLastRequestQueueRequestPutRequest { + r.forefront = &forefront + return r +} + +// A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. +func (r ApiActRunsLastRequestQueueRequestPutRequest) ClientKey(clientKey string) ApiActRunsLastRequestQueueRequestPutRequest { + r.clientKey = &clientKey + return r +} + +func (r ApiActRunsLastRequestQueueRequestPutRequest) Execute() (*UpdateRequestResponse, *http.Response, error) { + return r.ApiService.ActRunsLastRequestQueueRequestPutExecute(r) +} + +/* +ActRunsLastRequestQueueRequestPut Update request in last run's default request queue + +Updates a request in the default request queue of the last Actor run. + +This endpoint is a shortcut for getting the last run's `defaultRequestQueueId` and then using the +[Update request](/api/v2/request-queue-request-put) endpoint. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param actorId Actor ID or a tilde-separated owner's username and Actor name. + @param requestId Request ID. + @return ApiActRunsLastRequestQueueRequestPutRequest +*/ +func (a *LastActorRunsDefaultRequestQueueAPIService) ActRunsLastRequestQueueRequestPut(ctx context.Context, actorId string, requestId string) ApiActRunsLastRequestQueueRequestPutRequest { + return ApiActRunsLastRequestQueueRequestPutRequest{ + ApiService: a, + ctx: ctx, + actorId: actorId, + requestId: requestId, + } +} + +// Execute executes the request +// @return UpdateRequestResponse +func (a *LastActorRunsDefaultRequestQueueAPIService) ActRunsLastRequestQueueRequestPutExecute(r ApiActRunsLastRequestQueueRequestPutRequest) (*UpdateRequestResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *UpdateRequestResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LastActorRunsDefaultRequestQueueAPIService.ActRunsLastRequestQueueRequestPut") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/actors/{actorId}/runs/last/request-queue/requests/{requestId}" + localVarPath = strings.Replace(localVarPath, "{"+"actorId"+"}", url.PathEscape(parameterValueToString(r.actorId, "actorId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"requestId"+"}", url.PathEscape(parameterValueToString(r.requestId, "requestId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.request == nil { + return localVarReturnValue, nil, reportError("request is required and must be specified") + } + + if r.status != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "status", r.status, "form", "") + } + if r.forefront != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "forefront", r.forefront, "form", "") + } + if r.clientKey != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "clientKey", r.clientKey, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.request + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 413 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 415 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiActRunsLastRequestQueueRequestsBatchDeleteRequest struct { + ctx context.Context + ApiService *LastActorRunsDefaultRequestQueueAPIService + actorId string + contentType *string + requestDraftDelete *[]RequestDraftDelete + status *string + clientKey *string +} + +// +func (r ApiActRunsLastRequestQueueRequestsBatchDeleteRequest) ContentType(contentType string) ApiActRunsLastRequestQueueRequestsBatchDeleteRequest { + r.contentType = &contentType + return r +} + +// +func (r ApiActRunsLastRequestQueueRequestsBatchDeleteRequest) RequestDraftDelete(requestDraftDelete []RequestDraftDelete) ApiActRunsLastRequestQueueRequestsBatchDeleteRequest { + r.requestDraftDelete = &requestDraftDelete + return r +} + +// Filter for the run status. +func (r ApiActRunsLastRequestQueueRequestsBatchDeleteRequest) Status(status string) ApiActRunsLastRequestQueueRequestsBatchDeleteRequest { + r.status = &status + return r +} + +// A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. +func (r ApiActRunsLastRequestQueueRequestsBatchDeleteRequest) ClientKey(clientKey string) ApiActRunsLastRequestQueueRequestsBatchDeleteRequest { + r.clientKey = &clientKey + return r +} + +func (r ApiActRunsLastRequestQueueRequestsBatchDeleteRequest) Execute() (*BatchDeleteResponse, *http.Response, error) { + return r.ApiService.ActRunsLastRequestQueueRequestsBatchDeleteExecute(r) +} + +/* +ActRunsLastRequestQueueRequestsBatchDelete Batch delete requests from last run's default request queue + +Batch-deletes requests from the default request queue of the last Actor run. + +This endpoint is a shortcut for getting the last run's `defaultRequestQueueId` and then using the +[Delete requests](/api/v2/request-queue-requests-batch-delete) endpoint. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param actorId Actor ID or a tilde-separated owner's username and Actor name. + @return ApiActRunsLastRequestQueueRequestsBatchDeleteRequest +*/ +func (a *LastActorRunsDefaultRequestQueueAPIService) ActRunsLastRequestQueueRequestsBatchDelete(ctx context.Context, actorId string) ApiActRunsLastRequestQueueRequestsBatchDeleteRequest { + return ApiActRunsLastRequestQueueRequestsBatchDeleteRequest{ + ApiService: a, + ctx: ctx, + actorId: actorId, + } +} + +// Execute executes the request +// @return BatchDeleteResponse +func (a *LastActorRunsDefaultRequestQueueAPIService) ActRunsLastRequestQueueRequestsBatchDeleteExecute(r ApiActRunsLastRequestQueueRequestsBatchDeleteRequest) (*BatchDeleteResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *BatchDeleteResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LastActorRunsDefaultRequestQueueAPIService.ActRunsLastRequestQueueRequestsBatchDelete") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/actors/{actorId}/runs/last/request-queue/requests/batch" + localVarPath = strings.Replace(localVarPath, "{"+"actorId"+"}", url.PathEscape(parameterValueToString(r.actorId, "actorId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.contentType == nil { + return localVarReturnValue, nil, reportError("contentType is required and must be specified") + } + if r.requestDraftDelete == nil { + return localVarReturnValue, nil, reportError("requestDraftDelete is required and must be specified") + } + + if r.status != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "status", r.status, "form", "") + } + if r.clientKey != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "clientKey", r.clientKey, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + parameterAddToHeaderOrQuery(localVarHeaderParams, "Content-Type", r.contentType, "simple", "") + // body params + localVarPostBody = r.requestDraftDelete + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 413 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 415 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiActRunsLastRequestQueueRequestsBatchPostRequest struct { + ctx context.Context + ApiService *LastActorRunsDefaultRequestQueueAPIService + actorId string + requestBase *[]RequestBase + status *string + clientKey *string + forefront *string +} + +// +func (r ApiActRunsLastRequestQueueRequestsBatchPostRequest) RequestBase(requestBase []RequestBase) ApiActRunsLastRequestQueueRequestsBatchPostRequest { + r.requestBase = &requestBase + return r +} + +// Filter for the run status. +func (r ApiActRunsLastRequestQueueRequestsBatchPostRequest) Status(status string) ApiActRunsLastRequestQueueRequestsBatchPostRequest { + r.status = &status + return r +} + +// A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. +func (r ApiActRunsLastRequestQueueRequestsBatchPostRequest) ClientKey(clientKey string) ApiActRunsLastRequestQueueRequestsBatchPostRequest { + r.clientKey = &clientKey + return r +} + +// Determines if request should be added to the head of the queue or to the end. Default value is `false` (end of queue). +func (r ApiActRunsLastRequestQueueRequestsBatchPostRequest) Forefront(forefront string) ApiActRunsLastRequestQueueRequestsBatchPostRequest { + r.forefront = &forefront + return r +} + +func (r ApiActRunsLastRequestQueueRequestsBatchPostRequest) Execute() (*BatchAddResponse, *http.Response, error) { + return r.ApiService.ActRunsLastRequestQueueRequestsBatchPostExecute(r) +} + +/* +ActRunsLastRequestQueueRequestsBatchPost Batch add requests to last run's default request queue + +Adds requests to the default request queue of the last Actor run in batch. + +This endpoint is a shortcut for getting the last run's `defaultRequestQueueId` and then using the +[Add requests](/api/v2/request-queue-requests-batch-post) endpoint. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param actorId Actor ID or a tilde-separated owner's username and Actor name. + @return ApiActRunsLastRequestQueueRequestsBatchPostRequest +*/ +func (a *LastActorRunsDefaultRequestQueueAPIService) ActRunsLastRequestQueueRequestsBatchPost(ctx context.Context, actorId string) ApiActRunsLastRequestQueueRequestsBatchPostRequest { + return ApiActRunsLastRequestQueueRequestsBatchPostRequest{ + ApiService: a, + ctx: ctx, + actorId: actorId, + } +} + +// Execute executes the request +// @return BatchAddResponse +func (a *LastActorRunsDefaultRequestQueueAPIService) ActRunsLastRequestQueueRequestsBatchPostExecute(r ApiActRunsLastRequestQueueRequestsBatchPostRequest) (*BatchAddResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *BatchAddResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LastActorRunsDefaultRequestQueueAPIService.ActRunsLastRequestQueueRequestsBatchPost") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/actors/{actorId}/runs/last/request-queue/requests/batch" + localVarPath = strings.Replace(localVarPath, "{"+"actorId"+"}", url.PathEscape(parameterValueToString(r.actorId, "actorId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.requestBase == nil { + return localVarReturnValue, nil, reportError("requestBase is required and must be specified") + } + + if r.status != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "status", r.status, "form", "") + } + if r.clientKey != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "clientKey", r.clientKey, "form", "") + } + if r.forefront != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "forefront", r.forefront, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.requestBase + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 413 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 415 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiActRunsLastRequestQueueRequestsGetRequest struct { + ctx context.Context + ApiService *LastActorRunsDefaultRequestQueueAPIService + actorId string + status *string + clientKey *string + exclusiveStartId *string + limit *float64 + cursor *string + filter *[]string +} + +// Filter for the run status. +func (r ApiActRunsLastRequestQueueRequestsGetRequest) Status(status string) ApiActRunsLastRequestQueueRequestsGetRequest { + r.status = &status + return r +} + +// A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. +func (r ApiActRunsLastRequestQueueRequestsGetRequest) ClientKey(clientKey string) ApiActRunsLastRequestQueueRequestsGetRequest { + r.clientKey = &clientKey + return r +} + +// All requests up to this one (including) are skipped from the result. (Deprecated, use `cursor` instead.) +// Deprecated +func (r ApiActRunsLastRequestQueueRequestsGetRequest) ExclusiveStartId(exclusiveStartId string) ApiActRunsLastRequestQueueRequestsGetRequest { + r.exclusiveStartId = &exclusiveStartId + return r +} + +// Number of keys to be returned. Maximum value is `10000`. +func (r ApiActRunsLastRequestQueueRequestsGetRequest) Limit(limit float64) ApiActRunsLastRequestQueueRequestsGetRequest { + r.limit = &limit + return r +} + +// A cursor string for pagination, returned in the previous response as `nextCursor`. Use this to retrieve the next page of requests. +func (r ApiActRunsLastRequestQueueRequestsGetRequest) Cursor(cursor string) ApiActRunsLastRequestQueueRequestsGetRequest { + r.cursor = &cursor + return r +} + +// Filter requests by their state. Possible values are `locked` and `pending`. You can combine multiple values separated by commas, which will mean the union of these filters – requests matching any of the specified states will be returned. (Not compatible with deprecated `exclusiveStartId` parameter.) +func (r ApiActRunsLastRequestQueueRequestsGetRequest) Filter(filter []string) ApiActRunsLastRequestQueueRequestsGetRequest { + r.filter = &filter + return r +} + +func (r ApiActRunsLastRequestQueueRequestsGetRequest) Execute() (*ListOfRequestsResponse, *http.Response, error) { + return r.ApiService.ActRunsLastRequestQueueRequestsGetExecute(r) +} + +/* +ActRunsLastRequestQueueRequestsGet List last run's default request queue's requests + +Returns a list of requests from the default request queue of the last Actor run. + +This endpoint is a shortcut for getting the last run's `defaultRequestQueueId` and then using the +[List requests](/api/v2/request-queue-requests-get) endpoint. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param actorId Actor ID or a tilde-separated owner's username and Actor name. + @return ApiActRunsLastRequestQueueRequestsGetRequest +*/ +func (a *LastActorRunsDefaultRequestQueueAPIService) ActRunsLastRequestQueueRequestsGet(ctx context.Context, actorId string) ApiActRunsLastRequestQueueRequestsGetRequest { + return ApiActRunsLastRequestQueueRequestsGetRequest{ + ApiService: a, + ctx: ctx, + actorId: actorId, + } +} + +// Execute executes the request +// @return ListOfRequestsResponse +func (a *LastActorRunsDefaultRequestQueueAPIService) ActRunsLastRequestQueueRequestsGetExecute(r ApiActRunsLastRequestQueueRequestsGetRequest) (*ListOfRequestsResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ListOfRequestsResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LastActorRunsDefaultRequestQueueAPIService.ActRunsLastRequestQueueRequestsGet") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/actors/{actorId}/runs/last/request-queue/requests" + localVarPath = strings.Replace(localVarPath, "{"+"actorId"+"}", url.PathEscape(parameterValueToString(r.actorId, "actorId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.status != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "status", r.status, "form", "") + } + if r.clientKey != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "clientKey", r.clientKey, "form", "") + } + if r.exclusiveStartId != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "exclusiveStartId", r.exclusiveStartId, "form", "") + } + if r.limit != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "form", "") + } + if r.cursor != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "cursor", r.cursor, "form", "") + } + if r.filter != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "filter", r.filter, "form", "csv") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiActRunsLastRequestQueueRequestsPostRequest struct { + ctx context.Context + ApiService *LastActorRunsDefaultRequestQueueAPIService + actorId string + requestBase *RequestBase + status *string + clientKey *string + forefront *string +} + +// +func (r ApiActRunsLastRequestQueueRequestsPostRequest) RequestBase(requestBase RequestBase) ApiActRunsLastRequestQueueRequestsPostRequest { + r.requestBase = &requestBase + return r +} + +// Filter for the run status. +func (r ApiActRunsLastRequestQueueRequestsPostRequest) Status(status string) ApiActRunsLastRequestQueueRequestsPostRequest { + r.status = &status + return r +} + +// A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. +func (r ApiActRunsLastRequestQueueRequestsPostRequest) ClientKey(clientKey string) ApiActRunsLastRequestQueueRequestsPostRequest { + r.clientKey = &clientKey + return r +} + +// Determines if request should be added to the head of the queue or to the end. Default value is `false` (end of queue). +func (r ApiActRunsLastRequestQueueRequestsPostRequest) Forefront(forefront string) ApiActRunsLastRequestQueueRequestsPostRequest { + r.forefront = &forefront + return r +} + +func (r ApiActRunsLastRequestQueueRequestsPostRequest) Execute() (*AddRequestResponse, *http.Response, error) { + return r.ApiService.ActRunsLastRequestQueueRequestsPostExecute(r) +} + +/* +ActRunsLastRequestQueueRequestsPost Add request to last run's default request queue + +Adds a request to the default request queue of the last Actor run. + +This endpoint is a shortcut for getting the last run's `defaultRequestQueueId` and then using the +[Add request](/api/v2/request-queue-requests-post) endpoint. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param actorId Actor ID or a tilde-separated owner's username and Actor name. + @return ApiActRunsLastRequestQueueRequestsPostRequest +*/ +func (a *LastActorRunsDefaultRequestQueueAPIService) ActRunsLastRequestQueueRequestsPost(ctx context.Context, actorId string) ApiActRunsLastRequestQueueRequestsPostRequest { + return ApiActRunsLastRequestQueueRequestsPostRequest{ + ApiService: a, + ctx: ctx, + actorId: actorId, + } +} + +// Execute executes the request +// @return AddRequestResponse +func (a *LastActorRunsDefaultRequestQueueAPIService) ActRunsLastRequestQueueRequestsPostExecute(r ApiActRunsLastRequestQueueRequestsPostRequest) (*AddRequestResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *AddRequestResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LastActorRunsDefaultRequestQueueAPIService.ActRunsLastRequestQueueRequestsPost") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/actors/{actorId}/runs/last/request-queue/requests" + localVarPath = strings.Replace(localVarPath, "{"+"actorId"+"}", url.PathEscape(parameterValueToString(r.actorId, "actorId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.requestBase == nil { + return localVarReturnValue, nil, reportError("requestBase is required and must be specified") + } + + if r.status != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "status", r.status, "form", "") + } + if r.clientKey != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "clientKey", r.clientKey, "form", "") + } + if r.forefront != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "forefront", r.forefront, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.requestBase + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 413 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 415 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiActRunsLastRequestQueueRequestsUnlockPostRequest struct { + ctx context.Context + ApiService *LastActorRunsDefaultRequestQueueAPIService + actorId string + status *string + clientKey *string +} + +// Filter for the run status. +func (r ApiActRunsLastRequestQueueRequestsUnlockPostRequest) Status(status string) ApiActRunsLastRequestQueueRequestsUnlockPostRequest { + r.status = &status + return r +} + +// A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. +func (r ApiActRunsLastRequestQueueRequestsUnlockPostRequest) ClientKey(clientKey string) ApiActRunsLastRequestQueueRequestsUnlockPostRequest { + r.clientKey = &clientKey + return r +} + +func (r ApiActRunsLastRequestQueueRequestsUnlockPostRequest) Execute() (*UnlockRequestsResponse, *http.Response, error) { + return r.ApiService.ActRunsLastRequestQueueRequestsUnlockPostExecute(r) +} + +/* +ActRunsLastRequestQueueRequestsUnlockPost Unlock requests in last run's default request queue + +Unlocks requests in the default request queue of the last Actor run that are currently locked by the client. + +This endpoint is a shortcut for getting the last run's `defaultRequestQueueId` and then using the +[Unlock requests](/api/v2/request-queue-requests-unlock-post) endpoint. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param actorId Actor ID or a tilde-separated owner's username and Actor name. + @return ApiActRunsLastRequestQueueRequestsUnlockPostRequest +*/ +func (a *LastActorRunsDefaultRequestQueueAPIService) ActRunsLastRequestQueueRequestsUnlockPost(ctx context.Context, actorId string) ApiActRunsLastRequestQueueRequestsUnlockPostRequest { + return ApiActRunsLastRequestQueueRequestsUnlockPostRequest{ + ApiService: a, + ctx: ctx, + actorId: actorId, + } +} + +// Execute executes the request +// @return UnlockRequestsResponse +func (a *LastActorRunsDefaultRequestQueueAPIService) ActRunsLastRequestQueueRequestsUnlockPostExecute(r ApiActRunsLastRequestQueueRequestsUnlockPostRequest) (*UnlockRequestsResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *UnlockRequestsResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LastActorRunsDefaultRequestQueueAPIService.ActRunsLastRequestQueueRequestsUnlockPost") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/actors/{actorId}/runs/last/request-queue/requests/unlock" + localVarPath = strings.Replace(localVarPath, "{"+"actorId"+"}", url.PathEscape(parameterValueToString(r.actorId, "actorId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.status != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "status", r.status, "form", "") + } + if r.clientKey != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "clientKey", r.clientKey, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/api_last_actor_runs_log.go b/api_last_actor_runs_log.go new file mode 100644 index 0000000..40dc20a --- /dev/null +++ b/api_last_actor_runs_log.go @@ -0,0 +1,239 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" + "strings" +) + + +// LastActorRunsLogAPIService LastActorRunsLogAPI service +type LastActorRunsLogAPIService service + +type ApiActRunsLastLogGetRequest struct { + ctx context.Context + ApiService *LastActorRunsLogAPIService + actorId string + stream *bool + download *bool + raw *bool +} + +// If `true` or `1` then the logs will be streamed as long as the run or build is running. +func (r ApiActRunsLastLogGetRequest) Stream(stream bool) ApiActRunsLastLogGetRequest { + r.stream = &stream + return r +} + +// If `true` or `1` then the web browser will download the log file rather than open it in a tab. +func (r ApiActRunsLastLogGetRequest) Download(download bool) ApiActRunsLastLogGetRequest { + r.download = &download + return r +} + +// If `true` or `1`, the logs will be kept verbatim. By default, the API removes ANSI escape codes from the logs, keeping only printable characters. +func (r ApiActRunsLastLogGetRequest) Raw(raw bool) ApiActRunsLastLogGetRequest { + r.raw = &raw + return r +} + +func (r ApiActRunsLastLogGetRequest) Execute() (string, *http.Response, error) { + return r.ApiService.ActRunsLastLogGetExecute(r) +} + +/* +ActRunsLastLogGet Get last Actor run's log + +Retrieves last Actor run's logs. + +This endpoint is a shortcut for getting last Actor run's log. Same as [Get log](/api/v2/log-get) endpoint. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param actorId Actor ID or a tilde-separated owner's username and Actor name. + @return ApiActRunsLastLogGetRequest +*/ +func (a *LastActorRunsLogAPIService) ActRunsLastLogGet(ctx context.Context, actorId string) ApiActRunsLastLogGetRequest { + return ApiActRunsLastLogGetRequest{ + ApiService: a, + ctx: ctx, + actorId: actorId, + } +} + +// Execute executes the request +// @return string +func (a *LastActorRunsLogAPIService) ActRunsLastLogGetExecute(r ApiActRunsLastLogGetRequest) (string, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue string + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LastActorRunsLogAPIService.ActRunsLastLogGet") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/actors/{actorId}/runs/last/log" + localVarPath = strings.Replace(localVarPath, "{"+"actorId"+"}", url.PathEscape(parameterValueToString(r.actorId, "actorId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.stream != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "stream", r.stream, "form", "") + } + if r.download != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "download", r.download, "form", "") + } + if r.raw != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "raw", r.raw, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"text/plain", "application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/api_last_actor_runs_metamorph.go b/api_last_actor_runs_metamorph.go new file mode 100644 index 0000000..87196d0 --- /dev/null +++ b/api_last_actor_runs_metamorph.go @@ -0,0 +1,242 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" + "strings" +) + + +// LastActorRunsMetamorphAPIService LastActorRunsMetamorphAPI service +type LastActorRunsMetamorphAPIService service + +type ApiActRunsLastMetamorphPostRequest struct { + ctx context.Context + ApiService *LastActorRunsMetamorphAPIService + actorId string + targetActorId *string + status *string + build *string +} + +// ID of a target Actor that the run should be transformed into. +func (r ApiActRunsLastMetamorphPostRequest) TargetActorId(targetActorId string) ApiActRunsLastMetamorphPostRequest { + r.targetActorId = &targetActorId + return r +} + +// Filter for the run status. +func (r ApiActRunsLastMetamorphPostRequest) Status(status string) ApiActRunsLastMetamorphPostRequest { + r.status = &status + return r +} + +// Optional build of the target Actor. It can be either a build tag or build number. By default, the run uses the build specified in the default run configuration for the target Actor (typically `latest`). +func (r ApiActRunsLastMetamorphPostRequest) Build(build string) ApiActRunsLastMetamorphPostRequest { + r.build = &build + return r +} + +func (r ApiActRunsLastMetamorphPostRequest) Execute() (*RunResponse, *http.Response, error) { + return r.ApiService.ActRunsLastMetamorphPostExecute(r) +} + +/* +ActRunsLastMetamorphPost Metamorph Actor's last run + +Transforms the last run of the specified Actor into a run of another Actor with +a new input. + +This endpoint is a shortcut for [Metamorph run](#/reference/actor-runs/metamorph-run/metamorph-run) +on the Actor's last run. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param actorId Actor ID or a tilde-separated owner's username and Actor name. + @return ApiActRunsLastMetamorphPostRequest +*/ +func (a *LastActorRunsMetamorphAPIService) ActRunsLastMetamorphPost(ctx context.Context, actorId string) ApiActRunsLastMetamorphPostRequest { + return ApiActRunsLastMetamorphPostRequest{ + ApiService: a, + ctx: ctx, + actorId: actorId, + } +} + +// Execute executes the request +// @return RunResponse +func (a *LastActorRunsMetamorphAPIService) ActRunsLastMetamorphPostExecute(r ApiActRunsLastMetamorphPostRequest) (*RunResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *RunResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LastActorRunsMetamorphAPIService.ActRunsLastMetamorphPost") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/actors/{actorId}/runs/last/metamorph" + localVarPath = strings.Replace(localVarPath, "{"+"actorId"+"}", url.PathEscape(parameterValueToString(r.actorId, "actorId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.targetActorId == nil { + return localVarReturnValue, nil, reportError("targetActorId is required and must be specified") + } + + if r.status != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "status", r.status, "form", "") + } + parameterAddToHeaderOrQuery(localVarQueryParams, "targetActorId", r.targetActorId, "form", "") + if r.build != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "build", r.build, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/api_last_actor_runs_reboot.go b/api_last_actor_runs_reboot.go new file mode 100644 index 0000000..46dd799 --- /dev/null +++ b/api_last_actor_runs_reboot.go @@ -0,0 +1,223 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" + "strings" +) + + +// LastActorRunsRebootAPIService LastActorRunsRebootAPI service +type LastActorRunsRebootAPIService service + +type ApiActRunsLastRebootPostRequest struct { + ctx context.Context + ApiService *LastActorRunsRebootAPIService + actorId string + status *string +} + +// Filter for the run status. +func (r ApiActRunsLastRebootPostRequest) Status(status string) ApiActRunsLastRebootPostRequest { + r.status = &status + return r +} + +func (r ApiActRunsLastRebootPostRequest) Execute() (*RunResponse, *http.Response, error) { + return r.ApiService.ActRunsLastRebootPostExecute(r) +} + +/* +ActRunsLastRebootPost Reboot Actor's last run + +Reboots the last run of the specified Actor and returns an object that +contains all the details about the rebooted run. + +This endpoint is a shortcut for [Reboot run](#/reference/actor-runs/reboot-run/reboot-run) +on the Actor's last run. Only runs with status `RUNNING` can be rebooted. The run's +container will be restarted, so any data not persisted in the key-value store, dataset, +or request queue will be lost. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param actorId Actor ID or a tilde-separated owner's username and Actor name. + @return ApiActRunsLastRebootPostRequest +*/ +func (a *LastActorRunsRebootAPIService) ActRunsLastRebootPost(ctx context.Context, actorId string) ApiActRunsLastRebootPostRequest { + return ApiActRunsLastRebootPostRequest{ + ApiService: a, + ctx: ctx, + actorId: actorId, + } +} + +// Execute executes the request +// @return RunResponse +func (a *LastActorRunsRebootAPIService) ActRunsLastRebootPostExecute(r ApiActRunsLastRebootPostRequest) (*RunResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *RunResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LastActorRunsRebootAPIService.ActRunsLastRebootPost") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/actors/{actorId}/runs/last/reboot" + localVarPath = strings.Replace(localVarPath, "{"+"actorId"+"}", url.PathEscape(parameterValueToString(r.actorId, "actorId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.status != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "status", r.status, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/api_last_actor_task_runs_abort.go b/api_last_actor_task_runs_abort.go new file mode 100644 index 0000000..f59e1a0 --- /dev/null +++ b/api_last_actor_task_runs_abort.go @@ -0,0 +1,233 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" + "strings" +) + + +// LastActorTaskRunsAbortAPIService LastActorTaskRunsAbortAPI service +type LastActorTaskRunsAbortAPIService service + +type ApiActorTaskRunsLastAbortPostRequest struct { + ctx context.Context + ApiService *LastActorTaskRunsAbortAPIService + actorTaskId string + status *string + gracefully *bool +} + +// Filter for the run status. +func (r ApiActorTaskRunsLastAbortPostRequest) Status(status string) ApiActorTaskRunsLastAbortPostRequest { + r.status = &status + return r +} + +// If true passed, the Actor run will abort gracefully. It will send `aborting` and `persistState` event into run and force-stop the run after 30 seconds. It is helpful in cases where you plan to resurrect the run later. +func (r ApiActorTaskRunsLastAbortPostRequest) Gracefully(gracefully bool) ApiActorTaskRunsLastAbortPostRequest { + r.gracefully = &gracefully + return r +} + +func (r ApiActorTaskRunsLastAbortPostRequest) Execute() (*RunResponse, *http.Response, error) { + return r.ApiService.ActorTaskRunsLastAbortPostExecute(r) +} + +/* +ActorTaskRunsLastAbortPost Abort Actor task's last run + +Aborts the last run of the specified Actor task and returns an object that +contains all the details about the run. + +This endpoint is a shortcut for [Abort run](#/reference/actor-runs/abort-run/abort-run) +on the Actor task's last run. Only runs that are starting or running are aborted. +For runs with status `FINISHED`, `FAILED`, `ABORTING` and `TIMED-OUT` this call +does nothing. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param actorTaskId Task ID or a tilde-separated owner's username and task's name. + @return ApiActorTaskRunsLastAbortPostRequest +*/ +func (a *LastActorTaskRunsAbortAPIService) ActorTaskRunsLastAbortPost(ctx context.Context, actorTaskId string) ApiActorTaskRunsLastAbortPostRequest { + return ApiActorTaskRunsLastAbortPostRequest{ + ApiService: a, + ctx: ctx, + actorTaskId: actorTaskId, + } +} + +// Execute executes the request +// @return RunResponse +func (a *LastActorTaskRunsAbortAPIService) ActorTaskRunsLastAbortPostExecute(r ApiActorTaskRunsLastAbortPostRequest) (*RunResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *RunResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LastActorTaskRunsAbortAPIService.ActorTaskRunsLastAbortPost") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/actor-tasks/{actorTaskId}/runs/last/abort" + localVarPath = strings.Replace(localVarPath, "{"+"actorTaskId"+"}", url.PathEscape(parameterValueToString(r.actorTaskId, "actorTaskId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.status != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "status", r.status, "form", "") + } + if r.gracefully != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "gracefully", r.gracefully, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/api_last_actor_task_runs_default_dataset.go b/api_last_actor_task_runs_default_dataset.go new file mode 100644 index 0000000..63d7b8a --- /dev/null +++ b/api_last_actor_task_runs_default_dataset.go @@ -0,0 +1,1475 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" + "strings" +) + + +// LastActorTaskRunsDefaultDatasetAPIService LastActorTaskRunsDefaultDatasetAPI service +type LastActorTaskRunsDefaultDatasetAPIService service + +type ApiActorTaskRunsLastDatasetDeleteRequest struct { + ctx context.Context + ApiService *LastActorTaskRunsDefaultDatasetAPIService + actorTaskId string + status *string +} + +// Filter for the run status. +func (r ApiActorTaskRunsLastDatasetDeleteRequest) Status(status string) ApiActorTaskRunsLastDatasetDeleteRequest { + r.status = &status + return r +} + +func (r ApiActorTaskRunsLastDatasetDeleteRequest) Execute() (*http.Response, error) { + return r.ApiService.ActorTaskRunsLastDatasetDeleteExecute(r) +} + +/* +ActorTaskRunsLastDatasetDelete Delete last task run's default dataset + +Deletes the default dataset associated with the last Actor task run. + +This endpoint is a shortcut for getting the last task run's `defaultDatasetId` and then using the +[Delete dataset](/api/v2/dataset-delete) endpoint. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param actorTaskId Task ID or a tilde-separated owner's username and task's name. + @return ApiActorTaskRunsLastDatasetDeleteRequest +*/ +func (a *LastActorTaskRunsDefaultDatasetAPIService) ActorTaskRunsLastDatasetDelete(ctx context.Context, actorTaskId string) ApiActorTaskRunsLastDatasetDeleteRequest { + return ApiActorTaskRunsLastDatasetDeleteRequest{ + ApiService: a, + ctx: ctx, + actorTaskId: actorTaskId, + } +} + +// Execute executes the request +func (a *LastActorTaskRunsDefaultDatasetAPIService) ActorTaskRunsLastDatasetDeleteExecute(r ApiActorTaskRunsLastDatasetDeleteRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LastActorTaskRunsDefaultDatasetAPIService.ActorTaskRunsLastDatasetDelete") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/actor-tasks/{actorTaskId}/runs/last/dataset" + localVarPath = strings.Replace(localVarPath, "{"+"actorTaskId"+"}", url.PathEscape(parameterValueToString(r.actorTaskId, "actorTaskId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.status != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "status", r.status, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiActorTaskRunsLastDatasetGetRequest struct { + ctx context.Context + ApiService *LastActorTaskRunsDefaultDatasetAPIService + actorTaskId string + status *string +} + +// Filter for the run status. +func (r ApiActorTaskRunsLastDatasetGetRequest) Status(status string) ApiActorTaskRunsLastDatasetGetRequest { + r.status = &status + return r +} + +func (r ApiActorTaskRunsLastDatasetGetRequest) Execute() (*DatasetResponse, *http.Response, error) { + return r.ApiService.ActorTaskRunsLastDatasetGetExecute(r) +} + +/* +ActorTaskRunsLastDatasetGet Get last task run's default dataset + +Returns the default dataset associated with the last Actor task run. + +This endpoint is a shortcut for getting the last task run's `defaultDatasetId` and then using the +[Get dataset](/api/v2/dataset-get) endpoint. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param actorTaskId Task ID or a tilde-separated owner's username and task's name. + @return ApiActorTaskRunsLastDatasetGetRequest +*/ +func (a *LastActorTaskRunsDefaultDatasetAPIService) ActorTaskRunsLastDatasetGet(ctx context.Context, actorTaskId string) ApiActorTaskRunsLastDatasetGetRequest { + return ApiActorTaskRunsLastDatasetGetRequest{ + ApiService: a, + ctx: ctx, + actorTaskId: actorTaskId, + } +} + +// Execute executes the request +// @return DatasetResponse +func (a *LastActorTaskRunsDefaultDatasetAPIService) ActorTaskRunsLastDatasetGetExecute(r ApiActorTaskRunsLastDatasetGetRequest) (*DatasetResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *DatasetResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LastActorTaskRunsDefaultDatasetAPIService.ActorTaskRunsLastDatasetGet") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/actor-tasks/{actorTaskId}/runs/last/dataset" + localVarPath = strings.Replace(localVarPath, "{"+"actorTaskId"+"}", url.PathEscape(parameterValueToString(r.actorTaskId, "actorTaskId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.status != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "status", r.status, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiActorTaskRunsLastDatasetItemsGetRequest struct { + ctx context.Context + ApiService *LastActorTaskRunsDefaultDatasetAPIService + actorTaskId string + status *string + format *string + clean *bool + offset *float64 + limit *float64 + fields *string + outputFields *string + omit *string + unwind *string + flatten *string + desc *bool + attachment *bool + delimiter *string + bom *bool + xmlRoot *string + xmlRow *string + skipHeaderRow *bool + skipHidden *bool + skipEmpty *bool + simplified *bool + view *string + skipFailedPages *bool + feedTitle *string + feedDescription *string + signature *string +} + +// Filter for the run status. +func (r ApiActorTaskRunsLastDatasetItemsGetRequest) Status(status string) ApiActorTaskRunsLastDatasetItemsGetRequest { + r.status = &status + return r +} + +// Format of the results, possible values are: `json`, `jsonl`, `csv`, `html`, `xlsx`, `xml` and `rss`. The default value is `json`. +func (r ApiActorTaskRunsLastDatasetItemsGetRequest) Format(format string) ApiActorTaskRunsLastDatasetItemsGetRequest { + r.format = &format + return r +} + +// If `true` or `1` then the API endpoint returns only non-empty items and skips hidden fields (i.e. fields starting with the # character). The `clean` parameter is just a shortcut for `skipHidden=true` and `skipEmpty=true` parameters. Note that since some objects might be skipped from the output, that the result might contain less items than the `limit` value. +func (r ApiActorTaskRunsLastDatasetItemsGetRequest) Clean(clean bool) ApiActorTaskRunsLastDatasetItemsGetRequest { + r.clean = &clean + return r +} + +// Number of items that should be skipped at the start. The default value is `0`. +func (r ApiActorTaskRunsLastDatasetItemsGetRequest) Offset(offset float64) ApiActorTaskRunsLastDatasetItemsGetRequest { + r.offset = &offset + return r +} + +// Maximum number of items to return. By default there is no limit. +func (r ApiActorTaskRunsLastDatasetItemsGetRequest) Limit(limit float64) ApiActorTaskRunsLastDatasetItemsGetRequest { + r.limit = &limit + return r +} + +// A comma-separated list of fields which should be picked from the items, only these fields will remain in the resulting record objects. Note that the fields in the outputted items are sorted the same way as they are specified in the `fields` query parameter. You can use this feature to effectively fix the output format. +func (r ApiActorTaskRunsLastDatasetItemsGetRequest) Fields(fields string) ApiActorTaskRunsLastDatasetItemsGetRequest { + r.fields = &fields + return r +} + +// A comma-separated list of output field names that positionally rename the fields specified in the `fields` parameter. For example, `?fields=headline,url&outputFields=title,link` renames `headline` to `title` and `url` to `link` in the output. The number of names in `outputFields` must match the number of names in `fields`. Requires the `fields` parameter to be specified as well. +func (r ApiActorTaskRunsLastDatasetItemsGetRequest) OutputFields(outputFields string) ApiActorTaskRunsLastDatasetItemsGetRequest { + r.outputFields = &outputFields + return r +} + +// A comma-separated list of fields which should be omitted from the items. +func (r ApiActorTaskRunsLastDatasetItemsGetRequest) Omit(omit string) ApiActorTaskRunsLastDatasetItemsGetRequest { + r.omit = &omit + return r +} + +// A comma-separated list of fields which should be unwound, in order which they should be processed. Each field should be either an array or an object. If the field is an array then every element of the array will become a separate record and merged with parent object. If the unwound field is an object then it is merged with the parent object. If the unwound field is missing or its value is neither an array nor an object and therefore cannot be merged with a parent object then the item gets preserved as it is. Note that the unwound items ignore the `desc` parameter. +func (r ApiActorTaskRunsLastDatasetItemsGetRequest) Unwind(unwind string) ApiActorTaskRunsLastDatasetItemsGetRequest { + r.unwind = &unwind + return r +} + +// A comma-separated list of fields which should transform nested objects into flat structures. For example, with `flatten=\"foo\"` the object `{\"foo\":{\"bar\": \"hello\"}}` is turned into `{\"foo.bar\": \"hello\"}`. The original object with properties is replaced with the flattened object. +func (r ApiActorTaskRunsLastDatasetItemsGetRequest) Flatten(flatten string) ApiActorTaskRunsLastDatasetItemsGetRequest { + r.flatten = &flatten + return r +} + +// By default, results are returned in the same order as they were stored. To reverse the order, set this parameter to `true` or `1`. +func (r ApiActorTaskRunsLastDatasetItemsGetRequest) Desc(desc bool) ApiActorTaskRunsLastDatasetItemsGetRequest { + r.desc = &desc + return r +} + +// If `true` or `1` then the response will define the `Content-Disposition: attachment` header, forcing a web browser to download the file rather than to display it. By default this header is not present. +func (r ApiActorTaskRunsLastDatasetItemsGetRequest) Attachment(attachment bool) ApiActorTaskRunsLastDatasetItemsGetRequest { + r.attachment = &attachment + return r +} + +// A delimiter character for CSV files, only used if `format=csv`. You might need to URL-encode the character (e.g. use `%09` for tab or `%3B` for semicolon). The default delimiter is a simple comma (`,`). +func (r ApiActorTaskRunsLastDatasetItemsGetRequest) Delimiter(delimiter string) ApiActorTaskRunsLastDatasetItemsGetRequest { + r.delimiter = &delimiter + return r +} + +// All text responses are encoded in UTF-8 encoding. By default, the `format=csv` files are prefixed with the UTF-8 Byte Order Mark (BOM), while `json`, `jsonl`, `xml`, `html` and `rss` files are not. If you want to override this default behavior, specify `bom=1` query parameter to include the BOM or `bom=0` to skip it. +func (r ApiActorTaskRunsLastDatasetItemsGetRequest) Bom(bom bool) ApiActorTaskRunsLastDatasetItemsGetRequest { + r.bom = &bom + return r +} + +// Overrides default root element name of `xml` output. By default the root element is `items`. +func (r ApiActorTaskRunsLastDatasetItemsGetRequest) XmlRoot(xmlRoot string) ApiActorTaskRunsLastDatasetItemsGetRequest { + r.xmlRoot = &xmlRoot + return r +} + +// Overrides default element name that wraps each page or page function result object in `xml` output. By default the element name is `item`. +func (r ApiActorTaskRunsLastDatasetItemsGetRequest) XmlRow(xmlRow string) ApiActorTaskRunsLastDatasetItemsGetRequest { + r.xmlRow = &xmlRow + return r +} + +// If `true` or `1` then header row in the `csv` format is skipped. +func (r ApiActorTaskRunsLastDatasetItemsGetRequest) SkipHeaderRow(skipHeaderRow bool) ApiActorTaskRunsLastDatasetItemsGetRequest { + r.skipHeaderRow = &skipHeaderRow + return r +} + +// If `true` or `1` then hidden fields are skipped from the output, i.e. fields starting with the `#` character. +func (r ApiActorTaskRunsLastDatasetItemsGetRequest) SkipHidden(skipHidden bool) ApiActorTaskRunsLastDatasetItemsGetRequest { + r.skipHidden = &skipHidden + return r +} + +// If `true` or `1` then empty items are skipped from the output. Note that if used, the results might contain less items than the limit value. +func (r ApiActorTaskRunsLastDatasetItemsGetRequest) SkipEmpty(skipEmpty bool) ApiActorTaskRunsLastDatasetItemsGetRequest { + r.skipEmpty = &skipEmpty + return r +} + +// If `true` or `1` then, the endpoint applies the `fields=url,pageFunctionResult,errorInfo` and `unwind=pageFunctionResult` query parameters. This feature is used to emulate simplified results provided by the legacy Apify Crawler product and it's not recommended to use it in new integrations. +func (r ApiActorTaskRunsLastDatasetItemsGetRequest) Simplified(simplified bool) ApiActorTaskRunsLastDatasetItemsGetRequest { + r.simplified = &simplified + return r +} + +// Defines the view configuration for dataset items based on the schema definition. This parameter determines how the data will be filtered and presented. For complete specification details, see the [dataset schema documentation](/platform/actors/development/actor-definition/dataset-schema). +func (r ApiActorTaskRunsLastDatasetItemsGetRequest) View(view string) ApiActorTaskRunsLastDatasetItemsGetRequest { + r.view = &view + return r +} + +// If `true` or `1` then, the all the items with errorInfo property will be skipped from the output. This feature is here to emulate functionality of API version 1 used for the legacy Apify Crawler product and it's not recommended to use it in new integrations. +func (r ApiActorTaskRunsLastDatasetItemsGetRequest) SkipFailedPages(skipFailedPages bool) ApiActorTaskRunsLastDatasetItemsGetRequest { + r.skipFailedPages = &skipFailedPages + return r +} + +// Overrides the auto-generated RSS channel `<title>` element. Only used when `format=rss`. If not provided, the title defaults to `Dataset <label>`. +func (r ApiActorTaskRunsLastDatasetItemsGetRequest) FeedTitle(feedTitle string) ApiActorTaskRunsLastDatasetItemsGetRequest { + r.feedTitle = &feedTitle + return r +} + +// Overrides the auto-generated RSS channel `<description>` element. Only used when `format=rss`. If not provided, the description defaults to `Items in dataset with id \"<datasetId>\".` +func (r ApiActorTaskRunsLastDatasetItemsGetRequest) FeedDescription(feedDescription string) ApiActorTaskRunsLastDatasetItemsGetRequest { + r.feedDescription = &feedDescription + return r +} + +// Signature used for the access. +func (r ApiActorTaskRunsLastDatasetItemsGetRequest) Signature(signature string) ApiActorTaskRunsLastDatasetItemsGetRequest { + r.signature = &signature + return r +} + +func (r ApiActorTaskRunsLastDatasetItemsGetRequest) Execute() ([]map[string]interface{}, *http.Response, error) { + return r.ApiService.ActorTaskRunsLastDatasetItemsGetExecute(r) +} + +/* +ActorTaskRunsLastDatasetItemsGet Get last task run's dataset items + +Returns data stored in the default dataset of the last Actor task run in the desired format. + +This endpoint is a shortcut that resolves the last task run's `defaultDatasetId` and proxies to the +[Get dataset items](/api/v2/dataset-items-get) endpoint. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param actorTaskId Task ID or a tilde-separated owner's username and task's name. + @return ApiActorTaskRunsLastDatasetItemsGetRequest +*/ +func (a *LastActorTaskRunsDefaultDatasetAPIService) ActorTaskRunsLastDatasetItemsGet(ctx context.Context, actorTaskId string) ApiActorTaskRunsLastDatasetItemsGetRequest { + return ApiActorTaskRunsLastDatasetItemsGetRequest{ + ApiService: a, + ctx: ctx, + actorTaskId: actorTaskId, + } +} + +// Execute executes the request +// @return []map[string]interface{} +func (a *LastActorTaskRunsDefaultDatasetAPIService) ActorTaskRunsLastDatasetItemsGetExecute(r ApiActorTaskRunsLastDatasetItemsGetRequest) ([]map[string]interface{}, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []map[string]interface{} + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LastActorTaskRunsDefaultDatasetAPIService.ActorTaskRunsLastDatasetItemsGet") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/actor-tasks/{actorTaskId}/runs/last/dataset/items" + localVarPath = strings.Replace(localVarPath, "{"+"actorTaskId"+"}", url.PathEscape(parameterValueToString(r.actorTaskId, "actorTaskId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.status != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "status", r.status, "form", "") + } + if r.format != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "format", r.format, "form", "") + } + if r.clean != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "clean", r.clean, "form", "") + } + if r.offset != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "form", "") + } + if r.limit != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "form", "") + } + if r.fields != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "fields", r.fields, "form", "") + } + if r.outputFields != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "outputFields", r.outputFields, "form", "") + } + if r.omit != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "omit", r.omit, "form", "") + } + if r.unwind != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "unwind", r.unwind, "form", "") + } + if r.flatten != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "flatten", r.flatten, "form", "") + } + if r.desc != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "desc", r.desc, "form", "") + } + if r.attachment != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "attachment", r.attachment, "form", "") + } + if r.delimiter != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "delimiter", r.delimiter, "form", "") + } + if r.bom != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "bom", r.bom, "form", "") + } + if r.xmlRoot != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "xmlRoot", r.xmlRoot, "form", "") + } + if r.xmlRow != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "xmlRow", r.xmlRow, "form", "") + } + if r.skipHeaderRow != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "skipHeaderRow", r.skipHeaderRow, "form", "") + } + if r.skipHidden != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "skipHidden", r.skipHidden, "form", "") + } + if r.skipEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "skipEmpty", r.skipEmpty, "form", "") + } + if r.simplified != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "simplified", r.simplified, "form", "") + } + if r.view != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "view", r.view, "form", "") + } + if r.skipFailedPages != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "skipFailedPages", r.skipFailedPages, "form", "") + } + if r.feedTitle != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "feedTitle", r.feedTitle, "form", "") + } + if r.feedDescription != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "feedDescription", r.feedDescription, "form", "") + } + if r.signature != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "signature", r.signature, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json", "application/jsonl", "text/csv", "text/html", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", "application/rss+xml", "application/xml"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiActorTaskRunsLastDatasetItemsPostRequest struct { + ctx context.Context + ApiService *LastActorTaskRunsDefaultDatasetAPIService + actorTaskId string + actRunsLastDatasetItemsPostRequest *ActRunsLastDatasetItemsPostRequest + status *string +} + +// +func (r ApiActorTaskRunsLastDatasetItemsPostRequest) ActRunsLastDatasetItemsPostRequest(actRunsLastDatasetItemsPostRequest ActRunsLastDatasetItemsPostRequest) ApiActorTaskRunsLastDatasetItemsPostRequest { + r.actRunsLastDatasetItemsPostRequest = &actRunsLastDatasetItemsPostRequest + return r +} + +// Filter for the run status. +func (r ApiActorTaskRunsLastDatasetItemsPostRequest) Status(status string) ApiActorTaskRunsLastDatasetItemsPostRequest { + r.status = &status + return r +} + +func (r ApiActorTaskRunsLastDatasetItemsPostRequest) Execute() (map[string]interface{}, *http.Response, error) { + return r.ApiService.ActorTaskRunsLastDatasetItemsPostExecute(r) +} + +/* +ActorTaskRunsLastDatasetItemsPost Store items in last task run's dataset + +Appends an item or an array of items to the end of the last Actor task run's default dataset. + +This endpoint is a shortcut that resolves the last task run's `defaultDatasetId` and proxies to the +[Store items](/api/v2/dataset-items-post) endpoint. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param actorTaskId Task ID or a tilde-separated owner's username and task's name. + @return ApiActorTaskRunsLastDatasetItemsPostRequest +*/ +func (a *LastActorTaskRunsDefaultDatasetAPIService) ActorTaskRunsLastDatasetItemsPost(ctx context.Context, actorTaskId string) ApiActorTaskRunsLastDatasetItemsPostRequest { + return ApiActorTaskRunsLastDatasetItemsPostRequest{ + ApiService: a, + ctx: ctx, + actorTaskId: actorTaskId, + } +} + +// Execute executes the request +// @return map[string]interface{} +func (a *LastActorTaskRunsDefaultDatasetAPIService) ActorTaskRunsLastDatasetItemsPostExecute(r ApiActorTaskRunsLastDatasetItemsPostRequest) (map[string]interface{}, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue map[string]interface{} + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LastActorTaskRunsDefaultDatasetAPIService.ActorTaskRunsLastDatasetItemsPost") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/actor-tasks/{actorTaskId}/runs/last/dataset/items" + localVarPath = strings.Replace(localVarPath, "{"+"actorTaskId"+"}", url.PathEscape(parameterValueToString(r.actorTaskId, "actorTaskId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.actRunsLastDatasetItemsPostRequest == nil { + return localVarReturnValue, nil, reportError("actRunsLastDatasetItemsPostRequest is required and must be specified") + } + + if r.status != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "status", r.status, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.actRunsLastDatasetItemsPostRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ActRunsLastDatasetItemsPost400Response + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiActorTaskRunsLastDatasetPutRequest struct { + ctx context.Context + ApiService *LastActorTaskRunsDefaultDatasetAPIService + actorTaskId string + updateDatasetRequest *UpdateDatasetRequest + status *string +} + +// +func (r ApiActorTaskRunsLastDatasetPutRequest) UpdateDatasetRequest(updateDatasetRequest UpdateDatasetRequest) ApiActorTaskRunsLastDatasetPutRequest { + r.updateDatasetRequest = &updateDatasetRequest + return r +} + +// Filter for the run status. +func (r ApiActorTaskRunsLastDatasetPutRequest) Status(status string) ApiActorTaskRunsLastDatasetPutRequest { + r.status = &status + return r +} + +func (r ApiActorTaskRunsLastDatasetPutRequest) Execute() (*DatasetResponse, *http.Response, error) { + return r.ApiService.ActorTaskRunsLastDatasetPutExecute(r) +} + +/* +ActorTaskRunsLastDatasetPut Update last task run's default dataset + +Updates the default dataset associated with the last Actor task run. + +This endpoint is a shortcut for getting the last task run's `defaultDatasetId` and then using the +[Update dataset](/api/v2/dataset-put) endpoint. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param actorTaskId Task ID or a tilde-separated owner's username and task's name. + @return ApiActorTaskRunsLastDatasetPutRequest +*/ +func (a *LastActorTaskRunsDefaultDatasetAPIService) ActorTaskRunsLastDatasetPut(ctx context.Context, actorTaskId string) ApiActorTaskRunsLastDatasetPutRequest { + return ApiActorTaskRunsLastDatasetPutRequest{ + ApiService: a, + ctx: ctx, + actorTaskId: actorTaskId, + } +} + +// Execute executes the request +// @return DatasetResponse +func (a *LastActorTaskRunsDefaultDatasetAPIService) ActorTaskRunsLastDatasetPutExecute(r ApiActorTaskRunsLastDatasetPutRequest) (*DatasetResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *DatasetResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LastActorTaskRunsDefaultDatasetAPIService.ActorTaskRunsLastDatasetPut") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/actor-tasks/{actorTaskId}/runs/last/dataset" + localVarPath = strings.Replace(localVarPath, "{"+"actorTaskId"+"}", url.PathEscape(parameterValueToString(r.actorTaskId, "actorTaskId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.updateDatasetRequest == nil { + return localVarReturnValue, nil, reportError("updateDatasetRequest is required and must be specified") + } + + if r.status != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "status", r.status, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.updateDatasetRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 413 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 415 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiActorTaskRunsLastDatasetStatisticsGetRequest struct { + ctx context.Context + ApiService *LastActorTaskRunsDefaultDatasetAPIService + actorTaskId string + status *string +} + +// Filter for the run status. +func (r ApiActorTaskRunsLastDatasetStatisticsGetRequest) Status(status string) ApiActorTaskRunsLastDatasetStatisticsGetRequest { + r.status = &status + return r +} + +func (r ApiActorTaskRunsLastDatasetStatisticsGetRequest) Execute() (*DatasetStatisticsResponse, *http.Response, error) { + return r.ApiService.ActorTaskRunsLastDatasetStatisticsGetExecute(r) +} + +/* +ActorTaskRunsLastDatasetStatisticsGet Get last task run's dataset statistics + +Returns statistics for the last Actor task run's default dataset. + +This endpoint is a shortcut that resolves the last task run's `defaultDatasetId` and proxies to the +[Get dataset statistics](/api/v2/dataset-statistics-get) endpoint. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param actorTaskId Task ID or a tilde-separated owner's username and task's name. + @return ApiActorTaskRunsLastDatasetStatisticsGetRequest +*/ +func (a *LastActorTaskRunsDefaultDatasetAPIService) ActorTaskRunsLastDatasetStatisticsGet(ctx context.Context, actorTaskId string) ApiActorTaskRunsLastDatasetStatisticsGetRequest { + return ApiActorTaskRunsLastDatasetStatisticsGetRequest{ + ApiService: a, + ctx: ctx, + actorTaskId: actorTaskId, + } +} + +// Execute executes the request +// @return DatasetStatisticsResponse +func (a *LastActorTaskRunsDefaultDatasetAPIService) ActorTaskRunsLastDatasetStatisticsGetExecute(r ApiActorTaskRunsLastDatasetStatisticsGetRequest) (*DatasetStatisticsResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *DatasetStatisticsResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LastActorTaskRunsDefaultDatasetAPIService.ActorTaskRunsLastDatasetStatisticsGet") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/actor-tasks/{actorTaskId}/runs/last/dataset/statistics" + localVarPath = strings.Replace(localVarPath, "{"+"actorTaskId"+"}", url.PathEscape(parameterValueToString(r.actorTaskId, "actorTaskId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.status != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "status", r.status, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/api_last_actor_task_runs_default_key_value_store.go b/api_last_actor_task_runs_default_key_value_store.go new file mode 100644 index 0000000..7c73c7a --- /dev/null +++ b/api_last_actor_task_runs_default_key_value_store.go @@ -0,0 +1,2009 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" + "strings" + "os" +) + + +// LastActorTaskRunsDefaultKeyValueStoreAPIService LastActorTaskRunsDefaultKeyValueStoreAPI service +type LastActorTaskRunsDefaultKeyValueStoreAPIService service + +type ApiActorTaskRunsLastKeyValueStoreDeleteRequest struct { + ctx context.Context + ApiService *LastActorTaskRunsDefaultKeyValueStoreAPIService + actorTaskId string + status *string +} + +// Filter for the run status. +func (r ApiActorTaskRunsLastKeyValueStoreDeleteRequest) Status(status string) ApiActorTaskRunsLastKeyValueStoreDeleteRequest { + r.status = &status + return r +} + +func (r ApiActorTaskRunsLastKeyValueStoreDeleteRequest) Execute() (*http.Response, error) { + return r.ApiService.ActorTaskRunsLastKeyValueStoreDeleteExecute(r) +} + +/* +ActorTaskRunsLastKeyValueStoreDelete Delete last task run's default store + +Deletes the default key-value store of the last Actor task run. + +This endpoint is a shortcut for getting the last task run's `defaultKeyValueStoreId` and then using the +[Delete store](/api/v2/key-value-store-delete) endpoint. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param actorTaskId Task ID or a tilde-separated owner's username and task's name. + @return ApiActorTaskRunsLastKeyValueStoreDeleteRequest +*/ +func (a *LastActorTaskRunsDefaultKeyValueStoreAPIService) ActorTaskRunsLastKeyValueStoreDelete(ctx context.Context, actorTaskId string) ApiActorTaskRunsLastKeyValueStoreDeleteRequest { + return ApiActorTaskRunsLastKeyValueStoreDeleteRequest{ + ApiService: a, + ctx: ctx, + actorTaskId: actorTaskId, + } +} + +// Execute executes the request +func (a *LastActorTaskRunsDefaultKeyValueStoreAPIService) ActorTaskRunsLastKeyValueStoreDeleteExecute(r ApiActorTaskRunsLastKeyValueStoreDeleteRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LastActorTaskRunsDefaultKeyValueStoreAPIService.ActorTaskRunsLastKeyValueStoreDelete") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/actor-tasks/{actorTaskId}/runs/last/key-value-store" + localVarPath = strings.Replace(localVarPath, "{"+"actorTaskId"+"}", url.PathEscape(parameterValueToString(r.actorTaskId, "actorTaskId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.status != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "status", r.status, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiActorTaskRunsLastKeyValueStoreGetRequest struct { + ctx context.Context + ApiService *LastActorTaskRunsDefaultKeyValueStoreAPIService + actorTaskId string + status *string +} + +// Filter for the run status. +func (r ApiActorTaskRunsLastKeyValueStoreGetRequest) Status(status string) ApiActorTaskRunsLastKeyValueStoreGetRequest { + r.status = &status + return r +} + +func (r ApiActorTaskRunsLastKeyValueStoreGetRequest) Execute() (*KeyValueStoreResponse, *http.Response, error) { + return r.ApiService.ActorTaskRunsLastKeyValueStoreGetExecute(r) +} + +/* +ActorTaskRunsLastKeyValueStoreGet Get last task run's default store + +Gets an object that contains all the details about the default key-value store of the last Actor task run. + +This endpoint is a shortcut for getting the last task run's `defaultKeyValueStoreId` and then using the +[Get store](/api/v2/key-value-store-get) endpoint. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param actorTaskId Task ID or a tilde-separated owner's username and task's name. + @return ApiActorTaskRunsLastKeyValueStoreGetRequest +*/ +func (a *LastActorTaskRunsDefaultKeyValueStoreAPIService) ActorTaskRunsLastKeyValueStoreGet(ctx context.Context, actorTaskId string) ApiActorTaskRunsLastKeyValueStoreGetRequest { + return ApiActorTaskRunsLastKeyValueStoreGetRequest{ + ApiService: a, + ctx: ctx, + actorTaskId: actorTaskId, + } +} + +// Execute executes the request +// @return KeyValueStoreResponse +func (a *LastActorTaskRunsDefaultKeyValueStoreAPIService) ActorTaskRunsLastKeyValueStoreGetExecute(r ApiActorTaskRunsLastKeyValueStoreGetRequest) (*KeyValueStoreResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *KeyValueStoreResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LastActorTaskRunsDefaultKeyValueStoreAPIService.ActorTaskRunsLastKeyValueStoreGet") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/actor-tasks/{actorTaskId}/runs/last/key-value-store" + localVarPath = strings.Replace(localVarPath, "{"+"actorTaskId"+"}", url.PathEscape(parameterValueToString(r.actorTaskId, "actorTaskId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.status != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "status", r.status, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiActorTaskRunsLastKeyValueStoreKeysGetRequest struct { + ctx context.Context + ApiService *LastActorTaskRunsDefaultKeyValueStoreAPIService + actorTaskId string + status *string + exclusiveStartKey *string + limit *float32 + collection *string + prefix *string + signature *string +} + +// Filter for the run status. +func (r ApiActorTaskRunsLastKeyValueStoreKeysGetRequest) Status(status string) ApiActorTaskRunsLastKeyValueStoreKeysGetRequest { + r.status = &status + return r +} + +// All keys up to this one (including) are skipped from the result. +func (r ApiActorTaskRunsLastKeyValueStoreKeysGetRequest) ExclusiveStartKey(exclusiveStartKey string) ApiActorTaskRunsLastKeyValueStoreKeysGetRequest { + r.exclusiveStartKey = &exclusiveStartKey + return r +} + +// Number of keys to be returned. +func (r ApiActorTaskRunsLastKeyValueStoreKeysGetRequest) Limit(limit float32) ApiActorTaskRunsLastKeyValueStoreKeysGetRequest { + r.limit = &limit + return r +} + +// Limit the results to keys that belong to a specific collection from the key-value store schema. The key-value store need to have a schema defined for this parameter to work. +func (r ApiActorTaskRunsLastKeyValueStoreKeysGetRequest) Collection(collection string) ApiActorTaskRunsLastKeyValueStoreKeysGetRequest { + r.collection = &collection + return r +} + +// Limit the results to keys that start with a specific prefix. +func (r ApiActorTaskRunsLastKeyValueStoreKeysGetRequest) Prefix(prefix string) ApiActorTaskRunsLastKeyValueStoreKeysGetRequest { + r.prefix = &prefix + return r +} + +// Signature used for the access. +func (r ApiActorTaskRunsLastKeyValueStoreKeysGetRequest) Signature(signature string) ApiActorTaskRunsLastKeyValueStoreKeysGetRequest { + r.signature = &signature + return r +} + +func (r ApiActorTaskRunsLastKeyValueStoreKeysGetRequest) Execute() (*ListOfKeysResponse, *http.Response, error) { + return r.ApiService.ActorTaskRunsLastKeyValueStoreKeysGetExecute(r) +} + +/* +ActorTaskRunsLastKeyValueStoreKeysGet Get last task run's default store's list of keys + +Returns a list of keys for the default key-value store of the last Actor task run. + +This endpoint is a shortcut for getting the last task run's `defaultKeyValueStoreId` and then using the +[Get list of keys](/api/v2/key-value-store-keys-get) endpoint. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param actorTaskId Task ID or a tilde-separated owner's username and task's name. + @return ApiActorTaskRunsLastKeyValueStoreKeysGetRequest +*/ +func (a *LastActorTaskRunsDefaultKeyValueStoreAPIService) ActorTaskRunsLastKeyValueStoreKeysGet(ctx context.Context, actorTaskId string) ApiActorTaskRunsLastKeyValueStoreKeysGetRequest { + return ApiActorTaskRunsLastKeyValueStoreKeysGetRequest{ + ApiService: a, + ctx: ctx, + actorTaskId: actorTaskId, + } +} + +// Execute executes the request +// @return ListOfKeysResponse +func (a *LastActorTaskRunsDefaultKeyValueStoreAPIService) ActorTaskRunsLastKeyValueStoreKeysGetExecute(r ApiActorTaskRunsLastKeyValueStoreKeysGetRequest) (*ListOfKeysResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ListOfKeysResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LastActorTaskRunsDefaultKeyValueStoreAPIService.ActorTaskRunsLastKeyValueStoreKeysGet") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/actor-tasks/{actorTaskId}/runs/last/key-value-store/keys" + localVarPath = strings.Replace(localVarPath, "{"+"actorTaskId"+"}", url.PathEscape(parameterValueToString(r.actorTaskId, "actorTaskId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.status != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "status", r.status, "form", "") + } + if r.exclusiveStartKey != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "exclusiveStartKey", r.exclusiveStartKey, "form", "") + } + if r.limit != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "form", "") + } else { + var defaultValue float32 = 1000 + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", defaultValue, "form", "") + r.limit = &defaultValue + } + if r.collection != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "collection", r.collection, "form", "") + } + if r.prefix != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "prefix", r.prefix, "form", "") + } + if r.signature != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "signature", r.signature, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiActorTaskRunsLastKeyValueStorePutRequest struct { + ctx context.Context + ApiService *LastActorTaskRunsDefaultKeyValueStoreAPIService + actorTaskId string + updateStoreRequest *UpdateStoreRequest + status *string +} + +// +func (r ApiActorTaskRunsLastKeyValueStorePutRequest) UpdateStoreRequest(updateStoreRequest UpdateStoreRequest) ApiActorTaskRunsLastKeyValueStorePutRequest { + r.updateStoreRequest = &updateStoreRequest + return r +} + +// Filter for the run status. +func (r ApiActorTaskRunsLastKeyValueStorePutRequest) Status(status string) ApiActorTaskRunsLastKeyValueStorePutRequest { + r.status = &status + return r +} + +func (r ApiActorTaskRunsLastKeyValueStorePutRequest) Execute() (*KeyValueStoreResponse, *http.Response, error) { + return r.ApiService.ActorTaskRunsLastKeyValueStorePutExecute(r) +} + +/* +ActorTaskRunsLastKeyValueStorePut Update last task run's default store + +Updates the default key-value store associated with the last Actor task run. + +This endpoint is a shortcut for getting the last task run's `defaultKeyValueStoreId` and then using the +[Update store](/api/v2/key-value-store-put) endpoint. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param actorTaskId Task ID or a tilde-separated owner's username and task's name. + @return ApiActorTaskRunsLastKeyValueStorePutRequest +*/ +func (a *LastActorTaskRunsDefaultKeyValueStoreAPIService) ActorTaskRunsLastKeyValueStorePut(ctx context.Context, actorTaskId string) ApiActorTaskRunsLastKeyValueStorePutRequest { + return ApiActorTaskRunsLastKeyValueStorePutRequest{ + ApiService: a, + ctx: ctx, + actorTaskId: actorTaskId, + } +} + +// Execute executes the request +// @return KeyValueStoreResponse +func (a *LastActorTaskRunsDefaultKeyValueStoreAPIService) ActorTaskRunsLastKeyValueStorePutExecute(r ApiActorTaskRunsLastKeyValueStorePutRequest) (*KeyValueStoreResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *KeyValueStoreResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LastActorTaskRunsDefaultKeyValueStoreAPIService.ActorTaskRunsLastKeyValueStorePut") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/actor-tasks/{actorTaskId}/runs/last/key-value-store" + localVarPath = strings.Replace(localVarPath, "{"+"actorTaskId"+"}", url.PathEscape(parameterValueToString(r.actorTaskId, "actorTaskId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.updateStoreRequest == nil { + return localVarReturnValue, nil, reportError("updateStoreRequest is required and must be specified") + } + + if r.status != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "status", r.status, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.updateStoreRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 413 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 415 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiActorTaskRunsLastKeyValueStoreRecordDeleteRequest struct { + ctx context.Context + ApiService *LastActorTaskRunsDefaultKeyValueStoreAPIService + actorTaskId string + recordKey string + status *string +} + +// Filter for the run status. +func (r ApiActorTaskRunsLastKeyValueStoreRecordDeleteRequest) Status(status string) ApiActorTaskRunsLastKeyValueStoreRecordDeleteRequest { + r.status = &status + return r +} + +func (r ApiActorTaskRunsLastKeyValueStoreRecordDeleteRequest) Execute() (*http.Response, error) { + return r.ApiService.ActorTaskRunsLastKeyValueStoreRecordDeleteExecute(r) +} + +/* +ActorTaskRunsLastKeyValueStoreRecordDelete Delete last task run's default store's record + +Removes a record specified by a key from the default key-value store of the last Actor task run. + +This endpoint is a shortcut for getting the last task run's `defaultKeyValueStoreId` and then using the +[Delete record](/api/v2/key-value-store-record-delete) endpoint. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param actorTaskId Task ID or a tilde-separated owner's username and task's name. + @param recordKey Key of the record. + @return ApiActorTaskRunsLastKeyValueStoreRecordDeleteRequest +*/ +func (a *LastActorTaskRunsDefaultKeyValueStoreAPIService) ActorTaskRunsLastKeyValueStoreRecordDelete(ctx context.Context, actorTaskId string, recordKey string) ApiActorTaskRunsLastKeyValueStoreRecordDeleteRequest { + return ApiActorTaskRunsLastKeyValueStoreRecordDeleteRequest{ + ApiService: a, + ctx: ctx, + actorTaskId: actorTaskId, + recordKey: recordKey, + } +} + +// Execute executes the request +func (a *LastActorTaskRunsDefaultKeyValueStoreAPIService) ActorTaskRunsLastKeyValueStoreRecordDeleteExecute(r ApiActorTaskRunsLastKeyValueStoreRecordDeleteRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LastActorTaskRunsDefaultKeyValueStoreAPIService.ActorTaskRunsLastKeyValueStoreRecordDelete") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/actor-tasks/{actorTaskId}/runs/last/key-value-store/records/{recordKey}" + localVarPath = strings.Replace(localVarPath, "{"+"actorTaskId"+"}", url.PathEscape(parameterValueToString(r.actorTaskId, "actorTaskId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"recordKey"+"}", url.PathEscape(parameterValueToString(r.recordKey, "recordKey")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.status != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "status", r.status, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiActorTaskRunsLastKeyValueStoreRecordGetRequest struct { + ctx context.Context + ApiService *LastActorTaskRunsDefaultKeyValueStoreAPIService + actorTaskId string + recordKey string + status *string + signature *string + attachment *bool +} + +// Filter for the run status. +func (r ApiActorTaskRunsLastKeyValueStoreRecordGetRequest) Status(status string) ApiActorTaskRunsLastKeyValueStoreRecordGetRequest { + r.status = &status + return r +} + +// Signature used for the access. +func (r ApiActorTaskRunsLastKeyValueStoreRecordGetRequest) Signature(signature string) ApiActorTaskRunsLastKeyValueStoreRecordGetRequest { + r.signature = &signature + return r +} + +// If `true` or `1`, the response will be served with `Content-Disposition: attachment` header, causing web browsers to offer downloading HTML records instead of displaying them. +func (r ApiActorTaskRunsLastKeyValueStoreRecordGetRequest) Attachment(attachment bool) ApiActorTaskRunsLastKeyValueStoreRecordGetRequest { + r.attachment = &attachment + return r +} + +func (r ApiActorTaskRunsLastKeyValueStoreRecordGetRequest) Execute() (map[string]interface{}, *http.Response, error) { + return r.ApiService.ActorTaskRunsLastKeyValueStoreRecordGetExecute(r) +} + +/* +ActorTaskRunsLastKeyValueStoreRecordGet Get last task run's default store's record + +Gets a value stored under a specific key in the default key-value store of the last Actor task run. + +This endpoint is a shortcut for getting the last task run's `defaultKeyValueStoreId` and then using the +[Get record](/api/v2/key-value-store-record-get) endpoint. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param actorTaskId Task ID or a tilde-separated owner's username and task's name. + @param recordKey Key of the record. + @return ApiActorTaskRunsLastKeyValueStoreRecordGetRequest +*/ +func (a *LastActorTaskRunsDefaultKeyValueStoreAPIService) ActorTaskRunsLastKeyValueStoreRecordGet(ctx context.Context, actorTaskId string, recordKey string) ApiActorTaskRunsLastKeyValueStoreRecordGetRequest { + return ApiActorTaskRunsLastKeyValueStoreRecordGetRequest{ + ApiService: a, + ctx: ctx, + actorTaskId: actorTaskId, + recordKey: recordKey, + } +} + +// Execute executes the request +// @return map[string]interface{} +func (a *LastActorTaskRunsDefaultKeyValueStoreAPIService) ActorTaskRunsLastKeyValueStoreRecordGetExecute(r ApiActorTaskRunsLastKeyValueStoreRecordGetRequest) (map[string]interface{}, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue map[string]interface{} + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LastActorTaskRunsDefaultKeyValueStoreAPIService.ActorTaskRunsLastKeyValueStoreRecordGet") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/actor-tasks/{actorTaskId}/runs/last/key-value-store/records/{recordKey}" + localVarPath = strings.Replace(localVarPath, "{"+"actorTaskId"+"}", url.PathEscape(parameterValueToString(r.actorTaskId, "actorTaskId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"recordKey"+"}", url.PathEscape(parameterValueToString(r.recordKey, "recordKey")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.status != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "status", r.status, "form", "") + } + if r.signature != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "signature", r.signature, "form", "") + } + if r.attachment != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "attachment", r.attachment, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json", "*/*"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiActorTaskRunsLastKeyValueStoreRecordPostRequest struct { + ctx context.Context + ApiService *LastActorTaskRunsDefaultKeyValueStoreAPIService + actorTaskId string + recordKey string + requestBody *map[string]interface{} + status *string + contentEncoding *string +} + +// +func (r ApiActorTaskRunsLastKeyValueStoreRecordPostRequest) RequestBody(requestBody map[string]interface{}) ApiActorTaskRunsLastKeyValueStoreRecordPostRequest { + r.requestBody = &requestBody + return r +} + +// Filter for the run status. +func (r ApiActorTaskRunsLastKeyValueStoreRecordPostRequest) Status(status string) ApiActorTaskRunsLastKeyValueStoreRecordPostRequest { + r.status = &status + return r +} + +// +func (r ApiActorTaskRunsLastKeyValueStoreRecordPostRequest) ContentEncoding(contentEncoding string) ApiActorTaskRunsLastKeyValueStoreRecordPostRequest { + r.contentEncoding = &contentEncoding + return r +} + +func (r ApiActorTaskRunsLastKeyValueStoreRecordPostRequest) Execute() (map[string]interface{}, *http.Response, error) { + return r.ApiService.ActorTaskRunsLastKeyValueStoreRecordPostExecute(r) +} + +/* +ActorTaskRunsLastKeyValueStoreRecordPost Store record in last task run's default store (POST) + +Stores a value under a specific key in the default key-value store of the last Actor task run. + +This endpoint is a shortcut for getting the last task run's `defaultKeyValueStoreId` and then using the +[Store record](/api/v2/key-value-store-record-post) endpoint. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param actorTaskId Task ID or a tilde-separated owner's username and task's name. + @param recordKey Key of the record. + @return ApiActorTaskRunsLastKeyValueStoreRecordPostRequest +*/ +func (a *LastActorTaskRunsDefaultKeyValueStoreAPIService) ActorTaskRunsLastKeyValueStoreRecordPost(ctx context.Context, actorTaskId string, recordKey string) ApiActorTaskRunsLastKeyValueStoreRecordPostRequest { + return ApiActorTaskRunsLastKeyValueStoreRecordPostRequest{ + ApiService: a, + ctx: ctx, + actorTaskId: actorTaskId, + recordKey: recordKey, + } +} + +// Execute executes the request +// @return map[string]interface{} +func (a *LastActorTaskRunsDefaultKeyValueStoreAPIService) ActorTaskRunsLastKeyValueStoreRecordPostExecute(r ApiActorTaskRunsLastKeyValueStoreRecordPostRequest) (map[string]interface{}, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue map[string]interface{} + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LastActorTaskRunsDefaultKeyValueStoreAPIService.ActorTaskRunsLastKeyValueStoreRecordPost") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/actor-tasks/{actorTaskId}/runs/last/key-value-store/records/{recordKey}" + localVarPath = strings.Replace(localVarPath, "{"+"actorTaskId"+"}", url.PathEscape(parameterValueToString(r.actorTaskId, "actorTaskId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"recordKey"+"}", url.PathEscape(parameterValueToString(r.recordKey, "recordKey")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.requestBody == nil { + return localVarReturnValue, nil, reportError("requestBody is required and must be specified") + } + + if r.status != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "status", r.status, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.contentEncoding != nil { + parameterAddToHeaderOrQuery(localVarHeaderParams, "Content-Encoding", r.contentEncoding, "simple", "") + } + // body params + localVarPostBody = r.requestBody + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 413 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 415 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiActorTaskRunsLastKeyValueStoreRecordPutRequest struct { + ctx context.Context + ApiService *LastActorTaskRunsDefaultKeyValueStoreAPIService + actorTaskId string + recordKey string + requestBody *map[string]interface{} + status *string + contentEncoding *string +} + +// +func (r ApiActorTaskRunsLastKeyValueStoreRecordPutRequest) RequestBody(requestBody map[string]interface{}) ApiActorTaskRunsLastKeyValueStoreRecordPutRequest { + r.requestBody = &requestBody + return r +} + +// Filter for the run status. +func (r ApiActorTaskRunsLastKeyValueStoreRecordPutRequest) Status(status string) ApiActorTaskRunsLastKeyValueStoreRecordPutRequest { + r.status = &status + return r +} + +// +func (r ApiActorTaskRunsLastKeyValueStoreRecordPutRequest) ContentEncoding(contentEncoding string) ApiActorTaskRunsLastKeyValueStoreRecordPutRequest { + r.contentEncoding = &contentEncoding + return r +} + +func (r ApiActorTaskRunsLastKeyValueStoreRecordPutRequest) Execute() (map[string]interface{}, *http.Response, error) { + return r.ApiService.ActorTaskRunsLastKeyValueStoreRecordPutExecute(r) +} + +/* +ActorTaskRunsLastKeyValueStoreRecordPut Store record in last task run's default store + +Stores a value under a specific key in the default key-value store of the last Actor task run. + +This endpoint is a shortcut for getting the last task run's `defaultKeyValueStoreId` and then using the +[Store record](/api/v2/key-value-store-record-put) endpoint. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param actorTaskId Task ID or a tilde-separated owner's username and task's name. + @param recordKey Key of the record. + @return ApiActorTaskRunsLastKeyValueStoreRecordPutRequest +*/ +func (a *LastActorTaskRunsDefaultKeyValueStoreAPIService) ActorTaskRunsLastKeyValueStoreRecordPut(ctx context.Context, actorTaskId string, recordKey string) ApiActorTaskRunsLastKeyValueStoreRecordPutRequest { + return ApiActorTaskRunsLastKeyValueStoreRecordPutRequest{ + ApiService: a, + ctx: ctx, + actorTaskId: actorTaskId, + recordKey: recordKey, + } +} + +// Execute executes the request +// @return map[string]interface{} +func (a *LastActorTaskRunsDefaultKeyValueStoreAPIService) ActorTaskRunsLastKeyValueStoreRecordPutExecute(r ApiActorTaskRunsLastKeyValueStoreRecordPutRequest) (map[string]interface{}, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue map[string]interface{} + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LastActorTaskRunsDefaultKeyValueStoreAPIService.ActorTaskRunsLastKeyValueStoreRecordPut") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/actor-tasks/{actorTaskId}/runs/last/key-value-store/records/{recordKey}" + localVarPath = strings.Replace(localVarPath, "{"+"actorTaskId"+"}", url.PathEscape(parameterValueToString(r.actorTaskId, "actorTaskId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"recordKey"+"}", url.PathEscape(parameterValueToString(r.recordKey, "recordKey")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.requestBody == nil { + return localVarReturnValue, nil, reportError("requestBody is required and must be specified") + } + + if r.status != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "status", r.status, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.contentEncoding != nil { + parameterAddToHeaderOrQuery(localVarHeaderParams, "Content-Encoding", r.contentEncoding, "simple", "") + } + // body params + localVarPostBody = r.requestBody + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 413 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 415 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiActorTaskRunsLastKeyValueStoreRecordsGetRequest struct { + ctx context.Context + ApiService *LastActorTaskRunsDefaultKeyValueStoreAPIService + actorTaskId string + status *string + collection *string + prefix *string + signature *string +} + +// Filter for the run status. +func (r ApiActorTaskRunsLastKeyValueStoreRecordsGetRequest) Status(status string) ApiActorTaskRunsLastKeyValueStoreRecordsGetRequest { + r.status = &status + return r +} + +// If specified, only records belonging to a specific collection from the key-value store schema. The key-value store need to have a schema defined for this parameter to work. +func (r ApiActorTaskRunsLastKeyValueStoreRecordsGetRequest) Collection(collection string) ApiActorTaskRunsLastKeyValueStoreRecordsGetRequest { + r.collection = &collection + return r +} + +// If specified, only records whose key starts with the given prefix are included in the archive. +func (r ApiActorTaskRunsLastKeyValueStoreRecordsGetRequest) Prefix(prefix string) ApiActorTaskRunsLastKeyValueStoreRecordsGetRequest { + r.prefix = &prefix + return r +} + +// Signature used for the access. +func (r ApiActorTaskRunsLastKeyValueStoreRecordsGetRequest) Signature(signature string) ApiActorTaskRunsLastKeyValueStoreRecordsGetRequest { + r.signature = &signature + return r +} + +func (r ApiActorTaskRunsLastKeyValueStoreRecordsGetRequest) Execute() (*os.File, *http.Response, error) { + return r.ApiService.ActorTaskRunsLastKeyValueStoreRecordsGetExecute(r) +} + +/* +ActorTaskRunsLastKeyValueStoreRecordsGet Download last task run's default store's records + +Downloads all records from the default key-value store of the last Actor task run as a ZIP archive. + +This endpoint is a shortcut for getting the last task run's `defaultKeyValueStoreId` and then using the +[Download records](/api/v2/key-value-store-records-get) endpoint. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param actorTaskId Task ID or a tilde-separated owner's username and task's name. + @return ApiActorTaskRunsLastKeyValueStoreRecordsGetRequest +*/ +func (a *LastActorTaskRunsDefaultKeyValueStoreAPIService) ActorTaskRunsLastKeyValueStoreRecordsGet(ctx context.Context, actorTaskId string) ApiActorTaskRunsLastKeyValueStoreRecordsGetRequest { + return ApiActorTaskRunsLastKeyValueStoreRecordsGetRequest{ + ApiService: a, + ctx: ctx, + actorTaskId: actorTaskId, + } +} + +// Execute executes the request +// @return *os.File +func (a *LastActorTaskRunsDefaultKeyValueStoreAPIService) ActorTaskRunsLastKeyValueStoreRecordsGetExecute(r ApiActorTaskRunsLastKeyValueStoreRecordsGetRequest) (*os.File, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *os.File + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LastActorTaskRunsDefaultKeyValueStoreAPIService.ActorTaskRunsLastKeyValueStoreRecordsGet") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/actor-tasks/{actorTaskId}/runs/last/key-value-store/records" + localVarPath = strings.Replace(localVarPath, "{"+"actorTaskId"+"}", url.PathEscape(parameterValueToString(r.actorTaskId, "actorTaskId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.status != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "status", r.status, "form", "") + } + if r.collection != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "collection", r.collection, "form", "") + } + if r.prefix != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "prefix", r.prefix, "form", "") + } + if r.signature != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "signature", r.signature, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/zip", "application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/api_last_actor_task_runs_default_request_queue.go b/api_last_actor_task_runs_default_request_queue.go new file mode 100644 index 0000000..64360e9 --- /dev/null +++ b/api_last_actor_task_runs_default_request_queue.go @@ -0,0 +1,3376 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" + "strings" +) + + +// LastActorTaskRunsDefaultRequestQueueAPIService LastActorTaskRunsDefaultRequestQueueAPI service +type LastActorTaskRunsDefaultRequestQueueAPIService service + +type ApiActorTaskRunsLastRequestQueueDeleteRequest struct { + ctx context.Context + ApiService *LastActorTaskRunsDefaultRequestQueueAPIService + actorTaskId string + status *string +} + +// Filter for the run status. +func (r ApiActorTaskRunsLastRequestQueueDeleteRequest) Status(status string) ApiActorTaskRunsLastRequestQueueDeleteRequest { + r.status = &status + return r +} + +func (r ApiActorTaskRunsLastRequestQueueDeleteRequest) Execute() (*http.Response, error) { + return r.ApiService.ActorTaskRunsLastRequestQueueDeleteExecute(r) +} + +/* +ActorTaskRunsLastRequestQueueDelete Delete last task run's default request queue + +Deletes the default request queue associated with the last Actor task run. + +This endpoint is a shortcut for getting the last task run's `defaultRequestQueueId` and then using the +[Delete request queue](/api/v2/request-queue-delete) endpoint. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param actorTaskId Task ID or a tilde-separated owner's username and task's name. + @return ApiActorTaskRunsLastRequestQueueDeleteRequest +*/ +func (a *LastActorTaskRunsDefaultRequestQueueAPIService) ActorTaskRunsLastRequestQueueDelete(ctx context.Context, actorTaskId string) ApiActorTaskRunsLastRequestQueueDeleteRequest { + return ApiActorTaskRunsLastRequestQueueDeleteRequest{ + ApiService: a, + ctx: ctx, + actorTaskId: actorTaskId, + } +} + +// Execute executes the request +func (a *LastActorTaskRunsDefaultRequestQueueAPIService) ActorTaskRunsLastRequestQueueDeleteExecute(r ApiActorTaskRunsLastRequestQueueDeleteRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LastActorTaskRunsDefaultRequestQueueAPIService.ActorTaskRunsLastRequestQueueDelete") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/actor-tasks/{actorTaskId}/runs/last/request-queue" + localVarPath = strings.Replace(localVarPath, "{"+"actorTaskId"+"}", url.PathEscape(parameterValueToString(r.actorTaskId, "actorTaskId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.status != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "status", r.status, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiActorTaskRunsLastRequestQueueGetRequest struct { + ctx context.Context + ApiService *LastActorTaskRunsDefaultRequestQueueAPIService + actorTaskId string + status *string +} + +// Filter for the run status. +func (r ApiActorTaskRunsLastRequestQueueGetRequest) Status(status string) ApiActorTaskRunsLastRequestQueueGetRequest { + r.status = &status + return r +} + +func (r ApiActorTaskRunsLastRequestQueueGetRequest) Execute() (*RequestQueueResponse, *http.Response, error) { + return r.ApiService.ActorTaskRunsLastRequestQueueGetExecute(r) +} + +/* +ActorTaskRunsLastRequestQueueGet Get last task run's default request queue + +Returns the default request queue associated with the last Actor task run. + +This endpoint is a shortcut for getting the last task run's `defaultRequestQueueId` and then using the +[Get request queue](/api/v2/request-queue-get) endpoint. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param actorTaskId Task ID or a tilde-separated owner's username and task's name. + @return ApiActorTaskRunsLastRequestQueueGetRequest +*/ +func (a *LastActorTaskRunsDefaultRequestQueueAPIService) ActorTaskRunsLastRequestQueueGet(ctx context.Context, actorTaskId string) ApiActorTaskRunsLastRequestQueueGetRequest { + return ApiActorTaskRunsLastRequestQueueGetRequest{ + ApiService: a, + ctx: ctx, + actorTaskId: actorTaskId, + } +} + +// Execute executes the request +// @return RequestQueueResponse +func (a *LastActorTaskRunsDefaultRequestQueueAPIService) ActorTaskRunsLastRequestQueueGetExecute(r ApiActorTaskRunsLastRequestQueueGetRequest) (*RequestQueueResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *RequestQueueResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LastActorTaskRunsDefaultRequestQueueAPIService.ActorTaskRunsLastRequestQueueGet") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/actor-tasks/{actorTaskId}/runs/last/request-queue" + localVarPath = strings.Replace(localVarPath, "{"+"actorTaskId"+"}", url.PathEscape(parameterValueToString(r.actorTaskId, "actorTaskId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.status != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "status", r.status, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiActorTaskRunsLastRequestQueueHeadGetRequest struct { + ctx context.Context + ApiService *LastActorTaskRunsDefaultRequestQueueAPIService + actorTaskId string + status *string + limit *float64 + clientKey *string +} + +// Filter for the run status. +func (r ApiActorTaskRunsLastRequestQueueHeadGetRequest) Status(status string) ApiActorTaskRunsLastRequestQueueHeadGetRequest { + r.status = &status + return r +} + +// How many items from queue should be returned. +func (r ApiActorTaskRunsLastRequestQueueHeadGetRequest) Limit(limit float64) ApiActorTaskRunsLastRequestQueueHeadGetRequest { + r.limit = &limit + return r +} + +// A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. +func (r ApiActorTaskRunsLastRequestQueueHeadGetRequest) ClientKey(clientKey string) ApiActorTaskRunsLastRequestQueueHeadGetRequest { + r.clientKey = &clientKey + return r +} + +func (r ApiActorTaskRunsLastRequestQueueHeadGetRequest) Execute() (*HeadResponse, *http.Response, error) { + return r.ApiService.ActorTaskRunsLastRequestQueueHeadGetExecute(r) +} + +/* +ActorTaskRunsLastRequestQueueHeadGet Get last task run's default request queue head + +Returns the given number of first requests from the default request queue of the last Actor task run. + +This endpoint is a shortcut for getting the last task run's `defaultRequestQueueId` and then using the +[Get head](/api/v2/request-queue-head-get) endpoint. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param actorTaskId Task ID or a tilde-separated owner's username and task's name. + @return ApiActorTaskRunsLastRequestQueueHeadGetRequest +*/ +func (a *LastActorTaskRunsDefaultRequestQueueAPIService) ActorTaskRunsLastRequestQueueHeadGet(ctx context.Context, actorTaskId string) ApiActorTaskRunsLastRequestQueueHeadGetRequest { + return ApiActorTaskRunsLastRequestQueueHeadGetRequest{ + ApiService: a, + ctx: ctx, + actorTaskId: actorTaskId, + } +} + +// Execute executes the request +// @return HeadResponse +func (a *LastActorTaskRunsDefaultRequestQueueAPIService) ActorTaskRunsLastRequestQueueHeadGetExecute(r ApiActorTaskRunsLastRequestQueueHeadGetRequest) (*HeadResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *HeadResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LastActorTaskRunsDefaultRequestQueueAPIService.ActorTaskRunsLastRequestQueueHeadGet") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/actor-tasks/{actorTaskId}/runs/last/request-queue/head" + localVarPath = strings.Replace(localVarPath, "{"+"actorTaskId"+"}", url.PathEscape(parameterValueToString(r.actorTaskId, "actorTaskId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.status != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "status", r.status, "form", "") + } + if r.limit != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "form", "") + } + if r.clientKey != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "clientKey", r.clientKey, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiActorTaskRunsLastRequestQueueHeadLockPostRequest struct { + ctx context.Context + ApiService *LastActorTaskRunsDefaultRequestQueueAPIService + actorTaskId string + lockSecs *float64 + status *string + limit *float64 + clientKey *string +} + +// How long the requests will be locked for (in seconds). +func (r ApiActorTaskRunsLastRequestQueueHeadLockPostRequest) LockSecs(lockSecs float64) ApiActorTaskRunsLastRequestQueueHeadLockPostRequest { + r.lockSecs = &lockSecs + return r +} + +// Filter for the run status. +func (r ApiActorTaskRunsLastRequestQueueHeadLockPostRequest) Status(status string) ApiActorTaskRunsLastRequestQueueHeadLockPostRequest { + r.status = &status + return r +} + +// How many items from the queue should be returned. +func (r ApiActorTaskRunsLastRequestQueueHeadLockPostRequest) Limit(limit float64) ApiActorTaskRunsLastRequestQueueHeadLockPostRequest { + r.limit = &limit + return r +} + +// A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. +func (r ApiActorTaskRunsLastRequestQueueHeadLockPostRequest) ClientKey(clientKey string) ApiActorTaskRunsLastRequestQueueHeadLockPostRequest { + r.clientKey = &clientKey + return r +} + +func (r ApiActorTaskRunsLastRequestQueueHeadLockPostRequest) Execute() (*HeadAndLockResponse, *http.Response, error) { + return r.ApiService.ActorTaskRunsLastRequestQueueHeadLockPostExecute(r) +} + +/* +ActorTaskRunsLastRequestQueueHeadLockPost Get and lock last task run's default request queue head + +Returns the given number of first requests from the default request queue of the last Actor task run +and locks them for the given time. + +This endpoint is a shortcut for getting the last task run's `defaultRequestQueueId` and then using the +[Get head and lock](/api/v2/request-queue-head-lock-post) endpoint. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param actorTaskId Task ID or a tilde-separated owner's username and task's name. + @return ApiActorTaskRunsLastRequestQueueHeadLockPostRequest +*/ +func (a *LastActorTaskRunsDefaultRequestQueueAPIService) ActorTaskRunsLastRequestQueueHeadLockPost(ctx context.Context, actorTaskId string) ApiActorTaskRunsLastRequestQueueHeadLockPostRequest { + return ApiActorTaskRunsLastRequestQueueHeadLockPostRequest{ + ApiService: a, + ctx: ctx, + actorTaskId: actorTaskId, + } +} + +// Execute executes the request +// @return HeadAndLockResponse +func (a *LastActorTaskRunsDefaultRequestQueueAPIService) ActorTaskRunsLastRequestQueueHeadLockPostExecute(r ApiActorTaskRunsLastRequestQueueHeadLockPostRequest) (*HeadAndLockResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *HeadAndLockResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LastActorTaskRunsDefaultRequestQueueAPIService.ActorTaskRunsLastRequestQueueHeadLockPost") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/actor-tasks/{actorTaskId}/runs/last/request-queue/head/lock" + localVarPath = strings.Replace(localVarPath, "{"+"actorTaskId"+"}", url.PathEscape(parameterValueToString(r.actorTaskId, "actorTaskId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.lockSecs == nil { + return localVarReturnValue, nil, reportError("lockSecs is required and must be specified") + } + + if r.status != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "status", r.status, "form", "") + } + parameterAddToHeaderOrQuery(localVarQueryParams, "lockSecs", r.lockSecs, "form", "") + if r.limit != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "form", "") + } + if r.clientKey != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "clientKey", r.clientKey, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiActorTaskRunsLastRequestQueuePutRequest struct { + ctx context.Context + ApiService *LastActorTaskRunsDefaultRequestQueueAPIService + actorTaskId string + updateRequestQueueRequest *UpdateRequestQueueRequest + status *string +} + +// +func (r ApiActorTaskRunsLastRequestQueuePutRequest) UpdateRequestQueueRequest(updateRequestQueueRequest UpdateRequestQueueRequest) ApiActorTaskRunsLastRequestQueuePutRequest { + r.updateRequestQueueRequest = &updateRequestQueueRequest + return r +} + +// Filter for the run status. +func (r ApiActorTaskRunsLastRequestQueuePutRequest) Status(status string) ApiActorTaskRunsLastRequestQueuePutRequest { + r.status = &status + return r +} + +func (r ApiActorTaskRunsLastRequestQueuePutRequest) Execute() (*RequestQueueResponse, *http.Response, error) { + return r.ApiService.ActorTaskRunsLastRequestQueuePutExecute(r) +} + +/* +ActorTaskRunsLastRequestQueuePut Update last task run's default request queue + +Updates the default request queue associated with the last Actor task run. + +This endpoint is a shortcut for getting the last task run's `defaultRequestQueueId` and then using the +[Update request queue](/api/v2/request-queue-put) endpoint. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param actorTaskId Task ID or a tilde-separated owner's username and task's name. + @return ApiActorTaskRunsLastRequestQueuePutRequest +*/ +func (a *LastActorTaskRunsDefaultRequestQueueAPIService) ActorTaskRunsLastRequestQueuePut(ctx context.Context, actorTaskId string) ApiActorTaskRunsLastRequestQueuePutRequest { + return ApiActorTaskRunsLastRequestQueuePutRequest{ + ApiService: a, + ctx: ctx, + actorTaskId: actorTaskId, + } +} + +// Execute executes the request +// @return RequestQueueResponse +func (a *LastActorTaskRunsDefaultRequestQueueAPIService) ActorTaskRunsLastRequestQueuePutExecute(r ApiActorTaskRunsLastRequestQueuePutRequest) (*RequestQueueResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *RequestQueueResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LastActorTaskRunsDefaultRequestQueueAPIService.ActorTaskRunsLastRequestQueuePut") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/actor-tasks/{actorTaskId}/runs/last/request-queue" + localVarPath = strings.Replace(localVarPath, "{"+"actorTaskId"+"}", url.PathEscape(parameterValueToString(r.actorTaskId, "actorTaskId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.updateRequestQueueRequest == nil { + return localVarReturnValue, nil, reportError("updateRequestQueueRequest is required and must be specified") + } + + if r.status != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "status", r.status, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.updateRequestQueueRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 413 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 415 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiActorTaskRunsLastRequestQueueRequestDeleteRequest struct { + ctx context.Context + ApiService *LastActorTaskRunsDefaultRequestQueueAPIService + actorTaskId string + requestId string + status *string + clientKey *string +} + +// Filter for the run status. +func (r ApiActorTaskRunsLastRequestQueueRequestDeleteRequest) Status(status string) ApiActorTaskRunsLastRequestQueueRequestDeleteRequest { + r.status = &status + return r +} + +// A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. +func (r ApiActorTaskRunsLastRequestQueueRequestDeleteRequest) ClientKey(clientKey string) ApiActorTaskRunsLastRequestQueueRequestDeleteRequest { + r.clientKey = &clientKey + return r +} + +func (r ApiActorTaskRunsLastRequestQueueRequestDeleteRequest) Execute() (*http.Response, error) { + return r.ApiService.ActorTaskRunsLastRequestQueueRequestDeleteExecute(r) +} + +/* +ActorTaskRunsLastRequestQueueRequestDelete Delete request from last task run's default request queue + +Deletes a request from the default request queue of the last Actor task run. + +This endpoint is a shortcut for getting the last task run's `defaultRequestQueueId` and then using the +[Delete request](/api/v2/request-queue-request-delete) endpoint. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param actorTaskId Task ID or a tilde-separated owner's username and task's name. + @param requestId Request ID. + @return ApiActorTaskRunsLastRequestQueueRequestDeleteRequest +*/ +func (a *LastActorTaskRunsDefaultRequestQueueAPIService) ActorTaskRunsLastRequestQueueRequestDelete(ctx context.Context, actorTaskId string, requestId string) ApiActorTaskRunsLastRequestQueueRequestDeleteRequest { + return ApiActorTaskRunsLastRequestQueueRequestDeleteRequest{ + ApiService: a, + ctx: ctx, + actorTaskId: actorTaskId, + requestId: requestId, + } +} + +// Execute executes the request +func (a *LastActorTaskRunsDefaultRequestQueueAPIService) ActorTaskRunsLastRequestQueueRequestDeleteExecute(r ApiActorTaskRunsLastRequestQueueRequestDeleteRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LastActorTaskRunsDefaultRequestQueueAPIService.ActorTaskRunsLastRequestQueueRequestDelete") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/actor-tasks/{actorTaskId}/runs/last/request-queue/requests/{requestId}" + localVarPath = strings.Replace(localVarPath, "{"+"actorTaskId"+"}", url.PathEscape(parameterValueToString(r.actorTaskId, "actorTaskId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"requestId"+"}", url.PathEscape(parameterValueToString(r.requestId, "requestId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.status != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "status", r.status, "form", "") + } + if r.clientKey != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "clientKey", r.clientKey, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiActorTaskRunsLastRequestQueueRequestGetRequest struct { + ctx context.Context + ApiService *LastActorTaskRunsDefaultRequestQueueAPIService + actorTaskId string + requestId string + status *string +} + +// Filter for the run status. +func (r ApiActorTaskRunsLastRequestQueueRequestGetRequest) Status(status string) ApiActorTaskRunsLastRequestQueueRequestGetRequest { + r.status = &status + return r +} + +func (r ApiActorTaskRunsLastRequestQueueRequestGetRequest) Execute() (*RequestResponse, *http.Response, error) { + return r.ApiService.ActorTaskRunsLastRequestQueueRequestGetExecute(r) +} + +/* +ActorTaskRunsLastRequestQueueRequestGet Get request from last task run's default request queue + +Returns a request from the default request queue of the last Actor task run. + +This endpoint is a shortcut for getting the last task run's `defaultRequestQueueId` and then using the +[Get request](/api/v2/request-queue-request-get) endpoint. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param actorTaskId Task ID or a tilde-separated owner's username and task's name. + @param requestId Request ID. + @return ApiActorTaskRunsLastRequestQueueRequestGetRequest +*/ +func (a *LastActorTaskRunsDefaultRequestQueueAPIService) ActorTaskRunsLastRequestQueueRequestGet(ctx context.Context, actorTaskId string, requestId string) ApiActorTaskRunsLastRequestQueueRequestGetRequest { + return ApiActorTaskRunsLastRequestQueueRequestGetRequest{ + ApiService: a, + ctx: ctx, + actorTaskId: actorTaskId, + requestId: requestId, + } +} + +// Execute executes the request +// @return RequestResponse +func (a *LastActorTaskRunsDefaultRequestQueueAPIService) ActorTaskRunsLastRequestQueueRequestGetExecute(r ApiActorTaskRunsLastRequestQueueRequestGetRequest) (*RequestResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *RequestResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LastActorTaskRunsDefaultRequestQueueAPIService.ActorTaskRunsLastRequestQueueRequestGet") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/actor-tasks/{actorTaskId}/runs/last/request-queue/requests/{requestId}" + localVarPath = strings.Replace(localVarPath, "{"+"actorTaskId"+"}", url.PathEscape(parameterValueToString(r.actorTaskId, "actorTaskId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"requestId"+"}", url.PathEscape(parameterValueToString(r.requestId, "requestId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.status != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "status", r.status, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiActorTaskRunsLastRequestQueueRequestLockDeleteRequest struct { + ctx context.Context + ApiService *LastActorTaskRunsDefaultRequestQueueAPIService + actorTaskId string + requestId string + status *string + clientKey *string + forefront *string +} + +// Filter for the run status. +func (r ApiActorTaskRunsLastRequestQueueRequestLockDeleteRequest) Status(status string) ApiActorTaskRunsLastRequestQueueRequestLockDeleteRequest { + r.status = &status + return r +} + +// A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. +func (r ApiActorTaskRunsLastRequestQueueRequestLockDeleteRequest) ClientKey(clientKey string) ApiActorTaskRunsLastRequestQueueRequestLockDeleteRequest { + r.clientKey = &clientKey + return r +} + +// Determines if request should be added to the head of the queue or to the end after lock was removed. +func (r ApiActorTaskRunsLastRequestQueueRequestLockDeleteRequest) Forefront(forefront string) ApiActorTaskRunsLastRequestQueueRequestLockDeleteRequest { + r.forefront = &forefront + return r +} + +func (r ApiActorTaskRunsLastRequestQueueRequestLockDeleteRequest) Execute() (*http.Response, error) { + return r.ApiService.ActorTaskRunsLastRequestQueueRequestLockDeleteExecute(r) +} + +/* +ActorTaskRunsLastRequestQueueRequestLockDelete Delete lock on request in last task run's default request queue + +Deletes a request lock in the default request queue of the last Actor task run. + +This endpoint is a shortcut for getting the last task run's `defaultRequestQueueId` and then using the +[Delete request lock](/api/v2/request-queue-request-lock-delete) endpoint. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param actorTaskId Task ID or a tilde-separated owner's username and task's name. + @param requestId Request ID. + @return ApiActorTaskRunsLastRequestQueueRequestLockDeleteRequest +*/ +func (a *LastActorTaskRunsDefaultRequestQueueAPIService) ActorTaskRunsLastRequestQueueRequestLockDelete(ctx context.Context, actorTaskId string, requestId string) ApiActorTaskRunsLastRequestQueueRequestLockDeleteRequest { + return ApiActorTaskRunsLastRequestQueueRequestLockDeleteRequest{ + ApiService: a, + ctx: ctx, + actorTaskId: actorTaskId, + requestId: requestId, + } +} + +// Execute executes the request +func (a *LastActorTaskRunsDefaultRequestQueueAPIService) ActorTaskRunsLastRequestQueueRequestLockDeleteExecute(r ApiActorTaskRunsLastRequestQueueRequestLockDeleteRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LastActorTaskRunsDefaultRequestQueueAPIService.ActorTaskRunsLastRequestQueueRequestLockDelete") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/actor-tasks/{actorTaskId}/runs/last/request-queue/requests/{requestId}/lock" + localVarPath = strings.Replace(localVarPath, "{"+"actorTaskId"+"}", url.PathEscape(parameterValueToString(r.actorTaskId, "actorTaskId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"requestId"+"}", url.PathEscape(parameterValueToString(r.requestId, "requestId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.status != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "status", r.status, "form", "") + } + if r.clientKey != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "clientKey", r.clientKey, "form", "") + } + if r.forefront != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "forefront", r.forefront, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiActorTaskRunsLastRequestQueueRequestLockPutRequest struct { + ctx context.Context + ApiService *LastActorTaskRunsDefaultRequestQueueAPIService + actorTaskId string + requestId string + lockSecs *float64 + status *string + clientKey *string + forefront *string +} + +// How long the requests will be locked for (in seconds). +func (r ApiActorTaskRunsLastRequestQueueRequestLockPutRequest) LockSecs(lockSecs float64) ApiActorTaskRunsLastRequestQueueRequestLockPutRequest { + r.lockSecs = &lockSecs + return r +} + +// Filter for the run status. +func (r ApiActorTaskRunsLastRequestQueueRequestLockPutRequest) Status(status string) ApiActorTaskRunsLastRequestQueueRequestLockPutRequest { + r.status = &status + return r +} + +// A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. +func (r ApiActorTaskRunsLastRequestQueueRequestLockPutRequest) ClientKey(clientKey string) ApiActorTaskRunsLastRequestQueueRequestLockPutRequest { + r.clientKey = &clientKey + return r +} + +// Determines if request should be added to the head of the queue or to the end after lock expires. +func (r ApiActorTaskRunsLastRequestQueueRequestLockPutRequest) Forefront(forefront string) ApiActorTaskRunsLastRequestQueueRequestLockPutRequest { + r.forefront = &forefront + return r +} + +func (r ApiActorTaskRunsLastRequestQueueRequestLockPutRequest) Execute() (*ProlongRequestLockResponse, *http.Response, error) { + return r.ApiService.ActorTaskRunsLastRequestQueueRequestLockPutExecute(r) +} + +/* +ActorTaskRunsLastRequestQueueRequestLockPut Prolong lock on request in last task run's default request queue + +Prolongs a request lock in the default request queue of the last Actor task run. + +This endpoint is a shortcut for getting the last task run's `defaultRequestQueueId` and then using the +[Prolong request lock](/api/v2/request-queue-request-lock-put) endpoint. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param actorTaskId Task ID or a tilde-separated owner's username and task's name. + @param requestId Request ID. + @return ApiActorTaskRunsLastRequestQueueRequestLockPutRequest +*/ +func (a *LastActorTaskRunsDefaultRequestQueueAPIService) ActorTaskRunsLastRequestQueueRequestLockPut(ctx context.Context, actorTaskId string, requestId string) ApiActorTaskRunsLastRequestQueueRequestLockPutRequest { + return ApiActorTaskRunsLastRequestQueueRequestLockPutRequest{ + ApiService: a, + ctx: ctx, + actorTaskId: actorTaskId, + requestId: requestId, + } +} + +// Execute executes the request +// @return ProlongRequestLockResponse +func (a *LastActorTaskRunsDefaultRequestQueueAPIService) ActorTaskRunsLastRequestQueueRequestLockPutExecute(r ApiActorTaskRunsLastRequestQueueRequestLockPutRequest) (*ProlongRequestLockResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ProlongRequestLockResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LastActorTaskRunsDefaultRequestQueueAPIService.ActorTaskRunsLastRequestQueueRequestLockPut") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/actor-tasks/{actorTaskId}/runs/last/request-queue/requests/{requestId}/lock" + localVarPath = strings.Replace(localVarPath, "{"+"actorTaskId"+"}", url.PathEscape(parameterValueToString(r.actorTaskId, "actorTaskId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"requestId"+"}", url.PathEscape(parameterValueToString(r.requestId, "requestId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.lockSecs == nil { + return localVarReturnValue, nil, reportError("lockSecs is required and must be specified") + } + + if r.status != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "status", r.status, "form", "") + } + parameterAddToHeaderOrQuery(localVarQueryParams, "lockSecs", r.lockSecs, "form", "") + if r.clientKey != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "clientKey", r.clientKey, "form", "") + } + if r.forefront != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "forefront", r.forefront, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiActorTaskRunsLastRequestQueueRequestPutRequest struct { + ctx context.Context + ApiService *LastActorTaskRunsDefaultRequestQueueAPIService + actorTaskId string + requestId string + request *Request + status *string + forefront *string + clientKey *string +} + +// +func (r ApiActorTaskRunsLastRequestQueueRequestPutRequest) Request(request Request) ApiActorTaskRunsLastRequestQueueRequestPutRequest { + r.request = &request + return r +} + +// Filter for the run status. +func (r ApiActorTaskRunsLastRequestQueueRequestPutRequest) Status(status string) ApiActorTaskRunsLastRequestQueueRequestPutRequest { + r.status = &status + return r +} + +// Determines if request should be added to the head of the queue or to the end. Default value is `false` (end of queue). +func (r ApiActorTaskRunsLastRequestQueueRequestPutRequest) Forefront(forefront string) ApiActorTaskRunsLastRequestQueueRequestPutRequest { + r.forefront = &forefront + return r +} + +// A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. +func (r ApiActorTaskRunsLastRequestQueueRequestPutRequest) ClientKey(clientKey string) ApiActorTaskRunsLastRequestQueueRequestPutRequest { + r.clientKey = &clientKey + return r +} + +func (r ApiActorTaskRunsLastRequestQueueRequestPutRequest) Execute() (*UpdateRequestResponse, *http.Response, error) { + return r.ApiService.ActorTaskRunsLastRequestQueueRequestPutExecute(r) +} + +/* +ActorTaskRunsLastRequestQueueRequestPut Update request in last task run's default request queue + +Updates a request in the default request queue of the last Actor task run. + +This endpoint is a shortcut for getting the last task run's `defaultRequestQueueId` and then using the +[Update request](/api/v2/request-queue-request-put) endpoint. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param actorTaskId Task ID or a tilde-separated owner's username and task's name. + @param requestId Request ID. + @return ApiActorTaskRunsLastRequestQueueRequestPutRequest +*/ +func (a *LastActorTaskRunsDefaultRequestQueueAPIService) ActorTaskRunsLastRequestQueueRequestPut(ctx context.Context, actorTaskId string, requestId string) ApiActorTaskRunsLastRequestQueueRequestPutRequest { + return ApiActorTaskRunsLastRequestQueueRequestPutRequest{ + ApiService: a, + ctx: ctx, + actorTaskId: actorTaskId, + requestId: requestId, + } +} + +// Execute executes the request +// @return UpdateRequestResponse +func (a *LastActorTaskRunsDefaultRequestQueueAPIService) ActorTaskRunsLastRequestQueueRequestPutExecute(r ApiActorTaskRunsLastRequestQueueRequestPutRequest) (*UpdateRequestResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *UpdateRequestResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LastActorTaskRunsDefaultRequestQueueAPIService.ActorTaskRunsLastRequestQueueRequestPut") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/actor-tasks/{actorTaskId}/runs/last/request-queue/requests/{requestId}" + localVarPath = strings.Replace(localVarPath, "{"+"actorTaskId"+"}", url.PathEscape(parameterValueToString(r.actorTaskId, "actorTaskId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"requestId"+"}", url.PathEscape(parameterValueToString(r.requestId, "requestId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.request == nil { + return localVarReturnValue, nil, reportError("request is required and must be specified") + } + + if r.status != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "status", r.status, "form", "") + } + if r.forefront != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "forefront", r.forefront, "form", "") + } + if r.clientKey != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "clientKey", r.clientKey, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.request + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 413 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 415 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiActorTaskRunsLastRequestQueueRequestsBatchDeleteRequest struct { + ctx context.Context + ApiService *LastActorTaskRunsDefaultRequestQueueAPIService + actorTaskId string + contentType *string + requestDraftDelete *[]RequestDraftDelete + status *string + clientKey *string +} + +// +func (r ApiActorTaskRunsLastRequestQueueRequestsBatchDeleteRequest) ContentType(contentType string) ApiActorTaskRunsLastRequestQueueRequestsBatchDeleteRequest { + r.contentType = &contentType + return r +} + +// +func (r ApiActorTaskRunsLastRequestQueueRequestsBatchDeleteRequest) RequestDraftDelete(requestDraftDelete []RequestDraftDelete) ApiActorTaskRunsLastRequestQueueRequestsBatchDeleteRequest { + r.requestDraftDelete = &requestDraftDelete + return r +} + +// Filter for the run status. +func (r ApiActorTaskRunsLastRequestQueueRequestsBatchDeleteRequest) Status(status string) ApiActorTaskRunsLastRequestQueueRequestsBatchDeleteRequest { + r.status = &status + return r +} + +// A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. +func (r ApiActorTaskRunsLastRequestQueueRequestsBatchDeleteRequest) ClientKey(clientKey string) ApiActorTaskRunsLastRequestQueueRequestsBatchDeleteRequest { + r.clientKey = &clientKey + return r +} + +func (r ApiActorTaskRunsLastRequestQueueRequestsBatchDeleteRequest) Execute() (*BatchDeleteResponse, *http.Response, error) { + return r.ApiService.ActorTaskRunsLastRequestQueueRequestsBatchDeleteExecute(r) +} + +/* +ActorTaskRunsLastRequestQueueRequestsBatchDelete Batch delete requests from last task run's default request queue + +Batch-deletes requests from the default request queue of the last Actor task run. + +This endpoint is a shortcut for getting the last task run's `defaultRequestQueueId` and then using the +[Delete requests](/api/v2/request-queue-requests-batch-delete) endpoint. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param actorTaskId Task ID or a tilde-separated owner's username and task's name. + @return ApiActorTaskRunsLastRequestQueueRequestsBatchDeleteRequest +*/ +func (a *LastActorTaskRunsDefaultRequestQueueAPIService) ActorTaskRunsLastRequestQueueRequestsBatchDelete(ctx context.Context, actorTaskId string) ApiActorTaskRunsLastRequestQueueRequestsBatchDeleteRequest { + return ApiActorTaskRunsLastRequestQueueRequestsBatchDeleteRequest{ + ApiService: a, + ctx: ctx, + actorTaskId: actorTaskId, + } +} + +// Execute executes the request +// @return BatchDeleteResponse +func (a *LastActorTaskRunsDefaultRequestQueueAPIService) ActorTaskRunsLastRequestQueueRequestsBatchDeleteExecute(r ApiActorTaskRunsLastRequestQueueRequestsBatchDeleteRequest) (*BatchDeleteResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *BatchDeleteResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LastActorTaskRunsDefaultRequestQueueAPIService.ActorTaskRunsLastRequestQueueRequestsBatchDelete") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/actor-tasks/{actorTaskId}/runs/last/request-queue/requests/batch" + localVarPath = strings.Replace(localVarPath, "{"+"actorTaskId"+"}", url.PathEscape(parameterValueToString(r.actorTaskId, "actorTaskId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.contentType == nil { + return localVarReturnValue, nil, reportError("contentType is required and must be specified") + } + if r.requestDraftDelete == nil { + return localVarReturnValue, nil, reportError("requestDraftDelete is required and must be specified") + } + + if r.status != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "status", r.status, "form", "") + } + if r.clientKey != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "clientKey", r.clientKey, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + parameterAddToHeaderOrQuery(localVarHeaderParams, "Content-Type", r.contentType, "simple", "") + // body params + localVarPostBody = r.requestDraftDelete + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 413 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 415 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiActorTaskRunsLastRequestQueueRequestsBatchPostRequest struct { + ctx context.Context + ApiService *LastActorTaskRunsDefaultRequestQueueAPIService + actorTaskId string + requestBase *[]RequestBase + status *string + clientKey *string + forefront *string +} + +// +func (r ApiActorTaskRunsLastRequestQueueRequestsBatchPostRequest) RequestBase(requestBase []RequestBase) ApiActorTaskRunsLastRequestQueueRequestsBatchPostRequest { + r.requestBase = &requestBase + return r +} + +// Filter for the run status. +func (r ApiActorTaskRunsLastRequestQueueRequestsBatchPostRequest) Status(status string) ApiActorTaskRunsLastRequestQueueRequestsBatchPostRequest { + r.status = &status + return r +} + +// A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. +func (r ApiActorTaskRunsLastRequestQueueRequestsBatchPostRequest) ClientKey(clientKey string) ApiActorTaskRunsLastRequestQueueRequestsBatchPostRequest { + r.clientKey = &clientKey + return r +} + +// Determines if request should be added to the head of the queue or to the end. Default value is `false` (end of queue). +func (r ApiActorTaskRunsLastRequestQueueRequestsBatchPostRequest) Forefront(forefront string) ApiActorTaskRunsLastRequestQueueRequestsBatchPostRequest { + r.forefront = &forefront + return r +} + +func (r ApiActorTaskRunsLastRequestQueueRequestsBatchPostRequest) Execute() (*BatchAddResponse, *http.Response, error) { + return r.ApiService.ActorTaskRunsLastRequestQueueRequestsBatchPostExecute(r) +} + +/* +ActorTaskRunsLastRequestQueueRequestsBatchPost Batch add requests to last task run's default request queue + +Adds requests to the default request queue of the last Actor task run in batch. + +This endpoint is a shortcut for getting the last task run's `defaultRequestQueueId` and then using the +[Add requests](/api/v2/request-queue-requests-batch-post) endpoint. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param actorTaskId Task ID or a tilde-separated owner's username and task's name. + @return ApiActorTaskRunsLastRequestQueueRequestsBatchPostRequest +*/ +func (a *LastActorTaskRunsDefaultRequestQueueAPIService) ActorTaskRunsLastRequestQueueRequestsBatchPost(ctx context.Context, actorTaskId string) ApiActorTaskRunsLastRequestQueueRequestsBatchPostRequest { + return ApiActorTaskRunsLastRequestQueueRequestsBatchPostRequest{ + ApiService: a, + ctx: ctx, + actorTaskId: actorTaskId, + } +} + +// Execute executes the request +// @return BatchAddResponse +func (a *LastActorTaskRunsDefaultRequestQueueAPIService) ActorTaskRunsLastRequestQueueRequestsBatchPostExecute(r ApiActorTaskRunsLastRequestQueueRequestsBatchPostRequest) (*BatchAddResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *BatchAddResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LastActorTaskRunsDefaultRequestQueueAPIService.ActorTaskRunsLastRequestQueueRequestsBatchPost") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/actor-tasks/{actorTaskId}/runs/last/request-queue/requests/batch" + localVarPath = strings.Replace(localVarPath, "{"+"actorTaskId"+"}", url.PathEscape(parameterValueToString(r.actorTaskId, "actorTaskId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.requestBase == nil { + return localVarReturnValue, nil, reportError("requestBase is required and must be specified") + } + + if r.status != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "status", r.status, "form", "") + } + if r.clientKey != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "clientKey", r.clientKey, "form", "") + } + if r.forefront != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "forefront", r.forefront, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.requestBase + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 413 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 415 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiActorTaskRunsLastRequestQueueRequestsGetRequest struct { + ctx context.Context + ApiService *LastActorTaskRunsDefaultRequestQueueAPIService + actorTaskId string + status *string + clientKey *string + exclusiveStartId *string + limit *float64 + cursor *string + filter *[]string +} + +// Filter for the run status. +func (r ApiActorTaskRunsLastRequestQueueRequestsGetRequest) Status(status string) ApiActorTaskRunsLastRequestQueueRequestsGetRequest { + r.status = &status + return r +} + +// A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. +func (r ApiActorTaskRunsLastRequestQueueRequestsGetRequest) ClientKey(clientKey string) ApiActorTaskRunsLastRequestQueueRequestsGetRequest { + r.clientKey = &clientKey + return r +} + +// All requests up to this one (including) are skipped from the result. (Deprecated, use `cursor` instead.) +// Deprecated +func (r ApiActorTaskRunsLastRequestQueueRequestsGetRequest) ExclusiveStartId(exclusiveStartId string) ApiActorTaskRunsLastRequestQueueRequestsGetRequest { + r.exclusiveStartId = &exclusiveStartId + return r +} + +// Number of keys to be returned. Maximum value is `10000`. +func (r ApiActorTaskRunsLastRequestQueueRequestsGetRequest) Limit(limit float64) ApiActorTaskRunsLastRequestQueueRequestsGetRequest { + r.limit = &limit + return r +} + +// A cursor string for pagination, returned in the previous response as `nextCursor`. Use this to retrieve the next page of requests. +func (r ApiActorTaskRunsLastRequestQueueRequestsGetRequest) Cursor(cursor string) ApiActorTaskRunsLastRequestQueueRequestsGetRequest { + r.cursor = &cursor + return r +} + +// Filter requests by their state. Possible values are `locked` and `pending`. You can combine multiple values separated by commas, which will mean the union of these filters – requests matching any of the specified states will be returned. (Not compatible with deprecated `exclusiveStartId` parameter.) +func (r ApiActorTaskRunsLastRequestQueueRequestsGetRequest) Filter(filter []string) ApiActorTaskRunsLastRequestQueueRequestsGetRequest { + r.filter = &filter + return r +} + +func (r ApiActorTaskRunsLastRequestQueueRequestsGetRequest) Execute() (*ListOfRequestsResponse, *http.Response, error) { + return r.ApiService.ActorTaskRunsLastRequestQueueRequestsGetExecute(r) +} + +/* +ActorTaskRunsLastRequestQueueRequestsGet List last task run's default request queue's requests + +Returns a list of requests from the default request queue of the last Actor task run. + +This endpoint is a shortcut for getting the last task run's `defaultRequestQueueId` and then using the +[List requests](/api/v2/request-queue-requests-get) endpoint. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param actorTaskId Task ID or a tilde-separated owner's username and task's name. + @return ApiActorTaskRunsLastRequestQueueRequestsGetRequest +*/ +func (a *LastActorTaskRunsDefaultRequestQueueAPIService) ActorTaskRunsLastRequestQueueRequestsGet(ctx context.Context, actorTaskId string) ApiActorTaskRunsLastRequestQueueRequestsGetRequest { + return ApiActorTaskRunsLastRequestQueueRequestsGetRequest{ + ApiService: a, + ctx: ctx, + actorTaskId: actorTaskId, + } +} + +// Execute executes the request +// @return ListOfRequestsResponse +func (a *LastActorTaskRunsDefaultRequestQueueAPIService) ActorTaskRunsLastRequestQueueRequestsGetExecute(r ApiActorTaskRunsLastRequestQueueRequestsGetRequest) (*ListOfRequestsResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ListOfRequestsResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LastActorTaskRunsDefaultRequestQueueAPIService.ActorTaskRunsLastRequestQueueRequestsGet") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/actor-tasks/{actorTaskId}/runs/last/request-queue/requests" + localVarPath = strings.Replace(localVarPath, "{"+"actorTaskId"+"}", url.PathEscape(parameterValueToString(r.actorTaskId, "actorTaskId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.status != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "status", r.status, "form", "") + } + if r.clientKey != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "clientKey", r.clientKey, "form", "") + } + if r.exclusiveStartId != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "exclusiveStartId", r.exclusiveStartId, "form", "") + } + if r.limit != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "form", "") + } + if r.cursor != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "cursor", r.cursor, "form", "") + } + if r.filter != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "filter", r.filter, "form", "csv") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiActorTaskRunsLastRequestQueueRequestsPostRequest struct { + ctx context.Context + ApiService *LastActorTaskRunsDefaultRequestQueueAPIService + actorTaskId string + requestBase *RequestBase + status *string + clientKey *string + forefront *string +} + +// +func (r ApiActorTaskRunsLastRequestQueueRequestsPostRequest) RequestBase(requestBase RequestBase) ApiActorTaskRunsLastRequestQueueRequestsPostRequest { + r.requestBase = &requestBase + return r +} + +// Filter for the run status. +func (r ApiActorTaskRunsLastRequestQueueRequestsPostRequest) Status(status string) ApiActorTaskRunsLastRequestQueueRequestsPostRequest { + r.status = &status + return r +} + +// A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. +func (r ApiActorTaskRunsLastRequestQueueRequestsPostRequest) ClientKey(clientKey string) ApiActorTaskRunsLastRequestQueueRequestsPostRequest { + r.clientKey = &clientKey + return r +} + +// Determines if request should be added to the head of the queue or to the end. Default value is `false` (end of queue). +func (r ApiActorTaskRunsLastRequestQueueRequestsPostRequest) Forefront(forefront string) ApiActorTaskRunsLastRequestQueueRequestsPostRequest { + r.forefront = &forefront + return r +} + +func (r ApiActorTaskRunsLastRequestQueueRequestsPostRequest) Execute() (*AddRequestResponse, *http.Response, error) { + return r.ApiService.ActorTaskRunsLastRequestQueueRequestsPostExecute(r) +} + +/* +ActorTaskRunsLastRequestQueueRequestsPost Add request to last task run's default request queue + +Adds a request to the default request queue of the last Actor task run. + +This endpoint is a shortcut for getting the last task run's `defaultRequestQueueId` and then using the +[Add request](/api/v2/request-queue-requests-post) endpoint. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param actorTaskId Task ID or a tilde-separated owner's username and task's name. + @return ApiActorTaskRunsLastRequestQueueRequestsPostRequest +*/ +func (a *LastActorTaskRunsDefaultRequestQueueAPIService) ActorTaskRunsLastRequestQueueRequestsPost(ctx context.Context, actorTaskId string) ApiActorTaskRunsLastRequestQueueRequestsPostRequest { + return ApiActorTaskRunsLastRequestQueueRequestsPostRequest{ + ApiService: a, + ctx: ctx, + actorTaskId: actorTaskId, + } +} + +// Execute executes the request +// @return AddRequestResponse +func (a *LastActorTaskRunsDefaultRequestQueueAPIService) ActorTaskRunsLastRequestQueueRequestsPostExecute(r ApiActorTaskRunsLastRequestQueueRequestsPostRequest) (*AddRequestResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *AddRequestResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LastActorTaskRunsDefaultRequestQueueAPIService.ActorTaskRunsLastRequestQueueRequestsPost") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/actor-tasks/{actorTaskId}/runs/last/request-queue/requests" + localVarPath = strings.Replace(localVarPath, "{"+"actorTaskId"+"}", url.PathEscape(parameterValueToString(r.actorTaskId, "actorTaskId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.requestBase == nil { + return localVarReturnValue, nil, reportError("requestBase is required and must be specified") + } + + if r.status != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "status", r.status, "form", "") + } + if r.clientKey != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "clientKey", r.clientKey, "form", "") + } + if r.forefront != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "forefront", r.forefront, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.requestBase + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 413 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 415 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiActorTaskRunsLastRequestQueueRequestsUnlockPostRequest struct { + ctx context.Context + ApiService *LastActorTaskRunsDefaultRequestQueueAPIService + actorTaskId string + status *string + clientKey *string +} + +// Filter for the run status. +func (r ApiActorTaskRunsLastRequestQueueRequestsUnlockPostRequest) Status(status string) ApiActorTaskRunsLastRequestQueueRequestsUnlockPostRequest { + r.status = &status + return r +} + +// A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. +func (r ApiActorTaskRunsLastRequestQueueRequestsUnlockPostRequest) ClientKey(clientKey string) ApiActorTaskRunsLastRequestQueueRequestsUnlockPostRequest { + r.clientKey = &clientKey + return r +} + +func (r ApiActorTaskRunsLastRequestQueueRequestsUnlockPostRequest) Execute() (*UnlockRequestsResponse, *http.Response, error) { + return r.ApiService.ActorTaskRunsLastRequestQueueRequestsUnlockPostExecute(r) +} + +/* +ActorTaskRunsLastRequestQueueRequestsUnlockPost Unlock requests in last task run's default request queue + +Unlocks requests in the default request queue of the last Actor task run that are currently locked by the client. + +This endpoint is a shortcut for getting the last task run's `defaultRequestQueueId` and then using the +[Unlock requests](/api/v2/request-queue-requests-unlock-post) endpoint. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param actorTaskId Task ID or a tilde-separated owner's username and task's name. + @return ApiActorTaskRunsLastRequestQueueRequestsUnlockPostRequest +*/ +func (a *LastActorTaskRunsDefaultRequestQueueAPIService) ActorTaskRunsLastRequestQueueRequestsUnlockPost(ctx context.Context, actorTaskId string) ApiActorTaskRunsLastRequestQueueRequestsUnlockPostRequest { + return ApiActorTaskRunsLastRequestQueueRequestsUnlockPostRequest{ + ApiService: a, + ctx: ctx, + actorTaskId: actorTaskId, + } +} + +// Execute executes the request +// @return UnlockRequestsResponse +func (a *LastActorTaskRunsDefaultRequestQueueAPIService) ActorTaskRunsLastRequestQueueRequestsUnlockPostExecute(r ApiActorTaskRunsLastRequestQueueRequestsUnlockPostRequest) (*UnlockRequestsResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *UnlockRequestsResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LastActorTaskRunsDefaultRequestQueueAPIService.ActorTaskRunsLastRequestQueueRequestsUnlockPost") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/actor-tasks/{actorTaskId}/runs/last/request-queue/requests/unlock" + localVarPath = strings.Replace(localVarPath, "{"+"actorTaskId"+"}", url.PathEscape(parameterValueToString(r.actorTaskId, "actorTaskId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.status != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "status", r.status, "form", "") + } + if r.clientKey != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "clientKey", r.clientKey, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/api_last_actor_task_runs_log.go b/api_last_actor_task_runs_log.go new file mode 100644 index 0000000..bf755d9 --- /dev/null +++ b/api_last_actor_task_runs_log.go @@ -0,0 +1,239 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" + "strings" +) + + +// LastActorTaskRunsLogAPIService LastActorTaskRunsLogAPI service +type LastActorTaskRunsLogAPIService service + +type ApiActorTaskLastLogGetRequest struct { + ctx context.Context + ApiService *LastActorTaskRunsLogAPIService + actorTaskId string + stream *bool + download *bool + raw *bool +} + +// If `true` or `1` then the logs will be streamed as long as the run or build is running. +func (r ApiActorTaskLastLogGetRequest) Stream(stream bool) ApiActorTaskLastLogGetRequest { + r.stream = &stream + return r +} + +// If `true` or `1` then the web browser will download the log file rather than open it in a tab. +func (r ApiActorTaskLastLogGetRequest) Download(download bool) ApiActorTaskLastLogGetRequest { + r.download = &download + return r +} + +// If `true` or `1`, the logs will be kept verbatim. By default, the API removes ANSI escape codes from the logs, keeping only printable characters. +func (r ApiActorTaskLastLogGetRequest) Raw(raw bool) ApiActorTaskLastLogGetRequest { + r.raw = &raw + return r +} + +func (r ApiActorTaskLastLogGetRequest) Execute() (string, *http.Response, error) { + return r.ApiService.ActorTaskLastLogGetExecute(r) +} + +/* +ActorTaskLastLogGet Get last Actor task run's log + +Retrieves last Actor task run's logs. + +This endpoint is a shortcut for getting last Actor task run's log. Same as [Get log](/api/v2/log-get) endpoint. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param actorTaskId Task ID or a tilde-separated owner's username and task's name. + @return ApiActorTaskLastLogGetRequest +*/ +func (a *LastActorTaskRunsLogAPIService) ActorTaskLastLogGet(ctx context.Context, actorTaskId string) ApiActorTaskLastLogGetRequest { + return ApiActorTaskLastLogGetRequest{ + ApiService: a, + ctx: ctx, + actorTaskId: actorTaskId, + } +} + +// Execute executes the request +// @return string +func (a *LastActorTaskRunsLogAPIService) ActorTaskLastLogGetExecute(r ApiActorTaskLastLogGetRequest) (string, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue string + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LastActorTaskRunsLogAPIService.ActorTaskLastLogGet") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/actor-tasks/{actorTaskId}/runs/last/log" + localVarPath = strings.Replace(localVarPath, "{"+"actorTaskId"+"}", url.PathEscape(parameterValueToString(r.actorTaskId, "actorTaskId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.stream != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "stream", r.stream, "form", "") + } + if r.download != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "download", r.download, "form", "") + } + if r.raw != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "raw", r.raw, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"text/plain", "application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/api_last_actor_task_runs_metamorph.go b/api_last_actor_task_runs_metamorph.go new file mode 100644 index 0000000..ae1aec9 --- /dev/null +++ b/api_last_actor_task_runs_metamorph.go @@ -0,0 +1,242 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" + "strings" +) + + +// LastActorTaskRunsMetamorphAPIService LastActorTaskRunsMetamorphAPI service +type LastActorTaskRunsMetamorphAPIService service + +type ApiActorTaskRunsLastMetamorphPostRequest struct { + ctx context.Context + ApiService *LastActorTaskRunsMetamorphAPIService + actorTaskId string + targetActorId *string + status *string + build *string +} + +// ID of a target Actor that the run should be transformed into. +func (r ApiActorTaskRunsLastMetamorphPostRequest) TargetActorId(targetActorId string) ApiActorTaskRunsLastMetamorphPostRequest { + r.targetActorId = &targetActorId + return r +} + +// Filter for the run status. +func (r ApiActorTaskRunsLastMetamorphPostRequest) Status(status string) ApiActorTaskRunsLastMetamorphPostRequest { + r.status = &status + return r +} + +// Optional build of the target Actor. It can be either a build tag or build number. By default, the run uses the build specified in the default run configuration for the target Actor (typically `latest`). +func (r ApiActorTaskRunsLastMetamorphPostRequest) Build(build string) ApiActorTaskRunsLastMetamorphPostRequest { + r.build = &build + return r +} + +func (r ApiActorTaskRunsLastMetamorphPostRequest) Execute() (*RunResponse, *http.Response, error) { + return r.ApiService.ActorTaskRunsLastMetamorphPostExecute(r) +} + +/* +ActorTaskRunsLastMetamorphPost Metamorph Actor task's last run + +Transforms the last run of the specified Actor task into a run of another Actor with +a new input. + +This endpoint is a shortcut for [Metamorph run](#/reference/actor-runs/metamorph-run/metamorph-run) +on the Actor task's last run. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param actorTaskId Task ID or a tilde-separated owner's username and task's name. + @return ApiActorTaskRunsLastMetamorphPostRequest +*/ +func (a *LastActorTaskRunsMetamorphAPIService) ActorTaskRunsLastMetamorphPost(ctx context.Context, actorTaskId string) ApiActorTaskRunsLastMetamorphPostRequest { + return ApiActorTaskRunsLastMetamorphPostRequest{ + ApiService: a, + ctx: ctx, + actorTaskId: actorTaskId, + } +} + +// Execute executes the request +// @return RunResponse +func (a *LastActorTaskRunsMetamorphAPIService) ActorTaskRunsLastMetamorphPostExecute(r ApiActorTaskRunsLastMetamorphPostRequest) (*RunResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *RunResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LastActorTaskRunsMetamorphAPIService.ActorTaskRunsLastMetamorphPost") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/actor-tasks/{actorTaskId}/runs/last/metamorph" + localVarPath = strings.Replace(localVarPath, "{"+"actorTaskId"+"}", url.PathEscape(parameterValueToString(r.actorTaskId, "actorTaskId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.targetActorId == nil { + return localVarReturnValue, nil, reportError("targetActorId is required and must be specified") + } + + if r.status != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "status", r.status, "form", "") + } + parameterAddToHeaderOrQuery(localVarQueryParams, "targetActorId", r.targetActorId, "form", "") + if r.build != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "build", r.build, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/api_last_actor_task_runs_reboot.go b/api_last_actor_task_runs_reboot.go new file mode 100644 index 0000000..ac2f6b9 --- /dev/null +++ b/api_last_actor_task_runs_reboot.go @@ -0,0 +1,223 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" + "strings" +) + + +// LastActorTaskRunsRebootAPIService LastActorTaskRunsRebootAPI service +type LastActorTaskRunsRebootAPIService service + +type ApiActorTaskRunsLastRebootPostRequest struct { + ctx context.Context + ApiService *LastActorTaskRunsRebootAPIService + actorTaskId string + status *string +} + +// Filter for the run status. +func (r ApiActorTaskRunsLastRebootPostRequest) Status(status string) ApiActorTaskRunsLastRebootPostRequest { + r.status = &status + return r +} + +func (r ApiActorTaskRunsLastRebootPostRequest) Execute() (*RunResponse, *http.Response, error) { + return r.ApiService.ActorTaskRunsLastRebootPostExecute(r) +} + +/* +ActorTaskRunsLastRebootPost Reboot Actor task's last run + +Reboots the last run of the specified Actor task and returns an object that +contains all the details about the rebooted run. + +This endpoint is a shortcut for [Reboot run](#/reference/actor-runs/reboot-run/reboot-run) +on the Actor task's last run. Only runs with status `RUNNING` can be rebooted. The run's +container will be restarted, so any data not persisted in the key-value store, dataset, +or request queue will be lost. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param actorTaskId Task ID or a tilde-separated owner's username and task's name. + @return ApiActorTaskRunsLastRebootPostRequest +*/ +func (a *LastActorTaskRunsRebootAPIService) ActorTaskRunsLastRebootPost(ctx context.Context, actorTaskId string) ApiActorTaskRunsLastRebootPostRequest { + return ApiActorTaskRunsLastRebootPostRequest{ + ApiService: a, + ctx: ctx, + actorTaskId: actorTaskId, + } +} + +// Execute executes the request +// @return RunResponse +func (a *LastActorTaskRunsRebootAPIService) ActorTaskRunsLastRebootPostExecute(r ApiActorTaskRunsLastRebootPostRequest) (*RunResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *RunResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LastActorTaskRunsRebootAPIService.ActorTaskRunsLastRebootPost") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/actor-tasks/{actorTaskId}/runs/last/reboot" + localVarPath = strings.Replace(localVarPath, "{"+"actorTaskId"+"}", url.PathEscape(parameterValueToString(r.actorTaskId, "actorTaskId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.status != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "status", r.status, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/api_logs.go b/api_logs.go new file mode 100644 index 0000000..178d314 --- /dev/null +++ b/api_logs.go @@ -0,0 +1,237 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" + "strings" +) + + +// LogsAPIService LogsAPI service +type LogsAPIService service + +type ApiLogGetRequest struct { + ctx context.Context + ApiService *LogsAPIService + buildOrRunId string + stream *bool + download *bool + raw *bool +} + +// If `true` or `1` then the logs will be streamed as long as the run or build is running. +func (r ApiLogGetRequest) Stream(stream bool) ApiLogGetRequest { + r.stream = &stream + return r +} + +// If `true` or `1` then the web browser will download the log file rather than open it in a tab. +func (r ApiLogGetRequest) Download(download bool) ApiLogGetRequest { + r.download = &download + return r +} + +// If `true` or `1`, the logs will be kept verbatim. By default, the API removes ANSI escape codes from the logs, keeping only printable characters. +func (r ApiLogGetRequest) Raw(raw bool) ApiLogGetRequest { + r.raw = &raw + return r +} + +func (r ApiLogGetRequest) Execute() (string, *http.Response, error) { + return r.ApiService.LogGetExecute(r) +} + +/* +LogGet Get log + +Retrieves logs for a specific Actor build or run. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param buildOrRunId ID of the Actor build or run. + @return ApiLogGetRequest +*/ +func (a *LogsAPIService) LogGet(ctx context.Context, buildOrRunId string) ApiLogGetRequest { + return ApiLogGetRequest{ + ApiService: a, + ctx: ctx, + buildOrRunId: buildOrRunId, + } +} + +// Execute executes the request +// @return string +func (a *LogsAPIService) LogGetExecute(r ApiLogGetRequest) (string, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue string + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LogsAPIService.LogGet") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/logs/{buildOrRunId}" + localVarPath = strings.Replace(localVarPath, "{"+"buildOrRunId"+"}", url.PathEscape(parameterValueToString(r.buildOrRunId, "buildOrRunId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.stream != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "stream", r.stream, "form", "") + } + if r.download != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "download", r.download, "form", "") + } + if r.raw != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "raw", r.raw, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"text/plain", "application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/api_schedules.go b/api_schedules.go new file mode 100644 index 0000000..9d1e327 --- /dev/null +++ b/api_schedules.go @@ -0,0 +1,1236 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" + "strings" +) + + +// SchedulesAPIService SchedulesAPI service +type SchedulesAPIService service + +type ApiScheduleDeleteRequest struct { + ctx context.Context + ApiService *SchedulesAPIService + scheduleId string +} + +func (r ApiScheduleDeleteRequest) Execute() (map[string]interface{}, *http.Response, error) { + return r.ApiService.ScheduleDeleteExecute(r) +} + +/* +ScheduleDelete Delete schedule + +Deletes a schedule. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param scheduleId Schedule ID. + @return ApiScheduleDeleteRequest +*/ +func (a *SchedulesAPIService) ScheduleDelete(ctx context.Context, scheduleId string) ApiScheduleDeleteRequest { + return ApiScheduleDeleteRequest{ + ApiService: a, + ctx: ctx, + scheduleId: scheduleId, + } +} + +// Execute executes the request +// @return map[string]interface{} +func (a *SchedulesAPIService) ScheduleDeleteExecute(r ApiScheduleDeleteRequest) (map[string]interface{}, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue map[string]interface{} + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SchedulesAPIService.ScheduleDelete") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/schedules/{scheduleId}" + localVarPath = strings.Replace(localVarPath, "{"+"scheduleId"+"}", url.PathEscape(parameterValueToString(r.scheduleId, "scheduleId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiScheduleGetRequest struct { + ctx context.Context + ApiService *SchedulesAPIService + scheduleId string +} + +func (r ApiScheduleGetRequest) Execute() (*ScheduleResponse, *http.Response, error) { + return r.ApiService.ScheduleGetExecute(r) +} + +/* +ScheduleGet Get schedule + +Gets the schedule object with all details. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param scheduleId Schedule ID. + @return ApiScheduleGetRequest +*/ +func (a *SchedulesAPIService) ScheduleGet(ctx context.Context, scheduleId string) ApiScheduleGetRequest { + return ApiScheduleGetRequest{ + ApiService: a, + ctx: ctx, + scheduleId: scheduleId, + } +} + +// Execute executes the request +// @return ScheduleResponse +func (a *SchedulesAPIService) ScheduleGetExecute(r ApiScheduleGetRequest) (*ScheduleResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ScheduleResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SchedulesAPIService.ScheduleGet") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/schedules/{scheduleId}" + localVarPath = strings.Replace(localVarPath, "{"+"scheduleId"+"}", url.PathEscape(parameterValueToString(r.scheduleId, "scheduleId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiScheduleLogGetRequest struct { + ctx context.Context + ApiService *SchedulesAPIService + scheduleId string +} + +func (r ApiScheduleLogGetRequest) Execute() (*ScheduleLogResponse, *http.Response, error) { + return r.ApiService.ScheduleLogGetExecute(r) +} + +/* +ScheduleLogGet Get schedule log + +Gets the schedule log as a JSON array containing information about up to a +1000 invocations of the schedule. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param scheduleId Schedule ID. + @return ApiScheduleLogGetRequest +*/ +func (a *SchedulesAPIService) ScheduleLogGet(ctx context.Context, scheduleId string) ApiScheduleLogGetRequest { + return ApiScheduleLogGetRequest{ + ApiService: a, + ctx: ctx, + scheduleId: scheduleId, + } +} + +// Execute executes the request +// @return ScheduleLogResponse +func (a *SchedulesAPIService) ScheduleLogGetExecute(r ApiScheduleLogGetRequest) (*ScheduleLogResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ScheduleLogResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SchedulesAPIService.ScheduleLogGet") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/schedules/{scheduleId}/log" + localVarPath = strings.Replace(localVarPath, "{"+"scheduleId"+"}", url.PathEscape(parameterValueToString(r.scheduleId, "scheduleId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiSchedulePutRequest struct { + ctx context.Context + ApiService *SchedulesAPIService + scheduleId string + scheduleCreate *ScheduleCreate +} + +// +func (r ApiSchedulePutRequest) ScheduleCreate(scheduleCreate ScheduleCreate) ApiSchedulePutRequest { + r.scheduleCreate = &scheduleCreate + return r +} + +func (r ApiSchedulePutRequest) Execute() (*ScheduleResponse, *http.Response, error) { + return r.ApiService.SchedulePutExecute(r) +} + +/* +SchedulePut Update schedule + +Updates a schedule using values specified by a schedule object passed as +JSON in the POST payload. If the object does not define a specific property, +its value will not be updated. + +The response is the full schedule object as returned by the +[Get schedule](#/reference/schedules/schedule-object/get-schedule) endpoint. + +**The request needs to specify the `Content-Type: application/json` HTTP +header!** + +When providing your API authentication token, we recommend using the +request's `Authorization` header, rather than the URL. ([More +info](#/introduction/authentication)). + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param scheduleId Schedule ID. + @return ApiSchedulePutRequest +*/ +func (a *SchedulesAPIService) SchedulePut(ctx context.Context, scheduleId string) ApiSchedulePutRequest { + return ApiSchedulePutRequest{ + ApiService: a, + ctx: ctx, + scheduleId: scheduleId, + } +} + +// Execute executes the request +// @return ScheduleResponse +func (a *SchedulesAPIService) SchedulePutExecute(r ApiSchedulePutRequest) (*ScheduleResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ScheduleResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SchedulesAPIService.SchedulePut") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/schedules/{scheduleId}" + localVarPath = strings.Replace(localVarPath, "{"+"scheduleId"+"}", url.PathEscape(parameterValueToString(r.scheduleId, "scheduleId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.scheduleCreate == nil { + return localVarReturnValue, nil, reportError("scheduleCreate is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.scheduleCreate + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 413 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 415 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiSchedulesGetRequest struct { + ctx context.Context + ApiService *SchedulesAPIService + offset *float64 + limit *float64 + desc *bool +} + +// Number of items that should be skipped at the start. The default value is `0`. +func (r ApiSchedulesGetRequest) Offset(offset float64) ApiSchedulesGetRequest { + r.offset = &offset + return r +} + +// Maximum number of items to return. The default value as well as the maximum is `1000`. +func (r ApiSchedulesGetRequest) Limit(limit float64) ApiSchedulesGetRequest { + r.limit = &limit + return r +} + +// If `true` or `1` then the objects are sorted by the `createdAt` field in descending order. By default, they are sorted in ascending order. +func (r ApiSchedulesGetRequest) Desc(desc bool) ApiSchedulesGetRequest { + r.desc = &desc + return r +} + +func (r ApiSchedulesGetRequest) Execute() (*ListOfSchedulesResponse, *http.Response, error) { + return r.ApiService.SchedulesGetExecute(r) +} + +/* +SchedulesGet Get list of schedules + +Gets the list of schedules that the user created. + +The endpoint supports pagination using the `limit` and `offset` parameters. +It will not return more than 1000 records. + +By default, the records are sorted by the `createdAt` field in ascending +order. To sort the records in descending order, use the `desc=1` parameter. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiSchedulesGetRequest +*/ +func (a *SchedulesAPIService) SchedulesGet(ctx context.Context) ApiSchedulesGetRequest { + return ApiSchedulesGetRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return ListOfSchedulesResponse +func (a *SchedulesAPIService) SchedulesGetExecute(r ApiSchedulesGetRequest) (*ListOfSchedulesResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ListOfSchedulesResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SchedulesAPIService.SchedulesGet") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/schedules" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.offset != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "form", "") + } + if r.limit != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "form", "") + } + if r.desc != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "desc", r.desc, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiSchedulesPostRequest struct { + ctx context.Context + ApiService *SchedulesAPIService + scheduleCreate *ScheduleCreate +} + +// +func (r ApiSchedulesPostRequest) ScheduleCreate(scheduleCreate ScheduleCreate) ApiSchedulesPostRequest { + r.scheduleCreate = &scheduleCreate + return r +} + +func (r ApiSchedulesPostRequest) Execute() (*ScheduleResponse, *http.Response, error) { + return r.ApiService.SchedulesPostExecute(r) +} + +/* +SchedulesPost Create schedule + +Creates a new schedule with settings provided by the schedule object passed +as JSON in the payload. The response is the created schedule object. + +The request needs to specify the `Content-Type: application/json` HTTP header! + +When providing your API authentication token, we recommend using the +request's `Authorization` header, rather than the URL. ([More +info](#/introduction/authentication)). + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiSchedulesPostRequest +*/ +func (a *SchedulesAPIService) SchedulesPost(ctx context.Context) ApiSchedulesPostRequest { + return ApiSchedulesPostRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return ScheduleResponse +func (a *SchedulesAPIService) SchedulesPostExecute(r ApiSchedulesPostRequest) (*ScheduleResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ScheduleResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SchedulesAPIService.SchedulesPost") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/schedules" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.scheduleCreate == nil { + return localVarReturnValue, nil, reportError("scheduleCreate is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.scheduleCreate + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 409 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 413 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 415 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/api_storage_datasets.go b/api_storage_datasets.go new file mode 100644 index 0000000..82cb485 --- /dev/null +++ b/api_storage_datasets.go @@ -0,0 +1,2385 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" + "strings" +) + + +// StorageDatasetsAPIService StorageDatasetsAPI service +type StorageDatasetsAPIService service + +type ApiDatasetDeleteRequest struct { + ctx context.Context + ApiService *StorageDatasetsAPIService + datasetId string +} + +func (r ApiDatasetDeleteRequest) Execute() (*http.Response, error) { + return r.ApiService.DatasetDeleteExecute(r) +} + +/* +DatasetDelete Delete dataset + +Deletes a specific dataset. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param datasetId Dataset ID or `username~dataset-name`. + @return ApiDatasetDeleteRequest +*/ +func (a *StorageDatasetsAPIService) DatasetDelete(ctx context.Context, datasetId string) ApiDatasetDeleteRequest { + return ApiDatasetDeleteRequest{ + ApiService: a, + ctx: ctx, + datasetId: datasetId, + } +} + +// Execute executes the request +func (a *StorageDatasetsAPIService) DatasetDeleteExecute(r ApiDatasetDeleteRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StorageDatasetsAPIService.DatasetDelete") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/datasets/{datasetId}" + localVarPath = strings.Replace(localVarPath, "{"+"datasetId"+"}", url.PathEscape(parameterValueToString(r.datasetId, "datasetId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiDatasetGetRequest struct { + ctx context.Context + ApiService *StorageDatasetsAPIService + datasetId string +} + +func (r ApiDatasetGetRequest) Execute() (*DatasetResponse, *http.Response, error) { + return r.ApiService.DatasetGetExecute(r) +} + +/* +DatasetGet Get dataset + +Returns dataset object for given dataset ID. + +This does not return dataset items, only information about the storage itself. +To retrieve dataset items, use the [List dataset items](/api/v2/dataset-items-get) endpoint. + +:::note + +Keep in mind that attributes `itemCount` and `cleanItemCount` are not propagated right away after data are pushed into a dataset. + +::: + +There is a short period (up to 5 seconds) during which these counters may not match with exact counts in dataset items. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param datasetId Dataset ID or `username~dataset-name`. + @return ApiDatasetGetRequest +*/ +func (a *StorageDatasetsAPIService) DatasetGet(ctx context.Context, datasetId string) ApiDatasetGetRequest { + return ApiDatasetGetRequest{ + ApiService: a, + ctx: ctx, + datasetId: datasetId, + } +} + +// Execute executes the request +// @return DatasetResponse +func (a *StorageDatasetsAPIService) DatasetGetExecute(r ApiDatasetGetRequest) (*DatasetResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *DatasetResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StorageDatasetsAPIService.DatasetGet") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/datasets/{datasetId}" + localVarPath = strings.Replace(localVarPath, "{"+"datasetId"+"}", url.PathEscape(parameterValueToString(r.datasetId, "datasetId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDatasetItemsGetRequest struct { + ctx context.Context + ApiService *StorageDatasetsAPIService + datasetId string + format *string + clean *bool + offset *float64 + limit *float64 + fields *string + outputFields *string + omit *string + unwind *string + flatten *string + desc *bool + attachment *bool + delimiter *string + bom *bool + xmlRoot *string + xmlRow *string + skipHeaderRow *bool + skipHidden *bool + skipEmpty *bool + simplified *bool + view *string + skipFailedPages *bool + feedTitle *string + feedDescription *string + signature *string +} + +// Format of the results, possible values are: `json`, `jsonl`, `csv`, `html`, `xlsx`, `xml` and `rss`. The default value is `json`. +func (r ApiDatasetItemsGetRequest) Format(format string) ApiDatasetItemsGetRequest { + r.format = &format + return r +} + +// If `true` or `1` then the API endpoint returns only non-empty items and skips hidden fields (i.e. fields starting with the # character). The `clean` parameter is just a shortcut for `skipHidden=true` and `skipEmpty=true` parameters. Note that since some objects might be skipped from the output, that the result might contain less items than the `limit` value. +func (r ApiDatasetItemsGetRequest) Clean(clean bool) ApiDatasetItemsGetRequest { + r.clean = &clean + return r +} + +// Number of items that should be skipped at the start. The default value is `0`. +func (r ApiDatasetItemsGetRequest) Offset(offset float64) ApiDatasetItemsGetRequest { + r.offset = &offset + return r +} + +// Maximum number of items to return. By default there is no limit. +func (r ApiDatasetItemsGetRequest) Limit(limit float64) ApiDatasetItemsGetRequest { + r.limit = &limit + return r +} + +// A comma-separated list of fields which should be picked from the items, only these fields will remain in the resulting record objects. Note that the fields in the outputted items are sorted the same way as they are specified in the `fields` query parameter. You can use this feature to effectively fix the output format. +func (r ApiDatasetItemsGetRequest) Fields(fields string) ApiDatasetItemsGetRequest { + r.fields = &fields + return r +} + +// A comma-separated list of output field names that positionally rename the fields specified in the `fields` parameter. For example, `?fields=headline,url&outputFields=title,link` renames `headline` to `title` and `url` to `link` in the output. The number of names in `outputFields` must match the number of names in `fields`. Requires the `fields` parameter to be specified as well. +func (r ApiDatasetItemsGetRequest) OutputFields(outputFields string) ApiDatasetItemsGetRequest { + r.outputFields = &outputFields + return r +} + +// A comma-separated list of fields which should be omitted from the items. +func (r ApiDatasetItemsGetRequest) Omit(omit string) ApiDatasetItemsGetRequest { + r.omit = &omit + return r +} + +// A comma-separated list of fields which should be unwound, in order which they should be processed. Each field should be either an array or an object. If the field is an array then every element of the array will become a separate record and merged with parent object. If the unwound field is an object then it is merged with the parent object. If the unwound field is missing or its value is neither an array nor an object and therefore cannot be merged with a parent object then the item gets preserved as it is. Note that the unwound items ignore the `desc` parameter. +func (r ApiDatasetItemsGetRequest) Unwind(unwind string) ApiDatasetItemsGetRequest { + r.unwind = &unwind + return r +} + +// A comma-separated list of fields which should transform nested objects into flat structures. For example, with `flatten=\"foo\"` the object `{\"foo\":{\"bar\": \"hello\"}}` is turned into `{\"foo.bar\": \"hello\"}`. The original object with properties is replaced with the flattened object. +func (r ApiDatasetItemsGetRequest) Flatten(flatten string) ApiDatasetItemsGetRequest { + r.flatten = &flatten + return r +} + +// By default, results are returned in the same order as they were stored. To reverse the order, set this parameter to `true` or `1`. +func (r ApiDatasetItemsGetRequest) Desc(desc bool) ApiDatasetItemsGetRequest { + r.desc = &desc + return r +} + +// If `true` or `1` then the response will define the `Content-Disposition: attachment` header, forcing a web browser to download the file rather than to display it. By default this header is not present. +func (r ApiDatasetItemsGetRequest) Attachment(attachment bool) ApiDatasetItemsGetRequest { + r.attachment = &attachment + return r +} + +// A delimiter character for CSV files, only used if `format=csv`. You might need to URL-encode the character (e.g. use `%09` for tab or `%3B` for semicolon). The default delimiter is a simple comma (`,`). +func (r ApiDatasetItemsGetRequest) Delimiter(delimiter string) ApiDatasetItemsGetRequest { + r.delimiter = &delimiter + return r +} + +// All text responses are encoded in UTF-8 encoding. By default, the `format=csv` files are prefixed with the UTF-8 Byte Order Mark (BOM), while `json`, `jsonl`, `xml`, `html` and `rss` files are not. If you want to override this default behavior, specify `bom=1` query parameter to include the BOM or `bom=0` to skip it. +func (r ApiDatasetItemsGetRequest) Bom(bom bool) ApiDatasetItemsGetRequest { + r.bom = &bom + return r +} + +// Overrides default root element name of `xml` output. By default the root element is `items`. +func (r ApiDatasetItemsGetRequest) XmlRoot(xmlRoot string) ApiDatasetItemsGetRequest { + r.xmlRoot = &xmlRoot + return r +} + +// Overrides default element name that wraps each page or page function result object in `xml` output. By default the element name is `item`. +func (r ApiDatasetItemsGetRequest) XmlRow(xmlRow string) ApiDatasetItemsGetRequest { + r.xmlRow = &xmlRow + return r +} + +// If `true` or `1` then header row in the `csv` format is skipped. +func (r ApiDatasetItemsGetRequest) SkipHeaderRow(skipHeaderRow bool) ApiDatasetItemsGetRequest { + r.skipHeaderRow = &skipHeaderRow + return r +} + +// If `true` or `1` then hidden fields are skipped from the output, i.e. fields starting with the `#` character. +func (r ApiDatasetItemsGetRequest) SkipHidden(skipHidden bool) ApiDatasetItemsGetRequest { + r.skipHidden = &skipHidden + return r +} + +// If `true` or `1` then empty items are skipped from the output. Note that if used, the results might contain less items than the limit value. +func (r ApiDatasetItemsGetRequest) SkipEmpty(skipEmpty bool) ApiDatasetItemsGetRequest { + r.skipEmpty = &skipEmpty + return r +} + +// If `true` or `1` then, the endpoint applies the `fields=url,pageFunctionResult,errorInfo` and `unwind=pageFunctionResult` query parameters. This feature is used to emulate simplified results provided by the legacy Apify Crawler product and it's not recommended to use it in new integrations. +func (r ApiDatasetItemsGetRequest) Simplified(simplified bool) ApiDatasetItemsGetRequest { + r.simplified = &simplified + return r +} + +// Defines the view configuration for dataset items based on the schema definition. This parameter determines how the data will be filtered and presented. For complete specification details, see the [dataset schema documentation](/platform/actors/development/actor-definition/dataset-schema). +func (r ApiDatasetItemsGetRequest) View(view string) ApiDatasetItemsGetRequest { + r.view = &view + return r +} + +// If `true` or `1` then, the all the items with errorInfo property will be skipped from the output. This feature is here to emulate functionality of API version 1 used for the legacy Apify Crawler product and it's not recommended to use it in new integrations. +func (r ApiDatasetItemsGetRequest) SkipFailedPages(skipFailedPages bool) ApiDatasetItemsGetRequest { + r.skipFailedPages = &skipFailedPages + return r +} + +// Overrides the auto-generated RSS channel `<title>` element. Only used when `format=rss`. If not provided, the title defaults to `Dataset <label>`. +func (r ApiDatasetItemsGetRequest) FeedTitle(feedTitle string) ApiDatasetItemsGetRequest { + r.feedTitle = &feedTitle + return r +} + +// Overrides the auto-generated RSS channel `<description>` element. Only used when `format=rss`. If not provided, the description defaults to `Items in dataset with id \"<datasetId>\".` +func (r ApiDatasetItemsGetRequest) FeedDescription(feedDescription string) ApiDatasetItemsGetRequest { + r.feedDescription = &feedDescription + return r +} + +// Signature used for the access. +func (r ApiDatasetItemsGetRequest) Signature(signature string) ApiDatasetItemsGetRequest { + r.signature = &signature + return r +} + +func (r ApiDatasetItemsGetRequest) Execute() ([]map[string]interface{}, *http.Response, error) { + return r.ApiService.DatasetItemsGetExecute(r) +} + +/* +DatasetItemsGet Get dataset items + +Returns data stored in the dataset in a desired format. + +### Response format + +The format of the response depends on <code>format</code> query parameter. + +The <code>format</code> parameter can have one of the following values: +<code>json</code>, <code>jsonl</code>, <code>xml</code>, <code>html</code>, +<code>csv</code>, <code>xlsx</code> and <code>rss</code>. + +The following table describes how each format is treated. + +<table> + <tr> + <th>Format</th> + <th>Items</th> + </tr> + <tr> + <td><code>json</code></td> + <td rowspan="3">The response is a JSON, JSONL or XML array of raw item objects.</td> + </tr> + <tr> + <td><code>jsonl</code></td> + </tr> + <tr> + <td><code>xml</code></td> + </tr> + <tr> + <td><code>html</code></td> + <td rowspan="3">The response is a HTML, CSV or XLSX table, where columns correspond to the + properties of the item and rows correspond to each dataset item.</td> + </tr> + <tr> + <td><code>csv</code></td> + </tr> + <tr> + <td><code>xlsx</code></td> + </tr> + <tr> + <td><code>rss</code></td> + <td colspan="2">The response is a RSS file. Each item is displayed as child elements of one + <code><item></code>.</td> + </tr> +</table> + +Note that CSV, XLSX and HTML tables are limited to 2000 columns and the column names cannot be longer than 200 characters. +JSON, XML and RSS formats do not have such restrictions. + +### Hidden fields + +The top-level fields starting with the `#` character are considered hidden. +These are useful to store debugging information and can be omitted from the output by providing the `skipHidden=1` or `clean=1` query parameters. +For example, if you store the following object to the dataset: + +``` +{ + productName: "iPhone Xs", + description: "Welcome to the big screens." + #debug: { + url: "https://www.apple.com/lae/iphone-xs/", + crawledAt: "2019-01-21T16:06:03.683Z" + } +} +``` + +The `#debug` field will be considered as hidden and can be omitted from the +results. This is useful to +provide nice cleaned data to end users, while keeping debugging info +available if needed. The Dataset object +returned by the API contains the number of such clean items in the`dataset.cleanItemCount` property. + +### XML format extension + +When exporting results to XML or RSS formats, the names of object properties become XML tags and the corresponding values become tag's children. For example, the following JavaScript object: + +``` +{ + name: "Paul Newman", + address: [ + { type: "home", street: "21st", city: "Chicago" }, + { type: "office", street: null, city: null } + ] +} +``` + +will be transformed to the following XML snippet: + +``` +<name>Paul Newman</name> +<address> + <type>home</type> + <street>21st</street> + <city>Chicago</city> +</address> +<address> + <type>office</type> + <street/> + <city/> +</address> +``` + +If the JavaScript object contains a property named `@` then its sub-properties are exported as attributes of the parent XML +element. +If the parent XML element does not have any child elements then its value is taken from a JavaScript object property named `#`. + +For example, the following JavaScript object: + +``` +{ + "address": [{ + "@": { + "type": "home" + }, + "street": "21st", + "city": "Chicago" + }, + { + "@": { + "type": "office" + }, + "#": 'unknown' + }] +} +``` + +will be transformed to the following XML snippet: + +``` +<address type="home"> + <street>21st</street> + <city>Chicago</city> +</address> +<address type="office">unknown</address> +``` + +This feature is also useful to customize your RSS feeds generated for various websites. + +By default the whole result is wrapped in a `<items>` element and each page object is wrapped in a `<item>` element. +You can change this using <code>xmlRoot</code> and <code>xmlRow</code> url parameters. + +### Pagination + +The generated response supports [pagination](#/introduction/pagination). +The pagination is always performed with the granularity of a single item, regardless whether <code>unwind</code> parameter was provided. +By default, the **Items** in the response are sorted by the time they were stored to the database, therefore you can use pagination to incrementally fetch the items as they are being added. +No limit exists to how many items can be returned in one response. + +If you specify `desc=1` query parameter, the results are returned in the reverse order than they were stored (i.e. from newest to oldest items). +Note that only the order of **Items** is reversed, but not the order of the `unwind` array elements. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param datasetId Dataset ID or `username~dataset-name`. + @return ApiDatasetItemsGetRequest +*/ +func (a *StorageDatasetsAPIService) DatasetItemsGet(ctx context.Context, datasetId string) ApiDatasetItemsGetRequest { + return ApiDatasetItemsGetRequest{ + ApiService: a, + ctx: ctx, + datasetId: datasetId, + } +} + +// Execute executes the request +// @return []map[string]interface{} +func (a *StorageDatasetsAPIService) DatasetItemsGetExecute(r ApiDatasetItemsGetRequest) ([]map[string]interface{}, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []map[string]interface{} + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StorageDatasetsAPIService.DatasetItemsGet") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/datasets/{datasetId}/items" + localVarPath = strings.Replace(localVarPath, "{"+"datasetId"+"}", url.PathEscape(parameterValueToString(r.datasetId, "datasetId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.format != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "format", r.format, "form", "") + } + if r.clean != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "clean", r.clean, "form", "") + } + if r.offset != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "form", "") + } + if r.limit != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "form", "") + } + if r.fields != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "fields", r.fields, "form", "") + } + if r.outputFields != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "outputFields", r.outputFields, "form", "") + } + if r.omit != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "omit", r.omit, "form", "") + } + if r.unwind != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "unwind", r.unwind, "form", "") + } + if r.flatten != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "flatten", r.flatten, "form", "") + } + if r.desc != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "desc", r.desc, "form", "") + } + if r.attachment != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "attachment", r.attachment, "form", "") + } + if r.delimiter != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "delimiter", r.delimiter, "form", "") + } + if r.bom != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "bom", r.bom, "form", "") + } + if r.xmlRoot != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "xmlRoot", r.xmlRoot, "form", "") + } + if r.xmlRow != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "xmlRow", r.xmlRow, "form", "") + } + if r.skipHeaderRow != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "skipHeaderRow", r.skipHeaderRow, "form", "") + } + if r.skipHidden != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "skipHidden", r.skipHidden, "form", "") + } + if r.skipEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "skipEmpty", r.skipEmpty, "form", "") + } + if r.simplified != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "simplified", r.simplified, "form", "") + } + if r.view != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "view", r.view, "form", "") + } + if r.skipFailedPages != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "skipFailedPages", r.skipFailedPages, "form", "") + } + if r.feedTitle != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "feedTitle", r.feedTitle, "form", "") + } + if r.feedDescription != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "feedDescription", r.feedDescription, "form", "") + } + if r.signature != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "signature", r.signature, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json", "application/jsonl", "text/csv", "text/html", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", "application/rss+xml", "application/xml"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDatasetItemsHeadRequest struct { + ctx context.Context + ApiService *StorageDatasetsAPIService + datasetId string + format *string + clean *bool + offset *float64 + limit *float64 + fields *string + outputFields *string + omit *string + unwind *string + flatten *string + desc *bool + attachment *bool + delimiter *string + bom *bool + xmlRoot *string + xmlRow *string + skipHeaderRow *bool + skipHidden *bool + skipEmpty *bool + simplified *bool + view *string + skipFailedPages *bool + feedTitle *string + feedDescription *string + signature *string +} + +// Format of the results, possible values are: `json`, `jsonl`, `csv`, `html`, `xlsx`, `xml` and `rss`. The default value is `json`. +func (r ApiDatasetItemsHeadRequest) Format(format string) ApiDatasetItemsHeadRequest { + r.format = &format + return r +} + +// If `true` or `1` then the API endpoint returns only non-empty items and skips hidden fields (i.e. fields starting with the # character). The `clean` parameter is just a shortcut for `skipHidden=true` and `skipEmpty=true` parameters. Note that since some objects might be skipped from the output, that the result might contain less items than the `limit` value. +func (r ApiDatasetItemsHeadRequest) Clean(clean bool) ApiDatasetItemsHeadRequest { + r.clean = &clean + return r +} + +// Number of items that should be skipped at the start. The default value is `0`. +func (r ApiDatasetItemsHeadRequest) Offset(offset float64) ApiDatasetItemsHeadRequest { + r.offset = &offset + return r +} + +// Maximum number of items to return. By default there is no limit. +func (r ApiDatasetItemsHeadRequest) Limit(limit float64) ApiDatasetItemsHeadRequest { + r.limit = &limit + return r +} + +// A comma-separated list of fields which should be picked from the items, only these fields will remain in the resulting record objects. Note that the fields in the outputted items are sorted the same way as they are specified in the `fields` query parameter. You can use this feature to effectively fix the output format. +func (r ApiDatasetItemsHeadRequest) Fields(fields string) ApiDatasetItemsHeadRequest { + r.fields = &fields + return r +} + +// A comma-separated list of output field names that positionally rename the fields specified in the `fields` parameter. For example, `?fields=headline,url&outputFields=title,link` renames `headline` to `title` and `url` to `link` in the output. The number of names in `outputFields` must match the number of names in `fields`. Requires the `fields` parameter to be specified as well. +func (r ApiDatasetItemsHeadRequest) OutputFields(outputFields string) ApiDatasetItemsHeadRequest { + r.outputFields = &outputFields + return r +} + +// A comma-separated list of fields which should be omitted from the items. +func (r ApiDatasetItemsHeadRequest) Omit(omit string) ApiDatasetItemsHeadRequest { + r.omit = &omit + return r +} + +// A comma-separated list of fields which should be unwound, in order which they should be processed. Each field should be either an array or an object. If the field is an array then every element of the array will become a separate record and merged with parent object. If the unwound field is an object then it is merged with the parent object. If the unwound field is missing or its value is neither an array nor an object and therefore cannot be merged with a parent object then the item gets preserved as it is. Note that the unwound items ignore the `desc` parameter. +func (r ApiDatasetItemsHeadRequest) Unwind(unwind string) ApiDatasetItemsHeadRequest { + r.unwind = &unwind + return r +} + +// A comma-separated list of fields which should transform nested objects into flat structures. For example, with `flatten=\"foo\"` the object `{\"foo\":{\"bar\": \"hello\"}}` is turned into `{\"foo.bar\": \"hello\"}`. The original object with properties is replaced with the flattened object. +func (r ApiDatasetItemsHeadRequest) Flatten(flatten string) ApiDatasetItemsHeadRequest { + r.flatten = &flatten + return r +} + +// By default, results are returned in the same order as they were stored. To reverse the order, set this parameter to `true` or `1`. +func (r ApiDatasetItemsHeadRequest) Desc(desc bool) ApiDatasetItemsHeadRequest { + r.desc = &desc + return r +} + +// If `true` or `1` then the response will define the `Content-Disposition: attachment` header, forcing a web browser to download the file rather than to display it. By default this header is not present. +func (r ApiDatasetItemsHeadRequest) Attachment(attachment bool) ApiDatasetItemsHeadRequest { + r.attachment = &attachment + return r +} + +// A delimiter character for CSV files, only used if `format=csv`. You might need to URL-encode the character (e.g. use `%09` for tab or `%3B` for semicolon). The default delimiter is a simple comma (`,`). +func (r ApiDatasetItemsHeadRequest) Delimiter(delimiter string) ApiDatasetItemsHeadRequest { + r.delimiter = &delimiter + return r +} + +// All text responses are encoded in UTF-8 encoding. By default, the `format=csv` files are prefixed with the UTF-8 Byte Order Mark (BOM), while `json`, `jsonl`, `xml`, `html` and `rss` files are not. If you want to override this default behavior, specify `bom=1` query parameter to include the BOM or `bom=0` to skip it. +func (r ApiDatasetItemsHeadRequest) Bom(bom bool) ApiDatasetItemsHeadRequest { + r.bom = &bom + return r +} + +// Overrides default root element name of `xml` output. By default the root element is `items`. +func (r ApiDatasetItemsHeadRequest) XmlRoot(xmlRoot string) ApiDatasetItemsHeadRequest { + r.xmlRoot = &xmlRoot + return r +} + +// Overrides default element name that wraps each page or page function result object in `xml` output. By default the element name is `item`. +func (r ApiDatasetItemsHeadRequest) XmlRow(xmlRow string) ApiDatasetItemsHeadRequest { + r.xmlRow = &xmlRow + return r +} + +// If `true` or `1` then header row in the `csv` format is skipped. +func (r ApiDatasetItemsHeadRequest) SkipHeaderRow(skipHeaderRow bool) ApiDatasetItemsHeadRequest { + r.skipHeaderRow = &skipHeaderRow + return r +} + +// If `true` or `1` then hidden fields are skipped from the output, i.e. fields starting with the `#` character. +func (r ApiDatasetItemsHeadRequest) SkipHidden(skipHidden bool) ApiDatasetItemsHeadRequest { + r.skipHidden = &skipHidden + return r +} + +// If `true` or `1` then empty items are skipped from the output. Note that if used, the results might contain less items than the limit value. +func (r ApiDatasetItemsHeadRequest) SkipEmpty(skipEmpty bool) ApiDatasetItemsHeadRequest { + r.skipEmpty = &skipEmpty + return r +} + +// If `true` or `1` then, the endpoint applies the `fields=url,pageFunctionResult,errorInfo` and `unwind=pageFunctionResult` query parameters. This feature is used to emulate simplified results provided by the legacy Apify Crawler product and it's not recommended to use it in new integrations. +func (r ApiDatasetItemsHeadRequest) Simplified(simplified bool) ApiDatasetItemsHeadRequest { + r.simplified = &simplified + return r +} + +// Defines the view configuration for dataset items based on the schema definition. This parameter determines how the data will be filtered and presented. For complete specification details, see the [dataset schema documentation](/platform/actors/development/actor-definition/dataset-schema). +func (r ApiDatasetItemsHeadRequest) View(view string) ApiDatasetItemsHeadRequest { + r.view = &view + return r +} + +// If `true` or `1` then, the all the items with errorInfo property will be skipped from the output. This feature is here to emulate functionality of API version 1 used for the legacy Apify Crawler product and it's not recommended to use it in new integrations. +func (r ApiDatasetItemsHeadRequest) SkipFailedPages(skipFailedPages bool) ApiDatasetItemsHeadRequest { + r.skipFailedPages = &skipFailedPages + return r +} + +// Overrides the auto-generated RSS channel `<title>` element. Only used when `format=rss`. If not provided, the title defaults to `Dataset <label>`. +func (r ApiDatasetItemsHeadRequest) FeedTitle(feedTitle string) ApiDatasetItemsHeadRequest { + r.feedTitle = &feedTitle + return r +} + +// Overrides the auto-generated RSS channel `<description>` element. Only used when `format=rss`. If not provided, the description defaults to `Items in dataset with id \"<datasetId>\".` +func (r ApiDatasetItemsHeadRequest) FeedDescription(feedDescription string) ApiDatasetItemsHeadRequest { + r.feedDescription = &feedDescription + return r +} + +// Signature used for the access. +func (r ApiDatasetItemsHeadRequest) Signature(signature string) ApiDatasetItemsHeadRequest { + r.signature = &signature + return r +} + +func (r ApiDatasetItemsHeadRequest) Execute() (*http.Response, error) { + return r.ApiService.DatasetItemsHeadExecute(r) +} + +/* +DatasetItemsHead Get dataset items headers + +Returns only the HTTP headers for the dataset items endpoint, without the response body. +This is useful to check pagination metadata or verify access without downloading the full dataset. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param datasetId Dataset ID or `username~dataset-name`. + @return ApiDatasetItemsHeadRequest +*/ +func (a *StorageDatasetsAPIService) DatasetItemsHead(ctx context.Context, datasetId string) ApiDatasetItemsHeadRequest { + return ApiDatasetItemsHeadRequest{ + ApiService: a, + ctx: ctx, + datasetId: datasetId, + } +} + +// Execute executes the request +func (a *StorageDatasetsAPIService) DatasetItemsHeadExecute(r ApiDatasetItemsHeadRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodHead + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StorageDatasetsAPIService.DatasetItemsHead") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/datasets/{datasetId}/items" + localVarPath = strings.Replace(localVarPath, "{"+"datasetId"+"}", url.PathEscape(parameterValueToString(r.datasetId, "datasetId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.format != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "format", r.format, "form", "") + } + if r.clean != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "clean", r.clean, "form", "") + } + if r.offset != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "form", "") + } + if r.limit != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "form", "") + } + if r.fields != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "fields", r.fields, "form", "") + } + if r.outputFields != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "outputFields", r.outputFields, "form", "") + } + if r.omit != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "omit", r.omit, "form", "") + } + if r.unwind != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "unwind", r.unwind, "form", "") + } + if r.flatten != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "flatten", r.flatten, "form", "") + } + if r.desc != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "desc", r.desc, "form", "") + } + if r.attachment != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "attachment", r.attachment, "form", "") + } + if r.delimiter != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "delimiter", r.delimiter, "form", "") + } + if r.bom != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "bom", r.bom, "form", "") + } + if r.xmlRoot != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "xmlRoot", r.xmlRoot, "form", "") + } + if r.xmlRow != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "xmlRow", r.xmlRow, "form", "") + } + if r.skipHeaderRow != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "skipHeaderRow", r.skipHeaderRow, "form", "") + } + if r.skipHidden != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "skipHidden", r.skipHidden, "form", "") + } + if r.skipEmpty != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "skipEmpty", r.skipEmpty, "form", "") + } + if r.simplified != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "simplified", r.simplified, "form", "") + } + if r.view != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "view", r.view, "form", "") + } + if r.skipFailedPages != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "skipFailedPages", r.skipFailedPages, "form", "") + } + if r.feedTitle != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "feedTitle", r.feedTitle, "form", "") + } + if r.feedDescription != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "feedDescription", r.feedDescription, "form", "") + } + if r.signature != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "signature", r.signature, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiDatasetItemsPostRequest struct { + ctx context.Context + ApiService *StorageDatasetsAPIService + datasetId string + actRunsLastDatasetItemsPostRequest *ActRunsLastDatasetItemsPostRequest +} + +// +func (r ApiDatasetItemsPostRequest) ActRunsLastDatasetItemsPostRequest(actRunsLastDatasetItemsPostRequest ActRunsLastDatasetItemsPostRequest) ApiDatasetItemsPostRequest { + r.actRunsLastDatasetItemsPostRequest = &actRunsLastDatasetItemsPostRequest + return r +} + +func (r ApiDatasetItemsPostRequest) Execute() (map[string]interface{}, *http.Response, error) { + return r.ApiService.DatasetItemsPostExecute(r) +} + +/* +DatasetItemsPost Store items + +Appends an item or an array of items to the end of the dataset. +The POST payload is a JSON object or a JSON array of objects to save into the dataset. + +If the data you attempt to store in the dataset is invalid (meaning any of the items received by the API fails the validation), the whole request is discarded and the API will return a response with status code 400. +For more information about dataset schema validation, see [Dataset schema](https://docs.apify.com/platform/actors/development/actor-definition/dataset-schema/validation). + +**IMPORTANT:** The limit of request payload size for the dataset is 5 MB. If the array exceeds the size, you'll need to split it into a number of smaller arrays. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param datasetId Dataset ID or `username~dataset-name`. + @return ApiDatasetItemsPostRequest +*/ +func (a *StorageDatasetsAPIService) DatasetItemsPost(ctx context.Context, datasetId string) ApiDatasetItemsPostRequest { + return ApiDatasetItemsPostRequest{ + ApiService: a, + ctx: ctx, + datasetId: datasetId, + } +} + +// Execute executes the request +// @return map[string]interface{} +func (a *StorageDatasetsAPIService) DatasetItemsPostExecute(r ApiDatasetItemsPostRequest) (map[string]interface{}, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue map[string]interface{} + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StorageDatasetsAPIService.DatasetItemsPost") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/datasets/{datasetId}/items" + localVarPath = strings.Replace(localVarPath, "{"+"datasetId"+"}", url.PathEscape(parameterValueToString(r.datasetId, "datasetId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.actRunsLastDatasetItemsPostRequest == nil { + return localVarReturnValue, nil, reportError("actRunsLastDatasetItemsPostRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.actRunsLastDatasetItemsPostRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ActRunsLastDatasetItemsPost400Response + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDatasetPutRequest struct { + ctx context.Context + ApiService *StorageDatasetsAPIService + datasetId string + updateDatasetRequest *UpdateDatasetRequest +} + +// +func (r ApiDatasetPutRequest) UpdateDatasetRequest(updateDatasetRequest UpdateDatasetRequest) ApiDatasetPutRequest { + r.updateDatasetRequest = &updateDatasetRequest + return r +} + +func (r ApiDatasetPutRequest) Execute() (*DatasetResponse, *http.Response, error) { + return r.ApiService.DatasetPutExecute(r) +} + +/* +DatasetPut Update dataset + +Updates a dataset's name and general resource access level using a value specified by a JSON object passed in the PUT payload. +The response is the updated dataset object, as returned by the [Get dataset](/api/v2/dataset-get) API endpoint. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param datasetId Dataset ID or `username~dataset-name`. + @return ApiDatasetPutRequest +*/ +func (a *StorageDatasetsAPIService) DatasetPut(ctx context.Context, datasetId string) ApiDatasetPutRequest { + return ApiDatasetPutRequest{ + ApiService: a, + ctx: ctx, + datasetId: datasetId, + } +} + +// Execute executes the request +// @return DatasetResponse +func (a *StorageDatasetsAPIService) DatasetPutExecute(r ApiDatasetPutRequest) (*DatasetResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *DatasetResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StorageDatasetsAPIService.DatasetPut") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/datasets/{datasetId}" + localVarPath = strings.Replace(localVarPath, "{"+"datasetId"+"}", url.PathEscape(parameterValueToString(r.datasetId, "datasetId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.updateDatasetRequest == nil { + return localVarReturnValue, nil, reportError("updateDatasetRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.updateDatasetRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 413 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 415 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDatasetStatisticsGetRequest struct { + ctx context.Context + ApiService *StorageDatasetsAPIService + datasetId string +} + +func (r ApiDatasetStatisticsGetRequest) Execute() (*DatasetStatisticsResponse, *http.Response, error) { + return r.ApiService.DatasetStatisticsGetExecute(r) +} + +/* +DatasetStatisticsGet Get dataset statistics + +Returns statistics for given dataset. + +Provides only [field statistics](https://docs.apify.com/platform/actors/development/actor-definition/dataset-schema/validation#dataset-field-statistics). + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param datasetId Dataset ID or `username~dataset-name`. + @return ApiDatasetStatisticsGetRequest +*/ +func (a *StorageDatasetsAPIService) DatasetStatisticsGet(ctx context.Context, datasetId string) ApiDatasetStatisticsGetRequest { + return ApiDatasetStatisticsGetRequest{ + ApiService: a, + ctx: ctx, + datasetId: datasetId, + } +} + +// Execute executes the request +// @return DatasetStatisticsResponse +func (a *StorageDatasetsAPIService) DatasetStatisticsGetExecute(r ApiDatasetStatisticsGetRequest) (*DatasetStatisticsResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *DatasetStatisticsResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StorageDatasetsAPIService.DatasetStatisticsGet") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/datasets/{datasetId}/statistics" + localVarPath = strings.Replace(localVarPath, "{"+"datasetId"+"}", url.PathEscape(parameterValueToString(r.datasetId, "datasetId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDatasetsGetRequest struct { + ctx context.Context + ApiService *StorageDatasetsAPIService + offset *float64 + limit *float64 + desc *bool + unnamed *bool + ownership *StorageOwnership +} + +// Number of items that should be skipped at the start. The default value is `0`. +func (r ApiDatasetsGetRequest) Offset(offset float64) ApiDatasetsGetRequest { + r.offset = &offset + return r +} + +// Maximum number of items to return. The default value as well as the maximum is `1000`. +func (r ApiDatasetsGetRequest) Limit(limit float64) ApiDatasetsGetRequest { + r.limit = &limit + return r +} + +// If `true` or `1` then the objects are sorted by the `createdAt` field in descending order. By default, they are sorted in ascending order. +func (r ApiDatasetsGetRequest) Desc(desc bool) ApiDatasetsGetRequest { + r.desc = &desc + return r +} + +// If `true` or `1` then all the storages are returned. By default, only named storages are returned. +func (r ApiDatasetsGetRequest) Unnamed(unnamed bool) ApiDatasetsGetRequest { + r.unnamed = &unnamed + return r +} + +// Filter by ownership. If this parameter is omitted, all accessible datasets are returned. - `ownedByMe`: Return only datasets owned by the user. - `sharedWithMe`: Return only datasets shared with the user by other users. +func (r ApiDatasetsGetRequest) Ownership(ownership StorageOwnership) ApiDatasetsGetRequest { + r.ownership = &ownership + return r +} + +func (r ApiDatasetsGetRequest) Execute() (*ListOfDatasetsResponse, *http.Response, error) { + return r.ApiService.DatasetsGetExecute(r) +} + +/* +DatasetsGet Get list of datasets + +Lists all of a user's datasets. + +The response is a JSON array of objects, +where each object contains basic information about one dataset. + +By default, the objects are sorted by the `createdAt` field in ascending +order, therefore you can use pagination to incrementally fetch all datasets while new +ones are still being created. To sort them in descending order, use `desc=1` +parameter. The endpoint supports pagination using `limit` and `offset` +parameters and it will not return more than 1000 array elements. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDatasetsGetRequest +*/ +func (a *StorageDatasetsAPIService) DatasetsGet(ctx context.Context) ApiDatasetsGetRequest { + return ApiDatasetsGetRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return ListOfDatasetsResponse +func (a *StorageDatasetsAPIService) DatasetsGetExecute(r ApiDatasetsGetRequest) (*ListOfDatasetsResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ListOfDatasetsResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StorageDatasetsAPIService.DatasetsGet") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/datasets" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.offset != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "form", "") + } + if r.limit != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "form", "") + } + if r.desc != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "desc", r.desc, "form", "") + } + if r.unnamed != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "unnamed", r.unnamed, "form", "") + } + if r.ownership != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ownership", r.ownership, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDatasetsPostRequest struct { + ctx context.Context + ApiService *StorageDatasetsAPIService + name *string +} + +// Custom unique name to easily identify the dataset in the future. +func (r ApiDatasetsPostRequest) Name(name string) ApiDatasetsPostRequest { + r.name = &name + return r +} + +func (r ApiDatasetsPostRequest) Execute() (*DatasetResponse, *http.Response, error) { + return r.ApiService.DatasetsPostExecute(r) +} + +/* +DatasetsPost Create dataset + +Creates a dataset and returns its object. +Keep in mind that data stored under unnamed dataset follows [data retention period](https://docs.apify.com/platform/storage#data-retention). +It creates a dataset with the given name if the parameter name is used. +If a dataset with the given name already exists then returns its object. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDatasetsPostRequest +*/ +func (a *StorageDatasetsAPIService) DatasetsPost(ctx context.Context) ApiDatasetsPostRequest { + return ApiDatasetsPostRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return DatasetResponse +func (a *StorageDatasetsAPIService) DatasetsPostExecute(r ApiDatasetsPostRequest) (*DatasetResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *DatasetResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StorageDatasetsAPIService.DatasetsPost") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/datasets" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.name != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", r.name, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/api_storage_key_value_stores.go b/api_storage_key_value_stores.go new file mode 100644 index 0000000..267a0b5 --- /dev/null +++ b/api_storage_key_value_stores.go @@ -0,0 +1,2470 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" + "strings" + "os" +) + + +// StorageKeyValueStoresAPIService StorageKeyValueStoresAPI service +type StorageKeyValueStoresAPIService service + +type ApiKeyValueStoreDeleteRequest struct { + ctx context.Context + ApiService *StorageKeyValueStoresAPIService + storeId string +} + +func (r ApiKeyValueStoreDeleteRequest) Execute() (*http.Response, error) { + return r.ApiService.KeyValueStoreDeleteExecute(r) +} + +/* +KeyValueStoreDelete Delete store + +Deletes a key-value store. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param storeId Key-value store ID or `username~store-name`. + @return ApiKeyValueStoreDeleteRequest +*/ +func (a *StorageKeyValueStoresAPIService) KeyValueStoreDelete(ctx context.Context, storeId string) ApiKeyValueStoreDeleteRequest { + return ApiKeyValueStoreDeleteRequest{ + ApiService: a, + ctx: ctx, + storeId: storeId, + } +} + +// Execute executes the request +func (a *StorageKeyValueStoresAPIService) KeyValueStoreDeleteExecute(r ApiKeyValueStoreDeleteRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StorageKeyValueStoresAPIService.KeyValueStoreDelete") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/key-value-stores/{storeId}" + localVarPath = strings.Replace(localVarPath, "{"+"storeId"+"}", url.PathEscape(parameterValueToString(r.storeId, "storeId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiKeyValueStoreGetRequest struct { + ctx context.Context + ApiService *StorageKeyValueStoresAPIService + storeId string +} + +func (r ApiKeyValueStoreGetRequest) Execute() (*KeyValueStoreResponse, *http.Response, error) { + return r.ApiService.KeyValueStoreGetExecute(r) +} + +/* +KeyValueStoreGet Get store + +Gets an object that contains all the details about a specific key-value +store. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param storeId Key-value store ID or `username~store-name`. + @return ApiKeyValueStoreGetRequest +*/ +func (a *StorageKeyValueStoresAPIService) KeyValueStoreGet(ctx context.Context, storeId string) ApiKeyValueStoreGetRequest { + return ApiKeyValueStoreGetRequest{ + ApiService: a, + ctx: ctx, + storeId: storeId, + } +} + +// Execute executes the request +// @return KeyValueStoreResponse +func (a *StorageKeyValueStoresAPIService) KeyValueStoreGetExecute(r ApiKeyValueStoreGetRequest) (*KeyValueStoreResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *KeyValueStoreResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StorageKeyValueStoresAPIService.KeyValueStoreGet") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/key-value-stores/{storeId}" + localVarPath = strings.Replace(localVarPath, "{"+"storeId"+"}", url.PathEscape(parameterValueToString(r.storeId, "storeId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiKeyValueStoreKeysGetRequest struct { + ctx context.Context + ApiService *StorageKeyValueStoresAPIService + storeId string + exclusiveStartKey *string + limit *float32 + collection *string + prefix *string + signature *string +} + +// All keys up to this one (including) are skipped from the result. +func (r ApiKeyValueStoreKeysGetRequest) ExclusiveStartKey(exclusiveStartKey string) ApiKeyValueStoreKeysGetRequest { + r.exclusiveStartKey = &exclusiveStartKey + return r +} + +// Number of keys to be returned. +func (r ApiKeyValueStoreKeysGetRequest) Limit(limit float32) ApiKeyValueStoreKeysGetRequest { + r.limit = &limit + return r +} + +// Limit the results to keys that belong to a specific collection from the key-value store schema. The key-value store need to have a schema defined for this parameter to work. +func (r ApiKeyValueStoreKeysGetRequest) Collection(collection string) ApiKeyValueStoreKeysGetRequest { + r.collection = &collection + return r +} + +// Limit the results to keys that start with a specific prefix. +func (r ApiKeyValueStoreKeysGetRequest) Prefix(prefix string) ApiKeyValueStoreKeysGetRequest { + r.prefix = &prefix + return r +} + +// Signature used for the access. +func (r ApiKeyValueStoreKeysGetRequest) Signature(signature string) ApiKeyValueStoreKeysGetRequest { + r.signature = &signature + return r +} + +func (r ApiKeyValueStoreKeysGetRequest) Execute() (*ListOfKeysResponse, *http.Response, error) { + return r.ApiService.KeyValueStoreKeysGetExecute(r) +} + +/* +KeyValueStoreKeysGet Get list of keys + +Returns a list of objects describing keys of a given key-value store, as +well as some information about the values (e.g. size). + +This endpoint is paginated using `exclusiveStartKey` and `limit` parameters +- see [Pagination](/api/v2#using-key) for more details. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param storeId Key-value store ID or `username~store-name`. + @return ApiKeyValueStoreKeysGetRequest +*/ +func (a *StorageKeyValueStoresAPIService) KeyValueStoreKeysGet(ctx context.Context, storeId string) ApiKeyValueStoreKeysGetRequest { + return ApiKeyValueStoreKeysGetRequest{ + ApiService: a, + ctx: ctx, + storeId: storeId, + } +} + +// Execute executes the request +// @return ListOfKeysResponse +func (a *StorageKeyValueStoresAPIService) KeyValueStoreKeysGetExecute(r ApiKeyValueStoreKeysGetRequest) (*ListOfKeysResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ListOfKeysResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StorageKeyValueStoresAPIService.KeyValueStoreKeysGet") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/key-value-stores/{storeId}/keys" + localVarPath = strings.Replace(localVarPath, "{"+"storeId"+"}", url.PathEscape(parameterValueToString(r.storeId, "storeId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.exclusiveStartKey != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "exclusiveStartKey", r.exclusiveStartKey, "form", "") + } + if r.limit != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "form", "") + } else { + var defaultValue float32 = 1000 + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", defaultValue, "form", "") + r.limit = &defaultValue + } + if r.collection != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "collection", r.collection, "form", "") + } + if r.prefix != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "prefix", r.prefix, "form", "") + } + if r.signature != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "signature", r.signature, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiKeyValueStorePutRequest struct { + ctx context.Context + ApiService *StorageKeyValueStoresAPIService + storeId string + updateStoreRequest *UpdateStoreRequest +} + +// +func (r ApiKeyValueStorePutRequest) UpdateStoreRequest(updateStoreRequest UpdateStoreRequest) ApiKeyValueStorePutRequest { + r.updateStoreRequest = &updateStoreRequest + return r +} + +func (r ApiKeyValueStorePutRequest) Execute() (*KeyValueStoreResponse, *http.Response, error) { + return r.ApiService.KeyValueStorePutExecute(r) +} + +/* +KeyValueStorePut Update store + +Updates a key-value store's name and general resource access level using a value specified by a JSON object +passed in the PUT payload. + +The response is the updated key-value store object, as returned by the [Get +store](#/reference/key-value-stores/store-object/get-store) API endpoint. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param storeId Key-value store ID or `username~store-name`. + @return ApiKeyValueStorePutRequest +*/ +func (a *StorageKeyValueStoresAPIService) KeyValueStorePut(ctx context.Context, storeId string) ApiKeyValueStorePutRequest { + return ApiKeyValueStorePutRequest{ + ApiService: a, + ctx: ctx, + storeId: storeId, + } +} + +// Execute executes the request +// @return KeyValueStoreResponse +func (a *StorageKeyValueStoresAPIService) KeyValueStorePutExecute(r ApiKeyValueStorePutRequest) (*KeyValueStoreResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *KeyValueStoreResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StorageKeyValueStoresAPIService.KeyValueStorePut") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/key-value-stores/{storeId}" + localVarPath = strings.Replace(localVarPath, "{"+"storeId"+"}", url.PathEscape(parameterValueToString(r.storeId, "storeId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.updateStoreRequest == nil { + return localVarReturnValue, nil, reportError("updateStoreRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.updateStoreRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 413 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 415 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiKeyValueStoreRecordDeleteRequest struct { + ctx context.Context + ApiService *StorageKeyValueStoresAPIService + storeId string + recordKey string +} + +func (r ApiKeyValueStoreRecordDeleteRequest) Execute() (*http.Response, error) { + return r.ApiService.KeyValueStoreRecordDeleteExecute(r) +} + +/* +KeyValueStoreRecordDelete Delete record + +Removes a record specified by a key from the key-value store. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param storeId Key-value store ID or `username~store-name`. + @param recordKey Key of the record. + @return ApiKeyValueStoreRecordDeleteRequest +*/ +func (a *StorageKeyValueStoresAPIService) KeyValueStoreRecordDelete(ctx context.Context, storeId string, recordKey string) ApiKeyValueStoreRecordDeleteRequest { + return ApiKeyValueStoreRecordDeleteRequest{ + ApiService: a, + ctx: ctx, + storeId: storeId, + recordKey: recordKey, + } +} + +// Execute executes the request +func (a *StorageKeyValueStoresAPIService) KeyValueStoreRecordDeleteExecute(r ApiKeyValueStoreRecordDeleteRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StorageKeyValueStoresAPIService.KeyValueStoreRecordDelete") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/key-value-stores/{storeId}/records/{recordKey}" + localVarPath = strings.Replace(localVarPath, "{"+"storeId"+"}", url.PathEscape(parameterValueToString(r.storeId, "storeId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"recordKey"+"}", url.PathEscape(parameterValueToString(r.recordKey, "recordKey")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiKeyValueStoreRecordGetRequest struct { + ctx context.Context + ApiService *StorageKeyValueStoresAPIService + storeId string + recordKey string + attachment *bool + signature *string +} + +// If `true` or `1`, the response will be served with `Content-Disposition: attachment` header, causing web browsers to offer downloading HTML records instead of displaying them. +func (r ApiKeyValueStoreRecordGetRequest) Attachment(attachment bool) ApiKeyValueStoreRecordGetRequest { + r.attachment = &attachment + return r +} + +// Signature used for the access. +func (r ApiKeyValueStoreRecordGetRequest) Signature(signature string) ApiKeyValueStoreRecordGetRequest { + r.signature = &signature + return r +} + +func (r ApiKeyValueStoreRecordGetRequest) Execute() (map[string]interface{}, *http.Response, error) { + return r.ApiService.KeyValueStoreRecordGetExecute(r) +} + +/* +KeyValueStoreRecordGet Get record + +Gets a value stored in the key-value store under a specific key. + +The response body has the same `Content-Encoding` header as it was set in +[Put record](#tag/Key-value-storesRecord/operation/keyValueStore_record_put). + +If the request does not define the `Accept-Encoding` HTTP header with the +right encoding, the record will be decompressed. + +Most HTTP clients support decompression by default. After using the HTTP +client with decompression support, the `Accept-Encoding` header is set by +the client and body is decompressed automatically. + +Please note that for security reasons, Apify API can perform small modifications +to HTML documents before they are served via this endpoint. To fetch the raw HTML +content without any modifications, use the `attachment` query parameter. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param storeId Key-value store ID or `username~store-name`. + @param recordKey Key of the record. + @return ApiKeyValueStoreRecordGetRequest +*/ +func (a *StorageKeyValueStoresAPIService) KeyValueStoreRecordGet(ctx context.Context, storeId string, recordKey string) ApiKeyValueStoreRecordGetRequest { + return ApiKeyValueStoreRecordGetRequest{ + ApiService: a, + ctx: ctx, + storeId: storeId, + recordKey: recordKey, + } +} + +// Execute executes the request +// @return map[string]interface{} +func (a *StorageKeyValueStoresAPIService) KeyValueStoreRecordGetExecute(r ApiKeyValueStoreRecordGetRequest) (map[string]interface{}, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue map[string]interface{} + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StorageKeyValueStoresAPIService.KeyValueStoreRecordGet") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/key-value-stores/{storeId}/records/{recordKey}" + localVarPath = strings.Replace(localVarPath, "{"+"storeId"+"}", url.PathEscape(parameterValueToString(r.storeId, "storeId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"recordKey"+"}", url.PathEscape(parameterValueToString(r.recordKey, "recordKey")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.attachment != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "attachment", r.attachment, "form", "") + } + if r.signature != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "signature", r.signature, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json", "*/*"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiKeyValueStoreRecordHeadRequest struct { + ctx context.Context + ApiService *StorageKeyValueStoresAPIService + storeId string + recordKey string +} + +func (r ApiKeyValueStoreRecordHeadRequest) Execute() (*http.Response, error) { + return r.ApiService.KeyValueStoreRecordHeadExecute(r) +} + +/* +KeyValueStoreRecordHead Check if a record exists + +Check if a value is stored in the key-value store under a specific key. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param storeId Key-value store ID or `username~store-name`. + @param recordKey Key of the record. + @return ApiKeyValueStoreRecordHeadRequest +*/ +func (a *StorageKeyValueStoresAPIService) KeyValueStoreRecordHead(ctx context.Context, storeId string, recordKey string) ApiKeyValueStoreRecordHeadRequest { + return ApiKeyValueStoreRecordHeadRequest{ + ApiService: a, + ctx: ctx, + storeId: storeId, + recordKey: recordKey, + } +} + +// Execute executes the request +func (a *StorageKeyValueStoresAPIService) KeyValueStoreRecordHeadExecute(r ApiKeyValueStoreRecordHeadRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodHead + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StorageKeyValueStoresAPIService.KeyValueStoreRecordHead") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/key-value-stores/{storeId}/records/{recordKey}" + localVarPath = strings.Replace(localVarPath, "{"+"storeId"+"}", url.PathEscape(parameterValueToString(r.storeId, "storeId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"recordKey"+"}", url.PathEscape(parameterValueToString(r.recordKey, "recordKey")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiKeyValueStoreRecordPostRequest struct { + ctx context.Context + ApiService *StorageKeyValueStoresAPIService + storeId string + recordKey string + requestBody *map[string]interface{} + contentEncoding *string +} + +// +func (r ApiKeyValueStoreRecordPostRequest) RequestBody(requestBody map[string]interface{}) ApiKeyValueStoreRecordPostRequest { + r.requestBody = &requestBody + return r +} + +// +func (r ApiKeyValueStoreRecordPostRequest) ContentEncoding(contentEncoding string) ApiKeyValueStoreRecordPostRequest { + r.contentEncoding = &contentEncoding + return r +} + +func (r ApiKeyValueStoreRecordPostRequest) Execute() (map[string]interface{}, *http.Response, error) { + return r.ApiService.KeyValueStoreRecordPostExecute(r) +} + +/* +KeyValueStoreRecordPost Store record (POST) + +Stores a value under a specific key to the key-value store. + +This endpoint is an alias for the [`PUT` record](#tag/Key-value-storesRecord/operation/keyValueStore_record_put) method and behaves identically. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param storeId Key-value store ID or `username~store-name`. + @param recordKey Key of the record. + @return ApiKeyValueStoreRecordPostRequest +*/ +func (a *StorageKeyValueStoresAPIService) KeyValueStoreRecordPost(ctx context.Context, storeId string, recordKey string) ApiKeyValueStoreRecordPostRequest { + return ApiKeyValueStoreRecordPostRequest{ + ApiService: a, + ctx: ctx, + storeId: storeId, + recordKey: recordKey, + } +} + +// Execute executes the request +// @return map[string]interface{} +func (a *StorageKeyValueStoresAPIService) KeyValueStoreRecordPostExecute(r ApiKeyValueStoreRecordPostRequest) (map[string]interface{}, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue map[string]interface{} + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StorageKeyValueStoresAPIService.KeyValueStoreRecordPost") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/key-value-stores/{storeId}/records/{recordKey}" + localVarPath = strings.Replace(localVarPath, "{"+"storeId"+"}", url.PathEscape(parameterValueToString(r.storeId, "storeId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"recordKey"+"}", url.PathEscape(parameterValueToString(r.recordKey, "recordKey")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.requestBody == nil { + return localVarReturnValue, nil, reportError("requestBody is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.contentEncoding != nil { + parameterAddToHeaderOrQuery(localVarHeaderParams, "Content-Encoding", r.contentEncoding, "simple", "") + } + // body params + localVarPostBody = r.requestBody + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 413 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 415 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiKeyValueStoreRecordPutRequest struct { + ctx context.Context + ApiService *StorageKeyValueStoresAPIService + storeId string + recordKey string + requestBody *map[string]interface{} + contentEncoding *string +} + +// +func (r ApiKeyValueStoreRecordPutRequest) RequestBody(requestBody map[string]interface{}) ApiKeyValueStoreRecordPutRequest { + r.requestBody = &requestBody + return r +} + +// +func (r ApiKeyValueStoreRecordPutRequest) ContentEncoding(contentEncoding string) ApiKeyValueStoreRecordPutRequest { + r.contentEncoding = &contentEncoding + return r +} + +func (r ApiKeyValueStoreRecordPutRequest) Execute() (map[string]interface{}, *http.Response, error) { + return r.ApiService.KeyValueStoreRecordPutExecute(r) +} + +/* +KeyValueStoreRecordPut Store record + +Stores a value under a specific key to the key-value store. + +The value is passed as the PUT payload and it is stored with a MIME content +type defined by the `Content-Type` header and with encoding defined by the +`Content-Encoding` header. + +To save bandwidth, storage, and speed up your upload, send the request +payload compressed with Gzip compression and add the `Content-Encoding: gzip` +header. It is possible to set up another compression type with `Content-Encoding` +request header. + +Below is a list of supported `Content-Encoding` types. + +* Gzip compression: `Content-Encoding: gzip` +* Deflate compression: `Content-Encoding: deflate` +* Brotli compression: `Content-Encoding: br` + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param storeId Key-value store ID or `username~store-name`. + @param recordKey Key of the record. + @return ApiKeyValueStoreRecordPutRequest +*/ +func (a *StorageKeyValueStoresAPIService) KeyValueStoreRecordPut(ctx context.Context, storeId string, recordKey string) ApiKeyValueStoreRecordPutRequest { + return ApiKeyValueStoreRecordPutRequest{ + ApiService: a, + ctx: ctx, + storeId: storeId, + recordKey: recordKey, + } +} + +// Execute executes the request +// @return map[string]interface{} +func (a *StorageKeyValueStoresAPIService) KeyValueStoreRecordPutExecute(r ApiKeyValueStoreRecordPutRequest) (map[string]interface{}, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue map[string]interface{} + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StorageKeyValueStoresAPIService.KeyValueStoreRecordPut") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/key-value-stores/{storeId}/records/{recordKey}" + localVarPath = strings.Replace(localVarPath, "{"+"storeId"+"}", url.PathEscape(parameterValueToString(r.storeId, "storeId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"recordKey"+"}", url.PathEscape(parameterValueToString(r.recordKey, "recordKey")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.requestBody == nil { + return localVarReturnValue, nil, reportError("requestBody is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.contentEncoding != nil { + parameterAddToHeaderOrQuery(localVarHeaderParams, "Content-Encoding", r.contentEncoding, "simple", "") + } + // body params + localVarPostBody = r.requestBody + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 413 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 415 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiKeyValueStoreRecordsGetRequest struct { + ctx context.Context + ApiService *StorageKeyValueStoresAPIService + storeId string + collection *string + prefix *string + signature *string +} + +// If specified, only records belonging to a specific collection from the key-value store schema. The key-value store need to have a schema defined for this parameter to work. +func (r ApiKeyValueStoreRecordsGetRequest) Collection(collection string) ApiKeyValueStoreRecordsGetRequest { + r.collection = &collection + return r +} + +// If specified, only records whose key starts with the given prefix are included in the archive. +func (r ApiKeyValueStoreRecordsGetRequest) Prefix(prefix string) ApiKeyValueStoreRecordsGetRequest { + r.prefix = &prefix + return r +} + +// Signature used for the access. +func (r ApiKeyValueStoreRecordsGetRequest) Signature(signature string) ApiKeyValueStoreRecordsGetRequest { + r.signature = &signature + return r +} + +func (r ApiKeyValueStoreRecordsGetRequest) Execute() (*os.File, *http.Response, error) { + return r.ApiService.KeyValueStoreRecordsGetExecute(r) +} + +/* +KeyValueStoreRecordsGet Download records + +Downloads all records from the key-value store as a ZIP archive. +Each record is stored as a separate file in the archive, with the filename equal to the record key. + +You can optionally filter the records by `collection` or `prefix` to download only a subset of the store. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param storeId Key-value store ID or `username~store-name`. + @return ApiKeyValueStoreRecordsGetRequest +*/ +func (a *StorageKeyValueStoresAPIService) KeyValueStoreRecordsGet(ctx context.Context, storeId string) ApiKeyValueStoreRecordsGetRequest { + return ApiKeyValueStoreRecordsGetRequest{ + ApiService: a, + ctx: ctx, + storeId: storeId, + } +} + +// Execute executes the request +// @return *os.File +func (a *StorageKeyValueStoresAPIService) KeyValueStoreRecordsGetExecute(r ApiKeyValueStoreRecordsGetRequest) (*os.File, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *os.File + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StorageKeyValueStoresAPIService.KeyValueStoreRecordsGet") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/key-value-stores/{storeId}/records" + localVarPath = strings.Replace(localVarPath, "{"+"storeId"+"}", url.PathEscape(parameterValueToString(r.storeId, "storeId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.collection != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "collection", r.collection, "form", "") + } + if r.prefix != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "prefix", r.prefix, "form", "") + } + if r.signature != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "signature", r.signature, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/zip", "application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiKeyValueStoresGetRequest struct { + ctx context.Context + ApiService *StorageKeyValueStoresAPIService + offset *float64 + limit *float64 + desc *bool + unnamed *bool + ownership *StorageOwnership +} + +// Number of items that should be skipped at the start. The default value is `0`. +func (r ApiKeyValueStoresGetRequest) Offset(offset float64) ApiKeyValueStoresGetRequest { + r.offset = &offset + return r +} + +// Maximum number of items to return. The default value as well as the maximum is `1000`. +func (r ApiKeyValueStoresGetRequest) Limit(limit float64) ApiKeyValueStoresGetRequest { + r.limit = &limit + return r +} + +// If `true` or `1` then the objects are sorted by the `createdAt` field in descending order. By default, they are sorted in ascending order. +func (r ApiKeyValueStoresGetRequest) Desc(desc bool) ApiKeyValueStoresGetRequest { + r.desc = &desc + return r +} + +// If `true` or `1` then all the storages are returned. By default, only named storages are returned. +func (r ApiKeyValueStoresGetRequest) Unnamed(unnamed bool) ApiKeyValueStoresGetRequest { + r.unnamed = &unnamed + return r +} + +// Filter by ownership. If this parameter is omitted, all accessible key-value stores are returned. - `ownedByMe`: Return only key-value stores owned by the user. - `sharedWithMe`: Return only key-value stores shared with the user by other users. +func (r ApiKeyValueStoresGetRequest) Ownership(ownership StorageOwnership) ApiKeyValueStoresGetRequest { + r.ownership = &ownership + return r +} + +func (r ApiKeyValueStoresGetRequest) Execute() (*ListOfKeyValueStoresResponse, *http.Response, error) { + return r.ApiService.KeyValueStoresGetExecute(r) +} + +/* +KeyValueStoresGet Get list of key-value stores + +Gets the list of key-value stores owned by the user. + +The response is a list of objects, where each objects contains a basic +information about a single key-value store. + +The endpoint supports pagination using the `limit` and `offset` parameters +and it will not return more than 1000 array elements. + +By default, the records are sorted by the `createdAt` field in ascending +order, therefore you can use pagination to incrementally fetch all key-value stores +while new ones are still being created. To sort the records in descending order, use +the `desc=1` parameter. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiKeyValueStoresGetRequest +*/ +func (a *StorageKeyValueStoresAPIService) KeyValueStoresGet(ctx context.Context) ApiKeyValueStoresGetRequest { + return ApiKeyValueStoresGetRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return ListOfKeyValueStoresResponse +func (a *StorageKeyValueStoresAPIService) KeyValueStoresGetExecute(r ApiKeyValueStoresGetRequest) (*ListOfKeyValueStoresResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ListOfKeyValueStoresResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StorageKeyValueStoresAPIService.KeyValueStoresGet") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/key-value-stores" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.offset != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "form", "") + } + if r.limit != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "form", "") + } + if r.desc != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "desc", r.desc, "form", "") + } + if r.unnamed != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "unnamed", r.unnamed, "form", "") + } + if r.ownership != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ownership", r.ownership, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiKeyValueStoresPostRequest struct { + ctx context.Context + ApiService *StorageKeyValueStoresAPIService + name *string +} + +// Custom unique name to easily identify the store in the future. +func (r ApiKeyValueStoresPostRequest) Name(name string) ApiKeyValueStoresPostRequest { + r.name = &name + return r +} + +func (r ApiKeyValueStoresPostRequest) Execute() (*KeyValueStoreResponse, *http.Response, error) { + return r.ApiService.KeyValueStoresPostExecute(r) +} + +/* +KeyValueStoresPost Create key-value store + +Creates a key-value store and returns its object. The response is the same +object as returned by the [Get store](#/reference/key-value-stores/store-object/get-store) +endpoint. + +Keep in mind that data stored under unnamed store follows [data retention +period](https://docs.apify.com/platform/storage#data-retention). + +It creates a store with the given name if the parameter name is used. +If there is another store with the same name, the endpoint does not create a +new one and returns the existing object instead. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiKeyValueStoresPostRequest +*/ +func (a *StorageKeyValueStoresAPIService) KeyValueStoresPost(ctx context.Context) ApiKeyValueStoresPostRequest { + return ApiKeyValueStoresPostRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return KeyValueStoreResponse +func (a *StorageKeyValueStoresAPIService) KeyValueStoresPostExecute(r ApiKeyValueStoresPostRequest) (*KeyValueStoreResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *KeyValueStoreResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StorageKeyValueStoresAPIService.KeyValueStoresPost") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/key-value-stores" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.name != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", r.name, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/api_storage_request_queues.go b/api_storage_request_queues.go new file mode 100644 index 0000000..7c25faa --- /dev/null +++ b/api_storage_request_queues.go @@ -0,0 +1,1503 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" + "strings" +) + + +// StorageRequestQueuesAPIService StorageRequestQueuesAPI service +type StorageRequestQueuesAPIService service + +type ApiRequestQueueDeleteRequest struct { + ctx context.Context + ApiService *StorageRequestQueuesAPIService + queueId string +} + +func (r ApiRequestQueueDeleteRequest) Execute() (*http.Response, error) { + return r.ApiService.RequestQueueDeleteExecute(r) +} + +/* +RequestQueueDelete Delete request queue + +Deletes given queue. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param queueId Queue ID or `username~queue-name`. + @return ApiRequestQueueDeleteRequest +*/ +func (a *StorageRequestQueuesAPIService) RequestQueueDelete(ctx context.Context, queueId string) ApiRequestQueueDeleteRequest { + return ApiRequestQueueDeleteRequest{ + ApiService: a, + ctx: ctx, + queueId: queueId, + } +} + +// Execute executes the request +func (a *StorageRequestQueuesAPIService) RequestQueueDeleteExecute(r ApiRequestQueueDeleteRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StorageRequestQueuesAPIService.RequestQueueDelete") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/request-queues/{queueId}" + localVarPath = strings.Replace(localVarPath, "{"+"queueId"+"}", url.PathEscape(parameterValueToString(r.queueId, "queueId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiRequestQueueGetRequest struct { + ctx context.Context + ApiService *StorageRequestQueuesAPIService + queueId string +} + +func (r ApiRequestQueueGetRequest) Execute() (*RequestQueueResponse, *http.Response, error) { + return r.ApiService.RequestQueueGetExecute(r) +} + +/* +RequestQueueGet Get request queue + +Returns queue object for given queue ID. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param queueId Queue ID or `username~queue-name`. + @return ApiRequestQueueGetRequest +*/ +func (a *StorageRequestQueuesAPIService) RequestQueueGet(ctx context.Context, queueId string) ApiRequestQueueGetRequest { + return ApiRequestQueueGetRequest{ + ApiService: a, + ctx: ctx, + queueId: queueId, + } +} + +// Execute executes the request +// @return RequestQueueResponse +func (a *StorageRequestQueuesAPIService) RequestQueueGetExecute(r ApiRequestQueueGetRequest) (*RequestQueueResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *RequestQueueResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StorageRequestQueuesAPIService.RequestQueueGet") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/request-queues/{queueId}" + localVarPath = strings.Replace(localVarPath, "{"+"queueId"+"}", url.PathEscape(parameterValueToString(r.queueId, "queueId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiRequestQueuePutRequest struct { + ctx context.Context + ApiService *StorageRequestQueuesAPIService + queueId string + updateRequestQueueRequest *UpdateRequestQueueRequest +} + +// +func (r ApiRequestQueuePutRequest) UpdateRequestQueueRequest(updateRequestQueueRequest UpdateRequestQueueRequest) ApiRequestQueuePutRequest { + r.updateRequestQueueRequest = &updateRequestQueueRequest + return r +} + +func (r ApiRequestQueuePutRequest) Execute() (*RequestQueueResponse, *http.Response, error) { + return r.ApiService.RequestQueuePutExecute(r) +} + +/* +RequestQueuePut Update request queue + +Updates a request queue's name and general resource access level using a value specified by a JSON object +passed in the PUT payload. + +The response is the updated request queue object, as returned by the +[Get request queue](#/reference/request-queues/queue-collection/get-request-queue) API endpoint. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param queueId Queue ID or `username~queue-name`. + @return ApiRequestQueuePutRequest +*/ +func (a *StorageRequestQueuesAPIService) RequestQueuePut(ctx context.Context, queueId string) ApiRequestQueuePutRequest { + return ApiRequestQueuePutRequest{ + ApiService: a, + ctx: ctx, + queueId: queueId, + } +} + +// Execute executes the request +// @return RequestQueueResponse +func (a *StorageRequestQueuesAPIService) RequestQueuePutExecute(r ApiRequestQueuePutRequest) (*RequestQueueResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *RequestQueueResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StorageRequestQueuesAPIService.RequestQueuePut") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/request-queues/{queueId}" + localVarPath = strings.Replace(localVarPath, "{"+"queueId"+"}", url.PathEscape(parameterValueToString(r.queueId, "queueId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.updateRequestQueueRequest == nil { + return localVarReturnValue, nil, reportError("updateRequestQueueRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.updateRequestQueueRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 413 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 415 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiRequestQueueRequestsBatchDeleteRequest struct { + ctx context.Context + ApiService *StorageRequestQueuesAPIService + queueId string + contentType *string + requestDraftDelete *[]RequestDraftDelete + clientKey *string +} + +// +func (r ApiRequestQueueRequestsBatchDeleteRequest) ContentType(contentType string) ApiRequestQueueRequestsBatchDeleteRequest { + r.contentType = &contentType + return r +} + +// +func (r ApiRequestQueueRequestsBatchDeleteRequest) RequestDraftDelete(requestDraftDelete []RequestDraftDelete) ApiRequestQueueRequestsBatchDeleteRequest { + r.requestDraftDelete = &requestDraftDelete + return r +} + +// A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. +func (r ApiRequestQueueRequestsBatchDeleteRequest) ClientKey(clientKey string) ApiRequestQueueRequestsBatchDeleteRequest { + r.clientKey = &clientKey + return r +} + +func (r ApiRequestQueueRequestsBatchDeleteRequest) Execute() (*BatchDeleteResponse, *http.Response, error) { + return r.ApiService.RequestQueueRequestsBatchDeleteExecute(r) +} + +/* +RequestQueueRequestsBatchDelete Delete requests + +Batch-deletes given requests from the queue. The number of requests in a +batch is limited to 25. The response contains an array of unprocessed and +processed requests. +If any delete operation fails because the request queue rate limit is +exceeded or an internal failure occurs, +the failed request is returned in the `unprocessedRequests` response +parameter. +You can re-send these delete requests. It is recommended to use an +exponential backoff algorithm for these retries. +Each request is identified by its ID or uniqueKey parameter. You can use +either of them to identify the request. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param queueId Queue ID or `username~queue-name`. + @return ApiRequestQueueRequestsBatchDeleteRequest +*/ +func (a *StorageRequestQueuesAPIService) RequestQueueRequestsBatchDelete(ctx context.Context, queueId string) ApiRequestQueueRequestsBatchDeleteRequest { + return ApiRequestQueueRequestsBatchDeleteRequest{ + ApiService: a, + ctx: ctx, + queueId: queueId, + } +} + +// Execute executes the request +// @return BatchDeleteResponse +func (a *StorageRequestQueuesAPIService) RequestQueueRequestsBatchDeleteExecute(r ApiRequestQueueRequestsBatchDeleteRequest) (*BatchDeleteResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *BatchDeleteResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StorageRequestQueuesAPIService.RequestQueueRequestsBatchDelete") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/request-queues/{queueId}/requests/batch" + localVarPath = strings.Replace(localVarPath, "{"+"queueId"+"}", url.PathEscape(parameterValueToString(r.queueId, "queueId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.contentType == nil { + return localVarReturnValue, nil, reportError("contentType is required and must be specified") + } + if r.requestDraftDelete == nil { + return localVarReturnValue, nil, reportError("requestDraftDelete is required and must be specified") + } + + if r.clientKey != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "clientKey", r.clientKey, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + parameterAddToHeaderOrQuery(localVarHeaderParams, "Content-Type", r.contentType, "simple", "") + // body params + localVarPostBody = r.requestDraftDelete + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 413 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 415 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiRequestQueueRequestsBatchPostRequest struct { + ctx context.Context + ApiService *StorageRequestQueuesAPIService + queueId string + requestBase *[]RequestBase + clientKey *string + forefront *string +} + +// +func (r ApiRequestQueueRequestsBatchPostRequest) RequestBase(requestBase []RequestBase) ApiRequestQueueRequestsBatchPostRequest { + r.requestBase = &requestBase + return r +} + +// A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. +func (r ApiRequestQueueRequestsBatchPostRequest) ClientKey(clientKey string) ApiRequestQueueRequestsBatchPostRequest { + r.clientKey = &clientKey + return r +} + +// Determines if request should be added to the head of the queue or to the end. Default value is `false` (end of queue). +func (r ApiRequestQueueRequestsBatchPostRequest) Forefront(forefront string) ApiRequestQueueRequestsBatchPostRequest { + r.forefront = &forefront + return r +} + +func (r ApiRequestQueueRequestsBatchPostRequest) Execute() (*BatchAddResponse, *http.Response, error) { + return r.ApiService.RequestQueueRequestsBatchPostExecute(r) +} + +/* +RequestQueueRequestsBatchPost Add requests + +Adds requests to the queue in batch. The maximum requests in batch is limited +to 25. The response contains an array of unprocessed and processed requests. +If any add operation fails because the request queue rate limit is exceeded +or an internal failure occurs, +the failed request is returned in the unprocessedRequests response +parameter. +You can resend these requests to add. It is recommended to use an +exponential backoff algorithm for these retries. +If a request with the same `uniqueKey` was already present in the queue, +then it returns an ID of the existing request. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param queueId Queue ID or `username~queue-name`. + @return ApiRequestQueueRequestsBatchPostRequest +*/ +func (a *StorageRequestQueuesAPIService) RequestQueueRequestsBatchPost(ctx context.Context, queueId string) ApiRequestQueueRequestsBatchPostRequest { + return ApiRequestQueueRequestsBatchPostRequest{ + ApiService: a, + ctx: ctx, + queueId: queueId, + } +} + +// Execute executes the request +// @return BatchAddResponse +func (a *StorageRequestQueuesAPIService) RequestQueueRequestsBatchPostExecute(r ApiRequestQueueRequestsBatchPostRequest) (*BatchAddResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *BatchAddResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StorageRequestQueuesAPIService.RequestQueueRequestsBatchPost") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/request-queues/{queueId}/requests/batch" + localVarPath = strings.Replace(localVarPath, "{"+"queueId"+"}", url.PathEscape(parameterValueToString(r.queueId, "queueId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.requestBase == nil { + return localVarReturnValue, nil, reportError("requestBase is required and must be specified") + } + + if r.clientKey != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "clientKey", r.clientKey, "form", "") + } + if r.forefront != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "forefront", r.forefront, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.requestBase + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 413 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 415 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiRequestQueuesGetRequest struct { + ctx context.Context + ApiService *StorageRequestQueuesAPIService + offset *float64 + limit *float64 + desc *bool + unnamed *bool + ownership *StorageOwnership +} + +// Number of items that should be skipped at the start. The default value is `0`. +func (r ApiRequestQueuesGetRequest) Offset(offset float64) ApiRequestQueuesGetRequest { + r.offset = &offset + return r +} + +// Maximum number of items to return. The default value as well as the maximum is `1000`. +func (r ApiRequestQueuesGetRequest) Limit(limit float64) ApiRequestQueuesGetRequest { + r.limit = &limit + return r +} + +// If `true` or `1` then the objects are sorted by the `createdAt` field in descending order. By default, they are sorted in ascending order. +func (r ApiRequestQueuesGetRequest) Desc(desc bool) ApiRequestQueuesGetRequest { + r.desc = &desc + return r +} + +// If `true` or `1` then all the storages are returned. By default, only named storages are returned. +func (r ApiRequestQueuesGetRequest) Unnamed(unnamed bool) ApiRequestQueuesGetRequest { + r.unnamed = &unnamed + return r +} + +// Filter by ownership. If this parameter is omitted, all accessible request queues are returned. - `ownedByMe`: Return only request queues owned by the user. - `sharedWithMe`: Return only request queues shared with the user by other users. +func (r ApiRequestQueuesGetRequest) Ownership(ownership StorageOwnership) ApiRequestQueuesGetRequest { + r.ownership = &ownership + return r +} + +func (r ApiRequestQueuesGetRequest) Execute() (*ListOfRequestQueuesResponse, *http.Response, error) { + return r.ApiService.RequestQueuesGetExecute(r) +} + +/* +RequestQueuesGet Get list of request queues + +Lists all of a user's request queues. The response is a JSON array of +objects, where each object +contains basic information about one queue. + +By default, the objects are sorted by the `createdAt` field in ascending order, +therefore you can use pagination to incrementally fetch all queues while new +ones are still being created. To sort them in descending order, use `desc=1` +parameter. The endpoint supports pagination using `limit` and `offset` +parameters and it will not return more than 1000 +array elements. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiRequestQueuesGetRequest +*/ +func (a *StorageRequestQueuesAPIService) RequestQueuesGet(ctx context.Context) ApiRequestQueuesGetRequest { + return ApiRequestQueuesGetRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return ListOfRequestQueuesResponse +func (a *StorageRequestQueuesAPIService) RequestQueuesGetExecute(r ApiRequestQueuesGetRequest) (*ListOfRequestQueuesResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ListOfRequestQueuesResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StorageRequestQueuesAPIService.RequestQueuesGet") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/request-queues" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.offset != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "form", "") + } + if r.limit != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "form", "") + } + if r.desc != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "desc", r.desc, "form", "") + } + if r.unnamed != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "unnamed", r.unnamed, "form", "") + } + if r.ownership != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ownership", r.ownership, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiRequestQueuesPostRequest struct { + ctx context.Context + ApiService *StorageRequestQueuesAPIService + name *string +} + +// Custom unique name to easily identify the queue in the future. +func (r ApiRequestQueuesPostRequest) Name(name string) ApiRequestQueuesPostRequest { + r.name = &name + return r +} + +func (r ApiRequestQueuesPostRequest) Execute() (*RequestQueueResponse, *http.Response, error) { + return r.ApiService.RequestQueuesPostExecute(r) +} + +/* +RequestQueuesPost Create request queue + +Creates a request queue and returns its object. +Keep in mind that requests stored under unnamed queue follows [data +retention period](https://docs.apify.com/platform/storage#data-retention). + +It creates a queue of given name if the parameter name is used. If a queue +with the given name already exists then the endpoint returns +its object. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiRequestQueuesPostRequest +*/ +func (a *StorageRequestQueuesAPIService) RequestQueuesPost(ctx context.Context) ApiRequestQueuesPostRequest { + return ApiRequestQueuesPostRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return RequestQueueResponse +func (a *StorageRequestQueuesAPIService) RequestQueuesPostExecute(r ApiRequestQueuesPostRequest) (*RequestQueueResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *RequestQueueResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StorageRequestQueuesAPIService.RequestQueuesPost") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/request-queues" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.name != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", r.name, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/api_storage_request_queues_requests.go b/api_storage_request_queues_requests.go new file mode 100644 index 0000000..55d4054 --- /dev/null +++ b/api_storage_request_queues_requests.go @@ -0,0 +1,1114 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" + "strings" +) + + +// StorageRequestQueuesRequestsAPIService StorageRequestQueuesRequestsAPI service +type StorageRequestQueuesRequestsAPIService service + +type ApiRequestQueueRequestDeleteRequest struct { + ctx context.Context + ApiService *StorageRequestQueuesRequestsAPIService + queueId string + requestId string + clientKey *string +} + +// A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. +func (r ApiRequestQueueRequestDeleteRequest) ClientKey(clientKey string) ApiRequestQueueRequestDeleteRequest { + r.clientKey = &clientKey + return r +} + +func (r ApiRequestQueueRequestDeleteRequest) Execute() (*http.Response, error) { + return r.ApiService.RequestQueueRequestDeleteExecute(r) +} + +/* +RequestQueueRequestDelete Delete request + +Deletes given request from queue. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param queueId Queue ID or `username~queue-name`. + @param requestId Request ID. + @return ApiRequestQueueRequestDeleteRequest +*/ +func (a *StorageRequestQueuesRequestsAPIService) RequestQueueRequestDelete(ctx context.Context, queueId string, requestId string) ApiRequestQueueRequestDeleteRequest { + return ApiRequestQueueRequestDeleteRequest{ + ApiService: a, + ctx: ctx, + queueId: queueId, + requestId: requestId, + } +} + +// Execute executes the request +func (a *StorageRequestQueuesRequestsAPIService) RequestQueueRequestDeleteExecute(r ApiRequestQueueRequestDeleteRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StorageRequestQueuesRequestsAPIService.RequestQueueRequestDelete") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/request-queues/{queueId}/requests/{requestId}" + localVarPath = strings.Replace(localVarPath, "{"+"queueId"+"}", url.PathEscape(parameterValueToString(r.queueId, "queueId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"requestId"+"}", url.PathEscape(parameterValueToString(r.requestId, "requestId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.clientKey != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "clientKey", r.clientKey, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiRequestQueueRequestGetRequest struct { + ctx context.Context + ApiService *StorageRequestQueuesRequestsAPIService + queueId string + requestId string +} + +func (r ApiRequestQueueRequestGetRequest) Execute() (*RequestResponse, *http.Response, error) { + return r.ApiService.RequestQueueRequestGetExecute(r) +} + +/* +RequestQueueRequestGet Get request + +Returns request from queue. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param queueId Queue ID or `username~queue-name`. + @param requestId Request ID. + @return ApiRequestQueueRequestGetRequest +*/ +func (a *StorageRequestQueuesRequestsAPIService) RequestQueueRequestGet(ctx context.Context, queueId string, requestId string) ApiRequestQueueRequestGetRequest { + return ApiRequestQueueRequestGetRequest{ + ApiService: a, + ctx: ctx, + queueId: queueId, + requestId: requestId, + } +} + +// Execute executes the request +// @return RequestResponse +func (a *StorageRequestQueuesRequestsAPIService) RequestQueueRequestGetExecute(r ApiRequestQueueRequestGetRequest) (*RequestResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *RequestResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StorageRequestQueuesRequestsAPIService.RequestQueueRequestGet") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/request-queues/{queueId}/requests/{requestId}" + localVarPath = strings.Replace(localVarPath, "{"+"queueId"+"}", url.PathEscape(parameterValueToString(r.queueId, "queueId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"requestId"+"}", url.PathEscape(parameterValueToString(r.requestId, "requestId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiRequestQueueRequestPutRequest struct { + ctx context.Context + ApiService *StorageRequestQueuesRequestsAPIService + queueId string + requestId string + request *Request + forefront *string + clientKey *string +} + +// +func (r ApiRequestQueueRequestPutRequest) Request(request Request) ApiRequestQueueRequestPutRequest { + r.request = &request + return r +} + +// Determines if request should be added to the head of the queue or to the end. Default value is `false` (end of queue). +func (r ApiRequestQueueRequestPutRequest) Forefront(forefront string) ApiRequestQueueRequestPutRequest { + r.forefront = &forefront + return r +} + +// A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. +func (r ApiRequestQueueRequestPutRequest) ClientKey(clientKey string) ApiRequestQueueRequestPutRequest { + r.clientKey = &clientKey + return r +} + +func (r ApiRequestQueueRequestPutRequest) Execute() (*UpdateRequestResponse, *http.Response, error) { + return r.ApiService.RequestQueueRequestPutExecute(r) +} + +/* +RequestQueueRequestPut Update request + +Updates a request in a queue. Mark request as handled by setting +`request.handledAt = new Date()`. +If `handledAt` is set, the request will be removed from head of the queue (and unlocked, if applicable). + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param queueId Queue ID or `username~queue-name`. + @param requestId Request ID. + @return ApiRequestQueueRequestPutRequest +*/ +func (a *StorageRequestQueuesRequestsAPIService) RequestQueueRequestPut(ctx context.Context, queueId string, requestId string) ApiRequestQueueRequestPutRequest { + return ApiRequestQueueRequestPutRequest{ + ApiService: a, + ctx: ctx, + queueId: queueId, + requestId: requestId, + } +} + +// Execute executes the request +// @return UpdateRequestResponse +func (a *StorageRequestQueuesRequestsAPIService) RequestQueueRequestPutExecute(r ApiRequestQueueRequestPutRequest) (*UpdateRequestResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *UpdateRequestResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StorageRequestQueuesRequestsAPIService.RequestQueueRequestPut") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/request-queues/{queueId}/requests/{requestId}" + localVarPath = strings.Replace(localVarPath, "{"+"queueId"+"}", url.PathEscape(parameterValueToString(r.queueId, "queueId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"requestId"+"}", url.PathEscape(parameterValueToString(r.requestId, "requestId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.request == nil { + return localVarReturnValue, nil, reportError("request is required and must be specified") + } + + if r.forefront != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "forefront", r.forefront, "form", "") + } + if r.clientKey != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "clientKey", r.clientKey, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.request + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 413 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 415 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiRequestQueueRequestsGetRequest struct { + ctx context.Context + ApiService *StorageRequestQueuesRequestsAPIService + queueId string + clientKey *string + exclusiveStartId *string + limit *float64 + cursor *string + filter *[]string +} + +// A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. +func (r ApiRequestQueueRequestsGetRequest) ClientKey(clientKey string) ApiRequestQueueRequestsGetRequest { + r.clientKey = &clientKey + return r +} + +// All requests up to this one (including) are skipped from the result. (Deprecated, use `cursor` instead.) +// Deprecated +func (r ApiRequestQueueRequestsGetRequest) ExclusiveStartId(exclusiveStartId string) ApiRequestQueueRequestsGetRequest { + r.exclusiveStartId = &exclusiveStartId + return r +} + +// Number of keys to be returned. Maximum value is `10000`. +func (r ApiRequestQueueRequestsGetRequest) Limit(limit float64) ApiRequestQueueRequestsGetRequest { + r.limit = &limit + return r +} + +// A cursor string for pagination, returned in the previous response as `nextCursor`. Use this to retrieve the next page of requests. +func (r ApiRequestQueueRequestsGetRequest) Cursor(cursor string) ApiRequestQueueRequestsGetRequest { + r.cursor = &cursor + return r +} + +// Filter requests by their state. Possible values are `locked` and `pending`. You can combine multiple values separated by commas, which will mean the union of these filters – requests matching any of the specified states will be returned. (Not compatible with deprecated `exclusiveStartId` parameter.) +func (r ApiRequestQueueRequestsGetRequest) Filter(filter []string) ApiRequestQueueRequestsGetRequest { + r.filter = &filter + return r +} + +func (r ApiRequestQueueRequestsGetRequest) Execute() (*ListOfRequestsResponse, *http.Response, error) { + return r.ApiService.RequestQueueRequestsGetExecute(r) +} + +/* +RequestQueueRequestsGet List requests + +Returns a list of requests. This endpoint is paginated using +cursor (pagination by `exclusiveStartId` is deprecated) and limit parameters. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param queueId Queue ID or `username~queue-name`. + @return ApiRequestQueueRequestsGetRequest +*/ +func (a *StorageRequestQueuesRequestsAPIService) RequestQueueRequestsGet(ctx context.Context, queueId string) ApiRequestQueueRequestsGetRequest { + return ApiRequestQueueRequestsGetRequest{ + ApiService: a, + ctx: ctx, + queueId: queueId, + } +} + +// Execute executes the request +// @return ListOfRequestsResponse +func (a *StorageRequestQueuesRequestsAPIService) RequestQueueRequestsGetExecute(r ApiRequestQueueRequestsGetRequest) (*ListOfRequestsResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ListOfRequestsResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StorageRequestQueuesRequestsAPIService.RequestQueueRequestsGet") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/request-queues/{queueId}/requests" + localVarPath = strings.Replace(localVarPath, "{"+"queueId"+"}", url.PathEscape(parameterValueToString(r.queueId, "queueId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.clientKey != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "clientKey", r.clientKey, "form", "") + } + if r.exclusiveStartId != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "exclusiveStartId", r.exclusiveStartId, "form", "") + } + if r.limit != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "form", "") + } + if r.cursor != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "cursor", r.cursor, "form", "") + } + if r.filter != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "filter", r.filter, "form", "csv") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiRequestQueueRequestsPostRequest struct { + ctx context.Context + ApiService *StorageRequestQueuesRequestsAPIService + queueId string + requestBase *RequestBase + clientKey *string + forefront *string +} + +// +func (r ApiRequestQueueRequestsPostRequest) RequestBase(requestBase RequestBase) ApiRequestQueueRequestsPostRequest { + r.requestBase = &requestBase + return r +} + +// A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. +func (r ApiRequestQueueRequestsPostRequest) ClientKey(clientKey string) ApiRequestQueueRequestsPostRequest { + r.clientKey = &clientKey + return r +} + +// Determines if request should be added to the head of the queue or to the end. Default value is `false` (end of queue). +func (r ApiRequestQueueRequestsPostRequest) Forefront(forefront string) ApiRequestQueueRequestsPostRequest { + r.forefront = &forefront + return r +} + +func (r ApiRequestQueueRequestsPostRequest) Execute() (*AddRequestResponse, *http.Response, error) { + return r.ApiService.RequestQueueRequestsPostExecute(r) +} + +/* +RequestQueueRequestsPost Add request + +Adds request to the queue. Response contains ID of the request and info if +request was already present in the queue or handled. + +If request with same `uniqueKey` was already present in the queue then +returns an ID of existing request. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param queueId Queue ID or `username~queue-name`. + @return ApiRequestQueueRequestsPostRequest +*/ +func (a *StorageRequestQueuesRequestsAPIService) RequestQueueRequestsPost(ctx context.Context, queueId string) ApiRequestQueueRequestsPostRequest { + return ApiRequestQueueRequestsPostRequest{ + ApiService: a, + ctx: ctx, + queueId: queueId, + } +} + +// Execute executes the request +// @return AddRequestResponse +func (a *StorageRequestQueuesRequestsAPIService) RequestQueueRequestsPostExecute(r ApiRequestQueueRequestsPostRequest) (*AddRequestResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *AddRequestResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StorageRequestQueuesRequestsAPIService.RequestQueueRequestsPost") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/request-queues/{queueId}/requests" + localVarPath = strings.Replace(localVarPath, "{"+"queueId"+"}", url.PathEscape(parameterValueToString(r.queueId, "queueId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.requestBase == nil { + return localVarReturnValue, nil, reportError("requestBase is required and must be specified") + } + + if r.clientKey != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "clientKey", r.clientKey, "form", "") + } + if r.forefront != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "forefront", r.forefront, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.requestBase + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 413 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 415 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/api_storage_request_queues_requests_locks.go b/api_storage_request_queues_requests_locks.go new file mode 100644 index 0000000..b5df458 --- /dev/null +++ b/api_storage_request_queues_requests_locks.go @@ -0,0 +1,1076 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" + "strings" +) + + +// StorageRequestQueuesRequestsLocksAPIService StorageRequestQueuesRequestsLocksAPI service +type StorageRequestQueuesRequestsLocksAPIService service + +type ApiRequestQueueHeadGetRequest struct { + ctx context.Context + ApiService *StorageRequestQueuesRequestsLocksAPIService + queueId string + limit *float64 + clientKey *string +} + +// How many items from queue should be returned. +func (r ApiRequestQueueHeadGetRequest) Limit(limit float64) ApiRequestQueueHeadGetRequest { + r.limit = &limit + return r +} + +// A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. +func (r ApiRequestQueueHeadGetRequest) ClientKey(clientKey string) ApiRequestQueueHeadGetRequest { + r.clientKey = &clientKey + return r +} + +func (r ApiRequestQueueHeadGetRequest) Execute() (*HeadResponse, *http.Response, error) { + return r.ApiService.RequestQueueHeadGetExecute(r) +} + +/* +RequestQueueHeadGet Get head + +Returns given number of first requests from the queue. + +The response contains the `hadMultipleClients` boolean field which indicates +that the queue was accessed by more than one client (with unique or empty +`clientKey`). +This field is used by [Apify SDK](https://sdk.apify.com) to determine +whether the local cache is consistent with the request queue, and thus +optimize performance of certain operations. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param queueId Queue ID or `username~queue-name`. + @return ApiRequestQueueHeadGetRequest +*/ +func (a *StorageRequestQueuesRequestsLocksAPIService) RequestQueueHeadGet(ctx context.Context, queueId string) ApiRequestQueueHeadGetRequest { + return ApiRequestQueueHeadGetRequest{ + ApiService: a, + ctx: ctx, + queueId: queueId, + } +} + +// Execute executes the request +// @return HeadResponse +func (a *StorageRequestQueuesRequestsLocksAPIService) RequestQueueHeadGetExecute(r ApiRequestQueueHeadGetRequest) (*HeadResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *HeadResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StorageRequestQueuesRequestsLocksAPIService.RequestQueueHeadGet") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/request-queues/{queueId}/head" + localVarPath = strings.Replace(localVarPath, "{"+"queueId"+"}", url.PathEscape(parameterValueToString(r.queueId, "queueId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.limit != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "form", "") + } + if r.clientKey != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "clientKey", r.clientKey, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiRequestQueueHeadLockPostRequest struct { + ctx context.Context + ApiService *StorageRequestQueuesRequestsLocksAPIService + queueId string + lockSecs *float64 + limit *float64 + clientKey *string +} + +// How long the requests will be locked for (in seconds). +func (r ApiRequestQueueHeadLockPostRequest) LockSecs(lockSecs float64) ApiRequestQueueHeadLockPostRequest { + r.lockSecs = &lockSecs + return r +} + +// How many items from the queue should be returned. +func (r ApiRequestQueueHeadLockPostRequest) Limit(limit float64) ApiRequestQueueHeadLockPostRequest { + r.limit = &limit + return r +} + +// A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. +func (r ApiRequestQueueHeadLockPostRequest) ClientKey(clientKey string) ApiRequestQueueHeadLockPostRequest { + r.clientKey = &clientKey + return r +} + +func (r ApiRequestQueueHeadLockPostRequest) Execute() (*HeadAndLockResponse, *http.Response, error) { + return r.ApiService.RequestQueueHeadLockPostExecute(r) +} + +/* +RequestQueueHeadLockPost Get head and lock + +Returns the given number of first requests from the queue and locks them for +the given time. + +If this endpoint locks the request, no other client or run will be able to get and +lock these requests. + +The response contains the `hadMultipleClients` boolean field which indicates +that the queue was accessed by more than one client (with unique or empty +`clientKey`). + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param queueId Queue ID or `username~queue-name`. + @return ApiRequestQueueHeadLockPostRequest +*/ +func (a *StorageRequestQueuesRequestsLocksAPIService) RequestQueueHeadLockPost(ctx context.Context, queueId string) ApiRequestQueueHeadLockPostRequest { + return ApiRequestQueueHeadLockPostRequest{ + ApiService: a, + ctx: ctx, + queueId: queueId, + } +} + +// Execute executes the request +// @return HeadAndLockResponse +func (a *StorageRequestQueuesRequestsLocksAPIService) RequestQueueHeadLockPostExecute(r ApiRequestQueueHeadLockPostRequest) (*HeadAndLockResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *HeadAndLockResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StorageRequestQueuesRequestsLocksAPIService.RequestQueueHeadLockPost") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/request-queues/{queueId}/head/lock" + localVarPath = strings.Replace(localVarPath, "{"+"queueId"+"}", url.PathEscape(parameterValueToString(r.queueId, "queueId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.lockSecs == nil { + return localVarReturnValue, nil, reportError("lockSecs is required and must be specified") + } + + parameterAddToHeaderOrQuery(localVarQueryParams, "lockSecs", r.lockSecs, "form", "") + if r.limit != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "form", "") + } + if r.clientKey != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "clientKey", r.clientKey, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiRequestQueueRequestLockDeleteRequest struct { + ctx context.Context + ApiService *StorageRequestQueuesRequestsLocksAPIService + queueId string + requestId string + clientKey *string + forefront *string +} + +// A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. +func (r ApiRequestQueueRequestLockDeleteRequest) ClientKey(clientKey string) ApiRequestQueueRequestLockDeleteRequest { + r.clientKey = &clientKey + return r +} + +// Determines if request should be added to the head of the queue or to the end after lock was removed. +func (r ApiRequestQueueRequestLockDeleteRequest) Forefront(forefront string) ApiRequestQueueRequestLockDeleteRequest { + r.forefront = &forefront + return r +} + +func (r ApiRequestQueueRequestLockDeleteRequest) Execute() (*http.Response, error) { + return r.ApiService.RequestQueueRequestLockDeleteExecute(r) +} + +/* +RequestQueueRequestLockDelete Delete request lock + +Deletes a request lock. The request lock can be deleted only by the client +that has locked it using [Get and lock head +operation](#/request-queue-head-lock-post). + +The clientKey identifier is used for locking and unlocking requests. +You can delete or prolong the lock only for requests that were locked by the same client key or from the same Actor run. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param queueId Queue ID or `username~queue-name`. + @param requestId Request ID. + @return ApiRequestQueueRequestLockDeleteRequest +*/ +func (a *StorageRequestQueuesRequestsLocksAPIService) RequestQueueRequestLockDelete(ctx context.Context, queueId string, requestId string) ApiRequestQueueRequestLockDeleteRequest { + return ApiRequestQueueRequestLockDeleteRequest{ + ApiService: a, + ctx: ctx, + queueId: queueId, + requestId: requestId, + } +} + +// Execute executes the request +func (a *StorageRequestQueuesRequestsLocksAPIService) RequestQueueRequestLockDeleteExecute(r ApiRequestQueueRequestLockDeleteRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StorageRequestQueuesRequestsLocksAPIService.RequestQueueRequestLockDelete") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/request-queues/{queueId}/requests/{requestId}/lock" + localVarPath = strings.Replace(localVarPath, "{"+"queueId"+"}", url.PathEscape(parameterValueToString(r.queueId, "queueId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"requestId"+"}", url.PathEscape(parameterValueToString(r.requestId, "requestId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.clientKey != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "clientKey", r.clientKey, "form", "") + } + if r.forefront != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "forefront", r.forefront, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiRequestQueueRequestLockPutRequest struct { + ctx context.Context + ApiService *StorageRequestQueuesRequestsLocksAPIService + queueId string + requestId string + lockSecs *float64 + clientKey *string + forefront *string +} + +// How long the requests will be locked for (in seconds). +func (r ApiRequestQueueRequestLockPutRequest) LockSecs(lockSecs float64) ApiRequestQueueRequestLockPutRequest { + r.lockSecs = &lockSecs + return r +} + +// A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. +func (r ApiRequestQueueRequestLockPutRequest) ClientKey(clientKey string) ApiRequestQueueRequestLockPutRequest { + r.clientKey = &clientKey + return r +} + +// Determines if request should be added to the head of the queue or to the end after lock expires. +func (r ApiRequestQueueRequestLockPutRequest) Forefront(forefront string) ApiRequestQueueRequestLockPutRequest { + r.forefront = &forefront + return r +} + +func (r ApiRequestQueueRequestLockPutRequest) Execute() (*ProlongRequestLockResponse, *http.Response, error) { + return r.ApiService.RequestQueueRequestLockPutExecute(r) +} + +/* +RequestQueueRequestLockPut Prolong request lock + +Prolongs request lock. The request lock can be prolonged only by the client +that has locked it using [Get and lock head +operation](#/request-queue-head-lock-post). + +The clientKey identifier is used for locking and unlocking requests. +You can delete or prolong the lock only for requests that were locked by the same client key or from the same Actor run. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param queueId Queue ID or `username~queue-name`. + @param requestId Request ID. + @return ApiRequestQueueRequestLockPutRequest +*/ +func (a *StorageRequestQueuesRequestsLocksAPIService) RequestQueueRequestLockPut(ctx context.Context, queueId string, requestId string) ApiRequestQueueRequestLockPutRequest { + return ApiRequestQueueRequestLockPutRequest{ + ApiService: a, + ctx: ctx, + queueId: queueId, + requestId: requestId, + } +} + +// Execute executes the request +// @return ProlongRequestLockResponse +func (a *StorageRequestQueuesRequestsLocksAPIService) RequestQueueRequestLockPutExecute(r ApiRequestQueueRequestLockPutRequest) (*ProlongRequestLockResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ProlongRequestLockResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StorageRequestQueuesRequestsLocksAPIService.RequestQueueRequestLockPut") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/request-queues/{queueId}/requests/{requestId}/lock" + localVarPath = strings.Replace(localVarPath, "{"+"queueId"+"}", url.PathEscape(parameterValueToString(r.queueId, "queueId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"requestId"+"}", url.PathEscape(parameterValueToString(r.requestId, "requestId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.lockSecs == nil { + return localVarReturnValue, nil, reportError("lockSecs is required and must be specified") + } + + parameterAddToHeaderOrQuery(localVarQueryParams, "lockSecs", r.lockSecs, "form", "") + if r.clientKey != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "clientKey", r.clientKey, "form", "") + } + if r.forefront != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "forefront", r.forefront, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiRequestQueueRequestsUnlockPostRequest struct { + ctx context.Context + ApiService *StorageRequestQueuesRequestsLocksAPIService + queueId string + clientKey *string +} + +// A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. +func (r ApiRequestQueueRequestsUnlockPostRequest) ClientKey(clientKey string) ApiRequestQueueRequestsUnlockPostRequest { + r.clientKey = &clientKey + return r +} + +func (r ApiRequestQueueRequestsUnlockPostRequest) Execute() (*UnlockRequestsResponse, *http.Response, error) { + return r.ApiService.RequestQueueRequestsUnlockPostExecute(r) +} + +/* +RequestQueueRequestsUnlockPost Unlock requests + +Unlocks requests in the queue that are currently locked by the client. + +* If the client is within an Actor run, it unlocks all requests locked by that specific run plus all requests locked by the same clientKey. +* If the client is outside of an Actor run, it unlocks all requests locked using the same clientKey. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param queueId Queue ID or `username~queue-name`. + @return ApiRequestQueueRequestsUnlockPostRequest +*/ +func (a *StorageRequestQueuesRequestsLocksAPIService) RequestQueueRequestsUnlockPost(ctx context.Context, queueId string) ApiRequestQueueRequestsUnlockPostRequest { + return ApiRequestQueueRequestsUnlockPostRequest{ + ApiService: a, + ctx: ctx, + queueId: queueId, + } +} + +// Execute executes the request +// @return UnlockRequestsResponse +func (a *StorageRequestQueuesRequestsLocksAPIService) RequestQueueRequestsUnlockPostExecute(r ApiRequestQueueRequestsUnlockPostRequest) (*UnlockRequestsResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *UnlockRequestsResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StorageRequestQueuesRequestsLocksAPIService.RequestQueueRequestsUnlockPost") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/request-queues/{queueId}/requests/unlock" + localVarPath = strings.Replace(localVarPath, "{"+"queueId"+"}", url.PathEscape(parameterValueToString(r.queueId, "queueId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.clientKey != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "clientKey", r.clientKey, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/api_store.go b/api_store.go new file mode 100644 index 0000000..c910bd6 --- /dev/null +++ b/api_store.go @@ -0,0 +1,284 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" +) + + +// StoreAPIService StoreAPI service +type StoreAPIService service + +type ApiStoreGetRequest struct { + ctx context.Context + ApiService *StoreAPIService + limit *float64 + offset *float64 + search *string + sortBy *string + category *string + username *string + pricingModel *string + allowsAgenticUsers *bool + responseFormat *string + includeUnrunnableActors *bool +} + +// Maximum number of items to return. The default value as well as the maximum is `1000`. +func (r ApiStoreGetRequest) Limit(limit float64) ApiStoreGetRequest { + r.limit = &limit + return r +} + +// Number of items that should be skipped at the start. The default value is `0`. +func (r ApiStoreGetRequest) Offset(offset float64) ApiStoreGetRequest { + r.offset = &offset + return r +} + +// String to search by. The search runs on the following fields: `title`, `name`, `description`, `username`, `readme`. +func (r ApiStoreGetRequest) Search(search string) ApiStoreGetRequest { + r.search = &search + return r +} + +// Specifies the field by which to sort the results. The supported values are `relevance` (default), `popularity`, `newest` and `lastUpdate`. +func (r ApiStoreGetRequest) SortBy(sortBy string) ApiStoreGetRequest { + r.sortBy = &sortBy + return r +} + +// Filters the results by the specified category. +func (r ApiStoreGetRequest) Category(category string) ApiStoreGetRequest { + r.category = &category + return r +} + +// Filters the results by the specified username. +func (r ApiStoreGetRequest) Username(username string) ApiStoreGetRequest { + r.username = &username + return r +} + +// Only return Actors with the specified pricing model. +func (r ApiStoreGetRequest) PricingModel(pricingModel string) ApiStoreGetRequest { + r.pricingModel = &pricingModel + return r +} + +// If true, only return Actors that allow agentic users. If false, only return Actors that do not allow agentic users. +func (r ApiStoreGetRequest) AllowsAgenticUsers(allowsAgenticUsers bool) ApiStoreGetRequest { + r.allowsAgenticUsers = &allowsAgenticUsers + return r +} + +// Controls the shape of the response. Use `full` (default) for the complete response including image URLs and all fields. Use `agent` for a reduced field set optimized for LLM consumers, which only includes `id`, `title`, `name`, `username`, `description`, `notice`, `badge`, `categories`, and minimal `stats`. +func (r ApiStoreGetRequest) ResponseFormat(responseFormat string) ApiStoreGetRequest { + r.responseFormat = &responseFormat + return r +} + +// By default, search results exclude Actors that are not safe to run automatically (e.g. Actors from developers who haven't passed KYC, or full-permission Actors without a large user base). Set to `true` to bypass this safety filtering and include all Actors in the results. +func (r ApiStoreGetRequest) IncludeUnrunnableActors(includeUnrunnableActors bool) ApiStoreGetRequest { + r.includeUnrunnableActors = &includeUnrunnableActors + return r +} + +func (r ApiStoreGetRequest) Execute() (*ListOfActorsInStoreResponse, *http.Response, error) { + return r.ApiService.StoreGetExecute(r) +} + +/* +StoreGet Get list of Actors in Store + +Gets the list of public Actors in Apify Store. You can use `search` +parameter to search Actors by string in title, name, description, username +and readme. +If you need detailed info about a specific Actor, use the [Get +Actor](#/reference/actors/actor-object/get-actor) endpoint. + +The endpoint supports pagination using the `limit` and `offset` parameters. +It will not return more than 1,000 records. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiStoreGetRequest +*/ +func (a *StoreAPIService) StoreGet(ctx context.Context) ApiStoreGetRequest { + return ApiStoreGetRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return ListOfActorsInStoreResponse +func (a *StoreAPIService) StoreGetExecute(r ApiStoreGetRequest) (*ListOfActorsInStoreResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ListOfActorsInStoreResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StoreAPIService.StoreGet") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/store" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.limit != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "form", "") + } + if r.offset != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "form", "") + } + if r.search != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "search", r.search, "form", "") + } + if r.sortBy != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "sortBy", r.sortBy, "form", "") + } + if r.category != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "category", r.category, "form", "") + } + if r.username != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "username", r.username, "form", "") + } + if r.pricingModel != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "pricingModel", r.pricingModel, "form", "") + } + if r.allowsAgenticUsers != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "allowsAgenticUsers", r.allowsAgenticUsers, "form", "") + } + if r.responseFormat != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "responseFormat", r.responseFormat, "form", "") + } else { + var defaultValue string = "full" + parameterAddToHeaderOrQuery(localVarQueryParams, "responseFormat", defaultValue, "form", "") + r.responseFormat = &defaultValue + } + if r.includeUnrunnableActors != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "includeUnrunnableActors", r.includeUnrunnableActors, "form", "") + } else { + var defaultValue bool = false + parameterAddToHeaderOrQuery(localVarQueryParams, "includeUnrunnableActors", defaultValue, "form", "") + r.includeUnrunnableActors = &defaultValue + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/api_tools.go b/api_tools.go new file mode 100644 index 0000000..8a19e58 --- /dev/null +++ b/api_tools.go @@ -0,0 +1,985 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" +) + + +// ToolsAPIService ToolsAPI service +type ToolsAPIService service + +type ApiToolsBrowserInfoDeleteRequest struct { + ctx context.Context + ApiService *ToolsAPIService + skipHeaders *bool + rawHeaders *bool +} + +// If `true` or `1`, the response omits the `headers` field. +func (r ApiToolsBrowserInfoDeleteRequest) SkipHeaders(skipHeaders bool) ApiToolsBrowserInfoDeleteRequest { + r.skipHeaders = &skipHeaders + return r +} + +// If `true` or `1`, the response includes the `rawHeaders` field with the raw request headers. +func (r ApiToolsBrowserInfoDeleteRequest) RawHeaders(rawHeaders bool) ApiToolsBrowserInfoDeleteRequest { + r.rawHeaders = &rawHeaders + return r +} + +func (r ApiToolsBrowserInfoDeleteRequest) Execute() (*BrowserInfoResponse, *http.Response, error) { + return r.ApiService.ToolsBrowserInfoDeleteExecute(r) +} + +/* +ToolsBrowserInfoDelete Get browser info + +Returns information about the HTTP request, including the client IP address, +country code, request headers, and body length. + +This endpoint is designed for proxy testing. It accepts any HTTP method so you +can verify that your proxy correctly forwards requests of any type and that +client IP addresses are anonymized. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiToolsBrowserInfoDeleteRequest +*/ +func (a *ToolsAPIService) ToolsBrowserInfoDelete(ctx context.Context) ApiToolsBrowserInfoDeleteRequest { + return ApiToolsBrowserInfoDeleteRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return BrowserInfoResponse +func (a *ToolsAPIService) ToolsBrowserInfoDeleteExecute(r ApiToolsBrowserInfoDeleteRequest) (*BrowserInfoResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *BrowserInfoResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ToolsAPIService.ToolsBrowserInfoDelete") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/browser-info" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.skipHeaders != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "skipHeaders", r.skipHeaders, "form", "") + } + if r.rawHeaders != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "rawHeaders", r.rawHeaders, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiToolsBrowserInfoGetRequest struct { + ctx context.Context + ApiService *ToolsAPIService + skipHeaders *bool + rawHeaders *bool +} + +// If `true` or `1`, the response omits the `headers` field. +func (r ApiToolsBrowserInfoGetRequest) SkipHeaders(skipHeaders bool) ApiToolsBrowserInfoGetRequest { + r.skipHeaders = &skipHeaders + return r +} + +// If `true` or `1`, the response includes the `rawHeaders` field with the raw request headers. +func (r ApiToolsBrowserInfoGetRequest) RawHeaders(rawHeaders bool) ApiToolsBrowserInfoGetRequest { + r.rawHeaders = &rawHeaders + return r +} + +func (r ApiToolsBrowserInfoGetRequest) Execute() (*BrowserInfoResponse, *http.Response, error) { + return r.ApiService.ToolsBrowserInfoGetExecute(r) +} + +/* +ToolsBrowserInfoGet Get browser info + +Returns information about the HTTP request, including the client IP address, +country code, request headers, and body length. + +This endpoint is designed for proxy testing. It accepts any HTTP method so you +can verify that your proxy correctly forwards requests of any type and that +client IP addresses are anonymized. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiToolsBrowserInfoGetRequest +*/ +func (a *ToolsAPIService) ToolsBrowserInfoGet(ctx context.Context) ApiToolsBrowserInfoGetRequest { + return ApiToolsBrowserInfoGetRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return BrowserInfoResponse +func (a *ToolsAPIService) ToolsBrowserInfoGetExecute(r ApiToolsBrowserInfoGetRequest) (*BrowserInfoResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *BrowserInfoResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ToolsAPIService.ToolsBrowserInfoGet") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/browser-info" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.skipHeaders != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "skipHeaders", r.skipHeaders, "form", "") + } + if r.rawHeaders != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "rawHeaders", r.rawHeaders, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiToolsBrowserInfoPostRequest struct { + ctx context.Context + ApiService *ToolsAPIService + skipHeaders *bool + rawHeaders *bool +} + +// If `true` or `1`, the response omits the `headers` field. +func (r ApiToolsBrowserInfoPostRequest) SkipHeaders(skipHeaders bool) ApiToolsBrowserInfoPostRequest { + r.skipHeaders = &skipHeaders + return r +} + +// If `true` or `1`, the response includes the `rawHeaders` field with the raw request headers. +func (r ApiToolsBrowserInfoPostRequest) RawHeaders(rawHeaders bool) ApiToolsBrowserInfoPostRequest { + r.rawHeaders = &rawHeaders + return r +} + +func (r ApiToolsBrowserInfoPostRequest) Execute() (*BrowserInfoResponse, *http.Response, error) { + return r.ApiService.ToolsBrowserInfoPostExecute(r) +} + +/* +ToolsBrowserInfoPost Get browser info + +Returns information about the HTTP request, including the client IP address, +country code, request headers, and body length. + +This endpoint is designed for proxy testing. It accepts any HTTP method so you +can verify that your proxy correctly forwards requests of any type and that +client IP addresses are anonymized. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiToolsBrowserInfoPostRequest +*/ +func (a *ToolsAPIService) ToolsBrowserInfoPost(ctx context.Context) ApiToolsBrowserInfoPostRequest { + return ApiToolsBrowserInfoPostRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return BrowserInfoResponse +func (a *ToolsAPIService) ToolsBrowserInfoPostExecute(r ApiToolsBrowserInfoPostRequest) (*BrowserInfoResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *BrowserInfoResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ToolsAPIService.ToolsBrowserInfoPost") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/browser-info" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.skipHeaders != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "skipHeaders", r.skipHeaders, "form", "") + } + if r.rawHeaders != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "rawHeaders", r.rawHeaders, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiToolsBrowserInfoPutRequest struct { + ctx context.Context + ApiService *ToolsAPIService + skipHeaders *bool + rawHeaders *bool +} + +// If `true` or `1`, the response omits the `headers` field. +func (r ApiToolsBrowserInfoPutRequest) SkipHeaders(skipHeaders bool) ApiToolsBrowserInfoPutRequest { + r.skipHeaders = &skipHeaders + return r +} + +// If `true` or `1`, the response includes the `rawHeaders` field with the raw request headers. +func (r ApiToolsBrowserInfoPutRequest) RawHeaders(rawHeaders bool) ApiToolsBrowserInfoPutRequest { + r.rawHeaders = &rawHeaders + return r +} + +func (r ApiToolsBrowserInfoPutRequest) Execute() (*BrowserInfoResponse, *http.Response, error) { + return r.ApiService.ToolsBrowserInfoPutExecute(r) +} + +/* +ToolsBrowserInfoPut Get browser info + +Returns information about the HTTP request, including the client IP address, +country code, request headers, and body length. + +This endpoint is designed for proxy testing. It accepts any HTTP method so you +can verify that your proxy correctly forwards requests of any type and that +client IP addresses are anonymized. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiToolsBrowserInfoPutRequest +*/ +func (a *ToolsAPIService) ToolsBrowserInfoPut(ctx context.Context) ApiToolsBrowserInfoPutRequest { + return ApiToolsBrowserInfoPutRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return BrowserInfoResponse +func (a *ToolsAPIService) ToolsBrowserInfoPutExecute(r ApiToolsBrowserInfoPutRequest) (*BrowserInfoResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *BrowserInfoResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ToolsAPIService.ToolsBrowserInfoPut") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/browser-info" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.skipHeaders != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "skipHeaders", r.skipHeaders, "form", "") + } + if r.rawHeaders != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "rawHeaders", r.rawHeaders, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiToolsDecodeAndVerifyPostRequest struct { + ctx context.Context + ApiService *ToolsAPIService + decodeAndVerifyRequest *DecodeAndVerifyRequest +} + +// +func (r ApiToolsDecodeAndVerifyPostRequest) DecodeAndVerifyRequest(decodeAndVerifyRequest DecodeAndVerifyRequest) ApiToolsDecodeAndVerifyPostRequest { + r.decodeAndVerifyRequest = &decodeAndVerifyRequest + return r +} + +func (r ApiToolsDecodeAndVerifyPostRequest) Execute() (*DecodeAndVerifyResponse, *http.Response, error) { + return r.ApiService.ToolsDecodeAndVerifyPostExecute(r) +} + +/* +ToolsDecodeAndVerifyPost Decode and verify object + +Decodes and verifies an encoded value previously created by the +encode-and-sign endpoint. Returns the original decoded object along with +information about the user who encoded it and whether that user is verified. + +**Important**: The request must specify the `Content-Type: application/json` +HTTP header. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiToolsDecodeAndVerifyPostRequest +*/ +func (a *ToolsAPIService) ToolsDecodeAndVerifyPost(ctx context.Context) ApiToolsDecodeAndVerifyPostRequest { + return ApiToolsDecodeAndVerifyPostRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return DecodeAndVerifyResponse +func (a *ToolsAPIService) ToolsDecodeAndVerifyPostExecute(r ApiToolsDecodeAndVerifyPostRequest) (*DecodeAndVerifyResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *DecodeAndVerifyResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ToolsAPIService.ToolsDecodeAndVerifyPost") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/tools/decode-and-verify" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.decodeAndVerifyRequest == nil { + return localVarReturnValue, nil, reportError("decodeAndVerifyRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.decodeAndVerifyRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 413 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 415 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiToolsEncodeAndSignPostRequest struct { + ctx context.Context + ApiService *ToolsAPIService + body *map[string]interface{} +} + +// +func (r ApiToolsEncodeAndSignPostRequest) Body(body map[string]interface{}) ApiToolsEncodeAndSignPostRequest { + r.body = &body + return r +} + +func (r ApiToolsEncodeAndSignPostRequest) Execute() (*EncodeAndSignResponse, *http.Response, error) { + return r.ApiService.ToolsEncodeAndSignPostExecute(r) +} + +/* +ToolsEncodeAndSignPost Encode and sign object + +Encodes and signs any JSON object. The encoded value includes a signature +tied to the authenticated user's ID, which can later be verified using the +decode-and-verify endpoint. + +**Important**: The request must specify the `Content-Type: application/json` +HTTP header. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiToolsEncodeAndSignPostRequest +*/ +func (a *ToolsAPIService) ToolsEncodeAndSignPost(ctx context.Context) ApiToolsEncodeAndSignPostRequest { + return ApiToolsEncodeAndSignPostRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return EncodeAndSignResponse +func (a *ToolsAPIService) ToolsEncodeAndSignPostExecute(r ApiToolsEncodeAndSignPostRequest) (*EncodeAndSignResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *EncodeAndSignResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ToolsAPIService.ToolsEncodeAndSignPost") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/tools/encode-and-sign" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.body == nil { + return localVarReturnValue, nil, reportError("body is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.body + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 413 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 415 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/api_users.go b/api_users.go new file mode 100644 index 0000000..37a9c05 --- /dev/null +++ b/api_users.go @@ -0,0 +1,915 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" + "strings" +) + + +// UsersAPIService UsersAPI service +type UsersAPIService service + +type ApiUserGetRequest struct { + ctx context.Context + ApiService *UsersAPIService + userId string +} + +func (r ApiUserGetRequest) Execute() (*PublicUserDataResponse, *http.Response, error) { + return r.ApiService.UserGetExecute(r) +} + +/* +UserGet Get public user data + +Returns public information about a specific user account, similar to what +can be seen on public profile pages (e.g. https://apify.com/apify). + +This operation requires no authentication token. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param userId User ID or username. + @return ApiUserGetRequest +*/ +func (a *UsersAPIService) UserGet(ctx context.Context, userId string) ApiUserGetRequest { + return ApiUserGetRequest{ + ApiService: a, + ctx: ctx, + userId: userId, + } +} + +// Execute executes the request +// @return PublicUserDataResponse +func (a *UsersAPIService) UserGetExecute(r ApiUserGetRequest) (*PublicUserDataResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PublicUserDataResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UsersAPIService.UserGet") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/users/{userId}" + localVarPath = strings.Replace(localVarPath, "{"+"userId"+"}", url.PathEscape(parameterValueToString(r.userId, "userId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiUsersMeGetRequest struct { + ctx context.Context + ApiService *UsersAPIService +} + +func (r ApiUsersMeGetRequest) Execute() (*PrivateUserDataResponse, *http.Response, error) { + return r.ApiService.UsersMeGetExecute(r) +} + +/* +UsersMeGet Get private user data + +Returns information about the current user account, including both public +and private information. + +The user account is identified by the provided authentication token. + +The fields `plan`, `email` and `profile` are omitted when this endpoint is accessed from Actor run. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiUsersMeGetRequest +*/ +func (a *UsersAPIService) UsersMeGet(ctx context.Context) ApiUsersMeGetRequest { + return ApiUsersMeGetRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return PrivateUserDataResponse +func (a *UsersAPIService) UsersMeGetExecute(r ApiUsersMeGetRequest) (*PrivateUserDataResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PrivateUserDataResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UsersAPIService.UsersMeGet") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/users/me" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiUsersMeLimitsGetRequest struct { + ctx context.Context + ApiService *UsersAPIService +} + +func (r ApiUsersMeLimitsGetRequest) Execute() (*LimitsResponse, *http.Response, error) { + return r.ApiService.UsersMeLimitsGetExecute(r) +} + +/* +UsersMeLimitsGet Get limits + +Returns a complete summary of your account's limits. It is the same +information you will see on your account's [Limits page](https://console.apify.com/billing#/limits). The returned data +includes the current usage cycle, a summary of your limits, and your current usage. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiUsersMeLimitsGetRequest +*/ +func (a *UsersAPIService) UsersMeLimitsGet(ctx context.Context) ApiUsersMeLimitsGetRequest { + return ApiUsersMeLimitsGetRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return LimitsResponse +func (a *UsersAPIService) UsersMeLimitsGetExecute(r ApiUsersMeLimitsGetRequest) (*LimitsResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *LimitsResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UsersAPIService.UsersMeLimitsGet") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/users/me/limits" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiUsersMeLimitsPutRequest struct { + ctx context.Context + ApiService *UsersAPIService + updateLimitsRequest *UpdateLimitsRequest +} + +// +func (r ApiUsersMeLimitsPutRequest) UpdateLimitsRequest(updateLimitsRequest UpdateLimitsRequest) ApiUsersMeLimitsPutRequest { + r.updateLimitsRequest = &updateLimitsRequest + return r +} + +func (r ApiUsersMeLimitsPutRequest) Execute() (map[string]interface{}, *http.Response, error) { + return r.ApiService.UsersMeLimitsPutExecute(r) +} + +/* +UsersMeLimitsPut Update limits + +Updates the account's limits manageable on your account's [Limits page](https://console.apify.com/billing#/limits). +Specifically the: `maxMonthlyUsageUsd` and `dataRetentionDays` limits (see request body schema for more details). + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiUsersMeLimitsPutRequest +*/ +func (a *UsersAPIService) UsersMeLimitsPut(ctx context.Context) ApiUsersMeLimitsPutRequest { + return ApiUsersMeLimitsPutRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return map[string]interface{} +func (a *UsersAPIService) UsersMeLimitsPutExecute(r ApiUsersMeLimitsPutRequest) (map[string]interface{}, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue map[string]interface{} + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UsersAPIService.UsersMeLimitsPut") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/users/me/limits" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.updateLimitsRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 413 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 415 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiUsersMeUsageMonthlyGetRequest struct { + ctx context.Context + ApiService *UsersAPIService + date *string +} + +// Date in the YYYY-MM-DD format. +func (r ApiUsersMeUsageMonthlyGetRequest) Date(date string) ApiUsersMeUsageMonthlyGetRequest { + r.date = &date + return r +} + +func (r ApiUsersMeUsageMonthlyGetRequest) Execute() (*MonthlyUsageResponse, *http.Response, error) { + return r.ApiService.UsersMeUsageMonthlyGetExecute(r) +} + +/* +UsersMeUsageMonthlyGet Get monthly usage + +Returns a complete summary of your usage for the current monthly usage cycle, +an overall sum, as well as a daily breakdown of usage. It is the same +information you will see on your account's [Billing > Historical usage page](https://console.apify.com/billing/historical-usage). The information +includes your use of Actors, compute, data transfer, and storage. + +Using the `date` parameter will show your usage in the monthly usage cycle that +includes that date. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiUsersMeUsageMonthlyGetRequest +*/ +func (a *UsersAPIService) UsersMeUsageMonthlyGet(ctx context.Context) ApiUsersMeUsageMonthlyGetRequest { + return ApiUsersMeUsageMonthlyGetRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return MonthlyUsageResponse +func (a *UsersAPIService) UsersMeUsageMonthlyGetExecute(r ApiUsersMeUsageMonthlyGetRequest) (*MonthlyUsageResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *MonthlyUsageResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UsersAPIService.UsersMeUsageMonthlyGet") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/users/me/usage/monthly" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.date != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "date", r.date, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/api_webhooks_webhook_dispatches.go b/api_webhooks_webhook_dispatches.go new file mode 100644 index 0000000..7a9924d --- /dev/null +++ b/api_webhooks_webhook_dispatches.go @@ -0,0 +1,410 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" + "strings" +) + + +// WebhooksWebhookDispatchesAPIService WebhooksWebhookDispatchesAPI service +type WebhooksWebhookDispatchesAPIService service + +type ApiWebhookDispatchGetRequest struct { + ctx context.Context + ApiService *WebhooksWebhookDispatchesAPIService + dispatchId string +} + +func (r ApiWebhookDispatchGetRequest) Execute() (*WebhookDispatchResponse, *http.Response, error) { + return r.ApiService.WebhookDispatchGetExecute(r) +} + +/* +WebhookDispatchGet Get webhook dispatch + +Gets webhook dispatch object with all details. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param dispatchId Webhook dispatch ID. + @return ApiWebhookDispatchGetRequest +*/ +func (a *WebhooksWebhookDispatchesAPIService) WebhookDispatchGet(ctx context.Context, dispatchId string) ApiWebhookDispatchGetRequest { + return ApiWebhookDispatchGetRequest{ + ApiService: a, + ctx: ctx, + dispatchId: dispatchId, + } +} + +// Execute executes the request +// @return WebhookDispatchResponse +func (a *WebhooksWebhookDispatchesAPIService) WebhookDispatchGetExecute(r ApiWebhookDispatchGetRequest) (*WebhookDispatchResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *WebhookDispatchResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "WebhooksWebhookDispatchesAPIService.WebhookDispatchGet") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/webhook-dispatches/{dispatchId}" + localVarPath = strings.Replace(localVarPath, "{"+"dispatchId"+"}", url.PathEscape(parameterValueToString(r.dispatchId, "dispatchId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiWebhookDispatchesGetRequest struct { + ctx context.Context + ApiService *WebhooksWebhookDispatchesAPIService + offset *float64 + limit *float64 + desc *bool +} + +// Number of items that should be skipped at the start. The default value is `0`. +func (r ApiWebhookDispatchesGetRequest) Offset(offset float64) ApiWebhookDispatchesGetRequest { + r.offset = &offset + return r +} + +// Maximum number of items to return. The default value as well as the maximum is `1000`. +func (r ApiWebhookDispatchesGetRequest) Limit(limit float64) ApiWebhookDispatchesGetRequest { + r.limit = &limit + return r +} + +// If `true` or `1` then the objects are sorted by the `createdAt` field in descending order. By default, they are sorted in ascending order. +func (r ApiWebhookDispatchesGetRequest) Desc(desc bool) ApiWebhookDispatchesGetRequest { + r.desc = &desc + return r +} + +func (r ApiWebhookDispatchesGetRequest) Execute() (*ListOfWebhookDispatchesResponse, *http.Response, error) { + return r.ApiService.WebhookDispatchesGetExecute(r) +} + +/* +WebhookDispatchesGet Get list of webhook dispatches + +Gets the list of webhook dispatches that the user have. + +The endpoint supports pagination using the `limit` and `offset` parameters +and it will not return more than 1000 records. +By default, the records are sorted by the `createdAt` field in ascending +order. To sort the records in descending order, use the `desc=1` +parameter. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiWebhookDispatchesGetRequest +*/ +func (a *WebhooksWebhookDispatchesAPIService) WebhookDispatchesGet(ctx context.Context) ApiWebhookDispatchesGetRequest { + return ApiWebhookDispatchesGetRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return ListOfWebhookDispatchesResponse +func (a *WebhooksWebhookDispatchesAPIService) WebhookDispatchesGetExecute(r ApiWebhookDispatchesGetRequest) (*ListOfWebhookDispatchesResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ListOfWebhookDispatchesResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "WebhooksWebhookDispatchesAPIService.WebhookDispatchesGet") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/webhook-dispatches" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.offset != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "form", "") + } + if r.limit != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "form", "") + } + if r.desc != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "desc", r.desc, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/api_webhooks_webhooks.go b/api_webhooks_webhooks.go new file mode 100644 index 0000000..38590df --- /dev/null +++ b/api_webhooks_webhooks.go @@ -0,0 +1,1437 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" + "strings" +) + + +// WebhooksWebhooksAPIService WebhooksWebhooksAPI service +type WebhooksWebhooksAPIService service + +type ApiWebhookDeleteRequest struct { + ctx context.Context + ApiService *WebhooksWebhooksAPIService + webhookId string +} + +func (r ApiWebhookDeleteRequest) Execute() (map[string]interface{}, *http.Response, error) { + return r.ApiService.WebhookDeleteExecute(r) +} + +/* +WebhookDelete Delete webhook + +Deletes a webhook. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param webhookId Webhook ID. + @return ApiWebhookDeleteRequest +*/ +func (a *WebhooksWebhooksAPIService) WebhookDelete(ctx context.Context, webhookId string) ApiWebhookDeleteRequest { + return ApiWebhookDeleteRequest{ + ApiService: a, + ctx: ctx, + webhookId: webhookId, + } +} + +// Execute executes the request +// @return map[string]interface{} +func (a *WebhooksWebhooksAPIService) WebhookDeleteExecute(r ApiWebhookDeleteRequest) (map[string]interface{}, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue map[string]interface{} + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "WebhooksWebhooksAPIService.WebhookDelete") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/webhooks/{webhookId}" + localVarPath = strings.Replace(localVarPath, "{"+"webhookId"+"}", url.PathEscape(parameterValueToString(r.webhookId, "webhookId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiWebhookGetRequest struct { + ctx context.Context + ApiService *WebhooksWebhooksAPIService + webhookId string +} + +func (r ApiWebhookGetRequest) Execute() (*WebhookResponse, *http.Response, error) { + return r.ApiService.WebhookGetExecute(r) +} + +/* +WebhookGet Get webhook + +Gets webhook object with all details. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param webhookId Webhook ID. + @return ApiWebhookGetRequest +*/ +func (a *WebhooksWebhooksAPIService) WebhookGet(ctx context.Context, webhookId string) ApiWebhookGetRequest { + return ApiWebhookGetRequest{ + ApiService: a, + ctx: ctx, + webhookId: webhookId, + } +} + +// Execute executes the request +// @return WebhookResponse +func (a *WebhooksWebhooksAPIService) WebhookGetExecute(r ApiWebhookGetRequest) (*WebhookResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *WebhookResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "WebhooksWebhooksAPIService.WebhookGet") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/webhooks/{webhookId}" + localVarPath = strings.Replace(localVarPath, "{"+"webhookId"+"}", url.PathEscape(parameterValueToString(r.webhookId, "webhookId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiWebhookPutRequest struct { + ctx context.Context + ApiService *WebhooksWebhooksAPIService + webhookId string + webhookUpdate *WebhookUpdate +} + +// +func (r ApiWebhookPutRequest) WebhookUpdate(webhookUpdate WebhookUpdate) ApiWebhookPutRequest { + r.webhookUpdate = &webhookUpdate + return r +} + +func (r ApiWebhookPutRequest) Execute() (*WebhookResponse, *http.Response, error) { + return r.ApiService.WebhookPutExecute(r) +} + +/* +WebhookPut Update webhook + +Updates a webhook using values specified by a webhook object passed as JSON +in the POST payload. +If the object does not define a specific property, its value will not be +updated. + +The response is the full webhook object as returned by the +[Get webhook](#/reference/webhooks/webhook-object/get-webhook) endpoint. + +The request needs to specify the `Content-Type: application/json` HTTP +header! + +When providing your API authentication token, we recommend using the +request's `Authorization` header, rather than the URL. ([More +info](#/introduction/authentication)). + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param webhookId Webhook ID. + @return ApiWebhookPutRequest +*/ +func (a *WebhooksWebhooksAPIService) WebhookPut(ctx context.Context, webhookId string) ApiWebhookPutRequest { + return ApiWebhookPutRequest{ + ApiService: a, + ctx: ctx, + webhookId: webhookId, + } +} + +// Execute executes the request +// @return WebhookResponse +func (a *WebhooksWebhooksAPIService) WebhookPutExecute(r ApiWebhookPutRequest) (*WebhookResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *WebhookResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "WebhooksWebhooksAPIService.WebhookPut") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/webhooks/{webhookId}" + localVarPath = strings.Replace(localVarPath, "{"+"webhookId"+"}", url.PathEscape(parameterValueToString(r.webhookId, "webhookId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.webhookUpdate == nil { + return localVarReturnValue, nil, reportError("webhookUpdate is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.webhookUpdate + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 413 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 415 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiWebhookTestPostRequest struct { + ctx context.Context + ApiService *WebhooksWebhooksAPIService + webhookId string +} + +func (r ApiWebhookTestPostRequest) Execute() (*TestWebhookResponse, *http.Response, error) { + return r.ApiService.WebhookTestPostExecute(r) +} + +/* +WebhookTestPost Test webhook + +Tests a webhook. Creates a webhook dispatch with a dummy payload. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param webhookId Webhook ID. + @return ApiWebhookTestPostRequest +*/ +func (a *WebhooksWebhooksAPIService) WebhookTestPost(ctx context.Context, webhookId string) ApiWebhookTestPostRequest { + return ApiWebhookTestPostRequest{ + ApiService: a, + ctx: ctx, + webhookId: webhookId, + } +} + +// Execute executes the request +// @return TestWebhookResponse +func (a *WebhooksWebhooksAPIService) WebhookTestPostExecute(r ApiWebhookTestPostRequest) (*TestWebhookResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *TestWebhookResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "WebhooksWebhooksAPIService.WebhookTestPost") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/webhooks/{webhookId}/test" + localVarPath = strings.Replace(localVarPath, "{"+"webhookId"+"}", url.PathEscape(parameterValueToString(r.webhookId, "webhookId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiWebhookWebhookDispatchesGetRequest struct { + ctx context.Context + ApiService *WebhooksWebhooksAPIService + webhookId string +} + +func (r ApiWebhookWebhookDispatchesGetRequest) Execute() (*ListOfWebhookDispatchesResponse, *http.Response, error) { + return r.ApiService.WebhookWebhookDispatchesGetExecute(r) +} + +/* +WebhookWebhookDispatchesGet Get collection + +Gets a given webhook's list of dispatches. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param webhookId Webhook ID. + @return ApiWebhookWebhookDispatchesGetRequest +*/ +func (a *WebhooksWebhooksAPIService) WebhookWebhookDispatchesGet(ctx context.Context, webhookId string) ApiWebhookWebhookDispatchesGetRequest { + return ApiWebhookWebhookDispatchesGetRequest{ + ApiService: a, + ctx: ctx, + webhookId: webhookId, + } +} + +// Execute executes the request +// @return ListOfWebhookDispatchesResponse +func (a *WebhooksWebhooksAPIService) WebhookWebhookDispatchesGetExecute(r ApiWebhookWebhookDispatchesGetRequest) (*ListOfWebhookDispatchesResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ListOfWebhookDispatchesResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "WebhooksWebhooksAPIService.WebhookWebhookDispatchesGet") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/webhooks/{webhookId}/dispatches" + localVarPath = strings.Replace(localVarPath, "{"+"webhookId"+"}", url.PathEscape(parameterValueToString(r.webhookId, "webhookId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiWebhooksGetRequest struct { + ctx context.Context + ApiService *WebhooksWebhooksAPIService + offset *float64 + limit *float64 + desc *bool +} + +// Number of items that should be skipped at the start. The default value is `0`. +func (r ApiWebhooksGetRequest) Offset(offset float64) ApiWebhooksGetRequest { + r.offset = &offset + return r +} + +// Maximum number of items to return. The default value as well as the maximum is `1000`. +func (r ApiWebhooksGetRequest) Limit(limit float64) ApiWebhooksGetRequest { + r.limit = &limit + return r +} + +// If `true` or `1` then the objects are sorted by the `createdAt` field in descending order. By default, they are sorted in ascending order. +func (r ApiWebhooksGetRequest) Desc(desc bool) ApiWebhooksGetRequest { + r.desc = &desc + return r +} + +func (r ApiWebhooksGetRequest) Execute() (*ListOfWebhooksResponse, *http.Response, error) { + return r.ApiService.WebhooksGetExecute(r) +} + +/* +WebhooksGet Get list of webhooks + +Gets the list of webhooks that the user created. + +The endpoint supports pagination using the `limit` and `offset` parameters +and it will not return more than 1000 records. +By default, the records are sorted by the `createdAt` field in ascending +order. To sort the records in descending order, use the `desc=1` +parameter. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiWebhooksGetRequest +*/ +func (a *WebhooksWebhooksAPIService) WebhooksGet(ctx context.Context) ApiWebhooksGetRequest { + return ApiWebhooksGetRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return ListOfWebhooksResponse +func (a *WebhooksWebhooksAPIService) WebhooksGetExecute(r ApiWebhooksGetRequest) (*ListOfWebhooksResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ListOfWebhooksResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "WebhooksWebhooksAPIService.WebhooksGet") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/webhooks" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.offset != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "form", "") + } + if r.limit != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "form", "") + } + if r.desc != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "desc", r.desc, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiWebhooksPostRequest struct { + ctx context.Context + ApiService *WebhooksWebhooksAPIService + webhookCreate *WebhookCreate +} + +// +func (r ApiWebhooksPostRequest) WebhookCreate(webhookCreate WebhookCreate) ApiWebhooksPostRequest { + r.webhookCreate = &webhookCreate + return r +} + +func (r ApiWebhooksPostRequest) Execute() (*WebhookResponse, *http.Response, error) { + return r.ApiService.WebhooksPostExecute(r) +} + +/* +WebhooksPost Create webhook + +Creates a new webhook with settings provided by the webhook object passed as +JSON in the payload. +The response is the created webhook object. + +To avoid duplicating a webhook, use the `idempotencyKey` parameter in the +request body. +Multiple calls to create a webhook with the same `idempotencyKey` will only +create the webhook with the first call and return the existing webhook on +subsequent calls. +Idempotency keys must be unique, so use a UUID or another random string with +enough entropy. + +To assign the new webhook to an Actor or task, the request body must contain +`requestUrl`, `eventTypes`, and `condition` properties. + +* `requestUrl` is the webhook's target URL, to which data is sent as a POST +request with a JSON payload. +* `eventTypes` is a list of events that will trigger the webhook, e.g. when +the Actor run succeeds. +* `condition` should be an object containing the ID of the Actor or task to +which the webhook will be assigned. +* `payloadTemplate` is a JSON-like string, whose syntax is extended with the +use of variables. +* `headersTemplate` is a JSON-like string, whose syntax is extended with the +use of variables. Following values will be re-written to defaults: "host", +"Content-Type", "X-Apify-Webhook", "X-Apify-Webhook-Dispatch-Id", +"X-Apify-Request-Origin" +* `description` is an optional string. +* `shouldInterpolateStrings` is a boolean indicating whether to interpolate +variables contained inside strings in the `payloadTemplate` + +``` + "isAdHoc" : false, + "requestUrl" : "https://example.com", + "eventTypes" : [ + "ACTOR.RUN.SUCCEEDED", + "ACTOR.RUN.ABORTED" + ], + "condition" : { + "actorId": "5sTMwDQywwsLzKRRh", + "actorTaskId" : "W9bs9JE9v7wprjAnJ" + }, + "payloadTemplate": "", + "headersTemplate": "", + "description": "my awesome webhook", + "shouldInterpolateStrings": false, +``` + +**Important**: The request must specify the `Content-Type: application/json` +HTTP header. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiWebhooksPostRequest +*/ +func (a *WebhooksWebhooksAPIService) WebhooksPost(ctx context.Context) ApiWebhooksPostRequest { + return ApiWebhooksPostRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return WebhookResponse +func (a *WebhooksWebhooksAPIService) WebhooksPostExecute(r ApiWebhooksPostRequest) (*WebhookResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *WebhookResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "WebhooksWebhooksAPIService.WebhooksPost") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/webhooks" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.webhookCreate == nil { + return localVarReturnValue, nil, reportError("webhookCreate is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.webhookCreate + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("token", key) + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 413 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 415 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/client.go b/client.go new file mode 100644 index 0000000..f2120e0 --- /dev/null +++ b/client.go @@ -0,0 +1,775 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "bytes" + "context" + "encoding/json" + "encoding/xml" + "errors" + "fmt" + "io" + "log" + "mime/multipart" + "net/http" + "net/http/httputil" + "net/url" + "os" + "path/filepath" + "reflect" + "regexp" + "strconv" + "strings" + "time" + "unicode/utf8" + +) + +var ( + JsonCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:[^;]+\+)?json)`) + XmlCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:[^;]+\+)?xml)`) + queryParamSplit = regexp.MustCompile(`(^|&)([^&]+)`) + queryDescape = strings.NewReplacer( "%5B", "[", "%5D", "]" ) +) + +// APIClient manages communication with the Apify API API vv2-2026-06-16T064758Z +// In most cases there should be only one, shared, APIClient. +type APIClient struct { + cfg *Configuration + common service // Reuse a single struct instead of allocating one for each service on the heap. + + // API Services + + ActorBuildsAPI *ActorBuildsAPIService + + ActorRunsAPI *ActorRunsAPIService + + ActorTasksAPI *ActorTasksAPIService + + ActorsAPI *ActorsAPIService + + ActorsActorBuildsAPI *ActorsActorBuildsAPIService + + ActorsActorRunsAPI *ActorsActorRunsAPIService + + ActorsActorVersionsAPI *ActorsActorVersionsAPIService + + ActorsWebhookCollectionAPI *ActorsWebhookCollectionAPIService + + DefaultDatasetAPI *DefaultDatasetAPIService + + DefaultKeyValueStoreAPI *DefaultKeyValueStoreAPIService + + DefaultRequestQueueAPI *DefaultRequestQueueAPIService + + LastActorRunsAbortAPI *LastActorRunsAbortAPIService + + LastActorRunsDefaultDatasetAPI *LastActorRunsDefaultDatasetAPIService + + LastActorRunsDefaultKeyValueStoreAPI *LastActorRunsDefaultKeyValueStoreAPIService + + LastActorRunsDefaultRequestQueueAPI *LastActorRunsDefaultRequestQueueAPIService + + LastActorRunsLogAPI *LastActorRunsLogAPIService + + LastActorRunsMetamorphAPI *LastActorRunsMetamorphAPIService + + LastActorRunsRebootAPI *LastActorRunsRebootAPIService + + LastActorTaskRunsAbortAPI *LastActorTaskRunsAbortAPIService + + LastActorTaskRunsDefaultDatasetAPI *LastActorTaskRunsDefaultDatasetAPIService + + LastActorTaskRunsDefaultKeyValueStoreAPI *LastActorTaskRunsDefaultKeyValueStoreAPIService + + LastActorTaskRunsDefaultRequestQueueAPI *LastActorTaskRunsDefaultRequestQueueAPIService + + LastActorTaskRunsLogAPI *LastActorTaskRunsLogAPIService + + LastActorTaskRunsMetamorphAPI *LastActorTaskRunsMetamorphAPIService + + LastActorTaskRunsRebootAPI *LastActorTaskRunsRebootAPIService + + LogsAPI *LogsAPIService + + SchedulesAPI *SchedulesAPIService + + StorageDatasetsAPI *StorageDatasetsAPIService + + StorageKeyValueStoresAPI *StorageKeyValueStoresAPIService + + StorageRequestQueuesAPI *StorageRequestQueuesAPIService + + StorageRequestQueuesRequestsAPI *StorageRequestQueuesRequestsAPIService + + StorageRequestQueuesRequestsLocksAPI *StorageRequestQueuesRequestsLocksAPIService + + StoreAPI *StoreAPIService + + ToolsAPI *ToolsAPIService + + UsersAPI *UsersAPIService + + WebhooksWebhookDispatchesAPI *WebhooksWebhookDispatchesAPIService + + WebhooksWebhooksAPI *WebhooksWebhooksAPIService +} + +type service struct { + client *APIClient +} + +// NewAPIClient creates a new API client. Requires a userAgent string describing your application. +// optionally a custom http.Client to allow for advanced features such as caching. +func NewAPIClient(cfg *Configuration) *APIClient { + if cfg.HTTPClient == nil { + cfg.HTTPClient = http.DefaultClient + } + + c := &APIClient{} + c.cfg = cfg + c.common.client = c + + // API Services + c.ActorBuildsAPI = (*ActorBuildsAPIService)(&c.common) + c.ActorRunsAPI = (*ActorRunsAPIService)(&c.common) + c.ActorTasksAPI = (*ActorTasksAPIService)(&c.common) + c.ActorsAPI = (*ActorsAPIService)(&c.common) + c.ActorsActorBuildsAPI = (*ActorsActorBuildsAPIService)(&c.common) + c.ActorsActorRunsAPI = (*ActorsActorRunsAPIService)(&c.common) + c.ActorsActorVersionsAPI = (*ActorsActorVersionsAPIService)(&c.common) + c.ActorsWebhookCollectionAPI = (*ActorsWebhookCollectionAPIService)(&c.common) + c.DefaultDatasetAPI = (*DefaultDatasetAPIService)(&c.common) + c.DefaultKeyValueStoreAPI = (*DefaultKeyValueStoreAPIService)(&c.common) + c.DefaultRequestQueueAPI = (*DefaultRequestQueueAPIService)(&c.common) + c.LastActorRunsAbortAPI = (*LastActorRunsAbortAPIService)(&c.common) + c.LastActorRunsDefaultDatasetAPI = (*LastActorRunsDefaultDatasetAPIService)(&c.common) + c.LastActorRunsDefaultKeyValueStoreAPI = (*LastActorRunsDefaultKeyValueStoreAPIService)(&c.common) + c.LastActorRunsDefaultRequestQueueAPI = (*LastActorRunsDefaultRequestQueueAPIService)(&c.common) + c.LastActorRunsLogAPI = (*LastActorRunsLogAPIService)(&c.common) + c.LastActorRunsMetamorphAPI = (*LastActorRunsMetamorphAPIService)(&c.common) + c.LastActorRunsRebootAPI = (*LastActorRunsRebootAPIService)(&c.common) + c.LastActorTaskRunsAbortAPI = (*LastActorTaskRunsAbortAPIService)(&c.common) + c.LastActorTaskRunsDefaultDatasetAPI = (*LastActorTaskRunsDefaultDatasetAPIService)(&c.common) + c.LastActorTaskRunsDefaultKeyValueStoreAPI = (*LastActorTaskRunsDefaultKeyValueStoreAPIService)(&c.common) + c.LastActorTaskRunsDefaultRequestQueueAPI = (*LastActorTaskRunsDefaultRequestQueueAPIService)(&c.common) + c.LastActorTaskRunsLogAPI = (*LastActorTaskRunsLogAPIService)(&c.common) + c.LastActorTaskRunsMetamorphAPI = (*LastActorTaskRunsMetamorphAPIService)(&c.common) + c.LastActorTaskRunsRebootAPI = (*LastActorTaskRunsRebootAPIService)(&c.common) + c.LogsAPI = (*LogsAPIService)(&c.common) + c.SchedulesAPI = (*SchedulesAPIService)(&c.common) + c.StorageDatasetsAPI = (*StorageDatasetsAPIService)(&c.common) + c.StorageKeyValueStoresAPI = (*StorageKeyValueStoresAPIService)(&c.common) + c.StorageRequestQueuesAPI = (*StorageRequestQueuesAPIService)(&c.common) + c.StorageRequestQueuesRequestsAPI = (*StorageRequestQueuesRequestsAPIService)(&c.common) + c.StorageRequestQueuesRequestsLocksAPI = (*StorageRequestQueuesRequestsLocksAPIService)(&c.common) + c.StoreAPI = (*StoreAPIService)(&c.common) + c.ToolsAPI = (*ToolsAPIService)(&c.common) + c.UsersAPI = (*UsersAPIService)(&c.common) + c.WebhooksWebhookDispatchesAPI = (*WebhooksWebhookDispatchesAPIService)(&c.common) + c.WebhooksWebhooksAPI = (*WebhooksWebhooksAPIService)(&c.common) + + return c +} + +func atoi(in string) (int, error) { + return strconv.Atoi(in) +} + +// selectHeaderContentType select a content type from the available list. +func selectHeaderContentType(contentTypes []string) string { + if len(contentTypes) == 0 { + return "" + } + if contains(contentTypes, "application/json") { + return "application/json" + } + return contentTypes[0] // use the first content type specified in 'consumes' +} + +// selectHeaderAccept join all accept types and return +func selectHeaderAccept(accepts []string) string { + if len(accepts) == 0 { + return "" + } + + if contains(accepts, "application/json") { + return "application/json" + } + + return strings.Join(accepts, ",") +} + +// contains is a case insensitive match, finding needle in a haystack +func contains(haystack []string, needle string) bool { + for _, a := range haystack { + if strings.EqualFold(a, needle) { + return true + } + } + return false +} + +// Verify optional parameters are of the correct type. +func typeCheckParameter(obj interface{}, expected string, name string) error { + // Make sure there is an object. + if obj == nil { + return nil + } + + // Check the type is as expected. + if reflect.TypeOf(obj).String() != expected { + return fmt.Errorf("expected %s to be of type %s but received %s", name, expected, reflect.TypeOf(obj).String()) + } + return nil +} + +func parameterValueToString( obj interface{}, key string ) string { + if reflect.TypeOf(obj).Kind() != reflect.Ptr { + if actualObj, ok := obj.(interface{ GetActualInstanceValue() interface{} }); ok { + return fmt.Sprintf("%v", actualObj.GetActualInstanceValue()) + } + + return fmt.Sprintf("%v", obj) + } + var param,ok = obj.(MappedNullable) + if !ok { + return "" + } + dataMap,err := param.ToMap() + if err != nil { + return "" + } + return fmt.Sprintf("%v", dataMap[key]) +} + +// parameterAddToHeaderOrQuery adds the provided object to the request header or url query +// supporting deep object syntax +func parameterAddToHeaderOrQuery(headerOrQueryParams interface{}, keyPrefix string, obj interface{}, style string, collectionType string) { + var v = reflect.ValueOf(obj) + var value = "" + if v == reflect.ValueOf(nil) { + value = "null" + } else { + switch v.Kind() { + case reflect.Invalid: + value = "invalid" + + case reflect.Struct: + if t,ok := obj.(MappedNullable); ok { + dataMap,err := t.ToMap() + if err != nil { + return + } + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, dataMap, style, collectionType) + return + } + if t, ok := obj.(time.Time); ok { + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, t.Format(time.RFC3339Nano), style, collectionType) + return + } + value = v.Type().String() + " value" + case reflect.Slice: + var indValue = reflect.ValueOf(obj) + if indValue == reflect.ValueOf(nil) { + return + } + var lenIndValue = indValue.Len() + for i:=0;i<lenIndValue;i++ { + var arrayValue = indValue.Index(i) + var keyPrefixForCollectionType = keyPrefix + if style == "deepObject" { + keyPrefixForCollectionType = keyPrefix + "[" + strconv.Itoa(i) + "]" + } + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefixForCollectionType, arrayValue.Interface(), style, collectionType) + } + return + + case reflect.Map: + var indValue = reflect.ValueOf(obj) + if indValue == reflect.ValueOf(nil) { + return + } + iter := indValue.MapRange() + for iter.Next() { + k,v := iter.Key(), iter.Value() + parameterAddToHeaderOrQuery(headerOrQueryParams, fmt.Sprintf("%s[%s]", keyPrefix, k.String()), v.Interface(), style, collectionType) + } + return + + case reflect.Interface: + fallthrough + case reflect.Ptr: + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, v.Elem().Interface(), style, collectionType) + return + + case reflect.Int, reflect.Int8, reflect.Int16, + reflect.Int32, reflect.Int64: + value = strconv.FormatInt(v.Int(), 10) + case reflect.Uint, reflect.Uint8, reflect.Uint16, + reflect.Uint32, reflect.Uint64, reflect.Uintptr: + value = strconv.FormatUint(v.Uint(), 10) + case reflect.Float32, reflect.Float64: + value = strconv.FormatFloat(v.Float(), 'g', -1, 32) + case reflect.Bool: + value = strconv.FormatBool(v.Bool()) + case reflect.String: + value = v.String() + default: + value = v.Type().String() + " value" + } + } + + switch valuesMap := headerOrQueryParams.(type) { + case url.Values: + if collectionType == "csv" && valuesMap.Get(keyPrefix) != "" { + valuesMap.Set(keyPrefix, valuesMap.Get(keyPrefix) + "," + value) + } else { + valuesMap.Add(keyPrefix, value) + } + break + case map[string]string: + valuesMap[keyPrefix] = value + break + } +} + +// helper for converting interface{} parameters to json strings +func parameterToJson(obj interface{}) (string, error) { + jsonBuf, err := json.Marshal(obj) + if err != nil { + return "", err + } + return string(jsonBuf), err +} + +// callAPI do the request. +func (c *APIClient) callAPI(request *http.Request) (*http.Response, error) { + if c.cfg.Debug { + dump, err := httputil.DumpRequestOut(request, true) + if err != nil { + return nil, err + } + log.Printf("\n%s\n", string(dump)) + } + + resp, err := c.cfg.HTTPClient.Do(request) + if err != nil { + return resp, err + } + + if c.cfg.Debug { + dump, err := httputil.DumpResponse(resp, true) + if err != nil { + return resp, err + } + log.Printf("\n%s\n", string(dump)) + } + return resp, err +} + +// Allow modification of underlying config for alternate implementations and testing +// Caution: modifying the configuration while live can cause data races and potentially unwanted behavior +func (c *APIClient) GetConfig() *Configuration { + return c.cfg +} + +type formFile struct { + fileBytes []byte + fileName string + formFileName string +} + +// prepareRequest build the request +func (c *APIClient) prepareRequest( + ctx context.Context, + path string, method string, + postBody interface{}, + headerParams map[string]string, + queryParams url.Values, + formParams url.Values, + formFiles []formFile) (localVarRequest *http.Request, err error) { + + var body *bytes.Buffer + + // Detect postBody type and post. + if postBody != nil { + contentType := headerParams["Content-Type"] + if contentType == "" { + contentType = detectContentType(postBody) + headerParams["Content-Type"] = contentType + } + + body, err = setBody(postBody, contentType) + if err != nil { + return nil, err + } + } + + // add form parameters and file if available. + if strings.HasPrefix(headerParams["Content-Type"], "multipart/form-data") && len(formParams) > 0 || (len(formFiles) > 0) { + if body != nil { + return nil, errors.New("Cannot specify postBody and multipart form at the same time.") + } + body = &bytes.Buffer{} + w := multipart.NewWriter(body) + + for k, v := range formParams { + for _, iv := range v { + if strings.HasPrefix(k, "@") { // file + err = addFile(w, k[1:], iv) + if err != nil { + return nil, err + } + } else { // form value + w.WriteField(k, iv) + } + } + } + for _, formFile := range formFiles { + if len(formFile.fileBytes) > 0 && formFile.fileName != "" { + w.Boundary() + part, err := w.CreateFormFile(formFile.formFileName, filepath.Base(formFile.fileName)) + if err != nil { + return nil, err + } + _, err = part.Write(formFile.fileBytes) + if err != nil { + return nil, err + } + } + } + + // Set the Boundary in the Content-Type + headerParams["Content-Type"] = w.FormDataContentType() + + // Set Content-Length + headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) + w.Close() + } + + if strings.HasPrefix(headerParams["Content-Type"], "application/x-www-form-urlencoded") && len(formParams) > 0 { + if body != nil { + return nil, errors.New("Cannot specify postBody and x-www-form-urlencoded form at the same time.") + } + body = &bytes.Buffer{} + body.WriteString(formParams.Encode()) + // Set Content-Length + headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) + } + + // Setup path and query parameters + url, err := url.Parse(path) + if err != nil { + return nil, err + } + + // Override request host, if applicable + if c.cfg.Host != "" { + url.Host = c.cfg.Host + } + + // Override request scheme, if applicable + if c.cfg.Scheme != "" { + url.Scheme = c.cfg.Scheme + } + + // Adding Query Param + query := url.Query() + for k, v := range queryParams { + for _, iv := range v { + query.Add(k, iv) + } + } + + // Encode the parameters. + url.RawQuery = queryParamSplit.ReplaceAllStringFunc(query.Encode(), func(s string) string { + pieces := strings.Split(s, "=") + pieces[0] = queryDescape.Replace(pieces[0]) + return strings.Join(pieces, "=") + }) + + // Generate a new request + if body != nil { + localVarRequest, err = http.NewRequest(method, url.String(), body) + } else { + localVarRequest, err = http.NewRequest(method, url.String(), nil) + } + if err != nil { + return nil, err + } + + // add header parameters, if any + if len(headerParams) > 0 { + headers := http.Header{} + for h, v := range headerParams { + headers[h] = []string{v} + } + localVarRequest.Header = headers + } + + // Add the user agent to the request. + localVarRequest.Header.Add("User-Agent", c.cfg.UserAgent) + + if ctx != nil { + // add context to the request + localVarRequest = localVarRequest.WithContext(ctx) + + // Walk through any authentication. + + // AccessToken Authentication + if auth, ok := ctx.Value(ContextAccessToken).(string); ok { + localVarRequest.Header.Add("Authorization", "Bearer "+auth) + } + + } + + for header, value := range c.cfg.DefaultHeader { + localVarRequest.Header.Add(header, value) + } + return localVarRequest, nil +} + +func (c *APIClient) decode(v interface{}, b []byte, contentType string) (err error) { + if len(b) == 0 { + return nil + } + if s, ok := v.(*string); ok { + *s = string(b) + return nil + } + if r, ok := v.(*io.Reader); ok { + *r = bytes.NewReader(b) + return nil + } + // Must stay before the JSON branch: json.Unmarshal would base64-decode into *[]byte. + if p, ok := v.(*[]byte); ok { + *p = b + return nil + } + if f, ok := v.(*os.File); ok { + f, err = os.CreateTemp("", "HttpClientFile") + if err != nil { + return + } + _, err = f.Write(b) + if err != nil { + return + } + _, err = f.Seek(0, io.SeekStart) + return + } + if f, ok := v.(**os.File); ok { + *f, err = os.CreateTemp("", "HttpClientFile") + if err != nil { + return + } + _, err = (*f).Write(b) + if err != nil { + return + } + _, err = (*f).Seek(0, io.SeekStart) + return + } + if XmlCheck.MatchString(contentType) { + if err = xml.Unmarshal(b, v); err != nil { + return err + } + return nil + } + if JsonCheck.MatchString(contentType) { + if actualObj, ok := v.(interface{ GetActualInstance() interface{} }); ok { // oneOf, anyOf schemas + if unmarshalObj, ok := actualObj.(interface{ UnmarshalJSON([]byte) error }); ok { // make sure it has UnmarshalJSON defined + if err = unmarshalObj.UnmarshalJSON(b); err != nil { + return err + } + } else { + return errors.New("Unknown type with GetActualInstance but no unmarshalObj.UnmarshalJSON defined") + } + } else if err = json.Unmarshal(b, v); err != nil { // simple model + return err + } + return nil + } + return errors.New("undefined response type") +} + +// Add a file to the multipart request +func addFile(w *multipart.Writer, fieldName, path string) error { + file, err := os.Open(filepath.Clean(path)) + if err != nil { + return err + } + defer file.Close() + + part, err := w.CreateFormFile(fieldName, filepath.Base(path)) + if err != nil { + return err + } + _, err = io.Copy(part, file) + + return err +} + +// Set request body from an interface{} +func setBody(body interface{}, contentType string) (bodyBuf *bytes.Buffer, err error) { + if bodyBuf == nil { + bodyBuf = &bytes.Buffer{} + } + + if reader, ok := body.(io.Reader); ok { + _, err = bodyBuf.ReadFrom(reader) + } else if fp, ok := body.(*os.File); ok { + _, err = bodyBuf.ReadFrom(fp) + } else if b, ok := body.([]byte); ok { + _, err = bodyBuf.Write(b) + } else if s, ok := body.(string); ok { + _, err = bodyBuf.WriteString(s) + } else if s, ok := body.(*string); ok { + _, err = bodyBuf.WriteString(*s) + } else if JsonCheck.MatchString(contentType) { + err = json.NewEncoder(bodyBuf).Encode(body) + } else if XmlCheck.MatchString(contentType) { + var bs []byte + bs, err = xml.Marshal(body) + if err == nil { + bodyBuf.Write(bs) + } + } + + if err != nil { + return nil, err + } + + if bodyBuf.Len() == 0 { + err = fmt.Errorf("invalid body type %s\n", contentType) + return nil, err + } + return bodyBuf, nil +} + +// detectContentType method is used to figure out `Request.Body` content type for request header +func detectContentType(body interface{}) string { + contentType := "text/plain; charset=utf-8" + kind := reflect.TypeOf(body).Kind() + + switch kind { + case reflect.Struct, reflect.Map, reflect.Ptr: + contentType = "application/json; charset=utf-8" + case reflect.String: + contentType = "text/plain; charset=utf-8" + default: + if b, ok := body.([]byte); ok { + contentType = http.DetectContentType(b) + } else if kind == reflect.Slice { + contentType = "application/json; charset=utf-8" + } + } + + return contentType +} + +// Ripped from https://github.com/gregjones/httpcache/blob/master/httpcache.go +type cacheControl map[string]string + +func parseCacheControl(headers http.Header) cacheControl { + cc := cacheControl{} + ccHeader := headers.Get("Cache-Control") + for _, part := range strings.Split(ccHeader, ",") { + part = strings.Trim(part, " ") + if part == "" { + continue + } + if strings.ContainsRune(part, '=') { + keyval := strings.Split(part, "=") + cc[strings.Trim(keyval[0], " ")] = strings.Trim(keyval[1], ",") + } else { + cc[part] = "" + } + } + return cc +} + +// CacheExpires helper function to determine remaining time before repeating a request. +func CacheExpires(r *http.Response) time.Time { + // Figure out when the cache expires. + var expires time.Time + now, err := time.Parse(time.RFC1123, r.Header.Get("date")) + if err != nil { + return time.Now() + } + respCacheControl := parseCacheControl(r.Header) + + if maxAge, ok := respCacheControl["max-age"]; ok { + lifetime, err := time.ParseDuration(maxAge + "s") + if err != nil { + expires = now + } else { + expires = now.Add(lifetime) + } + } else { + expiresHeader := r.Header.Get("Expires") + if expiresHeader != "" { + expires, err = time.Parse(time.RFC1123, expiresHeader) + if err != nil { + expires = now + } + } + } + return expires +} + +func strlen(s string) int { + return utf8.RuneCountInString(s) +} + +// GenericOpenAPIError Provides access to the body, error and model on returned errors. +type GenericOpenAPIError struct { + body []byte + error string + model interface{} +} + +// Error returns non-empty string if there was an error. +func (e GenericOpenAPIError) Error() string { + return e.error +} + +// Body returns the raw bytes of the response +func (e GenericOpenAPIError) Body() []byte { + return e.body +} + +// Model returns the unpacked model of the error +func (e GenericOpenAPIError) Model() interface{} { + return e.model +} + +// format error message using title and detail when model implements rfc7807 +func formatErrorMessage(status string, v interface{}) string { + str := "" + metaValue := reflect.ValueOf(v).Elem() + + if metaValue.Kind() == reflect.Struct { + field := metaValue.FieldByName("Title") + if field != (reflect.Value{}) { + str = fmt.Sprintf("%s", field.Interface()) + } + + field = metaValue.FieldByName("Detail") + if field != (reflect.Value{}) { + str = fmt.Sprintf("%s (%s)", str, field.Interface()) + } + } + + return strings.TrimSpace(fmt.Sprintf("%s %s", status, str)) +} diff --git a/configuration.go b/configuration.go new file mode 100644 index 0000000..5b92cb6 --- /dev/null +++ b/configuration.go @@ -0,0 +1,221 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "context" + "fmt" + "net/http" + "strings" +) + +// contextKeys are used to identify the type of value in the context. +// Since these are string, it is possible to get a short description of the +// context key for logging and debugging using key.String(). + +type contextKey string + +func (c contextKey) String() string { + return "auth " + string(c) +} + +var ( + // ContextAccessToken takes a string oauth2 access token as authentication for the request. + ContextAccessToken = contextKey("accesstoken") + + // ContextAPIKeys takes a string apikey as authentication for the request + ContextAPIKeys = contextKey("apiKeys") + + // ContextServerIndex uses a server configuration from the index. + ContextServerIndex = contextKey("serverIndex") + + // ContextOperationServerIndices uses a server configuration from the index mapping. + ContextOperationServerIndices = contextKey("serverOperationIndices") + + // ContextServerVariables overrides a server configuration variables. + ContextServerVariables = contextKey("serverVariables") + + // ContextOperationServerVariables overrides a server configuration variables using operation specific values. + ContextOperationServerVariables = contextKey("serverOperationVariables") +) + +// BasicAuth provides basic http authentication to a request passed via context using ContextBasicAuth +type BasicAuth struct { + UserName string `json:"userName,omitempty"` + Password string `json:"password,omitempty"` +} + +// APIKey provides API key based authentication to a request passed via context using ContextAPIKey +type APIKey struct { + Key string + Prefix string +} + +// ServerVariable stores the information about a server variable +type ServerVariable struct { + Description string + DefaultValue string + EnumValues []string +} + +// ServerConfiguration stores the information about a server +type ServerConfiguration struct { + URL string + Description string + Variables map[string]ServerVariable +} + +// ServerConfigurations stores multiple ServerConfiguration items +type ServerConfigurations []ServerConfiguration + +// Configuration stores the configuration of the API client +type Configuration struct { + Host string `json:"host,omitempty"` + Scheme string `json:"scheme,omitempty"` + DefaultHeader map[string]string `json:"defaultHeader,omitempty"` + UserAgent string `json:"userAgent,omitempty"` + Debug bool `json:"debug,omitempty"` + Servers ServerConfigurations + OperationServers map[string]ServerConfigurations + HTTPClient *http.Client +} + +// NewConfiguration returns a new Configuration object +func NewConfiguration() *Configuration { + cfg := &Configuration{ + DefaultHeader: make(map[string]string), + UserAgent: "OpenAPI-Generator/1.0.0/go", + Debug: false, + Servers: ServerConfigurations{ + { + URL: "https://api.apify.com", + Description: "No description provided", + }, + }, + OperationServers: map[string]ServerConfigurations{ + }, + } + return cfg +} + +// AddDefaultHeader adds a new HTTP header to the default header in the request +func (c *Configuration) AddDefaultHeader(key string, value string) { + c.DefaultHeader[key] = value +} + +// URL formats template on a index using given variables +func (sc ServerConfigurations) URL(index int, variables map[string]string) (string, error) { + if index < 0 || len(sc) <= index { + return "", fmt.Errorf("index %v out of range %v", index, len(sc)-1) + } + server := sc[index] + url := server.URL + + // go through variables and replace placeholders + for name, variable := range server.Variables { + if value, ok := variables[name]; ok { + found := bool(len(variable.EnumValues) == 0) + for _, enumValue := range variable.EnumValues { + if value == enumValue { + found = true + } + } + if !found { + return "", fmt.Errorf("the variable %s in the server URL has invalid value %v. Must be %v", name, value, variable.EnumValues) + } + url = strings.Replace(url, "{"+name+"}", value, -1) + } else { + url = strings.Replace(url, "{"+name+"}", variable.DefaultValue, -1) + } + } + return url, nil +} + +// ServerURL returns URL based on server settings +func (c *Configuration) ServerURL(index int, variables map[string]string) (string, error) { + return c.Servers.URL(index, variables) +} + +func getServerIndex(ctx context.Context) (int, error) { + si := ctx.Value(ContextServerIndex) + if si != nil { + if index, ok := si.(int); ok { + return index, nil + } + return 0, reportError("Invalid type %T should be int", si) + } + return 0, nil +} + +func getServerOperationIndex(ctx context.Context, endpoint string) (int, error) { + osi := ctx.Value(ContextOperationServerIndices) + if osi != nil { + if operationIndices, ok := osi.(map[string]int); !ok { + return 0, reportError("Invalid type %T should be map[string]int", osi) + } else { + index, ok := operationIndices[endpoint] + if ok { + return index, nil + } + } + } + return getServerIndex(ctx) +} + +func getServerVariables(ctx context.Context) (map[string]string, error) { + sv := ctx.Value(ContextServerVariables) + if sv != nil { + if variables, ok := sv.(map[string]string); ok { + return variables, nil + } + return nil, reportError("ctx value of ContextServerVariables has invalid type %T should be map[string]string", sv) + } + return nil, nil +} + +func getServerOperationVariables(ctx context.Context, endpoint string) (map[string]string, error) { + osv := ctx.Value(ContextOperationServerVariables) + if osv != nil { + if operationVariables, ok := osv.(map[string]map[string]string); !ok { + return nil, reportError("ctx value of ContextOperationServerVariables has invalid type %T should be map[string]map[string]string", osv) + } else { + variables, ok := operationVariables[endpoint] + if ok { + return variables, nil + } + } + } + return getServerVariables(ctx) +} + +// ServerURLWithContext returns a new server URL given an endpoint +func (c *Configuration) ServerURLWithContext(ctx context.Context, endpoint string) (string, error) { + sc, ok := c.OperationServers[endpoint] + if !ok { + sc = c.Servers + } + + if ctx == nil { + return sc.URL(0, nil) + } + + index, err := getServerOperationIndex(ctx, endpoint) + if err != nil { + return "", err + } + + variables, err := getServerOperationVariables(ctx, endpoint) + if err != nil { + return "", err + } + + return sc.URL(index, variables) +} diff --git a/docs/AccountLimits.md b/docs/AccountLimits.md new file mode 100644 index 0000000..c0b2b6d --- /dev/null +++ b/docs/AccountLimits.md @@ -0,0 +1,93 @@ +# AccountLimits + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**MonthlyUsageCycle** | [**UsageCycle**](UsageCycle.md) | | +**Limits** | [**Limits**](Limits.md) | | +**Current** | [**Current**](Current.md) | | + +## Methods + +### NewAccountLimits + +`func NewAccountLimits(monthlyUsageCycle UsageCycle, limits Limits, current Current, ) *AccountLimits` + +NewAccountLimits instantiates a new AccountLimits object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewAccountLimitsWithDefaults + +`func NewAccountLimitsWithDefaults() *AccountLimits` + +NewAccountLimitsWithDefaults instantiates a new AccountLimits object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetMonthlyUsageCycle + +`func (o *AccountLimits) GetMonthlyUsageCycle() UsageCycle` + +GetMonthlyUsageCycle returns the MonthlyUsageCycle field if non-nil, zero value otherwise. + +### GetMonthlyUsageCycleOk + +`func (o *AccountLimits) GetMonthlyUsageCycleOk() (*UsageCycle, bool)` + +GetMonthlyUsageCycleOk returns a tuple with the MonthlyUsageCycle field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMonthlyUsageCycle + +`func (o *AccountLimits) SetMonthlyUsageCycle(v UsageCycle)` + +SetMonthlyUsageCycle sets MonthlyUsageCycle field to given value. + + +### GetLimits + +`func (o *AccountLimits) GetLimits() Limits` + +GetLimits returns the Limits field if non-nil, zero value otherwise. + +### GetLimitsOk + +`func (o *AccountLimits) GetLimitsOk() (*Limits, bool)` + +GetLimitsOk returns a tuple with the Limits field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetLimits + +`func (o *AccountLimits) SetLimits(v Limits)` + +SetLimits sets Limits field to given value. + + +### GetCurrent + +`func (o *AccountLimits) GetCurrent() Current` + +GetCurrent returns the Current field if non-nil, zero value otherwise. + +### GetCurrentOk + +`func (o *AccountLimits) GetCurrentOk() (*Current, bool)` + +GetCurrentOk returns a tuple with the Current field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCurrent + +`func (o *AccountLimits) SetCurrent(v Current)` + +SetCurrent sets Current field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ActRunsLastDatasetItemsPost400Response.md b/docs/ActRunsLastDatasetItemsPost400Response.md new file mode 100644 index 0000000..07cec09 --- /dev/null +++ b/docs/ActRunsLastDatasetItemsPost400Response.md @@ -0,0 +1,51 @@ +# ActRunsLastDatasetItemsPost400Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Error** | [**ErrorDetail**](ErrorDetail.md) | | + +## Methods + +### NewActRunsLastDatasetItemsPost400Response + +`func NewActRunsLastDatasetItemsPost400Response(error_ ErrorDetail, ) *ActRunsLastDatasetItemsPost400Response` + +NewActRunsLastDatasetItemsPost400Response instantiates a new ActRunsLastDatasetItemsPost400Response object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewActRunsLastDatasetItemsPost400ResponseWithDefaults + +`func NewActRunsLastDatasetItemsPost400ResponseWithDefaults() *ActRunsLastDatasetItemsPost400Response` + +NewActRunsLastDatasetItemsPost400ResponseWithDefaults instantiates a new ActRunsLastDatasetItemsPost400Response object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetError + +`func (o *ActRunsLastDatasetItemsPost400Response) GetError() ErrorDetail` + +GetError returns the Error field if non-nil, zero value otherwise. + +### GetErrorOk + +`func (o *ActRunsLastDatasetItemsPost400Response) GetErrorOk() (*ErrorDetail, bool)` + +GetErrorOk returns a tuple with the Error field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetError + +`func (o *ActRunsLastDatasetItemsPost400Response) SetError(v ErrorDetail)` + +SetError sets Error field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ActRunsLastDatasetItemsPostRequest.md b/docs/ActRunsLastDatasetItemsPostRequest.md new file mode 100644 index 0000000..8188944 --- /dev/null +++ b/docs/ActRunsLastDatasetItemsPostRequest.md @@ -0,0 +1,30 @@ +# ActRunsLastDatasetItemsPostRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +## Methods + +### NewActRunsLastDatasetItemsPostRequest + +`func NewActRunsLastDatasetItemsPostRequest() *ActRunsLastDatasetItemsPostRequest` + +NewActRunsLastDatasetItemsPostRequest instantiates a new ActRunsLastDatasetItemsPostRequest object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewActRunsLastDatasetItemsPostRequestWithDefaults + +`func NewActRunsLastDatasetItemsPostRequestWithDefaults() *ActRunsLastDatasetItemsPostRequest` + +NewActRunsLastDatasetItemsPostRequestWithDefaults instantiates a new ActRunsLastDatasetItemsPostRequest object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ActValidateInputPost200Response.md b/docs/ActValidateInputPost200Response.md new file mode 100644 index 0000000..9a0a22f --- /dev/null +++ b/docs/ActValidateInputPost200Response.md @@ -0,0 +1,51 @@ +# ActValidateInputPost200Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Valid** | **bool** | Whether the input is valid according to the Actor's input schema. | + +## Methods + +### NewActValidateInputPost200Response + +`func NewActValidateInputPost200Response(valid bool, ) *ActValidateInputPost200Response` + +NewActValidateInputPost200Response instantiates a new ActValidateInputPost200Response object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewActValidateInputPost200ResponseWithDefaults + +`func NewActValidateInputPost200ResponseWithDefaults() *ActValidateInputPost200Response` + +NewActValidateInputPost200ResponseWithDefaults instantiates a new ActValidateInputPost200Response object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetValid + +`func (o *ActValidateInputPost200Response) GetValid() bool` + +GetValid returns the Valid field if non-nil, zero value otherwise. + +### GetValidOk + +`func (o *ActValidateInputPost200Response) GetValidOk() (*bool, bool)` + +GetValidOk returns a tuple with the Valid field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetValid + +`func (o *ActValidateInputPost200Response) SetValid(v bool)` + +SetValid sets Valid field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/Actor.md b/docs/Actor.md new file mode 100644 index 0000000..557edd7 --- /dev/null +++ b/docs/Actor.md @@ -0,0 +1,886 @@ +# Actor + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **string** | | +**UserId** | **string** | | +**Name** | **string** | | +**Username** | **string** | | +**Description** | Pointer to **NullableString** | | [optional] +**RestartOnError** | Pointer to **bool** | | [optional] +**IsPublic** | **bool** | | +**ActorPermissionLevel** | Pointer to [**ActorPermissionLevel**](ActorPermissionLevel.md) | | [optional] +**CreatedAt** | **time.Time** | | +**ModifiedAt** | **time.Time** | | +**Stats** | [**ActorStats**](ActorStats.md) | | +**Versions** | [**[]Version**](Version.md) | | +**PricingInfos** | Pointer to [**[]ActorRunPricingInfo**](ActorRunPricingInfo.md) | | [optional] +**DefaultRunOptions** | [**DefaultRunOptions**](DefaultRunOptions.md) | | +**ExampleRunInput** | Pointer to [**NullableExampleRunInput**](ExampleRunInput.md) | | [optional] +**IsDeprecated** | Pointer to **NullableBool** | | [optional] +**DeploymentKey** | Pointer to **string** | | [optional] +**Title** | Pointer to **NullableString** | | [optional] +**TaggedBuilds** | Pointer to [**map[string]TaggedBuildsValue**](TaggedBuildsValue.md) | A dictionary mapping build tag names (e.g., \"latest\", \"beta\") to their build information. | [optional] +**ActorStandby** | Pointer to [**NullableActorStandby**](ActorStandby.md) | | [optional] +**ReadmeSummary** | Pointer to **string** | A brief, LLM-generated readme summary | [optional] +**SeoTitle** | Pointer to **NullableString** | | [optional] +**SeoDescription** | Pointer to **NullableString** | | [optional] +**PictureUrl** | Pointer to **NullableString** | | [optional] +**StandbyUrl** | Pointer to **NullableString** | | [optional] +**Notice** | Pointer to **string** | | [optional] +**Categories** | Pointer to **[]string** | | [optional] +**IsCritical** | Pointer to **bool** | | [optional] +**IsGeneric** | Pointer to **bool** | | [optional] +**IsSourceCodeHidden** | Pointer to **bool** | | [optional] +**HasNoDataset** | Pointer to **bool** | | [optional] + +## Methods + +### NewActor + +`func NewActor(id string, userId string, name string, username string, isPublic bool, createdAt time.Time, modifiedAt time.Time, stats ActorStats, versions []Version, defaultRunOptions DefaultRunOptions, ) *Actor` + +NewActor instantiates a new Actor object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewActorWithDefaults + +`func NewActorWithDefaults() *Actor` + +NewActorWithDefaults instantiates a new Actor object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetId + +`func (o *Actor) GetId() string` + +GetId returns the Id field if non-nil, zero value otherwise. + +### GetIdOk + +`func (o *Actor) GetIdOk() (*string, bool)` + +GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetId + +`func (o *Actor) SetId(v string)` + +SetId sets Id field to given value. + + +### GetUserId + +`func (o *Actor) GetUserId() string` + +GetUserId returns the UserId field if non-nil, zero value otherwise. + +### GetUserIdOk + +`func (o *Actor) GetUserIdOk() (*string, bool)` + +GetUserIdOk returns a tuple with the UserId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUserId + +`func (o *Actor) SetUserId(v string)` + +SetUserId sets UserId field to given value. + + +### GetName + +`func (o *Actor) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *Actor) GetNameOk() (*string, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetName + +`func (o *Actor) SetName(v string)` + +SetName sets Name field to given value. + + +### GetUsername + +`func (o *Actor) GetUsername() string` + +GetUsername returns the Username field if non-nil, zero value otherwise. + +### GetUsernameOk + +`func (o *Actor) GetUsernameOk() (*string, bool)` + +GetUsernameOk returns a tuple with the Username field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUsername + +`func (o *Actor) SetUsername(v string)` + +SetUsername sets Username field to given value. + + +### GetDescription + +`func (o *Actor) GetDescription() string` + +GetDescription returns the Description field if non-nil, zero value otherwise. + +### GetDescriptionOk + +`func (o *Actor) GetDescriptionOk() (*string, bool)` + +GetDescriptionOk returns a tuple with the Description field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDescription + +`func (o *Actor) SetDescription(v string)` + +SetDescription sets Description field to given value. + +### HasDescription + +`func (o *Actor) HasDescription() bool` + +HasDescription returns a boolean if a field has been set. + +### SetDescriptionNil + +`func (o *Actor) SetDescriptionNil(b bool)` + + SetDescriptionNil sets the value for Description to be an explicit nil + +### UnsetDescription +`func (o *Actor) UnsetDescription()` + +UnsetDescription ensures that no value is present for Description, not even an explicit nil +### GetRestartOnError + +`func (o *Actor) GetRestartOnError() bool` + +GetRestartOnError returns the RestartOnError field if non-nil, zero value otherwise. + +### GetRestartOnErrorOk + +`func (o *Actor) GetRestartOnErrorOk() (*bool, bool)` + +GetRestartOnErrorOk returns a tuple with the RestartOnError field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRestartOnError + +`func (o *Actor) SetRestartOnError(v bool)` + +SetRestartOnError sets RestartOnError field to given value. + +### HasRestartOnError + +`func (o *Actor) HasRestartOnError() bool` + +HasRestartOnError returns a boolean if a field has been set. + +### GetIsPublic + +`func (o *Actor) GetIsPublic() bool` + +GetIsPublic returns the IsPublic field if non-nil, zero value otherwise. + +### GetIsPublicOk + +`func (o *Actor) GetIsPublicOk() (*bool, bool)` + +GetIsPublicOk returns a tuple with the IsPublic field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetIsPublic + +`func (o *Actor) SetIsPublic(v bool)` + +SetIsPublic sets IsPublic field to given value. + + +### GetActorPermissionLevel + +`func (o *Actor) GetActorPermissionLevel() ActorPermissionLevel` + +GetActorPermissionLevel returns the ActorPermissionLevel field if non-nil, zero value otherwise. + +### GetActorPermissionLevelOk + +`func (o *Actor) GetActorPermissionLevelOk() (*ActorPermissionLevel, bool)` + +GetActorPermissionLevelOk returns a tuple with the ActorPermissionLevel field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetActorPermissionLevel + +`func (o *Actor) SetActorPermissionLevel(v ActorPermissionLevel)` + +SetActorPermissionLevel sets ActorPermissionLevel field to given value. + +### HasActorPermissionLevel + +`func (o *Actor) HasActorPermissionLevel() bool` + +HasActorPermissionLevel returns a boolean if a field has been set. + +### GetCreatedAt + +`func (o *Actor) GetCreatedAt() time.Time` + +GetCreatedAt returns the CreatedAt field if non-nil, zero value otherwise. + +### GetCreatedAtOk + +`func (o *Actor) GetCreatedAtOk() (*time.Time, bool)` + +GetCreatedAtOk returns a tuple with the CreatedAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCreatedAt + +`func (o *Actor) SetCreatedAt(v time.Time)` + +SetCreatedAt sets CreatedAt field to given value. + + +### GetModifiedAt + +`func (o *Actor) GetModifiedAt() time.Time` + +GetModifiedAt returns the ModifiedAt field if non-nil, zero value otherwise. + +### GetModifiedAtOk + +`func (o *Actor) GetModifiedAtOk() (*time.Time, bool)` + +GetModifiedAtOk returns a tuple with the ModifiedAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetModifiedAt + +`func (o *Actor) SetModifiedAt(v time.Time)` + +SetModifiedAt sets ModifiedAt field to given value. + + +### GetStats + +`func (o *Actor) GetStats() ActorStats` + +GetStats returns the Stats field if non-nil, zero value otherwise. + +### GetStatsOk + +`func (o *Actor) GetStatsOk() (*ActorStats, bool)` + +GetStatsOk returns a tuple with the Stats field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetStats + +`func (o *Actor) SetStats(v ActorStats)` + +SetStats sets Stats field to given value. + + +### GetVersions + +`func (o *Actor) GetVersions() []Version` + +GetVersions returns the Versions field if non-nil, zero value otherwise. + +### GetVersionsOk + +`func (o *Actor) GetVersionsOk() (*[]Version, bool)` + +GetVersionsOk returns a tuple with the Versions field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetVersions + +`func (o *Actor) SetVersions(v []Version)` + +SetVersions sets Versions field to given value. + + +### GetPricingInfos + +`func (o *Actor) GetPricingInfos() []ActorRunPricingInfo` + +GetPricingInfos returns the PricingInfos field if non-nil, zero value otherwise. + +### GetPricingInfosOk + +`func (o *Actor) GetPricingInfosOk() (*[]ActorRunPricingInfo, bool)` + +GetPricingInfosOk returns a tuple with the PricingInfos field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPricingInfos + +`func (o *Actor) SetPricingInfos(v []ActorRunPricingInfo)` + +SetPricingInfos sets PricingInfos field to given value. + +### HasPricingInfos + +`func (o *Actor) HasPricingInfos() bool` + +HasPricingInfos returns a boolean if a field has been set. + +### GetDefaultRunOptions + +`func (o *Actor) GetDefaultRunOptions() DefaultRunOptions` + +GetDefaultRunOptions returns the DefaultRunOptions field if non-nil, zero value otherwise. + +### GetDefaultRunOptionsOk + +`func (o *Actor) GetDefaultRunOptionsOk() (*DefaultRunOptions, bool)` + +GetDefaultRunOptionsOk returns a tuple with the DefaultRunOptions field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDefaultRunOptions + +`func (o *Actor) SetDefaultRunOptions(v DefaultRunOptions)` + +SetDefaultRunOptions sets DefaultRunOptions field to given value. + + +### GetExampleRunInput + +`func (o *Actor) GetExampleRunInput() ExampleRunInput` + +GetExampleRunInput returns the ExampleRunInput field if non-nil, zero value otherwise. + +### GetExampleRunInputOk + +`func (o *Actor) GetExampleRunInputOk() (*ExampleRunInput, bool)` + +GetExampleRunInputOk returns a tuple with the ExampleRunInput field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetExampleRunInput + +`func (o *Actor) SetExampleRunInput(v ExampleRunInput)` + +SetExampleRunInput sets ExampleRunInput field to given value. + +### HasExampleRunInput + +`func (o *Actor) HasExampleRunInput() bool` + +HasExampleRunInput returns a boolean if a field has been set. + +### SetExampleRunInputNil + +`func (o *Actor) SetExampleRunInputNil(b bool)` + + SetExampleRunInputNil sets the value for ExampleRunInput to be an explicit nil + +### UnsetExampleRunInput +`func (o *Actor) UnsetExampleRunInput()` + +UnsetExampleRunInput ensures that no value is present for ExampleRunInput, not even an explicit nil +### GetIsDeprecated + +`func (o *Actor) GetIsDeprecated() bool` + +GetIsDeprecated returns the IsDeprecated field if non-nil, zero value otherwise. + +### GetIsDeprecatedOk + +`func (o *Actor) GetIsDeprecatedOk() (*bool, bool)` + +GetIsDeprecatedOk returns a tuple with the IsDeprecated field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetIsDeprecated + +`func (o *Actor) SetIsDeprecated(v bool)` + +SetIsDeprecated sets IsDeprecated field to given value. + +### HasIsDeprecated + +`func (o *Actor) HasIsDeprecated() bool` + +HasIsDeprecated returns a boolean if a field has been set. + +### SetIsDeprecatedNil + +`func (o *Actor) SetIsDeprecatedNil(b bool)` + + SetIsDeprecatedNil sets the value for IsDeprecated to be an explicit nil + +### UnsetIsDeprecated +`func (o *Actor) UnsetIsDeprecated()` + +UnsetIsDeprecated ensures that no value is present for IsDeprecated, not even an explicit nil +### GetDeploymentKey + +`func (o *Actor) GetDeploymentKey() string` + +GetDeploymentKey returns the DeploymentKey field if non-nil, zero value otherwise. + +### GetDeploymentKeyOk + +`func (o *Actor) GetDeploymentKeyOk() (*string, bool)` + +GetDeploymentKeyOk returns a tuple with the DeploymentKey field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDeploymentKey + +`func (o *Actor) SetDeploymentKey(v string)` + +SetDeploymentKey sets DeploymentKey field to given value. + +### HasDeploymentKey + +`func (o *Actor) HasDeploymentKey() bool` + +HasDeploymentKey returns a boolean if a field has been set. + +### GetTitle + +`func (o *Actor) GetTitle() string` + +GetTitle returns the Title field if non-nil, zero value otherwise. + +### GetTitleOk + +`func (o *Actor) GetTitleOk() (*string, bool)` + +GetTitleOk returns a tuple with the Title field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTitle + +`func (o *Actor) SetTitle(v string)` + +SetTitle sets Title field to given value. + +### HasTitle + +`func (o *Actor) HasTitle() bool` + +HasTitle returns a boolean if a field has been set. + +### SetTitleNil + +`func (o *Actor) SetTitleNil(b bool)` + + SetTitleNil sets the value for Title to be an explicit nil + +### UnsetTitle +`func (o *Actor) UnsetTitle()` + +UnsetTitle ensures that no value is present for Title, not even an explicit nil +### GetTaggedBuilds + +`func (o *Actor) GetTaggedBuilds() map[string]TaggedBuildsValue` + +GetTaggedBuilds returns the TaggedBuilds field if non-nil, zero value otherwise. + +### GetTaggedBuildsOk + +`func (o *Actor) GetTaggedBuildsOk() (*map[string]TaggedBuildsValue, bool)` + +GetTaggedBuildsOk returns a tuple with the TaggedBuilds field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTaggedBuilds + +`func (o *Actor) SetTaggedBuilds(v map[string]TaggedBuildsValue)` + +SetTaggedBuilds sets TaggedBuilds field to given value. + +### HasTaggedBuilds + +`func (o *Actor) HasTaggedBuilds() bool` + +HasTaggedBuilds returns a boolean if a field has been set. + +### SetTaggedBuildsNil + +`func (o *Actor) SetTaggedBuildsNil(b bool)` + + SetTaggedBuildsNil sets the value for TaggedBuilds to be an explicit nil + +### UnsetTaggedBuilds +`func (o *Actor) UnsetTaggedBuilds()` + +UnsetTaggedBuilds ensures that no value is present for TaggedBuilds, not even an explicit nil +### GetActorStandby + +`func (o *Actor) GetActorStandby() ActorStandby` + +GetActorStandby returns the ActorStandby field if non-nil, zero value otherwise. + +### GetActorStandbyOk + +`func (o *Actor) GetActorStandbyOk() (*ActorStandby, bool)` + +GetActorStandbyOk returns a tuple with the ActorStandby field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetActorStandby + +`func (o *Actor) SetActorStandby(v ActorStandby)` + +SetActorStandby sets ActorStandby field to given value. + +### HasActorStandby + +`func (o *Actor) HasActorStandby() bool` + +HasActorStandby returns a boolean if a field has been set. + +### SetActorStandbyNil + +`func (o *Actor) SetActorStandbyNil(b bool)` + + SetActorStandbyNil sets the value for ActorStandby to be an explicit nil + +### UnsetActorStandby +`func (o *Actor) UnsetActorStandby()` + +UnsetActorStandby ensures that no value is present for ActorStandby, not even an explicit nil +### GetReadmeSummary + +`func (o *Actor) GetReadmeSummary() string` + +GetReadmeSummary returns the ReadmeSummary field if non-nil, zero value otherwise. + +### GetReadmeSummaryOk + +`func (o *Actor) GetReadmeSummaryOk() (*string, bool)` + +GetReadmeSummaryOk returns a tuple with the ReadmeSummary field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetReadmeSummary + +`func (o *Actor) SetReadmeSummary(v string)` + +SetReadmeSummary sets ReadmeSummary field to given value. + +### HasReadmeSummary + +`func (o *Actor) HasReadmeSummary() bool` + +HasReadmeSummary returns a boolean if a field has been set. + +### GetSeoTitle + +`func (o *Actor) GetSeoTitle() string` + +GetSeoTitle returns the SeoTitle field if non-nil, zero value otherwise. + +### GetSeoTitleOk + +`func (o *Actor) GetSeoTitleOk() (*string, bool)` + +GetSeoTitleOk returns a tuple with the SeoTitle field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSeoTitle + +`func (o *Actor) SetSeoTitle(v string)` + +SetSeoTitle sets SeoTitle field to given value. + +### HasSeoTitle + +`func (o *Actor) HasSeoTitle() bool` + +HasSeoTitle returns a boolean if a field has been set. + +### SetSeoTitleNil + +`func (o *Actor) SetSeoTitleNil(b bool)` + + SetSeoTitleNil sets the value for SeoTitle to be an explicit nil + +### UnsetSeoTitle +`func (o *Actor) UnsetSeoTitle()` + +UnsetSeoTitle ensures that no value is present for SeoTitle, not even an explicit nil +### GetSeoDescription + +`func (o *Actor) GetSeoDescription() string` + +GetSeoDescription returns the SeoDescription field if non-nil, zero value otherwise. + +### GetSeoDescriptionOk + +`func (o *Actor) GetSeoDescriptionOk() (*string, bool)` + +GetSeoDescriptionOk returns a tuple with the SeoDescription field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSeoDescription + +`func (o *Actor) SetSeoDescription(v string)` + +SetSeoDescription sets SeoDescription field to given value. + +### HasSeoDescription + +`func (o *Actor) HasSeoDescription() bool` + +HasSeoDescription returns a boolean if a field has been set. + +### SetSeoDescriptionNil + +`func (o *Actor) SetSeoDescriptionNil(b bool)` + + SetSeoDescriptionNil sets the value for SeoDescription to be an explicit nil + +### UnsetSeoDescription +`func (o *Actor) UnsetSeoDescription()` + +UnsetSeoDescription ensures that no value is present for SeoDescription, not even an explicit nil +### GetPictureUrl + +`func (o *Actor) GetPictureUrl() string` + +GetPictureUrl returns the PictureUrl field if non-nil, zero value otherwise. + +### GetPictureUrlOk + +`func (o *Actor) GetPictureUrlOk() (*string, bool)` + +GetPictureUrlOk returns a tuple with the PictureUrl field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPictureUrl + +`func (o *Actor) SetPictureUrl(v string)` + +SetPictureUrl sets PictureUrl field to given value. + +### HasPictureUrl + +`func (o *Actor) HasPictureUrl() bool` + +HasPictureUrl returns a boolean if a field has been set. + +### SetPictureUrlNil + +`func (o *Actor) SetPictureUrlNil(b bool)` + + SetPictureUrlNil sets the value for PictureUrl to be an explicit nil + +### UnsetPictureUrl +`func (o *Actor) UnsetPictureUrl()` + +UnsetPictureUrl ensures that no value is present for PictureUrl, not even an explicit nil +### GetStandbyUrl + +`func (o *Actor) GetStandbyUrl() string` + +GetStandbyUrl returns the StandbyUrl field if non-nil, zero value otherwise. + +### GetStandbyUrlOk + +`func (o *Actor) GetStandbyUrlOk() (*string, bool)` + +GetStandbyUrlOk returns a tuple with the StandbyUrl field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetStandbyUrl + +`func (o *Actor) SetStandbyUrl(v string)` + +SetStandbyUrl sets StandbyUrl field to given value. + +### HasStandbyUrl + +`func (o *Actor) HasStandbyUrl() bool` + +HasStandbyUrl returns a boolean if a field has been set. + +### SetStandbyUrlNil + +`func (o *Actor) SetStandbyUrlNil(b bool)` + + SetStandbyUrlNil sets the value for StandbyUrl to be an explicit nil + +### UnsetStandbyUrl +`func (o *Actor) UnsetStandbyUrl()` + +UnsetStandbyUrl ensures that no value is present for StandbyUrl, not even an explicit nil +### GetNotice + +`func (o *Actor) GetNotice() string` + +GetNotice returns the Notice field if non-nil, zero value otherwise. + +### GetNoticeOk + +`func (o *Actor) GetNoticeOk() (*string, bool)` + +GetNoticeOk returns a tuple with the Notice field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetNotice + +`func (o *Actor) SetNotice(v string)` + +SetNotice sets Notice field to given value. + +### HasNotice + +`func (o *Actor) HasNotice() bool` + +HasNotice returns a boolean if a field has been set. + +### GetCategories + +`func (o *Actor) GetCategories() []string` + +GetCategories returns the Categories field if non-nil, zero value otherwise. + +### GetCategoriesOk + +`func (o *Actor) GetCategoriesOk() (*[]string, bool)` + +GetCategoriesOk returns a tuple with the Categories field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCategories + +`func (o *Actor) SetCategories(v []string)` + +SetCategories sets Categories field to given value. + +### HasCategories + +`func (o *Actor) HasCategories() bool` + +HasCategories returns a boolean if a field has been set. + +### GetIsCritical + +`func (o *Actor) GetIsCritical() bool` + +GetIsCritical returns the IsCritical field if non-nil, zero value otherwise. + +### GetIsCriticalOk + +`func (o *Actor) GetIsCriticalOk() (*bool, bool)` + +GetIsCriticalOk returns a tuple with the IsCritical field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetIsCritical + +`func (o *Actor) SetIsCritical(v bool)` + +SetIsCritical sets IsCritical field to given value. + +### HasIsCritical + +`func (o *Actor) HasIsCritical() bool` + +HasIsCritical returns a boolean if a field has been set. + +### GetIsGeneric + +`func (o *Actor) GetIsGeneric() bool` + +GetIsGeneric returns the IsGeneric field if non-nil, zero value otherwise. + +### GetIsGenericOk + +`func (o *Actor) GetIsGenericOk() (*bool, bool)` + +GetIsGenericOk returns a tuple with the IsGeneric field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetIsGeneric + +`func (o *Actor) SetIsGeneric(v bool)` + +SetIsGeneric sets IsGeneric field to given value. + +### HasIsGeneric + +`func (o *Actor) HasIsGeneric() bool` + +HasIsGeneric returns a boolean if a field has been set. + +### GetIsSourceCodeHidden + +`func (o *Actor) GetIsSourceCodeHidden() bool` + +GetIsSourceCodeHidden returns the IsSourceCodeHidden field if non-nil, zero value otherwise. + +### GetIsSourceCodeHiddenOk + +`func (o *Actor) GetIsSourceCodeHiddenOk() (*bool, bool)` + +GetIsSourceCodeHiddenOk returns a tuple with the IsSourceCodeHidden field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetIsSourceCodeHidden + +`func (o *Actor) SetIsSourceCodeHidden(v bool)` + +SetIsSourceCodeHidden sets IsSourceCodeHidden field to given value. + +### HasIsSourceCodeHidden + +`func (o *Actor) HasIsSourceCodeHidden() bool` + +HasIsSourceCodeHidden returns a boolean if a field has been set. + +### GetHasNoDataset + +`func (o *Actor) GetHasNoDataset() bool` + +GetHasNoDataset returns the HasNoDataset field if non-nil, zero value otherwise. + +### GetHasNoDatasetOk + +`func (o *Actor) GetHasNoDatasetOk() (*bool, bool)` + +GetHasNoDatasetOk returns a tuple with the HasNoDataset field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetHasNoDataset + +`func (o *Actor) SetHasNoDataset(v bool)` + +SetHasNoDataset sets HasNoDataset field to given value. + +### HasHasNoDataset + +`func (o *Actor) HasHasNoDataset() bool` + +HasHasNoDataset returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ActorBuildsAPI.md b/docs/ActorBuildsAPI.md new file mode 100644 index 0000000..8fb5704 --- /dev/null +++ b/docs/ActorBuildsAPI.md @@ -0,0 +1,438 @@ +# \ActorBuildsAPI + +All URIs are relative to *https://api.apify.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**ActorBuildAbortPost**](ActorBuildsAPI.md#ActorBuildAbortPost) | **Post** /v2/actor-builds/{buildId}/abort | Abort build +[**ActorBuildDelete**](ActorBuildsAPI.md#ActorBuildDelete) | **Delete** /v2/actor-builds/{buildId} | Delete build +[**ActorBuildGet**](ActorBuildsAPI.md#ActorBuildGet) | **Get** /v2/actor-builds/{buildId} | Get build +[**ActorBuildLogGet**](ActorBuildsAPI.md#ActorBuildLogGet) | **Get** /v2/actor-builds/{buildId}/log | Get build's Log +[**ActorBuildOpenapiJsonGet**](ActorBuildsAPI.md#ActorBuildOpenapiJsonGet) | **Get** /v2/actor-builds/{buildId}/openapi.json | Get OpenAPI definition +[**ActorBuildsGet**](ActorBuildsAPI.md#ActorBuildsGet) | **Get** /v2/actor-builds | Get user builds list + + + +## ActorBuildAbortPost + +> BuildResponse ActorBuildAbortPost(ctx, buildId).Execute() + +Abort build + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + buildId := "soSkq9ekdmfOslopH" // string | ID of the build, found in the build's Info tab. + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.ActorBuildsAPI.ActorBuildAbortPost(context.Background(), buildId).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ActorBuildsAPI.ActorBuildAbortPost``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ActorBuildAbortPost`: BuildResponse + fmt.Fprintf(os.Stdout, "Response from `ActorBuildsAPI.ActorBuildAbortPost`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**buildId** | **string** | ID of the build, found in the build's Info tab. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiActorBuildAbortPostRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + +### Return type + +[**BuildResponse**](BuildResponse.md) + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## ActorBuildDelete + +> ActorBuildDelete(ctx, buildId).Execute() + +Delete build + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + buildId := "soSkq9ekdmfOslopH" // string | ID of the build, found in the build's Info tab. + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + r, err := apiClient.ActorBuildsAPI.ActorBuildDelete(context.Background(), buildId).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ActorBuildsAPI.ActorBuildDelete``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**buildId** | **string** | ID of the build, found in the build's Info tab. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiActorBuildDeleteRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + +### Return type + + (empty response body) + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## ActorBuildGet + +> BuildResponse ActorBuildGet(ctx, buildId).WaitForFinish(waitForFinish).Execute() + +Get build + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + buildId := "soSkq9ekdmfOslopH" // string | ID of the build, found in the build's Info tab. + waitForFinish := float64(60) // float64 | The maximum number of seconds the server waits for the build to finish. By default it is `0`, the maximum value is `60`. <!-- MAX_ACTOR_JOB_ASYNC_WAIT_SECS --> If the build finishes in time then the returned build object will have a terminal status (e.g. `SUCCEEDED`), otherwise it will have a transitional status (e.g. `RUNNING`). (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.ActorBuildsAPI.ActorBuildGet(context.Background(), buildId).WaitForFinish(waitForFinish).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ActorBuildsAPI.ActorBuildGet``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ActorBuildGet`: BuildResponse + fmt.Fprintf(os.Stdout, "Response from `ActorBuildsAPI.ActorBuildGet`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**buildId** | **string** | ID of the build, found in the build's Info tab. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiActorBuildGetRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **waitForFinish** | **float64** | The maximum number of seconds the server waits for the build to finish. By default it is `0`, the maximum value is `60`. <!-- MAX_ACTOR_JOB_ASYNC_WAIT_SECS --> If the build finishes in time then the returned build object will have a terminal status (e.g. `SUCCEEDED`), otherwise it will have a transitional status (e.g. `RUNNING`). | + +### Return type + +[**BuildResponse**](BuildResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## ActorBuildLogGet + +> string ActorBuildLogGet(ctx, buildId).Stream(stream).Download(download).Execute() + +Get build's Log + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + buildId := "soSkq9ekdmfOslopH" // string | ID of the build, found in the build's Info tab. + stream := false // bool | If `true` or `1` then the logs will be streamed as long as the run or build is running. (optional) + download := false // bool | If `true` or `1` then the web browser will download the log file rather than open it in a tab. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.ActorBuildsAPI.ActorBuildLogGet(context.Background(), buildId).Stream(stream).Download(download).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ActorBuildsAPI.ActorBuildLogGet``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ActorBuildLogGet`: string + fmt.Fprintf(os.Stdout, "Response from `ActorBuildsAPI.ActorBuildLogGet`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**buildId** | **string** | ID of the build, found in the build's Info tab. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiActorBuildLogGetRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **stream** | **bool** | If `true` or `1` then the logs will be streamed as long as the run or build is running. | + **download** | **bool** | If `true` or `1` then the web browser will download the log file rather than open it in a tab. | + +### Return type + +**string** + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: text/plain, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## ActorBuildOpenapiJsonGet + +> map[string]interface{} ActorBuildOpenapiJsonGet(ctx, buildId).Execute() + +Get OpenAPI definition + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + buildId := "soSkq9ekdmfOslopH" // string | ID of the build, found in the build's Info tab. Use the special value `default` to get the OpenAPI schema for the Actor's default build. + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.ActorBuildsAPI.ActorBuildOpenapiJsonGet(context.Background(), buildId).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ActorBuildsAPI.ActorBuildOpenapiJsonGet``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ActorBuildOpenapiJsonGet`: map[string]interface{} + fmt.Fprintf(os.Stdout, "Response from `ActorBuildsAPI.ActorBuildOpenapiJsonGet`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**buildId** | **string** | ID of the build, found in the build's Info tab. Use the special value `default` to get the OpenAPI schema for the Actor's default build. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiActorBuildOpenapiJsonGetRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + +### Return type + +**map[string]interface{}** + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## ActorBuildsGet + +> ListOfBuildsResponse ActorBuildsGet(ctx).Offset(offset).Limit(limit).Desc(desc).Execute() + +Get user builds list + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + offset := float64(0) // float64 | Number of items that should be skipped at the start. The default value is `0`. (optional) + limit := float64(1000) // float64 | Maximum number of items to return. The default value as well as the maximum is `1000`. (optional) + desc := true // bool | If `true` or `1` then the objects are sorted by the `startedAt` field in descending order. By default, they are sorted in ascending order. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.ActorBuildsAPI.ActorBuildsGet(context.Background()).Offset(offset).Limit(limit).Desc(desc).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ActorBuildsAPI.ActorBuildsGet``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ActorBuildsGet`: ListOfBuildsResponse + fmt.Fprintf(os.Stdout, "Response from `ActorBuildsAPI.ActorBuildsGet`: %v\n", resp) +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiActorBuildsGetRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **offset** | **float64** | Number of items that should be skipped at the start. The default value is `0`. | + **limit** | **float64** | Maximum number of items to return. The default value as well as the maximum is `1000`. | + **desc** | **bool** | If `true` or `1` then the objects are sorted by the `startedAt` field in descending order. By default, they are sorted in ascending order. | + +### Return type + +[**ListOfBuildsResponse**](ListOfBuildsResponse.md) + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/docs/ActorChargeEvent.md b/docs/ActorChargeEvent.md new file mode 100644 index 0000000..d818aa9 --- /dev/null +++ b/docs/ActorChargeEvent.md @@ -0,0 +1,176 @@ +# ActorChargeEvent + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**EventTitle** | **string** | Human-readable title shown to users in the billing UI. | +**EventDescription** | **string** | Human-readable description of what triggers this event. | +**EventPriceUsd** | Pointer to **float32** | Flat price per event in USD. Present only for non-tiered events. Mutually exclusive with `eventTieredPricingUsd`. | [optional] +**EventTieredPricingUsd** | Pointer to [**map[string]TieredPricingPerEventEntry**](TieredPricingPerEventEntry.md) | Tiered price-per-event pricing for a single charge event, keyed by subscription tier (e.g. `FREE`, `BRONZE`, `SILVER`, `GOLD`, `PLATINUM`, `DIAMOND`). The actual price applied is resolved from the user's tier. | [optional] +**IsPrimaryEvent** | Pointer to **bool** | Whether this event is the Actor's primary chargeable event. | [optional] +**IsOneTimeEvent** | Pointer to **bool** | Whether this event can only be charged once per Actor run. | [optional] + +## Methods + +### NewActorChargeEvent + +`func NewActorChargeEvent(eventTitle string, eventDescription string, ) *ActorChargeEvent` + +NewActorChargeEvent instantiates a new ActorChargeEvent object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewActorChargeEventWithDefaults + +`func NewActorChargeEventWithDefaults() *ActorChargeEvent` + +NewActorChargeEventWithDefaults instantiates a new ActorChargeEvent object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetEventTitle + +`func (o *ActorChargeEvent) GetEventTitle() string` + +GetEventTitle returns the EventTitle field if non-nil, zero value otherwise. + +### GetEventTitleOk + +`func (o *ActorChargeEvent) GetEventTitleOk() (*string, bool)` + +GetEventTitleOk returns a tuple with the EventTitle field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetEventTitle + +`func (o *ActorChargeEvent) SetEventTitle(v string)` + +SetEventTitle sets EventTitle field to given value. + + +### GetEventDescription + +`func (o *ActorChargeEvent) GetEventDescription() string` + +GetEventDescription returns the EventDescription field if non-nil, zero value otherwise. + +### GetEventDescriptionOk + +`func (o *ActorChargeEvent) GetEventDescriptionOk() (*string, bool)` + +GetEventDescriptionOk returns a tuple with the EventDescription field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetEventDescription + +`func (o *ActorChargeEvent) SetEventDescription(v string)` + +SetEventDescription sets EventDescription field to given value. + + +### GetEventPriceUsd + +`func (o *ActorChargeEvent) GetEventPriceUsd() float32` + +GetEventPriceUsd returns the EventPriceUsd field if non-nil, zero value otherwise. + +### GetEventPriceUsdOk + +`func (o *ActorChargeEvent) GetEventPriceUsdOk() (*float32, bool)` + +GetEventPriceUsdOk returns a tuple with the EventPriceUsd field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetEventPriceUsd + +`func (o *ActorChargeEvent) SetEventPriceUsd(v float32)` + +SetEventPriceUsd sets EventPriceUsd field to given value. + +### HasEventPriceUsd + +`func (o *ActorChargeEvent) HasEventPriceUsd() bool` + +HasEventPriceUsd returns a boolean if a field has been set. + +### GetEventTieredPricingUsd + +`func (o *ActorChargeEvent) GetEventTieredPricingUsd() map[string]TieredPricingPerEventEntry` + +GetEventTieredPricingUsd returns the EventTieredPricingUsd field if non-nil, zero value otherwise. + +### GetEventTieredPricingUsdOk + +`func (o *ActorChargeEvent) GetEventTieredPricingUsdOk() (*map[string]TieredPricingPerEventEntry, bool)` + +GetEventTieredPricingUsdOk returns a tuple with the EventTieredPricingUsd field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetEventTieredPricingUsd + +`func (o *ActorChargeEvent) SetEventTieredPricingUsd(v map[string]TieredPricingPerEventEntry)` + +SetEventTieredPricingUsd sets EventTieredPricingUsd field to given value. + +### HasEventTieredPricingUsd + +`func (o *ActorChargeEvent) HasEventTieredPricingUsd() bool` + +HasEventTieredPricingUsd returns a boolean if a field has been set. + +### GetIsPrimaryEvent + +`func (o *ActorChargeEvent) GetIsPrimaryEvent() bool` + +GetIsPrimaryEvent returns the IsPrimaryEvent field if non-nil, zero value otherwise. + +### GetIsPrimaryEventOk + +`func (o *ActorChargeEvent) GetIsPrimaryEventOk() (*bool, bool)` + +GetIsPrimaryEventOk returns a tuple with the IsPrimaryEvent field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetIsPrimaryEvent + +`func (o *ActorChargeEvent) SetIsPrimaryEvent(v bool)` + +SetIsPrimaryEvent sets IsPrimaryEvent field to given value. + +### HasIsPrimaryEvent + +`func (o *ActorChargeEvent) HasIsPrimaryEvent() bool` + +HasIsPrimaryEvent returns a boolean if a field has been set. + +### GetIsOneTimeEvent + +`func (o *ActorChargeEvent) GetIsOneTimeEvent() bool` + +GetIsOneTimeEvent returns the IsOneTimeEvent field if non-nil, zero value otherwise. + +### GetIsOneTimeEventOk + +`func (o *ActorChargeEvent) GetIsOneTimeEventOk() (*bool, bool)` + +GetIsOneTimeEventOk returns a tuple with the IsOneTimeEvent field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetIsOneTimeEvent + +`func (o *ActorChargeEvent) SetIsOneTimeEvent(v bool)` + +SetIsOneTimeEvent sets IsOneTimeEvent field to given value. + +### HasIsOneTimeEvent + +`func (o *ActorChargeEvent) HasIsOneTimeEvent() bool` + +HasIsOneTimeEvent returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ActorDefinition.md b/docs/ActorDefinition.md new file mode 100644 index 0000000..faeeb58 --- /dev/null +++ b/docs/ActorDefinition.md @@ -0,0 +1,420 @@ +# ActorDefinition + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ActorSpecification** | Pointer to **int32** | The Actor specification version that this Actor follows. This property must be set to 1. | [optional] +**Name** | Pointer to **string** | The name of the Actor. | [optional] +**Version** | Pointer to **string** | The version of the Actor, typically a dot-separated sequence of numbers (e.g., `0.1`, `1.0`, or `0.0.1`). | [optional] +**BuildTag** | Pointer to **string** | The tag name to be applied to a successful build of the Actor. Defaults to 'latest' if not specified. | [optional] +**EnvironmentVariables** | Pointer to **map[string]string** | A map of environment variables to be used during local development and deployment. | [optional] +**Dockerfile** | Pointer to **string** | The path to the Dockerfile used for building the Actor on the platform. | [optional] +**DockerContextDir** | Pointer to **string** | The path to the directory used as the Docker context when building the Actor. | [optional] +**Readme** | Pointer to **string** | The path to the README file for the Actor. | [optional] +**Input** | Pointer to **map[string]interface{}** | The input schema object, the full specification can be found in [Apify docs](https://docs.apify.com/platform/actors/development/actor-definition/input-schema) | [optional] +**Changelog** | Pointer to **string** | The path to the CHANGELOG file displayed in the Actor's information tab. | [optional] +**Storages** | Pointer to [**ActorDefinitionStorages**](ActorDefinitionStorages.md) | | [optional] +**DefaultMemoryMbytes** | Pointer to [**ActorDefinitionDefaultMemoryMbytes**](ActorDefinitionDefaultMemoryMbytes.md) | | [optional] +**MinMemoryMbytes** | Pointer to **int32** | Specifies the minimum amount of memory in megabytes required by the Actor. | [optional] +**MaxMemoryMbytes** | Pointer to **int32** | Specifies the maximum amount of memory in megabytes required by the Actor. | [optional] +**UsesStandbyMode** | Pointer to **bool** | Specifies whether Standby mode is enabled for the Actor. | [optional] + +## Methods + +### NewActorDefinition + +`func NewActorDefinition() *ActorDefinition` + +NewActorDefinition instantiates a new ActorDefinition object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewActorDefinitionWithDefaults + +`func NewActorDefinitionWithDefaults() *ActorDefinition` + +NewActorDefinitionWithDefaults instantiates a new ActorDefinition object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetActorSpecification + +`func (o *ActorDefinition) GetActorSpecification() int32` + +GetActorSpecification returns the ActorSpecification field if non-nil, zero value otherwise. + +### GetActorSpecificationOk + +`func (o *ActorDefinition) GetActorSpecificationOk() (*int32, bool)` + +GetActorSpecificationOk returns a tuple with the ActorSpecification field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetActorSpecification + +`func (o *ActorDefinition) SetActorSpecification(v int32)` + +SetActorSpecification sets ActorSpecification field to given value. + +### HasActorSpecification + +`func (o *ActorDefinition) HasActorSpecification() bool` + +HasActorSpecification returns a boolean if a field has been set. + +### GetName + +`func (o *ActorDefinition) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *ActorDefinition) GetNameOk() (*string, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetName + +`func (o *ActorDefinition) SetName(v string)` + +SetName sets Name field to given value. + +### HasName + +`func (o *ActorDefinition) HasName() bool` + +HasName returns a boolean if a field has been set. + +### GetVersion + +`func (o *ActorDefinition) GetVersion() string` + +GetVersion returns the Version field if non-nil, zero value otherwise. + +### GetVersionOk + +`func (o *ActorDefinition) GetVersionOk() (*string, bool)` + +GetVersionOk returns a tuple with the Version field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetVersion + +`func (o *ActorDefinition) SetVersion(v string)` + +SetVersion sets Version field to given value. + +### HasVersion + +`func (o *ActorDefinition) HasVersion() bool` + +HasVersion returns a boolean if a field has been set. + +### GetBuildTag + +`func (o *ActorDefinition) GetBuildTag() string` + +GetBuildTag returns the BuildTag field if non-nil, zero value otherwise. + +### GetBuildTagOk + +`func (o *ActorDefinition) GetBuildTagOk() (*string, bool)` + +GetBuildTagOk returns a tuple with the BuildTag field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetBuildTag + +`func (o *ActorDefinition) SetBuildTag(v string)` + +SetBuildTag sets BuildTag field to given value. + +### HasBuildTag + +`func (o *ActorDefinition) HasBuildTag() bool` + +HasBuildTag returns a boolean if a field has been set. + +### GetEnvironmentVariables + +`func (o *ActorDefinition) GetEnvironmentVariables() map[string]string` + +GetEnvironmentVariables returns the EnvironmentVariables field if non-nil, zero value otherwise. + +### GetEnvironmentVariablesOk + +`func (o *ActorDefinition) GetEnvironmentVariablesOk() (*map[string]string, bool)` + +GetEnvironmentVariablesOk returns a tuple with the EnvironmentVariables field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetEnvironmentVariables + +`func (o *ActorDefinition) SetEnvironmentVariables(v map[string]string)` + +SetEnvironmentVariables sets EnvironmentVariables field to given value. + +### HasEnvironmentVariables + +`func (o *ActorDefinition) HasEnvironmentVariables() bool` + +HasEnvironmentVariables returns a boolean if a field has been set. + +### GetDockerfile + +`func (o *ActorDefinition) GetDockerfile() string` + +GetDockerfile returns the Dockerfile field if non-nil, zero value otherwise. + +### GetDockerfileOk + +`func (o *ActorDefinition) GetDockerfileOk() (*string, bool)` + +GetDockerfileOk returns a tuple with the Dockerfile field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDockerfile + +`func (o *ActorDefinition) SetDockerfile(v string)` + +SetDockerfile sets Dockerfile field to given value. + +### HasDockerfile + +`func (o *ActorDefinition) HasDockerfile() bool` + +HasDockerfile returns a boolean if a field has been set. + +### GetDockerContextDir + +`func (o *ActorDefinition) GetDockerContextDir() string` + +GetDockerContextDir returns the DockerContextDir field if non-nil, zero value otherwise. + +### GetDockerContextDirOk + +`func (o *ActorDefinition) GetDockerContextDirOk() (*string, bool)` + +GetDockerContextDirOk returns a tuple with the DockerContextDir field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDockerContextDir + +`func (o *ActorDefinition) SetDockerContextDir(v string)` + +SetDockerContextDir sets DockerContextDir field to given value. + +### HasDockerContextDir + +`func (o *ActorDefinition) HasDockerContextDir() bool` + +HasDockerContextDir returns a boolean if a field has been set. + +### GetReadme + +`func (o *ActorDefinition) GetReadme() string` + +GetReadme returns the Readme field if non-nil, zero value otherwise. + +### GetReadmeOk + +`func (o *ActorDefinition) GetReadmeOk() (*string, bool)` + +GetReadmeOk returns a tuple with the Readme field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetReadme + +`func (o *ActorDefinition) SetReadme(v string)` + +SetReadme sets Readme field to given value. + +### HasReadme + +`func (o *ActorDefinition) HasReadme() bool` + +HasReadme returns a boolean if a field has been set. + +### GetInput + +`func (o *ActorDefinition) GetInput() map[string]interface{}` + +GetInput returns the Input field if non-nil, zero value otherwise. + +### GetInputOk + +`func (o *ActorDefinition) GetInputOk() (*map[string]interface{}, bool)` + +GetInputOk returns a tuple with the Input field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetInput + +`func (o *ActorDefinition) SetInput(v map[string]interface{})` + +SetInput sets Input field to given value. + +### HasInput + +`func (o *ActorDefinition) HasInput() bool` + +HasInput returns a boolean if a field has been set. + +### GetChangelog + +`func (o *ActorDefinition) GetChangelog() string` + +GetChangelog returns the Changelog field if non-nil, zero value otherwise. + +### GetChangelogOk + +`func (o *ActorDefinition) GetChangelogOk() (*string, bool)` + +GetChangelogOk returns a tuple with the Changelog field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetChangelog + +`func (o *ActorDefinition) SetChangelog(v string)` + +SetChangelog sets Changelog field to given value. + +### HasChangelog + +`func (o *ActorDefinition) HasChangelog() bool` + +HasChangelog returns a boolean if a field has been set. + +### GetStorages + +`func (o *ActorDefinition) GetStorages() ActorDefinitionStorages` + +GetStorages returns the Storages field if non-nil, zero value otherwise. + +### GetStoragesOk + +`func (o *ActorDefinition) GetStoragesOk() (*ActorDefinitionStorages, bool)` + +GetStoragesOk returns a tuple with the Storages field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetStorages + +`func (o *ActorDefinition) SetStorages(v ActorDefinitionStorages)` + +SetStorages sets Storages field to given value. + +### HasStorages + +`func (o *ActorDefinition) HasStorages() bool` + +HasStorages returns a boolean if a field has been set. + +### GetDefaultMemoryMbytes + +`func (o *ActorDefinition) GetDefaultMemoryMbytes() ActorDefinitionDefaultMemoryMbytes` + +GetDefaultMemoryMbytes returns the DefaultMemoryMbytes field if non-nil, zero value otherwise. + +### GetDefaultMemoryMbytesOk + +`func (o *ActorDefinition) GetDefaultMemoryMbytesOk() (*ActorDefinitionDefaultMemoryMbytes, bool)` + +GetDefaultMemoryMbytesOk returns a tuple with the DefaultMemoryMbytes field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDefaultMemoryMbytes + +`func (o *ActorDefinition) SetDefaultMemoryMbytes(v ActorDefinitionDefaultMemoryMbytes)` + +SetDefaultMemoryMbytes sets DefaultMemoryMbytes field to given value. + +### HasDefaultMemoryMbytes + +`func (o *ActorDefinition) HasDefaultMemoryMbytes() bool` + +HasDefaultMemoryMbytes returns a boolean if a field has been set. + +### GetMinMemoryMbytes + +`func (o *ActorDefinition) GetMinMemoryMbytes() int32` + +GetMinMemoryMbytes returns the MinMemoryMbytes field if non-nil, zero value otherwise. + +### GetMinMemoryMbytesOk + +`func (o *ActorDefinition) GetMinMemoryMbytesOk() (*int32, bool)` + +GetMinMemoryMbytesOk returns a tuple with the MinMemoryMbytes field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMinMemoryMbytes + +`func (o *ActorDefinition) SetMinMemoryMbytes(v int32)` + +SetMinMemoryMbytes sets MinMemoryMbytes field to given value. + +### HasMinMemoryMbytes + +`func (o *ActorDefinition) HasMinMemoryMbytes() bool` + +HasMinMemoryMbytes returns a boolean if a field has been set. + +### GetMaxMemoryMbytes + +`func (o *ActorDefinition) GetMaxMemoryMbytes() int32` + +GetMaxMemoryMbytes returns the MaxMemoryMbytes field if non-nil, zero value otherwise. + +### GetMaxMemoryMbytesOk + +`func (o *ActorDefinition) GetMaxMemoryMbytesOk() (*int32, bool)` + +GetMaxMemoryMbytesOk returns a tuple with the MaxMemoryMbytes field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMaxMemoryMbytes + +`func (o *ActorDefinition) SetMaxMemoryMbytes(v int32)` + +SetMaxMemoryMbytes sets MaxMemoryMbytes field to given value. + +### HasMaxMemoryMbytes + +`func (o *ActorDefinition) HasMaxMemoryMbytes() bool` + +HasMaxMemoryMbytes returns a boolean if a field has been set. + +### GetUsesStandbyMode + +`func (o *ActorDefinition) GetUsesStandbyMode() bool` + +GetUsesStandbyMode returns the UsesStandbyMode field if non-nil, zero value otherwise. + +### GetUsesStandbyModeOk + +`func (o *ActorDefinition) GetUsesStandbyModeOk() (*bool, bool)` + +GetUsesStandbyModeOk returns a tuple with the UsesStandbyMode field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUsesStandbyMode + +`func (o *ActorDefinition) SetUsesStandbyMode(v bool)` + +SetUsesStandbyMode sets UsesStandbyMode field to given value. + +### HasUsesStandbyMode + +`func (o *ActorDefinition) HasUsesStandbyMode() bool` + +HasUsesStandbyMode returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ActorDefinitionDefaultMemoryMbytes.md b/docs/ActorDefinitionDefaultMemoryMbytes.md new file mode 100644 index 0000000..ab2f836 --- /dev/null +++ b/docs/ActorDefinitionDefaultMemoryMbytes.md @@ -0,0 +1,30 @@ +# ActorDefinitionDefaultMemoryMbytes + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +## Methods + +### NewActorDefinitionDefaultMemoryMbytes + +`func NewActorDefinitionDefaultMemoryMbytes() *ActorDefinitionDefaultMemoryMbytes` + +NewActorDefinitionDefaultMemoryMbytes instantiates a new ActorDefinitionDefaultMemoryMbytes object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewActorDefinitionDefaultMemoryMbytesWithDefaults + +`func NewActorDefinitionDefaultMemoryMbytesWithDefaults() *ActorDefinitionDefaultMemoryMbytes` + +NewActorDefinitionDefaultMemoryMbytesWithDefaults instantiates a new ActorDefinitionDefaultMemoryMbytes object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ActorDefinitionStorages.md b/docs/ActorDefinitionStorages.md new file mode 100644 index 0000000..937541c --- /dev/null +++ b/docs/ActorDefinitionStorages.md @@ -0,0 +1,56 @@ +# ActorDefinitionStorages + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Dataset** | Pointer to **map[string]interface{}** | Defines the schema of items in your dataset, the full specification can be found in [Apify docs](https://docs.apify.com/platform/actors/development/actor-definition/dataset-schema) | [optional] + +## Methods + +### NewActorDefinitionStorages + +`func NewActorDefinitionStorages() *ActorDefinitionStorages` + +NewActorDefinitionStorages instantiates a new ActorDefinitionStorages object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewActorDefinitionStoragesWithDefaults + +`func NewActorDefinitionStoragesWithDefaults() *ActorDefinitionStorages` + +NewActorDefinitionStoragesWithDefaults instantiates a new ActorDefinitionStorages object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetDataset + +`func (o *ActorDefinitionStorages) GetDataset() map[string]interface{}` + +GetDataset returns the Dataset field if non-nil, zero value otherwise. + +### GetDatasetOk + +`func (o *ActorDefinitionStorages) GetDatasetOk() (*map[string]interface{}, bool)` + +GetDatasetOk returns a tuple with the Dataset field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDataset + +`func (o *ActorDefinitionStorages) SetDataset(v map[string]interface{})` + +SetDataset sets Dataset field to given value. + +### HasDataset + +`func (o *ActorDefinitionStorages) HasDataset() bool` + +HasDataset returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ActorJobStatus.md b/docs/ActorJobStatus.md new file mode 100644 index 0000000..4811a84 --- /dev/null +++ b/docs/ActorJobStatus.md @@ -0,0 +1,25 @@ +# ActorJobStatus + +## Enum + + +* `READY` (value: `"READY"`) + +* `RUNNING` (value: `"RUNNING"`) + +* `SUCCEEDED` (value: `"SUCCEEDED"`) + +* `FAILED` (value: `"FAILED"`) + +* `TIMING_OUT` (value: `"TIMING-OUT"`) + +* `TIMED_OUT` (value: `"TIMED-OUT"`) + +* `ABORTING` (value: `"ABORTING"`) + +* `ABORTED` (value: `"ABORTED"`) + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ActorPermissionLevel.md b/docs/ActorPermissionLevel.md new file mode 100644 index 0000000..7f2aa27 --- /dev/null +++ b/docs/ActorPermissionLevel.md @@ -0,0 +1,13 @@ +# ActorPermissionLevel + +## Enum + + +* `LIMITED_PERMISSIONS` (value: `"LIMITED_PERMISSIONS"`) + +* `FULL_PERMISSIONS` (value: `"FULL_PERMISSIONS"`) + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ActorResponse.md b/docs/ActorResponse.md new file mode 100644 index 0000000..6305a21 --- /dev/null +++ b/docs/ActorResponse.md @@ -0,0 +1,51 @@ +# ActorResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Data** | [**Actor**](Actor.md) | | + +## Methods + +### NewActorResponse + +`func NewActorResponse(data Actor, ) *ActorResponse` + +NewActorResponse instantiates a new ActorResponse object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewActorResponseWithDefaults + +`func NewActorResponseWithDefaults() *ActorResponse` + +NewActorResponseWithDefaults instantiates a new ActorResponse object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetData + +`func (o *ActorResponse) GetData() Actor` + +GetData returns the Data field if non-nil, zero value otherwise. + +### GetDataOk + +`func (o *ActorResponse) GetDataOk() (*Actor, bool)` + +GetDataOk returns a tuple with the Data field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetData + +`func (o *ActorResponse) SetData(v Actor)` + +SetData sets Data field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ActorRunFailedError.md b/docs/ActorRunFailedError.md new file mode 100644 index 0000000..493b82f --- /dev/null +++ b/docs/ActorRunFailedError.md @@ -0,0 +1,56 @@ +# ActorRunFailedError + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Error** | Pointer to [**RunFailedErrorDetail**](RunFailedErrorDetail.md) | | [optional] + +## Methods + +### NewActorRunFailedError + +`func NewActorRunFailedError() *ActorRunFailedError` + +NewActorRunFailedError instantiates a new ActorRunFailedError object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewActorRunFailedErrorWithDefaults + +`func NewActorRunFailedErrorWithDefaults() *ActorRunFailedError` + +NewActorRunFailedErrorWithDefaults instantiates a new ActorRunFailedError object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetError + +`func (o *ActorRunFailedError) GetError() RunFailedErrorDetail` + +GetError returns the Error field if non-nil, zero value otherwise. + +### GetErrorOk + +`func (o *ActorRunFailedError) GetErrorOk() (*RunFailedErrorDetail, bool)` + +GetErrorOk returns a tuple with the Error field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetError + +`func (o *ActorRunFailedError) SetError(v RunFailedErrorDetail)` + +SetError sets Error field to given value. + +### HasError + +`func (o *ActorRunFailedError) HasError() bool` + +HasError returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ActorRunPricingInfo.md b/docs/ActorRunPricingInfo.md new file mode 100644 index 0000000..577f8c9 --- /dev/null +++ b/docs/ActorRunPricingInfo.md @@ -0,0 +1,380 @@ +# ActorRunPricingInfo + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ApifyMarginPercentage** | **float32** | In [0, 1], fraction of pricePerUnitUsd that goes to Apify | +**CreatedAt** | **time.Time** | When this pricing info record has been created | +**StartedAt** | **time.Time** | Since when is this pricing info record effective for a given Actor | +**NotifiedAboutFutureChangeAt** | Pointer to **time.Time** | | [optional] +**NotifiedAboutChangeAt** | Pointer to **time.Time** | | [optional] +**ReasonForChange** | Pointer to **string** | | [optional] +**IsPriceChangeNotificationSuppressed** | Pointer to **bool** | | [optional] +**ForceContainsSignificantPriceChange** | Pointer to **bool** | | [optional] +**PricingModel** | **string** | | +**PricingPerEvent** | [**PayPerEventActorPricingInfoAllOfPricingPerEvent**](PayPerEventActorPricingInfoAllOfPricingPerEvent.md) | | +**MinimalMaxTotalChargeUsd** | Pointer to **float32** | | [optional] +**UnitName** | **string** | Name of the unit that is being charged | +**PricePerUnitUsd** | **float32** | Monthly flat price in USD | +**TieredPricing** | Pointer to [**map[string]TieredPricingPerDatasetItemEntry**](TieredPricingPerDatasetItemEntry.md) | Tiered price-per-dataset-item pricing, keyed by subscription tier (e.g. `FREE`, `BRONZE`, `SILVER`, `GOLD`, `PLATINUM`, `DIAMOND`). The actual price applied to a run is resolved from the user's tier. | [optional] +**TrialMinutes** | **int32** | For how long this Actor can be used for free in trial period | + +## Methods + +### NewActorRunPricingInfo + +`func NewActorRunPricingInfo(apifyMarginPercentage float32, createdAt time.Time, startedAt time.Time, pricingModel string, pricingPerEvent PayPerEventActorPricingInfoAllOfPricingPerEvent, unitName string, pricePerUnitUsd float32, trialMinutes int32, ) *ActorRunPricingInfo` + +NewActorRunPricingInfo instantiates a new ActorRunPricingInfo object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewActorRunPricingInfoWithDefaults + +`func NewActorRunPricingInfoWithDefaults() *ActorRunPricingInfo` + +NewActorRunPricingInfoWithDefaults instantiates a new ActorRunPricingInfo object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetApifyMarginPercentage + +`func (o *ActorRunPricingInfo) GetApifyMarginPercentage() float32` + +GetApifyMarginPercentage returns the ApifyMarginPercentage field if non-nil, zero value otherwise. + +### GetApifyMarginPercentageOk + +`func (o *ActorRunPricingInfo) GetApifyMarginPercentageOk() (*float32, bool)` + +GetApifyMarginPercentageOk returns a tuple with the ApifyMarginPercentage field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetApifyMarginPercentage + +`func (o *ActorRunPricingInfo) SetApifyMarginPercentage(v float32)` + +SetApifyMarginPercentage sets ApifyMarginPercentage field to given value. + + +### GetCreatedAt + +`func (o *ActorRunPricingInfo) GetCreatedAt() time.Time` + +GetCreatedAt returns the CreatedAt field if non-nil, zero value otherwise. + +### GetCreatedAtOk + +`func (o *ActorRunPricingInfo) GetCreatedAtOk() (*time.Time, bool)` + +GetCreatedAtOk returns a tuple with the CreatedAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCreatedAt + +`func (o *ActorRunPricingInfo) SetCreatedAt(v time.Time)` + +SetCreatedAt sets CreatedAt field to given value. + + +### GetStartedAt + +`func (o *ActorRunPricingInfo) GetStartedAt() time.Time` + +GetStartedAt returns the StartedAt field if non-nil, zero value otherwise. + +### GetStartedAtOk + +`func (o *ActorRunPricingInfo) GetStartedAtOk() (*time.Time, bool)` + +GetStartedAtOk returns a tuple with the StartedAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetStartedAt + +`func (o *ActorRunPricingInfo) SetStartedAt(v time.Time)` + +SetStartedAt sets StartedAt field to given value. + + +### GetNotifiedAboutFutureChangeAt + +`func (o *ActorRunPricingInfo) GetNotifiedAboutFutureChangeAt() time.Time` + +GetNotifiedAboutFutureChangeAt returns the NotifiedAboutFutureChangeAt field if non-nil, zero value otherwise. + +### GetNotifiedAboutFutureChangeAtOk + +`func (o *ActorRunPricingInfo) GetNotifiedAboutFutureChangeAtOk() (*time.Time, bool)` + +GetNotifiedAboutFutureChangeAtOk returns a tuple with the NotifiedAboutFutureChangeAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetNotifiedAboutFutureChangeAt + +`func (o *ActorRunPricingInfo) SetNotifiedAboutFutureChangeAt(v time.Time)` + +SetNotifiedAboutFutureChangeAt sets NotifiedAboutFutureChangeAt field to given value. + +### HasNotifiedAboutFutureChangeAt + +`func (o *ActorRunPricingInfo) HasNotifiedAboutFutureChangeAt() bool` + +HasNotifiedAboutFutureChangeAt returns a boolean if a field has been set. + +### GetNotifiedAboutChangeAt + +`func (o *ActorRunPricingInfo) GetNotifiedAboutChangeAt() time.Time` + +GetNotifiedAboutChangeAt returns the NotifiedAboutChangeAt field if non-nil, zero value otherwise. + +### GetNotifiedAboutChangeAtOk + +`func (o *ActorRunPricingInfo) GetNotifiedAboutChangeAtOk() (*time.Time, bool)` + +GetNotifiedAboutChangeAtOk returns a tuple with the NotifiedAboutChangeAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetNotifiedAboutChangeAt + +`func (o *ActorRunPricingInfo) SetNotifiedAboutChangeAt(v time.Time)` + +SetNotifiedAboutChangeAt sets NotifiedAboutChangeAt field to given value. + +### HasNotifiedAboutChangeAt + +`func (o *ActorRunPricingInfo) HasNotifiedAboutChangeAt() bool` + +HasNotifiedAboutChangeAt returns a boolean if a field has been set. + +### GetReasonForChange + +`func (o *ActorRunPricingInfo) GetReasonForChange() string` + +GetReasonForChange returns the ReasonForChange field if non-nil, zero value otherwise. + +### GetReasonForChangeOk + +`func (o *ActorRunPricingInfo) GetReasonForChangeOk() (*string, bool)` + +GetReasonForChangeOk returns a tuple with the ReasonForChange field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetReasonForChange + +`func (o *ActorRunPricingInfo) SetReasonForChange(v string)` + +SetReasonForChange sets ReasonForChange field to given value. + +### HasReasonForChange + +`func (o *ActorRunPricingInfo) HasReasonForChange() bool` + +HasReasonForChange returns a boolean if a field has been set. + +### GetIsPriceChangeNotificationSuppressed + +`func (o *ActorRunPricingInfo) GetIsPriceChangeNotificationSuppressed() bool` + +GetIsPriceChangeNotificationSuppressed returns the IsPriceChangeNotificationSuppressed field if non-nil, zero value otherwise. + +### GetIsPriceChangeNotificationSuppressedOk + +`func (o *ActorRunPricingInfo) GetIsPriceChangeNotificationSuppressedOk() (*bool, bool)` + +GetIsPriceChangeNotificationSuppressedOk returns a tuple with the IsPriceChangeNotificationSuppressed field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetIsPriceChangeNotificationSuppressed + +`func (o *ActorRunPricingInfo) SetIsPriceChangeNotificationSuppressed(v bool)` + +SetIsPriceChangeNotificationSuppressed sets IsPriceChangeNotificationSuppressed field to given value. + +### HasIsPriceChangeNotificationSuppressed + +`func (o *ActorRunPricingInfo) HasIsPriceChangeNotificationSuppressed() bool` + +HasIsPriceChangeNotificationSuppressed returns a boolean if a field has been set. + +### GetForceContainsSignificantPriceChange + +`func (o *ActorRunPricingInfo) GetForceContainsSignificantPriceChange() bool` + +GetForceContainsSignificantPriceChange returns the ForceContainsSignificantPriceChange field if non-nil, zero value otherwise. + +### GetForceContainsSignificantPriceChangeOk + +`func (o *ActorRunPricingInfo) GetForceContainsSignificantPriceChangeOk() (*bool, bool)` + +GetForceContainsSignificantPriceChangeOk returns a tuple with the ForceContainsSignificantPriceChange field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetForceContainsSignificantPriceChange + +`func (o *ActorRunPricingInfo) SetForceContainsSignificantPriceChange(v bool)` + +SetForceContainsSignificantPriceChange sets ForceContainsSignificantPriceChange field to given value. + +### HasForceContainsSignificantPriceChange + +`func (o *ActorRunPricingInfo) HasForceContainsSignificantPriceChange() bool` + +HasForceContainsSignificantPriceChange returns a boolean if a field has been set. + +### GetPricingModel + +`func (o *ActorRunPricingInfo) GetPricingModel() string` + +GetPricingModel returns the PricingModel field if non-nil, zero value otherwise. + +### GetPricingModelOk + +`func (o *ActorRunPricingInfo) GetPricingModelOk() (*string, bool)` + +GetPricingModelOk returns a tuple with the PricingModel field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPricingModel + +`func (o *ActorRunPricingInfo) SetPricingModel(v string)` + +SetPricingModel sets PricingModel field to given value. + + +### GetPricingPerEvent + +`func (o *ActorRunPricingInfo) GetPricingPerEvent() PayPerEventActorPricingInfoAllOfPricingPerEvent` + +GetPricingPerEvent returns the PricingPerEvent field if non-nil, zero value otherwise. + +### GetPricingPerEventOk + +`func (o *ActorRunPricingInfo) GetPricingPerEventOk() (*PayPerEventActorPricingInfoAllOfPricingPerEvent, bool)` + +GetPricingPerEventOk returns a tuple with the PricingPerEvent field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPricingPerEvent + +`func (o *ActorRunPricingInfo) SetPricingPerEvent(v PayPerEventActorPricingInfoAllOfPricingPerEvent)` + +SetPricingPerEvent sets PricingPerEvent field to given value. + + +### GetMinimalMaxTotalChargeUsd + +`func (o *ActorRunPricingInfo) GetMinimalMaxTotalChargeUsd() float32` + +GetMinimalMaxTotalChargeUsd returns the MinimalMaxTotalChargeUsd field if non-nil, zero value otherwise. + +### GetMinimalMaxTotalChargeUsdOk + +`func (o *ActorRunPricingInfo) GetMinimalMaxTotalChargeUsdOk() (*float32, bool)` + +GetMinimalMaxTotalChargeUsdOk returns a tuple with the MinimalMaxTotalChargeUsd field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMinimalMaxTotalChargeUsd + +`func (o *ActorRunPricingInfo) SetMinimalMaxTotalChargeUsd(v float32)` + +SetMinimalMaxTotalChargeUsd sets MinimalMaxTotalChargeUsd field to given value. + +### HasMinimalMaxTotalChargeUsd + +`func (o *ActorRunPricingInfo) HasMinimalMaxTotalChargeUsd() bool` + +HasMinimalMaxTotalChargeUsd returns a boolean if a field has been set. + +### GetUnitName + +`func (o *ActorRunPricingInfo) GetUnitName() string` + +GetUnitName returns the UnitName field if non-nil, zero value otherwise. + +### GetUnitNameOk + +`func (o *ActorRunPricingInfo) GetUnitNameOk() (*string, bool)` + +GetUnitNameOk returns a tuple with the UnitName field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUnitName + +`func (o *ActorRunPricingInfo) SetUnitName(v string)` + +SetUnitName sets UnitName field to given value. + + +### GetPricePerUnitUsd + +`func (o *ActorRunPricingInfo) GetPricePerUnitUsd() float32` + +GetPricePerUnitUsd returns the PricePerUnitUsd field if non-nil, zero value otherwise. + +### GetPricePerUnitUsdOk + +`func (o *ActorRunPricingInfo) GetPricePerUnitUsdOk() (*float32, bool)` + +GetPricePerUnitUsdOk returns a tuple with the PricePerUnitUsd field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPricePerUnitUsd + +`func (o *ActorRunPricingInfo) SetPricePerUnitUsd(v float32)` + +SetPricePerUnitUsd sets PricePerUnitUsd field to given value. + + +### GetTieredPricing + +`func (o *ActorRunPricingInfo) GetTieredPricing() map[string]TieredPricingPerDatasetItemEntry` + +GetTieredPricing returns the TieredPricing field if non-nil, zero value otherwise. + +### GetTieredPricingOk + +`func (o *ActorRunPricingInfo) GetTieredPricingOk() (*map[string]TieredPricingPerDatasetItemEntry, bool)` + +GetTieredPricingOk returns a tuple with the TieredPricing field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTieredPricing + +`func (o *ActorRunPricingInfo) SetTieredPricing(v map[string]TieredPricingPerDatasetItemEntry)` + +SetTieredPricing sets TieredPricing field to given value. + +### HasTieredPricing + +`func (o *ActorRunPricingInfo) HasTieredPricing() bool` + +HasTieredPricing returns a boolean if a field has been set. + +### GetTrialMinutes + +`func (o *ActorRunPricingInfo) GetTrialMinutes() int32` + +GetTrialMinutes returns the TrialMinutes field if non-nil, zero value otherwise. + +### GetTrialMinutesOk + +`func (o *ActorRunPricingInfo) GetTrialMinutesOk() (*int32, bool)` + +GetTrialMinutesOk returns a tuple with the TrialMinutes field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTrialMinutes + +`func (o *ActorRunPricingInfo) SetTrialMinutes(v int32)` + +SetTrialMinutes sets TrialMinutes field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ActorRunTimeoutExceededError.md b/docs/ActorRunTimeoutExceededError.md new file mode 100644 index 0000000..5b4bb81 --- /dev/null +++ b/docs/ActorRunTimeoutExceededError.md @@ -0,0 +1,56 @@ +# ActorRunTimeoutExceededError + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Error** | Pointer to [**RunTimeoutExceededErrorDetail**](RunTimeoutExceededErrorDetail.md) | | [optional] + +## Methods + +### NewActorRunTimeoutExceededError + +`func NewActorRunTimeoutExceededError() *ActorRunTimeoutExceededError` + +NewActorRunTimeoutExceededError instantiates a new ActorRunTimeoutExceededError object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewActorRunTimeoutExceededErrorWithDefaults + +`func NewActorRunTimeoutExceededErrorWithDefaults() *ActorRunTimeoutExceededError` + +NewActorRunTimeoutExceededErrorWithDefaults instantiates a new ActorRunTimeoutExceededError object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetError + +`func (o *ActorRunTimeoutExceededError) GetError() RunTimeoutExceededErrorDetail` + +GetError returns the Error field if non-nil, zero value otherwise. + +### GetErrorOk + +`func (o *ActorRunTimeoutExceededError) GetErrorOk() (*RunTimeoutExceededErrorDetail, bool)` + +GetErrorOk returns a tuple with the Error field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetError + +`func (o *ActorRunTimeoutExceededError) SetError(v RunTimeoutExceededErrorDetail)` + +SetError sets Error field to given value. + +### HasError + +`func (o *ActorRunTimeoutExceededError) HasError() bool` + +HasError returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ActorRunsAPI.md b/docs/ActorRunsAPI.md new file mode 100644 index 0000000..0f58b0b --- /dev/null +++ b/docs/ActorRunsAPI.md @@ -0,0 +1,755 @@ +# \ActorRunsAPI + +All URIs are relative to *https://api.apify.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**ActorRunAbortPost**](ActorRunsAPI.md#ActorRunAbortPost) | **Post** /v2/actor-runs/{runId}/abort | Abort run +[**ActorRunDelete**](ActorRunsAPI.md#ActorRunDelete) | **Delete** /v2/actor-runs/{runId} | Delete run +[**ActorRunGet**](ActorRunsAPI.md#ActorRunGet) | **Get** /v2/actor-runs/{runId} | Get run +[**ActorRunLogGet**](ActorRunsAPI.md#ActorRunLogGet) | **Get** /v2/actor-runs/{runId}/log | Get run's log +[**ActorRunMetamorphPost**](ActorRunsAPI.md#ActorRunMetamorphPost) | **Post** /v2/actor-runs/{runId}/metamorph | Metamorph run +[**ActorRunPut**](ActorRunsAPI.md#ActorRunPut) | **Put** /v2/actor-runs/{runId} | Update run +[**ActorRunRebootPost**](ActorRunsAPI.md#ActorRunRebootPost) | **Post** /v2/actor-runs/{runId}/reboot | Reboot run +[**ActorRunsGet**](ActorRunsAPI.md#ActorRunsGet) | **Get** /v2/actor-runs | Get user runs list +[**PostChargeRun**](ActorRunsAPI.md#PostChargeRun) | **Post** /v2/actor-runs/{runId}/charge | Charge events in run +[**PostResurrectRun**](ActorRunsAPI.md#PostResurrectRun) | **Post** /v2/actor-runs/{runId}/resurrect | Resurrect run + + + +## ActorRunAbortPost + +> RunResponse ActorRunAbortPost(ctx, runId).Gracefully(gracefully).Execute() + +Abort run + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + runId := "3KH8gEpp4d8uQSe8T" // string | Actor run ID. + gracefully := true // bool | If true passed, the Actor run will abort gracefully. It will send `aborting` and `persistState` event into run and force-stop the run after 30 seconds. It is helpful in cases where you plan to resurrect the run later. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.ActorRunsAPI.ActorRunAbortPost(context.Background(), runId).Gracefully(gracefully).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ActorRunsAPI.ActorRunAbortPost``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ActorRunAbortPost`: RunResponse + fmt.Fprintf(os.Stdout, "Response from `ActorRunsAPI.ActorRunAbortPost`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**runId** | **string** | Actor run ID. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiActorRunAbortPostRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **gracefully** | **bool** | If true passed, the Actor run will abort gracefully. It will send `aborting` and `persistState` event into run and force-stop the run after 30 seconds. It is helpful in cases where you plan to resurrect the run later. | + +### Return type + +[**RunResponse**](RunResponse.md) + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## ActorRunDelete + +> ActorRunDelete(ctx, runId).Execute() + +Delete run + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + runId := "3KH8gEpp4d8uQSe8T" // string | Actor run ID. + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + r, err := apiClient.ActorRunsAPI.ActorRunDelete(context.Background(), runId).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ActorRunsAPI.ActorRunDelete``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**runId** | **string** | Actor run ID. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiActorRunDeleteRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + +### Return type + + (empty response body) + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## ActorRunGet + +> RunResponse ActorRunGet(ctx, runId).WaitForFinish(waitForFinish).Execute() + +Get run + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + runId := "3KH8gEpp4d8uQSe8T" // string | Actor run ID. + waitForFinish := float64(60) // float64 | The maximum number of seconds the server waits for the run to finish. By default it is `0`, the maximum value is `60`. <!-- MAX_ACTOR_JOB_ASYNC_WAIT_SECS --> If the run finishes in time then the returned run object will have a terminal status (e.g. `SUCCEEDED`), otherwise it will have a transitional status (e.g. `RUNNING`). (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.ActorRunsAPI.ActorRunGet(context.Background(), runId).WaitForFinish(waitForFinish).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ActorRunsAPI.ActorRunGet``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ActorRunGet`: RunResponse + fmt.Fprintf(os.Stdout, "Response from `ActorRunsAPI.ActorRunGet`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**runId** | **string** | Actor run ID. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiActorRunGetRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **waitForFinish** | **float64** | The maximum number of seconds the server waits for the run to finish. By default it is `0`, the maximum value is `60`. <!-- MAX_ACTOR_JOB_ASYNC_WAIT_SECS --> If the run finishes in time then the returned run object will have a terminal status (e.g. `SUCCEEDED`), otherwise it will have a transitional status (e.g. `RUNNING`). | + +### Return type + +[**RunResponse**](RunResponse.md) + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## ActorRunLogGet + +> string ActorRunLogGet(ctx, runId).Stream(stream).Download(download).Raw(raw).Execute() + +Get run's log + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + runId := "3KH8gEpp4d8uQSe8T" // string | Actor run ID. + stream := false // bool | If `true` or `1` then the logs will be streamed as long as the run or build is running. (optional) + download := false // bool | If `true` or `1` then the web browser will download the log file rather than open it in a tab. (optional) + raw := false // bool | If `true` or `1`, the logs will be kept verbatim. By default, the API removes ANSI escape codes from the logs, keeping only printable characters. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.ActorRunsAPI.ActorRunLogGet(context.Background(), runId).Stream(stream).Download(download).Raw(raw).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ActorRunsAPI.ActorRunLogGet``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ActorRunLogGet`: string + fmt.Fprintf(os.Stdout, "Response from `ActorRunsAPI.ActorRunLogGet`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**runId** | **string** | Actor run ID. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiActorRunLogGetRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **stream** | **bool** | If `true` or `1` then the logs will be streamed as long as the run or build is running. | + **download** | **bool** | If `true` or `1` then the web browser will download the log file rather than open it in a tab. | + **raw** | **bool** | If `true` or `1`, the logs will be kept verbatim. By default, the API removes ANSI escape codes from the logs, keeping only printable characters. | + +### Return type + +**string** + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: text/plain, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## ActorRunMetamorphPost + +> RunResponse ActorRunMetamorphPost(ctx, runId).TargetActorId(targetActorId).Build(build).Execute() + +Metamorph run + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + runId := "3KH8gEpp4d8uQSe8T" // string | Actor run ID. + targetActorId := "HDSasDasz78YcAPEB" // string | ID of a target Actor that the run should be transformed into. + build := "beta" // string | Optional build of the target Actor. It can be either a build tag or build number. By default, the run uses the build specified in the default run configuration for the target Actor (typically `latest`). (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.ActorRunsAPI.ActorRunMetamorphPost(context.Background(), runId).TargetActorId(targetActorId).Build(build).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ActorRunsAPI.ActorRunMetamorphPost``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ActorRunMetamorphPost`: RunResponse + fmt.Fprintf(os.Stdout, "Response from `ActorRunsAPI.ActorRunMetamorphPost`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**runId** | **string** | Actor run ID. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiActorRunMetamorphPostRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **targetActorId** | **string** | ID of a target Actor that the run should be transformed into. | + **build** | **string** | Optional build of the target Actor. It can be either a build tag or build number. By default, the run uses the build specified in the default run configuration for the target Actor (typically `latest`). | + +### Return type + +[**RunResponse**](RunResponse.md) + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## ActorRunPut + +> RunResponse ActorRunPut(ctx, runId).UpdateRunRequest(updateRunRequest).Execute() + +Update run + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + runId := "3KH8gEpp4d8uQSe8T" // string | Actor run ID. + updateRunRequest := *openapiclient.NewUpdateRunRequest() // UpdateRunRequest | + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.ActorRunsAPI.ActorRunPut(context.Background(), runId).UpdateRunRequest(updateRunRequest).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ActorRunsAPI.ActorRunPut``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ActorRunPut`: RunResponse + fmt.Fprintf(os.Stdout, "Response from `ActorRunsAPI.ActorRunPut`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**runId** | **string** | Actor run ID. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiActorRunPutRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **updateRunRequest** | [**UpdateRunRequest**](UpdateRunRequest.md) | | + +### Return type + +[**RunResponse**](RunResponse.md) + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## ActorRunRebootPost + +> RunResponse ActorRunRebootPost(ctx, runId).Execute() + +Reboot run + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + runId := "3KH8gEpp4d8uQSe8T" // string | Actor run ID. + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.ActorRunsAPI.ActorRunRebootPost(context.Background(), runId).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ActorRunsAPI.ActorRunRebootPost``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ActorRunRebootPost`: RunResponse + fmt.Fprintf(os.Stdout, "Response from `ActorRunsAPI.ActorRunRebootPost`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**runId** | **string** | Actor run ID. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiActorRunRebootPostRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + +### Return type + +[**RunResponse**](RunResponse.md) + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## ActorRunsGet + +> ListOfRunsResponse ActorRunsGet(ctx).Offset(offset).Limit(limit).Desc(desc).Status(status).StartedAfter(startedAfter).StartedBefore(startedBefore).Execute() + +Get user runs list + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + "time" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + offset := float64(0) // float64 | Number of items that should be skipped at the start. The default value is `0`. (optional) + limit := float64(1000) // float64 | Maximum number of items to return. The default value as well as the maximum is `1000`. (optional) + desc := true // bool | If `true` or `1` then the objects are sorted by the `startedAt` field in descending order. By default, they are sorted in ascending order. (optional) + status := []string{"Inner_example"} // []string | Single status or comma-separated list of statuses, see ([available statuses](https://docs.apify.com/platform/actors/running/runs-and-builds#lifecycle)). Used to filter runs by the specified statuses only. (optional) + startedAfter := time.Now() // time.Time | Filter runs that started after the specified date and time (inclusive). The value must be a valid ISO 8601 datetime string (UTC). (optional) + startedBefore := time.Now() // time.Time | Filter runs that started before the specified date and time (inclusive). The value must be a valid ISO 8601 datetime string (UTC). (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.ActorRunsAPI.ActorRunsGet(context.Background()).Offset(offset).Limit(limit).Desc(desc).Status(status).StartedAfter(startedAfter).StartedBefore(startedBefore).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ActorRunsAPI.ActorRunsGet``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ActorRunsGet`: ListOfRunsResponse + fmt.Fprintf(os.Stdout, "Response from `ActorRunsAPI.ActorRunsGet`: %v\n", resp) +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiActorRunsGetRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **offset** | **float64** | Number of items that should be skipped at the start. The default value is `0`. | + **limit** | **float64** | Maximum number of items to return. The default value as well as the maximum is `1000`. | + **desc** | **bool** | If `true` or `1` then the objects are sorted by the `startedAt` field in descending order. By default, they are sorted in ascending order. | + **status** | **[]string** | Single status or comma-separated list of statuses, see ([available statuses](https://docs.apify.com/platform/actors/running/runs-and-builds#lifecycle)). Used to filter runs by the specified statuses only. | + **startedAfter** | **time.Time** | Filter runs that started after the specified date and time (inclusive). The value must be a valid ISO 8601 datetime string (UTC). | + **startedBefore** | **time.Time** | Filter runs that started before the specified date and time (inclusive). The value must be a valid ISO 8601 datetime string (UTC). | + +### Return type + +[**ListOfRunsResponse**](ListOfRunsResponse.md) + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## PostChargeRun + +> map[string]interface{} PostChargeRun(ctx, runId).ChargeRunRequest(chargeRunRequest).IdempotencyKey(idempotencyKey).Execute() + +Charge events in run + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + runId := "3KH8gEpp4d8uQSe8T" // string | Actor run ID. + chargeRunRequest := *openapiclient.NewChargeRunRequest("EventName_example", int32(123)) // ChargeRunRequest | Define which event, and how many times, you want to charge for. + idempotencyKey := "2024-12-09T01:23:45.000Z-random-uuid" // string | Always pass a unique idempotency key (any unique string) for each charge to avoid double charging in case of retries or network errors. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.ActorRunsAPI.PostChargeRun(context.Background(), runId).ChargeRunRequest(chargeRunRequest).IdempotencyKey(idempotencyKey).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ActorRunsAPI.PostChargeRun``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `PostChargeRun`: map[string]interface{} + fmt.Fprintf(os.Stdout, "Response from `ActorRunsAPI.PostChargeRun`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**runId** | **string** | Actor run ID. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiPostChargeRunRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **chargeRunRequest** | [**ChargeRunRequest**](ChargeRunRequest.md) | Define which event, and how many times, you want to charge for. | + **idempotencyKey** | **string** | Always pass a unique idempotency key (any unique string) for each charge to avoid double charging in case of retries or network errors. | + +### Return type + +**map[string]interface{}** + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## PostResurrectRun + +> RunResponse PostResurrectRun(ctx, runId).Build(build).Timeout(timeout).Memory(memory).MaxItems(maxItems).MaxTotalChargeUsd(maxTotalChargeUsd).RestartOnError(restartOnError).Execute() + +Resurrect run + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + runId := "3KH8gEpp4d8uQSe8T" // string | Actor run ID. + build := "0.1.234" // string | Specifies the Actor build to run. It can be either a build tag or build number. By default, the run is resurrected with the same build it originally used. Specifically, if a run was first started with the `latest` tag, which resolves to version `0.0.3` at the time, a run resurrected without this parameter will continue running with `0.0.3`, even if `latest` already points to a newer build. (optional) + timeout := float64(60) // float64 | Optional timeout for the run, in seconds. By default, the run uses the timeout specified in the run that is being resurrected. (optional) + memory := float64(256) // float64 | Memory limit for the run, in megabytes. The amount of memory can be set to a power of 2 with a minimum of 128. By default, the run uses the memory limit specified in the run that is being resurrected. (optional) + maxItems := float64(1000) // float64 | Specifies the maximum number of dataset items that will be charged for pay-per-result Actors. This does NOT guarantee that the Actor will return only this many items. It only ensures you won't be charged for more than this number of items. Only works for pay-per-result Actors. Value can be accessed in the actor run using `ACTOR_MAX_PAID_DATASET_ITEMS` environment variable. (optional) + maxTotalChargeUsd := float64(5) // float64 | Specifies the maximum cost of the run. This parameter is useful for pay-per-event Actors, as it allows you to limit the amount charged to your subscription. You can access the maximum cost in your Actor by using the `ACTOR_MAX_TOTAL_CHARGE_USD` environment variable. (optional) + restartOnError := false // bool | Determines whether the resurrected run will be restarted if it fails. By default, the resurrected run uses the same setting as before. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.ActorRunsAPI.PostResurrectRun(context.Background(), runId).Build(build).Timeout(timeout).Memory(memory).MaxItems(maxItems).MaxTotalChargeUsd(maxTotalChargeUsd).RestartOnError(restartOnError).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ActorRunsAPI.PostResurrectRun``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `PostResurrectRun`: RunResponse + fmt.Fprintf(os.Stdout, "Response from `ActorRunsAPI.PostResurrectRun`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**runId** | **string** | Actor run ID. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiPostResurrectRunRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **build** | **string** | Specifies the Actor build to run. It can be either a build tag or build number. By default, the run is resurrected with the same build it originally used. Specifically, if a run was first started with the `latest` tag, which resolves to version `0.0.3` at the time, a run resurrected without this parameter will continue running with `0.0.3`, even if `latest` already points to a newer build. | + **timeout** | **float64** | Optional timeout for the run, in seconds. By default, the run uses the timeout specified in the run that is being resurrected. | + **memory** | **float64** | Memory limit for the run, in megabytes. The amount of memory can be set to a power of 2 with a minimum of 128. By default, the run uses the memory limit specified in the run that is being resurrected. | + **maxItems** | **float64** | Specifies the maximum number of dataset items that will be charged for pay-per-result Actors. This does NOT guarantee that the Actor will return only this many items. It only ensures you won't be charged for more than this number of items. Only works for pay-per-result Actors. Value can be accessed in the actor run using `ACTOR_MAX_PAID_DATASET_ITEMS` environment variable. | + **maxTotalChargeUsd** | **float64** | Specifies the maximum cost of the run. This parameter is useful for pay-per-event Actors, as it allows you to limit the amount charged to your subscription. You can access the maximum cost in your Actor by using the `ACTOR_MAX_TOTAL_CHARGE_USD` environment variable. | + **restartOnError** | **bool** | Determines whether the resurrected run will be restarted if it fails. By default, the resurrected run uses the same setting as before. | + +### Return type + +[**RunResponse**](RunResponse.md) + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/docs/ActorShort.md b/docs/ActorShort.md new file mode 100644 index 0000000..700d4bb --- /dev/null +++ b/docs/ActorShort.md @@ -0,0 +1,197 @@ +# ActorShort + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **string** | | +**CreatedAt** | **time.Time** | | +**ModifiedAt** | **time.Time** | | +**Name** | **string** | | +**Username** | **string** | | +**Title** | Pointer to **string** | | [optional] +**Stats** | Pointer to [**NullableActorStats**](ActorStats.md) | | [optional] + +## Methods + +### NewActorShort + +`func NewActorShort(id string, createdAt time.Time, modifiedAt time.Time, name string, username string, ) *ActorShort` + +NewActorShort instantiates a new ActorShort object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewActorShortWithDefaults + +`func NewActorShortWithDefaults() *ActorShort` + +NewActorShortWithDefaults instantiates a new ActorShort object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetId + +`func (o *ActorShort) GetId() string` + +GetId returns the Id field if non-nil, zero value otherwise. + +### GetIdOk + +`func (o *ActorShort) GetIdOk() (*string, bool)` + +GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetId + +`func (o *ActorShort) SetId(v string)` + +SetId sets Id field to given value. + + +### GetCreatedAt + +`func (o *ActorShort) GetCreatedAt() time.Time` + +GetCreatedAt returns the CreatedAt field if non-nil, zero value otherwise. + +### GetCreatedAtOk + +`func (o *ActorShort) GetCreatedAtOk() (*time.Time, bool)` + +GetCreatedAtOk returns a tuple with the CreatedAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCreatedAt + +`func (o *ActorShort) SetCreatedAt(v time.Time)` + +SetCreatedAt sets CreatedAt field to given value. + + +### GetModifiedAt + +`func (o *ActorShort) GetModifiedAt() time.Time` + +GetModifiedAt returns the ModifiedAt field if non-nil, zero value otherwise. + +### GetModifiedAtOk + +`func (o *ActorShort) GetModifiedAtOk() (*time.Time, bool)` + +GetModifiedAtOk returns a tuple with the ModifiedAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetModifiedAt + +`func (o *ActorShort) SetModifiedAt(v time.Time)` + +SetModifiedAt sets ModifiedAt field to given value. + + +### GetName + +`func (o *ActorShort) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *ActorShort) GetNameOk() (*string, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetName + +`func (o *ActorShort) SetName(v string)` + +SetName sets Name field to given value. + + +### GetUsername + +`func (o *ActorShort) GetUsername() string` + +GetUsername returns the Username field if non-nil, zero value otherwise. + +### GetUsernameOk + +`func (o *ActorShort) GetUsernameOk() (*string, bool)` + +GetUsernameOk returns a tuple with the Username field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUsername + +`func (o *ActorShort) SetUsername(v string)` + +SetUsername sets Username field to given value. + + +### GetTitle + +`func (o *ActorShort) GetTitle() string` + +GetTitle returns the Title field if non-nil, zero value otherwise. + +### GetTitleOk + +`func (o *ActorShort) GetTitleOk() (*string, bool)` + +GetTitleOk returns a tuple with the Title field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTitle + +`func (o *ActorShort) SetTitle(v string)` + +SetTitle sets Title field to given value. + +### HasTitle + +`func (o *ActorShort) HasTitle() bool` + +HasTitle returns a boolean if a field has been set. + +### GetStats + +`func (o *ActorShort) GetStats() ActorStats` + +GetStats returns the Stats field if non-nil, zero value otherwise. + +### GetStatsOk + +`func (o *ActorShort) GetStatsOk() (*ActorStats, bool)` + +GetStatsOk returns a tuple with the Stats field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetStats + +`func (o *ActorShort) SetStats(v ActorStats)` + +SetStats sets Stats field to given value. + +### HasStats + +`func (o *ActorShort) HasStats() bool` + +HasStats returns a boolean if a field has been set. + +### SetStatsNil + +`func (o *ActorShort) SetStatsNil(b bool)` + + SetStatsNil sets the value for Stats to be an explicit nil + +### UnsetStats +`func (o *ActorShort) UnsetStats()` + +UnsetStats ensures that no value is present for Stats, not even an explicit nil + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ActorStandby.md b/docs/ActorStandby.md new file mode 100644 index 0000000..6874406 --- /dev/null +++ b/docs/ActorStandby.md @@ -0,0 +1,318 @@ +# ActorStandby + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**IsEnabled** | Pointer to **NullableBool** | | [optional] +**DesiredRequestsPerActorRun** | Pointer to **NullableInt32** | | [optional] +**MaxRequestsPerActorRun** | Pointer to **NullableInt32** | | [optional] +**IdleTimeoutSecs** | Pointer to **NullableInt32** | | [optional] +**Build** | Pointer to **NullableString** | | [optional] +**MemoryMbytes** | Pointer to **NullableInt32** | | [optional] +**DisableStandbyFieldsOverride** | Pointer to **NullableBool** | | [optional] +**ShouldPassActorInput** | Pointer to **NullableBool** | | [optional] + +## Methods + +### NewActorStandby + +`func NewActorStandby() *ActorStandby` + +NewActorStandby instantiates a new ActorStandby object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewActorStandbyWithDefaults + +`func NewActorStandbyWithDefaults() *ActorStandby` + +NewActorStandbyWithDefaults instantiates a new ActorStandby object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetIsEnabled + +`func (o *ActorStandby) GetIsEnabled() bool` + +GetIsEnabled returns the IsEnabled field if non-nil, zero value otherwise. + +### GetIsEnabledOk + +`func (o *ActorStandby) GetIsEnabledOk() (*bool, bool)` + +GetIsEnabledOk returns a tuple with the IsEnabled field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetIsEnabled + +`func (o *ActorStandby) SetIsEnabled(v bool)` + +SetIsEnabled sets IsEnabled field to given value. + +### HasIsEnabled + +`func (o *ActorStandby) HasIsEnabled() bool` + +HasIsEnabled returns a boolean if a field has been set. + +### SetIsEnabledNil + +`func (o *ActorStandby) SetIsEnabledNil(b bool)` + + SetIsEnabledNil sets the value for IsEnabled to be an explicit nil + +### UnsetIsEnabled +`func (o *ActorStandby) UnsetIsEnabled()` + +UnsetIsEnabled ensures that no value is present for IsEnabled, not even an explicit nil +### GetDesiredRequestsPerActorRun + +`func (o *ActorStandby) GetDesiredRequestsPerActorRun() int32` + +GetDesiredRequestsPerActorRun returns the DesiredRequestsPerActorRun field if non-nil, zero value otherwise. + +### GetDesiredRequestsPerActorRunOk + +`func (o *ActorStandby) GetDesiredRequestsPerActorRunOk() (*int32, bool)` + +GetDesiredRequestsPerActorRunOk returns a tuple with the DesiredRequestsPerActorRun field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDesiredRequestsPerActorRun + +`func (o *ActorStandby) SetDesiredRequestsPerActorRun(v int32)` + +SetDesiredRequestsPerActorRun sets DesiredRequestsPerActorRun field to given value. + +### HasDesiredRequestsPerActorRun + +`func (o *ActorStandby) HasDesiredRequestsPerActorRun() bool` + +HasDesiredRequestsPerActorRun returns a boolean if a field has been set. + +### SetDesiredRequestsPerActorRunNil + +`func (o *ActorStandby) SetDesiredRequestsPerActorRunNil(b bool)` + + SetDesiredRequestsPerActorRunNil sets the value for DesiredRequestsPerActorRun to be an explicit nil + +### UnsetDesiredRequestsPerActorRun +`func (o *ActorStandby) UnsetDesiredRequestsPerActorRun()` + +UnsetDesiredRequestsPerActorRun ensures that no value is present for DesiredRequestsPerActorRun, not even an explicit nil +### GetMaxRequestsPerActorRun + +`func (o *ActorStandby) GetMaxRequestsPerActorRun() int32` + +GetMaxRequestsPerActorRun returns the MaxRequestsPerActorRun field if non-nil, zero value otherwise. + +### GetMaxRequestsPerActorRunOk + +`func (o *ActorStandby) GetMaxRequestsPerActorRunOk() (*int32, bool)` + +GetMaxRequestsPerActorRunOk returns a tuple with the MaxRequestsPerActorRun field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMaxRequestsPerActorRun + +`func (o *ActorStandby) SetMaxRequestsPerActorRun(v int32)` + +SetMaxRequestsPerActorRun sets MaxRequestsPerActorRun field to given value. + +### HasMaxRequestsPerActorRun + +`func (o *ActorStandby) HasMaxRequestsPerActorRun() bool` + +HasMaxRequestsPerActorRun returns a boolean if a field has been set. + +### SetMaxRequestsPerActorRunNil + +`func (o *ActorStandby) SetMaxRequestsPerActorRunNil(b bool)` + + SetMaxRequestsPerActorRunNil sets the value for MaxRequestsPerActorRun to be an explicit nil + +### UnsetMaxRequestsPerActorRun +`func (o *ActorStandby) UnsetMaxRequestsPerActorRun()` + +UnsetMaxRequestsPerActorRun ensures that no value is present for MaxRequestsPerActorRun, not even an explicit nil +### GetIdleTimeoutSecs + +`func (o *ActorStandby) GetIdleTimeoutSecs() int32` + +GetIdleTimeoutSecs returns the IdleTimeoutSecs field if non-nil, zero value otherwise. + +### GetIdleTimeoutSecsOk + +`func (o *ActorStandby) GetIdleTimeoutSecsOk() (*int32, bool)` + +GetIdleTimeoutSecsOk returns a tuple with the IdleTimeoutSecs field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetIdleTimeoutSecs + +`func (o *ActorStandby) SetIdleTimeoutSecs(v int32)` + +SetIdleTimeoutSecs sets IdleTimeoutSecs field to given value. + +### HasIdleTimeoutSecs + +`func (o *ActorStandby) HasIdleTimeoutSecs() bool` + +HasIdleTimeoutSecs returns a boolean if a field has been set. + +### SetIdleTimeoutSecsNil + +`func (o *ActorStandby) SetIdleTimeoutSecsNil(b bool)` + + SetIdleTimeoutSecsNil sets the value for IdleTimeoutSecs to be an explicit nil + +### UnsetIdleTimeoutSecs +`func (o *ActorStandby) UnsetIdleTimeoutSecs()` + +UnsetIdleTimeoutSecs ensures that no value is present for IdleTimeoutSecs, not even an explicit nil +### GetBuild + +`func (o *ActorStandby) GetBuild() string` + +GetBuild returns the Build field if non-nil, zero value otherwise. + +### GetBuildOk + +`func (o *ActorStandby) GetBuildOk() (*string, bool)` + +GetBuildOk returns a tuple with the Build field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetBuild + +`func (o *ActorStandby) SetBuild(v string)` + +SetBuild sets Build field to given value. + +### HasBuild + +`func (o *ActorStandby) HasBuild() bool` + +HasBuild returns a boolean if a field has been set. + +### SetBuildNil + +`func (o *ActorStandby) SetBuildNil(b bool)` + + SetBuildNil sets the value for Build to be an explicit nil + +### UnsetBuild +`func (o *ActorStandby) UnsetBuild()` + +UnsetBuild ensures that no value is present for Build, not even an explicit nil +### GetMemoryMbytes + +`func (o *ActorStandby) GetMemoryMbytes() int32` + +GetMemoryMbytes returns the MemoryMbytes field if non-nil, zero value otherwise. + +### GetMemoryMbytesOk + +`func (o *ActorStandby) GetMemoryMbytesOk() (*int32, bool)` + +GetMemoryMbytesOk returns a tuple with the MemoryMbytes field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMemoryMbytes + +`func (o *ActorStandby) SetMemoryMbytes(v int32)` + +SetMemoryMbytes sets MemoryMbytes field to given value. + +### HasMemoryMbytes + +`func (o *ActorStandby) HasMemoryMbytes() bool` + +HasMemoryMbytes returns a boolean if a field has been set. + +### SetMemoryMbytesNil + +`func (o *ActorStandby) SetMemoryMbytesNil(b bool)` + + SetMemoryMbytesNil sets the value for MemoryMbytes to be an explicit nil + +### UnsetMemoryMbytes +`func (o *ActorStandby) UnsetMemoryMbytes()` + +UnsetMemoryMbytes ensures that no value is present for MemoryMbytes, not even an explicit nil +### GetDisableStandbyFieldsOverride + +`func (o *ActorStandby) GetDisableStandbyFieldsOverride() bool` + +GetDisableStandbyFieldsOverride returns the DisableStandbyFieldsOverride field if non-nil, zero value otherwise. + +### GetDisableStandbyFieldsOverrideOk + +`func (o *ActorStandby) GetDisableStandbyFieldsOverrideOk() (*bool, bool)` + +GetDisableStandbyFieldsOverrideOk returns a tuple with the DisableStandbyFieldsOverride field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDisableStandbyFieldsOverride + +`func (o *ActorStandby) SetDisableStandbyFieldsOverride(v bool)` + +SetDisableStandbyFieldsOverride sets DisableStandbyFieldsOverride field to given value. + +### HasDisableStandbyFieldsOverride + +`func (o *ActorStandby) HasDisableStandbyFieldsOverride() bool` + +HasDisableStandbyFieldsOverride returns a boolean if a field has been set. + +### SetDisableStandbyFieldsOverrideNil + +`func (o *ActorStandby) SetDisableStandbyFieldsOverrideNil(b bool)` + + SetDisableStandbyFieldsOverrideNil sets the value for DisableStandbyFieldsOverride to be an explicit nil + +### UnsetDisableStandbyFieldsOverride +`func (o *ActorStandby) UnsetDisableStandbyFieldsOverride()` + +UnsetDisableStandbyFieldsOverride ensures that no value is present for DisableStandbyFieldsOverride, not even an explicit nil +### GetShouldPassActorInput + +`func (o *ActorStandby) GetShouldPassActorInput() bool` + +GetShouldPassActorInput returns the ShouldPassActorInput field if non-nil, zero value otherwise. + +### GetShouldPassActorInputOk + +`func (o *ActorStandby) GetShouldPassActorInputOk() (*bool, bool)` + +GetShouldPassActorInputOk returns a tuple with the ShouldPassActorInput field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetShouldPassActorInput + +`func (o *ActorStandby) SetShouldPassActorInput(v bool)` + +SetShouldPassActorInput sets ShouldPassActorInput field to given value. + +### HasShouldPassActorInput + +`func (o *ActorStandby) HasShouldPassActorInput() bool` + +HasShouldPassActorInput returns a boolean if a field has been set. + +### SetShouldPassActorInputNil + +`func (o *ActorStandby) SetShouldPassActorInputNil(b bool)` + + SetShouldPassActorInputNil sets the value for ShouldPassActorInput to be an explicit nil + +### UnsetShouldPassActorInput +`func (o *ActorStandby) UnsetShouldPassActorInput()` + +UnsetShouldPassActorInput ensures that no value is present for ShouldPassActorInput, not even an explicit nil + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ActorStats.md b/docs/ActorStats.md new file mode 100644 index 0000000..27493a6 --- /dev/null +++ b/docs/ActorStats.md @@ -0,0 +1,342 @@ +# ActorStats + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**TotalBuilds** | Pointer to **int32** | | [optional] +**TotalRuns** | Pointer to **int32** | | [optional] +**TotalUsers** | Pointer to **int32** | | [optional] +**TotalUsers7Days** | Pointer to **int32** | | [optional] +**TotalUsers30Days** | Pointer to **int32** | | [optional] +**TotalUsers90Days** | Pointer to **int32** | | [optional] +**TotalMetamorphs** | Pointer to **int32** | | [optional] +**LastRunStartedAt** | Pointer to **time.Time** | | [optional] +**ActorReviewCount** | Pointer to **int32** | | [optional] +**ActorReviewRating** | Pointer to **float32** | | [optional] +**BookmarkCount** | Pointer to **int32** | | [optional] +**PublicActorRunStats30Days** | Pointer to [**ActorStatsPublicActorRunStats30Days**](ActorStatsPublicActorRunStats30Days.md) | | [optional] + +## Methods + +### NewActorStats + +`func NewActorStats() *ActorStats` + +NewActorStats instantiates a new ActorStats object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewActorStatsWithDefaults + +`func NewActorStatsWithDefaults() *ActorStats` + +NewActorStatsWithDefaults instantiates a new ActorStats object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetTotalBuilds + +`func (o *ActorStats) GetTotalBuilds() int32` + +GetTotalBuilds returns the TotalBuilds field if non-nil, zero value otherwise. + +### GetTotalBuildsOk + +`func (o *ActorStats) GetTotalBuildsOk() (*int32, bool)` + +GetTotalBuildsOk returns a tuple with the TotalBuilds field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTotalBuilds + +`func (o *ActorStats) SetTotalBuilds(v int32)` + +SetTotalBuilds sets TotalBuilds field to given value. + +### HasTotalBuilds + +`func (o *ActorStats) HasTotalBuilds() bool` + +HasTotalBuilds returns a boolean if a field has been set. + +### GetTotalRuns + +`func (o *ActorStats) GetTotalRuns() int32` + +GetTotalRuns returns the TotalRuns field if non-nil, zero value otherwise. + +### GetTotalRunsOk + +`func (o *ActorStats) GetTotalRunsOk() (*int32, bool)` + +GetTotalRunsOk returns a tuple with the TotalRuns field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTotalRuns + +`func (o *ActorStats) SetTotalRuns(v int32)` + +SetTotalRuns sets TotalRuns field to given value. + +### HasTotalRuns + +`func (o *ActorStats) HasTotalRuns() bool` + +HasTotalRuns returns a boolean if a field has been set. + +### GetTotalUsers + +`func (o *ActorStats) GetTotalUsers() int32` + +GetTotalUsers returns the TotalUsers field if non-nil, zero value otherwise. + +### GetTotalUsersOk + +`func (o *ActorStats) GetTotalUsersOk() (*int32, bool)` + +GetTotalUsersOk returns a tuple with the TotalUsers field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTotalUsers + +`func (o *ActorStats) SetTotalUsers(v int32)` + +SetTotalUsers sets TotalUsers field to given value. + +### HasTotalUsers + +`func (o *ActorStats) HasTotalUsers() bool` + +HasTotalUsers returns a boolean if a field has been set. + +### GetTotalUsers7Days + +`func (o *ActorStats) GetTotalUsers7Days() int32` + +GetTotalUsers7Days returns the TotalUsers7Days field if non-nil, zero value otherwise. + +### GetTotalUsers7DaysOk + +`func (o *ActorStats) GetTotalUsers7DaysOk() (*int32, bool)` + +GetTotalUsers7DaysOk returns a tuple with the TotalUsers7Days field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTotalUsers7Days + +`func (o *ActorStats) SetTotalUsers7Days(v int32)` + +SetTotalUsers7Days sets TotalUsers7Days field to given value. + +### HasTotalUsers7Days + +`func (o *ActorStats) HasTotalUsers7Days() bool` + +HasTotalUsers7Days returns a boolean if a field has been set. + +### GetTotalUsers30Days + +`func (o *ActorStats) GetTotalUsers30Days() int32` + +GetTotalUsers30Days returns the TotalUsers30Days field if non-nil, zero value otherwise. + +### GetTotalUsers30DaysOk + +`func (o *ActorStats) GetTotalUsers30DaysOk() (*int32, bool)` + +GetTotalUsers30DaysOk returns a tuple with the TotalUsers30Days field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTotalUsers30Days + +`func (o *ActorStats) SetTotalUsers30Days(v int32)` + +SetTotalUsers30Days sets TotalUsers30Days field to given value. + +### HasTotalUsers30Days + +`func (o *ActorStats) HasTotalUsers30Days() bool` + +HasTotalUsers30Days returns a boolean if a field has been set. + +### GetTotalUsers90Days + +`func (o *ActorStats) GetTotalUsers90Days() int32` + +GetTotalUsers90Days returns the TotalUsers90Days field if non-nil, zero value otherwise. + +### GetTotalUsers90DaysOk + +`func (o *ActorStats) GetTotalUsers90DaysOk() (*int32, bool)` + +GetTotalUsers90DaysOk returns a tuple with the TotalUsers90Days field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTotalUsers90Days + +`func (o *ActorStats) SetTotalUsers90Days(v int32)` + +SetTotalUsers90Days sets TotalUsers90Days field to given value. + +### HasTotalUsers90Days + +`func (o *ActorStats) HasTotalUsers90Days() bool` + +HasTotalUsers90Days returns a boolean if a field has been set. + +### GetTotalMetamorphs + +`func (o *ActorStats) GetTotalMetamorphs() int32` + +GetTotalMetamorphs returns the TotalMetamorphs field if non-nil, zero value otherwise. + +### GetTotalMetamorphsOk + +`func (o *ActorStats) GetTotalMetamorphsOk() (*int32, bool)` + +GetTotalMetamorphsOk returns a tuple with the TotalMetamorphs field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTotalMetamorphs + +`func (o *ActorStats) SetTotalMetamorphs(v int32)` + +SetTotalMetamorphs sets TotalMetamorphs field to given value. + +### HasTotalMetamorphs + +`func (o *ActorStats) HasTotalMetamorphs() bool` + +HasTotalMetamorphs returns a boolean if a field has been set. + +### GetLastRunStartedAt + +`func (o *ActorStats) GetLastRunStartedAt() time.Time` + +GetLastRunStartedAt returns the LastRunStartedAt field if non-nil, zero value otherwise. + +### GetLastRunStartedAtOk + +`func (o *ActorStats) GetLastRunStartedAtOk() (*time.Time, bool)` + +GetLastRunStartedAtOk returns a tuple with the LastRunStartedAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetLastRunStartedAt + +`func (o *ActorStats) SetLastRunStartedAt(v time.Time)` + +SetLastRunStartedAt sets LastRunStartedAt field to given value. + +### HasLastRunStartedAt + +`func (o *ActorStats) HasLastRunStartedAt() bool` + +HasLastRunStartedAt returns a boolean if a field has been set. + +### GetActorReviewCount + +`func (o *ActorStats) GetActorReviewCount() int32` + +GetActorReviewCount returns the ActorReviewCount field if non-nil, zero value otherwise. + +### GetActorReviewCountOk + +`func (o *ActorStats) GetActorReviewCountOk() (*int32, bool)` + +GetActorReviewCountOk returns a tuple with the ActorReviewCount field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetActorReviewCount + +`func (o *ActorStats) SetActorReviewCount(v int32)` + +SetActorReviewCount sets ActorReviewCount field to given value. + +### HasActorReviewCount + +`func (o *ActorStats) HasActorReviewCount() bool` + +HasActorReviewCount returns a boolean if a field has been set. + +### GetActorReviewRating + +`func (o *ActorStats) GetActorReviewRating() float32` + +GetActorReviewRating returns the ActorReviewRating field if non-nil, zero value otherwise. + +### GetActorReviewRatingOk + +`func (o *ActorStats) GetActorReviewRatingOk() (*float32, bool)` + +GetActorReviewRatingOk returns a tuple with the ActorReviewRating field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetActorReviewRating + +`func (o *ActorStats) SetActorReviewRating(v float32)` + +SetActorReviewRating sets ActorReviewRating field to given value. + +### HasActorReviewRating + +`func (o *ActorStats) HasActorReviewRating() bool` + +HasActorReviewRating returns a boolean if a field has been set. + +### GetBookmarkCount + +`func (o *ActorStats) GetBookmarkCount() int32` + +GetBookmarkCount returns the BookmarkCount field if non-nil, zero value otherwise. + +### GetBookmarkCountOk + +`func (o *ActorStats) GetBookmarkCountOk() (*int32, bool)` + +GetBookmarkCountOk returns a tuple with the BookmarkCount field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetBookmarkCount + +`func (o *ActorStats) SetBookmarkCount(v int32)` + +SetBookmarkCount sets BookmarkCount field to given value. + +### HasBookmarkCount + +`func (o *ActorStats) HasBookmarkCount() bool` + +HasBookmarkCount returns a boolean if a field has been set. + +### GetPublicActorRunStats30Days + +`func (o *ActorStats) GetPublicActorRunStats30Days() ActorStatsPublicActorRunStats30Days` + +GetPublicActorRunStats30Days returns the PublicActorRunStats30Days field if non-nil, zero value otherwise. + +### GetPublicActorRunStats30DaysOk + +`func (o *ActorStats) GetPublicActorRunStats30DaysOk() (*ActorStatsPublicActorRunStats30Days, bool)` + +GetPublicActorRunStats30DaysOk returns a tuple with the PublicActorRunStats30Days field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPublicActorRunStats30Days + +`func (o *ActorStats) SetPublicActorRunStats30Days(v ActorStatsPublicActorRunStats30Days)` + +SetPublicActorRunStats30Days sets PublicActorRunStats30Days field to given value. + +### HasPublicActorRunStats30Days + +`func (o *ActorStats) HasPublicActorRunStats30Days() bool` + +HasPublicActorRunStats30Days returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ActorStatsPublicActorRunStats30Days.md b/docs/ActorStatsPublicActorRunStats30Days.md new file mode 100644 index 0000000..f18d079 --- /dev/null +++ b/docs/ActorStatsPublicActorRunStats30Days.md @@ -0,0 +1,160 @@ +# ActorStatsPublicActorRunStats30Days + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ABORTED** | Pointer to **int32** | | [optional] +**FAILED** | Pointer to **int32** | | [optional] +**SUCCEEDED** | Pointer to **int32** | | [optional] +**TIMED_OUT** | Pointer to **int32** | | [optional] +**TOTAL** | Pointer to **int32** | | [optional] + +## Methods + +### NewActorStatsPublicActorRunStats30Days + +`func NewActorStatsPublicActorRunStats30Days() *ActorStatsPublicActorRunStats30Days` + +NewActorStatsPublicActorRunStats30Days instantiates a new ActorStatsPublicActorRunStats30Days object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewActorStatsPublicActorRunStats30DaysWithDefaults + +`func NewActorStatsPublicActorRunStats30DaysWithDefaults() *ActorStatsPublicActorRunStats30Days` + +NewActorStatsPublicActorRunStats30DaysWithDefaults instantiates a new ActorStatsPublicActorRunStats30Days object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetABORTED + +`func (o *ActorStatsPublicActorRunStats30Days) GetABORTED() int32` + +GetABORTED returns the ABORTED field if non-nil, zero value otherwise. + +### GetABORTEDOk + +`func (o *ActorStatsPublicActorRunStats30Days) GetABORTEDOk() (*int32, bool)` + +GetABORTEDOk returns a tuple with the ABORTED field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetABORTED + +`func (o *ActorStatsPublicActorRunStats30Days) SetABORTED(v int32)` + +SetABORTED sets ABORTED field to given value. + +### HasABORTED + +`func (o *ActorStatsPublicActorRunStats30Days) HasABORTED() bool` + +HasABORTED returns a boolean if a field has been set. + +### GetFAILED + +`func (o *ActorStatsPublicActorRunStats30Days) GetFAILED() int32` + +GetFAILED returns the FAILED field if non-nil, zero value otherwise. + +### GetFAILEDOk + +`func (o *ActorStatsPublicActorRunStats30Days) GetFAILEDOk() (*int32, bool)` + +GetFAILEDOk returns a tuple with the FAILED field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetFAILED + +`func (o *ActorStatsPublicActorRunStats30Days) SetFAILED(v int32)` + +SetFAILED sets FAILED field to given value. + +### HasFAILED + +`func (o *ActorStatsPublicActorRunStats30Days) HasFAILED() bool` + +HasFAILED returns a boolean if a field has been set. + +### GetSUCCEEDED + +`func (o *ActorStatsPublicActorRunStats30Days) GetSUCCEEDED() int32` + +GetSUCCEEDED returns the SUCCEEDED field if non-nil, zero value otherwise. + +### GetSUCCEEDEDOk + +`func (o *ActorStatsPublicActorRunStats30Days) GetSUCCEEDEDOk() (*int32, bool)` + +GetSUCCEEDEDOk returns a tuple with the SUCCEEDED field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSUCCEEDED + +`func (o *ActorStatsPublicActorRunStats30Days) SetSUCCEEDED(v int32)` + +SetSUCCEEDED sets SUCCEEDED field to given value. + +### HasSUCCEEDED + +`func (o *ActorStatsPublicActorRunStats30Days) HasSUCCEEDED() bool` + +HasSUCCEEDED returns a boolean if a field has been set. + +### GetTIMED_OUT + +`func (o *ActorStatsPublicActorRunStats30Days) GetTIMED_OUT() int32` + +GetTIMED_OUT returns the TIMED_OUT field if non-nil, zero value otherwise. + +### GetTIMED_OUTOk + +`func (o *ActorStatsPublicActorRunStats30Days) GetTIMED_OUTOk() (*int32, bool)` + +GetTIMED_OUTOk returns a tuple with the TIMED_OUT field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTIMED_OUT + +`func (o *ActorStatsPublicActorRunStats30Days) SetTIMED_OUT(v int32)` + +SetTIMED_OUT sets TIMED_OUT field to given value. + +### HasTIMED_OUT + +`func (o *ActorStatsPublicActorRunStats30Days) HasTIMED_OUT() bool` + +HasTIMED_OUT returns a boolean if a field has been set. + +### GetTOTAL + +`func (o *ActorStatsPublicActorRunStats30Days) GetTOTAL() int32` + +GetTOTAL returns the TOTAL field if non-nil, zero value otherwise. + +### GetTOTALOk + +`func (o *ActorStatsPublicActorRunStats30Days) GetTOTALOk() (*int32, bool)` + +GetTOTALOk returns a tuple with the TOTAL field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTOTAL + +`func (o *ActorStatsPublicActorRunStats30Days) SetTOTAL(v int32)` + +SetTOTAL sets TOTAL field to given value. + +### HasTOTAL + +`func (o *ActorStatsPublicActorRunStats30Days) HasTOTAL() bool` + +HasTOTAL returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ActorTaskGet200Response.md b/docs/ActorTaskGet200Response.md new file mode 100644 index 0000000..a059f12 --- /dev/null +++ b/docs/ActorTaskGet200Response.md @@ -0,0 +1,51 @@ +# ActorTaskGet200Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Data** | [**Task**](Task.md) | | + +## Methods + +### NewActorTaskGet200Response + +`func NewActorTaskGet200Response(data Task, ) *ActorTaskGet200Response` + +NewActorTaskGet200Response instantiates a new ActorTaskGet200Response object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewActorTaskGet200ResponseWithDefaults + +`func NewActorTaskGet200ResponseWithDefaults() *ActorTaskGet200Response` + +NewActorTaskGet200ResponseWithDefaults instantiates a new ActorTaskGet200Response object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetData + +`func (o *ActorTaskGet200Response) GetData() Task` + +GetData returns the Data field if non-nil, zero value otherwise. + +### GetDataOk + +`func (o *ActorTaskGet200Response) GetDataOk() (*Task, bool)` + +GetDataOk returns a tuple with the Data field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetData + +`func (o *ActorTaskGet200Response) SetData(v Task)` + +SetData sets Data field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ActorTaskRunsGet200Response.md b/docs/ActorTaskRunsGet200Response.md new file mode 100644 index 0000000..4ec813c --- /dev/null +++ b/docs/ActorTaskRunsGet200Response.md @@ -0,0 +1,51 @@ +# ActorTaskRunsGet200Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Data** | [**ActorTaskRunsGet200ResponseData**](ActorTaskRunsGet200ResponseData.md) | | + +## Methods + +### NewActorTaskRunsGet200Response + +`func NewActorTaskRunsGet200Response(data ActorTaskRunsGet200ResponseData, ) *ActorTaskRunsGet200Response` + +NewActorTaskRunsGet200Response instantiates a new ActorTaskRunsGet200Response object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewActorTaskRunsGet200ResponseWithDefaults + +`func NewActorTaskRunsGet200ResponseWithDefaults() *ActorTaskRunsGet200Response` + +NewActorTaskRunsGet200ResponseWithDefaults instantiates a new ActorTaskRunsGet200Response object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetData + +`func (o *ActorTaskRunsGet200Response) GetData() ActorTaskRunsGet200ResponseData` + +GetData returns the Data field if non-nil, zero value otherwise. + +### GetDataOk + +`func (o *ActorTaskRunsGet200Response) GetDataOk() (*ActorTaskRunsGet200ResponseData, bool)` + +GetDataOk returns a tuple with the Data field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetData + +`func (o *ActorTaskRunsGet200Response) SetData(v ActorTaskRunsGet200ResponseData)` + +SetData sets Data field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ActorTaskRunsGet200ResponseData.md b/docs/ActorTaskRunsGet200ResponseData.md new file mode 100644 index 0000000..996ee85 --- /dev/null +++ b/docs/ActorTaskRunsGet200ResponseData.md @@ -0,0 +1,156 @@ +# ActorTaskRunsGet200ResponseData + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Total** | **int32** | The total number of items available across all pages. | +**Offset** | **int32** | The starting position for this page of results. | +**Limit** | **int32** | The maximum number of items returned per page. | +**Desc** | **bool** | Whether the results are sorted in descending order. | +**Count** | **int32** | The number of items returned in this response. | +**Items** | [**[]RunShort**](RunShort.md) | | + +## Methods + +### NewActorTaskRunsGet200ResponseData + +`func NewActorTaskRunsGet200ResponseData(total int32, offset int32, limit int32, desc bool, count int32, items []RunShort, ) *ActorTaskRunsGet200ResponseData` + +NewActorTaskRunsGet200ResponseData instantiates a new ActorTaskRunsGet200ResponseData object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewActorTaskRunsGet200ResponseDataWithDefaults + +`func NewActorTaskRunsGet200ResponseDataWithDefaults() *ActorTaskRunsGet200ResponseData` + +NewActorTaskRunsGet200ResponseDataWithDefaults instantiates a new ActorTaskRunsGet200ResponseData object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetTotal + +`func (o *ActorTaskRunsGet200ResponseData) GetTotal() int32` + +GetTotal returns the Total field if non-nil, zero value otherwise. + +### GetTotalOk + +`func (o *ActorTaskRunsGet200ResponseData) GetTotalOk() (*int32, bool)` + +GetTotalOk returns a tuple with the Total field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTotal + +`func (o *ActorTaskRunsGet200ResponseData) SetTotal(v int32)` + +SetTotal sets Total field to given value. + + +### GetOffset + +`func (o *ActorTaskRunsGet200ResponseData) GetOffset() int32` + +GetOffset returns the Offset field if non-nil, zero value otherwise. + +### GetOffsetOk + +`func (o *ActorTaskRunsGet200ResponseData) GetOffsetOk() (*int32, bool)` + +GetOffsetOk returns a tuple with the Offset field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetOffset + +`func (o *ActorTaskRunsGet200ResponseData) SetOffset(v int32)` + +SetOffset sets Offset field to given value. + + +### GetLimit + +`func (o *ActorTaskRunsGet200ResponseData) GetLimit() int32` + +GetLimit returns the Limit field if non-nil, zero value otherwise. + +### GetLimitOk + +`func (o *ActorTaskRunsGet200ResponseData) GetLimitOk() (*int32, bool)` + +GetLimitOk returns a tuple with the Limit field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetLimit + +`func (o *ActorTaskRunsGet200ResponseData) SetLimit(v int32)` + +SetLimit sets Limit field to given value. + + +### GetDesc + +`func (o *ActorTaskRunsGet200ResponseData) GetDesc() bool` + +GetDesc returns the Desc field if non-nil, zero value otherwise. + +### GetDescOk + +`func (o *ActorTaskRunsGet200ResponseData) GetDescOk() (*bool, bool)` + +GetDescOk returns a tuple with the Desc field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDesc + +`func (o *ActorTaskRunsGet200ResponseData) SetDesc(v bool)` + +SetDesc sets Desc field to given value. + + +### GetCount + +`func (o *ActorTaskRunsGet200ResponseData) GetCount() int32` + +GetCount returns the Count field if non-nil, zero value otherwise. + +### GetCountOk + +`func (o *ActorTaskRunsGet200ResponseData) GetCountOk() (*int32, bool)` + +GetCountOk returns a tuple with the Count field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCount + +`func (o *ActorTaskRunsGet200ResponseData) SetCount(v int32)` + +SetCount sets Count field to given value. + + +### GetItems + +`func (o *ActorTaskRunsGet200ResponseData) GetItems() []RunShort` + +GetItems returns the Items field if non-nil, zero value otherwise. + +### GetItemsOk + +`func (o *ActorTaskRunsGet200ResponseData) GetItemsOk() (*[]RunShort, bool)` + +GetItemsOk returns a tuple with the Items field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetItems + +`func (o *ActorTaskRunsGet200ResponseData) SetItems(v []RunShort)` + +SetItems sets Items field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ActorTaskRunsPost201Response.md b/docs/ActorTaskRunsPost201Response.md new file mode 100644 index 0000000..c29f11e --- /dev/null +++ b/docs/ActorTaskRunsPost201Response.md @@ -0,0 +1,51 @@ +# ActorTaskRunsPost201Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Data** | [**Run**](Run.md) | | + +## Methods + +### NewActorTaskRunsPost201Response + +`func NewActorTaskRunsPost201Response(data Run, ) *ActorTaskRunsPost201Response` + +NewActorTaskRunsPost201Response instantiates a new ActorTaskRunsPost201Response object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewActorTaskRunsPost201ResponseWithDefaults + +`func NewActorTaskRunsPost201ResponseWithDefaults() *ActorTaskRunsPost201Response` + +NewActorTaskRunsPost201ResponseWithDefaults instantiates a new ActorTaskRunsPost201Response object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetData + +`func (o *ActorTaskRunsPost201Response) GetData() Run` + +GetData returns the Data field if non-nil, zero value otherwise. + +### GetDataOk + +`func (o *ActorTaskRunsPost201Response) GetDataOk() (*Run, bool)` + +GetDataOk returns a tuple with the Data field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetData + +`func (o *ActorTaskRunsPost201Response) SetData(v Run)` + +SetData sets Data field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ActorTaskWebhooksGet200Response.md b/docs/ActorTaskWebhooksGet200Response.md new file mode 100644 index 0000000..9d64664 --- /dev/null +++ b/docs/ActorTaskWebhooksGet200Response.md @@ -0,0 +1,51 @@ +# ActorTaskWebhooksGet200Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Data** | [**ActorTaskWebhooksGet200ResponseData**](ActorTaskWebhooksGet200ResponseData.md) | | + +## Methods + +### NewActorTaskWebhooksGet200Response + +`func NewActorTaskWebhooksGet200Response(data ActorTaskWebhooksGet200ResponseData, ) *ActorTaskWebhooksGet200Response` + +NewActorTaskWebhooksGet200Response instantiates a new ActorTaskWebhooksGet200Response object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewActorTaskWebhooksGet200ResponseWithDefaults + +`func NewActorTaskWebhooksGet200ResponseWithDefaults() *ActorTaskWebhooksGet200Response` + +NewActorTaskWebhooksGet200ResponseWithDefaults instantiates a new ActorTaskWebhooksGet200Response object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetData + +`func (o *ActorTaskWebhooksGet200Response) GetData() ActorTaskWebhooksGet200ResponseData` + +GetData returns the Data field if non-nil, zero value otherwise. + +### GetDataOk + +`func (o *ActorTaskWebhooksGet200Response) GetDataOk() (*ActorTaskWebhooksGet200ResponseData, bool)` + +GetDataOk returns a tuple with the Data field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetData + +`func (o *ActorTaskWebhooksGet200Response) SetData(v ActorTaskWebhooksGet200ResponseData)` + +SetData sets Data field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ActorTaskWebhooksGet200ResponseData.md b/docs/ActorTaskWebhooksGet200ResponseData.md new file mode 100644 index 0000000..861b41d --- /dev/null +++ b/docs/ActorTaskWebhooksGet200ResponseData.md @@ -0,0 +1,156 @@ +# ActorTaskWebhooksGet200ResponseData + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Total** | **int32** | The total number of items available across all pages. | +**Offset** | **int32** | The starting position for this page of results. | +**Limit** | **int32** | The maximum number of items returned per page. | +**Desc** | **bool** | Whether the results are sorted in descending order. | +**Count** | **int32** | The number of items returned in this response. | +**Items** | [**[]Webhook**](Webhook.md) | | + +## Methods + +### NewActorTaskWebhooksGet200ResponseData + +`func NewActorTaskWebhooksGet200ResponseData(total int32, offset int32, limit int32, desc bool, count int32, items []Webhook, ) *ActorTaskWebhooksGet200ResponseData` + +NewActorTaskWebhooksGet200ResponseData instantiates a new ActorTaskWebhooksGet200ResponseData object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewActorTaskWebhooksGet200ResponseDataWithDefaults + +`func NewActorTaskWebhooksGet200ResponseDataWithDefaults() *ActorTaskWebhooksGet200ResponseData` + +NewActorTaskWebhooksGet200ResponseDataWithDefaults instantiates a new ActorTaskWebhooksGet200ResponseData object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetTotal + +`func (o *ActorTaskWebhooksGet200ResponseData) GetTotal() int32` + +GetTotal returns the Total field if non-nil, zero value otherwise. + +### GetTotalOk + +`func (o *ActorTaskWebhooksGet200ResponseData) GetTotalOk() (*int32, bool)` + +GetTotalOk returns a tuple with the Total field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTotal + +`func (o *ActorTaskWebhooksGet200ResponseData) SetTotal(v int32)` + +SetTotal sets Total field to given value. + + +### GetOffset + +`func (o *ActorTaskWebhooksGet200ResponseData) GetOffset() int32` + +GetOffset returns the Offset field if non-nil, zero value otherwise. + +### GetOffsetOk + +`func (o *ActorTaskWebhooksGet200ResponseData) GetOffsetOk() (*int32, bool)` + +GetOffsetOk returns a tuple with the Offset field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetOffset + +`func (o *ActorTaskWebhooksGet200ResponseData) SetOffset(v int32)` + +SetOffset sets Offset field to given value. + + +### GetLimit + +`func (o *ActorTaskWebhooksGet200ResponseData) GetLimit() int32` + +GetLimit returns the Limit field if non-nil, zero value otherwise. + +### GetLimitOk + +`func (o *ActorTaskWebhooksGet200ResponseData) GetLimitOk() (*int32, bool)` + +GetLimitOk returns a tuple with the Limit field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetLimit + +`func (o *ActorTaskWebhooksGet200ResponseData) SetLimit(v int32)` + +SetLimit sets Limit field to given value. + + +### GetDesc + +`func (o *ActorTaskWebhooksGet200ResponseData) GetDesc() bool` + +GetDesc returns the Desc field if non-nil, zero value otherwise. + +### GetDescOk + +`func (o *ActorTaskWebhooksGet200ResponseData) GetDescOk() (*bool, bool)` + +GetDescOk returns a tuple with the Desc field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDesc + +`func (o *ActorTaskWebhooksGet200ResponseData) SetDesc(v bool)` + +SetDesc sets Desc field to given value. + + +### GetCount + +`func (o *ActorTaskWebhooksGet200ResponseData) GetCount() int32` + +GetCount returns the Count field if non-nil, zero value otherwise. + +### GetCountOk + +`func (o *ActorTaskWebhooksGet200ResponseData) GetCountOk() (*int32, bool)` + +GetCountOk returns a tuple with the Count field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCount + +`func (o *ActorTaskWebhooksGet200ResponseData) SetCount(v int32)` + +SetCount sets Count field to given value. + + +### GetItems + +`func (o *ActorTaskWebhooksGet200ResponseData) GetItems() []Webhook` + +GetItems returns the Items field if non-nil, zero value otherwise. + +### GetItemsOk + +`func (o *ActorTaskWebhooksGet200ResponseData) GetItemsOk() (*[]Webhook, bool)` + +GetItemsOk returns a tuple with the Items field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetItems + +`func (o *ActorTaskWebhooksGet200ResponseData) SetItems(v []Webhook)` + +SetItems sets Items field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ActorTasksAPI.md b/docs/ActorTasksAPI.md new file mode 100644 index 0000000..e833894 --- /dev/null +++ b/docs/ActorTasksAPI.md @@ -0,0 +1,1257 @@ +# \ActorTasksAPI + +All URIs are relative to *https://api.apify.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**ActorTaskDelete**](ActorTasksAPI.md#ActorTaskDelete) | **Delete** /v2/actor-tasks/{actorTaskId} | Delete task +[**ActorTaskGet**](ActorTasksAPI.md#ActorTaskGet) | **Get** /v2/actor-tasks/{actorTaskId} | Get task +[**ActorTaskInputGet**](ActorTasksAPI.md#ActorTaskInputGet) | **Get** /v2/actor-tasks/{actorTaskId}/input | Get task input +[**ActorTaskInputPut**](ActorTasksAPI.md#ActorTaskInputPut) | **Put** /v2/actor-tasks/{actorTaskId}/input | Update task input +[**ActorTaskPut**](ActorTasksAPI.md#ActorTaskPut) | **Put** /v2/actor-tasks/{actorTaskId} | Update task +[**ActorTaskRunSyncGet**](ActorTasksAPI.md#ActorTaskRunSyncGet) | **Get** /v2/actor-tasks/{actorTaskId}/run-sync | Run task synchronously +[**ActorTaskRunSyncGetDatasetItemsGet**](ActorTasksAPI.md#ActorTaskRunSyncGetDatasetItemsGet) | **Get** /v2/actor-tasks/{actorTaskId}/run-sync-get-dataset-items | Run task synchronously and get dataset items +[**ActorTaskRunSyncGetDatasetItemsPost**](ActorTasksAPI.md#ActorTaskRunSyncGetDatasetItemsPost) | **Post** /v2/actor-tasks/{actorTaskId}/run-sync-get-dataset-items | Run task synchronously and get dataset items +[**ActorTaskRunSyncPost**](ActorTasksAPI.md#ActorTaskRunSyncPost) | **Post** /v2/actor-tasks/{actorTaskId}/run-sync | Run task synchronously +[**ActorTaskRunsGet**](ActorTasksAPI.md#ActorTaskRunsGet) | **Get** /v2/actor-tasks/{actorTaskId}/runs | Get list of task runs +[**ActorTaskRunsLastGet**](ActorTasksAPI.md#ActorTaskRunsLastGet) | **Get** /v2/actor-tasks/{actorTaskId}/runs/last | Get last run +[**ActorTaskRunsPost**](ActorTasksAPI.md#ActorTaskRunsPost) | **Post** /v2/actor-tasks/{actorTaskId}/runs | Run task +[**ActorTaskWebhooksGet**](ActorTasksAPI.md#ActorTaskWebhooksGet) | **Get** /v2/actor-tasks/{actorTaskId}/webhooks | Get list of webhooks +[**ActorTasksGet**](ActorTasksAPI.md#ActorTasksGet) | **Get** /v2/actor-tasks | Get list of tasks +[**ActorTasksPost**](ActorTasksAPI.md#ActorTasksPost) | **Post** /v2/actor-tasks | Create task + + + +## ActorTaskDelete + +> map[string]interface{} ActorTaskDelete(ctx, actorTaskId).Execute() + +Delete task + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + actorTaskId := "janedoe~my-task" // string | Task ID or a tilde-separated owner's username and task's name. + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.ActorTasksAPI.ActorTaskDelete(context.Background(), actorTaskId).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ActorTasksAPI.ActorTaskDelete``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ActorTaskDelete`: map[string]interface{} + fmt.Fprintf(os.Stdout, "Response from `ActorTasksAPI.ActorTaskDelete`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**actorTaskId** | **string** | Task ID or a tilde-separated owner's username and task's name. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiActorTaskDeleteRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + +### Return type + +**map[string]interface{}** + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## ActorTaskGet + +> ActorTaskGet200Response ActorTaskGet(ctx, actorTaskId).Execute() + +Get task + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + actorTaskId := "janedoe~my-task" // string | Task ID or a tilde-separated owner's username and task's name. + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.ActorTasksAPI.ActorTaskGet(context.Background(), actorTaskId).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ActorTasksAPI.ActorTaskGet``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ActorTaskGet`: ActorTaskGet200Response + fmt.Fprintf(os.Stdout, "Response from `ActorTasksAPI.ActorTaskGet`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**actorTaskId** | **string** | Task ID or a tilde-separated owner's username and task's name. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiActorTaskGetRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + +### Return type + +[**ActorTaskGet200Response**](ActorTaskGet200Response.md) + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## ActorTaskInputGet + +> map[string]interface{} ActorTaskInputGet(ctx, actorTaskId).Execute() + +Get task input + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + actorTaskId := "janedoe~my-task" // string | Task ID or a tilde-separated owner's username and task's name. + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.ActorTasksAPI.ActorTaskInputGet(context.Background(), actorTaskId).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ActorTasksAPI.ActorTaskInputGet``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ActorTaskInputGet`: map[string]interface{} + fmt.Fprintf(os.Stdout, "Response from `ActorTasksAPI.ActorTaskInputGet`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**actorTaskId** | **string** | Task ID or a tilde-separated owner's username and task's name. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiActorTaskInputGetRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + +### Return type + +**map[string]interface{}** + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## ActorTaskInputPut + +> map[string]interface{} ActorTaskInputPut(ctx, actorTaskId).Body(body).Execute() + +Update task input + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + actorTaskId := "janedoe~my-task" // string | Task ID or a tilde-separated owner's username and task's name. + body := map[string]interface{}{ ... } // map[string]interface{} | + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.ActorTasksAPI.ActorTaskInputPut(context.Background(), actorTaskId).Body(body).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ActorTasksAPI.ActorTaskInputPut``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ActorTaskInputPut`: map[string]interface{} + fmt.Fprintf(os.Stdout, "Response from `ActorTasksAPI.ActorTaskInputPut`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**actorTaskId** | **string** | Task ID or a tilde-separated owner's username and task's name. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiActorTaskInputPutRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **body** | **map[string]interface{}** | | + +### Return type + +**map[string]interface{}** + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## ActorTaskPut + +> ActorTaskGet200Response ActorTaskPut(ctx, actorTaskId).UpdateTaskRequest(updateTaskRequest).Execute() + +Update task + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + actorTaskId := "janedoe~my-task" // string | Task ID or a tilde-separated owner's username and task's name. + updateTaskRequest := *openapiclient.NewUpdateTaskRequest() // UpdateTaskRequest | + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.ActorTasksAPI.ActorTaskPut(context.Background(), actorTaskId).UpdateTaskRequest(updateTaskRequest).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ActorTasksAPI.ActorTaskPut``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ActorTaskPut`: ActorTaskGet200Response + fmt.Fprintf(os.Stdout, "Response from `ActorTasksAPI.ActorTaskPut`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**actorTaskId** | **string** | Task ID or a tilde-separated owner's username and task's name. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiActorTaskPutRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **updateTaskRequest** | [**UpdateTaskRequest**](UpdateTaskRequest.md) | | + +### Return type + +[**ActorTaskGet200Response**](ActorTaskGet200Response.md) + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## ActorTaskRunSyncGet + +> map[string]interface{} ActorTaskRunSyncGet(ctx, actorTaskId).Timeout(timeout).Memory(memory).MaxItems(maxItems).Build(build).OutputRecordKey(outputRecordKey).Webhooks(webhooks).Execute() + +Run task synchronously + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + actorTaskId := "janedoe~my-task" // string | Task ID or a tilde-separated owner's username and task's name. + timeout := float64(60) // float64 | Optional timeout for the run, in seconds. By default, the run uses the timeout from its configuration. (optional) + memory := float64(256) // float64 | Memory limit for the run, in megabytes. The amount of memory can be set to a power of 2 with a minimum of 128. By default, the run uses the memory limit from its configuration. (optional) + maxItems := float64(1000) // float64 | Specifies the maximum number of dataset items that will be charged for pay-per-result Actors. This does NOT guarantee that the Actor will return only this many items. It only ensures you won't be charged for more than this number of items. Only works for pay-per-result Actors. Value can be accessed in the actor run using `ACTOR_MAX_PAID_DATASET_ITEMS` environment variable. (optional) + build := "0.1.234" // string | Specifies the Actor build to run. It can be either a build tag or build number. By default, the run uses the build from its configuration (typically `latest`). (optional) + outputRecordKey := "OUTPUT" // string | Key of the record from run's default key-value store to be returned in the response. By default, it is `OUTPUT`. (optional) + webhooks := "dGhpcyBpcyBqdXN0IGV4YW1wbGUK..." // string | Specifies optional webhooks associated with the Actor run, which can be used to receive a notification e.g. when the Actor finished or failed. The value is a Base64-encoded JSON array whose items follow the WebhookRepresentation schema. For more information, see [Webhooks documentation](https://docs.apify.com/platform/integrations/webhooks). (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.ActorTasksAPI.ActorTaskRunSyncGet(context.Background(), actorTaskId).Timeout(timeout).Memory(memory).MaxItems(maxItems).Build(build).OutputRecordKey(outputRecordKey).Webhooks(webhooks).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ActorTasksAPI.ActorTaskRunSyncGet``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ActorTaskRunSyncGet`: map[string]interface{} + fmt.Fprintf(os.Stdout, "Response from `ActorTasksAPI.ActorTaskRunSyncGet`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**actorTaskId** | **string** | Task ID or a tilde-separated owner's username and task's name. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiActorTaskRunSyncGetRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **timeout** | **float64** | Optional timeout for the run, in seconds. By default, the run uses the timeout from its configuration. | + **memory** | **float64** | Memory limit for the run, in megabytes. The amount of memory can be set to a power of 2 with a minimum of 128. By default, the run uses the memory limit from its configuration. | + **maxItems** | **float64** | Specifies the maximum number of dataset items that will be charged for pay-per-result Actors. This does NOT guarantee that the Actor will return only this many items. It only ensures you won't be charged for more than this number of items. Only works for pay-per-result Actors. Value can be accessed in the actor run using `ACTOR_MAX_PAID_DATASET_ITEMS` environment variable. | + **build** | **string** | Specifies the Actor build to run. It can be either a build tag or build number. By default, the run uses the build from its configuration (typically `latest`). | + **outputRecordKey** | **string** | Key of the record from run's default key-value store to be returned in the response. By default, it is `OUTPUT`. | + **webhooks** | **string** | Specifies optional webhooks associated with the Actor run, which can be used to receive a notification e.g. when the Actor finished or failed. The value is a Base64-encoded JSON array whose items follow the WebhookRepresentation schema. For more information, see [Webhooks documentation](https://docs.apify.com/platform/integrations/webhooks). | + +### Return type + +**map[string]interface{}** + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## ActorTaskRunSyncGetDatasetItemsGet + +> map[string]interface{} ActorTaskRunSyncGetDatasetItemsGet(ctx, actorTaskId).Timeout(timeout).Memory(memory).MaxItems(maxItems).Build(build).Webhooks(webhooks).Format(format).Clean(clean).Offset(offset).Limit(limit).Fields(fields).OutputFields(outputFields).Omit(omit).Unwind(unwind).Flatten(flatten).Desc(desc).Attachment(attachment).Delimiter(delimiter).Bom(bom).XmlRoot(xmlRoot).XmlRow(xmlRow).SkipHeaderRow(skipHeaderRow).SkipHidden(skipHidden).SkipEmpty(skipEmpty).Simplified(simplified).View(view).SkipFailedPages(skipFailedPages).FeedTitle(feedTitle).FeedDescription(feedDescription).Execute() + +Run task synchronously and get dataset items + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + actorTaskId := "janedoe~my-task" // string | Task ID or a tilde-separated owner's username and task's name. + timeout := float64(60) // float64 | Optional timeout for the run, in seconds. By default, the run uses the timeout from its configuration. (optional) + memory := float64(256) // float64 | Memory limit for the run, in megabytes. The amount of memory can be set to a power of 2 with a minimum of 128. By default, the run uses the memory limit from its configuration. (optional) + maxItems := float64(1000) // float64 | Specifies the maximum number of dataset items that will be charged for pay-per-result Actors. This does NOT guarantee that the Actor will return only this many items. It only ensures you won't be charged for more than this number of items. Only works for pay-per-result Actors. Value can be accessed in the actor run using `ACTOR_MAX_PAID_DATASET_ITEMS` environment variable. (optional) + build := "0.1.234" // string | Specifies the Actor build to run. It can be either a build tag or build number. By default, the run uses the build from its configuration (typically `latest`). (optional) + webhooks := "dGhpcyBpcyBqdXN0IGV4YW1wbGUK..." // string | Specifies optional webhooks associated with the Actor run, which can be used to receive a notification e.g. when the Actor finished or failed. The value is a Base64-encoded JSON array whose items follow the WebhookRepresentation schema. For more information, see [Webhooks documentation](https://docs.apify.com/platform/integrations/webhooks). (optional) + format := "json" // string | Format of the results, possible values are: `json`, `jsonl`, `csv`, `html`, `xlsx`, `xml` and `rss`. The default value is `json`. (optional) + clean := false // bool | If `true` or `1` then the API endpoint returns only non-empty items and skips hidden fields (i.e. fields starting with the # character). The `clean` parameter is just a shortcut for `skipHidden=true` and `skipEmpty=true` parameters. Note that since some objects might be skipped from the output, that the result might contain less items than the `limit` value. (optional) + offset := float64(0) // float64 | Number of items that should be skipped at the start. The default value is `0`. (optional) + limit := float64(1.2) // float64 | Maximum number of items to return. By default there is no limit. (optional) + fields := "myValue,myOtherValue" // string | A comma-separated list of fields which should be picked from the items, only these fields will remain in the resulting record objects. Note that the fields in the outputted items are sorted the same way as they are specified in the `fields` query parameter. You can use this feature to effectively fix the output format. (optional) + outputFields := "title,link" // string | A comma-separated list of output field names that positionally rename the fields specified in the `fields` parameter. For example, `?fields=headline,url&outputFields=title,link` renames `headline` to `title` and `url` to `link` in the output. The number of names in `outputFields` must match the number of names in `fields`. Requires the `fields` parameter to be specified as well. (optional) + omit := "myValue,myOtherValue" // string | A comma-separated list of fields which should be omitted from the items. (optional) + unwind := "myValue,myOtherValue" // string | A comma-separated list of fields which should be unwound, in order which they should be processed. Each field should be either an array or an object. If the field is an array then every element of the array will become a separate record and merged with parent object. If the unwound field is an object then it is merged with the parent object. If the unwound field is missing or its value is neither an array nor an object and therefore cannot be merged with a parent object then the item gets preserved as it is. Note that the unwound items ignore the `desc` parameter. (optional) + flatten := "myValue" // string | A comma-separated list of fields which should transform nested objects into flat structures. For example, with `flatten=\"foo\"` the object `{\"foo\":{\"bar\": \"hello\"}}` is turned into `{\"foo.bar\": \"hello\"}`. The original object with properties is replaced with the flattened object. (optional) + desc := true // bool | By default, results are returned in the same order as they were stored. To reverse the order, set this parameter to `true` or `1`. (optional) + attachment := true // bool | If `true` or `1` then the response will define the `Content-Disposition: attachment` header, forcing a web browser to download the file rather than to display it. By default this header is not present. (optional) + delimiter := ";" // string | A delimiter character for CSV files, only used if `format=csv`. You might need to URL-encode the character (e.g. use `%09` for tab or `%3B` for semicolon). The default delimiter is a simple comma (`,`). (optional) + bom := false // bool | All text responses are encoded in UTF-8 encoding. By default, the `format=csv` files are prefixed with the UTF-8 Byte Order Mark (BOM), while `json`, `jsonl`, `xml`, `html` and `rss` files are not. If you want to override this default behavior, specify `bom=1` query parameter to include the BOM or `bom=0` to skip it. (optional) + xmlRoot := "items" // string | Overrides default root element name of `xml` output. By default the root element is `items`. (optional) + xmlRow := "item" // string | Overrides default element name that wraps each page or page function result object in `xml` output. By default the element name is `item`. (optional) + skipHeaderRow := true // bool | If `true` or `1` then header row in the `csv` format is skipped. (optional) + skipHidden := false // bool | If `true` or `1` then hidden fields are skipped from the output, i.e. fields starting with the `#` character. (optional) + skipEmpty := false // bool | If `true` or `1` then empty items are skipped from the output. Note that if used, the results might contain less items than the limit value. (optional) + simplified := false // bool | If `true` or `1` then, the endpoint applies the `fields=url,pageFunctionResult,errorInfo` and `unwind=pageFunctionResult` query parameters. This feature is used to emulate simplified results provided by the legacy Apify Crawler product and it's not recommended to use it in new integrations. (optional) + view := "overview" // string | Defines the view configuration for dataset items based on the schema definition. This parameter determines how the data will be filtered and presented. For complete specification details, see the [dataset schema documentation](/platform/actors/development/actor-definition/dataset-schema). (optional) + skipFailedPages := false // bool | If `true` or `1` then, the all the items with errorInfo property will be skipped from the output. This feature is here to emulate functionality of API version 1 used for the legacy Apify Crawler product and it's not recommended to use it in new integrations. (optional) + feedTitle := "Latest posts from r/pasta" // string | Overrides the auto-generated RSS channel `<title>` element. Only used when `format=rss`. If not provided, the title defaults to `Dataset <label>`. (optional) + feedDescription := "Scraped forum posts" // string | Overrides the auto-generated RSS channel `<description>` element. Only used when `format=rss`. If not provided, the description defaults to `Items in dataset with id \"<datasetId>\".` (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.ActorTasksAPI.ActorTaskRunSyncGetDatasetItemsGet(context.Background(), actorTaskId).Timeout(timeout).Memory(memory).MaxItems(maxItems).Build(build).Webhooks(webhooks).Format(format).Clean(clean).Offset(offset).Limit(limit).Fields(fields).OutputFields(outputFields).Omit(omit).Unwind(unwind).Flatten(flatten).Desc(desc).Attachment(attachment).Delimiter(delimiter).Bom(bom).XmlRoot(xmlRoot).XmlRow(xmlRow).SkipHeaderRow(skipHeaderRow).SkipHidden(skipHidden).SkipEmpty(skipEmpty).Simplified(simplified).View(view).SkipFailedPages(skipFailedPages).FeedTitle(feedTitle).FeedDescription(feedDescription).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ActorTasksAPI.ActorTaskRunSyncGetDatasetItemsGet``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ActorTaskRunSyncGetDatasetItemsGet`: map[string]interface{} + fmt.Fprintf(os.Stdout, "Response from `ActorTasksAPI.ActorTaskRunSyncGetDatasetItemsGet`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**actorTaskId** | **string** | Task ID or a tilde-separated owner's username and task's name. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiActorTaskRunSyncGetDatasetItemsGetRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **timeout** | **float64** | Optional timeout for the run, in seconds. By default, the run uses the timeout from its configuration. | + **memory** | **float64** | Memory limit for the run, in megabytes. The amount of memory can be set to a power of 2 with a minimum of 128. By default, the run uses the memory limit from its configuration. | + **maxItems** | **float64** | Specifies the maximum number of dataset items that will be charged for pay-per-result Actors. This does NOT guarantee that the Actor will return only this many items. It only ensures you won't be charged for more than this number of items. Only works for pay-per-result Actors. Value can be accessed in the actor run using `ACTOR_MAX_PAID_DATASET_ITEMS` environment variable. | + **build** | **string** | Specifies the Actor build to run. It can be either a build tag or build number. By default, the run uses the build from its configuration (typically `latest`). | + **webhooks** | **string** | Specifies optional webhooks associated with the Actor run, which can be used to receive a notification e.g. when the Actor finished or failed. The value is a Base64-encoded JSON array whose items follow the WebhookRepresentation schema. For more information, see [Webhooks documentation](https://docs.apify.com/platform/integrations/webhooks). | + **format** | **string** | Format of the results, possible values are: `json`, `jsonl`, `csv`, `html`, `xlsx`, `xml` and `rss`. The default value is `json`. | + **clean** | **bool** | If `true` or `1` then the API endpoint returns only non-empty items and skips hidden fields (i.e. fields starting with the # character). The `clean` parameter is just a shortcut for `skipHidden=true` and `skipEmpty=true` parameters. Note that since some objects might be skipped from the output, that the result might contain less items than the `limit` value. | + **offset** | **float64** | Number of items that should be skipped at the start. The default value is `0`. | + **limit** | **float64** | Maximum number of items to return. By default there is no limit. | + **fields** | **string** | A comma-separated list of fields which should be picked from the items, only these fields will remain in the resulting record objects. Note that the fields in the outputted items are sorted the same way as they are specified in the `fields` query parameter. You can use this feature to effectively fix the output format. | + **outputFields** | **string** | A comma-separated list of output field names that positionally rename the fields specified in the `fields` parameter. For example, `?fields=headline,url&outputFields=title,link` renames `headline` to `title` and `url` to `link` in the output. The number of names in `outputFields` must match the number of names in `fields`. Requires the `fields` parameter to be specified as well. | + **omit** | **string** | A comma-separated list of fields which should be omitted from the items. | + **unwind** | **string** | A comma-separated list of fields which should be unwound, in order which they should be processed. Each field should be either an array or an object. If the field is an array then every element of the array will become a separate record and merged with parent object. If the unwound field is an object then it is merged with the parent object. If the unwound field is missing or its value is neither an array nor an object and therefore cannot be merged with a parent object then the item gets preserved as it is. Note that the unwound items ignore the `desc` parameter. | + **flatten** | **string** | A comma-separated list of fields which should transform nested objects into flat structures. For example, with `flatten=\"foo\"` the object `{\"foo\":{\"bar\": \"hello\"}}` is turned into `{\"foo.bar\": \"hello\"}`. The original object with properties is replaced with the flattened object. | + **desc** | **bool** | By default, results are returned in the same order as they were stored. To reverse the order, set this parameter to `true` or `1`. | + **attachment** | **bool** | If `true` or `1` then the response will define the `Content-Disposition: attachment` header, forcing a web browser to download the file rather than to display it. By default this header is not present. | + **delimiter** | **string** | A delimiter character for CSV files, only used if `format=csv`. You might need to URL-encode the character (e.g. use `%09` for tab or `%3B` for semicolon). The default delimiter is a simple comma (`,`). | + **bom** | **bool** | All text responses are encoded in UTF-8 encoding. By default, the `format=csv` files are prefixed with the UTF-8 Byte Order Mark (BOM), while `json`, `jsonl`, `xml`, `html` and `rss` files are not. If you want to override this default behavior, specify `bom=1` query parameter to include the BOM or `bom=0` to skip it. | + **xmlRoot** | **string** | Overrides default root element name of `xml` output. By default the root element is `items`. | + **xmlRow** | **string** | Overrides default element name that wraps each page or page function result object in `xml` output. By default the element name is `item`. | + **skipHeaderRow** | **bool** | If `true` or `1` then header row in the `csv` format is skipped. | + **skipHidden** | **bool** | If `true` or `1` then hidden fields are skipped from the output, i.e. fields starting with the `#` character. | + **skipEmpty** | **bool** | If `true` or `1` then empty items are skipped from the output. Note that if used, the results might contain less items than the limit value. | + **simplified** | **bool** | If `true` or `1` then, the endpoint applies the `fields=url,pageFunctionResult,errorInfo` and `unwind=pageFunctionResult` query parameters. This feature is used to emulate simplified results provided by the legacy Apify Crawler product and it's not recommended to use it in new integrations. | + **view** | **string** | Defines the view configuration for dataset items based on the schema definition. This parameter determines how the data will be filtered and presented. For complete specification details, see the [dataset schema documentation](/platform/actors/development/actor-definition/dataset-schema). | + **skipFailedPages** | **bool** | If `true` or `1` then, the all the items with errorInfo property will be skipped from the output. This feature is here to emulate functionality of API version 1 used for the legacy Apify Crawler product and it's not recommended to use it in new integrations. | + **feedTitle** | **string** | Overrides the auto-generated RSS channel `<title>` element. Only used when `format=rss`. If not provided, the title defaults to `Dataset <label>`. | + **feedDescription** | **string** | Overrides the auto-generated RSS channel `<description>` element. Only used when `format=rss`. If not provided, the description defaults to `Items in dataset with id \"<datasetId>\".` | + +### Return type + +**map[string]interface{}** + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## ActorTaskRunSyncGetDatasetItemsPost + +> map[string]interface{} ActorTaskRunSyncGetDatasetItemsPost(ctx, actorTaskId).Body(body).Timeout(timeout).Memory(memory).MaxItems(maxItems).MaxTotalChargeUsd(maxTotalChargeUsd).RestartOnError(restartOnError).Build(build).Webhooks(webhooks).Format(format).Clean(clean).Offset(offset).Limit(limit).Fields(fields).OutputFields(outputFields).Omit(omit).Unwind(unwind).Flatten(flatten).Desc(desc).Attachment(attachment).Delimiter(delimiter).Bom(bom).XmlRoot(xmlRoot).XmlRow(xmlRow).SkipHeaderRow(skipHeaderRow).SkipHidden(skipHidden).SkipEmpty(skipEmpty).Simplified(simplified).View(view).SkipFailedPages(skipFailedPages).FeedTitle(feedTitle).FeedDescription(feedDescription).Execute() + +Run task synchronously and get dataset items + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + actorTaskId := "janedoe~my-task" // string | Task ID or a tilde-separated owner's username and task's name. + body := map[string]interface{}{ ... } // map[string]interface{} | + timeout := float64(60) // float64 | Optional timeout for the run, in seconds. By default, the run uses the timeout from its configuration. (optional) + memory := float64(256) // float64 | Memory limit for the run, in megabytes. The amount of memory can be set to a power of 2 with a minimum of 128. By default, the run uses the memory limit from its configuration. (optional) + maxItems := float64(1000) // float64 | Specifies the maximum number of dataset items that will be charged for pay-per-result Actors. This does NOT guarantee that the Actor will return only this many items. It only ensures you won't be charged for more than this number of items. Only works for pay-per-result Actors. Value can be accessed in the actor run using `ACTOR_MAX_PAID_DATASET_ITEMS` environment variable. (optional) + maxTotalChargeUsd := float64(5) // float64 | Specifies the maximum cost of the run. This parameter is useful for pay-per-event Actors, as it allows you to limit the amount charged to your subscription. You can access the maximum cost in your Actor by using the `ACTOR_MAX_TOTAL_CHARGE_USD` environment variable. (optional) + restartOnError := false // bool | Determines whether the run will be restarted if it fails. (optional) + build := "0.1.234" // string | Specifies the Actor build to run. It can be either a build tag or build number. By default, the run uses the build from its configuration (typically `latest`). (optional) + webhooks := "dGhpcyBpcyBqdXN0IGV4YW1wbGUK..." // string | Specifies optional webhooks associated with the Actor run, which can be used to receive a notification e.g. when the Actor finished or failed. The value is a Base64-encoded JSON array whose items follow the WebhookRepresentation schema. For more information, see [Webhooks documentation](https://docs.apify.com/platform/integrations/webhooks). (optional) + format := "json" // string | Format of the results, possible values are: `json`, `jsonl`, `csv`, `html`, `xlsx`, `xml` and `rss`. The default value is `json`. (optional) + clean := false // bool | If `true` or `1` then the API endpoint returns only non-empty items and skips hidden fields (i.e. fields starting with the # character). The `clean` parameter is just a shortcut for `skipHidden=true` and `skipEmpty=true` parameters. Note that since some objects might be skipped from the output, that the result might contain less items than the `limit` value. (optional) + offset := float64(0) // float64 | Number of items that should be skipped at the start. The default value is `0`. (optional) + limit := float64(1.2) // float64 | Maximum number of items to return. By default there is no limit. (optional) + fields := "myValue,myOtherValue" // string | A comma-separated list of fields which should be picked from the items, only these fields will remain in the resulting record objects. Note that the fields in the outputted items are sorted the same way as they are specified in the `fields` query parameter. You can use this feature to effectively fix the output format. (optional) + outputFields := "title,link" // string | A comma-separated list of output field names that positionally rename the fields specified in the `fields` parameter. For example, `?fields=headline,url&outputFields=title,link` renames `headline` to `title` and `url` to `link` in the output. The number of names in `outputFields` must match the number of names in `fields`. Requires the `fields` parameter to be specified as well. (optional) + omit := "myValue,myOtherValue" // string | A comma-separated list of fields which should be omitted from the items. (optional) + unwind := "myValue,myOtherValue" // string | A comma-separated list of fields which should be unwound, in order which they should be processed. Each field should be either an array or an object. If the field is an array then every element of the array will become a separate record and merged with parent object. If the unwound field is an object then it is merged with the parent object. If the unwound field is missing or its value is neither an array nor an object and therefore cannot be merged with a parent object then the item gets preserved as it is. Note that the unwound items ignore the `desc` parameter. (optional) + flatten := "myValue" // string | A comma-separated list of fields which should transform nested objects into flat structures. For example, with `flatten=\"foo\"` the object `{\"foo\":{\"bar\": \"hello\"}}` is turned into `{\"foo.bar\": \"hello\"}`. The original object with properties is replaced with the flattened object. (optional) + desc := true // bool | By default, results are returned in the same order as they were stored. To reverse the order, set this parameter to `true` or `1`. (optional) + attachment := true // bool | If `true` or `1` then the response will define the `Content-Disposition: attachment` header, forcing a web browser to download the file rather than to display it. By default this header is not present. (optional) + delimiter := ";" // string | A delimiter character for CSV files, only used if `format=csv`. You might need to URL-encode the character (e.g. use `%09` for tab or `%3B` for semicolon). The default delimiter is a simple comma (`,`). (optional) + bom := false // bool | All text responses are encoded in UTF-8 encoding. By default, the `format=csv` files are prefixed with the UTF-8 Byte Order Mark (BOM), while `json`, `jsonl`, `xml`, `html` and `rss` files are not. If you want to override this default behavior, specify `bom=1` query parameter to include the BOM or `bom=0` to skip it. (optional) + xmlRoot := "items" // string | Overrides default root element name of `xml` output. By default the root element is `items`. (optional) + xmlRow := "item" // string | Overrides default element name that wraps each page or page function result object in `xml` output. By default the element name is `item`. (optional) + skipHeaderRow := true // bool | If `true` or `1` then header row in the `csv` format is skipped. (optional) + skipHidden := false // bool | If `true` or `1` then hidden fields are skipped from the output, i.e. fields starting with the `#` character. (optional) + skipEmpty := false // bool | If `true` or `1` then empty items are skipped from the output. Note that if used, the results might contain less items than the limit value. (optional) + simplified := false // bool | If `true` or `1` then, the endpoint applies the `fields=url,pageFunctionResult,errorInfo` and `unwind=pageFunctionResult` query parameters. This feature is used to emulate simplified results provided by the legacy Apify Crawler product and it's not recommended to use it in new integrations. (optional) + view := "overview" // string | Defines the view configuration for dataset items based on the schema definition. This parameter determines how the data will be filtered and presented. For complete specification details, see the [dataset schema documentation](/platform/actors/development/actor-definition/dataset-schema). (optional) + skipFailedPages := false // bool | If `true` or `1` then, the all the items with errorInfo property will be skipped from the output. This feature is here to emulate functionality of API version 1 used for the legacy Apify Crawler product and it's not recommended to use it in new integrations. (optional) + feedTitle := "Latest posts from r/pasta" // string | Overrides the auto-generated RSS channel `<title>` element. Only used when `format=rss`. If not provided, the title defaults to `Dataset <label>`. (optional) + feedDescription := "Scraped forum posts" // string | Overrides the auto-generated RSS channel `<description>` element. Only used when `format=rss`. If not provided, the description defaults to `Items in dataset with id \"<datasetId>\".` (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.ActorTasksAPI.ActorTaskRunSyncGetDatasetItemsPost(context.Background(), actorTaskId).Body(body).Timeout(timeout).Memory(memory).MaxItems(maxItems).MaxTotalChargeUsd(maxTotalChargeUsd).RestartOnError(restartOnError).Build(build).Webhooks(webhooks).Format(format).Clean(clean).Offset(offset).Limit(limit).Fields(fields).OutputFields(outputFields).Omit(omit).Unwind(unwind).Flatten(flatten).Desc(desc).Attachment(attachment).Delimiter(delimiter).Bom(bom).XmlRoot(xmlRoot).XmlRow(xmlRow).SkipHeaderRow(skipHeaderRow).SkipHidden(skipHidden).SkipEmpty(skipEmpty).Simplified(simplified).View(view).SkipFailedPages(skipFailedPages).FeedTitle(feedTitle).FeedDescription(feedDescription).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ActorTasksAPI.ActorTaskRunSyncGetDatasetItemsPost``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ActorTaskRunSyncGetDatasetItemsPost`: map[string]interface{} + fmt.Fprintf(os.Stdout, "Response from `ActorTasksAPI.ActorTaskRunSyncGetDatasetItemsPost`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**actorTaskId** | **string** | Task ID or a tilde-separated owner's username and task's name. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiActorTaskRunSyncGetDatasetItemsPostRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **body** | **map[string]interface{}** | | + **timeout** | **float64** | Optional timeout for the run, in seconds. By default, the run uses the timeout from its configuration. | + **memory** | **float64** | Memory limit for the run, in megabytes. The amount of memory can be set to a power of 2 with a minimum of 128. By default, the run uses the memory limit from its configuration. | + **maxItems** | **float64** | Specifies the maximum number of dataset items that will be charged for pay-per-result Actors. This does NOT guarantee that the Actor will return only this many items. It only ensures you won't be charged for more than this number of items. Only works for pay-per-result Actors. Value can be accessed in the actor run using `ACTOR_MAX_PAID_DATASET_ITEMS` environment variable. | + **maxTotalChargeUsd** | **float64** | Specifies the maximum cost of the run. This parameter is useful for pay-per-event Actors, as it allows you to limit the amount charged to your subscription. You can access the maximum cost in your Actor by using the `ACTOR_MAX_TOTAL_CHARGE_USD` environment variable. | + **restartOnError** | **bool** | Determines whether the run will be restarted if it fails. | + **build** | **string** | Specifies the Actor build to run. It can be either a build tag or build number. By default, the run uses the build from its configuration (typically `latest`). | + **webhooks** | **string** | Specifies optional webhooks associated with the Actor run, which can be used to receive a notification e.g. when the Actor finished or failed. The value is a Base64-encoded JSON array whose items follow the WebhookRepresentation schema. For more information, see [Webhooks documentation](https://docs.apify.com/platform/integrations/webhooks). | + **format** | **string** | Format of the results, possible values are: `json`, `jsonl`, `csv`, `html`, `xlsx`, `xml` and `rss`. The default value is `json`. | + **clean** | **bool** | If `true` or `1` then the API endpoint returns only non-empty items and skips hidden fields (i.e. fields starting with the # character). The `clean` parameter is just a shortcut for `skipHidden=true` and `skipEmpty=true` parameters. Note that since some objects might be skipped from the output, that the result might contain less items than the `limit` value. | + **offset** | **float64** | Number of items that should be skipped at the start. The default value is `0`. | + **limit** | **float64** | Maximum number of items to return. By default there is no limit. | + **fields** | **string** | A comma-separated list of fields which should be picked from the items, only these fields will remain in the resulting record objects. Note that the fields in the outputted items are sorted the same way as they are specified in the `fields` query parameter. You can use this feature to effectively fix the output format. | + **outputFields** | **string** | A comma-separated list of output field names that positionally rename the fields specified in the `fields` parameter. For example, `?fields=headline,url&outputFields=title,link` renames `headline` to `title` and `url` to `link` in the output. The number of names in `outputFields` must match the number of names in `fields`. Requires the `fields` parameter to be specified as well. | + **omit** | **string** | A comma-separated list of fields which should be omitted from the items. | + **unwind** | **string** | A comma-separated list of fields which should be unwound, in order which they should be processed. Each field should be either an array or an object. If the field is an array then every element of the array will become a separate record and merged with parent object. If the unwound field is an object then it is merged with the parent object. If the unwound field is missing or its value is neither an array nor an object and therefore cannot be merged with a parent object then the item gets preserved as it is. Note that the unwound items ignore the `desc` parameter. | + **flatten** | **string** | A comma-separated list of fields which should transform nested objects into flat structures. For example, with `flatten=\"foo\"` the object `{\"foo\":{\"bar\": \"hello\"}}` is turned into `{\"foo.bar\": \"hello\"}`. The original object with properties is replaced with the flattened object. | + **desc** | **bool** | By default, results are returned in the same order as they were stored. To reverse the order, set this parameter to `true` or `1`. | + **attachment** | **bool** | If `true` or `1` then the response will define the `Content-Disposition: attachment` header, forcing a web browser to download the file rather than to display it. By default this header is not present. | + **delimiter** | **string** | A delimiter character for CSV files, only used if `format=csv`. You might need to URL-encode the character (e.g. use `%09` for tab or `%3B` for semicolon). The default delimiter is a simple comma (`,`). | + **bom** | **bool** | All text responses are encoded in UTF-8 encoding. By default, the `format=csv` files are prefixed with the UTF-8 Byte Order Mark (BOM), while `json`, `jsonl`, `xml`, `html` and `rss` files are not. If you want to override this default behavior, specify `bom=1` query parameter to include the BOM or `bom=0` to skip it. | + **xmlRoot** | **string** | Overrides default root element name of `xml` output. By default the root element is `items`. | + **xmlRow** | **string** | Overrides default element name that wraps each page or page function result object in `xml` output. By default the element name is `item`. | + **skipHeaderRow** | **bool** | If `true` or `1` then header row in the `csv` format is skipped. | + **skipHidden** | **bool** | If `true` or `1` then hidden fields are skipped from the output, i.e. fields starting with the `#` character. | + **skipEmpty** | **bool** | If `true` or `1` then empty items are skipped from the output. Note that if used, the results might contain less items than the limit value. | + **simplified** | **bool** | If `true` or `1` then, the endpoint applies the `fields=url,pageFunctionResult,errorInfo` and `unwind=pageFunctionResult` query parameters. This feature is used to emulate simplified results provided by the legacy Apify Crawler product and it's not recommended to use it in new integrations. | + **view** | **string** | Defines the view configuration for dataset items based on the schema definition. This parameter determines how the data will be filtered and presented. For complete specification details, see the [dataset schema documentation](/platform/actors/development/actor-definition/dataset-schema). | + **skipFailedPages** | **bool** | If `true` or `1` then, the all the items with errorInfo property will be skipped from the output. This feature is here to emulate functionality of API version 1 used for the legacy Apify Crawler product and it's not recommended to use it in new integrations. | + **feedTitle** | **string** | Overrides the auto-generated RSS channel `<title>` element. Only used when `format=rss`. If not provided, the title defaults to `Dataset <label>`. | + **feedDescription** | **string** | Overrides the auto-generated RSS channel `<description>` element. Only used when `format=rss`. If not provided, the description defaults to `Items in dataset with id \"<datasetId>\".` | + +### Return type + +**map[string]interface{}** + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## ActorTaskRunSyncPost + +> map[string]interface{} ActorTaskRunSyncPost(ctx, actorTaskId).Body(body).Timeout(timeout).Memory(memory).MaxItems(maxItems).MaxTotalChargeUsd(maxTotalChargeUsd).RestartOnError(restartOnError).Build(build).OutputRecordKey(outputRecordKey).Webhooks(webhooks).Execute() + +Run task synchronously + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + actorTaskId := "janedoe~my-task" // string | Task ID or a tilde-separated owner's username and task's name. + body := map[string]interface{}{ ... } // map[string]interface{} | + timeout := float64(60) // float64 | Optional timeout for the run, in seconds. By default, the run uses the timeout from its configuration. (optional) + memory := float64(256) // float64 | Memory limit for the run, in megabytes. The amount of memory can be set to a power of 2 with a minimum of 128. By default, the run uses the memory limit from its configuration. (optional) + maxItems := float64(1000) // float64 | Specifies the maximum number of dataset items that will be charged for pay-per-result Actors. This does NOT guarantee that the Actor will return only this many items. It only ensures you won't be charged for more than this number of items. Only works for pay-per-result Actors. Value can be accessed in the actor run using `ACTOR_MAX_PAID_DATASET_ITEMS` environment variable. (optional) + maxTotalChargeUsd := float64(5) // float64 | Specifies the maximum cost of the run. This parameter is useful for pay-per-event Actors, as it allows you to limit the amount charged to your subscription. You can access the maximum cost in your Actor by using the `ACTOR_MAX_TOTAL_CHARGE_USD` environment variable. (optional) + restartOnError := false // bool | Determines whether the run will be restarted if it fails. (optional) + build := "0.1.234" // string | Specifies the Actor build to run. It can be either a build tag or build number. By default, the run uses the build from its configuration (typically `latest`). (optional) + outputRecordKey := "OUTPUT" // string | Key of the record from run's default key-value store to be returned in the response. By default, it is `OUTPUT`. (optional) + webhooks := "dGhpcyBpcyBqdXN0IGV4YW1wbGUK..." // string | Specifies optional webhooks associated with the Actor run, which can be used to receive a notification e.g. when the Actor finished or failed. The value is a Base64-encoded JSON array whose items follow the WebhookRepresentation schema. For more information, see [Webhooks documentation](https://docs.apify.com/platform/integrations/webhooks). (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.ActorTasksAPI.ActorTaskRunSyncPost(context.Background(), actorTaskId).Body(body).Timeout(timeout).Memory(memory).MaxItems(maxItems).MaxTotalChargeUsd(maxTotalChargeUsd).RestartOnError(restartOnError).Build(build).OutputRecordKey(outputRecordKey).Webhooks(webhooks).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ActorTasksAPI.ActorTaskRunSyncPost``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ActorTaskRunSyncPost`: map[string]interface{} + fmt.Fprintf(os.Stdout, "Response from `ActorTasksAPI.ActorTaskRunSyncPost`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**actorTaskId** | **string** | Task ID or a tilde-separated owner's username and task's name. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiActorTaskRunSyncPostRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **body** | **map[string]interface{}** | | + **timeout** | **float64** | Optional timeout for the run, in seconds. By default, the run uses the timeout from its configuration. | + **memory** | **float64** | Memory limit for the run, in megabytes. The amount of memory can be set to a power of 2 with a minimum of 128. By default, the run uses the memory limit from its configuration. | + **maxItems** | **float64** | Specifies the maximum number of dataset items that will be charged for pay-per-result Actors. This does NOT guarantee that the Actor will return only this many items. It only ensures you won't be charged for more than this number of items. Only works for pay-per-result Actors. Value can be accessed in the actor run using `ACTOR_MAX_PAID_DATASET_ITEMS` environment variable. | + **maxTotalChargeUsd** | **float64** | Specifies the maximum cost of the run. This parameter is useful for pay-per-event Actors, as it allows you to limit the amount charged to your subscription. You can access the maximum cost in your Actor by using the `ACTOR_MAX_TOTAL_CHARGE_USD` environment variable. | + **restartOnError** | **bool** | Determines whether the run will be restarted if it fails. | + **build** | **string** | Specifies the Actor build to run. It can be either a build tag or build number. By default, the run uses the build from its configuration (typically `latest`). | + **outputRecordKey** | **string** | Key of the record from run's default key-value store to be returned in the response. By default, it is `OUTPUT`. | + **webhooks** | **string** | Specifies optional webhooks associated with the Actor run, which can be used to receive a notification e.g. when the Actor finished or failed. The value is a Base64-encoded JSON array whose items follow the WebhookRepresentation schema. For more information, see [Webhooks documentation](https://docs.apify.com/platform/integrations/webhooks). | + +### Return type + +**map[string]interface{}** + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## ActorTaskRunsGet + +> ActorTaskRunsGet200Response ActorTaskRunsGet(ctx, actorTaskId).Offset(offset).Limit(limit).Desc(desc).Status(status).Execute() + +Get list of task runs + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + actorTaskId := "janedoe~my-task" // string | Task ID or a tilde-separated owner's username and task's name. + offset := float64(0) // float64 | Number of items that should be skipped at the start. The default value is `0`. (optional) + limit := float64(1000) // float64 | Maximum number of items to return. The default value as well as the maximum is `1000`. (optional) + desc := true // bool | If `true` or `1` then the objects are sorted by the `startedAt` field in descending order. By default, they are sorted in ascending order. (optional) + status := []string{"Inner_example"} // []string | Single status or comma-separated list of statuses, see ([available statuses](https://docs.apify.com/platform/actors/running/runs-and-builds#lifecycle)). Used to filter runs by the specified statuses only. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.ActorTasksAPI.ActorTaskRunsGet(context.Background(), actorTaskId).Offset(offset).Limit(limit).Desc(desc).Status(status).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ActorTasksAPI.ActorTaskRunsGet``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ActorTaskRunsGet`: ActorTaskRunsGet200Response + fmt.Fprintf(os.Stdout, "Response from `ActorTasksAPI.ActorTaskRunsGet`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**actorTaskId** | **string** | Task ID or a tilde-separated owner's username and task's name. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiActorTaskRunsGetRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **offset** | **float64** | Number of items that should be skipped at the start. The default value is `0`. | + **limit** | **float64** | Maximum number of items to return. The default value as well as the maximum is `1000`. | + **desc** | **bool** | If `true` or `1` then the objects are sorted by the `startedAt` field in descending order. By default, they are sorted in ascending order. | + **status** | **[]string** | Single status or comma-separated list of statuses, see ([available statuses](https://docs.apify.com/platform/actors/running/runs-and-builds#lifecycle)). Used to filter runs by the specified statuses only. | + +### Return type + +[**ActorTaskRunsGet200Response**](ActorTaskRunsGet200Response.md) + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## ActorTaskRunsLastGet + +> ActorTaskRunsPost201Response ActorTaskRunsLastGet(ctx, actorTaskId).Status(status).WaitForFinish(waitForFinish).Execute() + +Get last run + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + actorTaskId := "janedoe~my-task" // string | Task ID or a tilde-separated owner's username and task's name. + status := "SUCCEEDED" // string | Filter for the run status. (optional) + waitForFinish := float64(60) // float64 | The maximum number of seconds the server waits for the run to finish. By default it is `0`, the maximum value is `60`. <!-- MAX_ACTOR_JOB_ASYNC_WAIT_SECS --> If the run finishes in time then the returned run object will have a terminal status (e.g. `SUCCEEDED`), otherwise it will have a transitional status (e.g. `RUNNING`). (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.ActorTasksAPI.ActorTaskRunsLastGet(context.Background(), actorTaskId).Status(status).WaitForFinish(waitForFinish).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ActorTasksAPI.ActorTaskRunsLastGet``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ActorTaskRunsLastGet`: ActorTaskRunsPost201Response + fmt.Fprintf(os.Stdout, "Response from `ActorTasksAPI.ActorTaskRunsLastGet`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**actorTaskId** | **string** | Task ID or a tilde-separated owner's username and task's name. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiActorTaskRunsLastGetRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **status** | **string** | Filter for the run status. | + **waitForFinish** | **float64** | The maximum number of seconds the server waits for the run to finish. By default it is `0`, the maximum value is `60`. <!-- MAX_ACTOR_JOB_ASYNC_WAIT_SECS --> If the run finishes in time then the returned run object will have a terminal status (e.g. `SUCCEEDED`), otherwise it will have a transitional status (e.g. `RUNNING`). | + +### Return type + +[**ActorTaskRunsPost201Response**](ActorTaskRunsPost201Response.md) + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## ActorTaskRunsPost + +> ActorTaskRunsPost201Response ActorTaskRunsPost(ctx, actorTaskId).Body(body).Timeout(timeout).Memory(memory).MaxItems(maxItems).MaxTotalChargeUsd(maxTotalChargeUsd).RestartOnError(restartOnError).Build(build).WaitForFinish(waitForFinish).Webhooks(webhooks).Execute() + +Run task + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + actorTaskId := "janedoe~my-task" // string | Task ID or a tilde-separated owner's username and task's name. + body := map[string]interface{}{ ... } // map[string]interface{} | + timeout := float64(60) // float64 | Optional timeout for the run, in seconds. By default, the run uses the timeout from its configuration. (optional) + memory := float64(256) // float64 | Memory limit for the run, in megabytes. The amount of memory can be set to a power of 2 with a minimum of 128. By default, the run uses the memory limit from its configuration. (optional) + maxItems := float64(1000) // float64 | Specifies the maximum number of dataset items that will be charged for pay-per-result Actors. This does NOT guarantee that the Actor will return only this many items. It only ensures you won't be charged for more than this number of items. Only works for pay-per-result Actors. Value can be accessed in the actor run using `ACTOR_MAX_PAID_DATASET_ITEMS` environment variable. (optional) + maxTotalChargeUsd := float64(5) // float64 | Specifies the maximum cost of the run. This parameter is useful for pay-per-event Actors, as it allows you to limit the amount charged to your subscription. You can access the maximum cost in your Actor by using the `ACTOR_MAX_TOTAL_CHARGE_USD` environment variable. (optional) + restartOnError := false // bool | Determines whether the run will be restarted if it fails. (optional) + build := "0.1.234" // string | Specifies the Actor build to run. It can be either a build tag or build number. By default, the run uses the build from its configuration (typically `latest`). (optional) + waitForFinish := float64(60) // float64 | The maximum number of seconds the server waits for the run to finish. By default it is `0`, the maximum value is `60`. <!-- MAX_ACTOR_JOB_ASYNC_WAIT_SECS --> If the run finishes in time then the returned run object will have a terminal status (e.g. `SUCCEEDED`), otherwise it will have a transitional status (e.g. `RUNNING`). (optional) + webhooks := "dGhpcyBpcyBqdXN0IGV4YW1wbGUK..." // string | Specifies optional webhooks associated with the Actor run, which can be used to receive a notification e.g. when the Actor finished or failed. The value is a Base64-encoded JSON array whose items follow the WebhookRepresentation schema. For more information, see [Webhooks documentation](https://docs.apify.com/platform/integrations/webhooks). (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.ActorTasksAPI.ActorTaskRunsPost(context.Background(), actorTaskId).Body(body).Timeout(timeout).Memory(memory).MaxItems(maxItems).MaxTotalChargeUsd(maxTotalChargeUsd).RestartOnError(restartOnError).Build(build).WaitForFinish(waitForFinish).Webhooks(webhooks).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ActorTasksAPI.ActorTaskRunsPost``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ActorTaskRunsPost`: ActorTaskRunsPost201Response + fmt.Fprintf(os.Stdout, "Response from `ActorTasksAPI.ActorTaskRunsPost`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**actorTaskId** | **string** | Task ID or a tilde-separated owner's username and task's name. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiActorTaskRunsPostRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **body** | **map[string]interface{}** | | + **timeout** | **float64** | Optional timeout for the run, in seconds. By default, the run uses the timeout from its configuration. | + **memory** | **float64** | Memory limit for the run, in megabytes. The amount of memory can be set to a power of 2 with a minimum of 128. By default, the run uses the memory limit from its configuration. | + **maxItems** | **float64** | Specifies the maximum number of dataset items that will be charged for pay-per-result Actors. This does NOT guarantee that the Actor will return only this many items. It only ensures you won't be charged for more than this number of items. Only works for pay-per-result Actors. Value can be accessed in the actor run using `ACTOR_MAX_PAID_DATASET_ITEMS` environment variable. | + **maxTotalChargeUsd** | **float64** | Specifies the maximum cost of the run. This parameter is useful for pay-per-event Actors, as it allows you to limit the amount charged to your subscription. You can access the maximum cost in your Actor by using the `ACTOR_MAX_TOTAL_CHARGE_USD` environment variable. | + **restartOnError** | **bool** | Determines whether the run will be restarted if it fails. | + **build** | **string** | Specifies the Actor build to run. It can be either a build tag or build number. By default, the run uses the build from its configuration (typically `latest`). | + **waitForFinish** | **float64** | The maximum number of seconds the server waits for the run to finish. By default it is `0`, the maximum value is `60`. <!-- MAX_ACTOR_JOB_ASYNC_WAIT_SECS --> If the run finishes in time then the returned run object will have a terminal status (e.g. `SUCCEEDED`), otherwise it will have a transitional status (e.g. `RUNNING`). | + **webhooks** | **string** | Specifies optional webhooks associated with the Actor run, which can be used to receive a notification e.g. when the Actor finished or failed. The value is a Base64-encoded JSON array whose items follow the WebhookRepresentation schema. For more information, see [Webhooks documentation](https://docs.apify.com/platform/integrations/webhooks). | + +### Return type + +[**ActorTaskRunsPost201Response**](ActorTaskRunsPost201Response.md) + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## ActorTaskWebhooksGet + +> ActorTaskWebhooksGet200Response ActorTaskWebhooksGet(ctx, actorTaskId).Offset(offset).Limit(limit).Desc(desc).Execute() + +Get list of webhooks + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + actorTaskId := "janedoe~my-task" // string | Task ID or a tilde-separated owner's username and task's name. + offset := float64(0) // float64 | Number of items that should be skipped at the start. The default value is `0`. (optional) + limit := float64(1000) // float64 | Maximum number of items to return. The default value as well as the maximum is `1000`. (optional) + desc := true // bool | If `true` or `1` then the objects are sorted by the `createdAt` field in descending order. By default, they are sorted in ascending order. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.ActorTasksAPI.ActorTaskWebhooksGet(context.Background(), actorTaskId).Offset(offset).Limit(limit).Desc(desc).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ActorTasksAPI.ActorTaskWebhooksGet``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ActorTaskWebhooksGet`: ActorTaskWebhooksGet200Response + fmt.Fprintf(os.Stdout, "Response from `ActorTasksAPI.ActorTaskWebhooksGet`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**actorTaskId** | **string** | Task ID or a tilde-separated owner's username and task's name. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiActorTaskWebhooksGetRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **offset** | **float64** | Number of items that should be skipped at the start. The default value is `0`. | + **limit** | **float64** | Maximum number of items to return. The default value as well as the maximum is `1000`. | + **desc** | **bool** | If `true` or `1` then the objects are sorted by the `createdAt` field in descending order. By default, they are sorted in ascending order. | + +### Return type + +[**ActorTaskWebhooksGet200Response**](ActorTaskWebhooksGet200Response.md) + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## ActorTasksGet + +> ListOfTasksResponse ActorTasksGet(ctx).Offset(offset).Limit(limit).Desc(desc).Execute() + +Get list of tasks + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + offset := float64(0) // float64 | Number of items that should be skipped at the start. The default value is `0`. (optional) + limit := float64(1000) // float64 | Maximum number of items to return. The default value as well as the maximum is `1000`. (optional) + desc := true // bool | If `true` or `1` then the objects are sorted by the `createdAt` field in descending order. By default, they are sorted in ascending order. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.ActorTasksAPI.ActorTasksGet(context.Background()).Offset(offset).Limit(limit).Desc(desc).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ActorTasksAPI.ActorTasksGet``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ActorTasksGet`: ListOfTasksResponse + fmt.Fprintf(os.Stdout, "Response from `ActorTasksAPI.ActorTasksGet`: %v\n", resp) +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiActorTasksGetRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **offset** | **float64** | Number of items that should be skipped at the start. The default value is `0`. | + **limit** | **float64** | Maximum number of items to return. The default value as well as the maximum is `1000`. | + **desc** | **bool** | If `true` or `1` then the objects are sorted by the `createdAt` field in descending order. By default, they are sorted in ascending order. | + +### Return type + +[**ListOfTasksResponse**](ListOfTasksResponse.md) + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## ActorTasksPost + +> TaskResponse ActorTasksPost(ctx).CreateTaskRequest(createTaskRequest).Execute() + +Create task + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + createTaskRequest := *openapiclient.NewCreateTaskRequest("ActId_example") // CreateTaskRequest | + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.ActorTasksAPI.ActorTasksPost(context.Background()).CreateTaskRequest(createTaskRequest).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ActorTasksAPI.ActorTasksPost``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ActorTasksPost`: TaskResponse + fmt.Fprintf(os.Stdout, "Response from `ActorTasksAPI.ActorTasksPost`: %v\n", resp) +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiActorTasksPostRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **createTaskRequest** | [**CreateTaskRequest**](CreateTaskRequest.md) | | + +### Return type + +[**TaskResponse**](TaskResponse.md) + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/docs/ActorsAPI.md b/docs/ActorsAPI.md new file mode 100644 index 0000000..cf8646a --- /dev/null +++ b/docs/ActorsAPI.md @@ -0,0 +1,440 @@ +# \ActorsAPI + +All URIs are relative to *https://api.apify.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**ActDelete**](ActorsAPI.md#ActDelete) | **Delete** /v2/actors/{actorId} | Delete Actor +[**ActGet**](ActorsAPI.md#ActGet) | **Get** /v2/actors/{actorId} | Get Actor +[**ActPut**](ActorsAPI.md#ActPut) | **Put** /v2/actors/{actorId} | Update Actor +[**ActValidateInputPost**](ActorsAPI.md#ActValidateInputPost) | **Post** /v2/actors/{actorId}/validate-input | Validate Actor input +[**ActsGet**](ActorsAPI.md#ActsGet) | **Get** /v2/actors | Get list of Actors +[**ActsPost**](ActorsAPI.md#ActsPost) | **Post** /v2/actors | Create Actor + + + +## ActDelete + +> map[string]interface{} ActDelete(ctx, actorId).Execute() + +Delete Actor + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + actorId := "janedoe~my-actor" // string | Actor ID or a tilde-separated owner's username and Actor name. + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.ActorsAPI.ActDelete(context.Background(), actorId).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ActorsAPI.ActDelete``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ActDelete`: map[string]interface{} + fmt.Fprintf(os.Stdout, "Response from `ActorsAPI.ActDelete`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**actorId** | **string** | Actor ID or a tilde-separated owner's username and Actor name. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiActDeleteRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + +### Return type + +**map[string]interface{}** + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## ActGet + +> ActorResponse ActGet(ctx, actorId).Execute() + +Get Actor + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + actorId := "janedoe~my-actor" // string | Actor ID or a tilde-separated owner's username and Actor name. + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.ActorsAPI.ActGet(context.Background(), actorId).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ActorsAPI.ActGet``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ActGet`: ActorResponse + fmt.Fprintf(os.Stdout, "Response from `ActorsAPI.ActGet`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**actorId** | **string** | Actor ID or a tilde-separated owner's username and Actor name. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiActGetRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + +### Return type + +[**ActorResponse**](ActorResponse.md) + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## ActPut + +> ActorResponse ActPut(ctx, actorId).UpdateActorRequest(updateActorRequest).Execute() + +Update Actor + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + actorId := "janedoe~my-actor" // string | Actor ID or a tilde-separated owner's username and Actor name. + updateActorRequest := *openapiclient.NewUpdateActorRequest() // UpdateActorRequest | + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.ActorsAPI.ActPut(context.Background(), actorId).UpdateActorRequest(updateActorRequest).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ActorsAPI.ActPut``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ActPut`: ActorResponse + fmt.Fprintf(os.Stdout, "Response from `ActorsAPI.ActPut`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**actorId** | **string** | Actor ID or a tilde-separated owner's username and Actor name. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiActPutRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **updateActorRequest** | [**UpdateActorRequest**](UpdateActorRequest.md) | | + +### Return type + +[**ActorResponse**](ActorResponse.md) + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## ActValidateInputPost + +> ActValidateInputPost200Response ActValidateInputPost(ctx, actorId).Body(body).Build(build).Execute() + +Validate Actor input + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + actorId := "janedoe~my-actor" // string | Actor ID or a tilde-separated owner's username and Actor name. + body := map[string]interface{}{ ... } // map[string]interface{} | JSON input to validate against the Actor's input schema. + build := "latest" // string | Optional tag or number of the Actor build to use for input schema validation. By default, the `latest` build tag is used. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.ActorsAPI.ActValidateInputPost(context.Background(), actorId).Body(body).Build(build).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ActorsAPI.ActValidateInputPost``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ActValidateInputPost`: ActValidateInputPost200Response + fmt.Fprintf(os.Stdout, "Response from `ActorsAPI.ActValidateInputPost`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**actorId** | **string** | Actor ID or a tilde-separated owner's username and Actor name. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiActValidateInputPostRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **body** | **map[string]interface{}** | JSON input to validate against the Actor's input schema. | + **build** | **string** | Optional tag or number of the Actor build to use for input schema validation. By default, the `latest` build tag is used. | + +### Return type + +[**ActValidateInputPost200Response**](ActValidateInputPost200Response.md) + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## ActsGet + +> ListOfActorsResponse ActsGet(ctx).My(my).Offset(offset).Limit(limit).Desc(desc).SortBy(sortBy).Execute() + +Get list of Actors + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + my := true // bool | If `true` or `1` then the returned list only contains Actors owned by the user. The default value is `false`. (optional) + offset := float64(0) // float64 | Number of items that should be skipped at the start. The default value is `0`. (optional) + limit := float64(1000) // float64 | Maximum number of items to return. The default value as well as the maximum is `1000`. (optional) + desc := true // bool | If `true` or `1` then the objects are sorted by the `createdAt` field in descending order. By default, they are sorted in ascending order. (optional) + sortBy := "createdAt" // string | Field to sort the records by. The default is `createdAt`. You can also use `stats.lastRunStartedAt` to sort by the most recently ran Actors. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.ActorsAPI.ActsGet(context.Background()).My(my).Offset(offset).Limit(limit).Desc(desc).SortBy(sortBy).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ActorsAPI.ActsGet``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ActsGet`: ListOfActorsResponse + fmt.Fprintf(os.Stdout, "Response from `ActorsAPI.ActsGet`: %v\n", resp) +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiActsGetRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **my** | **bool** | If `true` or `1` then the returned list only contains Actors owned by the user. The default value is `false`. | + **offset** | **float64** | Number of items that should be skipped at the start. The default value is `0`. | + **limit** | **float64** | Maximum number of items to return. The default value as well as the maximum is `1000`. | + **desc** | **bool** | If `true` or `1` then the objects are sorted by the `createdAt` field in descending order. By default, they are sorted in ascending order. | + **sortBy** | **string** | Field to sort the records by. The default is `createdAt`. You can also use `stats.lastRunStartedAt` to sort by the most recently ran Actors. | + +### Return type + +[**ListOfActorsResponse**](ListOfActorsResponse.md) + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## ActsPost + +> ActorResponse ActsPost(ctx).CreateActorRequest(createActorRequest).Execute() + +Create Actor + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + createActorRequest := *openapiclient.NewCreateActorRequest() // CreateActorRequest | + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.ActorsAPI.ActsPost(context.Background()).CreateActorRequest(createActorRequest).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ActorsAPI.ActsPost``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ActsPost`: ActorResponse + fmt.Fprintf(os.Stdout, "Response from `ActorsAPI.ActsPost`: %v\n", resp) +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiActsPostRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **createActorRequest** | [**CreateActorRequest**](CreateActorRequest.md) | | + +### Return type + +[**ActorResponse**](ActorResponse.md) + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/docs/ActorsActorBuildsAPI.md b/docs/ActorsActorBuildsAPI.md new file mode 100644 index 0000000..600b41b --- /dev/null +++ b/docs/ActorsActorBuildsAPI.md @@ -0,0 +1,463 @@ +# \ActorsActorBuildsAPI + +All URIs are relative to *https://api.apify.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**ActBuildAbortPost**](ActorsActorBuildsAPI.md#ActBuildAbortPost) | **Post** /v2/actors/{actorId}/builds/{buildId}/abort | Abort build +[**ActBuildDefaultGet**](ActorsActorBuildsAPI.md#ActBuildDefaultGet) | **Get** /v2/actors/{actorId}/builds/default | Get default build +[**ActBuildGet**](ActorsActorBuildsAPI.md#ActBuildGet) | **Get** /v2/actors/{actorId}/builds/{buildId} | Get build +[**ActBuildsGet**](ActorsActorBuildsAPI.md#ActBuildsGet) | **Get** /v2/actors/{actorId}/builds | Get list of builds +[**ActBuildsPost**](ActorsActorBuildsAPI.md#ActBuildsPost) | **Post** /v2/actors/{actorId}/builds | Build Actor +[**ActOpenapiJsonGet**](ActorsActorBuildsAPI.md#ActOpenapiJsonGet) | **Get** /v2/actors/{actorId}/builds/{buildId}/openapi.json | Get OpenAPI definition + + + +## ActBuildAbortPost + +> BuildResponse ActBuildAbortPost(ctx, actorId, buildId).Execute() + +Abort build + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + actorId := "janedoe~my-actor" // string | Actor ID or a tilde-separated owner's username and Actor name. + buildId := "soSkq9ekdmfOslopH" // string | ID of the build, found in the build's Info tab. + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.ActorsActorBuildsAPI.ActBuildAbortPost(context.Background(), actorId, buildId).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ActorsActorBuildsAPI.ActBuildAbortPost``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ActBuildAbortPost`: BuildResponse + fmt.Fprintf(os.Stdout, "Response from `ActorsActorBuildsAPI.ActBuildAbortPost`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**actorId** | **string** | Actor ID or a tilde-separated owner's username and Actor name. | +**buildId** | **string** | ID of the build, found in the build's Info tab. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiActBuildAbortPostRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + +### Return type + +[**BuildResponse**](BuildResponse.md) + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## ActBuildDefaultGet + +> BuildResponse ActBuildDefaultGet(ctx, actorId).WaitForFinish(waitForFinish).Execute() + +Get default build + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + actorId := "janedoe~my-actor" // string | Actor ID or a tilde-separated owner's username and Actor name. + waitForFinish := float64(60) // float64 | The maximum number of seconds the server waits for the build to finish. By default it is `0`, the maximum value is `60`. <!-- MAX_ACTOR_JOB_ASYNC_WAIT_SECS --> If the build finishes in time then the returned build object will have a terminal status (e.g. `SUCCEEDED`), otherwise it will have a transitional status (e.g. `RUNNING`). (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.ActorsActorBuildsAPI.ActBuildDefaultGet(context.Background(), actorId).WaitForFinish(waitForFinish).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ActorsActorBuildsAPI.ActBuildDefaultGet``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ActBuildDefaultGet`: BuildResponse + fmt.Fprintf(os.Stdout, "Response from `ActorsActorBuildsAPI.ActBuildDefaultGet`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**actorId** | **string** | Actor ID or a tilde-separated owner's username and Actor name. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiActBuildDefaultGetRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **waitForFinish** | **float64** | The maximum number of seconds the server waits for the build to finish. By default it is `0`, the maximum value is `60`. <!-- MAX_ACTOR_JOB_ASYNC_WAIT_SECS --> If the build finishes in time then the returned build object will have a terminal status (e.g. `SUCCEEDED`), otherwise it will have a transitional status (e.g. `RUNNING`). | + +### Return type + +[**BuildResponse**](BuildResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## ActBuildGet + +> BuildResponse ActBuildGet(ctx, actorId, buildId).WaitForFinish(waitForFinish).Execute() + +Get build + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + actorId := "janedoe~my-actor" // string | Actor ID or a tilde-separated owner's username and Actor name. + buildId := "soSkq9ekdmfOslopH" // string | ID of the build, found in the build's Info tab. + waitForFinish := float64(60) // float64 | The maximum number of seconds the server waits for the build to finish. By default it is `0`, the maximum value is `60`. <!-- MAX_ACTOR_JOB_ASYNC_WAIT_SECS --> If the build finishes in time then the returned build object will have a terminal status (e.g. `SUCCEEDED`), otherwise it will have a transitional status (e.g. `RUNNING`). (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.ActorsActorBuildsAPI.ActBuildGet(context.Background(), actorId, buildId).WaitForFinish(waitForFinish).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ActorsActorBuildsAPI.ActBuildGet``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ActBuildGet`: BuildResponse + fmt.Fprintf(os.Stdout, "Response from `ActorsActorBuildsAPI.ActBuildGet`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**actorId** | **string** | Actor ID or a tilde-separated owner's username and Actor name. | +**buildId** | **string** | ID of the build, found in the build's Info tab. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiActBuildGetRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + **waitForFinish** | **float64** | The maximum number of seconds the server waits for the build to finish. By default it is `0`, the maximum value is `60`. <!-- MAX_ACTOR_JOB_ASYNC_WAIT_SECS --> If the build finishes in time then the returned build object will have a terminal status (e.g. `SUCCEEDED`), otherwise it will have a transitional status (e.g. `RUNNING`). | + +### Return type + +[**BuildResponse**](BuildResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## ActBuildsGet + +> ListOfBuildsResponse ActBuildsGet(ctx, actorId).Offset(offset).Limit(limit).Desc(desc).Execute() + +Get list of builds + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + actorId := "janedoe~my-actor" // string | Actor ID or a tilde-separated owner's username and Actor name. + offset := float64(0) // float64 | Number of items that should be skipped at the start. The default value is `0`. (optional) + limit := float64(1000) // float64 | Maximum number of items to return. The default value as well as the maximum is `1000`. (optional) + desc := true // bool | If `true` or `1` then the objects are sorted by the `startedAt` field in descending order. By default, they are sorted in ascending order. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.ActorsActorBuildsAPI.ActBuildsGet(context.Background(), actorId).Offset(offset).Limit(limit).Desc(desc).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ActorsActorBuildsAPI.ActBuildsGet``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ActBuildsGet`: ListOfBuildsResponse + fmt.Fprintf(os.Stdout, "Response from `ActorsActorBuildsAPI.ActBuildsGet`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**actorId** | **string** | Actor ID or a tilde-separated owner's username and Actor name. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiActBuildsGetRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **offset** | **float64** | Number of items that should be skipped at the start. The default value is `0`. | + **limit** | **float64** | Maximum number of items to return. The default value as well as the maximum is `1000`. | + **desc** | **bool** | If `true` or `1` then the objects are sorted by the `startedAt` field in descending order. By default, they are sorted in ascending order. | + +### Return type + +[**ListOfBuildsResponse**](ListOfBuildsResponse.md) + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## ActBuildsPost + +> BuildResponse ActBuildsPost(ctx, actorId).Version(version).UseCache(useCache).BetaPackages(betaPackages).Tag(tag).WaitForFinish(waitForFinish).Execute() + +Build Actor + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + actorId := "janedoe~my-actor" // string | Actor ID or a tilde-separated owner's username and Actor name. + version := "0.0" // string | Actor version number to be built. + useCache := true // bool | If `true` or `1`, the system will use a cache to speed up the build process. By default, cache is not used. (optional) + betaPackages := true // bool | If `true` or `1` then the Actor is built with beta versions of Apify NPM packages. By default, the build uses `latest` packages. (optional) + tag := "latest" // string | Tag to be applied to the build on success. By default, the tag is taken from Actor version's `buildTag` property. (optional) + waitForFinish := float64(60) // float64 | The maximum number of seconds the server waits for the build to finish. By default it is `0`, the maximum value is `60`. <!-- MAX_ACTOR_JOB_ASYNC_WAIT_SECS --> If the build finishes in time then the returned build object will have a terminal status (e.g. `SUCCEEDED`), otherwise it will have a transitional status (e.g. `RUNNING`). (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.ActorsActorBuildsAPI.ActBuildsPost(context.Background(), actorId).Version(version).UseCache(useCache).BetaPackages(betaPackages).Tag(tag).WaitForFinish(waitForFinish).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ActorsActorBuildsAPI.ActBuildsPost``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ActBuildsPost`: BuildResponse + fmt.Fprintf(os.Stdout, "Response from `ActorsActorBuildsAPI.ActBuildsPost`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**actorId** | **string** | Actor ID or a tilde-separated owner's username and Actor name. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiActBuildsPostRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **version** | **string** | Actor version number to be built. | + **useCache** | **bool** | If `true` or `1`, the system will use a cache to speed up the build process. By default, cache is not used. | + **betaPackages** | **bool** | If `true` or `1` then the Actor is built with beta versions of Apify NPM packages. By default, the build uses `latest` packages. | + **tag** | **string** | Tag to be applied to the build on success. By default, the tag is taken from Actor version's `buildTag` property. | + **waitForFinish** | **float64** | The maximum number of seconds the server waits for the build to finish. By default it is `0`, the maximum value is `60`. <!-- MAX_ACTOR_JOB_ASYNC_WAIT_SECS --> If the build finishes in time then the returned build object will have a terminal status (e.g. `SUCCEEDED`), otherwise it will have a transitional status (e.g. `RUNNING`). | + +### Return type + +[**BuildResponse**](BuildResponse.md) + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## ActOpenapiJsonGet + +> map[string]interface{} ActOpenapiJsonGet(ctx, actorId, buildId).Execute() + +Get OpenAPI definition + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + actorId := "janedoe~my-actor" // string | Actor ID or a tilde-separated owner's username and Actor name. + buildId := "soSkq9ekdmfOslopH" // string | ID of the build, found in the build's Info tab. Use the special value `default` to get the OpenAPI schema for the Actor's default build. + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.ActorsActorBuildsAPI.ActOpenapiJsonGet(context.Background(), actorId, buildId).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ActorsActorBuildsAPI.ActOpenapiJsonGet``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ActOpenapiJsonGet`: map[string]interface{} + fmt.Fprintf(os.Stdout, "Response from `ActorsActorBuildsAPI.ActOpenapiJsonGet`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**actorId** | **string** | Actor ID or a tilde-separated owner's username and Actor name. | +**buildId** | **string** | ID of the build, found in the build's Info tab. Use the special value `default` to get the OpenAPI schema for the Actor's default build. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiActOpenapiJsonGetRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + +### Return type + +**map[string]interface{}** + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/docs/ActorsActorRunsAPI.md b/docs/ActorsActorRunsAPI.md new file mode 100644 index 0000000..67a3fad --- /dev/null +++ b/docs/ActorsActorRunsAPI.md @@ -0,0 +1,1010 @@ +# \ActorsActorRunsAPI + +All URIs are relative to *https://api.apify.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**ActRunAbortPost**](ActorsActorRunsAPI.md#ActRunAbortPost) | **Post** /v2/actors/{actorId}/runs/{runId}/abort | Abort run +[**ActRunGet**](ActorsActorRunsAPI.md#ActRunGet) | **Get** /v2/actors/{actorId}/runs/{runId} | Get run +[**ActRunMetamorphPost**](ActorsActorRunsAPI.md#ActRunMetamorphPost) | **Post** /v2/actors/{actorId}/runs/{runId}/metamorph | Metamorph run +[**ActRunResurrectPost**](ActorsActorRunsAPI.md#ActRunResurrectPost) | **Post** /v2/actors/{actorId}/runs/{runId}/resurrect | Resurrect run +[**ActRunSyncGet**](ActorsActorRunsAPI.md#ActRunSyncGet) | **Get** /v2/actors/{actorId}/run-sync | Run Actor synchronously without input +[**ActRunSyncGetDatasetItemsGet**](ActorsActorRunsAPI.md#ActRunSyncGetDatasetItemsGet) | **Get** /v2/actors/{actorId}/run-sync-get-dataset-items | Run Actor synchronously without input and get dataset items +[**ActRunSyncGetDatasetItemsPost**](ActorsActorRunsAPI.md#ActRunSyncGetDatasetItemsPost) | **Post** /v2/actors/{actorId}/run-sync-get-dataset-items | Run Actor synchronously and get dataset items +[**ActRunSyncPost**](ActorsActorRunsAPI.md#ActRunSyncPost) | **Post** /v2/actors/{actorId}/run-sync | Run Actor synchronously and return output +[**ActRunsGet**](ActorsActorRunsAPI.md#ActRunsGet) | **Get** /v2/actors/{actorId}/runs | Get list of runs +[**ActRunsLastGet**](ActorsActorRunsAPI.md#ActRunsLastGet) | **Get** /v2/actors/{actorId}/runs/last | Get last run +[**ActRunsPost**](ActorsActorRunsAPI.md#ActRunsPost) | **Post** /v2/actors/{actorId}/runs | Run Actor + + + +## ActRunAbortPost + +> RunResponse ActRunAbortPost(ctx, actorId, runId).Gracefully(gracefully).Execute() + +Abort run + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + actorId := "janedoe~my-actor" // string | Actor ID or a tilde-separated owner's username and Actor name. + runId := "3KH8gEpp4d8uQSe8T" // string | Actor run ID. + gracefully := true // bool | If true passed, the Actor run will abort gracefully. It will send `aborting` and `persistState` event into run and force-stop the run after 30 seconds. It is helpful in cases where you plan to resurrect the run later. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.ActorsActorRunsAPI.ActRunAbortPost(context.Background(), actorId, runId).Gracefully(gracefully).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ActorsActorRunsAPI.ActRunAbortPost``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ActRunAbortPost`: RunResponse + fmt.Fprintf(os.Stdout, "Response from `ActorsActorRunsAPI.ActRunAbortPost`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**actorId** | **string** | Actor ID or a tilde-separated owner's username and Actor name. | +**runId** | **string** | Actor run ID. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiActRunAbortPostRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + **gracefully** | **bool** | If true passed, the Actor run will abort gracefully. It will send `aborting` and `persistState` event into run and force-stop the run after 30 seconds. It is helpful in cases where you plan to resurrect the run later. | + +### Return type + +[**RunResponse**](RunResponse.md) + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## ActRunGet + +> RunResponse ActRunGet(ctx, actorId, runId).WaitForFinish(waitForFinish).Execute() + +Get run + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + actorId := "janedoe~my-actor" // string | Actor ID or a tilde-separated owner's username and Actor name. + runId := "3KH8gEpp4d8uQSe8T" // string | Actor run ID. + waitForFinish := float64(60) // float64 | The maximum number of seconds the server waits for the run to finish. By default it is `0`, the maximum value is `60`. <!-- MAX_ACTOR_JOB_ASYNC_WAIT_SECS --> If the run finishes in time then the returned run object will have a terminal status (e.g. `SUCCEEDED`), otherwise it will have a transitional status (e.g. `RUNNING`). (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.ActorsActorRunsAPI.ActRunGet(context.Background(), actorId, runId).WaitForFinish(waitForFinish).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ActorsActorRunsAPI.ActRunGet``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ActRunGet`: RunResponse + fmt.Fprintf(os.Stdout, "Response from `ActorsActorRunsAPI.ActRunGet`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**actorId** | **string** | Actor ID or a tilde-separated owner's username and Actor name. | +**runId** | **string** | Actor run ID. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiActRunGetRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + **waitForFinish** | **float64** | The maximum number of seconds the server waits for the run to finish. By default it is `0`, the maximum value is `60`. <!-- MAX_ACTOR_JOB_ASYNC_WAIT_SECS --> If the run finishes in time then the returned run object will have a terminal status (e.g. `SUCCEEDED`), otherwise it will have a transitional status (e.g. `RUNNING`). | + +### Return type + +[**RunResponse**](RunResponse.md) + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## ActRunMetamorphPost + +> RunResponse ActRunMetamorphPost(ctx, actorId, runId).TargetActorId(targetActorId).Build(build).Execute() + +Metamorph run + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + actorId := "janedoe~my-actor" // string | Actor ID or a tilde-separated owner's username and Actor name. + runId := "3KH8gEpp4d8uQSe8T" // string | Actor run ID. + targetActorId := "HDSasDasz78YcAPEB" // string | ID of a target Actor that the run should be transformed into. + build := "beta" // string | Optional build of the target Actor. It can be either a build tag or build number. By default, the run uses the build specified in the default run configuration for the target Actor (typically `latest`). (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.ActorsActorRunsAPI.ActRunMetamorphPost(context.Background(), actorId, runId).TargetActorId(targetActorId).Build(build).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ActorsActorRunsAPI.ActRunMetamorphPost``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ActRunMetamorphPost`: RunResponse + fmt.Fprintf(os.Stdout, "Response from `ActorsActorRunsAPI.ActRunMetamorphPost`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**actorId** | **string** | Actor ID or a tilde-separated owner's username and Actor name. | +**runId** | **string** | Actor run ID. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiActRunMetamorphPostRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + **targetActorId** | **string** | ID of a target Actor that the run should be transformed into. | + **build** | **string** | Optional build of the target Actor. It can be either a build tag or build number. By default, the run uses the build specified in the default run configuration for the target Actor (typically `latest`). | + +### Return type + +[**RunResponse**](RunResponse.md) + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## ActRunResurrectPost + +> RunResponse ActRunResurrectPost(ctx, actorId, runId).Build(build).Timeout(timeout).Memory(memory).RestartOnError(restartOnError).Execute() + +Resurrect run + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + actorId := "janedoe~my-actor" // string | Actor ID or a tilde-separated owner's username and Actor name. + runId := "3KH8gEpp4d8uQSe8T" // string | Actor run ID. + build := "0.1.234" // string | Specifies the Actor build to run. It can be either a build tag or build number. By default, the run is resurrected with the same build it originally used. Specifically, if a run was first started with the `latest` tag, which resolves to version `0.0.3` at the time, a run resurrected without this parameter will continue running with `0.0.3`, even if `latest` already points to a newer build. (optional) + timeout := float64(60) // float64 | Optional timeout for the run, in seconds. By default, the run uses the timeout specified in the run that is being resurrected. (optional) + memory := float64(256) // float64 | Memory limit for the run, in megabytes. The amount of memory can be set to a power of 2 with a minimum of 128. By default, the run uses the memory limit specified in the run that is being resurrected. (optional) + restartOnError := false // bool | Determines whether the resurrected run will be restarted if it fails. By default, the resurrected run uses the same setting as before. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.ActorsActorRunsAPI.ActRunResurrectPost(context.Background(), actorId, runId).Build(build).Timeout(timeout).Memory(memory).RestartOnError(restartOnError).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ActorsActorRunsAPI.ActRunResurrectPost``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ActRunResurrectPost`: RunResponse + fmt.Fprintf(os.Stdout, "Response from `ActorsActorRunsAPI.ActRunResurrectPost`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**actorId** | **string** | Actor ID or a tilde-separated owner's username and Actor name. | +**runId** | **string** | Actor run ID. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiActRunResurrectPostRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + **build** | **string** | Specifies the Actor build to run. It can be either a build tag or build number. By default, the run is resurrected with the same build it originally used. Specifically, if a run was first started with the `latest` tag, which resolves to version `0.0.3` at the time, a run resurrected without this parameter will continue running with `0.0.3`, even if `latest` already points to a newer build. | + **timeout** | **float64** | Optional timeout for the run, in seconds. By default, the run uses the timeout specified in the run that is being resurrected. | + **memory** | **float64** | Memory limit for the run, in megabytes. The amount of memory can be set to a power of 2 with a minimum of 128. By default, the run uses the memory limit specified in the run that is being resurrected. | + **restartOnError** | **bool** | Determines whether the resurrected run will be restarted if it fails. By default, the resurrected run uses the same setting as before. | + +### Return type + +[**RunResponse**](RunResponse.md) + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## ActRunSyncGet + +> map[string]interface{} ActRunSyncGet(ctx, actorId).OutputRecordKey(outputRecordKey).Timeout(timeout).Memory(memory).MaxItems(maxItems).MaxTotalChargeUsd(maxTotalChargeUsd).RestartOnError(restartOnError).Build(build).Webhooks(webhooks).Execute() + +Run Actor synchronously without input + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + actorId := "janedoe~my-actor" // string | Actor ID or a tilde-separated owner's username and Actor name. + outputRecordKey := "OUTPUT" // string | Key of the record from run's default key-value store to be returned in the response. By default, it is `OUTPUT`. (optional) + timeout := float64(60) // float64 | Optional timeout for the run, in seconds. By default, the run uses the timeout from its configuration. (optional) + memory := float64(256) // float64 | Memory limit for the run, in megabytes. The amount of memory can be set to a power of 2 with a minimum of 128. By default, the run uses the memory limit from its configuration. (optional) + maxItems := float64(1000) // float64 | Specifies the maximum number of dataset items that will be charged for pay-per-result Actors. This does NOT guarantee that the Actor will return only this many items. It only ensures you won't be charged for more than this number of items. Only works for pay-per-result Actors. Value can be accessed in the actor run using `ACTOR_MAX_PAID_DATASET_ITEMS` environment variable. (optional) + maxTotalChargeUsd := float64(5) // float64 | Specifies the maximum cost of the run. This parameter is useful for pay-per-event Actors, as it allows you to limit the amount charged to your subscription. You can access the maximum cost in your Actor by using the `ACTOR_MAX_TOTAL_CHARGE_USD` environment variable. (optional) + restartOnError := false // bool | Determines whether the run will be restarted if it fails. (optional) + build := "0.1.234" // string | Specifies the Actor build to run. It can be either a build tag or build number. By default, the run uses the build from its configuration (typically `latest`). (optional) + webhooks := "dGhpcyBpcyBqdXN0IGV4YW1wbGUK..." // string | Specifies optional webhooks associated with the Actor run, which can be used to receive a notification e.g. when the Actor finished or failed. The value is a Base64-encoded JSON array whose items follow the WebhookRepresentation schema. For more information, see [Webhooks documentation](https://docs.apify.com/platform/integrations/webhooks). (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.ActorsActorRunsAPI.ActRunSyncGet(context.Background(), actorId).OutputRecordKey(outputRecordKey).Timeout(timeout).Memory(memory).MaxItems(maxItems).MaxTotalChargeUsd(maxTotalChargeUsd).RestartOnError(restartOnError).Build(build).Webhooks(webhooks).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ActorsActorRunsAPI.ActRunSyncGet``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ActRunSyncGet`: map[string]interface{} + fmt.Fprintf(os.Stdout, "Response from `ActorsActorRunsAPI.ActRunSyncGet`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**actorId** | **string** | Actor ID or a tilde-separated owner's username and Actor name. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiActRunSyncGetRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **outputRecordKey** | **string** | Key of the record from run's default key-value store to be returned in the response. By default, it is `OUTPUT`. | + **timeout** | **float64** | Optional timeout for the run, in seconds. By default, the run uses the timeout from its configuration. | + **memory** | **float64** | Memory limit for the run, in megabytes. The amount of memory can be set to a power of 2 with a minimum of 128. By default, the run uses the memory limit from its configuration. | + **maxItems** | **float64** | Specifies the maximum number of dataset items that will be charged for pay-per-result Actors. This does NOT guarantee that the Actor will return only this many items. It only ensures you won't be charged for more than this number of items. Only works for pay-per-result Actors. Value can be accessed in the actor run using `ACTOR_MAX_PAID_DATASET_ITEMS` environment variable. | + **maxTotalChargeUsd** | **float64** | Specifies the maximum cost of the run. This parameter is useful for pay-per-event Actors, as it allows you to limit the amount charged to your subscription. You can access the maximum cost in your Actor by using the `ACTOR_MAX_TOTAL_CHARGE_USD` environment variable. | + **restartOnError** | **bool** | Determines whether the run will be restarted if it fails. | + **build** | **string** | Specifies the Actor build to run. It can be either a build tag or build number. By default, the run uses the build from its configuration (typically `latest`). | + **webhooks** | **string** | Specifies optional webhooks associated with the Actor run, which can be used to receive a notification e.g. when the Actor finished or failed. The value is a Base64-encoded JSON array whose items follow the WebhookRepresentation schema. For more information, see [Webhooks documentation](https://docs.apify.com/platform/integrations/webhooks). | + +### Return type + +**map[string]interface{}** + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## ActRunSyncGetDatasetItemsGet + +> []map[string]interface{} ActRunSyncGetDatasetItemsGet(ctx, actorId).Timeout(timeout).Memory(memory).MaxItems(maxItems).MaxTotalChargeUsd(maxTotalChargeUsd).RestartOnError(restartOnError).Build(build).Webhooks(webhooks).Format(format).Clean(clean).Offset(offset).Limit(limit).Fields(fields).OutputFields(outputFields).Omit(omit).Unwind(unwind).Flatten(flatten).Desc(desc).Attachment(attachment).Delimiter(delimiter).Bom(bom).XmlRoot(xmlRoot).XmlRow(xmlRow).SkipHeaderRow(skipHeaderRow).SkipHidden(skipHidden).SkipEmpty(skipEmpty).Simplified(simplified).View(view).SkipFailedPages(skipFailedPages).FeedTitle(feedTitle).FeedDescription(feedDescription).Execute() + +Run Actor synchronously without input and get dataset items + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + actorId := "janedoe~my-actor" // string | Actor ID or a tilde-separated owner's username and Actor name. + timeout := float64(60) // float64 | Optional timeout for the run, in seconds. By default, the run uses the timeout from its configuration. (optional) + memory := float64(256) // float64 | Memory limit for the run, in megabytes. The amount of memory can be set to a power of 2 with a minimum of 128. By default, the run uses the memory limit from its configuration. (optional) + maxItems := float64(1000) // float64 | Specifies the maximum number of dataset items that will be charged for pay-per-result Actors. This does NOT guarantee that the Actor will return only this many items. It only ensures you won't be charged for more than this number of items. Only works for pay-per-result Actors. Value can be accessed in the actor run using `ACTOR_MAX_PAID_DATASET_ITEMS` environment variable. (optional) + maxTotalChargeUsd := float64(5) // float64 | Specifies the maximum cost of the run. This parameter is useful for pay-per-event Actors, as it allows you to limit the amount charged to your subscription. You can access the maximum cost in your Actor by using the `ACTOR_MAX_TOTAL_CHARGE_USD` environment variable. (optional) + restartOnError := false // bool | Determines whether the run will be restarted if it fails. (optional) + build := "0.1.234" // string | Specifies the Actor build to run. It can be either a build tag or build number. By default, the run uses the build from its configuration (typically `latest`). (optional) + webhooks := "dGhpcyBpcyBqdXN0IGV4YW1wbGUK..." // string | Specifies optional webhooks associated with the Actor run, which can be used to receive a notification e.g. when the Actor finished or failed. The value is a Base64-encoded JSON array whose items follow the WebhookRepresentation schema. For more information, see [Webhooks documentation](https://docs.apify.com/platform/integrations/webhooks). (optional) + format := "json" // string | Format of the results, possible values are: `json`, `jsonl`, `csv`, `html`, `xlsx`, `xml` and `rss`. The default value is `json`. (optional) + clean := false // bool | If `true` or `1` then the API endpoint returns only non-empty items and skips hidden fields (i.e. fields starting with the # character). The `clean` parameter is just a shortcut for `skipHidden=true` and `skipEmpty=true` parameters. Note that since some objects might be skipped from the output, that the result might contain less items than the `limit` value. (optional) + offset := float64(0) // float64 | Number of items that should be skipped at the start. The default value is `0`. (optional) + limit := float64(1.2) // float64 | Maximum number of items to return. By default there is no limit. (optional) + fields := "myValue,myOtherValue" // string | A comma-separated list of fields which should be picked from the items, only these fields will remain in the resulting record objects. Note that the fields in the outputted items are sorted the same way as they are specified in the `fields` query parameter. You can use this feature to effectively fix the output format. (optional) + outputFields := "title,link" // string | A comma-separated list of output field names that positionally rename the fields specified in the `fields` parameter. For example, `?fields=headline,url&outputFields=title,link` renames `headline` to `title` and `url` to `link` in the output. The number of names in `outputFields` must match the number of names in `fields`. Requires the `fields` parameter to be specified as well. (optional) + omit := "myValue,myOtherValue" // string | A comma-separated list of fields which should be omitted from the items. (optional) + unwind := "myValue,myOtherValue" // string | A comma-separated list of fields which should be unwound, in order which they should be processed. Each field should be either an array or an object. If the field is an array then every element of the array will become a separate record and merged with parent object. If the unwound field is an object then it is merged with the parent object. If the unwound field is missing or its value is neither an array nor an object and therefore cannot be merged with a parent object then the item gets preserved as it is. Note that the unwound items ignore the `desc` parameter. (optional) + flatten := "myValue" // string | A comma-separated list of fields which should transform nested objects into flat structures. For example, with `flatten=\"foo\"` the object `{\"foo\":{\"bar\": \"hello\"}}` is turned into `{\"foo.bar\": \"hello\"}`. The original object with properties is replaced with the flattened object. (optional) + desc := true // bool | By default, results are returned in the same order as they were stored. To reverse the order, set this parameter to `true` or `1`. (optional) + attachment := true // bool | If `true` or `1` then the response will define the `Content-Disposition: attachment` header, forcing a web browser to download the file rather than to display it. By default this header is not present. (optional) + delimiter := ";" // string | A delimiter character for CSV files, only used if `format=csv`. You might need to URL-encode the character (e.g. use `%09` for tab or `%3B` for semicolon). The default delimiter is a simple comma (`,`). (optional) + bom := false // bool | All text responses are encoded in UTF-8 encoding. By default, the `format=csv` files are prefixed with the UTF-8 Byte Order Mark (BOM), while `json`, `jsonl`, `xml`, `html` and `rss` files are not. If you want to override this default behavior, specify `bom=1` query parameter to include the BOM or `bom=0` to skip it. (optional) + xmlRoot := "items" // string | Overrides default root element name of `xml` output. By default the root element is `items`. (optional) + xmlRow := "item" // string | Overrides default element name that wraps each page or page function result object in `xml` output. By default the element name is `item`. (optional) + skipHeaderRow := true // bool | If `true` or `1` then header row in the `csv` format is skipped. (optional) + skipHidden := false // bool | If `true` or `1` then hidden fields are skipped from the output, i.e. fields starting with the `#` character. (optional) + skipEmpty := false // bool | If `true` or `1` then empty items are skipped from the output. Note that if used, the results might contain less items than the limit value. (optional) + simplified := false // bool | If `true` or `1` then, the endpoint applies the `fields=url,pageFunctionResult,errorInfo` and `unwind=pageFunctionResult` query parameters. This feature is used to emulate simplified results provided by the legacy Apify Crawler product and it's not recommended to use it in new integrations. (optional) + view := "overview" // string | Defines the view configuration for dataset items based on the schema definition. This parameter determines how the data will be filtered and presented. For complete specification details, see the [dataset schema documentation](/platform/actors/development/actor-definition/dataset-schema). (optional) + skipFailedPages := false // bool | If `true` or `1` then, the all the items with errorInfo property will be skipped from the output. This feature is here to emulate functionality of API version 1 used for the legacy Apify Crawler product and it's not recommended to use it in new integrations. (optional) + feedTitle := "Latest posts from r/pasta" // string | Overrides the auto-generated RSS channel `<title>` element. Only used when `format=rss`. If not provided, the title defaults to `Dataset <label>`. (optional) + feedDescription := "Scraped forum posts" // string | Overrides the auto-generated RSS channel `<description>` element. Only used when `format=rss`. If not provided, the description defaults to `Items in dataset with id \"<datasetId>\".` (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.ActorsActorRunsAPI.ActRunSyncGetDatasetItemsGet(context.Background(), actorId).Timeout(timeout).Memory(memory).MaxItems(maxItems).MaxTotalChargeUsd(maxTotalChargeUsd).RestartOnError(restartOnError).Build(build).Webhooks(webhooks).Format(format).Clean(clean).Offset(offset).Limit(limit).Fields(fields).OutputFields(outputFields).Omit(omit).Unwind(unwind).Flatten(flatten).Desc(desc).Attachment(attachment).Delimiter(delimiter).Bom(bom).XmlRoot(xmlRoot).XmlRow(xmlRow).SkipHeaderRow(skipHeaderRow).SkipHidden(skipHidden).SkipEmpty(skipEmpty).Simplified(simplified).View(view).SkipFailedPages(skipFailedPages).FeedTitle(feedTitle).FeedDescription(feedDescription).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ActorsActorRunsAPI.ActRunSyncGetDatasetItemsGet``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ActRunSyncGetDatasetItemsGet`: []map[string]interface{} + fmt.Fprintf(os.Stdout, "Response from `ActorsActorRunsAPI.ActRunSyncGetDatasetItemsGet`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**actorId** | **string** | Actor ID or a tilde-separated owner's username and Actor name. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiActRunSyncGetDatasetItemsGetRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **timeout** | **float64** | Optional timeout for the run, in seconds. By default, the run uses the timeout from its configuration. | + **memory** | **float64** | Memory limit for the run, in megabytes. The amount of memory can be set to a power of 2 with a minimum of 128. By default, the run uses the memory limit from its configuration. | + **maxItems** | **float64** | Specifies the maximum number of dataset items that will be charged for pay-per-result Actors. This does NOT guarantee that the Actor will return only this many items. It only ensures you won't be charged for more than this number of items. Only works for pay-per-result Actors. Value can be accessed in the actor run using `ACTOR_MAX_PAID_DATASET_ITEMS` environment variable. | + **maxTotalChargeUsd** | **float64** | Specifies the maximum cost of the run. This parameter is useful for pay-per-event Actors, as it allows you to limit the amount charged to your subscription. You can access the maximum cost in your Actor by using the `ACTOR_MAX_TOTAL_CHARGE_USD` environment variable. | + **restartOnError** | **bool** | Determines whether the run will be restarted if it fails. | + **build** | **string** | Specifies the Actor build to run. It can be either a build tag or build number. By default, the run uses the build from its configuration (typically `latest`). | + **webhooks** | **string** | Specifies optional webhooks associated with the Actor run, which can be used to receive a notification e.g. when the Actor finished or failed. The value is a Base64-encoded JSON array whose items follow the WebhookRepresentation schema. For more information, see [Webhooks documentation](https://docs.apify.com/platform/integrations/webhooks). | + **format** | **string** | Format of the results, possible values are: `json`, `jsonl`, `csv`, `html`, `xlsx`, `xml` and `rss`. The default value is `json`. | + **clean** | **bool** | If `true` or `1` then the API endpoint returns only non-empty items and skips hidden fields (i.e. fields starting with the # character). The `clean` parameter is just a shortcut for `skipHidden=true` and `skipEmpty=true` parameters. Note that since some objects might be skipped from the output, that the result might contain less items than the `limit` value. | + **offset** | **float64** | Number of items that should be skipped at the start. The default value is `0`. | + **limit** | **float64** | Maximum number of items to return. By default there is no limit. | + **fields** | **string** | A comma-separated list of fields which should be picked from the items, only these fields will remain in the resulting record objects. Note that the fields in the outputted items are sorted the same way as they are specified in the `fields` query parameter. You can use this feature to effectively fix the output format. | + **outputFields** | **string** | A comma-separated list of output field names that positionally rename the fields specified in the `fields` parameter. For example, `?fields=headline,url&outputFields=title,link` renames `headline` to `title` and `url` to `link` in the output. The number of names in `outputFields` must match the number of names in `fields`. Requires the `fields` parameter to be specified as well. | + **omit** | **string** | A comma-separated list of fields which should be omitted from the items. | + **unwind** | **string** | A comma-separated list of fields which should be unwound, in order which they should be processed. Each field should be either an array or an object. If the field is an array then every element of the array will become a separate record and merged with parent object. If the unwound field is an object then it is merged with the parent object. If the unwound field is missing or its value is neither an array nor an object and therefore cannot be merged with a parent object then the item gets preserved as it is. Note that the unwound items ignore the `desc` parameter. | + **flatten** | **string** | A comma-separated list of fields which should transform nested objects into flat structures. For example, with `flatten=\"foo\"` the object `{\"foo\":{\"bar\": \"hello\"}}` is turned into `{\"foo.bar\": \"hello\"}`. The original object with properties is replaced with the flattened object. | + **desc** | **bool** | By default, results are returned in the same order as they were stored. To reverse the order, set this parameter to `true` or `1`. | + **attachment** | **bool** | If `true` or `1` then the response will define the `Content-Disposition: attachment` header, forcing a web browser to download the file rather than to display it. By default this header is not present. | + **delimiter** | **string** | A delimiter character for CSV files, only used if `format=csv`. You might need to URL-encode the character (e.g. use `%09` for tab or `%3B` for semicolon). The default delimiter is a simple comma (`,`). | + **bom** | **bool** | All text responses are encoded in UTF-8 encoding. By default, the `format=csv` files are prefixed with the UTF-8 Byte Order Mark (BOM), while `json`, `jsonl`, `xml`, `html` and `rss` files are not. If you want to override this default behavior, specify `bom=1` query parameter to include the BOM or `bom=0` to skip it. | + **xmlRoot** | **string** | Overrides default root element name of `xml` output. By default the root element is `items`. | + **xmlRow** | **string** | Overrides default element name that wraps each page or page function result object in `xml` output. By default the element name is `item`. | + **skipHeaderRow** | **bool** | If `true` or `1` then header row in the `csv` format is skipped. | + **skipHidden** | **bool** | If `true` or `1` then hidden fields are skipped from the output, i.e. fields starting with the `#` character. | + **skipEmpty** | **bool** | If `true` or `1` then empty items are skipped from the output. Note that if used, the results might contain less items than the limit value. | + **simplified** | **bool** | If `true` or `1` then, the endpoint applies the `fields=url,pageFunctionResult,errorInfo` and `unwind=pageFunctionResult` query parameters. This feature is used to emulate simplified results provided by the legacy Apify Crawler product and it's not recommended to use it in new integrations. | + **view** | **string** | Defines the view configuration for dataset items based on the schema definition. This parameter determines how the data will be filtered and presented. For complete specification details, see the [dataset schema documentation](/platform/actors/development/actor-definition/dataset-schema). | + **skipFailedPages** | **bool** | If `true` or `1` then, the all the items with errorInfo property will be skipped from the output. This feature is here to emulate functionality of API version 1 used for the legacy Apify Crawler product and it's not recommended to use it in new integrations. | + **feedTitle** | **string** | Overrides the auto-generated RSS channel `<title>` element. Only used when `format=rss`. If not provided, the title defaults to `Dataset <label>`. | + **feedDescription** | **string** | Overrides the auto-generated RSS channel `<description>` element. Only used when `format=rss`. If not provided, the description defaults to `Items in dataset with id \"<datasetId>\".` | + +### Return type + +**[]map[string]interface{}** + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## ActRunSyncGetDatasetItemsPost + +> []map[string]interface{} ActRunSyncGetDatasetItemsPost(ctx, actorId).Body(body).Timeout(timeout).Memory(memory).MaxItems(maxItems).MaxTotalChargeUsd(maxTotalChargeUsd).RestartOnError(restartOnError).Build(build).Webhooks(webhooks).Format(format).Clean(clean).Offset(offset).Limit(limit).Fields(fields).OutputFields(outputFields).Omit(omit).Unwind(unwind).Flatten(flatten).Desc(desc).Attachment(attachment).Delimiter(delimiter).Bom(bom).XmlRoot(xmlRoot).XmlRow(xmlRow).SkipHeaderRow(skipHeaderRow).SkipHidden(skipHidden).SkipEmpty(skipEmpty).Simplified(simplified).View(view).SkipFailedPages(skipFailedPages).FeedTitle(feedTitle).FeedDescription(feedDescription).Execute() + +Run Actor synchronously and get dataset items + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + actorId := "janedoe~my-actor" // string | Actor ID or a tilde-separated owner's username and Actor name. + body := map[string]interface{}{ ... } // map[string]interface{} | + timeout := float64(60) // float64 | Optional timeout for the run, in seconds. By default, the run uses the timeout from its configuration. (optional) + memory := float64(256) // float64 | Memory limit for the run, in megabytes. The amount of memory can be set to a power of 2 with a minimum of 128. By default, the run uses the memory limit from its configuration. (optional) + maxItems := float64(1000) // float64 | Specifies the maximum number of dataset items that will be charged for pay-per-result Actors. This does NOT guarantee that the Actor will return only this many items. It only ensures you won't be charged for more than this number of items. Only works for pay-per-result Actors. Value can be accessed in the actor run using `ACTOR_MAX_PAID_DATASET_ITEMS` environment variable. (optional) + maxTotalChargeUsd := float64(5) // float64 | Specifies the maximum cost of the run. This parameter is useful for pay-per-event Actors, as it allows you to limit the amount charged to your subscription. You can access the maximum cost in your Actor by using the `ACTOR_MAX_TOTAL_CHARGE_USD` environment variable. (optional) + restartOnError := false // bool | Determines whether the run will be restarted if it fails. (optional) + build := "0.1.234" // string | Specifies the Actor build to run. It can be either a build tag or build number. By default, the run uses the build from its configuration (typically `latest`). (optional) + webhooks := "dGhpcyBpcyBqdXN0IGV4YW1wbGUK..." // string | Specifies optional webhooks associated with the Actor run, which can be used to receive a notification e.g. when the Actor finished or failed. The value is a Base64-encoded JSON array whose items follow the WebhookRepresentation schema. For more information, see [Webhooks documentation](https://docs.apify.com/platform/integrations/webhooks). (optional) + format := "json" // string | Format of the results, possible values are: `json`, `jsonl`, `csv`, `html`, `xlsx`, `xml` and `rss`. The default value is `json`. (optional) + clean := false // bool | If `true` or `1` then the API endpoint returns only non-empty items and skips hidden fields (i.e. fields starting with the # character). The `clean` parameter is just a shortcut for `skipHidden=true` and `skipEmpty=true` parameters. Note that since some objects might be skipped from the output, that the result might contain less items than the `limit` value. (optional) + offset := float64(0) // float64 | Number of items that should be skipped at the start. The default value is `0`. (optional) + limit := float64(1.2) // float64 | Maximum number of items to return. By default there is no limit. (optional) + fields := "myValue,myOtherValue" // string | A comma-separated list of fields which should be picked from the items, only these fields will remain in the resulting record objects. Note that the fields in the outputted items are sorted the same way as they are specified in the `fields` query parameter. You can use this feature to effectively fix the output format. (optional) + outputFields := "title,link" // string | A comma-separated list of output field names that positionally rename the fields specified in the `fields` parameter. For example, `?fields=headline,url&outputFields=title,link` renames `headline` to `title` and `url` to `link` in the output. The number of names in `outputFields` must match the number of names in `fields`. Requires the `fields` parameter to be specified as well. (optional) + omit := "myValue,myOtherValue" // string | A comma-separated list of fields which should be omitted from the items. (optional) + unwind := "myValue,myOtherValue" // string | A comma-separated list of fields which should be unwound, in order which they should be processed. Each field should be either an array or an object. If the field is an array then every element of the array will become a separate record and merged with parent object. If the unwound field is an object then it is merged with the parent object. If the unwound field is missing or its value is neither an array nor an object and therefore cannot be merged with a parent object then the item gets preserved as it is. Note that the unwound items ignore the `desc` parameter. (optional) + flatten := "myValue" // string | A comma-separated list of fields which should transform nested objects into flat structures. For example, with `flatten=\"foo\"` the object `{\"foo\":{\"bar\": \"hello\"}}` is turned into `{\"foo.bar\": \"hello\"}`. The original object with properties is replaced with the flattened object. (optional) + desc := true // bool | By default, results are returned in the same order as they were stored. To reverse the order, set this parameter to `true` or `1`. (optional) + attachment := true // bool | If `true` or `1` then the response will define the `Content-Disposition: attachment` header, forcing a web browser to download the file rather than to display it. By default this header is not present. (optional) + delimiter := ";" // string | A delimiter character for CSV files, only used if `format=csv`. You might need to URL-encode the character (e.g. use `%09` for tab or `%3B` for semicolon). The default delimiter is a simple comma (`,`). (optional) + bom := false // bool | All text responses are encoded in UTF-8 encoding. By default, the `format=csv` files are prefixed with the UTF-8 Byte Order Mark (BOM), while `json`, `jsonl`, `xml`, `html` and `rss` files are not. If you want to override this default behavior, specify `bom=1` query parameter to include the BOM or `bom=0` to skip it. (optional) + xmlRoot := "items" // string | Overrides default root element name of `xml` output. By default the root element is `items`. (optional) + xmlRow := "item" // string | Overrides default element name that wraps each page or page function result object in `xml` output. By default the element name is `item`. (optional) + skipHeaderRow := true // bool | If `true` or `1` then header row in the `csv` format is skipped. (optional) + skipHidden := false // bool | If `true` or `1` then hidden fields are skipped from the output, i.e. fields starting with the `#` character. (optional) + skipEmpty := false // bool | If `true` or `1` then empty items are skipped from the output. Note that if used, the results might contain less items than the limit value. (optional) + simplified := false // bool | If `true` or `1` then, the endpoint applies the `fields=url,pageFunctionResult,errorInfo` and `unwind=pageFunctionResult` query parameters. This feature is used to emulate simplified results provided by the legacy Apify Crawler product and it's not recommended to use it in new integrations. (optional) + view := "overview" // string | Defines the view configuration for dataset items based on the schema definition. This parameter determines how the data will be filtered and presented. For complete specification details, see the [dataset schema documentation](/platform/actors/development/actor-definition/dataset-schema). (optional) + skipFailedPages := false // bool | If `true` or `1` then, the all the items with errorInfo property will be skipped from the output. This feature is here to emulate functionality of API version 1 used for the legacy Apify Crawler product and it's not recommended to use it in new integrations. (optional) + feedTitle := "Latest posts from r/pasta" // string | Overrides the auto-generated RSS channel `<title>` element. Only used when `format=rss`. If not provided, the title defaults to `Dataset <label>`. (optional) + feedDescription := "Scraped forum posts" // string | Overrides the auto-generated RSS channel `<description>` element. Only used when `format=rss`. If not provided, the description defaults to `Items in dataset with id \"<datasetId>\".` (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.ActorsActorRunsAPI.ActRunSyncGetDatasetItemsPost(context.Background(), actorId).Body(body).Timeout(timeout).Memory(memory).MaxItems(maxItems).MaxTotalChargeUsd(maxTotalChargeUsd).RestartOnError(restartOnError).Build(build).Webhooks(webhooks).Format(format).Clean(clean).Offset(offset).Limit(limit).Fields(fields).OutputFields(outputFields).Omit(omit).Unwind(unwind).Flatten(flatten).Desc(desc).Attachment(attachment).Delimiter(delimiter).Bom(bom).XmlRoot(xmlRoot).XmlRow(xmlRow).SkipHeaderRow(skipHeaderRow).SkipHidden(skipHidden).SkipEmpty(skipEmpty).Simplified(simplified).View(view).SkipFailedPages(skipFailedPages).FeedTitle(feedTitle).FeedDescription(feedDescription).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ActorsActorRunsAPI.ActRunSyncGetDatasetItemsPost``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ActRunSyncGetDatasetItemsPost`: []map[string]interface{} + fmt.Fprintf(os.Stdout, "Response from `ActorsActorRunsAPI.ActRunSyncGetDatasetItemsPost`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**actorId** | **string** | Actor ID or a tilde-separated owner's username and Actor name. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiActRunSyncGetDatasetItemsPostRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **body** | **map[string]interface{}** | | + **timeout** | **float64** | Optional timeout for the run, in seconds. By default, the run uses the timeout from its configuration. | + **memory** | **float64** | Memory limit for the run, in megabytes. The amount of memory can be set to a power of 2 with a minimum of 128. By default, the run uses the memory limit from its configuration. | + **maxItems** | **float64** | Specifies the maximum number of dataset items that will be charged for pay-per-result Actors. This does NOT guarantee that the Actor will return only this many items. It only ensures you won't be charged for more than this number of items. Only works for pay-per-result Actors. Value can be accessed in the actor run using `ACTOR_MAX_PAID_DATASET_ITEMS` environment variable. | + **maxTotalChargeUsd** | **float64** | Specifies the maximum cost of the run. This parameter is useful for pay-per-event Actors, as it allows you to limit the amount charged to your subscription. You can access the maximum cost in your Actor by using the `ACTOR_MAX_TOTAL_CHARGE_USD` environment variable. | + **restartOnError** | **bool** | Determines whether the run will be restarted if it fails. | + **build** | **string** | Specifies the Actor build to run. It can be either a build tag or build number. By default, the run uses the build from its configuration (typically `latest`). | + **webhooks** | **string** | Specifies optional webhooks associated with the Actor run, which can be used to receive a notification e.g. when the Actor finished or failed. The value is a Base64-encoded JSON array whose items follow the WebhookRepresentation schema. For more information, see [Webhooks documentation](https://docs.apify.com/platform/integrations/webhooks). | + **format** | **string** | Format of the results, possible values are: `json`, `jsonl`, `csv`, `html`, `xlsx`, `xml` and `rss`. The default value is `json`. | + **clean** | **bool** | If `true` or `1` then the API endpoint returns only non-empty items and skips hidden fields (i.e. fields starting with the # character). The `clean` parameter is just a shortcut for `skipHidden=true` and `skipEmpty=true` parameters. Note that since some objects might be skipped from the output, that the result might contain less items than the `limit` value. | + **offset** | **float64** | Number of items that should be skipped at the start. The default value is `0`. | + **limit** | **float64** | Maximum number of items to return. By default there is no limit. | + **fields** | **string** | A comma-separated list of fields which should be picked from the items, only these fields will remain in the resulting record objects. Note that the fields in the outputted items are sorted the same way as they are specified in the `fields` query parameter. You can use this feature to effectively fix the output format. | + **outputFields** | **string** | A comma-separated list of output field names that positionally rename the fields specified in the `fields` parameter. For example, `?fields=headline,url&outputFields=title,link` renames `headline` to `title` and `url` to `link` in the output. The number of names in `outputFields` must match the number of names in `fields`. Requires the `fields` parameter to be specified as well. | + **omit** | **string** | A comma-separated list of fields which should be omitted from the items. | + **unwind** | **string** | A comma-separated list of fields which should be unwound, in order which they should be processed. Each field should be either an array or an object. If the field is an array then every element of the array will become a separate record and merged with parent object. If the unwound field is an object then it is merged with the parent object. If the unwound field is missing or its value is neither an array nor an object and therefore cannot be merged with a parent object then the item gets preserved as it is. Note that the unwound items ignore the `desc` parameter. | + **flatten** | **string** | A comma-separated list of fields which should transform nested objects into flat structures. For example, with `flatten=\"foo\"` the object `{\"foo\":{\"bar\": \"hello\"}}` is turned into `{\"foo.bar\": \"hello\"}`. The original object with properties is replaced with the flattened object. | + **desc** | **bool** | By default, results are returned in the same order as they were stored. To reverse the order, set this parameter to `true` or `1`. | + **attachment** | **bool** | If `true` or `1` then the response will define the `Content-Disposition: attachment` header, forcing a web browser to download the file rather than to display it. By default this header is not present. | + **delimiter** | **string** | A delimiter character for CSV files, only used if `format=csv`. You might need to URL-encode the character (e.g. use `%09` for tab or `%3B` for semicolon). The default delimiter is a simple comma (`,`). | + **bom** | **bool** | All text responses are encoded in UTF-8 encoding. By default, the `format=csv` files are prefixed with the UTF-8 Byte Order Mark (BOM), while `json`, `jsonl`, `xml`, `html` and `rss` files are not. If you want to override this default behavior, specify `bom=1` query parameter to include the BOM or `bom=0` to skip it. | + **xmlRoot** | **string** | Overrides default root element name of `xml` output. By default the root element is `items`. | + **xmlRow** | **string** | Overrides default element name that wraps each page or page function result object in `xml` output. By default the element name is `item`. | + **skipHeaderRow** | **bool** | If `true` or `1` then header row in the `csv` format is skipped. | + **skipHidden** | **bool** | If `true` or `1` then hidden fields are skipped from the output, i.e. fields starting with the `#` character. | + **skipEmpty** | **bool** | If `true` or `1` then empty items are skipped from the output. Note that if used, the results might contain less items than the limit value. | + **simplified** | **bool** | If `true` or `1` then, the endpoint applies the `fields=url,pageFunctionResult,errorInfo` and `unwind=pageFunctionResult` query parameters. This feature is used to emulate simplified results provided by the legacy Apify Crawler product and it's not recommended to use it in new integrations. | + **view** | **string** | Defines the view configuration for dataset items based on the schema definition. This parameter determines how the data will be filtered and presented. For complete specification details, see the [dataset schema documentation](/platform/actors/development/actor-definition/dataset-schema). | + **skipFailedPages** | **bool** | If `true` or `1` then, the all the items with errorInfo property will be skipped from the output. This feature is here to emulate functionality of API version 1 used for the legacy Apify Crawler product and it's not recommended to use it in new integrations. | + **feedTitle** | **string** | Overrides the auto-generated RSS channel `<title>` element. Only used when `format=rss`. If not provided, the title defaults to `Dataset <label>`. | + **feedDescription** | **string** | Overrides the auto-generated RSS channel `<description>` element. Only used when `format=rss`. If not provided, the description defaults to `Items in dataset with id \"<datasetId>\".` | + +### Return type + +**[]map[string]interface{}** + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## ActRunSyncPost + +> map[string]interface{} ActRunSyncPost(ctx, actorId).Body(body).OutputRecordKey(outputRecordKey).Timeout(timeout).Memory(memory).MaxItems(maxItems).MaxTotalChargeUsd(maxTotalChargeUsd).RestartOnError(restartOnError).Build(build).Webhooks(webhooks).Execute() + +Run Actor synchronously and return output + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + actorId := "janedoe~my-actor" // string | Actor ID or a tilde-separated owner's username and Actor name. + body := map[string]interface{}{ ... } // map[string]interface{} | + outputRecordKey := "OUTPUT" // string | Key of the record from run's default key-value store to be returned in the response. By default, it is `OUTPUT`. (optional) + timeout := float64(60) // float64 | Optional timeout for the run, in seconds. By default, the run uses the timeout from its configuration. (optional) + memory := float64(256) // float64 | Memory limit for the run, in megabytes. The amount of memory can be set to a power of 2 with a minimum of 128. By default, the run uses the memory limit from its configuration. (optional) + maxItems := float64(1000) // float64 | Specifies the maximum number of dataset items that will be charged for pay-per-result Actors. This does NOT guarantee that the Actor will return only this many items. It only ensures you won't be charged for more than this number of items. Only works for pay-per-result Actors. Value can be accessed in the actor run using `ACTOR_MAX_PAID_DATASET_ITEMS` environment variable. (optional) + maxTotalChargeUsd := float64(5) // float64 | Specifies the maximum cost of the run. This parameter is useful for pay-per-event Actors, as it allows you to limit the amount charged to your subscription. You can access the maximum cost in your Actor by using the `ACTOR_MAX_TOTAL_CHARGE_USD` environment variable. (optional) + restartOnError := false // bool | Determines whether the run will be restarted if it fails. (optional) + build := "0.1.234" // string | Specifies the Actor build to run. It can be either a build tag or build number. By default, the run uses the build from its configuration (typically `latest`). (optional) + webhooks := "dGhpcyBpcyBqdXN0IGV4YW1wbGUK..." // string | Specifies optional webhooks associated with the Actor run, which can be used to receive a notification e.g. when the Actor finished or failed. The value is a Base64-encoded JSON array whose items follow the WebhookRepresentation schema. For more information, see [Webhooks documentation](https://docs.apify.com/platform/integrations/webhooks). (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.ActorsActorRunsAPI.ActRunSyncPost(context.Background(), actorId).Body(body).OutputRecordKey(outputRecordKey).Timeout(timeout).Memory(memory).MaxItems(maxItems).MaxTotalChargeUsd(maxTotalChargeUsd).RestartOnError(restartOnError).Build(build).Webhooks(webhooks).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ActorsActorRunsAPI.ActRunSyncPost``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ActRunSyncPost`: map[string]interface{} + fmt.Fprintf(os.Stdout, "Response from `ActorsActorRunsAPI.ActRunSyncPost`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**actorId** | **string** | Actor ID or a tilde-separated owner's username and Actor name. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiActRunSyncPostRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **body** | **map[string]interface{}** | | + **outputRecordKey** | **string** | Key of the record from run's default key-value store to be returned in the response. By default, it is `OUTPUT`. | + **timeout** | **float64** | Optional timeout for the run, in seconds. By default, the run uses the timeout from its configuration. | + **memory** | **float64** | Memory limit for the run, in megabytes. The amount of memory can be set to a power of 2 with a minimum of 128. By default, the run uses the memory limit from its configuration. | + **maxItems** | **float64** | Specifies the maximum number of dataset items that will be charged for pay-per-result Actors. This does NOT guarantee that the Actor will return only this many items. It only ensures you won't be charged for more than this number of items. Only works for pay-per-result Actors. Value can be accessed in the actor run using `ACTOR_MAX_PAID_DATASET_ITEMS` environment variable. | + **maxTotalChargeUsd** | **float64** | Specifies the maximum cost of the run. This parameter is useful for pay-per-event Actors, as it allows you to limit the amount charged to your subscription. You can access the maximum cost in your Actor by using the `ACTOR_MAX_TOTAL_CHARGE_USD` environment variable. | + **restartOnError** | **bool** | Determines whether the run will be restarted if it fails. | + **build** | **string** | Specifies the Actor build to run. It can be either a build tag or build number. By default, the run uses the build from its configuration (typically `latest`). | + **webhooks** | **string** | Specifies optional webhooks associated with the Actor run, which can be used to receive a notification e.g. when the Actor finished or failed. The value is a Base64-encoded JSON array whose items follow the WebhookRepresentation schema. For more information, see [Webhooks documentation](https://docs.apify.com/platform/integrations/webhooks). | + +### Return type + +**map[string]interface{}** + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## ActRunsGet + +> ListOfRunsResponse ActRunsGet(ctx, actorId).Offset(offset).Limit(limit).Desc(desc).Status(status).StartedAfter(startedAfter).StartedBefore(startedBefore).Execute() + +Get list of runs + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + "time" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + actorId := "janedoe~my-actor" // string | Actor ID or a tilde-separated owner's username and Actor name. + offset := float64(0) // float64 | Number of items that should be skipped at the start. The default value is `0`. (optional) + limit := float64(1000) // float64 | Maximum number of items to return. The default value as well as the maximum is `1000`. (optional) + desc := true // bool | If `true` or `1` then the objects are sorted by the `startedAt` field in descending order. By default, they are sorted in ascending order. (optional) + status := []string{"Inner_example"} // []string | Single status or comma-separated list of statuses, see ([available statuses](https://docs.apify.com/platform/actors/running/runs-and-builds#lifecycle)). Used to filter runs by the specified statuses only. (optional) + startedAfter := time.Now() // time.Time | Filter runs that started after the specified date and time (inclusive). The value must be a valid ISO 8601 datetime string (UTC). (optional) + startedBefore := time.Now() // time.Time | Filter runs that started before the specified date and time (inclusive). The value must be a valid ISO 8601 datetime string (UTC). (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.ActorsActorRunsAPI.ActRunsGet(context.Background(), actorId).Offset(offset).Limit(limit).Desc(desc).Status(status).StartedAfter(startedAfter).StartedBefore(startedBefore).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ActorsActorRunsAPI.ActRunsGet``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ActRunsGet`: ListOfRunsResponse + fmt.Fprintf(os.Stdout, "Response from `ActorsActorRunsAPI.ActRunsGet`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**actorId** | **string** | Actor ID or a tilde-separated owner's username and Actor name. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiActRunsGetRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **offset** | **float64** | Number of items that should be skipped at the start. The default value is `0`. | + **limit** | **float64** | Maximum number of items to return. The default value as well as the maximum is `1000`. | + **desc** | **bool** | If `true` or `1` then the objects are sorted by the `startedAt` field in descending order. By default, they are sorted in ascending order. | + **status** | **[]string** | Single status or comma-separated list of statuses, see ([available statuses](https://docs.apify.com/platform/actors/running/runs-and-builds#lifecycle)). Used to filter runs by the specified statuses only. | + **startedAfter** | **time.Time** | Filter runs that started after the specified date and time (inclusive). The value must be a valid ISO 8601 datetime string (UTC). | + **startedBefore** | **time.Time** | Filter runs that started before the specified date and time (inclusive). The value must be a valid ISO 8601 datetime string (UTC). | + +### Return type + +[**ListOfRunsResponse**](ListOfRunsResponse.md) + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## ActRunsLastGet + +> RunResponse ActRunsLastGet(ctx, actorId).Status(status).WaitForFinish(waitForFinish).Execute() + +Get last run + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + actorId := "janedoe~my-actor" // string | Actor ID or a tilde-separated owner's username and Actor name. + status := "SUCCEEDED" // string | Filter for the run status. (optional) + waitForFinish := float64(60) // float64 | The maximum number of seconds the server waits for the run to finish. By default it is `0`, the maximum value is `60`. <!-- MAX_ACTOR_JOB_ASYNC_WAIT_SECS --> If the run finishes in time then the returned run object will have a terminal status (e.g. `SUCCEEDED`), otherwise it will have a transitional status (e.g. `RUNNING`). (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.ActorsActorRunsAPI.ActRunsLastGet(context.Background(), actorId).Status(status).WaitForFinish(waitForFinish).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ActorsActorRunsAPI.ActRunsLastGet``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ActRunsLastGet`: RunResponse + fmt.Fprintf(os.Stdout, "Response from `ActorsActorRunsAPI.ActRunsLastGet`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**actorId** | **string** | Actor ID or a tilde-separated owner's username and Actor name. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiActRunsLastGetRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **status** | **string** | Filter for the run status. | + **waitForFinish** | **float64** | The maximum number of seconds the server waits for the run to finish. By default it is `0`, the maximum value is `60`. <!-- MAX_ACTOR_JOB_ASYNC_WAIT_SECS --> If the run finishes in time then the returned run object will have a terminal status (e.g. `SUCCEEDED`), otherwise it will have a transitional status (e.g. `RUNNING`). | + +### Return type + +[**RunResponse**](RunResponse.md) + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## ActRunsPost + +> RunResponse ActRunsPost(ctx, actorId).Body(body).Timeout(timeout).Memory(memory).MaxItems(maxItems).MaxTotalChargeUsd(maxTotalChargeUsd).RestartOnError(restartOnError).Build(build).WaitForFinish(waitForFinish).Webhooks(webhooks).ForcePermissionLevel(forcePermissionLevel).Execute() + +Run Actor + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + actorId := "janedoe~my-actor" // string | Actor ID or a tilde-separated owner's username and Actor name. + body := map[string]interface{}{ ... } // map[string]interface{} | + timeout := float64(60) // float64 | Optional timeout for the run, in seconds. By default, the run uses the timeout from its configuration. (optional) + memory := float64(256) // float64 | Memory limit for the run, in megabytes. The amount of memory can be set to a power of 2 with a minimum of 128. By default, the run uses the memory limit from its configuration. (optional) + maxItems := float64(1000) // float64 | Specifies the maximum number of dataset items that will be charged for pay-per-result Actors. This does NOT guarantee that the Actor will return only this many items. It only ensures you won't be charged for more than this number of items. Only works for pay-per-result Actors. Value can be accessed in the actor run using `ACTOR_MAX_PAID_DATASET_ITEMS` environment variable. (optional) + maxTotalChargeUsd := float64(5) // float64 | Specifies the maximum cost of the run. This parameter is useful for pay-per-event Actors, as it allows you to limit the amount charged to your subscription. You can access the maximum cost in your Actor by using the `ACTOR_MAX_TOTAL_CHARGE_USD` environment variable. (optional) + restartOnError := false // bool | Determines whether the run will be restarted if it fails. (optional) + build := "0.1.234" // string | Specifies the Actor build to run. It can be either a build tag or build number. By default, the run uses the build from its configuration (typically `latest`). (optional) + waitForFinish := float64(60) // float64 | The maximum number of seconds the server waits for the run to finish. By default it is `0`, the maximum value is `60`. <!-- MAX_ACTOR_JOB_ASYNC_WAIT_SECS --> If the run finishes in time then the returned run object will have a terminal status (e.g. `SUCCEEDED`), otherwise it will have a transitional status (e.g. `RUNNING`). (optional) + webhooks := "dGhpcyBpcyBqdXN0IGV4YW1wbGUK..." // string | Specifies optional webhooks associated with the Actor run, which can be used to receive a notification e.g. when the Actor finished or failed. The value is a Base64-encoded JSON array whose items follow the WebhookRepresentation schema. For more information, see [Webhooks documentation](https://docs.apify.com/platform/integrations/webhooks). (optional) + forcePermissionLevel := "LIMITED_PERMISSIONS" // string | Overrides the Actor's permission level for this specific run. Use to test restricted permissions before deploying changes to your Actor or to temporarily elevate or restrict access. If you don't specify this parameter, the Actor uses its configured default permission level. For more information on permissions, see the [documentation](https://docs.apify.com/platform/actors/development/permissions). (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.ActorsActorRunsAPI.ActRunsPost(context.Background(), actorId).Body(body).Timeout(timeout).Memory(memory).MaxItems(maxItems).MaxTotalChargeUsd(maxTotalChargeUsd).RestartOnError(restartOnError).Build(build).WaitForFinish(waitForFinish).Webhooks(webhooks).ForcePermissionLevel(forcePermissionLevel).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ActorsActorRunsAPI.ActRunsPost``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ActRunsPost`: RunResponse + fmt.Fprintf(os.Stdout, "Response from `ActorsActorRunsAPI.ActRunsPost`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**actorId** | **string** | Actor ID or a tilde-separated owner's username and Actor name. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiActRunsPostRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **body** | **map[string]interface{}** | | + **timeout** | **float64** | Optional timeout for the run, in seconds. By default, the run uses the timeout from its configuration. | + **memory** | **float64** | Memory limit for the run, in megabytes. The amount of memory can be set to a power of 2 with a minimum of 128. By default, the run uses the memory limit from its configuration. | + **maxItems** | **float64** | Specifies the maximum number of dataset items that will be charged for pay-per-result Actors. This does NOT guarantee that the Actor will return only this many items. It only ensures you won't be charged for more than this number of items. Only works for pay-per-result Actors. Value can be accessed in the actor run using `ACTOR_MAX_PAID_DATASET_ITEMS` environment variable. | + **maxTotalChargeUsd** | **float64** | Specifies the maximum cost of the run. This parameter is useful for pay-per-event Actors, as it allows you to limit the amount charged to your subscription. You can access the maximum cost in your Actor by using the `ACTOR_MAX_TOTAL_CHARGE_USD` environment variable. | + **restartOnError** | **bool** | Determines whether the run will be restarted if it fails. | + **build** | **string** | Specifies the Actor build to run. It can be either a build tag or build number. By default, the run uses the build from its configuration (typically `latest`). | + **waitForFinish** | **float64** | The maximum number of seconds the server waits for the run to finish. By default it is `0`, the maximum value is `60`. <!-- MAX_ACTOR_JOB_ASYNC_WAIT_SECS --> If the run finishes in time then the returned run object will have a terminal status (e.g. `SUCCEEDED`), otherwise it will have a transitional status (e.g. `RUNNING`). | + **webhooks** | **string** | Specifies optional webhooks associated with the Actor run, which can be used to receive a notification e.g. when the Actor finished or failed. The value is a Base64-encoded JSON array whose items follow the WebhookRepresentation schema. For more information, see [Webhooks documentation](https://docs.apify.com/platform/integrations/webhooks). | + **forcePermissionLevel** | **string** | Overrides the Actor's permission level for this specific run. Use to test restricted permissions before deploying changes to your Actor or to temporarily elevate or restrict access. If you don't specify this parameter, the Actor uses its configured default permission level. For more information on permissions, see the [documentation](https://docs.apify.com/platform/actors/development/permissions). | + +### Return type + +[**RunResponse**](RunResponse.md) + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/docs/ActorsActorVersionsAPI.md b/docs/ActorsActorVersionsAPI.md new file mode 100644 index 0000000..6cedba0 --- /dev/null +++ b/docs/ActorsActorVersionsAPI.md @@ -0,0 +1,914 @@ +# \ActorsActorVersionsAPI + +All URIs are relative to *https://api.apify.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**ActVersionDelete**](ActorsActorVersionsAPI.md#ActVersionDelete) | **Delete** /v2/actors/{actorId}/versions/{versionNumber} | Delete version +[**ActVersionEnvVarDelete**](ActorsActorVersionsAPI.md#ActVersionEnvVarDelete) | **Delete** /v2/actors/{actorId}/versions/{versionNumber}/env-vars/{envVarName} | Delete environment variable +[**ActVersionEnvVarGet**](ActorsActorVersionsAPI.md#ActVersionEnvVarGet) | **Get** /v2/actors/{actorId}/versions/{versionNumber}/env-vars/{envVarName} | Get environment variable +[**ActVersionEnvVarPost**](ActorsActorVersionsAPI.md#ActVersionEnvVarPost) | **Post** /v2/actors/{actorId}/versions/{versionNumber}/env-vars/{envVarName} | Update environment variable (POST) +[**ActVersionEnvVarPut**](ActorsActorVersionsAPI.md#ActVersionEnvVarPut) | **Put** /v2/actors/{actorId}/versions/{versionNumber}/env-vars/{envVarName} | Update environment variable +[**ActVersionEnvVarsGet**](ActorsActorVersionsAPI.md#ActVersionEnvVarsGet) | **Get** /v2/actors/{actorId}/versions/{versionNumber}/env-vars | Get list of environment variables +[**ActVersionEnvVarsPost**](ActorsActorVersionsAPI.md#ActVersionEnvVarsPost) | **Post** /v2/actors/{actorId}/versions/{versionNumber}/env-vars | Create environment variable +[**ActVersionGet**](ActorsActorVersionsAPI.md#ActVersionGet) | **Get** /v2/actors/{actorId}/versions/{versionNumber} | Get version +[**ActVersionPost**](ActorsActorVersionsAPI.md#ActVersionPost) | **Post** /v2/actors/{actorId}/versions/{versionNumber} | Update version (POST) +[**ActVersionPut**](ActorsActorVersionsAPI.md#ActVersionPut) | **Put** /v2/actors/{actorId}/versions/{versionNumber} | Update version +[**ActVersionsGet**](ActorsActorVersionsAPI.md#ActVersionsGet) | **Get** /v2/actors/{actorId}/versions | Get list of versions +[**ActVersionsPost**](ActorsActorVersionsAPI.md#ActVersionsPost) | **Post** /v2/actors/{actorId}/versions | Create version + + + +## ActVersionDelete + +> map[string]interface{} ActVersionDelete(ctx, actorId, versionNumber).Execute() + +Delete version + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + actorId := "janedoe~my-actor" // string | Actor ID or a tilde-separated owner's username and Actor name. + versionNumber := "0.1" // string | Actor version. + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.ActorsActorVersionsAPI.ActVersionDelete(context.Background(), actorId, versionNumber).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ActorsActorVersionsAPI.ActVersionDelete``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ActVersionDelete`: map[string]interface{} + fmt.Fprintf(os.Stdout, "Response from `ActorsActorVersionsAPI.ActVersionDelete`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**actorId** | **string** | Actor ID or a tilde-separated owner's username and Actor name. | +**versionNumber** | **string** | Actor version. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiActVersionDeleteRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + +### Return type + +**map[string]interface{}** + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## ActVersionEnvVarDelete + +> map[string]interface{} ActVersionEnvVarDelete(ctx, actorId, versionNumber, envVarName).Execute() + +Delete environment variable + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + actorId := "janedoe~my-actor" // string | Actor ID or a tilde-separated owner's username and Actor name. + versionNumber := "0.1" // string | Actor version. + envVarName := "MY_ENV_VAR" // string | The name of the environment variable + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.ActorsActorVersionsAPI.ActVersionEnvVarDelete(context.Background(), actorId, versionNumber, envVarName).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ActorsActorVersionsAPI.ActVersionEnvVarDelete``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ActVersionEnvVarDelete`: map[string]interface{} + fmt.Fprintf(os.Stdout, "Response from `ActorsActorVersionsAPI.ActVersionEnvVarDelete`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**actorId** | **string** | Actor ID or a tilde-separated owner's username and Actor name. | +**versionNumber** | **string** | Actor version. | +**envVarName** | **string** | The name of the environment variable | + +### Other Parameters + +Other parameters are passed through a pointer to a apiActVersionEnvVarDeleteRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + + +### Return type + +**map[string]interface{}** + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## ActVersionEnvVarGet + +> EnvVarResponse ActVersionEnvVarGet(ctx, actorId, versionNumber, envVarName).Execute() + +Get environment variable + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + actorId := "janedoe~my-actor" // string | Actor ID or a tilde-separated owner's username and Actor name. + versionNumber := "0.1" // string | Actor version. + envVarName := "MY_ENV_VAR" // string | The name of the environment variable + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.ActorsActorVersionsAPI.ActVersionEnvVarGet(context.Background(), actorId, versionNumber, envVarName).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ActorsActorVersionsAPI.ActVersionEnvVarGet``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ActVersionEnvVarGet`: EnvVarResponse + fmt.Fprintf(os.Stdout, "Response from `ActorsActorVersionsAPI.ActVersionEnvVarGet`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**actorId** | **string** | Actor ID or a tilde-separated owner's username and Actor name. | +**versionNumber** | **string** | Actor version. | +**envVarName** | **string** | The name of the environment variable | + +### Other Parameters + +Other parameters are passed through a pointer to a apiActVersionEnvVarGetRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + + +### Return type + +[**EnvVarResponse**](EnvVarResponse.md) + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## ActVersionEnvVarPost + +> EnvVarResponse ActVersionEnvVarPost(ctx, actorId, versionNumber, envVarName).EnvVarRequest(envVarRequest).Execute() + +Update environment variable (POST) + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + actorId := "janedoe~my-actor" // string | Actor ID or a tilde-separated owner's username and Actor name. + versionNumber := "0.1" // string | Actor version. + envVarName := "MY_ENV_VAR" // string | The name of the environment variable + envVarRequest := *openapiclient.NewEnvVarRequest("Name_example") // EnvVarRequest | + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.ActorsActorVersionsAPI.ActVersionEnvVarPost(context.Background(), actorId, versionNumber, envVarName).EnvVarRequest(envVarRequest).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ActorsActorVersionsAPI.ActVersionEnvVarPost``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ActVersionEnvVarPost`: EnvVarResponse + fmt.Fprintf(os.Stdout, "Response from `ActorsActorVersionsAPI.ActVersionEnvVarPost`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**actorId** | **string** | Actor ID or a tilde-separated owner's username and Actor name. | +**versionNumber** | **string** | Actor version. | +**envVarName** | **string** | The name of the environment variable | + +### Other Parameters + +Other parameters are passed through a pointer to a apiActVersionEnvVarPostRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + + **envVarRequest** | [**EnvVarRequest**](EnvVarRequest.md) | | + +### Return type + +[**EnvVarResponse**](EnvVarResponse.md) + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## ActVersionEnvVarPut + +> EnvVarResponse ActVersionEnvVarPut(ctx, actorId, versionNumber, envVarName).EnvVarRequest(envVarRequest).Execute() + +Update environment variable + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + actorId := "janedoe~my-actor" // string | Actor ID or a tilde-separated owner's username and Actor name. + versionNumber := "0.1" // string | Actor version. + envVarName := "MY_ENV_VAR" // string | The name of the environment variable + envVarRequest := *openapiclient.NewEnvVarRequest("Name_example") // EnvVarRequest | + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.ActorsActorVersionsAPI.ActVersionEnvVarPut(context.Background(), actorId, versionNumber, envVarName).EnvVarRequest(envVarRequest).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ActorsActorVersionsAPI.ActVersionEnvVarPut``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ActVersionEnvVarPut`: EnvVarResponse + fmt.Fprintf(os.Stdout, "Response from `ActorsActorVersionsAPI.ActVersionEnvVarPut`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**actorId** | **string** | Actor ID or a tilde-separated owner's username and Actor name. | +**versionNumber** | **string** | Actor version. | +**envVarName** | **string** | The name of the environment variable | + +### Other Parameters + +Other parameters are passed through a pointer to a apiActVersionEnvVarPutRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + + **envVarRequest** | [**EnvVarRequest**](EnvVarRequest.md) | | + +### Return type + +[**EnvVarResponse**](EnvVarResponse.md) + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## ActVersionEnvVarsGet + +> ListOfEnvVarsResponse ActVersionEnvVarsGet(ctx, actorId, versionNumber).Execute() + +Get list of environment variables + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + actorId := "janedoe~my-actor" // string | Actor ID or a tilde-separated owner's username and Actor name. + versionNumber := "0.1" // string | Actor version. + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.ActorsActorVersionsAPI.ActVersionEnvVarsGet(context.Background(), actorId, versionNumber).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ActorsActorVersionsAPI.ActVersionEnvVarsGet``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ActVersionEnvVarsGet`: ListOfEnvVarsResponse + fmt.Fprintf(os.Stdout, "Response from `ActorsActorVersionsAPI.ActVersionEnvVarsGet`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**actorId** | **string** | Actor ID or a tilde-separated owner's username and Actor name. | +**versionNumber** | **string** | Actor version. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiActVersionEnvVarsGetRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + +### Return type + +[**ListOfEnvVarsResponse**](ListOfEnvVarsResponse.md) + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## ActVersionEnvVarsPost + +> EnvVarResponse ActVersionEnvVarsPost(ctx, actorId, versionNumber).EnvVarRequest(envVarRequest).Execute() + +Create environment variable + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + actorId := "janedoe~my-actor" // string | Actor ID or a tilde-separated owner's username and Actor name. + versionNumber := "0.1" // string | Actor version. + envVarRequest := *openapiclient.NewEnvVarRequest("Name_example") // EnvVarRequest | + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.ActorsActorVersionsAPI.ActVersionEnvVarsPost(context.Background(), actorId, versionNumber).EnvVarRequest(envVarRequest).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ActorsActorVersionsAPI.ActVersionEnvVarsPost``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ActVersionEnvVarsPost`: EnvVarResponse + fmt.Fprintf(os.Stdout, "Response from `ActorsActorVersionsAPI.ActVersionEnvVarsPost`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**actorId** | **string** | Actor ID or a tilde-separated owner's username and Actor name. | +**versionNumber** | **string** | Actor version. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiActVersionEnvVarsPostRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + **envVarRequest** | [**EnvVarRequest**](EnvVarRequest.md) | | + +### Return type + +[**EnvVarResponse**](EnvVarResponse.md) + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## ActVersionGet + +> VersionResponse ActVersionGet(ctx, actorId, versionNumber).Execute() + +Get version + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + actorId := "janedoe~my-actor" // string | Actor ID or a tilde-separated owner's username and Actor name. + versionNumber := "0.1" // string | Actor version. + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.ActorsActorVersionsAPI.ActVersionGet(context.Background(), actorId, versionNumber).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ActorsActorVersionsAPI.ActVersionGet``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ActVersionGet`: VersionResponse + fmt.Fprintf(os.Stdout, "Response from `ActorsActorVersionsAPI.ActVersionGet`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**actorId** | **string** | Actor ID or a tilde-separated owner's username and Actor name. | +**versionNumber** | **string** | Actor version. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiActVersionGetRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + +### Return type + +[**VersionResponse**](VersionResponse.md) + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## ActVersionPost + +> VersionResponse ActVersionPost(ctx, actorId, versionNumber).CreateOrUpdateVersionRequest(createOrUpdateVersionRequest).Execute() + +Update version (POST) + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + actorId := "janedoe~my-actor" // string | Actor ID or a tilde-separated owner's username and Actor name. + versionNumber := "0.1" // string | Actor version. + createOrUpdateVersionRequest := *openapiclient.NewCreateOrUpdateVersionRequest() // CreateOrUpdateVersionRequest | + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.ActorsActorVersionsAPI.ActVersionPost(context.Background(), actorId, versionNumber).CreateOrUpdateVersionRequest(createOrUpdateVersionRequest).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ActorsActorVersionsAPI.ActVersionPost``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ActVersionPost`: VersionResponse + fmt.Fprintf(os.Stdout, "Response from `ActorsActorVersionsAPI.ActVersionPost`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**actorId** | **string** | Actor ID or a tilde-separated owner's username and Actor name. | +**versionNumber** | **string** | Actor version. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiActVersionPostRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + **createOrUpdateVersionRequest** | [**CreateOrUpdateVersionRequest**](CreateOrUpdateVersionRequest.md) | | + +### Return type + +[**VersionResponse**](VersionResponse.md) + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## ActVersionPut + +> VersionResponse ActVersionPut(ctx, actorId, versionNumber).CreateOrUpdateVersionRequest(createOrUpdateVersionRequest).Execute() + +Update version + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + actorId := "janedoe~my-actor" // string | Actor ID or a tilde-separated owner's username and Actor name. + versionNumber := "0.1" // string | Actor version. + createOrUpdateVersionRequest := *openapiclient.NewCreateOrUpdateVersionRequest() // CreateOrUpdateVersionRequest | + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.ActorsActorVersionsAPI.ActVersionPut(context.Background(), actorId, versionNumber).CreateOrUpdateVersionRequest(createOrUpdateVersionRequest).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ActorsActorVersionsAPI.ActVersionPut``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ActVersionPut`: VersionResponse + fmt.Fprintf(os.Stdout, "Response from `ActorsActorVersionsAPI.ActVersionPut`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**actorId** | **string** | Actor ID or a tilde-separated owner's username and Actor name. | +**versionNumber** | **string** | Actor version. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiActVersionPutRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + **createOrUpdateVersionRequest** | [**CreateOrUpdateVersionRequest**](CreateOrUpdateVersionRequest.md) | | + +### Return type + +[**VersionResponse**](VersionResponse.md) + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## ActVersionsGet + +> ListOfVersionsResponse ActVersionsGet(ctx, actorId).Execute() + +Get list of versions + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + actorId := "janedoe~my-actor" // string | Actor ID or a tilde-separated owner's username and Actor name. + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.ActorsActorVersionsAPI.ActVersionsGet(context.Background(), actorId).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ActorsActorVersionsAPI.ActVersionsGet``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ActVersionsGet`: ListOfVersionsResponse + fmt.Fprintf(os.Stdout, "Response from `ActorsActorVersionsAPI.ActVersionsGet`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**actorId** | **string** | Actor ID or a tilde-separated owner's username and Actor name. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiActVersionsGetRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + +### Return type + +[**ListOfVersionsResponse**](ListOfVersionsResponse.md) + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## ActVersionsPost + +> VersionResponse ActVersionsPost(ctx, actorId).CreateOrUpdateVersionRequest(createOrUpdateVersionRequest).Execute() + +Create version + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + actorId := "janedoe~my-actor" // string | Actor ID or a tilde-separated owner's username and Actor name. + createOrUpdateVersionRequest := *openapiclient.NewCreateOrUpdateVersionRequest() // CreateOrUpdateVersionRequest | + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.ActorsActorVersionsAPI.ActVersionsPost(context.Background(), actorId).CreateOrUpdateVersionRequest(createOrUpdateVersionRequest).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ActorsActorVersionsAPI.ActVersionsPost``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ActVersionsPost`: VersionResponse + fmt.Fprintf(os.Stdout, "Response from `ActorsActorVersionsAPI.ActVersionsPost`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**actorId** | **string** | Actor ID or a tilde-separated owner's username and Actor name. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiActVersionsPostRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **createOrUpdateVersionRequest** | [**CreateOrUpdateVersionRequest**](CreateOrUpdateVersionRequest.md) | | + +### Return type + +[**VersionResponse**](VersionResponse.md) + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/docs/ActorsWebhookCollectionAPI.md b/docs/ActorsWebhookCollectionAPI.md new file mode 100644 index 0000000..49afb0d --- /dev/null +++ b/docs/ActorsWebhookCollectionAPI.md @@ -0,0 +1,85 @@ +# \ActorsWebhookCollectionAPI + +All URIs are relative to *https://api.apify.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**ActWebhooksGet**](ActorsWebhookCollectionAPI.md#ActWebhooksGet) | **Get** /v2/actors/{actorId}/webhooks | Get list of webhooks + + + +## ActWebhooksGet + +> ListOfWebhooksResponse ActWebhooksGet(ctx, actorId).Offset(offset).Limit(limit).Desc(desc).Execute() + +Get list of webhooks + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + actorId := "janedoe~my-actor" // string | Actor ID or a tilde-separated owner's username and Actor name. + offset := float64(0) // float64 | Number of items that should be skipped at the start. The default value is `0`. (optional) + limit := float64(1000) // float64 | Maximum number of items to return. The default value as well as the maximum is `1000`. (optional) + desc := true // bool | If `true` or `1` then the objects are sorted by the `createdAt` field in descending order. By default, they are sorted in ascending order. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.ActorsWebhookCollectionAPI.ActWebhooksGet(context.Background(), actorId).Offset(offset).Limit(limit).Desc(desc).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ActorsWebhookCollectionAPI.ActWebhooksGet``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ActWebhooksGet`: ListOfWebhooksResponse + fmt.Fprintf(os.Stdout, "Response from `ActorsWebhookCollectionAPI.ActWebhooksGet`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**actorId** | **string** | Actor ID or a tilde-separated owner's username and Actor name. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiActWebhooksGetRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **offset** | **float64** | Number of items that should be skipped at the start. The default value is `0`. | + **limit** | **float64** | Maximum number of items to return. The default value as well as the maximum is `1000`. | + **desc** | **bool** | If `true` or `1` then the objects are sorted by the `createdAt` field in descending order. By default, they are sorted in ascending order. | + +### Return type + +[**ListOfWebhooksResponse**](ListOfWebhooksResponse.md) + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/docs/AddRequestResponse.md b/docs/AddRequestResponse.md new file mode 100644 index 0000000..6c88213 --- /dev/null +++ b/docs/AddRequestResponse.md @@ -0,0 +1,51 @@ +# AddRequestResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Data** | [**RequestRegistration**](RequestRegistration.md) | | + +## Methods + +### NewAddRequestResponse + +`func NewAddRequestResponse(data RequestRegistration, ) *AddRequestResponse` + +NewAddRequestResponse instantiates a new AddRequestResponse object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewAddRequestResponseWithDefaults + +`func NewAddRequestResponseWithDefaults() *AddRequestResponse` + +NewAddRequestResponseWithDefaults instantiates a new AddRequestResponse object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetData + +`func (o *AddRequestResponse) GetData() RequestRegistration` + +GetData returns the Data field if non-nil, zero value otherwise. + +### GetDataOk + +`func (o *AddRequestResponse) GetDataOk() (*RequestRegistration, bool)` + +GetDataOk returns a tuple with the Data field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetData + +`func (o *AddRequestResponse) SetData(v RequestRegistration)` + +SetData sets Data field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/AddedRequest.md b/docs/AddedRequest.md new file mode 100644 index 0000000..4c82ec4 --- /dev/null +++ b/docs/AddedRequest.md @@ -0,0 +1,114 @@ +# AddedRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**RequestId** | **string** | A unique identifier assigned to the request. | +**UniqueKey** | **string** | A unique key used for request de-duplication. Requests with the same unique key are considered identical. | +**WasAlreadyPresent** | **bool** | Indicates whether a request with the same unique key already existed in the request queue. If true, no new request was created. | +**WasAlreadyHandled** | **bool** | Indicates whether a request with the same unique key has already been processed by the request queue. | + +## Methods + +### NewAddedRequest + +`func NewAddedRequest(requestId string, uniqueKey string, wasAlreadyPresent bool, wasAlreadyHandled bool, ) *AddedRequest` + +NewAddedRequest instantiates a new AddedRequest object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewAddedRequestWithDefaults + +`func NewAddedRequestWithDefaults() *AddedRequest` + +NewAddedRequestWithDefaults instantiates a new AddedRequest object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetRequestId + +`func (o *AddedRequest) GetRequestId() string` + +GetRequestId returns the RequestId field if non-nil, zero value otherwise. + +### GetRequestIdOk + +`func (o *AddedRequest) GetRequestIdOk() (*string, bool)` + +GetRequestIdOk returns a tuple with the RequestId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRequestId + +`func (o *AddedRequest) SetRequestId(v string)` + +SetRequestId sets RequestId field to given value. + + +### GetUniqueKey + +`func (o *AddedRequest) GetUniqueKey() string` + +GetUniqueKey returns the UniqueKey field if non-nil, zero value otherwise. + +### GetUniqueKeyOk + +`func (o *AddedRequest) GetUniqueKeyOk() (*string, bool)` + +GetUniqueKeyOk returns a tuple with the UniqueKey field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUniqueKey + +`func (o *AddedRequest) SetUniqueKey(v string)` + +SetUniqueKey sets UniqueKey field to given value. + + +### GetWasAlreadyPresent + +`func (o *AddedRequest) GetWasAlreadyPresent() bool` + +GetWasAlreadyPresent returns the WasAlreadyPresent field if non-nil, zero value otherwise. + +### GetWasAlreadyPresentOk + +`func (o *AddedRequest) GetWasAlreadyPresentOk() (*bool, bool)` + +GetWasAlreadyPresentOk returns a tuple with the WasAlreadyPresent field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetWasAlreadyPresent + +`func (o *AddedRequest) SetWasAlreadyPresent(v bool)` + +SetWasAlreadyPresent sets WasAlreadyPresent field to given value. + + +### GetWasAlreadyHandled + +`func (o *AddedRequest) GetWasAlreadyHandled() bool` + +GetWasAlreadyHandled returns the WasAlreadyHandled field if non-nil, zero value otherwise. + +### GetWasAlreadyHandledOk + +`func (o *AddedRequest) GetWasAlreadyHandledOk() (*bool, bool)` + +GetWasAlreadyHandledOk returns a tuple with the WasAlreadyHandled field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetWasAlreadyHandled + +`func (o *AddedRequest) SetWasAlreadyHandled(v bool)` + +SetWasAlreadyHandled sets WasAlreadyHandled field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/BatchAddResponse.md b/docs/BatchAddResponse.md new file mode 100644 index 0000000..fc57018 --- /dev/null +++ b/docs/BatchAddResponse.md @@ -0,0 +1,51 @@ +# BatchAddResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Data** | [**BatchAddResult**](BatchAddResult.md) | | + +## Methods + +### NewBatchAddResponse + +`func NewBatchAddResponse(data BatchAddResult, ) *BatchAddResponse` + +NewBatchAddResponse instantiates a new BatchAddResponse object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewBatchAddResponseWithDefaults + +`func NewBatchAddResponseWithDefaults() *BatchAddResponse` + +NewBatchAddResponseWithDefaults instantiates a new BatchAddResponse object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetData + +`func (o *BatchAddResponse) GetData() BatchAddResult` + +GetData returns the Data field if non-nil, zero value otherwise. + +### GetDataOk + +`func (o *BatchAddResponse) GetDataOk() (*BatchAddResult, bool)` + +GetDataOk returns a tuple with the Data field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetData + +`func (o *BatchAddResponse) SetData(v BatchAddResult)` + +SetData sets Data field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/BatchAddResult.md b/docs/BatchAddResult.md new file mode 100644 index 0000000..30667ce --- /dev/null +++ b/docs/BatchAddResult.md @@ -0,0 +1,72 @@ +# BatchAddResult + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ProcessedRequests** | [**[]AddedRequest**](AddedRequest.md) | Requests that were successfully added to the request queue. | +**UnprocessedRequests** | [**[]RequestDraft**](RequestDraft.md) | Requests that failed to be added and can be retried. | + +## Methods + +### NewBatchAddResult + +`func NewBatchAddResult(processedRequests []AddedRequest, unprocessedRequests []RequestDraft, ) *BatchAddResult` + +NewBatchAddResult instantiates a new BatchAddResult object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewBatchAddResultWithDefaults + +`func NewBatchAddResultWithDefaults() *BatchAddResult` + +NewBatchAddResultWithDefaults instantiates a new BatchAddResult object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetProcessedRequests + +`func (o *BatchAddResult) GetProcessedRequests() []AddedRequest` + +GetProcessedRequests returns the ProcessedRequests field if non-nil, zero value otherwise. + +### GetProcessedRequestsOk + +`func (o *BatchAddResult) GetProcessedRequestsOk() (*[]AddedRequest, bool)` + +GetProcessedRequestsOk returns a tuple with the ProcessedRequests field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetProcessedRequests + +`func (o *BatchAddResult) SetProcessedRequests(v []AddedRequest)` + +SetProcessedRequests sets ProcessedRequests field to given value. + + +### GetUnprocessedRequests + +`func (o *BatchAddResult) GetUnprocessedRequests() []RequestDraft` + +GetUnprocessedRequests returns the UnprocessedRequests field if non-nil, zero value otherwise. + +### GetUnprocessedRequestsOk + +`func (o *BatchAddResult) GetUnprocessedRequestsOk() (*[]RequestDraft, bool)` + +GetUnprocessedRequestsOk returns a tuple with the UnprocessedRequests field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUnprocessedRequests + +`func (o *BatchAddResult) SetUnprocessedRequests(v []RequestDraft)` + +SetUnprocessedRequests sets UnprocessedRequests field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/BatchDeleteResponse.md b/docs/BatchDeleteResponse.md new file mode 100644 index 0000000..2191e91 --- /dev/null +++ b/docs/BatchDeleteResponse.md @@ -0,0 +1,51 @@ +# BatchDeleteResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Data** | [**BatchDeleteResult**](BatchDeleteResult.md) | | + +## Methods + +### NewBatchDeleteResponse + +`func NewBatchDeleteResponse(data BatchDeleteResult, ) *BatchDeleteResponse` + +NewBatchDeleteResponse instantiates a new BatchDeleteResponse object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewBatchDeleteResponseWithDefaults + +`func NewBatchDeleteResponseWithDefaults() *BatchDeleteResponse` + +NewBatchDeleteResponseWithDefaults instantiates a new BatchDeleteResponse object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetData + +`func (o *BatchDeleteResponse) GetData() BatchDeleteResult` + +GetData returns the Data field if non-nil, zero value otherwise. + +### GetDataOk + +`func (o *BatchDeleteResponse) GetDataOk() (*BatchDeleteResult, bool)` + +GetDataOk returns a tuple with the Data field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetData + +`func (o *BatchDeleteResponse) SetData(v BatchDeleteResult)` + +SetData sets Data field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/BatchDeleteResult.md b/docs/BatchDeleteResult.md new file mode 100644 index 0000000..9b5ce9e --- /dev/null +++ b/docs/BatchDeleteResult.md @@ -0,0 +1,72 @@ +# BatchDeleteResult + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ProcessedRequests** | [**[]DeletedRequest**](DeletedRequest.md) | Requests that were successfully deleted from the request queue. | +**UnprocessedRequests** | [**[]RequestDraft**](RequestDraft.md) | Requests that failed to be deleted and can be retried. | + +## Methods + +### NewBatchDeleteResult + +`func NewBatchDeleteResult(processedRequests []DeletedRequest, unprocessedRequests []RequestDraft, ) *BatchDeleteResult` + +NewBatchDeleteResult instantiates a new BatchDeleteResult object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewBatchDeleteResultWithDefaults + +`func NewBatchDeleteResultWithDefaults() *BatchDeleteResult` + +NewBatchDeleteResultWithDefaults instantiates a new BatchDeleteResult object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetProcessedRequests + +`func (o *BatchDeleteResult) GetProcessedRequests() []DeletedRequest` + +GetProcessedRequests returns the ProcessedRequests field if non-nil, zero value otherwise. + +### GetProcessedRequestsOk + +`func (o *BatchDeleteResult) GetProcessedRequestsOk() (*[]DeletedRequest, bool)` + +GetProcessedRequestsOk returns a tuple with the ProcessedRequests field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetProcessedRequests + +`func (o *BatchDeleteResult) SetProcessedRequests(v []DeletedRequest)` + +SetProcessedRequests sets ProcessedRequests field to given value. + + +### GetUnprocessedRequests + +`func (o *BatchDeleteResult) GetUnprocessedRequests() []RequestDraft` + +GetUnprocessedRequests returns the UnprocessedRequests field if non-nil, zero value otherwise. + +### GetUnprocessedRequestsOk + +`func (o *BatchDeleteResult) GetUnprocessedRequestsOk() (*[]RequestDraft, bool)` + +GetUnprocessedRequestsOk returns a tuple with the UnprocessedRequests field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUnprocessedRequests + +`func (o *BatchDeleteResult) SetUnprocessedRequests(v []RequestDraft)` + +SetUnprocessedRequests sets UnprocessedRequests field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/BrowserInfoResponse.md b/docs/BrowserInfoResponse.md new file mode 100644 index 0000000..babc5d0 --- /dev/null +++ b/docs/BrowserInfoResponse.md @@ -0,0 +1,186 @@ +# BrowserInfoResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Method** | **string** | HTTP method of the request. | +**ClientIp** | **NullableString** | IP address of the client. | +**CountryCode** | **NullableString** | Two-letter country code resolved from the client IP address. | +**BodyLength** | **int32** | Length of the request body in bytes. | +**Headers** | Pointer to [**map[string]BrowserInfoResponseHeadersValue**](BrowserInfoResponseHeadersValue.md) | Request headers. Omitted when `skipHeaders=true`. | [optional] +**RawHeaders** | Pointer to **[]string** | Raw request headers as a flat list of alternating name/value strings. Included only when `rawHeaders=true`. | [optional] + +## Methods + +### NewBrowserInfoResponse + +`func NewBrowserInfoResponse(method string, clientIp NullableString, countryCode NullableString, bodyLength int32, ) *BrowserInfoResponse` + +NewBrowserInfoResponse instantiates a new BrowserInfoResponse object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewBrowserInfoResponseWithDefaults + +`func NewBrowserInfoResponseWithDefaults() *BrowserInfoResponse` + +NewBrowserInfoResponseWithDefaults instantiates a new BrowserInfoResponse object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetMethod + +`func (o *BrowserInfoResponse) GetMethod() string` + +GetMethod returns the Method field if non-nil, zero value otherwise. + +### GetMethodOk + +`func (o *BrowserInfoResponse) GetMethodOk() (*string, bool)` + +GetMethodOk returns a tuple with the Method field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMethod + +`func (o *BrowserInfoResponse) SetMethod(v string)` + +SetMethod sets Method field to given value. + + +### GetClientIp + +`func (o *BrowserInfoResponse) GetClientIp() string` + +GetClientIp returns the ClientIp field if non-nil, zero value otherwise. + +### GetClientIpOk + +`func (o *BrowserInfoResponse) GetClientIpOk() (*string, bool)` + +GetClientIpOk returns a tuple with the ClientIp field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetClientIp + +`func (o *BrowserInfoResponse) SetClientIp(v string)` + +SetClientIp sets ClientIp field to given value. + + +### SetClientIpNil + +`func (o *BrowserInfoResponse) SetClientIpNil(b bool)` + + SetClientIpNil sets the value for ClientIp to be an explicit nil + +### UnsetClientIp +`func (o *BrowserInfoResponse) UnsetClientIp()` + +UnsetClientIp ensures that no value is present for ClientIp, not even an explicit nil +### GetCountryCode + +`func (o *BrowserInfoResponse) GetCountryCode() string` + +GetCountryCode returns the CountryCode field if non-nil, zero value otherwise. + +### GetCountryCodeOk + +`func (o *BrowserInfoResponse) GetCountryCodeOk() (*string, bool)` + +GetCountryCodeOk returns a tuple with the CountryCode field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCountryCode + +`func (o *BrowserInfoResponse) SetCountryCode(v string)` + +SetCountryCode sets CountryCode field to given value. + + +### SetCountryCodeNil + +`func (o *BrowserInfoResponse) SetCountryCodeNil(b bool)` + + SetCountryCodeNil sets the value for CountryCode to be an explicit nil + +### UnsetCountryCode +`func (o *BrowserInfoResponse) UnsetCountryCode()` + +UnsetCountryCode ensures that no value is present for CountryCode, not even an explicit nil +### GetBodyLength + +`func (o *BrowserInfoResponse) GetBodyLength() int32` + +GetBodyLength returns the BodyLength field if non-nil, zero value otherwise. + +### GetBodyLengthOk + +`func (o *BrowserInfoResponse) GetBodyLengthOk() (*int32, bool)` + +GetBodyLengthOk returns a tuple with the BodyLength field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetBodyLength + +`func (o *BrowserInfoResponse) SetBodyLength(v int32)` + +SetBodyLength sets BodyLength field to given value. + + +### GetHeaders + +`func (o *BrowserInfoResponse) GetHeaders() map[string]BrowserInfoResponseHeadersValue` + +GetHeaders returns the Headers field if non-nil, zero value otherwise. + +### GetHeadersOk + +`func (o *BrowserInfoResponse) GetHeadersOk() (*map[string]BrowserInfoResponseHeadersValue, bool)` + +GetHeadersOk returns a tuple with the Headers field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetHeaders + +`func (o *BrowserInfoResponse) SetHeaders(v map[string]BrowserInfoResponseHeadersValue)` + +SetHeaders sets Headers field to given value. + +### HasHeaders + +`func (o *BrowserInfoResponse) HasHeaders() bool` + +HasHeaders returns a boolean if a field has been set. + +### GetRawHeaders + +`func (o *BrowserInfoResponse) GetRawHeaders() []string` + +GetRawHeaders returns the RawHeaders field if non-nil, zero value otherwise. + +### GetRawHeadersOk + +`func (o *BrowserInfoResponse) GetRawHeadersOk() (*[]string, bool)` + +GetRawHeadersOk returns a tuple with the RawHeaders field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRawHeaders + +`func (o *BrowserInfoResponse) SetRawHeaders(v []string)` + +SetRawHeaders sets RawHeaders field to given value. + +### HasRawHeaders + +`func (o *BrowserInfoResponse) HasRawHeaders() bool` + +HasRawHeaders returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/BrowserInfoResponseHeadersValue.md b/docs/BrowserInfoResponseHeadersValue.md new file mode 100644 index 0000000..0a4be4c --- /dev/null +++ b/docs/BrowserInfoResponseHeadersValue.md @@ -0,0 +1,30 @@ +# BrowserInfoResponseHeadersValue + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +## Methods + +### NewBrowserInfoResponseHeadersValue + +`func NewBrowserInfoResponseHeadersValue() *BrowserInfoResponseHeadersValue` + +NewBrowserInfoResponseHeadersValue instantiates a new BrowserInfoResponseHeadersValue object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewBrowserInfoResponseHeadersValueWithDefaults + +`func NewBrowserInfoResponseHeadersValueWithDefaults() *BrowserInfoResponseHeadersValue` + +NewBrowserInfoResponseHeadersValueWithDefaults instantiates a new BrowserInfoResponseHeadersValue object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/Build.md b/docs/Build.md new file mode 100644 index 0000000..a10ccdc --- /dev/null +++ b/docs/Build.md @@ -0,0 +1,527 @@ +# Build + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **string** | | +**ActId** | **string** | | +**UserId** | **string** | | +**StartedAt** | **time.Time** | | +**FinishedAt** | Pointer to **NullableTime** | | [optional] +**Status** | [**ActorJobStatus**](ActorJobStatus.md) | | +**Meta** | [**BuildsMeta**](BuildsMeta.md) | | +**Stats** | Pointer to [**NullableBuildStats**](BuildStats.md) | | [optional] +**Options** | Pointer to [**NullableBuildOptions**](BuildOptions.md) | | [optional] +**Usage** | Pointer to [**NullableBuildUsage**](BuildUsage.md) | | [optional] +**UsageTotalUsd** | Pointer to **NullableFloat32** | Total cost in USD for this build. Requires authentication token to access. | [optional] +**UsageUsd** | Pointer to [**NullableBuildUsage**](BuildUsage.md) | Platform usage costs breakdown in USD for this build. Requires authentication token to access. | [optional] +**InputSchema** | Pointer to **NullableString** | | [optional] +**Readme** | Pointer to **NullableString** | | [optional] +**BuildNumber** | **string** | | +**ActVersion** | Pointer to [**BuildActVersion**](BuildActVersion.md) | | [optional] +**ActorDefinition** | Pointer to [**NullableActorDefinition**](ActorDefinition.md) | | [optional] + +## Methods + +### NewBuild + +`func NewBuild(id string, actId string, userId string, startedAt time.Time, status ActorJobStatus, meta BuildsMeta, buildNumber string, ) *Build` + +NewBuild instantiates a new Build object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewBuildWithDefaults + +`func NewBuildWithDefaults() *Build` + +NewBuildWithDefaults instantiates a new Build object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetId + +`func (o *Build) GetId() string` + +GetId returns the Id field if non-nil, zero value otherwise. + +### GetIdOk + +`func (o *Build) GetIdOk() (*string, bool)` + +GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetId + +`func (o *Build) SetId(v string)` + +SetId sets Id field to given value. + + +### GetActId + +`func (o *Build) GetActId() string` + +GetActId returns the ActId field if non-nil, zero value otherwise. + +### GetActIdOk + +`func (o *Build) GetActIdOk() (*string, bool)` + +GetActIdOk returns a tuple with the ActId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetActId + +`func (o *Build) SetActId(v string)` + +SetActId sets ActId field to given value. + + +### GetUserId + +`func (o *Build) GetUserId() string` + +GetUserId returns the UserId field if non-nil, zero value otherwise. + +### GetUserIdOk + +`func (o *Build) GetUserIdOk() (*string, bool)` + +GetUserIdOk returns a tuple with the UserId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUserId + +`func (o *Build) SetUserId(v string)` + +SetUserId sets UserId field to given value. + + +### GetStartedAt + +`func (o *Build) GetStartedAt() time.Time` + +GetStartedAt returns the StartedAt field if non-nil, zero value otherwise. + +### GetStartedAtOk + +`func (o *Build) GetStartedAtOk() (*time.Time, bool)` + +GetStartedAtOk returns a tuple with the StartedAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetStartedAt + +`func (o *Build) SetStartedAt(v time.Time)` + +SetStartedAt sets StartedAt field to given value. + + +### GetFinishedAt + +`func (o *Build) GetFinishedAt() time.Time` + +GetFinishedAt returns the FinishedAt field if non-nil, zero value otherwise. + +### GetFinishedAtOk + +`func (o *Build) GetFinishedAtOk() (*time.Time, bool)` + +GetFinishedAtOk returns a tuple with the FinishedAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetFinishedAt + +`func (o *Build) SetFinishedAt(v time.Time)` + +SetFinishedAt sets FinishedAt field to given value. + +### HasFinishedAt + +`func (o *Build) HasFinishedAt() bool` + +HasFinishedAt returns a boolean if a field has been set. + +### SetFinishedAtNil + +`func (o *Build) SetFinishedAtNil(b bool)` + + SetFinishedAtNil sets the value for FinishedAt to be an explicit nil + +### UnsetFinishedAt +`func (o *Build) UnsetFinishedAt()` + +UnsetFinishedAt ensures that no value is present for FinishedAt, not even an explicit nil +### GetStatus + +`func (o *Build) GetStatus() ActorJobStatus` + +GetStatus returns the Status field if non-nil, zero value otherwise. + +### GetStatusOk + +`func (o *Build) GetStatusOk() (*ActorJobStatus, bool)` + +GetStatusOk returns a tuple with the Status field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetStatus + +`func (o *Build) SetStatus(v ActorJobStatus)` + +SetStatus sets Status field to given value. + + +### GetMeta + +`func (o *Build) GetMeta() BuildsMeta` + +GetMeta returns the Meta field if non-nil, zero value otherwise. + +### GetMetaOk + +`func (o *Build) GetMetaOk() (*BuildsMeta, bool)` + +GetMetaOk returns a tuple with the Meta field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMeta + +`func (o *Build) SetMeta(v BuildsMeta)` + +SetMeta sets Meta field to given value. + + +### GetStats + +`func (o *Build) GetStats() BuildStats` + +GetStats returns the Stats field if non-nil, zero value otherwise. + +### GetStatsOk + +`func (o *Build) GetStatsOk() (*BuildStats, bool)` + +GetStatsOk returns a tuple with the Stats field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetStats + +`func (o *Build) SetStats(v BuildStats)` + +SetStats sets Stats field to given value. + +### HasStats + +`func (o *Build) HasStats() bool` + +HasStats returns a boolean if a field has been set. + +### SetStatsNil + +`func (o *Build) SetStatsNil(b bool)` + + SetStatsNil sets the value for Stats to be an explicit nil + +### UnsetStats +`func (o *Build) UnsetStats()` + +UnsetStats ensures that no value is present for Stats, not even an explicit nil +### GetOptions + +`func (o *Build) GetOptions() BuildOptions` + +GetOptions returns the Options field if non-nil, zero value otherwise. + +### GetOptionsOk + +`func (o *Build) GetOptionsOk() (*BuildOptions, bool)` + +GetOptionsOk returns a tuple with the Options field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetOptions + +`func (o *Build) SetOptions(v BuildOptions)` + +SetOptions sets Options field to given value. + +### HasOptions + +`func (o *Build) HasOptions() bool` + +HasOptions returns a boolean if a field has been set. + +### SetOptionsNil + +`func (o *Build) SetOptionsNil(b bool)` + + SetOptionsNil sets the value for Options to be an explicit nil + +### UnsetOptions +`func (o *Build) UnsetOptions()` + +UnsetOptions ensures that no value is present for Options, not even an explicit nil +### GetUsage + +`func (o *Build) GetUsage() BuildUsage` + +GetUsage returns the Usage field if non-nil, zero value otherwise. + +### GetUsageOk + +`func (o *Build) GetUsageOk() (*BuildUsage, bool)` + +GetUsageOk returns a tuple with the Usage field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUsage + +`func (o *Build) SetUsage(v BuildUsage)` + +SetUsage sets Usage field to given value. + +### HasUsage + +`func (o *Build) HasUsage() bool` + +HasUsage returns a boolean if a field has been set. + +### SetUsageNil + +`func (o *Build) SetUsageNil(b bool)` + + SetUsageNil sets the value for Usage to be an explicit nil + +### UnsetUsage +`func (o *Build) UnsetUsage()` + +UnsetUsage ensures that no value is present for Usage, not even an explicit nil +### GetUsageTotalUsd + +`func (o *Build) GetUsageTotalUsd() float32` + +GetUsageTotalUsd returns the UsageTotalUsd field if non-nil, zero value otherwise. + +### GetUsageTotalUsdOk + +`func (o *Build) GetUsageTotalUsdOk() (*float32, bool)` + +GetUsageTotalUsdOk returns a tuple with the UsageTotalUsd field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUsageTotalUsd + +`func (o *Build) SetUsageTotalUsd(v float32)` + +SetUsageTotalUsd sets UsageTotalUsd field to given value. + +### HasUsageTotalUsd + +`func (o *Build) HasUsageTotalUsd() bool` + +HasUsageTotalUsd returns a boolean if a field has been set. + +### SetUsageTotalUsdNil + +`func (o *Build) SetUsageTotalUsdNil(b bool)` + + SetUsageTotalUsdNil sets the value for UsageTotalUsd to be an explicit nil + +### UnsetUsageTotalUsd +`func (o *Build) UnsetUsageTotalUsd()` + +UnsetUsageTotalUsd ensures that no value is present for UsageTotalUsd, not even an explicit nil +### GetUsageUsd + +`func (o *Build) GetUsageUsd() BuildUsage` + +GetUsageUsd returns the UsageUsd field if non-nil, zero value otherwise. + +### GetUsageUsdOk + +`func (o *Build) GetUsageUsdOk() (*BuildUsage, bool)` + +GetUsageUsdOk returns a tuple with the UsageUsd field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUsageUsd + +`func (o *Build) SetUsageUsd(v BuildUsage)` + +SetUsageUsd sets UsageUsd field to given value. + +### HasUsageUsd + +`func (o *Build) HasUsageUsd() bool` + +HasUsageUsd returns a boolean if a field has been set. + +### SetUsageUsdNil + +`func (o *Build) SetUsageUsdNil(b bool)` + + SetUsageUsdNil sets the value for UsageUsd to be an explicit nil + +### UnsetUsageUsd +`func (o *Build) UnsetUsageUsd()` + +UnsetUsageUsd ensures that no value is present for UsageUsd, not even an explicit nil +### GetInputSchema + +`func (o *Build) GetInputSchema() string` + +GetInputSchema returns the InputSchema field if non-nil, zero value otherwise. + +### GetInputSchemaOk + +`func (o *Build) GetInputSchemaOk() (*string, bool)` + +GetInputSchemaOk returns a tuple with the InputSchema field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetInputSchema + +`func (o *Build) SetInputSchema(v string)` + +SetInputSchema sets InputSchema field to given value. + +### HasInputSchema + +`func (o *Build) HasInputSchema() bool` + +HasInputSchema returns a boolean if a field has been set. + +### SetInputSchemaNil + +`func (o *Build) SetInputSchemaNil(b bool)` + + SetInputSchemaNil sets the value for InputSchema to be an explicit nil + +### UnsetInputSchema +`func (o *Build) UnsetInputSchema()` + +UnsetInputSchema ensures that no value is present for InputSchema, not even an explicit nil +### GetReadme + +`func (o *Build) GetReadme() string` + +GetReadme returns the Readme field if non-nil, zero value otherwise. + +### GetReadmeOk + +`func (o *Build) GetReadmeOk() (*string, bool)` + +GetReadmeOk returns a tuple with the Readme field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetReadme + +`func (o *Build) SetReadme(v string)` + +SetReadme sets Readme field to given value. + +### HasReadme + +`func (o *Build) HasReadme() bool` + +HasReadme returns a boolean if a field has been set. + +### SetReadmeNil + +`func (o *Build) SetReadmeNil(b bool)` + + SetReadmeNil sets the value for Readme to be an explicit nil + +### UnsetReadme +`func (o *Build) UnsetReadme()` + +UnsetReadme ensures that no value is present for Readme, not even an explicit nil +### GetBuildNumber + +`func (o *Build) GetBuildNumber() string` + +GetBuildNumber returns the BuildNumber field if non-nil, zero value otherwise. + +### GetBuildNumberOk + +`func (o *Build) GetBuildNumberOk() (*string, bool)` + +GetBuildNumberOk returns a tuple with the BuildNumber field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetBuildNumber + +`func (o *Build) SetBuildNumber(v string)` + +SetBuildNumber sets BuildNumber field to given value. + + +### GetActVersion + +`func (o *Build) GetActVersion() BuildActVersion` + +GetActVersion returns the ActVersion field if non-nil, zero value otherwise. + +### GetActVersionOk + +`func (o *Build) GetActVersionOk() (*BuildActVersion, bool)` + +GetActVersionOk returns a tuple with the ActVersion field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetActVersion + +`func (o *Build) SetActVersion(v BuildActVersion)` + +SetActVersion sets ActVersion field to given value. + +### HasActVersion + +`func (o *Build) HasActVersion() bool` + +HasActVersion returns a boolean if a field has been set. + +### GetActorDefinition + +`func (o *Build) GetActorDefinition() ActorDefinition` + +GetActorDefinition returns the ActorDefinition field if non-nil, zero value otherwise. + +### GetActorDefinitionOk + +`func (o *Build) GetActorDefinitionOk() (*ActorDefinition, bool)` + +GetActorDefinitionOk returns a tuple with the ActorDefinition field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetActorDefinition + +`func (o *Build) SetActorDefinition(v ActorDefinition)` + +SetActorDefinition sets ActorDefinition field to given value. + +### HasActorDefinition + +`func (o *Build) HasActorDefinition() bool` + +HasActorDefinition returns a boolean if a field has been set. + +### SetActorDefinitionNil + +`func (o *Build) SetActorDefinitionNil(b bool)` + + SetActorDefinitionNil sets the value for ActorDefinition to be an explicit nil + +### UnsetActorDefinition +`func (o *Build) UnsetActorDefinition()` + +UnsetActorDefinition ensures that no value is present for ActorDefinition, not even an explicit nil + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/BuildActVersion.md b/docs/BuildActVersion.md new file mode 100644 index 0000000..cb83952 --- /dev/null +++ b/docs/BuildActVersion.md @@ -0,0 +1,160 @@ +# BuildActVersion + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**SourceType** | Pointer to [**VersionSourceType**](VersionSourceType.md) | | [optional] +**BuildTag** | Pointer to **string** | | [optional] +**VersionNumber** | Pointer to **string** | | [optional] +**GitRepoUrl** | Pointer to **string** | URL of the git repository, present when sourceType is GIT_REPO. | [optional] +**SourceFiles** | Pointer to [**[]SourceCodeFile**](SourceCodeFile.md) | Inline source files, present when sourceType is SOURCE_FILES. | [optional] + +## Methods + +### NewBuildActVersion + +`func NewBuildActVersion() *BuildActVersion` + +NewBuildActVersion instantiates a new BuildActVersion object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewBuildActVersionWithDefaults + +`func NewBuildActVersionWithDefaults() *BuildActVersion` + +NewBuildActVersionWithDefaults instantiates a new BuildActVersion object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetSourceType + +`func (o *BuildActVersion) GetSourceType() VersionSourceType` + +GetSourceType returns the SourceType field if non-nil, zero value otherwise. + +### GetSourceTypeOk + +`func (o *BuildActVersion) GetSourceTypeOk() (*VersionSourceType, bool)` + +GetSourceTypeOk returns a tuple with the SourceType field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSourceType + +`func (o *BuildActVersion) SetSourceType(v VersionSourceType)` + +SetSourceType sets SourceType field to given value. + +### HasSourceType + +`func (o *BuildActVersion) HasSourceType() bool` + +HasSourceType returns a boolean if a field has been set. + +### GetBuildTag + +`func (o *BuildActVersion) GetBuildTag() string` + +GetBuildTag returns the BuildTag field if non-nil, zero value otherwise. + +### GetBuildTagOk + +`func (o *BuildActVersion) GetBuildTagOk() (*string, bool)` + +GetBuildTagOk returns a tuple with the BuildTag field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetBuildTag + +`func (o *BuildActVersion) SetBuildTag(v string)` + +SetBuildTag sets BuildTag field to given value. + +### HasBuildTag + +`func (o *BuildActVersion) HasBuildTag() bool` + +HasBuildTag returns a boolean if a field has been set. + +### GetVersionNumber + +`func (o *BuildActVersion) GetVersionNumber() string` + +GetVersionNumber returns the VersionNumber field if non-nil, zero value otherwise. + +### GetVersionNumberOk + +`func (o *BuildActVersion) GetVersionNumberOk() (*string, bool)` + +GetVersionNumberOk returns a tuple with the VersionNumber field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetVersionNumber + +`func (o *BuildActVersion) SetVersionNumber(v string)` + +SetVersionNumber sets VersionNumber field to given value. + +### HasVersionNumber + +`func (o *BuildActVersion) HasVersionNumber() bool` + +HasVersionNumber returns a boolean if a field has been set. + +### GetGitRepoUrl + +`func (o *BuildActVersion) GetGitRepoUrl() string` + +GetGitRepoUrl returns the GitRepoUrl field if non-nil, zero value otherwise. + +### GetGitRepoUrlOk + +`func (o *BuildActVersion) GetGitRepoUrlOk() (*string, bool)` + +GetGitRepoUrlOk returns a tuple with the GitRepoUrl field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetGitRepoUrl + +`func (o *BuildActVersion) SetGitRepoUrl(v string)` + +SetGitRepoUrl sets GitRepoUrl field to given value. + +### HasGitRepoUrl + +`func (o *BuildActVersion) HasGitRepoUrl() bool` + +HasGitRepoUrl returns a boolean if a field has been set. + +### GetSourceFiles + +`func (o *BuildActVersion) GetSourceFiles() []SourceCodeFile` + +GetSourceFiles returns the SourceFiles field if non-nil, zero value otherwise. + +### GetSourceFilesOk + +`func (o *BuildActVersion) GetSourceFilesOk() (*[]SourceCodeFile, bool)` + +GetSourceFilesOk returns a tuple with the SourceFiles field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSourceFiles + +`func (o *BuildActVersion) SetSourceFiles(v []SourceCodeFile)` + +SetSourceFiles sets SourceFiles field to given value. + +### HasSourceFiles + +`func (o *BuildActVersion) HasSourceFiles() bool` + +HasSourceFiles returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/BuildOptions.md b/docs/BuildOptions.md new file mode 100644 index 0000000..152c405 --- /dev/null +++ b/docs/BuildOptions.md @@ -0,0 +1,174 @@ +# BuildOptions + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**UseCache** | Pointer to **NullableBool** | | [optional] +**BetaPackages** | Pointer to **NullableBool** | | [optional] +**MemoryMbytes** | Pointer to **NullableInt32** | | [optional] +**DiskMbytes** | Pointer to **NullableInt32** | | [optional] + +## Methods + +### NewBuildOptions + +`func NewBuildOptions() *BuildOptions` + +NewBuildOptions instantiates a new BuildOptions object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewBuildOptionsWithDefaults + +`func NewBuildOptionsWithDefaults() *BuildOptions` + +NewBuildOptionsWithDefaults instantiates a new BuildOptions object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetUseCache + +`func (o *BuildOptions) GetUseCache() bool` + +GetUseCache returns the UseCache field if non-nil, zero value otherwise. + +### GetUseCacheOk + +`func (o *BuildOptions) GetUseCacheOk() (*bool, bool)` + +GetUseCacheOk returns a tuple with the UseCache field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUseCache + +`func (o *BuildOptions) SetUseCache(v bool)` + +SetUseCache sets UseCache field to given value. + +### HasUseCache + +`func (o *BuildOptions) HasUseCache() bool` + +HasUseCache returns a boolean if a field has been set. + +### SetUseCacheNil + +`func (o *BuildOptions) SetUseCacheNil(b bool)` + + SetUseCacheNil sets the value for UseCache to be an explicit nil + +### UnsetUseCache +`func (o *BuildOptions) UnsetUseCache()` + +UnsetUseCache ensures that no value is present for UseCache, not even an explicit nil +### GetBetaPackages + +`func (o *BuildOptions) GetBetaPackages() bool` + +GetBetaPackages returns the BetaPackages field if non-nil, zero value otherwise. + +### GetBetaPackagesOk + +`func (o *BuildOptions) GetBetaPackagesOk() (*bool, bool)` + +GetBetaPackagesOk returns a tuple with the BetaPackages field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetBetaPackages + +`func (o *BuildOptions) SetBetaPackages(v bool)` + +SetBetaPackages sets BetaPackages field to given value. + +### HasBetaPackages + +`func (o *BuildOptions) HasBetaPackages() bool` + +HasBetaPackages returns a boolean if a field has been set. + +### SetBetaPackagesNil + +`func (o *BuildOptions) SetBetaPackagesNil(b bool)` + + SetBetaPackagesNil sets the value for BetaPackages to be an explicit nil + +### UnsetBetaPackages +`func (o *BuildOptions) UnsetBetaPackages()` + +UnsetBetaPackages ensures that no value is present for BetaPackages, not even an explicit nil +### GetMemoryMbytes + +`func (o *BuildOptions) GetMemoryMbytes() int32` + +GetMemoryMbytes returns the MemoryMbytes field if non-nil, zero value otherwise. + +### GetMemoryMbytesOk + +`func (o *BuildOptions) GetMemoryMbytesOk() (*int32, bool)` + +GetMemoryMbytesOk returns a tuple with the MemoryMbytes field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMemoryMbytes + +`func (o *BuildOptions) SetMemoryMbytes(v int32)` + +SetMemoryMbytes sets MemoryMbytes field to given value. + +### HasMemoryMbytes + +`func (o *BuildOptions) HasMemoryMbytes() bool` + +HasMemoryMbytes returns a boolean if a field has been set. + +### SetMemoryMbytesNil + +`func (o *BuildOptions) SetMemoryMbytesNil(b bool)` + + SetMemoryMbytesNil sets the value for MemoryMbytes to be an explicit nil + +### UnsetMemoryMbytes +`func (o *BuildOptions) UnsetMemoryMbytes()` + +UnsetMemoryMbytes ensures that no value is present for MemoryMbytes, not even an explicit nil +### GetDiskMbytes + +`func (o *BuildOptions) GetDiskMbytes() int32` + +GetDiskMbytes returns the DiskMbytes field if non-nil, zero value otherwise. + +### GetDiskMbytesOk + +`func (o *BuildOptions) GetDiskMbytesOk() (*int32, bool)` + +GetDiskMbytesOk returns a tuple with the DiskMbytes field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDiskMbytes + +`func (o *BuildOptions) SetDiskMbytes(v int32)` + +SetDiskMbytes sets DiskMbytes field to given value. + +### HasDiskMbytes + +`func (o *BuildOptions) HasDiskMbytes() bool` + +HasDiskMbytes returns a boolean if a field has been set. + +### SetDiskMbytesNil + +`func (o *BuildOptions) SetDiskMbytesNil(b bool)` + + SetDiskMbytesNil sets the value for DiskMbytes to be an explicit nil + +### UnsetDiskMbytes +`func (o *BuildOptions) UnsetDiskMbytes()` + +UnsetDiskMbytes ensures that no value is present for DiskMbytes, not even an explicit nil + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/BuildResponse.md b/docs/BuildResponse.md new file mode 100644 index 0000000..c0d617d --- /dev/null +++ b/docs/BuildResponse.md @@ -0,0 +1,51 @@ +# BuildResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Data** | [**Build**](Build.md) | | + +## Methods + +### NewBuildResponse + +`func NewBuildResponse(data Build, ) *BuildResponse` + +NewBuildResponse instantiates a new BuildResponse object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewBuildResponseWithDefaults + +`func NewBuildResponseWithDefaults() *BuildResponse` + +NewBuildResponseWithDefaults instantiates a new BuildResponse object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetData + +`func (o *BuildResponse) GetData() Build` + +GetData returns the Data field if non-nil, zero value otherwise. + +### GetDataOk + +`func (o *BuildResponse) GetDataOk() (*Build, bool)` + +GetDataOk returns a tuple with the Data field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetData + +`func (o *BuildResponse) SetData(v Build)` + +SetData sets Data field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/BuildShort.md b/docs/BuildShort.md new file mode 100644 index 0000000..6118159 --- /dev/null +++ b/docs/BuildShort.md @@ -0,0 +1,275 @@ +# BuildShort + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **string** | | +**ActId** | Pointer to **string** | | [optional] +**UserId** | Pointer to **string** | | [optional] +**Status** | [**ActorJobStatus**](ActorJobStatus.md) | | +**StartedAt** | **time.Time** | | +**FinishedAt** | Pointer to **NullableTime** | | [optional] +**UsageTotalUsd** | **float32** | | +**BuildNumber** | **string** | | +**BuildNumberInt** | Pointer to **int32** | | [optional] +**Meta** | Pointer to [**BuildsMeta**](BuildsMeta.md) | | [optional] + +## Methods + +### NewBuildShort + +`func NewBuildShort(id string, status ActorJobStatus, startedAt time.Time, usageTotalUsd float32, buildNumber string, ) *BuildShort` + +NewBuildShort instantiates a new BuildShort object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewBuildShortWithDefaults + +`func NewBuildShortWithDefaults() *BuildShort` + +NewBuildShortWithDefaults instantiates a new BuildShort object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetId + +`func (o *BuildShort) GetId() string` + +GetId returns the Id field if non-nil, zero value otherwise. + +### GetIdOk + +`func (o *BuildShort) GetIdOk() (*string, bool)` + +GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetId + +`func (o *BuildShort) SetId(v string)` + +SetId sets Id field to given value. + + +### GetActId + +`func (o *BuildShort) GetActId() string` + +GetActId returns the ActId field if non-nil, zero value otherwise. + +### GetActIdOk + +`func (o *BuildShort) GetActIdOk() (*string, bool)` + +GetActIdOk returns a tuple with the ActId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetActId + +`func (o *BuildShort) SetActId(v string)` + +SetActId sets ActId field to given value. + +### HasActId + +`func (o *BuildShort) HasActId() bool` + +HasActId returns a boolean if a field has been set. + +### GetUserId + +`func (o *BuildShort) GetUserId() string` + +GetUserId returns the UserId field if non-nil, zero value otherwise. + +### GetUserIdOk + +`func (o *BuildShort) GetUserIdOk() (*string, bool)` + +GetUserIdOk returns a tuple with the UserId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUserId + +`func (o *BuildShort) SetUserId(v string)` + +SetUserId sets UserId field to given value. + +### HasUserId + +`func (o *BuildShort) HasUserId() bool` + +HasUserId returns a boolean if a field has been set. + +### GetStatus + +`func (o *BuildShort) GetStatus() ActorJobStatus` + +GetStatus returns the Status field if non-nil, zero value otherwise. + +### GetStatusOk + +`func (o *BuildShort) GetStatusOk() (*ActorJobStatus, bool)` + +GetStatusOk returns a tuple with the Status field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetStatus + +`func (o *BuildShort) SetStatus(v ActorJobStatus)` + +SetStatus sets Status field to given value. + + +### GetStartedAt + +`func (o *BuildShort) GetStartedAt() time.Time` + +GetStartedAt returns the StartedAt field if non-nil, zero value otherwise. + +### GetStartedAtOk + +`func (o *BuildShort) GetStartedAtOk() (*time.Time, bool)` + +GetStartedAtOk returns a tuple with the StartedAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetStartedAt + +`func (o *BuildShort) SetStartedAt(v time.Time)` + +SetStartedAt sets StartedAt field to given value. + + +### GetFinishedAt + +`func (o *BuildShort) GetFinishedAt() time.Time` + +GetFinishedAt returns the FinishedAt field if non-nil, zero value otherwise. + +### GetFinishedAtOk + +`func (o *BuildShort) GetFinishedAtOk() (*time.Time, bool)` + +GetFinishedAtOk returns a tuple with the FinishedAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetFinishedAt + +`func (o *BuildShort) SetFinishedAt(v time.Time)` + +SetFinishedAt sets FinishedAt field to given value. + +### HasFinishedAt + +`func (o *BuildShort) HasFinishedAt() bool` + +HasFinishedAt returns a boolean if a field has been set. + +### SetFinishedAtNil + +`func (o *BuildShort) SetFinishedAtNil(b bool)` + + SetFinishedAtNil sets the value for FinishedAt to be an explicit nil + +### UnsetFinishedAt +`func (o *BuildShort) UnsetFinishedAt()` + +UnsetFinishedAt ensures that no value is present for FinishedAt, not even an explicit nil +### GetUsageTotalUsd + +`func (o *BuildShort) GetUsageTotalUsd() float32` + +GetUsageTotalUsd returns the UsageTotalUsd field if non-nil, zero value otherwise. + +### GetUsageTotalUsdOk + +`func (o *BuildShort) GetUsageTotalUsdOk() (*float32, bool)` + +GetUsageTotalUsdOk returns a tuple with the UsageTotalUsd field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUsageTotalUsd + +`func (o *BuildShort) SetUsageTotalUsd(v float32)` + +SetUsageTotalUsd sets UsageTotalUsd field to given value. + + +### GetBuildNumber + +`func (o *BuildShort) GetBuildNumber() string` + +GetBuildNumber returns the BuildNumber field if non-nil, zero value otherwise. + +### GetBuildNumberOk + +`func (o *BuildShort) GetBuildNumberOk() (*string, bool)` + +GetBuildNumberOk returns a tuple with the BuildNumber field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetBuildNumber + +`func (o *BuildShort) SetBuildNumber(v string)` + +SetBuildNumber sets BuildNumber field to given value. + + +### GetBuildNumberInt + +`func (o *BuildShort) GetBuildNumberInt() int32` + +GetBuildNumberInt returns the BuildNumberInt field if non-nil, zero value otherwise. + +### GetBuildNumberIntOk + +`func (o *BuildShort) GetBuildNumberIntOk() (*int32, bool)` + +GetBuildNumberIntOk returns a tuple with the BuildNumberInt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetBuildNumberInt + +`func (o *BuildShort) SetBuildNumberInt(v int32)` + +SetBuildNumberInt sets BuildNumberInt field to given value. + +### HasBuildNumberInt + +`func (o *BuildShort) HasBuildNumberInt() bool` + +HasBuildNumberInt returns a boolean if a field has been set. + +### GetMeta + +`func (o *BuildShort) GetMeta() BuildsMeta` + +GetMeta returns the Meta field if non-nil, zero value otherwise. + +### GetMetaOk + +`func (o *BuildShort) GetMetaOk() (*BuildsMeta, bool)` + +GetMetaOk returns a tuple with the Meta field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMeta + +`func (o *BuildShort) SetMeta(v BuildsMeta)` + +SetMeta sets Meta field to given value. + +### HasMeta + +`func (o *BuildShort) HasMeta() bool` + +HasMeta returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/BuildStats.md b/docs/BuildStats.md new file mode 100644 index 0000000..e188bcc --- /dev/null +++ b/docs/BuildStats.md @@ -0,0 +1,129 @@ +# BuildStats + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**DurationMillis** | Pointer to **int32** | | [optional] +**RunTimeSecs** | Pointer to **float32** | | [optional] +**ComputeUnits** | **float32** | | +**ImageSizeBytes** | Pointer to **int32** | | [optional] + +## Methods + +### NewBuildStats + +`func NewBuildStats(computeUnits float32, ) *BuildStats` + +NewBuildStats instantiates a new BuildStats object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewBuildStatsWithDefaults + +`func NewBuildStatsWithDefaults() *BuildStats` + +NewBuildStatsWithDefaults instantiates a new BuildStats object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetDurationMillis + +`func (o *BuildStats) GetDurationMillis() int32` + +GetDurationMillis returns the DurationMillis field if non-nil, zero value otherwise. + +### GetDurationMillisOk + +`func (o *BuildStats) GetDurationMillisOk() (*int32, bool)` + +GetDurationMillisOk returns a tuple with the DurationMillis field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDurationMillis + +`func (o *BuildStats) SetDurationMillis(v int32)` + +SetDurationMillis sets DurationMillis field to given value. + +### HasDurationMillis + +`func (o *BuildStats) HasDurationMillis() bool` + +HasDurationMillis returns a boolean if a field has been set. + +### GetRunTimeSecs + +`func (o *BuildStats) GetRunTimeSecs() float32` + +GetRunTimeSecs returns the RunTimeSecs field if non-nil, zero value otherwise. + +### GetRunTimeSecsOk + +`func (o *BuildStats) GetRunTimeSecsOk() (*float32, bool)` + +GetRunTimeSecsOk returns a tuple with the RunTimeSecs field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRunTimeSecs + +`func (o *BuildStats) SetRunTimeSecs(v float32)` + +SetRunTimeSecs sets RunTimeSecs field to given value. + +### HasRunTimeSecs + +`func (o *BuildStats) HasRunTimeSecs() bool` + +HasRunTimeSecs returns a boolean if a field has been set. + +### GetComputeUnits + +`func (o *BuildStats) GetComputeUnits() float32` + +GetComputeUnits returns the ComputeUnits field if non-nil, zero value otherwise. + +### GetComputeUnitsOk + +`func (o *BuildStats) GetComputeUnitsOk() (*float32, bool)` + +GetComputeUnitsOk returns a tuple with the ComputeUnits field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetComputeUnits + +`func (o *BuildStats) SetComputeUnits(v float32)` + +SetComputeUnits sets ComputeUnits field to given value. + + +### GetImageSizeBytes + +`func (o *BuildStats) GetImageSizeBytes() int32` + +GetImageSizeBytes returns the ImageSizeBytes field if non-nil, zero value otherwise. + +### GetImageSizeBytesOk + +`func (o *BuildStats) GetImageSizeBytesOk() (*int32, bool)` + +GetImageSizeBytesOk returns a tuple with the ImageSizeBytes field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetImageSizeBytes + +`func (o *BuildStats) SetImageSizeBytes(v int32)` + +SetImageSizeBytes sets ImageSizeBytes field to given value. + +### HasImageSizeBytes + +`func (o *BuildStats) HasImageSizeBytes() bool` + +HasImageSizeBytes returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/BuildTag.md b/docs/BuildTag.md new file mode 100644 index 0000000..e6acd40 --- /dev/null +++ b/docs/BuildTag.md @@ -0,0 +1,51 @@ +# BuildTag + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**BuildId** | **string** | | + +## Methods + +### NewBuildTag + +`func NewBuildTag(buildId string, ) *BuildTag` + +NewBuildTag instantiates a new BuildTag object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewBuildTagWithDefaults + +`func NewBuildTagWithDefaults() *BuildTag` + +NewBuildTagWithDefaults instantiates a new BuildTag object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetBuildId + +`func (o *BuildTag) GetBuildId() string` + +GetBuildId returns the BuildId field if non-nil, zero value otherwise. + +### GetBuildIdOk + +`func (o *BuildTag) GetBuildIdOk() (*string, bool)` + +GetBuildIdOk returns a tuple with the BuildId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetBuildId + +`func (o *BuildTag) SetBuildId(v string)` + +SetBuildId sets BuildId field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/BuildUsage.md b/docs/BuildUsage.md new file mode 100644 index 0000000..45e4bdb --- /dev/null +++ b/docs/BuildUsage.md @@ -0,0 +1,66 @@ +# BuildUsage + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ACTOR_COMPUTE_UNITS** | Pointer to **NullableFloat32** | | [optional] + +## Methods + +### NewBuildUsage + +`func NewBuildUsage() *BuildUsage` + +NewBuildUsage instantiates a new BuildUsage object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewBuildUsageWithDefaults + +`func NewBuildUsageWithDefaults() *BuildUsage` + +NewBuildUsageWithDefaults instantiates a new BuildUsage object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetACTOR_COMPUTE_UNITS + +`func (o *BuildUsage) GetACTOR_COMPUTE_UNITS() float32` + +GetACTOR_COMPUTE_UNITS returns the ACTOR_COMPUTE_UNITS field if non-nil, zero value otherwise. + +### GetACTOR_COMPUTE_UNITSOk + +`func (o *BuildUsage) GetACTOR_COMPUTE_UNITSOk() (*float32, bool)` + +GetACTOR_COMPUTE_UNITSOk returns a tuple with the ACTOR_COMPUTE_UNITS field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetACTOR_COMPUTE_UNITS + +`func (o *BuildUsage) SetACTOR_COMPUTE_UNITS(v float32)` + +SetACTOR_COMPUTE_UNITS sets ACTOR_COMPUTE_UNITS field to given value. + +### HasACTOR_COMPUTE_UNITS + +`func (o *BuildUsage) HasACTOR_COMPUTE_UNITS() bool` + +HasACTOR_COMPUTE_UNITS returns a boolean if a field has been set. + +### SetACTOR_COMPUTE_UNITSNil + +`func (o *BuildUsage) SetACTOR_COMPUTE_UNITSNil(b bool)` + + SetACTOR_COMPUTE_UNITSNil sets the value for ACTOR_COMPUTE_UNITS to be an explicit nil + +### UnsetACTOR_COMPUTE_UNITS +`func (o *BuildUsage) UnsetACTOR_COMPUTE_UNITS()` + +UnsetACTOR_COMPUTE_UNITS ensures that no value is present for ACTOR_COMPUTE_UNITS, not even an explicit nil + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/BuildsMeta.md b/docs/BuildsMeta.md new file mode 100644 index 0000000..c06a443 --- /dev/null +++ b/docs/BuildsMeta.md @@ -0,0 +1,103 @@ +# BuildsMeta + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Origin** | [**RunOrigin**](RunOrigin.md) | | +**ClientIp** | Pointer to **string** | IP address of the client that started the build. | [optional] +**UserAgent** | Pointer to **string** | User agent of the client that started the build. | [optional] + +## Methods + +### NewBuildsMeta + +`func NewBuildsMeta(origin RunOrigin, ) *BuildsMeta` + +NewBuildsMeta instantiates a new BuildsMeta object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewBuildsMetaWithDefaults + +`func NewBuildsMetaWithDefaults() *BuildsMeta` + +NewBuildsMetaWithDefaults instantiates a new BuildsMeta object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetOrigin + +`func (o *BuildsMeta) GetOrigin() RunOrigin` + +GetOrigin returns the Origin field if non-nil, zero value otherwise. + +### GetOriginOk + +`func (o *BuildsMeta) GetOriginOk() (*RunOrigin, bool)` + +GetOriginOk returns a tuple with the Origin field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetOrigin + +`func (o *BuildsMeta) SetOrigin(v RunOrigin)` + +SetOrigin sets Origin field to given value. + + +### GetClientIp + +`func (o *BuildsMeta) GetClientIp() string` + +GetClientIp returns the ClientIp field if non-nil, zero value otherwise. + +### GetClientIpOk + +`func (o *BuildsMeta) GetClientIpOk() (*string, bool)` + +GetClientIpOk returns a tuple with the ClientIp field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetClientIp + +`func (o *BuildsMeta) SetClientIp(v string)` + +SetClientIp sets ClientIp field to given value. + +### HasClientIp + +`func (o *BuildsMeta) HasClientIp() bool` + +HasClientIp returns a boolean if a field has been set. + +### GetUserAgent + +`func (o *BuildsMeta) GetUserAgent() string` + +GetUserAgent returns the UserAgent field if non-nil, zero value otherwise. + +### GetUserAgentOk + +`func (o *BuildsMeta) GetUserAgentOk() (*string, bool)` + +GetUserAgentOk returns a tuple with the UserAgent field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUserAgent + +`func (o *BuildsMeta) SetUserAgent(v string)` + +SetUserAgent sets UserAgent field to given value. + +### HasUserAgent + +`func (o *BuildsMeta) HasUserAgent() bool` + +HasUserAgent returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/CallsInner.md b/docs/CallsInner.md new file mode 100644 index 0000000..64537fa --- /dev/null +++ b/docs/CallsInner.md @@ -0,0 +1,210 @@ +# CallsInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**StartedAt** | Pointer to **NullableTime** | | [optional] +**FinishedAt** | Pointer to **NullableTime** | | [optional] +**ErrorMessage** | Pointer to **NullableString** | | [optional] +**ResponseStatus** | Pointer to **NullableInt32** | | [optional] +**ResponseBody** | Pointer to **NullableString** | | [optional] + +## Methods + +### NewCallsInner + +`func NewCallsInner() *CallsInner` + +NewCallsInner instantiates a new CallsInner object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewCallsInnerWithDefaults + +`func NewCallsInnerWithDefaults() *CallsInner` + +NewCallsInnerWithDefaults instantiates a new CallsInner object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetStartedAt + +`func (o *CallsInner) GetStartedAt() time.Time` + +GetStartedAt returns the StartedAt field if non-nil, zero value otherwise. + +### GetStartedAtOk + +`func (o *CallsInner) GetStartedAtOk() (*time.Time, bool)` + +GetStartedAtOk returns a tuple with the StartedAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetStartedAt + +`func (o *CallsInner) SetStartedAt(v time.Time)` + +SetStartedAt sets StartedAt field to given value. + +### HasStartedAt + +`func (o *CallsInner) HasStartedAt() bool` + +HasStartedAt returns a boolean if a field has been set. + +### SetStartedAtNil + +`func (o *CallsInner) SetStartedAtNil(b bool)` + + SetStartedAtNil sets the value for StartedAt to be an explicit nil + +### UnsetStartedAt +`func (o *CallsInner) UnsetStartedAt()` + +UnsetStartedAt ensures that no value is present for StartedAt, not even an explicit nil +### GetFinishedAt + +`func (o *CallsInner) GetFinishedAt() time.Time` + +GetFinishedAt returns the FinishedAt field if non-nil, zero value otherwise. + +### GetFinishedAtOk + +`func (o *CallsInner) GetFinishedAtOk() (*time.Time, bool)` + +GetFinishedAtOk returns a tuple with the FinishedAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetFinishedAt + +`func (o *CallsInner) SetFinishedAt(v time.Time)` + +SetFinishedAt sets FinishedAt field to given value. + +### HasFinishedAt + +`func (o *CallsInner) HasFinishedAt() bool` + +HasFinishedAt returns a boolean if a field has been set. + +### SetFinishedAtNil + +`func (o *CallsInner) SetFinishedAtNil(b bool)` + + SetFinishedAtNil sets the value for FinishedAt to be an explicit nil + +### UnsetFinishedAt +`func (o *CallsInner) UnsetFinishedAt()` + +UnsetFinishedAt ensures that no value is present for FinishedAt, not even an explicit nil +### GetErrorMessage + +`func (o *CallsInner) GetErrorMessage() string` + +GetErrorMessage returns the ErrorMessage field if non-nil, zero value otherwise. + +### GetErrorMessageOk + +`func (o *CallsInner) GetErrorMessageOk() (*string, bool)` + +GetErrorMessageOk returns a tuple with the ErrorMessage field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetErrorMessage + +`func (o *CallsInner) SetErrorMessage(v string)` + +SetErrorMessage sets ErrorMessage field to given value. + +### HasErrorMessage + +`func (o *CallsInner) HasErrorMessage() bool` + +HasErrorMessage returns a boolean if a field has been set. + +### SetErrorMessageNil + +`func (o *CallsInner) SetErrorMessageNil(b bool)` + + SetErrorMessageNil sets the value for ErrorMessage to be an explicit nil + +### UnsetErrorMessage +`func (o *CallsInner) UnsetErrorMessage()` + +UnsetErrorMessage ensures that no value is present for ErrorMessage, not even an explicit nil +### GetResponseStatus + +`func (o *CallsInner) GetResponseStatus() int32` + +GetResponseStatus returns the ResponseStatus field if non-nil, zero value otherwise. + +### GetResponseStatusOk + +`func (o *CallsInner) GetResponseStatusOk() (*int32, bool)` + +GetResponseStatusOk returns a tuple with the ResponseStatus field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetResponseStatus + +`func (o *CallsInner) SetResponseStatus(v int32)` + +SetResponseStatus sets ResponseStatus field to given value. + +### HasResponseStatus + +`func (o *CallsInner) HasResponseStatus() bool` + +HasResponseStatus returns a boolean if a field has been set. + +### SetResponseStatusNil + +`func (o *CallsInner) SetResponseStatusNil(b bool)` + + SetResponseStatusNil sets the value for ResponseStatus to be an explicit nil + +### UnsetResponseStatus +`func (o *CallsInner) UnsetResponseStatus()` + +UnsetResponseStatus ensures that no value is present for ResponseStatus, not even an explicit nil +### GetResponseBody + +`func (o *CallsInner) GetResponseBody() string` + +GetResponseBody returns the ResponseBody field if non-nil, zero value otherwise. + +### GetResponseBodyOk + +`func (o *CallsInner) GetResponseBodyOk() (*string, bool)` + +GetResponseBodyOk returns a tuple with the ResponseBody field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetResponseBody + +`func (o *CallsInner) SetResponseBody(v string)` + +SetResponseBody sets ResponseBody field to given value. + +### HasResponseBody + +`func (o *CallsInner) HasResponseBody() bool` + +HasResponseBody returns a boolean if a field has been set. + +### SetResponseBodyNil + +`func (o *CallsInner) SetResponseBodyNil(b bool)` + + SetResponseBodyNil sets the value for ResponseBody to be an explicit nil + +### UnsetResponseBody +`func (o *CallsInner) UnsetResponseBody()` + +UnsetResponseBody ensures that no value is present for ResponseBody, not even an explicit nil + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ChargeRunRequest.md b/docs/ChargeRunRequest.md new file mode 100644 index 0000000..4aa5c1f --- /dev/null +++ b/docs/ChargeRunRequest.md @@ -0,0 +1,72 @@ +# ChargeRunRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**EventName** | **string** | | +**Count** | **int32** | | + +## Methods + +### NewChargeRunRequest + +`func NewChargeRunRequest(eventName string, count int32, ) *ChargeRunRequest` + +NewChargeRunRequest instantiates a new ChargeRunRequest object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewChargeRunRequestWithDefaults + +`func NewChargeRunRequestWithDefaults() *ChargeRunRequest` + +NewChargeRunRequestWithDefaults instantiates a new ChargeRunRequest object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetEventName + +`func (o *ChargeRunRequest) GetEventName() string` + +GetEventName returns the EventName field if non-nil, zero value otherwise. + +### GetEventNameOk + +`func (o *ChargeRunRequest) GetEventNameOk() (*string, bool)` + +GetEventNameOk returns a tuple with the EventName field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetEventName + +`func (o *ChargeRunRequest) SetEventName(v string)` + +SetEventName sets EventName field to given value. + + +### GetCount + +`func (o *ChargeRunRequest) GetCount() int32` + +GetCount returns the Count field if non-nil, zero value otherwise. + +### GetCountOk + +`func (o *ChargeRunRequest) GetCountOk() (*int32, bool)` + +GetCountOk returns a tuple with the Count field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCount + +`func (o *ChargeRunRequest) SetCount(v int32)` + +SetCount sets Count field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/CommonActorPricingInfo.md b/docs/CommonActorPricingInfo.md new file mode 100644 index 0000000..4c6ee54 --- /dev/null +++ b/docs/CommonActorPricingInfo.md @@ -0,0 +1,253 @@ +# CommonActorPricingInfo + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ApifyMarginPercentage** | **float32** | In [0, 1], fraction of pricePerUnitUsd that goes to Apify | +**CreatedAt** | **time.Time** | When this pricing info record has been created | +**StartedAt** | **time.Time** | Since when is this pricing info record effective for a given Actor | +**NotifiedAboutFutureChangeAt** | Pointer to **NullableTime** | | [optional] +**NotifiedAboutChangeAt** | Pointer to **NullableTime** | | [optional] +**ReasonForChange** | Pointer to **NullableString** | | [optional] +**IsPriceChangeNotificationSuppressed** | Pointer to **bool** | | [optional] +**ForceContainsSignificantPriceChange** | Pointer to **bool** | | [optional] + +## Methods + +### NewCommonActorPricingInfo + +`func NewCommonActorPricingInfo(apifyMarginPercentage float32, createdAt time.Time, startedAt time.Time, ) *CommonActorPricingInfo` + +NewCommonActorPricingInfo instantiates a new CommonActorPricingInfo object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewCommonActorPricingInfoWithDefaults + +`func NewCommonActorPricingInfoWithDefaults() *CommonActorPricingInfo` + +NewCommonActorPricingInfoWithDefaults instantiates a new CommonActorPricingInfo object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetApifyMarginPercentage + +`func (o *CommonActorPricingInfo) GetApifyMarginPercentage() float32` + +GetApifyMarginPercentage returns the ApifyMarginPercentage field if non-nil, zero value otherwise. + +### GetApifyMarginPercentageOk + +`func (o *CommonActorPricingInfo) GetApifyMarginPercentageOk() (*float32, bool)` + +GetApifyMarginPercentageOk returns a tuple with the ApifyMarginPercentage field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetApifyMarginPercentage + +`func (o *CommonActorPricingInfo) SetApifyMarginPercentage(v float32)` + +SetApifyMarginPercentage sets ApifyMarginPercentage field to given value. + + +### GetCreatedAt + +`func (o *CommonActorPricingInfo) GetCreatedAt() time.Time` + +GetCreatedAt returns the CreatedAt field if non-nil, zero value otherwise. + +### GetCreatedAtOk + +`func (o *CommonActorPricingInfo) GetCreatedAtOk() (*time.Time, bool)` + +GetCreatedAtOk returns a tuple with the CreatedAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCreatedAt + +`func (o *CommonActorPricingInfo) SetCreatedAt(v time.Time)` + +SetCreatedAt sets CreatedAt field to given value. + + +### GetStartedAt + +`func (o *CommonActorPricingInfo) GetStartedAt() time.Time` + +GetStartedAt returns the StartedAt field if non-nil, zero value otherwise. + +### GetStartedAtOk + +`func (o *CommonActorPricingInfo) GetStartedAtOk() (*time.Time, bool)` + +GetStartedAtOk returns a tuple with the StartedAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetStartedAt + +`func (o *CommonActorPricingInfo) SetStartedAt(v time.Time)` + +SetStartedAt sets StartedAt field to given value. + + +### GetNotifiedAboutFutureChangeAt + +`func (o *CommonActorPricingInfo) GetNotifiedAboutFutureChangeAt() time.Time` + +GetNotifiedAboutFutureChangeAt returns the NotifiedAboutFutureChangeAt field if non-nil, zero value otherwise. + +### GetNotifiedAboutFutureChangeAtOk + +`func (o *CommonActorPricingInfo) GetNotifiedAboutFutureChangeAtOk() (*time.Time, bool)` + +GetNotifiedAboutFutureChangeAtOk returns a tuple with the NotifiedAboutFutureChangeAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetNotifiedAboutFutureChangeAt + +`func (o *CommonActorPricingInfo) SetNotifiedAboutFutureChangeAt(v time.Time)` + +SetNotifiedAboutFutureChangeAt sets NotifiedAboutFutureChangeAt field to given value. + +### HasNotifiedAboutFutureChangeAt + +`func (o *CommonActorPricingInfo) HasNotifiedAboutFutureChangeAt() bool` + +HasNotifiedAboutFutureChangeAt returns a boolean if a field has been set. + +### SetNotifiedAboutFutureChangeAtNil + +`func (o *CommonActorPricingInfo) SetNotifiedAboutFutureChangeAtNil(b bool)` + + SetNotifiedAboutFutureChangeAtNil sets the value for NotifiedAboutFutureChangeAt to be an explicit nil + +### UnsetNotifiedAboutFutureChangeAt +`func (o *CommonActorPricingInfo) UnsetNotifiedAboutFutureChangeAt()` + +UnsetNotifiedAboutFutureChangeAt ensures that no value is present for NotifiedAboutFutureChangeAt, not even an explicit nil +### GetNotifiedAboutChangeAt + +`func (o *CommonActorPricingInfo) GetNotifiedAboutChangeAt() time.Time` + +GetNotifiedAboutChangeAt returns the NotifiedAboutChangeAt field if non-nil, zero value otherwise. + +### GetNotifiedAboutChangeAtOk + +`func (o *CommonActorPricingInfo) GetNotifiedAboutChangeAtOk() (*time.Time, bool)` + +GetNotifiedAboutChangeAtOk returns a tuple with the NotifiedAboutChangeAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetNotifiedAboutChangeAt + +`func (o *CommonActorPricingInfo) SetNotifiedAboutChangeAt(v time.Time)` + +SetNotifiedAboutChangeAt sets NotifiedAboutChangeAt field to given value. + +### HasNotifiedAboutChangeAt + +`func (o *CommonActorPricingInfo) HasNotifiedAboutChangeAt() bool` + +HasNotifiedAboutChangeAt returns a boolean if a field has been set. + +### SetNotifiedAboutChangeAtNil + +`func (o *CommonActorPricingInfo) SetNotifiedAboutChangeAtNil(b bool)` + + SetNotifiedAboutChangeAtNil sets the value for NotifiedAboutChangeAt to be an explicit nil + +### UnsetNotifiedAboutChangeAt +`func (o *CommonActorPricingInfo) UnsetNotifiedAboutChangeAt()` + +UnsetNotifiedAboutChangeAt ensures that no value is present for NotifiedAboutChangeAt, not even an explicit nil +### GetReasonForChange + +`func (o *CommonActorPricingInfo) GetReasonForChange() string` + +GetReasonForChange returns the ReasonForChange field if non-nil, zero value otherwise. + +### GetReasonForChangeOk + +`func (o *CommonActorPricingInfo) GetReasonForChangeOk() (*string, bool)` + +GetReasonForChangeOk returns a tuple with the ReasonForChange field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetReasonForChange + +`func (o *CommonActorPricingInfo) SetReasonForChange(v string)` + +SetReasonForChange sets ReasonForChange field to given value. + +### HasReasonForChange + +`func (o *CommonActorPricingInfo) HasReasonForChange() bool` + +HasReasonForChange returns a boolean if a field has been set. + +### SetReasonForChangeNil + +`func (o *CommonActorPricingInfo) SetReasonForChangeNil(b bool)` + + SetReasonForChangeNil sets the value for ReasonForChange to be an explicit nil + +### UnsetReasonForChange +`func (o *CommonActorPricingInfo) UnsetReasonForChange()` + +UnsetReasonForChange ensures that no value is present for ReasonForChange, not even an explicit nil +### GetIsPriceChangeNotificationSuppressed + +`func (o *CommonActorPricingInfo) GetIsPriceChangeNotificationSuppressed() bool` + +GetIsPriceChangeNotificationSuppressed returns the IsPriceChangeNotificationSuppressed field if non-nil, zero value otherwise. + +### GetIsPriceChangeNotificationSuppressedOk + +`func (o *CommonActorPricingInfo) GetIsPriceChangeNotificationSuppressedOk() (*bool, bool)` + +GetIsPriceChangeNotificationSuppressedOk returns a tuple with the IsPriceChangeNotificationSuppressed field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetIsPriceChangeNotificationSuppressed + +`func (o *CommonActorPricingInfo) SetIsPriceChangeNotificationSuppressed(v bool)` + +SetIsPriceChangeNotificationSuppressed sets IsPriceChangeNotificationSuppressed field to given value. + +### HasIsPriceChangeNotificationSuppressed + +`func (o *CommonActorPricingInfo) HasIsPriceChangeNotificationSuppressed() bool` + +HasIsPriceChangeNotificationSuppressed returns a boolean if a field has been set. + +### GetForceContainsSignificantPriceChange + +`func (o *CommonActorPricingInfo) GetForceContainsSignificantPriceChange() bool` + +GetForceContainsSignificantPriceChange returns the ForceContainsSignificantPriceChange field if non-nil, zero value otherwise. + +### GetForceContainsSignificantPriceChangeOk + +`func (o *CommonActorPricingInfo) GetForceContainsSignificantPriceChangeOk() (*bool, bool)` + +GetForceContainsSignificantPriceChangeOk returns a tuple with the ForceContainsSignificantPriceChange field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetForceContainsSignificantPriceChange + +`func (o *CommonActorPricingInfo) SetForceContainsSignificantPriceChange(v bool)` + +SetForceContainsSignificantPriceChange sets ForceContainsSignificantPriceChange field to given value. + +### HasForceContainsSignificantPriceChange + +`func (o *CommonActorPricingInfo) HasForceContainsSignificantPriceChange() bool` + +HasForceContainsSignificantPriceChange returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/CreateActorRequest.md b/docs/CreateActorRequest.md new file mode 100644 index 0000000..2968467 --- /dev/null +++ b/docs/CreateActorRequest.md @@ -0,0 +1,504 @@ +# CreateActorRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Name** | Pointer to **NullableString** | | [optional] +**Description** | Pointer to **NullableString** | | [optional] +**Title** | Pointer to **NullableString** | | [optional] +**IsPublic** | Pointer to **NullableBool** | | [optional] +**SeoTitle** | Pointer to **NullableString** | | [optional] +**SeoDescription** | Pointer to **NullableString** | | [optional] +**RestartOnError** | Pointer to **bool** | | [optional] +**Versions** | Pointer to [**[]Version**](Version.md) | | [optional] +**PricingInfos** | Pointer to [**[]ActorRunPricingInfo**](ActorRunPricingInfo.md) | | [optional] +**Categories** | Pointer to **[]string** | | [optional] +**DefaultRunOptions** | Pointer to [**DefaultRunOptions**](DefaultRunOptions.md) | | [optional] +**ActorStandby** | Pointer to [**NullableActorStandby**](ActorStandby.md) | | [optional] +**ExampleRunInput** | Pointer to [**NullableExampleRunInput**](ExampleRunInput.md) | | [optional] +**IsDeprecated** | Pointer to **NullableBool** | | [optional] + +## Methods + +### NewCreateActorRequest + +`func NewCreateActorRequest() *CreateActorRequest` + +NewCreateActorRequest instantiates a new CreateActorRequest object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewCreateActorRequestWithDefaults + +`func NewCreateActorRequestWithDefaults() *CreateActorRequest` + +NewCreateActorRequestWithDefaults instantiates a new CreateActorRequest object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetName + +`func (o *CreateActorRequest) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *CreateActorRequest) GetNameOk() (*string, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetName + +`func (o *CreateActorRequest) SetName(v string)` + +SetName sets Name field to given value. + +### HasName + +`func (o *CreateActorRequest) HasName() bool` + +HasName returns a boolean if a field has been set. + +### SetNameNil + +`func (o *CreateActorRequest) SetNameNil(b bool)` + + SetNameNil sets the value for Name to be an explicit nil + +### UnsetName +`func (o *CreateActorRequest) UnsetName()` + +UnsetName ensures that no value is present for Name, not even an explicit nil +### GetDescription + +`func (o *CreateActorRequest) GetDescription() string` + +GetDescription returns the Description field if non-nil, zero value otherwise. + +### GetDescriptionOk + +`func (o *CreateActorRequest) GetDescriptionOk() (*string, bool)` + +GetDescriptionOk returns a tuple with the Description field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDescription + +`func (o *CreateActorRequest) SetDescription(v string)` + +SetDescription sets Description field to given value. + +### HasDescription + +`func (o *CreateActorRequest) HasDescription() bool` + +HasDescription returns a boolean if a field has been set. + +### SetDescriptionNil + +`func (o *CreateActorRequest) SetDescriptionNil(b bool)` + + SetDescriptionNil sets the value for Description to be an explicit nil + +### UnsetDescription +`func (o *CreateActorRequest) UnsetDescription()` + +UnsetDescription ensures that no value is present for Description, not even an explicit nil +### GetTitle + +`func (o *CreateActorRequest) GetTitle() string` + +GetTitle returns the Title field if non-nil, zero value otherwise. + +### GetTitleOk + +`func (o *CreateActorRequest) GetTitleOk() (*string, bool)` + +GetTitleOk returns a tuple with the Title field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTitle + +`func (o *CreateActorRequest) SetTitle(v string)` + +SetTitle sets Title field to given value. + +### HasTitle + +`func (o *CreateActorRequest) HasTitle() bool` + +HasTitle returns a boolean if a field has been set. + +### SetTitleNil + +`func (o *CreateActorRequest) SetTitleNil(b bool)` + + SetTitleNil sets the value for Title to be an explicit nil + +### UnsetTitle +`func (o *CreateActorRequest) UnsetTitle()` + +UnsetTitle ensures that no value is present for Title, not even an explicit nil +### GetIsPublic + +`func (o *CreateActorRequest) GetIsPublic() bool` + +GetIsPublic returns the IsPublic field if non-nil, zero value otherwise. + +### GetIsPublicOk + +`func (o *CreateActorRequest) GetIsPublicOk() (*bool, bool)` + +GetIsPublicOk returns a tuple with the IsPublic field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetIsPublic + +`func (o *CreateActorRequest) SetIsPublic(v bool)` + +SetIsPublic sets IsPublic field to given value. + +### HasIsPublic + +`func (o *CreateActorRequest) HasIsPublic() bool` + +HasIsPublic returns a boolean if a field has been set. + +### SetIsPublicNil + +`func (o *CreateActorRequest) SetIsPublicNil(b bool)` + + SetIsPublicNil sets the value for IsPublic to be an explicit nil + +### UnsetIsPublic +`func (o *CreateActorRequest) UnsetIsPublic()` + +UnsetIsPublic ensures that no value is present for IsPublic, not even an explicit nil +### GetSeoTitle + +`func (o *CreateActorRequest) GetSeoTitle() string` + +GetSeoTitle returns the SeoTitle field if non-nil, zero value otherwise. + +### GetSeoTitleOk + +`func (o *CreateActorRequest) GetSeoTitleOk() (*string, bool)` + +GetSeoTitleOk returns a tuple with the SeoTitle field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSeoTitle + +`func (o *CreateActorRequest) SetSeoTitle(v string)` + +SetSeoTitle sets SeoTitle field to given value. + +### HasSeoTitle + +`func (o *CreateActorRequest) HasSeoTitle() bool` + +HasSeoTitle returns a boolean if a field has been set. + +### SetSeoTitleNil + +`func (o *CreateActorRequest) SetSeoTitleNil(b bool)` + + SetSeoTitleNil sets the value for SeoTitle to be an explicit nil + +### UnsetSeoTitle +`func (o *CreateActorRequest) UnsetSeoTitle()` + +UnsetSeoTitle ensures that no value is present for SeoTitle, not even an explicit nil +### GetSeoDescription + +`func (o *CreateActorRequest) GetSeoDescription() string` + +GetSeoDescription returns the SeoDescription field if non-nil, zero value otherwise. + +### GetSeoDescriptionOk + +`func (o *CreateActorRequest) GetSeoDescriptionOk() (*string, bool)` + +GetSeoDescriptionOk returns a tuple with the SeoDescription field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSeoDescription + +`func (o *CreateActorRequest) SetSeoDescription(v string)` + +SetSeoDescription sets SeoDescription field to given value. + +### HasSeoDescription + +`func (o *CreateActorRequest) HasSeoDescription() bool` + +HasSeoDescription returns a boolean if a field has been set. + +### SetSeoDescriptionNil + +`func (o *CreateActorRequest) SetSeoDescriptionNil(b bool)` + + SetSeoDescriptionNil sets the value for SeoDescription to be an explicit nil + +### UnsetSeoDescription +`func (o *CreateActorRequest) UnsetSeoDescription()` + +UnsetSeoDescription ensures that no value is present for SeoDescription, not even an explicit nil +### GetRestartOnError + +`func (o *CreateActorRequest) GetRestartOnError() bool` + +GetRestartOnError returns the RestartOnError field if non-nil, zero value otherwise. + +### GetRestartOnErrorOk + +`func (o *CreateActorRequest) GetRestartOnErrorOk() (*bool, bool)` + +GetRestartOnErrorOk returns a tuple with the RestartOnError field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRestartOnError + +`func (o *CreateActorRequest) SetRestartOnError(v bool)` + +SetRestartOnError sets RestartOnError field to given value. + +### HasRestartOnError + +`func (o *CreateActorRequest) HasRestartOnError() bool` + +HasRestartOnError returns a boolean if a field has been set. + +### GetVersions + +`func (o *CreateActorRequest) GetVersions() []Version` + +GetVersions returns the Versions field if non-nil, zero value otherwise. + +### GetVersionsOk + +`func (o *CreateActorRequest) GetVersionsOk() (*[]Version, bool)` + +GetVersionsOk returns a tuple with the Versions field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetVersions + +`func (o *CreateActorRequest) SetVersions(v []Version)` + +SetVersions sets Versions field to given value. + +### HasVersions + +`func (o *CreateActorRequest) HasVersions() bool` + +HasVersions returns a boolean if a field has been set. + +### SetVersionsNil + +`func (o *CreateActorRequest) SetVersionsNil(b bool)` + + SetVersionsNil sets the value for Versions to be an explicit nil + +### UnsetVersions +`func (o *CreateActorRequest) UnsetVersions()` + +UnsetVersions ensures that no value is present for Versions, not even an explicit nil +### GetPricingInfos + +`func (o *CreateActorRequest) GetPricingInfos() []ActorRunPricingInfo` + +GetPricingInfos returns the PricingInfos field if non-nil, zero value otherwise. + +### GetPricingInfosOk + +`func (o *CreateActorRequest) GetPricingInfosOk() (*[]ActorRunPricingInfo, bool)` + +GetPricingInfosOk returns a tuple with the PricingInfos field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPricingInfos + +`func (o *CreateActorRequest) SetPricingInfos(v []ActorRunPricingInfo)` + +SetPricingInfos sets PricingInfos field to given value. + +### HasPricingInfos + +`func (o *CreateActorRequest) HasPricingInfos() bool` + +HasPricingInfos returns a boolean if a field has been set. + +### GetCategories + +`func (o *CreateActorRequest) GetCategories() []string` + +GetCategories returns the Categories field if non-nil, zero value otherwise. + +### GetCategoriesOk + +`func (o *CreateActorRequest) GetCategoriesOk() (*[]string, bool)` + +GetCategoriesOk returns a tuple with the Categories field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCategories + +`func (o *CreateActorRequest) SetCategories(v []string)` + +SetCategories sets Categories field to given value. + +### HasCategories + +`func (o *CreateActorRequest) HasCategories() bool` + +HasCategories returns a boolean if a field has been set. + +### SetCategoriesNil + +`func (o *CreateActorRequest) SetCategoriesNil(b bool)` + + SetCategoriesNil sets the value for Categories to be an explicit nil + +### UnsetCategories +`func (o *CreateActorRequest) UnsetCategories()` + +UnsetCategories ensures that no value is present for Categories, not even an explicit nil +### GetDefaultRunOptions + +`func (o *CreateActorRequest) GetDefaultRunOptions() DefaultRunOptions` + +GetDefaultRunOptions returns the DefaultRunOptions field if non-nil, zero value otherwise. + +### GetDefaultRunOptionsOk + +`func (o *CreateActorRequest) GetDefaultRunOptionsOk() (*DefaultRunOptions, bool)` + +GetDefaultRunOptionsOk returns a tuple with the DefaultRunOptions field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDefaultRunOptions + +`func (o *CreateActorRequest) SetDefaultRunOptions(v DefaultRunOptions)` + +SetDefaultRunOptions sets DefaultRunOptions field to given value. + +### HasDefaultRunOptions + +`func (o *CreateActorRequest) HasDefaultRunOptions() bool` + +HasDefaultRunOptions returns a boolean if a field has been set. + +### GetActorStandby + +`func (o *CreateActorRequest) GetActorStandby() ActorStandby` + +GetActorStandby returns the ActorStandby field if non-nil, zero value otherwise. + +### GetActorStandbyOk + +`func (o *CreateActorRequest) GetActorStandbyOk() (*ActorStandby, bool)` + +GetActorStandbyOk returns a tuple with the ActorStandby field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetActorStandby + +`func (o *CreateActorRequest) SetActorStandby(v ActorStandby)` + +SetActorStandby sets ActorStandby field to given value. + +### HasActorStandby + +`func (o *CreateActorRequest) HasActorStandby() bool` + +HasActorStandby returns a boolean if a field has been set. + +### SetActorStandbyNil + +`func (o *CreateActorRequest) SetActorStandbyNil(b bool)` + + SetActorStandbyNil sets the value for ActorStandby to be an explicit nil + +### UnsetActorStandby +`func (o *CreateActorRequest) UnsetActorStandby()` + +UnsetActorStandby ensures that no value is present for ActorStandby, not even an explicit nil +### GetExampleRunInput + +`func (o *CreateActorRequest) GetExampleRunInput() ExampleRunInput` + +GetExampleRunInput returns the ExampleRunInput field if non-nil, zero value otherwise. + +### GetExampleRunInputOk + +`func (o *CreateActorRequest) GetExampleRunInputOk() (*ExampleRunInput, bool)` + +GetExampleRunInputOk returns a tuple with the ExampleRunInput field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetExampleRunInput + +`func (o *CreateActorRequest) SetExampleRunInput(v ExampleRunInput)` + +SetExampleRunInput sets ExampleRunInput field to given value. + +### HasExampleRunInput + +`func (o *CreateActorRequest) HasExampleRunInput() bool` + +HasExampleRunInput returns a boolean if a field has been set. + +### SetExampleRunInputNil + +`func (o *CreateActorRequest) SetExampleRunInputNil(b bool)` + + SetExampleRunInputNil sets the value for ExampleRunInput to be an explicit nil + +### UnsetExampleRunInput +`func (o *CreateActorRequest) UnsetExampleRunInput()` + +UnsetExampleRunInput ensures that no value is present for ExampleRunInput, not even an explicit nil +### GetIsDeprecated + +`func (o *CreateActorRequest) GetIsDeprecated() bool` + +GetIsDeprecated returns the IsDeprecated field if non-nil, zero value otherwise. + +### GetIsDeprecatedOk + +`func (o *CreateActorRequest) GetIsDeprecatedOk() (*bool, bool)` + +GetIsDeprecatedOk returns a tuple with the IsDeprecated field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetIsDeprecated + +`func (o *CreateActorRequest) SetIsDeprecated(v bool)` + +SetIsDeprecated sets IsDeprecated field to given value. + +### HasIsDeprecated + +`func (o *CreateActorRequest) HasIsDeprecated() bool` + +HasIsDeprecated returns a boolean if a field has been set. + +### SetIsDeprecatedNil + +`func (o *CreateActorRequest) SetIsDeprecatedNil(b bool)` + + SetIsDeprecatedNil sets the value for IsDeprecated to be an explicit nil + +### UnsetIsDeprecated +`func (o *CreateActorRequest) UnsetIsDeprecated()` + +UnsetIsDeprecated ensures that no value is present for IsDeprecated, not even an explicit nil + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/CreateOrUpdateVersionRequest.md b/docs/CreateOrUpdateVersionRequest.md new file mode 100644 index 0000000..e1908a7 --- /dev/null +++ b/docs/CreateOrUpdateVersionRequest.md @@ -0,0 +1,344 @@ +# CreateOrUpdateVersionRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**VersionNumber** | Pointer to **NullableString** | | [optional] +**SourceType** | Pointer to [**NullableVersionSourceType**](VersionSourceType.md) | | [optional] +**EnvVars** | Pointer to [**[]EnvVarRequest**](EnvVarRequest.md) | | [optional] +**ApplyEnvVarsToBuild** | Pointer to **NullableBool** | | [optional] +**BuildTag** | Pointer to **NullableString** | | [optional] +**SourceFiles** | Pointer to [**[]VersionSourceFilesInner**](VersionSourceFilesInner.md) | | [optional] +**GitRepoUrl** | Pointer to **NullableString** | URL of the Git repository when sourceType is GIT_REPO. | [optional] +**TarballUrl** | Pointer to **NullableString** | URL of the tarball when sourceType is TARBALL. | [optional] +**GitHubGistUrl** | Pointer to **NullableString** | URL of the GitHub Gist when sourceType is GITHUB_GIST. | [optional] + +## Methods + +### NewCreateOrUpdateVersionRequest + +`func NewCreateOrUpdateVersionRequest() *CreateOrUpdateVersionRequest` + +NewCreateOrUpdateVersionRequest instantiates a new CreateOrUpdateVersionRequest object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewCreateOrUpdateVersionRequestWithDefaults + +`func NewCreateOrUpdateVersionRequestWithDefaults() *CreateOrUpdateVersionRequest` + +NewCreateOrUpdateVersionRequestWithDefaults instantiates a new CreateOrUpdateVersionRequest object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetVersionNumber + +`func (o *CreateOrUpdateVersionRequest) GetVersionNumber() string` + +GetVersionNumber returns the VersionNumber field if non-nil, zero value otherwise. + +### GetVersionNumberOk + +`func (o *CreateOrUpdateVersionRequest) GetVersionNumberOk() (*string, bool)` + +GetVersionNumberOk returns a tuple with the VersionNumber field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetVersionNumber + +`func (o *CreateOrUpdateVersionRequest) SetVersionNumber(v string)` + +SetVersionNumber sets VersionNumber field to given value. + +### HasVersionNumber + +`func (o *CreateOrUpdateVersionRequest) HasVersionNumber() bool` + +HasVersionNumber returns a boolean if a field has been set. + +### SetVersionNumberNil + +`func (o *CreateOrUpdateVersionRequest) SetVersionNumberNil(b bool)` + + SetVersionNumberNil sets the value for VersionNumber to be an explicit nil + +### UnsetVersionNumber +`func (o *CreateOrUpdateVersionRequest) UnsetVersionNumber()` + +UnsetVersionNumber ensures that no value is present for VersionNumber, not even an explicit nil +### GetSourceType + +`func (o *CreateOrUpdateVersionRequest) GetSourceType() VersionSourceType` + +GetSourceType returns the SourceType field if non-nil, zero value otherwise. + +### GetSourceTypeOk + +`func (o *CreateOrUpdateVersionRequest) GetSourceTypeOk() (*VersionSourceType, bool)` + +GetSourceTypeOk returns a tuple with the SourceType field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSourceType + +`func (o *CreateOrUpdateVersionRequest) SetSourceType(v VersionSourceType)` + +SetSourceType sets SourceType field to given value. + +### HasSourceType + +`func (o *CreateOrUpdateVersionRequest) HasSourceType() bool` + +HasSourceType returns a boolean if a field has been set. + +### SetSourceTypeNil + +`func (o *CreateOrUpdateVersionRequest) SetSourceTypeNil(b bool)` + + SetSourceTypeNil sets the value for SourceType to be an explicit nil + +### UnsetSourceType +`func (o *CreateOrUpdateVersionRequest) UnsetSourceType()` + +UnsetSourceType ensures that no value is present for SourceType, not even an explicit nil +### GetEnvVars + +`func (o *CreateOrUpdateVersionRequest) GetEnvVars() []EnvVarRequest` + +GetEnvVars returns the EnvVars field if non-nil, zero value otherwise. + +### GetEnvVarsOk + +`func (o *CreateOrUpdateVersionRequest) GetEnvVarsOk() (*[]EnvVarRequest, bool)` + +GetEnvVarsOk returns a tuple with the EnvVars field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetEnvVars + +`func (o *CreateOrUpdateVersionRequest) SetEnvVars(v []EnvVarRequest)` + +SetEnvVars sets EnvVars field to given value. + +### HasEnvVars + +`func (o *CreateOrUpdateVersionRequest) HasEnvVars() bool` + +HasEnvVars returns a boolean if a field has been set. + +### SetEnvVarsNil + +`func (o *CreateOrUpdateVersionRequest) SetEnvVarsNil(b bool)` + + SetEnvVarsNil sets the value for EnvVars to be an explicit nil + +### UnsetEnvVars +`func (o *CreateOrUpdateVersionRequest) UnsetEnvVars()` + +UnsetEnvVars ensures that no value is present for EnvVars, not even an explicit nil +### GetApplyEnvVarsToBuild + +`func (o *CreateOrUpdateVersionRequest) GetApplyEnvVarsToBuild() bool` + +GetApplyEnvVarsToBuild returns the ApplyEnvVarsToBuild field if non-nil, zero value otherwise. + +### GetApplyEnvVarsToBuildOk + +`func (o *CreateOrUpdateVersionRequest) GetApplyEnvVarsToBuildOk() (*bool, bool)` + +GetApplyEnvVarsToBuildOk returns a tuple with the ApplyEnvVarsToBuild field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetApplyEnvVarsToBuild + +`func (o *CreateOrUpdateVersionRequest) SetApplyEnvVarsToBuild(v bool)` + +SetApplyEnvVarsToBuild sets ApplyEnvVarsToBuild field to given value. + +### HasApplyEnvVarsToBuild + +`func (o *CreateOrUpdateVersionRequest) HasApplyEnvVarsToBuild() bool` + +HasApplyEnvVarsToBuild returns a boolean if a field has been set. + +### SetApplyEnvVarsToBuildNil + +`func (o *CreateOrUpdateVersionRequest) SetApplyEnvVarsToBuildNil(b bool)` + + SetApplyEnvVarsToBuildNil sets the value for ApplyEnvVarsToBuild to be an explicit nil + +### UnsetApplyEnvVarsToBuild +`func (o *CreateOrUpdateVersionRequest) UnsetApplyEnvVarsToBuild()` + +UnsetApplyEnvVarsToBuild ensures that no value is present for ApplyEnvVarsToBuild, not even an explicit nil +### GetBuildTag + +`func (o *CreateOrUpdateVersionRequest) GetBuildTag() string` + +GetBuildTag returns the BuildTag field if non-nil, zero value otherwise. + +### GetBuildTagOk + +`func (o *CreateOrUpdateVersionRequest) GetBuildTagOk() (*string, bool)` + +GetBuildTagOk returns a tuple with the BuildTag field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetBuildTag + +`func (o *CreateOrUpdateVersionRequest) SetBuildTag(v string)` + +SetBuildTag sets BuildTag field to given value. + +### HasBuildTag + +`func (o *CreateOrUpdateVersionRequest) HasBuildTag() bool` + +HasBuildTag returns a boolean if a field has been set. + +### SetBuildTagNil + +`func (o *CreateOrUpdateVersionRequest) SetBuildTagNil(b bool)` + + SetBuildTagNil sets the value for BuildTag to be an explicit nil + +### UnsetBuildTag +`func (o *CreateOrUpdateVersionRequest) UnsetBuildTag()` + +UnsetBuildTag ensures that no value is present for BuildTag, not even an explicit nil +### GetSourceFiles + +`func (o *CreateOrUpdateVersionRequest) GetSourceFiles() []VersionSourceFilesInner` + +GetSourceFiles returns the SourceFiles field if non-nil, zero value otherwise. + +### GetSourceFilesOk + +`func (o *CreateOrUpdateVersionRequest) GetSourceFilesOk() (*[]VersionSourceFilesInner, bool)` + +GetSourceFilesOk returns a tuple with the SourceFiles field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSourceFiles + +`func (o *CreateOrUpdateVersionRequest) SetSourceFiles(v []VersionSourceFilesInner)` + +SetSourceFiles sets SourceFiles field to given value. + +### HasSourceFiles + +`func (o *CreateOrUpdateVersionRequest) HasSourceFiles() bool` + +HasSourceFiles returns a boolean if a field has been set. + +### GetGitRepoUrl + +`func (o *CreateOrUpdateVersionRequest) GetGitRepoUrl() string` + +GetGitRepoUrl returns the GitRepoUrl field if non-nil, zero value otherwise. + +### GetGitRepoUrlOk + +`func (o *CreateOrUpdateVersionRequest) GetGitRepoUrlOk() (*string, bool)` + +GetGitRepoUrlOk returns a tuple with the GitRepoUrl field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetGitRepoUrl + +`func (o *CreateOrUpdateVersionRequest) SetGitRepoUrl(v string)` + +SetGitRepoUrl sets GitRepoUrl field to given value. + +### HasGitRepoUrl + +`func (o *CreateOrUpdateVersionRequest) HasGitRepoUrl() bool` + +HasGitRepoUrl returns a boolean if a field has been set. + +### SetGitRepoUrlNil + +`func (o *CreateOrUpdateVersionRequest) SetGitRepoUrlNil(b bool)` + + SetGitRepoUrlNil sets the value for GitRepoUrl to be an explicit nil + +### UnsetGitRepoUrl +`func (o *CreateOrUpdateVersionRequest) UnsetGitRepoUrl()` + +UnsetGitRepoUrl ensures that no value is present for GitRepoUrl, not even an explicit nil +### GetTarballUrl + +`func (o *CreateOrUpdateVersionRequest) GetTarballUrl() string` + +GetTarballUrl returns the TarballUrl field if non-nil, zero value otherwise. + +### GetTarballUrlOk + +`func (o *CreateOrUpdateVersionRequest) GetTarballUrlOk() (*string, bool)` + +GetTarballUrlOk returns a tuple with the TarballUrl field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTarballUrl + +`func (o *CreateOrUpdateVersionRequest) SetTarballUrl(v string)` + +SetTarballUrl sets TarballUrl field to given value. + +### HasTarballUrl + +`func (o *CreateOrUpdateVersionRequest) HasTarballUrl() bool` + +HasTarballUrl returns a boolean if a field has been set. + +### SetTarballUrlNil + +`func (o *CreateOrUpdateVersionRequest) SetTarballUrlNil(b bool)` + + SetTarballUrlNil sets the value for TarballUrl to be an explicit nil + +### UnsetTarballUrl +`func (o *CreateOrUpdateVersionRequest) UnsetTarballUrl()` + +UnsetTarballUrl ensures that no value is present for TarballUrl, not even an explicit nil +### GetGitHubGistUrl + +`func (o *CreateOrUpdateVersionRequest) GetGitHubGistUrl() string` + +GetGitHubGistUrl returns the GitHubGistUrl field if non-nil, zero value otherwise. + +### GetGitHubGistUrlOk + +`func (o *CreateOrUpdateVersionRequest) GetGitHubGistUrlOk() (*string, bool)` + +GetGitHubGistUrlOk returns a tuple with the GitHubGistUrl field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetGitHubGistUrl + +`func (o *CreateOrUpdateVersionRequest) SetGitHubGistUrl(v string)` + +SetGitHubGistUrl sets GitHubGistUrl field to given value. + +### HasGitHubGistUrl + +`func (o *CreateOrUpdateVersionRequest) HasGitHubGistUrl() bool` + +HasGitHubGistUrl returns a boolean if a field has been set. + +### SetGitHubGistUrlNil + +`func (o *CreateOrUpdateVersionRequest) SetGitHubGistUrlNil(b bool)` + + SetGitHubGistUrlNil sets the value for GitHubGistUrl to be an explicit nil + +### UnsetGitHubGistUrl +`func (o *CreateOrUpdateVersionRequest) UnsetGitHubGistUrl()` + +UnsetGitHubGistUrl ensures that no value is present for GitHubGistUrl, not even an explicit nil + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/CreateTaskRequest.md b/docs/CreateTaskRequest.md new file mode 100644 index 0000000..732cc9e --- /dev/null +++ b/docs/CreateTaskRequest.md @@ -0,0 +1,221 @@ +# CreateTaskRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ActId** | **string** | | +**Name** | Pointer to **string** | | [optional] +**Options** | Pointer to [**NullableTaskOptions**](TaskOptions.md) | | [optional] +**Input** | Pointer to **map[string]interface{}** | The input configuration for the Actor task. This is a user-defined JSON object that will be passed to the Actor when the task is run. | [optional] +**Title** | Pointer to **NullableString** | | [optional] +**ActorStandby** | Pointer to [**NullableActorStandby**](ActorStandby.md) | | [optional] + +## Methods + +### NewCreateTaskRequest + +`func NewCreateTaskRequest(actId string, ) *CreateTaskRequest` + +NewCreateTaskRequest instantiates a new CreateTaskRequest object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewCreateTaskRequestWithDefaults + +`func NewCreateTaskRequestWithDefaults() *CreateTaskRequest` + +NewCreateTaskRequestWithDefaults instantiates a new CreateTaskRequest object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetActId + +`func (o *CreateTaskRequest) GetActId() string` + +GetActId returns the ActId field if non-nil, zero value otherwise. + +### GetActIdOk + +`func (o *CreateTaskRequest) GetActIdOk() (*string, bool)` + +GetActIdOk returns a tuple with the ActId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetActId + +`func (o *CreateTaskRequest) SetActId(v string)` + +SetActId sets ActId field to given value. + + +### GetName + +`func (o *CreateTaskRequest) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *CreateTaskRequest) GetNameOk() (*string, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetName + +`func (o *CreateTaskRequest) SetName(v string)` + +SetName sets Name field to given value. + +### HasName + +`func (o *CreateTaskRequest) HasName() bool` + +HasName returns a boolean if a field has been set. + +### GetOptions + +`func (o *CreateTaskRequest) GetOptions() TaskOptions` + +GetOptions returns the Options field if non-nil, zero value otherwise. + +### GetOptionsOk + +`func (o *CreateTaskRequest) GetOptionsOk() (*TaskOptions, bool)` + +GetOptionsOk returns a tuple with the Options field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetOptions + +`func (o *CreateTaskRequest) SetOptions(v TaskOptions)` + +SetOptions sets Options field to given value. + +### HasOptions + +`func (o *CreateTaskRequest) HasOptions() bool` + +HasOptions returns a boolean if a field has been set. + +### SetOptionsNil + +`func (o *CreateTaskRequest) SetOptionsNil(b bool)` + + SetOptionsNil sets the value for Options to be an explicit nil + +### UnsetOptions +`func (o *CreateTaskRequest) UnsetOptions()` + +UnsetOptions ensures that no value is present for Options, not even an explicit nil +### GetInput + +`func (o *CreateTaskRequest) GetInput() map[string]interface{}` + +GetInput returns the Input field if non-nil, zero value otherwise. + +### GetInputOk + +`func (o *CreateTaskRequest) GetInputOk() (*map[string]interface{}, bool)` + +GetInputOk returns a tuple with the Input field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetInput + +`func (o *CreateTaskRequest) SetInput(v map[string]interface{})` + +SetInput sets Input field to given value. + +### HasInput + +`func (o *CreateTaskRequest) HasInput() bool` + +HasInput returns a boolean if a field has been set. + +### SetInputNil + +`func (o *CreateTaskRequest) SetInputNil(b bool)` + + SetInputNil sets the value for Input to be an explicit nil + +### UnsetInput +`func (o *CreateTaskRequest) UnsetInput()` + +UnsetInput ensures that no value is present for Input, not even an explicit nil +### GetTitle + +`func (o *CreateTaskRequest) GetTitle() string` + +GetTitle returns the Title field if non-nil, zero value otherwise. + +### GetTitleOk + +`func (o *CreateTaskRequest) GetTitleOk() (*string, bool)` + +GetTitleOk returns a tuple with the Title field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTitle + +`func (o *CreateTaskRequest) SetTitle(v string)` + +SetTitle sets Title field to given value. + +### HasTitle + +`func (o *CreateTaskRequest) HasTitle() bool` + +HasTitle returns a boolean if a field has been set. + +### SetTitleNil + +`func (o *CreateTaskRequest) SetTitleNil(b bool)` + + SetTitleNil sets the value for Title to be an explicit nil + +### UnsetTitle +`func (o *CreateTaskRequest) UnsetTitle()` + +UnsetTitle ensures that no value is present for Title, not even an explicit nil +### GetActorStandby + +`func (o *CreateTaskRequest) GetActorStandby() ActorStandby` + +GetActorStandby returns the ActorStandby field if non-nil, zero value otherwise. + +### GetActorStandbyOk + +`func (o *CreateTaskRequest) GetActorStandbyOk() (*ActorStandby, bool)` + +GetActorStandbyOk returns a tuple with the ActorStandby field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetActorStandby + +`func (o *CreateTaskRequest) SetActorStandby(v ActorStandby)` + +SetActorStandby sets ActorStandby field to given value. + +### HasActorStandby + +`func (o *CreateTaskRequest) HasActorStandby() bool` + +HasActorStandby returns a boolean if a field has been set. + +### SetActorStandbyNil + +`func (o *CreateTaskRequest) SetActorStandbyNil(b bool)` + + SetActorStandbyNil sets the value for ActorStandby to be an explicit nil + +### UnsetActorStandby +`func (o *CreateTaskRequest) UnsetActorStandby()` + +UnsetActorStandby ensures that no value is present for ActorStandby, not even an explicit nil + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/Current.md b/docs/Current.md new file mode 100644 index 0000000..9e040bc --- /dev/null +++ b/docs/Current.md @@ -0,0 +1,266 @@ +# Current + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**MonthlyUsageUsd** | **float32** | | +**MonthlyActorComputeUnits** | **float32** | | +**MonthlyExternalDataTransferGbytes** | **float32** | | +**MonthlyProxySerps** | **int32** | | +**MonthlyResidentialProxyGbytes** | **float32** | | +**ActorMemoryGbytes** | **float32** | | +**ActorCount** | **int32** | | +**ActorTaskCount** | **int32** | | +**ActiveActorJobCount** | **int32** | | +**TeamAccountSeatCount** | **int32** | | +**ScheduleCount** | Pointer to **int32** | | [optional] + +## Methods + +### NewCurrent + +`func NewCurrent(monthlyUsageUsd float32, monthlyActorComputeUnits float32, monthlyExternalDataTransferGbytes float32, monthlyProxySerps int32, monthlyResidentialProxyGbytes float32, actorMemoryGbytes float32, actorCount int32, actorTaskCount int32, activeActorJobCount int32, teamAccountSeatCount int32, ) *Current` + +NewCurrent instantiates a new Current object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewCurrentWithDefaults + +`func NewCurrentWithDefaults() *Current` + +NewCurrentWithDefaults instantiates a new Current object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetMonthlyUsageUsd + +`func (o *Current) GetMonthlyUsageUsd() float32` + +GetMonthlyUsageUsd returns the MonthlyUsageUsd field if non-nil, zero value otherwise. + +### GetMonthlyUsageUsdOk + +`func (o *Current) GetMonthlyUsageUsdOk() (*float32, bool)` + +GetMonthlyUsageUsdOk returns a tuple with the MonthlyUsageUsd field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMonthlyUsageUsd + +`func (o *Current) SetMonthlyUsageUsd(v float32)` + +SetMonthlyUsageUsd sets MonthlyUsageUsd field to given value. + + +### GetMonthlyActorComputeUnits + +`func (o *Current) GetMonthlyActorComputeUnits() float32` + +GetMonthlyActorComputeUnits returns the MonthlyActorComputeUnits field if non-nil, zero value otherwise. + +### GetMonthlyActorComputeUnitsOk + +`func (o *Current) GetMonthlyActorComputeUnitsOk() (*float32, bool)` + +GetMonthlyActorComputeUnitsOk returns a tuple with the MonthlyActorComputeUnits field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMonthlyActorComputeUnits + +`func (o *Current) SetMonthlyActorComputeUnits(v float32)` + +SetMonthlyActorComputeUnits sets MonthlyActorComputeUnits field to given value. + + +### GetMonthlyExternalDataTransferGbytes + +`func (o *Current) GetMonthlyExternalDataTransferGbytes() float32` + +GetMonthlyExternalDataTransferGbytes returns the MonthlyExternalDataTransferGbytes field if non-nil, zero value otherwise. + +### GetMonthlyExternalDataTransferGbytesOk + +`func (o *Current) GetMonthlyExternalDataTransferGbytesOk() (*float32, bool)` + +GetMonthlyExternalDataTransferGbytesOk returns a tuple with the MonthlyExternalDataTransferGbytes field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMonthlyExternalDataTransferGbytes + +`func (o *Current) SetMonthlyExternalDataTransferGbytes(v float32)` + +SetMonthlyExternalDataTransferGbytes sets MonthlyExternalDataTransferGbytes field to given value. + + +### GetMonthlyProxySerps + +`func (o *Current) GetMonthlyProxySerps() int32` + +GetMonthlyProxySerps returns the MonthlyProxySerps field if non-nil, zero value otherwise. + +### GetMonthlyProxySerpsOk + +`func (o *Current) GetMonthlyProxySerpsOk() (*int32, bool)` + +GetMonthlyProxySerpsOk returns a tuple with the MonthlyProxySerps field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMonthlyProxySerps + +`func (o *Current) SetMonthlyProxySerps(v int32)` + +SetMonthlyProxySerps sets MonthlyProxySerps field to given value. + + +### GetMonthlyResidentialProxyGbytes + +`func (o *Current) GetMonthlyResidentialProxyGbytes() float32` + +GetMonthlyResidentialProxyGbytes returns the MonthlyResidentialProxyGbytes field if non-nil, zero value otherwise. + +### GetMonthlyResidentialProxyGbytesOk + +`func (o *Current) GetMonthlyResidentialProxyGbytesOk() (*float32, bool)` + +GetMonthlyResidentialProxyGbytesOk returns a tuple with the MonthlyResidentialProxyGbytes field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMonthlyResidentialProxyGbytes + +`func (o *Current) SetMonthlyResidentialProxyGbytes(v float32)` + +SetMonthlyResidentialProxyGbytes sets MonthlyResidentialProxyGbytes field to given value. + + +### GetActorMemoryGbytes + +`func (o *Current) GetActorMemoryGbytes() float32` + +GetActorMemoryGbytes returns the ActorMemoryGbytes field if non-nil, zero value otherwise. + +### GetActorMemoryGbytesOk + +`func (o *Current) GetActorMemoryGbytesOk() (*float32, bool)` + +GetActorMemoryGbytesOk returns a tuple with the ActorMemoryGbytes field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetActorMemoryGbytes + +`func (o *Current) SetActorMemoryGbytes(v float32)` + +SetActorMemoryGbytes sets ActorMemoryGbytes field to given value. + + +### GetActorCount + +`func (o *Current) GetActorCount() int32` + +GetActorCount returns the ActorCount field if non-nil, zero value otherwise. + +### GetActorCountOk + +`func (o *Current) GetActorCountOk() (*int32, bool)` + +GetActorCountOk returns a tuple with the ActorCount field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetActorCount + +`func (o *Current) SetActorCount(v int32)` + +SetActorCount sets ActorCount field to given value. + + +### GetActorTaskCount + +`func (o *Current) GetActorTaskCount() int32` + +GetActorTaskCount returns the ActorTaskCount field if non-nil, zero value otherwise. + +### GetActorTaskCountOk + +`func (o *Current) GetActorTaskCountOk() (*int32, bool)` + +GetActorTaskCountOk returns a tuple with the ActorTaskCount field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetActorTaskCount + +`func (o *Current) SetActorTaskCount(v int32)` + +SetActorTaskCount sets ActorTaskCount field to given value. + + +### GetActiveActorJobCount + +`func (o *Current) GetActiveActorJobCount() int32` + +GetActiveActorJobCount returns the ActiveActorJobCount field if non-nil, zero value otherwise. + +### GetActiveActorJobCountOk + +`func (o *Current) GetActiveActorJobCountOk() (*int32, bool)` + +GetActiveActorJobCountOk returns a tuple with the ActiveActorJobCount field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetActiveActorJobCount + +`func (o *Current) SetActiveActorJobCount(v int32)` + +SetActiveActorJobCount sets ActiveActorJobCount field to given value. + + +### GetTeamAccountSeatCount + +`func (o *Current) GetTeamAccountSeatCount() int32` + +GetTeamAccountSeatCount returns the TeamAccountSeatCount field if non-nil, zero value otherwise. + +### GetTeamAccountSeatCountOk + +`func (o *Current) GetTeamAccountSeatCountOk() (*int32, bool)` + +GetTeamAccountSeatCountOk returns a tuple with the TeamAccountSeatCount field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTeamAccountSeatCount + +`func (o *Current) SetTeamAccountSeatCount(v int32)` + +SetTeamAccountSeatCount sets TeamAccountSeatCount field to given value. + + +### GetScheduleCount + +`func (o *Current) GetScheduleCount() int32` + +GetScheduleCount returns the ScheduleCount field if non-nil, zero value otherwise. + +### GetScheduleCountOk + +`func (o *Current) GetScheduleCountOk() (*int32, bool)` + +GetScheduleCountOk returns a tuple with the ScheduleCount field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetScheduleCount + +`func (o *Current) SetScheduleCount(v int32)` + +SetScheduleCount sets ScheduleCount field to given value. + +### HasScheduleCount + +`func (o *Current) HasScheduleCount() bool` + +HasScheduleCount returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/CurrentPricingInfo.md b/docs/CurrentPricingInfo.md new file mode 100644 index 0000000..996b071 --- /dev/null +++ b/docs/CurrentPricingInfo.md @@ -0,0 +1,495 @@ +# CurrentPricingInfo + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**PricingModel** | **string** | | +**ApifyMarginPercentage** | Pointer to **float32** | | [optional] +**CreatedAt** | Pointer to **time.Time** | | [optional] +**StartedAt** | Pointer to **time.Time** | | [optional] +**NotifiedAboutChangeAt** | Pointer to **NullableTime** | | [optional] +**NotifiedAboutFutureChangeAt** | Pointer to **NullableTime** | | [optional] +**IsPriceChangeNotificationSuppressed** | Pointer to **bool** | | [optional] +**ForceContainsSignificantPriceChange** | Pointer to **bool** | | [optional] +**IsPPEPlatformUsagePaidByUser** | Pointer to **bool** | | [optional] +**ReasonForChange** | Pointer to **NullableString** | | [optional] +**TrialMinutes** | Pointer to **NullableInt32** | | [optional] +**UnitName** | Pointer to **NullableString** | | [optional] +**PricePerUnitUsd** | Pointer to **NullableFloat32** | | [optional] +**MinimalMaxTotalChargeUsd** | Pointer to **NullableFloat32** | | [optional] +**PricingPerEvent** | Pointer to **map[string]interface{}** | Per-event pricing configuration for pay-per-event Actors. | [optional] + +## Methods + +### NewCurrentPricingInfo + +`func NewCurrentPricingInfo(pricingModel string, ) *CurrentPricingInfo` + +NewCurrentPricingInfo instantiates a new CurrentPricingInfo object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewCurrentPricingInfoWithDefaults + +`func NewCurrentPricingInfoWithDefaults() *CurrentPricingInfo` + +NewCurrentPricingInfoWithDefaults instantiates a new CurrentPricingInfo object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetPricingModel + +`func (o *CurrentPricingInfo) GetPricingModel() string` + +GetPricingModel returns the PricingModel field if non-nil, zero value otherwise. + +### GetPricingModelOk + +`func (o *CurrentPricingInfo) GetPricingModelOk() (*string, bool)` + +GetPricingModelOk returns a tuple with the PricingModel field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPricingModel + +`func (o *CurrentPricingInfo) SetPricingModel(v string)` + +SetPricingModel sets PricingModel field to given value. + + +### GetApifyMarginPercentage + +`func (o *CurrentPricingInfo) GetApifyMarginPercentage() float32` + +GetApifyMarginPercentage returns the ApifyMarginPercentage field if non-nil, zero value otherwise. + +### GetApifyMarginPercentageOk + +`func (o *CurrentPricingInfo) GetApifyMarginPercentageOk() (*float32, bool)` + +GetApifyMarginPercentageOk returns a tuple with the ApifyMarginPercentage field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetApifyMarginPercentage + +`func (o *CurrentPricingInfo) SetApifyMarginPercentage(v float32)` + +SetApifyMarginPercentage sets ApifyMarginPercentage field to given value. + +### HasApifyMarginPercentage + +`func (o *CurrentPricingInfo) HasApifyMarginPercentage() bool` + +HasApifyMarginPercentage returns a boolean if a field has been set. + +### GetCreatedAt + +`func (o *CurrentPricingInfo) GetCreatedAt() time.Time` + +GetCreatedAt returns the CreatedAt field if non-nil, zero value otherwise. + +### GetCreatedAtOk + +`func (o *CurrentPricingInfo) GetCreatedAtOk() (*time.Time, bool)` + +GetCreatedAtOk returns a tuple with the CreatedAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCreatedAt + +`func (o *CurrentPricingInfo) SetCreatedAt(v time.Time)` + +SetCreatedAt sets CreatedAt field to given value. + +### HasCreatedAt + +`func (o *CurrentPricingInfo) HasCreatedAt() bool` + +HasCreatedAt returns a boolean if a field has been set. + +### GetStartedAt + +`func (o *CurrentPricingInfo) GetStartedAt() time.Time` + +GetStartedAt returns the StartedAt field if non-nil, zero value otherwise. + +### GetStartedAtOk + +`func (o *CurrentPricingInfo) GetStartedAtOk() (*time.Time, bool)` + +GetStartedAtOk returns a tuple with the StartedAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetStartedAt + +`func (o *CurrentPricingInfo) SetStartedAt(v time.Time)` + +SetStartedAt sets StartedAt field to given value. + +### HasStartedAt + +`func (o *CurrentPricingInfo) HasStartedAt() bool` + +HasStartedAt returns a boolean if a field has been set. + +### GetNotifiedAboutChangeAt + +`func (o *CurrentPricingInfo) GetNotifiedAboutChangeAt() time.Time` + +GetNotifiedAboutChangeAt returns the NotifiedAboutChangeAt field if non-nil, zero value otherwise. + +### GetNotifiedAboutChangeAtOk + +`func (o *CurrentPricingInfo) GetNotifiedAboutChangeAtOk() (*time.Time, bool)` + +GetNotifiedAboutChangeAtOk returns a tuple with the NotifiedAboutChangeAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetNotifiedAboutChangeAt + +`func (o *CurrentPricingInfo) SetNotifiedAboutChangeAt(v time.Time)` + +SetNotifiedAboutChangeAt sets NotifiedAboutChangeAt field to given value. + +### HasNotifiedAboutChangeAt + +`func (o *CurrentPricingInfo) HasNotifiedAboutChangeAt() bool` + +HasNotifiedAboutChangeAt returns a boolean if a field has been set. + +### SetNotifiedAboutChangeAtNil + +`func (o *CurrentPricingInfo) SetNotifiedAboutChangeAtNil(b bool)` + + SetNotifiedAboutChangeAtNil sets the value for NotifiedAboutChangeAt to be an explicit nil + +### UnsetNotifiedAboutChangeAt +`func (o *CurrentPricingInfo) UnsetNotifiedAboutChangeAt()` + +UnsetNotifiedAboutChangeAt ensures that no value is present for NotifiedAboutChangeAt, not even an explicit nil +### GetNotifiedAboutFutureChangeAt + +`func (o *CurrentPricingInfo) GetNotifiedAboutFutureChangeAt() time.Time` + +GetNotifiedAboutFutureChangeAt returns the NotifiedAboutFutureChangeAt field if non-nil, zero value otherwise. + +### GetNotifiedAboutFutureChangeAtOk + +`func (o *CurrentPricingInfo) GetNotifiedAboutFutureChangeAtOk() (*time.Time, bool)` + +GetNotifiedAboutFutureChangeAtOk returns a tuple with the NotifiedAboutFutureChangeAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetNotifiedAboutFutureChangeAt + +`func (o *CurrentPricingInfo) SetNotifiedAboutFutureChangeAt(v time.Time)` + +SetNotifiedAboutFutureChangeAt sets NotifiedAboutFutureChangeAt field to given value. + +### HasNotifiedAboutFutureChangeAt + +`func (o *CurrentPricingInfo) HasNotifiedAboutFutureChangeAt() bool` + +HasNotifiedAboutFutureChangeAt returns a boolean if a field has been set. + +### SetNotifiedAboutFutureChangeAtNil + +`func (o *CurrentPricingInfo) SetNotifiedAboutFutureChangeAtNil(b bool)` + + SetNotifiedAboutFutureChangeAtNil sets the value for NotifiedAboutFutureChangeAt to be an explicit nil + +### UnsetNotifiedAboutFutureChangeAt +`func (o *CurrentPricingInfo) UnsetNotifiedAboutFutureChangeAt()` + +UnsetNotifiedAboutFutureChangeAt ensures that no value is present for NotifiedAboutFutureChangeAt, not even an explicit nil +### GetIsPriceChangeNotificationSuppressed + +`func (o *CurrentPricingInfo) GetIsPriceChangeNotificationSuppressed() bool` + +GetIsPriceChangeNotificationSuppressed returns the IsPriceChangeNotificationSuppressed field if non-nil, zero value otherwise. + +### GetIsPriceChangeNotificationSuppressedOk + +`func (o *CurrentPricingInfo) GetIsPriceChangeNotificationSuppressedOk() (*bool, bool)` + +GetIsPriceChangeNotificationSuppressedOk returns a tuple with the IsPriceChangeNotificationSuppressed field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetIsPriceChangeNotificationSuppressed + +`func (o *CurrentPricingInfo) SetIsPriceChangeNotificationSuppressed(v bool)` + +SetIsPriceChangeNotificationSuppressed sets IsPriceChangeNotificationSuppressed field to given value. + +### HasIsPriceChangeNotificationSuppressed + +`func (o *CurrentPricingInfo) HasIsPriceChangeNotificationSuppressed() bool` + +HasIsPriceChangeNotificationSuppressed returns a boolean if a field has been set. + +### GetForceContainsSignificantPriceChange + +`func (o *CurrentPricingInfo) GetForceContainsSignificantPriceChange() bool` + +GetForceContainsSignificantPriceChange returns the ForceContainsSignificantPriceChange field if non-nil, zero value otherwise. + +### GetForceContainsSignificantPriceChangeOk + +`func (o *CurrentPricingInfo) GetForceContainsSignificantPriceChangeOk() (*bool, bool)` + +GetForceContainsSignificantPriceChangeOk returns a tuple with the ForceContainsSignificantPriceChange field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetForceContainsSignificantPriceChange + +`func (o *CurrentPricingInfo) SetForceContainsSignificantPriceChange(v bool)` + +SetForceContainsSignificantPriceChange sets ForceContainsSignificantPriceChange field to given value. + +### HasForceContainsSignificantPriceChange + +`func (o *CurrentPricingInfo) HasForceContainsSignificantPriceChange() bool` + +HasForceContainsSignificantPriceChange returns a boolean if a field has been set. + +### GetIsPPEPlatformUsagePaidByUser + +`func (o *CurrentPricingInfo) GetIsPPEPlatformUsagePaidByUser() bool` + +GetIsPPEPlatformUsagePaidByUser returns the IsPPEPlatformUsagePaidByUser field if non-nil, zero value otherwise. + +### GetIsPPEPlatformUsagePaidByUserOk + +`func (o *CurrentPricingInfo) GetIsPPEPlatformUsagePaidByUserOk() (*bool, bool)` + +GetIsPPEPlatformUsagePaidByUserOk returns a tuple with the IsPPEPlatformUsagePaidByUser field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetIsPPEPlatformUsagePaidByUser + +`func (o *CurrentPricingInfo) SetIsPPEPlatformUsagePaidByUser(v bool)` + +SetIsPPEPlatformUsagePaidByUser sets IsPPEPlatformUsagePaidByUser field to given value. + +### HasIsPPEPlatformUsagePaidByUser + +`func (o *CurrentPricingInfo) HasIsPPEPlatformUsagePaidByUser() bool` + +HasIsPPEPlatformUsagePaidByUser returns a boolean if a field has been set. + +### GetReasonForChange + +`func (o *CurrentPricingInfo) GetReasonForChange() string` + +GetReasonForChange returns the ReasonForChange field if non-nil, zero value otherwise. + +### GetReasonForChangeOk + +`func (o *CurrentPricingInfo) GetReasonForChangeOk() (*string, bool)` + +GetReasonForChangeOk returns a tuple with the ReasonForChange field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetReasonForChange + +`func (o *CurrentPricingInfo) SetReasonForChange(v string)` + +SetReasonForChange sets ReasonForChange field to given value. + +### HasReasonForChange + +`func (o *CurrentPricingInfo) HasReasonForChange() bool` + +HasReasonForChange returns a boolean if a field has been set. + +### SetReasonForChangeNil + +`func (o *CurrentPricingInfo) SetReasonForChangeNil(b bool)` + + SetReasonForChangeNil sets the value for ReasonForChange to be an explicit nil + +### UnsetReasonForChange +`func (o *CurrentPricingInfo) UnsetReasonForChange()` + +UnsetReasonForChange ensures that no value is present for ReasonForChange, not even an explicit nil +### GetTrialMinutes + +`func (o *CurrentPricingInfo) GetTrialMinutes() int32` + +GetTrialMinutes returns the TrialMinutes field if non-nil, zero value otherwise. + +### GetTrialMinutesOk + +`func (o *CurrentPricingInfo) GetTrialMinutesOk() (*int32, bool)` + +GetTrialMinutesOk returns a tuple with the TrialMinutes field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTrialMinutes + +`func (o *CurrentPricingInfo) SetTrialMinutes(v int32)` + +SetTrialMinutes sets TrialMinutes field to given value. + +### HasTrialMinutes + +`func (o *CurrentPricingInfo) HasTrialMinutes() bool` + +HasTrialMinutes returns a boolean if a field has been set. + +### SetTrialMinutesNil + +`func (o *CurrentPricingInfo) SetTrialMinutesNil(b bool)` + + SetTrialMinutesNil sets the value for TrialMinutes to be an explicit nil + +### UnsetTrialMinutes +`func (o *CurrentPricingInfo) UnsetTrialMinutes()` + +UnsetTrialMinutes ensures that no value is present for TrialMinutes, not even an explicit nil +### GetUnitName + +`func (o *CurrentPricingInfo) GetUnitName() string` + +GetUnitName returns the UnitName field if non-nil, zero value otherwise. + +### GetUnitNameOk + +`func (o *CurrentPricingInfo) GetUnitNameOk() (*string, bool)` + +GetUnitNameOk returns a tuple with the UnitName field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUnitName + +`func (o *CurrentPricingInfo) SetUnitName(v string)` + +SetUnitName sets UnitName field to given value. + +### HasUnitName + +`func (o *CurrentPricingInfo) HasUnitName() bool` + +HasUnitName returns a boolean if a field has been set. + +### SetUnitNameNil + +`func (o *CurrentPricingInfo) SetUnitNameNil(b bool)` + + SetUnitNameNil sets the value for UnitName to be an explicit nil + +### UnsetUnitName +`func (o *CurrentPricingInfo) UnsetUnitName()` + +UnsetUnitName ensures that no value is present for UnitName, not even an explicit nil +### GetPricePerUnitUsd + +`func (o *CurrentPricingInfo) GetPricePerUnitUsd() float32` + +GetPricePerUnitUsd returns the PricePerUnitUsd field if non-nil, zero value otherwise. + +### GetPricePerUnitUsdOk + +`func (o *CurrentPricingInfo) GetPricePerUnitUsdOk() (*float32, bool)` + +GetPricePerUnitUsdOk returns a tuple with the PricePerUnitUsd field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPricePerUnitUsd + +`func (o *CurrentPricingInfo) SetPricePerUnitUsd(v float32)` + +SetPricePerUnitUsd sets PricePerUnitUsd field to given value. + +### HasPricePerUnitUsd + +`func (o *CurrentPricingInfo) HasPricePerUnitUsd() bool` + +HasPricePerUnitUsd returns a boolean if a field has been set. + +### SetPricePerUnitUsdNil + +`func (o *CurrentPricingInfo) SetPricePerUnitUsdNil(b bool)` + + SetPricePerUnitUsdNil sets the value for PricePerUnitUsd to be an explicit nil + +### UnsetPricePerUnitUsd +`func (o *CurrentPricingInfo) UnsetPricePerUnitUsd()` + +UnsetPricePerUnitUsd ensures that no value is present for PricePerUnitUsd, not even an explicit nil +### GetMinimalMaxTotalChargeUsd + +`func (o *CurrentPricingInfo) GetMinimalMaxTotalChargeUsd() float32` + +GetMinimalMaxTotalChargeUsd returns the MinimalMaxTotalChargeUsd field if non-nil, zero value otherwise. + +### GetMinimalMaxTotalChargeUsdOk + +`func (o *CurrentPricingInfo) GetMinimalMaxTotalChargeUsdOk() (*float32, bool)` + +GetMinimalMaxTotalChargeUsdOk returns a tuple with the MinimalMaxTotalChargeUsd field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMinimalMaxTotalChargeUsd + +`func (o *CurrentPricingInfo) SetMinimalMaxTotalChargeUsd(v float32)` + +SetMinimalMaxTotalChargeUsd sets MinimalMaxTotalChargeUsd field to given value. + +### HasMinimalMaxTotalChargeUsd + +`func (o *CurrentPricingInfo) HasMinimalMaxTotalChargeUsd() bool` + +HasMinimalMaxTotalChargeUsd returns a boolean if a field has been set. + +### SetMinimalMaxTotalChargeUsdNil + +`func (o *CurrentPricingInfo) SetMinimalMaxTotalChargeUsdNil(b bool)` + + SetMinimalMaxTotalChargeUsdNil sets the value for MinimalMaxTotalChargeUsd to be an explicit nil + +### UnsetMinimalMaxTotalChargeUsd +`func (o *CurrentPricingInfo) UnsetMinimalMaxTotalChargeUsd()` + +UnsetMinimalMaxTotalChargeUsd ensures that no value is present for MinimalMaxTotalChargeUsd, not even an explicit nil +### GetPricingPerEvent + +`func (o *CurrentPricingInfo) GetPricingPerEvent() map[string]interface{}` + +GetPricingPerEvent returns the PricingPerEvent field if non-nil, zero value otherwise. + +### GetPricingPerEventOk + +`func (o *CurrentPricingInfo) GetPricingPerEventOk() (*map[string]interface{}, bool)` + +GetPricingPerEventOk returns a tuple with the PricingPerEvent field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPricingPerEvent + +`func (o *CurrentPricingInfo) SetPricingPerEvent(v map[string]interface{})` + +SetPricingPerEvent sets PricingPerEvent field to given value. + +### HasPricingPerEvent + +`func (o *CurrentPricingInfo) HasPricingPerEvent() bool` + +HasPricingPerEvent returns a boolean if a field has been set. + +### SetPricingPerEventNil + +`func (o *CurrentPricingInfo) SetPricingPerEventNil(b bool)` + + SetPricingPerEventNil sets the value for PricingPerEvent to be an explicit nil + +### UnsetPricingPerEvent +`func (o *CurrentPricingInfo) UnsetPricingPerEvent()` + +UnsetPricingPerEvent ensures that no value is present for PricingPerEvent, not even an explicit nil + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/DailyServiceUsages.md b/docs/DailyServiceUsages.md new file mode 100644 index 0000000..28bcb21 --- /dev/null +++ b/docs/DailyServiceUsages.md @@ -0,0 +1,93 @@ +# DailyServiceUsages + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Date** | **string** | | +**ServiceUsage** | [**map[string]UsageItem**](UsageItem.md) | A map of service usage item names to their usage details. | +**TotalUsageCreditsUsd** | **float32** | | + +## Methods + +### NewDailyServiceUsages + +`func NewDailyServiceUsages(date string, serviceUsage map[string]UsageItem, totalUsageCreditsUsd float32, ) *DailyServiceUsages` + +NewDailyServiceUsages instantiates a new DailyServiceUsages object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewDailyServiceUsagesWithDefaults + +`func NewDailyServiceUsagesWithDefaults() *DailyServiceUsages` + +NewDailyServiceUsagesWithDefaults instantiates a new DailyServiceUsages object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetDate + +`func (o *DailyServiceUsages) GetDate() string` + +GetDate returns the Date field if non-nil, zero value otherwise. + +### GetDateOk + +`func (o *DailyServiceUsages) GetDateOk() (*string, bool)` + +GetDateOk returns a tuple with the Date field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDate + +`func (o *DailyServiceUsages) SetDate(v string)` + +SetDate sets Date field to given value. + + +### GetServiceUsage + +`func (o *DailyServiceUsages) GetServiceUsage() map[string]UsageItem` + +GetServiceUsage returns the ServiceUsage field if non-nil, zero value otherwise. + +### GetServiceUsageOk + +`func (o *DailyServiceUsages) GetServiceUsageOk() (*map[string]UsageItem, bool)` + +GetServiceUsageOk returns a tuple with the ServiceUsage field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetServiceUsage + +`func (o *DailyServiceUsages) SetServiceUsage(v map[string]UsageItem)` + +SetServiceUsage sets ServiceUsage field to given value. + + +### GetTotalUsageCreditsUsd + +`func (o *DailyServiceUsages) GetTotalUsageCreditsUsd() float32` + +GetTotalUsageCreditsUsd returns the TotalUsageCreditsUsd field if non-nil, zero value otherwise. + +### GetTotalUsageCreditsUsdOk + +`func (o *DailyServiceUsages) GetTotalUsageCreditsUsdOk() (*float32, bool)` + +GetTotalUsageCreditsUsdOk returns a tuple with the TotalUsageCreditsUsd field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTotalUsageCreditsUsd + +`func (o *DailyServiceUsages) SetTotalUsageCreditsUsd(v float32)` + +SetTotalUsageCreditsUsd sets TotalUsageCreditsUsd field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/Dataset.md b/docs/Dataset.md new file mode 100644 index 0000000..f07c7cf --- /dev/null +++ b/docs/Dataset.md @@ -0,0 +1,492 @@ +# Dataset + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **string** | | +**Name** | Pointer to **NullableString** | | [optional] +**UserId** | **string** | | +**CreatedAt** | **time.Time** | | +**ModifiedAt** | **time.Time** | | +**AccessedAt** | **time.Time** | | +**ItemCount** | **int32** | | +**CleanItemCount** | **int32** | | +**ActId** | Pointer to **NullableString** | | [optional] +**ActRunId** | Pointer to **NullableString** | | [optional] +**Fields** | Pointer to **[]string** | | [optional] +**Schema** | Pointer to **map[string]interface{}** | Defines the schema of items in your dataset, the full specification can be found in [Apify docs](/platform/actors/development/actor-definition/dataset-schema) | [optional] +**ConsoleUrl** | **string** | | +**ItemsPublicUrl** | Pointer to **string** | A public link to access the dataset items directly. | [optional] +**UrlSigningSecretKey** | Pointer to **NullableString** | A secret key for generating signed public URLs. It is only provided to clients with WRITE permission for the dataset. | [optional] +**GeneralAccess** | Pointer to [**GeneralAccess**](GeneralAccess.md) | | [optional] +**Stats** | Pointer to [**DatasetStats**](DatasetStats.md) | | [optional] + +## Methods + +### NewDataset + +`func NewDataset(id string, userId string, createdAt time.Time, modifiedAt time.Time, accessedAt time.Time, itemCount int32, cleanItemCount int32, consoleUrl string, ) *Dataset` + +NewDataset instantiates a new Dataset object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewDatasetWithDefaults + +`func NewDatasetWithDefaults() *Dataset` + +NewDatasetWithDefaults instantiates a new Dataset object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetId + +`func (o *Dataset) GetId() string` + +GetId returns the Id field if non-nil, zero value otherwise. + +### GetIdOk + +`func (o *Dataset) GetIdOk() (*string, bool)` + +GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetId + +`func (o *Dataset) SetId(v string)` + +SetId sets Id field to given value. + + +### GetName + +`func (o *Dataset) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *Dataset) GetNameOk() (*string, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetName + +`func (o *Dataset) SetName(v string)` + +SetName sets Name field to given value. + +### HasName + +`func (o *Dataset) HasName() bool` + +HasName returns a boolean if a field has been set. + +### SetNameNil + +`func (o *Dataset) SetNameNil(b bool)` + + SetNameNil sets the value for Name to be an explicit nil + +### UnsetName +`func (o *Dataset) UnsetName()` + +UnsetName ensures that no value is present for Name, not even an explicit nil +### GetUserId + +`func (o *Dataset) GetUserId() string` + +GetUserId returns the UserId field if non-nil, zero value otherwise. + +### GetUserIdOk + +`func (o *Dataset) GetUserIdOk() (*string, bool)` + +GetUserIdOk returns a tuple with the UserId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUserId + +`func (o *Dataset) SetUserId(v string)` + +SetUserId sets UserId field to given value. + + +### GetCreatedAt + +`func (o *Dataset) GetCreatedAt() time.Time` + +GetCreatedAt returns the CreatedAt field if non-nil, zero value otherwise. + +### GetCreatedAtOk + +`func (o *Dataset) GetCreatedAtOk() (*time.Time, bool)` + +GetCreatedAtOk returns a tuple with the CreatedAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCreatedAt + +`func (o *Dataset) SetCreatedAt(v time.Time)` + +SetCreatedAt sets CreatedAt field to given value. + + +### GetModifiedAt + +`func (o *Dataset) GetModifiedAt() time.Time` + +GetModifiedAt returns the ModifiedAt field if non-nil, zero value otherwise. + +### GetModifiedAtOk + +`func (o *Dataset) GetModifiedAtOk() (*time.Time, bool)` + +GetModifiedAtOk returns a tuple with the ModifiedAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetModifiedAt + +`func (o *Dataset) SetModifiedAt(v time.Time)` + +SetModifiedAt sets ModifiedAt field to given value. + + +### GetAccessedAt + +`func (o *Dataset) GetAccessedAt() time.Time` + +GetAccessedAt returns the AccessedAt field if non-nil, zero value otherwise. + +### GetAccessedAtOk + +`func (o *Dataset) GetAccessedAtOk() (*time.Time, bool)` + +GetAccessedAtOk returns a tuple with the AccessedAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAccessedAt + +`func (o *Dataset) SetAccessedAt(v time.Time)` + +SetAccessedAt sets AccessedAt field to given value. + + +### GetItemCount + +`func (o *Dataset) GetItemCount() int32` + +GetItemCount returns the ItemCount field if non-nil, zero value otherwise. + +### GetItemCountOk + +`func (o *Dataset) GetItemCountOk() (*int32, bool)` + +GetItemCountOk returns a tuple with the ItemCount field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetItemCount + +`func (o *Dataset) SetItemCount(v int32)` + +SetItemCount sets ItemCount field to given value. + + +### GetCleanItemCount + +`func (o *Dataset) GetCleanItemCount() int32` + +GetCleanItemCount returns the CleanItemCount field if non-nil, zero value otherwise. + +### GetCleanItemCountOk + +`func (o *Dataset) GetCleanItemCountOk() (*int32, bool)` + +GetCleanItemCountOk returns a tuple with the CleanItemCount field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCleanItemCount + +`func (o *Dataset) SetCleanItemCount(v int32)` + +SetCleanItemCount sets CleanItemCount field to given value. + + +### GetActId + +`func (o *Dataset) GetActId() string` + +GetActId returns the ActId field if non-nil, zero value otherwise. + +### GetActIdOk + +`func (o *Dataset) GetActIdOk() (*string, bool)` + +GetActIdOk returns a tuple with the ActId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetActId + +`func (o *Dataset) SetActId(v string)` + +SetActId sets ActId field to given value. + +### HasActId + +`func (o *Dataset) HasActId() bool` + +HasActId returns a boolean if a field has been set. + +### SetActIdNil + +`func (o *Dataset) SetActIdNil(b bool)` + + SetActIdNil sets the value for ActId to be an explicit nil + +### UnsetActId +`func (o *Dataset) UnsetActId()` + +UnsetActId ensures that no value is present for ActId, not even an explicit nil +### GetActRunId + +`func (o *Dataset) GetActRunId() string` + +GetActRunId returns the ActRunId field if non-nil, zero value otherwise. + +### GetActRunIdOk + +`func (o *Dataset) GetActRunIdOk() (*string, bool)` + +GetActRunIdOk returns a tuple with the ActRunId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetActRunId + +`func (o *Dataset) SetActRunId(v string)` + +SetActRunId sets ActRunId field to given value. + +### HasActRunId + +`func (o *Dataset) HasActRunId() bool` + +HasActRunId returns a boolean if a field has been set. + +### SetActRunIdNil + +`func (o *Dataset) SetActRunIdNil(b bool)` + + SetActRunIdNil sets the value for ActRunId to be an explicit nil + +### UnsetActRunId +`func (o *Dataset) UnsetActRunId()` + +UnsetActRunId ensures that no value is present for ActRunId, not even an explicit nil +### GetFields + +`func (o *Dataset) GetFields() []string` + +GetFields returns the Fields field if non-nil, zero value otherwise. + +### GetFieldsOk + +`func (o *Dataset) GetFieldsOk() (*[]string, bool)` + +GetFieldsOk returns a tuple with the Fields field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetFields + +`func (o *Dataset) SetFields(v []string)` + +SetFields sets Fields field to given value. + +### HasFields + +`func (o *Dataset) HasFields() bool` + +HasFields returns a boolean if a field has been set. + +### SetFieldsNil + +`func (o *Dataset) SetFieldsNil(b bool)` + + SetFieldsNil sets the value for Fields to be an explicit nil + +### UnsetFields +`func (o *Dataset) UnsetFields()` + +UnsetFields ensures that no value is present for Fields, not even an explicit nil +### GetSchema + +`func (o *Dataset) GetSchema() map[string]interface{}` + +GetSchema returns the Schema field if non-nil, zero value otherwise. + +### GetSchemaOk + +`func (o *Dataset) GetSchemaOk() (*map[string]interface{}, bool)` + +GetSchemaOk returns a tuple with the Schema field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSchema + +`func (o *Dataset) SetSchema(v map[string]interface{})` + +SetSchema sets Schema field to given value. + +### HasSchema + +`func (o *Dataset) HasSchema() bool` + +HasSchema returns a boolean if a field has been set. + +### SetSchemaNil + +`func (o *Dataset) SetSchemaNil(b bool)` + + SetSchemaNil sets the value for Schema to be an explicit nil + +### UnsetSchema +`func (o *Dataset) UnsetSchema()` + +UnsetSchema ensures that no value is present for Schema, not even an explicit nil +### GetConsoleUrl + +`func (o *Dataset) GetConsoleUrl() string` + +GetConsoleUrl returns the ConsoleUrl field if non-nil, zero value otherwise. + +### GetConsoleUrlOk + +`func (o *Dataset) GetConsoleUrlOk() (*string, bool)` + +GetConsoleUrlOk returns a tuple with the ConsoleUrl field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetConsoleUrl + +`func (o *Dataset) SetConsoleUrl(v string)` + +SetConsoleUrl sets ConsoleUrl field to given value. + + +### GetItemsPublicUrl + +`func (o *Dataset) GetItemsPublicUrl() string` + +GetItemsPublicUrl returns the ItemsPublicUrl field if non-nil, zero value otherwise. + +### GetItemsPublicUrlOk + +`func (o *Dataset) GetItemsPublicUrlOk() (*string, bool)` + +GetItemsPublicUrlOk returns a tuple with the ItemsPublicUrl field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetItemsPublicUrl + +`func (o *Dataset) SetItemsPublicUrl(v string)` + +SetItemsPublicUrl sets ItemsPublicUrl field to given value. + +### HasItemsPublicUrl + +`func (o *Dataset) HasItemsPublicUrl() bool` + +HasItemsPublicUrl returns a boolean if a field has been set. + +### GetUrlSigningSecretKey + +`func (o *Dataset) GetUrlSigningSecretKey() string` + +GetUrlSigningSecretKey returns the UrlSigningSecretKey field if non-nil, zero value otherwise. + +### GetUrlSigningSecretKeyOk + +`func (o *Dataset) GetUrlSigningSecretKeyOk() (*string, bool)` + +GetUrlSigningSecretKeyOk returns a tuple with the UrlSigningSecretKey field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUrlSigningSecretKey + +`func (o *Dataset) SetUrlSigningSecretKey(v string)` + +SetUrlSigningSecretKey sets UrlSigningSecretKey field to given value. + +### HasUrlSigningSecretKey + +`func (o *Dataset) HasUrlSigningSecretKey() bool` + +HasUrlSigningSecretKey returns a boolean if a field has been set. + +### SetUrlSigningSecretKeyNil + +`func (o *Dataset) SetUrlSigningSecretKeyNil(b bool)` + + SetUrlSigningSecretKeyNil sets the value for UrlSigningSecretKey to be an explicit nil + +### UnsetUrlSigningSecretKey +`func (o *Dataset) UnsetUrlSigningSecretKey()` + +UnsetUrlSigningSecretKey ensures that no value is present for UrlSigningSecretKey, not even an explicit nil +### GetGeneralAccess + +`func (o *Dataset) GetGeneralAccess() GeneralAccess` + +GetGeneralAccess returns the GeneralAccess field if non-nil, zero value otherwise. + +### GetGeneralAccessOk + +`func (o *Dataset) GetGeneralAccessOk() (*GeneralAccess, bool)` + +GetGeneralAccessOk returns a tuple with the GeneralAccess field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetGeneralAccess + +`func (o *Dataset) SetGeneralAccess(v GeneralAccess)` + +SetGeneralAccess sets GeneralAccess field to given value. + +### HasGeneralAccess + +`func (o *Dataset) HasGeneralAccess() bool` + +HasGeneralAccess returns a boolean if a field has been set. + +### GetStats + +`func (o *Dataset) GetStats() DatasetStats` + +GetStats returns the Stats field if non-nil, zero value otherwise. + +### GetStatsOk + +`func (o *Dataset) GetStatsOk() (*DatasetStats, bool)` + +GetStatsOk returns a tuple with the Stats field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetStats + +`func (o *Dataset) SetStats(v DatasetStats)` + +SetStats sets Stats field to given value. + +### HasStats + +`func (o *Dataset) HasStats() bool` + +HasStats returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/DatasetFieldStatistics.md b/docs/DatasetFieldStatistics.md new file mode 100644 index 0000000..a50dcc1 --- /dev/null +++ b/docs/DatasetFieldStatistics.md @@ -0,0 +1,174 @@ +# DatasetFieldStatistics + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Min** | Pointer to **NullableFloat32** | Minimum value of the field. For numbers, this is calculated directly. For strings, this is the length of the shortest string. For arrays, this is the length of the shortest array. For objects, this is the number of keys in the smallest object. | [optional] +**Max** | Pointer to **NullableFloat32** | Maximum value of the field. For numbers, this is calculated directly. For strings, this is the length of the longest string. For arrays, this is the length of the longest array. For objects, this is the number of keys in the largest object. | [optional] +**NullCount** | Pointer to **NullableInt32** | How many items in the dataset have a null value for this field. | [optional] +**EmptyCount** | Pointer to **NullableInt32** | How many items in the dataset are `undefined`, meaning that for example empty string is not considered empty. | [optional] + +## Methods + +### NewDatasetFieldStatistics + +`func NewDatasetFieldStatistics() *DatasetFieldStatistics` + +NewDatasetFieldStatistics instantiates a new DatasetFieldStatistics object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewDatasetFieldStatisticsWithDefaults + +`func NewDatasetFieldStatisticsWithDefaults() *DatasetFieldStatistics` + +NewDatasetFieldStatisticsWithDefaults instantiates a new DatasetFieldStatistics object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetMin + +`func (o *DatasetFieldStatistics) GetMin() float32` + +GetMin returns the Min field if non-nil, zero value otherwise. + +### GetMinOk + +`func (o *DatasetFieldStatistics) GetMinOk() (*float32, bool)` + +GetMinOk returns a tuple with the Min field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMin + +`func (o *DatasetFieldStatistics) SetMin(v float32)` + +SetMin sets Min field to given value. + +### HasMin + +`func (o *DatasetFieldStatistics) HasMin() bool` + +HasMin returns a boolean if a field has been set. + +### SetMinNil + +`func (o *DatasetFieldStatistics) SetMinNil(b bool)` + + SetMinNil sets the value for Min to be an explicit nil + +### UnsetMin +`func (o *DatasetFieldStatistics) UnsetMin()` + +UnsetMin ensures that no value is present for Min, not even an explicit nil +### GetMax + +`func (o *DatasetFieldStatistics) GetMax() float32` + +GetMax returns the Max field if non-nil, zero value otherwise. + +### GetMaxOk + +`func (o *DatasetFieldStatistics) GetMaxOk() (*float32, bool)` + +GetMaxOk returns a tuple with the Max field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMax + +`func (o *DatasetFieldStatistics) SetMax(v float32)` + +SetMax sets Max field to given value. + +### HasMax + +`func (o *DatasetFieldStatistics) HasMax() bool` + +HasMax returns a boolean if a field has been set. + +### SetMaxNil + +`func (o *DatasetFieldStatistics) SetMaxNil(b bool)` + + SetMaxNil sets the value for Max to be an explicit nil + +### UnsetMax +`func (o *DatasetFieldStatistics) UnsetMax()` + +UnsetMax ensures that no value is present for Max, not even an explicit nil +### GetNullCount + +`func (o *DatasetFieldStatistics) GetNullCount() int32` + +GetNullCount returns the NullCount field if non-nil, zero value otherwise. + +### GetNullCountOk + +`func (o *DatasetFieldStatistics) GetNullCountOk() (*int32, bool)` + +GetNullCountOk returns a tuple with the NullCount field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetNullCount + +`func (o *DatasetFieldStatistics) SetNullCount(v int32)` + +SetNullCount sets NullCount field to given value. + +### HasNullCount + +`func (o *DatasetFieldStatistics) HasNullCount() bool` + +HasNullCount returns a boolean if a field has been set. + +### SetNullCountNil + +`func (o *DatasetFieldStatistics) SetNullCountNil(b bool)` + + SetNullCountNil sets the value for NullCount to be an explicit nil + +### UnsetNullCount +`func (o *DatasetFieldStatistics) UnsetNullCount()` + +UnsetNullCount ensures that no value is present for NullCount, not even an explicit nil +### GetEmptyCount + +`func (o *DatasetFieldStatistics) GetEmptyCount() int32` + +GetEmptyCount returns the EmptyCount field if non-nil, zero value otherwise. + +### GetEmptyCountOk + +`func (o *DatasetFieldStatistics) GetEmptyCountOk() (*int32, bool)` + +GetEmptyCountOk returns a tuple with the EmptyCount field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetEmptyCount + +`func (o *DatasetFieldStatistics) SetEmptyCount(v int32)` + +SetEmptyCount sets EmptyCount field to given value. + +### HasEmptyCount + +`func (o *DatasetFieldStatistics) HasEmptyCount() bool` + +HasEmptyCount returns a boolean if a field has been set. + +### SetEmptyCountNil + +`func (o *DatasetFieldStatistics) SetEmptyCountNil(b bool)` + + SetEmptyCountNil sets the value for EmptyCount to be an explicit nil + +### UnsetEmptyCount +`func (o *DatasetFieldStatistics) UnsetEmptyCount()` + +UnsetEmptyCount ensures that no value is present for EmptyCount, not even an explicit nil + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/DatasetListItem.md b/docs/DatasetListItem.md new file mode 100644 index 0000000..9b2e590 --- /dev/null +++ b/docs/DatasetListItem.md @@ -0,0 +1,384 @@ +# DatasetListItem + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **string** | | +**Name** | **string** | | +**UserId** | **string** | | +**CreatedAt** | **time.Time** | | +**ModifiedAt** | **time.Time** | | +**AccessedAt** | **time.Time** | | +**ItemCount** | **int32** | | +**CleanItemCount** | **int32** | | +**ActId** | Pointer to **NullableString** | | [optional] +**ActRunId** | Pointer to **NullableString** | | [optional] +**Title** | Pointer to **NullableString** | | [optional] +**Username** | Pointer to **string** | | [optional] +**GeneralAccess** | Pointer to [**GeneralAccess**](GeneralAccess.md) | | [optional] +**Stats** | Pointer to [**DatasetStats**](DatasetStats.md) | | [optional] + +## Methods + +### NewDatasetListItem + +`func NewDatasetListItem(id string, name string, userId string, createdAt time.Time, modifiedAt time.Time, accessedAt time.Time, itemCount int32, cleanItemCount int32, ) *DatasetListItem` + +NewDatasetListItem instantiates a new DatasetListItem object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewDatasetListItemWithDefaults + +`func NewDatasetListItemWithDefaults() *DatasetListItem` + +NewDatasetListItemWithDefaults instantiates a new DatasetListItem object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetId + +`func (o *DatasetListItem) GetId() string` + +GetId returns the Id field if non-nil, zero value otherwise. + +### GetIdOk + +`func (o *DatasetListItem) GetIdOk() (*string, bool)` + +GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetId + +`func (o *DatasetListItem) SetId(v string)` + +SetId sets Id field to given value. + + +### GetName + +`func (o *DatasetListItem) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *DatasetListItem) GetNameOk() (*string, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetName + +`func (o *DatasetListItem) SetName(v string)` + +SetName sets Name field to given value. + + +### GetUserId + +`func (o *DatasetListItem) GetUserId() string` + +GetUserId returns the UserId field if non-nil, zero value otherwise. + +### GetUserIdOk + +`func (o *DatasetListItem) GetUserIdOk() (*string, bool)` + +GetUserIdOk returns a tuple with the UserId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUserId + +`func (o *DatasetListItem) SetUserId(v string)` + +SetUserId sets UserId field to given value. + + +### GetCreatedAt + +`func (o *DatasetListItem) GetCreatedAt() time.Time` + +GetCreatedAt returns the CreatedAt field if non-nil, zero value otherwise. + +### GetCreatedAtOk + +`func (o *DatasetListItem) GetCreatedAtOk() (*time.Time, bool)` + +GetCreatedAtOk returns a tuple with the CreatedAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCreatedAt + +`func (o *DatasetListItem) SetCreatedAt(v time.Time)` + +SetCreatedAt sets CreatedAt field to given value. + + +### GetModifiedAt + +`func (o *DatasetListItem) GetModifiedAt() time.Time` + +GetModifiedAt returns the ModifiedAt field if non-nil, zero value otherwise. + +### GetModifiedAtOk + +`func (o *DatasetListItem) GetModifiedAtOk() (*time.Time, bool)` + +GetModifiedAtOk returns a tuple with the ModifiedAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetModifiedAt + +`func (o *DatasetListItem) SetModifiedAt(v time.Time)` + +SetModifiedAt sets ModifiedAt field to given value. + + +### GetAccessedAt + +`func (o *DatasetListItem) GetAccessedAt() time.Time` + +GetAccessedAt returns the AccessedAt field if non-nil, zero value otherwise. + +### GetAccessedAtOk + +`func (o *DatasetListItem) GetAccessedAtOk() (*time.Time, bool)` + +GetAccessedAtOk returns a tuple with the AccessedAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAccessedAt + +`func (o *DatasetListItem) SetAccessedAt(v time.Time)` + +SetAccessedAt sets AccessedAt field to given value. + + +### GetItemCount + +`func (o *DatasetListItem) GetItemCount() int32` + +GetItemCount returns the ItemCount field if non-nil, zero value otherwise. + +### GetItemCountOk + +`func (o *DatasetListItem) GetItemCountOk() (*int32, bool)` + +GetItemCountOk returns a tuple with the ItemCount field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetItemCount + +`func (o *DatasetListItem) SetItemCount(v int32)` + +SetItemCount sets ItemCount field to given value. + + +### GetCleanItemCount + +`func (o *DatasetListItem) GetCleanItemCount() int32` + +GetCleanItemCount returns the CleanItemCount field if non-nil, zero value otherwise. + +### GetCleanItemCountOk + +`func (o *DatasetListItem) GetCleanItemCountOk() (*int32, bool)` + +GetCleanItemCountOk returns a tuple with the CleanItemCount field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCleanItemCount + +`func (o *DatasetListItem) SetCleanItemCount(v int32)` + +SetCleanItemCount sets CleanItemCount field to given value. + + +### GetActId + +`func (o *DatasetListItem) GetActId() string` + +GetActId returns the ActId field if non-nil, zero value otherwise. + +### GetActIdOk + +`func (o *DatasetListItem) GetActIdOk() (*string, bool)` + +GetActIdOk returns a tuple with the ActId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetActId + +`func (o *DatasetListItem) SetActId(v string)` + +SetActId sets ActId field to given value. + +### HasActId + +`func (o *DatasetListItem) HasActId() bool` + +HasActId returns a boolean if a field has been set. + +### SetActIdNil + +`func (o *DatasetListItem) SetActIdNil(b bool)` + + SetActIdNil sets the value for ActId to be an explicit nil + +### UnsetActId +`func (o *DatasetListItem) UnsetActId()` + +UnsetActId ensures that no value is present for ActId, not even an explicit nil +### GetActRunId + +`func (o *DatasetListItem) GetActRunId() string` + +GetActRunId returns the ActRunId field if non-nil, zero value otherwise. + +### GetActRunIdOk + +`func (o *DatasetListItem) GetActRunIdOk() (*string, bool)` + +GetActRunIdOk returns a tuple with the ActRunId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetActRunId + +`func (o *DatasetListItem) SetActRunId(v string)` + +SetActRunId sets ActRunId field to given value. + +### HasActRunId + +`func (o *DatasetListItem) HasActRunId() bool` + +HasActRunId returns a boolean if a field has been set. + +### SetActRunIdNil + +`func (o *DatasetListItem) SetActRunIdNil(b bool)` + + SetActRunIdNil sets the value for ActRunId to be an explicit nil + +### UnsetActRunId +`func (o *DatasetListItem) UnsetActRunId()` + +UnsetActRunId ensures that no value is present for ActRunId, not even an explicit nil +### GetTitle + +`func (o *DatasetListItem) GetTitle() string` + +GetTitle returns the Title field if non-nil, zero value otherwise. + +### GetTitleOk + +`func (o *DatasetListItem) GetTitleOk() (*string, bool)` + +GetTitleOk returns a tuple with the Title field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTitle + +`func (o *DatasetListItem) SetTitle(v string)` + +SetTitle sets Title field to given value. + +### HasTitle + +`func (o *DatasetListItem) HasTitle() bool` + +HasTitle returns a boolean if a field has been set. + +### SetTitleNil + +`func (o *DatasetListItem) SetTitleNil(b bool)` + + SetTitleNil sets the value for Title to be an explicit nil + +### UnsetTitle +`func (o *DatasetListItem) UnsetTitle()` + +UnsetTitle ensures that no value is present for Title, not even an explicit nil +### GetUsername + +`func (o *DatasetListItem) GetUsername() string` + +GetUsername returns the Username field if non-nil, zero value otherwise. + +### GetUsernameOk + +`func (o *DatasetListItem) GetUsernameOk() (*string, bool)` + +GetUsernameOk returns a tuple with the Username field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUsername + +`func (o *DatasetListItem) SetUsername(v string)` + +SetUsername sets Username field to given value. + +### HasUsername + +`func (o *DatasetListItem) HasUsername() bool` + +HasUsername returns a boolean if a field has been set. + +### GetGeneralAccess + +`func (o *DatasetListItem) GetGeneralAccess() GeneralAccess` + +GetGeneralAccess returns the GeneralAccess field if non-nil, zero value otherwise. + +### GetGeneralAccessOk + +`func (o *DatasetListItem) GetGeneralAccessOk() (*GeneralAccess, bool)` + +GetGeneralAccessOk returns a tuple with the GeneralAccess field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetGeneralAccess + +`func (o *DatasetListItem) SetGeneralAccess(v GeneralAccess)` + +SetGeneralAccess sets GeneralAccess field to given value. + +### HasGeneralAccess + +`func (o *DatasetListItem) HasGeneralAccess() bool` + +HasGeneralAccess returns a boolean if a field has been set. + +### GetStats + +`func (o *DatasetListItem) GetStats() DatasetStats` + +GetStats returns the Stats field if non-nil, zero value otherwise. + +### GetStatsOk + +`func (o *DatasetListItem) GetStatsOk() (*DatasetStats, bool)` + +GetStatsOk returns a tuple with the Stats field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetStats + +`func (o *DatasetListItem) SetStats(v DatasetStats)` + +SetStats sets Stats field to given value. + +### HasStats + +`func (o *DatasetListItem) HasStats() bool` + +HasStats returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/DatasetResponse.md b/docs/DatasetResponse.md new file mode 100644 index 0000000..f1b5ffc --- /dev/null +++ b/docs/DatasetResponse.md @@ -0,0 +1,51 @@ +# DatasetResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Data** | [**Dataset**](Dataset.md) | | + +## Methods + +### NewDatasetResponse + +`func NewDatasetResponse(data Dataset, ) *DatasetResponse` + +NewDatasetResponse instantiates a new DatasetResponse object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewDatasetResponseWithDefaults + +`func NewDatasetResponseWithDefaults() *DatasetResponse` + +NewDatasetResponseWithDefaults instantiates a new DatasetResponse object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetData + +`func (o *DatasetResponse) GetData() Dataset` + +GetData returns the Data field if non-nil, zero value otherwise. + +### GetDataOk + +`func (o *DatasetResponse) GetDataOk() (*Dataset, bool)` + +GetDataOk returns a tuple with the Data field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetData + +`func (o *DatasetResponse) SetData(v Dataset)` + +SetData sets Data field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/DatasetSchemaValidationError.md b/docs/DatasetSchemaValidationError.md new file mode 100644 index 0000000..735c415 --- /dev/null +++ b/docs/DatasetSchemaValidationError.md @@ -0,0 +1,108 @@ +# DatasetSchemaValidationError + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Type** | Pointer to **string** | The type of the error. | [optional] +**Message** | Pointer to **string** | A human-readable message describing the error. | [optional] +**Data** | Pointer to [**SchemaValidationErrorData**](SchemaValidationErrorData.md) | | [optional] + +## Methods + +### NewDatasetSchemaValidationError + +`func NewDatasetSchemaValidationError() *DatasetSchemaValidationError` + +NewDatasetSchemaValidationError instantiates a new DatasetSchemaValidationError object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewDatasetSchemaValidationErrorWithDefaults + +`func NewDatasetSchemaValidationErrorWithDefaults() *DatasetSchemaValidationError` + +NewDatasetSchemaValidationErrorWithDefaults instantiates a new DatasetSchemaValidationError object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetType + +`func (o *DatasetSchemaValidationError) GetType() string` + +GetType returns the Type field if non-nil, zero value otherwise. + +### GetTypeOk + +`func (o *DatasetSchemaValidationError) GetTypeOk() (*string, bool)` + +GetTypeOk returns a tuple with the Type field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetType + +`func (o *DatasetSchemaValidationError) SetType(v string)` + +SetType sets Type field to given value. + +### HasType + +`func (o *DatasetSchemaValidationError) HasType() bool` + +HasType returns a boolean if a field has been set. + +### GetMessage + +`func (o *DatasetSchemaValidationError) GetMessage() string` + +GetMessage returns the Message field if non-nil, zero value otherwise. + +### GetMessageOk + +`func (o *DatasetSchemaValidationError) GetMessageOk() (*string, bool)` + +GetMessageOk returns a tuple with the Message field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMessage + +`func (o *DatasetSchemaValidationError) SetMessage(v string)` + +SetMessage sets Message field to given value. + +### HasMessage + +`func (o *DatasetSchemaValidationError) HasMessage() bool` + +HasMessage returns a boolean if a field has been set. + +### GetData + +`func (o *DatasetSchemaValidationError) GetData() SchemaValidationErrorData` + +GetData returns the Data field if non-nil, zero value otherwise. + +### GetDataOk + +`func (o *DatasetSchemaValidationError) GetDataOk() (*SchemaValidationErrorData, bool)` + +GetDataOk returns a tuple with the Data field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetData + +`func (o *DatasetSchemaValidationError) SetData(v SchemaValidationErrorData)` + +SetData sets Data field to given value. + +### HasData + +`func (o *DatasetSchemaValidationError) HasData() bool` + +HasData returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/DatasetStatistics.md b/docs/DatasetStatistics.md new file mode 100644 index 0000000..2c81410 --- /dev/null +++ b/docs/DatasetStatistics.md @@ -0,0 +1,56 @@ +# DatasetStatistics + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**FieldStatistics** | Pointer to [**map[string]DatasetFieldStatistics**](DatasetFieldStatistics.md) | When you configure the dataset [fields schema](https://docs.apify.com/platform/actors/development/actor-definition/dataset-schema/validation), we measure the statistics such as `min`, `max`, `nullCount` and `emptyCount` for each field. This property provides statistics for each field from dataset fields schema. <br/></br>See dataset field statistics [documentation](https://docs.apify.com/platform/actors/development/actor-definition/dataset-schema/validation#dataset-field-statistics) for more information. | [optional] + +## Methods + +### NewDatasetStatistics + +`func NewDatasetStatistics() *DatasetStatistics` + +NewDatasetStatistics instantiates a new DatasetStatistics object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewDatasetStatisticsWithDefaults + +`func NewDatasetStatisticsWithDefaults() *DatasetStatistics` + +NewDatasetStatisticsWithDefaults instantiates a new DatasetStatistics object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetFieldStatistics + +`func (o *DatasetStatistics) GetFieldStatistics() map[string]DatasetFieldStatistics` + +GetFieldStatistics returns the FieldStatistics field if non-nil, zero value otherwise. + +### GetFieldStatisticsOk + +`func (o *DatasetStatistics) GetFieldStatisticsOk() (*map[string]DatasetFieldStatistics, bool)` + +GetFieldStatisticsOk returns a tuple with the FieldStatistics field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetFieldStatistics + +`func (o *DatasetStatistics) SetFieldStatistics(v map[string]DatasetFieldStatistics)` + +SetFieldStatistics sets FieldStatistics field to given value. + +### HasFieldStatistics + +`func (o *DatasetStatistics) HasFieldStatistics() bool` + +HasFieldStatistics returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/DatasetStatisticsResponse.md b/docs/DatasetStatisticsResponse.md new file mode 100644 index 0000000..d01346c --- /dev/null +++ b/docs/DatasetStatisticsResponse.md @@ -0,0 +1,51 @@ +# DatasetStatisticsResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Data** | [**DatasetStatistics**](DatasetStatistics.md) | | + +## Methods + +### NewDatasetStatisticsResponse + +`func NewDatasetStatisticsResponse(data DatasetStatistics, ) *DatasetStatisticsResponse` + +NewDatasetStatisticsResponse instantiates a new DatasetStatisticsResponse object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewDatasetStatisticsResponseWithDefaults + +`func NewDatasetStatisticsResponseWithDefaults() *DatasetStatisticsResponse` + +NewDatasetStatisticsResponseWithDefaults instantiates a new DatasetStatisticsResponse object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetData + +`func (o *DatasetStatisticsResponse) GetData() DatasetStatistics` + +GetData returns the Data field if non-nil, zero value otherwise. + +### GetDataOk + +`func (o *DatasetStatisticsResponse) GetDataOk() (*DatasetStatistics, bool)` + +GetDataOk returns a tuple with the Data field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetData + +`func (o *DatasetStatisticsResponse) SetData(v DatasetStatistics)` + +SetData sets Data field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/DatasetStats.md b/docs/DatasetStats.md new file mode 100644 index 0000000..96b7e81 --- /dev/null +++ b/docs/DatasetStats.md @@ -0,0 +1,134 @@ +# DatasetStats + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ReadCount** | Pointer to **int32** | | [optional] +**WriteCount** | Pointer to **int32** | | [optional] +**StorageBytes** | Pointer to **int32** | Total storage size in bytes. Only returned by the single-dataset endpoint. | [optional] +**InflatedBytes** | Pointer to **int32** | Uncompressed size in bytes. Only returned by the dataset list endpoint. | [optional] + +## Methods + +### NewDatasetStats + +`func NewDatasetStats() *DatasetStats` + +NewDatasetStats instantiates a new DatasetStats object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewDatasetStatsWithDefaults + +`func NewDatasetStatsWithDefaults() *DatasetStats` + +NewDatasetStatsWithDefaults instantiates a new DatasetStats object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetReadCount + +`func (o *DatasetStats) GetReadCount() int32` + +GetReadCount returns the ReadCount field if non-nil, zero value otherwise. + +### GetReadCountOk + +`func (o *DatasetStats) GetReadCountOk() (*int32, bool)` + +GetReadCountOk returns a tuple with the ReadCount field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetReadCount + +`func (o *DatasetStats) SetReadCount(v int32)` + +SetReadCount sets ReadCount field to given value. + +### HasReadCount + +`func (o *DatasetStats) HasReadCount() bool` + +HasReadCount returns a boolean if a field has been set. + +### GetWriteCount + +`func (o *DatasetStats) GetWriteCount() int32` + +GetWriteCount returns the WriteCount field if non-nil, zero value otherwise. + +### GetWriteCountOk + +`func (o *DatasetStats) GetWriteCountOk() (*int32, bool)` + +GetWriteCountOk returns a tuple with the WriteCount field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetWriteCount + +`func (o *DatasetStats) SetWriteCount(v int32)` + +SetWriteCount sets WriteCount field to given value. + +### HasWriteCount + +`func (o *DatasetStats) HasWriteCount() bool` + +HasWriteCount returns a boolean if a field has been set. + +### GetStorageBytes + +`func (o *DatasetStats) GetStorageBytes() int32` + +GetStorageBytes returns the StorageBytes field if non-nil, zero value otherwise. + +### GetStorageBytesOk + +`func (o *DatasetStats) GetStorageBytesOk() (*int32, bool)` + +GetStorageBytesOk returns a tuple with the StorageBytes field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetStorageBytes + +`func (o *DatasetStats) SetStorageBytes(v int32)` + +SetStorageBytes sets StorageBytes field to given value. + +### HasStorageBytes + +`func (o *DatasetStats) HasStorageBytes() bool` + +HasStorageBytes returns a boolean if a field has been set. + +### GetInflatedBytes + +`func (o *DatasetStats) GetInflatedBytes() int32` + +GetInflatedBytes returns the InflatedBytes field if non-nil, zero value otherwise. + +### GetInflatedBytesOk + +`func (o *DatasetStats) GetInflatedBytesOk() (*int32, bool)` + +GetInflatedBytesOk returns a tuple with the InflatedBytes field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetInflatedBytes + +`func (o *DatasetStats) SetInflatedBytes(v int32)` + +SetInflatedBytes sets InflatedBytes field to given value. + +### HasInflatedBytes + +`func (o *DatasetStats) HasInflatedBytes() bool` + +HasInflatedBytes returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/DecodeAndVerifyData.md b/docs/DecodeAndVerifyData.md new file mode 100644 index 0000000..cee005d --- /dev/null +++ b/docs/DecodeAndVerifyData.md @@ -0,0 +1,113 @@ +# DecodeAndVerifyData + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Decoded** | **interface{}** | | +**EncodedByUserId** | **NullableString** | | +**IsVerifiedUser** | **bool** | | + +## Methods + +### NewDecodeAndVerifyData + +`func NewDecodeAndVerifyData(decoded interface{}, encodedByUserId NullableString, isVerifiedUser bool, ) *DecodeAndVerifyData` + +NewDecodeAndVerifyData instantiates a new DecodeAndVerifyData object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewDecodeAndVerifyDataWithDefaults + +`func NewDecodeAndVerifyDataWithDefaults() *DecodeAndVerifyData` + +NewDecodeAndVerifyDataWithDefaults instantiates a new DecodeAndVerifyData object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetDecoded + +`func (o *DecodeAndVerifyData) GetDecoded() interface{}` + +GetDecoded returns the Decoded field if non-nil, zero value otherwise. + +### GetDecodedOk + +`func (o *DecodeAndVerifyData) GetDecodedOk() (*interface{}, bool)` + +GetDecodedOk returns a tuple with the Decoded field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDecoded + +`func (o *DecodeAndVerifyData) SetDecoded(v interface{})` + +SetDecoded sets Decoded field to given value. + + +### SetDecodedNil + +`func (o *DecodeAndVerifyData) SetDecodedNil(b bool)` + + SetDecodedNil sets the value for Decoded to be an explicit nil + +### UnsetDecoded +`func (o *DecodeAndVerifyData) UnsetDecoded()` + +UnsetDecoded ensures that no value is present for Decoded, not even an explicit nil +### GetEncodedByUserId + +`func (o *DecodeAndVerifyData) GetEncodedByUserId() string` + +GetEncodedByUserId returns the EncodedByUserId field if non-nil, zero value otherwise. + +### GetEncodedByUserIdOk + +`func (o *DecodeAndVerifyData) GetEncodedByUserIdOk() (*string, bool)` + +GetEncodedByUserIdOk returns a tuple with the EncodedByUserId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetEncodedByUserId + +`func (o *DecodeAndVerifyData) SetEncodedByUserId(v string)` + +SetEncodedByUserId sets EncodedByUserId field to given value. + + +### SetEncodedByUserIdNil + +`func (o *DecodeAndVerifyData) SetEncodedByUserIdNil(b bool)` + + SetEncodedByUserIdNil sets the value for EncodedByUserId to be an explicit nil + +### UnsetEncodedByUserId +`func (o *DecodeAndVerifyData) UnsetEncodedByUserId()` + +UnsetEncodedByUserId ensures that no value is present for EncodedByUserId, not even an explicit nil +### GetIsVerifiedUser + +`func (o *DecodeAndVerifyData) GetIsVerifiedUser() bool` + +GetIsVerifiedUser returns the IsVerifiedUser field if non-nil, zero value otherwise. + +### GetIsVerifiedUserOk + +`func (o *DecodeAndVerifyData) GetIsVerifiedUserOk() (*bool, bool)` + +GetIsVerifiedUserOk returns a tuple with the IsVerifiedUser field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetIsVerifiedUser + +`func (o *DecodeAndVerifyData) SetIsVerifiedUser(v bool)` + +SetIsVerifiedUser sets IsVerifiedUser field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/DecodeAndVerifyRequest.md b/docs/DecodeAndVerifyRequest.md new file mode 100644 index 0000000..5d5f674 --- /dev/null +++ b/docs/DecodeAndVerifyRequest.md @@ -0,0 +1,51 @@ +# DecodeAndVerifyRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Encoded** | **string** | | + +## Methods + +### NewDecodeAndVerifyRequest + +`func NewDecodeAndVerifyRequest(encoded string, ) *DecodeAndVerifyRequest` + +NewDecodeAndVerifyRequest instantiates a new DecodeAndVerifyRequest object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewDecodeAndVerifyRequestWithDefaults + +`func NewDecodeAndVerifyRequestWithDefaults() *DecodeAndVerifyRequest` + +NewDecodeAndVerifyRequestWithDefaults instantiates a new DecodeAndVerifyRequest object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetEncoded + +`func (o *DecodeAndVerifyRequest) GetEncoded() string` + +GetEncoded returns the Encoded field if non-nil, zero value otherwise. + +### GetEncodedOk + +`func (o *DecodeAndVerifyRequest) GetEncodedOk() (*string, bool)` + +GetEncodedOk returns a tuple with the Encoded field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetEncoded + +`func (o *DecodeAndVerifyRequest) SetEncoded(v string)` + +SetEncoded sets Encoded field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/DecodeAndVerifyResponse.md b/docs/DecodeAndVerifyResponse.md new file mode 100644 index 0000000..cf99b1e --- /dev/null +++ b/docs/DecodeAndVerifyResponse.md @@ -0,0 +1,51 @@ +# DecodeAndVerifyResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Data** | [**DecodeAndVerifyData**](DecodeAndVerifyData.md) | | + +## Methods + +### NewDecodeAndVerifyResponse + +`func NewDecodeAndVerifyResponse(data DecodeAndVerifyData, ) *DecodeAndVerifyResponse` + +NewDecodeAndVerifyResponse instantiates a new DecodeAndVerifyResponse object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewDecodeAndVerifyResponseWithDefaults + +`func NewDecodeAndVerifyResponseWithDefaults() *DecodeAndVerifyResponse` + +NewDecodeAndVerifyResponseWithDefaults instantiates a new DecodeAndVerifyResponse object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetData + +`func (o *DecodeAndVerifyResponse) GetData() DecodeAndVerifyData` + +GetData returns the Data field if non-nil, zero value otherwise. + +### GetDataOk + +`func (o *DecodeAndVerifyResponse) GetDataOk() (*DecodeAndVerifyData, bool)` + +GetDataOk returns a tuple with the Data field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetData + +`func (o *DecodeAndVerifyResponse) SetData(v DecodeAndVerifyData)` + +SetData sets Data field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/DefaultDatasetAPI.md b/docs/DefaultDatasetAPI.md new file mode 100644 index 0000000..b794de8 --- /dev/null +++ b/docs/DefaultDatasetAPI.md @@ -0,0 +1,484 @@ +# \DefaultDatasetAPI + +All URIs are relative to *https://api.apify.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**ActorRunDatasetDelete**](DefaultDatasetAPI.md#ActorRunDatasetDelete) | **Delete** /v2/actor-runs/{runId}/dataset | Delete default dataset +[**ActorRunDatasetGet**](DefaultDatasetAPI.md#ActorRunDatasetGet) | **Get** /v2/actor-runs/{runId}/dataset | Get default dataset +[**ActorRunDatasetItemsGet**](DefaultDatasetAPI.md#ActorRunDatasetItemsGet) | **Get** /v2/actor-runs/{runId}/dataset/items | Get default dataset items +[**ActorRunDatasetItemsPost**](DefaultDatasetAPI.md#ActorRunDatasetItemsPost) | **Post** /v2/actor-runs/{runId}/dataset/items | Store items +[**ActorRunDatasetPut**](DefaultDatasetAPI.md#ActorRunDatasetPut) | **Put** /v2/actor-runs/{runId}/dataset | Update default dataset +[**ActorRunDatasetStatisticsGet**](DefaultDatasetAPI.md#ActorRunDatasetStatisticsGet) | **Get** /v2/actor-runs/{runId}/dataset/statistics | Get default dataset statistics + + + +## ActorRunDatasetDelete + +> ActorRunDatasetDelete(ctx, runId).Execute() + +Delete default dataset + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + runId := "3KH8gEpp4d8uQSe8T" // string | Actor run ID. + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + r, err := apiClient.DefaultDatasetAPI.ActorRunDatasetDelete(context.Background(), runId).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `DefaultDatasetAPI.ActorRunDatasetDelete``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**runId** | **string** | Actor run ID. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiActorRunDatasetDeleteRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + +### Return type + + (empty response body) + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## ActorRunDatasetGet + +> DatasetResponse ActorRunDatasetGet(ctx, runId).Execute() + +Get default dataset + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + runId := "3KH8gEpp4d8uQSe8T" // string | Actor run ID. + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.DefaultDatasetAPI.ActorRunDatasetGet(context.Background(), runId).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `DefaultDatasetAPI.ActorRunDatasetGet``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ActorRunDatasetGet`: DatasetResponse + fmt.Fprintf(os.Stdout, "Response from `DefaultDatasetAPI.ActorRunDatasetGet`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**runId** | **string** | Actor run ID. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiActorRunDatasetGetRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + +### Return type + +[**DatasetResponse**](DatasetResponse.md) + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## ActorRunDatasetItemsGet + +> []map[string]interface{} ActorRunDatasetItemsGet(ctx, runId).Format(format).Clean(clean).Offset(offset).Limit(limit).Fields(fields).OutputFields(outputFields).Omit(omit).Unwind(unwind).Flatten(flatten).Desc(desc).Attachment(attachment).Delimiter(delimiter).Bom(bom).XmlRoot(xmlRoot).XmlRow(xmlRow).SkipHeaderRow(skipHeaderRow).SkipHidden(skipHidden).SkipEmpty(skipEmpty).Simplified(simplified).View(view).SkipFailedPages(skipFailedPages).FeedTitle(feedTitle).FeedDescription(feedDescription).Signature(signature).Execute() + +Get default dataset items + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + runId := "3KH8gEpp4d8uQSe8T" // string | Actor run ID. + format := "json" // string | Format of the results, possible values are: `json`, `jsonl`, `csv`, `html`, `xlsx`, `xml` and `rss`. The default value is `json`. (optional) + clean := false // bool | If `true` or `1` then the API endpoint returns only non-empty items and skips hidden fields (i.e. fields starting with the # character). The `clean` parameter is just a shortcut for `skipHidden=true` and `skipEmpty=true` parameters. Note that since some objects might be skipped from the output, that the result might contain less items than the `limit` value. (optional) + offset := float64(0) // float64 | Number of items that should be skipped at the start. The default value is `0`. (optional) + limit := float64(1.2) // float64 | Maximum number of items to return. By default there is no limit. (optional) + fields := "myValue,myOtherValue" // string | A comma-separated list of fields which should be picked from the items, only these fields will remain in the resulting record objects. Note that the fields in the outputted items are sorted the same way as they are specified in the `fields` query parameter. You can use this feature to effectively fix the output format. (optional) + outputFields := "title,link" // string | A comma-separated list of output field names that positionally rename the fields specified in the `fields` parameter. For example, `?fields=headline,url&outputFields=title,link` renames `headline` to `title` and `url` to `link` in the output. The number of names in `outputFields` must match the number of names in `fields`. Requires the `fields` parameter to be specified as well. (optional) + omit := "myValue,myOtherValue" // string | A comma-separated list of fields which should be omitted from the items. (optional) + unwind := "myValue,myOtherValue" // string | A comma-separated list of fields which should be unwound, in order which they should be processed. Each field should be either an array or an object. If the field is an array then every element of the array will become a separate record and merged with parent object. If the unwound field is an object then it is merged with the parent object. If the unwound field is missing or its value is neither an array nor an object and therefore cannot be merged with a parent object then the item gets preserved as it is. Note that the unwound items ignore the `desc` parameter. (optional) + flatten := "myValue" // string | A comma-separated list of fields which should transform nested objects into flat structures. For example, with `flatten=\"foo\"` the object `{\"foo\":{\"bar\": \"hello\"}}` is turned into `{\"foo.bar\": \"hello\"}`. The original object with properties is replaced with the flattened object. (optional) + desc := true // bool | By default, results are returned in the same order as they were stored. To reverse the order, set this parameter to `true` or `1`. (optional) + attachment := true // bool | If `true` or `1` then the response will define the `Content-Disposition: attachment` header, forcing a web browser to download the file rather than to display it. By default this header is not present. (optional) + delimiter := ";" // string | A delimiter character for CSV files, only used if `format=csv`. You might need to URL-encode the character (e.g. use `%09` for tab or `%3B` for semicolon). The default delimiter is a simple comma (`,`). (optional) + bom := false // bool | All text responses are encoded in UTF-8 encoding. By default, the `format=csv` files are prefixed with the UTF-8 Byte Order Mark (BOM), while `json`, `jsonl`, `xml`, `html` and `rss` files are not. If you want to override this default behavior, specify `bom=1` query parameter to include the BOM or `bom=0` to skip it. (optional) + xmlRoot := "items" // string | Overrides default root element name of `xml` output. By default the root element is `items`. (optional) + xmlRow := "item" // string | Overrides default element name that wraps each page or page function result object in `xml` output. By default the element name is `item`. (optional) + skipHeaderRow := true // bool | If `true` or `1` then header row in the `csv` format is skipped. (optional) + skipHidden := false // bool | If `true` or `1` then hidden fields are skipped from the output, i.e. fields starting with the `#` character. (optional) + skipEmpty := false // bool | If `true` or `1` then empty items are skipped from the output. Note that if used, the results might contain less items than the limit value. (optional) + simplified := false // bool | If `true` or `1` then, the endpoint applies the `fields=url,pageFunctionResult,errorInfo` and `unwind=pageFunctionResult` query parameters. This feature is used to emulate simplified results provided by the legacy Apify Crawler product and it's not recommended to use it in new integrations. (optional) + view := "overview" // string | Defines the view configuration for dataset items based on the schema definition. This parameter determines how the data will be filtered and presented. For complete specification details, see the [dataset schema documentation](/platform/actors/development/actor-definition/dataset-schema). (optional) + skipFailedPages := false // bool | If `true` or `1` then, the all the items with errorInfo property will be skipped from the output. This feature is here to emulate functionality of API version 1 used for the legacy Apify Crawler product and it's not recommended to use it in new integrations. (optional) + feedTitle := "Latest posts from r/pasta" // string | Overrides the auto-generated RSS channel `<title>` element. Only used when `format=rss`. If not provided, the title defaults to `Dataset <label>`. (optional) + feedDescription := "Scraped forum posts" // string | Overrides the auto-generated RSS channel `<description>` element. Only used when `format=rss`. If not provided, the description defaults to `Items in dataset with id \"<datasetId>\".` (optional) + signature := "2wTI46Bg8qWQrV7tavlPI" // string | Signature used for the access. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.DefaultDatasetAPI.ActorRunDatasetItemsGet(context.Background(), runId).Format(format).Clean(clean).Offset(offset).Limit(limit).Fields(fields).OutputFields(outputFields).Omit(omit).Unwind(unwind).Flatten(flatten).Desc(desc).Attachment(attachment).Delimiter(delimiter).Bom(bom).XmlRoot(xmlRoot).XmlRow(xmlRow).SkipHeaderRow(skipHeaderRow).SkipHidden(skipHidden).SkipEmpty(skipEmpty).Simplified(simplified).View(view).SkipFailedPages(skipFailedPages).FeedTitle(feedTitle).FeedDescription(feedDescription).Signature(signature).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `DefaultDatasetAPI.ActorRunDatasetItemsGet``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ActorRunDatasetItemsGet`: []map[string]interface{} + fmt.Fprintf(os.Stdout, "Response from `DefaultDatasetAPI.ActorRunDatasetItemsGet`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**runId** | **string** | Actor run ID. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiActorRunDatasetItemsGetRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **format** | **string** | Format of the results, possible values are: `json`, `jsonl`, `csv`, `html`, `xlsx`, `xml` and `rss`. The default value is `json`. | + **clean** | **bool** | If `true` or `1` then the API endpoint returns only non-empty items and skips hidden fields (i.e. fields starting with the # character). The `clean` parameter is just a shortcut for `skipHidden=true` and `skipEmpty=true` parameters. Note that since some objects might be skipped from the output, that the result might contain less items than the `limit` value. | + **offset** | **float64** | Number of items that should be skipped at the start. The default value is `0`. | + **limit** | **float64** | Maximum number of items to return. By default there is no limit. | + **fields** | **string** | A comma-separated list of fields which should be picked from the items, only these fields will remain in the resulting record objects. Note that the fields in the outputted items are sorted the same way as they are specified in the `fields` query parameter. You can use this feature to effectively fix the output format. | + **outputFields** | **string** | A comma-separated list of output field names that positionally rename the fields specified in the `fields` parameter. For example, `?fields=headline,url&outputFields=title,link` renames `headline` to `title` and `url` to `link` in the output. The number of names in `outputFields` must match the number of names in `fields`. Requires the `fields` parameter to be specified as well. | + **omit** | **string** | A comma-separated list of fields which should be omitted from the items. | + **unwind** | **string** | A comma-separated list of fields which should be unwound, in order which they should be processed. Each field should be either an array or an object. If the field is an array then every element of the array will become a separate record and merged with parent object. If the unwound field is an object then it is merged with the parent object. If the unwound field is missing or its value is neither an array nor an object and therefore cannot be merged with a parent object then the item gets preserved as it is. Note that the unwound items ignore the `desc` parameter. | + **flatten** | **string** | A comma-separated list of fields which should transform nested objects into flat structures. For example, with `flatten=\"foo\"` the object `{\"foo\":{\"bar\": \"hello\"}}` is turned into `{\"foo.bar\": \"hello\"}`. The original object with properties is replaced with the flattened object. | + **desc** | **bool** | By default, results are returned in the same order as they were stored. To reverse the order, set this parameter to `true` or `1`. | + **attachment** | **bool** | If `true` or `1` then the response will define the `Content-Disposition: attachment` header, forcing a web browser to download the file rather than to display it. By default this header is not present. | + **delimiter** | **string** | A delimiter character for CSV files, only used if `format=csv`. You might need to URL-encode the character (e.g. use `%09` for tab or `%3B` for semicolon). The default delimiter is a simple comma (`,`). | + **bom** | **bool** | All text responses are encoded in UTF-8 encoding. By default, the `format=csv` files are prefixed with the UTF-8 Byte Order Mark (BOM), while `json`, `jsonl`, `xml`, `html` and `rss` files are not. If you want to override this default behavior, specify `bom=1` query parameter to include the BOM or `bom=0` to skip it. | + **xmlRoot** | **string** | Overrides default root element name of `xml` output. By default the root element is `items`. | + **xmlRow** | **string** | Overrides default element name that wraps each page or page function result object in `xml` output. By default the element name is `item`. | + **skipHeaderRow** | **bool** | If `true` or `1` then header row in the `csv` format is skipped. | + **skipHidden** | **bool** | If `true` or `1` then hidden fields are skipped from the output, i.e. fields starting with the `#` character. | + **skipEmpty** | **bool** | If `true` or `1` then empty items are skipped from the output. Note that if used, the results might contain less items than the limit value. | + **simplified** | **bool** | If `true` or `1` then, the endpoint applies the `fields=url,pageFunctionResult,errorInfo` and `unwind=pageFunctionResult` query parameters. This feature is used to emulate simplified results provided by the legacy Apify Crawler product and it's not recommended to use it in new integrations. | + **view** | **string** | Defines the view configuration for dataset items based on the schema definition. This parameter determines how the data will be filtered and presented. For complete specification details, see the [dataset schema documentation](/platform/actors/development/actor-definition/dataset-schema). | + **skipFailedPages** | **bool** | If `true` or `1` then, the all the items with errorInfo property will be skipped from the output. This feature is here to emulate functionality of API version 1 used for the legacy Apify Crawler product and it's not recommended to use it in new integrations. | + **feedTitle** | **string** | Overrides the auto-generated RSS channel `<title>` element. Only used when `format=rss`. If not provided, the title defaults to `Dataset <label>`. | + **feedDescription** | **string** | Overrides the auto-generated RSS channel `<description>` element. Only used when `format=rss`. If not provided, the description defaults to `Items in dataset with id \"<datasetId>\".` | + **signature** | **string** | Signature used for the access. | + +### Return type + +**[]map[string]interface{}** + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json, application/jsonl, text/csv, text/html, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/rss+xml, application/xml + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## ActorRunDatasetItemsPost + +> map[string]interface{} ActorRunDatasetItemsPost(ctx, runId).ActRunsLastDatasetItemsPostRequest(actRunsLastDatasetItemsPostRequest).Execute() + +Store items + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + runId := "3KH8gEpp4d8uQSe8T" // string | Actor run ID. + actRunsLastDatasetItemsPostRequest := openapiclient.act_runs_last_dataset_items_post_request{ArrayOfMapmapOfStringAny: new([]map[string]interface{})} // ActRunsLastDatasetItemsPostRequest | + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.DefaultDatasetAPI.ActorRunDatasetItemsPost(context.Background(), runId).ActRunsLastDatasetItemsPostRequest(actRunsLastDatasetItemsPostRequest).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `DefaultDatasetAPI.ActorRunDatasetItemsPost``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ActorRunDatasetItemsPost`: map[string]interface{} + fmt.Fprintf(os.Stdout, "Response from `DefaultDatasetAPI.ActorRunDatasetItemsPost`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**runId** | **string** | Actor run ID. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiActorRunDatasetItemsPostRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **actRunsLastDatasetItemsPostRequest** | [**ActRunsLastDatasetItemsPostRequest**](ActRunsLastDatasetItemsPostRequest.md) | | + +### Return type + +**map[string]interface{}** + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## ActorRunDatasetPut + +> DatasetResponse ActorRunDatasetPut(ctx, runId).UpdateDatasetRequest(updateDatasetRequest).Execute() + +Update default dataset + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + runId := "3KH8gEpp4d8uQSe8T" // string | Actor run ID. + updateDatasetRequest := *openapiclient.NewUpdateDatasetRequest() // UpdateDatasetRequest | + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.DefaultDatasetAPI.ActorRunDatasetPut(context.Background(), runId).UpdateDatasetRequest(updateDatasetRequest).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `DefaultDatasetAPI.ActorRunDatasetPut``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ActorRunDatasetPut`: DatasetResponse + fmt.Fprintf(os.Stdout, "Response from `DefaultDatasetAPI.ActorRunDatasetPut`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**runId** | **string** | Actor run ID. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiActorRunDatasetPutRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **updateDatasetRequest** | [**UpdateDatasetRequest**](UpdateDatasetRequest.md) | | + +### Return type + +[**DatasetResponse**](DatasetResponse.md) + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## ActorRunDatasetStatisticsGet + +> DatasetStatisticsResponse ActorRunDatasetStatisticsGet(ctx, runId).Execute() + +Get default dataset statistics + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + runId := "3KH8gEpp4d8uQSe8T" // string | Actor run ID. + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.DefaultDatasetAPI.ActorRunDatasetStatisticsGet(context.Background(), runId).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `DefaultDatasetAPI.ActorRunDatasetStatisticsGet``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ActorRunDatasetStatisticsGet`: DatasetStatisticsResponse + fmt.Fprintf(os.Stdout, "Response from `DefaultDatasetAPI.ActorRunDatasetStatisticsGet`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**runId** | **string** | Actor run ID. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiActorRunDatasetStatisticsGetRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + +### Return type + +[**DatasetStatisticsResponse**](DatasetStatisticsResponse.md) + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/docs/DefaultKeyValueStoreAPI.md b/docs/DefaultKeyValueStoreAPI.md new file mode 100644 index 0000000..835f0da --- /dev/null +++ b/docs/DefaultKeyValueStoreAPI.md @@ -0,0 +1,685 @@ +# \DefaultKeyValueStoreAPI + +All URIs are relative to *https://api.apify.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**ActorRunKeyValueStoreDelete**](DefaultKeyValueStoreAPI.md#ActorRunKeyValueStoreDelete) | **Delete** /v2/actor-runs/{runId}/key-value-store | Delete default store +[**ActorRunKeyValueStoreGet**](DefaultKeyValueStoreAPI.md#ActorRunKeyValueStoreGet) | **Get** /v2/actor-runs/{runId}/key-value-store | Get default store +[**ActorRunKeyValueStoreKeysGet**](DefaultKeyValueStoreAPI.md#ActorRunKeyValueStoreKeysGet) | **Get** /v2/actor-runs/{runId}/key-value-store/keys | Get default store's list of keys +[**ActorRunKeyValueStorePut**](DefaultKeyValueStoreAPI.md#ActorRunKeyValueStorePut) | **Put** /v2/actor-runs/{runId}/key-value-store | Update default store +[**ActorRunKeyValueStoreRecordDelete**](DefaultKeyValueStoreAPI.md#ActorRunKeyValueStoreRecordDelete) | **Delete** /v2/actor-runs/{runId}/key-value-store/records/{recordKey} | Delete default store's record +[**ActorRunKeyValueStoreRecordGet**](DefaultKeyValueStoreAPI.md#ActorRunKeyValueStoreRecordGet) | **Get** /v2/actor-runs/{runId}/key-value-store/records/{recordKey} | Get default store's record +[**ActorRunKeyValueStoreRecordPost**](DefaultKeyValueStoreAPI.md#ActorRunKeyValueStoreRecordPost) | **Post** /v2/actor-runs/{runId}/key-value-store/records/{recordKey} | Store record in default store (POST) +[**ActorRunKeyValueStoreRecordPut**](DefaultKeyValueStoreAPI.md#ActorRunKeyValueStoreRecordPut) | **Put** /v2/actor-runs/{runId}/key-value-store/records/{recordKey} | Store record in default store +[**ActorRunKeyValueStoreRecordsGet**](DefaultKeyValueStoreAPI.md#ActorRunKeyValueStoreRecordsGet) | **Get** /v2/actor-runs/{runId}/key-value-store/records | Download default store's records + + + +## ActorRunKeyValueStoreDelete + +> ActorRunKeyValueStoreDelete(ctx, runId).Execute() + +Delete default store + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + runId := "3KH8gEpp4d8uQSe8T" // string | Actor run ID. + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + r, err := apiClient.DefaultKeyValueStoreAPI.ActorRunKeyValueStoreDelete(context.Background(), runId).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `DefaultKeyValueStoreAPI.ActorRunKeyValueStoreDelete``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**runId** | **string** | Actor run ID. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiActorRunKeyValueStoreDeleteRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + +### Return type + + (empty response body) + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## ActorRunKeyValueStoreGet + +> KeyValueStoreResponse ActorRunKeyValueStoreGet(ctx, runId).Execute() + +Get default store + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + runId := "3KH8gEpp4d8uQSe8T" // string | Actor run ID. + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.DefaultKeyValueStoreAPI.ActorRunKeyValueStoreGet(context.Background(), runId).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `DefaultKeyValueStoreAPI.ActorRunKeyValueStoreGet``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ActorRunKeyValueStoreGet`: KeyValueStoreResponse + fmt.Fprintf(os.Stdout, "Response from `DefaultKeyValueStoreAPI.ActorRunKeyValueStoreGet`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**runId** | **string** | Actor run ID. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiActorRunKeyValueStoreGetRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + +### Return type + +[**KeyValueStoreResponse**](KeyValueStoreResponse.md) + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## ActorRunKeyValueStoreKeysGet + +> ListOfKeysResponse ActorRunKeyValueStoreKeysGet(ctx, runId).ExclusiveStartKey(exclusiveStartKey).Limit(limit).Collection(collection).Prefix(prefix).Signature(signature).Execute() + +Get default store's list of keys + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + runId := "3KH8gEpp4d8uQSe8T" // string | Actor run ID. + exclusiveStartKey := "Ihnsp8YrvJ8102Kj" // string | All keys up to this one (including) are skipped from the result. (optional) + limit := float32(100) // float32 | Number of keys to be returned. (optional) (default to 1000) + collection := "postImages" // string | Limit the results to keys that belong to a specific collection from the key-value store schema. The key-value store need to have a schema defined for this parameter to work. (optional) + prefix := "post-images-" // string | Limit the results to keys that start with a specific prefix. (optional) + signature := "2wTI46Bg8qWQrV7tavlPI" // string | Signature used for the access. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.DefaultKeyValueStoreAPI.ActorRunKeyValueStoreKeysGet(context.Background(), runId).ExclusiveStartKey(exclusiveStartKey).Limit(limit).Collection(collection).Prefix(prefix).Signature(signature).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `DefaultKeyValueStoreAPI.ActorRunKeyValueStoreKeysGet``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ActorRunKeyValueStoreKeysGet`: ListOfKeysResponse + fmt.Fprintf(os.Stdout, "Response from `DefaultKeyValueStoreAPI.ActorRunKeyValueStoreKeysGet`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**runId** | **string** | Actor run ID. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiActorRunKeyValueStoreKeysGetRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **exclusiveStartKey** | **string** | All keys up to this one (including) are skipped from the result. | + **limit** | **float32** | Number of keys to be returned. | [default to 1000] + **collection** | **string** | Limit the results to keys that belong to a specific collection from the key-value store schema. The key-value store need to have a schema defined for this parameter to work. | + **prefix** | **string** | Limit the results to keys that start with a specific prefix. | + **signature** | **string** | Signature used for the access. | + +### Return type + +[**ListOfKeysResponse**](ListOfKeysResponse.md) + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## ActorRunKeyValueStorePut + +> KeyValueStoreResponse ActorRunKeyValueStorePut(ctx, runId).UpdateStoreRequest(updateStoreRequest).Execute() + +Update default store + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + runId := "3KH8gEpp4d8uQSe8T" // string | Actor run ID. + updateStoreRequest := *openapiclient.NewUpdateStoreRequest() // UpdateStoreRequest | + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.DefaultKeyValueStoreAPI.ActorRunKeyValueStorePut(context.Background(), runId).UpdateStoreRequest(updateStoreRequest).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `DefaultKeyValueStoreAPI.ActorRunKeyValueStorePut``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ActorRunKeyValueStorePut`: KeyValueStoreResponse + fmt.Fprintf(os.Stdout, "Response from `DefaultKeyValueStoreAPI.ActorRunKeyValueStorePut`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**runId** | **string** | Actor run ID. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiActorRunKeyValueStorePutRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **updateStoreRequest** | [**UpdateStoreRequest**](UpdateStoreRequest.md) | | + +### Return type + +[**KeyValueStoreResponse**](KeyValueStoreResponse.md) + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## ActorRunKeyValueStoreRecordDelete + +> ActorRunKeyValueStoreRecordDelete(ctx, runId, recordKey).Execute() + +Delete default store's record + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + runId := "3KH8gEpp4d8uQSe8T" // string | Actor run ID. + recordKey := "someKey" // string | Key of the record. + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + r, err := apiClient.DefaultKeyValueStoreAPI.ActorRunKeyValueStoreRecordDelete(context.Background(), runId, recordKey).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `DefaultKeyValueStoreAPI.ActorRunKeyValueStoreRecordDelete``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**runId** | **string** | Actor run ID. | +**recordKey** | **string** | Key of the record. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiActorRunKeyValueStoreRecordDeleteRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + +### Return type + + (empty response body) + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## ActorRunKeyValueStoreRecordGet + +> map[string]interface{} ActorRunKeyValueStoreRecordGet(ctx, runId, recordKey).Signature(signature).Attachment(attachment).Execute() + +Get default store's record + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + runId := "3KH8gEpp4d8uQSe8T" // string | Actor run ID. + recordKey := "someKey" // string | Key of the record. + signature := "2wTI46Bg8qWQrV7tavlPI" // string | Signature used for the access. (optional) + attachment := true // bool | If `true` or `1`, the response will be served with `Content-Disposition: attachment` header, causing web browsers to offer downloading HTML records instead of displaying them. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.DefaultKeyValueStoreAPI.ActorRunKeyValueStoreRecordGet(context.Background(), runId, recordKey).Signature(signature).Attachment(attachment).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `DefaultKeyValueStoreAPI.ActorRunKeyValueStoreRecordGet``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ActorRunKeyValueStoreRecordGet`: map[string]interface{} + fmt.Fprintf(os.Stdout, "Response from `DefaultKeyValueStoreAPI.ActorRunKeyValueStoreRecordGet`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**runId** | **string** | Actor run ID. | +**recordKey** | **string** | Key of the record. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiActorRunKeyValueStoreRecordGetRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + **signature** | **string** | Signature used for the access. | + **attachment** | **bool** | If `true` or `1`, the response will be served with `Content-Disposition: attachment` header, causing web browsers to offer downloading HTML records instead of displaying them. | + +### Return type + +**map[string]interface{}** + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json, */* + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## ActorRunKeyValueStoreRecordPost + +> map[string]interface{} ActorRunKeyValueStoreRecordPost(ctx, runId, recordKey).RequestBody(requestBody).ContentEncoding(contentEncoding).Execute() + +Store record in default store (POST) + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + runId := "3KH8gEpp4d8uQSe8T" // string | Actor run ID. + recordKey := "someKey" // string | Key of the record. + requestBody := map[string]interface{}{"key": interface{}(123)} // map[string]interface{} | + contentEncoding := "contentEncoding_example" // string | (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.DefaultKeyValueStoreAPI.ActorRunKeyValueStoreRecordPost(context.Background(), runId, recordKey).RequestBody(requestBody).ContentEncoding(contentEncoding).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `DefaultKeyValueStoreAPI.ActorRunKeyValueStoreRecordPost``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ActorRunKeyValueStoreRecordPost`: map[string]interface{} + fmt.Fprintf(os.Stdout, "Response from `DefaultKeyValueStoreAPI.ActorRunKeyValueStoreRecordPost`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**runId** | **string** | Actor run ID. | +**recordKey** | **string** | Key of the record. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiActorRunKeyValueStoreRecordPostRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + **requestBody** | **map[string]interface{}** | | + **contentEncoding** | **string** | | + +### Return type + +**map[string]interface{}** + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## ActorRunKeyValueStoreRecordPut + +> map[string]interface{} ActorRunKeyValueStoreRecordPut(ctx, runId, recordKey).RequestBody(requestBody).ContentEncoding(contentEncoding).Execute() + +Store record in default store + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + runId := "3KH8gEpp4d8uQSe8T" // string | Actor run ID. + recordKey := "someKey" // string | Key of the record. + requestBody := map[string]interface{}{"key": interface{}(123)} // map[string]interface{} | + contentEncoding := "contentEncoding_example" // string | (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.DefaultKeyValueStoreAPI.ActorRunKeyValueStoreRecordPut(context.Background(), runId, recordKey).RequestBody(requestBody).ContentEncoding(contentEncoding).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `DefaultKeyValueStoreAPI.ActorRunKeyValueStoreRecordPut``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ActorRunKeyValueStoreRecordPut`: map[string]interface{} + fmt.Fprintf(os.Stdout, "Response from `DefaultKeyValueStoreAPI.ActorRunKeyValueStoreRecordPut`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**runId** | **string** | Actor run ID. | +**recordKey** | **string** | Key of the record. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiActorRunKeyValueStoreRecordPutRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + **requestBody** | **map[string]interface{}** | | + **contentEncoding** | **string** | | + +### Return type + +**map[string]interface{}** + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## ActorRunKeyValueStoreRecordsGet + +> *os.File ActorRunKeyValueStoreRecordsGet(ctx, runId).Collection(collection).Prefix(prefix).Signature(signature).Execute() + +Download default store's records + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + runId := "3KH8gEpp4d8uQSe8T" // string | Actor run ID. + collection := "my-collection" // string | If specified, only records belonging to a specific collection from the key-value store schema. The key-value store need to have a schema defined for this parameter to work. (optional) + prefix := "my-prefix/" // string | If specified, only records whose key starts with the given prefix are included in the archive. (optional) + signature := "2wTI46Bg8qWQrV7tavlPI" // string | Signature used for the access. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.DefaultKeyValueStoreAPI.ActorRunKeyValueStoreRecordsGet(context.Background(), runId).Collection(collection).Prefix(prefix).Signature(signature).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `DefaultKeyValueStoreAPI.ActorRunKeyValueStoreRecordsGet``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ActorRunKeyValueStoreRecordsGet`: *os.File + fmt.Fprintf(os.Stdout, "Response from `DefaultKeyValueStoreAPI.ActorRunKeyValueStoreRecordsGet`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**runId** | **string** | Actor run ID. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiActorRunKeyValueStoreRecordsGetRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **collection** | **string** | If specified, only records belonging to a specific collection from the key-value store schema. The key-value store need to have a schema defined for this parameter to work. | + **prefix** | **string** | If specified, only records whose key starts with the given prefix are included in the archive. | + **signature** | **string** | Signature used for the access. | + +### Return type + +[***os.File**](*os.File.md) + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/zip, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/docs/DefaultRequestQueueAPI.md b/docs/DefaultRequestQueueAPI.md new file mode 100644 index 0000000..7fb9036 --- /dev/null +++ b/docs/DefaultRequestQueueAPI.md @@ -0,0 +1,1142 @@ +# \DefaultRequestQueueAPI + +All URIs are relative to *https://api.apify.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**ActorRunRequestQueueDelete**](DefaultRequestQueueAPI.md#ActorRunRequestQueueDelete) | **Delete** /v2/actor-runs/{runId}/request-queue | Delete default request queue +[**ActorRunRequestQueueGet**](DefaultRequestQueueAPI.md#ActorRunRequestQueueGet) | **Get** /v2/actor-runs/{runId}/request-queue | Get default request queue +[**ActorRunRequestQueueHeadGet**](DefaultRequestQueueAPI.md#ActorRunRequestQueueHeadGet) | **Get** /v2/actor-runs/{runId}/request-queue/head | Get default request queue head +[**ActorRunRequestQueueHeadLockPost**](DefaultRequestQueueAPI.md#ActorRunRequestQueueHeadLockPost) | **Post** /v2/actor-runs/{runId}/request-queue/head/lock | Get and lock default request queue head +[**ActorRunRequestQueuePut**](DefaultRequestQueueAPI.md#ActorRunRequestQueuePut) | **Put** /v2/actor-runs/{runId}/request-queue | Update default request queue +[**ActorRunRequestQueueRequestDelete**](DefaultRequestQueueAPI.md#ActorRunRequestQueueRequestDelete) | **Delete** /v2/actor-runs/{runId}/request-queue/requests/{requestId} | Delete request from default request queue +[**ActorRunRequestQueueRequestGet**](DefaultRequestQueueAPI.md#ActorRunRequestQueueRequestGet) | **Get** /v2/actor-runs/{runId}/request-queue/requests/{requestId} | Get request from default request queue +[**ActorRunRequestQueueRequestLockDelete**](DefaultRequestQueueAPI.md#ActorRunRequestQueueRequestLockDelete) | **Delete** /v2/actor-runs/{runId}/request-queue/requests/{requestId}/lock | Delete lock on request in default request queue +[**ActorRunRequestQueueRequestLockPut**](DefaultRequestQueueAPI.md#ActorRunRequestQueueRequestLockPut) | **Put** /v2/actor-runs/{runId}/request-queue/requests/{requestId}/lock | Prolong lock on request in default request queue +[**ActorRunRequestQueueRequestPut**](DefaultRequestQueueAPI.md#ActorRunRequestQueueRequestPut) | **Put** /v2/actor-runs/{runId}/request-queue/requests/{requestId} | Update request in default request queue +[**ActorRunRequestQueueRequestsBatchDelete**](DefaultRequestQueueAPI.md#ActorRunRequestQueueRequestsBatchDelete) | **Delete** /v2/actor-runs/{runId}/request-queue/requests/batch | Batch delete requests from default request queue +[**ActorRunRequestQueueRequestsBatchPost**](DefaultRequestQueueAPI.md#ActorRunRequestQueueRequestsBatchPost) | **Post** /v2/actor-runs/{runId}/request-queue/requests/batch | Batch add requests to default request queue +[**ActorRunRequestQueueRequestsGet**](DefaultRequestQueueAPI.md#ActorRunRequestQueueRequestsGet) | **Get** /v2/actor-runs/{runId}/request-queue/requests | List default request queue's requests +[**ActorRunRequestQueueRequestsPost**](DefaultRequestQueueAPI.md#ActorRunRequestQueueRequestsPost) | **Post** /v2/actor-runs/{runId}/request-queue/requests | Add request to default request queue +[**ActorRunRequestQueueRequestsUnlockPost**](DefaultRequestQueueAPI.md#ActorRunRequestQueueRequestsUnlockPost) | **Post** /v2/actor-runs/{runId}/request-queue/requests/unlock | Unlock requests in default request queue + + + +## ActorRunRequestQueueDelete + +> ActorRunRequestQueueDelete(ctx, runId).Execute() + +Delete default request queue + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + runId := "3KH8gEpp4d8uQSe8T" // string | Actor run ID. + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + r, err := apiClient.DefaultRequestQueueAPI.ActorRunRequestQueueDelete(context.Background(), runId).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `DefaultRequestQueueAPI.ActorRunRequestQueueDelete``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**runId** | **string** | Actor run ID. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiActorRunRequestQueueDeleteRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + +### Return type + + (empty response body) + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## ActorRunRequestQueueGet + +> RequestQueueResponse ActorRunRequestQueueGet(ctx, runId).Execute() + +Get default request queue + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + runId := "3KH8gEpp4d8uQSe8T" // string | Actor run ID. + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.DefaultRequestQueueAPI.ActorRunRequestQueueGet(context.Background(), runId).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `DefaultRequestQueueAPI.ActorRunRequestQueueGet``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ActorRunRequestQueueGet`: RequestQueueResponse + fmt.Fprintf(os.Stdout, "Response from `DefaultRequestQueueAPI.ActorRunRequestQueueGet`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**runId** | **string** | Actor run ID. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiActorRunRequestQueueGetRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + +### Return type + +[**RequestQueueResponse**](RequestQueueResponse.md) + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## ActorRunRequestQueueHeadGet + +> HeadResponse ActorRunRequestQueueHeadGet(ctx, runId).Limit(limit).ClientKey(clientKey).Execute() + +Get default request queue head + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + runId := "3KH8gEpp4d8uQSe8T" // string | Actor run ID. + limit := float64(100) // float64 | How many items from queue should be returned. (optional) + clientKey := "client-abc" // string | A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.DefaultRequestQueueAPI.ActorRunRequestQueueHeadGet(context.Background(), runId).Limit(limit).ClientKey(clientKey).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `DefaultRequestQueueAPI.ActorRunRequestQueueHeadGet``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ActorRunRequestQueueHeadGet`: HeadResponse + fmt.Fprintf(os.Stdout, "Response from `DefaultRequestQueueAPI.ActorRunRequestQueueHeadGet`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**runId** | **string** | Actor run ID. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiActorRunRequestQueueHeadGetRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **limit** | **float64** | How many items from queue should be returned. | + **clientKey** | **string** | A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. | + +### Return type + +[**HeadResponse**](HeadResponse.md) + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## ActorRunRequestQueueHeadLockPost + +> HeadAndLockResponse ActorRunRequestQueueHeadLockPost(ctx, runId).LockSecs(lockSecs).Limit(limit).ClientKey(clientKey).Execute() + +Get and lock default request queue head + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + runId := "3KH8gEpp4d8uQSe8T" // string | Actor run ID. + lockSecs := float64(60) // float64 | How long the requests will be locked for (in seconds). + limit := float64(25) // float64 | How many items from the queue should be returned. (optional) + clientKey := "client-abc" // string | A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.DefaultRequestQueueAPI.ActorRunRequestQueueHeadLockPost(context.Background(), runId).LockSecs(lockSecs).Limit(limit).ClientKey(clientKey).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `DefaultRequestQueueAPI.ActorRunRequestQueueHeadLockPost``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ActorRunRequestQueueHeadLockPost`: HeadAndLockResponse + fmt.Fprintf(os.Stdout, "Response from `DefaultRequestQueueAPI.ActorRunRequestQueueHeadLockPost`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**runId** | **string** | Actor run ID. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiActorRunRequestQueueHeadLockPostRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **lockSecs** | **float64** | How long the requests will be locked for (in seconds). | + **limit** | **float64** | How many items from the queue should be returned. | + **clientKey** | **string** | A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. | + +### Return type + +[**HeadAndLockResponse**](HeadAndLockResponse.md) + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## ActorRunRequestQueuePut + +> RequestQueueResponse ActorRunRequestQueuePut(ctx, runId).UpdateRequestQueueRequest(updateRequestQueueRequest).Execute() + +Update default request queue + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + runId := "3KH8gEpp4d8uQSe8T" // string | Actor run ID. + updateRequestQueueRequest := *openapiclient.NewUpdateRequestQueueRequest() // UpdateRequestQueueRequest | + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.DefaultRequestQueueAPI.ActorRunRequestQueuePut(context.Background(), runId).UpdateRequestQueueRequest(updateRequestQueueRequest).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `DefaultRequestQueueAPI.ActorRunRequestQueuePut``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ActorRunRequestQueuePut`: RequestQueueResponse + fmt.Fprintf(os.Stdout, "Response from `DefaultRequestQueueAPI.ActorRunRequestQueuePut`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**runId** | **string** | Actor run ID. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiActorRunRequestQueuePutRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **updateRequestQueueRequest** | [**UpdateRequestQueueRequest**](UpdateRequestQueueRequest.md) | | + +### Return type + +[**RequestQueueResponse**](RequestQueueResponse.md) + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## ActorRunRequestQueueRequestDelete + +> ActorRunRequestQueueRequestDelete(ctx, runId, requestId).ClientKey(clientKey).Execute() + +Delete request from default request queue + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + runId := "3KH8gEpp4d8uQSe8T" // string | Actor run ID. + requestId := "xpsmkDlspokDSmklS" // string | Request ID. + clientKey := "client-abc" // string | A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + r, err := apiClient.DefaultRequestQueueAPI.ActorRunRequestQueueRequestDelete(context.Background(), runId, requestId).ClientKey(clientKey).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `DefaultRequestQueueAPI.ActorRunRequestQueueRequestDelete``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**runId** | **string** | Actor run ID. | +**requestId** | **string** | Request ID. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiActorRunRequestQueueRequestDeleteRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + **clientKey** | **string** | A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. | + +### Return type + + (empty response body) + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## ActorRunRequestQueueRequestGet + +> RequestResponse ActorRunRequestQueueRequestGet(ctx, runId, requestId).Execute() + +Get request from default request queue + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + runId := "3KH8gEpp4d8uQSe8T" // string | Actor run ID. + requestId := "xpsmkDlspokDSmklS" // string | Request ID. + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.DefaultRequestQueueAPI.ActorRunRequestQueueRequestGet(context.Background(), runId, requestId).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `DefaultRequestQueueAPI.ActorRunRequestQueueRequestGet``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ActorRunRequestQueueRequestGet`: RequestResponse + fmt.Fprintf(os.Stdout, "Response from `DefaultRequestQueueAPI.ActorRunRequestQueueRequestGet`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**runId** | **string** | Actor run ID. | +**requestId** | **string** | Request ID. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiActorRunRequestQueueRequestGetRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + +### Return type + +[**RequestResponse**](RequestResponse.md) + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## ActorRunRequestQueueRequestLockDelete + +> ActorRunRequestQueueRequestLockDelete(ctx, runId, requestId).ClientKey(clientKey).Forefront(forefront).Execute() + +Delete lock on request in default request queue + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + runId := "3KH8gEpp4d8uQSe8T" // string | Actor run ID. + requestId := "xpsmkDlspokDSmklS" // string | Request ID. + clientKey := "client-abc" // string | A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. (optional) + forefront := "false" // string | Determines if request should be added to the head of the queue or to the end after lock was removed. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + r, err := apiClient.DefaultRequestQueueAPI.ActorRunRequestQueueRequestLockDelete(context.Background(), runId, requestId).ClientKey(clientKey).Forefront(forefront).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `DefaultRequestQueueAPI.ActorRunRequestQueueRequestLockDelete``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**runId** | **string** | Actor run ID. | +**requestId** | **string** | Request ID. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiActorRunRequestQueueRequestLockDeleteRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + **clientKey** | **string** | A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. | + **forefront** | **string** | Determines if request should be added to the head of the queue or to the end after lock was removed. | + +### Return type + + (empty response body) + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## ActorRunRequestQueueRequestLockPut + +> ProlongRequestLockResponse ActorRunRequestQueueRequestLockPut(ctx, runId, requestId).LockSecs(lockSecs).ClientKey(clientKey).Forefront(forefront).Execute() + +Prolong lock on request in default request queue + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + runId := "3KH8gEpp4d8uQSe8T" // string | Actor run ID. + requestId := "xpsmkDlspokDSmklS" // string | Request ID. + lockSecs := float64(60) // float64 | How long the requests will be locked for (in seconds). + clientKey := "client-abc" // string | A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. (optional) + forefront := "false" // string | Determines if request should be added to the head of the queue or to the end after lock expires. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.DefaultRequestQueueAPI.ActorRunRequestQueueRequestLockPut(context.Background(), runId, requestId).LockSecs(lockSecs).ClientKey(clientKey).Forefront(forefront).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `DefaultRequestQueueAPI.ActorRunRequestQueueRequestLockPut``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ActorRunRequestQueueRequestLockPut`: ProlongRequestLockResponse + fmt.Fprintf(os.Stdout, "Response from `DefaultRequestQueueAPI.ActorRunRequestQueueRequestLockPut`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**runId** | **string** | Actor run ID. | +**requestId** | **string** | Request ID. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiActorRunRequestQueueRequestLockPutRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + **lockSecs** | **float64** | How long the requests will be locked for (in seconds). | + **clientKey** | **string** | A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. | + **forefront** | **string** | Determines if request should be added to the head of the queue or to the end after lock expires. | + +### Return type + +[**ProlongRequestLockResponse**](ProlongRequestLockResponse.md) + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## ActorRunRequestQueueRequestPut + +> UpdateRequestResponse ActorRunRequestQueueRequestPut(ctx, runId, requestId).Request(request).Forefront(forefront).ClientKey(clientKey).Execute() + +Update request in default request queue + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + runId := "3KH8gEpp4d8uQSe8T" // string | Actor run ID. + requestId := "xpsmkDlspokDSmklS" // string | Request ID. + request := *openapiclient.NewRequest() // Request | + forefront := "false" // string | Determines if request should be added to the head of the queue or to the end. Default value is `false` (end of queue). (optional) + clientKey := "client-abc" // string | A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.DefaultRequestQueueAPI.ActorRunRequestQueueRequestPut(context.Background(), runId, requestId).Request(request).Forefront(forefront).ClientKey(clientKey).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `DefaultRequestQueueAPI.ActorRunRequestQueueRequestPut``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ActorRunRequestQueueRequestPut`: UpdateRequestResponse + fmt.Fprintf(os.Stdout, "Response from `DefaultRequestQueueAPI.ActorRunRequestQueueRequestPut`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**runId** | **string** | Actor run ID. | +**requestId** | **string** | Request ID. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiActorRunRequestQueueRequestPutRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + **request** | [**Request**](Request.md) | | + **forefront** | **string** | Determines if request should be added to the head of the queue or to the end. Default value is `false` (end of queue). | + **clientKey** | **string** | A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. | + +### Return type + +[**UpdateRequestResponse**](UpdateRequestResponse.md) + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## ActorRunRequestQueueRequestsBatchDelete + +> BatchDeleteResponse ActorRunRequestQueueRequestsBatchDelete(ctx, runId).ContentType(contentType).RequestDraftDelete(requestDraftDelete).ClientKey(clientKey).Execute() + +Batch delete requests from default request queue + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + runId := "3KH8gEpp4d8uQSe8T" // string | Actor run ID. + contentType := "contentType_example" // string | + requestDraftDelete := []openapiclient.RequestDraftDelete{*openapiclient.NewRequestDraftDelete("Id_example", "UniqueKey_example")} // []RequestDraftDelete | + clientKey := "client-abc" // string | A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.DefaultRequestQueueAPI.ActorRunRequestQueueRequestsBatchDelete(context.Background(), runId).ContentType(contentType).RequestDraftDelete(requestDraftDelete).ClientKey(clientKey).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `DefaultRequestQueueAPI.ActorRunRequestQueueRequestsBatchDelete``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ActorRunRequestQueueRequestsBatchDelete`: BatchDeleteResponse + fmt.Fprintf(os.Stdout, "Response from `DefaultRequestQueueAPI.ActorRunRequestQueueRequestsBatchDelete`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**runId** | **string** | Actor run ID. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiActorRunRequestQueueRequestsBatchDeleteRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **contentType** | **string** | | + **requestDraftDelete** | [**[]RequestDraftDelete**](RequestDraftDelete.md) | | + **clientKey** | **string** | A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. | + +### Return type + +[**BatchDeleteResponse**](BatchDeleteResponse.md) + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## ActorRunRequestQueueRequestsBatchPost + +> BatchAddResponse ActorRunRequestQueueRequestsBatchPost(ctx, runId).RequestBase(requestBase).ClientKey(clientKey).Forefront(forefront).Execute() + +Batch add requests to default request queue + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + runId := "3KH8gEpp4d8uQSe8T" // string | Actor run ID. + requestBase := []openapiclient.RequestBase{*openapiclient.NewRequestBase()} // []RequestBase | + clientKey := "client-abc" // string | A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. (optional) + forefront := "false" // string | Determines if request should be added to the head of the queue or to the end. Default value is `false` (end of queue). (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.DefaultRequestQueueAPI.ActorRunRequestQueueRequestsBatchPost(context.Background(), runId).RequestBase(requestBase).ClientKey(clientKey).Forefront(forefront).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `DefaultRequestQueueAPI.ActorRunRequestQueueRequestsBatchPost``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ActorRunRequestQueueRequestsBatchPost`: BatchAddResponse + fmt.Fprintf(os.Stdout, "Response from `DefaultRequestQueueAPI.ActorRunRequestQueueRequestsBatchPost`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**runId** | **string** | Actor run ID. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiActorRunRequestQueueRequestsBatchPostRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **requestBase** | [**[]RequestBase**](RequestBase.md) | | + **clientKey** | **string** | A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. | + **forefront** | **string** | Determines if request should be added to the head of the queue or to the end. Default value is `false` (end of queue). | + +### Return type + +[**BatchAddResponse**](BatchAddResponse.md) + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## ActorRunRequestQueueRequestsGet + +> ListOfRequestsResponse ActorRunRequestQueueRequestsGet(ctx, runId).ClientKey(clientKey).ExclusiveStartId(exclusiveStartId).Limit(limit).Cursor(cursor).Filter(filter).Execute() + +List default request queue's requests + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + runId := "3KH8gEpp4d8uQSe8T" // string | Actor run ID. + clientKey := "client-abc" // string | A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. (optional) + exclusiveStartId := "Ihnsp8YrvJ8102Kj" // string | All requests up to this one (including) are skipped from the result. (Deprecated, use `cursor` instead.) (optional) + limit := float64(100) // float64 | Number of keys to be returned. Maximum value is `10000`. (optional) + cursor := "eyJyZXF1ZXN0SWQiOiI2OFRqQ2RaTDNvM2hiUU0ifQ" // string | A cursor string for pagination, returned in the previous response as `nextCursor`. Use this to retrieve the next page of requests. (optional) + filter := []string{"Filter_example"} // []string | Filter requests by their state. Possible values are `locked` and `pending`. You can combine multiple values separated by commas, which will mean the union of these filters – requests matching any of the specified states will be returned. (Not compatible with deprecated `exclusiveStartId` parameter.) (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.DefaultRequestQueueAPI.ActorRunRequestQueueRequestsGet(context.Background(), runId).ClientKey(clientKey).ExclusiveStartId(exclusiveStartId).Limit(limit).Cursor(cursor).Filter(filter).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `DefaultRequestQueueAPI.ActorRunRequestQueueRequestsGet``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ActorRunRequestQueueRequestsGet`: ListOfRequestsResponse + fmt.Fprintf(os.Stdout, "Response from `DefaultRequestQueueAPI.ActorRunRequestQueueRequestsGet`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**runId** | **string** | Actor run ID. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiActorRunRequestQueueRequestsGetRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **clientKey** | **string** | A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. | + **exclusiveStartId** | **string** | All requests up to this one (including) are skipped from the result. (Deprecated, use `cursor` instead.) | + **limit** | **float64** | Number of keys to be returned. Maximum value is `10000`. | + **cursor** | **string** | A cursor string for pagination, returned in the previous response as `nextCursor`. Use this to retrieve the next page of requests. | + **filter** | **[]string** | Filter requests by their state. Possible values are `locked` and `pending`. You can combine multiple values separated by commas, which will mean the union of these filters – requests matching any of the specified states will be returned. (Not compatible with deprecated `exclusiveStartId` parameter.) | + +### Return type + +[**ListOfRequestsResponse**](ListOfRequestsResponse.md) + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## ActorRunRequestQueueRequestsPost + +> AddRequestResponse ActorRunRequestQueueRequestsPost(ctx, runId).RequestBase(requestBase).ClientKey(clientKey).Forefront(forefront).Execute() + +Add request to default request queue + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + runId := "3KH8gEpp4d8uQSe8T" // string | Actor run ID. + requestBase := *openapiclient.NewRequestBase() // RequestBase | + clientKey := "client-abc" // string | A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. (optional) + forefront := "false" // string | Determines if request should be added to the head of the queue or to the end. Default value is `false` (end of queue). (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.DefaultRequestQueueAPI.ActorRunRequestQueueRequestsPost(context.Background(), runId).RequestBase(requestBase).ClientKey(clientKey).Forefront(forefront).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `DefaultRequestQueueAPI.ActorRunRequestQueueRequestsPost``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ActorRunRequestQueueRequestsPost`: AddRequestResponse + fmt.Fprintf(os.Stdout, "Response from `DefaultRequestQueueAPI.ActorRunRequestQueueRequestsPost`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**runId** | **string** | Actor run ID. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiActorRunRequestQueueRequestsPostRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **requestBase** | [**RequestBase**](RequestBase.md) | | + **clientKey** | **string** | A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. | + **forefront** | **string** | Determines if request should be added to the head of the queue or to the end. Default value is `false` (end of queue). | + +### Return type + +[**AddRequestResponse**](AddRequestResponse.md) + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## ActorRunRequestQueueRequestsUnlockPost + +> UnlockRequestsResponse ActorRunRequestQueueRequestsUnlockPost(ctx, runId).ClientKey(clientKey).Execute() + +Unlock requests in default request queue + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + runId := "3KH8gEpp4d8uQSe8T" // string | Actor run ID. + clientKey := "client-abc" // string | A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.DefaultRequestQueueAPI.ActorRunRequestQueueRequestsUnlockPost(context.Background(), runId).ClientKey(clientKey).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `DefaultRequestQueueAPI.ActorRunRequestQueueRequestsUnlockPost``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ActorRunRequestQueueRequestsUnlockPost`: UnlockRequestsResponse + fmt.Fprintf(os.Stdout, "Response from `DefaultRequestQueueAPI.ActorRunRequestQueueRequestsUnlockPost`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**runId** | **string** | Actor run ID. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiActorRunRequestQueueRequestsUnlockPostRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **clientKey** | **string** | A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. | + +### Return type + +[**UnlockRequestsResponse**](UnlockRequestsResponse.md) + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/docs/DefaultRunOptions.md b/docs/DefaultRunOptions.md new file mode 100644 index 0000000..36b8eff --- /dev/null +++ b/docs/DefaultRunOptions.md @@ -0,0 +1,206 @@ +# DefaultRunOptions + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Build** | Pointer to **string** | | [optional] +**TimeoutSecs** | Pointer to **int32** | | [optional] +**MemoryMbytes** | Pointer to **int32** | | [optional] +**RestartOnError** | Pointer to **bool** | | [optional] +**MaxItems** | Pointer to **NullableInt32** | | [optional] +**ForcePermissionLevel** | Pointer to [**NullableActorPermissionLevel**](ActorPermissionLevel.md) | | [optional] + +## Methods + +### NewDefaultRunOptions + +`func NewDefaultRunOptions() *DefaultRunOptions` + +NewDefaultRunOptions instantiates a new DefaultRunOptions object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewDefaultRunOptionsWithDefaults + +`func NewDefaultRunOptionsWithDefaults() *DefaultRunOptions` + +NewDefaultRunOptionsWithDefaults instantiates a new DefaultRunOptions object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetBuild + +`func (o *DefaultRunOptions) GetBuild() string` + +GetBuild returns the Build field if non-nil, zero value otherwise. + +### GetBuildOk + +`func (o *DefaultRunOptions) GetBuildOk() (*string, bool)` + +GetBuildOk returns a tuple with the Build field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetBuild + +`func (o *DefaultRunOptions) SetBuild(v string)` + +SetBuild sets Build field to given value. + +### HasBuild + +`func (o *DefaultRunOptions) HasBuild() bool` + +HasBuild returns a boolean if a field has been set. + +### GetTimeoutSecs + +`func (o *DefaultRunOptions) GetTimeoutSecs() int32` + +GetTimeoutSecs returns the TimeoutSecs field if non-nil, zero value otherwise. + +### GetTimeoutSecsOk + +`func (o *DefaultRunOptions) GetTimeoutSecsOk() (*int32, bool)` + +GetTimeoutSecsOk returns a tuple with the TimeoutSecs field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTimeoutSecs + +`func (o *DefaultRunOptions) SetTimeoutSecs(v int32)` + +SetTimeoutSecs sets TimeoutSecs field to given value. + +### HasTimeoutSecs + +`func (o *DefaultRunOptions) HasTimeoutSecs() bool` + +HasTimeoutSecs returns a boolean if a field has been set. + +### GetMemoryMbytes + +`func (o *DefaultRunOptions) GetMemoryMbytes() int32` + +GetMemoryMbytes returns the MemoryMbytes field if non-nil, zero value otherwise. + +### GetMemoryMbytesOk + +`func (o *DefaultRunOptions) GetMemoryMbytesOk() (*int32, bool)` + +GetMemoryMbytesOk returns a tuple with the MemoryMbytes field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMemoryMbytes + +`func (o *DefaultRunOptions) SetMemoryMbytes(v int32)` + +SetMemoryMbytes sets MemoryMbytes field to given value. + +### HasMemoryMbytes + +`func (o *DefaultRunOptions) HasMemoryMbytes() bool` + +HasMemoryMbytes returns a boolean if a field has been set. + +### GetRestartOnError + +`func (o *DefaultRunOptions) GetRestartOnError() bool` + +GetRestartOnError returns the RestartOnError field if non-nil, zero value otherwise. + +### GetRestartOnErrorOk + +`func (o *DefaultRunOptions) GetRestartOnErrorOk() (*bool, bool)` + +GetRestartOnErrorOk returns a tuple with the RestartOnError field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRestartOnError + +`func (o *DefaultRunOptions) SetRestartOnError(v bool)` + +SetRestartOnError sets RestartOnError field to given value. + +### HasRestartOnError + +`func (o *DefaultRunOptions) HasRestartOnError() bool` + +HasRestartOnError returns a boolean if a field has been set. + +### GetMaxItems + +`func (o *DefaultRunOptions) GetMaxItems() int32` + +GetMaxItems returns the MaxItems field if non-nil, zero value otherwise. + +### GetMaxItemsOk + +`func (o *DefaultRunOptions) GetMaxItemsOk() (*int32, bool)` + +GetMaxItemsOk returns a tuple with the MaxItems field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMaxItems + +`func (o *DefaultRunOptions) SetMaxItems(v int32)` + +SetMaxItems sets MaxItems field to given value. + +### HasMaxItems + +`func (o *DefaultRunOptions) HasMaxItems() bool` + +HasMaxItems returns a boolean if a field has been set. + +### SetMaxItemsNil + +`func (o *DefaultRunOptions) SetMaxItemsNil(b bool)` + + SetMaxItemsNil sets the value for MaxItems to be an explicit nil + +### UnsetMaxItems +`func (o *DefaultRunOptions) UnsetMaxItems()` + +UnsetMaxItems ensures that no value is present for MaxItems, not even an explicit nil +### GetForcePermissionLevel + +`func (o *DefaultRunOptions) GetForcePermissionLevel() ActorPermissionLevel` + +GetForcePermissionLevel returns the ForcePermissionLevel field if non-nil, zero value otherwise. + +### GetForcePermissionLevelOk + +`func (o *DefaultRunOptions) GetForcePermissionLevelOk() (*ActorPermissionLevel, bool)` + +GetForcePermissionLevelOk returns a tuple with the ForcePermissionLevel field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetForcePermissionLevel + +`func (o *DefaultRunOptions) SetForcePermissionLevel(v ActorPermissionLevel)` + +SetForcePermissionLevel sets ForcePermissionLevel field to given value. + +### HasForcePermissionLevel + +`func (o *DefaultRunOptions) HasForcePermissionLevel() bool` + +HasForcePermissionLevel returns a boolean if a field has been set. + +### SetForcePermissionLevelNil + +`func (o *DefaultRunOptions) SetForcePermissionLevelNil(b bool)` + + SetForcePermissionLevelNil sets the value for ForcePermissionLevel to be an explicit nil + +### UnsetForcePermissionLevel +`func (o *DefaultRunOptions) UnsetForcePermissionLevel()` + +UnsetForcePermissionLevel ensures that no value is present for ForcePermissionLevel, not even an explicit nil + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/DeletedRequest.md b/docs/DeletedRequest.md new file mode 100644 index 0000000..d141eae --- /dev/null +++ b/docs/DeletedRequest.md @@ -0,0 +1,72 @@ +# DeletedRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**UniqueKey** | **string** | A unique key used for request de-duplication. Requests with the same unique key are considered identical. | +**Id** | **string** | A unique identifier assigned to the request. | + +## Methods + +### NewDeletedRequest + +`func NewDeletedRequest(uniqueKey string, id string, ) *DeletedRequest` + +NewDeletedRequest instantiates a new DeletedRequest object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewDeletedRequestWithDefaults + +`func NewDeletedRequestWithDefaults() *DeletedRequest` + +NewDeletedRequestWithDefaults instantiates a new DeletedRequest object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetUniqueKey + +`func (o *DeletedRequest) GetUniqueKey() string` + +GetUniqueKey returns the UniqueKey field if non-nil, zero value otherwise. + +### GetUniqueKeyOk + +`func (o *DeletedRequest) GetUniqueKeyOk() (*string, bool)` + +GetUniqueKeyOk returns a tuple with the UniqueKey field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUniqueKey + +`func (o *DeletedRequest) SetUniqueKey(v string)` + +SetUniqueKey sets UniqueKey field to given value. + + +### GetId + +`func (o *DeletedRequest) GetId() string` + +GetId returns the Id field if non-nil, zero value otherwise. + +### GetIdOk + +`func (o *DeletedRequest) GetIdOk() (*string, bool)` + +GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetId + +`func (o *DeletedRequest) SetId(v string)` + +SetId sets Id field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/DeletedRequestById.md b/docs/DeletedRequestById.md new file mode 100644 index 0000000..d2b63e0 --- /dev/null +++ b/docs/DeletedRequestById.md @@ -0,0 +1,77 @@ +# DeletedRequestById + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**UniqueKey** | Pointer to **string** | A unique key used for request de-duplication. Requests with the same unique key are considered identical. | [optional] +**Id** | **string** | A unique identifier assigned to the request. | + +## Methods + +### NewDeletedRequestById + +`func NewDeletedRequestById(id string, ) *DeletedRequestById` + +NewDeletedRequestById instantiates a new DeletedRequestById object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewDeletedRequestByIdWithDefaults + +`func NewDeletedRequestByIdWithDefaults() *DeletedRequestById` + +NewDeletedRequestByIdWithDefaults instantiates a new DeletedRequestById object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetUniqueKey + +`func (o *DeletedRequestById) GetUniqueKey() string` + +GetUniqueKey returns the UniqueKey field if non-nil, zero value otherwise. + +### GetUniqueKeyOk + +`func (o *DeletedRequestById) GetUniqueKeyOk() (*string, bool)` + +GetUniqueKeyOk returns a tuple with the UniqueKey field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUniqueKey + +`func (o *DeletedRequestById) SetUniqueKey(v string)` + +SetUniqueKey sets UniqueKey field to given value. + +### HasUniqueKey + +`func (o *DeletedRequestById) HasUniqueKey() bool` + +HasUniqueKey returns a boolean if a field has been set. + +### GetId + +`func (o *DeletedRequestById) GetId() string` + +GetId returns the Id field if non-nil, zero value otherwise. + +### GetIdOk + +`func (o *DeletedRequestById) GetIdOk() (*string, bool)` + +GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetId + +`func (o *DeletedRequestById) SetId(v string)` + +SetId sets Id field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/DeletedRequestByUniqueKey.md b/docs/DeletedRequestByUniqueKey.md new file mode 100644 index 0000000..fbbbd12 --- /dev/null +++ b/docs/DeletedRequestByUniqueKey.md @@ -0,0 +1,77 @@ +# DeletedRequestByUniqueKey + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**UniqueKey** | **string** | A unique key used for request de-duplication. Requests with the same unique key are considered identical. | +**Id** | Pointer to **string** | A unique identifier assigned to the request. | [optional] + +## Methods + +### NewDeletedRequestByUniqueKey + +`func NewDeletedRequestByUniqueKey(uniqueKey string, ) *DeletedRequestByUniqueKey` + +NewDeletedRequestByUniqueKey instantiates a new DeletedRequestByUniqueKey object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewDeletedRequestByUniqueKeyWithDefaults + +`func NewDeletedRequestByUniqueKeyWithDefaults() *DeletedRequestByUniqueKey` + +NewDeletedRequestByUniqueKeyWithDefaults instantiates a new DeletedRequestByUniqueKey object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetUniqueKey + +`func (o *DeletedRequestByUniqueKey) GetUniqueKey() string` + +GetUniqueKey returns the UniqueKey field if non-nil, zero value otherwise. + +### GetUniqueKeyOk + +`func (o *DeletedRequestByUniqueKey) GetUniqueKeyOk() (*string, bool)` + +GetUniqueKeyOk returns a tuple with the UniqueKey field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUniqueKey + +`func (o *DeletedRequestByUniqueKey) SetUniqueKey(v string)` + +SetUniqueKey sets UniqueKey field to given value. + + +### GetId + +`func (o *DeletedRequestByUniqueKey) GetId() string` + +GetId returns the Id field if non-nil, zero value otherwise. + +### GetIdOk + +`func (o *DeletedRequestByUniqueKey) GetIdOk() (*string, bool)` + +GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetId + +`func (o *DeletedRequestByUniqueKey) SetId(v string)` + +SetId sets Id field to given value. + +### HasId + +`func (o *DeletedRequestByUniqueKey) HasId() bool` + +HasId returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/EffectivePlatformFeature.md b/docs/EffectivePlatformFeature.md new file mode 100644 index 0000000..7e81198 --- /dev/null +++ b/docs/EffectivePlatformFeature.md @@ -0,0 +1,165 @@ +# EffectivePlatformFeature + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**IsEnabled** | **bool** | | +**DisabledReason** | **NullableString** | | +**DisabledReasonType** | **NullableString** | | +**IsTrial** | **bool** | | +**TrialExpirationAt** | **NullableTime** | | + +## Methods + +### NewEffectivePlatformFeature + +`func NewEffectivePlatformFeature(isEnabled bool, disabledReason NullableString, disabledReasonType NullableString, isTrial bool, trialExpirationAt NullableTime, ) *EffectivePlatformFeature` + +NewEffectivePlatformFeature instantiates a new EffectivePlatformFeature object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewEffectivePlatformFeatureWithDefaults + +`func NewEffectivePlatformFeatureWithDefaults() *EffectivePlatformFeature` + +NewEffectivePlatformFeatureWithDefaults instantiates a new EffectivePlatformFeature object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetIsEnabled + +`func (o *EffectivePlatformFeature) GetIsEnabled() bool` + +GetIsEnabled returns the IsEnabled field if non-nil, zero value otherwise. + +### GetIsEnabledOk + +`func (o *EffectivePlatformFeature) GetIsEnabledOk() (*bool, bool)` + +GetIsEnabledOk returns a tuple with the IsEnabled field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetIsEnabled + +`func (o *EffectivePlatformFeature) SetIsEnabled(v bool)` + +SetIsEnabled sets IsEnabled field to given value. + + +### GetDisabledReason + +`func (o *EffectivePlatformFeature) GetDisabledReason() string` + +GetDisabledReason returns the DisabledReason field if non-nil, zero value otherwise. + +### GetDisabledReasonOk + +`func (o *EffectivePlatformFeature) GetDisabledReasonOk() (*string, bool)` + +GetDisabledReasonOk returns a tuple with the DisabledReason field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDisabledReason + +`func (o *EffectivePlatformFeature) SetDisabledReason(v string)` + +SetDisabledReason sets DisabledReason field to given value. + + +### SetDisabledReasonNil + +`func (o *EffectivePlatformFeature) SetDisabledReasonNil(b bool)` + + SetDisabledReasonNil sets the value for DisabledReason to be an explicit nil + +### UnsetDisabledReason +`func (o *EffectivePlatformFeature) UnsetDisabledReason()` + +UnsetDisabledReason ensures that no value is present for DisabledReason, not even an explicit nil +### GetDisabledReasonType + +`func (o *EffectivePlatformFeature) GetDisabledReasonType() string` + +GetDisabledReasonType returns the DisabledReasonType field if non-nil, zero value otherwise. + +### GetDisabledReasonTypeOk + +`func (o *EffectivePlatformFeature) GetDisabledReasonTypeOk() (*string, bool)` + +GetDisabledReasonTypeOk returns a tuple with the DisabledReasonType field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDisabledReasonType + +`func (o *EffectivePlatformFeature) SetDisabledReasonType(v string)` + +SetDisabledReasonType sets DisabledReasonType field to given value. + + +### SetDisabledReasonTypeNil + +`func (o *EffectivePlatformFeature) SetDisabledReasonTypeNil(b bool)` + + SetDisabledReasonTypeNil sets the value for DisabledReasonType to be an explicit nil + +### UnsetDisabledReasonType +`func (o *EffectivePlatformFeature) UnsetDisabledReasonType()` + +UnsetDisabledReasonType ensures that no value is present for DisabledReasonType, not even an explicit nil +### GetIsTrial + +`func (o *EffectivePlatformFeature) GetIsTrial() bool` + +GetIsTrial returns the IsTrial field if non-nil, zero value otherwise. + +### GetIsTrialOk + +`func (o *EffectivePlatformFeature) GetIsTrialOk() (*bool, bool)` + +GetIsTrialOk returns a tuple with the IsTrial field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetIsTrial + +`func (o *EffectivePlatformFeature) SetIsTrial(v bool)` + +SetIsTrial sets IsTrial field to given value. + + +### GetTrialExpirationAt + +`func (o *EffectivePlatformFeature) GetTrialExpirationAt() time.Time` + +GetTrialExpirationAt returns the TrialExpirationAt field if non-nil, zero value otherwise. + +### GetTrialExpirationAtOk + +`func (o *EffectivePlatformFeature) GetTrialExpirationAtOk() (*time.Time, bool)` + +GetTrialExpirationAtOk returns a tuple with the TrialExpirationAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTrialExpirationAt + +`func (o *EffectivePlatformFeature) SetTrialExpirationAt(v time.Time)` + +SetTrialExpirationAt sets TrialExpirationAt field to given value. + + +### SetTrialExpirationAtNil + +`func (o *EffectivePlatformFeature) SetTrialExpirationAtNil(b bool)` + + SetTrialExpirationAtNil sets the value for TrialExpirationAt to be an explicit nil + +### UnsetTrialExpirationAt +`func (o *EffectivePlatformFeature) UnsetTrialExpirationAt()` + +UnsetTrialExpirationAt ensures that no value is present for TrialExpirationAt, not even an explicit nil + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/EffectivePlatformFeatures.md b/docs/EffectivePlatformFeatures.md new file mode 100644 index 0000000..daeb16c --- /dev/null +++ b/docs/EffectivePlatformFeatures.md @@ -0,0 +1,240 @@ +# EffectivePlatformFeatures + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ACTORS** | [**EffectivePlatformFeature**](EffectivePlatformFeature.md) | | +**STORAGE** | [**EffectivePlatformFeature**](EffectivePlatformFeature.md) | | +**SCHEDULER** | [**EffectivePlatformFeature**](EffectivePlatformFeature.md) | | +**PROXY** | [**EffectivePlatformFeature**](EffectivePlatformFeature.md) | | +**PROXY_EXTERNAL_ACCESS** | [**EffectivePlatformFeature**](EffectivePlatformFeature.md) | | +**PROXY_RESIDENTIAL** | [**EffectivePlatformFeature**](EffectivePlatformFeature.md) | | +**PROXY_SERPS** | [**EffectivePlatformFeature**](EffectivePlatformFeature.md) | | +**WEBHOOKS** | [**EffectivePlatformFeature**](EffectivePlatformFeature.md) | | +**ACTORS_PUBLIC_ALL** | [**EffectivePlatformFeature**](EffectivePlatformFeature.md) | | +**ACTORS_PUBLIC_DEVELOPER** | [**EffectivePlatformFeature**](EffectivePlatformFeature.md) | | + +## Methods + +### NewEffectivePlatformFeatures + +`func NewEffectivePlatformFeatures(aCTORS EffectivePlatformFeature, sTORAGE EffectivePlatformFeature, sCHEDULER EffectivePlatformFeature, pROXY EffectivePlatformFeature, pROXYEXTERNALACCESS EffectivePlatformFeature, pROXYRESIDENTIAL EffectivePlatformFeature, pROXYSERPS EffectivePlatformFeature, wEBHOOKS EffectivePlatformFeature, aCTORSPUBLICALL EffectivePlatformFeature, aCTORSPUBLICDEVELOPER EffectivePlatformFeature, ) *EffectivePlatformFeatures` + +NewEffectivePlatformFeatures instantiates a new EffectivePlatformFeatures object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewEffectivePlatformFeaturesWithDefaults + +`func NewEffectivePlatformFeaturesWithDefaults() *EffectivePlatformFeatures` + +NewEffectivePlatformFeaturesWithDefaults instantiates a new EffectivePlatformFeatures object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetACTORS + +`func (o *EffectivePlatformFeatures) GetACTORS() EffectivePlatformFeature` + +GetACTORS returns the ACTORS field if non-nil, zero value otherwise. + +### GetACTORSOk + +`func (o *EffectivePlatformFeatures) GetACTORSOk() (*EffectivePlatformFeature, bool)` + +GetACTORSOk returns a tuple with the ACTORS field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetACTORS + +`func (o *EffectivePlatformFeatures) SetACTORS(v EffectivePlatformFeature)` + +SetACTORS sets ACTORS field to given value. + + +### GetSTORAGE + +`func (o *EffectivePlatformFeatures) GetSTORAGE() EffectivePlatformFeature` + +GetSTORAGE returns the STORAGE field if non-nil, zero value otherwise. + +### GetSTORAGEOk + +`func (o *EffectivePlatformFeatures) GetSTORAGEOk() (*EffectivePlatformFeature, bool)` + +GetSTORAGEOk returns a tuple with the STORAGE field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSTORAGE + +`func (o *EffectivePlatformFeatures) SetSTORAGE(v EffectivePlatformFeature)` + +SetSTORAGE sets STORAGE field to given value. + + +### GetSCHEDULER + +`func (o *EffectivePlatformFeatures) GetSCHEDULER() EffectivePlatformFeature` + +GetSCHEDULER returns the SCHEDULER field if non-nil, zero value otherwise. + +### GetSCHEDULEROk + +`func (o *EffectivePlatformFeatures) GetSCHEDULEROk() (*EffectivePlatformFeature, bool)` + +GetSCHEDULEROk returns a tuple with the SCHEDULER field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSCHEDULER + +`func (o *EffectivePlatformFeatures) SetSCHEDULER(v EffectivePlatformFeature)` + +SetSCHEDULER sets SCHEDULER field to given value. + + +### GetPROXY + +`func (o *EffectivePlatformFeatures) GetPROXY() EffectivePlatformFeature` + +GetPROXY returns the PROXY field if non-nil, zero value otherwise. + +### GetPROXYOk + +`func (o *EffectivePlatformFeatures) GetPROXYOk() (*EffectivePlatformFeature, bool)` + +GetPROXYOk returns a tuple with the PROXY field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPROXY + +`func (o *EffectivePlatformFeatures) SetPROXY(v EffectivePlatformFeature)` + +SetPROXY sets PROXY field to given value. + + +### GetPROXY_EXTERNAL_ACCESS + +`func (o *EffectivePlatformFeatures) GetPROXY_EXTERNAL_ACCESS() EffectivePlatformFeature` + +GetPROXY_EXTERNAL_ACCESS returns the PROXY_EXTERNAL_ACCESS field if non-nil, zero value otherwise. + +### GetPROXY_EXTERNAL_ACCESSOk + +`func (o *EffectivePlatformFeatures) GetPROXY_EXTERNAL_ACCESSOk() (*EffectivePlatformFeature, bool)` + +GetPROXY_EXTERNAL_ACCESSOk returns a tuple with the PROXY_EXTERNAL_ACCESS field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPROXY_EXTERNAL_ACCESS + +`func (o *EffectivePlatformFeatures) SetPROXY_EXTERNAL_ACCESS(v EffectivePlatformFeature)` + +SetPROXY_EXTERNAL_ACCESS sets PROXY_EXTERNAL_ACCESS field to given value. + + +### GetPROXY_RESIDENTIAL + +`func (o *EffectivePlatformFeatures) GetPROXY_RESIDENTIAL() EffectivePlatformFeature` + +GetPROXY_RESIDENTIAL returns the PROXY_RESIDENTIAL field if non-nil, zero value otherwise. + +### GetPROXY_RESIDENTIALOk + +`func (o *EffectivePlatformFeatures) GetPROXY_RESIDENTIALOk() (*EffectivePlatformFeature, bool)` + +GetPROXY_RESIDENTIALOk returns a tuple with the PROXY_RESIDENTIAL field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPROXY_RESIDENTIAL + +`func (o *EffectivePlatformFeatures) SetPROXY_RESIDENTIAL(v EffectivePlatformFeature)` + +SetPROXY_RESIDENTIAL sets PROXY_RESIDENTIAL field to given value. + + +### GetPROXY_SERPS + +`func (o *EffectivePlatformFeatures) GetPROXY_SERPS() EffectivePlatformFeature` + +GetPROXY_SERPS returns the PROXY_SERPS field if non-nil, zero value otherwise. + +### GetPROXY_SERPSOk + +`func (o *EffectivePlatformFeatures) GetPROXY_SERPSOk() (*EffectivePlatformFeature, bool)` + +GetPROXY_SERPSOk returns a tuple with the PROXY_SERPS field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPROXY_SERPS + +`func (o *EffectivePlatformFeatures) SetPROXY_SERPS(v EffectivePlatformFeature)` + +SetPROXY_SERPS sets PROXY_SERPS field to given value. + + +### GetWEBHOOKS + +`func (o *EffectivePlatformFeatures) GetWEBHOOKS() EffectivePlatformFeature` + +GetWEBHOOKS returns the WEBHOOKS field if non-nil, zero value otherwise. + +### GetWEBHOOKSOk + +`func (o *EffectivePlatformFeatures) GetWEBHOOKSOk() (*EffectivePlatformFeature, bool)` + +GetWEBHOOKSOk returns a tuple with the WEBHOOKS field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetWEBHOOKS + +`func (o *EffectivePlatformFeatures) SetWEBHOOKS(v EffectivePlatformFeature)` + +SetWEBHOOKS sets WEBHOOKS field to given value. + + +### GetACTORS_PUBLIC_ALL + +`func (o *EffectivePlatformFeatures) GetACTORS_PUBLIC_ALL() EffectivePlatformFeature` + +GetACTORS_PUBLIC_ALL returns the ACTORS_PUBLIC_ALL field if non-nil, zero value otherwise. + +### GetACTORS_PUBLIC_ALLOk + +`func (o *EffectivePlatformFeatures) GetACTORS_PUBLIC_ALLOk() (*EffectivePlatformFeature, bool)` + +GetACTORS_PUBLIC_ALLOk returns a tuple with the ACTORS_PUBLIC_ALL field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetACTORS_PUBLIC_ALL + +`func (o *EffectivePlatformFeatures) SetACTORS_PUBLIC_ALL(v EffectivePlatformFeature)` + +SetACTORS_PUBLIC_ALL sets ACTORS_PUBLIC_ALL field to given value. + + +### GetACTORS_PUBLIC_DEVELOPER + +`func (o *EffectivePlatformFeatures) GetACTORS_PUBLIC_DEVELOPER() EffectivePlatformFeature` + +GetACTORS_PUBLIC_DEVELOPER returns the ACTORS_PUBLIC_DEVELOPER field if non-nil, zero value otherwise. + +### GetACTORS_PUBLIC_DEVELOPEROk + +`func (o *EffectivePlatformFeatures) GetACTORS_PUBLIC_DEVELOPEROk() (*EffectivePlatformFeature, bool)` + +GetACTORS_PUBLIC_DEVELOPEROk returns a tuple with the ACTORS_PUBLIC_DEVELOPER field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetACTORS_PUBLIC_DEVELOPER + +`func (o *EffectivePlatformFeatures) SetACTORS_PUBLIC_DEVELOPER(v EffectivePlatformFeature)` + +SetACTORS_PUBLIC_DEVELOPER sets ACTORS_PUBLIC_DEVELOPER field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/EncodeAndSignData.md b/docs/EncodeAndSignData.md new file mode 100644 index 0000000..489a991 --- /dev/null +++ b/docs/EncodeAndSignData.md @@ -0,0 +1,51 @@ +# EncodeAndSignData + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Encoded** | **string** | | + +## Methods + +### NewEncodeAndSignData + +`func NewEncodeAndSignData(encoded string, ) *EncodeAndSignData` + +NewEncodeAndSignData instantiates a new EncodeAndSignData object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewEncodeAndSignDataWithDefaults + +`func NewEncodeAndSignDataWithDefaults() *EncodeAndSignData` + +NewEncodeAndSignDataWithDefaults instantiates a new EncodeAndSignData object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetEncoded + +`func (o *EncodeAndSignData) GetEncoded() string` + +GetEncoded returns the Encoded field if non-nil, zero value otherwise. + +### GetEncodedOk + +`func (o *EncodeAndSignData) GetEncodedOk() (*string, bool)` + +GetEncodedOk returns a tuple with the Encoded field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetEncoded + +`func (o *EncodeAndSignData) SetEncoded(v string)` + +SetEncoded sets Encoded field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/EncodeAndSignResponse.md b/docs/EncodeAndSignResponse.md new file mode 100644 index 0000000..9081b07 --- /dev/null +++ b/docs/EncodeAndSignResponse.md @@ -0,0 +1,51 @@ +# EncodeAndSignResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Data** | [**EncodeAndSignData**](EncodeAndSignData.md) | | + +## Methods + +### NewEncodeAndSignResponse + +`func NewEncodeAndSignResponse(data EncodeAndSignData, ) *EncodeAndSignResponse` + +NewEncodeAndSignResponse instantiates a new EncodeAndSignResponse object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewEncodeAndSignResponseWithDefaults + +`func NewEncodeAndSignResponseWithDefaults() *EncodeAndSignResponse` + +NewEncodeAndSignResponseWithDefaults instantiates a new EncodeAndSignResponse object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetData + +`func (o *EncodeAndSignResponse) GetData() EncodeAndSignData` + +GetData returns the Data field if non-nil, zero value otherwise. + +### GetDataOk + +`func (o *EncodeAndSignResponse) GetDataOk() (*EncodeAndSignData, bool)` + +GetDataOk returns a tuple with the Data field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetData + +`func (o *EncodeAndSignResponse) SetData(v EncodeAndSignData)` + +SetData sets Data field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/EnvVar.md b/docs/EnvVar.md new file mode 100644 index 0000000..6d94447 --- /dev/null +++ b/docs/EnvVar.md @@ -0,0 +1,113 @@ +# EnvVar + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Name** | **string** | | +**Value** | Pointer to **string** | The environment variable value. This field is absent in responses when `isSecret` is `true`, as secret values are never returned by the API. | [optional] +**IsSecret** | Pointer to **NullableBool** | | [optional] + +## Methods + +### NewEnvVar + +`func NewEnvVar(name string, ) *EnvVar` + +NewEnvVar instantiates a new EnvVar object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewEnvVarWithDefaults + +`func NewEnvVarWithDefaults() *EnvVar` + +NewEnvVarWithDefaults instantiates a new EnvVar object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetName + +`func (o *EnvVar) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *EnvVar) GetNameOk() (*string, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetName + +`func (o *EnvVar) SetName(v string)` + +SetName sets Name field to given value. + + +### GetValue + +`func (o *EnvVar) GetValue() string` + +GetValue returns the Value field if non-nil, zero value otherwise. + +### GetValueOk + +`func (o *EnvVar) GetValueOk() (*string, bool)` + +GetValueOk returns a tuple with the Value field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetValue + +`func (o *EnvVar) SetValue(v string)` + +SetValue sets Value field to given value. + +### HasValue + +`func (o *EnvVar) HasValue() bool` + +HasValue returns a boolean if a field has been set. + +### GetIsSecret + +`func (o *EnvVar) GetIsSecret() bool` + +GetIsSecret returns the IsSecret field if non-nil, zero value otherwise. + +### GetIsSecretOk + +`func (o *EnvVar) GetIsSecretOk() (*bool, bool)` + +GetIsSecretOk returns a tuple with the IsSecret field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetIsSecret + +`func (o *EnvVar) SetIsSecret(v bool)` + +SetIsSecret sets IsSecret field to given value. + +### HasIsSecret + +`func (o *EnvVar) HasIsSecret() bool` + +HasIsSecret returns a boolean if a field has been set. + +### SetIsSecretNil + +`func (o *EnvVar) SetIsSecretNil(b bool)` + + SetIsSecretNil sets the value for IsSecret to be an explicit nil + +### UnsetIsSecret +`func (o *EnvVar) UnsetIsSecret()` + +UnsetIsSecret ensures that no value is present for IsSecret, not even an explicit nil + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/EnvVarRequest.md b/docs/EnvVarRequest.md new file mode 100644 index 0000000..71e1003 --- /dev/null +++ b/docs/EnvVarRequest.md @@ -0,0 +1,103 @@ +# EnvVarRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Name** | **string** | | +**Value** | Pointer to **string** | The environment variable value. This field is absent in responses when `isSecret` is `true`, as secret values are never returned by the API. | [optional] +**IsSecret** | Pointer to **bool** | | [optional] + +## Methods + +### NewEnvVarRequest + +`func NewEnvVarRequest(name string, ) *EnvVarRequest` + +NewEnvVarRequest instantiates a new EnvVarRequest object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewEnvVarRequestWithDefaults + +`func NewEnvVarRequestWithDefaults() *EnvVarRequest` + +NewEnvVarRequestWithDefaults instantiates a new EnvVarRequest object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetName + +`func (o *EnvVarRequest) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *EnvVarRequest) GetNameOk() (*string, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetName + +`func (o *EnvVarRequest) SetName(v string)` + +SetName sets Name field to given value. + + +### GetValue + +`func (o *EnvVarRequest) GetValue() string` + +GetValue returns the Value field if non-nil, zero value otherwise. + +### GetValueOk + +`func (o *EnvVarRequest) GetValueOk() (*string, bool)` + +GetValueOk returns a tuple with the Value field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetValue + +`func (o *EnvVarRequest) SetValue(v string)` + +SetValue sets Value field to given value. + +### HasValue + +`func (o *EnvVarRequest) HasValue() bool` + +HasValue returns a boolean if a field has been set. + +### GetIsSecret + +`func (o *EnvVarRequest) GetIsSecret() bool` + +GetIsSecret returns the IsSecret field if non-nil, zero value otherwise. + +### GetIsSecretOk + +`func (o *EnvVarRequest) GetIsSecretOk() (*bool, bool)` + +GetIsSecretOk returns a tuple with the IsSecret field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetIsSecret + +`func (o *EnvVarRequest) SetIsSecret(v bool)` + +SetIsSecret sets IsSecret field to given value. + +### HasIsSecret + +`func (o *EnvVarRequest) HasIsSecret() bool` + +HasIsSecret returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/EnvVarResponse.md b/docs/EnvVarResponse.md new file mode 100644 index 0000000..f662e99 --- /dev/null +++ b/docs/EnvVarResponse.md @@ -0,0 +1,51 @@ +# EnvVarResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Data** | [**EnvVar**](EnvVar.md) | | + +## Methods + +### NewEnvVarResponse + +`func NewEnvVarResponse(data EnvVar, ) *EnvVarResponse` + +NewEnvVarResponse instantiates a new EnvVarResponse object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewEnvVarResponseWithDefaults + +`func NewEnvVarResponseWithDefaults() *EnvVarResponse` + +NewEnvVarResponseWithDefaults instantiates a new EnvVarResponse object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetData + +`func (o *EnvVarResponse) GetData() EnvVar` + +GetData returns the Data field if non-nil, zero value otherwise. + +### GetDataOk + +`func (o *EnvVarResponse) GetDataOk() (*EnvVar, bool)` + +GetDataOk returns a tuple with the Data field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetData + +`func (o *EnvVarResponse) SetData(v EnvVar)` + +SetData sets Data field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ErrorDetail.md b/docs/ErrorDetail.md new file mode 100644 index 0000000..bf2d0a3 --- /dev/null +++ b/docs/ErrorDetail.md @@ -0,0 +1,82 @@ +# ErrorDetail + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Type** | Pointer to [**ErrorType**](ErrorType.md) | | [optional] +**Message** | Pointer to **string** | Human-readable error message describing what went wrong. | [optional] + +## Methods + +### NewErrorDetail + +`func NewErrorDetail() *ErrorDetail` + +NewErrorDetail instantiates a new ErrorDetail object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewErrorDetailWithDefaults + +`func NewErrorDetailWithDefaults() *ErrorDetail` + +NewErrorDetailWithDefaults instantiates a new ErrorDetail object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetType + +`func (o *ErrorDetail) GetType() ErrorType` + +GetType returns the Type field if non-nil, zero value otherwise. + +### GetTypeOk + +`func (o *ErrorDetail) GetTypeOk() (*ErrorType, bool)` + +GetTypeOk returns a tuple with the Type field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetType + +`func (o *ErrorDetail) SetType(v ErrorType)` + +SetType sets Type field to given value. + +### HasType + +`func (o *ErrorDetail) HasType() bool` + +HasType returns a boolean if a field has been set. + +### GetMessage + +`func (o *ErrorDetail) GetMessage() string` + +GetMessage returns the Message field if non-nil, zero value otherwise. + +### GetMessageOk + +`func (o *ErrorDetail) GetMessageOk() (*string, bool)` + +GetMessageOk returns a tuple with the Message field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMessage + +`func (o *ErrorDetail) SetMessage(v string)` + +SetMessage sets Message field to given value. + +### HasMessage + +`func (o *ErrorDetail) HasMessage() bool` + +HasMessage returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ErrorResponse.md b/docs/ErrorResponse.md new file mode 100644 index 0000000..64485d7 --- /dev/null +++ b/docs/ErrorResponse.md @@ -0,0 +1,51 @@ +# ErrorResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Error** | [**ErrorDetail**](ErrorDetail.md) | | + +## Methods + +### NewErrorResponse + +`func NewErrorResponse(error_ ErrorDetail, ) *ErrorResponse` + +NewErrorResponse instantiates a new ErrorResponse object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewErrorResponseWithDefaults + +`func NewErrorResponseWithDefaults() *ErrorResponse` + +NewErrorResponseWithDefaults instantiates a new ErrorResponse object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetError + +`func (o *ErrorResponse) GetError() ErrorDetail` + +GetError returns the Error field if non-nil, zero value otherwise. + +### GetErrorOk + +`func (o *ErrorResponse) GetErrorOk() (*ErrorDetail, bool)` + +GetErrorOk returns a tuple with the Error field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetError + +`func (o *ErrorResponse) SetError(v ErrorDetail)` + +SetError sets Error field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ErrorType.md b/docs/ErrorType.md new file mode 100644 index 0000000..dab3f58 --- /dev/null +++ b/docs/ErrorType.md @@ -0,0 +1,791 @@ +# ErrorType + +## Enum + + +* `_3D_SECURE_AUTH_FAILED` (value: `"3d-secure-auth-failed"`) + +* `ACCESS_RIGHT_ALREADY_EXISTS` (value: `"access-right-already-exists"`) + +* `ACTION_NOT_FOUND` (value: `"action-not-found"`) + +* `ACTOR_ALREADY_RENTED` (value: `"actor-already-rented"`) + +* `ACTOR_CAN_NOT_BE_RENTED` (value: `"actor-can-not-be-rented"`) + +* `ACTOR_DISABLED` (value: `"actor-disabled"`) + +* `ACTOR_IS_NOT_RENTED` (value: `"actor-is-not-rented"`) + +* `ACTOR_MEMORY_LIMIT_EXCEEDED` (value: `"actor-memory-limit-exceeded"`) + +* `ACTOR_NAME_EXISTS_NEW_OWNER` (value: `"actor-name-exists-new-owner"`) + +* `ACTOR_NAME_NOT_UNIQUE` (value: `"actor-name-not-unique"`) + +* `ACTOR_NOT_FOUND` (value: `"actor-not-found"`) + +* `ACTOR_NOT_GITHUB_ACTOR` (value: `"actor-not-github-actor"`) + +* `ACTOR_NOT_PUBLIC` (value: `"actor-not-public"`) + +* `ACTOR_PERMISSION_LEVEL_NOT_SUPPORTED_FOR_AGENTIC_PAYMENTS` (value: `"actor-permission-level-not-supported-for-agentic-payments"`) + +* `ACTOR_REVIEW_ALREADY_EXISTS` (value: `"actor-review-already-exists"`) + +* `ACTOR_RUN_FAILED` (value: `"actor-run-failed"`) + +* `ACTOR_STANDBY_NOT_SUPPORTED_FOR_AGENTIC_PAYMENTS` (value: `"actor-standby-not-supported-for-agentic-payments"`) + +* `ACTOR_TASK_NAME_NOT_UNIQUE` (value: `"actor-task-name-not-unique"`) + +* `AGENTIC_PAYMENT_INFO_RETRIEVAL_ERROR` (value: `"agentic-payment-info-retrieval-error"`) + +* `AGENTIC_PAYMENT_INFORMATION_MISSING` (value: `"agentic-payment-information-missing"`) + +* `AGENTIC_PAYMENT_INSUFFICIENT_AMOUNT` (value: `"agentic-payment-insufficient-amount"`) + +* `AGENTIC_PAYMENT_PROVIDER_INTERNAL_ERROR` (value: `"agentic-payment-provider-internal-error"`) + +* `AGENTIC_PAYMENT_PROVIDER_UNAUTHORIZED` (value: `"agentic-payment-provider-unauthorized"`) + +* `AIRTABLE_WEBHOOK_DEPRECATED` (value: `"airtable-webhook-deprecated"`) + +* `ALREADY_SUBSCRIBED_TO_PAID_ACTOR` (value: `"already-subscribed-to-paid-actor"`) + +* `APIFY_PLAN_REQUIRED_TO_USE_PAID_ACTOR` (value: `"apify-plan-required-to-use-paid-actor"`) + +* `APIFY_SIGNUP_NOT_ALLOWED` (value: `"apify-signup-not-allowed"`) + +* `AUTH_METHOD_NOT_SUPPORTED` (value: `"auth-method-not-supported"`) + +* `AUTHORIZATION_SERVER_NOT_FOUND` (value: `"authorization-server-not-found"`) + +* `AUTO_ISSUE_DATE_INVALID` (value: `"auto-issue-date-invalid"`) + +* `BACKGROUND_CHECK_REQUIRED` (value: `"background-check-required"`) + +* `BILLING_SYSTEM_ERROR` (value: `"billing-system-error"`) + +* `BLACK_FRIDAY_PLAN_EXPIRED` (value: `"black-friday-plan-expired"`) + +* `BRAINTREE_ERROR` (value: `"braintree-error"`) + +* `BRAINTREE_NOT_LINKED` (value: `"braintree-not-linked"`) + +* `BRAINTREE_OPERATION_TIMED_OUT` (value: `"braintree-operation-timed-out"`) + +* `BRAINTREE_UNSUPPORTED_CURRENCY` (value: `"braintree-unsupported-currency"`) + +* `BUILD_NOT_FOUND` (value: `"build-not-found"`) + +* `BUILD_OUTDATED` (value: `"build-outdated"`) + +* `CANNOT_ADD_APIFY_EVENTS_TO_PPE_ACTOR` (value: `"cannot-add-apify-events-to-ppe-actor"`) + +* `CANNOT_ADD_MULTIPLE_PRICING_INFOS` (value: `"cannot-add-multiple-pricing-infos"`) + +* `CANNOT_ADD_PRICING_INFO_THAT_ALTERS_PAST` (value: `"cannot-add-pricing-info-that-alters-past"`) + +* `CANNOT_ADD_SECOND_FUTURE_PRICING_INFO` (value: `"cannot-add-second-future-pricing-info"`) + +* `CANNOT_BUILD_ACTOR_FROM_WEBHOOK` (value: `"cannot-build-actor-from-webhook"`) + +* `CANNOT_CHANGE_BILLING_INTERVAL` (value: `"cannot-change-billing-interval"`) + +* `CANNOT_CHANGE_OWNER` (value: `"cannot-change-owner"`) + +* `CANNOT_CHARGE_APIFY_EVENT` (value: `"cannot-charge-apify-event"`) + +* `CANNOT_CHARGE_NON_PAY_PER_EVENT_ACTOR` (value: `"cannot-charge-non-pay-per-event-actor"`) + +* `CANNOT_COMMENT_AS_OTHER_USER` (value: `"cannot-comment-as-other-user"`) + +* `CANNOT_COPY_ACTOR_TASK` (value: `"cannot-copy-actor-task"`) + +* `CANNOT_CREATE_PAYOUT` (value: `"cannot-create-payout"`) + +* `CANNOT_CREATE_PUBLIC_ACTOR` (value: `"cannot-create-public-actor"`) + +* `CANNOT_CREATE_TAX_TRANSACTION` (value: `"cannot-create-tax-transaction"`) + +* `CANNOT_DELETE_CRITICAL_ACTOR` (value: `"cannot-delete-critical-actor"`) + +* `CANNOT_DELETE_INVOICE` (value: `"cannot-delete-invoice"`) + +* `CANNOT_DELETE_PAID_ACTOR` (value: `"cannot-delete-paid-actor"`) + +* `CANNOT_DISABLE_ONE_TIME_EVENT_FOR_APIFY_START_EVENT` (value: `"cannot-disable-one-time-event-for-apify-start-event"`) + +* `CANNOT_DISABLE_ORGANIZATION_WITH_ENABLED_MEMBERS` (value: `"cannot-disable-organization-with-enabled-members"`) + +* `CANNOT_DISABLE_USER_WITH_SUBSCRIPTION` (value: `"cannot-disable-user-with-subscription"`) + +* `CANNOT_LINK_OAUTH_TO_UNVERIFIED_EMAIL` (value: `"cannot-link-oauth-to-unverified-email"`) + +* `CANNOT_METAMORPH_TO_PAY_PER_RESULT_ACTOR` (value: `"cannot-metamorph-to-pay-per-result-actor"`) + +* `CANNOT_MODIFY_ACTOR_PRICING_TOO_FREQUENTLY` (value: `"cannot-modify-actor-pricing-too-frequently"`) + +* `CANNOT_MODIFY_ACTOR_PRICING_WITH_IMMEDIATE_EFFECT` (value: `"cannot-modify-actor-pricing-with-immediate-effect"`) + +* `CANNOT_OVERRIDE_PAID_ACTOR_TRIAL` (value: `"cannot-override-paid-actor-trial"`) + +* `CANNOT_PERMANENTLY_DELETE_SUBSCRIPTION` (value: `"cannot-permanently-delete-subscription"`) + +* `CANNOT_PUBLISH_ACTOR` (value: `"cannot-publish-actor"`) + +* `CANNOT_REDUCE_LAST_FULL_TOKEN` (value: `"cannot-reduce-last-full-token"`) + +* `CANNOT_REIMBURSE_MORE_THAN_ORIGINAL_CHARGE` (value: `"cannot-reimburse-more-than-original-charge"`) + +* `CANNOT_REIMBURSE_NON_RENTAL_CHARGE` (value: `"cannot-reimburse-non-rental-charge"`) + +* `CANNOT_REMOVE_OWN_ACTOR_FROM_RECENTLY_USED` (value: `"cannot-remove-own-actor-from-recently-used"`) + +* `CANNOT_REMOVE_PAYMENT_METHOD` (value: `"cannot-remove-payment-method"`) + +* `CANNOT_REMOVE_PRICING_INFO` (value: `"cannot-remove-pricing-info"`) + +* `CANNOT_REMOVE_RUNNING_RUN` (value: `"cannot-remove-running-run"`) + +* `CANNOT_REMOVE_USER_WITH_PUBLIC_ACTORS` (value: `"cannot-remove-user-with-public-actors"`) + +* `CANNOT_REMOVE_USER_WITH_SUBSCRIPTION` (value: `"cannot-remove-user-with-subscription"`) + +* `CANNOT_REMOVE_USER_WITH_UNPAID_INVOICE` (value: `"cannot-remove-user-with-unpaid-invoice"`) + +* `CANNOT_RENAME_ENV_VAR` (value: `"cannot-rename-env-var"`) + +* `CANNOT_RENT_PAID_ACTOR` (value: `"cannot-rent-paid-actor"`) + +* `CANNOT_REVIEW_OWN_ACTOR` (value: `"cannot-review-own-actor"`) + +* `CANNOT_SET_ACCESS_RIGHTS_FOR_OWNER` (value: `"cannot-set-access-rights-for-owner"`) + +* `CANNOT_SET_IS_STATUS_MESSAGE_TERMINAL` (value: `"cannot-set-is-status-message-terminal"`) + +* `CANNOT_UNPUBLISH_CRITICAL_ACTOR` (value: `"cannot-unpublish-critical-actor"`) + +* `CANNOT_UNPUBLISH_PAID_ACTOR` (value: `"cannot-unpublish-paid-actor"`) + +* `CANNOT_UNPUBLISH_PROFILE` (value: `"cannot-unpublish-profile"`) + +* `CANNOT_UPDATE_INVOICE_FIELD` (value: `"cannot-update-invoice-field"`) + +* `CONCURRENT_RUNS_LIMIT_EXCEEDED` (value: `"concurrent-runs-limit-exceeded"`) + +* `CONCURRENT_UPDATE_DETECTED` (value: `"concurrent-update-detected"`) + +* `CONFERENCE_TOKEN_NOT_FOUND` (value: `"conference-token-not-found"`) + +* `CONTENT_ENCODING_FORBIDDEN_FOR_HTML` (value: `"content-encoding-forbidden-for-html"`) + +* `COUPON_ALREADY_REDEEMED` (value: `"coupon-already-redeemed"`) + +* `COUPON_EXPIRED` (value: `"coupon-expired"`) + +* `COUPON_FOR_NEW_CUSTOMERS` (value: `"coupon-for-new-customers"`) + +* `COUPON_FOR_SUBSCRIBED_USERS` (value: `"coupon-for-subscribed-users"`) + +* `COUPON_LIMITS_ARE_IN_CONFLICT_WITH_CURRENT_LIMITS` (value: `"coupon-limits-are-in-conflict-with-current-limits"`) + +* `COUPON_MAX_NUMBER_OF_REDEMPTIONS_REACHED` (value: `"coupon-max-number-of-redemptions-reached"`) + +* `COUPON_NOT_FOUND` (value: `"coupon-not-found"`) + +* `COUPON_NOT_UNIQUE` (value: `"coupon-not-unique"`) + +* `COUPONS_DISABLED` (value: `"coupons-disabled"`) + +* `CREATE_GITHUB_ISSUE_NOT_ALLOWED` (value: `"create-github-issue-not-allowed"`) + +* `CREATOR_PLAN_NOT_AVAILABLE` (value: `"creator-plan-not-available"`) + +* `CRON_EXPRESSION_INVALID` (value: `"cron-expression-invalid"`) + +* `DAILY_AI_TOKEN_LIMIT_EXCEEDED` (value: `"daily-ai-token-limit-exceeded"`) + +* `DAILY_PUBLICATION_LIMIT_EXCEEDED` (value: `"daily-publication-limit-exceeded"`) + +* `DATASET_DOES_NOT_HAVE_FIELDS_SCHEMA` (value: `"dataset-does-not-have-fields-schema"`) + +* `DATASET_DOES_NOT_HAVE_SCHEMA` (value: `"dataset-does-not-have-schema"`) + +* `DATASET_LOCKED` (value: `"dataset-locked"`) + +* `DATASET_SCHEMA_INVALID` (value: `"dataset-schema-invalid"`) + +* `DCR_NOT_SUPPORTED` (value: `"dcr-not-supported"`) + +* `DEFAULT_DATASET_NOT_FOUND` (value: `"default-dataset-not-found"`) + +* `DELETING_DEFAULT_BUILD` (value: `"deleting-default-build"`) + +* `DELETING_UNFINISHED_BUILD` (value: `"deleting-unfinished-build"`) + +* `EMAIL_ALREADY_TAKEN` (value: `"email-already-taken"`) + +* `EMAIL_ALREADY_TAKEN_REMOVED_USER` (value: `"email-already-taken-removed-user"`) + +* `EMAIL_DOMAIN_NOT_ALLOWED_FOR_COUPON` (value: `"email-domain-not-allowed-for-coupon"`) + +* `EMAIL_INVALID` (value: `"email-invalid"`) + +* `EMAIL_NOT_ALLOWED` (value: `"email-not-allowed"`) + +* `EMAIL_NOT_VALID` (value: `"email-not-valid"`) + +* `EMAIL_UPDATE_TOO_SOON` (value: `"email-update-too-soon"`) + +* `ELEVATED_PERMISSIONS_NEEDED` (value: `"elevated-permissions-needed"`) + +* `ENV_VAR_ALREADY_EXISTS` (value: `"env-var-already-exists"`) + +* `EXCHANGE_RATE_FETCH_FAILED` (value: `"exchange-rate-fetch-failed"`) + +* `EXPIRED_CONFERENCE_TOKEN` (value: `"expired-conference-token"`) + +* `FAILED_TO_CHARGE_USER` (value: `"failed-to-charge-user"`) + +* `FINAL_INVOICE_NEGATIVE` (value: `"final-invoice-negative"`) + +* `FULL_PERMISSION_ACTOR_NOT_APPROVED` (value: `"full-permission-actor-not-approved"`) + +* `GITHUB_BRANCH_EMPTY` (value: `"github-branch-empty"`) + +* `GITHUB_ISSUE_ALREADY_EXISTS` (value: `"github-issue-already-exists"`) + +* `GITHUB_PUBLIC_KEY_NOT_FOUND` (value: `"github-public-key-not-found"`) + +* `GITHUB_REPOSITORY_NOT_FOUND` (value: `"github-repository-not-found"`) + +* `GITHUB_SIGNATURE_DOES_NOT_MATCH_PAYLOAD` (value: `"github-signature-does-not-match-payload"`) + +* `GITHUB_USER_NOT_AUTHORIZED_FOR_ISSUES` (value: `"github-user-not-authorized-for-issues"`) + +* `GMAIL_NOT_ALLOWED` (value: `"gmail-not-allowed"`) + +* `ID_DOES_NOT_MATCH` (value: `"id-does-not-match"`) + +* `INCOMPATIBLE_BILLING_INTERVAL` (value: `"incompatible-billing-interval"`) + +* `INCOMPLETE_PAYOUT_BILLING_INFO` (value: `"incomplete-payout-billing-info"`) + +* `INCONSISTENT_CURRENCIES` (value: `"inconsistent-currencies"`) + +* `INCORRECT_PRICING_MODIFIER_PREFIX` (value: `"incorrect-pricing-modifier-prefix"`) + +* `INPUT_JSON_INVALID_CHARACTERS` (value: `"input-json-invalid-characters"`) + +* `INPUT_JSON_NOT_OBJECT` (value: `"input-json-not-object"`) + +* `INPUT_JSON_TOO_LONG` (value: `"input-json-too-long"`) + +* `INPUT_UPDATE_COLLISION` (value: `"input-update-collision"`) + +* `INSUFFICIENT_PERMISSIONS` (value: `"insufficient-permissions"`) + +* `INSUFFICIENT_PERMISSIONS_TO_CHANGE_FIELD` (value: `"insufficient-permissions-to-change-field"`) + +* `INSUFFICIENT_SECURITY_MEASURES` (value: `"insufficient-security-measures"`) + +* `INSUFFICIENT_TAX_COUNTRY_EVIDENCE` (value: `"insufficient-tax-country-evidence"`) + +* `INTEGRATION_AUTH_ERROR` (value: `"integration-auth-error"`) + +* `INTERNAL_SERVER_ERROR` (value: `"internal-server-error"`) + +* `INVALID_BILLING_INFO` (value: `"invalid-billing-info"`) + +* `INVALID_BILLING_PERIOD_FOR_PAYOUT` (value: `"invalid-billing-period-for-payout"`) + +* `INVALID_BUILD` (value: `"invalid-build"`) + +* `INVALID_CLIENT_KEY` (value: `"invalid-client-key"`) + +* `INVALID_COLLECTION` (value: `"invalid-collection"`) + +* `INVALID_CONFERENCE_LOGIN_PASSWORD` (value: `"invalid-conference-login-password"`) + +* `INVALID_CONTENT_TYPE_HEADER` (value: `"invalid-content-type-header"`) + +* `INVALID_CREDENTIALS` (value: `"invalid-credentials"`) + +* `INVALID_GIT_AUTH_TOKEN` (value: `"invalid-git-auth-token"`) + +* `INVALID_GITHUB_ISSUE_URL` (value: `"invalid-github-issue-url"`) + +* `INVALID_HEADER` (value: `"invalid-header"`) + +* `INVALID_ID` (value: `"invalid-id"`) + +* `INVALID_IDEMPOTENCY_KEY` (value: `"invalid-idempotency-key"`) + +* `INVALID_INPUT` (value: `"invalid-input"`) + +* `INVALID_INPUT_SCHEMA` (value: `"invalid-input-schema"`) + +* `INVALID_INVOICE` (value: `"invalid-invoice"`) + +* `INVALID_INVOICE_TYPE` (value: `"invalid-invoice-type"`) + +* `INVALID_ISSUE_DATE` (value: `"invalid-issue-date"`) + +* `INVALID_LABEL_PARAMS` (value: `"invalid-label-params"`) + +* `INVALID_MAIN_ACCOUNT_USER_ID` (value: `"invalid-main-account-user-id"`) + +* `INVALID_OAUTH_APP` (value: `"invalid-oauth-app"`) + +* `INVALID_OAUTH_SCOPE` (value: `"invalid-oauth-scope"`) + +* `INVALID_ONE_TIME_INVOICE` (value: `"invalid-one-time-invoice"`) + +* `INVALID_PARAMETER` (value: `"invalid-parameter"`) + +* `INVALID_PAYOUT_STATUS` (value: `"invalid-payout-status"`) + +* `INVALID_PICTURE_URL` (value: `"invalid-picture-url"`) + +* `INVALID_RECORD_KEY` (value: `"invalid-record-key"`) + +* `INVALID_REQUEST` (value: `"invalid-request"`) + +* `INVALID_RESOURCE_TYPE` (value: `"invalid-resource-type"`) + +* `INVALID_SIGNATURE` (value: `"invalid-signature"`) + +* `INVALID_SUBSCRIPTION_PLAN` (value: `"invalid-subscription-plan"`) + +* `INVALID_TAX_NUMBER` (value: `"invalid-tax-number"`) + +* `INVALID_TAX_NUMBER_FORMAT` (value: `"invalid-tax-number-format"`) + +* `INVALID_TOKEN` (value: `"invalid-token"`) + +* `INVALID_TOKEN_TYPE` (value: `"invalid-token-type"`) + +* `INVALID_TWO_FACTOR_CODE` (value: `"invalid-two-factor-code"`) + +* `INVALID_TWO_FACTOR_CODE_OR_RECOVERY_CODE` (value: `"invalid-two-factor-code-or-recovery-code"`) + +* `INVALID_TWO_FACTOR_RECOVERY_CODE` (value: `"invalid-two-factor-recovery-code"`) + +* `INVALID_USERNAME` (value: `"invalid-username"`) + +* `INVALID_VALUE` (value: `"invalid-value"`) + +* `INVITATION_INVALID_RESOURCE_TYPE` (value: `"invitation-invalid-resource-type"`) + +* `INVITATION_NO_LONGER_VALID` (value: `"invitation-no-longer-valid"`) + +* `INVOICE_CANCELED` (value: `"invoice-canceled"`) + +* `INVOICE_CANNOT_BE_REFUNDED_DUE_TO_TOO_HIGH_AMOUNT` (value: `"invoice-cannot-be-refunded-due-to-too-high-amount"`) + +* `INVOICE_INCOMPLETE` (value: `"invoice-incomplete"`) + +* `INVOICE_IS_DRAFT` (value: `"invoice-is-draft"`) + +* `INVOICE_LOCKED` (value: `"invoice-locked"`) + +* `INVOICE_MUST_BE_BUFFER` (value: `"invoice-must-be-buffer"`) + +* `INVOICE_NOT_CANCELED` (value: `"invoice-not-canceled"`) + +* `INVOICE_NOT_DRAFT` (value: `"invoice-not-draft"`) + +* `INVOICE_NOT_FOUND` (value: `"invoice-not-found"`) + +* `INVOICE_OUTDATED` (value: `"invoice-outdated"`) + +* `INVOICE_PAID_ALREADY` (value: `"invoice-paid-already"`) + +* `ISSUE_ALREADY_CONNECTED_TO_GITHUB` (value: `"issue-already-connected-to-github"`) + +* `ISSUE_NOT_FOUND` (value: `"issue-not-found"`) + +* `ISSUES_BAD_REQUEST` (value: `"issues-bad-request"`) + +* `ISSUER_NOT_REGISTERED` (value: `"issuer-not-registered"`) + +* `JOB_FINISHED` (value: `"job-finished"`) + +* `LABEL_ALREADY_LINKED` (value: `"label-already-linked"`) + +* `LAST_API_TOKEN` (value: `"last-api-token"`) + +* `LIMIT_REACHED` (value: `"limit-reached"`) + +* `MAX_ITEMS_MUST_BE_GREATER_THAN_ZERO` (value: `"max-items-must-be-greater-than-zero"`) + +* `MAX_METAMORPHS_EXCEEDED` (value: `"max-metamorphs-exceeded"`) + +* `MAX_TOTAL_CHARGE_USD_BELOW_MINIMUM` (value: `"max-total-charge-usd-below-minimum"`) + +* `MAX_TOTAL_CHARGE_USD_MUST_BE_GREATER_THAN_ZERO` (value: `"max-total-charge-usd-must-be-greater-than-zero"`) + +* `METHOD_NOT_ALLOWED` (value: `"method-not-allowed"`) + +* `MIGRATION_DISABLED` (value: `"migration-disabled"`) + +* `MISSING_ACTOR_RIGHTS` (value: `"missing-actor-rights"`) + +* `MISSING_API_TOKEN` (value: `"missing-api-token"`) + +* `MISSING_BILLING_INFO` (value: `"missing-billing-info"`) + +* `MISSING_LINE_ITEMS` (value: `"missing-line-items"`) + +* `MISSING_PAYMENT_DATE` (value: `"missing-payment-date"`) + +* `MISSING_PAYOUT_BILLING_INFO` (value: `"missing-payout-billing-info"`) + +* `MISSING_PROXY_PASSWORD` (value: `"missing-proxy-password"`) + +* `MISSING_REPORTING_FIELDS` (value: `"missing-reporting-fields"`) + +* `MISSING_RESOURCE_NAME` (value: `"missing-resource-name"`) + +* `MISSING_SETTINGS` (value: `"missing-settings"`) + +* `MISSING_USERNAME` (value: `"missing-username"`) + +* `MONTHLY_USAGE_LIMIT_TOO_LOW` (value: `"monthly-usage-limit-too-low"`) + +* `MORE_THAN_ONE_UPDATE_NOT_ALLOWED` (value: `"more-than-one-update-not-allowed"`) + +* `MULTIPLE_RECORDS_FOUND` (value: `"multiple-records-found"`) + +* `MUST_BE_ADMIN` (value: `"must-be-admin"`) + +* `NAME_NOT_UNIQUE` (value: `"name-not-unique"`) + +* `NEXT_RUNTIME_COMPUTATION_FAILED` (value: `"next-runtime-computation-failed"`) + +* `NO_COLUMNS_IN_EXPORTED_DATASET` (value: `"no-columns-in-exported-dataset"`) + +* `NO_PAYMENT_ATTEMPT_FOR_REFUND_FOUND` (value: `"no-payment-attempt-for-refund-found"`) + +* `NO_PAYMENT_METHOD_AVAILABLE` (value: `"no-payment-method-available"`) + +* `NO_TEAM_ACCOUNT_SEATS_AVAILABLE` (value: `"no-team-account-seats-available"`) + +* `NON_TEMPORARY_EMAIL` (value: `"non-temporary-email"`) + +* `NOT_ENOUGH_USAGE_TO_RUN_PAID_ACTOR` (value: `"not-enough-usage-to-run-paid-actor"`) + +* `NOT_IMPLEMENTED` (value: `"not-implemented"`) + +* `NOT_SUPPORTED_CURRENCIES` (value: `"not-supported-currencies"`) + +* `O_AUTH_SERVICE_ALREADY_CONNECTED` (value: `"o-auth-service-already-connected"`) + +* `O_AUTH_SERVICE_NOT_CONNECTED` (value: `"o-auth-service-not-connected"`) + +* `OAUTH_RESOURCE_ACCESS_FAILED` (value: `"oauth-resource-access-failed"`) + +* `ONE_TIME_INVOICE_ALREADY_MARKED_PAID` (value: `"one-time-invoice-already-marked-paid"`) + +* `ONLY_DRAFTS_CAN_BE_DELETED` (value: `"only-drafts-can-be-deleted"`) + +* `OPERATION_CANCELED` (value: `"operation-canceled"`) + +* `OPERATION_NOT_ALLOWED` (value: `"operation-not-allowed"`) + +* `OPERATION_TIMED_OUT` (value: `"operation-timed-out"`) + +* `ORGANIZATION_CANNOT_OWN_ITSELF` (value: `"organization-cannot-own-itself"`) + +* `ORGANIZATION_ROLE_NOT_FOUND` (value: `"organization-role-not-found"`) + +* `OVERLAPPING_PAYOUT_BILLING_PERIODS` (value: `"overlapping-payout-billing-periods"`) + +* `OWN_TOKEN_REQUIRED` (value: `"own-token-required"`) + +* `PAGE_NOT_FOUND` (value: `"page-not-found"`) + +* `PARAM_NOT_ONE_OF` (value: `"param-not-one-of"`) + +* `PARAMETER_REQUIRED` (value: `"parameter-required"`) + +* `PARAMETERS_MISMATCHED` (value: `"parameters-mismatched"`) + +* `PASSWORD_RESET_EMAIL_ALREADY_SENT` (value: `"password-reset-email-already-sent"`) + +* `PASSWORD_RESET_TOKEN_EXPIRED` (value: `"password-reset-token-expired"`) + +* `PAY_AS_YOU_GO_WITHOUT_MONTHLY_INTERVAL` (value: `"pay-as-you-go-without-monthly-interval"`) + +* `PAYMENT_ATTEMPT_STATUS_MESSAGE_REQUIRED` (value: `"payment-attempt-status-message-required"`) + +* `PAYOUT_ALREADY_PAID` (value: `"payout-already-paid"`) + +* `PAYOUT_CANCELED` (value: `"payout-canceled"`) + +* `PAYOUT_INVALID_STATE` (value: `"payout-invalid-state"`) + +* `PAYOUT_MUST_BE_APPROVED_TO_BE_MARKED_PAID` (value: `"payout-must-be-approved-to-be-marked-paid"`) + +* `PAYOUT_NOT_FOUND` (value: `"payout-not-found"`) + +* `PAYOUT_NUMBER_ALREADY_EXISTS` (value: `"payout-number-already-exists"`) + +* `PHONE_NUMBER_INVALID` (value: `"phone-number-invalid"`) + +* `PHONE_NUMBER_LANDLINE` (value: `"phone-number-landline"`) + +* `PHONE_NUMBER_OPTED_OUT` (value: `"phone-number-opted-out"`) + +* `PHONE_VERIFICATION_DISABLED` (value: `"phone-verification-disabled"`) + +* `PLATFORM_FEATURE_DISABLED` (value: `"platform-feature-disabled"`) + +* `PRICE_OVERRIDES_VALIDATION_FAILED` (value: `"price-overrides-validation-failed"`) + +* `PRICING_MODEL_NOT_SUPPORTED` (value: `"pricing-model-not-supported"`) + +* `PROMOTIONAL_PLAN_NOT_AVAILABLE` (value: `"promotional-plan-not-available"`) + +* `PROXY_AUTH_IP_NOT_UNIQUE` (value: `"proxy-auth-ip-not-unique"`) + +* `PUBLIC_ACTOR_DISABLED` (value: `"public-actor-disabled"`) + +* `QUERY_TIMEOUT` (value: `"query-timeout"`) + +* `QUOTED_PRICE_OUTDATED` (value: `"quoted-price-outdated"`) + +* `RATE_LIMIT_EXCEEDED` (value: `"rate-limit-exceeded"`) + +* `RECAPTCHA_INVALID` (value: `"recaptcha-invalid"`) + +* `RECAPTCHA_REQUIRED` (value: `"recaptcha-required"`) + +* `RECORD_NOT_FOUND` (value: `"record-not-found"`) + +* `RECORD_NOT_PUBLIC` (value: `"record-not-public"`) + +* `RECORD_OR_TOKEN_NOT_FOUND` (value: `"record-or-token-not-found"`) + +* `RECORD_TOO_LARGE` (value: `"record-too-large"`) + +* `REDIRECT_URI_MISMATCH` (value: `"redirect-uri-mismatch"`) + +* `REDUCED_PLAN_NOT_AVAILABLE` (value: `"reduced-plan-not-available"`) + +* `RENTAL_CHARGE_ALREADY_REIMBURSED` (value: `"rental-charge-already-reimbursed"`) + +* `RENTAL_NOT_ALLOWED` (value: `"rental-not-allowed"`) + +* `REQUEST_ABORTED_PREMATURELY` (value: `"request-aborted-prematurely"`) + +* `REQUEST_HANDLED_OR_LOCKED` (value: `"request-handled-or-locked"`) + +* `REQUEST_ID_INVALID` (value: `"request-id-invalid"`) + +* `REQUEST_QUEUE_DUPLICATE_REQUESTS` (value: `"request-queue-duplicate-requests"`) + +* `REQUEST_TOO_LARGE` (value: `"request-too-large"`) + +* `REQUESTED_DATASET_VIEW_DOES_NOT_EXIST` (value: `"requested-dataset-view-does-not-exist"`) + +* `RESUME_TOKEN_EXPIRED` (value: `"resume-token-expired"`) + +* `RUN_FAILED` (value: `"run-failed"`) + +* `RUN_INPUT_BODY_NOT_VALID_JSON` (value: `"run-input-body-not-valid-json"`) + +* `RUN_TIMEOUT_EXCEEDED` (value: `"run-timeout-exceeded"`) + +* `RUSSIA_IS_EVIL` (value: `"russia-is-evil"`) + +* `SAME_USER` (value: `"same-user"`) + +* `SCHEDULE_ACTOR_NOT_FOUND` (value: `"schedule-actor-not-found"`) + +* `SCHEDULE_ACTOR_TASK_NOT_FOUND` (value: `"schedule-actor-task-not-found"`) + +* `SCHEDULE_NAME_NOT_UNIQUE` (value: `"schedule-name-not-unique"`) + +* `SCHEMA_VALIDATION` (value: `"schema-validation"`) + +* `SCHEMA_VALIDATION_ERROR` (value: `"schema-validation-error"`) + +* `SCHEMA_VALIDATION_FAILED` (value: `"schema-validation-failed"`) + +* `SIGN_UP_METHOD_NOT_ALLOWED` (value: `"sign-up-method-not-allowed"`) + +* `SLACK_INTEGRATION_NOT_CUSTOM` (value: `"slack-integration-not-custom"`) + +* `SOCKET_CLOSED` (value: `"socket-closed"`) + +* `SOCKET_DESTROYED` (value: `"socket-destroyed"`) + +* `STORE_SCHEMA_INVALID` (value: `"store-schema-invalid"`) + +* `STORE_TERMS_NOT_ACCEPTED` (value: `"store-terms-not-accepted"`) + +* `STRIPE_ENABLED` (value: `"stripe-enabled"`) + +* `STRIPE_GENERIC_DECLINE` (value: `"stripe-generic-decline"`) + +* `STRIPE_NOT_ENABLED` (value: `"stripe-not-enabled"`) + +* `STRIPE_NOT_ENABLED_FOR_USER` (value: `"stripe-not-enabled-for-user"`) + +* `TAGGED_BUILD_REQUIRED` (value: `"tagged-build-required"`) + +* `TAX_COUNTRY_INVALID` (value: `"tax-country-invalid"`) + +* `TAX_NUMBER_INVALID` (value: `"tax-number-invalid"`) + +* `TAX_NUMBER_VALIDATION_FAILED` (value: `"tax-number-validation-failed"`) + +* `TAXAMO_CALL_FAILED` (value: `"taxamo-call-failed"`) + +* `TAXAMO_REQUEST_FAILED` (value: `"taxamo-request-failed"`) + +* `TESTING_ERROR` (value: `"testing-error"`) + +* `TOKEN_NOT_PROVIDED` (value: `"token-not-provided"`) + +* `TOO_FEW_VERSIONS` (value: `"too-few-versions"`) + +* `TOO_MANY_ACTOR_TASKS` (value: `"too-many-actor-tasks"`) + +* `TOO_MANY_ACTORS` (value: `"too-many-actors"`) + +* `TOO_MANY_LABELS_ON_RESOURCE` (value: `"too-many-labels-on-resource"`) + +* `TOO_MANY_MCP_CONNECTORS` (value: `"too-many-mcp-connectors"`) + +* `TOO_MANY_O_AUTH_APPS` (value: `"too-many-o-auth-apps"`) + +* `TOO_MANY_ORGANIZATIONS` (value: `"too-many-organizations"`) + +* `TOO_MANY_REQUESTS` (value: `"too-many-requests"`) + +* `TOO_MANY_SCHEDULES` (value: `"too-many-schedules"`) + +* `TOO_MANY_UI_ACCESS_KEYS` (value: `"too-many-ui-access-keys"`) + +* `TOO_MANY_USER_LABELS` (value: `"too-many-user-labels"`) + +* `TOO_MANY_VALUES` (value: `"too-many-values"`) + +* `TOO_MANY_VERSIONS` (value: `"too-many-versions"`) + +* `TOO_MANY_WEBHOOKS` (value: `"too-many-webhooks"`) + +* `UNEXPECTED_ROUTE` (value: `"unexpected-route"`) + +* `UNKNOWN_BUILD_TAG` (value: `"unknown-build-tag"`) + +* `UNKNOWN_PAYMENT_PROVIDER` (value: `"unknown-payment-provider"`) + +* `UNSUBSCRIBE_TOKEN_INVALID` (value: `"unsubscribe-token-invalid"`) + +* `UNSUPPORTED_ACTOR_PRICING_MODEL_FOR_AGENTIC_PAYMENTS` (value: `"unsupported-actor-pricing-model-for-agentic-payments"`) + +* `UNSUPPORTED_CONTENT_ENCODING` (value: `"unsupported-content-encoding"`) + +* `UNSUPPORTED_FILE_TYPE_FOR_ISSUE` (value: `"unsupported-file-type-for-issue"`) + +* `UNSUPPORTED_FILE_TYPE_IMAGE_EXPECTED` (value: `"unsupported-file-type-image-expected"`) + +* `UNSUPPORTED_FILE_TYPE_TEXT_OR_JSON_EXPECTED` (value: `"unsupported-file-type-text-or-json-expected"`) + +* `UNSUPPORTED_PERMISSION` (value: `"unsupported-permission"`) + +* `UPCOMING_SUBSCRIPTION_BILL_NOT_UP_TO_DATE` (value: `"upcoming-subscription-bill-not-up-to-date"`) + +* `USER_ALREADY_EXISTS` (value: `"user-already-exists"`) + +* `USER_ALREADY_VERIFIED` (value: `"user-already-verified"`) + +* `USER_CREATES_ORGANIZATIONS_TOO_FAST` (value: `"user-creates-organizations-too-fast"`) + +* `USER_DISABLED` (value: `"user-disabled"`) + +* `USER_EMAIL_IS_DISPOSABLE` (value: `"user-email-is-disposable"`) + +* `USER_EMAIL_NOT_SET` (value: `"user-email-not-set"`) + +* `USER_EMAIL_NOT_VERIFIED` (value: `"user-email-not-verified"`) + +* `USER_HAS_NO_SUBSCRIPTION` (value: `"user-has-no-subscription"`) + +* `USER_INTEGRATION_NOT_FOUND` (value: `"user-integration-not-found"`) + +* `USER_IS_ALREADY_INVITED` (value: `"user-is-already-invited"`) + +* `USER_IS_ALREADY_ORGANIZATION_MEMBER` (value: `"user-is-already-organization-member"`) + +* `USER_IS_NOT_MEMBER_OF_ORGANIZATION` (value: `"user-is-not-member-of-organization"`) + +* `USER_IS_NOT_ORGANIZATION` (value: `"user-is-not-organization"`) + +* `USER_IS_ORGANIZATION` (value: `"user-is-organization"`) + +* `USER_IS_ORGANIZATION_OWNER` (value: `"user-is-organization-owner"`) + +* `USER_IS_REMOVED` (value: `"user-is-removed"`) + +* `USER_NOT_FOUND` (value: `"user-not-found"`) + +* `USER_NOT_LOGGED_IN` (value: `"user-not-logged-in"`) + +* `USER_NOT_VERIFIED` (value: `"user-not-verified"`) + +* `USER_OR_TOKEN_NOT_FOUND` (value: `"user-or-token-not-found"`) + +* `USER_PLAN_NOT_ALLOWED_FOR_COUPON` (value: `"user-plan-not-allowed-for-coupon"`) + +* `USER_PROBLEM_WITH_CARD` (value: `"user-problem-with-card"`) + +* `USER_RECORD_NOT_FOUND` (value: `"user-record-not-found"`) + +* `USERNAME_ALREADY_TAKEN` (value: `"username-already-taken"`) + +* `USERNAME_MISSING` (value: `"username-missing"`) + +* `USERNAME_NOT_ALLOWED` (value: `"username-not-allowed"`) + +* `USERNAME_REMOVAL_FORBIDDEN` (value: `"username-removal-forbidden"`) + +* `USERNAME_REQUIRED` (value: `"username-required"`) + +* `VERIFICATION_EMAIL_ALREADY_SENT` (value: `"verification-email-already-sent"`) + +* `VERIFICATION_TOKEN_EXPIRED` (value: `"verification-token-expired"`) + +* `VERSION_ALREADY_EXISTS` (value: `"version-already-exists"`) + +* `VERSIONS_SIZE_EXCEEDED` (value: `"versions-size-exceeded"`) + +* `WEAK_PASSWORD` (value: `"weak-password"`) + +* `X402_AGENTIC_PAYMENT_ALREADY_FINALIZED` (value: `"x402-agentic-payment-already-finalized"`) + +* `X402_AGENTIC_PAYMENT_INSUFFICIENT_AMOUNT` (value: `"x402-agentic-payment-insufficient-amount"`) + +* `X402_AGENTIC_PAYMENT_MALFORMED_TOKEN` (value: `"x402-agentic-payment-malformed-token"`) + +* `X402_AGENTIC_PAYMENT_SETTLEMENT_FAILED` (value: `"x402-agentic-payment-settlement-failed"`) + +* `X402_AGENTIC_PAYMENT_SETTLEMENT_IN_PROGRESS` (value: `"x402-agentic-payment-settlement-in-progress"`) + +* `X402_AGENTIC_PAYMENT_SETTLEMENT_STUCK` (value: `"x402-agentic-payment-settlement-stuck"`) + +* `X402_AGENTIC_PAYMENT_UNAUTHORIZED` (value: `"x402-agentic-payment-unauthorized"`) + +* `X402_PAYMENT_REQUIRED` (value: `"x402-payment-required"`) + +* `ZERO_INVOICE` (value: `"zero-invoice"`) + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/EventData.md b/docs/EventData.md new file mode 100644 index 0000000..8426df0 --- /dev/null +++ b/docs/EventData.md @@ -0,0 +1,72 @@ +# EventData + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ActorId** | **string** | | +**ActorRunId** | **string** | | + +## Methods + +### NewEventData + +`func NewEventData(actorId string, actorRunId string, ) *EventData` + +NewEventData instantiates a new EventData object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewEventDataWithDefaults + +`func NewEventDataWithDefaults() *EventData` + +NewEventDataWithDefaults instantiates a new EventData object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetActorId + +`func (o *EventData) GetActorId() string` + +GetActorId returns the ActorId field if non-nil, zero value otherwise. + +### GetActorIdOk + +`func (o *EventData) GetActorIdOk() (*string, bool)` + +GetActorIdOk returns a tuple with the ActorId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetActorId + +`func (o *EventData) SetActorId(v string)` + +SetActorId sets ActorId field to given value. + + +### GetActorRunId + +`func (o *EventData) GetActorRunId() string` + +GetActorRunId returns the ActorRunId field if non-nil, zero value otherwise. + +### GetActorRunIdOk + +`func (o *EventData) GetActorRunIdOk() (*string, bool)` + +GetActorRunIdOk returns a tuple with the ActorRunId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetActorRunId + +`func (o *EventData) SetActorRunId(v string)` + +SetActorRunId sets ActorRunId field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ExampleRunInput.md b/docs/ExampleRunInput.md new file mode 100644 index 0000000..4df6a64 --- /dev/null +++ b/docs/ExampleRunInput.md @@ -0,0 +1,82 @@ +# ExampleRunInput + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Body** | Pointer to **string** | | [optional] +**ContentType** | Pointer to **string** | | [optional] + +## Methods + +### NewExampleRunInput + +`func NewExampleRunInput() *ExampleRunInput` + +NewExampleRunInput instantiates a new ExampleRunInput object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewExampleRunInputWithDefaults + +`func NewExampleRunInputWithDefaults() *ExampleRunInput` + +NewExampleRunInputWithDefaults instantiates a new ExampleRunInput object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetBody + +`func (o *ExampleRunInput) GetBody() string` + +GetBody returns the Body field if non-nil, zero value otherwise. + +### GetBodyOk + +`func (o *ExampleRunInput) GetBodyOk() (*string, bool)` + +GetBodyOk returns a tuple with the Body field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetBody + +`func (o *ExampleRunInput) SetBody(v string)` + +SetBody sets Body field to given value. + +### HasBody + +`func (o *ExampleRunInput) HasBody() bool` + +HasBody returns a boolean if a field has been set. + +### GetContentType + +`func (o *ExampleRunInput) GetContentType() string` + +GetContentType returns the ContentType field if non-nil, zero value otherwise. + +### GetContentTypeOk + +`func (o *ExampleRunInput) GetContentTypeOk() (*string, bool)` + +GetContentTypeOk returns a tuple with the ContentType field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetContentType + +`func (o *ExampleRunInput) SetContentType(v string)` + +SetContentType sets ContentType field to given value. + +### HasContentType + +`func (o *ExampleRunInput) HasContentType() bool` + +HasContentType returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ExampleWebhookDispatch.md b/docs/ExampleWebhookDispatch.md new file mode 100644 index 0000000..a3ce97d --- /dev/null +++ b/docs/ExampleWebhookDispatch.md @@ -0,0 +1,123 @@ +# ExampleWebhookDispatch + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Status** | [**WebhookDispatchStatus**](WebhookDispatchStatus.md) | | +**FinishedAt** | Pointer to **NullableTime** | | [optional] +**RemovedAt** | Pointer to **NullableTime** | | [optional] + +## Methods + +### NewExampleWebhookDispatch + +`func NewExampleWebhookDispatch(status WebhookDispatchStatus, ) *ExampleWebhookDispatch` + +NewExampleWebhookDispatch instantiates a new ExampleWebhookDispatch object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewExampleWebhookDispatchWithDefaults + +`func NewExampleWebhookDispatchWithDefaults() *ExampleWebhookDispatch` + +NewExampleWebhookDispatchWithDefaults instantiates a new ExampleWebhookDispatch object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetStatus + +`func (o *ExampleWebhookDispatch) GetStatus() WebhookDispatchStatus` + +GetStatus returns the Status field if non-nil, zero value otherwise. + +### GetStatusOk + +`func (o *ExampleWebhookDispatch) GetStatusOk() (*WebhookDispatchStatus, bool)` + +GetStatusOk returns a tuple with the Status field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetStatus + +`func (o *ExampleWebhookDispatch) SetStatus(v WebhookDispatchStatus)` + +SetStatus sets Status field to given value. + + +### GetFinishedAt + +`func (o *ExampleWebhookDispatch) GetFinishedAt() time.Time` + +GetFinishedAt returns the FinishedAt field if non-nil, zero value otherwise. + +### GetFinishedAtOk + +`func (o *ExampleWebhookDispatch) GetFinishedAtOk() (*time.Time, bool)` + +GetFinishedAtOk returns a tuple with the FinishedAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetFinishedAt + +`func (o *ExampleWebhookDispatch) SetFinishedAt(v time.Time)` + +SetFinishedAt sets FinishedAt field to given value. + +### HasFinishedAt + +`func (o *ExampleWebhookDispatch) HasFinishedAt() bool` + +HasFinishedAt returns a boolean if a field has been set. + +### SetFinishedAtNil + +`func (o *ExampleWebhookDispatch) SetFinishedAtNil(b bool)` + + SetFinishedAtNil sets the value for FinishedAt to be an explicit nil + +### UnsetFinishedAt +`func (o *ExampleWebhookDispatch) UnsetFinishedAt()` + +UnsetFinishedAt ensures that no value is present for FinishedAt, not even an explicit nil +### GetRemovedAt + +`func (o *ExampleWebhookDispatch) GetRemovedAt() time.Time` + +GetRemovedAt returns the RemovedAt field if non-nil, zero value otherwise. + +### GetRemovedAtOk + +`func (o *ExampleWebhookDispatch) GetRemovedAtOk() (*time.Time, bool)` + +GetRemovedAtOk returns a tuple with the RemovedAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRemovedAt + +`func (o *ExampleWebhookDispatch) SetRemovedAt(v time.Time)` + +SetRemovedAt sets RemovedAt field to given value. + +### HasRemovedAt + +`func (o *ExampleWebhookDispatch) HasRemovedAt() bool` + +HasRemovedAt returns a boolean if a field has been set. + +### SetRemovedAtNil + +`func (o *ExampleWebhookDispatch) SetRemovedAtNil(b bool)` + + SetRemovedAtNil sets the value for RemovedAt to be an explicit nil + +### UnsetRemovedAt +`func (o *ExampleWebhookDispatch) UnsetRemovedAt()` + +UnsetRemovedAt ensures that no value is present for RemovedAt, not even an explicit nil + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/FlatPricePerMonthActorPricingInfo.md b/docs/FlatPricePerMonthActorPricingInfo.md new file mode 100644 index 0000000..28159f4 --- /dev/null +++ b/docs/FlatPricePerMonthActorPricingInfo.md @@ -0,0 +1,286 @@ +# FlatPricePerMonthActorPricingInfo + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ApifyMarginPercentage** | **float32** | In [0, 1], fraction of pricePerUnitUsd that goes to Apify | +**CreatedAt** | **time.Time** | When this pricing info record has been created | +**StartedAt** | **time.Time** | Since when is this pricing info record effective for a given Actor | +**NotifiedAboutFutureChangeAt** | Pointer to **time.Time** | | [optional] +**NotifiedAboutChangeAt** | Pointer to **time.Time** | | [optional] +**ReasonForChange** | Pointer to **string** | | [optional] +**IsPriceChangeNotificationSuppressed** | Pointer to **bool** | | [optional] +**ForceContainsSignificantPriceChange** | Pointer to **bool** | | [optional] +**PricingModel** | **string** | | +**TrialMinutes** | **int32** | For how long this Actor can be used for free in trial period | +**PricePerUnitUsd** | **float32** | Monthly flat price in USD | + +## Methods + +### NewFlatPricePerMonthActorPricingInfo + +`func NewFlatPricePerMonthActorPricingInfo(apifyMarginPercentage float32, createdAt time.Time, startedAt time.Time, pricingModel string, trialMinutes int32, pricePerUnitUsd float32, ) *FlatPricePerMonthActorPricingInfo` + +NewFlatPricePerMonthActorPricingInfo instantiates a new FlatPricePerMonthActorPricingInfo object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewFlatPricePerMonthActorPricingInfoWithDefaults + +`func NewFlatPricePerMonthActorPricingInfoWithDefaults() *FlatPricePerMonthActorPricingInfo` + +NewFlatPricePerMonthActorPricingInfoWithDefaults instantiates a new FlatPricePerMonthActorPricingInfo object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetApifyMarginPercentage + +`func (o *FlatPricePerMonthActorPricingInfo) GetApifyMarginPercentage() float32` + +GetApifyMarginPercentage returns the ApifyMarginPercentage field if non-nil, zero value otherwise. + +### GetApifyMarginPercentageOk + +`func (o *FlatPricePerMonthActorPricingInfo) GetApifyMarginPercentageOk() (*float32, bool)` + +GetApifyMarginPercentageOk returns a tuple with the ApifyMarginPercentage field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetApifyMarginPercentage + +`func (o *FlatPricePerMonthActorPricingInfo) SetApifyMarginPercentage(v float32)` + +SetApifyMarginPercentage sets ApifyMarginPercentage field to given value. + + +### GetCreatedAt + +`func (o *FlatPricePerMonthActorPricingInfo) GetCreatedAt() time.Time` + +GetCreatedAt returns the CreatedAt field if non-nil, zero value otherwise. + +### GetCreatedAtOk + +`func (o *FlatPricePerMonthActorPricingInfo) GetCreatedAtOk() (*time.Time, bool)` + +GetCreatedAtOk returns a tuple with the CreatedAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCreatedAt + +`func (o *FlatPricePerMonthActorPricingInfo) SetCreatedAt(v time.Time)` + +SetCreatedAt sets CreatedAt field to given value. + + +### GetStartedAt + +`func (o *FlatPricePerMonthActorPricingInfo) GetStartedAt() time.Time` + +GetStartedAt returns the StartedAt field if non-nil, zero value otherwise. + +### GetStartedAtOk + +`func (o *FlatPricePerMonthActorPricingInfo) GetStartedAtOk() (*time.Time, bool)` + +GetStartedAtOk returns a tuple with the StartedAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetStartedAt + +`func (o *FlatPricePerMonthActorPricingInfo) SetStartedAt(v time.Time)` + +SetStartedAt sets StartedAt field to given value. + + +### GetNotifiedAboutFutureChangeAt + +`func (o *FlatPricePerMonthActorPricingInfo) GetNotifiedAboutFutureChangeAt() time.Time` + +GetNotifiedAboutFutureChangeAt returns the NotifiedAboutFutureChangeAt field if non-nil, zero value otherwise. + +### GetNotifiedAboutFutureChangeAtOk + +`func (o *FlatPricePerMonthActorPricingInfo) GetNotifiedAboutFutureChangeAtOk() (*time.Time, bool)` + +GetNotifiedAboutFutureChangeAtOk returns a tuple with the NotifiedAboutFutureChangeAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetNotifiedAboutFutureChangeAt + +`func (o *FlatPricePerMonthActorPricingInfo) SetNotifiedAboutFutureChangeAt(v time.Time)` + +SetNotifiedAboutFutureChangeAt sets NotifiedAboutFutureChangeAt field to given value. + +### HasNotifiedAboutFutureChangeAt + +`func (o *FlatPricePerMonthActorPricingInfo) HasNotifiedAboutFutureChangeAt() bool` + +HasNotifiedAboutFutureChangeAt returns a boolean if a field has been set. + +### GetNotifiedAboutChangeAt + +`func (o *FlatPricePerMonthActorPricingInfo) GetNotifiedAboutChangeAt() time.Time` + +GetNotifiedAboutChangeAt returns the NotifiedAboutChangeAt field if non-nil, zero value otherwise. + +### GetNotifiedAboutChangeAtOk + +`func (o *FlatPricePerMonthActorPricingInfo) GetNotifiedAboutChangeAtOk() (*time.Time, bool)` + +GetNotifiedAboutChangeAtOk returns a tuple with the NotifiedAboutChangeAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetNotifiedAboutChangeAt + +`func (o *FlatPricePerMonthActorPricingInfo) SetNotifiedAboutChangeAt(v time.Time)` + +SetNotifiedAboutChangeAt sets NotifiedAboutChangeAt field to given value. + +### HasNotifiedAboutChangeAt + +`func (o *FlatPricePerMonthActorPricingInfo) HasNotifiedAboutChangeAt() bool` + +HasNotifiedAboutChangeAt returns a boolean if a field has been set. + +### GetReasonForChange + +`func (o *FlatPricePerMonthActorPricingInfo) GetReasonForChange() string` + +GetReasonForChange returns the ReasonForChange field if non-nil, zero value otherwise. + +### GetReasonForChangeOk + +`func (o *FlatPricePerMonthActorPricingInfo) GetReasonForChangeOk() (*string, bool)` + +GetReasonForChangeOk returns a tuple with the ReasonForChange field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetReasonForChange + +`func (o *FlatPricePerMonthActorPricingInfo) SetReasonForChange(v string)` + +SetReasonForChange sets ReasonForChange field to given value. + +### HasReasonForChange + +`func (o *FlatPricePerMonthActorPricingInfo) HasReasonForChange() bool` + +HasReasonForChange returns a boolean if a field has been set. + +### GetIsPriceChangeNotificationSuppressed + +`func (o *FlatPricePerMonthActorPricingInfo) GetIsPriceChangeNotificationSuppressed() bool` + +GetIsPriceChangeNotificationSuppressed returns the IsPriceChangeNotificationSuppressed field if non-nil, zero value otherwise. + +### GetIsPriceChangeNotificationSuppressedOk + +`func (o *FlatPricePerMonthActorPricingInfo) GetIsPriceChangeNotificationSuppressedOk() (*bool, bool)` + +GetIsPriceChangeNotificationSuppressedOk returns a tuple with the IsPriceChangeNotificationSuppressed field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetIsPriceChangeNotificationSuppressed + +`func (o *FlatPricePerMonthActorPricingInfo) SetIsPriceChangeNotificationSuppressed(v bool)` + +SetIsPriceChangeNotificationSuppressed sets IsPriceChangeNotificationSuppressed field to given value. + +### HasIsPriceChangeNotificationSuppressed + +`func (o *FlatPricePerMonthActorPricingInfo) HasIsPriceChangeNotificationSuppressed() bool` + +HasIsPriceChangeNotificationSuppressed returns a boolean if a field has been set. + +### GetForceContainsSignificantPriceChange + +`func (o *FlatPricePerMonthActorPricingInfo) GetForceContainsSignificantPriceChange() bool` + +GetForceContainsSignificantPriceChange returns the ForceContainsSignificantPriceChange field if non-nil, zero value otherwise. + +### GetForceContainsSignificantPriceChangeOk + +`func (o *FlatPricePerMonthActorPricingInfo) GetForceContainsSignificantPriceChangeOk() (*bool, bool)` + +GetForceContainsSignificantPriceChangeOk returns a tuple with the ForceContainsSignificantPriceChange field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetForceContainsSignificantPriceChange + +`func (o *FlatPricePerMonthActorPricingInfo) SetForceContainsSignificantPriceChange(v bool)` + +SetForceContainsSignificantPriceChange sets ForceContainsSignificantPriceChange field to given value. + +### HasForceContainsSignificantPriceChange + +`func (o *FlatPricePerMonthActorPricingInfo) HasForceContainsSignificantPriceChange() bool` + +HasForceContainsSignificantPriceChange returns a boolean if a field has been set. + +### GetPricingModel + +`func (o *FlatPricePerMonthActorPricingInfo) GetPricingModel() string` + +GetPricingModel returns the PricingModel field if non-nil, zero value otherwise. + +### GetPricingModelOk + +`func (o *FlatPricePerMonthActorPricingInfo) GetPricingModelOk() (*string, bool)` + +GetPricingModelOk returns a tuple with the PricingModel field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPricingModel + +`func (o *FlatPricePerMonthActorPricingInfo) SetPricingModel(v string)` + +SetPricingModel sets PricingModel field to given value. + + +### GetTrialMinutes + +`func (o *FlatPricePerMonthActorPricingInfo) GetTrialMinutes() int32` + +GetTrialMinutes returns the TrialMinutes field if non-nil, zero value otherwise. + +### GetTrialMinutesOk + +`func (o *FlatPricePerMonthActorPricingInfo) GetTrialMinutesOk() (*int32, bool)` + +GetTrialMinutesOk returns a tuple with the TrialMinutes field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTrialMinutes + +`func (o *FlatPricePerMonthActorPricingInfo) SetTrialMinutes(v int32)` + +SetTrialMinutes sets TrialMinutes field to given value. + + +### GetPricePerUnitUsd + +`func (o *FlatPricePerMonthActorPricingInfo) GetPricePerUnitUsd() float32` + +GetPricePerUnitUsd returns the PricePerUnitUsd field if non-nil, zero value otherwise. + +### GetPricePerUnitUsdOk + +`func (o *FlatPricePerMonthActorPricingInfo) GetPricePerUnitUsdOk() (*float32, bool)` + +GetPricePerUnitUsdOk returns a tuple with the PricePerUnitUsd field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPricePerUnitUsd + +`func (o *FlatPricePerMonthActorPricingInfo) SetPricePerUnitUsd(v float32)` + +SetPricePerUnitUsd sets PricePerUnitUsd field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/FreeActorPricingInfo.md b/docs/FreeActorPricingInfo.md new file mode 100644 index 0000000..99b74d0 --- /dev/null +++ b/docs/FreeActorPricingInfo.md @@ -0,0 +1,244 @@ +# FreeActorPricingInfo + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ApifyMarginPercentage** | **float32** | In [0, 1], fraction of pricePerUnitUsd that goes to Apify | +**CreatedAt** | **time.Time** | When this pricing info record has been created | +**StartedAt** | **time.Time** | Since when is this pricing info record effective for a given Actor | +**NotifiedAboutFutureChangeAt** | Pointer to **time.Time** | | [optional] +**NotifiedAboutChangeAt** | Pointer to **time.Time** | | [optional] +**ReasonForChange** | Pointer to **string** | | [optional] +**IsPriceChangeNotificationSuppressed** | Pointer to **bool** | | [optional] +**ForceContainsSignificantPriceChange** | Pointer to **bool** | | [optional] +**PricingModel** | **string** | | + +## Methods + +### NewFreeActorPricingInfo + +`func NewFreeActorPricingInfo(apifyMarginPercentage float32, createdAt time.Time, startedAt time.Time, pricingModel string, ) *FreeActorPricingInfo` + +NewFreeActorPricingInfo instantiates a new FreeActorPricingInfo object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewFreeActorPricingInfoWithDefaults + +`func NewFreeActorPricingInfoWithDefaults() *FreeActorPricingInfo` + +NewFreeActorPricingInfoWithDefaults instantiates a new FreeActorPricingInfo object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetApifyMarginPercentage + +`func (o *FreeActorPricingInfo) GetApifyMarginPercentage() float32` + +GetApifyMarginPercentage returns the ApifyMarginPercentage field if non-nil, zero value otherwise. + +### GetApifyMarginPercentageOk + +`func (o *FreeActorPricingInfo) GetApifyMarginPercentageOk() (*float32, bool)` + +GetApifyMarginPercentageOk returns a tuple with the ApifyMarginPercentage field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetApifyMarginPercentage + +`func (o *FreeActorPricingInfo) SetApifyMarginPercentage(v float32)` + +SetApifyMarginPercentage sets ApifyMarginPercentage field to given value. + + +### GetCreatedAt + +`func (o *FreeActorPricingInfo) GetCreatedAt() time.Time` + +GetCreatedAt returns the CreatedAt field if non-nil, zero value otherwise. + +### GetCreatedAtOk + +`func (o *FreeActorPricingInfo) GetCreatedAtOk() (*time.Time, bool)` + +GetCreatedAtOk returns a tuple with the CreatedAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCreatedAt + +`func (o *FreeActorPricingInfo) SetCreatedAt(v time.Time)` + +SetCreatedAt sets CreatedAt field to given value. + + +### GetStartedAt + +`func (o *FreeActorPricingInfo) GetStartedAt() time.Time` + +GetStartedAt returns the StartedAt field if non-nil, zero value otherwise. + +### GetStartedAtOk + +`func (o *FreeActorPricingInfo) GetStartedAtOk() (*time.Time, bool)` + +GetStartedAtOk returns a tuple with the StartedAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetStartedAt + +`func (o *FreeActorPricingInfo) SetStartedAt(v time.Time)` + +SetStartedAt sets StartedAt field to given value. + + +### GetNotifiedAboutFutureChangeAt + +`func (o *FreeActorPricingInfo) GetNotifiedAboutFutureChangeAt() time.Time` + +GetNotifiedAboutFutureChangeAt returns the NotifiedAboutFutureChangeAt field if non-nil, zero value otherwise. + +### GetNotifiedAboutFutureChangeAtOk + +`func (o *FreeActorPricingInfo) GetNotifiedAboutFutureChangeAtOk() (*time.Time, bool)` + +GetNotifiedAboutFutureChangeAtOk returns a tuple with the NotifiedAboutFutureChangeAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetNotifiedAboutFutureChangeAt + +`func (o *FreeActorPricingInfo) SetNotifiedAboutFutureChangeAt(v time.Time)` + +SetNotifiedAboutFutureChangeAt sets NotifiedAboutFutureChangeAt field to given value. + +### HasNotifiedAboutFutureChangeAt + +`func (o *FreeActorPricingInfo) HasNotifiedAboutFutureChangeAt() bool` + +HasNotifiedAboutFutureChangeAt returns a boolean if a field has been set. + +### GetNotifiedAboutChangeAt + +`func (o *FreeActorPricingInfo) GetNotifiedAboutChangeAt() time.Time` + +GetNotifiedAboutChangeAt returns the NotifiedAboutChangeAt field if non-nil, zero value otherwise. + +### GetNotifiedAboutChangeAtOk + +`func (o *FreeActorPricingInfo) GetNotifiedAboutChangeAtOk() (*time.Time, bool)` + +GetNotifiedAboutChangeAtOk returns a tuple with the NotifiedAboutChangeAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetNotifiedAboutChangeAt + +`func (o *FreeActorPricingInfo) SetNotifiedAboutChangeAt(v time.Time)` + +SetNotifiedAboutChangeAt sets NotifiedAboutChangeAt field to given value. + +### HasNotifiedAboutChangeAt + +`func (o *FreeActorPricingInfo) HasNotifiedAboutChangeAt() bool` + +HasNotifiedAboutChangeAt returns a boolean if a field has been set. + +### GetReasonForChange + +`func (o *FreeActorPricingInfo) GetReasonForChange() string` + +GetReasonForChange returns the ReasonForChange field if non-nil, zero value otherwise. + +### GetReasonForChangeOk + +`func (o *FreeActorPricingInfo) GetReasonForChangeOk() (*string, bool)` + +GetReasonForChangeOk returns a tuple with the ReasonForChange field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetReasonForChange + +`func (o *FreeActorPricingInfo) SetReasonForChange(v string)` + +SetReasonForChange sets ReasonForChange field to given value. + +### HasReasonForChange + +`func (o *FreeActorPricingInfo) HasReasonForChange() bool` + +HasReasonForChange returns a boolean if a field has been set. + +### GetIsPriceChangeNotificationSuppressed + +`func (o *FreeActorPricingInfo) GetIsPriceChangeNotificationSuppressed() bool` + +GetIsPriceChangeNotificationSuppressed returns the IsPriceChangeNotificationSuppressed field if non-nil, zero value otherwise. + +### GetIsPriceChangeNotificationSuppressedOk + +`func (o *FreeActorPricingInfo) GetIsPriceChangeNotificationSuppressedOk() (*bool, bool)` + +GetIsPriceChangeNotificationSuppressedOk returns a tuple with the IsPriceChangeNotificationSuppressed field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetIsPriceChangeNotificationSuppressed + +`func (o *FreeActorPricingInfo) SetIsPriceChangeNotificationSuppressed(v bool)` + +SetIsPriceChangeNotificationSuppressed sets IsPriceChangeNotificationSuppressed field to given value. + +### HasIsPriceChangeNotificationSuppressed + +`func (o *FreeActorPricingInfo) HasIsPriceChangeNotificationSuppressed() bool` + +HasIsPriceChangeNotificationSuppressed returns a boolean if a field has been set. + +### GetForceContainsSignificantPriceChange + +`func (o *FreeActorPricingInfo) GetForceContainsSignificantPriceChange() bool` + +GetForceContainsSignificantPriceChange returns the ForceContainsSignificantPriceChange field if non-nil, zero value otherwise. + +### GetForceContainsSignificantPriceChangeOk + +`func (o *FreeActorPricingInfo) GetForceContainsSignificantPriceChangeOk() (*bool, bool)` + +GetForceContainsSignificantPriceChangeOk returns a tuple with the ForceContainsSignificantPriceChange field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetForceContainsSignificantPriceChange + +`func (o *FreeActorPricingInfo) SetForceContainsSignificantPriceChange(v bool)` + +SetForceContainsSignificantPriceChange sets ForceContainsSignificantPriceChange field to given value. + +### HasForceContainsSignificantPriceChange + +`func (o *FreeActorPricingInfo) HasForceContainsSignificantPriceChange() bool` + +HasForceContainsSignificantPriceChange returns a boolean if a field has been set. + +### GetPricingModel + +`func (o *FreeActorPricingInfo) GetPricingModel() string` + +GetPricingModel returns the PricingModel field if non-nil, zero value otherwise. + +### GetPricingModelOk + +`func (o *FreeActorPricingInfo) GetPricingModelOk() (*string, bool)` + +GetPricingModelOk returns a tuple with the PricingModel field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPricingModel + +`func (o *FreeActorPricingInfo) SetPricingModel(v string)` + +SetPricingModel sets PricingModel field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/GeneralAccess.md b/docs/GeneralAccess.md new file mode 100644 index 0000000..644386d --- /dev/null +++ b/docs/GeneralAccess.md @@ -0,0 +1,17 @@ +# GeneralAccess + +## Enum + + +* `ANYONE_WITH_ID_CAN_READ` (value: `"ANYONE_WITH_ID_CAN_READ"`) + +* `ANYONE_WITH_NAME_CAN_READ` (value: `"ANYONE_WITH_NAME_CAN_READ"`) + +* `FOLLOW_USER_SETTING` (value: `"FOLLOW_USER_SETTING"`) + +* `RESTRICTED` (value: `"RESTRICTED"`) + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/HeadAndLockResponse.md b/docs/HeadAndLockResponse.md new file mode 100644 index 0000000..2306c09 --- /dev/null +++ b/docs/HeadAndLockResponse.md @@ -0,0 +1,51 @@ +# HeadAndLockResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Data** | [**LockedRequestQueueHead**](LockedRequestQueueHead.md) | | + +## Methods + +### NewHeadAndLockResponse + +`func NewHeadAndLockResponse(data LockedRequestQueueHead, ) *HeadAndLockResponse` + +NewHeadAndLockResponse instantiates a new HeadAndLockResponse object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewHeadAndLockResponseWithDefaults + +`func NewHeadAndLockResponseWithDefaults() *HeadAndLockResponse` + +NewHeadAndLockResponseWithDefaults instantiates a new HeadAndLockResponse object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetData + +`func (o *HeadAndLockResponse) GetData() LockedRequestQueueHead` + +GetData returns the Data field if non-nil, zero value otherwise. + +### GetDataOk + +`func (o *HeadAndLockResponse) GetDataOk() (*LockedRequestQueueHead, bool)` + +GetDataOk returns a tuple with the Data field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetData + +`func (o *HeadAndLockResponse) SetData(v LockedRequestQueueHead)` + +SetData sets Data field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/HeadRequest.md b/docs/HeadRequest.md new file mode 100644 index 0000000..f5446cf --- /dev/null +++ b/docs/HeadRequest.md @@ -0,0 +1,145 @@ +# HeadRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **string** | A unique identifier assigned to the request. | +**UniqueKey** | **string** | A unique key used for request de-duplication. Requests with the same unique key are considered identical. | +**Url** | **string** | The URL of the request. | +**Method** | Pointer to [**HttpMethod**](HttpMethod.md) | | [optional] +**RetryCount** | Pointer to **int32** | The number of times this request has been retried. | [optional] + +## Methods + +### NewHeadRequest + +`func NewHeadRequest(id string, uniqueKey string, url string, ) *HeadRequest` + +NewHeadRequest instantiates a new HeadRequest object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewHeadRequestWithDefaults + +`func NewHeadRequestWithDefaults() *HeadRequest` + +NewHeadRequestWithDefaults instantiates a new HeadRequest object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetId + +`func (o *HeadRequest) GetId() string` + +GetId returns the Id field if non-nil, zero value otherwise. + +### GetIdOk + +`func (o *HeadRequest) GetIdOk() (*string, bool)` + +GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetId + +`func (o *HeadRequest) SetId(v string)` + +SetId sets Id field to given value. + + +### GetUniqueKey + +`func (o *HeadRequest) GetUniqueKey() string` + +GetUniqueKey returns the UniqueKey field if non-nil, zero value otherwise. + +### GetUniqueKeyOk + +`func (o *HeadRequest) GetUniqueKeyOk() (*string, bool)` + +GetUniqueKeyOk returns a tuple with the UniqueKey field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUniqueKey + +`func (o *HeadRequest) SetUniqueKey(v string)` + +SetUniqueKey sets UniqueKey field to given value. + + +### GetUrl + +`func (o *HeadRequest) GetUrl() string` + +GetUrl returns the Url field if non-nil, zero value otherwise. + +### GetUrlOk + +`func (o *HeadRequest) GetUrlOk() (*string, bool)` + +GetUrlOk returns a tuple with the Url field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUrl + +`func (o *HeadRequest) SetUrl(v string)` + +SetUrl sets Url field to given value. + + +### GetMethod + +`func (o *HeadRequest) GetMethod() HttpMethod` + +GetMethod returns the Method field if non-nil, zero value otherwise. + +### GetMethodOk + +`func (o *HeadRequest) GetMethodOk() (*HttpMethod, bool)` + +GetMethodOk returns a tuple with the Method field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMethod + +`func (o *HeadRequest) SetMethod(v HttpMethod)` + +SetMethod sets Method field to given value. + +### HasMethod + +`func (o *HeadRequest) HasMethod() bool` + +HasMethod returns a boolean if a field has been set. + +### GetRetryCount + +`func (o *HeadRequest) GetRetryCount() int32` + +GetRetryCount returns the RetryCount field if non-nil, zero value otherwise. + +### GetRetryCountOk + +`func (o *HeadRequest) GetRetryCountOk() (*int32, bool)` + +GetRetryCountOk returns a tuple with the RetryCount field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRetryCount + +`func (o *HeadRequest) SetRetryCount(v int32)` + +SetRetryCount sets RetryCount field to given value. + +### HasRetryCount + +`func (o *HeadRequest) HasRetryCount() bool` + +HasRetryCount returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/HeadResponse.md b/docs/HeadResponse.md new file mode 100644 index 0000000..09c6162 --- /dev/null +++ b/docs/HeadResponse.md @@ -0,0 +1,51 @@ +# HeadResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Data** | [**RequestQueueHead**](RequestQueueHead.md) | | + +## Methods + +### NewHeadResponse + +`func NewHeadResponse(data RequestQueueHead, ) *HeadResponse` + +NewHeadResponse instantiates a new HeadResponse object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewHeadResponseWithDefaults + +`func NewHeadResponseWithDefaults() *HeadResponse` + +NewHeadResponseWithDefaults instantiates a new HeadResponse object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetData + +`func (o *HeadResponse) GetData() RequestQueueHead` + +GetData returns the Data field if non-nil, zero value otherwise. + +### GetDataOk + +`func (o *HeadResponse) GetDataOk() (*RequestQueueHead, bool)` + +GetDataOk returns a tuple with the Data field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetData + +`func (o *HeadResponse) SetData(v RequestQueueHead)` + +SetData sets Data field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/HttpMethod.md b/docs/HttpMethod.md new file mode 100644 index 0000000..edae44c --- /dev/null +++ b/docs/HttpMethod.md @@ -0,0 +1,27 @@ +# HttpMethod + +## Enum + + +* `GET` (value: `"GET"`) + +* `HEAD` (value: `"HEAD"`) + +* `POST` (value: `"POST"`) + +* `PUT` (value: `"PUT"`) + +* `DELETE` (value: `"DELETE"`) + +* `CONNECT` (value: `"CONNECT"`) + +* `OPTIONS` (value: `"OPTIONS"`) + +* `TRACE` (value: `"TRACE"`) + +* `PATCH` (value: `"PATCH"`) + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/InvalidItem.md b/docs/InvalidItem.md new file mode 100644 index 0000000..95f6d6d --- /dev/null +++ b/docs/InvalidItem.md @@ -0,0 +1,82 @@ +# InvalidItem + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ItemPosition** | Pointer to **int32** | The position of the invalid item in the array. | [optional] +**ValidationErrors** | Pointer to [**[]ValidationError**](ValidationError.md) | A complete list of AJV validation error objects for the invalid item. | [optional] + +## Methods + +### NewInvalidItem + +`func NewInvalidItem() *InvalidItem` + +NewInvalidItem instantiates a new InvalidItem object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewInvalidItemWithDefaults + +`func NewInvalidItemWithDefaults() *InvalidItem` + +NewInvalidItemWithDefaults instantiates a new InvalidItem object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetItemPosition + +`func (o *InvalidItem) GetItemPosition() int32` + +GetItemPosition returns the ItemPosition field if non-nil, zero value otherwise. + +### GetItemPositionOk + +`func (o *InvalidItem) GetItemPositionOk() (*int32, bool)` + +GetItemPositionOk returns a tuple with the ItemPosition field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetItemPosition + +`func (o *InvalidItem) SetItemPosition(v int32)` + +SetItemPosition sets ItemPosition field to given value. + +### HasItemPosition + +`func (o *InvalidItem) HasItemPosition() bool` + +HasItemPosition returns a boolean if a field has been set. + +### GetValidationErrors + +`func (o *InvalidItem) GetValidationErrors() []ValidationError` + +GetValidationErrors returns the ValidationErrors field if non-nil, zero value otherwise. + +### GetValidationErrorsOk + +`func (o *InvalidItem) GetValidationErrorsOk() (*[]ValidationError, bool)` + +GetValidationErrorsOk returns a tuple with the ValidationErrors field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetValidationErrors + +`func (o *InvalidItem) SetValidationErrors(v []ValidationError)` + +SetValidationErrors sets ValidationErrors field to given value. + +### HasValidationErrors + +`func (o *InvalidItem) HasValidationErrors() bool` + +HasValidationErrors returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/KeyValueStore.md b/docs/KeyValueStore.md new file mode 100644 index 0000000..2d09628 --- /dev/null +++ b/docs/KeyValueStore.md @@ -0,0 +1,496 @@ +# KeyValueStore + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **string** | | +**Name** | Pointer to **NullableString** | | [optional] +**UserId** | Pointer to **NullableString** | | [optional] +**Username** | Pointer to **NullableString** | | [optional] +**CreatedAt** | **time.Time** | | +**ModifiedAt** | **time.Time** | | +**AccessedAt** | **time.Time** | | +**ActId** | Pointer to **NullableString** | | [optional] +**ActRunId** | Pointer to **NullableString** | | [optional] +**ConsoleUrl** | Pointer to **string** | | [optional] +**KeysPublicUrl** | Pointer to **string** | A public link to access keys of the key-value store directly. | [optional] +**RecordsPublicUrl** | Pointer to **string** | A public link to access records of the key-value store directly. | [optional] +**Schema** | Pointer to **map[string]interface{}** | Optional JSON schema describing the keys stored in the key-value store. | [optional] +**UrlSigningSecretKey** | Pointer to **NullableString** | A secret key for generating signed public URLs. It is only provided to clients with WRITE permission for the key-value store. | [optional] +**GeneralAccess** | Pointer to [**GeneralAccess**](GeneralAccess.md) | | [optional] +**Stats** | Pointer to [**KeyValueStoreStats**](KeyValueStoreStats.md) | | [optional] + +## Methods + +### NewKeyValueStore + +`func NewKeyValueStore(id string, createdAt time.Time, modifiedAt time.Time, accessedAt time.Time, ) *KeyValueStore` + +NewKeyValueStore instantiates a new KeyValueStore object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewKeyValueStoreWithDefaults + +`func NewKeyValueStoreWithDefaults() *KeyValueStore` + +NewKeyValueStoreWithDefaults instantiates a new KeyValueStore object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetId + +`func (o *KeyValueStore) GetId() string` + +GetId returns the Id field if non-nil, zero value otherwise. + +### GetIdOk + +`func (o *KeyValueStore) GetIdOk() (*string, bool)` + +GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetId + +`func (o *KeyValueStore) SetId(v string)` + +SetId sets Id field to given value. + + +### GetName + +`func (o *KeyValueStore) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *KeyValueStore) GetNameOk() (*string, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetName + +`func (o *KeyValueStore) SetName(v string)` + +SetName sets Name field to given value. + +### HasName + +`func (o *KeyValueStore) HasName() bool` + +HasName returns a boolean if a field has been set. + +### SetNameNil + +`func (o *KeyValueStore) SetNameNil(b bool)` + + SetNameNil sets the value for Name to be an explicit nil + +### UnsetName +`func (o *KeyValueStore) UnsetName()` + +UnsetName ensures that no value is present for Name, not even an explicit nil +### GetUserId + +`func (o *KeyValueStore) GetUserId() string` + +GetUserId returns the UserId field if non-nil, zero value otherwise. + +### GetUserIdOk + +`func (o *KeyValueStore) GetUserIdOk() (*string, bool)` + +GetUserIdOk returns a tuple with the UserId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUserId + +`func (o *KeyValueStore) SetUserId(v string)` + +SetUserId sets UserId field to given value. + +### HasUserId + +`func (o *KeyValueStore) HasUserId() bool` + +HasUserId returns a boolean if a field has been set. + +### SetUserIdNil + +`func (o *KeyValueStore) SetUserIdNil(b bool)` + + SetUserIdNil sets the value for UserId to be an explicit nil + +### UnsetUserId +`func (o *KeyValueStore) UnsetUserId()` + +UnsetUserId ensures that no value is present for UserId, not even an explicit nil +### GetUsername + +`func (o *KeyValueStore) GetUsername() string` + +GetUsername returns the Username field if non-nil, zero value otherwise. + +### GetUsernameOk + +`func (o *KeyValueStore) GetUsernameOk() (*string, bool)` + +GetUsernameOk returns a tuple with the Username field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUsername + +`func (o *KeyValueStore) SetUsername(v string)` + +SetUsername sets Username field to given value. + +### HasUsername + +`func (o *KeyValueStore) HasUsername() bool` + +HasUsername returns a boolean if a field has been set. + +### SetUsernameNil + +`func (o *KeyValueStore) SetUsernameNil(b bool)` + + SetUsernameNil sets the value for Username to be an explicit nil + +### UnsetUsername +`func (o *KeyValueStore) UnsetUsername()` + +UnsetUsername ensures that no value is present for Username, not even an explicit nil +### GetCreatedAt + +`func (o *KeyValueStore) GetCreatedAt() time.Time` + +GetCreatedAt returns the CreatedAt field if non-nil, zero value otherwise. + +### GetCreatedAtOk + +`func (o *KeyValueStore) GetCreatedAtOk() (*time.Time, bool)` + +GetCreatedAtOk returns a tuple with the CreatedAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCreatedAt + +`func (o *KeyValueStore) SetCreatedAt(v time.Time)` + +SetCreatedAt sets CreatedAt field to given value. + + +### GetModifiedAt + +`func (o *KeyValueStore) GetModifiedAt() time.Time` + +GetModifiedAt returns the ModifiedAt field if non-nil, zero value otherwise. + +### GetModifiedAtOk + +`func (o *KeyValueStore) GetModifiedAtOk() (*time.Time, bool)` + +GetModifiedAtOk returns a tuple with the ModifiedAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetModifiedAt + +`func (o *KeyValueStore) SetModifiedAt(v time.Time)` + +SetModifiedAt sets ModifiedAt field to given value. + + +### GetAccessedAt + +`func (o *KeyValueStore) GetAccessedAt() time.Time` + +GetAccessedAt returns the AccessedAt field if non-nil, zero value otherwise. + +### GetAccessedAtOk + +`func (o *KeyValueStore) GetAccessedAtOk() (*time.Time, bool)` + +GetAccessedAtOk returns a tuple with the AccessedAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAccessedAt + +`func (o *KeyValueStore) SetAccessedAt(v time.Time)` + +SetAccessedAt sets AccessedAt field to given value. + + +### GetActId + +`func (o *KeyValueStore) GetActId() string` + +GetActId returns the ActId field if non-nil, zero value otherwise. + +### GetActIdOk + +`func (o *KeyValueStore) GetActIdOk() (*string, bool)` + +GetActIdOk returns a tuple with the ActId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetActId + +`func (o *KeyValueStore) SetActId(v string)` + +SetActId sets ActId field to given value. + +### HasActId + +`func (o *KeyValueStore) HasActId() bool` + +HasActId returns a boolean if a field has been set. + +### SetActIdNil + +`func (o *KeyValueStore) SetActIdNil(b bool)` + + SetActIdNil sets the value for ActId to be an explicit nil + +### UnsetActId +`func (o *KeyValueStore) UnsetActId()` + +UnsetActId ensures that no value is present for ActId, not even an explicit nil +### GetActRunId + +`func (o *KeyValueStore) GetActRunId() string` + +GetActRunId returns the ActRunId field if non-nil, zero value otherwise. + +### GetActRunIdOk + +`func (o *KeyValueStore) GetActRunIdOk() (*string, bool)` + +GetActRunIdOk returns a tuple with the ActRunId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetActRunId + +`func (o *KeyValueStore) SetActRunId(v string)` + +SetActRunId sets ActRunId field to given value. + +### HasActRunId + +`func (o *KeyValueStore) HasActRunId() bool` + +HasActRunId returns a boolean if a field has been set. + +### SetActRunIdNil + +`func (o *KeyValueStore) SetActRunIdNil(b bool)` + + SetActRunIdNil sets the value for ActRunId to be an explicit nil + +### UnsetActRunId +`func (o *KeyValueStore) UnsetActRunId()` + +UnsetActRunId ensures that no value is present for ActRunId, not even an explicit nil +### GetConsoleUrl + +`func (o *KeyValueStore) GetConsoleUrl() string` + +GetConsoleUrl returns the ConsoleUrl field if non-nil, zero value otherwise. + +### GetConsoleUrlOk + +`func (o *KeyValueStore) GetConsoleUrlOk() (*string, bool)` + +GetConsoleUrlOk returns a tuple with the ConsoleUrl field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetConsoleUrl + +`func (o *KeyValueStore) SetConsoleUrl(v string)` + +SetConsoleUrl sets ConsoleUrl field to given value. + +### HasConsoleUrl + +`func (o *KeyValueStore) HasConsoleUrl() bool` + +HasConsoleUrl returns a boolean if a field has been set. + +### GetKeysPublicUrl + +`func (o *KeyValueStore) GetKeysPublicUrl() string` + +GetKeysPublicUrl returns the KeysPublicUrl field if non-nil, zero value otherwise. + +### GetKeysPublicUrlOk + +`func (o *KeyValueStore) GetKeysPublicUrlOk() (*string, bool)` + +GetKeysPublicUrlOk returns a tuple with the KeysPublicUrl field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetKeysPublicUrl + +`func (o *KeyValueStore) SetKeysPublicUrl(v string)` + +SetKeysPublicUrl sets KeysPublicUrl field to given value. + +### HasKeysPublicUrl + +`func (o *KeyValueStore) HasKeysPublicUrl() bool` + +HasKeysPublicUrl returns a boolean if a field has been set. + +### GetRecordsPublicUrl + +`func (o *KeyValueStore) GetRecordsPublicUrl() string` + +GetRecordsPublicUrl returns the RecordsPublicUrl field if non-nil, zero value otherwise. + +### GetRecordsPublicUrlOk + +`func (o *KeyValueStore) GetRecordsPublicUrlOk() (*string, bool)` + +GetRecordsPublicUrlOk returns a tuple with the RecordsPublicUrl field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRecordsPublicUrl + +`func (o *KeyValueStore) SetRecordsPublicUrl(v string)` + +SetRecordsPublicUrl sets RecordsPublicUrl field to given value. + +### HasRecordsPublicUrl + +`func (o *KeyValueStore) HasRecordsPublicUrl() bool` + +HasRecordsPublicUrl returns a boolean if a field has been set. + +### GetSchema + +`func (o *KeyValueStore) GetSchema() map[string]interface{}` + +GetSchema returns the Schema field if non-nil, zero value otherwise. + +### GetSchemaOk + +`func (o *KeyValueStore) GetSchemaOk() (*map[string]interface{}, bool)` + +GetSchemaOk returns a tuple with the Schema field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSchema + +`func (o *KeyValueStore) SetSchema(v map[string]interface{})` + +SetSchema sets Schema field to given value. + +### HasSchema + +`func (o *KeyValueStore) HasSchema() bool` + +HasSchema returns a boolean if a field has been set. + +### SetSchemaNil + +`func (o *KeyValueStore) SetSchemaNil(b bool)` + + SetSchemaNil sets the value for Schema to be an explicit nil + +### UnsetSchema +`func (o *KeyValueStore) UnsetSchema()` + +UnsetSchema ensures that no value is present for Schema, not even an explicit nil +### GetUrlSigningSecretKey + +`func (o *KeyValueStore) GetUrlSigningSecretKey() string` + +GetUrlSigningSecretKey returns the UrlSigningSecretKey field if non-nil, zero value otherwise. + +### GetUrlSigningSecretKeyOk + +`func (o *KeyValueStore) GetUrlSigningSecretKeyOk() (*string, bool)` + +GetUrlSigningSecretKeyOk returns a tuple with the UrlSigningSecretKey field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUrlSigningSecretKey + +`func (o *KeyValueStore) SetUrlSigningSecretKey(v string)` + +SetUrlSigningSecretKey sets UrlSigningSecretKey field to given value. + +### HasUrlSigningSecretKey + +`func (o *KeyValueStore) HasUrlSigningSecretKey() bool` + +HasUrlSigningSecretKey returns a boolean if a field has been set. + +### SetUrlSigningSecretKeyNil + +`func (o *KeyValueStore) SetUrlSigningSecretKeyNil(b bool)` + + SetUrlSigningSecretKeyNil sets the value for UrlSigningSecretKey to be an explicit nil + +### UnsetUrlSigningSecretKey +`func (o *KeyValueStore) UnsetUrlSigningSecretKey()` + +UnsetUrlSigningSecretKey ensures that no value is present for UrlSigningSecretKey, not even an explicit nil +### GetGeneralAccess + +`func (o *KeyValueStore) GetGeneralAccess() GeneralAccess` + +GetGeneralAccess returns the GeneralAccess field if non-nil, zero value otherwise. + +### GetGeneralAccessOk + +`func (o *KeyValueStore) GetGeneralAccessOk() (*GeneralAccess, bool)` + +GetGeneralAccessOk returns a tuple with the GeneralAccess field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetGeneralAccess + +`func (o *KeyValueStore) SetGeneralAccess(v GeneralAccess)` + +SetGeneralAccess sets GeneralAccess field to given value. + +### HasGeneralAccess + +`func (o *KeyValueStore) HasGeneralAccess() bool` + +HasGeneralAccess returns a boolean if a field has been set. + +### GetStats + +`func (o *KeyValueStore) GetStats() KeyValueStoreStats` + +GetStats returns the Stats field if non-nil, zero value otherwise. + +### GetStatsOk + +`func (o *KeyValueStore) GetStatsOk() (*KeyValueStoreStats, bool)` + +GetStatsOk returns a tuple with the Stats field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetStats + +`func (o *KeyValueStore) SetStats(v KeyValueStoreStats)` + +SetStats sets Stats field to given value. + +### HasStats + +`func (o *KeyValueStore) HasStats() bool` + +HasStats returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/KeyValueStoreKey.md b/docs/KeyValueStoreKey.md new file mode 100644 index 0000000..dedb214 --- /dev/null +++ b/docs/KeyValueStoreKey.md @@ -0,0 +1,93 @@ +# KeyValueStoreKey + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Key** | **string** | | +**Size** | **int32** | | +**RecordPublicUrl** | **string** | A public link to access this record directly. | + +## Methods + +### NewKeyValueStoreKey + +`func NewKeyValueStoreKey(key string, size int32, recordPublicUrl string, ) *KeyValueStoreKey` + +NewKeyValueStoreKey instantiates a new KeyValueStoreKey object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewKeyValueStoreKeyWithDefaults + +`func NewKeyValueStoreKeyWithDefaults() *KeyValueStoreKey` + +NewKeyValueStoreKeyWithDefaults instantiates a new KeyValueStoreKey object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetKey + +`func (o *KeyValueStoreKey) GetKey() string` + +GetKey returns the Key field if non-nil, zero value otherwise. + +### GetKeyOk + +`func (o *KeyValueStoreKey) GetKeyOk() (*string, bool)` + +GetKeyOk returns a tuple with the Key field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetKey + +`func (o *KeyValueStoreKey) SetKey(v string)` + +SetKey sets Key field to given value. + + +### GetSize + +`func (o *KeyValueStoreKey) GetSize() int32` + +GetSize returns the Size field if non-nil, zero value otherwise. + +### GetSizeOk + +`func (o *KeyValueStoreKey) GetSizeOk() (*int32, bool)` + +GetSizeOk returns a tuple with the Size field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSize + +`func (o *KeyValueStoreKey) SetSize(v int32)` + +SetSize sets Size field to given value. + + +### GetRecordPublicUrl + +`func (o *KeyValueStoreKey) GetRecordPublicUrl() string` + +GetRecordPublicUrl returns the RecordPublicUrl field if non-nil, zero value otherwise. + +### GetRecordPublicUrlOk + +`func (o *KeyValueStoreKey) GetRecordPublicUrlOk() (*string, bool)` + +GetRecordPublicUrlOk returns a tuple with the RecordPublicUrl field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRecordPublicUrl + +`func (o *KeyValueStoreKey) SetRecordPublicUrl(v string)` + +SetRecordPublicUrl sets RecordPublicUrl field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/KeyValueStoreResponse.md b/docs/KeyValueStoreResponse.md new file mode 100644 index 0000000..403c3d6 --- /dev/null +++ b/docs/KeyValueStoreResponse.md @@ -0,0 +1,51 @@ +# KeyValueStoreResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Data** | [**KeyValueStore**](KeyValueStore.md) | | + +## Methods + +### NewKeyValueStoreResponse + +`func NewKeyValueStoreResponse(data KeyValueStore, ) *KeyValueStoreResponse` + +NewKeyValueStoreResponse instantiates a new KeyValueStoreResponse object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewKeyValueStoreResponseWithDefaults + +`func NewKeyValueStoreResponseWithDefaults() *KeyValueStoreResponse` + +NewKeyValueStoreResponseWithDefaults instantiates a new KeyValueStoreResponse object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetData + +`func (o *KeyValueStoreResponse) GetData() KeyValueStore` + +GetData returns the Data field if non-nil, zero value otherwise. + +### GetDataOk + +`func (o *KeyValueStoreResponse) GetDataOk() (*KeyValueStore, bool)` + +GetDataOk returns a tuple with the Data field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetData + +`func (o *KeyValueStoreResponse) SetData(v KeyValueStore)` + +SetData sets Data field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/KeyValueStoreStats.md b/docs/KeyValueStoreStats.md new file mode 100644 index 0000000..186f59f --- /dev/null +++ b/docs/KeyValueStoreStats.md @@ -0,0 +1,166 @@ +# KeyValueStoreStats + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ReadCount** | **int32** | | +**WriteCount** | **int32** | | +**DeleteCount** | **int32** | | +**ListCount** | **int32** | | +**S3StorageBytes** | Pointer to **int32** | | [optional] +**StorageBytes** | Pointer to **int32** | | [optional] + +## Methods + +### NewKeyValueStoreStats + +`func NewKeyValueStoreStats(readCount int32, writeCount int32, deleteCount int32, listCount int32, ) *KeyValueStoreStats` + +NewKeyValueStoreStats instantiates a new KeyValueStoreStats object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewKeyValueStoreStatsWithDefaults + +`func NewKeyValueStoreStatsWithDefaults() *KeyValueStoreStats` + +NewKeyValueStoreStatsWithDefaults instantiates a new KeyValueStoreStats object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetReadCount + +`func (o *KeyValueStoreStats) GetReadCount() int32` + +GetReadCount returns the ReadCount field if non-nil, zero value otherwise. + +### GetReadCountOk + +`func (o *KeyValueStoreStats) GetReadCountOk() (*int32, bool)` + +GetReadCountOk returns a tuple with the ReadCount field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetReadCount + +`func (o *KeyValueStoreStats) SetReadCount(v int32)` + +SetReadCount sets ReadCount field to given value. + + +### GetWriteCount + +`func (o *KeyValueStoreStats) GetWriteCount() int32` + +GetWriteCount returns the WriteCount field if non-nil, zero value otherwise. + +### GetWriteCountOk + +`func (o *KeyValueStoreStats) GetWriteCountOk() (*int32, bool)` + +GetWriteCountOk returns a tuple with the WriteCount field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetWriteCount + +`func (o *KeyValueStoreStats) SetWriteCount(v int32)` + +SetWriteCount sets WriteCount field to given value. + + +### GetDeleteCount + +`func (o *KeyValueStoreStats) GetDeleteCount() int32` + +GetDeleteCount returns the DeleteCount field if non-nil, zero value otherwise. + +### GetDeleteCountOk + +`func (o *KeyValueStoreStats) GetDeleteCountOk() (*int32, bool)` + +GetDeleteCountOk returns a tuple with the DeleteCount field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDeleteCount + +`func (o *KeyValueStoreStats) SetDeleteCount(v int32)` + +SetDeleteCount sets DeleteCount field to given value. + + +### GetListCount + +`func (o *KeyValueStoreStats) GetListCount() int32` + +GetListCount returns the ListCount field if non-nil, zero value otherwise. + +### GetListCountOk + +`func (o *KeyValueStoreStats) GetListCountOk() (*int32, bool)` + +GetListCountOk returns a tuple with the ListCount field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetListCount + +`func (o *KeyValueStoreStats) SetListCount(v int32)` + +SetListCount sets ListCount field to given value. + + +### GetS3StorageBytes + +`func (o *KeyValueStoreStats) GetS3StorageBytes() int32` + +GetS3StorageBytes returns the S3StorageBytes field if non-nil, zero value otherwise. + +### GetS3StorageBytesOk + +`func (o *KeyValueStoreStats) GetS3StorageBytesOk() (*int32, bool)` + +GetS3StorageBytesOk returns a tuple with the S3StorageBytes field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetS3StorageBytes + +`func (o *KeyValueStoreStats) SetS3StorageBytes(v int32)` + +SetS3StorageBytes sets S3StorageBytes field to given value. + +### HasS3StorageBytes + +`func (o *KeyValueStoreStats) HasS3StorageBytes() bool` + +HasS3StorageBytes returns a boolean if a field has been set. + +### GetStorageBytes + +`func (o *KeyValueStoreStats) GetStorageBytes() int32` + +GetStorageBytes returns the StorageBytes field if non-nil, zero value otherwise. + +### GetStorageBytesOk + +`func (o *KeyValueStoreStats) GetStorageBytesOk() (*int32, bool)` + +GetStorageBytesOk returns a tuple with the StorageBytes field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetStorageBytes + +`func (o *KeyValueStoreStats) SetStorageBytes(v int32)` + +SetStorageBytes sets StorageBytes field to given value. + +### HasStorageBytes + +`func (o *KeyValueStoreStats) HasStorageBytes() bool` + +HasStorageBytes returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/LastActorRunsAbortAPI.md b/docs/LastActorRunsAbortAPI.md new file mode 100644 index 0000000..6373ab0 --- /dev/null +++ b/docs/LastActorRunsAbortAPI.md @@ -0,0 +1,83 @@ +# \LastActorRunsAbortAPI + +All URIs are relative to *https://api.apify.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**ActRunsLastAbortPost**](LastActorRunsAbortAPI.md#ActRunsLastAbortPost) | **Post** /v2/actors/{actorId}/runs/last/abort | Abort Actor's last run + + + +## ActRunsLastAbortPost + +> RunResponse ActRunsLastAbortPost(ctx, actorId).Status(status).Gracefully(gracefully).Execute() + +Abort Actor's last run + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + actorId := "janedoe~my-actor" // string | Actor ID or a tilde-separated owner's username and Actor name. + status := "SUCCEEDED" // string | Filter for the run status. (optional) + gracefully := true // bool | If true passed, the Actor run will abort gracefully. It will send `aborting` and `persistState` event into run and force-stop the run after 30 seconds. It is helpful in cases where you plan to resurrect the run later. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.LastActorRunsAbortAPI.ActRunsLastAbortPost(context.Background(), actorId).Status(status).Gracefully(gracefully).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `LastActorRunsAbortAPI.ActRunsLastAbortPost``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ActRunsLastAbortPost`: RunResponse + fmt.Fprintf(os.Stdout, "Response from `LastActorRunsAbortAPI.ActRunsLastAbortPost`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**actorId** | **string** | Actor ID or a tilde-separated owner's username and Actor name. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiActRunsLastAbortPostRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **status** | **string** | Filter for the run status. | + **gracefully** | **bool** | If true passed, the Actor run will abort gracefully. It will send `aborting` and `persistState` event into run and force-stop the run after 30 seconds. It is helpful in cases where you plan to resurrect the run later. | + +### Return type + +[**RunResponse**](RunResponse.md) + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/docs/LastActorRunsDefaultDatasetAPI.md b/docs/LastActorRunsDefaultDatasetAPI.md new file mode 100644 index 0000000..d2f659a --- /dev/null +++ b/docs/LastActorRunsDefaultDatasetAPI.md @@ -0,0 +1,496 @@ +# \LastActorRunsDefaultDatasetAPI + +All URIs are relative to *https://api.apify.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**ActRunsLastDatasetDelete**](LastActorRunsDefaultDatasetAPI.md#ActRunsLastDatasetDelete) | **Delete** /v2/actors/{actorId}/runs/last/dataset | Delete last run's default dataset +[**ActRunsLastDatasetGet**](LastActorRunsDefaultDatasetAPI.md#ActRunsLastDatasetGet) | **Get** /v2/actors/{actorId}/runs/last/dataset | Get last run's default dataset +[**ActRunsLastDatasetItemsGet**](LastActorRunsDefaultDatasetAPI.md#ActRunsLastDatasetItemsGet) | **Get** /v2/actors/{actorId}/runs/last/dataset/items | Get last run's dataset items +[**ActRunsLastDatasetItemsPost**](LastActorRunsDefaultDatasetAPI.md#ActRunsLastDatasetItemsPost) | **Post** /v2/actors/{actorId}/runs/last/dataset/items | Store items in last run's dataset +[**ActRunsLastDatasetPut**](LastActorRunsDefaultDatasetAPI.md#ActRunsLastDatasetPut) | **Put** /v2/actors/{actorId}/runs/last/dataset | Update last run's default dataset +[**ActRunsLastDatasetStatisticsGet**](LastActorRunsDefaultDatasetAPI.md#ActRunsLastDatasetStatisticsGet) | **Get** /v2/actors/{actorId}/runs/last/dataset/statistics | Get last run's dataset statistics + + + +## ActRunsLastDatasetDelete + +> ActRunsLastDatasetDelete(ctx, actorId).Status(status).Execute() + +Delete last run's default dataset + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + actorId := "janedoe~my-actor" // string | Actor ID or a tilde-separated owner's username and Actor name. + status := "SUCCEEDED" // string | Filter for the run status. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + r, err := apiClient.LastActorRunsDefaultDatasetAPI.ActRunsLastDatasetDelete(context.Background(), actorId).Status(status).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `LastActorRunsDefaultDatasetAPI.ActRunsLastDatasetDelete``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**actorId** | **string** | Actor ID or a tilde-separated owner's username and Actor name. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiActRunsLastDatasetDeleteRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **status** | **string** | Filter for the run status. | + +### Return type + + (empty response body) + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## ActRunsLastDatasetGet + +> DatasetResponse ActRunsLastDatasetGet(ctx, actorId).Status(status).Execute() + +Get last run's default dataset + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + actorId := "janedoe~my-actor" // string | Actor ID or a tilde-separated owner's username and Actor name. + status := "SUCCEEDED" // string | Filter for the run status. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.LastActorRunsDefaultDatasetAPI.ActRunsLastDatasetGet(context.Background(), actorId).Status(status).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `LastActorRunsDefaultDatasetAPI.ActRunsLastDatasetGet``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ActRunsLastDatasetGet`: DatasetResponse + fmt.Fprintf(os.Stdout, "Response from `LastActorRunsDefaultDatasetAPI.ActRunsLastDatasetGet`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**actorId** | **string** | Actor ID or a tilde-separated owner's username and Actor name. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiActRunsLastDatasetGetRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **status** | **string** | Filter for the run status. | + +### Return type + +[**DatasetResponse**](DatasetResponse.md) + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## ActRunsLastDatasetItemsGet + +> []map[string]interface{} ActRunsLastDatasetItemsGet(ctx, actorId).Status(status).Format(format).Clean(clean).Offset(offset).Limit(limit).Fields(fields).OutputFields(outputFields).Omit(omit).Unwind(unwind).Flatten(flatten).Desc(desc).Attachment(attachment).Delimiter(delimiter).Bom(bom).XmlRoot(xmlRoot).XmlRow(xmlRow).SkipHeaderRow(skipHeaderRow).SkipHidden(skipHidden).SkipEmpty(skipEmpty).Simplified(simplified).View(view).SkipFailedPages(skipFailedPages).FeedTitle(feedTitle).FeedDescription(feedDescription).Signature(signature).Execute() + +Get last run's dataset items + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + actorId := "janedoe~my-actor" // string | Actor ID or a tilde-separated owner's username and Actor name. + status := "SUCCEEDED" // string | Filter for the run status. (optional) + format := "json" // string | Format of the results, possible values are: `json`, `jsonl`, `csv`, `html`, `xlsx`, `xml` and `rss`. The default value is `json`. (optional) + clean := false // bool | If `true` or `1` then the API endpoint returns only non-empty items and skips hidden fields (i.e. fields starting with the # character). The `clean` parameter is just a shortcut for `skipHidden=true` and `skipEmpty=true` parameters. Note that since some objects might be skipped from the output, that the result might contain less items than the `limit` value. (optional) + offset := float64(0) // float64 | Number of items that should be skipped at the start. The default value is `0`. (optional) + limit := float64(1.2) // float64 | Maximum number of items to return. By default there is no limit. (optional) + fields := "myValue,myOtherValue" // string | A comma-separated list of fields which should be picked from the items, only these fields will remain in the resulting record objects. Note that the fields in the outputted items are sorted the same way as they are specified in the `fields` query parameter. You can use this feature to effectively fix the output format. (optional) + outputFields := "title,link" // string | A comma-separated list of output field names that positionally rename the fields specified in the `fields` parameter. For example, `?fields=headline,url&outputFields=title,link` renames `headline` to `title` and `url` to `link` in the output. The number of names in `outputFields` must match the number of names in `fields`. Requires the `fields` parameter to be specified as well. (optional) + omit := "myValue,myOtherValue" // string | A comma-separated list of fields which should be omitted from the items. (optional) + unwind := "myValue,myOtherValue" // string | A comma-separated list of fields which should be unwound, in order which they should be processed. Each field should be either an array or an object. If the field is an array then every element of the array will become a separate record and merged with parent object. If the unwound field is an object then it is merged with the parent object. If the unwound field is missing or its value is neither an array nor an object and therefore cannot be merged with a parent object then the item gets preserved as it is. Note that the unwound items ignore the `desc` parameter. (optional) + flatten := "myValue" // string | A comma-separated list of fields which should transform nested objects into flat structures. For example, with `flatten=\"foo\"` the object `{\"foo\":{\"bar\": \"hello\"}}` is turned into `{\"foo.bar\": \"hello\"}`. The original object with properties is replaced with the flattened object. (optional) + desc := true // bool | By default, results are returned in the same order as they were stored. To reverse the order, set this parameter to `true` or `1`. (optional) + attachment := true // bool | If `true` or `1` then the response will define the `Content-Disposition: attachment` header, forcing a web browser to download the file rather than to display it. By default this header is not present. (optional) + delimiter := ";" // string | A delimiter character for CSV files, only used if `format=csv`. You might need to URL-encode the character (e.g. use `%09` for tab or `%3B` for semicolon). The default delimiter is a simple comma (`,`). (optional) + bom := false // bool | All text responses are encoded in UTF-8 encoding. By default, the `format=csv` files are prefixed with the UTF-8 Byte Order Mark (BOM), while `json`, `jsonl`, `xml`, `html` and `rss` files are not. If you want to override this default behavior, specify `bom=1` query parameter to include the BOM or `bom=0` to skip it. (optional) + xmlRoot := "items" // string | Overrides default root element name of `xml` output. By default the root element is `items`. (optional) + xmlRow := "item" // string | Overrides default element name that wraps each page or page function result object in `xml` output. By default the element name is `item`. (optional) + skipHeaderRow := true // bool | If `true` or `1` then header row in the `csv` format is skipped. (optional) + skipHidden := false // bool | If `true` or `1` then hidden fields are skipped from the output, i.e. fields starting with the `#` character. (optional) + skipEmpty := false // bool | If `true` or `1` then empty items are skipped from the output. Note that if used, the results might contain less items than the limit value. (optional) + simplified := false // bool | If `true` or `1` then, the endpoint applies the `fields=url,pageFunctionResult,errorInfo` and `unwind=pageFunctionResult` query parameters. This feature is used to emulate simplified results provided by the legacy Apify Crawler product and it's not recommended to use it in new integrations. (optional) + view := "overview" // string | Defines the view configuration for dataset items based on the schema definition. This parameter determines how the data will be filtered and presented. For complete specification details, see the [dataset schema documentation](/platform/actors/development/actor-definition/dataset-schema). (optional) + skipFailedPages := false // bool | If `true` or `1` then, the all the items with errorInfo property will be skipped from the output. This feature is here to emulate functionality of API version 1 used for the legacy Apify Crawler product and it's not recommended to use it in new integrations. (optional) + feedTitle := "Latest posts from r/pasta" // string | Overrides the auto-generated RSS channel `<title>` element. Only used when `format=rss`. If not provided, the title defaults to `Dataset <label>`. (optional) + feedDescription := "Scraped forum posts" // string | Overrides the auto-generated RSS channel `<description>` element. Only used when `format=rss`. If not provided, the description defaults to `Items in dataset with id \"<datasetId>\".` (optional) + signature := "2wTI46Bg8qWQrV7tavlPI" // string | Signature used for the access. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.LastActorRunsDefaultDatasetAPI.ActRunsLastDatasetItemsGet(context.Background(), actorId).Status(status).Format(format).Clean(clean).Offset(offset).Limit(limit).Fields(fields).OutputFields(outputFields).Omit(omit).Unwind(unwind).Flatten(flatten).Desc(desc).Attachment(attachment).Delimiter(delimiter).Bom(bom).XmlRoot(xmlRoot).XmlRow(xmlRow).SkipHeaderRow(skipHeaderRow).SkipHidden(skipHidden).SkipEmpty(skipEmpty).Simplified(simplified).View(view).SkipFailedPages(skipFailedPages).FeedTitle(feedTitle).FeedDescription(feedDescription).Signature(signature).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `LastActorRunsDefaultDatasetAPI.ActRunsLastDatasetItemsGet``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ActRunsLastDatasetItemsGet`: []map[string]interface{} + fmt.Fprintf(os.Stdout, "Response from `LastActorRunsDefaultDatasetAPI.ActRunsLastDatasetItemsGet`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**actorId** | **string** | Actor ID or a tilde-separated owner's username and Actor name. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiActRunsLastDatasetItemsGetRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **status** | **string** | Filter for the run status. | + **format** | **string** | Format of the results, possible values are: `json`, `jsonl`, `csv`, `html`, `xlsx`, `xml` and `rss`. The default value is `json`. | + **clean** | **bool** | If `true` or `1` then the API endpoint returns only non-empty items and skips hidden fields (i.e. fields starting with the # character). The `clean` parameter is just a shortcut for `skipHidden=true` and `skipEmpty=true` parameters. Note that since some objects might be skipped from the output, that the result might contain less items than the `limit` value. | + **offset** | **float64** | Number of items that should be skipped at the start. The default value is `0`. | + **limit** | **float64** | Maximum number of items to return. By default there is no limit. | + **fields** | **string** | A comma-separated list of fields which should be picked from the items, only these fields will remain in the resulting record objects. Note that the fields in the outputted items are sorted the same way as they are specified in the `fields` query parameter. You can use this feature to effectively fix the output format. | + **outputFields** | **string** | A comma-separated list of output field names that positionally rename the fields specified in the `fields` parameter. For example, `?fields=headline,url&outputFields=title,link` renames `headline` to `title` and `url` to `link` in the output. The number of names in `outputFields` must match the number of names in `fields`. Requires the `fields` parameter to be specified as well. | + **omit** | **string** | A comma-separated list of fields which should be omitted from the items. | + **unwind** | **string** | A comma-separated list of fields which should be unwound, in order which they should be processed. Each field should be either an array or an object. If the field is an array then every element of the array will become a separate record and merged with parent object. If the unwound field is an object then it is merged with the parent object. If the unwound field is missing or its value is neither an array nor an object and therefore cannot be merged with a parent object then the item gets preserved as it is. Note that the unwound items ignore the `desc` parameter. | + **flatten** | **string** | A comma-separated list of fields which should transform nested objects into flat structures. For example, with `flatten=\"foo\"` the object `{\"foo\":{\"bar\": \"hello\"}}` is turned into `{\"foo.bar\": \"hello\"}`. The original object with properties is replaced with the flattened object. | + **desc** | **bool** | By default, results are returned in the same order as they were stored. To reverse the order, set this parameter to `true` or `1`. | + **attachment** | **bool** | If `true` or `1` then the response will define the `Content-Disposition: attachment` header, forcing a web browser to download the file rather than to display it. By default this header is not present. | + **delimiter** | **string** | A delimiter character for CSV files, only used if `format=csv`. You might need to URL-encode the character (e.g. use `%09` for tab or `%3B` for semicolon). The default delimiter is a simple comma (`,`). | + **bom** | **bool** | All text responses are encoded in UTF-8 encoding. By default, the `format=csv` files are prefixed with the UTF-8 Byte Order Mark (BOM), while `json`, `jsonl`, `xml`, `html` and `rss` files are not. If you want to override this default behavior, specify `bom=1` query parameter to include the BOM or `bom=0` to skip it. | + **xmlRoot** | **string** | Overrides default root element name of `xml` output. By default the root element is `items`. | + **xmlRow** | **string** | Overrides default element name that wraps each page or page function result object in `xml` output. By default the element name is `item`. | + **skipHeaderRow** | **bool** | If `true` or `1` then header row in the `csv` format is skipped. | + **skipHidden** | **bool** | If `true` or `1` then hidden fields are skipped from the output, i.e. fields starting with the `#` character. | + **skipEmpty** | **bool** | If `true` or `1` then empty items are skipped from the output. Note that if used, the results might contain less items than the limit value. | + **simplified** | **bool** | If `true` or `1` then, the endpoint applies the `fields=url,pageFunctionResult,errorInfo` and `unwind=pageFunctionResult` query parameters. This feature is used to emulate simplified results provided by the legacy Apify Crawler product and it's not recommended to use it in new integrations. | + **view** | **string** | Defines the view configuration for dataset items based on the schema definition. This parameter determines how the data will be filtered and presented. For complete specification details, see the [dataset schema documentation](/platform/actors/development/actor-definition/dataset-schema). | + **skipFailedPages** | **bool** | If `true` or `1` then, the all the items with errorInfo property will be skipped from the output. This feature is here to emulate functionality of API version 1 used for the legacy Apify Crawler product and it's not recommended to use it in new integrations. | + **feedTitle** | **string** | Overrides the auto-generated RSS channel `<title>` element. Only used when `format=rss`. If not provided, the title defaults to `Dataset <label>`. | + **feedDescription** | **string** | Overrides the auto-generated RSS channel `<description>` element. Only used when `format=rss`. If not provided, the description defaults to `Items in dataset with id \"<datasetId>\".` | + **signature** | **string** | Signature used for the access. | + +### Return type + +**[]map[string]interface{}** + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json, application/jsonl, text/csv, text/html, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/rss+xml, application/xml + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## ActRunsLastDatasetItemsPost + +> map[string]interface{} ActRunsLastDatasetItemsPost(ctx, actorId).ActRunsLastDatasetItemsPostRequest(actRunsLastDatasetItemsPostRequest).Status(status).Execute() + +Store items in last run's dataset + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + actorId := "janedoe~my-actor" // string | Actor ID or a tilde-separated owner's username and Actor name. + actRunsLastDatasetItemsPostRequest := openapiclient.act_runs_last_dataset_items_post_request{ArrayOfMapmapOfStringAny: new([]map[string]interface{})} // ActRunsLastDatasetItemsPostRequest | + status := "SUCCEEDED" // string | Filter for the run status. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.LastActorRunsDefaultDatasetAPI.ActRunsLastDatasetItemsPost(context.Background(), actorId).ActRunsLastDatasetItemsPostRequest(actRunsLastDatasetItemsPostRequest).Status(status).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `LastActorRunsDefaultDatasetAPI.ActRunsLastDatasetItemsPost``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ActRunsLastDatasetItemsPost`: map[string]interface{} + fmt.Fprintf(os.Stdout, "Response from `LastActorRunsDefaultDatasetAPI.ActRunsLastDatasetItemsPost`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**actorId** | **string** | Actor ID or a tilde-separated owner's username and Actor name. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiActRunsLastDatasetItemsPostRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **actRunsLastDatasetItemsPostRequest** | [**ActRunsLastDatasetItemsPostRequest**](ActRunsLastDatasetItemsPostRequest.md) | | + **status** | **string** | Filter for the run status. | + +### Return type + +**map[string]interface{}** + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## ActRunsLastDatasetPut + +> DatasetResponse ActRunsLastDatasetPut(ctx, actorId).UpdateDatasetRequest(updateDatasetRequest).Status(status).Execute() + +Update last run's default dataset + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + actorId := "janedoe~my-actor" // string | Actor ID or a tilde-separated owner's username and Actor name. + updateDatasetRequest := *openapiclient.NewUpdateDatasetRequest() // UpdateDatasetRequest | + status := "SUCCEEDED" // string | Filter for the run status. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.LastActorRunsDefaultDatasetAPI.ActRunsLastDatasetPut(context.Background(), actorId).UpdateDatasetRequest(updateDatasetRequest).Status(status).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `LastActorRunsDefaultDatasetAPI.ActRunsLastDatasetPut``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ActRunsLastDatasetPut`: DatasetResponse + fmt.Fprintf(os.Stdout, "Response from `LastActorRunsDefaultDatasetAPI.ActRunsLastDatasetPut`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**actorId** | **string** | Actor ID or a tilde-separated owner's username and Actor name. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiActRunsLastDatasetPutRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **updateDatasetRequest** | [**UpdateDatasetRequest**](UpdateDatasetRequest.md) | | + **status** | **string** | Filter for the run status. | + +### Return type + +[**DatasetResponse**](DatasetResponse.md) + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## ActRunsLastDatasetStatisticsGet + +> DatasetStatisticsResponse ActRunsLastDatasetStatisticsGet(ctx, actorId).Status(status).Execute() + +Get last run's dataset statistics + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + actorId := "janedoe~my-actor" // string | Actor ID or a tilde-separated owner's username and Actor name. + status := "SUCCEEDED" // string | Filter for the run status. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.LastActorRunsDefaultDatasetAPI.ActRunsLastDatasetStatisticsGet(context.Background(), actorId).Status(status).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `LastActorRunsDefaultDatasetAPI.ActRunsLastDatasetStatisticsGet``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ActRunsLastDatasetStatisticsGet`: DatasetStatisticsResponse + fmt.Fprintf(os.Stdout, "Response from `LastActorRunsDefaultDatasetAPI.ActRunsLastDatasetStatisticsGet`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**actorId** | **string** | Actor ID or a tilde-separated owner's username and Actor name. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiActRunsLastDatasetStatisticsGetRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **status** | **string** | Filter for the run status. | + +### Return type + +[**DatasetStatisticsResponse**](DatasetStatisticsResponse.md) + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/docs/LastActorRunsDefaultKeyValueStoreAPI.md b/docs/LastActorRunsDefaultKeyValueStoreAPI.md new file mode 100644 index 0000000..4f8ba56 --- /dev/null +++ b/docs/LastActorRunsDefaultKeyValueStoreAPI.md @@ -0,0 +1,703 @@ +# \LastActorRunsDefaultKeyValueStoreAPI + +All URIs are relative to *https://api.apify.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**ActRunsLastKeyValueStoreDelete**](LastActorRunsDefaultKeyValueStoreAPI.md#ActRunsLastKeyValueStoreDelete) | **Delete** /v2/actors/{actorId}/runs/last/key-value-store | Delete last run's default store +[**ActRunsLastKeyValueStoreGet**](LastActorRunsDefaultKeyValueStoreAPI.md#ActRunsLastKeyValueStoreGet) | **Get** /v2/actors/{actorId}/runs/last/key-value-store | Get last run's default store +[**ActRunsLastKeyValueStoreKeysGet**](LastActorRunsDefaultKeyValueStoreAPI.md#ActRunsLastKeyValueStoreKeysGet) | **Get** /v2/actors/{actorId}/runs/last/key-value-store/keys | Get last run's default store's list of keys +[**ActRunsLastKeyValueStorePut**](LastActorRunsDefaultKeyValueStoreAPI.md#ActRunsLastKeyValueStorePut) | **Put** /v2/actors/{actorId}/runs/last/key-value-store | Update last run's default store +[**ActRunsLastKeyValueStoreRecordDelete**](LastActorRunsDefaultKeyValueStoreAPI.md#ActRunsLastKeyValueStoreRecordDelete) | **Delete** /v2/actors/{actorId}/runs/last/key-value-store/records/{recordKey} | Delete last run's default store's record +[**ActRunsLastKeyValueStoreRecordGet**](LastActorRunsDefaultKeyValueStoreAPI.md#ActRunsLastKeyValueStoreRecordGet) | **Get** /v2/actors/{actorId}/runs/last/key-value-store/records/{recordKey} | Get last run's default store's record +[**ActRunsLastKeyValueStoreRecordPost**](LastActorRunsDefaultKeyValueStoreAPI.md#ActRunsLastKeyValueStoreRecordPost) | **Post** /v2/actors/{actorId}/runs/last/key-value-store/records/{recordKey} | Store record in last run's default store (POST) +[**ActRunsLastKeyValueStoreRecordPut**](LastActorRunsDefaultKeyValueStoreAPI.md#ActRunsLastKeyValueStoreRecordPut) | **Put** /v2/actors/{actorId}/runs/last/key-value-store/records/{recordKey} | Store record in last run's default store +[**ActRunsLastKeyValueStoreRecordsGet**](LastActorRunsDefaultKeyValueStoreAPI.md#ActRunsLastKeyValueStoreRecordsGet) | **Get** /v2/actors/{actorId}/runs/last/key-value-store/records | Download last run's default store's records + + + +## ActRunsLastKeyValueStoreDelete + +> ActRunsLastKeyValueStoreDelete(ctx, actorId).Status(status).Execute() + +Delete last run's default store + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + actorId := "janedoe~my-actor" // string | Actor ID or a tilde-separated owner's username and Actor name. + status := "SUCCEEDED" // string | Filter for the run status. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + r, err := apiClient.LastActorRunsDefaultKeyValueStoreAPI.ActRunsLastKeyValueStoreDelete(context.Background(), actorId).Status(status).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `LastActorRunsDefaultKeyValueStoreAPI.ActRunsLastKeyValueStoreDelete``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**actorId** | **string** | Actor ID or a tilde-separated owner's username and Actor name. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiActRunsLastKeyValueStoreDeleteRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **status** | **string** | Filter for the run status. | + +### Return type + + (empty response body) + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## ActRunsLastKeyValueStoreGet + +> KeyValueStoreResponse ActRunsLastKeyValueStoreGet(ctx, actorId).Status(status).Execute() + +Get last run's default store + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + actorId := "janedoe~my-actor" // string | Actor ID or a tilde-separated owner's username and Actor name. + status := "SUCCEEDED" // string | Filter for the run status. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.LastActorRunsDefaultKeyValueStoreAPI.ActRunsLastKeyValueStoreGet(context.Background(), actorId).Status(status).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `LastActorRunsDefaultKeyValueStoreAPI.ActRunsLastKeyValueStoreGet``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ActRunsLastKeyValueStoreGet`: KeyValueStoreResponse + fmt.Fprintf(os.Stdout, "Response from `LastActorRunsDefaultKeyValueStoreAPI.ActRunsLastKeyValueStoreGet`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**actorId** | **string** | Actor ID or a tilde-separated owner's username and Actor name. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiActRunsLastKeyValueStoreGetRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **status** | **string** | Filter for the run status. | + +### Return type + +[**KeyValueStoreResponse**](KeyValueStoreResponse.md) + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## ActRunsLastKeyValueStoreKeysGet + +> ListOfKeysResponse ActRunsLastKeyValueStoreKeysGet(ctx, actorId).Status(status).ExclusiveStartKey(exclusiveStartKey).Limit(limit).Collection(collection).Prefix(prefix).Signature(signature).Execute() + +Get last run's default store's list of keys + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + actorId := "janedoe~my-actor" // string | Actor ID or a tilde-separated owner's username and Actor name. + status := "SUCCEEDED" // string | Filter for the run status. (optional) + exclusiveStartKey := "Ihnsp8YrvJ8102Kj" // string | All keys up to this one (including) are skipped from the result. (optional) + limit := float32(100) // float32 | Number of keys to be returned. (optional) (default to 1000) + collection := "postImages" // string | Limit the results to keys that belong to a specific collection from the key-value store schema. The key-value store need to have a schema defined for this parameter to work. (optional) + prefix := "post-images-" // string | Limit the results to keys that start with a specific prefix. (optional) + signature := "2wTI46Bg8qWQrV7tavlPI" // string | Signature used for the access. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.LastActorRunsDefaultKeyValueStoreAPI.ActRunsLastKeyValueStoreKeysGet(context.Background(), actorId).Status(status).ExclusiveStartKey(exclusiveStartKey).Limit(limit).Collection(collection).Prefix(prefix).Signature(signature).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `LastActorRunsDefaultKeyValueStoreAPI.ActRunsLastKeyValueStoreKeysGet``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ActRunsLastKeyValueStoreKeysGet`: ListOfKeysResponse + fmt.Fprintf(os.Stdout, "Response from `LastActorRunsDefaultKeyValueStoreAPI.ActRunsLastKeyValueStoreKeysGet`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**actorId** | **string** | Actor ID or a tilde-separated owner's username and Actor name. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiActRunsLastKeyValueStoreKeysGetRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **status** | **string** | Filter for the run status. | + **exclusiveStartKey** | **string** | All keys up to this one (including) are skipped from the result. | + **limit** | **float32** | Number of keys to be returned. | [default to 1000] + **collection** | **string** | Limit the results to keys that belong to a specific collection from the key-value store schema. The key-value store need to have a schema defined for this parameter to work. | + **prefix** | **string** | Limit the results to keys that start with a specific prefix. | + **signature** | **string** | Signature used for the access. | + +### Return type + +[**ListOfKeysResponse**](ListOfKeysResponse.md) + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## ActRunsLastKeyValueStorePut + +> KeyValueStoreResponse ActRunsLastKeyValueStorePut(ctx, actorId).UpdateStoreRequest(updateStoreRequest).Status(status).Execute() + +Update last run's default store + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + actorId := "janedoe~my-actor" // string | Actor ID or a tilde-separated owner's username and Actor name. + updateStoreRequest := *openapiclient.NewUpdateStoreRequest() // UpdateStoreRequest | + status := "SUCCEEDED" // string | Filter for the run status. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.LastActorRunsDefaultKeyValueStoreAPI.ActRunsLastKeyValueStorePut(context.Background(), actorId).UpdateStoreRequest(updateStoreRequest).Status(status).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `LastActorRunsDefaultKeyValueStoreAPI.ActRunsLastKeyValueStorePut``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ActRunsLastKeyValueStorePut`: KeyValueStoreResponse + fmt.Fprintf(os.Stdout, "Response from `LastActorRunsDefaultKeyValueStoreAPI.ActRunsLastKeyValueStorePut`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**actorId** | **string** | Actor ID or a tilde-separated owner's username and Actor name. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiActRunsLastKeyValueStorePutRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **updateStoreRequest** | [**UpdateStoreRequest**](UpdateStoreRequest.md) | | + **status** | **string** | Filter for the run status. | + +### Return type + +[**KeyValueStoreResponse**](KeyValueStoreResponse.md) + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## ActRunsLastKeyValueStoreRecordDelete + +> ActRunsLastKeyValueStoreRecordDelete(ctx, actorId, recordKey).Status(status).Execute() + +Delete last run's default store's record + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + actorId := "janedoe~my-actor" // string | Actor ID or a tilde-separated owner's username and Actor name. + recordKey := "someKey" // string | Key of the record. + status := "SUCCEEDED" // string | Filter for the run status. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + r, err := apiClient.LastActorRunsDefaultKeyValueStoreAPI.ActRunsLastKeyValueStoreRecordDelete(context.Background(), actorId, recordKey).Status(status).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `LastActorRunsDefaultKeyValueStoreAPI.ActRunsLastKeyValueStoreRecordDelete``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**actorId** | **string** | Actor ID or a tilde-separated owner's username and Actor name. | +**recordKey** | **string** | Key of the record. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiActRunsLastKeyValueStoreRecordDeleteRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + **status** | **string** | Filter for the run status. | + +### Return type + + (empty response body) + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## ActRunsLastKeyValueStoreRecordGet + +> map[string]interface{} ActRunsLastKeyValueStoreRecordGet(ctx, actorId, recordKey).Status(status).Signature(signature).Attachment(attachment).Execute() + +Get last run's default store's record + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + actorId := "janedoe~my-actor" // string | Actor ID or a tilde-separated owner's username and Actor name. + recordKey := "someKey" // string | Key of the record. + status := "SUCCEEDED" // string | Filter for the run status. (optional) + signature := "2wTI46Bg8qWQrV7tavlPI" // string | Signature used for the access. (optional) + attachment := true // bool | If `true` or `1`, the response will be served with `Content-Disposition: attachment` header, causing web browsers to offer downloading HTML records instead of displaying them. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.LastActorRunsDefaultKeyValueStoreAPI.ActRunsLastKeyValueStoreRecordGet(context.Background(), actorId, recordKey).Status(status).Signature(signature).Attachment(attachment).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `LastActorRunsDefaultKeyValueStoreAPI.ActRunsLastKeyValueStoreRecordGet``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ActRunsLastKeyValueStoreRecordGet`: map[string]interface{} + fmt.Fprintf(os.Stdout, "Response from `LastActorRunsDefaultKeyValueStoreAPI.ActRunsLastKeyValueStoreRecordGet`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**actorId** | **string** | Actor ID or a tilde-separated owner's username and Actor name. | +**recordKey** | **string** | Key of the record. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiActRunsLastKeyValueStoreRecordGetRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + **status** | **string** | Filter for the run status. | + **signature** | **string** | Signature used for the access. | + **attachment** | **bool** | If `true` or `1`, the response will be served with `Content-Disposition: attachment` header, causing web browsers to offer downloading HTML records instead of displaying them. | + +### Return type + +**map[string]interface{}** + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json, */* + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## ActRunsLastKeyValueStoreRecordPost + +> map[string]interface{} ActRunsLastKeyValueStoreRecordPost(ctx, actorId, recordKey).RequestBody(requestBody).Status(status).ContentEncoding(contentEncoding).Execute() + +Store record in last run's default store (POST) + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + actorId := "janedoe~my-actor" // string | Actor ID or a tilde-separated owner's username and Actor name. + recordKey := "someKey" // string | Key of the record. + requestBody := map[string]interface{}{"key": interface{}(123)} // map[string]interface{} | + status := "SUCCEEDED" // string | Filter for the run status. (optional) + contentEncoding := "contentEncoding_example" // string | (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.LastActorRunsDefaultKeyValueStoreAPI.ActRunsLastKeyValueStoreRecordPost(context.Background(), actorId, recordKey).RequestBody(requestBody).Status(status).ContentEncoding(contentEncoding).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `LastActorRunsDefaultKeyValueStoreAPI.ActRunsLastKeyValueStoreRecordPost``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ActRunsLastKeyValueStoreRecordPost`: map[string]interface{} + fmt.Fprintf(os.Stdout, "Response from `LastActorRunsDefaultKeyValueStoreAPI.ActRunsLastKeyValueStoreRecordPost`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**actorId** | **string** | Actor ID or a tilde-separated owner's username and Actor name. | +**recordKey** | **string** | Key of the record. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiActRunsLastKeyValueStoreRecordPostRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + **requestBody** | **map[string]interface{}** | | + **status** | **string** | Filter for the run status. | + **contentEncoding** | **string** | | + +### Return type + +**map[string]interface{}** + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## ActRunsLastKeyValueStoreRecordPut + +> map[string]interface{} ActRunsLastKeyValueStoreRecordPut(ctx, actorId, recordKey).RequestBody(requestBody).Status(status).ContentEncoding(contentEncoding).Execute() + +Store record in last run's default store + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + actorId := "janedoe~my-actor" // string | Actor ID or a tilde-separated owner's username and Actor name. + recordKey := "someKey" // string | Key of the record. + requestBody := map[string]interface{}{"key": interface{}(123)} // map[string]interface{} | + status := "SUCCEEDED" // string | Filter for the run status. (optional) + contentEncoding := "contentEncoding_example" // string | (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.LastActorRunsDefaultKeyValueStoreAPI.ActRunsLastKeyValueStoreRecordPut(context.Background(), actorId, recordKey).RequestBody(requestBody).Status(status).ContentEncoding(contentEncoding).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `LastActorRunsDefaultKeyValueStoreAPI.ActRunsLastKeyValueStoreRecordPut``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ActRunsLastKeyValueStoreRecordPut`: map[string]interface{} + fmt.Fprintf(os.Stdout, "Response from `LastActorRunsDefaultKeyValueStoreAPI.ActRunsLastKeyValueStoreRecordPut`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**actorId** | **string** | Actor ID or a tilde-separated owner's username and Actor name. | +**recordKey** | **string** | Key of the record. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiActRunsLastKeyValueStoreRecordPutRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + **requestBody** | **map[string]interface{}** | | + **status** | **string** | Filter for the run status. | + **contentEncoding** | **string** | | + +### Return type + +**map[string]interface{}** + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## ActRunsLastKeyValueStoreRecordsGet + +> *os.File ActRunsLastKeyValueStoreRecordsGet(ctx, actorId).Status(status).Collection(collection).Prefix(prefix).Signature(signature).Execute() + +Download last run's default store's records + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + actorId := "janedoe~my-actor" // string | Actor ID or a tilde-separated owner's username and Actor name. + status := "SUCCEEDED" // string | Filter for the run status. (optional) + collection := "my-collection" // string | If specified, only records belonging to a specific collection from the key-value store schema. The key-value store need to have a schema defined for this parameter to work. (optional) + prefix := "my-prefix/" // string | If specified, only records whose key starts with the given prefix are included in the archive. (optional) + signature := "2wTI46Bg8qWQrV7tavlPI" // string | Signature used for the access. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.LastActorRunsDefaultKeyValueStoreAPI.ActRunsLastKeyValueStoreRecordsGet(context.Background(), actorId).Status(status).Collection(collection).Prefix(prefix).Signature(signature).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `LastActorRunsDefaultKeyValueStoreAPI.ActRunsLastKeyValueStoreRecordsGet``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ActRunsLastKeyValueStoreRecordsGet`: *os.File + fmt.Fprintf(os.Stdout, "Response from `LastActorRunsDefaultKeyValueStoreAPI.ActRunsLastKeyValueStoreRecordsGet`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**actorId** | **string** | Actor ID or a tilde-separated owner's username and Actor name. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiActRunsLastKeyValueStoreRecordsGetRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **status** | **string** | Filter for the run status. | + **collection** | **string** | If specified, only records belonging to a specific collection from the key-value store schema. The key-value store need to have a schema defined for this parameter to work. | + **prefix** | **string** | If specified, only records whose key starts with the given prefix are included in the archive. | + **signature** | **string** | Signature used for the access. | + +### Return type + +[***os.File**](*os.File.md) + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/zip, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/docs/LastActorRunsDefaultRequestQueueAPI.md b/docs/LastActorRunsDefaultRequestQueueAPI.md new file mode 100644 index 0000000..c349449 --- /dev/null +++ b/docs/LastActorRunsDefaultRequestQueueAPI.md @@ -0,0 +1,1172 @@ +# \LastActorRunsDefaultRequestQueueAPI + +All URIs are relative to *https://api.apify.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**ActRunsLastRequestQueueDelete**](LastActorRunsDefaultRequestQueueAPI.md#ActRunsLastRequestQueueDelete) | **Delete** /v2/actors/{actorId}/runs/last/request-queue | Delete last run's default request queue +[**ActRunsLastRequestQueueGet**](LastActorRunsDefaultRequestQueueAPI.md#ActRunsLastRequestQueueGet) | **Get** /v2/actors/{actorId}/runs/last/request-queue | Get last run's default request queue +[**ActRunsLastRequestQueueHeadGet**](LastActorRunsDefaultRequestQueueAPI.md#ActRunsLastRequestQueueHeadGet) | **Get** /v2/actors/{actorId}/runs/last/request-queue/head | Get last run's default request queue head +[**ActRunsLastRequestQueueHeadLockPost**](LastActorRunsDefaultRequestQueueAPI.md#ActRunsLastRequestQueueHeadLockPost) | **Post** /v2/actors/{actorId}/runs/last/request-queue/head/lock | Get and lock last run's default request queue head +[**ActRunsLastRequestQueuePut**](LastActorRunsDefaultRequestQueueAPI.md#ActRunsLastRequestQueuePut) | **Put** /v2/actors/{actorId}/runs/last/request-queue | Update last run's default request queue +[**ActRunsLastRequestQueueRequestDelete**](LastActorRunsDefaultRequestQueueAPI.md#ActRunsLastRequestQueueRequestDelete) | **Delete** /v2/actors/{actorId}/runs/last/request-queue/requests/{requestId} | Delete request from last run's default request queue +[**ActRunsLastRequestQueueRequestGet**](LastActorRunsDefaultRequestQueueAPI.md#ActRunsLastRequestQueueRequestGet) | **Get** /v2/actors/{actorId}/runs/last/request-queue/requests/{requestId} | Get request from last run's default request queue +[**ActRunsLastRequestQueueRequestLockDelete**](LastActorRunsDefaultRequestQueueAPI.md#ActRunsLastRequestQueueRequestLockDelete) | **Delete** /v2/actors/{actorId}/runs/last/request-queue/requests/{requestId}/lock | Delete lock on request in last run's default request queue +[**ActRunsLastRequestQueueRequestLockPut**](LastActorRunsDefaultRequestQueueAPI.md#ActRunsLastRequestQueueRequestLockPut) | **Put** /v2/actors/{actorId}/runs/last/request-queue/requests/{requestId}/lock | Prolong lock on request in last run's default request queue +[**ActRunsLastRequestQueueRequestPut**](LastActorRunsDefaultRequestQueueAPI.md#ActRunsLastRequestQueueRequestPut) | **Put** /v2/actors/{actorId}/runs/last/request-queue/requests/{requestId} | Update request in last run's default request queue +[**ActRunsLastRequestQueueRequestsBatchDelete**](LastActorRunsDefaultRequestQueueAPI.md#ActRunsLastRequestQueueRequestsBatchDelete) | **Delete** /v2/actors/{actorId}/runs/last/request-queue/requests/batch | Batch delete requests from last run's default request queue +[**ActRunsLastRequestQueueRequestsBatchPost**](LastActorRunsDefaultRequestQueueAPI.md#ActRunsLastRequestQueueRequestsBatchPost) | **Post** /v2/actors/{actorId}/runs/last/request-queue/requests/batch | Batch add requests to last run's default request queue +[**ActRunsLastRequestQueueRequestsGet**](LastActorRunsDefaultRequestQueueAPI.md#ActRunsLastRequestQueueRequestsGet) | **Get** /v2/actors/{actorId}/runs/last/request-queue/requests | List last run's default request queue's requests +[**ActRunsLastRequestQueueRequestsPost**](LastActorRunsDefaultRequestQueueAPI.md#ActRunsLastRequestQueueRequestsPost) | **Post** /v2/actors/{actorId}/runs/last/request-queue/requests | Add request to last run's default request queue +[**ActRunsLastRequestQueueRequestsUnlockPost**](LastActorRunsDefaultRequestQueueAPI.md#ActRunsLastRequestQueueRequestsUnlockPost) | **Post** /v2/actors/{actorId}/runs/last/request-queue/requests/unlock | Unlock requests in last run's default request queue + + + +## ActRunsLastRequestQueueDelete + +> ActRunsLastRequestQueueDelete(ctx, actorId).Status(status).Execute() + +Delete last run's default request queue + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + actorId := "janedoe~my-actor" // string | Actor ID or a tilde-separated owner's username and Actor name. + status := "SUCCEEDED" // string | Filter for the run status. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + r, err := apiClient.LastActorRunsDefaultRequestQueueAPI.ActRunsLastRequestQueueDelete(context.Background(), actorId).Status(status).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `LastActorRunsDefaultRequestQueueAPI.ActRunsLastRequestQueueDelete``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**actorId** | **string** | Actor ID or a tilde-separated owner's username and Actor name. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiActRunsLastRequestQueueDeleteRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **status** | **string** | Filter for the run status. | + +### Return type + + (empty response body) + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## ActRunsLastRequestQueueGet + +> RequestQueueResponse ActRunsLastRequestQueueGet(ctx, actorId).Status(status).Execute() + +Get last run's default request queue + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + actorId := "janedoe~my-actor" // string | Actor ID or a tilde-separated owner's username and Actor name. + status := "SUCCEEDED" // string | Filter for the run status. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.LastActorRunsDefaultRequestQueueAPI.ActRunsLastRequestQueueGet(context.Background(), actorId).Status(status).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `LastActorRunsDefaultRequestQueueAPI.ActRunsLastRequestQueueGet``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ActRunsLastRequestQueueGet`: RequestQueueResponse + fmt.Fprintf(os.Stdout, "Response from `LastActorRunsDefaultRequestQueueAPI.ActRunsLastRequestQueueGet`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**actorId** | **string** | Actor ID or a tilde-separated owner's username and Actor name. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiActRunsLastRequestQueueGetRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **status** | **string** | Filter for the run status. | + +### Return type + +[**RequestQueueResponse**](RequestQueueResponse.md) + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## ActRunsLastRequestQueueHeadGet + +> HeadResponse ActRunsLastRequestQueueHeadGet(ctx, actorId).Status(status).Limit(limit).ClientKey(clientKey).Execute() + +Get last run's default request queue head + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + actorId := "janedoe~my-actor" // string | Actor ID or a tilde-separated owner's username and Actor name. + status := "SUCCEEDED" // string | Filter for the run status. (optional) + limit := float64(100) // float64 | How many items from queue should be returned. (optional) + clientKey := "client-abc" // string | A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.LastActorRunsDefaultRequestQueueAPI.ActRunsLastRequestQueueHeadGet(context.Background(), actorId).Status(status).Limit(limit).ClientKey(clientKey).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `LastActorRunsDefaultRequestQueueAPI.ActRunsLastRequestQueueHeadGet``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ActRunsLastRequestQueueHeadGet`: HeadResponse + fmt.Fprintf(os.Stdout, "Response from `LastActorRunsDefaultRequestQueueAPI.ActRunsLastRequestQueueHeadGet`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**actorId** | **string** | Actor ID or a tilde-separated owner's username and Actor name. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiActRunsLastRequestQueueHeadGetRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **status** | **string** | Filter for the run status. | + **limit** | **float64** | How many items from queue should be returned. | + **clientKey** | **string** | A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. | + +### Return type + +[**HeadResponse**](HeadResponse.md) + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## ActRunsLastRequestQueueHeadLockPost + +> HeadAndLockResponse ActRunsLastRequestQueueHeadLockPost(ctx, actorId).LockSecs(lockSecs).Status(status).Limit(limit).ClientKey(clientKey).Execute() + +Get and lock last run's default request queue head + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + actorId := "janedoe~my-actor" // string | Actor ID or a tilde-separated owner's username and Actor name. + lockSecs := float64(60) // float64 | How long the requests will be locked for (in seconds). + status := "SUCCEEDED" // string | Filter for the run status. (optional) + limit := float64(25) // float64 | How many items from the queue should be returned. (optional) + clientKey := "client-abc" // string | A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.LastActorRunsDefaultRequestQueueAPI.ActRunsLastRequestQueueHeadLockPost(context.Background(), actorId).LockSecs(lockSecs).Status(status).Limit(limit).ClientKey(clientKey).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `LastActorRunsDefaultRequestQueueAPI.ActRunsLastRequestQueueHeadLockPost``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ActRunsLastRequestQueueHeadLockPost`: HeadAndLockResponse + fmt.Fprintf(os.Stdout, "Response from `LastActorRunsDefaultRequestQueueAPI.ActRunsLastRequestQueueHeadLockPost`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**actorId** | **string** | Actor ID or a tilde-separated owner's username and Actor name. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiActRunsLastRequestQueueHeadLockPostRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **lockSecs** | **float64** | How long the requests will be locked for (in seconds). | + **status** | **string** | Filter for the run status. | + **limit** | **float64** | How many items from the queue should be returned. | + **clientKey** | **string** | A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. | + +### Return type + +[**HeadAndLockResponse**](HeadAndLockResponse.md) + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## ActRunsLastRequestQueuePut + +> RequestQueueResponse ActRunsLastRequestQueuePut(ctx, actorId).UpdateRequestQueueRequest(updateRequestQueueRequest).Status(status).Execute() + +Update last run's default request queue + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + actorId := "janedoe~my-actor" // string | Actor ID or a tilde-separated owner's username and Actor name. + updateRequestQueueRequest := *openapiclient.NewUpdateRequestQueueRequest() // UpdateRequestQueueRequest | + status := "SUCCEEDED" // string | Filter for the run status. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.LastActorRunsDefaultRequestQueueAPI.ActRunsLastRequestQueuePut(context.Background(), actorId).UpdateRequestQueueRequest(updateRequestQueueRequest).Status(status).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `LastActorRunsDefaultRequestQueueAPI.ActRunsLastRequestQueuePut``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ActRunsLastRequestQueuePut`: RequestQueueResponse + fmt.Fprintf(os.Stdout, "Response from `LastActorRunsDefaultRequestQueueAPI.ActRunsLastRequestQueuePut`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**actorId** | **string** | Actor ID or a tilde-separated owner's username and Actor name. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiActRunsLastRequestQueuePutRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **updateRequestQueueRequest** | [**UpdateRequestQueueRequest**](UpdateRequestQueueRequest.md) | | + **status** | **string** | Filter for the run status. | + +### Return type + +[**RequestQueueResponse**](RequestQueueResponse.md) + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## ActRunsLastRequestQueueRequestDelete + +> ActRunsLastRequestQueueRequestDelete(ctx, actorId, requestId).Status(status).ClientKey(clientKey).Execute() + +Delete request from last run's default request queue + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + actorId := "janedoe~my-actor" // string | Actor ID or a tilde-separated owner's username and Actor name. + requestId := "xpsmkDlspokDSmklS" // string | Request ID. + status := "SUCCEEDED" // string | Filter for the run status. (optional) + clientKey := "client-abc" // string | A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + r, err := apiClient.LastActorRunsDefaultRequestQueueAPI.ActRunsLastRequestQueueRequestDelete(context.Background(), actorId, requestId).Status(status).ClientKey(clientKey).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `LastActorRunsDefaultRequestQueueAPI.ActRunsLastRequestQueueRequestDelete``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**actorId** | **string** | Actor ID or a tilde-separated owner's username and Actor name. | +**requestId** | **string** | Request ID. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiActRunsLastRequestQueueRequestDeleteRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + **status** | **string** | Filter for the run status. | + **clientKey** | **string** | A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. | + +### Return type + + (empty response body) + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## ActRunsLastRequestQueueRequestGet + +> RequestResponse ActRunsLastRequestQueueRequestGet(ctx, actorId, requestId).Status(status).Execute() + +Get request from last run's default request queue + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + actorId := "janedoe~my-actor" // string | Actor ID or a tilde-separated owner's username and Actor name. + requestId := "xpsmkDlspokDSmklS" // string | Request ID. + status := "SUCCEEDED" // string | Filter for the run status. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.LastActorRunsDefaultRequestQueueAPI.ActRunsLastRequestQueueRequestGet(context.Background(), actorId, requestId).Status(status).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `LastActorRunsDefaultRequestQueueAPI.ActRunsLastRequestQueueRequestGet``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ActRunsLastRequestQueueRequestGet`: RequestResponse + fmt.Fprintf(os.Stdout, "Response from `LastActorRunsDefaultRequestQueueAPI.ActRunsLastRequestQueueRequestGet`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**actorId** | **string** | Actor ID or a tilde-separated owner's username and Actor name. | +**requestId** | **string** | Request ID. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiActRunsLastRequestQueueRequestGetRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + **status** | **string** | Filter for the run status. | + +### Return type + +[**RequestResponse**](RequestResponse.md) + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## ActRunsLastRequestQueueRequestLockDelete + +> ActRunsLastRequestQueueRequestLockDelete(ctx, actorId, requestId).Status(status).ClientKey(clientKey).Forefront(forefront).Execute() + +Delete lock on request in last run's default request queue + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + actorId := "janedoe~my-actor" // string | Actor ID or a tilde-separated owner's username and Actor name. + requestId := "xpsmkDlspokDSmklS" // string | Request ID. + status := "SUCCEEDED" // string | Filter for the run status. (optional) + clientKey := "client-abc" // string | A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. (optional) + forefront := "false" // string | Determines if request should be added to the head of the queue or to the end after lock was removed. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + r, err := apiClient.LastActorRunsDefaultRequestQueueAPI.ActRunsLastRequestQueueRequestLockDelete(context.Background(), actorId, requestId).Status(status).ClientKey(clientKey).Forefront(forefront).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `LastActorRunsDefaultRequestQueueAPI.ActRunsLastRequestQueueRequestLockDelete``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**actorId** | **string** | Actor ID or a tilde-separated owner's username and Actor name. | +**requestId** | **string** | Request ID. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiActRunsLastRequestQueueRequestLockDeleteRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + **status** | **string** | Filter for the run status. | + **clientKey** | **string** | A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. | + **forefront** | **string** | Determines if request should be added to the head of the queue or to the end after lock was removed. | + +### Return type + + (empty response body) + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## ActRunsLastRequestQueueRequestLockPut + +> ProlongRequestLockResponse ActRunsLastRequestQueueRequestLockPut(ctx, actorId, requestId).LockSecs(lockSecs).Status(status).ClientKey(clientKey).Forefront(forefront).Execute() + +Prolong lock on request in last run's default request queue + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + actorId := "janedoe~my-actor" // string | Actor ID or a tilde-separated owner's username and Actor name. + requestId := "xpsmkDlspokDSmklS" // string | Request ID. + lockSecs := float64(60) // float64 | How long the requests will be locked for (in seconds). + status := "SUCCEEDED" // string | Filter for the run status. (optional) + clientKey := "client-abc" // string | A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. (optional) + forefront := "false" // string | Determines if request should be added to the head of the queue or to the end after lock expires. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.LastActorRunsDefaultRequestQueueAPI.ActRunsLastRequestQueueRequestLockPut(context.Background(), actorId, requestId).LockSecs(lockSecs).Status(status).ClientKey(clientKey).Forefront(forefront).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `LastActorRunsDefaultRequestQueueAPI.ActRunsLastRequestQueueRequestLockPut``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ActRunsLastRequestQueueRequestLockPut`: ProlongRequestLockResponse + fmt.Fprintf(os.Stdout, "Response from `LastActorRunsDefaultRequestQueueAPI.ActRunsLastRequestQueueRequestLockPut`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**actorId** | **string** | Actor ID or a tilde-separated owner's username and Actor name. | +**requestId** | **string** | Request ID. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiActRunsLastRequestQueueRequestLockPutRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + **lockSecs** | **float64** | How long the requests will be locked for (in seconds). | + **status** | **string** | Filter for the run status. | + **clientKey** | **string** | A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. | + **forefront** | **string** | Determines if request should be added to the head of the queue or to the end after lock expires. | + +### Return type + +[**ProlongRequestLockResponse**](ProlongRequestLockResponse.md) + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## ActRunsLastRequestQueueRequestPut + +> UpdateRequestResponse ActRunsLastRequestQueueRequestPut(ctx, actorId, requestId).Request(request).Status(status).Forefront(forefront).ClientKey(clientKey).Execute() + +Update request in last run's default request queue + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + actorId := "janedoe~my-actor" // string | Actor ID or a tilde-separated owner's username and Actor name. + requestId := "xpsmkDlspokDSmklS" // string | Request ID. + request := *openapiclient.NewRequest() // Request | + status := "SUCCEEDED" // string | Filter for the run status. (optional) + forefront := "false" // string | Determines if request should be added to the head of the queue or to the end. Default value is `false` (end of queue). (optional) + clientKey := "client-abc" // string | A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.LastActorRunsDefaultRequestQueueAPI.ActRunsLastRequestQueueRequestPut(context.Background(), actorId, requestId).Request(request).Status(status).Forefront(forefront).ClientKey(clientKey).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `LastActorRunsDefaultRequestQueueAPI.ActRunsLastRequestQueueRequestPut``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ActRunsLastRequestQueueRequestPut`: UpdateRequestResponse + fmt.Fprintf(os.Stdout, "Response from `LastActorRunsDefaultRequestQueueAPI.ActRunsLastRequestQueueRequestPut`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**actorId** | **string** | Actor ID or a tilde-separated owner's username and Actor name. | +**requestId** | **string** | Request ID. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiActRunsLastRequestQueueRequestPutRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + **request** | [**Request**](Request.md) | | + **status** | **string** | Filter for the run status. | + **forefront** | **string** | Determines if request should be added to the head of the queue or to the end. Default value is `false` (end of queue). | + **clientKey** | **string** | A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. | + +### Return type + +[**UpdateRequestResponse**](UpdateRequestResponse.md) + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## ActRunsLastRequestQueueRequestsBatchDelete + +> BatchDeleteResponse ActRunsLastRequestQueueRequestsBatchDelete(ctx, actorId).ContentType(contentType).RequestDraftDelete(requestDraftDelete).Status(status).ClientKey(clientKey).Execute() + +Batch delete requests from last run's default request queue + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + actorId := "janedoe~my-actor" // string | Actor ID or a tilde-separated owner's username and Actor name. + contentType := "contentType_example" // string | + requestDraftDelete := []openapiclient.RequestDraftDelete{*openapiclient.NewRequestDraftDelete("Id_example", "UniqueKey_example")} // []RequestDraftDelete | + status := "SUCCEEDED" // string | Filter for the run status. (optional) + clientKey := "client-abc" // string | A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.LastActorRunsDefaultRequestQueueAPI.ActRunsLastRequestQueueRequestsBatchDelete(context.Background(), actorId).ContentType(contentType).RequestDraftDelete(requestDraftDelete).Status(status).ClientKey(clientKey).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `LastActorRunsDefaultRequestQueueAPI.ActRunsLastRequestQueueRequestsBatchDelete``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ActRunsLastRequestQueueRequestsBatchDelete`: BatchDeleteResponse + fmt.Fprintf(os.Stdout, "Response from `LastActorRunsDefaultRequestQueueAPI.ActRunsLastRequestQueueRequestsBatchDelete`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**actorId** | **string** | Actor ID or a tilde-separated owner's username and Actor name. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiActRunsLastRequestQueueRequestsBatchDeleteRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **contentType** | **string** | | + **requestDraftDelete** | [**[]RequestDraftDelete**](RequestDraftDelete.md) | | + **status** | **string** | Filter for the run status. | + **clientKey** | **string** | A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. | + +### Return type + +[**BatchDeleteResponse**](BatchDeleteResponse.md) + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## ActRunsLastRequestQueueRequestsBatchPost + +> BatchAddResponse ActRunsLastRequestQueueRequestsBatchPost(ctx, actorId).RequestBase(requestBase).Status(status).ClientKey(clientKey).Forefront(forefront).Execute() + +Batch add requests to last run's default request queue + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + actorId := "janedoe~my-actor" // string | Actor ID or a tilde-separated owner's username and Actor name. + requestBase := []openapiclient.RequestBase{*openapiclient.NewRequestBase()} // []RequestBase | + status := "SUCCEEDED" // string | Filter for the run status. (optional) + clientKey := "client-abc" // string | A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. (optional) + forefront := "false" // string | Determines if request should be added to the head of the queue or to the end. Default value is `false` (end of queue). (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.LastActorRunsDefaultRequestQueueAPI.ActRunsLastRequestQueueRequestsBatchPost(context.Background(), actorId).RequestBase(requestBase).Status(status).ClientKey(clientKey).Forefront(forefront).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `LastActorRunsDefaultRequestQueueAPI.ActRunsLastRequestQueueRequestsBatchPost``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ActRunsLastRequestQueueRequestsBatchPost`: BatchAddResponse + fmt.Fprintf(os.Stdout, "Response from `LastActorRunsDefaultRequestQueueAPI.ActRunsLastRequestQueueRequestsBatchPost`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**actorId** | **string** | Actor ID or a tilde-separated owner's username and Actor name. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiActRunsLastRequestQueueRequestsBatchPostRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **requestBase** | [**[]RequestBase**](RequestBase.md) | | + **status** | **string** | Filter for the run status. | + **clientKey** | **string** | A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. | + **forefront** | **string** | Determines if request should be added to the head of the queue or to the end. Default value is `false` (end of queue). | + +### Return type + +[**BatchAddResponse**](BatchAddResponse.md) + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## ActRunsLastRequestQueueRequestsGet + +> ListOfRequestsResponse ActRunsLastRequestQueueRequestsGet(ctx, actorId).Status(status).ClientKey(clientKey).ExclusiveStartId(exclusiveStartId).Limit(limit).Cursor(cursor).Filter(filter).Execute() + +List last run's default request queue's requests + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + actorId := "janedoe~my-actor" // string | Actor ID or a tilde-separated owner's username and Actor name. + status := "SUCCEEDED" // string | Filter for the run status. (optional) + clientKey := "client-abc" // string | A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. (optional) + exclusiveStartId := "Ihnsp8YrvJ8102Kj" // string | All requests up to this one (including) are skipped from the result. (Deprecated, use `cursor` instead.) (optional) + limit := float64(100) // float64 | Number of keys to be returned. Maximum value is `10000`. (optional) + cursor := "eyJyZXF1ZXN0SWQiOiI2OFRqQ2RaTDNvM2hiUU0ifQ" // string | A cursor string for pagination, returned in the previous response as `nextCursor`. Use this to retrieve the next page of requests. (optional) + filter := []string{"Filter_example"} // []string | Filter requests by their state. Possible values are `locked` and `pending`. You can combine multiple values separated by commas, which will mean the union of these filters – requests matching any of the specified states will be returned. (Not compatible with deprecated `exclusiveStartId` parameter.) (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.LastActorRunsDefaultRequestQueueAPI.ActRunsLastRequestQueueRequestsGet(context.Background(), actorId).Status(status).ClientKey(clientKey).ExclusiveStartId(exclusiveStartId).Limit(limit).Cursor(cursor).Filter(filter).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `LastActorRunsDefaultRequestQueueAPI.ActRunsLastRequestQueueRequestsGet``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ActRunsLastRequestQueueRequestsGet`: ListOfRequestsResponse + fmt.Fprintf(os.Stdout, "Response from `LastActorRunsDefaultRequestQueueAPI.ActRunsLastRequestQueueRequestsGet`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**actorId** | **string** | Actor ID or a tilde-separated owner's username and Actor name. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiActRunsLastRequestQueueRequestsGetRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **status** | **string** | Filter for the run status. | + **clientKey** | **string** | A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. | + **exclusiveStartId** | **string** | All requests up to this one (including) are skipped from the result. (Deprecated, use `cursor` instead.) | + **limit** | **float64** | Number of keys to be returned. Maximum value is `10000`. | + **cursor** | **string** | A cursor string for pagination, returned in the previous response as `nextCursor`. Use this to retrieve the next page of requests. | + **filter** | **[]string** | Filter requests by their state. Possible values are `locked` and `pending`. You can combine multiple values separated by commas, which will mean the union of these filters – requests matching any of the specified states will be returned. (Not compatible with deprecated `exclusiveStartId` parameter.) | + +### Return type + +[**ListOfRequestsResponse**](ListOfRequestsResponse.md) + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## ActRunsLastRequestQueueRequestsPost + +> AddRequestResponse ActRunsLastRequestQueueRequestsPost(ctx, actorId).RequestBase(requestBase).Status(status).ClientKey(clientKey).Forefront(forefront).Execute() + +Add request to last run's default request queue + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + actorId := "janedoe~my-actor" // string | Actor ID or a tilde-separated owner's username and Actor name. + requestBase := *openapiclient.NewRequestBase() // RequestBase | + status := "SUCCEEDED" // string | Filter for the run status. (optional) + clientKey := "client-abc" // string | A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. (optional) + forefront := "false" // string | Determines if request should be added to the head of the queue or to the end. Default value is `false` (end of queue). (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.LastActorRunsDefaultRequestQueueAPI.ActRunsLastRequestQueueRequestsPost(context.Background(), actorId).RequestBase(requestBase).Status(status).ClientKey(clientKey).Forefront(forefront).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `LastActorRunsDefaultRequestQueueAPI.ActRunsLastRequestQueueRequestsPost``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ActRunsLastRequestQueueRequestsPost`: AddRequestResponse + fmt.Fprintf(os.Stdout, "Response from `LastActorRunsDefaultRequestQueueAPI.ActRunsLastRequestQueueRequestsPost`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**actorId** | **string** | Actor ID or a tilde-separated owner's username and Actor name. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiActRunsLastRequestQueueRequestsPostRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **requestBase** | [**RequestBase**](RequestBase.md) | | + **status** | **string** | Filter for the run status. | + **clientKey** | **string** | A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. | + **forefront** | **string** | Determines if request should be added to the head of the queue or to the end. Default value is `false` (end of queue). | + +### Return type + +[**AddRequestResponse**](AddRequestResponse.md) + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## ActRunsLastRequestQueueRequestsUnlockPost + +> UnlockRequestsResponse ActRunsLastRequestQueueRequestsUnlockPost(ctx, actorId).Status(status).ClientKey(clientKey).Execute() + +Unlock requests in last run's default request queue + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + actorId := "janedoe~my-actor" // string | Actor ID or a tilde-separated owner's username and Actor name. + status := "SUCCEEDED" // string | Filter for the run status. (optional) + clientKey := "client-abc" // string | A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.LastActorRunsDefaultRequestQueueAPI.ActRunsLastRequestQueueRequestsUnlockPost(context.Background(), actorId).Status(status).ClientKey(clientKey).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `LastActorRunsDefaultRequestQueueAPI.ActRunsLastRequestQueueRequestsUnlockPost``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ActRunsLastRequestQueueRequestsUnlockPost`: UnlockRequestsResponse + fmt.Fprintf(os.Stdout, "Response from `LastActorRunsDefaultRequestQueueAPI.ActRunsLastRequestQueueRequestsUnlockPost`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**actorId** | **string** | Actor ID or a tilde-separated owner's username and Actor name. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiActRunsLastRequestQueueRequestsUnlockPostRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **status** | **string** | Filter for the run status. | + **clientKey** | **string** | A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. | + +### Return type + +[**UnlockRequestsResponse**](UnlockRequestsResponse.md) + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/docs/LastActorRunsLogAPI.md b/docs/LastActorRunsLogAPI.md new file mode 100644 index 0000000..471da0d --- /dev/null +++ b/docs/LastActorRunsLogAPI.md @@ -0,0 +1,85 @@ +# \LastActorRunsLogAPI + +All URIs are relative to *https://api.apify.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**ActRunsLastLogGet**](LastActorRunsLogAPI.md#ActRunsLastLogGet) | **Get** /v2/actors/{actorId}/runs/last/log | Get last Actor run's log + + + +## ActRunsLastLogGet + +> string ActRunsLastLogGet(ctx, actorId).Stream(stream).Download(download).Raw(raw).Execute() + +Get last Actor run's log + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + actorId := "janedoe~my-actor" // string | Actor ID or a tilde-separated owner's username and Actor name. + stream := false // bool | If `true` or `1` then the logs will be streamed as long as the run or build is running. (optional) + download := false // bool | If `true` or `1` then the web browser will download the log file rather than open it in a tab. (optional) + raw := false // bool | If `true` or `1`, the logs will be kept verbatim. By default, the API removes ANSI escape codes from the logs, keeping only printable characters. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.LastActorRunsLogAPI.ActRunsLastLogGet(context.Background(), actorId).Stream(stream).Download(download).Raw(raw).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `LastActorRunsLogAPI.ActRunsLastLogGet``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ActRunsLastLogGet`: string + fmt.Fprintf(os.Stdout, "Response from `LastActorRunsLogAPI.ActRunsLastLogGet`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**actorId** | **string** | Actor ID or a tilde-separated owner's username and Actor name. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiActRunsLastLogGetRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **stream** | **bool** | If `true` or `1` then the logs will be streamed as long as the run or build is running. | + **download** | **bool** | If `true` or `1` then the web browser will download the log file rather than open it in a tab. | + **raw** | **bool** | If `true` or `1`, the logs will be kept verbatim. By default, the API removes ANSI escape codes from the logs, keeping only printable characters. | + +### Return type + +**string** + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: text/plain, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/docs/LastActorRunsMetamorphAPI.md b/docs/LastActorRunsMetamorphAPI.md new file mode 100644 index 0000000..4c7987c --- /dev/null +++ b/docs/LastActorRunsMetamorphAPI.md @@ -0,0 +1,85 @@ +# \LastActorRunsMetamorphAPI + +All URIs are relative to *https://api.apify.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**ActRunsLastMetamorphPost**](LastActorRunsMetamorphAPI.md#ActRunsLastMetamorphPost) | **Post** /v2/actors/{actorId}/runs/last/metamorph | Metamorph Actor's last run + + + +## ActRunsLastMetamorphPost + +> RunResponse ActRunsLastMetamorphPost(ctx, actorId).TargetActorId(targetActorId).Status(status).Build(build).Execute() + +Metamorph Actor's last run + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + actorId := "janedoe~my-actor" // string | Actor ID or a tilde-separated owner's username and Actor name. + targetActorId := "HDSasDasz78YcAPEB" // string | ID of a target Actor that the run should be transformed into. + status := "SUCCEEDED" // string | Filter for the run status. (optional) + build := "beta" // string | Optional build of the target Actor. It can be either a build tag or build number. By default, the run uses the build specified in the default run configuration for the target Actor (typically `latest`). (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.LastActorRunsMetamorphAPI.ActRunsLastMetamorphPost(context.Background(), actorId).TargetActorId(targetActorId).Status(status).Build(build).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `LastActorRunsMetamorphAPI.ActRunsLastMetamorphPost``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ActRunsLastMetamorphPost`: RunResponse + fmt.Fprintf(os.Stdout, "Response from `LastActorRunsMetamorphAPI.ActRunsLastMetamorphPost`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**actorId** | **string** | Actor ID or a tilde-separated owner's username and Actor name. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiActRunsLastMetamorphPostRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **targetActorId** | **string** | ID of a target Actor that the run should be transformed into. | + **status** | **string** | Filter for the run status. | + **build** | **string** | Optional build of the target Actor. It can be either a build tag or build number. By default, the run uses the build specified in the default run configuration for the target Actor (typically `latest`). | + +### Return type + +[**RunResponse**](RunResponse.md) + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/docs/LastActorRunsRebootAPI.md b/docs/LastActorRunsRebootAPI.md new file mode 100644 index 0000000..d2201ff --- /dev/null +++ b/docs/LastActorRunsRebootAPI.md @@ -0,0 +1,81 @@ +# \LastActorRunsRebootAPI + +All URIs are relative to *https://api.apify.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**ActRunsLastRebootPost**](LastActorRunsRebootAPI.md#ActRunsLastRebootPost) | **Post** /v2/actors/{actorId}/runs/last/reboot | Reboot Actor's last run + + + +## ActRunsLastRebootPost + +> RunResponse ActRunsLastRebootPost(ctx, actorId).Status(status).Execute() + +Reboot Actor's last run + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + actorId := "janedoe~my-actor" // string | Actor ID or a tilde-separated owner's username and Actor name. + status := "SUCCEEDED" // string | Filter for the run status. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.LastActorRunsRebootAPI.ActRunsLastRebootPost(context.Background(), actorId).Status(status).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `LastActorRunsRebootAPI.ActRunsLastRebootPost``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ActRunsLastRebootPost`: RunResponse + fmt.Fprintf(os.Stdout, "Response from `LastActorRunsRebootAPI.ActRunsLastRebootPost`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**actorId** | **string** | Actor ID or a tilde-separated owner's username and Actor name. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiActRunsLastRebootPostRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **status** | **string** | Filter for the run status. | + +### Return type + +[**RunResponse**](RunResponse.md) + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/docs/LastActorTaskRunsAbortAPI.md b/docs/LastActorTaskRunsAbortAPI.md new file mode 100644 index 0000000..f9e9eee --- /dev/null +++ b/docs/LastActorTaskRunsAbortAPI.md @@ -0,0 +1,83 @@ +# \LastActorTaskRunsAbortAPI + +All URIs are relative to *https://api.apify.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**ActorTaskRunsLastAbortPost**](LastActorTaskRunsAbortAPI.md#ActorTaskRunsLastAbortPost) | **Post** /v2/actor-tasks/{actorTaskId}/runs/last/abort | Abort Actor task's last run + + + +## ActorTaskRunsLastAbortPost + +> RunResponse ActorTaskRunsLastAbortPost(ctx, actorTaskId).Status(status).Gracefully(gracefully).Execute() + +Abort Actor task's last run + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + actorTaskId := "janedoe~my-task" // string | Task ID or a tilde-separated owner's username and task's name. + status := "SUCCEEDED" // string | Filter for the run status. (optional) + gracefully := true // bool | If true passed, the Actor run will abort gracefully. It will send `aborting` and `persistState` event into run and force-stop the run after 30 seconds. It is helpful in cases where you plan to resurrect the run later. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.LastActorTaskRunsAbortAPI.ActorTaskRunsLastAbortPost(context.Background(), actorTaskId).Status(status).Gracefully(gracefully).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `LastActorTaskRunsAbortAPI.ActorTaskRunsLastAbortPost``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ActorTaskRunsLastAbortPost`: RunResponse + fmt.Fprintf(os.Stdout, "Response from `LastActorTaskRunsAbortAPI.ActorTaskRunsLastAbortPost`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**actorTaskId** | **string** | Task ID or a tilde-separated owner's username and task's name. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiActorTaskRunsLastAbortPostRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **status** | **string** | Filter for the run status. | + **gracefully** | **bool** | If true passed, the Actor run will abort gracefully. It will send `aborting` and `persistState` event into run and force-stop the run after 30 seconds. It is helpful in cases where you plan to resurrect the run later. | + +### Return type + +[**RunResponse**](RunResponse.md) + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/docs/LastActorTaskRunsDefaultDatasetAPI.md b/docs/LastActorTaskRunsDefaultDatasetAPI.md new file mode 100644 index 0000000..b2bbff0 --- /dev/null +++ b/docs/LastActorTaskRunsDefaultDatasetAPI.md @@ -0,0 +1,496 @@ +# \LastActorTaskRunsDefaultDatasetAPI + +All URIs are relative to *https://api.apify.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**ActorTaskRunsLastDatasetDelete**](LastActorTaskRunsDefaultDatasetAPI.md#ActorTaskRunsLastDatasetDelete) | **Delete** /v2/actor-tasks/{actorTaskId}/runs/last/dataset | Delete last task run's default dataset +[**ActorTaskRunsLastDatasetGet**](LastActorTaskRunsDefaultDatasetAPI.md#ActorTaskRunsLastDatasetGet) | **Get** /v2/actor-tasks/{actorTaskId}/runs/last/dataset | Get last task run's default dataset +[**ActorTaskRunsLastDatasetItemsGet**](LastActorTaskRunsDefaultDatasetAPI.md#ActorTaskRunsLastDatasetItemsGet) | **Get** /v2/actor-tasks/{actorTaskId}/runs/last/dataset/items | Get last task run's dataset items +[**ActorTaskRunsLastDatasetItemsPost**](LastActorTaskRunsDefaultDatasetAPI.md#ActorTaskRunsLastDatasetItemsPost) | **Post** /v2/actor-tasks/{actorTaskId}/runs/last/dataset/items | Store items in last task run's dataset +[**ActorTaskRunsLastDatasetPut**](LastActorTaskRunsDefaultDatasetAPI.md#ActorTaskRunsLastDatasetPut) | **Put** /v2/actor-tasks/{actorTaskId}/runs/last/dataset | Update last task run's default dataset +[**ActorTaskRunsLastDatasetStatisticsGet**](LastActorTaskRunsDefaultDatasetAPI.md#ActorTaskRunsLastDatasetStatisticsGet) | **Get** /v2/actor-tasks/{actorTaskId}/runs/last/dataset/statistics | Get last task run's dataset statistics + + + +## ActorTaskRunsLastDatasetDelete + +> ActorTaskRunsLastDatasetDelete(ctx, actorTaskId).Status(status).Execute() + +Delete last task run's default dataset + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + actorTaskId := "janedoe~my-task" // string | Task ID or a tilde-separated owner's username and task's name. + status := "SUCCEEDED" // string | Filter for the run status. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + r, err := apiClient.LastActorTaskRunsDefaultDatasetAPI.ActorTaskRunsLastDatasetDelete(context.Background(), actorTaskId).Status(status).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `LastActorTaskRunsDefaultDatasetAPI.ActorTaskRunsLastDatasetDelete``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**actorTaskId** | **string** | Task ID or a tilde-separated owner's username and task's name. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiActorTaskRunsLastDatasetDeleteRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **status** | **string** | Filter for the run status. | + +### Return type + + (empty response body) + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## ActorTaskRunsLastDatasetGet + +> DatasetResponse ActorTaskRunsLastDatasetGet(ctx, actorTaskId).Status(status).Execute() + +Get last task run's default dataset + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + actorTaskId := "janedoe~my-task" // string | Task ID or a tilde-separated owner's username and task's name. + status := "SUCCEEDED" // string | Filter for the run status. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.LastActorTaskRunsDefaultDatasetAPI.ActorTaskRunsLastDatasetGet(context.Background(), actorTaskId).Status(status).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `LastActorTaskRunsDefaultDatasetAPI.ActorTaskRunsLastDatasetGet``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ActorTaskRunsLastDatasetGet`: DatasetResponse + fmt.Fprintf(os.Stdout, "Response from `LastActorTaskRunsDefaultDatasetAPI.ActorTaskRunsLastDatasetGet`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**actorTaskId** | **string** | Task ID or a tilde-separated owner's username and task's name. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiActorTaskRunsLastDatasetGetRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **status** | **string** | Filter for the run status. | + +### Return type + +[**DatasetResponse**](DatasetResponse.md) + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## ActorTaskRunsLastDatasetItemsGet + +> []map[string]interface{} ActorTaskRunsLastDatasetItemsGet(ctx, actorTaskId).Status(status).Format(format).Clean(clean).Offset(offset).Limit(limit).Fields(fields).OutputFields(outputFields).Omit(omit).Unwind(unwind).Flatten(flatten).Desc(desc).Attachment(attachment).Delimiter(delimiter).Bom(bom).XmlRoot(xmlRoot).XmlRow(xmlRow).SkipHeaderRow(skipHeaderRow).SkipHidden(skipHidden).SkipEmpty(skipEmpty).Simplified(simplified).View(view).SkipFailedPages(skipFailedPages).FeedTitle(feedTitle).FeedDescription(feedDescription).Signature(signature).Execute() + +Get last task run's dataset items + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + actorTaskId := "janedoe~my-task" // string | Task ID or a tilde-separated owner's username and task's name. + status := "SUCCEEDED" // string | Filter for the run status. (optional) + format := "json" // string | Format of the results, possible values are: `json`, `jsonl`, `csv`, `html`, `xlsx`, `xml` and `rss`. The default value is `json`. (optional) + clean := false // bool | If `true` or `1` then the API endpoint returns only non-empty items and skips hidden fields (i.e. fields starting with the # character). The `clean` parameter is just a shortcut for `skipHidden=true` and `skipEmpty=true` parameters. Note that since some objects might be skipped from the output, that the result might contain less items than the `limit` value. (optional) + offset := float64(0) // float64 | Number of items that should be skipped at the start. The default value is `0`. (optional) + limit := float64(1.2) // float64 | Maximum number of items to return. By default there is no limit. (optional) + fields := "myValue,myOtherValue" // string | A comma-separated list of fields which should be picked from the items, only these fields will remain in the resulting record objects. Note that the fields in the outputted items are sorted the same way as they are specified in the `fields` query parameter. You can use this feature to effectively fix the output format. (optional) + outputFields := "title,link" // string | A comma-separated list of output field names that positionally rename the fields specified in the `fields` parameter. For example, `?fields=headline,url&outputFields=title,link` renames `headline` to `title` and `url` to `link` in the output. The number of names in `outputFields` must match the number of names in `fields`. Requires the `fields` parameter to be specified as well. (optional) + omit := "myValue,myOtherValue" // string | A comma-separated list of fields which should be omitted from the items. (optional) + unwind := "myValue,myOtherValue" // string | A comma-separated list of fields which should be unwound, in order which they should be processed. Each field should be either an array or an object. If the field is an array then every element of the array will become a separate record and merged with parent object. If the unwound field is an object then it is merged with the parent object. If the unwound field is missing or its value is neither an array nor an object and therefore cannot be merged with a parent object then the item gets preserved as it is. Note that the unwound items ignore the `desc` parameter. (optional) + flatten := "myValue" // string | A comma-separated list of fields which should transform nested objects into flat structures. For example, with `flatten=\"foo\"` the object `{\"foo\":{\"bar\": \"hello\"}}` is turned into `{\"foo.bar\": \"hello\"}`. The original object with properties is replaced with the flattened object. (optional) + desc := true // bool | By default, results are returned in the same order as they were stored. To reverse the order, set this parameter to `true` or `1`. (optional) + attachment := true // bool | If `true` or `1` then the response will define the `Content-Disposition: attachment` header, forcing a web browser to download the file rather than to display it. By default this header is not present. (optional) + delimiter := ";" // string | A delimiter character for CSV files, only used if `format=csv`. You might need to URL-encode the character (e.g. use `%09` for tab or `%3B` for semicolon). The default delimiter is a simple comma (`,`). (optional) + bom := false // bool | All text responses are encoded in UTF-8 encoding. By default, the `format=csv` files are prefixed with the UTF-8 Byte Order Mark (BOM), while `json`, `jsonl`, `xml`, `html` and `rss` files are not. If you want to override this default behavior, specify `bom=1` query parameter to include the BOM or `bom=0` to skip it. (optional) + xmlRoot := "items" // string | Overrides default root element name of `xml` output. By default the root element is `items`. (optional) + xmlRow := "item" // string | Overrides default element name that wraps each page or page function result object in `xml` output. By default the element name is `item`. (optional) + skipHeaderRow := true // bool | If `true` or `1` then header row in the `csv` format is skipped. (optional) + skipHidden := false // bool | If `true` or `1` then hidden fields are skipped from the output, i.e. fields starting with the `#` character. (optional) + skipEmpty := false // bool | If `true` or `1` then empty items are skipped from the output. Note that if used, the results might contain less items than the limit value. (optional) + simplified := false // bool | If `true` or `1` then, the endpoint applies the `fields=url,pageFunctionResult,errorInfo` and `unwind=pageFunctionResult` query parameters. This feature is used to emulate simplified results provided by the legacy Apify Crawler product and it's not recommended to use it in new integrations. (optional) + view := "overview" // string | Defines the view configuration for dataset items based on the schema definition. This parameter determines how the data will be filtered and presented. For complete specification details, see the [dataset schema documentation](/platform/actors/development/actor-definition/dataset-schema). (optional) + skipFailedPages := false // bool | If `true` or `1` then, the all the items with errorInfo property will be skipped from the output. This feature is here to emulate functionality of API version 1 used for the legacy Apify Crawler product and it's not recommended to use it in new integrations. (optional) + feedTitle := "Latest posts from r/pasta" // string | Overrides the auto-generated RSS channel `<title>` element. Only used when `format=rss`. If not provided, the title defaults to `Dataset <label>`. (optional) + feedDescription := "Scraped forum posts" // string | Overrides the auto-generated RSS channel `<description>` element. Only used when `format=rss`. If not provided, the description defaults to `Items in dataset with id \"<datasetId>\".` (optional) + signature := "2wTI46Bg8qWQrV7tavlPI" // string | Signature used for the access. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.LastActorTaskRunsDefaultDatasetAPI.ActorTaskRunsLastDatasetItemsGet(context.Background(), actorTaskId).Status(status).Format(format).Clean(clean).Offset(offset).Limit(limit).Fields(fields).OutputFields(outputFields).Omit(omit).Unwind(unwind).Flatten(flatten).Desc(desc).Attachment(attachment).Delimiter(delimiter).Bom(bom).XmlRoot(xmlRoot).XmlRow(xmlRow).SkipHeaderRow(skipHeaderRow).SkipHidden(skipHidden).SkipEmpty(skipEmpty).Simplified(simplified).View(view).SkipFailedPages(skipFailedPages).FeedTitle(feedTitle).FeedDescription(feedDescription).Signature(signature).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `LastActorTaskRunsDefaultDatasetAPI.ActorTaskRunsLastDatasetItemsGet``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ActorTaskRunsLastDatasetItemsGet`: []map[string]interface{} + fmt.Fprintf(os.Stdout, "Response from `LastActorTaskRunsDefaultDatasetAPI.ActorTaskRunsLastDatasetItemsGet`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**actorTaskId** | **string** | Task ID or a tilde-separated owner's username and task's name. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiActorTaskRunsLastDatasetItemsGetRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **status** | **string** | Filter for the run status. | + **format** | **string** | Format of the results, possible values are: `json`, `jsonl`, `csv`, `html`, `xlsx`, `xml` and `rss`. The default value is `json`. | + **clean** | **bool** | If `true` or `1` then the API endpoint returns only non-empty items and skips hidden fields (i.e. fields starting with the # character). The `clean` parameter is just a shortcut for `skipHidden=true` and `skipEmpty=true` parameters. Note that since some objects might be skipped from the output, that the result might contain less items than the `limit` value. | + **offset** | **float64** | Number of items that should be skipped at the start. The default value is `0`. | + **limit** | **float64** | Maximum number of items to return. By default there is no limit. | + **fields** | **string** | A comma-separated list of fields which should be picked from the items, only these fields will remain in the resulting record objects. Note that the fields in the outputted items are sorted the same way as they are specified in the `fields` query parameter. You can use this feature to effectively fix the output format. | + **outputFields** | **string** | A comma-separated list of output field names that positionally rename the fields specified in the `fields` parameter. For example, `?fields=headline,url&outputFields=title,link` renames `headline` to `title` and `url` to `link` in the output. The number of names in `outputFields` must match the number of names in `fields`. Requires the `fields` parameter to be specified as well. | + **omit** | **string** | A comma-separated list of fields which should be omitted from the items. | + **unwind** | **string** | A comma-separated list of fields which should be unwound, in order which they should be processed. Each field should be either an array or an object. If the field is an array then every element of the array will become a separate record and merged with parent object. If the unwound field is an object then it is merged with the parent object. If the unwound field is missing or its value is neither an array nor an object and therefore cannot be merged with a parent object then the item gets preserved as it is. Note that the unwound items ignore the `desc` parameter. | + **flatten** | **string** | A comma-separated list of fields which should transform nested objects into flat structures. For example, with `flatten=\"foo\"` the object `{\"foo\":{\"bar\": \"hello\"}}` is turned into `{\"foo.bar\": \"hello\"}`. The original object with properties is replaced with the flattened object. | + **desc** | **bool** | By default, results are returned in the same order as they were stored. To reverse the order, set this parameter to `true` or `1`. | + **attachment** | **bool** | If `true` or `1` then the response will define the `Content-Disposition: attachment` header, forcing a web browser to download the file rather than to display it. By default this header is not present. | + **delimiter** | **string** | A delimiter character for CSV files, only used if `format=csv`. You might need to URL-encode the character (e.g. use `%09` for tab or `%3B` for semicolon). The default delimiter is a simple comma (`,`). | + **bom** | **bool** | All text responses are encoded in UTF-8 encoding. By default, the `format=csv` files are prefixed with the UTF-8 Byte Order Mark (BOM), while `json`, `jsonl`, `xml`, `html` and `rss` files are not. If you want to override this default behavior, specify `bom=1` query parameter to include the BOM or `bom=0` to skip it. | + **xmlRoot** | **string** | Overrides default root element name of `xml` output. By default the root element is `items`. | + **xmlRow** | **string** | Overrides default element name that wraps each page or page function result object in `xml` output. By default the element name is `item`. | + **skipHeaderRow** | **bool** | If `true` or `1` then header row in the `csv` format is skipped. | + **skipHidden** | **bool** | If `true` or `1` then hidden fields are skipped from the output, i.e. fields starting with the `#` character. | + **skipEmpty** | **bool** | If `true` or `1` then empty items are skipped from the output. Note that if used, the results might contain less items than the limit value. | + **simplified** | **bool** | If `true` or `1` then, the endpoint applies the `fields=url,pageFunctionResult,errorInfo` and `unwind=pageFunctionResult` query parameters. This feature is used to emulate simplified results provided by the legacy Apify Crawler product and it's not recommended to use it in new integrations. | + **view** | **string** | Defines the view configuration for dataset items based on the schema definition. This parameter determines how the data will be filtered and presented. For complete specification details, see the [dataset schema documentation](/platform/actors/development/actor-definition/dataset-schema). | + **skipFailedPages** | **bool** | If `true` or `1` then, the all the items with errorInfo property will be skipped from the output. This feature is here to emulate functionality of API version 1 used for the legacy Apify Crawler product and it's not recommended to use it in new integrations. | + **feedTitle** | **string** | Overrides the auto-generated RSS channel `<title>` element. Only used when `format=rss`. If not provided, the title defaults to `Dataset <label>`. | + **feedDescription** | **string** | Overrides the auto-generated RSS channel `<description>` element. Only used when `format=rss`. If not provided, the description defaults to `Items in dataset with id \"<datasetId>\".` | + **signature** | **string** | Signature used for the access. | + +### Return type + +**[]map[string]interface{}** + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json, application/jsonl, text/csv, text/html, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/rss+xml, application/xml + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## ActorTaskRunsLastDatasetItemsPost + +> map[string]interface{} ActorTaskRunsLastDatasetItemsPost(ctx, actorTaskId).ActRunsLastDatasetItemsPostRequest(actRunsLastDatasetItemsPostRequest).Status(status).Execute() + +Store items in last task run's dataset + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + actorTaskId := "janedoe~my-task" // string | Task ID or a tilde-separated owner's username and task's name. + actRunsLastDatasetItemsPostRequest := openapiclient.act_runs_last_dataset_items_post_request{ArrayOfMapmapOfStringAny: new([]map[string]interface{})} // ActRunsLastDatasetItemsPostRequest | + status := "SUCCEEDED" // string | Filter for the run status. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.LastActorTaskRunsDefaultDatasetAPI.ActorTaskRunsLastDatasetItemsPost(context.Background(), actorTaskId).ActRunsLastDatasetItemsPostRequest(actRunsLastDatasetItemsPostRequest).Status(status).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `LastActorTaskRunsDefaultDatasetAPI.ActorTaskRunsLastDatasetItemsPost``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ActorTaskRunsLastDatasetItemsPost`: map[string]interface{} + fmt.Fprintf(os.Stdout, "Response from `LastActorTaskRunsDefaultDatasetAPI.ActorTaskRunsLastDatasetItemsPost`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**actorTaskId** | **string** | Task ID or a tilde-separated owner's username and task's name. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiActorTaskRunsLastDatasetItemsPostRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **actRunsLastDatasetItemsPostRequest** | [**ActRunsLastDatasetItemsPostRequest**](ActRunsLastDatasetItemsPostRequest.md) | | + **status** | **string** | Filter for the run status. | + +### Return type + +**map[string]interface{}** + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## ActorTaskRunsLastDatasetPut + +> DatasetResponse ActorTaskRunsLastDatasetPut(ctx, actorTaskId).UpdateDatasetRequest(updateDatasetRequest).Status(status).Execute() + +Update last task run's default dataset + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + actorTaskId := "janedoe~my-task" // string | Task ID or a tilde-separated owner's username and task's name. + updateDatasetRequest := *openapiclient.NewUpdateDatasetRequest() // UpdateDatasetRequest | + status := "SUCCEEDED" // string | Filter for the run status. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.LastActorTaskRunsDefaultDatasetAPI.ActorTaskRunsLastDatasetPut(context.Background(), actorTaskId).UpdateDatasetRequest(updateDatasetRequest).Status(status).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `LastActorTaskRunsDefaultDatasetAPI.ActorTaskRunsLastDatasetPut``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ActorTaskRunsLastDatasetPut`: DatasetResponse + fmt.Fprintf(os.Stdout, "Response from `LastActorTaskRunsDefaultDatasetAPI.ActorTaskRunsLastDatasetPut`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**actorTaskId** | **string** | Task ID or a tilde-separated owner's username and task's name. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiActorTaskRunsLastDatasetPutRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **updateDatasetRequest** | [**UpdateDatasetRequest**](UpdateDatasetRequest.md) | | + **status** | **string** | Filter for the run status. | + +### Return type + +[**DatasetResponse**](DatasetResponse.md) + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## ActorTaskRunsLastDatasetStatisticsGet + +> DatasetStatisticsResponse ActorTaskRunsLastDatasetStatisticsGet(ctx, actorTaskId).Status(status).Execute() + +Get last task run's dataset statistics + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + actorTaskId := "janedoe~my-task" // string | Task ID or a tilde-separated owner's username and task's name. + status := "SUCCEEDED" // string | Filter for the run status. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.LastActorTaskRunsDefaultDatasetAPI.ActorTaskRunsLastDatasetStatisticsGet(context.Background(), actorTaskId).Status(status).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `LastActorTaskRunsDefaultDatasetAPI.ActorTaskRunsLastDatasetStatisticsGet``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ActorTaskRunsLastDatasetStatisticsGet`: DatasetStatisticsResponse + fmt.Fprintf(os.Stdout, "Response from `LastActorTaskRunsDefaultDatasetAPI.ActorTaskRunsLastDatasetStatisticsGet`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**actorTaskId** | **string** | Task ID or a tilde-separated owner's username and task's name. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiActorTaskRunsLastDatasetStatisticsGetRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **status** | **string** | Filter for the run status. | + +### Return type + +[**DatasetStatisticsResponse**](DatasetStatisticsResponse.md) + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/docs/LastActorTaskRunsDefaultKeyValueStoreAPI.md b/docs/LastActorTaskRunsDefaultKeyValueStoreAPI.md new file mode 100644 index 0000000..9f41650 --- /dev/null +++ b/docs/LastActorTaskRunsDefaultKeyValueStoreAPI.md @@ -0,0 +1,703 @@ +# \LastActorTaskRunsDefaultKeyValueStoreAPI + +All URIs are relative to *https://api.apify.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**ActorTaskRunsLastKeyValueStoreDelete**](LastActorTaskRunsDefaultKeyValueStoreAPI.md#ActorTaskRunsLastKeyValueStoreDelete) | **Delete** /v2/actor-tasks/{actorTaskId}/runs/last/key-value-store | Delete last task run's default store +[**ActorTaskRunsLastKeyValueStoreGet**](LastActorTaskRunsDefaultKeyValueStoreAPI.md#ActorTaskRunsLastKeyValueStoreGet) | **Get** /v2/actor-tasks/{actorTaskId}/runs/last/key-value-store | Get last task run's default store +[**ActorTaskRunsLastKeyValueStoreKeysGet**](LastActorTaskRunsDefaultKeyValueStoreAPI.md#ActorTaskRunsLastKeyValueStoreKeysGet) | **Get** /v2/actor-tasks/{actorTaskId}/runs/last/key-value-store/keys | Get last task run's default store's list of keys +[**ActorTaskRunsLastKeyValueStorePut**](LastActorTaskRunsDefaultKeyValueStoreAPI.md#ActorTaskRunsLastKeyValueStorePut) | **Put** /v2/actor-tasks/{actorTaskId}/runs/last/key-value-store | Update last task run's default store +[**ActorTaskRunsLastKeyValueStoreRecordDelete**](LastActorTaskRunsDefaultKeyValueStoreAPI.md#ActorTaskRunsLastKeyValueStoreRecordDelete) | **Delete** /v2/actor-tasks/{actorTaskId}/runs/last/key-value-store/records/{recordKey} | Delete last task run's default store's record +[**ActorTaskRunsLastKeyValueStoreRecordGet**](LastActorTaskRunsDefaultKeyValueStoreAPI.md#ActorTaskRunsLastKeyValueStoreRecordGet) | **Get** /v2/actor-tasks/{actorTaskId}/runs/last/key-value-store/records/{recordKey} | Get last task run's default store's record +[**ActorTaskRunsLastKeyValueStoreRecordPost**](LastActorTaskRunsDefaultKeyValueStoreAPI.md#ActorTaskRunsLastKeyValueStoreRecordPost) | **Post** /v2/actor-tasks/{actorTaskId}/runs/last/key-value-store/records/{recordKey} | Store record in last task run's default store (POST) +[**ActorTaskRunsLastKeyValueStoreRecordPut**](LastActorTaskRunsDefaultKeyValueStoreAPI.md#ActorTaskRunsLastKeyValueStoreRecordPut) | **Put** /v2/actor-tasks/{actorTaskId}/runs/last/key-value-store/records/{recordKey} | Store record in last task run's default store +[**ActorTaskRunsLastKeyValueStoreRecordsGet**](LastActorTaskRunsDefaultKeyValueStoreAPI.md#ActorTaskRunsLastKeyValueStoreRecordsGet) | **Get** /v2/actor-tasks/{actorTaskId}/runs/last/key-value-store/records | Download last task run's default store's records + + + +## ActorTaskRunsLastKeyValueStoreDelete + +> ActorTaskRunsLastKeyValueStoreDelete(ctx, actorTaskId).Status(status).Execute() + +Delete last task run's default store + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + actorTaskId := "janedoe~my-task" // string | Task ID or a tilde-separated owner's username and task's name. + status := "SUCCEEDED" // string | Filter for the run status. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + r, err := apiClient.LastActorTaskRunsDefaultKeyValueStoreAPI.ActorTaskRunsLastKeyValueStoreDelete(context.Background(), actorTaskId).Status(status).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `LastActorTaskRunsDefaultKeyValueStoreAPI.ActorTaskRunsLastKeyValueStoreDelete``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**actorTaskId** | **string** | Task ID or a tilde-separated owner's username and task's name. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiActorTaskRunsLastKeyValueStoreDeleteRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **status** | **string** | Filter for the run status. | + +### Return type + + (empty response body) + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## ActorTaskRunsLastKeyValueStoreGet + +> KeyValueStoreResponse ActorTaskRunsLastKeyValueStoreGet(ctx, actorTaskId).Status(status).Execute() + +Get last task run's default store + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + actorTaskId := "janedoe~my-task" // string | Task ID or a tilde-separated owner's username and task's name. + status := "SUCCEEDED" // string | Filter for the run status. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.LastActorTaskRunsDefaultKeyValueStoreAPI.ActorTaskRunsLastKeyValueStoreGet(context.Background(), actorTaskId).Status(status).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `LastActorTaskRunsDefaultKeyValueStoreAPI.ActorTaskRunsLastKeyValueStoreGet``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ActorTaskRunsLastKeyValueStoreGet`: KeyValueStoreResponse + fmt.Fprintf(os.Stdout, "Response from `LastActorTaskRunsDefaultKeyValueStoreAPI.ActorTaskRunsLastKeyValueStoreGet`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**actorTaskId** | **string** | Task ID or a tilde-separated owner's username and task's name. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiActorTaskRunsLastKeyValueStoreGetRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **status** | **string** | Filter for the run status. | + +### Return type + +[**KeyValueStoreResponse**](KeyValueStoreResponse.md) + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## ActorTaskRunsLastKeyValueStoreKeysGet + +> ListOfKeysResponse ActorTaskRunsLastKeyValueStoreKeysGet(ctx, actorTaskId).Status(status).ExclusiveStartKey(exclusiveStartKey).Limit(limit).Collection(collection).Prefix(prefix).Signature(signature).Execute() + +Get last task run's default store's list of keys + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + actorTaskId := "janedoe~my-task" // string | Task ID or a tilde-separated owner's username and task's name. + status := "SUCCEEDED" // string | Filter for the run status. (optional) + exclusiveStartKey := "Ihnsp8YrvJ8102Kj" // string | All keys up to this one (including) are skipped from the result. (optional) + limit := float32(100) // float32 | Number of keys to be returned. (optional) (default to 1000) + collection := "postImages" // string | Limit the results to keys that belong to a specific collection from the key-value store schema. The key-value store need to have a schema defined for this parameter to work. (optional) + prefix := "post-images-" // string | Limit the results to keys that start with a specific prefix. (optional) + signature := "2wTI46Bg8qWQrV7tavlPI" // string | Signature used for the access. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.LastActorTaskRunsDefaultKeyValueStoreAPI.ActorTaskRunsLastKeyValueStoreKeysGet(context.Background(), actorTaskId).Status(status).ExclusiveStartKey(exclusiveStartKey).Limit(limit).Collection(collection).Prefix(prefix).Signature(signature).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `LastActorTaskRunsDefaultKeyValueStoreAPI.ActorTaskRunsLastKeyValueStoreKeysGet``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ActorTaskRunsLastKeyValueStoreKeysGet`: ListOfKeysResponse + fmt.Fprintf(os.Stdout, "Response from `LastActorTaskRunsDefaultKeyValueStoreAPI.ActorTaskRunsLastKeyValueStoreKeysGet`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**actorTaskId** | **string** | Task ID or a tilde-separated owner's username and task's name. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiActorTaskRunsLastKeyValueStoreKeysGetRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **status** | **string** | Filter for the run status. | + **exclusiveStartKey** | **string** | All keys up to this one (including) are skipped from the result. | + **limit** | **float32** | Number of keys to be returned. | [default to 1000] + **collection** | **string** | Limit the results to keys that belong to a specific collection from the key-value store schema. The key-value store need to have a schema defined for this parameter to work. | + **prefix** | **string** | Limit the results to keys that start with a specific prefix. | + **signature** | **string** | Signature used for the access. | + +### Return type + +[**ListOfKeysResponse**](ListOfKeysResponse.md) + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## ActorTaskRunsLastKeyValueStorePut + +> KeyValueStoreResponse ActorTaskRunsLastKeyValueStorePut(ctx, actorTaskId).UpdateStoreRequest(updateStoreRequest).Status(status).Execute() + +Update last task run's default store + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + actorTaskId := "janedoe~my-task" // string | Task ID or a tilde-separated owner's username and task's name. + updateStoreRequest := *openapiclient.NewUpdateStoreRequest() // UpdateStoreRequest | + status := "SUCCEEDED" // string | Filter for the run status. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.LastActorTaskRunsDefaultKeyValueStoreAPI.ActorTaskRunsLastKeyValueStorePut(context.Background(), actorTaskId).UpdateStoreRequest(updateStoreRequest).Status(status).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `LastActorTaskRunsDefaultKeyValueStoreAPI.ActorTaskRunsLastKeyValueStorePut``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ActorTaskRunsLastKeyValueStorePut`: KeyValueStoreResponse + fmt.Fprintf(os.Stdout, "Response from `LastActorTaskRunsDefaultKeyValueStoreAPI.ActorTaskRunsLastKeyValueStorePut`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**actorTaskId** | **string** | Task ID or a tilde-separated owner's username and task's name. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiActorTaskRunsLastKeyValueStorePutRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **updateStoreRequest** | [**UpdateStoreRequest**](UpdateStoreRequest.md) | | + **status** | **string** | Filter for the run status. | + +### Return type + +[**KeyValueStoreResponse**](KeyValueStoreResponse.md) + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## ActorTaskRunsLastKeyValueStoreRecordDelete + +> ActorTaskRunsLastKeyValueStoreRecordDelete(ctx, actorTaskId, recordKey).Status(status).Execute() + +Delete last task run's default store's record + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + actorTaskId := "janedoe~my-task" // string | Task ID or a tilde-separated owner's username and task's name. + recordKey := "someKey" // string | Key of the record. + status := "SUCCEEDED" // string | Filter for the run status. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + r, err := apiClient.LastActorTaskRunsDefaultKeyValueStoreAPI.ActorTaskRunsLastKeyValueStoreRecordDelete(context.Background(), actorTaskId, recordKey).Status(status).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `LastActorTaskRunsDefaultKeyValueStoreAPI.ActorTaskRunsLastKeyValueStoreRecordDelete``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**actorTaskId** | **string** | Task ID or a tilde-separated owner's username and task's name. | +**recordKey** | **string** | Key of the record. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiActorTaskRunsLastKeyValueStoreRecordDeleteRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + **status** | **string** | Filter for the run status. | + +### Return type + + (empty response body) + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## ActorTaskRunsLastKeyValueStoreRecordGet + +> map[string]interface{} ActorTaskRunsLastKeyValueStoreRecordGet(ctx, actorTaskId, recordKey).Status(status).Signature(signature).Attachment(attachment).Execute() + +Get last task run's default store's record + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + actorTaskId := "janedoe~my-task" // string | Task ID or a tilde-separated owner's username and task's name. + recordKey := "someKey" // string | Key of the record. + status := "SUCCEEDED" // string | Filter for the run status. (optional) + signature := "2wTI46Bg8qWQrV7tavlPI" // string | Signature used for the access. (optional) + attachment := true // bool | If `true` or `1`, the response will be served with `Content-Disposition: attachment` header, causing web browsers to offer downloading HTML records instead of displaying them. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.LastActorTaskRunsDefaultKeyValueStoreAPI.ActorTaskRunsLastKeyValueStoreRecordGet(context.Background(), actorTaskId, recordKey).Status(status).Signature(signature).Attachment(attachment).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `LastActorTaskRunsDefaultKeyValueStoreAPI.ActorTaskRunsLastKeyValueStoreRecordGet``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ActorTaskRunsLastKeyValueStoreRecordGet`: map[string]interface{} + fmt.Fprintf(os.Stdout, "Response from `LastActorTaskRunsDefaultKeyValueStoreAPI.ActorTaskRunsLastKeyValueStoreRecordGet`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**actorTaskId** | **string** | Task ID or a tilde-separated owner's username and task's name. | +**recordKey** | **string** | Key of the record. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiActorTaskRunsLastKeyValueStoreRecordGetRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + **status** | **string** | Filter for the run status. | + **signature** | **string** | Signature used for the access. | + **attachment** | **bool** | If `true` or `1`, the response will be served with `Content-Disposition: attachment` header, causing web browsers to offer downloading HTML records instead of displaying them. | + +### Return type + +**map[string]interface{}** + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json, */* + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## ActorTaskRunsLastKeyValueStoreRecordPost + +> map[string]interface{} ActorTaskRunsLastKeyValueStoreRecordPost(ctx, actorTaskId, recordKey).RequestBody(requestBody).Status(status).ContentEncoding(contentEncoding).Execute() + +Store record in last task run's default store (POST) + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + actorTaskId := "janedoe~my-task" // string | Task ID or a tilde-separated owner's username and task's name. + recordKey := "someKey" // string | Key of the record. + requestBody := map[string]interface{}{"key": interface{}(123)} // map[string]interface{} | + status := "SUCCEEDED" // string | Filter for the run status. (optional) + contentEncoding := "contentEncoding_example" // string | (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.LastActorTaskRunsDefaultKeyValueStoreAPI.ActorTaskRunsLastKeyValueStoreRecordPost(context.Background(), actorTaskId, recordKey).RequestBody(requestBody).Status(status).ContentEncoding(contentEncoding).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `LastActorTaskRunsDefaultKeyValueStoreAPI.ActorTaskRunsLastKeyValueStoreRecordPost``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ActorTaskRunsLastKeyValueStoreRecordPost`: map[string]interface{} + fmt.Fprintf(os.Stdout, "Response from `LastActorTaskRunsDefaultKeyValueStoreAPI.ActorTaskRunsLastKeyValueStoreRecordPost`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**actorTaskId** | **string** | Task ID or a tilde-separated owner's username and task's name. | +**recordKey** | **string** | Key of the record. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiActorTaskRunsLastKeyValueStoreRecordPostRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + **requestBody** | **map[string]interface{}** | | + **status** | **string** | Filter for the run status. | + **contentEncoding** | **string** | | + +### Return type + +**map[string]interface{}** + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## ActorTaskRunsLastKeyValueStoreRecordPut + +> map[string]interface{} ActorTaskRunsLastKeyValueStoreRecordPut(ctx, actorTaskId, recordKey).RequestBody(requestBody).Status(status).ContentEncoding(contentEncoding).Execute() + +Store record in last task run's default store + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + actorTaskId := "janedoe~my-task" // string | Task ID or a tilde-separated owner's username and task's name. + recordKey := "someKey" // string | Key of the record. + requestBody := map[string]interface{}{"key": interface{}(123)} // map[string]interface{} | + status := "SUCCEEDED" // string | Filter for the run status. (optional) + contentEncoding := "contentEncoding_example" // string | (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.LastActorTaskRunsDefaultKeyValueStoreAPI.ActorTaskRunsLastKeyValueStoreRecordPut(context.Background(), actorTaskId, recordKey).RequestBody(requestBody).Status(status).ContentEncoding(contentEncoding).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `LastActorTaskRunsDefaultKeyValueStoreAPI.ActorTaskRunsLastKeyValueStoreRecordPut``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ActorTaskRunsLastKeyValueStoreRecordPut`: map[string]interface{} + fmt.Fprintf(os.Stdout, "Response from `LastActorTaskRunsDefaultKeyValueStoreAPI.ActorTaskRunsLastKeyValueStoreRecordPut`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**actorTaskId** | **string** | Task ID or a tilde-separated owner's username and task's name. | +**recordKey** | **string** | Key of the record. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiActorTaskRunsLastKeyValueStoreRecordPutRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + **requestBody** | **map[string]interface{}** | | + **status** | **string** | Filter for the run status. | + **contentEncoding** | **string** | | + +### Return type + +**map[string]interface{}** + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## ActorTaskRunsLastKeyValueStoreRecordsGet + +> *os.File ActorTaskRunsLastKeyValueStoreRecordsGet(ctx, actorTaskId).Status(status).Collection(collection).Prefix(prefix).Signature(signature).Execute() + +Download last task run's default store's records + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + actorTaskId := "janedoe~my-task" // string | Task ID or a tilde-separated owner's username and task's name. + status := "SUCCEEDED" // string | Filter for the run status. (optional) + collection := "my-collection" // string | If specified, only records belonging to a specific collection from the key-value store schema. The key-value store need to have a schema defined for this parameter to work. (optional) + prefix := "my-prefix/" // string | If specified, only records whose key starts with the given prefix are included in the archive. (optional) + signature := "2wTI46Bg8qWQrV7tavlPI" // string | Signature used for the access. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.LastActorTaskRunsDefaultKeyValueStoreAPI.ActorTaskRunsLastKeyValueStoreRecordsGet(context.Background(), actorTaskId).Status(status).Collection(collection).Prefix(prefix).Signature(signature).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `LastActorTaskRunsDefaultKeyValueStoreAPI.ActorTaskRunsLastKeyValueStoreRecordsGet``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ActorTaskRunsLastKeyValueStoreRecordsGet`: *os.File + fmt.Fprintf(os.Stdout, "Response from `LastActorTaskRunsDefaultKeyValueStoreAPI.ActorTaskRunsLastKeyValueStoreRecordsGet`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**actorTaskId** | **string** | Task ID or a tilde-separated owner's username and task's name. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiActorTaskRunsLastKeyValueStoreRecordsGetRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **status** | **string** | Filter for the run status. | + **collection** | **string** | If specified, only records belonging to a specific collection from the key-value store schema. The key-value store need to have a schema defined for this parameter to work. | + **prefix** | **string** | If specified, only records whose key starts with the given prefix are included in the archive. | + **signature** | **string** | Signature used for the access. | + +### Return type + +[***os.File**](*os.File.md) + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/zip, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/docs/LastActorTaskRunsDefaultRequestQueueAPI.md b/docs/LastActorTaskRunsDefaultRequestQueueAPI.md new file mode 100644 index 0000000..51e94d1 --- /dev/null +++ b/docs/LastActorTaskRunsDefaultRequestQueueAPI.md @@ -0,0 +1,1172 @@ +# \LastActorTaskRunsDefaultRequestQueueAPI + +All URIs are relative to *https://api.apify.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**ActorTaskRunsLastRequestQueueDelete**](LastActorTaskRunsDefaultRequestQueueAPI.md#ActorTaskRunsLastRequestQueueDelete) | **Delete** /v2/actor-tasks/{actorTaskId}/runs/last/request-queue | Delete last task run's default request queue +[**ActorTaskRunsLastRequestQueueGet**](LastActorTaskRunsDefaultRequestQueueAPI.md#ActorTaskRunsLastRequestQueueGet) | **Get** /v2/actor-tasks/{actorTaskId}/runs/last/request-queue | Get last task run's default request queue +[**ActorTaskRunsLastRequestQueueHeadGet**](LastActorTaskRunsDefaultRequestQueueAPI.md#ActorTaskRunsLastRequestQueueHeadGet) | **Get** /v2/actor-tasks/{actorTaskId}/runs/last/request-queue/head | Get last task run's default request queue head +[**ActorTaskRunsLastRequestQueueHeadLockPost**](LastActorTaskRunsDefaultRequestQueueAPI.md#ActorTaskRunsLastRequestQueueHeadLockPost) | **Post** /v2/actor-tasks/{actorTaskId}/runs/last/request-queue/head/lock | Get and lock last task run's default request queue head +[**ActorTaskRunsLastRequestQueuePut**](LastActorTaskRunsDefaultRequestQueueAPI.md#ActorTaskRunsLastRequestQueuePut) | **Put** /v2/actor-tasks/{actorTaskId}/runs/last/request-queue | Update last task run's default request queue +[**ActorTaskRunsLastRequestQueueRequestDelete**](LastActorTaskRunsDefaultRequestQueueAPI.md#ActorTaskRunsLastRequestQueueRequestDelete) | **Delete** /v2/actor-tasks/{actorTaskId}/runs/last/request-queue/requests/{requestId} | Delete request from last task run's default request queue +[**ActorTaskRunsLastRequestQueueRequestGet**](LastActorTaskRunsDefaultRequestQueueAPI.md#ActorTaskRunsLastRequestQueueRequestGet) | **Get** /v2/actor-tasks/{actorTaskId}/runs/last/request-queue/requests/{requestId} | Get request from last task run's default request queue +[**ActorTaskRunsLastRequestQueueRequestLockDelete**](LastActorTaskRunsDefaultRequestQueueAPI.md#ActorTaskRunsLastRequestQueueRequestLockDelete) | **Delete** /v2/actor-tasks/{actorTaskId}/runs/last/request-queue/requests/{requestId}/lock | Delete lock on request in last task run's default request queue +[**ActorTaskRunsLastRequestQueueRequestLockPut**](LastActorTaskRunsDefaultRequestQueueAPI.md#ActorTaskRunsLastRequestQueueRequestLockPut) | **Put** /v2/actor-tasks/{actorTaskId}/runs/last/request-queue/requests/{requestId}/lock | Prolong lock on request in last task run's default request queue +[**ActorTaskRunsLastRequestQueueRequestPut**](LastActorTaskRunsDefaultRequestQueueAPI.md#ActorTaskRunsLastRequestQueueRequestPut) | **Put** /v2/actor-tasks/{actorTaskId}/runs/last/request-queue/requests/{requestId} | Update request in last task run's default request queue +[**ActorTaskRunsLastRequestQueueRequestsBatchDelete**](LastActorTaskRunsDefaultRequestQueueAPI.md#ActorTaskRunsLastRequestQueueRequestsBatchDelete) | **Delete** /v2/actor-tasks/{actorTaskId}/runs/last/request-queue/requests/batch | Batch delete requests from last task run's default request queue +[**ActorTaskRunsLastRequestQueueRequestsBatchPost**](LastActorTaskRunsDefaultRequestQueueAPI.md#ActorTaskRunsLastRequestQueueRequestsBatchPost) | **Post** /v2/actor-tasks/{actorTaskId}/runs/last/request-queue/requests/batch | Batch add requests to last task run's default request queue +[**ActorTaskRunsLastRequestQueueRequestsGet**](LastActorTaskRunsDefaultRequestQueueAPI.md#ActorTaskRunsLastRequestQueueRequestsGet) | **Get** /v2/actor-tasks/{actorTaskId}/runs/last/request-queue/requests | List last task run's default request queue's requests +[**ActorTaskRunsLastRequestQueueRequestsPost**](LastActorTaskRunsDefaultRequestQueueAPI.md#ActorTaskRunsLastRequestQueueRequestsPost) | **Post** /v2/actor-tasks/{actorTaskId}/runs/last/request-queue/requests | Add request to last task run's default request queue +[**ActorTaskRunsLastRequestQueueRequestsUnlockPost**](LastActorTaskRunsDefaultRequestQueueAPI.md#ActorTaskRunsLastRequestQueueRequestsUnlockPost) | **Post** /v2/actor-tasks/{actorTaskId}/runs/last/request-queue/requests/unlock | Unlock requests in last task run's default request queue + + + +## ActorTaskRunsLastRequestQueueDelete + +> ActorTaskRunsLastRequestQueueDelete(ctx, actorTaskId).Status(status).Execute() + +Delete last task run's default request queue + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + actorTaskId := "janedoe~my-task" // string | Task ID or a tilde-separated owner's username and task's name. + status := "SUCCEEDED" // string | Filter for the run status. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + r, err := apiClient.LastActorTaskRunsDefaultRequestQueueAPI.ActorTaskRunsLastRequestQueueDelete(context.Background(), actorTaskId).Status(status).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `LastActorTaskRunsDefaultRequestQueueAPI.ActorTaskRunsLastRequestQueueDelete``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**actorTaskId** | **string** | Task ID or a tilde-separated owner's username and task's name. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiActorTaskRunsLastRequestQueueDeleteRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **status** | **string** | Filter for the run status. | + +### Return type + + (empty response body) + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## ActorTaskRunsLastRequestQueueGet + +> RequestQueueResponse ActorTaskRunsLastRequestQueueGet(ctx, actorTaskId).Status(status).Execute() + +Get last task run's default request queue + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + actorTaskId := "janedoe~my-task" // string | Task ID or a tilde-separated owner's username and task's name. + status := "SUCCEEDED" // string | Filter for the run status. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.LastActorTaskRunsDefaultRequestQueueAPI.ActorTaskRunsLastRequestQueueGet(context.Background(), actorTaskId).Status(status).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `LastActorTaskRunsDefaultRequestQueueAPI.ActorTaskRunsLastRequestQueueGet``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ActorTaskRunsLastRequestQueueGet`: RequestQueueResponse + fmt.Fprintf(os.Stdout, "Response from `LastActorTaskRunsDefaultRequestQueueAPI.ActorTaskRunsLastRequestQueueGet`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**actorTaskId** | **string** | Task ID or a tilde-separated owner's username and task's name. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiActorTaskRunsLastRequestQueueGetRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **status** | **string** | Filter for the run status. | + +### Return type + +[**RequestQueueResponse**](RequestQueueResponse.md) + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## ActorTaskRunsLastRequestQueueHeadGet + +> HeadResponse ActorTaskRunsLastRequestQueueHeadGet(ctx, actorTaskId).Status(status).Limit(limit).ClientKey(clientKey).Execute() + +Get last task run's default request queue head + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + actorTaskId := "janedoe~my-task" // string | Task ID or a tilde-separated owner's username and task's name. + status := "SUCCEEDED" // string | Filter for the run status. (optional) + limit := float64(100) // float64 | How many items from queue should be returned. (optional) + clientKey := "client-abc" // string | A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.LastActorTaskRunsDefaultRequestQueueAPI.ActorTaskRunsLastRequestQueueHeadGet(context.Background(), actorTaskId).Status(status).Limit(limit).ClientKey(clientKey).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `LastActorTaskRunsDefaultRequestQueueAPI.ActorTaskRunsLastRequestQueueHeadGet``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ActorTaskRunsLastRequestQueueHeadGet`: HeadResponse + fmt.Fprintf(os.Stdout, "Response from `LastActorTaskRunsDefaultRequestQueueAPI.ActorTaskRunsLastRequestQueueHeadGet`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**actorTaskId** | **string** | Task ID or a tilde-separated owner's username and task's name. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiActorTaskRunsLastRequestQueueHeadGetRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **status** | **string** | Filter for the run status. | + **limit** | **float64** | How many items from queue should be returned. | + **clientKey** | **string** | A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. | + +### Return type + +[**HeadResponse**](HeadResponse.md) + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## ActorTaskRunsLastRequestQueueHeadLockPost + +> HeadAndLockResponse ActorTaskRunsLastRequestQueueHeadLockPost(ctx, actorTaskId).LockSecs(lockSecs).Status(status).Limit(limit).ClientKey(clientKey).Execute() + +Get and lock last task run's default request queue head + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + actorTaskId := "janedoe~my-task" // string | Task ID or a tilde-separated owner's username and task's name. + lockSecs := float64(60) // float64 | How long the requests will be locked for (in seconds). + status := "SUCCEEDED" // string | Filter for the run status. (optional) + limit := float64(25) // float64 | How many items from the queue should be returned. (optional) + clientKey := "client-abc" // string | A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.LastActorTaskRunsDefaultRequestQueueAPI.ActorTaskRunsLastRequestQueueHeadLockPost(context.Background(), actorTaskId).LockSecs(lockSecs).Status(status).Limit(limit).ClientKey(clientKey).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `LastActorTaskRunsDefaultRequestQueueAPI.ActorTaskRunsLastRequestQueueHeadLockPost``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ActorTaskRunsLastRequestQueueHeadLockPost`: HeadAndLockResponse + fmt.Fprintf(os.Stdout, "Response from `LastActorTaskRunsDefaultRequestQueueAPI.ActorTaskRunsLastRequestQueueHeadLockPost`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**actorTaskId** | **string** | Task ID or a tilde-separated owner's username and task's name. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiActorTaskRunsLastRequestQueueHeadLockPostRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **lockSecs** | **float64** | How long the requests will be locked for (in seconds). | + **status** | **string** | Filter for the run status. | + **limit** | **float64** | How many items from the queue should be returned. | + **clientKey** | **string** | A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. | + +### Return type + +[**HeadAndLockResponse**](HeadAndLockResponse.md) + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## ActorTaskRunsLastRequestQueuePut + +> RequestQueueResponse ActorTaskRunsLastRequestQueuePut(ctx, actorTaskId).UpdateRequestQueueRequest(updateRequestQueueRequest).Status(status).Execute() + +Update last task run's default request queue + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + actorTaskId := "janedoe~my-task" // string | Task ID or a tilde-separated owner's username and task's name. + updateRequestQueueRequest := *openapiclient.NewUpdateRequestQueueRequest() // UpdateRequestQueueRequest | + status := "SUCCEEDED" // string | Filter for the run status. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.LastActorTaskRunsDefaultRequestQueueAPI.ActorTaskRunsLastRequestQueuePut(context.Background(), actorTaskId).UpdateRequestQueueRequest(updateRequestQueueRequest).Status(status).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `LastActorTaskRunsDefaultRequestQueueAPI.ActorTaskRunsLastRequestQueuePut``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ActorTaskRunsLastRequestQueuePut`: RequestQueueResponse + fmt.Fprintf(os.Stdout, "Response from `LastActorTaskRunsDefaultRequestQueueAPI.ActorTaskRunsLastRequestQueuePut`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**actorTaskId** | **string** | Task ID or a tilde-separated owner's username and task's name. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiActorTaskRunsLastRequestQueuePutRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **updateRequestQueueRequest** | [**UpdateRequestQueueRequest**](UpdateRequestQueueRequest.md) | | + **status** | **string** | Filter for the run status. | + +### Return type + +[**RequestQueueResponse**](RequestQueueResponse.md) + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## ActorTaskRunsLastRequestQueueRequestDelete + +> ActorTaskRunsLastRequestQueueRequestDelete(ctx, actorTaskId, requestId).Status(status).ClientKey(clientKey).Execute() + +Delete request from last task run's default request queue + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + actorTaskId := "janedoe~my-task" // string | Task ID or a tilde-separated owner's username and task's name. + requestId := "xpsmkDlspokDSmklS" // string | Request ID. + status := "SUCCEEDED" // string | Filter for the run status. (optional) + clientKey := "client-abc" // string | A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + r, err := apiClient.LastActorTaskRunsDefaultRequestQueueAPI.ActorTaskRunsLastRequestQueueRequestDelete(context.Background(), actorTaskId, requestId).Status(status).ClientKey(clientKey).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `LastActorTaskRunsDefaultRequestQueueAPI.ActorTaskRunsLastRequestQueueRequestDelete``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**actorTaskId** | **string** | Task ID or a tilde-separated owner's username and task's name. | +**requestId** | **string** | Request ID. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiActorTaskRunsLastRequestQueueRequestDeleteRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + **status** | **string** | Filter for the run status. | + **clientKey** | **string** | A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. | + +### Return type + + (empty response body) + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## ActorTaskRunsLastRequestQueueRequestGet + +> RequestResponse ActorTaskRunsLastRequestQueueRequestGet(ctx, actorTaskId, requestId).Status(status).Execute() + +Get request from last task run's default request queue + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + actorTaskId := "janedoe~my-task" // string | Task ID or a tilde-separated owner's username and task's name. + requestId := "xpsmkDlspokDSmklS" // string | Request ID. + status := "SUCCEEDED" // string | Filter for the run status. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.LastActorTaskRunsDefaultRequestQueueAPI.ActorTaskRunsLastRequestQueueRequestGet(context.Background(), actorTaskId, requestId).Status(status).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `LastActorTaskRunsDefaultRequestQueueAPI.ActorTaskRunsLastRequestQueueRequestGet``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ActorTaskRunsLastRequestQueueRequestGet`: RequestResponse + fmt.Fprintf(os.Stdout, "Response from `LastActorTaskRunsDefaultRequestQueueAPI.ActorTaskRunsLastRequestQueueRequestGet`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**actorTaskId** | **string** | Task ID or a tilde-separated owner's username and task's name. | +**requestId** | **string** | Request ID. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiActorTaskRunsLastRequestQueueRequestGetRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + **status** | **string** | Filter for the run status. | + +### Return type + +[**RequestResponse**](RequestResponse.md) + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## ActorTaskRunsLastRequestQueueRequestLockDelete + +> ActorTaskRunsLastRequestQueueRequestLockDelete(ctx, actorTaskId, requestId).Status(status).ClientKey(clientKey).Forefront(forefront).Execute() + +Delete lock on request in last task run's default request queue + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + actorTaskId := "janedoe~my-task" // string | Task ID or a tilde-separated owner's username and task's name. + requestId := "xpsmkDlspokDSmklS" // string | Request ID. + status := "SUCCEEDED" // string | Filter for the run status. (optional) + clientKey := "client-abc" // string | A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. (optional) + forefront := "false" // string | Determines if request should be added to the head of the queue or to the end after lock was removed. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + r, err := apiClient.LastActorTaskRunsDefaultRequestQueueAPI.ActorTaskRunsLastRequestQueueRequestLockDelete(context.Background(), actorTaskId, requestId).Status(status).ClientKey(clientKey).Forefront(forefront).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `LastActorTaskRunsDefaultRequestQueueAPI.ActorTaskRunsLastRequestQueueRequestLockDelete``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**actorTaskId** | **string** | Task ID or a tilde-separated owner's username and task's name. | +**requestId** | **string** | Request ID. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiActorTaskRunsLastRequestQueueRequestLockDeleteRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + **status** | **string** | Filter for the run status. | + **clientKey** | **string** | A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. | + **forefront** | **string** | Determines if request should be added to the head of the queue or to the end after lock was removed. | + +### Return type + + (empty response body) + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## ActorTaskRunsLastRequestQueueRequestLockPut + +> ProlongRequestLockResponse ActorTaskRunsLastRequestQueueRequestLockPut(ctx, actorTaskId, requestId).LockSecs(lockSecs).Status(status).ClientKey(clientKey).Forefront(forefront).Execute() + +Prolong lock on request in last task run's default request queue + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + actorTaskId := "janedoe~my-task" // string | Task ID or a tilde-separated owner's username and task's name. + requestId := "xpsmkDlspokDSmklS" // string | Request ID. + lockSecs := float64(60) // float64 | How long the requests will be locked for (in seconds). + status := "SUCCEEDED" // string | Filter for the run status. (optional) + clientKey := "client-abc" // string | A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. (optional) + forefront := "false" // string | Determines if request should be added to the head of the queue or to the end after lock expires. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.LastActorTaskRunsDefaultRequestQueueAPI.ActorTaskRunsLastRequestQueueRequestLockPut(context.Background(), actorTaskId, requestId).LockSecs(lockSecs).Status(status).ClientKey(clientKey).Forefront(forefront).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `LastActorTaskRunsDefaultRequestQueueAPI.ActorTaskRunsLastRequestQueueRequestLockPut``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ActorTaskRunsLastRequestQueueRequestLockPut`: ProlongRequestLockResponse + fmt.Fprintf(os.Stdout, "Response from `LastActorTaskRunsDefaultRequestQueueAPI.ActorTaskRunsLastRequestQueueRequestLockPut`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**actorTaskId** | **string** | Task ID or a tilde-separated owner's username and task's name. | +**requestId** | **string** | Request ID. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiActorTaskRunsLastRequestQueueRequestLockPutRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + **lockSecs** | **float64** | How long the requests will be locked for (in seconds). | + **status** | **string** | Filter for the run status. | + **clientKey** | **string** | A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. | + **forefront** | **string** | Determines if request should be added to the head of the queue or to the end after lock expires. | + +### Return type + +[**ProlongRequestLockResponse**](ProlongRequestLockResponse.md) + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## ActorTaskRunsLastRequestQueueRequestPut + +> UpdateRequestResponse ActorTaskRunsLastRequestQueueRequestPut(ctx, actorTaskId, requestId).Request(request).Status(status).Forefront(forefront).ClientKey(clientKey).Execute() + +Update request in last task run's default request queue + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + actorTaskId := "janedoe~my-task" // string | Task ID or a tilde-separated owner's username and task's name. + requestId := "xpsmkDlspokDSmklS" // string | Request ID. + request := *openapiclient.NewRequest() // Request | + status := "SUCCEEDED" // string | Filter for the run status. (optional) + forefront := "false" // string | Determines if request should be added to the head of the queue or to the end. Default value is `false` (end of queue). (optional) + clientKey := "client-abc" // string | A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.LastActorTaskRunsDefaultRequestQueueAPI.ActorTaskRunsLastRequestQueueRequestPut(context.Background(), actorTaskId, requestId).Request(request).Status(status).Forefront(forefront).ClientKey(clientKey).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `LastActorTaskRunsDefaultRequestQueueAPI.ActorTaskRunsLastRequestQueueRequestPut``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ActorTaskRunsLastRequestQueueRequestPut`: UpdateRequestResponse + fmt.Fprintf(os.Stdout, "Response from `LastActorTaskRunsDefaultRequestQueueAPI.ActorTaskRunsLastRequestQueueRequestPut`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**actorTaskId** | **string** | Task ID or a tilde-separated owner's username and task's name. | +**requestId** | **string** | Request ID. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiActorTaskRunsLastRequestQueueRequestPutRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + **request** | [**Request**](Request.md) | | + **status** | **string** | Filter for the run status. | + **forefront** | **string** | Determines if request should be added to the head of the queue or to the end. Default value is `false` (end of queue). | + **clientKey** | **string** | A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. | + +### Return type + +[**UpdateRequestResponse**](UpdateRequestResponse.md) + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## ActorTaskRunsLastRequestQueueRequestsBatchDelete + +> BatchDeleteResponse ActorTaskRunsLastRequestQueueRequestsBatchDelete(ctx, actorTaskId).ContentType(contentType).RequestDraftDelete(requestDraftDelete).Status(status).ClientKey(clientKey).Execute() + +Batch delete requests from last task run's default request queue + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + actorTaskId := "janedoe~my-task" // string | Task ID or a tilde-separated owner's username and task's name. + contentType := "contentType_example" // string | + requestDraftDelete := []openapiclient.RequestDraftDelete{*openapiclient.NewRequestDraftDelete("Id_example", "UniqueKey_example")} // []RequestDraftDelete | + status := "SUCCEEDED" // string | Filter for the run status. (optional) + clientKey := "client-abc" // string | A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.LastActorTaskRunsDefaultRequestQueueAPI.ActorTaskRunsLastRequestQueueRequestsBatchDelete(context.Background(), actorTaskId).ContentType(contentType).RequestDraftDelete(requestDraftDelete).Status(status).ClientKey(clientKey).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `LastActorTaskRunsDefaultRequestQueueAPI.ActorTaskRunsLastRequestQueueRequestsBatchDelete``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ActorTaskRunsLastRequestQueueRequestsBatchDelete`: BatchDeleteResponse + fmt.Fprintf(os.Stdout, "Response from `LastActorTaskRunsDefaultRequestQueueAPI.ActorTaskRunsLastRequestQueueRequestsBatchDelete`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**actorTaskId** | **string** | Task ID or a tilde-separated owner's username and task's name. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiActorTaskRunsLastRequestQueueRequestsBatchDeleteRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **contentType** | **string** | | + **requestDraftDelete** | [**[]RequestDraftDelete**](RequestDraftDelete.md) | | + **status** | **string** | Filter for the run status. | + **clientKey** | **string** | A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. | + +### Return type + +[**BatchDeleteResponse**](BatchDeleteResponse.md) + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## ActorTaskRunsLastRequestQueueRequestsBatchPost + +> BatchAddResponse ActorTaskRunsLastRequestQueueRequestsBatchPost(ctx, actorTaskId).RequestBase(requestBase).Status(status).ClientKey(clientKey).Forefront(forefront).Execute() + +Batch add requests to last task run's default request queue + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + actorTaskId := "janedoe~my-task" // string | Task ID or a tilde-separated owner's username and task's name. + requestBase := []openapiclient.RequestBase{*openapiclient.NewRequestBase()} // []RequestBase | + status := "SUCCEEDED" // string | Filter for the run status. (optional) + clientKey := "client-abc" // string | A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. (optional) + forefront := "false" // string | Determines if request should be added to the head of the queue or to the end. Default value is `false` (end of queue). (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.LastActorTaskRunsDefaultRequestQueueAPI.ActorTaskRunsLastRequestQueueRequestsBatchPost(context.Background(), actorTaskId).RequestBase(requestBase).Status(status).ClientKey(clientKey).Forefront(forefront).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `LastActorTaskRunsDefaultRequestQueueAPI.ActorTaskRunsLastRequestQueueRequestsBatchPost``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ActorTaskRunsLastRequestQueueRequestsBatchPost`: BatchAddResponse + fmt.Fprintf(os.Stdout, "Response from `LastActorTaskRunsDefaultRequestQueueAPI.ActorTaskRunsLastRequestQueueRequestsBatchPost`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**actorTaskId** | **string** | Task ID or a tilde-separated owner's username and task's name. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiActorTaskRunsLastRequestQueueRequestsBatchPostRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **requestBase** | [**[]RequestBase**](RequestBase.md) | | + **status** | **string** | Filter for the run status. | + **clientKey** | **string** | A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. | + **forefront** | **string** | Determines if request should be added to the head of the queue or to the end. Default value is `false` (end of queue). | + +### Return type + +[**BatchAddResponse**](BatchAddResponse.md) + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## ActorTaskRunsLastRequestQueueRequestsGet + +> ListOfRequestsResponse ActorTaskRunsLastRequestQueueRequestsGet(ctx, actorTaskId).Status(status).ClientKey(clientKey).ExclusiveStartId(exclusiveStartId).Limit(limit).Cursor(cursor).Filter(filter).Execute() + +List last task run's default request queue's requests + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + actorTaskId := "janedoe~my-task" // string | Task ID or a tilde-separated owner's username and task's name. + status := "SUCCEEDED" // string | Filter for the run status. (optional) + clientKey := "client-abc" // string | A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. (optional) + exclusiveStartId := "Ihnsp8YrvJ8102Kj" // string | All requests up to this one (including) are skipped from the result. (Deprecated, use `cursor` instead.) (optional) + limit := float64(100) // float64 | Number of keys to be returned. Maximum value is `10000`. (optional) + cursor := "eyJyZXF1ZXN0SWQiOiI2OFRqQ2RaTDNvM2hiUU0ifQ" // string | A cursor string for pagination, returned in the previous response as `nextCursor`. Use this to retrieve the next page of requests. (optional) + filter := []string{"Filter_example"} // []string | Filter requests by their state. Possible values are `locked` and `pending`. You can combine multiple values separated by commas, which will mean the union of these filters – requests matching any of the specified states will be returned. (Not compatible with deprecated `exclusiveStartId` parameter.) (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.LastActorTaskRunsDefaultRequestQueueAPI.ActorTaskRunsLastRequestQueueRequestsGet(context.Background(), actorTaskId).Status(status).ClientKey(clientKey).ExclusiveStartId(exclusiveStartId).Limit(limit).Cursor(cursor).Filter(filter).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `LastActorTaskRunsDefaultRequestQueueAPI.ActorTaskRunsLastRequestQueueRequestsGet``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ActorTaskRunsLastRequestQueueRequestsGet`: ListOfRequestsResponse + fmt.Fprintf(os.Stdout, "Response from `LastActorTaskRunsDefaultRequestQueueAPI.ActorTaskRunsLastRequestQueueRequestsGet`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**actorTaskId** | **string** | Task ID or a tilde-separated owner's username and task's name. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiActorTaskRunsLastRequestQueueRequestsGetRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **status** | **string** | Filter for the run status. | + **clientKey** | **string** | A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. | + **exclusiveStartId** | **string** | All requests up to this one (including) are skipped from the result. (Deprecated, use `cursor` instead.) | + **limit** | **float64** | Number of keys to be returned. Maximum value is `10000`. | + **cursor** | **string** | A cursor string for pagination, returned in the previous response as `nextCursor`. Use this to retrieve the next page of requests. | + **filter** | **[]string** | Filter requests by their state. Possible values are `locked` and `pending`. You can combine multiple values separated by commas, which will mean the union of these filters – requests matching any of the specified states will be returned. (Not compatible with deprecated `exclusiveStartId` parameter.) | + +### Return type + +[**ListOfRequestsResponse**](ListOfRequestsResponse.md) + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## ActorTaskRunsLastRequestQueueRequestsPost + +> AddRequestResponse ActorTaskRunsLastRequestQueueRequestsPost(ctx, actorTaskId).RequestBase(requestBase).Status(status).ClientKey(clientKey).Forefront(forefront).Execute() + +Add request to last task run's default request queue + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + actorTaskId := "janedoe~my-task" // string | Task ID or a tilde-separated owner's username and task's name. + requestBase := *openapiclient.NewRequestBase() // RequestBase | + status := "SUCCEEDED" // string | Filter for the run status. (optional) + clientKey := "client-abc" // string | A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. (optional) + forefront := "false" // string | Determines if request should be added to the head of the queue or to the end. Default value is `false` (end of queue). (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.LastActorTaskRunsDefaultRequestQueueAPI.ActorTaskRunsLastRequestQueueRequestsPost(context.Background(), actorTaskId).RequestBase(requestBase).Status(status).ClientKey(clientKey).Forefront(forefront).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `LastActorTaskRunsDefaultRequestQueueAPI.ActorTaskRunsLastRequestQueueRequestsPost``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ActorTaskRunsLastRequestQueueRequestsPost`: AddRequestResponse + fmt.Fprintf(os.Stdout, "Response from `LastActorTaskRunsDefaultRequestQueueAPI.ActorTaskRunsLastRequestQueueRequestsPost`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**actorTaskId** | **string** | Task ID or a tilde-separated owner's username and task's name. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiActorTaskRunsLastRequestQueueRequestsPostRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **requestBase** | [**RequestBase**](RequestBase.md) | | + **status** | **string** | Filter for the run status. | + **clientKey** | **string** | A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. | + **forefront** | **string** | Determines if request should be added to the head of the queue or to the end. Default value is `false` (end of queue). | + +### Return type + +[**AddRequestResponse**](AddRequestResponse.md) + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## ActorTaskRunsLastRequestQueueRequestsUnlockPost + +> UnlockRequestsResponse ActorTaskRunsLastRequestQueueRequestsUnlockPost(ctx, actorTaskId).Status(status).ClientKey(clientKey).Execute() + +Unlock requests in last task run's default request queue + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + actorTaskId := "janedoe~my-task" // string | Task ID or a tilde-separated owner's username and task's name. + status := "SUCCEEDED" // string | Filter for the run status. (optional) + clientKey := "client-abc" // string | A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.LastActorTaskRunsDefaultRequestQueueAPI.ActorTaskRunsLastRequestQueueRequestsUnlockPost(context.Background(), actorTaskId).Status(status).ClientKey(clientKey).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `LastActorTaskRunsDefaultRequestQueueAPI.ActorTaskRunsLastRequestQueueRequestsUnlockPost``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ActorTaskRunsLastRequestQueueRequestsUnlockPost`: UnlockRequestsResponse + fmt.Fprintf(os.Stdout, "Response from `LastActorTaskRunsDefaultRequestQueueAPI.ActorTaskRunsLastRequestQueueRequestsUnlockPost`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**actorTaskId** | **string** | Task ID or a tilde-separated owner's username and task's name. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiActorTaskRunsLastRequestQueueRequestsUnlockPostRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **status** | **string** | Filter for the run status. | + **clientKey** | **string** | A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. | + +### Return type + +[**UnlockRequestsResponse**](UnlockRequestsResponse.md) + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/docs/LastActorTaskRunsLogAPI.md b/docs/LastActorTaskRunsLogAPI.md new file mode 100644 index 0000000..2d808b9 --- /dev/null +++ b/docs/LastActorTaskRunsLogAPI.md @@ -0,0 +1,85 @@ +# \LastActorTaskRunsLogAPI + +All URIs are relative to *https://api.apify.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**ActorTaskLastLogGet**](LastActorTaskRunsLogAPI.md#ActorTaskLastLogGet) | **Get** /v2/actor-tasks/{actorTaskId}/runs/last/log | Get last Actor task run's log + + + +## ActorTaskLastLogGet + +> string ActorTaskLastLogGet(ctx, actorTaskId).Stream(stream).Download(download).Raw(raw).Execute() + +Get last Actor task run's log + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + actorTaskId := "janedoe~my-task" // string | Task ID or a tilde-separated owner's username and task's name. + stream := false // bool | If `true` or `1` then the logs will be streamed as long as the run or build is running. (optional) + download := false // bool | If `true` or `1` then the web browser will download the log file rather than open it in a tab. (optional) + raw := false // bool | If `true` or `1`, the logs will be kept verbatim. By default, the API removes ANSI escape codes from the logs, keeping only printable characters. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.LastActorTaskRunsLogAPI.ActorTaskLastLogGet(context.Background(), actorTaskId).Stream(stream).Download(download).Raw(raw).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `LastActorTaskRunsLogAPI.ActorTaskLastLogGet``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ActorTaskLastLogGet`: string + fmt.Fprintf(os.Stdout, "Response from `LastActorTaskRunsLogAPI.ActorTaskLastLogGet`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**actorTaskId** | **string** | Task ID or a tilde-separated owner's username and task's name. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiActorTaskLastLogGetRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **stream** | **bool** | If `true` or `1` then the logs will be streamed as long as the run or build is running. | + **download** | **bool** | If `true` or `1` then the web browser will download the log file rather than open it in a tab. | + **raw** | **bool** | If `true` or `1`, the logs will be kept verbatim. By default, the API removes ANSI escape codes from the logs, keeping only printable characters. | + +### Return type + +**string** + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: text/plain, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/docs/LastActorTaskRunsMetamorphAPI.md b/docs/LastActorTaskRunsMetamorphAPI.md new file mode 100644 index 0000000..cb685ab --- /dev/null +++ b/docs/LastActorTaskRunsMetamorphAPI.md @@ -0,0 +1,85 @@ +# \LastActorTaskRunsMetamorphAPI + +All URIs are relative to *https://api.apify.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**ActorTaskRunsLastMetamorphPost**](LastActorTaskRunsMetamorphAPI.md#ActorTaskRunsLastMetamorphPost) | **Post** /v2/actor-tasks/{actorTaskId}/runs/last/metamorph | Metamorph Actor task's last run + + + +## ActorTaskRunsLastMetamorphPost + +> RunResponse ActorTaskRunsLastMetamorphPost(ctx, actorTaskId).TargetActorId(targetActorId).Status(status).Build(build).Execute() + +Metamorph Actor task's last run + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + actorTaskId := "janedoe~my-task" // string | Task ID or a tilde-separated owner's username and task's name. + targetActorId := "HDSasDasz78YcAPEB" // string | ID of a target Actor that the run should be transformed into. + status := "SUCCEEDED" // string | Filter for the run status. (optional) + build := "beta" // string | Optional build of the target Actor. It can be either a build tag or build number. By default, the run uses the build specified in the default run configuration for the target Actor (typically `latest`). (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.LastActorTaskRunsMetamorphAPI.ActorTaskRunsLastMetamorphPost(context.Background(), actorTaskId).TargetActorId(targetActorId).Status(status).Build(build).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `LastActorTaskRunsMetamorphAPI.ActorTaskRunsLastMetamorphPost``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ActorTaskRunsLastMetamorphPost`: RunResponse + fmt.Fprintf(os.Stdout, "Response from `LastActorTaskRunsMetamorphAPI.ActorTaskRunsLastMetamorphPost`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**actorTaskId** | **string** | Task ID or a tilde-separated owner's username and task's name. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiActorTaskRunsLastMetamorphPostRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **targetActorId** | **string** | ID of a target Actor that the run should be transformed into. | + **status** | **string** | Filter for the run status. | + **build** | **string** | Optional build of the target Actor. It can be either a build tag or build number. By default, the run uses the build specified in the default run configuration for the target Actor (typically `latest`). | + +### Return type + +[**RunResponse**](RunResponse.md) + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/docs/LastActorTaskRunsRebootAPI.md b/docs/LastActorTaskRunsRebootAPI.md new file mode 100644 index 0000000..1f514b7 --- /dev/null +++ b/docs/LastActorTaskRunsRebootAPI.md @@ -0,0 +1,81 @@ +# \LastActorTaskRunsRebootAPI + +All URIs are relative to *https://api.apify.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**ActorTaskRunsLastRebootPost**](LastActorTaskRunsRebootAPI.md#ActorTaskRunsLastRebootPost) | **Post** /v2/actor-tasks/{actorTaskId}/runs/last/reboot | Reboot Actor task's last run + + + +## ActorTaskRunsLastRebootPost + +> RunResponse ActorTaskRunsLastRebootPost(ctx, actorTaskId).Status(status).Execute() + +Reboot Actor task's last run + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + actorTaskId := "janedoe~my-task" // string | Task ID or a tilde-separated owner's username and task's name. + status := "SUCCEEDED" // string | Filter for the run status. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.LastActorTaskRunsRebootAPI.ActorTaskRunsLastRebootPost(context.Background(), actorTaskId).Status(status).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `LastActorTaskRunsRebootAPI.ActorTaskRunsLastRebootPost``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ActorTaskRunsLastRebootPost`: RunResponse + fmt.Fprintf(os.Stdout, "Response from `LastActorTaskRunsRebootAPI.ActorTaskRunsLastRebootPost`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**actorTaskId** | **string** | Task ID or a tilde-separated owner's username and task's name. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiActorTaskRunsLastRebootPostRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **status** | **string** | Filter for the run status. | + +### Return type + +[**RunResponse**](RunResponse.md) + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/docs/Limits.md b/docs/Limits.md new file mode 100644 index 0000000..f807cda --- /dev/null +++ b/docs/Limits.md @@ -0,0 +1,287 @@ +# Limits + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**MaxMonthlyUsageUsd** | **float32** | | +**MaxMonthlyActorComputeUnits** | **float32** | | +**MaxMonthlyExternalDataTransferGbytes** | **float32** | | +**MaxMonthlyProxySerps** | **int32** | | +**MaxMonthlyResidentialProxyGbytes** | **float32** | | +**MaxActorMemoryGbytes** | **float32** | | +**MaxActorCount** | **int32** | | +**MaxActorTaskCount** | **int32** | | +**MaxConcurrentActorJobs** | **int32** | | +**MaxTeamAccountSeatCount** | **int32** | | +**DataRetentionDays** | **int32** | | +**MaxScheduleCount** | Pointer to **int32** | | [optional] + +## Methods + +### NewLimits + +`func NewLimits(maxMonthlyUsageUsd float32, maxMonthlyActorComputeUnits float32, maxMonthlyExternalDataTransferGbytes float32, maxMonthlyProxySerps int32, maxMonthlyResidentialProxyGbytes float32, maxActorMemoryGbytes float32, maxActorCount int32, maxActorTaskCount int32, maxConcurrentActorJobs int32, maxTeamAccountSeatCount int32, dataRetentionDays int32, ) *Limits` + +NewLimits instantiates a new Limits object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewLimitsWithDefaults + +`func NewLimitsWithDefaults() *Limits` + +NewLimitsWithDefaults instantiates a new Limits object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetMaxMonthlyUsageUsd + +`func (o *Limits) GetMaxMonthlyUsageUsd() float32` + +GetMaxMonthlyUsageUsd returns the MaxMonthlyUsageUsd field if non-nil, zero value otherwise. + +### GetMaxMonthlyUsageUsdOk + +`func (o *Limits) GetMaxMonthlyUsageUsdOk() (*float32, bool)` + +GetMaxMonthlyUsageUsdOk returns a tuple with the MaxMonthlyUsageUsd field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMaxMonthlyUsageUsd + +`func (o *Limits) SetMaxMonthlyUsageUsd(v float32)` + +SetMaxMonthlyUsageUsd sets MaxMonthlyUsageUsd field to given value. + + +### GetMaxMonthlyActorComputeUnits + +`func (o *Limits) GetMaxMonthlyActorComputeUnits() float32` + +GetMaxMonthlyActorComputeUnits returns the MaxMonthlyActorComputeUnits field if non-nil, zero value otherwise. + +### GetMaxMonthlyActorComputeUnitsOk + +`func (o *Limits) GetMaxMonthlyActorComputeUnitsOk() (*float32, bool)` + +GetMaxMonthlyActorComputeUnitsOk returns a tuple with the MaxMonthlyActorComputeUnits field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMaxMonthlyActorComputeUnits + +`func (o *Limits) SetMaxMonthlyActorComputeUnits(v float32)` + +SetMaxMonthlyActorComputeUnits sets MaxMonthlyActorComputeUnits field to given value. + + +### GetMaxMonthlyExternalDataTransferGbytes + +`func (o *Limits) GetMaxMonthlyExternalDataTransferGbytes() float32` + +GetMaxMonthlyExternalDataTransferGbytes returns the MaxMonthlyExternalDataTransferGbytes field if non-nil, zero value otherwise. + +### GetMaxMonthlyExternalDataTransferGbytesOk + +`func (o *Limits) GetMaxMonthlyExternalDataTransferGbytesOk() (*float32, bool)` + +GetMaxMonthlyExternalDataTransferGbytesOk returns a tuple with the MaxMonthlyExternalDataTransferGbytes field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMaxMonthlyExternalDataTransferGbytes + +`func (o *Limits) SetMaxMonthlyExternalDataTransferGbytes(v float32)` + +SetMaxMonthlyExternalDataTransferGbytes sets MaxMonthlyExternalDataTransferGbytes field to given value. + + +### GetMaxMonthlyProxySerps + +`func (o *Limits) GetMaxMonthlyProxySerps() int32` + +GetMaxMonthlyProxySerps returns the MaxMonthlyProxySerps field if non-nil, zero value otherwise. + +### GetMaxMonthlyProxySerpsOk + +`func (o *Limits) GetMaxMonthlyProxySerpsOk() (*int32, bool)` + +GetMaxMonthlyProxySerpsOk returns a tuple with the MaxMonthlyProxySerps field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMaxMonthlyProxySerps + +`func (o *Limits) SetMaxMonthlyProxySerps(v int32)` + +SetMaxMonthlyProxySerps sets MaxMonthlyProxySerps field to given value. + + +### GetMaxMonthlyResidentialProxyGbytes + +`func (o *Limits) GetMaxMonthlyResidentialProxyGbytes() float32` + +GetMaxMonthlyResidentialProxyGbytes returns the MaxMonthlyResidentialProxyGbytes field if non-nil, zero value otherwise. + +### GetMaxMonthlyResidentialProxyGbytesOk + +`func (o *Limits) GetMaxMonthlyResidentialProxyGbytesOk() (*float32, bool)` + +GetMaxMonthlyResidentialProxyGbytesOk returns a tuple with the MaxMonthlyResidentialProxyGbytes field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMaxMonthlyResidentialProxyGbytes + +`func (o *Limits) SetMaxMonthlyResidentialProxyGbytes(v float32)` + +SetMaxMonthlyResidentialProxyGbytes sets MaxMonthlyResidentialProxyGbytes field to given value. + + +### GetMaxActorMemoryGbytes + +`func (o *Limits) GetMaxActorMemoryGbytes() float32` + +GetMaxActorMemoryGbytes returns the MaxActorMemoryGbytes field if non-nil, zero value otherwise. + +### GetMaxActorMemoryGbytesOk + +`func (o *Limits) GetMaxActorMemoryGbytesOk() (*float32, bool)` + +GetMaxActorMemoryGbytesOk returns a tuple with the MaxActorMemoryGbytes field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMaxActorMemoryGbytes + +`func (o *Limits) SetMaxActorMemoryGbytes(v float32)` + +SetMaxActorMemoryGbytes sets MaxActorMemoryGbytes field to given value. + + +### GetMaxActorCount + +`func (o *Limits) GetMaxActorCount() int32` + +GetMaxActorCount returns the MaxActorCount field if non-nil, zero value otherwise. + +### GetMaxActorCountOk + +`func (o *Limits) GetMaxActorCountOk() (*int32, bool)` + +GetMaxActorCountOk returns a tuple with the MaxActorCount field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMaxActorCount + +`func (o *Limits) SetMaxActorCount(v int32)` + +SetMaxActorCount sets MaxActorCount field to given value. + + +### GetMaxActorTaskCount + +`func (o *Limits) GetMaxActorTaskCount() int32` + +GetMaxActorTaskCount returns the MaxActorTaskCount field if non-nil, zero value otherwise. + +### GetMaxActorTaskCountOk + +`func (o *Limits) GetMaxActorTaskCountOk() (*int32, bool)` + +GetMaxActorTaskCountOk returns a tuple with the MaxActorTaskCount field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMaxActorTaskCount + +`func (o *Limits) SetMaxActorTaskCount(v int32)` + +SetMaxActorTaskCount sets MaxActorTaskCount field to given value. + + +### GetMaxConcurrentActorJobs + +`func (o *Limits) GetMaxConcurrentActorJobs() int32` + +GetMaxConcurrentActorJobs returns the MaxConcurrentActorJobs field if non-nil, zero value otherwise. + +### GetMaxConcurrentActorJobsOk + +`func (o *Limits) GetMaxConcurrentActorJobsOk() (*int32, bool)` + +GetMaxConcurrentActorJobsOk returns a tuple with the MaxConcurrentActorJobs field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMaxConcurrentActorJobs + +`func (o *Limits) SetMaxConcurrentActorJobs(v int32)` + +SetMaxConcurrentActorJobs sets MaxConcurrentActorJobs field to given value. + + +### GetMaxTeamAccountSeatCount + +`func (o *Limits) GetMaxTeamAccountSeatCount() int32` + +GetMaxTeamAccountSeatCount returns the MaxTeamAccountSeatCount field if non-nil, zero value otherwise. + +### GetMaxTeamAccountSeatCountOk + +`func (o *Limits) GetMaxTeamAccountSeatCountOk() (*int32, bool)` + +GetMaxTeamAccountSeatCountOk returns a tuple with the MaxTeamAccountSeatCount field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMaxTeamAccountSeatCount + +`func (o *Limits) SetMaxTeamAccountSeatCount(v int32)` + +SetMaxTeamAccountSeatCount sets MaxTeamAccountSeatCount field to given value. + + +### GetDataRetentionDays + +`func (o *Limits) GetDataRetentionDays() int32` + +GetDataRetentionDays returns the DataRetentionDays field if non-nil, zero value otherwise. + +### GetDataRetentionDaysOk + +`func (o *Limits) GetDataRetentionDaysOk() (*int32, bool)` + +GetDataRetentionDaysOk returns a tuple with the DataRetentionDays field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDataRetentionDays + +`func (o *Limits) SetDataRetentionDays(v int32)` + +SetDataRetentionDays sets DataRetentionDays field to given value. + + +### GetMaxScheduleCount + +`func (o *Limits) GetMaxScheduleCount() int32` + +GetMaxScheduleCount returns the MaxScheduleCount field if non-nil, zero value otherwise. + +### GetMaxScheduleCountOk + +`func (o *Limits) GetMaxScheduleCountOk() (*int32, bool)` + +GetMaxScheduleCountOk returns a tuple with the MaxScheduleCount field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMaxScheduleCount + +`func (o *Limits) SetMaxScheduleCount(v int32)` + +SetMaxScheduleCount sets MaxScheduleCount field to given value. + +### HasMaxScheduleCount + +`func (o *Limits) HasMaxScheduleCount() bool` + +HasMaxScheduleCount returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/LimitsResponse.md b/docs/LimitsResponse.md new file mode 100644 index 0000000..0e0bca3 --- /dev/null +++ b/docs/LimitsResponse.md @@ -0,0 +1,51 @@ +# LimitsResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Data** | [**AccountLimits**](AccountLimits.md) | | + +## Methods + +### NewLimitsResponse + +`func NewLimitsResponse(data AccountLimits, ) *LimitsResponse` + +NewLimitsResponse instantiates a new LimitsResponse object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewLimitsResponseWithDefaults + +`func NewLimitsResponseWithDefaults() *LimitsResponse` + +NewLimitsResponseWithDefaults instantiates a new LimitsResponse object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetData + +`func (o *LimitsResponse) GetData() AccountLimits` + +GetData returns the Data field if non-nil, zero value otherwise. + +### GetDataOk + +`func (o *LimitsResponse) GetDataOk() (*AccountLimits, bool)` + +GetDataOk returns a tuple with the Data field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetData + +`func (o *LimitsResponse) SetData(v AccountLimits)` + +SetData sets Data field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ListOfActors.md b/docs/ListOfActors.md new file mode 100644 index 0000000..ee4559b --- /dev/null +++ b/docs/ListOfActors.md @@ -0,0 +1,156 @@ +# ListOfActors + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Total** | **int32** | The total number of items available across all pages. | +**Offset** | **int32** | The starting position for this page of results. | +**Limit** | **int32** | The maximum number of items returned per page. | +**Desc** | **bool** | Whether the results are sorted in descending order. | +**Count** | **int32** | The number of items returned in this response. | +**Items** | [**[]ActorShort**](ActorShort.md) | | + +## Methods + +### NewListOfActors + +`func NewListOfActors(total int32, offset int32, limit int32, desc bool, count int32, items []ActorShort, ) *ListOfActors` + +NewListOfActors instantiates a new ListOfActors object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewListOfActorsWithDefaults + +`func NewListOfActorsWithDefaults() *ListOfActors` + +NewListOfActorsWithDefaults instantiates a new ListOfActors object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetTotal + +`func (o *ListOfActors) GetTotal() int32` + +GetTotal returns the Total field if non-nil, zero value otherwise. + +### GetTotalOk + +`func (o *ListOfActors) GetTotalOk() (*int32, bool)` + +GetTotalOk returns a tuple with the Total field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTotal + +`func (o *ListOfActors) SetTotal(v int32)` + +SetTotal sets Total field to given value. + + +### GetOffset + +`func (o *ListOfActors) GetOffset() int32` + +GetOffset returns the Offset field if non-nil, zero value otherwise. + +### GetOffsetOk + +`func (o *ListOfActors) GetOffsetOk() (*int32, bool)` + +GetOffsetOk returns a tuple with the Offset field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetOffset + +`func (o *ListOfActors) SetOffset(v int32)` + +SetOffset sets Offset field to given value. + + +### GetLimit + +`func (o *ListOfActors) GetLimit() int32` + +GetLimit returns the Limit field if non-nil, zero value otherwise. + +### GetLimitOk + +`func (o *ListOfActors) GetLimitOk() (*int32, bool)` + +GetLimitOk returns a tuple with the Limit field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetLimit + +`func (o *ListOfActors) SetLimit(v int32)` + +SetLimit sets Limit field to given value. + + +### GetDesc + +`func (o *ListOfActors) GetDesc() bool` + +GetDesc returns the Desc field if non-nil, zero value otherwise. + +### GetDescOk + +`func (o *ListOfActors) GetDescOk() (*bool, bool)` + +GetDescOk returns a tuple with the Desc field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDesc + +`func (o *ListOfActors) SetDesc(v bool)` + +SetDesc sets Desc field to given value. + + +### GetCount + +`func (o *ListOfActors) GetCount() int32` + +GetCount returns the Count field if non-nil, zero value otherwise. + +### GetCountOk + +`func (o *ListOfActors) GetCountOk() (*int32, bool)` + +GetCountOk returns a tuple with the Count field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCount + +`func (o *ListOfActors) SetCount(v int32)` + +SetCount sets Count field to given value. + + +### GetItems + +`func (o *ListOfActors) GetItems() []ActorShort` + +GetItems returns the Items field if non-nil, zero value otherwise. + +### GetItemsOk + +`func (o *ListOfActors) GetItemsOk() (*[]ActorShort, bool)` + +GetItemsOk returns a tuple with the Items field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetItems + +`func (o *ListOfActors) SetItems(v []ActorShort)` + +SetItems sets Items field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ListOfActorsInStoreResponse.md b/docs/ListOfActorsInStoreResponse.md new file mode 100644 index 0000000..a786872 --- /dev/null +++ b/docs/ListOfActorsInStoreResponse.md @@ -0,0 +1,51 @@ +# ListOfActorsInStoreResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Data** | [**ListOfStoreActors**](ListOfStoreActors.md) | | + +## Methods + +### NewListOfActorsInStoreResponse + +`func NewListOfActorsInStoreResponse(data ListOfStoreActors, ) *ListOfActorsInStoreResponse` + +NewListOfActorsInStoreResponse instantiates a new ListOfActorsInStoreResponse object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewListOfActorsInStoreResponseWithDefaults + +`func NewListOfActorsInStoreResponseWithDefaults() *ListOfActorsInStoreResponse` + +NewListOfActorsInStoreResponseWithDefaults instantiates a new ListOfActorsInStoreResponse object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetData + +`func (o *ListOfActorsInStoreResponse) GetData() ListOfStoreActors` + +GetData returns the Data field if non-nil, zero value otherwise. + +### GetDataOk + +`func (o *ListOfActorsInStoreResponse) GetDataOk() (*ListOfStoreActors, bool)` + +GetDataOk returns a tuple with the Data field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetData + +`func (o *ListOfActorsInStoreResponse) SetData(v ListOfStoreActors)` + +SetData sets Data field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ListOfActorsResponse.md b/docs/ListOfActorsResponse.md new file mode 100644 index 0000000..3152e69 --- /dev/null +++ b/docs/ListOfActorsResponse.md @@ -0,0 +1,51 @@ +# ListOfActorsResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Data** | [**ListOfActors**](ListOfActors.md) | | + +## Methods + +### NewListOfActorsResponse + +`func NewListOfActorsResponse(data ListOfActors, ) *ListOfActorsResponse` + +NewListOfActorsResponse instantiates a new ListOfActorsResponse object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewListOfActorsResponseWithDefaults + +`func NewListOfActorsResponseWithDefaults() *ListOfActorsResponse` + +NewListOfActorsResponseWithDefaults instantiates a new ListOfActorsResponse object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetData + +`func (o *ListOfActorsResponse) GetData() ListOfActors` + +GetData returns the Data field if non-nil, zero value otherwise. + +### GetDataOk + +`func (o *ListOfActorsResponse) GetDataOk() (*ListOfActors, bool)` + +GetDataOk returns a tuple with the Data field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetData + +`func (o *ListOfActorsResponse) SetData(v ListOfActors)` + +SetData sets Data field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ListOfBuilds.md b/docs/ListOfBuilds.md new file mode 100644 index 0000000..36c2a8a --- /dev/null +++ b/docs/ListOfBuilds.md @@ -0,0 +1,156 @@ +# ListOfBuilds + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Total** | **int32** | The total number of items available across all pages. | +**Offset** | **int32** | The starting position for this page of results. | +**Limit** | **int32** | The maximum number of items returned per page. | +**Desc** | **bool** | Whether the results are sorted in descending order. | +**Count** | **int32** | The number of items returned in this response. | +**Items** | [**[]BuildShort**](BuildShort.md) | | + +## Methods + +### NewListOfBuilds + +`func NewListOfBuilds(total int32, offset int32, limit int32, desc bool, count int32, items []BuildShort, ) *ListOfBuilds` + +NewListOfBuilds instantiates a new ListOfBuilds object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewListOfBuildsWithDefaults + +`func NewListOfBuildsWithDefaults() *ListOfBuilds` + +NewListOfBuildsWithDefaults instantiates a new ListOfBuilds object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetTotal + +`func (o *ListOfBuilds) GetTotal() int32` + +GetTotal returns the Total field if non-nil, zero value otherwise. + +### GetTotalOk + +`func (o *ListOfBuilds) GetTotalOk() (*int32, bool)` + +GetTotalOk returns a tuple with the Total field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTotal + +`func (o *ListOfBuilds) SetTotal(v int32)` + +SetTotal sets Total field to given value. + + +### GetOffset + +`func (o *ListOfBuilds) GetOffset() int32` + +GetOffset returns the Offset field if non-nil, zero value otherwise. + +### GetOffsetOk + +`func (o *ListOfBuilds) GetOffsetOk() (*int32, bool)` + +GetOffsetOk returns a tuple with the Offset field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetOffset + +`func (o *ListOfBuilds) SetOffset(v int32)` + +SetOffset sets Offset field to given value. + + +### GetLimit + +`func (o *ListOfBuilds) GetLimit() int32` + +GetLimit returns the Limit field if non-nil, zero value otherwise. + +### GetLimitOk + +`func (o *ListOfBuilds) GetLimitOk() (*int32, bool)` + +GetLimitOk returns a tuple with the Limit field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetLimit + +`func (o *ListOfBuilds) SetLimit(v int32)` + +SetLimit sets Limit field to given value. + + +### GetDesc + +`func (o *ListOfBuilds) GetDesc() bool` + +GetDesc returns the Desc field if non-nil, zero value otherwise. + +### GetDescOk + +`func (o *ListOfBuilds) GetDescOk() (*bool, bool)` + +GetDescOk returns a tuple with the Desc field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDesc + +`func (o *ListOfBuilds) SetDesc(v bool)` + +SetDesc sets Desc field to given value. + + +### GetCount + +`func (o *ListOfBuilds) GetCount() int32` + +GetCount returns the Count field if non-nil, zero value otherwise. + +### GetCountOk + +`func (o *ListOfBuilds) GetCountOk() (*int32, bool)` + +GetCountOk returns a tuple with the Count field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCount + +`func (o *ListOfBuilds) SetCount(v int32)` + +SetCount sets Count field to given value. + + +### GetItems + +`func (o *ListOfBuilds) GetItems() []BuildShort` + +GetItems returns the Items field if non-nil, zero value otherwise. + +### GetItemsOk + +`func (o *ListOfBuilds) GetItemsOk() (*[]BuildShort, bool)` + +GetItemsOk returns a tuple with the Items field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetItems + +`func (o *ListOfBuilds) SetItems(v []BuildShort)` + +SetItems sets Items field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ListOfBuildsResponse.md b/docs/ListOfBuildsResponse.md new file mode 100644 index 0000000..4ce57f8 --- /dev/null +++ b/docs/ListOfBuildsResponse.md @@ -0,0 +1,51 @@ +# ListOfBuildsResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Data** | [**ListOfBuilds**](ListOfBuilds.md) | | + +## Methods + +### NewListOfBuildsResponse + +`func NewListOfBuildsResponse(data ListOfBuilds, ) *ListOfBuildsResponse` + +NewListOfBuildsResponse instantiates a new ListOfBuildsResponse object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewListOfBuildsResponseWithDefaults + +`func NewListOfBuildsResponseWithDefaults() *ListOfBuildsResponse` + +NewListOfBuildsResponseWithDefaults instantiates a new ListOfBuildsResponse object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetData + +`func (o *ListOfBuildsResponse) GetData() ListOfBuilds` + +GetData returns the Data field if non-nil, zero value otherwise. + +### GetDataOk + +`func (o *ListOfBuildsResponse) GetDataOk() (*ListOfBuilds, bool)` + +GetDataOk returns a tuple with the Data field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetData + +`func (o *ListOfBuildsResponse) SetData(v ListOfBuilds)` + +SetData sets Data field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ListOfDatasets.md b/docs/ListOfDatasets.md new file mode 100644 index 0000000..fc5e8e7 --- /dev/null +++ b/docs/ListOfDatasets.md @@ -0,0 +1,182 @@ +# ListOfDatasets + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Total** | **int32** | The total number of items available across all pages. | +**Offset** | **int32** | The starting position for this page of results. | +**Limit** | **int32** | The maximum number of items returned per page. | +**Desc** | **bool** | Whether the results are sorted in descending order. | +**Count** | **int32** | The number of items returned in this response. | +**Unnamed** | Pointer to **bool** | Whether the listing was filtered to only unnamed datasets. | [optional] +**Items** | [**[]DatasetListItem**](DatasetListItem.md) | | + +## Methods + +### NewListOfDatasets + +`func NewListOfDatasets(total int32, offset int32, limit int32, desc bool, count int32, items []DatasetListItem, ) *ListOfDatasets` + +NewListOfDatasets instantiates a new ListOfDatasets object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewListOfDatasetsWithDefaults + +`func NewListOfDatasetsWithDefaults() *ListOfDatasets` + +NewListOfDatasetsWithDefaults instantiates a new ListOfDatasets object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetTotal + +`func (o *ListOfDatasets) GetTotal() int32` + +GetTotal returns the Total field if non-nil, zero value otherwise. + +### GetTotalOk + +`func (o *ListOfDatasets) GetTotalOk() (*int32, bool)` + +GetTotalOk returns a tuple with the Total field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTotal + +`func (o *ListOfDatasets) SetTotal(v int32)` + +SetTotal sets Total field to given value. + + +### GetOffset + +`func (o *ListOfDatasets) GetOffset() int32` + +GetOffset returns the Offset field if non-nil, zero value otherwise. + +### GetOffsetOk + +`func (o *ListOfDatasets) GetOffsetOk() (*int32, bool)` + +GetOffsetOk returns a tuple with the Offset field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetOffset + +`func (o *ListOfDatasets) SetOffset(v int32)` + +SetOffset sets Offset field to given value. + + +### GetLimit + +`func (o *ListOfDatasets) GetLimit() int32` + +GetLimit returns the Limit field if non-nil, zero value otherwise. + +### GetLimitOk + +`func (o *ListOfDatasets) GetLimitOk() (*int32, bool)` + +GetLimitOk returns a tuple with the Limit field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetLimit + +`func (o *ListOfDatasets) SetLimit(v int32)` + +SetLimit sets Limit field to given value. + + +### GetDesc + +`func (o *ListOfDatasets) GetDesc() bool` + +GetDesc returns the Desc field if non-nil, zero value otherwise. + +### GetDescOk + +`func (o *ListOfDatasets) GetDescOk() (*bool, bool)` + +GetDescOk returns a tuple with the Desc field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDesc + +`func (o *ListOfDatasets) SetDesc(v bool)` + +SetDesc sets Desc field to given value. + + +### GetCount + +`func (o *ListOfDatasets) GetCount() int32` + +GetCount returns the Count field if non-nil, zero value otherwise. + +### GetCountOk + +`func (o *ListOfDatasets) GetCountOk() (*int32, bool)` + +GetCountOk returns a tuple with the Count field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCount + +`func (o *ListOfDatasets) SetCount(v int32)` + +SetCount sets Count field to given value. + + +### GetUnnamed + +`func (o *ListOfDatasets) GetUnnamed() bool` + +GetUnnamed returns the Unnamed field if non-nil, zero value otherwise. + +### GetUnnamedOk + +`func (o *ListOfDatasets) GetUnnamedOk() (*bool, bool)` + +GetUnnamedOk returns a tuple with the Unnamed field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUnnamed + +`func (o *ListOfDatasets) SetUnnamed(v bool)` + +SetUnnamed sets Unnamed field to given value. + +### HasUnnamed + +`func (o *ListOfDatasets) HasUnnamed() bool` + +HasUnnamed returns a boolean if a field has been set. + +### GetItems + +`func (o *ListOfDatasets) GetItems() []DatasetListItem` + +GetItems returns the Items field if non-nil, zero value otherwise. + +### GetItemsOk + +`func (o *ListOfDatasets) GetItemsOk() (*[]DatasetListItem, bool)` + +GetItemsOk returns a tuple with the Items field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetItems + +`func (o *ListOfDatasets) SetItems(v []DatasetListItem)` + +SetItems sets Items field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ListOfDatasetsResponse.md b/docs/ListOfDatasetsResponse.md new file mode 100644 index 0000000..b2bb55e --- /dev/null +++ b/docs/ListOfDatasetsResponse.md @@ -0,0 +1,51 @@ +# ListOfDatasetsResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Data** | [**ListOfDatasets**](ListOfDatasets.md) | | + +## Methods + +### NewListOfDatasetsResponse + +`func NewListOfDatasetsResponse(data ListOfDatasets, ) *ListOfDatasetsResponse` + +NewListOfDatasetsResponse instantiates a new ListOfDatasetsResponse object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewListOfDatasetsResponseWithDefaults + +`func NewListOfDatasetsResponseWithDefaults() *ListOfDatasetsResponse` + +NewListOfDatasetsResponseWithDefaults instantiates a new ListOfDatasetsResponse object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetData + +`func (o *ListOfDatasetsResponse) GetData() ListOfDatasets` + +GetData returns the Data field if non-nil, zero value otherwise. + +### GetDataOk + +`func (o *ListOfDatasetsResponse) GetDataOk() (*ListOfDatasets, bool)` + +GetDataOk returns a tuple with the Data field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetData + +`func (o *ListOfDatasetsResponse) SetData(v ListOfDatasets)` + +SetData sets Data field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ListOfEnvVars.md b/docs/ListOfEnvVars.md new file mode 100644 index 0000000..b26bcd0 --- /dev/null +++ b/docs/ListOfEnvVars.md @@ -0,0 +1,72 @@ +# ListOfEnvVars + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Total** | **int32** | | +**Items** | [**[]EnvVar**](EnvVar.md) | | + +## Methods + +### NewListOfEnvVars + +`func NewListOfEnvVars(total int32, items []EnvVar, ) *ListOfEnvVars` + +NewListOfEnvVars instantiates a new ListOfEnvVars object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewListOfEnvVarsWithDefaults + +`func NewListOfEnvVarsWithDefaults() *ListOfEnvVars` + +NewListOfEnvVarsWithDefaults instantiates a new ListOfEnvVars object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetTotal + +`func (o *ListOfEnvVars) GetTotal() int32` + +GetTotal returns the Total field if non-nil, zero value otherwise. + +### GetTotalOk + +`func (o *ListOfEnvVars) GetTotalOk() (*int32, bool)` + +GetTotalOk returns a tuple with the Total field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTotal + +`func (o *ListOfEnvVars) SetTotal(v int32)` + +SetTotal sets Total field to given value. + + +### GetItems + +`func (o *ListOfEnvVars) GetItems() []EnvVar` + +GetItems returns the Items field if non-nil, zero value otherwise. + +### GetItemsOk + +`func (o *ListOfEnvVars) GetItemsOk() (*[]EnvVar, bool)` + +GetItemsOk returns a tuple with the Items field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetItems + +`func (o *ListOfEnvVars) SetItems(v []EnvVar)` + +SetItems sets Items field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ListOfEnvVarsResponse.md b/docs/ListOfEnvVarsResponse.md new file mode 100644 index 0000000..e36d5d0 --- /dev/null +++ b/docs/ListOfEnvVarsResponse.md @@ -0,0 +1,51 @@ +# ListOfEnvVarsResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Data** | [**ListOfEnvVars**](ListOfEnvVars.md) | | + +## Methods + +### NewListOfEnvVarsResponse + +`func NewListOfEnvVarsResponse(data ListOfEnvVars, ) *ListOfEnvVarsResponse` + +NewListOfEnvVarsResponse instantiates a new ListOfEnvVarsResponse object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewListOfEnvVarsResponseWithDefaults + +`func NewListOfEnvVarsResponseWithDefaults() *ListOfEnvVarsResponse` + +NewListOfEnvVarsResponseWithDefaults instantiates a new ListOfEnvVarsResponse object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetData + +`func (o *ListOfEnvVarsResponse) GetData() ListOfEnvVars` + +GetData returns the Data field if non-nil, zero value otherwise. + +### GetDataOk + +`func (o *ListOfEnvVarsResponse) GetDataOk() (*ListOfEnvVars, bool)` + +GetDataOk returns a tuple with the Data field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetData + +`func (o *ListOfEnvVarsResponse) SetData(v ListOfEnvVars)` + +SetData sets Data field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ListOfKeyValueStores.md b/docs/ListOfKeyValueStores.md new file mode 100644 index 0000000..75b8f71 --- /dev/null +++ b/docs/ListOfKeyValueStores.md @@ -0,0 +1,182 @@ +# ListOfKeyValueStores + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Total** | **int32** | The total number of items available across all pages. | +**Offset** | **int32** | The starting position for this page of results. | +**Limit** | **int32** | The maximum number of items returned per page. | +**Desc** | **bool** | Whether the results are sorted in descending order. | +**Count** | **int32** | The number of items returned in this response. | +**Unnamed** | Pointer to **bool** | Whether the listing was filtered to only unnamed key-value stores. | [optional] +**Items** | [**[]KeyValueStore**](KeyValueStore.md) | | + +## Methods + +### NewListOfKeyValueStores + +`func NewListOfKeyValueStores(total int32, offset int32, limit int32, desc bool, count int32, items []KeyValueStore, ) *ListOfKeyValueStores` + +NewListOfKeyValueStores instantiates a new ListOfKeyValueStores object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewListOfKeyValueStoresWithDefaults + +`func NewListOfKeyValueStoresWithDefaults() *ListOfKeyValueStores` + +NewListOfKeyValueStoresWithDefaults instantiates a new ListOfKeyValueStores object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetTotal + +`func (o *ListOfKeyValueStores) GetTotal() int32` + +GetTotal returns the Total field if non-nil, zero value otherwise. + +### GetTotalOk + +`func (o *ListOfKeyValueStores) GetTotalOk() (*int32, bool)` + +GetTotalOk returns a tuple with the Total field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTotal + +`func (o *ListOfKeyValueStores) SetTotal(v int32)` + +SetTotal sets Total field to given value. + + +### GetOffset + +`func (o *ListOfKeyValueStores) GetOffset() int32` + +GetOffset returns the Offset field if non-nil, zero value otherwise. + +### GetOffsetOk + +`func (o *ListOfKeyValueStores) GetOffsetOk() (*int32, bool)` + +GetOffsetOk returns a tuple with the Offset field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetOffset + +`func (o *ListOfKeyValueStores) SetOffset(v int32)` + +SetOffset sets Offset field to given value. + + +### GetLimit + +`func (o *ListOfKeyValueStores) GetLimit() int32` + +GetLimit returns the Limit field if non-nil, zero value otherwise. + +### GetLimitOk + +`func (o *ListOfKeyValueStores) GetLimitOk() (*int32, bool)` + +GetLimitOk returns a tuple with the Limit field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetLimit + +`func (o *ListOfKeyValueStores) SetLimit(v int32)` + +SetLimit sets Limit field to given value. + + +### GetDesc + +`func (o *ListOfKeyValueStores) GetDesc() bool` + +GetDesc returns the Desc field if non-nil, zero value otherwise. + +### GetDescOk + +`func (o *ListOfKeyValueStores) GetDescOk() (*bool, bool)` + +GetDescOk returns a tuple with the Desc field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDesc + +`func (o *ListOfKeyValueStores) SetDesc(v bool)` + +SetDesc sets Desc field to given value. + + +### GetCount + +`func (o *ListOfKeyValueStores) GetCount() int32` + +GetCount returns the Count field if non-nil, zero value otherwise. + +### GetCountOk + +`func (o *ListOfKeyValueStores) GetCountOk() (*int32, bool)` + +GetCountOk returns a tuple with the Count field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCount + +`func (o *ListOfKeyValueStores) SetCount(v int32)` + +SetCount sets Count field to given value. + + +### GetUnnamed + +`func (o *ListOfKeyValueStores) GetUnnamed() bool` + +GetUnnamed returns the Unnamed field if non-nil, zero value otherwise. + +### GetUnnamedOk + +`func (o *ListOfKeyValueStores) GetUnnamedOk() (*bool, bool)` + +GetUnnamedOk returns a tuple with the Unnamed field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUnnamed + +`func (o *ListOfKeyValueStores) SetUnnamed(v bool)` + +SetUnnamed sets Unnamed field to given value. + +### HasUnnamed + +`func (o *ListOfKeyValueStores) HasUnnamed() bool` + +HasUnnamed returns a boolean if a field has been set. + +### GetItems + +`func (o *ListOfKeyValueStores) GetItems() []KeyValueStore` + +GetItems returns the Items field if non-nil, zero value otherwise. + +### GetItemsOk + +`func (o *ListOfKeyValueStores) GetItemsOk() (*[]KeyValueStore, bool)` + +GetItemsOk returns a tuple with the Items field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetItems + +`func (o *ListOfKeyValueStores) SetItems(v []KeyValueStore)` + +SetItems sets Items field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ListOfKeyValueStoresResponse.md b/docs/ListOfKeyValueStoresResponse.md new file mode 100644 index 0000000..4319119 --- /dev/null +++ b/docs/ListOfKeyValueStoresResponse.md @@ -0,0 +1,51 @@ +# ListOfKeyValueStoresResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Data** | [**ListOfKeyValueStores**](ListOfKeyValueStores.md) | | + +## Methods + +### NewListOfKeyValueStoresResponse + +`func NewListOfKeyValueStoresResponse(data ListOfKeyValueStores, ) *ListOfKeyValueStoresResponse` + +NewListOfKeyValueStoresResponse instantiates a new ListOfKeyValueStoresResponse object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewListOfKeyValueStoresResponseWithDefaults + +`func NewListOfKeyValueStoresResponseWithDefaults() *ListOfKeyValueStoresResponse` + +NewListOfKeyValueStoresResponseWithDefaults instantiates a new ListOfKeyValueStoresResponse object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetData + +`func (o *ListOfKeyValueStoresResponse) GetData() ListOfKeyValueStores` + +GetData returns the Data field if non-nil, zero value otherwise. + +### GetDataOk + +`func (o *ListOfKeyValueStoresResponse) GetDataOk() (*ListOfKeyValueStores, bool)` + +GetDataOk returns a tuple with the Data field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetData + +`func (o *ListOfKeyValueStoresResponse) SetData(v ListOfKeyValueStores)` + +SetData sets Data field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ListOfKeys.md b/docs/ListOfKeys.md new file mode 100644 index 0000000..1f8e460 --- /dev/null +++ b/docs/ListOfKeys.md @@ -0,0 +1,186 @@ +# ListOfKeys + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Items** | [**[]KeyValueStoreKey**](KeyValueStoreKey.md) | | +**Count** | **int32** | | +**Limit** | **int32** | | +**ExclusiveStartKey** | Pointer to **NullableString** | | [optional] +**IsTruncated** | **bool** | | +**NextExclusiveStartKey** | Pointer to **NullableString** | | [optional] + +## Methods + +### NewListOfKeys + +`func NewListOfKeys(items []KeyValueStoreKey, count int32, limit int32, isTruncated bool, ) *ListOfKeys` + +NewListOfKeys instantiates a new ListOfKeys object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewListOfKeysWithDefaults + +`func NewListOfKeysWithDefaults() *ListOfKeys` + +NewListOfKeysWithDefaults instantiates a new ListOfKeys object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetItems + +`func (o *ListOfKeys) GetItems() []KeyValueStoreKey` + +GetItems returns the Items field if non-nil, zero value otherwise. + +### GetItemsOk + +`func (o *ListOfKeys) GetItemsOk() (*[]KeyValueStoreKey, bool)` + +GetItemsOk returns a tuple with the Items field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetItems + +`func (o *ListOfKeys) SetItems(v []KeyValueStoreKey)` + +SetItems sets Items field to given value. + + +### GetCount + +`func (o *ListOfKeys) GetCount() int32` + +GetCount returns the Count field if non-nil, zero value otherwise. + +### GetCountOk + +`func (o *ListOfKeys) GetCountOk() (*int32, bool)` + +GetCountOk returns a tuple with the Count field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCount + +`func (o *ListOfKeys) SetCount(v int32)` + +SetCount sets Count field to given value. + + +### GetLimit + +`func (o *ListOfKeys) GetLimit() int32` + +GetLimit returns the Limit field if non-nil, zero value otherwise. + +### GetLimitOk + +`func (o *ListOfKeys) GetLimitOk() (*int32, bool)` + +GetLimitOk returns a tuple with the Limit field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetLimit + +`func (o *ListOfKeys) SetLimit(v int32)` + +SetLimit sets Limit field to given value. + + +### GetExclusiveStartKey + +`func (o *ListOfKeys) GetExclusiveStartKey() string` + +GetExclusiveStartKey returns the ExclusiveStartKey field if non-nil, zero value otherwise. + +### GetExclusiveStartKeyOk + +`func (o *ListOfKeys) GetExclusiveStartKeyOk() (*string, bool)` + +GetExclusiveStartKeyOk returns a tuple with the ExclusiveStartKey field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetExclusiveStartKey + +`func (o *ListOfKeys) SetExclusiveStartKey(v string)` + +SetExclusiveStartKey sets ExclusiveStartKey field to given value. + +### HasExclusiveStartKey + +`func (o *ListOfKeys) HasExclusiveStartKey() bool` + +HasExclusiveStartKey returns a boolean if a field has been set. + +### SetExclusiveStartKeyNil + +`func (o *ListOfKeys) SetExclusiveStartKeyNil(b bool)` + + SetExclusiveStartKeyNil sets the value for ExclusiveStartKey to be an explicit nil + +### UnsetExclusiveStartKey +`func (o *ListOfKeys) UnsetExclusiveStartKey()` + +UnsetExclusiveStartKey ensures that no value is present for ExclusiveStartKey, not even an explicit nil +### GetIsTruncated + +`func (o *ListOfKeys) GetIsTruncated() bool` + +GetIsTruncated returns the IsTruncated field if non-nil, zero value otherwise. + +### GetIsTruncatedOk + +`func (o *ListOfKeys) GetIsTruncatedOk() (*bool, bool)` + +GetIsTruncatedOk returns a tuple with the IsTruncated field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetIsTruncated + +`func (o *ListOfKeys) SetIsTruncated(v bool)` + +SetIsTruncated sets IsTruncated field to given value. + + +### GetNextExclusiveStartKey + +`func (o *ListOfKeys) GetNextExclusiveStartKey() string` + +GetNextExclusiveStartKey returns the NextExclusiveStartKey field if non-nil, zero value otherwise. + +### GetNextExclusiveStartKeyOk + +`func (o *ListOfKeys) GetNextExclusiveStartKeyOk() (*string, bool)` + +GetNextExclusiveStartKeyOk returns a tuple with the NextExclusiveStartKey field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetNextExclusiveStartKey + +`func (o *ListOfKeys) SetNextExclusiveStartKey(v string)` + +SetNextExclusiveStartKey sets NextExclusiveStartKey field to given value. + +### HasNextExclusiveStartKey + +`func (o *ListOfKeys) HasNextExclusiveStartKey() bool` + +HasNextExclusiveStartKey returns a boolean if a field has been set. + +### SetNextExclusiveStartKeyNil + +`func (o *ListOfKeys) SetNextExclusiveStartKeyNil(b bool)` + + SetNextExclusiveStartKeyNil sets the value for NextExclusiveStartKey to be an explicit nil + +### UnsetNextExclusiveStartKey +`func (o *ListOfKeys) UnsetNextExclusiveStartKey()` + +UnsetNextExclusiveStartKey ensures that no value is present for NextExclusiveStartKey, not even an explicit nil + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ListOfKeysResponse.md b/docs/ListOfKeysResponse.md new file mode 100644 index 0000000..147e3da --- /dev/null +++ b/docs/ListOfKeysResponse.md @@ -0,0 +1,51 @@ +# ListOfKeysResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Data** | [**ListOfKeys**](ListOfKeys.md) | | + +## Methods + +### NewListOfKeysResponse + +`func NewListOfKeysResponse(data ListOfKeys, ) *ListOfKeysResponse` + +NewListOfKeysResponse instantiates a new ListOfKeysResponse object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewListOfKeysResponseWithDefaults + +`func NewListOfKeysResponseWithDefaults() *ListOfKeysResponse` + +NewListOfKeysResponseWithDefaults instantiates a new ListOfKeysResponse object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetData + +`func (o *ListOfKeysResponse) GetData() ListOfKeys` + +GetData returns the Data field if non-nil, zero value otherwise. + +### GetDataOk + +`func (o *ListOfKeysResponse) GetDataOk() (*ListOfKeys, bool)` + +GetDataOk returns a tuple with the Data field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetData + +`func (o *ListOfKeysResponse) SetData(v ListOfKeys)` + +SetData sets Data field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ListOfRequestQueues.md b/docs/ListOfRequestQueues.md new file mode 100644 index 0000000..db6a0a0 --- /dev/null +++ b/docs/ListOfRequestQueues.md @@ -0,0 +1,182 @@ +# ListOfRequestQueues + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Total** | **int32** | The total number of items available across all pages. | +**Offset** | **int32** | The starting position for this page of results. | +**Limit** | **int32** | The maximum number of items returned per page. | +**Desc** | **bool** | Whether the results are sorted in descending order. | +**Count** | **int32** | The number of items returned in this response. | +**Unnamed** | Pointer to **bool** | Whether the listing was filtered to only unnamed request queues. | [optional] +**Items** | [**[]RequestQueueShort**](RequestQueueShort.md) | The array of request queues. | + +## Methods + +### NewListOfRequestQueues + +`func NewListOfRequestQueues(total int32, offset int32, limit int32, desc bool, count int32, items []RequestQueueShort, ) *ListOfRequestQueues` + +NewListOfRequestQueues instantiates a new ListOfRequestQueues object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewListOfRequestQueuesWithDefaults + +`func NewListOfRequestQueuesWithDefaults() *ListOfRequestQueues` + +NewListOfRequestQueuesWithDefaults instantiates a new ListOfRequestQueues object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetTotal + +`func (o *ListOfRequestQueues) GetTotal() int32` + +GetTotal returns the Total field if non-nil, zero value otherwise. + +### GetTotalOk + +`func (o *ListOfRequestQueues) GetTotalOk() (*int32, bool)` + +GetTotalOk returns a tuple with the Total field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTotal + +`func (o *ListOfRequestQueues) SetTotal(v int32)` + +SetTotal sets Total field to given value. + + +### GetOffset + +`func (o *ListOfRequestQueues) GetOffset() int32` + +GetOffset returns the Offset field if non-nil, zero value otherwise. + +### GetOffsetOk + +`func (o *ListOfRequestQueues) GetOffsetOk() (*int32, bool)` + +GetOffsetOk returns a tuple with the Offset field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetOffset + +`func (o *ListOfRequestQueues) SetOffset(v int32)` + +SetOffset sets Offset field to given value. + + +### GetLimit + +`func (o *ListOfRequestQueues) GetLimit() int32` + +GetLimit returns the Limit field if non-nil, zero value otherwise. + +### GetLimitOk + +`func (o *ListOfRequestQueues) GetLimitOk() (*int32, bool)` + +GetLimitOk returns a tuple with the Limit field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetLimit + +`func (o *ListOfRequestQueues) SetLimit(v int32)` + +SetLimit sets Limit field to given value. + + +### GetDesc + +`func (o *ListOfRequestQueues) GetDesc() bool` + +GetDesc returns the Desc field if non-nil, zero value otherwise. + +### GetDescOk + +`func (o *ListOfRequestQueues) GetDescOk() (*bool, bool)` + +GetDescOk returns a tuple with the Desc field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDesc + +`func (o *ListOfRequestQueues) SetDesc(v bool)` + +SetDesc sets Desc field to given value. + + +### GetCount + +`func (o *ListOfRequestQueues) GetCount() int32` + +GetCount returns the Count field if non-nil, zero value otherwise. + +### GetCountOk + +`func (o *ListOfRequestQueues) GetCountOk() (*int32, bool)` + +GetCountOk returns a tuple with the Count field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCount + +`func (o *ListOfRequestQueues) SetCount(v int32)` + +SetCount sets Count field to given value. + + +### GetUnnamed + +`func (o *ListOfRequestQueues) GetUnnamed() bool` + +GetUnnamed returns the Unnamed field if non-nil, zero value otherwise. + +### GetUnnamedOk + +`func (o *ListOfRequestQueues) GetUnnamedOk() (*bool, bool)` + +GetUnnamedOk returns a tuple with the Unnamed field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUnnamed + +`func (o *ListOfRequestQueues) SetUnnamed(v bool)` + +SetUnnamed sets Unnamed field to given value. + +### HasUnnamed + +`func (o *ListOfRequestQueues) HasUnnamed() bool` + +HasUnnamed returns a boolean if a field has been set. + +### GetItems + +`func (o *ListOfRequestQueues) GetItems() []RequestQueueShort` + +GetItems returns the Items field if non-nil, zero value otherwise. + +### GetItemsOk + +`func (o *ListOfRequestQueues) GetItemsOk() (*[]RequestQueueShort, bool)` + +GetItemsOk returns a tuple with the Items field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetItems + +`func (o *ListOfRequestQueues) SetItems(v []RequestQueueShort)` + +SetItems sets Items field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ListOfRequestQueuesResponse.md b/docs/ListOfRequestQueuesResponse.md new file mode 100644 index 0000000..0fd8b57 --- /dev/null +++ b/docs/ListOfRequestQueuesResponse.md @@ -0,0 +1,51 @@ +# ListOfRequestQueuesResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Data** | [**ListOfRequestQueues**](ListOfRequestQueues.md) | | + +## Methods + +### NewListOfRequestQueuesResponse + +`func NewListOfRequestQueuesResponse(data ListOfRequestQueues, ) *ListOfRequestQueuesResponse` + +NewListOfRequestQueuesResponse instantiates a new ListOfRequestQueuesResponse object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewListOfRequestQueuesResponseWithDefaults + +`func NewListOfRequestQueuesResponseWithDefaults() *ListOfRequestQueuesResponse` + +NewListOfRequestQueuesResponseWithDefaults instantiates a new ListOfRequestQueuesResponse object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetData + +`func (o *ListOfRequestQueuesResponse) GetData() ListOfRequestQueues` + +GetData returns the Data field if non-nil, zero value otherwise. + +### GetDataOk + +`func (o *ListOfRequestQueuesResponse) GetDataOk() (*ListOfRequestQueues, bool)` + +GetDataOk returns a tuple with the Data field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetData + +`func (o *ListOfRequestQueuesResponse) SetData(v ListOfRequestQueues)` + +SetData sets Data field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ListOfRequests.md b/docs/ListOfRequests.md new file mode 100644 index 0000000..43cf262 --- /dev/null +++ b/docs/ListOfRequests.md @@ -0,0 +1,150 @@ +# ListOfRequests + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Items** | [**[]Request**](Request.md) | The array of requests. | +**Limit** | **int32** | The maximum number of requests returned in this response. | +**ExclusiveStartId** | Pointer to **string** | The ID of the last request from the previous page, used for pagination. | [optional] +**Cursor** | Pointer to **string** | A cursor string used for current page of results. | [optional] +**NextCursor** | Pointer to **string** | A cursor string to be used to continue pagination. | [optional] + +## Methods + +### NewListOfRequests + +`func NewListOfRequests(items []Request, limit int32, ) *ListOfRequests` + +NewListOfRequests instantiates a new ListOfRequests object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewListOfRequestsWithDefaults + +`func NewListOfRequestsWithDefaults() *ListOfRequests` + +NewListOfRequestsWithDefaults instantiates a new ListOfRequests object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetItems + +`func (o *ListOfRequests) GetItems() []Request` + +GetItems returns the Items field if non-nil, zero value otherwise. + +### GetItemsOk + +`func (o *ListOfRequests) GetItemsOk() (*[]Request, bool)` + +GetItemsOk returns a tuple with the Items field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetItems + +`func (o *ListOfRequests) SetItems(v []Request)` + +SetItems sets Items field to given value. + + +### GetLimit + +`func (o *ListOfRequests) GetLimit() int32` + +GetLimit returns the Limit field if non-nil, zero value otherwise. + +### GetLimitOk + +`func (o *ListOfRequests) GetLimitOk() (*int32, bool)` + +GetLimitOk returns a tuple with the Limit field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetLimit + +`func (o *ListOfRequests) SetLimit(v int32)` + +SetLimit sets Limit field to given value. + + +### GetExclusiveStartId + +`func (o *ListOfRequests) GetExclusiveStartId() string` + +GetExclusiveStartId returns the ExclusiveStartId field if non-nil, zero value otherwise. + +### GetExclusiveStartIdOk + +`func (o *ListOfRequests) GetExclusiveStartIdOk() (*string, bool)` + +GetExclusiveStartIdOk returns a tuple with the ExclusiveStartId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetExclusiveStartId + +`func (o *ListOfRequests) SetExclusiveStartId(v string)` + +SetExclusiveStartId sets ExclusiveStartId field to given value. + +### HasExclusiveStartId + +`func (o *ListOfRequests) HasExclusiveStartId() bool` + +HasExclusiveStartId returns a boolean if a field has been set. + +### GetCursor + +`func (o *ListOfRequests) GetCursor() string` + +GetCursor returns the Cursor field if non-nil, zero value otherwise. + +### GetCursorOk + +`func (o *ListOfRequests) GetCursorOk() (*string, bool)` + +GetCursorOk returns a tuple with the Cursor field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCursor + +`func (o *ListOfRequests) SetCursor(v string)` + +SetCursor sets Cursor field to given value. + +### HasCursor + +`func (o *ListOfRequests) HasCursor() bool` + +HasCursor returns a boolean if a field has been set. + +### GetNextCursor + +`func (o *ListOfRequests) GetNextCursor() string` + +GetNextCursor returns the NextCursor field if non-nil, zero value otherwise. + +### GetNextCursorOk + +`func (o *ListOfRequests) GetNextCursorOk() (*string, bool)` + +GetNextCursorOk returns a tuple with the NextCursor field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetNextCursor + +`func (o *ListOfRequests) SetNextCursor(v string)` + +SetNextCursor sets NextCursor field to given value. + +### HasNextCursor + +`func (o *ListOfRequests) HasNextCursor() bool` + +HasNextCursor returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ListOfRequestsResponse.md b/docs/ListOfRequestsResponse.md new file mode 100644 index 0000000..a2eb1f6 --- /dev/null +++ b/docs/ListOfRequestsResponse.md @@ -0,0 +1,51 @@ +# ListOfRequestsResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Data** | [**ListOfRequests**](ListOfRequests.md) | | + +## Methods + +### NewListOfRequestsResponse + +`func NewListOfRequestsResponse(data ListOfRequests, ) *ListOfRequestsResponse` + +NewListOfRequestsResponse instantiates a new ListOfRequestsResponse object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewListOfRequestsResponseWithDefaults + +`func NewListOfRequestsResponseWithDefaults() *ListOfRequestsResponse` + +NewListOfRequestsResponseWithDefaults instantiates a new ListOfRequestsResponse object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetData + +`func (o *ListOfRequestsResponse) GetData() ListOfRequests` + +GetData returns the Data field if non-nil, zero value otherwise. + +### GetDataOk + +`func (o *ListOfRequestsResponse) GetDataOk() (*ListOfRequests, bool)` + +GetDataOk returns a tuple with the Data field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetData + +`func (o *ListOfRequestsResponse) SetData(v ListOfRequests)` + +SetData sets Data field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ListOfRuns.md b/docs/ListOfRuns.md new file mode 100644 index 0000000..6a8a692 --- /dev/null +++ b/docs/ListOfRuns.md @@ -0,0 +1,156 @@ +# ListOfRuns + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Total** | **int32** | The total number of items available across all pages. | +**Offset** | **int32** | The starting position for this page of results. | +**Limit** | **int32** | The maximum number of items returned per page. | +**Desc** | **bool** | Whether the results are sorted in descending order. | +**Count** | **int32** | The number of items returned in this response. | +**Items** | [**[]RunShort**](RunShort.md) | | + +## Methods + +### NewListOfRuns + +`func NewListOfRuns(total int32, offset int32, limit int32, desc bool, count int32, items []RunShort, ) *ListOfRuns` + +NewListOfRuns instantiates a new ListOfRuns object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewListOfRunsWithDefaults + +`func NewListOfRunsWithDefaults() *ListOfRuns` + +NewListOfRunsWithDefaults instantiates a new ListOfRuns object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetTotal + +`func (o *ListOfRuns) GetTotal() int32` + +GetTotal returns the Total field if non-nil, zero value otherwise. + +### GetTotalOk + +`func (o *ListOfRuns) GetTotalOk() (*int32, bool)` + +GetTotalOk returns a tuple with the Total field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTotal + +`func (o *ListOfRuns) SetTotal(v int32)` + +SetTotal sets Total field to given value. + + +### GetOffset + +`func (o *ListOfRuns) GetOffset() int32` + +GetOffset returns the Offset field if non-nil, zero value otherwise. + +### GetOffsetOk + +`func (o *ListOfRuns) GetOffsetOk() (*int32, bool)` + +GetOffsetOk returns a tuple with the Offset field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetOffset + +`func (o *ListOfRuns) SetOffset(v int32)` + +SetOffset sets Offset field to given value. + + +### GetLimit + +`func (o *ListOfRuns) GetLimit() int32` + +GetLimit returns the Limit field if non-nil, zero value otherwise. + +### GetLimitOk + +`func (o *ListOfRuns) GetLimitOk() (*int32, bool)` + +GetLimitOk returns a tuple with the Limit field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetLimit + +`func (o *ListOfRuns) SetLimit(v int32)` + +SetLimit sets Limit field to given value. + + +### GetDesc + +`func (o *ListOfRuns) GetDesc() bool` + +GetDesc returns the Desc field if non-nil, zero value otherwise. + +### GetDescOk + +`func (o *ListOfRuns) GetDescOk() (*bool, bool)` + +GetDescOk returns a tuple with the Desc field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDesc + +`func (o *ListOfRuns) SetDesc(v bool)` + +SetDesc sets Desc field to given value. + + +### GetCount + +`func (o *ListOfRuns) GetCount() int32` + +GetCount returns the Count field if non-nil, zero value otherwise. + +### GetCountOk + +`func (o *ListOfRuns) GetCountOk() (*int32, bool)` + +GetCountOk returns a tuple with the Count field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCount + +`func (o *ListOfRuns) SetCount(v int32)` + +SetCount sets Count field to given value. + + +### GetItems + +`func (o *ListOfRuns) GetItems() []RunShort` + +GetItems returns the Items field if non-nil, zero value otherwise. + +### GetItemsOk + +`func (o *ListOfRuns) GetItemsOk() (*[]RunShort, bool)` + +GetItemsOk returns a tuple with the Items field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetItems + +`func (o *ListOfRuns) SetItems(v []RunShort)` + +SetItems sets Items field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ListOfRunsResponse.md b/docs/ListOfRunsResponse.md new file mode 100644 index 0000000..e97dbf1 --- /dev/null +++ b/docs/ListOfRunsResponse.md @@ -0,0 +1,51 @@ +# ListOfRunsResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Data** | [**ListOfRuns**](ListOfRuns.md) | | + +## Methods + +### NewListOfRunsResponse + +`func NewListOfRunsResponse(data ListOfRuns, ) *ListOfRunsResponse` + +NewListOfRunsResponse instantiates a new ListOfRunsResponse object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewListOfRunsResponseWithDefaults + +`func NewListOfRunsResponseWithDefaults() *ListOfRunsResponse` + +NewListOfRunsResponseWithDefaults instantiates a new ListOfRunsResponse object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetData + +`func (o *ListOfRunsResponse) GetData() ListOfRuns` + +GetData returns the Data field if non-nil, zero value otherwise. + +### GetDataOk + +`func (o *ListOfRunsResponse) GetDataOk() (*ListOfRuns, bool)` + +GetDataOk returns a tuple with the Data field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetData + +`func (o *ListOfRunsResponse) SetData(v ListOfRuns)` + +SetData sets Data field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ListOfSchedules.md b/docs/ListOfSchedules.md new file mode 100644 index 0000000..42dc2ed --- /dev/null +++ b/docs/ListOfSchedules.md @@ -0,0 +1,156 @@ +# ListOfSchedules + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Total** | **int32** | The total number of items available across all pages. | +**Offset** | **int32** | The starting position for this page of results. | +**Limit** | **int32** | The maximum number of items returned per page. | +**Desc** | **bool** | Whether the results are sorted in descending order. | +**Count** | **int32** | The number of items returned in this response. | +**Items** | [**[]ScheduleShort**](ScheduleShort.md) | | + +## Methods + +### NewListOfSchedules + +`func NewListOfSchedules(total int32, offset int32, limit int32, desc bool, count int32, items []ScheduleShort, ) *ListOfSchedules` + +NewListOfSchedules instantiates a new ListOfSchedules object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewListOfSchedulesWithDefaults + +`func NewListOfSchedulesWithDefaults() *ListOfSchedules` + +NewListOfSchedulesWithDefaults instantiates a new ListOfSchedules object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetTotal + +`func (o *ListOfSchedules) GetTotal() int32` + +GetTotal returns the Total field if non-nil, zero value otherwise. + +### GetTotalOk + +`func (o *ListOfSchedules) GetTotalOk() (*int32, bool)` + +GetTotalOk returns a tuple with the Total field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTotal + +`func (o *ListOfSchedules) SetTotal(v int32)` + +SetTotal sets Total field to given value. + + +### GetOffset + +`func (o *ListOfSchedules) GetOffset() int32` + +GetOffset returns the Offset field if non-nil, zero value otherwise. + +### GetOffsetOk + +`func (o *ListOfSchedules) GetOffsetOk() (*int32, bool)` + +GetOffsetOk returns a tuple with the Offset field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetOffset + +`func (o *ListOfSchedules) SetOffset(v int32)` + +SetOffset sets Offset field to given value. + + +### GetLimit + +`func (o *ListOfSchedules) GetLimit() int32` + +GetLimit returns the Limit field if non-nil, zero value otherwise. + +### GetLimitOk + +`func (o *ListOfSchedules) GetLimitOk() (*int32, bool)` + +GetLimitOk returns a tuple with the Limit field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetLimit + +`func (o *ListOfSchedules) SetLimit(v int32)` + +SetLimit sets Limit field to given value. + + +### GetDesc + +`func (o *ListOfSchedules) GetDesc() bool` + +GetDesc returns the Desc field if non-nil, zero value otherwise. + +### GetDescOk + +`func (o *ListOfSchedules) GetDescOk() (*bool, bool)` + +GetDescOk returns a tuple with the Desc field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDesc + +`func (o *ListOfSchedules) SetDesc(v bool)` + +SetDesc sets Desc field to given value. + + +### GetCount + +`func (o *ListOfSchedules) GetCount() int32` + +GetCount returns the Count field if non-nil, zero value otherwise. + +### GetCountOk + +`func (o *ListOfSchedules) GetCountOk() (*int32, bool)` + +GetCountOk returns a tuple with the Count field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCount + +`func (o *ListOfSchedules) SetCount(v int32)` + +SetCount sets Count field to given value. + + +### GetItems + +`func (o *ListOfSchedules) GetItems() []ScheduleShort` + +GetItems returns the Items field if non-nil, zero value otherwise. + +### GetItemsOk + +`func (o *ListOfSchedules) GetItemsOk() (*[]ScheduleShort, bool)` + +GetItemsOk returns a tuple with the Items field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetItems + +`func (o *ListOfSchedules) SetItems(v []ScheduleShort)` + +SetItems sets Items field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ListOfSchedulesResponse.md b/docs/ListOfSchedulesResponse.md new file mode 100644 index 0000000..50173f8 --- /dev/null +++ b/docs/ListOfSchedulesResponse.md @@ -0,0 +1,51 @@ +# ListOfSchedulesResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Data** | [**ListOfSchedules**](ListOfSchedules.md) | | + +## Methods + +### NewListOfSchedulesResponse + +`func NewListOfSchedulesResponse(data ListOfSchedules, ) *ListOfSchedulesResponse` + +NewListOfSchedulesResponse instantiates a new ListOfSchedulesResponse object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewListOfSchedulesResponseWithDefaults + +`func NewListOfSchedulesResponseWithDefaults() *ListOfSchedulesResponse` + +NewListOfSchedulesResponseWithDefaults instantiates a new ListOfSchedulesResponse object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetData + +`func (o *ListOfSchedulesResponse) GetData() ListOfSchedules` + +GetData returns the Data field if non-nil, zero value otherwise. + +### GetDataOk + +`func (o *ListOfSchedulesResponse) GetDataOk() (*ListOfSchedules, bool)` + +GetDataOk returns a tuple with the Data field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetData + +`func (o *ListOfSchedulesResponse) SetData(v ListOfSchedules)` + +SetData sets Data field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ListOfStoreActors.md b/docs/ListOfStoreActors.md new file mode 100644 index 0000000..2c30565 --- /dev/null +++ b/docs/ListOfStoreActors.md @@ -0,0 +1,156 @@ +# ListOfStoreActors + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Total** | **int32** | The total number of items available across all pages. | +**Offset** | **int32** | The starting position for this page of results. | +**Limit** | **int32** | The maximum number of items returned per page. | +**Desc** | **bool** | Whether the results are sorted in descending order. | +**Count** | **int32** | The number of items returned in this response. | +**Items** | [**[]StoreListActor**](StoreListActor.md) | | + +## Methods + +### NewListOfStoreActors + +`func NewListOfStoreActors(total int32, offset int32, limit int32, desc bool, count int32, items []StoreListActor, ) *ListOfStoreActors` + +NewListOfStoreActors instantiates a new ListOfStoreActors object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewListOfStoreActorsWithDefaults + +`func NewListOfStoreActorsWithDefaults() *ListOfStoreActors` + +NewListOfStoreActorsWithDefaults instantiates a new ListOfStoreActors object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetTotal + +`func (o *ListOfStoreActors) GetTotal() int32` + +GetTotal returns the Total field if non-nil, zero value otherwise. + +### GetTotalOk + +`func (o *ListOfStoreActors) GetTotalOk() (*int32, bool)` + +GetTotalOk returns a tuple with the Total field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTotal + +`func (o *ListOfStoreActors) SetTotal(v int32)` + +SetTotal sets Total field to given value. + + +### GetOffset + +`func (o *ListOfStoreActors) GetOffset() int32` + +GetOffset returns the Offset field if non-nil, zero value otherwise. + +### GetOffsetOk + +`func (o *ListOfStoreActors) GetOffsetOk() (*int32, bool)` + +GetOffsetOk returns a tuple with the Offset field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetOffset + +`func (o *ListOfStoreActors) SetOffset(v int32)` + +SetOffset sets Offset field to given value. + + +### GetLimit + +`func (o *ListOfStoreActors) GetLimit() int32` + +GetLimit returns the Limit field if non-nil, zero value otherwise. + +### GetLimitOk + +`func (o *ListOfStoreActors) GetLimitOk() (*int32, bool)` + +GetLimitOk returns a tuple with the Limit field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetLimit + +`func (o *ListOfStoreActors) SetLimit(v int32)` + +SetLimit sets Limit field to given value. + + +### GetDesc + +`func (o *ListOfStoreActors) GetDesc() bool` + +GetDesc returns the Desc field if non-nil, zero value otherwise. + +### GetDescOk + +`func (o *ListOfStoreActors) GetDescOk() (*bool, bool)` + +GetDescOk returns a tuple with the Desc field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDesc + +`func (o *ListOfStoreActors) SetDesc(v bool)` + +SetDesc sets Desc field to given value. + + +### GetCount + +`func (o *ListOfStoreActors) GetCount() int32` + +GetCount returns the Count field if non-nil, zero value otherwise. + +### GetCountOk + +`func (o *ListOfStoreActors) GetCountOk() (*int32, bool)` + +GetCountOk returns a tuple with the Count field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCount + +`func (o *ListOfStoreActors) SetCount(v int32)` + +SetCount sets Count field to given value. + + +### GetItems + +`func (o *ListOfStoreActors) GetItems() []StoreListActor` + +GetItems returns the Items field if non-nil, zero value otherwise. + +### GetItemsOk + +`func (o *ListOfStoreActors) GetItemsOk() (*[]StoreListActor, bool)` + +GetItemsOk returns a tuple with the Items field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetItems + +`func (o *ListOfStoreActors) SetItems(v []StoreListActor)` + +SetItems sets Items field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ListOfTasks.md b/docs/ListOfTasks.md new file mode 100644 index 0000000..c11932c --- /dev/null +++ b/docs/ListOfTasks.md @@ -0,0 +1,156 @@ +# ListOfTasks + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Total** | **int32** | The total number of items available across all pages. | +**Offset** | **int32** | The starting position for this page of results. | +**Limit** | **int32** | The maximum number of items returned per page. | +**Desc** | **bool** | Whether the results are sorted in descending order. | +**Count** | **int32** | The number of items returned in this response. | +**Items** | [**[]TaskShort**](TaskShort.md) | | + +## Methods + +### NewListOfTasks + +`func NewListOfTasks(total int32, offset int32, limit int32, desc bool, count int32, items []TaskShort, ) *ListOfTasks` + +NewListOfTasks instantiates a new ListOfTasks object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewListOfTasksWithDefaults + +`func NewListOfTasksWithDefaults() *ListOfTasks` + +NewListOfTasksWithDefaults instantiates a new ListOfTasks object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetTotal + +`func (o *ListOfTasks) GetTotal() int32` + +GetTotal returns the Total field if non-nil, zero value otherwise. + +### GetTotalOk + +`func (o *ListOfTasks) GetTotalOk() (*int32, bool)` + +GetTotalOk returns a tuple with the Total field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTotal + +`func (o *ListOfTasks) SetTotal(v int32)` + +SetTotal sets Total field to given value. + + +### GetOffset + +`func (o *ListOfTasks) GetOffset() int32` + +GetOffset returns the Offset field if non-nil, zero value otherwise. + +### GetOffsetOk + +`func (o *ListOfTasks) GetOffsetOk() (*int32, bool)` + +GetOffsetOk returns a tuple with the Offset field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetOffset + +`func (o *ListOfTasks) SetOffset(v int32)` + +SetOffset sets Offset field to given value. + + +### GetLimit + +`func (o *ListOfTasks) GetLimit() int32` + +GetLimit returns the Limit field if non-nil, zero value otherwise. + +### GetLimitOk + +`func (o *ListOfTasks) GetLimitOk() (*int32, bool)` + +GetLimitOk returns a tuple with the Limit field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetLimit + +`func (o *ListOfTasks) SetLimit(v int32)` + +SetLimit sets Limit field to given value. + + +### GetDesc + +`func (o *ListOfTasks) GetDesc() bool` + +GetDesc returns the Desc field if non-nil, zero value otherwise. + +### GetDescOk + +`func (o *ListOfTasks) GetDescOk() (*bool, bool)` + +GetDescOk returns a tuple with the Desc field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDesc + +`func (o *ListOfTasks) SetDesc(v bool)` + +SetDesc sets Desc field to given value. + + +### GetCount + +`func (o *ListOfTasks) GetCount() int32` + +GetCount returns the Count field if non-nil, zero value otherwise. + +### GetCountOk + +`func (o *ListOfTasks) GetCountOk() (*int32, bool)` + +GetCountOk returns a tuple with the Count field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCount + +`func (o *ListOfTasks) SetCount(v int32)` + +SetCount sets Count field to given value. + + +### GetItems + +`func (o *ListOfTasks) GetItems() []TaskShort` + +GetItems returns the Items field if non-nil, zero value otherwise. + +### GetItemsOk + +`func (o *ListOfTasks) GetItemsOk() (*[]TaskShort, bool)` + +GetItemsOk returns a tuple with the Items field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetItems + +`func (o *ListOfTasks) SetItems(v []TaskShort)` + +SetItems sets Items field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ListOfTasksResponse.md b/docs/ListOfTasksResponse.md new file mode 100644 index 0000000..2847c25 --- /dev/null +++ b/docs/ListOfTasksResponse.md @@ -0,0 +1,51 @@ +# ListOfTasksResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Data** | [**ListOfTasks**](ListOfTasks.md) | | + +## Methods + +### NewListOfTasksResponse + +`func NewListOfTasksResponse(data ListOfTasks, ) *ListOfTasksResponse` + +NewListOfTasksResponse instantiates a new ListOfTasksResponse object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewListOfTasksResponseWithDefaults + +`func NewListOfTasksResponseWithDefaults() *ListOfTasksResponse` + +NewListOfTasksResponseWithDefaults instantiates a new ListOfTasksResponse object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetData + +`func (o *ListOfTasksResponse) GetData() ListOfTasks` + +GetData returns the Data field if non-nil, zero value otherwise. + +### GetDataOk + +`func (o *ListOfTasksResponse) GetDataOk() (*ListOfTasks, bool)` + +GetDataOk returns a tuple with the Data field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetData + +`func (o *ListOfTasksResponse) SetData(v ListOfTasks)` + +SetData sets Data field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ListOfVersions.md b/docs/ListOfVersions.md new file mode 100644 index 0000000..c549a8d --- /dev/null +++ b/docs/ListOfVersions.md @@ -0,0 +1,72 @@ +# ListOfVersions + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Total** | **int32** | | +**Items** | [**[]Version**](Version.md) | | + +## Methods + +### NewListOfVersions + +`func NewListOfVersions(total int32, items []Version, ) *ListOfVersions` + +NewListOfVersions instantiates a new ListOfVersions object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewListOfVersionsWithDefaults + +`func NewListOfVersionsWithDefaults() *ListOfVersions` + +NewListOfVersionsWithDefaults instantiates a new ListOfVersions object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetTotal + +`func (o *ListOfVersions) GetTotal() int32` + +GetTotal returns the Total field if non-nil, zero value otherwise. + +### GetTotalOk + +`func (o *ListOfVersions) GetTotalOk() (*int32, bool)` + +GetTotalOk returns a tuple with the Total field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTotal + +`func (o *ListOfVersions) SetTotal(v int32)` + +SetTotal sets Total field to given value. + + +### GetItems + +`func (o *ListOfVersions) GetItems() []Version` + +GetItems returns the Items field if non-nil, zero value otherwise. + +### GetItemsOk + +`func (o *ListOfVersions) GetItemsOk() (*[]Version, bool)` + +GetItemsOk returns a tuple with the Items field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetItems + +`func (o *ListOfVersions) SetItems(v []Version)` + +SetItems sets Items field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ListOfVersionsResponse.md b/docs/ListOfVersionsResponse.md new file mode 100644 index 0000000..fc13e2e --- /dev/null +++ b/docs/ListOfVersionsResponse.md @@ -0,0 +1,51 @@ +# ListOfVersionsResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Data** | [**ListOfVersions**](ListOfVersions.md) | | + +## Methods + +### NewListOfVersionsResponse + +`func NewListOfVersionsResponse(data ListOfVersions, ) *ListOfVersionsResponse` + +NewListOfVersionsResponse instantiates a new ListOfVersionsResponse object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewListOfVersionsResponseWithDefaults + +`func NewListOfVersionsResponseWithDefaults() *ListOfVersionsResponse` + +NewListOfVersionsResponseWithDefaults instantiates a new ListOfVersionsResponse object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetData + +`func (o *ListOfVersionsResponse) GetData() ListOfVersions` + +GetData returns the Data field if non-nil, zero value otherwise. + +### GetDataOk + +`func (o *ListOfVersionsResponse) GetDataOk() (*ListOfVersions, bool)` + +GetDataOk returns a tuple with the Data field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetData + +`func (o *ListOfVersionsResponse) SetData(v ListOfVersions)` + +SetData sets Data field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ListOfWebhookDispatches.md b/docs/ListOfWebhookDispatches.md new file mode 100644 index 0000000..cf52f53 --- /dev/null +++ b/docs/ListOfWebhookDispatches.md @@ -0,0 +1,156 @@ +# ListOfWebhookDispatches + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Total** | **int32** | The total number of items available across all pages. | +**Offset** | **int32** | The starting position for this page of results. | +**Limit** | **int32** | The maximum number of items returned per page. | +**Desc** | **bool** | Whether the results are sorted in descending order. | +**Count** | **int32** | The number of items returned in this response. | +**Items** | [**[]WebhookDispatch**](WebhookDispatch.md) | | + +## Methods + +### NewListOfWebhookDispatches + +`func NewListOfWebhookDispatches(total int32, offset int32, limit int32, desc bool, count int32, items []WebhookDispatch, ) *ListOfWebhookDispatches` + +NewListOfWebhookDispatches instantiates a new ListOfWebhookDispatches object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewListOfWebhookDispatchesWithDefaults + +`func NewListOfWebhookDispatchesWithDefaults() *ListOfWebhookDispatches` + +NewListOfWebhookDispatchesWithDefaults instantiates a new ListOfWebhookDispatches object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetTotal + +`func (o *ListOfWebhookDispatches) GetTotal() int32` + +GetTotal returns the Total field if non-nil, zero value otherwise. + +### GetTotalOk + +`func (o *ListOfWebhookDispatches) GetTotalOk() (*int32, bool)` + +GetTotalOk returns a tuple with the Total field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTotal + +`func (o *ListOfWebhookDispatches) SetTotal(v int32)` + +SetTotal sets Total field to given value. + + +### GetOffset + +`func (o *ListOfWebhookDispatches) GetOffset() int32` + +GetOffset returns the Offset field if non-nil, zero value otherwise. + +### GetOffsetOk + +`func (o *ListOfWebhookDispatches) GetOffsetOk() (*int32, bool)` + +GetOffsetOk returns a tuple with the Offset field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetOffset + +`func (o *ListOfWebhookDispatches) SetOffset(v int32)` + +SetOffset sets Offset field to given value. + + +### GetLimit + +`func (o *ListOfWebhookDispatches) GetLimit() int32` + +GetLimit returns the Limit field if non-nil, zero value otherwise. + +### GetLimitOk + +`func (o *ListOfWebhookDispatches) GetLimitOk() (*int32, bool)` + +GetLimitOk returns a tuple with the Limit field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetLimit + +`func (o *ListOfWebhookDispatches) SetLimit(v int32)` + +SetLimit sets Limit field to given value. + + +### GetDesc + +`func (o *ListOfWebhookDispatches) GetDesc() bool` + +GetDesc returns the Desc field if non-nil, zero value otherwise. + +### GetDescOk + +`func (o *ListOfWebhookDispatches) GetDescOk() (*bool, bool)` + +GetDescOk returns a tuple with the Desc field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDesc + +`func (o *ListOfWebhookDispatches) SetDesc(v bool)` + +SetDesc sets Desc field to given value. + + +### GetCount + +`func (o *ListOfWebhookDispatches) GetCount() int32` + +GetCount returns the Count field if non-nil, zero value otherwise. + +### GetCountOk + +`func (o *ListOfWebhookDispatches) GetCountOk() (*int32, bool)` + +GetCountOk returns a tuple with the Count field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCount + +`func (o *ListOfWebhookDispatches) SetCount(v int32)` + +SetCount sets Count field to given value. + + +### GetItems + +`func (o *ListOfWebhookDispatches) GetItems() []WebhookDispatch` + +GetItems returns the Items field if non-nil, zero value otherwise. + +### GetItemsOk + +`func (o *ListOfWebhookDispatches) GetItemsOk() (*[]WebhookDispatch, bool)` + +GetItemsOk returns a tuple with the Items field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetItems + +`func (o *ListOfWebhookDispatches) SetItems(v []WebhookDispatch)` + +SetItems sets Items field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ListOfWebhookDispatchesResponse.md b/docs/ListOfWebhookDispatchesResponse.md new file mode 100644 index 0000000..f2a3302 --- /dev/null +++ b/docs/ListOfWebhookDispatchesResponse.md @@ -0,0 +1,51 @@ +# ListOfWebhookDispatchesResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Data** | [**ListOfWebhookDispatches**](ListOfWebhookDispatches.md) | | + +## Methods + +### NewListOfWebhookDispatchesResponse + +`func NewListOfWebhookDispatchesResponse(data ListOfWebhookDispatches, ) *ListOfWebhookDispatchesResponse` + +NewListOfWebhookDispatchesResponse instantiates a new ListOfWebhookDispatchesResponse object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewListOfWebhookDispatchesResponseWithDefaults + +`func NewListOfWebhookDispatchesResponseWithDefaults() *ListOfWebhookDispatchesResponse` + +NewListOfWebhookDispatchesResponseWithDefaults instantiates a new ListOfWebhookDispatchesResponse object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetData + +`func (o *ListOfWebhookDispatchesResponse) GetData() ListOfWebhookDispatches` + +GetData returns the Data field if non-nil, zero value otherwise. + +### GetDataOk + +`func (o *ListOfWebhookDispatchesResponse) GetDataOk() (*ListOfWebhookDispatches, bool)` + +GetDataOk returns a tuple with the Data field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetData + +`func (o *ListOfWebhookDispatchesResponse) SetData(v ListOfWebhookDispatches)` + +SetData sets Data field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ListOfWebhooks.md b/docs/ListOfWebhooks.md new file mode 100644 index 0000000..80239a7 --- /dev/null +++ b/docs/ListOfWebhooks.md @@ -0,0 +1,156 @@ +# ListOfWebhooks + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Total** | **int32** | The total number of items available across all pages. | +**Offset** | **int32** | The starting position for this page of results. | +**Limit** | **int32** | The maximum number of items returned per page. | +**Desc** | **bool** | Whether the results are sorted in descending order. | +**Count** | **int32** | The number of items returned in this response. | +**Items** | [**[]WebhookShort**](WebhookShort.md) | | + +## Methods + +### NewListOfWebhooks + +`func NewListOfWebhooks(total int32, offset int32, limit int32, desc bool, count int32, items []WebhookShort, ) *ListOfWebhooks` + +NewListOfWebhooks instantiates a new ListOfWebhooks object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewListOfWebhooksWithDefaults + +`func NewListOfWebhooksWithDefaults() *ListOfWebhooks` + +NewListOfWebhooksWithDefaults instantiates a new ListOfWebhooks object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetTotal + +`func (o *ListOfWebhooks) GetTotal() int32` + +GetTotal returns the Total field if non-nil, zero value otherwise. + +### GetTotalOk + +`func (o *ListOfWebhooks) GetTotalOk() (*int32, bool)` + +GetTotalOk returns a tuple with the Total field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTotal + +`func (o *ListOfWebhooks) SetTotal(v int32)` + +SetTotal sets Total field to given value. + + +### GetOffset + +`func (o *ListOfWebhooks) GetOffset() int32` + +GetOffset returns the Offset field if non-nil, zero value otherwise. + +### GetOffsetOk + +`func (o *ListOfWebhooks) GetOffsetOk() (*int32, bool)` + +GetOffsetOk returns a tuple with the Offset field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetOffset + +`func (o *ListOfWebhooks) SetOffset(v int32)` + +SetOffset sets Offset field to given value. + + +### GetLimit + +`func (o *ListOfWebhooks) GetLimit() int32` + +GetLimit returns the Limit field if non-nil, zero value otherwise. + +### GetLimitOk + +`func (o *ListOfWebhooks) GetLimitOk() (*int32, bool)` + +GetLimitOk returns a tuple with the Limit field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetLimit + +`func (o *ListOfWebhooks) SetLimit(v int32)` + +SetLimit sets Limit field to given value. + + +### GetDesc + +`func (o *ListOfWebhooks) GetDesc() bool` + +GetDesc returns the Desc field if non-nil, zero value otherwise. + +### GetDescOk + +`func (o *ListOfWebhooks) GetDescOk() (*bool, bool)` + +GetDescOk returns a tuple with the Desc field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDesc + +`func (o *ListOfWebhooks) SetDesc(v bool)` + +SetDesc sets Desc field to given value. + + +### GetCount + +`func (o *ListOfWebhooks) GetCount() int32` + +GetCount returns the Count field if non-nil, zero value otherwise. + +### GetCountOk + +`func (o *ListOfWebhooks) GetCountOk() (*int32, bool)` + +GetCountOk returns a tuple with the Count field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCount + +`func (o *ListOfWebhooks) SetCount(v int32)` + +SetCount sets Count field to given value. + + +### GetItems + +`func (o *ListOfWebhooks) GetItems() []WebhookShort` + +GetItems returns the Items field if non-nil, zero value otherwise. + +### GetItemsOk + +`func (o *ListOfWebhooks) GetItemsOk() (*[]WebhookShort, bool)` + +GetItemsOk returns a tuple with the Items field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetItems + +`func (o *ListOfWebhooks) SetItems(v []WebhookShort)` + +SetItems sets Items field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ListOfWebhooksResponse.md b/docs/ListOfWebhooksResponse.md new file mode 100644 index 0000000..c8e3d72 --- /dev/null +++ b/docs/ListOfWebhooksResponse.md @@ -0,0 +1,51 @@ +# ListOfWebhooksResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Data** | [**ListOfWebhooks**](ListOfWebhooks.md) | | + +## Methods + +### NewListOfWebhooksResponse + +`func NewListOfWebhooksResponse(data ListOfWebhooks, ) *ListOfWebhooksResponse` + +NewListOfWebhooksResponse instantiates a new ListOfWebhooksResponse object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewListOfWebhooksResponseWithDefaults + +`func NewListOfWebhooksResponseWithDefaults() *ListOfWebhooksResponse` + +NewListOfWebhooksResponseWithDefaults instantiates a new ListOfWebhooksResponse object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetData + +`func (o *ListOfWebhooksResponse) GetData() ListOfWebhooks` + +GetData returns the Data field if non-nil, zero value otherwise. + +### GetDataOk + +`func (o *ListOfWebhooksResponse) GetDataOk() (*ListOfWebhooks, bool)` + +GetDataOk returns a tuple with the Data field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetData + +`func (o *ListOfWebhooksResponse) SetData(v ListOfWebhooks)` + +SetData sets Data field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/LockedHeadRequest.md b/docs/LockedHeadRequest.md new file mode 100644 index 0000000..09180c7 --- /dev/null +++ b/docs/LockedHeadRequest.md @@ -0,0 +1,166 @@ +# LockedHeadRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **string** | A unique identifier assigned to the request. | +**UniqueKey** | **string** | A unique key used for request de-duplication. Requests with the same unique key are considered identical. | +**Url** | **string** | The URL of the request. | +**Method** | Pointer to [**HttpMethod**](HttpMethod.md) | | [optional] +**RetryCount** | Pointer to **int32** | The number of times this request has been retried. | [optional] +**LockExpiresAt** | **time.Time** | The timestamp when the lock on this request expires. | + +## Methods + +### NewLockedHeadRequest + +`func NewLockedHeadRequest(id string, uniqueKey string, url string, lockExpiresAt time.Time, ) *LockedHeadRequest` + +NewLockedHeadRequest instantiates a new LockedHeadRequest object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewLockedHeadRequestWithDefaults + +`func NewLockedHeadRequestWithDefaults() *LockedHeadRequest` + +NewLockedHeadRequestWithDefaults instantiates a new LockedHeadRequest object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetId + +`func (o *LockedHeadRequest) GetId() string` + +GetId returns the Id field if non-nil, zero value otherwise. + +### GetIdOk + +`func (o *LockedHeadRequest) GetIdOk() (*string, bool)` + +GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetId + +`func (o *LockedHeadRequest) SetId(v string)` + +SetId sets Id field to given value. + + +### GetUniqueKey + +`func (o *LockedHeadRequest) GetUniqueKey() string` + +GetUniqueKey returns the UniqueKey field if non-nil, zero value otherwise. + +### GetUniqueKeyOk + +`func (o *LockedHeadRequest) GetUniqueKeyOk() (*string, bool)` + +GetUniqueKeyOk returns a tuple with the UniqueKey field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUniqueKey + +`func (o *LockedHeadRequest) SetUniqueKey(v string)` + +SetUniqueKey sets UniqueKey field to given value. + + +### GetUrl + +`func (o *LockedHeadRequest) GetUrl() string` + +GetUrl returns the Url field if non-nil, zero value otherwise. + +### GetUrlOk + +`func (o *LockedHeadRequest) GetUrlOk() (*string, bool)` + +GetUrlOk returns a tuple with the Url field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUrl + +`func (o *LockedHeadRequest) SetUrl(v string)` + +SetUrl sets Url field to given value. + + +### GetMethod + +`func (o *LockedHeadRequest) GetMethod() HttpMethod` + +GetMethod returns the Method field if non-nil, zero value otherwise. + +### GetMethodOk + +`func (o *LockedHeadRequest) GetMethodOk() (*HttpMethod, bool)` + +GetMethodOk returns a tuple with the Method field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMethod + +`func (o *LockedHeadRequest) SetMethod(v HttpMethod)` + +SetMethod sets Method field to given value. + +### HasMethod + +`func (o *LockedHeadRequest) HasMethod() bool` + +HasMethod returns a boolean if a field has been set. + +### GetRetryCount + +`func (o *LockedHeadRequest) GetRetryCount() int32` + +GetRetryCount returns the RetryCount field if non-nil, zero value otherwise. + +### GetRetryCountOk + +`func (o *LockedHeadRequest) GetRetryCountOk() (*int32, bool)` + +GetRetryCountOk returns a tuple with the RetryCount field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRetryCount + +`func (o *LockedHeadRequest) SetRetryCount(v int32)` + +SetRetryCount sets RetryCount field to given value. + +### HasRetryCount + +`func (o *LockedHeadRequest) HasRetryCount() bool` + +HasRetryCount returns a boolean if a field has been set. + +### GetLockExpiresAt + +`func (o *LockedHeadRequest) GetLockExpiresAt() time.Time` + +GetLockExpiresAt returns the LockExpiresAt field if non-nil, zero value otherwise. + +### GetLockExpiresAtOk + +`func (o *LockedHeadRequest) GetLockExpiresAtOk() (*time.Time, bool)` + +GetLockExpiresAtOk returns a tuple with the LockExpiresAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetLockExpiresAt + +`func (o *LockedHeadRequest) SetLockExpiresAt(v time.Time)` + +SetLockExpiresAt sets LockExpiresAt field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/LockedRequestQueueHead.md b/docs/LockedRequestQueueHead.md new file mode 100644 index 0000000..fe3fc7f --- /dev/null +++ b/docs/LockedRequestQueueHead.md @@ -0,0 +1,187 @@ +# LockedRequestQueueHead + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Limit** | **int32** | The maximum number of requests returned. | +**QueueModifiedAt** | **time.Time** | The timestamp when the request queue was last modified. Modifications include adding, updating, or removing requests, as well as locking or unlocking requests in the request queue. | +**QueueHasLockedRequests** | Pointer to **bool** | Whether the request queue contains requests locked by any client (either the one calling the endpoint or a different one). | [optional] +**ClientKey** | Pointer to **string** | The client key used for locking the requests. | [optional] +**HadMultipleClients** | **bool** | Whether the request queue has been accessed by multiple different clients. | +**LockSecs** | **int32** | The number of seconds the locks will be held. | +**Items** | [**[]LockedHeadRequest**](LockedHeadRequest.md) | The array of locked requests from the request queue head. | + +## Methods + +### NewLockedRequestQueueHead + +`func NewLockedRequestQueueHead(limit int32, queueModifiedAt time.Time, hadMultipleClients bool, lockSecs int32, items []LockedHeadRequest, ) *LockedRequestQueueHead` + +NewLockedRequestQueueHead instantiates a new LockedRequestQueueHead object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewLockedRequestQueueHeadWithDefaults + +`func NewLockedRequestQueueHeadWithDefaults() *LockedRequestQueueHead` + +NewLockedRequestQueueHeadWithDefaults instantiates a new LockedRequestQueueHead object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetLimit + +`func (o *LockedRequestQueueHead) GetLimit() int32` + +GetLimit returns the Limit field if non-nil, zero value otherwise. + +### GetLimitOk + +`func (o *LockedRequestQueueHead) GetLimitOk() (*int32, bool)` + +GetLimitOk returns a tuple with the Limit field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetLimit + +`func (o *LockedRequestQueueHead) SetLimit(v int32)` + +SetLimit sets Limit field to given value. + + +### GetQueueModifiedAt + +`func (o *LockedRequestQueueHead) GetQueueModifiedAt() time.Time` + +GetQueueModifiedAt returns the QueueModifiedAt field if non-nil, zero value otherwise. + +### GetQueueModifiedAtOk + +`func (o *LockedRequestQueueHead) GetQueueModifiedAtOk() (*time.Time, bool)` + +GetQueueModifiedAtOk returns a tuple with the QueueModifiedAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetQueueModifiedAt + +`func (o *LockedRequestQueueHead) SetQueueModifiedAt(v time.Time)` + +SetQueueModifiedAt sets QueueModifiedAt field to given value. + + +### GetQueueHasLockedRequests + +`func (o *LockedRequestQueueHead) GetQueueHasLockedRequests() bool` + +GetQueueHasLockedRequests returns the QueueHasLockedRequests field if non-nil, zero value otherwise. + +### GetQueueHasLockedRequestsOk + +`func (o *LockedRequestQueueHead) GetQueueHasLockedRequestsOk() (*bool, bool)` + +GetQueueHasLockedRequestsOk returns a tuple with the QueueHasLockedRequests field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetQueueHasLockedRequests + +`func (o *LockedRequestQueueHead) SetQueueHasLockedRequests(v bool)` + +SetQueueHasLockedRequests sets QueueHasLockedRequests field to given value. + +### HasQueueHasLockedRequests + +`func (o *LockedRequestQueueHead) HasQueueHasLockedRequests() bool` + +HasQueueHasLockedRequests returns a boolean if a field has been set. + +### GetClientKey + +`func (o *LockedRequestQueueHead) GetClientKey() string` + +GetClientKey returns the ClientKey field if non-nil, zero value otherwise. + +### GetClientKeyOk + +`func (o *LockedRequestQueueHead) GetClientKeyOk() (*string, bool)` + +GetClientKeyOk returns a tuple with the ClientKey field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetClientKey + +`func (o *LockedRequestQueueHead) SetClientKey(v string)` + +SetClientKey sets ClientKey field to given value. + +### HasClientKey + +`func (o *LockedRequestQueueHead) HasClientKey() bool` + +HasClientKey returns a boolean if a field has been set. + +### GetHadMultipleClients + +`func (o *LockedRequestQueueHead) GetHadMultipleClients() bool` + +GetHadMultipleClients returns the HadMultipleClients field if non-nil, zero value otherwise. + +### GetHadMultipleClientsOk + +`func (o *LockedRequestQueueHead) GetHadMultipleClientsOk() (*bool, bool)` + +GetHadMultipleClientsOk returns a tuple with the HadMultipleClients field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetHadMultipleClients + +`func (o *LockedRequestQueueHead) SetHadMultipleClients(v bool)` + +SetHadMultipleClients sets HadMultipleClients field to given value. + + +### GetLockSecs + +`func (o *LockedRequestQueueHead) GetLockSecs() int32` + +GetLockSecs returns the LockSecs field if non-nil, zero value otherwise. + +### GetLockSecsOk + +`func (o *LockedRequestQueueHead) GetLockSecsOk() (*int32, bool)` + +GetLockSecsOk returns a tuple with the LockSecs field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetLockSecs + +`func (o *LockedRequestQueueHead) SetLockSecs(v int32)` + +SetLockSecs sets LockSecs field to given value. + + +### GetItems + +`func (o *LockedRequestQueueHead) GetItems() []LockedHeadRequest` + +GetItems returns the Items field if non-nil, zero value otherwise. + +### GetItemsOk + +`func (o *LockedRequestQueueHead) GetItemsOk() (*[]LockedHeadRequest, bool)` + +GetItemsOk returns a tuple with the Items field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetItems + +`func (o *LockedRequestQueueHead) SetItems(v []LockedHeadRequest)` + +SetItems sets Items field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/LogsAPI.md b/docs/LogsAPI.md new file mode 100644 index 0000000..13a6c8b --- /dev/null +++ b/docs/LogsAPI.md @@ -0,0 +1,85 @@ +# \LogsAPI + +All URIs are relative to *https://api.apify.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**LogGet**](LogsAPI.md#LogGet) | **Get** /v2/logs/{buildOrRunId} | Get log + + + +## LogGet + +> string LogGet(ctx, buildOrRunId).Stream(stream).Download(download).Raw(raw).Execute() + +Get log + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + buildOrRunId := "HG7ML7M8z78YcAPE" // string | ID of the Actor build or run. + stream := false // bool | If `true` or `1` then the logs will be streamed as long as the run or build is running. (optional) + download := false // bool | If `true` or `1` then the web browser will download the log file rather than open it in a tab. (optional) + raw := false // bool | If `true` or `1`, the logs will be kept verbatim. By default, the API removes ANSI escape codes from the logs, keeping only printable characters. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.LogsAPI.LogGet(context.Background(), buildOrRunId).Stream(stream).Download(download).Raw(raw).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `LogsAPI.LogGet``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `LogGet`: string + fmt.Fprintf(os.Stdout, "Response from `LogsAPI.LogGet`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**buildOrRunId** | **string** | ID of the Actor build or run. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiLogGetRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **stream** | **bool** | If `true` or `1` then the logs will be streamed as long as the run or build is running. | + **download** | **bool** | If `true` or `1` then the web browser will download the log file rather than open it in a tab. | + **raw** | **bool** | If `true` or `1`, the logs will be kept verbatim. By default, the API removes ANSI escape codes from the logs, keeping only printable characters. | + +### Return type + +**string** + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: text/plain, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/docs/Metamorph.md b/docs/Metamorph.md new file mode 100644 index 0000000..aeeb893 --- /dev/null +++ b/docs/Metamorph.md @@ -0,0 +1,129 @@ +# Metamorph + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**CreatedAt** | **time.Time** | Time when the metamorph occurred. | +**ActorId** | **string** | ID of the Actor that the run was metamorphed to. | +**BuildId** | **string** | ID of the build used for the metamorphed Actor. | +**InputKey** | Pointer to **NullableString** | Key of the input record in the key-value store. | [optional] + +## Methods + +### NewMetamorph + +`func NewMetamorph(createdAt time.Time, actorId string, buildId string, ) *Metamorph` + +NewMetamorph instantiates a new Metamorph object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewMetamorphWithDefaults + +`func NewMetamorphWithDefaults() *Metamorph` + +NewMetamorphWithDefaults instantiates a new Metamorph object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetCreatedAt + +`func (o *Metamorph) GetCreatedAt() time.Time` + +GetCreatedAt returns the CreatedAt field if non-nil, zero value otherwise. + +### GetCreatedAtOk + +`func (o *Metamorph) GetCreatedAtOk() (*time.Time, bool)` + +GetCreatedAtOk returns a tuple with the CreatedAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCreatedAt + +`func (o *Metamorph) SetCreatedAt(v time.Time)` + +SetCreatedAt sets CreatedAt field to given value. + + +### GetActorId + +`func (o *Metamorph) GetActorId() string` + +GetActorId returns the ActorId field if non-nil, zero value otherwise. + +### GetActorIdOk + +`func (o *Metamorph) GetActorIdOk() (*string, bool)` + +GetActorIdOk returns a tuple with the ActorId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetActorId + +`func (o *Metamorph) SetActorId(v string)` + +SetActorId sets ActorId field to given value. + + +### GetBuildId + +`func (o *Metamorph) GetBuildId() string` + +GetBuildId returns the BuildId field if non-nil, zero value otherwise. + +### GetBuildIdOk + +`func (o *Metamorph) GetBuildIdOk() (*string, bool)` + +GetBuildIdOk returns a tuple with the BuildId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetBuildId + +`func (o *Metamorph) SetBuildId(v string)` + +SetBuildId sets BuildId field to given value. + + +### GetInputKey + +`func (o *Metamorph) GetInputKey() string` + +GetInputKey returns the InputKey field if non-nil, zero value otherwise. + +### GetInputKeyOk + +`func (o *Metamorph) GetInputKeyOk() (*string, bool)` + +GetInputKeyOk returns a tuple with the InputKey field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetInputKey + +`func (o *Metamorph) SetInputKey(v string)` + +SetInputKey sets InputKey field to given value. + +### HasInputKey + +`func (o *Metamorph) HasInputKey() bool` + +HasInputKey returns a boolean if a field has been set. + +### SetInputKeyNil + +`func (o *Metamorph) SetInputKeyNil(b bool)` + + SetInputKeyNil sets the value for InputKey to be an explicit nil + +### UnsetInputKey +`func (o *Metamorph) UnsetInputKey()` + +UnsetInputKey ensures that no value is present for InputKey, not even an explicit nil + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/MonthlyUsage.md b/docs/MonthlyUsage.md new file mode 100644 index 0000000..a63b736 --- /dev/null +++ b/docs/MonthlyUsage.md @@ -0,0 +1,135 @@ +# MonthlyUsage + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**UsageCycle** | [**UsageCycle**](UsageCycle.md) | | +**MonthlyServiceUsage** | [**map[string]UsageItem**](UsageItem.md) | A map of usage item names (e.g., ACTOR_COMPUTE_UNITS) to their usage details. | +**DailyServiceUsages** | [**[]DailyServiceUsages**](DailyServiceUsages.md) | | +**TotalUsageCreditsUsdBeforeVolumeDiscount** | **float32** | | +**TotalUsageCreditsUsdAfterVolumeDiscount** | **float32** | | + +## Methods + +### NewMonthlyUsage + +`func NewMonthlyUsage(usageCycle UsageCycle, monthlyServiceUsage map[string]UsageItem, dailyServiceUsages []DailyServiceUsages, totalUsageCreditsUsdBeforeVolumeDiscount float32, totalUsageCreditsUsdAfterVolumeDiscount float32, ) *MonthlyUsage` + +NewMonthlyUsage instantiates a new MonthlyUsage object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewMonthlyUsageWithDefaults + +`func NewMonthlyUsageWithDefaults() *MonthlyUsage` + +NewMonthlyUsageWithDefaults instantiates a new MonthlyUsage object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetUsageCycle + +`func (o *MonthlyUsage) GetUsageCycle() UsageCycle` + +GetUsageCycle returns the UsageCycle field if non-nil, zero value otherwise. + +### GetUsageCycleOk + +`func (o *MonthlyUsage) GetUsageCycleOk() (*UsageCycle, bool)` + +GetUsageCycleOk returns a tuple with the UsageCycle field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUsageCycle + +`func (o *MonthlyUsage) SetUsageCycle(v UsageCycle)` + +SetUsageCycle sets UsageCycle field to given value. + + +### GetMonthlyServiceUsage + +`func (o *MonthlyUsage) GetMonthlyServiceUsage() map[string]UsageItem` + +GetMonthlyServiceUsage returns the MonthlyServiceUsage field if non-nil, zero value otherwise. + +### GetMonthlyServiceUsageOk + +`func (o *MonthlyUsage) GetMonthlyServiceUsageOk() (*map[string]UsageItem, bool)` + +GetMonthlyServiceUsageOk returns a tuple with the MonthlyServiceUsage field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMonthlyServiceUsage + +`func (o *MonthlyUsage) SetMonthlyServiceUsage(v map[string]UsageItem)` + +SetMonthlyServiceUsage sets MonthlyServiceUsage field to given value. + + +### GetDailyServiceUsages + +`func (o *MonthlyUsage) GetDailyServiceUsages() []DailyServiceUsages` + +GetDailyServiceUsages returns the DailyServiceUsages field if non-nil, zero value otherwise. + +### GetDailyServiceUsagesOk + +`func (o *MonthlyUsage) GetDailyServiceUsagesOk() (*[]DailyServiceUsages, bool)` + +GetDailyServiceUsagesOk returns a tuple with the DailyServiceUsages field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDailyServiceUsages + +`func (o *MonthlyUsage) SetDailyServiceUsages(v []DailyServiceUsages)` + +SetDailyServiceUsages sets DailyServiceUsages field to given value. + + +### GetTotalUsageCreditsUsdBeforeVolumeDiscount + +`func (o *MonthlyUsage) GetTotalUsageCreditsUsdBeforeVolumeDiscount() float32` + +GetTotalUsageCreditsUsdBeforeVolumeDiscount returns the TotalUsageCreditsUsdBeforeVolumeDiscount field if non-nil, zero value otherwise. + +### GetTotalUsageCreditsUsdBeforeVolumeDiscountOk + +`func (o *MonthlyUsage) GetTotalUsageCreditsUsdBeforeVolumeDiscountOk() (*float32, bool)` + +GetTotalUsageCreditsUsdBeforeVolumeDiscountOk returns a tuple with the TotalUsageCreditsUsdBeforeVolumeDiscount field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTotalUsageCreditsUsdBeforeVolumeDiscount + +`func (o *MonthlyUsage) SetTotalUsageCreditsUsdBeforeVolumeDiscount(v float32)` + +SetTotalUsageCreditsUsdBeforeVolumeDiscount sets TotalUsageCreditsUsdBeforeVolumeDiscount field to given value. + + +### GetTotalUsageCreditsUsdAfterVolumeDiscount + +`func (o *MonthlyUsage) GetTotalUsageCreditsUsdAfterVolumeDiscount() float32` + +GetTotalUsageCreditsUsdAfterVolumeDiscount returns the TotalUsageCreditsUsdAfterVolumeDiscount field if non-nil, zero value otherwise. + +### GetTotalUsageCreditsUsdAfterVolumeDiscountOk + +`func (o *MonthlyUsage) GetTotalUsageCreditsUsdAfterVolumeDiscountOk() (*float32, bool)` + +GetTotalUsageCreditsUsdAfterVolumeDiscountOk returns a tuple with the TotalUsageCreditsUsdAfterVolumeDiscount field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTotalUsageCreditsUsdAfterVolumeDiscount + +`func (o *MonthlyUsage) SetTotalUsageCreditsUsdAfterVolumeDiscount(v float32)` + +SetTotalUsageCreditsUsdAfterVolumeDiscount sets TotalUsageCreditsUsdAfterVolumeDiscount field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/MonthlyUsageResponse.md b/docs/MonthlyUsageResponse.md new file mode 100644 index 0000000..9e7f65c --- /dev/null +++ b/docs/MonthlyUsageResponse.md @@ -0,0 +1,51 @@ +# MonthlyUsageResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Data** | [**MonthlyUsage**](MonthlyUsage.md) | | + +## Methods + +### NewMonthlyUsageResponse + +`func NewMonthlyUsageResponse(data MonthlyUsage, ) *MonthlyUsageResponse` + +NewMonthlyUsageResponse instantiates a new MonthlyUsageResponse object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewMonthlyUsageResponseWithDefaults + +`func NewMonthlyUsageResponseWithDefaults() *MonthlyUsageResponse` + +NewMonthlyUsageResponseWithDefaults instantiates a new MonthlyUsageResponse object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetData + +`func (o *MonthlyUsageResponse) GetData() MonthlyUsage` + +GetData returns the Data field if non-nil, zero value otherwise. + +### GetDataOk + +`func (o *MonthlyUsageResponse) GetDataOk() (*MonthlyUsage, bool)` + +GetDataOk returns a tuple with the Data field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetData + +`func (o *MonthlyUsageResponse) SetData(v MonthlyUsage)` + +SetData sets Data field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/PaginationResponse.md b/docs/PaginationResponse.md new file mode 100644 index 0000000..48ee395 --- /dev/null +++ b/docs/PaginationResponse.md @@ -0,0 +1,135 @@ +# PaginationResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Total** | **int32** | The total number of items available across all pages. | +**Offset** | **int32** | The starting position for this page of results. | +**Limit** | **int32** | The maximum number of items returned per page. | +**Desc** | **bool** | Whether the results are sorted in descending order. | +**Count** | **int32** | The number of items returned in this response. | + +## Methods + +### NewPaginationResponse + +`func NewPaginationResponse(total int32, offset int32, limit int32, desc bool, count int32, ) *PaginationResponse` + +NewPaginationResponse instantiates a new PaginationResponse object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewPaginationResponseWithDefaults + +`func NewPaginationResponseWithDefaults() *PaginationResponse` + +NewPaginationResponseWithDefaults instantiates a new PaginationResponse object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetTotal + +`func (o *PaginationResponse) GetTotal() int32` + +GetTotal returns the Total field if non-nil, zero value otherwise. + +### GetTotalOk + +`func (o *PaginationResponse) GetTotalOk() (*int32, bool)` + +GetTotalOk returns a tuple with the Total field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTotal + +`func (o *PaginationResponse) SetTotal(v int32)` + +SetTotal sets Total field to given value. + + +### GetOffset + +`func (o *PaginationResponse) GetOffset() int32` + +GetOffset returns the Offset field if non-nil, zero value otherwise. + +### GetOffsetOk + +`func (o *PaginationResponse) GetOffsetOk() (*int32, bool)` + +GetOffsetOk returns a tuple with the Offset field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetOffset + +`func (o *PaginationResponse) SetOffset(v int32)` + +SetOffset sets Offset field to given value. + + +### GetLimit + +`func (o *PaginationResponse) GetLimit() int32` + +GetLimit returns the Limit field if non-nil, zero value otherwise. + +### GetLimitOk + +`func (o *PaginationResponse) GetLimitOk() (*int32, bool)` + +GetLimitOk returns a tuple with the Limit field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetLimit + +`func (o *PaginationResponse) SetLimit(v int32)` + +SetLimit sets Limit field to given value. + + +### GetDesc + +`func (o *PaginationResponse) GetDesc() bool` + +GetDesc returns the Desc field if non-nil, zero value otherwise. + +### GetDescOk + +`func (o *PaginationResponse) GetDescOk() (*bool, bool)` + +GetDescOk returns a tuple with the Desc field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDesc + +`func (o *PaginationResponse) SetDesc(v bool)` + +SetDesc sets Desc field to given value. + + +### GetCount + +`func (o *PaginationResponse) GetCount() int32` + +GetCount returns the Count field if non-nil, zero value otherwise. + +### GetCountOk + +`func (o *PaginationResponse) GetCountOk() (*int32, bool)` + +GetCountOk returns a tuple with the Count field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCount + +`func (o *PaginationResponse) SetCount(v int32)` + +SetCount sets Count field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/PayPerEventActorPricingInfo.md b/docs/PayPerEventActorPricingInfo.md new file mode 100644 index 0000000..5406002 --- /dev/null +++ b/docs/PayPerEventActorPricingInfo.md @@ -0,0 +1,301 @@ +# PayPerEventActorPricingInfo + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ApifyMarginPercentage** | **float32** | In [0, 1], fraction of pricePerUnitUsd that goes to Apify | +**CreatedAt** | **time.Time** | When this pricing info record has been created | +**StartedAt** | **time.Time** | Since when is this pricing info record effective for a given Actor | +**NotifiedAboutFutureChangeAt** | Pointer to **time.Time** | | [optional] +**NotifiedAboutChangeAt** | Pointer to **time.Time** | | [optional] +**ReasonForChange** | Pointer to **string** | | [optional] +**IsPriceChangeNotificationSuppressed** | Pointer to **bool** | | [optional] +**ForceContainsSignificantPriceChange** | Pointer to **bool** | | [optional] +**PricingModel** | **string** | | +**PricingPerEvent** | [**PayPerEventActorPricingInfoAllOfPricingPerEvent**](PayPerEventActorPricingInfoAllOfPricingPerEvent.md) | | +**MinimalMaxTotalChargeUsd** | Pointer to **NullableFloat32** | | [optional] + +## Methods + +### NewPayPerEventActorPricingInfo + +`func NewPayPerEventActorPricingInfo(apifyMarginPercentage float32, createdAt time.Time, startedAt time.Time, pricingModel string, pricingPerEvent PayPerEventActorPricingInfoAllOfPricingPerEvent, ) *PayPerEventActorPricingInfo` + +NewPayPerEventActorPricingInfo instantiates a new PayPerEventActorPricingInfo object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewPayPerEventActorPricingInfoWithDefaults + +`func NewPayPerEventActorPricingInfoWithDefaults() *PayPerEventActorPricingInfo` + +NewPayPerEventActorPricingInfoWithDefaults instantiates a new PayPerEventActorPricingInfo object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetApifyMarginPercentage + +`func (o *PayPerEventActorPricingInfo) GetApifyMarginPercentage() float32` + +GetApifyMarginPercentage returns the ApifyMarginPercentage field if non-nil, zero value otherwise. + +### GetApifyMarginPercentageOk + +`func (o *PayPerEventActorPricingInfo) GetApifyMarginPercentageOk() (*float32, bool)` + +GetApifyMarginPercentageOk returns a tuple with the ApifyMarginPercentage field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetApifyMarginPercentage + +`func (o *PayPerEventActorPricingInfo) SetApifyMarginPercentage(v float32)` + +SetApifyMarginPercentage sets ApifyMarginPercentage field to given value. + + +### GetCreatedAt + +`func (o *PayPerEventActorPricingInfo) GetCreatedAt() time.Time` + +GetCreatedAt returns the CreatedAt field if non-nil, zero value otherwise. + +### GetCreatedAtOk + +`func (o *PayPerEventActorPricingInfo) GetCreatedAtOk() (*time.Time, bool)` + +GetCreatedAtOk returns a tuple with the CreatedAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCreatedAt + +`func (o *PayPerEventActorPricingInfo) SetCreatedAt(v time.Time)` + +SetCreatedAt sets CreatedAt field to given value. + + +### GetStartedAt + +`func (o *PayPerEventActorPricingInfo) GetStartedAt() time.Time` + +GetStartedAt returns the StartedAt field if non-nil, zero value otherwise. + +### GetStartedAtOk + +`func (o *PayPerEventActorPricingInfo) GetStartedAtOk() (*time.Time, bool)` + +GetStartedAtOk returns a tuple with the StartedAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetStartedAt + +`func (o *PayPerEventActorPricingInfo) SetStartedAt(v time.Time)` + +SetStartedAt sets StartedAt field to given value. + + +### GetNotifiedAboutFutureChangeAt + +`func (o *PayPerEventActorPricingInfo) GetNotifiedAboutFutureChangeAt() time.Time` + +GetNotifiedAboutFutureChangeAt returns the NotifiedAboutFutureChangeAt field if non-nil, zero value otherwise. + +### GetNotifiedAboutFutureChangeAtOk + +`func (o *PayPerEventActorPricingInfo) GetNotifiedAboutFutureChangeAtOk() (*time.Time, bool)` + +GetNotifiedAboutFutureChangeAtOk returns a tuple with the NotifiedAboutFutureChangeAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetNotifiedAboutFutureChangeAt + +`func (o *PayPerEventActorPricingInfo) SetNotifiedAboutFutureChangeAt(v time.Time)` + +SetNotifiedAboutFutureChangeAt sets NotifiedAboutFutureChangeAt field to given value. + +### HasNotifiedAboutFutureChangeAt + +`func (o *PayPerEventActorPricingInfo) HasNotifiedAboutFutureChangeAt() bool` + +HasNotifiedAboutFutureChangeAt returns a boolean if a field has been set. + +### GetNotifiedAboutChangeAt + +`func (o *PayPerEventActorPricingInfo) GetNotifiedAboutChangeAt() time.Time` + +GetNotifiedAboutChangeAt returns the NotifiedAboutChangeAt field if non-nil, zero value otherwise. + +### GetNotifiedAboutChangeAtOk + +`func (o *PayPerEventActorPricingInfo) GetNotifiedAboutChangeAtOk() (*time.Time, bool)` + +GetNotifiedAboutChangeAtOk returns a tuple with the NotifiedAboutChangeAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetNotifiedAboutChangeAt + +`func (o *PayPerEventActorPricingInfo) SetNotifiedAboutChangeAt(v time.Time)` + +SetNotifiedAboutChangeAt sets NotifiedAboutChangeAt field to given value. + +### HasNotifiedAboutChangeAt + +`func (o *PayPerEventActorPricingInfo) HasNotifiedAboutChangeAt() bool` + +HasNotifiedAboutChangeAt returns a boolean if a field has been set. + +### GetReasonForChange + +`func (o *PayPerEventActorPricingInfo) GetReasonForChange() string` + +GetReasonForChange returns the ReasonForChange field if non-nil, zero value otherwise. + +### GetReasonForChangeOk + +`func (o *PayPerEventActorPricingInfo) GetReasonForChangeOk() (*string, bool)` + +GetReasonForChangeOk returns a tuple with the ReasonForChange field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetReasonForChange + +`func (o *PayPerEventActorPricingInfo) SetReasonForChange(v string)` + +SetReasonForChange sets ReasonForChange field to given value. + +### HasReasonForChange + +`func (o *PayPerEventActorPricingInfo) HasReasonForChange() bool` + +HasReasonForChange returns a boolean if a field has been set. + +### GetIsPriceChangeNotificationSuppressed + +`func (o *PayPerEventActorPricingInfo) GetIsPriceChangeNotificationSuppressed() bool` + +GetIsPriceChangeNotificationSuppressed returns the IsPriceChangeNotificationSuppressed field if non-nil, zero value otherwise. + +### GetIsPriceChangeNotificationSuppressedOk + +`func (o *PayPerEventActorPricingInfo) GetIsPriceChangeNotificationSuppressedOk() (*bool, bool)` + +GetIsPriceChangeNotificationSuppressedOk returns a tuple with the IsPriceChangeNotificationSuppressed field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetIsPriceChangeNotificationSuppressed + +`func (o *PayPerEventActorPricingInfo) SetIsPriceChangeNotificationSuppressed(v bool)` + +SetIsPriceChangeNotificationSuppressed sets IsPriceChangeNotificationSuppressed field to given value. + +### HasIsPriceChangeNotificationSuppressed + +`func (o *PayPerEventActorPricingInfo) HasIsPriceChangeNotificationSuppressed() bool` + +HasIsPriceChangeNotificationSuppressed returns a boolean if a field has been set. + +### GetForceContainsSignificantPriceChange + +`func (o *PayPerEventActorPricingInfo) GetForceContainsSignificantPriceChange() bool` + +GetForceContainsSignificantPriceChange returns the ForceContainsSignificantPriceChange field if non-nil, zero value otherwise. + +### GetForceContainsSignificantPriceChangeOk + +`func (o *PayPerEventActorPricingInfo) GetForceContainsSignificantPriceChangeOk() (*bool, bool)` + +GetForceContainsSignificantPriceChangeOk returns a tuple with the ForceContainsSignificantPriceChange field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetForceContainsSignificantPriceChange + +`func (o *PayPerEventActorPricingInfo) SetForceContainsSignificantPriceChange(v bool)` + +SetForceContainsSignificantPriceChange sets ForceContainsSignificantPriceChange field to given value. + +### HasForceContainsSignificantPriceChange + +`func (o *PayPerEventActorPricingInfo) HasForceContainsSignificantPriceChange() bool` + +HasForceContainsSignificantPriceChange returns a boolean if a field has been set. + +### GetPricingModel + +`func (o *PayPerEventActorPricingInfo) GetPricingModel() string` + +GetPricingModel returns the PricingModel field if non-nil, zero value otherwise. + +### GetPricingModelOk + +`func (o *PayPerEventActorPricingInfo) GetPricingModelOk() (*string, bool)` + +GetPricingModelOk returns a tuple with the PricingModel field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPricingModel + +`func (o *PayPerEventActorPricingInfo) SetPricingModel(v string)` + +SetPricingModel sets PricingModel field to given value. + + +### GetPricingPerEvent + +`func (o *PayPerEventActorPricingInfo) GetPricingPerEvent() PayPerEventActorPricingInfoAllOfPricingPerEvent` + +GetPricingPerEvent returns the PricingPerEvent field if non-nil, zero value otherwise. + +### GetPricingPerEventOk + +`func (o *PayPerEventActorPricingInfo) GetPricingPerEventOk() (*PayPerEventActorPricingInfoAllOfPricingPerEvent, bool)` + +GetPricingPerEventOk returns a tuple with the PricingPerEvent field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPricingPerEvent + +`func (o *PayPerEventActorPricingInfo) SetPricingPerEvent(v PayPerEventActorPricingInfoAllOfPricingPerEvent)` + +SetPricingPerEvent sets PricingPerEvent field to given value. + + +### GetMinimalMaxTotalChargeUsd + +`func (o *PayPerEventActorPricingInfo) GetMinimalMaxTotalChargeUsd() float32` + +GetMinimalMaxTotalChargeUsd returns the MinimalMaxTotalChargeUsd field if non-nil, zero value otherwise. + +### GetMinimalMaxTotalChargeUsdOk + +`func (o *PayPerEventActorPricingInfo) GetMinimalMaxTotalChargeUsdOk() (*float32, bool)` + +GetMinimalMaxTotalChargeUsdOk returns a tuple with the MinimalMaxTotalChargeUsd field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMinimalMaxTotalChargeUsd + +`func (o *PayPerEventActorPricingInfo) SetMinimalMaxTotalChargeUsd(v float32)` + +SetMinimalMaxTotalChargeUsd sets MinimalMaxTotalChargeUsd field to given value. + +### HasMinimalMaxTotalChargeUsd + +`func (o *PayPerEventActorPricingInfo) HasMinimalMaxTotalChargeUsd() bool` + +HasMinimalMaxTotalChargeUsd returns a boolean if a field has been set. + +### SetMinimalMaxTotalChargeUsdNil + +`func (o *PayPerEventActorPricingInfo) SetMinimalMaxTotalChargeUsdNil(b bool)` + + SetMinimalMaxTotalChargeUsdNil sets the value for MinimalMaxTotalChargeUsd to be an explicit nil + +### UnsetMinimalMaxTotalChargeUsd +`func (o *PayPerEventActorPricingInfo) UnsetMinimalMaxTotalChargeUsd()` + +UnsetMinimalMaxTotalChargeUsd ensures that no value is present for MinimalMaxTotalChargeUsd, not even an explicit nil + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/PayPerEventActorPricingInfoAllOfPricingPerEvent.md b/docs/PayPerEventActorPricingInfoAllOfPricingPerEvent.md new file mode 100644 index 0000000..7160c47 --- /dev/null +++ b/docs/PayPerEventActorPricingInfoAllOfPricingPerEvent.md @@ -0,0 +1,56 @@ +# PayPerEventActorPricingInfoAllOfPricingPerEvent + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ActorChargeEvents** | Pointer to [**map[string]ActorChargeEvent**](ActorChargeEvent.md) | | [optional] + +## Methods + +### NewPayPerEventActorPricingInfoAllOfPricingPerEvent + +`func NewPayPerEventActorPricingInfoAllOfPricingPerEvent() *PayPerEventActorPricingInfoAllOfPricingPerEvent` + +NewPayPerEventActorPricingInfoAllOfPricingPerEvent instantiates a new PayPerEventActorPricingInfoAllOfPricingPerEvent object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewPayPerEventActorPricingInfoAllOfPricingPerEventWithDefaults + +`func NewPayPerEventActorPricingInfoAllOfPricingPerEventWithDefaults() *PayPerEventActorPricingInfoAllOfPricingPerEvent` + +NewPayPerEventActorPricingInfoAllOfPricingPerEventWithDefaults instantiates a new PayPerEventActorPricingInfoAllOfPricingPerEvent object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetActorChargeEvents + +`func (o *PayPerEventActorPricingInfoAllOfPricingPerEvent) GetActorChargeEvents() map[string]ActorChargeEvent` + +GetActorChargeEvents returns the ActorChargeEvents field if non-nil, zero value otherwise. + +### GetActorChargeEventsOk + +`func (o *PayPerEventActorPricingInfoAllOfPricingPerEvent) GetActorChargeEventsOk() (*map[string]ActorChargeEvent, bool)` + +GetActorChargeEventsOk returns a tuple with the ActorChargeEvents field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetActorChargeEvents + +`func (o *PayPerEventActorPricingInfoAllOfPricingPerEvent) SetActorChargeEvents(v map[string]ActorChargeEvent)` + +SetActorChargeEvents sets ActorChargeEvents field to given value. + +### HasActorChargeEvents + +`func (o *PayPerEventActorPricingInfoAllOfPricingPerEvent) HasActorChargeEvents() bool` + +HasActorChargeEvents returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/Plan.md b/docs/Plan.md new file mode 100644 index 0000000..8e87457 --- /dev/null +++ b/docs/Plan.md @@ -0,0 +1,585 @@ +# Plan + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **string** | | +**Description** | **string** | | +**IsEnabled** | **bool** | | +**MonthlyBasePriceUsd** | **float32** | | +**MonthlyUsageCreditsUsd** | **float32** | | +**UsageDiscountPercent** | Pointer to **float32** | | [optional] +**EnabledPlatformFeatures** | **[]string** | | +**MaxMonthlyUsageUsd** | **float32** | | +**MaxActorMemoryGbytes** | **float32** | | +**MaxMonthlyActorComputeUnits** | **float32** | | +**MaxMonthlyResidentialProxyGbytes** | **float32** | | +**MaxMonthlyProxySerps** | **int32** | | +**MaxMonthlyExternalDataTransferGbytes** | **float32** | | +**MaxActorCount** | **int32** | | +**MaxActorTaskCount** | **int32** | | +**DataRetentionDays** | **int32** | | +**AvailableProxyGroups** | **map[string]int32** | A dictionary mapping proxy group names to the number of available proxies in each group. The keys are proxy group names (e.g., \"RESIDENTIAL\", \"DATACENTER\") and values are the count of available proxies. | +**TeamAccountSeatCount** | **int32** | | +**SupportLevel** | **string** | | +**AvailableAddOns** | **[]string** | | +**Tier** | Pointer to **string** | | [optional] +**ApiRateLimitBoosts** | Pointer to **int32** | | [optional] +**MaxScheduleCount** | Pointer to **int32** | | [optional] +**MaxConcurrentActorRuns** | Pointer to **int32** | | [optional] +**PlanPricing** | Pointer to **map[string]interface{}** | Pricing details for this plan. | [optional] + +## Methods + +### NewPlan + +`func NewPlan(id string, description string, isEnabled bool, monthlyBasePriceUsd float32, monthlyUsageCreditsUsd float32, enabledPlatformFeatures []string, maxMonthlyUsageUsd float32, maxActorMemoryGbytes float32, maxMonthlyActorComputeUnits float32, maxMonthlyResidentialProxyGbytes float32, maxMonthlyProxySerps int32, maxMonthlyExternalDataTransferGbytes float32, maxActorCount int32, maxActorTaskCount int32, dataRetentionDays int32, availableProxyGroups map[string]int32, teamAccountSeatCount int32, supportLevel string, availableAddOns []string, ) *Plan` + +NewPlan instantiates a new Plan object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewPlanWithDefaults + +`func NewPlanWithDefaults() *Plan` + +NewPlanWithDefaults instantiates a new Plan object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetId + +`func (o *Plan) GetId() string` + +GetId returns the Id field if non-nil, zero value otherwise. + +### GetIdOk + +`func (o *Plan) GetIdOk() (*string, bool)` + +GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetId + +`func (o *Plan) SetId(v string)` + +SetId sets Id field to given value. + + +### GetDescription + +`func (o *Plan) GetDescription() string` + +GetDescription returns the Description field if non-nil, zero value otherwise. + +### GetDescriptionOk + +`func (o *Plan) GetDescriptionOk() (*string, bool)` + +GetDescriptionOk returns a tuple with the Description field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDescription + +`func (o *Plan) SetDescription(v string)` + +SetDescription sets Description field to given value. + + +### GetIsEnabled + +`func (o *Plan) GetIsEnabled() bool` + +GetIsEnabled returns the IsEnabled field if non-nil, zero value otherwise. + +### GetIsEnabledOk + +`func (o *Plan) GetIsEnabledOk() (*bool, bool)` + +GetIsEnabledOk returns a tuple with the IsEnabled field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetIsEnabled + +`func (o *Plan) SetIsEnabled(v bool)` + +SetIsEnabled sets IsEnabled field to given value. + + +### GetMonthlyBasePriceUsd + +`func (o *Plan) GetMonthlyBasePriceUsd() float32` + +GetMonthlyBasePriceUsd returns the MonthlyBasePriceUsd field if non-nil, zero value otherwise. + +### GetMonthlyBasePriceUsdOk + +`func (o *Plan) GetMonthlyBasePriceUsdOk() (*float32, bool)` + +GetMonthlyBasePriceUsdOk returns a tuple with the MonthlyBasePriceUsd field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMonthlyBasePriceUsd + +`func (o *Plan) SetMonthlyBasePriceUsd(v float32)` + +SetMonthlyBasePriceUsd sets MonthlyBasePriceUsd field to given value. + + +### GetMonthlyUsageCreditsUsd + +`func (o *Plan) GetMonthlyUsageCreditsUsd() float32` + +GetMonthlyUsageCreditsUsd returns the MonthlyUsageCreditsUsd field if non-nil, zero value otherwise. + +### GetMonthlyUsageCreditsUsdOk + +`func (o *Plan) GetMonthlyUsageCreditsUsdOk() (*float32, bool)` + +GetMonthlyUsageCreditsUsdOk returns a tuple with the MonthlyUsageCreditsUsd field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMonthlyUsageCreditsUsd + +`func (o *Plan) SetMonthlyUsageCreditsUsd(v float32)` + +SetMonthlyUsageCreditsUsd sets MonthlyUsageCreditsUsd field to given value. + + +### GetUsageDiscountPercent + +`func (o *Plan) GetUsageDiscountPercent() float32` + +GetUsageDiscountPercent returns the UsageDiscountPercent field if non-nil, zero value otherwise. + +### GetUsageDiscountPercentOk + +`func (o *Plan) GetUsageDiscountPercentOk() (*float32, bool)` + +GetUsageDiscountPercentOk returns a tuple with the UsageDiscountPercent field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUsageDiscountPercent + +`func (o *Plan) SetUsageDiscountPercent(v float32)` + +SetUsageDiscountPercent sets UsageDiscountPercent field to given value. + +### HasUsageDiscountPercent + +`func (o *Plan) HasUsageDiscountPercent() bool` + +HasUsageDiscountPercent returns a boolean if a field has been set. + +### GetEnabledPlatformFeatures + +`func (o *Plan) GetEnabledPlatformFeatures() []string` + +GetEnabledPlatformFeatures returns the EnabledPlatformFeatures field if non-nil, zero value otherwise. + +### GetEnabledPlatformFeaturesOk + +`func (o *Plan) GetEnabledPlatformFeaturesOk() (*[]string, bool)` + +GetEnabledPlatformFeaturesOk returns a tuple with the EnabledPlatformFeatures field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetEnabledPlatformFeatures + +`func (o *Plan) SetEnabledPlatformFeatures(v []string)` + +SetEnabledPlatformFeatures sets EnabledPlatformFeatures field to given value. + + +### GetMaxMonthlyUsageUsd + +`func (o *Plan) GetMaxMonthlyUsageUsd() float32` + +GetMaxMonthlyUsageUsd returns the MaxMonthlyUsageUsd field if non-nil, zero value otherwise. + +### GetMaxMonthlyUsageUsdOk + +`func (o *Plan) GetMaxMonthlyUsageUsdOk() (*float32, bool)` + +GetMaxMonthlyUsageUsdOk returns a tuple with the MaxMonthlyUsageUsd field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMaxMonthlyUsageUsd + +`func (o *Plan) SetMaxMonthlyUsageUsd(v float32)` + +SetMaxMonthlyUsageUsd sets MaxMonthlyUsageUsd field to given value. + + +### GetMaxActorMemoryGbytes + +`func (o *Plan) GetMaxActorMemoryGbytes() float32` + +GetMaxActorMemoryGbytes returns the MaxActorMemoryGbytes field if non-nil, zero value otherwise. + +### GetMaxActorMemoryGbytesOk + +`func (o *Plan) GetMaxActorMemoryGbytesOk() (*float32, bool)` + +GetMaxActorMemoryGbytesOk returns a tuple with the MaxActorMemoryGbytes field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMaxActorMemoryGbytes + +`func (o *Plan) SetMaxActorMemoryGbytes(v float32)` + +SetMaxActorMemoryGbytes sets MaxActorMemoryGbytes field to given value. + + +### GetMaxMonthlyActorComputeUnits + +`func (o *Plan) GetMaxMonthlyActorComputeUnits() float32` + +GetMaxMonthlyActorComputeUnits returns the MaxMonthlyActorComputeUnits field if non-nil, zero value otherwise. + +### GetMaxMonthlyActorComputeUnitsOk + +`func (o *Plan) GetMaxMonthlyActorComputeUnitsOk() (*float32, bool)` + +GetMaxMonthlyActorComputeUnitsOk returns a tuple with the MaxMonthlyActorComputeUnits field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMaxMonthlyActorComputeUnits + +`func (o *Plan) SetMaxMonthlyActorComputeUnits(v float32)` + +SetMaxMonthlyActorComputeUnits sets MaxMonthlyActorComputeUnits field to given value. + + +### GetMaxMonthlyResidentialProxyGbytes + +`func (o *Plan) GetMaxMonthlyResidentialProxyGbytes() float32` + +GetMaxMonthlyResidentialProxyGbytes returns the MaxMonthlyResidentialProxyGbytes field if non-nil, zero value otherwise. + +### GetMaxMonthlyResidentialProxyGbytesOk + +`func (o *Plan) GetMaxMonthlyResidentialProxyGbytesOk() (*float32, bool)` + +GetMaxMonthlyResidentialProxyGbytesOk returns a tuple with the MaxMonthlyResidentialProxyGbytes field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMaxMonthlyResidentialProxyGbytes + +`func (o *Plan) SetMaxMonthlyResidentialProxyGbytes(v float32)` + +SetMaxMonthlyResidentialProxyGbytes sets MaxMonthlyResidentialProxyGbytes field to given value. + + +### GetMaxMonthlyProxySerps + +`func (o *Plan) GetMaxMonthlyProxySerps() int32` + +GetMaxMonthlyProxySerps returns the MaxMonthlyProxySerps field if non-nil, zero value otherwise. + +### GetMaxMonthlyProxySerpsOk + +`func (o *Plan) GetMaxMonthlyProxySerpsOk() (*int32, bool)` + +GetMaxMonthlyProxySerpsOk returns a tuple with the MaxMonthlyProxySerps field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMaxMonthlyProxySerps + +`func (o *Plan) SetMaxMonthlyProxySerps(v int32)` + +SetMaxMonthlyProxySerps sets MaxMonthlyProxySerps field to given value. + + +### GetMaxMonthlyExternalDataTransferGbytes + +`func (o *Plan) GetMaxMonthlyExternalDataTransferGbytes() float32` + +GetMaxMonthlyExternalDataTransferGbytes returns the MaxMonthlyExternalDataTransferGbytes field if non-nil, zero value otherwise. + +### GetMaxMonthlyExternalDataTransferGbytesOk + +`func (o *Plan) GetMaxMonthlyExternalDataTransferGbytesOk() (*float32, bool)` + +GetMaxMonthlyExternalDataTransferGbytesOk returns a tuple with the MaxMonthlyExternalDataTransferGbytes field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMaxMonthlyExternalDataTransferGbytes + +`func (o *Plan) SetMaxMonthlyExternalDataTransferGbytes(v float32)` + +SetMaxMonthlyExternalDataTransferGbytes sets MaxMonthlyExternalDataTransferGbytes field to given value. + + +### GetMaxActorCount + +`func (o *Plan) GetMaxActorCount() int32` + +GetMaxActorCount returns the MaxActorCount field if non-nil, zero value otherwise. + +### GetMaxActorCountOk + +`func (o *Plan) GetMaxActorCountOk() (*int32, bool)` + +GetMaxActorCountOk returns a tuple with the MaxActorCount field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMaxActorCount + +`func (o *Plan) SetMaxActorCount(v int32)` + +SetMaxActorCount sets MaxActorCount field to given value. + + +### GetMaxActorTaskCount + +`func (o *Plan) GetMaxActorTaskCount() int32` + +GetMaxActorTaskCount returns the MaxActorTaskCount field if non-nil, zero value otherwise. + +### GetMaxActorTaskCountOk + +`func (o *Plan) GetMaxActorTaskCountOk() (*int32, bool)` + +GetMaxActorTaskCountOk returns a tuple with the MaxActorTaskCount field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMaxActorTaskCount + +`func (o *Plan) SetMaxActorTaskCount(v int32)` + +SetMaxActorTaskCount sets MaxActorTaskCount field to given value. + + +### GetDataRetentionDays + +`func (o *Plan) GetDataRetentionDays() int32` + +GetDataRetentionDays returns the DataRetentionDays field if non-nil, zero value otherwise. + +### GetDataRetentionDaysOk + +`func (o *Plan) GetDataRetentionDaysOk() (*int32, bool)` + +GetDataRetentionDaysOk returns a tuple with the DataRetentionDays field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDataRetentionDays + +`func (o *Plan) SetDataRetentionDays(v int32)` + +SetDataRetentionDays sets DataRetentionDays field to given value. + + +### GetAvailableProxyGroups + +`func (o *Plan) GetAvailableProxyGroups() map[string]int32` + +GetAvailableProxyGroups returns the AvailableProxyGroups field if non-nil, zero value otherwise. + +### GetAvailableProxyGroupsOk + +`func (o *Plan) GetAvailableProxyGroupsOk() (*map[string]int32, bool)` + +GetAvailableProxyGroupsOk returns a tuple with the AvailableProxyGroups field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAvailableProxyGroups + +`func (o *Plan) SetAvailableProxyGroups(v map[string]int32)` + +SetAvailableProxyGroups sets AvailableProxyGroups field to given value. + + +### GetTeamAccountSeatCount + +`func (o *Plan) GetTeamAccountSeatCount() int32` + +GetTeamAccountSeatCount returns the TeamAccountSeatCount field if non-nil, zero value otherwise. + +### GetTeamAccountSeatCountOk + +`func (o *Plan) GetTeamAccountSeatCountOk() (*int32, bool)` + +GetTeamAccountSeatCountOk returns a tuple with the TeamAccountSeatCount field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTeamAccountSeatCount + +`func (o *Plan) SetTeamAccountSeatCount(v int32)` + +SetTeamAccountSeatCount sets TeamAccountSeatCount field to given value. + + +### GetSupportLevel + +`func (o *Plan) GetSupportLevel() string` + +GetSupportLevel returns the SupportLevel field if non-nil, zero value otherwise. + +### GetSupportLevelOk + +`func (o *Plan) GetSupportLevelOk() (*string, bool)` + +GetSupportLevelOk returns a tuple with the SupportLevel field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSupportLevel + +`func (o *Plan) SetSupportLevel(v string)` + +SetSupportLevel sets SupportLevel field to given value. + + +### GetAvailableAddOns + +`func (o *Plan) GetAvailableAddOns() []string` + +GetAvailableAddOns returns the AvailableAddOns field if non-nil, zero value otherwise. + +### GetAvailableAddOnsOk + +`func (o *Plan) GetAvailableAddOnsOk() (*[]string, bool)` + +GetAvailableAddOnsOk returns a tuple with the AvailableAddOns field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAvailableAddOns + +`func (o *Plan) SetAvailableAddOns(v []string)` + +SetAvailableAddOns sets AvailableAddOns field to given value. + + +### GetTier + +`func (o *Plan) GetTier() string` + +GetTier returns the Tier field if non-nil, zero value otherwise. + +### GetTierOk + +`func (o *Plan) GetTierOk() (*string, bool)` + +GetTierOk returns a tuple with the Tier field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTier + +`func (o *Plan) SetTier(v string)` + +SetTier sets Tier field to given value. + +### HasTier + +`func (o *Plan) HasTier() bool` + +HasTier returns a boolean if a field has been set. + +### GetApiRateLimitBoosts + +`func (o *Plan) GetApiRateLimitBoosts() int32` + +GetApiRateLimitBoosts returns the ApiRateLimitBoosts field if non-nil, zero value otherwise. + +### GetApiRateLimitBoostsOk + +`func (o *Plan) GetApiRateLimitBoostsOk() (*int32, bool)` + +GetApiRateLimitBoostsOk returns a tuple with the ApiRateLimitBoosts field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetApiRateLimitBoosts + +`func (o *Plan) SetApiRateLimitBoosts(v int32)` + +SetApiRateLimitBoosts sets ApiRateLimitBoosts field to given value. + +### HasApiRateLimitBoosts + +`func (o *Plan) HasApiRateLimitBoosts() bool` + +HasApiRateLimitBoosts returns a boolean if a field has been set. + +### GetMaxScheduleCount + +`func (o *Plan) GetMaxScheduleCount() int32` + +GetMaxScheduleCount returns the MaxScheduleCount field if non-nil, zero value otherwise. + +### GetMaxScheduleCountOk + +`func (o *Plan) GetMaxScheduleCountOk() (*int32, bool)` + +GetMaxScheduleCountOk returns a tuple with the MaxScheduleCount field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMaxScheduleCount + +`func (o *Plan) SetMaxScheduleCount(v int32)` + +SetMaxScheduleCount sets MaxScheduleCount field to given value. + +### HasMaxScheduleCount + +`func (o *Plan) HasMaxScheduleCount() bool` + +HasMaxScheduleCount returns a boolean if a field has been set. + +### GetMaxConcurrentActorRuns + +`func (o *Plan) GetMaxConcurrentActorRuns() int32` + +GetMaxConcurrentActorRuns returns the MaxConcurrentActorRuns field if non-nil, zero value otherwise. + +### GetMaxConcurrentActorRunsOk + +`func (o *Plan) GetMaxConcurrentActorRunsOk() (*int32, bool)` + +GetMaxConcurrentActorRunsOk returns a tuple with the MaxConcurrentActorRuns field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMaxConcurrentActorRuns + +`func (o *Plan) SetMaxConcurrentActorRuns(v int32)` + +SetMaxConcurrentActorRuns sets MaxConcurrentActorRuns field to given value. + +### HasMaxConcurrentActorRuns + +`func (o *Plan) HasMaxConcurrentActorRuns() bool` + +HasMaxConcurrentActorRuns returns a boolean if a field has been set. + +### GetPlanPricing + +`func (o *Plan) GetPlanPricing() map[string]interface{}` + +GetPlanPricing returns the PlanPricing field if non-nil, zero value otherwise. + +### GetPlanPricingOk + +`func (o *Plan) GetPlanPricingOk() (*map[string]interface{}, bool)` + +GetPlanPricingOk returns a tuple with the PlanPricing field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPlanPricing + +`func (o *Plan) SetPlanPricing(v map[string]interface{})` + +SetPlanPricing sets PlanPricing field to given value. + +### HasPlanPricing + +`func (o *Plan) HasPlanPricing() bool` + +HasPlanPricing returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/PricePerDatasetItemActorPricingInfo.md b/docs/PricePerDatasetItemActorPricingInfo.md new file mode 100644 index 0000000..0846de6 --- /dev/null +++ b/docs/PricePerDatasetItemActorPricingInfo.md @@ -0,0 +1,317 @@ +# PricePerDatasetItemActorPricingInfo + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ApifyMarginPercentage** | **float32** | In [0, 1], fraction of pricePerUnitUsd that goes to Apify | +**CreatedAt** | **time.Time** | When this pricing info record has been created | +**StartedAt** | **time.Time** | Since when is this pricing info record effective for a given Actor | +**NotifiedAboutFutureChangeAt** | Pointer to **time.Time** | | [optional] +**NotifiedAboutChangeAt** | Pointer to **time.Time** | | [optional] +**ReasonForChange** | Pointer to **string** | | [optional] +**IsPriceChangeNotificationSuppressed** | Pointer to **bool** | | [optional] +**ForceContainsSignificantPriceChange** | Pointer to **bool** | | [optional] +**PricingModel** | **string** | | +**UnitName** | **string** | Name of the unit that is being charged | +**PricePerUnitUsd** | Pointer to **float32** | Price per unit in USD. Mutually exclusive with `tieredPricing` - exactly one of the two is present on a pricing record. | [optional] +**TieredPricing** | Pointer to [**map[string]TieredPricingPerDatasetItemEntry**](TieredPricingPerDatasetItemEntry.md) | Tiered price-per-dataset-item pricing, keyed by subscription tier (e.g. `FREE`, `BRONZE`, `SILVER`, `GOLD`, `PLATINUM`, `DIAMOND`). The actual price applied to a run is resolved from the user's tier. | [optional] + +## Methods + +### NewPricePerDatasetItemActorPricingInfo + +`func NewPricePerDatasetItemActorPricingInfo(apifyMarginPercentage float32, createdAt time.Time, startedAt time.Time, pricingModel string, unitName string, ) *PricePerDatasetItemActorPricingInfo` + +NewPricePerDatasetItemActorPricingInfo instantiates a new PricePerDatasetItemActorPricingInfo object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewPricePerDatasetItemActorPricingInfoWithDefaults + +`func NewPricePerDatasetItemActorPricingInfoWithDefaults() *PricePerDatasetItemActorPricingInfo` + +NewPricePerDatasetItemActorPricingInfoWithDefaults instantiates a new PricePerDatasetItemActorPricingInfo object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetApifyMarginPercentage + +`func (o *PricePerDatasetItemActorPricingInfo) GetApifyMarginPercentage() float32` + +GetApifyMarginPercentage returns the ApifyMarginPercentage field if non-nil, zero value otherwise. + +### GetApifyMarginPercentageOk + +`func (o *PricePerDatasetItemActorPricingInfo) GetApifyMarginPercentageOk() (*float32, bool)` + +GetApifyMarginPercentageOk returns a tuple with the ApifyMarginPercentage field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetApifyMarginPercentage + +`func (o *PricePerDatasetItemActorPricingInfo) SetApifyMarginPercentage(v float32)` + +SetApifyMarginPercentage sets ApifyMarginPercentage field to given value. + + +### GetCreatedAt + +`func (o *PricePerDatasetItemActorPricingInfo) GetCreatedAt() time.Time` + +GetCreatedAt returns the CreatedAt field if non-nil, zero value otherwise. + +### GetCreatedAtOk + +`func (o *PricePerDatasetItemActorPricingInfo) GetCreatedAtOk() (*time.Time, bool)` + +GetCreatedAtOk returns a tuple with the CreatedAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCreatedAt + +`func (o *PricePerDatasetItemActorPricingInfo) SetCreatedAt(v time.Time)` + +SetCreatedAt sets CreatedAt field to given value. + + +### GetStartedAt + +`func (o *PricePerDatasetItemActorPricingInfo) GetStartedAt() time.Time` + +GetStartedAt returns the StartedAt field if non-nil, zero value otherwise. + +### GetStartedAtOk + +`func (o *PricePerDatasetItemActorPricingInfo) GetStartedAtOk() (*time.Time, bool)` + +GetStartedAtOk returns a tuple with the StartedAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetStartedAt + +`func (o *PricePerDatasetItemActorPricingInfo) SetStartedAt(v time.Time)` + +SetStartedAt sets StartedAt field to given value. + + +### GetNotifiedAboutFutureChangeAt + +`func (o *PricePerDatasetItemActorPricingInfo) GetNotifiedAboutFutureChangeAt() time.Time` + +GetNotifiedAboutFutureChangeAt returns the NotifiedAboutFutureChangeAt field if non-nil, zero value otherwise. + +### GetNotifiedAboutFutureChangeAtOk + +`func (o *PricePerDatasetItemActorPricingInfo) GetNotifiedAboutFutureChangeAtOk() (*time.Time, bool)` + +GetNotifiedAboutFutureChangeAtOk returns a tuple with the NotifiedAboutFutureChangeAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetNotifiedAboutFutureChangeAt + +`func (o *PricePerDatasetItemActorPricingInfo) SetNotifiedAboutFutureChangeAt(v time.Time)` + +SetNotifiedAboutFutureChangeAt sets NotifiedAboutFutureChangeAt field to given value. + +### HasNotifiedAboutFutureChangeAt + +`func (o *PricePerDatasetItemActorPricingInfo) HasNotifiedAboutFutureChangeAt() bool` + +HasNotifiedAboutFutureChangeAt returns a boolean if a field has been set. + +### GetNotifiedAboutChangeAt + +`func (o *PricePerDatasetItemActorPricingInfo) GetNotifiedAboutChangeAt() time.Time` + +GetNotifiedAboutChangeAt returns the NotifiedAboutChangeAt field if non-nil, zero value otherwise. + +### GetNotifiedAboutChangeAtOk + +`func (o *PricePerDatasetItemActorPricingInfo) GetNotifiedAboutChangeAtOk() (*time.Time, bool)` + +GetNotifiedAboutChangeAtOk returns a tuple with the NotifiedAboutChangeAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetNotifiedAboutChangeAt + +`func (o *PricePerDatasetItemActorPricingInfo) SetNotifiedAboutChangeAt(v time.Time)` + +SetNotifiedAboutChangeAt sets NotifiedAboutChangeAt field to given value. + +### HasNotifiedAboutChangeAt + +`func (o *PricePerDatasetItemActorPricingInfo) HasNotifiedAboutChangeAt() bool` + +HasNotifiedAboutChangeAt returns a boolean if a field has been set. + +### GetReasonForChange + +`func (o *PricePerDatasetItemActorPricingInfo) GetReasonForChange() string` + +GetReasonForChange returns the ReasonForChange field if non-nil, zero value otherwise. + +### GetReasonForChangeOk + +`func (o *PricePerDatasetItemActorPricingInfo) GetReasonForChangeOk() (*string, bool)` + +GetReasonForChangeOk returns a tuple with the ReasonForChange field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetReasonForChange + +`func (o *PricePerDatasetItemActorPricingInfo) SetReasonForChange(v string)` + +SetReasonForChange sets ReasonForChange field to given value. + +### HasReasonForChange + +`func (o *PricePerDatasetItemActorPricingInfo) HasReasonForChange() bool` + +HasReasonForChange returns a boolean if a field has been set. + +### GetIsPriceChangeNotificationSuppressed + +`func (o *PricePerDatasetItemActorPricingInfo) GetIsPriceChangeNotificationSuppressed() bool` + +GetIsPriceChangeNotificationSuppressed returns the IsPriceChangeNotificationSuppressed field if non-nil, zero value otherwise. + +### GetIsPriceChangeNotificationSuppressedOk + +`func (o *PricePerDatasetItemActorPricingInfo) GetIsPriceChangeNotificationSuppressedOk() (*bool, bool)` + +GetIsPriceChangeNotificationSuppressedOk returns a tuple with the IsPriceChangeNotificationSuppressed field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetIsPriceChangeNotificationSuppressed + +`func (o *PricePerDatasetItemActorPricingInfo) SetIsPriceChangeNotificationSuppressed(v bool)` + +SetIsPriceChangeNotificationSuppressed sets IsPriceChangeNotificationSuppressed field to given value. + +### HasIsPriceChangeNotificationSuppressed + +`func (o *PricePerDatasetItemActorPricingInfo) HasIsPriceChangeNotificationSuppressed() bool` + +HasIsPriceChangeNotificationSuppressed returns a boolean if a field has been set. + +### GetForceContainsSignificantPriceChange + +`func (o *PricePerDatasetItemActorPricingInfo) GetForceContainsSignificantPriceChange() bool` + +GetForceContainsSignificantPriceChange returns the ForceContainsSignificantPriceChange field if non-nil, zero value otherwise. + +### GetForceContainsSignificantPriceChangeOk + +`func (o *PricePerDatasetItemActorPricingInfo) GetForceContainsSignificantPriceChangeOk() (*bool, bool)` + +GetForceContainsSignificantPriceChangeOk returns a tuple with the ForceContainsSignificantPriceChange field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetForceContainsSignificantPriceChange + +`func (o *PricePerDatasetItemActorPricingInfo) SetForceContainsSignificantPriceChange(v bool)` + +SetForceContainsSignificantPriceChange sets ForceContainsSignificantPriceChange field to given value. + +### HasForceContainsSignificantPriceChange + +`func (o *PricePerDatasetItemActorPricingInfo) HasForceContainsSignificantPriceChange() bool` + +HasForceContainsSignificantPriceChange returns a boolean if a field has been set. + +### GetPricingModel + +`func (o *PricePerDatasetItemActorPricingInfo) GetPricingModel() string` + +GetPricingModel returns the PricingModel field if non-nil, zero value otherwise. + +### GetPricingModelOk + +`func (o *PricePerDatasetItemActorPricingInfo) GetPricingModelOk() (*string, bool)` + +GetPricingModelOk returns a tuple with the PricingModel field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPricingModel + +`func (o *PricePerDatasetItemActorPricingInfo) SetPricingModel(v string)` + +SetPricingModel sets PricingModel field to given value. + + +### GetUnitName + +`func (o *PricePerDatasetItemActorPricingInfo) GetUnitName() string` + +GetUnitName returns the UnitName field if non-nil, zero value otherwise. + +### GetUnitNameOk + +`func (o *PricePerDatasetItemActorPricingInfo) GetUnitNameOk() (*string, bool)` + +GetUnitNameOk returns a tuple with the UnitName field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUnitName + +`func (o *PricePerDatasetItemActorPricingInfo) SetUnitName(v string)` + +SetUnitName sets UnitName field to given value. + + +### GetPricePerUnitUsd + +`func (o *PricePerDatasetItemActorPricingInfo) GetPricePerUnitUsd() float32` + +GetPricePerUnitUsd returns the PricePerUnitUsd field if non-nil, zero value otherwise. + +### GetPricePerUnitUsdOk + +`func (o *PricePerDatasetItemActorPricingInfo) GetPricePerUnitUsdOk() (*float32, bool)` + +GetPricePerUnitUsdOk returns a tuple with the PricePerUnitUsd field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPricePerUnitUsd + +`func (o *PricePerDatasetItemActorPricingInfo) SetPricePerUnitUsd(v float32)` + +SetPricePerUnitUsd sets PricePerUnitUsd field to given value. + +### HasPricePerUnitUsd + +`func (o *PricePerDatasetItemActorPricingInfo) HasPricePerUnitUsd() bool` + +HasPricePerUnitUsd returns a boolean if a field has been set. + +### GetTieredPricing + +`func (o *PricePerDatasetItemActorPricingInfo) GetTieredPricing() map[string]TieredPricingPerDatasetItemEntry` + +GetTieredPricing returns the TieredPricing field if non-nil, zero value otherwise. + +### GetTieredPricingOk + +`func (o *PricePerDatasetItemActorPricingInfo) GetTieredPricingOk() (*map[string]TieredPricingPerDatasetItemEntry, bool)` + +GetTieredPricingOk returns a tuple with the TieredPricing field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTieredPricing + +`func (o *PricePerDatasetItemActorPricingInfo) SetTieredPricing(v map[string]TieredPricingPerDatasetItemEntry)` + +SetTieredPricing sets TieredPricing field to given value. + +### HasTieredPricing + +`func (o *PricePerDatasetItemActorPricingInfo) HasTieredPricing() bool` + +HasTieredPricing returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/PriceTiers.md b/docs/PriceTiers.md new file mode 100644 index 0000000..2cf87f0 --- /dev/null +++ b/docs/PriceTiers.md @@ -0,0 +1,135 @@ +# PriceTiers + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**QuantityAbove** | **float32** | | +**DiscountPercent** | **float32** | | +**TierQuantity** | **float32** | | +**UnitPriceUsd** | **float32** | | +**PriceUsd** | **float32** | | + +## Methods + +### NewPriceTiers + +`func NewPriceTiers(quantityAbove float32, discountPercent float32, tierQuantity float32, unitPriceUsd float32, priceUsd float32, ) *PriceTiers` + +NewPriceTiers instantiates a new PriceTiers object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewPriceTiersWithDefaults + +`func NewPriceTiersWithDefaults() *PriceTiers` + +NewPriceTiersWithDefaults instantiates a new PriceTiers object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetQuantityAbove + +`func (o *PriceTiers) GetQuantityAbove() float32` + +GetQuantityAbove returns the QuantityAbove field if non-nil, zero value otherwise. + +### GetQuantityAboveOk + +`func (o *PriceTiers) GetQuantityAboveOk() (*float32, bool)` + +GetQuantityAboveOk returns a tuple with the QuantityAbove field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetQuantityAbove + +`func (o *PriceTiers) SetQuantityAbove(v float32)` + +SetQuantityAbove sets QuantityAbove field to given value. + + +### GetDiscountPercent + +`func (o *PriceTiers) GetDiscountPercent() float32` + +GetDiscountPercent returns the DiscountPercent field if non-nil, zero value otherwise. + +### GetDiscountPercentOk + +`func (o *PriceTiers) GetDiscountPercentOk() (*float32, bool)` + +GetDiscountPercentOk returns a tuple with the DiscountPercent field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDiscountPercent + +`func (o *PriceTiers) SetDiscountPercent(v float32)` + +SetDiscountPercent sets DiscountPercent field to given value. + + +### GetTierQuantity + +`func (o *PriceTiers) GetTierQuantity() float32` + +GetTierQuantity returns the TierQuantity field if non-nil, zero value otherwise. + +### GetTierQuantityOk + +`func (o *PriceTiers) GetTierQuantityOk() (*float32, bool)` + +GetTierQuantityOk returns a tuple with the TierQuantity field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTierQuantity + +`func (o *PriceTiers) SetTierQuantity(v float32)` + +SetTierQuantity sets TierQuantity field to given value. + + +### GetUnitPriceUsd + +`func (o *PriceTiers) GetUnitPriceUsd() float32` + +GetUnitPriceUsd returns the UnitPriceUsd field if non-nil, zero value otherwise. + +### GetUnitPriceUsdOk + +`func (o *PriceTiers) GetUnitPriceUsdOk() (*float32, bool)` + +GetUnitPriceUsdOk returns a tuple with the UnitPriceUsd field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUnitPriceUsd + +`func (o *PriceTiers) SetUnitPriceUsd(v float32)` + +SetUnitPriceUsd sets UnitPriceUsd field to given value. + + +### GetPriceUsd + +`func (o *PriceTiers) GetPriceUsd() float32` + +GetPriceUsd returns the PriceUsd field if non-nil, zero value otherwise. + +### GetPriceUsdOk + +`func (o *PriceTiers) GetPriceUsdOk() (*float32, bool)` + +GetPriceUsdOk returns a tuple with the PriceUsd field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPriceUsd + +`func (o *PriceTiers) SetPriceUsd(v float32)` + +SetPriceUsd sets PriceUsd field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/PrivateUserDataResponse.md b/docs/PrivateUserDataResponse.md new file mode 100644 index 0000000..2fd55b4 --- /dev/null +++ b/docs/PrivateUserDataResponse.md @@ -0,0 +1,51 @@ +# PrivateUserDataResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Data** | [**UserPrivateInfo**](UserPrivateInfo.md) | | + +## Methods + +### NewPrivateUserDataResponse + +`func NewPrivateUserDataResponse(data UserPrivateInfo, ) *PrivateUserDataResponse` + +NewPrivateUserDataResponse instantiates a new PrivateUserDataResponse object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewPrivateUserDataResponseWithDefaults + +`func NewPrivateUserDataResponseWithDefaults() *PrivateUserDataResponse` + +NewPrivateUserDataResponseWithDefaults instantiates a new PrivateUserDataResponse object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetData + +`func (o *PrivateUserDataResponse) GetData() UserPrivateInfo` + +GetData returns the Data field if non-nil, zero value otherwise. + +### GetDataOk + +`func (o *PrivateUserDataResponse) GetDataOk() (*UserPrivateInfo, bool)` + +GetDataOk returns a tuple with the Data field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetData + +`func (o *PrivateUserDataResponse) SetData(v UserPrivateInfo)` + +SetData sets Data field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/Profile.md b/docs/Profile.md new file mode 100644 index 0000000..8d627a4 --- /dev/null +++ b/docs/Profile.md @@ -0,0 +1,186 @@ +# Profile + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Bio** | Pointer to **string** | | [optional] +**Name** | Pointer to **string** | | [optional] +**PictureUrl** | Pointer to **string** | | [optional] +**GithubUsername** | Pointer to **string** | | [optional] +**WebsiteUrl** | Pointer to **string** | | [optional] +**TwitterUsername** | Pointer to **string** | | [optional] + +## Methods + +### NewProfile + +`func NewProfile() *Profile` + +NewProfile instantiates a new Profile object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewProfileWithDefaults + +`func NewProfileWithDefaults() *Profile` + +NewProfileWithDefaults instantiates a new Profile object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetBio + +`func (o *Profile) GetBio() string` + +GetBio returns the Bio field if non-nil, zero value otherwise. + +### GetBioOk + +`func (o *Profile) GetBioOk() (*string, bool)` + +GetBioOk returns a tuple with the Bio field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetBio + +`func (o *Profile) SetBio(v string)` + +SetBio sets Bio field to given value. + +### HasBio + +`func (o *Profile) HasBio() bool` + +HasBio returns a boolean if a field has been set. + +### GetName + +`func (o *Profile) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *Profile) GetNameOk() (*string, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetName + +`func (o *Profile) SetName(v string)` + +SetName sets Name field to given value. + +### HasName + +`func (o *Profile) HasName() bool` + +HasName returns a boolean if a field has been set. + +### GetPictureUrl + +`func (o *Profile) GetPictureUrl() string` + +GetPictureUrl returns the PictureUrl field if non-nil, zero value otherwise. + +### GetPictureUrlOk + +`func (o *Profile) GetPictureUrlOk() (*string, bool)` + +GetPictureUrlOk returns a tuple with the PictureUrl field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPictureUrl + +`func (o *Profile) SetPictureUrl(v string)` + +SetPictureUrl sets PictureUrl field to given value. + +### HasPictureUrl + +`func (o *Profile) HasPictureUrl() bool` + +HasPictureUrl returns a boolean if a field has been set. + +### GetGithubUsername + +`func (o *Profile) GetGithubUsername() string` + +GetGithubUsername returns the GithubUsername field if non-nil, zero value otherwise. + +### GetGithubUsernameOk + +`func (o *Profile) GetGithubUsernameOk() (*string, bool)` + +GetGithubUsernameOk returns a tuple with the GithubUsername field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetGithubUsername + +`func (o *Profile) SetGithubUsername(v string)` + +SetGithubUsername sets GithubUsername field to given value. + +### HasGithubUsername + +`func (o *Profile) HasGithubUsername() bool` + +HasGithubUsername returns a boolean if a field has been set. + +### GetWebsiteUrl + +`func (o *Profile) GetWebsiteUrl() string` + +GetWebsiteUrl returns the WebsiteUrl field if non-nil, zero value otherwise. + +### GetWebsiteUrlOk + +`func (o *Profile) GetWebsiteUrlOk() (*string, bool)` + +GetWebsiteUrlOk returns a tuple with the WebsiteUrl field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetWebsiteUrl + +`func (o *Profile) SetWebsiteUrl(v string)` + +SetWebsiteUrl sets WebsiteUrl field to given value. + +### HasWebsiteUrl + +`func (o *Profile) HasWebsiteUrl() bool` + +HasWebsiteUrl returns a boolean if a field has been set. + +### GetTwitterUsername + +`func (o *Profile) GetTwitterUsername() string` + +GetTwitterUsername returns the TwitterUsername field if non-nil, zero value otherwise. + +### GetTwitterUsernameOk + +`func (o *Profile) GetTwitterUsernameOk() (*string, bool)` + +GetTwitterUsernameOk returns a tuple with the TwitterUsername field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTwitterUsername + +`func (o *Profile) SetTwitterUsername(v string)` + +SetTwitterUsername sets TwitterUsername field to given value. + +### HasTwitterUsername + +`func (o *Profile) HasTwitterUsername() bool` + +HasTwitterUsername returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ProlongRequestLockResponse.md b/docs/ProlongRequestLockResponse.md new file mode 100644 index 0000000..8874909 --- /dev/null +++ b/docs/ProlongRequestLockResponse.md @@ -0,0 +1,51 @@ +# ProlongRequestLockResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Data** | [**RequestLockInfo**](RequestLockInfo.md) | | + +## Methods + +### NewProlongRequestLockResponse + +`func NewProlongRequestLockResponse(data RequestLockInfo, ) *ProlongRequestLockResponse` + +NewProlongRequestLockResponse instantiates a new ProlongRequestLockResponse object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewProlongRequestLockResponseWithDefaults + +`func NewProlongRequestLockResponseWithDefaults() *ProlongRequestLockResponse` + +NewProlongRequestLockResponseWithDefaults instantiates a new ProlongRequestLockResponse object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetData + +`func (o *ProlongRequestLockResponse) GetData() RequestLockInfo` + +GetData returns the Data field if non-nil, zero value otherwise. + +### GetDataOk + +`func (o *ProlongRequestLockResponse) GetDataOk() (*RequestLockInfo, bool)` + +GetDataOk returns a tuple with the Data field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetData + +`func (o *ProlongRequestLockResponse) SetData(v RequestLockInfo)` + +SetData sets Data field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/Proxy.md b/docs/Proxy.md new file mode 100644 index 0000000..b967056 --- /dev/null +++ b/docs/Proxy.md @@ -0,0 +1,72 @@ +# Proxy + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Password** | **string** | | +**Groups** | [**[]ProxyGroup**](ProxyGroup.md) | | + +## Methods + +### NewProxy + +`func NewProxy(password string, groups []ProxyGroup, ) *Proxy` + +NewProxy instantiates a new Proxy object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewProxyWithDefaults + +`func NewProxyWithDefaults() *Proxy` + +NewProxyWithDefaults instantiates a new Proxy object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetPassword + +`func (o *Proxy) GetPassword() string` + +GetPassword returns the Password field if non-nil, zero value otherwise. + +### GetPasswordOk + +`func (o *Proxy) GetPasswordOk() (*string, bool)` + +GetPasswordOk returns a tuple with the Password field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPassword + +`func (o *Proxy) SetPassword(v string)` + +SetPassword sets Password field to given value. + + +### GetGroups + +`func (o *Proxy) GetGroups() []ProxyGroup` + +GetGroups returns the Groups field if non-nil, zero value otherwise. + +### GetGroupsOk + +`func (o *Proxy) GetGroupsOk() (*[]ProxyGroup, bool)` + +GetGroupsOk returns a tuple with the Groups field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetGroups + +`func (o *Proxy) SetGroups(v []ProxyGroup)` + +SetGroups sets Groups field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ProxyGroup.md b/docs/ProxyGroup.md new file mode 100644 index 0000000..a7a944d --- /dev/null +++ b/docs/ProxyGroup.md @@ -0,0 +1,103 @@ +# ProxyGroup + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Name** | **string** | | +**Description** | **NullableString** | | +**AvailableCount** | **int32** | | + +## Methods + +### NewProxyGroup + +`func NewProxyGroup(name string, description NullableString, availableCount int32, ) *ProxyGroup` + +NewProxyGroup instantiates a new ProxyGroup object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewProxyGroupWithDefaults + +`func NewProxyGroupWithDefaults() *ProxyGroup` + +NewProxyGroupWithDefaults instantiates a new ProxyGroup object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetName + +`func (o *ProxyGroup) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *ProxyGroup) GetNameOk() (*string, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetName + +`func (o *ProxyGroup) SetName(v string)` + +SetName sets Name field to given value. + + +### GetDescription + +`func (o *ProxyGroup) GetDescription() string` + +GetDescription returns the Description field if non-nil, zero value otherwise. + +### GetDescriptionOk + +`func (o *ProxyGroup) GetDescriptionOk() (*string, bool)` + +GetDescriptionOk returns a tuple with the Description field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDescription + +`func (o *ProxyGroup) SetDescription(v string)` + +SetDescription sets Description field to given value. + + +### SetDescriptionNil + +`func (o *ProxyGroup) SetDescriptionNil(b bool)` + + SetDescriptionNil sets the value for Description to be an explicit nil + +### UnsetDescription +`func (o *ProxyGroup) UnsetDescription()` + +UnsetDescription ensures that no value is present for Description, not even an explicit nil +### GetAvailableCount + +`func (o *ProxyGroup) GetAvailableCount() int32` + +GetAvailableCount returns the AvailableCount field if non-nil, zero value otherwise. + +### GetAvailableCountOk + +`func (o *ProxyGroup) GetAvailableCountOk() (*int32, bool)` + +GetAvailableCountOk returns a tuple with the AvailableCount field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAvailableCount + +`func (o *ProxyGroup) SetAvailableCount(v int32)` + +SetAvailableCount sets AvailableCount field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/PublicUserDataResponse.md b/docs/PublicUserDataResponse.md new file mode 100644 index 0000000..638cf84 --- /dev/null +++ b/docs/PublicUserDataResponse.md @@ -0,0 +1,51 @@ +# PublicUserDataResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Data** | [**UserPublicInfo**](UserPublicInfo.md) | | + +## Methods + +### NewPublicUserDataResponse + +`func NewPublicUserDataResponse(data UserPublicInfo, ) *PublicUserDataResponse` + +NewPublicUserDataResponse instantiates a new PublicUserDataResponse object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewPublicUserDataResponseWithDefaults + +`func NewPublicUserDataResponseWithDefaults() *PublicUserDataResponse` + +NewPublicUserDataResponseWithDefaults instantiates a new PublicUserDataResponse object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetData + +`func (o *PublicUserDataResponse) GetData() UserPublicInfo` + +GetData returns the Data field if non-nil, zero value otherwise. + +### GetDataOk + +`func (o *PublicUserDataResponse) GetDataOk() (*UserPublicInfo, bool)` + +GetDataOk returns a tuple with the Data field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetData + +`func (o *PublicUserDataResponse) SetData(v UserPublicInfo)` + +SetData sets Data field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/PutItemResponseError.md b/docs/PutItemResponseError.md new file mode 100644 index 0000000..63c0f27 --- /dev/null +++ b/docs/PutItemResponseError.md @@ -0,0 +1,51 @@ +# PutItemResponseError + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Error** | [**DatasetSchemaValidationError**](DatasetSchemaValidationError.md) | | + +## Methods + +### NewPutItemResponseError + +`func NewPutItemResponseError(error_ DatasetSchemaValidationError, ) *PutItemResponseError` + +NewPutItemResponseError instantiates a new PutItemResponseError object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewPutItemResponseErrorWithDefaults + +`func NewPutItemResponseErrorWithDefaults() *PutItemResponseError` + +NewPutItemResponseErrorWithDefaults instantiates a new PutItemResponseError object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetError + +`func (o *PutItemResponseError) GetError() DatasetSchemaValidationError` + +GetError returns the Error field if non-nil, zero value otherwise. + +### GetErrorOk + +`func (o *PutItemResponseError) GetErrorOk() (*DatasetSchemaValidationError, bool)` + +GetErrorOk returns a tuple with the Error field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetError + +`func (o *PutItemResponseError) SetError(v DatasetSchemaValidationError)` + +SetError sets Error field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/Request.md b/docs/Request.md new file mode 100644 index 0000000..80f6016 --- /dev/null +++ b/docs/Request.md @@ -0,0 +1,352 @@ +# Request + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**UniqueKey** | Pointer to **string** | A unique key used for request de-duplication. Requests with the same unique key are considered identical. | [optional] +**Url** | Pointer to **string** | The URL of the request. | [optional] +**Method** | Pointer to [**HttpMethod**](HttpMethod.md) | | [optional] +**RetryCount** | Pointer to **int32** | The number of times this request has been retried. | [optional] +**LoadedUrl** | Pointer to **string** | The final URL that was loaded, after redirects (if any). | [optional] +**Payload** | Pointer to [**NullableRequestBasePayload**](RequestBasePayload.md) | | [optional] +**Headers** | Pointer to **map[string]interface{}** | HTTP headers sent with the request. | [optional] +**UserData** | Pointer to **map[string]interface{}** | Custom user data attached to the request. Can contain arbitrary fields. | [optional] +**NoRetry** | Pointer to **bool** | Indicates whether the request should not be retried if processing fails. | [optional] +**ErrorMessages** | Pointer to **[]string** | Error messages recorded from failed processing attempts. | [optional] +**HandledAt** | Pointer to **time.Time** | The timestamp when the request was marked as handled, if applicable. | [optional] +**Id** | Pointer to **string** | A unique identifier assigned to the request. | [optional] + +## Methods + +### NewRequest + +`func NewRequest() *Request` + +NewRequest instantiates a new Request object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewRequestWithDefaults + +`func NewRequestWithDefaults() *Request` + +NewRequestWithDefaults instantiates a new Request object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetUniqueKey + +`func (o *Request) GetUniqueKey() string` + +GetUniqueKey returns the UniqueKey field if non-nil, zero value otherwise. + +### GetUniqueKeyOk + +`func (o *Request) GetUniqueKeyOk() (*string, bool)` + +GetUniqueKeyOk returns a tuple with the UniqueKey field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUniqueKey + +`func (o *Request) SetUniqueKey(v string)` + +SetUniqueKey sets UniqueKey field to given value. + +### HasUniqueKey + +`func (o *Request) HasUniqueKey() bool` + +HasUniqueKey returns a boolean if a field has been set. + +### GetUrl + +`func (o *Request) GetUrl() string` + +GetUrl returns the Url field if non-nil, zero value otherwise. + +### GetUrlOk + +`func (o *Request) GetUrlOk() (*string, bool)` + +GetUrlOk returns a tuple with the Url field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUrl + +`func (o *Request) SetUrl(v string)` + +SetUrl sets Url field to given value. + +### HasUrl + +`func (o *Request) HasUrl() bool` + +HasUrl returns a boolean if a field has been set. + +### GetMethod + +`func (o *Request) GetMethod() HttpMethod` + +GetMethod returns the Method field if non-nil, zero value otherwise. + +### GetMethodOk + +`func (o *Request) GetMethodOk() (*HttpMethod, bool)` + +GetMethodOk returns a tuple with the Method field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMethod + +`func (o *Request) SetMethod(v HttpMethod)` + +SetMethod sets Method field to given value. + +### HasMethod + +`func (o *Request) HasMethod() bool` + +HasMethod returns a boolean if a field has been set. + +### GetRetryCount + +`func (o *Request) GetRetryCount() int32` + +GetRetryCount returns the RetryCount field if non-nil, zero value otherwise. + +### GetRetryCountOk + +`func (o *Request) GetRetryCountOk() (*int32, bool)` + +GetRetryCountOk returns a tuple with the RetryCount field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRetryCount + +`func (o *Request) SetRetryCount(v int32)` + +SetRetryCount sets RetryCount field to given value. + +### HasRetryCount + +`func (o *Request) HasRetryCount() bool` + +HasRetryCount returns a boolean if a field has been set. + +### GetLoadedUrl + +`func (o *Request) GetLoadedUrl() string` + +GetLoadedUrl returns the LoadedUrl field if non-nil, zero value otherwise. + +### GetLoadedUrlOk + +`func (o *Request) GetLoadedUrlOk() (*string, bool)` + +GetLoadedUrlOk returns a tuple with the LoadedUrl field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetLoadedUrl + +`func (o *Request) SetLoadedUrl(v string)` + +SetLoadedUrl sets LoadedUrl field to given value. + +### HasLoadedUrl + +`func (o *Request) HasLoadedUrl() bool` + +HasLoadedUrl returns a boolean if a field has been set. + +### GetPayload + +`func (o *Request) GetPayload() RequestBasePayload` + +GetPayload returns the Payload field if non-nil, zero value otherwise. + +### GetPayloadOk + +`func (o *Request) GetPayloadOk() (*RequestBasePayload, bool)` + +GetPayloadOk returns a tuple with the Payload field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPayload + +`func (o *Request) SetPayload(v RequestBasePayload)` + +SetPayload sets Payload field to given value. + +### HasPayload + +`func (o *Request) HasPayload() bool` + +HasPayload returns a boolean if a field has been set. + +### SetPayloadNil + +`func (o *Request) SetPayloadNil(b bool)` + + SetPayloadNil sets the value for Payload to be an explicit nil + +### UnsetPayload +`func (o *Request) UnsetPayload()` + +UnsetPayload ensures that no value is present for Payload, not even an explicit nil +### GetHeaders + +`func (o *Request) GetHeaders() map[string]interface{}` + +GetHeaders returns the Headers field if non-nil, zero value otherwise. + +### GetHeadersOk + +`func (o *Request) GetHeadersOk() (*map[string]interface{}, bool)` + +GetHeadersOk returns a tuple with the Headers field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetHeaders + +`func (o *Request) SetHeaders(v map[string]interface{})` + +SetHeaders sets Headers field to given value. + +### HasHeaders + +`func (o *Request) HasHeaders() bool` + +HasHeaders returns a boolean if a field has been set. + +### GetUserData + +`func (o *Request) GetUserData() map[string]interface{}` + +GetUserData returns the UserData field if non-nil, zero value otherwise. + +### GetUserDataOk + +`func (o *Request) GetUserDataOk() (*map[string]interface{}, bool)` + +GetUserDataOk returns a tuple with the UserData field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUserData + +`func (o *Request) SetUserData(v map[string]interface{})` + +SetUserData sets UserData field to given value. + +### HasUserData + +`func (o *Request) HasUserData() bool` + +HasUserData returns a boolean if a field has been set. + +### GetNoRetry + +`func (o *Request) GetNoRetry() bool` + +GetNoRetry returns the NoRetry field if non-nil, zero value otherwise. + +### GetNoRetryOk + +`func (o *Request) GetNoRetryOk() (*bool, bool)` + +GetNoRetryOk returns a tuple with the NoRetry field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetNoRetry + +`func (o *Request) SetNoRetry(v bool)` + +SetNoRetry sets NoRetry field to given value. + +### HasNoRetry + +`func (o *Request) HasNoRetry() bool` + +HasNoRetry returns a boolean if a field has been set. + +### GetErrorMessages + +`func (o *Request) GetErrorMessages() []string` + +GetErrorMessages returns the ErrorMessages field if non-nil, zero value otherwise. + +### GetErrorMessagesOk + +`func (o *Request) GetErrorMessagesOk() (*[]string, bool)` + +GetErrorMessagesOk returns a tuple with the ErrorMessages field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetErrorMessages + +`func (o *Request) SetErrorMessages(v []string)` + +SetErrorMessages sets ErrorMessages field to given value. + +### HasErrorMessages + +`func (o *Request) HasErrorMessages() bool` + +HasErrorMessages returns a boolean if a field has been set. + +### GetHandledAt + +`func (o *Request) GetHandledAt() time.Time` + +GetHandledAt returns the HandledAt field if non-nil, zero value otherwise. + +### GetHandledAtOk + +`func (o *Request) GetHandledAtOk() (*time.Time, bool)` + +GetHandledAtOk returns a tuple with the HandledAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetHandledAt + +`func (o *Request) SetHandledAt(v time.Time)` + +SetHandledAt sets HandledAt field to given value. + +### HasHandledAt + +`func (o *Request) HasHandledAt() bool` + +HasHandledAt returns a boolean if a field has been set. + +### GetId + +`func (o *Request) GetId() string` + +GetId returns the Id field if non-nil, zero value otherwise. + +### GetIdOk + +`func (o *Request) GetIdOk() (*string, bool)` + +GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetId + +`func (o *Request) SetId(v string)` + +SetId sets Id field to given value. + +### HasId + +`func (o *Request) HasId() bool` + +HasId returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/RequestBase.md b/docs/RequestBase.md new file mode 100644 index 0000000..e369928 --- /dev/null +++ b/docs/RequestBase.md @@ -0,0 +1,376 @@ +# RequestBase + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**UniqueKey** | Pointer to **string** | A unique key used for request de-duplication. Requests with the same unique key are considered identical. | [optional] +**Url** | Pointer to **string** | The URL of the request. | [optional] +**Method** | Pointer to [**HttpMethod**](HttpMethod.md) | | [optional] +**RetryCount** | Pointer to **int32** | The number of times this request has been retried. | [optional] +**LoadedUrl** | Pointer to **NullableString** | The final URL that was loaded, after redirects (if any). | [optional] +**Payload** | Pointer to [**NullableRequestBasePayload**](RequestBasePayload.md) | | [optional] +**Headers** | Pointer to **map[string]interface{}** | HTTP headers sent with the request. | [optional] +**UserData** | Pointer to **map[string]interface{}** | Custom user data attached to the request. Can contain arbitrary fields. | [optional] +**NoRetry** | Pointer to **NullableBool** | Indicates whether the request should not be retried if processing fails. | [optional] +**ErrorMessages** | Pointer to **[]string** | Error messages recorded from failed processing attempts. | [optional] +**HandledAt** | Pointer to **NullableTime** | The timestamp when the request was marked as handled, if applicable. | [optional] + +## Methods + +### NewRequestBase + +`func NewRequestBase() *RequestBase` + +NewRequestBase instantiates a new RequestBase object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewRequestBaseWithDefaults + +`func NewRequestBaseWithDefaults() *RequestBase` + +NewRequestBaseWithDefaults instantiates a new RequestBase object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetUniqueKey + +`func (o *RequestBase) GetUniqueKey() string` + +GetUniqueKey returns the UniqueKey field if non-nil, zero value otherwise. + +### GetUniqueKeyOk + +`func (o *RequestBase) GetUniqueKeyOk() (*string, bool)` + +GetUniqueKeyOk returns a tuple with the UniqueKey field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUniqueKey + +`func (o *RequestBase) SetUniqueKey(v string)` + +SetUniqueKey sets UniqueKey field to given value. + +### HasUniqueKey + +`func (o *RequestBase) HasUniqueKey() bool` + +HasUniqueKey returns a boolean if a field has been set. + +### GetUrl + +`func (o *RequestBase) GetUrl() string` + +GetUrl returns the Url field if non-nil, zero value otherwise. + +### GetUrlOk + +`func (o *RequestBase) GetUrlOk() (*string, bool)` + +GetUrlOk returns a tuple with the Url field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUrl + +`func (o *RequestBase) SetUrl(v string)` + +SetUrl sets Url field to given value. + +### HasUrl + +`func (o *RequestBase) HasUrl() bool` + +HasUrl returns a boolean if a field has been set. + +### GetMethod + +`func (o *RequestBase) GetMethod() HttpMethod` + +GetMethod returns the Method field if non-nil, zero value otherwise. + +### GetMethodOk + +`func (o *RequestBase) GetMethodOk() (*HttpMethod, bool)` + +GetMethodOk returns a tuple with the Method field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMethod + +`func (o *RequestBase) SetMethod(v HttpMethod)` + +SetMethod sets Method field to given value. + +### HasMethod + +`func (o *RequestBase) HasMethod() bool` + +HasMethod returns a boolean if a field has been set. + +### GetRetryCount + +`func (o *RequestBase) GetRetryCount() int32` + +GetRetryCount returns the RetryCount field if non-nil, zero value otherwise. + +### GetRetryCountOk + +`func (o *RequestBase) GetRetryCountOk() (*int32, bool)` + +GetRetryCountOk returns a tuple with the RetryCount field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRetryCount + +`func (o *RequestBase) SetRetryCount(v int32)` + +SetRetryCount sets RetryCount field to given value. + +### HasRetryCount + +`func (o *RequestBase) HasRetryCount() bool` + +HasRetryCount returns a boolean if a field has been set. + +### GetLoadedUrl + +`func (o *RequestBase) GetLoadedUrl() string` + +GetLoadedUrl returns the LoadedUrl field if non-nil, zero value otherwise. + +### GetLoadedUrlOk + +`func (o *RequestBase) GetLoadedUrlOk() (*string, bool)` + +GetLoadedUrlOk returns a tuple with the LoadedUrl field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetLoadedUrl + +`func (o *RequestBase) SetLoadedUrl(v string)` + +SetLoadedUrl sets LoadedUrl field to given value. + +### HasLoadedUrl + +`func (o *RequestBase) HasLoadedUrl() bool` + +HasLoadedUrl returns a boolean if a field has been set. + +### SetLoadedUrlNil + +`func (o *RequestBase) SetLoadedUrlNil(b bool)` + + SetLoadedUrlNil sets the value for LoadedUrl to be an explicit nil + +### UnsetLoadedUrl +`func (o *RequestBase) UnsetLoadedUrl()` + +UnsetLoadedUrl ensures that no value is present for LoadedUrl, not even an explicit nil +### GetPayload + +`func (o *RequestBase) GetPayload() RequestBasePayload` + +GetPayload returns the Payload field if non-nil, zero value otherwise. + +### GetPayloadOk + +`func (o *RequestBase) GetPayloadOk() (*RequestBasePayload, bool)` + +GetPayloadOk returns a tuple with the Payload field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPayload + +`func (o *RequestBase) SetPayload(v RequestBasePayload)` + +SetPayload sets Payload field to given value. + +### HasPayload + +`func (o *RequestBase) HasPayload() bool` + +HasPayload returns a boolean if a field has been set. + +### SetPayloadNil + +`func (o *RequestBase) SetPayloadNil(b bool)` + + SetPayloadNil sets the value for Payload to be an explicit nil + +### UnsetPayload +`func (o *RequestBase) UnsetPayload()` + +UnsetPayload ensures that no value is present for Payload, not even an explicit nil +### GetHeaders + +`func (o *RequestBase) GetHeaders() map[string]interface{}` + +GetHeaders returns the Headers field if non-nil, zero value otherwise. + +### GetHeadersOk + +`func (o *RequestBase) GetHeadersOk() (*map[string]interface{}, bool)` + +GetHeadersOk returns a tuple with the Headers field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetHeaders + +`func (o *RequestBase) SetHeaders(v map[string]interface{})` + +SetHeaders sets Headers field to given value. + +### HasHeaders + +`func (o *RequestBase) HasHeaders() bool` + +HasHeaders returns a boolean if a field has been set. + +### SetHeadersNil + +`func (o *RequestBase) SetHeadersNil(b bool)` + + SetHeadersNil sets the value for Headers to be an explicit nil + +### UnsetHeaders +`func (o *RequestBase) UnsetHeaders()` + +UnsetHeaders ensures that no value is present for Headers, not even an explicit nil +### GetUserData + +`func (o *RequestBase) GetUserData() map[string]interface{}` + +GetUserData returns the UserData field if non-nil, zero value otherwise. + +### GetUserDataOk + +`func (o *RequestBase) GetUserDataOk() (*map[string]interface{}, bool)` + +GetUserDataOk returns a tuple with the UserData field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUserData + +`func (o *RequestBase) SetUserData(v map[string]interface{})` + +SetUserData sets UserData field to given value. + +### HasUserData + +`func (o *RequestBase) HasUserData() bool` + +HasUserData returns a boolean if a field has been set. + +### GetNoRetry + +`func (o *RequestBase) GetNoRetry() bool` + +GetNoRetry returns the NoRetry field if non-nil, zero value otherwise. + +### GetNoRetryOk + +`func (o *RequestBase) GetNoRetryOk() (*bool, bool)` + +GetNoRetryOk returns a tuple with the NoRetry field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetNoRetry + +`func (o *RequestBase) SetNoRetry(v bool)` + +SetNoRetry sets NoRetry field to given value. + +### HasNoRetry + +`func (o *RequestBase) HasNoRetry() bool` + +HasNoRetry returns a boolean if a field has been set. + +### SetNoRetryNil + +`func (o *RequestBase) SetNoRetryNil(b bool)` + + SetNoRetryNil sets the value for NoRetry to be an explicit nil + +### UnsetNoRetry +`func (o *RequestBase) UnsetNoRetry()` + +UnsetNoRetry ensures that no value is present for NoRetry, not even an explicit nil +### GetErrorMessages + +`func (o *RequestBase) GetErrorMessages() []string` + +GetErrorMessages returns the ErrorMessages field if non-nil, zero value otherwise. + +### GetErrorMessagesOk + +`func (o *RequestBase) GetErrorMessagesOk() (*[]string, bool)` + +GetErrorMessagesOk returns a tuple with the ErrorMessages field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetErrorMessages + +`func (o *RequestBase) SetErrorMessages(v []string)` + +SetErrorMessages sets ErrorMessages field to given value. + +### HasErrorMessages + +`func (o *RequestBase) HasErrorMessages() bool` + +HasErrorMessages returns a boolean if a field has been set. + +### SetErrorMessagesNil + +`func (o *RequestBase) SetErrorMessagesNil(b bool)` + + SetErrorMessagesNil sets the value for ErrorMessages to be an explicit nil + +### UnsetErrorMessages +`func (o *RequestBase) UnsetErrorMessages()` + +UnsetErrorMessages ensures that no value is present for ErrorMessages, not even an explicit nil +### GetHandledAt + +`func (o *RequestBase) GetHandledAt() time.Time` + +GetHandledAt returns the HandledAt field if non-nil, zero value otherwise. + +### GetHandledAtOk + +`func (o *RequestBase) GetHandledAtOk() (*time.Time, bool)` + +GetHandledAtOk returns a tuple with the HandledAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetHandledAt + +`func (o *RequestBase) SetHandledAt(v time.Time)` + +SetHandledAt sets HandledAt field to given value. + +### HasHandledAt + +`func (o *RequestBase) HasHandledAt() bool` + +HasHandledAt returns a boolean if a field has been set. + +### SetHandledAtNil + +`func (o *RequestBase) SetHandledAtNil(b bool)` + + SetHandledAtNil sets the value for HandledAt to be an explicit nil + +### UnsetHandledAt +`func (o *RequestBase) UnsetHandledAt()` + +UnsetHandledAt ensures that no value is present for HandledAt, not even an explicit nil + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/RequestBasePayload.md b/docs/RequestBasePayload.md new file mode 100644 index 0000000..fec2848 --- /dev/null +++ b/docs/RequestBasePayload.md @@ -0,0 +1,30 @@ +# RequestBasePayload + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +## Methods + +### NewRequestBasePayload + +`func NewRequestBasePayload() *RequestBasePayload` + +NewRequestBasePayload instantiates a new RequestBasePayload object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewRequestBasePayloadWithDefaults + +`func NewRequestBasePayloadWithDefaults() *RequestBasePayload` + +NewRequestBasePayloadWithDefaults instantiates a new RequestBasePayload object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/RequestDraft.md b/docs/RequestDraft.md new file mode 100644 index 0000000..ec08436 --- /dev/null +++ b/docs/RequestDraft.md @@ -0,0 +1,124 @@ +# RequestDraft + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | Pointer to **string** | A unique identifier assigned to the request. | [optional] +**UniqueKey** | **string** | A unique key used for request de-duplication. Requests with the same unique key are considered identical. | +**Url** | **string** | The URL of the request. | +**Method** | Pointer to [**HttpMethod**](HttpMethod.md) | | [optional] + +## Methods + +### NewRequestDraft + +`func NewRequestDraft(uniqueKey string, url string, ) *RequestDraft` + +NewRequestDraft instantiates a new RequestDraft object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewRequestDraftWithDefaults + +`func NewRequestDraftWithDefaults() *RequestDraft` + +NewRequestDraftWithDefaults instantiates a new RequestDraft object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetId + +`func (o *RequestDraft) GetId() string` + +GetId returns the Id field if non-nil, zero value otherwise. + +### GetIdOk + +`func (o *RequestDraft) GetIdOk() (*string, bool)` + +GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetId + +`func (o *RequestDraft) SetId(v string)` + +SetId sets Id field to given value. + +### HasId + +`func (o *RequestDraft) HasId() bool` + +HasId returns a boolean if a field has been set. + +### GetUniqueKey + +`func (o *RequestDraft) GetUniqueKey() string` + +GetUniqueKey returns the UniqueKey field if non-nil, zero value otherwise. + +### GetUniqueKeyOk + +`func (o *RequestDraft) GetUniqueKeyOk() (*string, bool)` + +GetUniqueKeyOk returns a tuple with the UniqueKey field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUniqueKey + +`func (o *RequestDraft) SetUniqueKey(v string)` + +SetUniqueKey sets UniqueKey field to given value. + + +### GetUrl + +`func (o *RequestDraft) GetUrl() string` + +GetUrl returns the Url field if non-nil, zero value otherwise. + +### GetUrlOk + +`func (o *RequestDraft) GetUrlOk() (*string, bool)` + +GetUrlOk returns a tuple with the Url field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUrl + +`func (o *RequestDraft) SetUrl(v string)` + +SetUrl sets Url field to given value. + + +### GetMethod + +`func (o *RequestDraft) GetMethod() HttpMethod` + +GetMethod returns the Method field if non-nil, zero value otherwise. + +### GetMethodOk + +`func (o *RequestDraft) GetMethodOk() (*HttpMethod, bool)` + +GetMethodOk returns a tuple with the Method field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMethod + +`func (o *RequestDraft) SetMethod(v HttpMethod)` + +SetMethod sets Method field to given value. + +### HasMethod + +`func (o *RequestDraft) HasMethod() bool` + +HasMethod returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/RequestDraftDelete.md b/docs/RequestDraftDelete.md new file mode 100644 index 0000000..ca26d3d --- /dev/null +++ b/docs/RequestDraftDelete.md @@ -0,0 +1,72 @@ +# RequestDraftDelete + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **string** | A unique identifier assigned to the request. | +**UniqueKey** | **string** | A unique key used for request de-duplication. Requests with the same unique key are considered identical. | + +## Methods + +### NewRequestDraftDelete + +`func NewRequestDraftDelete(id string, uniqueKey string, ) *RequestDraftDelete` + +NewRequestDraftDelete instantiates a new RequestDraftDelete object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewRequestDraftDeleteWithDefaults + +`func NewRequestDraftDeleteWithDefaults() *RequestDraftDelete` + +NewRequestDraftDeleteWithDefaults instantiates a new RequestDraftDelete object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetId + +`func (o *RequestDraftDelete) GetId() string` + +GetId returns the Id field if non-nil, zero value otherwise. + +### GetIdOk + +`func (o *RequestDraftDelete) GetIdOk() (*string, bool)` + +GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetId + +`func (o *RequestDraftDelete) SetId(v string)` + +SetId sets Id field to given value. + + +### GetUniqueKey + +`func (o *RequestDraftDelete) GetUniqueKey() string` + +GetUniqueKey returns the UniqueKey field if non-nil, zero value otherwise. + +### GetUniqueKeyOk + +`func (o *RequestDraftDelete) GetUniqueKeyOk() (*string, bool)` + +GetUniqueKeyOk returns a tuple with the UniqueKey field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUniqueKey + +`func (o *RequestDraftDelete) SetUniqueKey(v string)` + +SetUniqueKey sets UniqueKey field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/RequestDraftDeleteById.md b/docs/RequestDraftDeleteById.md new file mode 100644 index 0000000..6e52d9a --- /dev/null +++ b/docs/RequestDraftDeleteById.md @@ -0,0 +1,77 @@ +# RequestDraftDeleteById + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **string** | A unique identifier assigned to the request. | +**UniqueKey** | Pointer to **string** | A unique key used for request de-duplication. Requests with the same unique key are considered identical. | [optional] + +## Methods + +### NewRequestDraftDeleteById + +`func NewRequestDraftDeleteById(id string, ) *RequestDraftDeleteById` + +NewRequestDraftDeleteById instantiates a new RequestDraftDeleteById object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewRequestDraftDeleteByIdWithDefaults + +`func NewRequestDraftDeleteByIdWithDefaults() *RequestDraftDeleteById` + +NewRequestDraftDeleteByIdWithDefaults instantiates a new RequestDraftDeleteById object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetId + +`func (o *RequestDraftDeleteById) GetId() string` + +GetId returns the Id field if non-nil, zero value otherwise. + +### GetIdOk + +`func (o *RequestDraftDeleteById) GetIdOk() (*string, bool)` + +GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetId + +`func (o *RequestDraftDeleteById) SetId(v string)` + +SetId sets Id field to given value. + + +### GetUniqueKey + +`func (o *RequestDraftDeleteById) GetUniqueKey() string` + +GetUniqueKey returns the UniqueKey field if non-nil, zero value otherwise. + +### GetUniqueKeyOk + +`func (o *RequestDraftDeleteById) GetUniqueKeyOk() (*string, bool)` + +GetUniqueKeyOk returns a tuple with the UniqueKey field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUniqueKey + +`func (o *RequestDraftDeleteById) SetUniqueKey(v string)` + +SetUniqueKey sets UniqueKey field to given value. + +### HasUniqueKey + +`func (o *RequestDraftDeleteById) HasUniqueKey() bool` + +HasUniqueKey returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/RequestDraftDeleteByUniqueKey.md b/docs/RequestDraftDeleteByUniqueKey.md new file mode 100644 index 0000000..a44a21f --- /dev/null +++ b/docs/RequestDraftDeleteByUniqueKey.md @@ -0,0 +1,77 @@ +# RequestDraftDeleteByUniqueKey + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | Pointer to **string** | A unique identifier assigned to the request. | [optional] +**UniqueKey** | **string** | A unique key used for request de-duplication. Requests with the same unique key are considered identical. | + +## Methods + +### NewRequestDraftDeleteByUniqueKey + +`func NewRequestDraftDeleteByUniqueKey(uniqueKey string, ) *RequestDraftDeleteByUniqueKey` + +NewRequestDraftDeleteByUniqueKey instantiates a new RequestDraftDeleteByUniqueKey object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewRequestDraftDeleteByUniqueKeyWithDefaults + +`func NewRequestDraftDeleteByUniqueKeyWithDefaults() *RequestDraftDeleteByUniqueKey` + +NewRequestDraftDeleteByUniqueKeyWithDefaults instantiates a new RequestDraftDeleteByUniqueKey object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetId + +`func (o *RequestDraftDeleteByUniqueKey) GetId() string` + +GetId returns the Id field if non-nil, zero value otherwise. + +### GetIdOk + +`func (o *RequestDraftDeleteByUniqueKey) GetIdOk() (*string, bool)` + +GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetId + +`func (o *RequestDraftDeleteByUniqueKey) SetId(v string)` + +SetId sets Id field to given value. + +### HasId + +`func (o *RequestDraftDeleteByUniqueKey) HasId() bool` + +HasId returns a boolean if a field has been set. + +### GetUniqueKey + +`func (o *RequestDraftDeleteByUniqueKey) GetUniqueKey() string` + +GetUniqueKey returns the UniqueKey field if non-nil, zero value otherwise. + +### GetUniqueKeyOk + +`func (o *RequestDraftDeleteByUniqueKey) GetUniqueKeyOk() (*string, bool)` + +GetUniqueKeyOk returns a tuple with the UniqueKey field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUniqueKey + +`func (o *RequestDraftDeleteByUniqueKey) SetUniqueKey(v string)` + +SetUniqueKey sets UniqueKey field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/RequestLockInfo.md b/docs/RequestLockInfo.md new file mode 100644 index 0000000..6fb1e31 --- /dev/null +++ b/docs/RequestLockInfo.md @@ -0,0 +1,51 @@ +# RequestLockInfo + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**LockExpiresAt** | **time.Time** | The timestamp when the lock on this request expires. | + +## Methods + +### NewRequestLockInfo + +`func NewRequestLockInfo(lockExpiresAt time.Time, ) *RequestLockInfo` + +NewRequestLockInfo instantiates a new RequestLockInfo object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewRequestLockInfoWithDefaults + +`func NewRequestLockInfoWithDefaults() *RequestLockInfo` + +NewRequestLockInfoWithDefaults instantiates a new RequestLockInfo object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetLockExpiresAt + +`func (o *RequestLockInfo) GetLockExpiresAt() time.Time` + +GetLockExpiresAt returns the LockExpiresAt field if non-nil, zero value otherwise. + +### GetLockExpiresAtOk + +`func (o *RequestLockInfo) GetLockExpiresAtOk() (*time.Time, bool)` + +GetLockExpiresAtOk returns a tuple with the LockExpiresAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetLockExpiresAt + +`func (o *RequestLockInfo) SetLockExpiresAt(v time.Time)` + +SetLockExpiresAt sets LockExpiresAt field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/RequestQueue.md b/docs/RequestQueue.md new file mode 100644 index 0000000..df5ae0f --- /dev/null +++ b/docs/RequestQueue.md @@ -0,0 +1,400 @@ +# RequestQueue + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **string** | A unique identifier assigned to the request queue. | +**Name** | Pointer to **NullableString** | The name of the request queue. | [optional] +**UserId** | **string** | The ID of the user who owns the request queue. | +**ActId** | Pointer to **NullableString** | The ID of the Actor that created this request queue. | [optional] +**ActRunId** | Pointer to **NullableString** | The ID of the Actor run that created this request queue. | [optional] +**CreatedAt** | **time.Time** | The timestamp when the request queue was created. | +**ModifiedAt** | **time.Time** | The timestamp when the request queue was last modified. Modifications include adding, updating, or removing requests, as well as locking or unlocking requests in the request queue. | +**AccessedAt** | **time.Time** | The timestamp when the request queue was last accessed. | +**TotalRequestCount** | **int32** | The total number of requests in the request queue. | +**HandledRequestCount** | **int32** | The number of requests that have been handled. | +**PendingRequestCount** | **int32** | The number of requests that are pending and have not been handled yet. | +**HadMultipleClients** | **bool** | Whether the request queue has been accessed by multiple different clients. | +**ConsoleUrl** | **string** | The URL to view the request queue in the Apify console. | +**Stats** | Pointer to [**RequestQueueStats**](RequestQueueStats.md) | | [optional] +**GeneralAccess** | Pointer to [**GeneralAccess**](GeneralAccess.md) | | [optional] + +## Methods + +### NewRequestQueue + +`func NewRequestQueue(id string, userId string, createdAt time.Time, modifiedAt time.Time, accessedAt time.Time, totalRequestCount int32, handledRequestCount int32, pendingRequestCount int32, hadMultipleClients bool, consoleUrl string, ) *RequestQueue` + +NewRequestQueue instantiates a new RequestQueue object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewRequestQueueWithDefaults + +`func NewRequestQueueWithDefaults() *RequestQueue` + +NewRequestQueueWithDefaults instantiates a new RequestQueue object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetId + +`func (o *RequestQueue) GetId() string` + +GetId returns the Id field if non-nil, zero value otherwise. + +### GetIdOk + +`func (o *RequestQueue) GetIdOk() (*string, bool)` + +GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetId + +`func (o *RequestQueue) SetId(v string)` + +SetId sets Id field to given value. + + +### GetName + +`func (o *RequestQueue) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *RequestQueue) GetNameOk() (*string, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetName + +`func (o *RequestQueue) SetName(v string)` + +SetName sets Name field to given value. + +### HasName + +`func (o *RequestQueue) HasName() bool` + +HasName returns a boolean if a field has been set. + +### SetNameNil + +`func (o *RequestQueue) SetNameNil(b bool)` + + SetNameNil sets the value for Name to be an explicit nil + +### UnsetName +`func (o *RequestQueue) UnsetName()` + +UnsetName ensures that no value is present for Name, not even an explicit nil +### GetUserId + +`func (o *RequestQueue) GetUserId() string` + +GetUserId returns the UserId field if non-nil, zero value otherwise. + +### GetUserIdOk + +`func (o *RequestQueue) GetUserIdOk() (*string, bool)` + +GetUserIdOk returns a tuple with the UserId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUserId + +`func (o *RequestQueue) SetUserId(v string)` + +SetUserId sets UserId field to given value. + + +### GetActId + +`func (o *RequestQueue) GetActId() string` + +GetActId returns the ActId field if non-nil, zero value otherwise. + +### GetActIdOk + +`func (o *RequestQueue) GetActIdOk() (*string, bool)` + +GetActIdOk returns a tuple with the ActId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetActId + +`func (o *RequestQueue) SetActId(v string)` + +SetActId sets ActId field to given value. + +### HasActId + +`func (o *RequestQueue) HasActId() bool` + +HasActId returns a boolean if a field has been set. + +### SetActIdNil + +`func (o *RequestQueue) SetActIdNil(b bool)` + + SetActIdNil sets the value for ActId to be an explicit nil + +### UnsetActId +`func (o *RequestQueue) UnsetActId()` + +UnsetActId ensures that no value is present for ActId, not even an explicit nil +### GetActRunId + +`func (o *RequestQueue) GetActRunId() string` + +GetActRunId returns the ActRunId field if non-nil, zero value otherwise. + +### GetActRunIdOk + +`func (o *RequestQueue) GetActRunIdOk() (*string, bool)` + +GetActRunIdOk returns a tuple with the ActRunId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetActRunId + +`func (o *RequestQueue) SetActRunId(v string)` + +SetActRunId sets ActRunId field to given value. + +### HasActRunId + +`func (o *RequestQueue) HasActRunId() bool` + +HasActRunId returns a boolean if a field has been set. + +### SetActRunIdNil + +`func (o *RequestQueue) SetActRunIdNil(b bool)` + + SetActRunIdNil sets the value for ActRunId to be an explicit nil + +### UnsetActRunId +`func (o *RequestQueue) UnsetActRunId()` + +UnsetActRunId ensures that no value is present for ActRunId, not even an explicit nil +### GetCreatedAt + +`func (o *RequestQueue) GetCreatedAt() time.Time` + +GetCreatedAt returns the CreatedAt field if non-nil, zero value otherwise. + +### GetCreatedAtOk + +`func (o *RequestQueue) GetCreatedAtOk() (*time.Time, bool)` + +GetCreatedAtOk returns a tuple with the CreatedAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCreatedAt + +`func (o *RequestQueue) SetCreatedAt(v time.Time)` + +SetCreatedAt sets CreatedAt field to given value. + + +### GetModifiedAt + +`func (o *RequestQueue) GetModifiedAt() time.Time` + +GetModifiedAt returns the ModifiedAt field if non-nil, zero value otherwise. + +### GetModifiedAtOk + +`func (o *RequestQueue) GetModifiedAtOk() (*time.Time, bool)` + +GetModifiedAtOk returns a tuple with the ModifiedAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetModifiedAt + +`func (o *RequestQueue) SetModifiedAt(v time.Time)` + +SetModifiedAt sets ModifiedAt field to given value. + + +### GetAccessedAt + +`func (o *RequestQueue) GetAccessedAt() time.Time` + +GetAccessedAt returns the AccessedAt field if non-nil, zero value otherwise. + +### GetAccessedAtOk + +`func (o *RequestQueue) GetAccessedAtOk() (*time.Time, bool)` + +GetAccessedAtOk returns a tuple with the AccessedAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAccessedAt + +`func (o *RequestQueue) SetAccessedAt(v time.Time)` + +SetAccessedAt sets AccessedAt field to given value. + + +### GetTotalRequestCount + +`func (o *RequestQueue) GetTotalRequestCount() int32` + +GetTotalRequestCount returns the TotalRequestCount field if non-nil, zero value otherwise. + +### GetTotalRequestCountOk + +`func (o *RequestQueue) GetTotalRequestCountOk() (*int32, bool)` + +GetTotalRequestCountOk returns a tuple with the TotalRequestCount field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTotalRequestCount + +`func (o *RequestQueue) SetTotalRequestCount(v int32)` + +SetTotalRequestCount sets TotalRequestCount field to given value. + + +### GetHandledRequestCount + +`func (o *RequestQueue) GetHandledRequestCount() int32` + +GetHandledRequestCount returns the HandledRequestCount field if non-nil, zero value otherwise. + +### GetHandledRequestCountOk + +`func (o *RequestQueue) GetHandledRequestCountOk() (*int32, bool)` + +GetHandledRequestCountOk returns a tuple with the HandledRequestCount field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetHandledRequestCount + +`func (o *RequestQueue) SetHandledRequestCount(v int32)` + +SetHandledRequestCount sets HandledRequestCount field to given value. + + +### GetPendingRequestCount + +`func (o *RequestQueue) GetPendingRequestCount() int32` + +GetPendingRequestCount returns the PendingRequestCount field if non-nil, zero value otherwise. + +### GetPendingRequestCountOk + +`func (o *RequestQueue) GetPendingRequestCountOk() (*int32, bool)` + +GetPendingRequestCountOk returns a tuple with the PendingRequestCount field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPendingRequestCount + +`func (o *RequestQueue) SetPendingRequestCount(v int32)` + +SetPendingRequestCount sets PendingRequestCount field to given value. + + +### GetHadMultipleClients + +`func (o *RequestQueue) GetHadMultipleClients() bool` + +GetHadMultipleClients returns the HadMultipleClients field if non-nil, zero value otherwise. + +### GetHadMultipleClientsOk + +`func (o *RequestQueue) GetHadMultipleClientsOk() (*bool, bool)` + +GetHadMultipleClientsOk returns a tuple with the HadMultipleClients field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetHadMultipleClients + +`func (o *RequestQueue) SetHadMultipleClients(v bool)` + +SetHadMultipleClients sets HadMultipleClients field to given value. + + +### GetConsoleUrl + +`func (o *RequestQueue) GetConsoleUrl() string` + +GetConsoleUrl returns the ConsoleUrl field if non-nil, zero value otherwise. + +### GetConsoleUrlOk + +`func (o *RequestQueue) GetConsoleUrlOk() (*string, bool)` + +GetConsoleUrlOk returns a tuple with the ConsoleUrl field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetConsoleUrl + +`func (o *RequestQueue) SetConsoleUrl(v string)` + +SetConsoleUrl sets ConsoleUrl field to given value. + + +### GetStats + +`func (o *RequestQueue) GetStats() RequestQueueStats` + +GetStats returns the Stats field if non-nil, zero value otherwise. + +### GetStatsOk + +`func (o *RequestQueue) GetStatsOk() (*RequestQueueStats, bool)` + +GetStatsOk returns a tuple with the Stats field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetStats + +`func (o *RequestQueue) SetStats(v RequestQueueStats)` + +SetStats sets Stats field to given value. + +### HasStats + +`func (o *RequestQueue) HasStats() bool` + +HasStats returns a boolean if a field has been set. + +### GetGeneralAccess + +`func (o *RequestQueue) GetGeneralAccess() GeneralAccess` + +GetGeneralAccess returns the GeneralAccess field if non-nil, zero value otherwise. + +### GetGeneralAccessOk + +`func (o *RequestQueue) GetGeneralAccessOk() (*GeneralAccess, bool)` + +GetGeneralAccessOk returns a tuple with the GeneralAccess field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetGeneralAccess + +`func (o *RequestQueue) SetGeneralAccess(v GeneralAccess)` + +SetGeneralAccess sets GeneralAccess field to given value. + +### HasGeneralAccess + +`func (o *RequestQueue) HasGeneralAccess() bool` + +HasGeneralAccess returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/RequestQueueHead.md b/docs/RequestQueueHead.md new file mode 100644 index 0000000..54d09eb --- /dev/null +++ b/docs/RequestQueueHead.md @@ -0,0 +1,114 @@ +# RequestQueueHead + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Limit** | **int32** | The maximum number of requests returned. | +**QueueModifiedAt** | **time.Time** | The timestamp when the request queue was last modified. Modifications include adding, updating, or removing requests, as well as locking or unlocking requests in the request queue. | +**HadMultipleClients** | **bool** | Whether the request queue has been accessed by multiple different clients. | +**Items** | [**[]HeadRequest**](HeadRequest.md) | The array of requests from the request queue head. | + +## Methods + +### NewRequestQueueHead + +`func NewRequestQueueHead(limit int32, queueModifiedAt time.Time, hadMultipleClients bool, items []HeadRequest, ) *RequestQueueHead` + +NewRequestQueueHead instantiates a new RequestQueueHead object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewRequestQueueHeadWithDefaults + +`func NewRequestQueueHeadWithDefaults() *RequestQueueHead` + +NewRequestQueueHeadWithDefaults instantiates a new RequestQueueHead object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetLimit + +`func (o *RequestQueueHead) GetLimit() int32` + +GetLimit returns the Limit field if non-nil, zero value otherwise. + +### GetLimitOk + +`func (o *RequestQueueHead) GetLimitOk() (*int32, bool)` + +GetLimitOk returns a tuple with the Limit field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetLimit + +`func (o *RequestQueueHead) SetLimit(v int32)` + +SetLimit sets Limit field to given value. + + +### GetQueueModifiedAt + +`func (o *RequestQueueHead) GetQueueModifiedAt() time.Time` + +GetQueueModifiedAt returns the QueueModifiedAt field if non-nil, zero value otherwise. + +### GetQueueModifiedAtOk + +`func (o *RequestQueueHead) GetQueueModifiedAtOk() (*time.Time, bool)` + +GetQueueModifiedAtOk returns a tuple with the QueueModifiedAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetQueueModifiedAt + +`func (o *RequestQueueHead) SetQueueModifiedAt(v time.Time)` + +SetQueueModifiedAt sets QueueModifiedAt field to given value. + + +### GetHadMultipleClients + +`func (o *RequestQueueHead) GetHadMultipleClients() bool` + +GetHadMultipleClients returns the HadMultipleClients field if non-nil, zero value otherwise. + +### GetHadMultipleClientsOk + +`func (o *RequestQueueHead) GetHadMultipleClientsOk() (*bool, bool)` + +GetHadMultipleClientsOk returns a tuple with the HadMultipleClients field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetHadMultipleClients + +`func (o *RequestQueueHead) SetHadMultipleClients(v bool)` + +SetHadMultipleClients sets HadMultipleClients field to given value. + + +### GetItems + +`func (o *RequestQueueHead) GetItems() []HeadRequest` + +GetItems returns the Items field if non-nil, zero value otherwise. + +### GetItemsOk + +`func (o *RequestQueueHead) GetItemsOk() (*[]HeadRequest, bool)` + +GetItemsOk returns a tuple with the Items field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetItems + +`func (o *RequestQueueHead) SetItems(v []HeadRequest)` + +SetItems sets Items field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/RequestQueueResponse.md b/docs/RequestQueueResponse.md new file mode 100644 index 0000000..0c14de1 --- /dev/null +++ b/docs/RequestQueueResponse.md @@ -0,0 +1,51 @@ +# RequestQueueResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Data** | [**RequestQueue**](RequestQueue.md) | | + +## Methods + +### NewRequestQueueResponse + +`func NewRequestQueueResponse(data RequestQueue, ) *RequestQueueResponse` + +NewRequestQueueResponse instantiates a new RequestQueueResponse object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewRequestQueueResponseWithDefaults + +`func NewRequestQueueResponseWithDefaults() *RequestQueueResponse` + +NewRequestQueueResponseWithDefaults instantiates a new RequestQueueResponse object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetData + +`func (o *RequestQueueResponse) GetData() RequestQueue` + +GetData returns the Data field if non-nil, zero value otherwise. + +### GetDataOk + +`func (o *RequestQueueResponse) GetDataOk() (*RequestQueue, bool)` + +GetDataOk returns a tuple with the Data field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetData + +`func (o *RequestQueueResponse) SetData(v RequestQueue)` + +SetData sets Data field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/RequestQueueShort.md b/docs/RequestQueueShort.md new file mode 100644 index 0000000..66c6852 --- /dev/null +++ b/docs/RequestQueueShort.md @@ -0,0 +1,411 @@ +# RequestQueueShort + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **string** | A unique identifier assigned to the request queue. | +**Name** | **string** | The name of the request queue. | +**UserId** | **string** | The ID of the user who owns the request queue. | +**Username** | **string** | The username of the user who owns the request queue. | +**CreatedAt** | **time.Time** | The timestamp when the request queue was created. | +**ModifiedAt** | **time.Time** | The timestamp when the request queue was last modified. Modifications include adding, updating, or removing requests, as well as locking or unlocking requests in the request queue. | +**AccessedAt** | **time.Time** | The timestamp when the request queue was last accessed. | +**ExpireAt** | Pointer to **time.Time** | The timestamp when the request queue will expire and be deleted. | [optional] +**TotalRequestCount** | **int32** | The total number of requests in the request queue. | +**HandledRequestCount** | **int32** | The number of requests that have been handled. | +**PendingRequestCount** | **int32** | The number of requests that are pending and have not been handled yet. | +**ActId** | Pointer to **NullableString** | The ID of the Actor that created this request queue. | [optional] +**ActRunId** | Pointer to **NullableString** | The ID of the Actor run that created this request queue. | [optional] +**HadMultipleClients** | **bool** | Whether the request queue has been accessed by multiple different clients. | +**GeneralAccess** | Pointer to [**GeneralAccess**](GeneralAccess.md) | | [optional] +**Stats** | Pointer to [**RequestQueueStats**](RequestQueueStats.md) | | [optional] + +## Methods + +### NewRequestQueueShort + +`func NewRequestQueueShort(id string, name string, userId string, username string, createdAt time.Time, modifiedAt time.Time, accessedAt time.Time, totalRequestCount int32, handledRequestCount int32, pendingRequestCount int32, hadMultipleClients bool, ) *RequestQueueShort` + +NewRequestQueueShort instantiates a new RequestQueueShort object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewRequestQueueShortWithDefaults + +`func NewRequestQueueShortWithDefaults() *RequestQueueShort` + +NewRequestQueueShortWithDefaults instantiates a new RequestQueueShort object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetId + +`func (o *RequestQueueShort) GetId() string` + +GetId returns the Id field if non-nil, zero value otherwise. + +### GetIdOk + +`func (o *RequestQueueShort) GetIdOk() (*string, bool)` + +GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetId + +`func (o *RequestQueueShort) SetId(v string)` + +SetId sets Id field to given value. + + +### GetName + +`func (o *RequestQueueShort) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *RequestQueueShort) GetNameOk() (*string, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetName + +`func (o *RequestQueueShort) SetName(v string)` + +SetName sets Name field to given value. + + +### GetUserId + +`func (o *RequestQueueShort) GetUserId() string` + +GetUserId returns the UserId field if non-nil, zero value otherwise. + +### GetUserIdOk + +`func (o *RequestQueueShort) GetUserIdOk() (*string, bool)` + +GetUserIdOk returns a tuple with the UserId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUserId + +`func (o *RequestQueueShort) SetUserId(v string)` + +SetUserId sets UserId field to given value. + + +### GetUsername + +`func (o *RequestQueueShort) GetUsername() string` + +GetUsername returns the Username field if non-nil, zero value otherwise. + +### GetUsernameOk + +`func (o *RequestQueueShort) GetUsernameOk() (*string, bool)` + +GetUsernameOk returns a tuple with the Username field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUsername + +`func (o *RequestQueueShort) SetUsername(v string)` + +SetUsername sets Username field to given value. + + +### GetCreatedAt + +`func (o *RequestQueueShort) GetCreatedAt() time.Time` + +GetCreatedAt returns the CreatedAt field if non-nil, zero value otherwise. + +### GetCreatedAtOk + +`func (o *RequestQueueShort) GetCreatedAtOk() (*time.Time, bool)` + +GetCreatedAtOk returns a tuple with the CreatedAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCreatedAt + +`func (o *RequestQueueShort) SetCreatedAt(v time.Time)` + +SetCreatedAt sets CreatedAt field to given value. + + +### GetModifiedAt + +`func (o *RequestQueueShort) GetModifiedAt() time.Time` + +GetModifiedAt returns the ModifiedAt field if non-nil, zero value otherwise. + +### GetModifiedAtOk + +`func (o *RequestQueueShort) GetModifiedAtOk() (*time.Time, bool)` + +GetModifiedAtOk returns a tuple with the ModifiedAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetModifiedAt + +`func (o *RequestQueueShort) SetModifiedAt(v time.Time)` + +SetModifiedAt sets ModifiedAt field to given value. + + +### GetAccessedAt + +`func (o *RequestQueueShort) GetAccessedAt() time.Time` + +GetAccessedAt returns the AccessedAt field if non-nil, zero value otherwise. + +### GetAccessedAtOk + +`func (o *RequestQueueShort) GetAccessedAtOk() (*time.Time, bool)` + +GetAccessedAtOk returns a tuple with the AccessedAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAccessedAt + +`func (o *RequestQueueShort) SetAccessedAt(v time.Time)` + +SetAccessedAt sets AccessedAt field to given value. + + +### GetExpireAt + +`func (o *RequestQueueShort) GetExpireAt() time.Time` + +GetExpireAt returns the ExpireAt field if non-nil, zero value otherwise. + +### GetExpireAtOk + +`func (o *RequestQueueShort) GetExpireAtOk() (*time.Time, bool)` + +GetExpireAtOk returns a tuple with the ExpireAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetExpireAt + +`func (o *RequestQueueShort) SetExpireAt(v time.Time)` + +SetExpireAt sets ExpireAt field to given value. + +### HasExpireAt + +`func (o *RequestQueueShort) HasExpireAt() bool` + +HasExpireAt returns a boolean if a field has been set. + +### GetTotalRequestCount + +`func (o *RequestQueueShort) GetTotalRequestCount() int32` + +GetTotalRequestCount returns the TotalRequestCount field if non-nil, zero value otherwise. + +### GetTotalRequestCountOk + +`func (o *RequestQueueShort) GetTotalRequestCountOk() (*int32, bool)` + +GetTotalRequestCountOk returns a tuple with the TotalRequestCount field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTotalRequestCount + +`func (o *RequestQueueShort) SetTotalRequestCount(v int32)` + +SetTotalRequestCount sets TotalRequestCount field to given value. + + +### GetHandledRequestCount + +`func (o *RequestQueueShort) GetHandledRequestCount() int32` + +GetHandledRequestCount returns the HandledRequestCount field if non-nil, zero value otherwise. + +### GetHandledRequestCountOk + +`func (o *RequestQueueShort) GetHandledRequestCountOk() (*int32, bool)` + +GetHandledRequestCountOk returns a tuple with the HandledRequestCount field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetHandledRequestCount + +`func (o *RequestQueueShort) SetHandledRequestCount(v int32)` + +SetHandledRequestCount sets HandledRequestCount field to given value. + + +### GetPendingRequestCount + +`func (o *RequestQueueShort) GetPendingRequestCount() int32` + +GetPendingRequestCount returns the PendingRequestCount field if non-nil, zero value otherwise. + +### GetPendingRequestCountOk + +`func (o *RequestQueueShort) GetPendingRequestCountOk() (*int32, bool)` + +GetPendingRequestCountOk returns a tuple with the PendingRequestCount field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPendingRequestCount + +`func (o *RequestQueueShort) SetPendingRequestCount(v int32)` + +SetPendingRequestCount sets PendingRequestCount field to given value. + + +### GetActId + +`func (o *RequestQueueShort) GetActId() string` + +GetActId returns the ActId field if non-nil, zero value otherwise. + +### GetActIdOk + +`func (o *RequestQueueShort) GetActIdOk() (*string, bool)` + +GetActIdOk returns a tuple with the ActId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetActId + +`func (o *RequestQueueShort) SetActId(v string)` + +SetActId sets ActId field to given value. + +### HasActId + +`func (o *RequestQueueShort) HasActId() bool` + +HasActId returns a boolean if a field has been set. + +### SetActIdNil + +`func (o *RequestQueueShort) SetActIdNil(b bool)` + + SetActIdNil sets the value for ActId to be an explicit nil + +### UnsetActId +`func (o *RequestQueueShort) UnsetActId()` + +UnsetActId ensures that no value is present for ActId, not even an explicit nil +### GetActRunId + +`func (o *RequestQueueShort) GetActRunId() string` + +GetActRunId returns the ActRunId field if non-nil, zero value otherwise. + +### GetActRunIdOk + +`func (o *RequestQueueShort) GetActRunIdOk() (*string, bool)` + +GetActRunIdOk returns a tuple with the ActRunId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetActRunId + +`func (o *RequestQueueShort) SetActRunId(v string)` + +SetActRunId sets ActRunId field to given value. + +### HasActRunId + +`func (o *RequestQueueShort) HasActRunId() bool` + +HasActRunId returns a boolean if a field has been set. + +### SetActRunIdNil + +`func (o *RequestQueueShort) SetActRunIdNil(b bool)` + + SetActRunIdNil sets the value for ActRunId to be an explicit nil + +### UnsetActRunId +`func (o *RequestQueueShort) UnsetActRunId()` + +UnsetActRunId ensures that no value is present for ActRunId, not even an explicit nil +### GetHadMultipleClients + +`func (o *RequestQueueShort) GetHadMultipleClients() bool` + +GetHadMultipleClients returns the HadMultipleClients field if non-nil, zero value otherwise. + +### GetHadMultipleClientsOk + +`func (o *RequestQueueShort) GetHadMultipleClientsOk() (*bool, bool)` + +GetHadMultipleClientsOk returns a tuple with the HadMultipleClients field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetHadMultipleClients + +`func (o *RequestQueueShort) SetHadMultipleClients(v bool)` + +SetHadMultipleClients sets HadMultipleClients field to given value. + + +### GetGeneralAccess + +`func (o *RequestQueueShort) GetGeneralAccess() GeneralAccess` + +GetGeneralAccess returns the GeneralAccess field if non-nil, zero value otherwise. + +### GetGeneralAccessOk + +`func (o *RequestQueueShort) GetGeneralAccessOk() (*GeneralAccess, bool)` + +GetGeneralAccessOk returns a tuple with the GeneralAccess field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetGeneralAccess + +`func (o *RequestQueueShort) SetGeneralAccess(v GeneralAccess)` + +SetGeneralAccess sets GeneralAccess field to given value. + +### HasGeneralAccess + +`func (o *RequestQueueShort) HasGeneralAccess() bool` + +HasGeneralAccess returns a boolean if a field has been set. + +### GetStats + +`func (o *RequestQueueShort) GetStats() RequestQueueStats` + +GetStats returns the Stats field if non-nil, zero value otherwise. + +### GetStatsOk + +`func (o *RequestQueueShort) GetStatsOk() (*RequestQueueStats, bool)` + +GetStatsOk returns a tuple with the Stats field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetStats + +`func (o *RequestQueueShort) SetStats(v RequestQueueStats)` + +SetStats sets Stats field to given value. + +### HasStats + +`func (o *RequestQueueShort) HasStats() bool` + +HasStats returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/RequestQueueStats.md b/docs/RequestQueueStats.md new file mode 100644 index 0000000..8b81d4b --- /dev/null +++ b/docs/RequestQueueStats.md @@ -0,0 +1,160 @@ +# RequestQueueStats + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**DeleteCount** | Pointer to **int32** | The number of delete operations performed on the request queue. | [optional] +**HeadItemReadCount** | Pointer to **int32** | The number of times requests from the head were read. | [optional] +**ReadCount** | Pointer to **int32** | The total number of read operations performed on the request queue. | [optional] +**StorageBytes** | Pointer to **int32** | The total storage size in bytes used by the request queue. | [optional] +**WriteCount** | Pointer to **int32** | The total number of write operations performed on the request queue. | [optional] + +## Methods + +### NewRequestQueueStats + +`func NewRequestQueueStats() *RequestQueueStats` + +NewRequestQueueStats instantiates a new RequestQueueStats object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewRequestQueueStatsWithDefaults + +`func NewRequestQueueStatsWithDefaults() *RequestQueueStats` + +NewRequestQueueStatsWithDefaults instantiates a new RequestQueueStats object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetDeleteCount + +`func (o *RequestQueueStats) GetDeleteCount() int32` + +GetDeleteCount returns the DeleteCount field if non-nil, zero value otherwise. + +### GetDeleteCountOk + +`func (o *RequestQueueStats) GetDeleteCountOk() (*int32, bool)` + +GetDeleteCountOk returns a tuple with the DeleteCount field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDeleteCount + +`func (o *RequestQueueStats) SetDeleteCount(v int32)` + +SetDeleteCount sets DeleteCount field to given value. + +### HasDeleteCount + +`func (o *RequestQueueStats) HasDeleteCount() bool` + +HasDeleteCount returns a boolean if a field has been set. + +### GetHeadItemReadCount + +`func (o *RequestQueueStats) GetHeadItemReadCount() int32` + +GetHeadItemReadCount returns the HeadItemReadCount field if non-nil, zero value otherwise. + +### GetHeadItemReadCountOk + +`func (o *RequestQueueStats) GetHeadItemReadCountOk() (*int32, bool)` + +GetHeadItemReadCountOk returns a tuple with the HeadItemReadCount field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetHeadItemReadCount + +`func (o *RequestQueueStats) SetHeadItemReadCount(v int32)` + +SetHeadItemReadCount sets HeadItemReadCount field to given value. + +### HasHeadItemReadCount + +`func (o *RequestQueueStats) HasHeadItemReadCount() bool` + +HasHeadItemReadCount returns a boolean if a field has been set. + +### GetReadCount + +`func (o *RequestQueueStats) GetReadCount() int32` + +GetReadCount returns the ReadCount field if non-nil, zero value otherwise. + +### GetReadCountOk + +`func (o *RequestQueueStats) GetReadCountOk() (*int32, bool)` + +GetReadCountOk returns a tuple with the ReadCount field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetReadCount + +`func (o *RequestQueueStats) SetReadCount(v int32)` + +SetReadCount sets ReadCount field to given value. + +### HasReadCount + +`func (o *RequestQueueStats) HasReadCount() bool` + +HasReadCount returns a boolean if a field has been set. + +### GetStorageBytes + +`func (o *RequestQueueStats) GetStorageBytes() int32` + +GetStorageBytes returns the StorageBytes field if non-nil, zero value otherwise. + +### GetStorageBytesOk + +`func (o *RequestQueueStats) GetStorageBytesOk() (*int32, bool)` + +GetStorageBytesOk returns a tuple with the StorageBytes field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetStorageBytes + +`func (o *RequestQueueStats) SetStorageBytes(v int32)` + +SetStorageBytes sets StorageBytes field to given value. + +### HasStorageBytes + +`func (o *RequestQueueStats) HasStorageBytes() bool` + +HasStorageBytes returns a boolean if a field has been set. + +### GetWriteCount + +`func (o *RequestQueueStats) GetWriteCount() int32` + +GetWriteCount returns the WriteCount field if non-nil, zero value otherwise. + +### GetWriteCountOk + +`func (o *RequestQueueStats) GetWriteCountOk() (*int32, bool)` + +GetWriteCountOk returns a tuple with the WriteCount field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetWriteCount + +`func (o *RequestQueueStats) SetWriteCount(v int32)` + +SetWriteCount sets WriteCount field to given value. + +### HasWriteCount + +`func (o *RequestQueueStats) HasWriteCount() bool` + +HasWriteCount returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/RequestRegistration.md b/docs/RequestRegistration.md new file mode 100644 index 0000000..85e8754 --- /dev/null +++ b/docs/RequestRegistration.md @@ -0,0 +1,93 @@ +# RequestRegistration + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**RequestId** | **string** | A unique identifier assigned to the request. | +**WasAlreadyPresent** | **bool** | Indicates whether a request with the same unique key already existed in the request queue. If true, no new request was created. | +**WasAlreadyHandled** | **bool** | Indicates whether a request with the same unique key has already been processed by the request queue. | + +## Methods + +### NewRequestRegistration + +`func NewRequestRegistration(requestId string, wasAlreadyPresent bool, wasAlreadyHandled bool, ) *RequestRegistration` + +NewRequestRegistration instantiates a new RequestRegistration object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewRequestRegistrationWithDefaults + +`func NewRequestRegistrationWithDefaults() *RequestRegistration` + +NewRequestRegistrationWithDefaults instantiates a new RequestRegistration object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetRequestId + +`func (o *RequestRegistration) GetRequestId() string` + +GetRequestId returns the RequestId field if non-nil, zero value otherwise. + +### GetRequestIdOk + +`func (o *RequestRegistration) GetRequestIdOk() (*string, bool)` + +GetRequestIdOk returns a tuple with the RequestId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRequestId + +`func (o *RequestRegistration) SetRequestId(v string)` + +SetRequestId sets RequestId field to given value. + + +### GetWasAlreadyPresent + +`func (o *RequestRegistration) GetWasAlreadyPresent() bool` + +GetWasAlreadyPresent returns the WasAlreadyPresent field if non-nil, zero value otherwise. + +### GetWasAlreadyPresentOk + +`func (o *RequestRegistration) GetWasAlreadyPresentOk() (*bool, bool)` + +GetWasAlreadyPresentOk returns a tuple with the WasAlreadyPresent field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetWasAlreadyPresent + +`func (o *RequestRegistration) SetWasAlreadyPresent(v bool)` + +SetWasAlreadyPresent sets WasAlreadyPresent field to given value. + + +### GetWasAlreadyHandled + +`func (o *RequestRegistration) GetWasAlreadyHandled() bool` + +GetWasAlreadyHandled returns the WasAlreadyHandled field if non-nil, zero value otherwise. + +### GetWasAlreadyHandledOk + +`func (o *RequestRegistration) GetWasAlreadyHandledOk() (*bool, bool)` + +GetWasAlreadyHandledOk returns a tuple with the WasAlreadyHandled field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetWasAlreadyHandled + +`func (o *RequestRegistration) SetWasAlreadyHandled(v bool)` + +SetWasAlreadyHandled sets WasAlreadyHandled field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/RequestResponse.md b/docs/RequestResponse.md new file mode 100644 index 0000000..c231425 --- /dev/null +++ b/docs/RequestResponse.md @@ -0,0 +1,51 @@ +# RequestResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Data** | [**Request**](Request.md) | | + +## Methods + +### NewRequestResponse + +`func NewRequestResponse(data Request, ) *RequestResponse` + +NewRequestResponse instantiates a new RequestResponse object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewRequestResponseWithDefaults + +`func NewRequestResponseWithDefaults() *RequestResponse` + +NewRequestResponseWithDefaults instantiates a new RequestResponse object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetData + +`func (o *RequestResponse) GetData() Request` + +GetData returns the Data field if non-nil, zero value otherwise. + +### GetDataOk + +`func (o *RequestResponse) GetDataOk() (*Request, bool)` + +GetDataOk returns a tuple with the Data field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetData + +`func (o *RequestResponse) SetData(v Request)` + +SetData sets Data field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/Run.md b/docs/Run.md new file mode 100644 index 0000000..97a2362 --- /dev/null +++ b/docs/Run.md @@ -0,0 +1,865 @@ +# Run + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **string** | Unique identifier of the Actor run. | +**ActId** | **string** | ID of the Actor that was run. | +**UserId** | **string** | ID of the user who started the run. | +**ActorTaskId** | Pointer to **NullableString** | ID of the Actor task, if the run was started from a task. | [optional] +**StartedAt** | **time.Time** | Time when the Actor run started. | +**FinishedAt** | Pointer to **NullableTime** | Time when the Actor run finished. | [optional] +**Status** | [**ActorJobStatus**](ActorJobStatus.md) | Current status of the Actor run. | +**StatusMessage** | Pointer to **NullableString** | Detailed message about the run status. | [optional] +**IsStatusMessageTerminal** | Pointer to **NullableBool** | Whether the status message is terminal (final). | [optional] +**Meta** | [**RunMeta**](RunMeta.md) | Metadata about the Actor run. | +**PricingInfo** | Pointer to [**ActorRunPricingInfo**](ActorRunPricingInfo.md) | Pricing information for the Actor. | [optional] +**Stats** | [**RunStats**](RunStats.md) | Statistics of the Actor run. | +**ChargedEventCounts** | Pointer to **map[string]int32** | A map of charged event types to their counts. The keys are event type identifiers defined by the Actor's pricing model (pay-per-event), and the values are the number of times each event was charged during this run. | [optional] +**Options** | [**RunOptions**](RunOptions.md) | Configuration options for the Actor run. | +**BuildId** | **string** | ID of the Actor build used for this run. | +**ExitCode** | Pointer to **NullableInt32** | Exit code of the Actor run process. | [optional] +**GeneralAccess** | [**GeneralAccess**](GeneralAccess.md) | General access level for the Actor run. | +**DefaultKeyValueStoreId** | **string** | ID of the default key-value store for this run. | +**DefaultDatasetId** | **string** | ID of the default dataset for this run. | +**DefaultRequestQueueId** | **string** | ID of the default request queue for this run. | +**StorageIds** | Pointer to [**RunStorageIds**](RunStorageIds.md) | | [optional] +**BuildNumber** | Pointer to **NullableString** | Build number of the Actor build used for this run. | [optional] +**ContainerUrl** | Pointer to **string** | URL of the container running the Actor. | [optional] +**IsContainerServerReady** | Pointer to **NullableBool** | Whether the container's HTTP server is ready to accept requests. | [optional] +**GitBranchName** | Pointer to **NullableString** | Name of the git branch used for the Actor build. | [optional] +**Usage** | Pointer to [**NullableRunUsage**](RunUsage.md) | Resource usage statistics for the run. | [optional] +**UsageTotalUsd** | Pointer to **NullableFloat32** | Total cost in USD for this run. Represents what you actually pay. For run owners: includes platform usage (compute units) and/or event costs depending on the Actor's pricing model. For run non-owners: only available for Pay-Per-Event Actors (event costs only). Requires authentication token to access. | [optional] +**UsageUsd** | Pointer to [**NullableRunUsageUsd**](RunUsageUsd.md) | Platform usage costs breakdown in USD. Only present if you own the run AND are paying for platform usage (Pay-Per-Usage, Rental, or Pay-Per-Event with usage costs like standby Actors). Not available for standard Pay-Per-Event Actors. Requires authentication token to access. | [optional] +**Metamorphs** | Pointer to [**[]Metamorph**](Metamorph.md) | List of metamorph events that occurred during the run. | [optional] +**PlatformUsageBillingModel** | Pointer to **string** | Indicates which party covers platform usage costs for this run. | [optional] + +## Methods + +### NewRun + +`func NewRun(id string, actId string, userId string, startedAt time.Time, status ActorJobStatus, meta RunMeta, stats RunStats, options RunOptions, buildId string, generalAccess GeneralAccess, defaultKeyValueStoreId string, defaultDatasetId string, defaultRequestQueueId string, ) *Run` + +NewRun instantiates a new Run object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewRunWithDefaults + +`func NewRunWithDefaults() *Run` + +NewRunWithDefaults instantiates a new Run object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetId + +`func (o *Run) GetId() string` + +GetId returns the Id field if non-nil, zero value otherwise. + +### GetIdOk + +`func (o *Run) GetIdOk() (*string, bool)` + +GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetId + +`func (o *Run) SetId(v string)` + +SetId sets Id field to given value. + + +### GetActId + +`func (o *Run) GetActId() string` + +GetActId returns the ActId field if non-nil, zero value otherwise. + +### GetActIdOk + +`func (o *Run) GetActIdOk() (*string, bool)` + +GetActIdOk returns a tuple with the ActId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetActId + +`func (o *Run) SetActId(v string)` + +SetActId sets ActId field to given value. + + +### GetUserId + +`func (o *Run) GetUserId() string` + +GetUserId returns the UserId field if non-nil, zero value otherwise. + +### GetUserIdOk + +`func (o *Run) GetUserIdOk() (*string, bool)` + +GetUserIdOk returns a tuple with the UserId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUserId + +`func (o *Run) SetUserId(v string)` + +SetUserId sets UserId field to given value. + + +### GetActorTaskId + +`func (o *Run) GetActorTaskId() string` + +GetActorTaskId returns the ActorTaskId field if non-nil, zero value otherwise. + +### GetActorTaskIdOk + +`func (o *Run) GetActorTaskIdOk() (*string, bool)` + +GetActorTaskIdOk returns a tuple with the ActorTaskId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetActorTaskId + +`func (o *Run) SetActorTaskId(v string)` + +SetActorTaskId sets ActorTaskId field to given value. + +### HasActorTaskId + +`func (o *Run) HasActorTaskId() bool` + +HasActorTaskId returns a boolean if a field has been set. + +### SetActorTaskIdNil + +`func (o *Run) SetActorTaskIdNil(b bool)` + + SetActorTaskIdNil sets the value for ActorTaskId to be an explicit nil + +### UnsetActorTaskId +`func (o *Run) UnsetActorTaskId()` + +UnsetActorTaskId ensures that no value is present for ActorTaskId, not even an explicit nil +### GetStartedAt + +`func (o *Run) GetStartedAt() time.Time` + +GetStartedAt returns the StartedAt field if non-nil, zero value otherwise. + +### GetStartedAtOk + +`func (o *Run) GetStartedAtOk() (*time.Time, bool)` + +GetStartedAtOk returns a tuple with the StartedAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetStartedAt + +`func (o *Run) SetStartedAt(v time.Time)` + +SetStartedAt sets StartedAt field to given value. + + +### GetFinishedAt + +`func (o *Run) GetFinishedAt() time.Time` + +GetFinishedAt returns the FinishedAt field if non-nil, zero value otherwise. + +### GetFinishedAtOk + +`func (o *Run) GetFinishedAtOk() (*time.Time, bool)` + +GetFinishedAtOk returns a tuple with the FinishedAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetFinishedAt + +`func (o *Run) SetFinishedAt(v time.Time)` + +SetFinishedAt sets FinishedAt field to given value. + +### HasFinishedAt + +`func (o *Run) HasFinishedAt() bool` + +HasFinishedAt returns a boolean if a field has been set. + +### SetFinishedAtNil + +`func (o *Run) SetFinishedAtNil(b bool)` + + SetFinishedAtNil sets the value for FinishedAt to be an explicit nil + +### UnsetFinishedAt +`func (o *Run) UnsetFinishedAt()` + +UnsetFinishedAt ensures that no value is present for FinishedAt, not even an explicit nil +### GetStatus + +`func (o *Run) GetStatus() ActorJobStatus` + +GetStatus returns the Status field if non-nil, zero value otherwise. + +### GetStatusOk + +`func (o *Run) GetStatusOk() (*ActorJobStatus, bool)` + +GetStatusOk returns a tuple with the Status field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetStatus + +`func (o *Run) SetStatus(v ActorJobStatus)` + +SetStatus sets Status field to given value. + + +### GetStatusMessage + +`func (o *Run) GetStatusMessage() string` + +GetStatusMessage returns the StatusMessage field if non-nil, zero value otherwise. + +### GetStatusMessageOk + +`func (o *Run) GetStatusMessageOk() (*string, bool)` + +GetStatusMessageOk returns a tuple with the StatusMessage field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetStatusMessage + +`func (o *Run) SetStatusMessage(v string)` + +SetStatusMessage sets StatusMessage field to given value. + +### HasStatusMessage + +`func (o *Run) HasStatusMessage() bool` + +HasStatusMessage returns a boolean if a field has been set. + +### SetStatusMessageNil + +`func (o *Run) SetStatusMessageNil(b bool)` + + SetStatusMessageNil sets the value for StatusMessage to be an explicit nil + +### UnsetStatusMessage +`func (o *Run) UnsetStatusMessage()` + +UnsetStatusMessage ensures that no value is present for StatusMessage, not even an explicit nil +### GetIsStatusMessageTerminal + +`func (o *Run) GetIsStatusMessageTerminal() bool` + +GetIsStatusMessageTerminal returns the IsStatusMessageTerminal field if non-nil, zero value otherwise. + +### GetIsStatusMessageTerminalOk + +`func (o *Run) GetIsStatusMessageTerminalOk() (*bool, bool)` + +GetIsStatusMessageTerminalOk returns a tuple with the IsStatusMessageTerminal field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetIsStatusMessageTerminal + +`func (o *Run) SetIsStatusMessageTerminal(v bool)` + +SetIsStatusMessageTerminal sets IsStatusMessageTerminal field to given value. + +### HasIsStatusMessageTerminal + +`func (o *Run) HasIsStatusMessageTerminal() bool` + +HasIsStatusMessageTerminal returns a boolean if a field has been set. + +### SetIsStatusMessageTerminalNil + +`func (o *Run) SetIsStatusMessageTerminalNil(b bool)` + + SetIsStatusMessageTerminalNil sets the value for IsStatusMessageTerminal to be an explicit nil + +### UnsetIsStatusMessageTerminal +`func (o *Run) UnsetIsStatusMessageTerminal()` + +UnsetIsStatusMessageTerminal ensures that no value is present for IsStatusMessageTerminal, not even an explicit nil +### GetMeta + +`func (o *Run) GetMeta() RunMeta` + +GetMeta returns the Meta field if non-nil, zero value otherwise. + +### GetMetaOk + +`func (o *Run) GetMetaOk() (*RunMeta, bool)` + +GetMetaOk returns a tuple with the Meta field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMeta + +`func (o *Run) SetMeta(v RunMeta)` + +SetMeta sets Meta field to given value. + + +### GetPricingInfo + +`func (o *Run) GetPricingInfo() ActorRunPricingInfo` + +GetPricingInfo returns the PricingInfo field if non-nil, zero value otherwise. + +### GetPricingInfoOk + +`func (o *Run) GetPricingInfoOk() (*ActorRunPricingInfo, bool)` + +GetPricingInfoOk returns a tuple with the PricingInfo field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPricingInfo + +`func (o *Run) SetPricingInfo(v ActorRunPricingInfo)` + +SetPricingInfo sets PricingInfo field to given value. + +### HasPricingInfo + +`func (o *Run) HasPricingInfo() bool` + +HasPricingInfo returns a boolean if a field has been set. + +### GetStats + +`func (o *Run) GetStats() RunStats` + +GetStats returns the Stats field if non-nil, zero value otherwise. + +### GetStatsOk + +`func (o *Run) GetStatsOk() (*RunStats, bool)` + +GetStatsOk returns a tuple with the Stats field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetStats + +`func (o *Run) SetStats(v RunStats)` + +SetStats sets Stats field to given value. + + +### GetChargedEventCounts + +`func (o *Run) GetChargedEventCounts() map[string]int32` + +GetChargedEventCounts returns the ChargedEventCounts field if non-nil, zero value otherwise. + +### GetChargedEventCountsOk + +`func (o *Run) GetChargedEventCountsOk() (*map[string]int32, bool)` + +GetChargedEventCountsOk returns a tuple with the ChargedEventCounts field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetChargedEventCounts + +`func (o *Run) SetChargedEventCounts(v map[string]int32)` + +SetChargedEventCounts sets ChargedEventCounts field to given value. + +### HasChargedEventCounts + +`func (o *Run) HasChargedEventCounts() bool` + +HasChargedEventCounts returns a boolean if a field has been set. + +### GetOptions + +`func (o *Run) GetOptions() RunOptions` + +GetOptions returns the Options field if non-nil, zero value otherwise. + +### GetOptionsOk + +`func (o *Run) GetOptionsOk() (*RunOptions, bool)` + +GetOptionsOk returns a tuple with the Options field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetOptions + +`func (o *Run) SetOptions(v RunOptions)` + +SetOptions sets Options field to given value. + + +### GetBuildId + +`func (o *Run) GetBuildId() string` + +GetBuildId returns the BuildId field if non-nil, zero value otherwise. + +### GetBuildIdOk + +`func (o *Run) GetBuildIdOk() (*string, bool)` + +GetBuildIdOk returns a tuple with the BuildId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetBuildId + +`func (o *Run) SetBuildId(v string)` + +SetBuildId sets BuildId field to given value. + + +### GetExitCode + +`func (o *Run) GetExitCode() int32` + +GetExitCode returns the ExitCode field if non-nil, zero value otherwise. + +### GetExitCodeOk + +`func (o *Run) GetExitCodeOk() (*int32, bool)` + +GetExitCodeOk returns a tuple with the ExitCode field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetExitCode + +`func (o *Run) SetExitCode(v int32)` + +SetExitCode sets ExitCode field to given value. + +### HasExitCode + +`func (o *Run) HasExitCode() bool` + +HasExitCode returns a boolean if a field has been set. + +### SetExitCodeNil + +`func (o *Run) SetExitCodeNil(b bool)` + + SetExitCodeNil sets the value for ExitCode to be an explicit nil + +### UnsetExitCode +`func (o *Run) UnsetExitCode()` + +UnsetExitCode ensures that no value is present for ExitCode, not even an explicit nil +### GetGeneralAccess + +`func (o *Run) GetGeneralAccess() GeneralAccess` + +GetGeneralAccess returns the GeneralAccess field if non-nil, zero value otherwise. + +### GetGeneralAccessOk + +`func (o *Run) GetGeneralAccessOk() (*GeneralAccess, bool)` + +GetGeneralAccessOk returns a tuple with the GeneralAccess field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetGeneralAccess + +`func (o *Run) SetGeneralAccess(v GeneralAccess)` + +SetGeneralAccess sets GeneralAccess field to given value. + + +### GetDefaultKeyValueStoreId + +`func (o *Run) GetDefaultKeyValueStoreId() string` + +GetDefaultKeyValueStoreId returns the DefaultKeyValueStoreId field if non-nil, zero value otherwise. + +### GetDefaultKeyValueStoreIdOk + +`func (o *Run) GetDefaultKeyValueStoreIdOk() (*string, bool)` + +GetDefaultKeyValueStoreIdOk returns a tuple with the DefaultKeyValueStoreId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDefaultKeyValueStoreId + +`func (o *Run) SetDefaultKeyValueStoreId(v string)` + +SetDefaultKeyValueStoreId sets DefaultKeyValueStoreId field to given value. + + +### GetDefaultDatasetId + +`func (o *Run) GetDefaultDatasetId() string` + +GetDefaultDatasetId returns the DefaultDatasetId field if non-nil, zero value otherwise. + +### GetDefaultDatasetIdOk + +`func (o *Run) GetDefaultDatasetIdOk() (*string, bool)` + +GetDefaultDatasetIdOk returns a tuple with the DefaultDatasetId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDefaultDatasetId + +`func (o *Run) SetDefaultDatasetId(v string)` + +SetDefaultDatasetId sets DefaultDatasetId field to given value. + + +### GetDefaultRequestQueueId + +`func (o *Run) GetDefaultRequestQueueId() string` + +GetDefaultRequestQueueId returns the DefaultRequestQueueId field if non-nil, zero value otherwise. + +### GetDefaultRequestQueueIdOk + +`func (o *Run) GetDefaultRequestQueueIdOk() (*string, bool)` + +GetDefaultRequestQueueIdOk returns a tuple with the DefaultRequestQueueId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDefaultRequestQueueId + +`func (o *Run) SetDefaultRequestQueueId(v string)` + +SetDefaultRequestQueueId sets DefaultRequestQueueId field to given value. + + +### GetStorageIds + +`func (o *Run) GetStorageIds() RunStorageIds` + +GetStorageIds returns the StorageIds field if non-nil, zero value otherwise. + +### GetStorageIdsOk + +`func (o *Run) GetStorageIdsOk() (*RunStorageIds, bool)` + +GetStorageIdsOk returns a tuple with the StorageIds field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetStorageIds + +`func (o *Run) SetStorageIds(v RunStorageIds)` + +SetStorageIds sets StorageIds field to given value. + +### HasStorageIds + +`func (o *Run) HasStorageIds() bool` + +HasStorageIds returns a boolean if a field has been set. + +### GetBuildNumber + +`func (o *Run) GetBuildNumber() string` + +GetBuildNumber returns the BuildNumber field if non-nil, zero value otherwise. + +### GetBuildNumberOk + +`func (o *Run) GetBuildNumberOk() (*string, bool)` + +GetBuildNumberOk returns a tuple with the BuildNumber field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetBuildNumber + +`func (o *Run) SetBuildNumber(v string)` + +SetBuildNumber sets BuildNumber field to given value. + +### HasBuildNumber + +`func (o *Run) HasBuildNumber() bool` + +HasBuildNumber returns a boolean if a field has been set. + +### SetBuildNumberNil + +`func (o *Run) SetBuildNumberNil(b bool)` + + SetBuildNumberNil sets the value for BuildNumber to be an explicit nil + +### UnsetBuildNumber +`func (o *Run) UnsetBuildNumber()` + +UnsetBuildNumber ensures that no value is present for BuildNumber, not even an explicit nil +### GetContainerUrl + +`func (o *Run) GetContainerUrl() string` + +GetContainerUrl returns the ContainerUrl field if non-nil, zero value otherwise. + +### GetContainerUrlOk + +`func (o *Run) GetContainerUrlOk() (*string, bool)` + +GetContainerUrlOk returns a tuple with the ContainerUrl field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetContainerUrl + +`func (o *Run) SetContainerUrl(v string)` + +SetContainerUrl sets ContainerUrl field to given value. + +### HasContainerUrl + +`func (o *Run) HasContainerUrl() bool` + +HasContainerUrl returns a boolean if a field has been set. + +### GetIsContainerServerReady + +`func (o *Run) GetIsContainerServerReady() bool` + +GetIsContainerServerReady returns the IsContainerServerReady field if non-nil, zero value otherwise. + +### GetIsContainerServerReadyOk + +`func (o *Run) GetIsContainerServerReadyOk() (*bool, bool)` + +GetIsContainerServerReadyOk returns a tuple with the IsContainerServerReady field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetIsContainerServerReady + +`func (o *Run) SetIsContainerServerReady(v bool)` + +SetIsContainerServerReady sets IsContainerServerReady field to given value. + +### HasIsContainerServerReady + +`func (o *Run) HasIsContainerServerReady() bool` + +HasIsContainerServerReady returns a boolean if a field has been set. + +### SetIsContainerServerReadyNil + +`func (o *Run) SetIsContainerServerReadyNil(b bool)` + + SetIsContainerServerReadyNil sets the value for IsContainerServerReady to be an explicit nil + +### UnsetIsContainerServerReady +`func (o *Run) UnsetIsContainerServerReady()` + +UnsetIsContainerServerReady ensures that no value is present for IsContainerServerReady, not even an explicit nil +### GetGitBranchName + +`func (o *Run) GetGitBranchName() string` + +GetGitBranchName returns the GitBranchName field if non-nil, zero value otherwise. + +### GetGitBranchNameOk + +`func (o *Run) GetGitBranchNameOk() (*string, bool)` + +GetGitBranchNameOk returns a tuple with the GitBranchName field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetGitBranchName + +`func (o *Run) SetGitBranchName(v string)` + +SetGitBranchName sets GitBranchName field to given value. + +### HasGitBranchName + +`func (o *Run) HasGitBranchName() bool` + +HasGitBranchName returns a boolean if a field has been set. + +### SetGitBranchNameNil + +`func (o *Run) SetGitBranchNameNil(b bool)` + + SetGitBranchNameNil sets the value for GitBranchName to be an explicit nil + +### UnsetGitBranchName +`func (o *Run) UnsetGitBranchName()` + +UnsetGitBranchName ensures that no value is present for GitBranchName, not even an explicit nil +### GetUsage + +`func (o *Run) GetUsage() RunUsage` + +GetUsage returns the Usage field if non-nil, zero value otherwise. + +### GetUsageOk + +`func (o *Run) GetUsageOk() (*RunUsage, bool)` + +GetUsageOk returns a tuple with the Usage field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUsage + +`func (o *Run) SetUsage(v RunUsage)` + +SetUsage sets Usage field to given value. + +### HasUsage + +`func (o *Run) HasUsage() bool` + +HasUsage returns a boolean if a field has been set. + +### SetUsageNil + +`func (o *Run) SetUsageNil(b bool)` + + SetUsageNil sets the value for Usage to be an explicit nil + +### UnsetUsage +`func (o *Run) UnsetUsage()` + +UnsetUsage ensures that no value is present for Usage, not even an explicit nil +### GetUsageTotalUsd + +`func (o *Run) GetUsageTotalUsd() float32` + +GetUsageTotalUsd returns the UsageTotalUsd field if non-nil, zero value otherwise. + +### GetUsageTotalUsdOk + +`func (o *Run) GetUsageTotalUsdOk() (*float32, bool)` + +GetUsageTotalUsdOk returns a tuple with the UsageTotalUsd field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUsageTotalUsd + +`func (o *Run) SetUsageTotalUsd(v float32)` + +SetUsageTotalUsd sets UsageTotalUsd field to given value. + +### HasUsageTotalUsd + +`func (o *Run) HasUsageTotalUsd() bool` + +HasUsageTotalUsd returns a boolean if a field has been set. + +### SetUsageTotalUsdNil + +`func (o *Run) SetUsageTotalUsdNil(b bool)` + + SetUsageTotalUsdNil sets the value for UsageTotalUsd to be an explicit nil + +### UnsetUsageTotalUsd +`func (o *Run) UnsetUsageTotalUsd()` + +UnsetUsageTotalUsd ensures that no value is present for UsageTotalUsd, not even an explicit nil +### GetUsageUsd + +`func (o *Run) GetUsageUsd() RunUsageUsd` + +GetUsageUsd returns the UsageUsd field if non-nil, zero value otherwise. + +### GetUsageUsdOk + +`func (o *Run) GetUsageUsdOk() (*RunUsageUsd, bool)` + +GetUsageUsdOk returns a tuple with the UsageUsd field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUsageUsd + +`func (o *Run) SetUsageUsd(v RunUsageUsd)` + +SetUsageUsd sets UsageUsd field to given value. + +### HasUsageUsd + +`func (o *Run) HasUsageUsd() bool` + +HasUsageUsd returns a boolean if a field has been set. + +### SetUsageUsdNil + +`func (o *Run) SetUsageUsdNil(b bool)` + + SetUsageUsdNil sets the value for UsageUsd to be an explicit nil + +### UnsetUsageUsd +`func (o *Run) UnsetUsageUsd()` + +UnsetUsageUsd ensures that no value is present for UsageUsd, not even an explicit nil +### GetMetamorphs + +`func (o *Run) GetMetamorphs() []Metamorph` + +GetMetamorphs returns the Metamorphs field if non-nil, zero value otherwise. + +### GetMetamorphsOk + +`func (o *Run) GetMetamorphsOk() (*[]Metamorph, bool)` + +GetMetamorphsOk returns a tuple with the Metamorphs field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMetamorphs + +`func (o *Run) SetMetamorphs(v []Metamorph)` + +SetMetamorphs sets Metamorphs field to given value. + +### HasMetamorphs + +`func (o *Run) HasMetamorphs() bool` + +HasMetamorphs returns a boolean if a field has been set. + +### SetMetamorphsNil + +`func (o *Run) SetMetamorphsNil(b bool)` + + SetMetamorphsNil sets the value for Metamorphs to be an explicit nil + +### UnsetMetamorphs +`func (o *Run) UnsetMetamorphs()` + +UnsetMetamorphs ensures that no value is present for Metamorphs, not even an explicit nil +### GetPlatformUsageBillingModel + +`func (o *Run) GetPlatformUsageBillingModel() string` + +GetPlatformUsageBillingModel returns the PlatformUsageBillingModel field if non-nil, zero value otherwise. + +### GetPlatformUsageBillingModelOk + +`func (o *Run) GetPlatformUsageBillingModelOk() (*string, bool)` + +GetPlatformUsageBillingModelOk returns a tuple with the PlatformUsageBillingModel field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPlatformUsageBillingModel + +`func (o *Run) SetPlatformUsageBillingModel(v string)` + +SetPlatformUsageBillingModel sets PlatformUsageBillingModel field to given value. + +### HasPlatformUsageBillingModel + +`func (o *Run) HasPlatformUsageBillingModel() bool` + +HasPlatformUsageBillingModel returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/RunFailedErrorDetail.md b/docs/RunFailedErrorDetail.md new file mode 100644 index 0000000..bb67e41 --- /dev/null +++ b/docs/RunFailedErrorDetail.md @@ -0,0 +1,92 @@ +# RunFailedErrorDetail + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Type** | Pointer to **interface{}** | | [optional] +**Message** | Pointer to **string** | Human-readable error message describing what went wrong. | [optional] + +## Methods + +### NewRunFailedErrorDetail + +`func NewRunFailedErrorDetail() *RunFailedErrorDetail` + +NewRunFailedErrorDetail instantiates a new RunFailedErrorDetail object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewRunFailedErrorDetailWithDefaults + +`func NewRunFailedErrorDetailWithDefaults() *RunFailedErrorDetail` + +NewRunFailedErrorDetailWithDefaults instantiates a new RunFailedErrorDetail object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetType + +`func (o *RunFailedErrorDetail) GetType() interface{}` + +GetType returns the Type field if non-nil, zero value otherwise. + +### GetTypeOk + +`func (o *RunFailedErrorDetail) GetTypeOk() (*interface{}, bool)` + +GetTypeOk returns a tuple with the Type field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetType + +`func (o *RunFailedErrorDetail) SetType(v interface{})` + +SetType sets Type field to given value. + +### HasType + +`func (o *RunFailedErrorDetail) HasType() bool` + +HasType returns a boolean if a field has been set. + +### SetTypeNil + +`func (o *RunFailedErrorDetail) SetTypeNil(b bool)` + + SetTypeNil sets the value for Type to be an explicit nil + +### UnsetType +`func (o *RunFailedErrorDetail) UnsetType()` + +UnsetType ensures that no value is present for Type, not even an explicit nil +### GetMessage + +`func (o *RunFailedErrorDetail) GetMessage() string` + +GetMessage returns the Message field if non-nil, zero value otherwise. + +### GetMessageOk + +`func (o *RunFailedErrorDetail) GetMessageOk() (*string, bool)` + +GetMessageOk returns a tuple with the Message field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMessage + +`func (o *RunFailedErrorDetail) SetMessage(v string)` + +SetMessage sets Message field to given value. + +### HasMessage + +`func (o *RunFailedErrorDetail) HasMessage() bool` + +HasMessage returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/RunMeta.md b/docs/RunMeta.md new file mode 100644 index 0000000..6b89815 --- /dev/null +++ b/docs/RunMeta.md @@ -0,0 +1,195 @@ +# RunMeta + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Origin** | [**RunOrigin**](RunOrigin.md) | | +**ClientIp** | Pointer to **NullableString** | IP address of the client that started the run. | [optional] +**UserAgent** | Pointer to **NullableString** | User agent of the client that started the run. | [optional] +**ScheduleId** | Pointer to **NullableString** | ID of the schedule that triggered the run. | [optional] +**ScheduledAt** | Pointer to **NullableTime** | Time when the run was scheduled. | [optional] + +## Methods + +### NewRunMeta + +`func NewRunMeta(origin RunOrigin, ) *RunMeta` + +NewRunMeta instantiates a new RunMeta object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewRunMetaWithDefaults + +`func NewRunMetaWithDefaults() *RunMeta` + +NewRunMetaWithDefaults instantiates a new RunMeta object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetOrigin + +`func (o *RunMeta) GetOrigin() RunOrigin` + +GetOrigin returns the Origin field if non-nil, zero value otherwise. + +### GetOriginOk + +`func (o *RunMeta) GetOriginOk() (*RunOrigin, bool)` + +GetOriginOk returns a tuple with the Origin field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetOrigin + +`func (o *RunMeta) SetOrigin(v RunOrigin)` + +SetOrigin sets Origin field to given value. + + +### GetClientIp + +`func (o *RunMeta) GetClientIp() string` + +GetClientIp returns the ClientIp field if non-nil, zero value otherwise. + +### GetClientIpOk + +`func (o *RunMeta) GetClientIpOk() (*string, bool)` + +GetClientIpOk returns a tuple with the ClientIp field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetClientIp + +`func (o *RunMeta) SetClientIp(v string)` + +SetClientIp sets ClientIp field to given value. + +### HasClientIp + +`func (o *RunMeta) HasClientIp() bool` + +HasClientIp returns a boolean if a field has been set. + +### SetClientIpNil + +`func (o *RunMeta) SetClientIpNil(b bool)` + + SetClientIpNil sets the value for ClientIp to be an explicit nil + +### UnsetClientIp +`func (o *RunMeta) UnsetClientIp()` + +UnsetClientIp ensures that no value is present for ClientIp, not even an explicit nil +### GetUserAgent + +`func (o *RunMeta) GetUserAgent() string` + +GetUserAgent returns the UserAgent field if non-nil, zero value otherwise. + +### GetUserAgentOk + +`func (o *RunMeta) GetUserAgentOk() (*string, bool)` + +GetUserAgentOk returns a tuple with the UserAgent field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUserAgent + +`func (o *RunMeta) SetUserAgent(v string)` + +SetUserAgent sets UserAgent field to given value. + +### HasUserAgent + +`func (o *RunMeta) HasUserAgent() bool` + +HasUserAgent returns a boolean if a field has been set. + +### SetUserAgentNil + +`func (o *RunMeta) SetUserAgentNil(b bool)` + + SetUserAgentNil sets the value for UserAgent to be an explicit nil + +### UnsetUserAgent +`func (o *RunMeta) UnsetUserAgent()` + +UnsetUserAgent ensures that no value is present for UserAgent, not even an explicit nil +### GetScheduleId + +`func (o *RunMeta) GetScheduleId() string` + +GetScheduleId returns the ScheduleId field if non-nil, zero value otherwise. + +### GetScheduleIdOk + +`func (o *RunMeta) GetScheduleIdOk() (*string, bool)` + +GetScheduleIdOk returns a tuple with the ScheduleId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetScheduleId + +`func (o *RunMeta) SetScheduleId(v string)` + +SetScheduleId sets ScheduleId field to given value. + +### HasScheduleId + +`func (o *RunMeta) HasScheduleId() bool` + +HasScheduleId returns a boolean if a field has been set. + +### SetScheduleIdNil + +`func (o *RunMeta) SetScheduleIdNil(b bool)` + + SetScheduleIdNil sets the value for ScheduleId to be an explicit nil + +### UnsetScheduleId +`func (o *RunMeta) UnsetScheduleId()` + +UnsetScheduleId ensures that no value is present for ScheduleId, not even an explicit nil +### GetScheduledAt + +`func (o *RunMeta) GetScheduledAt() time.Time` + +GetScheduledAt returns the ScheduledAt field if non-nil, zero value otherwise. + +### GetScheduledAtOk + +`func (o *RunMeta) GetScheduledAtOk() (*time.Time, bool)` + +GetScheduledAtOk returns a tuple with the ScheduledAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetScheduledAt + +`func (o *RunMeta) SetScheduledAt(v time.Time)` + +SetScheduledAt sets ScheduledAt field to given value. + +### HasScheduledAt + +`func (o *RunMeta) HasScheduledAt() bool` + +HasScheduledAt returns a boolean if a field has been set. + +### SetScheduledAtNil + +`func (o *RunMeta) SetScheduledAtNil(b bool)` + + SetScheduledAtNil sets the value for ScheduledAt to be an explicit nil + +### UnsetScheduledAt +`func (o *RunMeta) UnsetScheduledAt()` + +UnsetScheduledAt ensures that no value is present for ScheduledAt, not even an explicit nil + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/RunOptions.md b/docs/RunOptions.md new file mode 100644 index 0000000..2d47cdf --- /dev/null +++ b/docs/RunOptions.md @@ -0,0 +1,176 @@ +# RunOptions + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Build** | **string** | | +**TimeoutSecs** | **int32** | | +**MemoryMbytes** | **int32** | | +**DiskMbytes** | **int32** | | +**MaxItems** | Pointer to **NullableInt32** | | [optional] +**MaxTotalChargeUsd** | Pointer to **float32** | | [optional] + +## Methods + +### NewRunOptions + +`func NewRunOptions(build string, timeoutSecs int32, memoryMbytes int32, diskMbytes int32, ) *RunOptions` + +NewRunOptions instantiates a new RunOptions object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewRunOptionsWithDefaults + +`func NewRunOptionsWithDefaults() *RunOptions` + +NewRunOptionsWithDefaults instantiates a new RunOptions object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetBuild + +`func (o *RunOptions) GetBuild() string` + +GetBuild returns the Build field if non-nil, zero value otherwise. + +### GetBuildOk + +`func (o *RunOptions) GetBuildOk() (*string, bool)` + +GetBuildOk returns a tuple with the Build field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetBuild + +`func (o *RunOptions) SetBuild(v string)` + +SetBuild sets Build field to given value. + + +### GetTimeoutSecs + +`func (o *RunOptions) GetTimeoutSecs() int32` + +GetTimeoutSecs returns the TimeoutSecs field if non-nil, zero value otherwise. + +### GetTimeoutSecsOk + +`func (o *RunOptions) GetTimeoutSecsOk() (*int32, bool)` + +GetTimeoutSecsOk returns a tuple with the TimeoutSecs field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTimeoutSecs + +`func (o *RunOptions) SetTimeoutSecs(v int32)` + +SetTimeoutSecs sets TimeoutSecs field to given value. + + +### GetMemoryMbytes + +`func (o *RunOptions) GetMemoryMbytes() int32` + +GetMemoryMbytes returns the MemoryMbytes field if non-nil, zero value otherwise. + +### GetMemoryMbytesOk + +`func (o *RunOptions) GetMemoryMbytesOk() (*int32, bool)` + +GetMemoryMbytesOk returns a tuple with the MemoryMbytes field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMemoryMbytes + +`func (o *RunOptions) SetMemoryMbytes(v int32)` + +SetMemoryMbytes sets MemoryMbytes field to given value. + + +### GetDiskMbytes + +`func (o *RunOptions) GetDiskMbytes() int32` + +GetDiskMbytes returns the DiskMbytes field if non-nil, zero value otherwise. + +### GetDiskMbytesOk + +`func (o *RunOptions) GetDiskMbytesOk() (*int32, bool)` + +GetDiskMbytesOk returns a tuple with the DiskMbytes field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDiskMbytes + +`func (o *RunOptions) SetDiskMbytes(v int32)` + +SetDiskMbytes sets DiskMbytes field to given value. + + +### GetMaxItems + +`func (o *RunOptions) GetMaxItems() int32` + +GetMaxItems returns the MaxItems field if non-nil, zero value otherwise. + +### GetMaxItemsOk + +`func (o *RunOptions) GetMaxItemsOk() (*int32, bool)` + +GetMaxItemsOk returns a tuple with the MaxItems field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMaxItems + +`func (o *RunOptions) SetMaxItems(v int32)` + +SetMaxItems sets MaxItems field to given value. + +### HasMaxItems + +`func (o *RunOptions) HasMaxItems() bool` + +HasMaxItems returns a boolean if a field has been set. + +### SetMaxItemsNil + +`func (o *RunOptions) SetMaxItemsNil(b bool)` + + SetMaxItemsNil sets the value for MaxItems to be an explicit nil + +### UnsetMaxItems +`func (o *RunOptions) UnsetMaxItems()` + +UnsetMaxItems ensures that no value is present for MaxItems, not even an explicit nil +### GetMaxTotalChargeUsd + +`func (o *RunOptions) GetMaxTotalChargeUsd() float32` + +GetMaxTotalChargeUsd returns the MaxTotalChargeUsd field if non-nil, zero value otherwise. + +### GetMaxTotalChargeUsdOk + +`func (o *RunOptions) GetMaxTotalChargeUsdOk() (*float32, bool)` + +GetMaxTotalChargeUsdOk returns a tuple with the MaxTotalChargeUsd field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMaxTotalChargeUsd + +`func (o *RunOptions) SetMaxTotalChargeUsd(v float32)` + +SetMaxTotalChargeUsd sets MaxTotalChargeUsd field to given value. + +### HasMaxTotalChargeUsd + +`func (o *RunOptions) HasMaxTotalChargeUsd() bool` + +HasMaxTotalChargeUsd returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/RunOrigin.md b/docs/RunOrigin.md new file mode 100644 index 0000000..d4c3839 --- /dev/null +++ b/docs/RunOrigin.md @@ -0,0 +1,29 @@ +# RunOrigin + +## Enum + + +* `DEVELOPMENT` (value: `"DEVELOPMENT"`) + +* `WEB` (value: `"WEB"`) + +* `API` (value: `"API"`) + +* `SCHEDULER` (value: `"SCHEDULER"`) + +* `TEST` (value: `"TEST"`) + +* `WEBHOOK` (value: `"WEBHOOK"`) + +* `ACTOR` (value: `"ACTOR"`) + +* `CLI` (value: `"CLI"`) + +* `CI` (value: `"CI"`) + +* `STANDBY` (value: `"STANDBY"`) + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/RunResponse.md b/docs/RunResponse.md new file mode 100644 index 0000000..928d27d --- /dev/null +++ b/docs/RunResponse.md @@ -0,0 +1,51 @@ +# RunResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Data** | [**Run**](Run.md) | | + +## Methods + +### NewRunResponse + +`func NewRunResponse(data Run, ) *RunResponse` + +NewRunResponse instantiates a new RunResponse object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewRunResponseWithDefaults + +`func NewRunResponseWithDefaults() *RunResponse` + +NewRunResponseWithDefaults instantiates a new RunResponse object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetData + +`func (o *RunResponse) GetData() Run` + +GetData returns the Data field if non-nil, zero value otherwise. + +### GetDataOk + +`func (o *RunResponse) GetDataOk() (*Run, bool)` + +GetDataOk returns a tuple with the Data field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetData + +`func (o *RunResponse) SetData(v Run)` + +SetData sets Data field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/RunShort.md b/docs/RunShort.md new file mode 100644 index 0000000..21e6012 --- /dev/null +++ b/docs/RunShort.md @@ -0,0 +1,390 @@ +# RunShort + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **string** | | +**ActId** | **string** | | +**UserId** | Pointer to **string** | | [optional] +**ActorTaskId** | Pointer to **NullableString** | | [optional] +**Status** | [**ActorJobStatus**](ActorJobStatus.md) | | +**StartedAt** | **time.Time** | | +**FinishedAt** | Pointer to **NullableTime** | | [optional] +**BuildId** | **string** | | +**BuildNumber** | Pointer to **string** | | [optional] +**BuildNumberInt** | Pointer to **int32** | | [optional] +**Meta** | [**RunMeta**](RunMeta.md) | | +**UsageTotalUsd** | **float32** | | +**DefaultKeyValueStoreId** | **string** | | +**DefaultDatasetId** | **string** | | +**DefaultRequestQueueId** | **string** | | + +## Methods + +### NewRunShort + +`func NewRunShort(id string, actId string, status ActorJobStatus, startedAt time.Time, buildId string, meta RunMeta, usageTotalUsd float32, defaultKeyValueStoreId string, defaultDatasetId string, defaultRequestQueueId string, ) *RunShort` + +NewRunShort instantiates a new RunShort object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewRunShortWithDefaults + +`func NewRunShortWithDefaults() *RunShort` + +NewRunShortWithDefaults instantiates a new RunShort object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetId + +`func (o *RunShort) GetId() string` + +GetId returns the Id field if non-nil, zero value otherwise. + +### GetIdOk + +`func (o *RunShort) GetIdOk() (*string, bool)` + +GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetId + +`func (o *RunShort) SetId(v string)` + +SetId sets Id field to given value. + + +### GetActId + +`func (o *RunShort) GetActId() string` + +GetActId returns the ActId field if non-nil, zero value otherwise. + +### GetActIdOk + +`func (o *RunShort) GetActIdOk() (*string, bool)` + +GetActIdOk returns a tuple with the ActId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetActId + +`func (o *RunShort) SetActId(v string)` + +SetActId sets ActId field to given value. + + +### GetUserId + +`func (o *RunShort) GetUserId() string` + +GetUserId returns the UserId field if non-nil, zero value otherwise. + +### GetUserIdOk + +`func (o *RunShort) GetUserIdOk() (*string, bool)` + +GetUserIdOk returns a tuple with the UserId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUserId + +`func (o *RunShort) SetUserId(v string)` + +SetUserId sets UserId field to given value. + +### HasUserId + +`func (o *RunShort) HasUserId() bool` + +HasUserId returns a boolean if a field has been set. + +### GetActorTaskId + +`func (o *RunShort) GetActorTaskId() string` + +GetActorTaskId returns the ActorTaskId field if non-nil, zero value otherwise. + +### GetActorTaskIdOk + +`func (o *RunShort) GetActorTaskIdOk() (*string, bool)` + +GetActorTaskIdOk returns a tuple with the ActorTaskId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetActorTaskId + +`func (o *RunShort) SetActorTaskId(v string)` + +SetActorTaskId sets ActorTaskId field to given value. + +### HasActorTaskId + +`func (o *RunShort) HasActorTaskId() bool` + +HasActorTaskId returns a boolean if a field has been set. + +### SetActorTaskIdNil + +`func (o *RunShort) SetActorTaskIdNil(b bool)` + + SetActorTaskIdNil sets the value for ActorTaskId to be an explicit nil + +### UnsetActorTaskId +`func (o *RunShort) UnsetActorTaskId()` + +UnsetActorTaskId ensures that no value is present for ActorTaskId, not even an explicit nil +### GetStatus + +`func (o *RunShort) GetStatus() ActorJobStatus` + +GetStatus returns the Status field if non-nil, zero value otherwise. + +### GetStatusOk + +`func (o *RunShort) GetStatusOk() (*ActorJobStatus, bool)` + +GetStatusOk returns a tuple with the Status field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetStatus + +`func (o *RunShort) SetStatus(v ActorJobStatus)` + +SetStatus sets Status field to given value. + + +### GetStartedAt + +`func (o *RunShort) GetStartedAt() time.Time` + +GetStartedAt returns the StartedAt field if non-nil, zero value otherwise. + +### GetStartedAtOk + +`func (o *RunShort) GetStartedAtOk() (*time.Time, bool)` + +GetStartedAtOk returns a tuple with the StartedAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetStartedAt + +`func (o *RunShort) SetStartedAt(v time.Time)` + +SetStartedAt sets StartedAt field to given value. + + +### GetFinishedAt + +`func (o *RunShort) GetFinishedAt() time.Time` + +GetFinishedAt returns the FinishedAt field if non-nil, zero value otherwise. + +### GetFinishedAtOk + +`func (o *RunShort) GetFinishedAtOk() (*time.Time, bool)` + +GetFinishedAtOk returns a tuple with the FinishedAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetFinishedAt + +`func (o *RunShort) SetFinishedAt(v time.Time)` + +SetFinishedAt sets FinishedAt field to given value. + +### HasFinishedAt + +`func (o *RunShort) HasFinishedAt() bool` + +HasFinishedAt returns a boolean if a field has been set. + +### SetFinishedAtNil + +`func (o *RunShort) SetFinishedAtNil(b bool)` + + SetFinishedAtNil sets the value for FinishedAt to be an explicit nil + +### UnsetFinishedAt +`func (o *RunShort) UnsetFinishedAt()` + +UnsetFinishedAt ensures that no value is present for FinishedAt, not even an explicit nil +### GetBuildId + +`func (o *RunShort) GetBuildId() string` + +GetBuildId returns the BuildId field if non-nil, zero value otherwise. + +### GetBuildIdOk + +`func (o *RunShort) GetBuildIdOk() (*string, bool)` + +GetBuildIdOk returns a tuple with the BuildId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetBuildId + +`func (o *RunShort) SetBuildId(v string)` + +SetBuildId sets BuildId field to given value. + + +### GetBuildNumber + +`func (o *RunShort) GetBuildNumber() string` + +GetBuildNumber returns the BuildNumber field if non-nil, zero value otherwise. + +### GetBuildNumberOk + +`func (o *RunShort) GetBuildNumberOk() (*string, bool)` + +GetBuildNumberOk returns a tuple with the BuildNumber field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetBuildNumber + +`func (o *RunShort) SetBuildNumber(v string)` + +SetBuildNumber sets BuildNumber field to given value. + +### HasBuildNumber + +`func (o *RunShort) HasBuildNumber() bool` + +HasBuildNumber returns a boolean if a field has been set. + +### GetBuildNumberInt + +`func (o *RunShort) GetBuildNumberInt() int32` + +GetBuildNumberInt returns the BuildNumberInt field if non-nil, zero value otherwise. + +### GetBuildNumberIntOk + +`func (o *RunShort) GetBuildNumberIntOk() (*int32, bool)` + +GetBuildNumberIntOk returns a tuple with the BuildNumberInt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetBuildNumberInt + +`func (o *RunShort) SetBuildNumberInt(v int32)` + +SetBuildNumberInt sets BuildNumberInt field to given value. + +### HasBuildNumberInt + +`func (o *RunShort) HasBuildNumberInt() bool` + +HasBuildNumberInt returns a boolean if a field has been set. + +### GetMeta + +`func (o *RunShort) GetMeta() RunMeta` + +GetMeta returns the Meta field if non-nil, zero value otherwise. + +### GetMetaOk + +`func (o *RunShort) GetMetaOk() (*RunMeta, bool)` + +GetMetaOk returns a tuple with the Meta field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMeta + +`func (o *RunShort) SetMeta(v RunMeta)` + +SetMeta sets Meta field to given value. + + +### GetUsageTotalUsd + +`func (o *RunShort) GetUsageTotalUsd() float32` + +GetUsageTotalUsd returns the UsageTotalUsd field if non-nil, zero value otherwise. + +### GetUsageTotalUsdOk + +`func (o *RunShort) GetUsageTotalUsdOk() (*float32, bool)` + +GetUsageTotalUsdOk returns a tuple with the UsageTotalUsd field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUsageTotalUsd + +`func (o *RunShort) SetUsageTotalUsd(v float32)` + +SetUsageTotalUsd sets UsageTotalUsd field to given value. + + +### GetDefaultKeyValueStoreId + +`func (o *RunShort) GetDefaultKeyValueStoreId() string` + +GetDefaultKeyValueStoreId returns the DefaultKeyValueStoreId field if non-nil, zero value otherwise. + +### GetDefaultKeyValueStoreIdOk + +`func (o *RunShort) GetDefaultKeyValueStoreIdOk() (*string, bool)` + +GetDefaultKeyValueStoreIdOk returns a tuple with the DefaultKeyValueStoreId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDefaultKeyValueStoreId + +`func (o *RunShort) SetDefaultKeyValueStoreId(v string)` + +SetDefaultKeyValueStoreId sets DefaultKeyValueStoreId field to given value. + + +### GetDefaultDatasetId + +`func (o *RunShort) GetDefaultDatasetId() string` + +GetDefaultDatasetId returns the DefaultDatasetId field if non-nil, zero value otherwise. + +### GetDefaultDatasetIdOk + +`func (o *RunShort) GetDefaultDatasetIdOk() (*string, bool)` + +GetDefaultDatasetIdOk returns a tuple with the DefaultDatasetId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDefaultDatasetId + +`func (o *RunShort) SetDefaultDatasetId(v string)` + +SetDefaultDatasetId sets DefaultDatasetId field to given value. + + +### GetDefaultRequestQueueId + +`func (o *RunShort) GetDefaultRequestQueueId() string` + +GetDefaultRequestQueueId returns the DefaultRequestQueueId field if non-nil, zero value otherwise. + +### GetDefaultRequestQueueIdOk + +`func (o *RunShort) GetDefaultRequestQueueIdOk() (*string, bool)` + +GetDefaultRequestQueueIdOk returns a tuple with the DefaultRequestQueueId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDefaultRequestQueueId + +`func (o *RunShort) SetDefaultRequestQueueId(v string)` + +SetDefaultRequestQueueId sets DefaultRequestQueueId field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/RunStats.md b/docs/RunStats.md new file mode 100644 index 0000000..52aae97 --- /dev/null +++ b/docs/RunStats.md @@ -0,0 +1,467 @@ +# RunStats + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**InputBodyLen** | Pointer to **NullableInt32** | | [optional] +**MigrationCount** | Pointer to **int32** | | [optional] +**RebootCount** | Pointer to **int32** | | [optional] +**RestartCount** | **int32** | | +**ResurrectCount** | **int32** | | +**MemAvgBytes** | Pointer to **float32** | | [optional] +**MemMaxBytes** | Pointer to **int32** | | [optional] +**MemCurrentBytes** | Pointer to **int32** | | [optional] +**CpuAvgUsage** | Pointer to **float32** | | [optional] +**CpuMaxUsage** | Pointer to **float32** | | [optional] +**CpuCurrentUsage** | Pointer to **float32** | | [optional] +**NetRxBytes** | Pointer to **int32** | | [optional] +**NetTxBytes** | Pointer to **int32** | | [optional] +**DurationMillis** | Pointer to **int32** | | [optional] +**RunTimeSecs** | Pointer to **float32** | | [optional] +**Metamorph** | Pointer to **int32** | | [optional] +**ComputeUnits** | **float32** | | + +## Methods + +### NewRunStats + +`func NewRunStats(restartCount int32, resurrectCount int32, computeUnits float32, ) *RunStats` + +NewRunStats instantiates a new RunStats object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewRunStatsWithDefaults + +`func NewRunStatsWithDefaults() *RunStats` + +NewRunStatsWithDefaults instantiates a new RunStats object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetInputBodyLen + +`func (o *RunStats) GetInputBodyLen() int32` + +GetInputBodyLen returns the InputBodyLen field if non-nil, zero value otherwise. + +### GetInputBodyLenOk + +`func (o *RunStats) GetInputBodyLenOk() (*int32, bool)` + +GetInputBodyLenOk returns a tuple with the InputBodyLen field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetInputBodyLen + +`func (o *RunStats) SetInputBodyLen(v int32)` + +SetInputBodyLen sets InputBodyLen field to given value. + +### HasInputBodyLen + +`func (o *RunStats) HasInputBodyLen() bool` + +HasInputBodyLen returns a boolean if a field has been set. + +### SetInputBodyLenNil + +`func (o *RunStats) SetInputBodyLenNil(b bool)` + + SetInputBodyLenNil sets the value for InputBodyLen to be an explicit nil + +### UnsetInputBodyLen +`func (o *RunStats) UnsetInputBodyLen()` + +UnsetInputBodyLen ensures that no value is present for InputBodyLen, not even an explicit nil +### GetMigrationCount + +`func (o *RunStats) GetMigrationCount() int32` + +GetMigrationCount returns the MigrationCount field if non-nil, zero value otherwise. + +### GetMigrationCountOk + +`func (o *RunStats) GetMigrationCountOk() (*int32, bool)` + +GetMigrationCountOk returns a tuple with the MigrationCount field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMigrationCount + +`func (o *RunStats) SetMigrationCount(v int32)` + +SetMigrationCount sets MigrationCount field to given value. + +### HasMigrationCount + +`func (o *RunStats) HasMigrationCount() bool` + +HasMigrationCount returns a boolean if a field has been set. + +### GetRebootCount + +`func (o *RunStats) GetRebootCount() int32` + +GetRebootCount returns the RebootCount field if non-nil, zero value otherwise. + +### GetRebootCountOk + +`func (o *RunStats) GetRebootCountOk() (*int32, bool)` + +GetRebootCountOk returns a tuple with the RebootCount field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRebootCount + +`func (o *RunStats) SetRebootCount(v int32)` + +SetRebootCount sets RebootCount field to given value. + +### HasRebootCount + +`func (o *RunStats) HasRebootCount() bool` + +HasRebootCount returns a boolean if a field has been set. + +### GetRestartCount + +`func (o *RunStats) GetRestartCount() int32` + +GetRestartCount returns the RestartCount field if non-nil, zero value otherwise. + +### GetRestartCountOk + +`func (o *RunStats) GetRestartCountOk() (*int32, bool)` + +GetRestartCountOk returns a tuple with the RestartCount field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRestartCount + +`func (o *RunStats) SetRestartCount(v int32)` + +SetRestartCount sets RestartCount field to given value. + + +### GetResurrectCount + +`func (o *RunStats) GetResurrectCount() int32` + +GetResurrectCount returns the ResurrectCount field if non-nil, zero value otherwise. + +### GetResurrectCountOk + +`func (o *RunStats) GetResurrectCountOk() (*int32, bool)` + +GetResurrectCountOk returns a tuple with the ResurrectCount field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetResurrectCount + +`func (o *RunStats) SetResurrectCount(v int32)` + +SetResurrectCount sets ResurrectCount field to given value. + + +### GetMemAvgBytes + +`func (o *RunStats) GetMemAvgBytes() float32` + +GetMemAvgBytes returns the MemAvgBytes field if non-nil, zero value otherwise. + +### GetMemAvgBytesOk + +`func (o *RunStats) GetMemAvgBytesOk() (*float32, bool)` + +GetMemAvgBytesOk returns a tuple with the MemAvgBytes field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMemAvgBytes + +`func (o *RunStats) SetMemAvgBytes(v float32)` + +SetMemAvgBytes sets MemAvgBytes field to given value. + +### HasMemAvgBytes + +`func (o *RunStats) HasMemAvgBytes() bool` + +HasMemAvgBytes returns a boolean if a field has been set. + +### GetMemMaxBytes + +`func (o *RunStats) GetMemMaxBytes() int32` + +GetMemMaxBytes returns the MemMaxBytes field if non-nil, zero value otherwise. + +### GetMemMaxBytesOk + +`func (o *RunStats) GetMemMaxBytesOk() (*int32, bool)` + +GetMemMaxBytesOk returns a tuple with the MemMaxBytes field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMemMaxBytes + +`func (o *RunStats) SetMemMaxBytes(v int32)` + +SetMemMaxBytes sets MemMaxBytes field to given value. + +### HasMemMaxBytes + +`func (o *RunStats) HasMemMaxBytes() bool` + +HasMemMaxBytes returns a boolean if a field has been set. + +### GetMemCurrentBytes + +`func (o *RunStats) GetMemCurrentBytes() int32` + +GetMemCurrentBytes returns the MemCurrentBytes field if non-nil, zero value otherwise. + +### GetMemCurrentBytesOk + +`func (o *RunStats) GetMemCurrentBytesOk() (*int32, bool)` + +GetMemCurrentBytesOk returns a tuple with the MemCurrentBytes field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMemCurrentBytes + +`func (o *RunStats) SetMemCurrentBytes(v int32)` + +SetMemCurrentBytes sets MemCurrentBytes field to given value. + +### HasMemCurrentBytes + +`func (o *RunStats) HasMemCurrentBytes() bool` + +HasMemCurrentBytes returns a boolean if a field has been set. + +### GetCpuAvgUsage + +`func (o *RunStats) GetCpuAvgUsage() float32` + +GetCpuAvgUsage returns the CpuAvgUsage field if non-nil, zero value otherwise. + +### GetCpuAvgUsageOk + +`func (o *RunStats) GetCpuAvgUsageOk() (*float32, bool)` + +GetCpuAvgUsageOk returns a tuple with the CpuAvgUsage field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCpuAvgUsage + +`func (o *RunStats) SetCpuAvgUsage(v float32)` + +SetCpuAvgUsage sets CpuAvgUsage field to given value. + +### HasCpuAvgUsage + +`func (o *RunStats) HasCpuAvgUsage() bool` + +HasCpuAvgUsage returns a boolean if a field has been set. + +### GetCpuMaxUsage + +`func (o *RunStats) GetCpuMaxUsage() float32` + +GetCpuMaxUsage returns the CpuMaxUsage field if non-nil, zero value otherwise. + +### GetCpuMaxUsageOk + +`func (o *RunStats) GetCpuMaxUsageOk() (*float32, bool)` + +GetCpuMaxUsageOk returns a tuple with the CpuMaxUsage field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCpuMaxUsage + +`func (o *RunStats) SetCpuMaxUsage(v float32)` + +SetCpuMaxUsage sets CpuMaxUsage field to given value. + +### HasCpuMaxUsage + +`func (o *RunStats) HasCpuMaxUsage() bool` + +HasCpuMaxUsage returns a boolean if a field has been set. + +### GetCpuCurrentUsage + +`func (o *RunStats) GetCpuCurrentUsage() float32` + +GetCpuCurrentUsage returns the CpuCurrentUsage field if non-nil, zero value otherwise. + +### GetCpuCurrentUsageOk + +`func (o *RunStats) GetCpuCurrentUsageOk() (*float32, bool)` + +GetCpuCurrentUsageOk returns a tuple with the CpuCurrentUsage field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCpuCurrentUsage + +`func (o *RunStats) SetCpuCurrentUsage(v float32)` + +SetCpuCurrentUsage sets CpuCurrentUsage field to given value. + +### HasCpuCurrentUsage + +`func (o *RunStats) HasCpuCurrentUsage() bool` + +HasCpuCurrentUsage returns a boolean if a field has been set. + +### GetNetRxBytes + +`func (o *RunStats) GetNetRxBytes() int32` + +GetNetRxBytes returns the NetRxBytes field if non-nil, zero value otherwise. + +### GetNetRxBytesOk + +`func (o *RunStats) GetNetRxBytesOk() (*int32, bool)` + +GetNetRxBytesOk returns a tuple with the NetRxBytes field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetNetRxBytes + +`func (o *RunStats) SetNetRxBytes(v int32)` + +SetNetRxBytes sets NetRxBytes field to given value. + +### HasNetRxBytes + +`func (o *RunStats) HasNetRxBytes() bool` + +HasNetRxBytes returns a boolean if a field has been set. + +### GetNetTxBytes + +`func (o *RunStats) GetNetTxBytes() int32` + +GetNetTxBytes returns the NetTxBytes field if non-nil, zero value otherwise. + +### GetNetTxBytesOk + +`func (o *RunStats) GetNetTxBytesOk() (*int32, bool)` + +GetNetTxBytesOk returns a tuple with the NetTxBytes field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetNetTxBytes + +`func (o *RunStats) SetNetTxBytes(v int32)` + +SetNetTxBytes sets NetTxBytes field to given value. + +### HasNetTxBytes + +`func (o *RunStats) HasNetTxBytes() bool` + +HasNetTxBytes returns a boolean if a field has been set. + +### GetDurationMillis + +`func (o *RunStats) GetDurationMillis() int32` + +GetDurationMillis returns the DurationMillis field if non-nil, zero value otherwise. + +### GetDurationMillisOk + +`func (o *RunStats) GetDurationMillisOk() (*int32, bool)` + +GetDurationMillisOk returns a tuple with the DurationMillis field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDurationMillis + +`func (o *RunStats) SetDurationMillis(v int32)` + +SetDurationMillis sets DurationMillis field to given value. + +### HasDurationMillis + +`func (o *RunStats) HasDurationMillis() bool` + +HasDurationMillis returns a boolean if a field has been set. + +### GetRunTimeSecs + +`func (o *RunStats) GetRunTimeSecs() float32` + +GetRunTimeSecs returns the RunTimeSecs field if non-nil, zero value otherwise. + +### GetRunTimeSecsOk + +`func (o *RunStats) GetRunTimeSecsOk() (*float32, bool)` + +GetRunTimeSecsOk returns a tuple with the RunTimeSecs field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRunTimeSecs + +`func (o *RunStats) SetRunTimeSecs(v float32)` + +SetRunTimeSecs sets RunTimeSecs field to given value. + +### HasRunTimeSecs + +`func (o *RunStats) HasRunTimeSecs() bool` + +HasRunTimeSecs returns a boolean if a field has been set. + +### GetMetamorph + +`func (o *RunStats) GetMetamorph() int32` + +GetMetamorph returns the Metamorph field if non-nil, zero value otherwise. + +### GetMetamorphOk + +`func (o *RunStats) GetMetamorphOk() (*int32, bool)` + +GetMetamorphOk returns a tuple with the Metamorph field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMetamorph + +`func (o *RunStats) SetMetamorph(v int32)` + +SetMetamorph sets Metamorph field to given value. + +### HasMetamorph + +`func (o *RunStats) HasMetamorph() bool` + +HasMetamorph returns a boolean if a field has been set. + +### GetComputeUnits + +`func (o *RunStats) GetComputeUnits() float32` + +GetComputeUnits returns the ComputeUnits field if non-nil, zero value otherwise. + +### GetComputeUnitsOk + +`func (o *RunStats) GetComputeUnitsOk() (*float32, bool)` + +GetComputeUnitsOk returns a tuple with the ComputeUnits field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetComputeUnits + +`func (o *RunStats) SetComputeUnits(v float32)` + +SetComputeUnits sets ComputeUnits field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/RunStorageIds.md b/docs/RunStorageIds.md new file mode 100644 index 0000000..fc234cf --- /dev/null +++ b/docs/RunStorageIds.md @@ -0,0 +1,108 @@ +# RunStorageIds + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Datasets** | Pointer to [**RunStorageIdsDatasets**](RunStorageIdsDatasets.md) | | [optional] +**KeyValueStores** | Pointer to [**RunStorageIdsDatasets**](RunStorageIdsDatasets.md) | | [optional] +**RequestQueues** | Pointer to [**RunStorageIdsDatasets**](RunStorageIdsDatasets.md) | | [optional] + +## Methods + +### NewRunStorageIds + +`func NewRunStorageIds() *RunStorageIds` + +NewRunStorageIds instantiates a new RunStorageIds object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewRunStorageIdsWithDefaults + +`func NewRunStorageIdsWithDefaults() *RunStorageIds` + +NewRunStorageIdsWithDefaults instantiates a new RunStorageIds object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetDatasets + +`func (o *RunStorageIds) GetDatasets() RunStorageIdsDatasets` + +GetDatasets returns the Datasets field if non-nil, zero value otherwise. + +### GetDatasetsOk + +`func (o *RunStorageIds) GetDatasetsOk() (*RunStorageIdsDatasets, bool)` + +GetDatasetsOk returns a tuple with the Datasets field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDatasets + +`func (o *RunStorageIds) SetDatasets(v RunStorageIdsDatasets)` + +SetDatasets sets Datasets field to given value. + +### HasDatasets + +`func (o *RunStorageIds) HasDatasets() bool` + +HasDatasets returns a boolean if a field has been set. + +### GetKeyValueStores + +`func (o *RunStorageIds) GetKeyValueStores() RunStorageIdsDatasets` + +GetKeyValueStores returns the KeyValueStores field if non-nil, zero value otherwise. + +### GetKeyValueStoresOk + +`func (o *RunStorageIds) GetKeyValueStoresOk() (*RunStorageIdsDatasets, bool)` + +GetKeyValueStoresOk returns a tuple with the KeyValueStores field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetKeyValueStores + +`func (o *RunStorageIds) SetKeyValueStores(v RunStorageIdsDatasets)` + +SetKeyValueStores sets KeyValueStores field to given value. + +### HasKeyValueStores + +`func (o *RunStorageIds) HasKeyValueStores() bool` + +HasKeyValueStores returns a boolean if a field has been set. + +### GetRequestQueues + +`func (o *RunStorageIds) GetRequestQueues() RunStorageIdsDatasets` + +GetRequestQueues returns the RequestQueues field if non-nil, zero value otherwise. + +### GetRequestQueuesOk + +`func (o *RunStorageIds) GetRequestQueuesOk() (*RunStorageIdsDatasets, bool)` + +GetRequestQueuesOk returns a tuple with the RequestQueues field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRequestQueues + +`func (o *RunStorageIds) SetRequestQueues(v RunStorageIdsDatasets)` + +SetRequestQueues sets RequestQueues field to given value. + +### HasRequestQueues + +`func (o *RunStorageIds) HasRequestQueues() bool` + +HasRequestQueues returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/RunStorageIdsDatasets.md b/docs/RunStorageIdsDatasets.md new file mode 100644 index 0000000..30c7ffa --- /dev/null +++ b/docs/RunStorageIdsDatasets.md @@ -0,0 +1,56 @@ +# RunStorageIdsDatasets + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Default** | Pointer to **string** | ID of the default dataset for this run. | [optional] + +## Methods + +### NewRunStorageIdsDatasets + +`func NewRunStorageIdsDatasets() *RunStorageIdsDatasets` + +NewRunStorageIdsDatasets instantiates a new RunStorageIdsDatasets object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewRunStorageIdsDatasetsWithDefaults + +`func NewRunStorageIdsDatasetsWithDefaults() *RunStorageIdsDatasets` + +NewRunStorageIdsDatasetsWithDefaults instantiates a new RunStorageIdsDatasets object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetDefault + +`func (o *RunStorageIdsDatasets) GetDefault() string` + +GetDefault returns the Default field if non-nil, zero value otherwise. + +### GetDefaultOk + +`func (o *RunStorageIdsDatasets) GetDefaultOk() (*string, bool)` + +GetDefaultOk returns a tuple with the Default field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDefault + +`func (o *RunStorageIdsDatasets) SetDefault(v string)` + +SetDefault sets Default field to given value. + +### HasDefault + +`func (o *RunStorageIdsDatasets) HasDefault() bool` + +HasDefault returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/RunTimeoutExceededErrorDetail.md b/docs/RunTimeoutExceededErrorDetail.md new file mode 100644 index 0000000..c6a0195 --- /dev/null +++ b/docs/RunTimeoutExceededErrorDetail.md @@ -0,0 +1,92 @@ +# RunTimeoutExceededErrorDetail + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Type** | Pointer to **interface{}** | | [optional] +**Message** | Pointer to **string** | Human-readable error message describing what went wrong. | [optional] + +## Methods + +### NewRunTimeoutExceededErrorDetail + +`func NewRunTimeoutExceededErrorDetail() *RunTimeoutExceededErrorDetail` + +NewRunTimeoutExceededErrorDetail instantiates a new RunTimeoutExceededErrorDetail object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewRunTimeoutExceededErrorDetailWithDefaults + +`func NewRunTimeoutExceededErrorDetailWithDefaults() *RunTimeoutExceededErrorDetail` + +NewRunTimeoutExceededErrorDetailWithDefaults instantiates a new RunTimeoutExceededErrorDetail object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetType + +`func (o *RunTimeoutExceededErrorDetail) GetType() interface{}` + +GetType returns the Type field if non-nil, zero value otherwise. + +### GetTypeOk + +`func (o *RunTimeoutExceededErrorDetail) GetTypeOk() (*interface{}, bool)` + +GetTypeOk returns a tuple with the Type field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetType + +`func (o *RunTimeoutExceededErrorDetail) SetType(v interface{})` + +SetType sets Type field to given value. + +### HasType + +`func (o *RunTimeoutExceededErrorDetail) HasType() bool` + +HasType returns a boolean if a field has been set. + +### SetTypeNil + +`func (o *RunTimeoutExceededErrorDetail) SetTypeNil(b bool)` + + SetTypeNil sets the value for Type to be an explicit nil + +### UnsetType +`func (o *RunTimeoutExceededErrorDetail) UnsetType()` + +UnsetType ensures that no value is present for Type, not even an explicit nil +### GetMessage + +`func (o *RunTimeoutExceededErrorDetail) GetMessage() string` + +GetMessage returns the Message field if non-nil, zero value otherwise. + +### GetMessageOk + +`func (o *RunTimeoutExceededErrorDetail) GetMessageOk() (*string, bool)` + +GetMessageOk returns a tuple with the Message field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMessage + +`func (o *RunTimeoutExceededErrorDetail) SetMessage(v string)` + +SetMessage sets Message field to given value. + +### HasMessage + +`func (o *RunTimeoutExceededErrorDetail) HasMessage() bool` + +HasMessage returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/RunUsage.md b/docs/RunUsage.md new file mode 100644 index 0000000..8fe349b --- /dev/null +++ b/docs/RunUsage.md @@ -0,0 +1,462 @@ +# RunUsage + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ACTOR_COMPUTE_UNITS** | Pointer to **NullableFloat32** | | [optional] +**DATASET_READS** | Pointer to **NullableInt32** | | [optional] +**DATASET_WRITES** | Pointer to **NullableInt32** | | [optional] +**KEY_VALUE_STORE_READS** | Pointer to **NullableInt32** | | [optional] +**KEY_VALUE_STORE_WRITES** | Pointer to **NullableInt32** | | [optional] +**KEY_VALUE_STORE_LISTS** | Pointer to **NullableInt32** | | [optional] +**REQUEST_QUEUE_READS** | Pointer to **NullableInt32** | | [optional] +**REQUEST_QUEUE_WRITES** | Pointer to **NullableInt32** | | [optional] +**DATA_TRANSFER_INTERNAL_GBYTES** | Pointer to **NullableFloat32** | | [optional] +**DATA_TRANSFER_EXTERNAL_GBYTES** | Pointer to **NullableFloat32** | | [optional] +**PROXY_RESIDENTIAL_TRANSFER_GBYTES** | Pointer to **NullableFloat32** | | [optional] +**PROXY_SERPS** | Pointer to **NullableInt32** | | [optional] + +## Methods + +### NewRunUsage + +`func NewRunUsage() *RunUsage` + +NewRunUsage instantiates a new RunUsage object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewRunUsageWithDefaults + +`func NewRunUsageWithDefaults() *RunUsage` + +NewRunUsageWithDefaults instantiates a new RunUsage object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetACTOR_COMPUTE_UNITS + +`func (o *RunUsage) GetACTOR_COMPUTE_UNITS() float32` + +GetACTOR_COMPUTE_UNITS returns the ACTOR_COMPUTE_UNITS field if non-nil, zero value otherwise. + +### GetACTOR_COMPUTE_UNITSOk + +`func (o *RunUsage) GetACTOR_COMPUTE_UNITSOk() (*float32, bool)` + +GetACTOR_COMPUTE_UNITSOk returns a tuple with the ACTOR_COMPUTE_UNITS field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetACTOR_COMPUTE_UNITS + +`func (o *RunUsage) SetACTOR_COMPUTE_UNITS(v float32)` + +SetACTOR_COMPUTE_UNITS sets ACTOR_COMPUTE_UNITS field to given value. + +### HasACTOR_COMPUTE_UNITS + +`func (o *RunUsage) HasACTOR_COMPUTE_UNITS() bool` + +HasACTOR_COMPUTE_UNITS returns a boolean if a field has been set. + +### SetACTOR_COMPUTE_UNITSNil + +`func (o *RunUsage) SetACTOR_COMPUTE_UNITSNil(b bool)` + + SetACTOR_COMPUTE_UNITSNil sets the value for ACTOR_COMPUTE_UNITS to be an explicit nil + +### UnsetACTOR_COMPUTE_UNITS +`func (o *RunUsage) UnsetACTOR_COMPUTE_UNITS()` + +UnsetACTOR_COMPUTE_UNITS ensures that no value is present for ACTOR_COMPUTE_UNITS, not even an explicit nil +### GetDATASET_READS + +`func (o *RunUsage) GetDATASET_READS() int32` + +GetDATASET_READS returns the DATASET_READS field if non-nil, zero value otherwise. + +### GetDATASET_READSOk + +`func (o *RunUsage) GetDATASET_READSOk() (*int32, bool)` + +GetDATASET_READSOk returns a tuple with the DATASET_READS field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDATASET_READS + +`func (o *RunUsage) SetDATASET_READS(v int32)` + +SetDATASET_READS sets DATASET_READS field to given value. + +### HasDATASET_READS + +`func (o *RunUsage) HasDATASET_READS() bool` + +HasDATASET_READS returns a boolean if a field has been set. + +### SetDATASET_READSNil + +`func (o *RunUsage) SetDATASET_READSNil(b bool)` + + SetDATASET_READSNil sets the value for DATASET_READS to be an explicit nil + +### UnsetDATASET_READS +`func (o *RunUsage) UnsetDATASET_READS()` + +UnsetDATASET_READS ensures that no value is present for DATASET_READS, not even an explicit nil +### GetDATASET_WRITES + +`func (o *RunUsage) GetDATASET_WRITES() int32` + +GetDATASET_WRITES returns the DATASET_WRITES field if non-nil, zero value otherwise. + +### GetDATASET_WRITESOk + +`func (o *RunUsage) GetDATASET_WRITESOk() (*int32, bool)` + +GetDATASET_WRITESOk returns a tuple with the DATASET_WRITES field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDATASET_WRITES + +`func (o *RunUsage) SetDATASET_WRITES(v int32)` + +SetDATASET_WRITES sets DATASET_WRITES field to given value. + +### HasDATASET_WRITES + +`func (o *RunUsage) HasDATASET_WRITES() bool` + +HasDATASET_WRITES returns a boolean if a field has been set. + +### SetDATASET_WRITESNil + +`func (o *RunUsage) SetDATASET_WRITESNil(b bool)` + + SetDATASET_WRITESNil sets the value for DATASET_WRITES to be an explicit nil + +### UnsetDATASET_WRITES +`func (o *RunUsage) UnsetDATASET_WRITES()` + +UnsetDATASET_WRITES ensures that no value is present for DATASET_WRITES, not even an explicit nil +### GetKEY_VALUE_STORE_READS + +`func (o *RunUsage) GetKEY_VALUE_STORE_READS() int32` + +GetKEY_VALUE_STORE_READS returns the KEY_VALUE_STORE_READS field if non-nil, zero value otherwise. + +### GetKEY_VALUE_STORE_READSOk + +`func (o *RunUsage) GetKEY_VALUE_STORE_READSOk() (*int32, bool)` + +GetKEY_VALUE_STORE_READSOk returns a tuple with the KEY_VALUE_STORE_READS field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetKEY_VALUE_STORE_READS + +`func (o *RunUsage) SetKEY_VALUE_STORE_READS(v int32)` + +SetKEY_VALUE_STORE_READS sets KEY_VALUE_STORE_READS field to given value. + +### HasKEY_VALUE_STORE_READS + +`func (o *RunUsage) HasKEY_VALUE_STORE_READS() bool` + +HasKEY_VALUE_STORE_READS returns a boolean if a field has been set. + +### SetKEY_VALUE_STORE_READSNil + +`func (o *RunUsage) SetKEY_VALUE_STORE_READSNil(b bool)` + + SetKEY_VALUE_STORE_READSNil sets the value for KEY_VALUE_STORE_READS to be an explicit nil + +### UnsetKEY_VALUE_STORE_READS +`func (o *RunUsage) UnsetKEY_VALUE_STORE_READS()` + +UnsetKEY_VALUE_STORE_READS ensures that no value is present for KEY_VALUE_STORE_READS, not even an explicit nil +### GetKEY_VALUE_STORE_WRITES + +`func (o *RunUsage) GetKEY_VALUE_STORE_WRITES() int32` + +GetKEY_VALUE_STORE_WRITES returns the KEY_VALUE_STORE_WRITES field if non-nil, zero value otherwise. + +### GetKEY_VALUE_STORE_WRITESOk + +`func (o *RunUsage) GetKEY_VALUE_STORE_WRITESOk() (*int32, bool)` + +GetKEY_VALUE_STORE_WRITESOk returns a tuple with the KEY_VALUE_STORE_WRITES field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetKEY_VALUE_STORE_WRITES + +`func (o *RunUsage) SetKEY_VALUE_STORE_WRITES(v int32)` + +SetKEY_VALUE_STORE_WRITES sets KEY_VALUE_STORE_WRITES field to given value. + +### HasKEY_VALUE_STORE_WRITES + +`func (o *RunUsage) HasKEY_VALUE_STORE_WRITES() bool` + +HasKEY_VALUE_STORE_WRITES returns a boolean if a field has been set. + +### SetKEY_VALUE_STORE_WRITESNil + +`func (o *RunUsage) SetKEY_VALUE_STORE_WRITESNil(b bool)` + + SetKEY_VALUE_STORE_WRITESNil sets the value for KEY_VALUE_STORE_WRITES to be an explicit nil + +### UnsetKEY_VALUE_STORE_WRITES +`func (o *RunUsage) UnsetKEY_VALUE_STORE_WRITES()` + +UnsetKEY_VALUE_STORE_WRITES ensures that no value is present for KEY_VALUE_STORE_WRITES, not even an explicit nil +### GetKEY_VALUE_STORE_LISTS + +`func (o *RunUsage) GetKEY_VALUE_STORE_LISTS() int32` + +GetKEY_VALUE_STORE_LISTS returns the KEY_VALUE_STORE_LISTS field if non-nil, zero value otherwise. + +### GetKEY_VALUE_STORE_LISTSOk + +`func (o *RunUsage) GetKEY_VALUE_STORE_LISTSOk() (*int32, bool)` + +GetKEY_VALUE_STORE_LISTSOk returns a tuple with the KEY_VALUE_STORE_LISTS field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetKEY_VALUE_STORE_LISTS + +`func (o *RunUsage) SetKEY_VALUE_STORE_LISTS(v int32)` + +SetKEY_VALUE_STORE_LISTS sets KEY_VALUE_STORE_LISTS field to given value. + +### HasKEY_VALUE_STORE_LISTS + +`func (o *RunUsage) HasKEY_VALUE_STORE_LISTS() bool` + +HasKEY_VALUE_STORE_LISTS returns a boolean if a field has been set. + +### SetKEY_VALUE_STORE_LISTSNil + +`func (o *RunUsage) SetKEY_VALUE_STORE_LISTSNil(b bool)` + + SetKEY_VALUE_STORE_LISTSNil sets the value for KEY_VALUE_STORE_LISTS to be an explicit nil + +### UnsetKEY_VALUE_STORE_LISTS +`func (o *RunUsage) UnsetKEY_VALUE_STORE_LISTS()` + +UnsetKEY_VALUE_STORE_LISTS ensures that no value is present for KEY_VALUE_STORE_LISTS, not even an explicit nil +### GetREQUEST_QUEUE_READS + +`func (o *RunUsage) GetREQUEST_QUEUE_READS() int32` + +GetREQUEST_QUEUE_READS returns the REQUEST_QUEUE_READS field if non-nil, zero value otherwise. + +### GetREQUEST_QUEUE_READSOk + +`func (o *RunUsage) GetREQUEST_QUEUE_READSOk() (*int32, bool)` + +GetREQUEST_QUEUE_READSOk returns a tuple with the REQUEST_QUEUE_READS field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetREQUEST_QUEUE_READS + +`func (o *RunUsage) SetREQUEST_QUEUE_READS(v int32)` + +SetREQUEST_QUEUE_READS sets REQUEST_QUEUE_READS field to given value. + +### HasREQUEST_QUEUE_READS + +`func (o *RunUsage) HasREQUEST_QUEUE_READS() bool` + +HasREQUEST_QUEUE_READS returns a boolean if a field has been set. + +### SetREQUEST_QUEUE_READSNil + +`func (o *RunUsage) SetREQUEST_QUEUE_READSNil(b bool)` + + SetREQUEST_QUEUE_READSNil sets the value for REQUEST_QUEUE_READS to be an explicit nil + +### UnsetREQUEST_QUEUE_READS +`func (o *RunUsage) UnsetREQUEST_QUEUE_READS()` + +UnsetREQUEST_QUEUE_READS ensures that no value is present for REQUEST_QUEUE_READS, not even an explicit nil +### GetREQUEST_QUEUE_WRITES + +`func (o *RunUsage) GetREQUEST_QUEUE_WRITES() int32` + +GetREQUEST_QUEUE_WRITES returns the REQUEST_QUEUE_WRITES field if non-nil, zero value otherwise. + +### GetREQUEST_QUEUE_WRITESOk + +`func (o *RunUsage) GetREQUEST_QUEUE_WRITESOk() (*int32, bool)` + +GetREQUEST_QUEUE_WRITESOk returns a tuple with the REQUEST_QUEUE_WRITES field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetREQUEST_QUEUE_WRITES + +`func (o *RunUsage) SetREQUEST_QUEUE_WRITES(v int32)` + +SetREQUEST_QUEUE_WRITES sets REQUEST_QUEUE_WRITES field to given value. + +### HasREQUEST_QUEUE_WRITES + +`func (o *RunUsage) HasREQUEST_QUEUE_WRITES() bool` + +HasREQUEST_QUEUE_WRITES returns a boolean if a field has been set. + +### SetREQUEST_QUEUE_WRITESNil + +`func (o *RunUsage) SetREQUEST_QUEUE_WRITESNil(b bool)` + + SetREQUEST_QUEUE_WRITESNil sets the value for REQUEST_QUEUE_WRITES to be an explicit nil + +### UnsetREQUEST_QUEUE_WRITES +`func (o *RunUsage) UnsetREQUEST_QUEUE_WRITES()` + +UnsetREQUEST_QUEUE_WRITES ensures that no value is present for REQUEST_QUEUE_WRITES, not even an explicit nil +### GetDATA_TRANSFER_INTERNAL_GBYTES + +`func (o *RunUsage) GetDATA_TRANSFER_INTERNAL_GBYTES() float32` + +GetDATA_TRANSFER_INTERNAL_GBYTES returns the DATA_TRANSFER_INTERNAL_GBYTES field if non-nil, zero value otherwise. + +### GetDATA_TRANSFER_INTERNAL_GBYTESOk + +`func (o *RunUsage) GetDATA_TRANSFER_INTERNAL_GBYTESOk() (*float32, bool)` + +GetDATA_TRANSFER_INTERNAL_GBYTESOk returns a tuple with the DATA_TRANSFER_INTERNAL_GBYTES field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDATA_TRANSFER_INTERNAL_GBYTES + +`func (o *RunUsage) SetDATA_TRANSFER_INTERNAL_GBYTES(v float32)` + +SetDATA_TRANSFER_INTERNAL_GBYTES sets DATA_TRANSFER_INTERNAL_GBYTES field to given value. + +### HasDATA_TRANSFER_INTERNAL_GBYTES + +`func (o *RunUsage) HasDATA_TRANSFER_INTERNAL_GBYTES() bool` + +HasDATA_TRANSFER_INTERNAL_GBYTES returns a boolean if a field has been set. + +### SetDATA_TRANSFER_INTERNAL_GBYTESNil + +`func (o *RunUsage) SetDATA_TRANSFER_INTERNAL_GBYTESNil(b bool)` + + SetDATA_TRANSFER_INTERNAL_GBYTESNil sets the value for DATA_TRANSFER_INTERNAL_GBYTES to be an explicit nil + +### UnsetDATA_TRANSFER_INTERNAL_GBYTES +`func (o *RunUsage) UnsetDATA_TRANSFER_INTERNAL_GBYTES()` + +UnsetDATA_TRANSFER_INTERNAL_GBYTES ensures that no value is present for DATA_TRANSFER_INTERNAL_GBYTES, not even an explicit nil +### GetDATA_TRANSFER_EXTERNAL_GBYTES + +`func (o *RunUsage) GetDATA_TRANSFER_EXTERNAL_GBYTES() float32` + +GetDATA_TRANSFER_EXTERNAL_GBYTES returns the DATA_TRANSFER_EXTERNAL_GBYTES field if non-nil, zero value otherwise. + +### GetDATA_TRANSFER_EXTERNAL_GBYTESOk + +`func (o *RunUsage) GetDATA_TRANSFER_EXTERNAL_GBYTESOk() (*float32, bool)` + +GetDATA_TRANSFER_EXTERNAL_GBYTESOk returns a tuple with the DATA_TRANSFER_EXTERNAL_GBYTES field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDATA_TRANSFER_EXTERNAL_GBYTES + +`func (o *RunUsage) SetDATA_TRANSFER_EXTERNAL_GBYTES(v float32)` + +SetDATA_TRANSFER_EXTERNAL_GBYTES sets DATA_TRANSFER_EXTERNAL_GBYTES field to given value. + +### HasDATA_TRANSFER_EXTERNAL_GBYTES + +`func (o *RunUsage) HasDATA_TRANSFER_EXTERNAL_GBYTES() bool` + +HasDATA_TRANSFER_EXTERNAL_GBYTES returns a boolean if a field has been set. + +### SetDATA_TRANSFER_EXTERNAL_GBYTESNil + +`func (o *RunUsage) SetDATA_TRANSFER_EXTERNAL_GBYTESNil(b bool)` + + SetDATA_TRANSFER_EXTERNAL_GBYTESNil sets the value for DATA_TRANSFER_EXTERNAL_GBYTES to be an explicit nil + +### UnsetDATA_TRANSFER_EXTERNAL_GBYTES +`func (o *RunUsage) UnsetDATA_TRANSFER_EXTERNAL_GBYTES()` + +UnsetDATA_TRANSFER_EXTERNAL_GBYTES ensures that no value is present for DATA_TRANSFER_EXTERNAL_GBYTES, not even an explicit nil +### GetPROXY_RESIDENTIAL_TRANSFER_GBYTES + +`func (o *RunUsage) GetPROXY_RESIDENTIAL_TRANSFER_GBYTES() float32` + +GetPROXY_RESIDENTIAL_TRANSFER_GBYTES returns the PROXY_RESIDENTIAL_TRANSFER_GBYTES field if non-nil, zero value otherwise. + +### GetPROXY_RESIDENTIAL_TRANSFER_GBYTESOk + +`func (o *RunUsage) GetPROXY_RESIDENTIAL_TRANSFER_GBYTESOk() (*float32, bool)` + +GetPROXY_RESIDENTIAL_TRANSFER_GBYTESOk returns a tuple with the PROXY_RESIDENTIAL_TRANSFER_GBYTES field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPROXY_RESIDENTIAL_TRANSFER_GBYTES + +`func (o *RunUsage) SetPROXY_RESIDENTIAL_TRANSFER_GBYTES(v float32)` + +SetPROXY_RESIDENTIAL_TRANSFER_GBYTES sets PROXY_RESIDENTIAL_TRANSFER_GBYTES field to given value. + +### HasPROXY_RESIDENTIAL_TRANSFER_GBYTES + +`func (o *RunUsage) HasPROXY_RESIDENTIAL_TRANSFER_GBYTES() bool` + +HasPROXY_RESIDENTIAL_TRANSFER_GBYTES returns a boolean if a field has been set. + +### SetPROXY_RESIDENTIAL_TRANSFER_GBYTESNil + +`func (o *RunUsage) SetPROXY_RESIDENTIAL_TRANSFER_GBYTESNil(b bool)` + + SetPROXY_RESIDENTIAL_TRANSFER_GBYTESNil sets the value for PROXY_RESIDENTIAL_TRANSFER_GBYTES to be an explicit nil + +### UnsetPROXY_RESIDENTIAL_TRANSFER_GBYTES +`func (o *RunUsage) UnsetPROXY_RESIDENTIAL_TRANSFER_GBYTES()` + +UnsetPROXY_RESIDENTIAL_TRANSFER_GBYTES ensures that no value is present for PROXY_RESIDENTIAL_TRANSFER_GBYTES, not even an explicit nil +### GetPROXY_SERPS + +`func (o *RunUsage) GetPROXY_SERPS() int32` + +GetPROXY_SERPS returns the PROXY_SERPS field if non-nil, zero value otherwise. + +### GetPROXY_SERPSOk + +`func (o *RunUsage) GetPROXY_SERPSOk() (*int32, bool)` + +GetPROXY_SERPSOk returns a tuple with the PROXY_SERPS field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPROXY_SERPS + +`func (o *RunUsage) SetPROXY_SERPS(v int32)` + +SetPROXY_SERPS sets PROXY_SERPS field to given value. + +### HasPROXY_SERPS + +`func (o *RunUsage) HasPROXY_SERPS() bool` + +HasPROXY_SERPS returns a boolean if a field has been set. + +### SetPROXY_SERPSNil + +`func (o *RunUsage) SetPROXY_SERPSNil(b bool)` + + SetPROXY_SERPSNil sets the value for PROXY_SERPS to be an explicit nil + +### UnsetPROXY_SERPS +`func (o *RunUsage) UnsetPROXY_SERPS()` + +UnsetPROXY_SERPS ensures that no value is present for PROXY_SERPS, not even an explicit nil + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/RunUsageUsd.md b/docs/RunUsageUsd.md new file mode 100644 index 0000000..2ed7378 --- /dev/null +++ b/docs/RunUsageUsd.md @@ -0,0 +1,462 @@ +# RunUsageUsd + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ACTOR_COMPUTE_UNITS** | Pointer to **NullableFloat32** | | [optional] +**DATASET_READS** | Pointer to **NullableFloat32** | | [optional] +**DATASET_WRITES** | Pointer to **NullableFloat32** | | [optional] +**KEY_VALUE_STORE_READS** | Pointer to **NullableFloat32** | | [optional] +**KEY_VALUE_STORE_WRITES** | Pointer to **NullableFloat32** | | [optional] +**KEY_VALUE_STORE_LISTS** | Pointer to **NullableFloat32** | | [optional] +**REQUEST_QUEUE_READS** | Pointer to **NullableFloat32** | | [optional] +**REQUEST_QUEUE_WRITES** | Pointer to **NullableFloat32** | | [optional] +**DATA_TRANSFER_INTERNAL_GBYTES** | Pointer to **NullableFloat32** | | [optional] +**DATA_TRANSFER_EXTERNAL_GBYTES** | Pointer to **NullableFloat32** | | [optional] +**PROXY_RESIDENTIAL_TRANSFER_GBYTES** | Pointer to **NullableFloat32** | | [optional] +**PROXY_SERPS** | Pointer to **NullableFloat32** | | [optional] + +## Methods + +### NewRunUsageUsd + +`func NewRunUsageUsd() *RunUsageUsd` + +NewRunUsageUsd instantiates a new RunUsageUsd object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewRunUsageUsdWithDefaults + +`func NewRunUsageUsdWithDefaults() *RunUsageUsd` + +NewRunUsageUsdWithDefaults instantiates a new RunUsageUsd object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetACTOR_COMPUTE_UNITS + +`func (o *RunUsageUsd) GetACTOR_COMPUTE_UNITS() float32` + +GetACTOR_COMPUTE_UNITS returns the ACTOR_COMPUTE_UNITS field if non-nil, zero value otherwise. + +### GetACTOR_COMPUTE_UNITSOk + +`func (o *RunUsageUsd) GetACTOR_COMPUTE_UNITSOk() (*float32, bool)` + +GetACTOR_COMPUTE_UNITSOk returns a tuple with the ACTOR_COMPUTE_UNITS field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetACTOR_COMPUTE_UNITS + +`func (o *RunUsageUsd) SetACTOR_COMPUTE_UNITS(v float32)` + +SetACTOR_COMPUTE_UNITS sets ACTOR_COMPUTE_UNITS field to given value. + +### HasACTOR_COMPUTE_UNITS + +`func (o *RunUsageUsd) HasACTOR_COMPUTE_UNITS() bool` + +HasACTOR_COMPUTE_UNITS returns a boolean if a field has been set. + +### SetACTOR_COMPUTE_UNITSNil + +`func (o *RunUsageUsd) SetACTOR_COMPUTE_UNITSNil(b bool)` + + SetACTOR_COMPUTE_UNITSNil sets the value for ACTOR_COMPUTE_UNITS to be an explicit nil + +### UnsetACTOR_COMPUTE_UNITS +`func (o *RunUsageUsd) UnsetACTOR_COMPUTE_UNITS()` + +UnsetACTOR_COMPUTE_UNITS ensures that no value is present for ACTOR_COMPUTE_UNITS, not even an explicit nil +### GetDATASET_READS + +`func (o *RunUsageUsd) GetDATASET_READS() float32` + +GetDATASET_READS returns the DATASET_READS field if non-nil, zero value otherwise. + +### GetDATASET_READSOk + +`func (o *RunUsageUsd) GetDATASET_READSOk() (*float32, bool)` + +GetDATASET_READSOk returns a tuple with the DATASET_READS field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDATASET_READS + +`func (o *RunUsageUsd) SetDATASET_READS(v float32)` + +SetDATASET_READS sets DATASET_READS field to given value. + +### HasDATASET_READS + +`func (o *RunUsageUsd) HasDATASET_READS() bool` + +HasDATASET_READS returns a boolean if a field has been set. + +### SetDATASET_READSNil + +`func (o *RunUsageUsd) SetDATASET_READSNil(b bool)` + + SetDATASET_READSNil sets the value for DATASET_READS to be an explicit nil + +### UnsetDATASET_READS +`func (o *RunUsageUsd) UnsetDATASET_READS()` + +UnsetDATASET_READS ensures that no value is present for DATASET_READS, not even an explicit nil +### GetDATASET_WRITES + +`func (o *RunUsageUsd) GetDATASET_WRITES() float32` + +GetDATASET_WRITES returns the DATASET_WRITES field if non-nil, zero value otherwise. + +### GetDATASET_WRITESOk + +`func (o *RunUsageUsd) GetDATASET_WRITESOk() (*float32, bool)` + +GetDATASET_WRITESOk returns a tuple with the DATASET_WRITES field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDATASET_WRITES + +`func (o *RunUsageUsd) SetDATASET_WRITES(v float32)` + +SetDATASET_WRITES sets DATASET_WRITES field to given value. + +### HasDATASET_WRITES + +`func (o *RunUsageUsd) HasDATASET_WRITES() bool` + +HasDATASET_WRITES returns a boolean if a field has been set. + +### SetDATASET_WRITESNil + +`func (o *RunUsageUsd) SetDATASET_WRITESNil(b bool)` + + SetDATASET_WRITESNil sets the value for DATASET_WRITES to be an explicit nil + +### UnsetDATASET_WRITES +`func (o *RunUsageUsd) UnsetDATASET_WRITES()` + +UnsetDATASET_WRITES ensures that no value is present for DATASET_WRITES, not even an explicit nil +### GetKEY_VALUE_STORE_READS + +`func (o *RunUsageUsd) GetKEY_VALUE_STORE_READS() float32` + +GetKEY_VALUE_STORE_READS returns the KEY_VALUE_STORE_READS field if non-nil, zero value otherwise. + +### GetKEY_VALUE_STORE_READSOk + +`func (o *RunUsageUsd) GetKEY_VALUE_STORE_READSOk() (*float32, bool)` + +GetKEY_VALUE_STORE_READSOk returns a tuple with the KEY_VALUE_STORE_READS field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetKEY_VALUE_STORE_READS + +`func (o *RunUsageUsd) SetKEY_VALUE_STORE_READS(v float32)` + +SetKEY_VALUE_STORE_READS sets KEY_VALUE_STORE_READS field to given value. + +### HasKEY_VALUE_STORE_READS + +`func (o *RunUsageUsd) HasKEY_VALUE_STORE_READS() bool` + +HasKEY_VALUE_STORE_READS returns a boolean if a field has been set. + +### SetKEY_VALUE_STORE_READSNil + +`func (o *RunUsageUsd) SetKEY_VALUE_STORE_READSNil(b bool)` + + SetKEY_VALUE_STORE_READSNil sets the value for KEY_VALUE_STORE_READS to be an explicit nil + +### UnsetKEY_VALUE_STORE_READS +`func (o *RunUsageUsd) UnsetKEY_VALUE_STORE_READS()` + +UnsetKEY_VALUE_STORE_READS ensures that no value is present for KEY_VALUE_STORE_READS, not even an explicit nil +### GetKEY_VALUE_STORE_WRITES + +`func (o *RunUsageUsd) GetKEY_VALUE_STORE_WRITES() float32` + +GetKEY_VALUE_STORE_WRITES returns the KEY_VALUE_STORE_WRITES field if non-nil, zero value otherwise. + +### GetKEY_VALUE_STORE_WRITESOk + +`func (o *RunUsageUsd) GetKEY_VALUE_STORE_WRITESOk() (*float32, bool)` + +GetKEY_VALUE_STORE_WRITESOk returns a tuple with the KEY_VALUE_STORE_WRITES field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetKEY_VALUE_STORE_WRITES + +`func (o *RunUsageUsd) SetKEY_VALUE_STORE_WRITES(v float32)` + +SetKEY_VALUE_STORE_WRITES sets KEY_VALUE_STORE_WRITES field to given value. + +### HasKEY_VALUE_STORE_WRITES + +`func (o *RunUsageUsd) HasKEY_VALUE_STORE_WRITES() bool` + +HasKEY_VALUE_STORE_WRITES returns a boolean if a field has been set. + +### SetKEY_VALUE_STORE_WRITESNil + +`func (o *RunUsageUsd) SetKEY_VALUE_STORE_WRITESNil(b bool)` + + SetKEY_VALUE_STORE_WRITESNil sets the value for KEY_VALUE_STORE_WRITES to be an explicit nil + +### UnsetKEY_VALUE_STORE_WRITES +`func (o *RunUsageUsd) UnsetKEY_VALUE_STORE_WRITES()` + +UnsetKEY_VALUE_STORE_WRITES ensures that no value is present for KEY_VALUE_STORE_WRITES, not even an explicit nil +### GetKEY_VALUE_STORE_LISTS + +`func (o *RunUsageUsd) GetKEY_VALUE_STORE_LISTS() float32` + +GetKEY_VALUE_STORE_LISTS returns the KEY_VALUE_STORE_LISTS field if non-nil, zero value otherwise. + +### GetKEY_VALUE_STORE_LISTSOk + +`func (o *RunUsageUsd) GetKEY_VALUE_STORE_LISTSOk() (*float32, bool)` + +GetKEY_VALUE_STORE_LISTSOk returns a tuple with the KEY_VALUE_STORE_LISTS field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetKEY_VALUE_STORE_LISTS + +`func (o *RunUsageUsd) SetKEY_VALUE_STORE_LISTS(v float32)` + +SetKEY_VALUE_STORE_LISTS sets KEY_VALUE_STORE_LISTS field to given value. + +### HasKEY_VALUE_STORE_LISTS + +`func (o *RunUsageUsd) HasKEY_VALUE_STORE_LISTS() bool` + +HasKEY_VALUE_STORE_LISTS returns a boolean if a field has been set. + +### SetKEY_VALUE_STORE_LISTSNil + +`func (o *RunUsageUsd) SetKEY_VALUE_STORE_LISTSNil(b bool)` + + SetKEY_VALUE_STORE_LISTSNil sets the value for KEY_VALUE_STORE_LISTS to be an explicit nil + +### UnsetKEY_VALUE_STORE_LISTS +`func (o *RunUsageUsd) UnsetKEY_VALUE_STORE_LISTS()` + +UnsetKEY_VALUE_STORE_LISTS ensures that no value is present for KEY_VALUE_STORE_LISTS, not even an explicit nil +### GetREQUEST_QUEUE_READS + +`func (o *RunUsageUsd) GetREQUEST_QUEUE_READS() float32` + +GetREQUEST_QUEUE_READS returns the REQUEST_QUEUE_READS field if non-nil, zero value otherwise. + +### GetREQUEST_QUEUE_READSOk + +`func (o *RunUsageUsd) GetREQUEST_QUEUE_READSOk() (*float32, bool)` + +GetREQUEST_QUEUE_READSOk returns a tuple with the REQUEST_QUEUE_READS field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetREQUEST_QUEUE_READS + +`func (o *RunUsageUsd) SetREQUEST_QUEUE_READS(v float32)` + +SetREQUEST_QUEUE_READS sets REQUEST_QUEUE_READS field to given value. + +### HasREQUEST_QUEUE_READS + +`func (o *RunUsageUsd) HasREQUEST_QUEUE_READS() bool` + +HasREQUEST_QUEUE_READS returns a boolean if a field has been set. + +### SetREQUEST_QUEUE_READSNil + +`func (o *RunUsageUsd) SetREQUEST_QUEUE_READSNil(b bool)` + + SetREQUEST_QUEUE_READSNil sets the value for REQUEST_QUEUE_READS to be an explicit nil + +### UnsetREQUEST_QUEUE_READS +`func (o *RunUsageUsd) UnsetREQUEST_QUEUE_READS()` + +UnsetREQUEST_QUEUE_READS ensures that no value is present for REQUEST_QUEUE_READS, not even an explicit nil +### GetREQUEST_QUEUE_WRITES + +`func (o *RunUsageUsd) GetREQUEST_QUEUE_WRITES() float32` + +GetREQUEST_QUEUE_WRITES returns the REQUEST_QUEUE_WRITES field if non-nil, zero value otherwise. + +### GetREQUEST_QUEUE_WRITESOk + +`func (o *RunUsageUsd) GetREQUEST_QUEUE_WRITESOk() (*float32, bool)` + +GetREQUEST_QUEUE_WRITESOk returns a tuple with the REQUEST_QUEUE_WRITES field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetREQUEST_QUEUE_WRITES + +`func (o *RunUsageUsd) SetREQUEST_QUEUE_WRITES(v float32)` + +SetREQUEST_QUEUE_WRITES sets REQUEST_QUEUE_WRITES field to given value. + +### HasREQUEST_QUEUE_WRITES + +`func (o *RunUsageUsd) HasREQUEST_QUEUE_WRITES() bool` + +HasREQUEST_QUEUE_WRITES returns a boolean if a field has been set. + +### SetREQUEST_QUEUE_WRITESNil + +`func (o *RunUsageUsd) SetREQUEST_QUEUE_WRITESNil(b bool)` + + SetREQUEST_QUEUE_WRITESNil sets the value for REQUEST_QUEUE_WRITES to be an explicit nil + +### UnsetREQUEST_QUEUE_WRITES +`func (o *RunUsageUsd) UnsetREQUEST_QUEUE_WRITES()` + +UnsetREQUEST_QUEUE_WRITES ensures that no value is present for REQUEST_QUEUE_WRITES, not even an explicit nil +### GetDATA_TRANSFER_INTERNAL_GBYTES + +`func (o *RunUsageUsd) GetDATA_TRANSFER_INTERNAL_GBYTES() float32` + +GetDATA_TRANSFER_INTERNAL_GBYTES returns the DATA_TRANSFER_INTERNAL_GBYTES field if non-nil, zero value otherwise. + +### GetDATA_TRANSFER_INTERNAL_GBYTESOk + +`func (o *RunUsageUsd) GetDATA_TRANSFER_INTERNAL_GBYTESOk() (*float32, bool)` + +GetDATA_TRANSFER_INTERNAL_GBYTESOk returns a tuple with the DATA_TRANSFER_INTERNAL_GBYTES field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDATA_TRANSFER_INTERNAL_GBYTES + +`func (o *RunUsageUsd) SetDATA_TRANSFER_INTERNAL_GBYTES(v float32)` + +SetDATA_TRANSFER_INTERNAL_GBYTES sets DATA_TRANSFER_INTERNAL_GBYTES field to given value. + +### HasDATA_TRANSFER_INTERNAL_GBYTES + +`func (o *RunUsageUsd) HasDATA_TRANSFER_INTERNAL_GBYTES() bool` + +HasDATA_TRANSFER_INTERNAL_GBYTES returns a boolean if a field has been set. + +### SetDATA_TRANSFER_INTERNAL_GBYTESNil + +`func (o *RunUsageUsd) SetDATA_TRANSFER_INTERNAL_GBYTESNil(b bool)` + + SetDATA_TRANSFER_INTERNAL_GBYTESNil sets the value for DATA_TRANSFER_INTERNAL_GBYTES to be an explicit nil + +### UnsetDATA_TRANSFER_INTERNAL_GBYTES +`func (o *RunUsageUsd) UnsetDATA_TRANSFER_INTERNAL_GBYTES()` + +UnsetDATA_TRANSFER_INTERNAL_GBYTES ensures that no value is present for DATA_TRANSFER_INTERNAL_GBYTES, not even an explicit nil +### GetDATA_TRANSFER_EXTERNAL_GBYTES + +`func (o *RunUsageUsd) GetDATA_TRANSFER_EXTERNAL_GBYTES() float32` + +GetDATA_TRANSFER_EXTERNAL_GBYTES returns the DATA_TRANSFER_EXTERNAL_GBYTES field if non-nil, zero value otherwise. + +### GetDATA_TRANSFER_EXTERNAL_GBYTESOk + +`func (o *RunUsageUsd) GetDATA_TRANSFER_EXTERNAL_GBYTESOk() (*float32, bool)` + +GetDATA_TRANSFER_EXTERNAL_GBYTESOk returns a tuple with the DATA_TRANSFER_EXTERNAL_GBYTES field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDATA_TRANSFER_EXTERNAL_GBYTES + +`func (o *RunUsageUsd) SetDATA_TRANSFER_EXTERNAL_GBYTES(v float32)` + +SetDATA_TRANSFER_EXTERNAL_GBYTES sets DATA_TRANSFER_EXTERNAL_GBYTES field to given value. + +### HasDATA_TRANSFER_EXTERNAL_GBYTES + +`func (o *RunUsageUsd) HasDATA_TRANSFER_EXTERNAL_GBYTES() bool` + +HasDATA_TRANSFER_EXTERNAL_GBYTES returns a boolean if a field has been set. + +### SetDATA_TRANSFER_EXTERNAL_GBYTESNil + +`func (o *RunUsageUsd) SetDATA_TRANSFER_EXTERNAL_GBYTESNil(b bool)` + + SetDATA_TRANSFER_EXTERNAL_GBYTESNil sets the value for DATA_TRANSFER_EXTERNAL_GBYTES to be an explicit nil + +### UnsetDATA_TRANSFER_EXTERNAL_GBYTES +`func (o *RunUsageUsd) UnsetDATA_TRANSFER_EXTERNAL_GBYTES()` + +UnsetDATA_TRANSFER_EXTERNAL_GBYTES ensures that no value is present for DATA_TRANSFER_EXTERNAL_GBYTES, not even an explicit nil +### GetPROXY_RESIDENTIAL_TRANSFER_GBYTES + +`func (o *RunUsageUsd) GetPROXY_RESIDENTIAL_TRANSFER_GBYTES() float32` + +GetPROXY_RESIDENTIAL_TRANSFER_GBYTES returns the PROXY_RESIDENTIAL_TRANSFER_GBYTES field if non-nil, zero value otherwise. + +### GetPROXY_RESIDENTIAL_TRANSFER_GBYTESOk + +`func (o *RunUsageUsd) GetPROXY_RESIDENTIAL_TRANSFER_GBYTESOk() (*float32, bool)` + +GetPROXY_RESIDENTIAL_TRANSFER_GBYTESOk returns a tuple with the PROXY_RESIDENTIAL_TRANSFER_GBYTES field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPROXY_RESIDENTIAL_TRANSFER_GBYTES + +`func (o *RunUsageUsd) SetPROXY_RESIDENTIAL_TRANSFER_GBYTES(v float32)` + +SetPROXY_RESIDENTIAL_TRANSFER_GBYTES sets PROXY_RESIDENTIAL_TRANSFER_GBYTES field to given value. + +### HasPROXY_RESIDENTIAL_TRANSFER_GBYTES + +`func (o *RunUsageUsd) HasPROXY_RESIDENTIAL_TRANSFER_GBYTES() bool` + +HasPROXY_RESIDENTIAL_TRANSFER_GBYTES returns a boolean if a field has been set. + +### SetPROXY_RESIDENTIAL_TRANSFER_GBYTESNil + +`func (o *RunUsageUsd) SetPROXY_RESIDENTIAL_TRANSFER_GBYTESNil(b bool)` + + SetPROXY_RESIDENTIAL_TRANSFER_GBYTESNil sets the value for PROXY_RESIDENTIAL_TRANSFER_GBYTES to be an explicit nil + +### UnsetPROXY_RESIDENTIAL_TRANSFER_GBYTES +`func (o *RunUsageUsd) UnsetPROXY_RESIDENTIAL_TRANSFER_GBYTES()` + +UnsetPROXY_RESIDENTIAL_TRANSFER_GBYTES ensures that no value is present for PROXY_RESIDENTIAL_TRANSFER_GBYTES, not even an explicit nil +### GetPROXY_SERPS + +`func (o *RunUsageUsd) GetPROXY_SERPS() float32` + +GetPROXY_SERPS returns the PROXY_SERPS field if non-nil, zero value otherwise. + +### GetPROXY_SERPSOk + +`func (o *RunUsageUsd) GetPROXY_SERPSOk() (*float32, bool)` + +GetPROXY_SERPSOk returns a tuple with the PROXY_SERPS field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPROXY_SERPS + +`func (o *RunUsageUsd) SetPROXY_SERPS(v float32)` + +SetPROXY_SERPS sets PROXY_SERPS field to given value. + +### HasPROXY_SERPS + +`func (o *RunUsageUsd) HasPROXY_SERPS() bool` + +HasPROXY_SERPS returns a boolean if a field has been set. + +### SetPROXY_SERPSNil + +`func (o *RunUsageUsd) SetPROXY_SERPSNil(b bool)` + + SetPROXY_SERPSNil sets the value for PROXY_SERPS to be an explicit nil + +### UnsetPROXY_SERPS +`func (o *RunUsageUsd) UnsetPROXY_SERPS()` + +UnsetPROXY_SERPS ensures that no value is present for PROXY_SERPS, not even an explicit nil + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/Schedule.md b/docs/Schedule.md new file mode 100644 index 0000000..918ab5c --- /dev/null +++ b/docs/Schedule.md @@ -0,0 +1,390 @@ +# Schedule + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **string** | | +**UserId** | **string** | | +**Name** | **string** | | +**CronExpression** | **string** | | +**Timezone** | **string** | | +**IsEnabled** | **bool** | | +**IsExclusive** | **bool** | | +**CreatedAt** | **time.Time** | | +**ModifiedAt** | **time.Time** | | +**NextRunAt** | Pointer to **time.Time** | | [optional] +**LastRunAt** | Pointer to **time.Time** | | [optional] +**Description** | Pointer to **NullableString** | | [optional] +**Title** | Pointer to **NullableString** | | [optional] +**Notifications** | Pointer to [**ScheduleNotifications**](ScheduleNotifications.md) | | [optional] +**Actions** | [**[]ScheduleAction**](ScheduleAction.md) | | + +## Methods + +### NewSchedule + +`func NewSchedule(id string, userId string, name string, cronExpression string, timezone string, isEnabled bool, isExclusive bool, createdAt time.Time, modifiedAt time.Time, actions []ScheduleAction, ) *Schedule` + +NewSchedule instantiates a new Schedule object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewScheduleWithDefaults + +`func NewScheduleWithDefaults() *Schedule` + +NewScheduleWithDefaults instantiates a new Schedule object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetId + +`func (o *Schedule) GetId() string` + +GetId returns the Id field if non-nil, zero value otherwise. + +### GetIdOk + +`func (o *Schedule) GetIdOk() (*string, bool)` + +GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetId + +`func (o *Schedule) SetId(v string)` + +SetId sets Id field to given value. + + +### GetUserId + +`func (o *Schedule) GetUserId() string` + +GetUserId returns the UserId field if non-nil, zero value otherwise. + +### GetUserIdOk + +`func (o *Schedule) GetUserIdOk() (*string, bool)` + +GetUserIdOk returns a tuple with the UserId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUserId + +`func (o *Schedule) SetUserId(v string)` + +SetUserId sets UserId field to given value. + + +### GetName + +`func (o *Schedule) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *Schedule) GetNameOk() (*string, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetName + +`func (o *Schedule) SetName(v string)` + +SetName sets Name field to given value. + + +### GetCronExpression + +`func (o *Schedule) GetCronExpression() string` + +GetCronExpression returns the CronExpression field if non-nil, zero value otherwise. + +### GetCronExpressionOk + +`func (o *Schedule) GetCronExpressionOk() (*string, bool)` + +GetCronExpressionOk returns a tuple with the CronExpression field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCronExpression + +`func (o *Schedule) SetCronExpression(v string)` + +SetCronExpression sets CronExpression field to given value. + + +### GetTimezone + +`func (o *Schedule) GetTimezone() string` + +GetTimezone returns the Timezone field if non-nil, zero value otherwise. + +### GetTimezoneOk + +`func (o *Schedule) GetTimezoneOk() (*string, bool)` + +GetTimezoneOk returns a tuple with the Timezone field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTimezone + +`func (o *Schedule) SetTimezone(v string)` + +SetTimezone sets Timezone field to given value. + + +### GetIsEnabled + +`func (o *Schedule) GetIsEnabled() bool` + +GetIsEnabled returns the IsEnabled field if non-nil, zero value otherwise. + +### GetIsEnabledOk + +`func (o *Schedule) GetIsEnabledOk() (*bool, bool)` + +GetIsEnabledOk returns a tuple with the IsEnabled field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetIsEnabled + +`func (o *Schedule) SetIsEnabled(v bool)` + +SetIsEnabled sets IsEnabled field to given value. + + +### GetIsExclusive + +`func (o *Schedule) GetIsExclusive() bool` + +GetIsExclusive returns the IsExclusive field if non-nil, zero value otherwise. + +### GetIsExclusiveOk + +`func (o *Schedule) GetIsExclusiveOk() (*bool, bool)` + +GetIsExclusiveOk returns a tuple with the IsExclusive field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetIsExclusive + +`func (o *Schedule) SetIsExclusive(v bool)` + +SetIsExclusive sets IsExclusive field to given value. + + +### GetCreatedAt + +`func (o *Schedule) GetCreatedAt() time.Time` + +GetCreatedAt returns the CreatedAt field if non-nil, zero value otherwise. + +### GetCreatedAtOk + +`func (o *Schedule) GetCreatedAtOk() (*time.Time, bool)` + +GetCreatedAtOk returns a tuple with the CreatedAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCreatedAt + +`func (o *Schedule) SetCreatedAt(v time.Time)` + +SetCreatedAt sets CreatedAt field to given value. + + +### GetModifiedAt + +`func (o *Schedule) GetModifiedAt() time.Time` + +GetModifiedAt returns the ModifiedAt field if non-nil, zero value otherwise. + +### GetModifiedAtOk + +`func (o *Schedule) GetModifiedAtOk() (*time.Time, bool)` + +GetModifiedAtOk returns a tuple with the ModifiedAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetModifiedAt + +`func (o *Schedule) SetModifiedAt(v time.Time)` + +SetModifiedAt sets ModifiedAt field to given value. + + +### GetNextRunAt + +`func (o *Schedule) GetNextRunAt() time.Time` + +GetNextRunAt returns the NextRunAt field if non-nil, zero value otherwise. + +### GetNextRunAtOk + +`func (o *Schedule) GetNextRunAtOk() (*time.Time, bool)` + +GetNextRunAtOk returns a tuple with the NextRunAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetNextRunAt + +`func (o *Schedule) SetNextRunAt(v time.Time)` + +SetNextRunAt sets NextRunAt field to given value. + +### HasNextRunAt + +`func (o *Schedule) HasNextRunAt() bool` + +HasNextRunAt returns a boolean if a field has been set. + +### GetLastRunAt + +`func (o *Schedule) GetLastRunAt() time.Time` + +GetLastRunAt returns the LastRunAt field if non-nil, zero value otherwise. + +### GetLastRunAtOk + +`func (o *Schedule) GetLastRunAtOk() (*time.Time, bool)` + +GetLastRunAtOk returns a tuple with the LastRunAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetLastRunAt + +`func (o *Schedule) SetLastRunAt(v time.Time)` + +SetLastRunAt sets LastRunAt field to given value. + +### HasLastRunAt + +`func (o *Schedule) HasLastRunAt() bool` + +HasLastRunAt returns a boolean if a field has been set. + +### GetDescription + +`func (o *Schedule) GetDescription() string` + +GetDescription returns the Description field if non-nil, zero value otherwise. + +### GetDescriptionOk + +`func (o *Schedule) GetDescriptionOk() (*string, bool)` + +GetDescriptionOk returns a tuple with the Description field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDescription + +`func (o *Schedule) SetDescription(v string)` + +SetDescription sets Description field to given value. + +### HasDescription + +`func (o *Schedule) HasDescription() bool` + +HasDescription returns a boolean if a field has been set. + +### SetDescriptionNil + +`func (o *Schedule) SetDescriptionNil(b bool)` + + SetDescriptionNil sets the value for Description to be an explicit nil + +### UnsetDescription +`func (o *Schedule) UnsetDescription()` + +UnsetDescription ensures that no value is present for Description, not even an explicit nil +### GetTitle + +`func (o *Schedule) GetTitle() string` + +GetTitle returns the Title field if non-nil, zero value otherwise. + +### GetTitleOk + +`func (o *Schedule) GetTitleOk() (*string, bool)` + +GetTitleOk returns a tuple with the Title field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTitle + +`func (o *Schedule) SetTitle(v string)` + +SetTitle sets Title field to given value. + +### HasTitle + +`func (o *Schedule) HasTitle() bool` + +HasTitle returns a boolean if a field has been set. + +### SetTitleNil + +`func (o *Schedule) SetTitleNil(b bool)` + + SetTitleNil sets the value for Title to be an explicit nil + +### UnsetTitle +`func (o *Schedule) UnsetTitle()` + +UnsetTitle ensures that no value is present for Title, not even an explicit nil +### GetNotifications + +`func (o *Schedule) GetNotifications() ScheduleNotifications` + +GetNotifications returns the Notifications field if non-nil, zero value otherwise. + +### GetNotificationsOk + +`func (o *Schedule) GetNotificationsOk() (*ScheduleNotifications, bool)` + +GetNotificationsOk returns a tuple with the Notifications field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetNotifications + +`func (o *Schedule) SetNotifications(v ScheduleNotifications)` + +SetNotifications sets Notifications field to given value. + +### HasNotifications + +`func (o *Schedule) HasNotifications() bool` + +HasNotifications returns a boolean if a field has been set. + +### GetActions + +`func (o *Schedule) GetActions() []ScheduleAction` + +GetActions returns the Actions field if non-nil, zero value otherwise. + +### GetActionsOk + +`func (o *Schedule) GetActionsOk() (*[]ScheduleAction, bool)` + +GetActionsOk returns a tuple with the Actions field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetActions + +`func (o *Schedule) SetActions(v []ScheduleAction)` + +SetActions sets Actions field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ScheduleAction.md b/docs/ScheduleAction.md new file mode 100644 index 0000000..b13c3ed --- /dev/null +++ b/docs/ScheduleAction.md @@ -0,0 +1,202 @@ +# ScheduleAction + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **string** | | +**Type** | **interface{}** | | +**ActorId** | **string** | | +**RunInput** | Pointer to [**ScheduleActionRunInput**](ScheduleActionRunInput.md) | | [optional] +**RunOptions** | Pointer to [**TaskOptions**](TaskOptions.md) | | [optional] +**ActorTaskId** | **string** | | +**Input** | Pointer to **map[string]interface{}** | | [optional] + +## Methods + +### NewScheduleAction + +`func NewScheduleAction(id string, type_ interface{}, actorId string, actorTaskId string, ) *ScheduleAction` + +NewScheduleAction instantiates a new ScheduleAction object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewScheduleActionWithDefaults + +`func NewScheduleActionWithDefaults() *ScheduleAction` + +NewScheduleActionWithDefaults instantiates a new ScheduleAction object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetId + +`func (o *ScheduleAction) GetId() string` + +GetId returns the Id field if non-nil, zero value otherwise. + +### GetIdOk + +`func (o *ScheduleAction) GetIdOk() (*string, bool)` + +GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetId + +`func (o *ScheduleAction) SetId(v string)` + +SetId sets Id field to given value. + + +### GetType + +`func (o *ScheduleAction) GetType() interface{}` + +GetType returns the Type field if non-nil, zero value otherwise. + +### GetTypeOk + +`func (o *ScheduleAction) GetTypeOk() (*interface{}, bool)` + +GetTypeOk returns a tuple with the Type field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetType + +`func (o *ScheduleAction) SetType(v interface{})` + +SetType sets Type field to given value. + + +### SetTypeNil + +`func (o *ScheduleAction) SetTypeNil(b bool)` + + SetTypeNil sets the value for Type to be an explicit nil + +### UnsetType +`func (o *ScheduleAction) UnsetType()` + +UnsetType ensures that no value is present for Type, not even an explicit nil +### GetActorId + +`func (o *ScheduleAction) GetActorId() string` + +GetActorId returns the ActorId field if non-nil, zero value otherwise. + +### GetActorIdOk + +`func (o *ScheduleAction) GetActorIdOk() (*string, bool)` + +GetActorIdOk returns a tuple with the ActorId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetActorId + +`func (o *ScheduleAction) SetActorId(v string)` + +SetActorId sets ActorId field to given value. + + +### GetRunInput + +`func (o *ScheduleAction) GetRunInput() ScheduleActionRunInput` + +GetRunInput returns the RunInput field if non-nil, zero value otherwise. + +### GetRunInputOk + +`func (o *ScheduleAction) GetRunInputOk() (*ScheduleActionRunInput, bool)` + +GetRunInputOk returns a tuple with the RunInput field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRunInput + +`func (o *ScheduleAction) SetRunInput(v ScheduleActionRunInput)` + +SetRunInput sets RunInput field to given value. + +### HasRunInput + +`func (o *ScheduleAction) HasRunInput() bool` + +HasRunInput returns a boolean if a field has been set. + +### GetRunOptions + +`func (o *ScheduleAction) GetRunOptions() TaskOptions` + +GetRunOptions returns the RunOptions field if non-nil, zero value otherwise. + +### GetRunOptionsOk + +`func (o *ScheduleAction) GetRunOptionsOk() (*TaskOptions, bool)` + +GetRunOptionsOk returns a tuple with the RunOptions field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRunOptions + +`func (o *ScheduleAction) SetRunOptions(v TaskOptions)` + +SetRunOptions sets RunOptions field to given value. + +### HasRunOptions + +`func (o *ScheduleAction) HasRunOptions() bool` + +HasRunOptions returns a boolean if a field has been set. + +### GetActorTaskId + +`func (o *ScheduleAction) GetActorTaskId() string` + +GetActorTaskId returns the ActorTaskId field if non-nil, zero value otherwise. + +### GetActorTaskIdOk + +`func (o *ScheduleAction) GetActorTaskIdOk() (*string, bool)` + +GetActorTaskIdOk returns a tuple with the ActorTaskId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetActorTaskId + +`func (o *ScheduleAction) SetActorTaskId(v string)` + +SetActorTaskId sets ActorTaskId field to given value. + + +### GetInput + +`func (o *ScheduleAction) GetInput() map[string]interface{}` + +GetInput returns the Input field if non-nil, zero value otherwise. + +### GetInputOk + +`func (o *ScheduleAction) GetInputOk() (*map[string]interface{}, bool)` + +GetInputOk returns a tuple with the Input field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetInput + +`func (o *ScheduleAction) SetInput(v map[string]interface{})` + +SetInput sets Input field to given value. + +### HasInput + +`func (o *ScheduleAction) HasInput() bool` + +HasInput returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ScheduleActionRunActor.md b/docs/ScheduleActionRunActor.md new file mode 100644 index 0000000..14e9c0c --- /dev/null +++ b/docs/ScheduleActionRunActor.md @@ -0,0 +1,175 @@ +# ScheduleActionRunActor + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **string** | | +**Type** | **interface{}** | | +**ActorId** | **string** | | +**RunInput** | Pointer to [**NullableScheduleActionRunInput**](ScheduleActionRunInput.md) | | [optional] +**RunOptions** | Pointer to [**NullableTaskOptions**](TaskOptions.md) | | [optional] + +## Methods + +### NewScheduleActionRunActor + +`func NewScheduleActionRunActor(id string, type_ interface{}, actorId string, ) *ScheduleActionRunActor` + +NewScheduleActionRunActor instantiates a new ScheduleActionRunActor object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewScheduleActionRunActorWithDefaults + +`func NewScheduleActionRunActorWithDefaults() *ScheduleActionRunActor` + +NewScheduleActionRunActorWithDefaults instantiates a new ScheduleActionRunActor object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetId + +`func (o *ScheduleActionRunActor) GetId() string` + +GetId returns the Id field if non-nil, zero value otherwise. + +### GetIdOk + +`func (o *ScheduleActionRunActor) GetIdOk() (*string, bool)` + +GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetId + +`func (o *ScheduleActionRunActor) SetId(v string)` + +SetId sets Id field to given value. + + +### GetType + +`func (o *ScheduleActionRunActor) GetType() interface{}` + +GetType returns the Type field if non-nil, zero value otherwise. + +### GetTypeOk + +`func (o *ScheduleActionRunActor) GetTypeOk() (*interface{}, bool)` + +GetTypeOk returns a tuple with the Type field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetType + +`func (o *ScheduleActionRunActor) SetType(v interface{})` + +SetType sets Type field to given value. + + +### SetTypeNil + +`func (o *ScheduleActionRunActor) SetTypeNil(b bool)` + + SetTypeNil sets the value for Type to be an explicit nil + +### UnsetType +`func (o *ScheduleActionRunActor) UnsetType()` + +UnsetType ensures that no value is present for Type, not even an explicit nil +### GetActorId + +`func (o *ScheduleActionRunActor) GetActorId() string` + +GetActorId returns the ActorId field if non-nil, zero value otherwise. + +### GetActorIdOk + +`func (o *ScheduleActionRunActor) GetActorIdOk() (*string, bool)` + +GetActorIdOk returns a tuple with the ActorId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetActorId + +`func (o *ScheduleActionRunActor) SetActorId(v string)` + +SetActorId sets ActorId field to given value. + + +### GetRunInput + +`func (o *ScheduleActionRunActor) GetRunInput() ScheduleActionRunInput` + +GetRunInput returns the RunInput field if non-nil, zero value otherwise. + +### GetRunInputOk + +`func (o *ScheduleActionRunActor) GetRunInputOk() (*ScheduleActionRunInput, bool)` + +GetRunInputOk returns a tuple with the RunInput field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRunInput + +`func (o *ScheduleActionRunActor) SetRunInput(v ScheduleActionRunInput)` + +SetRunInput sets RunInput field to given value. + +### HasRunInput + +`func (o *ScheduleActionRunActor) HasRunInput() bool` + +HasRunInput returns a boolean if a field has been set. + +### SetRunInputNil + +`func (o *ScheduleActionRunActor) SetRunInputNil(b bool)` + + SetRunInputNil sets the value for RunInput to be an explicit nil + +### UnsetRunInput +`func (o *ScheduleActionRunActor) UnsetRunInput()` + +UnsetRunInput ensures that no value is present for RunInput, not even an explicit nil +### GetRunOptions + +`func (o *ScheduleActionRunActor) GetRunOptions() TaskOptions` + +GetRunOptions returns the RunOptions field if non-nil, zero value otherwise. + +### GetRunOptionsOk + +`func (o *ScheduleActionRunActor) GetRunOptionsOk() (*TaskOptions, bool)` + +GetRunOptionsOk returns a tuple with the RunOptions field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRunOptions + +`func (o *ScheduleActionRunActor) SetRunOptions(v TaskOptions)` + +SetRunOptions sets RunOptions field to given value. + +### HasRunOptions + +`func (o *ScheduleActionRunActor) HasRunOptions() bool` + +HasRunOptions returns a boolean if a field has been set. + +### SetRunOptionsNil + +`func (o *ScheduleActionRunActor) SetRunOptionsNil(b bool)` + + SetRunOptionsNil sets the value for RunOptions to be an explicit nil + +### UnsetRunOptions +`func (o *ScheduleActionRunActor) UnsetRunOptions()` + +UnsetRunOptions ensures that no value is present for RunOptions, not even an explicit nil + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ScheduleActionRunActorTask.md b/docs/ScheduleActionRunActorTask.md new file mode 100644 index 0000000..962cacb --- /dev/null +++ b/docs/ScheduleActionRunActorTask.md @@ -0,0 +1,139 @@ +# ScheduleActionRunActorTask + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **string** | | +**Type** | **interface{}** | | +**ActorTaskId** | **string** | | +**Input** | Pointer to **map[string]interface{}** | | [optional] + +## Methods + +### NewScheduleActionRunActorTask + +`func NewScheduleActionRunActorTask(id string, type_ interface{}, actorTaskId string, ) *ScheduleActionRunActorTask` + +NewScheduleActionRunActorTask instantiates a new ScheduleActionRunActorTask object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewScheduleActionRunActorTaskWithDefaults + +`func NewScheduleActionRunActorTaskWithDefaults() *ScheduleActionRunActorTask` + +NewScheduleActionRunActorTaskWithDefaults instantiates a new ScheduleActionRunActorTask object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetId + +`func (o *ScheduleActionRunActorTask) GetId() string` + +GetId returns the Id field if non-nil, zero value otherwise. + +### GetIdOk + +`func (o *ScheduleActionRunActorTask) GetIdOk() (*string, bool)` + +GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetId + +`func (o *ScheduleActionRunActorTask) SetId(v string)` + +SetId sets Id field to given value. + + +### GetType + +`func (o *ScheduleActionRunActorTask) GetType() interface{}` + +GetType returns the Type field if non-nil, zero value otherwise. + +### GetTypeOk + +`func (o *ScheduleActionRunActorTask) GetTypeOk() (*interface{}, bool)` + +GetTypeOk returns a tuple with the Type field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetType + +`func (o *ScheduleActionRunActorTask) SetType(v interface{})` + +SetType sets Type field to given value. + + +### SetTypeNil + +`func (o *ScheduleActionRunActorTask) SetTypeNil(b bool)` + + SetTypeNil sets the value for Type to be an explicit nil + +### UnsetType +`func (o *ScheduleActionRunActorTask) UnsetType()` + +UnsetType ensures that no value is present for Type, not even an explicit nil +### GetActorTaskId + +`func (o *ScheduleActionRunActorTask) GetActorTaskId() string` + +GetActorTaskId returns the ActorTaskId field if non-nil, zero value otherwise. + +### GetActorTaskIdOk + +`func (o *ScheduleActionRunActorTask) GetActorTaskIdOk() (*string, bool)` + +GetActorTaskIdOk returns a tuple with the ActorTaskId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetActorTaskId + +`func (o *ScheduleActionRunActorTask) SetActorTaskId(v string)` + +SetActorTaskId sets ActorTaskId field to given value. + + +### GetInput + +`func (o *ScheduleActionRunActorTask) GetInput() map[string]interface{}` + +GetInput returns the Input field if non-nil, zero value otherwise. + +### GetInputOk + +`func (o *ScheduleActionRunActorTask) GetInputOk() (*map[string]interface{}, bool)` + +GetInputOk returns a tuple with the Input field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetInput + +`func (o *ScheduleActionRunActorTask) SetInput(v map[string]interface{})` + +SetInput sets Input field to given value. + +### HasInput + +`func (o *ScheduleActionRunActorTask) HasInput() bool` + +HasInput returns a boolean if a field has been set. + +### SetInputNil + +`func (o *ScheduleActionRunActorTask) SetInputNil(b bool)` + + SetInputNil sets the value for Input to be an explicit nil + +### UnsetInput +`func (o *ScheduleActionRunActorTask) UnsetInput()` + +UnsetInput ensures that no value is present for Input, not even an explicit nil + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ScheduleActionRunInput.md b/docs/ScheduleActionRunInput.md new file mode 100644 index 0000000..c379df4 --- /dev/null +++ b/docs/ScheduleActionRunInput.md @@ -0,0 +1,102 @@ +# ScheduleActionRunInput + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Body** | Pointer to **NullableString** | | [optional] +**ContentType** | Pointer to **NullableString** | | [optional] + +## Methods + +### NewScheduleActionRunInput + +`func NewScheduleActionRunInput() *ScheduleActionRunInput` + +NewScheduleActionRunInput instantiates a new ScheduleActionRunInput object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewScheduleActionRunInputWithDefaults + +`func NewScheduleActionRunInputWithDefaults() *ScheduleActionRunInput` + +NewScheduleActionRunInputWithDefaults instantiates a new ScheduleActionRunInput object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetBody + +`func (o *ScheduleActionRunInput) GetBody() string` + +GetBody returns the Body field if non-nil, zero value otherwise. + +### GetBodyOk + +`func (o *ScheduleActionRunInput) GetBodyOk() (*string, bool)` + +GetBodyOk returns a tuple with the Body field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetBody + +`func (o *ScheduleActionRunInput) SetBody(v string)` + +SetBody sets Body field to given value. + +### HasBody + +`func (o *ScheduleActionRunInput) HasBody() bool` + +HasBody returns a boolean if a field has been set. + +### SetBodyNil + +`func (o *ScheduleActionRunInput) SetBodyNil(b bool)` + + SetBodyNil sets the value for Body to be an explicit nil + +### UnsetBody +`func (o *ScheduleActionRunInput) UnsetBody()` + +UnsetBody ensures that no value is present for Body, not even an explicit nil +### GetContentType + +`func (o *ScheduleActionRunInput) GetContentType() string` + +GetContentType returns the ContentType field if non-nil, zero value otherwise. + +### GetContentTypeOk + +`func (o *ScheduleActionRunInput) GetContentTypeOk() (*string, bool)` + +GetContentTypeOk returns a tuple with the ContentType field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetContentType + +`func (o *ScheduleActionRunInput) SetContentType(v string)` + +SetContentType sets ContentType field to given value. + +### HasContentType + +`func (o *ScheduleActionRunInput) HasContentType() bool` + +HasContentType returns a boolean if a field has been set. + +### SetContentTypeNil + +`func (o *ScheduleActionRunInput) SetContentTypeNil(b bool)` + + SetContentTypeNil sets the value for ContentType to be an explicit nil + +### UnsetContentType +`func (o *ScheduleActionRunInput) UnsetContentType()` + +UnsetContentType ensures that no value is present for ContentType, not even an explicit nil + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ScheduleActionShort.md b/docs/ScheduleActionShort.md new file mode 100644 index 0000000..90c2f8f --- /dev/null +++ b/docs/ScheduleActionShort.md @@ -0,0 +1,124 @@ +# ScheduleActionShort + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **string** | | +**Type** | **interface{}** | | +**ActorId** | **string** | | +**ActorTaskId** | **string** | | + +## Methods + +### NewScheduleActionShort + +`func NewScheduleActionShort(id string, type_ interface{}, actorId string, actorTaskId string, ) *ScheduleActionShort` + +NewScheduleActionShort instantiates a new ScheduleActionShort object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewScheduleActionShortWithDefaults + +`func NewScheduleActionShortWithDefaults() *ScheduleActionShort` + +NewScheduleActionShortWithDefaults instantiates a new ScheduleActionShort object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetId + +`func (o *ScheduleActionShort) GetId() string` + +GetId returns the Id field if non-nil, zero value otherwise. + +### GetIdOk + +`func (o *ScheduleActionShort) GetIdOk() (*string, bool)` + +GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetId + +`func (o *ScheduleActionShort) SetId(v string)` + +SetId sets Id field to given value. + + +### GetType + +`func (o *ScheduleActionShort) GetType() interface{}` + +GetType returns the Type field if non-nil, zero value otherwise. + +### GetTypeOk + +`func (o *ScheduleActionShort) GetTypeOk() (*interface{}, bool)` + +GetTypeOk returns a tuple with the Type field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetType + +`func (o *ScheduleActionShort) SetType(v interface{})` + +SetType sets Type field to given value. + + +### SetTypeNil + +`func (o *ScheduleActionShort) SetTypeNil(b bool)` + + SetTypeNil sets the value for Type to be an explicit nil + +### UnsetType +`func (o *ScheduleActionShort) UnsetType()` + +UnsetType ensures that no value is present for Type, not even an explicit nil +### GetActorId + +`func (o *ScheduleActionShort) GetActorId() string` + +GetActorId returns the ActorId field if non-nil, zero value otherwise. + +### GetActorIdOk + +`func (o *ScheduleActionShort) GetActorIdOk() (*string, bool)` + +GetActorIdOk returns a tuple with the ActorId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetActorId + +`func (o *ScheduleActionShort) SetActorId(v string)` + +SetActorId sets ActorId field to given value. + + +### GetActorTaskId + +`func (o *ScheduleActionShort) GetActorTaskId() string` + +GetActorTaskId returns the ActorTaskId field if non-nil, zero value otherwise. + +### GetActorTaskIdOk + +`func (o *ScheduleActionShort) GetActorTaskIdOk() (*string, bool)` + +GetActorTaskIdOk returns a tuple with the ActorTaskId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetActorTaskId + +`func (o *ScheduleActionShort) SetActorTaskId(v string)` + +SetActorTaskId sets ActorTaskId field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ScheduleActionShortRunActor.md b/docs/ScheduleActionShortRunActor.md new file mode 100644 index 0000000..a95f5ef --- /dev/null +++ b/docs/ScheduleActionShortRunActor.md @@ -0,0 +1,103 @@ +# ScheduleActionShortRunActor + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **string** | | +**Type** | **interface{}** | | +**ActorId** | **string** | | + +## Methods + +### NewScheduleActionShortRunActor + +`func NewScheduleActionShortRunActor(id string, type_ interface{}, actorId string, ) *ScheduleActionShortRunActor` + +NewScheduleActionShortRunActor instantiates a new ScheduleActionShortRunActor object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewScheduleActionShortRunActorWithDefaults + +`func NewScheduleActionShortRunActorWithDefaults() *ScheduleActionShortRunActor` + +NewScheduleActionShortRunActorWithDefaults instantiates a new ScheduleActionShortRunActor object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetId + +`func (o *ScheduleActionShortRunActor) GetId() string` + +GetId returns the Id field if non-nil, zero value otherwise. + +### GetIdOk + +`func (o *ScheduleActionShortRunActor) GetIdOk() (*string, bool)` + +GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetId + +`func (o *ScheduleActionShortRunActor) SetId(v string)` + +SetId sets Id field to given value. + + +### GetType + +`func (o *ScheduleActionShortRunActor) GetType() interface{}` + +GetType returns the Type field if non-nil, zero value otherwise. + +### GetTypeOk + +`func (o *ScheduleActionShortRunActor) GetTypeOk() (*interface{}, bool)` + +GetTypeOk returns a tuple with the Type field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetType + +`func (o *ScheduleActionShortRunActor) SetType(v interface{})` + +SetType sets Type field to given value. + + +### SetTypeNil + +`func (o *ScheduleActionShortRunActor) SetTypeNil(b bool)` + + SetTypeNil sets the value for Type to be an explicit nil + +### UnsetType +`func (o *ScheduleActionShortRunActor) UnsetType()` + +UnsetType ensures that no value is present for Type, not even an explicit nil +### GetActorId + +`func (o *ScheduleActionShortRunActor) GetActorId() string` + +GetActorId returns the ActorId field if non-nil, zero value otherwise. + +### GetActorIdOk + +`func (o *ScheduleActionShortRunActor) GetActorIdOk() (*string, bool)` + +GetActorIdOk returns a tuple with the ActorId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetActorId + +`func (o *ScheduleActionShortRunActor) SetActorId(v string)` + +SetActorId sets ActorId field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ScheduleActionShortRunActorTask.md b/docs/ScheduleActionShortRunActorTask.md new file mode 100644 index 0000000..8253ded --- /dev/null +++ b/docs/ScheduleActionShortRunActorTask.md @@ -0,0 +1,103 @@ +# ScheduleActionShortRunActorTask + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **string** | | +**Type** | **interface{}** | | +**ActorTaskId** | **string** | | + +## Methods + +### NewScheduleActionShortRunActorTask + +`func NewScheduleActionShortRunActorTask(id string, type_ interface{}, actorTaskId string, ) *ScheduleActionShortRunActorTask` + +NewScheduleActionShortRunActorTask instantiates a new ScheduleActionShortRunActorTask object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewScheduleActionShortRunActorTaskWithDefaults + +`func NewScheduleActionShortRunActorTaskWithDefaults() *ScheduleActionShortRunActorTask` + +NewScheduleActionShortRunActorTaskWithDefaults instantiates a new ScheduleActionShortRunActorTask object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetId + +`func (o *ScheduleActionShortRunActorTask) GetId() string` + +GetId returns the Id field if non-nil, zero value otherwise. + +### GetIdOk + +`func (o *ScheduleActionShortRunActorTask) GetIdOk() (*string, bool)` + +GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetId + +`func (o *ScheduleActionShortRunActorTask) SetId(v string)` + +SetId sets Id field to given value. + + +### GetType + +`func (o *ScheduleActionShortRunActorTask) GetType() interface{}` + +GetType returns the Type field if non-nil, zero value otherwise. + +### GetTypeOk + +`func (o *ScheduleActionShortRunActorTask) GetTypeOk() (*interface{}, bool)` + +GetTypeOk returns a tuple with the Type field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetType + +`func (o *ScheduleActionShortRunActorTask) SetType(v interface{})` + +SetType sets Type field to given value. + + +### SetTypeNil + +`func (o *ScheduleActionShortRunActorTask) SetTypeNil(b bool)` + + SetTypeNil sets the value for Type to be an explicit nil + +### UnsetType +`func (o *ScheduleActionShortRunActorTask) UnsetType()` + +UnsetType ensures that no value is present for Type, not even an explicit nil +### GetActorTaskId + +`func (o *ScheduleActionShortRunActorTask) GetActorTaskId() string` + +GetActorTaskId returns the ActorTaskId field if non-nil, zero value otherwise. + +### GetActorTaskIdOk + +`func (o *ScheduleActionShortRunActorTask) GetActorTaskIdOk() (*string, bool)` + +GetActorTaskIdOk returns a tuple with the ActorTaskId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetActorTaskId + +`func (o *ScheduleActionShortRunActorTask) SetActorTaskId(v string)` + +SetActorTaskId sets ActorTaskId field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ScheduleBase.md b/docs/ScheduleBase.md new file mode 100644 index 0000000..44e5f7d --- /dev/null +++ b/docs/ScheduleBase.md @@ -0,0 +1,291 @@ +# ScheduleBase + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **string** | | +**UserId** | **string** | | +**Name** | **string** | | +**CronExpression** | **string** | | +**Timezone** | **string** | | +**IsEnabled** | **bool** | | +**IsExclusive** | **bool** | | +**CreatedAt** | **time.Time** | | +**ModifiedAt** | **time.Time** | | +**NextRunAt** | Pointer to **NullableTime** | | [optional] +**LastRunAt** | Pointer to **NullableTime** | | [optional] + +## Methods + +### NewScheduleBase + +`func NewScheduleBase(id string, userId string, name string, cronExpression string, timezone string, isEnabled bool, isExclusive bool, createdAt time.Time, modifiedAt time.Time, ) *ScheduleBase` + +NewScheduleBase instantiates a new ScheduleBase object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewScheduleBaseWithDefaults + +`func NewScheduleBaseWithDefaults() *ScheduleBase` + +NewScheduleBaseWithDefaults instantiates a new ScheduleBase object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetId + +`func (o *ScheduleBase) GetId() string` + +GetId returns the Id field if non-nil, zero value otherwise. + +### GetIdOk + +`func (o *ScheduleBase) GetIdOk() (*string, bool)` + +GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetId + +`func (o *ScheduleBase) SetId(v string)` + +SetId sets Id field to given value. + + +### GetUserId + +`func (o *ScheduleBase) GetUserId() string` + +GetUserId returns the UserId field if non-nil, zero value otherwise. + +### GetUserIdOk + +`func (o *ScheduleBase) GetUserIdOk() (*string, bool)` + +GetUserIdOk returns a tuple with the UserId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUserId + +`func (o *ScheduleBase) SetUserId(v string)` + +SetUserId sets UserId field to given value. + + +### GetName + +`func (o *ScheduleBase) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *ScheduleBase) GetNameOk() (*string, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetName + +`func (o *ScheduleBase) SetName(v string)` + +SetName sets Name field to given value. + + +### GetCronExpression + +`func (o *ScheduleBase) GetCronExpression() string` + +GetCronExpression returns the CronExpression field if non-nil, zero value otherwise. + +### GetCronExpressionOk + +`func (o *ScheduleBase) GetCronExpressionOk() (*string, bool)` + +GetCronExpressionOk returns a tuple with the CronExpression field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCronExpression + +`func (o *ScheduleBase) SetCronExpression(v string)` + +SetCronExpression sets CronExpression field to given value. + + +### GetTimezone + +`func (o *ScheduleBase) GetTimezone() string` + +GetTimezone returns the Timezone field if non-nil, zero value otherwise. + +### GetTimezoneOk + +`func (o *ScheduleBase) GetTimezoneOk() (*string, bool)` + +GetTimezoneOk returns a tuple with the Timezone field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTimezone + +`func (o *ScheduleBase) SetTimezone(v string)` + +SetTimezone sets Timezone field to given value. + + +### GetIsEnabled + +`func (o *ScheduleBase) GetIsEnabled() bool` + +GetIsEnabled returns the IsEnabled field if non-nil, zero value otherwise. + +### GetIsEnabledOk + +`func (o *ScheduleBase) GetIsEnabledOk() (*bool, bool)` + +GetIsEnabledOk returns a tuple with the IsEnabled field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetIsEnabled + +`func (o *ScheduleBase) SetIsEnabled(v bool)` + +SetIsEnabled sets IsEnabled field to given value. + + +### GetIsExclusive + +`func (o *ScheduleBase) GetIsExclusive() bool` + +GetIsExclusive returns the IsExclusive field if non-nil, zero value otherwise. + +### GetIsExclusiveOk + +`func (o *ScheduleBase) GetIsExclusiveOk() (*bool, bool)` + +GetIsExclusiveOk returns a tuple with the IsExclusive field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetIsExclusive + +`func (o *ScheduleBase) SetIsExclusive(v bool)` + +SetIsExclusive sets IsExclusive field to given value. + + +### GetCreatedAt + +`func (o *ScheduleBase) GetCreatedAt() time.Time` + +GetCreatedAt returns the CreatedAt field if non-nil, zero value otherwise. + +### GetCreatedAtOk + +`func (o *ScheduleBase) GetCreatedAtOk() (*time.Time, bool)` + +GetCreatedAtOk returns a tuple with the CreatedAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCreatedAt + +`func (o *ScheduleBase) SetCreatedAt(v time.Time)` + +SetCreatedAt sets CreatedAt field to given value. + + +### GetModifiedAt + +`func (o *ScheduleBase) GetModifiedAt() time.Time` + +GetModifiedAt returns the ModifiedAt field if non-nil, zero value otherwise. + +### GetModifiedAtOk + +`func (o *ScheduleBase) GetModifiedAtOk() (*time.Time, bool)` + +GetModifiedAtOk returns a tuple with the ModifiedAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetModifiedAt + +`func (o *ScheduleBase) SetModifiedAt(v time.Time)` + +SetModifiedAt sets ModifiedAt field to given value. + + +### GetNextRunAt + +`func (o *ScheduleBase) GetNextRunAt() time.Time` + +GetNextRunAt returns the NextRunAt field if non-nil, zero value otherwise. + +### GetNextRunAtOk + +`func (o *ScheduleBase) GetNextRunAtOk() (*time.Time, bool)` + +GetNextRunAtOk returns a tuple with the NextRunAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetNextRunAt + +`func (o *ScheduleBase) SetNextRunAt(v time.Time)` + +SetNextRunAt sets NextRunAt field to given value. + +### HasNextRunAt + +`func (o *ScheduleBase) HasNextRunAt() bool` + +HasNextRunAt returns a boolean if a field has been set. + +### SetNextRunAtNil + +`func (o *ScheduleBase) SetNextRunAtNil(b bool)` + + SetNextRunAtNil sets the value for NextRunAt to be an explicit nil + +### UnsetNextRunAt +`func (o *ScheduleBase) UnsetNextRunAt()` + +UnsetNextRunAt ensures that no value is present for NextRunAt, not even an explicit nil +### GetLastRunAt + +`func (o *ScheduleBase) GetLastRunAt() time.Time` + +GetLastRunAt returns the LastRunAt field if non-nil, zero value otherwise. + +### GetLastRunAtOk + +`func (o *ScheduleBase) GetLastRunAtOk() (*time.Time, bool)` + +GetLastRunAtOk returns a tuple with the LastRunAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetLastRunAt + +`func (o *ScheduleBase) SetLastRunAt(v time.Time)` + +SetLastRunAt sets LastRunAt field to given value. + +### HasLastRunAt + +`func (o *ScheduleBase) HasLastRunAt() bool` + +HasLastRunAt returns a boolean if a field has been set. + +### SetLastRunAtNil + +`func (o *ScheduleBase) SetLastRunAtNil(b bool)` + + SetLastRunAtNil sets the value for LastRunAt to be an explicit nil + +### UnsetLastRunAt +`func (o *ScheduleBase) UnsetLastRunAt()` + +UnsetLastRunAt ensures that no value is present for LastRunAt, not even an explicit nil + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ScheduleCreate.md b/docs/ScheduleCreate.md new file mode 100644 index 0000000..49a0f4f --- /dev/null +++ b/docs/ScheduleCreate.md @@ -0,0 +1,318 @@ +# ScheduleCreate + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Name** | Pointer to **NullableString** | | [optional] +**IsEnabled** | Pointer to **NullableBool** | | [optional] +**IsExclusive** | Pointer to **NullableBool** | | [optional] +**CronExpression** | Pointer to **NullableString** | | [optional] +**Timezone** | Pointer to **NullableString** | | [optional] +**Description** | Pointer to **NullableString** | | [optional] +**Title** | Pointer to **NullableString** | | [optional] +**Actions** | Pointer to [**[]ScheduleCreateAction**](ScheduleCreateAction.md) | | [optional] + +## Methods + +### NewScheduleCreate + +`func NewScheduleCreate() *ScheduleCreate` + +NewScheduleCreate instantiates a new ScheduleCreate object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewScheduleCreateWithDefaults + +`func NewScheduleCreateWithDefaults() *ScheduleCreate` + +NewScheduleCreateWithDefaults instantiates a new ScheduleCreate object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetName + +`func (o *ScheduleCreate) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *ScheduleCreate) GetNameOk() (*string, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetName + +`func (o *ScheduleCreate) SetName(v string)` + +SetName sets Name field to given value. + +### HasName + +`func (o *ScheduleCreate) HasName() bool` + +HasName returns a boolean if a field has been set. + +### SetNameNil + +`func (o *ScheduleCreate) SetNameNil(b bool)` + + SetNameNil sets the value for Name to be an explicit nil + +### UnsetName +`func (o *ScheduleCreate) UnsetName()` + +UnsetName ensures that no value is present for Name, not even an explicit nil +### GetIsEnabled + +`func (o *ScheduleCreate) GetIsEnabled() bool` + +GetIsEnabled returns the IsEnabled field if non-nil, zero value otherwise. + +### GetIsEnabledOk + +`func (o *ScheduleCreate) GetIsEnabledOk() (*bool, bool)` + +GetIsEnabledOk returns a tuple with the IsEnabled field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetIsEnabled + +`func (o *ScheduleCreate) SetIsEnabled(v bool)` + +SetIsEnabled sets IsEnabled field to given value. + +### HasIsEnabled + +`func (o *ScheduleCreate) HasIsEnabled() bool` + +HasIsEnabled returns a boolean if a field has been set. + +### SetIsEnabledNil + +`func (o *ScheduleCreate) SetIsEnabledNil(b bool)` + + SetIsEnabledNil sets the value for IsEnabled to be an explicit nil + +### UnsetIsEnabled +`func (o *ScheduleCreate) UnsetIsEnabled()` + +UnsetIsEnabled ensures that no value is present for IsEnabled, not even an explicit nil +### GetIsExclusive + +`func (o *ScheduleCreate) GetIsExclusive() bool` + +GetIsExclusive returns the IsExclusive field if non-nil, zero value otherwise. + +### GetIsExclusiveOk + +`func (o *ScheduleCreate) GetIsExclusiveOk() (*bool, bool)` + +GetIsExclusiveOk returns a tuple with the IsExclusive field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetIsExclusive + +`func (o *ScheduleCreate) SetIsExclusive(v bool)` + +SetIsExclusive sets IsExclusive field to given value. + +### HasIsExclusive + +`func (o *ScheduleCreate) HasIsExclusive() bool` + +HasIsExclusive returns a boolean if a field has been set. + +### SetIsExclusiveNil + +`func (o *ScheduleCreate) SetIsExclusiveNil(b bool)` + + SetIsExclusiveNil sets the value for IsExclusive to be an explicit nil + +### UnsetIsExclusive +`func (o *ScheduleCreate) UnsetIsExclusive()` + +UnsetIsExclusive ensures that no value is present for IsExclusive, not even an explicit nil +### GetCronExpression + +`func (o *ScheduleCreate) GetCronExpression() string` + +GetCronExpression returns the CronExpression field if non-nil, zero value otherwise. + +### GetCronExpressionOk + +`func (o *ScheduleCreate) GetCronExpressionOk() (*string, bool)` + +GetCronExpressionOk returns a tuple with the CronExpression field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCronExpression + +`func (o *ScheduleCreate) SetCronExpression(v string)` + +SetCronExpression sets CronExpression field to given value. + +### HasCronExpression + +`func (o *ScheduleCreate) HasCronExpression() bool` + +HasCronExpression returns a boolean if a field has been set. + +### SetCronExpressionNil + +`func (o *ScheduleCreate) SetCronExpressionNil(b bool)` + + SetCronExpressionNil sets the value for CronExpression to be an explicit nil + +### UnsetCronExpression +`func (o *ScheduleCreate) UnsetCronExpression()` + +UnsetCronExpression ensures that no value is present for CronExpression, not even an explicit nil +### GetTimezone + +`func (o *ScheduleCreate) GetTimezone() string` + +GetTimezone returns the Timezone field if non-nil, zero value otherwise. + +### GetTimezoneOk + +`func (o *ScheduleCreate) GetTimezoneOk() (*string, bool)` + +GetTimezoneOk returns a tuple with the Timezone field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTimezone + +`func (o *ScheduleCreate) SetTimezone(v string)` + +SetTimezone sets Timezone field to given value. + +### HasTimezone + +`func (o *ScheduleCreate) HasTimezone() bool` + +HasTimezone returns a boolean if a field has been set. + +### SetTimezoneNil + +`func (o *ScheduleCreate) SetTimezoneNil(b bool)` + + SetTimezoneNil sets the value for Timezone to be an explicit nil + +### UnsetTimezone +`func (o *ScheduleCreate) UnsetTimezone()` + +UnsetTimezone ensures that no value is present for Timezone, not even an explicit nil +### GetDescription + +`func (o *ScheduleCreate) GetDescription() string` + +GetDescription returns the Description field if non-nil, zero value otherwise. + +### GetDescriptionOk + +`func (o *ScheduleCreate) GetDescriptionOk() (*string, bool)` + +GetDescriptionOk returns a tuple with the Description field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDescription + +`func (o *ScheduleCreate) SetDescription(v string)` + +SetDescription sets Description field to given value. + +### HasDescription + +`func (o *ScheduleCreate) HasDescription() bool` + +HasDescription returns a boolean if a field has been set. + +### SetDescriptionNil + +`func (o *ScheduleCreate) SetDescriptionNil(b bool)` + + SetDescriptionNil sets the value for Description to be an explicit nil + +### UnsetDescription +`func (o *ScheduleCreate) UnsetDescription()` + +UnsetDescription ensures that no value is present for Description, not even an explicit nil +### GetTitle + +`func (o *ScheduleCreate) GetTitle() string` + +GetTitle returns the Title field if non-nil, zero value otherwise. + +### GetTitleOk + +`func (o *ScheduleCreate) GetTitleOk() (*string, bool)` + +GetTitleOk returns a tuple with the Title field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTitle + +`func (o *ScheduleCreate) SetTitle(v string)` + +SetTitle sets Title field to given value. + +### HasTitle + +`func (o *ScheduleCreate) HasTitle() bool` + +HasTitle returns a boolean if a field has been set. + +### SetTitleNil + +`func (o *ScheduleCreate) SetTitleNil(b bool)` + + SetTitleNil sets the value for Title to be an explicit nil + +### UnsetTitle +`func (o *ScheduleCreate) UnsetTitle()` + +UnsetTitle ensures that no value is present for Title, not even an explicit nil +### GetActions + +`func (o *ScheduleCreate) GetActions() []ScheduleCreateAction` + +GetActions returns the Actions field if non-nil, zero value otherwise. + +### GetActionsOk + +`func (o *ScheduleCreate) GetActionsOk() (*[]ScheduleCreateAction, bool)` + +GetActionsOk returns a tuple with the Actions field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetActions + +`func (o *ScheduleCreate) SetActions(v []ScheduleCreateAction)` + +SetActions sets Actions field to given value. + +### HasActions + +`func (o *ScheduleCreate) HasActions() bool` + +HasActions returns a boolean if a field has been set. + +### SetActionsNil + +`func (o *ScheduleCreate) SetActionsNil(b bool)` + + SetActionsNil sets the value for Actions to be an explicit nil + +### UnsetActions +`func (o *ScheduleCreate) UnsetActions()` + +UnsetActions ensures that no value is present for Actions, not even an explicit nil + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ScheduleCreateAction.md b/docs/ScheduleCreateAction.md new file mode 100644 index 0000000..e838370 --- /dev/null +++ b/docs/ScheduleCreateAction.md @@ -0,0 +1,181 @@ +# ScheduleCreateAction + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Type** | **interface{}** | | +**ActorId** | **string** | | +**RunInput** | Pointer to [**ScheduleActionRunInput**](ScheduleActionRunInput.md) | | [optional] +**RunOptions** | Pointer to [**TaskOptions**](TaskOptions.md) | | [optional] +**ActorTaskId** | **string** | | +**Input** | Pointer to **map[string]interface{}** | | [optional] + +## Methods + +### NewScheduleCreateAction + +`func NewScheduleCreateAction(type_ interface{}, actorId string, actorTaskId string, ) *ScheduleCreateAction` + +NewScheduleCreateAction instantiates a new ScheduleCreateAction object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewScheduleCreateActionWithDefaults + +`func NewScheduleCreateActionWithDefaults() *ScheduleCreateAction` + +NewScheduleCreateActionWithDefaults instantiates a new ScheduleCreateAction object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetType + +`func (o *ScheduleCreateAction) GetType() interface{}` + +GetType returns the Type field if non-nil, zero value otherwise. + +### GetTypeOk + +`func (o *ScheduleCreateAction) GetTypeOk() (*interface{}, bool)` + +GetTypeOk returns a tuple with the Type field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetType + +`func (o *ScheduleCreateAction) SetType(v interface{})` + +SetType sets Type field to given value. + + +### SetTypeNil + +`func (o *ScheduleCreateAction) SetTypeNil(b bool)` + + SetTypeNil sets the value for Type to be an explicit nil + +### UnsetType +`func (o *ScheduleCreateAction) UnsetType()` + +UnsetType ensures that no value is present for Type, not even an explicit nil +### GetActorId + +`func (o *ScheduleCreateAction) GetActorId() string` + +GetActorId returns the ActorId field if non-nil, zero value otherwise. + +### GetActorIdOk + +`func (o *ScheduleCreateAction) GetActorIdOk() (*string, bool)` + +GetActorIdOk returns a tuple with the ActorId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetActorId + +`func (o *ScheduleCreateAction) SetActorId(v string)` + +SetActorId sets ActorId field to given value. + + +### GetRunInput + +`func (o *ScheduleCreateAction) GetRunInput() ScheduleActionRunInput` + +GetRunInput returns the RunInput field if non-nil, zero value otherwise. + +### GetRunInputOk + +`func (o *ScheduleCreateAction) GetRunInputOk() (*ScheduleActionRunInput, bool)` + +GetRunInputOk returns a tuple with the RunInput field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRunInput + +`func (o *ScheduleCreateAction) SetRunInput(v ScheduleActionRunInput)` + +SetRunInput sets RunInput field to given value. + +### HasRunInput + +`func (o *ScheduleCreateAction) HasRunInput() bool` + +HasRunInput returns a boolean if a field has been set. + +### GetRunOptions + +`func (o *ScheduleCreateAction) GetRunOptions() TaskOptions` + +GetRunOptions returns the RunOptions field if non-nil, zero value otherwise. + +### GetRunOptionsOk + +`func (o *ScheduleCreateAction) GetRunOptionsOk() (*TaskOptions, bool)` + +GetRunOptionsOk returns a tuple with the RunOptions field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRunOptions + +`func (o *ScheduleCreateAction) SetRunOptions(v TaskOptions)` + +SetRunOptions sets RunOptions field to given value. + +### HasRunOptions + +`func (o *ScheduleCreateAction) HasRunOptions() bool` + +HasRunOptions returns a boolean if a field has been set. + +### GetActorTaskId + +`func (o *ScheduleCreateAction) GetActorTaskId() string` + +GetActorTaskId returns the ActorTaskId field if non-nil, zero value otherwise. + +### GetActorTaskIdOk + +`func (o *ScheduleCreateAction) GetActorTaskIdOk() (*string, bool)` + +GetActorTaskIdOk returns a tuple with the ActorTaskId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetActorTaskId + +`func (o *ScheduleCreateAction) SetActorTaskId(v string)` + +SetActorTaskId sets ActorTaskId field to given value. + + +### GetInput + +`func (o *ScheduleCreateAction) GetInput() map[string]interface{}` + +GetInput returns the Input field if non-nil, zero value otherwise. + +### GetInputOk + +`func (o *ScheduleCreateAction) GetInputOk() (*map[string]interface{}, bool)` + +GetInputOk returns a tuple with the Input field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetInput + +`func (o *ScheduleCreateAction) SetInput(v map[string]interface{})` + +SetInput sets Input field to given value. + +### HasInput + +`func (o *ScheduleCreateAction) HasInput() bool` + +HasInput returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ScheduleCreateActionRunActor.md b/docs/ScheduleCreateActionRunActor.md new file mode 100644 index 0000000..422b64b --- /dev/null +++ b/docs/ScheduleCreateActionRunActor.md @@ -0,0 +1,154 @@ +# ScheduleCreateActionRunActor + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Type** | **interface{}** | | +**ActorId** | **string** | | +**RunInput** | Pointer to [**NullableScheduleActionRunInput**](ScheduleActionRunInput.md) | | [optional] +**RunOptions** | Pointer to [**NullableTaskOptions**](TaskOptions.md) | | [optional] + +## Methods + +### NewScheduleCreateActionRunActor + +`func NewScheduleCreateActionRunActor(type_ interface{}, actorId string, ) *ScheduleCreateActionRunActor` + +NewScheduleCreateActionRunActor instantiates a new ScheduleCreateActionRunActor object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewScheduleCreateActionRunActorWithDefaults + +`func NewScheduleCreateActionRunActorWithDefaults() *ScheduleCreateActionRunActor` + +NewScheduleCreateActionRunActorWithDefaults instantiates a new ScheduleCreateActionRunActor object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetType + +`func (o *ScheduleCreateActionRunActor) GetType() interface{}` + +GetType returns the Type field if non-nil, zero value otherwise. + +### GetTypeOk + +`func (o *ScheduleCreateActionRunActor) GetTypeOk() (*interface{}, bool)` + +GetTypeOk returns a tuple with the Type field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetType + +`func (o *ScheduleCreateActionRunActor) SetType(v interface{})` + +SetType sets Type field to given value. + + +### SetTypeNil + +`func (o *ScheduleCreateActionRunActor) SetTypeNil(b bool)` + + SetTypeNil sets the value for Type to be an explicit nil + +### UnsetType +`func (o *ScheduleCreateActionRunActor) UnsetType()` + +UnsetType ensures that no value is present for Type, not even an explicit nil +### GetActorId + +`func (o *ScheduleCreateActionRunActor) GetActorId() string` + +GetActorId returns the ActorId field if non-nil, zero value otherwise. + +### GetActorIdOk + +`func (o *ScheduleCreateActionRunActor) GetActorIdOk() (*string, bool)` + +GetActorIdOk returns a tuple with the ActorId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetActorId + +`func (o *ScheduleCreateActionRunActor) SetActorId(v string)` + +SetActorId sets ActorId field to given value. + + +### GetRunInput + +`func (o *ScheduleCreateActionRunActor) GetRunInput() ScheduleActionRunInput` + +GetRunInput returns the RunInput field if non-nil, zero value otherwise. + +### GetRunInputOk + +`func (o *ScheduleCreateActionRunActor) GetRunInputOk() (*ScheduleActionRunInput, bool)` + +GetRunInputOk returns a tuple with the RunInput field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRunInput + +`func (o *ScheduleCreateActionRunActor) SetRunInput(v ScheduleActionRunInput)` + +SetRunInput sets RunInput field to given value. + +### HasRunInput + +`func (o *ScheduleCreateActionRunActor) HasRunInput() bool` + +HasRunInput returns a boolean if a field has been set. + +### SetRunInputNil + +`func (o *ScheduleCreateActionRunActor) SetRunInputNil(b bool)` + + SetRunInputNil sets the value for RunInput to be an explicit nil + +### UnsetRunInput +`func (o *ScheduleCreateActionRunActor) UnsetRunInput()` + +UnsetRunInput ensures that no value is present for RunInput, not even an explicit nil +### GetRunOptions + +`func (o *ScheduleCreateActionRunActor) GetRunOptions() TaskOptions` + +GetRunOptions returns the RunOptions field if non-nil, zero value otherwise. + +### GetRunOptionsOk + +`func (o *ScheduleCreateActionRunActor) GetRunOptionsOk() (*TaskOptions, bool)` + +GetRunOptionsOk returns a tuple with the RunOptions field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRunOptions + +`func (o *ScheduleCreateActionRunActor) SetRunOptions(v TaskOptions)` + +SetRunOptions sets RunOptions field to given value. + +### HasRunOptions + +`func (o *ScheduleCreateActionRunActor) HasRunOptions() bool` + +HasRunOptions returns a boolean if a field has been set. + +### SetRunOptionsNil + +`func (o *ScheduleCreateActionRunActor) SetRunOptionsNil(b bool)` + + SetRunOptionsNil sets the value for RunOptions to be an explicit nil + +### UnsetRunOptions +`func (o *ScheduleCreateActionRunActor) UnsetRunOptions()` + +UnsetRunOptions ensures that no value is present for RunOptions, not even an explicit nil + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ScheduleCreateActionRunActorTask.md b/docs/ScheduleCreateActionRunActorTask.md new file mode 100644 index 0000000..8f0f67e --- /dev/null +++ b/docs/ScheduleCreateActionRunActorTask.md @@ -0,0 +1,118 @@ +# ScheduleCreateActionRunActorTask + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Type** | **interface{}** | | +**ActorTaskId** | **string** | | +**Input** | Pointer to **map[string]interface{}** | | [optional] + +## Methods + +### NewScheduleCreateActionRunActorTask + +`func NewScheduleCreateActionRunActorTask(type_ interface{}, actorTaskId string, ) *ScheduleCreateActionRunActorTask` + +NewScheduleCreateActionRunActorTask instantiates a new ScheduleCreateActionRunActorTask object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewScheduleCreateActionRunActorTaskWithDefaults + +`func NewScheduleCreateActionRunActorTaskWithDefaults() *ScheduleCreateActionRunActorTask` + +NewScheduleCreateActionRunActorTaskWithDefaults instantiates a new ScheduleCreateActionRunActorTask object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetType + +`func (o *ScheduleCreateActionRunActorTask) GetType() interface{}` + +GetType returns the Type field if non-nil, zero value otherwise. + +### GetTypeOk + +`func (o *ScheduleCreateActionRunActorTask) GetTypeOk() (*interface{}, bool)` + +GetTypeOk returns a tuple with the Type field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetType + +`func (o *ScheduleCreateActionRunActorTask) SetType(v interface{})` + +SetType sets Type field to given value. + + +### SetTypeNil + +`func (o *ScheduleCreateActionRunActorTask) SetTypeNil(b bool)` + + SetTypeNil sets the value for Type to be an explicit nil + +### UnsetType +`func (o *ScheduleCreateActionRunActorTask) UnsetType()` + +UnsetType ensures that no value is present for Type, not even an explicit nil +### GetActorTaskId + +`func (o *ScheduleCreateActionRunActorTask) GetActorTaskId() string` + +GetActorTaskId returns the ActorTaskId field if non-nil, zero value otherwise. + +### GetActorTaskIdOk + +`func (o *ScheduleCreateActionRunActorTask) GetActorTaskIdOk() (*string, bool)` + +GetActorTaskIdOk returns a tuple with the ActorTaskId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetActorTaskId + +`func (o *ScheduleCreateActionRunActorTask) SetActorTaskId(v string)` + +SetActorTaskId sets ActorTaskId field to given value. + + +### GetInput + +`func (o *ScheduleCreateActionRunActorTask) GetInput() map[string]interface{}` + +GetInput returns the Input field if non-nil, zero value otherwise. + +### GetInputOk + +`func (o *ScheduleCreateActionRunActorTask) GetInputOk() (*map[string]interface{}, bool)` + +GetInputOk returns a tuple with the Input field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetInput + +`func (o *ScheduleCreateActionRunActorTask) SetInput(v map[string]interface{})` + +SetInput sets Input field to given value. + +### HasInput + +`func (o *ScheduleCreateActionRunActorTask) HasInput() bool` + +HasInput returns a boolean if a field has been set. + +### SetInputNil + +`func (o *ScheduleCreateActionRunActorTask) SetInputNil(b bool)` + + SetInputNil sets the value for Input to be an explicit nil + +### UnsetInput +`func (o *ScheduleCreateActionRunActorTask) UnsetInput()` + +UnsetInput ensures that no value is present for Input, not even an explicit nil + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ScheduleInvoked.md b/docs/ScheduleInvoked.md new file mode 100644 index 0000000..a0bdd9a --- /dev/null +++ b/docs/ScheduleInvoked.md @@ -0,0 +1,93 @@ +# ScheduleInvoked + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Message** | **string** | | +**Level** | **string** | | +**CreatedAt** | **time.Time** | | + +## Methods + +### NewScheduleInvoked + +`func NewScheduleInvoked(message string, level string, createdAt time.Time, ) *ScheduleInvoked` + +NewScheduleInvoked instantiates a new ScheduleInvoked object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewScheduleInvokedWithDefaults + +`func NewScheduleInvokedWithDefaults() *ScheduleInvoked` + +NewScheduleInvokedWithDefaults instantiates a new ScheduleInvoked object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetMessage + +`func (o *ScheduleInvoked) GetMessage() string` + +GetMessage returns the Message field if non-nil, zero value otherwise. + +### GetMessageOk + +`func (o *ScheduleInvoked) GetMessageOk() (*string, bool)` + +GetMessageOk returns a tuple with the Message field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMessage + +`func (o *ScheduleInvoked) SetMessage(v string)` + +SetMessage sets Message field to given value. + + +### GetLevel + +`func (o *ScheduleInvoked) GetLevel() string` + +GetLevel returns the Level field if non-nil, zero value otherwise. + +### GetLevelOk + +`func (o *ScheduleInvoked) GetLevelOk() (*string, bool)` + +GetLevelOk returns a tuple with the Level field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetLevel + +`func (o *ScheduleInvoked) SetLevel(v string)` + +SetLevel sets Level field to given value. + + +### GetCreatedAt + +`func (o *ScheduleInvoked) GetCreatedAt() time.Time` + +GetCreatedAt returns the CreatedAt field if non-nil, zero value otherwise. + +### GetCreatedAtOk + +`func (o *ScheduleInvoked) GetCreatedAtOk() (*time.Time, bool)` + +GetCreatedAtOk returns a tuple with the CreatedAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCreatedAt + +`func (o *ScheduleInvoked) SetCreatedAt(v time.Time)` + +SetCreatedAt sets CreatedAt field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ScheduleLogResponse.md b/docs/ScheduleLogResponse.md new file mode 100644 index 0000000..9ccc7a1 --- /dev/null +++ b/docs/ScheduleLogResponse.md @@ -0,0 +1,51 @@ +# ScheduleLogResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Data** | [**[]ScheduleInvoked**](ScheduleInvoked.md) | | + +## Methods + +### NewScheduleLogResponse + +`func NewScheduleLogResponse(data []ScheduleInvoked, ) *ScheduleLogResponse` + +NewScheduleLogResponse instantiates a new ScheduleLogResponse object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewScheduleLogResponseWithDefaults + +`func NewScheduleLogResponseWithDefaults() *ScheduleLogResponse` + +NewScheduleLogResponseWithDefaults instantiates a new ScheduleLogResponse object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetData + +`func (o *ScheduleLogResponse) GetData() []ScheduleInvoked` + +GetData returns the Data field if non-nil, zero value otherwise. + +### GetDataOk + +`func (o *ScheduleLogResponse) GetDataOk() (*[]ScheduleInvoked, bool)` + +GetDataOk returns a tuple with the Data field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetData + +`func (o *ScheduleLogResponse) SetData(v []ScheduleInvoked)` + +SetData sets Data field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ScheduleNotifications.md b/docs/ScheduleNotifications.md new file mode 100644 index 0000000..a3b32d0 --- /dev/null +++ b/docs/ScheduleNotifications.md @@ -0,0 +1,56 @@ +# ScheduleNotifications + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Email** | Pointer to **bool** | | [optional] + +## Methods + +### NewScheduleNotifications + +`func NewScheduleNotifications() *ScheduleNotifications` + +NewScheduleNotifications instantiates a new ScheduleNotifications object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewScheduleNotificationsWithDefaults + +`func NewScheduleNotificationsWithDefaults() *ScheduleNotifications` + +NewScheduleNotificationsWithDefaults instantiates a new ScheduleNotifications object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetEmail + +`func (o *ScheduleNotifications) GetEmail() bool` + +GetEmail returns the Email field if non-nil, zero value otherwise. + +### GetEmailOk + +`func (o *ScheduleNotifications) GetEmailOk() (*bool, bool)` + +GetEmailOk returns a tuple with the Email field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetEmail + +`func (o *ScheduleNotifications) SetEmail(v bool)` + +SetEmail sets Email field to given value. + +### HasEmail + +`func (o *ScheduleNotifications) HasEmail() bool` + +HasEmail returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ScheduleResponse.md b/docs/ScheduleResponse.md new file mode 100644 index 0000000..95eff18 --- /dev/null +++ b/docs/ScheduleResponse.md @@ -0,0 +1,51 @@ +# ScheduleResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Data** | [**Schedule**](Schedule.md) | | + +## Methods + +### NewScheduleResponse + +`func NewScheduleResponse(data Schedule, ) *ScheduleResponse` + +NewScheduleResponse instantiates a new ScheduleResponse object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewScheduleResponseWithDefaults + +`func NewScheduleResponseWithDefaults() *ScheduleResponse` + +NewScheduleResponseWithDefaults instantiates a new ScheduleResponse object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetData + +`func (o *ScheduleResponse) GetData() Schedule` + +GetData returns the Data field if non-nil, zero value otherwise. + +### GetDataOk + +`func (o *ScheduleResponse) GetDataOk() (*Schedule, bool)` + +GetDataOk returns a tuple with the Data field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetData + +`func (o *ScheduleResponse) SetData(v Schedule)` + +SetData sets Data field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ScheduleShort.md b/docs/ScheduleShort.md new file mode 100644 index 0000000..81faad5 --- /dev/null +++ b/docs/ScheduleShort.md @@ -0,0 +1,292 @@ +# ScheduleShort + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **string** | | +**UserId** | **string** | | +**Name** | **string** | | +**CronExpression** | **string** | | +**Timezone** | **string** | | +**IsEnabled** | **bool** | | +**IsExclusive** | **bool** | | +**CreatedAt** | **time.Time** | | +**ModifiedAt** | **time.Time** | | +**NextRunAt** | Pointer to **time.Time** | | [optional] +**LastRunAt** | Pointer to **time.Time** | | [optional] +**Actions** | [**[]ScheduleActionShort**](ScheduleActionShort.md) | | + +## Methods + +### NewScheduleShort + +`func NewScheduleShort(id string, userId string, name string, cronExpression string, timezone string, isEnabled bool, isExclusive bool, createdAt time.Time, modifiedAt time.Time, actions []ScheduleActionShort, ) *ScheduleShort` + +NewScheduleShort instantiates a new ScheduleShort object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewScheduleShortWithDefaults + +`func NewScheduleShortWithDefaults() *ScheduleShort` + +NewScheduleShortWithDefaults instantiates a new ScheduleShort object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetId + +`func (o *ScheduleShort) GetId() string` + +GetId returns the Id field if non-nil, zero value otherwise. + +### GetIdOk + +`func (o *ScheduleShort) GetIdOk() (*string, bool)` + +GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetId + +`func (o *ScheduleShort) SetId(v string)` + +SetId sets Id field to given value. + + +### GetUserId + +`func (o *ScheduleShort) GetUserId() string` + +GetUserId returns the UserId field if non-nil, zero value otherwise. + +### GetUserIdOk + +`func (o *ScheduleShort) GetUserIdOk() (*string, bool)` + +GetUserIdOk returns a tuple with the UserId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUserId + +`func (o *ScheduleShort) SetUserId(v string)` + +SetUserId sets UserId field to given value. + + +### GetName + +`func (o *ScheduleShort) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *ScheduleShort) GetNameOk() (*string, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetName + +`func (o *ScheduleShort) SetName(v string)` + +SetName sets Name field to given value. + + +### GetCronExpression + +`func (o *ScheduleShort) GetCronExpression() string` + +GetCronExpression returns the CronExpression field if non-nil, zero value otherwise. + +### GetCronExpressionOk + +`func (o *ScheduleShort) GetCronExpressionOk() (*string, bool)` + +GetCronExpressionOk returns a tuple with the CronExpression field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCronExpression + +`func (o *ScheduleShort) SetCronExpression(v string)` + +SetCronExpression sets CronExpression field to given value. + + +### GetTimezone + +`func (o *ScheduleShort) GetTimezone() string` + +GetTimezone returns the Timezone field if non-nil, zero value otherwise. + +### GetTimezoneOk + +`func (o *ScheduleShort) GetTimezoneOk() (*string, bool)` + +GetTimezoneOk returns a tuple with the Timezone field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTimezone + +`func (o *ScheduleShort) SetTimezone(v string)` + +SetTimezone sets Timezone field to given value. + + +### GetIsEnabled + +`func (o *ScheduleShort) GetIsEnabled() bool` + +GetIsEnabled returns the IsEnabled field if non-nil, zero value otherwise. + +### GetIsEnabledOk + +`func (o *ScheduleShort) GetIsEnabledOk() (*bool, bool)` + +GetIsEnabledOk returns a tuple with the IsEnabled field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetIsEnabled + +`func (o *ScheduleShort) SetIsEnabled(v bool)` + +SetIsEnabled sets IsEnabled field to given value. + + +### GetIsExclusive + +`func (o *ScheduleShort) GetIsExclusive() bool` + +GetIsExclusive returns the IsExclusive field if non-nil, zero value otherwise. + +### GetIsExclusiveOk + +`func (o *ScheduleShort) GetIsExclusiveOk() (*bool, bool)` + +GetIsExclusiveOk returns a tuple with the IsExclusive field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetIsExclusive + +`func (o *ScheduleShort) SetIsExclusive(v bool)` + +SetIsExclusive sets IsExclusive field to given value. + + +### GetCreatedAt + +`func (o *ScheduleShort) GetCreatedAt() time.Time` + +GetCreatedAt returns the CreatedAt field if non-nil, zero value otherwise. + +### GetCreatedAtOk + +`func (o *ScheduleShort) GetCreatedAtOk() (*time.Time, bool)` + +GetCreatedAtOk returns a tuple with the CreatedAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCreatedAt + +`func (o *ScheduleShort) SetCreatedAt(v time.Time)` + +SetCreatedAt sets CreatedAt field to given value. + + +### GetModifiedAt + +`func (o *ScheduleShort) GetModifiedAt() time.Time` + +GetModifiedAt returns the ModifiedAt field if non-nil, zero value otherwise. + +### GetModifiedAtOk + +`func (o *ScheduleShort) GetModifiedAtOk() (*time.Time, bool)` + +GetModifiedAtOk returns a tuple with the ModifiedAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetModifiedAt + +`func (o *ScheduleShort) SetModifiedAt(v time.Time)` + +SetModifiedAt sets ModifiedAt field to given value. + + +### GetNextRunAt + +`func (o *ScheduleShort) GetNextRunAt() time.Time` + +GetNextRunAt returns the NextRunAt field if non-nil, zero value otherwise. + +### GetNextRunAtOk + +`func (o *ScheduleShort) GetNextRunAtOk() (*time.Time, bool)` + +GetNextRunAtOk returns a tuple with the NextRunAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetNextRunAt + +`func (o *ScheduleShort) SetNextRunAt(v time.Time)` + +SetNextRunAt sets NextRunAt field to given value. + +### HasNextRunAt + +`func (o *ScheduleShort) HasNextRunAt() bool` + +HasNextRunAt returns a boolean if a field has been set. + +### GetLastRunAt + +`func (o *ScheduleShort) GetLastRunAt() time.Time` + +GetLastRunAt returns the LastRunAt field if non-nil, zero value otherwise. + +### GetLastRunAtOk + +`func (o *ScheduleShort) GetLastRunAtOk() (*time.Time, bool)` + +GetLastRunAtOk returns a tuple with the LastRunAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetLastRunAt + +`func (o *ScheduleShort) SetLastRunAt(v time.Time)` + +SetLastRunAt sets LastRunAt field to given value. + +### HasLastRunAt + +`func (o *ScheduleShort) HasLastRunAt() bool` + +HasLastRunAt returns a boolean if a field has been set. + +### GetActions + +`func (o *ScheduleShort) GetActions() []ScheduleActionShort` + +GetActions returns the Actions field if non-nil, zero value otherwise. + +### GetActionsOk + +`func (o *ScheduleShort) GetActionsOk() (*[]ScheduleActionShort, bool)` + +GetActionsOk returns a tuple with the Actions field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetActions + +`func (o *ScheduleShort) SetActions(v []ScheduleActionShort)` + +SetActions sets Actions field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/SchedulesAPI.md b/docs/SchedulesAPI.md new file mode 100644 index 0000000..f5b1d91 --- /dev/null +++ b/docs/SchedulesAPI.md @@ -0,0 +1,432 @@ +# \SchedulesAPI + +All URIs are relative to *https://api.apify.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**ScheduleDelete**](SchedulesAPI.md#ScheduleDelete) | **Delete** /v2/schedules/{scheduleId} | Delete schedule +[**ScheduleGet**](SchedulesAPI.md#ScheduleGet) | **Get** /v2/schedules/{scheduleId} | Get schedule +[**ScheduleLogGet**](SchedulesAPI.md#ScheduleLogGet) | **Get** /v2/schedules/{scheduleId}/log | Get schedule log +[**SchedulePut**](SchedulesAPI.md#SchedulePut) | **Put** /v2/schedules/{scheduleId} | Update schedule +[**SchedulesGet**](SchedulesAPI.md#SchedulesGet) | **Get** /v2/schedules | Get list of schedules +[**SchedulesPost**](SchedulesAPI.md#SchedulesPost) | **Post** /v2/schedules | Create schedule + + + +## ScheduleDelete + +> map[string]interface{} ScheduleDelete(ctx, scheduleId).Execute() + +Delete schedule + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + scheduleId := "asdLZtadYvn4mBZmm" // string | Schedule ID. + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.SchedulesAPI.ScheduleDelete(context.Background(), scheduleId).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `SchedulesAPI.ScheduleDelete``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ScheduleDelete`: map[string]interface{} + fmt.Fprintf(os.Stdout, "Response from `SchedulesAPI.ScheduleDelete`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**scheduleId** | **string** | Schedule ID. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiScheduleDeleteRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + +### Return type + +**map[string]interface{}** + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## ScheduleGet + +> ScheduleResponse ScheduleGet(ctx, scheduleId).Execute() + +Get schedule + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + scheduleId := "asdLZtadYvn4mBZmm" // string | Schedule ID. + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.SchedulesAPI.ScheduleGet(context.Background(), scheduleId).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `SchedulesAPI.ScheduleGet``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ScheduleGet`: ScheduleResponse + fmt.Fprintf(os.Stdout, "Response from `SchedulesAPI.ScheduleGet`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**scheduleId** | **string** | Schedule ID. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiScheduleGetRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + +### Return type + +[**ScheduleResponse**](ScheduleResponse.md) + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## ScheduleLogGet + +> ScheduleLogResponse ScheduleLogGet(ctx, scheduleId).Execute() + +Get schedule log + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + scheduleId := "asdLZtadYvn4mBZmm" // string | Schedule ID. + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.SchedulesAPI.ScheduleLogGet(context.Background(), scheduleId).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `SchedulesAPI.ScheduleLogGet``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ScheduleLogGet`: ScheduleLogResponse + fmt.Fprintf(os.Stdout, "Response from `SchedulesAPI.ScheduleLogGet`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**scheduleId** | **string** | Schedule ID. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiScheduleLogGetRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + +### Return type + +[**ScheduleLogResponse**](ScheduleLogResponse.md) + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## SchedulePut + +> ScheduleResponse SchedulePut(ctx, scheduleId).ScheduleCreate(scheduleCreate).Execute() + +Update schedule + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + scheduleId := "asdLZtadYvn4mBZmm" // string | Schedule ID. + scheduleCreate := *openapiclient.NewScheduleCreate() // ScheduleCreate | + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.SchedulesAPI.SchedulePut(context.Background(), scheduleId).ScheduleCreate(scheduleCreate).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `SchedulesAPI.SchedulePut``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `SchedulePut`: ScheduleResponse + fmt.Fprintf(os.Stdout, "Response from `SchedulesAPI.SchedulePut`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**scheduleId** | **string** | Schedule ID. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiSchedulePutRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **scheduleCreate** | [**ScheduleCreate**](ScheduleCreate.md) | | + +### Return type + +[**ScheduleResponse**](ScheduleResponse.md) + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## SchedulesGet + +> ListOfSchedulesResponse SchedulesGet(ctx).Offset(offset).Limit(limit).Desc(desc).Execute() + +Get list of schedules + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + offset := float64(0) // float64 | Number of items that should be skipped at the start. The default value is `0`. (optional) + limit := float64(1000) // float64 | Maximum number of items to return. The default value as well as the maximum is `1000`. (optional) + desc := true // bool | If `true` or `1` then the objects are sorted by the `createdAt` field in descending order. By default, they are sorted in ascending order. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.SchedulesAPI.SchedulesGet(context.Background()).Offset(offset).Limit(limit).Desc(desc).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `SchedulesAPI.SchedulesGet``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `SchedulesGet`: ListOfSchedulesResponse + fmt.Fprintf(os.Stdout, "Response from `SchedulesAPI.SchedulesGet`: %v\n", resp) +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiSchedulesGetRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **offset** | **float64** | Number of items that should be skipped at the start. The default value is `0`. | + **limit** | **float64** | Maximum number of items to return. The default value as well as the maximum is `1000`. | + **desc** | **bool** | If `true` or `1` then the objects are sorted by the `createdAt` field in descending order. By default, they are sorted in ascending order. | + +### Return type + +[**ListOfSchedulesResponse**](ListOfSchedulesResponse.md) + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## SchedulesPost + +> ScheduleResponse SchedulesPost(ctx).ScheduleCreate(scheduleCreate).Execute() + +Create schedule + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + scheduleCreate := *openapiclient.NewScheduleCreate() // ScheduleCreate | + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.SchedulesAPI.SchedulesPost(context.Background()).ScheduleCreate(scheduleCreate).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `SchedulesAPI.SchedulesPost``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `SchedulesPost`: ScheduleResponse + fmt.Fprintf(os.Stdout, "Response from `SchedulesAPI.SchedulesPost`: %v\n", resp) +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiSchedulesPostRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **scheduleCreate** | [**ScheduleCreate**](ScheduleCreate.md) | | + +### Return type + +[**ScheduleResponse**](ScheduleResponse.md) + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/docs/SchemaValidationErrorData.md b/docs/SchemaValidationErrorData.md new file mode 100644 index 0000000..66acc8a --- /dev/null +++ b/docs/SchemaValidationErrorData.md @@ -0,0 +1,51 @@ +# SchemaValidationErrorData + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**InvalidItems** | [**[]InvalidItem**](InvalidItem.md) | A list of invalid items in the received array of items. | + +## Methods + +### NewSchemaValidationErrorData + +`func NewSchemaValidationErrorData(invalidItems []InvalidItem, ) *SchemaValidationErrorData` + +NewSchemaValidationErrorData instantiates a new SchemaValidationErrorData object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewSchemaValidationErrorDataWithDefaults + +`func NewSchemaValidationErrorDataWithDefaults() *SchemaValidationErrorData` + +NewSchemaValidationErrorDataWithDefaults instantiates a new SchemaValidationErrorData object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetInvalidItems + +`func (o *SchemaValidationErrorData) GetInvalidItems() []InvalidItem` + +GetInvalidItems returns the InvalidItems field if non-nil, zero value otherwise. + +### GetInvalidItemsOk + +`func (o *SchemaValidationErrorData) GetInvalidItemsOk() (*[]InvalidItem, bool)` + +GetInvalidItemsOk returns a tuple with the InvalidItems field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetInvalidItems + +`func (o *SchemaValidationErrorData) SetInvalidItems(v []InvalidItem)` + +SetInvalidItems sets InvalidItems field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/SourceCodeFile.md b/docs/SourceCodeFile.md new file mode 100644 index 0000000..16211a4 --- /dev/null +++ b/docs/SourceCodeFile.md @@ -0,0 +1,103 @@ +# SourceCodeFile + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Format** | Pointer to [**SourceCodeFileFormat**](SourceCodeFileFormat.md) | | [optional] +**Content** | Pointer to **string** | | [optional] +**Name** | **string** | | + +## Methods + +### NewSourceCodeFile + +`func NewSourceCodeFile(name string, ) *SourceCodeFile` + +NewSourceCodeFile instantiates a new SourceCodeFile object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewSourceCodeFileWithDefaults + +`func NewSourceCodeFileWithDefaults() *SourceCodeFile` + +NewSourceCodeFileWithDefaults instantiates a new SourceCodeFile object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetFormat + +`func (o *SourceCodeFile) GetFormat() SourceCodeFileFormat` + +GetFormat returns the Format field if non-nil, zero value otherwise. + +### GetFormatOk + +`func (o *SourceCodeFile) GetFormatOk() (*SourceCodeFileFormat, bool)` + +GetFormatOk returns a tuple with the Format field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetFormat + +`func (o *SourceCodeFile) SetFormat(v SourceCodeFileFormat)` + +SetFormat sets Format field to given value. + +### HasFormat + +`func (o *SourceCodeFile) HasFormat() bool` + +HasFormat returns a boolean if a field has been set. + +### GetContent + +`func (o *SourceCodeFile) GetContent() string` + +GetContent returns the Content field if non-nil, zero value otherwise. + +### GetContentOk + +`func (o *SourceCodeFile) GetContentOk() (*string, bool)` + +GetContentOk returns a tuple with the Content field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetContent + +`func (o *SourceCodeFile) SetContent(v string)` + +SetContent sets Content field to given value. + +### HasContent + +`func (o *SourceCodeFile) HasContent() bool` + +HasContent returns a boolean if a field has been set. + +### GetName + +`func (o *SourceCodeFile) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *SourceCodeFile) GetNameOk() (*string, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetName + +`func (o *SourceCodeFile) SetName(v string)` + +SetName sets Name field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/SourceCodeFileFormat.md b/docs/SourceCodeFileFormat.md new file mode 100644 index 0000000..c263a51 --- /dev/null +++ b/docs/SourceCodeFileFormat.md @@ -0,0 +1,13 @@ +# SourceCodeFileFormat + +## Enum + + +* `BASE64` (value: `"BASE64"`) + +* `TEXT` (value: `"TEXT"`) + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/SourceCodeFolder.md b/docs/SourceCodeFolder.md new file mode 100644 index 0000000..f35824c --- /dev/null +++ b/docs/SourceCodeFolder.md @@ -0,0 +1,72 @@ +# SourceCodeFolder + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Name** | **string** | The folder path relative to the Actor's root directory. | +**Folder** | **bool** | Always `true` for folders. Used to distinguish folders from files. | + +## Methods + +### NewSourceCodeFolder + +`func NewSourceCodeFolder(name string, folder bool, ) *SourceCodeFolder` + +NewSourceCodeFolder instantiates a new SourceCodeFolder object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewSourceCodeFolderWithDefaults + +`func NewSourceCodeFolderWithDefaults() *SourceCodeFolder` + +NewSourceCodeFolderWithDefaults instantiates a new SourceCodeFolder object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetName + +`func (o *SourceCodeFolder) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *SourceCodeFolder) GetNameOk() (*string, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetName + +`func (o *SourceCodeFolder) SetName(v string)` + +SetName sets Name field to given value. + + +### GetFolder + +`func (o *SourceCodeFolder) GetFolder() bool` + +GetFolder returns the Folder field if non-nil, zero value otherwise. + +### GetFolderOk + +`func (o *SourceCodeFolder) GetFolderOk() (*bool, bool)` + +GetFolderOk returns a tuple with the Folder field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetFolder + +`func (o *SourceCodeFolder) SetFolder(v bool)` + +SetFolder sets Folder field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/StorageDatasetsAPI.md b/docs/StorageDatasetsAPI.md new file mode 100644 index 0000000..b13b2fc --- /dev/null +++ b/docs/StorageDatasetsAPI.md @@ -0,0 +1,743 @@ +# \StorageDatasetsAPI + +All URIs are relative to *https://api.apify.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**DatasetDelete**](StorageDatasetsAPI.md#DatasetDelete) | **Delete** /v2/datasets/{datasetId} | Delete dataset +[**DatasetGet**](StorageDatasetsAPI.md#DatasetGet) | **Get** /v2/datasets/{datasetId} | Get dataset +[**DatasetItemsGet**](StorageDatasetsAPI.md#DatasetItemsGet) | **Get** /v2/datasets/{datasetId}/items | Get dataset items +[**DatasetItemsHead**](StorageDatasetsAPI.md#DatasetItemsHead) | **Head** /v2/datasets/{datasetId}/items | Get dataset items headers +[**DatasetItemsPost**](StorageDatasetsAPI.md#DatasetItemsPost) | **Post** /v2/datasets/{datasetId}/items | Store items +[**DatasetPut**](StorageDatasetsAPI.md#DatasetPut) | **Put** /v2/datasets/{datasetId} | Update dataset +[**DatasetStatisticsGet**](StorageDatasetsAPI.md#DatasetStatisticsGet) | **Get** /v2/datasets/{datasetId}/statistics | Get dataset statistics +[**DatasetsGet**](StorageDatasetsAPI.md#DatasetsGet) | **Get** /v2/datasets | Get list of datasets +[**DatasetsPost**](StorageDatasetsAPI.md#DatasetsPost) | **Post** /v2/datasets | Create dataset + + + +## DatasetDelete + +> DatasetDelete(ctx, datasetId).Execute() + +Delete dataset + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + datasetId := "WkzbQMuFYuamGv3YF" // string | Dataset ID or `username~dataset-name`. + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + r, err := apiClient.StorageDatasetsAPI.DatasetDelete(context.Background(), datasetId).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `StorageDatasetsAPI.DatasetDelete``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**datasetId** | **string** | Dataset ID or `username~dataset-name`. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiDatasetDeleteRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + +### Return type + + (empty response body) + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## DatasetGet + +> DatasetResponse DatasetGet(ctx, datasetId).Execute() + +Get dataset + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + datasetId := "WkzbQMuFYuamGv3YF" // string | Dataset ID or `username~dataset-name`. + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.StorageDatasetsAPI.DatasetGet(context.Background(), datasetId).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `StorageDatasetsAPI.DatasetGet``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `DatasetGet`: DatasetResponse + fmt.Fprintf(os.Stdout, "Response from `StorageDatasetsAPI.DatasetGet`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**datasetId** | **string** | Dataset ID or `username~dataset-name`. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiDatasetGetRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + +### Return type + +[**DatasetResponse**](DatasetResponse.md) + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## DatasetItemsGet + +> []map[string]interface{} DatasetItemsGet(ctx, datasetId).Format(format).Clean(clean).Offset(offset).Limit(limit).Fields(fields).OutputFields(outputFields).Omit(omit).Unwind(unwind).Flatten(flatten).Desc(desc).Attachment(attachment).Delimiter(delimiter).Bom(bom).XmlRoot(xmlRoot).XmlRow(xmlRow).SkipHeaderRow(skipHeaderRow).SkipHidden(skipHidden).SkipEmpty(skipEmpty).Simplified(simplified).View(view).SkipFailedPages(skipFailedPages).FeedTitle(feedTitle).FeedDescription(feedDescription).Signature(signature).Execute() + +Get dataset items + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + datasetId := "WkzbQMuFYuamGv3YF" // string | Dataset ID or `username~dataset-name`. + format := "json" // string | Format of the results, possible values are: `json`, `jsonl`, `csv`, `html`, `xlsx`, `xml` and `rss`. The default value is `json`. (optional) + clean := false // bool | If `true` or `1` then the API endpoint returns only non-empty items and skips hidden fields (i.e. fields starting with the # character). The `clean` parameter is just a shortcut for `skipHidden=true` and `skipEmpty=true` parameters. Note that since some objects might be skipped from the output, that the result might contain less items than the `limit` value. (optional) + offset := float64(0) // float64 | Number of items that should be skipped at the start. The default value is `0`. (optional) + limit := float64(1.2) // float64 | Maximum number of items to return. By default there is no limit. (optional) + fields := "myValue,myOtherValue" // string | A comma-separated list of fields which should be picked from the items, only these fields will remain in the resulting record objects. Note that the fields in the outputted items are sorted the same way as they are specified in the `fields` query parameter. You can use this feature to effectively fix the output format. (optional) + outputFields := "title,link" // string | A comma-separated list of output field names that positionally rename the fields specified in the `fields` parameter. For example, `?fields=headline,url&outputFields=title,link` renames `headline` to `title` and `url` to `link` in the output. The number of names in `outputFields` must match the number of names in `fields`. Requires the `fields` parameter to be specified as well. (optional) + omit := "myValue,myOtherValue" // string | A comma-separated list of fields which should be omitted from the items. (optional) + unwind := "myValue,myOtherValue" // string | A comma-separated list of fields which should be unwound, in order which they should be processed. Each field should be either an array or an object. If the field is an array then every element of the array will become a separate record and merged with parent object. If the unwound field is an object then it is merged with the parent object. If the unwound field is missing or its value is neither an array nor an object and therefore cannot be merged with a parent object then the item gets preserved as it is. Note that the unwound items ignore the `desc` parameter. (optional) + flatten := "myValue" // string | A comma-separated list of fields which should transform nested objects into flat structures. For example, with `flatten=\"foo\"` the object `{\"foo\":{\"bar\": \"hello\"}}` is turned into `{\"foo.bar\": \"hello\"}`. The original object with properties is replaced with the flattened object. (optional) + desc := true // bool | By default, results are returned in the same order as they were stored. To reverse the order, set this parameter to `true` or `1`. (optional) + attachment := true // bool | If `true` or `1` then the response will define the `Content-Disposition: attachment` header, forcing a web browser to download the file rather than to display it. By default this header is not present. (optional) + delimiter := ";" // string | A delimiter character for CSV files, only used if `format=csv`. You might need to URL-encode the character (e.g. use `%09` for tab or `%3B` for semicolon). The default delimiter is a simple comma (`,`). (optional) + bom := false // bool | All text responses are encoded in UTF-8 encoding. By default, the `format=csv` files are prefixed with the UTF-8 Byte Order Mark (BOM), while `json`, `jsonl`, `xml`, `html` and `rss` files are not. If you want to override this default behavior, specify `bom=1` query parameter to include the BOM or `bom=0` to skip it. (optional) + xmlRoot := "items" // string | Overrides default root element name of `xml` output. By default the root element is `items`. (optional) + xmlRow := "item" // string | Overrides default element name that wraps each page or page function result object in `xml` output. By default the element name is `item`. (optional) + skipHeaderRow := true // bool | If `true` or `1` then header row in the `csv` format is skipped. (optional) + skipHidden := false // bool | If `true` or `1` then hidden fields are skipped from the output, i.e. fields starting with the `#` character. (optional) + skipEmpty := false // bool | If `true` or `1` then empty items are skipped from the output. Note that if used, the results might contain less items than the limit value. (optional) + simplified := false // bool | If `true` or `1` then, the endpoint applies the `fields=url,pageFunctionResult,errorInfo` and `unwind=pageFunctionResult` query parameters. This feature is used to emulate simplified results provided by the legacy Apify Crawler product and it's not recommended to use it in new integrations. (optional) + view := "overview" // string | Defines the view configuration for dataset items based on the schema definition. This parameter determines how the data will be filtered and presented. For complete specification details, see the [dataset schema documentation](/platform/actors/development/actor-definition/dataset-schema). (optional) + skipFailedPages := false // bool | If `true` or `1` then, the all the items with errorInfo property will be skipped from the output. This feature is here to emulate functionality of API version 1 used for the legacy Apify Crawler product and it's not recommended to use it in new integrations. (optional) + feedTitle := "Latest posts from r/pasta" // string | Overrides the auto-generated RSS channel `<title>` element. Only used when `format=rss`. If not provided, the title defaults to `Dataset <label>`. (optional) + feedDescription := "Scraped forum posts" // string | Overrides the auto-generated RSS channel `<description>` element. Only used when `format=rss`. If not provided, the description defaults to `Items in dataset with id \"<datasetId>\".` (optional) + signature := "2wTI46Bg8qWQrV7tavlPI" // string | Signature used for the access. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.StorageDatasetsAPI.DatasetItemsGet(context.Background(), datasetId).Format(format).Clean(clean).Offset(offset).Limit(limit).Fields(fields).OutputFields(outputFields).Omit(omit).Unwind(unwind).Flatten(flatten).Desc(desc).Attachment(attachment).Delimiter(delimiter).Bom(bom).XmlRoot(xmlRoot).XmlRow(xmlRow).SkipHeaderRow(skipHeaderRow).SkipHidden(skipHidden).SkipEmpty(skipEmpty).Simplified(simplified).View(view).SkipFailedPages(skipFailedPages).FeedTitle(feedTitle).FeedDescription(feedDescription).Signature(signature).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `StorageDatasetsAPI.DatasetItemsGet``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `DatasetItemsGet`: []map[string]interface{} + fmt.Fprintf(os.Stdout, "Response from `StorageDatasetsAPI.DatasetItemsGet`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**datasetId** | **string** | Dataset ID or `username~dataset-name`. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiDatasetItemsGetRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **format** | **string** | Format of the results, possible values are: `json`, `jsonl`, `csv`, `html`, `xlsx`, `xml` and `rss`. The default value is `json`. | + **clean** | **bool** | If `true` or `1` then the API endpoint returns only non-empty items and skips hidden fields (i.e. fields starting with the # character). The `clean` parameter is just a shortcut for `skipHidden=true` and `skipEmpty=true` parameters. Note that since some objects might be skipped from the output, that the result might contain less items than the `limit` value. | + **offset** | **float64** | Number of items that should be skipped at the start. The default value is `0`. | + **limit** | **float64** | Maximum number of items to return. By default there is no limit. | + **fields** | **string** | A comma-separated list of fields which should be picked from the items, only these fields will remain in the resulting record objects. Note that the fields in the outputted items are sorted the same way as they are specified in the `fields` query parameter. You can use this feature to effectively fix the output format. | + **outputFields** | **string** | A comma-separated list of output field names that positionally rename the fields specified in the `fields` parameter. For example, `?fields=headline,url&outputFields=title,link` renames `headline` to `title` and `url` to `link` in the output. The number of names in `outputFields` must match the number of names in `fields`. Requires the `fields` parameter to be specified as well. | + **omit** | **string** | A comma-separated list of fields which should be omitted from the items. | + **unwind** | **string** | A comma-separated list of fields which should be unwound, in order which they should be processed. Each field should be either an array or an object. If the field is an array then every element of the array will become a separate record and merged with parent object. If the unwound field is an object then it is merged with the parent object. If the unwound field is missing or its value is neither an array nor an object and therefore cannot be merged with a parent object then the item gets preserved as it is. Note that the unwound items ignore the `desc` parameter. | + **flatten** | **string** | A comma-separated list of fields which should transform nested objects into flat structures. For example, with `flatten=\"foo\"` the object `{\"foo\":{\"bar\": \"hello\"}}` is turned into `{\"foo.bar\": \"hello\"}`. The original object with properties is replaced with the flattened object. | + **desc** | **bool** | By default, results are returned in the same order as they were stored. To reverse the order, set this parameter to `true` or `1`. | + **attachment** | **bool** | If `true` or `1` then the response will define the `Content-Disposition: attachment` header, forcing a web browser to download the file rather than to display it. By default this header is not present. | + **delimiter** | **string** | A delimiter character for CSV files, only used if `format=csv`. You might need to URL-encode the character (e.g. use `%09` for tab or `%3B` for semicolon). The default delimiter is a simple comma (`,`). | + **bom** | **bool** | All text responses are encoded in UTF-8 encoding. By default, the `format=csv` files are prefixed with the UTF-8 Byte Order Mark (BOM), while `json`, `jsonl`, `xml`, `html` and `rss` files are not. If you want to override this default behavior, specify `bom=1` query parameter to include the BOM or `bom=0` to skip it. | + **xmlRoot** | **string** | Overrides default root element name of `xml` output. By default the root element is `items`. | + **xmlRow** | **string** | Overrides default element name that wraps each page or page function result object in `xml` output. By default the element name is `item`. | + **skipHeaderRow** | **bool** | If `true` or `1` then header row in the `csv` format is skipped. | + **skipHidden** | **bool** | If `true` or `1` then hidden fields are skipped from the output, i.e. fields starting with the `#` character. | + **skipEmpty** | **bool** | If `true` or `1` then empty items are skipped from the output. Note that if used, the results might contain less items than the limit value. | + **simplified** | **bool** | If `true` or `1` then, the endpoint applies the `fields=url,pageFunctionResult,errorInfo` and `unwind=pageFunctionResult` query parameters. This feature is used to emulate simplified results provided by the legacy Apify Crawler product and it's not recommended to use it in new integrations. | + **view** | **string** | Defines the view configuration for dataset items based on the schema definition. This parameter determines how the data will be filtered and presented. For complete specification details, see the [dataset schema documentation](/platform/actors/development/actor-definition/dataset-schema). | + **skipFailedPages** | **bool** | If `true` or `1` then, the all the items with errorInfo property will be skipped from the output. This feature is here to emulate functionality of API version 1 used for the legacy Apify Crawler product and it's not recommended to use it in new integrations. | + **feedTitle** | **string** | Overrides the auto-generated RSS channel `<title>` element. Only used when `format=rss`. If not provided, the title defaults to `Dataset <label>`. | + **feedDescription** | **string** | Overrides the auto-generated RSS channel `<description>` element. Only used when `format=rss`. If not provided, the description defaults to `Items in dataset with id \"<datasetId>\".` | + **signature** | **string** | Signature used for the access. | + +### Return type + +**[]map[string]interface{}** + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json, application/jsonl, text/csv, text/html, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/rss+xml, application/xml + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## DatasetItemsHead + +> DatasetItemsHead(ctx, datasetId).Format(format).Clean(clean).Offset(offset).Limit(limit).Fields(fields).OutputFields(outputFields).Omit(omit).Unwind(unwind).Flatten(flatten).Desc(desc).Attachment(attachment).Delimiter(delimiter).Bom(bom).XmlRoot(xmlRoot).XmlRow(xmlRow).SkipHeaderRow(skipHeaderRow).SkipHidden(skipHidden).SkipEmpty(skipEmpty).Simplified(simplified).View(view).SkipFailedPages(skipFailedPages).FeedTitle(feedTitle).FeedDescription(feedDescription).Signature(signature).Execute() + +Get dataset items headers + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + datasetId := "WkzbQMuFYuamGv3YF" // string | Dataset ID or `username~dataset-name`. + format := "json" // string | Format of the results, possible values are: `json`, `jsonl`, `csv`, `html`, `xlsx`, `xml` and `rss`. The default value is `json`. (optional) + clean := false // bool | If `true` or `1` then the API endpoint returns only non-empty items and skips hidden fields (i.e. fields starting with the # character). The `clean` parameter is just a shortcut for `skipHidden=true` and `skipEmpty=true` parameters. Note that since some objects might be skipped from the output, that the result might contain less items than the `limit` value. (optional) + offset := float64(0) // float64 | Number of items that should be skipped at the start. The default value is `0`. (optional) + limit := float64(1.2) // float64 | Maximum number of items to return. By default there is no limit. (optional) + fields := "myValue,myOtherValue" // string | A comma-separated list of fields which should be picked from the items, only these fields will remain in the resulting record objects. Note that the fields in the outputted items are sorted the same way as they are specified in the `fields` query parameter. You can use this feature to effectively fix the output format. (optional) + outputFields := "title,link" // string | A comma-separated list of output field names that positionally rename the fields specified in the `fields` parameter. For example, `?fields=headline,url&outputFields=title,link` renames `headline` to `title` and `url` to `link` in the output. The number of names in `outputFields` must match the number of names in `fields`. Requires the `fields` parameter to be specified as well. (optional) + omit := "myValue,myOtherValue" // string | A comma-separated list of fields which should be omitted from the items. (optional) + unwind := "myValue,myOtherValue" // string | A comma-separated list of fields which should be unwound, in order which they should be processed. Each field should be either an array or an object. If the field is an array then every element of the array will become a separate record and merged with parent object. If the unwound field is an object then it is merged with the parent object. If the unwound field is missing or its value is neither an array nor an object and therefore cannot be merged with a parent object then the item gets preserved as it is. Note that the unwound items ignore the `desc` parameter. (optional) + flatten := "myValue" // string | A comma-separated list of fields which should transform nested objects into flat structures. For example, with `flatten=\"foo\"` the object `{\"foo\":{\"bar\": \"hello\"}}` is turned into `{\"foo.bar\": \"hello\"}`. The original object with properties is replaced with the flattened object. (optional) + desc := true // bool | By default, results are returned in the same order as they were stored. To reverse the order, set this parameter to `true` or `1`. (optional) + attachment := true // bool | If `true` or `1` then the response will define the `Content-Disposition: attachment` header, forcing a web browser to download the file rather than to display it. By default this header is not present. (optional) + delimiter := ";" // string | A delimiter character for CSV files, only used if `format=csv`. You might need to URL-encode the character (e.g. use `%09` for tab or `%3B` for semicolon). The default delimiter is a simple comma (`,`). (optional) + bom := false // bool | All text responses are encoded in UTF-8 encoding. By default, the `format=csv` files are prefixed with the UTF-8 Byte Order Mark (BOM), while `json`, `jsonl`, `xml`, `html` and `rss` files are not. If you want to override this default behavior, specify `bom=1` query parameter to include the BOM or `bom=0` to skip it. (optional) + xmlRoot := "items" // string | Overrides default root element name of `xml` output. By default the root element is `items`. (optional) + xmlRow := "item" // string | Overrides default element name that wraps each page or page function result object in `xml` output. By default the element name is `item`. (optional) + skipHeaderRow := true // bool | If `true` or `1` then header row in the `csv` format is skipped. (optional) + skipHidden := false // bool | If `true` or `1` then hidden fields are skipped from the output, i.e. fields starting with the `#` character. (optional) + skipEmpty := false // bool | If `true` or `1` then empty items are skipped from the output. Note that if used, the results might contain less items than the limit value. (optional) + simplified := false // bool | If `true` or `1` then, the endpoint applies the `fields=url,pageFunctionResult,errorInfo` and `unwind=pageFunctionResult` query parameters. This feature is used to emulate simplified results provided by the legacy Apify Crawler product and it's not recommended to use it in new integrations. (optional) + view := "overview" // string | Defines the view configuration for dataset items based on the schema definition. This parameter determines how the data will be filtered and presented. For complete specification details, see the [dataset schema documentation](/platform/actors/development/actor-definition/dataset-schema). (optional) + skipFailedPages := false // bool | If `true` or `1` then, the all the items with errorInfo property will be skipped from the output. This feature is here to emulate functionality of API version 1 used for the legacy Apify Crawler product and it's not recommended to use it in new integrations. (optional) + feedTitle := "Latest posts from r/pasta" // string | Overrides the auto-generated RSS channel `<title>` element. Only used when `format=rss`. If not provided, the title defaults to `Dataset <label>`. (optional) + feedDescription := "Scraped forum posts" // string | Overrides the auto-generated RSS channel `<description>` element. Only used when `format=rss`. If not provided, the description defaults to `Items in dataset with id \"<datasetId>\".` (optional) + signature := "2wTI46Bg8qWQrV7tavlPI" // string | Signature used for the access. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + r, err := apiClient.StorageDatasetsAPI.DatasetItemsHead(context.Background(), datasetId).Format(format).Clean(clean).Offset(offset).Limit(limit).Fields(fields).OutputFields(outputFields).Omit(omit).Unwind(unwind).Flatten(flatten).Desc(desc).Attachment(attachment).Delimiter(delimiter).Bom(bom).XmlRoot(xmlRoot).XmlRow(xmlRow).SkipHeaderRow(skipHeaderRow).SkipHidden(skipHidden).SkipEmpty(skipEmpty).Simplified(simplified).View(view).SkipFailedPages(skipFailedPages).FeedTitle(feedTitle).FeedDescription(feedDescription).Signature(signature).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `StorageDatasetsAPI.DatasetItemsHead``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**datasetId** | **string** | Dataset ID or `username~dataset-name`. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiDatasetItemsHeadRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **format** | **string** | Format of the results, possible values are: `json`, `jsonl`, `csv`, `html`, `xlsx`, `xml` and `rss`. The default value is `json`. | + **clean** | **bool** | If `true` or `1` then the API endpoint returns only non-empty items and skips hidden fields (i.e. fields starting with the # character). The `clean` parameter is just a shortcut for `skipHidden=true` and `skipEmpty=true` parameters. Note that since some objects might be skipped from the output, that the result might contain less items than the `limit` value. | + **offset** | **float64** | Number of items that should be skipped at the start. The default value is `0`. | + **limit** | **float64** | Maximum number of items to return. By default there is no limit. | + **fields** | **string** | A comma-separated list of fields which should be picked from the items, only these fields will remain in the resulting record objects. Note that the fields in the outputted items are sorted the same way as they are specified in the `fields` query parameter. You can use this feature to effectively fix the output format. | + **outputFields** | **string** | A comma-separated list of output field names that positionally rename the fields specified in the `fields` parameter. For example, `?fields=headline,url&outputFields=title,link` renames `headline` to `title` and `url` to `link` in the output. The number of names in `outputFields` must match the number of names in `fields`. Requires the `fields` parameter to be specified as well. | + **omit** | **string** | A comma-separated list of fields which should be omitted from the items. | + **unwind** | **string** | A comma-separated list of fields which should be unwound, in order which they should be processed. Each field should be either an array or an object. If the field is an array then every element of the array will become a separate record and merged with parent object. If the unwound field is an object then it is merged with the parent object. If the unwound field is missing or its value is neither an array nor an object and therefore cannot be merged with a parent object then the item gets preserved as it is. Note that the unwound items ignore the `desc` parameter. | + **flatten** | **string** | A comma-separated list of fields which should transform nested objects into flat structures. For example, with `flatten=\"foo\"` the object `{\"foo\":{\"bar\": \"hello\"}}` is turned into `{\"foo.bar\": \"hello\"}`. The original object with properties is replaced with the flattened object. | + **desc** | **bool** | By default, results are returned in the same order as they were stored. To reverse the order, set this parameter to `true` or `1`. | + **attachment** | **bool** | If `true` or `1` then the response will define the `Content-Disposition: attachment` header, forcing a web browser to download the file rather than to display it. By default this header is not present. | + **delimiter** | **string** | A delimiter character for CSV files, only used if `format=csv`. You might need to URL-encode the character (e.g. use `%09` for tab or `%3B` for semicolon). The default delimiter is a simple comma (`,`). | + **bom** | **bool** | All text responses are encoded in UTF-8 encoding. By default, the `format=csv` files are prefixed with the UTF-8 Byte Order Mark (BOM), while `json`, `jsonl`, `xml`, `html` and `rss` files are not. If you want to override this default behavior, specify `bom=1` query parameter to include the BOM or `bom=0` to skip it. | + **xmlRoot** | **string** | Overrides default root element name of `xml` output. By default the root element is `items`. | + **xmlRow** | **string** | Overrides default element name that wraps each page or page function result object in `xml` output. By default the element name is `item`. | + **skipHeaderRow** | **bool** | If `true` or `1` then header row in the `csv` format is skipped. | + **skipHidden** | **bool** | If `true` or `1` then hidden fields are skipped from the output, i.e. fields starting with the `#` character. | + **skipEmpty** | **bool** | If `true` or `1` then empty items are skipped from the output. Note that if used, the results might contain less items than the limit value. | + **simplified** | **bool** | If `true` or `1` then, the endpoint applies the `fields=url,pageFunctionResult,errorInfo` and `unwind=pageFunctionResult` query parameters. This feature is used to emulate simplified results provided by the legacy Apify Crawler product and it's not recommended to use it in new integrations. | + **view** | **string** | Defines the view configuration for dataset items based on the schema definition. This parameter determines how the data will be filtered and presented. For complete specification details, see the [dataset schema documentation](/platform/actors/development/actor-definition/dataset-schema). | + **skipFailedPages** | **bool** | If `true` or `1` then, the all the items with errorInfo property will be skipped from the output. This feature is here to emulate functionality of API version 1 used for the legacy Apify Crawler product and it's not recommended to use it in new integrations. | + **feedTitle** | **string** | Overrides the auto-generated RSS channel `<title>` element. Only used when `format=rss`. If not provided, the title defaults to `Dataset <label>`. | + **feedDescription** | **string** | Overrides the auto-generated RSS channel `<description>` element. Only used when `format=rss`. If not provided, the description defaults to `Items in dataset with id \"<datasetId>\".` | + **signature** | **string** | Signature used for the access. | + +### Return type + + (empty response body) + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## DatasetItemsPost + +> map[string]interface{} DatasetItemsPost(ctx, datasetId).ActRunsLastDatasetItemsPostRequest(actRunsLastDatasetItemsPostRequest).Execute() + +Store items + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + datasetId := "WkzbQMuFYuamGv3YF" // string | Dataset ID or `username~dataset-name`. + actRunsLastDatasetItemsPostRequest := openapiclient.act_runs_last_dataset_items_post_request{ArrayOfMapmapOfStringAny: new([]map[string]interface{})} // ActRunsLastDatasetItemsPostRequest | + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.StorageDatasetsAPI.DatasetItemsPost(context.Background(), datasetId).ActRunsLastDatasetItemsPostRequest(actRunsLastDatasetItemsPostRequest).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `StorageDatasetsAPI.DatasetItemsPost``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `DatasetItemsPost`: map[string]interface{} + fmt.Fprintf(os.Stdout, "Response from `StorageDatasetsAPI.DatasetItemsPost`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**datasetId** | **string** | Dataset ID or `username~dataset-name`. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiDatasetItemsPostRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **actRunsLastDatasetItemsPostRequest** | [**ActRunsLastDatasetItemsPostRequest**](ActRunsLastDatasetItemsPostRequest.md) | | + +### Return type + +**map[string]interface{}** + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## DatasetPut + +> DatasetResponse DatasetPut(ctx, datasetId).UpdateDatasetRequest(updateDatasetRequest).Execute() + +Update dataset + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + datasetId := "WkzbQMuFYuamGv3YF" // string | Dataset ID or `username~dataset-name`. + updateDatasetRequest := *openapiclient.NewUpdateDatasetRequest() // UpdateDatasetRequest | + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.StorageDatasetsAPI.DatasetPut(context.Background(), datasetId).UpdateDatasetRequest(updateDatasetRequest).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `StorageDatasetsAPI.DatasetPut``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `DatasetPut`: DatasetResponse + fmt.Fprintf(os.Stdout, "Response from `StorageDatasetsAPI.DatasetPut`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**datasetId** | **string** | Dataset ID or `username~dataset-name`. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiDatasetPutRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **updateDatasetRequest** | [**UpdateDatasetRequest**](UpdateDatasetRequest.md) | | + +### Return type + +[**DatasetResponse**](DatasetResponse.md) + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## DatasetStatisticsGet + +> DatasetStatisticsResponse DatasetStatisticsGet(ctx, datasetId).Execute() + +Get dataset statistics + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + datasetId := "WkzbQMuFYuamGv3YF" // string | Dataset ID or `username~dataset-name`. + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.StorageDatasetsAPI.DatasetStatisticsGet(context.Background(), datasetId).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `StorageDatasetsAPI.DatasetStatisticsGet``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `DatasetStatisticsGet`: DatasetStatisticsResponse + fmt.Fprintf(os.Stdout, "Response from `StorageDatasetsAPI.DatasetStatisticsGet`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**datasetId** | **string** | Dataset ID or `username~dataset-name`. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiDatasetStatisticsGetRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + +### Return type + +[**DatasetStatisticsResponse**](DatasetStatisticsResponse.md) + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## DatasetsGet + +> ListOfDatasetsResponse DatasetsGet(ctx).Offset(offset).Limit(limit).Desc(desc).Unnamed(unnamed).Ownership(ownership).Execute() + +Get list of datasets + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + offset := float64(0) // float64 | Number of items that should be skipped at the start. The default value is `0`. (optional) + limit := float64(1000) // float64 | Maximum number of items to return. The default value as well as the maximum is `1000`. (optional) + desc := true // bool | If `true` or `1` then the objects are sorted by the `createdAt` field in descending order. By default, they are sorted in ascending order. (optional) + unnamed := true // bool | If `true` or `1` then all the storages are returned. By default, only named storages are returned. (optional) + ownership := openapiclient.StorageOwnership("ownedByMe") // StorageOwnership | Filter by ownership. If this parameter is omitted, all accessible datasets are returned. - `ownedByMe`: Return only datasets owned by the user. - `sharedWithMe`: Return only datasets shared with the user by other users. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.StorageDatasetsAPI.DatasetsGet(context.Background()).Offset(offset).Limit(limit).Desc(desc).Unnamed(unnamed).Ownership(ownership).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `StorageDatasetsAPI.DatasetsGet``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `DatasetsGet`: ListOfDatasetsResponse + fmt.Fprintf(os.Stdout, "Response from `StorageDatasetsAPI.DatasetsGet`: %v\n", resp) +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiDatasetsGetRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **offset** | **float64** | Number of items that should be skipped at the start. The default value is `0`. | + **limit** | **float64** | Maximum number of items to return. The default value as well as the maximum is `1000`. | + **desc** | **bool** | If `true` or `1` then the objects are sorted by the `createdAt` field in descending order. By default, they are sorted in ascending order. | + **unnamed** | **bool** | If `true` or `1` then all the storages are returned. By default, only named storages are returned. | + **ownership** | [**StorageOwnership**](StorageOwnership.md) | Filter by ownership. If this parameter is omitted, all accessible datasets are returned. - `ownedByMe`: Return only datasets owned by the user. - `sharedWithMe`: Return only datasets shared with the user by other users. | + +### Return type + +[**ListOfDatasetsResponse**](ListOfDatasetsResponse.md) + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## DatasetsPost + +> DatasetResponse DatasetsPost(ctx).Name(name).Execute() + +Create dataset + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + name := "eshop-items" // string | Custom unique name to easily identify the dataset in the future. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.StorageDatasetsAPI.DatasetsPost(context.Background()).Name(name).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `StorageDatasetsAPI.DatasetsPost``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `DatasetsPost`: DatasetResponse + fmt.Fprintf(os.Stdout, "Response from `StorageDatasetsAPI.DatasetsPost`: %v\n", resp) +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiDatasetsPostRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **name** | **string** | Custom unique name to easily identify the dataset in the future. | + +### Return type + +[**DatasetResponse**](DatasetResponse.md) + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/docs/StorageKeyValueStoresAPI.md b/docs/StorageKeyValueStoresAPI.md new file mode 100644 index 0000000..f36da65 --- /dev/null +++ b/docs/StorageKeyValueStoresAPI.md @@ -0,0 +1,899 @@ +# \StorageKeyValueStoresAPI + +All URIs are relative to *https://api.apify.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**KeyValueStoreDelete**](StorageKeyValueStoresAPI.md#KeyValueStoreDelete) | **Delete** /v2/key-value-stores/{storeId} | Delete store +[**KeyValueStoreGet**](StorageKeyValueStoresAPI.md#KeyValueStoreGet) | **Get** /v2/key-value-stores/{storeId} | Get store +[**KeyValueStoreKeysGet**](StorageKeyValueStoresAPI.md#KeyValueStoreKeysGet) | **Get** /v2/key-value-stores/{storeId}/keys | Get list of keys +[**KeyValueStorePut**](StorageKeyValueStoresAPI.md#KeyValueStorePut) | **Put** /v2/key-value-stores/{storeId} | Update store +[**KeyValueStoreRecordDelete**](StorageKeyValueStoresAPI.md#KeyValueStoreRecordDelete) | **Delete** /v2/key-value-stores/{storeId}/records/{recordKey} | Delete record +[**KeyValueStoreRecordGet**](StorageKeyValueStoresAPI.md#KeyValueStoreRecordGet) | **Get** /v2/key-value-stores/{storeId}/records/{recordKey} | Get record +[**KeyValueStoreRecordHead**](StorageKeyValueStoresAPI.md#KeyValueStoreRecordHead) | **Head** /v2/key-value-stores/{storeId}/records/{recordKey} | Check if a record exists +[**KeyValueStoreRecordPost**](StorageKeyValueStoresAPI.md#KeyValueStoreRecordPost) | **Post** /v2/key-value-stores/{storeId}/records/{recordKey} | Store record (POST) +[**KeyValueStoreRecordPut**](StorageKeyValueStoresAPI.md#KeyValueStoreRecordPut) | **Put** /v2/key-value-stores/{storeId}/records/{recordKey} | Store record +[**KeyValueStoreRecordsGet**](StorageKeyValueStoresAPI.md#KeyValueStoreRecordsGet) | **Get** /v2/key-value-stores/{storeId}/records | Download records +[**KeyValueStoresGet**](StorageKeyValueStoresAPI.md#KeyValueStoresGet) | **Get** /v2/key-value-stores | Get list of key-value stores +[**KeyValueStoresPost**](StorageKeyValueStoresAPI.md#KeyValueStoresPost) | **Post** /v2/key-value-stores | Create key-value store + + + +## KeyValueStoreDelete + +> KeyValueStoreDelete(ctx, storeId).Execute() + +Delete store + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + storeId := "WkzbQMuFYuamGv3YF" // string | Key-value store ID or `username~store-name`. + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + r, err := apiClient.StorageKeyValueStoresAPI.KeyValueStoreDelete(context.Background(), storeId).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `StorageKeyValueStoresAPI.KeyValueStoreDelete``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**storeId** | **string** | Key-value store ID or `username~store-name`. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiKeyValueStoreDeleteRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + +### Return type + + (empty response body) + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## KeyValueStoreGet + +> KeyValueStoreResponse KeyValueStoreGet(ctx, storeId).Execute() + +Get store + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + storeId := "WkzbQMuFYuamGv3YF" // string | Key-value store ID or `username~store-name`. + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.StorageKeyValueStoresAPI.KeyValueStoreGet(context.Background(), storeId).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `StorageKeyValueStoresAPI.KeyValueStoreGet``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `KeyValueStoreGet`: KeyValueStoreResponse + fmt.Fprintf(os.Stdout, "Response from `StorageKeyValueStoresAPI.KeyValueStoreGet`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**storeId** | **string** | Key-value store ID or `username~store-name`. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiKeyValueStoreGetRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + +### Return type + +[**KeyValueStoreResponse**](KeyValueStoreResponse.md) + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## KeyValueStoreKeysGet + +> ListOfKeysResponse KeyValueStoreKeysGet(ctx, storeId).ExclusiveStartKey(exclusiveStartKey).Limit(limit).Collection(collection).Prefix(prefix).Signature(signature).Execute() + +Get list of keys + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + storeId := "WkzbQMuFYuamGv3YF" // string | Key-value store ID or `username~store-name`. + exclusiveStartKey := "Ihnsp8YrvJ8102Kj" // string | All keys up to this one (including) are skipped from the result. (optional) + limit := float32(100) // float32 | Number of keys to be returned. (optional) (default to 1000) + collection := "postImages" // string | Limit the results to keys that belong to a specific collection from the key-value store schema. The key-value store need to have a schema defined for this parameter to work. (optional) + prefix := "post-images-" // string | Limit the results to keys that start with a specific prefix. (optional) + signature := "2wTI46Bg8qWQrV7tavlPI" // string | Signature used for the access. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.StorageKeyValueStoresAPI.KeyValueStoreKeysGet(context.Background(), storeId).ExclusiveStartKey(exclusiveStartKey).Limit(limit).Collection(collection).Prefix(prefix).Signature(signature).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `StorageKeyValueStoresAPI.KeyValueStoreKeysGet``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `KeyValueStoreKeysGet`: ListOfKeysResponse + fmt.Fprintf(os.Stdout, "Response from `StorageKeyValueStoresAPI.KeyValueStoreKeysGet`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**storeId** | **string** | Key-value store ID or `username~store-name`. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiKeyValueStoreKeysGetRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **exclusiveStartKey** | **string** | All keys up to this one (including) are skipped from the result. | + **limit** | **float32** | Number of keys to be returned. | [default to 1000] + **collection** | **string** | Limit the results to keys that belong to a specific collection from the key-value store schema. The key-value store need to have a schema defined for this parameter to work. | + **prefix** | **string** | Limit the results to keys that start with a specific prefix. | + **signature** | **string** | Signature used for the access. | + +### Return type + +[**ListOfKeysResponse**](ListOfKeysResponse.md) + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## KeyValueStorePut + +> KeyValueStoreResponse KeyValueStorePut(ctx, storeId).UpdateStoreRequest(updateStoreRequest).Execute() + +Update store + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + storeId := "WkzbQMuFYuamGv3YF" // string | Key-value store ID or `username~store-name`. + updateStoreRequest := *openapiclient.NewUpdateStoreRequest() // UpdateStoreRequest | + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.StorageKeyValueStoresAPI.KeyValueStorePut(context.Background(), storeId).UpdateStoreRequest(updateStoreRequest).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `StorageKeyValueStoresAPI.KeyValueStorePut``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `KeyValueStorePut`: KeyValueStoreResponse + fmt.Fprintf(os.Stdout, "Response from `StorageKeyValueStoresAPI.KeyValueStorePut`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**storeId** | **string** | Key-value store ID or `username~store-name`. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiKeyValueStorePutRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **updateStoreRequest** | [**UpdateStoreRequest**](UpdateStoreRequest.md) | | + +### Return type + +[**KeyValueStoreResponse**](KeyValueStoreResponse.md) + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## KeyValueStoreRecordDelete + +> KeyValueStoreRecordDelete(ctx, storeId, recordKey).Execute() + +Delete record + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + storeId := "WkzbQMuFYuamGv3YF" // string | Key-value store ID or `username~store-name`. + recordKey := "someKey" // string | Key of the record. + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + r, err := apiClient.StorageKeyValueStoresAPI.KeyValueStoreRecordDelete(context.Background(), storeId, recordKey).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `StorageKeyValueStoresAPI.KeyValueStoreRecordDelete``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**storeId** | **string** | Key-value store ID or `username~store-name`. | +**recordKey** | **string** | Key of the record. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiKeyValueStoreRecordDeleteRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + +### Return type + + (empty response body) + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## KeyValueStoreRecordGet + +> map[string]interface{} KeyValueStoreRecordGet(ctx, storeId, recordKey).Attachment(attachment).Signature(signature).Execute() + +Get record + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + storeId := "WkzbQMuFYuamGv3YF" // string | Key-value store ID or `username~store-name`. + recordKey := "someKey" // string | Key of the record. + attachment := true // bool | If `true` or `1`, the response will be served with `Content-Disposition: attachment` header, causing web browsers to offer downloading HTML records instead of displaying them. (optional) + signature := "2wTI46Bg8qWQrV7tavlPI" // string | Signature used for the access. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.StorageKeyValueStoresAPI.KeyValueStoreRecordGet(context.Background(), storeId, recordKey).Attachment(attachment).Signature(signature).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `StorageKeyValueStoresAPI.KeyValueStoreRecordGet``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `KeyValueStoreRecordGet`: map[string]interface{} + fmt.Fprintf(os.Stdout, "Response from `StorageKeyValueStoresAPI.KeyValueStoreRecordGet`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**storeId** | **string** | Key-value store ID or `username~store-name`. | +**recordKey** | **string** | Key of the record. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiKeyValueStoreRecordGetRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + **attachment** | **bool** | If `true` or `1`, the response will be served with `Content-Disposition: attachment` header, causing web browsers to offer downloading HTML records instead of displaying them. | + **signature** | **string** | Signature used for the access. | + +### Return type + +**map[string]interface{}** + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json, */* + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## KeyValueStoreRecordHead + +> KeyValueStoreRecordHead(ctx, storeId, recordKey).Execute() + +Check if a record exists + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + storeId := "WkzbQMuFYuamGv3YF" // string | Key-value store ID or `username~store-name`. + recordKey := "someKey" // string | Key of the record. + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + r, err := apiClient.StorageKeyValueStoresAPI.KeyValueStoreRecordHead(context.Background(), storeId, recordKey).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `StorageKeyValueStoresAPI.KeyValueStoreRecordHead``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**storeId** | **string** | Key-value store ID or `username~store-name`. | +**recordKey** | **string** | Key of the record. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiKeyValueStoreRecordHeadRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + +### Return type + + (empty response body) + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## KeyValueStoreRecordPost + +> map[string]interface{} KeyValueStoreRecordPost(ctx, storeId, recordKey).RequestBody(requestBody).ContentEncoding(contentEncoding).Execute() + +Store record (POST) + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + storeId := "WkzbQMuFYuamGv3YF" // string | Key-value store ID or `username~store-name`. + recordKey := "someKey" // string | Key of the record. + requestBody := map[string]interface{}{"key": interface{}(123)} // map[string]interface{} | + contentEncoding := "contentEncoding_example" // string | (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.StorageKeyValueStoresAPI.KeyValueStoreRecordPost(context.Background(), storeId, recordKey).RequestBody(requestBody).ContentEncoding(contentEncoding).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `StorageKeyValueStoresAPI.KeyValueStoreRecordPost``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `KeyValueStoreRecordPost`: map[string]interface{} + fmt.Fprintf(os.Stdout, "Response from `StorageKeyValueStoresAPI.KeyValueStoreRecordPost`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**storeId** | **string** | Key-value store ID or `username~store-name`. | +**recordKey** | **string** | Key of the record. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiKeyValueStoreRecordPostRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + **requestBody** | **map[string]interface{}** | | + **contentEncoding** | **string** | | + +### Return type + +**map[string]interface{}** + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## KeyValueStoreRecordPut + +> map[string]interface{} KeyValueStoreRecordPut(ctx, storeId, recordKey).RequestBody(requestBody).ContentEncoding(contentEncoding).Execute() + +Store record + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + storeId := "WkzbQMuFYuamGv3YF" // string | Key-value store ID or `username~store-name`. + recordKey := "someKey" // string | Key of the record. + requestBody := map[string]interface{}{"key": interface{}(123)} // map[string]interface{} | + contentEncoding := "contentEncoding_example" // string | (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.StorageKeyValueStoresAPI.KeyValueStoreRecordPut(context.Background(), storeId, recordKey).RequestBody(requestBody).ContentEncoding(contentEncoding).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `StorageKeyValueStoresAPI.KeyValueStoreRecordPut``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `KeyValueStoreRecordPut`: map[string]interface{} + fmt.Fprintf(os.Stdout, "Response from `StorageKeyValueStoresAPI.KeyValueStoreRecordPut`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**storeId** | **string** | Key-value store ID or `username~store-name`. | +**recordKey** | **string** | Key of the record. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiKeyValueStoreRecordPutRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + **requestBody** | **map[string]interface{}** | | + **contentEncoding** | **string** | | + +### Return type + +**map[string]interface{}** + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## KeyValueStoreRecordsGet + +> *os.File KeyValueStoreRecordsGet(ctx, storeId).Collection(collection).Prefix(prefix).Signature(signature).Execute() + +Download records + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + storeId := "WkzbQMuFYuamGv3YF" // string | Key-value store ID or `username~store-name`. + collection := "my-collection" // string | If specified, only records belonging to a specific collection from the key-value store schema. The key-value store need to have a schema defined for this parameter to work. (optional) + prefix := "my-prefix/" // string | If specified, only records whose key starts with the given prefix are included in the archive. (optional) + signature := "2wTI46Bg8qWQrV7tavlPI" // string | Signature used for the access. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.StorageKeyValueStoresAPI.KeyValueStoreRecordsGet(context.Background(), storeId).Collection(collection).Prefix(prefix).Signature(signature).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `StorageKeyValueStoresAPI.KeyValueStoreRecordsGet``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `KeyValueStoreRecordsGet`: *os.File + fmt.Fprintf(os.Stdout, "Response from `StorageKeyValueStoresAPI.KeyValueStoreRecordsGet`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**storeId** | **string** | Key-value store ID or `username~store-name`. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiKeyValueStoreRecordsGetRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **collection** | **string** | If specified, only records belonging to a specific collection from the key-value store schema. The key-value store need to have a schema defined for this parameter to work. | + **prefix** | **string** | If specified, only records whose key starts with the given prefix are included in the archive. | + **signature** | **string** | Signature used for the access. | + +### Return type + +[***os.File**](*os.File.md) + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/zip, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## KeyValueStoresGet + +> ListOfKeyValueStoresResponse KeyValueStoresGet(ctx).Offset(offset).Limit(limit).Desc(desc).Unnamed(unnamed).Ownership(ownership).Execute() + +Get list of key-value stores + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + offset := float64(0) // float64 | Number of items that should be skipped at the start. The default value is `0`. (optional) + limit := float64(1000) // float64 | Maximum number of items to return. The default value as well as the maximum is `1000`. (optional) + desc := true // bool | If `true` or `1` then the objects are sorted by the `createdAt` field in descending order. By default, they are sorted in ascending order. (optional) + unnamed := true // bool | If `true` or `1` then all the storages are returned. By default, only named storages are returned. (optional) + ownership := openapiclient.StorageOwnership("ownedByMe") // StorageOwnership | Filter by ownership. If this parameter is omitted, all accessible key-value stores are returned. - `ownedByMe`: Return only key-value stores owned by the user. - `sharedWithMe`: Return only key-value stores shared with the user by other users. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.StorageKeyValueStoresAPI.KeyValueStoresGet(context.Background()).Offset(offset).Limit(limit).Desc(desc).Unnamed(unnamed).Ownership(ownership).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `StorageKeyValueStoresAPI.KeyValueStoresGet``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `KeyValueStoresGet`: ListOfKeyValueStoresResponse + fmt.Fprintf(os.Stdout, "Response from `StorageKeyValueStoresAPI.KeyValueStoresGet`: %v\n", resp) +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiKeyValueStoresGetRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **offset** | **float64** | Number of items that should be skipped at the start. The default value is `0`. | + **limit** | **float64** | Maximum number of items to return. The default value as well as the maximum is `1000`. | + **desc** | **bool** | If `true` or `1` then the objects are sorted by the `createdAt` field in descending order. By default, they are sorted in ascending order. | + **unnamed** | **bool** | If `true` or `1` then all the storages are returned. By default, only named storages are returned. | + **ownership** | [**StorageOwnership**](StorageOwnership.md) | Filter by ownership. If this parameter is omitted, all accessible key-value stores are returned. - `ownedByMe`: Return only key-value stores owned by the user. - `sharedWithMe`: Return only key-value stores shared with the user by other users. | + +### Return type + +[**ListOfKeyValueStoresResponse**](ListOfKeyValueStoresResponse.md) + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## KeyValueStoresPost + +> KeyValueStoreResponse KeyValueStoresPost(ctx).Name(name).Execute() + +Create key-value store + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + name := "eshop-values" // string | Custom unique name to easily identify the store in the future. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.StorageKeyValueStoresAPI.KeyValueStoresPost(context.Background()).Name(name).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `StorageKeyValueStoresAPI.KeyValueStoresPost``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `KeyValueStoresPost`: KeyValueStoreResponse + fmt.Fprintf(os.Stdout, "Response from `StorageKeyValueStoresAPI.KeyValueStoresPost`: %v\n", resp) +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiKeyValueStoresPostRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **name** | **string** | Custom unique name to easily identify the store in the future. | + +### Return type + +[**KeyValueStoreResponse**](KeyValueStoreResponse.md) + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/docs/StorageOwnership.md b/docs/StorageOwnership.md new file mode 100644 index 0000000..f2a49c2 --- /dev/null +++ b/docs/StorageOwnership.md @@ -0,0 +1,13 @@ +# StorageOwnership + +## Enum + + +* `OWNED_BY_ME` (value: `"ownedByMe"`) + +* `SHARED_WITH_ME` (value: `"sharedWithMe"`) + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/StorageRequestQueuesAPI.md b/docs/StorageRequestQueuesAPI.md new file mode 100644 index 0000000..b011785 --- /dev/null +++ b/docs/StorageRequestQueuesAPI.md @@ -0,0 +1,517 @@ +# \StorageRequestQueuesAPI + +All URIs are relative to *https://api.apify.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**RequestQueueDelete**](StorageRequestQueuesAPI.md#RequestQueueDelete) | **Delete** /v2/request-queues/{queueId} | Delete request queue +[**RequestQueueGet**](StorageRequestQueuesAPI.md#RequestQueueGet) | **Get** /v2/request-queues/{queueId} | Get request queue +[**RequestQueuePut**](StorageRequestQueuesAPI.md#RequestQueuePut) | **Put** /v2/request-queues/{queueId} | Update request queue +[**RequestQueueRequestsBatchDelete**](StorageRequestQueuesAPI.md#RequestQueueRequestsBatchDelete) | **Delete** /v2/request-queues/{queueId}/requests/batch | Delete requests +[**RequestQueueRequestsBatchPost**](StorageRequestQueuesAPI.md#RequestQueueRequestsBatchPost) | **Post** /v2/request-queues/{queueId}/requests/batch | Add requests +[**RequestQueuesGet**](StorageRequestQueuesAPI.md#RequestQueuesGet) | **Get** /v2/request-queues | Get list of request queues +[**RequestQueuesPost**](StorageRequestQueuesAPI.md#RequestQueuesPost) | **Post** /v2/request-queues | Create request queue + + + +## RequestQueueDelete + +> RequestQueueDelete(ctx, queueId).Execute() + +Delete request queue + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + queueId := "WkzbQMuFYuamGv3YF" // string | Queue ID or `username~queue-name`. + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + r, err := apiClient.StorageRequestQueuesAPI.RequestQueueDelete(context.Background(), queueId).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `StorageRequestQueuesAPI.RequestQueueDelete``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**queueId** | **string** | Queue ID or `username~queue-name`. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiRequestQueueDeleteRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + +### Return type + + (empty response body) + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## RequestQueueGet + +> RequestQueueResponse RequestQueueGet(ctx, queueId).Execute() + +Get request queue + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + queueId := "WkzbQMuFYuamGv3YF" // string | Queue ID or `username~queue-name`. + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.StorageRequestQueuesAPI.RequestQueueGet(context.Background(), queueId).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `StorageRequestQueuesAPI.RequestQueueGet``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `RequestQueueGet`: RequestQueueResponse + fmt.Fprintf(os.Stdout, "Response from `StorageRequestQueuesAPI.RequestQueueGet`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**queueId** | **string** | Queue ID or `username~queue-name`. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiRequestQueueGetRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + +### Return type + +[**RequestQueueResponse**](RequestQueueResponse.md) + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## RequestQueuePut + +> RequestQueueResponse RequestQueuePut(ctx, queueId).UpdateRequestQueueRequest(updateRequestQueueRequest).Execute() + +Update request queue + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + queueId := "WkzbQMuFYuamGv3YF" // string | Queue ID or `username~queue-name`. + updateRequestQueueRequest := *openapiclient.NewUpdateRequestQueueRequest() // UpdateRequestQueueRequest | + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.StorageRequestQueuesAPI.RequestQueuePut(context.Background(), queueId).UpdateRequestQueueRequest(updateRequestQueueRequest).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `StorageRequestQueuesAPI.RequestQueuePut``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `RequestQueuePut`: RequestQueueResponse + fmt.Fprintf(os.Stdout, "Response from `StorageRequestQueuesAPI.RequestQueuePut`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**queueId** | **string** | Queue ID or `username~queue-name`. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiRequestQueuePutRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **updateRequestQueueRequest** | [**UpdateRequestQueueRequest**](UpdateRequestQueueRequest.md) | | + +### Return type + +[**RequestQueueResponse**](RequestQueueResponse.md) + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## RequestQueueRequestsBatchDelete + +> BatchDeleteResponse RequestQueueRequestsBatchDelete(ctx, queueId).ContentType(contentType).RequestDraftDelete(requestDraftDelete).ClientKey(clientKey).Execute() + +Delete requests + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + queueId := "WkzbQMuFYuamGv3YF" // string | Queue ID or `username~queue-name`. + contentType := "contentType_example" // string | + requestDraftDelete := []openapiclient.RequestDraftDelete{*openapiclient.NewRequestDraftDelete("Id_example", "UniqueKey_example")} // []RequestDraftDelete | + clientKey := "client-abc" // string | A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.StorageRequestQueuesAPI.RequestQueueRequestsBatchDelete(context.Background(), queueId).ContentType(contentType).RequestDraftDelete(requestDraftDelete).ClientKey(clientKey).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `StorageRequestQueuesAPI.RequestQueueRequestsBatchDelete``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `RequestQueueRequestsBatchDelete`: BatchDeleteResponse + fmt.Fprintf(os.Stdout, "Response from `StorageRequestQueuesAPI.RequestQueueRequestsBatchDelete`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**queueId** | **string** | Queue ID or `username~queue-name`. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiRequestQueueRequestsBatchDeleteRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **contentType** | **string** | | + **requestDraftDelete** | [**[]RequestDraftDelete**](RequestDraftDelete.md) | | + **clientKey** | **string** | A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. | + +### Return type + +[**BatchDeleteResponse**](BatchDeleteResponse.md) + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## RequestQueueRequestsBatchPost + +> BatchAddResponse RequestQueueRequestsBatchPost(ctx, queueId).RequestBase(requestBase).ClientKey(clientKey).Forefront(forefront).Execute() + +Add requests + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + queueId := "WkzbQMuFYuamGv3YF" // string | Queue ID or `username~queue-name`. + requestBase := []openapiclient.RequestBase{*openapiclient.NewRequestBase()} // []RequestBase | + clientKey := "client-abc" // string | A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. (optional) + forefront := "false" // string | Determines if request should be added to the head of the queue or to the end. Default value is `false` (end of queue). (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.StorageRequestQueuesAPI.RequestQueueRequestsBatchPost(context.Background(), queueId).RequestBase(requestBase).ClientKey(clientKey).Forefront(forefront).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `StorageRequestQueuesAPI.RequestQueueRequestsBatchPost``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `RequestQueueRequestsBatchPost`: BatchAddResponse + fmt.Fprintf(os.Stdout, "Response from `StorageRequestQueuesAPI.RequestQueueRequestsBatchPost`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**queueId** | **string** | Queue ID or `username~queue-name`. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiRequestQueueRequestsBatchPostRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **requestBase** | [**[]RequestBase**](RequestBase.md) | | + **clientKey** | **string** | A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. | + **forefront** | **string** | Determines if request should be added to the head of the queue or to the end. Default value is `false` (end of queue). | + +### Return type + +[**BatchAddResponse**](BatchAddResponse.md) + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## RequestQueuesGet + +> ListOfRequestQueuesResponse RequestQueuesGet(ctx).Offset(offset).Limit(limit).Desc(desc).Unnamed(unnamed).Ownership(ownership).Execute() + +Get list of request queues + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + offset := float64(0) // float64 | Number of items that should be skipped at the start. The default value is `0`. (optional) + limit := float64(1000) // float64 | Maximum number of items to return. The default value as well as the maximum is `1000`. (optional) + desc := true // bool | If `true` or `1` then the objects are sorted by the `createdAt` field in descending order. By default, they are sorted in ascending order. (optional) + unnamed := true // bool | If `true` or `1` then all the storages are returned. By default, only named storages are returned. (optional) + ownership := openapiclient.StorageOwnership("ownedByMe") // StorageOwnership | Filter by ownership. If this parameter is omitted, all accessible request queues are returned. - `ownedByMe`: Return only request queues owned by the user. - `sharedWithMe`: Return only request queues shared with the user by other users. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.StorageRequestQueuesAPI.RequestQueuesGet(context.Background()).Offset(offset).Limit(limit).Desc(desc).Unnamed(unnamed).Ownership(ownership).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `StorageRequestQueuesAPI.RequestQueuesGet``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `RequestQueuesGet`: ListOfRequestQueuesResponse + fmt.Fprintf(os.Stdout, "Response from `StorageRequestQueuesAPI.RequestQueuesGet`: %v\n", resp) +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiRequestQueuesGetRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **offset** | **float64** | Number of items that should be skipped at the start. The default value is `0`. | + **limit** | **float64** | Maximum number of items to return. The default value as well as the maximum is `1000`. | + **desc** | **bool** | If `true` or `1` then the objects are sorted by the `createdAt` field in descending order. By default, they are sorted in ascending order. | + **unnamed** | **bool** | If `true` or `1` then all the storages are returned. By default, only named storages are returned. | + **ownership** | [**StorageOwnership**](StorageOwnership.md) | Filter by ownership. If this parameter is omitted, all accessible request queues are returned. - `ownedByMe`: Return only request queues owned by the user. - `sharedWithMe`: Return only request queues shared with the user by other users. | + +### Return type + +[**ListOfRequestQueuesResponse**](ListOfRequestQueuesResponse.md) + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## RequestQueuesPost + +> RequestQueueResponse RequestQueuesPost(ctx).Name(name).Execute() + +Create request queue + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + name := "example-com" // string | Custom unique name to easily identify the queue in the future. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.StorageRequestQueuesAPI.RequestQueuesPost(context.Background()).Name(name).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `StorageRequestQueuesAPI.RequestQueuesPost``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `RequestQueuesPost`: RequestQueueResponse + fmt.Fprintf(os.Stdout, "Response from `StorageRequestQueuesAPI.RequestQueuesPost`: %v\n", resp) +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiRequestQueuesPostRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **name** | **string** | Custom unique name to easily identify the queue in the future. | + +### Return type + +[**RequestQueueResponse**](RequestQueueResponse.md) + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/docs/StorageRequestQueuesRequestsAPI.md b/docs/StorageRequestQueuesRequestsAPI.md new file mode 100644 index 0000000..32e430c --- /dev/null +++ b/docs/StorageRequestQueuesRequestsAPI.md @@ -0,0 +1,394 @@ +# \StorageRequestQueuesRequestsAPI + +All URIs are relative to *https://api.apify.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**RequestQueueRequestDelete**](StorageRequestQueuesRequestsAPI.md#RequestQueueRequestDelete) | **Delete** /v2/request-queues/{queueId}/requests/{requestId} | Delete request +[**RequestQueueRequestGet**](StorageRequestQueuesRequestsAPI.md#RequestQueueRequestGet) | **Get** /v2/request-queues/{queueId}/requests/{requestId} | Get request +[**RequestQueueRequestPut**](StorageRequestQueuesRequestsAPI.md#RequestQueueRequestPut) | **Put** /v2/request-queues/{queueId}/requests/{requestId} | Update request +[**RequestQueueRequestsGet**](StorageRequestQueuesRequestsAPI.md#RequestQueueRequestsGet) | **Get** /v2/request-queues/{queueId}/requests | List requests +[**RequestQueueRequestsPost**](StorageRequestQueuesRequestsAPI.md#RequestQueueRequestsPost) | **Post** /v2/request-queues/{queueId}/requests | Add request + + + +## RequestQueueRequestDelete + +> RequestQueueRequestDelete(ctx, queueId, requestId).ClientKey(clientKey).Execute() + +Delete request + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + queueId := "WkzbQMuFYuamGv3YF" // string | Queue ID or `username~queue-name`. + requestId := "xpsmkDlspokDSmklS" // string | Request ID. + clientKey := "client-abc" // string | A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + r, err := apiClient.StorageRequestQueuesRequestsAPI.RequestQueueRequestDelete(context.Background(), queueId, requestId).ClientKey(clientKey).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `StorageRequestQueuesRequestsAPI.RequestQueueRequestDelete``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**queueId** | **string** | Queue ID or `username~queue-name`. | +**requestId** | **string** | Request ID. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiRequestQueueRequestDeleteRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + **clientKey** | **string** | A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. | + +### Return type + + (empty response body) + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## RequestQueueRequestGet + +> RequestResponse RequestQueueRequestGet(ctx, queueId, requestId).Execute() + +Get request + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + queueId := "WkzbQMuFYuamGv3YF" // string | Queue ID or `username~queue-name`. + requestId := "xpsmkDlspokDSmklS" // string | Request ID. + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.StorageRequestQueuesRequestsAPI.RequestQueueRequestGet(context.Background(), queueId, requestId).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `StorageRequestQueuesRequestsAPI.RequestQueueRequestGet``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `RequestQueueRequestGet`: RequestResponse + fmt.Fprintf(os.Stdout, "Response from `StorageRequestQueuesRequestsAPI.RequestQueueRequestGet`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**queueId** | **string** | Queue ID or `username~queue-name`. | +**requestId** | **string** | Request ID. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiRequestQueueRequestGetRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + +### Return type + +[**RequestResponse**](RequestResponse.md) + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## RequestQueueRequestPut + +> UpdateRequestResponse RequestQueueRequestPut(ctx, queueId, requestId).Request(request).Forefront(forefront).ClientKey(clientKey).Execute() + +Update request + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + queueId := "WkzbQMuFYuamGv3YF" // string | Queue ID or `username~queue-name`. + requestId := "xpsmkDlspokDSmklS" // string | Request ID. + request := *openapiclient.NewRequest() // Request | + forefront := "false" // string | Determines if request should be added to the head of the queue or to the end. Default value is `false` (end of queue). (optional) + clientKey := "client-abc" // string | A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.StorageRequestQueuesRequestsAPI.RequestQueueRequestPut(context.Background(), queueId, requestId).Request(request).Forefront(forefront).ClientKey(clientKey).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `StorageRequestQueuesRequestsAPI.RequestQueueRequestPut``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `RequestQueueRequestPut`: UpdateRequestResponse + fmt.Fprintf(os.Stdout, "Response from `StorageRequestQueuesRequestsAPI.RequestQueueRequestPut`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**queueId** | **string** | Queue ID or `username~queue-name`. | +**requestId** | **string** | Request ID. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiRequestQueueRequestPutRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + **request** | [**Request**](Request.md) | | + **forefront** | **string** | Determines if request should be added to the head of the queue or to the end. Default value is `false` (end of queue). | + **clientKey** | **string** | A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. | + +### Return type + +[**UpdateRequestResponse**](UpdateRequestResponse.md) + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## RequestQueueRequestsGet + +> ListOfRequestsResponse RequestQueueRequestsGet(ctx, queueId).ClientKey(clientKey).ExclusiveStartId(exclusiveStartId).Limit(limit).Cursor(cursor).Filter(filter).Execute() + +List requests + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + queueId := "WkzbQMuFYuamGv3YF" // string | Queue ID or `username~queue-name`. + clientKey := "client-abc" // string | A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. (optional) + exclusiveStartId := "Ihnsp8YrvJ8102Kj" // string | All requests up to this one (including) are skipped from the result. (Deprecated, use `cursor` instead.) (optional) + limit := float64(100) // float64 | Number of keys to be returned. Maximum value is `10000`. (optional) + cursor := "eyJyZXF1ZXN0SWQiOiI2OFRqQ2RaTDNvM2hiUU0ifQ" // string | A cursor string for pagination, returned in the previous response as `nextCursor`. Use this to retrieve the next page of requests. (optional) + filter := []string{"Filter_example"} // []string | Filter requests by their state. Possible values are `locked` and `pending`. You can combine multiple values separated by commas, which will mean the union of these filters – requests matching any of the specified states will be returned. (Not compatible with deprecated `exclusiveStartId` parameter.) (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.StorageRequestQueuesRequestsAPI.RequestQueueRequestsGet(context.Background(), queueId).ClientKey(clientKey).ExclusiveStartId(exclusiveStartId).Limit(limit).Cursor(cursor).Filter(filter).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `StorageRequestQueuesRequestsAPI.RequestQueueRequestsGet``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `RequestQueueRequestsGet`: ListOfRequestsResponse + fmt.Fprintf(os.Stdout, "Response from `StorageRequestQueuesRequestsAPI.RequestQueueRequestsGet`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**queueId** | **string** | Queue ID or `username~queue-name`. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiRequestQueueRequestsGetRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **clientKey** | **string** | A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. | + **exclusiveStartId** | **string** | All requests up to this one (including) are skipped from the result. (Deprecated, use `cursor` instead.) | + **limit** | **float64** | Number of keys to be returned. Maximum value is `10000`. | + **cursor** | **string** | A cursor string for pagination, returned in the previous response as `nextCursor`. Use this to retrieve the next page of requests. | + **filter** | **[]string** | Filter requests by their state. Possible values are `locked` and `pending`. You can combine multiple values separated by commas, which will mean the union of these filters – requests matching any of the specified states will be returned. (Not compatible with deprecated `exclusiveStartId` parameter.) | + +### Return type + +[**ListOfRequestsResponse**](ListOfRequestsResponse.md) + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## RequestQueueRequestsPost + +> AddRequestResponse RequestQueueRequestsPost(ctx, queueId).RequestBase(requestBase).ClientKey(clientKey).Forefront(forefront).Execute() + +Add request + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + queueId := "WkzbQMuFYuamGv3YF" // string | Queue ID or `username~queue-name`. + requestBase := *openapiclient.NewRequestBase() // RequestBase | + clientKey := "client-abc" // string | A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. (optional) + forefront := "false" // string | Determines if request should be added to the head of the queue or to the end. Default value is `false` (end of queue). (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.StorageRequestQueuesRequestsAPI.RequestQueueRequestsPost(context.Background(), queueId).RequestBase(requestBase).ClientKey(clientKey).Forefront(forefront).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `StorageRequestQueuesRequestsAPI.RequestQueueRequestsPost``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `RequestQueueRequestsPost`: AddRequestResponse + fmt.Fprintf(os.Stdout, "Response from `StorageRequestQueuesRequestsAPI.RequestQueueRequestsPost`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**queueId** | **string** | Queue ID or `username~queue-name`. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiRequestQueueRequestsPostRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **requestBase** | [**RequestBase**](RequestBase.md) | | + **clientKey** | **string** | A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. | + **forefront** | **string** | Determines if request should be added to the head of the queue or to the end. Default value is `false` (end of queue). | + +### Return type + +[**AddRequestResponse**](AddRequestResponse.md) + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/docs/StorageRequestQueuesRequestsLocksAPI.md b/docs/StorageRequestQueuesRequestsLocksAPI.md new file mode 100644 index 0000000..e503dd7 --- /dev/null +++ b/docs/StorageRequestQueuesRequestsLocksAPI.md @@ -0,0 +1,389 @@ +# \StorageRequestQueuesRequestsLocksAPI + +All URIs are relative to *https://api.apify.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**RequestQueueHeadGet**](StorageRequestQueuesRequestsLocksAPI.md#RequestQueueHeadGet) | **Get** /v2/request-queues/{queueId}/head | Get head +[**RequestQueueHeadLockPost**](StorageRequestQueuesRequestsLocksAPI.md#RequestQueueHeadLockPost) | **Post** /v2/request-queues/{queueId}/head/lock | Get head and lock +[**RequestQueueRequestLockDelete**](StorageRequestQueuesRequestsLocksAPI.md#RequestQueueRequestLockDelete) | **Delete** /v2/request-queues/{queueId}/requests/{requestId}/lock | Delete request lock +[**RequestQueueRequestLockPut**](StorageRequestQueuesRequestsLocksAPI.md#RequestQueueRequestLockPut) | **Put** /v2/request-queues/{queueId}/requests/{requestId}/lock | Prolong request lock +[**RequestQueueRequestsUnlockPost**](StorageRequestQueuesRequestsLocksAPI.md#RequestQueueRequestsUnlockPost) | **Post** /v2/request-queues/{queueId}/requests/unlock | Unlock requests + + + +## RequestQueueHeadGet + +> HeadResponse RequestQueueHeadGet(ctx, queueId).Limit(limit).ClientKey(clientKey).Execute() + +Get head + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + queueId := "WkzbQMuFYuamGv3YF" // string | Queue ID or `username~queue-name`. + limit := float64(100) // float64 | How many items from queue should be returned. (optional) + clientKey := "client-abc" // string | A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.StorageRequestQueuesRequestsLocksAPI.RequestQueueHeadGet(context.Background(), queueId).Limit(limit).ClientKey(clientKey).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `StorageRequestQueuesRequestsLocksAPI.RequestQueueHeadGet``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `RequestQueueHeadGet`: HeadResponse + fmt.Fprintf(os.Stdout, "Response from `StorageRequestQueuesRequestsLocksAPI.RequestQueueHeadGet`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**queueId** | **string** | Queue ID or `username~queue-name`. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiRequestQueueHeadGetRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **limit** | **float64** | How many items from queue should be returned. | + **clientKey** | **string** | A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. | + +### Return type + +[**HeadResponse**](HeadResponse.md) + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## RequestQueueHeadLockPost + +> HeadAndLockResponse RequestQueueHeadLockPost(ctx, queueId).LockSecs(lockSecs).Limit(limit).ClientKey(clientKey).Execute() + +Get head and lock + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + queueId := "WkzbQMuFYuamGv3YF" // string | Queue ID or `username~queue-name`. + lockSecs := float64(60) // float64 | How long the requests will be locked for (in seconds). + limit := float64(25) // float64 | How many items from the queue should be returned. (optional) + clientKey := "client-abc" // string | A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.StorageRequestQueuesRequestsLocksAPI.RequestQueueHeadLockPost(context.Background(), queueId).LockSecs(lockSecs).Limit(limit).ClientKey(clientKey).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `StorageRequestQueuesRequestsLocksAPI.RequestQueueHeadLockPost``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `RequestQueueHeadLockPost`: HeadAndLockResponse + fmt.Fprintf(os.Stdout, "Response from `StorageRequestQueuesRequestsLocksAPI.RequestQueueHeadLockPost`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**queueId** | **string** | Queue ID or `username~queue-name`. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiRequestQueueHeadLockPostRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **lockSecs** | **float64** | How long the requests will be locked for (in seconds). | + **limit** | **float64** | How many items from the queue should be returned. | + **clientKey** | **string** | A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. | + +### Return type + +[**HeadAndLockResponse**](HeadAndLockResponse.md) + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## RequestQueueRequestLockDelete + +> RequestQueueRequestLockDelete(ctx, queueId, requestId).ClientKey(clientKey).Forefront(forefront).Execute() + +Delete request lock + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + queueId := "WkzbQMuFYuamGv3YF" // string | Queue ID or `username~queue-name`. + requestId := "xpsmkDlspokDSmklS" // string | Request ID. + clientKey := "client-abc" // string | A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. (optional) + forefront := "false" // string | Determines if request should be added to the head of the queue or to the end after lock was removed. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + r, err := apiClient.StorageRequestQueuesRequestsLocksAPI.RequestQueueRequestLockDelete(context.Background(), queueId, requestId).ClientKey(clientKey).Forefront(forefront).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `StorageRequestQueuesRequestsLocksAPI.RequestQueueRequestLockDelete``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**queueId** | **string** | Queue ID or `username~queue-name`. | +**requestId** | **string** | Request ID. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiRequestQueueRequestLockDeleteRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + **clientKey** | **string** | A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. | + **forefront** | **string** | Determines if request should be added to the head of the queue or to the end after lock was removed. | + +### Return type + + (empty response body) + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## RequestQueueRequestLockPut + +> ProlongRequestLockResponse RequestQueueRequestLockPut(ctx, queueId, requestId).LockSecs(lockSecs).ClientKey(clientKey).Forefront(forefront).Execute() + +Prolong request lock + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + queueId := "WkzbQMuFYuamGv3YF" // string | Queue ID or `username~queue-name`. + requestId := "xpsmkDlspokDSmklS" // string | Request ID. + lockSecs := float64(60) // float64 | How long the requests will be locked for (in seconds). + clientKey := "client-abc" // string | A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. (optional) + forefront := "false" // string | Determines if request should be added to the head of the queue or to the end after lock expires. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.StorageRequestQueuesRequestsLocksAPI.RequestQueueRequestLockPut(context.Background(), queueId, requestId).LockSecs(lockSecs).ClientKey(clientKey).Forefront(forefront).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `StorageRequestQueuesRequestsLocksAPI.RequestQueueRequestLockPut``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `RequestQueueRequestLockPut`: ProlongRequestLockResponse + fmt.Fprintf(os.Stdout, "Response from `StorageRequestQueuesRequestsLocksAPI.RequestQueueRequestLockPut`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**queueId** | **string** | Queue ID or `username~queue-name`. | +**requestId** | **string** | Request ID. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiRequestQueueRequestLockPutRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + **lockSecs** | **float64** | How long the requests will be locked for (in seconds). | + **clientKey** | **string** | A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. | + **forefront** | **string** | Determines if request should be added to the head of the queue or to the end after lock expires. | + +### Return type + +[**ProlongRequestLockResponse**](ProlongRequestLockResponse.md) + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## RequestQueueRequestsUnlockPost + +> UnlockRequestsResponse RequestQueueRequestsUnlockPost(ctx, queueId).ClientKey(clientKey).Execute() + +Unlock requests + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + queueId := "WkzbQMuFYuamGv3YF" // string | Queue ID or `username~queue-name`. + clientKey := "client-abc" // string | A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.StorageRequestQueuesRequestsLocksAPI.RequestQueueRequestsUnlockPost(context.Background(), queueId).ClientKey(clientKey).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `StorageRequestQueuesRequestsLocksAPI.RequestQueueRequestsUnlockPost``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `RequestQueueRequestsUnlockPost`: UnlockRequestsResponse + fmt.Fprintf(os.Stdout, "Response from `StorageRequestQueuesRequestsLocksAPI.RequestQueueRequestsUnlockPost`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**queueId** | **string** | Queue ID or `username~queue-name`. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiRequestQueueRequestsUnlockPostRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **clientKey** | **string** | A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. | + +### Return type + +[**UnlockRequestsResponse**](UnlockRequestsResponse.md) + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/docs/StoreAPI.md b/docs/StoreAPI.md new file mode 100644 index 0000000..3569099 --- /dev/null +++ b/docs/StoreAPI.md @@ -0,0 +1,93 @@ +# \StoreAPI + +All URIs are relative to *https://api.apify.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**StoreGet**](StoreAPI.md#StoreGet) | **Get** /v2/store | Get list of Actors in Store + + + +## StoreGet + +> ListOfActorsInStoreResponse StoreGet(ctx).Limit(limit).Offset(offset).Search(search).SortBy(sortBy).Category(category).Username(username).PricingModel(pricingModel).AllowsAgenticUsers(allowsAgenticUsers).ResponseFormat(responseFormat).IncludeUnrunnableActors(includeUnrunnableActors).Execute() + +Get list of Actors in Store + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + limit := float64(1000) // float64 | Maximum number of items to return. The default value as well as the maximum is `1000`. (optional) + offset := float64(0) // float64 | Number of items that should be skipped at the start. The default value is `0`. (optional) + search := "web scraper" // string | String to search by. The search runs on the following fields: `title`, `name`, `description`, `username`, `readme`. (optional) + sortBy := "'popularity'" // string | Specifies the field by which to sort the results. The supported values are `relevance` (default), `popularity`, `newest` and `lastUpdate`. (optional) + category := "'AI'" // string | Filters the results by the specified category. (optional) + username := "'apify'" // string | Filters the results by the specified username. (optional) + pricingModel := "FREE" // string | Only return Actors with the specified pricing model. (optional) + allowsAgenticUsers := true // bool | If true, only return Actors that allow agentic users. If false, only return Actors that do not allow agentic users. (optional) + responseFormat := "agent" // string | Controls the shape of the response. Use `full` (default) for the complete response including image URLs and all fields. Use `agent` for a reduced field set optimized for LLM consumers, which only includes `id`, `title`, `name`, `username`, `description`, `notice`, `badge`, `categories`, and minimal `stats`. (optional) (default to "full") + includeUnrunnableActors := true // bool | By default, search results exclude Actors that are not safe to run automatically (e.g. Actors from developers who haven't passed KYC, or full-permission Actors without a large user base). Set to `true` to bypass this safety filtering and include all Actors in the results. (optional) (default to false) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.StoreAPI.StoreGet(context.Background()).Limit(limit).Offset(offset).Search(search).SortBy(sortBy).Category(category).Username(username).PricingModel(pricingModel).AllowsAgenticUsers(allowsAgenticUsers).ResponseFormat(responseFormat).IncludeUnrunnableActors(includeUnrunnableActors).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `StoreAPI.StoreGet``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `StoreGet`: ListOfActorsInStoreResponse + fmt.Fprintf(os.Stdout, "Response from `StoreAPI.StoreGet`: %v\n", resp) +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiStoreGetRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **limit** | **float64** | Maximum number of items to return. The default value as well as the maximum is `1000`. | + **offset** | **float64** | Number of items that should be skipped at the start. The default value is `0`. | + **search** | **string** | String to search by. The search runs on the following fields: `title`, `name`, `description`, `username`, `readme`. | + **sortBy** | **string** | Specifies the field by which to sort the results. The supported values are `relevance` (default), `popularity`, `newest` and `lastUpdate`. | + **category** | **string** | Filters the results by the specified category. | + **username** | **string** | Filters the results by the specified username. | + **pricingModel** | **string** | Only return Actors with the specified pricing model. | + **allowsAgenticUsers** | **bool** | If true, only return Actors that allow agentic users. If false, only return Actors that do not allow agentic users. | + **responseFormat** | **string** | Controls the shape of the response. Use `full` (default) for the complete response including image URLs and all fields. Use `agent` for a reduced field set optimized for LLM consumers, which only includes `id`, `title`, `name`, `username`, `description`, `notice`, `badge`, `categories`, and minimal `stats`. | [default to "full"] + **includeUnrunnableActors** | **bool** | By default, search results exclude Actors that are not safe to run automatically (e.g. Actors from developers who haven't passed KYC, or full-permission Actors without a large user base). Set to `true` to bypass this safety filtering and include all Actors in the results. | [default to false] + +### Return type + +[**ListOfActorsInStoreResponse**](ListOfActorsInStoreResponse.md) + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/docs/StoreListActor.md b/docs/StoreListActor.md new file mode 100644 index 0000000..f83ee81 --- /dev/null +++ b/docs/StoreListActor.md @@ -0,0 +1,534 @@ +# StoreListActor + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **string** | | +**Title** | **string** | | +**Name** | **string** | | +**Username** | **string** | | +**UserFullName** | **string** | | +**Description** | **string** | | +**Categories** | Pointer to **[]string** | | [optional] +**Notice** | Pointer to **string** | | [optional] +**PictureUrl** | Pointer to **NullableString** | | [optional] +**UserPictureUrl** | Pointer to **NullableString** | | [optional] +**Url** | Pointer to **NullableString** | | [optional] +**Stats** | [**ActorStats**](ActorStats.md) | | +**CurrentPricingInfo** | [**CurrentPricingInfo**](CurrentPricingInfo.md) | | +**IsWhiteListedForAgenticPayments** | Pointer to **NullableBool** | Whether the Actor is whitelisted for agentic payment processing. | [optional] +**ActorReviewCount** | Pointer to **int32** | | [optional] +**ActorReviewRating** | Pointer to **float32** | | [optional] +**BookmarkCount** | Pointer to **int32** | | [optional] +**Badge** | Pointer to **NullableString** | | [optional] +**ReadmeSummary** | Pointer to **string** | A brief, LLM-generated readme summary | [optional] + +## Methods + +### NewStoreListActor + +`func NewStoreListActor(id string, title string, name string, username string, userFullName string, description string, stats ActorStats, currentPricingInfo CurrentPricingInfo, ) *StoreListActor` + +NewStoreListActor instantiates a new StoreListActor object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewStoreListActorWithDefaults + +`func NewStoreListActorWithDefaults() *StoreListActor` + +NewStoreListActorWithDefaults instantiates a new StoreListActor object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetId + +`func (o *StoreListActor) GetId() string` + +GetId returns the Id field if non-nil, zero value otherwise. + +### GetIdOk + +`func (o *StoreListActor) GetIdOk() (*string, bool)` + +GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetId + +`func (o *StoreListActor) SetId(v string)` + +SetId sets Id field to given value. + + +### GetTitle + +`func (o *StoreListActor) GetTitle() string` + +GetTitle returns the Title field if non-nil, zero value otherwise. + +### GetTitleOk + +`func (o *StoreListActor) GetTitleOk() (*string, bool)` + +GetTitleOk returns a tuple with the Title field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTitle + +`func (o *StoreListActor) SetTitle(v string)` + +SetTitle sets Title field to given value. + + +### GetName + +`func (o *StoreListActor) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *StoreListActor) GetNameOk() (*string, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetName + +`func (o *StoreListActor) SetName(v string)` + +SetName sets Name field to given value. + + +### GetUsername + +`func (o *StoreListActor) GetUsername() string` + +GetUsername returns the Username field if non-nil, zero value otherwise. + +### GetUsernameOk + +`func (o *StoreListActor) GetUsernameOk() (*string, bool)` + +GetUsernameOk returns a tuple with the Username field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUsername + +`func (o *StoreListActor) SetUsername(v string)` + +SetUsername sets Username field to given value. + + +### GetUserFullName + +`func (o *StoreListActor) GetUserFullName() string` + +GetUserFullName returns the UserFullName field if non-nil, zero value otherwise. + +### GetUserFullNameOk + +`func (o *StoreListActor) GetUserFullNameOk() (*string, bool)` + +GetUserFullNameOk returns a tuple with the UserFullName field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUserFullName + +`func (o *StoreListActor) SetUserFullName(v string)` + +SetUserFullName sets UserFullName field to given value. + + +### GetDescription + +`func (o *StoreListActor) GetDescription() string` + +GetDescription returns the Description field if non-nil, zero value otherwise. + +### GetDescriptionOk + +`func (o *StoreListActor) GetDescriptionOk() (*string, bool)` + +GetDescriptionOk returns a tuple with the Description field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDescription + +`func (o *StoreListActor) SetDescription(v string)` + +SetDescription sets Description field to given value. + + +### GetCategories + +`func (o *StoreListActor) GetCategories() []string` + +GetCategories returns the Categories field if non-nil, zero value otherwise. + +### GetCategoriesOk + +`func (o *StoreListActor) GetCategoriesOk() (*[]string, bool)` + +GetCategoriesOk returns a tuple with the Categories field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCategories + +`func (o *StoreListActor) SetCategories(v []string)` + +SetCategories sets Categories field to given value. + +### HasCategories + +`func (o *StoreListActor) HasCategories() bool` + +HasCategories returns a boolean if a field has been set. + +### GetNotice + +`func (o *StoreListActor) GetNotice() string` + +GetNotice returns the Notice field if non-nil, zero value otherwise. + +### GetNoticeOk + +`func (o *StoreListActor) GetNoticeOk() (*string, bool)` + +GetNoticeOk returns a tuple with the Notice field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetNotice + +`func (o *StoreListActor) SetNotice(v string)` + +SetNotice sets Notice field to given value. + +### HasNotice + +`func (o *StoreListActor) HasNotice() bool` + +HasNotice returns a boolean if a field has been set. + +### GetPictureUrl + +`func (o *StoreListActor) GetPictureUrl() string` + +GetPictureUrl returns the PictureUrl field if non-nil, zero value otherwise. + +### GetPictureUrlOk + +`func (o *StoreListActor) GetPictureUrlOk() (*string, bool)` + +GetPictureUrlOk returns a tuple with the PictureUrl field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPictureUrl + +`func (o *StoreListActor) SetPictureUrl(v string)` + +SetPictureUrl sets PictureUrl field to given value. + +### HasPictureUrl + +`func (o *StoreListActor) HasPictureUrl() bool` + +HasPictureUrl returns a boolean if a field has been set. + +### SetPictureUrlNil + +`func (o *StoreListActor) SetPictureUrlNil(b bool)` + + SetPictureUrlNil sets the value for PictureUrl to be an explicit nil + +### UnsetPictureUrl +`func (o *StoreListActor) UnsetPictureUrl()` + +UnsetPictureUrl ensures that no value is present for PictureUrl, not even an explicit nil +### GetUserPictureUrl + +`func (o *StoreListActor) GetUserPictureUrl() string` + +GetUserPictureUrl returns the UserPictureUrl field if non-nil, zero value otherwise. + +### GetUserPictureUrlOk + +`func (o *StoreListActor) GetUserPictureUrlOk() (*string, bool)` + +GetUserPictureUrlOk returns a tuple with the UserPictureUrl field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUserPictureUrl + +`func (o *StoreListActor) SetUserPictureUrl(v string)` + +SetUserPictureUrl sets UserPictureUrl field to given value. + +### HasUserPictureUrl + +`func (o *StoreListActor) HasUserPictureUrl() bool` + +HasUserPictureUrl returns a boolean if a field has been set. + +### SetUserPictureUrlNil + +`func (o *StoreListActor) SetUserPictureUrlNil(b bool)` + + SetUserPictureUrlNil sets the value for UserPictureUrl to be an explicit nil + +### UnsetUserPictureUrl +`func (o *StoreListActor) UnsetUserPictureUrl()` + +UnsetUserPictureUrl ensures that no value is present for UserPictureUrl, not even an explicit nil +### GetUrl + +`func (o *StoreListActor) GetUrl() string` + +GetUrl returns the Url field if non-nil, zero value otherwise. + +### GetUrlOk + +`func (o *StoreListActor) GetUrlOk() (*string, bool)` + +GetUrlOk returns a tuple with the Url field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUrl + +`func (o *StoreListActor) SetUrl(v string)` + +SetUrl sets Url field to given value. + +### HasUrl + +`func (o *StoreListActor) HasUrl() bool` + +HasUrl returns a boolean if a field has been set. + +### SetUrlNil + +`func (o *StoreListActor) SetUrlNil(b bool)` + + SetUrlNil sets the value for Url to be an explicit nil + +### UnsetUrl +`func (o *StoreListActor) UnsetUrl()` + +UnsetUrl ensures that no value is present for Url, not even an explicit nil +### GetStats + +`func (o *StoreListActor) GetStats() ActorStats` + +GetStats returns the Stats field if non-nil, zero value otherwise. + +### GetStatsOk + +`func (o *StoreListActor) GetStatsOk() (*ActorStats, bool)` + +GetStatsOk returns a tuple with the Stats field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetStats + +`func (o *StoreListActor) SetStats(v ActorStats)` + +SetStats sets Stats field to given value. + + +### GetCurrentPricingInfo + +`func (o *StoreListActor) GetCurrentPricingInfo() CurrentPricingInfo` + +GetCurrentPricingInfo returns the CurrentPricingInfo field if non-nil, zero value otherwise. + +### GetCurrentPricingInfoOk + +`func (o *StoreListActor) GetCurrentPricingInfoOk() (*CurrentPricingInfo, bool)` + +GetCurrentPricingInfoOk returns a tuple with the CurrentPricingInfo field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCurrentPricingInfo + +`func (o *StoreListActor) SetCurrentPricingInfo(v CurrentPricingInfo)` + +SetCurrentPricingInfo sets CurrentPricingInfo field to given value. + + +### GetIsWhiteListedForAgenticPayments + +`func (o *StoreListActor) GetIsWhiteListedForAgenticPayments() bool` + +GetIsWhiteListedForAgenticPayments returns the IsWhiteListedForAgenticPayments field if non-nil, zero value otherwise. + +### GetIsWhiteListedForAgenticPaymentsOk + +`func (o *StoreListActor) GetIsWhiteListedForAgenticPaymentsOk() (*bool, bool)` + +GetIsWhiteListedForAgenticPaymentsOk returns a tuple with the IsWhiteListedForAgenticPayments field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetIsWhiteListedForAgenticPayments + +`func (o *StoreListActor) SetIsWhiteListedForAgenticPayments(v bool)` + +SetIsWhiteListedForAgenticPayments sets IsWhiteListedForAgenticPayments field to given value. + +### HasIsWhiteListedForAgenticPayments + +`func (o *StoreListActor) HasIsWhiteListedForAgenticPayments() bool` + +HasIsWhiteListedForAgenticPayments returns a boolean if a field has been set. + +### SetIsWhiteListedForAgenticPaymentsNil + +`func (o *StoreListActor) SetIsWhiteListedForAgenticPaymentsNil(b bool)` + + SetIsWhiteListedForAgenticPaymentsNil sets the value for IsWhiteListedForAgenticPayments to be an explicit nil + +### UnsetIsWhiteListedForAgenticPayments +`func (o *StoreListActor) UnsetIsWhiteListedForAgenticPayments()` + +UnsetIsWhiteListedForAgenticPayments ensures that no value is present for IsWhiteListedForAgenticPayments, not even an explicit nil +### GetActorReviewCount + +`func (o *StoreListActor) GetActorReviewCount() int32` + +GetActorReviewCount returns the ActorReviewCount field if non-nil, zero value otherwise. + +### GetActorReviewCountOk + +`func (o *StoreListActor) GetActorReviewCountOk() (*int32, bool)` + +GetActorReviewCountOk returns a tuple with the ActorReviewCount field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetActorReviewCount + +`func (o *StoreListActor) SetActorReviewCount(v int32)` + +SetActorReviewCount sets ActorReviewCount field to given value. + +### HasActorReviewCount + +`func (o *StoreListActor) HasActorReviewCount() bool` + +HasActorReviewCount returns a boolean if a field has been set. + +### GetActorReviewRating + +`func (o *StoreListActor) GetActorReviewRating() float32` + +GetActorReviewRating returns the ActorReviewRating field if non-nil, zero value otherwise. + +### GetActorReviewRatingOk + +`func (o *StoreListActor) GetActorReviewRatingOk() (*float32, bool)` + +GetActorReviewRatingOk returns a tuple with the ActorReviewRating field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetActorReviewRating + +`func (o *StoreListActor) SetActorReviewRating(v float32)` + +SetActorReviewRating sets ActorReviewRating field to given value. + +### HasActorReviewRating + +`func (o *StoreListActor) HasActorReviewRating() bool` + +HasActorReviewRating returns a boolean if a field has been set. + +### GetBookmarkCount + +`func (o *StoreListActor) GetBookmarkCount() int32` + +GetBookmarkCount returns the BookmarkCount field if non-nil, zero value otherwise. + +### GetBookmarkCountOk + +`func (o *StoreListActor) GetBookmarkCountOk() (*int32, bool)` + +GetBookmarkCountOk returns a tuple with the BookmarkCount field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetBookmarkCount + +`func (o *StoreListActor) SetBookmarkCount(v int32)` + +SetBookmarkCount sets BookmarkCount field to given value. + +### HasBookmarkCount + +`func (o *StoreListActor) HasBookmarkCount() bool` + +HasBookmarkCount returns a boolean if a field has been set. + +### GetBadge + +`func (o *StoreListActor) GetBadge() string` + +GetBadge returns the Badge field if non-nil, zero value otherwise. + +### GetBadgeOk + +`func (o *StoreListActor) GetBadgeOk() (*string, bool)` + +GetBadgeOk returns a tuple with the Badge field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetBadge + +`func (o *StoreListActor) SetBadge(v string)` + +SetBadge sets Badge field to given value. + +### HasBadge + +`func (o *StoreListActor) HasBadge() bool` + +HasBadge returns a boolean if a field has been set. + +### SetBadgeNil + +`func (o *StoreListActor) SetBadgeNil(b bool)` + + SetBadgeNil sets the value for Badge to be an explicit nil + +### UnsetBadge +`func (o *StoreListActor) UnsetBadge()` + +UnsetBadge ensures that no value is present for Badge, not even an explicit nil +### GetReadmeSummary + +`func (o *StoreListActor) GetReadmeSummary() string` + +GetReadmeSummary returns the ReadmeSummary field if non-nil, zero value otherwise. + +### GetReadmeSummaryOk + +`func (o *StoreListActor) GetReadmeSummaryOk() (*string, bool)` + +GetReadmeSummaryOk returns a tuple with the ReadmeSummary field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetReadmeSummary + +`func (o *StoreListActor) SetReadmeSummary(v string)` + +SetReadmeSummary sets ReadmeSummary field to given value. + +### HasReadmeSummary + +`func (o *StoreListActor) HasReadmeSummary() bool` + +HasReadmeSummary returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/TaggedBuildInfo.md b/docs/TaggedBuildInfo.md new file mode 100644 index 0000000..216e17e --- /dev/null +++ b/docs/TaggedBuildInfo.md @@ -0,0 +1,144 @@ +# TaggedBuildInfo + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**BuildId** | Pointer to **string** | The ID of the build associated with this tag. | [optional] +**BuildNumber** | Pointer to **string** | The build number/version string. | [optional] +**BuildNumberInt** | Pointer to **int32** | The build number encoded as a single integer. | [optional] +**FinishedAt** | Pointer to **NullableTime** | The timestamp when the build finished. | [optional] + +## Methods + +### NewTaggedBuildInfo + +`func NewTaggedBuildInfo() *TaggedBuildInfo` + +NewTaggedBuildInfo instantiates a new TaggedBuildInfo object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewTaggedBuildInfoWithDefaults + +`func NewTaggedBuildInfoWithDefaults() *TaggedBuildInfo` + +NewTaggedBuildInfoWithDefaults instantiates a new TaggedBuildInfo object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetBuildId + +`func (o *TaggedBuildInfo) GetBuildId() string` + +GetBuildId returns the BuildId field if non-nil, zero value otherwise. + +### GetBuildIdOk + +`func (o *TaggedBuildInfo) GetBuildIdOk() (*string, bool)` + +GetBuildIdOk returns a tuple with the BuildId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetBuildId + +`func (o *TaggedBuildInfo) SetBuildId(v string)` + +SetBuildId sets BuildId field to given value. + +### HasBuildId + +`func (o *TaggedBuildInfo) HasBuildId() bool` + +HasBuildId returns a boolean if a field has been set. + +### GetBuildNumber + +`func (o *TaggedBuildInfo) GetBuildNumber() string` + +GetBuildNumber returns the BuildNumber field if non-nil, zero value otherwise. + +### GetBuildNumberOk + +`func (o *TaggedBuildInfo) GetBuildNumberOk() (*string, bool)` + +GetBuildNumberOk returns a tuple with the BuildNumber field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetBuildNumber + +`func (o *TaggedBuildInfo) SetBuildNumber(v string)` + +SetBuildNumber sets BuildNumber field to given value. + +### HasBuildNumber + +`func (o *TaggedBuildInfo) HasBuildNumber() bool` + +HasBuildNumber returns a boolean if a field has been set. + +### GetBuildNumberInt + +`func (o *TaggedBuildInfo) GetBuildNumberInt() int32` + +GetBuildNumberInt returns the BuildNumberInt field if non-nil, zero value otherwise. + +### GetBuildNumberIntOk + +`func (o *TaggedBuildInfo) GetBuildNumberIntOk() (*int32, bool)` + +GetBuildNumberIntOk returns a tuple with the BuildNumberInt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetBuildNumberInt + +`func (o *TaggedBuildInfo) SetBuildNumberInt(v int32)` + +SetBuildNumberInt sets BuildNumberInt field to given value. + +### HasBuildNumberInt + +`func (o *TaggedBuildInfo) HasBuildNumberInt() bool` + +HasBuildNumberInt returns a boolean if a field has been set. + +### GetFinishedAt + +`func (o *TaggedBuildInfo) GetFinishedAt() time.Time` + +GetFinishedAt returns the FinishedAt field if non-nil, zero value otherwise. + +### GetFinishedAtOk + +`func (o *TaggedBuildInfo) GetFinishedAtOk() (*time.Time, bool)` + +GetFinishedAtOk returns a tuple with the FinishedAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetFinishedAt + +`func (o *TaggedBuildInfo) SetFinishedAt(v time.Time)` + +SetFinishedAt sets FinishedAt field to given value. + +### HasFinishedAt + +`func (o *TaggedBuildInfo) HasFinishedAt() bool` + +HasFinishedAt returns a boolean if a field has been set. + +### SetFinishedAtNil + +`func (o *TaggedBuildInfo) SetFinishedAtNil(b bool)` + + SetFinishedAtNil sets the value for FinishedAt to be an explicit nil + +### UnsetFinishedAt +`func (o *TaggedBuildInfo) UnsetFinishedAt()` + +UnsetFinishedAt ensures that no value is present for FinishedAt, not even an explicit nil + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/TaggedBuildsValue.md b/docs/TaggedBuildsValue.md new file mode 100644 index 0000000..f950d02 --- /dev/null +++ b/docs/TaggedBuildsValue.md @@ -0,0 +1,144 @@ +# TaggedBuildsValue + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**BuildId** | Pointer to **string** | The ID of the build associated with this tag. | [optional] +**BuildNumber** | Pointer to **string** | The build number/version string. | [optional] +**BuildNumberInt** | Pointer to **int32** | The build number encoded as a single integer. | [optional] +**FinishedAt** | Pointer to **NullableTime** | The timestamp when the build finished. | [optional] + +## Methods + +### NewTaggedBuildsValue + +`func NewTaggedBuildsValue() *TaggedBuildsValue` + +NewTaggedBuildsValue instantiates a new TaggedBuildsValue object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewTaggedBuildsValueWithDefaults + +`func NewTaggedBuildsValueWithDefaults() *TaggedBuildsValue` + +NewTaggedBuildsValueWithDefaults instantiates a new TaggedBuildsValue object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetBuildId + +`func (o *TaggedBuildsValue) GetBuildId() string` + +GetBuildId returns the BuildId field if non-nil, zero value otherwise. + +### GetBuildIdOk + +`func (o *TaggedBuildsValue) GetBuildIdOk() (*string, bool)` + +GetBuildIdOk returns a tuple with the BuildId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetBuildId + +`func (o *TaggedBuildsValue) SetBuildId(v string)` + +SetBuildId sets BuildId field to given value. + +### HasBuildId + +`func (o *TaggedBuildsValue) HasBuildId() bool` + +HasBuildId returns a boolean if a field has been set. + +### GetBuildNumber + +`func (o *TaggedBuildsValue) GetBuildNumber() string` + +GetBuildNumber returns the BuildNumber field if non-nil, zero value otherwise. + +### GetBuildNumberOk + +`func (o *TaggedBuildsValue) GetBuildNumberOk() (*string, bool)` + +GetBuildNumberOk returns a tuple with the BuildNumber field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetBuildNumber + +`func (o *TaggedBuildsValue) SetBuildNumber(v string)` + +SetBuildNumber sets BuildNumber field to given value. + +### HasBuildNumber + +`func (o *TaggedBuildsValue) HasBuildNumber() bool` + +HasBuildNumber returns a boolean if a field has been set. + +### GetBuildNumberInt + +`func (o *TaggedBuildsValue) GetBuildNumberInt() int32` + +GetBuildNumberInt returns the BuildNumberInt field if non-nil, zero value otherwise. + +### GetBuildNumberIntOk + +`func (o *TaggedBuildsValue) GetBuildNumberIntOk() (*int32, bool)` + +GetBuildNumberIntOk returns a tuple with the BuildNumberInt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetBuildNumberInt + +`func (o *TaggedBuildsValue) SetBuildNumberInt(v int32)` + +SetBuildNumberInt sets BuildNumberInt field to given value. + +### HasBuildNumberInt + +`func (o *TaggedBuildsValue) HasBuildNumberInt() bool` + +HasBuildNumberInt returns a boolean if a field has been set. + +### GetFinishedAt + +`func (o *TaggedBuildsValue) GetFinishedAt() time.Time` + +GetFinishedAt returns the FinishedAt field if non-nil, zero value otherwise. + +### GetFinishedAtOk + +`func (o *TaggedBuildsValue) GetFinishedAtOk() (*time.Time, bool)` + +GetFinishedAtOk returns a tuple with the FinishedAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetFinishedAt + +`func (o *TaggedBuildsValue) SetFinishedAt(v time.Time)` + +SetFinishedAt sets FinishedAt field to given value. + +### HasFinishedAt + +`func (o *TaggedBuildsValue) HasFinishedAt() bool` + +HasFinishedAt returns a boolean if a field has been set. + +### SetFinishedAtNil + +`func (o *TaggedBuildsValue) SetFinishedAtNil(b bool)` + + SetFinishedAtNil sets the value for FinishedAt to be an explicit nil + +### UnsetFinishedAt +`func (o *TaggedBuildsValue) UnsetFinishedAt()` + +UnsetFinishedAt ensures that no value is present for FinishedAt, not even an explicit nil + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/Task.md b/docs/Task.md new file mode 100644 index 0000000..16ede80 --- /dev/null +++ b/docs/Task.md @@ -0,0 +1,444 @@ +# Task + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **string** | | +**UserId** | **string** | | +**ActId** | **string** | | +**Name** | **string** | | +**Username** | Pointer to **NullableString** | | [optional] +**CreatedAt** | **time.Time** | | +**ModifiedAt** | **time.Time** | | +**RemovedAt** | Pointer to **NullableTime** | | [optional] +**Stats** | Pointer to [**NullableTaskStats**](TaskStats.md) | | [optional] +**Options** | Pointer to [**NullableTaskOptions**](TaskOptions.md) | | [optional] +**Input** | Pointer to **map[string]interface{}** | The input configuration for the Actor task. This is a user-defined JSON object that will be passed to the Actor when the task is run. | [optional] +**Title** | Pointer to **NullableString** | | [optional] +**ActorStandby** | Pointer to [**NullableActorStandby**](ActorStandby.md) | | [optional] +**StandbyUrl** | Pointer to **NullableString** | | [optional] + +## Methods + +### NewTask + +`func NewTask(id string, userId string, actId string, name string, createdAt time.Time, modifiedAt time.Time, ) *Task` + +NewTask instantiates a new Task object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewTaskWithDefaults + +`func NewTaskWithDefaults() *Task` + +NewTaskWithDefaults instantiates a new Task object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetId + +`func (o *Task) GetId() string` + +GetId returns the Id field if non-nil, zero value otherwise. + +### GetIdOk + +`func (o *Task) GetIdOk() (*string, bool)` + +GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetId + +`func (o *Task) SetId(v string)` + +SetId sets Id field to given value. + + +### GetUserId + +`func (o *Task) GetUserId() string` + +GetUserId returns the UserId field if non-nil, zero value otherwise. + +### GetUserIdOk + +`func (o *Task) GetUserIdOk() (*string, bool)` + +GetUserIdOk returns a tuple with the UserId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUserId + +`func (o *Task) SetUserId(v string)` + +SetUserId sets UserId field to given value. + + +### GetActId + +`func (o *Task) GetActId() string` + +GetActId returns the ActId field if non-nil, zero value otherwise. + +### GetActIdOk + +`func (o *Task) GetActIdOk() (*string, bool)` + +GetActIdOk returns a tuple with the ActId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetActId + +`func (o *Task) SetActId(v string)` + +SetActId sets ActId field to given value. + + +### GetName + +`func (o *Task) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *Task) GetNameOk() (*string, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetName + +`func (o *Task) SetName(v string)` + +SetName sets Name field to given value. + + +### GetUsername + +`func (o *Task) GetUsername() string` + +GetUsername returns the Username field if non-nil, zero value otherwise. + +### GetUsernameOk + +`func (o *Task) GetUsernameOk() (*string, bool)` + +GetUsernameOk returns a tuple with the Username field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUsername + +`func (o *Task) SetUsername(v string)` + +SetUsername sets Username field to given value. + +### HasUsername + +`func (o *Task) HasUsername() bool` + +HasUsername returns a boolean if a field has been set. + +### SetUsernameNil + +`func (o *Task) SetUsernameNil(b bool)` + + SetUsernameNil sets the value for Username to be an explicit nil + +### UnsetUsername +`func (o *Task) UnsetUsername()` + +UnsetUsername ensures that no value is present for Username, not even an explicit nil +### GetCreatedAt + +`func (o *Task) GetCreatedAt() time.Time` + +GetCreatedAt returns the CreatedAt field if non-nil, zero value otherwise. + +### GetCreatedAtOk + +`func (o *Task) GetCreatedAtOk() (*time.Time, bool)` + +GetCreatedAtOk returns a tuple with the CreatedAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCreatedAt + +`func (o *Task) SetCreatedAt(v time.Time)` + +SetCreatedAt sets CreatedAt field to given value. + + +### GetModifiedAt + +`func (o *Task) GetModifiedAt() time.Time` + +GetModifiedAt returns the ModifiedAt field if non-nil, zero value otherwise. + +### GetModifiedAtOk + +`func (o *Task) GetModifiedAtOk() (*time.Time, bool)` + +GetModifiedAtOk returns a tuple with the ModifiedAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetModifiedAt + +`func (o *Task) SetModifiedAt(v time.Time)` + +SetModifiedAt sets ModifiedAt field to given value. + + +### GetRemovedAt + +`func (o *Task) GetRemovedAt() time.Time` + +GetRemovedAt returns the RemovedAt field if non-nil, zero value otherwise. + +### GetRemovedAtOk + +`func (o *Task) GetRemovedAtOk() (*time.Time, bool)` + +GetRemovedAtOk returns a tuple with the RemovedAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRemovedAt + +`func (o *Task) SetRemovedAt(v time.Time)` + +SetRemovedAt sets RemovedAt field to given value. + +### HasRemovedAt + +`func (o *Task) HasRemovedAt() bool` + +HasRemovedAt returns a boolean if a field has been set. + +### SetRemovedAtNil + +`func (o *Task) SetRemovedAtNil(b bool)` + + SetRemovedAtNil sets the value for RemovedAt to be an explicit nil + +### UnsetRemovedAt +`func (o *Task) UnsetRemovedAt()` + +UnsetRemovedAt ensures that no value is present for RemovedAt, not even an explicit nil +### GetStats + +`func (o *Task) GetStats() TaskStats` + +GetStats returns the Stats field if non-nil, zero value otherwise. + +### GetStatsOk + +`func (o *Task) GetStatsOk() (*TaskStats, bool)` + +GetStatsOk returns a tuple with the Stats field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetStats + +`func (o *Task) SetStats(v TaskStats)` + +SetStats sets Stats field to given value. + +### HasStats + +`func (o *Task) HasStats() bool` + +HasStats returns a boolean if a field has been set. + +### SetStatsNil + +`func (o *Task) SetStatsNil(b bool)` + + SetStatsNil sets the value for Stats to be an explicit nil + +### UnsetStats +`func (o *Task) UnsetStats()` + +UnsetStats ensures that no value is present for Stats, not even an explicit nil +### GetOptions + +`func (o *Task) GetOptions() TaskOptions` + +GetOptions returns the Options field if non-nil, zero value otherwise. + +### GetOptionsOk + +`func (o *Task) GetOptionsOk() (*TaskOptions, bool)` + +GetOptionsOk returns a tuple with the Options field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetOptions + +`func (o *Task) SetOptions(v TaskOptions)` + +SetOptions sets Options field to given value. + +### HasOptions + +`func (o *Task) HasOptions() bool` + +HasOptions returns a boolean if a field has been set. + +### SetOptionsNil + +`func (o *Task) SetOptionsNil(b bool)` + + SetOptionsNil sets the value for Options to be an explicit nil + +### UnsetOptions +`func (o *Task) UnsetOptions()` + +UnsetOptions ensures that no value is present for Options, not even an explicit nil +### GetInput + +`func (o *Task) GetInput() map[string]interface{}` + +GetInput returns the Input field if non-nil, zero value otherwise. + +### GetInputOk + +`func (o *Task) GetInputOk() (*map[string]interface{}, bool)` + +GetInputOk returns a tuple with the Input field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetInput + +`func (o *Task) SetInput(v map[string]interface{})` + +SetInput sets Input field to given value. + +### HasInput + +`func (o *Task) HasInput() bool` + +HasInput returns a boolean if a field has been set. + +### SetInputNil + +`func (o *Task) SetInputNil(b bool)` + + SetInputNil sets the value for Input to be an explicit nil + +### UnsetInput +`func (o *Task) UnsetInput()` + +UnsetInput ensures that no value is present for Input, not even an explicit nil +### GetTitle + +`func (o *Task) GetTitle() string` + +GetTitle returns the Title field if non-nil, zero value otherwise. + +### GetTitleOk + +`func (o *Task) GetTitleOk() (*string, bool)` + +GetTitleOk returns a tuple with the Title field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTitle + +`func (o *Task) SetTitle(v string)` + +SetTitle sets Title field to given value. + +### HasTitle + +`func (o *Task) HasTitle() bool` + +HasTitle returns a boolean if a field has been set. + +### SetTitleNil + +`func (o *Task) SetTitleNil(b bool)` + + SetTitleNil sets the value for Title to be an explicit nil + +### UnsetTitle +`func (o *Task) UnsetTitle()` + +UnsetTitle ensures that no value is present for Title, not even an explicit nil +### GetActorStandby + +`func (o *Task) GetActorStandby() ActorStandby` + +GetActorStandby returns the ActorStandby field if non-nil, zero value otherwise. + +### GetActorStandbyOk + +`func (o *Task) GetActorStandbyOk() (*ActorStandby, bool)` + +GetActorStandbyOk returns a tuple with the ActorStandby field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetActorStandby + +`func (o *Task) SetActorStandby(v ActorStandby)` + +SetActorStandby sets ActorStandby field to given value. + +### HasActorStandby + +`func (o *Task) HasActorStandby() bool` + +HasActorStandby returns a boolean if a field has been set. + +### SetActorStandbyNil + +`func (o *Task) SetActorStandbyNil(b bool)` + + SetActorStandbyNil sets the value for ActorStandby to be an explicit nil + +### UnsetActorStandby +`func (o *Task) UnsetActorStandby()` + +UnsetActorStandby ensures that no value is present for ActorStandby, not even an explicit nil +### GetStandbyUrl + +`func (o *Task) GetStandbyUrl() string` + +GetStandbyUrl returns the StandbyUrl field if non-nil, zero value otherwise. + +### GetStandbyUrlOk + +`func (o *Task) GetStandbyUrlOk() (*string, bool)` + +GetStandbyUrlOk returns a tuple with the StandbyUrl field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetStandbyUrl + +`func (o *Task) SetStandbyUrl(v string)` + +SetStandbyUrl sets StandbyUrl field to given value. + +### HasStandbyUrl + +`func (o *Task) HasStandbyUrl() bool` + +HasStandbyUrl returns a boolean if a field has been set. + +### SetStandbyUrlNil + +`func (o *Task) SetStandbyUrlNil(b bool)` + + SetStandbyUrlNil sets the value for StandbyUrl to be an explicit nil + +### UnsetStandbyUrl +`func (o *Task) UnsetStandbyUrl()` + +UnsetStandbyUrl ensures that no value is present for StandbyUrl, not even an explicit nil + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/TaskOptions.md b/docs/TaskOptions.md new file mode 100644 index 0000000..d90e430 --- /dev/null +++ b/docs/TaskOptions.md @@ -0,0 +1,246 @@ +# TaskOptions + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Build** | Pointer to **NullableString** | | [optional] +**TimeoutSecs** | Pointer to **NullableInt32** | | [optional] +**MemoryMbytes** | Pointer to **NullableInt32** | | [optional] +**MaxItems** | Pointer to **NullableInt32** | | [optional] +**MaxTotalChargeUsd** | Pointer to **NullableFloat32** | | [optional] +**RestartOnError** | Pointer to **NullableBool** | | [optional] + +## Methods + +### NewTaskOptions + +`func NewTaskOptions() *TaskOptions` + +NewTaskOptions instantiates a new TaskOptions object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewTaskOptionsWithDefaults + +`func NewTaskOptionsWithDefaults() *TaskOptions` + +NewTaskOptionsWithDefaults instantiates a new TaskOptions object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetBuild + +`func (o *TaskOptions) GetBuild() string` + +GetBuild returns the Build field if non-nil, zero value otherwise. + +### GetBuildOk + +`func (o *TaskOptions) GetBuildOk() (*string, bool)` + +GetBuildOk returns a tuple with the Build field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetBuild + +`func (o *TaskOptions) SetBuild(v string)` + +SetBuild sets Build field to given value. + +### HasBuild + +`func (o *TaskOptions) HasBuild() bool` + +HasBuild returns a boolean if a field has been set. + +### SetBuildNil + +`func (o *TaskOptions) SetBuildNil(b bool)` + + SetBuildNil sets the value for Build to be an explicit nil + +### UnsetBuild +`func (o *TaskOptions) UnsetBuild()` + +UnsetBuild ensures that no value is present for Build, not even an explicit nil +### GetTimeoutSecs + +`func (o *TaskOptions) GetTimeoutSecs() int32` + +GetTimeoutSecs returns the TimeoutSecs field if non-nil, zero value otherwise. + +### GetTimeoutSecsOk + +`func (o *TaskOptions) GetTimeoutSecsOk() (*int32, bool)` + +GetTimeoutSecsOk returns a tuple with the TimeoutSecs field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTimeoutSecs + +`func (o *TaskOptions) SetTimeoutSecs(v int32)` + +SetTimeoutSecs sets TimeoutSecs field to given value. + +### HasTimeoutSecs + +`func (o *TaskOptions) HasTimeoutSecs() bool` + +HasTimeoutSecs returns a boolean if a field has been set. + +### SetTimeoutSecsNil + +`func (o *TaskOptions) SetTimeoutSecsNil(b bool)` + + SetTimeoutSecsNil sets the value for TimeoutSecs to be an explicit nil + +### UnsetTimeoutSecs +`func (o *TaskOptions) UnsetTimeoutSecs()` + +UnsetTimeoutSecs ensures that no value is present for TimeoutSecs, not even an explicit nil +### GetMemoryMbytes + +`func (o *TaskOptions) GetMemoryMbytes() int32` + +GetMemoryMbytes returns the MemoryMbytes field if non-nil, zero value otherwise. + +### GetMemoryMbytesOk + +`func (o *TaskOptions) GetMemoryMbytesOk() (*int32, bool)` + +GetMemoryMbytesOk returns a tuple with the MemoryMbytes field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMemoryMbytes + +`func (o *TaskOptions) SetMemoryMbytes(v int32)` + +SetMemoryMbytes sets MemoryMbytes field to given value. + +### HasMemoryMbytes + +`func (o *TaskOptions) HasMemoryMbytes() bool` + +HasMemoryMbytes returns a boolean if a field has been set. + +### SetMemoryMbytesNil + +`func (o *TaskOptions) SetMemoryMbytesNil(b bool)` + + SetMemoryMbytesNil sets the value for MemoryMbytes to be an explicit nil + +### UnsetMemoryMbytes +`func (o *TaskOptions) UnsetMemoryMbytes()` + +UnsetMemoryMbytes ensures that no value is present for MemoryMbytes, not even an explicit nil +### GetMaxItems + +`func (o *TaskOptions) GetMaxItems() int32` + +GetMaxItems returns the MaxItems field if non-nil, zero value otherwise. + +### GetMaxItemsOk + +`func (o *TaskOptions) GetMaxItemsOk() (*int32, bool)` + +GetMaxItemsOk returns a tuple with the MaxItems field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMaxItems + +`func (o *TaskOptions) SetMaxItems(v int32)` + +SetMaxItems sets MaxItems field to given value. + +### HasMaxItems + +`func (o *TaskOptions) HasMaxItems() bool` + +HasMaxItems returns a boolean if a field has been set. + +### SetMaxItemsNil + +`func (o *TaskOptions) SetMaxItemsNil(b bool)` + + SetMaxItemsNil sets the value for MaxItems to be an explicit nil + +### UnsetMaxItems +`func (o *TaskOptions) UnsetMaxItems()` + +UnsetMaxItems ensures that no value is present for MaxItems, not even an explicit nil +### GetMaxTotalChargeUsd + +`func (o *TaskOptions) GetMaxTotalChargeUsd() float32` + +GetMaxTotalChargeUsd returns the MaxTotalChargeUsd field if non-nil, zero value otherwise. + +### GetMaxTotalChargeUsdOk + +`func (o *TaskOptions) GetMaxTotalChargeUsdOk() (*float32, bool)` + +GetMaxTotalChargeUsdOk returns a tuple with the MaxTotalChargeUsd field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMaxTotalChargeUsd + +`func (o *TaskOptions) SetMaxTotalChargeUsd(v float32)` + +SetMaxTotalChargeUsd sets MaxTotalChargeUsd field to given value. + +### HasMaxTotalChargeUsd + +`func (o *TaskOptions) HasMaxTotalChargeUsd() bool` + +HasMaxTotalChargeUsd returns a boolean if a field has been set. + +### SetMaxTotalChargeUsdNil + +`func (o *TaskOptions) SetMaxTotalChargeUsdNil(b bool)` + + SetMaxTotalChargeUsdNil sets the value for MaxTotalChargeUsd to be an explicit nil + +### UnsetMaxTotalChargeUsd +`func (o *TaskOptions) UnsetMaxTotalChargeUsd()` + +UnsetMaxTotalChargeUsd ensures that no value is present for MaxTotalChargeUsd, not even an explicit nil +### GetRestartOnError + +`func (o *TaskOptions) GetRestartOnError() bool` + +GetRestartOnError returns the RestartOnError field if non-nil, zero value otherwise. + +### GetRestartOnErrorOk + +`func (o *TaskOptions) GetRestartOnErrorOk() (*bool, bool)` + +GetRestartOnErrorOk returns a tuple with the RestartOnError field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRestartOnError + +`func (o *TaskOptions) SetRestartOnError(v bool)` + +SetRestartOnError sets RestartOnError field to given value. + +### HasRestartOnError + +`func (o *TaskOptions) HasRestartOnError() bool` + +HasRestartOnError returns a boolean if a field has been set. + +### SetRestartOnErrorNil + +`func (o *TaskOptions) SetRestartOnErrorNil(b bool)` + + SetRestartOnErrorNil sets the value for RestartOnError to be an explicit nil + +### UnsetRestartOnError +`func (o *TaskOptions) UnsetRestartOnError()` + +UnsetRestartOnError ensures that no value is present for RestartOnError, not even an explicit nil + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/TaskResponse.md b/docs/TaskResponse.md new file mode 100644 index 0000000..7e8570b --- /dev/null +++ b/docs/TaskResponse.md @@ -0,0 +1,51 @@ +# TaskResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Data** | [**Task**](Task.md) | | + +## Methods + +### NewTaskResponse + +`func NewTaskResponse(data Task, ) *TaskResponse` + +NewTaskResponse instantiates a new TaskResponse object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewTaskResponseWithDefaults + +`func NewTaskResponseWithDefaults() *TaskResponse` + +NewTaskResponseWithDefaults instantiates a new TaskResponse object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetData + +`func (o *TaskResponse) GetData() Task` + +GetData returns the Data field if non-nil, zero value otherwise. + +### GetDataOk + +`func (o *TaskResponse) GetDataOk() (*Task, bool)` + +GetDataOk returns a tuple with the Data field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetData + +`func (o *TaskResponse) SetData(v Task)` + +SetData sets Data field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/TaskShort.md b/docs/TaskShort.md new file mode 100644 index 0000000..7eef763 --- /dev/null +++ b/docs/TaskShort.md @@ -0,0 +1,300 @@ +# TaskShort + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **string** | | +**UserId** | **string** | | +**ActId** | **string** | | +**ActName** | Pointer to **NullableString** | | [optional] +**Name** | **string** | | +**Username** | Pointer to **NullableString** | | [optional] +**ActUsername** | Pointer to **NullableString** | | [optional] +**CreatedAt** | **time.Time** | | +**ModifiedAt** | **time.Time** | | +**Stats** | Pointer to [**NullableTaskStats**](TaskStats.md) | | [optional] + +## Methods + +### NewTaskShort + +`func NewTaskShort(id string, userId string, actId string, name string, createdAt time.Time, modifiedAt time.Time, ) *TaskShort` + +NewTaskShort instantiates a new TaskShort object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewTaskShortWithDefaults + +`func NewTaskShortWithDefaults() *TaskShort` + +NewTaskShortWithDefaults instantiates a new TaskShort object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetId + +`func (o *TaskShort) GetId() string` + +GetId returns the Id field if non-nil, zero value otherwise. + +### GetIdOk + +`func (o *TaskShort) GetIdOk() (*string, bool)` + +GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetId + +`func (o *TaskShort) SetId(v string)` + +SetId sets Id field to given value. + + +### GetUserId + +`func (o *TaskShort) GetUserId() string` + +GetUserId returns the UserId field if non-nil, zero value otherwise. + +### GetUserIdOk + +`func (o *TaskShort) GetUserIdOk() (*string, bool)` + +GetUserIdOk returns a tuple with the UserId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUserId + +`func (o *TaskShort) SetUserId(v string)` + +SetUserId sets UserId field to given value. + + +### GetActId + +`func (o *TaskShort) GetActId() string` + +GetActId returns the ActId field if non-nil, zero value otherwise. + +### GetActIdOk + +`func (o *TaskShort) GetActIdOk() (*string, bool)` + +GetActIdOk returns a tuple with the ActId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetActId + +`func (o *TaskShort) SetActId(v string)` + +SetActId sets ActId field to given value. + + +### GetActName + +`func (o *TaskShort) GetActName() string` + +GetActName returns the ActName field if non-nil, zero value otherwise. + +### GetActNameOk + +`func (o *TaskShort) GetActNameOk() (*string, bool)` + +GetActNameOk returns a tuple with the ActName field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetActName + +`func (o *TaskShort) SetActName(v string)` + +SetActName sets ActName field to given value. + +### HasActName + +`func (o *TaskShort) HasActName() bool` + +HasActName returns a boolean if a field has been set. + +### SetActNameNil + +`func (o *TaskShort) SetActNameNil(b bool)` + + SetActNameNil sets the value for ActName to be an explicit nil + +### UnsetActName +`func (o *TaskShort) UnsetActName()` + +UnsetActName ensures that no value is present for ActName, not even an explicit nil +### GetName + +`func (o *TaskShort) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *TaskShort) GetNameOk() (*string, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetName + +`func (o *TaskShort) SetName(v string)` + +SetName sets Name field to given value. + + +### GetUsername + +`func (o *TaskShort) GetUsername() string` + +GetUsername returns the Username field if non-nil, zero value otherwise. + +### GetUsernameOk + +`func (o *TaskShort) GetUsernameOk() (*string, bool)` + +GetUsernameOk returns a tuple with the Username field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUsername + +`func (o *TaskShort) SetUsername(v string)` + +SetUsername sets Username field to given value. + +### HasUsername + +`func (o *TaskShort) HasUsername() bool` + +HasUsername returns a boolean if a field has been set. + +### SetUsernameNil + +`func (o *TaskShort) SetUsernameNil(b bool)` + + SetUsernameNil sets the value for Username to be an explicit nil + +### UnsetUsername +`func (o *TaskShort) UnsetUsername()` + +UnsetUsername ensures that no value is present for Username, not even an explicit nil +### GetActUsername + +`func (o *TaskShort) GetActUsername() string` + +GetActUsername returns the ActUsername field if non-nil, zero value otherwise. + +### GetActUsernameOk + +`func (o *TaskShort) GetActUsernameOk() (*string, bool)` + +GetActUsernameOk returns a tuple with the ActUsername field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetActUsername + +`func (o *TaskShort) SetActUsername(v string)` + +SetActUsername sets ActUsername field to given value. + +### HasActUsername + +`func (o *TaskShort) HasActUsername() bool` + +HasActUsername returns a boolean if a field has been set. + +### SetActUsernameNil + +`func (o *TaskShort) SetActUsernameNil(b bool)` + + SetActUsernameNil sets the value for ActUsername to be an explicit nil + +### UnsetActUsername +`func (o *TaskShort) UnsetActUsername()` + +UnsetActUsername ensures that no value is present for ActUsername, not even an explicit nil +### GetCreatedAt + +`func (o *TaskShort) GetCreatedAt() time.Time` + +GetCreatedAt returns the CreatedAt field if non-nil, zero value otherwise. + +### GetCreatedAtOk + +`func (o *TaskShort) GetCreatedAtOk() (*time.Time, bool)` + +GetCreatedAtOk returns a tuple with the CreatedAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCreatedAt + +`func (o *TaskShort) SetCreatedAt(v time.Time)` + +SetCreatedAt sets CreatedAt field to given value. + + +### GetModifiedAt + +`func (o *TaskShort) GetModifiedAt() time.Time` + +GetModifiedAt returns the ModifiedAt field if non-nil, zero value otherwise. + +### GetModifiedAtOk + +`func (o *TaskShort) GetModifiedAtOk() (*time.Time, bool)` + +GetModifiedAtOk returns a tuple with the ModifiedAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetModifiedAt + +`func (o *TaskShort) SetModifiedAt(v time.Time)` + +SetModifiedAt sets ModifiedAt field to given value. + + +### GetStats + +`func (o *TaskShort) GetStats() TaskStats` + +GetStats returns the Stats field if non-nil, zero value otherwise. + +### GetStatsOk + +`func (o *TaskShort) GetStatsOk() (*TaskStats, bool)` + +GetStatsOk returns a tuple with the Stats field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetStats + +`func (o *TaskShort) SetStats(v TaskStats)` + +SetStats sets Stats field to given value. + +### HasStats + +`func (o *TaskShort) HasStats() bool` + +HasStats returns a boolean if a field has been set. + +### SetStatsNil + +`func (o *TaskShort) SetStatsNil(b bool)` + + SetStatsNil sets the value for Stats to be an explicit nil + +### UnsetStats +`func (o *TaskShort) UnsetStats()` + +UnsetStats ensures that no value is present for Stats, not even an explicit nil + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/TaskStats.md b/docs/TaskStats.md new file mode 100644 index 0000000..c3331b0 --- /dev/null +++ b/docs/TaskStats.md @@ -0,0 +1,56 @@ +# TaskStats + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**TotalRuns** | Pointer to **int32** | | [optional] + +## Methods + +### NewTaskStats + +`func NewTaskStats() *TaskStats` + +NewTaskStats instantiates a new TaskStats object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewTaskStatsWithDefaults + +`func NewTaskStatsWithDefaults() *TaskStats` + +NewTaskStatsWithDefaults instantiates a new TaskStats object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetTotalRuns + +`func (o *TaskStats) GetTotalRuns() int32` + +GetTotalRuns returns the TotalRuns field if non-nil, zero value otherwise. + +### GetTotalRunsOk + +`func (o *TaskStats) GetTotalRunsOk() (*int32, bool)` + +GetTotalRunsOk returns a tuple with the TotalRuns field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTotalRuns + +`func (o *TaskStats) SetTotalRuns(v int32)` + +SetTotalRuns sets TotalRuns field to given value. + +### HasTotalRuns + +`func (o *TaskStats) HasTotalRuns() bool` + +HasTotalRuns returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/TestWebhookResponse.md b/docs/TestWebhookResponse.md new file mode 100644 index 0000000..9e81ef4 --- /dev/null +++ b/docs/TestWebhookResponse.md @@ -0,0 +1,51 @@ +# TestWebhookResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Data** | [**WebhookDispatch**](WebhookDispatch.md) | | + +## Methods + +### NewTestWebhookResponse + +`func NewTestWebhookResponse(data WebhookDispatch, ) *TestWebhookResponse` + +NewTestWebhookResponse instantiates a new TestWebhookResponse object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewTestWebhookResponseWithDefaults + +`func NewTestWebhookResponseWithDefaults() *TestWebhookResponse` + +NewTestWebhookResponseWithDefaults instantiates a new TestWebhookResponse object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetData + +`func (o *TestWebhookResponse) GetData() WebhookDispatch` + +GetData returns the Data field if non-nil, zero value otherwise. + +### GetDataOk + +`func (o *TestWebhookResponse) GetDataOk() (*WebhookDispatch, bool)` + +GetDataOk returns a tuple with the Data field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetData + +`func (o *TestWebhookResponse) SetData(v WebhookDispatch)` + +SetData sets Data field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/TieredPricingPerDatasetItemEntry.md b/docs/TieredPricingPerDatasetItemEntry.md new file mode 100644 index 0000000..915bd9f --- /dev/null +++ b/docs/TieredPricingPerDatasetItemEntry.md @@ -0,0 +1,51 @@ +# TieredPricingPerDatasetItemEntry + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**TieredPricePerUnitUsd** | **float32** | Price per unit in USD for this tier. | + +## Methods + +### NewTieredPricingPerDatasetItemEntry + +`func NewTieredPricingPerDatasetItemEntry(tieredPricePerUnitUsd float32, ) *TieredPricingPerDatasetItemEntry` + +NewTieredPricingPerDatasetItemEntry instantiates a new TieredPricingPerDatasetItemEntry object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewTieredPricingPerDatasetItemEntryWithDefaults + +`func NewTieredPricingPerDatasetItemEntryWithDefaults() *TieredPricingPerDatasetItemEntry` + +NewTieredPricingPerDatasetItemEntryWithDefaults instantiates a new TieredPricingPerDatasetItemEntry object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetTieredPricePerUnitUsd + +`func (o *TieredPricingPerDatasetItemEntry) GetTieredPricePerUnitUsd() float32` + +GetTieredPricePerUnitUsd returns the TieredPricePerUnitUsd field if non-nil, zero value otherwise. + +### GetTieredPricePerUnitUsdOk + +`func (o *TieredPricingPerDatasetItemEntry) GetTieredPricePerUnitUsdOk() (*float32, bool)` + +GetTieredPricePerUnitUsdOk returns a tuple with the TieredPricePerUnitUsd field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTieredPricePerUnitUsd + +`func (o *TieredPricingPerDatasetItemEntry) SetTieredPricePerUnitUsd(v float32)` + +SetTieredPricePerUnitUsd sets TieredPricePerUnitUsd field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/TieredPricingPerEventEntry.md b/docs/TieredPricingPerEventEntry.md new file mode 100644 index 0000000..ae97a7a --- /dev/null +++ b/docs/TieredPricingPerEventEntry.md @@ -0,0 +1,51 @@ +# TieredPricingPerEventEntry + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**TieredEventPriceUsd** | **float32** | Price per event in USD for this tier. | + +## Methods + +### NewTieredPricingPerEventEntry + +`func NewTieredPricingPerEventEntry(tieredEventPriceUsd float32, ) *TieredPricingPerEventEntry` + +NewTieredPricingPerEventEntry instantiates a new TieredPricingPerEventEntry object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewTieredPricingPerEventEntryWithDefaults + +`func NewTieredPricingPerEventEntryWithDefaults() *TieredPricingPerEventEntry` + +NewTieredPricingPerEventEntryWithDefaults instantiates a new TieredPricingPerEventEntry object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetTieredEventPriceUsd + +`func (o *TieredPricingPerEventEntry) GetTieredEventPriceUsd() float32` + +GetTieredEventPriceUsd returns the TieredEventPriceUsd field if non-nil, zero value otherwise. + +### GetTieredEventPriceUsdOk + +`func (o *TieredPricingPerEventEntry) GetTieredEventPriceUsdOk() (*float32, bool)` + +GetTieredEventPriceUsdOk returns a tuple with the TieredEventPriceUsd field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTieredEventPriceUsd + +`func (o *TieredPricingPerEventEntry) SetTieredEventPriceUsd(v float32)` + +SetTieredEventPriceUsd sets TieredEventPriceUsd field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ToolsAPI.md b/docs/ToolsAPI.md new file mode 100644 index 0000000..bc29aba --- /dev/null +++ b/docs/ToolsAPI.md @@ -0,0 +1,418 @@ +# \ToolsAPI + +All URIs are relative to *https://api.apify.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**ToolsBrowserInfoDelete**](ToolsAPI.md#ToolsBrowserInfoDelete) | **Delete** /v2/browser-info | Get browser info +[**ToolsBrowserInfoGet**](ToolsAPI.md#ToolsBrowserInfoGet) | **Get** /v2/browser-info | Get browser info +[**ToolsBrowserInfoPost**](ToolsAPI.md#ToolsBrowserInfoPost) | **Post** /v2/browser-info | Get browser info +[**ToolsBrowserInfoPut**](ToolsAPI.md#ToolsBrowserInfoPut) | **Put** /v2/browser-info | Get browser info +[**ToolsDecodeAndVerifyPost**](ToolsAPI.md#ToolsDecodeAndVerifyPost) | **Post** /v2/tools/decode-and-verify | Decode and verify object +[**ToolsEncodeAndSignPost**](ToolsAPI.md#ToolsEncodeAndSignPost) | **Post** /v2/tools/encode-and-sign | Encode and sign object + + + +## ToolsBrowserInfoDelete + +> BrowserInfoResponse ToolsBrowserInfoDelete(ctx).SkipHeaders(skipHeaders).RawHeaders(rawHeaders).Execute() + +Get browser info + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + skipHeaders := true // bool | If `true` or `1`, the response omits the `headers` field. (optional) + rawHeaders := true // bool | If `true` or `1`, the response includes the `rawHeaders` field with the raw request headers. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.ToolsAPI.ToolsBrowserInfoDelete(context.Background()).SkipHeaders(skipHeaders).RawHeaders(rawHeaders).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ToolsAPI.ToolsBrowserInfoDelete``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ToolsBrowserInfoDelete`: BrowserInfoResponse + fmt.Fprintf(os.Stdout, "Response from `ToolsAPI.ToolsBrowserInfoDelete`: %v\n", resp) +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiToolsBrowserInfoDeleteRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **skipHeaders** | **bool** | If `true` or `1`, the response omits the `headers` field. | + **rawHeaders** | **bool** | If `true` or `1`, the response includes the `rawHeaders` field with the raw request headers. | + +### Return type + +[**BrowserInfoResponse**](BrowserInfoResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## ToolsBrowserInfoGet + +> BrowserInfoResponse ToolsBrowserInfoGet(ctx).SkipHeaders(skipHeaders).RawHeaders(rawHeaders).Execute() + +Get browser info + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + skipHeaders := true // bool | If `true` or `1`, the response omits the `headers` field. (optional) + rawHeaders := true // bool | If `true` or `1`, the response includes the `rawHeaders` field with the raw request headers. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.ToolsAPI.ToolsBrowserInfoGet(context.Background()).SkipHeaders(skipHeaders).RawHeaders(rawHeaders).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ToolsAPI.ToolsBrowserInfoGet``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ToolsBrowserInfoGet`: BrowserInfoResponse + fmt.Fprintf(os.Stdout, "Response from `ToolsAPI.ToolsBrowserInfoGet`: %v\n", resp) +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiToolsBrowserInfoGetRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **skipHeaders** | **bool** | If `true` or `1`, the response omits the `headers` field. | + **rawHeaders** | **bool** | If `true` or `1`, the response includes the `rawHeaders` field with the raw request headers. | + +### Return type + +[**BrowserInfoResponse**](BrowserInfoResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## ToolsBrowserInfoPost + +> BrowserInfoResponse ToolsBrowserInfoPost(ctx).SkipHeaders(skipHeaders).RawHeaders(rawHeaders).Execute() + +Get browser info + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + skipHeaders := true // bool | If `true` or `1`, the response omits the `headers` field. (optional) + rawHeaders := true // bool | If `true` or `1`, the response includes the `rawHeaders` field with the raw request headers. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.ToolsAPI.ToolsBrowserInfoPost(context.Background()).SkipHeaders(skipHeaders).RawHeaders(rawHeaders).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ToolsAPI.ToolsBrowserInfoPost``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ToolsBrowserInfoPost`: BrowserInfoResponse + fmt.Fprintf(os.Stdout, "Response from `ToolsAPI.ToolsBrowserInfoPost`: %v\n", resp) +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiToolsBrowserInfoPostRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **skipHeaders** | **bool** | If `true` or `1`, the response omits the `headers` field. | + **rawHeaders** | **bool** | If `true` or `1`, the response includes the `rawHeaders` field with the raw request headers. | + +### Return type + +[**BrowserInfoResponse**](BrowserInfoResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## ToolsBrowserInfoPut + +> BrowserInfoResponse ToolsBrowserInfoPut(ctx).SkipHeaders(skipHeaders).RawHeaders(rawHeaders).Execute() + +Get browser info + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + skipHeaders := true // bool | If `true` or `1`, the response omits the `headers` field. (optional) + rawHeaders := true // bool | If `true` or `1`, the response includes the `rawHeaders` field with the raw request headers. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.ToolsAPI.ToolsBrowserInfoPut(context.Background()).SkipHeaders(skipHeaders).RawHeaders(rawHeaders).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ToolsAPI.ToolsBrowserInfoPut``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ToolsBrowserInfoPut`: BrowserInfoResponse + fmt.Fprintf(os.Stdout, "Response from `ToolsAPI.ToolsBrowserInfoPut`: %v\n", resp) +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiToolsBrowserInfoPutRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **skipHeaders** | **bool** | If `true` or `1`, the response omits the `headers` field. | + **rawHeaders** | **bool** | If `true` or `1`, the response includes the `rawHeaders` field with the raw request headers. | + +### Return type + +[**BrowserInfoResponse**](BrowserInfoResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## ToolsDecodeAndVerifyPost + +> DecodeAndVerifyResponse ToolsDecodeAndVerifyPost(ctx).DecodeAndVerifyRequest(decodeAndVerifyRequest).Execute() + +Decode and verify object + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + decodeAndVerifyRequest := *openapiclient.NewDecodeAndVerifyRequest("Encoded_example") // DecodeAndVerifyRequest | + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.ToolsAPI.ToolsDecodeAndVerifyPost(context.Background()).DecodeAndVerifyRequest(decodeAndVerifyRequest).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ToolsAPI.ToolsDecodeAndVerifyPost``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ToolsDecodeAndVerifyPost`: DecodeAndVerifyResponse + fmt.Fprintf(os.Stdout, "Response from `ToolsAPI.ToolsDecodeAndVerifyPost`: %v\n", resp) +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiToolsDecodeAndVerifyPostRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **decodeAndVerifyRequest** | [**DecodeAndVerifyRequest**](DecodeAndVerifyRequest.md) | | + +### Return type + +[**DecodeAndVerifyResponse**](DecodeAndVerifyResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## ToolsEncodeAndSignPost + +> EncodeAndSignResponse ToolsEncodeAndSignPost(ctx).Body(body).Execute() + +Encode and sign object + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + body := map[string]interface{}{ ... } // map[string]interface{} | + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.ToolsAPI.ToolsEncodeAndSignPost(context.Background()).Body(body).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ToolsAPI.ToolsEncodeAndSignPost``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ToolsEncodeAndSignPost`: EncodeAndSignResponse + fmt.Fprintf(os.Stdout, "Response from `ToolsAPI.ToolsEncodeAndSignPost`: %v\n", resp) +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiToolsEncodeAndSignPostRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | **map[string]interface{}** | | + +### Return type + +[**EncodeAndSignResponse**](EncodeAndSignResponse.md) + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/docs/UnlockRequestsResponse.md b/docs/UnlockRequestsResponse.md new file mode 100644 index 0000000..4bf5c2c --- /dev/null +++ b/docs/UnlockRequestsResponse.md @@ -0,0 +1,51 @@ +# UnlockRequestsResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Data** | [**UnlockRequestsResult**](UnlockRequestsResult.md) | | + +## Methods + +### NewUnlockRequestsResponse + +`func NewUnlockRequestsResponse(data UnlockRequestsResult, ) *UnlockRequestsResponse` + +NewUnlockRequestsResponse instantiates a new UnlockRequestsResponse object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewUnlockRequestsResponseWithDefaults + +`func NewUnlockRequestsResponseWithDefaults() *UnlockRequestsResponse` + +NewUnlockRequestsResponseWithDefaults instantiates a new UnlockRequestsResponse object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetData + +`func (o *UnlockRequestsResponse) GetData() UnlockRequestsResult` + +GetData returns the Data field if non-nil, zero value otherwise. + +### GetDataOk + +`func (o *UnlockRequestsResponse) GetDataOk() (*UnlockRequestsResult, bool)` + +GetDataOk returns a tuple with the Data field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetData + +`func (o *UnlockRequestsResponse) SetData(v UnlockRequestsResult)` + +SetData sets Data field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/UnlockRequestsResult.md b/docs/UnlockRequestsResult.md new file mode 100644 index 0000000..e46e168 --- /dev/null +++ b/docs/UnlockRequestsResult.md @@ -0,0 +1,51 @@ +# UnlockRequestsResult + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**UnlockedCount** | **int32** | Number of requests that were successfully unlocked. | + +## Methods + +### NewUnlockRequestsResult + +`func NewUnlockRequestsResult(unlockedCount int32, ) *UnlockRequestsResult` + +NewUnlockRequestsResult instantiates a new UnlockRequestsResult object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewUnlockRequestsResultWithDefaults + +`func NewUnlockRequestsResultWithDefaults() *UnlockRequestsResult` + +NewUnlockRequestsResultWithDefaults instantiates a new UnlockRequestsResult object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetUnlockedCount + +`func (o *UnlockRequestsResult) GetUnlockedCount() int32` + +GetUnlockedCount returns the UnlockedCount field if non-nil, zero value otherwise. + +### GetUnlockedCountOk + +`func (o *UnlockRequestsResult) GetUnlockedCountOk() (*int32, bool)` + +GetUnlockedCountOk returns a tuple with the UnlockedCount field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUnlockedCount + +`func (o *UnlockRequestsResult) SetUnlockedCount(v int32)` + +SetUnlockedCount sets UnlockedCount field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/UpdateActorRequest.md b/docs/UpdateActorRequest.md new file mode 100644 index 0000000..bffcca1 --- /dev/null +++ b/docs/UpdateActorRequest.md @@ -0,0 +1,546 @@ +# UpdateActorRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Name** | Pointer to **string** | | [optional] +**Description** | Pointer to **NullableString** | | [optional] +**IsPublic** | Pointer to **bool** | | [optional] +**ActorPermissionLevel** | Pointer to [**NullableActorPermissionLevel**](ActorPermissionLevel.md) | | [optional] +**SeoTitle** | Pointer to **NullableString** | | [optional] +**SeoDescription** | Pointer to **NullableString** | | [optional] +**Title** | Pointer to **NullableString** | | [optional] +**RestartOnError** | Pointer to **bool** | | [optional] +**Versions** | Pointer to [**[]CreateOrUpdateVersionRequest**](CreateOrUpdateVersionRequest.md) | | [optional] +**PricingInfos** | Pointer to [**[]ActorRunPricingInfo**](ActorRunPricingInfo.md) | | [optional] +**Categories** | Pointer to **[]string** | | [optional] +**DefaultRunOptions** | Pointer to [**NullableDefaultRunOptions**](DefaultRunOptions.md) | | [optional] +**TaggedBuilds** | Pointer to [**map[string]BuildTag**](BuildTag.md) | An object to modify tags on the Actor's builds. The key is the tag name (e.g., _latest_), and the value is either an object with a `buildId` or `null`. This operation is a patch; any existing tags that you omit from this object will be preserved. - **To create or reassign a tag**, provide the tag name with a `buildId`. e.g., to assign the _latest_ tag: &nbsp; ```json { \"latest\": { \"buildId\": \"z2EryhbfhgSyqj6Hn\" } } ``` - **To remove a tag**, provide the tag name with a `null` value. e.g., to remove the _beta_ tag: &nbsp; ```json { \"beta\": null } ``` - **To perform multiple operations**, combine them. The following reassigns _latest_ and removes _beta_, while preserving any other existing tags. &nbsp; ```json { \"latest\": { \"buildId\": \"z2EryhbfhgSyqj6Hn\" }, \"beta\": null } ``` | [optional] +**ActorStandby** | Pointer to [**NullableActorStandby**](ActorStandby.md) | | [optional] +**ExampleRunInput** | Pointer to [**NullableExampleRunInput**](ExampleRunInput.md) | | [optional] +**IsDeprecated** | Pointer to **NullableBool** | | [optional] + +## Methods + +### NewUpdateActorRequest + +`func NewUpdateActorRequest() *UpdateActorRequest` + +NewUpdateActorRequest instantiates a new UpdateActorRequest object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewUpdateActorRequestWithDefaults + +`func NewUpdateActorRequestWithDefaults() *UpdateActorRequest` + +NewUpdateActorRequestWithDefaults instantiates a new UpdateActorRequest object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetName + +`func (o *UpdateActorRequest) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *UpdateActorRequest) GetNameOk() (*string, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetName + +`func (o *UpdateActorRequest) SetName(v string)` + +SetName sets Name field to given value. + +### HasName + +`func (o *UpdateActorRequest) HasName() bool` + +HasName returns a boolean if a field has been set. + +### GetDescription + +`func (o *UpdateActorRequest) GetDescription() string` + +GetDescription returns the Description field if non-nil, zero value otherwise. + +### GetDescriptionOk + +`func (o *UpdateActorRequest) GetDescriptionOk() (*string, bool)` + +GetDescriptionOk returns a tuple with the Description field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDescription + +`func (o *UpdateActorRequest) SetDescription(v string)` + +SetDescription sets Description field to given value. + +### HasDescription + +`func (o *UpdateActorRequest) HasDescription() bool` + +HasDescription returns a boolean if a field has been set. + +### SetDescriptionNil + +`func (o *UpdateActorRequest) SetDescriptionNil(b bool)` + + SetDescriptionNil sets the value for Description to be an explicit nil + +### UnsetDescription +`func (o *UpdateActorRequest) UnsetDescription()` + +UnsetDescription ensures that no value is present for Description, not even an explicit nil +### GetIsPublic + +`func (o *UpdateActorRequest) GetIsPublic() bool` + +GetIsPublic returns the IsPublic field if non-nil, zero value otherwise. + +### GetIsPublicOk + +`func (o *UpdateActorRequest) GetIsPublicOk() (*bool, bool)` + +GetIsPublicOk returns a tuple with the IsPublic field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetIsPublic + +`func (o *UpdateActorRequest) SetIsPublic(v bool)` + +SetIsPublic sets IsPublic field to given value. + +### HasIsPublic + +`func (o *UpdateActorRequest) HasIsPublic() bool` + +HasIsPublic returns a boolean if a field has been set. + +### GetActorPermissionLevel + +`func (o *UpdateActorRequest) GetActorPermissionLevel() ActorPermissionLevel` + +GetActorPermissionLevel returns the ActorPermissionLevel field if non-nil, zero value otherwise. + +### GetActorPermissionLevelOk + +`func (o *UpdateActorRequest) GetActorPermissionLevelOk() (*ActorPermissionLevel, bool)` + +GetActorPermissionLevelOk returns a tuple with the ActorPermissionLevel field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetActorPermissionLevel + +`func (o *UpdateActorRequest) SetActorPermissionLevel(v ActorPermissionLevel)` + +SetActorPermissionLevel sets ActorPermissionLevel field to given value. + +### HasActorPermissionLevel + +`func (o *UpdateActorRequest) HasActorPermissionLevel() bool` + +HasActorPermissionLevel returns a boolean if a field has been set. + +### SetActorPermissionLevelNil + +`func (o *UpdateActorRequest) SetActorPermissionLevelNil(b bool)` + + SetActorPermissionLevelNil sets the value for ActorPermissionLevel to be an explicit nil + +### UnsetActorPermissionLevel +`func (o *UpdateActorRequest) UnsetActorPermissionLevel()` + +UnsetActorPermissionLevel ensures that no value is present for ActorPermissionLevel, not even an explicit nil +### GetSeoTitle + +`func (o *UpdateActorRequest) GetSeoTitle() string` + +GetSeoTitle returns the SeoTitle field if non-nil, zero value otherwise. + +### GetSeoTitleOk + +`func (o *UpdateActorRequest) GetSeoTitleOk() (*string, bool)` + +GetSeoTitleOk returns a tuple with the SeoTitle field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSeoTitle + +`func (o *UpdateActorRequest) SetSeoTitle(v string)` + +SetSeoTitle sets SeoTitle field to given value. + +### HasSeoTitle + +`func (o *UpdateActorRequest) HasSeoTitle() bool` + +HasSeoTitle returns a boolean if a field has been set. + +### SetSeoTitleNil + +`func (o *UpdateActorRequest) SetSeoTitleNil(b bool)` + + SetSeoTitleNil sets the value for SeoTitle to be an explicit nil + +### UnsetSeoTitle +`func (o *UpdateActorRequest) UnsetSeoTitle()` + +UnsetSeoTitle ensures that no value is present for SeoTitle, not even an explicit nil +### GetSeoDescription + +`func (o *UpdateActorRequest) GetSeoDescription() string` + +GetSeoDescription returns the SeoDescription field if non-nil, zero value otherwise. + +### GetSeoDescriptionOk + +`func (o *UpdateActorRequest) GetSeoDescriptionOk() (*string, bool)` + +GetSeoDescriptionOk returns a tuple with the SeoDescription field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSeoDescription + +`func (o *UpdateActorRequest) SetSeoDescription(v string)` + +SetSeoDescription sets SeoDescription field to given value. + +### HasSeoDescription + +`func (o *UpdateActorRequest) HasSeoDescription() bool` + +HasSeoDescription returns a boolean if a field has been set. + +### SetSeoDescriptionNil + +`func (o *UpdateActorRequest) SetSeoDescriptionNil(b bool)` + + SetSeoDescriptionNil sets the value for SeoDescription to be an explicit nil + +### UnsetSeoDescription +`func (o *UpdateActorRequest) UnsetSeoDescription()` + +UnsetSeoDescription ensures that no value is present for SeoDescription, not even an explicit nil +### GetTitle + +`func (o *UpdateActorRequest) GetTitle() string` + +GetTitle returns the Title field if non-nil, zero value otherwise. + +### GetTitleOk + +`func (o *UpdateActorRequest) GetTitleOk() (*string, bool)` + +GetTitleOk returns a tuple with the Title field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTitle + +`func (o *UpdateActorRequest) SetTitle(v string)` + +SetTitle sets Title field to given value. + +### HasTitle + +`func (o *UpdateActorRequest) HasTitle() bool` + +HasTitle returns a boolean if a field has been set. + +### SetTitleNil + +`func (o *UpdateActorRequest) SetTitleNil(b bool)` + + SetTitleNil sets the value for Title to be an explicit nil + +### UnsetTitle +`func (o *UpdateActorRequest) UnsetTitle()` + +UnsetTitle ensures that no value is present for Title, not even an explicit nil +### GetRestartOnError + +`func (o *UpdateActorRequest) GetRestartOnError() bool` + +GetRestartOnError returns the RestartOnError field if non-nil, zero value otherwise. + +### GetRestartOnErrorOk + +`func (o *UpdateActorRequest) GetRestartOnErrorOk() (*bool, bool)` + +GetRestartOnErrorOk returns a tuple with the RestartOnError field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRestartOnError + +`func (o *UpdateActorRequest) SetRestartOnError(v bool)` + +SetRestartOnError sets RestartOnError field to given value. + +### HasRestartOnError + +`func (o *UpdateActorRequest) HasRestartOnError() bool` + +HasRestartOnError returns a boolean if a field has been set. + +### GetVersions + +`func (o *UpdateActorRequest) GetVersions() []CreateOrUpdateVersionRequest` + +GetVersions returns the Versions field if non-nil, zero value otherwise. + +### GetVersionsOk + +`func (o *UpdateActorRequest) GetVersionsOk() (*[]CreateOrUpdateVersionRequest, bool)` + +GetVersionsOk returns a tuple with the Versions field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetVersions + +`func (o *UpdateActorRequest) SetVersions(v []CreateOrUpdateVersionRequest)` + +SetVersions sets Versions field to given value. + +### HasVersions + +`func (o *UpdateActorRequest) HasVersions() bool` + +HasVersions returns a boolean if a field has been set. + +### GetPricingInfos + +`func (o *UpdateActorRequest) GetPricingInfos() []ActorRunPricingInfo` + +GetPricingInfos returns the PricingInfos field if non-nil, zero value otherwise. + +### GetPricingInfosOk + +`func (o *UpdateActorRequest) GetPricingInfosOk() (*[]ActorRunPricingInfo, bool)` + +GetPricingInfosOk returns a tuple with the PricingInfos field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPricingInfos + +`func (o *UpdateActorRequest) SetPricingInfos(v []ActorRunPricingInfo)` + +SetPricingInfos sets PricingInfos field to given value. + +### HasPricingInfos + +`func (o *UpdateActorRequest) HasPricingInfos() bool` + +HasPricingInfos returns a boolean if a field has been set. + +### GetCategories + +`func (o *UpdateActorRequest) GetCategories() []string` + +GetCategories returns the Categories field if non-nil, zero value otherwise. + +### GetCategoriesOk + +`func (o *UpdateActorRequest) GetCategoriesOk() (*[]string, bool)` + +GetCategoriesOk returns a tuple with the Categories field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCategories + +`func (o *UpdateActorRequest) SetCategories(v []string)` + +SetCategories sets Categories field to given value. + +### HasCategories + +`func (o *UpdateActorRequest) HasCategories() bool` + +HasCategories returns a boolean if a field has been set. + +### SetCategoriesNil + +`func (o *UpdateActorRequest) SetCategoriesNil(b bool)` + + SetCategoriesNil sets the value for Categories to be an explicit nil + +### UnsetCategories +`func (o *UpdateActorRequest) UnsetCategories()` + +UnsetCategories ensures that no value is present for Categories, not even an explicit nil +### GetDefaultRunOptions + +`func (o *UpdateActorRequest) GetDefaultRunOptions() DefaultRunOptions` + +GetDefaultRunOptions returns the DefaultRunOptions field if non-nil, zero value otherwise. + +### GetDefaultRunOptionsOk + +`func (o *UpdateActorRequest) GetDefaultRunOptionsOk() (*DefaultRunOptions, bool)` + +GetDefaultRunOptionsOk returns a tuple with the DefaultRunOptions field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDefaultRunOptions + +`func (o *UpdateActorRequest) SetDefaultRunOptions(v DefaultRunOptions)` + +SetDefaultRunOptions sets DefaultRunOptions field to given value. + +### HasDefaultRunOptions + +`func (o *UpdateActorRequest) HasDefaultRunOptions() bool` + +HasDefaultRunOptions returns a boolean if a field has been set. + +### SetDefaultRunOptionsNil + +`func (o *UpdateActorRequest) SetDefaultRunOptionsNil(b bool)` + + SetDefaultRunOptionsNil sets the value for DefaultRunOptions to be an explicit nil + +### UnsetDefaultRunOptions +`func (o *UpdateActorRequest) UnsetDefaultRunOptions()` + +UnsetDefaultRunOptions ensures that no value is present for DefaultRunOptions, not even an explicit nil +### GetTaggedBuilds + +`func (o *UpdateActorRequest) GetTaggedBuilds() map[string]BuildTag` + +GetTaggedBuilds returns the TaggedBuilds field if non-nil, zero value otherwise. + +### GetTaggedBuildsOk + +`func (o *UpdateActorRequest) GetTaggedBuildsOk() (*map[string]BuildTag, bool)` + +GetTaggedBuildsOk returns a tuple with the TaggedBuilds field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTaggedBuilds + +`func (o *UpdateActorRequest) SetTaggedBuilds(v map[string]BuildTag)` + +SetTaggedBuilds sets TaggedBuilds field to given value. + +### HasTaggedBuilds + +`func (o *UpdateActorRequest) HasTaggedBuilds() bool` + +HasTaggedBuilds returns a boolean if a field has been set. + +### GetActorStandby + +`func (o *UpdateActorRequest) GetActorStandby() ActorStandby` + +GetActorStandby returns the ActorStandby field if non-nil, zero value otherwise. + +### GetActorStandbyOk + +`func (o *UpdateActorRequest) GetActorStandbyOk() (*ActorStandby, bool)` + +GetActorStandbyOk returns a tuple with the ActorStandby field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetActorStandby + +`func (o *UpdateActorRequest) SetActorStandby(v ActorStandby)` + +SetActorStandby sets ActorStandby field to given value. + +### HasActorStandby + +`func (o *UpdateActorRequest) HasActorStandby() bool` + +HasActorStandby returns a boolean if a field has been set. + +### SetActorStandbyNil + +`func (o *UpdateActorRequest) SetActorStandbyNil(b bool)` + + SetActorStandbyNil sets the value for ActorStandby to be an explicit nil + +### UnsetActorStandby +`func (o *UpdateActorRequest) UnsetActorStandby()` + +UnsetActorStandby ensures that no value is present for ActorStandby, not even an explicit nil +### GetExampleRunInput + +`func (o *UpdateActorRequest) GetExampleRunInput() ExampleRunInput` + +GetExampleRunInput returns the ExampleRunInput field if non-nil, zero value otherwise. + +### GetExampleRunInputOk + +`func (o *UpdateActorRequest) GetExampleRunInputOk() (*ExampleRunInput, bool)` + +GetExampleRunInputOk returns a tuple with the ExampleRunInput field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetExampleRunInput + +`func (o *UpdateActorRequest) SetExampleRunInput(v ExampleRunInput)` + +SetExampleRunInput sets ExampleRunInput field to given value. + +### HasExampleRunInput + +`func (o *UpdateActorRequest) HasExampleRunInput() bool` + +HasExampleRunInput returns a boolean if a field has been set. + +### SetExampleRunInputNil + +`func (o *UpdateActorRequest) SetExampleRunInputNil(b bool)` + + SetExampleRunInputNil sets the value for ExampleRunInput to be an explicit nil + +### UnsetExampleRunInput +`func (o *UpdateActorRequest) UnsetExampleRunInput()` + +UnsetExampleRunInput ensures that no value is present for ExampleRunInput, not even an explicit nil +### GetIsDeprecated + +`func (o *UpdateActorRequest) GetIsDeprecated() bool` + +GetIsDeprecated returns the IsDeprecated field if non-nil, zero value otherwise. + +### GetIsDeprecatedOk + +`func (o *UpdateActorRequest) GetIsDeprecatedOk() (*bool, bool)` + +GetIsDeprecatedOk returns a tuple with the IsDeprecated field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetIsDeprecated + +`func (o *UpdateActorRequest) SetIsDeprecated(v bool)` + +SetIsDeprecated sets IsDeprecated field to given value. + +### HasIsDeprecated + +`func (o *UpdateActorRequest) HasIsDeprecated() bool` + +HasIsDeprecated returns a boolean if a field has been set. + +### SetIsDeprecatedNil + +`func (o *UpdateActorRequest) SetIsDeprecatedNil(b bool)` + + SetIsDeprecatedNil sets the value for IsDeprecated to be an explicit nil + +### UnsetIsDeprecated +`func (o *UpdateActorRequest) UnsetIsDeprecated()` + +UnsetIsDeprecated ensures that no value is present for IsDeprecated, not even an explicit nil + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/UpdateDatasetRequest.md b/docs/UpdateDatasetRequest.md new file mode 100644 index 0000000..4f19cca --- /dev/null +++ b/docs/UpdateDatasetRequest.md @@ -0,0 +1,92 @@ +# UpdateDatasetRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Name** | Pointer to **NullableString** | | [optional] +**GeneralAccess** | Pointer to [**GeneralAccess**](GeneralAccess.md) | | [optional] + +## Methods + +### NewUpdateDatasetRequest + +`func NewUpdateDatasetRequest() *UpdateDatasetRequest` + +NewUpdateDatasetRequest instantiates a new UpdateDatasetRequest object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewUpdateDatasetRequestWithDefaults + +`func NewUpdateDatasetRequestWithDefaults() *UpdateDatasetRequest` + +NewUpdateDatasetRequestWithDefaults instantiates a new UpdateDatasetRequest object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetName + +`func (o *UpdateDatasetRequest) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *UpdateDatasetRequest) GetNameOk() (*string, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetName + +`func (o *UpdateDatasetRequest) SetName(v string)` + +SetName sets Name field to given value. + +### HasName + +`func (o *UpdateDatasetRequest) HasName() bool` + +HasName returns a boolean if a field has been set. + +### SetNameNil + +`func (o *UpdateDatasetRequest) SetNameNil(b bool)` + + SetNameNil sets the value for Name to be an explicit nil + +### UnsetName +`func (o *UpdateDatasetRequest) UnsetName()` + +UnsetName ensures that no value is present for Name, not even an explicit nil +### GetGeneralAccess + +`func (o *UpdateDatasetRequest) GetGeneralAccess() GeneralAccess` + +GetGeneralAccess returns the GeneralAccess field if non-nil, zero value otherwise. + +### GetGeneralAccessOk + +`func (o *UpdateDatasetRequest) GetGeneralAccessOk() (*GeneralAccess, bool)` + +GetGeneralAccessOk returns a tuple with the GeneralAccess field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetGeneralAccess + +`func (o *UpdateDatasetRequest) SetGeneralAccess(v GeneralAccess)` + +SetGeneralAccess sets GeneralAccess field to given value. + +### HasGeneralAccess + +`func (o *UpdateDatasetRequest) HasGeneralAccess() bool` + +HasGeneralAccess returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/UpdateLimitsRequest.md b/docs/UpdateLimitsRequest.md new file mode 100644 index 0000000..7e4f72f --- /dev/null +++ b/docs/UpdateLimitsRequest.md @@ -0,0 +1,82 @@ +# UpdateLimitsRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**MaxMonthlyUsageUsd** | Pointer to **float32** | If your platform usage in the billing period exceeds the prepaid usage, you will be charged extra. Setting this property you can update your hard limit on monthly platform usage to prevent accidental overage or to limit the extra charges. | [optional] +**DataRetentionDays** | Pointer to **int32** | Apify securely stores your ten most recent Actor runs indefinitely, ensuring they are always accessible. Unnamed storages and other Actor runs are automatically deleted after the retention period. If you're subscribed, you can change it to keep data for longer or to limit your usage. [Lear more](https://docs.apify.com/platform/storage/usage#data-retention). | [optional] + +## Methods + +### NewUpdateLimitsRequest + +`func NewUpdateLimitsRequest() *UpdateLimitsRequest` + +NewUpdateLimitsRequest instantiates a new UpdateLimitsRequest object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewUpdateLimitsRequestWithDefaults + +`func NewUpdateLimitsRequestWithDefaults() *UpdateLimitsRequest` + +NewUpdateLimitsRequestWithDefaults instantiates a new UpdateLimitsRequest object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetMaxMonthlyUsageUsd + +`func (o *UpdateLimitsRequest) GetMaxMonthlyUsageUsd() float32` + +GetMaxMonthlyUsageUsd returns the MaxMonthlyUsageUsd field if non-nil, zero value otherwise. + +### GetMaxMonthlyUsageUsdOk + +`func (o *UpdateLimitsRequest) GetMaxMonthlyUsageUsdOk() (*float32, bool)` + +GetMaxMonthlyUsageUsdOk returns a tuple with the MaxMonthlyUsageUsd field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMaxMonthlyUsageUsd + +`func (o *UpdateLimitsRequest) SetMaxMonthlyUsageUsd(v float32)` + +SetMaxMonthlyUsageUsd sets MaxMonthlyUsageUsd field to given value. + +### HasMaxMonthlyUsageUsd + +`func (o *UpdateLimitsRequest) HasMaxMonthlyUsageUsd() bool` + +HasMaxMonthlyUsageUsd returns a boolean if a field has been set. + +### GetDataRetentionDays + +`func (o *UpdateLimitsRequest) GetDataRetentionDays() int32` + +GetDataRetentionDays returns the DataRetentionDays field if non-nil, zero value otherwise. + +### GetDataRetentionDaysOk + +`func (o *UpdateLimitsRequest) GetDataRetentionDaysOk() (*int32, bool)` + +GetDataRetentionDaysOk returns a tuple with the DataRetentionDays field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDataRetentionDays + +`func (o *UpdateLimitsRequest) SetDataRetentionDays(v int32)` + +SetDataRetentionDays sets DataRetentionDays field to given value. + +### HasDataRetentionDays + +`func (o *UpdateLimitsRequest) HasDataRetentionDays() bool` + +HasDataRetentionDays returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/UpdateRequestQueueRequest.md b/docs/UpdateRequestQueueRequest.md new file mode 100644 index 0000000..7c1cbb5 --- /dev/null +++ b/docs/UpdateRequestQueueRequest.md @@ -0,0 +1,92 @@ +# UpdateRequestQueueRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Name** | Pointer to **NullableString** | The new name for the request queue. | [optional] +**GeneralAccess** | Pointer to [**GeneralAccess**](GeneralAccess.md) | | [optional] + +## Methods + +### NewUpdateRequestQueueRequest + +`func NewUpdateRequestQueueRequest() *UpdateRequestQueueRequest` + +NewUpdateRequestQueueRequest instantiates a new UpdateRequestQueueRequest object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewUpdateRequestQueueRequestWithDefaults + +`func NewUpdateRequestQueueRequestWithDefaults() *UpdateRequestQueueRequest` + +NewUpdateRequestQueueRequestWithDefaults instantiates a new UpdateRequestQueueRequest object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetName + +`func (o *UpdateRequestQueueRequest) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *UpdateRequestQueueRequest) GetNameOk() (*string, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetName + +`func (o *UpdateRequestQueueRequest) SetName(v string)` + +SetName sets Name field to given value. + +### HasName + +`func (o *UpdateRequestQueueRequest) HasName() bool` + +HasName returns a boolean if a field has been set. + +### SetNameNil + +`func (o *UpdateRequestQueueRequest) SetNameNil(b bool)` + + SetNameNil sets the value for Name to be an explicit nil + +### UnsetName +`func (o *UpdateRequestQueueRequest) UnsetName()` + +UnsetName ensures that no value is present for Name, not even an explicit nil +### GetGeneralAccess + +`func (o *UpdateRequestQueueRequest) GetGeneralAccess() GeneralAccess` + +GetGeneralAccess returns the GeneralAccess field if non-nil, zero value otherwise. + +### GetGeneralAccessOk + +`func (o *UpdateRequestQueueRequest) GetGeneralAccessOk() (*GeneralAccess, bool)` + +GetGeneralAccessOk returns a tuple with the GeneralAccess field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetGeneralAccess + +`func (o *UpdateRequestQueueRequest) SetGeneralAccess(v GeneralAccess)` + +SetGeneralAccess sets GeneralAccess field to given value. + +### HasGeneralAccess + +`func (o *UpdateRequestQueueRequest) HasGeneralAccess() bool` + +HasGeneralAccess returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/UpdateRequestResponse.md b/docs/UpdateRequestResponse.md new file mode 100644 index 0000000..e0ccda5 --- /dev/null +++ b/docs/UpdateRequestResponse.md @@ -0,0 +1,51 @@ +# UpdateRequestResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Data** | [**RequestRegistration**](RequestRegistration.md) | | + +## Methods + +### NewUpdateRequestResponse + +`func NewUpdateRequestResponse(data RequestRegistration, ) *UpdateRequestResponse` + +NewUpdateRequestResponse instantiates a new UpdateRequestResponse object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewUpdateRequestResponseWithDefaults + +`func NewUpdateRequestResponseWithDefaults() *UpdateRequestResponse` + +NewUpdateRequestResponseWithDefaults instantiates a new UpdateRequestResponse object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetData + +`func (o *UpdateRequestResponse) GetData() RequestRegistration` + +GetData returns the Data field if non-nil, zero value otherwise. + +### GetDataOk + +`func (o *UpdateRequestResponse) GetDataOk() (*RequestRegistration, bool)` + +GetDataOk returns a tuple with the Data field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetData + +`func (o *UpdateRequestResponse) SetData(v RequestRegistration)` + +SetData sets Data field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/UpdateRunRequest.md b/docs/UpdateRunRequest.md new file mode 100644 index 0000000..40b9960 --- /dev/null +++ b/docs/UpdateRunRequest.md @@ -0,0 +1,134 @@ +# UpdateRunRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**RunId** | Pointer to **string** | | [optional] +**StatusMessage** | Pointer to **string** | | [optional] +**IsStatusMessageTerminal** | Pointer to **bool** | | [optional] +**GeneralAccess** | Pointer to [**GeneralAccess**](GeneralAccess.md) | | [optional] + +## Methods + +### NewUpdateRunRequest + +`func NewUpdateRunRequest() *UpdateRunRequest` + +NewUpdateRunRequest instantiates a new UpdateRunRequest object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewUpdateRunRequestWithDefaults + +`func NewUpdateRunRequestWithDefaults() *UpdateRunRequest` + +NewUpdateRunRequestWithDefaults instantiates a new UpdateRunRequest object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetRunId + +`func (o *UpdateRunRequest) GetRunId() string` + +GetRunId returns the RunId field if non-nil, zero value otherwise. + +### GetRunIdOk + +`func (o *UpdateRunRequest) GetRunIdOk() (*string, bool)` + +GetRunIdOk returns a tuple with the RunId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRunId + +`func (o *UpdateRunRequest) SetRunId(v string)` + +SetRunId sets RunId field to given value. + +### HasRunId + +`func (o *UpdateRunRequest) HasRunId() bool` + +HasRunId returns a boolean if a field has been set. + +### GetStatusMessage + +`func (o *UpdateRunRequest) GetStatusMessage() string` + +GetStatusMessage returns the StatusMessage field if non-nil, zero value otherwise. + +### GetStatusMessageOk + +`func (o *UpdateRunRequest) GetStatusMessageOk() (*string, bool)` + +GetStatusMessageOk returns a tuple with the StatusMessage field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetStatusMessage + +`func (o *UpdateRunRequest) SetStatusMessage(v string)` + +SetStatusMessage sets StatusMessage field to given value. + +### HasStatusMessage + +`func (o *UpdateRunRequest) HasStatusMessage() bool` + +HasStatusMessage returns a boolean if a field has been set. + +### GetIsStatusMessageTerminal + +`func (o *UpdateRunRequest) GetIsStatusMessageTerminal() bool` + +GetIsStatusMessageTerminal returns the IsStatusMessageTerminal field if non-nil, zero value otherwise. + +### GetIsStatusMessageTerminalOk + +`func (o *UpdateRunRequest) GetIsStatusMessageTerminalOk() (*bool, bool)` + +GetIsStatusMessageTerminalOk returns a tuple with the IsStatusMessageTerminal field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetIsStatusMessageTerminal + +`func (o *UpdateRunRequest) SetIsStatusMessageTerminal(v bool)` + +SetIsStatusMessageTerminal sets IsStatusMessageTerminal field to given value. + +### HasIsStatusMessageTerminal + +`func (o *UpdateRunRequest) HasIsStatusMessageTerminal() bool` + +HasIsStatusMessageTerminal returns a boolean if a field has been set. + +### GetGeneralAccess + +`func (o *UpdateRunRequest) GetGeneralAccess() GeneralAccess` + +GetGeneralAccess returns the GeneralAccess field if non-nil, zero value otherwise. + +### GetGeneralAccessOk + +`func (o *UpdateRunRequest) GetGeneralAccessOk() (*GeneralAccess, bool)` + +GetGeneralAccessOk returns a tuple with the GeneralAccess field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetGeneralAccess + +`func (o *UpdateRunRequest) SetGeneralAccess(v GeneralAccess)` + +SetGeneralAccess sets GeneralAccess field to given value. + +### HasGeneralAccess + +`func (o *UpdateRunRequest) HasGeneralAccess() bool` + +HasGeneralAccess returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/UpdateStoreRequest.md b/docs/UpdateStoreRequest.md new file mode 100644 index 0000000..16650b0 --- /dev/null +++ b/docs/UpdateStoreRequest.md @@ -0,0 +1,92 @@ +# UpdateStoreRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Name** | Pointer to **NullableString** | | [optional] +**GeneralAccess** | Pointer to [**GeneralAccess**](GeneralAccess.md) | | [optional] + +## Methods + +### NewUpdateStoreRequest + +`func NewUpdateStoreRequest() *UpdateStoreRequest` + +NewUpdateStoreRequest instantiates a new UpdateStoreRequest object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewUpdateStoreRequestWithDefaults + +`func NewUpdateStoreRequestWithDefaults() *UpdateStoreRequest` + +NewUpdateStoreRequestWithDefaults instantiates a new UpdateStoreRequest object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetName + +`func (o *UpdateStoreRequest) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *UpdateStoreRequest) GetNameOk() (*string, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetName + +`func (o *UpdateStoreRequest) SetName(v string)` + +SetName sets Name field to given value. + +### HasName + +`func (o *UpdateStoreRequest) HasName() bool` + +HasName returns a boolean if a field has been set. + +### SetNameNil + +`func (o *UpdateStoreRequest) SetNameNil(b bool)` + + SetNameNil sets the value for Name to be an explicit nil + +### UnsetName +`func (o *UpdateStoreRequest) UnsetName()` + +UnsetName ensures that no value is present for Name, not even an explicit nil +### GetGeneralAccess + +`func (o *UpdateStoreRequest) GetGeneralAccess() GeneralAccess` + +GetGeneralAccess returns the GeneralAccess field if non-nil, zero value otherwise. + +### GetGeneralAccessOk + +`func (o *UpdateStoreRequest) GetGeneralAccessOk() (*GeneralAccess, bool)` + +GetGeneralAccessOk returns a tuple with the GeneralAccess field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetGeneralAccess + +`func (o *UpdateStoreRequest) SetGeneralAccess(v GeneralAccess)` + +SetGeneralAccess sets GeneralAccess field to given value. + +### HasGeneralAccess + +`func (o *UpdateStoreRequest) HasGeneralAccess() bool` + +HasGeneralAccess returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/UpdateTaskRequest.md b/docs/UpdateTaskRequest.md new file mode 100644 index 0000000..26b8f50 --- /dev/null +++ b/docs/UpdateTaskRequest.md @@ -0,0 +1,200 @@ +# UpdateTaskRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Name** | Pointer to **string** | | [optional] +**Options** | Pointer to [**NullableTaskOptions**](TaskOptions.md) | | [optional] +**Input** | Pointer to **map[string]interface{}** | The input configuration for the Actor task. This is a user-defined JSON object that will be passed to the Actor when the task is run. | [optional] +**Title** | Pointer to **NullableString** | | [optional] +**ActorStandby** | Pointer to [**NullableActorStandby**](ActorStandby.md) | | [optional] + +## Methods + +### NewUpdateTaskRequest + +`func NewUpdateTaskRequest() *UpdateTaskRequest` + +NewUpdateTaskRequest instantiates a new UpdateTaskRequest object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewUpdateTaskRequestWithDefaults + +`func NewUpdateTaskRequestWithDefaults() *UpdateTaskRequest` + +NewUpdateTaskRequestWithDefaults instantiates a new UpdateTaskRequest object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetName + +`func (o *UpdateTaskRequest) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *UpdateTaskRequest) GetNameOk() (*string, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetName + +`func (o *UpdateTaskRequest) SetName(v string)` + +SetName sets Name field to given value. + +### HasName + +`func (o *UpdateTaskRequest) HasName() bool` + +HasName returns a boolean if a field has been set. + +### GetOptions + +`func (o *UpdateTaskRequest) GetOptions() TaskOptions` + +GetOptions returns the Options field if non-nil, zero value otherwise. + +### GetOptionsOk + +`func (o *UpdateTaskRequest) GetOptionsOk() (*TaskOptions, bool)` + +GetOptionsOk returns a tuple with the Options field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetOptions + +`func (o *UpdateTaskRequest) SetOptions(v TaskOptions)` + +SetOptions sets Options field to given value. + +### HasOptions + +`func (o *UpdateTaskRequest) HasOptions() bool` + +HasOptions returns a boolean if a field has been set. + +### SetOptionsNil + +`func (o *UpdateTaskRequest) SetOptionsNil(b bool)` + + SetOptionsNil sets the value for Options to be an explicit nil + +### UnsetOptions +`func (o *UpdateTaskRequest) UnsetOptions()` + +UnsetOptions ensures that no value is present for Options, not even an explicit nil +### GetInput + +`func (o *UpdateTaskRequest) GetInput() map[string]interface{}` + +GetInput returns the Input field if non-nil, zero value otherwise. + +### GetInputOk + +`func (o *UpdateTaskRequest) GetInputOk() (*map[string]interface{}, bool)` + +GetInputOk returns a tuple with the Input field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetInput + +`func (o *UpdateTaskRequest) SetInput(v map[string]interface{})` + +SetInput sets Input field to given value. + +### HasInput + +`func (o *UpdateTaskRequest) HasInput() bool` + +HasInput returns a boolean if a field has been set. + +### SetInputNil + +`func (o *UpdateTaskRequest) SetInputNil(b bool)` + + SetInputNil sets the value for Input to be an explicit nil + +### UnsetInput +`func (o *UpdateTaskRequest) UnsetInput()` + +UnsetInput ensures that no value is present for Input, not even an explicit nil +### GetTitle + +`func (o *UpdateTaskRequest) GetTitle() string` + +GetTitle returns the Title field if non-nil, zero value otherwise. + +### GetTitleOk + +`func (o *UpdateTaskRequest) GetTitleOk() (*string, bool)` + +GetTitleOk returns a tuple with the Title field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTitle + +`func (o *UpdateTaskRequest) SetTitle(v string)` + +SetTitle sets Title field to given value. + +### HasTitle + +`func (o *UpdateTaskRequest) HasTitle() bool` + +HasTitle returns a boolean if a field has been set. + +### SetTitleNil + +`func (o *UpdateTaskRequest) SetTitleNil(b bool)` + + SetTitleNil sets the value for Title to be an explicit nil + +### UnsetTitle +`func (o *UpdateTaskRequest) UnsetTitle()` + +UnsetTitle ensures that no value is present for Title, not even an explicit nil +### GetActorStandby + +`func (o *UpdateTaskRequest) GetActorStandby() ActorStandby` + +GetActorStandby returns the ActorStandby field if non-nil, zero value otherwise. + +### GetActorStandbyOk + +`func (o *UpdateTaskRequest) GetActorStandbyOk() (*ActorStandby, bool)` + +GetActorStandbyOk returns a tuple with the ActorStandby field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetActorStandby + +`func (o *UpdateTaskRequest) SetActorStandby(v ActorStandby)` + +SetActorStandby sets ActorStandby field to given value. + +### HasActorStandby + +`func (o *UpdateTaskRequest) HasActorStandby() bool` + +HasActorStandby returns a boolean if a field has been set. + +### SetActorStandbyNil + +`func (o *UpdateTaskRequest) SetActorStandbyNil(b bool)` + + SetActorStandbyNil sets the value for ActorStandby to be an explicit nil + +### UnsetActorStandby +`func (o *UpdateTaskRequest) UnsetActorStandby()` + +UnsetActorStandby ensures that no value is present for ActorStandby, not even an explicit nil + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/UsageCycle.md b/docs/UsageCycle.md new file mode 100644 index 0000000..99200c1 --- /dev/null +++ b/docs/UsageCycle.md @@ -0,0 +1,72 @@ +# UsageCycle + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**StartAt** | **time.Time** | | +**EndAt** | **time.Time** | | + +## Methods + +### NewUsageCycle + +`func NewUsageCycle(startAt time.Time, endAt time.Time, ) *UsageCycle` + +NewUsageCycle instantiates a new UsageCycle object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewUsageCycleWithDefaults + +`func NewUsageCycleWithDefaults() *UsageCycle` + +NewUsageCycleWithDefaults instantiates a new UsageCycle object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetStartAt + +`func (o *UsageCycle) GetStartAt() time.Time` + +GetStartAt returns the StartAt field if non-nil, zero value otherwise. + +### GetStartAtOk + +`func (o *UsageCycle) GetStartAtOk() (*time.Time, bool)` + +GetStartAtOk returns a tuple with the StartAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetStartAt + +`func (o *UsageCycle) SetStartAt(v time.Time)` + +SetStartAt sets StartAt field to given value. + + +### GetEndAt + +`func (o *UsageCycle) GetEndAt() time.Time` + +GetEndAt returns the EndAt field if non-nil, zero value otherwise. + +### GetEndAtOk + +`func (o *UsageCycle) GetEndAtOk() (*time.Time, bool)` + +GetEndAtOk returns a tuple with the EndAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetEndAt + +`func (o *UsageCycle) SetEndAt(v time.Time)` + +SetEndAt sets EndAt field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/UsageItem.md b/docs/UsageItem.md new file mode 100644 index 0000000..a567c12 --- /dev/null +++ b/docs/UsageItem.md @@ -0,0 +1,150 @@ +# UsageItem + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Quantity** | **float32** | | +**BaseAmountUsd** | **float32** | | +**BaseUnitPriceUsd** | Pointer to **float32** | | [optional] +**AmountAfterVolumeDiscountUsd** | Pointer to **float32** | | [optional] +**PriceTiers** | Pointer to [**[]PriceTiers**](PriceTiers.md) | | [optional] + +## Methods + +### NewUsageItem + +`func NewUsageItem(quantity float32, baseAmountUsd float32, ) *UsageItem` + +NewUsageItem instantiates a new UsageItem object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewUsageItemWithDefaults + +`func NewUsageItemWithDefaults() *UsageItem` + +NewUsageItemWithDefaults instantiates a new UsageItem object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetQuantity + +`func (o *UsageItem) GetQuantity() float32` + +GetQuantity returns the Quantity field if non-nil, zero value otherwise. + +### GetQuantityOk + +`func (o *UsageItem) GetQuantityOk() (*float32, bool)` + +GetQuantityOk returns a tuple with the Quantity field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetQuantity + +`func (o *UsageItem) SetQuantity(v float32)` + +SetQuantity sets Quantity field to given value. + + +### GetBaseAmountUsd + +`func (o *UsageItem) GetBaseAmountUsd() float32` + +GetBaseAmountUsd returns the BaseAmountUsd field if non-nil, zero value otherwise. + +### GetBaseAmountUsdOk + +`func (o *UsageItem) GetBaseAmountUsdOk() (*float32, bool)` + +GetBaseAmountUsdOk returns a tuple with the BaseAmountUsd field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetBaseAmountUsd + +`func (o *UsageItem) SetBaseAmountUsd(v float32)` + +SetBaseAmountUsd sets BaseAmountUsd field to given value. + + +### GetBaseUnitPriceUsd + +`func (o *UsageItem) GetBaseUnitPriceUsd() float32` + +GetBaseUnitPriceUsd returns the BaseUnitPriceUsd field if non-nil, zero value otherwise. + +### GetBaseUnitPriceUsdOk + +`func (o *UsageItem) GetBaseUnitPriceUsdOk() (*float32, bool)` + +GetBaseUnitPriceUsdOk returns a tuple with the BaseUnitPriceUsd field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetBaseUnitPriceUsd + +`func (o *UsageItem) SetBaseUnitPriceUsd(v float32)` + +SetBaseUnitPriceUsd sets BaseUnitPriceUsd field to given value. + +### HasBaseUnitPriceUsd + +`func (o *UsageItem) HasBaseUnitPriceUsd() bool` + +HasBaseUnitPriceUsd returns a boolean if a field has been set. + +### GetAmountAfterVolumeDiscountUsd + +`func (o *UsageItem) GetAmountAfterVolumeDiscountUsd() float32` + +GetAmountAfterVolumeDiscountUsd returns the AmountAfterVolumeDiscountUsd field if non-nil, zero value otherwise. + +### GetAmountAfterVolumeDiscountUsdOk + +`func (o *UsageItem) GetAmountAfterVolumeDiscountUsdOk() (*float32, bool)` + +GetAmountAfterVolumeDiscountUsdOk returns a tuple with the AmountAfterVolumeDiscountUsd field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAmountAfterVolumeDiscountUsd + +`func (o *UsageItem) SetAmountAfterVolumeDiscountUsd(v float32)` + +SetAmountAfterVolumeDiscountUsd sets AmountAfterVolumeDiscountUsd field to given value. + +### HasAmountAfterVolumeDiscountUsd + +`func (o *UsageItem) HasAmountAfterVolumeDiscountUsd() bool` + +HasAmountAfterVolumeDiscountUsd returns a boolean if a field has been set. + +### GetPriceTiers + +`func (o *UsageItem) GetPriceTiers() []PriceTiers` + +GetPriceTiers returns the PriceTiers field if non-nil, zero value otherwise. + +### GetPriceTiersOk + +`func (o *UsageItem) GetPriceTiersOk() (*[]PriceTiers, bool)` + +GetPriceTiersOk returns a tuple with the PriceTiers field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPriceTiers + +`func (o *UsageItem) SetPriceTiers(v []PriceTiers)` + +SetPriceTiers sets PriceTiers field to given value. + +### HasPriceTiers + +`func (o *UsageItem) HasPriceTiers() bool` + +HasPriceTiers returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/UserPrivateInfo.md b/docs/UserPrivateInfo.md new file mode 100644 index 0000000..179f6df --- /dev/null +++ b/docs/UserPrivateInfo.md @@ -0,0 +1,219 @@ +# UserPrivateInfo + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **string** | | +**Username** | **string** | | +**Profile** | [**Profile**](Profile.md) | | +**Email** | **string** | | +**Proxy** | [**Proxy**](Proxy.md) | | +**Plan** | [**Plan**](Plan.md) | | +**EffectivePlatformFeatures** | [**EffectivePlatformFeatures**](EffectivePlatformFeatures.md) | | +**CreatedAt** | **time.Time** | | +**IsPaying** | **bool** | | + +## Methods + +### NewUserPrivateInfo + +`func NewUserPrivateInfo(id string, username string, profile Profile, email string, proxy Proxy, plan Plan, effectivePlatformFeatures EffectivePlatformFeatures, createdAt time.Time, isPaying bool, ) *UserPrivateInfo` + +NewUserPrivateInfo instantiates a new UserPrivateInfo object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewUserPrivateInfoWithDefaults + +`func NewUserPrivateInfoWithDefaults() *UserPrivateInfo` + +NewUserPrivateInfoWithDefaults instantiates a new UserPrivateInfo object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetId + +`func (o *UserPrivateInfo) GetId() string` + +GetId returns the Id field if non-nil, zero value otherwise. + +### GetIdOk + +`func (o *UserPrivateInfo) GetIdOk() (*string, bool)` + +GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetId + +`func (o *UserPrivateInfo) SetId(v string)` + +SetId sets Id field to given value. + + +### GetUsername + +`func (o *UserPrivateInfo) GetUsername() string` + +GetUsername returns the Username field if non-nil, zero value otherwise. + +### GetUsernameOk + +`func (o *UserPrivateInfo) GetUsernameOk() (*string, bool)` + +GetUsernameOk returns a tuple with the Username field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUsername + +`func (o *UserPrivateInfo) SetUsername(v string)` + +SetUsername sets Username field to given value. + + +### GetProfile + +`func (o *UserPrivateInfo) GetProfile() Profile` + +GetProfile returns the Profile field if non-nil, zero value otherwise. + +### GetProfileOk + +`func (o *UserPrivateInfo) GetProfileOk() (*Profile, bool)` + +GetProfileOk returns a tuple with the Profile field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetProfile + +`func (o *UserPrivateInfo) SetProfile(v Profile)` + +SetProfile sets Profile field to given value. + + +### GetEmail + +`func (o *UserPrivateInfo) GetEmail() string` + +GetEmail returns the Email field if non-nil, zero value otherwise. + +### GetEmailOk + +`func (o *UserPrivateInfo) GetEmailOk() (*string, bool)` + +GetEmailOk returns a tuple with the Email field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetEmail + +`func (o *UserPrivateInfo) SetEmail(v string)` + +SetEmail sets Email field to given value. + + +### GetProxy + +`func (o *UserPrivateInfo) GetProxy() Proxy` + +GetProxy returns the Proxy field if non-nil, zero value otherwise. + +### GetProxyOk + +`func (o *UserPrivateInfo) GetProxyOk() (*Proxy, bool)` + +GetProxyOk returns a tuple with the Proxy field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetProxy + +`func (o *UserPrivateInfo) SetProxy(v Proxy)` + +SetProxy sets Proxy field to given value. + + +### GetPlan + +`func (o *UserPrivateInfo) GetPlan() Plan` + +GetPlan returns the Plan field if non-nil, zero value otherwise. + +### GetPlanOk + +`func (o *UserPrivateInfo) GetPlanOk() (*Plan, bool)` + +GetPlanOk returns a tuple with the Plan field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPlan + +`func (o *UserPrivateInfo) SetPlan(v Plan)` + +SetPlan sets Plan field to given value. + + +### GetEffectivePlatformFeatures + +`func (o *UserPrivateInfo) GetEffectivePlatformFeatures() EffectivePlatformFeatures` + +GetEffectivePlatformFeatures returns the EffectivePlatformFeatures field if non-nil, zero value otherwise. + +### GetEffectivePlatformFeaturesOk + +`func (o *UserPrivateInfo) GetEffectivePlatformFeaturesOk() (*EffectivePlatformFeatures, bool)` + +GetEffectivePlatformFeaturesOk returns a tuple with the EffectivePlatformFeatures field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetEffectivePlatformFeatures + +`func (o *UserPrivateInfo) SetEffectivePlatformFeatures(v EffectivePlatformFeatures)` + +SetEffectivePlatformFeatures sets EffectivePlatformFeatures field to given value. + + +### GetCreatedAt + +`func (o *UserPrivateInfo) GetCreatedAt() time.Time` + +GetCreatedAt returns the CreatedAt field if non-nil, zero value otherwise. + +### GetCreatedAtOk + +`func (o *UserPrivateInfo) GetCreatedAtOk() (*time.Time, bool)` + +GetCreatedAtOk returns a tuple with the CreatedAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCreatedAt + +`func (o *UserPrivateInfo) SetCreatedAt(v time.Time)` + +SetCreatedAt sets CreatedAt field to given value. + + +### GetIsPaying + +`func (o *UserPrivateInfo) GetIsPaying() bool` + +GetIsPaying returns the IsPaying field if non-nil, zero value otherwise. + +### GetIsPayingOk + +`func (o *UserPrivateInfo) GetIsPayingOk() (*bool, bool)` + +GetIsPayingOk returns a tuple with the IsPaying field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetIsPaying + +`func (o *UserPrivateInfo) SetIsPaying(v bool)` + +SetIsPaying sets IsPaying field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/UserPublicInfo.md b/docs/UserPublicInfo.md new file mode 100644 index 0000000..a98f27c --- /dev/null +++ b/docs/UserPublicInfo.md @@ -0,0 +1,77 @@ +# UserPublicInfo + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Username** | **string** | | +**Profile** | Pointer to [**Profile**](Profile.md) | | [optional] + +## Methods + +### NewUserPublicInfo + +`func NewUserPublicInfo(username string, ) *UserPublicInfo` + +NewUserPublicInfo instantiates a new UserPublicInfo object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewUserPublicInfoWithDefaults + +`func NewUserPublicInfoWithDefaults() *UserPublicInfo` + +NewUserPublicInfoWithDefaults instantiates a new UserPublicInfo object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetUsername + +`func (o *UserPublicInfo) GetUsername() string` + +GetUsername returns the Username field if non-nil, zero value otherwise. + +### GetUsernameOk + +`func (o *UserPublicInfo) GetUsernameOk() (*string, bool)` + +GetUsernameOk returns a tuple with the Username field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUsername + +`func (o *UserPublicInfo) SetUsername(v string)` + +SetUsername sets Username field to given value. + + +### GetProfile + +`func (o *UserPublicInfo) GetProfile() Profile` + +GetProfile returns the Profile field if non-nil, zero value otherwise. + +### GetProfileOk + +`func (o *UserPublicInfo) GetProfileOk() (*Profile, bool)` + +GetProfileOk returns a tuple with the Profile field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetProfile + +`func (o *UserPublicInfo) SetProfile(v Profile)` + +SetProfile sets Profile field to given value. + +### HasProfile + +`func (o *UserPublicInfo) HasProfile() bool` + +HasProfile returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/UsersAPI.md b/docs/UsersAPI.md new file mode 100644 index 0000000..80dc11a --- /dev/null +++ b/docs/UsersAPI.md @@ -0,0 +1,337 @@ +# \UsersAPI + +All URIs are relative to *https://api.apify.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**UserGet**](UsersAPI.md#UserGet) | **Get** /v2/users/{userId} | Get public user data +[**UsersMeGet**](UsersAPI.md#UsersMeGet) | **Get** /v2/users/me | Get private user data +[**UsersMeLimitsGet**](UsersAPI.md#UsersMeLimitsGet) | **Get** /v2/users/me/limits | Get limits +[**UsersMeLimitsPut**](UsersAPI.md#UsersMeLimitsPut) | **Put** /v2/users/me/limits | Update limits +[**UsersMeUsageMonthlyGet**](UsersAPI.md#UsersMeUsageMonthlyGet) | **Get** /v2/users/me/usage/monthly | Get monthly usage + + + +## UserGet + +> PublicUserDataResponse UserGet(ctx, userId).Execute() + +Get public user data + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + userId := "HGzIk8z78YcAPEB" // string | User ID or username. + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.UsersAPI.UserGet(context.Background(), userId).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `UsersAPI.UserGet``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `UserGet`: PublicUserDataResponse + fmt.Fprintf(os.Stdout, "Response from `UsersAPI.UserGet`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**userId** | **string** | User ID or username. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiUserGetRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + +### Return type + +[**PublicUserDataResponse**](PublicUserDataResponse.md) + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## UsersMeGet + +> PrivateUserDataResponse UsersMeGet(ctx).Execute() + +Get private user data + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.UsersAPI.UsersMeGet(context.Background()).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `UsersAPI.UsersMeGet``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `UsersMeGet`: PrivateUserDataResponse + fmt.Fprintf(os.Stdout, "Response from `UsersAPI.UsersMeGet`: %v\n", resp) +} +``` + +### Path Parameters + +This endpoint does not need any parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a apiUsersMeGetRequest struct via the builder pattern + + +### Return type + +[**PrivateUserDataResponse**](PrivateUserDataResponse.md) + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## UsersMeLimitsGet + +> LimitsResponse UsersMeLimitsGet(ctx).Execute() + +Get limits + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.UsersAPI.UsersMeLimitsGet(context.Background()).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `UsersAPI.UsersMeLimitsGet``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `UsersMeLimitsGet`: LimitsResponse + fmt.Fprintf(os.Stdout, "Response from `UsersAPI.UsersMeLimitsGet`: %v\n", resp) +} +``` + +### Path Parameters + +This endpoint does not need any parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a apiUsersMeLimitsGetRequest struct via the builder pattern + + +### Return type + +[**LimitsResponse**](LimitsResponse.md) + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## UsersMeLimitsPut + +> map[string]interface{} UsersMeLimitsPut(ctx).UpdateLimitsRequest(updateLimitsRequest).Execute() + +Update limits + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + updateLimitsRequest := *openapiclient.NewUpdateLimitsRequest() // UpdateLimitsRequest | (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.UsersAPI.UsersMeLimitsPut(context.Background()).UpdateLimitsRequest(updateLimitsRequest).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `UsersAPI.UsersMeLimitsPut``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `UsersMeLimitsPut`: map[string]interface{} + fmt.Fprintf(os.Stdout, "Response from `UsersAPI.UsersMeLimitsPut`: %v\n", resp) +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiUsersMeLimitsPutRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **updateLimitsRequest** | [**UpdateLimitsRequest**](UpdateLimitsRequest.md) | | + +### Return type + +**map[string]interface{}** + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## UsersMeUsageMonthlyGet + +> MonthlyUsageResponse UsersMeUsageMonthlyGet(ctx).Date(date).Execute() + +Get monthly usage + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + date := "2020-06-14" // string | Date in the YYYY-MM-DD format. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.UsersAPI.UsersMeUsageMonthlyGet(context.Background()).Date(date).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `UsersAPI.UsersMeUsageMonthlyGet``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `UsersMeUsageMonthlyGet`: MonthlyUsageResponse + fmt.Fprintf(os.Stdout, "Response from `UsersAPI.UsersMeUsageMonthlyGet`: %v\n", resp) +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiUsersMeUsageMonthlyGetRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **date** | **string** | Date in the YYYY-MM-DD format. | + +### Return type + +[**MonthlyUsageResponse**](MonthlyUsageResponse.md) + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/docs/ValidationError.md b/docs/ValidationError.md new file mode 100644 index 0000000..064378d --- /dev/null +++ b/docs/ValidationError.md @@ -0,0 +1,160 @@ +# ValidationError + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**InstancePath** | Pointer to **string** | The path to the instance being validated. | [optional] +**SchemaPath** | Pointer to **string** | The path to the schema that failed the validation. | [optional] +**Keyword** | Pointer to **string** | The validation keyword that caused the error. | [optional] +**Message** | Pointer to **string** | A message describing the validation error. | [optional] +**Params** | Pointer to **map[string]interface{}** | Additional parameters specific to the validation error. | [optional] + +## Methods + +### NewValidationError + +`func NewValidationError() *ValidationError` + +NewValidationError instantiates a new ValidationError object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewValidationErrorWithDefaults + +`func NewValidationErrorWithDefaults() *ValidationError` + +NewValidationErrorWithDefaults instantiates a new ValidationError object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetInstancePath + +`func (o *ValidationError) GetInstancePath() string` + +GetInstancePath returns the InstancePath field if non-nil, zero value otherwise. + +### GetInstancePathOk + +`func (o *ValidationError) GetInstancePathOk() (*string, bool)` + +GetInstancePathOk returns a tuple with the InstancePath field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetInstancePath + +`func (o *ValidationError) SetInstancePath(v string)` + +SetInstancePath sets InstancePath field to given value. + +### HasInstancePath + +`func (o *ValidationError) HasInstancePath() bool` + +HasInstancePath returns a boolean if a field has been set. + +### GetSchemaPath + +`func (o *ValidationError) GetSchemaPath() string` + +GetSchemaPath returns the SchemaPath field if non-nil, zero value otherwise. + +### GetSchemaPathOk + +`func (o *ValidationError) GetSchemaPathOk() (*string, bool)` + +GetSchemaPathOk returns a tuple with the SchemaPath field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSchemaPath + +`func (o *ValidationError) SetSchemaPath(v string)` + +SetSchemaPath sets SchemaPath field to given value. + +### HasSchemaPath + +`func (o *ValidationError) HasSchemaPath() bool` + +HasSchemaPath returns a boolean if a field has been set. + +### GetKeyword + +`func (o *ValidationError) GetKeyword() string` + +GetKeyword returns the Keyword field if non-nil, zero value otherwise. + +### GetKeywordOk + +`func (o *ValidationError) GetKeywordOk() (*string, bool)` + +GetKeywordOk returns a tuple with the Keyword field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetKeyword + +`func (o *ValidationError) SetKeyword(v string)` + +SetKeyword sets Keyword field to given value. + +### HasKeyword + +`func (o *ValidationError) HasKeyword() bool` + +HasKeyword returns a boolean if a field has been set. + +### GetMessage + +`func (o *ValidationError) GetMessage() string` + +GetMessage returns the Message field if non-nil, zero value otherwise. + +### GetMessageOk + +`func (o *ValidationError) GetMessageOk() (*string, bool)` + +GetMessageOk returns a tuple with the Message field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMessage + +`func (o *ValidationError) SetMessage(v string)` + +SetMessage sets Message field to given value. + +### HasMessage + +`func (o *ValidationError) HasMessage() bool` + +HasMessage returns a boolean if a field has been set. + +### GetParams + +`func (o *ValidationError) GetParams() map[string]interface{}` + +GetParams returns the Params field if non-nil, zero value otherwise. + +### GetParamsOk + +`func (o *ValidationError) GetParamsOk() (*map[string]interface{}, bool)` + +GetParamsOk returns a tuple with the Params field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetParams + +`func (o *ValidationError) SetParams(v map[string]interface{})` + +SetParams sets Params field to given value. + +### HasParams + +`func (o *ValidationError) HasParams() bool` + +HasParams returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/Version.md b/docs/Version.md new file mode 100644 index 0000000..08e65e3 --- /dev/null +++ b/docs/Version.md @@ -0,0 +1,314 @@ +# Version + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**VersionNumber** | **string** | | +**SourceType** | [**NullableVersionSourceType**](VersionSourceType.md) | | +**EnvVars** | Pointer to [**[]EnvVar**](EnvVar.md) | | [optional] +**ApplyEnvVarsToBuild** | Pointer to **NullableBool** | | [optional] +**BuildTag** | Pointer to **string** | | [optional] +**SourceFiles** | Pointer to [**[]VersionSourceFilesInner**](VersionSourceFilesInner.md) | | [optional] +**GitRepoUrl** | Pointer to **NullableString** | URL of the Git repository when sourceType is GIT_REPO. | [optional] +**TarballUrl** | Pointer to **NullableString** | URL of the tarball when sourceType is TARBALL. | [optional] +**GitHubGistUrl** | Pointer to **NullableString** | URL of the GitHub Gist when sourceType is GITHUB_GIST. | [optional] + +## Methods + +### NewVersion + +`func NewVersion(versionNumber string, sourceType NullableVersionSourceType, ) *Version` + +NewVersion instantiates a new Version object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewVersionWithDefaults + +`func NewVersionWithDefaults() *Version` + +NewVersionWithDefaults instantiates a new Version object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetVersionNumber + +`func (o *Version) GetVersionNumber() string` + +GetVersionNumber returns the VersionNumber field if non-nil, zero value otherwise. + +### GetVersionNumberOk + +`func (o *Version) GetVersionNumberOk() (*string, bool)` + +GetVersionNumberOk returns a tuple with the VersionNumber field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetVersionNumber + +`func (o *Version) SetVersionNumber(v string)` + +SetVersionNumber sets VersionNumber field to given value. + + +### GetSourceType + +`func (o *Version) GetSourceType() VersionSourceType` + +GetSourceType returns the SourceType field if non-nil, zero value otherwise. + +### GetSourceTypeOk + +`func (o *Version) GetSourceTypeOk() (*VersionSourceType, bool)` + +GetSourceTypeOk returns a tuple with the SourceType field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSourceType + +`func (o *Version) SetSourceType(v VersionSourceType)` + +SetSourceType sets SourceType field to given value. + + +### SetSourceTypeNil + +`func (o *Version) SetSourceTypeNil(b bool)` + + SetSourceTypeNil sets the value for SourceType to be an explicit nil + +### UnsetSourceType +`func (o *Version) UnsetSourceType()` + +UnsetSourceType ensures that no value is present for SourceType, not even an explicit nil +### GetEnvVars + +`func (o *Version) GetEnvVars() []EnvVar` + +GetEnvVars returns the EnvVars field if non-nil, zero value otherwise. + +### GetEnvVarsOk + +`func (o *Version) GetEnvVarsOk() (*[]EnvVar, bool)` + +GetEnvVarsOk returns a tuple with the EnvVars field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetEnvVars + +`func (o *Version) SetEnvVars(v []EnvVar)` + +SetEnvVars sets EnvVars field to given value. + +### HasEnvVars + +`func (o *Version) HasEnvVars() bool` + +HasEnvVars returns a boolean if a field has been set. + +### SetEnvVarsNil + +`func (o *Version) SetEnvVarsNil(b bool)` + + SetEnvVarsNil sets the value for EnvVars to be an explicit nil + +### UnsetEnvVars +`func (o *Version) UnsetEnvVars()` + +UnsetEnvVars ensures that no value is present for EnvVars, not even an explicit nil +### GetApplyEnvVarsToBuild + +`func (o *Version) GetApplyEnvVarsToBuild() bool` + +GetApplyEnvVarsToBuild returns the ApplyEnvVarsToBuild field if non-nil, zero value otherwise. + +### GetApplyEnvVarsToBuildOk + +`func (o *Version) GetApplyEnvVarsToBuildOk() (*bool, bool)` + +GetApplyEnvVarsToBuildOk returns a tuple with the ApplyEnvVarsToBuild field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetApplyEnvVarsToBuild + +`func (o *Version) SetApplyEnvVarsToBuild(v bool)` + +SetApplyEnvVarsToBuild sets ApplyEnvVarsToBuild field to given value. + +### HasApplyEnvVarsToBuild + +`func (o *Version) HasApplyEnvVarsToBuild() bool` + +HasApplyEnvVarsToBuild returns a boolean if a field has been set. + +### SetApplyEnvVarsToBuildNil + +`func (o *Version) SetApplyEnvVarsToBuildNil(b bool)` + + SetApplyEnvVarsToBuildNil sets the value for ApplyEnvVarsToBuild to be an explicit nil + +### UnsetApplyEnvVarsToBuild +`func (o *Version) UnsetApplyEnvVarsToBuild()` + +UnsetApplyEnvVarsToBuild ensures that no value is present for ApplyEnvVarsToBuild, not even an explicit nil +### GetBuildTag + +`func (o *Version) GetBuildTag() string` + +GetBuildTag returns the BuildTag field if non-nil, zero value otherwise. + +### GetBuildTagOk + +`func (o *Version) GetBuildTagOk() (*string, bool)` + +GetBuildTagOk returns a tuple with the BuildTag field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetBuildTag + +`func (o *Version) SetBuildTag(v string)` + +SetBuildTag sets BuildTag field to given value. + +### HasBuildTag + +`func (o *Version) HasBuildTag() bool` + +HasBuildTag returns a boolean if a field has been set. + +### GetSourceFiles + +`func (o *Version) GetSourceFiles() []VersionSourceFilesInner` + +GetSourceFiles returns the SourceFiles field if non-nil, zero value otherwise. + +### GetSourceFilesOk + +`func (o *Version) GetSourceFilesOk() (*[]VersionSourceFilesInner, bool)` + +GetSourceFilesOk returns a tuple with the SourceFiles field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSourceFiles + +`func (o *Version) SetSourceFiles(v []VersionSourceFilesInner)` + +SetSourceFiles sets SourceFiles field to given value. + +### HasSourceFiles + +`func (o *Version) HasSourceFiles() bool` + +HasSourceFiles returns a boolean if a field has been set. + +### GetGitRepoUrl + +`func (o *Version) GetGitRepoUrl() string` + +GetGitRepoUrl returns the GitRepoUrl field if non-nil, zero value otherwise. + +### GetGitRepoUrlOk + +`func (o *Version) GetGitRepoUrlOk() (*string, bool)` + +GetGitRepoUrlOk returns a tuple with the GitRepoUrl field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetGitRepoUrl + +`func (o *Version) SetGitRepoUrl(v string)` + +SetGitRepoUrl sets GitRepoUrl field to given value. + +### HasGitRepoUrl + +`func (o *Version) HasGitRepoUrl() bool` + +HasGitRepoUrl returns a boolean if a field has been set. + +### SetGitRepoUrlNil + +`func (o *Version) SetGitRepoUrlNil(b bool)` + + SetGitRepoUrlNil sets the value for GitRepoUrl to be an explicit nil + +### UnsetGitRepoUrl +`func (o *Version) UnsetGitRepoUrl()` + +UnsetGitRepoUrl ensures that no value is present for GitRepoUrl, not even an explicit nil +### GetTarballUrl + +`func (o *Version) GetTarballUrl() string` + +GetTarballUrl returns the TarballUrl field if non-nil, zero value otherwise. + +### GetTarballUrlOk + +`func (o *Version) GetTarballUrlOk() (*string, bool)` + +GetTarballUrlOk returns a tuple with the TarballUrl field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTarballUrl + +`func (o *Version) SetTarballUrl(v string)` + +SetTarballUrl sets TarballUrl field to given value. + +### HasTarballUrl + +`func (o *Version) HasTarballUrl() bool` + +HasTarballUrl returns a boolean if a field has been set. + +### SetTarballUrlNil + +`func (o *Version) SetTarballUrlNil(b bool)` + + SetTarballUrlNil sets the value for TarballUrl to be an explicit nil + +### UnsetTarballUrl +`func (o *Version) UnsetTarballUrl()` + +UnsetTarballUrl ensures that no value is present for TarballUrl, not even an explicit nil +### GetGitHubGistUrl + +`func (o *Version) GetGitHubGistUrl() string` + +GetGitHubGistUrl returns the GitHubGistUrl field if non-nil, zero value otherwise. + +### GetGitHubGistUrlOk + +`func (o *Version) GetGitHubGistUrlOk() (*string, bool)` + +GetGitHubGistUrlOk returns a tuple with the GitHubGistUrl field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetGitHubGistUrl + +`func (o *Version) SetGitHubGistUrl(v string)` + +SetGitHubGistUrl sets GitHubGistUrl field to given value. + +### HasGitHubGistUrl + +`func (o *Version) HasGitHubGistUrl() bool` + +HasGitHubGistUrl returns a boolean if a field has been set. + +### SetGitHubGistUrlNil + +`func (o *Version) SetGitHubGistUrlNil(b bool)` + + SetGitHubGistUrlNil sets the value for GitHubGistUrl to be an explicit nil + +### UnsetGitHubGistUrl +`func (o *Version) UnsetGitHubGistUrl()` + +UnsetGitHubGistUrl ensures that no value is present for GitHubGistUrl, not even an explicit nil + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/VersionResponse.md b/docs/VersionResponse.md new file mode 100644 index 0000000..0f2ca95 --- /dev/null +++ b/docs/VersionResponse.md @@ -0,0 +1,51 @@ +# VersionResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Data** | [**Version**](Version.md) | | + +## Methods + +### NewVersionResponse + +`func NewVersionResponse(data Version, ) *VersionResponse` + +NewVersionResponse instantiates a new VersionResponse object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewVersionResponseWithDefaults + +`func NewVersionResponseWithDefaults() *VersionResponse` + +NewVersionResponseWithDefaults instantiates a new VersionResponse object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetData + +`func (o *VersionResponse) GetData() Version` + +GetData returns the Data field if non-nil, zero value otherwise. + +### GetDataOk + +`func (o *VersionResponse) GetDataOk() (*Version, bool)` + +GetDataOk returns a tuple with the Data field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetData + +`func (o *VersionResponse) SetData(v Version)` + +SetData sets Data field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/VersionSourceFilesInner.md b/docs/VersionSourceFilesInner.md new file mode 100644 index 0000000..5ccae44 --- /dev/null +++ b/docs/VersionSourceFilesInner.md @@ -0,0 +1,124 @@ +# VersionSourceFilesInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Format** | Pointer to [**SourceCodeFileFormat**](SourceCodeFileFormat.md) | | [optional] +**Content** | Pointer to **string** | | [optional] +**Name** | **string** | The folder path relative to the Actor's root directory. | +**Folder** | **bool** | Always `true` for folders. Used to distinguish folders from files. | + +## Methods + +### NewVersionSourceFilesInner + +`func NewVersionSourceFilesInner(name string, folder bool, ) *VersionSourceFilesInner` + +NewVersionSourceFilesInner instantiates a new VersionSourceFilesInner object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewVersionSourceFilesInnerWithDefaults + +`func NewVersionSourceFilesInnerWithDefaults() *VersionSourceFilesInner` + +NewVersionSourceFilesInnerWithDefaults instantiates a new VersionSourceFilesInner object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetFormat + +`func (o *VersionSourceFilesInner) GetFormat() SourceCodeFileFormat` + +GetFormat returns the Format field if non-nil, zero value otherwise. + +### GetFormatOk + +`func (o *VersionSourceFilesInner) GetFormatOk() (*SourceCodeFileFormat, bool)` + +GetFormatOk returns a tuple with the Format field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetFormat + +`func (o *VersionSourceFilesInner) SetFormat(v SourceCodeFileFormat)` + +SetFormat sets Format field to given value. + +### HasFormat + +`func (o *VersionSourceFilesInner) HasFormat() bool` + +HasFormat returns a boolean if a field has been set. + +### GetContent + +`func (o *VersionSourceFilesInner) GetContent() string` + +GetContent returns the Content field if non-nil, zero value otherwise. + +### GetContentOk + +`func (o *VersionSourceFilesInner) GetContentOk() (*string, bool)` + +GetContentOk returns a tuple with the Content field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetContent + +`func (o *VersionSourceFilesInner) SetContent(v string)` + +SetContent sets Content field to given value. + +### HasContent + +`func (o *VersionSourceFilesInner) HasContent() bool` + +HasContent returns a boolean if a field has been set. + +### GetName + +`func (o *VersionSourceFilesInner) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *VersionSourceFilesInner) GetNameOk() (*string, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetName + +`func (o *VersionSourceFilesInner) SetName(v string)` + +SetName sets Name field to given value. + + +### GetFolder + +`func (o *VersionSourceFilesInner) GetFolder() bool` + +GetFolder returns the Folder field if non-nil, zero value otherwise. + +### GetFolderOk + +`func (o *VersionSourceFilesInner) GetFolderOk() (*bool, bool)` + +GetFolderOk returns a tuple with the Folder field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetFolder + +`func (o *VersionSourceFilesInner) SetFolder(v bool)` + +SetFolder sets Folder field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/VersionSourceType.md b/docs/VersionSourceType.md new file mode 100644 index 0000000..4ecae6c --- /dev/null +++ b/docs/VersionSourceType.md @@ -0,0 +1,19 @@ +# VersionSourceType + +## Enum + + +* `SOURCE_FILES` (value: `"SOURCE_FILES"`) + +* `GIT_REPO` (value: `"GIT_REPO"`) + +* `TARBALL` (value: `"TARBALL"`) + +* `GITHUB_GIST` (value: `"GITHUB_GIST"`) + +* `SOURCE_CODE` (value: `"SOURCE_CODE"`) + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/Webhook.md b/docs/Webhook.md new file mode 100644 index 0000000..b92f789 --- /dev/null +++ b/docs/Webhook.md @@ -0,0 +1,486 @@ +# Webhook + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **string** | | +**CreatedAt** | **time.Time** | | +**ModifiedAt** | **time.Time** | | +**UserId** | **string** | | +**IsAdHoc** | Pointer to **NullableBool** | | [optional] +**ShouldInterpolateStrings** | Pointer to **NullableBool** | | [optional] +**EventTypes** | [**[]WebhookEventType**](WebhookEventType.md) | | +**Condition** | [**WebhookCondition**](WebhookCondition.md) | | +**IgnoreSslErrors** | **bool** | | +**DoNotRetry** | Pointer to **NullableBool** | | [optional] +**RequestUrl** | **string** | | +**PayloadTemplate** | Pointer to **NullableString** | | [optional] +**HeadersTemplate** | Pointer to **NullableString** | | [optional] +**Description** | Pointer to **NullableString** | | [optional] +**LastDispatch** | Pointer to [**NullableExampleWebhookDispatch**](ExampleWebhookDispatch.md) | | [optional] +**Stats** | Pointer to [**NullableWebhookStats**](WebhookStats.md) | | [optional] + +## Methods + +### NewWebhook + +`func NewWebhook(id string, createdAt time.Time, modifiedAt time.Time, userId string, eventTypes []WebhookEventType, condition WebhookCondition, ignoreSslErrors bool, requestUrl string, ) *Webhook` + +NewWebhook instantiates a new Webhook object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewWebhookWithDefaults + +`func NewWebhookWithDefaults() *Webhook` + +NewWebhookWithDefaults instantiates a new Webhook object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetId + +`func (o *Webhook) GetId() string` + +GetId returns the Id field if non-nil, zero value otherwise. + +### GetIdOk + +`func (o *Webhook) GetIdOk() (*string, bool)` + +GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetId + +`func (o *Webhook) SetId(v string)` + +SetId sets Id field to given value. + + +### GetCreatedAt + +`func (o *Webhook) GetCreatedAt() time.Time` + +GetCreatedAt returns the CreatedAt field if non-nil, zero value otherwise. + +### GetCreatedAtOk + +`func (o *Webhook) GetCreatedAtOk() (*time.Time, bool)` + +GetCreatedAtOk returns a tuple with the CreatedAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCreatedAt + +`func (o *Webhook) SetCreatedAt(v time.Time)` + +SetCreatedAt sets CreatedAt field to given value. + + +### GetModifiedAt + +`func (o *Webhook) GetModifiedAt() time.Time` + +GetModifiedAt returns the ModifiedAt field if non-nil, zero value otherwise. + +### GetModifiedAtOk + +`func (o *Webhook) GetModifiedAtOk() (*time.Time, bool)` + +GetModifiedAtOk returns a tuple with the ModifiedAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetModifiedAt + +`func (o *Webhook) SetModifiedAt(v time.Time)` + +SetModifiedAt sets ModifiedAt field to given value. + + +### GetUserId + +`func (o *Webhook) GetUserId() string` + +GetUserId returns the UserId field if non-nil, zero value otherwise. + +### GetUserIdOk + +`func (o *Webhook) GetUserIdOk() (*string, bool)` + +GetUserIdOk returns a tuple with the UserId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUserId + +`func (o *Webhook) SetUserId(v string)` + +SetUserId sets UserId field to given value. + + +### GetIsAdHoc + +`func (o *Webhook) GetIsAdHoc() bool` + +GetIsAdHoc returns the IsAdHoc field if non-nil, zero value otherwise. + +### GetIsAdHocOk + +`func (o *Webhook) GetIsAdHocOk() (*bool, bool)` + +GetIsAdHocOk returns a tuple with the IsAdHoc field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetIsAdHoc + +`func (o *Webhook) SetIsAdHoc(v bool)` + +SetIsAdHoc sets IsAdHoc field to given value. + +### HasIsAdHoc + +`func (o *Webhook) HasIsAdHoc() bool` + +HasIsAdHoc returns a boolean if a field has been set. + +### SetIsAdHocNil + +`func (o *Webhook) SetIsAdHocNil(b bool)` + + SetIsAdHocNil sets the value for IsAdHoc to be an explicit nil + +### UnsetIsAdHoc +`func (o *Webhook) UnsetIsAdHoc()` + +UnsetIsAdHoc ensures that no value is present for IsAdHoc, not even an explicit nil +### GetShouldInterpolateStrings + +`func (o *Webhook) GetShouldInterpolateStrings() bool` + +GetShouldInterpolateStrings returns the ShouldInterpolateStrings field if non-nil, zero value otherwise. + +### GetShouldInterpolateStringsOk + +`func (o *Webhook) GetShouldInterpolateStringsOk() (*bool, bool)` + +GetShouldInterpolateStringsOk returns a tuple with the ShouldInterpolateStrings field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetShouldInterpolateStrings + +`func (o *Webhook) SetShouldInterpolateStrings(v bool)` + +SetShouldInterpolateStrings sets ShouldInterpolateStrings field to given value. + +### HasShouldInterpolateStrings + +`func (o *Webhook) HasShouldInterpolateStrings() bool` + +HasShouldInterpolateStrings returns a boolean if a field has been set. + +### SetShouldInterpolateStringsNil + +`func (o *Webhook) SetShouldInterpolateStringsNil(b bool)` + + SetShouldInterpolateStringsNil sets the value for ShouldInterpolateStrings to be an explicit nil + +### UnsetShouldInterpolateStrings +`func (o *Webhook) UnsetShouldInterpolateStrings()` + +UnsetShouldInterpolateStrings ensures that no value is present for ShouldInterpolateStrings, not even an explicit nil +### GetEventTypes + +`func (o *Webhook) GetEventTypes() []WebhookEventType` + +GetEventTypes returns the EventTypes field if non-nil, zero value otherwise. + +### GetEventTypesOk + +`func (o *Webhook) GetEventTypesOk() (*[]WebhookEventType, bool)` + +GetEventTypesOk returns a tuple with the EventTypes field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetEventTypes + +`func (o *Webhook) SetEventTypes(v []WebhookEventType)` + +SetEventTypes sets EventTypes field to given value. + + +### GetCondition + +`func (o *Webhook) GetCondition() WebhookCondition` + +GetCondition returns the Condition field if non-nil, zero value otherwise. + +### GetConditionOk + +`func (o *Webhook) GetConditionOk() (*WebhookCondition, bool)` + +GetConditionOk returns a tuple with the Condition field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCondition + +`func (o *Webhook) SetCondition(v WebhookCondition)` + +SetCondition sets Condition field to given value. + + +### GetIgnoreSslErrors + +`func (o *Webhook) GetIgnoreSslErrors() bool` + +GetIgnoreSslErrors returns the IgnoreSslErrors field if non-nil, zero value otherwise. + +### GetIgnoreSslErrorsOk + +`func (o *Webhook) GetIgnoreSslErrorsOk() (*bool, bool)` + +GetIgnoreSslErrorsOk returns a tuple with the IgnoreSslErrors field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetIgnoreSslErrors + +`func (o *Webhook) SetIgnoreSslErrors(v bool)` + +SetIgnoreSslErrors sets IgnoreSslErrors field to given value. + + +### GetDoNotRetry + +`func (o *Webhook) GetDoNotRetry() bool` + +GetDoNotRetry returns the DoNotRetry field if non-nil, zero value otherwise. + +### GetDoNotRetryOk + +`func (o *Webhook) GetDoNotRetryOk() (*bool, bool)` + +GetDoNotRetryOk returns a tuple with the DoNotRetry field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDoNotRetry + +`func (o *Webhook) SetDoNotRetry(v bool)` + +SetDoNotRetry sets DoNotRetry field to given value. + +### HasDoNotRetry + +`func (o *Webhook) HasDoNotRetry() bool` + +HasDoNotRetry returns a boolean if a field has been set. + +### SetDoNotRetryNil + +`func (o *Webhook) SetDoNotRetryNil(b bool)` + + SetDoNotRetryNil sets the value for DoNotRetry to be an explicit nil + +### UnsetDoNotRetry +`func (o *Webhook) UnsetDoNotRetry()` + +UnsetDoNotRetry ensures that no value is present for DoNotRetry, not even an explicit nil +### GetRequestUrl + +`func (o *Webhook) GetRequestUrl() string` + +GetRequestUrl returns the RequestUrl field if non-nil, zero value otherwise. + +### GetRequestUrlOk + +`func (o *Webhook) GetRequestUrlOk() (*string, bool)` + +GetRequestUrlOk returns a tuple with the RequestUrl field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRequestUrl + +`func (o *Webhook) SetRequestUrl(v string)` + +SetRequestUrl sets RequestUrl field to given value. + + +### GetPayloadTemplate + +`func (o *Webhook) GetPayloadTemplate() string` + +GetPayloadTemplate returns the PayloadTemplate field if non-nil, zero value otherwise. + +### GetPayloadTemplateOk + +`func (o *Webhook) GetPayloadTemplateOk() (*string, bool)` + +GetPayloadTemplateOk returns a tuple with the PayloadTemplate field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPayloadTemplate + +`func (o *Webhook) SetPayloadTemplate(v string)` + +SetPayloadTemplate sets PayloadTemplate field to given value. + +### HasPayloadTemplate + +`func (o *Webhook) HasPayloadTemplate() bool` + +HasPayloadTemplate returns a boolean if a field has been set. + +### SetPayloadTemplateNil + +`func (o *Webhook) SetPayloadTemplateNil(b bool)` + + SetPayloadTemplateNil sets the value for PayloadTemplate to be an explicit nil + +### UnsetPayloadTemplate +`func (o *Webhook) UnsetPayloadTemplate()` + +UnsetPayloadTemplate ensures that no value is present for PayloadTemplate, not even an explicit nil +### GetHeadersTemplate + +`func (o *Webhook) GetHeadersTemplate() string` + +GetHeadersTemplate returns the HeadersTemplate field if non-nil, zero value otherwise. + +### GetHeadersTemplateOk + +`func (o *Webhook) GetHeadersTemplateOk() (*string, bool)` + +GetHeadersTemplateOk returns a tuple with the HeadersTemplate field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetHeadersTemplate + +`func (o *Webhook) SetHeadersTemplate(v string)` + +SetHeadersTemplate sets HeadersTemplate field to given value. + +### HasHeadersTemplate + +`func (o *Webhook) HasHeadersTemplate() bool` + +HasHeadersTemplate returns a boolean if a field has been set. + +### SetHeadersTemplateNil + +`func (o *Webhook) SetHeadersTemplateNil(b bool)` + + SetHeadersTemplateNil sets the value for HeadersTemplate to be an explicit nil + +### UnsetHeadersTemplate +`func (o *Webhook) UnsetHeadersTemplate()` + +UnsetHeadersTemplate ensures that no value is present for HeadersTemplate, not even an explicit nil +### GetDescription + +`func (o *Webhook) GetDescription() string` + +GetDescription returns the Description field if non-nil, zero value otherwise. + +### GetDescriptionOk + +`func (o *Webhook) GetDescriptionOk() (*string, bool)` + +GetDescriptionOk returns a tuple with the Description field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDescription + +`func (o *Webhook) SetDescription(v string)` + +SetDescription sets Description field to given value. + +### HasDescription + +`func (o *Webhook) HasDescription() bool` + +HasDescription returns a boolean if a field has been set. + +### SetDescriptionNil + +`func (o *Webhook) SetDescriptionNil(b bool)` + + SetDescriptionNil sets the value for Description to be an explicit nil + +### UnsetDescription +`func (o *Webhook) UnsetDescription()` + +UnsetDescription ensures that no value is present for Description, not even an explicit nil +### GetLastDispatch + +`func (o *Webhook) GetLastDispatch() ExampleWebhookDispatch` + +GetLastDispatch returns the LastDispatch field if non-nil, zero value otherwise. + +### GetLastDispatchOk + +`func (o *Webhook) GetLastDispatchOk() (*ExampleWebhookDispatch, bool)` + +GetLastDispatchOk returns a tuple with the LastDispatch field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetLastDispatch + +`func (o *Webhook) SetLastDispatch(v ExampleWebhookDispatch)` + +SetLastDispatch sets LastDispatch field to given value. + +### HasLastDispatch + +`func (o *Webhook) HasLastDispatch() bool` + +HasLastDispatch returns a boolean if a field has been set. + +### SetLastDispatchNil + +`func (o *Webhook) SetLastDispatchNil(b bool)` + + SetLastDispatchNil sets the value for LastDispatch to be an explicit nil + +### UnsetLastDispatch +`func (o *Webhook) UnsetLastDispatch()` + +UnsetLastDispatch ensures that no value is present for LastDispatch, not even an explicit nil +### GetStats + +`func (o *Webhook) GetStats() WebhookStats` + +GetStats returns the Stats field if non-nil, zero value otherwise. + +### GetStatsOk + +`func (o *Webhook) GetStatsOk() (*WebhookStats, bool)` + +GetStatsOk returns a tuple with the Stats field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetStats + +`func (o *Webhook) SetStats(v WebhookStats)` + +SetStats sets Stats field to given value. + +### HasStats + +`func (o *Webhook) HasStats() bool` + +HasStats returns a boolean if a field has been set. + +### SetStatsNil + +`func (o *Webhook) SetStatsNil(b bool)` + + SetStatsNil sets the value for Stats to be an explicit nil + +### UnsetStats +`func (o *Webhook) UnsetStats()` + +UnsetStats ensures that no value is present for Stats, not even an explicit nil + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/WebhookCondition.md b/docs/WebhookCondition.md new file mode 100644 index 0000000..b8e00b8 --- /dev/null +++ b/docs/WebhookCondition.md @@ -0,0 +1,138 @@ +# WebhookCondition + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ActorId** | Pointer to **NullableString** | | [optional] +**ActorTaskId** | Pointer to **NullableString** | | [optional] +**ActorRunId** | Pointer to **NullableString** | | [optional] + +## Methods + +### NewWebhookCondition + +`func NewWebhookCondition() *WebhookCondition` + +NewWebhookCondition instantiates a new WebhookCondition object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewWebhookConditionWithDefaults + +`func NewWebhookConditionWithDefaults() *WebhookCondition` + +NewWebhookConditionWithDefaults instantiates a new WebhookCondition object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetActorId + +`func (o *WebhookCondition) GetActorId() string` + +GetActorId returns the ActorId field if non-nil, zero value otherwise. + +### GetActorIdOk + +`func (o *WebhookCondition) GetActorIdOk() (*string, bool)` + +GetActorIdOk returns a tuple with the ActorId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetActorId + +`func (o *WebhookCondition) SetActorId(v string)` + +SetActorId sets ActorId field to given value. + +### HasActorId + +`func (o *WebhookCondition) HasActorId() bool` + +HasActorId returns a boolean if a field has been set. + +### SetActorIdNil + +`func (o *WebhookCondition) SetActorIdNil(b bool)` + + SetActorIdNil sets the value for ActorId to be an explicit nil + +### UnsetActorId +`func (o *WebhookCondition) UnsetActorId()` + +UnsetActorId ensures that no value is present for ActorId, not even an explicit nil +### GetActorTaskId + +`func (o *WebhookCondition) GetActorTaskId() string` + +GetActorTaskId returns the ActorTaskId field if non-nil, zero value otherwise. + +### GetActorTaskIdOk + +`func (o *WebhookCondition) GetActorTaskIdOk() (*string, bool)` + +GetActorTaskIdOk returns a tuple with the ActorTaskId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetActorTaskId + +`func (o *WebhookCondition) SetActorTaskId(v string)` + +SetActorTaskId sets ActorTaskId field to given value. + +### HasActorTaskId + +`func (o *WebhookCondition) HasActorTaskId() bool` + +HasActorTaskId returns a boolean if a field has been set. + +### SetActorTaskIdNil + +`func (o *WebhookCondition) SetActorTaskIdNil(b bool)` + + SetActorTaskIdNil sets the value for ActorTaskId to be an explicit nil + +### UnsetActorTaskId +`func (o *WebhookCondition) UnsetActorTaskId()` + +UnsetActorTaskId ensures that no value is present for ActorTaskId, not even an explicit nil +### GetActorRunId + +`func (o *WebhookCondition) GetActorRunId() string` + +GetActorRunId returns the ActorRunId field if non-nil, zero value otherwise. + +### GetActorRunIdOk + +`func (o *WebhookCondition) GetActorRunIdOk() (*string, bool)` + +GetActorRunIdOk returns a tuple with the ActorRunId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetActorRunId + +`func (o *WebhookCondition) SetActorRunId(v string)` + +SetActorRunId sets ActorRunId field to given value. + +### HasActorRunId + +`func (o *WebhookCondition) HasActorRunId() bool` + +HasActorRunId returns a boolean if a field has been set. + +### SetActorRunIdNil + +`func (o *WebhookCondition) SetActorRunIdNil(b bool)` + + SetActorRunIdNil sets the value for ActorRunId to be an explicit nil + +### UnsetActorRunId +`func (o *WebhookCondition) UnsetActorRunId()` + +UnsetActorRunId ensures that no value is present for ActorRunId, not even an explicit nil + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/WebhookCreate.md b/docs/WebhookCreate.md new file mode 100644 index 0000000..3e6fe34 --- /dev/null +++ b/docs/WebhookCreate.md @@ -0,0 +1,381 @@ +# WebhookCreate + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**IsAdHoc** | Pointer to **NullableBool** | | [optional] +**EventTypes** | [**[]WebhookEventType**](WebhookEventType.md) | | +**Condition** | [**WebhookCondition**](WebhookCondition.md) | | +**IdempotencyKey** | Pointer to **NullableString** | | [optional] +**IgnoreSslErrors** | Pointer to **NullableBool** | | [optional] +**DoNotRetry** | Pointer to **NullableBool** | | [optional] +**RequestUrl** | **string** | | +**PayloadTemplate** | Pointer to **NullableString** | | [optional] +**HeadersTemplate** | Pointer to **NullableString** | | [optional] +**Description** | Pointer to **NullableString** | | [optional] +**ShouldInterpolateStrings** | Pointer to **NullableBool** | | [optional] + +## Methods + +### NewWebhookCreate + +`func NewWebhookCreate(eventTypes []WebhookEventType, condition WebhookCondition, requestUrl string, ) *WebhookCreate` + +NewWebhookCreate instantiates a new WebhookCreate object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewWebhookCreateWithDefaults + +`func NewWebhookCreateWithDefaults() *WebhookCreate` + +NewWebhookCreateWithDefaults instantiates a new WebhookCreate object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetIsAdHoc + +`func (o *WebhookCreate) GetIsAdHoc() bool` + +GetIsAdHoc returns the IsAdHoc field if non-nil, zero value otherwise. + +### GetIsAdHocOk + +`func (o *WebhookCreate) GetIsAdHocOk() (*bool, bool)` + +GetIsAdHocOk returns a tuple with the IsAdHoc field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetIsAdHoc + +`func (o *WebhookCreate) SetIsAdHoc(v bool)` + +SetIsAdHoc sets IsAdHoc field to given value. + +### HasIsAdHoc + +`func (o *WebhookCreate) HasIsAdHoc() bool` + +HasIsAdHoc returns a boolean if a field has been set. + +### SetIsAdHocNil + +`func (o *WebhookCreate) SetIsAdHocNil(b bool)` + + SetIsAdHocNil sets the value for IsAdHoc to be an explicit nil + +### UnsetIsAdHoc +`func (o *WebhookCreate) UnsetIsAdHoc()` + +UnsetIsAdHoc ensures that no value is present for IsAdHoc, not even an explicit nil +### GetEventTypes + +`func (o *WebhookCreate) GetEventTypes() []WebhookEventType` + +GetEventTypes returns the EventTypes field if non-nil, zero value otherwise. + +### GetEventTypesOk + +`func (o *WebhookCreate) GetEventTypesOk() (*[]WebhookEventType, bool)` + +GetEventTypesOk returns a tuple with the EventTypes field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetEventTypes + +`func (o *WebhookCreate) SetEventTypes(v []WebhookEventType)` + +SetEventTypes sets EventTypes field to given value. + + +### GetCondition + +`func (o *WebhookCreate) GetCondition() WebhookCondition` + +GetCondition returns the Condition field if non-nil, zero value otherwise. + +### GetConditionOk + +`func (o *WebhookCreate) GetConditionOk() (*WebhookCondition, bool)` + +GetConditionOk returns a tuple with the Condition field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCondition + +`func (o *WebhookCreate) SetCondition(v WebhookCondition)` + +SetCondition sets Condition field to given value. + + +### GetIdempotencyKey + +`func (o *WebhookCreate) GetIdempotencyKey() string` + +GetIdempotencyKey returns the IdempotencyKey field if non-nil, zero value otherwise. + +### GetIdempotencyKeyOk + +`func (o *WebhookCreate) GetIdempotencyKeyOk() (*string, bool)` + +GetIdempotencyKeyOk returns a tuple with the IdempotencyKey field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetIdempotencyKey + +`func (o *WebhookCreate) SetIdempotencyKey(v string)` + +SetIdempotencyKey sets IdempotencyKey field to given value. + +### HasIdempotencyKey + +`func (o *WebhookCreate) HasIdempotencyKey() bool` + +HasIdempotencyKey returns a boolean if a field has been set. + +### SetIdempotencyKeyNil + +`func (o *WebhookCreate) SetIdempotencyKeyNil(b bool)` + + SetIdempotencyKeyNil sets the value for IdempotencyKey to be an explicit nil + +### UnsetIdempotencyKey +`func (o *WebhookCreate) UnsetIdempotencyKey()` + +UnsetIdempotencyKey ensures that no value is present for IdempotencyKey, not even an explicit nil +### GetIgnoreSslErrors + +`func (o *WebhookCreate) GetIgnoreSslErrors() bool` + +GetIgnoreSslErrors returns the IgnoreSslErrors field if non-nil, zero value otherwise. + +### GetIgnoreSslErrorsOk + +`func (o *WebhookCreate) GetIgnoreSslErrorsOk() (*bool, bool)` + +GetIgnoreSslErrorsOk returns a tuple with the IgnoreSslErrors field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetIgnoreSslErrors + +`func (o *WebhookCreate) SetIgnoreSslErrors(v bool)` + +SetIgnoreSslErrors sets IgnoreSslErrors field to given value. + +### HasIgnoreSslErrors + +`func (o *WebhookCreate) HasIgnoreSslErrors() bool` + +HasIgnoreSslErrors returns a boolean if a field has been set. + +### SetIgnoreSslErrorsNil + +`func (o *WebhookCreate) SetIgnoreSslErrorsNil(b bool)` + + SetIgnoreSslErrorsNil sets the value for IgnoreSslErrors to be an explicit nil + +### UnsetIgnoreSslErrors +`func (o *WebhookCreate) UnsetIgnoreSslErrors()` + +UnsetIgnoreSslErrors ensures that no value is present for IgnoreSslErrors, not even an explicit nil +### GetDoNotRetry + +`func (o *WebhookCreate) GetDoNotRetry() bool` + +GetDoNotRetry returns the DoNotRetry field if non-nil, zero value otherwise. + +### GetDoNotRetryOk + +`func (o *WebhookCreate) GetDoNotRetryOk() (*bool, bool)` + +GetDoNotRetryOk returns a tuple with the DoNotRetry field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDoNotRetry + +`func (o *WebhookCreate) SetDoNotRetry(v bool)` + +SetDoNotRetry sets DoNotRetry field to given value. + +### HasDoNotRetry + +`func (o *WebhookCreate) HasDoNotRetry() bool` + +HasDoNotRetry returns a boolean if a field has been set. + +### SetDoNotRetryNil + +`func (o *WebhookCreate) SetDoNotRetryNil(b bool)` + + SetDoNotRetryNil sets the value for DoNotRetry to be an explicit nil + +### UnsetDoNotRetry +`func (o *WebhookCreate) UnsetDoNotRetry()` + +UnsetDoNotRetry ensures that no value is present for DoNotRetry, not even an explicit nil +### GetRequestUrl + +`func (o *WebhookCreate) GetRequestUrl() string` + +GetRequestUrl returns the RequestUrl field if non-nil, zero value otherwise. + +### GetRequestUrlOk + +`func (o *WebhookCreate) GetRequestUrlOk() (*string, bool)` + +GetRequestUrlOk returns a tuple with the RequestUrl field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRequestUrl + +`func (o *WebhookCreate) SetRequestUrl(v string)` + +SetRequestUrl sets RequestUrl field to given value. + + +### GetPayloadTemplate + +`func (o *WebhookCreate) GetPayloadTemplate() string` + +GetPayloadTemplate returns the PayloadTemplate field if non-nil, zero value otherwise. + +### GetPayloadTemplateOk + +`func (o *WebhookCreate) GetPayloadTemplateOk() (*string, bool)` + +GetPayloadTemplateOk returns a tuple with the PayloadTemplate field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPayloadTemplate + +`func (o *WebhookCreate) SetPayloadTemplate(v string)` + +SetPayloadTemplate sets PayloadTemplate field to given value. + +### HasPayloadTemplate + +`func (o *WebhookCreate) HasPayloadTemplate() bool` + +HasPayloadTemplate returns a boolean if a field has been set. + +### SetPayloadTemplateNil + +`func (o *WebhookCreate) SetPayloadTemplateNil(b bool)` + + SetPayloadTemplateNil sets the value for PayloadTemplate to be an explicit nil + +### UnsetPayloadTemplate +`func (o *WebhookCreate) UnsetPayloadTemplate()` + +UnsetPayloadTemplate ensures that no value is present for PayloadTemplate, not even an explicit nil +### GetHeadersTemplate + +`func (o *WebhookCreate) GetHeadersTemplate() string` + +GetHeadersTemplate returns the HeadersTemplate field if non-nil, zero value otherwise. + +### GetHeadersTemplateOk + +`func (o *WebhookCreate) GetHeadersTemplateOk() (*string, bool)` + +GetHeadersTemplateOk returns a tuple with the HeadersTemplate field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetHeadersTemplate + +`func (o *WebhookCreate) SetHeadersTemplate(v string)` + +SetHeadersTemplate sets HeadersTemplate field to given value. + +### HasHeadersTemplate + +`func (o *WebhookCreate) HasHeadersTemplate() bool` + +HasHeadersTemplate returns a boolean if a field has been set. + +### SetHeadersTemplateNil + +`func (o *WebhookCreate) SetHeadersTemplateNil(b bool)` + + SetHeadersTemplateNil sets the value for HeadersTemplate to be an explicit nil + +### UnsetHeadersTemplate +`func (o *WebhookCreate) UnsetHeadersTemplate()` + +UnsetHeadersTemplate ensures that no value is present for HeadersTemplate, not even an explicit nil +### GetDescription + +`func (o *WebhookCreate) GetDescription() string` + +GetDescription returns the Description field if non-nil, zero value otherwise. + +### GetDescriptionOk + +`func (o *WebhookCreate) GetDescriptionOk() (*string, bool)` + +GetDescriptionOk returns a tuple with the Description field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDescription + +`func (o *WebhookCreate) SetDescription(v string)` + +SetDescription sets Description field to given value. + +### HasDescription + +`func (o *WebhookCreate) HasDescription() bool` + +HasDescription returns a boolean if a field has been set. + +### SetDescriptionNil + +`func (o *WebhookCreate) SetDescriptionNil(b bool)` + + SetDescriptionNil sets the value for Description to be an explicit nil + +### UnsetDescription +`func (o *WebhookCreate) UnsetDescription()` + +UnsetDescription ensures that no value is present for Description, not even an explicit nil +### GetShouldInterpolateStrings + +`func (o *WebhookCreate) GetShouldInterpolateStrings() bool` + +GetShouldInterpolateStrings returns the ShouldInterpolateStrings field if non-nil, zero value otherwise. + +### GetShouldInterpolateStringsOk + +`func (o *WebhookCreate) GetShouldInterpolateStringsOk() (*bool, bool)` + +GetShouldInterpolateStringsOk returns a tuple with the ShouldInterpolateStrings field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetShouldInterpolateStrings + +`func (o *WebhookCreate) SetShouldInterpolateStrings(v bool)` + +SetShouldInterpolateStrings sets ShouldInterpolateStrings field to given value. + +### HasShouldInterpolateStrings + +`func (o *WebhookCreate) HasShouldInterpolateStrings() bool` + +HasShouldInterpolateStrings returns a boolean if a field has been set. + +### SetShouldInterpolateStringsNil + +`func (o *WebhookCreate) SetShouldInterpolateStringsNil(b bool)` + + SetShouldInterpolateStringsNil sets the value for ShouldInterpolateStrings to be an explicit nil + +### UnsetShouldInterpolateStrings +`func (o *WebhookCreate) UnsetShouldInterpolateStrings()` + +UnsetShouldInterpolateStrings ensures that no value is present for ShouldInterpolateStrings, not even an explicit nil + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/WebhookDispatch.md b/docs/WebhookDispatch.md new file mode 100644 index 0000000..6d01b41 --- /dev/null +++ b/docs/WebhookDispatch.md @@ -0,0 +1,244 @@ +# WebhookDispatch + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **string** | | +**UserId** | **string** | | +**WebhookId** | **string** | | +**CreatedAt** | **time.Time** | | +**Status** | [**WebhookDispatchStatus**](WebhookDispatchStatus.md) | | +**EventType** | [**WebhookEventType**](WebhookEventType.md) | | +**EventData** | Pointer to [**EventData**](EventData.md) | | [optional] +**Webhook** | Pointer to [**NullableWebhookDispatchWebhookSummary**](WebhookDispatchWebhookSummary.md) | | [optional] +**Calls** | Pointer to [**[]CallsInner**](CallsInner.md) | | [optional] + +## Methods + +### NewWebhookDispatch + +`func NewWebhookDispatch(id string, userId string, webhookId string, createdAt time.Time, status WebhookDispatchStatus, eventType WebhookEventType, ) *WebhookDispatch` + +NewWebhookDispatch instantiates a new WebhookDispatch object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewWebhookDispatchWithDefaults + +`func NewWebhookDispatchWithDefaults() *WebhookDispatch` + +NewWebhookDispatchWithDefaults instantiates a new WebhookDispatch object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetId + +`func (o *WebhookDispatch) GetId() string` + +GetId returns the Id field if non-nil, zero value otherwise. + +### GetIdOk + +`func (o *WebhookDispatch) GetIdOk() (*string, bool)` + +GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetId + +`func (o *WebhookDispatch) SetId(v string)` + +SetId sets Id field to given value. + + +### GetUserId + +`func (o *WebhookDispatch) GetUserId() string` + +GetUserId returns the UserId field if non-nil, zero value otherwise. + +### GetUserIdOk + +`func (o *WebhookDispatch) GetUserIdOk() (*string, bool)` + +GetUserIdOk returns a tuple with the UserId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUserId + +`func (o *WebhookDispatch) SetUserId(v string)` + +SetUserId sets UserId field to given value. + + +### GetWebhookId + +`func (o *WebhookDispatch) GetWebhookId() string` + +GetWebhookId returns the WebhookId field if non-nil, zero value otherwise. + +### GetWebhookIdOk + +`func (o *WebhookDispatch) GetWebhookIdOk() (*string, bool)` + +GetWebhookIdOk returns a tuple with the WebhookId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetWebhookId + +`func (o *WebhookDispatch) SetWebhookId(v string)` + +SetWebhookId sets WebhookId field to given value. + + +### GetCreatedAt + +`func (o *WebhookDispatch) GetCreatedAt() time.Time` + +GetCreatedAt returns the CreatedAt field if non-nil, zero value otherwise. + +### GetCreatedAtOk + +`func (o *WebhookDispatch) GetCreatedAtOk() (*time.Time, bool)` + +GetCreatedAtOk returns a tuple with the CreatedAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCreatedAt + +`func (o *WebhookDispatch) SetCreatedAt(v time.Time)` + +SetCreatedAt sets CreatedAt field to given value. + + +### GetStatus + +`func (o *WebhookDispatch) GetStatus() WebhookDispatchStatus` + +GetStatus returns the Status field if non-nil, zero value otherwise. + +### GetStatusOk + +`func (o *WebhookDispatch) GetStatusOk() (*WebhookDispatchStatus, bool)` + +GetStatusOk returns a tuple with the Status field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetStatus + +`func (o *WebhookDispatch) SetStatus(v WebhookDispatchStatus)` + +SetStatus sets Status field to given value. + + +### GetEventType + +`func (o *WebhookDispatch) GetEventType() WebhookEventType` + +GetEventType returns the EventType field if non-nil, zero value otherwise. + +### GetEventTypeOk + +`func (o *WebhookDispatch) GetEventTypeOk() (*WebhookEventType, bool)` + +GetEventTypeOk returns a tuple with the EventType field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetEventType + +`func (o *WebhookDispatch) SetEventType(v WebhookEventType)` + +SetEventType sets EventType field to given value. + + +### GetEventData + +`func (o *WebhookDispatch) GetEventData() EventData` + +GetEventData returns the EventData field if non-nil, zero value otherwise. + +### GetEventDataOk + +`func (o *WebhookDispatch) GetEventDataOk() (*EventData, bool)` + +GetEventDataOk returns a tuple with the EventData field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetEventData + +`func (o *WebhookDispatch) SetEventData(v EventData)` + +SetEventData sets EventData field to given value. + +### HasEventData + +`func (o *WebhookDispatch) HasEventData() bool` + +HasEventData returns a boolean if a field has been set. + +### GetWebhook + +`func (o *WebhookDispatch) GetWebhook() WebhookDispatchWebhookSummary` + +GetWebhook returns the Webhook field if non-nil, zero value otherwise. + +### GetWebhookOk + +`func (o *WebhookDispatch) GetWebhookOk() (*WebhookDispatchWebhookSummary, bool)` + +GetWebhookOk returns a tuple with the Webhook field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetWebhook + +`func (o *WebhookDispatch) SetWebhook(v WebhookDispatchWebhookSummary)` + +SetWebhook sets Webhook field to given value. + +### HasWebhook + +`func (o *WebhookDispatch) HasWebhook() bool` + +HasWebhook returns a boolean if a field has been set. + +### SetWebhookNil + +`func (o *WebhookDispatch) SetWebhookNil(b bool)` + + SetWebhookNil sets the value for Webhook to be an explicit nil + +### UnsetWebhook +`func (o *WebhookDispatch) UnsetWebhook()` + +UnsetWebhook ensures that no value is present for Webhook, not even an explicit nil +### GetCalls + +`func (o *WebhookDispatch) GetCalls() []CallsInner` + +GetCalls returns the Calls field if non-nil, zero value otherwise. + +### GetCallsOk + +`func (o *WebhookDispatch) GetCallsOk() (*[]CallsInner, bool)` + +GetCallsOk returns a tuple with the Calls field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCalls + +`func (o *WebhookDispatch) SetCalls(v []CallsInner)` + +SetCalls sets Calls field to given value. + +### HasCalls + +`func (o *WebhookDispatch) HasCalls() bool` + +HasCalls returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/WebhookDispatchResponse.md b/docs/WebhookDispatchResponse.md new file mode 100644 index 0000000..b558452 --- /dev/null +++ b/docs/WebhookDispatchResponse.md @@ -0,0 +1,51 @@ +# WebhookDispatchResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Data** | [**WebhookDispatch**](WebhookDispatch.md) | | + +## Methods + +### NewWebhookDispatchResponse + +`func NewWebhookDispatchResponse(data WebhookDispatch, ) *WebhookDispatchResponse` + +NewWebhookDispatchResponse instantiates a new WebhookDispatchResponse object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewWebhookDispatchResponseWithDefaults + +`func NewWebhookDispatchResponseWithDefaults() *WebhookDispatchResponse` + +NewWebhookDispatchResponseWithDefaults instantiates a new WebhookDispatchResponse object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetData + +`func (o *WebhookDispatchResponse) GetData() WebhookDispatch` + +GetData returns the Data field if non-nil, zero value otherwise. + +### GetDataOk + +`func (o *WebhookDispatchResponse) GetDataOk() (*WebhookDispatch, bool)` + +GetDataOk returns a tuple with the Data field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetData + +`func (o *WebhookDispatchResponse) SetData(v WebhookDispatch)` + +SetData sets Data field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/WebhookDispatchStatus.md b/docs/WebhookDispatchStatus.md new file mode 100644 index 0000000..0bd4ed0 --- /dev/null +++ b/docs/WebhookDispatchStatus.md @@ -0,0 +1,15 @@ +# WebhookDispatchStatus + +## Enum + + +* `ACTIVE` (value: `"ACTIVE"`) + +* `SUCCEEDED` (value: `"SUCCEEDED"`) + +* `FAILED` (value: `"FAILED"`) + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/WebhookDispatchWebhookSummary.md b/docs/WebhookDispatchWebhookSummary.md new file mode 100644 index 0000000..f413d79 --- /dev/null +++ b/docs/WebhookDispatchWebhookSummary.md @@ -0,0 +1,134 @@ +# WebhookDispatchWebhookSummary + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ActionType** | Pointer to **string** | | [optional] +**Condition** | Pointer to [**WebhookCondition**](WebhookCondition.md) | | [optional] +**RequestUrl** | Pointer to **string** | | [optional] +**IsAdHoc** | Pointer to **bool** | | [optional] + +## Methods + +### NewWebhookDispatchWebhookSummary + +`func NewWebhookDispatchWebhookSummary() *WebhookDispatchWebhookSummary` + +NewWebhookDispatchWebhookSummary instantiates a new WebhookDispatchWebhookSummary object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewWebhookDispatchWebhookSummaryWithDefaults + +`func NewWebhookDispatchWebhookSummaryWithDefaults() *WebhookDispatchWebhookSummary` + +NewWebhookDispatchWebhookSummaryWithDefaults instantiates a new WebhookDispatchWebhookSummary object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetActionType + +`func (o *WebhookDispatchWebhookSummary) GetActionType() string` + +GetActionType returns the ActionType field if non-nil, zero value otherwise. + +### GetActionTypeOk + +`func (o *WebhookDispatchWebhookSummary) GetActionTypeOk() (*string, bool)` + +GetActionTypeOk returns a tuple with the ActionType field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetActionType + +`func (o *WebhookDispatchWebhookSummary) SetActionType(v string)` + +SetActionType sets ActionType field to given value. + +### HasActionType + +`func (o *WebhookDispatchWebhookSummary) HasActionType() bool` + +HasActionType returns a boolean if a field has been set. + +### GetCondition + +`func (o *WebhookDispatchWebhookSummary) GetCondition() WebhookCondition` + +GetCondition returns the Condition field if non-nil, zero value otherwise. + +### GetConditionOk + +`func (o *WebhookDispatchWebhookSummary) GetConditionOk() (*WebhookCondition, bool)` + +GetConditionOk returns a tuple with the Condition field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCondition + +`func (o *WebhookDispatchWebhookSummary) SetCondition(v WebhookCondition)` + +SetCondition sets Condition field to given value. + +### HasCondition + +`func (o *WebhookDispatchWebhookSummary) HasCondition() bool` + +HasCondition returns a boolean if a field has been set. + +### GetRequestUrl + +`func (o *WebhookDispatchWebhookSummary) GetRequestUrl() string` + +GetRequestUrl returns the RequestUrl field if non-nil, zero value otherwise. + +### GetRequestUrlOk + +`func (o *WebhookDispatchWebhookSummary) GetRequestUrlOk() (*string, bool)` + +GetRequestUrlOk returns a tuple with the RequestUrl field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRequestUrl + +`func (o *WebhookDispatchWebhookSummary) SetRequestUrl(v string)` + +SetRequestUrl sets RequestUrl field to given value. + +### HasRequestUrl + +`func (o *WebhookDispatchWebhookSummary) HasRequestUrl() bool` + +HasRequestUrl returns a boolean if a field has been set. + +### GetIsAdHoc + +`func (o *WebhookDispatchWebhookSummary) GetIsAdHoc() bool` + +GetIsAdHoc returns the IsAdHoc field if non-nil, zero value otherwise. + +### GetIsAdHocOk + +`func (o *WebhookDispatchWebhookSummary) GetIsAdHocOk() (*bool, bool)` + +GetIsAdHocOk returns a tuple with the IsAdHoc field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetIsAdHoc + +`func (o *WebhookDispatchWebhookSummary) SetIsAdHoc(v bool)` + +SetIsAdHoc sets IsAdHoc field to given value. + +### HasIsAdHoc + +`func (o *WebhookDispatchWebhookSummary) HasIsAdHoc() bool` + +HasIsAdHoc returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/WebhookEventType.md b/docs/WebhookEventType.md new file mode 100644 index 0000000..703d5e0 --- /dev/null +++ b/docs/WebhookEventType.md @@ -0,0 +1,33 @@ +# WebhookEventType + +## Enum + + +* `ACTOR_BUILD_ABORTED` (value: `"ACTOR.BUILD.ABORTED"`) + +* `ACTOR_BUILD_CREATED` (value: `"ACTOR.BUILD.CREATED"`) + +* `ACTOR_BUILD_FAILED` (value: `"ACTOR.BUILD.FAILED"`) + +* `ACTOR_BUILD_SUCCEEDED` (value: `"ACTOR.BUILD.SUCCEEDED"`) + +* `ACTOR_BUILD_TIMED_OUT` (value: `"ACTOR.BUILD.TIMED_OUT"`) + +* `ACTOR_RUN_ABORTED` (value: `"ACTOR.RUN.ABORTED"`) + +* `ACTOR_RUN_CREATED` (value: `"ACTOR.RUN.CREATED"`) + +* `ACTOR_RUN_FAILED` (value: `"ACTOR.RUN.FAILED"`) + +* `ACTOR_RUN_RESURRECTED` (value: `"ACTOR.RUN.RESURRECTED"`) + +* `ACTOR_RUN_SUCCEEDED` (value: `"ACTOR.RUN.SUCCEEDED"`) + +* `ACTOR_RUN_TIMED_OUT` (value: `"ACTOR.RUN.TIMED_OUT"`) + +* `TEST` (value: `"TEST"`) + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/WebhookRepresentation.md b/docs/WebhookRepresentation.md new file mode 100644 index 0000000..3e68111 --- /dev/null +++ b/docs/WebhookRepresentation.md @@ -0,0 +1,288 @@ +# WebhookRepresentation + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**EventTypes** | [**[]WebhookEventType**](WebhookEventType.md) | | +**RequestUrl** | **string** | The URL to which the webhook sends its payload. | +**PayloadTemplate** | Pointer to **NullableString** | Optional template for the JSON payload sent by the webhook. | [optional] +**HeadersTemplate** | Pointer to **NullableString** | Optional template for the HTTP headers sent by the webhook. | [optional] +**ShouldInterpolateStrings** | Pointer to **NullableBool** | Flag to also interpolate `{{...}}` variables inside string values of the payload and headers templates. | [optional] +**IdempotencyKey** | Pointer to **NullableString** | Key that prevents creating duplicate webhooks, e.g. when the run-starting request is retried. | [optional] +**IgnoreSslErrors** | Pointer to **NullableBool** | Flag to ignore SSL errors when the webhook sends the request. | [optional] +**DoNotRetry** | Pointer to **NullableBool** | Flag to skip retrying the webhook request on failure. | [optional] + +## Methods + +### NewWebhookRepresentation + +`func NewWebhookRepresentation(eventTypes []WebhookEventType, requestUrl string, ) *WebhookRepresentation` + +NewWebhookRepresentation instantiates a new WebhookRepresentation object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewWebhookRepresentationWithDefaults + +`func NewWebhookRepresentationWithDefaults() *WebhookRepresentation` + +NewWebhookRepresentationWithDefaults instantiates a new WebhookRepresentation object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetEventTypes + +`func (o *WebhookRepresentation) GetEventTypes() []WebhookEventType` + +GetEventTypes returns the EventTypes field if non-nil, zero value otherwise. + +### GetEventTypesOk + +`func (o *WebhookRepresentation) GetEventTypesOk() (*[]WebhookEventType, bool)` + +GetEventTypesOk returns a tuple with the EventTypes field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetEventTypes + +`func (o *WebhookRepresentation) SetEventTypes(v []WebhookEventType)` + +SetEventTypes sets EventTypes field to given value. + + +### GetRequestUrl + +`func (o *WebhookRepresentation) GetRequestUrl() string` + +GetRequestUrl returns the RequestUrl field if non-nil, zero value otherwise. + +### GetRequestUrlOk + +`func (o *WebhookRepresentation) GetRequestUrlOk() (*string, bool)` + +GetRequestUrlOk returns a tuple with the RequestUrl field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRequestUrl + +`func (o *WebhookRepresentation) SetRequestUrl(v string)` + +SetRequestUrl sets RequestUrl field to given value. + + +### GetPayloadTemplate + +`func (o *WebhookRepresentation) GetPayloadTemplate() string` + +GetPayloadTemplate returns the PayloadTemplate field if non-nil, zero value otherwise. + +### GetPayloadTemplateOk + +`func (o *WebhookRepresentation) GetPayloadTemplateOk() (*string, bool)` + +GetPayloadTemplateOk returns a tuple with the PayloadTemplate field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPayloadTemplate + +`func (o *WebhookRepresentation) SetPayloadTemplate(v string)` + +SetPayloadTemplate sets PayloadTemplate field to given value. + +### HasPayloadTemplate + +`func (o *WebhookRepresentation) HasPayloadTemplate() bool` + +HasPayloadTemplate returns a boolean if a field has been set. + +### SetPayloadTemplateNil + +`func (o *WebhookRepresentation) SetPayloadTemplateNil(b bool)` + + SetPayloadTemplateNil sets the value for PayloadTemplate to be an explicit nil + +### UnsetPayloadTemplate +`func (o *WebhookRepresentation) UnsetPayloadTemplate()` + +UnsetPayloadTemplate ensures that no value is present for PayloadTemplate, not even an explicit nil +### GetHeadersTemplate + +`func (o *WebhookRepresentation) GetHeadersTemplate() string` + +GetHeadersTemplate returns the HeadersTemplate field if non-nil, zero value otherwise. + +### GetHeadersTemplateOk + +`func (o *WebhookRepresentation) GetHeadersTemplateOk() (*string, bool)` + +GetHeadersTemplateOk returns a tuple with the HeadersTemplate field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetHeadersTemplate + +`func (o *WebhookRepresentation) SetHeadersTemplate(v string)` + +SetHeadersTemplate sets HeadersTemplate field to given value. + +### HasHeadersTemplate + +`func (o *WebhookRepresentation) HasHeadersTemplate() bool` + +HasHeadersTemplate returns a boolean if a field has been set. + +### SetHeadersTemplateNil + +`func (o *WebhookRepresentation) SetHeadersTemplateNil(b bool)` + + SetHeadersTemplateNil sets the value for HeadersTemplate to be an explicit nil + +### UnsetHeadersTemplate +`func (o *WebhookRepresentation) UnsetHeadersTemplate()` + +UnsetHeadersTemplate ensures that no value is present for HeadersTemplate, not even an explicit nil +### GetShouldInterpolateStrings + +`func (o *WebhookRepresentation) GetShouldInterpolateStrings() bool` + +GetShouldInterpolateStrings returns the ShouldInterpolateStrings field if non-nil, zero value otherwise. + +### GetShouldInterpolateStringsOk + +`func (o *WebhookRepresentation) GetShouldInterpolateStringsOk() (*bool, bool)` + +GetShouldInterpolateStringsOk returns a tuple with the ShouldInterpolateStrings field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetShouldInterpolateStrings + +`func (o *WebhookRepresentation) SetShouldInterpolateStrings(v bool)` + +SetShouldInterpolateStrings sets ShouldInterpolateStrings field to given value. + +### HasShouldInterpolateStrings + +`func (o *WebhookRepresentation) HasShouldInterpolateStrings() bool` + +HasShouldInterpolateStrings returns a boolean if a field has been set. + +### SetShouldInterpolateStringsNil + +`func (o *WebhookRepresentation) SetShouldInterpolateStringsNil(b bool)` + + SetShouldInterpolateStringsNil sets the value for ShouldInterpolateStrings to be an explicit nil + +### UnsetShouldInterpolateStrings +`func (o *WebhookRepresentation) UnsetShouldInterpolateStrings()` + +UnsetShouldInterpolateStrings ensures that no value is present for ShouldInterpolateStrings, not even an explicit nil +### GetIdempotencyKey + +`func (o *WebhookRepresentation) GetIdempotencyKey() string` + +GetIdempotencyKey returns the IdempotencyKey field if non-nil, zero value otherwise. + +### GetIdempotencyKeyOk + +`func (o *WebhookRepresentation) GetIdempotencyKeyOk() (*string, bool)` + +GetIdempotencyKeyOk returns a tuple with the IdempotencyKey field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetIdempotencyKey + +`func (o *WebhookRepresentation) SetIdempotencyKey(v string)` + +SetIdempotencyKey sets IdempotencyKey field to given value. + +### HasIdempotencyKey + +`func (o *WebhookRepresentation) HasIdempotencyKey() bool` + +HasIdempotencyKey returns a boolean if a field has been set. + +### SetIdempotencyKeyNil + +`func (o *WebhookRepresentation) SetIdempotencyKeyNil(b bool)` + + SetIdempotencyKeyNil sets the value for IdempotencyKey to be an explicit nil + +### UnsetIdempotencyKey +`func (o *WebhookRepresentation) UnsetIdempotencyKey()` + +UnsetIdempotencyKey ensures that no value is present for IdempotencyKey, not even an explicit nil +### GetIgnoreSslErrors + +`func (o *WebhookRepresentation) GetIgnoreSslErrors() bool` + +GetIgnoreSslErrors returns the IgnoreSslErrors field if non-nil, zero value otherwise. + +### GetIgnoreSslErrorsOk + +`func (o *WebhookRepresentation) GetIgnoreSslErrorsOk() (*bool, bool)` + +GetIgnoreSslErrorsOk returns a tuple with the IgnoreSslErrors field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetIgnoreSslErrors + +`func (o *WebhookRepresentation) SetIgnoreSslErrors(v bool)` + +SetIgnoreSslErrors sets IgnoreSslErrors field to given value. + +### HasIgnoreSslErrors + +`func (o *WebhookRepresentation) HasIgnoreSslErrors() bool` + +HasIgnoreSslErrors returns a boolean if a field has been set. + +### SetIgnoreSslErrorsNil + +`func (o *WebhookRepresentation) SetIgnoreSslErrorsNil(b bool)` + + SetIgnoreSslErrorsNil sets the value for IgnoreSslErrors to be an explicit nil + +### UnsetIgnoreSslErrors +`func (o *WebhookRepresentation) UnsetIgnoreSslErrors()` + +UnsetIgnoreSslErrors ensures that no value is present for IgnoreSslErrors, not even an explicit nil +### GetDoNotRetry + +`func (o *WebhookRepresentation) GetDoNotRetry() bool` + +GetDoNotRetry returns the DoNotRetry field if non-nil, zero value otherwise. + +### GetDoNotRetryOk + +`func (o *WebhookRepresentation) GetDoNotRetryOk() (*bool, bool)` + +GetDoNotRetryOk returns a tuple with the DoNotRetry field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDoNotRetry + +`func (o *WebhookRepresentation) SetDoNotRetry(v bool)` + +SetDoNotRetry sets DoNotRetry field to given value. + +### HasDoNotRetry + +`func (o *WebhookRepresentation) HasDoNotRetry() bool` + +HasDoNotRetry returns a boolean if a field has been set. + +### SetDoNotRetryNil + +`func (o *WebhookRepresentation) SetDoNotRetryNil(b bool)` + + SetDoNotRetryNil sets the value for DoNotRetry to be an explicit nil + +### UnsetDoNotRetry +`func (o *WebhookRepresentation) UnsetDoNotRetry()` + +UnsetDoNotRetry ensures that no value is present for DoNotRetry, not even an explicit nil + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/WebhookResponse.md b/docs/WebhookResponse.md new file mode 100644 index 0000000..933323b --- /dev/null +++ b/docs/WebhookResponse.md @@ -0,0 +1,51 @@ +# WebhookResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Data** | [**Webhook**](Webhook.md) | | + +## Methods + +### NewWebhookResponse + +`func NewWebhookResponse(data Webhook, ) *WebhookResponse` + +NewWebhookResponse instantiates a new WebhookResponse object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewWebhookResponseWithDefaults + +`func NewWebhookResponseWithDefaults() *WebhookResponse` + +NewWebhookResponseWithDefaults instantiates a new WebhookResponse object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetData + +`func (o *WebhookResponse) GetData() Webhook` + +GetData returns the Data field if non-nil, zero value otherwise. + +### GetDataOk + +`func (o *WebhookResponse) GetDataOk() (*Webhook, bool)` + +GetDataOk returns a tuple with the Data field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetData + +`func (o *WebhookResponse) SetData(v Webhook)` + +SetData sets Data field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/WebhookShort.md b/docs/WebhookShort.md new file mode 100644 index 0000000..92ae1d0 --- /dev/null +++ b/docs/WebhookShort.md @@ -0,0 +1,441 @@ +# WebhookShort + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **string** | | +**CreatedAt** | **time.Time** | | +**ModifiedAt** | **time.Time** | | +**UserId** | **string** | | +**IsAdHoc** | Pointer to **NullableBool** | | [optional] +**IsApifyIntegration** | Pointer to **bool** | | [optional] +**IsEnabled** | Pointer to **bool** | | [optional] +**ActionType** | Pointer to **string** | | [optional] +**ShouldInterpolateStrings** | Pointer to **NullableBool** | | [optional] +**EventTypes** | [**[]WebhookEventType**](WebhookEventType.md) | | +**Condition** | [**WebhookCondition**](WebhookCondition.md) | | +**IgnoreSslErrors** | **bool** | | +**DoNotRetry** | **bool** | | +**RequestUrl** | **string** | | +**LastDispatch** | Pointer to [**NullableExampleWebhookDispatch**](ExampleWebhookDispatch.md) | | [optional] +**Stats** | Pointer to [**NullableWebhookStats**](WebhookStats.md) | | [optional] + +## Methods + +### NewWebhookShort + +`func NewWebhookShort(id string, createdAt time.Time, modifiedAt time.Time, userId string, eventTypes []WebhookEventType, condition WebhookCondition, ignoreSslErrors bool, doNotRetry bool, requestUrl string, ) *WebhookShort` + +NewWebhookShort instantiates a new WebhookShort object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewWebhookShortWithDefaults + +`func NewWebhookShortWithDefaults() *WebhookShort` + +NewWebhookShortWithDefaults instantiates a new WebhookShort object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetId + +`func (o *WebhookShort) GetId() string` + +GetId returns the Id field if non-nil, zero value otherwise. + +### GetIdOk + +`func (o *WebhookShort) GetIdOk() (*string, bool)` + +GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetId + +`func (o *WebhookShort) SetId(v string)` + +SetId sets Id field to given value. + + +### GetCreatedAt + +`func (o *WebhookShort) GetCreatedAt() time.Time` + +GetCreatedAt returns the CreatedAt field if non-nil, zero value otherwise. + +### GetCreatedAtOk + +`func (o *WebhookShort) GetCreatedAtOk() (*time.Time, bool)` + +GetCreatedAtOk returns a tuple with the CreatedAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCreatedAt + +`func (o *WebhookShort) SetCreatedAt(v time.Time)` + +SetCreatedAt sets CreatedAt field to given value. + + +### GetModifiedAt + +`func (o *WebhookShort) GetModifiedAt() time.Time` + +GetModifiedAt returns the ModifiedAt field if non-nil, zero value otherwise. + +### GetModifiedAtOk + +`func (o *WebhookShort) GetModifiedAtOk() (*time.Time, bool)` + +GetModifiedAtOk returns a tuple with the ModifiedAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetModifiedAt + +`func (o *WebhookShort) SetModifiedAt(v time.Time)` + +SetModifiedAt sets ModifiedAt field to given value. + + +### GetUserId + +`func (o *WebhookShort) GetUserId() string` + +GetUserId returns the UserId field if non-nil, zero value otherwise. + +### GetUserIdOk + +`func (o *WebhookShort) GetUserIdOk() (*string, bool)` + +GetUserIdOk returns a tuple with the UserId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUserId + +`func (o *WebhookShort) SetUserId(v string)` + +SetUserId sets UserId field to given value. + + +### GetIsAdHoc + +`func (o *WebhookShort) GetIsAdHoc() bool` + +GetIsAdHoc returns the IsAdHoc field if non-nil, zero value otherwise. + +### GetIsAdHocOk + +`func (o *WebhookShort) GetIsAdHocOk() (*bool, bool)` + +GetIsAdHocOk returns a tuple with the IsAdHoc field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetIsAdHoc + +`func (o *WebhookShort) SetIsAdHoc(v bool)` + +SetIsAdHoc sets IsAdHoc field to given value. + +### HasIsAdHoc + +`func (o *WebhookShort) HasIsAdHoc() bool` + +HasIsAdHoc returns a boolean if a field has been set. + +### SetIsAdHocNil + +`func (o *WebhookShort) SetIsAdHocNil(b bool)` + + SetIsAdHocNil sets the value for IsAdHoc to be an explicit nil + +### UnsetIsAdHoc +`func (o *WebhookShort) UnsetIsAdHoc()` + +UnsetIsAdHoc ensures that no value is present for IsAdHoc, not even an explicit nil +### GetIsApifyIntegration + +`func (o *WebhookShort) GetIsApifyIntegration() bool` + +GetIsApifyIntegration returns the IsApifyIntegration field if non-nil, zero value otherwise. + +### GetIsApifyIntegrationOk + +`func (o *WebhookShort) GetIsApifyIntegrationOk() (*bool, bool)` + +GetIsApifyIntegrationOk returns a tuple with the IsApifyIntegration field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetIsApifyIntegration + +`func (o *WebhookShort) SetIsApifyIntegration(v bool)` + +SetIsApifyIntegration sets IsApifyIntegration field to given value. + +### HasIsApifyIntegration + +`func (o *WebhookShort) HasIsApifyIntegration() bool` + +HasIsApifyIntegration returns a boolean if a field has been set. + +### GetIsEnabled + +`func (o *WebhookShort) GetIsEnabled() bool` + +GetIsEnabled returns the IsEnabled field if non-nil, zero value otherwise. + +### GetIsEnabledOk + +`func (o *WebhookShort) GetIsEnabledOk() (*bool, bool)` + +GetIsEnabledOk returns a tuple with the IsEnabled field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetIsEnabled + +`func (o *WebhookShort) SetIsEnabled(v bool)` + +SetIsEnabled sets IsEnabled field to given value. + +### HasIsEnabled + +`func (o *WebhookShort) HasIsEnabled() bool` + +HasIsEnabled returns a boolean if a field has been set. + +### GetActionType + +`func (o *WebhookShort) GetActionType() string` + +GetActionType returns the ActionType field if non-nil, zero value otherwise. + +### GetActionTypeOk + +`func (o *WebhookShort) GetActionTypeOk() (*string, bool)` + +GetActionTypeOk returns a tuple with the ActionType field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetActionType + +`func (o *WebhookShort) SetActionType(v string)` + +SetActionType sets ActionType field to given value. + +### HasActionType + +`func (o *WebhookShort) HasActionType() bool` + +HasActionType returns a boolean if a field has been set. + +### GetShouldInterpolateStrings + +`func (o *WebhookShort) GetShouldInterpolateStrings() bool` + +GetShouldInterpolateStrings returns the ShouldInterpolateStrings field if non-nil, zero value otherwise. + +### GetShouldInterpolateStringsOk + +`func (o *WebhookShort) GetShouldInterpolateStringsOk() (*bool, bool)` + +GetShouldInterpolateStringsOk returns a tuple with the ShouldInterpolateStrings field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetShouldInterpolateStrings + +`func (o *WebhookShort) SetShouldInterpolateStrings(v bool)` + +SetShouldInterpolateStrings sets ShouldInterpolateStrings field to given value. + +### HasShouldInterpolateStrings + +`func (o *WebhookShort) HasShouldInterpolateStrings() bool` + +HasShouldInterpolateStrings returns a boolean if a field has been set. + +### SetShouldInterpolateStringsNil + +`func (o *WebhookShort) SetShouldInterpolateStringsNil(b bool)` + + SetShouldInterpolateStringsNil sets the value for ShouldInterpolateStrings to be an explicit nil + +### UnsetShouldInterpolateStrings +`func (o *WebhookShort) UnsetShouldInterpolateStrings()` + +UnsetShouldInterpolateStrings ensures that no value is present for ShouldInterpolateStrings, not even an explicit nil +### GetEventTypes + +`func (o *WebhookShort) GetEventTypes() []WebhookEventType` + +GetEventTypes returns the EventTypes field if non-nil, zero value otherwise. + +### GetEventTypesOk + +`func (o *WebhookShort) GetEventTypesOk() (*[]WebhookEventType, bool)` + +GetEventTypesOk returns a tuple with the EventTypes field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetEventTypes + +`func (o *WebhookShort) SetEventTypes(v []WebhookEventType)` + +SetEventTypes sets EventTypes field to given value. + + +### GetCondition + +`func (o *WebhookShort) GetCondition() WebhookCondition` + +GetCondition returns the Condition field if non-nil, zero value otherwise. + +### GetConditionOk + +`func (o *WebhookShort) GetConditionOk() (*WebhookCondition, bool)` + +GetConditionOk returns a tuple with the Condition field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCondition + +`func (o *WebhookShort) SetCondition(v WebhookCondition)` + +SetCondition sets Condition field to given value. + + +### GetIgnoreSslErrors + +`func (o *WebhookShort) GetIgnoreSslErrors() bool` + +GetIgnoreSslErrors returns the IgnoreSslErrors field if non-nil, zero value otherwise. + +### GetIgnoreSslErrorsOk + +`func (o *WebhookShort) GetIgnoreSslErrorsOk() (*bool, bool)` + +GetIgnoreSslErrorsOk returns a tuple with the IgnoreSslErrors field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetIgnoreSslErrors + +`func (o *WebhookShort) SetIgnoreSslErrors(v bool)` + +SetIgnoreSslErrors sets IgnoreSslErrors field to given value. + + +### GetDoNotRetry + +`func (o *WebhookShort) GetDoNotRetry() bool` + +GetDoNotRetry returns the DoNotRetry field if non-nil, zero value otherwise. + +### GetDoNotRetryOk + +`func (o *WebhookShort) GetDoNotRetryOk() (*bool, bool)` + +GetDoNotRetryOk returns a tuple with the DoNotRetry field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDoNotRetry + +`func (o *WebhookShort) SetDoNotRetry(v bool)` + +SetDoNotRetry sets DoNotRetry field to given value. + + +### GetRequestUrl + +`func (o *WebhookShort) GetRequestUrl() string` + +GetRequestUrl returns the RequestUrl field if non-nil, zero value otherwise. + +### GetRequestUrlOk + +`func (o *WebhookShort) GetRequestUrlOk() (*string, bool)` + +GetRequestUrlOk returns a tuple with the RequestUrl field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRequestUrl + +`func (o *WebhookShort) SetRequestUrl(v string)` + +SetRequestUrl sets RequestUrl field to given value. + + +### GetLastDispatch + +`func (o *WebhookShort) GetLastDispatch() ExampleWebhookDispatch` + +GetLastDispatch returns the LastDispatch field if non-nil, zero value otherwise. + +### GetLastDispatchOk + +`func (o *WebhookShort) GetLastDispatchOk() (*ExampleWebhookDispatch, bool)` + +GetLastDispatchOk returns a tuple with the LastDispatch field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetLastDispatch + +`func (o *WebhookShort) SetLastDispatch(v ExampleWebhookDispatch)` + +SetLastDispatch sets LastDispatch field to given value. + +### HasLastDispatch + +`func (o *WebhookShort) HasLastDispatch() bool` + +HasLastDispatch returns a boolean if a field has been set. + +### SetLastDispatchNil + +`func (o *WebhookShort) SetLastDispatchNil(b bool)` + + SetLastDispatchNil sets the value for LastDispatch to be an explicit nil + +### UnsetLastDispatch +`func (o *WebhookShort) UnsetLastDispatch()` + +UnsetLastDispatch ensures that no value is present for LastDispatch, not even an explicit nil +### GetStats + +`func (o *WebhookShort) GetStats() WebhookStats` + +GetStats returns the Stats field if non-nil, zero value otherwise. + +### GetStatsOk + +`func (o *WebhookShort) GetStatsOk() (*WebhookStats, bool)` + +GetStatsOk returns a tuple with the Stats field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetStats + +`func (o *WebhookShort) SetStats(v WebhookStats)` + +SetStats sets Stats field to given value. + +### HasStats + +`func (o *WebhookShort) HasStats() bool` + +HasStats returns a boolean if a field has been set. + +### SetStatsNil + +`func (o *WebhookShort) SetStatsNil(b bool)` + + SetStatsNil sets the value for Stats to be an explicit nil + +### UnsetStats +`func (o *WebhookShort) UnsetStats()` + +UnsetStats ensures that no value is present for Stats, not even an explicit nil + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/WebhookStats.md b/docs/WebhookStats.md new file mode 100644 index 0000000..72e1f31 --- /dev/null +++ b/docs/WebhookStats.md @@ -0,0 +1,51 @@ +# WebhookStats + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**TotalDispatches** | **int32** | | + +## Methods + +### NewWebhookStats + +`func NewWebhookStats(totalDispatches int32, ) *WebhookStats` + +NewWebhookStats instantiates a new WebhookStats object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewWebhookStatsWithDefaults + +`func NewWebhookStatsWithDefaults() *WebhookStats` + +NewWebhookStatsWithDefaults instantiates a new WebhookStats object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetTotalDispatches + +`func (o *WebhookStats) GetTotalDispatches() int32` + +GetTotalDispatches returns the TotalDispatches field if non-nil, zero value otherwise. + +### GetTotalDispatchesOk + +`func (o *WebhookStats) GetTotalDispatchesOk() (*int32, bool)` + +GetTotalDispatchesOk returns a tuple with the TotalDispatches field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTotalDispatches + +`func (o *WebhookStats) SetTotalDispatches(v int32)` + +SetTotalDispatches sets TotalDispatches field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/WebhookUpdate.md b/docs/WebhookUpdate.md new file mode 100644 index 0000000..32810d4 --- /dev/null +++ b/docs/WebhookUpdate.md @@ -0,0 +1,390 @@ +# WebhookUpdate + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**IsAdHoc** | Pointer to **NullableBool** | | [optional] +**EventTypes** | Pointer to [**[]WebhookEventType**](WebhookEventType.md) | | [optional] +**Condition** | Pointer to [**NullableWebhookCondition**](WebhookCondition.md) | | [optional] +**IgnoreSslErrors** | Pointer to **NullableBool** | | [optional] +**DoNotRetry** | Pointer to **NullableBool** | | [optional] +**RequestUrl** | Pointer to **NullableString** | | [optional] +**PayloadTemplate** | Pointer to **NullableString** | | [optional] +**HeadersTemplate** | Pointer to **NullableString** | | [optional] +**Description** | Pointer to **NullableString** | | [optional] +**ShouldInterpolateStrings** | Pointer to **NullableBool** | | [optional] + +## Methods + +### NewWebhookUpdate + +`func NewWebhookUpdate() *WebhookUpdate` + +NewWebhookUpdate instantiates a new WebhookUpdate object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewWebhookUpdateWithDefaults + +`func NewWebhookUpdateWithDefaults() *WebhookUpdate` + +NewWebhookUpdateWithDefaults instantiates a new WebhookUpdate object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetIsAdHoc + +`func (o *WebhookUpdate) GetIsAdHoc() bool` + +GetIsAdHoc returns the IsAdHoc field if non-nil, zero value otherwise. + +### GetIsAdHocOk + +`func (o *WebhookUpdate) GetIsAdHocOk() (*bool, bool)` + +GetIsAdHocOk returns a tuple with the IsAdHoc field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetIsAdHoc + +`func (o *WebhookUpdate) SetIsAdHoc(v bool)` + +SetIsAdHoc sets IsAdHoc field to given value. + +### HasIsAdHoc + +`func (o *WebhookUpdate) HasIsAdHoc() bool` + +HasIsAdHoc returns a boolean if a field has been set. + +### SetIsAdHocNil + +`func (o *WebhookUpdate) SetIsAdHocNil(b bool)` + + SetIsAdHocNil sets the value for IsAdHoc to be an explicit nil + +### UnsetIsAdHoc +`func (o *WebhookUpdate) UnsetIsAdHoc()` + +UnsetIsAdHoc ensures that no value is present for IsAdHoc, not even an explicit nil +### GetEventTypes + +`func (o *WebhookUpdate) GetEventTypes() []WebhookEventType` + +GetEventTypes returns the EventTypes field if non-nil, zero value otherwise. + +### GetEventTypesOk + +`func (o *WebhookUpdate) GetEventTypesOk() (*[]WebhookEventType, bool)` + +GetEventTypesOk returns a tuple with the EventTypes field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetEventTypes + +`func (o *WebhookUpdate) SetEventTypes(v []WebhookEventType)` + +SetEventTypes sets EventTypes field to given value. + +### HasEventTypes + +`func (o *WebhookUpdate) HasEventTypes() bool` + +HasEventTypes returns a boolean if a field has been set. + +### SetEventTypesNil + +`func (o *WebhookUpdate) SetEventTypesNil(b bool)` + + SetEventTypesNil sets the value for EventTypes to be an explicit nil + +### UnsetEventTypes +`func (o *WebhookUpdate) UnsetEventTypes()` + +UnsetEventTypes ensures that no value is present for EventTypes, not even an explicit nil +### GetCondition + +`func (o *WebhookUpdate) GetCondition() WebhookCondition` + +GetCondition returns the Condition field if non-nil, zero value otherwise. + +### GetConditionOk + +`func (o *WebhookUpdate) GetConditionOk() (*WebhookCondition, bool)` + +GetConditionOk returns a tuple with the Condition field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCondition + +`func (o *WebhookUpdate) SetCondition(v WebhookCondition)` + +SetCondition sets Condition field to given value. + +### HasCondition + +`func (o *WebhookUpdate) HasCondition() bool` + +HasCondition returns a boolean if a field has been set. + +### SetConditionNil + +`func (o *WebhookUpdate) SetConditionNil(b bool)` + + SetConditionNil sets the value for Condition to be an explicit nil + +### UnsetCondition +`func (o *WebhookUpdate) UnsetCondition()` + +UnsetCondition ensures that no value is present for Condition, not even an explicit nil +### GetIgnoreSslErrors + +`func (o *WebhookUpdate) GetIgnoreSslErrors() bool` + +GetIgnoreSslErrors returns the IgnoreSslErrors field if non-nil, zero value otherwise. + +### GetIgnoreSslErrorsOk + +`func (o *WebhookUpdate) GetIgnoreSslErrorsOk() (*bool, bool)` + +GetIgnoreSslErrorsOk returns a tuple with the IgnoreSslErrors field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetIgnoreSslErrors + +`func (o *WebhookUpdate) SetIgnoreSslErrors(v bool)` + +SetIgnoreSslErrors sets IgnoreSslErrors field to given value. + +### HasIgnoreSslErrors + +`func (o *WebhookUpdate) HasIgnoreSslErrors() bool` + +HasIgnoreSslErrors returns a boolean if a field has been set. + +### SetIgnoreSslErrorsNil + +`func (o *WebhookUpdate) SetIgnoreSslErrorsNil(b bool)` + + SetIgnoreSslErrorsNil sets the value for IgnoreSslErrors to be an explicit nil + +### UnsetIgnoreSslErrors +`func (o *WebhookUpdate) UnsetIgnoreSslErrors()` + +UnsetIgnoreSslErrors ensures that no value is present for IgnoreSslErrors, not even an explicit nil +### GetDoNotRetry + +`func (o *WebhookUpdate) GetDoNotRetry() bool` + +GetDoNotRetry returns the DoNotRetry field if non-nil, zero value otherwise. + +### GetDoNotRetryOk + +`func (o *WebhookUpdate) GetDoNotRetryOk() (*bool, bool)` + +GetDoNotRetryOk returns a tuple with the DoNotRetry field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDoNotRetry + +`func (o *WebhookUpdate) SetDoNotRetry(v bool)` + +SetDoNotRetry sets DoNotRetry field to given value. + +### HasDoNotRetry + +`func (o *WebhookUpdate) HasDoNotRetry() bool` + +HasDoNotRetry returns a boolean if a field has been set. + +### SetDoNotRetryNil + +`func (o *WebhookUpdate) SetDoNotRetryNil(b bool)` + + SetDoNotRetryNil sets the value for DoNotRetry to be an explicit nil + +### UnsetDoNotRetry +`func (o *WebhookUpdate) UnsetDoNotRetry()` + +UnsetDoNotRetry ensures that no value is present for DoNotRetry, not even an explicit nil +### GetRequestUrl + +`func (o *WebhookUpdate) GetRequestUrl() string` + +GetRequestUrl returns the RequestUrl field if non-nil, zero value otherwise. + +### GetRequestUrlOk + +`func (o *WebhookUpdate) GetRequestUrlOk() (*string, bool)` + +GetRequestUrlOk returns a tuple with the RequestUrl field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRequestUrl + +`func (o *WebhookUpdate) SetRequestUrl(v string)` + +SetRequestUrl sets RequestUrl field to given value. + +### HasRequestUrl + +`func (o *WebhookUpdate) HasRequestUrl() bool` + +HasRequestUrl returns a boolean if a field has been set. + +### SetRequestUrlNil + +`func (o *WebhookUpdate) SetRequestUrlNil(b bool)` + + SetRequestUrlNil sets the value for RequestUrl to be an explicit nil + +### UnsetRequestUrl +`func (o *WebhookUpdate) UnsetRequestUrl()` + +UnsetRequestUrl ensures that no value is present for RequestUrl, not even an explicit nil +### GetPayloadTemplate + +`func (o *WebhookUpdate) GetPayloadTemplate() string` + +GetPayloadTemplate returns the PayloadTemplate field if non-nil, zero value otherwise. + +### GetPayloadTemplateOk + +`func (o *WebhookUpdate) GetPayloadTemplateOk() (*string, bool)` + +GetPayloadTemplateOk returns a tuple with the PayloadTemplate field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPayloadTemplate + +`func (o *WebhookUpdate) SetPayloadTemplate(v string)` + +SetPayloadTemplate sets PayloadTemplate field to given value. + +### HasPayloadTemplate + +`func (o *WebhookUpdate) HasPayloadTemplate() bool` + +HasPayloadTemplate returns a boolean if a field has been set. + +### SetPayloadTemplateNil + +`func (o *WebhookUpdate) SetPayloadTemplateNil(b bool)` + + SetPayloadTemplateNil sets the value for PayloadTemplate to be an explicit nil + +### UnsetPayloadTemplate +`func (o *WebhookUpdate) UnsetPayloadTemplate()` + +UnsetPayloadTemplate ensures that no value is present for PayloadTemplate, not even an explicit nil +### GetHeadersTemplate + +`func (o *WebhookUpdate) GetHeadersTemplate() string` + +GetHeadersTemplate returns the HeadersTemplate field if non-nil, zero value otherwise. + +### GetHeadersTemplateOk + +`func (o *WebhookUpdate) GetHeadersTemplateOk() (*string, bool)` + +GetHeadersTemplateOk returns a tuple with the HeadersTemplate field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetHeadersTemplate + +`func (o *WebhookUpdate) SetHeadersTemplate(v string)` + +SetHeadersTemplate sets HeadersTemplate field to given value. + +### HasHeadersTemplate + +`func (o *WebhookUpdate) HasHeadersTemplate() bool` + +HasHeadersTemplate returns a boolean if a field has been set. + +### SetHeadersTemplateNil + +`func (o *WebhookUpdate) SetHeadersTemplateNil(b bool)` + + SetHeadersTemplateNil sets the value for HeadersTemplate to be an explicit nil + +### UnsetHeadersTemplate +`func (o *WebhookUpdate) UnsetHeadersTemplate()` + +UnsetHeadersTemplate ensures that no value is present for HeadersTemplate, not even an explicit nil +### GetDescription + +`func (o *WebhookUpdate) GetDescription() string` + +GetDescription returns the Description field if non-nil, zero value otherwise. + +### GetDescriptionOk + +`func (o *WebhookUpdate) GetDescriptionOk() (*string, bool)` + +GetDescriptionOk returns a tuple with the Description field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDescription + +`func (o *WebhookUpdate) SetDescription(v string)` + +SetDescription sets Description field to given value. + +### HasDescription + +`func (o *WebhookUpdate) HasDescription() bool` + +HasDescription returns a boolean if a field has been set. + +### SetDescriptionNil + +`func (o *WebhookUpdate) SetDescriptionNil(b bool)` + + SetDescriptionNil sets the value for Description to be an explicit nil + +### UnsetDescription +`func (o *WebhookUpdate) UnsetDescription()` + +UnsetDescription ensures that no value is present for Description, not even an explicit nil +### GetShouldInterpolateStrings + +`func (o *WebhookUpdate) GetShouldInterpolateStrings() bool` + +GetShouldInterpolateStrings returns the ShouldInterpolateStrings field if non-nil, zero value otherwise. + +### GetShouldInterpolateStringsOk + +`func (o *WebhookUpdate) GetShouldInterpolateStringsOk() (*bool, bool)` + +GetShouldInterpolateStringsOk returns a tuple with the ShouldInterpolateStrings field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetShouldInterpolateStrings + +`func (o *WebhookUpdate) SetShouldInterpolateStrings(v bool)` + +SetShouldInterpolateStrings sets ShouldInterpolateStrings field to given value. + +### HasShouldInterpolateStrings + +`func (o *WebhookUpdate) HasShouldInterpolateStrings() bool` + +HasShouldInterpolateStrings returns a boolean if a field has been set. + +### SetShouldInterpolateStringsNil + +`func (o *WebhookUpdate) SetShouldInterpolateStringsNil(b bool)` + + SetShouldInterpolateStringsNil sets the value for ShouldInterpolateStrings to be an explicit nil + +### UnsetShouldInterpolateStrings +`func (o *WebhookUpdate) UnsetShouldInterpolateStrings()` + +UnsetShouldInterpolateStrings ensures that no value is present for ShouldInterpolateStrings, not even an explicit nil + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/WebhooksWebhookDispatchesAPI.md b/docs/WebhooksWebhookDispatchesAPI.md new file mode 100644 index 0000000..a02b7ee --- /dev/null +++ b/docs/WebhooksWebhookDispatchesAPI.md @@ -0,0 +1,150 @@ +# \WebhooksWebhookDispatchesAPI + +All URIs are relative to *https://api.apify.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**WebhookDispatchGet**](WebhooksWebhookDispatchesAPI.md#WebhookDispatchGet) | **Get** /v2/webhook-dispatches/{dispatchId} | Get webhook dispatch +[**WebhookDispatchesGet**](WebhooksWebhookDispatchesAPI.md#WebhookDispatchesGet) | **Get** /v2/webhook-dispatches | Get list of webhook dispatches + + + +## WebhookDispatchGet + +> WebhookDispatchResponse WebhookDispatchGet(ctx, dispatchId).Execute() + +Get webhook dispatch + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + dispatchId := "Zib4xbZsmvZeK55ua" // string | Webhook dispatch ID. + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.WebhooksWebhookDispatchesAPI.WebhookDispatchGet(context.Background(), dispatchId).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `WebhooksWebhookDispatchesAPI.WebhookDispatchGet``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `WebhookDispatchGet`: WebhookDispatchResponse + fmt.Fprintf(os.Stdout, "Response from `WebhooksWebhookDispatchesAPI.WebhookDispatchGet`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**dispatchId** | **string** | Webhook dispatch ID. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiWebhookDispatchGetRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + +### Return type + +[**WebhookDispatchResponse**](WebhookDispatchResponse.md) + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## WebhookDispatchesGet + +> ListOfWebhookDispatchesResponse WebhookDispatchesGet(ctx).Offset(offset).Limit(limit).Desc(desc).Execute() + +Get list of webhook dispatches + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + offset := float64(0) // float64 | Number of items that should be skipped at the start. The default value is `0`. (optional) + limit := float64(1000) // float64 | Maximum number of items to return. The default value as well as the maximum is `1000`. (optional) + desc := true // bool | If `true` or `1` then the objects are sorted by the `createdAt` field in descending order. By default, they are sorted in ascending order. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.WebhooksWebhookDispatchesAPI.WebhookDispatchesGet(context.Background()).Offset(offset).Limit(limit).Desc(desc).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `WebhooksWebhookDispatchesAPI.WebhookDispatchesGet``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `WebhookDispatchesGet`: ListOfWebhookDispatchesResponse + fmt.Fprintf(os.Stdout, "Response from `WebhooksWebhookDispatchesAPI.WebhookDispatchesGet`: %v\n", resp) +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiWebhookDispatchesGetRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **offset** | **float64** | Number of items that should be skipped at the start. The default value is `0`. | + **limit** | **float64** | Maximum number of items to return. The default value as well as the maximum is `1000`. | + **desc** | **bool** | If `true` or `1` then the objects are sorted by the `createdAt` field in descending order. By default, they are sorted in ascending order. | + +### Return type + +[**ListOfWebhookDispatchesResponse**](ListOfWebhookDispatchesResponse.md) + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/docs/WebhooksWebhooksAPI.md b/docs/WebhooksWebhooksAPI.md new file mode 100644 index 0000000..e4ec489 --- /dev/null +++ b/docs/WebhooksWebhooksAPI.md @@ -0,0 +1,503 @@ +# \WebhooksWebhooksAPI + +All URIs are relative to *https://api.apify.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**WebhookDelete**](WebhooksWebhooksAPI.md#WebhookDelete) | **Delete** /v2/webhooks/{webhookId} | Delete webhook +[**WebhookGet**](WebhooksWebhooksAPI.md#WebhookGet) | **Get** /v2/webhooks/{webhookId} | Get webhook +[**WebhookPut**](WebhooksWebhooksAPI.md#WebhookPut) | **Put** /v2/webhooks/{webhookId} | Update webhook +[**WebhookTestPost**](WebhooksWebhooksAPI.md#WebhookTestPost) | **Post** /v2/webhooks/{webhookId}/test | Test webhook +[**WebhookWebhookDispatchesGet**](WebhooksWebhooksAPI.md#WebhookWebhookDispatchesGet) | **Get** /v2/webhooks/{webhookId}/dispatches | Get collection +[**WebhooksGet**](WebhooksWebhooksAPI.md#WebhooksGet) | **Get** /v2/webhooks | Get list of webhooks +[**WebhooksPost**](WebhooksWebhooksAPI.md#WebhooksPost) | **Post** /v2/webhooks | Create webhook + + + +## WebhookDelete + +> map[string]interface{} WebhookDelete(ctx, webhookId).Execute() + +Delete webhook + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + webhookId := "pVJtoTelgYUq4qJOt" // string | Webhook ID. + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.WebhooksWebhooksAPI.WebhookDelete(context.Background(), webhookId).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `WebhooksWebhooksAPI.WebhookDelete``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `WebhookDelete`: map[string]interface{} + fmt.Fprintf(os.Stdout, "Response from `WebhooksWebhooksAPI.WebhookDelete`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**webhookId** | **string** | Webhook ID. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiWebhookDeleteRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + +### Return type + +**map[string]interface{}** + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## WebhookGet + +> WebhookResponse WebhookGet(ctx, webhookId).Execute() + +Get webhook + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + webhookId := "pVJtoTelgYUq4qJOt" // string | Webhook ID. + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.WebhooksWebhooksAPI.WebhookGet(context.Background(), webhookId).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `WebhooksWebhooksAPI.WebhookGet``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `WebhookGet`: WebhookResponse + fmt.Fprintf(os.Stdout, "Response from `WebhooksWebhooksAPI.WebhookGet`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**webhookId** | **string** | Webhook ID. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiWebhookGetRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + +### Return type + +[**WebhookResponse**](WebhookResponse.md) + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## WebhookPut + +> WebhookResponse WebhookPut(ctx, webhookId).WebhookUpdate(webhookUpdate).Execute() + +Update webhook + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + webhookId := "pVJtoTelgYUq4qJOt" // string | Webhook ID. + webhookUpdate := *openapiclient.NewWebhookUpdate() // WebhookUpdate | + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.WebhooksWebhooksAPI.WebhookPut(context.Background(), webhookId).WebhookUpdate(webhookUpdate).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `WebhooksWebhooksAPI.WebhookPut``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `WebhookPut`: WebhookResponse + fmt.Fprintf(os.Stdout, "Response from `WebhooksWebhooksAPI.WebhookPut`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**webhookId** | **string** | Webhook ID. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiWebhookPutRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **webhookUpdate** | [**WebhookUpdate**](WebhookUpdate.md) | | + +### Return type + +[**WebhookResponse**](WebhookResponse.md) + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## WebhookTestPost + +> TestWebhookResponse WebhookTestPost(ctx, webhookId).Execute() + +Test webhook + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + webhookId := "pVJtoTelgYUq4qJOt" // string | Webhook ID. + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.WebhooksWebhooksAPI.WebhookTestPost(context.Background(), webhookId).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `WebhooksWebhooksAPI.WebhookTestPost``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `WebhookTestPost`: TestWebhookResponse + fmt.Fprintf(os.Stdout, "Response from `WebhooksWebhooksAPI.WebhookTestPost`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**webhookId** | **string** | Webhook ID. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiWebhookTestPostRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + +### Return type + +[**TestWebhookResponse**](TestWebhookResponse.md) + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## WebhookWebhookDispatchesGet + +> ListOfWebhookDispatchesResponse WebhookWebhookDispatchesGet(ctx, webhookId).Execute() + +Get collection + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + webhookId := "pVJtoTelgYUq4qJOt" // string | Webhook ID. + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.WebhooksWebhooksAPI.WebhookWebhookDispatchesGet(context.Background(), webhookId).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `WebhooksWebhooksAPI.WebhookWebhookDispatchesGet``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `WebhookWebhookDispatchesGet`: ListOfWebhookDispatchesResponse + fmt.Fprintf(os.Stdout, "Response from `WebhooksWebhooksAPI.WebhookWebhookDispatchesGet`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**webhookId** | **string** | Webhook ID. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiWebhookWebhookDispatchesGetRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + +### Return type + +[**ListOfWebhookDispatchesResponse**](ListOfWebhookDispatchesResponse.md) + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## WebhooksGet + +> ListOfWebhooksResponse WebhooksGet(ctx).Offset(offset).Limit(limit).Desc(desc).Execute() + +Get list of webhooks + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + offset := float64(0) // float64 | Number of items that should be skipped at the start. The default value is `0`. (optional) + limit := float64(1000) // float64 | Maximum number of items to return. The default value as well as the maximum is `1000`. (optional) + desc := true // bool | If `true` or `1` then the objects are sorted by the `createdAt` field in descending order. By default, they are sorted in ascending order. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.WebhooksWebhooksAPI.WebhooksGet(context.Background()).Offset(offset).Limit(limit).Desc(desc).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `WebhooksWebhooksAPI.WebhooksGet``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `WebhooksGet`: ListOfWebhooksResponse + fmt.Fprintf(os.Stdout, "Response from `WebhooksWebhooksAPI.WebhooksGet`: %v\n", resp) +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiWebhooksGetRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **offset** | **float64** | Number of items that should be skipped at the start. The default value is `0`. | + **limit** | **float64** | Maximum number of items to return. The default value as well as the maximum is `1000`. | + **desc** | **bool** | If `true` or `1` then the objects are sorted by the `createdAt` field in descending order. By default, they are sorted in ascending order. | + +### Return type + +[**ListOfWebhooksResponse**](ListOfWebhooksResponse.md) + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## WebhooksPost + +> WebhookResponse WebhooksPost(ctx).WebhookCreate(webhookCreate).Execute() + +Create webhook + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/apify/apify-client-go" +) + +func main() { + webhookCreate := *openapiclient.NewWebhookCreate([]openapiclient.WebhookEventType{openapiclient.WebhookEventType("ACTOR.BUILD.ABORTED")}, *openapiclient.NewWebhookCondition(), "RequestUrl_example") // WebhookCreate | + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.WebhooksWebhooksAPI.WebhooksPost(context.Background()).WebhookCreate(webhookCreate).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `WebhooksWebhooksAPI.WebhooksPost``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `WebhooksPost`: WebhookResponse + fmt.Fprintf(os.Stdout, "Response from `WebhooksWebhooksAPI.WebhooksPost`: %v\n", resp) +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiWebhooksPostRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **webhookCreate** | [**WebhookCreate**](WebhookCreate.md) | | + +### Return type + +[**WebhookResponse**](WebhookResponse.md) + +### Authorization + +[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/git_push.sh b/git_push.sh new file mode 100644 index 0000000..f421bf0 --- /dev/null +++ b/git_push.sh @@ -0,0 +1,57 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="github.com" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi + +if [ "$git_user_id" = "" ]; then + git_user_id="apify" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="apify-client-go" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=$(git remote) +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..dbfbb61 --- /dev/null +++ b/go.mod @@ -0,0 +1,7 @@ +module github.com/apify/apify-client-go + +go 1.23 + +require ( + gopkg.in/validator.v2 v2.0.1 +) diff --git a/go.sum b/go.sum new file mode 100644 index 0000000..525afa0 --- /dev/null +++ b/go.sum @@ -0,0 +1,13 @@ +cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +github.com/golang/protobuf v1.2.0 h1:P3YflyNX/ehuJFLhxviNdFxQPkGK5cDcApsge1SqnvM= +github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e h1:bRhVy7zSSasaqNksaRZiA5EEI+Ei4I1nO5Jh72wfHlg= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4 h1:YUO/7uOKsKeq9UokNS62b8FYywz3ker1l1vDZRCRefw= +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +google.golang.org/appengine v1.4.0 h1:/wp5JvzpHIxhs/dumFmF7BXTf3Z+dd4uXta4kVyO508= +google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +gopkg.in/validator.v2 v2.0.1 h1:xF0KWyGWXm/LM2G1TrEjqOu4pa6coO9AlWSf3msVfDY= +gopkg.in/validator.v2 v2.0.1/go.mod h1:lIUZBlB3Im4s/eYp39Ry/wkR02yOPhZ9IwIRBjuPuG8= diff --git a/model_account_limits.go b/model_account_limits.go new file mode 100644 index 0000000..7faeabc --- /dev/null +++ b/model_account_limits.go @@ -0,0 +1,214 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" + "bytes" + "fmt" +) + +// checks if the AccountLimits type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &AccountLimits{} + +// AccountLimits struct for AccountLimits +type AccountLimits struct { + MonthlyUsageCycle UsageCycle `json:"monthlyUsageCycle"` + Limits Limits `json:"limits"` + Current Current `json:"current"` +} + +type _AccountLimits AccountLimits + +// NewAccountLimits instantiates a new AccountLimits object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewAccountLimits(monthlyUsageCycle UsageCycle, limits Limits, current Current) *AccountLimits { + this := AccountLimits{} + this.MonthlyUsageCycle = monthlyUsageCycle + this.Limits = limits + this.Current = current + return &this +} + +// NewAccountLimitsWithDefaults instantiates a new AccountLimits object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewAccountLimitsWithDefaults() *AccountLimits { + this := AccountLimits{} + return &this +} + +// GetMonthlyUsageCycle returns the MonthlyUsageCycle field value +func (o *AccountLimits) GetMonthlyUsageCycle() UsageCycle { + if o == nil { + var ret UsageCycle + return ret + } + + return o.MonthlyUsageCycle +} + +// GetMonthlyUsageCycleOk returns a tuple with the MonthlyUsageCycle field value +// and a boolean to check if the value has been set. +func (o *AccountLimits) GetMonthlyUsageCycleOk() (*UsageCycle, bool) { + if o == nil { + return nil, false + } + return &o.MonthlyUsageCycle, true +} + +// SetMonthlyUsageCycle sets field value +func (o *AccountLimits) SetMonthlyUsageCycle(v UsageCycle) { + o.MonthlyUsageCycle = v +} + +// GetLimits returns the Limits field value +func (o *AccountLimits) GetLimits() Limits { + if o == nil { + var ret Limits + return ret + } + + return o.Limits +} + +// GetLimitsOk returns a tuple with the Limits field value +// and a boolean to check if the value has been set. +func (o *AccountLimits) GetLimitsOk() (*Limits, bool) { + if o == nil { + return nil, false + } + return &o.Limits, true +} + +// SetLimits sets field value +func (o *AccountLimits) SetLimits(v Limits) { + o.Limits = v +} + +// GetCurrent returns the Current field value +func (o *AccountLimits) GetCurrent() Current { + if o == nil { + var ret Current + return ret + } + + return o.Current +} + +// GetCurrentOk returns a tuple with the Current field value +// and a boolean to check if the value has been set. +func (o *AccountLimits) GetCurrentOk() (*Current, bool) { + if o == nil { + return nil, false + } + return &o.Current, true +} + +// SetCurrent sets field value +func (o *AccountLimits) SetCurrent(v Current) { + o.Current = v +} + +func (o AccountLimits) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o AccountLimits) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["monthlyUsageCycle"] = o.MonthlyUsageCycle + toSerialize["limits"] = o.Limits + toSerialize["current"] = o.Current + return toSerialize, nil +} + +func (o *AccountLimits) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "monthlyUsageCycle", + "limits", + "current", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varAccountLimits := _AccountLimits{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varAccountLimits) + + if err != nil { + return err + } + + *o = AccountLimits(varAccountLimits) + + return err +} + +type NullableAccountLimits struct { + value *AccountLimits + isSet bool +} + +func (v NullableAccountLimits) Get() *AccountLimits { + return v.value +} + +func (v *NullableAccountLimits) Set(val *AccountLimits) { + v.value = val + v.isSet = true +} + +func (v NullableAccountLimits) IsSet() bool { + return v.isSet +} + +func (v *NullableAccountLimits) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAccountLimits(val *AccountLimits) *NullableAccountLimits { + return &NullableAccountLimits{value: val, isSet: true} +} + +func (v NullableAccountLimits) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAccountLimits) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_act_runs_last_dataset_items_post_400_response.go b/model_act_runs_last_dataset_items_post_400_response.go new file mode 100644 index 0000000..39dd953 --- /dev/null +++ b/model_act_runs_last_dataset_items_post_400_response.go @@ -0,0 +1,107 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" + "fmt" +) + + +// ActRunsLastDatasetItemsPost400Response struct for ActRunsLastDatasetItemsPost400Response +type ActRunsLastDatasetItemsPost400Response struct { + ErrorResponse *ErrorResponse + PutItemResponseError *PutItemResponseError +} + +// Unmarshal JSON data into any of the pointers in the struct +func (dst *ActRunsLastDatasetItemsPost400Response) UnmarshalJSON(data []byte) error { + var err error + // try to unmarshal JSON data into ErrorResponse + err = json.Unmarshal(data, &dst.ErrorResponse); + if err == nil { + jsonErrorResponse, _ := json.Marshal(dst.ErrorResponse) + if string(jsonErrorResponse) == "{}" { // empty struct + dst.ErrorResponse = nil + } else { + return nil // data stored in dst.ErrorResponse, return on the first match + } + } else { + dst.ErrorResponse = nil + } + + // try to unmarshal JSON data into PutItemResponseError + err = json.Unmarshal(data, &dst.PutItemResponseError); + if err == nil { + jsonPutItemResponseError, _ := json.Marshal(dst.PutItemResponseError) + if string(jsonPutItemResponseError) == "{}" { // empty struct + dst.PutItemResponseError = nil + } else { + return nil // data stored in dst.PutItemResponseError, return on the first match + } + } else { + dst.PutItemResponseError = nil + } + + return fmt.Errorf("data failed to match schemas in anyOf(ActRunsLastDatasetItemsPost400Response)") +} + +// Marshal data from the first non-nil pointers in the struct to JSON +func (src ActRunsLastDatasetItemsPost400Response) MarshalJSON() ([]byte, error) { + if src.ErrorResponse != nil { + return json.Marshal(&src.ErrorResponse) + } + + if src.PutItemResponseError != nil { + return json.Marshal(&src.PutItemResponseError) + } + + return nil, nil // no data in anyOf schemas +} + + +type NullableActRunsLastDatasetItemsPost400Response struct { + value *ActRunsLastDatasetItemsPost400Response + isSet bool +} + +func (v NullableActRunsLastDatasetItemsPost400Response) Get() *ActRunsLastDatasetItemsPost400Response { + return v.value +} + +func (v *NullableActRunsLastDatasetItemsPost400Response) Set(val *ActRunsLastDatasetItemsPost400Response) { + v.value = val + v.isSet = true +} + +func (v NullableActRunsLastDatasetItemsPost400Response) IsSet() bool { + return v.isSet +} + +func (v *NullableActRunsLastDatasetItemsPost400Response) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableActRunsLastDatasetItemsPost400Response(val *ActRunsLastDatasetItemsPost400Response) *NullableActRunsLastDatasetItemsPost400Response { + return &NullableActRunsLastDatasetItemsPost400Response{value: val, isSet: true} +} + +func (v NullableActRunsLastDatasetItemsPost400Response) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableActRunsLastDatasetItemsPost400Response) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_act_runs_last_dataset_items_post_request.go b/model_act_runs_last_dataset_items_post_request.go new file mode 100644 index 0000000..cbfbe14 --- /dev/null +++ b/model_act_runs_last_dataset_items_post_request.go @@ -0,0 +1,171 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" + "fmt" + "gopkg.in/validator.v2" +) + +// ActRunsLastDatasetItemsPostRequest - +type ActRunsLastDatasetItemsPostRequest struct { + ArrayOfMapmapOfStringAny *[]map[string]interface{} + MapmapOfStringAny *map[string]interface{} +} + +// []map[string]interface{}AsActRunsLastDatasetItemsPostRequest is a convenience function that returns []map[string]interface{} wrapped in ActRunsLastDatasetItemsPostRequest +func ArrayOfMapmapOfStringAnyAsActRunsLastDatasetItemsPostRequest(v *[]map[string]interface{}) ActRunsLastDatasetItemsPostRequest { + return ActRunsLastDatasetItemsPostRequest{ + ArrayOfMapmapOfStringAny: v, + } +} + +// map[string]interface{}AsActRunsLastDatasetItemsPostRequest is a convenience function that returns map[string]interface{} wrapped in ActRunsLastDatasetItemsPostRequest +func MapmapOfStringAnyAsActRunsLastDatasetItemsPostRequest(v *map[string]interface{}) ActRunsLastDatasetItemsPostRequest { + return ActRunsLastDatasetItemsPostRequest{ + MapmapOfStringAny: v, + } +} + + +// Unmarshal JSON data into one of the pointers in the struct +func (dst *ActRunsLastDatasetItemsPostRequest) UnmarshalJSON(data []byte) error { + var err error + match := 0 + // try to unmarshal data into ArrayOfMapmapOfStringAny + err = newStrictDecoder(data).Decode(&dst.ArrayOfMapmapOfStringAny) + if err == nil { + jsonArrayOfMapmapOfStringAny, _ := json.Marshal(dst.ArrayOfMapmapOfStringAny) + if string(jsonArrayOfMapmapOfStringAny) == "{}" { // empty struct + dst.ArrayOfMapmapOfStringAny = nil + } else { + if err = validator.Validate(dst.ArrayOfMapmapOfStringAny); err != nil { + dst.ArrayOfMapmapOfStringAny = nil + } else { + match++ + } + } + } else { + dst.ArrayOfMapmapOfStringAny = nil + } + + // try to unmarshal data into MapmapOfStringAny + err = newStrictDecoder(data).Decode(&dst.MapmapOfStringAny) + if err == nil { + jsonMapmapOfStringAny, _ := json.Marshal(dst.MapmapOfStringAny) + if string(jsonMapmapOfStringAny) == "{}" { // empty struct + dst.MapmapOfStringAny = nil + } else { + if err = validator.Validate(dst.MapmapOfStringAny); err != nil { + dst.MapmapOfStringAny = nil + } else { + match++ + } + } + } else { + dst.MapmapOfStringAny = nil + } + + if match > 1 { // more than 1 match + // reset to nil + dst.ArrayOfMapmapOfStringAny = nil + dst.MapmapOfStringAny = nil + + return fmt.Errorf("data matches more than one schema in oneOf(ActRunsLastDatasetItemsPostRequest)") + } else if match == 1 { + return nil // exactly one match + } else { // no match + return fmt.Errorf("data failed to match schemas in oneOf(ActRunsLastDatasetItemsPostRequest)") + } +} + +// Marshal data from the first non-nil pointers in the struct to JSON +func (src ActRunsLastDatasetItemsPostRequest) MarshalJSON() ([]byte, error) { + if src.ArrayOfMapmapOfStringAny != nil { + return json.Marshal(&src.ArrayOfMapmapOfStringAny) + } + + if src.MapmapOfStringAny != nil { + return json.Marshal(&src.MapmapOfStringAny) + } + + return nil, nil // no data in oneOf schemas +} + +// Get the actual instance +func (obj *ActRunsLastDatasetItemsPostRequest) GetActualInstance() (interface{}) { + if obj == nil { + return nil + } + if obj.ArrayOfMapmapOfStringAny != nil { + return obj.ArrayOfMapmapOfStringAny + } + + if obj.MapmapOfStringAny != nil { + return obj.MapmapOfStringAny + } + + // all schemas are nil + return nil +} + +// Get the actual instance value +func (obj ActRunsLastDatasetItemsPostRequest) GetActualInstanceValue() (interface{}) { + if obj.ArrayOfMapmapOfStringAny != nil { + return *obj.ArrayOfMapmapOfStringAny + } + + if obj.MapmapOfStringAny != nil { + return *obj.MapmapOfStringAny + } + + // all schemas are nil + return nil +} + +type NullableActRunsLastDatasetItemsPostRequest struct { + value *ActRunsLastDatasetItemsPostRequest + isSet bool +} + +func (v NullableActRunsLastDatasetItemsPostRequest) Get() *ActRunsLastDatasetItemsPostRequest { + return v.value +} + +func (v *NullableActRunsLastDatasetItemsPostRequest) Set(val *ActRunsLastDatasetItemsPostRequest) { + v.value = val + v.isSet = true +} + +func (v NullableActRunsLastDatasetItemsPostRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableActRunsLastDatasetItemsPostRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableActRunsLastDatasetItemsPostRequest(val *ActRunsLastDatasetItemsPostRequest) *NullableActRunsLastDatasetItemsPostRequest { + return &NullableActRunsLastDatasetItemsPostRequest{value: val, isSet: true} +} + +func (v NullableActRunsLastDatasetItemsPostRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableActRunsLastDatasetItemsPostRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_act_validate_input_post_200_response.go b/model_act_validate_input_post_200_response.go new file mode 100644 index 0000000..bc3e75e --- /dev/null +++ b/model_act_validate_input_post_200_response.go @@ -0,0 +1,159 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" + "bytes" + "fmt" +) + +// checks if the ActValidateInputPost200Response type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ActValidateInputPost200Response{} + +// ActValidateInputPost200Response struct for ActValidateInputPost200Response +type ActValidateInputPost200Response struct { + // Whether the input is valid according to the Actor's input schema. + Valid bool `json:"valid"` +} + +type _ActValidateInputPost200Response ActValidateInputPost200Response + +// NewActValidateInputPost200Response instantiates a new ActValidateInputPost200Response object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewActValidateInputPost200Response(valid bool) *ActValidateInputPost200Response { + this := ActValidateInputPost200Response{} + this.Valid = valid + return &this +} + +// NewActValidateInputPost200ResponseWithDefaults instantiates a new ActValidateInputPost200Response object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewActValidateInputPost200ResponseWithDefaults() *ActValidateInputPost200Response { + this := ActValidateInputPost200Response{} + return &this +} + +// GetValid returns the Valid field value +func (o *ActValidateInputPost200Response) GetValid() bool { + if o == nil { + var ret bool + return ret + } + + return o.Valid +} + +// GetValidOk returns a tuple with the Valid field value +// and a boolean to check if the value has been set. +func (o *ActValidateInputPost200Response) GetValidOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.Valid, true +} + +// SetValid sets field value +func (o *ActValidateInputPost200Response) SetValid(v bool) { + o.Valid = v +} + +func (o ActValidateInputPost200Response) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ActValidateInputPost200Response) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["valid"] = o.Valid + return toSerialize, nil +} + +func (o *ActValidateInputPost200Response) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "valid", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varActValidateInputPost200Response := _ActValidateInputPost200Response{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varActValidateInputPost200Response) + + if err != nil { + return err + } + + *o = ActValidateInputPost200Response(varActValidateInputPost200Response) + + return err +} + +type NullableActValidateInputPost200Response struct { + value *ActValidateInputPost200Response + isSet bool +} + +func (v NullableActValidateInputPost200Response) Get() *ActValidateInputPost200Response { + return v.value +} + +func (v *NullableActValidateInputPost200Response) Set(val *ActValidateInputPost200Response) { + v.value = val + v.isSet = true +} + +func (v NullableActValidateInputPost200Response) IsSet() bool { + return v.isSet +} + +func (v *NullableActValidateInputPost200Response) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableActValidateInputPost200Response(val *ActValidateInputPost200Response) *NullableActValidateInputPost200Response { + return &NullableActValidateInputPost200Response{value: val, isSet: true} +} + +func (v NullableActValidateInputPost200Response) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableActValidateInputPost200Response) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_actor.go b/model_actor.go new file mode 100644 index 0000000..0ed1086 --- /dev/null +++ b/model_actor.go @@ -0,0 +1,1265 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" + "time" + "bytes" + "fmt" +) + +// checks if the Actor type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Actor{} + +// Actor struct for Actor +type Actor struct { + Id string `json:"id"` + UserId string `json:"userId"` + Name string `json:"name"` + Username string `json:"username"` + Description NullableString `json:"description,omitempty"` + // Deprecated + RestartOnError *bool `json:"restartOnError,omitempty"` + IsPublic bool `json:"isPublic"` + ActorPermissionLevel *ActorPermissionLevel `json:"actorPermissionLevel,omitempty"` + CreatedAt time.Time `json:"createdAt"` + ModifiedAt time.Time `json:"modifiedAt"` + Stats ActorStats `json:"stats"` + // + Versions []Version `json:"versions"` + PricingInfos []ActorRunPricingInfo `json:"pricingInfos,omitempty"` + DefaultRunOptions DefaultRunOptions `json:"defaultRunOptions"` + ExampleRunInput NullableExampleRunInput `json:"exampleRunInput,omitempty"` + IsDeprecated NullableBool `json:"isDeprecated,omitempty"` + DeploymentKey *string `json:"deploymentKey,omitempty"` + Title NullableString `json:"title,omitempty"` + // A dictionary mapping build tag names (e.g., \"latest\", \"beta\") to their build information. + TaggedBuilds map[string]TaggedBuildsValue `json:"taggedBuilds,omitempty"` + ActorStandby NullableActorStandby `json:"actorStandby,omitempty"` + // A brief, LLM-generated readme summary + ReadmeSummary *string `json:"readmeSummary,omitempty"` + SeoTitle NullableString `json:"seoTitle,omitempty"` + SeoDescription NullableString `json:"seoDescription,omitempty"` + PictureUrl NullableString `json:"pictureUrl,omitempty"` + StandbyUrl NullableString `json:"standbyUrl,omitempty"` + Notice *string `json:"notice,omitempty"` + Categories []string `json:"categories,omitempty"` + IsCritical *bool `json:"isCritical,omitempty"` + IsGeneric *bool `json:"isGeneric,omitempty"` + IsSourceCodeHidden *bool `json:"isSourceCodeHidden,omitempty"` + HasNoDataset *bool `json:"hasNoDataset,omitempty"` +} + +type _Actor Actor + +// NewActor instantiates a new Actor object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewActor(id string, userId string, name string, username string, isPublic bool, createdAt time.Time, modifiedAt time.Time, stats ActorStats, versions []Version, defaultRunOptions DefaultRunOptions) *Actor { + this := Actor{} + this.Id = id + this.UserId = userId + this.Name = name + this.Username = username + this.IsPublic = isPublic + this.CreatedAt = createdAt + this.ModifiedAt = modifiedAt + this.Stats = stats + this.Versions = versions + this.DefaultRunOptions = defaultRunOptions + return &this +} + +// NewActorWithDefaults instantiates a new Actor object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewActorWithDefaults() *Actor { + this := Actor{} + return &this +} + +// GetId returns the Id field value +func (o *Actor) GetId() string { + if o == nil { + var ret string + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *Actor) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *Actor) SetId(v string) { + o.Id = v +} + +// GetUserId returns the UserId field value +func (o *Actor) GetUserId() string { + if o == nil { + var ret string + return ret + } + + return o.UserId +} + +// GetUserIdOk returns a tuple with the UserId field value +// and a boolean to check if the value has been set. +func (o *Actor) GetUserIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.UserId, true +} + +// SetUserId sets field value +func (o *Actor) SetUserId(v string) { + o.UserId = v +} + +// GetName returns the Name field value +func (o *Actor) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *Actor) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *Actor) SetName(v string) { + o.Name = v +} + +// GetUsername returns the Username field value +func (o *Actor) GetUsername() string { + if o == nil { + var ret string + return ret + } + + return o.Username +} + +// GetUsernameOk returns a tuple with the Username field value +// and a boolean to check if the value has been set. +func (o *Actor) GetUsernameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Username, true +} + +// SetUsername sets field value +func (o *Actor) SetUsername(v string) { + o.Username = v +} + +// GetDescription returns the Description field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Actor) GetDescription() string { + if o == nil || IsNil(o.Description.Get()) { + var ret string + return ret + } + return *o.Description.Get() +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Actor) GetDescriptionOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Description.Get(), o.Description.IsSet() +} + +// HasDescription returns a boolean if a field has been set. +func (o *Actor) HasDescription() bool { + if o != nil && o.Description.IsSet() { + return true + } + + return false +} + +// SetDescription gets a reference to the given NullableString and assigns it to the Description field. +func (o *Actor) SetDescription(v string) { + o.Description.Set(&v) +} +// SetDescriptionNil sets the value for Description to be an explicit nil +func (o *Actor) SetDescriptionNil() { + o.Description.Set(nil) +} + +// UnsetDescription ensures that no value is present for Description, not even an explicit nil +func (o *Actor) UnsetDescription() { + o.Description.Unset() +} + +// GetRestartOnError returns the RestartOnError field value if set, zero value otherwise. +// Deprecated +func (o *Actor) GetRestartOnError() bool { + if o == nil || IsNil(o.RestartOnError) { + var ret bool + return ret + } + return *o.RestartOnError +} + +// GetRestartOnErrorOk returns a tuple with the RestartOnError field value if set, nil otherwise +// and a boolean to check if the value has been set. +// Deprecated +func (o *Actor) GetRestartOnErrorOk() (*bool, bool) { + if o == nil || IsNil(o.RestartOnError) { + return nil, false + } + return o.RestartOnError, true +} + +// HasRestartOnError returns a boolean if a field has been set. +func (o *Actor) HasRestartOnError() bool { + if o != nil && !IsNil(o.RestartOnError) { + return true + } + + return false +} + +// SetRestartOnError gets a reference to the given bool and assigns it to the RestartOnError field. +// Deprecated +func (o *Actor) SetRestartOnError(v bool) { + o.RestartOnError = &v +} + +// GetIsPublic returns the IsPublic field value +func (o *Actor) GetIsPublic() bool { + if o == nil { + var ret bool + return ret + } + + return o.IsPublic +} + +// GetIsPublicOk returns a tuple with the IsPublic field value +// and a boolean to check if the value has been set. +func (o *Actor) GetIsPublicOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.IsPublic, true +} + +// SetIsPublic sets field value +func (o *Actor) SetIsPublic(v bool) { + o.IsPublic = v +} + +// GetActorPermissionLevel returns the ActorPermissionLevel field value if set, zero value otherwise. +func (o *Actor) GetActorPermissionLevel() ActorPermissionLevel { + if o == nil || IsNil(o.ActorPermissionLevel) { + var ret ActorPermissionLevel + return ret + } + return *o.ActorPermissionLevel +} + +// GetActorPermissionLevelOk returns a tuple with the ActorPermissionLevel field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Actor) GetActorPermissionLevelOk() (*ActorPermissionLevel, bool) { + if o == nil || IsNil(o.ActorPermissionLevel) { + return nil, false + } + return o.ActorPermissionLevel, true +} + +// HasActorPermissionLevel returns a boolean if a field has been set. +func (o *Actor) HasActorPermissionLevel() bool { + if o != nil && !IsNil(o.ActorPermissionLevel) { + return true + } + + return false +} + +// SetActorPermissionLevel gets a reference to the given ActorPermissionLevel and assigns it to the ActorPermissionLevel field. +func (o *Actor) SetActorPermissionLevel(v ActorPermissionLevel) { + o.ActorPermissionLevel = &v +} + +// GetCreatedAt returns the CreatedAt field value +func (o *Actor) GetCreatedAt() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value +// and a boolean to check if the value has been set. +func (o *Actor) GetCreatedAtOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.CreatedAt, true +} + +// SetCreatedAt sets field value +func (o *Actor) SetCreatedAt(v time.Time) { + o.CreatedAt = v +} + +// GetModifiedAt returns the ModifiedAt field value +func (o *Actor) GetModifiedAt() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.ModifiedAt +} + +// GetModifiedAtOk returns a tuple with the ModifiedAt field value +// and a boolean to check if the value has been set. +func (o *Actor) GetModifiedAtOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.ModifiedAt, true +} + +// SetModifiedAt sets field value +func (o *Actor) SetModifiedAt(v time.Time) { + o.ModifiedAt = v +} + +// GetStats returns the Stats field value +func (o *Actor) GetStats() ActorStats { + if o == nil { + var ret ActorStats + return ret + } + + return o.Stats +} + +// GetStatsOk returns a tuple with the Stats field value +// and a boolean to check if the value has been set. +func (o *Actor) GetStatsOk() (*ActorStats, bool) { + if o == nil { + return nil, false + } + return &o.Stats, true +} + +// SetStats sets field value +func (o *Actor) SetStats(v ActorStats) { + o.Stats = v +} + +// GetVersions returns the Versions field value +func (o *Actor) GetVersions() []Version { + if o == nil { + var ret []Version + return ret + } + + return o.Versions +} + +// GetVersionsOk returns a tuple with the Versions field value +// and a boolean to check if the value has been set. +func (o *Actor) GetVersionsOk() ([]Version, bool) { + if o == nil { + return nil, false + } + return o.Versions, true +} + +// SetVersions sets field value +func (o *Actor) SetVersions(v []Version) { + o.Versions = v +} + +// GetPricingInfos returns the PricingInfos field value if set, zero value otherwise. +func (o *Actor) GetPricingInfos() []ActorRunPricingInfo { + if o == nil || IsNil(o.PricingInfos) { + var ret []ActorRunPricingInfo + return ret + } + return o.PricingInfos +} + +// GetPricingInfosOk returns a tuple with the PricingInfos field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Actor) GetPricingInfosOk() ([]ActorRunPricingInfo, bool) { + if o == nil || IsNil(o.PricingInfos) { + return nil, false + } + return o.PricingInfos, true +} + +// HasPricingInfos returns a boolean if a field has been set. +func (o *Actor) HasPricingInfos() bool { + if o != nil && !IsNil(o.PricingInfos) { + return true + } + + return false +} + +// SetPricingInfos gets a reference to the given []ActorRunPricingInfo and assigns it to the PricingInfos field. +func (o *Actor) SetPricingInfos(v []ActorRunPricingInfo) { + o.PricingInfos = v +} + +// GetDefaultRunOptions returns the DefaultRunOptions field value +func (o *Actor) GetDefaultRunOptions() DefaultRunOptions { + if o == nil { + var ret DefaultRunOptions + return ret + } + + return o.DefaultRunOptions +} + +// GetDefaultRunOptionsOk returns a tuple with the DefaultRunOptions field value +// and a boolean to check if the value has been set. +func (o *Actor) GetDefaultRunOptionsOk() (*DefaultRunOptions, bool) { + if o == nil { + return nil, false + } + return &o.DefaultRunOptions, true +} + +// SetDefaultRunOptions sets field value +func (o *Actor) SetDefaultRunOptions(v DefaultRunOptions) { + o.DefaultRunOptions = v +} + +// GetExampleRunInput returns the ExampleRunInput field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Actor) GetExampleRunInput() ExampleRunInput { + if o == nil || IsNil(o.ExampleRunInput.Get()) { + var ret ExampleRunInput + return ret + } + return *o.ExampleRunInput.Get() +} + +// GetExampleRunInputOk returns a tuple with the ExampleRunInput field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Actor) GetExampleRunInputOk() (*ExampleRunInput, bool) { + if o == nil { + return nil, false + } + return o.ExampleRunInput.Get(), o.ExampleRunInput.IsSet() +} + +// HasExampleRunInput returns a boolean if a field has been set. +func (o *Actor) HasExampleRunInput() bool { + if o != nil && o.ExampleRunInput.IsSet() { + return true + } + + return false +} + +// SetExampleRunInput gets a reference to the given NullableExampleRunInput and assigns it to the ExampleRunInput field. +func (o *Actor) SetExampleRunInput(v ExampleRunInput) { + o.ExampleRunInput.Set(&v) +} +// SetExampleRunInputNil sets the value for ExampleRunInput to be an explicit nil +func (o *Actor) SetExampleRunInputNil() { + o.ExampleRunInput.Set(nil) +} + +// UnsetExampleRunInput ensures that no value is present for ExampleRunInput, not even an explicit nil +func (o *Actor) UnsetExampleRunInput() { + o.ExampleRunInput.Unset() +} + +// GetIsDeprecated returns the IsDeprecated field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Actor) GetIsDeprecated() bool { + if o == nil || IsNil(o.IsDeprecated.Get()) { + var ret bool + return ret + } + return *o.IsDeprecated.Get() +} + +// GetIsDeprecatedOk returns a tuple with the IsDeprecated field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Actor) GetIsDeprecatedOk() (*bool, bool) { + if o == nil { + return nil, false + } + return o.IsDeprecated.Get(), o.IsDeprecated.IsSet() +} + +// HasIsDeprecated returns a boolean if a field has been set. +func (o *Actor) HasIsDeprecated() bool { + if o != nil && o.IsDeprecated.IsSet() { + return true + } + + return false +} + +// SetIsDeprecated gets a reference to the given NullableBool and assigns it to the IsDeprecated field. +func (o *Actor) SetIsDeprecated(v bool) { + o.IsDeprecated.Set(&v) +} +// SetIsDeprecatedNil sets the value for IsDeprecated to be an explicit nil +func (o *Actor) SetIsDeprecatedNil() { + o.IsDeprecated.Set(nil) +} + +// UnsetIsDeprecated ensures that no value is present for IsDeprecated, not even an explicit nil +func (o *Actor) UnsetIsDeprecated() { + o.IsDeprecated.Unset() +} + +// GetDeploymentKey returns the DeploymentKey field value if set, zero value otherwise. +func (o *Actor) GetDeploymentKey() string { + if o == nil || IsNil(o.DeploymentKey) { + var ret string + return ret + } + return *o.DeploymentKey +} + +// GetDeploymentKeyOk returns a tuple with the DeploymentKey field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Actor) GetDeploymentKeyOk() (*string, bool) { + if o == nil || IsNil(o.DeploymentKey) { + return nil, false + } + return o.DeploymentKey, true +} + +// HasDeploymentKey returns a boolean if a field has been set. +func (o *Actor) HasDeploymentKey() bool { + if o != nil && !IsNil(o.DeploymentKey) { + return true + } + + return false +} + +// SetDeploymentKey gets a reference to the given string and assigns it to the DeploymentKey field. +func (o *Actor) SetDeploymentKey(v string) { + o.DeploymentKey = &v +} + +// GetTitle returns the Title field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Actor) GetTitle() string { + if o == nil || IsNil(o.Title.Get()) { + var ret string + return ret + } + return *o.Title.Get() +} + +// GetTitleOk returns a tuple with the Title field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Actor) GetTitleOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Title.Get(), o.Title.IsSet() +} + +// HasTitle returns a boolean if a field has been set. +func (o *Actor) HasTitle() bool { + if o != nil && o.Title.IsSet() { + return true + } + + return false +} + +// SetTitle gets a reference to the given NullableString and assigns it to the Title field. +func (o *Actor) SetTitle(v string) { + o.Title.Set(&v) +} +// SetTitleNil sets the value for Title to be an explicit nil +func (o *Actor) SetTitleNil() { + o.Title.Set(nil) +} + +// UnsetTitle ensures that no value is present for Title, not even an explicit nil +func (o *Actor) UnsetTitle() { + o.Title.Unset() +} + +// GetTaggedBuilds returns the TaggedBuilds field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Actor) GetTaggedBuilds() map[string]TaggedBuildsValue { + if o == nil { + var ret map[string]TaggedBuildsValue + return ret + } + return o.TaggedBuilds +} + +// GetTaggedBuildsOk returns a tuple with the TaggedBuilds field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Actor) GetTaggedBuildsOk() (map[string]TaggedBuildsValue, bool) { + if o == nil || IsNil(o.TaggedBuilds) { + return map[string]TaggedBuildsValue{}, false + } + return o.TaggedBuilds, true +} + +// HasTaggedBuilds returns a boolean if a field has been set. +func (o *Actor) HasTaggedBuilds() bool { + if o != nil && !IsNil(o.TaggedBuilds) { + return true + } + + return false +} + +// SetTaggedBuilds gets a reference to the given map[string]TaggedBuildsValue and assigns it to the TaggedBuilds field. +func (o *Actor) SetTaggedBuilds(v map[string]TaggedBuildsValue) { + o.TaggedBuilds = v +} + +// GetActorStandby returns the ActorStandby field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Actor) GetActorStandby() ActorStandby { + if o == nil || IsNil(o.ActorStandby.Get()) { + var ret ActorStandby + return ret + } + return *o.ActorStandby.Get() +} + +// GetActorStandbyOk returns a tuple with the ActorStandby field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Actor) GetActorStandbyOk() (*ActorStandby, bool) { + if o == nil { + return nil, false + } + return o.ActorStandby.Get(), o.ActorStandby.IsSet() +} + +// HasActorStandby returns a boolean if a field has been set. +func (o *Actor) HasActorStandby() bool { + if o != nil && o.ActorStandby.IsSet() { + return true + } + + return false +} + +// SetActorStandby gets a reference to the given NullableActorStandby and assigns it to the ActorStandby field. +func (o *Actor) SetActorStandby(v ActorStandby) { + o.ActorStandby.Set(&v) +} +// SetActorStandbyNil sets the value for ActorStandby to be an explicit nil +func (o *Actor) SetActorStandbyNil() { + o.ActorStandby.Set(nil) +} + +// UnsetActorStandby ensures that no value is present for ActorStandby, not even an explicit nil +func (o *Actor) UnsetActorStandby() { + o.ActorStandby.Unset() +} + +// GetReadmeSummary returns the ReadmeSummary field value if set, zero value otherwise. +func (o *Actor) GetReadmeSummary() string { + if o == nil || IsNil(o.ReadmeSummary) { + var ret string + return ret + } + return *o.ReadmeSummary +} + +// GetReadmeSummaryOk returns a tuple with the ReadmeSummary field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Actor) GetReadmeSummaryOk() (*string, bool) { + if o == nil || IsNil(o.ReadmeSummary) { + return nil, false + } + return o.ReadmeSummary, true +} + +// HasReadmeSummary returns a boolean if a field has been set. +func (o *Actor) HasReadmeSummary() bool { + if o != nil && !IsNil(o.ReadmeSummary) { + return true + } + + return false +} + +// SetReadmeSummary gets a reference to the given string and assigns it to the ReadmeSummary field. +func (o *Actor) SetReadmeSummary(v string) { + o.ReadmeSummary = &v +} + +// GetSeoTitle returns the SeoTitle field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Actor) GetSeoTitle() string { + if o == nil || IsNil(o.SeoTitle.Get()) { + var ret string + return ret + } + return *o.SeoTitle.Get() +} + +// GetSeoTitleOk returns a tuple with the SeoTitle field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Actor) GetSeoTitleOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.SeoTitle.Get(), o.SeoTitle.IsSet() +} + +// HasSeoTitle returns a boolean if a field has been set. +func (o *Actor) HasSeoTitle() bool { + if o != nil && o.SeoTitle.IsSet() { + return true + } + + return false +} + +// SetSeoTitle gets a reference to the given NullableString and assigns it to the SeoTitle field. +func (o *Actor) SetSeoTitle(v string) { + o.SeoTitle.Set(&v) +} +// SetSeoTitleNil sets the value for SeoTitle to be an explicit nil +func (o *Actor) SetSeoTitleNil() { + o.SeoTitle.Set(nil) +} + +// UnsetSeoTitle ensures that no value is present for SeoTitle, not even an explicit nil +func (o *Actor) UnsetSeoTitle() { + o.SeoTitle.Unset() +} + +// GetSeoDescription returns the SeoDescription field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Actor) GetSeoDescription() string { + if o == nil || IsNil(o.SeoDescription.Get()) { + var ret string + return ret + } + return *o.SeoDescription.Get() +} + +// GetSeoDescriptionOk returns a tuple with the SeoDescription field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Actor) GetSeoDescriptionOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.SeoDescription.Get(), o.SeoDescription.IsSet() +} + +// HasSeoDescription returns a boolean if a field has been set. +func (o *Actor) HasSeoDescription() bool { + if o != nil && o.SeoDescription.IsSet() { + return true + } + + return false +} + +// SetSeoDescription gets a reference to the given NullableString and assigns it to the SeoDescription field. +func (o *Actor) SetSeoDescription(v string) { + o.SeoDescription.Set(&v) +} +// SetSeoDescriptionNil sets the value for SeoDescription to be an explicit nil +func (o *Actor) SetSeoDescriptionNil() { + o.SeoDescription.Set(nil) +} + +// UnsetSeoDescription ensures that no value is present for SeoDescription, not even an explicit nil +func (o *Actor) UnsetSeoDescription() { + o.SeoDescription.Unset() +} + +// GetPictureUrl returns the PictureUrl field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Actor) GetPictureUrl() string { + if o == nil || IsNil(o.PictureUrl.Get()) { + var ret string + return ret + } + return *o.PictureUrl.Get() +} + +// GetPictureUrlOk returns a tuple with the PictureUrl field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Actor) GetPictureUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.PictureUrl.Get(), o.PictureUrl.IsSet() +} + +// HasPictureUrl returns a boolean if a field has been set. +func (o *Actor) HasPictureUrl() bool { + if o != nil && o.PictureUrl.IsSet() { + return true + } + + return false +} + +// SetPictureUrl gets a reference to the given NullableString and assigns it to the PictureUrl field. +func (o *Actor) SetPictureUrl(v string) { + o.PictureUrl.Set(&v) +} +// SetPictureUrlNil sets the value for PictureUrl to be an explicit nil +func (o *Actor) SetPictureUrlNil() { + o.PictureUrl.Set(nil) +} + +// UnsetPictureUrl ensures that no value is present for PictureUrl, not even an explicit nil +func (o *Actor) UnsetPictureUrl() { + o.PictureUrl.Unset() +} + +// GetStandbyUrl returns the StandbyUrl field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Actor) GetStandbyUrl() string { + if o == nil || IsNil(o.StandbyUrl.Get()) { + var ret string + return ret + } + return *o.StandbyUrl.Get() +} + +// GetStandbyUrlOk returns a tuple with the StandbyUrl field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Actor) GetStandbyUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.StandbyUrl.Get(), o.StandbyUrl.IsSet() +} + +// HasStandbyUrl returns a boolean if a field has been set. +func (o *Actor) HasStandbyUrl() bool { + if o != nil && o.StandbyUrl.IsSet() { + return true + } + + return false +} + +// SetStandbyUrl gets a reference to the given NullableString and assigns it to the StandbyUrl field. +func (o *Actor) SetStandbyUrl(v string) { + o.StandbyUrl.Set(&v) +} +// SetStandbyUrlNil sets the value for StandbyUrl to be an explicit nil +func (o *Actor) SetStandbyUrlNil() { + o.StandbyUrl.Set(nil) +} + +// UnsetStandbyUrl ensures that no value is present for StandbyUrl, not even an explicit nil +func (o *Actor) UnsetStandbyUrl() { + o.StandbyUrl.Unset() +} + +// GetNotice returns the Notice field value if set, zero value otherwise. +func (o *Actor) GetNotice() string { + if o == nil || IsNil(o.Notice) { + var ret string + return ret + } + return *o.Notice +} + +// GetNoticeOk returns a tuple with the Notice field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Actor) GetNoticeOk() (*string, bool) { + if o == nil || IsNil(o.Notice) { + return nil, false + } + return o.Notice, true +} + +// HasNotice returns a boolean if a field has been set. +func (o *Actor) HasNotice() bool { + if o != nil && !IsNil(o.Notice) { + return true + } + + return false +} + +// SetNotice gets a reference to the given string and assigns it to the Notice field. +func (o *Actor) SetNotice(v string) { + o.Notice = &v +} + +// GetCategories returns the Categories field value if set, zero value otherwise. +func (o *Actor) GetCategories() []string { + if o == nil || IsNil(o.Categories) { + var ret []string + return ret + } + return o.Categories +} + +// GetCategoriesOk returns a tuple with the Categories field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Actor) GetCategoriesOk() ([]string, bool) { + if o == nil || IsNil(o.Categories) { + return nil, false + } + return o.Categories, true +} + +// HasCategories returns a boolean if a field has been set. +func (o *Actor) HasCategories() bool { + if o != nil && !IsNil(o.Categories) { + return true + } + + return false +} + +// SetCategories gets a reference to the given []string and assigns it to the Categories field. +func (o *Actor) SetCategories(v []string) { + o.Categories = v +} + +// GetIsCritical returns the IsCritical field value if set, zero value otherwise. +func (o *Actor) GetIsCritical() bool { + if o == nil || IsNil(o.IsCritical) { + var ret bool + return ret + } + return *o.IsCritical +} + +// GetIsCriticalOk returns a tuple with the IsCritical field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Actor) GetIsCriticalOk() (*bool, bool) { + if o == nil || IsNil(o.IsCritical) { + return nil, false + } + return o.IsCritical, true +} + +// HasIsCritical returns a boolean if a field has been set. +func (o *Actor) HasIsCritical() bool { + if o != nil && !IsNil(o.IsCritical) { + return true + } + + return false +} + +// SetIsCritical gets a reference to the given bool and assigns it to the IsCritical field. +func (o *Actor) SetIsCritical(v bool) { + o.IsCritical = &v +} + +// GetIsGeneric returns the IsGeneric field value if set, zero value otherwise. +func (o *Actor) GetIsGeneric() bool { + if o == nil || IsNil(o.IsGeneric) { + var ret bool + return ret + } + return *o.IsGeneric +} + +// GetIsGenericOk returns a tuple with the IsGeneric field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Actor) GetIsGenericOk() (*bool, bool) { + if o == nil || IsNil(o.IsGeneric) { + return nil, false + } + return o.IsGeneric, true +} + +// HasIsGeneric returns a boolean if a field has been set. +func (o *Actor) HasIsGeneric() bool { + if o != nil && !IsNil(o.IsGeneric) { + return true + } + + return false +} + +// SetIsGeneric gets a reference to the given bool and assigns it to the IsGeneric field. +func (o *Actor) SetIsGeneric(v bool) { + o.IsGeneric = &v +} + +// GetIsSourceCodeHidden returns the IsSourceCodeHidden field value if set, zero value otherwise. +func (o *Actor) GetIsSourceCodeHidden() bool { + if o == nil || IsNil(o.IsSourceCodeHidden) { + var ret bool + return ret + } + return *o.IsSourceCodeHidden +} + +// GetIsSourceCodeHiddenOk returns a tuple with the IsSourceCodeHidden field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Actor) GetIsSourceCodeHiddenOk() (*bool, bool) { + if o == nil || IsNil(o.IsSourceCodeHidden) { + return nil, false + } + return o.IsSourceCodeHidden, true +} + +// HasIsSourceCodeHidden returns a boolean if a field has been set. +func (o *Actor) HasIsSourceCodeHidden() bool { + if o != nil && !IsNil(o.IsSourceCodeHidden) { + return true + } + + return false +} + +// SetIsSourceCodeHidden gets a reference to the given bool and assigns it to the IsSourceCodeHidden field. +func (o *Actor) SetIsSourceCodeHidden(v bool) { + o.IsSourceCodeHidden = &v +} + +// GetHasNoDataset returns the HasNoDataset field value if set, zero value otherwise. +func (o *Actor) GetHasNoDataset() bool { + if o == nil || IsNil(o.HasNoDataset) { + var ret bool + return ret + } + return *o.HasNoDataset +} + +// GetHasNoDatasetOk returns a tuple with the HasNoDataset field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Actor) GetHasNoDatasetOk() (*bool, bool) { + if o == nil || IsNil(o.HasNoDataset) { + return nil, false + } + return o.HasNoDataset, true +} + +// HasHasNoDataset returns a boolean if a field has been set. +func (o *Actor) HasHasNoDataset() bool { + if o != nil && !IsNil(o.HasNoDataset) { + return true + } + + return false +} + +// SetHasNoDataset gets a reference to the given bool and assigns it to the HasNoDataset field. +func (o *Actor) SetHasNoDataset(v bool) { + o.HasNoDataset = &v +} + +func (o Actor) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Actor) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["userId"] = o.UserId + toSerialize["name"] = o.Name + toSerialize["username"] = o.Username + if o.Description.IsSet() { + toSerialize["description"] = o.Description.Get() + } + if !IsNil(o.RestartOnError) { + toSerialize["restartOnError"] = o.RestartOnError + } + toSerialize["isPublic"] = o.IsPublic + if !IsNil(o.ActorPermissionLevel) { + toSerialize["actorPermissionLevel"] = o.ActorPermissionLevel + } + toSerialize["createdAt"] = o.CreatedAt + toSerialize["modifiedAt"] = o.ModifiedAt + toSerialize["stats"] = o.Stats + toSerialize["versions"] = o.Versions + if !IsNil(o.PricingInfos) { + toSerialize["pricingInfos"] = o.PricingInfos + } + toSerialize["defaultRunOptions"] = o.DefaultRunOptions + if o.ExampleRunInput.IsSet() { + toSerialize["exampleRunInput"] = o.ExampleRunInput.Get() + } + if o.IsDeprecated.IsSet() { + toSerialize["isDeprecated"] = o.IsDeprecated.Get() + } + if !IsNil(o.DeploymentKey) { + toSerialize["deploymentKey"] = o.DeploymentKey + } + if o.Title.IsSet() { + toSerialize["title"] = o.Title.Get() + } + if o.TaggedBuilds != nil { + toSerialize["taggedBuilds"] = o.TaggedBuilds + } + if o.ActorStandby.IsSet() { + toSerialize["actorStandby"] = o.ActorStandby.Get() + } + if !IsNil(o.ReadmeSummary) { + toSerialize["readmeSummary"] = o.ReadmeSummary + } + if o.SeoTitle.IsSet() { + toSerialize["seoTitle"] = o.SeoTitle.Get() + } + if o.SeoDescription.IsSet() { + toSerialize["seoDescription"] = o.SeoDescription.Get() + } + if o.PictureUrl.IsSet() { + toSerialize["pictureUrl"] = o.PictureUrl.Get() + } + if o.StandbyUrl.IsSet() { + toSerialize["standbyUrl"] = o.StandbyUrl.Get() + } + if !IsNil(o.Notice) { + toSerialize["notice"] = o.Notice + } + if !IsNil(o.Categories) { + toSerialize["categories"] = o.Categories + } + if !IsNil(o.IsCritical) { + toSerialize["isCritical"] = o.IsCritical + } + if !IsNil(o.IsGeneric) { + toSerialize["isGeneric"] = o.IsGeneric + } + if !IsNil(o.IsSourceCodeHidden) { + toSerialize["isSourceCodeHidden"] = o.IsSourceCodeHidden + } + if !IsNil(o.HasNoDataset) { + toSerialize["hasNoDataset"] = o.HasNoDataset + } + return toSerialize, nil +} + +func (o *Actor) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "userId", + "name", + "username", + "isPublic", + "createdAt", + "modifiedAt", + "stats", + "versions", + "defaultRunOptions", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varActor := _Actor{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varActor) + + if err != nil { + return err + } + + *o = Actor(varActor) + + return err +} + +type NullableActor struct { + value *Actor + isSet bool +} + +func (v NullableActor) Get() *Actor { + return v.value +} + +func (v *NullableActor) Set(val *Actor) { + v.value = val + v.isSet = true +} + +func (v NullableActor) IsSet() bool { + return v.isSet +} + +func (v *NullableActor) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableActor(val *Actor) *NullableActor { + return &NullableActor{value: val, isSet: true} +} + +func (v NullableActor) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableActor) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_actor_charge_event.go b/model_actor_charge_event.go new file mode 100644 index 0000000..7daa860 --- /dev/null +++ b/model_actor_charge_event.go @@ -0,0 +1,336 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" + "bytes" + "fmt" +) + +// checks if the ActorChargeEvent type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ActorChargeEvent{} + +// ActorChargeEvent Definition of a single chargeable event for a pay-per-event Actor. Each event is either flat-priced (`eventPriceUsd` is set) or tier-priced (`eventTieredPricingUsd` is set); the two are mutually exclusive. +type ActorChargeEvent struct { + // Human-readable title shown to users in the billing UI. + EventTitle string `json:"eventTitle"` + // Human-readable description of what triggers this event. + EventDescription string `json:"eventDescription"` + // Flat price per event in USD. Present only for non-tiered events. Mutually exclusive with `eventTieredPricingUsd`. + EventPriceUsd *float32 `json:"eventPriceUsd,omitempty"` + // Tiered price-per-event pricing for a single charge event, keyed by subscription tier (e.g. `FREE`, `BRONZE`, `SILVER`, `GOLD`, `PLATINUM`, `DIAMOND`). The actual price applied is resolved from the user's tier. + EventTieredPricingUsd map[string]TieredPricingPerEventEntry `json:"eventTieredPricingUsd,omitempty"` + // Whether this event is the Actor's primary chargeable event. + IsPrimaryEvent *bool `json:"isPrimaryEvent,omitempty"` + // Whether this event can only be charged once per Actor run. + IsOneTimeEvent *bool `json:"isOneTimeEvent,omitempty"` +} + +type _ActorChargeEvent ActorChargeEvent + +// NewActorChargeEvent instantiates a new ActorChargeEvent object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewActorChargeEvent(eventTitle string, eventDescription string) *ActorChargeEvent { + this := ActorChargeEvent{} + this.EventTitle = eventTitle + this.EventDescription = eventDescription + return &this +} + +// NewActorChargeEventWithDefaults instantiates a new ActorChargeEvent object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewActorChargeEventWithDefaults() *ActorChargeEvent { + this := ActorChargeEvent{} + return &this +} + +// GetEventTitle returns the EventTitle field value +func (o *ActorChargeEvent) GetEventTitle() string { + if o == nil { + var ret string + return ret + } + + return o.EventTitle +} + +// GetEventTitleOk returns a tuple with the EventTitle field value +// and a boolean to check if the value has been set. +func (o *ActorChargeEvent) GetEventTitleOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.EventTitle, true +} + +// SetEventTitle sets field value +func (o *ActorChargeEvent) SetEventTitle(v string) { + o.EventTitle = v +} + +// GetEventDescription returns the EventDescription field value +func (o *ActorChargeEvent) GetEventDescription() string { + if o == nil { + var ret string + return ret + } + + return o.EventDescription +} + +// GetEventDescriptionOk returns a tuple with the EventDescription field value +// and a boolean to check if the value has been set. +func (o *ActorChargeEvent) GetEventDescriptionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.EventDescription, true +} + +// SetEventDescription sets field value +func (o *ActorChargeEvent) SetEventDescription(v string) { + o.EventDescription = v +} + +// GetEventPriceUsd returns the EventPriceUsd field value if set, zero value otherwise. +func (o *ActorChargeEvent) GetEventPriceUsd() float32 { + if o == nil || IsNil(o.EventPriceUsd) { + var ret float32 + return ret + } + return *o.EventPriceUsd +} + +// GetEventPriceUsdOk returns a tuple with the EventPriceUsd field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ActorChargeEvent) GetEventPriceUsdOk() (*float32, bool) { + if o == nil || IsNil(o.EventPriceUsd) { + return nil, false + } + return o.EventPriceUsd, true +} + +// HasEventPriceUsd returns a boolean if a field has been set. +func (o *ActorChargeEvent) HasEventPriceUsd() bool { + if o != nil && !IsNil(o.EventPriceUsd) { + return true + } + + return false +} + +// SetEventPriceUsd gets a reference to the given float32 and assigns it to the EventPriceUsd field. +func (o *ActorChargeEvent) SetEventPriceUsd(v float32) { + o.EventPriceUsd = &v +} + +// GetEventTieredPricingUsd returns the EventTieredPricingUsd field value if set, zero value otherwise. +func (o *ActorChargeEvent) GetEventTieredPricingUsd() map[string]TieredPricingPerEventEntry { + if o == nil || IsNil(o.EventTieredPricingUsd) { + var ret map[string]TieredPricingPerEventEntry + return ret + } + return o.EventTieredPricingUsd +} + +// GetEventTieredPricingUsdOk returns a tuple with the EventTieredPricingUsd field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ActorChargeEvent) GetEventTieredPricingUsdOk() (map[string]TieredPricingPerEventEntry, bool) { + if o == nil || IsNil(o.EventTieredPricingUsd) { + return map[string]TieredPricingPerEventEntry{}, false + } + return o.EventTieredPricingUsd, true +} + +// HasEventTieredPricingUsd returns a boolean if a field has been set. +func (o *ActorChargeEvent) HasEventTieredPricingUsd() bool { + if o != nil && !IsNil(o.EventTieredPricingUsd) { + return true + } + + return false +} + +// SetEventTieredPricingUsd gets a reference to the given map[string]TieredPricingPerEventEntry and assigns it to the EventTieredPricingUsd field. +func (o *ActorChargeEvent) SetEventTieredPricingUsd(v map[string]TieredPricingPerEventEntry) { + o.EventTieredPricingUsd = v +} + +// GetIsPrimaryEvent returns the IsPrimaryEvent field value if set, zero value otherwise. +func (o *ActorChargeEvent) GetIsPrimaryEvent() bool { + if o == nil || IsNil(o.IsPrimaryEvent) { + var ret bool + return ret + } + return *o.IsPrimaryEvent +} + +// GetIsPrimaryEventOk returns a tuple with the IsPrimaryEvent field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ActorChargeEvent) GetIsPrimaryEventOk() (*bool, bool) { + if o == nil || IsNil(o.IsPrimaryEvent) { + return nil, false + } + return o.IsPrimaryEvent, true +} + +// HasIsPrimaryEvent returns a boolean if a field has been set. +func (o *ActorChargeEvent) HasIsPrimaryEvent() bool { + if o != nil && !IsNil(o.IsPrimaryEvent) { + return true + } + + return false +} + +// SetIsPrimaryEvent gets a reference to the given bool and assigns it to the IsPrimaryEvent field. +func (o *ActorChargeEvent) SetIsPrimaryEvent(v bool) { + o.IsPrimaryEvent = &v +} + +// GetIsOneTimeEvent returns the IsOneTimeEvent field value if set, zero value otherwise. +func (o *ActorChargeEvent) GetIsOneTimeEvent() bool { + if o == nil || IsNil(o.IsOneTimeEvent) { + var ret bool + return ret + } + return *o.IsOneTimeEvent +} + +// GetIsOneTimeEventOk returns a tuple with the IsOneTimeEvent field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ActorChargeEvent) GetIsOneTimeEventOk() (*bool, bool) { + if o == nil || IsNil(o.IsOneTimeEvent) { + return nil, false + } + return o.IsOneTimeEvent, true +} + +// HasIsOneTimeEvent returns a boolean if a field has been set. +func (o *ActorChargeEvent) HasIsOneTimeEvent() bool { + if o != nil && !IsNil(o.IsOneTimeEvent) { + return true + } + + return false +} + +// SetIsOneTimeEvent gets a reference to the given bool and assigns it to the IsOneTimeEvent field. +func (o *ActorChargeEvent) SetIsOneTimeEvent(v bool) { + o.IsOneTimeEvent = &v +} + +func (o ActorChargeEvent) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ActorChargeEvent) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["eventTitle"] = o.EventTitle + toSerialize["eventDescription"] = o.EventDescription + if !IsNil(o.EventPriceUsd) { + toSerialize["eventPriceUsd"] = o.EventPriceUsd + } + if !IsNil(o.EventTieredPricingUsd) { + toSerialize["eventTieredPricingUsd"] = o.EventTieredPricingUsd + } + if !IsNil(o.IsPrimaryEvent) { + toSerialize["isPrimaryEvent"] = o.IsPrimaryEvent + } + if !IsNil(o.IsOneTimeEvent) { + toSerialize["isOneTimeEvent"] = o.IsOneTimeEvent + } + return toSerialize, nil +} + +func (o *ActorChargeEvent) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "eventTitle", + "eventDescription", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varActorChargeEvent := _ActorChargeEvent{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varActorChargeEvent) + + if err != nil { + return err + } + + *o = ActorChargeEvent(varActorChargeEvent) + + return err +} + +type NullableActorChargeEvent struct { + value *ActorChargeEvent + isSet bool +} + +func (v NullableActorChargeEvent) Get() *ActorChargeEvent { + return v.value +} + +func (v *NullableActorChargeEvent) Set(val *ActorChargeEvent) { + v.value = val + v.isSet = true +} + +func (v NullableActorChargeEvent) IsSet() bool { + return v.isSet +} + +func (v *NullableActorChargeEvent) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableActorChargeEvent(val *ActorChargeEvent) *NullableActorChargeEvent { + return &NullableActorChargeEvent{value: val, isSet: true} +} + +func (v NullableActorChargeEvent) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableActorChargeEvent) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_actor_definition.go b/model_actor_definition.go new file mode 100644 index 0000000..54d293a --- /dev/null +++ b/model_actor_definition.go @@ -0,0 +1,643 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" +) + +// checks if the ActorDefinition type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ActorDefinition{} + +// ActorDefinition The definition of the Actor, the full specification of this field can be found in [Apify docs](https://docs.apify.com/platform/actors/development/actor-definition/actor-json) +type ActorDefinition struct { + // The Actor specification version that this Actor follows. This property must be set to 1. + ActorSpecification *int32 `json:"actorSpecification,omitempty"` + // The name of the Actor. + Name *string `json:"name,omitempty"` + // The version of the Actor, typically a dot-separated sequence of numbers (e.g., `0.1`, `1.0`, or `0.0.1`). + Version *string `json:"version,omitempty" validate:"regexp=^[0-9]+(\\\\.[0-9]+)+$"` + // The tag name to be applied to a successful build of the Actor. Defaults to 'latest' if not specified. + BuildTag *string `json:"buildTag,omitempty"` + // A map of environment variables to be used during local development and deployment. + EnvironmentVariables map[string]string `json:"environmentVariables,omitempty"` + // The path to the Dockerfile used for building the Actor on the platform. + Dockerfile *string `json:"dockerfile,omitempty"` + // The path to the directory used as the Docker context when building the Actor. + DockerContextDir *string `json:"dockerContextDir,omitempty"` + // The path to the README file for the Actor. + Readme *string `json:"readme,omitempty"` + // The input schema object, the full specification can be found in [Apify docs](https://docs.apify.com/platform/actors/development/actor-definition/input-schema) + Input map[string]interface{} `json:"input,omitempty"` + // The path to the CHANGELOG file displayed in the Actor's information tab. + Changelog *string `json:"changelog,omitempty"` + Storages *ActorDefinitionStorages `json:"storages,omitempty"` + DefaultMemoryMbytes *ActorDefinitionDefaultMemoryMbytes `json:"defaultMemoryMbytes,omitempty"` + // Specifies the minimum amount of memory in megabytes required by the Actor. + MinMemoryMbytes *int32 `json:"minMemoryMbytes,omitempty"` + // Specifies the maximum amount of memory in megabytes required by the Actor. + MaxMemoryMbytes *int32 `json:"maxMemoryMbytes,omitempty"` + // Specifies whether Standby mode is enabled for the Actor. + UsesStandbyMode *bool `json:"usesStandbyMode,omitempty"` +} + +// NewActorDefinition instantiates a new ActorDefinition object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewActorDefinition() *ActorDefinition { + this := ActorDefinition{} + return &this +} + +// NewActorDefinitionWithDefaults instantiates a new ActorDefinition object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewActorDefinitionWithDefaults() *ActorDefinition { + this := ActorDefinition{} + return &this +} + +// GetActorSpecification returns the ActorSpecification field value if set, zero value otherwise. +func (o *ActorDefinition) GetActorSpecification() int32 { + if o == nil || IsNil(o.ActorSpecification) { + var ret int32 + return ret + } + return *o.ActorSpecification +} + +// GetActorSpecificationOk returns a tuple with the ActorSpecification field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ActorDefinition) GetActorSpecificationOk() (*int32, bool) { + if o == nil || IsNil(o.ActorSpecification) { + return nil, false + } + return o.ActorSpecification, true +} + +// HasActorSpecification returns a boolean if a field has been set. +func (o *ActorDefinition) HasActorSpecification() bool { + if o != nil && !IsNil(o.ActorSpecification) { + return true + } + + return false +} + +// SetActorSpecification gets a reference to the given int32 and assigns it to the ActorSpecification field. +func (o *ActorDefinition) SetActorSpecification(v int32) { + o.ActorSpecification = &v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *ActorDefinition) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ActorDefinition) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *ActorDefinition) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *ActorDefinition) SetName(v string) { + o.Name = &v +} + +// GetVersion returns the Version field value if set, zero value otherwise. +func (o *ActorDefinition) GetVersion() string { + if o == nil || IsNil(o.Version) { + var ret string + return ret + } + return *o.Version +} + +// GetVersionOk returns a tuple with the Version field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ActorDefinition) GetVersionOk() (*string, bool) { + if o == nil || IsNil(o.Version) { + return nil, false + } + return o.Version, true +} + +// HasVersion returns a boolean if a field has been set. +func (o *ActorDefinition) HasVersion() bool { + if o != nil && !IsNil(o.Version) { + return true + } + + return false +} + +// SetVersion gets a reference to the given string and assigns it to the Version field. +func (o *ActorDefinition) SetVersion(v string) { + o.Version = &v +} + +// GetBuildTag returns the BuildTag field value if set, zero value otherwise. +func (o *ActorDefinition) GetBuildTag() string { + if o == nil || IsNil(o.BuildTag) { + var ret string + return ret + } + return *o.BuildTag +} + +// GetBuildTagOk returns a tuple with the BuildTag field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ActorDefinition) GetBuildTagOk() (*string, bool) { + if o == nil || IsNil(o.BuildTag) { + return nil, false + } + return o.BuildTag, true +} + +// HasBuildTag returns a boolean if a field has been set. +func (o *ActorDefinition) HasBuildTag() bool { + if o != nil && !IsNil(o.BuildTag) { + return true + } + + return false +} + +// SetBuildTag gets a reference to the given string and assigns it to the BuildTag field. +func (o *ActorDefinition) SetBuildTag(v string) { + o.BuildTag = &v +} + +// GetEnvironmentVariables returns the EnvironmentVariables field value if set, zero value otherwise. +func (o *ActorDefinition) GetEnvironmentVariables() map[string]string { + if o == nil || IsNil(o.EnvironmentVariables) { + var ret map[string]string + return ret + } + return o.EnvironmentVariables +} + +// GetEnvironmentVariablesOk returns a tuple with the EnvironmentVariables field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ActorDefinition) GetEnvironmentVariablesOk() (map[string]string, bool) { + if o == nil || IsNil(o.EnvironmentVariables) { + return map[string]string{}, false + } + return o.EnvironmentVariables, true +} + +// HasEnvironmentVariables returns a boolean if a field has been set. +func (o *ActorDefinition) HasEnvironmentVariables() bool { + if o != nil && !IsNil(o.EnvironmentVariables) { + return true + } + + return false +} + +// SetEnvironmentVariables gets a reference to the given map[string]string and assigns it to the EnvironmentVariables field. +func (o *ActorDefinition) SetEnvironmentVariables(v map[string]string) { + o.EnvironmentVariables = v +} + +// GetDockerfile returns the Dockerfile field value if set, zero value otherwise. +func (o *ActorDefinition) GetDockerfile() string { + if o == nil || IsNil(o.Dockerfile) { + var ret string + return ret + } + return *o.Dockerfile +} + +// GetDockerfileOk returns a tuple with the Dockerfile field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ActorDefinition) GetDockerfileOk() (*string, bool) { + if o == nil || IsNil(o.Dockerfile) { + return nil, false + } + return o.Dockerfile, true +} + +// HasDockerfile returns a boolean if a field has been set. +func (o *ActorDefinition) HasDockerfile() bool { + if o != nil && !IsNil(o.Dockerfile) { + return true + } + + return false +} + +// SetDockerfile gets a reference to the given string and assigns it to the Dockerfile field. +func (o *ActorDefinition) SetDockerfile(v string) { + o.Dockerfile = &v +} + +// GetDockerContextDir returns the DockerContextDir field value if set, zero value otherwise. +func (o *ActorDefinition) GetDockerContextDir() string { + if o == nil || IsNil(o.DockerContextDir) { + var ret string + return ret + } + return *o.DockerContextDir +} + +// GetDockerContextDirOk returns a tuple with the DockerContextDir field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ActorDefinition) GetDockerContextDirOk() (*string, bool) { + if o == nil || IsNil(o.DockerContextDir) { + return nil, false + } + return o.DockerContextDir, true +} + +// HasDockerContextDir returns a boolean if a field has been set. +func (o *ActorDefinition) HasDockerContextDir() bool { + if o != nil && !IsNil(o.DockerContextDir) { + return true + } + + return false +} + +// SetDockerContextDir gets a reference to the given string and assigns it to the DockerContextDir field. +func (o *ActorDefinition) SetDockerContextDir(v string) { + o.DockerContextDir = &v +} + +// GetReadme returns the Readme field value if set, zero value otherwise. +func (o *ActorDefinition) GetReadme() string { + if o == nil || IsNil(o.Readme) { + var ret string + return ret + } + return *o.Readme +} + +// GetReadmeOk returns a tuple with the Readme field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ActorDefinition) GetReadmeOk() (*string, bool) { + if o == nil || IsNil(o.Readme) { + return nil, false + } + return o.Readme, true +} + +// HasReadme returns a boolean if a field has been set. +func (o *ActorDefinition) HasReadme() bool { + if o != nil && !IsNil(o.Readme) { + return true + } + + return false +} + +// SetReadme gets a reference to the given string and assigns it to the Readme field. +func (o *ActorDefinition) SetReadme(v string) { + o.Readme = &v +} + +// GetInput returns the Input field value if set, zero value otherwise. +func (o *ActorDefinition) GetInput() map[string]interface{} { + if o == nil || IsNil(o.Input) { + var ret map[string]interface{} + return ret + } + return o.Input +} + +// GetInputOk returns a tuple with the Input field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ActorDefinition) GetInputOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Input) { + return map[string]interface{}{}, false + } + return o.Input, true +} + +// HasInput returns a boolean if a field has been set. +func (o *ActorDefinition) HasInput() bool { + if o != nil && !IsNil(o.Input) { + return true + } + + return false +} + +// SetInput gets a reference to the given map[string]interface{} and assigns it to the Input field. +func (o *ActorDefinition) SetInput(v map[string]interface{}) { + o.Input = v +} + +// GetChangelog returns the Changelog field value if set, zero value otherwise. +func (o *ActorDefinition) GetChangelog() string { + if o == nil || IsNil(o.Changelog) { + var ret string + return ret + } + return *o.Changelog +} + +// GetChangelogOk returns a tuple with the Changelog field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ActorDefinition) GetChangelogOk() (*string, bool) { + if o == nil || IsNil(o.Changelog) { + return nil, false + } + return o.Changelog, true +} + +// HasChangelog returns a boolean if a field has been set. +func (o *ActorDefinition) HasChangelog() bool { + if o != nil && !IsNil(o.Changelog) { + return true + } + + return false +} + +// SetChangelog gets a reference to the given string and assigns it to the Changelog field. +func (o *ActorDefinition) SetChangelog(v string) { + o.Changelog = &v +} + +// GetStorages returns the Storages field value if set, zero value otherwise. +func (o *ActorDefinition) GetStorages() ActorDefinitionStorages { + if o == nil || IsNil(o.Storages) { + var ret ActorDefinitionStorages + return ret + } + return *o.Storages +} + +// GetStoragesOk returns a tuple with the Storages field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ActorDefinition) GetStoragesOk() (*ActorDefinitionStorages, bool) { + if o == nil || IsNil(o.Storages) { + return nil, false + } + return o.Storages, true +} + +// HasStorages returns a boolean if a field has been set. +func (o *ActorDefinition) HasStorages() bool { + if o != nil && !IsNil(o.Storages) { + return true + } + + return false +} + +// SetStorages gets a reference to the given ActorDefinitionStorages and assigns it to the Storages field. +func (o *ActorDefinition) SetStorages(v ActorDefinitionStorages) { + o.Storages = &v +} + +// GetDefaultMemoryMbytes returns the DefaultMemoryMbytes field value if set, zero value otherwise. +func (o *ActorDefinition) GetDefaultMemoryMbytes() ActorDefinitionDefaultMemoryMbytes { + if o == nil || IsNil(o.DefaultMemoryMbytes) { + var ret ActorDefinitionDefaultMemoryMbytes + return ret + } + return *o.DefaultMemoryMbytes +} + +// GetDefaultMemoryMbytesOk returns a tuple with the DefaultMemoryMbytes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ActorDefinition) GetDefaultMemoryMbytesOk() (*ActorDefinitionDefaultMemoryMbytes, bool) { + if o == nil || IsNil(o.DefaultMemoryMbytes) { + return nil, false + } + return o.DefaultMemoryMbytes, true +} + +// HasDefaultMemoryMbytes returns a boolean if a field has been set. +func (o *ActorDefinition) HasDefaultMemoryMbytes() bool { + if o != nil && !IsNil(o.DefaultMemoryMbytes) { + return true + } + + return false +} + +// SetDefaultMemoryMbytes gets a reference to the given ActorDefinitionDefaultMemoryMbytes and assigns it to the DefaultMemoryMbytes field. +func (o *ActorDefinition) SetDefaultMemoryMbytes(v ActorDefinitionDefaultMemoryMbytes) { + o.DefaultMemoryMbytes = &v +} + +// GetMinMemoryMbytes returns the MinMemoryMbytes field value if set, zero value otherwise. +func (o *ActorDefinition) GetMinMemoryMbytes() int32 { + if o == nil || IsNil(o.MinMemoryMbytes) { + var ret int32 + return ret + } + return *o.MinMemoryMbytes +} + +// GetMinMemoryMbytesOk returns a tuple with the MinMemoryMbytes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ActorDefinition) GetMinMemoryMbytesOk() (*int32, bool) { + if o == nil || IsNil(o.MinMemoryMbytes) { + return nil, false + } + return o.MinMemoryMbytes, true +} + +// HasMinMemoryMbytes returns a boolean if a field has been set. +func (o *ActorDefinition) HasMinMemoryMbytes() bool { + if o != nil && !IsNil(o.MinMemoryMbytes) { + return true + } + + return false +} + +// SetMinMemoryMbytes gets a reference to the given int32 and assigns it to the MinMemoryMbytes field. +func (o *ActorDefinition) SetMinMemoryMbytes(v int32) { + o.MinMemoryMbytes = &v +} + +// GetMaxMemoryMbytes returns the MaxMemoryMbytes field value if set, zero value otherwise. +func (o *ActorDefinition) GetMaxMemoryMbytes() int32 { + if o == nil || IsNil(o.MaxMemoryMbytes) { + var ret int32 + return ret + } + return *o.MaxMemoryMbytes +} + +// GetMaxMemoryMbytesOk returns a tuple with the MaxMemoryMbytes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ActorDefinition) GetMaxMemoryMbytesOk() (*int32, bool) { + if o == nil || IsNil(o.MaxMemoryMbytes) { + return nil, false + } + return o.MaxMemoryMbytes, true +} + +// HasMaxMemoryMbytes returns a boolean if a field has been set. +func (o *ActorDefinition) HasMaxMemoryMbytes() bool { + if o != nil && !IsNil(o.MaxMemoryMbytes) { + return true + } + + return false +} + +// SetMaxMemoryMbytes gets a reference to the given int32 and assigns it to the MaxMemoryMbytes field. +func (o *ActorDefinition) SetMaxMemoryMbytes(v int32) { + o.MaxMemoryMbytes = &v +} + +// GetUsesStandbyMode returns the UsesStandbyMode field value if set, zero value otherwise. +func (o *ActorDefinition) GetUsesStandbyMode() bool { + if o == nil || IsNil(o.UsesStandbyMode) { + var ret bool + return ret + } + return *o.UsesStandbyMode +} + +// GetUsesStandbyModeOk returns a tuple with the UsesStandbyMode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ActorDefinition) GetUsesStandbyModeOk() (*bool, bool) { + if o == nil || IsNil(o.UsesStandbyMode) { + return nil, false + } + return o.UsesStandbyMode, true +} + +// HasUsesStandbyMode returns a boolean if a field has been set. +func (o *ActorDefinition) HasUsesStandbyMode() bool { + if o != nil && !IsNil(o.UsesStandbyMode) { + return true + } + + return false +} + +// SetUsesStandbyMode gets a reference to the given bool and assigns it to the UsesStandbyMode field. +func (o *ActorDefinition) SetUsesStandbyMode(v bool) { + o.UsesStandbyMode = &v +} + +func (o ActorDefinition) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ActorDefinition) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.ActorSpecification) { + toSerialize["actorSpecification"] = o.ActorSpecification + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Version) { + toSerialize["version"] = o.Version + } + if !IsNil(o.BuildTag) { + toSerialize["buildTag"] = o.BuildTag + } + if !IsNil(o.EnvironmentVariables) { + toSerialize["environmentVariables"] = o.EnvironmentVariables + } + if !IsNil(o.Dockerfile) { + toSerialize["dockerfile"] = o.Dockerfile + } + if !IsNil(o.DockerContextDir) { + toSerialize["dockerContextDir"] = o.DockerContextDir + } + if !IsNil(o.Readme) { + toSerialize["readme"] = o.Readme + } + if !IsNil(o.Input) { + toSerialize["input"] = o.Input + } + if !IsNil(o.Changelog) { + toSerialize["changelog"] = o.Changelog + } + if !IsNil(o.Storages) { + toSerialize["storages"] = o.Storages + } + if !IsNil(o.DefaultMemoryMbytes) { + toSerialize["defaultMemoryMbytes"] = o.DefaultMemoryMbytes + } + if !IsNil(o.MinMemoryMbytes) { + toSerialize["minMemoryMbytes"] = o.MinMemoryMbytes + } + if !IsNil(o.MaxMemoryMbytes) { + toSerialize["maxMemoryMbytes"] = o.MaxMemoryMbytes + } + if !IsNil(o.UsesStandbyMode) { + toSerialize["usesStandbyMode"] = o.UsesStandbyMode + } + return toSerialize, nil +} + +type NullableActorDefinition struct { + value *ActorDefinition + isSet bool +} + +func (v NullableActorDefinition) Get() *ActorDefinition { + return v.value +} + +func (v *NullableActorDefinition) Set(val *ActorDefinition) { + v.value = val + v.isSet = true +} + +func (v NullableActorDefinition) IsSet() bool { + return v.isSet +} + +func (v *NullableActorDefinition) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableActorDefinition(val *ActorDefinition) *NullableActorDefinition { + return &NullableActorDefinition{value: val, isSet: true} +} + +func (v NullableActorDefinition) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableActorDefinition) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_actor_definition_default_memory_mbytes.go b/model_actor_definition_default_memory_mbytes.go new file mode 100644 index 0000000..2b5dbd0 --- /dev/null +++ b/model_actor_definition_default_memory_mbytes.go @@ -0,0 +1,171 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" + "fmt" + "gopkg.in/validator.v2" +) + +// ActorDefinitionDefaultMemoryMbytes - Specifies the default amount of memory in megabytes to be used when the Actor is started. Can be an integer or a [dynamic memory expression](/platform/actors/development/actor-definition/dynamic-actor-memory). +type ActorDefinitionDefaultMemoryMbytes struct { + Int32 *int32 + String *string +} + +// int32AsActorDefinitionDefaultMemoryMbytes is a convenience function that returns int32 wrapped in ActorDefinitionDefaultMemoryMbytes +func Int32AsActorDefinitionDefaultMemoryMbytes(v *int32) ActorDefinitionDefaultMemoryMbytes { + return ActorDefinitionDefaultMemoryMbytes{ + Int32: v, + } +} + +// stringAsActorDefinitionDefaultMemoryMbytes is a convenience function that returns string wrapped in ActorDefinitionDefaultMemoryMbytes +func StringAsActorDefinitionDefaultMemoryMbytes(v *string) ActorDefinitionDefaultMemoryMbytes { + return ActorDefinitionDefaultMemoryMbytes{ + String: v, + } +} + + +// Unmarshal JSON data into one of the pointers in the struct +func (dst *ActorDefinitionDefaultMemoryMbytes) UnmarshalJSON(data []byte) error { + var err error + match := 0 + // try to unmarshal data into Int32 + err = newStrictDecoder(data).Decode(&dst.Int32) + if err == nil { + jsonInt32, _ := json.Marshal(dst.Int32) + if string(jsonInt32) == "{}" { // empty struct + dst.Int32 = nil + } else { + if err = validator.Validate(dst.Int32); err != nil { + dst.Int32 = nil + } else { + match++ + } + } + } else { + dst.Int32 = nil + } + + // try to unmarshal data into String + err = newStrictDecoder(data).Decode(&dst.String) + if err == nil { + jsonString, _ := json.Marshal(dst.String) + if string(jsonString) == "{}" { // empty struct + dst.String = nil + } else { + if err = validator.Validate(dst.String); err != nil { + dst.String = nil + } else { + match++ + } + } + } else { + dst.String = nil + } + + if match > 1 { // more than 1 match + // reset to nil + dst.Int32 = nil + dst.String = nil + + return fmt.Errorf("data matches more than one schema in oneOf(ActorDefinitionDefaultMemoryMbytes)") + } else if match == 1 { + return nil // exactly one match + } else { // no match + return fmt.Errorf("data failed to match schemas in oneOf(ActorDefinitionDefaultMemoryMbytes)") + } +} + +// Marshal data from the first non-nil pointers in the struct to JSON +func (src ActorDefinitionDefaultMemoryMbytes) MarshalJSON() ([]byte, error) { + if src.Int32 != nil { + return json.Marshal(&src.Int32) + } + + if src.String != nil { + return json.Marshal(&src.String) + } + + return nil, nil // no data in oneOf schemas +} + +// Get the actual instance +func (obj *ActorDefinitionDefaultMemoryMbytes) GetActualInstance() (interface{}) { + if obj == nil { + return nil + } + if obj.Int32 != nil { + return obj.Int32 + } + + if obj.String != nil { + return obj.String + } + + // all schemas are nil + return nil +} + +// Get the actual instance value +func (obj ActorDefinitionDefaultMemoryMbytes) GetActualInstanceValue() (interface{}) { + if obj.Int32 != nil { + return *obj.Int32 + } + + if obj.String != nil { + return *obj.String + } + + // all schemas are nil + return nil +} + +type NullableActorDefinitionDefaultMemoryMbytes struct { + value *ActorDefinitionDefaultMemoryMbytes + isSet bool +} + +func (v NullableActorDefinitionDefaultMemoryMbytes) Get() *ActorDefinitionDefaultMemoryMbytes { + return v.value +} + +func (v *NullableActorDefinitionDefaultMemoryMbytes) Set(val *ActorDefinitionDefaultMemoryMbytes) { + v.value = val + v.isSet = true +} + +func (v NullableActorDefinitionDefaultMemoryMbytes) IsSet() bool { + return v.isSet +} + +func (v *NullableActorDefinitionDefaultMemoryMbytes) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableActorDefinitionDefaultMemoryMbytes(val *ActorDefinitionDefaultMemoryMbytes) *NullableActorDefinitionDefaultMemoryMbytes { + return &NullableActorDefinitionDefaultMemoryMbytes{value: val, isSet: true} +} + +func (v NullableActorDefinitionDefaultMemoryMbytes) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableActorDefinitionDefaultMemoryMbytes) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_actor_definition_storages.go b/model_actor_definition_storages.go new file mode 100644 index 0000000..5637d73 --- /dev/null +++ b/model_actor_definition_storages.go @@ -0,0 +1,127 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" +) + +// checks if the ActorDefinitionStorages type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ActorDefinitionStorages{} + +// ActorDefinitionStorages struct for ActorDefinitionStorages +type ActorDefinitionStorages struct { + // Defines the schema of items in your dataset, the full specification can be found in [Apify docs](https://docs.apify.com/platform/actors/development/actor-definition/dataset-schema) + Dataset map[string]interface{} `json:"dataset,omitempty"` +} + +// NewActorDefinitionStorages instantiates a new ActorDefinitionStorages object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewActorDefinitionStorages() *ActorDefinitionStorages { + this := ActorDefinitionStorages{} + return &this +} + +// NewActorDefinitionStoragesWithDefaults instantiates a new ActorDefinitionStorages object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewActorDefinitionStoragesWithDefaults() *ActorDefinitionStorages { + this := ActorDefinitionStorages{} + return &this +} + +// GetDataset returns the Dataset field value if set, zero value otherwise. +func (o *ActorDefinitionStorages) GetDataset() map[string]interface{} { + if o == nil || IsNil(o.Dataset) { + var ret map[string]interface{} + return ret + } + return o.Dataset +} + +// GetDatasetOk returns a tuple with the Dataset field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ActorDefinitionStorages) GetDatasetOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Dataset) { + return map[string]interface{}{}, false + } + return o.Dataset, true +} + +// HasDataset returns a boolean if a field has been set. +func (o *ActorDefinitionStorages) HasDataset() bool { + if o != nil && !IsNil(o.Dataset) { + return true + } + + return false +} + +// SetDataset gets a reference to the given map[string]interface{} and assigns it to the Dataset field. +func (o *ActorDefinitionStorages) SetDataset(v map[string]interface{}) { + o.Dataset = v +} + +func (o ActorDefinitionStorages) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ActorDefinitionStorages) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Dataset) { + toSerialize["dataset"] = o.Dataset + } + return toSerialize, nil +} + +type NullableActorDefinitionStorages struct { + value *ActorDefinitionStorages + isSet bool +} + +func (v NullableActorDefinitionStorages) Get() *ActorDefinitionStorages { + return v.value +} + +func (v *NullableActorDefinitionStorages) Set(val *ActorDefinitionStorages) { + v.value = val + v.isSet = true +} + +func (v NullableActorDefinitionStorages) IsSet() bool { + return v.isSet +} + +func (v *NullableActorDefinitionStorages) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableActorDefinitionStorages(val *ActorDefinitionStorages) *NullableActorDefinitionStorages { + return &NullableActorDefinitionStorages{value: val, isSet: true} +} + +func (v NullableActorDefinitionStorages) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableActorDefinitionStorages) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_actor_job_status.go b/model_actor_job_status.go new file mode 100644 index 0000000..d2af1d2 --- /dev/null +++ b/model_actor_job_status.go @@ -0,0 +1,123 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" + "fmt" +) + +// ActorJobStatus Status of an Actor job (run or build). +type ActorJobStatus string + +// List of ActorJobStatus +const ( + READY ActorJobStatus = "READY" + RUNNING ActorJobStatus = "RUNNING" + SUCCEEDED ActorJobStatus = "SUCCEEDED" + FAILED ActorJobStatus = "FAILED" + TIMING_OUT ActorJobStatus = "TIMING-OUT" + TIMED_OUT ActorJobStatus = "TIMED-OUT" + ABORTING ActorJobStatus = "ABORTING" + ABORTED ActorJobStatus = "ABORTED" +) + +// All allowed values of ActorJobStatus enum +var AllowedActorJobStatusEnumValues = []ActorJobStatus{ + "READY", + "RUNNING", + "SUCCEEDED", + "FAILED", + "TIMING-OUT", + "TIMED-OUT", + "ABORTING", + "ABORTED", +} + +func (v *ActorJobStatus) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := ActorJobStatus(value) + for _, existing := range AllowedActorJobStatusEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid ActorJobStatus", value) +} + +// NewActorJobStatusFromValue returns a pointer to a valid ActorJobStatus +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewActorJobStatusFromValue(v string) (*ActorJobStatus, error) { + ev := ActorJobStatus(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for ActorJobStatus: valid values are %v", v, AllowedActorJobStatusEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v ActorJobStatus) IsValid() bool { + for _, existing := range AllowedActorJobStatusEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to ActorJobStatus value +func (v ActorJobStatus) Ptr() *ActorJobStatus { + return &v +} + +type NullableActorJobStatus struct { + value *ActorJobStatus + isSet bool +} + +func (v NullableActorJobStatus) Get() *ActorJobStatus { + return v.value +} + +func (v *NullableActorJobStatus) Set(val *ActorJobStatus) { + v.value = val + v.isSet = true +} + +func (v NullableActorJobStatus) IsSet() bool { + return v.isSet +} + +func (v *NullableActorJobStatus) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableActorJobStatus(val *ActorJobStatus) *NullableActorJobStatus { + return &NullableActorJobStatus{value: val, isSet: true} +} + +func (v NullableActorJobStatus) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableActorJobStatus) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + diff --git a/model_actor_permission_level.go b/model_actor_permission_level.go new file mode 100644 index 0000000..fb656bb --- /dev/null +++ b/model_actor_permission_level.go @@ -0,0 +1,111 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" + "fmt" +) + +// ActorPermissionLevel Determines permissions that the Actor requires to run. For more information, see the [Actor permissions documentation](https://docs.apify.com/platform/actors/development/permissions). +type ActorPermissionLevel string + +// List of ActorPermissionLevel +const ( + LIMITED_PERMISSIONS ActorPermissionLevel = "LIMITED_PERMISSIONS" + FULL_PERMISSIONS ActorPermissionLevel = "FULL_PERMISSIONS" +) + +// All allowed values of ActorPermissionLevel enum +var AllowedActorPermissionLevelEnumValues = []ActorPermissionLevel{ + "LIMITED_PERMISSIONS", + "FULL_PERMISSIONS", +} + +func (v *ActorPermissionLevel) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := ActorPermissionLevel(value) + for _, existing := range AllowedActorPermissionLevelEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid ActorPermissionLevel", value) +} + +// NewActorPermissionLevelFromValue returns a pointer to a valid ActorPermissionLevel +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewActorPermissionLevelFromValue(v string) (*ActorPermissionLevel, error) { + ev := ActorPermissionLevel(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for ActorPermissionLevel: valid values are %v", v, AllowedActorPermissionLevelEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v ActorPermissionLevel) IsValid() bool { + for _, existing := range AllowedActorPermissionLevelEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to ActorPermissionLevel value +func (v ActorPermissionLevel) Ptr() *ActorPermissionLevel { + return &v +} + +type NullableActorPermissionLevel struct { + value *ActorPermissionLevel + isSet bool +} + +func (v NullableActorPermissionLevel) Get() *ActorPermissionLevel { + return v.value +} + +func (v *NullableActorPermissionLevel) Set(val *ActorPermissionLevel) { + v.value = val + v.isSet = true +} + +func (v NullableActorPermissionLevel) IsSet() bool { + return v.isSet +} + +func (v *NullableActorPermissionLevel) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableActorPermissionLevel(val *ActorPermissionLevel) *NullableActorPermissionLevel { + return &NullableActorPermissionLevel{value: val, isSet: true} +} + +func (v NullableActorPermissionLevel) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableActorPermissionLevel) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + diff --git a/model_actor_response.go b/model_actor_response.go new file mode 100644 index 0000000..14e8fd1 --- /dev/null +++ b/model_actor_response.go @@ -0,0 +1,158 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" + "bytes" + "fmt" +) + +// checks if the ActorResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ActorResponse{} + +// ActorResponse Response containing Actor data. +type ActorResponse struct { + Data Actor `json:"data"` +} + +type _ActorResponse ActorResponse + +// NewActorResponse instantiates a new ActorResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewActorResponse(data Actor) *ActorResponse { + this := ActorResponse{} + this.Data = data + return &this +} + +// NewActorResponseWithDefaults instantiates a new ActorResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewActorResponseWithDefaults() *ActorResponse { + this := ActorResponse{} + return &this +} + +// GetData returns the Data field value +func (o *ActorResponse) GetData() Actor { + if o == nil { + var ret Actor + return ret + } + + return o.Data +} + +// GetDataOk returns a tuple with the Data field value +// and a boolean to check if the value has been set. +func (o *ActorResponse) GetDataOk() (*Actor, bool) { + if o == nil { + return nil, false + } + return &o.Data, true +} + +// SetData sets field value +func (o *ActorResponse) SetData(v Actor) { + o.Data = v +} + +func (o ActorResponse) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ActorResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["data"] = o.Data + return toSerialize, nil +} + +func (o *ActorResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "data", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varActorResponse := _ActorResponse{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varActorResponse) + + if err != nil { + return err + } + + *o = ActorResponse(varActorResponse) + + return err +} + +type NullableActorResponse struct { + value *ActorResponse + isSet bool +} + +func (v NullableActorResponse) Get() *ActorResponse { + return v.value +} + +func (v *NullableActorResponse) Set(val *ActorResponse) { + v.value = val + v.isSet = true +} + +func (v NullableActorResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableActorResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableActorResponse(val *ActorResponse) *NullableActorResponse { + return &NullableActorResponse{value: val, isSet: true} +} + +func (v NullableActorResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableActorResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_actor_run_failed_error.go b/model_actor_run_failed_error.go new file mode 100644 index 0000000..8bd3bcc --- /dev/null +++ b/model_actor_run_failed_error.go @@ -0,0 +1,126 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" +) + +// checks if the ActorRunFailedError type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ActorRunFailedError{} + +// ActorRunFailedError struct for ActorRunFailedError +type ActorRunFailedError struct { + Error *RunFailedErrorDetail `json:"error,omitempty"` +} + +// NewActorRunFailedError instantiates a new ActorRunFailedError object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewActorRunFailedError() *ActorRunFailedError { + this := ActorRunFailedError{} + return &this +} + +// NewActorRunFailedErrorWithDefaults instantiates a new ActorRunFailedError object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewActorRunFailedErrorWithDefaults() *ActorRunFailedError { + this := ActorRunFailedError{} + return &this +} + +// GetError returns the Error field value if set, zero value otherwise. +func (o *ActorRunFailedError) GetError() RunFailedErrorDetail { + if o == nil || IsNil(o.Error) { + var ret RunFailedErrorDetail + return ret + } + return *o.Error +} + +// GetErrorOk returns a tuple with the Error field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ActorRunFailedError) GetErrorOk() (*RunFailedErrorDetail, bool) { + if o == nil || IsNil(o.Error) { + return nil, false + } + return o.Error, true +} + +// HasError returns a boolean if a field has been set. +func (o *ActorRunFailedError) HasError() bool { + if o != nil && !IsNil(o.Error) { + return true + } + + return false +} + +// SetError gets a reference to the given RunFailedErrorDetail and assigns it to the Error field. +func (o *ActorRunFailedError) SetError(v RunFailedErrorDetail) { + o.Error = &v +} + +func (o ActorRunFailedError) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ActorRunFailedError) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Error) { + toSerialize["error"] = o.Error + } + return toSerialize, nil +} + +type NullableActorRunFailedError struct { + value *ActorRunFailedError + isSet bool +} + +func (v NullableActorRunFailedError) Get() *ActorRunFailedError { + return v.value +} + +func (v *NullableActorRunFailedError) Set(val *ActorRunFailedError) { + v.value = val + v.isSet = true +} + +func (v NullableActorRunFailedError) IsSet() bool { + return v.isSet +} + +func (v *NullableActorRunFailedError) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableActorRunFailedError(val *ActorRunFailedError) *NullableActorRunFailedError { + return &NullableActorRunFailedError{value: val, isSet: true} +} + +func (v NullableActorRunFailedError) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableActorRunFailedError) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_actor_run_pricing_info.go b/model_actor_run_pricing_info.go new file mode 100644 index 0000000..9aa8086 --- /dev/null +++ b/model_actor_run_pricing_info.go @@ -0,0 +1,247 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" + "fmt" + "gopkg.in/validator.v2" +) + +// ActorRunPricingInfo - struct for ActorRunPricingInfo +type ActorRunPricingInfo struct { + FlatPricePerMonthActorPricingInfo *FlatPricePerMonthActorPricingInfo + FreeActorPricingInfo *FreeActorPricingInfo + PayPerEventActorPricingInfo *PayPerEventActorPricingInfo + PricePerDatasetItemActorPricingInfo *PricePerDatasetItemActorPricingInfo +} + +// FlatPricePerMonthActorPricingInfoAsActorRunPricingInfo is a convenience function that returns FlatPricePerMonthActorPricingInfo wrapped in ActorRunPricingInfo +func FlatPricePerMonthActorPricingInfoAsActorRunPricingInfo(v *FlatPricePerMonthActorPricingInfo) ActorRunPricingInfo { + return ActorRunPricingInfo{ + FlatPricePerMonthActorPricingInfo: v, + } +} + +// FreeActorPricingInfoAsActorRunPricingInfo is a convenience function that returns FreeActorPricingInfo wrapped in ActorRunPricingInfo +func FreeActorPricingInfoAsActorRunPricingInfo(v *FreeActorPricingInfo) ActorRunPricingInfo { + return ActorRunPricingInfo{ + FreeActorPricingInfo: v, + } +} + +// PayPerEventActorPricingInfoAsActorRunPricingInfo is a convenience function that returns PayPerEventActorPricingInfo wrapped in ActorRunPricingInfo +func PayPerEventActorPricingInfoAsActorRunPricingInfo(v *PayPerEventActorPricingInfo) ActorRunPricingInfo { + return ActorRunPricingInfo{ + PayPerEventActorPricingInfo: v, + } +} + +// PricePerDatasetItemActorPricingInfoAsActorRunPricingInfo is a convenience function that returns PricePerDatasetItemActorPricingInfo wrapped in ActorRunPricingInfo +func PricePerDatasetItemActorPricingInfoAsActorRunPricingInfo(v *PricePerDatasetItemActorPricingInfo) ActorRunPricingInfo { + return ActorRunPricingInfo{ + PricePerDatasetItemActorPricingInfo: v, + } +} + + +// Unmarshal JSON data into one of the pointers in the struct +func (dst *ActorRunPricingInfo) UnmarshalJSON(data []byte) error { + var err error + match := 0 + // try to unmarshal data into FlatPricePerMonthActorPricingInfo + err = newStrictDecoder(data).Decode(&dst.FlatPricePerMonthActorPricingInfo) + if err == nil { + jsonFlatPricePerMonthActorPricingInfo, _ := json.Marshal(dst.FlatPricePerMonthActorPricingInfo) + if string(jsonFlatPricePerMonthActorPricingInfo) == "{}" { // empty struct + dst.FlatPricePerMonthActorPricingInfo = nil + } else { + if err = validator.Validate(dst.FlatPricePerMonthActorPricingInfo); err != nil { + dst.FlatPricePerMonthActorPricingInfo = nil + } else { + match++ + } + } + } else { + dst.FlatPricePerMonthActorPricingInfo = nil + } + + // try to unmarshal data into FreeActorPricingInfo + err = newStrictDecoder(data).Decode(&dst.FreeActorPricingInfo) + if err == nil { + jsonFreeActorPricingInfo, _ := json.Marshal(dst.FreeActorPricingInfo) + if string(jsonFreeActorPricingInfo) == "{}" { // empty struct + dst.FreeActorPricingInfo = nil + } else { + if err = validator.Validate(dst.FreeActorPricingInfo); err != nil { + dst.FreeActorPricingInfo = nil + } else { + match++ + } + } + } else { + dst.FreeActorPricingInfo = nil + } + + // try to unmarshal data into PayPerEventActorPricingInfo + err = newStrictDecoder(data).Decode(&dst.PayPerEventActorPricingInfo) + if err == nil { + jsonPayPerEventActorPricingInfo, _ := json.Marshal(dst.PayPerEventActorPricingInfo) + if string(jsonPayPerEventActorPricingInfo) == "{}" { // empty struct + dst.PayPerEventActorPricingInfo = nil + } else { + if err = validator.Validate(dst.PayPerEventActorPricingInfo); err != nil { + dst.PayPerEventActorPricingInfo = nil + } else { + match++ + } + } + } else { + dst.PayPerEventActorPricingInfo = nil + } + + // try to unmarshal data into PricePerDatasetItemActorPricingInfo + err = newStrictDecoder(data).Decode(&dst.PricePerDatasetItemActorPricingInfo) + if err == nil { + jsonPricePerDatasetItemActorPricingInfo, _ := json.Marshal(dst.PricePerDatasetItemActorPricingInfo) + if string(jsonPricePerDatasetItemActorPricingInfo) == "{}" { // empty struct + dst.PricePerDatasetItemActorPricingInfo = nil + } else { + if err = validator.Validate(dst.PricePerDatasetItemActorPricingInfo); err != nil { + dst.PricePerDatasetItemActorPricingInfo = nil + } else { + match++ + } + } + } else { + dst.PricePerDatasetItemActorPricingInfo = nil + } + + if match > 1 { // more than 1 match + // reset to nil + dst.FlatPricePerMonthActorPricingInfo = nil + dst.FreeActorPricingInfo = nil + dst.PayPerEventActorPricingInfo = nil + dst.PricePerDatasetItemActorPricingInfo = nil + + return fmt.Errorf("data matches more than one schema in oneOf(ActorRunPricingInfo)") + } else if match == 1 { + return nil // exactly one match + } else { // no match + return fmt.Errorf("data failed to match schemas in oneOf(ActorRunPricingInfo)") + } +} + +// Marshal data from the first non-nil pointers in the struct to JSON +func (src ActorRunPricingInfo) MarshalJSON() ([]byte, error) { + if src.FlatPricePerMonthActorPricingInfo != nil { + return json.Marshal(&src.FlatPricePerMonthActorPricingInfo) + } + + if src.FreeActorPricingInfo != nil { + return json.Marshal(&src.FreeActorPricingInfo) + } + + if src.PayPerEventActorPricingInfo != nil { + return json.Marshal(&src.PayPerEventActorPricingInfo) + } + + if src.PricePerDatasetItemActorPricingInfo != nil { + return json.Marshal(&src.PricePerDatasetItemActorPricingInfo) + } + + return nil, nil // no data in oneOf schemas +} + +// Get the actual instance +func (obj *ActorRunPricingInfo) GetActualInstance() (interface{}) { + if obj == nil { + return nil + } + if obj.FlatPricePerMonthActorPricingInfo != nil { + return obj.FlatPricePerMonthActorPricingInfo + } + + if obj.FreeActorPricingInfo != nil { + return obj.FreeActorPricingInfo + } + + if obj.PayPerEventActorPricingInfo != nil { + return obj.PayPerEventActorPricingInfo + } + + if obj.PricePerDatasetItemActorPricingInfo != nil { + return obj.PricePerDatasetItemActorPricingInfo + } + + // all schemas are nil + return nil +} + +// Get the actual instance value +func (obj ActorRunPricingInfo) GetActualInstanceValue() (interface{}) { + if obj.FlatPricePerMonthActorPricingInfo != nil { + return *obj.FlatPricePerMonthActorPricingInfo + } + + if obj.FreeActorPricingInfo != nil { + return *obj.FreeActorPricingInfo + } + + if obj.PayPerEventActorPricingInfo != nil { + return *obj.PayPerEventActorPricingInfo + } + + if obj.PricePerDatasetItemActorPricingInfo != nil { + return *obj.PricePerDatasetItemActorPricingInfo + } + + // all schemas are nil + return nil +} + +type NullableActorRunPricingInfo struct { + value *ActorRunPricingInfo + isSet bool +} + +func (v NullableActorRunPricingInfo) Get() *ActorRunPricingInfo { + return v.value +} + +func (v *NullableActorRunPricingInfo) Set(val *ActorRunPricingInfo) { + v.value = val + v.isSet = true +} + +func (v NullableActorRunPricingInfo) IsSet() bool { + return v.isSet +} + +func (v *NullableActorRunPricingInfo) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableActorRunPricingInfo(val *ActorRunPricingInfo) *NullableActorRunPricingInfo { + return &NullableActorRunPricingInfo{value: val, isSet: true} +} + +func (v NullableActorRunPricingInfo) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableActorRunPricingInfo) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_actor_run_timeout_exceeded_error.go b/model_actor_run_timeout_exceeded_error.go new file mode 100644 index 0000000..8a4b5c9 --- /dev/null +++ b/model_actor_run_timeout_exceeded_error.go @@ -0,0 +1,126 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" +) + +// checks if the ActorRunTimeoutExceededError type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ActorRunTimeoutExceededError{} + +// ActorRunTimeoutExceededError struct for ActorRunTimeoutExceededError +type ActorRunTimeoutExceededError struct { + Error *RunTimeoutExceededErrorDetail `json:"error,omitempty"` +} + +// NewActorRunTimeoutExceededError instantiates a new ActorRunTimeoutExceededError object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewActorRunTimeoutExceededError() *ActorRunTimeoutExceededError { + this := ActorRunTimeoutExceededError{} + return &this +} + +// NewActorRunTimeoutExceededErrorWithDefaults instantiates a new ActorRunTimeoutExceededError object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewActorRunTimeoutExceededErrorWithDefaults() *ActorRunTimeoutExceededError { + this := ActorRunTimeoutExceededError{} + return &this +} + +// GetError returns the Error field value if set, zero value otherwise. +func (o *ActorRunTimeoutExceededError) GetError() RunTimeoutExceededErrorDetail { + if o == nil || IsNil(o.Error) { + var ret RunTimeoutExceededErrorDetail + return ret + } + return *o.Error +} + +// GetErrorOk returns a tuple with the Error field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ActorRunTimeoutExceededError) GetErrorOk() (*RunTimeoutExceededErrorDetail, bool) { + if o == nil || IsNil(o.Error) { + return nil, false + } + return o.Error, true +} + +// HasError returns a boolean if a field has been set. +func (o *ActorRunTimeoutExceededError) HasError() bool { + if o != nil && !IsNil(o.Error) { + return true + } + + return false +} + +// SetError gets a reference to the given RunTimeoutExceededErrorDetail and assigns it to the Error field. +func (o *ActorRunTimeoutExceededError) SetError(v RunTimeoutExceededErrorDetail) { + o.Error = &v +} + +func (o ActorRunTimeoutExceededError) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ActorRunTimeoutExceededError) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Error) { + toSerialize["error"] = o.Error + } + return toSerialize, nil +} + +type NullableActorRunTimeoutExceededError struct { + value *ActorRunTimeoutExceededError + isSet bool +} + +func (v NullableActorRunTimeoutExceededError) Get() *ActorRunTimeoutExceededError { + return v.value +} + +func (v *NullableActorRunTimeoutExceededError) Set(val *ActorRunTimeoutExceededError) { + v.value = val + v.isSet = true +} + +func (v NullableActorRunTimeoutExceededError) IsSet() bool { + return v.isSet +} + +func (v *NullableActorRunTimeoutExceededError) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableActorRunTimeoutExceededError(val *ActorRunTimeoutExceededError) *NullableActorRunTimeoutExceededError { + return &NullableActorRunTimeoutExceededError{value: val, isSet: true} +} + +func (v NullableActorRunTimeoutExceededError) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableActorRunTimeoutExceededError) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_actor_short.go b/model_actor_short.go new file mode 100644 index 0000000..c6c12a0 --- /dev/null +++ b/model_actor_short.go @@ -0,0 +1,353 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" + "time" + "bytes" + "fmt" +) + +// checks if the ActorShort type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ActorShort{} + +// ActorShort struct for ActorShort +type ActorShort struct { + Id string `json:"id"` + CreatedAt time.Time `json:"createdAt"` + ModifiedAt time.Time `json:"modifiedAt"` + Name string `json:"name"` + Username string `json:"username"` + Title *string `json:"title,omitempty"` + Stats NullableActorStats `json:"stats,omitempty"` +} + +type _ActorShort ActorShort + +// NewActorShort instantiates a new ActorShort object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewActorShort(id string, createdAt time.Time, modifiedAt time.Time, name string, username string) *ActorShort { + this := ActorShort{} + this.Id = id + this.CreatedAt = createdAt + this.ModifiedAt = modifiedAt + this.Name = name + this.Username = username + return &this +} + +// NewActorShortWithDefaults instantiates a new ActorShort object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewActorShortWithDefaults() *ActorShort { + this := ActorShort{} + return &this +} + +// GetId returns the Id field value +func (o *ActorShort) GetId() string { + if o == nil { + var ret string + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *ActorShort) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *ActorShort) SetId(v string) { + o.Id = v +} + +// GetCreatedAt returns the CreatedAt field value +func (o *ActorShort) GetCreatedAt() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value +// and a boolean to check if the value has been set. +func (o *ActorShort) GetCreatedAtOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.CreatedAt, true +} + +// SetCreatedAt sets field value +func (o *ActorShort) SetCreatedAt(v time.Time) { + o.CreatedAt = v +} + +// GetModifiedAt returns the ModifiedAt field value +func (o *ActorShort) GetModifiedAt() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.ModifiedAt +} + +// GetModifiedAtOk returns a tuple with the ModifiedAt field value +// and a boolean to check if the value has been set. +func (o *ActorShort) GetModifiedAtOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.ModifiedAt, true +} + +// SetModifiedAt sets field value +func (o *ActorShort) SetModifiedAt(v time.Time) { + o.ModifiedAt = v +} + +// GetName returns the Name field value +func (o *ActorShort) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *ActorShort) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *ActorShort) SetName(v string) { + o.Name = v +} + +// GetUsername returns the Username field value +func (o *ActorShort) GetUsername() string { + if o == nil { + var ret string + return ret + } + + return o.Username +} + +// GetUsernameOk returns a tuple with the Username field value +// and a boolean to check if the value has been set. +func (o *ActorShort) GetUsernameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Username, true +} + +// SetUsername sets field value +func (o *ActorShort) SetUsername(v string) { + o.Username = v +} + +// GetTitle returns the Title field value if set, zero value otherwise. +func (o *ActorShort) GetTitle() string { + if o == nil || IsNil(o.Title) { + var ret string + return ret + } + return *o.Title +} + +// GetTitleOk returns a tuple with the Title field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ActorShort) GetTitleOk() (*string, bool) { + if o == nil || IsNil(o.Title) { + return nil, false + } + return o.Title, true +} + +// HasTitle returns a boolean if a field has been set. +func (o *ActorShort) HasTitle() bool { + if o != nil && !IsNil(o.Title) { + return true + } + + return false +} + +// SetTitle gets a reference to the given string and assigns it to the Title field. +func (o *ActorShort) SetTitle(v string) { + o.Title = &v +} + +// GetStats returns the Stats field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ActorShort) GetStats() ActorStats { + if o == nil || IsNil(o.Stats.Get()) { + var ret ActorStats + return ret + } + return *o.Stats.Get() +} + +// GetStatsOk returns a tuple with the Stats field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ActorShort) GetStatsOk() (*ActorStats, bool) { + if o == nil { + return nil, false + } + return o.Stats.Get(), o.Stats.IsSet() +} + +// HasStats returns a boolean if a field has been set. +func (o *ActorShort) HasStats() bool { + if o != nil && o.Stats.IsSet() { + return true + } + + return false +} + +// SetStats gets a reference to the given NullableActorStats and assigns it to the Stats field. +func (o *ActorShort) SetStats(v ActorStats) { + o.Stats.Set(&v) +} +// SetStatsNil sets the value for Stats to be an explicit nil +func (o *ActorShort) SetStatsNil() { + o.Stats.Set(nil) +} + +// UnsetStats ensures that no value is present for Stats, not even an explicit nil +func (o *ActorShort) UnsetStats() { + o.Stats.Unset() +} + +func (o ActorShort) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ActorShort) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["createdAt"] = o.CreatedAt + toSerialize["modifiedAt"] = o.ModifiedAt + toSerialize["name"] = o.Name + toSerialize["username"] = o.Username + if !IsNil(o.Title) { + toSerialize["title"] = o.Title + } + if o.Stats.IsSet() { + toSerialize["stats"] = o.Stats.Get() + } + return toSerialize, nil +} + +func (o *ActorShort) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "createdAt", + "modifiedAt", + "name", + "username", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varActorShort := _ActorShort{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varActorShort) + + if err != nil { + return err + } + + *o = ActorShort(varActorShort) + + return err +} + +type NullableActorShort struct { + value *ActorShort + isSet bool +} + +func (v NullableActorShort) Get() *ActorShort { + return v.value +} + +func (v *NullableActorShort) Set(val *ActorShort) { + v.value = val + v.isSet = true +} + +func (v NullableActorShort) IsSet() bool { + return v.isSet +} + +func (v *NullableActorShort) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableActorShort(val *ActorShort) *NullableActorShort { + return &NullableActorShort{value: val, isSet: true} +} + +func (v NullableActorShort) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableActorShort) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_actor_standby.go b/model_actor_standby.go new file mode 100644 index 0000000..1736c86 --- /dev/null +++ b/model_actor_standby.go @@ -0,0 +1,458 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" +) + +// checks if the ActorStandby type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ActorStandby{} + +// ActorStandby struct for ActorStandby +type ActorStandby struct { + IsEnabled NullableBool `json:"isEnabled,omitempty"` + DesiredRequestsPerActorRun NullableInt32 `json:"desiredRequestsPerActorRun,omitempty"` + MaxRequestsPerActorRun NullableInt32 `json:"maxRequestsPerActorRun,omitempty"` + IdleTimeoutSecs NullableInt32 `json:"idleTimeoutSecs,omitempty"` + Build NullableString `json:"build,omitempty"` + MemoryMbytes NullableInt32 `json:"memoryMbytes,omitempty"` + DisableStandbyFieldsOverride NullableBool `json:"disableStandbyFieldsOverride,omitempty"` + ShouldPassActorInput NullableBool `json:"shouldPassActorInput,omitempty"` +} + +// NewActorStandby instantiates a new ActorStandby object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewActorStandby() *ActorStandby { + this := ActorStandby{} + return &this +} + +// NewActorStandbyWithDefaults instantiates a new ActorStandby object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewActorStandbyWithDefaults() *ActorStandby { + this := ActorStandby{} + return &this +} + +// GetIsEnabled returns the IsEnabled field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ActorStandby) GetIsEnabled() bool { + if o == nil || IsNil(o.IsEnabled.Get()) { + var ret bool + return ret + } + return *o.IsEnabled.Get() +} + +// GetIsEnabledOk returns a tuple with the IsEnabled field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ActorStandby) GetIsEnabledOk() (*bool, bool) { + if o == nil { + return nil, false + } + return o.IsEnabled.Get(), o.IsEnabled.IsSet() +} + +// HasIsEnabled returns a boolean if a field has been set. +func (o *ActorStandby) HasIsEnabled() bool { + if o != nil && o.IsEnabled.IsSet() { + return true + } + + return false +} + +// SetIsEnabled gets a reference to the given NullableBool and assigns it to the IsEnabled field. +func (o *ActorStandby) SetIsEnabled(v bool) { + o.IsEnabled.Set(&v) +} +// SetIsEnabledNil sets the value for IsEnabled to be an explicit nil +func (o *ActorStandby) SetIsEnabledNil() { + o.IsEnabled.Set(nil) +} + +// UnsetIsEnabled ensures that no value is present for IsEnabled, not even an explicit nil +func (o *ActorStandby) UnsetIsEnabled() { + o.IsEnabled.Unset() +} + +// GetDesiredRequestsPerActorRun returns the DesiredRequestsPerActorRun field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ActorStandby) GetDesiredRequestsPerActorRun() int32 { + if o == nil || IsNil(o.DesiredRequestsPerActorRun.Get()) { + var ret int32 + return ret + } + return *o.DesiredRequestsPerActorRun.Get() +} + +// GetDesiredRequestsPerActorRunOk returns a tuple with the DesiredRequestsPerActorRun field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ActorStandby) GetDesiredRequestsPerActorRunOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.DesiredRequestsPerActorRun.Get(), o.DesiredRequestsPerActorRun.IsSet() +} + +// HasDesiredRequestsPerActorRun returns a boolean if a field has been set. +func (o *ActorStandby) HasDesiredRequestsPerActorRun() bool { + if o != nil && o.DesiredRequestsPerActorRun.IsSet() { + return true + } + + return false +} + +// SetDesiredRequestsPerActorRun gets a reference to the given NullableInt32 and assigns it to the DesiredRequestsPerActorRun field. +func (o *ActorStandby) SetDesiredRequestsPerActorRun(v int32) { + o.DesiredRequestsPerActorRun.Set(&v) +} +// SetDesiredRequestsPerActorRunNil sets the value for DesiredRequestsPerActorRun to be an explicit nil +func (o *ActorStandby) SetDesiredRequestsPerActorRunNil() { + o.DesiredRequestsPerActorRun.Set(nil) +} + +// UnsetDesiredRequestsPerActorRun ensures that no value is present for DesiredRequestsPerActorRun, not even an explicit nil +func (o *ActorStandby) UnsetDesiredRequestsPerActorRun() { + o.DesiredRequestsPerActorRun.Unset() +} + +// GetMaxRequestsPerActorRun returns the MaxRequestsPerActorRun field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ActorStandby) GetMaxRequestsPerActorRun() int32 { + if o == nil || IsNil(o.MaxRequestsPerActorRun.Get()) { + var ret int32 + return ret + } + return *o.MaxRequestsPerActorRun.Get() +} + +// GetMaxRequestsPerActorRunOk returns a tuple with the MaxRequestsPerActorRun field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ActorStandby) GetMaxRequestsPerActorRunOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.MaxRequestsPerActorRun.Get(), o.MaxRequestsPerActorRun.IsSet() +} + +// HasMaxRequestsPerActorRun returns a boolean if a field has been set. +func (o *ActorStandby) HasMaxRequestsPerActorRun() bool { + if o != nil && o.MaxRequestsPerActorRun.IsSet() { + return true + } + + return false +} + +// SetMaxRequestsPerActorRun gets a reference to the given NullableInt32 and assigns it to the MaxRequestsPerActorRun field. +func (o *ActorStandby) SetMaxRequestsPerActorRun(v int32) { + o.MaxRequestsPerActorRun.Set(&v) +} +// SetMaxRequestsPerActorRunNil sets the value for MaxRequestsPerActorRun to be an explicit nil +func (o *ActorStandby) SetMaxRequestsPerActorRunNil() { + o.MaxRequestsPerActorRun.Set(nil) +} + +// UnsetMaxRequestsPerActorRun ensures that no value is present for MaxRequestsPerActorRun, not even an explicit nil +func (o *ActorStandby) UnsetMaxRequestsPerActorRun() { + o.MaxRequestsPerActorRun.Unset() +} + +// GetIdleTimeoutSecs returns the IdleTimeoutSecs field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ActorStandby) GetIdleTimeoutSecs() int32 { + if o == nil || IsNil(o.IdleTimeoutSecs.Get()) { + var ret int32 + return ret + } + return *o.IdleTimeoutSecs.Get() +} + +// GetIdleTimeoutSecsOk returns a tuple with the IdleTimeoutSecs field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ActorStandby) GetIdleTimeoutSecsOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.IdleTimeoutSecs.Get(), o.IdleTimeoutSecs.IsSet() +} + +// HasIdleTimeoutSecs returns a boolean if a field has been set. +func (o *ActorStandby) HasIdleTimeoutSecs() bool { + if o != nil && o.IdleTimeoutSecs.IsSet() { + return true + } + + return false +} + +// SetIdleTimeoutSecs gets a reference to the given NullableInt32 and assigns it to the IdleTimeoutSecs field. +func (o *ActorStandby) SetIdleTimeoutSecs(v int32) { + o.IdleTimeoutSecs.Set(&v) +} +// SetIdleTimeoutSecsNil sets the value for IdleTimeoutSecs to be an explicit nil +func (o *ActorStandby) SetIdleTimeoutSecsNil() { + o.IdleTimeoutSecs.Set(nil) +} + +// UnsetIdleTimeoutSecs ensures that no value is present for IdleTimeoutSecs, not even an explicit nil +func (o *ActorStandby) UnsetIdleTimeoutSecs() { + o.IdleTimeoutSecs.Unset() +} + +// GetBuild returns the Build field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ActorStandby) GetBuild() string { + if o == nil || IsNil(o.Build.Get()) { + var ret string + return ret + } + return *o.Build.Get() +} + +// GetBuildOk returns a tuple with the Build field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ActorStandby) GetBuildOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Build.Get(), o.Build.IsSet() +} + +// HasBuild returns a boolean if a field has been set. +func (o *ActorStandby) HasBuild() bool { + if o != nil && o.Build.IsSet() { + return true + } + + return false +} + +// SetBuild gets a reference to the given NullableString and assigns it to the Build field. +func (o *ActorStandby) SetBuild(v string) { + o.Build.Set(&v) +} +// SetBuildNil sets the value for Build to be an explicit nil +func (o *ActorStandby) SetBuildNil() { + o.Build.Set(nil) +} + +// UnsetBuild ensures that no value is present for Build, not even an explicit nil +func (o *ActorStandby) UnsetBuild() { + o.Build.Unset() +} + +// GetMemoryMbytes returns the MemoryMbytes field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ActorStandby) GetMemoryMbytes() int32 { + if o == nil || IsNil(o.MemoryMbytes.Get()) { + var ret int32 + return ret + } + return *o.MemoryMbytes.Get() +} + +// GetMemoryMbytesOk returns a tuple with the MemoryMbytes field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ActorStandby) GetMemoryMbytesOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.MemoryMbytes.Get(), o.MemoryMbytes.IsSet() +} + +// HasMemoryMbytes returns a boolean if a field has been set. +func (o *ActorStandby) HasMemoryMbytes() bool { + if o != nil && o.MemoryMbytes.IsSet() { + return true + } + + return false +} + +// SetMemoryMbytes gets a reference to the given NullableInt32 and assigns it to the MemoryMbytes field. +func (o *ActorStandby) SetMemoryMbytes(v int32) { + o.MemoryMbytes.Set(&v) +} +// SetMemoryMbytesNil sets the value for MemoryMbytes to be an explicit nil +func (o *ActorStandby) SetMemoryMbytesNil() { + o.MemoryMbytes.Set(nil) +} + +// UnsetMemoryMbytes ensures that no value is present for MemoryMbytes, not even an explicit nil +func (o *ActorStandby) UnsetMemoryMbytes() { + o.MemoryMbytes.Unset() +} + +// GetDisableStandbyFieldsOverride returns the DisableStandbyFieldsOverride field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ActorStandby) GetDisableStandbyFieldsOverride() bool { + if o == nil || IsNil(o.DisableStandbyFieldsOverride.Get()) { + var ret bool + return ret + } + return *o.DisableStandbyFieldsOverride.Get() +} + +// GetDisableStandbyFieldsOverrideOk returns a tuple with the DisableStandbyFieldsOverride field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ActorStandby) GetDisableStandbyFieldsOverrideOk() (*bool, bool) { + if o == nil { + return nil, false + } + return o.DisableStandbyFieldsOverride.Get(), o.DisableStandbyFieldsOverride.IsSet() +} + +// HasDisableStandbyFieldsOverride returns a boolean if a field has been set. +func (o *ActorStandby) HasDisableStandbyFieldsOverride() bool { + if o != nil && o.DisableStandbyFieldsOverride.IsSet() { + return true + } + + return false +} + +// SetDisableStandbyFieldsOverride gets a reference to the given NullableBool and assigns it to the DisableStandbyFieldsOverride field. +func (o *ActorStandby) SetDisableStandbyFieldsOverride(v bool) { + o.DisableStandbyFieldsOverride.Set(&v) +} +// SetDisableStandbyFieldsOverrideNil sets the value for DisableStandbyFieldsOverride to be an explicit nil +func (o *ActorStandby) SetDisableStandbyFieldsOverrideNil() { + o.DisableStandbyFieldsOverride.Set(nil) +} + +// UnsetDisableStandbyFieldsOverride ensures that no value is present for DisableStandbyFieldsOverride, not even an explicit nil +func (o *ActorStandby) UnsetDisableStandbyFieldsOverride() { + o.DisableStandbyFieldsOverride.Unset() +} + +// GetShouldPassActorInput returns the ShouldPassActorInput field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ActorStandby) GetShouldPassActorInput() bool { + if o == nil || IsNil(o.ShouldPassActorInput.Get()) { + var ret bool + return ret + } + return *o.ShouldPassActorInput.Get() +} + +// GetShouldPassActorInputOk returns a tuple with the ShouldPassActorInput field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ActorStandby) GetShouldPassActorInputOk() (*bool, bool) { + if o == nil { + return nil, false + } + return o.ShouldPassActorInput.Get(), o.ShouldPassActorInput.IsSet() +} + +// HasShouldPassActorInput returns a boolean if a field has been set. +func (o *ActorStandby) HasShouldPassActorInput() bool { + if o != nil && o.ShouldPassActorInput.IsSet() { + return true + } + + return false +} + +// SetShouldPassActorInput gets a reference to the given NullableBool and assigns it to the ShouldPassActorInput field. +func (o *ActorStandby) SetShouldPassActorInput(v bool) { + o.ShouldPassActorInput.Set(&v) +} +// SetShouldPassActorInputNil sets the value for ShouldPassActorInput to be an explicit nil +func (o *ActorStandby) SetShouldPassActorInputNil() { + o.ShouldPassActorInput.Set(nil) +} + +// UnsetShouldPassActorInput ensures that no value is present for ShouldPassActorInput, not even an explicit nil +func (o *ActorStandby) UnsetShouldPassActorInput() { + o.ShouldPassActorInput.Unset() +} + +func (o ActorStandby) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ActorStandby) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.IsEnabled.IsSet() { + toSerialize["isEnabled"] = o.IsEnabled.Get() + } + if o.DesiredRequestsPerActorRun.IsSet() { + toSerialize["desiredRequestsPerActorRun"] = o.DesiredRequestsPerActorRun.Get() + } + if o.MaxRequestsPerActorRun.IsSet() { + toSerialize["maxRequestsPerActorRun"] = o.MaxRequestsPerActorRun.Get() + } + if o.IdleTimeoutSecs.IsSet() { + toSerialize["idleTimeoutSecs"] = o.IdleTimeoutSecs.Get() + } + if o.Build.IsSet() { + toSerialize["build"] = o.Build.Get() + } + if o.MemoryMbytes.IsSet() { + toSerialize["memoryMbytes"] = o.MemoryMbytes.Get() + } + if o.DisableStandbyFieldsOverride.IsSet() { + toSerialize["disableStandbyFieldsOverride"] = o.DisableStandbyFieldsOverride.Get() + } + if o.ShouldPassActorInput.IsSet() { + toSerialize["shouldPassActorInput"] = o.ShouldPassActorInput.Get() + } + return toSerialize, nil +} + +type NullableActorStandby struct { + value *ActorStandby + isSet bool +} + +func (v NullableActorStandby) Get() *ActorStandby { + return v.value +} + +func (v *NullableActorStandby) Set(val *ActorStandby) { + v.value = val + v.isSet = true +} + +func (v NullableActorStandby) IsSet() bool { + return v.isSet +} + +func (v *NullableActorStandby) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableActorStandby(val *ActorStandby) *NullableActorStandby { + return &NullableActorStandby{value: val, isSet: true} +} + +func (v NullableActorStandby) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableActorStandby) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_actor_stats.go b/model_actor_stats.go new file mode 100644 index 0000000..ef8a3a4 --- /dev/null +++ b/model_actor_stats.go @@ -0,0 +1,523 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" + "time" +) + +// checks if the ActorStats type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ActorStats{} + +// ActorStats struct for ActorStats +type ActorStats struct { + TotalBuilds *int32 `json:"totalBuilds,omitempty"` + TotalRuns *int32 `json:"totalRuns,omitempty"` + TotalUsers *int32 `json:"totalUsers,omitempty"` + TotalUsers7Days *int32 `json:"totalUsers7Days,omitempty"` + TotalUsers30Days *int32 `json:"totalUsers30Days,omitempty"` + TotalUsers90Days *int32 `json:"totalUsers90Days,omitempty"` + TotalMetamorphs *int32 `json:"totalMetamorphs,omitempty"` + LastRunStartedAt *time.Time `json:"lastRunStartedAt,omitempty"` + ActorReviewCount *int32 `json:"actorReviewCount,omitempty"` + ActorReviewRating *float32 `json:"actorReviewRating,omitempty"` + BookmarkCount *int32 `json:"bookmarkCount,omitempty"` + PublicActorRunStats30Days *ActorStatsPublicActorRunStats30Days `json:"publicActorRunStats30Days,omitempty"` +} + +// NewActorStats instantiates a new ActorStats object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewActorStats() *ActorStats { + this := ActorStats{} + return &this +} + +// NewActorStatsWithDefaults instantiates a new ActorStats object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewActorStatsWithDefaults() *ActorStats { + this := ActorStats{} + return &this +} + +// GetTotalBuilds returns the TotalBuilds field value if set, zero value otherwise. +func (o *ActorStats) GetTotalBuilds() int32 { + if o == nil || IsNil(o.TotalBuilds) { + var ret int32 + return ret + } + return *o.TotalBuilds +} + +// GetTotalBuildsOk returns a tuple with the TotalBuilds field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ActorStats) GetTotalBuildsOk() (*int32, bool) { + if o == nil || IsNil(o.TotalBuilds) { + return nil, false + } + return o.TotalBuilds, true +} + +// HasTotalBuilds returns a boolean if a field has been set. +func (o *ActorStats) HasTotalBuilds() bool { + if o != nil && !IsNil(o.TotalBuilds) { + return true + } + + return false +} + +// SetTotalBuilds gets a reference to the given int32 and assigns it to the TotalBuilds field. +func (o *ActorStats) SetTotalBuilds(v int32) { + o.TotalBuilds = &v +} + +// GetTotalRuns returns the TotalRuns field value if set, zero value otherwise. +func (o *ActorStats) GetTotalRuns() int32 { + if o == nil || IsNil(o.TotalRuns) { + var ret int32 + return ret + } + return *o.TotalRuns +} + +// GetTotalRunsOk returns a tuple with the TotalRuns field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ActorStats) GetTotalRunsOk() (*int32, bool) { + if o == nil || IsNil(o.TotalRuns) { + return nil, false + } + return o.TotalRuns, true +} + +// HasTotalRuns returns a boolean if a field has been set. +func (o *ActorStats) HasTotalRuns() bool { + if o != nil && !IsNil(o.TotalRuns) { + return true + } + + return false +} + +// SetTotalRuns gets a reference to the given int32 and assigns it to the TotalRuns field. +func (o *ActorStats) SetTotalRuns(v int32) { + o.TotalRuns = &v +} + +// GetTotalUsers returns the TotalUsers field value if set, zero value otherwise. +func (o *ActorStats) GetTotalUsers() int32 { + if o == nil || IsNil(o.TotalUsers) { + var ret int32 + return ret + } + return *o.TotalUsers +} + +// GetTotalUsersOk returns a tuple with the TotalUsers field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ActorStats) GetTotalUsersOk() (*int32, bool) { + if o == nil || IsNil(o.TotalUsers) { + return nil, false + } + return o.TotalUsers, true +} + +// HasTotalUsers returns a boolean if a field has been set. +func (o *ActorStats) HasTotalUsers() bool { + if o != nil && !IsNil(o.TotalUsers) { + return true + } + + return false +} + +// SetTotalUsers gets a reference to the given int32 and assigns it to the TotalUsers field. +func (o *ActorStats) SetTotalUsers(v int32) { + o.TotalUsers = &v +} + +// GetTotalUsers7Days returns the TotalUsers7Days field value if set, zero value otherwise. +func (o *ActorStats) GetTotalUsers7Days() int32 { + if o == nil || IsNil(o.TotalUsers7Days) { + var ret int32 + return ret + } + return *o.TotalUsers7Days +} + +// GetTotalUsers7DaysOk returns a tuple with the TotalUsers7Days field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ActorStats) GetTotalUsers7DaysOk() (*int32, bool) { + if o == nil || IsNil(o.TotalUsers7Days) { + return nil, false + } + return o.TotalUsers7Days, true +} + +// HasTotalUsers7Days returns a boolean if a field has been set. +func (o *ActorStats) HasTotalUsers7Days() bool { + if o != nil && !IsNil(o.TotalUsers7Days) { + return true + } + + return false +} + +// SetTotalUsers7Days gets a reference to the given int32 and assigns it to the TotalUsers7Days field. +func (o *ActorStats) SetTotalUsers7Days(v int32) { + o.TotalUsers7Days = &v +} + +// GetTotalUsers30Days returns the TotalUsers30Days field value if set, zero value otherwise. +func (o *ActorStats) GetTotalUsers30Days() int32 { + if o == nil || IsNil(o.TotalUsers30Days) { + var ret int32 + return ret + } + return *o.TotalUsers30Days +} + +// GetTotalUsers30DaysOk returns a tuple with the TotalUsers30Days field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ActorStats) GetTotalUsers30DaysOk() (*int32, bool) { + if o == nil || IsNil(o.TotalUsers30Days) { + return nil, false + } + return o.TotalUsers30Days, true +} + +// HasTotalUsers30Days returns a boolean if a field has been set. +func (o *ActorStats) HasTotalUsers30Days() bool { + if o != nil && !IsNil(o.TotalUsers30Days) { + return true + } + + return false +} + +// SetTotalUsers30Days gets a reference to the given int32 and assigns it to the TotalUsers30Days field. +func (o *ActorStats) SetTotalUsers30Days(v int32) { + o.TotalUsers30Days = &v +} + +// GetTotalUsers90Days returns the TotalUsers90Days field value if set, zero value otherwise. +func (o *ActorStats) GetTotalUsers90Days() int32 { + if o == nil || IsNil(o.TotalUsers90Days) { + var ret int32 + return ret + } + return *o.TotalUsers90Days +} + +// GetTotalUsers90DaysOk returns a tuple with the TotalUsers90Days field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ActorStats) GetTotalUsers90DaysOk() (*int32, bool) { + if o == nil || IsNil(o.TotalUsers90Days) { + return nil, false + } + return o.TotalUsers90Days, true +} + +// HasTotalUsers90Days returns a boolean if a field has been set. +func (o *ActorStats) HasTotalUsers90Days() bool { + if o != nil && !IsNil(o.TotalUsers90Days) { + return true + } + + return false +} + +// SetTotalUsers90Days gets a reference to the given int32 and assigns it to the TotalUsers90Days field. +func (o *ActorStats) SetTotalUsers90Days(v int32) { + o.TotalUsers90Days = &v +} + +// GetTotalMetamorphs returns the TotalMetamorphs field value if set, zero value otherwise. +func (o *ActorStats) GetTotalMetamorphs() int32 { + if o == nil || IsNil(o.TotalMetamorphs) { + var ret int32 + return ret + } + return *o.TotalMetamorphs +} + +// GetTotalMetamorphsOk returns a tuple with the TotalMetamorphs field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ActorStats) GetTotalMetamorphsOk() (*int32, bool) { + if o == nil || IsNil(o.TotalMetamorphs) { + return nil, false + } + return o.TotalMetamorphs, true +} + +// HasTotalMetamorphs returns a boolean if a field has been set. +func (o *ActorStats) HasTotalMetamorphs() bool { + if o != nil && !IsNil(o.TotalMetamorphs) { + return true + } + + return false +} + +// SetTotalMetamorphs gets a reference to the given int32 and assigns it to the TotalMetamorphs field. +func (o *ActorStats) SetTotalMetamorphs(v int32) { + o.TotalMetamorphs = &v +} + +// GetLastRunStartedAt returns the LastRunStartedAt field value if set, zero value otherwise. +func (o *ActorStats) GetLastRunStartedAt() time.Time { + if o == nil || IsNil(o.LastRunStartedAt) { + var ret time.Time + return ret + } + return *o.LastRunStartedAt +} + +// GetLastRunStartedAtOk returns a tuple with the LastRunStartedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ActorStats) GetLastRunStartedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.LastRunStartedAt) { + return nil, false + } + return o.LastRunStartedAt, true +} + +// HasLastRunStartedAt returns a boolean if a field has been set. +func (o *ActorStats) HasLastRunStartedAt() bool { + if o != nil && !IsNil(o.LastRunStartedAt) { + return true + } + + return false +} + +// SetLastRunStartedAt gets a reference to the given time.Time and assigns it to the LastRunStartedAt field. +func (o *ActorStats) SetLastRunStartedAt(v time.Time) { + o.LastRunStartedAt = &v +} + +// GetActorReviewCount returns the ActorReviewCount field value if set, zero value otherwise. +func (o *ActorStats) GetActorReviewCount() int32 { + if o == nil || IsNil(o.ActorReviewCount) { + var ret int32 + return ret + } + return *o.ActorReviewCount +} + +// GetActorReviewCountOk returns a tuple with the ActorReviewCount field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ActorStats) GetActorReviewCountOk() (*int32, bool) { + if o == nil || IsNil(o.ActorReviewCount) { + return nil, false + } + return o.ActorReviewCount, true +} + +// HasActorReviewCount returns a boolean if a field has been set. +func (o *ActorStats) HasActorReviewCount() bool { + if o != nil && !IsNil(o.ActorReviewCount) { + return true + } + + return false +} + +// SetActorReviewCount gets a reference to the given int32 and assigns it to the ActorReviewCount field. +func (o *ActorStats) SetActorReviewCount(v int32) { + o.ActorReviewCount = &v +} + +// GetActorReviewRating returns the ActorReviewRating field value if set, zero value otherwise. +func (o *ActorStats) GetActorReviewRating() float32 { + if o == nil || IsNil(o.ActorReviewRating) { + var ret float32 + return ret + } + return *o.ActorReviewRating +} + +// GetActorReviewRatingOk returns a tuple with the ActorReviewRating field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ActorStats) GetActorReviewRatingOk() (*float32, bool) { + if o == nil || IsNil(o.ActorReviewRating) { + return nil, false + } + return o.ActorReviewRating, true +} + +// HasActorReviewRating returns a boolean if a field has been set. +func (o *ActorStats) HasActorReviewRating() bool { + if o != nil && !IsNil(o.ActorReviewRating) { + return true + } + + return false +} + +// SetActorReviewRating gets a reference to the given float32 and assigns it to the ActorReviewRating field. +func (o *ActorStats) SetActorReviewRating(v float32) { + o.ActorReviewRating = &v +} + +// GetBookmarkCount returns the BookmarkCount field value if set, zero value otherwise. +func (o *ActorStats) GetBookmarkCount() int32 { + if o == nil || IsNil(o.BookmarkCount) { + var ret int32 + return ret + } + return *o.BookmarkCount +} + +// GetBookmarkCountOk returns a tuple with the BookmarkCount field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ActorStats) GetBookmarkCountOk() (*int32, bool) { + if o == nil || IsNil(o.BookmarkCount) { + return nil, false + } + return o.BookmarkCount, true +} + +// HasBookmarkCount returns a boolean if a field has been set. +func (o *ActorStats) HasBookmarkCount() bool { + if o != nil && !IsNil(o.BookmarkCount) { + return true + } + + return false +} + +// SetBookmarkCount gets a reference to the given int32 and assigns it to the BookmarkCount field. +func (o *ActorStats) SetBookmarkCount(v int32) { + o.BookmarkCount = &v +} + +// GetPublicActorRunStats30Days returns the PublicActorRunStats30Days field value if set, zero value otherwise. +func (o *ActorStats) GetPublicActorRunStats30Days() ActorStatsPublicActorRunStats30Days { + if o == nil || IsNil(o.PublicActorRunStats30Days) { + var ret ActorStatsPublicActorRunStats30Days + return ret + } + return *o.PublicActorRunStats30Days +} + +// GetPublicActorRunStats30DaysOk returns a tuple with the PublicActorRunStats30Days field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ActorStats) GetPublicActorRunStats30DaysOk() (*ActorStatsPublicActorRunStats30Days, bool) { + if o == nil || IsNil(o.PublicActorRunStats30Days) { + return nil, false + } + return o.PublicActorRunStats30Days, true +} + +// HasPublicActorRunStats30Days returns a boolean if a field has been set. +func (o *ActorStats) HasPublicActorRunStats30Days() bool { + if o != nil && !IsNil(o.PublicActorRunStats30Days) { + return true + } + + return false +} + +// SetPublicActorRunStats30Days gets a reference to the given ActorStatsPublicActorRunStats30Days and assigns it to the PublicActorRunStats30Days field. +func (o *ActorStats) SetPublicActorRunStats30Days(v ActorStatsPublicActorRunStats30Days) { + o.PublicActorRunStats30Days = &v +} + +func (o ActorStats) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ActorStats) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.TotalBuilds) { + toSerialize["totalBuilds"] = o.TotalBuilds + } + if !IsNil(o.TotalRuns) { + toSerialize["totalRuns"] = o.TotalRuns + } + if !IsNil(o.TotalUsers) { + toSerialize["totalUsers"] = o.TotalUsers + } + if !IsNil(o.TotalUsers7Days) { + toSerialize["totalUsers7Days"] = o.TotalUsers7Days + } + if !IsNil(o.TotalUsers30Days) { + toSerialize["totalUsers30Days"] = o.TotalUsers30Days + } + if !IsNil(o.TotalUsers90Days) { + toSerialize["totalUsers90Days"] = o.TotalUsers90Days + } + if !IsNil(o.TotalMetamorphs) { + toSerialize["totalMetamorphs"] = o.TotalMetamorphs + } + if !IsNil(o.LastRunStartedAt) { + toSerialize["lastRunStartedAt"] = o.LastRunStartedAt + } + if !IsNil(o.ActorReviewCount) { + toSerialize["actorReviewCount"] = o.ActorReviewCount + } + if !IsNil(o.ActorReviewRating) { + toSerialize["actorReviewRating"] = o.ActorReviewRating + } + if !IsNil(o.BookmarkCount) { + toSerialize["bookmarkCount"] = o.BookmarkCount + } + if !IsNil(o.PublicActorRunStats30Days) { + toSerialize["publicActorRunStats30Days"] = o.PublicActorRunStats30Days + } + return toSerialize, nil +} + +type NullableActorStats struct { + value *ActorStats + isSet bool +} + +func (v NullableActorStats) Get() *ActorStats { + return v.value +} + +func (v *NullableActorStats) Set(val *ActorStats) { + v.value = val + v.isSet = true +} + +func (v NullableActorStats) IsSet() bool { + return v.isSet +} + +func (v *NullableActorStats) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableActorStats(val *ActorStats) *NullableActorStats { + return &NullableActorStats{value: val, isSet: true} +} + +func (v NullableActorStats) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableActorStats) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_actor_stats_public_actor_run_stats30_days.go b/model_actor_stats_public_actor_run_stats30_days.go new file mode 100644 index 0000000..eb487ee --- /dev/null +++ b/model_actor_stats_public_actor_run_stats30_days.go @@ -0,0 +1,270 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" +) + +// checks if the ActorStatsPublicActorRunStats30Days type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ActorStatsPublicActorRunStats30Days{} + +// ActorStatsPublicActorRunStats30Days Run status counts over the past 30 days. +type ActorStatsPublicActorRunStats30Days struct { + ABORTED *int32 `json:"ABORTED,omitempty"` + FAILED *int32 `json:"FAILED,omitempty"` + SUCCEEDED *int32 `json:"SUCCEEDED,omitempty"` + TIMED_OUT *int32 `json:"TIMED-OUT,omitempty"` + TOTAL *int32 `json:"TOTAL,omitempty"` +} + +// NewActorStatsPublicActorRunStats30Days instantiates a new ActorStatsPublicActorRunStats30Days object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewActorStatsPublicActorRunStats30Days() *ActorStatsPublicActorRunStats30Days { + this := ActorStatsPublicActorRunStats30Days{} + return &this +} + +// NewActorStatsPublicActorRunStats30DaysWithDefaults instantiates a new ActorStatsPublicActorRunStats30Days object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewActorStatsPublicActorRunStats30DaysWithDefaults() *ActorStatsPublicActorRunStats30Days { + this := ActorStatsPublicActorRunStats30Days{} + return &this +} + +// GetABORTED returns the ABORTED field value if set, zero value otherwise. +func (o *ActorStatsPublicActorRunStats30Days) GetABORTED() int32 { + if o == nil || IsNil(o.ABORTED) { + var ret int32 + return ret + } + return *o.ABORTED +} + +// GetABORTEDOk returns a tuple with the ABORTED field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ActorStatsPublicActorRunStats30Days) GetABORTEDOk() (*int32, bool) { + if o == nil || IsNil(o.ABORTED) { + return nil, false + } + return o.ABORTED, true +} + +// HasABORTED returns a boolean if a field has been set. +func (o *ActorStatsPublicActorRunStats30Days) HasABORTED() bool { + if o != nil && !IsNil(o.ABORTED) { + return true + } + + return false +} + +// SetABORTED gets a reference to the given int32 and assigns it to the ABORTED field. +func (o *ActorStatsPublicActorRunStats30Days) SetABORTED(v int32) { + o.ABORTED = &v +} + +// GetFAILED returns the FAILED field value if set, zero value otherwise. +func (o *ActorStatsPublicActorRunStats30Days) GetFAILED() int32 { + if o == nil || IsNil(o.FAILED) { + var ret int32 + return ret + } + return *o.FAILED +} + +// GetFAILEDOk returns a tuple with the FAILED field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ActorStatsPublicActorRunStats30Days) GetFAILEDOk() (*int32, bool) { + if o == nil || IsNil(o.FAILED) { + return nil, false + } + return o.FAILED, true +} + +// HasFAILED returns a boolean if a field has been set. +func (o *ActorStatsPublicActorRunStats30Days) HasFAILED() bool { + if o != nil && !IsNil(o.FAILED) { + return true + } + + return false +} + +// SetFAILED gets a reference to the given int32 and assigns it to the FAILED field. +func (o *ActorStatsPublicActorRunStats30Days) SetFAILED(v int32) { + o.FAILED = &v +} + +// GetSUCCEEDED returns the SUCCEEDED field value if set, zero value otherwise. +func (o *ActorStatsPublicActorRunStats30Days) GetSUCCEEDED() int32 { + if o == nil || IsNil(o.SUCCEEDED) { + var ret int32 + return ret + } + return *o.SUCCEEDED +} + +// GetSUCCEEDEDOk returns a tuple with the SUCCEEDED field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ActorStatsPublicActorRunStats30Days) GetSUCCEEDEDOk() (*int32, bool) { + if o == nil || IsNil(o.SUCCEEDED) { + return nil, false + } + return o.SUCCEEDED, true +} + +// HasSUCCEEDED returns a boolean if a field has been set. +func (o *ActorStatsPublicActorRunStats30Days) HasSUCCEEDED() bool { + if o != nil && !IsNil(o.SUCCEEDED) { + return true + } + + return false +} + +// SetSUCCEEDED gets a reference to the given int32 and assigns it to the SUCCEEDED field. +func (o *ActorStatsPublicActorRunStats30Days) SetSUCCEEDED(v int32) { + o.SUCCEEDED = &v +} + +// GetTIMED_OUT returns the TIMED_OUT field value if set, zero value otherwise. +func (o *ActorStatsPublicActorRunStats30Days) GetTIMED_OUT() int32 { + if o == nil || IsNil(o.TIMED_OUT) { + var ret int32 + return ret + } + return *o.TIMED_OUT +} + +// GetTIMED_OUTOk returns a tuple with the TIMED_OUT field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ActorStatsPublicActorRunStats30Days) GetTIMED_OUTOk() (*int32, bool) { + if o == nil || IsNil(o.TIMED_OUT) { + return nil, false + } + return o.TIMED_OUT, true +} + +// HasTIMED_OUT returns a boolean if a field has been set. +func (o *ActorStatsPublicActorRunStats30Days) HasTIMED_OUT() bool { + if o != nil && !IsNil(o.TIMED_OUT) { + return true + } + + return false +} + +// SetTIMED_OUT gets a reference to the given int32 and assigns it to the TIMED_OUT field. +func (o *ActorStatsPublicActorRunStats30Days) SetTIMED_OUT(v int32) { + o.TIMED_OUT = &v +} + +// GetTOTAL returns the TOTAL field value if set, zero value otherwise. +func (o *ActorStatsPublicActorRunStats30Days) GetTOTAL() int32 { + if o == nil || IsNil(o.TOTAL) { + var ret int32 + return ret + } + return *o.TOTAL +} + +// GetTOTALOk returns a tuple with the TOTAL field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ActorStatsPublicActorRunStats30Days) GetTOTALOk() (*int32, bool) { + if o == nil || IsNil(o.TOTAL) { + return nil, false + } + return o.TOTAL, true +} + +// HasTOTAL returns a boolean if a field has been set. +func (o *ActorStatsPublicActorRunStats30Days) HasTOTAL() bool { + if o != nil && !IsNil(o.TOTAL) { + return true + } + + return false +} + +// SetTOTAL gets a reference to the given int32 and assigns it to the TOTAL field. +func (o *ActorStatsPublicActorRunStats30Days) SetTOTAL(v int32) { + o.TOTAL = &v +} + +func (o ActorStatsPublicActorRunStats30Days) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ActorStatsPublicActorRunStats30Days) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.ABORTED) { + toSerialize["ABORTED"] = o.ABORTED + } + if !IsNil(o.FAILED) { + toSerialize["FAILED"] = o.FAILED + } + if !IsNil(o.SUCCEEDED) { + toSerialize["SUCCEEDED"] = o.SUCCEEDED + } + if !IsNil(o.TIMED_OUT) { + toSerialize["TIMED-OUT"] = o.TIMED_OUT + } + if !IsNil(o.TOTAL) { + toSerialize["TOTAL"] = o.TOTAL + } + return toSerialize, nil +} + +type NullableActorStatsPublicActorRunStats30Days struct { + value *ActorStatsPublicActorRunStats30Days + isSet bool +} + +func (v NullableActorStatsPublicActorRunStats30Days) Get() *ActorStatsPublicActorRunStats30Days { + return v.value +} + +func (v *NullableActorStatsPublicActorRunStats30Days) Set(val *ActorStatsPublicActorRunStats30Days) { + v.value = val + v.isSet = true +} + +func (v NullableActorStatsPublicActorRunStats30Days) IsSet() bool { + return v.isSet +} + +func (v *NullableActorStatsPublicActorRunStats30Days) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableActorStatsPublicActorRunStats30Days(val *ActorStatsPublicActorRunStats30Days) *NullableActorStatsPublicActorRunStats30Days { + return &NullableActorStatsPublicActorRunStats30Days{value: val, isSet: true} +} + +func (v NullableActorStatsPublicActorRunStats30Days) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableActorStatsPublicActorRunStats30Days) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_actor_task_get_200_response.go b/model_actor_task_get_200_response.go new file mode 100644 index 0000000..990dee5 --- /dev/null +++ b/model_actor_task_get_200_response.go @@ -0,0 +1,158 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" + "bytes" + "fmt" +) + +// checks if the ActorTaskGet200Response type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ActorTaskGet200Response{} + +// ActorTaskGet200Response struct for ActorTaskGet200Response +type ActorTaskGet200Response struct { + Data Task `json:"data"` +} + +type _ActorTaskGet200Response ActorTaskGet200Response + +// NewActorTaskGet200Response instantiates a new ActorTaskGet200Response object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewActorTaskGet200Response(data Task) *ActorTaskGet200Response { + this := ActorTaskGet200Response{} + this.Data = data + return &this +} + +// NewActorTaskGet200ResponseWithDefaults instantiates a new ActorTaskGet200Response object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewActorTaskGet200ResponseWithDefaults() *ActorTaskGet200Response { + this := ActorTaskGet200Response{} + return &this +} + +// GetData returns the Data field value +func (o *ActorTaskGet200Response) GetData() Task { + if o == nil { + var ret Task + return ret + } + + return o.Data +} + +// GetDataOk returns a tuple with the Data field value +// and a boolean to check if the value has been set. +func (o *ActorTaskGet200Response) GetDataOk() (*Task, bool) { + if o == nil { + return nil, false + } + return &o.Data, true +} + +// SetData sets field value +func (o *ActorTaskGet200Response) SetData(v Task) { + o.Data = v +} + +func (o ActorTaskGet200Response) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ActorTaskGet200Response) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["data"] = o.Data + return toSerialize, nil +} + +func (o *ActorTaskGet200Response) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "data", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varActorTaskGet200Response := _ActorTaskGet200Response{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varActorTaskGet200Response) + + if err != nil { + return err + } + + *o = ActorTaskGet200Response(varActorTaskGet200Response) + + return err +} + +type NullableActorTaskGet200Response struct { + value *ActorTaskGet200Response + isSet bool +} + +func (v NullableActorTaskGet200Response) Get() *ActorTaskGet200Response { + return v.value +} + +func (v *NullableActorTaskGet200Response) Set(val *ActorTaskGet200Response) { + v.value = val + v.isSet = true +} + +func (v NullableActorTaskGet200Response) IsSet() bool { + return v.isSet +} + +func (v *NullableActorTaskGet200Response) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableActorTaskGet200Response(val *ActorTaskGet200Response) *NullableActorTaskGet200Response { + return &NullableActorTaskGet200Response{value: val, isSet: true} +} + +func (v NullableActorTaskGet200Response) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableActorTaskGet200Response) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_actor_task_runs_get_200_response.go b/model_actor_task_runs_get_200_response.go new file mode 100644 index 0000000..9ffded6 --- /dev/null +++ b/model_actor_task_runs_get_200_response.go @@ -0,0 +1,158 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" + "bytes" + "fmt" +) + +// checks if the ActorTaskRunsGet200Response type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ActorTaskRunsGet200Response{} + +// ActorTaskRunsGet200Response struct for ActorTaskRunsGet200Response +type ActorTaskRunsGet200Response struct { + Data ActorTaskRunsGet200ResponseData `json:"data"` +} + +type _ActorTaskRunsGet200Response ActorTaskRunsGet200Response + +// NewActorTaskRunsGet200Response instantiates a new ActorTaskRunsGet200Response object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewActorTaskRunsGet200Response(data ActorTaskRunsGet200ResponseData) *ActorTaskRunsGet200Response { + this := ActorTaskRunsGet200Response{} + this.Data = data + return &this +} + +// NewActorTaskRunsGet200ResponseWithDefaults instantiates a new ActorTaskRunsGet200Response object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewActorTaskRunsGet200ResponseWithDefaults() *ActorTaskRunsGet200Response { + this := ActorTaskRunsGet200Response{} + return &this +} + +// GetData returns the Data field value +func (o *ActorTaskRunsGet200Response) GetData() ActorTaskRunsGet200ResponseData { + if o == nil { + var ret ActorTaskRunsGet200ResponseData + return ret + } + + return o.Data +} + +// GetDataOk returns a tuple with the Data field value +// and a boolean to check if the value has been set. +func (o *ActorTaskRunsGet200Response) GetDataOk() (*ActorTaskRunsGet200ResponseData, bool) { + if o == nil { + return nil, false + } + return &o.Data, true +} + +// SetData sets field value +func (o *ActorTaskRunsGet200Response) SetData(v ActorTaskRunsGet200ResponseData) { + o.Data = v +} + +func (o ActorTaskRunsGet200Response) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ActorTaskRunsGet200Response) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["data"] = o.Data + return toSerialize, nil +} + +func (o *ActorTaskRunsGet200Response) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "data", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varActorTaskRunsGet200Response := _ActorTaskRunsGet200Response{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varActorTaskRunsGet200Response) + + if err != nil { + return err + } + + *o = ActorTaskRunsGet200Response(varActorTaskRunsGet200Response) + + return err +} + +type NullableActorTaskRunsGet200Response struct { + value *ActorTaskRunsGet200Response + isSet bool +} + +func (v NullableActorTaskRunsGet200Response) Get() *ActorTaskRunsGet200Response { + return v.value +} + +func (v *NullableActorTaskRunsGet200Response) Set(val *ActorTaskRunsGet200Response) { + v.value = val + v.isSet = true +} + +func (v NullableActorTaskRunsGet200Response) IsSet() bool { + return v.isSet +} + +func (v *NullableActorTaskRunsGet200Response) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableActorTaskRunsGet200Response(val *ActorTaskRunsGet200Response) *NullableActorTaskRunsGet200Response { + return &NullableActorTaskRunsGet200Response{value: val, isSet: true} +} + +func (v NullableActorTaskRunsGet200Response) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableActorTaskRunsGet200Response) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_actor_task_runs_get_200_response_data.go b/model_actor_task_runs_get_200_response_data.go new file mode 100644 index 0000000..7d53ade --- /dev/null +++ b/model_actor_task_runs_get_200_response_data.go @@ -0,0 +1,303 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" + "bytes" + "fmt" +) + +// checks if the ActorTaskRunsGet200ResponseData type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ActorTaskRunsGet200ResponseData{} + +// ActorTaskRunsGet200ResponseData struct for ActorTaskRunsGet200ResponseData +type ActorTaskRunsGet200ResponseData struct { + // The total number of items available across all pages. + Total int32 `json:"total"` + // The starting position for this page of results. + Offset int32 `json:"offset"` + // The maximum number of items returned per page. + Limit int32 `json:"limit"` + // Whether the results are sorted in descending order. + Desc bool `json:"desc"` + // The number of items returned in this response. + Count int32 `json:"count"` + Items []RunShort `json:"items"` +} + +type _ActorTaskRunsGet200ResponseData ActorTaskRunsGet200ResponseData + +// NewActorTaskRunsGet200ResponseData instantiates a new ActorTaskRunsGet200ResponseData object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewActorTaskRunsGet200ResponseData(total int32, offset int32, limit int32, desc bool, count int32, items []RunShort) *ActorTaskRunsGet200ResponseData { + this := ActorTaskRunsGet200ResponseData{} + this.Total = total + this.Offset = offset + this.Limit = limit + this.Desc = desc + this.Count = count + this.Items = items + return &this +} + +// NewActorTaskRunsGet200ResponseDataWithDefaults instantiates a new ActorTaskRunsGet200ResponseData object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewActorTaskRunsGet200ResponseDataWithDefaults() *ActorTaskRunsGet200ResponseData { + this := ActorTaskRunsGet200ResponseData{} + return &this +} + +// GetTotal returns the Total field value +func (o *ActorTaskRunsGet200ResponseData) GetTotal() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Total +} + +// GetTotalOk returns a tuple with the Total field value +// and a boolean to check if the value has been set. +func (o *ActorTaskRunsGet200ResponseData) GetTotalOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Total, true +} + +// SetTotal sets field value +func (o *ActorTaskRunsGet200ResponseData) SetTotal(v int32) { + o.Total = v +} + +// GetOffset returns the Offset field value +func (o *ActorTaskRunsGet200ResponseData) GetOffset() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Offset +} + +// GetOffsetOk returns a tuple with the Offset field value +// and a boolean to check if the value has been set. +func (o *ActorTaskRunsGet200ResponseData) GetOffsetOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Offset, true +} + +// SetOffset sets field value +func (o *ActorTaskRunsGet200ResponseData) SetOffset(v int32) { + o.Offset = v +} + +// GetLimit returns the Limit field value +func (o *ActorTaskRunsGet200ResponseData) GetLimit() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Limit +} + +// GetLimitOk returns a tuple with the Limit field value +// and a boolean to check if the value has been set. +func (o *ActorTaskRunsGet200ResponseData) GetLimitOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Limit, true +} + +// SetLimit sets field value +func (o *ActorTaskRunsGet200ResponseData) SetLimit(v int32) { + o.Limit = v +} + +// GetDesc returns the Desc field value +func (o *ActorTaskRunsGet200ResponseData) GetDesc() bool { + if o == nil { + var ret bool + return ret + } + + return o.Desc +} + +// GetDescOk returns a tuple with the Desc field value +// and a boolean to check if the value has been set. +func (o *ActorTaskRunsGet200ResponseData) GetDescOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.Desc, true +} + +// SetDesc sets field value +func (o *ActorTaskRunsGet200ResponseData) SetDesc(v bool) { + o.Desc = v +} + +// GetCount returns the Count field value +func (o *ActorTaskRunsGet200ResponseData) GetCount() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Count +} + +// GetCountOk returns a tuple with the Count field value +// and a boolean to check if the value has been set. +func (o *ActorTaskRunsGet200ResponseData) GetCountOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Count, true +} + +// SetCount sets field value +func (o *ActorTaskRunsGet200ResponseData) SetCount(v int32) { + o.Count = v +} + +// GetItems returns the Items field value +func (o *ActorTaskRunsGet200ResponseData) GetItems() []RunShort { + if o == nil { + var ret []RunShort + return ret + } + + return o.Items +} + +// GetItemsOk returns a tuple with the Items field value +// and a boolean to check if the value has been set. +func (o *ActorTaskRunsGet200ResponseData) GetItemsOk() ([]RunShort, bool) { + if o == nil { + return nil, false + } + return o.Items, true +} + +// SetItems sets field value +func (o *ActorTaskRunsGet200ResponseData) SetItems(v []RunShort) { + o.Items = v +} + +func (o ActorTaskRunsGet200ResponseData) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ActorTaskRunsGet200ResponseData) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["total"] = o.Total + toSerialize["offset"] = o.Offset + toSerialize["limit"] = o.Limit + toSerialize["desc"] = o.Desc + toSerialize["count"] = o.Count + toSerialize["items"] = o.Items + return toSerialize, nil +} + +func (o *ActorTaskRunsGet200ResponseData) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "total", + "offset", + "limit", + "desc", + "count", + "items", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varActorTaskRunsGet200ResponseData := _ActorTaskRunsGet200ResponseData{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varActorTaskRunsGet200ResponseData) + + if err != nil { + return err + } + + *o = ActorTaskRunsGet200ResponseData(varActorTaskRunsGet200ResponseData) + + return err +} + +type NullableActorTaskRunsGet200ResponseData struct { + value *ActorTaskRunsGet200ResponseData + isSet bool +} + +func (v NullableActorTaskRunsGet200ResponseData) Get() *ActorTaskRunsGet200ResponseData { + return v.value +} + +func (v *NullableActorTaskRunsGet200ResponseData) Set(val *ActorTaskRunsGet200ResponseData) { + v.value = val + v.isSet = true +} + +func (v NullableActorTaskRunsGet200ResponseData) IsSet() bool { + return v.isSet +} + +func (v *NullableActorTaskRunsGet200ResponseData) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableActorTaskRunsGet200ResponseData(val *ActorTaskRunsGet200ResponseData) *NullableActorTaskRunsGet200ResponseData { + return &NullableActorTaskRunsGet200ResponseData{value: val, isSet: true} +} + +func (v NullableActorTaskRunsGet200ResponseData) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableActorTaskRunsGet200ResponseData) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_actor_task_runs_post_201_response.go b/model_actor_task_runs_post_201_response.go new file mode 100644 index 0000000..ec29890 --- /dev/null +++ b/model_actor_task_runs_post_201_response.go @@ -0,0 +1,158 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" + "bytes" + "fmt" +) + +// checks if the ActorTaskRunsPost201Response type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ActorTaskRunsPost201Response{} + +// ActorTaskRunsPost201Response struct for ActorTaskRunsPost201Response +type ActorTaskRunsPost201Response struct { + Data Run `json:"data"` +} + +type _ActorTaskRunsPost201Response ActorTaskRunsPost201Response + +// NewActorTaskRunsPost201Response instantiates a new ActorTaskRunsPost201Response object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewActorTaskRunsPost201Response(data Run) *ActorTaskRunsPost201Response { + this := ActorTaskRunsPost201Response{} + this.Data = data + return &this +} + +// NewActorTaskRunsPost201ResponseWithDefaults instantiates a new ActorTaskRunsPost201Response object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewActorTaskRunsPost201ResponseWithDefaults() *ActorTaskRunsPost201Response { + this := ActorTaskRunsPost201Response{} + return &this +} + +// GetData returns the Data field value +func (o *ActorTaskRunsPost201Response) GetData() Run { + if o == nil { + var ret Run + return ret + } + + return o.Data +} + +// GetDataOk returns a tuple with the Data field value +// and a boolean to check if the value has been set. +func (o *ActorTaskRunsPost201Response) GetDataOk() (*Run, bool) { + if o == nil { + return nil, false + } + return &o.Data, true +} + +// SetData sets field value +func (o *ActorTaskRunsPost201Response) SetData(v Run) { + o.Data = v +} + +func (o ActorTaskRunsPost201Response) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ActorTaskRunsPost201Response) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["data"] = o.Data + return toSerialize, nil +} + +func (o *ActorTaskRunsPost201Response) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "data", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varActorTaskRunsPost201Response := _ActorTaskRunsPost201Response{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varActorTaskRunsPost201Response) + + if err != nil { + return err + } + + *o = ActorTaskRunsPost201Response(varActorTaskRunsPost201Response) + + return err +} + +type NullableActorTaskRunsPost201Response struct { + value *ActorTaskRunsPost201Response + isSet bool +} + +func (v NullableActorTaskRunsPost201Response) Get() *ActorTaskRunsPost201Response { + return v.value +} + +func (v *NullableActorTaskRunsPost201Response) Set(val *ActorTaskRunsPost201Response) { + v.value = val + v.isSet = true +} + +func (v NullableActorTaskRunsPost201Response) IsSet() bool { + return v.isSet +} + +func (v *NullableActorTaskRunsPost201Response) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableActorTaskRunsPost201Response(val *ActorTaskRunsPost201Response) *NullableActorTaskRunsPost201Response { + return &NullableActorTaskRunsPost201Response{value: val, isSet: true} +} + +func (v NullableActorTaskRunsPost201Response) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableActorTaskRunsPost201Response) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_actor_task_webhooks_get_200_response.go b/model_actor_task_webhooks_get_200_response.go new file mode 100644 index 0000000..8a4f793 --- /dev/null +++ b/model_actor_task_webhooks_get_200_response.go @@ -0,0 +1,158 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" + "bytes" + "fmt" +) + +// checks if the ActorTaskWebhooksGet200Response type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ActorTaskWebhooksGet200Response{} + +// ActorTaskWebhooksGet200Response struct for ActorTaskWebhooksGet200Response +type ActorTaskWebhooksGet200Response struct { + Data ActorTaskWebhooksGet200ResponseData `json:"data"` +} + +type _ActorTaskWebhooksGet200Response ActorTaskWebhooksGet200Response + +// NewActorTaskWebhooksGet200Response instantiates a new ActorTaskWebhooksGet200Response object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewActorTaskWebhooksGet200Response(data ActorTaskWebhooksGet200ResponseData) *ActorTaskWebhooksGet200Response { + this := ActorTaskWebhooksGet200Response{} + this.Data = data + return &this +} + +// NewActorTaskWebhooksGet200ResponseWithDefaults instantiates a new ActorTaskWebhooksGet200Response object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewActorTaskWebhooksGet200ResponseWithDefaults() *ActorTaskWebhooksGet200Response { + this := ActorTaskWebhooksGet200Response{} + return &this +} + +// GetData returns the Data field value +func (o *ActorTaskWebhooksGet200Response) GetData() ActorTaskWebhooksGet200ResponseData { + if o == nil { + var ret ActorTaskWebhooksGet200ResponseData + return ret + } + + return o.Data +} + +// GetDataOk returns a tuple with the Data field value +// and a boolean to check if the value has been set. +func (o *ActorTaskWebhooksGet200Response) GetDataOk() (*ActorTaskWebhooksGet200ResponseData, bool) { + if o == nil { + return nil, false + } + return &o.Data, true +} + +// SetData sets field value +func (o *ActorTaskWebhooksGet200Response) SetData(v ActorTaskWebhooksGet200ResponseData) { + o.Data = v +} + +func (o ActorTaskWebhooksGet200Response) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ActorTaskWebhooksGet200Response) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["data"] = o.Data + return toSerialize, nil +} + +func (o *ActorTaskWebhooksGet200Response) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "data", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varActorTaskWebhooksGet200Response := _ActorTaskWebhooksGet200Response{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varActorTaskWebhooksGet200Response) + + if err != nil { + return err + } + + *o = ActorTaskWebhooksGet200Response(varActorTaskWebhooksGet200Response) + + return err +} + +type NullableActorTaskWebhooksGet200Response struct { + value *ActorTaskWebhooksGet200Response + isSet bool +} + +func (v NullableActorTaskWebhooksGet200Response) Get() *ActorTaskWebhooksGet200Response { + return v.value +} + +func (v *NullableActorTaskWebhooksGet200Response) Set(val *ActorTaskWebhooksGet200Response) { + v.value = val + v.isSet = true +} + +func (v NullableActorTaskWebhooksGet200Response) IsSet() bool { + return v.isSet +} + +func (v *NullableActorTaskWebhooksGet200Response) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableActorTaskWebhooksGet200Response(val *ActorTaskWebhooksGet200Response) *NullableActorTaskWebhooksGet200Response { + return &NullableActorTaskWebhooksGet200Response{value: val, isSet: true} +} + +func (v NullableActorTaskWebhooksGet200Response) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableActorTaskWebhooksGet200Response) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_actor_task_webhooks_get_200_response_data.go b/model_actor_task_webhooks_get_200_response_data.go new file mode 100644 index 0000000..055f3f9 --- /dev/null +++ b/model_actor_task_webhooks_get_200_response_data.go @@ -0,0 +1,303 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" + "bytes" + "fmt" +) + +// checks if the ActorTaskWebhooksGet200ResponseData type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ActorTaskWebhooksGet200ResponseData{} + +// ActorTaskWebhooksGet200ResponseData struct for ActorTaskWebhooksGet200ResponseData +type ActorTaskWebhooksGet200ResponseData struct { + // The total number of items available across all pages. + Total int32 `json:"total"` + // The starting position for this page of results. + Offset int32 `json:"offset"` + // The maximum number of items returned per page. + Limit int32 `json:"limit"` + // Whether the results are sorted in descending order. + Desc bool `json:"desc"` + // The number of items returned in this response. + Count int32 `json:"count"` + Items []Webhook `json:"items"` +} + +type _ActorTaskWebhooksGet200ResponseData ActorTaskWebhooksGet200ResponseData + +// NewActorTaskWebhooksGet200ResponseData instantiates a new ActorTaskWebhooksGet200ResponseData object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewActorTaskWebhooksGet200ResponseData(total int32, offset int32, limit int32, desc bool, count int32, items []Webhook) *ActorTaskWebhooksGet200ResponseData { + this := ActorTaskWebhooksGet200ResponseData{} + this.Total = total + this.Offset = offset + this.Limit = limit + this.Desc = desc + this.Count = count + this.Items = items + return &this +} + +// NewActorTaskWebhooksGet200ResponseDataWithDefaults instantiates a new ActorTaskWebhooksGet200ResponseData object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewActorTaskWebhooksGet200ResponseDataWithDefaults() *ActorTaskWebhooksGet200ResponseData { + this := ActorTaskWebhooksGet200ResponseData{} + return &this +} + +// GetTotal returns the Total field value +func (o *ActorTaskWebhooksGet200ResponseData) GetTotal() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Total +} + +// GetTotalOk returns a tuple with the Total field value +// and a boolean to check if the value has been set. +func (o *ActorTaskWebhooksGet200ResponseData) GetTotalOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Total, true +} + +// SetTotal sets field value +func (o *ActorTaskWebhooksGet200ResponseData) SetTotal(v int32) { + o.Total = v +} + +// GetOffset returns the Offset field value +func (o *ActorTaskWebhooksGet200ResponseData) GetOffset() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Offset +} + +// GetOffsetOk returns a tuple with the Offset field value +// and a boolean to check if the value has been set. +func (o *ActorTaskWebhooksGet200ResponseData) GetOffsetOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Offset, true +} + +// SetOffset sets field value +func (o *ActorTaskWebhooksGet200ResponseData) SetOffset(v int32) { + o.Offset = v +} + +// GetLimit returns the Limit field value +func (o *ActorTaskWebhooksGet200ResponseData) GetLimit() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Limit +} + +// GetLimitOk returns a tuple with the Limit field value +// and a boolean to check if the value has been set. +func (o *ActorTaskWebhooksGet200ResponseData) GetLimitOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Limit, true +} + +// SetLimit sets field value +func (o *ActorTaskWebhooksGet200ResponseData) SetLimit(v int32) { + o.Limit = v +} + +// GetDesc returns the Desc field value +func (o *ActorTaskWebhooksGet200ResponseData) GetDesc() bool { + if o == nil { + var ret bool + return ret + } + + return o.Desc +} + +// GetDescOk returns a tuple with the Desc field value +// and a boolean to check if the value has been set. +func (o *ActorTaskWebhooksGet200ResponseData) GetDescOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.Desc, true +} + +// SetDesc sets field value +func (o *ActorTaskWebhooksGet200ResponseData) SetDesc(v bool) { + o.Desc = v +} + +// GetCount returns the Count field value +func (o *ActorTaskWebhooksGet200ResponseData) GetCount() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Count +} + +// GetCountOk returns a tuple with the Count field value +// and a boolean to check if the value has been set. +func (o *ActorTaskWebhooksGet200ResponseData) GetCountOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Count, true +} + +// SetCount sets field value +func (o *ActorTaskWebhooksGet200ResponseData) SetCount(v int32) { + o.Count = v +} + +// GetItems returns the Items field value +func (o *ActorTaskWebhooksGet200ResponseData) GetItems() []Webhook { + if o == nil { + var ret []Webhook + return ret + } + + return o.Items +} + +// GetItemsOk returns a tuple with the Items field value +// and a boolean to check if the value has been set. +func (o *ActorTaskWebhooksGet200ResponseData) GetItemsOk() ([]Webhook, bool) { + if o == nil { + return nil, false + } + return o.Items, true +} + +// SetItems sets field value +func (o *ActorTaskWebhooksGet200ResponseData) SetItems(v []Webhook) { + o.Items = v +} + +func (o ActorTaskWebhooksGet200ResponseData) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ActorTaskWebhooksGet200ResponseData) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["total"] = o.Total + toSerialize["offset"] = o.Offset + toSerialize["limit"] = o.Limit + toSerialize["desc"] = o.Desc + toSerialize["count"] = o.Count + toSerialize["items"] = o.Items + return toSerialize, nil +} + +func (o *ActorTaskWebhooksGet200ResponseData) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "total", + "offset", + "limit", + "desc", + "count", + "items", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varActorTaskWebhooksGet200ResponseData := _ActorTaskWebhooksGet200ResponseData{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varActorTaskWebhooksGet200ResponseData) + + if err != nil { + return err + } + + *o = ActorTaskWebhooksGet200ResponseData(varActorTaskWebhooksGet200ResponseData) + + return err +} + +type NullableActorTaskWebhooksGet200ResponseData struct { + value *ActorTaskWebhooksGet200ResponseData + isSet bool +} + +func (v NullableActorTaskWebhooksGet200ResponseData) Get() *ActorTaskWebhooksGet200ResponseData { + return v.value +} + +func (v *NullableActorTaskWebhooksGet200ResponseData) Set(val *ActorTaskWebhooksGet200ResponseData) { + v.value = val + v.isSet = true +} + +func (v NullableActorTaskWebhooksGet200ResponseData) IsSet() bool { + return v.isSet +} + +func (v *NullableActorTaskWebhooksGet200ResponseData) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableActorTaskWebhooksGet200ResponseData(val *ActorTaskWebhooksGet200ResponseData) *NullableActorTaskWebhooksGet200ResponseData { + return &NullableActorTaskWebhooksGet200ResponseData{value: val, isSet: true} +} + +func (v NullableActorTaskWebhooksGet200ResponseData) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableActorTaskWebhooksGet200ResponseData) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_add_request_response.go b/model_add_request_response.go new file mode 100644 index 0000000..70dd710 --- /dev/null +++ b/model_add_request_response.go @@ -0,0 +1,158 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" + "bytes" + "fmt" +) + +// checks if the AddRequestResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &AddRequestResponse{} + +// AddRequestResponse Response containing the result of adding a request to the request queue. +type AddRequestResponse struct { + Data RequestRegistration `json:"data"` +} + +type _AddRequestResponse AddRequestResponse + +// NewAddRequestResponse instantiates a new AddRequestResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewAddRequestResponse(data RequestRegistration) *AddRequestResponse { + this := AddRequestResponse{} + this.Data = data + return &this +} + +// NewAddRequestResponseWithDefaults instantiates a new AddRequestResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewAddRequestResponseWithDefaults() *AddRequestResponse { + this := AddRequestResponse{} + return &this +} + +// GetData returns the Data field value +func (o *AddRequestResponse) GetData() RequestRegistration { + if o == nil { + var ret RequestRegistration + return ret + } + + return o.Data +} + +// GetDataOk returns a tuple with the Data field value +// and a boolean to check if the value has been set. +func (o *AddRequestResponse) GetDataOk() (*RequestRegistration, bool) { + if o == nil { + return nil, false + } + return &o.Data, true +} + +// SetData sets field value +func (o *AddRequestResponse) SetData(v RequestRegistration) { + o.Data = v +} + +func (o AddRequestResponse) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o AddRequestResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["data"] = o.Data + return toSerialize, nil +} + +func (o *AddRequestResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "data", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varAddRequestResponse := _AddRequestResponse{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varAddRequestResponse) + + if err != nil { + return err + } + + *o = AddRequestResponse(varAddRequestResponse) + + return err +} + +type NullableAddRequestResponse struct { + value *AddRequestResponse + isSet bool +} + +func (v NullableAddRequestResponse) Get() *AddRequestResponse { + return v.value +} + +func (v *NullableAddRequestResponse) Set(val *AddRequestResponse) { + v.value = val + v.isSet = true +} + +func (v NullableAddRequestResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableAddRequestResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAddRequestResponse(val *AddRequestResponse) *NullableAddRequestResponse { + return &NullableAddRequestResponse{value: val, isSet: true} +} + +func (v NullableAddRequestResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAddRequestResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_added_request.go b/model_added_request.go new file mode 100644 index 0000000..1dfc64a --- /dev/null +++ b/model_added_request.go @@ -0,0 +1,246 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" + "bytes" + "fmt" +) + +// checks if the AddedRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &AddedRequest{} + +// AddedRequest Information about a request that was successfully added to a request queue. +type AddedRequest struct { + // A unique identifier assigned to the request. + RequestId string `json:"requestId"` + // A unique key used for request de-duplication. Requests with the same unique key are considered identical. + UniqueKey string `json:"uniqueKey"` + // Indicates whether a request with the same unique key already existed in the request queue. If true, no new request was created. + WasAlreadyPresent bool `json:"wasAlreadyPresent"` + // Indicates whether a request with the same unique key has already been processed by the request queue. + WasAlreadyHandled bool `json:"wasAlreadyHandled"` +} + +type _AddedRequest AddedRequest + +// NewAddedRequest instantiates a new AddedRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewAddedRequest(requestId string, uniqueKey string, wasAlreadyPresent bool, wasAlreadyHandled bool) *AddedRequest { + this := AddedRequest{} + this.RequestId = requestId + this.UniqueKey = uniqueKey + this.WasAlreadyPresent = wasAlreadyPresent + this.WasAlreadyHandled = wasAlreadyHandled + return &this +} + +// NewAddedRequestWithDefaults instantiates a new AddedRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewAddedRequestWithDefaults() *AddedRequest { + this := AddedRequest{} + return &this +} + +// GetRequestId returns the RequestId field value +func (o *AddedRequest) GetRequestId() string { + if o == nil { + var ret string + return ret + } + + return o.RequestId +} + +// GetRequestIdOk returns a tuple with the RequestId field value +// and a boolean to check if the value has been set. +func (o *AddedRequest) GetRequestIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.RequestId, true +} + +// SetRequestId sets field value +func (o *AddedRequest) SetRequestId(v string) { + o.RequestId = v +} + +// GetUniqueKey returns the UniqueKey field value +func (o *AddedRequest) GetUniqueKey() string { + if o == nil { + var ret string + return ret + } + + return o.UniqueKey +} + +// GetUniqueKeyOk returns a tuple with the UniqueKey field value +// and a boolean to check if the value has been set. +func (o *AddedRequest) GetUniqueKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.UniqueKey, true +} + +// SetUniqueKey sets field value +func (o *AddedRequest) SetUniqueKey(v string) { + o.UniqueKey = v +} + +// GetWasAlreadyPresent returns the WasAlreadyPresent field value +func (o *AddedRequest) GetWasAlreadyPresent() bool { + if o == nil { + var ret bool + return ret + } + + return o.WasAlreadyPresent +} + +// GetWasAlreadyPresentOk returns a tuple with the WasAlreadyPresent field value +// and a boolean to check if the value has been set. +func (o *AddedRequest) GetWasAlreadyPresentOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.WasAlreadyPresent, true +} + +// SetWasAlreadyPresent sets field value +func (o *AddedRequest) SetWasAlreadyPresent(v bool) { + o.WasAlreadyPresent = v +} + +// GetWasAlreadyHandled returns the WasAlreadyHandled field value +func (o *AddedRequest) GetWasAlreadyHandled() bool { + if o == nil { + var ret bool + return ret + } + + return o.WasAlreadyHandled +} + +// GetWasAlreadyHandledOk returns a tuple with the WasAlreadyHandled field value +// and a boolean to check if the value has been set. +func (o *AddedRequest) GetWasAlreadyHandledOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.WasAlreadyHandled, true +} + +// SetWasAlreadyHandled sets field value +func (o *AddedRequest) SetWasAlreadyHandled(v bool) { + o.WasAlreadyHandled = v +} + +func (o AddedRequest) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o AddedRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["requestId"] = o.RequestId + toSerialize["uniqueKey"] = o.UniqueKey + toSerialize["wasAlreadyPresent"] = o.WasAlreadyPresent + toSerialize["wasAlreadyHandled"] = o.WasAlreadyHandled + return toSerialize, nil +} + +func (o *AddedRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "requestId", + "uniqueKey", + "wasAlreadyPresent", + "wasAlreadyHandled", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varAddedRequest := _AddedRequest{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varAddedRequest) + + if err != nil { + return err + } + + *o = AddedRequest(varAddedRequest) + + return err +} + +type NullableAddedRequest struct { + value *AddedRequest + isSet bool +} + +func (v NullableAddedRequest) Get() *AddedRequest { + return v.value +} + +func (v *NullableAddedRequest) Set(val *AddedRequest) { + v.value = val + v.isSet = true +} + +func (v NullableAddedRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableAddedRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAddedRequest(val *AddedRequest) *NullableAddedRequest { + return &NullableAddedRequest{value: val, isSet: true} +} + +func (v NullableAddedRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAddedRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_batch_add_response.go b/model_batch_add_response.go new file mode 100644 index 0000000..b54037f --- /dev/null +++ b/model_batch_add_response.go @@ -0,0 +1,158 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" + "bytes" + "fmt" +) + +// checks if the BatchAddResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &BatchAddResponse{} + +// BatchAddResponse Response containing the result of a batch add operation. +type BatchAddResponse struct { + Data BatchAddResult `json:"data"` +} + +type _BatchAddResponse BatchAddResponse + +// NewBatchAddResponse instantiates a new BatchAddResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewBatchAddResponse(data BatchAddResult) *BatchAddResponse { + this := BatchAddResponse{} + this.Data = data + return &this +} + +// NewBatchAddResponseWithDefaults instantiates a new BatchAddResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewBatchAddResponseWithDefaults() *BatchAddResponse { + this := BatchAddResponse{} + return &this +} + +// GetData returns the Data field value +func (o *BatchAddResponse) GetData() BatchAddResult { + if o == nil { + var ret BatchAddResult + return ret + } + + return o.Data +} + +// GetDataOk returns a tuple with the Data field value +// and a boolean to check if the value has been set. +func (o *BatchAddResponse) GetDataOk() (*BatchAddResult, bool) { + if o == nil { + return nil, false + } + return &o.Data, true +} + +// SetData sets field value +func (o *BatchAddResponse) SetData(v BatchAddResult) { + o.Data = v +} + +func (o BatchAddResponse) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o BatchAddResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["data"] = o.Data + return toSerialize, nil +} + +func (o *BatchAddResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "data", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varBatchAddResponse := _BatchAddResponse{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varBatchAddResponse) + + if err != nil { + return err + } + + *o = BatchAddResponse(varBatchAddResponse) + + return err +} + +type NullableBatchAddResponse struct { + value *BatchAddResponse + isSet bool +} + +func (v NullableBatchAddResponse) Get() *BatchAddResponse { + return v.value +} + +func (v *NullableBatchAddResponse) Set(val *BatchAddResponse) { + v.value = val + v.isSet = true +} + +func (v NullableBatchAddResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableBatchAddResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBatchAddResponse(val *BatchAddResponse) *NullableBatchAddResponse { + return &NullableBatchAddResponse{value: val, isSet: true} +} + +func (v NullableBatchAddResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBatchAddResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_batch_add_result.go b/model_batch_add_result.go new file mode 100644 index 0000000..f79335b --- /dev/null +++ b/model_batch_add_result.go @@ -0,0 +1,188 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" + "bytes" + "fmt" +) + +// checks if the BatchAddResult type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &BatchAddResult{} + +// BatchAddResult Result of a batch add operation containing successfully processed and failed requests. +type BatchAddResult struct { + // Requests that were successfully added to the request queue. + ProcessedRequests []AddedRequest `json:"processedRequests"` + // Requests that failed to be added and can be retried. + UnprocessedRequests []RequestDraft `json:"unprocessedRequests"` +} + +type _BatchAddResult BatchAddResult + +// NewBatchAddResult instantiates a new BatchAddResult object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewBatchAddResult(processedRequests []AddedRequest, unprocessedRequests []RequestDraft) *BatchAddResult { + this := BatchAddResult{} + this.ProcessedRequests = processedRequests + this.UnprocessedRequests = unprocessedRequests + return &this +} + +// NewBatchAddResultWithDefaults instantiates a new BatchAddResult object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewBatchAddResultWithDefaults() *BatchAddResult { + this := BatchAddResult{} + return &this +} + +// GetProcessedRequests returns the ProcessedRequests field value +func (o *BatchAddResult) GetProcessedRequests() []AddedRequest { + if o == nil { + var ret []AddedRequest + return ret + } + + return o.ProcessedRequests +} + +// GetProcessedRequestsOk returns a tuple with the ProcessedRequests field value +// and a boolean to check if the value has been set. +func (o *BatchAddResult) GetProcessedRequestsOk() ([]AddedRequest, bool) { + if o == nil { + return nil, false + } + return o.ProcessedRequests, true +} + +// SetProcessedRequests sets field value +func (o *BatchAddResult) SetProcessedRequests(v []AddedRequest) { + o.ProcessedRequests = v +} + +// GetUnprocessedRequests returns the UnprocessedRequests field value +func (o *BatchAddResult) GetUnprocessedRequests() []RequestDraft { + if o == nil { + var ret []RequestDraft + return ret + } + + return o.UnprocessedRequests +} + +// GetUnprocessedRequestsOk returns a tuple with the UnprocessedRequests field value +// and a boolean to check if the value has been set. +func (o *BatchAddResult) GetUnprocessedRequestsOk() ([]RequestDraft, bool) { + if o == nil { + return nil, false + } + return o.UnprocessedRequests, true +} + +// SetUnprocessedRequests sets field value +func (o *BatchAddResult) SetUnprocessedRequests(v []RequestDraft) { + o.UnprocessedRequests = v +} + +func (o BatchAddResult) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o BatchAddResult) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["processedRequests"] = o.ProcessedRequests + toSerialize["unprocessedRequests"] = o.UnprocessedRequests + return toSerialize, nil +} + +func (o *BatchAddResult) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "processedRequests", + "unprocessedRequests", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varBatchAddResult := _BatchAddResult{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varBatchAddResult) + + if err != nil { + return err + } + + *o = BatchAddResult(varBatchAddResult) + + return err +} + +type NullableBatchAddResult struct { + value *BatchAddResult + isSet bool +} + +func (v NullableBatchAddResult) Get() *BatchAddResult { + return v.value +} + +func (v *NullableBatchAddResult) Set(val *BatchAddResult) { + v.value = val + v.isSet = true +} + +func (v NullableBatchAddResult) IsSet() bool { + return v.isSet +} + +func (v *NullableBatchAddResult) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBatchAddResult(val *BatchAddResult) *NullableBatchAddResult { + return &NullableBatchAddResult{value: val, isSet: true} +} + +func (v NullableBatchAddResult) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBatchAddResult) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_batch_delete_response.go b/model_batch_delete_response.go new file mode 100644 index 0000000..568ee83 --- /dev/null +++ b/model_batch_delete_response.go @@ -0,0 +1,158 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" + "bytes" + "fmt" +) + +// checks if the BatchDeleteResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &BatchDeleteResponse{} + +// BatchDeleteResponse Response containing the result of a batch delete operation. +type BatchDeleteResponse struct { + Data BatchDeleteResult `json:"data"` +} + +type _BatchDeleteResponse BatchDeleteResponse + +// NewBatchDeleteResponse instantiates a new BatchDeleteResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewBatchDeleteResponse(data BatchDeleteResult) *BatchDeleteResponse { + this := BatchDeleteResponse{} + this.Data = data + return &this +} + +// NewBatchDeleteResponseWithDefaults instantiates a new BatchDeleteResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewBatchDeleteResponseWithDefaults() *BatchDeleteResponse { + this := BatchDeleteResponse{} + return &this +} + +// GetData returns the Data field value +func (o *BatchDeleteResponse) GetData() BatchDeleteResult { + if o == nil { + var ret BatchDeleteResult + return ret + } + + return o.Data +} + +// GetDataOk returns a tuple with the Data field value +// and a boolean to check if the value has been set. +func (o *BatchDeleteResponse) GetDataOk() (*BatchDeleteResult, bool) { + if o == nil { + return nil, false + } + return &o.Data, true +} + +// SetData sets field value +func (o *BatchDeleteResponse) SetData(v BatchDeleteResult) { + o.Data = v +} + +func (o BatchDeleteResponse) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o BatchDeleteResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["data"] = o.Data + return toSerialize, nil +} + +func (o *BatchDeleteResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "data", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varBatchDeleteResponse := _BatchDeleteResponse{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varBatchDeleteResponse) + + if err != nil { + return err + } + + *o = BatchDeleteResponse(varBatchDeleteResponse) + + return err +} + +type NullableBatchDeleteResponse struct { + value *BatchDeleteResponse + isSet bool +} + +func (v NullableBatchDeleteResponse) Get() *BatchDeleteResponse { + return v.value +} + +func (v *NullableBatchDeleteResponse) Set(val *BatchDeleteResponse) { + v.value = val + v.isSet = true +} + +func (v NullableBatchDeleteResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableBatchDeleteResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBatchDeleteResponse(val *BatchDeleteResponse) *NullableBatchDeleteResponse { + return &NullableBatchDeleteResponse{value: val, isSet: true} +} + +func (v NullableBatchDeleteResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBatchDeleteResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_batch_delete_result.go b/model_batch_delete_result.go new file mode 100644 index 0000000..dbcb7e8 --- /dev/null +++ b/model_batch_delete_result.go @@ -0,0 +1,188 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" + "bytes" + "fmt" +) + +// checks if the BatchDeleteResult type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &BatchDeleteResult{} + +// BatchDeleteResult Result of a batch delete operation containing successfully deleted and failed requests. +type BatchDeleteResult struct { + // Requests that were successfully deleted from the request queue. + ProcessedRequests []DeletedRequest `json:"processedRequests"` + // Requests that failed to be deleted and can be retried. + UnprocessedRequests []RequestDraft `json:"unprocessedRequests"` +} + +type _BatchDeleteResult BatchDeleteResult + +// NewBatchDeleteResult instantiates a new BatchDeleteResult object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewBatchDeleteResult(processedRequests []DeletedRequest, unprocessedRequests []RequestDraft) *BatchDeleteResult { + this := BatchDeleteResult{} + this.ProcessedRequests = processedRequests + this.UnprocessedRequests = unprocessedRequests + return &this +} + +// NewBatchDeleteResultWithDefaults instantiates a new BatchDeleteResult object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewBatchDeleteResultWithDefaults() *BatchDeleteResult { + this := BatchDeleteResult{} + return &this +} + +// GetProcessedRequests returns the ProcessedRequests field value +func (o *BatchDeleteResult) GetProcessedRequests() []DeletedRequest { + if o == nil { + var ret []DeletedRequest + return ret + } + + return o.ProcessedRequests +} + +// GetProcessedRequestsOk returns a tuple with the ProcessedRequests field value +// and a boolean to check if the value has been set. +func (o *BatchDeleteResult) GetProcessedRequestsOk() ([]DeletedRequest, bool) { + if o == nil { + return nil, false + } + return o.ProcessedRequests, true +} + +// SetProcessedRequests sets field value +func (o *BatchDeleteResult) SetProcessedRequests(v []DeletedRequest) { + o.ProcessedRequests = v +} + +// GetUnprocessedRequests returns the UnprocessedRequests field value +func (o *BatchDeleteResult) GetUnprocessedRequests() []RequestDraft { + if o == nil { + var ret []RequestDraft + return ret + } + + return o.UnprocessedRequests +} + +// GetUnprocessedRequestsOk returns a tuple with the UnprocessedRequests field value +// and a boolean to check if the value has been set. +func (o *BatchDeleteResult) GetUnprocessedRequestsOk() ([]RequestDraft, bool) { + if o == nil { + return nil, false + } + return o.UnprocessedRequests, true +} + +// SetUnprocessedRequests sets field value +func (o *BatchDeleteResult) SetUnprocessedRequests(v []RequestDraft) { + o.UnprocessedRequests = v +} + +func (o BatchDeleteResult) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o BatchDeleteResult) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["processedRequests"] = o.ProcessedRequests + toSerialize["unprocessedRequests"] = o.UnprocessedRequests + return toSerialize, nil +} + +func (o *BatchDeleteResult) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "processedRequests", + "unprocessedRequests", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varBatchDeleteResult := _BatchDeleteResult{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varBatchDeleteResult) + + if err != nil { + return err + } + + *o = BatchDeleteResult(varBatchDeleteResult) + + return err +} + +type NullableBatchDeleteResult struct { + value *BatchDeleteResult + isSet bool +} + +func (v NullableBatchDeleteResult) Get() *BatchDeleteResult { + return v.value +} + +func (v *NullableBatchDeleteResult) Set(val *BatchDeleteResult) { + v.value = val + v.isSet = true +} + +func (v NullableBatchDeleteResult) IsSet() bool { + return v.isSet +} + +func (v *NullableBatchDeleteResult) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBatchDeleteResult(val *BatchDeleteResult) *NullableBatchDeleteResult { + return &NullableBatchDeleteResult{value: val, isSet: true} +} + +func (v NullableBatchDeleteResult) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBatchDeleteResult) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_browser_info_response.go b/model_browser_info_response.go new file mode 100644 index 0000000..77623c1 --- /dev/null +++ b/model_browser_info_response.go @@ -0,0 +1,324 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" + "bytes" + "fmt" +) + +// checks if the BrowserInfoResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &BrowserInfoResponse{} + +// BrowserInfoResponse struct for BrowserInfoResponse +type BrowserInfoResponse struct { + // HTTP method of the request. + Method string `json:"method"` + // IP address of the client. + ClientIp NullableString `json:"clientIp"` + // Two-letter country code resolved from the client IP address. + CountryCode NullableString `json:"countryCode"` + // Length of the request body in bytes. + BodyLength int32 `json:"bodyLength"` + // Request headers. Omitted when `skipHeaders=true`. + Headers map[string]BrowserInfoResponseHeadersValue `json:"headers,omitempty"` + // Raw request headers as a flat list of alternating name/value strings. Included only when `rawHeaders=true`. + RawHeaders []string `json:"rawHeaders,omitempty"` +} + +type _BrowserInfoResponse BrowserInfoResponse + +// NewBrowserInfoResponse instantiates a new BrowserInfoResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewBrowserInfoResponse(method string, clientIp NullableString, countryCode NullableString, bodyLength int32) *BrowserInfoResponse { + this := BrowserInfoResponse{} + this.Method = method + this.ClientIp = clientIp + this.CountryCode = countryCode + this.BodyLength = bodyLength + return &this +} + +// NewBrowserInfoResponseWithDefaults instantiates a new BrowserInfoResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewBrowserInfoResponseWithDefaults() *BrowserInfoResponse { + this := BrowserInfoResponse{} + return &this +} + +// GetMethod returns the Method field value +func (o *BrowserInfoResponse) GetMethod() string { + if o == nil { + var ret string + return ret + } + + return o.Method +} + +// GetMethodOk returns a tuple with the Method field value +// and a boolean to check if the value has been set. +func (o *BrowserInfoResponse) GetMethodOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Method, true +} + +// SetMethod sets field value +func (o *BrowserInfoResponse) SetMethod(v string) { + o.Method = v +} + +// GetClientIp returns the ClientIp field value +// If the value is explicit nil, the zero value for string will be returned +func (o *BrowserInfoResponse) GetClientIp() string { + if o == nil || o.ClientIp.Get() == nil { + var ret string + return ret + } + + return *o.ClientIp.Get() +} + +// GetClientIpOk returns a tuple with the ClientIp field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *BrowserInfoResponse) GetClientIpOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.ClientIp.Get(), o.ClientIp.IsSet() +} + +// SetClientIp sets field value +func (o *BrowserInfoResponse) SetClientIp(v string) { + o.ClientIp.Set(&v) +} + +// GetCountryCode returns the CountryCode field value +// If the value is explicit nil, the zero value for string will be returned +func (o *BrowserInfoResponse) GetCountryCode() string { + if o == nil || o.CountryCode.Get() == nil { + var ret string + return ret + } + + return *o.CountryCode.Get() +} + +// GetCountryCodeOk returns a tuple with the CountryCode field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *BrowserInfoResponse) GetCountryCodeOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.CountryCode.Get(), o.CountryCode.IsSet() +} + +// SetCountryCode sets field value +func (o *BrowserInfoResponse) SetCountryCode(v string) { + o.CountryCode.Set(&v) +} + +// GetBodyLength returns the BodyLength field value +func (o *BrowserInfoResponse) GetBodyLength() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.BodyLength +} + +// GetBodyLengthOk returns a tuple with the BodyLength field value +// and a boolean to check if the value has been set. +func (o *BrowserInfoResponse) GetBodyLengthOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.BodyLength, true +} + +// SetBodyLength sets field value +func (o *BrowserInfoResponse) SetBodyLength(v int32) { + o.BodyLength = v +} + +// GetHeaders returns the Headers field value if set, zero value otherwise. +func (o *BrowserInfoResponse) GetHeaders() map[string]BrowserInfoResponseHeadersValue { + if o == nil || IsNil(o.Headers) { + var ret map[string]BrowserInfoResponseHeadersValue + return ret + } + return o.Headers +} + +// GetHeadersOk returns a tuple with the Headers field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BrowserInfoResponse) GetHeadersOk() (map[string]BrowserInfoResponseHeadersValue, bool) { + if o == nil || IsNil(o.Headers) { + return map[string]BrowserInfoResponseHeadersValue{}, false + } + return o.Headers, true +} + +// HasHeaders returns a boolean if a field has been set. +func (o *BrowserInfoResponse) HasHeaders() bool { + if o != nil && !IsNil(o.Headers) { + return true + } + + return false +} + +// SetHeaders gets a reference to the given map[string]BrowserInfoResponseHeadersValue and assigns it to the Headers field. +func (o *BrowserInfoResponse) SetHeaders(v map[string]BrowserInfoResponseHeadersValue) { + o.Headers = v +} + +// GetRawHeaders returns the RawHeaders field value if set, zero value otherwise. +func (o *BrowserInfoResponse) GetRawHeaders() []string { + if o == nil || IsNil(o.RawHeaders) { + var ret []string + return ret + } + return o.RawHeaders +} + +// GetRawHeadersOk returns a tuple with the RawHeaders field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BrowserInfoResponse) GetRawHeadersOk() ([]string, bool) { + if o == nil || IsNil(o.RawHeaders) { + return nil, false + } + return o.RawHeaders, true +} + +// HasRawHeaders returns a boolean if a field has been set. +func (o *BrowserInfoResponse) HasRawHeaders() bool { + if o != nil && !IsNil(o.RawHeaders) { + return true + } + + return false +} + +// SetRawHeaders gets a reference to the given []string and assigns it to the RawHeaders field. +func (o *BrowserInfoResponse) SetRawHeaders(v []string) { + o.RawHeaders = v +} + +func (o BrowserInfoResponse) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o BrowserInfoResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["method"] = o.Method + toSerialize["clientIp"] = o.ClientIp.Get() + toSerialize["countryCode"] = o.CountryCode.Get() + toSerialize["bodyLength"] = o.BodyLength + if !IsNil(o.Headers) { + toSerialize["headers"] = o.Headers + } + if !IsNil(o.RawHeaders) { + toSerialize["rawHeaders"] = o.RawHeaders + } + return toSerialize, nil +} + +func (o *BrowserInfoResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "method", + "clientIp", + "countryCode", + "bodyLength", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varBrowserInfoResponse := _BrowserInfoResponse{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varBrowserInfoResponse) + + if err != nil { + return err + } + + *o = BrowserInfoResponse(varBrowserInfoResponse) + + return err +} + +type NullableBrowserInfoResponse struct { + value *BrowserInfoResponse + isSet bool +} + +func (v NullableBrowserInfoResponse) Get() *BrowserInfoResponse { + return v.value +} + +func (v *NullableBrowserInfoResponse) Set(val *BrowserInfoResponse) { + v.value = val + v.isSet = true +} + +func (v NullableBrowserInfoResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableBrowserInfoResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBrowserInfoResponse(val *BrowserInfoResponse) *NullableBrowserInfoResponse { + return &NullableBrowserInfoResponse{value: val, isSet: true} +} + +func (v NullableBrowserInfoResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBrowserInfoResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_browser_info_response_headers_value.go b/model_browser_info_response_headers_value.go new file mode 100644 index 0000000..62266dc --- /dev/null +++ b/model_browser_info_response_headers_value.go @@ -0,0 +1,171 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" + "fmt" + "gopkg.in/validator.v2" +) + +// BrowserInfoResponseHeadersValue - struct for BrowserInfoResponseHeadersValue +type BrowserInfoResponseHeadersValue struct { + ArrayOfString *[]string + String *string +} + +// []stringAsBrowserInfoResponseHeadersValue is a convenience function that returns []string wrapped in BrowserInfoResponseHeadersValue +func ArrayOfStringAsBrowserInfoResponseHeadersValue(v *[]string) BrowserInfoResponseHeadersValue { + return BrowserInfoResponseHeadersValue{ + ArrayOfString: v, + } +} + +// stringAsBrowserInfoResponseHeadersValue is a convenience function that returns string wrapped in BrowserInfoResponseHeadersValue +func StringAsBrowserInfoResponseHeadersValue(v *string) BrowserInfoResponseHeadersValue { + return BrowserInfoResponseHeadersValue{ + String: v, + } +} + + +// Unmarshal JSON data into one of the pointers in the struct +func (dst *BrowserInfoResponseHeadersValue) UnmarshalJSON(data []byte) error { + var err error + match := 0 + // try to unmarshal data into ArrayOfString + err = newStrictDecoder(data).Decode(&dst.ArrayOfString) + if err == nil { + jsonArrayOfString, _ := json.Marshal(dst.ArrayOfString) + if string(jsonArrayOfString) == "{}" { // empty struct + dst.ArrayOfString = nil + } else { + if err = validator.Validate(dst.ArrayOfString); err != nil { + dst.ArrayOfString = nil + } else { + match++ + } + } + } else { + dst.ArrayOfString = nil + } + + // try to unmarshal data into String + err = newStrictDecoder(data).Decode(&dst.String) + if err == nil { + jsonString, _ := json.Marshal(dst.String) + if string(jsonString) == "{}" { // empty struct + dst.String = nil + } else { + if err = validator.Validate(dst.String); err != nil { + dst.String = nil + } else { + match++ + } + } + } else { + dst.String = nil + } + + if match > 1 { // more than 1 match + // reset to nil + dst.ArrayOfString = nil + dst.String = nil + + return fmt.Errorf("data matches more than one schema in oneOf(BrowserInfoResponseHeadersValue)") + } else if match == 1 { + return nil // exactly one match + } else { // no match + return fmt.Errorf("data failed to match schemas in oneOf(BrowserInfoResponseHeadersValue)") + } +} + +// Marshal data from the first non-nil pointers in the struct to JSON +func (src BrowserInfoResponseHeadersValue) MarshalJSON() ([]byte, error) { + if src.ArrayOfString != nil { + return json.Marshal(&src.ArrayOfString) + } + + if src.String != nil { + return json.Marshal(&src.String) + } + + return nil, nil // no data in oneOf schemas +} + +// Get the actual instance +func (obj *BrowserInfoResponseHeadersValue) GetActualInstance() (interface{}) { + if obj == nil { + return nil + } + if obj.ArrayOfString != nil { + return obj.ArrayOfString + } + + if obj.String != nil { + return obj.String + } + + // all schemas are nil + return nil +} + +// Get the actual instance value +func (obj BrowserInfoResponseHeadersValue) GetActualInstanceValue() (interface{}) { + if obj.ArrayOfString != nil { + return *obj.ArrayOfString + } + + if obj.String != nil { + return *obj.String + } + + // all schemas are nil + return nil +} + +type NullableBrowserInfoResponseHeadersValue struct { + value *BrowserInfoResponseHeadersValue + isSet bool +} + +func (v NullableBrowserInfoResponseHeadersValue) Get() *BrowserInfoResponseHeadersValue { + return v.value +} + +func (v *NullableBrowserInfoResponseHeadersValue) Set(val *BrowserInfoResponseHeadersValue) { + v.value = val + v.isSet = true +} + +func (v NullableBrowserInfoResponseHeadersValue) IsSet() bool { + return v.isSet +} + +func (v *NullableBrowserInfoResponseHeadersValue) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBrowserInfoResponseHeadersValue(val *BrowserInfoResponseHeadersValue) *NullableBrowserInfoResponseHeadersValue { + return &NullableBrowserInfoResponseHeadersValue{value: val, isSet: true} +} + +func (v NullableBrowserInfoResponseHeadersValue) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBrowserInfoResponseHeadersValue) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_build.go b/model_build.go new file mode 100644 index 0000000..2dcead5 --- /dev/null +++ b/model_build.go @@ -0,0 +1,787 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" + "time" + "bytes" + "fmt" +) + +// checks if the Build type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Build{} + +// Build struct for Build +type Build struct { + Id string `json:"id"` + ActId string `json:"actId"` + UserId string `json:"userId"` + StartedAt time.Time `json:"startedAt"` + FinishedAt NullableTime `json:"finishedAt,omitempty"` + Status ActorJobStatus `json:"status"` + Meta BuildsMeta `json:"meta"` + Stats NullableBuildStats `json:"stats,omitempty"` + Options NullableBuildOptions `json:"options,omitempty"` + Usage NullableBuildUsage `json:"usage,omitempty"` + // Total cost in USD for this build. Requires authentication token to access. + UsageTotalUsd NullableFloat32 `json:"usageTotalUsd,omitempty"` + // Platform usage costs breakdown in USD for this build. Requires authentication token to access. + UsageUsd NullableBuildUsage `json:"usageUsd,omitempty"` + // Deprecated + InputSchema NullableString `json:"inputSchema,omitempty"` + // Deprecated + Readme NullableString `json:"readme,omitempty"` + BuildNumber string `json:"buildNumber" validate:"regexp=^([0-9]|[1-9][0-9])\\\\.([0-9]|[1-9][0-9])(\\\\.[1-9][0-9]{0,4})$"` + ActVersion *BuildActVersion `json:"actVersion,omitempty"` + ActorDefinition NullableActorDefinition `json:"actorDefinition,omitempty"` +} + +type _Build Build + +// NewBuild instantiates a new Build object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewBuild(id string, actId string, userId string, startedAt time.Time, status ActorJobStatus, meta BuildsMeta, buildNumber string) *Build { + this := Build{} + this.Id = id + this.ActId = actId + this.UserId = userId + this.StartedAt = startedAt + this.Status = status + this.Meta = meta + this.BuildNumber = buildNumber + return &this +} + +// NewBuildWithDefaults instantiates a new Build object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewBuildWithDefaults() *Build { + this := Build{} + return &this +} + +// GetId returns the Id field value +func (o *Build) GetId() string { + if o == nil { + var ret string + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *Build) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *Build) SetId(v string) { + o.Id = v +} + +// GetActId returns the ActId field value +func (o *Build) GetActId() string { + if o == nil { + var ret string + return ret + } + + return o.ActId +} + +// GetActIdOk returns a tuple with the ActId field value +// and a boolean to check if the value has been set. +func (o *Build) GetActIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ActId, true +} + +// SetActId sets field value +func (o *Build) SetActId(v string) { + o.ActId = v +} + +// GetUserId returns the UserId field value +func (o *Build) GetUserId() string { + if o == nil { + var ret string + return ret + } + + return o.UserId +} + +// GetUserIdOk returns a tuple with the UserId field value +// and a boolean to check if the value has been set. +func (o *Build) GetUserIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.UserId, true +} + +// SetUserId sets field value +func (o *Build) SetUserId(v string) { + o.UserId = v +} + +// GetStartedAt returns the StartedAt field value +func (o *Build) GetStartedAt() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.StartedAt +} + +// GetStartedAtOk returns a tuple with the StartedAt field value +// and a boolean to check if the value has been set. +func (o *Build) GetStartedAtOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.StartedAt, true +} + +// SetStartedAt sets field value +func (o *Build) SetStartedAt(v time.Time) { + o.StartedAt = v +} + +// GetFinishedAt returns the FinishedAt field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Build) GetFinishedAt() time.Time { + if o == nil || IsNil(o.FinishedAt.Get()) { + var ret time.Time + return ret + } + return *o.FinishedAt.Get() +} + +// GetFinishedAtOk returns a tuple with the FinishedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Build) GetFinishedAtOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.FinishedAt.Get(), o.FinishedAt.IsSet() +} + +// HasFinishedAt returns a boolean if a field has been set. +func (o *Build) HasFinishedAt() bool { + if o != nil && o.FinishedAt.IsSet() { + return true + } + + return false +} + +// SetFinishedAt gets a reference to the given NullableTime and assigns it to the FinishedAt field. +func (o *Build) SetFinishedAt(v time.Time) { + o.FinishedAt.Set(&v) +} +// SetFinishedAtNil sets the value for FinishedAt to be an explicit nil +func (o *Build) SetFinishedAtNil() { + o.FinishedAt.Set(nil) +} + +// UnsetFinishedAt ensures that no value is present for FinishedAt, not even an explicit nil +func (o *Build) UnsetFinishedAt() { + o.FinishedAt.Unset() +} + +// GetStatus returns the Status field value +func (o *Build) GetStatus() ActorJobStatus { + if o == nil { + var ret ActorJobStatus + return ret + } + + return o.Status +} + +// GetStatusOk returns a tuple with the Status field value +// and a boolean to check if the value has been set. +func (o *Build) GetStatusOk() (*ActorJobStatus, bool) { + if o == nil { + return nil, false + } + return &o.Status, true +} + +// SetStatus sets field value +func (o *Build) SetStatus(v ActorJobStatus) { + o.Status = v +} + +// GetMeta returns the Meta field value +func (o *Build) GetMeta() BuildsMeta { + if o == nil { + var ret BuildsMeta + return ret + } + + return o.Meta +} + +// GetMetaOk returns a tuple with the Meta field value +// and a boolean to check if the value has been set. +func (o *Build) GetMetaOk() (*BuildsMeta, bool) { + if o == nil { + return nil, false + } + return &o.Meta, true +} + +// SetMeta sets field value +func (o *Build) SetMeta(v BuildsMeta) { + o.Meta = v +} + +// GetStats returns the Stats field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Build) GetStats() BuildStats { + if o == nil || IsNil(o.Stats.Get()) { + var ret BuildStats + return ret + } + return *o.Stats.Get() +} + +// GetStatsOk returns a tuple with the Stats field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Build) GetStatsOk() (*BuildStats, bool) { + if o == nil { + return nil, false + } + return o.Stats.Get(), o.Stats.IsSet() +} + +// HasStats returns a boolean if a field has been set. +func (o *Build) HasStats() bool { + if o != nil && o.Stats.IsSet() { + return true + } + + return false +} + +// SetStats gets a reference to the given NullableBuildStats and assigns it to the Stats field. +func (o *Build) SetStats(v BuildStats) { + o.Stats.Set(&v) +} +// SetStatsNil sets the value for Stats to be an explicit nil +func (o *Build) SetStatsNil() { + o.Stats.Set(nil) +} + +// UnsetStats ensures that no value is present for Stats, not even an explicit nil +func (o *Build) UnsetStats() { + o.Stats.Unset() +} + +// GetOptions returns the Options field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Build) GetOptions() BuildOptions { + if o == nil || IsNil(o.Options.Get()) { + var ret BuildOptions + return ret + } + return *o.Options.Get() +} + +// GetOptionsOk returns a tuple with the Options field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Build) GetOptionsOk() (*BuildOptions, bool) { + if o == nil { + return nil, false + } + return o.Options.Get(), o.Options.IsSet() +} + +// HasOptions returns a boolean if a field has been set. +func (o *Build) HasOptions() bool { + if o != nil && o.Options.IsSet() { + return true + } + + return false +} + +// SetOptions gets a reference to the given NullableBuildOptions and assigns it to the Options field. +func (o *Build) SetOptions(v BuildOptions) { + o.Options.Set(&v) +} +// SetOptionsNil sets the value for Options to be an explicit nil +func (o *Build) SetOptionsNil() { + o.Options.Set(nil) +} + +// UnsetOptions ensures that no value is present for Options, not even an explicit nil +func (o *Build) UnsetOptions() { + o.Options.Unset() +} + +// GetUsage returns the Usage field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Build) GetUsage() BuildUsage { + if o == nil || IsNil(o.Usage.Get()) { + var ret BuildUsage + return ret + } + return *o.Usage.Get() +} + +// GetUsageOk returns a tuple with the Usage field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Build) GetUsageOk() (*BuildUsage, bool) { + if o == nil { + return nil, false + } + return o.Usage.Get(), o.Usage.IsSet() +} + +// HasUsage returns a boolean if a field has been set. +func (o *Build) HasUsage() bool { + if o != nil && o.Usage.IsSet() { + return true + } + + return false +} + +// SetUsage gets a reference to the given NullableBuildUsage and assigns it to the Usage field. +func (o *Build) SetUsage(v BuildUsage) { + o.Usage.Set(&v) +} +// SetUsageNil sets the value for Usage to be an explicit nil +func (o *Build) SetUsageNil() { + o.Usage.Set(nil) +} + +// UnsetUsage ensures that no value is present for Usage, not even an explicit nil +func (o *Build) UnsetUsage() { + o.Usage.Unset() +} + +// GetUsageTotalUsd returns the UsageTotalUsd field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Build) GetUsageTotalUsd() float32 { + if o == nil || IsNil(o.UsageTotalUsd.Get()) { + var ret float32 + return ret + } + return *o.UsageTotalUsd.Get() +} + +// GetUsageTotalUsdOk returns a tuple with the UsageTotalUsd field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Build) GetUsageTotalUsdOk() (*float32, bool) { + if o == nil { + return nil, false + } + return o.UsageTotalUsd.Get(), o.UsageTotalUsd.IsSet() +} + +// HasUsageTotalUsd returns a boolean if a field has been set. +func (o *Build) HasUsageTotalUsd() bool { + if o != nil && o.UsageTotalUsd.IsSet() { + return true + } + + return false +} + +// SetUsageTotalUsd gets a reference to the given NullableFloat32 and assigns it to the UsageTotalUsd field. +func (o *Build) SetUsageTotalUsd(v float32) { + o.UsageTotalUsd.Set(&v) +} +// SetUsageTotalUsdNil sets the value for UsageTotalUsd to be an explicit nil +func (o *Build) SetUsageTotalUsdNil() { + o.UsageTotalUsd.Set(nil) +} + +// UnsetUsageTotalUsd ensures that no value is present for UsageTotalUsd, not even an explicit nil +func (o *Build) UnsetUsageTotalUsd() { + o.UsageTotalUsd.Unset() +} + +// GetUsageUsd returns the UsageUsd field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Build) GetUsageUsd() BuildUsage { + if o == nil || IsNil(o.UsageUsd.Get()) { + var ret BuildUsage + return ret + } + return *o.UsageUsd.Get() +} + +// GetUsageUsdOk returns a tuple with the UsageUsd field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Build) GetUsageUsdOk() (*BuildUsage, bool) { + if o == nil { + return nil, false + } + return o.UsageUsd.Get(), o.UsageUsd.IsSet() +} + +// HasUsageUsd returns a boolean if a field has been set. +func (o *Build) HasUsageUsd() bool { + if o != nil && o.UsageUsd.IsSet() { + return true + } + + return false +} + +// SetUsageUsd gets a reference to the given NullableBuildUsage and assigns it to the UsageUsd field. +func (o *Build) SetUsageUsd(v BuildUsage) { + o.UsageUsd.Set(&v) +} +// SetUsageUsdNil sets the value for UsageUsd to be an explicit nil +func (o *Build) SetUsageUsdNil() { + o.UsageUsd.Set(nil) +} + +// UnsetUsageUsd ensures that no value is present for UsageUsd, not even an explicit nil +func (o *Build) UnsetUsageUsd() { + o.UsageUsd.Unset() +} + +// GetInputSchema returns the InputSchema field value if set, zero value otherwise (both if not set or set to explicit null). +// Deprecated +func (o *Build) GetInputSchema() string { + if o == nil || IsNil(o.InputSchema.Get()) { + var ret string + return ret + } + return *o.InputSchema.Get() +} + +// GetInputSchemaOk returns a tuple with the InputSchema field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +// Deprecated +func (o *Build) GetInputSchemaOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.InputSchema.Get(), o.InputSchema.IsSet() +} + +// HasInputSchema returns a boolean if a field has been set. +func (o *Build) HasInputSchema() bool { + if o != nil && o.InputSchema.IsSet() { + return true + } + + return false +} + +// SetInputSchema gets a reference to the given NullableString and assigns it to the InputSchema field. +// Deprecated +func (o *Build) SetInputSchema(v string) { + o.InputSchema.Set(&v) +} +// SetInputSchemaNil sets the value for InputSchema to be an explicit nil +func (o *Build) SetInputSchemaNil() { + o.InputSchema.Set(nil) +} + +// UnsetInputSchema ensures that no value is present for InputSchema, not even an explicit nil +func (o *Build) UnsetInputSchema() { + o.InputSchema.Unset() +} + +// GetReadme returns the Readme field value if set, zero value otherwise (both if not set or set to explicit null). +// Deprecated +func (o *Build) GetReadme() string { + if o == nil || IsNil(o.Readme.Get()) { + var ret string + return ret + } + return *o.Readme.Get() +} + +// GetReadmeOk returns a tuple with the Readme field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +// Deprecated +func (o *Build) GetReadmeOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Readme.Get(), o.Readme.IsSet() +} + +// HasReadme returns a boolean if a field has been set. +func (o *Build) HasReadme() bool { + if o != nil && o.Readme.IsSet() { + return true + } + + return false +} + +// SetReadme gets a reference to the given NullableString and assigns it to the Readme field. +// Deprecated +func (o *Build) SetReadme(v string) { + o.Readme.Set(&v) +} +// SetReadmeNil sets the value for Readme to be an explicit nil +func (o *Build) SetReadmeNil() { + o.Readme.Set(nil) +} + +// UnsetReadme ensures that no value is present for Readme, not even an explicit nil +func (o *Build) UnsetReadme() { + o.Readme.Unset() +} + +// GetBuildNumber returns the BuildNumber field value +func (o *Build) GetBuildNumber() string { + if o == nil { + var ret string + return ret + } + + return o.BuildNumber +} + +// GetBuildNumberOk returns a tuple with the BuildNumber field value +// and a boolean to check if the value has been set. +func (o *Build) GetBuildNumberOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.BuildNumber, true +} + +// SetBuildNumber sets field value +func (o *Build) SetBuildNumber(v string) { + o.BuildNumber = v +} + +// GetActVersion returns the ActVersion field value if set, zero value otherwise. +func (o *Build) GetActVersion() BuildActVersion { + if o == nil || IsNil(o.ActVersion) { + var ret BuildActVersion + return ret + } + return *o.ActVersion +} + +// GetActVersionOk returns a tuple with the ActVersion field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Build) GetActVersionOk() (*BuildActVersion, bool) { + if o == nil || IsNil(o.ActVersion) { + return nil, false + } + return o.ActVersion, true +} + +// HasActVersion returns a boolean if a field has been set. +func (o *Build) HasActVersion() bool { + if o != nil && !IsNil(o.ActVersion) { + return true + } + + return false +} + +// SetActVersion gets a reference to the given BuildActVersion and assigns it to the ActVersion field. +func (o *Build) SetActVersion(v BuildActVersion) { + o.ActVersion = &v +} + +// GetActorDefinition returns the ActorDefinition field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Build) GetActorDefinition() ActorDefinition { + if o == nil || IsNil(o.ActorDefinition.Get()) { + var ret ActorDefinition + return ret + } + return *o.ActorDefinition.Get() +} + +// GetActorDefinitionOk returns a tuple with the ActorDefinition field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Build) GetActorDefinitionOk() (*ActorDefinition, bool) { + if o == nil { + return nil, false + } + return o.ActorDefinition.Get(), o.ActorDefinition.IsSet() +} + +// HasActorDefinition returns a boolean if a field has been set. +func (o *Build) HasActorDefinition() bool { + if o != nil && o.ActorDefinition.IsSet() { + return true + } + + return false +} + +// SetActorDefinition gets a reference to the given NullableActorDefinition and assigns it to the ActorDefinition field. +func (o *Build) SetActorDefinition(v ActorDefinition) { + o.ActorDefinition.Set(&v) +} +// SetActorDefinitionNil sets the value for ActorDefinition to be an explicit nil +func (o *Build) SetActorDefinitionNil() { + o.ActorDefinition.Set(nil) +} + +// UnsetActorDefinition ensures that no value is present for ActorDefinition, not even an explicit nil +func (o *Build) UnsetActorDefinition() { + o.ActorDefinition.Unset() +} + +func (o Build) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Build) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["actId"] = o.ActId + toSerialize["userId"] = o.UserId + toSerialize["startedAt"] = o.StartedAt + if o.FinishedAt.IsSet() { + toSerialize["finishedAt"] = o.FinishedAt.Get() + } + toSerialize["status"] = o.Status + toSerialize["meta"] = o.Meta + if o.Stats.IsSet() { + toSerialize["stats"] = o.Stats.Get() + } + if o.Options.IsSet() { + toSerialize["options"] = o.Options.Get() + } + if o.Usage.IsSet() { + toSerialize["usage"] = o.Usage.Get() + } + if o.UsageTotalUsd.IsSet() { + toSerialize["usageTotalUsd"] = o.UsageTotalUsd.Get() + } + if o.UsageUsd.IsSet() { + toSerialize["usageUsd"] = o.UsageUsd.Get() + } + if o.InputSchema.IsSet() { + toSerialize["inputSchema"] = o.InputSchema.Get() + } + if o.Readme.IsSet() { + toSerialize["readme"] = o.Readme.Get() + } + toSerialize["buildNumber"] = o.BuildNumber + if !IsNil(o.ActVersion) { + toSerialize["actVersion"] = o.ActVersion + } + if o.ActorDefinition.IsSet() { + toSerialize["actorDefinition"] = o.ActorDefinition.Get() + } + return toSerialize, nil +} + +func (o *Build) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "actId", + "userId", + "startedAt", + "status", + "meta", + "buildNumber", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varBuild := _Build{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varBuild) + + if err != nil { + return err + } + + *o = Build(varBuild) + + return err +} + +type NullableBuild struct { + value *Build + isSet bool +} + +func (v NullableBuild) Get() *Build { + return v.value +} + +func (v *NullableBuild) Set(val *Build) { + v.value = val + v.isSet = true +} + +func (v NullableBuild) IsSet() bool { + return v.isSet +} + +func (v *NullableBuild) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBuild(val *Build) *NullableBuild { + return &NullableBuild{value: val, isSet: true} +} + +func (v NullableBuild) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBuild) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_build_act_version.go b/model_build_act_version.go new file mode 100644 index 0000000..53e84a2 --- /dev/null +++ b/model_build_act_version.go @@ -0,0 +1,272 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" +) + +// checks if the BuildActVersion type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &BuildActVersion{} + +// BuildActVersion Snapshot of the Actor version that this build was created from. +type BuildActVersion struct { + SourceType *VersionSourceType `json:"sourceType,omitempty"` + BuildTag *string `json:"buildTag,omitempty"` + VersionNumber *string `json:"versionNumber,omitempty" validate:"regexp=^([0-9]|[1-9][0-9])\\\\.([0-9]|[1-9][0-9])$"` + // URL of the git repository, present when sourceType is GIT_REPO. + GitRepoUrl *string `json:"gitRepoUrl,omitempty"` + // Inline source files, present when sourceType is SOURCE_FILES. + SourceFiles []SourceCodeFile `json:"sourceFiles,omitempty"` +} + +// NewBuildActVersion instantiates a new BuildActVersion object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewBuildActVersion() *BuildActVersion { + this := BuildActVersion{} + return &this +} + +// NewBuildActVersionWithDefaults instantiates a new BuildActVersion object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewBuildActVersionWithDefaults() *BuildActVersion { + this := BuildActVersion{} + return &this +} + +// GetSourceType returns the SourceType field value if set, zero value otherwise. +func (o *BuildActVersion) GetSourceType() VersionSourceType { + if o == nil || IsNil(o.SourceType) { + var ret VersionSourceType + return ret + } + return *o.SourceType +} + +// GetSourceTypeOk returns a tuple with the SourceType field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BuildActVersion) GetSourceTypeOk() (*VersionSourceType, bool) { + if o == nil || IsNil(o.SourceType) { + return nil, false + } + return o.SourceType, true +} + +// HasSourceType returns a boolean if a field has been set. +func (o *BuildActVersion) HasSourceType() bool { + if o != nil && !IsNil(o.SourceType) { + return true + } + + return false +} + +// SetSourceType gets a reference to the given VersionSourceType and assigns it to the SourceType field. +func (o *BuildActVersion) SetSourceType(v VersionSourceType) { + o.SourceType = &v +} + +// GetBuildTag returns the BuildTag field value if set, zero value otherwise. +func (o *BuildActVersion) GetBuildTag() string { + if o == nil || IsNil(o.BuildTag) { + var ret string + return ret + } + return *o.BuildTag +} + +// GetBuildTagOk returns a tuple with the BuildTag field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BuildActVersion) GetBuildTagOk() (*string, bool) { + if o == nil || IsNil(o.BuildTag) { + return nil, false + } + return o.BuildTag, true +} + +// HasBuildTag returns a boolean if a field has been set. +func (o *BuildActVersion) HasBuildTag() bool { + if o != nil && !IsNil(o.BuildTag) { + return true + } + + return false +} + +// SetBuildTag gets a reference to the given string and assigns it to the BuildTag field. +func (o *BuildActVersion) SetBuildTag(v string) { + o.BuildTag = &v +} + +// GetVersionNumber returns the VersionNumber field value if set, zero value otherwise. +func (o *BuildActVersion) GetVersionNumber() string { + if o == nil || IsNil(o.VersionNumber) { + var ret string + return ret + } + return *o.VersionNumber +} + +// GetVersionNumberOk returns a tuple with the VersionNumber field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BuildActVersion) GetVersionNumberOk() (*string, bool) { + if o == nil || IsNil(o.VersionNumber) { + return nil, false + } + return o.VersionNumber, true +} + +// HasVersionNumber returns a boolean if a field has been set. +func (o *BuildActVersion) HasVersionNumber() bool { + if o != nil && !IsNil(o.VersionNumber) { + return true + } + + return false +} + +// SetVersionNumber gets a reference to the given string and assigns it to the VersionNumber field. +func (o *BuildActVersion) SetVersionNumber(v string) { + o.VersionNumber = &v +} + +// GetGitRepoUrl returns the GitRepoUrl field value if set, zero value otherwise. +func (o *BuildActVersion) GetGitRepoUrl() string { + if o == nil || IsNil(o.GitRepoUrl) { + var ret string + return ret + } + return *o.GitRepoUrl +} + +// GetGitRepoUrlOk returns a tuple with the GitRepoUrl field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BuildActVersion) GetGitRepoUrlOk() (*string, bool) { + if o == nil || IsNil(o.GitRepoUrl) { + return nil, false + } + return o.GitRepoUrl, true +} + +// HasGitRepoUrl returns a boolean if a field has been set. +func (o *BuildActVersion) HasGitRepoUrl() bool { + if o != nil && !IsNil(o.GitRepoUrl) { + return true + } + + return false +} + +// SetGitRepoUrl gets a reference to the given string and assigns it to the GitRepoUrl field. +func (o *BuildActVersion) SetGitRepoUrl(v string) { + o.GitRepoUrl = &v +} + +// GetSourceFiles returns the SourceFiles field value if set, zero value otherwise. +func (o *BuildActVersion) GetSourceFiles() []SourceCodeFile { + if o == nil || IsNil(o.SourceFiles) { + var ret []SourceCodeFile + return ret + } + return o.SourceFiles +} + +// GetSourceFilesOk returns a tuple with the SourceFiles field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BuildActVersion) GetSourceFilesOk() ([]SourceCodeFile, bool) { + if o == nil || IsNil(o.SourceFiles) { + return nil, false + } + return o.SourceFiles, true +} + +// HasSourceFiles returns a boolean if a field has been set. +func (o *BuildActVersion) HasSourceFiles() bool { + if o != nil && !IsNil(o.SourceFiles) { + return true + } + + return false +} + +// SetSourceFiles gets a reference to the given []SourceCodeFile and assigns it to the SourceFiles field. +func (o *BuildActVersion) SetSourceFiles(v []SourceCodeFile) { + o.SourceFiles = v +} + +func (o BuildActVersion) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o BuildActVersion) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.SourceType) { + toSerialize["sourceType"] = o.SourceType + } + if !IsNil(o.BuildTag) { + toSerialize["buildTag"] = o.BuildTag + } + if !IsNil(o.VersionNumber) { + toSerialize["versionNumber"] = o.VersionNumber + } + if !IsNil(o.GitRepoUrl) { + toSerialize["gitRepoUrl"] = o.GitRepoUrl + } + if !IsNil(o.SourceFiles) { + toSerialize["sourceFiles"] = o.SourceFiles + } + return toSerialize, nil +} + +type NullableBuildActVersion struct { + value *BuildActVersion + isSet bool +} + +func (v NullableBuildActVersion) Get() *BuildActVersion { + return v.value +} + +func (v *NullableBuildActVersion) Set(val *BuildActVersion) { + v.value = val + v.isSet = true +} + +func (v NullableBuildActVersion) IsSet() bool { + return v.isSet +} + +func (v *NullableBuildActVersion) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBuildActVersion(val *BuildActVersion) *NullableBuildActVersion { + return &NullableBuildActVersion{value: val, isSet: true} +} + +func (v NullableBuildActVersion) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBuildActVersion) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_build_options.go b/model_build_options.go new file mode 100644 index 0000000..bf58486 --- /dev/null +++ b/model_build_options.go @@ -0,0 +1,274 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" +) + +// checks if the BuildOptions type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &BuildOptions{} + +// BuildOptions struct for BuildOptions +type BuildOptions struct { + UseCache NullableBool `json:"useCache,omitempty"` + BetaPackages NullableBool `json:"betaPackages,omitempty"` + MemoryMbytes NullableInt32 `json:"memoryMbytes,omitempty"` + DiskMbytes NullableInt32 `json:"diskMbytes,omitempty"` +} + +// NewBuildOptions instantiates a new BuildOptions object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewBuildOptions() *BuildOptions { + this := BuildOptions{} + return &this +} + +// NewBuildOptionsWithDefaults instantiates a new BuildOptions object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewBuildOptionsWithDefaults() *BuildOptions { + this := BuildOptions{} + return &this +} + +// GetUseCache returns the UseCache field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *BuildOptions) GetUseCache() bool { + if o == nil || IsNil(o.UseCache.Get()) { + var ret bool + return ret + } + return *o.UseCache.Get() +} + +// GetUseCacheOk returns a tuple with the UseCache field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *BuildOptions) GetUseCacheOk() (*bool, bool) { + if o == nil { + return nil, false + } + return o.UseCache.Get(), o.UseCache.IsSet() +} + +// HasUseCache returns a boolean if a field has been set. +func (o *BuildOptions) HasUseCache() bool { + if o != nil && o.UseCache.IsSet() { + return true + } + + return false +} + +// SetUseCache gets a reference to the given NullableBool and assigns it to the UseCache field. +func (o *BuildOptions) SetUseCache(v bool) { + o.UseCache.Set(&v) +} +// SetUseCacheNil sets the value for UseCache to be an explicit nil +func (o *BuildOptions) SetUseCacheNil() { + o.UseCache.Set(nil) +} + +// UnsetUseCache ensures that no value is present for UseCache, not even an explicit nil +func (o *BuildOptions) UnsetUseCache() { + o.UseCache.Unset() +} + +// GetBetaPackages returns the BetaPackages field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *BuildOptions) GetBetaPackages() bool { + if o == nil || IsNil(o.BetaPackages.Get()) { + var ret bool + return ret + } + return *o.BetaPackages.Get() +} + +// GetBetaPackagesOk returns a tuple with the BetaPackages field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *BuildOptions) GetBetaPackagesOk() (*bool, bool) { + if o == nil { + return nil, false + } + return o.BetaPackages.Get(), o.BetaPackages.IsSet() +} + +// HasBetaPackages returns a boolean if a field has been set. +func (o *BuildOptions) HasBetaPackages() bool { + if o != nil && o.BetaPackages.IsSet() { + return true + } + + return false +} + +// SetBetaPackages gets a reference to the given NullableBool and assigns it to the BetaPackages field. +func (o *BuildOptions) SetBetaPackages(v bool) { + o.BetaPackages.Set(&v) +} +// SetBetaPackagesNil sets the value for BetaPackages to be an explicit nil +func (o *BuildOptions) SetBetaPackagesNil() { + o.BetaPackages.Set(nil) +} + +// UnsetBetaPackages ensures that no value is present for BetaPackages, not even an explicit nil +func (o *BuildOptions) UnsetBetaPackages() { + o.BetaPackages.Unset() +} + +// GetMemoryMbytes returns the MemoryMbytes field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *BuildOptions) GetMemoryMbytes() int32 { + if o == nil || IsNil(o.MemoryMbytes.Get()) { + var ret int32 + return ret + } + return *o.MemoryMbytes.Get() +} + +// GetMemoryMbytesOk returns a tuple with the MemoryMbytes field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *BuildOptions) GetMemoryMbytesOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.MemoryMbytes.Get(), o.MemoryMbytes.IsSet() +} + +// HasMemoryMbytes returns a boolean if a field has been set. +func (o *BuildOptions) HasMemoryMbytes() bool { + if o != nil && o.MemoryMbytes.IsSet() { + return true + } + + return false +} + +// SetMemoryMbytes gets a reference to the given NullableInt32 and assigns it to the MemoryMbytes field. +func (o *BuildOptions) SetMemoryMbytes(v int32) { + o.MemoryMbytes.Set(&v) +} +// SetMemoryMbytesNil sets the value for MemoryMbytes to be an explicit nil +func (o *BuildOptions) SetMemoryMbytesNil() { + o.MemoryMbytes.Set(nil) +} + +// UnsetMemoryMbytes ensures that no value is present for MemoryMbytes, not even an explicit nil +func (o *BuildOptions) UnsetMemoryMbytes() { + o.MemoryMbytes.Unset() +} + +// GetDiskMbytes returns the DiskMbytes field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *BuildOptions) GetDiskMbytes() int32 { + if o == nil || IsNil(o.DiskMbytes.Get()) { + var ret int32 + return ret + } + return *o.DiskMbytes.Get() +} + +// GetDiskMbytesOk returns a tuple with the DiskMbytes field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *BuildOptions) GetDiskMbytesOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.DiskMbytes.Get(), o.DiskMbytes.IsSet() +} + +// HasDiskMbytes returns a boolean if a field has been set. +func (o *BuildOptions) HasDiskMbytes() bool { + if o != nil && o.DiskMbytes.IsSet() { + return true + } + + return false +} + +// SetDiskMbytes gets a reference to the given NullableInt32 and assigns it to the DiskMbytes field. +func (o *BuildOptions) SetDiskMbytes(v int32) { + o.DiskMbytes.Set(&v) +} +// SetDiskMbytesNil sets the value for DiskMbytes to be an explicit nil +func (o *BuildOptions) SetDiskMbytesNil() { + o.DiskMbytes.Set(nil) +} + +// UnsetDiskMbytes ensures that no value is present for DiskMbytes, not even an explicit nil +func (o *BuildOptions) UnsetDiskMbytes() { + o.DiskMbytes.Unset() +} + +func (o BuildOptions) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o BuildOptions) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.UseCache.IsSet() { + toSerialize["useCache"] = o.UseCache.Get() + } + if o.BetaPackages.IsSet() { + toSerialize["betaPackages"] = o.BetaPackages.Get() + } + if o.MemoryMbytes.IsSet() { + toSerialize["memoryMbytes"] = o.MemoryMbytes.Get() + } + if o.DiskMbytes.IsSet() { + toSerialize["diskMbytes"] = o.DiskMbytes.Get() + } + return toSerialize, nil +} + +type NullableBuildOptions struct { + value *BuildOptions + isSet bool +} + +func (v NullableBuildOptions) Get() *BuildOptions { + return v.value +} + +func (v *NullableBuildOptions) Set(val *BuildOptions) { + v.value = val + v.isSet = true +} + +func (v NullableBuildOptions) IsSet() bool { + return v.isSet +} + +func (v *NullableBuildOptions) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBuildOptions(val *BuildOptions) *NullableBuildOptions { + return &NullableBuildOptions{value: val, isSet: true} +} + +func (v NullableBuildOptions) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBuildOptions) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_build_response.go b/model_build_response.go new file mode 100644 index 0000000..fe55ccf --- /dev/null +++ b/model_build_response.go @@ -0,0 +1,158 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" + "bytes" + "fmt" +) + +// checks if the BuildResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &BuildResponse{} + +// BuildResponse Response containing Actor build data. +type BuildResponse struct { + Data Build `json:"data"` +} + +type _BuildResponse BuildResponse + +// NewBuildResponse instantiates a new BuildResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewBuildResponse(data Build) *BuildResponse { + this := BuildResponse{} + this.Data = data + return &this +} + +// NewBuildResponseWithDefaults instantiates a new BuildResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewBuildResponseWithDefaults() *BuildResponse { + this := BuildResponse{} + return &this +} + +// GetData returns the Data field value +func (o *BuildResponse) GetData() Build { + if o == nil { + var ret Build + return ret + } + + return o.Data +} + +// GetDataOk returns a tuple with the Data field value +// and a boolean to check if the value has been set. +func (o *BuildResponse) GetDataOk() (*Build, bool) { + if o == nil { + return nil, false + } + return &o.Data, true +} + +// SetData sets field value +func (o *BuildResponse) SetData(v Build) { + o.Data = v +} + +func (o BuildResponse) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o BuildResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["data"] = o.Data + return toSerialize, nil +} + +func (o *BuildResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "data", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varBuildResponse := _BuildResponse{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varBuildResponse) + + if err != nil { + return err + } + + *o = BuildResponse(varBuildResponse) + + return err +} + +type NullableBuildResponse struct { + value *BuildResponse + isSet bool +} + +func (v NullableBuildResponse) Get() *BuildResponse { + return v.value +} + +func (v *NullableBuildResponse) Set(val *BuildResponse) { + v.value = val + v.isSet = true +} + +func (v NullableBuildResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableBuildResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBuildResponse(val *BuildResponse) *NullableBuildResponse { + return &NullableBuildResponse{value: val, isSet: true} +} + +func (v NullableBuildResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBuildResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_build_short.go b/model_build_short.go new file mode 100644 index 0000000..7327ccc --- /dev/null +++ b/model_build_short.go @@ -0,0 +1,461 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" + "time" + "bytes" + "fmt" +) + +// checks if the BuildShort type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &BuildShort{} + +// BuildShort struct for BuildShort +type BuildShort struct { + Id string `json:"id"` + ActId *string `json:"actId,omitempty"` + UserId *string `json:"userId,omitempty"` + Status ActorJobStatus `json:"status"` + StartedAt time.Time `json:"startedAt"` + FinishedAt NullableTime `json:"finishedAt,omitempty"` + UsageTotalUsd float32 `json:"usageTotalUsd"` + BuildNumber string `json:"buildNumber" validate:"regexp=^([0-9]|[1-9][0-9])\\\\.([0-9]|[1-9][0-9])(\\\\.[1-9][0-9]{0,4})$"` + BuildNumberInt *int32 `json:"buildNumberInt,omitempty"` + Meta *BuildsMeta `json:"meta,omitempty"` +} + +type _BuildShort BuildShort + +// NewBuildShort instantiates a new BuildShort object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewBuildShort(id string, status ActorJobStatus, startedAt time.Time, usageTotalUsd float32, buildNumber string) *BuildShort { + this := BuildShort{} + this.Id = id + this.Status = status + this.StartedAt = startedAt + this.UsageTotalUsd = usageTotalUsd + this.BuildNumber = buildNumber + return &this +} + +// NewBuildShortWithDefaults instantiates a new BuildShort object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewBuildShortWithDefaults() *BuildShort { + this := BuildShort{} + return &this +} + +// GetId returns the Id field value +func (o *BuildShort) GetId() string { + if o == nil { + var ret string + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *BuildShort) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *BuildShort) SetId(v string) { + o.Id = v +} + +// GetActId returns the ActId field value if set, zero value otherwise. +func (o *BuildShort) GetActId() string { + if o == nil || IsNil(o.ActId) { + var ret string + return ret + } + return *o.ActId +} + +// GetActIdOk returns a tuple with the ActId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BuildShort) GetActIdOk() (*string, bool) { + if o == nil || IsNil(o.ActId) { + return nil, false + } + return o.ActId, true +} + +// HasActId returns a boolean if a field has been set. +func (o *BuildShort) HasActId() bool { + if o != nil && !IsNil(o.ActId) { + return true + } + + return false +} + +// SetActId gets a reference to the given string and assigns it to the ActId field. +func (o *BuildShort) SetActId(v string) { + o.ActId = &v +} + +// GetUserId returns the UserId field value if set, zero value otherwise. +func (o *BuildShort) GetUserId() string { + if o == nil || IsNil(o.UserId) { + var ret string + return ret + } + return *o.UserId +} + +// GetUserIdOk returns a tuple with the UserId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BuildShort) GetUserIdOk() (*string, bool) { + if o == nil || IsNil(o.UserId) { + return nil, false + } + return o.UserId, true +} + +// HasUserId returns a boolean if a field has been set. +func (o *BuildShort) HasUserId() bool { + if o != nil && !IsNil(o.UserId) { + return true + } + + return false +} + +// SetUserId gets a reference to the given string and assigns it to the UserId field. +func (o *BuildShort) SetUserId(v string) { + o.UserId = &v +} + +// GetStatus returns the Status field value +func (o *BuildShort) GetStatus() ActorJobStatus { + if o == nil { + var ret ActorJobStatus + return ret + } + + return o.Status +} + +// GetStatusOk returns a tuple with the Status field value +// and a boolean to check if the value has been set. +func (o *BuildShort) GetStatusOk() (*ActorJobStatus, bool) { + if o == nil { + return nil, false + } + return &o.Status, true +} + +// SetStatus sets field value +func (o *BuildShort) SetStatus(v ActorJobStatus) { + o.Status = v +} + +// GetStartedAt returns the StartedAt field value +func (o *BuildShort) GetStartedAt() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.StartedAt +} + +// GetStartedAtOk returns a tuple with the StartedAt field value +// and a boolean to check if the value has been set. +func (o *BuildShort) GetStartedAtOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.StartedAt, true +} + +// SetStartedAt sets field value +func (o *BuildShort) SetStartedAt(v time.Time) { + o.StartedAt = v +} + +// GetFinishedAt returns the FinishedAt field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *BuildShort) GetFinishedAt() time.Time { + if o == nil || IsNil(o.FinishedAt.Get()) { + var ret time.Time + return ret + } + return *o.FinishedAt.Get() +} + +// GetFinishedAtOk returns a tuple with the FinishedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *BuildShort) GetFinishedAtOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.FinishedAt.Get(), o.FinishedAt.IsSet() +} + +// HasFinishedAt returns a boolean if a field has been set. +func (o *BuildShort) HasFinishedAt() bool { + if o != nil && o.FinishedAt.IsSet() { + return true + } + + return false +} + +// SetFinishedAt gets a reference to the given NullableTime and assigns it to the FinishedAt field. +func (o *BuildShort) SetFinishedAt(v time.Time) { + o.FinishedAt.Set(&v) +} +// SetFinishedAtNil sets the value for FinishedAt to be an explicit nil +func (o *BuildShort) SetFinishedAtNil() { + o.FinishedAt.Set(nil) +} + +// UnsetFinishedAt ensures that no value is present for FinishedAt, not even an explicit nil +func (o *BuildShort) UnsetFinishedAt() { + o.FinishedAt.Unset() +} + +// GetUsageTotalUsd returns the UsageTotalUsd field value +func (o *BuildShort) GetUsageTotalUsd() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.UsageTotalUsd +} + +// GetUsageTotalUsdOk returns a tuple with the UsageTotalUsd field value +// and a boolean to check if the value has been set. +func (o *BuildShort) GetUsageTotalUsdOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.UsageTotalUsd, true +} + +// SetUsageTotalUsd sets field value +func (o *BuildShort) SetUsageTotalUsd(v float32) { + o.UsageTotalUsd = v +} + +// GetBuildNumber returns the BuildNumber field value +func (o *BuildShort) GetBuildNumber() string { + if o == nil { + var ret string + return ret + } + + return o.BuildNumber +} + +// GetBuildNumberOk returns a tuple with the BuildNumber field value +// and a boolean to check if the value has been set. +func (o *BuildShort) GetBuildNumberOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.BuildNumber, true +} + +// SetBuildNumber sets field value +func (o *BuildShort) SetBuildNumber(v string) { + o.BuildNumber = v +} + +// GetBuildNumberInt returns the BuildNumberInt field value if set, zero value otherwise. +func (o *BuildShort) GetBuildNumberInt() int32 { + if o == nil || IsNil(o.BuildNumberInt) { + var ret int32 + return ret + } + return *o.BuildNumberInt +} + +// GetBuildNumberIntOk returns a tuple with the BuildNumberInt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BuildShort) GetBuildNumberIntOk() (*int32, bool) { + if o == nil || IsNil(o.BuildNumberInt) { + return nil, false + } + return o.BuildNumberInt, true +} + +// HasBuildNumberInt returns a boolean if a field has been set. +func (o *BuildShort) HasBuildNumberInt() bool { + if o != nil && !IsNil(o.BuildNumberInt) { + return true + } + + return false +} + +// SetBuildNumberInt gets a reference to the given int32 and assigns it to the BuildNumberInt field. +func (o *BuildShort) SetBuildNumberInt(v int32) { + o.BuildNumberInt = &v +} + +// GetMeta returns the Meta field value if set, zero value otherwise. +func (o *BuildShort) GetMeta() BuildsMeta { + if o == nil || IsNil(o.Meta) { + var ret BuildsMeta + return ret + } + return *o.Meta +} + +// GetMetaOk returns a tuple with the Meta field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BuildShort) GetMetaOk() (*BuildsMeta, bool) { + if o == nil || IsNil(o.Meta) { + return nil, false + } + return o.Meta, true +} + +// HasMeta returns a boolean if a field has been set. +func (o *BuildShort) HasMeta() bool { + if o != nil && !IsNil(o.Meta) { + return true + } + + return false +} + +// SetMeta gets a reference to the given BuildsMeta and assigns it to the Meta field. +func (o *BuildShort) SetMeta(v BuildsMeta) { + o.Meta = &v +} + +func (o BuildShort) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o BuildShort) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + if !IsNil(o.ActId) { + toSerialize["actId"] = o.ActId + } + if !IsNil(o.UserId) { + toSerialize["userId"] = o.UserId + } + toSerialize["status"] = o.Status + toSerialize["startedAt"] = o.StartedAt + if o.FinishedAt.IsSet() { + toSerialize["finishedAt"] = o.FinishedAt.Get() + } + toSerialize["usageTotalUsd"] = o.UsageTotalUsd + toSerialize["buildNumber"] = o.BuildNumber + if !IsNil(o.BuildNumberInt) { + toSerialize["buildNumberInt"] = o.BuildNumberInt + } + if !IsNil(o.Meta) { + toSerialize["meta"] = o.Meta + } + return toSerialize, nil +} + +func (o *BuildShort) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "status", + "startedAt", + "usageTotalUsd", + "buildNumber", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varBuildShort := _BuildShort{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varBuildShort) + + if err != nil { + return err + } + + *o = BuildShort(varBuildShort) + + return err +} + +type NullableBuildShort struct { + value *BuildShort + isSet bool +} + +func (v NullableBuildShort) Get() *BuildShort { + return v.value +} + +func (v *NullableBuildShort) Set(val *BuildShort) { + v.value = val + v.isSet = true +} + +func (v NullableBuildShort) IsSet() bool { + return v.isSet +} + +func (v *NullableBuildShort) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBuildShort(val *BuildShort) *NullableBuildShort { + return &NullableBuildShort{value: val, isSet: true} +} + +func (v NullableBuildShort) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBuildShort) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_build_stats.go b/model_build_stats.go new file mode 100644 index 0000000..344afca --- /dev/null +++ b/model_build_stats.go @@ -0,0 +1,266 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" + "bytes" + "fmt" +) + +// checks if the BuildStats type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &BuildStats{} + +// BuildStats struct for BuildStats +type BuildStats struct { + DurationMillis *int32 `json:"durationMillis,omitempty"` + RunTimeSecs *float32 `json:"runTimeSecs,omitempty"` + ComputeUnits float32 `json:"computeUnits"` + ImageSizeBytes *int32 `json:"imageSizeBytes,omitempty"` +} + +type _BuildStats BuildStats + +// NewBuildStats instantiates a new BuildStats object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewBuildStats(computeUnits float32) *BuildStats { + this := BuildStats{} + this.ComputeUnits = computeUnits + return &this +} + +// NewBuildStatsWithDefaults instantiates a new BuildStats object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewBuildStatsWithDefaults() *BuildStats { + this := BuildStats{} + return &this +} + +// GetDurationMillis returns the DurationMillis field value if set, zero value otherwise. +func (o *BuildStats) GetDurationMillis() int32 { + if o == nil || IsNil(o.DurationMillis) { + var ret int32 + return ret + } + return *o.DurationMillis +} + +// GetDurationMillisOk returns a tuple with the DurationMillis field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BuildStats) GetDurationMillisOk() (*int32, bool) { + if o == nil || IsNil(o.DurationMillis) { + return nil, false + } + return o.DurationMillis, true +} + +// HasDurationMillis returns a boolean if a field has been set. +func (o *BuildStats) HasDurationMillis() bool { + if o != nil && !IsNil(o.DurationMillis) { + return true + } + + return false +} + +// SetDurationMillis gets a reference to the given int32 and assigns it to the DurationMillis field. +func (o *BuildStats) SetDurationMillis(v int32) { + o.DurationMillis = &v +} + +// GetRunTimeSecs returns the RunTimeSecs field value if set, zero value otherwise. +func (o *BuildStats) GetRunTimeSecs() float32 { + if o == nil || IsNil(o.RunTimeSecs) { + var ret float32 + return ret + } + return *o.RunTimeSecs +} + +// GetRunTimeSecsOk returns a tuple with the RunTimeSecs field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BuildStats) GetRunTimeSecsOk() (*float32, bool) { + if o == nil || IsNil(o.RunTimeSecs) { + return nil, false + } + return o.RunTimeSecs, true +} + +// HasRunTimeSecs returns a boolean if a field has been set. +func (o *BuildStats) HasRunTimeSecs() bool { + if o != nil && !IsNil(o.RunTimeSecs) { + return true + } + + return false +} + +// SetRunTimeSecs gets a reference to the given float32 and assigns it to the RunTimeSecs field. +func (o *BuildStats) SetRunTimeSecs(v float32) { + o.RunTimeSecs = &v +} + +// GetComputeUnits returns the ComputeUnits field value +func (o *BuildStats) GetComputeUnits() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.ComputeUnits +} + +// GetComputeUnitsOk returns a tuple with the ComputeUnits field value +// and a boolean to check if the value has been set. +func (o *BuildStats) GetComputeUnitsOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.ComputeUnits, true +} + +// SetComputeUnits sets field value +func (o *BuildStats) SetComputeUnits(v float32) { + o.ComputeUnits = v +} + +// GetImageSizeBytes returns the ImageSizeBytes field value if set, zero value otherwise. +func (o *BuildStats) GetImageSizeBytes() int32 { + if o == nil || IsNil(o.ImageSizeBytes) { + var ret int32 + return ret + } + return *o.ImageSizeBytes +} + +// GetImageSizeBytesOk returns a tuple with the ImageSizeBytes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BuildStats) GetImageSizeBytesOk() (*int32, bool) { + if o == nil || IsNil(o.ImageSizeBytes) { + return nil, false + } + return o.ImageSizeBytes, true +} + +// HasImageSizeBytes returns a boolean if a field has been set. +func (o *BuildStats) HasImageSizeBytes() bool { + if o != nil && !IsNil(o.ImageSizeBytes) { + return true + } + + return false +} + +// SetImageSizeBytes gets a reference to the given int32 and assigns it to the ImageSizeBytes field. +func (o *BuildStats) SetImageSizeBytes(v int32) { + o.ImageSizeBytes = &v +} + +func (o BuildStats) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o BuildStats) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.DurationMillis) { + toSerialize["durationMillis"] = o.DurationMillis + } + if !IsNil(o.RunTimeSecs) { + toSerialize["runTimeSecs"] = o.RunTimeSecs + } + toSerialize["computeUnits"] = o.ComputeUnits + if !IsNil(o.ImageSizeBytes) { + toSerialize["imageSizeBytes"] = o.ImageSizeBytes + } + return toSerialize, nil +} + +func (o *BuildStats) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "computeUnits", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varBuildStats := _BuildStats{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varBuildStats) + + if err != nil { + return err + } + + *o = BuildStats(varBuildStats) + + return err +} + +type NullableBuildStats struct { + value *BuildStats + isSet bool +} + +func (v NullableBuildStats) Get() *BuildStats { + return v.value +} + +func (v *NullableBuildStats) Set(val *BuildStats) { + v.value = val + v.isSet = true +} + +func (v NullableBuildStats) IsSet() bool { + return v.isSet +} + +func (v *NullableBuildStats) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBuildStats(val *BuildStats) *NullableBuildStats { + return &NullableBuildStats{value: val, isSet: true} +} + +func (v NullableBuildStats) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBuildStats) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_build_tag.go b/model_build_tag.go new file mode 100644 index 0000000..e74fc1d --- /dev/null +++ b/model_build_tag.go @@ -0,0 +1,158 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" + "bytes" + "fmt" +) + +// checks if the BuildTag type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &BuildTag{} + +// BuildTag struct for BuildTag +type BuildTag struct { + BuildId string `json:"buildId"` +} + +type _BuildTag BuildTag + +// NewBuildTag instantiates a new BuildTag object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewBuildTag(buildId string) *BuildTag { + this := BuildTag{} + this.BuildId = buildId + return &this +} + +// NewBuildTagWithDefaults instantiates a new BuildTag object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewBuildTagWithDefaults() *BuildTag { + this := BuildTag{} + return &this +} + +// GetBuildId returns the BuildId field value +func (o *BuildTag) GetBuildId() string { + if o == nil { + var ret string + return ret + } + + return o.BuildId +} + +// GetBuildIdOk returns a tuple with the BuildId field value +// and a boolean to check if the value has been set. +func (o *BuildTag) GetBuildIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.BuildId, true +} + +// SetBuildId sets field value +func (o *BuildTag) SetBuildId(v string) { + o.BuildId = v +} + +func (o BuildTag) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o BuildTag) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["buildId"] = o.BuildId + return toSerialize, nil +} + +func (o *BuildTag) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "buildId", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varBuildTag := _BuildTag{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varBuildTag) + + if err != nil { + return err + } + + *o = BuildTag(varBuildTag) + + return err +} + +type NullableBuildTag struct { + value *BuildTag + isSet bool +} + +func (v NullableBuildTag) Get() *BuildTag { + return v.value +} + +func (v *NullableBuildTag) Set(val *BuildTag) { + v.value = val + v.isSet = true +} + +func (v NullableBuildTag) IsSet() bool { + return v.isSet +} + +func (v *NullableBuildTag) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBuildTag(val *BuildTag) *NullableBuildTag { + return &NullableBuildTag{value: val, isSet: true} +} + +func (v NullableBuildTag) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBuildTag) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_build_usage.go b/model_build_usage.go new file mode 100644 index 0000000..73350b6 --- /dev/null +++ b/model_build_usage.go @@ -0,0 +1,136 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" +) + +// checks if the BuildUsage type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &BuildUsage{} + +// BuildUsage struct for BuildUsage +type BuildUsage struct { + ACTOR_COMPUTE_UNITS NullableFloat32 `json:"ACTOR_COMPUTE_UNITS,omitempty"` +} + +// NewBuildUsage instantiates a new BuildUsage object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewBuildUsage() *BuildUsage { + this := BuildUsage{} + return &this +} + +// NewBuildUsageWithDefaults instantiates a new BuildUsage object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewBuildUsageWithDefaults() *BuildUsage { + this := BuildUsage{} + return &this +} + +// GetACTOR_COMPUTE_UNITS returns the ACTOR_COMPUTE_UNITS field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *BuildUsage) GetACTOR_COMPUTE_UNITS() float32 { + if o == nil || IsNil(o.ACTOR_COMPUTE_UNITS.Get()) { + var ret float32 + return ret + } + return *o.ACTOR_COMPUTE_UNITS.Get() +} + +// GetACTOR_COMPUTE_UNITSOk returns a tuple with the ACTOR_COMPUTE_UNITS field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *BuildUsage) GetACTOR_COMPUTE_UNITSOk() (*float32, bool) { + if o == nil { + return nil, false + } + return o.ACTOR_COMPUTE_UNITS.Get(), o.ACTOR_COMPUTE_UNITS.IsSet() +} + +// HasACTOR_COMPUTE_UNITS returns a boolean if a field has been set. +func (o *BuildUsage) HasACTOR_COMPUTE_UNITS() bool { + if o != nil && o.ACTOR_COMPUTE_UNITS.IsSet() { + return true + } + + return false +} + +// SetACTOR_COMPUTE_UNITS gets a reference to the given NullableFloat32 and assigns it to the ACTOR_COMPUTE_UNITS field. +func (o *BuildUsage) SetACTOR_COMPUTE_UNITS(v float32) { + o.ACTOR_COMPUTE_UNITS.Set(&v) +} +// SetACTOR_COMPUTE_UNITSNil sets the value for ACTOR_COMPUTE_UNITS to be an explicit nil +func (o *BuildUsage) SetACTOR_COMPUTE_UNITSNil() { + o.ACTOR_COMPUTE_UNITS.Set(nil) +} + +// UnsetACTOR_COMPUTE_UNITS ensures that no value is present for ACTOR_COMPUTE_UNITS, not even an explicit nil +func (o *BuildUsage) UnsetACTOR_COMPUTE_UNITS() { + o.ACTOR_COMPUTE_UNITS.Unset() +} + +func (o BuildUsage) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o BuildUsage) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.ACTOR_COMPUTE_UNITS.IsSet() { + toSerialize["ACTOR_COMPUTE_UNITS"] = o.ACTOR_COMPUTE_UNITS.Get() + } + return toSerialize, nil +} + +type NullableBuildUsage struct { + value *BuildUsage + isSet bool +} + +func (v NullableBuildUsage) Get() *BuildUsage { + return v.value +} + +func (v *NullableBuildUsage) Set(val *BuildUsage) { + v.value = val + v.isSet = true +} + +func (v NullableBuildUsage) IsSet() bool { + return v.isSet +} + +func (v *NullableBuildUsage) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBuildUsage(val *BuildUsage) *NullableBuildUsage { + return &NullableBuildUsage{value: val, isSet: true} +} + +func (v NullableBuildUsage) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBuildUsage) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_builds_meta.go b/model_builds_meta.go new file mode 100644 index 0000000..7e28911 --- /dev/null +++ b/model_builds_meta.go @@ -0,0 +1,232 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" + "bytes" + "fmt" +) + +// checks if the BuildsMeta type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &BuildsMeta{} + +// BuildsMeta struct for BuildsMeta +type BuildsMeta struct { + Origin RunOrigin `json:"origin"` + // IP address of the client that started the build. + ClientIp *string `json:"clientIp,omitempty"` + // User agent of the client that started the build. + UserAgent *string `json:"userAgent,omitempty"` +} + +type _BuildsMeta BuildsMeta + +// NewBuildsMeta instantiates a new BuildsMeta object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewBuildsMeta(origin RunOrigin) *BuildsMeta { + this := BuildsMeta{} + this.Origin = origin + return &this +} + +// NewBuildsMetaWithDefaults instantiates a new BuildsMeta object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewBuildsMetaWithDefaults() *BuildsMeta { + this := BuildsMeta{} + return &this +} + +// GetOrigin returns the Origin field value +func (o *BuildsMeta) GetOrigin() RunOrigin { + if o == nil { + var ret RunOrigin + return ret + } + + return o.Origin +} + +// GetOriginOk returns a tuple with the Origin field value +// and a boolean to check if the value has been set. +func (o *BuildsMeta) GetOriginOk() (*RunOrigin, bool) { + if o == nil { + return nil, false + } + return &o.Origin, true +} + +// SetOrigin sets field value +func (o *BuildsMeta) SetOrigin(v RunOrigin) { + o.Origin = v +} + +// GetClientIp returns the ClientIp field value if set, zero value otherwise. +func (o *BuildsMeta) GetClientIp() string { + if o == nil || IsNil(o.ClientIp) { + var ret string + return ret + } + return *o.ClientIp +} + +// GetClientIpOk returns a tuple with the ClientIp field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BuildsMeta) GetClientIpOk() (*string, bool) { + if o == nil || IsNil(o.ClientIp) { + return nil, false + } + return o.ClientIp, true +} + +// HasClientIp returns a boolean if a field has been set. +func (o *BuildsMeta) HasClientIp() bool { + if o != nil && !IsNil(o.ClientIp) { + return true + } + + return false +} + +// SetClientIp gets a reference to the given string and assigns it to the ClientIp field. +func (o *BuildsMeta) SetClientIp(v string) { + o.ClientIp = &v +} + +// GetUserAgent returns the UserAgent field value if set, zero value otherwise. +func (o *BuildsMeta) GetUserAgent() string { + if o == nil || IsNil(o.UserAgent) { + var ret string + return ret + } + return *o.UserAgent +} + +// GetUserAgentOk returns a tuple with the UserAgent field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BuildsMeta) GetUserAgentOk() (*string, bool) { + if o == nil || IsNil(o.UserAgent) { + return nil, false + } + return o.UserAgent, true +} + +// HasUserAgent returns a boolean if a field has been set. +func (o *BuildsMeta) HasUserAgent() bool { + if o != nil && !IsNil(o.UserAgent) { + return true + } + + return false +} + +// SetUserAgent gets a reference to the given string and assigns it to the UserAgent field. +func (o *BuildsMeta) SetUserAgent(v string) { + o.UserAgent = &v +} + +func (o BuildsMeta) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o BuildsMeta) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["origin"] = o.Origin + if !IsNil(o.ClientIp) { + toSerialize["clientIp"] = o.ClientIp + } + if !IsNil(o.UserAgent) { + toSerialize["userAgent"] = o.UserAgent + } + return toSerialize, nil +} + +func (o *BuildsMeta) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "origin", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varBuildsMeta := _BuildsMeta{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varBuildsMeta) + + if err != nil { + return err + } + + *o = BuildsMeta(varBuildsMeta) + + return err +} + +type NullableBuildsMeta struct { + value *BuildsMeta + isSet bool +} + +func (v NullableBuildsMeta) Get() *BuildsMeta { + return v.value +} + +func (v *NullableBuildsMeta) Set(val *BuildsMeta) { + v.value = val + v.isSet = true +} + +func (v NullableBuildsMeta) IsSet() bool { + return v.isSet +} + +func (v *NullableBuildsMeta) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBuildsMeta(val *BuildsMeta) *NullableBuildsMeta { + return &NullableBuildsMeta{value: val, isSet: true} +} + +func (v NullableBuildsMeta) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBuildsMeta) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_calls_inner.go b/model_calls_inner.go new file mode 100644 index 0000000..09e00b3 --- /dev/null +++ b/model_calls_inner.go @@ -0,0 +1,321 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" + "time" +) + +// checks if the CallsInner type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CallsInner{} + +// CallsInner struct for CallsInner +type CallsInner struct { + StartedAt NullableTime `json:"startedAt,omitempty"` + FinishedAt NullableTime `json:"finishedAt,omitempty"` + ErrorMessage NullableString `json:"errorMessage,omitempty"` + ResponseStatus NullableInt32 `json:"responseStatus,omitempty"` + ResponseBody NullableString `json:"responseBody,omitempty"` +} + +// NewCallsInner instantiates a new CallsInner object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCallsInner() *CallsInner { + this := CallsInner{} + return &this +} + +// NewCallsInnerWithDefaults instantiates a new CallsInner object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCallsInnerWithDefaults() *CallsInner { + this := CallsInner{} + return &this +} + +// GetStartedAt returns the StartedAt field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *CallsInner) GetStartedAt() time.Time { + if o == nil || IsNil(o.StartedAt.Get()) { + var ret time.Time + return ret + } + return *o.StartedAt.Get() +} + +// GetStartedAtOk returns a tuple with the StartedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *CallsInner) GetStartedAtOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.StartedAt.Get(), o.StartedAt.IsSet() +} + +// HasStartedAt returns a boolean if a field has been set. +func (o *CallsInner) HasStartedAt() bool { + if o != nil && o.StartedAt.IsSet() { + return true + } + + return false +} + +// SetStartedAt gets a reference to the given NullableTime and assigns it to the StartedAt field. +func (o *CallsInner) SetStartedAt(v time.Time) { + o.StartedAt.Set(&v) +} +// SetStartedAtNil sets the value for StartedAt to be an explicit nil +func (o *CallsInner) SetStartedAtNil() { + o.StartedAt.Set(nil) +} + +// UnsetStartedAt ensures that no value is present for StartedAt, not even an explicit nil +func (o *CallsInner) UnsetStartedAt() { + o.StartedAt.Unset() +} + +// GetFinishedAt returns the FinishedAt field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *CallsInner) GetFinishedAt() time.Time { + if o == nil || IsNil(o.FinishedAt.Get()) { + var ret time.Time + return ret + } + return *o.FinishedAt.Get() +} + +// GetFinishedAtOk returns a tuple with the FinishedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *CallsInner) GetFinishedAtOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.FinishedAt.Get(), o.FinishedAt.IsSet() +} + +// HasFinishedAt returns a boolean if a field has been set. +func (o *CallsInner) HasFinishedAt() bool { + if o != nil && o.FinishedAt.IsSet() { + return true + } + + return false +} + +// SetFinishedAt gets a reference to the given NullableTime and assigns it to the FinishedAt field. +func (o *CallsInner) SetFinishedAt(v time.Time) { + o.FinishedAt.Set(&v) +} +// SetFinishedAtNil sets the value for FinishedAt to be an explicit nil +func (o *CallsInner) SetFinishedAtNil() { + o.FinishedAt.Set(nil) +} + +// UnsetFinishedAt ensures that no value is present for FinishedAt, not even an explicit nil +func (o *CallsInner) UnsetFinishedAt() { + o.FinishedAt.Unset() +} + +// GetErrorMessage returns the ErrorMessage field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *CallsInner) GetErrorMessage() string { + if o == nil || IsNil(o.ErrorMessage.Get()) { + var ret string + return ret + } + return *o.ErrorMessage.Get() +} + +// GetErrorMessageOk returns a tuple with the ErrorMessage field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *CallsInner) GetErrorMessageOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.ErrorMessage.Get(), o.ErrorMessage.IsSet() +} + +// HasErrorMessage returns a boolean if a field has been set. +func (o *CallsInner) HasErrorMessage() bool { + if o != nil && o.ErrorMessage.IsSet() { + return true + } + + return false +} + +// SetErrorMessage gets a reference to the given NullableString and assigns it to the ErrorMessage field. +func (o *CallsInner) SetErrorMessage(v string) { + o.ErrorMessage.Set(&v) +} +// SetErrorMessageNil sets the value for ErrorMessage to be an explicit nil +func (o *CallsInner) SetErrorMessageNil() { + o.ErrorMessage.Set(nil) +} + +// UnsetErrorMessage ensures that no value is present for ErrorMessage, not even an explicit nil +func (o *CallsInner) UnsetErrorMessage() { + o.ErrorMessage.Unset() +} + +// GetResponseStatus returns the ResponseStatus field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *CallsInner) GetResponseStatus() int32 { + if o == nil || IsNil(o.ResponseStatus.Get()) { + var ret int32 + return ret + } + return *o.ResponseStatus.Get() +} + +// GetResponseStatusOk returns a tuple with the ResponseStatus field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *CallsInner) GetResponseStatusOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.ResponseStatus.Get(), o.ResponseStatus.IsSet() +} + +// HasResponseStatus returns a boolean if a field has been set. +func (o *CallsInner) HasResponseStatus() bool { + if o != nil && o.ResponseStatus.IsSet() { + return true + } + + return false +} + +// SetResponseStatus gets a reference to the given NullableInt32 and assigns it to the ResponseStatus field. +func (o *CallsInner) SetResponseStatus(v int32) { + o.ResponseStatus.Set(&v) +} +// SetResponseStatusNil sets the value for ResponseStatus to be an explicit nil +func (o *CallsInner) SetResponseStatusNil() { + o.ResponseStatus.Set(nil) +} + +// UnsetResponseStatus ensures that no value is present for ResponseStatus, not even an explicit nil +func (o *CallsInner) UnsetResponseStatus() { + o.ResponseStatus.Unset() +} + +// GetResponseBody returns the ResponseBody field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *CallsInner) GetResponseBody() string { + if o == nil || IsNil(o.ResponseBody.Get()) { + var ret string + return ret + } + return *o.ResponseBody.Get() +} + +// GetResponseBodyOk returns a tuple with the ResponseBody field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *CallsInner) GetResponseBodyOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.ResponseBody.Get(), o.ResponseBody.IsSet() +} + +// HasResponseBody returns a boolean if a field has been set. +func (o *CallsInner) HasResponseBody() bool { + if o != nil && o.ResponseBody.IsSet() { + return true + } + + return false +} + +// SetResponseBody gets a reference to the given NullableString and assigns it to the ResponseBody field. +func (o *CallsInner) SetResponseBody(v string) { + o.ResponseBody.Set(&v) +} +// SetResponseBodyNil sets the value for ResponseBody to be an explicit nil +func (o *CallsInner) SetResponseBodyNil() { + o.ResponseBody.Set(nil) +} + +// UnsetResponseBody ensures that no value is present for ResponseBody, not even an explicit nil +func (o *CallsInner) UnsetResponseBody() { + o.ResponseBody.Unset() +} + +func (o CallsInner) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CallsInner) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.StartedAt.IsSet() { + toSerialize["startedAt"] = o.StartedAt.Get() + } + if o.FinishedAt.IsSet() { + toSerialize["finishedAt"] = o.FinishedAt.Get() + } + if o.ErrorMessage.IsSet() { + toSerialize["errorMessage"] = o.ErrorMessage.Get() + } + if o.ResponseStatus.IsSet() { + toSerialize["responseStatus"] = o.ResponseStatus.Get() + } + if o.ResponseBody.IsSet() { + toSerialize["responseBody"] = o.ResponseBody.Get() + } + return toSerialize, nil +} + +type NullableCallsInner struct { + value *CallsInner + isSet bool +} + +func (v NullableCallsInner) Get() *CallsInner { + return v.value +} + +func (v *NullableCallsInner) Set(val *CallsInner) { + v.value = val + v.isSet = true +} + +func (v NullableCallsInner) IsSet() bool { + return v.isSet +} + +func (v *NullableCallsInner) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCallsInner(val *CallsInner) *NullableCallsInner { + return &NullableCallsInner{value: val, isSet: true} +} + +func (v NullableCallsInner) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCallsInner) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_charge_run_request.go b/model_charge_run_request.go new file mode 100644 index 0000000..59888f5 --- /dev/null +++ b/model_charge_run_request.go @@ -0,0 +1,186 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" + "bytes" + "fmt" +) + +// checks if the ChargeRunRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ChargeRunRequest{} + +// ChargeRunRequest struct for ChargeRunRequest +type ChargeRunRequest struct { + EventName string `json:"eventName"` + Count int32 `json:"count"` +} + +type _ChargeRunRequest ChargeRunRequest + +// NewChargeRunRequest instantiates a new ChargeRunRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewChargeRunRequest(eventName string, count int32) *ChargeRunRequest { + this := ChargeRunRequest{} + this.EventName = eventName + this.Count = count + return &this +} + +// NewChargeRunRequestWithDefaults instantiates a new ChargeRunRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewChargeRunRequestWithDefaults() *ChargeRunRequest { + this := ChargeRunRequest{} + return &this +} + +// GetEventName returns the EventName field value +func (o *ChargeRunRequest) GetEventName() string { + if o == nil { + var ret string + return ret + } + + return o.EventName +} + +// GetEventNameOk returns a tuple with the EventName field value +// and a boolean to check if the value has been set. +func (o *ChargeRunRequest) GetEventNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.EventName, true +} + +// SetEventName sets field value +func (o *ChargeRunRequest) SetEventName(v string) { + o.EventName = v +} + +// GetCount returns the Count field value +func (o *ChargeRunRequest) GetCount() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Count +} + +// GetCountOk returns a tuple with the Count field value +// and a boolean to check if the value has been set. +func (o *ChargeRunRequest) GetCountOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Count, true +} + +// SetCount sets field value +func (o *ChargeRunRequest) SetCount(v int32) { + o.Count = v +} + +func (o ChargeRunRequest) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ChargeRunRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["eventName"] = o.EventName + toSerialize["count"] = o.Count + return toSerialize, nil +} + +func (o *ChargeRunRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "eventName", + "count", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varChargeRunRequest := _ChargeRunRequest{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varChargeRunRequest) + + if err != nil { + return err + } + + *o = ChargeRunRequest(varChargeRunRequest) + + return err +} + +type NullableChargeRunRequest struct { + value *ChargeRunRequest + isSet bool +} + +func (v NullableChargeRunRequest) Get() *ChargeRunRequest { + return v.value +} + +func (v *NullableChargeRunRequest) Set(val *ChargeRunRequest) { + v.value = val + v.isSet = true +} + +func (v NullableChargeRunRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableChargeRunRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableChargeRunRequest(val *ChargeRunRequest) *NullableChargeRunRequest { + return &NullableChargeRunRequest{value: val, isSet: true} +} + +func (v NullableChargeRunRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableChargeRunRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_common_actor_pricing_info.go b/model_common_actor_pricing_info.go new file mode 100644 index 0000000..4de86f0 --- /dev/null +++ b/model_common_actor_pricing_info.go @@ -0,0 +1,428 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" + "time" + "bytes" + "fmt" +) + +// checks if the CommonActorPricingInfo type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CommonActorPricingInfo{} + +// CommonActorPricingInfo struct for CommonActorPricingInfo +type CommonActorPricingInfo struct { + // In [0, 1], fraction of pricePerUnitUsd that goes to Apify + ApifyMarginPercentage float32 `json:"apifyMarginPercentage"` + // When this pricing info record has been created + CreatedAt time.Time `json:"createdAt"` + // Since when is this pricing info record effective for a given Actor + StartedAt time.Time `json:"startedAt"` + NotifiedAboutFutureChangeAt NullableTime `json:"notifiedAboutFutureChangeAt,omitempty"` + NotifiedAboutChangeAt NullableTime `json:"notifiedAboutChangeAt,omitempty"` + ReasonForChange NullableString `json:"reasonForChange,omitempty"` + IsPriceChangeNotificationSuppressed *bool `json:"isPriceChangeNotificationSuppressed,omitempty"` + ForceContainsSignificantPriceChange *bool `json:"forceContainsSignificantPriceChange,omitempty"` +} + +type _CommonActorPricingInfo CommonActorPricingInfo + +// NewCommonActorPricingInfo instantiates a new CommonActorPricingInfo object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCommonActorPricingInfo(apifyMarginPercentage float32, createdAt time.Time, startedAt time.Time) *CommonActorPricingInfo { + this := CommonActorPricingInfo{} + this.ApifyMarginPercentage = apifyMarginPercentage + this.CreatedAt = createdAt + this.StartedAt = startedAt + return &this +} + +// NewCommonActorPricingInfoWithDefaults instantiates a new CommonActorPricingInfo object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCommonActorPricingInfoWithDefaults() *CommonActorPricingInfo { + this := CommonActorPricingInfo{} + return &this +} + +// GetApifyMarginPercentage returns the ApifyMarginPercentage field value +func (o *CommonActorPricingInfo) GetApifyMarginPercentage() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.ApifyMarginPercentage +} + +// GetApifyMarginPercentageOk returns a tuple with the ApifyMarginPercentage field value +// and a boolean to check if the value has been set. +func (o *CommonActorPricingInfo) GetApifyMarginPercentageOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.ApifyMarginPercentage, true +} + +// SetApifyMarginPercentage sets field value +func (o *CommonActorPricingInfo) SetApifyMarginPercentage(v float32) { + o.ApifyMarginPercentage = v +} + +// GetCreatedAt returns the CreatedAt field value +func (o *CommonActorPricingInfo) GetCreatedAt() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value +// and a boolean to check if the value has been set. +func (o *CommonActorPricingInfo) GetCreatedAtOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.CreatedAt, true +} + +// SetCreatedAt sets field value +func (o *CommonActorPricingInfo) SetCreatedAt(v time.Time) { + o.CreatedAt = v +} + +// GetStartedAt returns the StartedAt field value +func (o *CommonActorPricingInfo) GetStartedAt() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.StartedAt +} + +// GetStartedAtOk returns a tuple with the StartedAt field value +// and a boolean to check if the value has been set. +func (o *CommonActorPricingInfo) GetStartedAtOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.StartedAt, true +} + +// SetStartedAt sets field value +func (o *CommonActorPricingInfo) SetStartedAt(v time.Time) { + o.StartedAt = v +} + +// GetNotifiedAboutFutureChangeAt returns the NotifiedAboutFutureChangeAt field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *CommonActorPricingInfo) GetNotifiedAboutFutureChangeAt() time.Time { + if o == nil || IsNil(o.NotifiedAboutFutureChangeAt.Get()) { + var ret time.Time + return ret + } + return *o.NotifiedAboutFutureChangeAt.Get() +} + +// GetNotifiedAboutFutureChangeAtOk returns a tuple with the NotifiedAboutFutureChangeAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *CommonActorPricingInfo) GetNotifiedAboutFutureChangeAtOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.NotifiedAboutFutureChangeAt.Get(), o.NotifiedAboutFutureChangeAt.IsSet() +} + +// HasNotifiedAboutFutureChangeAt returns a boolean if a field has been set. +func (o *CommonActorPricingInfo) HasNotifiedAboutFutureChangeAt() bool { + if o != nil && o.NotifiedAboutFutureChangeAt.IsSet() { + return true + } + + return false +} + +// SetNotifiedAboutFutureChangeAt gets a reference to the given NullableTime and assigns it to the NotifiedAboutFutureChangeAt field. +func (o *CommonActorPricingInfo) SetNotifiedAboutFutureChangeAt(v time.Time) { + o.NotifiedAboutFutureChangeAt.Set(&v) +} +// SetNotifiedAboutFutureChangeAtNil sets the value for NotifiedAboutFutureChangeAt to be an explicit nil +func (o *CommonActorPricingInfo) SetNotifiedAboutFutureChangeAtNil() { + o.NotifiedAboutFutureChangeAt.Set(nil) +} + +// UnsetNotifiedAboutFutureChangeAt ensures that no value is present for NotifiedAboutFutureChangeAt, not even an explicit nil +func (o *CommonActorPricingInfo) UnsetNotifiedAboutFutureChangeAt() { + o.NotifiedAboutFutureChangeAt.Unset() +} + +// GetNotifiedAboutChangeAt returns the NotifiedAboutChangeAt field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *CommonActorPricingInfo) GetNotifiedAboutChangeAt() time.Time { + if o == nil || IsNil(o.NotifiedAboutChangeAt.Get()) { + var ret time.Time + return ret + } + return *o.NotifiedAboutChangeAt.Get() +} + +// GetNotifiedAboutChangeAtOk returns a tuple with the NotifiedAboutChangeAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *CommonActorPricingInfo) GetNotifiedAboutChangeAtOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.NotifiedAboutChangeAt.Get(), o.NotifiedAboutChangeAt.IsSet() +} + +// HasNotifiedAboutChangeAt returns a boolean if a field has been set. +func (o *CommonActorPricingInfo) HasNotifiedAboutChangeAt() bool { + if o != nil && o.NotifiedAboutChangeAt.IsSet() { + return true + } + + return false +} + +// SetNotifiedAboutChangeAt gets a reference to the given NullableTime and assigns it to the NotifiedAboutChangeAt field. +func (o *CommonActorPricingInfo) SetNotifiedAboutChangeAt(v time.Time) { + o.NotifiedAboutChangeAt.Set(&v) +} +// SetNotifiedAboutChangeAtNil sets the value for NotifiedAboutChangeAt to be an explicit nil +func (o *CommonActorPricingInfo) SetNotifiedAboutChangeAtNil() { + o.NotifiedAboutChangeAt.Set(nil) +} + +// UnsetNotifiedAboutChangeAt ensures that no value is present for NotifiedAboutChangeAt, not even an explicit nil +func (o *CommonActorPricingInfo) UnsetNotifiedAboutChangeAt() { + o.NotifiedAboutChangeAt.Unset() +} + +// GetReasonForChange returns the ReasonForChange field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *CommonActorPricingInfo) GetReasonForChange() string { + if o == nil || IsNil(o.ReasonForChange.Get()) { + var ret string + return ret + } + return *o.ReasonForChange.Get() +} + +// GetReasonForChangeOk returns a tuple with the ReasonForChange field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *CommonActorPricingInfo) GetReasonForChangeOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.ReasonForChange.Get(), o.ReasonForChange.IsSet() +} + +// HasReasonForChange returns a boolean if a field has been set. +func (o *CommonActorPricingInfo) HasReasonForChange() bool { + if o != nil && o.ReasonForChange.IsSet() { + return true + } + + return false +} + +// SetReasonForChange gets a reference to the given NullableString and assigns it to the ReasonForChange field. +func (o *CommonActorPricingInfo) SetReasonForChange(v string) { + o.ReasonForChange.Set(&v) +} +// SetReasonForChangeNil sets the value for ReasonForChange to be an explicit nil +func (o *CommonActorPricingInfo) SetReasonForChangeNil() { + o.ReasonForChange.Set(nil) +} + +// UnsetReasonForChange ensures that no value is present for ReasonForChange, not even an explicit nil +func (o *CommonActorPricingInfo) UnsetReasonForChange() { + o.ReasonForChange.Unset() +} + +// GetIsPriceChangeNotificationSuppressed returns the IsPriceChangeNotificationSuppressed field value if set, zero value otherwise. +func (o *CommonActorPricingInfo) GetIsPriceChangeNotificationSuppressed() bool { + if o == nil || IsNil(o.IsPriceChangeNotificationSuppressed) { + var ret bool + return ret + } + return *o.IsPriceChangeNotificationSuppressed +} + +// GetIsPriceChangeNotificationSuppressedOk returns a tuple with the IsPriceChangeNotificationSuppressed field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CommonActorPricingInfo) GetIsPriceChangeNotificationSuppressedOk() (*bool, bool) { + if o == nil || IsNil(o.IsPriceChangeNotificationSuppressed) { + return nil, false + } + return o.IsPriceChangeNotificationSuppressed, true +} + +// HasIsPriceChangeNotificationSuppressed returns a boolean if a field has been set. +func (o *CommonActorPricingInfo) HasIsPriceChangeNotificationSuppressed() bool { + if o != nil && !IsNil(o.IsPriceChangeNotificationSuppressed) { + return true + } + + return false +} + +// SetIsPriceChangeNotificationSuppressed gets a reference to the given bool and assigns it to the IsPriceChangeNotificationSuppressed field. +func (o *CommonActorPricingInfo) SetIsPriceChangeNotificationSuppressed(v bool) { + o.IsPriceChangeNotificationSuppressed = &v +} + +// GetForceContainsSignificantPriceChange returns the ForceContainsSignificantPriceChange field value if set, zero value otherwise. +func (o *CommonActorPricingInfo) GetForceContainsSignificantPriceChange() bool { + if o == nil || IsNil(o.ForceContainsSignificantPriceChange) { + var ret bool + return ret + } + return *o.ForceContainsSignificantPriceChange +} + +// GetForceContainsSignificantPriceChangeOk returns a tuple with the ForceContainsSignificantPriceChange field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CommonActorPricingInfo) GetForceContainsSignificantPriceChangeOk() (*bool, bool) { + if o == nil || IsNil(o.ForceContainsSignificantPriceChange) { + return nil, false + } + return o.ForceContainsSignificantPriceChange, true +} + +// HasForceContainsSignificantPriceChange returns a boolean if a field has been set. +func (o *CommonActorPricingInfo) HasForceContainsSignificantPriceChange() bool { + if o != nil && !IsNil(o.ForceContainsSignificantPriceChange) { + return true + } + + return false +} + +// SetForceContainsSignificantPriceChange gets a reference to the given bool and assigns it to the ForceContainsSignificantPriceChange field. +func (o *CommonActorPricingInfo) SetForceContainsSignificantPriceChange(v bool) { + o.ForceContainsSignificantPriceChange = &v +} + +func (o CommonActorPricingInfo) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CommonActorPricingInfo) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["apifyMarginPercentage"] = o.ApifyMarginPercentage + toSerialize["createdAt"] = o.CreatedAt + toSerialize["startedAt"] = o.StartedAt + if o.NotifiedAboutFutureChangeAt.IsSet() { + toSerialize["notifiedAboutFutureChangeAt"] = o.NotifiedAboutFutureChangeAt.Get() + } + if o.NotifiedAboutChangeAt.IsSet() { + toSerialize["notifiedAboutChangeAt"] = o.NotifiedAboutChangeAt.Get() + } + if o.ReasonForChange.IsSet() { + toSerialize["reasonForChange"] = o.ReasonForChange.Get() + } + if !IsNil(o.IsPriceChangeNotificationSuppressed) { + toSerialize["isPriceChangeNotificationSuppressed"] = o.IsPriceChangeNotificationSuppressed + } + if !IsNil(o.ForceContainsSignificantPriceChange) { + toSerialize["forceContainsSignificantPriceChange"] = o.ForceContainsSignificantPriceChange + } + return toSerialize, nil +} + +func (o *CommonActorPricingInfo) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "apifyMarginPercentage", + "createdAt", + "startedAt", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varCommonActorPricingInfo := _CommonActorPricingInfo{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varCommonActorPricingInfo) + + if err != nil { + return err + } + + *o = CommonActorPricingInfo(varCommonActorPricingInfo) + + return err +} + +type NullableCommonActorPricingInfo struct { + value *CommonActorPricingInfo + isSet bool +} + +func (v NullableCommonActorPricingInfo) Get() *CommonActorPricingInfo { + return v.value +} + +func (v *NullableCommonActorPricingInfo) Set(val *CommonActorPricingInfo) { + v.value = val + v.isSet = true +} + +func (v NullableCommonActorPricingInfo) IsSet() bool { + return v.isSet +} + +func (v *NullableCommonActorPricingInfo) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCommonActorPricingInfo(val *CommonActorPricingInfo) *NullableCommonActorPricingInfo { + return &NullableCommonActorPricingInfo{value: val, isSet: true} +} + +func (v NullableCommonActorPricingInfo) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCommonActorPricingInfo) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_create_actor_request.go b/model_create_actor_request.go new file mode 100644 index 0000000..ccbafb3 --- /dev/null +++ b/model_create_actor_request.go @@ -0,0 +1,692 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" +) + +// checks if the CreateActorRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateActorRequest{} + +// CreateActorRequest struct for CreateActorRequest +type CreateActorRequest struct { + Name NullableString `json:"name,omitempty"` + Description NullableString `json:"description,omitempty"` + Title NullableString `json:"title,omitempty"` + IsPublic NullableBool `json:"isPublic,omitempty"` + SeoTitle NullableString `json:"seoTitle,omitempty"` + SeoDescription NullableString `json:"seoDescription,omitempty"` + // Deprecated + RestartOnError *bool `json:"restartOnError,omitempty"` + // + Versions []Version `json:"versions,omitempty"` + PricingInfos []ActorRunPricingInfo `json:"pricingInfos,omitempty"` + // + Categories []string `json:"categories,omitempty"` + DefaultRunOptions *DefaultRunOptions `json:"defaultRunOptions,omitempty"` + ActorStandby NullableActorStandby `json:"actorStandby,omitempty"` + ExampleRunInput NullableExampleRunInput `json:"exampleRunInput,omitempty"` + IsDeprecated NullableBool `json:"isDeprecated,omitempty"` +} + +// NewCreateActorRequest instantiates a new CreateActorRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCreateActorRequest() *CreateActorRequest { + this := CreateActorRequest{} + return &this +} + +// NewCreateActorRequestWithDefaults instantiates a new CreateActorRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCreateActorRequestWithDefaults() *CreateActorRequest { + this := CreateActorRequest{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *CreateActorRequest) GetName() string { + if o == nil || IsNil(o.Name.Get()) { + var ret string + return ret + } + return *o.Name.Get() +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *CreateActorRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Name.Get(), o.Name.IsSet() +} + +// HasName returns a boolean if a field has been set. +func (o *CreateActorRequest) HasName() bool { + if o != nil && o.Name.IsSet() { + return true + } + + return false +} + +// SetName gets a reference to the given NullableString and assigns it to the Name field. +func (o *CreateActorRequest) SetName(v string) { + o.Name.Set(&v) +} +// SetNameNil sets the value for Name to be an explicit nil +func (o *CreateActorRequest) SetNameNil() { + o.Name.Set(nil) +} + +// UnsetName ensures that no value is present for Name, not even an explicit nil +func (o *CreateActorRequest) UnsetName() { + o.Name.Unset() +} + +// GetDescription returns the Description field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *CreateActorRequest) GetDescription() string { + if o == nil || IsNil(o.Description.Get()) { + var ret string + return ret + } + return *o.Description.Get() +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *CreateActorRequest) GetDescriptionOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Description.Get(), o.Description.IsSet() +} + +// HasDescription returns a boolean if a field has been set. +func (o *CreateActorRequest) HasDescription() bool { + if o != nil && o.Description.IsSet() { + return true + } + + return false +} + +// SetDescription gets a reference to the given NullableString and assigns it to the Description field. +func (o *CreateActorRequest) SetDescription(v string) { + o.Description.Set(&v) +} +// SetDescriptionNil sets the value for Description to be an explicit nil +func (o *CreateActorRequest) SetDescriptionNil() { + o.Description.Set(nil) +} + +// UnsetDescription ensures that no value is present for Description, not even an explicit nil +func (o *CreateActorRequest) UnsetDescription() { + o.Description.Unset() +} + +// GetTitle returns the Title field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *CreateActorRequest) GetTitle() string { + if o == nil || IsNil(o.Title.Get()) { + var ret string + return ret + } + return *o.Title.Get() +} + +// GetTitleOk returns a tuple with the Title field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *CreateActorRequest) GetTitleOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Title.Get(), o.Title.IsSet() +} + +// HasTitle returns a boolean if a field has been set. +func (o *CreateActorRequest) HasTitle() bool { + if o != nil && o.Title.IsSet() { + return true + } + + return false +} + +// SetTitle gets a reference to the given NullableString and assigns it to the Title field. +func (o *CreateActorRequest) SetTitle(v string) { + o.Title.Set(&v) +} +// SetTitleNil sets the value for Title to be an explicit nil +func (o *CreateActorRequest) SetTitleNil() { + o.Title.Set(nil) +} + +// UnsetTitle ensures that no value is present for Title, not even an explicit nil +func (o *CreateActorRequest) UnsetTitle() { + o.Title.Unset() +} + +// GetIsPublic returns the IsPublic field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *CreateActorRequest) GetIsPublic() bool { + if o == nil || IsNil(o.IsPublic.Get()) { + var ret bool + return ret + } + return *o.IsPublic.Get() +} + +// GetIsPublicOk returns a tuple with the IsPublic field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *CreateActorRequest) GetIsPublicOk() (*bool, bool) { + if o == nil { + return nil, false + } + return o.IsPublic.Get(), o.IsPublic.IsSet() +} + +// HasIsPublic returns a boolean if a field has been set. +func (o *CreateActorRequest) HasIsPublic() bool { + if o != nil && o.IsPublic.IsSet() { + return true + } + + return false +} + +// SetIsPublic gets a reference to the given NullableBool and assigns it to the IsPublic field. +func (o *CreateActorRequest) SetIsPublic(v bool) { + o.IsPublic.Set(&v) +} +// SetIsPublicNil sets the value for IsPublic to be an explicit nil +func (o *CreateActorRequest) SetIsPublicNil() { + o.IsPublic.Set(nil) +} + +// UnsetIsPublic ensures that no value is present for IsPublic, not even an explicit nil +func (o *CreateActorRequest) UnsetIsPublic() { + o.IsPublic.Unset() +} + +// GetSeoTitle returns the SeoTitle field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *CreateActorRequest) GetSeoTitle() string { + if o == nil || IsNil(o.SeoTitle.Get()) { + var ret string + return ret + } + return *o.SeoTitle.Get() +} + +// GetSeoTitleOk returns a tuple with the SeoTitle field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *CreateActorRequest) GetSeoTitleOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.SeoTitle.Get(), o.SeoTitle.IsSet() +} + +// HasSeoTitle returns a boolean if a field has been set. +func (o *CreateActorRequest) HasSeoTitle() bool { + if o != nil && o.SeoTitle.IsSet() { + return true + } + + return false +} + +// SetSeoTitle gets a reference to the given NullableString and assigns it to the SeoTitle field. +func (o *CreateActorRequest) SetSeoTitle(v string) { + o.SeoTitle.Set(&v) +} +// SetSeoTitleNil sets the value for SeoTitle to be an explicit nil +func (o *CreateActorRequest) SetSeoTitleNil() { + o.SeoTitle.Set(nil) +} + +// UnsetSeoTitle ensures that no value is present for SeoTitle, not even an explicit nil +func (o *CreateActorRequest) UnsetSeoTitle() { + o.SeoTitle.Unset() +} + +// GetSeoDescription returns the SeoDescription field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *CreateActorRequest) GetSeoDescription() string { + if o == nil || IsNil(o.SeoDescription.Get()) { + var ret string + return ret + } + return *o.SeoDescription.Get() +} + +// GetSeoDescriptionOk returns a tuple with the SeoDescription field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *CreateActorRequest) GetSeoDescriptionOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.SeoDescription.Get(), o.SeoDescription.IsSet() +} + +// HasSeoDescription returns a boolean if a field has been set. +func (o *CreateActorRequest) HasSeoDescription() bool { + if o != nil && o.SeoDescription.IsSet() { + return true + } + + return false +} + +// SetSeoDescription gets a reference to the given NullableString and assigns it to the SeoDescription field. +func (o *CreateActorRequest) SetSeoDescription(v string) { + o.SeoDescription.Set(&v) +} +// SetSeoDescriptionNil sets the value for SeoDescription to be an explicit nil +func (o *CreateActorRequest) SetSeoDescriptionNil() { + o.SeoDescription.Set(nil) +} + +// UnsetSeoDescription ensures that no value is present for SeoDescription, not even an explicit nil +func (o *CreateActorRequest) UnsetSeoDescription() { + o.SeoDescription.Unset() +} + +// GetRestartOnError returns the RestartOnError field value if set, zero value otherwise. +// Deprecated +func (o *CreateActorRequest) GetRestartOnError() bool { + if o == nil || IsNil(o.RestartOnError) { + var ret bool + return ret + } + return *o.RestartOnError +} + +// GetRestartOnErrorOk returns a tuple with the RestartOnError field value if set, nil otherwise +// and a boolean to check if the value has been set. +// Deprecated +func (o *CreateActorRequest) GetRestartOnErrorOk() (*bool, bool) { + if o == nil || IsNil(o.RestartOnError) { + return nil, false + } + return o.RestartOnError, true +} + +// HasRestartOnError returns a boolean if a field has been set. +func (o *CreateActorRequest) HasRestartOnError() bool { + if o != nil && !IsNil(o.RestartOnError) { + return true + } + + return false +} + +// SetRestartOnError gets a reference to the given bool and assigns it to the RestartOnError field. +// Deprecated +func (o *CreateActorRequest) SetRestartOnError(v bool) { + o.RestartOnError = &v +} + +// GetVersions returns the Versions field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *CreateActorRequest) GetVersions() []Version { + if o == nil { + var ret []Version + return ret + } + return o.Versions +} + +// GetVersionsOk returns a tuple with the Versions field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *CreateActorRequest) GetVersionsOk() ([]Version, bool) { + if o == nil || IsNil(o.Versions) { + return nil, false + } + return o.Versions, true +} + +// HasVersions returns a boolean if a field has been set. +func (o *CreateActorRequest) HasVersions() bool { + if o != nil && !IsNil(o.Versions) { + return true + } + + return false +} + +// SetVersions gets a reference to the given []Version and assigns it to the Versions field. +func (o *CreateActorRequest) SetVersions(v []Version) { + o.Versions = v +} + +// GetPricingInfos returns the PricingInfos field value if set, zero value otherwise. +func (o *CreateActorRequest) GetPricingInfos() []ActorRunPricingInfo { + if o == nil || IsNil(o.PricingInfos) { + var ret []ActorRunPricingInfo + return ret + } + return o.PricingInfos +} + +// GetPricingInfosOk returns a tuple with the PricingInfos field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateActorRequest) GetPricingInfosOk() ([]ActorRunPricingInfo, bool) { + if o == nil || IsNil(o.PricingInfos) { + return nil, false + } + return o.PricingInfos, true +} + +// HasPricingInfos returns a boolean if a field has been set. +func (o *CreateActorRequest) HasPricingInfos() bool { + if o != nil && !IsNil(o.PricingInfos) { + return true + } + + return false +} + +// SetPricingInfos gets a reference to the given []ActorRunPricingInfo and assigns it to the PricingInfos field. +func (o *CreateActorRequest) SetPricingInfos(v []ActorRunPricingInfo) { + o.PricingInfos = v +} + +// GetCategories returns the Categories field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *CreateActorRequest) GetCategories() []string { + if o == nil { + var ret []string + return ret + } + return o.Categories +} + +// GetCategoriesOk returns a tuple with the Categories field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *CreateActorRequest) GetCategoriesOk() ([]string, bool) { + if o == nil || IsNil(o.Categories) { + return nil, false + } + return o.Categories, true +} + +// HasCategories returns a boolean if a field has been set. +func (o *CreateActorRequest) HasCategories() bool { + if o != nil && !IsNil(o.Categories) { + return true + } + + return false +} + +// SetCategories gets a reference to the given []string and assigns it to the Categories field. +func (o *CreateActorRequest) SetCategories(v []string) { + o.Categories = v +} + +// GetDefaultRunOptions returns the DefaultRunOptions field value if set, zero value otherwise. +func (o *CreateActorRequest) GetDefaultRunOptions() DefaultRunOptions { + if o == nil || IsNil(o.DefaultRunOptions) { + var ret DefaultRunOptions + return ret + } + return *o.DefaultRunOptions +} + +// GetDefaultRunOptionsOk returns a tuple with the DefaultRunOptions field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateActorRequest) GetDefaultRunOptionsOk() (*DefaultRunOptions, bool) { + if o == nil || IsNil(o.DefaultRunOptions) { + return nil, false + } + return o.DefaultRunOptions, true +} + +// HasDefaultRunOptions returns a boolean if a field has been set. +func (o *CreateActorRequest) HasDefaultRunOptions() bool { + if o != nil && !IsNil(o.DefaultRunOptions) { + return true + } + + return false +} + +// SetDefaultRunOptions gets a reference to the given DefaultRunOptions and assigns it to the DefaultRunOptions field. +func (o *CreateActorRequest) SetDefaultRunOptions(v DefaultRunOptions) { + o.DefaultRunOptions = &v +} + +// GetActorStandby returns the ActorStandby field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *CreateActorRequest) GetActorStandby() ActorStandby { + if o == nil || IsNil(o.ActorStandby.Get()) { + var ret ActorStandby + return ret + } + return *o.ActorStandby.Get() +} + +// GetActorStandbyOk returns a tuple with the ActorStandby field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *CreateActorRequest) GetActorStandbyOk() (*ActorStandby, bool) { + if o == nil { + return nil, false + } + return o.ActorStandby.Get(), o.ActorStandby.IsSet() +} + +// HasActorStandby returns a boolean if a field has been set. +func (o *CreateActorRequest) HasActorStandby() bool { + if o != nil && o.ActorStandby.IsSet() { + return true + } + + return false +} + +// SetActorStandby gets a reference to the given NullableActorStandby and assigns it to the ActorStandby field. +func (o *CreateActorRequest) SetActorStandby(v ActorStandby) { + o.ActorStandby.Set(&v) +} +// SetActorStandbyNil sets the value for ActorStandby to be an explicit nil +func (o *CreateActorRequest) SetActorStandbyNil() { + o.ActorStandby.Set(nil) +} + +// UnsetActorStandby ensures that no value is present for ActorStandby, not even an explicit nil +func (o *CreateActorRequest) UnsetActorStandby() { + o.ActorStandby.Unset() +} + +// GetExampleRunInput returns the ExampleRunInput field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *CreateActorRequest) GetExampleRunInput() ExampleRunInput { + if o == nil || IsNil(o.ExampleRunInput.Get()) { + var ret ExampleRunInput + return ret + } + return *o.ExampleRunInput.Get() +} + +// GetExampleRunInputOk returns a tuple with the ExampleRunInput field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *CreateActorRequest) GetExampleRunInputOk() (*ExampleRunInput, bool) { + if o == nil { + return nil, false + } + return o.ExampleRunInput.Get(), o.ExampleRunInput.IsSet() +} + +// HasExampleRunInput returns a boolean if a field has been set. +func (o *CreateActorRequest) HasExampleRunInput() bool { + if o != nil && o.ExampleRunInput.IsSet() { + return true + } + + return false +} + +// SetExampleRunInput gets a reference to the given NullableExampleRunInput and assigns it to the ExampleRunInput field. +func (o *CreateActorRequest) SetExampleRunInput(v ExampleRunInput) { + o.ExampleRunInput.Set(&v) +} +// SetExampleRunInputNil sets the value for ExampleRunInput to be an explicit nil +func (o *CreateActorRequest) SetExampleRunInputNil() { + o.ExampleRunInput.Set(nil) +} + +// UnsetExampleRunInput ensures that no value is present for ExampleRunInput, not even an explicit nil +func (o *CreateActorRequest) UnsetExampleRunInput() { + o.ExampleRunInput.Unset() +} + +// GetIsDeprecated returns the IsDeprecated field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *CreateActorRequest) GetIsDeprecated() bool { + if o == nil || IsNil(o.IsDeprecated.Get()) { + var ret bool + return ret + } + return *o.IsDeprecated.Get() +} + +// GetIsDeprecatedOk returns a tuple with the IsDeprecated field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *CreateActorRequest) GetIsDeprecatedOk() (*bool, bool) { + if o == nil { + return nil, false + } + return o.IsDeprecated.Get(), o.IsDeprecated.IsSet() +} + +// HasIsDeprecated returns a boolean if a field has been set. +func (o *CreateActorRequest) HasIsDeprecated() bool { + if o != nil && o.IsDeprecated.IsSet() { + return true + } + + return false +} + +// SetIsDeprecated gets a reference to the given NullableBool and assigns it to the IsDeprecated field. +func (o *CreateActorRequest) SetIsDeprecated(v bool) { + o.IsDeprecated.Set(&v) +} +// SetIsDeprecatedNil sets the value for IsDeprecated to be an explicit nil +func (o *CreateActorRequest) SetIsDeprecatedNil() { + o.IsDeprecated.Set(nil) +} + +// UnsetIsDeprecated ensures that no value is present for IsDeprecated, not even an explicit nil +func (o *CreateActorRequest) UnsetIsDeprecated() { + o.IsDeprecated.Unset() +} + +func (o CreateActorRequest) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CreateActorRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.Name.IsSet() { + toSerialize["name"] = o.Name.Get() + } + if o.Description.IsSet() { + toSerialize["description"] = o.Description.Get() + } + if o.Title.IsSet() { + toSerialize["title"] = o.Title.Get() + } + if o.IsPublic.IsSet() { + toSerialize["isPublic"] = o.IsPublic.Get() + } + if o.SeoTitle.IsSet() { + toSerialize["seoTitle"] = o.SeoTitle.Get() + } + if o.SeoDescription.IsSet() { + toSerialize["seoDescription"] = o.SeoDescription.Get() + } + if !IsNil(o.RestartOnError) { + toSerialize["restartOnError"] = o.RestartOnError + } + if o.Versions != nil { + toSerialize["versions"] = o.Versions + } + if !IsNil(o.PricingInfos) { + toSerialize["pricingInfos"] = o.PricingInfos + } + if o.Categories != nil { + toSerialize["categories"] = o.Categories + } + if !IsNil(o.DefaultRunOptions) { + toSerialize["defaultRunOptions"] = o.DefaultRunOptions + } + if o.ActorStandby.IsSet() { + toSerialize["actorStandby"] = o.ActorStandby.Get() + } + if o.ExampleRunInput.IsSet() { + toSerialize["exampleRunInput"] = o.ExampleRunInput.Get() + } + if o.IsDeprecated.IsSet() { + toSerialize["isDeprecated"] = o.IsDeprecated.Get() + } + return toSerialize, nil +} + +type NullableCreateActorRequest struct { + value *CreateActorRequest + isSet bool +} + +func (v NullableCreateActorRequest) Get() *CreateActorRequest { + return v.value +} + +func (v *NullableCreateActorRequest) Set(val *CreateActorRequest) { + v.value = val + v.isSet = true +} + +func (v NullableCreateActorRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateActorRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateActorRequest(val *CreateActorRequest) *NullableCreateActorRequest { + return &NullableCreateActorRequest{value: val, isSet: true} +} + +func (v NullableCreateActorRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateActorRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_create_or_update_version_request.go b/model_create_or_update_version_request.go new file mode 100644 index 0000000..5632939 --- /dev/null +++ b/model_create_or_update_version_request.go @@ -0,0 +1,489 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" +) + +// checks if the CreateOrUpdateVersionRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateOrUpdateVersionRequest{} + +// CreateOrUpdateVersionRequest struct for CreateOrUpdateVersionRequest +type CreateOrUpdateVersionRequest struct { + VersionNumber NullableString `json:"versionNumber,omitempty" validate:"regexp=^([0-9]|[1-9][0-9])\\\\.([0-9]|[1-9][0-9])$"` + SourceType NullableVersionSourceType `json:"sourceType,omitempty"` + // + EnvVars []EnvVarRequest `json:"envVars,omitempty"` + ApplyEnvVarsToBuild NullableBool `json:"applyEnvVarsToBuild,omitempty"` + BuildTag NullableString `json:"buildTag,omitempty"` + SourceFiles []VersionSourceFilesInner `json:"sourceFiles,omitempty"` + // URL of the Git repository when sourceType is GIT_REPO. + GitRepoUrl NullableString `json:"gitRepoUrl,omitempty"` + // URL of the tarball when sourceType is TARBALL. + TarballUrl NullableString `json:"tarballUrl,omitempty"` + // URL of the GitHub Gist when sourceType is GITHUB_GIST. + GitHubGistUrl NullableString `json:"gitHubGistUrl,omitempty"` +} + +// NewCreateOrUpdateVersionRequest instantiates a new CreateOrUpdateVersionRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCreateOrUpdateVersionRequest() *CreateOrUpdateVersionRequest { + this := CreateOrUpdateVersionRequest{} + return &this +} + +// NewCreateOrUpdateVersionRequestWithDefaults instantiates a new CreateOrUpdateVersionRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCreateOrUpdateVersionRequestWithDefaults() *CreateOrUpdateVersionRequest { + this := CreateOrUpdateVersionRequest{} + return &this +} + +// GetVersionNumber returns the VersionNumber field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *CreateOrUpdateVersionRequest) GetVersionNumber() string { + if o == nil || IsNil(o.VersionNumber.Get()) { + var ret string + return ret + } + return *o.VersionNumber.Get() +} + +// GetVersionNumberOk returns a tuple with the VersionNumber field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *CreateOrUpdateVersionRequest) GetVersionNumberOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.VersionNumber.Get(), o.VersionNumber.IsSet() +} + +// HasVersionNumber returns a boolean if a field has been set. +func (o *CreateOrUpdateVersionRequest) HasVersionNumber() bool { + if o != nil && o.VersionNumber.IsSet() { + return true + } + + return false +} + +// SetVersionNumber gets a reference to the given NullableString and assigns it to the VersionNumber field. +func (o *CreateOrUpdateVersionRequest) SetVersionNumber(v string) { + o.VersionNumber.Set(&v) +} +// SetVersionNumberNil sets the value for VersionNumber to be an explicit nil +func (o *CreateOrUpdateVersionRequest) SetVersionNumberNil() { + o.VersionNumber.Set(nil) +} + +// UnsetVersionNumber ensures that no value is present for VersionNumber, not even an explicit nil +func (o *CreateOrUpdateVersionRequest) UnsetVersionNumber() { + o.VersionNumber.Unset() +} + +// GetSourceType returns the SourceType field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *CreateOrUpdateVersionRequest) GetSourceType() VersionSourceType { + if o == nil || IsNil(o.SourceType.Get()) { + var ret VersionSourceType + return ret + } + return *o.SourceType.Get() +} + +// GetSourceTypeOk returns a tuple with the SourceType field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *CreateOrUpdateVersionRequest) GetSourceTypeOk() (*VersionSourceType, bool) { + if o == nil { + return nil, false + } + return o.SourceType.Get(), o.SourceType.IsSet() +} + +// HasSourceType returns a boolean if a field has been set. +func (o *CreateOrUpdateVersionRequest) HasSourceType() bool { + if o != nil && o.SourceType.IsSet() { + return true + } + + return false +} + +// SetSourceType gets a reference to the given NullableVersionSourceType and assigns it to the SourceType field. +func (o *CreateOrUpdateVersionRequest) SetSourceType(v VersionSourceType) { + o.SourceType.Set(&v) +} +// SetSourceTypeNil sets the value for SourceType to be an explicit nil +func (o *CreateOrUpdateVersionRequest) SetSourceTypeNil() { + o.SourceType.Set(nil) +} + +// UnsetSourceType ensures that no value is present for SourceType, not even an explicit nil +func (o *CreateOrUpdateVersionRequest) UnsetSourceType() { + o.SourceType.Unset() +} + +// GetEnvVars returns the EnvVars field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *CreateOrUpdateVersionRequest) GetEnvVars() []EnvVarRequest { + if o == nil { + var ret []EnvVarRequest + return ret + } + return o.EnvVars +} + +// GetEnvVarsOk returns a tuple with the EnvVars field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *CreateOrUpdateVersionRequest) GetEnvVarsOk() ([]EnvVarRequest, bool) { + if o == nil || IsNil(o.EnvVars) { + return nil, false + } + return o.EnvVars, true +} + +// HasEnvVars returns a boolean if a field has been set. +func (o *CreateOrUpdateVersionRequest) HasEnvVars() bool { + if o != nil && !IsNil(o.EnvVars) { + return true + } + + return false +} + +// SetEnvVars gets a reference to the given []EnvVarRequest and assigns it to the EnvVars field. +func (o *CreateOrUpdateVersionRequest) SetEnvVars(v []EnvVarRequest) { + o.EnvVars = v +} + +// GetApplyEnvVarsToBuild returns the ApplyEnvVarsToBuild field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *CreateOrUpdateVersionRequest) GetApplyEnvVarsToBuild() bool { + if o == nil || IsNil(o.ApplyEnvVarsToBuild.Get()) { + var ret bool + return ret + } + return *o.ApplyEnvVarsToBuild.Get() +} + +// GetApplyEnvVarsToBuildOk returns a tuple with the ApplyEnvVarsToBuild field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *CreateOrUpdateVersionRequest) GetApplyEnvVarsToBuildOk() (*bool, bool) { + if o == nil { + return nil, false + } + return o.ApplyEnvVarsToBuild.Get(), o.ApplyEnvVarsToBuild.IsSet() +} + +// HasApplyEnvVarsToBuild returns a boolean if a field has been set. +func (o *CreateOrUpdateVersionRequest) HasApplyEnvVarsToBuild() bool { + if o != nil && o.ApplyEnvVarsToBuild.IsSet() { + return true + } + + return false +} + +// SetApplyEnvVarsToBuild gets a reference to the given NullableBool and assigns it to the ApplyEnvVarsToBuild field. +func (o *CreateOrUpdateVersionRequest) SetApplyEnvVarsToBuild(v bool) { + o.ApplyEnvVarsToBuild.Set(&v) +} +// SetApplyEnvVarsToBuildNil sets the value for ApplyEnvVarsToBuild to be an explicit nil +func (o *CreateOrUpdateVersionRequest) SetApplyEnvVarsToBuildNil() { + o.ApplyEnvVarsToBuild.Set(nil) +} + +// UnsetApplyEnvVarsToBuild ensures that no value is present for ApplyEnvVarsToBuild, not even an explicit nil +func (o *CreateOrUpdateVersionRequest) UnsetApplyEnvVarsToBuild() { + o.ApplyEnvVarsToBuild.Unset() +} + +// GetBuildTag returns the BuildTag field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *CreateOrUpdateVersionRequest) GetBuildTag() string { + if o == nil || IsNil(o.BuildTag.Get()) { + var ret string + return ret + } + return *o.BuildTag.Get() +} + +// GetBuildTagOk returns a tuple with the BuildTag field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *CreateOrUpdateVersionRequest) GetBuildTagOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.BuildTag.Get(), o.BuildTag.IsSet() +} + +// HasBuildTag returns a boolean if a field has been set. +func (o *CreateOrUpdateVersionRequest) HasBuildTag() bool { + if o != nil && o.BuildTag.IsSet() { + return true + } + + return false +} + +// SetBuildTag gets a reference to the given NullableString and assigns it to the BuildTag field. +func (o *CreateOrUpdateVersionRequest) SetBuildTag(v string) { + o.BuildTag.Set(&v) +} +// SetBuildTagNil sets the value for BuildTag to be an explicit nil +func (o *CreateOrUpdateVersionRequest) SetBuildTagNil() { + o.BuildTag.Set(nil) +} + +// UnsetBuildTag ensures that no value is present for BuildTag, not even an explicit nil +func (o *CreateOrUpdateVersionRequest) UnsetBuildTag() { + o.BuildTag.Unset() +} + +// GetSourceFiles returns the SourceFiles field value if set, zero value otherwise. +func (o *CreateOrUpdateVersionRequest) GetSourceFiles() []VersionSourceFilesInner { + if o == nil || IsNil(o.SourceFiles) { + var ret []VersionSourceFilesInner + return ret + } + return o.SourceFiles +} + +// GetSourceFilesOk returns a tuple with the SourceFiles field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateOrUpdateVersionRequest) GetSourceFilesOk() ([]VersionSourceFilesInner, bool) { + if o == nil || IsNil(o.SourceFiles) { + return nil, false + } + return o.SourceFiles, true +} + +// HasSourceFiles returns a boolean if a field has been set. +func (o *CreateOrUpdateVersionRequest) HasSourceFiles() bool { + if o != nil && !IsNil(o.SourceFiles) { + return true + } + + return false +} + +// SetSourceFiles gets a reference to the given []VersionSourceFilesInner and assigns it to the SourceFiles field. +func (o *CreateOrUpdateVersionRequest) SetSourceFiles(v []VersionSourceFilesInner) { + o.SourceFiles = v +} + +// GetGitRepoUrl returns the GitRepoUrl field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *CreateOrUpdateVersionRequest) GetGitRepoUrl() string { + if o == nil || IsNil(o.GitRepoUrl.Get()) { + var ret string + return ret + } + return *o.GitRepoUrl.Get() +} + +// GetGitRepoUrlOk returns a tuple with the GitRepoUrl field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *CreateOrUpdateVersionRequest) GetGitRepoUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.GitRepoUrl.Get(), o.GitRepoUrl.IsSet() +} + +// HasGitRepoUrl returns a boolean if a field has been set. +func (o *CreateOrUpdateVersionRequest) HasGitRepoUrl() bool { + if o != nil && o.GitRepoUrl.IsSet() { + return true + } + + return false +} + +// SetGitRepoUrl gets a reference to the given NullableString and assigns it to the GitRepoUrl field. +func (o *CreateOrUpdateVersionRequest) SetGitRepoUrl(v string) { + o.GitRepoUrl.Set(&v) +} +// SetGitRepoUrlNil sets the value for GitRepoUrl to be an explicit nil +func (o *CreateOrUpdateVersionRequest) SetGitRepoUrlNil() { + o.GitRepoUrl.Set(nil) +} + +// UnsetGitRepoUrl ensures that no value is present for GitRepoUrl, not even an explicit nil +func (o *CreateOrUpdateVersionRequest) UnsetGitRepoUrl() { + o.GitRepoUrl.Unset() +} + +// GetTarballUrl returns the TarballUrl field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *CreateOrUpdateVersionRequest) GetTarballUrl() string { + if o == nil || IsNil(o.TarballUrl.Get()) { + var ret string + return ret + } + return *o.TarballUrl.Get() +} + +// GetTarballUrlOk returns a tuple with the TarballUrl field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *CreateOrUpdateVersionRequest) GetTarballUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.TarballUrl.Get(), o.TarballUrl.IsSet() +} + +// HasTarballUrl returns a boolean if a field has been set. +func (o *CreateOrUpdateVersionRequest) HasTarballUrl() bool { + if o != nil && o.TarballUrl.IsSet() { + return true + } + + return false +} + +// SetTarballUrl gets a reference to the given NullableString and assigns it to the TarballUrl field. +func (o *CreateOrUpdateVersionRequest) SetTarballUrl(v string) { + o.TarballUrl.Set(&v) +} +// SetTarballUrlNil sets the value for TarballUrl to be an explicit nil +func (o *CreateOrUpdateVersionRequest) SetTarballUrlNil() { + o.TarballUrl.Set(nil) +} + +// UnsetTarballUrl ensures that no value is present for TarballUrl, not even an explicit nil +func (o *CreateOrUpdateVersionRequest) UnsetTarballUrl() { + o.TarballUrl.Unset() +} + +// GetGitHubGistUrl returns the GitHubGistUrl field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *CreateOrUpdateVersionRequest) GetGitHubGistUrl() string { + if o == nil || IsNil(o.GitHubGistUrl.Get()) { + var ret string + return ret + } + return *o.GitHubGistUrl.Get() +} + +// GetGitHubGistUrlOk returns a tuple with the GitHubGistUrl field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *CreateOrUpdateVersionRequest) GetGitHubGistUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.GitHubGistUrl.Get(), o.GitHubGistUrl.IsSet() +} + +// HasGitHubGistUrl returns a boolean if a field has been set. +func (o *CreateOrUpdateVersionRequest) HasGitHubGistUrl() bool { + if o != nil && o.GitHubGistUrl.IsSet() { + return true + } + + return false +} + +// SetGitHubGistUrl gets a reference to the given NullableString and assigns it to the GitHubGistUrl field. +func (o *CreateOrUpdateVersionRequest) SetGitHubGistUrl(v string) { + o.GitHubGistUrl.Set(&v) +} +// SetGitHubGistUrlNil sets the value for GitHubGistUrl to be an explicit nil +func (o *CreateOrUpdateVersionRequest) SetGitHubGistUrlNil() { + o.GitHubGistUrl.Set(nil) +} + +// UnsetGitHubGistUrl ensures that no value is present for GitHubGistUrl, not even an explicit nil +func (o *CreateOrUpdateVersionRequest) UnsetGitHubGistUrl() { + o.GitHubGistUrl.Unset() +} + +func (o CreateOrUpdateVersionRequest) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CreateOrUpdateVersionRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.VersionNumber.IsSet() { + toSerialize["versionNumber"] = o.VersionNumber.Get() + } + if o.SourceType.IsSet() { + toSerialize["sourceType"] = o.SourceType.Get() + } + if o.EnvVars != nil { + toSerialize["envVars"] = o.EnvVars + } + if o.ApplyEnvVarsToBuild.IsSet() { + toSerialize["applyEnvVarsToBuild"] = o.ApplyEnvVarsToBuild.Get() + } + if o.BuildTag.IsSet() { + toSerialize["buildTag"] = o.BuildTag.Get() + } + if !IsNil(o.SourceFiles) { + toSerialize["sourceFiles"] = o.SourceFiles + } + if o.GitRepoUrl.IsSet() { + toSerialize["gitRepoUrl"] = o.GitRepoUrl.Get() + } + if o.TarballUrl.IsSet() { + toSerialize["tarballUrl"] = o.TarballUrl.Get() + } + if o.GitHubGistUrl.IsSet() { + toSerialize["gitHubGistUrl"] = o.GitHubGistUrl.Get() + } + return toSerialize, nil +} + +type NullableCreateOrUpdateVersionRequest struct { + value *CreateOrUpdateVersionRequest + isSet bool +} + +func (v NullableCreateOrUpdateVersionRequest) Get() *CreateOrUpdateVersionRequest { + return v.value +} + +func (v *NullableCreateOrUpdateVersionRequest) Set(val *CreateOrUpdateVersionRequest) { + v.value = val + v.isSet = true +} + +func (v NullableCreateOrUpdateVersionRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateOrUpdateVersionRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateOrUpdateVersionRequest(val *CreateOrUpdateVersionRequest) *NullableCreateOrUpdateVersionRequest { + return &NullableCreateOrUpdateVersionRequest{value: val, isSet: true} +} + +func (v NullableCreateOrUpdateVersionRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateOrUpdateVersionRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_create_task_request.go b/model_create_task_request.go new file mode 100644 index 0000000..b41052f --- /dev/null +++ b/model_create_task_request.go @@ -0,0 +1,370 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" + "bytes" + "fmt" +) + +// checks if the CreateTaskRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateTaskRequest{} + +// CreateTaskRequest struct for CreateTaskRequest +type CreateTaskRequest struct { + ActId string `json:"actId"` + Name *string `json:"name,omitempty"` + Options NullableTaskOptions `json:"options,omitempty"` + // The input configuration for the Actor task. This is a user-defined JSON object that will be passed to the Actor when the task is run. + Input map[string]interface{} `json:"input,omitempty"` + Title NullableString `json:"title,omitempty"` + ActorStandby NullableActorStandby `json:"actorStandby,omitempty"` +} + +type _CreateTaskRequest CreateTaskRequest + +// NewCreateTaskRequest instantiates a new CreateTaskRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCreateTaskRequest(actId string) *CreateTaskRequest { + this := CreateTaskRequest{} + this.ActId = actId + return &this +} + +// NewCreateTaskRequestWithDefaults instantiates a new CreateTaskRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCreateTaskRequestWithDefaults() *CreateTaskRequest { + this := CreateTaskRequest{} + return &this +} + +// GetActId returns the ActId field value +func (o *CreateTaskRequest) GetActId() string { + if o == nil { + var ret string + return ret + } + + return o.ActId +} + +// GetActIdOk returns a tuple with the ActId field value +// and a boolean to check if the value has been set. +func (o *CreateTaskRequest) GetActIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ActId, true +} + +// SetActId sets field value +func (o *CreateTaskRequest) SetActId(v string) { + o.ActId = v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *CreateTaskRequest) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateTaskRequest) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *CreateTaskRequest) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *CreateTaskRequest) SetName(v string) { + o.Name = &v +} + +// GetOptions returns the Options field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *CreateTaskRequest) GetOptions() TaskOptions { + if o == nil || IsNil(o.Options.Get()) { + var ret TaskOptions + return ret + } + return *o.Options.Get() +} + +// GetOptionsOk returns a tuple with the Options field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *CreateTaskRequest) GetOptionsOk() (*TaskOptions, bool) { + if o == nil { + return nil, false + } + return o.Options.Get(), o.Options.IsSet() +} + +// HasOptions returns a boolean if a field has been set. +func (o *CreateTaskRequest) HasOptions() bool { + if o != nil && o.Options.IsSet() { + return true + } + + return false +} + +// SetOptions gets a reference to the given NullableTaskOptions and assigns it to the Options field. +func (o *CreateTaskRequest) SetOptions(v TaskOptions) { + o.Options.Set(&v) +} +// SetOptionsNil sets the value for Options to be an explicit nil +func (o *CreateTaskRequest) SetOptionsNil() { + o.Options.Set(nil) +} + +// UnsetOptions ensures that no value is present for Options, not even an explicit nil +func (o *CreateTaskRequest) UnsetOptions() { + o.Options.Unset() +} + +// GetInput returns the Input field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *CreateTaskRequest) GetInput() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + return o.Input +} + +// GetInputOk returns a tuple with the Input field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *CreateTaskRequest) GetInputOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Input) { + return map[string]interface{}{}, false + } + return o.Input, true +} + +// HasInput returns a boolean if a field has been set. +func (o *CreateTaskRequest) HasInput() bool { + if o != nil && !IsNil(o.Input) { + return true + } + + return false +} + +// SetInput gets a reference to the given map[string]interface{} and assigns it to the Input field. +func (o *CreateTaskRequest) SetInput(v map[string]interface{}) { + o.Input = v +} + +// GetTitle returns the Title field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *CreateTaskRequest) GetTitle() string { + if o == nil || IsNil(o.Title.Get()) { + var ret string + return ret + } + return *o.Title.Get() +} + +// GetTitleOk returns a tuple with the Title field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *CreateTaskRequest) GetTitleOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Title.Get(), o.Title.IsSet() +} + +// HasTitle returns a boolean if a field has been set. +func (o *CreateTaskRequest) HasTitle() bool { + if o != nil && o.Title.IsSet() { + return true + } + + return false +} + +// SetTitle gets a reference to the given NullableString and assigns it to the Title field. +func (o *CreateTaskRequest) SetTitle(v string) { + o.Title.Set(&v) +} +// SetTitleNil sets the value for Title to be an explicit nil +func (o *CreateTaskRequest) SetTitleNil() { + o.Title.Set(nil) +} + +// UnsetTitle ensures that no value is present for Title, not even an explicit nil +func (o *CreateTaskRequest) UnsetTitle() { + o.Title.Unset() +} + +// GetActorStandby returns the ActorStandby field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *CreateTaskRequest) GetActorStandby() ActorStandby { + if o == nil || IsNil(o.ActorStandby.Get()) { + var ret ActorStandby + return ret + } + return *o.ActorStandby.Get() +} + +// GetActorStandbyOk returns a tuple with the ActorStandby field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *CreateTaskRequest) GetActorStandbyOk() (*ActorStandby, bool) { + if o == nil { + return nil, false + } + return o.ActorStandby.Get(), o.ActorStandby.IsSet() +} + +// HasActorStandby returns a boolean if a field has been set. +func (o *CreateTaskRequest) HasActorStandby() bool { + if o != nil && o.ActorStandby.IsSet() { + return true + } + + return false +} + +// SetActorStandby gets a reference to the given NullableActorStandby and assigns it to the ActorStandby field. +func (o *CreateTaskRequest) SetActorStandby(v ActorStandby) { + o.ActorStandby.Set(&v) +} +// SetActorStandbyNil sets the value for ActorStandby to be an explicit nil +func (o *CreateTaskRequest) SetActorStandbyNil() { + o.ActorStandby.Set(nil) +} + +// UnsetActorStandby ensures that no value is present for ActorStandby, not even an explicit nil +func (o *CreateTaskRequest) UnsetActorStandby() { + o.ActorStandby.Unset() +} + +func (o CreateTaskRequest) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CreateTaskRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["actId"] = o.ActId + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if o.Options.IsSet() { + toSerialize["options"] = o.Options.Get() + } + if o.Input != nil { + toSerialize["input"] = o.Input + } + if o.Title.IsSet() { + toSerialize["title"] = o.Title.Get() + } + if o.ActorStandby.IsSet() { + toSerialize["actorStandby"] = o.ActorStandby.Get() + } + return toSerialize, nil +} + +func (o *CreateTaskRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "actId", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varCreateTaskRequest := _CreateTaskRequest{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varCreateTaskRequest) + + if err != nil { + return err + } + + *o = CreateTaskRequest(varCreateTaskRequest) + + return err +} + +type NullableCreateTaskRequest struct { + value *CreateTaskRequest + isSet bool +} + +func (v NullableCreateTaskRequest) Get() *CreateTaskRequest { + return v.value +} + +func (v *NullableCreateTaskRequest) Set(val *CreateTaskRequest) { + v.value = val + v.isSet = true +} + +func (v NullableCreateTaskRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateTaskRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateTaskRequest(val *CreateTaskRequest) *NullableCreateTaskRequest { + return &NullableCreateTaskRequest{value: val, isSet: true} +} + +func (v NullableCreateTaskRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateTaskRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_current.go b/model_current.go new file mode 100644 index 0000000..eb2fbf0 --- /dev/null +++ b/model_current.go @@ -0,0 +1,446 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" + "bytes" + "fmt" +) + +// checks if the Current type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Current{} + +// Current struct for Current +type Current struct { + MonthlyUsageUsd float32 `json:"monthlyUsageUsd"` + MonthlyActorComputeUnits float32 `json:"monthlyActorComputeUnits"` + MonthlyExternalDataTransferGbytes float32 `json:"monthlyExternalDataTransferGbytes"` + MonthlyProxySerps int32 `json:"monthlyProxySerps"` + MonthlyResidentialProxyGbytes float32 `json:"monthlyResidentialProxyGbytes"` + ActorMemoryGbytes float32 `json:"actorMemoryGbytes"` + ActorCount int32 `json:"actorCount"` + ActorTaskCount int32 `json:"actorTaskCount"` + ActiveActorJobCount int32 `json:"activeActorJobCount"` + TeamAccountSeatCount int32 `json:"teamAccountSeatCount"` + ScheduleCount *int32 `json:"scheduleCount,omitempty"` +} + +type _Current Current + +// NewCurrent instantiates a new Current object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCurrent(monthlyUsageUsd float32, monthlyActorComputeUnits float32, monthlyExternalDataTransferGbytes float32, monthlyProxySerps int32, monthlyResidentialProxyGbytes float32, actorMemoryGbytes float32, actorCount int32, actorTaskCount int32, activeActorJobCount int32, teamAccountSeatCount int32) *Current { + this := Current{} + this.MonthlyUsageUsd = monthlyUsageUsd + this.MonthlyActorComputeUnits = monthlyActorComputeUnits + this.MonthlyExternalDataTransferGbytes = monthlyExternalDataTransferGbytes + this.MonthlyProxySerps = monthlyProxySerps + this.MonthlyResidentialProxyGbytes = monthlyResidentialProxyGbytes + this.ActorMemoryGbytes = actorMemoryGbytes + this.ActorCount = actorCount + this.ActorTaskCount = actorTaskCount + this.ActiveActorJobCount = activeActorJobCount + this.TeamAccountSeatCount = teamAccountSeatCount + return &this +} + +// NewCurrentWithDefaults instantiates a new Current object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCurrentWithDefaults() *Current { + this := Current{} + return &this +} + +// GetMonthlyUsageUsd returns the MonthlyUsageUsd field value +func (o *Current) GetMonthlyUsageUsd() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.MonthlyUsageUsd +} + +// GetMonthlyUsageUsdOk returns a tuple with the MonthlyUsageUsd field value +// and a boolean to check if the value has been set. +func (o *Current) GetMonthlyUsageUsdOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.MonthlyUsageUsd, true +} + +// SetMonthlyUsageUsd sets field value +func (o *Current) SetMonthlyUsageUsd(v float32) { + o.MonthlyUsageUsd = v +} + +// GetMonthlyActorComputeUnits returns the MonthlyActorComputeUnits field value +func (o *Current) GetMonthlyActorComputeUnits() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.MonthlyActorComputeUnits +} + +// GetMonthlyActorComputeUnitsOk returns a tuple with the MonthlyActorComputeUnits field value +// and a boolean to check if the value has been set. +func (o *Current) GetMonthlyActorComputeUnitsOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.MonthlyActorComputeUnits, true +} + +// SetMonthlyActorComputeUnits sets field value +func (o *Current) SetMonthlyActorComputeUnits(v float32) { + o.MonthlyActorComputeUnits = v +} + +// GetMonthlyExternalDataTransferGbytes returns the MonthlyExternalDataTransferGbytes field value +func (o *Current) GetMonthlyExternalDataTransferGbytes() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.MonthlyExternalDataTransferGbytes +} + +// GetMonthlyExternalDataTransferGbytesOk returns a tuple with the MonthlyExternalDataTransferGbytes field value +// and a boolean to check if the value has been set. +func (o *Current) GetMonthlyExternalDataTransferGbytesOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.MonthlyExternalDataTransferGbytes, true +} + +// SetMonthlyExternalDataTransferGbytes sets field value +func (o *Current) SetMonthlyExternalDataTransferGbytes(v float32) { + o.MonthlyExternalDataTransferGbytes = v +} + +// GetMonthlyProxySerps returns the MonthlyProxySerps field value +func (o *Current) GetMonthlyProxySerps() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.MonthlyProxySerps +} + +// GetMonthlyProxySerpsOk returns a tuple with the MonthlyProxySerps field value +// and a boolean to check if the value has been set. +func (o *Current) GetMonthlyProxySerpsOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.MonthlyProxySerps, true +} + +// SetMonthlyProxySerps sets field value +func (o *Current) SetMonthlyProxySerps(v int32) { + o.MonthlyProxySerps = v +} + +// GetMonthlyResidentialProxyGbytes returns the MonthlyResidentialProxyGbytes field value +func (o *Current) GetMonthlyResidentialProxyGbytes() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.MonthlyResidentialProxyGbytes +} + +// GetMonthlyResidentialProxyGbytesOk returns a tuple with the MonthlyResidentialProxyGbytes field value +// and a boolean to check if the value has been set. +func (o *Current) GetMonthlyResidentialProxyGbytesOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.MonthlyResidentialProxyGbytes, true +} + +// SetMonthlyResidentialProxyGbytes sets field value +func (o *Current) SetMonthlyResidentialProxyGbytes(v float32) { + o.MonthlyResidentialProxyGbytes = v +} + +// GetActorMemoryGbytes returns the ActorMemoryGbytes field value +func (o *Current) GetActorMemoryGbytes() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.ActorMemoryGbytes +} + +// GetActorMemoryGbytesOk returns a tuple with the ActorMemoryGbytes field value +// and a boolean to check if the value has been set. +func (o *Current) GetActorMemoryGbytesOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.ActorMemoryGbytes, true +} + +// SetActorMemoryGbytes sets field value +func (o *Current) SetActorMemoryGbytes(v float32) { + o.ActorMemoryGbytes = v +} + +// GetActorCount returns the ActorCount field value +func (o *Current) GetActorCount() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.ActorCount +} + +// GetActorCountOk returns a tuple with the ActorCount field value +// and a boolean to check if the value has been set. +func (o *Current) GetActorCountOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.ActorCount, true +} + +// SetActorCount sets field value +func (o *Current) SetActorCount(v int32) { + o.ActorCount = v +} + +// GetActorTaskCount returns the ActorTaskCount field value +func (o *Current) GetActorTaskCount() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.ActorTaskCount +} + +// GetActorTaskCountOk returns a tuple with the ActorTaskCount field value +// and a boolean to check if the value has been set. +func (o *Current) GetActorTaskCountOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.ActorTaskCount, true +} + +// SetActorTaskCount sets field value +func (o *Current) SetActorTaskCount(v int32) { + o.ActorTaskCount = v +} + +// GetActiveActorJobCount returns the ActiveActorJobCount field value +func (o *Current) GetActiveActorJobCount() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.ActiveActorJobCount +} + +// GetActiveActorJobCountOk returns a tuple with the ActiveActorJobCount field value +// and a boolean to check if the value has been set. +func (o *Current) GetActiveActorJobCountOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.ActiveActorJobCount, true +} + +// SetActiveActorJobCount sets field value +func (o *Current) SetActiveActorJobCount(v int32) { + o.ActiveActorJobCount = v +} + +// GetTeamAccountSeatCount returns the TeamAccountSeatCount field value +func (o *Current) GetTeamAccountSeatCount() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.TeamAccountSeatCount +} + +// GetTeamAccountSeatCountOk returns a tuple with the TeamAccountSeatCount field value +// and a boolean to check if the value has been set. +func (o *Current) GetTeamAccountSeatCountOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.TeamAccountSeatCount, true +} + +// SetTeamAccountSeatCount sets field value +func (o *Current) SetTeamAccountSeatCount(v int32) { + o.TeamAccountSeatCount = v +} + +// GetScheduleCount returns the ScheduleCount field value if set, zero value otherwise. +func (o *Current) GetScheduleCount() int32 { + if o == nil || IsNil(o.ScheduleCount) { + var ret int32 + return ret + } + return *o.ScheduleCount +} + +// GetScheduleCountOk returns a tuple with the ScheduleCount field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Current) GetScheduleCountOk() (*int32, bool) { + if o == nil || IsNil(o.ScheduleCount) { + return nil, false + } + return o.ScheduleCount, true +} + +// HasScheduleCount returns a boolean if a field has been set. +func (o *Current) HasScheduleCount() bool { + if o != nil && !IsNil(o.ScheduleCount) { + return true + } + + return false +} + +// SetScheduleCount gets a reference to the given int32 and assigns it to the ScheduleCount field. +func (o *Current) SetScheduleCount(v int32) { + o.ScheduleCount = &v +} + +func (o Current) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Current) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["monthlyUsageUsd"] = o.MonthlyUsageUsd + toSerialize["monthlyActorComputeUnits"] = o.MonthlyActorComputeUnits + toSerialize["monthlyExternalDataTransferGbytes"] = o.MonthlyExternalDataTransferGbytes + toSerialize["monthlyProxySerps"] = o.MonthlyProxySerps + toSerialize["monthlyResidentialProxyGbytes"] = o.MonthlyResidentialProxyGbytes + toSerialize["actorMemoryGbytes"] = o.ActorMemoryGbytes + toSerialize["actorCount"] = o.ActorCount + toSerialize["actorTaskCount"] = o.ActorTaskCount + toSerialize["activeActorJobCount"] = o.ActiveActorJobCount + toSerialize["teamAccountSeatCount"] = o.TeamAccountSeatCount + if !IsNil(o.ScheduleCount) { + toSerialize["scheduleCount"] = o.ScheduleCount + } + return toSerialize, nil +} + +func (o *Current) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "monthlyUsageUsd", + "monthlyActorComputeUnits", + "monthlyExternalDataTransferGbytes", + "monthlyProxySerps", + "monthlyResidentialProxyGbytes", + "actorMemoryGbytes", + "actorCount", + "actorTaskCount", + "activeActorJobCount", + "teamAccountSeatCount", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varCurrent := _Current{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varCurrent) + + if err != nil { + return err + } + + *o = Current(varCurrent) + + return err +} + +type NullableCurrent struct { + value *Current + isSet bool +} + +func (v NullableCurrent) Get() *Current { + return v.value +} + +func (v *NullableCurrent) Set(val *Current) { + v.value = val + v.isSet = true +} + +func (v NullableCurrent) IsSet() bool { + return v.isSet +} + +func (v *NullableCurrent) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCurrent(val *Current) *NullableCurrent { + return &NullableCurrent{value: val, isSet: true} +} + +func (v NullableCurrent) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCurrent) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_current_pricing_info.go b/model_current_pricing_info.go new file mode 100644 index 0000000..36fa6a9 --- /dev/null +++ b/model_current_pricing_info.go @@ -0,0 +1,735 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" + "time" + "bytes" + "fmt" +) + +// checks if the CurrentPricingInfo type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CurrentPricingInfo{} + +// CurrentPricingInfo struct for CurrentPricingInfo +type CurrentPricingInfo struct { + PricingModel string `json:"pricingModel"` + ApifyMarginPercentage *float32 `json:"apifyMarginPercentage,omitempty"` + CreatedAt *time.Time `json:"createdAt,omitempty"` + StartedAt *time.Time `json:"startedAt,omitempty"` + NotifiedAboutChangeAt NullableTime `json:"notifiedAboutChangeAt,omitempty"` + NotifiedAboutFutureChangeAt NullableTime `json:"notifiedAboutFutureChangeAt,omitempty"` + IsPriceChangeNotificationSuppressed *bool `json:"isPriceChangeNotificationSuppressed,omitempty"` + ForceContainsSignificantPriceChange *bool `json:"forceContainsSignificantPriceChange,omitempty"` + IsPPEPlatformUsagePaidByUser *bool `json:"isPPEPlatformUsagePaidByUser,omitempty"` + ReasonForChange NullableString `json:"reasonForChange,omitempty"` + TrialMinutes NullableInt32 `json:"trialMinutes,omitempty"` + UnitName NullableString `json:"unitName,omitempty"` + PricePerUnitUsd NullableFloat32 `json:"pricePerUnitUsd,omitempty"` + MinimalMaxTotalChargeUsd NullableFloat32 `json:"minimalMaxTotalChargeUsd,omitempty"` + // Per-event pricing configuration for pay-per-event Actors. + PricingPerEvent map[string]interface{} `json:"pricingPerEvent,omitempty"` +} + +type _CurrentPricingInfo CurrentPricingInfo + +// NewCurrentPricingInfo instantiates a new CurrentPricingInfo object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCurrentPricingInfo(pricingModel string) *CurrentPricingInfo { + this := CurrentPricingInfo{} + this.PricingModel = pricingModel + return &this +} + +// NewCurrentPricingInfoWithDefaults instantiates a new CurrentPricingInfo object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCurrentPricingInfoWithDefaults() *CurrentPricingInfo { + this := CurrentPricingInfo{} + return &this +} + +// GetPricingModel returns the PricingModel field value +func (o *CurrentPricingInfo) GetPricingModel() string { + if o == nil { + var ret string + return ret + } + + return o.PricingModel +} + +// GetPricingModelOk returns a tuple with the PricingModel field value +// and a boolean to check if the value has been set. +func (o *CurrentPricingInfo) GetPricingModelOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.PricingModel, true +} + +// SetPricingModel sets field value +func (o *CurrentPricingInfo) SetPricingModel(v string) { + o.PricingModel = v +} + +// GetApifyMarginPercentage returns the ApifyMarginPercentage field value if set, zero value otherwise. +func (o *CurrentPricingInfo) GetApifyMarginPercentage() float32 { + if o == nil || IsNil(o.ApifyMarginPercentage) { + var ret float32 + return ret + } + return *o.ApifyMarginPercentage +} + +// GetApifyMarginPercentageOk returns a tuple with the ApifyMarginPercentage field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CurrentPricingInfo) GetApifyMarginPercentageOk() (*float32, bool) { + if o == nil || IsNil(o.ApifyMarginPercentage) { + return nil, false + } + return o.ApifyMarginPercentage, true +} + +// HasApifyMarginPercentage returns a boolean if a field has been set. +func (o *CurrentPricingInfo) HasApifyMarginPercentage() bool { + if o != nil && !IsNil(o.ApifyMarginPercentage) { + return true + } + + return false +} + +// SetApifyMarginPercentage gets a reference to the given float32 and assigns it to the ApifyMarginPercentage field. +func (o *CurrentPricingInfo) SetApifyMarginPercentage(v float32) { + o.ApifyMarginPercentage = &v +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *CurrentPricingInfo) GetCreatedAt() time.Time { + if o == nil || IsNil(o.CreatedAt) { + var ret time.Time + return ret + } + return *o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CurrentPricingInfo) GetCreatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.CreatedAt) { + return nil, false + } + return o.CreatedAt, true +} + +// HasCreatedAt returns a boolean if a field has been set. +func (o *CurrentPricingInfo) HasCreatedAt() bool { + if o != nil && !IsNil(o.CreatedAt) { + return true + } + + return false +} + +// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +func (o *CurrentPricingInfo) SetCreatedAt(v time.Time) { + o.CreatedAt = &v +} + +// GetStartedAt returns the StartedAt field value if set, zero value otherwise. +func (o *CurrentPricingInfo) GetStartedAt() time.Time { + if o == nil || IsNil(o.StartedAt) { + var ret time.Time + return ret + } + return *o.StartedAt +} + +// GetStartedAtOk returns a tuple with the StartedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CurrentPricingInfo) GetStartedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.StartedAt) { + return nil, false + } + return o.StartedAt, true +} + +// HasStartedAt returns a boolean if a field has been set. +func (o *CurrentPricingInfo) HasStartedAt() bool { + if o != nil && !IsNil(o.StartedAt) { + return true + } + + return false +} + +// SetStartedAt gets a reference to the given time.Time and assigns it to the StartedAt field. +func (o *CurrentPricingInfo) SetStartedAt(v time.Time) { + o.StartedAt = &v +} + +// GetNotifiedAboutChangeAt returns the NotifiedAboutChangeAt field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *CurrentPricingInfo) GetNotifiedAboutChangeAt() time.Time { + if o == nil || IsNil(o.NotifiedAboutChangeAt.Get()) { + var ret time.Time + return ret + } + return *o.NotifiedAboutChangeAt.Get() +} + +// GetNotifiedAboutChangeAtOk returns a tuple with the NotifiedAboutChangeAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *CurrentPricingInfo) GetNotifiedAboutChangeAtOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.NotifiedAboutChangeAt.Get(), o.NotifiedAboutChangeAt.IsSet() +} + +// HasNotifiedAboutChangeAt returns a boolean if a field has been set. +func (o *CurrentPricingInfo) HasNotifiedAboutChangeAt() bool { + if o != nil && o.NotifiedAboutChangeAt.IsSet() { + return true + } + + return false +} + +// SetNotifiedAboutChangeAt gets a reference to the given NullableTime and assigns it to the NotifiedAboutChangeAt field. +func (o *CurrentPricingInfo) SetNotifiedAboutChangeAt(v time.Time) { + o.NotifiedAboutChangeAt.Set(&v) +} +// SetNotifiedAboutChangeAtNil sets the value for NotifiedAboutChangeAt to be an explicit nil +func (o *CurrentPricingInfo) SetNotifiedAboutChangeAtNil() { + o.NotifiedAboutChangeAt.Set(nil) +} + +// UnsetNotifiedAboutChangeAt ensures that no value is present for NotifiedAboutChangeAt, not even an explicit nil +func (o *CurrentPricingInfo) UnsetNotifiedAboutChangeAt() { + o.NotifiedAboutChangeAt.Unset() +} + +// GetNotifiedAboutFutureChangeAt returns the NotifiedAboutFutureChangeAt field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *CurrentPricingInfo) GetNotifiedAboutFutureChangeAt() time.Time { + if o == nil || IsNil(o.NotifiedAboutFutureChangeAt.Get()) { + var ret time.Time + return ret + } + return *o.NotifiedAboutFutureChangeAt.Get() +} + +// GetNotifiedAboutFutureChangeAtOk returns a tuple with the NotifiedAboutFutureChangeAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *CurrentPricingInfo) GetNotifiedAboutFutureChangeAtOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.NotifiedAboutFutureChangeAt.Get(), o.NotifiedAboutFutureChangeAt.IsSet() +} + +// HasNotifiedAboutFutureChangeAt returns a boolean if a field has been set. +func (o *CurrentPricingInfo) HasNotifiedAboutFutureChangeAt() bool { + if o != nil && o.NotifiedAboutFutureChangeAt.IsSet() { + return true + } + + return false +} + +// SetNotifiedAboutFutureChangeAt gets a reference to the given NullableTime and assigns it to the NotifiedAboutFutureChangeAt field. +func (o *CurrentPricingInfo) SetNotifiedAboutFutureChangeAt(v time.Time) { + o.NotifiedAboutFutureChangeAt.Set(&v) +} +// SetNotifiedAboutFutureChangeAtNil sets the value for NotifiedAboutFutureChangeAt to be an explicit nil +func (o *CurrentPricingInfo) SetNotifiedAboutFutureChangeAtNil() { + o.NotifiedAboutFutureChangeAt.Set(nil) +} + +// UnsetNotifiedAboutFutureChangeAt ensures that no value is present for NotifiedAboutFutureChangeAt, not even an explicit nil +func (o *CurrentPricingInfo) UnsetNotifiedAboutFutureChangeAt() { + o.NotifiedAboutFutureChangeAt.Unset() +} + +// GetIsPriceChangeNotificationSuppressed returns the IsPriceChangeNotificationSuppressed field value if set, zero value otherwise. +func (o *CurrentPricingInfo) GetIsPriceChangeNotificationSuppressed() bool { + if o == nil || IsNil(o.IsPriceChangeNotificationSuppressed) { + var ret bool + return ret + } + return *o.IsPriceChangeNotificationSuppressed +} + +// GetIsPriceChangeNotificationSuppressedOk returns a tuple with the IsPriceChangeNotificationSuppressed field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CurrentPricingInfo) GetIsPriceChangeNotificationSuppressedOk() (*bool, bool) { + if o == nil || IsNil(o.IsPriceChangeNotificationSuppressed) { + return nil, false + } + return o.IsPriceChangeNotificationSuppressed, true +} + +// HasIsPriceChangeNotificationSuppressed returns a boolean if a field has been set. +func (o *CurrentPricingInfo) HasIsPriceChangeNotificationSuppressed() bool { + if o != nil && !IsNil(o.IsPriceChangeNotificationSuppressed) { + return true + } + + return false +} + +// SetIsPriceChangeNotificationSuppressed gets a reference to the given bool and assigns it to the IsPriceChangeNotificationSuppressed field. +func (o *CurrentPricingInfo) SetIsPriceChangeNotificationSuppressed(v bool) { + o.IsPriceChangeNotificationSuppressed = &v +} + +// GetForceContainsSignificantPriceChange returns the ForceContainsSignificantPriceChange field value if set, zero value otherwise. +func (o *CurrentPricingInfo) GetForceContainsSignificantPriceChange() bool { + if o == nil || IsNil(o.ForceContainsSignificantPriceChange) { + var ret bool + return ret + } + return *o.ForceContainsSignificantPriceChange +} + +// GetForceContainsSignificantPriceChangeOk returns a tuple with the ForceContainsSignificantPriceChange field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CurrentPricingInfo) GetForceContainsSignificantPriceChangeOk() (*bool, bool) { + if o == nil || IsNil(o.ForceContainsSignificantPriceChange) { + return nil, false + } + return o.ForceContainsSignificantPriceChange, true +} + +// HasForceContainsSignificantPriceChange returns a boolean if a field has been set. +func (o *CurrentPricingInfo) HasForceContainsSignificantPriceChange() bool { + if o != nil && !IsNil(o.ForceContainsSignificantPriceChange) { + return true + } + + return false +} + +// SetForceContainsSignificantPriceChange gets a reference to the given bool and assigns it to the ForceContainsSignificantPriceChange field. +func (o *CurrentPricingInfo) SetForceContainsSignificantPriceChange(v bool) { + o.ForceContainsSignificantPriceChange = &v +} + +// GetIsPPEPlatformUsagePaidByUser returns the IsPPEPlatformUsagePaidByUser field value if set, zero value otherwise. +func (o *CurrentPricingInfo) GetIsPPEPlatformUsagePaidByUser() bool { + if o == nil || IsNil(o.IsPPEPlatformUsagePaidByUser) { + var ret bool + return ret + } + return *o.IsPPEPlatformUsagePaidByUser +} + +// GetIsPPEPlatformUsagePaidByUserOk returns a tuple with the IsPPEPlatformUsagePaidByUser field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CurrentPricingInfo) GetIsPPEPlatformUsagePaidByUserOk() (*bool, bool) { + if o == nil || IsNil(o.IsPPEPlatformUsagePaidByUser) { + return nil, false + } + return o.IsPPEPlatformUsagePaidByUser, true +} + +// HasIsPPEPlatformUsagePaidByUser returns a boolean if a field has been set. +func (o *CurrentPricingInfo) HasIsPPEPlatformUsagePaidByUser() bool { + if o != nil && !IsNil(o.IsPPEPlatformUsagePaidByUser) { + return true + } + + return false +} + +// SetIsPPEPlatformUsagePaidByUser gets a reference to the given bool and assigns it to the IsPPEPlatformUsagePaidByUser field. +func (o *CurrentPricingInfo) SetIsPPEPlatformUsagePaidByUser(v bool) { + o.IsPPEPlatformUsagePaidByUser = &v +} + +// GetReasonForChange returns the ReasonForChange field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *CurrentPricingInfo) GetReasonForChange() string { + if o == nil || IsNil(o.ReasonForChange.Get()) { + var ret string + return ret + } + return *o.ReasonForChange.Get() +} + +// GetReasonForChangeOk returns a tuple with the ReasonForChange field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *CurrentPricingInfo) GetReasonForChangeOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.ReasonForChange.Get(), o.ReasonForChange.IsSet() +} + +// HasReasonForChange returns a boolean if a field has been set. +func (o *CurrentPricingInfo) HasReasonForChange() bool { + if o != nil && o.ReasonForChange.IsSet() { + return true + } + + return false +} + +// SetReasonForChange gets a reference to the given NullableString and assigns it to the ReasonForChange field. +func (o *CurrentPricingInfo) SetReasonForChange(v string) { + o.ReasonForChange.Set(&v) +} +// SetReasonForChangeNil sets the value for ReasonForChange to be an explicit nil +func (o *CurrentPricingInfo) SetReasonForChangeNil() { + o.ReasonForChange.Set(nil) +} + +// UnsetReasonForChange ensures that no value is present for ReasonForChange, not even an explicit nil +func (o *CurrentPricingInfo) UnsetReasonForChange() { + o.ReasonForChange.Unset() +} + +// GetTrialMinutes returns the TrialMinutes field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *CurrentPricingInfo) GetTrialMinutes() int32 { + if o == nil || IsNil(o.TrialMinutes.Get()) { + var ret int32 + return ret + } + return *o.TrialMinutes.Get() +} + +// GetTrialMinutesOk returns a tuple with the TrialMinutes field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *CurrentPricingInfo) GetTrialMinutesOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.TrialMinutes.Get(), o.TrialMinutes.IsSet() +} + +// HasTrialMinutes returns a boolean if a field has been set. +func (o *CurrentPricingInfo) HasTrialMinutes() bool { + if o != nil && o.TrialMinutes.IsSet() { + return true + } + + return false +} + +// SetTrialMinutes gets a reference to the given NullableInt32 and assigns it to the TrialMinutes field. +func (o *CurrentPricingInfo) SetTrialMinutes(v int32) { + o.TrialMinutes.Set(&v) +} +// SetTrialMinutesNil sets the value for TrialMinutes to be an explicit nil +func (o *CurrentPricingInfo) SetTrialMinutesNil() { + o.TrialMinutes.Set(nil) +} + +// UnsetTrialMinutes ensures that no value is present for TrialMinutes, not even an explicit nil +func (o *CurrentPricingInfo) UnsetTrialMinutes() { + o.TrialMinutes.Unset() +} + +// GetUnitName returns the UnitName field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *CurrentPricingInfo) GetUnitName() string { + if o == nil || IsNil(o.UnitName.Get()) { + var ret string + return ret + } + return *o.UnitName.Get() +} + +// GetUnitNameOk returns a tuple with the UnitName field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *CurrentPricingInfo) GetUnitNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.UnitName.Get(), o.UnitName.IsSet() +} + +// HasUnitName returns a boolean if a field has been set. +func (o *CurrentPricingInfo) HasUnitName() bool { + if o != nil && o.UnitName.IsSet() { + return true + } + + return false +} + +// SetUnitName gets a reference to the given NullableString and assigns it to the UnitName field. +func (o *CurrentPricingInfo) SetUnitName(v string) { + o.UnitName.Set(&v) +} +// SetUnitNameNil sets the value for UnitName to be an explicit nil +func (o *CurrentPricingInfo) SetUnitNameNil() { + o.UnitName.Set(nil) +} + +// UnsetUnitName ensures that no value is present for UnitName, not even an explicit nil +func (o *CurrentPricingInfo) UnsetUnitName() { + o.UnitName.Unset() +} + +// GetPricePerUnitUsd returns the PricePerUnitUsd field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *CurrentPricingInfo) GetPricePerUnitUsd() float32 { + if o == nil || IsNil(o.PricePerUnitUsd.Get()) { + var ret float32 + return ret + } + return *o.PricePerUnitUsd.Get() +} + +// GetPricePerUnitUsdOk returns a tuple with the PricePerUnitUsd field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *CurrentPricingInfo) GetPricePerUnitUsdOk() (*float32, bool) { + if o == nil { + return nil, false + } + return o.PricePerUnitUsd.Get(), o.PricePerUnitUsd.IsSet() +} + +// HasPricePerUnitUsd returns a boolean if a field has been set. +func (o *CurrentPricingInfo) HasPricePerUnitUsd() bool { + if o != nil && o.PricePerUnitUsd.IsSet() { + return true + } + + return false +} + +// SetPricePerUnitUsd gets a reference to the given NullableFloat32 and assigns it to the PricePerUnitUsd field. +func (o *CurrentPricingInfo) SetPricePerUnitUsd(v float32) { + o.PricePerUnitUsd.Set(&v) +} +// SetPricePerUnitUsdNil sets the value for PricePerUnitUsd to be an explicit nil +func (o *CurrentPricingInfo) SetPricePerUnitUsdNil() { + o.PricePerUnitUsd.Set(nil) +} + +// UnsetPricePerUnitUsd ensures that no value is present for PricePerUnitUsd, not even an explicit nil +func (o *CurrentPricingInfo) UnsetPricePerUnitUsd() { + o.PricePerUnitUsd.Unset() +} + +// GetMinimalMaxTotalChargeUsd returns the MinimalMaxTotalChargeUsd field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *CurrentPricingInfo) GetMinimalMaxTotalChargeUsd() float32 { + if o == nil || IsNil(o.MinimalMaxTotalChargeUsd.Get()) { + var ret float32 + return ret + } + return *o.MinimalMaxTotalChargeUsd.Get() +} + +// GetMinimalMaxTotalChargeUsdOk returns a tuple with the MinimalMaxTotalChargeUsd field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *CurrentPricingInfo) GetMinimalMaxTotalChargeUsdOk() (*float32, bool) { + if o == nil { + return nil, false + } + return o.MinimalMaxTotalChargeUsd.Get(), o.MinimalMaxTotalChargeUsd.IsSet() +} + +// HasMinimalMaxTotalChargeUsd returns a boolean if a field has been set. +func (o *CurrentPricingInfo) HasMinimalMaxTotalChargeUsd() bool { + if o != nil && o.MinimalMaxTotalChargeUsd.IsSet() { + return true + } + + return false +} + +// SetMinimalMaxTotalChargeUsd gets a reference to the given NullableFloat32 and assigns it to the MinimalMaxTotalChargeUsd field. +func (o *CurrentPricingInfo) SetMinimalMaxTotalChargeUsd(v float32) { + o.MinimalMaxTotalChargeUsd.Set(&v) +} +// SetMinimalMaxTotalChargeUsdNil sets the value for MinimalMaxTotalChargeUsd to be an explicit nil +func (o *CurrentPricingInfo) SetMinimalMaxTotalChargeUsdNil() { + o.MinimalMaxTotalChargeUsd.Set(nil) +} + +// UnsetMinimalMaxTotalChargeUsd ensures that no value is present for MinimalMaxTotalChargeUsd, not even an explicit nil +func (o *CurrentPricingInfo) UnsetMinimalMaxTotalChargeUsd() { + o.MinimalMaxTotalChargeUsd.Unset() +} + +// GetPricingPerEvent returns the PricingPerEvent field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *CurrentPricingInfo) GetPricingPerEvent() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + return o.PricingPerEvent +} + +// GetPricingPerEventOk returns a tuple with the PricingPerEvent field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *CurrentPricingInfo) GetPricingPerEventOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.PricingPerEvent) { + return map[string]interface{}{}, false + } + return o.PricingPerEvent, true +} + +// HasPricingPerEvent returns a boolean if a field has been set. +func (o *CurrentPricingInfo) HasPricingPerEvent() bool { + if o != nil && !IsNil(o.PricingPerEvent) { + return true + } + + return false +} + +// SetPricingPerEvent gets a reference to the given map[string]interface{} and assigns it to the PricingPerEvent field. +func (o *CurrentPricingInfo) SetPricingPerEvent(v map[string]interface{}) { + o.PricingPerEvent = v +} + +func (o CurrentPricingInfo) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CurrentPricingInfo) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pricingModel"] = o.PricingModel + if !IsNil(o.ApifyMarginPercentage) { + toSerialize["apifyMarginPercentage"] = o.ApifyMarginPercentage + } + if !IsNil(o.CreatedAt) { + toSerialize["createdAt"] = o.CreatedAt + } + if !IsNil(o.StartedAt) { + toSerialize["startedAt"] = o.StartedAt + } + if o.NotifiedAboutChangeAt.IsSet() { + toSerialize["notifiedAboutChangeAt"] = o.NotifiedAboutChangeAt.Get() + } + if o.NotifiedAboutFutureChangeAt.IsSet() { + toSerialize["notifiedAboutFutureChangeAt"] = o.NotifiedAboutFutureChangeAt.Get() + } + if !IsNil(o.IsPriceChangeNotificationSuppressed) { + toSerialize["isPriceChangeNotificationSuppressed"] = o.IsPriceChangeNotificationSuppressed + } + if !IsNil(o.ForceContainsSignificantPriceChange) { + toSerialize["forceContainsSignificantPriceChange"] = o.ForceContainsSignificantPriceChange + } + if !IsNil(o.IsPPEPlatformUsagePaidByUser) { + toSerialize["isPPEPlatformUsagePaidByUser"] = o.IsPPEPlatformUsagePaidByUser + } + if o.ReasonForChange.IsSet() { + toSerialize["reasonForChange"] = o.ReasonForChange.Get() + } + if o.TrialMinutes.IsSet() { + toSerialize["trialMinutes"] = o.TrialMinutes.Get() + } + if o.UnitName.IsSet() { + toSerialize["unitName"] = o.UnitName.Get() + } + if o.PricePerUnitUsd.IsSet() { + toSerialize["pricePerUnitUsd"] = o.PricePerUnitUsd.Get() + } + if o.MinimalMaxTotalChargeUsd.IsSet() { + toSerialize["minimalMaxTotalChargeUsd"] = o.MinimalMaxTotalChargeUsd.Get() + } + if o.PricingPerEvent != nil { + toSerialize["pricingPerEvent"] = o.PricingPerEvent + } + return toSerialize, nil +} + +func (o *CurrentPricingInfo) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pricingModel", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varCurrentPricingInfo := _CurrentPricingInfo{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varCurrentPricingInfo) + + if err != nil { + return err + } + + *o = CurrentPricingInfo(varCurrentPricingInfo) + + return err +} + +type NullableCurrentPricingInfo struct { + value *CurrentPricingInfo + isSet bool +} + +func (v NullableCurrentPricingInfo) Get() *CurrentPricingInfo { + return v.value +} + +func (v *NullableCurrentPricingInfo) Set(val *CurrentPricingInfo) { + v.value = val + v.isSet = true +} + +func (v NullableCurrentPricingInfo) IsSet() bool { + return v.isSet +} + +func (v *NullableCurrentPricingInfo) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCurrentPricingInfo(val *CurrentPricingInfo) *NullableCurrentPricingInfo { + return &NullableCurrentPricingInfo{value: val, isSet: true} +} + +func (v NullableCurrentPricingInfo) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCurrentPricingInfo) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_daily_service_usages.go b/model_daily_service_usages.go new file mode 100644 index 0000000..83e906b --- /dev/null +++ b/model_daily_service_usages.go @@ -0,0 +1,215 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" + "bytes" + "fmt" +) + +// checks if the DailyServiceUsages type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DailyServiceUsages{} + +// DailyServiceUsages struct for DailyServiceUsages +type DailyServiceUsages struct { + Date string `json:"date"` + // A map of service usage item names to their usage details. + ServiceUsage map[string]UsageItem `json:"serviceUsage"` + TotalUsageCreditsUsd float32 `json:"totalUsageCreditsUsd"` +} + +type _DailyServiceUsages DailyServiceUsages + +// NewDailyServiceUsages instantiates a new DailyServiceUsages object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewDailyServiceUsages(date string, serviceUsage map[string]UsageItem, totalUsageCreditsUsd float32) *DailyServiceUsages { + this := DailyServiceUsages{} + this.Date = date + this.ServiceUsage = serviceUsage + this.TotalUsageCreditsUsd = totalUsageCreditsUsd + return &this +} + +// NewDailyServiceUsagesWithDefaults instantiates a new DailyServiceUsages object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDailyServiceUsagesWithDefaults() *DailyServiceUsages { + this := DailyServiceUsages{} + return &this +} + +// GetDate returns the Date field value +func (o *DailyServiceUsages) GetDate() string { + if o == nil { + var ret string + return ret + } + + return o.Date +} + +// GetDateOk returns a tuple with the Date field value +// and a boolean to check if the value has been set. +func (o *DailyServiceUsages) GetDateOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Date, true +} + +// SetDate sets field value +func (o *DailyServiceUsages) SetDate(v string) { + o.Date = v +} + +// GetServiceUsage returns the ServiceUsage field value +func (o *DailyServiceUsages) GetServiceUsage() map[string]UsageItem { + if o == nil { + var ret map[string]UsageItem + return ret + } + + return o.ServiceUsage +} + +// GetServiceUsageOk returns a tuple with the ServiceUsage field value +// and a boolean to check if the value has been set. +func (o *DailyServiceUsages) GetServiceUsageOk() (map[string]UsageItem, bool) { + if o == nil { + return map[string]UsageItem{}, false + } + return o.ServiceUsage, true +} + +// SetServiceUsage sets field value +func (o *DailyServiceUsages) SetServiceUsage(v map[string]UsageItem) { + o.ServiceUsage = v +} + +// GetTotalUsageCreditsUsd returns the TotalUsageCreditsUsd field value +func (o *DailyServiceUsages) GetTotalUsageCreditsUsd() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.TotalUsageCreditsUsd +} + +// GetTotalUsageCreditsUsdOk returns a tuple with the TotalUsageCreditsUsd field value +// and a boolean to check if the value has been set. +func (o *DailyServiceUsages) GetTotalUsageCreditsUsdOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.TotalUsageCreditsUsd, true +} + +// SetTotalUsageCreditsUsd sets field value +func (o *DailyServiceUsages) SetTotalUsageCreditsUsd(v float32) { + o.TotalUsageCreditsUsd = v +} + +func (o DailyServiceUsages) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DailyServiceUsages) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["date"] = o.Date + toSerialize["serviceUsage"] = o.ServiceUsage + toSerialize["totalUsageCreditsUsd"] = o.TotalUsageCreditsUsd + return toSerialize, nil +} + +func (o *DailyServiceUsages) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "date", + "serviceUsage", + "totalUsageCreditsUsd", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varDailyServiceUsages := _DailyServiceUsages{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varDailyServiceUsages) + + if err != nil { + return err + } + + *o = DailyServiceUsages(varDailyServiceUsages) + + return err +} + +type NullableDailyServiceUsages struct { + value *DailyServiceUsages + isSet bool +} + +func (v NullableDailyServiceUsages) Get() *DailyServiceUsages { + return v.value +} + +func (v *NullableDailyServiceUsages) Set(val *DailyServiceUsages) { + v.value = val + v.isSet = true +} + +func (v NullableDailyServiceUsages) IsSet() bool { + return v.isSet +} + +func (v *NullableDailyServiceUsages) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDailyServiceUsages(val *DailyServiceUsages) *NullableDailyServiceUsages { + return &NullableDailyServiceUsages{value: val, isSet: true} +} + +func (v NullableDailyServiceUsages) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDailyServiceUsages) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_dataset.go b/model_dataset.go new file mode 100644 index 0000000..c8754b0 --- /dev/null +++ b/model_dataset.go @@ -0,0 +1,725 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" + "time" + "bytes" + "fmt" +) + +// checks if the Dataset type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Dataset{} + +// Dataset struct for Dataset +type Dataset struct { + Id string `json:"id"` + Name NullableString `json:"name,omitempty"` + UserId string `json:"userId"` + CreatedAt time.Time `json:"createdAt"` + ModifiedAt time.Time `json:"modifiedAt"` + AccessedAt time.Time `json:"accessedAt"` + ItemCount int32 `json:"itemCount"` + CleanItemCount int32 `json:"cleanItemCount"` + ActId NullableString `json:"actId,omitempty"` + ActRunId NullableString `json:"actRunId,omitempty"` + // + Fields []string `json:"fields,omitempty"` + // Defines the schema of items in your dataset, the full specification can be found in [Apify docs](/platform/actors/development/actor-definition/dataset-schema) + Schema map[string]interface{} `json:"schema,omitempty"` + ConsoleUrl string `json:"consoleUrl"` + // A public link to access the dataset items directly. + ItemsPublicUrl *string `json:"itemsPublicUrl,omitempty"` + // A secret key for generating signed public URLs. It is only provided to clients with WRITE permission for the dataset. + UrlSigningSecretKey NullableString `json:"urlSigningSecretKey,omitempty"` + GeneralAccess *GeneralAccess `json:"generalAccess,omitempty"` + Stats *DatasetStats `json:"stats,omitempty"` +} + +type _Dataset Dataset + +// NewDataset instantiates a new Dataset object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewDataset(id string, userId string, createdAt time.Time, modifiedAt time.Time, accessedAt time.Time, itemCount int32, cleanItemCount int32, consoleUrl string) *Dataset { + this := Dataset{} + this.Id = id + this.UserId = userId + this.CreatedAt = createdAt + this.ModifiedAt = modifiedAt + this.AccessedAt = accessedAt + this.ItemCount = itemCount + this.CleanItemCount = cleanItemCount + this.ConsoleUrl = consoleUrl + return &this +} + +// NewDatasetWithDefaults instantiates a new Dataset object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDatasetWithDefaults() *Dataset { + this := Dataset{} + return &this +} + +// GetId returns the Id field value +func (o *Dataset) GetId() string { + if o == nil { + var ret string + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *Dataset) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *Dataset) SetId(v string) { + o.Id = v +} + +// GetName returns the Name field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Dataset) GetName() string { + if o == nil || IsNil(o.Name.Get()) { + var ret string + return ret + } + return *o.Name.Get() +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Dataset) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Name.Get(), o.Name.IsSet() +} + +// HasName returns a boolean if a field has been set. +func (o *Dataset) HasName() bool { + if o != nil && o.Name.IsSet() { + return true + } + + return false +} + +// SetName gets a reference to the given NullableString and assigns it to the Name field. +func (o *Dataset) SetName(v string) { + o.Name.Set(&v) +} +// SetNameNil sets the value for Name to be an explicit nil +func (o *Dataset) SetNameNil() { + o.Name.Set(nil) +} + +// UnsetName ensures that no value is present for Name, not even an explicit nil +func (o *Dataset) UnsetName() { + o.Name.Unset() +} + +// GetUserId returns the UserId field value +func (o *Dataset) GetUserId() string { + if o == nil { + var ret string + return ret + } + + return o.UserId +} + +// GetUserIdOk returns a tuple with the UserId field value +// and a boolean to check if the value has been set. +func (o *Dataset) GetUserIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.UserId, true +} + +// SetUserId sets field value +func (o *Dataset) SetUserId(v string) { + o.UserId = v +} + +// GetCreatedAt returns the CreatedAt field value +func (o *Dataset) GetCreatedAt() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value +// and a boolean to check if the value has been set. +func (o *Dataset) GetCreatedAtOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.CreatedAt, true +} + +// SetCreatedAt sets field value +func (o *Dataset) SetCreatedAt(v time.Time) { + o.CreatedAt = v +} + +// GetModifiedAt returns the ModifiedAt field value +func (o *Dataset) GetModifiedAt() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.ModifiedAt +} + +// GetModifiedAtOk returns a tuple with the ModifiedAt field value +// and a boolean to check if the value has been set. +func (o *Dataset) GetModifiedAtOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.ModifiedAt, true +} + +// SetModifiedAt sets field value +func (o *Dataset) SetModifiedAt(v time.Time) { + o.ModifiedAt = v +} + +// GetAccessedAt returns the AccessedAt field value +func (o *Dataset) GetAccessedAt() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.AccessedAt +} + +// GetAccessedAtOk returns a tuple with the AccessedAt field value +// and a boolean to check if the value has been set. +func (o *Dataset) GetAccessedAtOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.AccessedAt, true +} + +// SetAccessedAt sets field value +func (o *Dataset) SetAccessedAt(v time.Time) { + o.AccessedAt = v +} + +// GetItemCount returns the ItemCount field value +func (o *Dataset) GetItemCount() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.ItemCount +} + +// GetItemCountOk returns a tuple with the ItemCount field value +// and a boolean to check if the value has been set. +func (o *Dataset) GetItemCountOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.ItemCount, true +} + +// SetItemCount sets field value +func (o *Dataset) SetItemCount(v int32) { + o.ItemCount = v +} + +// GetCleanItemCount returns the CleanItemCount field value +func (o *Dataset) GetCleanItemCount() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.CleanItemCount +} + +// GetCleanItemCountOk returns a tuple with the CleanItemCount field value +// and a boolean to check if the value has been set. +func (o *Dataset) GetCleanItemCountOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.CleanItemCount, true +} + +// SetCleanItemCount sets field value +func (o *Dataset) SetCleanItemCount(v int32) { + o.CleanItemCount = v +} + +// GetActId returns the ActId field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Dataset) GetActId() string { + if o == nil || IsNil(o.ActId.Get()) { + var ret string + return ret + } + return *o.ActId.Get() +} + +// GetActIdOk returns a tuple with the ActId field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Dataset) GetActIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.ActId.Get(), o.ActId.IsSet() +} + +// HasActId returns a boolean if a field has been set. +func (o *Dataset) HasActId() bool { + if o != nil && o.ActId.IsSet() { + return true + } + + return false +} + +// SetActId gets a reference to the given NullableString and assigns it to the ActId field. +func (o *Dataset) SetActId(v string) { + o.ActId.Set(&v) +} +// SetActIdNil sets the value for ActId to be an explicit nil +func (o *Dataset) SetActIdNil() { + o.ActId.Set(nil) +} + +// UnsetActId ensures that no value is present for ActId, not even an explicit nil +func (o *Dataset) UnsetActId() { + o.ActId.Unset() +} + +// GetActRunId returns the ActRunId field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Dataset) GetActRunId() string { + if o == nil || IsNil(o.ActRunId.Get()) { + var ret string + return ret + } + return *o.ActRunId.Get() +} + +// GetActRunIdOk returns a tuple with the ActRunId field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Dataset) GetActRunIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.ActRunId.Get(), o.ActRunId.IsSet() +} + +// HasActRunId returns a boolean if a field has been set. +func (o *Dataset) HasActRunId() bool { + if o != nil && o.ActRunId.IsSet() { + return true + } + + return false +} + +// SetActRunId gets a reference to the given NullableString and assigns it to the ActRunId field. +func (o *Dataset) SetActRunId(v string) { + o.ActRunId.Set(&v) +} +// SetActRunIdNil sets the value for ActRunId to be an explicit nil +func (o *Dataset) SetActRunIdNil() { + o.ActRunId.Set(nil) +} + +// UnsetActRunId ensures that no value is present for ActRunId, not even an explicit nil +func (o *Dataset) UnsetActRunId() { + o.ActRunId.Unset() +} + +// GetFields returns the Fields field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Dataset) GetFields() []string { + if o == nil { + var ret []string + return ret + } + return o.Fields +} + +// GetFieldsOk returns a tuple with the Fields field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Dataset) GetFieldsOk() ([]string, bool) { + if o == nil || IsNil(o.Fields) { + return nil, false + } + return o.Fields, true +} + +// HasFields returns a boolean if a field has been set. +func (o *Dataset) HasFields() bool { + if o != nil && !IsNil(o.Fields) { + return true + } + + return false +} + +// SetFields gets a reference to the given []string and assigns it to the Fields field. +func (o *Dataset) SetFields(v []string) { + o.Fields = v +} + +// GetSchema returns the Schema field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Dataset) GetSchema() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + return o.Schema +} + +// GetSchemaOk returns a tuple with the Schema field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Dataset) GetSchemaOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Schema) { + return map[string]interface{}{}, false + } + return o.Schema, true +} + +// HasSchema returns a boolean if a field has been set. +func (o *Dataset) HasSchema() bool { + if o != nil && !IsNil(o.Schema) { + return true + } + + return false +} + +// SetSchema gets a reference to the given map[string]interface{} and assigns it to the Schema field. +func (o *Dataset) SetSchema(v map[string]interface{}) { + o.Schema = v +} + +// GetConsoleUrl returns the ConsoleUrl field value +func (o *Dataset) GetConsoleUrl() string { + if o == nil { + var ret string + return ret + } + + return o.ConsoleUrl +} + +// GetConsoleUrlOk returns a tuple with the ConsoleUrl field value +// and a boolean to check if the value has been set. +func (o *Dataset) GetConsoleUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ConsoleUrl, true +} + +// SetConsoleUrl sets field value +func (o *Dataset) SetConsoleUrl(v string) { + o.ConsoleUrl = v +} + +// GetItemsPublicUrl returns the ItemsPublicUrl field value if set, zero value otherwise. +func (o *Dataset) GetItemsPublicUrl() string { + if o == nil || IsNil(o.ItemsPublicUrl) { + var ret string + return ret + } + return *o.ItemsPublicUrl +} + +// GetItemsPublicUrlOk returns a tuple with the ItemsPublicUrl field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Dataset) GetItemsPublicUrlOk() (*string, bool) { + if o == nil || IsNil(o.ItemsPublicUrl) { + return nil, false + } + return o.ItemsPublicUrl, true +} + +// HasItemsPublicUrl returns a boolean if a field has been set. +func (o *Dataset) HasItemsPublicUrl() bool { + if o != nil && !IsNil(o.ItemsPublicUrl) { + return true + } + + return false +} + +// SetItemsPublicUrl gets a reference to the given string and assigns it to the ItemsPublicUrl field. +func (o *Dataset) SetItemsPublicUrl(v string) { + o.ItemsPublicUrl = &v +} + +// GetUrlSigningSecretKey returns the UrlSigningSecretKey field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Dataset) GetUrlSigningSecretKey() string { + if o == nil || IsNil(o.UrlSigningSecretKey.Get()) { + var ret string + return ret + } + return *o.UrlSigningSecretKey.Get() +} + +// GetUrlSigningSecretKeyOk returns a tuple with the UrlSigningSecretKey field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Dataset) GetUrlSigningSecretKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.UrlSigningSecretKey.Get(), o.UrlSigningSecretKey.IsSet() +} + +// HasUrlSigningSecretKey returns a boolean if a field has been set. +func (o *Dataset) HasUrlSigningSecretKey() bool { + if o != nil && o.UrlSigningSecretKey.IsSet() { + return true + } + + return false +} + +// SetUrlSigningSecretKey gets a reference to the given NullableString and assigns it to the UrlSigningSecretKey field. +func (o *Dataset) SetUrlSigningSecretKey(v string) { + o.UrlSigningSecretKey.Set(&v) +} +// SetUrlSigningSecretKeyNil sets the value for UrlSigningSecretKey to be an explicit nil +func (o *Dataset) SetUrlSigningSecretKeyNil() { + o.UrlSigningSecretKey.Set(nil) +} + +// UnsetUrlSigningSecretKey ensures that no value is present for UrlSigningSecretKey, not even an explicit nil +func (o *Dataset) UnsetUrlSigningSecretKey() { + o.UrlSigningSecretKey.Unset() +} + +// GetGeneralAccess returns the GeneralAccess field value if set, zero value otherwise. +func (o *Dataset) GetGeneralAccess() GeneralAccess { + if o == nil || IsNil(o.GeneralAccess) { + var ret GeneralAccess + return ret + } + return *o.GeneralAccess +} + +// GetGeneralAccessOk returns a tuple with the GeneralAccess field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Dataset) GetGeneralAccessOk() (*GeneralAccess, bool) { + if o == nil || IsNil(o.GeneralAccess) { + return nil, false + } + return o.GeneralAccess, true +} + +// HasGeneralAccess returns a boolean if a field has been set. +func (o *Dataset) HasGeneralAccess() bool { + if o != nil && !IsNil(o.GeneralAccess) { + return true + } + + return false +} + +// SetGeneralAccess gets a reference to the given GeneralAccess and assigns it to the GeneralAccess field. +func (o *Dataset) SetGeneralAccess(v GeneralAccess) { + o.GeneralAccess = &v +} + +// GetStats returns the Stats field value if set, zero value otherwise. +func (o *Dataset) GetStats() DatasetStats { + if o == nil || IsNil(o.Stats) { + var ret DatasetStats + return ret + } + return *o.Stats +} + +// GetStatsOk returns a tuple with the Stats field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Dataset) GetStatsOk() (*DatasetStats, bool) { + if o == nil || IsNil(o.Stats) { + return nil, false + } + return o.Stats, true +} + +// HasStats returns a boolean if a field has been set. +func (o *Dataset) HasStats() bool { + if o != nil && !IsNil(o.Stats) { + return true + } + + return false +} + +// SetStats gets a reference to the given DatasetStats and assigns it to the Stats field. +func (o *Dataset) SetStats(v DatasetStats) { + o.Stats = &v +} + +func (o Dataset) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Dataset) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + if o.Name.IsSet() { + toSerialize["name"] = o.Name.Get() + } + toSerialize["userId"] = o.UserId + toSerialize["createdAt"] = o.CreatedAt + toSerialize["modifiedAt"] = o.ModifiedAt + toSerialize["accessedAt"] = o.AccessedAt + toSerialize["itemCount"] = o.ItemCount + toSerialize["cleanItemCount"] = o.CleanItemCount + if o.ActId.IsSet() { + toSerialize["actId"] = o.ActId.Get() + } + if o.ActRunId.IsSet() { + toSerialize["actRunId"] = o.ActRunId.Get() + } + if o.Fields != nil { + toSerialize["fields"] = o.Fields + } + if o.Schema != nil { + toSerialize["schema"] = o.Schema + } + toSerialize["consoleUrl"] = o.ConsoleUrl + if !IsNil(o.ItemsPublicUrl) { + toSerialize["itemsPublicUrl"] = o.ItemsPublicUrl + } + if o.UrlSigningSecretKey.IsSet() { + toSerialize["urlSigningSecretKey"] = o.UrlSigningSecretKey.Get() + } + if !IsNil(o.GeneralAccess) { + toSerialize["generalAccess"] = o.GeneralAccess + } + if !IsNil(o.Stats) { + toSerialize["stats"] = o.Stats + } + return toSerialize, nil +} + +func (o *Dataset) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "userId", + "createdAt", + "modifiedAt", + "accessedAt", + "itemCount", + "cleanItemCount", + "consoleUrl", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varDataset := _Dataset{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varDataset) + + if err != nil { + return err + } + + *o = Dataset(varDataset) + + return err +} + +type NullableDataset struct { + value *Dataset + isSet bool +} + +func (v NullableDataset) Get() *Dataset { + return v.value +} + +func (v *NullableDataset) Set(val *Dataset) { + v.value = val + v.isSet = true +} + +func (v NullableDataset) IsSet() bool { + return v.isSet +} + +func (v *NullableDataset) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDataset(val *Dataset) *NullableDataset { + return &NullableDataset{value: val, isSet: true} +} + +func (v NullableDataset) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDataset) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_dataset_field_statistics.go b/model_dataset_field_statistics.go new file mode 100644 index 0000000..74ccb35 --- /dev/null +++ b/model_dataset_field_statistics.go @@ -0,0 +1,278 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" +) + +// checks if the DatasetFieldStatistics type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DatasetFieldStatistics{} + +// DatasetFieldStatistics struct for DatasetFieldStatistics +type DatasetFieldStatistics struct { + // Minimum value of the field. For numbers, this is calculated directly. For strings, this is the length of the shortest string. For arrays, this is the length of the shortest array. For objects, this is the number of keys in the smallest object. + Min NullableFloat32 `json:"min,omitempty"` + // Maximum value of the field. For numbers, this is calculated directly. For strings, this is the length of the longest string. For arrays, this is the length of the longest array. For objects, this is the number of keys in the largest object. + Max NullableFloat32 `json:"max,omitempty"` + // How many items in the dataset have a null value for this field. + NullCount NullableInt32 `json:"nullCount,omitempty"` + // How many items in the dataset are `undefined`, meaning that for example empty string is not considered empty. + EmptyCount NullableInt32 `json:"emptyCount,omitempty"` +} + +// NewDatasetFieldStatistics instantiates a new DatasetFieldStatistics object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewDatasetFieldStatistics() *DatasetFieldStatistics { + this := DatasetFieldStatistics{} + return &this +} + +// NewDatasetFieldStatisticsWithDefaults instantiates a new DatasetFieldStatistics object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDatasetFieldStatisticsWithDefaults() *DatasetFieldStatistics { + this := DatasetFieldStatistics{} + return &this +} + +// GetMin returns the Min field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *DatasetFieldStatistics) GetMin() float32 { + if o == nil || IsNil(o.Min.Get()) { + var ret float32 + return ret + } + return *o.Min.Get() +} + +// GetMinOk returns a tuple with the Min field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *DatasetFieldStatistics) GetMinOk() (*float32, bool) { + if o == nil { + return nil, false + } + return o.Min.Get(), o.Min.IsSet() +} + +// HasMin returns a boolean if a field has been set. +func (o *DatasetFieldStatistics) HasMin() bool { + if o != nil && o.Min.IsSet() { + return true + } + + return false +} + +// SetMin gets a reference to the given NullableFloat32 and assigns it to the Min field. +func (o *DatasetFieldStatistics) SetMin(v float32) { + o.Min.Set(&v) +} +// SetMinNil sets the value for Min to be an explicit nil +func (o *DatasetFieldStatistics) SetMinNil() { + o.Min.Set(nil) +} + +// UnsetMin ensures that no value is present for Min, not even an explicit nil +func (o *DatasetFieldStatistics) UnsetMin() { + o.Min.Unset() +} + +// GetMax returns the Max field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *DatasetFieldStatistics) GetMax() float32 { + if o == nil || IsNil(o.Max.Get()) { + var ret float32 + return ret + } + return *o.Max.Get() +} + +// GetMaxOk returns a tuple with the Max field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *DatasetFieldStatistics) GetMaxOk() (*float32, bool) { + if o == nil { + return nil, false + } + return o.Max.Get(), o.Max.IsSet() +} + +// HasMax returns a boolean if a field has been set. +func (o *DatasetFieldStatistics) HasMax() bool { + if o != nil && o.Max.IsSet() { + return true + } + + return false +} + +// SetMax gets a reference to the given NullableFloat32 and assigns it to the Max field. +func (o *DatasetFieldStatistics) SetMax(v float32) { + o.Max.Set(&v) +} +// SetMaxNil sets the value for Max to be an explicit nil +func (o *DatasetFieldStatistics) SetMaxNil() { + o.Max.Set(nil) +} + +// UnsetMax ensures that no value is present for Max, not even an explicit nil +func (o *DatasetFieldStatistics) UnsetMax() { + o.Max.Unset() +} + +// GetNullCount returns the NullCount field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *DatasetFieldStatistics) GetNullCount() int32 { + if o == nil || IsNil(o.NullCount.Get()) { + var ret int32 + return ret + } + return *o.NullCount.Get() +} + +// GetNullCountOk returns a tuple with the NullCount field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *DatasetFieldStatistics) GetNullCountOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.NullCount.Get(), o.NullCount.IsSet() +} + +// HasNullCount returns a boolean if a field has been set. +func (o *DatasetFieldStatistics) HasNullCount() bool { + if o != nil && o.NullCount.IsSet() { + return true + } + + return false +} + +// SetNullCount gets a reference to the given NullableInt32 and assigns it to the NullCount field. +func (o *DatasetFieldStatistics) SetNullCount(v int32) { + o.NullCount.Set(&v) +} +// SetNullCountNil sets the value for NullCount to be an explicit nil +func (o *DatasetFieldStatistics) SetNullCountNil() { + o.NullCount.Set(nil) +} + +// UnsetNullCount ensures that no value is present for NullCount, not even an explicit nil +func (o *DatasetFieldStatistics) UnsetNullCount() { + o.NullCount.Unset() +} + +// GetEmptyCount returns the EmptyCount field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *DatasetFieldStatistics) GetEmptyCount() int32 { + if o == nil || IsNil(o.EmptyCount.Get()) { + var ret int32 + return ret + } + return *o.EmptyCount.Get() +} + +// GetEmptyCountOk returns a tuple with the EmptyCount field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *DatasetFieldStatistics) GetEmptyCountOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.EmptyCount.Get(), o.EmptyCount.IsSet() +} + +// HasEmptyCount returns a boolean if a field has been set. +func (o *DatasetFieldStatistics) HasEmptyCount() bool { + if o != nil && o.EmptyCount.IsSet() { + return true + } + + return false +} + +// SetEmptyCount gets a reference to the given NullableInt32 and assigns it to the EmptyCount field. +func (o *DatasetFieldStatistics) SetEmptyCount(v int32) { + o.EmptyCount.Set(&v) +} +// SetEmptyCountNil sets the value for EmptyCount to be an explicit nil +func (o *DatasetFieldStatistics) SetEmptyCountNil() { + o.EmptyCount.Set(nil) +} + +// UnsetEmptyCount ensures that no value is present for EmptyCount, not even an explicit nil +func (o *DatasetFieldStatistics) UnsetEmptyCount() { + o.EmptyCount.Unset() +} + +func (o DatasetFieldStatistics) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DatasetFieldStatistics) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.Min.IsSet() { + toSerialize["min"] = o.Min.Get() + } + if o.Max.IsSet() { + toSerialize["max"] = o.Max.Get() + } + if o.NullCount.IsSet() { + toSerialize["nullCount"] = o.NullCount.Get() + } + if o.EmptyCount.IsSet() { + toSerialize["emptyCount"] = o.EmptyCount.Get() + } + return toSerialize, nil +} + +type NullableDatasetFieldStatistics struct { + value *DatasetFieldStatistics + isSet bool +} + +func (v NullableDatasetFieldStatistics) Get() *DatasetFieldStatistics { + return v.value +} + +func (v *NullableDatasetFieldStatistics) Set(val *DatasetFieldStatistics) { + v.value = val + v.isSet = true +} + +func (v NullableDatasetFieldStatistics) IsSet() bool { + return v.isSet +} + +func (v *NullableDatasetFieldStatistics) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDatasetFieldStatistics(val *DatasetFieldStatistics) *NullableDatasetFieldStatistics { + return &NullableDatasetFieldStatistics{value: val, isSet: true} +} + +func (v NullableDatasetFieldStatistics) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDatasetFieldStatistics) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_dataset_list_item.go b/model_dataset_list_item.go new file mode 100644 index 0000000..302ffc1 --- /dev/null +++ b/model_dataset_list_item.go @@ -0,0 +1,601 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" + "time" + "bytes" + "fmt" +) + +// checks if the DatasetListItem type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DatasetListItem{} + +// DatasetListItem struct for DatasetListItem +type DatasetListItem struct { + Id string `json:"id"` + Name string `json:"name"` + UserId string `json:"userId"` + CreatedAt time.Time `json:"createdAt"` + ModifiedAt time.Time `json:"modifiedAt"` + AccessedAt time.Time `json:"accessedAt"` + ItemCount int32 `json:"itemCount"` + CleanItemCount int32 `json:"cleanItemCount"` + ActId NullableString `json:"actId,omitempty"` + ActRunId NullableString `json:"actRunId,omitempty"` + Title NullableString `json:"title,omitempty"` + Username *string `json:"username,omitempty"` + GeneralAccess *GeneralAccess `json:"generalAccess,omitempty"` + Stats *DatasetStats `json:"stats,omitempty"` +} + +type _DatasetListItem DatasetListItem + +// NewDatasetListItem instantiates a new DatasetListItem object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewDatasetListItem(id string, name string, userId string, createdAt time.Time, modifiedAt time.Time, accessedAt time.Time, itemCount int32, cleanItemCount int32) *DatasetListItem { + this := DatasetListItem{} + this.Id = id + this.Name = name + this.UserId = userId + this.CreatedAt = createdAt + this.ModifiedAt = modifiedAt + this.AccessedAt = accessedAt + this.ItemCount = itemCount + this.CleanItemCount = cleanItemCount + return &this +} + +// NewDatasetListItemWithDefaults instantiates a new DatasetListItem object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDatasetListItemWithDefaults() *DatasetListItem { + this := DatasetListItem{} + return &this +} + +// GetId returns the Id field value +func (o *DatasetListItem) GetId() string { + if o == nil { + var ret string + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *DatasetListItem) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *DatasetListItem) SetId(v string) { + o.Id = v +} + +// GetName returns the Name field value +func (o *DatasetListItem) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *DatasetListItem) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *DatasetListItem) SetName(v string) { + o.Name = v +} + +// GetUserId returns the UserId field value +func (o *DatasetListItem) GetUserId() string { + if o == nil { + var ret string + return ret + } + + return o.UserId +} + +// GetUserIdOk returns a tuple with the UserId field value +// and a boolean to check if the value has been set. +func (o *DatasetListItem) GetUserIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.UserId, true +} + +// SetUserId sets field value +func (o *DatasetListItem) SetUserId(v string) { + o.UserId = v +} + +// GetCreatedAt returns the CreatedAt field value +func (o *DatasetListItem) GetCreatedAt() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value +// and a boolean to check if the value has been set. +func (o *DatasetListItem) GetCreatedAtOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.CreatedAt, true +} + +// SetCreatedAt sets field value +func (o *DatasetListItem) SetCreatedAt(v time.Time) { + o.CreatedAt = v +} + +// GetModifiedAt returns the ModifiedAt field value +func (o *DatasetListItem) GetModifiedAt() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.ModifiedAt +} + +// GetModifiedAtOk returns a tuple with the ModifiedAt field value +// and a boolean to check if the value has been set. +func (o *DatasetListItem) GetModifiedAtOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.ModifiedAt, true +} + +// SetModifiedAt sets field value +func (o *DatasetListItem) SetModifiedAt(v time.Time) { + o.ModifiedAt = v +} + +// GetAccessedAt returns the AccessedAt field value +func (o *DatasetListItem) GetAccessedAt() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.AccessedAt +} + +// GetAccessedAtOk returns a tuple with the AccessedAt field value +// and a boolean to check if the value has been set. +func (o *DatasetListItem) GetAccessedAtOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.AccessedAt, true +} + +// SetAccessedAt sets field value +func (o *DatasetListItem) SetAccessedAt(v time.Time) { + o.AccessedAt = v +} + +// GetItemCount returns the ItemCount field value +func (o *DatasetListItem) GetItemCount() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.ItemCount +} + +// GetItemCountOk returns a tuple with the ItemCount field value +// and a boolean to check if the value has been set. +func (o *DatasetListItem) GetItemCountOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.ItemCount, true +} + +// SetItemCount sets field value +func (o *DatasetListItem) SetItemCount(v int32) { + o.ItemCount = v +} + +// GetCleanItemCount returns the CleanItemCount field value +func (o *DatasetListItem) GetCleanItemCount() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.CleanItemCount +} + +// GetCleanItemCountOk returns a tuple with the CleanItemCount field value +// and a boolean to check if the value has been set. +func (o *DatasetListItem) GetCleanItemCountOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.CleanItemCount, true +} + +// SetCleanItemCount sets field value +func (o *DatasetListItem) SetCleanItemCount(v int32) { + o.CleanItemCount = v +} + +// GetActId returns the ActId field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *DatasetListItem) GetActId() string { + if o == nil || IsNil(o.ActId.Get()) { + var ret string + return ret + } + return *o.ActId.Get() +} + +// GetActIdOk returns a tuple with the ActId field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *DatasetListItem) GetActIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.ActId.Get(), o.ActId.IsSet() +} + +// HasActId returns a boolean if a field has been set. +func (o *DatasetListItem) HasActId() bool { + if o != nil && o.ActId.IsSet() { + return true + } + + return false +} + +// SetActId gets a reference to the given NullableString and assigns it to the ActId field. +func (o *DatasetListItem) SetActId(v string) { + o.ActId.Set(&v) +} +// SetActIdNil sets the value for ActId to be an explicit nil +func (o *DatasetListItem) SetActIdNil() { + o.ActId.Set(nil) +} + +// UnsetActId ensures that no value is present for ActId, not even an explicit nil +func (o *DatasetListItem) UnsetActId() { + o.ActId.Unset() +} + +// GetActRunId returns the ActRunId field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *DatasetListItem) GetActRunId() string { + if o == nil || IsNil(o.ActRunId.Get()) { + var ret string + return ret + } + return *o.ActRunId.Get() +} + +// GetActRunIdOk returns a tuple with the ActRunId field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *DatasetListItem) GetActRunIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.ActRunId.Get(), o.ActRunId.IsSet() +} + +// HasActRunId returns a boolean if a field has been set. +func (o *DatasetListItem) HasActRunId() bool { + if o != nil && o.ActRunId.IsSet() { + return true + } + + return false +} + +// SetActRunId gets a reference to the given NullableString and assigns it to the ActRunId field. +func (o *DatasetListItem) SetActRunId(v string) { + o.ActRunId.Set(&v) +} +// SetActRunIdNil sets the value for ActRunId to be an explicit nil +func (o *DatasetListItem) SetActRunIdNil() { + o.ActRunId.Set(nil) +} + +// UnsetActRunId ensures that no value is present for ActRunId, not even an explicit nil +func (o *DatasetListItem) UnsetActRunId() { + o.ActRunId.Unset() +} + +// GetTitle returns the Title field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *DatasetListItem) GetTitle() string { + if o == nil || IsNil(o.Title.Get()) { + var ret string + return ret + } + return *o.Title.Get() +} + +// GetTitleOk returns a tuple with the Title field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *DatasetListItem) GetTitleOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Title.Get(), o.Title.IsSet() +} + +// HasTitle returns a boolean if a field has been set. +func (o *DatasetListItem) HasTitle() bool { + if o != nil && o.Title.IsSet() { + return true + } + + return false +} + +// SetTitle gets a reference to the given NullableString and assigns it to the Title field. +func (o *DatasetListItem) SetTitle(v string) { + o.Title.Set(&v) +} +// SetTitleNil sets the value for Title to be an explicit nil +func (o *DatasetListItem) SetTitleNil() { + o.Title.Set(nil) +} + +// UnsetTitle ensures that no value is present for Title, not even an explicit nil +func (o *DatasetListItem) UnsetTitle() { + o.Title.Unset() +} + +// GetUsername returns the Username field value if set, zero value otherwise. +func (o *DatasetListItem) GetUsername() string { + if o == nil || IsNil(o.Username) { + var ret string + return ret + } + return *o.Username +} + +// GetUsernameOk returns a tuple with the Username field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DatasetListItem) GetUsernameOk() (*string, bool) { + if o == nil || IsNil(o.Username) { + return nil, false + } + return o.Username, true +} + +// HasUsername returns a boolean if a field has been set. +func (o *DatasetListItem) HasUsername() bool { + if o != nil && !IsNil(o.Username) { + return true + } + + return false +} + +// SetUsername gets a reference to the given string and assigns it to the Username field. +func (o *DatasetListItem) SetUsername(v string) { + o.Username = &v +} + +// GetGeneralAccess returns the GeneralAccess field value if set, zero value otherwise. +func (o *DatasetListItem) GetGeneralAccess() GeneralAccess { + if o == nil || IsNil(o.GeneralAccess) { + var ret GeneralAccess + return ret + } + return *o.GeneralAccess +} + +// GetGeneralAccessOk returns a tuple with the GeneralAccess field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DatasetListItem) GetGeneralAccessOk() (*GeneralAccess, bool) { + if o == nil || IsNil(o.GeneralAccess) { + return nil, false + } + return o.GeneralAccess, true +} + +// HasGeneralAccess returns a boolean if a field has been set. +func (o *DatasetListItem) HasGeneralAccess() bool { + if o != nil && !IsNil(o.GeneralAccess) { + return true + } + + return false +} + +// SetGeneralAccess gets a reference to the given GeneralAccess and assigns it to the GeneralAccess field. +func (o *DatasetListItem) SetGeneralAccess(v GeneralAccess) { + o.GeneralAccess = &v +} + +// GetStats returns the Stats field value if set, zero value otherwise. +func (o *DatasetListItem) GetStats() DatasetStats { + if o == nil || IsNil(o.Stats) { + var ret DatasetStats + return ret + } + return *o.Stats +} + +// GetStatsOk returns a tuple with the Stats field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DatasetListItem) GetStatsOk() (*DatasetStats, bool) { + if o == nil || IsNil(o.Stats) { + return nil, false + } + return o.Stats, true +} + +// HasStats returns a boolean if a field has been set. +func (o *DatasetListItem) HasStats() bool { + if o != nil && !IsNil(o.Stats) { + return true + } + + return false +} + +// SetStats gets a reference to the given DatasetStats and assigns it to the Stats field. +func (o *DatasetListItem) SetStats(v DatasetStats) { + o.Stats = &v +} + +func (o DatasetListItem) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DatasetListItem) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["name"] = o.Name + toSerialize["userId"] = o.UserId + toSerialize["createdAt"] = o.CreatedAt + toSerialize["modifiedAt"] = o.ModifiedAt + toSerialize["accessedAt"] = o.AccessedAt + toSerialize["itemCount"] = o.ItemCount + toSerialize["cleanItemCount"] = o.CleanItemCount + if o.ActId.IsSet() { + toSerialize["actId"] = o.ActId.Get() + } + if o.ActRunId.IsSet() { + toSerialize["actRunId"] = o.ActRunId.Get() + } + if o.Title.IsSet() { + toSerialize["title"] = o.Title.Get() + } + if !IsNil(o.Username) { + toSerialize["username"] = o.Username + } + if !IsNil(o.GeneralAccess) { + toSerialize["generalAccess"] = o.GeneralAccess + } + if !IsNil(o.Stats) { + toSerialize["stats"] = o.Stats + } + return toSerialize, nil +} + +func (o *DatasetListItem) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "name", + "userId", + "createdAt", + "modifiedAt", + "accessedAt", + "itemCount", + "cleanItemCount", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varDatasetListItem := _DatasetListItem{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varDatasetListItem) + + if err != nil { + return err + } + + *o = DatasetListItem(varDatasetListItem) + + return err +} + +type NullableDatasetListItem struct { + value *DatasetListItem + isSet bool +} + +func (v NullableDatasetListItem) Get() *DatasetListItem { + return v.value +} + +func (v *NullableDatasetListItem) Set(val *DatasetListItem) { + v.value = val + v.isSet = true +} + +func (v NullableDatasetListItem) IsSet() bool { + return v.isSet +} + +func (v *NullableDatasetListItem) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDatasetListItem(val *DatasetListItem) *NullableDatasetListItem { + return &NullableDatasetListItem{value: val, isSet: true} +} + +func (v NullableDatasetListItem) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDatasetListItem) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_dataset_response.go b/model_dataset_response.go new file mode 100644 index 0000000..ba2d9c6 --- /dev/null +++ b/model_dataset_response.go @@ -0,0 +1,158 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" + "bytes" + "fmt" +) + +// checks if the DatasetResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DatasetResponse{} + +// DatasetResponse Response containing dataset metadata. +type DatasetResponse struct { + Data Dataset `json:"data"` +} + +type _DatasetResponse DatasetResponse + +// NewDatasetResponse instantiates a new DatasetResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewDatasetResponse(data Dataset) *DatasetResponse { + this := DatasetResponse{} + this.Data = data + return &this +} + +// NewDatasetResponseWithDefaults instantiates a new DatasetResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDatasetResponseWithDefaults() *DatasetResponse { + this := DatasetResponse{} + return &this +} + +// GetData returns the Data field value +func (o *DatasetResponse) GetData() Dataset { + if o == nil { + var ret Dataset + return ret + } + + return o.Data +} + +// GetDataOk returns a tuple with the Data field value +// and a boolean to check if the value has been set. +func (o *DatasetResponse) GetDataOk() (*Dataset, bool) { + if o == nil { + return nil, false + } + return &o.Data, true +} + +// SetData sets field value +func (o *DatasetResponse) SetData(v Dataset) { + o.Data = v +} + +func (o DatasetResponse) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DatasetResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["data"] = o.Data + return toSerialize, nil +} + +func (o *DatasetResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "data", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varDatasetResponse := _DatasetResponse{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varDatasetResponse) + + if err != nil { + return err + } + + *o = DatasetResponse(varDatasetResponse) + + return err +} + +type NullableDatasetResponse struct { + value *DatasetResponse + isSet bool +} + +func (v NullableDatasetResponse) Get() *DatasetResponse { + return v.value +} + +func (v *NullableDatasetResponse) Set(val *DatasetResponse) { + v.value = val + v.isSet = true +} + +func (v NullableDatasetResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableDatasetResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDatasetResponse(val *DatasetResponse) *NullableDatasetResponse { + return &NullableDatasetResponse{value: val, isSet: true} +} + +func (v NullableDatasetResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDatasetResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_dataset_schema_validation_error.go b/model_dataset_schema_validation_error.go new file mode 100644 index 0000000..67c0de6 --- /dev/null +++ b/model_dataset_schema_validation_error.go @@ -0,0 +1,200 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" +) + +// checks if the DatasetSchemaValidationError type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DatasetSchemaValidationError{} + +// DatasetSchemaValidationError struct for DatasetSchemaValidationError +type DatasetSchemaValidationError struct { + // The type of the error. + Type *string `json:"type,omitempty"` + // A human-readable message describing the error. + Message *string `json:"message,omitempty"` + Data *SchemaValidationErrorData `json:"data,omitempty"` +} + +// NewDatasetSchemaValidationError instantiates a new DatasetSchemaValidationError object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewDatasetSchemaValidationError() *DatasetSchemaValidationError { + this := DatasetSchemaValidationError{} + return &this +} + +// NewDatasetSchemaValidationErrorWithDefaults instantiates a new DatasetSchemaValidationError object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDatasetSchemaValidationErrorWithDefaults() *DatasetSchemaValidationError { + this := DatasetSchemaValidationError{} + return &this +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *DatasetSchemaValidationError) GetType() string { + if o == nil || IsNil(o.Type) { + var ret string + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DatasetSchemaValidationError) GetTypeOk() (*string, bool) { + if o == nil || IsNil(o.Type) { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *DatasetSchemaValidationError) HasType() bool { + if o != nil && !IsNil(o.Type) { + return true + } + + return false +} + +// SetType gets a reference to the given string and assigns it to the Type field. +func (o *DatasetSchemaValidationError) SetType(v string) { + o.Type = &v +} + +// GetMessage returns the Message field value if set, zero value otherwise. +func (o *DatasetSchemaValidationError) GetMessage() string { + if o == nil || IsNil(o.Message) { + var ret string + return ret + } + return *o.Message +} + +// GetMessageOk returns a tuple with the Message field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DatasetSchemaValidationError) GetMessageOk() (*string, bool) { + if o == nil || IsNil(o.Message) { + return nil, false + } + return o.Message, true +} + +// HasMessage returns a boolean if a field has been set. +func (o *DatasetSchemaValidationError) HasMessage() bool { + if o != nil && !IsNil(o.Message) { + return true + } + + return false +} + +// SetMessage gets a reference to the given string and assigns it to the Message field. +func (o *DatasetSchemaValidationError) SetMessage(v string) { + o.Message = &v +} + +// GetData returns the Data field value if set, zero value otherwise. +func (o *DatasetSchemaValidationError) GetData() SchemaValidationErrorData { + if o == nil || IsNil(o.Data) { + var ret SchemaValidationErrorData + return ret + } + return *o.Data +} + +// GetDataOk returns a tuple with the Data field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DatasetSchemaValidationError) GetDataOk() (*SchemaValidationErrorData, bool) { + if o == nil || IsNil(o.Data) { + return nil, false + } + return o.Data, true +} + +// HasData returns a boolean if a field has been set. +func (o *DatasetSchemaValidationError) HasData() bool { + if o != nil && !IsNil(o.Data) { + return true + } + + return false +} + +// SetData gets a reference to the given SchemaValidationErrorData and assigns it to the Data field. +func (o *DatasetSchemaValidationError) SetData(v SchemaValidationErrorData) { + o.Data = &v +} + +func (o DatasetSchemaValidationError) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DatasetSchemaValidationError) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Type) { + toSerialize["type"] = o.Type + } + if !IsNil(o.Message) { + toSerialize["message"] = o.Message + } + if !IsNil(o.Data) { + toSerialize["data"] = o.Data + } + return toSerialize, nil +} + +type NullableDatasetSchemaValidationError struct { + value *DatasetSchemaValidationError + isSet bool +} + +func (v NullableDatasetSchemaValidationError) Get() *DatasetSchemaValidationError { + return v.value +} + +func (v *NullableDatasetSchemaValidationError) Set(val *DatasetSchemaValidationError) { + v.value = val + v.isSet = true +} + +func (v NullableDatasetSchemaValidationError) IsSet() bool { + return v.isSet +} + +func (v *NullableDatasetSchemaValidationError) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDatasetSchemaValidationError(val *DatasetSchemaValidationError) *NullableDatasetSchemaValidationError { + return &NullableDatasetSchemaValidationError{value: val, isSet: true} +} + +func (v NullableDatasetSchemaValidationError) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDatasetSchemaValidationError) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_dataset_statistics.go b/model_dataset_statistics.go new file mode 100644 index 0000000..6f2fa66 --- /dev/null +++ b/model_dataset_statistics.go @@ -0,0 +1,127 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" +) + +// checks if the DatasetStatistics type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DatasetStatistics{} + +// DatasetStatistics struct for DatasetStatistics +type DatasetStatistics struct { + // When you configure the dataset [fields schema](https://docs.apify.com/platform/actors/development/actor-definition/dataset-schema/validation), we measure the statistics such as `min`, `max`, `nullCount` and `emptyCount` for each field. This property provides statistics for each field from dataset fields schema. <br/></br>See dataset field statistics [documentation](https://docs.apify.com/platform/actors/development/actor-definition/dataset-schema/validation#dataset-field-statistics) for more information. + FieldStatistics map[string]DatasetFieldStatistics `json:"fieldStatistics,omitempty"` +} + +// NewDatasetStatistics instantiates a new DatasetStatistics object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewDatasetStatistics() *DatasetStatistics { + this := DatasetStatistics{} + return &this +} + +// NewDatasetStatisticsWithDefaults instantiates a new DatasetStatistics object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDatasetStatisticsWithDefaults() *DatasetStatistics { + this := DatasetStatistics{} + return &this +} + +// GetFieldStatistics returns the FieldStatistics field value if set, zero value otherwise. +func (o *DatasetStatistics) GetFieldStatistics() map[string]DatasetFieldStatistics { + if o == nil || IsNil(o.FieldStatistics) { + var ret map[string]DatasetFieldStatistics + return ret + } + return o.FieldStatistics +} + +// GetFieldStatisticsOk returns a tuple with the FieldStatistics field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DatasetStatistics) GetFieldStatisticsOk() (map[string]DatasetFieldStatistics, bool) { + if o == nil || IsNil(o.FieldStatistics) { + return map[string]DatasetFieldStatistics{}, false + } + return o.FieldStatistics, true +} + +// HasFieldStatistics returns a boolean if a field has been set. +func (o *DatasetStatistics) HasFieldStatistics() bool { + if o != nil && !IsNil(o.FieldStatistics) { + return true + } + + return false +} + +// SetFieldStatistics gets a reference to the given map[string]DatasetFieldStatistics and assigns it to the FieldStatistics field. +func (o *DatasetStatistics) SetFieldStatistics(v map[string]DatasetFieldStatistics) { + o.FieldStatistics = v +} + +func (o DatasetStatistics) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DatasetStatistics) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.FieldStatistics) { + toSerialize["fieldStatistics"] = o.FieldStatistics + } + return toSerialize, nil +} + +type NullableDatasetStatistics struct { + value *DatasetStatistics + isSet bool +} + +func (v NullableDatasetStatistics) Get() *DatasetStatistics { + return v.value +} + +func (v *NullableDatasetStatistics) Set(val *DatasetStatistics) { + v.value = val + v.isSet = true +} + +func (v NullableDatasetStatistics) IsSet() bool { + return v.isSet +} + +func (v *NullableDatasetStatistics) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDatasetStatistics(val *DatasetStatistics) *NullableDatasetStatistics { + return &NullableDatasetStatistics{value: val, isSet: true} +} + +func (v NullableDatasetStatistics) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDatasetStatistics) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_dataset_statistics_response.go b/model_dataset_statistics_response.go new file mode 100644 index 0000000..a28c5bc --- /dev/null +++ b/model_dataset_statistics_response.go @@ -0,0 +1,158 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" + "bytes" + "fmt" +) + +// checks if the DatasetStatisticsResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DatasetStatisticsResponse{} + +// DatasetStatisticsResponse struct for DatasetStatisticsResponse +type DatasetStatisticsResponse struct { + Data DatasetStatistics `json:"data"` +} + +type _DatasetStatisticsResponse DatasetStatisticsResponse + +// NewDatasetStatisticsResponse instantiates a new DatasetStatisticsResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewDatasetStatisticsResponse(data DatasetStatistics) *DatasetStatisticsResponse { + this := DatasetStatisticsResponse{} + this.Data = data + return &this +} + +// NewDatasetStatisticsResponseWithDefaults instantiates a new DatasetStatisticsResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDatasetStatisticsResponseWithDefaults() *DatasetStatisticsResponse { + this := DatasetStatisticsResponse{} + return &this +} + +// GetData returns the Data field value +func (o *DatasetStatisticsResponse) GetData() DatasetStatistics { + if o == nil { + var ret DatasetStatistics + return ret + } + + return o.Data +} + +// GetDataOk returns a tuple with the Data field value +// and a boolean to check if the value has been set. +func (o *DatasetStatisticsResponse) GetDataOk() (*DatasetStatistics, bool) { + if o == nil { + return nil, false + } + return &o.Data, true +} + +// SetData sets field value +func (o *DatasetStatisticsResponse) SetData(v DatasetStatistics) { + o.Data = v +} + +func (o DatasetStatisticsResponse) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DatasetStatisticsResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["data"] = o.Data + return toSerialize, nil +} + +func (o *DatasetStatisticsResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "data", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varDatasetStatisticsResponse := _DatasetStatisticsResponse{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varDatasetStatisticsResponse) + + if err != nil { + return err + } + + *o = DatasetStatisticsResponse(varDatasetStatisticsResponse) + + return err +} + +type NullableDatasetStatisticsResponse struct { + value *DatasetStatisticsResponse + isSet bool +} + +func (v NullableDatasetStatisticsResponse) Get() *DatasetStatisticsResponse { + return v.value +} + +func (v *NullableDatasetStatisticsResponse) Set(val *DatasetStatisticsResponse) { + v.value = val + v.isSet = true +} + +func (v NullableDatasetStatisticsResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableDatasetStatisticsResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDatasetStatisticsResponse(val *DatasetStatisticsResponse) *NullableDatasetStatisticsResponse { + return &NullableDatasetStatisticsResponse{value: val, isSet: true} +} + +func (v NullableDatasetStatisticsResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDatasetStatisticsResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_dataset_stats.go b/model_dataset_stats.go new file mode 100644 index 0000000..f54b52f --- /dev/null +++ b/model_dataset_stats.go @@ -0,0 +1,236 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" +) + +// checks if the DatasetStats type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DatasetStats{} + +// DatasetStats struct for DatasetStats +type DatasetStats struct { + ReadCount *int32 `json:"readCount,omitempty"` + WriteCount *int32 `json:"writeCount,omitempty"` + // Total storage size in bytes. Only returned by the single-dataset endpoint. + StorageBytes *int32 `json:"storageBytes,omitempty"` + // Uncompressed size in bytes. Only returned by the dataset list endpoint. + InflatedBytes *int32 `json:"inflatedBytes,omitempty"` +} + +// NewDatasetStats instantiates a new DatasetStats object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewDatasetStats() *DatasetStats { + this := DatasetStats{} + return &this +} + +// NewDatasetStatsWithDefaults instantiates a new DatasetStats object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDatasetStatsWithDefaults() *DatasetStats { + this := DatasetStats{} + return &this +} + +// GetReadCount returns the ReadCount field value if set, zero value otherwise. +func (o *DatasetStats) GetReadCount() int32 { + if o == nil || IsNil(o.ReadCount) { + var ret int32 + return ret + } + return *o.ReadCount +} + +// GetReadCountOk returns a tuple with the ReadCount field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DatasetStats) GetReadCountOk() (*int32, bool) { + if o == nil || IsNil(o.ReadCount) { + return nil, false + } + return o.ReadCount, true +} + +// HasReadCount returns a boolean if a field has been set. +func (o *DatasetStats) HasReadCount() bool { + if o != nil && !IsNil(o.ReadCount) { + return true + } + + return false +} + +// SetReadCount gets a reference to the given int32 and assigns it to the ReadCount field. +func (o *DatasetStats) SetReadCount(v int32) { + o.ReadCount = &v +} + +// GetWriteCount returns the WriteCount field value if set, zero value otherwise. +func (o *DatasetStats) GetWriteCount() int32 { + if o == nil || IsNil(o.WriteCount) { + var ret int32 + return ret + } + return *o.WriteCount +} + +// GetWriteCountOk returns a tuple with the WriteCount field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DatasetStats) GetWriteCountOk() (*int32, bool) { + if o == nil || IsNil(o.WriteCount) { + return nil, false + } + return o.WriteCount, true +} + +// HasWriteCount returns a boolean if a field has been set. +func (o *DatasetStats) HasWriteCount() bool { + if o != nil && !IsNil(o.WriteCount) { + return true + } + + return false +} + +// SetWriteCount gets a reference to the given int32 and assigns it to the WriteCount field. +func (o *DatasetStats) SetWriteCount(v int32) { + o.WriteCount = &v +} + +// GetStorageBytes returns the StorageBytes field value if set, zero value otherwise. +func (o *DatasetStats) GetStorageBytes() int32 { + if o == nil || IsNil(o.StorageBytes) { + var ret int32 + return ret + } + return *o.StorageBytes +} + +// GetStorageBytesOk returns a tuple with the StorageBytes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DatasetStats) GetStorageBytesOk() (*int32, bool) { + if o == nil || IsNil(o.StorageBytes) { + return nil, false + } + return o.StorageBytes, true +} + +// HasStorageBytes returns a boolean if a field has been set. +func (o *DatasetStats) HasStorageBytes() bool { + if o != nil && !IsNil(o.StorageBytes) { + return true + } + + return false +} + +// SetStorageBytes gets a reference to the given int32 and assigns it to the StorageBytes field. +func (o *DatasetStats) SetStorageBytes(v int32) { + o.StorageBytes = &v +} + +// GetInflatedBytes returns the InflatedBytes field value if set, zero value otherwise. +func (o *DatasetStats) GetInflatedBytes() int32 { + if o == nil || IsNil(o.InflatedBytes) { + var ret int32 + return ret + } + return *o.InflatedBytes +} + +// GetInflatedBytesOk returns a tuple with the InflatedBytes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DatasetStats) GetInflatedBytesOk() (*int32, bool) { + if o == nil || IsNil(o.InflatedBytes) { + return nil, false + } + return o.InflatedBytes, true +} + +// HasInflatedBytes returns a boolean if a field has been set. +func (o *DatasetStats) HasInflatedBytes() bool { + if o != nil && !IsNil(o.InflatedBytes) { + return true + } + + return false +} + +// SetInflatedBytes gets a reference to the given int32 and assigns it to the InflatedBytes field. +func (o *DatasetStats) SetInflatedBytes(v int32) { + o.InflatedBytes = &v +} + +func (o DatasetStats) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DatasetStats) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.ReadCount) { + toSerialize["readCount"] = o.ReadCount + } + if !IsNil(o.WriteCount) { + toSerialize["writeCount"] = o.WriteCount + } + if !IsNil(o.StorageBytes) { + toSerialize["storageBytes"] = o.StorageBytes + } + if !IsNil(o.InflatedBytes) { + toSerialize["inflatedBytes"] = o.InflatedBytes + } + return toSerialize, nil +} + +type NullableDatasetStats struct { + value *DatasetStats + isSet bool +} + +func (v NullableDatasetStats) Get() *DatasetStats { + return v.value +} + +func (v *NullableDatasetStats) Set(val *DatasetStats) { + v.value = val + v.isSet = true +} + +func (v NullableDatasetStats) IsSet() bool { + return v.isSet +} + +func (v *NullableDatasetStats) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDatasetStats(val *DatasetStats) *NullableDatasetStats { + return &NullableDatasetStats{value: val, isSet: true} +} + +func (v NullableDatasetStats) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDatasetStats) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_decode_and_verify_data.go b/model_decode_and_verify_data.go new file mode 100644 index 0000000..07bad2f --- /dev/null +++ b/model_decode_and_verify_data.go @@ -0,0 +1,220 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" + "bytes" + "fmt" +) + +// checks if the DecodeAndVerifyData type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DecodeAndVerifyData{} + +// DecodeAndVerifyData struct for DecodeAndVerifyData +type DecodeAndVerifyData struct { + Decoded interface{} `json:"decoded"` + EncodedByUserId NullableString `json:"encodedByUserId"` + IsVerifiedUser bool `json:"isVerifiedUser"` +} + +type _DecodeAndVerifyData DecodeAndVerifyData + +// NewDecodeAndVerifyData instantiates a new DecodeAndVerifyData object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewDecodeAndVerifyData(decoded interface{}, encodedByUserId NullableString, isVerifiedUser bool) *DecodeAndVerifyData { + this := DecodeAndVerifyData{} + this.Decoded = decoded + this.EncodedByUserId = encodedByUserId + this.IsVerifiedUser = isVerifiedUser + return &this +} + +// NewDecodeAndVerifyDataWithDefaults instantiates a new DecodeAndVerifyData object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDecodeAndVerifyDataWithDefaults() *DecodeAndVerifyData { + this := DecodeAndVerifyData{} + return &this +} + +// GetDecoded returns the Decoded field value +// If the value is explicit nil, the zero value for interface{} will be returned +func (o *DecodeAndVerifyData) GetDecoded() interface{} { + if o == nil { + var ret interface{} + return ret + } + + return o.Decoded +} + +// GetDecodedOk returns a tuple with the Decoded field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *DecodeAndVerifyData) GetDecodedOk() (*interface{}, bool) { + if o == nil || IsNil(o.Decoded) { + return nil, false + } + return &o.Decoded, true +} + +// SetDecoded sets field value +func (o *DecodeAndVerifyData) SetDecoded(v interface{}) { + o.Decoded = v +} + +// GetEncodedByUserId returns the EncodedByUserId field value +// If the value is explicit nil, the zero value for string will be returned +func (o *DecodeAndVerifyData) GetEncodedByUserId() string { + if o == nil || o.EncodedByUserId.Get() == nil { + var ret string + return ret + } + + return *o.EncodedByUserId.Get() +} + +// GetEncodedByUserIdOk returns a tuple with the EncodedByUserId field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *DecodeAndVerifyData) GetEncodedByUserIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.EncodedByUserId.Get(), o.EncodedByUserId.IsSet() +} + +// SetEncodedByUserId sets field value +func (o *DecodeAndVerifyData) SetEncodedByUserId(v string) { + o.EncodedByUserId.Set(&v) +} + +// GetIsVerifiedUser returns the IsVerifiedUser field value +func (o *DecodeAndVerifyData) GetIsVerifiedUser() bool { + if o == nil { + var ret bool + return ret + } + + return o.IsVerifiedUser +} + +// GetIsVerifiedUserOk returns a tuple with the IsVerifiedUser field value +// and a boolean to check if the value has been set. +func (o *DecodeAndVerifyData) GetIsVerifiedUserOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.IsVerifiedUser, true +} + +// SetIsVerifiedUser sets field value +func (o *DecodeAndVerifyData) SetIsVerifiedUser(v bool) { + o.IsVerifiedUser = v +} + +func (o DecodeAndVerifyData) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DecodeAndVerifyData) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.Decoded != nil { + toSerialize["decoded"] = o.Decoded + } + toSerialize["encodedByUserId"] = o.EncodedByUserId.Get() + toSerialize["isVerifiedUser"] = o.IsVerifiedUser + return toSerialize, nil +} + +func (o *DecodeAndVerifyData) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "decoded", + "encodedByUserId", + "isVerifiedUser", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varDecodeAndVerifyData := _DecodeAndVerifyData{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varDecodeAndVerifyData) + + if err != nil { + return err + } + + *o = DecodeAndVerifyData(varDecodeAndVerifyData) + + return err +} + +type NullableDecodeAndVerifyData struct { + value *DecodeAndVerifyData + isSet bool +} + +func (v NullableDecodeAndVerifyData) Get() *DecodeAndVerifyData { + return v.value +} + +func (v *NullableDecodeAndVerifyData) Set(val *DecodeAndVerifyData) { + v.value = val + v.isSet = true +} + +func (v NullableDecodeAndVerifyData) IsSet() bool { + return v.isSet +} + +func (v *NullableDecodeAndVerifyData) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDecodeAndVerifyData(val *DecodeAndVerifyData) *NullableDecodeAndVerifyData { + return &NullableDecodeAndVerifyData{value: val, isSet: true} +} + +func (v NullableDecodeAndVerifyData) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDecodeAndVerifyData) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_decode_and_verify_request.go b/model_decode_and_verify_request.go new file mode 100644 index 0000000..09d5d70 --- /dev/null +++ b/model_decode_and_verify_request.go @@ -0,0 +1,158 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" + "bytes" + "fmt" +) + +// checks if the DecodeAndVerifyRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DecodeAndVerifyRequest{} + +// DecodeAndVerifyRequest struct for DecodeAndVerifyRequest +type DecodeAndVerifyRequest struct { + Encoded string `json:"encoded"` +} + +type _DecodeAndVerifyRequest DecodeAndVerifyRequest + +// NewDecodeAndVerifyRequest instantiates a new DecodeAndVerifyRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewDecodeAndVerifyRequest(encoded string) *DecodeAndVerifyRequest { + this := DecodeAndVerifyRequest{} + this.Encoded = encoded + return &this +} + +// NewDecodeAndVerifyRequestWithDefaults instantiates a new DecodeAndVerifyRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDecodeAndVerifyRequestWithDefaults() *DecodeAndVerifyRequest { + this := DecodeAndVerifyRequest{} + return &this +} + +// GetEncoded returns the Encoded field value +func (o *DecodeAndVerifyRequest) GetEncoded() string { + if o == nil { + var ret string + return ret + } + + return o.Encoded +} + +// GetEncodedOk returns a tuple with the Encoded field value +// and a boolean to check if the value has been set. +func (o *DecodeAndVerifyRequest) GetEncodedOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Encoded, true +} + +// SetEncoded sets field value +func (o *DecodeAndVerifyRequest) SetEncoded(v string) { + o.Encoded = v +} + +func (o DecodeAndVerifyRequest) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DecodeAndVerifyRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["encoded"] = o.Encoded + return toSerialize, nil +} + +func (o *DecodeAndVerifyRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "encoded", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varDecodeAndVerifyRequest := _DecodeAndVerifyRequest{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varDecodeAndVerifyRequest) + + if err != nil { + return err + } + + *o = DecodeAndVerifyRequest(varDecodeAndVerifyRequest) + + return err +} + +type NullableDecodeAndVerifyRequest struct { + value *DecodeAndVerifyRequest + isSet bool +} + +func (v NullableDecodeAndVerifyRequest) Get() *DecodeAndVerifyRequest { + return v.value +} + +func (v *NullableDecodeAndVerifyRequest) Set(val *DecodeAndVerifyRequest) { + v.value = val + v.isSet = true +} + +func (v NullableDecodeAndVerifyRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableDecodeAndVerifyRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDecodeAndVerifyRequest(val *DecodeAndVerifyRequest) *NullableDecodeAndVerifyRequest { + return &NullableDecodeAndVerifyRequest{value: val, isSet: true} +} + +func (v NullableDecodeAndVerifyRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDecodeAndVerifyRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_decode_and_verify_response.go b/model_decode_and_verify_response.go new file mode 100644 index 0000000..956b853 --- /dev/null +++ b/model_decode_and_verify_response.go @@ -0,0 +1,158 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" + "bytes" + "fmt" +) + +// checks if the DecodeAndVerifyResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DecodeAndVerifyResponse{} + +// DecodeAndVerifyResponse struct for DecodeAndVerifyResponse +type DecodeAndVerifyResponse struct { + Data DecodeAndVerifyData `json:"data"` +} + +type _DecodeAndVerifyResponse DecodeAndVerifyResponse + +// NewDecodeAndVerifyResponse instantiates a new DecodeAndVerifyResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewDecodeAndVerifyResponse(data DecodeAndVerifyData) *DecodeAndVerifyResponse { + this := DecodeAndVerifyResponse{} + this.Data = data + return &this +} + +// NewDecodeAndVerifyResponseWithDefaults instantiates a new DecodeAndVerifyResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDecodeAndVerifyResponseWithDefaults() *DecodeAndVerifyResponse { + this := DecodeAndVerifyResponse{} + return &this +} + +// GetData returns the Data field value +func (o *DecodeAndVerifyResponse) GetData() DecodeAndVerifyData { + if o == nil { + var ret DecodeAndVerifyData + return ret + } + + return o.Data +} + +// GetDataOk returns a tuple with the Data field value +// and a boolean to check if the value has been set. +func (o *DecodeAndVerifyResponse) GetDataOk() (*DecodeAndVerifyData, bool) { + if o == nil { + return nil, false + } + return &o.Data, true +} + +// SetData sets field value +func (o *DecodeAndVerifyResponse) SetData(v DecodeAndVerifyData) { + o.Data = v +} + +func (o DecodeAndVerifyResponse) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DecodeAndVerifyResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["data"] = o.Data + return toSerialize, nil +} + +func (o *DecodeAndVerifyResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "data", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varDecodeAndVerifyResponse := _DecodeAndVerifyResponse{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varDecodeAndVerifyResponse) + + if err != nil { + return err + } + + *o = DecodeAndVerifyResponse(varDecodeAndVerifyResponse) + + return err +} + +type NullableDecodeAndVerifyResponse struct { + value *DecodeAndVerifyResponse + isSet bool +} + +func (v NullableDecodeAndVerifyResponse) Get() *DecodeAndVerifyResponse { + return v.value +} + +func (v *NullableDecodeAndVerifyResponse) Set(val *DecodeAndVerifyResponse) { + v.value = val + v.isSet = true +} + +func (v NullableDecodeAndVerifyResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableDecodeAndVerifyResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDecodeAndVerifyResponse(val *DecodeAndVerifyResponse) *NullableDecodeAndVerifyResponse { + return &NullableDecodeAndVerifyResponse{value: val, isSet: true} +} + +func (v NullableDecodeAndVerifyResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDecodeAndVerifyResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_default_run_options.go b/model_default_run_options.go new file mode 100644 index 0000000..49150c2 --- /dev/null +++ b/model_default_run_options.go @@ -0,0 +1,326 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" +) + +// checks if the DefaultRunOptions type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DefaultRunOptions{} + +// DefaultRunOptions struct for DefaultRunOptions +type DefaultRunOptions struct { + Build *string `json:"build,omitempty"` + TimeoutSecs *int32 `json:"timeoutSecs,omitempty"` + MemoryMbytes *int32 `json:"memoryMbytes,omitempty"` + RestartOnError *bool `json:"restartOnError,omitempty"` + MaxItems NullableInt32 `json:"maxItems,omitempty"` + ForcePermissionLevel NullableActorPermissionLevel `json:"forcePermissionLevel,omitempty"` +} + +// NewDefaultRunOptions instantiates a new DefaultRunOptions object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewDefaultRunOptions() *DefaultRunOptions { + this := DefaultRunOptions{} + return &this +} + +// NewDefaultRunOptionsWithDefaults instantiates a new DefaultRunOptions object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDefaultRunOptionsWithDefaults() *DefaultRunOptions { + this := DefaultRunOptions{} + return &this +} + +// GetBuild returns the Build field value if set, zero value otherwise. +func (o *DefaultRunOptions) GetBuild() string { + if o == nil || IsNil(o.Build) { + var ret string + return ret + } + return *o.Build +} + +// GetBuildOk returns a tuple with the Build field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DefaultRunOptions) GetBuildOk() (*string, bool) { + if o == nil || IsNil(o.Build) { + return nil, false + } + return o.Build, true +} + +// HasBuild returns a boolean if a field has been set. +func (o *DefaultRunOptions) HasBuild() bool { + if o != nil && !IsNil(o.Build) { + return true + } + + return false +} + +// SetBuild gets a reference to the given string and assigns it to the Build field. +func (o *DefaultRunOptions) SetBuild(v string) { + o.Build = &v +} + +// GetTimeoutSecs returns the TimeoutSecs field value if set, zero value otherwise. +func (o *DefaultRunOptions) GetTimeoutSecs() int32 { + if o == nil || IsNil(o.TimeoutSecs) { + var ret int32 + return ret + } + return *o.TimeoutSecs +} + +// GetTimeoutSecsOk returns a tuple with the TimeoutSecs field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DefaultRunOptions) GetTimeoutSecsOk() (*int32, bool) { + if o == nil || IsNil(o.TimeoutSecs) { + return nil, false + } + return o.TimeoutSecs, true +} + +// HasTimeoutSecs returns a boolean if a field has been set. +func (o *DefaultRunOptions) HasTimeoutSecs() bool { + if o != nil && !IsNil(o.TimeoutSecs) { + return true + } + + return false +} + +// SetTimeoutSecs gets a reference to the given int32 and assigns it to the TimeoutSecs field. +func (o *DefaultRunOptions) SetTimeoutSecs(v int32) { + o.TimeoutSecs = &v +} + +// GetMemoryMbytes returns the MemoryMbytes field value if set, zero value otherwise. +func (o *DefaultRunOptions) GetMemoryMbytes() int32 { + if o == nil || IsNil(o.MemoryMbytes) { + var ret int32 + return ret + } + return *o.MemoryMbytes +} + +// GetMemoryMbytesOk returns a tuple with the MemoryMbytes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DefaultRunOptions) GetMemoryMbytesOk() (*int32, bool) { + if o == nil || IsNil(o.MemoryMbytes) { + return nil, false + } + return o.MemoryMbytes, true +} + +// HasMemoryMbytes returns a boolean if a field has been set. +func (o *DefaultRunOptions) HasMemoryMbytes() bool { + if o != nil && !IsNil(o.MemoryMbytes) { + return true + } + + return false +} + +// SetMemoryMbytes gets a reference to the given int32 and assigns it to the MemoryMbytes field. +func (o *DefaultRunOptions) SetMemoryMbytes(v int32) { + o.MemoryMbytes = &v +} + +// GetRestartOnError returns the RestartOnError field value if set, zero value otherwise. +func (o *DefaultRunOptions) GetRestartOnError() bool { + if o == nil || IsNil(o.RestartOnError) { + var ret bool + return ret + } + return *o.RestartOnError +} + +// GetRestartOnErrorOk returns a tuple with the RestartOnError field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DefaultRunOptions) GetRestartOnErrorOk() (*bool, bool) { + if o == nil || IsNil(o.RestartOnError) { + return nil, false + } + return o.RestartOnError, true +} + +// HasRestartOnError returns a boolean if a field has been set. +func (o *DefaultRunOptions) HasRestartOnError() bool { + if o != nil && !IsNil(o.RestartOnError) { + return true + } + + return false +} + +// SetRestartOnError gets a reference to the given bool and assigns it to the RestartOnError field. +func (o *DefaultRunOptions) SetRestartOnError(v bool) { + o.RestartOnError = &v +} + +// GetMaxItems returns the MaxItems field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *DefaultRunOptions) GetMaxItems() int32 { + if o == nil || IsNil(o.MaxItems.Get()) { + var ret int32 + return ret + } + return *o.MaxItems.Get() +} + +// GetMaxItemsOk returns a tuple with the MaxItems field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *DefaultRunOptions) GetMaxItemsOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.MaxItems.Get(), o.MaxItems.IsSet() +} + +// HasMaxItems returns a boolean if a field has been set. +func (o *DefaultRunOptions) HasMaxItems() bool { + if o != nil && o.MaxItems.IsSet() { + return true + } + + return false +} + +// SetMaxItems gets a reference to the given NullableInt32 and assigns it to the MaxItems field. +func (o *DefaultRunOptions) SetMaxItems(v int32) { + o.MaxItems.Set(&v) +} +// SetMaxItemsNil sets the value for MaxItems to be an explicit nil +func (o *DefaultRunOptions) SetMaxItemsNil() { + o.MaxItems.Set(nil) +} + +// UnsetMaxItems ensures that no value is present for MaxItems, not even an explicit nil +func (o *DefaultRunOptions) UnsetMaxItems() { + o.MaxItems.Unset() +} + +// GetForcePermissionLevel returns the ForcePermissionLevel field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *DefaultRunOptions) GetForcePermissionLevel() ActorPermissionLevel { + if o == nil || IsNil(o.ForcePermissionLevel.Get()) { + var ret ActorPermissionLevel + return ret + } + return *o.ForcePermissionLevel.Get() +} + +// GetForcePermissionLevelOk returns a tuple with the ForcePermissionLevel field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *DefaultRunOptions) GetForcePermissionLevelOk() (*ActorPermissionLevel, bool) { + if o == nil { + return nil, false + } + return o.ForcePermissionLevel.Get(), o.ForcePermissionLevel.IsSet() +} + +// HasForcePermissionLevel returns a boolean if a field has been set. +func (o *DefaultRunOptions) HasForcePermissionLevel() bool { + if o != nil && o.ForcePermissionLevel.IsSet() { + return true + } + + return false +} + +// SetForcePermissionLevel gets a reference to the given NullableActorPermissionLevel and assigns it to the ForcePermissionLevel field. +func (o *DefaultRunOptions) SetForcePermissionLevel(v ActorPermissionLevel) { + o.ForcePermissionLevel.Set(&v) +} +// SetForcePermissionLevelNil sets the value for ForcePermissionLevel to be an explicit nil +func (o *DefaultRunOptions) SetForcePermissionLevelNil() { + o.ForcePermissionLevel.Set(nil) +} + +// UnsetForcePermissionLevel ensures that no value is present for ForcePermissionLevel, not even an explicit nil +func (o *DefaultRunOptions) UnsetForcePermissionLevel() { + o.ForcePermissionLevel.Unset() +} + +func (o DefaultRunOptions) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DefaultRunOptions) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Build) { + toSerialize["build"] = o.Build + } + if !IsNil(o.TimeoutSecs) { + toSerialize["timeoutSecs"] = o.TimeoutSecs + } + if !IsNil(o.MemoryMbytes) { + toSerialize["memoryMbytes"] = o.MemoryMbytes + } + if !IsNil(o.RestartOnError) { + toSerialize["restartOnError"] = o.RestartOnError + } + if o.MaxItems.IsSet() { + toSerialize["maxItems"] = o.MaxItems.Get() + } + if o.ForcePermissionLevel.IsSet() { + toSerialize["forcePermissionLevel"] = o.ForcePermissionLevel.Get() + } + return toSerialize, nil +} + +type NullableDefaultRunOptions struct { + value *DefaultRunOptions + isSet bool +} + +func (v NullableDefaultRunOptions) Get() *DefaultRunOptions { + return v.value +} + +func (v *NullableDefaultRunOptions) Set(val *DefaultRunOptions) { + v.value = val + v.isSet = true +} + +func (v NullableDefaultRunOptions) IsSet() bool { + return v.isSet +} + +func (v *NullableDefaultRunOptions) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDefaultRunOptions(val *DefaultRunOptions) *NullableDefaultRunOptions { + return &NullableDefaultRunOptions{value: val, isSet: true} +} + +func (v NullableDefaultRunOptions) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDefaultRunOptions) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_deleted_request.go b/model_deleted_request.go new file mode 100644 index 0000000..68352ca --- /dev/null +++ b/model_deleted_request.go @@ -0,0 +1,107 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" + "fmt" +) + + +// DeletedRequest Confirmation of a request that was successfully deleted from a request queue. +type DeletedRequest struct { + DeletedRequestById *DeletedRequestById + DeletedRequestByUniqueKey *DeletedRequestByUniqueKey +} + +// Unmarshal JSON data into any of the pointers in the struct +func (dst *DeletedRequest) UnmarshalJSON(data []byte) error { + var err error + // try to unmarshal JSON data into DeletedRequestById + err = json.Unmarshal(data, &dst.DeletedRequestById); + if err == nil { + jsonDeletedRequestById, _ := json.Marshal(dst.DeletedRequestById) + if string(jsonDeletedRequestById) == "{}" { // empty struct + dst.DeletedRequestById = nil + } else { + return nil // data stored in dst.DeletedRequestById, return on the first match + } + } else { + dst.DeletedRequestById = nil + } + + // try to unmarshal JSON data into DeletedRequestByUniqueKey + err = json.Unmarshal(data, &dst.DeletedRequestByUniqueKey); + if err == nil { + jsonDeletedRequestByUniqueKey, _ := json.Marshal(dst.DeletedRequestByUniqueKey) + if string(jsonDeletedRequestByUniqueKey) == "{}" { // empty struct + dst.DeletedRequestByUniqueKey = nil + } else { + return nil // data stored in dst.DeletedRequestByUniqueKey, return on the first match + } + } else { + dst.DeletedRequestByUniqueKey = nil + } + + return fmt.Errorf("data failed to match schemas in anyOf(DeletedRequest)") +} + +// Marshal data from the first non-nil pointers in the struct to JSON +func (src DeletedRequest) MarshalJSON() ([]byte, error) { + if src.DeletedRequestById != nil { + return json.Marshal(&src.DeletedRequestById) + } + + if src.DeletedRequestByUniqueKey != nil { + return json.Marshal(&src.DeletedRequestByUniqueKey) + } + + return nil, nil // no data in anyOf schemas +} + + +type NullableDeletedRequest struct { + value *DeletedRequest + isSet bool +} + +func (v NullableDeletedRequest) Get() *DeletedRequest { + return v.value +} + +func (v *NullableDeletedRequest) Set(val *DeletedRequest) { + v.value = val + v.isSet = true +} + +func (v NullableDeletedRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableDeletedRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDeletedRequest(val *DeletedRequest) *NullableDeletedRequest { + return &NullableDeletedRequest{value: val, isSet: true} +} + +func (v NullableDeletedRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDeletedRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_deleted_request_by_id.go b/model_deleted_request_by_id.go new file mode 100644 index 0000000..8d98bcb --- /dev/null +++ b/model_deleted_request_by_id.go @@ -0,0 +1,196 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" + "bytes" + "fmt" +) + +// checks if the DeletedRequestById type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DeletedRequestById{} + +// DeletedRequestById Confirmation of a request that was successfully deleted, identified by its ID. +type DeletedRequestById struct { + // A unique key used for request de-duplication. Requests with the same unique key are considered identical. + UniqueKey *string `json:"uniqueKey,omitempty"` + // A unique identifier assigned to the request. + Id string `json:"id"` +} + +type _DeletedRequestById DeletedRequestById + +// NewDeletedRequestById instantiates a new DeletedRequestById object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewDeletedRequestById(id string) *DeletedRequestById { + this := DeletedRequestById{} + this.Id = id + return &this +} + +// NewDeletedRequestByIdWithDefaults instantiates a new DeletedRequestById object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDeletedRequestByIdWithDefaults() *DeletedRequestById { + this := DeletedRequestById{} + return &this +} + +// GetUniqueKey returns the UniqueKey field value if set, zero value otherwise. +func (o *DeletedRequestById) GetUniqueKey() string { + if o == nil || IsNil(o.UniqueKey) { + var ret string + return ret + } + return *o.UniqueKey +} + +// GetUniqueKeyOk returns a tuple with the UniqueKey field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeletedRequestById) GetUniqueKeyOk() (*string, bool) { + if o == nil || IsNil(o.UniqueKey) { + return nil, false + } + return o.UniqueKey, true +} + +// HasUniqueKey returns a boolean if a field has been set. +func (o *DeletedRequestById) HasUniqueKey() bool { + if o != nil && !IsNil(o.UniqueKey) { + return true + } + + return false +} + +// SetUniqueKey gets a reference to the given string and assigns it to the UniqueKey field. +func (o *DeletedRequestById) SetUniqueKey(v string) { + o.UniqueKey = &v +} + +// GetId returns the Id field value +func (o *DeletedRequestById) GetId() string { + if o == nil { + var ret string + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *DeletedRequestById) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *DeletedRequestById) SetId(v string) { + o.Id = v +} + +func (o DeletedRequestById) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DeletedRequestById) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.UniqueKey) { + toSerialize["uniqueKey"] = o.UniqueKey + } + toSerialize["id"] = o.Id + return toSerialize, nil +} + +func (o *DeletedRequestById) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varDeletedRequestById := _DeletedRequestById{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varDeletedRequestById) + + if err != nil { + return err + } + + *o = DeletedRequestById(varDeletedRequestById) + + return err +} + +type NullableDeletedRequestById struct { + value *DeletedRequestById + isSet bool +} + +func (v NullableDeletedRequestById) Get() *DeletedRequestById { + return v.value +} + +func (v *NullableDeletedRequestById) Set(val *DeletedRequestById) { + v.value = val + v.isSet = true +} + +func (v NullableDeletedRequestById) IsSet() bool { + return v.isSet +} + +func (v *NullableDeletedRequestById) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDeletedRequestById(val *DeletedRequestById) *NullableDeletedRequestById { + return &NullableDeletedRequestById{value: val, isSet: true} +} + +func (v NullableDeletedRequestById) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDeletedRequestById) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_deleted_request_by_unique_key.go b/model_deleted_request_by_unique_key.go new file mode 100644 index 0000000..2e74647 --- /dev/null +++ b/model_deleted_request_by_unique_key.go @@ -0,0 +1,196 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" + "bytes" + "fmt" +) + +// checks if the DeletedRequestByUniqueKey type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DeletedRequestByUniqueKey{} + +// DeletedRequestByUniqueKey Confirmation of a request that was successfully deleted, identified by its unique key. +type DeletedRequestByUniqueKey struct { + // A unique key used for request de-duplication. Requests with the same unique key are considered identical. + UniqueKey string `json:"uniqueKey"` + // A unique identifier assigned to the request. + Id *string `json:"id,omitempty"` +} + +type _DeletedRequestByUniqueKey DeletedRequestByUniqueKey + +// NewDeletedRequestByUniqueKey instantiates a new DeletedRequestByUniqueKey object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewDeletedRequestByUniqueKey(uniqueKey string) *DeletedRequestByUniqueKey { + this := DeletedRequestByUniqueKey{} + this.UniqueKey = uniqueKey + return &this +} + +// NewDeletedRequestByUniqueKeyWithDefaults instantiates a new DeletedRequestByUniqueKey object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDeletedRequestByUniqueKeyWithDefaults() *DeletedRequestByUniqueKey { + this := DeletedRequestByUniqueKey{} + return &this +} + +// GetUniqueKey returns the UniqueKey field value +func (o *DeletedRequestByUniqueKey) GetUniqueKey() string { + if o == nil { + var ret string + return ret + } + + return o.UniqueKey +} + +// GetUniqueKeyOk returns a tuple with the UniqueKey field value +// and a boolean to check if the value has been set. +func (o *DeletedRequestByUniqueKey) GetUniqueKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.UniqueKey, true +} + +// SetUniqueKey sets field value +func (o *DeletedRequestByUniqueKey) SetUniqueKey(v string) { + o.UniqueKey = v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *DeletedRequestByUniqueKey) GetId() string { + if o == nil || IsNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeletedRequestByUniqueKey) GetIdOk() (*string, bool) { + if o == nil || IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *DeletedRequestByUniqueKey) HasId() bool { + if o != nil && !IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *DeletedRequestByUniqueKey) SetId(v string) { + o.Id = &v +} + +func (o DeletedRequestByUniqueKey) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DeletedRequestByUniqueKey) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["uniqueKey"] = o.UniqueKey + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + return toSerialize, nil +} + +func (o *DeletedRequestByUniqueKey) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "uniqueKey", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varDeletedRequestByUniqueKey := _DeletedRequestByUniqueKey{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varDeletedRequestByUniqueKey) + + if err != nil { + return err + } + + *o = DeletedRequestByUniqueKey(varDeletedRequestByUniqueKey) + + return err +} + +type NullableDeletedRequestByUniqueKey struct { + value *DeletedRequestByUniqueKey + isSet bool +} + +func (v NullableDeletedRequestByUniqueKey) Get() *DeletedRequestByUniqueKey { + return v.value +} + +func (v *NullableDeletedRequestByUniqueKey) Set(val *DeletedRequestByUniqueKey) { + v.value = val + v.isSet = true +} + +func (v NullableDeletedRequestByUniqueKey) IsSet() bool { + return v.isSet +} + +func (v *NullableDeletedRequestByUniqueKey) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDeletedRequestByUniqueKey(val *DeletedRequestByUniqueKey) *NullableDeletedRequestByUniqueKey { + return &NullableDeletedRequestByUniqueKey{value: val, isSet: true} +} + +func (v NullableDeletedRequestByUniqueKey) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDeletedRequestByUniqueKey) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_effective_platform_feature.go b/model_effective_platform_feature.go new file mode 100644 index 0000000..2dca6a4 --- /dev/null +++ b/model_effective_platform_feature.go @@ -0,0 +1,277 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" + "time" + "bytes" + "fmt" +) + +// checks if the EffectivePlatformFeature type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &EffectivePlatformFeature{} + +// EffectivePlatformFeature struct for EffectivePlatformFeature +type EffectivePlatformFeature struct { + IsEnabled bool `json:"isEnabled"` + DisabledReason NullableString `json:"disabledReason"` + DisabledReasonType NullableString `json:"disabledReasonType"` + IsTrial bool `json:"isTrial"` + TrialExpirationAt NullableTime `json:"trialExpirationAt"` +} + +type _EffectivePlatformFeature EffectivePlatformFeature + +// NewEffectivePlatformFeature instantiates a new EffectivePlatformFeature object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewEffectivePlatformFeature(isEnabled bool, disabledReason NullableString, disabledReasonType NullableString, isTrial bool, trialExpirationAt NullableTime) *EffectivePlatformFeature { + this := EffectivePlatformFeature{} + this.IsEnabled = isEnabled + this.DisabledReason = disabledReason + this.DisabledReasonType = disabledReasonType + this.IsTrial = isTrial + this.TrialExpirationAt = trialExpirationAt + return &this +} + +// NewEffectivePlatformFeatureWithDefaults instantiates a new EffectivePlatformFeature object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewEffectivePlatformFeatureWithDefaults() *EffectivePlatformFeature { + this := EffectivePlatformFeature{} + return &this +} + +// GetIsEnabled returns the IsEnabled field value +func (o *EffectivePlatformFeature) GetIsEnabled() bool { + if o == nil { + var ret bool + return ret + } + + return o.IsEnabled +} + +// GetIsEnabledOk returns a tuple with the IsEnabled field value +// and a boolean to check if the value has been set. +func (o *EffectivePlatformFeature) GetIsEnabledOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.IsEnabled, true +} + +// SetIsEnabled sets field value +func (o *EffectivePlatformFeature) SetIsEnabled(v bool) { + o.IsEnabled = v +} + +// GetDisabledReason returns the DisabledReason field value +// If the value is explicit nil, the zero value for string will be returned +func (o *EffectivePlatformFeature) GetDisabledReason() string { + if o == nil || o.DisabledReason.Get() == nil { + var ret string + return ret + } + + return *o.DisabledReason.Get() +} + +// GetDisabledReasonOk returns a tuple with the DisabledReason field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *EffectivePlatformFeature) GetDisabledReasonOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.DisabledReason.Get(), o.DisabledReason.IsSet() +} + +// SetDisabledReason sets field value +func (o *EffectivePlatformFeature) SetDisabledReason(v string) { + o.DisabledReason.Set(&v) +} + +// GetDisabledReasonType returns the DisabledReasonType field value +// If the value is explicit nil, the zero value for string will be returned +func (o *EffectivePlatformFeature) GetDisabledReasonType() string { + if o == nil || o.DisabledReasonType.Get() == nil { + var ret string + return ret + } + + return *o.DisabledReasonType.Get() +} + +// GetDisabledReasonTypeOk returns a tuple with the DisabledReasonType field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *EffectivePlatformFeature) GetDisabledReasonTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.DisabledReasonType.Get(), o.DisabledReasonType.IsSet() +} + +// SetDisabledReasonType sets field value +func (o *EffectivePlatformFeature) SetDisabledReasonType(v string) { + o.DisabledReasonType.Set(&v) +} + +// GetIsTrial returns the IsTrial field value +func (o *EffectivePlatformFeature) GetIsTrial() bool { + if o == nil { + var ret bool + return ret + } + + return o.IsTrial +} + +// GetIsTrialOk returns a tuple with the IsTrial field value +// and a boolean to check if the value has been set. +func (o *EffectivePlatformFeature) GetIsTrialOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.IsTrial, true +} + +// SetIsTrial sets field value +func (o *EffectivePlatformFeature) SetIsTrial(v bool) { + o.IsTrial = v +} + +// GetTrialExpirationAt returns the TrialExpirationAt field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *EffectivePlatformFeature) GetTrialExpirationAt() time.Time { + if o == nil || o.TrialExpirationAt.Get() == nil { + var ret time.Time + return ret + } + + return *o.TrialExpirationAt.Get() +} + +// GetTrialExpirationAtOk returns a tuple with the TrialExpirationAt field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *EffectivePlatformFeature) GetTrialExpirationAtOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.TrialExpirationAt.Get(), o.TrialExpirationAt.IsSet() +} + +// SetTrialExpirationAt sets field value +func (o *EffectivePlatformFeature) SetTrialExpirationAt(v time.Time) { + o.TrialExpirationAt.Set(&v) +} + +func (o EffectivePlatformFeature) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o EffectivePlatformFeature) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["isEnabled"] = o.IsEnabled + toSerialize["disabledReason"] = o.DisabledReason.Get() + toSerialize["disabledReasonType"] = o.DisabledReasonType.Get() + toSerialize["isTrial"] = o.IsTrial + toSerialize["trialExpirationAt"] = o.TrialExpirationAt.Get() + return toSerialize, nil +} + +func (o *EffectivePlatformFeature) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "isEnabled", + "disabledReason", + "disabledReasonType", + "isTrial", + "trialExpirationAt", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varEffectivePlatformFeature := _EffectivePlatformFeature{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varEffectivePlatformFeature) + + if err != nil { + return err + } + + *o = EffectivePlatformFeature(varEffectivePlatformFeature) + + return err +} + +type NullableEffectivePlatformFeature struct { + value *EffectivePlatformFeature + isSet bool +} + +func (v NullableEffectivePlatformFeature) Get() *EffectivePlatformFeature { + return v.value +} + +func (v *NullableEffectivePlatformFeature) Set(val *EffectivePlatformFeature) { + v.value = val + v.isSet = true +} + +func (v NullableEffectivePlatformFeature) IsSet() bool { + return v.isSet +} + +func (v *NullableEffectivePlatformFeature) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableEffectivePlatformFeature(val *EffectivePlatformFeature) *NullableEffectivePlatformFeature { + return &NullableEffectivePlatformFeature{value: val, isSet: true} +} + +func (v NullableEffectivePlatformFeature) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableEffectivePlatformFeature) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_effective_platform_features.go b/model_effective_platform_features.go new file mode 100644 index 0000000..b4344e9 --- /dev/null +++ b/model_effective_platform_features.go @@ -0,0 +1,410 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" + "bytes" + "fmt" +) + +// checks if the EffectivePlatformFeatures type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &EffectivePlatformFeatures{} + +// EffectivePlatformFeatures struct for EffectivePlatformFeatures +type EffectivePlatformFeatures struct { + ACTORS EffectivePlatformFeature `json:"ACTORS"` + STORAGE EffectivePlatformFeature `json:"STORAGE"` + SCHEDULER EffectivePlatformFeature `json:"SCHEDULER"` + PROXY EffectivePlatformFeature `json:"PROXY"` + PROXY_EXTERNAL_ACCESS EffectivePlatformFeature `json:"PROXY_EXTERNAL_ACCESS"` + PROXY_RESIDENTIAL EffectivePlatformFeature `json:"PROXY_RESIDENTIAL"` + PROXY_SERPS EffectivePlatformFeature `json:"PROXY_SERPS"` + WEBHOOKS EffectivePlatformFeature `json:"WEBHOOKS"` + ACTORS_PUBLIC_ALL EffectivePlatformFeature `json:"ACTORS_PUBLIC_ALL"` + ACTORS_PUBLIC_DEVELOPER EffectivePlatformFeature `json:"ACTORS_PUBLIC_DEVELOPER"` +} + +type _EffectivePlatformFeatures EffectivePlatformFeatures + +// NewEffectivePlatformFeatures instantiates a new EffectivePlatformFeatures object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewEffectivePlatformFeatures(aCTORS EffectivePlatformFeature, sTORAGE EffectivePlatformFeature, sCHEDULER EffectivePlatformFeature, pROXY EffectivePlatformFeature, pROXYEXTERNALACCESS EffectivePlatformFeature, pROXYRESIDENTIAL EffectivePlatformFeature, pROXYSERPS EffectivePlatformFeature, wEBHOOKS EffectivePlatformFeature, aCTORSPUBLICALL EffectivePlatformFeature, aCTORSPUBLICDEVELOPER EffectivePlatformFeature) *EffectivePlatformFeatures { + this := EffectivePlatformFeatures{} + this.ACTORS = aCTORS + this.STORAGE = sTORAGE + this.SCHEDULER = sCHEDULER + this.PROXY = pROXY + this.PROXY_EXTERNAL_ACCESS = pROXYEXTERNALACCESS + this.PROXY_RESIDENTIAL = pROXYRESIDENTIAL + this.PROXY_SERPS = pROXYSERPS + this.WEBHOOKS = wEBHOOKS + this.ACTORS_PUBLIC_ALL = aCTORSPUBLICALL + this.ACTORS_PUBLIC_DEVELOPER = aCTORSPUBLICDEVELOPER + return &this +} + +// NewEffectivePlatformFeaturesWithDefaults instantiates a new EffectivePlatformFeatures object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewEffectivePlatformFeaturesWithDefaults() *EffectivePlatformFeatures { + this := EffectivePlatformFeatures{} + return &this +} + +// GetACTORS returns the ACTORS field value +func (o *EffectivePlatformFeatures) GetACTORS() EffectivePlatformFeature { + if o == nil { + var ret EffectivePlatformFeature + return ret + } + + return o.ACTORS +} + +// GetACTORSOk returns a tuple with the ACTORS field value +// and a boolean to check if the value has been set. +func (o *EffectivePlatformFeatures) GetACTORSOk() (*EffectivePlatformFeature, bool) { + if o == nil { + return nil, false + } + return &o.ACTORS, true +} + +// SetACTORS sets field value +func (o *EffectivePlatformFeatures) SetACTORS(v EffectivePlatformFeature) { + o.ACTORS = v +} + +// GetSTORAGE returns the STORAGE field value +func (o *EffectivePlatformFeatures) GetSTORAGE() EffectivePlatformFeature { + if o == nil { + var ret EffectivePlatformFeature + return ret + } + + return o.STORAGE +} + +// GetSTORAGEOk returns a tuple with the STORAGE field value +// and a boolean to check if the value has been set. +func (o *EffectivePlatformFeatures) GetSTORAGEOk() (*EffectivePlatformFeature, bool) { + if o == nil { + return nil, false + } + return &o.STORAGE, true +} + +// SetSTORAGE sets field value +func (o *EffectivePlatformFeatures) SetSTORAGE(v EffectivePlatformFeature) { + o.STORAGE = v +} + +// GetSCHEDULER returns the SCHEDULER field value +func (o *EffectivePlatformFeatures) GetSCHEDULER() EffectivePlatformFeature { + if o == nil { + var ret EffectivePlatformFeature + return ret + } + + return o.SCHEDULER +} + +// GetSCHEDULEROk returns a tuple with the SCHEDULER field value +// and a boolean to check if the value has been set. +func (o *EffectivePlatformFeatures) GetSCHEDULEROk() (*EffectivePlatformFeature, bool) { + if o == nil { + return nil, false + } + return &o.SCHEDULER, true +} + +// SetSCHEDULER sets field value +func (o *EffectivePlatformFeatures) SetSCHEDULER(v EffectivePlatformFeature) { + o.SCHEDULER = v +} + +// GetPROXY returns the PROXY field value +func (o *EffectivePlatformFeatures) GetPROXY() EffectivePlatformFeature { + if o == nil { + var ret EffectivePlatformFeature + return ret + } + + return o.PROXY +} + +// GetPROXYOk returns a tuple with the PROXY field value +// and a boolean to check if the value has been set. +func (o *EffectivePlatformFeatures) GetPROXYOk() (*EffectivePlatformFeature, bool) { + if o == nil { + return nil, false + } + return &o.PROXY, true +} + +// SetPROXY sets field value +func (o *EffectivePlatformFeatures) SetPROXY(v EffectivePlatformFeature) { + o.PROXY = v +} + +// GetPROXY_EXTERNAL_ACCESS returns the PROXY_EXTERNAL_ACCESS field value +func (o *EffectivePlatformFeatures) GetPROXY_EXTERNAL_ACCESS() EffectivePlatformFeature { + if o == nil { + var ret EffectivePlatformFeature + return ret + } + + return o.PROXY_EXTERNAL_ACCESS +} + +// GetPROXY_EXTERNAL_ACCESSOk returns a tuple with the PROXY_EXTERNAL_ACCESS field value +// and a boolean to check if the value has been set. +func (o *EffectivePlatformFeatures) GetPROXY_EXTERNAL_ACCESSOk() (*EffectivePlatformFeature, bool) { + if o == nil { + return nil, false + } + return &o.PROXY_EXTERNAL_ACCESS, true +} + +// SetPROXY_EXTERNAL_ACCESS sets field value +func (o *EffectivePlatformFeatures) SetPROXY_EXTERNAL_ACCESS(v EffectivePlatformFeature) { + o.PROXY_EXTERNAL_ACCESS = v +} + +// GetPROXY_RESIDENTIAL returns the PROXY_RESIDENTIAL field value +func (o *EffectivePlatformFeatures) GetPROXY_RESIDENTIAL() EffectivePlatformFeature { + if o == nil { + var ret EffectivePlatformFeature + return ret + } + + return o.PROXY_RESIDENTIAL +} + +// GetPROXY_RESIDENTIALOk returns a tuple with the PROXY_RESIDENTIAL field value +// and a boolean to check if the value has been set. +func (o *EffectivePlatformFeatures) GetPROXY_RESIDENTIALOk() (*EffectivePlatformFeature, bool) { + if o == nil { + return nil, false + } + return &o.PROXY_RESIDENTIAL, true +} + +// SetPROXY_RESIDENTIAL sets field value +func (o *EffectivePlatformFeatures) SetPROXY_RESIDENTIAL(v EffectivePlatformFeature) { + o.PROXY_RESIDENTIAL = v +} + +// GetPROXY_SERPS returns the PROXY_SERPS field value +func (o *EffectivePlatformFeatures) GetPROXY_SERPS() EffectivePlatformFeature { + if o == nil { + var ret EffectivePlatformFeature + return ret + } + + return o.PROXY_SERPS +} + +// GetPROXY_SERPSOk returns a tuple with the PROXY_SERPS field value +// and a boolean to check if the value has been set. +func (o *EffectivePlatformFeatures) GetPROXY_SERPSOk() (*EffectivePlatformFeature, bool) { + if o == nil { + return nil, false + } + return &o.PROXY_SERPS, true +} + +// SetPROXY_SERPS sets field value +func (o *EffectivePlatformFeatures) SetPROXY_SERPS(v EffectivePlatformFeature) { + o.PROXY_SERPS = v +} + +// GetWEBHOOKS returns the WEBHOOKS field value +func (o *EffectivePlatformFeatures) GetWEBHOOKS() EffectivePlatformFeature { + if o == nil { + var ret EffectivePlatformFeature + return ret + } + + return o.WEBHOOKS +} + +// GetWEBHOOKSOk returns a tuple with the WEBHOOKS field value +// and a boolean to check if the value has been set. +func (o *EffectivePlatformFeatures) GetWEBHOOKSOk() (*EffectivePlatformFeature, bool) { + if o == nil { + return nil, false + } + return &o.WEBHOOKS, true +} + +// SetWEBHOOKS sets field value +func (o *EffectivePlatformFeatures) SetWEBHOOKS(v EffectivePlatformFeature) { + o.WEBHOOKS = v +} + +// GetACTORS_PUBLIC_ALL returns the ACTORS_PUBLIC_ALL field value +func (o *EffectivePlatformFeatures) GetACTORS_PUBLIC_ALL() EffectivePlatformFeature { + if o == nil { + var ret EffectivePlatformFeature + return ret + } + + return o.ACTORS_PUBLIC_ALL +} + +// GetACTORS_PUBLIC_ALLOk returns a tuple with the ACTORS_PUBLIC_ALL field value +// and a boolean to check if the value has been set. +func (o *EffectivePlatformFeatures) GetACTORS_PUBLIC_ALLOk() (*EffectivePlatformFeature, bool) { + if o == nil { + return nil, false + } + return &o.ACTORS_PUBLIC_ALL, true +} + +// SetACTORS_PUBLIC_ALL sets field value +func (o *EffectivePlatformFeatures) SetACTORS_PUBLIC_ALL(v EffectivePlatformFeature) { + o.ACTORS_PUBLIC_ALL = v +} + +// GetACTORS_PUBLIC_DEVELOPER returns the ACTORS_PUBLIC_DEVELOPER field value +func (o *EffectivePlatformFeatures) GetACTORS_PUBLIC_DEVELOPER() EffectivePlatformFeature { + if o == nil { + var ret EffectivePlatformFeature + return ret + } + + return o.ACTORS_PUBLIC_DEVELOPER +} + +// GetACTORS_PUBLIC_DEVELOPEROk returns a tuple with the ACTORS_PUBLIC_DEVELOPER field value +// and a boolean to check if the value has been set. +func (o *EffectivePlatformFeatures) GetACTORS_PUBLIC_DEVELOPEROk() (*EffectivePlatformFeature, bool) { + if o == nil { + return nil, false + } + return &o.ACTORS_PUBLIC_DEVELOPER, true +} + +// SetACTORS_PUBLIC_DEVELOPER sets field value +func (o *EffectivePlatformFeatures) SetACTORS_PUBLIC_DEVELOPER(v EffectivePlatformFeature) { + o.ACTORS_PUBLIC_DEVELOPER = v +} + +func (o EffectivePlatformFeatures) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o EffectivePlatformFeatures) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["ACTORS"] = o.ACTORS + toSerialize["STORAGE"] = o.STORAGE + toSerialize["SCHEDULER"] = o.SCHEDULER + toSerialize["PROXY"] = o.PROXY + toSerialize["PROXY_EXTERNAL_ACCESS"] = o.PROXY_EXTERNAL_ACCESS + toSerialize["PROXY_RESIDENTIAL"] = o.PROXY_RESIDENTIAL + toSerialize["PROXY_SERPS"] = o.PROXY_SERPS + toSerialize["WEBHOOKS"] = o.WEBHOOKS + toSerialize["ACTORS_PUBLIC_ALL"] = o.ACTORS_PUBLIC_ALL + toSerialize["ACTORS_PUBLIC_DEVELOPER"] = o.ACTORS_PUBLIC_DEVELOPER + return toSerialize, nil +} + +func (o *EffectivePlatformFeatures) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "ACTORS", + "STORAGE", + "SCHEDULER", + "PROXY", + "PROXY_EXTERNAL_ACCESS", + "PROXY_RESIDENTIAL", + "PROXY_SERPS", + "WEBHOOKS", + "ACTORS_PUBLIC_ALL", + "ACTORS_PUBLIC_DEVELOPER", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varEffectivePlatformFeatures := _EffectivePlatformFeatures{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varEffectivePlatformFeatures) + + if err != nil { + return err + } + + *o = EffectivePlatformFeatures(varEffectivePlatformFeatures) + + return err +} + +type NullableEffectivePlatformFeatures struct { + value *EffectivePlatformFeatures + isSet bool +} + +func (v NullableEffectivePlatformFeatures) Get() *EffectivePlatformFeatures { + return v.value +} + +func (v *NullableEffectivePlatformFeatures) Set(val *EffectivePlatformFeatures) { + v.value = val + v.isSet = true +} + +func (v NullableEffectivePlatformFeatures) IsSet() bool { + return v.isSet +} + +func (v *NullableEffectivePlatformFeatures) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableEffectivePlatformFeatures(val *EffectivePlatformFeatures) *NullableEffectivePlatformFeatures { + return &NullableEffectivePlatformFeatures{value: val, isSet: true} +} + +func (v NullableEffectivePlatformFeatures) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableEffectivePlatformFeatures) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_encode_and_sign_data.go b/model_encode_and_sign_data.go new file mode 100644 index 0000000..40e6e29 --- /dev/null +++ b/model_encode_and_sign_data.go @@ -0,0 +1,158 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" + "bytes" + "fmt" +) + +// checks if the EncodeAndSignData type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &EncodeAndSignData{} + +// EncodeAndSignData struct for EncodeAndSignData +type EncodeAndSignData struct { + Encoded string `json:"encoded"` +} + +type _EncodeAndSignData EncodeAndSignData + +// NewEncodeAndSignData instantiates a new EncodeAndSignData object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewEncodeAndSignData(encoded string) *EncodeAndSignData { + this := EncodeAndSignData{} + this.Encoded = encoded + return &this +} + +// NewEncodeAndSignDataWithDefaults instantiates a new EncodeAndSignData object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewEncodeAndSignDataWithDefaults() *EncodeAndSignData { + this := EncodeAndSignData{} + return &this +} + +// GetEncoded returns the Encoded field value +func (o *EncodeAndSignData) GetEncoded() string { + if o == nil { + var ret string + return ret + } + + return o.Encoded +} + +// GetEncodedOk returns a tuple with the Encoded field value +// and a boolean to check if the value has been set. +func (o *EncodeAndSignData) GetEncodedOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Encoded, true +} + +// SetEncoded sets field value +func (o *EncodeAndSignData) SetEncoded(v string) { + o.Encoded = v +} + +func (o EncodeAndSignData) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o EncodeAndSignData) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["encoded"] = o.Encoded + return toSerialize, nil +} + +func (o *EncodeAndSignData) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "encoded", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varEncodeAndSignData := _EncodeAndSignData{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varEncodeAndSignData) + + if err != nil { + return err + } + + *o = EncodeAndSignData(varEncodeAndSignData) + + return err +} + +type NullableEncodeAndSignData struct { + value *EncodeAndSignData + isSet bool +} + +func (v NullableEncodeAndSignData) Get() *EncodeAndSignData { + return v.value +} + +func (v *NullableEncodeAndSignData) Set(val *EncodeAndSignData) { + v.value = val + v.isSet = true +} + +func (v NullableEncodeAndSignData) IsSet() bool { + return v.isSet +} + +func (v *NullableEncodeAndSignData) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableEncodeAndSignData(val *EncodeAndSignData) *NullableEncodeAndSignData { + return &NullableEncodeAndSignData{value: val, isSet: true} +} + +func (v NullableEncodeAndSignData) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableEncodeAndSignData) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_encode_and_sign_response.go b/model_encode_and_sign_response.go new file mode 100644 index 0000000..40b4dd9 --- /dev/null +++ b/model_encode_and_sign_response.go @@ -0,0 +1,158 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" + "bytes" + "fmt" +) + +// checks if the EncodeAndSignResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &EncodeAndSignResponse{} + +// EncodeAndSignResponse struct for EncodeAndSignResponse +type EncodeAndSignResponse struct { + Data EncodeAndSignData `json:"data"` +} + +type _EncodeAndSignResponse EncodeAndSignResponse + +// NewEncodeAndSignResponse instantiates a new EncodeAndSignResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewEncodeAndSignResponse(data EncodeAndSignData) *EncodeAndSignResponse { + this := EncodeAndSignResponse{} + this.Data = data + return &this +} + +// NewEncodeAndSignResponseWithDefaults instantiates a new EncodeAndSignResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewEncodeAndSignResponseWithDefaults() *EncodeAndSignResponse { + this := EncodeAndSignResponse{} + return &this +} + +// GetData returns the Data field value +func (o *EncodeAndSignResponse) GetData() EncodeAndSignData { + if o == nil { + var ret EncodeAndSignData + return ret + } + + return o.Data +} + +// GetDataOk returns a tuple with the Data field value +// and a boolean to check if the value has been set. +func (o *EncodeAndSignResponse) GetDataOk() (*EncodeAndSignData, bool) { + if o == nil { + return nil, false + } + return &o.Data, true +} + +// SetData sets field value +func (o *EncodeAndSignResponse) SetData(v EncodeAndSignData) { + o.Data = v +} + +func (o EncodeAndSignResponse) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o EncodeAndSignResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["data"] = o.Data + return toSerialize, nil +} + +func (o *EncodeAndSignResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "data", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varEncodeAndSignResponse := _EncodeAndSignResponse{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varEncodeAndSignResponse) + + if err != nil { + return err + } + + *o = EncodeAndSignResponse(varEncodeAndSignResponse) + + return err +} + +type NullableEncodeAndSignResponse struct { + value *EncodeAndSignResponse + isSet bool +} + +func (v NullableEncodeAndSignResponse) Get() *EncodeAndSignResponse { + return v.value +} + +func (v *NullableEncodeAndSignResponse) Set(val *EncodeAndSignResponse) { + v.value = val + v.isSet = true +} + +func (v NullableEncodeAndSignResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableEncodeAndSignResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableEncodeAndSignResponse(val *EncodeAndSignResponse) *NullableEncodeAndSignResponse { + return &NullableEncodeAndSignResponse{value: val, isSet: true} +} + +func (v NullableEncodeAndSignResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableEncodeAndSignResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_env_var.go b/model_env_var.go new file mode 100644 index 0000000..74c3bbc --- /dev/null +++ b/model_env_var.go @@ -0,0 +1,241 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" + "bytes" + "fmt" +) + +// checks if the EnvVar type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &EnvVar{} + +// EnvVar struct for EnvVar +type EnvVar struct { + Name string `json:"name"` + // The environment variable value. This field is absent in responses when `isSecret` is `true`, as secret values are never returned by the API. + Value *string `json:"value,omitempty"` + IsSecret NullableBool `json:"isSecret,omitempty"` +} + +type _EnvVar EnvVar + +// NewEnvVar instantiates a new EnvVar object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewEnvVar(name string) *EnvVar { + this := EnvVar{} + this.Name = name + return &this +} + +// NewEnvVarWithDefaults instantiates a new EnvVar object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewEnvVarWithDefaults() *EnvVar { + this := EnvVar{} + return &this +} + +// GetName returns the Name field value +func (o *EnvVar) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *EnvVar) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *EnvVar) SetName(v string) { + o.Name = v +} + +// GetValue returns the Value field value if set, zero value otherwise. +func (o *EnvVar) GetValue() string { + if o == nil || IsNil(o.Value) { + var ret string + return ret + } + return *o.Value +} + +// GetValueOk returns a tuple with the Value field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EnvVar) GetValueOk() (*string, bool) { + if o == nil || IsNil(o.Value) { + return nil, false + } + return o.Value, true +} + +// HasValue returns a boolean if a field has been set. +func (o *EnvVar) HasValue() bool { + if o != nil && !IsNil(o.Value) { + return true + } + + return false +} + +// SetValue gets a reference to the given string and assigns it to the Value field. +func (o *EnvVar) SetValue(v string) { + o.Value = &v +} + +// GetIsSecret returns the IsSecret field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *EnvVar) GetIsSecret() bool { + if o == nil || IsNil(o.IsSecret.Get()) { + var ret bool + return ret + } + return *o.IsSecret.Get() +} + +// GetIsSecretOk returns a tuple with the IsSecret field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *EnvVar) GetIsSecretOk() (*bool, bool) { + if o == nil { + return nil, false + } + return o.IsSecret.Get(), o.IsSecret.IsSet() +} + +// HasIsSecret returns a boolean if a field has been set. +func (o *EnvVar) HasIsSecret() bool { + if o != nil && o.IsSecret.IsSet() { + return true + } + + return false +} + +// SetIsSecret gets a reference to the given NullableBool and assigns it to the IsSecret field. +func (o *EnvVar) SetIsSecret(v bool) { + o.IsSecret.Set(&v) +} +// SetIsSecretNil sets the value for IsSecret to be an explicit nil +func (o *EnvVar) SetIsSecretNil() { + o.IsSecret.Set(nil) +} + +// UnsetIsSecret ensures that no value is present for IsSecret, not even an explicit nil +func (o *EnvVar) UnsetIsSecret() { + o.IsSecret.Unset() +} + +func (o EnvVar) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o EnvVar) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + if !IsNil(o.Value) { + toSerialize["value"] = o.Value + } + if o.IsSecret.IsSet() { + toSerialize["isSecret"] = o.IsSecret.Get() + } + return toSerialize, nil +} + +func (o *EnvVar) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varEnvVar := _EnvVar{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varEnvVar) + + if err != nil { + return err + } + + *o = EnvVar(varEnvVar) + + return err +} + +type NullableEnvVar struct { + value *EnvVar + isSet bool +} + +func (v NullableEnvVar) Get() *EnvVar { + return v.value +} + +func (v *NullableEnvVar) Set(val *EnvVar) { + v.value = val + v.isSet = true +} + +func (v NullableEnvVar) IsSet() bool { + return v.isSet +} + +func (v *NullableEnvVar) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableEnvVar(val *EnvVar) *NullableEnvVar { + return &NullableEnvVar{value: val, isSet: true} +} + +func (v NullableEnvVar) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableEnvVar) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_env_var_request.go b/model_env_var_request.go new file mode 100644 index 0000000..224ef5b --- /dev/null +++ b/model_env_var_request.go @@ -0,0 +1,231 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" + "bytes" + "fmt" +) + +// checks if the EnvVarRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &EnvVarRequest{} + +// EnvVarRequest struct for EnvVarRequest +type EnvVarRequest struct { + Name string `json:"name"` + // The environment variable value. This field is absent in responses when `isSecret` is `true`, as secret values are never returned by the API. + Value *string `json:"value,omitempty"` + IsSecret *bool `json:"isSecret,omitempty"` +} + +type _EnvVarRequest EnvVarRequest + +// NewEnvVarRequest instantiates a new EnvVarRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewEnvVarRequest(name string) *EnvVarRequest { + this := EnvVarRequest{} + this.Name = name + return &this +} + +// NewEnvVarRequestWithDefaults instantiates a new EnvVarRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewEnvVarRequestWithDefaults() *EnvVarRequest { + this := EnvVarRequest{} + return &this +} + +// GetName returns the Name field value +func (o *EnvVarRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *EnvVarRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *EnvVarRequest) SetName(v string) { + o.Name = v +} + +// GetValue returns the Value field value if set, zero value otherwise. +func (o *EnvVarRequest) GetValue() string { + if o == nil || IsNil(o.Value) { + var ret string + return ret + } + return *o.Value +} + +// GetValueOk returns a tuple with the Value field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EnvVarRequest) GetValueOk() (*string, bool) { + if o == nil || IsNil(o.Value) { + return nil, false + } + return o.Value, true +} + +// HasValue returns a boolean if a field has been set. +func (o *EnvVarRequest) HasValue() bool { + if o != nil && !IsNil(o.Value) { + return true + } + + return false +} + +// SetValue gets a reference to the given string and assigns it to the Value field. +func (o *EnvVarRequest) SetValue(v string) { + o.Value = &v +} + +// GetIsSecret returns the IsSecret field value if set, zero value otherwise. +func (o *EnvVarRequest) GetIsSecret() bool { + if o == nil || IsNil(o.IsSecret) { + var ret bool + return ret + } + return *o.IsSecret +} + +// GetIsSecretOk returns a tuple with the IsSecret field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EnvVarRequest) GetIsSecretOk() (*bool, bool) { + if o == nil || IsNil(o.IsSecret) { + return nil, false + } + return o.IsSecret, true +} + +// HasIsSecret returns a boolean if a field has been set. +func (o *EnvVarRequest) HasIsSecret() bool { + if o != nil && !IsNil(o.IsSecret) { + return true + } + + return false +} + +// SetIsSecret gets a reference to the given bool and assigns it to the IsSecret field. +func (o *EnvVarRequest) SetIsSecret(v bool) { + o.IsSecret = &v +} + +func (o EnvVarRequest) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o EnvVarRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + if !IsNil(o.Value) { + toSerialize["value"] = o.Value + } + if !IsNil(o.IsSecret) { + toSerialize["isSecret"] = o.IsSecret + } + return toSerialize, nil +} + +func (o *EnvVarRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varEnvVarRequest := _EnvVarRequest{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varEnvVarRequest) + + if err != nil { + return err + } + + *o = EnvVarRequest(varEnvVarRequest) + + return err +} + +type NullableEnvVarRequest struct { + value *EnvVarRequest + isSet bool +} + +func (v NullableEnvVarRequest) Get() *EnvVarRequest { + return v.value +} + +func (v *NullableEnvVarRequest) Set(val *EnvVarRequest) { + v.value = val + v.isSet = true +} + +func (v NullableEnvVarRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableEnvVarRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableEnvVarRequest(val *EnvVarRequest) *NullableEnvVarRequest { + return &NullableEnvVarRequest{value: val, isSet: true} +} + +func (v NullableEnvVarRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableEnvVarRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_env_var_response.go b/model_env_var_response.go new file mode 100644 index 0000000..7415fe8 --- /dev/null +++ b/model_env_var_response.go @@ -0,0 +1,158 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" + "bytes" + "fmt" +) + +// checks if the EnvVarResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &EnvVarResponse{} + +// EnvVarResponse struct for EnvVarResponse +type EnvVarResponse struct { + Data EnvVar `json:"data"` +} + +type _EnvVarResponse EnvVarResponse + +// NewEnvVarResponse instantiates a new EnvVarResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewEnvVarResponse(data EnvVar) *EnvVarResponse { + this := EnvVarResponse{} + this.Data = data + return &this +} + +// NewEnvVarResponseWithDefaults instantiates a new EnvVarResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewEnvVarResponseWithDefaults() *EnvVarResponse { + this := EnvVarResponse{} + return &this +} + +// GetData returns the Data field value +func (o *EnvVarResponse) GetData() EnvVar { + if o == nil { + var ret EnvVar + return ret + } + + return o.Data +} + +// GetDataOk returns a tuple with the Data field value +// and a boolean to check if the value has been set. +func (o *EnvVarResponse) GetDataOk() (*EnvVar, bool) { + if o == nil { + return nil, false + } + return &o.Data, true +} + +// SetData sets field value +func (o *EnvVarResponse) SetData(v EnvVar) { + o.Data = v +} + +func (o EnvVarResponse) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o EnvVarResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["data"] = o.Data + return toSerialize, nil +} + +func (o *EnvVarResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "data", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varEnvVarResponse := _EnvVarResponse{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varEnvVarResponse) + + if err != nil { + return err + } + + *o = EnvVarResponse(varEnvVarResponse) + + return err +} + +type NullableEnvVarResponse struct { + value *EnvVarResponse + isSet bool +} + +func (v NullableEnvVarResponse) Get() *EnvVarResponse { + return v.value +} + +func (v *NullableEnvVarResponse) Set(val *EnvVarResponse) { + v.value = val + v.isSet = true +} + +func (v NullableEnvVarResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableEnvVarResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableEnvVarResponse(val *EnvVarResponse) *NullableEnvVarResponse { + return &NullableEnvVarResponse{value: val, isSet: true} +} + +func (v NullableEnvVarResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableEnvVarResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_error_detail.go b/model_error_detail.go new file mode 100644 index 0000000..ba9be6f --- /dev/null +++ b/model_error_detail.go @@ -0,0 +1,163 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" +) + +// checks if the ErrorDetail type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ErrorDetail{} + +// ErrorDetail struct for ErrorDetail +type ErrorDetail struct { + Type *ErrorType `json:"type,omitempty"` + // Human-readable error message describing what went wrong. + Message *string `json:"message,omitempty"` +} + +// NewErrorDetail instantiates a new ErrorDetail object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewErrorDetail() *ErrorDetail { + this := ErrorDetail{} + return &this +} + +// NewErrorDetailWithDefaults instantiates a new ErrorDetail object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewErrorDetailWithDefaults() *ErrorDetail { + this := ErrorDetail{} + return &this +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *ErrorDetail) GetType() ErrorType { + if o == nil || IsNil(o.Type) { + var ret ErrorType + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ErrorDetail) GetTypeOk() (*ErrorType, bool) { + if o == nil || IsNil(o.Type) { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *ErrorDetail) HasType() bool { + if o != nil && !IsNil(o.Type) { + return true + } + + return false +} + +// SetType gets a reference to the given ErrorType and assigns it to the Type field. +func (o *ErrorDetail) SetType(v ErrorType) { + o.Type = &v +} + +// GetMessage returns the Message field value if set, zero value otherwise. +func (o *ErrorDetail) GetMessage() string { + if o == nil || IsNil(o.Message) { + var ret string + return ret + } + return *o.Message +} + +// GetMessageOk returns a tuple with the Message field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ErrorDetail) GetMessageOk() (*string, bool) { + if o == nil || IsNil(o.Message) { + return nil, false + } + return o.Message, true +} + +// HasMessage returns a boolean if a field has been set. +func (o *ErrorDetail) HasMessage() bool { + if o != nil && !IsNil(o.Message) { + return true + } + + return false +} + +// SetMessage gets a reference to the given string and assigns it to the Message field. +func (o *ErrorDetail) SetMessage(v string) { + o.Message = &v +} + +func (o ErrorDetail) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ErrorDetail) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Type) { + toSerialize["type"] = o.Type + } + if !IsNil(o.Message) { + toSerialize["message"] = o.Message + } + return toSerialize, nil +} + +type NullableErrorDetail struct { + value *ErrorDetail + isSet bool +} + +func (v NullableErrorDetail) Get() *ErrorDetail { + return v.value +} + +func (v *NullableErrorDetail) Set(val *ErrorDetail) { + v.value = val + v.isSet = true +} + +func (v NullableErrorDetail) IsSet() bool { + return v.isSet +} + +func (v *NullableErrorDetail) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableErrorDetail(val *ErrorDetail) *NullableErrorDetail { + return &NullableErrorDetail{value: val, isSet: true} +} + +func (v NullableErrorDetail) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableErrorDetail) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_error_response.go b/model_error_response.go new file mode 100644 index 0000000..ed43df4 --- /dev/null +++ b/model_error_response.go @@ -0,0 +1,158 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" + "bytes" + "fmt" +) + +// checks if the ErrorResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ErrorResponse{} + +// ErrorResponse struct for ErrorResponse +type ErrorResponse struct { + Error ErrorDetail `json:"error"` +} + +type _ErrorResponse ErrorResponse + +// NewErrorResponse instantiates a new ErrorResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewErrorResponse(error_ ErrorDetail) *ErrorResponse { + this := ErrorResponse{} + this.Error = error_ + return &this +} + +// NewErrorResponseWithDefaults instantiates a new ErrorResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewErrorResponseWithDefaults() *ErrorResponse { + this := ErrorResponse{} + return &this +} + +// GetError returns the Error field value +func (o *ErrorResponse) GetError() ErrorDetail { + if o == nil { + var ret ErrorDetail + return ret + } + + return o.Error +} + +// GetErrorOk returns a tuple with the Error field value +// and a boolean to check if the value has been set. +func (o *ErrorResponse) GetErrorOk() (*ErrorDetail, bool) { + if o == nil { + return nil, false + } + return &o.Error, true +} + +// SetError sets field value +func (o *ErrorResponse) SetError(v ErrorDetail) { + o.Error = v +} + +func (o ErrorResponse) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ErrorResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["error"] = o.Error + return toSerialize, nil +} + +func (o *ErrorResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "error", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varErrorResponse := _ErrorResponse{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varErrorResponse) + + if err != nil { + return err + } + + *o = ErrorResponse(varErrorResponse) + + return err +} + +type NullableErrorResponse struct { + value *ErrorResponse + isSet bool +} + +func (v NullableErrorResponse) Get() *ErrorResponse { + return v.value +} + +func (v *NullableErrorResponse) Set(val *ErrorResponse) { + v.value = val + v.isSet = true +} + +func (v NullableErrorResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableErrorResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableErrorResponse(val *ErrorResponse) *NullableErrorResponse { + return &NullableErrorResponse{value: val, isSet: true} +} + +func (v NullableErrorResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableErrorResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_error_type.go b/model_error_type.go new file mode 100644 index 0000000..bf133e7 --- /dev/null +++ b/model_error_type.go @@ -0,0 +1,889 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" + "fmt" +) + +// ErrorType Machine-processable error type identifier. +type ErrorType string + +// List of ErrorType +const ( + _3D_SECURE_AUTH_FAILED ErrorType = "3d-secure-auth-failed" + ACCESS_RIGHT_ALREADY_EXISTS ErrorType = "access-right-already-exists" + ACTION_NOT_FOUND ErrorType = "action-not-found" + ACTOR_ALREADY_RENTED ErrorType = "actor-already-rented" + ACTOR_CAN_NOT_BE_RENTED ErrorType = "actor-can-not-be-rented" + ACTOR_DISABLED ErrorType = "actor-disabled" + ACTOR_IS_NOT_RENTED ErrorType = "actor-is-not-rented" + ACTOR_MEMORY_LIMIT_EXCEEDED ErrorType = "actor-memory-limit-exceeded" + ACTOR_NAME_EXISTS_NEW_OWNER ErrorType = "actor-name-exists-new-owner" + ACTOR_NAME_NOT_UNIQUE ErrorType = "actor-name-not-unique" + ACTOR_NOT_FOUND ErrorType = "actor-not-found" + ACTOR_NOT_GITHUB_ACTOR ErrorType = "actor-not-github-actor" + ACTOR_NOT_PUBLIC ErrorType = "actor-not-public" + ACTOR_PERMISSION_LEVEL_NOT_SUPPORTED_FOR_AGENTIC_PAYMENTS ErrorType = "actor-permission-level-not-supported-for-agentic-payments" + ACTOR_REVIEW_ALREADY_EXISTS ErrorType = "actor-review-already-exists" + ACTOR_RUN_FAILED ErrorType = "actor-run-failed" + ACTOR_STANDBY_NOT_SUPPORTED_FOR_AGENTIC_PAYMENTS ErrorType = "actor-standby-not-supported-for-agentic-payments" + ACTOR_TASK_NAME_NOT_UNIQUE ErrorType = "actor-task-name-not-unique" + AGENTIC_PAYMENT_INFO_RETRIEVAL_ERROR ErrorType = "agentic-payment-info-retrieval-error" + AGENTIC_PAYMENT_INFORMATION_MISSING ErrorType = "agentic-payment-information-missing" + AGENTIC_PAYMENT_INSUFFICIENT_AMOUNT ErrorType = "agentic-payment-insufficient-amount" + AGENTIC_PAYMENT_PROVIDER_INTERNAL_ERROR ErrorType = "agentic-payment-provider-internal-error" + AGENTIC_PAYMENT_PROVIDER_UNAUTHORIZED ErrorType = "agentic-payment-provider-unauthorized" + AIRTABLE_WEBHOOK_DEPRECATED ErrorType = "airtable-webhook-deprecated" + ALREADY_SUBSCRIBED_TO_PAID_ACTOR ErrorType = "already-subscribed-to-paid-actor" + APIFY_PLAN_REQUIRED_TO_USE_PAID_ACTOR ErrorType = "apify-plan-required-to-use-paid-actor" + APIFY_SIGNUP_NOT_ALLOWED ErrorType = "apify-signup-not-allowed" + AUTH_METHOD_NOT_SUPPORTED ErrorType = "auth-method-not-supported" + AUTHORIZATION_SERVER_NOT_FOUND ErrorType = "authorization-server-not-found" + AUTO_ISSUE_DATE_INVALID ErrorType = "auto-issue-date-invalid" + BACKGROUND_CHECK_REQUIRED ErrorType = "background-check-required" + BILLING_SYSTEM_ERROR ErrorType = "billing-system-error" + BLACK_FRIDAY_PLAN_EXPIRED ErrorType = "black-friday-plan-expired" + BRAINTREE_ERROR ErrorType = "braintree-error" + BRAINTREE_NOT_LINKED ErrorType = "braintree-not-linked" + BRAINTREE_OPERATION_TIMED_OUT ErrorType = "braintree-operation-timed-out" + BRAINTREE_UNSUPPORTED_CURRENCY ErrorType = "braintree-unsupported-currency" + BUILD_NOT_FOUND ErrorType = "build-not-found" + BUILD_OUTDATED ErrorType = "build-outdated" + CANNOT_ADD_APIFY_EVENTS_TO_PPE_ACTOR ErrorType = "cannot-add-apify-events-to-ppe-actor" + CANNOT_ADD_MULTIPLE_PRICING_INFOS ErrorType = "cannot-add-multiple-pricing-infos" + CANNOT_ADD_PRICING_INFO_THAT_ALTERS_PAST ErrorType = "cannot-add-pricing-info-that-alters-past" + CANNOT_ADD_SECOND_FUTURE_PRICING_INFO ErrorType = "cannot-add-second-future-pricing-info" + CANNOT_BUILD_ACTOR_FROM_WEBHOOK ErrorType = "cannot-build-actor-from-webhook" + CANNOT_CHANGE_BILLING_INTERVAL ErrorType = "cannot-change-billing-interval" + CANNOT_CHANGE_OWNER ErrorType = "cannot-change-owner" + CANNOT_CHARGE_APIFY_EVENT ErrorType = "cannot-charge-apify-event" + CANNOT_CHARGE_NON_PAY_PER_EVENT_ACTOR ErrorType = "cannot-charge-non-pay-per-event-actor" + CANNOT_COMMENT_AS_OTHER_USER ErrorType = "cannot-comment-as-other-user" + CANNOT_COPY_ACTOR_TASK ErrorType = "cannot-copy-actor-task" + CANNOT_CREATE_PAYOUT ErrorType = "cannot-create-payout" + CANNOT_CREATE_PUBLIC_ACTOR ErrorType = "cannot-create-public-actor" + CANNOT_CREATE_TAX_TRANSACTION ErrorType = "cannot-create-tax-transaction" + CANNOT_DELETE_CRITICAL_ACTOR ErrorType = "cannot-delete-critical-actor" + CANNOT_DELETE_INVOICE ErrorType = "cannot-delete-invoice" + CANNOT_DELETE_PAID_ACTOR ErrorType = "cannot-delete-paid-actor" + CANNOT_DISABLE_ONE_TIME_EVENT_FOR_APIFY_START_EVENT ErrorType = "cannot-disable-one-time-event-for-apify-start-event" + CANNOT_DISABLE_ORGANIZATION_WITH_ENABLED_MEMBERS ErrorType = "cannot-disable-organization-with-enabled-members" + CANNOT_DISABLE_USER_WITH_SUBSCRIPTION ErrorType = "cannot-disable-user-with-subscription" + CANNOT_LINK_OAUTH_TO_UNVERIFIED_EMAIL ErrorType = "cannot-link-oauth-to-unverified-email" + CANNOT_METAMORPH_TO_PAY_PER_RESULT_ACTOR ErrorType = "cannot-metamorph-to-pay-per-result-actor" + CANNOT_MODIFY_ACTOR_PRICING_TOO_FREQUENTLY ErrorType = "cannot-modify-actor-pricing-too-frequently" + CANNOT_MODIFY_ACTOR_PRICING_WITH_IMMEDIATE_EFFECT ErrorType = "cannot-modify-actor-pricing-with-immediate-effect" + CANNOT_OVERRIDE_PAID_ACTOR_TRIAL ErrorType = "cannot-override-paid-actor-trial" + CANNOT_PERMANENTLY_DELETE_SUBSCRIPTION ErrorType = "cannot-permanently-delete-subscription" + CANNOT_PUBLISH_ACTOR ErrorType = "cannot-publish-actor" + CANNOT_REDUCE_LAST_FULL_TOKEN ErrorType = "cannot-reduce-last-full-token" + CANNOT_REIMBURSE_MORE_THAN_ORIGINAL_CHARGE ErrorType = "cannot-reimburse-more-than-original-charge" + CANNOT_REIMBURSE_NON_RENTAL_CHARGE ErrorType = "cannot-reimburse-non-rental-charge" + CANNOT_REMOVE_OWN_ACTOR_FROM_RECENTLY_USED ErrorType = "cannot-remove-own-actor-from-recently-used" + CANNOT_REMOVE_PAYMENT_METHOD ErrorType = "cannot-remove-payment-method" + CANNOT_REMOVE_PRICING_INFO ErrorType = "cannot-remove-pricing-info" + CANNOT_REMOVE_RUNNING_RUN ErrorType = "cannot-remove-running-run" + CANNOT_REMOVE_USER_WITH_PUBLIC_ACTORS ErrorType = "cannot-remove-user-with-public-actors" + CANNOT_REMOVE_USER_WITH_SUBSCRIPTION ErrorType = "cannot-remove-user-with-subscription" + CANNOT_REMOVE_USER_WITH_UNPAID_INVOICE ErrorType = "cannot-remove-user-with-unpaid-invoice" + CANNOT_RENAME_ENV_VAR ErrorType = "cannot-rename-env-var" + CANNOT_RENT_PAID_ACTOR ErrorType = "cannot-rent-paid-actor" + CANNOT_REVIEW_OWN_ACTOR ErrorType = "cannot-review-own-actor" + CANNOT_SET_ACCESS_RIGHTS_FOR_OWNER ErrorType = "cannot-set-access-rights-for-owner" + CANNOT_SET_IS_STATUS_MESSAGE_TERMINAL ErrorType = "cannot-set-is-status-message-terminal" + CANNOT_UNPUBLISH_CRITICAL_ACTOR ErrorType = "cannot-unpublish-critical-actor" + CANNOT_UNPUBLISH_PAID_ACTOR ErrorType = "cannot-unpublish-paid-actor" + CANNOT_UNPUBLISH_PROFILE ErrorType = "cannot-unpublish-profile" + CANNOT_UPDATE_INVOICE_FIELD ErrorType = "cannot-update-invoice-field" + CONCURRENT_RUNS_LIMIT_EXCEEDED ErrorType = "concurrent-runs-limit-exceeded" + CONCURRENT_UPDATE_DETECTED ErrorType = "concurrent-update-detected" + CONFERENCE_TOKEN_NOT_FOUND ErrorType = "conference-token-not-found" + CONTENT_ENCODING_FORBIDDEN_FOR_HTML ErrorType = "content-encoding-forbidden-for-html" + COUPON_ALREADY_REDEEMED ErrorType = "coupon-already-redeemed" + COUPON_EXPIRED ErrorType = "coupon-expired" + COUPON_FOR_NEW_CUSTOMERS ErrorType = "coupon-for-new-customers" + COUPON_FOR_SUBSCRIBED_USERS ErrorType = "coupon-for-subscribed-users" + COUPON_LIMITS_ARE_IN_CONFLICT_WITH_CURRENT_LIMITS ErrorType = "coupon-limits-are-in-conflict-with-current-limits" + COUPON_MAX_NUMBER_OF_REDEMPTIONS_REACHED ErrorType = "coupon-max-number-of-redemptions-reached" + COUPON_NOT_FOUND ErrorType = "coupon-not-found" + COUPON_NOT_UNIQUE ErrorType = "coupon-not-unique" + COUPONS_DISABLED ErrorType = "coupons-disabled" + CREATE_GITHUB_ISSUE_NOT_ALLOWED ErrorType = "create-github-issue-not-allowed" + CREATOR_PLAN_NOT_AVAILABLE ErrorType = "creator-plan-not-available" + CRON_EXPRESSION_INVALID ErrorType = "cron-expression-invalid" + DAILY_AI_TOKEN_LIMIT_EXCEEDED ErrorType = "daily-ai-token-limit-exceeded" + DAILY_PUBLICATION_LIMIT_EXCEEDED ErrorType = "daily-publication-limit-exceeded" + DATASET_DOES_NOT_HAVE_FIELDS_SCHEMA ErrorType = "dataset-does-not-have-fields-schema" + DATASET_DOES_NOT_HAVE_SCHEMA ErrorType = "dataset-does-not-have-schema" + DATASET_LOCKED ErrorType = "dataset-locked" + DATASET_SCHEMA_INVALID ErrorType = "dataset-schema-invalid" + DCR_NOT_SUPPORTED ErrorType = "dcr-not-supported" + DEFAULT_DATASET_NOT_FOUND ErrorType = "default-dataset-not-found" + DELETING_DEFAULT_BUILD ErrorType = "deleting-default-build" + DELETING_UNFINISHED_BUILD ErrorType = "deleting-unfinished-build" + EMAIL_ALREADY_TAKEN ErrorType = "email-already-taken" + EMAIL_ALREADY_TAKEN_REMOVED_USER ErrorType = "email-already-taken-removed-user" + EMAIL_DOMAIN_NOT_ALLOWED_FOR_COUPON ErrorType = "email-domain-not-allowed-for-coupon" + EMAIL_INVALID ErrorType = "email-invalid" + EMAIL_NOT_ALLOWED ErrorType = "email-not-allowed" + EMAIL_NOT_VALID ErrorType = "email-not-valid" + EMAIL_UPDATE_TOO_SOON ErrorType = "email-update-too-soon" + ELEVATED_PERMISSIONS_NEEDED ErrorType = "elevated-permissions-needed" + ENV_VAR_ALREADY_EXISTS ErrorType = "env-var-already-exists" + EXCHANGE_RATE_FETCH_FAILED ErrorType = "exchange-rate-fetch-failed" + EXPIRED_CONFERENCE_TOKEN ErrorType = "expired-conference-token" + FAILED_TO_CHARGE_USER ErrorType = "failed-to-charge-user" + FINAL_INVOICE_NEGATIVE ErrorType = "final-invoice-negative" + FULL_PERMISSION_ACTOR_NOT_APPROVED ErrorType = "full-permission-actor-not-approved" + GITHUB_BRANCH_EMPTY ErrorType = "github-branch-empty" + GITHUB_ISSUE_ALREADY_EXISTS ErrorType = "github-issue-already-exists" + GITHUB_PUBLIC_KEY_NOT_FOUND ErrorType = "github-public-key-not-found" + GITHUB_REPOSITORY_NOT_FOUND ErrorType = "github-repository-not-found" + GITHUB_SIGNATURE_DOES_NOT_MATCH_PAYLOAD ErrorType = "github-signature-does-not-match-payload" + GITHUB_USER_NOT_AUTHORIZED_FOR_ISSUES ErrorType = "github-user-not-authorized-for-issues" + GMAIL_NOT_ALLOWED ErrorType = "gmail-not-allowed" + ID_DOES_NOT_MATCH ErrorType = "id-does-not-match" + INCOMPATIBLE_BILLING_INTERVAL ErrorType = "incompatible-billing-interval" + INCOMPLETE_PAYOUT_BILLING_INFO ErrorType = "incomplete-payout-billing-info" + INCONSISTENT_CURRENCIES ErrorType = "inconsistent-currencies" + INCORRECT_PRICING_MODIFIER_PREFIX ErrorType = "incorrect-pricing-modifier-prefix" + INPUT_JSON_INVALID_CHARACTERS ErrorType = "input-json-invalid-characters" + INPUT_JSON_NOT_OBJECT ErrorType = "input-json-not-object" + INPUT_JSON_TOO_LONG ErrorType = "input-json-too-long" + INPUT_UPDATE_COLLISION ErrorType = "input-update-collision" + INSUFFICIENT_PERMISSIONS ErrorType = "insufficient-permissions" + INSUFFICIENT_PERMISSIONS_TO_CHANGE_FIELD ErrorType = "insufficient-permissions-to-change-field" + INSUFFICIENT_SECURITY_MEASURES ErrorType = "insufficient-security-measures" + INSUFFICIENT_TAX_COUNTRY_EVIDENCE ErrorType = "insufficient-tax-country-evidence" + INTEGRATION_AUTH_ERROR ErrorType = "integration-auth-error" + INTERNAL_SERVER_ERROR ErrorType = "internal-server-error" + INVALID_BILLING_INFO ErrorType = "invalid-billing-info" + INVALID_BILLING_PERIOD_FOR_PAYOUT ErrorType = "invalid-billing-period-for-payout" + INVALID_BUILD ErrorType = "invalid-build" + INVALID_CLIENT_KEY ErrorType = "invalid-client-key" + INVALID_COLLECTION ErrorType = "invalid-collection" + INVALID_CONFERENCE_LOGIN_PASSWORD ErrorType = "invalid-conference-login-password" + INVALID_CONTENT_TYPE_HEADER ErrorType = "invalid-content-type-header" + INVALID_CREDENTIALS ErrorType = "invalid-credentials" + INVALID_GIT_AUTH_TOKEN ErrorType = "invalid-git-auth-token" + INVALID_GITHUB_ISSUE_URL ErrorType = "invalid-github-issue-url" + INVALID_HEADER ErrorType = "invalid-header" + INVALID_ID ErrorType = "invalid-id" + INVALID_IDEMPOTENCY_KEY ErrorType = "invalid-idempotency-key" + INVALID_INPUT ErrorType = "invalid-input" + INVALID_INPUT_SCHEMA ErrorType = "invalid-input-schema" + INVALID_INVOICE ErrorType = "invalid-invoice" + INVALID_INVOICE_TYPE ErrorType = "invalid-invoice-type" + INVALID_ISSUE_DATE ErrorType = "invalid-issue-date" + INVALID_LABEL_PARAMS ErrorType = "invalid-label-params" + INVALID_MAIN_ACCOUNT_USER_ID ErrorType = "invalid-main-account-user-id" + INVALID_OAUTH_APP ErrorType = "invalid-oauth-app" + INVALID_OAUTH_SCOPE ErrorType = "invalid-oauth-scope" + INVALID_ONE_TIME_INVOICE ErrorType = "invalid-one-time-invoice" + INVALID_PARAMETER ErrorType = "invalid-parameter" + INVALID_PAYOUT_STATUS ErrorType = "invalid-payout-status" + INVALID_PICTURE_URL ErrorType = "invalid-picture-url" + INVALID_RECORD_KEY ErrorType = "invalid-record-key" + INVALID_REQUEST ErrorType = "invalid-request" + INVALID_RESOURCE_TYPE ErrorType = "invalid-resource-type" + INVALID_SIGNATURE ErrorType = "invalid-signature" + INVALID_SUBSCRIPTION_PLAN ErrorType = "invalid-subscription-plan" + INVALID_TAX_NUMBER ErrorType = "invalid-tax-number" + INVALID_TAX_NUMBER_FORMAT ErrorType = "invalid-tax-number-format" + INVALID_TOKEN ErrorType = "invalid-token" + INVALID_TOKEN_TYPE ErrorType = "invalid-token-type" + INVALID_TWO_FACTOR_CODE ErrorType = "invalid-two-factor-code" + INVALID_TWO_FACTOR_CODE_OR_RECOVERY_CODE ErrorType = "invalid-two-factor-code-or-recovery-code" + INVALID_TWO_FACTOR_RECOVERY_CODE ErrorType = "invalid-two-factor-recovery-code" + INVALID_USERNAME ErrorType = "invalid-username" + INVALID_VALUE ErrorType = "invalid-value" + INVITATION_INVALID_RESOURCE_TYPE ErrorType = "invitation-invalid-resource-type" + INVITATION_NO_LONGER_VALID ErrorType = "invitation-no-longer-valid" + INVOICE_CANCELED ErrorType = "invoice-canceled" + INVOICE_CANNOT_BE_REFUNDED_DUE_TO_TOO_HIGH_AMOUNT ErrorType = "invoice-cannot-be-refunded-due-to-too-high-amount" + INVOICE_INCOMPLETE ErrorType = "invoice-incomplete" + INVOICE_IS_DRAFT ErrorType = "invoice-is-draft" + INVOICE_LOCKED ErrorType = "invoice-locked" + INVOICE_MUST_BE_BUFFER ErrorType = "invoice-must-be-buffer" + INVOICE_NOT_CANCELED ErrorType = "invoice-not-canceled" + INVOICE_NOT_DRAFT ErrorType = "invoice-not-draft" + INVOICE_NOT_FOUND ErrorType = "invoice-not-found" + INVOICE_OUTDATED ErrorType = "invoice-outdated" + INVOICE_PAID_ALREADY ErrorType = "invoice-paid-already" + ISSUE_ALREADY_CONNECTED_TO_GITHUB ErrorType = "issue-already-connected-to-github" + ISSUE_NOT_FOUND ErrorType = "issue-not-found" + ISSUES_BAD_REQUEST ErrorType = "issues-bad-request" + ISSUER_NOT_REGISTERED ErrorType = "issuer-not-registered" + JOB_FINISHED ErrorType = "job-finished" + LABEL_ALREADY_LINKED ErrorType = "label-already-linked" + LAST_API_TOKEN ErrorType = "last-api-token" + LIMIT_REACHED ErrorType = "limit-reached" + MAX_ITEMS_MUST_BE_GREATER_THAN_ZERO ErrorType = "max-items-must-be-greater-than-zero" + MAX_METAMORPHS_EXCEEDED ErrorType = "max-metamorphs-exceeded" + MAX_TOTAL_CHARGE_USD_BELOW_MINIMUM ErrorType = "max-total-charge-usd-below-minimum" + MAX_TOTAL_CHARGE_USD_MUST_BE_GREATER_THAN_ZERO ErrorType = "max-total-charge-usd-must-be-greater-than-zero" + METHOD_NOT_ALLOWED ErrorType = "method-not-allowed" + MIGRATION_DISABLED ErrorType = "migration-disabled" + MISSING_ACTOR_RIGHTS ErrorType = "missing-actor-rights" + MISSING_API_TOKEN ErrorType = "missing-api-token" + MISSING_BILLING_INFO ErrorType = "missing-billing-info" + MISSING_LINE_ITEMS ErrorType = "missing-line-items" + MISSING_PAYMENT_DATE ErrorType = "missing-payment-date" + MISSING_PAYOUT_BILLING_INFO ErrorType = "missing-payout-billing-info" + MISSING_PROXY_PASSWORD ErrorType = "missing-proxy-password" + MISSING_REPORTING_FIELDS ErrorType = "missing-reporting-fields" + MISSING_RESOURCE_NAME ErrorType = "missing-resource-name" + MISSING_SETTINGS ErrorType = "missing-settings" + MISSING_USERNAME ErrorType = "missing-username" + MONTHLY_USAGE_LIMIT_TOO_LOW ErrorType = "monthly-usage-limit-too-low" + MORE_THAN_ONE_UPDATE_NOT_ALLOWED ErrorType = "more-than-one-update-not-allowed" + MULTIPLE_RECORDS_FOUND ErrorType = "multiple-records-found" + MUST_BE_ADMIN ErrorType = "must-be-admin" + NAME_NOT_UNIQUE ErrorType = "name-not-unique" + NEXT_RUNTIME_COMPUTATION_FAILED ErrorType = "next-runtime-computation-failed" + NO_COLUMNS_IN_EXPORTED_DATASET ErrorType = "no-columns-in-exported-dataset" + NO_PAYMENT_ATTEMPT_FOR_REFUND_FOUND ErrorType = "no-payment-attempt-for-refund-found" + NO_PAYMENT_METHOD_AVAILABLE ErrorType = "no-payment-method-available" + NO_TEAM_ACCOUNT_SEATS_AVAILABLE ErrorType = "no-team-account-seats-available" + NON_TEMPORARY_EMAIL ErrorType = "non-temporary-email" + NOT_ENOUGH_USAGE_TO_RUN_PAID_ACTOR ErrorType = "not-enough-usage-to-run-paid-actor" + NOT_IMPLEMENTED ErrorType = "not-implemented" + NOT_SUPPORTED_CURRENCIES ErrorType = "not-supported-currencies" + O_AUTH_SERVICE_ALREADY_CONNECTED ErrorType = "o-auth-service-already-connected" + O_AUTH_SERVICE_NOT_CONNECTED ErrorType = "o-auth-service-not-connected" + OAUTH_RESOURCE_ACCESS_FAILED ErrorType = "oauth-resource-access-failed" + ONE_TIME_INVOICE_ALREADY_MARKED_PAID ErrorType = "one-time-invoice-already-marked-paid" + ONLY_DRAFTS_CAN_BE_DELETED ErrorType = "only-drafts-can-be-deleted" + OPERATION_CANCELED ErrorType = "operation-canceled" + OPERATION_NOT_ALLOWED ErrorType = "operation-not-allowed" + OPERATION_TIMED_OUT ErrorType = "operation-timed-out" + ORGANIZATION_CANNOT_OWN_ITSELF ErrorType = "organization-cannot-own-itself" + ORGANIZATION_ROLE_NOT_FOUND ErrorType = "organization-role-not-found" + OVERLAPPING_PAYOUT_BILLING_PERIODS ErrorType = "overlapping-payout-billing-periods" + OWN_TOKEN_REQUIRED ErrorType = "own-token-required" + PAGE_NOT_FOUND ErrorType = "page-not-found" + PARAM_NOT_ONE_OF ErrorType = "param-not-one-of" + PARAMETER_REQUIRED ErrorType = "parameter-required" + PARAMETERS_MISMATCHED ErrorType = "parameters-mismatched" + PASSWORD_RESET_EMAIL_ALREADY_SENT ErrorType = "password-reset-email-already-sent" + PASSWORD_RESET_TOKEN_EXPIRED ErrorType = "password-reset-token-expired" + PAY_AS_YOU_GO_WITHOUT_MONTHLY_INTERVAL ErrorType = "pay-as-you-go-without-monthly-interval" + PAYMENT_ATTEMPT_STATUS_MESSAGE_REQUIRED ErrorType = "payment-attempt-status-message-required" + PAYOUT_ALREADY_PAID ErrorType = "payout-already-paid" + PAYOUT_CANCELED ErrorType = "payout-canceled" + PAYOUT_INVALID_STATE ErrorType = "payout-invalid-state" + PAYOUT_MUST_BE_APPROVED_TO_BE_MARKED_PAID ErrorType = "payout-must-be-approved-to-be-marked-paid" + PAYOUT_NOT_FOUND ErrorType = "payout-not-found" + PAYOUT_NUMBER_ALREADY_EXISTS ErrorType = "payout-number-already-exists" + PHONE_NUMBER_INVALID ErrorType = "phone-number-invalid" + PHONE_NUMBER_LANDLINE ErrorType = "phone-number-landline" + PHONE_NUMBER_OPTED_OUT ErrorType = "phone-number-opted-out" + PHONE_VERIFICATION_DISABLED ErrorType = "phone-verification-disabled" + PLATFORM_FEATURE_DISABLED ErrorType = "platform-feature-disabled" + PRICE_OVERRIDES_VALIDATION_FAILED ErrorType = "price-overrides-validation-failed" + PRICING_MODEL_NOT_SUPPORTED ErrorType = "pricing-model-not-supported" + PROMOTIONAL_PLAN_NOT_AVAILABLE ErrorType = "promotional-plan-not-available" + PROXY_AUTH_IP_NOT_UNIQUE ErrorType = "proxy-auth-ip-not-unique" + PUBLIC_ACTOR_DISABLED ErrorType = "public-actor-disabled" + QUERY_TIMEOUT ErrorType = "query-timeout" + QUOTED_PRICE_OUTDATED ErrorType = "quoted-price-outdated" + RATE_LIMIT_EXCEEDED ErrorType = "rate-limit-exceeded" + RECAPTCHA_INVALID ErrorType = "recaptcha-invalid" + RECAPTCHA_REQUIRED ErrorType = "recaptcha-required" + RECORD_NOT_FOUND ErrorType = "record-not-found" + RECORD_NOT_PUBLIC ErrorType = "record-not-public" + RECORD_OR_TOKEN_NOT_FOUND ErrorType = "record-or-token-not-found" + RECORD_TOO_LARGE ErrorType = "record-too-large" + REDIRECT_URI_MISMATCH ErrorType = "redirect-uri-mismatch" + REDUCED_PLAN_NOT_AVAILABLE ErrorType = "reduced-plan-not-available" + RENTAL_CHARGE_ALREADY_REIMBURSED ErrorType = "rental-charge-already-reimbursed" + RENTAL_NOT_ALLOWED ErrorType = "rental-not-allowed" + REQUEST_ABORTED_PREMATURELY ErrorType = "request-aborted-prematurely" + REQUEST_HANDLED_OR_LOCKED ErrorType = "request-handled-or-locked" + REQUEST_ID_INVALID ErrorType = "request-id-invalid" + REQUEST_QUEUE_DUPLICATE_REQUESTS ErrorType = "request-queue-duplicate-requests" + REQUEST_TOO_LARGE ErrorType = "request-too-large" + REQUESTED_DATASET_VIEW_DOES_NOT_EXIST ErrorType = "requested-dataset-view-does-not-exist" + RESUME_TOKEN_EXPIRED ErrorType = "resume-token-expired" + RUN_FAILED ErrorType = "run-failed" + RUN_INPUT_BODY_NOT_VALID_JSON ErrorType = "run-input-body-not-valid-json" + RUN_TIMEOUT_EXCEEDED ErrorType = "run-timeout-exceeded" + RUSSIA_IS_EVIL ErrorType = "russia-is-evil" + SAME_USER ErrorType = "same-user" + SCHEDULE_ACTOR_NOT_FOUND ErrorType = "schedule-actor-not-found" + SCHEDULE_ACTOR_TASK_NOT_FOUND ErrorType = "schedule-actor-task-not-found" + SCHEDULE_NAME_NOT_UNIQUE ErrorType = "schedule-name-not-unique" + SCHEMA_VALIDATION ErrorType = "schema-validation" + SCHEMA_VALIDATION_ERROR ErrorType = "schema-validation-error" + SCHEMA_VALIDATION_FAILED ErrorType = "schema-validation-failed" + SIGN_UP_METHOD_NOT_ALLOWED ErrorType = "sign-up-method-not-allowed" + SLACK_INTEGRATION_NOT_CUSTOM ErrorType = "slack-integration-not-custom" + SOCKET_CLOSED ErrorType = "socket-closed" + SOCKET_DESTROYED ErrorType = "socket-destroyed" + STORE_SCHEMA_INVALID ErrorType = "store-schema-invalid" + STORE_TERMS_NOT_ACCEPTED ErrorType = "store-terms-not-accepted" + STRIPE_ENABLED ErrorType = "stripe-enabled" + STRIPE_GENERIC_DECLINE ErrorType = "stripe-generic-decline" + STRIPE_NOT_ENABLED ErrorType = "stripe-not-enabled" + STRIPE_NOT_ENABLED_FOR_USER ErrorType = "stripe-not-enabled-for-user" + TAGGED_BUILD_REQUIRED ErrorType = "tagged-build-required" + TAX_COUNTRY_INVALID ErrorType = "tax-country-invalid" + TAX_NUMBER_INVALID ErrorType = "tax-number-invalid" + TAX_NUMBER_VALIDATION_FAILED ErrorType = "tax-number-validation-failed" + TAXAMO_CALL_FAILED ErrorType = "taxamo-call-failed" + TAXAMO_REQUEST_FAILED ErrorType = "taxamo-request-failed" + TESTING_ERROR ErrorType = "testing-error" + TOKEN_NOT_PROVIDED ErrorType = "token-not-provided" + TOO_FEW_VERSIONS ErrorType = "too-few-versions" + TOO_MANY_ACTOR_TASKS ErrorType = "too-many-actor-tasks" + TOO_MANY_ACTORS ErrorType = "too-many-actors" + TOO_MANY_LABELS_ON_RESOURCE ErrorType = "too-many-labels-on-resource" + TOO_MANY_MCP_CONNECTORS ErrorType = "too-many-mcp-connectors" + TOO_MANY_O_AUTH_APPS ErrorType = "too-many-o-auth-apps" + TOO_MANY_ORGANIZATIONS ErrorType = "too-many-organizations" + TOO_MANY_REQUESTS ErrorType = "too-many-requests" + TOO_MANY_SCHEDULES ErrorType = "too-many-schedules" + TOO_MANY_UI_ACCESS_KEYS ErrorType = "too-many-ui-access-keys" + TOO_MANY_USER_LABELS ErrorType = "too-many-user-labels" + TOO_MANY_VALUES ErrorType = "too-many-values" + TOO_MANY_VERSIONS ErrorType = "too-many-versions" + TOO_MANY_WEBHOOKS ErrorType = "too-many-webhooks" + UNEXPECTED_ROUTE ErrorType = "unexpected-route" + UNKNOWN_BUILD_TAG ErrorType = "unknown-build-tag" + UNKNOWN_PAYMENT_PROVIDER ErrorType = "unknown-payment-provider" + UNSUBSCRIBE_TOKEN_INVALID ErrorType = "unsubscribe-token-invalid" + UNSUPPORTED_ACTOR_PRICING_MODEL_FOR_AGENTIC_PAYMENTS ErrorType = "unsupported-actor-pricing-model-for-agentic-payments" + UNSUPPORTED_CONTENT_ENCODING ErrorType = "unsupported-content-encoding" + UNSUPPORTED_FILE_TYPE_FOR_ISSUE ErrorType = "unsupported-file-type-for-issue" + UNSUPPORTED_FILE_TYPE_IMAGE_EXPECTED ErrorType = "unsupported-file-type-image-expected" + UNSUPPORTED_FILE_TYPE_TEXT_OR_JSON_EXPECTED ErrorType = "unsupported-file-type-text-or-json-expected" + UNSUPPORTED_PERMISSION ErrorType = "unsupported-permission" + UPCOMING_SUBSCRIPTION_BILL_NOT_UP_TO_DATE ErrorType = "upcoming-subscription-bill-not-up-to-date" + USER_ALREADY_EXISTS ErrorType = "user-already-exists" + USER_ALREADY_VERIFIED ErrorType = "user-already-verified" + USER_CREATES_ORGANIZATIONS_TOO_FAST ErrorType = "user-creates-organizations-too-fast" + USER_DISABLED ErrorType = "user-disabled" + USER_EMAIL_IS_DISPOSABLE ErrorType = "user-email-is-disposable" + USER_EMAIL_NOT_SET ErrorType = "user-email-not-set" + USER_EMAIL_NOT_VERIFIED ErrorType = "user-email-not-verified" + USER_HAS_NO_SUBSCRIPTION ErrorType = "user-has-no-subscription" + USER_INTEGRATION_NOT_FOUND ErrorType = "user-integration-not-found" + USER_IS_ALREADY_INVITED ErrorType = "user-is-already-invited" + USER_IS_ALREADY_ORGANIZATION_MEMBER ErrorType = "user-is-already-organization-member" + USER_IS_NOT_MEMBER_OF_ORGANIZATION ErrorType = "user-is-not-member-of-organization" + USER_IS_NOT_ORGANIZATION ErrorType = "user-is-not-organization" + USER_IS_ORGANIZATION ErrorType = "user-is-organization" + USER_IS_ORGANIZATION_OWNER ErrorType = "user-is-organization-owner" + USER_IS_REMOVED ErrorType = "user-is-removed" + USER_NOT_FOUND ErrorType = "user-not-found" + USER_NOT_LOGGED_IN ErrorType = "user-not-logged-in" + USER_NOT_VERIFIED ErrorType = "user-not-verified" + USER_OR_TOKEN_NOT_FOUND ErrorType = "user-or-token-not-found" + USER_PLAN_NOT_ALLOWED_FOR_COUPON ErrorType = "user-plan-not-allowed-for-coupon" + USER_PROBLEM_WITH_CARD ErrorType = "user-problem-with-card" + USER_RECORD_NOT_FOUND ErrorType = "user-record-not-found" + USERNAME_ALREADY_TAKEN ErrorType = "username-already-taken" + USERNAME_MISSING ErrorType = "username-missing" + USERNAME_NOT_ALLOWED ErrorType = "username-not-allowed" + USERNAME_REMOVAL_FORBIDDEN ErrorType = "username-removal-forbidden" + USERNAME_REQUIRED ErrorType = "username-required" + VERIFICATION_EMAIL_ALREADY_SENT ErrorType = "verification-email-already-sent" + VERIFICATION_TOKEN_EXPIRED ErrorType = "verification-token-expired" + VERSION_ALREADY_EXISTS ErrorType = "version-already-exists" + VERSIONS_SIZE_EXCEEDED ErrorType = "versions-size-exceeded" + WEAK_PASSWORD ErrorType = "weak-password" + X402_AGENTIC_PAYMENT_ALREADY_FINALIZED ErrorType = "x402-agentic-payment-already-finalized" + X402_AGENTIC_PAYMENT_INSUFFICIENT_AMOUNT ErrorType = "x402-agentic-payment-insufficient-amount" + X402_AGENTIC_PAYMENT_MALFORMED_TOKEN ErrorType = "x402-agentic-payment-malformed-token" + X402_AGENTIC_PAYMENT_SETTLEMENT_FAILED ErrorType = "x402-agentic-payment-settlement-failed" + X402_AGENTIC_PAYMENT_SETTLEMENT_IN_PROGRESS ErrorType = "x402-agentic-payment-settlement-in-progress" + X402_AGENTIC_PAYMENT_SETTLEMENT_STUCK ErrorType = "x402-agentic-payment-settlement-stuck" + X402_AGENTIC_PAYMENT_UNAUTHORIZED ErrorType = "x402-agentic-payment-unauthorized" + X402_PAYMENT_REQUIRED ErrorType = "x402-payment-required" + ZERO_INVOICE ErrorType = "zero-invoice" +) + +// All allowed values of ErrorType enum +var AllowedErrorTypeEnumValues = []ErrorType{ + "3d-secure-auth-failed", + "access-right-already-exists", + "action-not-found", + "actor-already-rented", + "actor-can-not-be-rented", + "actor-disabled", + "actor-is-not-rented", + "actor-memory-limit-exceeded", + "actor-name-exists-new-owner", + "actor-name-not-unique", + "actor-not-found", + "actor-not-github-actor", + "actor-not-public", + "actor-permission-level-not-supported-for-agentic-payments", + "actor-review-already-exists", + "actor-run-failed", + "actor-standby-not-supported-for-agentic-payments", + "actor-task-name-not-unique", + "agentic-payment-info-retrieval-error", + "agentic-payment-information-missing", + "agentic-payment-insufficient-amount", + "agentic-payment-provider-internal-error", + "agentic-payment-provider-unauthorized", + "airtable-webhook-deprecated", + "already-subscribed-to-paid-actor", + "apify-plan-required-to-use-paid-actor", + "apify-signup-not-allowed", + "auth-method-not-supported", + "authorization-server-not-found", + "auto-issue-date-invalid", + "background-check-required", + "billing-system-error", + "black-friday-plan-expired", + "braintree-error", + "braintree-not-linked", + "braintree-operation-timed-out", + "braintree-unsupported-currency", + "build-not-found", + "build-outdated", + "cannot-add-apify-events-to-ppe-actor", + "cannot-add-multiple-pricing-infos", + "cannot-add-pricing-info-that-alters-past", + "cannot-add-second-future-pricing-info", + "cannot-build-actor-from-webhook", + "cannot-change-billing-interval", + "cannot-change-owner", + "cannot-charge-apify-event", + "cannot-charge-non-pay-per-event-actor", + "cannot-comment-as-other-user", + "cannot-copy-actor-task", + "cannot-create-payout", + "cannot-create-public-actor", + "cannot-create-tax-transaction", + "cannot-delete-critical-actor", + "cannot-delete-invoice", + "cannot-delete-paid-actor", + "cannot-disable-one-time-event-for-apify-start-event", + "cannot-disable-organization-with-enabled-members", + "cannot-disable-user-with-subscription", + "cannot-link-oauth-to-unverified-email", + "cannot-metamorph-to-pay-per-result-actor", + "cannot-modify-actor-pricing-too-frequently", + "cannot-modify-actor-pricing-with-immediate-effect", + "cannot-override-paid-actor-trial", + "cannot-permanently-delete-subscription", + "cannot-publish-actor", + "cannot-reduce-last-full-token", + "cannot-reimburse-more-than-original-charge", + "cannot-reimburse-non-rental-charge", + "cannot-remove-own-actor-from-recently-used", + "cannot-remove-payment-method", + "cannot-remove-pricing-info", + "cannot-remove-running-run", + "cannot-remove-user-with-public-actors", + "cannot-remove-user-with-subscription", + "cannot-remove-user-with-unpaid-invoice", + "cannot-rename-env-var", + "cannot-rent-paid-actor", + "cannot-review-own-actor", + "cannot-set-access-rights-for-owner", + "cannot-set-is-status-message-terminal", + "cannot-unpublish-critical-actor", + "cannot-unpublish-paid-actor", + "cannot-unpublish-profile", + "cannot-update-invoice-field", + "concurrent-runs-limit-exceeded", + "concurrent-update-detected", + "conference-token-not-found", + "content-encoding-forbidden-for-html", + "coupon-already-redeemed", + "coupon-expired", + "coupon-for-new-customers", + "coupon-for-subscribed-users", + "coupon-limits-are-in-conflict-with-current-limits", + "coupon-max-number-of-redemptions-reached", + "coupon-not-found", + "coupon-not-unique", + "coupons-disabled", + "create-github-issue-not-allowed", + "creator-plan-not-available", + "cron-expression-invalid", + "daily-ai-token-limit-exceeded", + "daily-publication-limit-exceeded", + "dataset-does-not-have-fields-schema", + "dataset-does-not-have-schema", + "dataset-locked", + "dataset-schema-invalid", + "dcr-not-supported", + "default-dataset-not-found", + "deleting-default-build", + "deleting-unfinished-build", + "email-already-taken", + "email-already-taken-removed-user", + "email-domain-not-allowed-for-coupon", + "email-invalid", + "email-not-allowed", + "email-not-valid", + "email-update-too-soon", + "elevated-permissions-needed", + "env-var-already-exists", + "exchange-rate-fetch-failed", + "expired-conference-token", + "failed-to-charge-user", + "final-invoice-negative", + "full-permission-actor-not-approved", + "github-branch-empty", + "github-issue-already-exists", + "github-public-key-not-found", + "github-repository-not-found", + "github-signature-does-not-match-payload", + "github-user-not-authorized-for-issues", + "gmail-not-allowed", + "id-does-not-match", + "incompatible-billing-interval", + "incomplete-payout-billing-info", + "inconsistent-currencies", + "incorrect-pricing-modifier-prefix", + "input-json-invalid-characters", + "input-json-not-object", + "input-json-too-long", + "input-update-collision", + "insufficient-permissions", + "insufficient-permissions-to-change-field", + "insufficient-security-measures", + "insufficient-tax-country-evidence", + "integration-auth-error", + "internal-server-error", + "invalid-billing-info", + "invalid-billing-period-for-payout", + "invalid-build", + "invalid-client-key", + "invalid-collection", + "invalid-conference-login-password", + "invalid-content-type-header", + "invalid-credentials", + "invalid-git-auth-token", + "invalid-github-issue-url", + "invalid-header", + "invalid-id", + "invalid-idempotency-key", + "invalid-input", + "invalid-input-schema", + "invalid-invoice", + "invalid-invoice-type", + "invalid-issue-date", + "invalid-label-params", + "invalid-main-account-user-id", + "invalid-oauth-app", + "invalid-oauth-scope", + "invalid-one-time-invoice", + "invalid-parameter", + "invalid-payout-status", + "invalid-picture-url", + "invalid-record-key", + "invalid-request", + "invalid-resource-type", + "invalid-signature", + "invalid-subscription-plan", + "invalid-tax-number", + "invalid-tax-number-format", + "invalid-token", + "invalid-token-type", + "invalid-two-factor-code", + "invalid-two-factor-code-or-recovery-code", + "invalid-two-factor-recovery-code", + "invalid-username", + "invalid-value", + "invitation-invalid-resource-type", + "invitation-no-longer-valid", + "invoice-canceled", + "invoice-cannot-be-refunded-due-to-too-high-amount", + "invoice-incomplete", + "invoice-is-draft", + "invoice-locked", + "invoice-must-be-buffer", + "invoice-not-canceled", + "invoice-not-draft", + "invoice-not-found", + "invoice-outdated", + "invoice-paid-already", + "issue-already-connected-to-github", + "issue-not-found", + "issues-bad-request", + "issuer-not-registered", + "job-finished", + "label-already-linked", + "last-api-token", + "limit-reached", + "max-items-must-be-greater-than-zero", + "max-metamorphs-exceeded", + "max-total-charge-usd-below-minimum", + "max-total-charge-usd-must-be-greater-than-zero", + "method-not-allowed", + "migration-disabled", + "missing-actor-rights", + "missing-api-token", + "missing-billing-info", + "missing-line-items", + "missing-payment-date", + "missing-payout-billing-info", + "missing-proxy-password", + "missing-reporting-fields", + "missing-resource-name", + "missing-settings", + "missing-username", + "monthly-usage-limit-too-low", + "more-than-one-update-not-allowed", + "multiple-records-found", + "must-be-admin", + "name-not-unique", + "next-runtime-computation-failed", + "no-columns-in-exported-dataset", + "no-payment-attempt-for-refund-found", + "no-payment-method-available", + "no-team-account-seats-available", + "non-temporary-email", + "not-enough-usage-to-run-paid-actor", + "not-implemented", + "not-supported-currencies", + "o-auth-service-already-connected", + "o-auth-service-not-connected", + "oauth-resource-access-failed", + "one-time-invoice-already-marked-paid", + "only-drafts-can-be-deleted", + "operation-canceled", + "operation-not-allowed", + "operation-timed-out", + "organization-cannot-own-itself", + "organization-role-not-found", + "overlapping-payout-billing-periods", + "own-token-required", + "page-not-found", + "param-not-one-of", + "parameter-required", + "parameters-mismatched", + "password-reset-email-already-sent", + "password-reset-token-expired", + "pay-as-you-go-without-monthly-interval", + "payment-attempt-status-message-required", + "payout-already-paid", + "payout-canceled", + "payout-invalid-state", + "payout-must-be-approved-to-be-marked-paid", + "payout-not-found", + "payout-number-already-exists", + "phone-number-invalid", + "phone-number-landline", + "phone-number-opted-out", + "phone-verification-disabled", + "platform-feature-disabled", + "price-overrides-validation-failed", + "pricing-model-not-supported", + "promotional-plan-not-available", + "proxy-auth-ip-not-unique", + "public-actor-disabled", + "query-timeout", + "quoted-price-outdated", + "rate-limit-exceeded", + "recaptcha-invalid", + "recaptcha-required", + "record-not-found", + "record-not-public", + "record-or-token-not-found", + "record-too-large", + "redirect-uri-mismatch", + "reduced-plan-not-available", + "rental-charge-already-reimbursed", + "rental-not-allowed", + "request-aborted-prematurely", + "request-handled-or-locked", + "request-id-invalid", + "request-queue-duplicate-requests", + "request-too-large", + "requested-dataset-view-does-not-exist", + "resume-token-expired", + "run-failed", + "run-input-body-not-valid-json", + "run-timeout-exceeded", + "russia-is-evil", + "same-user", + "schedule-actor-not-found", + "schedule-actor-task-not-found", + "schedule-name-not-unique", + "schema-validation", + "schema-validation-error", + "schema-validation-failed", + "sign-up-method-not-allowed", + "slack-integration-not-custom", + "socket-closed", + "socket-destroyed", + "store-schema-invalid", + "store-terms-not-accepted", + "stripe-enabled", + "stripe-generic-decline", + "stripe-not-enabled", + "stripe-not-enabled-for-user", + "tagged-build-required", + "tax-country-invalid", + "tax-number-invalid", + "tax-number-validation-failed", + "taxamo-call-failed", + "taxamo-request-failed", + "testing-error", + "token-not-provided", + "too-few-versions", + "too-many-actor-tasks", + "too-many-actors", + "too-many-labels-on-resource", + "too-many-mcp-connectors", + "too-many-o-auth-apps", + "too-many-organizations", + "too-many-requests", + "too-many-schedules", + "too-many-ui-access-keys", + "too-many-user-labels", + "too-many-values", + "too-many-versions", + "too-many-webhooks", + "unexpected-route", + "unknown-build-tag", + "unknown-payment-provider", + "unsubscribe-token-invalid", + "unsupported-actor-pricing-model-for-agentic-payments", + "unsupported-content-encoding", + "unsupported-file-type-for-issue", + "unsupported-file-type-image-expected", + "unsupported-file-type-text-or-json-expected", + "unsupported-permission", + "upcoming-subscription-bill-not-up-to-date", + "user-already-exists", + "user-already-verified", + "user-creates-organizations-too-fast", + "user-disabled", + "user-email-is-disposable", + "user-email-not-set", + "user-email-not-verified", + "user-has-no-subscription", + "user-integration-not-found", + "user-is-already-invited", + "user-is-already-organization-member", + "user-is-not-member-of-organization", + "user-is-not-organization", + "user-is-organization", + "user-is-organization-owner", + "user-is-removed", + "user-not-found", + "user-not-logged-in", + "user-not-verified", + "user-or-token-not-found", + "user-plan-not-allowed-for-coupon", + "user-problem-with-card", + "user-record-not-found", + "username-already-taken", + "username-missing", + "username-not-allowed", + "username-removal-forbidden", + "username-required", + "verification-email-already-sent", + "verification-token-expired", + "version-already-exists", + "versions-size-exceeded", + "weak-password", + "x402-agentic-payment-already-finalized", + "x402-agentic-payment-insufficient-amount", + "x402-agentic-payment-malformed-token", + "x402-agentic-payment-settlement-failed", + "x402-agentic-payment-settlement-in-progress", + "x402-agentic-payment-settlement-stuck", + "x402-agentic-payment-unauthorized", + "x402-payment-required", + "zero-invoice", +} + +func (v *ErrorType) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := ErrorType(value) + for _, existing := range AllowedErrorTypeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid ErrorType", value) +} + +// NewErrorTypeFromValue returns a pointer to a valid ErrorType +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewErrorTypeFromValue(v string) (*ErrorType, error) { + ev := ErrorType(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for ErrorType: valid values are %v", v, AllowedErrorTypeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v ErrorType) IsValid() bool { + for _, existing := range AllowedErrorTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to ErrorType value +func (v ErrorType) Ptr() *ErrorType { + return &v +} + +type NullableErrorType struct { + value *ErrorType + isSet bool +} + +func (v NullableErrorType) Get() *ErrorType { + return v.value +} + +func (v *NullableErrorType) Set(val *ErrorType) { + v.value = val + v.isSet = true +} + +func (v NullableErrorType) IsSet() bool { + return v.isSet +} + +func (v *NullableErrorType) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableErrorType(val *ErrorType) *NullableErrorType { + return &NullableErrorType{value: val, isSet: true} +} + +func (v NullableErrorType) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableErrorType) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + diff --git a/model_event_data.go b/model_event_data.go new file mode 100644 index 0000000..5188498 --- /dev/null +++ b/model_event_data.go @@ -0,0 +1,186 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" + "bytes" + "fmt" +) + +// checks if the EventData type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &EventData{} + +// EventData struct for EventData +type EventData struct { + ActorId string `json:"actorId"` + ActorRunId string `json:"actorRunId"` +} + +type _EventData EventData + +// NewEventData instantiates a new EventData object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewEventData(actorId string, actorRunId string) *EventData { + this := EventData{} + this.ActorId = actorId + this.ActorRunId = actorRunId + return &this +} + +// NewEventDataWithDefaults instantiates a new EventData object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewEventDataWithDefaults() *EventData { + this := EventData{} + return &this +} + +// GetActorId returns the ActorId field value +func (o *EventData) GetActorId() string { + if o == nil { + var ret string + return ret + } + + return o.ActorId +} + +// GetActorIdOk returns a tuple with the ActorId field value +// and a boolean to check if the value has been set. +func (o *EventData) GetActorIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ActorId, true +} + +// SetActorId sets field value +func (o *EventData) SetActorId(v string) { + o.ActorId = v +} + +// GetActorRunId returns the ActorRunId field value +func (o *EventData) GetActorRunId() string { + if o == nil { + var ret string + return ret + } + + return o.ActorRunId +} + +// GetActorRunIdOk returns a tuple with the ActorRunId field value +// and a boolean to check if the value has been set. +func (o *EventData) GetActorRunIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ActorRunId, true +} + +// SetActorRunId sets field value +func (o *EventData) SetActorRunId(v string) { + o.ActorRunId = v +} + +func (o EventData) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o EventData) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["actorId"] = o.ActorId + toSerialize["actorRunId"] = o.ActorRunId + return toSerialize, nil +} + +func (o *EventData) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "actorId", + "actorRunId", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varEventData := _EventData{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varEventData) + + if err != nil { + return err + } + + *o = EventData(varEventData) + + return err +} + +type NullableEventData struct { + value *EventData + isSet bool +} + +func (v NullableEventData) Get() *EventData { + return v.value +} + +func (v *NullableEventData) Set(val *EventData) { + v.value = val + v.isSet = true +} + +func (v NullableEventData) IsSet() bool { + return v.isSet +} + +func (v *NullableEventData) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableEventData(val *EventData) *NullableEventData { + return &NullableEventData{value: val, isSet: true} +} + +func (v NullableEventData) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableEventData) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_example_run_input.go b/model_example_run_input.go new file mode 100644 index 0000000..b238d68 --- /dev/null +++ b/model_example_run_input.go @@ -0,0 +1,162 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" +) + +// checks if the ExampleRunInput type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ExampleRunInput{} + +// ExampleRunInput struct for ExampleRunInput +type ExampleRunInput struct { + Body *string `json:"body,omitempty"` + ContentType *string `json:"contentType,omitempty"` +} + +// NewExampleRunInput instantiates a new ExampleRunInput object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewExampleRunInput() *ExampleRunInput { + this := ExampleRunInput{} + return &this +} + +// NewExampleRunInputWithDefaults instantiates a new ExampleRunInput object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewExampleRunInputWithDefaults() *ExampleRunInput { + this := ExampleRunInput{} + return &this +} + +// GetBody returns the Body field value if set, zero value otherwise. +func (o *ExampleRunInput) GetBody() string { + if o == nil || IsNil(o.Body) { + var ret string + return ret + } + return *o.Body +} + +// GetBodyOk returns a tuple with the Body field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ExampleRunInput) GetBodyOk() (*string, bool) { + if o == nil || IsNil(o.Body) { + return nil, false + } + return o.Body, true +} + +// HasBody returns a boolean if a field has been set. +func (o *ExampleRunInput) HasBody() bool { + if o != nil && !IsNil(o.Body) { + return true + } + + return false +} + +// SetBody gets a reference to the given string and assigns it to the Body field. +func (o *ExampleRunInput) SetBody(v string) { + o.Body = &v +} + +// GetContentType returns the ContentType field value if set, zero value otherwise. +func (o *ExampleRunInput) GetContentType() string { + if o == nil || IsNil(o.ContentType) { + var ret string + return ret + } + return *o.ContentType +} + +// GetContentTypeOk returns a tuple with the ContentType field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ExampleRunInput) GetContentTypeOk() (*string, bool) { + if o == nil || IsNil(o.ContentType) { + return nil, false + } + return o.ContentType, true +} + +// HasContentType returns a boolean if a field has been set. +func (o *ExampleRunInput) HasContentType() bool { + if o != nil && !IsNil(o.ContentType) { + return true + } + + return false +} + +// SetContentType gets a reference to the given string and assigns it to the ContentType field. +func (o *ExampleRunInput) SetContentType(v string) { + o.ContentType = &v +} + +func (o ExampleRunInput) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ExampleRunInput) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Body) { + toSerialize["body"] = o.Body + } + if !IsNil(o.ContentType) { + toSerialize["contentType"] = o.ContentType + } + return toSerialize, nil +} + +type NullableExampleRunInput struct { + value *ExampleRunInput + isSet bool +} + +func (v NullableExampleRunInput) Get() *ExampleRunInput { + return v.value +} + +func (v *NullableExampleRunInput) Set(val *ExampleRunInput) { + v.value = val + v.isSet = true +} + +func (v NullableExampleRunInput) IsSet() bool { + return v.isSet +} + +func (v *NullableExampleRunInput) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableExampleRunInput(val *ExampleRunInput) *NullableExampleRunInput { + return &NullableExampleRunInput{value: val, isSet: true} +} + +func (v NullableExampleRunInput) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableExampleRunInput) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_example_webhook_dispatch.go b/model_example_webhook_dispatch.go new file mode 100644 index 0000000..9bc4c1b --- /dev/null +++ b/model_example_webhook_dispatch.go @@ -0,0 +1,251 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" + "time" + "bytes" + "fmt" +) + +// checks if the ExampleWebhookDispatch type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ExampleWebhookDispatch{} + +// ExampleWebhookDispatch struct for ExampleWebhookDispatch +type ExampleWebhookDispatch struct { + Status WebhookDispatchStatus `json:"status"` + FinishedAt NullableTime `json:"finishedAt,omitempty"` + RemovedAt NullableTime `json:"removedAt,omitempty"` +} + +type _ExampleWebhookDispatch ExampleWebhookDispatch + +// NewExampleWebhookDispatch instantiates a new ExampleWebhookDispatch object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewExampleWebhookDispatch(status WebhookDispatchStatus) *ExampleWebhookDispatch { + this := ExampleWebhookDispatch{} + this.Status = status + return &this +} + +// NewExampleWebhookDispatchWithDefaults instantiates a new ExampleWebhookDispatch object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewExampleWebhookDispatchWithDefaults() *ExampleWebhookDispatch { + this := ExampleWebhookDispatch{} + return &this +} + +// GetStatus returns the Status field value +func (o *ExampleWebhookDispatch) GetStatus() WebhookDispatchStatus { + if o == nil { + var ret WebhookDispatchStatus + return ret + } + + return o.Status +} + +// GetStatusOk returns a tuple with the Status field value +// and a boolean to check if the value has been set. +func (o *ExampleWebhookDispatch) GetStatusOk() (*WebhookDispatchStatus, bool) { + if o == nil { + return nil, false + } + return &o.Status, true +} + +// SetStatus sets field value +func (o *ExampleWebhookDispatch) SetStatus(v WebhookDispatchStatus) { + o.Status = v +} + +// GetFinishedAt returns the FinishedAt field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ExampleWebhookDispatch) GetFinishedAt() time.Time { + if o == nil || IsNil(o.FinishedAt.Get()) { + var ret time.Time + return ret + } + return *o.FinishedAt.Get() +} + +// GetFinishedAtOk returns a tuple with the FinishedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ExampleWebhookDispatch) GetFinishedAtOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.FinishedAt.Get(), o.FinishedAt.IsSet() +} + +// HasFinishedAt returns a boolean if a field has been set. +func (o *ExampleWebhookDispatch) HasFinishedAt() bool { + if o != nil && o.FinishedAt.IsSet() { + return true + } + + return false +} + +// SetFinishedAt gets a reference to the given NullableTime and assigns it to the FinishedAt field. +func (o *ExampleWebhookDispatch) SetFinishedAt(v time.Time) { + o.FinishedAt.Set(&v) +} +// SetFinishedAtNil sets the value for FinishedAt to be an explicit nil +func (o *ExampleWebhookDispatch) SetFinishedAtNil() { + o.FinishedAt.Set(nil) +} + +// UnsetFinishedAt ensures that no value is present for FinishedAt, not even an explicit nil +func (o *ExampleWebhookDispatch) UnsetFinishedAt() { + o.FinishedAt.Unset() +} + +// GetRemovedAt returns the RemovedAt field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ExampleWebhookDispatch) GetRemovedAt() time.Time { + if o == nil || IsNil(o.RemovedAt.Get()) { + var ret time.Time + return ret + } + return *o.RemovedAt.Get() +} + +// GetRemovedAtOk returns a tuple with the RemovedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ExampleWebhookDispatch) GetRemovedAtOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.RemovedAt.Get(), o.RemovedAt.IsSet() +} + +// HasRemovedAt returns a boolean if a field has been set. +func (o *ExampleWebhookDispatch) HasRemovedAt() bool { + if o != nil && o.RemovedAt.IsSet() { + return true + } + + return false +} + +// SetRemovedAt gets a reference to the given NullableTime and assigns it to the RemovedAt field. +func (o *ExampleWebhookDispatch) SetRemovedAt(v time.Time) { + o.RemovedAt.Set(&v) +} +// SetRemovedAtNil sets the value for RemovedAt to be an explicit nil +func (o *ExampleWebhookDispatch) SetRemovedAtNil() { + o.RemovedAt.Set(nil) +} + +// UnsetRemovedAt ensures that no value is present for RemovedAt, not even an explicit nil +func (o *ExampleWebhookDispatch) UnsetRemovedAt() { + o.RemovedAt.Unset() +} + +func (o ExampleWebhookDispatch) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ExampleWebhookDispatch) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["status"] = o.Status + if o.FinishedAt.IsSet() { + toSerialize["finishedAt"] = o.FinishedAt.Get() + } + if o.RemovedAt.IsSet() { + toSerialize["removedAt"] = o.RemovedAt.Get() + } + return toSerialize, nil +} + +func (o *ExampleWebhookDispatch) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "status", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varExampleWebhookDispatch := _ExampleWebhookDispatch{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varExampleWebhookDispatch) + + if err != nil { + return err + } + + *o = ExampleWebhookDispatch(varExampleWebhookDispatch) + + return err +} + +type NullableExampleWebhookDispatch struct { + value *ExampleWebhookDispatch + isSet bool +} + +func (v NullableExampleWebhookDispatch) Get() *ExampleWebhookDispatch { + return v.value +} + +func (v *NullableExampleWebhookDispatch) Set(val *ExampleWebhookDispatch) { + v.value = val + v.isSet = true +} + +func (v NullableExampleWebhookDispatch) IsSet() bool { + return v.isSet +} + +func (v *NullableExampleWebhookDispatch) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableExampleWebhookDispatch(val *ExampleWebhookDispatch) *NullableExampleWebhookDispatch { + return &NullableExampleWebhookDispatch{value: val, isSet: true} +} + +func (v NullableExampleWebhookDispatch) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableExampleWebhookDispatch) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_flat_price_per_month_actor_pricing_info.go b/model_flat_price_per_month_actor_pricing_info.go new file mode 100644 index 0000000..cba4c18 --- /dev/null +++ b/model_flat_price_per_month_actor_pricing_info.go @@ -0,0 +1,484 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" + "time" + "bytes" + "fmt" +) + +// checks if the FlatPricePerMonthActorPricingInfo type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &FlatPricePerMonthActorPricingInfo{} + +// FlatPricePerMonthActorPricingInfo struct for FlatPricePerMonthActorPricingInfo +type FlatPricePerMonthActorPricingInfo struct { + // In [0, 1], fraction of pricePerUnitUsd that goes to Apify + ApifyMarginPercentage float32 `json:"apifyMarginPercentage"` + // When this pricing info record has been created + CreatedAt time.Time `json:"createdAt"` + // Since when is this pricing info record effective for a given Actor + StartedAt time.Time `json:"startedAt"` + NotifiedAboutFutureChangeAt *time.Time `json:"notifiedAboutFutureChangeAt,omitempty"` + NotifiedAboutChangeAt *time.Time `json:"notifiedAboutChangeAt,omitempty"` + ReasonForChange *string `json:"reasonForChange,omitempty"` + IsPriceChangeNotificationSuppressed *bool `json:"isPriceChangeNotificationSuppressed,omitempty"` + ForceContainsSignificantPriceChange *bool `json:"forceContainsSignificantPriceChange,omitempty"` + PricingModel string `json:"pricingModel"` + // For how long this Actor can be used for free in trial period + TrialMinutes int32 `json:"trialMinutes"` + // Monthly flat price in USD + PricePerUnitUsd float32 `json:"pricePerUnitUsd"` +} + +type _FlatPricePerMonthActorPricingInfo FlatPricePerMonthActorPricingInfo + +// NewFlatPricePerMonthActorPricingInfo instantiates a new FlatPricePerMonthActorPricingInfo object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewFlatPricePerMonthActorPricingInfo(apifyMarginPercentage float32, createdAt time.Time, startedAt time.Time, pricingModel string, trialMinutes int32, pricePerUnitUsd float32) *FlatPricePerMonthActorPricingInfo { + this := FlatPricePerMonthActorPricingInfo{} + this.ApifyMarginPercentage = apifyMarginPercentage + this.CreatedAt = createdAt + this.StartedAt = startedAt + this.PricingModel = pricingModel + this.TrialMinutes = trialMinutes + this.PricePerUnitUsd = pricePerUnitUsd + return &this +} + +// NewFlatPricePerMonthActorPricingInfoWithDefaults instantiates a new FlatPricePerMonthActorPricingInfo object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewFlatPricePerMonthActorPricingInfoWithDefaults() *FlatPricePerMonthActorPricingInfo { + this := FlatPricePerMonthActorPricingInfo{} + return &this +} + +// GetApifyMarginPercentage returns the ApifyMarginPercentage field value +func (o *FlatPricePerMonthActorPricingInfo) GetApifyMarginPercentage() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.ApifyMarginPercentage +} + +// GetApifyMarginPercentageOk returns a tuple with the ApifyMarginPercentage field value +// and a boolean to check if the value has been set. +func (o *FlatPricePerMonthActorPricingInfo) GetApifyMarginPercentageOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.ApifyMarginPercentage, true +} + +// SetApifyMarginPercentage sets field value +func (o *FlatPricePerMonthActorPricingInfo) SetApifyMarginPercentage(v float32) { + o.ApifyMarginPercentage = v +} + +// GetCreatedAt returns the CreatedAt field value +func (o *FlatPricePerMonthActorPricingInfo) GetCreatedAt() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value +// and a boolean to check if the value has been set. +func (o *FlatPricePerMonthActorPricingInfo) GetCreatedAtOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.CreatedAt, true +} + +// SetCreatedAt sets field value +func (o *FlatPricePerMonthActorPricingInfo) SetCreatedAt(v time.Time) { + o.CreatedAt = v +} + +// GetStartedAt returns the StartedAt field value +func (o *FlatPricePerMonthActorPricingInfo) GetStartedAt() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.StartedAt +} + +// GetStartedAtOk returns a tuple with the StartedAt field value +// and a boolean to check if the value has been set. +func (o *FlatPricePerMonthActorPricingInfo) GetStartedAtOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.StartedAt, true +} + +// SetStartedAt sets field value +func (o *FlatPricePerMonthActorPricingInfo) SetStartedAt(v time.Time) { + o.StartedAt = v +} + +// GetNotifiedAboutFutureChangeAt returns the NotifiedAboutFutureChangeAt field value if set, zero value otherwise. +func (o *FlatPricePerMonthActorPricingInfo) GetNotifiedAboutFutureChangeAt() time.Time { + if o == nil || IsNil(o.NotifiedAboutFutureChangeAt) { + var ret time.Time + return ret + } + return *o.NotifiedAboutFutureChangeAt +} + +// GetNotifiedAboutFutureChangeAtOk returns a tuple with the NotifiedAboutFutureChangeAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FlatPricePerMonthActorPricingInfo) GetNotifiedAboutFutureChangeAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.NotifiedAboutFutureChangeAt) { + return nil, false + } + return o.NotifiedAboutFutureChangeAt, true +} + +// HasNotifiedAboutFutureChangeAt returns a boolean if a field has been set. +func (o *FlatPricePerMonthActorPricingInfo) HasNotifiedAboutFutureChangeAt() bool { + if o != nil && !IsNil(o.NotifiedAboutFutureChangeAt) { + return true + } + + return false +} + +// SetNotifiedAboutFutureChangeAt gets a reference to the given time.Time and assigns it to the NotifiedAboutFutureChangeAt field. +func (o *FlatPricePerMonthActorPricingInfo) SetNotifiedAboutFutureChangeAt(v time.Time) { + o.NotifiedAboutFutureChangeAt = &v +} + +// GetNotifiedAboutChangeAt returns the NotifiedAboutChangeAt field value if set, zero value otherwise. +func (o *FlatPricePerMonthActorPricingInfo) GetNotifiedAboutChangeAt() time.Time { + if o == nil || IsNil(o.NotifiedAboutChangeAt) { + var ret time.Time + return ret + } + return *o.NotifiedAboutChangeAt +} + +// GetNotifiedAboutChangeAtOk returns a tuple with the NotifiedAboutChangeAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FlatPricePerMonthActorPricingInfo) GetNotifiedAboutChangeAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.NotifiedAboutChangeAt) { + return nil, false + } + return o.NotifiedAboutChangeAt, true +} + +// HasNotifiedAboutChangeAt returns a boolean if a field has been set. +func (o *FlatPricePerMonthActorPricingInfo) HasNotifiedAboutChangeAt() bool { + if o != nil && !IsNil(o.NotifiedAboutChangeAt) { + return true + } + + return false +} + +// SetNotifiedAboutChangeAt gets a reference to the given time.Time and assigns it to the NotifiedAboutChangeAt field. +func (o *FlatPricePerMonthActorPricingInfo) SetNotifiedAboutChangeAt(v time.Time) { + o.NotifiedAboutChangeAt = &v +} + +// GetReasonForChange returns the ReasonForChange field value if set, zero value otherwise. +func (o *FlatPricePerMonthActorPricingInfo) GetReasonForChange() string { + if o == nil || IsNil(o.ReasonForChange) { + var ret string + return ret + } + return *o.ReasonForChange +} + +// GetReasonForChangeOk returns a tuple with the ReasonForChange field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FlatPricePerMonthActorPricingInfo) GetReasonForChangeOk() (*string, bool) { + if o == nil || IsNil(o.ReasonForChange) { + return nil, false + } + return o.ReasonForChange, true +} + +// HasReasonForChange returns a boolean if a field has been set. +func (o *FlatPricePerMonthActorPricingInfo) HasReasonForChange() bool { + if o != nil && !IsNil(o.ReasonForChange) { + return true + } + + return false +} + +// SetReasonForChange gets a reference to the given string and assigns it to the ReasonForChange field. +func (o *FlatPricePerMonthActorPricingInfo) SetReasonForChange(v string) { + o.ReasonForChange = &v +} + +// GetIsPriceChangeNotificationSuppressed returns the IsPriceChangeNotificationSuppressed field value if set, zero value otherwise. +func (o *FlatPricePerMonthActorPricingInfo) GetIsPriceChangeNotificationSuppressed() bool { + if o == nil || IsNil(o.IsPriceChangeNotificationSuppressed) { + var ret bool + return ret + } + return *o.IsPriceChangeNotificationSuppressed +} + +// GetIsPriceChangeNotificationSuppressedOk returns a tuple with the IsPriceChangeNotificationSuppressed field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FlatPricePerMonthActorPricingInfo) GetIsPriceChangeNotificationSuppressedOk() (*bool, bool) { + if o == nil || IsNil(o.IsPriceChangeNotificationSuppressed) { + return nil, false + } + return o.IsPriceChangeNotificationSuppressed, true +} + +// HasIsPriceChangeNotificationSuppressed returns a boolean if a field has been set. +func (o *FlatPricePerMonthActorPricingInfo) HasIsPriceChangeNotificationSuppressed() bool { + if o != nil && !IsNil(o.IsPriceChangeNotificationSuppressed) { + return true + } + + return false +} + +// SetIsPriceChangeNotificationSuppressed gets a reference to the given bool and assigns it to the IsPriceChangeNotificationSuppressed field. +func (o *FlatPricePerMonthActorPricingInfo) SetIsPriceChangeNotificationSuppressed(v bool) { + o.IsPriceChangeNotificationSuppressed = &v +} + +// GetForceContainsSignificantPriceChange returns the ForceContainsSignificantPriceChange field value if set, zero value otherwise. +func (o *FlatPricePerMonthActorPricingInfo) GetForceContainsSignificantPriceChange() bool { + if o == nil || IsNil(o.ForceContainsSignificantPriceChange) { + var ret bool + return ret + } + return *o.ForceContainsSignificantPriceChange +} + +// GetForceContainsSignificantPriceChangeOk returns a tuple with the ForceContainsSignificantPriceChange field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FlatPricePerMonthActorPricingInfo) GetForceContainsSignificantPriceChangeOk() (*bool, bool) { + if o == nil || IsNil(o.ForceContainsSignificantPriceChange) { + return nil, false + } + return o.ForceContainsSignificantPriceChange, true +} + +// HasForceContainsSignificantPriceChange returns a boolean if a field has been set. +func (o *FlatPricePerMonthActorPricingInfo) HasForceContainsSignificantPriceChange() bool { + if o != nil && !IsNil(o.ForceContainsSignificantPriceChange) { + return true + } + + return false +} + +// SetForceContainsSignificantPriceChange gets a reference to the given bool and assigns it to the ForceContainsSignificantPriceChange field. +func (o *FlatPricePerMonthActorPricingInfo) SetForceContainsSignificantPriceChange(v bool) { + o.ForceContainsSignificantPriceChange = &v +} + +// GetPricingModel returns the PricingModel field value +func (o *FlatPricePerMonthActorPricingInfo) GetPricingModel() string { + if o == nil { + var ret string + return ret + } + + return o.PricingModel +} + +// GetPricingModelOk returns a tuple with the PricingModel field value +// and a boolean to check if the value has been set. +func (o *FlatPricePerMonthActorPricingInfo) GetPricingModelOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.PricingModel, true +} + +// SetPricingModel sets field value +func (o *FlatPricePerMonthActorPricingInfo) SetPricingModel(v string) { + o.PricingModel = v +} + +// GetTrialMinutes returns the TrialMinutes field value +func (o *FlatPricePerMonthActorPricingInfo) GetTrialMinutes() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.TrialMinutes +} + +// GetTrialMinutesOk returns a tuple with the TrialMinutes field value +// and a boolean to check if the value has been set. +func (o *FlatPricePerMonthActorPricingInfo) GetTrialMinutesOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.TrialMinutes, true +} + +// SetTrialMinutes sets field value +func (o *FlatPricePerMonthActorPricingInfo) SetTrialMinutes(v int32) { + o.TrialMinutes = v +} + +// GetPricePerUnitUsd returns the PricePerUnitUsd field value +func (o *FlatPricePerMonthActorPricingInfo) GetPricePerUnitUsd() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.PricePerUnitUsd +} + +// GetPricePerUnitUsdOk returns a tuple with the PricePerUnitUsd field value +// and a boolean to check if the value has been set. +func (o *FlatPricePerMonthActorPricingInfo) GetPricePerUnitUsdOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.PricePerUnitUsd, true +} + +// SetPricePerUnitUsd sets field value +func (o *FlatPricePerMonthActorPricingInfo) SetPricePerUnitUsd(v float32) { + o.PricePerUnitUsd = v +} + +func (o FlatPricePerMonthActorPricingInfo) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o FlatPricePerMonthActorPricingInfo) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["apifyMarginPercentage"] = o.ApifyMarginPercentage + toSerialize["createdAt"] = o.CreatedAt + toSerialize["startedAt"] = o.StartedAt + if !IsNil(o.NotifiedAboutFutureChangeAt) { + toSerialize["notifiedAboutFutureChangeAt"] = o.NotifiedAboutFutureChangeAt + } + if !IsNil(o.NotifiedAboutChangeAt) { + toSerialize["notifiedAboutChangeAt"] = o.NotifiedAboutChangeAt + } + if !IsNil(o.ReasonForChange) { + toSerialize["reasonForChange"] = o.ReasonForChange + } + if !IsNil(o.IsPriceChangeNotificationSuppressed) { + toSerialize["isPriceChangeNotificationSuppressed"] = o.IsPriceChangeNotificationSuppressed + } + if !IsNil(o.ForceContainsSignificantPriceChange) { + toSerialize["forceContainsSignificantPriceChange"] = o.ForceContainsSignificantPriceChange + } + toSerialize["pricingModel"] = o.PricingModel + toSerialize["trialMinutes"] = o.TrialMinutes + toSerialize["pricePerUnitUsd"] = o.PricePerUnitUsd + return toSerialize, nil +} + +func (o *FlatPricePerMonthActorPricingInfo) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "apifyMarginPercentage", + "createdAt", + "startedAt", + "pricingModel", + "trialMinutes", + "pricePerUnitUsd", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varFlatPricePerMonthActorPricingInfo := _FlatPricePerMonthActorPricingInfo{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varFlatPricePerMonthActorPricingInfo) + + if err != nil { + return err + } + + *o = FlatPricePerMonthActorPricingInfo(varFlatPricePerMonthActorPricingInfo) + + return err +} + +type NullableFlatPricePerMonthActorPricingInfo struct { + value *FlatPricePerMonthActorPricingInfo + isSet bool +} + +func (v NullableFlatPricePerMonthActorPricingInfo) Get() *FlatPricePerMonthActorPricingInfo { + return v.value +} + +func (v *NullableFlatPricePerMonthActorPricingInfo) Set(val *FlatPricePerMonthActorPricingInfo) { + v.value = val + v.isSet = true +} + +func (v NullableFlatPricePerMonthActorPricingInfo) IsSet() bool { + return v.isSet +} + +func (v *NullableFlatPricePerMonthActorPricingInfo) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFlatPricePerMonthActorPricingInfo(val *FlatPricePerMonthActorPricingInfo) *NullableFlatPricePerMonthActorPricingInfo { + return &NullableFlatPricePerMonthActorPricingInfo{value: val, isSet: true} +} + +func (v NullableFlatPricePerMonthActorPricingInfo) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFlatPricePerMonthActorPricingInfo) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_free_actor_pricing_info.go b/model_free_actor_pricing_info.go new file mode 100644 index 0000000..3d19001 --- /dev/null +++ b/model_free_actor_pricing_info.go @@ -0,0 +1,426 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" + "time" + "bytes" + "fmt" +) + +// checks if the FreeActorPricingInfo type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &FreeActorPricingInfo{} + +// FreeActorPricingInfo struct for FreeActorPricingInfo +type FreeActorPricingInfo struct { + // In [0, 1], fraction of pricePerUnitUsd that goes to Apify + ApifyMarginPercentage float32 `json:"apifyMarginPercentage"` + // When this pricing info record has been created + CreatedAt time.Time `json:"createdAt"` + // Since when is this pricing info record effective for a given Actor + StartedAt time.Time `json:"startedAt"` + NotifiedAboutFutureChangeAt *time.Time `json:"notifiedAboutFutureChangeAt,omitempty"` + NotifiedAboutChangeAt *time.Time `json:"notifiedAboutChangeAt,omitempty"` + ReasonForChange *string `json:"reasonForChange,omitempty"` + IsPriceChangeNotificationSuppressed *bool `json:"isPriceChangeNotificationSuppressed,omitempty"` + ForceContainsSignificantPriceChange *bool `json:"forceContainsSignificantPriceChange,omitempty"` + PricingModel string `json:"pricingModel"` +} + +type _FreeActorPricingInfo FreeActorPricingInfo + +// NewFreeActorPricingInfo instantiates a new FreeActorPricingInfo object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewFreeActorPricingInfo(apifyMarginPercentage float32, createdAt time.Time, startedAt time.Time, pricingModel string) *FreeActorPricingInfo { + this := FreeActorPricingInfo{} + this.ApifyMarginPercentage = apifyMarginPercentage + this.CreatedAt = createdAt + this.StartedAt = startedAt + this.PricingModel = pricingModel + return &this +} + +// NewFreeActorPricingInfoWithDefaults instantiates a new FreeActorPricingInfo object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewFreeActorPricingInfoWithDefaults() *FreeActorPricingInfo { + this := FreeActorPricingInfo{} + return &this +} + +// GetApifyMarginPercentage returns the ApifyMarginPercentage field value +func (o *FreeActorPricingInfo) GetApifyMarginPercentage() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.ApifyMarginPercentage +} + +// GetApifyMarginPercentageOk returns a tuple with the ApifyMarginPercentage field value +// and a boolean to check if the value has been set. +func (o *FreeActorPricingInfo) GetApifyMarginPercentageOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.ApifyMarginPercentage, true +} + +// SetApifyMarginPercentage sets field value +func (o *FreeActorPricingInfo) SetApifyMarginPercentage(v float32) { + o.ApifyMarginPercentage = v +} + +// GetCreatedAt returns the CreatedAt field value +func (o *FreeActorPricingInfo) GetCreatedAt() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value +// and a boolean to check if the value has been set. +func (o *FreeActorPricingInfo) GetCreatedAtOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.CreatedAt, true +} + +// SetCreatedAt sets field value +func (o *FreeActorPricingInfo) SetCreatedAt(v time.Time) { + o.CreatedAt = v +} + +// GetStartedAt returns the StartedAt field value +func (o *FreeActorPricingInfo) GetStartedAt() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.StartedAt +} + +// GetStartedAtOk returns a tuple with the StartedAt field value +// and a boolean to check if the value has been set. +func (o *FreeActorPricingInfo) GetStartedAtOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.StartedAt, true +} + +// SetStartedAt sets field value +func (o *FreeActorPricingInfo) SetStartedAt(v time.Time) { + o.StartedAt = v +} + +// GetNotifiedAboutFutureChangeAt returns the NotifiedAboutFutureChangeAt field value if set, zero value otherwise. +func (o *FreeActorPricingInfo) GetNotifiedAboutFutureChangeAt() time.Time { + if o == nil || IsNil(o.NotifiedAboutFutureChangeAt) { + var ret time.Time + return ret + } + return *o.NotifiedAboutFutureChangeAt +} + +// GetNotifiedAboutFutureChangeAtOk returns a tuple with the NotifiedAboutFutureChangeAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FreeActorPricingInfo) GetNotifiedAboutFutureChangeAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.NotifiedAboutFutureChangeAt) { + return nil, false + } + return o.NotifiedAboutFutureChangeAt, true +} + +// HasNotifiedAboutFutureChangeAt returns a boolean if a field has been set. +func (o *FreeActorPricingInfo) HasNotifiedAboutFutureChangeAt() bool { + if o != nil && !IsNil(o.NotifiedAboutFutureChangeAt) { + return true + } + + return false +} + +// SetNotifiedAboutFutureChangeAt gets a reference to the given time.Time and assigns it to the NotifiedAboutFutureChangeAt field. +func (o *FreeActorPricingInfo) SetNotifiedAboutFutureChangeAt(v time.Time) { + o.NotifiedAboutFutureChangeAt = &v +} + +// GetNotifiedAboutChangeAt returns the NotifiedAboutChangeAt field value if set, zero value otherwise. +func (o *FreeActorPricingInfo) GetNotifiedAboutChangeAt() time.Time { + if o == nil || IsNil(o.NotifiedAboutChangeAt) { + var ret time.Time + return ret + } + return *o.NotifiedAboutChangeAt +} + +// GetNotifiedAboutChangeAtOk returns a tuple with the NotifiedAboutChangeAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FreeActorPricingInfo) GetNotifiedAboutChangeAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.NotifiedAboutChangeAt) { + return nil, false + } + return o.NotifiedAboutChangeAt, true +} + +// HasNotifiedAboutChangeAt returns a boolean if a field has been set. +func (o *FreeActorPricingInfo) HasNotifiedAboutChangeAt() bool { + if o != nil && !IsNil(o.NotifiedAboutChangeAt) { + return true + } + + return false +} + +// SetNotifiedAboutChangeAt gets a reference to the given time.Time and assigns it to the NotifiedAboutChangeAt field. +func (o *FreeActorPricingInfo) SetNotifiedAboutChangeAt(v time.Time) { + o.NotifiedAboutChangeAt = &v +} + +// GetReasonForChange returns the ReasonForChange field value if set, zero value otherwise. +func (o *FreeActorPricingInfo) GetReasonForChange() string { + if o == nil || IsNil(o.ReasonForChange) { + var ret string + return ret + } + return *o.ReasonForChange +} + +// GetReasonForChangeOk returns a tuple with the ReasonForChange field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FreeActorPricingInfo) GetReasonForChangeOk() (*string, bool) { + if o == nil || IsNil(o.ReasonForChange) { + return nil, false + } + return o.ReasonForChange, true +} + +// HasReasonForChange returns a boolean if a field has been set. +func (o *FreeActorPricingInfo) HasReasonForChange() bool { + if o != nil && !IsNil(o.ReasonForChange) { + return true + } + + return false +} + +// SetReasonForChange gets a reference to the given string and assigns it to the ReasonForChange field. +func (o *FreeActorPricingInfo) SetReasonForChange(v string) { + o.ReasonForChange = &v +} + +// GetIsPriceChangeNotificationSuppressed returns the IsPriceChangeNotificationSuppressed field value if set, zero value otherwise. +func (o *FreeActorPricingInfo) GetIsPriceChangeNotificationSuppressed() bool { + if o == nil || IsNil(o.IsPriceChangeNotificationSuppressed) { + var ret bool + return ret + } + return *o.IsPriceChangeNotificationSuppressed +} + +// GetIsPriceChangeNotificationSuppressedOk returns a tuple with the IsPriceChangeNotificationSuppressed field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FreeActorPricingInfo) GetIsPriceChangeNotificationSuppressedOk() (*bool, bool) { + if o == nil || IsNil(o.IsPriceChangeNotificationSuppressed) { + return nil, false + } + return o.IsPriceChangeNotificationSuppressed, true +} + +// HasIsPriceChangeNotificationSuppressed returns a boolean if a field has been set. +func (o *FreeActorPricingInfo) HasIsPriceChangeNotificationSuppressed() bool { + if o != nil && !IsNil(o.IsPriceChangeNotificationSuppressed) { + return true + } + + return false +} + +// SetIsPriceChangeNotificationSuppressed gets a reference to the given bool and assigns it to the IsPriceChangeNotificationSuppressed field. +func (o *FreeActorPricingInfo) SetIsPriceChangeNotificationSuppressed(v bool) { + o.IsPriceChangeNotificationSuppressed = &v +} + +// GetForceContainsSignificantPriceChange returns the ForceContainsSignificantPriceChange field value if set, zero value otherwise. +func (o *FreeActorPricingInfo) GetForceContainsSignificantPriceChange() bool { + if o == nil || IsNil(o.ForceContainsSignificantPriceChange) { + var ret bool + return ret + } + return *o.ForceContainsSignificantPriceChange +} + +// GetForceContainsSignificantPriceChangeOk returns a tuple with the ForceContainsSignificantPriceChange field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FreeActorPricingInfo) GetForceContainsSignificantPriceChangeOk() (*bool, bool) { + if o == nil || IsNil(o.ForceContainsSignificantPriceChange) { + return nil, false + } + return o.ForceContainsSignificantPriceChange, true +} + +// HasForceContainsSignificantPriceChange returns a boolean if a field has been set. +func (o *FreeActorPricingInfo) HasForceContainsSignificantPriceChange() bool { + if o != nil && !IsNil(o.ForceContainsSignificantPriceChange) { + return true + } + + return false +} + +// SetForceContainsSignificantPriceChange gets a reference to the given bool and assigns it to the ForceContainsSignificantPriceChange field. +func (o *FreeActorPricingInfo) SetForceContainsSignificantPriceChange(v bool) { + o.ForceContainsSignificantPriceChange = &v +} + +// GetPricingModel returns the PricingModel field value +func (o *FreeActorPricingInfo) GetPricingModel() string { + if o == nil { + var ret string + return ret + } + + return o.PricingModel +} + +// GetPricingModelOk returns a tuple with the PricingModel field value +// and a boolean to check if the value has been set. +func (o *FreeActorPricingInfo) GetPricingModelOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.PricingModel, true +} + +// SetPricingModel sets field value +func (o *FreeActorPricingInfo) SetPricingModel(v string) { + o.PricingModel = v +} + +func (o FreeActorPricingInfo) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o FreeActorPricingInfo) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["apifyMarginPercentage"] = o.ApifyMarginPercentage + toSerialize["createdAt"] = o.CreatedAt + toSerialize["startedAt"] = o.StartedAt + if !IsNil(o.NotifiedAboutFutureChangeAt) { + toSerialize["notifiedAboutFutureChangeAt"] = o.NotifiedAboutFutureChangeAt + } + if !IsNil(o.NotifiedAboutChangeAt) { + toSerialize["notifiedAboutChangeAt"] = o.NotifiedAboutChangeAt + } + if !IsNil(o.ReasonForChange) { + toSerialize["reasonForChange"] = o.ReasonForChange + } + if !IsNil(o.IsPriceChangeNotificationSuppressed) { + toSerialize["isPriceChangeNotificationSuppressed"] = o.IsPriceChangeNotificationSuppressed + } + if !IsNil(o.ForceContainsSignificantPriceChange) { + toSerialize["forceContainsSignificantPriceChange"] = o.ForceContainsSignificantPriceChange + } + toSerialize["pricingModel"] = o.PricingModel + return toSerialize, nil +} + +func (o *FreeActorPricingInfo) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "apifyMarginPercentage", + "createdAt", + "startedAt", + "pricingModel", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varFreeActorPricingInfo := _FreeActorPricingInfo{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varFreeActorPricingInfo) + + if err != nil { + return err + } + + *o = FreeActorPricingInfo(varFreeActorPricingInfo) + + return err +} + +type NullableFreeActorPricingInfo struct { + value *FreeActorPricingInfo + isSet bool +} + +func (v NullableFreeActorPricingInfo) Get() *FreeActorPricingInfo { + return v.value +} + +func (v *NullableFreeActorPricingInfo) Set(val *FreeActorPricingInfo) { + v.value = val + v.isSet = true +} + +func (v NullableFreeActorPricingInfo) IsSet() bool { + return v.isSet +} + +func (v *NullableFreeActorPricingInfo) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFreeActorPricingInfo(val *FreeActorPricingInfo) *NullableFreeActorPricingInfo { + return &NullableFreeActorPricingInfo{value: val, isSet: true} +} + +func (v NullableFreeActorPricingInfo) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFreeActorPricingInfo) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_general_access.go b/model_general_access.go new file mode 100644 index 0000000..60f3e8a --- /dev/null +++ b/model_general_access.go @@ -0,0 +1,115 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" + "fmt" +) + +// GeneralAccess Defines the general access level for the resource. +type GeneralAccess string + +// List of GeneralAccess +const ( + ANYONE_WITH_ID_CAN_READ GeneralAccess = "ANYONE_WITH_ID_CAN_READ" + ANYONE_WITH_NAME_CAN_READ GeneralAccess = "ANYONE_WITH_NAME_CAN_READ" + FOLLOW_USER_SETTING GeneralAccess = "FOLLOW_USER_SETTING" + RESTRICTED GeneralAccess = "RESTRICTED" +) + +// All allowed values of GeneralAccess enum +var AllowedGeneralAccessEnumValues = []GeneralAccess{ + "ANYONE_WITH_ID_CAN_READ", + "ANYONE_WITH_NAME_CAN_READ", + "FOLLOW_USER_SETTING", + "RESTRICTED", +} + +func (v *GeneralAccess) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := GeneralAccess(value) + for _, existing := range AllowedGeneralAccessEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid GeneralAccess", value) +} + +// NewGeneralAccessFromValue returns a pointer to a valid GeneralAccess +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewGeneralAccessFromValue(v string) (*GeneralAccess, error) { + ev := GeneralAccess(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for GeneralAccess: valid values are %v", v, AllowedGeneralAccessEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v GeneralAccess) IsValid() bool { + for _, existing := range AllowedGeneralAccessEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to GeneralAccess value +func (v GeneralAccess) Ptr() *GeneralAccess { + return &v +} + +type NullableGeneralAccess struct { + value *GeneralAccess + isSet bool +} + +func (v NullableGeneralAccess) Get() *GeneralAccess { + return v.value +} + +func (v *NullableGeneralAccess) Set(val *GeneralAccess) { + v.value = val + v.isSet = true +} + +func (v NullableGeneralAccess) IsSet() bool { + return v.isSet +} + +func (v *NullableGeneralAccess) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGeneralAccess(val *GeneralAccess) *NullableGeneralAccess { + return &NullableGeneralAccess{value: val, isSet: true} +} + +func (v NullableGeneralAccess) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGeneralAccess) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + diff --git a/model_head_and_lock_response.go b/model_head_and_lock_response.go new file mode 100644 index 0000000..c1d3fcb --- /dev/null +++ b/model_head_and_lock_response.go @@ -0,0 +1,158 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" + "bytes" + "fmt" +) + +// checks if the HeadAndLockResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &HeadAndLockResponse{} + +// HeadAndLockResponse Response containing locked requests from the request queue head. +type HeadAndLockResponse struct { + Data LockedRequestQueueHead `json:"data"` +} + +type _HeadAndLockResponse HeadAndLockResponse + +// NewHeadAndLockResponse instantiates a new HeadAndLockResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewHeadAndLockResponse(data LockedRequestQueueHead) *HeadAndLockResponse { + this := HeadAndLockResponse{} + this.Data = data + return &this +} + +// NewHeadAndLockResponseWithDefaults instantiates a new HeadAndLockResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewHeadAndLockResponseWithDefaults() *HeadAndLockResponse { + this := HeadAndLockResponse{} + return &this +} + +// GetData returns the Data field value +func (o *HeadAndLockResponse) GetData() LockedRequestQueueHead { + if o == nil { + var ret LockedRequestQueueHead + return ret + } + + return o.Data +} + +// GetDataOk returns a tuple with the Data field value +// and a boolean to check if the value has been set. +func (o *HeadAndLockResponse) GetDataOk() (*LockedRequestQueueHead, bool) { + if o == nil { + return nil, false + } + return &o.Data, true +} + +// SetData sets field value +func (o *HeadAndLockResponse) SetData(v LockedRequestQueueHead) { + o.Data = v +} + +func (o HeadAndLockResponse) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o HeadAndLockResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["data"] = o.Data + return toSerialize, nil +} + +func (o *HeadAndLockResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "data", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varHeadAndLockResponse := _HeadAndLockResponse{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varHeadAndLockResponse) + + if err != nil { + return err + } + + *o = HeadAndLockResponse(varHeadAndLockResponse) + + return err +} + +type NullableHeadAndLockResponse struct { + value *HeadAndLockResponse + isSet bool +} + +func (v NullableHeadAndLockResponse) Get() *HeadAndLockResponse { + return v.value +} + +func (v *NullableHeadAndLockResponse) Set(val *HeadAndLockResponse) { + v.value = val + v.isSet = true +} + +func (v NullableHeadAndLockResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableHeadAndLockResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableHeadAndLockResponse(val *HeadAndLockResponse) *NullableHeadAndLockResponse { + return &NullableHeadAndLockResponse{value: val, isSet: true} +} + +func (v NullableHeadAndLockResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableHeadAndLockResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_head_request.go b/model_head_request.go new file mode 100644 index 0000000..a620907 --- /dev/null +++ b/model_head_request.go @@ -0,0 +1,290 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" + "bytes" + "fmt" +) + +// checks if the HeadRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &HeadRequest{} + +// HeadRequest A request from the request queue head without lock information. +type HeadRequest struct { + // A unique identifier assigned to the request. + Id string `json:"id"` + // A unique key used for request de-duplication. Requests with the same unique key are considered identical. + UniqueKey string `json:"uniqueKey"` + // The URL of the request. + Url string `json:"url"` + Method *HttpMethod `json:"method,omitempty"` + // The number of times this request has been retried. + RetryCount *int32 `json:"retryCount,omitempty"` +} + +type _HeadRequest HeadRequest + +// NewHeadRequest instantiates a new HeadRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewHeadRequest(id string, uniqueKey string, url string) *HeadRequest { + this := HeadRequest{} + this.Id = id + this.UniqueKey = uniqueKey + this.Url = url + return &this +} + +// NewHeadRequestWithDefaults instantiates a new HeadRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewHeadRequestWithDefaults() *HeadRequest { + this := HeadRequest{} + return &this +} + +// GetId returns the Id field value +func (o *HeadRequest) GetId() string { + if o == nil { + var ret string + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *HeadRequest) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *HeadRequest) SetId(v string) { + o.Id = v +} + +// GetUniqueKey returns the UniqueKey field value +func (o *HeadRequest) GetUniqueKey() string { + if o == nil { + var ret string + return ret + } + + return o.UniqueKey +} + +// GetUniqueKeyOk returns a tuple with the UniqueKey field value +// and a boolean to check if the value has been set. +func (o *HeadRequest) GetUniqueKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.UniqueKey, true +} + +// SetUniqueKey sets field value +func (o *HeadRequest) SetUniqueKey(v string) { + o.UniqueKey = v +} + +// GetUrl returns the Url field value +func (o *HeadRequest) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *HeadRequest) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *HeadRequest) SetUrl(v string) { + o.Url = v +} + +// GetMethod returns the Method field value if set, zero value otherwise. +func (o *HeadRequest) GetMethod() HttpMethod { + if o == nil || IsNil(o.Method) { + var ret HttpMethod + return ret + } + return *o.Method +} + +// GetMethodOk returns a tuple with the Method field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *HeadRequest) GetMethodOk() (*HttpMethod, bool) { + if o == nil || IsNil(o.Method) { + return nil, false + } + return o.Method, true +} + +// HasMethod returns a boolean if a field has been set. +func (o *HeadRequest) HasMethod() bool { + if o != nil && !IsNil(o.Method) { + return true + } + + return false +} + +// SetMethod gets a reference to the given HttpMethod and assigns it to the Method field. +func (o *HeadRequest) SetMethod(v HttpMethod) { + o.Method = &v +} + +// GetRetryCount returns the RetryCount field value if set, zero value otherwise. +func (o *HeadRequest) GetRetryCount() int32 { + if o == nil || IsNil(o.RetryCount) { + var ret int32 + return ret + } + return *o.RetryCount +} + +// GetRetryCountOk returns a tuple with the RetryCount field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *HeadRequest) GetRetryCountOk() (*int32, bool) { + if o == nil || IsNil(o.RetryCount) { + return nil, false + } + return o.RetryCount, true +} + +// HasRetryCount returns a boolean if a field has been set. +func (o *HeadRequest) HasRetryCount() bool { + if o != nil && !IsNil(o.RetryCount) { + return true + } + + return false +} + +// SetRetryCount gets a reference to the given int32 and assigns it to the RetryCount field. +func (o *HeadRequest) SetRetryCount(v int32) { + o.RetryCount = &v +} + +func (o HeadRequest) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o HeadRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["uniqueKey"] = o.UniqueKey + toSerialize["url"] = o.Url + if !IsNil(o.Method) { + toSerialize["method"] = o.Method + } + if !IsNil(o.RetryCount) { + toSerialize["retryCount"] = o.RetryCount + } + return toSerialize, nil +} + +func (o *HeadRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "uniqueKey", + "url", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varHeadRequest := _HeadRequest{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varHeadRequest) + + if err != nil { + return err + } + + *o = HeadRequest(varHeadRequest) + + return err +} + +type NullableHeadRequest struct { + value *HeadRequest + isSet bool +} + +func (v NullableHeadRequest) Get() *HeadRequest { + return v.value +} + +func (v *NullableHeadRequest) Set(val *HeadRequest) { + v.value = val + v.isSet = true +} + +func (v NullableHeadRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableHeadRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableHeadRequest(val *HeadRequest) *NullableHeadRequest { + return &NullableHeadRequest{value: val, isSet: true} +} + +func (v NullableHeadRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableHeadRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_head_response.go b/model_head_response.go new file mode 100644 index 0000000..5dedb87 --- /dev/null +++ b/model_head_response.go @@ -0,0 +1,158 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" + "bytes" + "fmt" +) + +// checks if the HeadResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &HeadResponse{} + +// HeadResponse Response containing requests from the request queue head without locking. +type HeadResponse struct { + Data RequestQueueHead `json:"data"` +} + +type _HeadResponse HeadResponse + +// NewHeadResponse instantiates a new HeadResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewHeadResponse(data RequestQueueHead) *HeadResponse { + this := HeadResponse{} + this.Data = data + return &this +} + +// NewHeadResponseWithDefaults instantiates a new HeadResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewHeadResponseWithDefaults() *HeadResponse { + this := HeadResponse{} + return &this +} + +// GetData returns the Data field value +func (o *HeadResponse) GetData() RequestQueueHead { + if o == nil { + var ret RequestQueueHead + return ret + } + + return o.Data +} + +// GetDataOk returns a tuple with the Data field value +// and a boolean to check if the value has been set. +func (o *HeadResponse) GetDataOk() (*RequestQueueHead, bool) { + if o == nil { + return nil, false + } + return &o.Data, true +} + +// SetData sets field value +func (o *HeadResponse) SetData(v RequestQueueHead) { + o.Data = v +} + +func (o HeadResponse) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o HeadResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["data"] = o.Data + return toSerialize, nil +} + +func (o *HeadResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "data", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varHeadResponse := _HeadResponse{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varHeadResponse) + + if err != nil { + return err + } + + *o = HeadResponse(varHeadResponse) + + return err +} + +type NullableHeadResponse struct { + value *HeadResponse + isSet bool +} + +func (v NullableHeadResponse) Get() *HeadResponse { + return v.value +} + +func (v *NullableHeadResponse) Set(val *HeadResponse) { + v.value = val + v.isSet = true +} + +func (v NullableHeadResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableHeadResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableHeadResponse(val *HeadResponse) *NullableHeadResponse { + return &NullableHeadResponse{value: val, isSet: true} +} + +func (v NullableHeadResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableHeadResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_http_method.go b/model_http_method.go new file mode 100644 index 0000000..9243eef --- /dev/null +++ b/model_http_method.go @@ -0,0 +1,125 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" + "fmt" +) + +// HttpMethod the model 'HttpMethod' +type HttpMethod string + +// List of HttpMethod +const ( + GET HttpMethod = "GET" + HEAD HttpMethod = "HEAD" + POST HttpMethod = "POST" + PUT HttpMethod = "PUT" + DELETE HttpMethod = "DELETE" + CONNECT HttpMethod = "CONNECT" + OPTIONS HttpMethod = "OPTIONS" + TRACE HttpMethod = "TRACE" + PATCH HttpMethod = "PATCH" +) + +// All allowed values of HttpMethod enum +var AllowedHttpMethodEnumValues = []HttpMethod{ + "GET", + "HEAD", + "POST", + "PUT", + "DELETE", + "CONNECT", + "OPTIONS", + "TRACE", + "PATCH", +} + +func (v *HttpMethod) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := HttpMethod(value) + for _, existing := range AllowedHttpMethodEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid HttpMethod", value) +} + +// NewHttpMethodFromValue returns a pointer to a valid HttpMethod +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewHttpMethodFromValue(v string) (*HttpMethod, error) { + ev := HttpMethod(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for HttpMethod: valid values are %v", v, AllowedHttpMethodEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v HttpMethod) IsValid() bool { + for _, existing := range AllowedHttpMethodEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to HttpMethod value +func (v HttpMethod) Ptr() *HttpMethod { + return &v +} + +type NullableHttpMethod struct { + value *HttpMethod + isSet bool +} + +func (v NullableHttpMethod) Get() *HttpMethod { + return v.value +} + +func (v *NullableHttpMethod) Set(val *HttpMethod) { + v.value = val + v.isSet = true +} + +func (v NullableHttpMethod) IsSet() bool { + return v.isSet +} + +func (v *NullableHttpMethod) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableHttpMethod(val *HttpMethod) *NullableHttpMethod { + return &NullableHttpMethod{value: val, isSet: true} +} + +func (v NullableHttpMethod) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableHttpMethod) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + diff --git a/model_invalid_item.go b/model_invalid_item.go new file mode 100644 index 0000000..dd0cc92 --- /dev/null +++ b/model_invalid_item.go @@ -0,0 +1,164 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" +) + +// checks if the InvalidItem type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &InvalidItem{} + +// InvalidItem struct for InvalidItem +type InvalidItem struct { + // The position of the invalid item in the array. + ItemPosition *int32 `json:"itemPosition,omitempty"` + // A complete list of AJV validation error objects for the invalid item. + ValidationErrors []ValidationError `json:"validationErrors,omitempty"` +} + +// NewInvalidItem instantiates a new InvalidItem object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewInvalidItem() *InvalidItem { + this := InvalidItem{} + return &this +} + +// NewInvalidItemWithDefaults instantiates a new InvalidItem object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInvalidItemWithDefaults() *InvalidItem { + this := InvalidItem{} + return &this +} + +// GetItemPosition returns the ItemPosition field value if set, zero value otherwise. +func (o *InvalidItem) GetItemPosition() int32 { + if o == nil || IsNil(o.ItemPosition) { + var ret int32 + return ret + } + return *o.ItemPosition +} + +// GetItemPositionOk returns a tuple with the ItemPosition field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InvalidItem) GetItemPositionOk() (*int32, bool) { + if o == nil || IsNil(o.ItemPosition) { + return nil, false + } + return o.ItemPosition, true +} + +// HasItemPosition returns a boolean if a field has been set. +func (o *InvalidItem) HasItemPosition() bool { + if o != nil && !IsNil(o.ItemPosition) { + return true + } + + return false +} + +// SetItemPosition gets a reference to the given int32 and assigns it to the ItemPosition field. +func (o *InvalidItem) SetItemPosition(v int32) { + o.ItemPosition = &v +} + +// GetValidationErrors returns the ValidationErrors field value if set, zero value otherwise. +func (o *InvalidItem) GetValidationErrors() []ValidationError { + if o == nil || IsNil(o.ValidationErrors) { + var ret []ValidationError + return ret + } + return o.ValidationErrors +} + +// GetValidationErrorsOk returns a tuple with the ValidationErrors field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InvalidItem) GetValidationErrorsOk() ([]ValidationError, bool) { + if o == nil || IsNil(o.ValidationErrors) { + return nil, false + } + return o.ValidationErrors, true +} + +// HasValidationErrors returns a boolean if a field has been set. +func (o *InvalidItem) HasValidationErrors() bool { + if o != nil && !IsNil(o.ValidationErrors) { + return true + } + + return false +} + +// SetValidationErrors gets a reference to the given []ValidationError and assigns it to the ValidationErrors field. +func (o *InvalidItem) SetValidationErrors(v []ValidationError) { + o.ValidationErrors = v +} + +func (o InvalidItem) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o InvalidItem) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.ItemPosition) { + toSerialize["itemPosition"] = o.ItemPosition + } + if !IsNil(o.ValidationErrors) { + toSerialize["validationErrors"] = o.ValidationErrors + } + return toSerialize, nil +} + +type NullableInvalidItem struct { + value *InvalidItem + isSet bool +} + +func (v NullableInvalidItem) Get() *InvalidItem { + return v.value +} + +func (v *NullableInvalidItem) Set(val *InvalidItem) { + v.value = val + v.isSet = true +} + +func (v NullableInvalidItem) IsSet() bool { + return v.isSet +} + +func (v *NullableInvalidItem) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInvalidItem(val *InvalidItem) *NullableInvalidItem { + return &NullableInvalidItem{value: val, isSet: true} +} + +func (v NullableInvalidItem) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInvalidItem) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_key_value_store.go b/model_key_value_store.go new file mode 100644 index 0000000..339e95b --- /dev/null +++ b/model_key_value_store.go @@ -0,0 +1,740 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" + "time" + "bytes" + "fmt" +) + +// checks if the KeyValueStore type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &KeyValueStore{} + +// KeyValueStore struct for KeyValueStore +type KeyValueStore struct { + Id string `json:"id"` + Name NullableString `json:"name,omitempty"` + UserId NullableString `json:"userId,omitempty"` + Username NullableString `json:"username,omitempty"` + CreatedAt time.Time `json:"createdAt"` + ModifiedAt time.Time `json:"modifiedAt"` + AccessedAt time.Time `json:"accessedAt"` + ActId NullableString `json:"actId,omitempty"` + ActRunId NullableString `json:"actRunId,omitempty"` + ConsoleUrl *string `json:"consoleUrl,omitempty"` + // A public link to access keys of the key-value store directly. + KeysPublicUrl *string `json:"keysPublicUrl,omitempty"` + // A public link to access records of the key-value store directly. + RecordsPublicUrl *string `json:"recordsPublicUrl,omitempty"` + // Optional JSON schema describing the keys stored in the key-value store. + Schema map[string]interface{} `json:"schema,omitempty"` + // A secret key for generating signed public URLs. It is only provided to clients with WRITE permission for the key-value store. + UrlSigningSecretKey NullableString `json:"urlSigningSecretKey,omitempty"` + GeneralAccess *GeneralAccess `json:"generalAccess,omitempty"` + Stats *KeyValueStoreStats `json:"stats,omitempty"` +} + +type _KeyValueStore KeyValueStore + +// NewKeyValueStore instantiates a new KeyValueStore object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewKeyValueStore(id string, createdAt time.Time, modifiedAt time.Time, accessedAt time.Time) *KeyValueStore { + this := KeyValueStore{} + this.Id = id + this.CreatedAt = createdAt + this.ModifiedAt = modifiedAt + this.AccessedAt = accessedAt + return &this +} + +// NewKeyValueStoreWithDefaults instantiates a new KeyValueStore object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewKeyValueStoreWithDefaults() *KeyValueStore { + this := KeyValueStore{} + return &this +} + +// GetId returns the Id field value +func (o *KeyValueStore) GetId() string { + if o == nil { + var ret string + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *KeyValueStore) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *KeyValueStore) SetId(v string) { + o.Id = v +} + +// GetName returns the Name field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *KeyValueStore) GetName() string { + if o == nil || IsNil(o.Name.Get()) { + var ret string + return ret + } + return *o.Name.Get() +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *KeyValueStore) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Name.Get(), o.Name.IsSet() +} + +// HasName returns a boolean if a field has been set. +func (o *KeyValueStore) HasName() bool { + if o != nil && o.Name.IsSet() { + return true + } + + return false +} + +// SetName gets a reference to the given NullableString and assigns it to the Name field. +func (o *KeyValueStore) SetName(v string) { + o.Name.Set(&v) +} +// SetNameNil sets the value for Name to be an explicit nil +func (o *KeyValueStore) SetNameNil() { + o.Name.Set(nil) +} + +// UnsetName ensures that no value is present for Name, not even an explicit nil +func (o *KeyValueStore) UnsetName() { + o.Name.Unset() +} + +// GetUserId returns the UserId field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *KeyValueStore) GetUserId() string { + if o == nil || IsNil(o.UserId.Get()) { + var ret string + return ret + } + return *o.UserId.Get() +} + +// GetUserIdOk returns a tuple with the UserId field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *KeyValueStore) GetUserIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.UserId.Get(), o.UserId.IsSet() +} + +// HasUserId returns a boolean if a field has been set. +func (o *KeyValueStore) HasUserId() bool { + if o != nil && o.UserId.IsSet() { + return true + } + + return false +} + +// SetUserId gets a reference to the given NullableString and assigns it to the UserId field. +func (o *KeyValueStore) SetUserId(v string) { + o.UserId.Set(&v) +} +// SetUserIdNil sets the value for UserId to be an explicit nil +func (o *KeyValueStore) SetUserIdNil() { + o.UserId.Set(nil) +} + +// UnsetUserId ensures that no value is present for UserId, not even an explicit nil +func (o *KeyValueStore) UnsetUserId() { + o.UserId.Unset() +} + +// GetUsername returns the Username field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *KeyValueStore) GetUsername() string { + if o == nil || IsNil(o.Username.Get()) { + var ret string + return ret + } + return *o.Username.Get() +} + +// GetUsernameOk returns a tuple with the Username field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *KeyValueStore) GetUsernameOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Username.Get(), o.Username.IsSet() +} + +// HasUsername returns a boolean if a field has been set. +func (o *KeyValueStore) HasUsername() bool { + if o != nil && o.Username.IsSet() { + return true + } + + return false +} + +// SetUsername gets a reference to the given NullableString and assigns it to the Username field. +func (o *KeyValueStore) SetUsername(v string) { + o.Username.Set(&v) +} +// SetUsernameNil sets the value for Username to be an explicit nil +func (o *KeyValueStore) SetUsernameNil() { + o.Username.Set(nil) +} + +// UnsetUsername ensures that no value is present for Username, not even an explicit nil +func (o *KeyValueStore) UnsetUsername() { + o.Username.Unset() +} + +// GetCreatedAt returns the CreatedAt field value +func (o *KeyValueStore) GetCreatedAt() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value +// and a boolean to check if the value has been set. +func (o *KeyValueStore) GetCreatedAtOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.CreatedAt, true +} + +// SetCreatedAt sets field value +func (o *KeyValueStore) SetCreatedAt(v time.Time) { + o.CreatedAt = v +} + +// GetModifiedAt returns the ModifiedAt field value +func (o *KeyValueStore) GetModifiedAt() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.ModifiedAt +} + +// GetModifiedAtOk returns a tuple with the ModifiedAt field value +// and a boolean to check if the value has been set. +func (o *KeyValueStore) GetModifiedAtOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.ModifiedAt, true +} + +// SetModifiedAt sets field value +func (o *KeyValueStore) SetModifiedAt(v time.Time) { + o.ModifiedAt = v +} + +// GetAccessedAt returns the AccessedAt field value +func (o *KeyValueStore) GetAccessedAt() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.AccessedAt +} + +// GetAccessedAtOk returns a tuple with the AccessedAt field value +// and a boolean to check if the value has been set. +func (o *KeyValueStore) GetAccessedAtOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.AccessedAt, true +} + +// SetAccessedAt sets field value +func (o *KeyValueStore) SetAccessedAt(v time.Time) { + o.AccessedAt = v +} + +// GetActId returns the ActId field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *KeyValueStore) GetActId() string { + if o == nil || IsNil(o.ActId.Get()) { + var ret string + return ret + } + return *o.ActId.Get() +} + +// GetActIdOk returns a tuple with the ActId field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *KeyValueStore) GetActIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.ActId.Get(), o.ActId.IsSet() +} + +// HasActId returns a boolean if a field has been set. +func (o *KeyValueStore) HasActId() bool { + if o != nil && o.ActId.IsSet() { + return true + } + + return false +} + +// SetActId gets a reference to the given NullableString and assigns it to the ActId field. +func (o *KeyValueStore) SetActId(v string) { + o.ActId.Set(&v) +} +// SetActIdNil sets the value for ActId to be an explicit nil +func (o *KeyValueStore) SetActIdNil() { + o.ActId.Set(nil) +} + +// UnsetActId ensures that no value is present for ActId, not even an explicit nil +func (o *KeyValueStore) UnsetActId() { + o.ActId.Unset() +} + +// GetActRunId returns the ActRunId field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *KeyValueStore) GetActRunId() string { + if o == nil || IsNil(o.ActRunId.Get()) { + var ret string + return ret + } + return *o.ActRunId.Get() +} + +// GetActRunIdOk returns a tuple with the ActRunId field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *KeyValueStore) GetActRunIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.ActRunId.Get(), o.ActRunId.IsSet() +} + +// HasActRunId returns a boolean if a field has been set. +func (o *KeyValueStore) HasActRunId() bool { + if o != nil && o.ActRunId.IsSet() { + return true + } + + return false +} + +// SetActRunId gets a reference to the given NullableString and assigns it to the ActRunId field. +func (o *KeyValueStore) SetActRunId(v string) { + o.ActRunId.Set(&v) +} +// SetActRunIdNil sets the value for ActRunId to be an explicit nil +func (o *KeyValueStore) SetActRunIdNil() { + o.ActRunId.Set(nil) +} + +// UnsetActRunId ensures that no value is present for ActRunId, not even an explicit nil +func (o *KeyValueStore) UnsetActRunId() { + o.ActRunId.Unset() +} + +// GetConsoleUrl returns the ConsoleUrl field value if set, zero value otherwise. +func (o *KeyValueStore) GetConsoleUrl() string { + if o == nil || IsNil(o.ConsoleUrl) { + var ret string + return ret + } + return *o.ConsoleUrl +} + +// GetConsoleUrlOk returns a tuple with the ConsoleUrl field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *KeyValueStore) GetConsoleUrlOk() (*string, bool) { + if o == nil || IsNil(o.ConsoleUrl) { + return nil, false + } + return o.ConsoleUrl, true +} + +// HasConsoleUrl returns a boolean if a field has been set. +func (o *KeyValueStore) HasConsoleUrl() bool { + if o != nil && !IsNil(o.ConsoleUrl) { + return true + } + + return false +} + +// SetConsoleUrl gets a reference to the given string and assigns it to the ConsoleUrl field. +func (o *KeyValueStore) SetConsoleUrl(v string) { + o.ConsoleUrl = &v +} + +// GetKeysPublicUrl returns the KeysPublicUrl field value if set, zero value otherwise. +func (o *KeyValueStore) GetKeysPublicUrl() string { + if o == nil || IsNil(o.KeysPublicUrl) { + var ret string + return ret + } + return *o.KeysPublicUrl +} + +// GetKeysPublicUrlOk returns a tuple with the KeysPublicUrl field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *KeyValueStore) GetKeysPublicUrlOk() (*string, bool) { + if o == nil || IsNil(o.KeysPublicUrl) { + return nil, false + } + return o.KeysPublicUrl, true +} + +// HasKeysPublicUrl returns a boolean if a field has been set. +func (o *KeyValueStore) HasKeysPublicUrl() bool { + if o != nil && !IsNil(o.KeysPublicUrl) { + return true + } + + return false +} + +// SetKeysPublicUrl gets a reference to the given string and assigns it to the KeysPublicUrl field. +func (o *KeyValueStore) SetKeysPublicUrl(v string) { + o.KeysPublicUrl = &v +} + +// GetRecordsPublicUrl returns the RecordsPublicUrl field value if set, zero value otherwise. +func (o *KeyValueStore) GetRecordsPublicUrl() string { + if o == nil || IsNil(o.RecordsPublicUrl) { + var ret string + return ret + } + return *o.RecordsPublicUrl +} + +// GetRecordsPublicUrlOk returns a tuple with the RecordsPublicUrl field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *KeyValueStore) GetRecordsPublicUrlOk() (*string, bool) { + if o == nil || IsNil(o.RecordsPublicUrl) { + return nil, false + } + return o.RecordsPublicUrl, true +} + +// HasRecordsPublicUrl returns a boolean if a field has been set. +func (o *KeyValueStore) HasRecordsPublicUrl() bool { + if o != nil && !IsNil(o.RecordsPublicUrl) { + return true + } + + return false +} + +// SetRecordsPublicUrl gets a reference to the given string and assigns it to the RecordsPublicUrl field. +func (o *KeyValueStore) SetRecordsPublicUrl(v string) { + o.RecordsPublicUrl = &v +} + +// GetSchema returns the Schema field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *KeyValueStore) GetSchema() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + return o.Schema +} + +// GetSchemaOk returns a tuple with the Schema field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *KeyValueStore) GetSchemaOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Schema) { + return map[string]interface{}{}, false + } + return o.Schema, true +} + +// HasSchema returns a boolean if a field has been set. +func (o *KeyValueStore) HasSchema() bool { + if o != nil && !IsNil(o.Schema) { + return true + } + + return false +} + +// SetSchema gets a reference to the given map[string]interface{} and assigns it to the Schema field. +func (o *KeyValueStore) SetSchema(v map[string]interface{}) { + o.Schema = v +} + +// GetUrlSigningSecretKey returns the UrlSigningSecretKey field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *KeyValueStore) GetUrlSigningSecretKey() string { + if o == nil || IsNil(o.UrlSigningSecretKey.Get()) { + var ret string + return ret + } + return *o.UrlSigningSecretKey.Get() +} + +// GetUrlSigningSecretKeyOk returns a tuple with the UrlSigningSecretKey field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *KeyValueStore) GetUrlSigningSecretKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.UrlSigningSecretKey.Get(), o.UrlSigningSecretKey.IsSet() +} + +// HasUrlSigningSecretKey returns a boolean if a field has been set. +func (o *KeyValueStore) HasUrlSigningSecretKey() bool { + if o != nil && o.UrlSigningSecretKey.IsSet() { + return true + } + + return false +} + +// SetUrlSigningSecretKey gets a reference to the given NullableString and assigns it to the UrlSigningSecretKey field. +func (o *KeyValueStore) SetUrlSigningSecretKey(v string) { + o.UrlSigningSecretKey.Set(&v) +} +// SetUrlSigningSecretKeyNil sets the value for UrlSigningSecretKey to be an explicit nil +func (o *KeyValueStore) SetUrlSigningSecretKeyNil() { + o.UrlSigningSecretKey.Set(nil) +} + +// UnsetUrlSigningSecretKey ensures that no value is present for UrlSigningSecretKey, not even an explicit nil +func (o *KeyValueStore) UnsetUrlSigningSecretKey() { + o.UrlSigningSecretKey.Unset() +} + +// GetGeneralAccess returns the GeneralAccess field value if set, zero value otherwise. +func (o *KeyValueStore) GetGeneralAccess() GeneralAccess { + if o == nil || IsNil(o.GeneralAccess) { + var ret GeneralAccess + return ret + } + return *o.GeneralAccess +} + +// GetGeneralAccessOk returns a tuple with the GeneralAccess field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *KeyValueStore) GetGeneralAccessOk() (*GeneralAccess, bool) { + if o == nil || IsNil(o.GeneralAccess) { + return nil, false + } + return o.GeneralAccess, true +} + +// HasGeneralAccess returns a boolean if a field has been set. +func (o *KeyValueStore) HasGeneralAccess() bool { + if o != nil && !IsNil(o.GeneralAccess) { + return true + } + + return false +} + +// SetGeneralAccess gets a reference to the given GeneralAccess and assigns it to the GeneralAccess field. +func (o *KeyValueStore) SetGeneralAccess(v GeneralAccess) { + o.GeneralAccess = &v +} + +// GetStats returns the Stats field value if set, zero value otherwise. +func (o *KeyValueStore) GetStats() KeyValueStoreStats { + if o == nil || IsNil(o.Stats) { + var ret KeyValueStoreStats + return ret + } + return *o.Stats +} + +// GetStatsOk returns a tuple with the Stats field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *KeyValueStore) GetStatsOk() (*KeyValueStoreStats, bool) { + if o == nil || IsNil(o.Stats) { + return nil, false + } + return o.Stats, true +} + +// HasStats returns a boolean if a field has been set. +func (o *KeyValueStore) HasStats() bool { + if o != nil && !IsNil(o.Stats) { + return true + } + + return false +} + +// SetStats gets a reference to the given KeyValueStoreStats and assigns it to the Stats field. +func (o *KeyValueStore) SetStats(v KeyValueStoreStats) { + o.Stats = &v +} + +func (o KeyValueStore) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o KeyValueStore) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + if o.Name.IsSet() { + toSerialize["name"] = o.Name.Get() + } + if o.UserId.IsSet() { + toSerialize["userId"] = o.UserId.Get() + } + if o.Username.IsSet() { + toSerialize["username"] = o.Username.Get() + } + toSerialize["createdAt"] = o.CreatedAt + toSerialize["modifiedAt"] = o.ModifiedAt + toSerialize["accessedAt"] = o.AccessedAt + if o.ActId.IsSet() { + toSerialize["actId"] = o.ActId.Get() + } + if o.ActRunId.IsSet() { + toSerialize["actRunId"] = o.ActRunId.Get() + } + if !IsNil(o.ConsoleUrl) { + toSerialize["consoleUrl"] = o.ConsoleUrl + } + if !IsNil(o.KeysPublicUrl) { + toSerialize["keysPublicUrl"] = o.KeysPublicUrl + } + if !IsNil(o.RecordsPublicUrl) { + toSerialize["recordsPublicUrl"] = o.RecordsPublicUrl + } + if o.Schema != nil { + toSerialize["schema"] = o.Schema + } + if o.UrlSigningSecretKey.IsSet() { + toSerialize["urlSigningSecretKey"] = o.UrlSigningSecretKey.Get() + } + if !IsNil(o.GeneralAccess) { + toSerialize["generalAccess"] = o.GeneralAccess + } + if !IsNil(o.Stats) { + toSerialize["stats"] = o.Stats + } + return toSerialize, nil +} + +func (o *KeyValueStore) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "createdAt", + "modifiedAt", + "accessedAt", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varKeyValueStore := _KeyValueStore{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varKeyValueStore) + + if err != nil { + return err + } + + *o = KeyValueStore(varKeyValueStore) + + return err +} + +type NullableKeyValueStore struct { + value *KeyValueStore + isSet bool +} + +func (v NullableKeyValueStore) Get() *KeyValueStore { + return v.value +} + +func (v *NullableKeyValueStore) Set(val *KeyValueStore) { + v.value = val + v.isSet = true +} + +func (v NullableKeyValueStore) IsSet() bool { + return v.isSet +} + +func (v *NullableKeyValueStore) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableKeyValueStore(val *KeyValueStore) *NullableKeyValueStore { + return &NullableKeyValueStore{value: val, isSet: true} +} + +func (v NullableKeyValueStore) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableKeyValueStore) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_key_value_store_key.go b/model_key_value_store_key.go new file mode 100644 index 0000000..52193b4 --- /dev/null +++ b/model_key_value_store_key.go @@ -0,0 +1,215 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" + "bytes" + "fmt" +) + +// checks if the KeyValueStoreKey type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &KeyValueStoreKey{} + +// KeyValueStoreKey struct for KeyValueStoreKey +type KeyValueStoreKey struct { + Key string `json:"key"` + Size int32 `json:"size"` + // A public link to access this record directly. + RecordPublicUrl string `json:"recordPublicUrl"` +} + +type _KeyValueStoreKey KeyValueStoreKey + +// NewKeyValueStoreKey instantiates a new KeyValueStoreKey object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewKeyValueStoreKey(key string, size int32, recordPublicUrl string) *KeyValueStoreKey { + this := KeyValueStoreKey{} + this.Key = key + this.Size = size + this.RecordPublicUrl = recordPublicUrl + return &this +} + +// NewKeyValueStoreKeyWithDefaults instantiates a new KeyValueStoreKey object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewKeyValueStoreKeyWithDefaults() *KeyValueStoreKey { + this := KeyValueStoreKey{} + return &this +} + +// GetKey returns the Key field value +func (o *KeyValueStoreKey) GetKey() string { + if o == nil { + var ret string + return ret + } + + return o.Key +} + +// GetKeyOk returns a tuple with the Key field value +// and a boolean to check if the value has been set. +func (o *KeyValueStoreKey) GetKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Key, true +} + +// SetKey sets field value +func (o *KeyValueStoreKey) SetKey(v string) { + o.Key = v +} + +// GetSize returns the Size field value +func (o *KeyValueStoreKey) GetSize() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Size +} + +// GetSizeOk returns a tuple with the Size field value +// and a boolean to check if the value has been set. +func (o *KeyValueStoreKey) GetSizeOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Size, true +} + +// SetSize sets field value +func (o *KeyValueStoreKey) SetSize(v int32) { + o.Size = v +} + +// GetRecordPublicUrl returns the RecordPublicUrl field value +func (o *KeyValueStoreKey) GetRecordPublicUrl() string { + if o == nil { + var ret string + return ret + } + + return o.RecordPublicUrl +} + +// GetRecordPublicUrlOk returns a tuple with the RecordPublicUrl field value +// and a boolean to check if the value has been set. +func (o *KeyValueStoreKey) GetRecordPublicUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.RecordPublicUrl, true +} + +// SetRecordPublicUrl sets field value +func (o *KeyValueStoreKey) SetRecordPublicUrl(v string) { + o.RecordPublicUrl = v +} + +func (o KeyValueStoreKey) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o KeyValueStoreKey) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["key"] = o.Key + toSerialize["size"] = o.Size + toSerialize["recordPublicUrl"] = o.RecordPublicUrl + return toSerialize, nil +} + +func (o *KeyValueStoreKey) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "key", + "size", + "recordPublicUrl", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varKeyValueStoreKey := _KeyValueStoreKey{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varKeyValueStoreKey) + + if err != nil { + return err + } + + *o = KeyValueStoreKey(varKeyValueStoreKey) + + return err +} + +type NullableKeyValueStoreKey struct { + value *KeyValueStoreKey + isSet bool +} + +func (v NullableKeyValueStoreKey) Get() *KeyValueStoreKey { + return v.value +} + +func (v *NullableKeyValueStoreKey) Set(val *KeyValueStoreKey) { + v.value = val + v.isSet = true +} + +func (v NullableKeyValueStoreKey) IsSet() bool { + return v.isSet +} + +func (v *NullableKeyValueStoreKey) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableKeyValueStoreKey(val *KeyValueStoreKey) *NullableKeyValueStoreKey { + return &NullableKeyValueStoreKey{value: val, isSet: true} +} + +func (v NullableKeyValueStoreKey) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableKeyValueStoreKey) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_key_value_store_response.go b/model_key_value_store_response.go new file mode 100644 index 0000000..252dbb3 --- /dev/null +++ b/model_key_value_store_response.go @@ -0,0 +1,158 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" + "bytes" + "fmt" +) + +// checks if the KeyValueStoreResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &KeyValueStoreResponse{} + +// KeyValueStoreResponse Response containing key-value store data. +type KeyValueStoreResponse struct { + Data KeyValueStore `json:"data"` +} + +type _KeyValueStoreResponse KeyValueStoreResponse + +// NewKeyValueStoreResponse instantiates a new KeyValueStoreResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewKeyValueStoreResponse(data KeyValueStore) *KeyValueStoreResponse { + this := KeyValueStoreResponse{} + this.Data = data + return &this +} + +// NewKeyValueStoreResponseWithDefaults instantiates a new KeyValueStoreResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewKeyValueStoreResponseWithDefaults() *KeyValueStoreResponse { + this := KeyValueStoreResponse{} + return &this +} + +// GetData returns the Data field value +func (o *KeyValueStoreResponse) GetData() KeyValueStore { + if o == nil { + var ret KeyValueStore + return ret + } + + return o.Data +} + +// GetDataOk returns a tuple with the Data field value +// and a boolean to check if the value has been set. +func (o *KeyValueStoreResponse) GetDataOk() (*KeyValueStore, bool) { + if o == nil { + return nil, false + } + return &o.Data, true +} + +// SetData sets field value +func (o *KeyValueStoreResponse) SetData(v KeyValueStore) { + o.Data = v +} + +func (o KeyValueStoreResponse) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o KeyValueStoreResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["data"] = o.Data + return toSerialize, nil +} + +func (o *KeyValueStoreResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "data", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varKeyValueStoreResponse := _KeyValueStoreResponse{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varKeyValueStoreResponse) + + if err != nil { + return err + } + + *o = KeyValueStoreResponse(varKeyValueStoreResponse) + + return err +} + +type NullableKeyValueStoreResponse struct { + value *KeyValueStoreResponse + isSet bool +} + +func (v NullableKeyValueStoreResponse) Get() *KeyValueStoreResponse { + return v.value +} + +func (v *NullableKeyValueStoreResponse) Set(val *KeyValueStoreResponse) { + v.value = val + v.isSet = true +} + +func (v NullableKeyValueStoreResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableKeyValueStoreResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableKeyValueStoreResponse(val *KeyValueStoreResponse) *NullableKeyValueStoreResponse { + return &NullableKeyValueStoreResponse{value: val, isSet: true} +} + +func (v NullableKeyValueStoreResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableKeyValueStoreResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_key_value_store_stats.go b/model_key_value_store_stats.go new file mode 100644 index 0000000..86242f7 --- /dev/null +++ b/model_key_value_store_stats.go @@ -0,0 +1,314 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" + "bytes" + "fmt" +) + +// checks if the KeyValueStoreStats type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &KeyValueStoreStats{} + +// KeyValueStoreStats struct for KeyValueStoreStats +type KeyValueStoreStats struct { + ReadCount int32 `json:"readCount"` + WriteCount int32 `json:"writeCount"` + DeleteCount int32 `json:"deleteCount"` + ListCount int32 `json:"listCount"` + S3StorageBytes *int32 `json:"s3StorageBytes,omitempty"` + StorageBytes *int32 `json:"storageBytes,omitempty"` +} + +type _KeyValueStoreStats KeyValueStoreStats + +// NewKeyValueStoreStats instantiates a new KeyValueStoreStats object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewKeyValueStoreStats(readCount int32, writeCount int32, deleteCount int32, listCount int32) *KeyValueStoreStats { + this := KeyValueStoreStats{} + this.ReadCount = readCount + this.WriteCount = writeCount + this.DeleteCount = deleteCount + this.ListCount = listCount + return &this +} + +// NewKeyValueStoreStatsWithDefaults instantiates a new KeyValueStoreStats object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewKeyValueStoreStatsWithDefaults() *KeyValueStoreStats { + this := KeyValueStoreStats{} + return &this +} + +// GetReadCount returns the ReadCount field value +func (o *KeyValueStoreStats) GetReadCount() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.ReadCount +} + +// GetReadCountOk returns a tuple with the ReadCount field value +// and a boolean to check if the value has been set. +func (o *KeyValueStoreStats) GetReadCountOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.ReadCount, true +} + +// SetReadCount sets field value +func (o *KeyValueStoreStats) SetReadCount(v int32) { + o.ReadCount = v +} + +// GetWriteCount returns the WriteCount field value +func (o *KeyValueStoreStats) GetWriteCount() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.WriteCount +} + +// GetWriteCountOk returns a tuple with the WriteCount field value +// and a boolean to check if the value has been set. +func (o *KeyValueStoreStats) GetWriteCountOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.WriteCount, true +} + +// SetWriteCount sets field value +func (o *KeyValueStoreStats) SetWriteCount(v int32) { + o.WriteCount = v +} + +// GetDeleteCount returns the DeleteCount field value +func (o *KeyValueStoreStats) GetDeleteCount() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.DeleteCount +} + +// GetDeleteCountOk returns a tuple with the DeleteCount field value +// and a boolean to check if the value has been set. +func (o *KeyValueStoreStats) GetDeleteCountOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.DeleteCount, true +} + +// SetDeleteCount sets field value +func (o *KeyValueStoreStats) SetDeleteCount(v int32) { + o.DeleteCount = v +} + +// GetListCount returns the ListCount field value +func (o *KeyValueStoreStats) GetListCount() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.ListCount +} + +// GetListCountOk returns a tuple with the ListCount field value +// and a boolean to check if the value has been set. +func (o *KeyValueStoreStats) GetListCountOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.ListCount, true +} + +// SetListCount sets field value +func (o *KeyValueStoreStats) SetListCount(v int32) { + o.ListCount = v +} + +// GetS3StorageBytes returns the S3StorageBytes field value if set, zero value otherwise. +func (o *KeyValueStoreStats) GetS3StorageBytes() int32 { + if o == nil || IsNil(o.S3StorageBytes) { + var ret int32 + return ret + } + return *o.S3StorageBytes +} + +// GetS3StorageBytesOk returns a tuple with the S3StorageBytes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *KeyValueStoreStats) GetS3StorageBytesOk() (*int32, bool) { + if o == nil || IsNil(o.S3StorageBytes) { + return nil, false + } + return o.S3StorageBytes, true +} + +// HasS3StorageBytes returns a boolean if a field has been set. +func (o *KeyValueStoreStats) HasS3StorageBytes() bool { + if o != nil && !IsNil(o.S3StorageBytes) { + return true + } + + return false +} + +// SetS3StorageBytes gets a reference to the given int32 and assigns it to the S3StorageBytes field. +func (o *KeyValueStoreStats) SetS3StorageBytes(v int32) { + o.S3StorageBytes = &v +} + +// GetStorageBytes returns the StorageBytes field value if set, zero value otherwise. +func (o *KeyValueStoreStats) GetStorageBytes() int32 { + if o == nil || IsNil(o.StorageBytes) { + var ret int32 + return ret + } + return *o.StorageBytes +} + +// GetStorageBytesOk returns a tuple with the StorageBytes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *KeyValueStoreStats) GetStorageBytesOk() (*int32, bool) { + if o == nil || IsNil(o.StorageBytes) { + return nil, false + } + return o.StorageBytes, true +} + +// HasStorageBytes returns a boolean if a field has been set. +func (o *KeyValueStoreStats) HasStorageBytes() bool { + if o != nil && !IsNil(o.StorageBytes) { + return true + } + + return false +} + +// SetStorageBytes gets a reference to the given int32 and assigns it to the StorageBytes field. +func (o *KeyValueStoreStats) SetStorageBytes(v int32) { + o.StorageBytes = &v +} + +func (o KeyValueStoreStats) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o KeyValueStoreStats) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["readCount"] = o.ReadCount + toSerialize["writeCount"] = o.WriteCount + toSerialize["deleteCount"] = o.DeleteCount + toSerialize["listCount"] = o.ListCount + if !IsNil(o.S3StorageBytes) { + toSerialize["s3StorageBytes"] = o.S3StorageBytes + } + if !IsNil(o.StorageBytes) { + toSerialize["storageBytes"] = o.StorageBytes + } + return toSerialize, nil +} + +func (o *KeyValueStoreStats) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "readCount", + "writeCount", + "deleteCount", + "listCount", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varKeyValueStoreStats := _KeyValueStoreStats{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varKeyValueStoreStats) + + if err != nil { + return err + } + + *o = KeyValueStoreStats(varKeyValueStoreStats) + + return err +} + +type NullableKeyValueStoreStats struct { + value *KeyValueStoreStats + isSet bool +} + +func (v NullableKeyValueStoreStats) Get() *KeyValueStoreStats { + return v.value +} + +func (v *NullableKeyValueStoreStats) Set(val *KeyValueStoreStats) { + v.value = val + v.isSet = true +} + +func (v NullableKeyValueStoreStats) IsSet() bool { + return v.isSet +} + +func (v *NullableKeyValueStoreStats) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableKeyValueStoreStats(val *KeyValueStoreStats) *NullableKeyValueStoreStats { + return &NullableKeyValueStoreStats{value: val, isSet: true} +} + +func (v NullableKeyValueStoreStats) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableKeyValueStoreStats) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_limits.go b/model_limits.go new file mode 100644 index 0000000..a387fdd --- /dev/null +++ b/model_limits.go @@ -0,0 +1,474 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" + "bytes" + "fmt" +) + +// checks if the Limits type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Limits{} + +// Limits struct for Limits +type Limits struct { + MaxMonthlyUsageUsd float32 `json:"maxMonthlyUsageUsd"` + MaxMonthlyActorComputeUnits float32 `json:"maxMonthlyActorComputeUnits"` + MaxMonthlyExternalDataTransferGbytes float32 `json:"maxMonthlyExternalDataTransferGbytes"` + MaxMonthlyProxySerps int32 `json:"maxMonthlyProxySerps"` + MaxMonthlyResidentialProxyGbytes float32 `json:"maxMonthlyResidentialProxyGbytes"` + MaxActorMemoryGbytes float32 `json:"maxActorMemoryGbytes"` + MaxActorCount int32 `json:"maxActorCount"` + MaxActorTaskCount int32 `json:"maxActorTaskCount"` + MaxConcurrentActorJobs int32 `json:"maxConcurrentActorJobs"` + MaxTeamAccountSeatCount int32 `json:"maxTeamAccountSeatCount"` + DataRetentionDays int32 `json:"dataRetentionDays"` + MaxScheduleCount *int32 `json:"maxScheduleCount,omitempty"` +} + +type _Limits Limits + +// NewLimits instantiates a new Limits object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewLimits(maxMonthlyUsageUsd float32, maxMonthlyActorComputeUnits float32, maxMonthlyExternalDataTransferGbytes float32, maxMonthlyProxySerps int32, maxMonthlyResidentialProxyGbytes float32, maxActorMemoryGbytes float32, maxActorCount int32, maxActorTaskCount int32, maxConcurrentActorJobs int32, maxTeamAccountSeatCount int32, dataRetentionDays int32) *Limits { + this := Limits{} + this.MaxMonthlyUsageUsd = maxMonthlyUsageUsd + this.MaxMonthlyActorComputeUnits = maxMonthlyActorComputeUnits + this.MaxMonthlyExternalDataTransferGbytes = maxMonthlyExternalDataTransferGbytes + this.MaxMonthlyProxySerps = maxMonthlyProxySerps + this.MaxMonthlyResidentialProxyGbytes = maxMonthlyResidentialProxyGbytes + this.MaxActorMemoryGbytes = maxActorMemoryGbytes + this.MaxActorCount = maxActorCount + this.MaxActorTaskCount = maxActorTaskCount + this.MaxConcurrentActorJobs = maxConcurrentActorJobs + this.MaxTeamAccountSeatCount = maxTeamAccountSeatCount + this.DataRetentionDays = dataRetentionDays + return &this +} + +// NewLimitsWithDefaults instantiates a new Limits object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewLimitsWithDefaults() *Limits { + this := Limits{} + return &this +} + +// GetMaxMonthlyUsageUsd returns the MaxMonthlyUsageUsd field value +func (o *Limits) GetMaxMonthlyUsageUsd() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.MaxMonthlyUsageUsd +} + +// GetMaxMonthlyUsageUsdOk returns a tuple with the MaxMonthlyUsageUsd field value +// and a boolean to check if the value has been set. +func (o *Limits) GetMaxMonthlyUsageUsdOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.MaxMonthlyUsageUsd, true +} + +// SetMaxMonthlyUsageUsd sets field value +func (o *Limits) SetMaxMonthlyUsageUsd(v float32) { + o.MaxMonthlyUsageUsd = v +} + +// GetMaxMonthlyActorComputeUnits returns the MaxMonthlyActorComputeUnits field value +func (o *Limits) GetMaxMonthlyActorComputeUnits() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.MaxMonthlyActorComputeUnits +} + +// GetMaxMonthlyActorComputeUnitsOk returns a tuple with the MaxMonthlyActorComputeUnits field value +// and a boolean to check if the value has been set. +func (o *Limits) GetMaxMonthlyActorComputeUnitsOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.MaxMonthlyActorComputeUnits, true +} + +// SetMaxMonthlyActorComputeUnits sets field value +func (o *Limits) SetMaxMonthlyActorComputeUnits(v float32) { + o.MaxMonthlyActorComputeUnits = v +} + +// GetMaxMonthlyExternalDataTransferGbytes returns the MaxMonthlyExternalDataTransferGbytes field value +func (o *Limits) GetMaxMonthlyExternalDataTransferGbytes() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.MaxMonthlyExternalDataTransferGbytes +} + +// GetMaxMonthlyExternalDataTransferGbytesOk returns a tuple with the MaxMonthlyExternalDataTransferGbytes field value +// and a boolean to check if the value has been set. +func (o *Limits) GetMaxMonthlyExternalDataTransferGbytesOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.MaxMonthlyExternalDataTransferGbytes, true +} + +// SetMaxMonthlyExternalDataTransferGbytes sets field value +func (o *Limits) SetMaxMonthlyExternalDataTransferGbytes(v float32) { + o.MaxMonthlyExternalDataTransferGbytes = v +} + +// GetMaxMonthlyProxySerps returns the MaxMonthlyProxySerps field value +func (o *Limits) GetMaxMonthlyProxySerps() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.MaxMonthlyProxySerps +} + +// GetMaxMonthlyProxySerpsOk returns a tuple with the MaxMonthlyProxySerps field value +// and a boolean to check if the value has been set. +func (o *Limits) GetMaxMonthlyProxySerpsOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.MaxMonthlyProxySerps, true +} + +// SetMaxMonthlyProxySerps sets field value +func (o *Limits) SetMaxMonthlyProxySerps(v int32) { + o.MaxMonthlyProxySerps = v +} + +// GetMaxMonthlyResidentialProxyGbytes returns the MaxMonthlyResidentialProxyGbytes field value +func (o *Limits) GetMaxMonthlyResidentialProxyGbytes() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.MaxMonthlyResidentialProxyGbytes +} + +// GetMaxMonthlyResidentialProxyGbytesOk returns a tuple with the MaxMonthlyResidentialProxyGbytes field value +// and a boolean to check if the value has been set. +func (o *Limits) GetMaxMonthlyResidentialProxyGbytesOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.MaxMonthlyResidentialProxyGbytes, true +} + +// SetMaxMonthlyResidentialProxyGbytes sets field value +func (o *Limits) SetMaxMonthlyResidentialProxyGbytes(v float32) { + o.MaxMonthlyResidentialProxyGbytes = v +} + +// GetMaxActorMemoryGbytes returns the MaxActorMemoryGbytes field value +func (o *Limits) GetMaxActorMemoryGbytes() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.MaxActorMemoryGbytes +} + +// GetMaxActorMemoryGbytesOk returns a tuple with the MaxActorMemoryGbytes field value +// and a boolean to check if the value has been set. +func (o *Limits) GetMaxActorMemoryGbytesOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.MaxActorMemoryGbytes, true +} + +// SetMaxActorMemoryGbytes sets field value +func (o *Limits) SetMaxActorMemoryGbytes(v float32) { + o.MaxActorMemoryGbytes = v +} + +// GetMaxActorCount returns the MaxActorCount field value +func (o *Limits) GetMaxActorCount() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.MaxActorCount +} + +// GetMaxActorCountOk returns a tuple with the MaxActorCount field value +// and a boolean to check if the value has been set. +func (o *Limits) GetMaxActorCountOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.MaxActorCount, true +} + +// SetMaxActorCount sets field value +func (o *Limits) SetMaxActorCount(v int32) { + o.MaxActorCount = v +} + +// GetMaxActorTaskCount returns the MaxActorTaskCount field value +func (o *Limits) GetMaxActorTaskCount() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.MaxActorTaskCount +} + +// GetMaxActorTaskCountOk returns a tuple with the MaxActorTaskCount field value +// and a boolean to check if the value has been set. +func (o *Limits) GetMaxActorTaskCountOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.MaxActorTaskCount, true +} + +// SetMaxActorTaskCount sets field value +func (o *Limits) SetMaxActorTaskCount(v int32) { + o.MaxActorTaskCount = v +} + +// GetMaxConcurrentActorJobs returns the MaxConcurrentActorJobs field value +func (o *Limits) GetMaxConcurrentActorJobs() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.MaxConcurrentActorJobs +} + +// GetMaxConcurrentActorJobsOk returns a tuple with the MaxConcurrentActorJobs field value +// and a boolean to check if the value has been set. +func (o *Limits) GetMaxConcurrentActorJobsOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.MaxConcurrentActorJobs, true +} + +// SetMaxConcurrentActorJobs sets field value +func (o *Limits) SetMaxConcurrentActorJobs(v int32) { + o.MaxConcurrentActorJobs = v +} + +// GetMaxTeamAccountSeatCount returns the MaxTeamAccountSeatCount field value +func (o *Limits) GetMaxTeamAccountSeatCount() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.MaxTeamAccountSeatCount +} + +// GetMaxTeamAccountSeatCountOk returns a tuple with the MaxTeamAccountSeatCount field value +// and a boolean to check if the value has been set. +func (o *Limits) GetMaxTeamAccountSeatCountOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.MaxTeamAccountSeatCount, true +} + +// SetMaxTeamAccountSeatCount sets field value +func (o *Limits) SetMaxTeamAccountSeatCount(v int32) { + o.MaxTeamAccountSeatCount = v +} + +// GetDataRetentionDays returns the DataRetentionDays field value +func (o *Limits) GetDataRetentionDays() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.DataRetentionDays +} + +// GetDataRetentionDaysOk returns a tuple with the DataRetentionDays field value +// and a boolean to check if the value has been set. +func (o *Limits) GetDataRetentionDaysOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.DataRetentionDays, true +} + +// SetDataRetentionDays sets field value +func (o *Limits) SetDataRetentionDays(v int32) { + o.DataRetentionDays = v +} + +// GetMaxScheduleCount returns the MaxScheduleCount field value if set, zero value otherwise. +func (o *Limits) GetMaxScheduleCount() int32 { + if o == nil || IsNil(o.MaxScheduleCount) { + var ret int32 + return ret + } + return *o.MaxScheduleCount +} + +// GetMaxScheduleCountOk returns a tuple with the MaxScheduleCount field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Limits) GetMaxScheduleCountOk() (*int32, bool) { + if o == nil || IsNil(o.MaxScheduleCount) { + return nil, false + } + return o.MaxScheduleCount, true +} + +// HasMaxScheduleCount returns a boolean if a field has been set. +func (o *Limits) HasMaxScheduleCount() bool { + if o != nil && !IsNil(o.MaxScheduleCount) { + return true + } + + return false +} + +// SetMaxScheduleCount gets a reference to the given int32 and assigns it to the MaxScheduleCount field. +func (o *Limits) SetMaxScheduleCount(v int32) { + o.MaxScheduleCount = &v +} + +func (o Limits) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Limits) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["maxMonthlyUsageUsd"] = o.MaxMonthlyUsageUsd + toSerialize["maxMonthlyActorComputeUnits"] = o.MaxMonthlyActorComputeUnits + toSerialize["maxMonthlyExternalDataTransferGbytes"] = o.MaxMonthlyExternalDataTransferGbytes + toSerialize["maxMonthlyProxySerps"] = o.MaxMonthlyProxySerps + toSerialize["maxMonthlyResidentialProxyGbytes"] = o.MaxMonthlyResidentialProxyGbytes + toSerialize["maxActorMemoryGbytes"] = o.MaxActorMemoryGbytes + toSerialize["maxActorCount"] = o.MaxActorCount + toSerialize["maxActorTaskCount"] = o.MaxActorTaskCount + toSerialize["maxConcurrentActorJobs"] = o.MaxConcurrentActorJobs + toSerialize["maxTeamAccountSeatCount"] = o.MaxTeamAccountSeatCount + toSerialize["dataRetentionDays"] = o.DataRetentionDays + if !IsNil(o.MaxScheduleCount) { + toSerialize["maxScheduleCount"] = o.MaxScheduleCount + } + return toSerialize, nil +} + +func (o *Limits) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "maxMonthlyUsageUsd", + "maxMonthlyActorComputeUnits", + "maxMonthlyExternalDataTransferGbytes", + "maxMonthlyProxySerps", + "maxMonthlyResidentialProxyGbytes", + "maxActorMemoryGbytes", + "maxActorCount", + "maxActorTaskCount", + "maxConcurrentActorJobs", + "maxTeamAccountSeatCount", + "dataRetentionDays", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varLimits := _Limits{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varLimits) + + if err != nil { + return err + } + + *o = Limits(varLimits) + + return err +} + +type NullableLimits struct { + value *Limits + isSet bool +} + +func (v NullableLimits) Get() *Limits { + return v.value +} + +func (v *NullableLimits) Set(val *Limits) { + v.value = val + v.isSet = true +} + +func (v NullableLimits) IsSet() bool { + return v.isSet +} + +func (v *NullableLimits) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableLimits(val *Limits) *NullableLimits { + return &NullableLimits{value: val, isSet: true} +} + +func (v NullableLimits) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableLimits) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_limits_response.go b/model_limits_response.go new file mode 100644 index 0000000..b540193 --- /dev/null +++ b/model_limits_response.go @@ -0,0 +1,158 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" + "bytes" + "fmt" +) + +// checks if the LimitsResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &LimitsResponse{} + +// LimitsResponse struct for LimitsResponse +type LimitsResponse struct { + Data AccountLimits `json:"data"` +} + +type _LimitsResponse LimitsResponse + +// NewLimitsResponse instantiates a new LimitsResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewLimitsResponse(data AccountLimits) *LimitsResponse { + this := LimitsResponse{} + this.Data = data + return &this +} + +// NewLimitsResponseWithDefaults instantiates a new LimitsResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewLimitsResponseWithDefaults() *LimitsResponse { + this := LimitsResponse{} + return &this +} + +// GetData returns the Data field value +func (o *LimitsResponse) GetData() AccountLimits { + if o == nil { + var ret AccountLimits + return ret + } + + return o.Data +} + +// GetDataOk returns a tuple with the Data field value +// and a boolean to check if the value has been set. +func (o *LimitsResponse) GetDataOk() (*AccountLimits, bool) { + if o == nil { + return nil, false + } + return &o.Data, true +} + +// SetData sets field value +func (o *LimitsResponse) SetData(v AccountLimits) { + o.Data = v +} + +func (o LimitsResponse) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o LimitsResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["data"] = o.Data + return toSerialize, nil +} + +func (o *LimitsResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "data", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varLimitsResponse := _LimitsResponse{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varLimitsResponse) + + if err != nil { + return err + } + + *o = LimitsResponse(varLimitsResponse) + + return err +} + +type NullableLimitsResponse struct { + value *LimitsResponse + isSet bool +} + +func (v NullableLimitsResponse) Get() *LimitsResponse { + return v.value +} + +func (v *NullableLimitsResponse) Set(val *LimitsResponse) { + v.value = val + v.isSet = true +} + +func (v NullableLimitsResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableLimitsResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableLimitsResponse(val *LimitsResponse) *NullableLimitsResponse { + return &NullableLimitsResponse{value: val, isSet: true} +} + +func (v NullableLimitsResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableLimitsResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_list_of_actors.go b/model_list_of_actors.go new file mode 100644 index 0000000..53c4ed3 --- /dev/null +++ b/model_list_of_actors.go @@ -0,0 +1,303 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" + "bytes" + "fmt" +) + +// checks if the ListOfActors type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ListOfActors{} + +// ListOfActors struct for ListOfActors +type ListOfActors struct { + // The total number of items available across all pages. + Total int32 `json:"total"` + // The starting position for this page of results. + Offset int32 `json:"offset"` + // The maximum number of items returned per page. + Limit int32 `json:"limit"` + // Whether the results are sorted in descending order. + Desc bool `json:"desc"` + // The number of items returned in this response. + Count int32 `json:"count"` + Items []ActorShort `json:"items"` +} + +type _ListOfActors ListOfActors + +// NewListOfActors instantiates a new ListOfActors object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewListOfActors(total int32, offset int32, limit int32, desc bool, count int32, items []ActorShort) *ListOfActors { + this := ListOfActors{} + this.Total = total + this.Offset = offset + this.Limit = limit + this.Desc = desc + this.Count = count + this.Items = items + return &this +} + +// NewListOfActorsWithDefaults instantiates a new ListOfActors object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewListOfActorsWithDefaults() *ListOfActors { + this := ListOfActors{} + return &this +} + +// GetTotal returns the Total field value +func (o *ListOfActors) GetTotal() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Total +} + +// GetTotalOk returns a tuple with the Total field value +// and a boolean to check if the value has been set. +func (o *ListOfActors) GetTotalOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Total, true +} + +// SetTotal sets field value +func (o *ListOfActors) SetTotal(v int32) { + o.Total = v +} + +// GetOffset returns the Offset field value +func (o *ListOfActors) GetOffset() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Offset +} + +// GetOffsetOk returns a tuple with the Offset field value +// and a boolean to check if the value has been set. +func (o *ListOfActors) GetOffsetOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Offset, true +} + +// SetOffset sets field value +func (o *ListOfActors) SetOffset(v int32) { + o.Offset = v +} + +// GetLimit returns the Limit field value +func (o *ListOfActors) GetLimit() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Limit +} + +// GetLimitOk returns a tuple with the Limit field value +// and a boolean to check if the value has been set. +func (o *ListOfActors) GetLimitOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Limit, true +} + +// SetLimit sets field value +func (o *ListOfActors) SetLimit(v int32) { + o.Limit = v +} + +// GetDesc returns the Desc field value +func (o *ListOfActors) GetDesc() bool { + if o == nil { + var ret bool + return ret + } + + return o.Desc +} + +// GetDescOk returns a tuple with the Desc field value +// and a boolean to check if the value has been set. +func (o *ListOfActors) GetDescOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.Desc, true +} + +// SetDesc sets field value +func (o *ListOfActors) SetDesc(v bool) { + o.Desc = v +} + +// GetCount returns the Count field value +func (o *ListOfActors) GetCount() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Count +} + +// GetCountOk returns a tuple with the Count field value +// and a boolean to check if the value has been set. +func (o *ListOfActors) GetCountOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Count, true +} + +// SetCount sets field value +func (o *ListOfActors) SetCount(v int32) { + o.Count = v +} + +// GetItems returns the Items field value +func (o *ListOfActors) GetItems() []ActorShort { + if o == nil { + var ret []ActorShort + return ret + } + + return o.Items +} + +// GetItemsOk returns a tuple with the Items field value +// and a boolean to check if the value has been set. +func (o *ListOfActors) GetItemsOk() ([]ActorShort, bool) { + if o == nil { + return nil, false + } + return o.Items, true +} + +// SetItems sets field value +func (o *ListOfActors) SetItems(v []ActorShort) { + o.Items = v +} + +func (o ListOfActors) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ListOfActors) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["total"] = o.Total + toSerialize["offset"] = o.Offset + toSerialize["limit"] = o.Limit + toSerialize["desc"] = o.Desc + toSerialize["count"] = o.Count + toSerialize["items"] = o.Items + return toSerialize, nil +} + +func (o *ListOfActors) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "total", + "offset", + "limit", + "desc", + "count", + "items", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varListOfActors := _ListOfActors{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varListOfActors) + + if err != nil { + return err + } + + *o = ListOfActors(varListOfActors) + + return err +} + +type NullableListOfActors struct { + value *ListOfActors + isSet bool +} + +func (v NullableListOfActors) Get() *ListOfActors { + return v.value +} + +func (v *NullableListOfActors) Set(val *ListOfActors) { + v.value = val + v.isSet = true +} + +func (v NullableListOfActors) IsSet() bool { + return v.isSet +} + +func (v *NullableListOfActors) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListOfActors(val *ListOfActors) *NullableListOfActors { + return &NullableListOfActors{value: val, isSet: true} +} + +func (v NullableListOfActors) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListOfActors) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_list_of_actors_in_store_response.go b/model_list_of_actors_in_store_response.go new file mode 100644 index 0000000..edea3ef --- /dev/null +++ b/model_list_of_actors_in_store_response.go @@ -0,0 +1,158 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" + "bytes" + "fmt" +) + +// checks if the ListOfActorsInStoreResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ListOfActorsInStoreResponse{} + +// ListOfActorsInStoreResponse struct for ListOfActorsInStoreResponse +type ListOfActorsInStoreResponse struct { + Data ListOfStoreActors `json:"data"` +} + +type _ListOfActorsInStoreResponse ListOfActorsInStoreResponse + +// NewListOfActorsInStoreResponse instantiates a new ListOfActorsInStoreResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewListOfActorsInStoreResponse(data ListOfStoreActors) *ListOfActorsInStoreResponse { + this := ListOfActorsInStoreResponse{} + this.Data = data + return &this +} + +// NewListOfActorsInStoreResponseWithDefaults instantiates a new ListOfActorsInStoreResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewListOfActorsInStoreResponseWithDefaults() *ListOfActorsInStoreResponse { + this := ListOfActorsInStoreResponse{} + return &this +} + +// GetData returns the Data field value +func (o *ListOfActorsInStoreResponse) GetData() ListOfStoreActors { + if o == nil { + var ret ListOfStoreActors + return ret + } + + return o.Data +} + +// GetDataOk returns a tuple with the Data field value +// and a boolean to check if the value has been set. +func (o *ListOfActorsInStoreResponse) GetDataOk() (*ListOfStoreActors, bool) { + if o == nil { + return nil, false + } + return &o.Data, true +} + +// SetData sets field value +func (o *ListOfActorsInStoreResponse) SetData(v ListOfStoreActors) { + o.Data = v +} + +func (o ListOfActorsInStoreResponse) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ListOfActorsInStoreResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["data"] = o.Data + return toSerialize, nil +} + +func (o *ListOfActorsInStoreResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "data", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varListOfActorsInStoreResponse := _ListOfActorsInStoreResponse{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varListOfActorsInStoreResponse) + + if err != nil { + return err + } + + *o = ListOfActorsInStoreResponse(varListOfActorsInStoreResponse) + + return err +} + +type NullableListOfActorsInStoreResponse struct { + value *ListOfActorsInStoreResponse + isSet bool +} + +func (v NullableListOfActorsInStoreResponse) Get() *ListOfActorsInStoreResponse { + return v.value +} + +func (v *NullableListOfActorsInStoreResponse) Set(val *ListOfActorsInStoreResponse) { + v.value = val + v.isSet = true +} + +func (v NullableListOfActorsInStoreResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableListOfActorsInStoreResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListOfActorsInStoreResponse(val *ListOfActorsInStoreResponse) *NullableListOfActorsInStoreResponse { + return &NullableListOfActorsInStoreResponse{value: val, isSet: true} +} + +func (v NullableListOfActorsInStoreResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListOfActorsInStoreResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_list_of_actors_response.go b/model_list_of_actors_response.go new file mode 100644 index 0000000..386abad --- /dev/null +++ b/model_list_of_actors_response.go @@ -0,0 +1,158 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" + "bytes" + "fmt" +) + +// checks if the ListOfActorsResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ListOfActorsResponse{} + +// ListOfActorsResponse struct for ListOfActorsResponse +type ListOfActorsResponse struct { + Data ListOfActors `json:"data"` +} + +type _ListOfActorsResponse ListOfActorsResponse + +// NewListOfActorsResponse instantiates a new ListOfActorsResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewListOfActorsResponse(data ListOfActors) *ListOfActorsResponse { + this := ListOfActorsResponse{} + this.Data = data + return &this +} + +// NewListOfActorsResponseWithDefaults instantiates a new ListOfActorsResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewListOfActorsResponseWithDefaults() *ListOfActorsResponse { + this := ListOfActorsResponse{} + return &this +} + +// GetData returns the Data field value +func (o *ListOfActorsResponse) GetData() ListOfActors { + if o == nil { + var ret ListOfActors + return ret + } + + return o.Data +} + +// GetDataOk returns a tuple with the Data field value +// and a boolean to check if the value has been set. +func (o *ListOfActorsResponse) GetDataOk() (*ListOfActors, bool) { + if o == nil { + return nil, false + } + return &o.Data, true +} + +// SetData sets field value +func (o *ListOfActorsResponse) SetData(v ListOfActors) { + o.Data = v +} + +func (o ListOfActorsResponse) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ListOfActorsResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["data"] = o.Data + return toSerialize, nil +} + +func (o *ListOfActorsResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "data", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varListOfActorsResponse := _ListOfActorsResponse{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varListOfActorsResponse) + + if err != nil { + return err + } + + *o = ListOfActorsResponse(varListOfActorsResponse) + + return err +} + +type NullableListOfActorsResponse struct { + value *ListOfActorsResponse + isSet bool +} + +func (v NullableListOfActorsResponse) Get() *ListOfActorsResponse { + return v.value +} + +func (v *NullableListOfActorsResponse) Set(val *ListOfActorsResponse) { + v.value = val + v.isSet = true +} + +func (v NullableListOfActorsResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableListOfActorsResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListOfActorsResponse(val *ListOfActorsResponse) *NullableListOfActorsResponse { + return &NullableListOfActorsResponse{value: val, isSet: true} +} + +func (v NullableListOfActorsResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListOfActorsResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_list_of_builds.go b/model_list_of_builds.go new file mode 100644 index 0000000..be42db7 --- /dev/null +++ b/model_list_of_builds.go @@ -0,0 +1,303 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" + "bytes" + "fmt" +) + +// checks if the ListOfBuilds type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ListOfBuilds{} + +// ListOfBuilds struct for ListOfBuilds +type ListOfBuilds struct { + // The total number of items available across all pages. + Total int32 `json:"total"` + // The starting position for this page of results. + Offset int32 `json:"offset"` + // The maximum number of items returned per page. + Limit int32 `json:"limit"` + // Whether the results are sorted in descending order. + Desc bool `json:"desc"` + // The number of items returned in this response. + Count int32 `json:"count"` + Items []BuildShort `json:"items"` +} + +type _ListOfBuilds ListOfBuilds + +// NewListOfBuilds instantiates a new ListOfBuilds object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewListOfBuilds(total int32, offset int32, limit int32, desc bool, count int32, items []BuildShort) *ListOfBuilds { + this := ListOfBuilds{} + this.Total = total + this.Offset = offset + this.Limit = limit + this.Desc = desc + this.Count = count + this.Items = items + return &this +} + +// NewListOfBuildsWithDefaults instantiates a new ListOfBuilds object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewListOfBuildsWithDefaults() *ListOfBuilds { + this := ListOfBuilds{} + return &this +} + +// GetTotal returns the Total field value +func (o *ListOfBuilds) GetTotal() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Total +} + +// GetTotalOk returns a tuple with the Total field value +// and a boolean to check if the value has been set. +func (o *ListOfBuilds) GetTotalOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Total, true +} + +// SetTotal sets field value +func (o *ListOfBuilds) SetTotal(v int32) { + o.Total = v +} + +// GetOffset returns the Offset field value +func (o *ListOfBuilds) GetOffset() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Offset +} + +// GetOffsetOk returns a tuple with the Offset field value +// and a boolean to check if the value has been set. +func (o *ListOfBuilds) GetOffsetOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Offset, true +} + +// SetOffset sets field value +func (o *ListOfBuilds) SetOffset(v int32) { + o.Offset = v +} + +// GetLimit returns the Limit field value +func (o *ListOfBuilds) GetLimit() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Limit +} + +// GetLimitOk returns a tuple with the Limit field value +// and a boolean to check if the value has been set. +func (o *ListOfBuilds) GetLimitOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Limit, true +} + +// SetLimit sets field value +func (o *ListOfBuilds) SetLimit(v int32) { + o.Limit = v +} + +// GetDesc returns the Desc field value +func (o *ListOfBuilds) GetDesc() bool { + if o == nil { + var ret bool + return ret + } + + return o.Desc +} + +// GetDescOk returns a tuple with the Desc field value +// and a boolean to check if the value has been set. +func (o *ListOfBuilds) GetDescOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.Desc, true +} + +// SetDesc sets field value +func (o *ListOfBuilds) SetDesc(v bool) { + o.Desc = v +} + +// GetCount returns the Count field value +func (o *ListOfBuilds) GetCount() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Count +} + +// GetCountOk returns a tuple with the Count field value +// and a boolean to check if the value has been set. +func (o *ListOfBuilds) GetCountOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Count, true +} + +// SetCount sets field value +func (o *ListOfBuilds) SetCount(v int32) { + o.Count = v +} + +// GetItems returns the Items field value +func (o *ListOfBuilds) GetItems() []BuildShort { + if o == nil { + var ret []BuildShort + return ret + } + + return o.Items +} + +// GetItemsOk returns a tuple with the Items field value +// and a boolean to check if the value has been set. +func (o *ListOfBuilds) GetItemsOk() ([]BuildShort, bool) { + if o == nil { + return nil, false + } + return o.Items, true +} + +// SetItems sets field value +func (o *ListOfBuilds) SetItems(v []BuildShort) { + o.Items = v +} + +func (o ListOfBuilds) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ListOfBuilds) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["total"] = o.Total + toSerialize["offset"] = o.Offset + toSerialize["limit"] = o.Limit + toSerialize["desc"] = o.Desc + toSerialize["count"] = o.Count + toSerialize["items"] = o.Items + return toSerialize, nil +} + +func (o *ListOfBuilds) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "total", + "offset", + "limit", + "desc", + "count", + "items", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varListOfBuilds := _ListOfBuilds{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varListOfBuilds) + + if err != nil { + return err + } + + *o = ListOfBuilds(varListOfBuilds) + + return err +} + +type NullableListOfBuilds struct { + value *ListOfBuilds + isSet bool +} + +func (v NullableListOfBuilds) Get() *ListOfBuilds { + return v.value +} + +func (v *NullableListOfBuilds) Set(val *ListOfBuilds) { + v.value = val + v.isSet = true +} + +func (v NullableListOfBuilds) IsSet() bool { + return v.isSet +} + +func (v *NullableListOfBuilds) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListOfBuilds(val *ListOfBuilds) *NullableListOfBuilds { + return &NullableListOfBuilds{value: val, isSet: true} +} + +func (v NullableListOfBuilds) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListOfBuilds) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_list_of_builds_response.go b/model_list_of_builds_response.go new file mode 100644 index 0000000..84efb3b --- /dev/null +++ b/model_list_of_builds_response.go @@ -0,0 +1,158 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" + "bytes" + "fmt" +) + +// checks if the ListOfBuildsResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ListOfBuildsResponse{} + +// ListOfBuildsResponse struct for ListOfBuildsResponse +type ListOfBuildsResponse struct { + Data ListOfBuilds `json:"data"` +} + +type _ListOfBuildsResponse ListOfBuildsResponse + +// NewListOfBuildsResponse instantiates a new ListOfBuildsResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewListOfBuildsResponse(data ListOfBuilds) *ListOfBuildsResponse { + this := ListOfBuildsResponse{} + this.Data = data + return &this +} + +// NewListOfBuildsResponseWithDefaults instantiates a new ListOfBuildsResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewListOfBuildsResponseWithDefaults() *ListOfBuildsResponse { + this := ListOfBuildsResponse{} + return &this +} + +// GetData returns the Data field value +func (o *ListOfBuildsResponse) GetData() ListOfBuilds { + if o == nil { + var ret ListOfBuilds + return ret + } + + return o.Data +} + +// GetDataOk returns a tuple with the Data field value +// and a boolean to check if the value has been set. +func (o *ListOfBuildsResponse) GetDataOk() (*ListOfBuilds, bool) { + if o == nil { + return nil, false + } + return &o.Data, true +} + +// SetData sets field value +func (o *ListOfBuildsResponse) SetData(v ListOfBuilds) { + o.Data = v +} + +func (o ListOfBuildsResponse) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ListOfBuildsResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["data"] = o.Data + return toSerialize, nil +} + +func (o *ListOfBuildsResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "data", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varListOfBuildsResponse := _ListOfBuildsResponse{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varListOfBuildsResponse) + + if err != nil { + return err + } + + *o = ListOfBuildsResponse(varListOfBuildsResponse) + + return err +} + +type NullableListOfBuildsResponse struct { + value *ListOfBuildsResponse + isSet bool +} + +func (v NullableListOfBuildsResponse) Get() *ListOfBuildsResponse { + return v.value +} + +func (v *NullableListOfBuildsResponse) Set(val *ListOfBuildsResponse) { + v.value = val + v.isSet = true +} + +func (v NullableListOfBuildsResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableListOfBuildsResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListOfBuildsResponse(val *ListOfBuildsResponse) *NullableListOfBuildsResponse { + return &NullableListOfBuildsResponse{value: val, isSet: true} +} + +func (v NullableListOfBuildsResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListOfBuildsResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_list_of_datasets.go b/model_list_of_datasets.go new file mode 100644 index 0000000..7f48197 --- /dev/null +++ b/model_list_of_datasets.go @@ -0,0 +1,340 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" + "bytes" + "fmt" +) + +// checks if the ListOfDatasets type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ListOfDatasets{} + +// ListOfDatasets struct for ListOfDatasets +type ListOfDatasets struct { + // The total number of items available across all pages. + Total int32 `json:"total"` + // The starting position for this page of results. + Offset int32 `json:"offset"` + // The maximum number of items returned per page. + Limit int32 `json:"limit"` + // Whether the results are sorted in descending order. + Desc bool `json:"desc"` + // The number of items returned in this response. + Count int32 `json:"count"` + // Whether the listing was filtered to only unnamed datasets. + Unnamed *bool `json:"unnamed,omitempty"` + Items []DatasetListItem `json:"items"` +} + +type _ListOfDatasets ListOfDatasets + +// NewListOfDatasets instantiates a new ListOfDatasets object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewListOfDatasets(total int32, offset int32, limit int32, desc bool, count int32, items []DatasetListItem) *ListOfDatasets { + this := ListOfDatasets{} + this.Total = total + this.Offset = offset + this.Limit = limit + this.Desc = desc + this.Count = count + this.Items = items + return &this +} + +// NewListOfDatasetsWithDefaults instantiates a new ListOfDatasets object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewListOfDatasetsWithDefaults() *ListOfDatasets { + this := ListOfDatasets{} + return &this +} + +// GetTotal returns the Total field value +func (o *ListOfDatasets) GetTotal() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Total +} + +// GetTotalOk returns a tuple with the Total field value +// and a boolean to check if the value has been set. +func (o *ListOfDatasets) GetTotalOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Total, true +} + +// SetTotal sets field value +func (o *ListOfDatasets) SetTotal(v int32) { + o.Total = v +} + +// GetOffset returns the Offset field value +func (o *ListOfDatasets) GetOffset() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Offset +} + +// GetOffsetOk returns a tuple with the Offset field value +// and a boolean to check if the value has been set. +func (o *ListOfDatasets) GetOffsetOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Offset, true +} + +// SetOffset sets field value +func (o *ListOfDatasets) SetOffset(v int32) { + o.Offset = v +} + +// GetLimit returns the Limit field value +func (o *ListOfDatasets) GetLimit() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Limit +} + +// GetLimitOk returns a tuple with the Limit field value +// and a boolean to check if the value has been set. +func (o *ListOfDatasets) GetLimitOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Limit, true +} + +// SetLimit sets field value +func (o *ListOfDatasets) SetLimit(v int32) { + o.Limit = v +} + +// GetDesc returns the Desc field value +func (o *ListOfDatasets) GetDesc() bool { + if o == nil { + var ret bool + return ret + } + + return o.Desc +} + +// GetDescOk returns a tuple with the Desc field value +// and a boolean to check if the value has been set. +func (o *ListOfDatasets) GetDescOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.Desc, true +} + +// SetDesc sets field value +func (o *ListOfDatasets) SetDesc(v bool) { + o.Desc = v +} + +// GetCount returns the Count field value +func (o *ListOfDatasets) GetCount() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Count +} + +// GetCountOk returns a tuple with the Count field value +// and a boolean to check if the value has been set. +func (o *ListOfDatasets) GetCountOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Count, true +} + +// SetCount sets field value +func (o *ListOfDatasets) SetCount(v int32) { + o.Count = v +} + +// GetUnnamed returns the Unnamed field value if set, zero value otherwise. +func (o *ListOfDatasets) GetUnnamed() bool { + if o == nil || IsNil(o.Unnamed) { + var ret bool + return ret + } + return *o.Unnamed +} + +// GetUnnamedOk returns a tuple with the Unnamed field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ListOfDatasets) GetUnnamedOk() (*bool, bool) { + if o == nil || IsNil(o.Unnamed) { + return nil, false + } + return o.Unnamed, true +} + +// HasUnnamed returns a boolean if a field has been set. +func (o *ListOfDatasets) HasUnnamed() bool { + if o != nil && !IsNil(o.Unnamed) { + return true + } + + return false +} + +// SetUnnamed gets a reference to the given bool and assigns it to the Unnamed field. +func (o *ListOfDatasets) SetUnnamed(v bool) { + o.Unnamed = &v +} + +// GetItems returns the Items field value +func (o *ListOfDatasets) GetItems() []DatasetListItem { + if o == nil { + var ret []DatasetListItem + return ret + } + + return o.Items +} + +// GetItemsOk returns a tuple with the Items field value +// and a boolean to check if the value has been set. +func (o *ListOfDatasets) GetItemsOk() ([]DatasetListItem, bool) { + if o == nil { + return nil, false + } + return o.Items, true +} + +// SetItems sets field value +func (o *ListOfDatasets) SetItems(v []DatasetListItem) { + o.Items = v +} + +func (o ListOfDatasets) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ListOfDatasets) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["total"] = o.Total + toSerialize["offset"] = o.Offset + toSerialize["limit"] = o.Limit + toSerialize["desc"] = o.Desc + toSerialize["count"] = o.Count + if !IsNil(o.Unnamed) { + toSerialize["unnamed"] = o.Unnamed + } + toSerialize["items"] = o.Items + return toSerialize, nil +} + +func (o *ListOfDatasets) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "total", + "offset", + "limit", + "desc", + "count", + "items", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varListOfDatasets := _ListOfDatasets{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varListOfDatasets) + + if err != nil { + return err + } + + *o = ListOfDatasets(varListOfDatasets) + + return err +} + +type NullableListOfDatasets struct { + value *ListOfDatasets + isSet bool +} + +func (v NullableListOfDatasets) Get() *ListOfDatasets { + return v.value +} + +func (v *NullableListOfDatasets) Set(val *ListOfDatasets) { + v.value = val + v.isSet = true +} + +func (v NullableListOfDatasets) IsSet() bool { + return v.isSet +} + +func (v *NullableListOfDatasets) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListOfDatasets(val *ListOfDatasets) *NullableListOfDatasets { + return &NullableListOfDatasets{value: val, isSet: true} +} + +func (v NullableListOfDatasets) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListOfDatasets) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_list_of_datasets_response.go b/model_list_of_datasets_response.go new file mode 100644 index 0000000..331e0d0 --- /dev/null +++ b/model_list_of_datasets_response.go @@ -0,0 +1,158 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" + "bytes" + "fmt" +) + +// checks if the ListOfDatasetsResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ListOfDatasetsResponse{} + +// ListOfDatasetsResponse struct for ListOfDatasetsResponse +type ListOfDatasetsResponse struct { + Data ListOfDatasets `json:"data"` +} + +type _ListOfDatasetsResponse ListOfDatasetsResponse + +// NewListOfDatasetsResponse instantiates a new ListOfDatasetsResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewListOfDatasetsResponse(data ListOfDatasets) *ListOfDatasetsResponse { + this := ListOfDatasetsResponse{} + this.Data = data + return &this +} + +// NewListOfDatasetsResponseWithDefaults instantiates a new ListOfDatasetsResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewListOfDatasetsResponseWithDefaults() *ListOfDatasetsResponse { + this := ListOfDatasetsResponse{} + return &this +} + +// GetData returns the Data field value +func (o *ListOfDatasetsResponse) GetData() ListOfDatasets { + if o == nil { + var ret ListOfDatasets + return ret + } + + return o.Data +} + +// GetDataOk returns a tuple with the Data field value +// and a boolean to check if the value has been set. +func (o *ListOfDatasetsResponse) GetDataOk() (*ListOfDatasets, bool) { + if o == nil { + return nil, false + } + return &o.Data, true +} + +// SetData sets field value +func (o *ListOfDatasetsResponse) SetData(v ListOfDatasets) { + o.Data = v +} + +func (o ListOfDatasetsResponse) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ListOfDatasetsResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["data"] = o.Data + return toSerialize, nil +} + +func (o *ListOfDatasetsResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "data", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varListOfDatasetsResponse := _ListOfDatasetsResponse{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varListOfDatasetsResponse) + + if err != nil { + return err + } + + *o = ListOfDatasetsResponse(varListOfDatasetsResponse) + + return err +} + +type NullableListOfDatasetsResponse struct { + value *ListOfDatasetsResponse + isSet bool +} + +func (v NullableListOfDatasetsResponse) Get() *ListOfDatasetsResponse { + return v.value +} + +func (v *NullableListOfDatasetsResponse) Set(val *ListOfDatasetsResponse) { + v.value = val + v.isSet = true +} + +func (v NullableListOfDatasetsResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableListOfDatasetsResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListOfDatasetsResponse(val *ListOfDatasetsResponse) *NullableListOfDatasetsResponse { + return &NullableListOfDatasetsResponse{value: val, isSet: true} +} + +func (v NullableListOfDatasetsResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListOfDatasetsResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_list_of_env_vars.go b/model_list_of_env_vars.go new file mode 100644 index 0000000..e016f39 --- /dev/null +++ b/model_list_of_env_vars.go @@ -0,0 +1,187 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" + "bytes" + "fmt" +) + +// checks if the ListOfEnvVars type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ListOfEnvVars{} + +// ListOfEnvVars struct for ListOfEnvVars +type ListOfEnvVars struct { + Total int32 `json:"total"` + // + Items []EnvVar `json:"items"` +} + +type _ListOfEnvVars ListOfEnvVars + +// NewListOfEnvVars instantiates a new ListOfEnvVars object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewListOfEnvVars(total int32, items []EnvVar) *ListOfEnvVars { + this := ListOfEnvVars{} + this.Total = total + this.Items = items + return &this +} + +// NewListOfEnvVarsWithDefaults instantiates a new ListOfEnvVars object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewListOfEnvVarsWithDefaults() *ListOfEnvVars { + this := ListOfEnvVars{} + return &this +} + +// GetTotal returns the Total field value +func (o *ListOfEnvVars) GetTotal() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Total +} + +// GetTotalOk returns a tuple with the Total field value +// and a boolean to check if the value has been set. +func (o *ListOfEnvVars) GetTotalOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Total, true +} + +// SetTotal sets field value +func (o *ListOfEnvVars) SetTotal(v int32) { + o.Total = v +} + +// GetItems returns the Items field value +func (o *ListOfEnvVars) GetItems() []EnvVar { + if o == nil { + var ret []EnvVar + return ret + } + + return o.Items +} + +// GetItemsOk returns a tuple with the Items field value +// and a boolean to check if the value has been set. +func (o *ListOfEnvVars) GetItemsOk() ([]EnvVar, bool) { + if o == nil { + return nil, false + } + return o.Items, true +} + +// SetItems sets field value +func (o *ListOfEnvVars) SetItems(v []EnvVar) { + o.Items = v +} + +func (o ListOfEnvVars) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ListOfEnvVars) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["total"] = o.Total + toSerialize["items"] = o.Items + return toSerialize, nil +} + +func (o *ListOfEnvVars) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "total", + "items", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varListOfEnvVars := _ListOfEnvVars{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varListOfEnvVars) + + if err != nil { + return err + } + + *o = ListOfEnvVars(varListOfEnvVars) + + return err +} + +type NullableListOfEnvVars struct { + value *ListOfEnvVars + isSet bool +} + +func (v NullableListOfEnvVars) Get() *ListOfEnvVars { + return v.value +} + +func (v *NullableListOfEnvVars) Set(val *ListOfEnvVars) { + v.value = val + v.isSet = true +} + +func (v NullableListOfEnvVars) IsSet() bool { + return v.isSet +} + +func (v *NullableListOfEnvVars) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListOfEnvVars(val *ListOfEnvVars) *NullableListOfEnvVars { + return &NullableListOfEnvVars{value: val, isSet: true} +} + +func (v NullableListOfEnvVars) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListOfEnvVars) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_list_of_env_vars_response.go b/model_list_of_env_vars_response.go new file mode 100644 index 0000000..41e833d --- /dev/null +++ b/model_list_of_env_vars_response.go @@ -0,0 +1,158 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" + "bytes" + "fmt" +) + +// checks if the ListOfEnvVarsResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ListOfEnvVarsResponse{} + +// ListOfEnvVarsResponse struct for ListOfEnvVarsResponse +type ListOfEnvVarsResponse struct { + Data ListOfEnvVars `json:"data"` +} + +type _ListOfEnvVarsResponse ListOfEnvVarsResponse + +// NewListOfEnvVarsResponse instantiates a new ListOfEnvVarsResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewListOfEnvVarsResponse(data ListOfEnvVars) *ListOfEnvVarsResponse { + this := ListOfEnvVarsResponse{} + this.Data = data + return &this +} + +// NewListOfEnvVarsResponseWithDefaults instantiates a new ListOfEnvVarsResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewListOfEnvVarsResponseWithDefaults() *ListOfEnvVarsResponse { + this := ListOfEnvVarsResponse{} + return &this +} + +// GetData returns the Data field value +func (o *ListOfEnvVarsResponse) GetData() ListOfEnvVars { + if o == nil { + var ret ListOfEnvVars + return ret + } + + return o.Data +} + +// GetDataOk returns a tuple with the Data field value +// and a boolean to check if the value has been set. +func (o *ListOfEnvVarsResponse) GetDataOk() (*ListOfEnvVars, bool) { + if o == nil { + return nil, false + } + return &o.Data, true +} + +// SetData sets field value +func (o *ListOfEnvVarsResponse) SetData(v ListOfEnvVars) { + o.Data = v +} + +func (o ListOfEnvVarsResponse) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ListOfEnvVarsResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["data"] = o.Data + return toSerialize, nil +} + +func (o *ListOfEnvVarsResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "data", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varListOfEnvVarsResponse := _ListOfEnvVarsResponse{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varListOfEnvVarsResponse) + + if err != nil { + return err + } + + *o = ListOfEnvVarsResponse(varListOfEnvVarsResponse) + + return err +} + +type NullableListOfEnvVarsResponse struct { + value *ListOfEnvVarsResponse + isSet bool +} + +func (v NullableListOfEnvVarsResponse) Get() *ListOfEnvVarsResponse { + return v.value +} + +func (v *NullableListOfEnvVarsResponse) Set(val *ListOfEnvVarsResponse) { + v.value = val + v.isSet = true +} + +func (v NullableListOfEnvVarsResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableListOfEnvVarsResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListOfEnvVarsResponse(val *ListOfEnvVarsResponse) *NullableListOfEnvVarsResponse { + return &NullableListOfEnvVarsResponse{value: val, isSet: true} +} + +func (v NullableListOfEnvVarsResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListOfEnvVarsResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_list_of_key_value_stores.go b/model_list_of_key_value_stores.go new file mode 100644 index 0000000..dadf0d0 --- /dev/null +++ b/model_list_of_key_value_stores.go @@ -0,0 +1,340 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" + "bytes" + "fmt" +) + +// checks if the ListOfKeyValueStores type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ListOfKeyValueStores{} + +// ListOfKeyValueStores struct for ListOfKeyValueStores +type ListOfKeyValueStores struct { + // The total number of items available across all pages. + Total int32 `json:"total"` + // The starting position for this page of results. + Offset int32 `json:"offset"` + // The maximum number of items returned per page. + Limit int32 `json:"limit"` + // Whether the results are sorted in descending order. + Desc bool `json:"desc"` + // The number of items returned in this response. + Count int32 `json:"count"` + // Whether the listing was filtered to only unnamed key-value stores. + Unnamed *bool `json:"unnamed,omitempty"` + Items []KeyValueStore `json:"items"` +} + +type _ListOfKeyValueStores ListOfKeyValueStores + +// NewListOfKeyValueStores instantiates a new ListOfKeyValueStores object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewListOfKeyValueStores(total int32, offset int32, limit int32, desc bool, count int32, items []KeyValueStore) *ListOfKeyValueStores { + this := ListOfKeyValueStores{} + this.Total = total + this.Offset = offset + this.Limit = limit + this.Desc = desc + this.Count = count + this.Items = items + return &this +} + +// NewListOfKeyValueStoresWithDefaults instantiates a new ListOfKeyValueStores object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewListOfKeyValueStoresWithDefaults() *ListOfKeyValueStores { + this := ListOfKeyValueStores{} + return &this +} + +// GetTotal returns the Total field value +func (o *ListOfKeyValueStores) GetTotal() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Total +} + +// GetTotalOk returns a tuple with the Total field value +// and a boolean to check if the value has been set. +func (o *ListOfKeyValueStores) GetTotalOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Total, true +} + +// SetTotal sets field value +func (o *ListOfKeyValueStores) SetTotal(v int32) { + o.Total = v +} + +// GetOffset returns the Offset field value +func (o *ListOfKeyValueStores) GetOffset() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Offset +} + +// GetOffsetOk returns a tuple with the Offset field value +// and a boolean to check if the value has been set. +func (o *ListOfKeyValueStores) GetOffsetOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Offset, true +} + +// SetOffset sets field value +func (o *ListOfKeyValueStores) SetOffset(v int32) { + o.Offset = v +} + +// GetLimit returns the Limit field value +func (o *ListOfKeyValueStores) GetLimit() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Limit +} + +// GetLimitOk returns a tuple with the Limit field value +// and a boolean to check if the value has been set. +func (o *ListOfKeyValueStores) GetLimitOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Limit, true +} + +// SetLimit sets field value +func (o *ListOfKeyValueStores) SetLimit(v int32) { + o.Limit = v +} + +// GetDesc returns the Desc field value +func (o *ListOfKeyValueStores) GetDesc() bool { + if o == nil { + var ret bool + return ret + } + + return o.Desc +} + +// GetDescOk returns a tuple with the Desc field value +// and a boolean to check if the value has been set. +func (o *ListOfKeyValueStores) GetDescOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.Desc, true +} + +// SetDesc sets field value +func (o *ListOfKeyValueStores) SetDesc(v bool) { + o.Desc = v +} + +// GetCount returns the Count field value +func (o *ListOfKeyValueStores) GetCount() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Count +} + +// GetCountOk returns a tuple with the Count field value +// and a boolean to check if the value has been set. +func (o *ListOfKeyValueStores) GetCountOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Count, true +} + +// SetCount sets field value +func (o *ListOfKeyValueStores) SetCount(v int32) { + o.Count = v +} + +// GetUnnamed returns the Unnamed field value if set, zero value otherwise. +func (o *ListOfKeyValueStores) GetUnnamed() bool { + if o == nil || IsNil(o.Unnamed) { + var ret bool + return ret + } + return *o.Unnamed +} + +// GetUnnamedOk returns a tuple with the Unnamed field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ListOfKeyValueStores) GetUnnamedOk() (*bool, bool) { + if o == nil || IsNil(o.Unnamed) { + return nil, false + } + return o.Unnamed, true +} + +// HasUnnamed returns a boolean if a field has been set. +func (o *ListOfKeyValueStores) HasUnnamed() bool { + if o != nil && !IsNil(o.Unnamed) { + return true + } + + return false +} + +// SetUnnamed gets a reference to the given bool and assigns it to the Unnamed field. +func (o *ListOfKeyValueStores) SetUnnamed(v bool) { + o.Unnamed = &v +} + +// GetItems returns the Items field value +func (o *ListOfKeyValueStores) GetItems() []KeyValueStore { + if o == nil { + var ret []KeyValueStore + return ret + } + + return o.Items +} + +// GetItemsOk returns a tuple with the Items field value +// and a boolean to check if the value has been set. +func (o *ListOfKeyValueStores) GetItemsOk() ([]KeyValueStore, bool) { + if o == nil { + return nil, false + } + return o.Items, true +} + +// SetItems sets field value +func (o *ListOfKeyValueStores) SetItems(v []KeyValueStore) { + o.Items = v +} + +func (o ListOfKeyValueStores) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ListOfKeyValueStores) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["total"] = o.Total + toSerialize["offset"] = o.Offset + toSerialize["limit"] = o.Limit + toSerialize["desc"] = o.Desc + toSerialize["count"] = o.Count + if !IsNil(o.Unnamed) { + toSerialize["unnamed"] = o.Unnamed + } + toSerialize["items"] = o.Items + return toSerialize, nil +} + +func (o *ListOfKeyValueStores) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "total", + "offset", + "limit", + "desc", + "count", + "items", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varListOfKeyValueStores := _ListOfKeyValueStores{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varListOfKeyValueStores) + + if err != nil { + return err + } + + *o = ListOfKeyValueStores(varListOfKeyValueStores) + + return err +} + +type NullableListOfKeyValueStores struct { + value *ListOfKeyValueStores + isSet bool +} + +func (v NullableListOfKeyValueStores) Get() *ListOfKeyValueStores { + return v.value +} + +func (v *NullableListOfKeyValueStores) Set(val *ListOfKeyValueStores) { + v.value = val + v.isSet = true +} + +func (v NullableListOfKeyValueStores) IsSet() bool { + return v.isSet +} + +func (v *NullableListOfKeyValueStores) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListOfKeyValueStores(val *ListOfKeyValueStores) *NullableListOfKeyValueStores { + return &NullableListOfKeyValueStores{value: val, isSet: true} +} + +func (v NullableListOfKeyValueStores) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListOfKeyValueStores) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_list_of_key_value_stores_response.go b/model_list_of_key_value_stores_response.go new file mode 100644 index 0000000..361a06f --- /dev/null +++ b/model_list_of_key_value_stores_response.go @@ -0,0 +1,158 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" + "bytes" + "fmt" +) + +// checks if the ListOfKeyValueStoresResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ListOfKeyValueStoresResponse{} + +// ListOfKeyValueStoresResponse struct for ListOfKeyValueStoresResponse +type ListOfKeyValueStoresResponse struct { + Data ListOfKeyValueStores `json:"data"` +} + +type _ListOfKeyValueStoresResponse ListOfKeyValueStoresResponse + +// NewListOfKeyValueStoresResponse instantiates a new ListOfKeyValueStoresResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewListOfKeyValueStoresResponse(data ListOfKeyValueStores) *ListOfKeyValueStoresResponse { + this := ListOfKeyValueStoresResponse{} + this.Data = data + return &this +} + +// NewListOfKeyValueStoresResponseWithDefaults instantiates a new ListOfKeyValueStoresResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewListOfKeyValueStoresResponseWithDefaults() *ListOfKeyValueStoresResponse { + this := ListOfKeyValueStoresResponse{} + return &this +} + +// GetData returns the Data field value +func (o *ListOfKeyValueStoresResponse) GetData() ListOfKeyValueStores { + if o == nil { + var ret ListOfKeyValueStores + return ret + } + + return o.Data +} + +// GetDataOk returns a tuple with the Data field value +// and a boolean to check if the value has been set. +func (o *ListOfKeyValueStoresResponse) GetDataOk() (*ListOfKeyValueStores, bool) { + if o == nil { + return nil, false + } + return &o.Data, true +} + +// SetData sets field value +func (o *ListOfKeyValueStoresResponse) SetData(v ListOfKeyValueStores) { + o.Data = v +} + +func (o ListOfKeyValueStoresResponse) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ListOfKeyValueStoresResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["data"] = o.Data + return toSerialize, nil +} + +func (o *ListOfKeyValueStoresResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "data", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varListOfKeyValueStoresResponse := _ListOfKeyValueStoresResponse{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varListOfKeyValueStoresResponse) + + if err != nil { + return err + } + + *o = ListOfKeyValueStoresResponse(varListOfKeyValueStoresResponse) + + return err +} + +type NullableListOfKeyValueStoresResponse struct { + value *ListOfKeyValueStoresResponse + isSet bool +} + +func (v NullableListOfKeyValueStoresResponse) Get() *ListOfKeyValueStoresResponse { + return v.value +} + +func (v *NullableListOfKeyValueStoresResponse) Set(val *ListOfKeyValueStoresResponse) { + v.value = val + v.isSet = true +} + +func (v NullableListOfKeyValueStoresResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableListOfKeyValueStoresResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListOfKeyValueStoresResponse(val *ListOfKeyValueStoresResponse) *NullableListOfKeyValueStoresResponse { + return &NullableListOfKeyValueStoresResponse{value: val, isSet: true} +} + +func (v NullableListOfKeyValueStoresResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListOfKeyValueStoresResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_list_of_keys.go b/model_list_of_keys.go new file mode 100644 index 0000000..a87c1b7 --- /dev/null +++ b/model_list_of_keys.go @@ -0,0 +1,335 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" + "bytes" + "fmt" +) + +// checks if the ListOfKeys type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ListOfKeys{} + +// ListOfKeys struct for ListOfKeys +type ListOfKeys struct { + // + Items []KeyValueStoreKey `json:"items"` + Count int32 `json:"count"` + Limit int32 `json:"limit"` + ExclusiveStartKey NullableString `json:"exclusiveStartKey,omitempty"` + IsTruncated bool `json:"isTruncated"` + NextExclusiveStartKey NullableString `json:"nextExclusiveStartKey,omitempty"` +} + +type _ListOfKeys ListOfKeys + +// NewListOfKeys instantiates a new ListOfKeys object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewListOfKeys(items []KeyValueStoreKey, count int32, limit int32, isTruncated bool) *ListOfKeys { + this := ListOfKeys{} + this.Items = items + this.Count = count + this.Limit = limit + this.IsTruncated = isTruncated + return &this +} + +// NewListOfKeysWithDefaults instantiates a new ListOfKeys object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewListOfKeysWithDefaults() *ListOfKeys { + this := ListOfKeys{} + return &this +} + +// GetItems returns the Items field value +func (o *ListOfKeys) GetItems() []KeyValueStoreKey { + if o == nil { + var ret []KeyValueStoreKey + return ret + } + + return o.Items +} + +// GetItemsOk returns a tuple with the Items field value +// and a boolean to check if the value has been set. +func (o *ListOfKeys) GetItemsOk() ([]KeyValueStoreKey, bool) { + if o == nil { + return nil, false + } + return o.Items, true +} + +// SetItems sets field value +func (o *ListOfKeys) SetItems(v []KeyValueStoreKey) { + o.Items = v +} + +// GetCount returns the Count field value +func (o *ListOfKeys) GetCount() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Count +} + +// GetCountOk returns a tuple with the Count field value +// and a boolean to check if the value has been set. +func (o *ListOfKeys) GetCountOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Count, true +} + +// SetCount sets field value +func (o *ListOfKeys) SetCount(v int32) { + o.Count = v +} + +// GetLimit returns the Limit field value +func (o *ListOfKeys) GetLimit() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Limit +} + +// GetLimitOk returns a tuple with the Limit field value +// and a boolean to check if the value has been set. +func (o *ListOfKeys) GetLimitOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Limit, true +} + +// SetLimit sets field value +func (o *ListOfKeys) SetLimit(v int32) { + o.Limit = v +} + +// GetExclusiveStartKey returns the ExclusiveStartKey field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ListOfKeys) GetExclusiveStartKey() string { + if o == nil || IsNil(o.ExclusiveStartKey.Get()) { + var ret string + return ret + } + return *o.ExclusiveStartKey.Get() +} + +// GetExclusiveStartKeyOk returns a tuple with the ExclusiveStartKey field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ListOfKeys) GetExclusiveStartKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.ExclusiveStartKey.Get(), o.ExclusiveStartKey.IsSet() +} + +// HasExclusiveStartKey returns a boolean if a field has been set. +func (o *ListOfKeys) HasExclusiveStartKey() bool { + if o != nil && o.ExclusiveStartKey.IsSet() { + return true + } + + return false +} + +// SetExclusiveStartKey gets a reference to the given NullableString and assigns it to the ExclusiveStartKey field. +func (o *ListOfKeys) SetExclusiveStartKey(v string) { + o.ExclusiveStartKey.Set(&v) +} +// SetExclusiveStartKeyNil sets the value for ExclusiveStartKey to be an explicit nil +func (o *ListOfKeys) SetExclusiveStartKeyNil() { + o.ExclusiveStartKey.Set(nil) +} + +// UnsetExclusiveStartKey ensures that no value is present for ExclusiveStartKey, not even an explicit nil +func (o *ListOfKeys) UnsetExclusiveStartKey() { + o.ExclusiveStartKey.Unset() +} + +// GetIsTruncated returns the IsTruncated field value +func (o *ListOfKeys) GetIsTruncated() bool { + if o == nil { + var ret bool + return ret + } + + return o.IsTruncated +} + +// GetIsTruncatedOk returns a tuple with the IsTruncated field value +// and a boolean to check if the value has been set. +func (o *ListOfKeys) GetIsTruncatedOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.IsTruncated, true +} + +// SetIsTruncated sets field value +func (o *ListOfKeys) SetIsTruncated(v bool) { + o.IsTruncated = v +} + +// GetNextExclusiveStartKey returns the NextExclusiveStartKey field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ListOfKeys) GetNextExclusiveStartKey() string { + if o == nil || IsNil(o.NextExclusiveStartKey.Get()) { + var ret string + return ret + } + return *o.NextExclusiveStartKey.Get() +} + +// GetNextExclusiveStartKeyOk returns a tuple with the NextExclusiveStartKey field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ListOfKeys) GetNextExclusiveStartKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.NextExclusiveStartKey.Get(), o.NextExclusiveStartKey.IsSet() +} + +// HasNextExclusiveStartKey returns a boolean if a field has been set. +func (o *ListOfKeys) HasNextExclusiveStartKey() bool { + if o != nil && o.NextExclusiveStartKey.IsSet() { + return true + } + + return false +} + +// SetNextExclusiveStartKey gets a reference to the given NullableString and assigns it to the NextExclusiveStartKey field. +func (o *ListOfKeys) SetNextExclusiveStartKey(v string) { + o.NextExclusiveStartKey.Set(&v) +} +// SetNextExclusiveStartKeyNil sets the value for NextExclusiveStartKey to be an explicit nil +func (o *ListOfKeys) SetNextExclusiveStartKeyNil() { + o.NextExclusiveStartKey.Set(nil) +} + +// UnsetNextExclusiveStartKey ensures that no value is present for NextExclusiveStartKey, not even an explicit nil +func (o *ListOfKeys) UnsetNextExclusiveStartKey() { + o.NextExclusiveStartKey.Unset() +} + +func (o ListOfKeys) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ListOfKeys) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["items"] = o.Items + toSerialize["count"] = o.Count + toSerialize["limit"] = o.Limit + if o.ExclusiveStartKey.IsSet() { + toSerialize["exclusiveStartKey"] = o.ExclusiveStartKey.Get() + } + toSerialize["isTruncated"] = o.IsTruncated + if o.NextExclusiveStartKey.IsSet() { + toSerialize["nextExclusiveStartKey"] = o.NextExclusiveStartKey.Get() + } + return toSerialize, nil +} + +func (o *ListOfKeys) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "items", + "count", + "limit", + "isTruncated", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varListOfKeys := _ListOfKeys{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varListOfKeys) + + if err != nil { + return err + } + + *o = ListOfKeys(varListOfKeys) + + return err +} + +type NullableListOfKeys struct { + value *ListOfKeys + isSet bool +} + +func (v NullableListOfKeys) Get() *ListOfKeys { + return v.value +} + +func (v *NullableListOfKeys) Set(val *ListOfKeys) { + v.value = val + v.isSet = true +} + +func (v NullableListOfKeys) IsSet() bool { + return v.isSet +} + +func (v *NullableListOfKeys) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListOfKeys(val *ListOfKeys) *NullableListOfKeys { + return &NullableListOfKeys{value: val, isSet: true} +} + +func (v NullableListOfKeys) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListOfKeys) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_list_of_keys_response.go b/model_list_of_keys_response.go new file mode 100644 index 0000000..45268d9 --- /dev/null +++ b/model_list_of_keys_response.go @@ -0,0 +1,158 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" + "bytes" + "fmt" +) + +// checks if the ListOfKeysResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ListOfKeysResponse{} + +// ListOfKeysResponse struct for ListOfKeysResponse +type ListOfKeysResponse struct { + Data ListOfKeys `json:"data"` +} + +type _ListOfKeysResponse ListOfKeysResponse + +// NewListOfKeysResponse instantiates a new ListOfKeysResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewListOfKeysResponse(data ListOfKeys) *ListOfKeysResponse { + this := ListOfKeysResponse{} + this.Data = data + return &this +} + +// NewListOfKeysResponseWithDefaults instantiates a new ListOfKeysResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewListOfKeysResponseWithDefaults() *ListOfKeysResponse { + this := ListOfKeysResponse{} + return &this +} + +// GetData returns the Data field value +func (o *ListOfKeysResponse) GetData() ListOfKeys { + if o == nil { + var ret ListOfKeys + return ret + } + + return o.Data +} + +// GetDataOk returns a tuple with the Data field value +// and a boolean to check if the value has been set. +func (o *ListOfKeysResponse) GetDataOk() (*ListOfKeys, bool) { + if o == nil { + return nil, false + } + return &o.Data, true +} + +// SetData sets field value +func (o *ListOfKeysResponse) SetData(v ListOfKeys) { + o.Data = v +} + +func (o ListOfKeysResponse) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ListOfKeysResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["data"] = o.Data + return toSerialize, nil +} + +func (o *ListOfKeysResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "data", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varListOfKeysResponse := _ListOfKeysResponse{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varListOfKeysResponse) + + if err != nil { + return err + } + + *o = ListOfKeysResponse(varListOfKeysResponse) + + return err +} + +type NullableListOfKeysResponse struct { + value *ListOfKeysResponse + isSet bool +} + +func (v NullableListOfKeysResponse) Get() *ListOfKeysResponse { + return v.value +} + +func (v *NullableListOfKeysResponse) Set(val *ListOfKeysResponse) { + v.value = val + v.isSet = true +} + +func (v NullableListOfKeysResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableListOfKeysResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListOfKeysResponse(val *ListOfKeysResponse) *NullableListOfKeysResponse { + return &NullableListOfKeysResponse{value: val, isSet: true} +} + +func (v NullableListOfKeysResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListOfKeysResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_list_of_request_queues.go b/model_list_of_request_queues.go new file mode 100644 index 0000000..49f17cd --- /dev/null +++ b/model_list_of_request_queues.go @@ -0,0 +1,341 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" + "bytes" + "fmt" +) + +// checks if the ListOfRequestQueues type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ListOfRequestQueues{} + +// ListOfRequestQueues A paginated list of request queues. +type ListOfRequestQueues struct { + // The total number of items available across all pages. + Total int32 `json:"total"` + // The starting position for this page of results. + Offset int32 `json:"offset"` + // The maximum number of items returned per page. + Limit int32 `json:"limit"` + // Whether the results are sorted in descending order. + Desc bool `json:"desc"` + // The number of items returned in this response. + Count int32 `json:"count"` + // Whether the listing was filtered to only unnamed request queues. + Unnamed *bool `json:"unnamed,omitempty"` + // The array of request queues. + Items []RequestQueueShort `json:"items"` +} + +type _ListOfRequestQueues ListOfRequestQueues + +// NewListOfRequestQueues instantiates a new ListOfRequestQueues object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewListOfRequestQueues(total int32, offset int32, limit int32, desc bool, count int32, items []RequestQueueShort) *ListOfRequestQueues { + this := ListOfRequestQueues{} + this.Total = total + this.Offset = offset + this.Limit = limit + this.Desc = desc + this.Count = count + this.Items = items + return &this +} + +// NewListOfRequestQueuesWithDefaults instantiates a new ListOfRequestQueues object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewListOfRequestQueuesWithDefaults() *ListOfRequestQueues { + this := ListOfRequestQueues{} + return &this +} + +// GetTotal returns the Total field value +func (o *ListOfRequestQueues) GetTotal() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Total +} + +// GetTotalOk returns a tuple with the Total field value +// and a boolean to check if the value has been set. +func (o *ListOfRequestQueues) GetTotalOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Total, true +} + +// SetTotal sets field value +func (o *ListOfRequestQueues) SetTotal(v int32) { + o.Total = v +} + +// GetOffset returns the Offset field value +func (o *ListOfRequestQueues) GetOffset() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Offset +} + +// GetOffsetOk returns a tuple with the Offset field value +// and a boolean to check if the value has been set. +func (o *ListOfRequestQueues) GetOffsetOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Offset, true +} + +// SetOffset sets field value +func (o *ListOfRequestQueues) SetOffset(v int32) { + o.Offset = v +} + +// GetLimit returns the Limit field value +func (o *ListOfRequestQueues) GetLimit() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Limit +} + +// GetLimitOk returns a tuple with the Limit field value +// and a boolean to check if the value has been set. +func (o *ListOfRequestQueues) GetLimitOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Limit, true +} + +// SetLimit sets field value +func (o *ListOfRequestQueues) SetLimit(v int32) { + o.Limit = v +} + +// GetDesc returns the Desc field value +func (o *ListOfRequestQueues) GetDesc() bool { + if o == nil { + var ret bool + return ret + } + + return o.Desc +} + +// GetDescOk returns a tuple with the Desc field value +// and a boolean to check if the value has been set. +func (o *ListOfRequestQueues) GetDescOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.Desc, true +} + +// SetDesc sets field value +func (o *ListOfRequestQueues) SetDesc(v bool) { + o.Desc = v +} + +// GetCount returns the Count field value +func (o *ListOfRequestQueues) GetCount() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Count +} + +// GetCountOk returns a tuple with the Count field value +// and a boolean to check if the value has been set. +func (o *ListOfRequestQueues) GetCountOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Count, true +} + +// SetCount sets field value +func (o *ListOfRequestQueues) SetCount(v int32) { + o.Count = v +} + +// GetUnnamed returns the Unnamed field value if set, zero value otherwise. +func (o *ListOfRequestQueues) GetUnnamed() bool { + if o == nil || IsNil(o.Unnamed) { + var ret bool + return ret + } + return *o.Unnamed +} + +// GetUnnamedOk returns a tuple with the Unnamed field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ListOfRequestQueues) GetUnnamedOk() (*bool, bool) { + if o == nil || IsNil(o.Unnamed) { + return nil, false + } + return o.Unnamed, true +} + +// HasUnnamed returns a boolean if a field has been set. +func (o *ListOfRequestQueues) HasUnnamed() bool { + if o != nil && !IsNil(o.Unnamed) { + return true + } + + return false +} + +// SetUnnamed gets a reference to the given bool and assigns it to the Unnamed field. +func (o *ListOfRequestQueues) SetUnnamed(v bool) { + o.Unnamed = &v +} + +// GetItems returns the Items field value +func (o *ListOfRequestQueues) GetItems() []RequestQueueShort { + if o == nil { + var ret []RequestQueueShort + return ret + } + + return o.Items +} + +// GetItemsOk returns a tuple with the Items field value +// and a boolean to check if the value has been set. +func (o *ListOfRequestQueues) GetItemsOk() ([]RequestQueueShort, bool) { + if o == nil { + return nil, false + } + return o.Items, true +} + +// SetItems sets field value +func (o *ListOfRequestQueues) SetItems(v []RequestQueueShort) { + o.Items = v +} + +func (o ListOfRequestQueues) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ListOfRequestQueues) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["total"] = o.Total + toSerialize["offset"] = o.Offset + toSerialize["limit"] = o.Limit + toSerialize["desc"] = o.Desc + toSerialize["count"] = o.Count + if !IsNil(o.Unnamed) { + toSerialize["unnamed"] = o.Unnamed + } + toSerialize["items"] = o.Items + return toSerialize, nil +} + +func (o *ListOfRequestQueues) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "total", + "offset", + "limit", + "desc", + "count", + "items", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varListOfRequestQueues := _ListOfRequestQueues{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varListOfRequestQueues) + + if err != nil { + return err + } + + *o = ListOfRequestQueues(varListOfRequestQueues) + + return err +} + +type NullableListOfRequestQueues struct { + value *ListOfRequestQueues + isSet bool +} + +func (v NullableListOfRequestQueues) Get() *ListOfRequestQueues { + return v.value +} + +func (v *NullableListOfRequestQueues) Set(val *ListOfRequestQueues) { + v.value = val + v.isSet = true +} + +func (v NullableListOfRequestQueues) IsSet() bool { + return v.isSet +} + +func (v *NullableListOfRequestQueues) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListOfRequestQueues(val *ListOfRequestQueues) *NullableListOfRequestQueues { + return &NullableListOfRequestQueues{value: val, isSet: true} +} + +func (v NullableListOfRequestQueues) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListOfRequestQueues) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_list_of_request_queues_response.go b/model_list_of_request_queues_response.go new file mode 100644 index 0000000..a4837a0 --- /dev/null +++ b/model_list_of_request_queues_response.go @@ -0,0 +1,158 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" + "bytes" + "fmt" +) + +// checks if the ListOfRequestQueuesResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ListOfRequestQueuesResponse{} + +// ListOfRequestQueuesResponse Response containing a list of request queues. +type ListOfRequestQueuesResponse struct { + Data ListOfRequestQueues `json:"data"` +} + +type _ListOfRequestQueuesResponse ListOfRequestQueuesResponse + +// NewListOfRequestQueuesResponse instantiates a new ListOfRequestQueuesResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewListOfRequestQueuesResponse(data ListOfRequestQueues) *ListOfRequestQueuesResponse { + this := ListOfRequestQueuesResponse{} + this.Data = data + return &this +} + +// NewListOfRequestQueuesResponseWithDefaults instantiates a new ListOfRequestQueuesResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewListOfRequestQueuesResponseWithDefaults() *ListOfRequestQueuesResponse { + this := ListOfRequestQueuesResponse{} + return &this +} + +// GetData returns the Data field value +func (o *ListOfRequestQueuesResponse) GetData() ListOfRequestQueues { + if o == nil { + var ret ListOfRequestQueues + return ret + } + + return o.Data +} + +// GetDataOk returns a tuple with the Data field value +// and a boolean to check if the value has been set. +func (o *ListOfRequestQueuesResponse) GetDataOk() (*ListOfRequestQueues, bool) { + if o == nil { + return nil, false + } + return &o.Data, true +} + +// SetData sets field value +func (o *ListOfRequestQueuesResponse) SetData(v ListOfRequestQueues) { + o.Data = v +} + +func (o ListOfRequestQueuesResponse) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ListOfRequestQueuesResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["data"] = o.Data + return toSerialize, nil +} + +func (o *ListOfRequestQueuesResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "data", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varListOfRequestQueuesResponse := _ListOfRequestQueuesResponse{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varListOfRequestQueuesResponse) + + if err != nil { + return err + } + + *o = ListOfRequestQueuesResponse(varListOfRequestQueuesResponse) + + return err +} + +type NullableListOfRequestQueuesResponse struct { + value *ListOfRequestQueuesResponse + isSet bool +} + +func (v NullableListOfRequestQueuesResponse) Get() *ListOfRequestQueuesResponse { + return v.value +} + +func (v *NullableListOfRequestQueuesResponse) Set(val *ListOfRequestQueuesResponse) { + v.value = val + v.isSet = true +} + +func (v NullableListOfRequestQueuesResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableListOfRequestQueuesResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListOfRequestQueuesResponse(val *ListOfRequestQueuesResponse) *NullableListOfRequestQueuesResponse { + return &NullableListOfRequestQueuesResponse{value: val, isSet: true} +} + +func (v NullableListOfRequestQueuesResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListOfRequestQueuesResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_list_of_requests.go b/model_list_of_requests.go new file mode 100644 index 0000000..6a15642 --- /dev/null +++ b/model_list_of_requests.go @@ -0,0 +1,303 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" + "bytes" + "fmt" +) + +// checks if the ListOfRequests type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ListOfRequests{} + +// ListOfRequests A paginated list of requests from the request queue. +type ListOfRequests struct { + // The array of requests. + Items []Request `json:"items"` + // The maximum number of requests returned in this response. + Limit int32 `json:"limit"` + // The ID of the last request from the previous page, used for pagination. + // Deprecated + ExclusiveStartId *string `json:"exclusiveStartId,omitempty"` + // A cursor string used for current page of results. + Cursor *string `json:"cursor,omitempty"` + // A cursor string to be used to continue pagination. + NextCursor *string `json:"nextCursor,omitempty"` +} + +type _ListOfRequests ListOfRequests + +// NewListOfRequests instantiates a new ListOfRequests object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewListOfRequests(items []Request, limit int32) *ListOfRequests { + this := ListOfRequests{} + this.Items = items + this.Limit = limit + return &this +} + +// NewListOfRequestsWithDefaults instantiates a new ListOfRequests object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewListOfRequestsWithDefaults() *ListOfRequests { + this := ListOfRequests{} + return &this +} + +// GetItems returns the Items field value +func (o *ListOfRequests) GetItems() []Request { + if o == nil { + var ret []Request + return ret + } + + return o.Items +} + +// GetItemsOk returns a tuple with the Items field value +// and a boolean to check if the value has been set. +func (o *ListOfRequests) GetItemsOk() ([]Request, bool) { + if o == nil { + return nil, false + } + return o.Items, true +} + +// SetItems sets field value +func (o *ListOfRequests) SetItems(v []Request) { + o.Items = v +} + +// GetLimit returns the Limit field value +func (o *ListOfRequests) GetLimit() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Limit +} + +// GetLimitOk returns a tuple with the Limit field value +// and a boolean to check if the value has been set. +func (o *ListOfRequests) GetLimitOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Limit, true +} + +// SetLimit sets field value +func (o *ListOfRequests) SetLimit(v int32) { + o.Limit = v +} + +// GetExclusiveStartId returns the ExclusiveStartId field value if set, zero value otherwise. +// Deprecated +func (o *ListOfRequests) GetExclusiveStartId() string { + if o == nil || IsNil(o.ExclusiveStartId) { + var ret string + return ret + } + return *o.ExclusiveStartId +} + +// GetExclusiveStartIdOk returns a tuple with the ExclusiveStartId field value if set, nil otherwise +// and a boolean to check if the value has been set. +// Deprecated +func (o *ListOfRequests) GetExclusiveStartIdOk() (*string, bool) { + if o == nil || IsNil(o.ExclusiveStartId) { + return nil, false + } + return o.ExclusiveStartId, true +} + +// HasExclusiveStartId returns a boolean if a field has been set. +func (o *ListOfRequests) HasExclusiveStartId() bool { + if o != nil && !IsNil(o.ExclusiveStartId) { + return true + } + + return false +} + +// SetExclusiveStartId gets a reference to the given string and assigns it to the ExclusiveStartId field. +// Deprecated +func (o *ListOfRequests) SetExclusiveStartId(v string) { + o.ExclusiveStartId = &v +} + +// GetCursor returns the Cursor field value if set, zero value otherwise. +func (o *ListOfRequests) GetCursor() string { + if o == nil || IsNil(o.Cursor) { + var ret string + return ret + } + return *o.Cursor +} + +// GetCursorOk returns a tuple with the Cursor field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ListOfRequests) GetCursorOk() (*string, bool) { + if o == nil || IsNil(o.Cursor) { + return nil, false + } + return o.Cursor, true +} + +// HasCursor returns a boolean if a field has been set. +func (o *ListOfRequests) HasCursor() bool { + if o != nil && !IsNil(o.Cursor) { + return true + } + + return false +} + +// SetCursor gets a reference to the given string and assigns it to the Cursor field. +func (o *ListOfRequests) SetCursor(v string) { + o.Cursor = &v +} + +// GetNextCursor returns the NextCursor field value if set, zero value otherwise. +func (o *ListOfRequests) GetNextCursor() string { + if o == nil || IsNil(o.NextCursor) { + var ret string + return ret + } + return *o.NextCursor +} + +// GetNextCursorOk returns a tuple with the NextCursor field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ListOfRequests) GetNextCursorOk() (*string, bool) { + if o == nil || IsNil(o.NextCursor) { + return nil, false + } + return o.NextCursor, true +} + +// HasNextCursor returns a boolean if a field has been set. +func (o *ListOfRequests) HasNextCursor() bool { + if o != nil && !IsNil(o.NextCursor) { + return true + } + + return false +} + +// SetNextCursor gets a reference to the given string and assigns it to the NextCursor field. +func (o *ListOfRequests) SetNextCursor(v string) { + o.NextCursor = &v +} + +func (o ListOfRequests) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ListOfRequests) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["items"] = o.Items + toSerialize["limit"] = o.Limit + if !IsNil(o.ExclusiveStartId) { + toSerialize["exclusiveStartId"] = o.ExclusiveStartId + } + if !IsNil(o.Cursor) { + toSerialize["cursor"] = o.Cursor + } + if !IsNil(o.NextCursor) { + toSerialize["nextCursor"] = o.NextCursor + } + return toSerialize, nil +} + +func (o *ListOfRequests) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "items", + "limit", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varListOfRequests := _ListOfRequests{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varListOfRequests) + + if err != nil { + return err + } + + *o = ListOfRequests(varListOfRequests) + + return err +} + +type NullableListOfRequests struct { + value *ListOfRequests + isSet bool +} + +func (v NullableListOfRequests) Get() *ListOfRequests { + return v.value +} + +func (v *NullableListOfRequests) Set(val *ListOfRequests) { + v.value = val + v.isSet = true +} + +func (v NullableListOfRequests) IsSet() bool { + return v.isSet +} + +func (v *NullableListOfRequests) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListOfRequests(val *ListOfRequests) *NullableListOfRequests { + return &NullableListOfRequests{value: val, isSet: true} +} + +func (v NullableListOfRequests) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListOfRequests) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_list_of_requests_response.go b/model_list_of_requests_response.go new file mode 100644 index 0000000..0162428 --- /dev/null +++ b/model_list_of_requests_response.go @@ -0,0 +1,158 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" + "bytes" + "fmt" +) + +// checks if the ListOfRequestsResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ListOfRequestsResponse{} + +// ListOfRequestsResponse Response containing a list of requests from the request queue. +type ListOfRequestsResponse struct { + Data ListOfRequests `json:"data"` +} + +type _ListOfRequestsResponse ListOfRequestsResponse + +// NewListOfRequestsResponse instantiates a new ListOfRequestsResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewListOfRequestsResponse(data ListOfRequests) *ListOfRequestsResponse { + this := ListOfRequestsResponse{} + this.Data = data + return &this +} + +// NewListOfRequestsResponseWithDefaults instantiates a new ListOfRequestsResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewListOfRequestsResponseWithDefaults() *ListOfRequestsResponse { + this := ListOfRequestsResponse{} + return &this +} + +// GetData returns the Data field value +func (o *ListOfRequestsResponse) GetData() ListOfRequests { + if o == nil { + var ret ListOfRequests + return ret + } + + return o.Data +} + +// GetDataOk returns a tuple with the Data field value +// and a boolean to check if the value has been set. +func (o *ListOfRequestsResponse) GetDataOk() (*ListOfRequests, bool) { + if o == nil { + return nil, false + } + return &o.Data, true +} + +// SetData sets field value +func (o *ListOfRequestsResponse) SetData(v ListOfRequests) { + o.Data = v +} + +func (o ListOfRequestsResponse) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ListOfRequestsResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["data"] = o.Data + return toSerialize, nil +} + +func (o *ListOfRequestsResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "data", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varListOfRequestsResponse := _ListOfRequestsResponse{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varListOfRequestsResponse) + + if err != nil { + return err + } + + *o = ListOfRequestsResponse(varListOfRequestsResponse) + + return err +} + +type NullableListOfRequestsResponse struct { + value *ListOfRequestsResponse + isSet bool +} + +func (v NullableListOfRequestsResponse) Get() *ListOfRequestsResponse { + return v.value +} + +func (v *NullableListOfRequestsResponse) Set(val *ListOfRequestsResponse) { + v.value = val + v.isSet = true +} + +func (v NullableListOfRequestsResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableListOfRequestsResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListOfRequestsResponse(val *ListOfRequestsResponse) *NullableListOfRequestsResponse { + return &NullableListOfRequestsResponse{value: val, isSet: true} +} + +func (v NullableListOfRequestsResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListOfRequestsResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_list_of_runs.go b/model_list_of_runs.go new file mode 100644 index 0000000..ad04afb --- /dev/null +++ b/model_list_of_runs.go @@ -0,0 +1,303 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" + "bytes" + "fmt" +) + +// checks if the ListOfRuns type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ListOfRuns{} + +// ListOfRuns struct for ListOfRuns +type ListOfRuns struct { + // The total number of items available across all pages. + Total int32 `json:"total"` + // The starting position for this page of results. + Offset int32 `json:"offset"` + // The maximum number of items returned per page. + Limit int32 `json:"limit"` + // Whether the results are sorted in descending order. + Desc bool `json:"desc"` + // The number of items returned in this response. + Count int32 `json:"count"` + Items []RunShort `json:"items"` +} + +type _ListOfRuns ListOfRuns + +// NewListOfRuns instantiates a new ListOfRuns object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewListOfRuns(total int32, offset int32, limit int32, desc bool, count int32, items []RunShort) *ListOfRuns { + this := ListOfRuns{} + this.Total = total + this.Offset = offset + this.Limit = limit + this.Desc = desc + this.Count = count + this.Items = items + return &this +} + +// NewListOfRunsWithDefaults instantiates a new ListOfRuns object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewListOfRunsWithDefaults() *ListOfRuns { + this := ListOfRuns{} + return &this +} + +// GetTotal returns the Total field value +func (o *ListOfRuns) GetTotal() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Total +} + +// GetTotalOk returns a tuple with the Total field value +// and a boolean to check if the value has been set. +func (o *ListOfRuns) GetTotalOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Total, true +} + +// SetTotal sets field value +func (o *ListOfRuns) SetTotal(v int32) { + o.Total = v +} + +// GetOffset returns the Offset field value +func (o *ListOfRuns) GetOffset() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Offset +} + +// GetOffsetOk returns a tuple with the Offset field value +// and a boolean to check if the value has been set. +func (o *ListOfRuns) GetOffsetOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Offset, true +} + +// SetOffset sets field value +func (o *ListOfRuns) SetOffset(v int32) { + o.Offset = v +} + +// GetLimit returns the Limit field value +func (o *ListOfRuns) GetLimit() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Limit +} + +// GetLimitOk returns a tuple with the Limit field value +// and a boolean to check if the value has been set. +func (o *ListOfRuns) GetLimitOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Limit, true +} + +// SetLimit sets field value +func (o *ListOfRuns) SetLimit(v int32) { + o.Limit = v +} + +// GetDesc returns the Desc field value +func (o *ListOfRuns) GetDesc() bool { + if o == nil { + var ret bool + return ret + } + + return o.Desc +} + +// GetDescOk returns a tuple with the Desc field value +// and a boolean to check if the value has been set. +func (o *ListOfRuns) GetDescOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.Desc, true +} + +// SetDesc sets field value +func (o *ListOfRuns) SetDesc(v bool) { + o.Desc = v +} + +// GetCount returns the Count field value +func (o *ListOfRuns) GetCount() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Count +} + +// GetCountOk returns a tuple with the Count field value +// and a boolean to check if the value has been set. +func (o *ListOfRuns) GetCountOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Count, true +} + +// SetCount sets field value +func (o *ListOfRuns) SetCount(v int32) { + o.Count = v +} + +// GetItems returns the Items field value +func (o *ListOfRuns) GetItems() []RunShort { + if o == nil { + var ret []RunShort + return ret + } + + return o.Items +} + +// GetItemsOk returns a tuple with the Items field value +// and a boolean to check if the value has been set. +func (o *ListOfRuns) GetItemsOk() ([]RunShort, bool) { + if o == nil { + return nil, false + } + return o.Items, true +} + +// SetItems sets field value +func (o *ListOfRuns) SetItems(v []RunShort) { + o.Items = v +} + +func (o ListOfRuns) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ListOfRuns) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["total"] = o.Total + toSerialize["offset"] = o.Offset + toSerialize["limit"] = o.Limit + toSerialize["desc"] = o.Desc + toSerialize["count"] = o.Count + toSerialize["items"] = o.Items + return toSerialize, nil +} + +func (o *ListOfRuns) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "total", + "offset", + "limit", + "desc", + "count", + "items", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varListOfRuns := _ListOfRuns{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varListOfRuns) + + if err != nil { + return err + } + + *o = ListOfRuns(varListOfRuns) + + return err +} + +type NullableListOfRuns struct { + value *ListOfRuns + isSet bool +} + +func (v NullableListOfRuns) Get() *ListOfRuns { + return v.value +} + +func (v *NullableListOfRuns) Set(val *ListOfRuns) { + v.value = val + v.isSet = true +} + +func (v NullableListOfRuns) IsSet() bool { + return v.isSet +} + +func (v *NullableListOfRuns) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListOfRuns(val *ListOfRuns) *NullableListOfRuns { + return &NullableListOfRuns{value: val, isSet: true} +} + +func (v NullableListOfRuns) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListOfRuns) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_list_of_runs_response.go b/model_list_of_runs_response.go new file mode 100644 index 0000000..cad1247 --- /dev/null +++ b/model_list_of_runs_response.go @@ -0,0 +1,158 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" + "bytes" + "fmt" +) + +// checks if the ListOfRunsResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ListOfRunsResponse{} + +// ListOfRunsResponse struct for ListOfRunsResponse +type ListOfRunsResponse struct { + Data ListOfRuns `json:"data"` +} + +type _ListOfRunsResponse ListOfRunsResponse + +// NewListOfRunsResponse instantiates a new ListOfRunsResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewListOfRunsResponse(data ListOfRuns) *ListOfRunsResponse { + this := ListOfRunsResponse{} + this.Data = data + return &this +} + +// NewListOfRunsResponseWithDefaults instantiates a new ListOfRunsResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewListOfRunsResponseWithDefaults() *ListOfRunsResponse { + this := ListOfRunsResponse{} + return &this +} + +// GetData returns the Data field value +func (o *ListOfRunsResponse) GetData() ListOfRuns { + if o == nil { + var ret ListOfRuns + return ret + } + + return o.Data +} + +// GetDataOk returns a tuple with the Data field value +// and a boolean to check if the value has been set. +func (o *ListOfRunsResponse) GetDataOk() (*ListOfRuns, bool) { + if o == nil { + return nil, false + } + return &o.Data, true +} + +// SetData sets field value +func (o *ListOfRunsResponse) SetData(v ListOfRuns) { + o.Data = v +} + +func (o ListOfRunsResponse) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ListOfRunsResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["data"] = o.Data + return toSerialize, nil +} + +func (o *ListOfRunsResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "data", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varListOfRunsResponse := _ListOfRunsResponse{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varListOfRunsResponse) + + if err != nil { + return err + } + + *o = ListOfRunsResponse(varListOfRunsResponse) + + return err +} + +type NullableListOfRunsResponse struct { + value *ListOfRunsResponse + isSet bool +} + +func (v NullableListOfRunsResponse) Get() *ListOfRunsResponse { + return v.value +} + +func (v *NullableListOfRunsResponse) Set(val *ListOfRunsResponse) { + v.value = val + v.isSet = true +} + +func (v NullableListOfRunsResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableListOfRunsResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListOfRunsResponse(val *ListOfRunsResponse) *NullableListOfRunsResponse { + return &NullableListOfRunsResponse{value: val, isSet: true} +} + +func (v NullableListOfRunsResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListOfRunsResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_list_of_schedules.go b/model_list_of_schedules.go new file mode 100644 index 0000000..422a7f2 --- /dev/null +++ b/model_list_of_schedules.go @@ -0,0 +1,303 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" + "bytes" + "fmt" +) + +// checks if the ListOfSchedules type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ListOfSchedules{} + +// ListOfSchedules struct for ListOfSchedules +type ListOfSchedules struct { + // The total number of items available across all pages. + Total int32 `json:"total"` + // The starting position for this page of results. + Offset int32 `json:"offset"` + // The maximum number of items returned per page. + Limit int32 `json:"limit"` + // Whether the results are sorted in descending order. + Desc bool `json:"desc"` + // The number of items returned in this response. + Count int32 `json:"count"` + Items []ScheduleShort `json:"items"` +} + +type _ListOfSchedules ListOfSchedules + +// NewListOfSchedules instantiates a new ListOfSchedules object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewListOfSchedules(total int32, offset int32, limit int32, desc bool, count int32, items []ScheduleShort) *ListOfSchedules { + this := ListOfSchedules{} + this.Total = total + this.Offset = offset + this.Limit = limit + this.Desc = desc + this.Count = count + this.Items = items + return &this +} + +// NewListOfSchedulesWithDefaults instantiates a new ListOfSchedules object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewListOfSchedulesWithDefaults() *ListOfSchedules { + this := ListOfSchedules{} + return &this +} + +// GetTotal returns the Total field value +func (o *ListOfSchedules) GetTotal() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Total +} + +// GetTotalOk returns a tuple with the Total field value +// and a boolean to check if the value has been set. +func (o *ListOfSchedules) GetTotalOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Total, true +} + +// SetTotal sets field value +func (o *ListOfSchedules) SetTotal(v int32) { + o.Total = v +} + +// GetOffset returns the Offset field value +func (o *ListOfSchedules) GetOffset() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Offset +} + +// GetOffsetOk returns a tuple with the Offset field value +// and a boolean to check if the value has been set. +func (o *ListOfSchedules) GetOffsetOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Offset, true +} + +// SetOffset sets field value +func (o *ListOfSchedules) SetOffset(v int32) { + o.Offset = v +} + +// GetLimit returns the Limit field value +func (o *ListOfSchedules) GetLimit() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Limit +} + +// GetLimitOk returns a tuple with the Limit field value +// and a boolean to check if the value has been set. +func (o *ListOfSchedules) GetLimitOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Limit, true +} + +// SetLimit sets field value +func (o *ListOfSchedules) SetLimit(v int32) { + o.Limit = v +} + +// GetDesc returns the Desc field value +func (o *ListOfSchedules) GetDesc() bool { + if o == nil { + var ret bool + return ret + } + + return o.Desc +} + +// GetDescOk returns a tuple with the Desc field value +// and a boolean to check if the value has been set. +func (o *ListOfSchedules) GetDescOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.Desc, true +} + +// SetDesc sets field value +func (o *ListOfSchedules) SetDesc(v bool) { + o.Desc = v +} + +// GetCount returns the Count field value +func (o *ListOfSchedules) GetCount() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Count +} + +// GetCountOk returns a tuple with the Count field value +// and a boolean to check if the value has been set. +func (o *ListOfSchedules) GetCountOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Count, true +} + +// SetCount sets field value +func (o *ListOfSchedules) SetCount(v int32) { + o.Count = v +} + +// GetItems returns the Items field value +func (o *ListOfSchedules) GetItems() []ScheduleShort { + if o == nil { + var ret []ScheduleShort + return ret + } + + return o.Items +} + +// GetItemsOk returns a tuple with the Items field value +// and a boolean to check if the value has been set. +func (o *ListOfSchedules) GetItemsOk() ([]ScheduleShort, bool) { + if o == nil { + return nil, false + } + return o.Items, true +} + +// SetItems sets field value +func (o *ListOfSchedules) SetItems(v []ScheduleShort) { + o.Items = v +} + +func (o ListOfSchedules) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ListOfSchedules) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["total"] = o.Total + toSerialize["offset"] = o.Offset + toSerialize["limit"] = o.Limit + toSerialize["desc"] = o.Desc + toSerialize["count"] = o.Count + toSerialize["items"] = o.Items + return toSerialize, nil +} + +func (o *ListOfSchedules) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "total", + "offset", + "limit", + "desc", + "count", + "items", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varListOfSchedules := _ListOfSchedules{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varListOfSchedules) + + if err != nil { + return err + } + + *o = ListOfSchedules(varListOfSchedules) + + return err +} + +type NullableListOfSchedules struct { + value *ListOfSchedules + isSet bool +} + +func (v NullableListOfSchedules) Get() *ListOfSchedules { + return v.value +} + +func (v *NullableListOfSchedules) Set(val *ListOfSchedules) { + v.value = val + v.isSet = true +} + +func (v NullableListOfSchedules) IsSet() bool { + return v.isSet +} + +func (v *NullableListOfSchedules) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListOfSchedules(val *ListOfSchedules) *NullableListOfSchedules { + return &NullableListOfSchedules{value: val, isSet: true} +} + +func (v NullableListOfSchedules) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListOfSchedules) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_list_of_schedules_response.go b/model_list_of_schedules_response.go new file mode 100644 index 0000000..5414901 --- /dev/null +++ b/model_list_of_schedules_response.go @@ -0,0 +1,158 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" + "bytes" + "fmt" +) + +// checks if the ListOfSchedulesResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ListOfSchedulesResponse{} + +// ListOfSchedulesResponse struct for ListOfSchedulesResponse +type ListOfSchedulesResponse struct { + Data ListOfSchedules `json:"data"` +} + +type _ListOfSchedulesResponse ListOfSchedulesResponse + +// NewListOfSchedulesResponse instantiates a new ListOfSchedulesResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewListOfSchedulesResponse(data ListOfSchedules) *ListOfSchedulesResponse { + this := ListOfSchedulesResponse{} + this.Data = data + return &this +} + +// NewListOfSchedulesResponseWithDefaults instantiates a new ListOfSchedulesResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewListOfSchedulesResponseWithDefaults() *ListOfSchedulesResponse { + this := ListOfSchedulesResponse{} + return &this +} + +// GetData returns the Data field value +func (o *ListOfSchedulesResponse) GetData() ListOfSchedules { + if o == nil { + var ret ListOfSchedules + return ret + } + + return o.Data +} + +// GetDataOk returns a tuple with the Data field value +// and a boolean to check if the value has been set. +func (o *ListOfSchedulesResponse) GetDataOk() (*ListOfSchedules, bool) { + if o == nil { + return nil, false + } + return &o.Data, true +} + +// SetData sets field value +func (o *ListOfSchedulesResponse) SetData(v ListOfSchedules) { + o.Data = v +} + +func (o ListOfSchedulesResponse) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ListOfSchedulesResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["data"] = o.Data + return toSerialize, nil +} + +func (o *ListOfSchedulesResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "data", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varListOfSchedulesResponse := _ListOfSchedulesResponse{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varListOfSchedulesResponse) + + if err != nil { + return err + } + + *o = ListOfSchedulesResponse(varListOfSchedulesResponse) + + return err +} + +type NullableListOfSchedulesResponse struct { + value *ListOfSchedulesResponse + isSet bool +} + +func (v NullableListOfSchedulesResponse) Get() *ListOfSchedulesResponse { + return v.value +} + +func (v *NullableListOfSchedulesResponse) Set(val *ListOfSchedulesResponse) { + v.value = val + v.isSet = true +} + +func (v NullableListOfSchedulesResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableListOfSchedulesResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListOfSchedulesResponse(val *ListOfSchedulesResponse) *NullableListOfSchedulesResponse { + return &NullableListOfSchedulesResponse{value: val, isSet: true} +} + +func (v NullableListOfSchedulesResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListOfSchedulesResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_list_of_store_actors.go b/model_list_of_store_actors.go new file mode 100644 index 0000000..b599a0e --- /dev/null +++ b/model_list_of_store_actors.go @@ -0,0 +1,303 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" + "bytes" + "fmt" +) + +// checks if the ListOfStoreActors type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ListOfStoreActors{} + +// ListOfStoreActors struct for ListOfStoreActors +type ListOfStoreActors struct { + // The total number of items available across all pages. + Total int32 `json:"total"` + // The starting position for this page of results. + Offset int32 `json:"offset"` + // The maximum number of items returned per page. + Limit int32 `json:"limit"` + // Whether the results are sorted in descending order. + Desc bool `json:"desc"` + // The number of items returned in this response. + Count int32 `json:"count"` + Items []StoreListActor `json:"items"` +} + +type _ListOfStoreActors ListOfStoreActors + +// NewListOfStoreActors instantiates a new ListOfStoreActors object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewListOfStoreActors(total int32, offset int32, limit int32, desc bool, count int32, items []StoreListActor) *ListOfStoreActors { + this := ListOfStoreActors{} + this.Total = total + this.Offset = offset + this.Limit = limit + this.Desc = desc + this.Count = count + this.Items = items + return &this +} + +// NewListOfStoreActorsWithDefaults instantiates a new ListOfStoreActors object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewListOfStoreActorsWithDefaults() *ListOfStoreActors { + this := ListOfStoreActors{} + return &this +} + +// GetTotal returns the Total field value +func (o *ListOfStoreActors) GetTotal() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Total +} + +// GetTotalOk returns a tuple with the Total field value +// and a boolean to check if the value has been set. +func (o *ListOfStoreActors) GetTotalOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Total, true +} + +// SetTotal sets field value +func (o *ListOfStoreActors) SetTotal(v int32) { + o.Total = v +} + +// GetOffset returns the Offset field value +func (o *ListOfStoreActors) GetOffset() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Offset +} + +// GetOffsetOk returns a tuple with the Offset field value +// and a boolean to check if the value has been set. +func (o *ListOfStoreActors) GetOffsetOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Offset, true +} + +// SetOffset sets field value +func (o *ListOfStoreActors) SetOffset(v int32) { + o.Offset = v +} + +// GetLimit returns the Limit field value +func (o *ListOfStoreActors) GetLimit() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Limit +} + +// GetLimitOk returns a tuple with the Limit field value +// and a boolean to check if the value has been set. +func (o *ListOfStoreActors) GetLimitOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Limit, true +} + +// SetLimit sets field value +func (o *ListOfStoreActors) SetLimit(v int32) { + o.Limit = v +} + +// GetDesc returns the Desc field value +func (o *ListOfStoreActors) GetDesc() bool { + if o == nil { + var ret bool + return ret + } + + return o.Desc +} + +// GetDescOk returns a tuple with the Desc field value +// and a boolean to check if the value has been set. +func (o *ListOfStoreActors) GetDescOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.Desc, true +} + +// SetDesc sets field value +func (o *ListOfStoreActors) SetDesc(v bool) { + o.Desc = v +} + +// GetCount returns the Count field value +func (o *ListOfStoreActors) GetCount() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Count +} + +// GetCountOk returns a tuple with the Count field value +// and a boolean to check if the value has been set. +func (o *ListOfStoreActors) GetCountOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Count, true +} + +// SetCount sets field value +func (o *ListOfStoreActors) SetCount(v int32) { + o.Count = v +} + +// GetItems returns the Items field value +func (o *ListOfStoreActors) GetItems() []StoreListActor { + if o == nil { + var ret []StoreListActor + return ret + } + + return o.Items +} + +// GetItemsOk returns a tuple with the Items field value +// and a boolean to check if the value has been set. +func (o *ListOfStoreActors) GetItemsOk() ([]StoreListActor, bool) { + if o == nil { + return nil, false + } + return o.Items, true +} + +// SetItems sets field value +func (o *ListOfStoreActors) SetItems(v []StoreListActor) { + o.Items = v +} + +func (o ListOfStoreActors) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ListOfStoreActors) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["total"] = o.Total + toSerialize["offset"] = o.Offset + toSerialize["limit"] = o.Limit + toSerialize["desc"] = o.Desc + toSerialize["count"] = o.Count + toSerialize["items"] = o.Items + return toSerialize, nil +} + +func (o *ListOfStoreActors) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "total", + "offset", + "limit", + "desc", + "count", + "items", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varListOfStoreActors := _ListOfStoreActors{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varListOfStoreActors) + + if err != nil { + return err + } + + *o = ListOfStoreActors(varListOfStoreActors) + + return err +} + +type NullableListOfStoreActors struct { + value *ListOfStoreActors + isSet bool +} + +func (v NullableListOfStoreActors) Get() *ListOfStoreActors { + return v.value +} + +func (v *NullableListOfStoreActors) Set(val *ListOfStoreActors) { + v.value = val + v.isSet = true +} + +func (v NullableListOfStoreActors) IsSet() bool { + return v.isSet +} + +func (v *NullableListOfStoreActors) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListOfStoreActors(val *ListOfStoreActors) *NullableListOfStoreActors { + return &NullableListOfStoreActors{value: val, isSet: true} +} + +func (v NullableListOfStoreActors) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListOfStoreActors) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_list_of_tasks.go b/model_list_of_tasks.go new file mode 100644 index 0000000..379bfd9 --- /dev/null +++ b/model_list_of_tasks.go @@ -0,0 +1,303 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" + "bytes" + "fmt" +) + +// checks if the ListOfTasks type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ListOfTasks{} + +// ListOfTasks struct for ListOfTasks +type ListOfTasks struct { + // The total number of items available across all pages. + Total int32 `json:"total"` + // The starting position for this page of results. + Offset int32 `json:"offset"` + // The maximum number of items returned per page. + Limit int32 `json:"limit"` + // Whether the results are sorted in descending order. + Desc bool `json:"desc"` + // The number of items returned in this response. + Count int32 `json:"count"` + Items []TaskShort `json:"items"` +} + +type _ListOfTasks ListOfTasks + +// NewListOfTasks instantiates a new ListOfTasks object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewListOfTasks(total int32, offset int32, limit int32, desc bool, count int32, items []TaskShort) *ListOfTasks { + this := ListOfTasks{} + this.Total = total + this.Offset = offset + this.Limit = limit + this.Desc = desc + this.Count = count + this.Items = items + return &this +} + +// NewListOfTasksWithDefaults instantiates a new ListOfTasks object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewListOfTasksWithDefaults() *ListOfTasks { + this := ListOfTasks{} + return &this +} + +// GetTotal returns the Total field value +func (o *ListOfTasks) GetTotal() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Total +} + +// GetTotalOk returns a tuple with the Total field value +// and a boolean to check if the value has been set. +func (o *ListOfTasks) GetTotalOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Total, true +} + +// SetTotal sets field value +func (o *ListOfTasks) SetTotal(v int32) { + o.Total = v +} + +// GetOffset returns the Offset field value +func (o *ListOfTasks) GetOffset() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Offset +} + +// GetOffsetOk returns a tuple with the Offset field value +// and a boolean to check if the value has been set. +func (o *ListOfTasks) GetOffsetOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Offset, true +} + +// SetOffset sets field value +func (o *ListOfTasks) SetOffset(v int32) { + o.Offset = v +} + +// GetLimit returns the Limit field value +func (o *ListOfTasks) GetLimit() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Limit +} + +// GetLimitOk returns a tuple with the Limit field value +// and a boolean to check if the value has been set. +func (o *ListOfTasks) GetLimitOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Limit, true +} + +// SetLimit sets field value +func (o *ListOfTasks) SetLimit(v int32) { + o.Limit = v +} + +// GetDesc returns the Desc field value +func (o *ListOfTasks) GetDesc() bool { + if o == nil { + var ret bool + return ret + } + + return o.Desc +} + +// GetDescOk returns a tuple with the Desc field value +// and a boolean to check if the value has been set. +func (o *ListOfTasks) GetDescOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.Desc, true +} + +// SetDesc sets field value +func (o *ListOfTasks) SetDesc(v bool) { + o.Desc = v +} + +// GetCount returns the Count field value +func (o *ListOfTasks) GetCount() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Count +} + +// GetCountOk returns a tuple with the Count field value +// and a boolean to check if the value has been set. +func (o *ListOfTasks) GetCountOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Count, true +} + +// SetCount sets field value +func (o *ListOfTasks) SetCount(v int32) { + o.Count = v +} + +// GetItems returns the Items field value +func (o *ListOfTasks) GetItems() []TaskShort { + if o == nil { + var ret []TaskShort + return ret + } + + return o.Items +} + +// GetItemsOk returns a tuple with the Items field value +// and a boolean to check if the value has been set. +func (o *ListOfTasks) GetItemsOk() ([]TaskShort, bool) { + if o == nil { + return nil, false + } + return o.Items, true +} + +// SetItems sets field value +func (o *ListOfTasks) SetItems(v []TaskShort) { + o.Items = v +} + +func (o ListOfTasks) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ListOfTasks) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["total"] = o.Total + toSerialize["offset"] = o.Offset + toSerialize["limit"] = o.Limit + toSerialize["desc"] = o.Desc + toSerialize["count"] = o.Count + toSerialize["items"] = o.Items + return toSerialize, nil +} + +func (o *ListOfTasks) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "total", + "offset", + "limit", + "desc", + "count", + "items", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varListOfTasks := _ListOfTasks{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varListOfTasks) + + if err != nil { + return err + } + + *o = ListOfTasks(varListOfTasks) + + return err +} + +type NullableListOfTasks struct { + value *ListOfTasks + isSet bool +} + +func (v NullableListOfTasks) Get() *ListOfTasks { + return v.value +} + +func (v *NullableListOfTasks) Set(val *ListOfTasks) { + v.value = val + v.isSet = true +} + +func (v NullableListOfTasks) IsSet() bool { + return v.isSet +} + +func (v *NullableListOfTasks) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListOfTasks(val *ListOfTasks) *NullableListOfTasks { + return &NullableListOfTasks{value: val, isSet: true} +} + +func (v NullableListOfTasks) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListOfTasks) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_list_of_tasks_response.go b/model_list_of_tasks_response.go new file mode 100644 index 0000000..0b299e0 --- /dev/null +++ b/model_list_of_tasks_response.go @@ -0,0 +1,158 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" + "bytes" + "fmt" +) + +// checks if the ListOfTasksResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ListOfTasksResponse{} + +// ListOfTasksResponse struct for ListOfTasksResponse +type ListOfTasksResponse struct { + Data ListOfTasks `json:"data"` +} + +type _ListOfTasksResponse ListOfTasksResponse + +// NewListOfTasksResponse instantiates a new ListOfTasksResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewListOfTasksResponse(data ListOfTasks) *ListOfTasksResponse { + this := ListOfTasksResponse{} + this.Data = data + return &this +} + +// NewListOfTasksResponseWithDefaults instantiates a new ListOfTasksResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewListOfTasksResponseWithDefaults() *ListOfTasksResponse { + this := ListOfTasksResponse{} + return &this +} + +// GetData returns the Data field value +func (o *ListOfTasksResponse) GetData() ListOfTasks { + if o == nil { + var ret ListOfTasks + return ret + } + + return o.Data +} + +// GetDataOk returns a tuple with the Data field value +// and a boolean to check if the value has been set. +func (o *ListOfTasksResponse) GetDataOk() (*ListOfTasks, bool) { + if o == nil { + return nil, false + } + return &o.Data, true +} + +// SetData sets field value +func (o *ListOfTasksResponse) SetData(v ListOfTasks) { + o.Data = v +} + +func (o ListOfTasksResponse) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ListOfTasksResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["data"] = o.Data + return toSerialize, nil +} + +func (o *ListOfTasksResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "data", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varListOfTasksResponse := _ListOfTasksResponse{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varListOfTasksResponse) + + if err != nil { + return err + } + + *o = ListOfTasksResponse(varListOfTasksResponse) + + return err +} + +type NullableListOfTasksResponse struct { + value *ListOfTasksResponse + isSet bool +} + +func (v NullableListOfTasksResponse) Get() *ListOfTasksResponse { + return v.value +} + +func (v *NullableListOfTasksResponse) Set(val *ListOfTasksResponse) { + v.value = val + v.isSet = true +} + +func (v NullableListOfTasksResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableListOfTasksResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListOfTasksResponse(val *ListOfTasksResponse) *NullableListOfTasksResponse { + return &NullableListOfTasksResponse{value: val, isSet: true} +} + +func (v NullableListOfTasksResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListOfTasksResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_list_of_versions.go b/model_list_of_versions.go new file mode 100644 index 0000000..18049b7 --- /dev/null +++ b/model_list_of_versions.go @@ -0,0 +1,187 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" + "bytes" + "fmt" +) + +// checks if the ListOfVersions type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ListOfVersions{} + +// ListOfVersions struct for ListOfVersions +type ListOfVersions struct { + Total int32 `json:"total"` + // + Items []Version `json:"items"` +} + +type _ListOfVersions ListOfVersions + +// NewListOfVersions instantiates a new ListOfVersions object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewListOfVersions(total int32, items []Version) *ListOfVersions { + this := ListOfVersions{} + this.Total = total + this.Items = items + return &this +} + +// NewListOfVersionsWithDefaults instantiates a new ListOfVersions object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewListOfVersionsWithDefaults() *ListOfVersions { + this := ListOfVersions{} + return &this +} + +// GetTotal returns the Total field value +func (o *ListOfVersions) GetTotal() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Total +} + +// GetTotalOk returns a tuple with the Total field value +// and a boolean to check if the value has been set. +func (o *ListOfVersions) GetTotalOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Total, true +} + +// SetTotal sets field value +func (o *ListOfVersions) SetTotal(v int32) { + o.Total = v +} + +// GetItems returns the Items field value +func (o *ListOfVersions) GetItems() []Version { + if o == nil { + var ret []Version + return ret + } + + return o.Items +} + +// GetItemsOk returns a tuple with the Items field value +// and a boolean to check if the value has been set. +func (o *ListOfVersions) GetItemsOk() ([]Version, bool) { + if o == nil { + return nil, false + } + return o.Items, true +} + +// SetItems sets field value +func (o *ListOfVersions) SetItems(v []Version) { + o.Items = v +} + +func (o ListOfVersions) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ListOfVersions) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["total"] = o.Total + toSerialize["items"] = o.Items + return toSerialize, nil +} + +func (o *ListOfVersions) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "total", + "items", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varListOfVersions := _ListOfVersions{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varListOfVersions) + + if err != nil { + return err + } + + *o = ListOfVersions(varListOfVersions) + + return err +} + +type NullableListOfVersions struct { + value *ListOfVersions + isSet bool +} + +func (v NullableListOfVersions) Get() *ListOfVersions { + return v.value +} + +func (v *NullableListOfVersions) Set(val *ListOfVersions) { + v.value = val + v.isSet = true +} + +func (v NullableListOfVersions) IsSet() bool { + return v.isSet +} + +func (v *NullableListOfVersions) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListOfVersions(val *ListOfVersions) *NullableListOfVersions { + return &NullableListOfVersions{value: val, isSet: true} +} + +func (v NullableListOfVersions) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListOfVersions) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_list_of_versions_response.go b/model_list_of_versions_response.go new file mode 100644 index 0000000..dc413d1 --- /dev/null +++ b/model_list_of_versions_response.go @@ -0,0 +1,158 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" + "bytes" + "fmt" +) + +// checks if the ListOfVersionsResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ListOfVersionsResponse{} + +// ListOfVersionsResponse struct for ListOfVersionsResponse +type ListOfVersionsResponse struct { + Data ListOfVersions `json:"data"` +} + +type _ListOfVersionsResponse ListOfVersionsResponse + +// NewListOfVersionsResponse instantiates a new ListOfVersionsResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewListOfVersionsResponse(data ListOfVersions) *ListOfVersionsResponse { + this := ListOfVersionsResponse{} + this.Data = data + return &this +} + +// NewListOfVersionsResponseWithDefaults instantiates a new ListOfVersionsResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewListOfVersionsResponseWithDefaults() *ListOfVersionsResponse { + this := ListOfVersionsResponse{} + return &this +} + +// GetData returns the Data field value +func (o *ListOfVersionsResponse) GetData() ListOfVersions { + if o == nil { + var ret ListOfVersions + return ret + } + + return o.Data +} + +// GetDataOk returns a tuple with the Data field value +// and a boolean to check if the value has been set. +func (o *ListOfVersionsResponse) GetDataOk() (*ListOfVersions, bool) { + if o == nil { + return nil, false + } + return &o.Data, true +} + +// SetData sets field value +func (o *ListOfVersionsResponse) SetData(v ListOfVersions) { + o.Data = v +} + +func (o ListOfVersionsResponse) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ListOfVersionsResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["data"] = o.Data + return toSerialize, nil +} + +func (o *ListOfVersionsResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "data", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varListOfVersionsResponse := _ListOfVersionsResponse{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varListOfVersionsResponse) + + if err != nil { + return err + } + + *o = ListOfVersionsResponse(varListOfVersionsResponse) + + return err +} + +type NullableListOfVersionsResponse struct { + value *ListOfVersionsResponse + isSet bool +} + +func (v NullableListOfVersionsResponse) Get() *ListOfVersionsResponse { + return v.value +} + +func (v *NullableListOfVersionsResponse) Set(val *ListOfVersionsResponse) { + v.value = val + v.isSet = true +} + +func (v NullableListOfVersionsResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableListOfVersionsResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListOfVersionsResponse(val *ListOfVersionsResponse) *NullableListOfVersionsResponse { + return &NullableListOfVersionsResponse{value: val, isSet: true} +} + +func (v NullableListOfVersionsResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListOfVersionsResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_list_of_webhook_dispatches.go b/model_list_of_webhook_dispatches.go new file mode 100644 index 0000000..c8e7d9d --- /dev/null +++ b/model_list_of_webhook_dispatches.go @@ -0,0 +1,303 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" + "bytes" + "fmt" +) + +// checks if the ListOfWebhookDispatches type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ListOfWebhookDispatches{} + +// ListOfWebhookDispatches struct for ListOfWebhookDispatches +type ListOfWebhookDispatches struct { + // The total number of items available across all pages. + Total int32 `json:"total"` + // The starting position for this page of results. + Offset int32 `json:"offset"` + // The maximum number of items returned per page. + Limit int32 `json:"limit"` + // Whether the results are sorted in descending order. + Desc bool `json:"desc"` + // The number of items returned in this response. + Count int32 `json:"count"` + Items []WebhookDispatch `json:"items"` +} + +type _ListOfWebhookDispatches ListOfWebhookDispatches + +// NewListOfWebhookDispatches instantiates a new ListOfWebhookDispatches object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewListOfWebhookDispatches(total int32, offset int32, limit int32, desc bool, count int32, items []WebhookDispatch) *ListOfWebhookDispatches { + this := ListOfWebhookDispatches{} + this.Total = total + this.Offset = offset + this.Limit = limit + this.Desc = desc + this.Count = count + this.Items = items + return &this +} + +// NewListOfWebhookDispatchesWithDefaults instantiates a new ListOfWebhookDispatches object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewListOfWebhookDispatchesWithDefaults() *ListOfWebhookDispatches { + this := ListOfWebhookDispatches{} + return &this +} + +// GetTotal returns the Total field value +func (o *ListOfWebhookDispatches) GetTotal() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Total +} + +// GetTotalOk returns a tuple with the Total field value +// and a boolean to check if the value has been set. +func (o *ListOfWebhookDispatches) GetTotalOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Total, true +} + +// SetTotal sets field value +func (o *ListOfWebhookDispatches) SetTotal(v int32) { + o.Total = v +} + +// GetOffset returns the Offset field value +func (o *ListOfWebhookDispatches) GetOffset() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Offset +} + +// GetOffsetOk returns a tuple with the Offset field value +// and a boolean to check if the value has been set. +func (o *ListOfWebhookDispatches) GetOffsetOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Offset, true +} + +// SetOffset sets field value +func (o *ListOfWebhookDispatches) SetOffset(v int32) { + o.Offset = v +} + +// GetLimit returns the Limit field value +func (o *ListOfWebhookDispatches) GetLimit() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Limit +} + +// GetLimitOk returns a tuple with the Limit field value +// and a boolean to check if the value has been set. +func (o *ListOfWebhookDispatches) GetLimitOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Limit, true +} + +// SetLimit sets field value +func (o *ListOfWebhookDispatches) SetLimit(v int32) { + o.Limit = v +} + +// GetDesc returns the Desc field value +func (o *ListOfWebhookDispatches) GetDesc() bool { + if o == nil { + var ret bool + return ret + } + + return o.Desc +} + +// GetDescOk returns a tuple with the Desc field value +// and a boolean to check if the value has been set. +func (o *ListOfWebhookDispatches) GetDescOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.Desc, true +} + +// SetDesc sets field value +func (o *ListOfWebhookDispatches) SetDesc(v bool) { + o.Desc = v +} + +// GetCount returns the Count field value +func (o *ListOfWebhookDispatches) GetCount() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Count +} + +// GetCountOk returns a tuple with the Count field value +// and a boolean to check if the value has been set. +func (o *ListOfWebhookDispatches) GetCountOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Count, true +} + +// SetCount sets field value +func (o *ListOfWebhookDispatches) SetCount(v int32) { + o.Count = v +} + +// GetItems returns the Items field value +func (o *ListOfWebhookDispatches) GetItems() []WebhookDispatch { + if o == nil { + var ret []WebhookDispatch + return ret + } + + return o.Items +} + +// GetItemsOk returns a tuple with the Items field value +// and a boolean to check if the value has been set. +func (o *ListOfWebhookDispatches) GetItemsOk() ([]WebhookDispatch, bool) { + if o == nil { + return nil, false + } + return o.Items, true +} + +// SetItems sets field value +func (o *ListOfWebhookDispatches) SetItems(v []WebhookDispatch) { + o.Items = v +} + +func (o ListOfWebhookDispatches) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ListOfWebhookDispatches) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["total"] = o.Total + toSerialize["offset"] = o.Offset + toSerialize["limit"] = o.Limit + toSerialize["desc"] = o.Desc + toSerialize["count"] = o.Count + toSerialize["items"] = o.Items + return toSerialize, nil +} + +func (o *ListOfWebhookDispatches) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "total", + "offset", + "limit", + "desc", + "count", + "items", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varListOfWebhookDispatches := _ListOfWebhookDispatches{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varListOfWebhookDispatches) + + if err != nil { + return err + } + + *o = ListOfWebhookDispatches(varListOfWebhookDispatches) + + return err +} + +type NullableListOfWebhookDispatches struct { + value *ListOfWebhookDispatches + isSet bool +} + +func (v NullableListOfWebhookDispatches) Get() *ListOfWebhookDispatches { + return v.value +} + +func (v *NullableListOfWebhookDispatches) Set(val *ListOfWebhookDispatches) { + v.value = val + v.isSet = true +} + +func (v NullableListOfWebhookDispatches) IsSet() bool { + return v.isSet +} + +func (v *NullableListOfWebhookDispatches) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListOfWebhookDispatches(val *ListOfWebhookDispatches) *NullableListOfWebhookDispatches { + return &NullableListOfWebhookDispatches{value: val, isSet: true} +} + +func (v NullableListOfWebhookDispatches) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListOfWebhookDispatches) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_list_of_webhook_dispatches_response.go b/model_list_of_webhook_dispatches_response.go new file mode 100644 index 0000000..336a2b4 --- /dev/null +++ b/model_list_of_webhook_dispatches_response.go @@ -0,0 +1,158 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" + "bytes" + "fmt" +) + +// checks if the ListOfWebhookDispatchesResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ListOfWebhookDispatchesResponse{} + +// ListOfWebhookDispatchesResponse struct for ListOfWebhookDispatchesResponse +type ListOfWebhookDispatchesResponse struct { + Data ListOfWebhookDispatches `json:"data"` +} + +type _ListOfWebhookDispatchesResponse ListOfWebhookDispatchesResponse + +// NewListOfWebhookDispatchesResponse instantiates a new ListOfWebhookDispatchesResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewListOfWebhookDispatchesResponse(data ListOfWebhookDispatches) *ListOfWebhookDispatchesResponse { + this := ListOfWebhookDispatchesResponse{} + this.Data = data + return &this +} + +// NewListOfWebhookDispatchesResponseWithDefaults instantiates a new ListOfWebhookDispatchesResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewListOfWebhookDispatchesResponseWithDefaults() *ListOfWebhookDispatchesResponse { + this := ListOfWebhookDispatchesResponse{} + return &this +} + +// GetData returns the Data field value +func (o *ListOfWebhookDispatchesResponse) GetData() ListOfWebhookDispatches { + if o == nil { + var ret ListOfWebhookDispatches + return ret + } + + return o.Data +} + +// GetDataOk returns a tuple with the Data field value +// and a boolean to check if the value has been set. +func (o *ListOfWebhookDispatchesResponse) GetDataOk() (*ListOfWebhookDispatches, bool) { + if o == nil { + return nil, false + } + return &o.Data, true +} + +// SetData sets field value +func (o *ListOfWebhookDispatchesResponse) SetData(v ListOfWebhookDispatches) { + o.Data = v +} + +func (o ListOfWebhookDispatchesResponse) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ListOfWebhookDispatchesResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["data"] = o.Data + return toSerialize, nil +} + +func (o *ListOfWebhookDispatchesResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "data", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varListOfWebhookDispatchesResponse := _ListOfWebhookDispatchesResponse{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varListOfWebhookDispatchesResponse) + + if err != nil { + return err + } + + *o = ListOfWebhookDispatchesResponse(varListOfWebhookDispatchesResponse) + + return err +} + +type NullableListOfWebhookDispatchesResponse struct { + value *ListOfWebhookDispatchesResponse + isSet bool +} + +func (v NullableListOfWebhookDispatchesResponse) Get() *ListOfWebhookDispatchesResponse { + return v.value +} + +func (v *NullableListOfWebhookDispatchesResponse) Set(val *ListOfWebhookDispatchesResponse) { + v.value = val + v.isSet = true +} + +func (v NullableListOfWebhookDispatchesResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableListOfWebhookDispatchesResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListOfWebhookDispatchesResponse(val *ListOfWebhookDispatchesResponse) *NullableListOfWebhookDispatchesResponse { + return &NullableListOfWebhookDispatchesResponse{value: val, isSet: true} +} + +func (v NullableListOfWebhookDispatchesResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListOfWebhookDispatchesResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_list_of_webhooks.go b/model_list_of_webhooks.go new file mode 100644 index 0000000..b293139 --- /dev/null +++ b/model_list_of_webhooks.go @@ -0,0 +1,303 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" + "bytes" + "fmt" +) + +// checks if the ListOfWebhooks type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ListOfWebhooks{} + +// ListOfWebhooks struct for ListOfWebhooks +type ListOfWebhooks struct { + // The total number of items available across all pages. + Total int32 `json:"total"` + // The starting position for this page of results. + Offset int32 `json:"offset"` + // The maximum number of items returned per page. + Limit int32 `json:"limit"` + // Whether the results are sorted in descending order. + Desc bool `json:"desc"` + // The number of items returned in this response. + Count int32 `json:"count"` + Items []WebhookShort `json:"items"` +} + +type _ListOfWebhooks ListOfWebhooks + +// NewListOfWebhooks instantiates a new ListOfWebhooks object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewListOfWebhooks(total int32, offset int32, limit int32, desc bool, count int32, items []WebhookShort) *ListOfWebhooks { + this := ListOfWebhooks{} + this.Total = total + this.Offset = offset + this.Limit = limit + this.Desc = desc + this.Count = count + this.Items = items + return &this +} + +// NewListOfWebhooksWithDefaults instantiates a new ListOfWebhooks object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewListOfWebhooksWithDefaults() *ListOfWebhooks { + this := ListOfWebhooks{} + return &this +} + +// GetTotal returns the Total field value +func (o *ListOfWebhooks) GetTotal() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Total +} + +// GetTotalOk returns a tuple with the Total field value +// and a boolean to check if the value has been set. +func (o *ListOfWebhooks) GetTotalOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Total, true +} + +// SetTotal sets field value +func (o *ListOfWebhooks) SetTotal(v int32) { + o.Total = v +} + +// GetOffset returns the Offset field value +func (o *ListOfWebhooks) GetOffset() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Offset +} + +// GetOffsetOk returns a tuple with the Offset field value +// and a boolean to check if the value has been set. +func (o *ListOfWebhooks) GetOffsetOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Offset, true +} + +// SetOffset sets field value +func (o *ListOfWebhooks) SetOffset(v int32) { + o.Offset = v +} + +// GetLimit returns the Limit field value +func (o *ListOfWebhooks) GetLimit() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Limit +} + +// GetLimitOk returns a tuple with the Limit field value +// and a boolean to check if the value has been set. +func (o *ListOfWebhooks) GetLimitOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Limit, true +} + +// SetLimit sets field value +func (o *ListOfWebhooks) SetLimit(v int32) { + o.Limit = v +} + +// GetDesc returns the Desc field value +func (o *ListOfWebhooks) GetDesc() bool { + if o == nil { + var ret bool + return ret + } + + return o.Desc +} + +// GetDescOk returns a tuple with the Desc field value +// and a boolean to check if the value has been set. +func (o *ListOfWebhooks) GetDescOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.Desc, true +} + +// SetDesc sets field value +func (o *ListOfWebhooks) SetDesc(v bool) { + o.Desc = v +} + +// GetCount returns the Count field value +func (o *ListOfWebhooks) GetCount() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Count +} + +// GetCountOk returns a tuple with the Count field value +// and a boolean to check if the value has been set. +func (o *ListOfWebhooks) GetCountOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Count, true +} + +// SetCount sets field value +func (o *ListOfWebhooks) SetCount(v int32) { + o.Count = v +} + +// GetItems returns the Items field value +func (o *ListOfWebhooks) GetItems() []WebhookShort { + if o == nil { + var ret []WebhookShort + return ret + } + + return o.Items +} + +// GetItemsOk returns a tuple with the Items field value +// and a boolean to check if the value has been set. +func (o *ListOfWebhooks) GetItemsOk() ([]WebhookShort, bool) { + if o == nil { + return nil, false + } + return o.Items, true +} + +// SetItems sets field value +func (o *ListOfWebhooks) SetItems(v []WebhookShort) { + o.Items = v +} + +func (o ListOfWebhooks) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ListOfWebhooks) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["total"] = o.Total + toSerialize["offset"] = o.Offset + toSerialize["limit"] = o.Limit + toSerialize["desc"] = o.Desc + toSerialize["count"] = o.Count + toSerialize["items"] = o.Items + return toSerialize, nil +} + +func (o *ListOfWebhooks) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "total", + "offset", + "limit", + "desc", + "count", + "items", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varListOfWebhooks := _ListOfWebhooks{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varListOfWebhooks) + + if err != nil { + return err + } + + *o = ListOfWebhooks(varListOfWebhooks) + + return err +} + +type NullableListOfWebhooks struct { + value *ListOfWebhooks + isSet bool +} + +func (v NullableListOfWebhooks) Get() *ListOfWebhooks { + return v.value +} + +func (v *NullableListOfWebhooks) Set(val *ListOfWebhooks) { + v.value = val + v.isSet = true +} + +func (v NullableListOfWebhooks) IsSet() bool { + return v.isSet +} + +func (v *NullableListOfWebhooks) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListOfWebhooks(val *ListOfWebhooks) *NullableListOfWebhooks { + return &NullableListOfWebhooks{value: val, isSet: true} +} + +func (v NullableListOfWebhooks) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListOfWebhooks) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_list_of_webhooks_response.go b/model_list_of_webhooks_response.go new file mode 100644 index 0000000..bbebf66 --- /dev/null +++ b/model_list_of_webhooks_response.go @@ -0,0 +1,158 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" + "bytes" + "fmt" +) + +// checks if the ListOfWebhooksResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ListOfWebhooksResponse{} + +// ListOfWebhooksResponse struct for ListOfWebhooksResponse +type ListOfWebhooksResponse struct { + Data ListOfWebhooks `json:"data"` +} + +type _ListOfWebhooksResponse ListOfWebhooksResponse + +// NewListOfWebhooksResponse instantiates a new ListOfWebhooksResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewListOfWebhooksResponse(data ListOfWebhooks) *ListOfWebhooksResponse { + this := ListOfWebhooksResponse{} + this.Data = data + return &this +} + +// NewListOfWebhooksResponseWithDefaults instantiates a new ListOfWebhooksResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewListOfWebhooksResponseWithDefaults() *ListOfWebhooksResponse { + this := ListOfWebhooksResponse{} + return &this +} + +// GetData returns the Data field value +func (o *ListOfWebhooksResponse) GetData() ListOfWebhooks { + if o == nil { + var ret ListOfWebhooks + return ret + } + + return o.Data +} + +// GetDataOk returns a tuple with the Data field value +// and a boolean to check if the value has been set. +func (o *ListOfWebhooksResponse) GetDataOk() (*ListOfWebhooks, bool) { + if o == nil { + return nil, false + } + return &o.Data, true +} + +// SetData sets field value +func (o *ListOfWebhooksResponse) SetData(v ListOfWebhooks) { + o.Data = v +} + +func (o ListOfWebhooksResponse) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ListOfWebhooksResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["data"] = o.Data + return toSerialize, nil +} + +func (o *ListOfWebhooksResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "data", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varListOfWebhooksResponse := _ListOfWebhooksResponse{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varListOfWebhooksResponse) + + if err != nil { + return err + } + + *o = ListOfWebhooksResponse(varListOfWebhooksResponse) + + return err +} + +type NullableListOfWebhooksResponse struct { + value *ListOfWebhooksResponse + isSet bool +} + +func (v NullableListOfWebhooksResponse) Get() *ListOfWebhooksResponse { + return v.value +} + +func (v *NullableListOfWebhooksResponse) Set(val *ListOfWebhooksResponse) { + v.value = val + v.isSet = true +} + +func (v NullableListOfWebhooksResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableListOfWebhooksResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListOfWebhooksResponse(val *ListOfWebhooksResponse) *NullableListOfWebhooksResponse { + return &NullableListOfWebhooksResponse{value: val, isSet: true} +} + +func (v NullableListOfWebhooksResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListOfWebhooksResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_locked_head_request.go b/model_locked_head_request.go new file mode 100644 index 0000000..3425faa --- /dev/null +++ b/model_locked_head_request.go @@ -0,0 +1,320 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" + "time" + "bytes" + "fmt" +) + +// checks if the LockedHeadRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &LockedHeadRequest{} + +// LockedHeadRequest A request from the request queue head that has been locked for processing. +type LockedHeadRequest struct { + // A unique identifier assigned to the request. + Id string `json:"id"` + // A unique key used for request de-duplication. Requests with the same unique key are considered identical. + UniqueKey string `json:"uniqueKey"` + // The URL of the request. + Url string `json:"url"` + Method *HttpMethod `json:"method,omitempty"` + // The number of times this request has been retried. + RetryCount *int32 `json:"retryCount,omitempty"` + // The timestamp when the lock on this request expires. + LockExpiresAt time.Time `json:"lockExpiresAt"` +} + +type _LockedHeadRequest LockedHeadRequest + +// NewLockedHeadRequest instantiates a new LockedHeadRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewLockedHeadRequest(id string, uniqueKey string, url string, lockExpiresAt time.Time) *LockedHeadRequest { + this := LockedHeadRequest{} + this.Id = id + this.UniqueKey = uniqueKey + this.Url = url + this.LockExpiresAt = lockExpiresAt + return &this +} + +// NewLockedHeadRequestWithDefaults instantiates a new LockedHeadRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewLockedHeadRequestWithDefaults() *LockedHeadRequest { + this := LockedHeadRequest{} + return &this +} + +// GetId returns the Id field value +func (o *LockedHeadRequest) GetId() string { + if o == nil { + var ret string + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *LockedHeadRequest) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *LockedHeadRequest) SetId(v string) { + o.Id = v +} + +// GetUniqueKey returns the UniqueKey field value +func (o *LockedHeadRequest) GetUniqueKey() string { + if o == nil { + var ret string + return ret + } + + return o.UniqueKey +} + +// GetUniqueKeyOk returns a tuple with the UniqueKey field value +// and a boolean to check if the value has been set. +func (o *LockedHeadRequest) GetUniqueKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.UniqueKey, true +} + +// SetUniqueKey sets field value +func (o *LockedHeadRequest) SetUniqueKey(v string) { + o.UniqueKey = v +} + +// GetUrl returns the Url field value +func (o *LockedHeadRequest) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *LockedHeadRequest) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *LockedHeadRequest) SetUrl(v string) { + o.Url = v +} + +// GetMethod returns the Method field value if set, zero value otherwise. +func (o *LockedHeadRequest) GetMethod() HttpMethod { + if o == nil || IsNil(o.Method) { + var ret HttpMethod + return ret + } + return *o.Method +} + +// GetMethodOk returns a tuple with the Method field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LockedHeadRequest) GetMethodOk() (*HttpMethod, bool) { + if o == nil || IsNil(o.Method) { + return nil, false + } + return o.Method, true +} + +// HasMethod returns a boolean if a field has been set. +func (o *LockedHeadRequest) HasMethod() bool { + if o != nil && !IsNil(o.Method) { + return true + } + + return false +} + +// SetMethod gets a reference to the given HttpMethod and assigns it to the Method field. +func (o *LockedHeadRequest) SetMethod(v HttpMethod) { + o.Method = &v +} + +// GetRetryCount returns the RetryCount field value if set, zero value otherwise. +func (o *LockedHeadRequest) GetRetryCount() int32 { + if o == nil || IsNil(o.RetryCount) { + var ret int32 + return ret + } + return *o.RetryCount +} + +// GetRetryCountOk returns a tuple with the RetryCount field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LockedHeadRequest) GetRetryCountOk() (*int32, bool) { + if o == nil || IsNil(o.RetryCount) { + return nil, false + } + return o.RetryCount, true +} + +// HasRetryCount returns a boolean if a field has been set. +func (o *LockedHeadRequest) HasRetryCount() bool { + if o != nil && !IsNil(o.RetryCount) { + return true + } + + return false +} + +// SetRetryCount gets a reference to the given int32 and assigns it to the RetryCount field. +func (o *LockedHeadRequest) SetRetryCount(v int32) { + o.RetryCount = &v +} + +// GetLockExpiresAt returns the LockExpiresAt field value +func (o *LockedHeadRequest) GetLockExpiresAt() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.LockExpiresAt +} + +// GetLockExpiresAtOk returns a tuple with the LockExpiresAt field value +// and a boolean to check if the value has been set. +func (o *LockedHeadRequest) GetLockExpiresAtOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.LockExpiresAt, true +} + +// SetLockExpiresAt sets field value +func (o *LockedHeadRequest) SetLockExpiresAt(v time.Time) { + o.LockExpiresAt = v +} + +func (o LockedHeadRequest) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o LockedHeadRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["uniqueKey"] = o.UniqueKey + toSerialize["url"] = o.Url + if !IsNil(o.Method) { + toSerialize["method"] = o.Method + } + if !IsNil(o.RetryCount) { + toSerialize["retryCount"] = o.RetryCount + } + toSerialize["lockExpiresAt"] = o.LockExpiresAt + return toSerialize, nil +} + +func (o *LockedHeadRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "uniqueKey", + "url", + "lockExpiresAt", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varLockedHeadRequest := _LockedHeadRequest{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varLockedHeadRequest) + + if err != nil { + return err + } + + *o = LockedHeadRequest(varLockedHeadRequest) + + return err +} + +type NullableLockedHeadRequest struct { + value *LockedHeadRequest + isSet bool +} + +func (v NullableLockedHeadRequest) Get() *LockedHeadRequest { + return v.value +} + +func (v *NullableLockedHeadRequest) Set(val *LockedHeadRequest) { + v.value = val + v.isSet = true +} + +func (v NullableLockedHeadRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableLockedHeadRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableLockedHeadRequest(val *LockedHeadRequest) *NullableLockedHeadRequest { + return &NullableLockedHeadRequest{value: val, isSet: true} +} + +func (v NullableLockedHeadRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableLockedHeadRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_locked_request_queue_head.go b/model_locked_request_queue_head.go new file mode 100644 index 0000000..e7d3df9 --- /dev/null +++ b/model_locked_request_queue_head.go @@ -0,0 +1,350 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" + "time" + "bytes" + "fmt" +) + +// checks if the LockedRequestQueueHead type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &LockedRequestQueueHead{} + +// LockedRequestQueueHead A batch of locked requests from the request queue head. +type LockedRequestQueueHead struct { + // The maximum number of requests returned. + Limit int32 `json:"limit"` + // The timestamp when the request queue was last modified. Modifications include adding, updating, or removing requests, as well as locking or unlocking requests in the request queue. + QueueModifiedAt time.Time `json:"queueModifiedAt"` + // Whether the request queue contains requests locked by any client (either the one calling the endpoint or a different one). + QueueHasLockedRequests *bool `json:"queueHasLockedRequests,omitempty"` + // The client key used for locking the requests. + ClientKey *string `json:"clientKey,omitempty"` + // Whether the request queue has been accessed by multiple different clients. + HadMultipleClients bool `json:"hadMultipleClients"` + // The number of seconds the locks will be held. + LockSecs int32 `json:"lockSecs"` + // The array of locked requests from the request queue head. + Items []LockedHeadRequest `json:"items"` +} + +type _LockedRequestQueueHead LockedRequestQueueHead + +// NewLockedRequestQueueHead instantiates a new LockedRequestQueueHead object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewLockedRequestQueueHead(limit int32, queueModifiedAt time.Time, hadMultipleClients bool, lockSecs int32, items []LockedHeadRequest) *LockedRequestQueueHead { + this := LockedRequestQueueHead{} + this.Limit = limit + this.QueueModifiedAt = queueModifiedAt + this.HadMultipleClients = hadMultipleClients + this.LockSecs = lockSecs + this.Items = items + return &this +} + +// NewLockedRequestQueueHeadWithDefaults instantiates a new LockedRequestQueueHead object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewLockedRequestQueueHeadWithDefaults() *LockedRequestQueueHead { + this := LockedRequestQueueHead{} + return &this +} + +// GetLimit returns the Limit field value +func (o *LockedRequestQueueHead) GetLimit() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Limit +} + +// GetLimitOk returns a tuple with the Limit field value +// and a boolean to check if the value has been set. +func (o *LockedRequestQueueHead) GetLimitOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Limit, true +} + +// SetLimit sets field value +func (o *LockedRequestQueueHead) SetLimit(v int32) { + o.Limit = v +} + +// GetQueueModifiedAt returns the QueueModifiedAt field value +func (o *LockedRequestQueueHead) GetQueueModifiedAt() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.QueueModifiedAt +} + +// GetQueueModifiedAtOk returns a tuple with the QueueModifiedAt field value +// and a boolean to check if the value has been set. +func (o *LockedRequestQueueHead) GetQueueModifiedAtOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.QueueModifiedAt, true +} + +// SetQueueModifiedAt sets field value +func (o *LockedRequestQueueHead) SetQueueModifiedAt(v time.Time) { + o.QueueModifiedAt = v +} + +// GetQueueHasLockedRequests returns the QueueHasLockedRequests field value if set, zero value otherwise. +func (o *LockedRequestQueueHead) GetQueueHasLockedRequests() bool { + if o == nil || IsNil(o.QueueHasLockedRequests) { + var ret bool + return ret + } + return *o.QueueHasLockedRequests +} + +// GetQueueHasLockedRequestsOk returns a tuple with the QueueHasLockedRequests field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LockedRequestQueueHead) GetQueueHasLockedRequestsOk() (*bool, bool) { + if o == nil || IsNil(o.QueueHasLockedRequests) { + return nil, false + } + return o.QueueHasLockedRequests, true +} + +// HasQueueHasLockedRequests returns a boolean if a field has been set. +func (o *LockedRequestQueueHead) HasQueueHasLockedRequests() bool { + if o != nil && !IsNil(o.QueueHasLockedRequests) { + return true + } + + return false +} + +// SetQueueHasLockedRequests gets a reference to the given bool and assigns it to the QueueHasLockedRequests field. +func (o *LockedRequestQueueHead) SetQueueHasLockedRequests(v bool) { + o.QueueHasLockedRequests = &v +} + +// GetClientKey returns the ClientKey field value if set, zero value otherwise. +func (o *LockedRequestQueueHead) GetClientKey() string { + if o == nil || IsNil(o.ClientKey) { + var ret string + return ret + } + return *o.ClientKey +} + +// GetClientKeyOk returns a tuple with the ClientKey field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LockedRequestQueueHead) GetClientKeyOk() (*string, bool) { + if o == nil || IsNil(o.ClientKey) { + return nil, false + } + return o.ClientKey, true +} + +// HasClientKey returns a boolean if a field has been set. +func (o *LockedRequestQueueHead) HasClientKey() bool { + if o != nil && !IsNil(o.ClientKey) { + return true + } + + return false +} + +// SetClientKey gets a reference to the given string and assigns it to the ClientKey field. +func (o *LockedRequestQueueHead) SetClientKey(v string) { + o.ClientKey = &v +} + +// GetHadMultipleClients returns the HadMultipleClients field value +func (o *LockedRequestQueueHead) GetHadMultipleClients() bool { + if o == nil { + var ret bool + return ret + } + + return o.HadMultipleClients +} + +// GetHadMultipleClientsOk returns a tuple with the HadMultipleClients field value +// and a boolean to check if the value has been set. +func (o *LockedRequestQueueHead) GetHadMultipleClientsOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.HadMultipleClients, true +} + +// SetHadMultipleClients sets field value +func (o *LockedRequestQueueHead) SetHadMultipleClients(v bool) { + o.HadMultipleClients = v +} + +// GetLockSecs returns the LockSecs field value +func (o *LockedRequestQueueHead) GetLockSecs() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.LockSecs +} + +// GetLockSecsOk returns a tuple with the LockSecs field value +// and a boolean to check if the value has been set. +func (o *LockedRequestQueueHead) GetLockSecsOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.LockSecs, true +} + +// SetLockSecs sets field value +func (o *LockedRequestQueueHead) SetLockSecs(v int32) { + o.LockSecs = v +} + +// GetItems returns the Items field value +func (o *LockedRequestQueueHead) GetItems() []LockedHeadRequest { + if o == nil { + var ret []LockedHeadRequest + return ret + } + + return o.Items +} + +// GetItemsOk returns a tuple with the Items field value +// and a boolean to check if the value has been set. +func (o *LockedRequestQueueHead) GetItemsOk() ([]LockedHeadRequest, bool) { + if o == nil { + return nil, false + } + return o.Items, true +} + +// SetItems sets field value +func (o *LockedRequestQueueHead) SetItems(v []LockedHeadRequest) { + o.Items = v +} + +func (o LockedRequestQueueHead) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o LockedRequestQueueHead) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["limit"] = o.Limit + toSerialize["queueModifiedAt"] = o.QueueModifiedAt + if !IsNil(o.QueueHasLockedRequests) { + toSerialize["queueHasLockedRequests"] = o.QueueHasLockedRequests + } + if !IsNil(o.ClientKey) { + toSerialize["clientKey"] = o.ClientKey + } + toSerialize["hadMultipleClients"] = o.HadMultipleClients + toSerialize["lockSecs"] = o.LockSecs + toSerialize["items"] = o.Items + return toSerialize, nil +} + +func (o *LockedRequestQueueHead) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "limit", + "queueModifiedAt", + "hadMultipleClients", + "lockSecs", + "items", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varLockedRequestQueueHead := _LockedRequestQueueHead{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varLockedRequestQueueHead) + + if err != nil { + return err + } + + *o = LockedRequestQueueHead(varLockedRequestQueueHead) + + return err +} + +type NullableLockedRequestQueueHead struct { + value *LockedRequestQueueHead + isSet bool +} + +func (v NullableLockedRequestQueueHead) Get() *LockedRequestQueueHead { + return v.value +} + +func (v *NullableLockedRequestQueueHead) Set(val *LockedRequestQueueHead) { + v.value = val + v.isSet = true +} + +func (v NullableLockedRequestQueueHead) IsSet() bool { + return v.isSet +} + +func (v *NullableLockedRequestQueueHead) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableLockedRequestQueueHead(val *LockedRequestQueueHead) *NullableLockedRequestQueueHead { + return &NullableLockedRequestQueueHead{value: val, isSet: true} +} + +func (v NullableLockedRequestQueueHead) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableLockedRequestQueueHead) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_metamorph.go b/model_metamorph.go new file mode 100644 index 0000000..f4f7bfe --- /dev/null +++ b/model_metamorph.go @@ -0,0 +1,265 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" + "time" + "bytes" + "fmt" +) + +// checks if the Metamorph type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Metamorph{} + +// Metamorph Information about a metamorph event that occurred during the run. +type Metamorph struct { + // Time when the metamorph occurred. + CreatedAt time.Time `json:"createdAt"` + // ID of the Actor that the run was metamorphed to. + ActorId string `json:"actorId"` + // ID of the build used for the metamorphed Actor. + BuildId string `json:"buildId"` + // Key of the input record in the key-value store. + InputKey NullableString `json:"inputKey,omitempty"` +} + +type _Metamorph Metamorph + +// NewMetamorph instantiates a new Metamorph object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewMetamorph(createdAt time.Time, actorId string, buildId string) *Metamorph { + this := Metamorph{} + this.CreatedAt = createdAt + this.ActorId = actorId + this.BuildId = buildId + return &this +} + +// NewMetamorphWithDefaults instantiates a new Metamorph object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewMetamorphWithDefaults() *Metamorph { + this := Metamorph{} + return &this +} + +// GetCreatedAt returns the CreatedAt field value +func (o *Metamorph) GetCreatedAt() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value +// and a boolean to check if the value has been set. +func (o *Metamorph) GetCreatedAtOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.CreatedAt, true +} + +// SetCreatedAt sets field value +func (o *Metamorph) SetCreatedAt(v time.Time) { + o.CreatedAt = v +} + +// GetActorId returns the ActorId field value +func (o *Metamorph) GetActorId() string { + if o == nil { + var ret string + return ret + } + + return o.ActorId +} + +// GetActorIdOk returns a tuple with the ActorId field value +// and a boolean to check if the value has been set. +func (o *Metamorph) GetActorIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ActorId, true +} + +// SetActorId sets field value +func (o *Metamorph) SetActorId(v string) { + o.ActorId = v +} + +// GetBuildId returns the BuildId field value +func (o *Metamorph) GetBuildId() string { + if o == nil { + var ret string + return ret + } + + return o.BuildId +} + +// GetBuildIdOk returns a tuple with the BuildId field value +// and a boolean to check if the value has been set. +func (o *Metamorph) GetBuildIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.BuildId, true +} + +// SetBuildId sets field value +func (o *Metamorph) SetBuildId(v string) { + o.BuildId = v +} + +// GetInputKey returns the InputKey field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Metamorph) GetInputKey() string { + if o == nil || IsNil(o.InputKey.Get()) { + var ret string + return ret + } + return *o.InputKey.Get() +} + +// GetInputKeyOk returns a tuple with the InputKey field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Metamorph) GetInputKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.InputKey.Get(), o.InputKey.IsSet() +} + +// HasInputKey returns a boolean if a field has been set. +func (o *Metamorph) HasInputKey() bool { + if o != nil && o.InputKey.IsSet() { + return true + } + + return false +} + +// SetInputKey gets a reference to the given NullableString and assigns it to the InputKey field. +func (o *Metamorph) SetInputKey(v string) { + o.InputKey.Set(&v) +} +// SetInputKeyNil sets the value for InputKey to be an explicit nil +func (o *Metamorph) SetInputKeyNil() { + o.InputKey.Set(nil) +} + +// UnsetInputKey ensures that no value is present for InputKey, not even an explicit nil +func (o *Metamorph) UnsetInputKey() { + o.InputKey.Unset() +} + +func (o Metamorph) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Metamorph) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["createdAt"] = o.CreatedAt + toSerialize["actorId"] = o.ActorId + toSerialize["buildId"] = o.BuildId + if o.InputKey.IsSet() { + toSerialize["inputKey"] = o.InputKey.Get() + } + return toSerialize, nil +} + +func (o *Metamorph) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "createdAt", + "actorId", + "buildId", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varMetamorph := _Metamorph{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varMetamorph) + + if err != nil { + return err + } + + *o = Metamorph(varMetamorph) + + return err +} + +type NullableMetamorph struct { + value *Metamorph + isSet bool +} + +func (v NullableMetamorph) Get() *Metamorph { + return v.value +} + +func (v *NullableMetamorph) Set(val *Metamorph) { + v.value = val + v.isSet = true +} + +func (v NullableMetamorph) IsSet() bool { + return v.isSet +} + +func (v *NullableMetamorph) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableMetamorph(val *Metamorph) *NullableMetamorph { + return &NullableMetamorph{value: val, isSet: true} +} + +func (v NullableMetamorph) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableMetamorph) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_monthly_usage.go b/model_monthly_usage.go new file mode 100644 index 0000000..ec058a7 --- /dev/null +++ b/model_monthly_usage.go @@ -0,0 +1,272 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" + "bytes" + "fmt" +) + +// checks if the MonthlyUsage type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &MonthlyUsage{} + +// MonthlyUsage struct for MonthlyUsage +type MonthlyUsage struct { + UsageCycle UsageCycle `json:"usageCycle"` + // A map of usage item names (e.g., ACTOR_COMPUTE_UNITS) to their usage details. + MonthlyServiceUsage map[string]UsageItem `json:"monthlyServiceUsage"` + // + DailyServiceUsages []DailyServiceUsages `json:"dailyServiceUsages"` + TotalUsageCreditsUsdBeforeVolumeDiscount float32 `json:"totalUsageCreditsUsdBeforeVolumeDiscount"` + TotalUsageCreditsUsdAfterVolumeDiscount float32 `json:"totalUsageCreditsUsdAfterVolumeDiscount"` +} + +type _MonthlyUsage MonthlyUsage + +// NewMonthlyUsage instantiates a new MonthlyUsage object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewMonthlyUsage(usageCycle UsageCycle, monthlyServiceUsage map[string]UsageItem, dailyServiceUsages []DailyServiceUsages, totalUsageCreditsUsdBeforeVolumeDiscount float32, totalUsageCreditsUsdAfterVolumeDiscount float32) *MonthlyUsage { + this := MonthlyUsage{} + this.UsageCycle = usageCycle + this.MonthlyServiceUsage = monthlyServiceUsage + this.DailyServiceUsages = dailyServiceUsages + this.TotalUsageCreditsUsdBeforeVolumeDiscount = totalUsageCreditsUsdBeforeVolumeDiscount + this.TotalUsageCreditsUsdAfterVolumeDiscount = totalUsageCreditsUsdAfterVolumeDiscount + return &this +} + +// NewMonthlyUsageWithDefaults instantiates a new MonthlyUsage object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewMonthlyUsageWithDefaults() *MonthlyUsage { + this := MonthlyUsage{} + return &this +} + +// GetUsageCycle returns the UsageCycle field value +func (o *MonthlyUsage) GetUsageCycle() UsageCycle { + if o == nil { + var ret UsageCycle + return ret + } + + return o.UsageCycle +} + +// GetUsageCycleOk returns a tuple with the UsageCycle field value +// and a boolean to check if the value has been set. +func (o *MonthlyUsage) GetUsageCycleOk() (*UsageCycle, bool) { + if o == nil { + return nil, false + } + return &o.UsageCycle, true +} + +// SetUsageCycle sets field value +func (o *MonthlyUsage) SetUsageCycle(v UsageCycle) { + o.UsageCycle = v +} + +// GetMonthlyServiceUsage returns the MonthlyServiceUsage field value +func (o *MonthlyUsage) GetMonthlyServiceUsage() map[string]UsageItem { + if o == nil { + var ret map[string]UsageItem + return ret + } + + return o.MonthlyServiceUsage +} + +// GetMonthlyServiceUsageOk returns a tuple with the MonthlyServiceUsage field value +// and a boolean to check if the value has been set. +func (o *MonthlyUsage) GetMonthlyServiceUsageOk() (map[string]UsageItem, bool) { + if o == nil { + return map[string]UsageItem{}, false + } + return o.MonthlyServiceUsage, true +} + +// SetMonthlyServiceUsage sets field value +func (o *MonthlyUsage) SetMonthlyServiceUsage(v map[string]UsageItem) { + o.MonthlyServiceUsage = v +} + +// GetDailyServiceUsages returns the DailyServiceUsages field value +func (o *MonthlyUsage) GetDailyServiceUsages() []DailyServiceUsages { + if o == nil { + var ret []DailyServiceUsages + return ret + } + + return o.DailyServiceUsages +} + +// GetDailyServiceUsagesOk returns a tuple with the DailyServiceUsages field value +// and a boolean to check if the value has been set. +func (o *MonthlyUsage) GetDailyServiceUsagesOk() ([]DailyServiceUsages, bool) { + if o == nil { + return nil, false + } + return o.DailyServiceUsages, true +} + +// SetDailyServiceUsages sets field value +func (o *MonthlyUsage) SetDailyServiceUsages(v []DailyServiceUsages) { + o.DailyServiceUsages = v +} + +// GetTotalUsageCreditsUsdBeforeVolumeDiscount returns the TotalUsageCreditsUsdBeforeVolumeDiscount field value +func (o *MonthlyUsage) GetTotalUsageCreditsUsdBeforeVolumeDiscount() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.TotalUsageCreditsUsdBeforeVolumeDiscount +} + +// GetTotalUsageCreditsUsdBeforeVolumeDiscountOk returns a tuple with the TotalUsageCreditsUsdBeforeVolumeDiscount field value +// and a boolean to check if the value has been set. +func (o *MonthlyUsage) GetTotalUsageCreditsUsdBeforeVolumeDiscountOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.TotalUsageCreditsUsdBeforeVolumeDiscount, true +} + +// SetTotalUsageCreditsUsdBeforeVolumeDiscount sets field value +func (o *MonthlyUsage) SetTotalUsageCreditsUsdBeforeVolumeDiscount(v float32) { + o.TotalUsageCreditsUsdBeforeVolumeDiscount = v +} + +// GetTotalUsageCreditsUsdAfterVolumeDiscount returns the TotalUsageCreditsUsdAfterVolumeDiscount field value +func (o *MonthlyUsage) GetTotalUsageCreditsUsdAfterVolumeDiscount() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.TotalUsageCreditsUsdAfterVolumeDiscount +} + +// GetTotalUsageCreditsUsdAfterVolumeDiscountOk returns a tuple with the TotalUsageCreditsUsdAfterVolumeDiscount field value +// and a boolean to check if the value has been set. +func (o *MonthlyUsage) GetTotalUsageCreditsUsdAfterVolumeDiscountOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.TotalUsageCreditsUsdAfterVolumeDiscount, true +} + +// SetTotalUsageCreditsUsdAfterVolumeDiscount sets field value +func (o *MonthlyUsage) SetTotalUsageCreditsUsdAfterVolumeDiscount(v float32) { + o.TotalUsageCreditsUsdAfterVolumeDiscount = v +} + +func (o MonthlyUsage) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o MonthlyUsage) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["usageCycle"] = o.UsageCycle + toSerialize["monthlyServiceUsage"] = o.MonthlyServiceUsage + toSerialize["dailyServiceUsages"] = o.DailyServiceUsages + toSerialize["totalUsageCreditsUsdBeforeVolumeDiscount"] = o.TotalUsageCreditsUsdBeforeVolumeDiscount + toSerialize["totalUsageCreditsUsdAfterVolumeDiscount"] = o.TotalUsageCreditsUsdAfterVolumeDiscount + return toSerialize, nil +} + +func (o *MonthlyUsage) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "usageCycle", + "monthlyServiceUsage", + "dailyServiceUsages", + "totalUsageCreditsUsdBeforeVolumeDiscount", + "totalUsageCreditsUsdAfterVolumeDiscount", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varMonthlyUsage := _MonthlyUsage{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varMonthlyUsage) + + if err != nil { + return err + } + + *o = MonthlyUsage(varMonthlyUsage) + + return err +} + +type NullableMonthlyUsage struct { + value *MonthlyUsage + isSet bool +} + +func (v NullableMonthlyUsage) Get() *MonthlyUsage { + return v.value +} + +func (v *NullableMonthlyUsage) Set(val *MonthlyUsage) { + v.value = val + v.isSet = true +} + +func (v NullableMonthlyUsage) IsSet() bool { + return v.isSet +} + +func (v *NullableMonthlyUsage) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableMonthlyUsage(val *MonthlyUsage) *NullableMonthlyUsage { + return &NullableMonthlyUsage{value: val, isSet: true} +} + +func (v NullableMonthlyUsage) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableMonthlyUsage) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_monthly_usage_response.go b/model_monthly_usage_response.go new file mode 100644 index 0000000..b45dc30 --- /dev/null +++ b/model_monthly_usage_response.go @@ -0,0 +1,158 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" + "bytes" + "fmt" +) + +// checks if the MonthlyUsageResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &MonthlyUsageResponse{} + +// MonthlyUsageResponse struct for MonthlyUsageResponse +type MonthlyUsageResponse struct { + Data MonthlyUsage `json:"data"` +} + +type _MonthlyUsageResponse MonthlyUsageResponse + +// NewMonthlyUsageResponse instantiates a new MonthlyUsageResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewMonthlyUsageResponse(data MonthlyUsage) *MonthlyUsageResponse { + this := MonthlyUsageResponse{} + this.Data = data + return &this +} + +// NewMonthlyUsageResponseWithDefaults instantiates a new MonthlyUsageResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewMonthlyUsageResponseWithDefaults() *MonthlyUsageResponse { + this := MonthlyUsageResponse{} + return &this +} + +// GetData returns the Data field value +func (o *MonthlyUsageResponse) GetData() MonthlyUsage { + if o == nil { + var ret MonthlyUsage + return ret + } + + return o.Data +} + +// GetDataOk returns a tuple with the Data field value +// and a boolean to check if the value has been set. +func (o *MonthlyUsageResponse) GetDataOk() (*MonthlyUsage, bool) { + if o == nil { + return nil, false + } + return &o.Data, true +} + +// SetData sets field value +func (o *MonthlyUsageResponse) SetData(v MonthlyUsage) { + o.Data = v +} + +func (o MonthlyUsageResponse) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o MonthlyUsageResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["data"] = o.Data + return toSerialize, nil +} + +func (o *MonthlyUsageResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "data", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varMonthlyUsageResponse := _MonthlyUsageResponse{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varMonthlyUsageResponse) + + if err != nil { + return err + } + + *o = MonthlyUsageResponse(varMonthlyUsageResponse) + + return err +} + +type NullableMonthlyUsageResponse struct { + value *MonthlyUsageResponse + isSet bool +} + +func (v NullableMonthlyUsageResponse) Get() *MonthlyUsageResponse { + return v.value +} + +func (v *NullableMonthlyUsageResponse) Set(val *MonthlyUsageResponse) { + v.value = val + v.isSet = true +} + +func (v NullableMonthlyUsageResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableMonthlyUsageResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableMonthlyUsageResponse(val *MonthlyUsageResponse) *NullableMonthlyUsageResponse { + return &NullableMonthlyUsageResponse{value: val, isSet: true} +} + +func (v NullableMonthlyUsageResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableMonthlyUsageResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_pagination_response.go b/model_pagination_response.go new file mode 100644 index 0000000..00228e8 --- /dev/null +++ b/model_pagination_response.go @@ -0,0 +1,275 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" + "bytes" + "fmt" +) + +// checks if the PaginationResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginationResponse{} + +// PaginationResponse Common pagination fields for list responses. +type PaginationResponse struct { + // The total number of items available across all pages. + Total int32 `json:"total"` + // The starting position for this page of results. + Offset int32 `json:"offset"` + // The maximum number of items returned per page. + Limit int32 `json:"limit"` + // Whether the results are sorted in descending order. + Desc bool `json:"desc"` + // The number of items returned in this response. + Count int32 `json:"count"` +} + +type _PaginationResponse PaginationResponse + +// NewPaginationResponse instantiates a new PaginationResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginationResponse(total int32, offset int32, limit int32, desc bool, count int32) *PaginationResponse { + this := PaginationResponse{} + this.Total = total + this.Offset = offset + this.Limit = limit + this.Desc = desc + this.Count = count + return &this +} + +// NewPaginationResponseWithDefaults instantiates a new PaginationResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginationResponseWithDefaults() *PaginationResponse { + this := PaginationResponse{} + return &this +} + +// GetTotal returns the Total field value +func (o *PaginationResponse) GetTotal() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Total +} + +// GetTotalOk returns a tuple with the Total field value +// and a boolean to check if the value has been set. +func (o *PaginationResponse) GetTotalOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Total, true +} + +// SetTotal sets field value +func (o *PaginationResponse) SetTotal(v int32) { + o.Total = v +} + +// GetOffset returns the Offset field value +func (o *PaginationResponse) GetOffset() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Offset +} + +// GetOffsetOk returns a tuple with the Offset field value +// and a boolean to check if the value has been set. +func (o *PaginationResponse) GetOffsetOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Offset, true +} + +// SetOffset sets field value +func (o *PaginationResponse) SetOffset(v int32) { + o.Offset = v +} + +// GetLimit returns the Limit field value +func (o *PaginationResponse) GetLimit() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Limit +} + +// GetLimitOk returns a tuple with the Limit field value +// and a boolean to check if the value has been set. +func (o *PaginationResponse) GetLimitOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Limit, true +} + +// SetLimit sets field value +func (o *PaginationResponse) SetLimit(v int32) { + o.Limit = v +} + +// GetDesc returns the Desc field value +func (o *PaginationResponse) GetDesc() bool { + if o == nil { + var ret bool + return ret + } + + return o.Desc +} + +// GetDescOk returns a tuple with the Desc field value +// and a boolean to check if the value has been set. +func (o *PaginationResponse) GetDescOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.Desc, true +} + +// SetDesc sets field value +func (o *PaginationResponse) SetDesc(v bool) { + o.Desc = v +} + +// GetCount returns the Count field value +func (o *PaginationResponse) GetCount() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Count +} + +// GetCountOk returns a tuple with the Count field value +// and a boolean to check if the value has been set. +func (o *PaginationResponse) GetCountOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Count, true +} + +// SetCount sets field value +func (o *PaginationResponse) SetCount(v int32) { + o.Count = v +} + +func (o PaginationResponse) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginationResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["total"] = o.Total + toSerialize["offset"] = o.Offset + toSerialize["limit"] = o.Limit + toSerialize["desc"] = o.Desc + toSerialize["count"] = o.Count + return toSerialize, nil +} + +func (o *PaginationResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "total", + "offset", + "limit", + "desc", + "count", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPaginationResponse := _PaginationResponse{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varPaginationResponse) + + if err != nil { + return err + } + + *o = PaginationResponse(varPaginationResponse) + + return err +} + +type NullablePaginationResponse struct { + value *PaginationResponse + isSet bool +} + +func (v NullablePaginationResponse) Get() *PaginationResponse { + return v.value +} + +func (v *NullablePaginationResponse) Set(val *PaginationResponse) { + v.value = val + v.isSet = true +} + +func (v NullablePaginationResponse) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginationResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginationResponse(val *PaginationResponse) *NullablePaginationResponse { + return &NullablePaginationResponse{value: val, isSet: true} +} + +func (v NullablePaginationResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginationResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_pay_per_event_actor_pricing_info.go b/model_pay_per_event_actor_pricing_info.go new file mode 100644 index 0000000..48921b1 --- /dev/null +++ b/model_pay_per_event_actor_pricing_info.go @@ -0,0 +1,500 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" + "time" + "bytes" + "fmt" +) + +// checks if the PayPerEventActorPricingInfo type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PayPerEventActorPricingInfo{} + +// PayPerEventActorPricingInfo struct for PayPerEventActorPricingInfo +type PayPerEventActorPricingInfo struct { + // In [0, 1], fraction of pricePerUnitUsd that goes to Apify + ApifyMarginPercentage float32 `json:"apifyMarginPercentage"` + // When this pricing info record has been created + CreatedAt time.Time `json:"createdAt"` + // Since when is this pricing info record effective for a given Actor + StartedAt time.Time `json:"startedAt"` + NotifiedAboutFutureChangeAt *time.Time `json:"notifiedAboutFutureChangeAt,omitempty"` + NotifiedAboutChangeAt *time.Time `json:"notifiedAboutChangeAt,omitempty"` + ReasonForChange *string `json:"reasonForChange,omitempty"` + IsPriceChangeNotificationSuppressed *bool `json:"isPriceChangeNotificationSuppressed,omitempty"` + ForceContainsSignificantPriceChange *bool `json:"forceContainsSignificantPriceChange,omitempty"` + PricingModel string `json:"pricingModel"` + PricingPerEvent PayPerEventActorPricingInfoAllOfPricingPerEvent `json:"pricingPerEvent"` + MinimalMaxTotalChargeUsd NullableFloat32 `json:"minimalMaxTotalChargeUsd,omitempty"` +} + +type _PayPerEventActorPricingInfo PayPerEventActorPricingInfo + +// NewPayPerEventActorPricingInfo instantiates a new PayPerEventActorPricingInfo object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPayPerEventActorPricingInfo(apifyMarginPercentage float32, createdAt time.Time, startedAt time.Time, pricingModel string, pricingPerEvent PayPerEventActorPricingInfoAllOfPricingPerEvent) *PayPerEventActorPricingInfo { + this := PayPerEventActorPricingInfo{} + this.ApifyMarginPercentage = apifyMarginPercentage + this.CreatedAt = createdAt + this.StartedAt = startedAt + this.PricingModel = pricingModel + this.PricingPerEvent = pricingPerEvent + return &this +} + +// NewPayPerEventActorPricingInfoWithDefaults instantiates a new PayPerEventActorPricingInfo object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPayPerEventActorPricingInfoWithDefaults() *PayPerEventActorPricingInfo { + this := PayPerEventActorPricingInfo{} + return &this +} + +// GetApifyMarginPercentage returns the ApifyMarginPercentage field value +func (o *PayPerEventActorPricingInfo) GetApifyMarginPercentage() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.ApifyMarginPercentage +} + +// GetApifyMarginPercentageOk returns a tuple with the ApifyMarginPercentage field value +// and a boolean to check if the value has been set. +func (o *PayPerEventActorPricingInfo) GetApifyMarginPercentageOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.ApifyMarginPercentage, true +} + +// SetApifyMarginPercentage sets field value +func (o *PayPerEventActorPricingInfo) SetApifyMarginPercentage(v float32) { + o.ApifyMarginPercentage = v +} + +// GetCreatedAt returns the CreatedAt field value +func (o *PayPerEventActorPricingInfo) GetCreatedAt() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value +// and a boolean to check if the value has been set. +func (o *PayPerEventActorPricingInfo) GetCreatedAtOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.CreatedAt, true +} + +// SetCreatedAt sets field value +func (o *PayPerEventActorPricingInfo) SetCreatedAt(v time.Time) { + o.CreatedAt = v +} + +// GetStartedAt returns the StartedAt field value +func (o *PayPerEventActorPricingInfo) GetStartedAt() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.StartedAt +} + +// GetStartedAtOk returns a tuple with the StartedAt field value +// and a boolean to check if the value has been set. +func (o *PayPerEventActorPricingInfo) GetStartedAtOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.StartedAt, true +} + +// SetStartedAt sets field value +func (o *PayPerEventActorPricingInfo) SetStartedAt(v time.Time) { + o.StartedAt = v +} + +// GetNotifiedAboutFutureChangeAt returns the NotifiedAboutFutureChangeAt field value if set, zero value otherwise. +func (o *PayPerEventActorPricingInfo) GetNotifiedAboutFutureChangeAt() time.Time { + if o == nil || IsNil(o.NotifiedAboutFutureChangeAt) { + var ret time.Time + return ret + } + return *o.NotifiedAboutFutureChangeAt +} + +// GetNotifiedAboutFutureChangeAtOk returns a tuple with the NotifiedAboutFutureChangeAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PayPerEventActorPricingInfo) GetNotifiedAboutFutureChangeAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.NotifiedAboutFutureChangeAt) { + return nil, false + } + return o.NotifiedAboutFutureChangeAt, true +} + +// HasNotifiedAboutFutureChangeAt returns a boolean if a field has been set. +func (o *PayPerEventActorPricingInfo) HasNotifiedAboutFutureChangeAt() bool { + if o != nil && !IsNil(o.NotifiedAboutFutureChangeAt) { + return true + } + + return false +} + +// SetNotifiedAboutFutureChangeAt gets a reference to the given time.Time and assigns it to the NotifiedAboutFutureChangeAt field. +func (o *PayPerEventActorPricingInfo) SetNotifiedAboutFutureChangeAt(v time.Time) { + o.NotifiedAboutFutureChangeAt = &v +} + +// GetNotifiedAboutChangeAt returns the NotifiedAboutChangeAt field value if set, zero value otherwise. +func (o *PayPerEventActorPricingInfo) GetNotifiedAboutChangeAt() time.Time { + if o == nil || IsNil(o.NotifiedAboutChangeAt) { + var ret time.Time + return ret + } + return *o.NotifiedAboutChangeAt +} + +// GetNotifiedAboutChangeAtOk returns a tuple with the NotifiedAboutChangeAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PayPerEventActorPricingInfo) GetNotifiedAboutChangeAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.NotifiedAboutChangeAt) { + return nil, false + } + return o.NotifiedAboutChangeAt, true +} + +// HasNotifiedAboutChangeAt returns a boolean if a field has been set. +func (o *PayPerEventActorPricingInfo) HasNotifiedAboutChangeAt() bool { + if o != nil && !IsNil(o.NotifiedAboutChangeAt) { + return true + } + + return false +} + +// SetNotifiedAboutChangeAt gets a reference to the given time.Time and assigns it to the NotifiedAboutChangeAt field. +func (o *PayPerEventActorPricingInfo) SetNotifiedAboutChangeAt(v time.Time) { + o.NotifiedAboutChangeAt = &v +} + +// GetReasonForChange returns the ReasonForChange field value if set, zero value otherwise. +func (o *PayPerEventActorPricingInfo) GetReasonForChange() string { + if o == nil || IsNil(o.ReasonForChange) { + var ret string + return ret + } + return *o.ReasonForChange +} + +// GetReasonForChangeOk returns a tuple with the ReasonForChange field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PayPerEventActorPricingInfo) GetReasonForChangeOk() (*string, bool) { + if o == nil || IsNil(o.ReasonForChange) { + return nil, false + } + return o.ReasonForChange, true +} + +// HasReasonForChange returns a boolean if a field has been set. +func (o *PayPerEventActorPricingInfo) HasReasonForChange() bool { + if o != nil && !IsNil(o.ReasonForChange) { + return true + } + + return false +} + +// SetReasonForChange gets a reference to the given string and assigns it to the ReasonForChange field. +func (o *PayPerEventActorPricingInfo) SetReasonForChange(v string) { + o.ReasonForChange = &v +} + +// GetIsPriceChangeNotificationSuppressed returns the IsPriceChangeNotificationSuppressed field value if set, zero value otherwise. +func (o *PayPerEventActorPricingInfo) GetIsPriceChangeNotificationSuppressed() bool { + if o == nil || IsNil(o.IsPriceChangeNotificationSuppressed) { + var ret bool + return ret + } + return *o.IsPriceChangeNotificationSuppressed +} + +// GetIsPriceChangeNotificationSuppressedOk returns a tuple with the IsPriceChangeNotificationSuppressed field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PayPerEventActorPricingInfo) GetIsPriceChangeNotificationSuppressedOk() (*bool, bool) { + if o == nil || IsNil(o.IsPriceChangeNotificationSuppressed) { + return nil, false + } + return o.IsPriceChangeNotificationSuppressed, true +} + +// HasIsPriceChangeNotificationSuppressed returns a boolean if a field has been set. +func (o *PayPerEventActorPricingInfo) HasIsPriceChangeNotificationSuppressed() bool { + if o != nil && !IsNil(o.IsPriceChangeNotificationSuppressed) { + return true + } + + return false +} + +// SetIsPriceChangeNotificationSuppressed gets a reference to the given bool and assigns it to the IsPriceChangeNotificationSuppressed field. +func (o *PayPerEventActorPricingInfo) SetIsPriceChangeNotificationSuppressed(v bool) { + o.IsPriceChangeNotificationSuppressed = &v +} + +// GetForceContainsSignificantPriceChange returns the ForceContainsSignificantPriceChange field value if set, zero value otherwise. +func (o *PayPerEventActorPricingInfo) GetForceContainsSignificantPriceChange() bool { + if o == nil || IsNil(o.ForceContainsSignificantPriceChange) { + var ret bool + return ret + } + return *o.ForceContainsSignificantPriceChange +} + +// GetForceContainsSignificantPriceChangeOk returns a tuple with the ForceContainsSignificantPriceChange field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PayPerEventActorPricingInfo) GetForceContainsSignificantPriceChangeOk() (*bool, bool) { + if o == nil || IsNil(o.ForceContainsSignificantPriceChange) { + return nil, false + } + return o.ForceContainsSignificantPriceChange, true +} + +// HasForceContainsSignificantPriceChange returns a boolean if a field has been set. +func (o *PayPerEventActorPricingInfo) HasForceContainsSignificantPriceChange() bool { + if o != nil && !IsNil(o.ForceContainsSignificantPriceChange) { + return true + } + + return false +} + +// SetForceContainsSignificantPriceChange gets a reference to the given bool and assigns it to the ForceContainsSignificantPriceChange field. +func (o *PayPerEventActorPricingInfo) SetForceContainsSignificantPriceChange(v bool) { + o.ForceContainsSignificantPriceChange = &v +} + +// GetPricingModel returns the PricingModel field value +func (o *PayPerEventActorPricingInfo) GetPricingModel() string { + if o == nil { + var ret string + return ret + } + + return o.PricingModel +} + +// GetPricingModelOk returns a tuple with the PricingModel field value +// and a boolean to check if the value has been set. +func (o *PayPerEventActorPricingInfo) GetPricingModelOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.PricingModel, true +} + +// SetPricingModel sets field value +func (o *PayPerEventActorPricingInfo) SetPricingModel(v string) { + o.PricingModel = v +} + +// GetPricingPerEvent returns the PricingPerEvent field value +func (o *PayPerEventActorPricingInfo) GetPricingPerEvent() PayPerEventActorPricingInfoAllOfPricingPerEvent { + if o == nil { + var ret PayPerEventActorPricingInfoAllOfPricingPerEvent + return ret + } + + return o.PricingPerEvent +} + +// GetPricingPerEventOk returns a tuple with the PricingPerEvent field value +// and a boolean to check if the value has been set. +func (o *PayPerEventActorPricingInfo) GetPricingPerEventOk() (*PayPerEventActorPricingInfoAllOfPricingPerEvent, bool) { + if o == nil { + return nil, false + } + return &o.PricingPerEvent, true +} + +// SetPricingPerEvent sets field value +func (o *PayPerEventActorPricingInfo) SetPricingPerEvent(v PayPerEventActorPricingInfoAllOfPricingPerEvent) { + o.PricingPerEvent = v +} + +// GetMinimalMaxTotalChargeUsd returns the MinimalMaxTotalChargeUsd field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PayPerEventActorPricingInfo) GetMinimalMaxTotalChargeUsd() float32 { + if o == nil || IsNil(o.MinimalMaxTotalChargeUsd.Get()) { + var ret float32 + return ret + } + return *o.MinimalMaxTotalChargeUsd.Get() +} + +// GetMinimalMaxTotalChargeUsdOk returns a tuple with the MinimalMaxTotalChargeUsd field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PayPerEventActorPricingInfo) GetMinimalMaxTotalChargeUsdOk() (*float32, bool) { + if o == nil { + return nil, false + } + return o.MinimalMaxTotalChargeUsd.Get(), o.MinimalMaxTotalChargeUsd.IsSet() +} + +// HasMinimalMaxTotalChargeUsd returns a boolean if a field has been set. +func (o *PayPerEventActorPricingInfo) HasMinimalMaxTotalChargeUsd() bool { + if o != nil && o.MinimalMaxTotalChargeUsd.IsSet() { + return true + } + + return false +} + +// SetMinimalMaxTotalChargeUsd gets a reference to the given NullableFloat32 and assigns it to the MinimalMaxTotalChargeUsd field. +func (o *PayPerEventActorPricingInfo) SetMinimalMaxTotalChargeUsd(v float32) { + o.MinimalMaxTotalChargeUsd.Set(&v) +} +// SetMinimalMaxTotalChargeUsdNil sets the value for MinimalMaxTotalChargeUsd to be an explicit nil +func (o *PayPerEventActorPricingInfo) SetMinimalMaxTotalChargeUsdNil() { + o.MinimalMaxTotalChargeUsd.Set(nil) +} + +// UnsetMinimalMaxTotalChargeUsd ensures that no value is present for MinimalMaxTotalChargeUsd, not even an explicit nil +func (o *PayPerEventActorPricingInfo) UnsetMinimalMaxTotalChargeUsd() { + o.MinimalMaxTotalChargeUsd.Unset() +} + +func (o PayPerEventActorPricingInfo) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PayPerEventActorPricingInfo) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["apifyMarginPercentage"] = o.ApifyMarginPercentage + toSerialize["createdAt"] = o.CreatedAt + toSerialize["startedAt"] = o.StartedAt + if !IsNil(o.NotifiedAboutFutureChangeAt) { + toSerialize["notifiedAboutFutureChangeAt"] = o.NotifiedAboutFutureChangeAt + } + if !IsNil(o.NotifiedAboutChangeAt) { + toSerialize["notifiedAboutChangeAt"] = o.NotifiedAboutChangeAt + } + if !IsNil(o.ReasonForChange) { + toSerialize["reasonForChange"] = o.ReasonForChange + } + if !IsNil(o.IsPriceChangeNotificationSuppressed) { + toSerialize["isPriceChangeNotificationSuppressed"] = o.IsPriceChangeNotificationSuppressed + } + if !IsNil(o.ForceContainsSignificantPriceChange) { + toSerialize["forceContainsSignificantPriceChange"] = o.ForceContainsSignificantPriceChange + } + toSerialize["pricingModel"] = o.PricingModel + toSerialize["pricingPerEvent"] = o.PricingPerEvent + if o.MinimalMaxTotalChargeUsd.IsSet() { + toSerialize["minimalMaxTotalChargeUsd"] = o.MinimalMaxTotalChargeUsd.Get() + } + return toSerialize, nil +} + +func (o *PayPerEventActorPricingInfo) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "apifyMarginPercentage", + "createdAt", + "startedAt", + "pricingModel", + "pricingPerEvent", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPayPerEventActorPricingInfo := _PayPerEventActorPricingInfo{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varPayPerEventActorPricingInfo) + + if err != nil { + return err + } + + *o = PayPerEventActorPricingInfo(varPayPerEventActorPricingInfo) + + return err +} + +type NullablePayPerEventActorPricingInfo struct { + value *PayPerEventActorPricingInfo + isSet bool +} + +func (v NullablePayPerEventActorPricingInfo) Get() *PayPerEventActorPricingInfo { + return v.value +} + +func (v *NullablePayPerEventActorPricingInfo) Set(val *PayPerEventActorPricingInfo) { + v.value = val + v.isSet = true +} + +func (v NullablePayPerEventActorPricingInfo) IsSet() bool { + return v.isSet +} + +func (v *NullablePayPerEventActorPricingInfo) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePayPerEventActorPricingInfo(val *PayPerEventActorPricingInfo) *NullablePayPerEventActorPricingInfo { + return &NullablePayPerEventActorPricingInfo{value: val, isSet: true} +} + +func (v NullablePayPerEventActorPricingInfo) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePayPerEventActorPricingInfo) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_pay_per_event_actor_pricing_info_all_of_pricing_per_event.go b/model_pay_per_event_actor_pricing_info_all_of_pricing_per_event.go new file mode 100644 index 0000000..439cf30 --- /dev/null +++ b/model_pay_per_event_actor_pricing_info_all_of_pricing_per_event.go @@ -0,0 +1,126 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" +) + +// checks if the PayPerEventActorPricingInfoAllOfPricingPerEvent type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PayPerEventActorPricingInfoAllOfPricingPerEvent{} + +// PayPerEventActorPricingInfoAllOfPricingPerEvent struct for PayPerEventActorPricingInfoAllOfPricingPerEvent +type PayPerEventActorPricingInfoAllOfPricingPerEvent struct { + ActorChargeEvents map[string]ActorChargeEvent `json:"actorChargeEvents,omitempty"` +} + +// NewPayPerEventActorPricingInfoAllOfPricingPerEvent instantiates a new PayPerEventActorPricingInfoAllOfPricingPerEvent object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPayPerEventActorPricingInfoAllOfPricingPerEvent() *PayPerEventActorPricingInfoAllOfPricingPerEvent { + this := PayPerEventActorPricingInfoAllOfPricingPerEvent{} + return &this +} + +// NewPayPerEventActorPricingInfoAllOfPricingPerEventWithDefaults instantiates a new PayPerEventActorPricingInfoAllOfPricingPerEvent object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPayPerEventActorPricingInfoAllOfPricingPerEventWithDefaults() *PayPerEventActorPricingInfoAllOfPricingPerEvent { + this := PayPerEventActorPricingInfoAllOfPricingPerEvent{} + return &this +} + +// GetActorChargeEvents returns the ActorChargeEvents field value if set, zero value otherwise. +func (o *PayPerEventActorPricingInfoAllOfPricingPerEvent) GetActorChargeEvents() map[string]ActorChargeEvent { + if o == nil || IsNil(o.ActorChargeEvents) { + var ret map[string]ActorChargeEvent + return ret + } + return o.ActorChargeEvents +} + +// GetActorChargeEventsOk returns a tuple with the ActorChargeEvents field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PayPerEventActorPricingInfoAllOfPricingPerEvent) GetActorChargeEventsOk() (map[string]ActorChargeEvent, bool) { + if o == nil || IsNil(o.ActorChargeEvents) { + return map[string]ActorChargeEvent{}, false + } + return o.ActorChargeEvents, true +} + +// HasActorChargeEvents returns a boolean if a field has been set. +func (o *PayPerEventActorPricingInfoAllOfPricingPerEvent) HasActorChargeEvents() bool { + if o != nil && !IsNil(o.ActorChargeEvents) { + return true + } + + return false +} + +// SetActorChargeEvents gets a reference to the given map[string]ActorChargeEvent and assigns it to the ActorChargeEvents field. +func (o *PayPerEventActorPricingInfoAllOfPricingPerEvent) SetActorChargeEvents(v map[string]ActorChargeEvent) { + o.ActorChargeEvents = v +} + +func (o PayPerEventActorPricingInfoAllOfPricingPerEvent) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PayPerEventActorPricingInfoAllOfPricingPerEvent) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.ActorChargeEvents) { + toSerialize["actorChargeEvents"] = o.ActorChargeEvents + } + return toSerialize, nil +} + +type NullablePayPerEventActorPricingInfoAllOfPricingPerEvent struct { + value *PayPerEventActorPricingInfoAllOfPricingPerEvent + isSet bool +} + +func (v NullablePayPerEventActorPricingInfoAllOfPricingPerEvent) Get() *PayPerEventActorPricingInfoAllOfPricingPerEvent { + return v.value +} + +func (v *NullablePayPerEventActorPricingInfoAllOfPricingPerEvent) Set(val *PayPerEventActorPricingInfoAllOfPricingPerEvent) { + v.value = val + v.isSet = true +} + +func (v NullablePayPerEventActorPricingInfoAllOfPricingPerEvent) IsSet() bool { + return v.isSet +} + +func (v *NullablePayPerEventActorPricingInfoAllOfPricingPerEvent) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePayPerEventActorPricingInfoAllOfPricingPerEvent(val *PayPerEventActorPricingInfoAllOfPricingPerEvent) *NullablePayPerEventActorPricingInfoAllOfPricingPerEvent { + return &NullablePayPerEventActorPricingInfoAllOfPricingPerEvent{value: val, isSet: true} +} + +func (v NullablePayPerEventActorPricingInfoAllOfPricingPerEvent) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePayPerEventActorPricingInfoAllOfPricingPerEvent) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_plan.go b/model_plan.go new file mode 100644 index 0000000..27534c6 --- /dev/null +++ b/model_plan.go @@ -0,0 +1,880 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" + "bytes" + "fmt" +) + +// checks if the Plan type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Plan{} + +// Plan struct for Plan +type Plan struct { + Id string `json:"id"` + Description string `json:"description"` + IsEnabled bool `json:"isEnabled"` + MonthlyBasePriceUsd float32 `json:"monthlyBasePriceUsd"` + MonthlyUsageCreditsUsd float32 `json:"monthlyUsageCreditsUsd"` + UsageDiscountPercent *float32 `json:"usageDiscountPercent,omitempty"` + EnabledPlatformFeatures []string `json:"enabledPlatformFeatures"` + MaxMonthlyUsageUsd float32 `json:"maxMonthlyUsageUsd"` + MaxActorMemoryGbytes float32 `json:"maxActorMemoryGbytes"` + MaxMonthlyActorComputeUnits float32 `json:"maxMonthlyActorComputeUnits"` + MaxMonthlyResidentialProxyGbytes float32 `json:"maxMonthlyResidentialProxyGbytes"` + MaxMonthlyProxySerps int32 `json:"maxMonthlyProxySerps"` + MaxMonthlyExternalDataTransferGbytes float32 `json:"maxMonthlyExternalDataTransferGbytes"` + MaxActorCount int32 `json:"maxActorCount"` + MaxActorTaskCount int32 `json:"maxActorTaskCount"` + DataRetentionDays int32 `json:"dataRetentionDays"` + // A dictionary mapping proxy group names to the number of available proxies in each group. The keys are proxy group names (e.g., \"RESIDENTIAL\", \"DATACENTER\") and values are the count of available proxies. + AvailableProxyGroups map[string]int32 `json:"availableProxyGroups"` + TeamAccountSeatCount int32 `json:"teamAccountSeatCount"` + SupportLevel string `json:"supportLevel"` + AvailableAddOns []string `json:"availableAddOns"` + Tier *string `json:"tier,omitempty"` + ApiRateLimitBoosts *int32 `json:"apiRateLimitBoosts,omitempty"` + MaxScheduleCount *int32 `json:"maxScheduleCount,omitempty"` + MaxConcurrentActorRuns *int32 `json:"maxConcurrentActorRuns,omitempty"` + // Pricing details for this plan. + PlanPricing map[string]interface{} `json:"planPricing,omitempty"` +} + +type _Plan Plan + +// NewPlan instantiates a new Plan object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPlan(id string, description string, isEnabled bool, monthlyBasePriceUsd float32, monthlyUsageCreditsUsd float32, enabledPlatformFeatures []string, maxMonthlyUsageUsd float32, maxActorMemoryGbytes float32, maxMonthlyActorComputeUnits float32, maxMonthlyResidentialProxyGbytes float32, maxMonthlyProxySerps int32, maxMonthlyExternalDataTransferGbytes float32, maxActorCount int32, maxActorTaskCount int32, dataRetentionDays int32, availableProxyGroups map[string]int32, teamAccountSeatCount int32, supportLevel string, availableAddOns []string) *Plan { + this := Plan{} + this.Id = id + this.Description = description + this.IsEnabled = isEnabled + this.MonthlyBasePriceUsd = monthlyBasePriceUsd + this.MonthlyUsageCreditsUsd = monthlyUsageCreditsUsd + this.EnabledPlatformFeatures = enabledPlatformFeatures + this.MaxMonthlyUsageUsd = maxMonthlyUsageUsd + this.MaxActorMemoryGbytes = maxActorMemoryGbytes + this.MaxMonthlyActorComputeUnits = maxMonthlyActorComputeUnits + this.MaxMonthlyResidentialProxyGbytes = maxMonthlyResidentialProxyGbytes + this.MaxMonthlyProxySerps = maxMonthlyProxySerps + this.MaxMonthlyExternalDataTransferGbytes = maxMonthlyExternalDataTransferGbytes + this.MaxActorCount = maxActorCount + this.MaxActorTaskCount = maxActorTaskCount + this.DataRetentionDays = dataRetentionDays + this.AvailableProxyGroups = availableProxyGroups + this.TeamAccountSeatCount = teamAccountSeatCount + this.SupportLevel = supportLevel + this.AvailableAddOns = availableAddOns + return &this +} + +// NewPlanWithDefaults instantiates a new Plan object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPlanWithDefaults() *Plan { + this := Plan{} + return &this +} + +// GetId returns the Id field value +func (o *Plan) GetId() string { + if o == nil { + var ret string + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *Plan) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *Plan) SetId(v string) { + o.Id = v +} + +// GetDescription returns the Description field value +func (o *Plan) GetDescription() string { + if o == nil { + var ret string + return ret + } + + return o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value +// and a boolean to check if the value has been set. +func (o *Plan) GetDescriptionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Description, true +} + +// SetDescription sets field value +func (o *Plan) SetDescription(v string) { + o.Description = v +} + +// GetIsEnabled returns the IsEnabled field value +func (o *Plan) GetIsEnabled() bool { + if o == nil { + var ret bool + return ret + } + + return o.IsEnabled +} + +// GetIsEnabledOk returns a tuple with the IsEnabled field value +// and a boolean to check if the value has been set. +func (o *Plan) GetIsEnabledOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.IsEnabled, true +} + +// SetIsEnabled sets field value +func (o *Plan) SetIsEnabled(v bool) { + o.IsEnabled = v +} + +// GetMonthlyBasePriceUsd returns the MonthlyBasePriceUsd field value +func (o *Plan) GetMonthlyBasePriceUsd() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.MonthlyBasePriceUsd +} + +// GetMonthlyBasePriceUsdOk returns a tuple with the MonthlyBasePriceUsd field value +// and a boolean to check if the value has been set. +func (o *Plan) GetMonthlyBasePriceUsdOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.MonthlyBasePriceUsd, true +} + +// SetMonthlyBasePriceUsd sets field value +func (o *Plan) SetMonthlyBasePriceUsd(v float32) { + o.MonthlyBasePriceUsd = v +} + +// GetMonthlyUsageCreditsUsd returns the MonthlyUsageCreditsUsd field value +func (o *Plan) GetMonthlyUsageCreditsUsd() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.MonthlyUsageCreditsUsd +} + +// GetMonthlyUsageCreditsUsdOk returns a tuple with the MonthlyUsageCreditsUsd field value +// and a boolean to check if the value has been set. +func (o *Plan) GetMonthlyUsageCreditsUsdOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.MonthlyUsageCreditsUsd, true +} + +// SetMonthlyUsageCreditsUsd sets field value +func (o *Plan) SetMonthlyUsageCreditsUsd(v float32) { + o.MonthlyUsageCreditsUsd = v +} + +// GetUsageDiscountPercent returns the UsageDiscountPercent field value if set, zero value otherwise. +func (o *Plan) GetUsageDiscountPercent() float32 { + if o == nil || IsNil(o.UsageDiscountPercent) { + var ret float32 + return ret + } + return *o.UsageDiscountPercent +} + +// GetUsageDiscountPercentOk returns a tuple with the UsageDiscountPercent field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Plan) GetUsageDiscountPercentOk() (*float32, bool) { + if o == nil || IsNil(o.UsageDiscountPercent) { + return nil, false + } + return o.UsageDiscountPercent, true +} + +// HasUsageDiscountPercent returns a boolean if a field has been set. +func (o *Plan) HasUsageDiscountPercent() bool { + if o != nil && !IsNil(o.UsageDiscountPercent) { + return true + } + + return false +} + +// SetUsageDiscountPercent gets a reference to the given float32 and assigns it to the UsageDiscountPercent field. +func (o *Plan) SetUsageDiscountPercent(v float32) { + o.UsageDiscountPercent = &v +} + +// GetEnabledPlatformFeatures returns the EnabledPlatformFeatures field value +func (o *Plan) GetEnabledPlatformFeatures() []string { + if o == nil { + var ret []string + return ret + } + + return o.EnabledPlatformFeatures +} + +// GetEnabledPlatformFeaturesOk returns a tuple with the EnabledPlatformFeatures field value +// and a boolean to check if the value has been set. +func (o *Plan) GetEnabledPlatformFeaturesOk() ([]string, bool) { + if o == nil { + return nil, false + } + return o.EnabledPlatformFeatures, true +} + +// SetEnabledPlatformFeatures sets field value +func (o *Plan) SetEnabledPlatformFeatures(v []string) { + o.EnabledPlatformFeatures = v +} + +// GetMaxMonthlyUsageUsd returns the MaxMonthlyUsageUsd field value +func (o *Plan) GetMaxMonthlyUsageUsd() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.MaxMonthlyUsageUsd +} + +// GetMaxMonthlyUsageUsdOk returns a tuple with the MaxMonthlyUsageUsd field value +// and a boolean to check if the value has been set. +func (o *Plan) GetMaxMonthlyUsageUsdOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.MaxMonthlyUsageUsd, true +} + +// SetMaxMonthlyUsageUsd sets field value +func (o *Plan) SetMaxMonthlyUsageUsd(v float32) { + o.MaxMonthlyUsageUsd = v +} + +// GetMaxActorMemoryGbytes returns the MaxActorMemoryGbytes field value +func (o *Plan) GetMaxActorMemoryGbytes() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.MaxActorMemoryGbytes +} + +// GetMaxActorMemoryGbytesOk returns a tuple with the MaxActorMemoryGbytes field value +// and a boolean to check if the value has been set. +func (o *Plan) GetMaxActorMemoryGbytesOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.MaxActorMemoryGbytes, true +} + +// SetMaxActorMemoryGbytes sets field value +func (o *Plan) SetMaxActorMemoryGbytes(v float32) { + o.MaxActorMemoryGbytes = v +} + +// GetMaxMonthlyActorComputeUnits returns the MaxMonthlyActorComputeUnits field value +func (o *Plan) GetMaxMonthlyActorComputeUnits() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.MaxMonthlyActorComputeUnits +} + +// GetMaxMonthlyActorComputeUnitsOk returns a tuple with the MaxMonthlyActorComputeUnits field value +// and a boolean to check if the value has been set. +func (o *Plan) GetMaxMonthlyActorComputeUnitsOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.MaxMonthlyActorComputeUnits, true +} + +// SetMaxMonthlyActorComputeUnits sets field value +func (o *Plan) SetMaxMonthlyActorComputeUnits(v float32) { + o.MaxMonthlyActorComputeUnits = v +} + +// GetMaxMonthlyResidentialProxyGbytes returns the MaxMonthlyResidentialProxyGbytes field value +func (o *Plan) GetMaxMonthlyResidentialProxyGbytes() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.MaxMonthlyResidentialProxyGbytes +} + +// GetMaxMonthlyResidentialProxyGbytesOk returns a tuple with the MaxMonthlyResidentialProxyGbytes field value +// and a boolean to check if the value has been set. +func (o *Plan) GetMaxMonthlyResidentialProxyGbytesOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.MaxMonthlyResidentialProxyGbytes, true +} + +// SetMaxMonthlyResidentialProxyGbytes sets field value +func (o *Plan) SetMaxMonthlyResidentialProxyGbytes(v float32) { + o.MaxMonthlyResidentialProxyGbytes = v +} + +// GetMaxMonthlyProxySerps returns the MaxMonthlyProxySerps field value +func (o *Plan) GetMaxMonthlyProxySerps() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.MaxMonthlyProxySerps +} + +// GetMaxMonthlyProxySerpsOk returns a tuple with the MaxMonthlyProxySerps field value +// and a boolean to check if the value has been set. +func (o *Plan) GetMaxMonthlyProxySerpsOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.MaxMonthlyProxySerps, true +} + +// SetMaxMonthlyProxySerps sets field value +func (o *Plan) SetMaxMonthlyProxySerps(v int32) { + o.MaxMonthlyProxySerps = v +} + +// GetMaxMonthlyExternalDataTransferGbytes returns the MaxMonthlyExternalDataTransferGbytes field value +func (o *Plan) GetMaxMonthlyExternalDataTransferGbytes() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.MaxMonthlyExternalDataTransferGbytes +} + +// GetMaxMonthlyExternalDataTransferGbytesOk returns a tuple with the MaxMonthlyExternalDataTransferGbytes field value +// and a boolean to check if the value has been set. +func (o *Plan) GetMaxMonthlyExternalDataTransferGbytesOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.MaxMonthlyExternalDataTransferGbytes, true +} + +// SetMaxMonthlyExternalDataTransferGbytes sets field value +func (o *Plan) SetMaxMonthlyExternalDataTransferGbytes(v float32) { + o.MaxMonthlyExternalDataTransferGbytes = v +} + +// GetMaxActorCount returns the MaxActorCount field value +func (o *Plan) GetMaxActorCount() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.MaxActorCount +} + +// GetMaxActorCountOk returns a tuple with the MaxActorCount field value +// and a boolean to check if the value has been set. +func (o *Plan) GetMaxActorCountOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.MaxActorCount, true +} + +// SetMaxActorCount sets field value +func (o *Plan) SetMaxActorCount(v int32) { + o.MaxActorCount = v +} + +// GetMaxActorTaskCount returns the MaxActorTaskCount field value +func (o *Plan) GetMaxActorTaskCount() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.MaxActorTaskCount +} + +// GetMaxActorTaskCountOk returns a tuple with the MaxActorTaskCount field value +// and a boolean to check if the value has been set. +func (o *Plan) GetMaxActorTaskCountOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.MaxActorTaskCount, true +} + +// SetMaxActorTaskCount sets field value +func (o *Plan) SetMaxActorTaskCount(v int32) { + o.MaxActorTaskCount = v +} + +// GetDataRetentionDays returns the DataRetentionDays field value +func (o *Plan) GetDataRetentionDays() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.DataRetentionDays +} + +// GetDataRetentionDaysOk returns a tuple with the DataRetentionDays field value +// and a boolean to check if the value has been set. +func (o *Plan) GetDataRetentionDaysOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.DataRetentionDays, true +} + +// SetDataRetentionDays sets field value +func (o *Plan) SetDataRetentionDays(v int32) { + o.DataRetentionDays = v +} + +// GetAvailableProxyGroups returns the AvailableProxyGroups field value +func (o *Plan) GetAvailableProxyGroups() map[string]int32 { + if o == nil { + var ret map[string]int32 + return ret + } + + return o.AvailableProxyGroups +} + +// GetAvailableProxyGroupsOk returns a tuple with the AvailableProxyGroups field value +// and a boolean to check if the value has been set. +func (o *Plan) GetAvailableProxyGroupsOk() (map[string]int32, bool) { + if o == nil { + return map[string]int32{}, false + } + return o.AvailableProxyGroups, true +} + +// SetAvailableProxyGroups sets field value +func (o *Plan) SetAvailableProxyGroups(v map[string]int32) { + o.AvailableProxyGroups = v +} + +// GetTeamAccountSeatCount returns the TeamAccountSeatCount field value +func (o *Plan) GetTeamAccountSeatCount() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.TeamAccountSeatCount +} + +// GetTeamAccountSeatCountOk returns a tuple with the TeamAccountSeatCount field value +// and a boolean to check if the value has been set. +func (o *Plan) GetTeamAccountSeatCountOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.TeamAccountSeatCount, true +} + +// SetTeamAccountSeatCount sets field value +func (o *Plan) SetTeamAccountSeatCount(v int32) { + o.TeamAccountSeatCount = v +} + +// GetSupportLevel returns the SupportLevel field value +func (o *Plan) GetSupportLevel() string { + if o == nil { + var ret string + return ret + } + + return o.SupportLevel +} + +// GetSupportLevelOk returns a tuple with the SupportLevel field value +// and a boolean to check if the value has been set. +func (o *Plan) GetSupportLevelOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.SupportLevel, true +} + +// SetSupportLevel sets field value +func (o *Plan) SetSupportLevel(v string) { + o.SupportLevel = v +} + +// GetAvailableAddOns returns the AvailableAddOns field value +func (o *Plan) GetAvailableAddOns() []string { + if o == nil { + var ret []string + return ret + } + + return o.AvailableAddOns +} + +// GetAvailableAddOnsOk returns a tuple with the AvailableAddOns field value +// and a boolean to check if the value has been set. +func (o *Plan) GetAvailableAddOnsOk() ([]string, bool) { + if o == nil { + return nil, false + } + return o.AvailableAddOns, true +} + +// SetAvailableAddOns sets field value +func (o *Plan) SetAvailableAddOns(v []string) { + o.AvailableAddOns = v +} + +// GetTier returns the Tier field value if set, zero value otherwise. +func (o *Plan) GetTier() string { + if o == nil || IsNil(o.Tier) { + var ret string + return ret + } + return *o.Tier +} + +// GetTierOk returns a tuple with the Tier field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Plan) GetTierOk() (*string, bool) { + if o == nil || IsNil(o.Tier) { + return nil, false + } + return o.Tier, true +} + +// HasTier returns a boolean if a field has been set. +func (o *Plan) HasTier() bool { + if o != nil && !IsNil(o.Tier) { + return true + } + + return false +} + +// SetTier gets a reference to the given string and assigns it to the Tier field. +func (o *Plan) SetTier(v string) { + o.Tier = &v +} + +// GetApiRateLimitBoosts returns the ApiRateLimitBoosts field value if set, zero value otherwise. +func (o *Plan) GetApiRateLimitBoosts() int32 { + if o == nil || IsNil(o.ApiRateLimitBoosts) { + var ret int32 + return ret + } + return *o.ApiRateLimitBoosts +} + +// GetApiRateLimitBoostsOk returns a tuple with the ApiRateLimitBoosts field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Plan) GetApiRateLimitBoostsOk() (*int32, bool) { + if o == nil || IsNil(o.ApiRateLimitBoosts) { + return nil, false + } + return o.ApiRateLimitBoosts, true +} + +// HasApiRateLimitBoosts returns a boolean if a field has been set. +func (o *Plan) HasApiRateLimitBoosts() bool { + if o != nil && !IsNil(o.ApiRateLimitBoosts) { + return true + } + + return false +} + +// SetApiRateLimitBoosts gets a reference to the given int32 and assigns it to the ApiRateLimitBoosts field. +func (o *Plan) SetApiRateLimitBoosts(v int32) { + o.ApiRateLimitBoosts = &v +} + +// GetMaxScheduleCount returns the MaxScheduleCount field value if set, zero value otherwise. +func (o *Plan) GetMaxScheduleCount() int32 { + if o == nil || IsNil(o.MaxScheduleCount) { + var ret int32 + return ret + } + return *o.MaxScheduleCount +} + +// GetMaxScheduleCountOk returns a tuple with the MaxScheduleCount field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Plan) GetMaxScheduleCountOk() (*int32, bool) { + if o == nil || IsNil(o.MaxScheduleCount) { + return nil, false + } + return o.MaxScheduleCount, true +} + +// HasMaxScheduleCount returns a boolean if a field has been set. +func (o *Plan) HasMaxScheduleCount() bool { + if o != nil && !IsNil(o.MaxScheduleCount) { + return true + } + + return false +} + +// SetMaxScheduleCount gets a reference to the given int32 and assigns it to the MaxScheduleCount field. +func (o *Plan) SetMaxScheduleCount(v int32) { + o.MaxScheduleCount = &v +} + +// GetMaxConcurrentActorRuns returns the MaxConcurrentActorRuns field value if set, zero value otherwise. +func (o *Plan) GetMaxConcurrentActorRuns() int32 { + if o == nil || IsNil(o.MaxConcurrentActorRuns) { + var ret int32 + return ret + } + return *o.MaxConcurrentActorRuns +} + +// GetMaxConcurrentActorRunsOk returns a tuple with the MaxConcurrentActorRuns field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Plan) GetMaxConcurrentActorRunsOk() (*int32, bool) { + if o == nil || IsNil(o.MaxConcurrentActorRuns) { + return nil, false + } + return o.MaxConcurrentActorRuns, true +} + +// HasMaxConcurrentActorRuns returns a boolean if a field has been set. +func (o *Plan) HasMaxConcurrentActorRuns() bool { + if o != nil && !IsNil(o.MaxConcurrentActorRuns) { + return true + } + + return false +} + +// SetMaxConcurrentActorRuns gets a reference to the given int32 and assigns it to the MaxConcurrentActorRuns field. +func (o *Plan) SetMaxConcurrentActorRuns(v int32) { + o.MaxConcurrentActorRuns = &v +} + +// GetPlanPricing returns the PlanPricing field value if set, zero value otherwise. +func (o *Plan) GetPlanPricing() map[string]interface{} { + if o == nil || IsNil(o.PlanPricing) { + var ret map[string]interface{} + return ret + } + return o.PlanPricing +} + +// GetPlanPricingOk returns a tuple with the PlanPricing field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Plan) GetPlanPricingOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.PlanPricing) { + return map[string]interface{}{}, false + } + return o.PlanPricing, true +} + +// HasPlanPricing returns a boolean if a field has been set. +func (o *Plan) HasPlanPricing() bool { + if o != nil && !IsNil(o.PlanPricing) { + return true + } + + return false +} + +// SetPlanPricing gets a reference to the given map[string]interface{} and assigns it to the PlanPricing field. +func (o *Plan) SetPlanPricing(v map[string]interface{}) { + o.PlanPricing = v +} + +func (o Plan) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Plan) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["description"] = o.Description + toSerialize["isEnabled"] = o.IsEnabled + toSerialize["monthlyBasePriceUsd"] = o.MonthlyBasePriceUsd + toSerialize["monthlyUsageCreditsUsd"] = o.MonthlyUsageCreditsUsd + if !IsNil(o.UsageDiscountPercent) { + toSerialize["usageDiscountPercent"] = o.UsageDiscountPercent + } + toSerialize["enabledPlatformFeatures"] = o.EnabledPlatformFeatures + toSerialize["maxMonthlyUsageUsd"] = o.MaxMonthlyUsageUsd + toSerialize["maxActorMemoryGbytes"] = o.MaxActorMemoryGbytes + toSerialize["maxMonthlyActorComputeUnits"] = o.MaxMonthlyActorComputeUnits + toSerialize["maxMonthlyResidentialProxyGbytes"] = o.MaxMonthlyResidentialProxyGbytes + toSerialize["maxMonthlyProxySerps"] = o.MaxMonthlyProxySerps + toSerialize["maxMonthlyExternalDataTransferGbytes"] = o.MaxMonthlyExternalDataTransferGbytes + toSerialize["maxActorCount"] = o.MaxActorCount + toSerialize["maxActorTaskCount"] = o.MaxActorTaskCount + toSerialize["dataRetentionDays"] = o.DataRetentionDays + toSerialize["availableProxyGroups"] = o.AvailableProxyGroups + toSerialize["teamAccountSeatCount"] = o.TeamAccountSeatCount + toSerialize["supportLevel"] = o.SupportLevel + toSerialize["availableAddOns"] = o.AvailableAddOns + if !IsNil(o.Tier) { + toSerialize["tier"] = o.Tier + } + if !IsNil(o.ApiRateLimitBoosts) { + toSerialize["apiRateLimitBoosts"] = o.ApiRateLimitBoosts + } + if !IsNil(o.MaxScheduleCount) { + toSerialize["maxScheduleCount"] = o.MaxScheduleCount + } + if !IsNil(o.MaxConcurrentActorRuns) { + toSerialize["maxConcurrentActorRuns"] = o.MaxConcurrentActorRuns + } + if !IsNil(o.PlanPricing) { + toSerialize["planPricing"] = o.PlanPricing + } + return toSerialize, nil +} + +func (o *Plan) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "description", + "isEnabled", + "monthlyBasePriceUsd", + "monthlyUsageCreditsUsd", + "enabledPlatformFeatures", + "maxMonthlyUsageUsd", + "maxActorMemoryGbytes", + "maxMonthlyActorComputeUnits", + "maxMonthlyResidentialProxyGbytes", + "maxMonthlyProxySerps", + "maxMonthlyExternalDataTransferGbytes", + "maxActorCount", + "maxActorTaskCount", + "dataRetentionDays", + "availableProxyGroups", + "teamAccountSeatCount", + "supportLevel", + "availableAddOns", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPlan := _Plan{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varPlan) + + if err != nil { + return err + } + + *o = Plan(varPlan) + + return err +} + +type NullablePlan struct { + value *Plan + isSet bool +} + +func (v NullablePlan) Get() *Plan { + return v.value +} + +func (v *NullablePlan) Set(val *Plan) { + v.value = val + v.isSet = true +} + +func (v NullablePlan) IsSet() bool { + return v.isSet +} + +func (v *NullablePlan) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePlan(val *Plan) *NullablePlan { + return &NullablePlan{value: val, isSet: true} +} + +func (v NullablePlan) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePlan) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_price_per_dataset_item_actor_pricing_info.go b/model_price_per_dataset_item_actor_pricing_info.go new file mode 100644 index 0000000..cbec914 --- /dev/null +++ b/model_price_per_dataset_item_actor_pricing_info.go @@ -0,0 +1,529 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" + "time" + "bytes" + "fmt" +) + +// checks if the PricePerDatasetItemActorPricingInfo type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PricePerDatasetItemActorPricingInfo{} + +// PricePerDatasetItemActorPricingInfo struct for PricePerDatasetItemActorPricingInfo +type PricePerDatasetItemActorPricingInfo struct { + // In [0, 1], fraction of pricePerUnitUsd that goes to Apify + ApifyMarginPercentage float32 `json:"apifyMarginPercentage"` + // When this pricing info record has been created + CreatedAt time.Time `json:"createdAt"` + // Since when is this pricing info record effective for a given Actor + StartedAt time.Time `json:"startedAt"` + NotifiedAboutFutureChangeAt *time.Time `json:"notifiedAboutFutureChangeAt,omitempty"` + NotifiedAboutChangeAt *time.Time `json:"notifiedAboutChangeAt,omitempty"` + ReasonForChange *string `json:"reasonForChange,omitempty"` + IsPriceChangeNotificationSuppressed *bool `json:"isPriceChangeNotificationSuppressed,omitempty"` + ForceContainsSignificantPriceChange *bool `json:"forceContainsSignificantPriceChange,omitempty"` + PricingModel string `json:"pricingModel"` + // Name of the unit that is being charged + UnitName string `json:"unitName"` + // Price per unit in USD. Mutually exclusive with `tieredPricing` - exactly one of the two is present on a pricing record. + PricePerUnitUsd *float32 `json:"pricePerUnitUsd,omitempty"` + // Tiered price-per-dataset-item pricing, keyed by subscription tier (e.g. `FREE`, `BRONZE`, `SILVER`, `GOLD`, `PLATINUM`, `DIAMOND`). The actual price applied to a run is resolved from the user's tier. + TieredPricing map[string]TieredPricingPerDatasetItemEntry `json:"tieredPricing,omitempty"` +} + +type _PricePerDatasetItemActorPricingInfo PricePerDatasetItemActorPricingInfo + +// NewPricePerDatasetItemActorPricingInfo instantiates a new PricePerDatasetItemActorPricingInfo object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPricePerDatasetItemActorPricingInfo(apifyMarginPercentage float32, createdAt time.Time, startedAt time.Time, pricingModel string, unitName string) *PricePerDatasetItemActorPricingInfo { + this := PricePerDatasetItemActorPricingInfo{} + this.ApifyMarginPercentage = apifyMarginPercentage + this.CreatedAt = createdAt + this.StartedAt = startedAt + this.PricingModel = pricingModel + this.UnitName = unitName + return &this +} + +// NewPricePerDatasetItemActorPricingInfoWithDefaults instantiates a new PricePerDatasetItemActorPricingInfo object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPricePerDatasetItemActorPricingInfoWithDefaults() *PricePerDatasetItemActorPricingInfo { + this := PricePerDatasetItemActorPricingInfo{} + return &this +} + +// GetApifyMarginPercentage returns the ApifyMarginPercentage field value +func (o *PricePerDatasetItemActorPricingInfo) GetApifyMarginPercentage() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.ApifyMarginPercentage +} + +// GetApifyMarginPercentageOk returns a tuple with the ApifyMarginPercentage field value +// and a boolean to check if the value has been set. +func (o *PricePerDatasetItemActorPricingInfo) GetApifyMarginPercentageOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.ApifyMarginPercentage, true +} + +// SetApifyMarginPercentage sets field value +func (o *PricePerDatasetItemActorPricingInfo) SetApifyMarginPercentage(v float32) { + o.ApifyMarginPercentage = v +} + +// GetCreatedAt returns the CreatedAt field value +func (o *PricePerDatasetItemActorPricingInfo) GetCreatedAt() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value +// and a boolean to check if the value has been set. +func (o *PricePerDatasetItemActorPricingInfo) GetCreatedAtOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.CreatedAt, true +} + +// SetCreatedAt sets field value +func (o *PricePerDatasetItemActorPricingInfo) SetCreatedAt(v time.Time) { + o.CreatedAt = v +} + +// GetStartedAt returns the StartedAt field value +func (o *PricePerDatasetItemActorPricingInfo) GetStartedAt() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.StartedAt +} + +// GetStartedAtOk returns a tuple with the StartedAt field value +// and a boolean to check if the value has been set. +func (o *PricePerDatasetItemActorPricingInfo) GetStartedAtOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.StartedAt, true +} + +// SetStartedAt sets field value +func (o *PricePerDatasetItemActorPricingInfo) SetStartedAt(v time.Time) { + o.StartedAt = v +} + +// GetNotifiedAboutFutureChangeAt returns the NotifiedAboutFutureChangeAt field value if set, zero value otherwise. +func (o *PricePerDatasetItemActorPricingInfo) GetNotifiedAboutFutureChangeAt() time.Time { + if o == nil || IsNil(o.NotifiedAboutFutureChangeAt) { + var ret time.Time + return ret + } + return *o.NotifiedAboutFutureChangeAt +} + +// GetNotifiedAboutFutureChangeAtOk returns a tuple with the NotifiedAboutFutureChangeAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PricePerDatasetItemActorPricingInfo) GetNotifiedAboutFutureChangeAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.NotifiedAboutFutureChangeAt) { + return nil, false + } + return o.NotifiedAboutFutureChangeAt, true +} + +// HasNotifiedAboutFutureChangeAt returns a boolean if a field has been set. +func (o *PricePerDatasetItemActorPricingInfo) HasNotifiedAboutFutureChangeAt() bool { + if o != nil && !IsNil(o.NotifiedAboutFutureChangeAt) { + return true + } + + return false +} + +// SetNotifiedAboutFutureChangeAt gets a reference to the given time.Time and assigns it to the NotifiedAboutFutureChangeAt field. +func (o *PricePerDatasetItemActorPricingInfo) SetNotifiedAboutFutureChangeAt(v time.Time) { + o.NotifiedAboutFutureChangeAt = &v +} + +// GetNotifiedAboutChangeAt returns the NotifiedAboutChangeAt field value if set, zero value otherwise. +func (o *PricePerDatasetItemActorPricingInfo) GetNotifiedAboutChangeAt() time.Time { + if o == nil || IsNil(o.NotifiedAboutChangeAt) { + var ret time.Time + return ret + } + return *o.NotifiedAboutChangeAt +} + +// GetNotifiedAboutChangeAtOk returns a tuple with the NotifiedAboutChangeAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PricePerDatasetItemActorPricingInfo) GetNotifiedAboutChangeAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.NotifiedAboutChangeAt) { + return nil, false + } + return o.NotifiedAboutChangeAt, true +} + +// HasNotifiedAboutChangeAt returns a boolean if a field has been set. +func (o *PricePerDatasetItemActorPricingInfo) HasNotifiedAboutChangeAt() bool { + if o != nil && !IsNil(o.NotifiedAboutChangeAt) { + return true + } + + return false +} + +// SetNotifiedAboutChangeAt gets a reference to the given time.Time and assigns it to the NotifiedAboutChangeAt field. +func (o *PricePerDatasetItemActorPricingInfo) SetNotifiedAboutChangeAt(v time.Time) { + o.NotifiedAboutChangeAt = &v +} + +// GetReasonForChange returns the ReasonForChange field value if set, zero value otherwise. +func (o *PricePerDatasetItemActorPricingInfo) GetReasonForChange() string { + if o == nil || IsNil(o.ReasonForChange) { + var ret string + return ret + } + return *o.ReasonForChange +} + +// GetReasonForChangeOk returns a tuple with the ReasonForChange field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PricePerDatasetItemActorPricingInfo) GetReasonForChangeOk() (*string, bool) { + if o == nil || IsNil(o.ReasonForChange) { + return nil, false + } + return o.ReasonForChange, true +} + +// HasReasonForChange returns a boolean if a field has been set. +func (o *PricePerDatasetItemActorPricingInfo) HasReasonForChange() bool { + if o != nil && !IsNil(o.ReasonForChange) { + return true + } + + return false +} + +// SetReasonForChange gets a reference to the given string and assigns it to the ReasonForChange field. +func (o *PricePerDatasetItemActorPricingInfo) SetReasonForChange(v string) { + o.ReasonForChange = &v +} + +// GetIsPriceChangeNotificationSuppressed returns the IsPriceChangeNotificationSuppressed field value if set, zero value otherwise. +func (o *PricePerDatasetItemActorPricingInfo) GetIsPriceChangeNotificationSuppressed() bool { + if o == nil || IsNil(o.IsPriceChangeNotificationSuppressed) { + var ret bool + return ret + } + return *o.IsPriceChangeNotificationSuppressed +} + +// GetIsPriceChangeNotificationSuppressedOk returns a tuple with the IsPriceChangeNotificationSuppressed field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PricePerDatasetItemActorPricingInfo) GetIsPriceChangeNotificationSuppressedOk() (*bool, bool) { + if o == nil || IsNil(o.IsPriceChangeNotificationSuppressed) { + return nil, false + } + return o.IsPriceChangeNotificationSuppressed, true +} + +// HasIsPriceChangeNotificationSuppressed returns a boolean if a field has been set. +func (o *PricePerDatasetItemActorPricingInfo) HasIsPriceChangeNotificationSuppressed() bool { + if o != nil && !IsNil(o.IsPriceChangeNotificationSuppressed) { + return true + } + + return false +} + +// SetIsPriceChangeNotificationSuppressed gets a reference to the given bool and assigns it to the IsPriceChangeNotificationSuppressed field. +func (o *PricePerDatasetItemActorPricingInfo) SetIsPriceChangeNotificationSuppressed(v bool) { + o.IsPriceChangeNotificationSuppressed = &v +} + +// GetForceContainsSignificantPriceChange returns the ForceContainsSignificantPriceChange field value if set, zero value otherwise. +func (o *PricePerDatasetItemActorPricingInfo) GetForceContainsSignificantPriceChange() bool { + if o == nil || IsNil(o.ForceContainsSignificantPriceChange) { + var ret bool + return ret + } + return *o.ForceContainsSignificantPriceChange +} + +// GetForceContainsSignificantPriceChangeOk returns a tuple with the ForceContainsSignificantPriceChange field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PricePerDatasetItemActorPricingInfo) GetForceContainsSignificantPriceChangeOk() (*bool, bool) { + if o == nil || IsNil(o.ForceContainsSignificantPriceChange) { + return nil, false + } + return o.ForceContainsSignificantPriceChange, true +} + +// HasForceContainsSignificantPriceChange returns a boolean if a field has been set. +func (o *PricePerDatasetItemActorPricingInfo) HasForceContainsSignificantPriceChange() bool { + if o != nil && !IsNil(o.ForceContainsSignificantPriceChange) { + return true + } + + return false +} + +// SetForceContainsSignificantPriceChange gets a reference to the given bool and assigns it to the ForceContainsSignificantPriceChange field. +func (o *PricePerDatasetItemActorPricingInfo) SetForceContainsSignificantPriceChange(v bool) { + o.ForceContainsSignificantPriceChange = &v +} + +// GetPricingModel returns the PricingModel field value +func (o *PricePerDatasetItemActorPricingInfo) GetPricingModel() string { + if o == nil { + var ret string + return ret + } + + return o.PricingModel +} + +// GetPricingModelOk returns a tuple with the PricingModel field value +// and a boolean to check if the value has been set. +func (o *PricePerDatasetItemActorPricingInfo) GetPricingModelOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.PricingModel, true +} + +// SetPricingModel sets field value +func (o *PricePerDatasetItemActorPricingInfo) SetPricingModel(v string) { + o.PricingModel = v +} + +// GetUnitName returns the UnitName field value +func (o *PricePerDatasetItemActorPricingInfo) GetUnitName() string { + if o == nil { + var ret string + return ret + } + + return o.UnitName +} + +// GetUnitNameOk returns a tuple with the UnitName field value +// and a boolean to check if the value has been set. +func (o *PricePerDatasetItemActorPricingInfo) GetUnitNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.UnitName, true +} + +// SetUnitName sets field value +func (o *PricePerDatasetItemActorPricingInfo) SetUnitName(v string) { + o.UnitName = v +} + +// GetPricePerUnitUsd returns the PricePerUnitUsd field value if set, zero value otherwise. +func (o *PricePerDatasetItemActorPricingInfo) GetPricePerUnitUsd() float32 { + if o == nil || IsNil(o.PricePerUnitUsd) { + var ret float32 + return ret + } + return *o.PricePerUnitUsd +} + +// GetPricePerUnitUsdOk returns a tuple with the PricePerUnitUsd field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PricePerDatasetItemActorPricingInfo) GetPricePerUnitUsdOk() (*float32, bool) { + if o == nil || IsNil(o.PricePerUnitUsd) { + return nil, false + } + return o.PricePerUnitUsd, true +} + +// HasPricePerUnitUsd returns a boolean if a field has been set. +func (o *PricePerDatasetItemActorPricingInfo) HasPricePerUnitUsd() bool { + if o != nil && !IsNil(o.PricePerUnitUsd) { + return true + } + + return false +} + +// SetPricePerUnitUsd gets a reference to the given float32 and assigns it to the PricePerUnitUsd field. +func (o *PricePerDatasetItemActorPricingInfo) SetPricePerUnitUsd(v float32) { + o.PricePerUnitUsd = &v +} + +// GetTieredPricing returns the TieredPricing field value if set, zero value otherwise. +func (o *PricePerDatasetItemActorPricingInfo) GetTieredPricing() map[string]TieredPricingPerDatasetItemEntry { + if o == nil || IsNil(o.TieredPricing) { + var ret map[string]TieredPricingPerDatasetItemEntry + return ret + } + return o.TieredPricing +} + +// GetTieredPricingOk returns a tuple with the TieredPricing field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PricePerDatasetItemActorPricingInfo) GetTieredPricingOk() (map[string]TieredPricingPerDatasetItemEntry, bool) { + if o == nil || IsNil(o.TieredPricing) { + return map[string]TieredPricingPerDatasetItemEntry{}, false + } + return o.TieredPricing, true +} + +// HasTieredPricing returns a boolean if a field has been set. +func (o *PricePerDatasetItemActorPricingInfo) HasTieredPricing() bool { + if o != nil && !IsNil(o.TieredPricing) { + return true + } + + return false +} + +// SetTieredPricing gets a reference to the given map[string]TieredPricingPerDatasetItemEntry and assigns it to the TieredPricing field. +func (o *PricePerDatasetItemActorPricingInfo) SetTieredPricing(v map[string]TieredPricingPerDatasetItemEntry) { + o.TieredPricing = v +} + +func (o PricePerDatasetItemActorPricingInfo) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PricePerDatasetItemActorPricingInfo) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["apifyMarginPercentage"] = o.ApifyMarginPercentage + toSerialize["createdAt"] = o.CreatedAt + toSerialize["startedAt"] = o.StartedAt + if !IsNil(o.NotifiedAboutFutureChangeAt) { + toSerialize["notifiedAboutFutureChangeAt"] = o.NotifiedAboutFutureChangeAt + } + if !IsNil(o.NotifiedAboutChangeAt) { + toSerialize["notifiedAboutChangeAt"] = o.NotifiedAboutChangeAt + } + if !IsNil(o.ReasonForChange) { + toSerialize["reasonForChange"] = o.ReasonForChange + } + if !IsNil(o.IsPriceChangeNotificationSuppressed) { + toSerialize["isPriceChangeNotificationSuppressed"] = o.IsPriceChangeNotificationSuppressed + } + if !IsNil(o.ForceContainsSignificantPriceChange) { + toSerialize["forceContainsSignificantPriceChange"] = o.ForceContainsSignificantPriceChange + } + toSerialize["pricingModel"] = o.PricingModel + toSerialize["unitName"] = o.UnitName + if !IsNil(o.PricePerUnitUsd) { + toSerialize["pricePerUnitUsd"] = o.PricePerUnitUsd + } + if !IsNil(o.TieredPricing) { + toSerialize["tieredPricing"] = o.TieredPricing + } + return toSerialize, nil +} + +func (o *PricePerDatasetItemActorPricingInfo) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "apifyMarginPercentage", + "createdAt", + "startedAt", + "pricingModel", + "unitName", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPricePerDatasetItemActorPricingInfo := _PricePerDatasetItemActorPricingInfo{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varPricePerDatasetItemActorPricingInfo) + + if err != nil { + return err + } + + *o = PricePerDatasetItemActorPricingInfo(varPricePerDatasetItemActorPricingInfo) + + return err +} + +type NullablePricePerDatasetItemActorPricingInfo struct { + value *PricePerDatasetItemActorPricingInfo + isSet bool +} + +func (v NullablePricePerDatasetItemActorPricingInfo) Get() *PricePerDatasetItemActorPricingInfo { + return v.value +} + +func (v *NullablePricePerDatasetItemActorPricingInfo) Set(val *PricePerDatasetItemActorPricingInfo) { + v.value = val + v.isSet = true +} + +func (v NullablePricePerDatasetItemActorPricingInfo) IsSet() bool { + return v.isSet +} + +func (v *NullablePricePerDatasetItemActorPricingInfo) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePricePerDatasetItemActorPricingInfo(val *PricePerDatasetItemActorPricingInfo) *NullablePricePerDatasetItemActorPricingInfo { + return &NullablePricePerDatasetItemActorPricingInfo{value: val, isSet: true} +} + +func (v NullablePricePerDatasetItemActorPricingInfo) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePricePerDatasetItemActorPricingInfo) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_price_tiers.go b/model_price_tiers.go new file mode 100644 index 0000000..bbc940d --- /dev/null +++ b/model_price_tiers.go @@ -0,0 +1,270 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" + "bytes" + "fmt" +) + +// checks if the PriceTiers type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PriceTiers{} + +// PriceTiers struct for PriceTiers +type PriceTiers struct { + QuantityAbove float32 `json:"quantityAbove"` + DiscountPercent float32 `json:"discountPercent"` + TierQuantity float32 `json:"tierQuantity"` + UnitPriceUsd float32 `json:"unitPriceUsd"` + PriceUsd float32 `json:"priceUsd"` +} + +type _PriceTiers PriceTiers + +// NewPriceTiers instantiates a new PriceTiers object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPriceTiers(quantityAbove float32, discountPercent float32, tierQuantity float32, unitPriceUsd float32, priceUsd float32) *PriceTiers { + this := PriceTiers{} + this.QuantityAbove = quantityAbove + this.DiscountPercent = discountPercent + this.TierQuantity = tierQuantity + this.UnitPriceUsd = unitPriceUsd + this.PriceUsd = priceUsd + return &this +} + +// NewPriceTiersWithDefaults instantiates a new PriceTiers object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPriceTiersWithDefaults() *PriceTiers { + this := PriceTiers{} + return &this +} + +// GetQuantityAbove returns the QuantityAbove field value +func (o *PriceTiers) GetQuantityAbove() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.QuantityAbove +} + +// GetQuantityAboveOk returns a tuple with the QuantityAbove field value +// and a boolean to check if the value has been set. +func (o *PriceTiers) GetQuantityAboveOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.QuantityAbove, true +} + +// SetQuantityAbove sets field value +func (o *PriceTiers) SetQuantityAbove(v float32) { + o.QuantityAbove = v +} + +// GetDiscountPercent returns the DiscountPercent field value +func (o *PriceTiers) GetDiscountPercent() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.DiscountPercent +} + +// GetDiscountPercentOk returns a tuple with the DiscountPercent field value +// and a boolean to check if the value has been set. +func (o *PriceTiers) GetDiscountPercentOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.DiscountPercent, true +} + +// SetDiscountPercent sets field value +func (o *PriceTiers) SetDiscountPercent(v float32) { + o.DiscountPercent = v +} + +// GetTierQuantity returns the TierQuantity field value +func (o *PriceTiers) GetTierQuantity() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.TierQuantity +} + +// GetTierQuantityOk returns a tuple with the TierQuantity field value +// and a boolean to check if the value has been set. +func (o *PriceTiers) GetTierQuantityOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.TierQuantity, true +} + +// SetTierQuantity sets field value +func (o *PriceTiers) SetTierQuantity(v float32) { + o.TierQuantity = v +} + +// GetUnitPriceUsd returns the UnitPriceUsd field value +func (o *PriceTiers) GetUnitPriceUsd() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.UnitPriceUsd +} + +// GetUnitPriceUsdOk returns a tuple with the UnitPriceUsd field value +// and a boolean to check if the value has been set. +func (o *PriceTiers) GetUnitPriceUsdOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.UnitPriceUsd, true +} + +// SetUnitPriceUsd sets field value +func (o *PriceTiers) SetUnitPriceUsd(v float32) { + o.UnitPriceUsd = v +} + +// GetPriceUsd returns the PriceUsd field value +func (o *PriceTiers) GetPriceUsd() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.PriceUsd +} + +// GetPriceUsdOk returns a tuple with the PriceUsd field value +// and a boolean to check if the value has been set. +func (o *PriceTiers) GetPriceUsdOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.PriceUsd, true +} + +// SetPriceUsd sets field value +func (o *PriceTiers) SetPriceUsd(v float32) { + o.PriceUsd = v +} + +func (o PriceTiers) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PriceTiers) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["quantityAbove"] = o.QuantityAbove + toSerialize["discountPercent"] = o.DiscountPercent + toSerialize["tierQuantity"] = o.TierQuantity + toSerialize["unitPriceUsd"] = o.UnitPriceUsd + toSerialize["priceUsd"] = o.PriceUsd + return toSerialize, nil +} + +func (o *PriceTiers) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "quantityAbove", + "discountPercent", + "tierQuantity", + "unitPriceUsd", + "priceUsd", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPriceTiers := _PriceTiers{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varPriceTiers) + + if err != nil { + return err + } + + *o = PriceTiers(varPriceTiers) + + return err +} + +type NullablePriceTiers struct { + value *PriceTiers + isSet bool +} + +func (v NullablePriceTiers) Get() *PriceTiers { + return v.value +} + +func (v *NullablePriceTiers) Set(val *PriceTiers) { + v.value = val + v.isSet = true +} + +func (v NullablePriceTiers) IsSet() bool { + return v.isSet +} + +func (v *NullablePriceTiers) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePriceTiers(val *PriceTiers) *NullablePriceTiers { + return &NullablePriceTiers{value: val, isSet: true} +} + +func (v NullablePriceTiers) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePriceTiers) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_private_user_data_response.go b/model_private_user_data_response.go new file mode 100644 index 0000000..e782018 --- /dev/null +++ b/model_private_user_data_response.go @@ -0,0 +1,158 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" + "bytes" + "fmt" +) + +// checks if the PrivateUserDataResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PrivateUserDataResponse{} + +// PrivateUserDataResponse struct for PrivateUserDataResponse +type PrivateUserDataResponse struct { + Data UserPrivateInfo `json:"data"` +} + +type _PrivateUserDataResponse PrivateUserDataResponse + +// NewPrivateUserDataResponse instantiates a new PrivateUserDataResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPrivateUserDataResponse(data UserPrivateInfo) *PrivateUserDataResponse { + this := PrivateUserDataResponse{} + this.Data = data + return &this +} + +// NewPrivateUserDataResponseWithDefaults instantiates a new PrivateUserDataResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPrivateUserDataResponseWithDefaults() *PrivateUserDataResponse { + this := PrivateUserDataResponse{} + return &this +} + +// GetData returns the Data field value +func (o *PrivateUserDataResponse) GetData() UserPrivateInfo { + if o == nil { + var ret UserPrivateInfo + return ret + } + + return o.Data +} + +// GetDataOk returns a tuple with the Data field value +// and a boolean to check if the value has been set. +func (o *PrivateUserDataResponse) GetDataOk() (*UserPrivateInfo, bool) { + if o == nil { + return nil, false + } + return &o.Data, true +} + +// SetData sets field value +func (o *PrivateUserDataResponse) SetData(v UserPrivateInfo) { + o.Data = v +} + +func (o PrivateUserDataResponse) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PrivateUserDataResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["data"] = o.Data + return toSerialize, nil +} + +func (o *PrivateUserDataResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "data", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPrivateUserDataResponse := _PrivateUserDataResponse{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varPrivateUserDataResponse) + + if err != nil { + return err + } + + *o = PrivateUserDataResponse(varPrivateUserDataResponse) + + return err +} + +type NullablePrivateUserDataResponse struct { + value *PrivateUserDataResponse + isSet bool +} + +func (v NullablePrivateUserDataResponse) Get() *PrivateUserDataResponse { + return v.value +} + +func (v *NullablePrivateUserDataResponse) Set(val *PrivateUserDataResponse) { + v.value = val + v.isSet = true +} + +func (v NullablePrivateUserDataResponse) IsSet() bool { + return v.isSet +} + +func (v *NullablePrivateUserDataResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePrivateUserDataResponse(val *PrivateUserDataResponse) *NullablePrivateUserDataResponse { + return &NullablePrivateUserDataResponse{value: val, isSet: true} +} + +func (v NullablePrivateUserDataResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePrivateUserDataResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_profile.go b/model_profile.go new file mode 100644 index 0000000..6b3b90b --- /dev/null +++ b/model_profile.go @@ -0,0 +1,306 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" +) + +// checks if the Profile type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Profile{} + +// Profile struct for Profile +type Profile struct { + Bio *string `json:"bio,omitempty"` + Name *string `json:"name,omitempty"` + PictureUrl *string `json:"pictureUrl,omitempty"` + GithubUsername *string `json:"githubUsername,omitempty"` + WebsiteUrl *string `json:"websiteUrl,omitempty"` + TwitterUsername *string `json:"twitterUsername,omitempty"` +} + +// NewProfile instantiates a new Profile object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewProfile() *Profile { + this := Profile{} + return &this +} + +// NewProfileWithDefaults instantiates a new Profile object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewProfileWithDefaults() *Profile { + this := Profile{} + return &this +} + +// GetBio returns the Bio field value if set, zero value otherwise. +func (o *Profile) GetBio() string { + if o == nil || IsNil(o.Bio) { + var ret string + return ret + } + return *o.Bio +} + +// GetBioOk returns a tuple with the Bio field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Profile) GetBioOk() (*string, bool) { + if o == nil || IsNil(o.Bio) { + return nil, false + } + return o.Bio, true +} + +// HasBio returns a boolean if a field has been set. +func (o *Profile) HasBio() bool { + if o != nil && !IsNil(o.Bio) { + return true + } + + return false +} + +// SetBio gets a reference to the given string and assigns it to the Bio field. +func (o *Profile) SetBio(v string) { + o.Bio = &v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *Profile) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Profile) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *Profile) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *Profile) SetName(v string) { + o.Name = &v +} + +// GetPictureUrl returns the PictureUrl field value if set, zero value otherwise. +func (o *Profile) GetPictureUrl() string { + if o == nil || IsNil(o.PictureUrl) { + var ret string + return ret + } + return *o.PictureUrl +} + +// GetPictureUrlOk returns a tuple with the PictureUrl field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Profile) GetPictureUrlOk() (*string, bool) { + if o == nil || IsNil(o.PictureUrl) { + return nil, false + } + return o.PictureUrl, true +} + +// HasPictureUrl returns a boolean if a field has been set. +func (o *Profile) HasPictureUrl() bool { + if o != nil && !IsNil(o.PictureUrl) { + return true + } + + return false +} + +// SetPictureUrl gets a reference to the given string and assigns it to the PictureUrl field. +func (o *Profile) SetPictureUrl(v string) { + o.PictureUrl = &v +} + +// GetGithubUsername returns the GithubUsername field value if set, zero value otherwise. +func (o *Profile) GetGithubUsername() string { + if o == nil || IsNil(o.GithubUsername) { + var ret string + return ret + } + return *o.GithubUsername +} + +// GetGithubUsernameOk returns a tuple with the GithubUsername field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Profile) GetGithubUsernameOk() (*string, bool) { + if o == nil || IsNil(o.GithubUsername) { + return nil, false + } + return o.GithubUsername, true +} + +// HasGithubUsername returns a boolean if a field has been set. +func (o *Profile) HasGithubUsername() bool { + if o != nil && !IsNil(o.GithubUsername) { + return true + } + + return false +} + +// SetGithubUsername gets a reference to the given string and assigns it to the GithubUsername field. +func (o *Profile) SetGithubUsername(v string) { + o.GithubUsername = &v +} + +// GetWebsiteUrl returns the WebsiteUrl field value if set, zero value otherwise. +func (o *Profile) GetWebsiteUrl() string { + if o == nil || IsNil(o.WebsiteUrl) { + var ret string + return ret + } + return *o.WebsiteUrl +} + +// GetWebsiteUrlOk returns a tuple with the WebsiteUrl field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Profile) GetWebsiteUrlOk() (*string, bool) { + if o == nil || IsNil(o.WebsiteUrl) { + return nil, false + } + return o.WebsiteUrl, true +} + +// HasWebsiteUrl returns a boolean if a field has been set. +func (o *Profile) HasWebsiteUrl() bool { + if o != nil && !IsNil(o.WebsiteUrl) { + return true + } + + return false +} + +// SetWebsiteUrl gets a reference to the given string and assigns it to the WebsiteUrl field. +func (o *Profile) SetWebsiteUrl(v string) { + o.WebsiteUrl = &v +} + +// GetTwitterUsername returns the TwitterUsername field value if set, zero value otherwise. +func (o *Profile) GetTwitterUsername() string { + if o == nil || IsNil(o.TwitterUsername) { + var ret string + return ret + } + return *o.TwitterUsername +} + +// GetTwitterUsernameOk returns a tuple with the TwitterUsername field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Profile) GetTwitterUsernameOk() (*string, bool) { + if o == nil || IsNil(o.TwitterUsername) { + return nil, false + } + return o.TwitterUsername, true +} + +// HasTwitterUsername returns a boolean if a field has been set. +func (o *Profile) HasTwitterUsername() bool { + if o != nil && !IsNil(o.TwitterUsername) { + return true + } + + return false +} + +// SetTwitterUsername gets a reference to the given string and assigns it to the TwitterUsername field. +func (o *Profile) SetTwitterUsername(v string) { + o.TwitterUsername = &v +} + +func (o Profile) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Profile) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Bio) { + toSerialize["bio"] = o.Bio + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.PictureUrl) { + toSerialize["pictureUrl"] = o.PictureUrl + } + if !IsNil(o.GithubUsername) { + toSerialize["githubUsername"] = o.GithubUsername + } + if !IsNil(o.WebsiteUrl) { + toSerialize["websiteUrl"] = o.WebsiteUrl + } + if !IsNil(o.TwitterUsername) { + toSerialize["twitterUsername"] = o.TwitterUsername + } + return toSerialize, nil +} + +type NullableProfile struct { + value *Profile + isSet bool +} + +func (v NullableProfile) Get() *Profile { + return v.value +} + +func (v *NullableProfile) Set(val *Profile) { + v.value = val + v.isSet = true +} + +func (v NullableProfile) IsSet() bool { + return v.isSet +} + +func (v *NullableProfile) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableProfile(val *Profile) *NullableProfile { + return &NullableProfile{value: val, isSet: true} +} + +func (v NullableProfile) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableProfile) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_prolong_request_lock_response.go b/model_prolong_request_lock_response.go new file mode 100644 index 0000000..d885b3b --- /dev/null +++ b/model_prolong_request_lock_response.go @@ -0,0 +1,158 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" + "bytes" + "fmt" +) + +// checks if the ProlongRequestLockResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ProlongRequestLockResponse{} + +// ProlongRequestLockResponse Response containing updated lock information after prolonging a request lock. +type ProlongRequestLockResponse struct { + Data RequestLockInfo `json:"data"` +} + +type _ProlongRequestLockResponse ProlongRequestLockResponse + +// NewProlongRequestLockResponse instantiates a new ProlongRequestLockResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewProlongRequestLockResponse(data RequestLockInfo) *ProlongRequestLockResponse { + this := ProlongRequestLockResponse{} + this.Data = data + return &this +} + +// NewProlongRequestLockResponseWithDefaults instantiates a new ProlongRequestLockResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewProlongRequestLockResponseWithDefaults() *ProlongRequestLockResponse { + this := ProlongRequestLockResponse{} + return &this +} + +// GetData returns the Data field value +func (o *ProlongRequestLockResponse) GetData() RequestLockInfo { + if o == nil { + var ret RequestLockInfo + return ret + } + + return o.Data +} + +// GetDataOk returns a tuple with the Data field value +// and a boolean to check if the value has been set. +func (o *ProlongRequestLockResponse) GetDataOk() (*RequestLockInfo, bool) { + if o == nil { + return nil, false + } + return &o.Data, true +} + +// SetData sets field value +func (o *ProlongRequestLockResponse) SetData(v RequestLockInfo) { + o.Data = v +} + +func (o ProlongRequestLockResponse) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ProlongRequestLockResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["data"] = o.Data + return toSerialize, nil +} + +func (o *ProlongRequestLockResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "data", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varProlongRequestLockResponse := _ProlongRequestLockResponse{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varProlongRequestLockResponse) + + if err != nil { + return err + } + + *o = ProlongRequestLockResponse(varProlongRequestLockResponse) + + return err +} + +type NullableProlongRequestLockResponse struct { + value *ProlongRequestLockResponse + isSet bool +} + +func (v NullableProlongRequestLockResponse) Get() *ProlongRequestLockResponse { + return v.value +} + +func (v *NullableProlongRequestLockResponse) Set(val *ProlongRequestLockResponse) { + v.value = val + v.isSet = true +} + +func (v NullableProlongRequestLockResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableProlongRequestLockResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableProlongRequestLockResponse(val *ProlongRequestLockResponse) *NullableProlongRequestLockResponse { + return &NullableProlongRequestLockResponse{value: val, isSet: true} +} + +func (v NullableProlongRequestLockResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableProlongRequestLockResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_proxy.go b/model_proxy.go new file mode 100644 index 0000000..8e4390f --- /dev/null +++ b/model_proxy.go @@ -0,0 +1,186 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" + "bytes" + "fmt" +) + +// checks if the Proxy type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Proxy{} + +// Proxy struct for Proxy +type Proxy struct { + Password string `json:"password"` + Groups []ProxyGroup `json:"groups"` +} + +type _Proxy Proxy + +// NewProxy instantiates a new Proxy object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewProxy(password string, groups []ProxyGroup) *Proxy { + this := Proxy{} + this.Password = password + this.Groups = groups + return &this +} + +// NewProxyWithDefaults instantiates a new Proxy object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewProxyWithDefaults() *Proxy { + this := Proxy{} + return &this +} + +// GetPassword returns the Password field value +func (o *Proxy) GetPassword() string { + if o == nil { + var ret string + return ret + } + + return o.Password +} + +// GetPasswordOk returns a tuple with the Password field value +// and a boolean to check if the value has been set. +func (o *Proxy) GetPasswordOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Password, true +} + +// SetPassword sets field value +func (o *Proxy) SetPassword(v string) { + o.Password = v +} + +// GetGroups returns the Groups field value +func (o *Proxy) GetGroups() []ProxyGroup { + if o == nil { + var ret []ProxyGroup + return ret + } + + return o.Groups +} + +// GetGroupsOk returns a tuple with the Groups field value +// and a boolean to check if the value has been set. +func (o *Proxy) GetGroupsOk() ([]ProxyGroup, bool) { + if o == nil { + return nil, false + } + return o.Groups, true +} + +// SetGroups sets field value +func (o *Proxy) SetGroups(v []ProxyGroup) { + o.Groups = v +} + +func (o Proxy) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Proxy) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["password"] = o.Password + toSerialize["groups"] = o.Groups + return toSerialize, nil +} + +func (o *Proxy) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "password", + "groups", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varProxy := _Proxy{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varProxy) + + if err != nil { + return err + } + + *o = Proxy(varProxy) + + return err +} + +type NullableProxy struct { + value *Proxy + isSet bool +} + +func (v NullableProxy) Get() *Proxy { + return v.value +} + +func (v *NullableProxy) Set(val *Proxy) { + v.value = val + v.isSet = true +} + +func (v NullableProxy) IsSet() bool { + return v.isSet +} + +func (v *NullableProxy) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableProxy(val *Proxy) *NullableProxy { + return &NullableProxy{value: val, isSet: true} +} + +func (v NullableProxy) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableProxy) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_proxy_group.go b/model_proxy_group.go new file mode 100644 index 0000000..fc6880a --- /dev/null +++ b/model_proxy_group.go @@ -0,0 +1,216 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" + "bytes" + "fmt" +) + +// checks if the ProxyGroup type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ProxyGroup{} + +// ProxyGroup struct for ProxyGroup +type ProxyGroup struct { + Name string `json:"name"` + Description NullableString `json:"description"` + AvailableCount int32 `json:"availableCount"` +} + +type _ProxyGroup ProxyGroup + +// NewProxyGroup instantiates a new ProxyGroup object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewProxyGroup(name string, description NullableString, availableCount int32) *ProxyGroup { + this := ProxyGroup{} + this.Name = name + this.Description = description + this.AvailableCount = availableCount + return &this +} + +// NewProxyGroupWithDefaults instantiates a new ProxyGroup object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewProxyGroupWithDefaults() *ProxyGroup { + this := ProxyGroup{} + return &this +} + +// GetName returns the Name field value +func (o *ProxyGroup) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *ProxyGroup) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *ProxyGroup) SetName(v string) { + o.Name = v +} + +// GetDescription returns the Description field value +// If the value is explicit nil, the zero value for string will be returned +func (o *ProxyGroup) GetDescription() string { + if o == nil || o.Description.Get() == nil { + var ret string + return ret + } + + return *o.Description.Get() +} + +// GetDescriptionOk returns a tuple with the Description field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ProxyGroup) GetDescriptionOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Description.Get(), o.Description.IsSet() +} + +// SetDescription sets field value +func (o *ProxyGroup) SetDescription(v string) { + o.Description.Set(&v) +} + +// GetAvailableCount returns the AvailableCount field value +func (o *ProxyGroup) GetAvailableCount() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.AvailableCount +} + +// GetAvailableCountOk returns a tuple with the AvailableCount field value +// and a boolean to check if the value has been set. +func (o *ProxyGroup) GetAvailableCountOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.AvailableCount, true +} + +// SetAvailableCount sets field value +func (o *ProxyGroup) SetAvailableCount(v int32) { + o.AvailableCount = v +} + +func (o ProxyGroup) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ProxyGroup) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + toSerialize["description"] = o.Description.Get() + toSerialize["availableCount"] = o.AvailableCount + return toSerialize, nil +} + +func (o *ProxyGroup) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "description", + "availableCount", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varProxyGroup := _ProxyGroup{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varProxyGroup) + + if err != nil { + return err + } + + *o = ProxyGroup(varProxyGroup) + + return err +} + +type NullableProxyGroup struct { + value *ProxyGroup + isSet bool +} + +func (v NullableProxyGroup) Get() *ProxyGroup { + return v.value +} + +func (v *NullableProxyGroup) Set(val *ProxyGroup) { + v.value = val + v.isSet = true +} + +func (v NullableProxyGroup) IsSet() bool { + return v.isSet +} + +func (v *NullableProxyGroup) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableProxyGroup(val *ProxyGroup) *NullableProxyGroup { + return &NullableProxyGroup{value: val, isSet: true} +} + +func (v NullableProxyGroup) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableProxyGroup) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_public_user_data_response.go b/model_public_user_data_response.go new file mode 100644 index 0000000..b463437 --- /dev/null +++ b/model_public_user_data_response.go @@ -0,0 +1,158 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" + "bytes" + "fmt" +) + +// checks if the PublicUserDataResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PublicUserDataResponse{} + +// PublicUserDataResponse struct for PublicUserDataResponse +type PublicUserDataResponse struct { + Data UserPublicInfo `json:"data"` +} + +type _PublicUserDataResponse PublicUserDataResponse + +// NewPublicUserDataResponse instantiates a new PublicUserDataResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPublicUserDataResponse(data UserPublicInfo) *PublicUserDataResponse { + this := PublicUserDataResponse{} + this.Data = data + return &this +} + +// NewPublicUserDataResponseWithDefaults instantiates a new PublicUserDataResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPublicUserDataResponseWithDefaults() *PublicUserDataResponse { + this := PublicUserDataResponse{} + return &this +} + +// GetData returns the Data field value +func (o *PublicUserDataResponse) GetData() UserPublicInfo { + if o == nil { + var ret UserPublicInfo + return ret + } + + return o.Data +} + +// GetDataOk returns a tuple with the Data field value +// and a boolean to check if the value has been set. +func (o *PublicUserDataResponse) GetDataOk() (*UserPublicInfo, bool) { + if o == nil { + return nil, false + } + return &o.Data, true +} + +// SetData sets field value +func (o *PublicUserDataResponse) SetData(v UserPublicInfo) { + o.Data = v +} + +func (o PublicUserDataResponse) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PublicUserDataResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["data"] = o.Data + return toSerialize, nil +} + +func (o *PublicUserDataResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "data", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPublicUserDataResponse := _PublicUserDataResponse{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varPublicUserDataResponse) + + if err != nil { + return err + } + + *o = PublicUserDataResponse(varPublicUserDataResponse) + + return err +} + +type NullablePublicUserDataResponse struct { + value *PublicUserDataResponse + isSet bool +} + +func (v NullablePublicUserDataResponse) Get() *PublicUserDataResponse { + return v.value +} + +func (v *NullablePublicUserDataResponse) Set(val *PublicUserDataResponse) { + v.value = val + v.isSet = true +} + +func (v NullablePublicUserDataResponse) IsSet() bool { + return v.isSet +} + +func (v *NullablePublicUserDataResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePublicUserDataResponse(val *PublicUserDataResponse) *NullablePublicUserDataResponse { + return &NullablePublicUserDataResponse{value: val, isSet: true} +} + +func (v NullablePublicUserDataResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePublicUserDataResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_put_item_response_error.go b/model_put_item_response_error.go new file mode 100644 index 0000000..4fc6976 --- /dev/null +++ b/model_put_item_response_error.go @@ -0,0 +1,158 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" + "bytes" + "fmt" +) + +// checks if the PutItemResponseError type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PutItemResponseError{} + +// PutItemResponseError struct for PutItemResponseError +type PutItemResponseError struct { + Error DatasetSchemaValidationError `json:"error"` +} + +type _PutItemResponseError PutItemResponseError + +// NewPutItemResponseError instantiates a new PutItemResponseError object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPutItemResponseError(error_ DatasetSchemaValidationError) *PutItemResponseError { + this := PutItemResponseError{} + this.Error = error_ + return &this +} + +// NewPutItemResponseErrorWithDefaults instantiates a new PutItemResponseError object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPutItemResponseErrorWithDefaults() *PutItemResponseError { + this := PutItemResponseError{} + return &this +} + +// GetError returns the Error field value +func (o *PutItemResponseError) GetError() DatasetSchemaValidationError { + if o == nil { + var ret DatasetSchemaValidationError + return ret + } + + return o.Error +} + +// GetErrorOk returns a tuple with the Error field value +// and a boolean to check if the value has been set. +func (o *PutItemResponseError) GetErrorOk() (*DatasetSchemaValidationError, bool) { + if o == nil { + return nil, false + } + return &o.Error, true +} + +// SetError sets field value +func (o *PutItemResponseError) SetError(v DatasetSchemaValidationError) { + o.Error = v +} + +func (o PutItemResponseError) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PutItemResponseError) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["error"] = o.Error + return toSerialize, nil +} + +func (o *PutItemResponseError) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "error", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPutItemResponseError := _PutItemResponseError{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varPutItemResponseError) + + if err != nil { + return err + } + + *o = PutItemResponseError(varPutItemResponseError) + + return err +} + +type NullablePutItemResponseError struct { + value *PutItemResponseError + isSet bool +} + +func (v NullablePutItemResponseError) Get() *PutItemResponseError { + return v.value +} + +func (v *NullablePutItemResponseError) Set(val *PutItemResponseError) { + v.value = val + v.isSet = true +} + +func (v NullablePutItemResponseError) IsSet() bool { + return v.isSet +} + +func (v *NullablePutItemResponseError) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePutItemResponseError(val *PutItemResponseError) *NullablePutItemResponseError { + return &NullablePutItemResponseError{value: val, isSet: true} +} + +func (v NullablePutItemResponseError) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePutItemResponseError) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_request.go b/model_request.go new file mode 100644 index 0000000..d2027b0 --- /dev/null +++ b/model_request.go @@ -0,0 +1,543 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" + "time" +) + +// checks if the Request type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Request{} + +// Request A request stored in the request queue, including its metadata and processing state. +type Request struct { + // A unique key used for request de-duplication. Requests with the same unique key are considered identical. + UniqueKey *string `json:"uniqueKey,omitempty"` + // The URL of the request. + Url *string `json:"url,omitempty"` + Method *HttpMethod `json:"method,omitempty"` + // The number of times this request has been retried. + RetryCount *int32 `json:"retryCount,omitempty"` + // The final URL that was loaded, after redirects (if any). + LoadedUrl *string `json:"loadedUrl,omitempty"` + Payload NullableRequestBasePayload `json:"payload,omitempty"` + // HTTP headers sent with the request. + Headers map[string]interface{} `json:"headers,omitempty"` + // Custom user data attached to the request. Can contain arbitrary fields. + UserData map[string]interface{} `json:"userData,omitempty"` + // Indicates whether the request should not be retried if processing fails. + NoRetry *bool `json:"noRetry,omitempty"` + // Error messages recorded from failed processing attempts. + ErrorMessages []string `json:"errorMessages,omitempty"` + // The timestamp when the request was marked as handled, if applicable. + HandledAt *time.Time `json:"handledAt,omitempty"` + // A unique identifier assigned to the request. + Id *string `json:"id,omitempty"` +} + +// NewRequest instantiates a new Request object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewRequest() *Request { + this := Request{} + return &this +} + +// NewRequestWithDefaults instantiates a new Request object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRequestWithDefaults() *Request { + this := Request{} + return &this +} + +// GetUniqueKey returns the UniqueKey field value if set, zero value otherwise. +func (o *Request) GetUniqueKey() string { + if o == nil || IsNil(o.UniqueKey) { + var ret string + return ret + } + return *o.UniqueKey +} + +// GetUniqueKeyOk returns a tuple with the UniqueKey field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Request) GetUniqueKeyOk() (*string, bool) { + if o == nil || IsNil(o.UniqueKey) { + return nil, false + } + return o.UniqueKey, true +} + +// HasUniqueKey returns a boolean if a field has been set. +func (o *Request) HasUniqueKey() bool { + if o != nil && !IsNil(o.UniqueKey) { + return true + } + + return false +} + +// SetUniqueKey gets a reference to the given string and assigns it to the UniqueKey field. +func (o *Request) SetUniqueKey(v string) { + o.UniqueKey = &v +} + +// GetUrl returns the Url field value if set, zero value otherwise. +func (o *Request) GetUrl() string { + if o == nil || IsNil(o.Url) { + var ret string + return ret + } + return *o.Url +} + +// GetUrlOk returns a tuple with the Url field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Request) GetUrlOk() (*string, bool) { + if o == nil || IsNil(o.Url) { + return nil, false + } + return o.Url, true +} + +// HasUrl returns a boolean if a field has been set. +func (o *Request) HasUrl() bool { + if o != nil && !IsNil(o.Url) { + return true + } + + return false +} + +// SetUrl gets a reference to the given string and assigns it to the Url field. +func (o *Request) SetUrl(v string) { + o.Url = &v +} + +// GetMethod returns the Method field value if set, zero value otherwise. +func (o *Request) GetMethod() HttpMethod { + if o == nil || IsNil(o.Method) { + var ret HttpMethod + return ret + } + return *o.Method +} + +// GetMethodOk returns a tuple with the Method field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Request) GetMethodOk() (*HttpMethod, bool) { + if o == nil || IsNil(o.Method) { + return nil, false + } + return o.Method, true +} + +// HasMethod returns a boolean if a field has been set. +func (o *Request) HasMethod() bool { + if o != nil && !IsNil(o.Method) { + return true + } + + return false +} + +// SetMethod gets a reference to the given HttpMethod and assigns it to the Method field. +func (o *Request) SetMethod(v HttpMethod) { + o.Method = &v +} + +// GetRetryCount returns the RetryCount field value if set, zero value otherwise. +func (o *Request) GetRetryCount() int32 { + if o == nil || IsNil(o.RetryCount) { + var ret int32 + return ret + } + return *o.RetryCount +} + +// GetRetryCountOk returns a tuple with the RetryCount field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Request) GetRetryCountOk() (*int32, bool) { + if o == nil || IsNil(o.RetryCount) { + return nil, false + } + return o.RetryCount, true +} + +// HasRetryCount returns a boolean if a field has been set. +func (o *Request) HasRetryCount() bool { + if o != nil && !IsNil(o.RetryCount) { + return true + } + + return false +} + +// SetRetryCount gets a reference to the given int32 and assigns it to the RetryCount field. +func (o *Request) SetRetryCount(v int32) { + o.RetryCount = &v +} + +// GetLoadedUrl returns the LoadedUrl field value if set, zero value otherwise. +func (o *Request) GetLoadedUrl() string { + if o == nil || IsNil(o.LoadedUrl) { + var ret string + return ret + } + return *o.LoadedUrl +} + +// GetLoadedUrlOk returns a tuple with the LoadedUrl field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Request) GetLoadedUrlOk() (*string, bool) { + if o == nil || IsNil(o.LoadedUrl) { + return nil, false + } + return o.LoadedUrl, true +} + +// HasLoadedUrl returns a boolean if a field has been set. +func (o *Request) HasLoadedUrl() bool { + if o != nil && !IsNil(o.LoadedUrl) { + return true + } + + return false +} + +// SetLoadedUrl gets a reference to the given string and assigns it to the LoadedUrl field. +func (o *Request) SetLoadedUrl(v string) { + o.LoadedUrl = &v +} + +// GetPayload returns the Payload field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Request) GetPayload() RequestBasePayload { + if o == nil || IsNil(o.Payload.Get()) { + var ret RequestBasePayload + return ret + } + return *o.Payload.Get() +} + +// GetPayloadOk returns a tuple with the Payload field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Request) GetPayloadOk() (*RequestBasePayload, bool) { + if o == nil { + return nil, false + } + return o.Payload.Get(), o.Payload.IsSet() +} + +// HasPayload returns a boolean if a field has been set. +func (o *Request) HasPayload() bool { + if o != nil && o.Payload.IsSet() { + return true + } + + return false +} + +// SetPayload gets a reference to the given NullableRequestBasePayload and assigns it to the Payload field. +func (o *Request) SetPayload(v RequestBasePayload) { + o.Payload.Set(&v) +} +// SetPayloadNil sets the value for Payload to be an explicit nil +func (o *Request) SetPayloadNil() { + o.Payload.Set(nil) +} + +// UnsetPayload ensures that no value is present for Payload, not even an explicit nil +func (o *Request) UnsetPayload() { + o.Payload.Unset() +} + +// GetHeaders returns the Headers field value if set, zero value otherwise. +func (o *Request) GetHeaders() map[string]interface{} { + if o == nil || IsNil(o.Headers) { + var ret map[string]interface{} + return ret + } + return o.Headers +} + +// GetHeadersOk returns a tuple with the Headers field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Request) GetHeadersOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Headers) { + return map[string]interface{}{}, false + } + return o.Headers, true +} + +// HasHeaders returns a boolean if a field has been set. +func (o *Request) HasHeaders() bool { + if o != nil && !IsNil(o.Headers) { + return true + } + + return false +} + +// SetHeaders gets a reference to the given map[string]interface{} and assigns it to the Headers field. +func (o *Request) SetHeaders(v map[string]interface{}) { + o.Headers = v +} + +// GetUserData returns the UserData field value if set, zero value otherwise. +func (o *Request) GetUserData() map[string]interface{} { + if o == nil || IsNil(o.UserData) { + var ret map[string]interface{} + return ret + } + return o.UserData +} + +// GetUserDataOk returns a tuple with the UserData field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Request) GetUserDataOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.UserData) { + return map[string]interface{}{}, false + } + return o.UserData, true +} + +// HasUserData returns a boolean if a field has been set. +func (o *Request) HasUserData() bool { + if o != nil && !IsNil(o.UserData) { + return true + } + + return false +} + +// SetUserData gets a reference to the given map[string]interface{} and assigns it to the UserData field. +func (o *Request) SetUserData(v map[string]interface{}) { + o.UserData = v +} + +// GetNoRetry returns the NoRetry field value if set, zero value otherwise. +func (o *Request) GetNoRetry() bool { + if o == nil || IsNil(o.NoRetry) { + var ret bool + return ret + } + return *o.NoRetry +} + +// GetNoRetryOk returns a tuple with the NoRetry field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Request) GetNoRetryOk() (*bool, bool) { + if o == nil || IsNil(o.NoRetry) { + return nil, false + } + return o.NoRetry, true +} + +// HasNoRetry returns a boolean if a field has been set. +func (o *Request) HasNoRetry() bool { + if o != nil && !IsNil(o.NoRetry) { + return true + } + + return false +} + +// SetNoRetry gets a reference to the given bool and assigns it to the NoRetry field. +func (o *Request) SetNoRetry(v bool) { + o.NoRetry = &v +} + +// GetErrorMessages returns the ErrorMessages field value if set, zero value otherwise. +func (o *Request) GetErrorMessages() []string { + if o == nil || IsNil(o.ErrorMessages) { + var ret []string + return ret + } + return o.ErrorMessages +} + +// GetErrorMessagesOk returns a tuple with the ErrorMessages field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Request) GetErrorMessagesOk() ([]string, bool) { + if o == nil || IsNil(o.ErrorMessages) { + return nil, false + } + return o.ErrorMessages, true +} + +// HasErrorMessages returns a boolean if a field has been set. +func (o *Request) HasErrorMessages() bool { + if o != nil && !IsNil(o.ErrorMessages) { + return true + } + + return false +} + +// SetErrorMessages gets a reference to the given []string and assigns it to the ErrorMessages field. +func (o *Request) SetErrorMessages(v []string) { + o.ErrorMessages = v +} + +// GetHandledAt returns the HandledAt field value if set, zero value otherwise. +func (o *Request) GetHandledAt() time.Time { + if o == nil || IsNil(o.HandledAt) { + var ret time.Time + return ret + } + return *o.HandledAt +} + +// GetHandledAtOk returns a tuple with the HandledAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Request) GetHandledAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.HandledAt) { + return nil, false + } + return o.HandledAt, true +} + +// HasHandledAt returns a boolean if a field has been set. +func (o *Request) HasHandledAt() bool { + if o != nil && !IsNil(o.HandledAt) { + return true + } + + return false +} + +// SetHandledAt gets a reference to the given time.Time and assigns it to the HandledAt field. +func (o *Request) SetHandledAt(v time.Time) { + o.HandledAt = &v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *Request) GetId() string { + if o == nil || IsNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Request) GetIdOk() (*string, bool) { + if o == nil || IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *Request) HasId() bool { + if o != nil && !IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *Request) SetId(v string) { + o.Id = &v +} + +func (o Request) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Request) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.UniqueKey) { + toSerialize["uniqueKey"] = o.UniqueKey + } + if !IsNil(o.Url) { + toSerialize["url"] = o.Url + } + if !IsNil(o.Method) { + toSerialize["method"] = o.Method + } + if !IsNil(o.RetryCount) { + toSerialize["retryCount"] = o.RetryCount + } + if !IsNil(o.LoadedUrl) { + toSerialize["loadedUrl"] = o.LoadedUrl + } + if o.Payload.IsSet() { + toSerialize["payload"] = o.Payload.Get() + } + if !IsNil(o.Headers) { + toSerialize["headers"] = o.Headers + } + if !IsNil(o.UserData) { + toSerialize["userData"] = o.UserData + } + if !IsNil(o.NoRetry) { + toSerialize["noRetry"] = o.NoRetry + } + if !IsNil(o.ErrorMessages) { + toSerialize["errorMessages"] = o.ErrorMessages + } + if !IsNil(o.HandledAt) { + toSerialize["handledAt"] = o.HandledAt + } + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + return toSerialize, nil +} + +type NullableRequest struct { + value *Request + isSet bool +} + +func (v NullableRequest) Get() *Request { + return v.value +} + +func (v *NullableRequest) Set(val *Request) { + v.value = val + v.isSet = true +} + +func (v NullableRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRequest(val *Request) *NullableRequest { + return &NullableRequest{value: val, isSet: true} +} + +func (v NullableRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_request_base.go b/model_request_base.go new file mode 100644 index 0000000..402f737 --- /dev/null +++ b/model_request_base.go @@ -0,0 +1,538 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" + "time" +) + +// checks if the RequestBase type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RequestBase{} + +// RequestBase struct for RequestBase +type RequestBase struct { + // A unique key used for request de-duplication. Requests with the same unique key are considered identical. + UniqueKey *string `json:"uniqueKey,omitempty"` + // The URL of the request. + Url *string `json:"url,omitempty"` + Method *HttpMethod `json:"method,omitempty"` + // The number of times this request has been retried. + RetryCount *int32 `json:"retryCount,omitempty"` + // The final URL that was loaded, after redirects (if any). + LoadedUrl NullableString `json:"loadedUrl,omitempty"` + Payload NullableRequestBasePayload `json:"payload,omitempty"` + // HTTP headers sent with the request. + Headers map[string]interface{} `json:"headers,omitempty"` + // Custom user data attached to the request. Can contain arbitrary fields. + UserData map[string]interface{} `json:"userData,omitempty"` + // Indicates whether the request should not be retried if processing fails. + NoRetry NullableBool `json:"noRetry,omitempty"` + // Error messages recorded from failed processing attempts. + ErrorMessages []string `json:"errorMessages,omitempty"` + // The timestamp when the request was marked as handled, if applicable. + HandledAt NullableTime `json:"handledAt,omitempty"` +} + +// NewRequestBase instantiates a new RequestBase object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewRequestBase() *RequestBase { + this := RequestBase{} + return &this +} + +// NewRequestBaseWithDefaults instantiates a new RequestBase object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRequestBaseWithDefaults() *RequestBase { + this := RequestBase{} + return &this +} + +// GetUniqueKey returns the UniqueKey field value if set, zero value otherwise. +func (o *RequestBase) GetUniqueKey() string { + if o == nil || IsNil(o.UniqueKey) { + var ret string + return ret + } + return *o.UniqueKey +} + +// GetUniqueKeyOk returns a tuple with the UniqueKey field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RequestBase) GetUniqueKeyOk() (*string, bool) { + if o == nil || IsNil(o.UniqueKey) { + return nil, false + } + return o.UniqueKey, true +} + +// HasUniqueKey returns a boolean if a field has been set. +func (o *RequestBase) HasUniqueKey() bool { + if o != nil && !IsNil(o.UniqueKey) { + return true + } + + return false +} + +// SetUniqueKey gets a reference to the given string and assigns it to the UniqueKey field. +func (o *RequestBase) SetUniqueKey(v string) { + o.UniqueKey = &v +} + +// GetUrl returns the Url field value if set, zero value otherwise. +func (o *RequestBase) GetUrl() string { + if o == nil || IsNil(o.Url) { + var ret string + return ret + } + return *o.Url +} + +// GetUrlOk returns a tuple with the Url field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RequestBase) GetUrlOk() (*string, bool) { + if o == nil || IsNil(o.Url) { + return nil, false + } + return o.Url, true +} + +// HasUrl returns a boolean if a field has been set. +func (o *RequestBase) HasUrl() bool { + if o != nil && !IsNil(o.Url) { + return true + } + + return false +} + +// SetUrl gets a reference to the given string and assigns it to the Url field. +func (o *RequestBase) SetUrl(v string) { + o.Url = &v +} + +// GetMethod returns the Method field value if set, zero value otherwise. +func (o *RequestBase) GetMethod() HttpMethod { + if o == nil || IsNil(o.Method) { + var ret HttpMethod + return ret + } + return *o.Method +} + +// GetMethodOk returns a tuple with the Method field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RequestBase) GetMethodOk() (*HttpMethod, bool) { + if o == nil || IsNil(o.Method) { + return nil, false + } + return o.Method, true +} + +// HasMethod returns a boolean if a field has been set. +func (o *RequestBase) HasMethod() bool { + if o != nil && !IsNil(o.Method) { + return true + } + + return false +} + +// SetMethod gets a reference to the given HttpMethod and assigns it to the Method field. +func (o *RequestBase) SetMethod(v HttpMethod) { + o.Method = &v +} + +// GetRetryCount returns the RetryCount field value if set, zero value otherwise. +func (o *RequestBase) GetRetryCount() int32 { + if o == nil || IsNil(o.RetryCount) { + var ret int32 + return ret + } + return *o.RetryCount +} + +// GetRetryCountOk returns a tuple with the RetryCount field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RequestBase) GetRetryCountOk() (*int32, bool) { + if o == nil || IsNil(o.RetryCount) { + return nil, false + } + return o.RetryCount, true +} + +// HasRetryCount returns a boolean if a field has been set. +func (o *RequestBase) HasRetryCount() bool { + if o != nil && !IsNil(o.RetryCount) { + return true + } + + return false +} + +// SetRetryCount gets a reference to the given int32 and assigns it to the RetryCount field. +func (o *RequestBase) SetRetryCount(v int32) { + o.RetryCount = &v +} + +// GetLoadedUrl returns the LoadedUrl field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *RequestBase) GetLoadedUrl() string { + if o == nil || IsNil(o.LoadedUrl.Get()) { + var ret string + return ret + } + return *o.LoadedUrl.Get() +} + +// GetLoadedUrlOk returns a tuple with the LoadedUrl field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *RequestBase) GetLoadedUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.LoadedUrl.Get(), o.LoadedUrl.IsSet() +} + +// HasLoadedUrl returns a boolean if a field has been set. +func (o *RequestBase) HasLoadedUrl() bool { + if o != nil && o.LoadedUrl.IsSet() { + return true + } + + return false +} + +// SetLoadedUrl gets a reference to the given NullableString and assigns it to the LoadedUrl field. +func (o *RequestBase) SetLoadedUrl(v string) { + o.LoadedUrl.Set(&v) +} +// SetLoadedUrlNil sets the value for LoadedUrl to be an explicit nil +func (o *RequestBase) SetLoadedUrlNil() { + o.LoadedUrl.Set(nil) +} + +// UnsetLoadedUrl ensures that no value is present for LoadedUrl, not even an explicit nil +func (o *RequestBase) UnsetLoadedUrl() { + o.LoadedUrl.Unset() +} + +// GetPayload returns the Payload field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *RequestBase) GetPayload() RequestBasePayload { + if o == nil || IsNil(o.Payload.Get()) { + var ret RequestBasePayload + return ret + } + return *o.Payload.Get() +} + +// GetPayloadOk returns a tuple with the Payload field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *RequestBase) GetPayloadOk() (*RequestBasePayload, bool) { + if o == nil { + return nil, false + } + return o.Payload.Get(), o.Payload.IsSet() +} + +// HasPayload returns a boolean if a field has been set. +func (o *RequestBase) HasPayload() bool { + if o != nil && o.Payload.IsSet() { + return true + } + + return false +} + +// SetPayload gets a reference to the given NullableRequestBasePayload and assigns it to the Payload field. +func (o *RequestBase) SetPayload(v RequestBasePayload) { + o.Payload.Set(&v) +} +// SetPayloadNil sets the value for Payload to be an explicit nil +func (o *RequestBase) SetPayloadNil() { + o.Payload.Set(nil) +} + +// UnsetPayload ensures that no value is present for Payload, not even an explicit nil +func (o *RequestBase) UnsetPayload() { + o.Payload.Unset() +} + +// GetHeaders returns the Headers field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *RequestBase) GetHeaders() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + return o.Headers +} + +// GetHeadersOk returns a tuple with the Headers field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *RequestBase) GetHeadersOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Headers) { + return map[string]interface{}{}, false + } + return o.Headers, true +} + +// HasHeaders returns a boolean if a field has been set. +func (o *RequestBase) HasHeaders() bool { + if o != nil && !IsNil(o.Headers) { + return true + } + + return false +} + +// SetHeaders gets a reference to the given map[string]interface{} and assigns it to the Headers field. +func (o *RequestBase) SetHeaders(v map[string]interface{}) { + o.Headers = v +} + +// GetUserData returns the UserData field value if set, zero value otherwise. +func (o *RequestBase) GetUserData() map[string]interface{} { + if o == nil || IsNil(o.UserData) { + var ret map[string]interface{} + return ret + } + return o.UserData +} + +// GetUserDataOk returns a tuple with the UserData field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RequestBase) GetUserDataOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.UserData) { + return map[string]interface{}{}, false + } + return o.UserData, true +} + +// HasUserData returns a boolean if a field has been set. +func (o *RequestBase) HasUserData() bool { + if o != nil && !IsNil(o.UserData) { + return true + } + + return false +} + +// SetUserData gets a reference to the given map[string]interface{} and assigns it to the UserData field. +func (o *RequestBase) SetUserData(v map[string]interface{}) { + o.UserData = v +} + +// GetNoRetry returns the NoRetry field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *RequestBase) GetNoRetry() bool { + if o == nil || IsNil(o.NoRetry.Get()) { + var ret bool + return ret + } + return *o.NoRetry.Get() +} + +// GetNoRetryOk returns a tuple with the NoRetry field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *RequestBase) GetNoRetryOk() (*bool, bool) { + if o == nil { + return nil, false + } + return o.NoRetry.Get(), o.NoRetry.IsSet() +} + +// HasNoRetry returns a boolean if a field has been set. +func (o *RequestBase) HasNoRetry() bool { + if o != nil && o.NoRetry.IsSet() { + return true + } + + return false +} + +// SetNoRetry gets a reference to the given NullableBool and assigns it to the NoRetry field. +func (o *RequestBase) SetNoRetry(v bool) { + o.NoRetry.Set(&v) +} +// SetNoRetryNil sets the value for NoRetry to be an explicit nil +func (o *RequestBase) SetNoRetryNil() { + o.NoRetry.Set(nil) +} + +// UnsetNoRetry ensures that no value is present for NoRetry, not even an explicit nil +func (o *RequestBase) UnsetNoRetry() { + o.NoRetry.Unset() +} + +// GetErrorMessages returns the ErrorMessages field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *RequestBase) GetErrorMessages() []string { + if o == nil { + var ret []string + return ret + } + return o.ErrorMessages +} + +// GetErrorMessagesOk returns a tuple with the ErrorMessages field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *RequestBase) GetErrorMessagesOk() ([]string, bool) { + if o == nil || IsNil(o.ErrorMessages) { + return nil, false + } + return o.ErrorMessages, true +} + +// HasErrorMessages returns a boolean if a field has been set. +func (o *RequestBase) HasErrorMessages() bool { + if o != nil && !IsNil(o.ErrorMessages) { + return true + } + + return false +} + +// SetErrorMessages gets a reference to the given []string and assigns it to the ErrorMessages field. +func (o *RequestBase) SetErrorMessages(v []string) { + o.ErrorMessages = v +} + +// GetHandledAt returns the HandledAt field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *RequestBase) GetHandledAt() time.Time { + if o == nil || IsNil(o.HandledAt.Get()) { + var ret time.Time + return ret + } + return *o.HandledAt.Get() +} + +// GetHandledAtOk returns a tuple with the HandledAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *RequestBase) GetHandledAtOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.HandledAt.Get(), o.HandledAt.IsSet() +} + +// HasHandledAt returns a boolean if a field has been set. +func (o *RequestBase) HasHandledAt() bool { + if o != nil && o.HandledAt.IsSet() { + return true + } + + return false +} + +// SetHandledAt gets a reference to the given NullableTime and assigns it to the HandledAt field. +func (o *RequestBase) SetHandledAt(v time.Time) { + o.HandledAt.Set(&v) +} +// SetHandledAtNil sets the value for HandledAt to be an explicit nil +func (o *RequestBase) SetHandledAtNil() { + o.HandledAt.Set(nil) +} + +// UnsetHandledAt ensures that no value is present for HandledAt, not even an explicit nil +func (o *RequestBase) UnsetHandledAt() { + o.HandledAt.Unset() +} + +func (o RequestBase) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o RequestBase) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.UniqueKey) { + toSerialize["uniqueKey"] = o.UniqueKey + } + if !IsNil(o.Url) { + toSerialize["url"] = o.Url + } + if !IsNil(o.Method) { + toSerialize["method"] = o.Method + } + if !IsNil(o.RetryCount) { + toSerialize["retryCount"] = o.RetryCount + } + if o.LoadedUrl.IsSet() { + toSerialize["loadedUrl"] = o.LoadedUrl.Get() + } + if o.Payload.IsSet() { + toSerialize["payload"] = o.Payload.Get() + } + if o.Headers != nil { + toSerialize["headers"] = o.Headers + } + if !IsNil(o.UserData) { + toSerialize["userData"] = o.UserData + } + if o.NoRetry.IsSet() { + toSerialize["noRetry"] = o.NoRetry.Get() + } + if o.ErrorMessages != nil { + toSerialize["errorMessages"] = o.ErrorMessages + } + if o.HandledAt.IsSet() { + toSerialize["handledAt"] = o.HandledAt.Get() + } + return toSerialize, nil +} + +type NullableRequestBase struct { + value *RequestBase + isSet bool +} + +func (v NullableRequestBase) Get() *RequestBase { + return v.value +} + +func (v *NullableRequestBase) Set(val *RequestBase) { + v.value = val + v.isSet = true +} + +func (v NullableRequestBase) IsSet() bool { + return v.isSet +} + +func (v *NullableRequestBase) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRequestBase(val *RequestBase) *NullableRequestBase { + return &NullableRequestBase{value: val, isSet: true} +} + +func (v NullableRequestBase) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRequestBase) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_request_base_payload.go b/model_request_base_payload.go new file mode 100644 index 0000000..b084d1f --- /dev/null +++ b/model_request_base_payload.go @@ -0,0 +1,94 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" + "fmt" +) + + +// RequestBasePayload The request payload, typically used with POST or PUT requests. +type RequestBasePayload struct { + String *string +} + +// Unmarshal JSON data into any of the pointers in the struct +func (dst *RequestBasePayload) UnmarshalJSON(data []byte) error { + var err error + // this object is nullable so check if the payload is null or empty string + if string(data) == "" || string(data) == "{}" { + return nil + } + + // try to unmarshal JSON data into String + err = json.Unmarshal(data, &dst.String); + if err == nil { + jsonString, _ := json.Marshal(dst.String) + if string(jsonString) == "{}" { // empty struct + dst.String = nil + } else { + return nil // data stored in dst.String, return on the first match + } + } else { + dst.String = nil + } + + return fmt.Errorf("data failed to match schemas in anyOf(RequestBasePayload)") +} + +// Marshal data from the first non-nil pointers in the struct to JSON +func (src RequestBasePayload) MarshalJSON() ([]byte, error) { + if src.String != nil { + return json.Marshal(&src.String) + } + + return nil, nil // no data in anyOf schemas +} + + +type NullableRequestBasePayload struct { + value *RequestBasePayload + isSet bool +} + +func (v NullableRequestBasePayload) Get() *RequestBasePayload { + return v.value +} + +func (v *NullableRequestBasePayload) Set(val *RequestBasePayload) { + v.value = val + v.isSet = true +} + +func (v NullableRequestBasePayload) IsSet() bool { + return v.isSet +} + +func (v *NullableRequestBasePayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRequestBasePayload(val *RequestBasePayload) *NullableRequestBasePayload { + return &NullableRequestBasePayload{value: val, isSet: true} +} + +func (v NullableRequestBasePayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRequestBasePayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_request_draft.go b/model_request_draft.go new file mode 100644 index 0000000..f1f05f0 --- /dev/null +++ b/model_request_draft.go @@ -0,0 +1,261 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" + "bytes" + "fmt" +) + +// checks if the RequestDraft type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RequestDraft{} + +// RequestDraft A request that failed to be processed during a request queue operation and can be retried. +type RequestDraft struct { + // A unique identifier assigned to the request. + Id *string `json:"id,omitempty"` + // A unique key used for request de-duplication. Requests with the same unique key are considered identical. + UniqueKey string `json:"uniqueKey"` + // The URL of the request. + Url string `json:"url"` + Method *HttpMethod `json:"method,omitempty"` +} + +type _RequestDraft RequestDraft + +// NewRequestDraft instantiates a new RequestDraft object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewRequestDraft(uniqueKey string, url string) *RequestDraft { + this := RequestDraft{} + this.UniqueKey = uniqueKey + this.Url = url + return &this +} + +// NewRequestDraftWithDefaults instantiates a new RequestDraft object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRequestDraftWithDefaults() *RequestDraft { + this := RequestDraft{} + return &this +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *RequestDraft) GetId() string { + if o == nil || IsNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RequestDraft) GetIdOk() (*string, bool) { + if o == nil || IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *RequestDraft) HasId() bool { + if o != nil && !IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *RequestDraft) SetId(v string) { + o.Id = &v +} + +// GetUniqueKey returns the UniqueKey field value +func (o *RequestDraft) GetUniqueKey() string { + if o == nil { + var ret string + return ret + } + + return o.UniqueKey +} + +// GetUniqueKeyOk returns a tuple with the UniqueKey field value +// and a boolean to check if the value has been set. +func (o *RequestDraft) GetUniqueKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.UniqueKey, true +} + +// SetUniqueKey sets field value +func (o *RequestDraft) SetUniqueKey(v string) { + o.UniqueKey = v +} + +// GetUrl returns the Url field value +func (o *RequestDraft) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *RequestDraft) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *RequestDraft) SetUrl(v string) { + o.Url = v +} + +// GetMethod returns the Method field value if set, zero value otherwise. +func (o *RequestDraft) GetMethod() HttpMethod { + if o == nil || IsNil(o.Method) { + var ret HttpMethod + return ret + } + return *o.Method +} + +// GetMethodOk returns a tuple with the Method field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RequestDraft) GetMethodOk() (*HttpMethod, bool) { + if o == nil || IsNil(o.Method) { + return nil, false + } + return o.Method, true +} + +// HasMethod returns a boolean if a field has been set. +func (o *RequestDraft) HasMethod() bool { + if o != nil && !IsNil(o.Method) { + return true + } + + return false +} + +// SetMethod gets a reference to the given HttpMethod and assigns it to the Method field. +func (o *RequestDraft) SetMethod(v HttpMethod) { + o.Method = &v +} + +func (o RequestDraft) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o RequestDraft) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + toSerialize["uniqueKey"] = o.UniqueKey + toSerialize["url"] = o.Url + if !IsNil(o.Method) { + toSerialize["method"] = o.Method + } + return toSerialize, nil +} + +func (o *RequestDraft) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "uniqueKey", + "url", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varRequestDraft := _RequestDraft{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varRequestDraft) + + if err != nil { + return err + } + + *o = RequestDraft(varRequestDraft) + + return err +} + +type NullableRequestDraft struct { + value *RequestDraft + isSet bool +} + +func (v NullableRequestDraft) Get() *RequestDraft { + return v.value +} + +func (v *NullableRequestDraft) Set(val *RequestDraft) { + v.value = val + v.isSet = true +} + +func (v NullableRequestDraft) IsSet() bool { + return v.isSet +} + +func (v *NullableRequestDraft) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRequestDraft(val *RequestDraft) *NullableRequestDraft { + return &NullableRequestDraft{value: val, isSet: true} +} + +func (v NullableRequestDraft) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRequestDraft) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_request_draft_delete.go b/model_request_draft_delete.go new file mode 100644 index 0000000..8b41833 --- /dev/null +++ b/model_request_draft_delete.go @@ -0,0 +1,107 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" + "fmt" +) + + +// RequestDraftDelete A request that should be deleted. +type RequestDraftDelete struct { + RequestDraftDeleteById *RequestDraftDeleteById + RequestDraftDeleteByUniqueKey *RequestDraftDeleteByUniqueKey +} + +// Unmarshal JSON data into any of the pointers in the struct +func (dst *RequestDraftDelete) UnmarshalJSON(data []byte) error { + var err error + // try to unmarshal JSON data into RequestDraftDeleteById + err = json.Unmarshal(data, &dst.RequestDraftDeleteById); + if err == nil { + jsonRequestDraftDeleteById, _ := json.Marshal(dst.RequestDraftDeleteById) + if string(jsonRequestDraftDeleteById) == "{}" { // empty struct + dst.RequestDraftDeleteById = nil + } else { + return nil // data stored in dst.RequestDraftDeleteById, return on the first match + } + } else { + dst.RequestDraftDeleteById = nil + } + + // try to unmarshal JSON data into RequestDraftDeleteByUniqueKey + err = json.Unmarshal(data, &dst.RequestDraftDeleteByUniqueKey); + if err == nil { + jsonRequestDraftDeleteByUniqueKey, _ := json.Marshal(dst.RequestDraftDeleteByUniqueKey) + if string(jsonRequestDraftDeleteByUniqueKey) == "{}" { // empty struct + dst.RequestDraftDeleteByUniqueKey = nil + } else { + return nil // data stored in dst.RequestDraftDeleteByUniqueKey, return on the first match + } + } else { + dst.RequestDraftDeleteByUniqueKey = nil + } + + return fmt.Errorf("data failed to match schemas in anyOf(RequestDraftDelete)") +} + +// Marshal data from the first non-nil pointers in the struct to JSON +func (src RequestDraftDelete) MarshalJSON() ([]byte, error) { + if src.RequestDraftDeleteById != nil { + return json.Marshal(&src.RequestDraftDeleteById) + } + + if src.RequestDraftDeleteByUniqueKey != nil { + return json.Marshal(&src.RequestDraftDeleteByUniqueKey) + } + + return nil, nil // no data in anyOf schemas +} + + +type NullableRequestDraftDelete struct { + value *RequestDraftDelete + isSet bool +} + +func (v NullableRequestDraftDelete) Get() *RequestDraftDelete { + return v.value +} + +func (v *NullableRequestDraftDelete) Set(val *RequestDraftDelete) { + v.value = val + v.isSet = true +} + +func (v NullableRequestDraftDelete) IsSet() bool { + return v.isSet +} + +func (v *NullableRequestDraftDelete) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRequestDraftDelete(val *RequestDraftDelete) *NullableRequestDraftDelete { + return &NullableRequestDraftDelete{value: val, isSet: true} +} + +func (v NullableRequestDraftDelete) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRequestDraftDelete) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_request_draft_delete_by_id.go b/model_request_draft_delete_by_id.go new file mode 100644 index 0000000..0a68e56 --- /dev/null +++ b/model_request_draft_delete_by_id.go @@ -0,0 +1,196 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" + "bytes" + "fmt" +) + +// checks if the RequestDraftDeleteById type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RequestDraftDeleteById{} + +// RequestDraftDeleteById A request that should be deleted, identified by its ID. +type RequestDraftDeleteById struct { + // A unique identifier assigned to the request. + Id string `json:"id"` + // A unique key used for request de-duplication. Requests with the same unique key are considered identical. + UniqueKey *string `json:"uniqueKey,omitempty"` +} + +type _RequestDraftDeleteById RequestDraftDeleteById + +// NewRequestDraftDeleteById instantiates a new RequestDraftDeleteById object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewRequestDraftDeleteById(id string) *RequestDraftDeleteById { + this := RequestDraftDeleteById{} + this.Id = id + return &this +} + +// NewRequestDraftDeleteByIdWithDefaults instantiates a new RequestDraftDeleteById object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRequestDraftDeleteByIdWithDefaults() *RequestDraftDeleteById { + this := RequestDraftDeleteById{} + return &this +} + +// GetId returns the Id field value +func (o *RequestDraftDeleteById) GetId() string { + if o == nil { + var ret string + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *RequestDraftDeleteById) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *RequestDraftDeleteById) SetId(v string) { + o.Id = v +} + +// GetUniqueKey returns the UniqueKey field value if set, zero value otherwise. +func (o *RequestDraftDeleteById) GetUniqueKey() string { + if o == nil || IsNil(o.UniqueKey) { + var ret string + return ret + } + return *o.UniqueKey +} + +// GetUniqueKeyOk returns a tuple with the UniqueKey field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RequestDraftDeleteById) GetUniqueKeyOk() (*string, bool) { + if o == nil || IsNil(o.UniqueKey) { + return nil, false + } + return o.UniqueKey, true +} + +// HasUniqueKey returns a boolean if a field has been set. +func (o *RequestDraftDeleteById) HasUniqueKey() bool { + if o != nil && !IsNil(o.UniqueKey) { + return true + } + + return false +} + +// SetUniqueKey gets a reference to the given string and assigns it to the UniqueKey field. +func (o *RequestDraftDeleteById) SetUniqueKey(v string) { + o.UniqueKey = &v +} + +func (o RequestDraftDeleteById) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o RequestDraftDeleteById) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + if !IsNil(o.UniqueKey) { + toSerialize["uniqueKey"] = o.UniqueKey + } + return toSerialize, nil +} + +func (o *RequestDraftDeleteById) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varRequestDraftDeleteById := _RequestDraftDeleteById{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varRequestDraftDeleteById) + + if err != nil { + return err + } + + *o = RequestDraftDeleteById(varRequestDraftDeleteById) + + return err +} + +type NullableRequestDraftDeleteById struct { + value *RequestDraftDeleteById + isSet bool +} + +func (v NullableRequestDraftDeleteById) Get() *RequestDraftDeleteById { + return v.value +} + +func (v *NullableRequestDraftDeleteById) Set(val *RequestDraftDeleteById) { + v.value = val + v.isSet = true +} + +func (v NullableRequestDraftDeleteById) IsSet() bool { + return v.isSet +} + +func (v *NullableRequestDraftDeleteById) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRequestDraftDeleteById(val *RequestDraftDeleteById) *NullableRequestDraftDeleteById { + return &NullableRequestDraftDeleteById{value: val, isSet: true} +} + +func (v NullableRequestDraftDeleteById) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRequestDraftDeleteById) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_request_draft_delete_by_unique_key.go b/model_request_draft_delete_by_unique_key.go new file mode 100644 index 0000000..0ab288c --- /dev/null +++ b/model_request_draft_delete_by_unique_key.go @@ -0,0 +1,196 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" + "bytes" + "fmt" +) + +// checks if the RequestDraftDeleteByUniqueKey type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RequestDraftDeleteByUniqueKey{} + +// RequestDraftDeleteByUniqueKey A request that should be deleted, identified by its unique key. +type RequestDraftDeleteByUniqueKey struct { + // A unique identifier assigned to the request. + Id *string `json:"id,omitempty"` + // A unique key used for request de-duplication. Requests with the same unique key are considered identical. + UniqueKey string `json:"uniqueKey"` +} + +type _RequestDraftDeleteByUniqueKey RequestDraftDeleteByUniqueKey + +// NewRequestDraftDeleteByUniqueKey instantiates a new RequestDraftDeleteByUniqueKey object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewRequestDraftDeleteByUniqueKey(uniqueKey string) *RequestDraftDeleteByUniqueKey { + this := RequestDraftDeleteByUniqueKey{} + this.UniqueKey = uniqueKey + return &this +} + +// NewRequestDraftDeleteByUniqueKeyWithDefaults instantiates a new RequestDraftDeleteByUniqueKey object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRequestDraftDeleteByUniqueKeyWithDefaults() *RequestDraftDeleteByUniqueKey { + this := RequestDraftDeleteByUniqueKey{} + return &this +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *RequestDraftDeleteByUniqueKey) GetId() string { + if o == nil || IsNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RequestDraftDeleteByUniqueKey) GetIdOk() (*string, bool) { + if o == nil || IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *RequestDraftDeleteByUniqueKey) HasId() bool { + if o != nil && !IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *RequestDraftDeleteByUniqueKey) SetId(v string) { + o.Id = &v +} + +// GetUniqueKey returns the UniqueKey field value +func (o *RequestDraftDeleteByUniqueKey) GetUniqueKey() string { + if o == nil { + var ret string + return ret + } + + return o.UniqueKey +} + +// GetUniqueKeyOk returns a tuple with the UniqueKey field value +// and a boolean to check if the value has been set. +func (o *RequestDraftDeleteByUniqueKey) GetUniqueKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.UniqueKey, true +} + +// SetUniqueKey sets field value +func (o *RequestDraftDeleteByUniqueKey) SetUniqueKey(v string) { + o.UniqueKey = v +} + +func (o RequestDraftDeleteByUniqueKey) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o RequestDraftDeleteByUniqueKey) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + toSerialize["uniqueKey"] = o.UniqueKey + return toSerialize, nil +} + +func (o *RequestDraftDeleteByUniqueKey) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "uniqueKey", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varRequestDraftDeleteByUniqueKey := _RequestDraftDeleteByUniqueKey{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varRequestDraftDeleteByUniqueKey) + + if err != nil { + return err + } + + *o = RequestDraftDeleteByUniqueKey(varRequestDraftDeleteByUniqueKey) + + return err +} + +type NullableRequestDraftDeleteByUniqueKey struct { + value *RequestDraftDeleteByUniqueKey + isSet bool +} + +func (v NullableRequestDraftDeleteByUniqueKey) Get() *RequestDraftDeleteByUniqueKey { + return v.value +} + +func (v *NullableRequestDraftDeleteByUniqueKey) Set(val *RequestDraftDeleteByUniqueKey) { + v.value = val + v.isSet = true +} + +func (v NullableRequestDraftDeleteByUniqueKey) IsSet() bool { + return v.isSet +} + +func (v *NullableRequestDraftDeleteByUniqueKey) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRequestDraftDeleteByUniqueKey(val *RequestDraftDeleteByUniqueKey) *NullableRequestDraftDeleteByUniqueKey { + return &NullableRequestDraftDeleteByUniqueKey{value: val, isSet: true} +} + +func (v NullableRequestDraftDeleteByUniqueKey) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRequestDraftDeleteByUniqueKey) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_request_lock_info.go b/model_request_lock_info.go new file mode 100644 index 0000000..0d7ae74 --- /dev/null +++ b/model_request_lock_info.go @@ -0,0 +1,160 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" + "time" + "bytes" + "fmt" +) + +// checks if the RequestLockInfo type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RequestLockInfo{} + +// RequestLockInfo Information about a request lock. +type RequestLockInfo struct { + // The timestamp when the lock on this request expires. + LockExpiresAt time.Time `json:"lockExpiresAt"` +} + +type _RequestLockInfo RequestLockInfo + +// NewRequestLockInfo instantiates a new RequestLockInfo object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewRequestLockInfo(lockExpiresAt time.Time) *RequestLockInfo { + this := RequestLockInfo{} + this.LockExpiresAt = lockExpiresAt + return &this +} + +// NewRequestLockInfoWithDefaults instantiates a new RequestLockInfo object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRequestLockInfoWithDefaults() *RequestLockInfo { + this := RequestLockInfo{} + return &this +} + +// GetLockExpiresAt returns the LockExpiresAt field value +func (o *RequestLockInfo) GetLockExpiresAt() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.LockExpiresAt +} + +// GetLockExpiresAtOk returns a tuple with the LockExpiresAt field value +// and a boolean to check if the value has been set. +func (o *RequestLockInfo) GetLockExpiresAtOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.LockExpiresAt, true +} + +// SetLockExpiresAt sets field value +func (o *RequestLockInfo) SetLockExpiresAt(v time.Time) { + o.LockExpiresAt = v +} + +func (o RequestLockInfo) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o RequestLockInfo) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["lockExpiresAt"] = o.LockExpiresAt + return toSerialize, nil +} + +func (o *RequestLockInfo) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "lockExpiresAt", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varRequestLockInfo := _RequestLockInfo{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varRequestLockInfo) + + if err != nil { + return err + } + + *o = RequestLockInfo(varRequestLockInfo) + + return err +} + +type NullableRequestLockInfo struct { + value *RequestLockInfo + isSet bool +} + +func (v NullableRequestLockInfo) Get() *RequestLockInfo { + return v.value +} + +func (v *NullableRequestLockInfo) Set(val *RequestLockInfo) { + v.value = val + v.isSet = true +} + +func (v NullableRequestLockInfo) IsSet() bool { + return v.isSet +} + +func (v *NullableRequestLockInfo) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRequestLockInfo(val *RequestLockInfo) *NullableRequestLockInfo { + return &NullableRequestLockInfo{value: val, isSet: true} +} + +func (v NullableRequestLockInfo) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRequestLockInfo) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_request_queue.go b/model_request_queue.go new file mode 100644 index 0000000..dda689d --- /dev/null +++ b/model_request_queue.go @@ -0,0 +1,634 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" + "time" + "bytes" + "fmt" +) + +// checks if the RequestQueue type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RequestQueue{} + +// RequestQueue A request queue object containing metadata and statistics. +type RequestQueue struct { + // A unique identifier assigned to the request queue. + Id string `json:"id"` + // The name of the request queue. + Name NullableString `json:"name,omitempty"` + // The ID of the user who owns the request queue. + UserId string `json:"userId"` + // The ID of the Actor that created this request queue. + ActId NullableString `json:"actId,omitempty"` + // The ID of the Actor run that created this request queue. + ActRunId NullableString `json:"actRunId,omitempty"` + // The timestamp when the request queue was created. + CreatedAt time.Time `json:"createdAt"` + // The timestamp when the request queue was last modified. Modifications include adding, updating, or removing requests, as well as locking or unlocking requests in the request queue. + ModifiedAt time.Time `json:"modifiedAt"` + // The timestamp when the request queue was last accessed. + AccessedAt time.Time `json:"accessedAt"` + // The total number of requests in the request queue. + TotalRequestCount int32 `json:"totalRequestCount"` + // The number of requests that have been handled. + HandledRequestCount int32 `json:"handledRequestCount"` + // The number of requests that are pending and have not been handled yet. + PendingRequestCount int32 `json:"pendingRequestCount"` + // Whether the request queue has been accessed by multiple different clients. + HadMultipleClients bool `json:"hadMultipleClients"` + // The URL to view the request queue in the Apify console. + ConsoleUrl string `json:"consoleUrl"` + Stats *RequestQueueStats `json:"stats,omitempty"` + GeneralAccess *GeneralAccess `json:"generalAccess,omitempty"` +} + +type _RequestQueue RequestQueue + +// NewRequestQueue instantiates a new RequestQueue object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewRequestQueue(id string, userId string, createdAt time.Time, modifiedAt time.Time, accessedAt time.Time, totalRequestCount int32, handledRequestCount int32, pendingRequestCount int32, hadMultipleClients bool, consoleUrl string) *RequestQueue { + this := RequestQueue{} + this.Id = id + this.UserId = userId + this.CreatedAt = createdAt + this.ModifiedAt = modifiedAt + this.AccessedAt = accessedAt + this.TotalRequestCount = totalRequestCount + this.HandledRequestCount = handledRequestCount + this.PendingRequestCount = pendingRequestCount + this.HadMultipleClients = hadMultipleClients + this.ConsoleUrl = consoleUrl + return &this +} + +// NewRequestQueueWithDefaults instantiates a new RequestQueue object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRequestQueueWithDefaults() *RequestQueue { + this := RequestQueue{} + return &this +} + +// GetId returns the Id field value +func (o *RequestQueue) GetId() string { + if o == nil { + var ret string + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *RequestQueue) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *RequestQueue) SetId(v string) { + o.Id = v +} + +// GetName returns the Name field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *RequestQueue) GetName() string { + if o == nil || IsNil(o.Name.Get()) { + var ret string + return ret + } + return *o.Name.Get() +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *RequestQueue) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Name.Get(), o.Name.IsSet() +} + +// HasName returns a boolean if a field has been set. +func (o *RequestQueue) HasName() bool { + if o != nil && o.Name.IsSet() { + return true + } + + return false +} + +// SetName gets a reference to the given NullableString and assigns it to the Name field. +func (o *RequestQueue) SetName(v string) { + o.Name.Set(&v) +} +// SetNameNil sets the value for Name to be an explicit nil +func (o *RequestQueue) SetNameNil() { + o.Name.Set(nil) +} + +// UnsetName ensures that no value is present for Name, not even an explicit nil +func (o *RequestQueue) UnsetName() { + o.Name.Unset() +} + +// GetUserId returns the UserId field value +func (o *RequestQueue) GetUserId() string { + if o == nil { + var ret string + return ret + } + + return o.UserId +} + +// GetUserIdOk returns a tuple with the UserId field value +// and a boolean to check if the value has been set. +func (o *RequestQueue) GetUserIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.UserId, true +} + +// SetUserId sets field value +func (o *RequestQueue) SetUserId(v string) { + o.UserId = v +} + +// GetActId returns the ActId field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *RequestQueue) GetActId() string { + if o == nil || IsNil(o.ActId.Get()) { + var ret string + return ret + } + return *o.ActId.Get() +} + +// GetActIdOk returns a tuple with the ActId field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *RequestQueue) GetActIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.ActId.Get(), o.ActId.IsSet() +} + +// HasActId returns a boolean if a field has been set. +func (o *RequestQueue) HasActId() bool { + if o != nil && o.ActId.IsSet() { + return true + } + + return false +} + +// SetActId gets a reference to the given NullableString and assigns it to the ActId field. +func (o *RequestQueue) SetActId(v string) { + o.ActId.Set(&v) +} +// SetActIdNil sets the value for ActId to be an explicit nil +func (o *RequestQueue) SetActIdNil() { + o.ActId.Set(nil) +} + +// UnsetActId ensures that no value is present for ActId, not even an explicit nil +func (o *RequestQueue) UnsetActId() { + o.ActId.Unset() +} + +// GetActRunId returns the ActRunId field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *RequestQueue) GetActRunId() string { + if o == nil || IsNil(o.ActRunId.Get()) { + var ret string + return ret + } + return *o.ActRunId.Get() +} + +// GetActRunIdOk returns a tuple with the ActRunId field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *RequestQueue) GetActRunIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.ActRunId.Get(), o.ActRunId.IsSet() +} + +// HasActRunId returns a boolean if a field has been set. +func (o *RequestQueue) HasActRunId() bool { + if o != nil && o.ActRunId.IsSet() { + return true + } + + return false +} + +// SetActRunId gets a reference to the given NullableString and assigns it to the ActRunId field. +func (o *RequestQueue) SetActRunId(v string) { + o.ActRunId.Set(&v) +} +// SetActRunIdNil sets the value for ActRunId to be an explicit nil +func (o *RequestQueue) SetActRunIdNil() { + o.ActRunId.Set(nil) +} + +// UnsetActRunId ensures that no value is present for ActRunId, not even an explicit nil +func (o *RequestQueue) UnsetActRunId() { + o.ActRunId.Unset() +} + +// GetCreatedAt returns the CreatedAt field value +func (o *RequestQueue) GetCreatedAt() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value +// and a boolean to check if the value has been set. +func (o *RequestQueue) GetCreatedAtOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.CreatedAt, true +} + +// SetCreatedAt sets field value +func (o *RequestQueue) SetCreatedAt(v time.Time) { + o.CreatedAt = v +} + +// GetModifiedAt returns the ModifiedAt field value +func (o *RequestQueue) GetModifiedAt() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.ModifiedAt +} + +// GetModifiedAtOk returns a tuple with the ModifiedAt field value +// and a boolean to check if the value has been set. +func (o *RequestQueue) GetModifiedAtOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.ModifiedAt, true +} + +// SetModifiedAt sets field value +func (o *RequestQueue) SetModifiedAt(v time.Time) { + o.ModifiedAt = v +} + +// GetAccessedAt returns the AccessedAt field value +func (o *RequestQueue) GetAccessedAt() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.AccessedAt +} + +// GetAccessedAtOk returns a tuple with the AccessedAt field value +// and a boolean to check if the value has been set. +func (o *RequestQueue) GetAccessedAtOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.AccessedAt, true +} + +// SetAccessedAt sets field value +func (o *RequestQueue) SetAccessedAt(v time.Time) { + o.AccessedAt = v +} + +// GetTotalRequestCount returns the TotalRequestCount field value +func (o *RequestQueue) GetTotalRequestCount() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.TotalRequestCount +} + +// GetTotalRequestCountOk returns a tuple with the TotalRequestCount field value +// and a boolean to check if the value has been set. +func (o *RequestQueue) GetTotalRequestCountOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.TotalRequestCount, true +} + +// SetTotalRequestCount sets field value +func (o *RequestQueue) SetTotalRequestCount(v int32) { + o.TotalRequestCount = v +} + +// GetHandledRequestCount returns the HandledRequestCount field value +func (o *RequestQueue) GetHandledRequestCount() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.HandledRequestCount +} + +// GetHandledRequestCountOk returns a tuple with the HandledRequestCount field value +// and a boolean to check if the value has been set. +func (o *RequestQueue) GetHandledRequestCountOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.HandledRequestCount, true +} + +// SetHandledRequestCount sets field value +func (o *RequestQueue) SetHandledRequestCount(v int32) { + o.HandledRequestCount = v +} + +// GetPendingRequestCount returns the PendingRequestCount field value +func (o *RequestQueue) GetPendingRequestCount() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.PendingRequestCount +} + +// GetPendingRequestCountOk returns a tuple with the PendingRequestCount field value +// and a boolean to check if the value has been set. +func (o *RequestQueue) GetPendingRequestCountOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.PendingRequestCount, true +} + +// SetPendingRequestCount sets field value +func (o *RequestQueue) SetPendingRequestCount(v int32) { + o.PendingRequestCount = v +} + +// GetHadMultipleClients returns the HadMultipleClients field value +func (o *RequestQueue) GetHadMultipleClients() bool { + if o == nil { + var ret bool + return ret + } + + return o.HadMultipleClients +} + +// GetHadMultipleClientsOk returns a tuple with the HadMultipleClients field value +// and a boolean to check if the value has been set. +func (o *RequestQueue) GetHadMultipleClientsOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.HadMultipleClients, true +} + +// SetHadMultipleClients sets field value +func (o *RequestQueue) SetHadMultipleClients(v bool) { + o.HadMultipleClients = v +} + +// GetConsoleUrl returns the ConsoleUrl field value +func (o *RequestQueue) GetConsoleUrl() string { + if o == nil { + var ret string + return ret + } + + return o.ConsoleUrl +} + +// GetConsoleUrlOk returns a tuple with the ConsoleUrl field value +// and a boolean to check if the value has been set. +func (o *RequestQueue) GetConsoleUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ConsoleUrl, true +} + +// SetConsoleUrl sets field value +func (o *RequestQueue) SetConsoleUrl(v string) { + o.ConsoleUrl = v +} + +// GetStats returns the Stats field value if set, zero value otherwise. +func (o *RequestQueue) GetStats() RequestQueueStats { + if o == nil || IsNil(o.Stats) { + var ret RequestQueueStats + return ret + } + return *o.Stats +} + +// GetStatsOk returns a tuple with the Stats field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RequestQueue) GetStatsOk() (*RequestQueueStats, bool) { + if o == nil || IsNil(o.Stats) { + return nil, false + } + return o.Stats, true +} + +// HasStats returns a boolean if a field has been set. +func (o *RequestQueue) HasStats() bool { + if o != nil && !IsNil(o.Stats) { + return true + } + + return false +} + +// SetStats gets a reference to the given RequestQueueStats and assigns it to the Stats field. +func (o *RequestQueue) SetStats(v RequestQueueStats) { + o.Stats = &v +} + +// GetGeneralAccess returns the GeneralAccess field value if set, zero value otherwise. +func (o *RequestQueue) GetGeneralAccess() GeneralAccess { + if o == nil || IsNil(o.GeneralAccess) { + var ret GeneralAccess + return ret + } + return *o.GeneralAccess +} + +// GetGeneralAccessOk returns a tuple with the GeneralAccess field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RequestQueue) GetGeneralAccessOk() (*GeneralAccess, bool) { + if o == nil || IsNil(o.GeneralAccess) { + return nil, false + } + return o.GeneralAccess, true +} + +// HasGeneralAccess returns a boolean if a field has been set. +func (o *RequestQueue) HasGeneralAccess() bool { + if o != nil && !IsNil(o.GeneralAccess) { + return true + } + + return false +} + +// SetGeneralAccess gets a reference to the given GeneralAccess and assigns it to the GeneralAccess field. +func (o *RequestQueue) SetGeneralAccess(v GeneralAccess) { + o.GeneralAccess = &v +} + +func (o RequestQueue) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o RequestQueue) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + if o.Name.IsSet() { + toSerialize["name"] = o.Name.Get() + } + toSerialize["userId"] = o.UserId + if o.ActId.IsSet() { + toSerialize["actId"] = o.ActId.Get() + } + if o.ActRunId.IsSet() { + toSerialize["actRunId"] = o.ActRunId.Get() + } + toSerialize["createdAt"] = o.CreatedAt + toSerialize["modifiedAt"] = o.ModifiedAt + toSerialize["accessedAt"] = o.AccessedAt + toSerialize["totalRequestCount"] = o.TotalRequestCount + toSerialize["handledRequestCount"] = o.HandledRequestCount + toSerialize["pendingRequestCount"] = o.PendingRequestCount + toSerialize["hadMultipleClients"] = o.HadMultipleClients + toSerialize["consoleUrl"] = o.ConsoleUrl + if !IsNil(o.Stats) { + toSerialize["stats"] = o.Stats + } + if !IsNil(o.GeneralAccess) { + toSerialize["generalAccess"] = o.GeneralAccess + } + return toSerialize, nil +} + +func (o *RequestQueue) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "userId", + "createdAt", + "modifiedAt", + "accessedAt", + "totalRequestCount", + "handledRequestCount", + "pendingRequestCount", + "hadMultipleClients", + "consoleUrl", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varRequestQueue := _RequestQueue{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varRequestQueue) + + if err != nil { + return err + } + + *o = RequestQueue(varRequestQueue) + + return err +} + +type NullableRequestQueue struct { + value *RequestQueue + isSet bool +} + +func (v NullableRequestQueue) Get() *RequestQueue { + return v.value +} + +func (v *NullableRequestQueue) Set(val *RequestQueue) { + v.value = val + v.isSet = true +} + +func (v NullableRequestQueue) IsSet() bool { + return v.isSet +} + +func (v *NullableRequestQueue) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRequestQueue(val *RequestQueue) *NullableRequestQueue { + return &NullableRequestQueue{value: val, isSet: true} +} + +func (v NullableRequestQueue) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRequestQueue) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_request_queue_head.go b/model_request_queue_head.go new file mode 100644 index 0000000..c352116 --- /dev/null +++ b/model_request_queue_head.go @@ -0,0 +1,247 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" + "time" + "bytes" + "fmt" +) + +// checks if the RequestQueueHead type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RequestQueueHead{} + +// RequestQueueHead A batch of requests from the request queue head without locking. +type RequestQueueHead struct { + // The maximum number of requests returned. + Limit int32 `json:"limit"` + // The timestamp when the request queue was last modified. Modifications include adding, updating, or removing requests, as well as locking or unlocking requests in the request queue. + QueueModifiedAt time.Time `json:"queueModifiedAt"` + // Whether the request queue has been accessed by multiple different clients. + HadMultipleClients bool `json:"hadMultipleClients"` + // The array of requests from the request queue head. + Items []HeadRequest `json:"items"` +} + +type _RequestQueueHead RequestQueueHead + +// NewRequestQueueHead instantiates a new RequestQueueHead object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewRequestQueueHead(limit int32, queueModifiedAt time.Time, hadMultipleClients bool, items []HeadRequest) *RequestQueueHead { + this := RequestQueueHead{} + this.Limit = limit + this.QueueModifiedAt = queueModifiedAt + this.HadMultipleClients = hadMultipleClients + this.Items = items + return &this +} + +// NewRequestQueueHeadWithDefaults instantiates a new RequestQueueHead object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRequestQueueHeadWithDefaults() *RequestQueueHead { + this := RequestQueueHead{} + return &this +} + +// GetLimit returns the Limit field value +func (o *RequestQueueHead) GetLimit() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Limit +} + +// GetLimitOk returns a tuple with the Limit field value +// and a boolean to check if the value has been set. +func (o *RequestQueueHead) GetLimitOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Limit, true +} + +// SetLimit sets field value +func (o *RequestQueueHead) SetLimit(v int32) { + o.Limit = v +} + +// GetQueueModifiedAt returns the QueueModifiedAt field value +func (o *RequestQueueHead) GetQueueModifiedAt() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.QueueModifiedAt +} + +// GetQueueModifiedAtOk returns a tuple with the QueueModifiedAt field value +// and a boolean to check if the value has been set. +func (o *RequestQueueHead) GetQueueModifiedAtOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.QueueModifiedAt, true +} + +// SetQueueModifiedAt sets field value +func (o *RequestQueueHead) SetQueueModifiedAt(v time.Time) { + o.QueueModifiedAt = v +} + +// GetHadMultipleClients returns the HadMultipleClients field value +func (o *RequestQueueHead) GetHadMultipleClients() bool { + if o == nil { + var ret bool + return ret + } + + return o.HadMultipleClients +} + +// GetHadMultipleClientsOk returns a tuple with the HadMultipleClients field value +// and a boolean to check if the value has been set. +func (o *RequestQueueHead) GetHadMultipleClientsOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.HadMultipleClients, true +} + +// SetHadMultipleClients sets field value +func (o *RequestQueueHead) SetHadMultipleClients(v bool) { + o.HadMultipleClients = v +} + +// GetItems returns the Items field value +func (o *RequestQueueHead) GetItems() []HeadRequest { + if o == nil { + var ret []HeadRequest + return ret + } + + return o.Items +} + +// GetItemsOk returns a tuple with the Items field value +// and a boolean to check if the value has been set. +func (o *RequestQueueHead) GetItemsOk() ([]HeadRequest, bool) { + if o == nil { + return nil, false + } + return o.Items, true +} + +// SetItems sets field value +func (o *RequestQueueHead) SetItems(v []HeadRequest) { + o.Items = v +} + +func (o RequestQueueHead) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o RequestQueueHead) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["limit"] = o.Limit + toSerialize["queueModifiedAt"] = o.QueueModifiedAt + toSerialize["hadMultipleClients"] = o.HadMultipleClients + toSerialize["items"] = o.Items + return toSerialize, nil +} + +func (o *RequestQueueHead) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "limit", + "queueModifiedAt", + "hadMultipleClients", + "items", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varRequestQueueHead := _RequestQueueHead{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varRequestQueueHead) + + if err != nil { + return err + } + + *o = RequestQueueHead(varRequestQueueHead) + + return err +} + +type NullableRequestQueueHead struct { + value *RequestQueueHead + isSet bool +} + +func (v NullableRequestQueueHead) Get() *RequestQueueHead { + return v.value +} + +func (v *NullableRequestQueueHead) Set(val *RequestQueueHead) { + v.value = val + v.isSet = true +} + +func (v NullableRequestQueueHead) IsSet() bool { + return v.isSet +} + +func (v *NullableRequestQueueHead) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRequestQueueHead(val *RequestQueueHead) *NullableRequestQueueHead { + return &NullableRequestQueueHead{value: val, isSet: true} +} + +func (v NullableRequestQueueHead) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRequestQueueHead) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_request_queue_response.go b/model_request_queue_response.go new file mode 100644 index 0000000..9512455 --- /dev/null +++ b/model_request_queue_response.go @@ -0,0 +1,158 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" + "bytes" + "fmt" +) + +// checks if the RequestQueueResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RequestQueueResponse{} + +// RequestQueueResponse Response containing request queue data. +type RequestQueueResponse struct { + Data RequestQueue `json:"data"` +} + +type _RequestQueueResponse RequestQueueResponse + +// NewRequestQueueResponse instantiates a new RequestQueueResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewRequestQueueResponse(data RequestQueue) *RequestQueueResponse { + this := RequestQueueResponse{} + this.Data = data + return &this +} + +// NewRequestQueueResponseWithDefaults instantiates a new RequestQueueResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRequestQueueResponseWithDefaults() *RequestQueueResponse { + this := RequestQueueResponse{} + return &this +} + +// GetData returns the Data field value +func (o *RequestQueueResponse) GetData() RequestQueue { + if o == nil { + var ret RequestQueue + return ret + } + + return o.Data +} + +// GetDataOk returns a tuple with the Data field value +// and a boolean to check if the value has been set. +func (o *RequestQueueResponse) GetDataOk() (*RequestQueue, bool) { + if o == nil { + return nil, false + } + return &o.Data, true +} + +// SetData sets field value +func (o *RequestQueueResponse) SetData(v RequestQueue) { + o.Data = v +} + +func (o RequestQueueResponse) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o RequestQueueResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["data"] = o.Data + return toSerialize, nil +} + +func (o *RequestQueueResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "data", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varRequestQueueResponse := _RequestQueueResponse{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varRequestQueueResponse) + + if err != nil { + return err + } + + *o = RequestQueueResponse(varRequestQueueResponse) + + return err +} + +type NullableRequestQueueResponse struct { + value *RequestQueueResponse + isSet bool +} + +func (v NullableRequestQueueResponse) Get() *RequestQueueResponse { + return v.value +} + +func (v *NullableRequestQueueResponse) Set(val *RequestQueueResponse) { + v.value = val + v.isSet = true +} + +func (v NullableRequestQueueResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableRequestQueueResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRequestQueueResponse(val *RequestQueueResponse) *NullableRequestQueueResponse { + return &NullableRequestQueueResponse{value: val, isSet: true} +} + +func (v NullableRequestQueueResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRequestQueueResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_request_queue_short.go b/model_request_queue_short.go new file mode 100644 index 0000000..0761b79 --- /dev/null +++ b/model_request_queue_short.go @@ -0,0 +1,653 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" + "time" + "bytes" + "fmt" +) + +// checks if the RequestQueueShort type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RequestQueueShort{} + +// RequestQueueShort A shortened request queue object for list responses. +type RequestQueueShort struct { + // A unique identifier assigned to the request queue. + Id string `json:"id"` + // The name of the request queue. + Name string `json:"name"` + // The ID of the user who owns the request queue. + UserId string `json:"userId"` + // The username of the user who owns the request queue. + Username string `json:"username"` + // The timestamp when the request queue was created. + CreatedAt time.Time `json:"createdAt"` + // The timestamp when the request queue was last modified. Modifications include adding, updating, or removing requests, as well as locking or unlocking requests in the request queue. + ModifiedAt time.Time `json:"modifiedAt"` + // The timestamp when the request queue was last accessed. + AccessedAt time.Time `json:"accessedAt"` + // The timestamp when the request queue will expire and be deleted. + ExpireAt *time.Time `json:"expireAt,omitempty"` + // The total number of requests in the request queue. + TotalRequestCount int32 `json:"totalRequestCount"` + // The number of requests that have been handled. + HandledRequestCount int32 `json:"handledRequestCount"` + // The number of requests that are pending and have not been handled yet. + PendingRequestCount int32 `json:"pendingRequestCount"` + // The ID of the Actor that created this request queue. + ActId NullableString `json:"actId,omitempty"` + // The ID of the Actor run that created this request queue. + ActRunId NullableString `json:"actRunId,omitempty"` + // Whether the request queue has been accessed by multiple different clients. + HadMultipleClients bool `json:"hadMultipleClients"` + GeneralAccess *GeneralAccess `json:"generalAccess,omitempty"` + Stats *RequestQueueStats `json:"stats,omitempty"` +} + +type _RequestQueueShort RequestQueueShort + +// NewRequestQueueShort instantiates a new RequestQueueShort object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewRequestQueueShort(id string, name string, userId string, username string, createdAt time.Time, modifiedAt time.Time, accessedAt time.Time, totalRequestCount int32, handledRequestCount int32, pendingRequestCount int32, hadMultipleClients bool) *RequestQueueShort { + this := RequestQueueShort{} + this.Id = id + this.Name = name + this.UserId = userId + this.Username = username + this.CreatedAt = createdAt + this.ModifiedAt = modifiedAt + this.AccessedAt = accessedAt + this.TotalRequestCount = totalRequestCount + this.HandledRequestCount = handledRequestCount + this.PendingRequestCount = pendingRequestCount + this.HadMultipleClients = hadMultipleClients + return &this +} + +// NewRequestQueueShortWithDefaults instantiates a new RequestQueueShort object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRequestQueueShortWithDefaults() *RequestQueueShort { + this := RequestQueueShort{} + return &this +} + +// GetId returns the Id field value +func (o *RequestQueueShort) GetId() string { + if o == nil { + var ret string + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *RequestQueueShort) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *RequestQueueShort) SetId(v string) { + o.Id = v +} + +// GetName returns the Name field value +func (o *RequestQueueShort) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *RequestQueueShort) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *RequestQueueShort) SetName(v string) { + o.Name = v +} + +// GetUserId returns the UserId field value +func (o *RequestQueueShort) GetUserId() string { + if o == nil { + var ret string + return ret + } + + return o.UserId +} + +// GetUserIdOk returns a tuple with the UserId field value +// and a boolean to check if the value has been set. +func (o *RequestQueueShort) GetUserIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.UserId, true +} + +// SetUserId sets field value +func (o *RequestQueueShort) SetUserId(v string) { + o.UserId = v +} + +// GetUsername returns the Username field value +func (o *RequestQueueShort) GetUsername() string { + if o == nil { + var ret string + return ret + } + + return o.Username +} + +// GetUsernameOk returns a tuple with the Username field value +// and a boolean to check if the value has been set. +func (o *RequestQueueShort) GetUsernameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Username, true +} + +// SetUsername sets field value +func (o *RequestQueueShort) SetUsername(v string) { + o.Username = v +} + +// GetCreatedAt returns the CreatedAt field value +func (o *RequestQueueShort) GetCreatedAt() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value +// and a boolean to check if the value has been set. +func (o *RequestQueueShort) GetCreatedAtOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.CreatedAt, true +} + +// SetCreatedAt sets field value +func (o *RequestQueueShort) SetCreatedAt(v time.Time) { + o.CreatedAt = v +} + +// GetModifiedAt returns the ModifiedAt field value +func (o *RequestQueueShort) GetModifiedAt() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.ModifiedAt +} + +// GetModifiedAtOk returns a tuple with the ModifiedAt field value +// and a boolean to check if the value has been set. +func (o *RequestQueueShort) GetModifiedAtOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.ModifiedAt, true +} + +// SetModifiedAt sets field value +func (o *RequestQueueShort) SetModifiedAt(v time.Time) { + o.ModifiedAt = v +} + +// GetAccessedAt returns the AccessedAt field value +func (o *RequestQueueShort) GetAccessedAt() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.AccessedAt +} + +// GetAccessedAtOk returns a tuple with the AccessedAt field value +// and a boolean to check if the value has been set. +func (o *RequestQueueShort) GetAccessedAtOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.AccessedAt, true +} + +// SetAccessedAt sets field value +func (o *RequestQueueShort) SetAccessedAt(v time.Time) { + o.AccessedAt = v +} + +// GetExpireAt returns the ExpireAt field value if set, zero value otherwise. +func (o *RequestQueueShort) GetExpireAt() time.Time { + if o == nil || IsNil(o.ExpireAt) { + var ret time.Time + return ret + } + return *o.ExpireAt +} + +// GetExpireAtOk returns a tuple with the ExpireAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RequestQueueShort) GetExpireAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.ExpireAt) { + return nil, false + } + return o.ExpireAt, true +} + +// HasExpireAt returns a boolean if a field has been set. +func (o *RequestQueueShort) HasExpireAt() bool { + if o != nil && !IsNil(o.ExpireAt) { + return true + } + + return false +} + +// SetExpireAt gets a reference to the given time.Time and assigns it to the ExpireAt field. +func (o *RequestQueueShort) SetExpireAt(v time.Time) { + o.ExpireAt = &v +} + +// GetTotalRequestCount returns the TotalRequestCount field value +func (o *RequestQueueShort) GetTotalRequestCount() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.TotalRequestCount +} + +// GetTotalRequestCountOk returns a tuple with the TotalRequestCount field value +// and a boolean to check if the value has been set. +func (o *RequestQueueShort) GetTotalRequestCountOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.TotalRequestCount, true +} + +// SetTotalRequestCount sets field value +func (o *RequestQueueShort) SetTotalRequestCount(v int32) { + o.TotalRequestCount = v +} + +// GetHandledRequestCount returns the HandledRequestCount field value +func (o *RequestQueueShort) GetHandledRequestCount() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.HandledRequestCount +} + +// GetHandledRequestCountOk returns a tuple with the HandledRequestCount field value +// and a boolean to check if the value has been set. +func (o *RequestQueueShort) GetHandledRequestCountOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.HandledRequestCount, true +} + +// SetHandledRequestCount sets field value +func (o *RequestQueueShort) SetHandledRequestCount(v int32) { + o.HandledRequestCount = v +} + +// GetPendingRequestCount returns the PendingRequestCount field value +func (o *RequestQueueShort) GetPendingRequestCount() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.PendingRequestCount +} + +// GetPendingRequestCountOk returns a tuple with the PendingRequestCount field value +// and a boolean to check if the value has been set. +func (o *RequestQueueShort) GetPendingRequestCountOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.PendingRequestCount, true +} + +// SetPendingRequestCount sets field value +func (o *RequestQueueShort) SetPendingRequestCount(v int32) { + o.PendingRequestCount = v +} + +// GetActId returns the ActId field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *RequestQueueShort) GetActId() string { + if o == nil || IsNil(o.ActId.Get()) { + var ret string + return ret + } + return *o.ActId.Get() +} + +// GetActIdOk returns a tuple with the ActId field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *RequestQueueShort) GetActIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.ActId.Get(), o.ActId.IsSet() +} + +// HasActId returns a boolean if a field has been set. +func (o *RequestQueueShort) HasActId() bool { + if o != nil && o.ActId.IsSet() { + return true + } + + return false +} + +// SetActId gets a reference to the given NullableString and assigns it to the ActId field. +func (o *RequestQueueShort) SetActId(v string) { + o.ActId.Set(&v) +} +// SetActIdNil sets the value for ActId to be an explicit nil +func (o *RequestQueueShort) SetActIdNil() { + o.ActId.Set(nil) +} + +// UnsetActId ensures that no value is present for ActId, not even an explicit nil +func (o *RequestQueueShort) UnsetActId() { + o.ActId.Unset() +} + +// GetActRunId returns the ActRunId field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *RequestQueueShort) GetActRunId() string { + if o == nil || IsNil(o.ActRunId.Get()) { + var ret string + return ret + } + return *o.ActRunId.Get() +} + +// GetActRunIdOk returns a tuple with the ActRunId field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *RequestQueueShort) GetActRunIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.ActRunId.Get(), o.ActRunId.IsSet() +} + +// HasActRunId returns a boolean if a field has been set. +func (o *RequestQueueShort) HasActRunId() bool { + if o != nil && o.ActRunId.IsSet() { + return true + } + + return false +} + +// SetActRunId gets a reference to the given NullableString and assigns it to the ActRunId field. +func (o *RequestQueueShort) SetActRunId(v string) { + o.ActRunId.Set(&v) +} +// SetActRunIdNil sets the value for ActRunId to be an explicit nil +func (o *RequestQueueShort) SetActRunIdNil() { + o.ActRunId.Set(nil) +} + +// UnsetActRunId ensures that no value is present for ActRunId, not even an explicit nil +func (o *RequestQueueShort) UnsetActRunId() { + o.ActRunId.Unset() +} + +// GetHadMultipleClients returns the HadMultipleClients field value +func (o *RequestQueueShort) GetHadMultipleClients() bool { + if o == nil { + var ret bool + return ret + } + + return o.HadMultipleClients +} + +// GetHadMultipleClientsOk returns a tuple with the HadMultipleClients field value +// and a boolean to check if the value has been set. +func (o *RequestQueueShort) GetHadMultipleClientsOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.HadMultipleClients, true +} + +// SetHadMultipleClients sets field value +func (o *RequestQueueShort) SetHadMultipleClients(v bool) { + o.HadMultipleClients = v +} + +// GetGeneralAccess returns the GeneralAccess field value if set, zero value otherwise. +func (o *RequestQueueShort) GetGeneralAccess() GeneralAccess { + if o == nil || IsNil(o.GeneralAccess) { + var ret GeneralAccess + return ret + } + return *o.GeneralAccess +} + +// GetGeneralAccessOk returns a tuple with the GeneralAccess field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RequestQueueShort) GetGeneralAccessOk() (*GeneralAccess, bool) { + if o == nil || IsNil(o.GeneralAccess) { + return nil, false + } + return o.GeneralAccess, true +} + +// HasGeneralAccess returns a boolean if a field has been set. +func (o *RequestQueueShort) HasGeneralAccess() bool { + if o != nil && !IsNil(o.GeneralAccess) { + return true + } + + return false +} + +// SetGeneralAccess gets a reference to the given GeneralAccess and assigns it to the GeneralAccess field. +func (o *RequestQueueShort) SetGeneralAccess(v GeneralAccess) { + o.GeneralAccess = &v +} + +// GetStats returns the Stats field value if set, zero value otherwise. +func (o *RequestQueueShort) GetStats() RequestQueueStats { + if o == nil || IsNil(o.Stats) { + var ret RequestQueueStats + return ret + } + return *o.Stats +} + +// GetStatsOk returns a tuple with the Stats field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RequestQueueShort) GetStatsOk() (*RequestQueueStats, bool) { + if o == nil || IsNil(o.Stats) { + return nil, false + } + return o.Stats, true +} + +// HasStats returns a boolean if a field has been set. +func (o *RequestQueueShort) HasStats() bool { + if o != nil && !IsNil(o.Stats) { + return true + } + + return false +} + +// SetStats gets a reference to the given RequestQueueStats and assigns it to the Stats field. +func (o *RequestQueueShort) SetStats(v RequestQueueStats) { + o.Stats = &v +} + +func (o RequestQueueShort) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o RequestQueueShort) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["name"] = o.Name + toSerialize["userId"] = o.UserId + toSerialize["username"] = o.Username + toSerialize["createdAt"] = o.CreatedAt + toSerialize["modifiedAt"] = o.ModifiedAt + toSerialize["accessedAt"] = o.AccessedAt + if !IsNil(o.ExpireAt) { + toSerialize["expireAt"] = o.ExpireAt + } + toSerialize["totalRequestCount"] = o.TotalRequestCount + toSerialize["handledRequestCount"] = o.HandledRequestCount + toSerialize["pendingRequestCount"] = o.PendingRequestCount + if o.ActId.IsSet() { + toSerialize["actId"] = o.ActId.Get() + } + if o.ActRunId.IsSet() { + toSerialize["actRunId"] = o.ActRunId.Get() + } + toSerialize["hadMultipleClients"] = o.HadMultipleClients + if !IsNil(o.GeneralAccess) { + toSerialize["generalAccess"] = o.GeneralAccess + } + if !IsNil(o.Stats) { + toSerialize["stats"] = o.Stats + } + return toSerialize, nil +} + +func (o *RequestQueueShort) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "name", + "userId", + "username", + "createdAt", + "modifiedAt", + "accessedAt", + "totalRequestCount", + "handledRequestCount", + "pendingRequestCount", + "hadMultipleClients", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varRequestQueueShort := _RequestQueueShort{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varRequestQueueShort) + + if err != nil { + return err + } + + *o = RequestQueueShort(varRequestQueueShort) + + return err +} + +type NullableRequestQueueShort struct { + value *RequestQueueShort + isSet bool +} + +func (v NullableRequestQueueShort) Get() *RequestQueueShort { + return v.value +} + +func (v *NullableRequestQueueShort) Set(val *RequestQueueShort) { + v.value = val + v.isSet = true +} + +func (v NullableRequestQueueShort) IsSet() bool { + return v.isSet +} + +func (v *NullableRequestQueueShort) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRequestQueueShort(val *RequestQueueShort) *NullableRequestQueueShort { + return &NullableRequestQueueShort{value: val, isSet: true} +} + +func (v NullableRequestQueueShort) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRequestQueueShort) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_request_queue_stats.go b/model_request_queue_stats.go new file mode 100644 index 0000000..ba799b7 --- /dev/null +++ b/model_request_queue_stats.go @@ -0,0 +1,275 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" +) + +// checks if the RequestQueueStats type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RequestQueueStats{} + +// RequestQueueStats Statistics about request queue operations and storage. +type RequestQueueStats struct { + // The number of delete operations performed on the request queue. + DeleteCount *int32 `json:"deleteCount,omitempty"` + // The number of times requests from the head were read. + HeadItemReadCount *int32 `json:"headItemReadCount,omitempty"` + // The total number of read operations performed on the request queue. + ReadCount *int32 `json:"readCount,omitempty"` + // The total storage size in bytes used by the request queue. + StorageBytes *int32 `json:"storageBytes,omitempty"` + // The total number of write operations performed on the request queue. + WriteCount *int32 `json:"writeCount,omitempty"` +} + +// NewRequestQueueStats instantiates a new RequestQueueStats object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewRequestQueueStats() *RequestQueueStats { + this := RequestQueueStats{} + return &this +} + +// NewRequestQueueStatsWithDefaults instantiates a new RequestQueueStats object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRequestQueueStatsWithDefaults() *RequestQueueStats { + this := RequestQueueStats{} + return &this +} + +// GetDeleteCount returns the DeleteCount field value if set, zero value otherwise. +func (o *RequestQueueStats) GetDeleteCount() int32 { + if o == nil || IsNil(o.DeleteCount) { + var ret int32 + return ret + } + return *o.DeleteCount +} + +// GetDeleteCountOk returns a tuple with the DeleteCount field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RequestQueueStats) GetDeleteCountOk() (*int32, bool) { + if o == nil || IsNil(o.DeleteCount) { + return nil, false + } + return o.DeleteCount, true +} + +// HasDeleteCount returns a boolean if a field has been set. +func (o *RequestQueueStats) HasDeleteCount() bool { + if o != nil && !IsNil(o.DeleteCount) { + return true + } + + return false +} + +// SetDeleteCount gets a reference to the given int32 and assigns it to the DeleteCount field. +func (o *RequestQueueStats) SetDeleteCount(v int32) { + o.DeleteCount = &v +} + +// GetHeadItemReadCount returns the HeadItemReadCount field value if set, zero value otherwise. +func (o *RequestQueueStats) GetHeadItemReadCount() int32 { + if o == nil || IsNil(o.HeadItemReadCount) { + var ret int32 + return ret + } + return *o.HeadItemReadCount +} + +// GetHeadItemReadCountOk returns a tuple with the HeadItemReadCount field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RequestQueueStats) GetHeadItemReadCountOk() (*int32, bool) { + if o == nil || IsNil(o.HeadItemReadCount) { + return nil, false + } + return o.HeadItemReadCount, true +} + +// HasHeadItemReadCount returns a boolean if a field has been set. +func (o *RequestQueueStats) HasHeadItemReadCount() bool { + if o != nil && !IsNil(o.HeadItemReadCount) { + return true + } + + return false +} + +// SetHeadItemReadCount gets a reference to the given int32 and assigns it to the HeadItemReadCount field. +func (o *RequestQueueStats) SetHeadItemReadCount(v int32) { + o.HeadItemReadCount = &v +} + +// GetReadCount returns the ReadCount field value if set, zero value otherwise. +func (o *RequestQueueStats) GetReadCount() int32 { + if o == nil || IsNil(o.ReadCount) { + var ret int32 + return ret + } + return *o.ReadCount +} + +// GetReadCountOk returns a tuple with the ReadCount field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RequestQueueStats) GetReadCountOk() (*int32, bool) { + if o == nil || IsNil(o.ReadCount) { + return nil, false + } + return o.ReadCount, true +} + +// HasReadCount returns a boolean if a field has been set. +func (o *RequestQueueStats) HasReadCount() bool { + if o != nil && !IsNil(o.ReadCount) { + return true + } + + return false +} + +// SetReadCount gets a reference to the given int32 and assigns it to the ReadCount field. +func (o *RequestQueueStats) SetReadCount(v int32) { + o.ReadCount = &v +} + +// GetStorageBytes returns the StorageBytes field value if set, zero value otherwise. +func (o *RequestQueueStats) GetStorageBytes() int32 { + if o == nil || IsNil(o.StorageBytes) { + var ret int32 + return ret + } + return *o.StorageBytes +} + +// GetStorageBytesOk returns a tuple with the StorageBytes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RequestQueueStats) GetStorageBytesOk() (*int32, bool) { + if o == nil || IsNil(o.StorageBytes) { + return nil, false + } + return o.StorageBytes, true +} + +// HasStorageBytes returns a boolean if a field has been set. +func (o *RequestQueueStats) HasStorageBytes() bool { + if o != nil && !IsNil(o.StorageBytes) { + return true + } + + return false +} + +// SetStorageBytes gets a reference to the given int32 and assigns it to the StorageBytes field. +func (o *RequestQueueStats) SetStorageBytes(v int32) { + o.StorageBytes = &v +} + +// GetWriteCount returns the WriteCount field value if set, zero value otherwise. +func (o *RequestQueueStats) GetWriteCount() int32 { + if o == nil || IsNil(o.WriteCount) { + var ret int32 + return ret + } + return *o.WriteCount +} + +// GetWriteCountOk returns a tuple with the WriteCount field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RequestQueueStats) GetWriteCountOk() (*int32, bool) { + if o == nil || IsNil(o.WriteCount) { + return nil, false + } + return o.WriteCount, true +} + +// HasWriteCount returns a boolean if a field has been set. +func (o *RequestQueueStats) HasWriteCount() bool { + if o != nil && !IsNil(o.WriteCount) { + return true + } + + return false +} + +// SetWriteCount gets a reference to the given int32 and assigns it to the WriteCount field. +func (o *RequestQueueStats) SetWriteCount(v int32) { + o.WriteCount = &v +} + +func (o RequestQueueStats) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o RequestQueueStats) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.DeleteCount) { + toSerialize["deleteCount"] = o.DeleteCount + } + if !IsNil(o.HeadItemReadCount) { + toSerialize["headItemReadCount"] = o.HeadItemReadCount + } + if !IsNil(o.ReadCount) { + toSerialize["readCount"] = o.ReadCount + } + if !IsNil(o.StorageBytes) { + toSerialize["storageBytes"] = o.StorageBytes + } + if !IsNil(o.WriteCount) { + toSerialize["writeCount"] = o.WriteCount + } + return toSerialize, nil +} + +type NullableRequestQueueStats struct { + value *RequestQueueStats + isSet bool +} + +func (v NullableRequestQueueStats) Get() *RequestQueueStats { + return v.value +} + +func (v *NullableRequestQueueStats) Set(val *RequestQueueStats) { + v.value = val + v.isSet = true +} + +func (v NullableRequestQueueStats) IsSet() bool { + return v.isSet +} + +func (v *NullableRequestQueueStats) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRequestQueueStats(val *RequestQueueStats) *NullableRequestQueueStats { + return &NullableRequestQueueStats{value: val, isSet: true} +} + +func (v NullableRequestQueueStats) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRequestQueueStats) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_request_registration.go b/model_request_registration.go new file mode 100644 index 0000000..4f0688e --- /dev/null +++ b/model_request_registration.go @@ -0,0 +1,217 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" + "bytes" + "fmt" +) + +// checks if the RequestRegistration type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RequestRegistration{} + +// RequestRegistration Result of registering a request in the request queue, either by adding a new request or updating an existing one. +type RequestRegistration struct { + // A unique identifier assigned to the request. + RequestId string `json:"requestId"` + // Indicates whether a request with the same unique key already existed in the request queue. If true, no new request was created. + WasAlreadyPresent bool `json:"wasAlreadyPresent"` + // Indicates whether a request with the same unique key has already been processed by the request queue. + WasAlreadyHandled bool `json:"wasAlreadyHandled"` +} + +type _RequestRegistration RequestRegistration + +// NewRequestRegistration instantiates a new RequestRegistration object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewRequestRegistration(requestId string, wasAlreadyPresent bool, wasAlreadyHandled bool) *RequestRegistration { + this := RequestRegistration{} + this.RequestId = requestId + this.WasAlreadyPresent = wasAlreadyPresent + this.WasAlreadyHandled = wasAlreadyHandled + return &this +} + +// NewRequestRegistrationWithDefaults instantiates a new RequestRegistration object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRequestRegistrationWithDefaults() *RequestRegistration { + this := RequestRegistration{} + return &this +} + +// GetRequestId returns the RequestId field value +func (o *RequestRegistration) GetRequestId() string { + if o == nil { + var ret string + return ret + } + + return o.RequestId +} + +// GetRequestIdOk returns a tuple with the RequestId field value +// and a boolean to check if the value has been set. +func (o *RequestRegistration) GetRequestIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.RequestId, true +} + +// SetRequestId sets field value +func (o *RequestRegistration) SetRequestId(v string) { + o.RequestId = v +} + +// GetWasAlreadyPresent returns the WasAlreadyPresent field value +func (o *RequestRegistration) GetWasAlreadyPresent() bool { + if o == nil { + var ret bool + return ret + } + + return o.WasAlreadyPresent +} + +// GetWasAlreadyPresentOk returns a tuple with the WasAlreadyPresent field value +// and a boolean to check if the value has been set. +func (o *RequestRegistration) GetWasAlreadyPresentOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.WasAlreadyPresent, true +} + +// SetWasAlreadyPresent sets field value +func (o *RequestRegistration) SetWasAlreadyPresent(v bool) { + o.WasAlreadyPresent = v +} + +// GetWasAlreadyHandled returns the WasAlreadyHandled field value +func (o *RequestRegistration) GetWasAlreadyHandled() bool { + if o == nil { + var ret bool + return ret + } + + return o.WasAlreadyHandled +} + +// GetWasAlreadyHandledOk returns a tuple with the WasAlreadyHandled field value +// and a boolean to check if the value has been set. +func (o *RequestRegistration) GetWasAlreadyHandledOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.WasAlreadyHandled, true +} + +// SetWasAlreadyHandled sets field value +func (o *RequestRegistration) SetWasAlreadyHandled(v bool) { + o.WasAlreadyHandled = v +} + +func (o RequestRegistration) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o RequestRegistration) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["requestId"] = o.RequestId + toSerialize["wasAlreadyPresent"] = o.WasAlreadyPresent + toSerialize["wasAlreadyHandled"] = o.WasAlreadyHandled + return toSerialize, nil +} + +func (o *RequestRegistration) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "requestId", + "wasAlreadyPresent", + "wasAlreadyHandled", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varRequestRegistration := _RequestRegistration{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varRequestRegistration) + + if err != nil { + return err + } + + *o = RequestRegistration(varRequestRegistration) + + return err +} + +type NullableRequestRegistration struct { + value *RequestRegistration + isSet bool +} + +func (v NullableRequestRegistration) Get() *RequestRegistration { + return v.value +} + +func (v *NullableRequestRegistration) Set(val *RequestRegistration) { + v.value = val + v.isSet = true +} + +func (v NullableRequestRegistration) IsSet() bool { + return v.isSet +} + +func (v *NullableRequestRegistration) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRequestRegistration(val *RequestRegistration) *NullableRequestRegistration { + return &NullableRequestRegistration{value: val, isSet: true} +} + +func (v NullableRequestRegistration) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRequestRegistration) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_request_response.go b/model_request_response.go new file mode 100644 index 0000000..9a17448 --- /dev/null +++ b/model_request_response.go @@ -0,0 +1,158 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" + "bytes" + "fmt" +) + +// checks if the RequestResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RequestResponse{} + +// RequestResponse Response containing a single request from the request queue. +type RequestResponse struct { + Data Request `json:"data"` +} + +type _RequestResponse RequestResponse + +// NewRequestResponse instantiates a new RequestResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewRequestResponse(data Request) *RequestResponse { + this := RequestResponse{} + this.Data = data + return &this +} + +// NewRequestResponseWithDefaults instantiates a new RequestResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRequestResponseWithDefaults() *RequestResponse { + this := RequestResponse{} + return &this +} + +// GetData returns the Data field value +func (o *RequestResponse) GetData() Request { + if o == nil { + var ret Request + return ret + } + + return o.Data +} + +// GetDataOk returns a tuple with the Data field value +// and a boolean to check if the value has been set. +func (o *RequestResponse) GetDataOk() (*Request, bool) { + if o == nil { + return nil, false + } + return &o.Data, true +} + +// SetData sets field value +func (o *RequestResponse) SetData(v Request) { + o.Data = v +} + +func (o RequestResponse) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o RequestResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["data"] = o.Data + return toSerialize, nil +} + +func (o *RequestResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "data", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varRequestResponse := _RequestResponse{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varRequestResponse) + + if err != nil { + return err + } + + *o = RequestResponse(varRequestResponse) + + return err +} + +type NullableRequestResponse struct { + value *RequestResponse + isSet bool +} + +func (v NullableRequestResponse) Get() *RequestResponse { + return v.value +} + +func (v *NullableRequestResponse) Set(val *RequestResponse) { + v.value = val + v.isSet = true +} + +func (v NullableRequestResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableRequestResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRequestResponse(val *RequestResponse) *NullableRequestResponse { + return &NullableRequestResponse{value: val, isSet: true} +} + +func (v NullableRequestResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRequestResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_run.go b/model_run.go new file mode 100644 index 0000000..bf1a1ba --- /dev/null +++ b/model_run.go @@ -0,0 +1,1247 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" + "time" + "bytes" + "fmt" +) + +// checks if the Run type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Run{} + +// Run Represents an Actor run and its associated data. +type Run struct { + // Unique identifier of the Actor run. + Id string `json:"id"` + // ID of the Actor that was run. + ActId string `json:"actId"` + // ID of the user who started the run. + UserId string `json:"userId"` + // ID of the Actor task, if the run was started from a task. + ActorTaskId NullableString `json:"actorTaskId,omitempty"` + // Time when the Actor run started. + StartedAt time.Time `json:"startedAt"` + // Time when the Actor run finished. + FinishedAt NullableTime `json:"finishedAt,omitempty"` + // Current status of the Actor run. + Status ActorJobStatus `json:"status"` + // Detailed message about the run status. + StatusMessage NullableString `json:"statusMessage,omitempty"` + // Whether the status message is terminal (final). + IsStatusMessageTerminal NullableBool `json:"isStatusMessageTerminal,omitempty"` + // Metadata about the Actor run. + Meta RunMeta `json:"meta"` + // Pricing information for the Actor. + PricingInfo *ActorRunPricingInfo `json:"pricingInfo,omitempty"` + // Statistics of the Actor run. + Stats RunStats `json:"stats"` + // A map of charged event types to their counts. The keys are event type identifiers defined by the Actor's pricing model (pay-per-event), and the values are the number of times each event was charged during this run. + ChargedEventCounts map[string]int32 `json:"chargedEventCounts,omitempty"` + // Configuration options for the Actor run. + Options RunOptions `json:"options"` + // ID of the Actor build used for this run. + BuildId string `json:"buildId"` + // Exit code of the Actor run process. + ExitCode NullableInt32 `json:"exitCode,omitempty"` + // General access level for the Actor run. + GeneralAccess GeneralAccess `json:"generalAccess"` + // ID of the default key-value store for this run. + DefaultKeyValueStoreId string `json:"defaultKeyValueStoreId"` + // ID of the default dataset for this run. + DefaultDatasetId string `json:"defaultDatasetId"` + // ID of the default request queue for this run. + DefaultRequestQueueId string `json:"defaultRequestQueueId"` + StorageIds *RunStorageIds `json:"storageIds,omitempty"` + // Build number of the Actor build used for this run. + BuildNumber NullableString `json:"buildNumber,omitempty" validate:"regexp=^([0-9]|[1-9][0-9])\\\\.([0-9]|[1-9][0-9])(\\\\.[1-9][0-9]{0,4})$"` + // URL of the container running the Actor. + ContainerUrl *string `json:"containerUrl,omitempty"` + // Whether the container's HTTP server is ready to accept requests. + IsContainerServerReady NullableBool `json:"isContainerServerReady,omitempty"` + // Name of the git branch used for the Actor build. + GitBranchName NullableString `json:"gitBranchName,omitempty"` + // Resource usage statistics for the run. + Usage NullableRunUsage `json:"usage,omitempty"` + // Total cost in USD for this run. Represents what you actually pay. For run owners: includes platform usage (compute units) and/or event costs depending on the Actor's pricing model. For run non-owners: only available for Pay-Per-Event Actors (event costs only). Requires authentication token to access. + UsageTotalUsd NullableFloat32 `json:"usageTotalUsd,omitempty"` + // Platform usage costs breakdown in USD. Only present if you own the run AND are paying for platform usage (Pay-Per-Usage, Rental, or Pay-Per-Event with usage costs like standby Actors). Not available for standard Pay-Per-Event Actors. Requires authentication token to access. + UsageUsd NullableRunUsageUsd `json:"usageUsd,omitempty"` + // List of metamorph events that occurred during the run. + Metamorphs []Metamorph `json:"metamorphs,omitempty"` + // Indicates which party covers platform usage costs for this run. + PlatformUsageBillingModel *string `json:"platformUsageBillingModel,omitempty"` +} + +type _Run Run + +// NewRun instantiates a new Run object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewRun(id string, actId string, userId string, startedAt time.Time, status ActorJobStatus, meta RunMeta, stats RunStats, options RunOptions, buildId string, generalAccess GeneralAccess, defaultKeyValueStoreId string, defaultDatasetId string, defaultRequestQueueId string) *Run { + this := Run{} + this.Id = id + this.ActId = actId + this.UserId = userId + this.StartedAt = startedAt + this.Status = status + this.Meta = meta + this.Stats = stats + this.Options = options + this.BuildId = buildId + this.GeneralAccess = generalAccess + this.DefaultKeyValueStoreId = defaultKeyValueStoreId + this.DefaultDatasetId = defaultDatasetId + this.DefaultRequestQueueId = defaultRequestQueueId + return &this +} + +// NewRunWithDefaults instantiates a new Run object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRunWithDefaults() *Run { + this := Run{} + return &this +} + +// GetId returns the Id field value +func (o *Run) GetId() string { + if o == nil { + var ret string + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *Run) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *Run) SetId(v string) { + o.Id = v +} + +// GetActId returns the ActId field value +func (o *Run) GetActId() string { + if o == nil { + var ret string + return ret + } + + return o.ActId +} + +// GetActIdOk returns a tuple with the ActId field value +// and a boolean to check if the value has been set. +func (o *Run) GetActIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ActId, true +} + +// SetActId sets field value +func (o *Run) SetActId(v string) { + o.ActId = v +} + +// GetUserId returns the UserId field value +func (o *Run) GetUserId() string { + if o == nil { + var ret string + return ret + } + + return o.UserId +} + +// GetUserIdOk returns a tuple with the UserId field value +// and a boolean to check if the value has been set. +func (o *Run) GetUserIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.UserId, true +} + +// SetUserId sets field value +func (o *Run) SetUserId(v string) { + o.UserId = v +} + +// GetActorTaskId returns the ActorTaskId field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Run) GetActorTaskId() string { + if o == nil || IsNil(o.ActorTaskId.Get()) { + var ret string + return ret + } + return *o.ActorTaskId.Get() +} + +// GetActorTaskIdOk returns a tuple with the ActorTaskId field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Run) GetActorTaskIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.ActorTaskId.Get(), o.ActorTaskId.IsSet() +} + +// HasActorTaskId returns a boolean if a field has been set. +func (o *Run) HasActorTaskId() bool { + if o != nil && o.ActorTaskId.IsSet() { + return true + } + + return false +} + +// SetActorTaskId gets a reference to the given NullableString and assigns it to the ActorTaskId field. +func (o *Run) SetActorTaskId(v string) { + o.ActorTaskId.Set(&v) +} +// SetActorTaskIdNil sets the value for ActorTaskId to be an explicit nil +func (o *Run) SetActorTaskIdNil() { + o.ActorTaskId.Set(nil) +} + +// UnsetActorTaskId ensures that no value is present for ActorTaskId, not even an explicit nil +func (o *Run) UnsetActorTaskId() { + o.ActorTaskId.Unset() +} + +// GetStartedAt returns the StartedAt field value +func (o *Run) GetStartedAt() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.StartedAt +} + +// GetStartedAtOk returns a tuple with the StartedAt field value +// and a boolean to check if the value has been set. +func (o *Run) GetStartedAtOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.StartedAt, true +} + +// SetStartedAt sets field value +func (o *Run) SetStartedAt(v time.Time) { + o.StartedAt = v +} + +// GetFinishedAt returns the FinishedAt field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Run) GetFinishedAt() time.Time { + if o == nil || IsNil(o.FinishedAt.Get()) { + var ret time.Time + return ret + } + return *o.FinishedAt.Get() +} + +// GetFinishedAtOk returns a tuple with the FinishedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Run) GetFinishedAtOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.FinishedAt.Get(), o.FinishedAt.IsSet() +} + +// HasFinishedAt returns a boolean if a field has been set. +func (o *Run) HasFinishedAt() bool { + if o != nil && o.FinishedAt.IsSet() { + return true + } + + return false +} + +// SetFinishedAt gets a reference to the given NullableTime and assigns it to the FinishedAt field. +func (o *Run) SetFinishedAt(v time.Time) { + o.FinishedAt.Set(&v) +} +// SetFinishedAtNil sets the value for FinishedAt to be an explicit nil +func (o *Run) SetFinishedAtNil() { + o.FinishedAt.Set(nil) +} + +// UnsetFinishedAt ensures that no value is present for FinishedAt, not even an explicit nil +func (o *Run) UnsetFinishedAt() { + o.FinishedAt.Unset() +} + +// GetStatus returns the Status field value +func (o *Run) GetStatus() ActorJobStatus { + if o == nil { + var ret ActorJobStatus + return ret + } + + return o.Status +} + +// GetStatusOk returns a tuple with the Status field value +// and a boolean to check if the value has been set. +func (o *Run) GetStatusOk() (*ActorJobStatus, bool) { + if o == nil { + return nil, false + } + return &o.Status, true +} + +// SetStatus sets field value +func (o *Run) SetStatus(v ActorJobStatus) { + o.Status = v +} + +// GetStatusMessage returns the StatusMessage field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Run) GetStatusMessage() string { + if o == nil || IsNil(o.StatusMessage.Get()) { + var ret string + return ret + } + return *o.StatusMessage.Get() +} + +// GetStatusMessageOk returns a tuple with the StatusMessage field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Run) GetStatusMessageOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.StatusMessage.Get(), o.StatusMessage.IsSet() +} + +// HasStatusMessage returns a boolean if a field has been set. +func (o *Run) HasStatusMessage() bool { + if o != nil && o.StatusMessage.IsSet() { + return true + } + + return false +} + +// SetStatusMessage gets a reference to the given NullableString and assigns it to the StatusMessage field. +func (o *Run) SetStatusMessage(v string) { + o.StatusMessage.Set(&v) +} +// SetStatusMessageNil sets the value for StatusMessage to be an explicit nil +func (o *Run) SetStatusMessageNil() { + o.StatusMessage.Set(nil) +} + +// UnsetStatusMessage ensures that no value is present for StatusMessage, not even an explicit nil +func (o *Run) UnsetStatusMessage() { + o.StatusMessage.Unset() +} + +// GetIsStatusMessageTerminal returns the IsStatusMessageTerminal field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Run) GetIsStatusMessageTerminal() bool { + if o == nil || IsNil(o.IsStatusMessageTerminal.Get()) { + var ret bool + return ret + } + return *o.IsStatusMessageTerminal.Get() +} + +// GetIsStatusMessageTerminalOk returns a tuple with the IsStatusMessageTerminal field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Run) GetIsStatusMessageTerminalOk() (*bool, bool) { + if o == nil { + return nil, false + } + return o.IsStatusMessageTerminal.Get(), o.IsStatusMessageTerminal.IsSet() +} + +// HasIsStatusMessageTerminal returns a boolean if a field has been set. +func (o *Run) HasIsStatusMessageTerminal() bool { + if o != nil && o.IsStatusMessageTerminal.IsSet() { + return true + } + + return false +} + +// SetIsStatusMessageTerminal gets a reference to the given NullableBool and assigns it to the IsStatusMessageTerminal field. +func (o *Run) SetIsStatusMessageTerminal(v bool) { + o.IsStatusMessageTerminal.Set(&v) +} +// SetIsStatusMessageTerminalNil sets the value for IsStatusMessageTerminal to be an explicit nil +func (o *Run) SetIsStatusMessageTerminalNil() { + o.IsStatusMessageTerminal.Set(nil) +} + +// UnsetIsStatusMessageTerminal ensures that no value is present for IsStatusMessageTerminal, not even an explicit nil +func (o *Run) UnsetIsStatusMessageTerminal() { + o.IsStatusMessageTerminal.Unset() +} + +// GetMeta returns the Meta field value +func (o *Run) GetMeta() RunMeta { + if o == nil { + var ret RunMeta + return ret + } + + return o.Meta +} + +// GetMetaOk returns a tuple with the Meta field value +// and a boolean to check if the value has been set. +func (o *Run) GetMetaOk() (*RunMeta, bool) { + if o == nil { + return nil, false + } + return &o.Meta, true +} + +// SetMeta sets field value +func (o *Run) SetMeta(v RunMeta) { + o.Meta = v +} + +// GetPricingInfo returns the PricingInfo field value if set, zero value otherwise. +func (o *Run) GetPricingInfo() ActorRunPricingInfo { + if o == nil || IsNil(o.PricingInfo) { + var ret ActorRunPricingInfo + return ret + } + return *o.PricingInfo +} + +// GetPricingInfoOk returns a tuple with the PricingInfo field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Run) GetPricingInfoOk() (*ActorRunPricingInfo, bool) { + if o == nil || IsNil(o.PricingInfo) { + return nil, false + } + return o.PricingInfo, true +} + +// HasPricingInfo returns a boolean if a field has been set. +func (o *Run) HasPricingInfo() bool { + if o != nil && !IsNil(o.PricingInfo) { + return true + } + + return false +} + +// SetPricingInfo gets a reference to the given ActorRunPricingInfo and assigns it to the PricingInfo field. +func (o *Run) SetPricingInfo(v ActorRunPricingInfo) { + o.PricingInfo = &v +} + +// GetStats returns the Stats field value +func (o *Run) GetStats() RunStats { + if o == nil { + var ret RunStats + return ret + } + + return o.Stats +} + +// GetStatsOk returns a tuple with the Stats field value +// and a boolean to check if the value has been set. +func (o *Run) GetStatsOk() (*RunStats, bool) { + if o == nil { + return nil, false + } + return &o.Stats, true +} + +// SetStats sets field value +func (o *Run) SetStats(v RunStats) { + o.Stats = v +} + +// GetChargedEventCounts returns the ChargedEventCounts field value if set, zero value otherwise. +func (o *Run) GetChargedEventCounts() map[string]int32 { + if o == nil || IsNil(o.ChargedEventCounts) { + var ret map[string]int32 + return ret + } + return o.ChargedEventCounts +} + +// GetChargedEventCountsOk returns a tuple with the ChargedEventCounts field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Run) GetChargedEventCountsOk() (map[string]int32, bool) { + if o == nil || IsNil(o.ChargedEventCounts) { + return map[string]int32{}, false + } + return o.ChargedEventCounts, true +} + +// HasChargedEventCounts returns a boolean if a field has been set. +func (o *Run) HasChargedEventCounts() bool { + if o != nil && !IsNil(o.ChargedEventCounts) { + return true + } + + return false +} + +// SetChargedEventCounts gets a reference to the given map[string]int32 and assigns it to the ChargedEventCounts field. +func (o *Run) SetChargedEventCounts(v map[string]int32) { + o.ChargedEventCounts = v +} + +// GetOptions returns the Options field value +func (o *Run) GetOptions() RunOptions { + if o == nil { + var ret RunOptions + return ret + } + + return o.Options +} + +// GetOptionsOk returns a tuple with the Options field value +// and a boolean to check if the value has been set. +func (o *Run) GetOptionsOk() (*RunOptions, bool) { + if o == nil { + return nil, false + } + return &o.Options, true +} + +// SetOptions sets field value +func (o *Run) SetOptions(v RunOptions) { + o.Options = v +} + +// GetBuildId returns the BuildId field value +func (o *Run) GetBuildId() string { + if o == nil { + var ret string + return ret + } + + return o.BuildId +} + +// GetBuildIdOk returns a tuple with the BuildId field value +// and a boolean to check if the value has been set. +func (o *Run) GetBuildIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.BuildId, true +} + +// SetBuildId sets field value +func (o *Run) SetBuildId(v string) { + o.BuildId = v +} + +// GetExitCode returns the ExitCode field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Run) GetExitCode() int32 { + if o == nil || IsNil(o.ExitCode.Get()) { + var ret int32 + return ret + } + return *o.ExitCode.Get() +} + +// GetExitCodeOk returns a tuple with the ExitCode field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Run) GetExitCodeOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.ExitCode.Get(), o.ExitCode.IsSet() +} + +// HasExitCode returns a boolean if a field has been set. +func (o *Run) HasExitCode() bool { + if o != nil && o.ExitCode.IsSet() { + return true + } + + return false +} + +// SetExitCode gets a reference to the given NullableInt32 and assigns it to the ExitCode field. +func (o *Run) SetExitCode(v int32) { + o.ExitCode.Set(&v) +} +// SetExitCodeNil sets the value for ExitCode to be an explicit nil +func (o *Run) SetExitCodeNil() { + o.ExitCode.Set(nil) +} + +// UnsetExitCode ensures that no value is present for ExitCode, not even an explicit nil +func (o *Run) UnsetExitCode() { + o.ExitCode.Unset() +} + +// GetGeneralAccess returns the GeneralAccess field value +func (o *Run) GetGeneralAccess() GeneralAccess { + if o == nil { + var ret GeneralAccess + return ret + } + + return o.GeneralAccess +} + +// GetGeneralAccessOk returns a tuple with the GeneralAccess field value +// and a boolean to check if the value has been set. +func (o *Run) GetGeneralAccessOk() (*GeneralAccess, bool) { + if o == nil { + return nil, false + } + return &o.GeneralAccess, true +} + +// SetGeneralAccess sets field value +func (o *Run) SetGeneralAccess(v GeneralAccess) { + o.GeneralAccess = v +} + +// GetDefaultKeyValueStoreId returns the DefaultKeyValueStoreId field value +func (o *Run) GetDefaultKeyValueStoreId() string { + if o == nil { + var ret string + return ret + } + + return o.DefaultKeyValueStoreId +} + +// GetDefaultKeyValueStoreIdOk returns a tuple with the DefaultKeyValueStoreId field value +// and a boolean to check if the value has been set. +func (o *Run) GetDefaultKeyValueStoreIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.DefaultKeyValueStoreId, true +} + +// SetDefaultKeyValueStoreId sets field value +func (o *Run) SetDefaultKeyValueStoreId(v string) { + o.DefaultKeyValueStoreId = v +} + +// GetDefaultDatasetId returns the DefaultDatasetId field value +func (o *Run) GetDefaultDatasetId() string { + if o == nil { + var ret string + return ret + } + + return o.DefaultDatasetId +} + +// GetDefaultDatasetIdOk returns a tuple with the DefaultDatasetId field value +// and a boolean to check if the value has been set. +func (o *Run) GetDefaultDatasetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.DefaultDatasetId, true +} + +// SetDefaultDatasetId sets field value +func (o *Run) SetDefaultDatasetId(v string) { + o.DefaultDatasetId = v +} + +// GetDefaultRequestQueueId returns the DefaultRequestQueueId field value +func (o *Run) GetDefaultRequestQueueId() string { + if o == nil { + var ret string + return ret + } + + return o.DefaultRequestQueueId +} + +// GetDefaultRequestQueueIdOk returns a tuple with the DefaultRequestQueueId field value +// and a boolean to check if the value has been set. +func (o *Run) GetDefaultRequestQueueIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.DefaultRequestQueueId, true +} + +// SetDefaultRequestQueueId sets field value +func (o *Run) SetDefaultRequestQueueId(v string) { + o.DefaultRequestQueueId = v +} + +// GetStorageIds returns the StorageIds field value if set, zero value otherwise. +func (o *Run) GetStorageIds() RunStorageIds { + if o == nil || IsNil(o.StorageIds) { + var ret RunStorageIds + return ret + } + return *o.StorageIds +} + +// GetStorageIdsOk returns a tuple with the StorageIds field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Run) GetStorageIdsOk() (*RunStorageIds, bool) { + if o == nil || IsNil(o.StorageIds) { + return nil, false + } + return o.StorageIds, true +} + +// HasStorageIds returns a boolean if a field has been set. +func (o *Run) HasStorageIds() bool { + if o != nil && !IsNil(o.StorageIds) { + return true + } + + return false +} + +// SetStorageIds gets a reference to the given RunStorageIds and assigns it to the StorageIds field. +func (o *Run) SetStorageIds(v RunStorageIds) { + o.StorageIds = &v +} + +// GetBuildNumber returns the BuildNumber field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Run) GetBuildNumber() string { + if o == nil || IsNil(o.BuildNumber.Get()) { + var ret string + return ret + } + return *o.BuildNumber.Get() +} + +// GetBuildNumberOk returns a tuple with the BuildNumber field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Run) GetBuildNumberOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.BuildNumber.Get(), o.BuildNumber.IsSet() +} + +// HasBuildNumber returns a boolean if a field has been set. +func (o *Run) HasBuildNumber() bool { + if o != nil && o.BuildNumber.IsSet() { + return true + } + + return false +} + +// SetBuildNumber gets a reference to the given NullableString and assigns it to the BuildNumber field. +func (o *Run) SetBuildNumber(v string) { + o.BuildNumber.Set(&v) +} +// SetBuildNumberNil sets the value for BuildNumber to be an explicit nil +func (o *Run) SetBuildNumberNil() { + o.BuildNumber.Set(nil) +} + +// UnsetBuildNumber ensures that no value is present for BuildNumber, not even an explicit nil +func (o *Run) UnsetBuildNumber() { + o.BuildNumber.Unset() +} + +// GetContainerUrl returns the ContainerUrl field value if set, zero value otherwise. +func (o *Run) GetContainerUrl() string { + if o == nil || IsNil(o.ContainerUrl) { + var ret string + return ret + } + return *o.ContainerUrl +} + +// GetContainerUrlOk returns a tuple with the ContainerUrl field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Run) GetContainerUrlOk() (*string, bool) { + if o == nil || IsNil(o.ContainerUrl) { + return nil, false + } + return o.ContainerUrl, true +} + +// HasContainerUrl returns a boolean if a field has been set. +func (o *Run) HasContainerUrl() bool { + if o != nil && !IsNil(o.ContainerUrl) { + return true + } + + return false +} + +// SetContainerUrl gets a reference to the given string and assigns it to the ContainerUrl field. +func (o *Run) SetContainerUrl(v string) { + o.ContainerUrl = &v +} + +// GetIsContainerServerReady returns the IsContainerServerReady field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Run) GetIsContainerServerReady() bool { + if o == nil || IsNil(o.IsContainerServerReady.Get()) { + var ret bool + return ret + } + return *o.IsContainerServerReady.Get() +} + +// GetIsContainerServerReadyOk returns a tuple with the IsContainerServerReady field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Run) GetIsContainerServerReadyOk() (*bool, bool) { + if o == nil { + return nil, false + } + return o.IsContainerServerReady.Get(), o.IsContainerServerReady.IsSet() +} + +// HasIsContainerServerReady returns a boolean if a field has been set. +func (o *Run) HasIsContainerServerReady() bool { + if o != nil && o.IsContainerServerReady.IsSet() { + return true + } + + return false +} + +// SetIsContainerServerReady gets a reference to the given NullableBool and assigns it to the IsContainerServerReady field. +func (o *Run) SetIsContainerServerReady(v bool) { + o.IsContainerServerReady.Set(&v) +} +// SetIsContainerServerReadyNil sets the value for IsContainerServerReady to be an explicit nil +func (o *Run) SetIsContainerServerReadyNil() { + o.IsContainerServerReady.Set(nil) +} + +// UnsetIsContainerServerReady ensures that no value is present for IsContainerServerReady, not even an explicit nil +func (o *Run) UnsetIsContainerServerReady() { + o.IsContainerServerReady.Unset() +} + +// GetGitBranchName returns the GitBranchName field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Run) GetGitBranchName() string { + if o == nil || IsNil(o.GitBranchName.Get()) { + var ret string + return ret + } + return *o.GitBranchName.Get() +} + +// GetGitBranchNameOk returns a tuple with the GitBranchName field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Run) GetGitBranchNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.GitBranchName.Get(), o.GitBranchName.IsSet() +} + +// HasGitBranchName returns a boolean if a field has been set. +func (o *Run) HasGitBranchName() bool { + if o != nil && o.GitBranchName.IsSet() { + return true + } + + return false +} + +// SetGitBranchName gets a reference to the given NullableString and assigns it to the GitBranchName field. +func (o *Run) SetGitBranchName(v string) { + o.GitBranchName.Set(&v) +} +// SetGitBranchNameNil sets the value for GitBranchName to be an explicit nil +func (o *Run) SetGitBranchNameNil() { + o.GitBranchName.Set(nil) +} + +// UnsetGitBranchName ensures that no value is present for GitBranchName, not even an explicit nil +func (o *Run) UnsetGitBranchName() { + o.GitBranchName.Unset() +} + +// GetUsage returns the Usage field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Run) GetUsage() RunUsage { + if o == nil || IsNil(o.Usage.Get()) { + var ret RunUsage + return ret + } + return *o.Usage.Get() +} + +// GetUsageOk returns a tuple with the Usage field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Run) GetUsageOk() (*RunUsage, bool) { + if o == nil { + return nil, false + } + return o.Usage.Get(), o.Usage.IsSet() +} + +// HasUsage returns a boolean if a field has been set. +func (o *Run) HasUsage() bool { + if o != nil && o.Usage.IsSet() { + return true + } + + return false +} + +// SetUsage gets a reference to the given NullableRunUsage and assigns it to the Usage field. +func (o *Run) SetUsage(v RunUsage) { + o.Usage.Set(&v) +} +// SetUsageNil sets the value for Usage to be an explicit nil +func (o *Run) SetUsageNil() { + o.Usage.Set(nil) +} + +// UnsetUsage ensures that no value is present for Usage, not even an explicit nil +func (o *Run) UnsetUsage() { + o.Usage.Unset() +} + +// GetUsageTotalUsd returns the UsageTotalUsd field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Run) GetUsageTotalUsd() float32 { + if o == nil || IsNil(o.UsageTotalUsd.Get()) { + var ret float32 + return ret + } + return *o.UsageTotalUsd.Get() +} + +// GetUsageTotalUsdOk returns a tuple with the UsageTotalUsd field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Run) GetUsageTotalUsdOk() (*float32, bool) { + if o == nil { + return nil, false + } + return o.UsageTotalUsd.Get(), o.UsageTotalUsd.IsSet() +} + +// HasUsageTotalUsd returns a boolean if a field has been set. +func (o *Run) HasUsageTotalUsd() bool { + if o != nil && o.UsageTotalUsd.IsSet() { + return true + } + + return false +} + +// SetUsageTotalUsd gets a reference to the given NullableFloat32 and assigns it to the UsageTotalUsd field. +func (o *Run) SetUsageTotalUsd(v float32) { + o.UsageTotalUsd.Set(&v) +} +// SetUsageTotalUsdNil sets the value for UsageTotalUsd to be an explicit nil +func (o *Run) SetUsageTotalUsdNil() { + o.UsageTotalUsd.Set(nil) +} + +// UnsetUsageTotalUsd ensures that no value is present for UsageTotalUsd, not even an explicit nil +func (o *Run) UnsetUsageTotalUsd() { + o.UsageTotalUsd.Unset() +} + +// GetUsageUsd returns the UsageUsd field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Run) GetUsageUsd() RunUsageUsd { + if o == nil || IsNil(o.UsageUsd.Get()) { + var ret RunUsageUsd + return ret + } + return *o.UsageUsd.Get() +} + +// GetUsageUsdOk returns a tuple with the UsageUsd field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Run) GetUsageUsdOk() (*RunUsageUsd, bool) { + if o == nil { + return nil, false + } + return o.UsageUsd.Get(), o.UsageUsd.IsSet() +} + +// HasUsageUsd returns a boolean if a field has been set. +func (o *Run) HasUsageUsd() bool { + if o != nil && o.UsageUsd.IsSet() { + return true + } + + return false +} + +// SetUsageUsd gets a reference to the given NullableRunUsageUsd and assigns it to the UsageUsd field. +func (o *Run) SetUsageUsd(v RunUsageUsd) { + o.UsageUsd.Set(&v) +} +// SetUsageUsdNil sets the value for UsageUsd to be an explicit nil +func (o *Run) SetUsageUsdNil() { + o.UsageUsd.Set(nil) +} + +// UnsetUsageUsd ensures that no value is present for UsageUsd, not even an explicit nil +func (o *Run) UnsetUsageUsd() { + o.UsageUsd.Unset() +} + +// GetMetamorphs returns the Metamorphs field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Run) GetMetamorphs() []Metamorph { + if o == nil { + var ret []Metamorph + return ret + } + return o.Metamorphs +} + +// GetMetamorphsOk returns a tuple with the Metamorphs field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Run) GetMetamorphsOk() ([]Metamorph, bool) { + if o == nil || IsNil(o.Metamorphs) { + return nil, false + } + return o.Metamorphs, true +} + +// HasMetamorphs returns a boolean if a field has been set. +func (o *Run) HasMetamorphs() bool { + if o != nil && !IsNil(o.Metamorphs) { + return true + } + + return false +} + +// SetMetamorphs gets a reference to the given []Metamorph and assigns it to the Metamorphs field. +func (o *Run) SetMetamorphs(v []Metamorph) { + o.Metamorphs = v +} + +// GetPlatformUsageBillingModel returns the PlatformUsageBillingModel field value if set, zero value otherwise. +func (o *Run) GetPlatformUsageBillingModel() string { + if o == nil || IsNil(o.PlatformUsageBillingModel) { + var ret string + return ret + } + return *o.PlatformUsageBillingModel +} + +// GetPlatformUsageBillingModelOk returns a tuple with the PlatformUsageBillingModel field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Run) GetPlatformUsageBillingModelOk() (*string, bool) { + if o == nil || IsNil(o.PlatformUsageBillingModel) { + return nil, false + } + return o.PlatformUsageBillingModel, true +} + +// HasPlatformUsageBillingModel returns a boolean if a field has been set. +func (o *Run) HasPlatformUsageBillingModel() bool { + if o != nil && !IsNil(o.PlatformUsageBillingModel) { + return true + } + + return false +} + +// SetPlatformUsageBillingModel gets a reference to the given string and assigns it to the PlatformUsageBillingModel field. +func (o *Run) SetPlatformUsageBillingModel(v string) { + o.PlatformUsageBillingModel = &v +} + +func (o Run) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Run) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["actId"] = o.ActId + toSerialize["userId"] = o.UserId + if o.ActorTaskId.IsSet() { + toSerialize["actorTaskId"] = o.ActorTaskId.Get() + } + toSerialize["startedAt"] = o.StartedAt + if o.FinishedAt.IsSet() { + toSerialize["finishedAt"] = o.FinishedAt.Get() + } + toSerialize["status"] = o.Status + if o.StatusMessage.IsSet() { + toSerialize["statusMessage"] = o.StatusMessage.Get() + } + if o.IsStatusMessageTerminal.IsSet() { + toSerialize["isStatusMessageTerminal"] = o.IsStatusMessageTerminal.Get() + } + toSerialize["meta"] = o.Meta + if !IsNil(o.PricingInfo) { + toSerialize["pricingInfo"] = o.PricingInfo + } + toSerialize["stats"] = o.Stats + if !IsNil(o.ChargedEventCounts) { + toSerialize["chargedEventCounts"] = o.ChargedEventCounts + } + toSerialize["options"] = o.Options + toSerialize["buildId"] = o.BuildId + if o.ExitCode.IsSet() { + toSerialize["exitCode"] = o.ExitCode.Get() + } + toSerialize["generalAccess"] = o.GeneralAccess + toSerialize["defaultKeyValueStoreId"] = o.DefaultKeyValueStoreId + toSerialize["defaultDatasetId"] = o.DefaultDatasetId + toSerialize["defaultRequestQueueId"] = o.DefaultRequestQueueId + if !IsNil(o.StorageIds) { + toSerialize["storageIds"] = o.StorageIds + } + if o.BuildNumber.IsSet() { + toSerialize["buildNumber"] = o.BuildNumber.Get() + } + if !IsNil(o.ContainerUrl) { + toSerialize["containerUrl"] = o.ContainerUrl + } + if o.IsContainerServerReady.IsSet() { + toSerialize["isContainerServerReady"] = o.IsContainerServerReady.Get() + } + if o.GitBranchName.IsSet() { + toSerialize["gitBranchName"] = o.GitBranchName.Get() + } + if o.Usage.IsSet() { + toSerialize["usage"] = o.Usage.Get() + } + if o.UsageTotalUsd.IsSet() { + toSerialize["usageTotalUsd"] = o.UsageTotalUsd.Get() + } + if o.UsageUsd.IsSet() { + toSerialize["usageUsd"] = o.UsageUsd.Get() + } + if o.Metamorphs != nil { + toSerialize["metamorphs"] = o.Metamorphs + } + if !IsNil(o.PlatformUsageBillingModel) { + toSerialize["platformUsageBillingModel"] = o.PlatformUsageBillingModel + } + return toSerialize, nil +} + +func (o *Run) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "actId", + "userId", + "startedAt", + "status", + "meta", + "stats", + "options", + "buildId", + "generalAccess", + "defaultKeyValueStoreId", + "defaultDatasetId", + "defaultRequestQueueId", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varRun := _Run{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varRun) + + if err != nil { + return err + } + + *o = Run(varRun) + + return err +} + +type NullableRun struct { + value *Run + isSet bool +} + +func (v NullableRun) Get() *Run { + return v.value +} + +func (v *NullableRun) Set(val *Run) { + v.value = val + v.isSet = true +} + +func (v NullableRun) IsSet() bool { + return v.isSet +} + +func (v *NullableRun) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRun(val *Run) *NullableRun { + return &NullableRun{value: val, isSet: true} +} + +func (v NullableRun) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRun) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_run_failed_error_detail.go b/model_run_failed_error_detail.go new file mode 100644 index 0000000..dd97fbb --- /dev/null +++ b/model_run_failed_error_detail.go @@ -0,0 +1,164 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" +) + +// checks if the RunFailedErrorDetail type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RunFailedErrorDetail{} + +// RunFailedErrorDetail struct for RunFailedErrorDetail +type RunFailedErrorDetail struct { + Type interface{} `json:"type,omitempty"` + // Human-readable error message describing what went wrong. + Message *string `json:"message,omitempty"` +} + +// NewRunFailedErrorDetail instantiates a new RunFailedErrorDetail object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewRunFailedErrorDetail() *RunFailedErrorDetail { + this := RunFailedErrorDetail{} + return &this +} + +// NewRunFailedErrorDetailWithDefaults instantiates a new RunFailedErrorDetail object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRunFailedErrorDetailWithDefaults() *RunFailedErrorDetail { + this := RunFailedErrorDetail{} + return &this +} + +// GetType returns the Type field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *RunFailedErrorDetail) GetType() interface{} { + if o == nil { + var ret interface{} + return ret + } + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *RunFailedErrorDetail) GetTypeOk() (*interface{}, bool) { + if o == nil || IsNil(o.Type) { + return nil, false + } + return &o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *RunFailedErrorDetail) HasType() bool { + if o != nil && !IsNil(o.Type) { + return true + } + + return false +} + +// SetType gets a reference to the given interface{} and assigns it to the Type field. +func (o *RunFailedErrorDetail) SetType(v interface{}) { + o.Type = v +} + +// GetMessage returns the Message field value if set, zero value otherwise. +func (o *RunFailedErrorDetail) GetMessage() string { + if o == nil || IsNil(o.Message) { + var ret string + return ret + } + return *o.Message +} + +// GetMessageOk returns a tuple with the Message field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RunFailedErrorDetail) GetMessageOk() (*string, bool) { + if o == nil || IsNil(o.Message) { + return nil, false + } + return o.Message, true +} + +// HasMessage returns a boolean if a field has been set. +func (o *RunFailedErrorDetail) HasMessage() bool { + if o != nil && !IsNil(o.Message) { + return true + } + + return false +} + +// SetMessage gets a reference to the given string and assigns it to the Message field. +func (o *RunFailedErrorDetail) SetMessage(v string) { + o.Message = &v +} + +func (o RunFailedErrorDetail) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o RunFailedErrorDetail) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.Type != nil { + toSerialize["type"] = o.Type + } + if !IsNil(o.Message) { + toSerialize["message"] = o.Message + } + return toSerialize, nil +} + +type NullableRunFailedErrorDetail struct { + value *RunFailedErrorDetail + isSet bool +} + +func (v NullableRunFailedErrorDetail) Get() *RunFailedErrorDetail { + return v.value +} + +func (v *NullableRunFailedErrorDetail) Set(val *RunFailedErrorDetail) { + v.value = val + v.isSet = true +} + +func (v NullableRunFailedErrorDetail) IsSet() bool { + return v.isSet +} + +func (v *NullableRunFailedErrorDetail) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRunFailedErrorDetail(val *RunFailedErrorDetail) *NullableRunFailedErrorDetail { + return &NullableRunFailedErrorDetail{value: val, isSet: true} +} + +func (v NullableRunFailedErrorDetail) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRunFailedErrorDetail) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_run_meta.go b/model_run_meta.go new file mode 100644 index 0000000..53602b8 --- /dev/null +++ b/model_run_meta.go @@ -0,0 +1,347 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" + "time" + "bytes" + "fmt" +) + +// checks if the RunMeta type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RunMeta{} + +// RunMeta struct for RunMeta +type RunMeta struct { + Origin RunOrigin `json:"origin"` + // IP address of the client that started the run. + ClientIp NullableString `json:"clientIp,omitempty"` + // User agent of the client that started the run. + UserAgent NullableString `json:"userAgent,omitempty"` + // ID of the schedule that triggered the run. + ScheduleId NullableString `json:"scheduleId,omitempty"` + // Time when the run was scheduled. + ScheduledAt NullableTime `json:"scheduledAt,omitempty"` +} + +type _RunMeta RunMeta + +// NewRunMeta instantiates a new RunMeta object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewRunMeta(origin RunOrigin) *RunMeta { + this := RunMeta{} + this.Origin = origin + return &this +} + +// NewRunMetaWithDefaults instantiates a new RunMeta object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRunMetaWithDefaults() *RunMeta { + this := RunMeta{} + return &this +} + +// GetOrigin returns the Origin field value +func (o *RunMeta) GetOrigin() RunOrigin { + if o == nil { + var ret RunOrigin + return ret + } + + return o.Origin +} + +// GetOriginOk returns a tuple with the Origin field value +// and a boolean to check if the value has been set. +func (o *RunMeta) GetOriginOk() (*RunOrigin, bool) { + if o == nil { + return nil, false + } + return &o.Origin, true +} + +// SetOrigin sets field value +func (o *RunMeta) SetOrigin(v RunOrigin) { + o.Origin = v +} + +// GetClientIp returns the ClientIp field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *RunMeta) GetClientIp() string { + if o == nil || IsNil(o.ClientIp.Get()) { + var ret string + return ret + } + return *o.ClientIp.Get() +} + +// GetClientIpOk returns a tuple with the ClientIp field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *RunMeta) GetClientIpOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.ClientIp.Get(), o.ClientIp.IsSet() +} + +// HasClientIp returns a boolean if a field has been set. +func (o *RunMeta) HasClientIp() bool { + if o != nil && o.ClientIp.IsSet() { + return true + } + + return false +} + +// SetClientIp gets a reference to the given NullableString and assigns it to the ClientIp field. +func (o *RunMeta) SetClientIp(v string) { + o.ClientIp.Set(&v) +} +// SetClientIpNil sets the value for ClientIp to be an explicit nil +func (o *RunMeta) SetClientIpNil() { + o.ClientIp.Set(nil) +} + +// UnsetClientIp ensures that no value is present for ClientIp, not even an explicit nil +func (o *RunMeta) UnsetClientIp() { + o.ClientIp.Unset() +} + +// GetUserAgent returns the UserAgent field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *RunMeta) GetUserAgent() string { + if o == nil || IsNil(o.UserAgent.Get()) { + var ret string + return ret + } + return *o.UserAgent.Get() +} + +// GetUserAgentOk returns a tuple with the UserAgent field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *RunMeta) GetUserAgentOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.UserAgent.Get(), o.UserAgent.IsSet() +} + +// HasUserAgent returns a boolean if a field has been set. +func (o *RunMeta) HasUserAgent() bool { + if o != nil && o.UserAgent.IsSet() { + return true + } + + return false +} + +// SetUserAgent gets a reference to the given NullableString and assigns it to the UserAgent field. +func (o *RunMeta) SetUserAgent(v string) { + o.UserAgent.Set(&v) +} +// SetUserAgentNil sets the value for UserAgent to be an explicit nil +func (o *RunMeta) SetUserAgentNil() { + o.UserAgent.Set(nil) +} + +// UnsetUserAgent ensures that no value is present for UserAgent, not even an explicit nil +func (o *RunMeta) UnsetUserAgent() { + o.UserAgent.Unset() +} + +// GetScheduleId returns the ScheduleId field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *RunMeta) GetScheduleId() string { + if o == nil || IsNil(o.ScheduleId.Get()) { + var ret string + return ret + } + return *o.ScheduleId.Get() +} + +// GetScheduleIdOk returns a tuple with the ScheduleId field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *RunMeta) GetScheduleIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.ScheduleId.Get(), o.ScheduleId.IsSet() +} + +// HasScheduleId returns a boolean if a field has been set. +func (o *RunMeta) HasScheduleId() bool { + if o != nil && o.ScheduleId.IsSet() { + return true + } + + return false +} + +// SetScheduleId gets a reference to the given NullableString and assigns it to the ScheduleId field. +func (o *RunMeta) SetScheduleId(v string) { + o.ScheduleId.Set(&v) +} +// SetScheduleIdNil sets the value for ScheduleId to be an explicit nil +func (o *RunMeta) SetScheduleIdNil() { + o.ScheduleId.Set(nil) +} + +// UnsetScheduleId ensures that no value is present for ScheduleId, not even an explicit nil +func (o *RunMeta) UnsetScheduleId() { + o.ScheduleId.Unset() +} + +// GetScheduledAt returns the ScheduledAt field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *RunMeta) GetScheduledAt() time.Time { + if o == nil || IsNil(o.ScheduledAt.Get()) { + var ret time.Time + return ret + } + return *o.ScheduledAt.Get() +} + +// GetScheduledAtOk returns a tuple with the ScheduledAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *RunMeta) GetScheduledAtOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.ScheduledAt.Get(), o.ScheduledAt.IsSet() +} + +// HasScheduledAt returns a boolean if a field has been set. +func (o *RunMeta) HasScheduledAt() bool { + if o != nil && o.ScheduledAt.IsSet() { + return true + } + + return false +} + +// SetScheduledAt gets a reference to the given NullableTime and assigns it to the ScheduledAt field. +func (o *RunMeta) SetScheduledAt(v time.Time) { + o.ScheduledAt.Set(&v) +} +// SetScheduledAtNil sets the value for ScheduledAt to be an explicit nil +func (o *RunMeta) SetScheduledAtNil() { + o.ScheduledAt.Set(nil) +} + +// UnsetScheduledAt ensures that no value is present for ScheduledAt, not even an explicit nil +func (o *RunMeta) UnsetScheduledAt() { + o.ScheduledAt.Unset() +} + +func (o RunMeta) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o RunMeta) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["origin"] = o.Origin + if o.ClientIp.IsSet() { + toSerialize["clientIp"] = o.ClientIp.Get() + } + if o.UserAgent.IsSet() { + toSerialize["userAgent"] = o.UserAgent.Get() + } + if o.ScheduleId.IsSet() { + toSerialize["scheduleId"] = o.ScheduleId.Get() + } + if o.ScheduledAt.IsSet() { + toSerialize["scheduledAt"] = o.ScheduledAt.Get() + } + return toSerialize, nil +} + +func (o *RunMeta) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "origin", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varRunMeta := _RunMeta{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varRunMeta) + + if err != nil { + return err + } + + *o = RunMeta(varRunMeta) + + return err +} + +type NullableRunMeta struct { + value *RunMeta + isSet bool +} + +func (v NullableRunMeta) Get() *RunMeta { + return v.value +} + +func (v *NullableRunMeta) Set(val *RunMeta) { + v.value = val + v.isSet = true +} + +func (v NullableRunMeta) IsSet() bool { + return v.isSet +} + +func (v *NullableRunMeta) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRunMeta(val *RunMeta) *NullableRunMeta { + return &NullableRunMeta{value: val, isSet: true} +} + +func (v NullableRunMeta) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRunMeta) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_run_options.go b/model_run_options.go new file mode 100644 index 0000000..aa0d4aa --- /dev/null +++ b/model_run_options.go @@ -0,0 +1,324 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" + "bytes" + "fmt" +) + +// checks if the RunOptions type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RunOptions{} + +// RunOptions struct for RunOptions +type RunOptions struct { + Build string `json:"build"` + TimeoutSecs int32 `json:"timeoutSecs"` + MemoryMbytes int32 `json:"memoryMbytes"` + DiskMbytes int32 `json:"diskMbytes"` + MaxItems NullableInt32 `json:"maxItems,omitempty"` + MaxTotalChargeUsd *float32 `json:"maxTotalChargeUsd,omitempty"` +} + +type _RunOptions RunOptions + +// NewRunOptions instantiates a new RunOptions object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewRunOptions(build string, timeoutSecs int32, memoryMbytes int32, diskMbytes int32) *RunOptions { + this := RunOptions{} + this.Build = build + this.TimeoutSecs = timeoutSecs + this.MemoryMbytes = memoryMbytes + this.DiskMbytes = diskMbytes + return &this +} + +// NewRunOptionsWithDefaults instantiates a new RunOptions object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRunOptionsWithDefaults() *RunOptions { + this := RunOptions{} + return &this +} + +// GetBuild returns the Build field value +func (o *RunOptions) GetBuild() string { + if o == nil { + var ret string + return ret + } + + return o.Build +} + +// GetBuildOk returns a tuple with the Build field value +// and a boolean to check if the value has been set. +func (o *RunOptions) GetBuildOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Build, true +} + +// SetBuild sets field value +func (o *RunOptions) SetBuild(v string) { + o.Build = v +} + +// GetTimeoutSecs returns the TimeoutSecs field value +func (o *RunOptions) GetTimeoutSecs() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.TimeoutSecs +} + +// GetTimeoutSecsOk returns a tuple with the TimeoutSecs field value +// and a boolean to check if the value has been set. +func (o *RunOptions) GetTimeoutSecsOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.TimeoutSecs, true +} + +// SetTimeoutSecs sets field value +func (o *RunOptions) SetTimeoutSecs(v int32) { + o.TimeoutSecs = v +} + +// GetMemoryMbytes returns the MemoryMbytes field value +func (o *RunOptions) GetMemoryMbytes() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.MemoryMbytes +} + +// GetMemoryMbytesOk returns a tuple with the MemoryMbytes field value +// and a boolean to check if the value has been set. +func (o *RunOptions) GetMemoryMbytesOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.MemoryMbytes, true +} + +// SetMemoryMbytes sets field value +func (o *RunOptions) SetMemoryMbytes(v int32) { + o.MemoryMbytes = v +} + +// GetDiskMbytes returns the DiskMbytes field value +func (o *RunOptions) GetDiskMbytes() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.DiskMbytes +} + +// GetDiskMbytesOk returns a tuple with the DiskMbytes field value +// and a boolean to check if the value has been set. +func (o *RunOptions) GetDiskMbytesOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.DiskMbytes, true +} + +// SetDiskMbytes sets field value +func (o *RunOptions) SetDiskMbytes(v int32) { + o.DiskMbytes = v +} + +// GetMaxItems returns the MaxItems field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *RunOptions) GetMaxItems() int32 { + if o == nil || IsNil(o.MaxItems.Get()) { + var ret int32 + return ret + } + return *o.MaxItems.Get() +} + +// GetMaxItemsOk returns a tuple with the MaxItems field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *RunOptions) GetMaxItemsOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.MaxItems.Get(), o.MaxItems.IsSet() +} + +// HasMaxItems returns a boolean if a field has been set. +func (o *RunOptions) HasMaxItems() bool { + if o != nil && o.MaxItems.IsSet() { + return true + } + + return false +} + +// SetMaxItems gets a reference to the given NullableInt32 and assigns it to the MaxItems field. +func (o *RunOptions) SetMaxItems(v int32) { + o.MaxItems.Set(&v) +} +// SetMaxItemsNil sets the value for MaxItems to be an explicit nil +func (o *RunOptions) SetMaxItemsNil() { + o.MaxItems.Set(nil) +} + +// UnsetMaxItems ensures that no value is present for MaxItems, not even an explicit nil +func (o *RunOptions) UnsetMaxItems() { + o.MaxItems.Unset() +} + +// GetMaxTotalChargeUsd returns the MaxTotalChargeUsd field value if set, zero value otherwise. +func (o *RunOptions) GetMaxTotalChargeUsd() float32 { + if o == nil || IsNil(o.MaxTotalChargeUsd) { + var ret float32 + return ret + } + return *o.MaxTotalChargeUsd +} + +// GetMaxTotalChargeUsdOk returns a tuple with the MaxTotalChargeUsd field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RunOptions) GetMaxTotalChargeUsdOk() (*float32, bool) { + if o == nil || IsNil(o.MaxTotalChargeUsd) { + return nil, false + } + return o.MaxTotalChargeUsd, true +} + +// HasMaxTotalChargeUsd returns a boolean if a field has been set. +func (o *RunOptions) HasMaxTotalChargeUsd() bool { + if o != nil && !IsNil(o.MaxTotalChargeUsd) { + return true + } + + return false +} + +// SetMaxTotalChargeUsd gets a reference to the given float32 and assigns it to the MaxTotalChargeUsd field. +func (o *RunOptions) SetMaxTotalChargeUsd(v float32) { + o.MaxTotalChargeUsd = &v +} + +func (o RunOptions) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o RunOptions) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["build"] = o.Build + toSerialize["timeoutSecs"] = o.TimeoutSecs + toSerialize["memoryMbytes"] = o.MemoryMbytes + toSerialize["diskMbytes"] = o.DiskMbytes + if o.MaxItems.IsSet() { + toSerialize["maxItems"] = o.MaxItems.Get() + } + if !IsNil(o.MaxTotalChargeUsd) { + toSerialize["maxTotalChargeUsd"] = o.MaxTotalChargeUsd + } + return toSerialize, nil +} + +func (o *RunOptions) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "build", + "timeoutSecs", + "memoryMbytes", + "diskMbytes", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varRunOptions := _RunOptions{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varRunOptions) + + if err != nil { + return err + } + + *o = RunOptions(varRunOptions) + + return err +} + +type NullableRunOptions struct { + value *RunOptions + isSet bool +} + +func (v NullableRunOptions) Get() *RunOptions { + return v.value +} + +func (v *NullableRunOptions) Set(val *RunOptions) { + v.value = val + v.isSet = true +} + +func (v NullableRunOptions) IsSet() bool { + return v.isSet +} + +func (v *NullableRunOptions) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRunOptions(val *RunOptions) *NullableRunOptions { + return &NullableRunOptions{value: val, isSet: true} +} + +func (v NullableRunOptions) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRunOptions) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_run_origin.go b/model_run_origin.go new file mode 100644 index 0000000..3d3b790 --- /dev/null +++ b/model_run_origin.go @@ -0,0 +1,127 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" + "fmt" +) + +// RunOrigin the model 'RunOrigin' +type RunOrigin string + +// List of RunOrigin +const ( + DEVELOPMENT RunOrigin = "DEVELOPMENT" + WEB RunOrigin = "WEB" + API RunOrigin = "API" + SCHEDULER RunOrigin = "SCHEDULER" + TEST RunOrigin = "TEST" + WEBHOOK RunOrigin = "WEBHOOK" + ACTOR RunOrigin = "ACTOR" + CLI RunOrigin = "CLI" + CI RunOrigin = "CI" + STANDBY RunOrigin = "STANDBY" +) + +// All allowed values of RunOrigin enum +var AllowedRunOriginEnumValues = []RunOrigin{ + "DEVELOPMENT", + "WEB", + "API", + "SCHEDULER", + "TEST", + "WEBHOOK", + "ACTOR", + "CLI", + "CI", + "STANDBY", +} + +func (v *RunOrigin) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := RunOrigin(value) + for _, existing := range AllowedRunOriginEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid RunOrigin", value) +} + +// NewRunOriginFromValue returns a pointer to a valid RunOrigin +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewRunOriginFromValue(v string) (*RunOrigin, error) { + ev := RunOrigin(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for RunOrigin: valid values are %v", v, AllowedRunOriginEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v RunOrigin) IsValid() bool { + for _, existing := range AllowedRunOriginEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to RunOrigin value +func (v RunOrigin) Ptr() *RunOrigin { + return &v +} + +type NullableRunOrigin struct { + value *RunOrigin + isSet bool +} + +func (v NullableRunOrigin) Get() *RunOrigin { + return v.value +} + +func (v *NullableRunOrigin) Set(val *RunOrigin) { + v.value = val + v.isSet = true +} + +func (v NullableRunOrigin) IsSet() bool { + return v.isSet +} + +func (v *NullableRunOrigin) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRunOrigin(val *RunOrigin) *NullableRunOrigin { + return &NullableRunOrigin{value: val, isSet: true} +} + +func (v NullableRunOrigin) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRunOrigin) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + diff --git a/model_run_response.go b/model_run_response.go new file mode 100644 index 0000000..9414c0d --- /dev/null +++ b/model_run_response.go @@ -0,0 +1,158 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" + "bytes" + "fmt" +) + +// checks if the RunResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RunResponse{} + +// RunResponse struct for RunResponse +type RunResponse struct { + Data Run `json:"data"` +} + +type _RunResponse RunResponse + +// NewRunResponse instantiates a new RunResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewRunResponse(data Run) *RunResponse { + this := RunResponse{} + this.Data = data + return &this +} + +// NewRunResponseWithDefaults instantiates a new RunResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRunResponseWithDefaults() *RunResponse { + this := RunResponse{} + return &this +} + +// GetData returns the Data field value +func (o *RunResponse) GetData() Run { + if o == nil { + var ret Run + return ret + } + + return o.Data +} + +// GetDataOk returns a tuple with the Data field value +// and a boolean to check if the value has been set. +func (o *RunResponse) GetDataOk() (*Run, bool) { + if o == nil { + return nil, false + } + return &o.Data, true +} + +// SetData sets field value +func (o *RunResponse) SetData(v Run) { + o.Data = v +} + +func (o RunResponse) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o RunResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["data"] = o.Data + return toSerialize, nil +} + +func (o *RunResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "data", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varRunResponse := _RunResponse{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varRunResponse) + + if err != nil { + return err + } + + *o = RunResponse(varRunResponse) + + return err +} + +type NullableRunResponse struct { + value *RunResponse + isSet bool +} + +func (v NullableRunResponse) Get() *RunResponse { + return v.value +} + +func (v *NullableRunResponse) Set(val *RunResponse) { + v.value = val + v.isSet = true +} + +func (v NullableRunResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableRunResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRunResponse(val *RunResponse) *NullableRunResponse { + return &NullableRunResponse{value: val, isSet: true} +} + +func (v NullableRunResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRunResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_run_short.go b/model_run_short.go new file mode 100644 index 0000000..ee60fde --- /dev/null +++ b/model_run_short.go @@ -0,0 +1,611 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" + "time" + "bytes" + "fmt" +) + +// checks if the RunShort type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RunShort{} + +// RunShort struct for RunShort +type RunShort struct { + Id string `json:"id"` + ActId string `json:"actId"` + UserId *string `json:"userId,omitempty"` + ActorTaskId NullableString `json:"actorTaskId,omitempty"` + Status ActorJobStatus `json:"status"` + StartedAt time.Time `json:"startedAt"` + FinishedAt NullableTime `json:"finishedAt,omitempty"` + BuildId string `json:"buildId"` + BuildNumber *string `json:"buildNumber,omitempty" validate:"regexp=^([0-9]|[1-9][0-9])\\\\.([0-9]|[1-9][0-9])(\\\\.[1-9][0-9]{0,4})$"` + BuildNumberInt *int32 `json:"buildNumberInt,omitempty"` + Meta RunMeta `json:"meta"` + UsageTotalUsd float32 `json:"usageTotalUsd"` + DefaultKeyValueStoreId string `json:"defaultKeyValueStoreId"` + DefaultDatasetId string `json:"defaultDatasetId"` + DefaultRequestQueueId string `json:"defaultRequestQueueId"` +} + +type _RunShort RunShort + +// NewRunShort instantiates a new RunShort object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewRunShort(id string, actId string, status ActorJobStatus, startedAt time.Time, buildId string, meta RunMeta, usageTotalUsd float32, defaultKeyValueStoreId string, defaultDatasetId string, defaultRequestQueueId string) *RunShort { + this := RunShort{} + this.Id = id + this.ActId = actId + this.Status = status + this.StartedAt = startedAt + this.BuildId = buildId + this.Meta = meta + this.UsageTotalUsd = usageTotalUsd + this.DefaultKeyValueStoreId = defaultKeyValueStoreId + this.DefaultDatasetId = defaultDatasetId + this.DefaultRequestQueueId = defaultRequestQueueId + return &this +} + +// NewRunShortWithDefaults instantiates a new RunShort object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRunShortWithDefaults() *RunShort { + this := RunShort{} + return &this +} + +// GetId returns the Id field value +func (o *RunShort) GetId() string { + if o == nil { + var ret string + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *RunShort) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *RunShort) SetId(v string) { + o.Id = v +} + +// GetActId returns the ActId field value +func (o *RunShort) GetActId() string { + if o == nil { + var ret string + return ret + } + + return o.ActId +} + +// GetActIdOk returns a tuple with the ActId field value +// and a boolean to check if the value has been set. +func (o *RunShort) GetActIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ActId, true +} + +// SetActId sets field value +func (o *RunShort) SetActId(v string) { + o.ActId = v +} + +// GetUserId returns the UserId field value if set, zero value otherwise. +func (o *RunShort) GetUserId() string { + if o == nil || IsNil(o.UserId) { + var ret string + return ret + } + return *o.UserId +} + +// GetUserIdOk returns a tuple with the UserId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RunShort) GetUserIdOk() (*string, bool) { + if o == nil || IsNil(o.UserId) { + return nil, false + } + return o.UserId, true +} + +// HasUserId returns a boolean if a field has been set. +func (o *RunShort) HasUserId() bool { + if o != nil && !IsNil(o.UserId) { + return true + } + + return false +} + +// SetUserId gets a reference to the given string and assigns it to the UserId field. +func (o *RunShort) SetUserId(v string) { + o.UserId = &v +} + +// GetActorTaskId returns the ActorTaskId field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *RunShort) GetActorTaskId() string { + if o == nil || IsNil(o.ActorTaskId.Get()) { + var ret string + return ret + } + return *o.ActorTaskId.Get() +} + +// GetActorTaskIdOk returns a tuple with the ActorTaskId field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *RunShort) GetActorTaskIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.ActorTaskId.Get(), o.ActorTaskId.IsSet() +} + +// HasActorTaskId returns a boolean if a field has been set. +func (o *RunShort) HasActorTaskId() bool { + if o != nil && o.ActorTaskId.IsSet() { + return true + } + + return false +} + +// SetActorTaskId gets a reference to the given NullableString and assigns it to the ActorTaskId field. +func (o *RunShort) SetActorTaskId(v string) { + o.ActorTaskId.Set(&v) +} +// SetActorTaskIdNil sets the value for ActorTaskId to be an explicit nil +func (o *RunShort) SetActorTaskIdNil() { + o.ActorTaskId.Set(nil) +} + +// UnsetActorTaskId ensures that no value is present for ActorTaskId, not even an explicit nil +func (o *RunShort) UnsetActorTaskId() { + o.ActorTaskId.Unset() +} + +// GetStatus returns the Status field value +func (o *RunShort) GetStatus() ActorJobStatus { + if o == nil { + var ret ActorJobStatus + return ret + } + + return o.Status +} + +// GetStatusOk returns a tuple with the Status field value +// and a boolean to check if the value has been set. +func (o *RunShort) GetStatusOk() (*ActorJobStatus, bool) { + if o == nil { + return nil, false + } + return &o.Status, true +} + +// SetStatus sets field value +func (o *RunShort) SetStatus(v ActorJobStatus) { + o.Status = v +} + +// GetStartedAt returns the StartedAt field value +func (o *RunShort) GetStartedAt() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.StartedAt +} + +// GetStartedAtOk returns a tuple with the StartedAt field value +// and a boolean to check if the value has been set. +func (o *RunShort) GetStartedAtOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.StartedAt, true +} + +// SetStartedAt sets field value +func (o *RunShort) SetStartedAt(v time.Time) { + o.StartedAt = v +} + +// GetFinishedAt returns the FinishedAt field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *RunShort) GetFinishedAt() time.Time { + if o == nil || IsNil(o.FinishedAt.Get()) { + var ret time.Time + return ret + } + return *o.FinishedAt.Get() +} + +// GetFinishedAtOk returns a tuple with the FinishedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *RunShort) GetFinishedAtOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.FinishedAt.Get(), o.FinishedAt.IsSet() +} + +// HasFinishedAt returns a boolean if a field has been set. +func (o *RunShort) HasFinishedAt() bool { + if o != nil && o.FinishedAt.IsSet() { + return true + } + + return false +} + +// SetFinishedAt gets a reference to the given NullableTime and assigns it to the FinishedAt field. +func (o *RunShort) SetFinishedAt(v time.Time) { + o.FinishedAt.Set(&v) +} +// SetFinishedAtNil sets the value for FinishedAt to be an explicit nil +func (o *RunShort) SetFinishedAtNil() { + o.FinishedAt.Set(nil) +} + +// UnsetFinishedAt ensures that no value is present for FinishedAt, not even an explicit nil +func (o *RunShort) UnsetFinishedAt() { + o.FinishedAt.Unset() +} + +// GetBuildId returns the BuildId field value +func (o *RunShort) GetBuildId() string { + if o == nil { + var ret string + return ret + } + + return o.BuildId +} + +// GetBuildIdOk returns a tuple with the BuildId field value +// and a boolean to check if the value has been set. +func (o *RunShort) GetBuildIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.BuildId, true +} + +// SetBuildId sets field value +func (o *RunShort) SetBuildId(v string) { + o.BuildId = v +} + +// GetBuildNumber returns the BuildNumber field value if set, zero value otherwise. +func (o *RunShort) GetBuildNumber() string { + if o == nil || IsNil(o.BuildNumber) { + var ret string + return ret + } + return *o.BuildNumber +} + +// GetBuildNumberOk returns a tuple with the BuildNumber field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RunShort) GetBuildNumberOk() (*string, bool) { + if o == nil || IsNil(o.BuildNumber) { + return nil, false + } + return o.BuildNumber, true +} + +// HasBuildNumber returns a boolean if a field has been set. +func (o *RunShort) HasBuildNumber() bool { + if o != nil && !IsNil(o.BuildNumber) { + return true + } + + return false +} + +// SetBuildNumber gets a reference to the given string and assigns it to the BuildNumber field. +func (o *RunShort) SetBuildNumber(v string) { + o.BuildNumber = &v +} + +// GetBuildNumberInt returns the BuildNumberInt field value if set, zero value otherwise. +func (o *RunShort) GetBuildNumberInt() int32 { + if o == nil || IsNil(o.BuildNumberInt) { + var ret int32 + return ret + } + return *o.BuildNumberInt +} + +// GetBuildNumberIntOk returns a tuple with the BuildNumberInt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RunShort) GetBuildNumberIntOk() (*int32, bool) { + if o == nil || IsNil(o.BuildNumberInt) { + return nil, false + } + return o.BuildNumberInt, true +} + +// HasBuildNumberInt returns a boolean if a field has been set. +func (o *RunShort) HasBuildNumberInt() bool { + if o != nil && !IsNil(o.BuildNumberInt) { + return true + } + + return false +} + +// SetBuildNumberInt gets a reference to the given int32 and assigns it to the BuildNumberInt field. +func (o *RunShort) SetBuildNumberInt(v int32) { + o.BuildNumberInt = &v +} + +// GetMeta returns the Meta field value +func (o *RunShort) GetMeta() RunMeta { + if o == nil { + var ret RunMeta + return ret + } + + return o.Meta +} + +// GetMetaOk returns a tuple with the Meta field value +// and a boolean to check if the value has been set. +func (o *RunShort) GetMetaOk() (*RunMeta, bool) { + if o == nil { + return nil, false + } + return &o.Meta, true +} + +// SetMeta sets field value +func (o *RunShort) SetMeta(v RunMeta) { + o.Meta = v +} + +// GetUsageTotalUsd returns the UsageTotalUsd field value +func (o *RunShort) GetUsageTotalUsd() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.UsageTotalUsd +} + +// GetUsageTotalUsdOk returns a tuple with the UsageTotalUsd field value +// and a boolean to check if the value has been set. +func (o *RunShort) GetUsageTotalUsdOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.UsageTotalUsd, true +} + +// SetUsageTotalUsd sets field value +func (o *RunShort) SetUsageTotalUsd(v float32) { + o.UsageTotalUsd = v +} + +// GetDefaultKeyValueStoreId returns the DefaultKeyValueStoreId field value +func (o *RunShort) GetDefaultKeyValueStoreId() string { + if o == nil { + var ret string + return ret + } + + return o.DefaultKeyValueStoreId +} + +// GetDefaultKeyValueStoreIdOk returns a tuple with the DefaultKeyValueStoreId field value +// and a boolean to check if the value has been set. +func (o *RunShort) GetDefaultKeyValueStoreIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.DefaultKeyValueStoreId, true +} + +// SetDefaultKeyValueStoreId sets field value +func (o *RunShort) SetDefaultKeyValueStoreId(v string) { + o.DefaultKeyValueStoreId = v +} + +// GetDefaultDatasetId returns the DefaultDatasetId field value +func (o *RunShort) GetDefaultDatasetId() string { + if o == nil { + var ret string + return ret + } + + return o.DefaultDatasetId +} + +// GetDefaultDatasetIdOk returns a tuple with the DefaultDatasetId field value +// and a boolean to check if the value has been set. +func (o *RunShort) GetDefaultDatasetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.DefaultDatasetId, true +} + +// SetDefaultDatasetId sets field value +func (o *RunShort) SetDefaultDatasetId(v string) { + o.DefaultDatasetId = v +} + +// GetDefaultRequestQueueId returns the DefaultRequestQueueId field value +func (o *RunShort) GetDefaultRequestQueueId() string { + if o == nil { + var ret string + return ret + } + + return o.DefaultRequestQueueId +} + +// GetDefaultRequestQueueIdOk returns a tuple with the DefaultRequestQueueId field value +// and a boolean to check if the value has been set. +func (o *RunShort) GetDefaultRequestQueueIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.DefaultRequestQueueId, true +} + +// SetDefaultRequestQueueId sets field value +func (o *RunShort) SetDefaultRequestQueueId(v string) { + o.DefaultRequestQueueId = v +} + +func (o RunShort) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o RunShort) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["actId"] = o.ActId + if !IsNil(o.UserId) { + toSerialize["userId"] = o.UserId + } + if o.ActorTaskId.IsSet() { + toSerialize["actorTaskId"] = o.ActorTaskId.Get() + } + toSerialize["status"] = o.Status + toSerialize["startedAt"] = o.StartedAt + if o.FinishedAt.IsSet() { + toSerialize["finishedAt"] = o.FinishedAt.Get() + } + toSerialize["buildId"] = o.BuildId + if !IsNil(o.BuildNumber) { + toSerialize["buildNumber"] = o.BuildNumber + } + if !IsNil(o.BuildNumberInt) { + toSerialize["buildNumberInt"] = o.BuildNumberInt + } + toSerialize["meta"] = o.Meta + toSerialize["usageTotalUsd"] = o.UsageTotalUsd + toSerialize["defaultKeyValueStoreId"] = o.DefaultKeyValueStoreId + toSerialize["defaultDatasetId"] = o.DefaultDatasetId + toSerialize["defaultRequestQueueId"] = o.DefaultRequestQueueId + return toSerialize, nil +} + +func (o *RunShort) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "actId", + "status", + "startedAt", + "buildId", + "meta", + "usageTotalUsd", + "defaultKeyValueStoreId", + "defaultDatasetId", + "defaultRequestQueueId", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varRunShort := _RunShort{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varRunShort) + + if err != nil { + return err + } + + *o = RunShort(varRunShort) + + return err +} + +type NullableRunShort struct { + value *RunShort + isSet bool +} + +func (v NullableRunShort) Get() *RunShort { + return v.value +} + +func (v *NullableRunShort) Set(val *RunShort) { + v.value = val + v.isSet = true +} + +func (v NullableRunShort) IsSet() bool { + return v.isSet +} + +func (v *NullableRunShort) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRunShort(val *RunShort) *NullableRunShort { + return &NullableRunShort{value: val, isSet: true} +} + +func (v NullableRunShort) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRunShort) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_run_stats.go b/model_run_stats.go new file mode 100644 index 0000000..f2e14cf --- /dev/null +++ b/model_run_stats.go @@ -0,0 +1,728 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" + "bytes" + "fmt" +) + +// checks if the RunStats type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RunStats{} + +// RunStats struct for RunStats +type RunStats struct { + InputBodyLen NullableInt32 `json:"inputBodyLen,omitempty"` + MigrationCount *int32 `json:"migrationCount,omitempty"` + RebootCount *int32 `json:"rebootCount,omitempty"` + RestartCount int32 `json:"restartCount"` + ResurrectCount int32 `json:"resurrectCount"` + MemAvgBytes *float32 `json:"memAvgBytes,omitempty"` + MemMaxBytes *int32 `json:"memMaxBytes,omitempty"` + MemCurrentBytes *int32 `json:"memCurrentBytes,omitempty"` + CpuAvgUsage *float32 `json:"cpuAvgUsage,omitempty"` + CpuMaxUsage *float32 `json:"cpuMaxUsage,omitempty"` + CpuCurrentUsage *float32 `json:"cpuCurrentUsage,omitempty"` + NetRxBytes *int32 `json:"netRxBytes,omitempty"` + NetTxBytes *int32 `json:"netTxBytes,omitempty"` + DurationMillis *int32 `json:"durationMillis,omitempty"` + RunTimeSecs *float32 `json:"runTimeSecs,omitempty"` + Metamorph *int32 `json:"metamorph,omitempty"` + ComputeUnits float32 `json:"computeUnits"` +} + +type _RunStats RunStats + +// NewRunStats instantiates a new RunStats object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewRunStats(restartCount int32, resurrectCount int32, computeUnits float32) *RunStats { + this := RunStats{} + this.RestartCount = restartCount + this.ResurrectCount = resurrectCount + this.ComputeUnits = computeUnits + return &this +} + +// NewRunStatsWithDefaults instantiates a new RunStats object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRunStatsWithDefaults() *RunStats { + this := RunStats{} + return &this +} + +// GetInputBodyLen returns the InputBodyLen field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *RunStats) GetInputBodyLen() int32 { + if o == nil || IsNil(o.InputBodyLen.Get()) { + var ret int32 + return ret + } + return *o.InputBodyLen.Get() +} + +// GetInputBodyLenOk returns a tuple with the InputBodyLen field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *RunStats) GetInputBodyLenOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.InputBodyLen.Get(), o.InputBodyLen.IsSet() +} + +// HasInputBodyLen returns a boolean if a field has been set. +func (o *RunStats) HasInputBodyLen() bool { + if o != nil && o.InputBodyLen.IsSet() { + return true + } + + return false +} + +// SetInputBodyLen gets a reference to the given NullableInt32 and assigns it to the InputBodyLen field. +func (o *RunStats) SetInputBodyLen(v int32) { + o.InputBodyLen.Set(&v) +} +// SetInputBodyLenNil sets the value for InputBodyLen to be an explicit nil +func (o *RunStats) SetInputBodyLenNil() { + o.InputBodyLen.Set(nil) +} + +// UnsetInputBodyLen ensures that no value is present for InputBodyLen, not even an explicit nil +func (o *RunStats) UnsetInputBodyLen() { + o.InputBodyLen.Unset() +} + +// GetMigrationCount returns the MigrationCount field value if set, zero value otherwise. +func (o *RunStats) GetMigrationCount() int32 { + if o == nil || IsNil(o.MigrationCount) { + var ret int32 + return ret + } + return *o.MigrationCount +} + +// GetMigrationCountOk returns a tuple with the MigrationCount field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RunStats) GetMigrationCountOk() (*int32, bool) { + if o == nil || IsNil(o.MigrationCount) { + return nil, false + } + return o.MigrationCount, true +} + +// HasMigrationCount returns a boolean if a field has been set. +func (o *RunStats) HasMigrationCount() bool { + if o != nil && !IsNil(o.MigrationCount) { + return true + } + + return false +} + +// SetMigrationCount gets a reference to the given int32 and assigns it to the MigrationCount field. +func (o *RunStats) SetMigrationCount(v int32) { + o.MigrationCount = &v +} + +// GetRebootCount returns the RebootCount field value if set, zero value otherwise. +func (o *RunStats) GetRebootCount() int32 { + if o == nil || IsNil(o.RebootCount) { + var ret int32 + return ret + } + return *o.RebootCount +} + +// GetRebootCountOk returns a tuple with the RebootCount field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RunStats) GetRebootCountOk() (*int32, bool) { + if o == nil || IsNil(o.RebootCount) { + return nil, false + } + return o.RebootCount, true +} + +// HasRebootCount returns a boolean if a field has been set. +func (o *RunStats) HasRebootCount() bool { + if o != nil && !IsNil(o.RebootCount) { + return true + } + + return false +} + +// SetRebootCount gets a reference to the given int32 and assigns it to the RebootCount field. +func (o *RunStats) SetRebootCount(v int32) { + o.RebootCount = &v +} + +// GetRestartCount returns the RestartCount field value +func (o *RunStats) GetRestartCount() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.RestartCount +} + +// GetRestartCountOk returns a tuple with the RestartCount field value +// and a boolean to check if the value has been set. +func (o *RunStats) GetRestartCountOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.RestartCount, true +} + +// SetRestartCount sets field value +func (o *RunStats) SetRestartCount(v int32) { + o.RestartCount = v +} + +// GetResurrectCount returns the ResurrectCount field value +func (o *RunStats) GetResurrectCount() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.ResurrectCount +} + +// GetResurrectCountOk returns a tuple with the ResurrectCount field value +// and a boolean to check if the value has been set. +func (o *RunStats) GetResurrectCountOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.ResurrectCount, true +} + +// SetResurrectCount sets field value +func (o *RunStats) SetResurrectCount(v int32) { + o.ResurrectCount = v +} + +// GetMemAvgBytes returns the MemAvgBytes field value if set, zero value otherwise. +func (o *RunStats) GetMemAvgBytes() float32 { + if o == nil || IsNil(o.MemAvgBytes) { + var ret float32 + return ret + } + return *o.MemAvgBytes +} + +// GetMemAvgBytesOk returns a tuple with the MemAvgBytes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RunStats) GetMemAvgBytesOk() (*float32, bool) { + if o == nil || IsNil(o.MemAvgBytes) { + return nil, false + } + return o.MemAvgBytes, true +} + +// HasMemAvgBytes returns a boolean if a field has been set. +func (o *RunStats) HasMemAvgBytes() bool { + if o != nil && !IsNil(o.MemAvgBytes) { + return true + } + + return false +} + +// SetMemAvgBytes gets a reference to the given float32 and assigns it to the MemAvgBytes field. +func (o *RunStats) SetMemAvgBytes(v float32) { + o.MemAvgBytes = &v +} + +// GetMemMaxBytes returns the MemMaxBytes field value if set, zero value otherwise. +func (o *RunStats) GetMemMaxBytes() int32 { + if o == nil || IsNil(o.MemMaxBytes) { + var ret int32 + return ret + } + return *o.MemMaxBytes +} + +// GetMemMaxBytesOk returns a tuple with the MemMaxBytes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RunStats) GetMemMaxBytesOk() (*int32, bool) { + if o == nil || IsNil(o.MemMaxBytes) { + return nil, false + } + return o.MemMaxBytes, true +} + +// HasMemMaxBytes returns a boolean if a field has been set. +func (o *RunStats) HasMemMaxBytes() bool { + if o != nil && !IsNil(o.MemMaxBytes) { + return true + } + + return false +} + +// SetMemMaxBytes gets a reference to the given int32 and assigns it to the MemMaxBytes field. +func (o *RunStats) SetMemMaxBytes(v int32) { + o.MemMaxBytes = &v +} + +// GetMemCurrentBytes returns the MemCurrentBytes field value if set, zero value otherwise. +func (o *RunStats) GetMemCurrentBytes() int32 { + if o == nil || IsNil(o.MemCurrentBytes) { + var ret int32 + return ret + } + return *o.MemCurrentBytes +} + +// GetMemCurrentBytesOk returns a tuple with the MemCurrentBytes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RunStats) GetMemCurrentBytesOk() (*int32, bool) { + if o == nil || IsNil(o.MemCurrentBytes) { + return nil, false + } + return o.MemCurrentBytes, true +} + +// HasMemCurrentBytes returns a boolean if a field has been set. +func (o *RunStats) HasMemCurrentBytes() bool { + if o != nil && !IsNil(o.MemCurrentBytes) { + return true + } + + return false +} + +// SetMemCurrentBytes gets a reference to the given int32 and assigns it to the MemCurrentBytes field. +func (o *RunStats) SetMemCurrentBytes(v int32) { + o.MemCurrentBytes = &v +} + +// GetCpuAvgUsage returns the CpuAvgUsage field value if set, zero value otherwise. +func (o *RunStats) GetCpuAvgUsage() float32 { + if o == nil || IsNil(o.CpuAvgUsage) { + var ret float32 + return ret + } + return *o.CpuAvgUsage +} + +// GetCpuAvgUsageOk returns a tuple with the CpuAvgUsage field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RunStats) GetCpuAvgUsageOk() (*float32, bool) { + if o == nil || IsNil(o.CpuAvgUsage) { + return nil, false + } + return o.CpuAvgUsage, true +} + +// HasCpuAvgUsage returns a boolean if a field has been set. +func (o *RunStats) HasCpuAvgUsage() bool { + if o != nil && !IsNil(o.CpuAvgUsage) { + return true + } + + return false +} + +// SetCpuAvgUsage gets a reference to the given float32 and assigns it to the CpuAvgUsage field. +func (o *RunStats) SetCpuAvgUsage(v float32) { + o.CpuAvgUsage = &v +} + +// GetCpuMaxUsage returns the CpuMaxUsage field value if set, zero value otherwise. +func (o *RunStats) GetCpuMaxUsage() float32 { + if o == nil || IsNil(o.CpuMaxUsage) { + var ret float32 + return ret + } + return *o.CpuMaxUsage +} + +// GetCpuMaxUsageOk returns a tuple with the CpuMaxUsage field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RunStats) GetCpuMaxUsageOk() (*float32, bool) { + if o == nil || IsNil(o.CpuMaxUsage) { + return nil, false + } + return o.CpuMaxUsage, true +} + +// HasCpuMaxUsage returns a boolean if a field has been set. +func (o *RunStats) HasCpuMaxUsage() bool { + if o != nil && !IsNil(o.CpuMaxUsage) { + return true + } + + return false +} + +// SetCpuMaxUsage gets a reference to the given float32 and assigns it to the CpuMaxUsage field. +func (o *RunStats) SetCpuMaxUsage(v float32) { + o.CpuMaxUsage = &v +} + +// GetCpuCurrentUsage returns the CpuCurrentUsage field value if set, zero value otherwise. +func (o *RunStats) GetCpuCurrentUsage() float32 { + if o == nil || IsNil(o.CpuCurrentUsage) { + var ret float32 + return ret + } + return *o.CpuCurrentUsage +} + +// GetCpuCurrentUsageOk returns a tuple with the CpuCurrentUsage field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RunStats) GetCpuCurrentUsageOk() (*float32, bool) { + if o == nil || IsNil(o.CpuCurrentUsage) { + return nil, false + } + return o.CpuCurrentUsage, true +} + +// HasCpuCurrentUsage returns a boolean if a field has been set. +func (o *RunStats) HasCpuCurrentUsage() bool { + if o != nil && !IsNil(o.CpuCurrentUsage) { + return true + } + + return false +} + +// SetCpuCurrentUsage gets a reference to the given float32 and assigns it to the CpuCurrentUsage field. +func (o *RunStats) SetCpuCurrentUsage(v float32) { + o.CpuCurrentUsage = &v +} + +// GetNetRxBytes returns the NetRxBytes field value if set, zero value otherwise. +func (o *RunStats) GetNetRxBytes() int32 { + if o == nil || IsNil(o.NetRxBytes) { + var ret int32 + return ret + } + return *o.NetRxBytes +} + +// GetNetRxBytesOk returns a tuple with the NetRxBytes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RunStats) GetNetRxBytesOk() (*int32, bool) { + if o == nil || IsNil(o.NetRxBytes) { + return nil, false + } + return o.NetRxBytes, true +} + +// HasNetRxBytes returns a boolean if a field has been set. +func (o *RunStats) HasNetRxBytes() bool { + if o != nil && !IsNil(o.NetRxBytes) { + return true + } + + return false +} + +// SetNetRxBytes gets a reference to the given int32 and assigns it to the NetRxBytes field. +func (o *RunStats) SetNetRxBytes(v int32) { + o.NetRxBytes = &v +} + +// GetNetTxBytes returns the NetTxBytes field value if set, zero value otherwise. +func (o *RunStats) GetNetTxBytes() int32 { + if o == nil || IsNil(o.NetTxBytes) { + var ret int32 + return ret + } + return *o.NetTxBytes +} + +// GetNetTxBytesOk returns a tuple with the NetTxBytes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RunStats) GetNetTxBytesOk() (*int32, bool) { + if o == nil || IsNil(o.NetTxBytes) { + return nil, false + } + return o.NetTxBytes, true +} + +// HasNetTxBytes returns a boolean if a field has been set. +func (o *RunStats) HasNetTxBytes() bool { + if o != nil && !IsNil(o.NetTxBytes) { + return true + } + + return false +} + +// SetNetTxBytes gets a reference to the given int32 and assigns it to the NetTxBytes field. +func (o *RunStats) SetNetTxBytes(v int32) { + o.NetTxBytes = &v +} + +// GetDurationMillis returns the DurationMillis field value if set, zero value otherwise. +func (o *RunStats) GetDurationMillis() int32 { + if o == nil || IsNil(o.DurationMillis) { + var ret int32 + return ret + } + return *o.DurationMillis +} + +// GetDurationMillisOk returns a tuple with the DurationMillis field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RunStats) GetDurationMillisOk() (*int32, bool) { + if o == nil || IsNil(o.DurationMillis) { + return nil, false + } + return o.DurationMillis, true +} + +// HasDurationMillis returns a boolean if a field has been set. +func (o *RunStats) HasDurationMillis() bool { + if o != nil && !IsNil(o.DurationMillis) { + return true + } + + return false +} + +// SetDurationMillis gets a reference to the given int32 and assigns it to the DurationMillis field. +func (o *RunStats) SetDurationMillis(v int32) { + o.DurationMillis = &v +} + +// GetRunTimeSecs returns the RunTimeSecs field value if set, zero value otherwise. +func (o *RunStats) GetRunTimeSecs() float32 { + if o == nil || IsNil(o.RunTimeSecs) { + var ret float32 + return ret + } + return *o.RunTimeSecs +} + +// GetRunTimeSecsOk returns a tuple with the RunTimeSecs field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RunStats) GetRunTimeSecsOk() (*float32, bool) { + if o == nil || IsNil(o.RunTimeSecs) { + return nil, false + } + return o.RunTimeSecs, true +} + +// HasRunTimeSecs returns a boolean if a field has been set. +func (o *RunStats) HasRunTimeSecs() bool { + if o != nil && !IsNil(o.RunTimeSecs) { + return true + } + + return false +} + +// SetRunTimeSecs gets a reference to the given float32 and assigns it to the RunTimeSecs field. +func (o *RunStats) SetRunTimeSecs(v float32) { + o.RunTimeSecs = &v +} + +// GetMetamorph returns the Metamorph field value if set, zero value otherwise. +func (o *RunStats) GetMetamorph() int32 { + if o == nil || IsNil(o.Metamorph) { + var ret int32 + return ret + } + return *o.Metamorph +} + +// GetMetamorphOk returns a tuple with the Metamorph field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RunStats) GetMetamorphOk() (*int32, bool) { + if o == nil || IsNil(o.Metamorph) { + return nil, false + } + return o.Metamorph, true +} + +// HasMetamorph returns a boolean if a field has been set. +func (o *RunStats) HasMetamorph() bool { + if o != nil && !IsNil(o.Metamorph) { + return true + } + + return false +} + +// SetMetamorph gets a reference to the given int32 and assigns it to the Metamorph field. +func (o *RunStats) SetMetamorph(v int32) { + o.Metamorph = &v +} + +// GetComputeUnits returns the ComputeUnits field value +func (o *RunStats) GetComputeUnits() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.ComputeUnits +} + +// GetComputeUnitsOk returns a tuple with the ComputeUnits field value +// and a boolean to check if the value has been set. +func (o *RunStats) GetComputeUnitsOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.ComputeUnits, true +} + +// SetComputeUnits sets field value +func (o *RunStats) SetComputeUnits(v float32) { + o.ComputeUnits = v +} + +func (o RunStats) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o RunStats) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.InputBodyLen.IsSet() { + toSerialize["inputBodyLen"] = o.InputBodyLen.Get() + } + if !IsNil(o.MigrationCount) { + toSerialize["migrationCount"] = o.MigrationCount + } + if !IsNil(o.RebootCount) { + toSerialize["rebootCount"] = o.RebootCount + } + toSerialize["restartCount"] = o.RestartCount + toSerialize["resurrectCount"] = o.ResurrectCount + if !IsNil(o.MemAvgBytes) { + toSerialize["memAvgBytes"] = o.MemAvgBytes + } + if !IsNil(o.MemMaxBytes) { + toSerialize["memMaxBytes"] = o.MemMaxBytes + } + if !IsNil(o.MemCurrentBytes) { + toSerialize["memCurrentBytes"] = o.MemCurrentBytes + } + if !IsNil(o.CpuAvgUsage) { + toSerialize["cpuAvgUsage"] = o.CpuAvgUsage + } + if !IsNil(o.CpuMaxUsage) { + toSerialize["cpuMaxUsage"] = o.CpuMaxUsage + } + if !IsNil(o.CpuCurrentUsage) { + toSerialize["cpuCurrentUsage"] = o.CpuCurrentUsage + } + if !IsNil(o.NetRxBytes) { + toSerialize["netRxBytes"] = o.NetRxBytes + } + if !IsNil(o.NetTxBytes) { + toSerialize["netTxBytes"] = o.NetTxBytes + } + if !IsNil(o.DurationMillis) { + toSerialize["durationMillis"] = o.DurationMillis + } + if !IsNil(o.RunTimeSecs) { + toSerialize["runTimeSecs"] = o.RunTimeSecs + } + if !IsNil(o.Metamorph) { + toSerialize["metamorph"] = o.Metamorph + } + toSerialize["computeUnits"] = o.ComputeUnits + return toSerialize, nil +} + +func (o *RunStats) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "restartCount", + "resurrectCount", + "computeUnits", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varRunStats := _RunStats{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varRunStats) + + if err != nil { + return err + } + + *o = RunStats(varRunStats) + + return err +} + +type NullableRunStats struct { + value *RunStats + isSet bool +} + +func (v NullableRunStats) Get() *RunStats { + return v.value +} + +func (v *NullableRunStats) Set(val *RunStats) { + v.value = val + v.isSet = true +} + +func (v NullableRunStats) IsSet() bool { + return v.isSet +} + +func (v *NullableRunStats) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRunStats(val *RunStats) *NullableRunStats { + return &NullableRunStats{value: val, isSet: true} +} + +func (v NullableRunStats) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRunStats) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_run_storage_ids.go b/model_run_storage_ids.go new file mode 100644 index 0000000..76c36a5 --- /dev/null +++ b/model_run_storage_ids.go @@ -0,0 +1,198 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" +) + +// checks if the RunStorageIds type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RunStorageIds{} + +// RunStorageIds A map of aliased storage IDs associated with this run, grouped by storage type. +type RunStorageIds struct { + Datasets *RunStorageIdsDatasets `json:"datasets,omitempty"` + KeyValueStores *RunStorageIdsDatasets `json:"keyValueStores,omitempty"` + RequestQueues *RunStorageIdsDatasets `json:"requestQueues,omitempty"` +} + +// NewRunStorageIds instantiates a new RunStorageIds object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewRunStorageIds() *RunStorageIds { + this := RunStorageIds{} + return &this +} + +// NewRunStorageIdsWithDefaults instantiates a new RunStorageIds object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRunStorageIdsWithDefaults() *RunStorageIds { + this := RunStorageIds{} + return &this +} + +// GetDatasets returns the Datasets field value if set, zero value otherwise. +func (o *RunStorageIds) GetDatasets() RunStorageIdsDatasets { + if o == nil || IsNil(o.Datasets) { + var ret RunStorageIdsDatasets + return ret + } + return *o.Datasets +} + +// GetDatasetsOk returns a tuple with the Datasets field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RunStorageIds) GetDatasetsOk() (*RunStorageIdsDatasets, bool) { + if o == nil || IsNil(o.Datasets) { + return nil, false + } + return o.Datasets, true +} + +// HasDatasets returns a boolean if a field has been set. +func (o *RunStorageIds) HasDatasets() bool { + if o != nil && !IsNil(o.Datasets) { + return true + } + + return false +} + +// SetDatasets gets a reference to the given RunStorageIdsDatasets and assigns it to the Datasets field. +func (o *RunStorageIds) SetDatasets(v RunStorageIdsDatasets) { + o.Datasets = &v +} + +// GetKeyValueStores returns the KeyValueStores field value if set, zero value otherwise. +func (o *RunStorageIds) GetKeyValueStores() RunStorageIdsDatasets { + if o == nil || IsNil(o.KeyValueStores) { + var ret RunStorageIdsDatasets + return ret + } + return *o.KeyValueStores +} + +// GetKeyValueStoresOk returns a tuple with the KeyValueStores field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RunStorageIds) GetKeyValueStoresOk() (*RunStorageIdsDatasets, bool) { + if o == nil || IsNil(o.KeyValueStores) { + return nil, false + } + return o.KeyValueStores, true +} + +// HasKeyValueStores returns a boolean if a field has been set. +func (o *RunStorageIds) HasKeyValueStores() bool { + if o != nil && !IsNil(o.KeyValueStores) { + return true + } + + return false +} + +// SetKeyValueStores gets a reference to the given RunStorageIdsDatasets and assigns it to the KeyValueStores field. +func (o *RunStorageIds) SetKeyValueStores(v RunStorageIdsDatasets) { + o.KeyValueStores = &v +} + +// GetRequestQueues returns the RequestQueues field value if set, zero value otherwise. +func (o *RunStorageIds) GetRequestQueues() RunStorageIdsDatasets { + if o == nil || IsNil(o.RequestQueues) { + var ret RunStorageIdsDatasets + return ret + } + return *o.RequestQueues +} + +// GetRequestQueuesOk returns a tuple with the RequestQueues field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RunStorageIds) GetRequestQueuesOk() (*RunStorageIdsDatasets, bool) { + if o == nil || IsNil(o.RequestQueues) { + return nil, false + } + return o.RequestQueues, true +} + +// HasRequestQueues returns a boolean if a field has been set. +func (o *RunStorageIds) HasRequestQueues() bool { + if o != nil && !IsNil(o.RequestQueues) { + return true + } + + return false +} + +// SetRequestQueues gets a reference to the given RunStorageIdsDatasets and assigns it to the RequestQueues field. +func (o *RunStorageIds) SetRequestQueues(v RunStorageIdsDatasets) { + o.RequestQueues = &v +} + +func (o RunStorageIds) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o RunStorageIds) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Datasets) { + toSerialize["datasets"] = o.Datasets + } + if !IsNil(o.KeyValueStores) { + toSerialize["keyValueStores"] = o.KeyValueStores + } + if !IsNil(o.RequestQueues) { + toSerialize["requestQueues"] = o.RequestQueues + } + return toSerialize, nil +} + +type NullableRunStorageIds struct { + value *RunStorageIds + isSet bool +} + +func (v NullableRunStorageIds) Get() *RunStorageIds { + return v.value +} + +func (v *NullableRunStorageIds) Set(val *RunStorageIds) { + v.value = val + v.isSet = true +} + +func (v NullableRunStorageIds) IsSet() bool { + return v.isSet +} + +func (v *NullableRunStorageIds) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRunStorageIds(val *RunStorageIds) *NullableRunStorageIds { + return &NullableRunStorageIds{value: val, isSet: true} +} + +func (v NullableRunStorageIds) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRunStorageIds) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_run_storage_ids_datasets.go b/model_run_storage_ids_datasets.go new file mode 100644 index 0000000..dd3809d --- /dev/null +++ b/model_run_storage_ids_datasets.go @@ -0,0 +1,156 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" +) + +// checks if the RunStorageIdsDatasets type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RunStorageIdsDatasets{} + +// RunStorageIdsDatasets Aliased dataset IDs for this run. +type RunStorageIdsDatasets struct { + // ID of the default dataset for this run. + Default *string `json:"default,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _RunStorageIdsDatasets RunStorageIdsDatasets + +// NewRunStorageIdsDatasets instantiates a new RunStorageIdsDatasets object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewRunStorageIdsDatasets() *RunStorageIdsDatasets { + this := RunStorageIdsDatasets{} + return &this +} + +// NewRunStorageIdsDatasetsWithDefaults instantiates a new RunStorageIdsDatasets object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRunStorageIdsDatasetsWithDefaults() *RunStorageIdsDatasets { + this := RunStorageIdsDatasets{} + return &this +} + +// GetDefault returns the Default field value if set, zero value otherwise. +func (o *RunStorageIdsDatasets) GetDefault() string { + if o == nil || IsNil(o.Default) { + var ret string + return ret + } + return *o.Default +} + +// GetDefaultOk returns a tuple with the Default field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RunStorageIdsDatasets) GetDefaultOk() (*string, bool) { + if o == nil || IsNil(o.Default) { + return nil, false + } + return o.Default, true +} + +// HasDefault returns a boolean if a field has been set. +func (o *RunStorageIdsDatasets) HasDefault() bool { + if o != nil && !IsNil(o.Default) { + return true + } + + return false +} + +// SetDefault gets a reference to the given string and assigns it to the Default field. +func (o *RunStorageIdsDatasets) SetDefault(v string) { + o.Default = &v +} + +func (o RunStorageIdsDatasets) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o RunStorageIdsDatasets) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Default) { + toSerialize["default"] = o.Default + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *RunStorageIdsDatasets) UnmarshalJSON(data []byte) (err error) { + varRunStorageIdsDatasets := _RunStorageIdsDatasets{} + + err = json.Unmarshal(data, &varRunStorageIdsDatasets) + + if err != nil { + return err + } + + *o = RunStorageIdsDatasets(varRunStorageIdsDatasets) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "default") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableRunStorageIdsDatasets struct { + value *RunStorageIdsDatasets + isSet bool +} + +func (v NullableRunStorageIdsDatasets) Get() *RunStorageIdsDatasets { + return v.value +} + +func (v *NullableRunStorageIdsDatasets) Set(val *RunStorageIdsDatasets) { + v.value = val + v.isSet = true +} + +func (v NullableRunStorageIdsDatasets) IsSet() bool { + return v.isSet +} + +func (v *NullableRunStorageIdsDatasets) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRunStorageIdsDatasets(val *RunStorageIdsDatasets) *NullableRunStorageIdsDatasets { + return &NullableRunStorageIdsDatasets{value: val, isSet: true} +} + +func (v NullableRunStorageIdsDatasets) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRunStorageIdsDatasets) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_run_timeout_exceeded_error_detail.go b/model_run_timeout_exceeded_error_detail.go new file mode 100644 index 0000000..630f69a --- /dev/null +++ b/model_run_timeout_exceeded_error_detail.go @@ -0,0 +1,164 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" +) + +// checks if the RunTimeoutExceededErrorDetail type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RunTimeoutExceededErrorDetail{} + +// RunTimeoutExceededErrorDetail struct for RunTimeoutExceededErrorDetail +type RunTimeoutExceededErrorDetail struct { + Type interface{} `json:"type,omitempty"` + // Human-readable error message describing what went wrong. + Message *string `json:"message,omitempty"` +} + +// NewRunTimeoutExceededErrorDetail instantiates a new RunTimeoutExceededErrorDetail object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewRunTimeoutExceededErrorDetail() *RunTimeoutExceededErrorDetail { + this := RunTimeoutExceededErrorDetail{} + return &this +} + +// NewRunTimeoutExceededErrorDetailWithDefaults instantiates a new RunTimeoutExceededErrorDetail object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRunTimeoutExceededErrorDetailWithDefaults() *RunTimeoutExceededErrorDetail { + this := RunTimeoutExceededErrorDetail{} + return &this +} + +// GetType returns the Type field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *RunTimeoutExceededErrorDetail) GetType() interface{} { + if o == nil { + var ret interface{} + return ret + } + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *RunTimeoutExceededErrorDetail) GetTypeOk() (*interface{}, bool) { + if o == nil || IsNil(o.Type) { + return nil, false + } + return &o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *RunTimeoutExceededErrorDetail) HasType() bool { + if o != nil && !IsNil(o.Type) { + return true + } + + return false +} + +// SetType gets a reference to the given interface{} and assigns it to the Type field. +func (o *RunTimeoutExceededErrorDetail) SetType(v interface{}) { + o.Type = v +} + +// GetMessage returns the Message field value if set, zero value otherwise. +func (o *RunTimeoutExceededErrorDetail) GetMessage() string { + if o == nil || IsNil(o.Message) { + var ret string + return ret + } + return *o.Message +} + +// GetMessageOk returns a tuple with the Message field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RunTimeoutExceededErrorDetail) GetMessageOk() (*string, bool) { + if o == nil || IsNil(o.Message) { + return nil, false + } + return o.Message, true +} + +// HasMessage returns a boolean if a field has been set. +func (o *RunTimeoutExceededErrorDetail) HasMessage() bool { + if o != nil && !IsNil(o.Message) { + return true + } + + return false +} + +// SetMessage gets a reference to the given string and assigns it to the Message field. +func (o *RunTimeoutExceededErrorDetail) SetMessage(v string) { + o.Message = &v +} + +func (o RunTimeoutExceededErrorDetail) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o RunTimeoutExceededErrorDetail) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.Type != nil { + toSerialize["type"] = o.Type + } + if !IsNil(o.Message) { + toSerialize["message"] = o.Message + } + return toSerialize, nil +} + +type NullableRunTimeoutExceededErrorDetail struct { + value *RunTimeoutExceededErrorDetail + isSet bool +} + +func (v NullableRunTimeoutExceededErrorDetail) Get() *RunTimeoutExceededErrorDetail { + return v.value +} + +func (v *NullableRunTimeoutExceededErrorDetail) Set(val *RunTimeoutExceededErrorDetail) { + v.value = val + v.isSet = true +} + +func (v NullableRunTimeoutExceededErrorDetail) IsSet() bool { + return v.isSet +} + +func (v *NullableRunTimeoutExceededErrorDetail) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRunTimeoutExceededErrorDetail(val *RunTimeoutExceededErrorDetail) *NullableRunTimeoutExceededErrorDetail { + return &NullableRunTimeoutExceededErrorDetail{value: val, isSet: true} +} + +func (v NullableRunTimeoutExceededErrorDetail) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRunTimeoutExceededErrorDetail) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_run_usage.go b/model_run_usage.go new file mode 100644 index 0000000..9c83bb8 --- /dev/null +++ b/model_run_usage.go @@ -0,0 +1,642 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" +) + +// checks if the RunUsage type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RunUsage{} + +// RunUsage struct for RunUsage +type RunUsage struct { + ACTOR_COMPUTE_UNITS NullableFloat32 `json:"ACTOR_COMPUTE_UNITS,omitempty"` + DATASET_READS NullableInt32 `json:"DATASET_READS,omitempty"` + DATASET_WRITES NullableInt32 `json:"DATASET_WRITES,omitempty"` + KEY_VALUE_STORE_READS NullableInt32 `json:"KEY_VALUE_STORE_READS,omitempty"` + KEY_VALUE_STORE_WRITES NullableInt32 `json:"KEY_VALUE_STORE_WRITES,omitempty"` + KEY_VALUE_STORE_LISTS NullableInt32 `json:"KEY_VALUE_STORE_LISTS,omitempty"` + REQUEST_QUEUE_READS NullableInt32 `json:"REQUEST_QUEUE_READS,omitempty"` + REQUEST_QUEUE_WRITES NullableInt32 `json:"REQUEST_QUEUE_WRITES,omitempty"` + DATA_TRANSFER_INTERNAL_GBYTES NullableFloat32 `json:"DATA_TRANSFER_INTERNAL_GBYTES,omitempty"` + DATA_TRANSFER_EXTERNAL_GBYTES NullableFloat32 `json:"DATA_TRANSFER_EXTERNAL_GBYTES,omitempty"` + PROXY_RESIDENTIAL_TRANSFER_GBYTES NullableFloat32 `json:"PROXY_RESIDENTIAL_TRANSFER_GBYTES,omitempty"` + PROXY_SERPS NullableInt32 `json:"PROXY_SERPS,omitempty"` +} + +// NewRunUsage instantiates a new RunUsage object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewRunUsage() *RunUsage { + this := RunUsage{} + return &this +} + +// NewRunUsageWithDefaults instantiates a new RunUsage object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRunUsageWithDefaults() *RunUsage { + this := RunUsage{} + return &this +} + +// GetACTOR_COMPUTE_UNITS returns the ACTOR_COMPUTE_UNITS field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *RunUsage) GetACTOR_COMPUTE_UNITS() float32 { + if o == nil || IsNil(o.ACTOR_COMPUTE_UNITS.Get()) { + var ret float32 + return ret + } + return *o.ACTOR_COMPUTE_UNITS.Get() +} + +// GetACTOR_COMPUTE_UNITSOk returns a tuple with the ACTOR_COMPUTE_UNITS field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *RunUsage) GetACTOR_COMPUTE_UNITSOk() (*float32, bool) { + if o == nil { + return nil, false + } + return o.ACTOR_COMPUTE_UNITS.Get(), o.ACTOR_COMPUTE_UNITS.IsSet() +} + +// HasACTOR_COMPUTE_UNITS returns a boolean if a field has been set. +func (o *RunUsage) HasACTOR_COMPUTE_UNITS() bool { + if o != nil && o.ACTOR_COMPUTE_UNITS.IsSet() { + return true + } + + return false +} + +// SetACTOR_COMPUTE_UNITS gets a reference to the given NullableFloat32 and assigns it to the ACTOR_COMPUTE_UNITS field. +func (o *RunUsage) SetACTOR_COMPUTE_UNITS(v float32) { + o.ACTOR_COMPUTE_UNITS.Set(&v) +} +// SetACTOR_COMPUTE_UNITSNil sets the value for ACTOR_COMPUTE_UNITS to be an explicit nil +func (o *RunUsage) SetACTOR_COMPUTE_UNITSNil() { + o.ACTOR_COMPUTE_UNITS.Set(nil) +} + +// UnsetACTOR_COMPUTE_UNITS ensures that no value is present for ACTOR_COMPUTE_UNITS, not even an explicit nil +func (o *RunUsage) UnsetACTOR_COMPUTE_UNITS() { + o.ACTOR_COMPUTE_UNITS.Unset() +} + +// GetDATASET_READS returns the DATASET_READS field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *RunUsage) GetDATASET_READS() int32 { + if o == nil || IsNil(o.DATASET_READS.Get()) { + var ret int32 + return ret + } + return *o.DATASET_READS.Get() +} + +// GetDATASET_READSOk returns a tuple with the DATASET_READS field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *RunUsage) GetDATASET_READSOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.DATASET_READS.Get(), o.DATASET_READS.IsSet() +} + +// HasDATASET_READS returns a boolean if a field has been set. +func (o *RunUsage) HasDATASET_READS() bool { + if o != nil && o.DATASET_READS.IsSet() { + return true + } + + return false +} + +// SetDATASET_READS gets a reference to the given NullableInt32 and assigns it to the DATASET_READS field. +func (o *RunUsage) SetDATASET_READS(v int32) { + o.DATASET_READS.Set(&v) +} +// SetDATASET_READSNil sets the value for DATASET_READS to be an explicit nil +func (o *RunUsage) SetDATASET_READSNil() { + o.DATASET_READS.Set(nil) +} + +// UnsetDATASET_READS ensures that no value is present for DATASET_READS, not even an explicit nil +func (o *RunUsage) UnsetDATASET_READS() { + o.DATASET_READS.Unset() +} + +// GetDATASET_WRITES returns the DATASET_WRITES field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *RunUsage) GetDATASET_WRITES() int32 { + if o == nil || IsNil(o.DATASET_WRITES.Get()) { + var ret int32 + return ret + } + return *o.DATASET_WRITES.Get() +} + +// GetDATASET_WRITESOk returns a tuple with the DATASET_WRITES field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *RunUsage) GetDATASET_WRITESOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.DATASET_WRITES.Get(), o.DATASET_WRITES.IsSet() +} + +// HasDATASET_WRITES returns a boolean if a field has been set. +func (o *RunUsage) HasDATASET_WRITES() bool { + if o != nil && o.DATASET_WRITES.IsSet() { + return true + } + + return false +} + +// SetDATASET_WRITES gets a reference to the given NullableInt32 and assigns it to the DATASET_WRITES field. +func (o *RunUsage) SetDATASET_WRITES(v int32) { + o.DATASET_WRITES.Set(&v) +} +// SetDATASET_WRITESNil sets the value for DATASET_WRITES to be an explicit nil +func (o *RunUsage) SetDATASET_WRITESNil() { + o.DATASET_WRITES.Set(nil) +} + +// UnsetDATASET_WRITES ensures that no value is present for DATASET_WRITES, not even an explicit nil +func (o *RunUsage) UnsetDATASET_WRITES() { + o.DATASET_WRITES.Unset() +} + +// GetKEY_VALUE_STORE_READS returns the KEY_VALUE_STORE_READS field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *RunUsage) GetKEY_VALUE_STORE_READS() int32 { + if o == nil || IsNil(o.KEY_VALUE_STORE_READS.Get()) { + var ret int32 + return ret + } + return *o.KEY_VALUE_STORE_READS.Get() +} + +// GetKEY_VALUE_STORE_READSOk returns a tuple with the KEY_VALUE_STORE_READS field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *RunUsage) GetKEY_VALUE_STORE_READSOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.KEY_VALUE_STORE_READS.Get(), o.KEY_VALUE_STORE_READS.IsSet() +} + +// HasKEY_VALUE_STORE_READS returns a boolean if a field has been set. +func (o *RunUsage) HasKEY_VALUE_STORE_READS() bool { + if o != nil && o.KEY_VALUE_STORE_READS.IsSet() { + return true + } + + return false +} + +// SetKEY_VALUE_STORE_READS gets a reference to the given NullableInt32 and assigns it to the KEY_VALUE_STORE_READS field. +func (o *RunUsage) SetKEY_VALUE_STORE_READS(v int32) { + o.KEY_VALUE_STORE_READS.Set(&v) +} +// SetKEY_VALUE_STORE_READSNil sets the value for KEY_VALUE_STORE_READS to be an explicit nil +func (o *RunUsage) SetKEY_VALUE_STORE_READSNil() { + o.KEY_VALUE_STORE_READS.Set(nil) +} + +// UnsetKEY_VALUE_STORE_READS ensures that no value is present for KEY_VALUE_STORE_READS, not even an explicit nil +func (o *RunUsage) UnsetKEY_VALUE_STORE_READS() { + o.KEY_VALUE_STORE_READS.Unset() +} + +// GetKEY_VALUE_STORE_WRITES returns the KEY_VALUE_STORE_WRITES field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *RunUsage) GetKEY_VALUE_STORE_WRITES() int32 { + if o == nil || IsNil(o.KEY_VALUE_STORE_WRITES.Get()) { + var ret int32 + return ret + } + return *o.KEY_VALUE_STORE_WRITES.Get() +} + +// GetKEY_VALUE_STORE_WRITESOk returns a tuple with the KEY_VALUE_STORE_WRITES field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *RunUsage) GetKEY_VALUE_STORE_WRITESOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.KEY_VALUE_STORE_WRITES.Get(), o.KEY_VALUE_STORE_WRITES.IsSet() +} + +// HasKEY_VALUE_STORE_WRITES returns a boolean if a field has been set. +func (o *RunUsage) HasKEY_VALUE_STORE_WRITES() bool { + if o != nil && o.KEY_VALUE_STORE_WRITES.IsSet() { + return true + } + + return false +} + +// SetKEY_VALUE_STORE_WRITES gets a reference to the given NullableInt32 and assigns it to the KEY_VALUE_STORE_WRITES field. +func (o *RunUsage) SetKEY_VALUE_STORE_WRITES(v int32) { + o.KEY_VALUE_STORE_WRITES.Set(&v) +} +// SetKEY_VALUE_STORE_WRITESNil sets the value for KEY_VALUE_STORE_WRITES to be an explicit nil +func (o *RunUsage) SetKEY_VALUE_STORE_WRITESNil() { + o.KEY_VALUE_STORE_WRITES.Set(nil) +} + +// UnsetKEY_VALUE_STORE_WRITES ensures that no value is present for KEY_VALUE_STORE_WRITES, not even an explicit nil +func (o *RunUsage) UnsetKEY_VALUE_STORE_WRITES() { + o.KEY_VALUE_STORE_WRITES.Unset() +} + +// GetKEY_VALUE_STORE_LISTS returns the KEY_VALUE_STORE_LISTS field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *RunUsage) GetKEY_VALUE_STORE_LISTS() int32 { + if o == nil || IsNil(o.KEY_VALUE_STORE_LISTS.Get()) { + var ret int32 + return ret + } + return *o.KEY_VALUE_STORE_LISTS.Get() +} + +// GetKEY_VALUE_STORE_LISTSOk returns a tuple with the KEY_VALUE_STORE_LISTS field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *RunUsage) GetKEY_VALUE_STORE_LISTSOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.KEY_VALUE_STORE_LISTS.Get(), o.KEY_VALUE_STORE_LISTS.IsSet() +} + +// HasKEY_VALUE_STORE_LISTS returns a boolean if a field has been set. +func (o *RunUsage) HasKEY_VALUE_STORE_LISTS() bool { + if o != nil && o.KEY_VALUE_STORE_LISTS.IsSet() { + return true + } + + return false +} + +// SetKEY_VALUE_STORE_LISTS gets a reference to the given NullableInt32 and assigns it to the KEY_VALUE_STORE_LISTS field. +func (o *RunUsage) SetKEY_VALUE_STORE_LISTS(v int32) { + o.KEY_VALUE_STORE_LISTS.Set(&v) +} +// SetKEY_VALUE_STORE_LISTSNil sets the value for KEY_VALUE_STORE_LISTS to be an explicit nil +func (o *RunUsage) SetKEY_VALUE_STORE_LISTSNil() { + o.KEY_VALUE_STORE_LISTS.Set(nil) +} + +// UnsetKEY_VALUE_STORE_LISTS ensures that no value is present for KEY_VALUE_STORE_LISTS, not even an explicit nil +func (o *RunUsage) UnsetKEY_VALUE_STORE_LISTS() { + o.KEY_VALUE_STORE_LISTS.Unset() +} + +// GetREQUEST_QUEUE_READS returns the REQUEST_QUEUE_READS field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *RunUsage) GetREQUEST_QUEUE_READS() int32 { + if o == nil || IsNil(o.REQUEST_QUEUE_READS.Get()) { + var ret int32 + return ret + } + return *o.REQUEST_QUEUE_READS.Get() +} + +// GetREQUEST_QUEUE_READSOk returns a tuple with the REQUEST_QUEUE_READS field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *RunUsage) GetREQUEST_QUEUE_READSOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.REQUEST_QUEUE_READS.Get(), o.REQUEST_QUEUE_READS.IsSet() +} + +// HasREQUEST_QUEUE_READS returns a boolean if a field has been set. +func (o *RunUsage) HasREQUEST_QUEUE_READS() bool { + if o != nil && o.REQUEST_QUEUE_READS.IsSet() { + return true + } + + return false +} + +// SetREQUEST_QUEUE_READS gets a reference to the given NullableInt32 and assigns it to the REQUEST_QUEUE_READS field. +func (o *RunUsage) SetREQUEST_QUEUE_READS(v int32) { + o.REQUEST_QUEUE_READS.Set(&v) +} +// SetREQUEST_QUEUE_READSNil sets the value for REQUEST_QUEUE_READS to be an explicit nil +func (o *RunUsage) SetREQUEST_QUEUE_READSNil() { + o.REQUEST_QUEUE_READS.Set(nil) +} + +// UnsetREQUEST_QUEUE_READS ensures that no value is present for REQUEST_QUEUE_READS, not even an explicit nil +func (o *RunUsage) UnsetREQUEST_QUEUE_READS() { + o.REQUEST_QUEUE_READS.Unset() +} + +// GetREQUEST_QUEUE_WRITES returns the REQUEST_QUEUE_WRITES field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *RunUsage) GetREQUEST_QUEUE_WRITES() int32 { + if o == nil || IsNil(o.REQUEST_QUEUE_WRITES.Get()) { + var ret int32 + return ret + } + return *o.REQUEST_QUEUE_WRITES.Get() +} + +// GetREQUEST_QUEUE_WRITESOk returns a tuple with the REQUEST_QUEUE_WRITES field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *RunUsage) GetREQUEST_QUEUE_WRITESOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.REQUEST_QUEUE_WRITES.Get(), o.REQUEST_QUEUE_WRITES.IsSet() +} + +// HasREQUEST_QUEUE_WRITES returns a boolean if a field has been set. +func (o *RunUsage) HasREQUEST_QUEUE_WRITES() bool { + if o != nil && o.REQUEST_QUEUE_WRITES.IsSet() { + return true + } + + return false +} + +// SetREQUEST_QUEUE_WRITES gets a reference to the given NullableInt32 and assigns it to the REQUEST_QUEUE_WRITES field. +func (o *RunUsage) SetREQUEST_QUEUE_WRITES(v int32) { + o.REQUEST_QUEUE_WRITES.Set(&v) +} +// SetREQUEST_QUEUE_WRITESNil sets the value for REQUEST_QUEUE_WRITES to be an explicit nil +func (o *RunUsage) SetREQUEST_QUEUE_WRITESNil() { + o.REQUEST_QUEUE_WRITES.Set(nil) +} + +// UnsetREQUEST_QUEUE_WRITES ensures that no value is present for REQUEST_QUEUE_WRITES, not even an explicit nil +func (o *RunUsage) UnsetREQUEST_QUEUE_WRITES() { + o.REQUEST_QUEUE_WRITES.Unset() +} + +// GetDATA_TRANSFER_INTERNAL_GBYTES returns the DATA_TRANSFER_INTERNAL_GBYTES field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *RunUsage) GetDATA_TRANSFER_INTERNAL_GBYTES() float32 { + if o == nil || IsNil(o.DATA_TRANSFER_INTERNAL_GBYTES.Get()) { + var ret float32 + return ret + } + return *o.DATA_TRANSFER_INTERNAL_GBYTES.Get() +} + +// GetDATA_TRANSFER_INTERNAL_GBYTESOk returns a tuple with the DATA_TRANSFER_INTERNAL_GBYTES field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *RunUsage) GetDATA_TRANSFER_INTERNAL_GBYTESOk() (*float32, bool) { + if o == nil { + return nil, false + } + return o.DATA_TRANSFER_INTERNAL_GBYTES.Get(), o.DATA_TRANSFER_INTERNAL_GBYTES.IsSet() +} + +// HasDATA_TRANSFER_INTERNAL_GBYTES returns a boolean if a field has been set. +func (o *RunUsage) HasDATA_TRANSFER_INTERNAL_GBYTES() bool { + if o != nil && o.DATA_TRANSFER_INTERNAL_GBYTES.IsSet() { + return true + } + + return false +} + +// SetDATA_TRANSFER_INTERNAL_GBYTES gets a reference to the given NullableFloat32 and assigns it to the DATA_TRANSFER_INTERNAL_GBYTES field. +func (o *RunUsage) SetDATA_TRANSFER_INTERNAL_GBYTES(v float32) { + o.DATA_TRANSFER_INTERNAL_GBYTES.Set(&v) +} +// SetDATA_TRANSFER_INTERNAL_GBYTESNil sets the value for DATA_TRANSFER_INTERNAL_GBYTES to be an explicit nil +func (o *RunUsage) SetDATA_TRANSFER_INTERNAL_GBYTESNil() { + o.DATA_TRANSFER_INTERNAL_GBYTES.Set(nil) +} + +// UnsetDATA_TRANSFER_INTERNAL_GBYTES ensures that no value is present for DATA_TRANSFER_INTERNAL_GBYTES, not even an explicit nil +func (o *RunUsage) UnsetDATA_TRANSFER_INTERNAL_GBYTES() { + o.DATA_TRANSFER_INTERNAL_GBYTES.Unset() +} + +// GetDATA_TRANSFER_EXTERNAL_GBYTES returns the DATA_TRANSFER_EXTERNAL_GBYTES field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *RunUsage) GetDATA_TRANSFER_EXTERNAL_GBYTES() float32 { + if o == nil || IsNil(o.DATA_TRANSFER_EXTERNAL_GBYTES.Get()) { + var ret float32 + return ret + } + return *o.DATA_TRANSFER_EXTERNAL_GBYTES.Get() +} + +// GetDATA_TRANSFER_EXTERNAL_GBYTESOk returns a tuple with the DATA_TRANSFER_EXTERNAL_GBYTES field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *RunUsage) GetDATA_TRANSFER_EXTERNAL_GBYTESOk() (*float32, bool) { + if o == nil { + return nil, false + } + return o.DATA_TRANSFER_EXTERNAL_GBYTES.Get(), o.DATA_TRANSFER_EXTERNAL_GBYTES.IsSet() +} + +// HasDATA_TRANSFER_EXTERNAL_GBYTES returns a boolean if a field has been set. +func (o *RunUsage) HasDATA_TRANSFER_EXTERNAL_GBYTES() bool { + if o != nil && o.DATA_TRANSFER_EXTERNAL_GBYTES.IsSet() { + return true + } + + return false +} + +// SetDATA_TRANSFER_EXTERNAL_GBYTES gets a reference to the given NullableFloat32 and assigns it to the DATA_TRANSFER_EXTERNAL_GBYTES field. +func (o *RunUsage) SetDATA_TRANSFER_EXTERNAL_GBYTES(v float32) { + o.DATA_TRANSFER_EXTERNAL_GBYTES.Set(&v) +} +// SetDATA_TRANSFER_EXTERNAL_GBYTESNil sets the value for DATA_TRANSFER_EXTERNAL_GBYTES to be an explicit nil +func (o *RunUsage) SetDATA_TRANSFER_EXTERNAL_GBYTESNil() { + o.DATA_TRANSFER_EXTERNAL_GBYTES.Set(nil) +} + +// UnsetDATA_TRANSFER_EXTERNAL_GBYTES ensures that no value is present for DATA_TRANSFER_EXTERNAL_GBYTES, not even an explicit nil +func (o *RunUsage) UnsetDATA_TRANSFER_EXTERNAL_GBYTES() { + o.DATA_TRANSFER_EXTERNAL_GBYTES.Unset() +} + +// GetPROXY_RESIDENTIAL_TRANSFER_GBYTES returns the PROXY_RESIDENTIAL_TRANSFER_GBYTES field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *RunUsage) GetPROXY_RESIDENTIAL_TRANSFER_GBYTES() float32 { + if o == nil || IsNil(o.PROXY_RESIDENTIAL_TRANSFER_GBYTES.Get()) { + var ret float32 + return ret + } + return *o.PROXY_RESIDENTIAL_TRANSFER_GBYTES.Get() +} + +// GetPROXY_RESIDENTIAL_TRANSFER_GBYTESOk returns a tuple with the PROXY_RESIDENTIAL_TRANSFER_GBYTES field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *RunUsage) GetPROXY_RESIDENTIAL_TRANSFER_GBYTESOk() (*float32, bool) { + if o == nil { + return nil, false + } + return o.PROXY_RESIDENTIAL_TRANSFER_GBYTES.Get(), o.PROXY_RESIDENTIAL_TRANSFER_GBYTES.IsSet() +} + +// HasPROXY_RESIDENTIAL_TRANSFER_GBYTES returns a boolean if a field has been set. +func (o *RunUsage) HasPROXY_RESIDENTIAL_TRANSFER_GBYTES() bool { + if o != nil && o.PROXY_RESIDENTIAL_TRANSFER_GBYTES.IsSet() { + return true + } + + return false +} + +// SetPROXY_RESIDENTIAL_TRANSFER_GBYTES gets a reference to the given NullableFloat32 and assigns it to the PROXY_RESIDENTIAL_TRANSFER_GBYTES field. +func (o *RunUsage) SetPROXY_RESIDENTIAL_TRANSFER_GBYTES(v float32) { + o.PROXY_RESIDENTIAL_TRANSFER_GBYTES.Set(&v) +} +// SetPROXY_RESIDENTIAL_TRANSFER_GBYTESNil sets the value for PROXY_RESIDENTIAL_TRANSFER_GBYTES to be an explicit nil +func (o *RunUsage) SetPROXY_RESIDENTIAL_TRANSFER_GBYTESNil() { + o.PROXY_RESIDENTIAL_TRANSFER_GBYTES.Set(nil) +} + +// UnsetPROXY_RESIDENTIAL_TRANSFER_GBYTES ensures that no value is present for PROXY_RESIDENTIAL_TRANSFER_GBYTES, not even an explicit nil +func (o *RunUsage) UnsetPROXY_RESIDENTIAL_TRANSFER_GBYTES() { + o.PROXY_RESIDENTIAL_TRANSFER_GBYTES.Unset() +} + +// GetPROXY_SERPS returns the PROXY_SERPS field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *RunUsage) GetPROXY_SERPS() int32 { + if o == nil || IsNil(o.PROXY_SERPS.Get()) { + var ret int32 + return ret + } + return *o.PROXY_SERPS.Get() +} + +// GetPROXY_SERPSOk returns a tuple with the PROXY_SERPS field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *RunUsage) GetPROXY_SERPSOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.PROXY_SERPS.Get(), o.PROXY_SERPS.IsSet() +} + +// HasPROXY_SERPS returns a boolean if a field has been set. +func (o *RunUsage) HasPROXY_SERPS() bool { + if o != nil && o.PROXY_SERPS.IsSet() { + return true + } + + return false +} + +// SetPROXY_SERPS gets a reference to the given NullableInt32 and assigns it to the PROXY_SERPS field. +func (o *RunUsage) SetPROXY_SERPS(v int32) { + o.PROXY_SERPS.Set(&v) +} +// SetPROXY_SERPSNil sets the value for PROXY_SERPS to be an explicit nil +func (o *RunUsage) SetPROXY_SERPSNil() { + o.PROXY_SERPS.Set(nil) +} + +// UnsetPROXY_SERPS ensures that no value is present for PROXY_SERPS, not even an explicit nil +func (o *RunUsage) UnsetPROXY_SERPS() { + o.PROXY_SERPS.Unset() +} + +func (o RunUsage) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o RunUsage) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.ACTOR_COMPUTE_UNITS.IsSet() { + toSerialize["ACTOR_COMPUTE_UNITS"] = o.ACTOR_COMPUTE_UNITS.Get() + } + if o.DATASET_READS.IsSet() { + toSerialize["DATASET_READS"] = o.DATASET_READS.Get() + } + if o.DATASET_WRITES.IsSet() { + toSerialize["DATASET_WRITES"] = o.DATASET_WRITES.Get() + } + if o.KEY_VALUE_STORE_READS.IsSet() { + toSerialize["KEY_VALUE_STORE_READS"] = o.KEY_VALUE_STORE_READS.Get() + } + if o.KEY_VALUE_STORE_WRITES.IsSet() { + toSerialize["KEY_VALUE_STORE_WRITES"] = o.KEY_VALUE_STORE_WRITES.Get() + } + if o.KEY_VALUE_STORE_LISTS.IsSet() { + toSerialize["KEY_VALUE_STORE_LISTS"] = o.KEY_VALUE_STORE_LISTS.Get() + } + if o.REQUEST_QUEUE_READS.IsSet() { + toSerialize["REQUEST_QUEUE_READS"] = o.REQUEST_QUEUE_READS.Get() + } + if o.REQUEST_QUEUE_WRITES.IsSet() { + toSerialize["REQUEST_QUEUE_WRITES"] = o.REQUEST_QUEUE_WRITES.Get() + } + if o.DATA_TRANSFER_INTERNAL_GBYTES.IsSet() { + toSerialize["DATA_TRANSFER_INTERNAL_GBYTES"] = o.DATA_TRANSFER_INTERNAL_GBYTES.Get() + } + if o.DATA_TRANSFER_EXTERNAL_GBYTES.IsSet() { + toSerialize["DATA_TRANSFER_EXTERNAL_GBYTES"] = o.DATA_TRANSFER_EXTERNAL_GBYTES.Get() + } + if o.PROXY_RESIDENTIAL_TRANSFER_GBYTES.IsSet() { + toSerialize["PROXY_RESIDENTIAL_TRANSFER_GBYTES"] = o.PROXY_RESIDENTIAL_TRANSFER_GBYTES.Get() + } + if o.PROXY_SERPS.IsSet() { + toSerialize["PROXY_SERPS"] = o.PROXY_SERPS.Get() + } + return toSerialize, nil +} + +type NullableRunUsage struct { + value *RunUsage + isSet bool +} + +func (v NullableRunUsage) Get() *RunUsage { + return v.value +} + +func (v *NullableRunUsage) Set(val *RunUsage) { + v.value = val + v.isSet = true +} + +func (v NullableRunUsage) IsSet() bool { + return v.isSet +} + +func (v *NullableRunUsage) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRunUsage(val *RunUsage) *NullableRunUsage { + return &NullableRunUsage{value: val, isSet: true} +} + +func (v NullableRunUsage) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRunUsage) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_run_usage_usd.go b/model_run_usage_usd.go new file mode 100644 index 0000000..100eb02 --- /dev/null +++ b/model_run_usage_usd.go @@ -0,0 +1,642 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" +) + +// checks if the RunUsageUsd type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RunUsageUsd{} + +// RunUsageUsd Resource usage costs in USD. All values are monetary amounts in US dollars. +type RunUsageUsd struct { + ACTOR_COMPUTE_UNITS NullableFloat32 `json:"ACTOR_COMPUTE_UNITS,omitempty"` + DATASET_READS NullableFloat32 `json:"DATASET_READS,omitempty"` + DATASET_WRITES NullableFloat32 `json:"DATASET_WRITES,omitempty"` + KEY_VALUE_STORE_READS NullableFloat32 `json:"KEY_VALUE_STORE_READS,omitempty"` + KEY_VALUE_STORE_WRITES NullableFloat32 `json:"KEY_VALUE_STORE_WRITES,omitempty"` + KEY_VALUE_STORE_LISTS NullableFloat32 `json:"KEY_VALUE_STORE_LISTS,omitempty"` + REQUEST_QUEUE_READS NullableFloat32 `json:"REQUEST_QUEUE_READS,omitempty"` + REQUEST_QUEUE_WRITES NullableFloat32 `json:"REQUEST_QUEUE_WRITES,omitempty"` + DATA_TRANSFER_INTERNAL_GBYTES NullableFloat32 `json:"DATA_TRANSFER_INTERNAL_GBYTES,omitempty"` + DATA_TRANSFER_EXTERNAL_GBYTES NullableFloat32 `json:"DATA_TRANSFER_EXTERNAL_GBYTES,omitempty"` + PROXY_RESIDENTIAL_TRANSFER_GBYTES NullableFloat32 `json:"PROXY_RESIDENTIAL_TRANSFER_GBYTES,omitempty"` + PROXY_SERPS NullableFloat32 `json:"PROXY_SERPS,omitempty"` +} + +// NewRunUsageUsd instantiates a new RunUsageUsd object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewRunUsageUsd() *RunUsageUsd { + this := RunUsageUsd{} + return &this +} + +// NewRunUsageUsdWithDefaults instantiates a new RunUsageUsd object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRunUsageUsdWithDefaults() *RunUsageUsd { + this := RunUsageUsd{} + return &this +} + +// GetACTOR_COMPUTE_UNITS returns the ACTOR_COMPUTE_UNITS field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *RunUsageUsd) GetACTOR_COMPUTE_UNITS() float32 { + if o == nil || IsNil(o.ACTOR_COMPUTE_UNITS.Get()) { + var ret float32 + return ret + } + return *o.ACTOR_COMPUTE_UNITS.Get() +} + +// GetACTOR_COMPUTE_UNITSOk returns a tuple with the ACTOR_COMPUTE_UNITS field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *RunUsageUsd) GetACTOR_COMPUTE_UNITSOk() (*float32, bool) { + if o == nil { + return nil, false + } + return o.ACTOR_COMPUTE_UNITS.Get(), o.ACTOR_COMPUTE_UNITS.IsSet() +} + +// HasACTOR_COMPUTE_UNITS returns a boolean if a field has been set. +func (o *RunUsageUsd) HasACTOR_COMPUTE_UNITS() bool { + if o != nil && o.ACTOR_COMPUTE_UNITS.IsSet() { + return true + } + + return false +} + +// SetACTOR_COMPUTE_UNITS gets a reference to the given NullableFloat32 and assigns it to the ACTOR_COMPUTE_UNITS field. +func (o *RunUsageUsd) SetACTOR_COMPUTE_UNITS(v float32) { + o.ACTOR_COMPUTE_UNITS.Set(&v) +} +// SetACTOR_COMPUTE_UNITSNil sets the value for ACTOR_COMPUTE_UNITS to be an explicit nil +func (o *RunUsageUsd) SetACTOR_COMPUTE_UNITSNil() { + o.ACTOR_COMPUTE_UNITS.Set(nil) +} + +// UnsetACTOR_COMPUTE_UNITS ensures that no value is present for ACTOR_COMPUTE_UNITS, not even an explicit nil +func (o *RunUsageUsd) UnsetACTOR_COMPUTE_UNITS() { + o.ACTOR_COMPUTE_UNITS.Unset() +} + +// GetDATASET_READS returns the DATASET_READS field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *RunUsageUsd) GetDATASET_READS() float32 { + if o == nil || IsNil(o.DATASET_READS.Get()) { + var ret float32 + return ret + } + return *o.DATASET_READS.Get() +} + +// GetDATASET_READSOk returns a tuple with the DATASET_READS field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *RunUsageUsd) GetDATASET_READSOk() (*float32, bool) { + if o == nil { + return nil, false + } + return o.DATASET_READS.Get(), o.DATASET_READS.IsSet() +} + +// HasDATASET_READS returns a boolean if a field has been set. +func (o *RunUsageUsd) HasDATASET_READS() bool { + if o != nil && o.DATASET_READS.IsSet() { + return true + } + + return false +} + +// SetDATASET_READS gets a reference to the given NullableFloat32 and assigns it to the DATASET_READS field. +func (o *RunUsageUsd) SetDATASET_READS(v float32) { + o.DATASET_READS.Set(&v) +} +// SetDATASET_READSNil sets the value for DATASET_READS to be an explicit nil +func (o *RunUsageUsd) SetDATASET_READSNil() { + o.DATASET_READS.Set(nil) +} + +// UnsetDATASET_READS ensures that no value is present for DATASET_READS, not even an explicit nil +func (o *RunUsageUsd) UnsetDATASET_READS() { + o.DATASET_READS.Unset() +} + +// GetDATASET_WRITES returns the DATASET_WRITES field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *RunUsageUsd) GetDATASET_WRITES() float32 { + if o == nil || IsNil(o.DATASET_WRITES.Get()) { + var ret float32 + return ret + } + return *o.DATASET_WRITES.Get() +} + +// GetDATASET_WRITESOk returns a tuple with the DATASET_WRITES field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *RunUsageUsd) GetDATASET_WRITESOk() (*float32, bool) { + if o == nil { + return nil, false + } + return o.DATASET_WRITES.Get(), o.DATASET_WRITES.IsSet() +} + +// HasDATASET_WRITES returns a boolean if a field has been set. +func (o *RunUsageUsd) HasDATASET_WRITES() bool { + if o != nil && o.DATASET_WRITES.IsSet() { + return true + } + + return false +} + +// SetDATASET_WRITES gets a reference to the given NullableFloat32 and assigns it to the DATASET_WRITES field. +func (o *RunUsageUsd) SetDATASET_WRITES(v float32) { + o.DATASET_WRITES.Set(&v) +} +// SetDATASET_WRITESNil sets the value for DATASET_WRITES to be an explicit nil +func (o *RunUsageUsd) SetDATASET_WRITESNil() { + o.DATASET_WRITES.Set(nil) +} + +// UnsetDATASET_WRITES ensures that no value is present for DATASET_WRITES, not even an explicit nil +func (o *RunUsageUsd) UnsetDATASET_WRITES() { + o.DATASET_WRITES.Unset() +} + +// GetKEY_VALUE_STORE_READS returns the KEY_VALUE_STORE_READS field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *RunUsageUsd) GetKEY_VALUE_STORE_READS() float32 { + if o == nil || IsNil(o.KEY_VALUE_STORE_READS.Get()) { + var ret float32 + return ret + } + return *o.KEY_VALUE_STORE_READS.Get() +} + +// GetKEY_VALUE_STORE_READSOk returns a tuple with the KEY_VALUE_STORE_READS field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *RunUsageUsd) GetKEY_VALUE_STORE_READSOk() (*float32, bool) { + if o == nil { + return nil, false + } + return o.KEY_VALUE_STORE_READS.Get(), o.KEY_VALUE_STORE_READS.IsSet() +} + +// HasKEY_VALUE_STORE_READS returns a boolean if a field has been set. +func (o *RunUsageUsd) HasKEY_VALUE_STORE_READS() bool { + if o != nil && o.KEY_VALUE_STORE_READS.IsSet() { + return true + } + + return false +} + +// SetKEY_VALUE_STORE_READS gets a reference to the given NullableFloat32 and assigns it to the KEY_VALUE_STORE_READS field. +func (o *RunUsageUsd) SetKEY_VALUE_STORE_READS(v float32) { + o.KEY_VALUE_STORE_READS.Set(&v) +} +// SetKEY_VALUE_STORE_READSNil sets the value for KEY_VALUE_STORE_READS to be an explicit nil +func (o *RunUsageUsd) SetKEY_VALUE_STORE_READSNil() { + o.KEY_VALUE_STORE_READS.Set(nil) +} + +// UnsetKEY_VALUE_STORE_READS ensures that no value is present for KEY_VALUE_STORE_READS, not even an explicit nil +func (o *RunUsageUsd) UnsetKEY_VALUE_STORE_READS() { + o.KEY_VALUE_STORE_READS.Unset() +} + +// GetKEY_VALUE_STORE_WRITES returns the KEY_VALUE_STORE_WRITES field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *RunUsageUsd) GetKEY_VALUE_STORE_WRITES() float32 { + if o == nil || IsNil(o.KEY_VALUE_STORE_WRITES.Get()) { + var ret float32 + return ret + } + return *o.KEY_VALUE_STORE_WRITES.Get() +} + +// GetKEY_VALUE_STORE_WRITESOk returns a tuple with the KEY_VALUE_STORE_WRITES field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *RunUsageUsd) GetKEY_VALUE_STORE_WRITESOk() (*float32, bool) { + if o == nil { + return nil, false + } + return o.KEY_VALUE_STORE_WRITES.Get(), o.KEY_VALUE_STORE_WRITES.IsSet() +} + +// HasKEY_VALUE_STORE_WRITES returns a boolean if a field has been set. +func (o *RunUsageUsd) HasKEY_VALUE_STORE_WRITES() bool { + if o != nil && o.KEY_VALUE_STORE_WRITES.IsSet() { + return true + } + + return false +} + +// SetKEY_VALUE_STORE_WRITES gets a reference to the given NullableFloat32 and assigns it to the KEY_VALUE_STORE_WRITES field. +func (o *RunUsageUsd) SetKEY_VALUE_STORE_WRITES(v float32) { + o.KEY_VALUE_STORE_WRITES.Set(&v) +} +// SetKEY_VALUE_STORE_WRITESNil sets the value for KEY_VALUE_STORE_WRITES to be an explicit nil +func (o *RunUsageUsd) SetKEY_VALUE_STORE_WRITESNil() { + o.KEY_VALUE_STORE_WRITES.Set(nil) +} + +// UnsetKEY_VALUE_STORE_WRITES ensures that no value is present for KEY_VALUE_STORE_WRITES, not even an explicit nil +func (o *RunUsageUsd) UnsetKEY_VALUE_STORE_WRITES() { + o.KEY_VALUE_STORE_WRITES.Unset() +} + +// GetKEY_VALUE_STORE_LISTS returns the KEY_VALUE_STORE_LISTS field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *RunUsageUsd) GetKEY_VALUE_STORE_LISTS() float32 { + if o == nil || IsNil(o.KEY_VALUE_STORE_LISTS.Get()) { + var ret float32 + return ret + } + return *o.KEY_VALUE_STORE_LISTS.Get() +} + +// GetKEY_VALUE_STORE_LISTSOk returns a tuple with the KEY_VALUE_STORE_LISTS field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *RunUsageUsd) GetKEY_VALUE_STORE_LISTSOk() (*float32, bool) { + if o == nil { + return nil, false + } + return o.KEY_VALUE_STORE_LISTS.Get(), o.KEY_VALUE_STORE_LISTS.IsSet() +} + +// HasKEY_VALUE_STORE_LISTS returns a boolean if a field has been set. +func (o *RunUsageUsd) HasKEY_VALUE_STORE_LISTS() bool { + if o != nil && o.KEY_VALUE_STORE_LISTS.IsSet() { + return true + } + + return false +} + +// SetKEY_VALUE_STORE_LISTS gets a reference to the given NullableFloat32 and assigns it to the KEY_VALUE_STORE_LISTS field. +func (o *RunUsageUsd) SetKEY_VALUE_STORE_LISTS(v float32) { + o.KEY_VALUE_STORE_LISTS.Set(&v) +} +// SetKEY_VALUE_STORE_LISTSNil sets the value for KEY_VALUE_STORE_LISTS to be an explicit nil +func (o *RunUsageUsd) SetKEY_VALUE_STORE_LISTSNil() { + o.KEY_VALUE_STORE_LISTS.Set(nil) +} + +// UnsetKEY_VALUE_STORE_LISTS ensures that no value is present for KEY_VALUE_STORE_LISTS, not even an explicit nil +func (o *RunUsageUsd) UnsetKEY_VALUE_STORE_LISTS() { + o.KEY_VALUE_STORE_LISTS.Unset() +} + +// GetREQUEST_QUEUE_READS returns the REQUEST_QUEUE_READS field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *RunUsageUsd) GetREQUEST_QUEUE_READS() float32 { + if o == nil || IsNil(o.REQUEST_QUEUE_READS.Get()) { + var ret float32 + return ret + } + return *o.REQUEST_QUEUE_READS.Get() +} + +// GetREQUEST_QUEUE_READSOk returns a tuple with the REQUEST_QUEUE_READS field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *RunUsageUsd) GetREQUEST_QUEUE_READSOk() (*float32, bool) { + if o == nil { + return nil, false + } + return o.REQUEST_QUEUE_READS.Get(), o.REQUEST_QUEUE_READS.IsSet() +} + +// HasREQUEST_QUEUE_READS returns a boolean if a field has been set. +func (o *RunUsageUsd) HasREQUEST_QUEUE_READS() bool { + if o != nil && o.REQUEST_QUEUE_READS.IsSet() { + return true + } + + return false +} + +// SetREQUEST_QUEUE_READS gets a reference to the given NullableFloat32 and assigns it to the REQUEST_QUEUE_READS field. +func (o *RunUsageUsd) SetREQUEST_QUEUE_READS(v float32) { + o.REQUEST_QUEUE_READS.Set(&v) +} +// SetREQUEST_QUEUE_READSNil sets the value for REQUEST_QUEUE_READS to be an explicit nil +func (o *RunUsageUsd) SetREQUEST_QUEUE_READSNil() { + o.REQUEST_QUEUE_READS.Set(nil) +} + +// UnsetREQUEST_QUEUE_READS ensures that no value is present for REQUEST_QUEUE_READS, not even an explicit nil +func (o *RunUsageUsd) UnsetREQUEST_QUEUE_READS() { + o.REQUEST_QUEUE_READS.Unset() +} + +// GetREQUEST_QUEUE_WRITES returns the REQUEST_QUEUE_WRITES field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *RunUsageUsd) GetREQUEST_QUEUE_WRITES() float32 { + if o == nil || IsNil(o.REQUEST_QUEUE_WRITES.Get()) { + var ret float32 + return ret + } + return *o.REQUEST_QUEUE_WRITES.Get() +} + +// GetREQUEST_QUEUE_WRITESOk returns a tuple with the REQUEST_QUEUE_WRITES field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *RunUsageUsd) GetREQUEST_QUEUE_WRITESOk() (*float32, bool) { + if o == nil { + return nil, false + } + return o.REQUEST_QUEUE_WRITES.Get(), o.REQUEST_QUEUE_WRITES.IsSet() +} + +// HasREQUEST_QUEUE_WRITES returns a boolean if a field has been set. +func (o *RunUsageUsd) HasREQUEST_QUEUE_WRITES() bool { + if o != nil && o.REQUEST_QUEUE_WRITES.IsSet() { + return true + } + + return false +} + +// SetREQUEST_QUEUE_WRITES gets a reference to the given NullableFloat32 and assigns it to the REQUEST_QUEUE_WRITES field. +func (o *RunUsageUsd) SetREQUEST_QUEUE_WRITES(v float32) { + o.REQUEST_QUEUE_WRITES.Set(&v) +} +// SetREQUEST_QUEUE_WRITESNil sets the value for REQUEST_QUEUE_WRITES to be an explicit nil +func (o *RunUsageUsd) SetREQUEST_QUEUE_WRITESNil() { + o.REQUEST_QUEUE_WRITES.Set(nil) +} + +// UnsetREQUEST_QUEUE_WRITES ensures that no value is present for REQUEST_QUEUE_WRITES, not even an explicit nil +func (o *RunUsageUsd) UnsetREQUEST_QUEUE_WRITES() { + o.REQUEST_QUEUE_WRITES.Unset() +} + +// GetDATA_TRANSFER_INTERNAL_GBYTES returns the DATA_TRANSFER_INTERNAL_GBYTES field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *RunUsageUsd) GetDATA_TRANSFER_INTERNAL_GBYTES() float32 { + if o == nil || IsNil(o.DATA_TRANSFER_INTERNAL_GBYTES.Get()) { + var ret float32 + return ret + } + return *o.DATA_TRANSFER_INTERNAL_GBYTES.Get() +} + +// GetDATA_TRANSFER_INTERNAL_GBYTESOk returns a tuple with the DATA_TRANSFER_INTERNAL_GBYTES field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *RunUsageUsd) GetDATA_TRANSFER_INTERNAL_GBYTESOk() (*float32, bool) { + if o == nil { + return nil, false + } + return o.DATA_TRANSFER_INTERNAL_GBYTES.Get(), o.DATA_TRANSFER_INTERNAL_GBYTES.IsSet() +} + +// HasDATA_TRANSFER_INTERNAL_GBYTES returns a boolean if a field has been set. +func (o *RunUsageUsd) HasDATA_TRANSFER_INTERNAL_GBYTES() bool { + if o != nil && o.DATA_TRANSFER_INTERNAL_GBYTES.IsSet() { + return true + } + + return false +} + +// SetDATA_TRANSFER_INTERNAL_GBYTES gets a reference to the given NullableFloat32 and assigns it to the DATA_TRANSFER_INTERNAL_GBYTES field. +func (o *RunUsageUsd) SetDATA_TRANSFER_INTERNAL_GBYTES(v float32) { + o.DATA_TRANSFER_INTERNAL_GBYTES.Set(&v) +} +// SetDATA_TRANSFER_INTERNAL_GBYTESNil sets the value for DATA_TRANSFER_INTERNAL_GBYTES to be an explicit nil +func (o *RunUsageUsd) SetDATA_TRANSFER_INTERNAL_GBYTESNil() { + o.DATA_TRANSFER_INTERNAL_GBYTES.Set(nil) +} + +// UnsetDATA_TRANSFER_INTERNAL_GBYTES ensures that no value is present for DATA_TRANSFER_INTERNAL_GBYTES, not even an explicit nil +func (o *RunUsageUsd) UnsetDATA_TRANSFER_INTERNAL_GBYTES() { + o.DATA_TRANSFER_INTERNAL_GBYTES.Unset() +} + +// GetDATA_TRANSFER_EXTERNAL_GBYTES returns the DATA_TRANSFER_EXTERNAL_GBYTES field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *RunUsageUsd) GetDATA_TRANSFER_EXTERNAL_GBYTES() float32 { + if o == nil || IsNil(o.DATA_TRANSFER_EXTERNAL_GBYTES.Get()) { + var ret float32 + return ret + } + return *o.DATA_TRANSFER_EXTERNAL_GBYTES.Get() +} + +// GetDATA_TRANSFER_EXTERNAL_GBYTESOk returns a tuple with the DATA_TRANSFER_EXTERNAL_GBYTES field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *RunUsageUsd) GetDATA_TRANSFER_EXTERNAL_GBYTESOk() (*float32, bool) { + if o == nil { + return nil, false + } + return o.DATA_TRANSFER_EXTERNAL_GBYTES.Get(), o.DATA_TRANSFER_EXTERNAL_GBYTES.IsSet() +} + +// HasDATA_TRANSFER_EXTERNAL_GBYTES returns a boolean if a field has been set. +func (o *RunUsageUsd) HasDATA_TRANSFER_EXTERNAL_GBYTES() bool { + if o != nil && o.DATA_TRANSFER_EXTERNAL_GBYTES.IsSet() { + return true + } + + return false +} + +// SetDATA_TRANSFER_EXTERNAL_GBYTES gets a reference to the given NullableFloat32 and assigns it to the DATA_TRANSFER_EXTERNAL_GBYTES field. +func (o *RunUsageUsd) SetDATA_TRANSFER_EXTERNAL_GBYTES(v float32) { + o.DATA_TRANSFER_EXTERNAL_GBYTES.Set(&v) +} +// SetDATA_TRANSFER_EXTERNAL_GBYTESNil sets the value for DATA_TRANSFER_EXTERNAL_GBYTES to be an explicit nil +func (o *RunUsageUsd) SetDATA_TRANSFER_EXTERNAL_GBYTESNil() { + o.DATA_TRANSFER_EXTERNAL_GBYTES.Set(nil) +} + +// UnsetDATA_TRANSFER_EXTERNAL_GBYTES ensures that no value is present for DATA_TRANSFER_EXTERNAL_GBYTES, not even an explicit nil +func (o *RunUsageUsd) UnsetDATA_TRANSFER_EXTERNAL_GBYTES() { + o.DATA_TRANSFER_EXTERNAL_GBYTES.Unset() +} + +// GetPROXY_RESIDENTIAL_TRANSFER_GBYTES returns the PROXY_RESIDENTIAL_TRANSFER_GBYTES field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *RunUsageUsd) GetPROXY_RESIDENTIAL_TRANSFER_GBYTES() float32 { + if o == nil || IsNil(o.PROXY_RESIDENTIAL_TRANSFER_GBYTES.Get()) { + var ret float32 + return ret + } + return *o.PROXY_RESIDENTIAL_TRANSFER_GBYTES.Get() +} + +// GetPROXY_RESIDENTIAL_TRANSFER_GBYTESOk returns a tuple with the PROXY_RESIDENTIAL_TRANSFER_GBYTES field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *RunUsageUsd) GetPROXY_RESIDENTIAL_TRANSFER_GBYTESOk() (*float32, bool) { + if o == nil { + return nil, false + } + return o.PROXY_RESIDENTIAL_TRANSFER_GBYTES.Get(), o.PROXY_RESIDENTIAL_TRANSFER_GBYTES.IsSet() +} + +// HasPROXY_RESIDENTIAL_TRANSFER_GBYTES returns a boolean if a field has been set. +func (o *RunUsageUsd) HasPROXY_RESIDENTIAL_TRANSFER_GBYTES() bool { + if o != nil && o.PROXY_RESIDENTIAL_TRANSFER_GBYTES.IsSet() { + return true + } + + return false +} + +// SetPROXY_RESIDENTIAL_TRANSFER_GBYTES gets a reference to the given NullableFloat32 and assigns it to the PROXY_RESIDENTIAL_TRANSFER_GBYTES field. +func (o *RunUsageUsd) SetPROXY_RESIDENTIAL_TRANSFER_GBYTES(v float32) { + o.PROXY_RESIDENTIAL_TRANSFER_GBYTES.Set(&v) +} +// SetPROXY_RESIDENTIAL_TRANSFER_GBYTESNil sets the value for PROXY_RESIDENTIAL_TRANSFER_GBYTES to be an explicit nil +func (o *RunUsageUsd) SetPROXY_RESIDENTIAL_TRANSFER_GBYTESNil() { + o.PROXY_RESIDENTIAL_TRANSFER_GBYTES.Set(nil) +} + +// UnsetPROXY_RESIDENTIAL_TRANSFER_GBYTES ensures that no value is present for PROXY_RESIDENTIAL_TRANSFER_GBYTES, not even an explicit nil +func (o *RunUsageUsd) UnsetPROXY_RESIDENTIAL_TRANSFER_GBYTES() { + o.PROXY_RESIDENTIAL_TRANSFER_GBYTES.Unset() +} + +// GetPROXY_SERPS returns the PROXY_SERPS field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *RunUsageUsd) GetPROXY_SERPS() float32 { + if o == nil || IsNil(o.PROXY_SERPS.Get()) { + var ret float32 + return ret + } + return *o.PROXY_SERPS.Get() +} + +// GetPROXY_SERPSOk returns a tuple with the PROXY_SERPS field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *RunUsageUsd) GetPROXY_SERPSOk() (*float32, bool) { + if o == nil { + return nil, false + } + return o.PROXY_SERPS.Get(), o.PROXY_SERPS.IsSet() +} + +// HasPROXY_SERPS returns a boolean if a field has been set. +func (o *RunUsageUsd) HasPROXY_SERPS() bool { + if o != nil && o.PROXY_SERPS.IsSet() { + return true + } + + return false +} + +// SetPROXY_SERPS gets a reference to the given NullableFloat32 and assigns it to the PROXY_SERPS field. +func (o *RunUsageUsd) SetPROXY_SERPS(v float32) { + o.PROXY_SERPS.Set(&v) +} +// SetPROXY_SERPSNil sets the value for PROXY_SERPS to be an explicit nil +func (o *RunUsageUsd) SetPROXY_SERPSNil() { + o.PROXY_SERPS.Set(nil) +} + +// UnsetPROXY_SERPS ensures that no value is present for PROXY_SERPS, not even an explicit nil +func (o *RunUsageUsd) UnsetPROXY_SERPS() { + o.PROXY_SERPS.Unset() +} + +func (o RunUsageUsd) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o RunUsageUsd) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.ACTOR_COMPUTE_UNITS.IsSet() { + toSerialize["ACTOR_COMPUTE_UNITS"] = o.ACTOR_COMPUTE_UNITS.Get() + } + if o.DATASET_READS.IsSet() { + toSerialize["DATASET_READS"] = o.DATASET_READS.Get() + } + if o.DATASET_WRITES.IsSet() { + toSerialize["DATASET_WRITES"] = o.DATASET_WRITES.Get() + } + if o.KEY_VALUE_STORE_READS.IsSet() { + toSerialize["KEY_VALUE_STORE_READS"] = o.KEY_VALUE_STORE_READS.Get() + } + if o.KEY_VALUE_STORE_WRITES.IsSet() { + toSerialize["KEY_VALUE_STORE_WRITES"] = o.KEY_VALUE_STORE_WRITES.Get() + } + if o.KEY_VALUE_STORE_LISTS.IsSet() { + toSerialize["KEY_VALUE_STORE_LISTS"] = o.KEY_VALUE_STORE_LISTS.Get() + } + if o.REQUEST_QUEUE_READS.IsSet() { + toSerialize["REQUEST_QUEUE_READS"] = o.REQUEST_QUEUE_READS.Get() + } + if o.REQUEST_QUEUE_WRITES.IsSet() { + toSerialize["REQUEST_QUEUE_WRITES"] = o.REQUEST_QUEUE_WRITES.Get() + } + if o.DATA_TRANSFER_INTERNAL_GBYTES.IsSet() { + toSerialize["DATA_TRANSFER_INTERNAL_GBYTES"] = o.DATA_TRANSFER_INTERNAL_GBYTES.Get() + } + if o.DATA_TRANSFER_EXTERNAL_GBYTES.IsSet() { + toSerialize["DATA_TRANSFER_EXTERNAL_GBYTES"] = o.DATA_TRANSFER_EXTERNAL_GBYTES.Get() + } + if o.PROXY_RESIDENTIAL_TRANSFER_GBYTES.IsSet() { + toSerialize["PROXY_RESIDENTIAL_TRANSFER_GBYTES"] = o.PROXY_RESIDENTIAL_TRANSFER_GBYTES.Get() + } + if o.PROXY_SERPS.IsSet() { + toSerialize["PROXY_SERPS"] = o.PROXY_SERPS.Get() + } + return toSerialize, nil +} + +type NullableRunUsageUsd struct { + value *RunUsageUsd + isSet bool +} + +func (v NullableRunUsageUsd) Get() *RunUsageUsd { + return v.value +} + +func (v *NullableRunUsageUsd) Set(val *RunUsageUsd) { + v.value = val + v.isSet = true +} + +func (v NullableRunUsageUsd) IsSet() bool { + return v.isSet +} + +func (v *NullableRunUsageUsd) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRunUsageUsd(val *RunUsageUsd) *NullableRunUsageUsd { + return &NullableRunUsageUsd{value: val, isSet: true} +} + +func (v NullableRunUsageUsd) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRunUsageUsd) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_schedule.go b/model_schedule.go new file mode 100644 index 0000000..6dd3734 --- /dev/null +++ b/model_schedule.go @@ -0,0 +1,612 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" + "time" + "bytes" + "fmt" +) + +// checks if the Schedule type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Schedule{} + +// Schedule struct for Schedule +type Schedule struct { + Id string `json:"id"` + UserId string `json:"userId"` + Name string `json:"name"` + CronExpression string `json:"cronExpression"` + Timezone string `json:"timezone"` + IsEnabled bool `json:"isEnabled"` + IsExclusive bool `json:"isExclusive"` + CreatedAt time.Time `json:"createdAt"` + ModifiedAt time.Time `json:"modifiedAt"` + NextRunAt *time.Time `json:"nextRunAt,omitempty"` + LastRunAt *time.Time `json:"lastRunAt,omitempty"` + Description NullableString `json:"description,omitempty"` + Title NullableString `json:"title,omitempty"` + Notifications *ScheduleNotifications `json:"notifications,omitempty"` + // + Actions []ScheduleAction `json:"actions"` +} + +type _Schedule Schedule + +// NewSchedule instantiates a new Schedule object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewSchedule(id string, userId string, name string, cronExpression string, timezone string, isEnabled bool, isExclusive bool, createdAt time.Time, modifiedAt time.Time, actions []ScheduleAction) *Schedule { + this := Schedule{} + this.Id = id + this.UserId = userId + this.Name = name + this.CronExpression = cronExpression + this.Timezone = timezone + this.IsEnabled = isEnabled + this.IsExclusive = isExclusive + this.CreatedAt = createdAt + this.ModifiedAt = modifiedAt + this.Actions = actions + return &this +} + +// NewScheduleWithDefaults instantiates a new Schedule object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewScheduleWithDefaults() *Schedule { + this := Schedule{} + return &this +} + +// GetId returns the Id field value +func (o *Schedule) GetId() string { + if o == nil { + var ret string + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *Schedule) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *Schedule) SetId(v string) { + o.Id = v +} + +// GetUserId returns the UserId field value +func (o *Schedule) GetUserId() string { + if o == nil { + var ret string + return ret + } + + return o.UserId +} + +// GetUserIdOk returns a tuple with the UserId field value +// and a boolean to check if the value has been set. +func (o *Schedule) GetUserIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.UserId, true +} + +// SetUserId sets field value +func (o *Schedule) SetUserId(v string) { + o.UserId = v +} + +// GetName returns the Name field value +func (o *Schedule) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *Schedule) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *Schedule) SetName(v string) { + o.Name = v +} + +// GetCronExpression returns the CronExpression field value +func (o *Schedule) GetCronExpression() string { + if o == nil { + var ret string + return ret + } + + return o.CronExpression +} + +// GetCronExpressionOk returns a tuple with the CronExpression field value +// and a boolean to check if the value has been set. +func (o *Schedule) GetCronExpressionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.CronExpression, true +} + +// SetCronExpression sets field value +func (o *Schedule) SetCronExpression(v string) { + o.CronExpression = v +} + +// GetTimezone returns the Timezone field value +func (o *Schedule) GetTimezone() string { + if o == nil { + var ret string + return ret + } + + return o.Timezone +} + +// GetTimezoneOk returns a tuple with the Timezone field value +// and a boolean to check if the value has been set. +func (o *Schedule) GetTimezoneOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Timezone, true +} + +// SetTimezone sets field value +func (o *Schedule) SetTimezone(v string) { + o.Timezone = v +} + +// GetIsEnabled returns the IsEnabled field value +func (o *Schedule) GetIsEnabled() bool { + if o == nil { + var ret bool + return ret + } + + return o.IsEnabled +} + +// GetIsEnabledOk returns a tuple with the IsEnabled field value +// and a boolean to check if the value has been set. +func (o *Schedule) GetIsEnabledOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.IsEnabled, true +} + +// SetIsEnabled sets field value +func (o *Schedule) SetIsEnabled(v bool) { + o.IsEnabled = v +} + +// GetIsExclusive returns the IsExclusive field value +func (o *Schedule) GetIsExclusive() bool { + if o == nil { + var ret bool + return ret + } + + return o.IsExclusive +} + +// GetIsExclusiveOk returns a tuple with the IsExclusive field value +// and a boolean to check if the value has been set. +func (o *Schedule) GetIsExclusiveOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.IsExclusive, true +} + +// SetIsExclusive sets field value +func (o *Schedule) SetIsExclusive(v bool) { + o.IsExclusive = v +} + +// GetCreatedAt returns the CreatedAt field value +func (o *Schedule) GetCreatedAt() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value +// and a boolean to check if the value has been set. +func (o *Schedule) GetCreatedAtOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.CreatedAt, true +} + +// SetCreatedAt sets field value +func (o *Schedule) SetCreatedAt(v time.Time) { + o.CreatedAt = v +} + +// GetModifiedAt returns the ModifiedAt field value +func (o *Schedule) GetModifiedAt() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.ModifiedAt +} + +// GetModifiedAtOk returns a tuple with the ModifiedAt field value +// and a boolean to check if the value has been set. +func (o *Schedule) GetModifiedAtOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.ModifiedAt, true +} + +// SetModifiedAt sets field value +func (o *Schedule) SetModifiedAt(v time.Time) { + o.ModifiedAt = v +} + +// GetNextRunAt returns the NextRunAt field value if set, zero value otherwise. +func (o *Schedule) GetNextRunAt() time.Time { + if o == nil || IsNil(o.NextRunAt) { + var ret time.Time + return ret + } + return *o.NextRunAt +} + +// GetNextRunAtOk returns a tuple with the NextRunAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Schedule) GetNextRunAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.NextRunAt) { + return nil, false + } + return o.NextRunAt, true +} + +// HasNextRunAt returns a boolean if a field has been set. +func (o *Schedule) HasNextRunAt() bool { + if o != nil && !IsNil(o.NextRunAt) { + return true + } + + return false +} + +// SetNextRunAt gets a reference to the given time.Time and assigns it to the NextRunAt field. +func (o *Schedule) SetNextRunAt(v time.Time) { + o.NextRunAt = &v +} + +// GetLastRunAt returns the LastRunAt field value if set, zero value otherwise. +func (o *Schedule) GetLastRunAt() time.Time { + if o == nil || IsNil(o.LastRunAt) { + var ret time.Time + return ret + } + return *o.LastRunAt +} + +// GetLastRunAtOk returns a tuple with the LastRunAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Schedule) GetLastRunAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.LastRunAt) { + return nil, false + } + return o.LastRunAt, true +} + +// HasLastRunAt returns a boolean if a field has been set. +func (o *Schedule) HasLastRunAt() bool { + if o != nil && !IsNil(o.LastRunAt) { + return true + } + + return false +} + +// SetLastRunAt gets a reference to the given time.Time and assigns it to the LastRunAt field. +func (o *Schedule) SetLastRunAt(v time.Time) { + o.LastRunAt = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Schedule) GetDescription() string { + if o == nil || IsNil(o.Description.Get()) { + var ret string + return ret + } + return *o.Description.Get() +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Schedule) GetDescriptionOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Description.Get(), o.Description.IsSet() +} + +// HasDescription returns a boolean if a field has been set. +func (o *Schedule) HasDescription() bool { + if o != nil && o.Description.IsSet() { + return true + } + + return false +} + +// SetDescription gets a reference to the given NullableString and assigns it to the Description field. +func (o *Schedule) SetDescription(v string) { + o.Description.Set(&v) +} +// SetDescriptionNil sets the value for Description to be an explicit nil +func (o *Schedule) SetDescriptionNil() { + o.Description.Set(nil) +} + +// UnsetDescription ensures that no value is present for Description, not even an explicit nil +func (o *Schedule) UnsetDescription() { + o.Description.Unset() +} + +// GetTitle returns the Title field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Schedule) GetTitle() string { + if o == nil || IsNil(o.Title.Get()) { + var ret string + return ret + } + return *o.Title.Get() +} + +// GetTitleOk returns a tuple with the Title field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Schedule) GetTitleOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Title.Get(), o.Title.IsSet() +} + +// HasTitle returns a boolean if a field has been set. +func (o *Schedule) HasTitle() bool { + if o != nil && o.Title.IsSet() { + return true + } + + return false +} + +// SetTitle gets a reference to the given NullableString and assigns it to the Title field. +func (o *Schedule) SetTitle(v string) { + o.Title.Set(&v) +} +// SetTitleNil sets the value for Title to be an explicit nil +func (o *Schedule) SetTitleNil() { + o.Title.Set(nil) +} + +// UnsetTitle ensures that no value is present for Title, not even an explicit nil +func (o *Schedule) UnsetTitle() { + o.Title.Unset() +} + +// GetNotifications returns the Notifications field value if set, zero value otherwise. +func (o *Schedule) GetNotifications() ScheduleNotifications { + if o == nil || IsNil(o.Notifications) { + var ret ScheduleNotifications + return ret + } + return *o.Notifications +} + +// GetNotificationsOk returns a tuple with the Notifications field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Schedule) GetNotificationsOk() (*ScheduleNotifications, bool) { + if o == nil || IsNil(o.Notifications) { + return nil, false + } + return o.Notifications, true +} + +// HasNotifications returns a boolean if a field has been set. +func (o *Schedule) HasNotifications() bool { + if o != nil && !IsNil(o.Notifications) { + return true + } + + return false +} + +// SetNotifications gets a reference to the given ScheduleNotifications and assigns it to the Notifications field. +func (o *Schedule) SetNotifications(v ScheduleNotifications) { + o.Notifications = &v +} + +// GetActions returns the Actions field value +func (o *Schedule) GetActions() []ScheduleAction { + if o == nil { + var ret []ScheduleAction + return ret + } + + return o.Actions +} + +// GetActionsOk returns a tuple with the Actions field value +// and a boolean to check if the value has been set. +func (o *Schedule) GetActionsOk() ([]ScheduleAction, bool) { + if o == nil { + return nil, false + } + return o.Actions, true +} + +// SetActions sets field value +func (o *Schedule) SetActions(v []ScheduleAction) { + o.Actions = v +} + +func (o Schedule) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Schedule) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["userId"] = o.UserId + toSerialize["name"] = o.Name + toSerialize["cronExpression"] = o.CronExpression + toSerialize["timezone"] = o.Timezone + toSerialize["isEnabled"] = o.IsEnabled + toSerialize["isExclusive"] = o.IsExclusive + toSerialize["createdAt"] = o.CreatedAt + toSerialize["modifiedAt"] = o.ModifiedAt + if !IsNil(o.NextRunAt) { + toSerialize["nextRunAt"] = o.NextRunAt + } + if !IsNil(o.LastRunAt) { + toSerialize["lastRunAt"] = o.LastRunAt + } + if o.Description.IsSet() { + toSerialize["description"] = o.Description.Get() + } + if o.Title.IsSet() { + toSerialize["title"] = o.Title.Get() + } + if !IsNil(o.Notifications) { + toSerialize["notifications"] = o.Notifications + } + toSerialize["actions"] = o.Actions + return toSerialize, nil +} + +func (o *Schedule) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "userId", + "name", + "cronExpression", + "timezone", + "isEnabled", + "isExclusive", + "createdAt", + "modifiedAt", + "actions", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varSchedule := _Schedule{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varSchedule) + + if err != nil { + return err + } + + *o = Schedule(varSchedule) + + return err +} + +type NullableSchedule struct { + value *Schedule + isSet bool +} + +func (v NullableSchedule) Get() *Schedule { + return v.value +} + +func (v *NullableSchedule) Set(val *Schedule) { + v.value = val + v.isSet = true +} + +func (v NullableSchedule) IsSet() bool { + return v.isSet +} + +func (v *NullableSchedule) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSchedule(val *Schedule) *NullableSchedule { + return &NullableSchedule{value: val, isSet: true} +} + +func (v NullableSchedule) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSchedule) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_schedule_action.go b/model_schedule_action.go new file mode 100644 index 0000000..3a3fd83 --- /dev/null +++ b/model_schedule_action.go @@ -0,0 +1,171 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" + "fmt" + "gopkg.in/validator.v2" +) + +// ScheduleAction - struct for ScheduleAction +type ScheduleAction struct { + ScheduleActionRunActor *ScheduleActionRunActor + ScheduleActionRunActorTask *ScheduleActionRunActorTask +} + +// ScheduleActionRunActorAsScheduleAction is a convenience function that returns ScheduleActionRunActor wrapped in ScheduleAction +func ScheduleActionRunActorAsScheduleAction(v *ScheduleActionRunActor) ScheduleAction { + return ScheduleAction{ + ScheduleActionRunActor: v, + } +} + +// ScheduleActionRunActorTaskAsScheduleAction is a convenience function that returns ScheduleActionRunActorTask wrapped in ScheduleAction +func ScheduleActionRunActorTaskAsScheduleAction(v *ScheduleActionRunActorTask) ScheduleAction { + return ScheduleAction{ + ScheduleActionRunActorTask: v, + } +} + + +// Unmarshal JSON data into one of the pointers in the struct +func (dst *ScheduleAction) UnmarshalJSON(data []byte) error { + var err error + match := 0 + // try to unmarshal data into ScheduleActionRunActor + err = newStrictDecoder(data).Decode(&dst.ScheduleActionRunActor) + if err == nil { + jsonScheduleActionRunActor, _ := json.Marshal(dst.ScheduleActionRunActor) + if string(jsonScheduleActionRunActor) == "{}" { // empty struct + dst.ScheduleActionRunActor = nil + } else { + if err = validator.Validate(dst.ScheduleActionRunActor); err != nil { + dst.ScheduleActionRunActor = nil + } else { + match++ + } + } + } else { + dst.ScheduleActionRunActor = nil + } + + // try to unmarshal data into ScheduleActionRunActorTask + err = newStrictDecoder(data).Decode(&dst.ScheduleActionRunActorTask) + if err == nil { + jsonScheduleActionRunActorTask, _ := json.Marshal(dst.ScheduleActionRunActorTask) + if string(jsonScheduleActionRunActorTask) == "{}" { // empty struct + dst.ScheduleActionRunActorTask = nil + } else { + if err = validator.Validate(dst.ScheduleActionRunActorTask); err != nil { + dst.ScheduleActionRunActorTask = nil + } else { + match++ + } + } + } else { + dst.ScheduleActionRunActorTask = nil + } + + if match > 1 { // more than 1 match + // reset to nil + dst.ScheduleActionRunActor = nil + dst.ScheduleActionRunActorTask = nil + + return fmt.Errorf("data matches more than one schema in oneOf(ScheduleAction)") + } else if match == 1 { + return nil // exactly one match + } else { // no match + return fmt.Errorf("data failed to match schemas in oneOf(ScheduleAction)") + } +} + +// Marshal data from the first non-nil pointers in the struct to JSON +func (src ScheduleAction) MarshalJSON() ([]byte, error) { + if src.ScheduleActionRunActor != nil { + return json.Marshal(&src.ScheduleActionRunActor) + } + + if src.ScheduleActionRunActorTask != nil { + return json.Marshal(&src.ScheduleActionRunActorTask) + } + + return nil, nil // no data in oneOf schemas +} + +// Get the actual instance +func (obj *ScheduleAction) GetActualInstance() (interface{}) { + if obj == nil { + return nil + } + if obj.ScheduleActionRunActor != nil { + return obj.ScheduleActionRunActor + } + + if obj.ScheduleActionRunActorTask != nil { + return obj.ScheduleActionRunActorTask + } + + // all schemas are nil + return nil +} + +// Get the actual instance value +func (obj ScheduleAction) GetActualInstanceValue() (interface{}) { + if obj.ScheduleActionRunActor != nil { + return *obj.ScheduleActionRunActor + } + + if obj.ScheduleActionRunActorTask != nil { + return *obj.ScheduleActionRunActorTask + } + + // all schemas are nil + return nil +} + +type NullableScheduleAction struct { + value *ScheduleAction + isSet bool +} + +func (v NullableScheduleAction) Get() *ScheduleAction { + return v.value +} + +func (v *NullableScheduleAction) Set(val *ScheduleAction) { + v.value = val + v.isSet = true +} + +func (v NullableScheduleAction) IsSet() bool { + return v.isSet +} + +func (v *NullableScheduleAction) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableScheduleAction(val *ScheduleAction) *NullableScheduleAction { + return &NullableScheduleAction{value: val, isSet: true} +} + +func (v NullableScheduleAction) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableScheduleAction) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_schedule_action_run_actor.go b/model_schedule_action_run_actor.go new file mode 100644 index 0000000..577986a --- /dev/null +++ b/model_schedule_action_run_actor.go @@ -0,0 +1,310 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" + "bytes" + "fmt" +) + +// checks if the ScheduleActionRunActor type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ScheduleActionRunActor{} + +// ScheduleActionRunActor struct for ScheduleActionRunActor +type ScheduleActionRunActor struct { + Id string `json:"id"` + Type interface{} `json:"type"` + ActorId string `json:"actorId"` + RunInput NullableScheduleActionRunInput `json:"runInput,omitempty"` + RunOptions NullableTaskOptions `json:"runOptions,omitempty"` +} + +type _ScheduleActionRunActor ScheduleActionRunActor + +// NewScheduleActionRunActor instantiates a new ScheduleActionRunActor object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewScheduleActionRunActor(id string, type_ interface{}, actorId string) *ScheduleActionRunActor { + this := ScheduleActionRunActor{} + this.Id = id + this.Type = type_ + this.ActorId = actorId + return &this +} + +// NewScheduleActionRunActorWithDefaults instantiates a new ScheduleActionRunActor object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewScheduleActionRunActorWithDefaults() *ScheduleActionRunActor { + this := ScheduleActionRunActor{} + return &this +} + +// GetId returns the Id field value +func (o *ScheduleActionRunActor) GetId() string { + if o == nil { + var ret string + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *ScheduleActionRunActor) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *ScheduleActionRunActor) SetId(v string) { + o.Id = v +} + +// GetType returns the Type field value +// If the value is explicit nil, the zero value for interface{} will be returned +func (o *ScheduleActionRunActor) GetType() interface{} { + if o == nil { + var ret interface{} + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ScheduleActionRunActor) GetTypeOk() (*interface{}, bool) { + if o == nil || IsNil(o.Type) { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *ScheduleActionRunActor) SetType(v interface{}) { + o.Type = v +} + +// GetActorId returns the ActorId field value +func (o *ScheduleActionRunActor) GetActorId() string { + if o == nil { + var ret string + return ret + } + + return o.ActorId +} + +// GetActorIdOk returns a tuple with the ActorId field value +// and a boolean to check if the value has been set. +func (o *ScheduleActionRunActor) GetActorIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ActorId, true +} + +// SetActorId sets field value +func (o *ScheduleActionRunActor) SetActorId(v string) { + o.ActorId = v +} + +// GetRunInput returns the RunInput field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ScheduleActionRunActor) GetRunInput() ScheduleActionRunInput { + if o == nil || IsNil(o.RunInput.Get()) { + var ret ScheduleActionRunInput + return ret + } + return *o.RunInput.Get() +} + +// GetRunInputOk returns a tuple with the RunInput field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ScheduleActionRunActor) GetRunInputOk() (*ScheduleActionRunInput, bool) { + if o == nil { + return nil, false + } + return o.RunInput.Get(), o.RunInput.IsSet() +} + +// HasRunInput returns a boolean if a field has been set. +func (o *ScheduleActionRunActor) HasRunInput() bool { + if o != nil && o.RunInput.IsSet() { + return true + } + + return false +} + +// SetRunInput gets a reference to the given NullableScheduleActionRunInput and assigns it to the RunInput field. +func (o *ScheduleActionRunActor) SetRunInput(v ScheduleActionRunInput) { + o.RunInput.Set(&v) +} +// SetRunInputNil sets the value for RunInput to be an explicit nil +func (o *ScheduleActionRunActor) SetRunInputNil() { + o.RunInput.Set(nil) +} + +// UnsetRunInput ensures that no value is present for RunInput, not even an explicit nil +func (o *ScheduleActionRunActor) UnsetRunInput() { + o.RunInput.Unset() +} + +// GetRunOptions returns the RunOptions field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ScheduleActionRunActor) GetRunOptions() TaskOptions { + if o == nil || IsNil(o.RunOptions.Get()) { + var ret TaskOptions + return ret + } + return *o.RunOptions.Get() +} + +// GetRunOptionsOk returns a tuple with the RunOptions field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ScheduleActionRunActor) GetRunOptionsOk() (*TaskOptions, bool) { + if o == nil { + return nil, false + } + return o.RunOptions.Get(), o.RunOptions.IsSet() +} + +// HasRunOptions returns a boolean if a field has been set. +func (o *ScheduleActionRunActor) HasRunOptions() bool { + if o != nil && o.RunOptions.IsSet() { + return true + } + + return false +} + +// SetRunOptions gets a reference to the given NullableTaskOptions and assigns it to the RunOptions field. +func (o *ScheduleActionRunActor) SetRunOptions(v TaskOptions) { + o.RunOptions.Set(&v) +} +// SetRunOptionsNil sets the value for RunOptions to be an explicit nil +func (o *ScheduleActionRunActor) SetRunOptionsNil() { + o.RunOptions.Set(nil) +} + +// UnsetRunOptions ensures that no value is present for RunOptions, not even an explicit nil +func (o *ScheduleActionRunActor) UnsetRunOptions() { + o.RunOptions.Unset() +} + +func (o ScheduleActionRunActor) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ScheduleActionRunActor) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + if o.Type != nil { + toSerialize["type"] = o.Type + } + toSerialize["actorId"] = o.ActorId + if o.RunInput.IsSet() { + toSerialize["runInput"] = o.RunInput.Get() + } + if o.RunOptions.IsSet() { + toSerialize["runOptions"] = o.RunOptions.Get() + } + return toSerialize, nil +} + +func (o *ScheduleActionRunActor) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "type", + "actorId", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varScheduleActionRunActor := _ScheduleActionRunActor{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varScheduleActionRunActor) + + if err != nil { + return err + } + + *o = ScheduleActionRunActor(varScheduleActionRunActor) + + return err +} + +type NullableScheduleActionRunActor struct { + value *ScheduleActionRunActor + isSet bool +} + +func (v NullableScheduleActionRunActor) Get() *ScheduleActionRunActor { + return v.value +} + +func (v *NullableScheduleActionRunActor) Set(val *ScheduleActionRunActor) { + v.value = val + v.isSet = true +} + +func (v NullableScheduleActionRunActor) IsSet() bool { + return v.isSet +} + +func (v *NullableScheduleActionRunActor) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableScheduleActionRunActor(val *ScheduleActionRunActor) *NullableScheduleActionRunActor { + return &NullableScheduleActionRunActor{value: val, isSet: true} +} + +func (v NullableScheduleActionRunActor) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableScheduleActionRunActor) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_schedule_action_run_actor_task.go b/model_schedule_action_run_actor_task.go new file mode 100644 index 0000000..586c759 --- /dev/null +++ b/model_schedule_action_run_actor_task.go @@ -0,0 +1,255 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" + "bytes" + "fmt" +) + +// checks if the ScheduleActionRunActorTask type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ScheduleActionRunActorTask{} + +// ScheduleActionRunActorTask struct for ScheduleActionRunActorTask +type ScheduleActionRunActorTask struct { + Id string `json:"id"` + Type interface{} `json:"type"` + ActorTaskId string `json:"actorTaskId"` + Input map[string]interface{} `json:"input,omitempty"` +} + +type _ScheduleActionRunActorTask ScheduleActionRunActorTask + +// NewScheduleActionRunActorTask instantiates a new ScheduleActionRunActorTask object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewScheduleActionRunActorTask(id string, type_ interface{}, actorTaskId string) *ScheduleActionRunActorTask { + this := ScheduleActionRunActorTask{} + this.Id = id + this.Type = type_ + this.ActorTaskId = actorTaskId + return &this +} + +// NewScheduleActionRunActorTaskWithDefaults instantiates a new ScheduleActionRunActorTask object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewScheduleActionRunActorTaskWithDefaults() *ScheduleActionRunActorTask { + this := ScheduleActionRunActorTask{} + return &this +} + +// GetId returns the Id field value +func (o *ScheduleActionRunActorTask) GetId() string { + if o == nil { + var ret string + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *ScheduleActionRunActorTask) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *ScheduleActionRunActorTask) SetId(v string) { + o.Id = v +} + +// GetType returns the Type field value +// If the value is explicit nil, the zero value for interface{} will be returned +func (o *ScheduleActionRunActorTask) GetType() interface{} { + if o == nil { + var ret interface{} + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ScheduleActionRunActorTask) GetTypeOk() (*interface{}, bool) { + if o == nil || IsNil(o.Type) { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *ScheduleActionRunActorTask) SetType(v interface{}) { + o.Type = v +} + +// GetActorTaskId returns the ActorTaskId field value +func (o *ScheduleActionRunActorTask) GetActorTaskId() string { + if o == nil { + var ret string + return ret + } + + return o.ActorTaskId +} + +// GetActorTaskIdOk returns a tuple with the ActorTaskId field value +// and a boolean to check if the value has been set. +func (o *ScheduleActionRunActorTask) GetActorTaskIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ActorTaskId, true +} + +// SetActorTaskId sets field value +func (o *ScheduleActionRunActorTask) SetActorTaskId(v string) { + o.ActorTaskId = v +} + +// GetInput returns the Input field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ScheduleActionRunActorTask) GetInput() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + return o.Input +} + +// GetInputOk returns a tuple with the Input field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ScheduleActionRunActorTask) GetInputOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Input) { + return map[string]interface{}{}, false + } + return o.Input, true +} + +// HasInput returns a boolean if a field has been set. +func (o *ScheduleActionRunActorTask) HasInput() bool { + if o != nil && !IsNil(o.Input) { + return true + } + + return false +} + +// SetInput gets a reference to the given map[string]interface{} and assigns it to the Input field. +func (o *ScheduleActionRunActorTask) SetInput(v map[string]interface{}) { + o.Input = v +} + +func (o ScheduleActionRunActorTask) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ScheduleActionRunActorTask) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + if o.Type != nil { + toSerialize["type"] = o.Type + } + toSerialize["actorTaskId"] = o.ActorTaskId + if o.Input != nil { + toSerialize["input"] = o.Input + } + return toSerialize, nil +} + +func (o *ScheduleActionRunActorTask) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "type", + "actorTaskId", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varScheduleActionRunActorTask := _ScheduleActionRunActorTask{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varScheduleActionRunActorTask) + + if err != nil { + return err + } + + *o = ScheduleActionRunActorTask(varScheduleActionRunActorTask) + + return err +} + +type NullableScheduleActionRunActorTask struct { + value *ScheduleActionRunActorTask + isSet bool +} + +func (v NullableScheduleActionRunActorTask) Get() *ScheduleActionRunActorTask { + return v.value +} + +func (v *NullableScheduleActionRunActorTask) Set(val *ScheduleActionRunActorTask) { + v.value = val + v.isSet = true +} + +func (v NullableScheduleActionRunActorTask) IsSet() bool { + return v.isSet +} + +func (v *NullableScheduleActionRunActorTask) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableScheduleActionRunActorTask(val *ScheduleActionRunActorTask) *NullableScheduleActionRunActorTask { + return &NullableScheduleActionRunActorTask{value: val, isSet: true} +} + +func (v NullableScheduleActionRunActorTask) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableScheduleActionRunActorTask) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_schedule_action_run_input.go b/model_schedule_action_run_input.go new file mode 100644 index 0000000..ac3daf1 --- /dev/null +++ b/model_schedule_action_run_input.go @@ -0,0 +1,182 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" +) + +// checks if the ScheduleActionRunInput type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ScheduleActionRunInput{} + +// ScheduleActionRunInput struct for ScheduleActionRunInput +type ScheduleActionRunInput struct { + Body NullableString `json:"body,omitempty"` + ContentType NullableString `json:"contentType,omitempty"` +} + +// NewScheduleActionRunInput instantiates a new ScheduleActionRunInput object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewScheduleActionRunInput() *ScheduleActionRunInput { + this := ScheduleActionRunInput{} + return &this +} + +// NewScheduleActionRunInputWithDefaults instantiates a new ScheduleActionRunInput object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewScheduleActionRunInputWithDefaults() *ScheduleActionRunInput { + this := ScheduleActionRunInput{} + return &this +} + +// GetBody returns the Body field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ScheduleActionRunInput) GetBody() string { + if o == nil || IsNil(o.Body.Get()) { + var ret string + return ret + } + return *o.Body.Get() +} + +// GetBodyOk returns a tuple with the Body field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ScheduleActionRunInput) GetBodyOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Body.Get(), o.Body.IsSet() +} + +// HasBody returns a boolean if a field has been set. +func (o *ScheduleActionRunInput) HasBody() bool { + if o != nil && o.Body.IsSet() { + return true + } + + return false +} + +// SetBody gets a reference to the given NullableString and assigns it to the Body field. +func (o *ScheduleActionRunInput) SetBody(v string) { + o.Body.Set(&v) +} +// SetBodyNil sets the value for Body to be an explicit nil +func (o *ScheduleActionRunInput) SetBodyNil() { + o.Body.Set(nil) +} + +// UnsetBody ensures that no value is present for Body, not even an explicit nil +func (o *ScheduleActionRunInput) UnsetBody() { + o.Body.Unset() +} + +// GetContentType returns the ContentType field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ScheduleActionRunInput) GetContentType() string { + if o == nil || IsNil(o.ContentType.Get()) { + var ret string + return ret + } + return *o.ContentType.Get() +} + +// GetContentTypeOk returns a tuple with the ContentType field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ScheduleActionRunInput) GetContentTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.ContentType.Get(), o.ContentType.IsSet() +} + +// HasContentType returns a boolean if a field has been set. +func (o *ScheduleActionRunInput) HasContentType() bool { + if o != nil && o.ContentType.IsSet() { + return true + } + + return false +} + +// SetContentType gets a reference to the given NullableString and assigns it to the ContentType field. +func (o *ScheduleActionRunInput) SetContentType(v string) { + o.ContentType.Set(&v) +} +// SetContentTypeNil sets the value for ContentType to be an explicit nil +func (o *ScheduleActionRunInput) SetContentTypeNil() { + o.ContentType.Set(nil) +} + +// UnsetContentType ensures that no value is present for ContentType, not even an explicit nil +func (o *ScheduleActionRunInput) UnsetContentType() { + o.ContentType.Unset() +} + +func (o ScheduleActionRunInput) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ScheduleActionRunInput) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.Body.IsSet() { + toSerialize["body"] = o.Body.Get() + } + if o.ContentType.IsSet() { + toSerialize["contentType"] = o.ContentType.Get() + } + return toSerialize, nil +} + +type NullableScheduleActionRunInput struct { + value *ScheduleActionRunInput + isSet bool +} + +func (v NullableScheduleActionRunInput) Get() *ScheduleActionRunInput { + return v.value +} + +func (v *NullableScheduleActionRunInput) Set(val *ScheduleActionRunInput) { + v.value = val + v.isSet = true +} + +func (v NullableScheduleActionRunInput) IsSet() bool { + return v.isSet +} + +func (v *NullableScheduleActionRunInput) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableScheduleActionRunInput(val *ScheduleActionRunInput) *NullableScheduleActionRunInput { + return &NullableScheduleActionRunInput{value: val, isSet: true} +} + +func (v NullableScheduleActionRunInput) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableScheduleActionRunInput) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_schedule_action_short.go b/model_schedule_action_short.go new file mode 100644 index 0000000..19098ed --- /dev/null +++ b/model_schedule_action_short.go @@ -0,0 +1,171 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" + "fmt" + "gopkg.in/validator.v2" +) + +// ScheduleActionShort - struct for ScheduleActionShort +type ScheduleActionShort struct { + ScheduleActionShortRunActor *ScheduleActionShortRunActor + ScheduleActionShortRunActorTask *ScheduleActionShortRunActorTask +} + +// ScheduleActionShortRunActorAsScheduleActionShort is a convenience function that returns ScheduleActionShortRunActor wrapped in ScheduleActionShort +func ScheduleActionShortRunActorAsScheduleActionShort(v *ScheduleActionShortRunActor) ScheduleActionShort { + return ScheduleActionShort{ + ScheduleActionShortRunActor: v, + } +} + +// ScheduleActionShortRunActorTaskAsScheduleActionShort is a convenience function that returns ScheduleActionShortRunActorTask wrapped in ScheduleActionShort +func ScheduleActionShortRunActorTaskAsScheduleActionShort(v *ScheduleActionShortRunActorTask) ScheduleActionShort { + return ScheduleActionShort{ + ScheduleActionShortRunActorTask: v, + } +} + + +// Unmarshal JSON data into one of the pointers in the struct +func (dst *ScheduleActionShort) UnmarshalJSON(data []byte) error { + var err error + match := 0 + // try to unmarshal data into ScheduleActionShortRunActor + err = newStrictDecoder(data).Decode(&dst.ScheduleActionShortRunActor) + if err == nil { + jsonScheduleActionShortRunActor, _ := json.Marshal(dst.ScheduleActionShortRunActor) + if string(jsonScheduleActionShortRunActor) == "{}" { // empty struct + dst.ScheduleActionShortRunActor = nil + } else { + if err = validator.Validate(dst.ScheduleActionShortRunActor); err != nil { + dst.ScheduleActionShortRunActor = nil + } else { + match++ + } + } + } else { + dst.ScheduleActionShortRunActor = nil + } + + // try to unmarshal data into ScheduleActionShortRunActorTask + err = newStrictDecoder(data).Decode(&dst.ScheduleActionShortRunActorTask) + if err == nil { + jsonScheduleActionShortRunActorTask, _ := json.Marshal(dst.ScheduleActionShortRunActorTask) + if string(jsonScheduleActionShortRunActorTask) == "{}" { // empty struct + dst.ScheduleActionShortRunActorTask = nil + } else { + if err = validator.Validate(dst.ScheduleActionShortRunActorTask); err != nil { + dst.ScheduleActionShortRunActorTask = nil + } else { + match++ + } + } + } else { + dst.ScheduleActionShortRunActorTask = nil + } + + if match > 1 { // more than 1 match + // reset to nil + dst.ScheduleActionShortRunActor = nil + dst.ScheduleActionShortRunActorTask = nil + + return fmt.Errorf("data matches more than one schema in oneOf(ScheduleActionShort)") + } else if match == 1 { + return nil // exactly one match + } else { // no match + return fmt.Errorf("data failed to match schemas in oneOf(ScheduleActionShort)") + } +} + +// Marshal data from the first non-nil pointers in the struct to JSON +func (src ScheduleActionShort) MarshalJSON() ([]byte, error) { + if src.ScheduleActionShortRunActor != nil { + return json.Marshal(&src.ScheduleActionShortRunActor) + } + + if src.ScheduleActionShortRunActorTask != nil { + return json.Marshal(&src.ScheduleActionShortRunActorTask) + } + + return nil, nil // no data in oneOf schemas +} + +// Get the actual instance +func (obj *ScheduleActionShort) GetActualInstance() (interface{}) { + if obj == nil { + return nil + } + if obj.ScheduleActionShortRunActor != nil { + return obj.ScheduleActionShortRunActor + } + + if obj.ScheduleActionShortRunActorTask != nil { + return obj.ScheduleActionShortRunActorTask + } + + // all schemas are nil + return nil +} + +// Get the actual instance value +func (obj ScheduleActionShort) GetActualInstanceValue() (interface{}) { + if obj.ScheduleActionShortRunActor != nil { + return *obj.ScheduleActionShortRunActor + } + + if obj.ScheduleActionShortRunActorTask != nil { + return *obj.ScheduleActionShortRunActorTask + } + + // all schemas are nil + return nil +} + +type NullableScheduleActionShort struct { + value *ScheduleActionShort + isSet bool +} + +func (v NullableScheduleActionShort) Get() *ScheduleActionShort { + return v.value +} + +func (v *NullableScheduleActionShort) Set(val *ScheduleActionShort) { + v.value = val + v.isSet = true +} + +func (v NullableScheduleActionShort) IsSet() bool { + return v.isSet +} + +func (v *NullableScheduleActionShort) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableScheduleActionShort(val *ScheduleActionShort) *NullableScheduleActionShort { + return &NullableScheduleActionShort{value: val, isSet: true} +} + +func (v NullableScheduleActionShort) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableScheduleActionShort) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_schedule_action_short_run_actor.go b/model_schedule_action_short_run_actor.go new file mode 100644 index 0000000..3151f49 --- /dev/null +++ b/model_schedule_action_short_run_actor.go @@ -0,0 +1,218 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" + "bytes" + "fmt" +) + +// checks if the ScheduleActionShortRunActor type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ScheduleActionShortRunActor{} + +// ScheduleActionShortRunActor struct for ScheduleActionShortRunActor +type ScheduleActionShortRunActor struct { + Id string `json:"id"` + Type interface{} `json:"type"` + ActorId string `json:"actorId"` +} + +type _ScheduleActionShortRunActor ScheduleActionShortRunActor + +// NewScheduleActionShortRunActor instantiates a new ScheduleActionShortRunActor object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewScheduleActionShortRunActor(id string, type_ interface{}, actorId string) *ScheduleActionShortRunActor { + this := ScheduleActionShortRunActor{} + this.Id = id + this.Type = type_ + this.ActorId = actorId + return &this +} + +// NewScheduleActionShortRunActorWithDefaults instantiates a new ScheduleActionShortRunActor object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewScheduleActionShortRunActorWithDefaults() *ScheduleActionShortRunActor { + this := ScheduleActionShortRunActor{} + return &this +} + +// GetId returns the Id field value +func (o *ScheduleActionShortRunActor) GetId() string { + if o == nil { + var ret string + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *ScheduleActionShortRunActor) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *ScheduleActionShortRunActor) SetId(v string) { + o.Id = v +} + +// GetType returns the Type field value +// If the value is explicit nil, the zero value for interface{} will be returned +func (o *ScheduleActionShortRunActor) GetType() interface{} { + if o == nil { + var ret interface{} + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ScheduleActionShortRunActor) GetTypeOk() (*interface{}, bool) { + if o == nil || IsNil(o.Type) { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *ScheduleActionShortRunActor) SetType(v interface{}) { + o.Type = v +} + +// GetActorId returns the ActorId field value +func (o *ScheduleActionShortRunActor) GetActorId() string { + if o == nil { + var ret string + return ret + } + + return o.ActorId +} + +// GetActorIdOk returns a tuple with the ActorId field value +// and a boolean to check if the value has been set. +func (o *ScheduleActionShortRunActor) GetActorIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ActorId, true +} + +// SetActorId sets field value +func (o *ScheduleActionShortRunActor) SetActorId(v string) { + o.ActorId = v +} + +func (o ScheduleActionShortRunActor) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ScheduleActionShortRunActor) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + if o.Type != nil { + toSerialize["type"] = o.Type + } + toSerialize["actorId"] = o.ActorId + return toSerialize, nil +} + +func (o *ScheduleActionShortRunActor) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "type", + "actorId", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varScheduleActionShortRunActor := _ScheduleActionShortRunActor{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varScheduleActionShortRunActor) + + if err != nil { + return err + } + + *o = ScheduleActionShortRunActor(varScheduleActionShortRunActor) + + return err +} + +type NullableScheduleActionShortRunActor struct { + value *ScheduleActionShortRunActor + isSet bool +} + +func (v NullableScheduleActionShortRunActor) Get() *ScheduleActionShortRunActor { + return v.value +} + +func (v *NullableScheduleActionShortRunActor) Set(val *ScheduleActionShortRunActor) { + v.value = val + v.isSet = true +} + +func (v NullableScheduleActionShortRunActor) IsSet() bool { + return v.isSet +} + +func (v *NullableScheduleActionShortRunActor) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableScheduleActionShortRunActor(val *ScheduleActionShortRunActor) *NullableScheduleActionShortRunActor { + return &NullableScheduleActionShortRunActor{value: val, isSet: true} +} + +func (v NullableScheduleActionShortRunActor) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableScheduleActionShortRunActor) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_schedule_action_short_run_actor_task.go b/model_schedule_action_short_run_actor_task.go new file mode 100644 index 0000000..ce40e59 --- /dev/null +++ b/model_schedule_action_short_run_actor_task.go @@ -0,0 +1,218 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" + "bytes" + "fmt" +) + +// checks if the ScheduleActionShortRunActorTask type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ScheduleActionShortRunActorTask{} + +// ScheduleActionShortRunActorTask struct for ScheduleActionShortRunActorTask +type ScheduleActionShortRunActorTask struct { + Id string `json:"id"` + Type interface{} `json:"type"` + ActorTaskId string `json:"actorTaskId"` +} + +type _ScheduleActionShortRunActorTask ScheduleActionShortRunActorTask + +// NewScheduleActionShortRunActorTask instantiates a new ScheduleActionShortRunActorTask object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewScheduleActionShortRunActorTask(id string, type_ interface{}, actorTaskId string) *ScheduleActionShortRunActorTask { + this := ScheduleActionShortRunActorTask{} + this.Id = id + this.Type = type_ + this.ActorTaskId = actorTaskId + return &this +} + +// NewScheduleActionShortRunActorTaskWithDefaults instantiates a new ScheduleActionShortRunActorTask object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewScheduleActionShortRunActorTaskWithDefaults() *ScheduleActionShortRunActorTask { + this := ScheduleActionShortRunActorTask{} + return &this +} + +// GetId returns the Id field value +func (o *ScheduleActionShortRunActorTask) GetId() string { + if o == nil { + var ret string + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *ScheduleActionShortRunActorTask) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *ScheduleActionShortRunActorTask) SetId(v string) { + o.Id = v +} + +// GetType returns the Type field value +// If the value is explicit nil, the zero value for interface{} will be returned +func (o *ScheduleActionShortRunActorTask) GetType() interface{} { + if o == nil { + var ret interface{} + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ScheduleActionShortRunActorTask) GetTypeOk() (*interface{}, bool) { + if o == nil || IsNil(o.Type) { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *ScheduleActionShortRunActorTask) SetType(v interface{}) { + o.Type = v +} + +// GetActorTaskId returns the ActorTaskId field value +func (o *ScheduleActionShortRunActorTask) GetActorTaskId() string { + if o == nil { + var ret string + return ret + } + + return o.ActorTaskId +} + +// GetActorTaskIdOk returns a tuple with the ActorTaskId field value +// and a boolean to check if the value has been set. +func (o *ScheduleActionShortRunActorTask) GetActorTaskIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ActorTaskId, true +} + +// SetActorTaskId sets field value +func (o *ScheduleActionShortRunActorTask) SetActorTaskId(v string) { + o.ActorTaskId = v +} + +func (o ScheduleActionShortRunActorTask) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ScheduleActionShortRunActorTask) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + if o.Type != nil { + toSerialize["type"] = o.Type + } + toSerialize["actorTaskId"] = o.ActorTaskId + return toSerialize, nil +} + +func (o *ScheduleActionShortRunActorTask) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "type", + "actorTaskId", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varScheduleActionShortRunActorTask := _ScheduleActionShortRunActorTask{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varScheduleActionShortRunActorTask) + + if err != nil { + return err + } + + *o = ScheduleActionShortRunActorTask(varScheduleActionShortRunActorTask) + + return err +} + +type NullableScheduleActionShortRunActorTask struct { + value *ScheduleActionShortRunActorTask + isSet bool +} + +func (v NullableScheduleActionShortRunActorTask) Get() *ScheduleActionShortRunActorTask { + return v.value +} + +func (v *NullableScheduleActionShortRunActorTask) Set(val *ScheduleActionShortRunActorTask) { + v.value = val + v.isSet = true +} + +func (v NullableScheduleActionShortRunActorTask) IsSet() bool { + return v.isSet +} + +func (v *NullableScheduleActionShortRunActorTask) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableScheduleActionShortRunActorTask(val *ScheduleActionShortRunActorTask) *NullableScheduleActionShortRunActorTask { + return &NullableScheduleActionShortRunActorTask{value: val, isSet: true} +} + +func (v NullableScheduleActionShortRunActorTask) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableScheduleActionShortRunActorTask) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_schedule_base.go b/model_schedule_base.go new file mode 100644 index 0000000..6c3f077 --- /dev/null +++ b/model_schedule_base.go @@ -0,0 +1,475 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" + "time" + "bytes" + "fmt" +) + +// checks if the ScheduleBase type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ScheduleBase{} + +// ScheduleBase struct for ScheduleBase +type ScheduleBase struct { + Id string `json:"id"` + UserId string `json:"userId"` + Name string `json:"name"` + CronExpression string `json:"cronExpression"` + Timezone string `json:"timezone"` + IsEnabled bool `json:"isEnabled"` + IsExclusive bool `json:"isExclusive"` + CreatedAt time.Time `json:"createdAt"` + ModifiedAt time.Time `json:"modifiedAt"` + NextRunAt NullableTime `json:"nextRunAt,omitempty"` + LastRunAt NullableTime `json:"lastRunAt,omitempty"` +} + +type _ScheduleBase ScheduleBase + +// NewScheduleBase instantiates a new ScheduleBase object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewScheduleBase(id string, userId string, name string, cronExpression string, timezone string, isEnabled bool, isExclusive bool, createdAt time.Time, modifiedAt time.Time) *ScheduleBase { + this := ScheduleBase{} + this.Id = id + this.UserId = userId + this.Name = name + this.CronExpression = cronExpression + this.Timezone = timezone + this.IsEnabled = isEnabled + this.IsExclusive = isExclusive + this.CreatedAt = createdAt + this.ModifiedAt = modifiedAt + return &this +} + +// NewScheduleBaseWithDefaults instantiates a new ScheduleBase object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewScheduleBaseWithDefaults() *ScheduleBase { + this := ScheduleBase{} + return &this +} + +// GetId returns the Id field value +func (o *ScheduleBase) GetId() string { + if o == nil { + var ret string + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *ScheduleBase) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *ScheduleBase) SetId(v string) { + o.Id = v +} + +// GetUserId returns the UserId field value +func (o *ScheduleBase) GetUserId() string { + if o == nil { + var ret string + return ret + } + + return o.UserId +} + +// GetUserIdOk returns a tuple with the UserId field value +// and a boolean to check if the value has been set. +func (o *ScheduleBase) GetUserIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.UserId, true +} + +// SetUserId sets field value +func (o *ScheduleBase) SetUserId(v string) { + o.UserId = v +} + +// GetName returns the Name field value +func (o *ScheduleBase) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *ScheduleBase) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *ScheduleBase) SetName(v string) { + o.Name = v +} + +// GetCronExpression returns the CronExpression field value +func (o *ScheduleBase) GetCronExpression() string { + if o == nil { + var ret string + return ret + } + + return o.CronExpression +} + +// GetCronExpressionOk returns a tuple with the CronExpression field value +// and a boolean to check if the value has been set. +func (o *ScheduleBase) GetCronExpressionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.CronExpression, true +} + +// SetCronExpression sets field value +func (o *ScheduleBase) SetCronExpression(v string) { + o.CronExpression = v +} + +// GetTimezone returns the Timezone field value +func (o *ScheduleBase) GetTimezone() string { + if o == nil { + var ret string + return ret + } + + return o.Timezone +} + +// GetTimezoneOk returns a tuple with the Timezone field value +// and a boolean to check if the value has been set. +func (o *ScheduleBase) GetTimezoneOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Timezone, true +} + +// SetTimezone sets field value +func (o *ScheduleBase) SetTimezone(v string) { + o.Timezone = v +} + +// GetIsEnabled returns the IsEnabled field value +func (o *ScheduleBase) GetIsEnabled() bool { + if o == nil { + var ret bool + return ret + } + + return o.IsEnabled +} + +// GetIsEnabledOk returns a tuple with the IsEnabled field value +// and a boolean to check if the value has been set. +func (o *ScheduleBase) GetIsEnabledOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.IsEnabled, true +} + +// SetIsEnabled sets field value +func (o *ScheduleBase) SetIsEnabled(v bool) { + o.IsEnabled = v +} + +// GetIsExclusive returns the IsExclusive field value +func (o *ScheduleBase) GetIsExclusive() bool { + if o == nil { + var ret bool + return ret + } + + return o.IsExclusive +} + +// GetIsExclusiveOk returns a tuple with the IsExclusive field value +// and a boolean to check if the value has been set. +func (o *ScheduleBase) GetIsExclusiveOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.IsExclusive, true +} + +// SetIsExclusive sets field value +func (o *ScheduleBase) SetIsExclusive(v bool) { + o.IsExclusive = v +} + +// GetCreatedAt returns the CreatedAt field value +func (o *ScheduleBase) GetCreatedAt() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value +// and a boolean to check if the value has been set. +func (o *ScheduleBase) GetCreatedAtOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.CreatedAt, true +} + +// SetCreatedAt sets field value +func (o *ScheduleBase) SetCreatedAt(v time.Time) { + o.CreatedAt = v +} + +// GetModifiedAt returns the ModifiedAt field value +func (o *ScheduleBase) GetModifiedAt() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.ModifiedAt +} + +// GetModifiedAtOk returns a tuple with the ModifiedAt field value +// and a boolean to check if the value has been set. +func (o *ScheduleBase) GetModifiedAtOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.ModifiedAt, true +} + +// SetModifiedAt sets field value +func (o *ScheduleBase) SetModifiedAt(v time.Time) { + o.ModifiedAt = v +} + +// GetNextRunAt returns the NextRunAt field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ScheduleBase) GetNextRunAt() time.Time { + if o == nil || IsNil(o.NextRunAt.Get()) { + var ret time.Time + return ret + } + return *o.NextRunAt.Get() +} + +// GetNextRunAtOk returns a tuple with the NextRunAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ScheduleBase) GetNextRunAtOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.NextRunAt.Get(), o.NextRunAt.IsSet() +} + +// HasNextRunAt returns a boolean if a field has been set. +func (o *ScheduleBase) HasNextRunAt() bool { + if o != nil && o.NextRunAt.IsSet() { + return true + } + + return false +} + +// SetNextRunAt gets a reference to the given NullableTime and assigns it to the NextRunAt field. +func (o *ScheduleBase) SetNextRunAt(v time.Time) { + o.NextRunAt.Set(&v) +} +// SetNextRunAtNil sets the value for NextRunAt to be an explicit nil +func (o *ScheduleBase) SetNextRunAtNil() { + o.NextRunAt.Set(nil) +} + +// UnsetNextRunAt ensures that no value is present for NextRunAt, not even an explicit nil +func (o *ScheduleBase) UnsetNextRunAt() { + o.NextRunAt.Unset() +} + +// GetLastRunAt returns the LastRunAt field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ScheduleBase) GetLastRunAt() time.Time { + if o == nil || IsNil(o.LastRunAt.Get()) { + var ret time.Time + return ret + } + return *o.LastRunAt.Get() +} + +// GetLastRunAtOk returns a tuple with the LastRunAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ScheduleBase) GetLastRunAtOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.LastRunAt.Get(), o.LastRunAt.IsSet() +} + +// HasLastRunAt returns a boolean if a field has been set. +func (o *ScheduleBase) HasLastRunAt() bool { + if o != nil && o.LastRunAt.IsSet() { + return true + } + + return false +} + +// SetLastRunAt gets a reference to the given NullableTime and assigns it to the LastRunAt field. +func (o *ScheduleBase) SetLastRunAt(v time.Time) { + o.LastRunAt.Set(&v) +} +// SetLastRunAtNil sets the value for LastRunAt to be an explicit nil +func (o *ScheduleBase) SetLastRunAtNil() { + o.LastRunAt.Set(nil) +} + +// UnsetLastRunAt ensures that no value is present for LastRunAt, not even an explicit nil +func (o *ScheduleBase) UnsetLastRunAt() { + o.LastRunAt.Unset() +} + +func (o ScheduleBase) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ScheduleBase) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["userId"] = o.UserId + toSerialize["name"] = o.Name + toSerialize["cronExpression"] = o.CronExpression + toSerialize["timezone"] = o.Timezone + toSerialize["isEnabled"] = o.IsEnabled + toSerialize["isExclusive"] = o.IsExclusive + toSerialize["createdAt"] = o.CreatedAt + toSerialize["modifiedAt"] = o.ModifiedAt + if o.NextRunAt.IsSet() { + toSerialize["nextRunAt"] = o.NextRunAt.Get() + } + if o.LastRunAt.IsSet() { + toSerialize["lastRunAt"] = o.LastRunAt.Get() + } + return toSerialize, nil +} + +func (o *ScheduleBase) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "userId", + "name", + "cronExpression", + "timezone", + "isEnabled", + "isExclusive", + "createdAt", + "modifiedAt", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varScheduleBase := _ScheduleBase{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varScheduleBase) + + if err != nil { + return err + } + + *o = ScheduleBase(varScheduleBase) + + return err +} + +type NullableScheduleBase struct { + value *ScheduleBase + isSet bool +} + +func (v NullableScheduleBase) Get() *ScheduleBase { + return v.value +} + +func (v *NullableScheduleBase) Set(val *ScheduleBase) { + v.value = val + v.isSet = true +} + +func (v NullableScheduleBase) IsSet() bool { + return v.isSet +} + +func (v *NullableScheduleBase) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableScheduleBase(val *ScheduleBase) *NullableScheduleBase { + return &NullableScheduleBase{value: val, isSet: true} +} + +func (v NullableScheduleBase) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableScheduleBase) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_schedule_create.go b/model_schedule_create.go new file mode 100644 index 0000000..7ac540a --- /dev/null +++ b/model_schedule_create.go @@ -0,0 +1,450 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" +) + +// checks if the ScheduleCreate type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ScheduleCreate{} + +// ScheduleCreate struct for ScheduleCreate +type ScheduleCreate struct { + Name NullableString `json:"name,omitempty"` + IsEnabled NullableBool `json:"isEnabled,omitempty"` + IsExclusive NullableBool `json:"isExclusive,omitempty"` + CronExpression NullableString `json:"cronExpression,omitempty"` + Timezone NullableString `json:"timezone,omitempty"` + Description NullableString `json:"description,omitempty"` + Title NullableString `json:"title,omitempty"` + // + Actions []ScheduleCreateAction `json:"actions,omitempty"` +} + +// NewScheduleCreate instantiates a new ScheduleCreate object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewScheduleCreate() *ScheduleCreate { + this := ScheduleCreate{} + return &this +} + +// NewScheduleCreateWithDefaults instantiates a new ScheduleCreate object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewScheduleCreateWithDefaults() *ScheduleCreate { + this := ScheduleCreate{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ScheduleCreate) GetName() string { + if o == nil || IsNil(o.Name.Get()) { + var ret string + return ret + } + return *o.Name.Get() +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ScheduleCreate) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Name.Get(), o.Name.IsSet() +} + +// HasName returns a boolean if a field has been set. +func (o *ScheduleCreate) HasName() bool { + if o != nil && o.Name.IsSet() { + return true + } + + return false +} + +// SetName gets a reference to the given NullableString and assigns it to the Name field. +func (o *ScheduleCreate) SetName(v string) { + o.Name.Set(&v) +} +// SetNameNil sets the value for Name to be an explicit nil +func (o *ScheduleCreate) SetNameNil() { + o.Name.Set(nil) +} + +// UnsetName ensures that no value is present for Name, not even an explicit nil +func (o *ScheduleCreate) UnsetName() { + o.Name.Unset() +} + +// GetIsEnabled returns the IsEnabled field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ScheduleCreate) GetIsEnabled() bool { + if o == nil || IsNil(o.IsEnabled.Get()) { + var ret bool + return ret + } + return *o.IsEnabled.Get() +} + +// GetIsEnabledOk returns a tuple with the IsEnabled field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ScheduleCreate) GetIsEnabledOk() (*bool, bool) { + if o == nil { + return nil, false + } + return o.IsEnabled.Get(), o.IsEnabled.IsSet() +} + +// HasIsEnabled returns a boolean if a field has been set. +func (o *ScheduleCreate) HasIsEnabled() bool { + if o != nil && o.IsEnabled.IsSet() { + return true + } + + return false +} + +// SetIsEnabled gets a reference to the given NullableBool and assigns it to the IsEnabled field. +func (o *ScheduleCreate) SetIsEnabled(v bool) { + o.IsEnabled.Set(&v) +} +// SetIsEnabledNil sets the value for IsEnabled to be an explicit nil +func (o *ScheduleCreate) SetIsEnabledNil() { + o.IsEnabled.Set(nil) +} + +// UnsetIsEnabled ensures that no value is present for IsEnabled, not even an explicit nil +func (o *ScheduleCreate) UnsetIsEnabled() { + o.IsEnabled.Unset() +} + +// GetIsExclusive returns the IsExclusive field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ScheduleCreate) GetIsExclusive() bool { + if o == nil || IsNil(o.IsExclusive.Get()) { + var ret bool + return ret + } + return *o.IsExclusive.Get() +} + +// GetIsExclusiveOk returns a tuple with the IsExclusive field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ScheduleCreate) GetIsExclusiveOk() (*bool, bool) { + if o == nil { + return nil, false + } + return o.IsExclusive.Get(), o.IsExclusive.IsSet() +} + +// HasIsExclusive returns a boolean if a field has been set. +func (o *ScheduleCreate) HasIsExclusive() bool { + if o != nil && o.IsExclusive.IsSet() { + return true + } + + return false +} + +// SetIsExclusive gets a reference to the given NullableBool and assigns it to the IsExclusive field. +func (o *ScheduleCreate) SetIsExclusive(v bool) { + o.IsExclusive.Set(&v) +} +// SetIsExclusiveNil sets the value for IsExclusive to be an explicit nil +func (o *ScheduleCreate) SetIsExclusiveNil() { + o.IsExclusive.Set(nil) +} + +// UnsetIsExclusive ensures that no value is present for IsExclusive, not even an explicit nil +func (o *ScheduleCreate) UnsetIsExclusive() { + o.IsExclusive.Unset() +} + +// GetCronExpression returns the CronExpression field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ScheduleCreate) GetCronExpression() string { + if o == nil || IsNil(o.CronExpression.Get()) { + var ret string + return ret + } + return *o.CronExpression.Get() +} + +// GetCronExpressionOk returns a tuple with the CronExpression field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ScheduleCreate) GetCronExpressionOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.CronExpression.Get(), o.CronExpression.IsSet() +} + +// HasCronExpression returns a boolean if a field has been set. +func (o *ScheduleCreate) HasCronExpression() bool { + if o != nil && o.CronExpression.IsSet() { + return true + } + + return false +} + +// SetCronExpression gets a reference to the given NullableString and assigns it to the CronExpression field. +func (o *ScheduleCreate) SetCronExpression(v string) { + o.CronExpression.Set(&v) +} +// SetCronExpressionNil sets the value for CronExpression to be an explicit nil +func (o *ScheduleCreate) SetCronExpressionNil() { + o.CronExpression.Set(nil) +} + +// UnsetCronExpression ensures that no value is present for CronExpression, not even an explicit nil +func (o *ScheduleCreate) UnsetCronExpression() { + o.CronExpression.Unset() +} + +// GetTimezone returns the Timezone field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ScheduleCreate) GetTimezone() string { + if o == nil || IsNil(o.Timezone.Get()) { + var ret string + return ret + } + return *o.Timezone.Get() +} + +// GetTimezoneOk returns a tuple with the Timezone field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ScheduleCreate) GetTimezoneOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Timezone.Get(), o.Timezone.IsSet() +} + +// HasTimezone returns a boolean if a field has been set. +func (o *ScheduleCreate) HasTimezone() bool { + if o != nil && o.Timezone.IsSet() { + return true + } + + return false +} + +// SetTimezone gets a reference to the given NullableString and assigns it to the Timezone field. +func (o *ScheduleCreate) SetTimezone(v string) { + o.Timezone.Set(&v) +} +// SetTimezoneNil sets the value for Timezone to be an explicit nil +func (o *ScheduleCreate) SetTimezoneNil() { + o.Timezone.Set(nil) +} + +// UnsetTimezone ensures that no value is present for Timezone, not even an explicit nil +func (o *ScheduleCreate) UnsetTimezone() { + o.Timezone.Unset() +} + +// GetDescription returns the Description field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ScheduleCreate) GetDescription() string { + if o == nil || IsNil(o.Description.Get()) { + var ret string + return ret + } + return *o.Description.Get() +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ScheduleCreate) GetDescriptionOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Description.Get(), o.Description.IsSet() +} + +// HasDescription returns a boolean if a field has been set. +func (o *ScheduleCreate) HasDescription() bool { + if o != nil && o.Description.IsSet() { + return true + } + + return false +} + +// SetDescription gets a reference to the given NullableString and assigns it to the Description field. +func (o *ScheduleCreate) SetDescription(v string) { + o.Description.Set(&v) +} +// SetDescriptionNil sets the value for Description to be an explicit nil +func (o *ScheduleCreate) SetDescriptionNil() { + o.Description.Set(nil) +} + +// UnsetDescription ensures that no value is present for Description, not even an explicit nil +func (o *ScheduleCreate) UnsetDescription() { + o.Description.Unset() +} + +// GetTitle returns the Title field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ScheduleCreate) GetTitle() string { + if o == nil || IsNil(o.Title.Get()) { + var ret string + return ret + } + return *o.Title.Get() +} + +// GetTitleOk returns a tuple with the Title field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ScheduleCreate) GetTitleOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Title.Get(), o.Title.IsSet() +} + +// HasTitle returns a boolean if a field has been set. +func (o *ScheduleCreate) HasTitle() bool { + if o != nil && o.Title.IsSet() { + return true + } + + return false +} + +// SetTitle gets a reference to the given NullableString and assigns it to the Title field. +func (o *ScheduleCreate) SetTitle(v string) { + o.Title.Set(&v) +} +// SetTitleNil sets the value for Title to be an explicit nil +func (o *ScheduleCreate) SetTitleNil() { + o.Title.Set(nil) +} + +// UnsetTitle ensures that no value is present for Title, not even an explicit nil +func (o *ScheduleCreate) UnsetTitle() { + o.Title.Unset() +} + +// GetActions returns the Actions field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ScheduleCreate) GetActions() []ScheduleCreateAction { + if o == nil { + var ret []ScheduleCreateAction + return ret + } + return o.Actions +} + +// GetActionsOk returns a tuple with the Actions field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ScheduleCreate) GetActionsOk() ([]ScheduleCreateAction, bool) { + if o == nil || IsNil(o.Actions) { + return nil, false + } + return o.Actions, true +} + +// HasActions returns a boolean if a field has been set. +func (o *ScheduleCreate) HasActions() bool { + if o != nil && !IsNil(o.Actions) { + return true + } + + return false +} + +// SetActions gets a reference to the given []ScheduleCreateAction and assigns it to the Actions field. +func (o *ScheduleCreate) SetActions(v []ScheduleCreateAction) { + o.Actions = v +} + +func (o ScheduleCreate) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ScheduleCreate) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.Name.IsSet() { + toSerialize["name"] = o.Name.Get() + } + if o.IsEnabled.IsSet() { + toSerialize["isEnabled"] = o.IsEnabled.Get() + } + if o.IsExclusive.IsSet() { + toSerialize["isExclusive"] = o.IsExclusive.Get() + } + if o.CronExpression.IsSet() { + toSerialize["cronExpression"] = o.CronExpression.Get() + } + if o.Timezone.IsSet() { + toSerialize["timezone"] = o.Timezone.Get() + } + if o.Description.IsSet() { + toSerialize["description"] = o.Description.Get() + } + if o.Title.IsSet() { + toSerialize["title"] = o.Title.Get() + } + if o.Actions != nil { + toSerialize["actions"] = o.Actions + } + return toSerialize, nil +} + +type NullableScheduleCreate struct { + value *ScheduleCreate + isSet bool +} + +func (v NullableScheduleCreate) Get() *ScheduleCreate { + return v.value +} + +func (v *NullableScheduleCreate) Set(val *ScheduleCreate) { + v.value = val + v.isSet = true +} + +func (v NullableScheduleCreate) IsSet() bool { + return v.isSet +} + +func (v *NullableScheduleCreate) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableScheduleCreate(val *ScheduleCreate) *NullableScheduleCreate { + return &NullableScheduleCreate{value: val, isSet: true} +} + +func (v NullableScheduleCreate) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableScheduleCreate) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_schedule_create_action.go b/model_schedule_create_action.go new file mode 100644 index 0000000..aa7cb62 --- /dev/null +++ b/model_schedule_create_action.go @@ -0,0 +1,171 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" + "fmt" + "gopkg.in/validator.v2" +) + +// ScheduleCreateAction - struct for ScheduleCreateAction +type ScheduleCreateAction struct { + ScheduleCreateActionRunActor *ScheduleCreateActionRunActor + ScheduleCreateActionRunActorTask *ScheduleCreateActionRunActorTask +} + +// ScheduleCreateActionRunActorAsScheduleCreateAction is a convenience function that returns ScheduleCreateActionRunActor wrapped in ScheduleCreateAction +func ScheduleCreateActionRunActorAsScheduleCreateAction(v *ScheduleCreateActionRunActor) ScheduleCreateAction { + return ScheduleCreateAction{ + ScheduleCreateActionRunActor: v, + } +} + +// ScheduleCreateActionRunActorTaskAsScheduleCreateAction is a convenience function that returns ScheduleCreateActionRunActorTask wrapped in ScheduleCreateAction +func ScheduleCreateActionRunActorTaskAsScheduleCreateAction(v *ScheduleCreateActionRunActorTask) ScheduleCreateAction { + return ScheduleCreateAction{ + ScheduleCreateActionRunActorTask: v, + } +} + + +// Unmarshal JSON data into one of the pointers in the struct +func (dst *ScheduleCreateAction) UnmarshalJSON(data []byte) error { + var err error + match := 0 + // try to unmarshal data into ScheduleCreateActionRunActor + err = newStrictDecoder(data).Decode(&dst.ScheduleCreateActionRunActor) + if err == nil { + jsonScheduleCreateActionRunActor, _ := json.Marshal(dst.ScheduleCreateActionRunActor) + if string(jsonScheduleCreateActionRunActor) == "{}" { // empty struct + dst.ScheduleCreateActionRunActor = nil + } else { + if err = validator.Validate(dst.ScheduleCreateActionRunActor); err != nil { + dst.ScheduleCreateActionRunActor = nil + } else { + match++ + } + } + } else { + dst.ScheduleCreateActionRunActor = nil + } + + // try to unmarshal data into ScheduleCreateActionRunActorTask + err = newStrictDecoder(data).Decode(&dst.ScheduleCreateActionRunActorTask) + if err == nil { + jsonScheduleCreateActionRunActorTask, _ := json.Marshal(dst.ScheduleCreateActionRunActorTask) + if string(jsonScheduleCreateActionRunActorTask) == "{}" { // empty struct + dst.ScheduleCreateActionRunActorTask = nil + } else { + if err = validator.Validate(dst.ScheduleCreateActionRunActorTask); err != nil { + dst.ScheduleCreateActionRunActorTask = nil + } else { + match++ + } + } + } else { + dst.ScheduleCreateActionRunActorTask = nil + } + + if match > 1 { // more than 1 match + // reset to nil + dst.ScheduleCreateActionRunActor = nil + dst.ScheduleCreateActionRunActorTask = nil + + return fmt.Errorf("data matches more than one schema in oneOf(ScheduleCreateAction)") + } else if match == 1 { + return nil // exactly one match + } else { // no match + return fmt.Errorf("data failed to match schemas in oneOf(ScheduleCreateAction)") + } +} + +// Marshal data from the first non-nil pointers in the struct to JSON +func (src ScheduleCreateAction) MarshalJSON() ([]byte, error) { + if src.ScheduleCreateActionRunActor != nil { + return json.Marshal(&src.ScheduleCreateActionRunActor) + } + + if src.ScheduleCreateActionRunActorTask != nil { + return json.Marshal(&src.ScheduleCreateActionRunActorTask) + } + + return nil, nil // no data in oneOf schemas +} + +// Get the actual instance +func (obj *ScheduleCreateAction) GetActualInstance() (interface{}) { + if obj == nil { + return nil + } + if obj.ScheduleCreateActionRunActor != nil { + return obj.ScheduleCreateActionRunActor + } + + if obj.ScheduleCreateActionRunActorTask != nil { + return obj.ScheduleCreateActionRunActorTask + } + + // all schemas are nil + return nil +} + +// Get the actual instance value +func (obj ScheduleCreateAction) GetActualInstanceValue() (interface{}) { + if obj.ScheduleCreateActionRunActor != nil { + return *obj.ScheduleCreateActionRunActor + } + + if obj.ScheduleCreateActionRunActorTask != nil { + return *obj.ScheduleCreateActionRunActorTask + } + + // all schemas are nil + return nil +} + +type NullableScheduleCreateAction struct { + value *ScheduleCreateAction + isSet bool +} + +func (v NullableScheduleCreateAction) Get() *ScheduleCreateAction { + return v.value +} + +func (v *NullableScheduleCreateAction) Set(val *ScheduleCreateAction) { + v.value = val + v.isSet = true +} + +func (v NullableScheduleCreateAction) IsSet() bool { + return v.isSet +} + +func (v *NullableScheduleCreateAction) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableScheduleCreateAction(val *ScheduleCreateAction) *NullableScheduleCreateAction { + return &NullableScheduleCreateAction{value: val, isSet: true} +} + +func (v NullableScheduleCreateAction) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableScheduleCreateAction) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_schedule_create_action_run_actor.go b/model_schedule_create_action_run_actor.go new file mode 100644 index 0000000..94ee5d7 --- /dev/null +++ b/model_schedule_create_action_run_actor.go @@ -0,0 +1,282 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" + "bytes" + "fmt" +) + +// checks if the ScheduleCreateActionRunActor type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ScheduleCreateActionRunActor{} + +// ScheduleCreateActionRunActor struct for ScheduleCreateActionRunActor +type ScheduleCreateActionRunActor struct { + Type interface{} `json:"type"` + ActorId string `json:"actorId"` + RunInput NullableScheduleActionRunInput `json:"runInput,omitempty"` + RunOptions NullableTaskOptions `json:"runOptions,omitempty"` +} + +type _ScheduleCreateActionRunActor ScheduleCreateActionRunActor + +// NewScheduleCreateActionRunActor instantiates a new ScheduleCreateActionRunActor object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewScheduleCreateActionRunActor(type_ interface{}, actorId string) *ScheduleCreateActionRunActor { + this := ScheduleCreateActionRunActor{} + this.Type = type_ + this.ActorId = actorId + return &this +} + +// NewScheduleCreateActionRunActorWithDefaults instantiates a new ScheduleCreateActionRunActor object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewScheduleCreateActionRunActorWithDefaults() *ScheduleCreateActionRunActor { + this := ScheduleCreateActionRunActor{} + return &this +} + +// GetType returns the Type field value +// If the value is explicit nil, the zero value for interface{} will be returned +func (o *ScheduleCreateActionRunActor) GetType() interface{} { + if o == nil { + var ret interface{} + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ScheduleCreateActionRunActor) GetTypeOk() (*interface{}, bool) { + if o == nil || IsNil(o.Type) { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *ScheduleCreateActionRunActor) SetType(v interface{}) { + o.Type = v +} + +// GetActorId returns the ActorId field value +func (o *ScheduleCreateActionRunActor) GetActorId() string { + if o == nil { + var ret string + return ret + } + + return o.ActorId +} + +// GetActorIdOk returns a tuple with the ActorId field value +// and a boolean to check if the value has been set. +func (o *ScheduleCreateActionRunActor) GetActorIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ActorId, true +} + +// SetActorId sets field value +func (o *ScheduleCreateActionRunActor) SetActorId(v string) { + o.ActorId = v +} + +// GetRunInput returns the RunInput field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ScheduleCreateActionRunActor) GetRunInput() ScheduleActionRunInput { + if o == nil || IsNil(o.RunInput.Get()) { + var ret ScheduleActionRunInput + return ret + } + return *o.RunInput.Get() +} + +// GetRunInputOk returns a tuple with the RunInput field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ScheduleCreateActionRunActor) GetRunInputOk() (*ScheduleActionRunInput, bool) { + if o == nil { + return nil, false + } + return o.RunInput.Get(), o.RunInput.IsSet() +} + +// HasRunInput returns a boolean if a field has been set. +func (o *ScheduleCreateActionRunActor) HasRunInput() bool { + if o != nil && o.RunInput.IsSet() { + return true + } + + return false +} + +// SetRunInput gets a reference to the given NullableScheduleActionRunInput and assigns it to the RunInput field. +func (o *ScheduleCreateActionRunActor) SetRunInput(v ScheduleActionRunInput) { + o.RunInput.Set(&v) +} +// SetRunInputNil sets the value for RunInput to be an explicit nil +func (o *ScheduleCreateActionRunActor) SetRunInputNil() { + o.RunInput.Set(nil) +} + +// UnsetRunInput ensures that no value is present for RunInput, not even an explicit nil +func (o *ScheduleCreateActionRunActor) UnsetRunInput() { + o.RunInput.Unset() +} + +// GetRunOptions returns the RunOptions field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ScheduleCreateActionRunActor) GetRunOptions() TaskOptions { + if o == nil || IsNil(o.RunOptions.Get()) { + var ret TaskOptions + return ret + } + return *o.RunOptions.Get() +} + +// GetRunOptionsOk returns a tuple with the RunOptions field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ScheduleCreateActionRunActor) GetRunOptionsOk() (*TaskOptions, bool) { + if o == nil { + return nil, false + } + return o.RunOptions.Get(), o.RunOptions.IsSet() +} + +// HasRunOptions returns a boolean if a field has been set. +func (o *ScheduleCreateActionRunActor) HasRunOptions() bool { + if o != nil && o.RunOptions.IsSet() { + return true + } + + return false +} + +// SetRunOptions gets a reference to the given NullableTaskOptions and assigns it to the RunOptions field. +func (o *ScheduleCreateActionRunActor) SetRunOptions(v TaskOptions) { + o.RunOptions.Set(&v) +} +// SetRunOptionsNil sets the value for RunOptions to be an explicit nil +func (o *ScheduleCreateActionRunActor) SetRunOptionsNil() { + o.RunOptions.Set(nil) +} + +// UnsetRunOptions ensures that no value is present for RunOptions, not even an explicit nil +func (o *ScheduleCreateActionRunActor) UnsetRunOptions() { + o.RunOptions.Unset() +} + +func (o ScheduleCreateActionRunActor) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ScheduleCreateActionRunActor) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.Type != nil { + toSerialize["type"] = o.Type + } + toSerialize["actorId"] = o.ActorId + if o.RunInput.IsSet() { + toSerialize["runInput"] = o.RunInput.Get() + } + if o.RunOptions.IsSet() { + toSerialize["runOptions"] = o.RunOptions.Get() + } + return toSerialize, nil +} + +func (o *ScheduleCreateActionRunActor) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "type", + "actorId", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varScheduleCreateActionRunActor := _ScheduleCreateActionRunActor{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varScheduleCreateActionRunActor) + + if err != nil { + return err + } + + *o = ScheduleCreateActionRunActor(varScheduleCreateActionRunActor) + + return err +} + +type NullableScheduleCreateActionRunActor struct { + value *ScheduleCreateActionRunActor + isSet bool +} + +func (v NullableScheduleCreateActionRunActor) Get() *ScheduleCreateActionRunActor { + return v.value +} + +func (v *NullableScheduleCreateActionRunActor) Set(val *ScheduleCreateActionRunActor) { + v.value = val + v.isSet = true +} + +func (v NullableScheduleCreateActionRunActor) IsSet() bool { + return v.isSet +} + +func (v *NullableScheduleCreateActionRunActor) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableScheduleCreateActionRunActor(val *ScheduleCreateActionRunActor) *NullableScheduleCreateActionRunActor { + return &NullableScheduleCreateActionRunActor{value: val, isSet: true} +} + +func (v NullableScheduleCreateActionRunActor) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableScheduleCreateActionRunActor) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_schedule_create_action_run_actor_task.go b/model_schedule_create_action_run_actor_task.go new file mode 100644 index 0000000..39f6798 --- /dev/null +++ b/model_schedule_create_action_run_actor_task.go @@ -0,0 +1,227 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" + "bytes" + "fmt" +) + +// checks if the ScheduleCreateActionRunActorTask type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ScheduleCreateActionRunActorTask{} + +// ScheduleCreateActionRunActorTask struct for ScheduleCreateActionRunActorTask +type ScheduleCreateActionRunActorTask struct { + Type interface{} `json:"type"` + ActorTaskId string `json:"actorTaskId"` + Input map[string]interface{} `json:"input,omitempty"` +} + +type _ScheduleCreateActionRunActorTask ScheduleCreateActionRunActorTask + +// NewScheduleCreateActionRunActorTask instantiates a new ScheduleCreateActionRunActorTask object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewScheduleCreateActionRunActorTask(type_ interface{}, actorTaskId string) *ScheduleCreateActionRunActorTask { + this := ScheduleCreateActionRunActorTask{} + this.Type = type_ + this.ActorTaskId = actorTaskId + return &this +} + +// NewScheduleCreateActionRunActorTaskWithDefaults instantiates a new ScheduleCreateActionRunActorTask object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewScheduleCreateActionRunActorTaskWithDefaults() *ScheduleCreateActionRunActorTask { + this := ScheduleCreateActionRunActorTask{} + return &this +} + +// GetType returns the Type field value +// If the value is explicit nil, the zero value for interface{} will be returned +func (o *ScheduleCreateActionRunActorTask) GetType() interface{} { + if o == nil { + var ret interface{} + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ScheduleCreateActionRunActorTask) GetTypeOk() (*interface{}, bool) { + if o == nil || IsNil(o.Type) { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *ScheduleCreateActionRunActorTask) SetType(v interface{}) { + o.Type = v +} + +// GetActorTaskId returns the ActorTaskId field value +func (o *ScheduleCreateActionRunActorTask) GetActorTaskId() string { + if o == nil { + var ret string + return ret + } + + return o.ActorTaskId +} + +// GetActorTaskIdOk returns a tuple with the ActorTaskId field value +// and a boolean to check if the value has been set. +func (o *ScheduleCreateActionRunActorTask) GetActorTaskIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ActorTaskId, true +} + +// SetActorTaskId sets field value +func (o *ScheduleCreateActionRunActorTask) SetActorTaskId(v string) { + o.ActorTaskId = v +} + +// GetInput returns the Input field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ScheduleCreateActionRunActorTask) GetInput() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + return o.Input +} + +// GetInputOk returns a tuple with the Input field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ScheduleCreateActionRunActorTask) GetInputOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Input) { + return map[string]interface{}{}, false + } + return o.Input, true +} + +// HasInput returns a boolean if a field has been set. +func (o *ScheduleCreateActionRunActorTask) HasInput() bool { + if o != nil && !IsNil(o.Input) { + return true + } + + return false +} + +// SetInput gets a reference to the given map[string]interface{} and assigns it to the Input field. +func (o *ScheduleCreateActionRunActorTask) SetInput(v map[string]interface{}) { + o.Input = v +} + +func (o ScheduleCreateActionRunActorTask) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ScheduleCreateActionRunActorTask) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.Type != nil { + toSerialize["type"] = o.Type + } + toSerialize["actorTaskId"] = o.ActorTaskId + if o.Input != nil { + toSerialize["input"] = o.Input + } + return toSerialize, nil +} + +func (o *ScheduleCreateActionRunActorTask) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "type", + "actorTaskId", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varScheduleCreateActionRunActorTask := _ScheduleCreateActionRunActorTask{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varScheduleCreateActionRunActorTask) + + if err != nil { + return err + } + + *o = ScheduleCreateActionRunActorTask(varScheduleCreateActionRunActorTask) + + return err +} + +type NullableScheduleCreateActionRunActorTask struct { + value *ScheduleCreateActionRunActorTask + isSet bool +} + +func (v NullableScheduleCreateActionRunActorTask) Get() *ScheduleCreateActionRunActorTask { + return v.value +} + +func (v *NullableScheduleCreateActionRunActorTask) Set(val *ScheduleCreateActionRunActorTask) { + v.value = val + v.isSet = true +} + +func (v NullableScheduleCreateActionRunActorTask) IsSet() bool { + return v.isSet +} + +func (v *NullableScheduleCreateActionRunActorTask) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableScheduleCreateActionRunActorTask(val *ScheduleCreateActionRunActorTask) *NullableScheduleCreateActionRunActorTask { + return &NullableScheduleCreateActionRunActorTask{value: val, isSet: true} +} + +func (v NullableScheduleCreateActionRunActorTask) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableScheduleCreateActionRunActorTask) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_schedule_invoked.go b/model_schedule_invoked.go new file mode 100644 index 0000000..6ee3fc6 --- /dev/null +++ b/model_schedule_invoked.go @@ -0,0 +1,215 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" + "time" + "bytes" + "fmt" +) + +// checks if the ScheduleInvoked type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ScheduleInvoked{} + +// ScheduleInvoked struct for ScheduleInvoked +type ScheduleInvoked struct { + Message string `json:"message"` + Level string `json:"level"` + CreatedAt time.Time `json:"createdAt"` +} + +type _ScheduleInvoked ScheduleInvoked + +// NewScheduleInvoked instantiates a new ScheduleInvoked object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewScheduleInvoked(message string, level string, createdAt time.Time) *ScheduleInvoked { + this := ScheduleInvoked{} + this.Message = message + this.Level = level + this.CreatedAt = createdAt + return &this +} + +// NewScheduleInvokedWithDefaults instantiates a new ScheduleInvoked object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewScheduleInvokedWithDefaults() *ScheduleInvoked { + this := ScheduleInvoked{} + return &this +} + +// GetMessage returns the Message field value +func (o *ScheduleInvoked) GetMessage() string { + if o == nil { + var ret string + return ret + } + + return o.Message +} + +// GetMessageOk returns a tuple with the Message field value +// and a boolean to check if the value has been set. +func (o *ScheduleInvoked) GetMessageOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Message, true +} + +// SetMessage sets field value +func (o *ScheduleInvoked) SetMessage(v string) { + o.Message = v +} + +// GetLevel returns the Level field value +func (o *ScheduleInvoked) GetLevel() string { + if o == nil { + var ret string + return ret + } + + return o.Level +} + +// GetLevelOk returns a tuple with the Level field value +// and a boolean to check if the value has been set. +func (o *ScheduleInvoked) GetLevelOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Level, true +} + +// SetLevel sets field value +func (o *ScheduleInvoked) SetLevel(v string) { + o.Level = v +} + +// GetCreatedAt returns the CreatedAt field value +func (o *ScheduleInvoked) GetCreatedAt() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value +// and a boolean to check if the value has been set. +func (o *ScheduleInvoked) GetCreatedAtOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.CreatedAt, true +} + +// SetCreatedAt sets field value +func (o *ScheduleInvoked) SetCreatedAt(v time.Time) { + o.CreatedAt = v +} + +func (o ScheduleInvoked) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ScheduleInvoked) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["message"] = o.Message + toSerialize["level"] = o.Level + toSerialize["createdAt"] = o.CreatedAt + return toSerialize, nil +} + +func (o *ScheduleInvoked) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "message", + "level", + "createdAt", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varScheduleInvoked := _ScheduleInvoked{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varScheduleInvoked) + + if err != nil { + return err + } + + *o = ScheduleInvoked(varScheduleInvoked) + + return err +} + +type NullableScheduleInvoked struct { + value *ScheduleInvoked + isSet bool +} + +func (v NullableScheduleInvoked) Get() *ScheduleInvoked { + return v.value +} + +func (v *NullableScheduleInvoked) Set(val *ScheduleInvoked) { + v.value = val + v.isSet = true +} + +func (v NullableScheduleInvoked) IsSet() bool { + return v.isSet +} + +func (v *NullableScheduleInvoked) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableScheduleInvoked(val *ScheduleInvoked) *NullableScheduleInvoked { + return &NullableScheduleInvoked{value: val, isSet: true} +} + +func (v NullableScheduleInvoked) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableScheduleInvoked) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_schedule_log_response.go b/model_schedule_log_response.go new file mode 100644 index 0000000..190802c --- /dev/null +++ b/model_schedule_log_response.go @@ -0,0 +1,159 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" + "bytes" + "fmt" +) + +// checks if the ScheduleLogResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ScheduleLogResponse{} + +// ScheduleLogResponse struct for ScheduleLogResponse +type ScheduleLogResponse struct { + // + Data []ScheduleInvoked `json:"data"` +} + +type _ScheduleLogResponse ScheduleLogResponse + +// NewScheduleLogResponse instantiates a new ScheduleLogResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewScheduleLogResponse(data []ScheduleInvoked) *ScheduleLogResponse { + this := ScheduleLogResponse{} + this.Data = data + return &this +} + +// NewScheduleLogResponseWithDefaults instantiates a new ScheduleLogResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewScheduleLogResponseWithDefaults() *ScheduleLogResponse { + this := ScheduleLogResponse{} + return &this +} + +// GetData returns the Data field value +func (o *ScheduleLogResponse) GetData() []ScheduleInvoked { + if o == nil { + var ret []ScheduleInvoked + return ret + } + + return o.Data +} + +// GetDataOk returns a tuple with the Data field value +// and a boolean to check if the value has been set. +func (o *ScheduleLogResponse) GetDataOk() ([]ScheduleInvoked, bool) { + if o == nil { + return nil, false + } + return o.Data, true +} + +// SetData sets field value +func (o *ScheduleLogResponse) SetData(v []ScheduleInvoked) { + o.Data = v +} + +func (o ScheduleLogResponse) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ScheduleLogResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["data"] = o.Data + return toSerialize, nil +} + +func (o *ScheduleLogResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "data", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varScheduleLogResponse := _ScheduleLogResponse{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varScheduleLogResponse) + + if err != nil { + return err + } + + *o = ScheduleLogResponse(varScheduleLogResponse) + + return err +} + +type NullableScheduleLogResponse struct { + value *ScheduleLogResponse + isSet bool +} + +func (v NullableScheduleLogResponse) Get() *ScheduleLogResponse { + return v.value +} + +func (v *NullableScheduleLogResponse) Set(val *ScheduleLogResponse) { + v.value = val + v.isSet = true +} + +func (v NullableScheduleLogResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableScheduleLogResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableScheduleLogResponse(val *ScheduleLogResponse) *NullableScheduleLogResponse { + return &NullableScheduleLogResponse{value: val, isSet: true} +} + +func (v NullableScheduleLogResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableScheduleLogResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_schedule_notifications.go b/model_schedule_notifications.go new file mode 100644 index 0000000..aaee9bc --- /dev/null +++ b/model_schedule_notifications.go @@ -0,0 +1,126 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" +) + +// checks if the ScheduleNotifications type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ScheduleNotifications{} + +// ScheduleNotifications Notification settings for this schedule. +type ScheduleNotifications struct { + Email *bool `json:"email,omitempty"` +} + +// NewScheduleNotifications instantiates a new ScheduleNotifications object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewScheduleNotifications() *ScheduleNotifications { + this := ScheduleNotifications{} + return &this +} + +// NewScheduleNotificationsWithDefaults instantiates a new ScheduleNotifications object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewScheduleNotificationsWithDefaults() *ScheduleNotifications { + this := ScheduleNotifications{} + return &this +} + +// GetEmail returns the Email field value if set, zero value otherwise. +func (o *ScheduleNotifications) GetEmail() bool { + if o == nil || IsNil(o.Email) { + var ret bool + return ret + } + return *o.Email +} + +// GetEmailOk returns a tuple with the Email field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ScheduleNotifications) GetEmailOk() (*bool, bool) { + if o == nil || IsNil(o.Email) { + return nil, false + } + return o.Email, true +} + +// HasEmail returns a boolean if a field has been set. +func (o *ScheduleNotifications) HasEmail() bool { + if o != nil && !IsNil(o.Email) { + return true + } + + return false +} + +// SetEmail gets a reference to the given bool and assigns it to the Email field. +func (o *ScheduleNotifications) SetEmail(v bool) { + o.Email = &v +} + +func (o ScheduleNotifications) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ScheduleNotifications) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Email) { + toSerialize["email"] = o.Email + } + return toSerialize, nil +} + +type NullableScheduleNotifications struct { + value *ScheduleNotifications + isSet bool +} + +func (v NullableScheduleNotifications) Get() *ScheduleNotifications { + return v.value +} + +func (v *NullableScheduleNotifications) Set(val *ScheduleNotifications) { + v.value = val + v.isSet = true +} + +func (v NullableScheduleNotifications) IsSet() bool { + return v.isSet +} + +func (v *NullableScheduleNotifications) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableScheduleNotifications(val *ScheduleNotifications) *NullableScheduleNotifications { + return &NullableScheduleNotifications{value: val, isSet: true} +} + +func (v NullableScheduleNotifications) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableScheduleNotifications) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_schedule_response.go b/model_schedule_response.go new file mode 100644 index 0000000..c1e350d --- /dev/null +++ b/model_schedule_response.go @@ -0,0 +1,158 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" + "bytes" + "fmt" +) + +// checks if the ScheduleResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ScheduleResponse{} + +// ScheduleResponse struct for ScheduleResponse +type ScheduleResponse struct { + Data Schedule `json:"data"` +} + +type _ScheduleResponse ScheduleResponse + +// NewScheduleResponse instantiates a new ScheduleResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewScheduleResponse(data Schedule) *ScheduleResponse { + this := ScheduleResponse{} + this.Data = data + return &this +} + +// NewScheduleResponseWithDefaults instantiates a new ScheduleResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewScheduleResponseWithDefaults() *ScheduleResponse { + this := ScheduleResponse{} + return &this +} + +// GetData returns the Data field value +func (o *ScheduleResponse) GetData() Schedule { + if o == nil { + var ret Schedule + return ret + } + + return o.Data +} + +// GetDataOk returns a tuple with the Data field value +// and a boolean to check if the value has been set. +func (o *ScheduleResponse) GetDataOk() (*Schedule, bool) { + if o == nil { + return nil, false + } + return &o.Data, true +} + +// SetData sets field value +func (o *ScheduleResponse) SetData(v Schedule) { + o.Data = v +} + +func (o ScheduleResponse) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ScheduleResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["data"] = o.Data + return toSerialize, nil +} + +func (o *ScheduleResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "data", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varScheduleResponse := _ScheduleResponse{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varScheduleResponse) + + if err != nil { + return err + } + + *o = ScheduleResponse(varScheduleResponse) + + return err +} + +type NullableScheduleResponse struct { + value *ScheduleResponse + isSet bool +} + +func (v NullableScheduleResponse) Get() *ScheduleResponse { + return v.value +} + +func (v *NullableScheduleResponse) Set(val *ScheduleResponse) { + v.value = val + v.isSet = true +} + +func (v NullableScheduleResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableScheduleResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableScheduleResponse(val *ScheduleResponse) *NullableScheduleResponse { + return &NullableScheduleResponse{value: val, isSet: true} +} + +func (v NullableScheduleResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableScheduleResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_schedule_short.go b/model_schedule_short.go new file mode 100644 index 0000000..9ea2c5d --- /dev/null +++ b/model_schedule_short.go @@ -0,0 +1,484 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" + "time" + "bytes" + "fmt" +) + +// checks if the ScheduleShort type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ScheduleShort{} + +// ScheduleShort struct for ScheduleShort +type ScheduleShort struct { + Id string `json:"id"` + UserId string `json:"userId"` + Name string `json:"name"` + CronExpression string `json:"cronExpression"` + Timezone string `json:"timezone"` + IsEnabled bool `json:"isEnabled"` + IsExclusive bool `json:"isExclusive"` + CreatedAt time.Time `json:"createdAt"` + ModifiedAt time.Time `json:"modifiedAt"` + NextRunAt *time.Time `json:"nextRunAt,omitempty"` + LastRunAt *time.Time `json:"lastRunAt,omitempty"` + // + Actions []ScheduleActionShort `json:"actions"` +} + +type _ScheduleShort ScheduleShort + +// NewScheduleShort instantiates a new ScheduleShort object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewScheduleShort(id string, userId string, name string, cronExpression string, timezone string, isEnabled bool, isExclusive bool, createdAt time.Time, modifiedAt time.Time, actions []ScheduleActionShort) *ScheduleShort { + this := ScheduleShort{} + this.Id = id + this.UserId = userId + this.Name = name + this.CronExpression = cronExpression + this.Timezone = timezone + this.IsEnabled = isEnabled + this.IsExclusive = isExclusive + this.CreatedAt = createdAt + this.ModifiedAt = modifiedAt + this.Actions = actions + return &this +} + +// NewScheduleShortWithDefaults instantiates a new ScheduleShort object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewScheduleShortWithDefaults() *ScheduleShort { + this := ScheduleShort{} + return &this +} + +// GetId returns the Id field value +func (o *ScheduleShort) GetId() string { + if o == nil { + var ret string + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *ScheduleShort) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *ScheduleShort) SetId(v string) { + o.Id = v +} + +// GetUserId returns the UserId field value +func (o *ScheduleShort) GetUserId() string { + if o == nil { + var ret string + return ret + } + + return o.UserId +} + +// GetUserIdOk returns a tuple with the UserId field value +// and a boolean to check if the value has been set. +func (o *ScheduleShort) GetUserIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.UserId, true +} + +// SetUserId sets field value +func (o *ScheduleShort) SetUserId(v string) { + o.UserId = v +} + +// GetName returns the Name field value +func (o *ScheduleShort) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *ScheduleShort) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *ScheduleShort) SetName(v string) { + o.Name = v +} + +// GetCronExpression returns the CronExpression field value +func (o *ScheduleShort) GetCronExpression() string { + if o == nil { + var ret string + return ret + } + + return o.CronExpression +} + +// GetCronExpressionOk returns a tuple with the CronExpression field value +// and a boolean to check if the value has been set. +func (o *ScheduleShort) GetCronExpressionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.CronExpression, true +} + +// SetCronExpression sets field value +func (o *ScheduleShort) SetCronExpression(v string) { + o.CronExpression = v +} + +// GetTimezone returns the Timezone field value +func (o *ScheduleShort) GetTimezone() string { + if o == nil { + var ret string + return ret + } + + return o.Timezone +} + +// GetTimezoneOk returns a tuple with the Timezone field value +// and a boolean to check if the value has been set. +func (o *ScheduleShort) GetTimezoneOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Timezone, true +} + +// SetTimezone sets field value +func (o *ScheduleShort) SetTimezone(v string) { + o.Timezone = v +} + +// GetIsEnabled returns the IsEnabled field value +func (o *ScheduleShort) GetIsEnabled() bool { + if o == nil { + var ret bool + return ret + } + + return o.IsEnabled +} + +// GetIsEnabledOk returns a tuple with the IsEnabled field value +// and a boolean to check if the value has been set. +func (o *ScheduleShort) GetIsEnabledOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.IsEnabled, true +} + +// SetIsEnabled sets field value +func (o *ScheduleShort) SetIsEnabled(v bool) { + o.IsEnabled = v +} + +// GetIsExclusive returns the IsExclusive field value +func (o *ScheduleShort) GetIsExclusive() bool { + if o == nil { + var ret bool + return ret + } + + return o.IsExclusive +} + +// GetIsExclusiveOk returns a tuple with the IsExclusive field value +// and a boolean to check if the value has been set. +func (o *ScheduleShort) GetIsExclusiveOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.IsExclusive, true +} + +// SetIsExclusive sets field value +func (o *ScheduleShort) SetIsExclusive(v bool) { + o.IsExclusive = v +} + +// GetCreatedAt returns the CreatedAt field value +func (o *ScheduleShort) GetCreatedAt() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value +// and a boolean to check if the value has been set. +func (o *ScheduleShort) GetCreatedAtOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.CreatedAt, true +} + +// SetCreatedAt sets field value +func (o *ScheduleShort) SetCreatedAt(v time.Time) { + o.CreatedAt = v +} + +// GetModifiedAt returns the ModifiedAt field value +func (o *ScheduleShort) GetModifiedAt() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.ModifiedAt +} + +// GetModifiedAtOk returns a tuple with the ModifiedAt field value +// and a boolean to check if the value has been set. +func (o *ScheduleShort) GetModifiedAtOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.ModifiedAt, true +} + +// SetModifiedAt sets field value +func (o *ScheduleShort) SetModifiedAt(v time.Time) { + o.ModifiedAt = v +} + +// GetNextRunAt returns the NextRunAt field value if set, zero value otherwise. +func (o *ScheduleShort) GetNextRunAt() time.Time { + if o == nil || IsNil(o.NextRunAt) { + var ret time.Time + return ret + } + return *o.NextRunAt +} + +// GetNextRunAtOk returns a tuple with the NextRunAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ScheduleShort) GetNextRunAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.NextRunAt) { + return nil, false + } + return o.NextRunAt, true +} + +// HasNextRunAt returns a boolean if a field has been set. +func (o *ScheduleShort) HasNextRunAt() bool { + if o != nil && !IsNil(o.NextRunAt) { + return true + } + + return false +} + +// SetNextRunAt gets a reference to the given time.Time and assigns it to the NextRunAt field. +func (o *ScheduleShort) SetNextRunAt(v time.Time) { + o.NextRunAt = &v +} + +// GetLastRunAt returns the LastRunAt field value if set, zero value otherwise. +func (o *ScheduleShort) GetLastRunAt() time.Time { + if o == nil || IsNil(o.LastRunAt) { + var ret time.Time + return ret + } + return *o.LastRunAt +} + +// GetLastRunAtOk returns a tuple with the LastRunAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ScheduleShort) GetLastRunAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.LastRunAt) { + return nil, false + } + return o.LastRunAt, true +} + +// HasLastRunAt returns a boolean if a field has been set. +func (o *ScheduleShort) HasLastRunAt() bool { + if o != nil && !IsNil(o.LastRunAt) { + return true + } + + return false +} + +// SetLastRunAt gets a reference to the given time.Time and assigns it to the LastRunAt field. +func (o *ScheduleShort) SetLastRunAt(v time.Time) { + o.LastRunAt = &v +} + +// GetActions returns the Actions field value +func (o *ScheduleShort) GetActions() []ScheduleActionShort { + if o == nil { + var ret []ScheduleActionShort + return ret + } + + return o.Actions +} + +// GetActionsOk returns a tuple with the Actions field value +// and a boolean to check if the value has been set. +func (o *ScheduleShort) GetActionsOk() ([]ScheduleActionShort, bool) { + if o == nil { + return nil, false + } + return o.Actions, true +} + +// SetActions sets field value +func (o *ScheduleShort) SetActions(v []ScheduleActionShort) { + o.Actions = v +} + +func (o ScheduleShort) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ScheduleShort) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["userId"] = o.UserId + toSerialize["name"] = o.Name + toSerialize["cronExpression"] = o.CronExpression + toSerialize["timezone"] = o.Timezone + toSerialize["isEnabled"] = o.IsEnabled + toSerialize["isExclusive"] = o.IsExclusive + toSerialize["createdAt"] = o.CreatedAt + toSerialize["modifiedAt"] = o.ModifiedAt + if !IsNil(o.NextRunAt) { + toSerialize["nextRunAt"] = o.NextRunAt + } + if !IsNil(o.LastRunAt) { + toSerialize["lastRunAt"] = o.LastRunAt + } + toSerialize["actions"] = o.Actions + return toSerialize, nil +} + +func (o *ScheduleShort) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "userId", + "name", + "cronExpression", + "timezone", + "isEnabled", + "isExclusive", + "createdAt", + "modifiedAt", + "actions", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varScheduleShort := _ScheduleShort{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varScheduleShort) + + if err != nil { + return err + } + + *o = ScheduleShort(varScheduleShort) + + return err +} + +type NullableScheduleShort struct { + value *ScheduleShort + isSet bool +} + +func (v NullableScheduleShort) Get() *ScheduleShort { + return v.value +} + +func (v *NullableScheduleShort) Set(val *ScheduleShort) { + v.value = val + v.isSet = true +} + +func (v NullableScheduleShort) IsSet() bool { + return v.isSet +} + +func (v *NullableScheduleShort) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableScheduleShort(val *ScheduleShort) *NullableScheduleShort { + return &NullableScheduleShort{value: val, isSet: true} +} + +func (v NullableScheduleShort) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableScheduleShort) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_schema_validation_error_data.go b/model_schema_validation_error_data.go new file mode 100644 index 0000000..0ebbbde --- /dev/null +++ b/model_schema_validation_error_data.go @@ -0,0 +1,159 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" + "bytes" + "fmt" +) + +// checks if the SchemaValidationErrorData type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SchemaValidationErrorData{} + +// SchemaValidationErrorData struct for SchemaValidationErrorData +type SchemaValidationErrorData struct { + // A list of invalid items in the received array of items. + InvalidItems []InvalidItem `json:"invalidItems"` +} + +type _SchemaValidationErrorData SchemaValidationErrorData + +// NewSchemaValidationErrorData instantiates a new SchemaValidationErrorData object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewSchemaValidationErrorData(invalidItems []InvalidItem) *SchemaValidationErrorData { + this := SchemaValidationErrorData{} + this.InvalidItems = invalidItems + return &this +} + +// NewSchemaValidationErrorDataWithDefaults instantiates a new SchemaValidationErrorData object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSchemaValidationErrorDataWithDefaults() *SchemaValidationErrorData { + this := SchemaValidationErrorData{} + return &this +} + +// GetInvalidItems returns the InvalidItems field value +func (o *SchemaValidationErrorData) GetInvalidItems() []InvalidItem { + if o == nil { + var ret []InvalidItem + return ret + } + + return o.InvalidItems +} + +// GetInvalidItemsOk returns a tuple with the InvalidItems field value +// and a boolean to check if the value has been set. +func (o *SchemaValidationErrorData) GetInvalidItemsOk() ([]InvalidItem, bool) { + if o == nil { + return nil, false + } + return o.InvalidItems, true +} + +// SetInvalidItems sets field value +func (o *SchemaValidationErrorData) SetInvalidItems(v []InvalidItem) { + o.InvalidItems = v +} + +func (o SchemaValidationErrorData) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SchemaValidationErrorData) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["invalidItems"] = o.InvalidItems + return toSerialize, nil +} + +func (o *SchemaValidationErrorData) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "invalidItems", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varSchemaValidationErrorData := _SchemaValidationErrorData{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varSchemaValidationErrorData) + + if err != nil { + return err + } + + *o = SchemaValidationErrorData(varSchemaValidationErrorData) + + return err +} + +type NullableSchemaValidationErrorData struct { + value *SchemaValidationErrorData + isSet bool +} + +func (v NullableSchemaValidationErrorData) Get() *SchemaValidationErrorData { + return v.value +} + +func (v *NullableSchemaValidationErrorData) Set(val *SchemaValidationErrorData) { + v.value = val + v.isSet = true +} + +func (v NullableSchemaValidationErrorData) IsSet() bool { + return v.isSet +} + +func (v *NullableSchemaValidationErrorData) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSchemaValidationErrorData(val *SchemaValidationErrorData) *NullableSchemaValidationErrorData { + return &NullableSchemaValidationErrorData{value: val, isSet: true} +} + +func (v NullableSchemaValidationErrorData) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSchemaValidationErrorData) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_source_code_file.go b/model_source_code_file.go new file mode 100644 index 0000000..3b54d86 --- /dev/null +++ b/model_source_code_file.go @@ -0,0 +1,230 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" + "bytes" + "fmt" +) + +// checks if the SourceCodeFile type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SourceCodeFile{} + +// SourceCodeFile struct for SourceCodeFile +type SourceCodeFile struct { + Format *SourceCodeFileFormat `json:"format,omitempty"` + Content *string `json:"content,omitempty"` + Name string `json:"name"` +} + +type _SourceCodeFile SourceCodeFile + +// NewSourceCodeFile instantiates a new SourceCodeFile object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewSourceCodeFile(name string) *SourceCodeFile { + this := SourceCodeFile{} + this.Name = name + return &this +} + +// NewSourceCodeFileWithDefaults instantiates a new SourceCodeFile object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSourceCodeFileWithDefaults() *SourceCodeFile { + this := SourceCodeFile{} + return &this +} + +// GetFormat returns the Format field value if set, zero value otherwise. +func (o *SourceCodeFile) GetFormat() SourceCodeFileFormat { + if o == nil || IsNil(o.Format) { + var ret SourceCodeFileFormat + return ret + } + return *o.Format +} + +// GetFormatOk returns a tuple with the Format field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SourceCodeFile) GetFormatOk() (*SourceCodeFileFormat, bool) { + if o == nil || IsNil(o.Format) { + return nil, false + } + return o.Format, true +} + +// HasFormat returns a boolean if a field has been set. +func (o *SourceCodeFile) HasFormat() bool { + if o != nil && !IsNil(o.Format) { + return true + } + + return false +} + +// SetFormat gets a reference to the given SourceCodeFileFormat and assigns it to the Format field. +func (o *SourceCodeFile) SetFormat(v SourceCodeFileFormat) { + o.Format = &v +} + +// GetContent returns the Content field value if set, zero value otherwise. +func (o *SourceCodeFile) GetContent() string { + if o == nil || IsNil(o.Content) { + var ret string + return ret + } + return *o.Content +} + +// GetContentOk returns a tuple with the Content field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SourceCodeFile) GetContentOk() (*string, bool) { + if o == nil || IsNil(o.Content) { + return nil, false + } + return o.Content, true +} + +// HasContent returns a boolean if a field has been set. +func (o *SourceCodeFile) HasContent() bool { + if o != nil && !IsNil(o.Content) { + return true + } + + return false +} + +// SetContent gets a reference to the given string and assigns it to the Content field. +func (o *SourceCodeFile) SetContent(v string) { + o.Content = &v +} + +// GetName returns the Name field value +func (o *SourceCodeFile) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *SourceCodeFile) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *SourceCodeFile) SetName(v string) { + o.Name = v +} + +func (o SourceCodeFile) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SourceCodeFile) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Format) { + toSerialize["format"] = o.Format + } + if !IsNil(o.Content) { + toSerialize["content"] = o.Content + } + toSerialize["name"] = o.Name + return toSerialize, nil +} + +func (o *SourceCodeFile) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varSourceCodeFile := _SourceCodeFile{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varSourceCodeFile) + + if err != nil { + return err + } + + *o = SourceCodeFile(varSourceCodeFile) + + return err +} + +type NullableSourceCodeFile struct { + value *SourceCodeFile + isSet bool +} + +func (v NullableSourceCodeFile) Get() *SourceCodeFile { + return v.value +} + +func (v *NullableSourceCodeFile) Set(val *SourceCodeFile) { + v.value = val + v.isSet = true +} + +func (v NullableSourceCodeFile) IsSet() bool { + return v.isSet +} + +func (v *NullableSourceCodeFile) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSourceCodeFile(val *SourceCodeFile) *NullableSourceCodeFile { + return &NullableSourceCodeFile{value: val, isSet: true} +} + +func (v NullableSourceCodeFile) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSourceCodeFile) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_source_code_file_format.go b/model_source_code_file_format.go new file mode 100644 index 0000000..01994ff --- /dev/null +++ b/model_source_code_file_format.go @@ -0,0 +1,111 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" + "fmt" +) + +// SourceCodeFileFormat the model 'SourceCodeFileFormat' +type SourceCodeFileFormat string + +// List of SourceCodeFileFormat +const ( + BASE64 SourceCodeFileFormat = "BASE64" + TEXT SourceCodeFileFormat = "TEXT" +) + +// All allowed values of SourceCodeFileFormat enum +var AllowedSourceCodeFileFormatEnumValues = []SourceCodeFileFormat{ + "BASE64", + "TEXT", +} + +func (v *SourceCodeFileFormat) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := SourceCodeFileFormat(value) + for _, existing := range AllowedSourceCodeFileFormatEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid SourceCodeFileFormat", value) +} + +// NewSourceCodeFileFormatFromValue returns a pointer to a valid SourceCodeFileFormat +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewSourceCodeFileFormatFromValue(v string) (*SourceCodeFileFormat, error) { + ev := SourceCodeFileFormat(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for SourceCodeFileFormat: valid values are %v", v, AllowedSourceCodeFileFormatEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v SourceCodeFileFormat) IsValid() bool { + for _, existing := range AllowedSourceCodeFileFormatEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to SourceCodeFileFormat value +func (v SourceCodeFileFormat) Ptr() *SourceCodeFileFormat { + return &v +} + +type NullableSourceCodeFileFormat struct { + value *SourceCodeFileFormat + isSet bool +} + +func (v NullableSourceCodeFileFormat) Get() *SourceCodeFileFormat { + return v.value +} + +func (v *NullableSourceCodeFileFormat) Set(val *SourceCodeFileFormat) { + v.value = val + v.isSet = true +} + +func (v NullableSourceCodeFileFormat) IsSet() bool { + return v.isSet +} + +func (v *NullableSourceCodeFileFormat) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSourceCodeFileFormat(val *SourceCodeFileFormat) *NullableSourceCodeFileFormat { + return &NullableSourceCodeFileFormat{value: val, isSet: true} +} + +func (v NullableSourceCodeFileFormat) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSourceCodeFileFormat) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + diff --git a/model_source_code_folder.go b/model_source_code_folder.go new file mode 100644 index 0000000..a971abc --- /dev/null +++ b/model_source_code_folder.go @@ -0,0 +1,188 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" + "bytes" + "fmt" +) + +// checks if the SourceCodeFolder type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SourceCodeFolder{} + +// SourceCodeFolder Represents a folder in the Actor's source code structure. Distinguished from SourceCodeFile by the presence of the `folder` property set to `true`. +type SourceCodeFolder struct { + // The folder path relative to the Actor's root directory. + Name string `json:"name"` + // Always `true` for folders. Used to distinguish folders from files. + Folder bool `json:"folder"` +} + +type _SourceCodeFolder SourceCodeFolder + +// NewSourceCodeFolder instantiates a new SourceCodeFolder object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewSourceCodeFolder(name string, folder bool) *SourceCodeFolder { + this := SourceCodeFolder{} + this.Name = name + this.Folder = folder + return &this +} + +// NewSourceCodeFolderWithDefaults instantiates a new SourceCodeFolder object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSourceCodeFolderWithDefaults() *SourceCodeFolder { + this := SourceCodeFolder{} + return &this +} + +// GetName returns the Name field value +func (o *SourceCodeFolder) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *SourceCodeFolder) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *SourceCodeFolder) SetName(v string) { + o.Name = v +} + +// GetFolder returns the Folder field value +func (o *SourceCodeFolder) GetFolder() bool { + if o == nil { + var ret bool + return ret + } + + return o.Folder +} + +// GetFolderOk returns a tuple with the Folder field value +// and a boolean to check if the value has been set. +func (o *SourceCodeFolder) GetFolderOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.Folder, true +} + +// SetFolder sets field value +func (o *SourceCodeFolder) SetFolder(v bool) { + o.Folder = v +} + +func (o SourceCodeFolder) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SourceCodeFolder) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + toSerialize["folder"] = o.Folder + return toSerialize, nil +} + +func (o *SourceCodeFolder) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "folder", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varSourceCodeFolder := _SourceCodeFolder{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varSourceCodeFolder) + + if err != nil { + return err + } + + *o = SourceCodeFolder(varSourceCodeFolder) + + return err +} + +type NullableSourceCodeFolder struct { + value *SourceCodeFolder + isSet bool +} + +func (v NullableSourceCodeFolder) Get() *SourceCodeFolder { + return v.value +} + +func (v *NullableSourceCodeFolder) Set(val *SourceCodeFolder) { + v.value = val + v.isSet = true +} + +func (v NullableSourceCodeFolder) IsSet() bool { + return v.isSet +} + +func (v *NullableSourceCodeFolder) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSourceCodeFolder(val *SourceCodeFolder) *NullableSourceCodeFolder { + return &NullableSourceCodeFolder{value: val, isSet: true} +} + +func (v NullableSourceCodeFolder) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSourceCodeFolder) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_storage_ownership.go b/model_storage_ownership.go new file mode 100644 index 0000000..5741691 --- /dev/null +++ b/model_storage_ownership.go @@ -0,0 +1,111 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" + "fmt" +) + +// StorageOwnership the model 'StorageOwnership' +type StorageOwnership string + +// List of StorageOwnership +const ( + OWNED_BY_ME StorageOwnership = "ownedByMe" + SHARED_WITH_ME StorageOwnership = "sharedWithMe" +) + +// All allowed values of StorageOwnership enum +var AllowedStorageOwnershipEnumValues = []StorageOwnership{ + "ownedByMe", + "sharedWithMe", +} + +func (v *StorageOwnership) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := StorageOwnership(value) + for _, existing := range AllowedStorageOwnershipEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid StorageOwnership", value) +} + +// NewStorageOwnershipFromValue returns a pointer to a valid StorageOwnership +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewStorageOwnershipFromValue(v string) (*StorageOwnership, error) { + ev := StorageOwnership(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for StorageOwnership: valid values are %v", v, AllowedStorageOwnershipEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v StorageOwnership) IsValid() bool { + for _, existing := range AllowedStorageOwnershipEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to StorageOwnership value +func (v StorageOwnership) Ptr() *StorageOwnership { + return &v +} + +type NullableStorageOwnership struct { + value *StorageOwnership + isSet bool +} + +func (v NullableStorageOwnership) Get() *StorageOwnership { + return v.value +} + +func (v *NullableStorageOwnership) Set(val *StorageOwnership) { + v.value = val + v.isSet = true +} + +func (v NullableStorageOwnership) IsSet() bool { + return v.isSet +} + +func (v *NullableStorageOwnership) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableStorageOwnership(val *StorageOwnership) *NullableStorageOwnership { + return &NullableStorageOwnership{value: val, isSet: true} +} + +func (v NullableStorageOwnership) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableStorageOwnership) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + diff --git a/model_store_list_actor.go b/model_store_list_actor.go new file mode 100644 index 0000000..5fdb1ee --- /dev/null +++ b/model_store_list_actor.go @@ -0,0 +1,802 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" + "bytes" + "fmt" +) + +// checks if the StoreListActor type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &StoreListActor{} + +// StoreListActor struct for StoreListActor +type StoreListActor struct { + Id string `json:"id"` + Title string `json:"title"` + Name string `json:"name"` + Username string `json:"username"` + UserFullName string `json:"userFullName"` + Description string `json:"description"` + Categories []string `json:"categories,omitempty"` + Notice *string `json:"notice,omitempty"` + PictureUrl NullableString `json:"pictureUrl,omitempty"` + UserPictureUrl NullableString `json:"userPictureUrl,omitempty"` + Url NullableString `json:"url,omitempty"` + Stats ActorStats `json:"stats"` + CurrentPricingInfo CurrentPricingInfo `json:"currentPricingInfo"` + // Whether the Actor is whitelisted for agentic payment processing. + IsWhiteListedForAgenticPayments NullableBool `json:"isWhiteListedForAgenticPayments,omitempty"` + ActorReviewCount *int32 `json:"actorReviewCount,omitempty"` + ActorReviewRating *float32 `json:"actorReviewRating,omitempty"` + BookmarkCount *int32 `json:"bookmarkCount,omitempty"` + Badge NullableString `json:"badge,omitempty"` + // A brief, LLM-generated readme summary + ReadmeSummary *string `json:"readmeSummary,omitempty"` +} + +type _StoreListActor StoreListActor + +// NewStoreListActor instantiates a new StoreListActor object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewStoreListActor(id string, title string, name string, username string, userFullName string, description string, stats ActorStats, currentPricingInfo CurrentPricingInfo) *StoreListActor { + this := StoreListActor{} + this.Id = id + this.Title = title + this.Name = name + this.Username = username + this.UserFullName = userFullName + this.Description = description + this.Stats = stats + this.CurrentPricingInfo = currentPricingInfo + return &this +} + +// NewStoreListActorWithDefaults instantiates a new StoreListActor object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewStoreListActorWithDefaults() *StoreListActor { + this := StoreListActor{} + return &this +} + +// GetId returns the Id field value +func (o *StoreListActor) GetId() string { + if o == nil { + var ret string + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *StoreListActor) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *StoreListActor) SetId(v string) { + o.Id = v +} + +// GetTitle returns the Title field value +func (o *StoreListActor) GetTitle() string { + if o == nil { + var ret string + return ret + } + + return o.Title +} + +// GetTitleOk returns a tuple with the Title field value +// and a boolean to check if the value has been set. +func (o *StoreListActor) GetTitleOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Title, true +} + +// SetTitle sets field value +func (o *StoreListActor) SetTitle(v string) { + o.Title = v +} + +// GetName returns the Name field value +func (o *StoreListActor) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *StoreListActor) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *StoreListActor) SetName(v string) { + o.Name = v +} + +// GetUsername returns the Username field value +func (o *StoreListActor) GetUsername() string { + if o == nil { + var ret string + return ret + } + + return o.Username +} + +// GetUsernameOk returns a tuple with the Username field value +// and a boolean to check if the value has been set. +func (o *StoreListActor) GetUsernameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Username, true +} + +// SetUsername sets field value +func (o *StoreListActor) SetUsername(v string) { + o.Username = v +} + +// GetUserFullName returns the UserFullName field value +func (o *StoreListActor) GetUserFullName() string { + if o == nil { + var ret string + return ret + } + + return o.UserFullName +} + +// GetUserFullNameOk returns a tuple with the UserFullName field value +// and a boolean to check if the value has been set. +func (o *StoreListActor) GetUserFullNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.UserFullName, true +} + +// SetUserFullName sets field value +func (o *StoreListActor) SetUserFullName(v string) { + o.UserFullName = v +} + +// GetDescription returns the Description field value +func (o *StoreListActor) GetDescription() string { + if o == nil { + var ret string + return ret + } + + return o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value +// and a boolean to check if the value has been set. +func (o *StoreListActor) GetDescriptionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Description, true +} + +// SetDescription sets field value +func (o *StoreListActor) SetDescription(v string) { + o.Description = v +} + +// GetCategories returns the Categories field value if set, zero value otherwise. +func (o *StoreListActor) GetCategories() []string { + if o == nil || IsNil(o.Categories) { + var ret []string + return ret + } + return o.Categories +} + +// GetCategoriesOk returns a tuple with the Categories field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *StoreListActor) GetCategoriesOk() ([]string, bool) { + if o == nil || IsNil(o.Categories) { + return nil, false + } + return o.Categories, true +} + +// HasCategories returns a boolean if a field has been set. +func (o *StoreListActor) HasCategories() bool { + if o != nil && !IsNil(o.Categories) { + return true + } + + return false +} + +// SetCategories gets a reference to the given []string and assigns it to the Categories field. +func (o *StoreListActor) SetCategories(v []string) { + o.Categories = v +} + +// GetNotice returns the Notice field value if set, zero value otherwise. +func (o *StoreListActor) GetNotice() string { + if o == nil || IsNil(o.Notice) { + var ret string + return ret + } + return *o.Notice +} + +// GetNoticeOk returns a tuple with the Notice field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *StoreListActor) GetNoticeOk() (*string, bool) { + if o == nil || IsNil(o.Notice) { + return nil, false + } + return o.Notice, true +} + +// HasNotice returns a boolean if a field has been set. +func (o *StoreListActor) HasNotice() bool { + if o != nil && !IsNil(o.Notice) { + return true + } + + return false +} + +// SetNotice gets a reference to the given string and assigns it to the Notice field. +func (o *StoreListActor) SetNotice(v string) { + o.Notice = &v +} + +// GetPictureUrl returns the PictureUrl field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *StoreListActor) GetPictureUrl() string { + if o == nil || IsNil(o.PictureUrl.Get()) { + var ret string + return ret + } + return *o.PictureUrl.Get() +} + +// GetPictureUrlOk returns a tuple with the PictureUrl field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *StoreListActor) GetPictureUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.PictureUrl.Get(), o.PictureUrl.IsSet() +} + +// HasPictureUrl returns a boolean if a field has been set. +func (o *StoreListActor) HasPictureUrl() bool { + if o != nil && o.PictureUrl.IsSet() { + return true + } + + return false +} + +// SetPictureUrl gets a reference to the given NullableString and assigns it to the PictureUrl field. +func (o *StoreListActor) SetPictureUrl(v string) { + o.PictureUrl.Set(&v) +} +// SetPictureUrlNil sets the value for PictureUrl to be an explicit nil +func (o *StoreListActor) SetPictureUrlNil() { + o.PictureUrl.Set(nil) +} + +// UnsetPictureUrl ensures that no value is present for PictureUrl, not even an explicit nil +func (o *StoreListActor) UnsetPictureUrl() { + o.PictureUrl.Unset() +} + +// GetUserPictureUrl returns the UserPictureUrl field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *StoreListActor) GetUserPictureUrl() string { + if o == nil || IsNil(o.UserPictureUrl.Get()) { + var ret string + return ret + } + return *o.UserPictureUrl.Get() +} + +// GetUserPictureUrlOk returns a tuple with the UserPictureUrl field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *StoreListActor) GetUserPictureUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.UserPictureUrl.Get(), o.UserPictureUrl.IsSet() +} + +// HasUserPictureUrl returns a boolean if a field has been set. +func (o *StoreListActor) HasUserPictureUrl() bool { + if o != nil && o.UserPictureUrl.IsSet() { + return true + } + + return false +} + +// SetUserPictureUrl gets a reference to the given NullableString and assigns it to the UserPictureUrl field. +func (o *StoreListActor) SetUserPictureUrl(v string) { + o.UserPictureUrl.Set(&v) +} +// SetUserPictureUrlNil sets the value for UserPictureUrl to be an explicit nil +func (o *StoreListActor) SetUserPictureUrlNil() { + o.UserPictureUrl.Set(nil) +} + +// UnsetUserPictureUrl ensures that no value is present for UserPictureUrl, not even an explicit nil +func (o *StoreListActor) UnsetUserPictureUrl() { + o.UserPictureUrl.Unset() +} + +// GetUrl returns the Url field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *StoreListActor) GetUrl() string { + if o == nil || IsNil(o.Url.Get()) { + var ret string + return ret + } + return *o.Url.Get() +} + +// GetUrlOk returns a tuple with the Url field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *StoreListActor) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Url.Get(), o.Url.IsSet() +} + +// HasUrl returns a boolean if a field has been set. +func (o *StoreListActor) HasUrl() bool { + if o != nil && o.Url.IsSet() { + return true + } + + return false +} + +// SetUrl gets a reference to the given NullableString and assigns it to the Url field. +func (o *StoreListActor) SetUrl(v string) { + o.Url.Set(&v) +} +// SetUrlNil sets the value for Url to be an explicit nil +func (o *StoreListActor) SetUrlNil() { + o.Url.Set(nil) +} + +// UnsetUrl ensures that no value is present for Url, not even an explicit nil +func (o *StoreListActor) UnsetUrl() { + o.Url.Unset() +} + +// GetStats returns the Stats field value +func (o *StoreListActor) GetStats() ActorStats { + if o == nil { + var ret ActorStats + return ret + } + + return o.Stats +} + +// GetStatsOk returns a tuple with the Stats field value +// and a boolean to check if the value has been set. +func (o *StoreListActor) GetStatsOk() (*ActorStats, bool) { + if o == nil { + return nil, false + } + return &o.Stats, true +} + +// SetStats sets field value +func (o *StoreListActor) SetStats(v ActorStats) { + o.Stats = v +} + +// GetCurrentPricingInfo returns the CurrentPricingInfo field value +func (o *StoreListActor) GetCurrentPricingInfo() CurrentPricingInfo { + if o == nil { + var ret CurrentPricingInfo + return ret + } + + return o.CurrentPricingInfo +} + +// GetCurrentPricingInfoOk returns a tuple with the CurrentPricingInfo field value +// and a boolean to check if the value has been set. +func (o *StoreListActor) GetCurrentPricingInfoOk() (*CurrentPricingInfo, bool) { + if o == nil { + return nil, false + } + return &o.CurrentPricingInfo, true +} + +// SetCurrentPricingInfo sets field value +func (o *StoreListActor) SetCurrentPricingInfo(v CurrentPricingInfo) { + o.CurrentPricingInfo = v +} + +// GetIsWhiteListedForAgenticPayments returns the IsWhiteListedForAgenticPayments field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *StoreListActor) GetIsWhiteListedForAgenticPayments() bool { + if o == nil || IsNil(o.IsWhiteListedForAgenticPayments.Get()) { + var ret bool + return ret + } + return *o.IsWhiteListedForAgenticPayments.Get() +} + +// GetIsWhiteListedForAgenticPaymentsOk returns a tuple with the IsWhiteListedForAgenticPayments field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *StoreListActor) GetIsWhiteListedForAgenticPaymentsOk() (*bool, bool) { + if o == nil { + return nil, false + } + return o.IsWhiteListedForAgenticPayments.Get(), o.IsWhiteListedForAgenticPayments.IsSet() +} + +// HasIsWhiteListedForAgenticPayments returns a boolean if a field has been set. +func (o *StoreListActor) HasIsWhiteListedForAgenticPayments() bool { + if o != nil && o.IsWhiteListedForAgenticPayments.IsSet() { + return true + } + + return false +} + +// SetIsWhiteListedForAgenticPayments gets a reference to the given NullableBool and assigns it to the IsWhiteListedForAgenticPayments field. +func (o *StoreListActor) SetIsWhiteListedForAgenticPayments(v bool) { + o.IsWhiteListedForAgenticPayments.Set(&v) +} +// SetIsWhiteListedForAgenticPaymentsNil sets the value for IsWhiteListedForAgenticPayments to be an explicit nil +func (o *StoreListActor) SetIsWhiteListedForAgenticPaymentsNil() { + o.IsWhiteListedForAgenticPayments.Set(nil) +} + +// UnsetIsWhiteListedForAgenticPayments ensures that no value is present for IsWhiteListedForAgenticPayments, not even an explicit nil +func (o *StoreListActor) UnsetIsWhiteListedForAgenticPayments() { + o.IsWhiteListedForAgenticPayments.Unset() +} + +// GetActorReviewCount returns the ActorReviewCount field value if set, zero value otherwise. +func (o *StoreListActor) GetActorReviewCount() int32 { + if o == nil || IsNil(o.ActorReviewCount) { + var ret int32 + return ret + } + return *o.ActorReviewCount +} + +// GetActorReviewCountOk returns a tuple with the ActorReviewCount field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *StoreListActor) GetActorReviewCountOk() (*int32, bool) { + if o == nil || IsNil(o.ActorReviewCount) { + return nil, false + } + return o.ActorReviewCount, true +} + +// HasActorReviewCount returns a boolean if a field has been set. +func (o *StoreListActor) HasActorReviewCount() bool { + if o != nil && !IsNil(o.ActorReviewCount) { + return true + } + + return false +} + +// SetActorReviewCount gets a reference to the given int32 and assigns it to the ActorReviewCount field. +func (o *StoreListActor) SetActorReviewCount(v int32) { + o.ActorReviewCount = &v +} + +// GetActorReviewRating returns the ActorReviewRating field value if set, zero value otherwise. +func (o *StoreListActor) GetActorReviewRating() float32 { + if o == nil || IsNil(o.ActorReviewRating) { + var ret float32 + return ret + } + return *o.ActorReviewRating +} + +// GetActorReviewRatingOk returns a tuple with the ActorReviewRating field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *StoreListActor) GetActorReviewRatingOk() (*float32, bool) { + if o == nil || IsNil(o.ActorReviewRating) { + return nil, false + } + return o.ActorReviewRating, true +} + +// HasActorReviewRating returns a boolean if a field has been set. +func (o *StoreListActor) HasActorReviewRating() bool { + if o != nil && !IsNil(o.ActorReviewRating) { + return true + } + + return false +} + +// SetActorReviewRating gets a reference to the given float32 and assigns it to the ActorReviewRating field. +func (o *StoreListActor) SetActorReviewRating(v float32) { + o.ActorReviewRating = &v +} + +// GetBookmarkCount returns the BookmarkCount field value if set, zero value otherwise. +func (o *StoreListActor) GetBookmarkCount() int32 { + if o == nil || IsNil(o.BookmarkCount) { + var ret int32 + return ret + } + return *o.BookmarkCount +} + +// GetBookmarkCountOk returns a tuple with the BookmarkCount field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *StoreListActor) GetBookmarkCountOk() (*int32, bool) { + if o == nil || IsNil(o.BookmarkCount) { + return nil, false + } + return o.BookmarkCount, true +} + +// HasBookmarkCount returns a boolean if a field has been set. +func (o *StoreListActor) HasBookmarkCount() bool { + if o != nil && !IsNil(o.BookmarkCount) { + return true + } + + return false +} + +// SetBookmarkCount gets a reference to the given int32 and assigns it to the BookmarkCount field. +func (o *StoreListActor) SetBookmarkCount(v int32) { + o.BookmarkCount = &v +} + +// GetBadge returns the Badge field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *StoreListActor) GetBadge() string { + if o == nil || IsNil(o.Badge.Get()) { + var ret string + return ret + } + return *o.Badge.Get() +} + +// GetBadgeOk returns a tuple with the Badge field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *StoreListActor) GetBadgeOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Badge.Get(), o.Badge.IsSet() +} + +// HasBadge returns a boolean if a field has been set. +func (o *StoreListActor) HasBadge() bool { + if o != nil && o.Badge.IsSet() { + return true + } + + return false +} + +// SetBadge gets a reference to the given NullableString and assigns it to the Badge field. +func (o *StoreListActor) SetBadge(v string) { + o.Badge.Set(&v) +} +// SetBadgeNil sets the value for Badge to be an explicit nil +func (o *StoreListActor) SetBadgeNil() { + o.Badge.Set(nil) +} + +// UnsetBadge ensures that no value is present for Badge, not even an explicit nil +func (o *StoreListActor) UnsetBadge() { + o.Badge.Unset() +} + +// GetReadmeSummary returns the ReadmeSummary field value if set, zero value otherwise. +func (o *StoreListActor) GetReadmeSummary() string { + if o == nil || IsNil(o.ReadmeSummary) { + var ret string + return ret + } + return *o.ReadmeSummary +} + +// GetReadmeSummaryOk returns a tuple with the ReadmeSummary field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *StoreListActor) GetReadmeSummaryOk() (*string, bool) { + if o == nil || IsNil(o.ReadmeSummary) { + return nil, false + } + return o.ReadmeSummary, true +} + +// HasReadmeSummary returns a boolean if a field has been set. +func (o *StoreListActor) HasReadmeSummary() bool { + if o != nil && !IsNil(o.ReadmeSummary) { + return true + } + + return false +} + +// SetReadmeSummary gets a reference to the given string and assigns it to the ReadmeSummary field. +func (o *StoreListActor) SetReadmeSummary(v string) { + o.ReadmeSummary = &v +} + +func (o StoreListActor) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o StoreListActor) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["title"] = o.Title + toSerialize["name"] = o.Name + toSerialize["username"] = o.Username + toSerialize["userFullName"] = o.UserFullName + toSerialize["description"] = o.Description + if !IsNil(o.Categories) { + toSerialize["categories"] = o.Categories + } + if !IsNil(o.Notice) { + toSerialize["notice"] = o.Notice + } + if o.PictureUrl.IsSet() { + toSerialize["pictureUrl"] = o.PictureUrl.Get() + } + if o.UserPictureUrl.IsSet() { + toSerialize["userPictureUrl"] = o.UserPictureUrl.Get() + } + if o.Url.IsSet() { + toSerialize["url"] = o.Url.Get() + } + toSerialize["stats"] = o.Stats + toSerialize["currentPricingInfo"] = o.CurrentPricingInfo + if o.IsWhiteListedForAgenticPayments.IsSet() { + toSerialize["isWhiteListedForAgenticPayments"] = o.IsWhiteListedForAgenticPayments.Get() + } + if !IsNil(o.ActorReviewCount) { + toSerialize["actorReviewCount"] = o.ActorReviewCount + } + if !IsNil(o.ActorReviewRating) { + toSerialize["actorReviewRating"] = o.ActorReviewRating + } + if !IsNil(o.BookmarkCount) { + toSerialize["bookmarkCount"] = o.BookmarkCount + } + if o.Badge.IsSet() { + toSerialize["badge"] = o.Badge.Get() + } + if !IsNil(o.ReadmeSummary) { + toSerialize["readmeSummary"] = o.ReadmeSummary + } + return toSerialize, nil +} + +func (o *StoreListActor) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "title", + "name", + "username", + "userFullName", + "description", + "stats", + "currentPricingInfo", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varStoreListActor := _StoreListActor{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varStoreListActor) + + if err != nil { + return err + } + + *o = StoreListActor(varStoreListActor) + + return err +} + +type NullableStoreListActor struct { + value *StoreListActor + isSet bool +} + +func (v NullableStoreListActor) Get() *StoreListActor { + return v.value +} + +func (v *NullableStoreListActor) Set(val *StoreListActor) { + v.value = val + v.isSet = true +} + +func (v NullableStoreListActor) IsSet() bool { + return v.isSet +} + +func (v *NullableStoreListActor) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableStoreListActor(val *StoreListActor) *NullableStoreListActor { + return &NullableStoreListActor{value: val, isSet: true} +} + +func (v NullableStoreListActor) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableStoreListActor) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_tagged_build_info.go b/model_tagged_build_info.go new file mode 100644 index 0000000..c8ee6b1 --- /dev/null +++ b/model_tagged_build_info.go @@ -0,0 +1,249 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" + "time" +) + +// checks if the TaggedBuildInfo type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &TaggedBuildInfo{} + +// TaggedBuildInfo Information about a tagged build. +type TaggedBuildInfo struct { + // The ID of the build associated with this tag. + BuildId *string `json:"buildId,omitempty"` + // The build number/version string. + BuildNumber *string `json:"buildNumber,omitempty" validate:"regexp=^([0-9]|[1-9][0-9])\\\\.([0-9]|[1-9][0-9])(\\\\.[1-9][0-9]{0,4})$"` + // The build number encoded as a single integer. + BuildNumberInt *int32 `json:"buildNumberInt,omitempty"` + // The timestamp when the build finished. + FinishedAt NullableTime `json:"finishedAt,omitempty"` +} + +// NewTaggedBuildInfo instantiates a new TaggedBuildInfo object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewTaggedBuildInfo() *TaggedBuildInfo { + this := TaggedBuildInfo{} + return &this +} + +// NewTaggedBuildInfoWithDefaults instantiates a new TaggedBuildInfo object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewTaggedBuildInfoWithDefaults() *TaggedBuildInfo { + this := TaggedBuildInfo{} + return &this +} + +// GetBuildId returns the BuildId field value if set, zero value otherwise. +func (o *TaggedBuildInfo) GetBuildId() string { + if o == nil || IsNil(o.BuildId) { + var ret string + return ret + } + return *o.BuildId +} + +// GetBuildIdOk returns a tuple with the BuildId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TaggedBuildInfo) GetBuildIdOk() (*string, bool) { + if o == nil || IsNil(o.BuildId) { + return nil, false + } + return o.BuildId, true +} + +// HasBuildId returns a boolean if a field has been set. +func (o *TaggedBuildInfo) HasBuildId() bool { + if o != nil && !IsNil(o.BuildId) { + return true + } + + return false +} + +// SetBuildId gets a reference to the given string and assigns it to the BuildId field. +func (o *TaggedBuildInfo) SetBuildId(v string) { + o.BuildId = &v +} + +// GetBuildNumber returns the BuildNumber field value if set, zero value otherwise. +func (o *TaggedBuildInfo) GetBuildNumber() string { + if o == nil || IsNil(o.BuildNumber) { + var ret string + return ret + } + return *o.BuildNumber +} + +// GetBuildNumberOk returns a tuple with the BuildNumber field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TaggedBuildInfo) GetBuildNumberOk() (*string, bool) { + if o == nil || IsNil(o.BuildNumber) { + return nil, false + } + return o.BuildNumber, true +} + +// HasBuildNumber returns a boolean if a field has been set. +func (o *TaggedBuildInfo) HasBuildNumber() bool { + if o != nil && !IsNil(o.BuildNumber) { + return true + } + + return false +} + +// SetBuildNumber gets a reference to the given string and assigns it to the BuildNumber field. +func (o *TaggedBuildInfo) SetBuildNumber(v string) { + o.BuildNumber = &v +} + +// GetBuildNumberInt returns the BuildNumberInt field value if set, zero value otherwise. +func (o *TaggedBuildInfo) GetBuildNumberInt() int32 { + if o == nil || IsNil(o.BuildNumberInt) { + var ret int32 + return ret + } + return *o.BuildNumberInt +} + +// GetBuildNumberIntOk returns a tuple with the BuildNumberInt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TaggedBuildInfo) GetBuildNumberIntOk() (*int32, bool) { + if o == nil || IsNil(o.BuildNumberInt) { + return nil, false + } + return o.BuildNumberInt, true +} + +// HasBuildNumberInt returns a boolean if a field has been set. +func (o *TaggedBuildInfo) HasBuildNumberInt() bool { + if o != nil && !IsNil(o.BuildNumberInt) { + return true + } + + return false +} + +// SetBuildNumberInt gets a reference to the given int32 and assigns it to the BuildNumberInt field. +func (o *TaggedBuildInfo) SetBuildNumberInt(v int32) { + o.BuildNumberInt = &v +} + +// GetFinishedAt returns the FinishedAt field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *TaggedBuildInfo) GetFinishedAt() time.Time { + if o == nil || IsNil(o.FinishedAt.Get()) { + var ret time.Time + return ret + } + return *o.FinishedAt.Get() +} + +// GetFinishedAtOk returns a tuple with the FinishedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *TaggedBuildInfo) GetFinishedAtOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.FinishedAt.Get(), o.FinishedAt.IsSet() +} + +// HasFinishedAt returns a boolean if a field has been set. +func (o *TaggedBuildInfo) HasFinishedAt() bool { + if o != nil && o.FinishedAt.IsSet() { + return true + } + + return false +} + +// SetFinishedAt gets a reference to the given NullableTime and assigns it to the FinishedAt field. +func (o *TaggedBuildInfo) SetFinishedAt(v time.Time) { + o.FinishedAt.Set(&v) +} +// SetFinishedAtNil sets the value for FinishedAt to be an explicit nil +func (o *TaggedBuildInfo) SetFinishedAtNil() { + o.FinishedAt.Set(nil) +} + +// UnsetFinishedAt ensures that no value is present for FinishedAt, not even an explicit nil +func (o *TaggedBuildInfo) UnsetFinishedAt() { + o.FinishedAt.Unset() +} + +func (o TaggedBuildInfo) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o TaggedBuildInfo) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.BuildId) { + toSerialize["buildId"] = o.BuildId + } + if !IsNil(o.BuildNumber) { + toSerialize["buildNumber"] = o.BuildNumber + } + if !IsNil(o.BuildNumberInt) { + toSerialize["buildNumberInt"] = o.BuildNumberInt + } + if o.FinishedAt.IsSet() { + toSerialize["finishedAt"] = o.FinishedAt.Get() + } + return toSerialize, nil +} + +type NullableTaggedBuildInfo struct { + value *TaggedBuildInfo + isSet bool +} + +func (v NullableTaggedBuildInfo) Get() *TaggedBuildInfo { + return v.value +} + +func (v *NullableTaggedBuildInfo) Set(val *TaggedBuildInfo) { + v.value = val + v.isSet = true +} + +func (v NullableTaggedBuildInfo) IsSet() bool { + return v.isSet +} + +func (v *NullableTaggedBuildInfo) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTaggedBuildInfo(val *TaggedBuildInfo) *NullableTaggedBuildInfo { + return &NullableTaggedBuildInfo{value: val, isSet: true} +} + +func (v NullableTaggedBuildInfo) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTaggedBuildInfo) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_tagged_builds_value.go b/model_tagged_builds_value.go new file mode 100644 index 0000000..a2cfa5a --- /dev/null +++ b/model_tagged_builds_value.go @@ -0,0 +1,94 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" + "fmt" +) + + +// TaggedBuildsValue struct for TaggedBuildsValue +type TaggedBuildsValue struct { + TaggedBuildInfo *TaggedBuildInfo +} + +// Unmarshal JSON data into any of the pointers in the struct +func (dst *TaggedBuildsValue) UnmarshalJSON(data []byte) error { + var err error + // this object is nullable so check if the payload is null or empty string + if string(data) == "" || string(data) == "{}" { + return nil + } + + // try to unmarshal JSON data into TaggedBuildInfo + err = json.Unmarshal(data, &dst.TaggedBuildInfo); + if err == nil { + jsonTaggedBuildInfo, _ := json.Marshal(dst.TaggedBuildInfo) + if string(jsonTaggedBuildInfo) == "{}" { // empty struct + dst.TaggedBuildInfo = nil + } else { + return nil // data stored in dst.TaggedBuildInfo, return on the first match + } + } else { + dst.TaggedBuildInfo = nil + } + + return fmt.Errorf("data failed to match schemas in anyOf(TaggedBuildsValue)") +} + +// Marshal data from the first non-nil pointers in the struct to JSON +func (src TaggedBuildsValue) MarshalJSON() ([]byte, error) { + if src.TaggedBuildInfo != nil { + return json.Marshal(&src.TaggedBuildInfo) + } + + return nil, nil // no data in anyOf schemas +} + + +type NullableTaggedBuildsValue struct { + value *TaggedBuildsValue + isSet bool +} + +func (v NullableTaggedBuildsValue) Get() *TaggedBuildsValue { + return v.value +} + +func (v *NullableTaggedBuildsValue) Set(val *TaggedBuildsValue) { + v.value = val + v.isSet = true +} + +func (v NullableTaggedBuildsValue) IsSet() bool { + return v.isSet +} + +func (v *NullableTaggedBuildsValue) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTaggedBuildsValue(val *TaggedBuildsValue) *NullableTaggedBuildsValue { + return &NullableTaggedBuildsValue{value: val, isSet: true} +} + +func (v NullableTaggedBuildsValue) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTaggedBuildsValue) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_task.go b/model_task.go new file mode 100644 index 0000000..df66e88 --- /dev/null +++ b/model_task.go @@ -0,0 +1,659 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" + "time" + "bytes" + "fmt" +) + +// checks if the Task type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Task{} + +// Task struct for Task +type Task struct { + Id string `json:"id"` + UserId string `json:"userId"` + ActId string `json:"actId"` + Name string `json:"name"` + Username NullableString `json:"username,omitempty"` + CreatedAt time.Time `json:"createdAt"` + ModifiedAt time.Time `json:"modifiedAt"` + RemovedAt NullableTime `json:"removedAt,omitempty"` + Stats NullableTaskStats `json:"stats,omitempty"` + Options NullableTaskOptions `json:"options,omitempty"` + // The input configuration for the Actor task. This is a user-defined JSON object that will be passed to the Actor when the task is run. + Input map[string]interface{} `json:"input,omitempty"` + Title NullableString `json:"title,omitempty"` + ActorStandby NullableActorStandby `json:"actorStandby,omitempty"` + StandbyUrl NullableString `json:"standbyUrl,omitempty"` +} + +type _Task Task + +// NewTask instantiates a new Task object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewTask(id string, userId string, actId string, name string, createdAt time.Time, modifiedAt time.Time) *Task { + this := Task{} + this.Id = id + this.UserId = userId + this.ActId = actId + this.Name = name + this.CreatedAt = createdAt + this.ModifiedAt = modifiedAt + return &this +} + +// NewTaskWithDefaults instantiates a new Task object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewTaskWithDefaults() *Task { + this := Task{} + return &this +} + +// GetId returns the Id field value +func (o *Task) GetId() string { + if o == nil { + var ret string + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *Task) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *Task) SetId(v string) { + o.Id = v +} + +// GetUserId returns the UserId field value +func (o *Task) GetUserId() string { + if o == nil { + var ret string + return ret + } + + return o.UserId +} + +// GetUserIdOk returns a tuple with the UserId field value +// and a boolean to check if the value has been set. +func (o *Task) GetUserIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.UserId, true +} + +// SetUserId sets field value +func (o *Task) SetUserId(v string) { + o.UserId = v +} + +// GetActId returns the ActId field value +func (o *Task) GetActId() string { + if o == nil { + var ret string + return ret + } + + return o.ActId +} + +// GetActIdOk returns a tuple with the ActId field value +// and a boolean to check if the value has been set. +func (o *Task) GetActIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ActId, true +} + +// SetActId sets field value +func (o *Task) SetActId(v string) { + o.ActId = v +} + +// GetName returns the Name field value +func (o *Task) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *Task) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *Task) SetName(v string) { + o.Name = v +} + +// GetUsername returns the Username field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Task) GetUsername() string { + if o == nil || IsNil(o.Username.Get()) { + var ret string + return ret + } + return *o.Username.Get() +} + +// GetUsernameOk returns a tuple with the Username field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Task) GetUsernameOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Username.Get(), o.Username.IsSet() +} + +// HasUsername returns a boolean if a field has been set. +func (o *Task) HasUsername() bool { + if o != nil && o.Username.IsSet() { + return true + } + + return false +} + +// SetUsername gets a reference to the given NullableString and assigns it to the Username field. +func (o *Task) SetUsername(v string) { + o.Username.Set(&v) +} +// SetUsernameNil sets the value for Username to be an explicit nil +func (o *Task) SetUsernameNil() { + o.Username.Set(nil) +} + +// UnsetUsername ensures that no value is present for Username, not even an explicit nil +func (o *Task) UnsetUsername() { + o.Username.Unset() +} + +// GetCreatedAt returns the CreatedAt field value +func (o *Task) GetCreatedAt() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value +// and a boolean to check if the value has been set. +func (o *Task) GetCreatedAtOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.CreatedAt, true +} + +// SetCreatedAt sets field value +func (o *Task) SetCreatedAt(v time.Time) { + o.CreatedAt = v +} + +// GetModifiedAt returns the ModifiedAt field value +func (o *Task) GetModifiedAt() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.ModifiedAt +} + +// GetModifiedAtOk returns a tuple with the ModifiedAt field value +// and a boolean to check if the value has been set. +func (o *Task) GetModifiedAtOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.ModifiedAt, true +} + +// SetModifiedAt sets field value +func (o *Task) SetModifiedAt(v time.Time) { + o.ModifiedAt = v +} + +// GetRemovedAt returns the RemovedAt field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Task) GetRemovedAt() time.Time { + if o == nil || IsNil(o.RemovedAt.Get()) { + var ret time.Time + return ret + } + return *o.RemovedAt.Get() +} + +// GetRemovedAtOk returns a tuple with the RemovedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Task) GetRemovedAtOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.RemovedAt.Get(), o.RemovedAt.IsSet() +} + +// HasRemovedAt returns a boolean if a field has been set. +func (o *Task) HasRemovedAt() bool { + if o != nil && o.RemovedAt.IsSet() { + return true + } + + return false +} + +// SetRemovedAt gets a reference to the given NullableTime and assigns it to the RemovedAt field. +func (o *Task) SetRemovedAt(v time.Time) { + o.RemovedAt.Set(&v) +} +// SetRemovedAtNil sets the value for RemovedAt to be an explicit nil +func (o *Task) SetRemovedAtNil() { + o.RemovedAt.Set(nil) +} + +// UnsetRemovedAt ensures that no value is present for RemovedAt, not even an explicit nil +func (o *Task) UnsetRemovedAt() { + o.RemovedAt.Unset() +} + +// GetStats returns the Stats field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Task) GetStats() TaskStats { + if o == nil || IsNil(o.Stats.Get()) { + var ret TaskStats + return ret + } + return *o.Stats.Get() +} + +// GetStatsOk returns a tuple with the Stats field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Task) GetStatsOk() (*TaskStats, bool) { + if o == nil { + return nil, false + } + return o.Stats.Get(), o.Stats.IsSet() +} + +// HasStats returns a boolean if a field has been set. +func (o *Task) HasStats() bool { + if o != nil && o.Stats.IsSet() { + return true + } + + return false +} + +// SetStats gets a reference to the given NullableTaskStats and assigns it to the Stats field. +func (o *Task) SetStats(v TaskStats) { + o.Stats.Set(&v) +} +// SetStatsNil sets the value for Stats to be an explicit nil +func (o *Task) SetStatsNil() { + o.Stats.Set(nil) +} + +// UnsetStats ensures that no value is present for Stats, not even an explicit nil +func (o *Task) UnsetStats() { + o.Stats.Unset() +} + +// GetOptions returns the Options field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Task) GetOptions() TaskOptions { + if o == nil || IsNil(o.Options.Get()) { + var ret TaskOptions + return ret + } + return *o.Options.Get() +} + +// GetOptionsOk returns a tuple with the Options field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Task) GetOptionsOk() (*TaskOptions, bool) { + if o == nil { + return nil, false + } + return o.Options.Get(), o.Options.IsSet() +} + +// HasOptions returns a boolean if a field has been set. +func (o *Task) HasOptions() bool { + if o != nil && o.Options.IsSet() { + return true + } + + return false +} + +// SetOptions gets a reference to the given NullableTaskOptions and assigns it to the Options field. +func (o *Task) SetOptions(v TaskOptions) { + o.Options.Set(&v) +} +// SetOptionsNil sets the value for Options to be an explicit nil +func (o *Task) SetOptionsNil() { + o.Options.Set(nil) +} + +// UnsetOptions ensures that no value is present for Options, not even an explicit nil +func (o *Task) UnsetOptions() { + o.Options.Unset() +} + +// GetInput returns the Input field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Task) GetInput() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + return o.Input +} + +// GetInputOk returns a tuple with the Input field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Task) GetInputOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Input) { + return map[string]interface{}{}, false + } + return o.Input, true +} + +// HasInput returns a boolean if a field has been set. +func (o *Task) HasInput() bool { + if o != nil && !IsNil(o.Input) { + return true + } + + return false +} + +// SetInput gets a reference to the given map[string]interface{} and assigns it to the Input field. +func (o *Task) SetInput(v map[string]interface{}) { + o.Input = v +} + +// GetTitle returns the Title field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Task) GetTitle() string { + if o == nil || IsNil(o.Title.Get()) { + var ret string + return ret + } + return *o.Title.Get() +} + +// GetTitleOk returns a tuple with the Title field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Task) GetTitleOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Title.Get(), o.Title.IsSet() +} + +// HasTitle returns a boolean if a field has been set. +func (o *Task) HasTitle() bool { + if o != nil && o.Title.IsSet() { + return true + } + + return false +} + +// SetTitle gets a reference to the given NullableString and assigns it to the Title field. +func (o *Task) SetTitle(v string) { + o.Title.Set(&v) +} +// SetTitleNil sets the value for Title to be an explicit nil +func (o *Task) SetTitleNil() { + o.Title.Set(nil) +} + +// UnsetTitle ensures that no value is present for Title, not even an explicit nil +func (o *Task) UnsetTitle() { + o.Title.Unset() +} + +// GetActorStandby returns the ActorStandby field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Task) GetActorStandby() ActorStandby { + if o == nil || IsNil(o.ActorStandby.Get()) { + var ret ActorStandby + return ret + } + return *o.ActorStandby.Get() +} + +// GetActorStandbyOk returns a tuple with the ActorStandby field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Task) GetActorStandbyOk() (*ActorStandby, bool) { + if o == nil { + return nil, false + } + return o.ActorStandby.Get(), o.ActorStandby.IsSet() +} + +// HasActorStandby returns a boolean if a field has been set. +func (o *Task) HasActorStandby() bool { + if o != nil && o.ActorStandby.IsSet() { + return true + } + + return false +} + +// SetActorStandby gets a reference to the given NullableActorStandby and assigns it to the ActorStandby field. +func (o *Task) SetActorStandby(v ActorStandby) { + o.ActorStandby.Set(&v) +} +// SetActorStandbyNil sets the value for ActorStandby to be an explicit nil +func (o *Task) SetActorStandbyNil() { + o.ActorStandby.Set(nil) +} + +// UnsetActorStandby ensures that no value is present for ActorStandby, not even an explicit nil +func (o *Task) UnsetActorStandby() { + o.ActorStandby.Unset() +} + +// GetStandbyUrl returns the StandbyUrl field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Task) GetStandbyUrl() string { + if o == nil || IsNil(o.StandbyUrl.Get()) { + var ret string + return ret + } + return *o.StandbyUrl.Get() +} + +// GetStandbyUrlOk returns a tuple with the StandbyUrl field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Task) GetStandbyUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.StandbyUrl.Get(), o.StandbyUrl.IsSet() +} + +// HasStandbyUrl returns a boolean if a field has been set. +func (o *Task) HasStandbyUrl() bool { + if o != nil && o.StandbyUrl.IsSet() { + return true + } + + return false +} + +// SetStandbyUrl gets a reference to the given NullableString and assigns it to the StandbyUrl field. +func (o *Task) SetStandbyUrl(v string) { + o.StandbyUrl.Set(&v) +} +// SetStandbyUrlNil sets the value for StandbyUrl to be an explicit nil +func (o *Task) SetStandbyUrlNil() { + o.StandbyUrl.Set(nil) +} + +// UnsetStandbyUrl ensures that no value is present for StandbyUrl, not even an explicit nil +func (o *Task) UnsetStandbyUrl() { + o.StandbyUrl.Unset() +} + +func (o Task) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Task) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["userId"] = o.UserId + toSerialize["actId"] = o.ActId + toSerialize["name"] = o.Name + if o.Username.IsSet() { + toSerialize["username"] = o.Username.Get() + } + toSerialize["createdAt"] = o.CreatedAt + toSerialize["modifiedAt"] = o.ModifiedAt + if o.RemovedAt.IsSet() { + toSerialize["removedAt"] = o.RemovedAt.Get() + } + if o.Stats.IsSet() { + toSerialize["stats"] = o.Stats.Get() + } + if o.Options.IsSet() { + toSerialize["options"] = o.Options.Get() + } + if o.Input != nil { + toSerialize["input"] = o.Input + } + if o.Title.IsSet() { + toSerialize["title"] = o.Title.Get() + } + if o.ActorStandby.IsSet() { + toSerialize["actorStandby"] = o.ActorStandby.Get() + } + if o.StandbyUrl.IsSet() { + toSerialize["standbyUrl"] = o.StandbyUrl.Get() + } + return toSerialize, nil +} + +func (o *Task) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "userId", + "actId", + "name", + "createdAt", + "modifiedAt", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varTask := _Task{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varTask) + + if err != nil { + return err + } + + *o = Task(varTask) + + return err +} + +type NullableTask struct { + value *Task + isSet bool +} + +func (v NullableTask) Get() *Task { + return v.value +} + +func (v *NullableTask) Set(val *Task) { + v.value = val + v.isSet = true +} + +func (v NullableTask) IsSet() bool { + return v.isSet +} + +func (v *NullableTask) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTask(val *Task) *NullableTask { + return &NullableTask{value: val, isSet: true} +} + +func (v NullableTask) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTask) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_task_options.go b/model_task_options.go new file mode 100644 index 0000000..661a0de --- /dev/null +++ b/model_task_options.go @@ -0,0 +1,366 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" +) + +// checks if the TaskOptions type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &TaskOptions{} + +// TaskOptions struct for TaskOptions +type TaskOptions struct { + Build NullableString `json:"build,omitempty"` + TimeoutSecs NullableInt32 `json:"timeoutSecs,omitempty"` + MemoryMbytes NullableInt32 `json:"memoryMbytes,omitempty"` + MaxItems NullableInt32 `json:"maxItems,omitempty"` + MaxTotalChargeUsd NullableFloat32 `json:"maxTotalChargeUsd,omitempty"` + RestartOnError NullableBool `json:"restartOnError,omitempty"` +} + +// NewTaskOptions instantiates a new TaskOptions object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewTaskOptions() *TaskOptions { + this := TaskOptions{} + return &this +} + +// NewTaskOptionsWithDefaults instantiates a new TaskOptions object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewTaskOptionsWithDefaults() *TaskOptions { + this := TaskOptions{} + return &this +} + +// GetBuild returns the Build field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *TaskOptions) GetBuild() string { + if o == nil || IsNil(o.Build.Get()) { + var ret string + return ret + } + return *o.Build.Get() +} + +// GetBuildOk returns a tuple with the Build field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *TaskOptions) GetBuildOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Build.Get(), o.Build.IsSet() +} + +// HasBuild returns a boolean if a field has been set. +func (o *TaskOptions) HasBuild() bool { + if o != nil && o.Build.IsSet() { + return true + } + + return false +} + +// SetBuild gets a reference to the given NullableString and assigns it to the Build field. +func (o *TaskOptions) SetBuild(v string) { + o.Build.Set(&v) +} +// SetBuildNil sets the value for Build to be an explicit nil +func (o *TaskOptions) SetBuildNil() { + o.Build.Set(nil) +} + +// UnsetBuild ensures that no value is present for Build, not even an explicit nil +func (o *TaskOptions) UnsetBuild() { + o.Build.Unset() +} + +// GetTimeoutSecs returns the TimeoutSecs field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *TaskOptions) GetTimeoutSecs() int32 { + if o == nil || IsNil(o.TimeoutSecs.Get()) { + var ret int32 + return ret + } + return *o.TimeoutSecs.Get() +} + +// GetTimeoutSecsOk returns a tuple with the TimeoutSecs field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *TaskOptions) GetTimeoutSecsOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.TimeoutSecs.Get(), o.TimeoutSecs.IsSet() +} + +// HasTimeoutSecs returns a boolean if a field has been set. +func (o *TaskOptions) HasTimeoutSecs() bool { + if o != nil && o.TimeoutSecs.IsSet() { + return true + } + + return false +} + +// SetTimeoutSecs gets a reference to the given NullableInt32 and assigns it to the TimeoutSecs field. +func (o *TaskOptions) SetTimeoutSecs(v int32) { + o.TimeoutSecs.Set(&v) +} +// SetTimeoutSecsNil sets the value for TimeoutSecs to be an explicit nil +func (o *TaskOptions) SetTimeoutSecsNil() { + o.TimeoutSecs.Set(nil) +} + +// UnsetTimeoutSecs ensures that no value is present for TimeoutSecs, not even an explicit nil +func (o *TaskOptions) UnsetTimeoutSecs() { + o.TimeoutSecs.Unset() +} + +// GetMemoryMbytes returns the MemoryMbytes field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *TaskOptions) GetMemoryMbytes() int32 { + if o == nil || IsNil(o.MemoryMbytes.Get()) { + var ret int32 + return ret + } + return *o.MemoryMbytes.Get() +} + +// GetMemoryMbytesOk returns a tuple with the MemoryMbytes field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *TaskOptions) GetMemoryMbytesOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.MemoryMbytes.Get(), o.MemoryMbytes.IsSet() +} + +// HasMemoryMbytes returns a boolean if a field has been set. +func (o *TaskOptions) HasMemoryMbytes() bool { + if o != nil && o.MemoryMbytes.IsSet() { + return true + } + + return false +} + +// SetMemoryMbytes gets a reference to the given NullableInt32 and assigns it to the MemoryMbytes field. +func (o *TaskOptions) SetMemoryMbytes(v int32) { + o.MemoryMbytes.Set(&v) +} +// SetMemoryMbytesNil sets the value for MemoryMbytes to be an explicit nil +func (o *TaskOptions) SetMemoryMbytesNil() { + o.MemoryMbytes.Set(nil) +} + +// UnsetMemoryMbytes ensures that no value is present for MemoryMbytes, not even an explicit nil +func (o *TaskOptions) UnsetMemoryMbytes() { + o.MemoryMbytes.Unset() +} + +// GetMaxItems returns the MaxItems field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *TaskOptions) GetMaxItems() int32 { + if o == nil || IsNil(o.MaxItems.Get()) { + var ret int32 + return ret + } + return *o.MaxItems.Get() +} + +// GetMaxItemsOk returns a tuple with the MaxItems field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *TaskOptions) GetMaxItemsOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.MaxItems.Get(), o.MaxItems.IsSet() +} + +// HasMaxItems returns a boolean if a field has been set. +func (o *TaskOptions) HasMaxItems() bool { + if o != nil && o.MaxItems.IsSet() { + return true + } + + return false +} + +// SetMaxItems gets a reference to the given NullableInt32 and assigns it to the MaxItems field. +func (o *TaskOptions) SetMaxItems(v int32) { + o.MaxItems.Set(&v) +} +// SetMaxItemsNil sets the value for MaxItems to be an explicit nil +func (o *TaskOptions) SetMaxItemsNil() { + o.MaxItems.Set(nil) +} + +// UnsetMaxItems ensures that no value is present for MaxItems, not even an explicit nil +func (o *TaskOptions) UnsetMaxItems() { + o.MaxItems.Unset() +} + +// GetMaxTotalChargeUsd returns the MaxTotalChargeUsd field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *TaskOptions) GetMaxTotalChargeUsd() float32 { + if o == nil || IsNil(o.MaxTotalChargeUsd.Get()) { + var ret float32 + return ret + } + return *o.MaxTotalChargeUsd.Get() +} + +// GetMaxTotalChargeUsdOk returns a tuple with the MaxTotalChargeUsd field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *TaskOptions) GetMaxTotalChargeUsdOk() (*float32, bool) { + if o == nil { + return nil, false + } + return o.MaxTotalChargeUsd.Get(), o.MaxTotalChargeUsd.IsSet() +} + +// HasMaxTotalChargeUsd returns a boolean if a field has been set. +func (o *TaskOptions) HasMaxTotalChargeUsd() bool { + if o != nil && o.MaxTotalChargeUsd.IsSet() { + return true + } + + return false +} + +// SetMaxTotalChargeUsd gets a reference to the given NullableFloat32 and assigns it to the MaxTotalChargeUsd field. +func (o *TaskOptions) SetMaxTotalChargeUsd(v float32) { + o.MaxTotalChargeUsd.Set(&v) +} +// SetMaxTotalChargeUsdNil sets the value for MaxTotalChargeUsd to be an explicit nil +func (o *TaskOptions) SetMaxTotalChargeUsdNil() { + o.MaxTotalChargeUsd.Set(nil) +} + +// UnsetMaxTotalChargeUsd ensures that no value is present for MaxTotalChargeUsd, not even an explicit nil +func (o *TaskOptions) UnsetMaxTotalChargeUsd() { + o.MaxTotalChargeUsd.Unset() +} + +// GetRestartOnError returns the RestartOnError field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *TaskOptions) GetRestartOnError() bool { + if o == nil || IsNil(o.RestartOnError.Get()) { + var ret bool + return ret + } + return *o.RestartOnError.Get() +} + +// GetRestartOnErrorOk returns a tuple with the RestartOnError field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *TaskOptions) GetRestartOnErrorOk() (*bool, bool) { + if o == nil { + return nil, false + } + return o.RestartOnError.Get(), o.RestartOnError.IsSet() +} + +// HasRestartOnError returns a boolean if a field has been set. +func (o *TaskOptions) HasRestartOnError() bool { + if o != nil && o.RestartOnError.IsSet() { + return true + } + + return false +} + +// SetRestartOnError gets a reference to the given NullableBool and assigns it to the RestartOnError field. +func (o *TaskOptions) SetRestartOnError(v bool) { + o.RestartOnError.Set(&v) +} +// SetRestartOnErrorNil sets the value for RestartOnError to be an explicit nil +func (o *TaskOptions) SetRestartOnErrorNil() { + o.RestartOnError.Set(nil) +} + +// UnsetRestartOnError ensures that no value is present for RestartOnError, not even an explicit nil +func (o *TaskOptions) UnsetRestartOnError() { + o.RestartOnError.Unset() +} + +func (o TaskOptions) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o TaskOptions) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.Build.IsSet() { + toSerialize["build"] = o.Build.Get() + } + if o.TimeoutSecs.IsSet() { + toSerialize["timeoutSecs"] = o.TimeoutSecs.Get() + } + if o.MemoryMbytes.IsSet() { + toSerialize["memoryMbytes"] = o.MemoryMbytes.Get() + } + if o.MaxItems.IsSet() { + toSerialize["maxItems"] = o.MaxItems.Get() + } + if o.MaxTotalChargeUsd.IsSet() { + toSerialize["maxTotalChargeUsd"] = o.MaxTotalChargeUsd.Get() + } + if o.RestartOnError.IsSet() { + toSerialize["restartOnError"] = o.RestartOnError.Get() + } + return toSerialize, nil +} + +type NullableTaskOptions struct { + value *TaskOptions + isSet bool +} + +func (v NullableTaskOptions) Get() *TaskOptions { + return v.value +} + +func (v *NullableTaskOptions) Set(val *TaskOptions) { + v.value = val + v.isSet = true +} + +func (v NullableTaskOptions) IsSet() bool { + return v.isSet +} + +func (v *NullableTaskOptions) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTaskOptions(val *TaskOptions) *NullableTaskOptions { + return &NullableTaskOptions{value: val, isSet: true} +} + +func (v NullableTaskOptions) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTaskOptions) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_task_response.go b/model_task_response.go new file mode 100644 index 0000000..6d1845c --- /dev/null +++ b/model_task_response.go @@ -0,0 +1,158 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" + "bytes" + "fmt" +) + +// checks if the TaskResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &TaskResponse{} + +// TaskResponse Response containing Actor task data. +type TaskResponse struct { + Data Task `json:"data"` +} + +type _TaskResponse TaskResponse + +// NewTaskResponse instantiates a new TaskResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewTaskResponse(data Task) *TaskResponse { + this := TaskResponse{} + this.Data = data + return &this +} + +// NewTaskResponseWithDefaults instantiates a new TaskResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewTaskResponseWithDefaults() *TaskResponse { + this := TaskResponse{} + return &this +} + +// GetData returns the Data field value +func (o *TaskResponse) GetData() Task { + if o == nil { + var ret Task + return ret + } + + return o.Data +} + +// GetDataOk returns a tuple with the Data field value +// and a boolean to check if the value has been set. +func (o *TaskResponse) GetDataOk() (*Task, bool) { + if o == nil { + return nil, false + } + return &o.Data, true +} + +// SetData sets field value +func (o *TaskResponse) SetData(v Task) { + o.Data = v +} + +func (o TaskResponse) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o TaskResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["data"] = o.Data + return toSerialize, nil +} + +func (o *TaskResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "data", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varTaskResponse := _TaskResponse{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varTaskResponse) + + if err != nil { + return err + } + + *o = TaskResponse(varTaskResponse) + + return err +} + +type NullableTaskResponse struct { + value *TaskResponse + isSet bool +} + +func (v NullableTaskResponse) Get() *TaskResponse { + return v.value +} + +func (v *NullableTaskResponse) Set(val *TaskResponse) { + v.value = val + v.isSet = true +} + +func (v NullableTaskResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableTaskResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTaskResponse(val *TaskResponse) *NullableTaskResponse { + return &NullableTaskResponse{value: val, isSet: true} +} + +func (v NullableTaskResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTaskResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_task_short.go b/model_task_short.go new file mode 100644 index 0000000..881c9e2 --- /dev/null +++ b/model_task_short.go @@ -0,0 +1,483 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" + "time" + "bytes" + "fmt" +) + +// checks if the TaskShort type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &TaskShort{} + +// TaskShort struct for TaskShort +type TaskShort struct { + Id string `json:"id"` + UserId string `json:"userId"` + ActId string `json:"actId"` + ActName NullableString `json:"actName,omitempty"` + Name string `json:"name"` + Username NullableString `json:"username,omitempty"` + ActUsername NullableString `json:"actUsername,omitempty"` + CreatedAt time.Time `json:"createdAt"` + ModifiedAt time.Time `json:"modifiedAt"` + Stats NullableTaskStats `json:"stats,omitempty"` +} + +type _TaskShort TaskShort + +// NewTaskShort instantiates a new TaskShort object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewTaskShort(id string, userId string, actId string, name string, createdAt time.Time, modifiedAt time.Time) *TaskShort { + this := TaskShort{} + this.Id = id + this.UserId = userId + this.ActId = actId + this.Name = name + this.CreatedAt = createdAt + this.ModifiedAt = modifiedAt + return &this +} + +// NewTaskShortWithDefaults instantiates a new TaskShort object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewTaskShortWithDefaults() *TaskShort { + this := TaskShort{} + return &this +} + +// GetId returns the Id field value +func (o *TaskShort) GetId() string { + if o == nil { + var ret string + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *TaskShort) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *TaskShort) SetId(v string) { + o.Id = v +} + +// GetUserId returns the UserId field value +func (o *TaskShort) GetUserId() string { + if o == nil { + var ret string + return ret + } + + return o.UserId +} + +// GetUserIdOk returns a tuple with the UserId field value +// and a boolean to check if the value has been set. +func (o *TaskShort) GetUserIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.UserId, true +} + +// SetUserId sets field value +func (o *TaskShort) SetUserId(v string) { + o.UserId = v +} + +// GetActId returns the ActId field value +func (o *TaskShort) GetActId() string { + if o == nil { + var ret string + return ret + } + + return o.ActId +} + +// GetActIdOk returns a tuple with the ActId field value +// and a boolean to check if the value has been set. +func (o *TaskShort) GetActIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ActId, true +} + +// SetActId sets field value +func (o *TaskShort) SetActId(v string) { + o.ActId = v +} + +// GetActName returns the ActName field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *TaskShort) GetActName() string { + if o == nil || IsNil(o.ActName.Get()) { + var ret string + return ret + } + return *o.ActName.Get() +} + +// GetActNameOk returns a tuple with the ActName field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *TaskShort) GetActNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.ActName.Get(), o.ActName.IsSet() +} + +// HasActName returns a boolean if a field has been set. +func (o *TaskShort) HasActName() bool { + if o != nil && o.ActName.IsSet() { + return true + } + + return false +} + +// SetActName gets a reference to the given NullableString and assigns it to the ActName field. +func (o *TaskShort) SetActName(v string) { + o.ActName.Set(&v) +} +// SetActNameNil sets the value for ActName to be an explicit nil +func (o *TaskShort) SetActNameNil() { + o.ActName.Set(nil) +} + +// UnsetActName ensures that no value is present for ActName, not even an explicit nil +func (o *TaskShort) UnsetActName() { + o.ActName.Unset() +} + +// GetName returns the Name field value +func (o *TaskShort) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *TaskShort) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *TaskShort) SetName(v string) { + o.Name = v +} + +// GetUsername returns the Username field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *TaskShort) GetUsername() string { + if o == nil || IsNil(o.Username.Get()) { + var ret string + return ret + } + return *o.Username.Get() +} + +// GetUsernameOk returns a tuple with the Username field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *TaskShort) GetUsernameOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Username.Get(), o.Username.IsSet() +} + +// HasUsername returns a boolean if a field has been set. +func (o *TaskShort) HasUsername() bool { + if o != nil && o.Username.IsSet() { + return true + } + + return false +} + +// SetUsername gets a reference to the given NullableString and assigns it to the Username field. +func (o *TaskShort) SetUsername(v string) { + o.Username.Set(&v) +} +// SetUsernameNil sets the value for Username to be an explicit nil +func (o *TaskShort) SetUsernameNil() { + o.Username.Set(nil) +} + +// UnsetUsername ensures that no value is present for Username, not even an explicit nil +func (o *TaskShort) UnsetUsername() { + o.Username.Unset() +} + +// GetActUsername returns the ActUsername field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *TaskShort) GetActUsername() string { + if o == nil || IsNil(o.ActUsername.Get()) { + var ret string + return ret + } + return *o.ActUsername.Get() +} + +// GetActUsernameOk returns a tuple with the ActUsername field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *TaskShort) GetActUsernameOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.ActUsername.Get(), o.ActUsername.IsSet() +} + +// HasActUsername returns a boolean if a field has been set. +func (o *TaskShort) HasActUsername() bool { + if o != nil && o.ActUsername.IsSet() { + return true + } + + return false +} + +// SetActUsername gets a reference to the given NullableString and assigns it to the ActUsername field. +func (o *TaskShort) SetActUsername(v string) { + o.ActUsername.Set(&v) +} +// SetActUsernameNil sets the value for ActUsername to be an explicit nil +func (o *TaskShort) SetActUsernameNil() { + o.ActUsername.Set(nil) +} + +// UnsetActUsername ensures that no value is present for ActUsername, not even an explicit nil +func (o *TaskShort) UnsetActUsername() { + o.ActUsername.Unset() +} + +// GetCreatedAt returns the CreatedAt field value +func (o *TaskShort) GetCreatedAt() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value +// and a boolean to check if the value has been set. +func (o *TaskShort) GetCreatedAtOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.CreatedAt, true +} + +// SetCreatedAt sets field value +func (o *TaskShort) SetCreatedAt(v time.Time) { + o.CreatedAt = v +} + +// GetModifiedAt returns the ModifiedAt field value +func (o *TaskShort) GetModifiedAt() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.ModifiedAt +} + +// GetModifiedAtOk returns a tuple with the ModifiedAt field value +// and a boolean to check if the value has been set. +func (o *TaskShort) GetModifiedAtOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.ModifiedAt, true +} + +// SetModifiedAt sets field value +func (o *TaskShort) SetModifiedAt(v time.Time) { + o.ModifiedAt = v +} + +// GetStats returns the Stats field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *TaskShort) GetStats() TaskStats { + if o == nil || IsNil(o.Stats.Get()) { + var ret TaskStats + return ret + } + return *o.Stats.Get() +} + +// GetStatsOk returns a tuple with the Stats field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *TaskShort) GetStatsOk() (*TaskStats, bool) { + if o == nil { + return nil, false + } + return o.Stats.Get(), o.Stats.IsSet() +} + +// HasStats returns a boolean if a field has been set. +func (o *TaskShort) HasStats() bool { + if o != nil && o.Stats.IsSet() { + return true + } + + return false +} + +// SetStats gets a reference to the given NullableTaskStats and assigns it to the Stats field. +func (o *TaskShort) SetStats(v TaskStats) { + o.Stats.Set(&v) +} +// SetStatsNil sets the value for Stats to be an explicit nil +func (o *TaskShort) SetStatsNil() { + o.Stats.Set(nil) +} + +// UnsetStats ensures that no value is present for Stats, not even an explicit nil +func (o *TaskShort) UnsetStats() { + o.Stats.Unset() +} + +func (o TaskShort) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o TaskShort) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["userId"] = o.UserId + toSerialize["actId"] = o.ActId + if o.ActName.IsSet() { + toSerialize["actName"] = o.ActName.Get() + } + toSerialize["name"] = o.Name + if o.Username.IsSet() { + toSerialize["username"] = o.Username.Get() + } + if o.ActUsername.IsSet() { + toSerialize["actUsername"] = o.ActUsername.Get() + } + toSerialize["createdAt"] = o.CreatedAt + toSerialize["modifiedAt"] = o.ModifiedAt + if o.Stats.IsSet() { + toSerialize["stats"] = o.Stats.Get() + } + return toSerialize, nil +} + +func (o *TaskShort) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "userId", + "actId", + "name", + "createdAt", + "modifiedAt", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varTaskShort := _TaskShort{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varTaskShort) + + if err != nil { + return err + } + + *o = TaskShort(varTaskShort) + + return err +} + +type NullableTaskShort struct { + value *TaskShort + isSet bool +} + +func (v NullableTaskShort) Get() *TaskShort { + return v.value +} + +func (v *NullableTaskShort) Set(val *TaskShort) { + v.value = val + v.isSet = true +} + +func (v NullableTaskShort) IsSet() bool { + return v.isSet +} + +func (v *NullableTaskShort) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTaskShort(val *TaskShort) *NullableTaskShort { + return &NullableTaskShort{value: val, isSet: true} +} + +func (v NullableTaskShort) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTaskShort) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_task_stats.go b/model_task_stats.go new file mode 100644 index 0000000..81693a7 --- /dev/null +++ b/model_task_stats.go @@ -0,0 +1,126 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" +) + +// checks if the TaskStats type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &TaskStats{} + +// TaskStats struct for TaskStats +type TaskStats struct { + TotalRuns *int32 `json:"totalRuns,omitempty"` +} + +// NewTaskStats instantiates a new TaskStats object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewTaskStats() *TaskStats { + this := TaskStats{} + return &this +} + +// NewTaskStatsWithDefaults instantiates a new TaskStats object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewTaskStatsWithDefaults() *TaskStats { + this := TaskStats{} + return &this +} + +// GetTotalRuns returns the TotalRuns field value if set, zero value otherwise. +func (o *TaskStats) GetTotalRuns() int32 { + if o == nil || IsNil(o.TotalRuns) { + var ret int32 + return ret + } + return *o.TotalRuns +} + +// GetTotalRunsOk returns a tuple with the TotalRuns field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TaskStats) GetTotalRunsOk() (*int32, bool) { + if o == nil || IsNil(o.TotalRuns) { + return nil, false + } + return o.TotalRuns, true +} + +// HasTotalRuns returns a boolean if a field has been set. +func (o *TaskStats) HasTotalRuns() bool { + if o != nil && !IsNil(o.TotalRuns) { + return true + } + + return false +} + +// SetTotalRuns gets a reference to the given int32 and assigns it to the TotalRuns field. +func (o *TaskStats) SetTotalRuns(v int32) { + o.TotalRuns = &v +} + +func (o TaskStats) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o TaskStats) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.TotalRuns) { + toSerialize["totalRuns"] = o.TotalRuns + } + return toSerialize, nil +} + +type NullableTaskStats struct { + value *TaskStats + isSet bool +} + +func (v NullableTaskStats) Get() *TaskStats { + return v.value +} + +func (v *NullableTaskStats) Set(val *TaskStats) { + v.value = val + v.isSet = true +} + +func (v NullableTaskStats) IsSet() bool { + return v.isSet +} + +func (v *NullableTaskStats) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTaskStats(val *TaskStats) *NullableTaskStats { + return &NullableTaskStats{value: val, isSet: true} +} + +func (v NullableTaskStats) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTaskStats) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_test_webhook_response.go b/model_test_webhook_response.go new file mode 100644 index 0000000..55bb35b --- /dev/null +++ b/model_test_webhook_response.go @@ -0,0 +1,158 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" + "bytes" + "fmt" +) + +// checks if the TestWebhookResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &TestWebhookResponse{} + +// TestWebhookResponse struct for TestWebhookResponse +type TestWebhookResponse struct { + Data WebhookDispatch `json:"data"` +} + +type _TestWebhookResponse TestWebhookResponse + +// NewTestWebhookResponse instantiates a new TestWebhookResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewTestWebhookResponse(data WebhookDispatch) *TestWebhookResponse { + this := TestWebhookResponse{} + this.Data = data + return &this +} + +// NewTestWebhookResponseWithDefaults instantiates a new TestWebhookResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewTestWebhookResponseWithDefaults() *TestWebhookResponse { + this := TestWebhookResponse{} + return &this +} + +// GetData returns the Data field value +func (o *TestWebhookResponse) GetData() WebhookDispatch { + if o == nil { + var ret WebhookDispatch + return ret + } + + return o.Data +} + +// GetDataOk returns a tuple with the Data field value +// and a boolean to check if the value has been set. +func (o *TestWebhookResponse) GetDataOk() (*WebhookDispatch, bool) { + if o == nil { + return nil, false + } + return &o.Data, true +} + +// SetData sets field value +func (o *TestWebhookResponse) SetData(v WebhookDispatch) { + o.Data = v +} + +func (o TestWebhookResponse) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o TestWebhookResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["data"] = o.Data + return toSerialize, nil +} + +func (o *TestWebhookResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "data", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varTestWebhookResponse := _TestWebhookResponse{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varTestWebhookResponse) + + if err != nil { + return err + } + + *o = TestWebhookResponse(varTestWebhookResponse) + + return err +} + +type NullableTestWebhookResponse struct { + value *TestWebhookResponse + isSet bool +} + +func (v NullableTestWebhookResponse) Get() *TestWebhookResponse { + return v.value +} + +func (v *NullableTestWebhookResponse) Set(val *TestWebhookResponse) { + v.value = val + v.isSet = true +} + +func (v NullableTestWebhookResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableTestWebhookResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTestWebhookResponse(val *TestWebhookResponse) *NullableTestWebhookResponse { + return &NullableTestWebhookResponse{value: val, isSet: true} +} + +func (v NullableTestWebhookResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTestWebhookResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_tiered_pricing_per_dataset_item_entry.go b/model_tiered_pricing_per_dataset_item_entry.go new file mode 100644 index 0000000..636f800 --- /dev/null +++ b/model_tiered_pricing_per_dataset_item_entry.go @@ -0,0 +1,159 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" + "bytes" + "fmt" +) + +// checks if the TieredPricingPerDatasetItemEntry type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &TieredPricingPerDatasetItemEntry{} + +// TieredPricingPerDatasetItemEntry A single tier's price-per-dataset-item entry. +type TieredPricingPerDatasetItemEntry struct { + // Price per unit in USD for this tier. + TieredPricePerUnitUsd float32 `json:"tieredPricePerUnitUsd"` +} + +type _TieredPricingPerDatasetItemEntry TieredPricingPerDatasetItemEntry + +// NewTieredPricingPerDatasetItemEntry instantiates a new TieredPricingPerDatasetItemEntry object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewTieredPricingPerDatasetItemEntry(tieredPricePerUnitUsd float32) *TieredPricingPerDatasetItemEntry { + this := TieredPricingPerDatasetItemEntry{} + this.TieredPricePerUnitUsd = tieredPricePerUnitUsd + return &this +} + +// NewTieredPricingPerDatasetItemEntryWithDefaults instantiates a new TieredPricingPerDatasetItemEntry object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewTieredPricingPerDatasetItemEntryWithDefaults() *TieredPricingPerDatasetItemEntry { + this := TieredPricingPerDatasetItemEntry{} + return &this +} + +// GetTieredPricePerUnitUsd returns the TieredPricePerUnitUsd field value +func (o *TieredPricingPerDatasetItemEntry) GetTieredPricePerUnitUsd() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.TieredPricePerUnitUsd +} + +// GetTieredPricePerUnitUsdOk returns a tuple with the TieredPricePerUnitUsd field value +// and a boolean to check if the value has been set. +func (o *TieredPricingPerDatasetItemEntry) GetTieredPricePerUnitUsdOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.TieredPricePerUnitUsd, true +} + +// SetTieredPricePerUnitUsd sets field value +func (o *TieredPricingPerDatasetItemEntry) SetTieredPricePerUnitUsd(v float32) { + o.TieredPricePerUnitUsd = v +} + +func (o TieredPricingPerDatasetItemEntry) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o TieredPricingPerDatasetItemEntry) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["tieredPricePerUnitUsd"] = o.TieredPricePerUnitUsd + return toSerialize, nil +} + +func (o *TieredPricingPerDatasetItemEntry) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "tieredPricePerUnitUsd", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varTieredPricingPerDatasetItemEntry := _TieredPricingPerDatasetItemEntry{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varTieredPricingPerDatasetItemEntry) + + if err != nil { + return err + } + + *o = TieredPricingPerDatasetItemEntry(varTieredPricingPerDatasetItemEntry) + + return err +} + +type NullableTieredPricingPerDatasetItemEntry struct { + value *TieredPricingPerDatasetItemEntry + isSet bool +} + +func (v NullableTieredPricingPerDatasetItemEntry) Get() *TieredPricingPerDatasetItemEntry { + return v.value +} + +func (v *NullableTieredPricingPerDatasetItemEntry) Set(val *TieredPricingPerDatasetItemEntry) { + v.value = val + v.isSet = true +} + +func (v NullableTieredPricingPerDatasetItemEntry) IsSet() bool { + return v.isSet +} + +func (v *NullableTieredPricingPerDatasetItemEntry) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTieredPricingPerDatasetItemEntry(val *TieredPricingPerDatasetItemEntry) *NullableTieredPricingPerDatasetItemEntry { + return &NullableTieredPricingPerDatasetItemEntry{value: val, isSet: true} +} + +func (v NullableTieredPricingPerDatasetItemEntry) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTieredPricingPerDatasetItemEntry) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_tiered_pricing_per_event_entry.go b/model_tiered_pricing_per_event_entry.go new file mode 100644 index 0000000..5b81cb7 --- /dev/null +++ b/model_tiered_pricing_per_event_entry.go @@ -0,0 +1,159 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" + "bytes" + "fmt" +) + +// checks if the TieredPricingPerEventEntry type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &TieredPricingPerEventEntry{} + +// TieredPricingPerEventEntry A single tier's price-per-event entry. +type TieredPricingPerEventEntry struct { + // Price per event in USD for this tier. + TieredEventPriceUsd float32 `json:"tieredEventPriceUsd"` +} + +type _TieredPricingPerEventEntry TieredPricingPerEventEntry + +// NewTieredPricingPerEventEntry instantiates a new TieredPricingPerEventEntry object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewTieredPricingPerEventEntry(tieredEventPriceUsd float32) *TieredPricingPerEventEntry { + this := TieredPricingPerEventEntry{} + this.TieredEventPriceUsd = tieredEventPriceUsd + return &this +} + +// NewTieredPricingPerEventEntryWithDefaults instantiates a new TieredPricingPerEventEntry object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewTieredPricingPerEventEntryWithDefaults() *TieredPricingPerEventEntry { + this := TieredPricingPerEventEntry{} + return &this +} + +// GetTieredEventPriceUsd returns the TieredEventPriceUsd field value +func (o *TieredPricingPerEventEntry) GetTieredEventPriceUsd() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.TieredEventPriceUsd +} + +// GetTieredEventPriceUsdOk returns a tuple with the TieredEventPriceUsd field value +// and a boolean to check if the value has been set. +func (o *TieredPricingPerEventEntry) GetTieredEventPriceUsdOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.TieredEventPriceUsd, true +} + +// SetTieredEventPriceUsd sets field value +func (o *TieredPricingPerEventEntry) SetTieredEventPriceUsd(v float32) { + o.TieredEventPriceUsd = v +} + +func (o TieredPricingPerEventEntry) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o TieredPricingPerEventEntry) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["tieredEventPriceUsd"] = o.TieredEventPriceUsd + return toSerialize, nil +} + +func (o *TieredPricingPerEventEntry) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "tieredEventPriceUsd", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varTieredPricingPerEventEntry := _TieredPricingPerEventEntry{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varTieredPricingPerEventEntry) + + if err != nil { + return err + } + + *o = TieredPricingPerEventEntry(varTieredPricingPerEventEntry) + + return err +} + +type NullableTieredPricingPerEventEntry struct { + value *TieredPricingPerEventEntry + isSet bool +} + +func (v NullableTieredPricingPerEventEntry) Get() *TieredPricingPerEventEntry { + return v.value +} + +func (v *NullableTieredPricingPerEventEntry) Set(val *TieredPricingPerEventEntry) { + v.value = val + v.isSet = true +} + +func (v NullableTieredPricingPerEventEntry) IsSet() bool { + return v.isSet +} + +func (v *NullableTieredPricingPerEventEntry) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTieredPricingPerEventEntry(val *TieredPricingPerEventEntry) *NullableTieredPricingPerEventEntry { + return &NullableTieredPricingPerEventEntry{value: val, isSet: true} +} + +func (v NullableTieredPricingPerEventEntry) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTieredPricingPerEventEntry) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_unlock_requests_response.go b/model_unlock_requests_response.go new file mode 100644 index 0000000..b1585d9 --- /dev/null +++ b/model_unlock_requests_response.go @@ -0,0 +1,158 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" + "bytes" + "fmt" +) + +// checks if the UnlockRequestsResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UnlockRequestsResponse{} + +// UnlockRequestsResponse Response containing the result of unlocking requests. +type UnlockRequestsResponse struct { + Data UnlockRequestsResult `json:"data"` +} + +type _UnlockRequestsResponse UnlockRequestsResponse + +// NewUnlockRequestsResponse instantiates a new UnlockRequestsResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUnlockRequestsResponse(data UnlockRequestsResult) *UnlockRequestsResponse { + this := UnlockRequestsResponse{} + this.Data = data + return &this +} + +// NewUnlockRequestsResponseWithDefaults instantiates a new UnlockRequestsResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUnlockRequestsResponseWithDefaults() *UnlockRequestsResponse { + this := UnlockRequestsResponse{} + return &this +} + +// GetData returns the Data field value +func (o *UnlockRequestsResponse) GetData() UnlockRequestsResult { + if o == nil { + var ret UnlockRequestsResult + return ret + } + + return o.Data +} + +// GetDataOk returns a tuple with the Data field value +// and a boolean to check if the value has been set. +func (o *UnlockRequestsResponse) GetDataOk() (*UnlockRequestsResult, bool) { + if o == nil { + return nil, false + } + return &o.Data, true +} + +// SetData sets field value +func (o *UnlockRequestsResponse) SetData(v UnlockRequestsResult) { + o.Data = v +} + +func (o UnlockRequestsResponse) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o UnlockRequestsResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["data"] = o.Data + return toSerialize, nil +} + +func (o *UnlockRequestsResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "data", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varUnlockRequestsResponse := _UnlockRequestsResponse{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varUnlockRequestsResponse) + + if err != nil { + return err + } + + *o = UnlockRequestsResponse(varUnlockRequestsResponse) + + return err +} + +type NullableUnlockRequestsResponse struct { + value *UnlockRequestsResponse + isSet bool +} + +func (v NullableUnlockRequestsResponse) Get() *UnlockRequestsResponse { + return v.value +} + +func (v *NullableUnlockRequestsResponse) Set(val *UnlockRequestsResponse) { + v.value = val + v.isSet = true +} + +func (v NullableUnlockRequestsResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableUnlockRequestsResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUnlockRequestsResponse(val *UnlockRequestsResponse) *NullableUnlockRequestsResponse { + return &NullableUnlockRequestsResponse{value: val, isSet: true} +} + +func (v NullableUnlockRequestsResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUnlockRequestsResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_unlock_requests_result.go b/model_unlock_requests_result.go new file mode 100644 index 0000000..347fb60 --- /dev/null +++ b/model_unlock_requests_result.go @@ -0,0 +1,159 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" + "bytes" + "fmt" +) + +// checks if the UnlockRequestsResult type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UnlockRequestsResult{} + +// UnlockRequestsResult Result of unlocking requests in the request queue. +type UnlockRequestsResult struct { + // Number of requests that were successfully unlocked. + UnlockedCount int32 `json:"unlockedCount"` +} + +type _UnlockRequestsResult UnlockRequestsResult + +// NewUnlockRequestsResult instantiates a new UnlockRequestsResult object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUnlockRequestsResult(unlockedCount int32) *UnlockRequestsResult { + this := UnlockRequestsResult{} + this.UnlockedCount = unlockedCount + return &this +} + +// NewUnlockRequestsResultWithDefaults instantiates a new UnlockRequestsResult object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUnlockRequestsResultWithDefaults() *UnlockRequestsResult { + this := UnlockRequestsResult{} + return &this +} + +// GetUnlockedCount returns the UnlockedCount field value +func (o *UnlockRequestsResult) GetUnlockedCount() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.UnlockedCount +} + +// GetUnlockedCountOk returns a tuple with the UnlockedCount field value +// and a boolean to check if the value has been set. +func (o *UnlockRequestsResult) GetUnlockedCountOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.UnlockedCount, true +} + +// SetUnlockedCount sets field value +func (o *UnlockRequestsResult) SetUnlockedCount(v int32) { + o.UnlockedCount = v +} + +func (o UnlockRequestsResult) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o UnlockRequestsResult) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["unlockedCount"] = o.UnlockedCount + return toSerialize, nil +} + +func (o *UnlockRequestsResult) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "unlockedCount", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varUnlockRequestsResult := _UnlockRequestsResult{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varUnlockRequestsResult) + + if err != nil { + return err + } + + *o = UnlockRequestsResult(varUnlockRequestsResult) + + return err +} + +type NullableUnlockRequestsResult struct { + value *UnlockRequestsResult + isSet bool +} + +func (v NullableUnlockRequestsResult) Get() *UnlockRequestsResult { + return v.value +} + +func (v *NullableUnlockRequestsResult) Set(val *UnlockRequestsResult) { + v.value = val + v.isSet = true +} + +func (v NullableUnlockRequestsResult) IsSet() bool { + return v.isSet +} + +func (v *NullableUnlockRequestsResult) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUnlockRequestsResult(val *UnlockRequestsResult) *NullableUnlockRequestsResult { + return &NullableUnlockRequestsResult{value: val, isSet: true} +} + +func (v NullableUnlockRequestsResult) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUnlockRequestsResult) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_update_actor_request.go b/model_update_actor_request.go new file mode 100644 index 0000000..d78aa9f --- /dev/null +++ b/model_update_actor_request.go @@ -0,0 +1,764 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" +) + +// checks if the UpdateActorRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UpdateActorRequest{} + +// UpdateActorRequest struct for UpdateActorRequest +type UpdateActorRequest struct { + Name *string `json:"name,omitempty"` + Description NullableString `json:"description,omitempty"` + IsPublic *bool `json:"isPublic,omitempty"` + ActorPermissionLevel NullableActorPermissionLevel `json:"actorPermissionLevel,omitempty"` + SeoTitle NullableString `json:"seoTitle,omitempty"` + SeoDescription NullableString `json:"seoDescription,omitempty"` + Title NullableString `json:"title,omitempty"` + // Deprecated + RestartOnError *bool `json:"restartOnError,omitempty"` + // + Versions []CreateOrUpdateVersionRequest `json:"versions,omitempty"` + PricingInfos []ActorRunPricingInfo `json:"pricingInfos,omitempty"` + // + Categories []string `json:"categories,omitempty"` + DefaultRunOptions NullableDefaultRunOptions `json:"defaultRunOptions,omitempty"` + // An object to modify tags on the Actor's builds. The key is the tag name (e.g., _latest_), and the value is either an object with a `buildId` or `null`. This operation is a patch; any existing tags that you omit from this object will be preserved. - **To create or reassign a tag**, provide the tag name with a `buildId`. e.g., to assign the _latest_ tag:   ```json { \"latest\": { \"buildId\": \"z2EryhbfhgSyqj6Hn\" } } ``` - **To remove a tag**, provide the tag name with a `null` value. e.g., to remove the _beta_ tag:   ```json { \"beta\": null } ``` - **To perform multiple operations**, combine them. The following reassigns _latest_ and removes _beta_, while preserving any other existing tags.   ```json { \"latest\": { \"buildId\": \"z2EryhbfhgSyqj6Hn\" }, \"beta\": null } ``` + TaggedBuilds map[string]BuildTag `json:"taggedBuilds,omitempty"` + ActorStandby NullableActorStandby `json:"actorStandby,omitempty"` + ExampleRunInput NullableExampleRunInput `json:"exampleRunInput,omitempty"` + IsDeprecated NullableBool `json:"isDeprecated,omitempty"` +} + +// NewUpdateActorRequest instantiates a new UpdateActorRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUpdateActorRequest() *UpdateActorRequest { + this := UpdateActorRequest{} + return &this +} + +// NewUpdateActorRequestWithDefaults instantiates a new UpdateActorRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUpdateActorRequestWithDefaults() *UpdateActorRequest { + this := UpdateActorRequest{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *UpdateActorRequest) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateActorRequest) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *UpdateActorRequest) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *UpdateActorRequest) SetName(v string) { + o.Name = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *UpdateActorRequest) GetDescription() string { + if o == nil || IsNil(o.Description.Get()) { + var ret string + return ret + } + return *o.Description.Get() +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *UpdateActorRequest) GetDescriptionOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Description.Get(), o.Description.IsSet() +} + +// HasDescription returns a boolean if a field has been set. +func (o *UpdateActorRequest) HasDescription() bool { + if o != nil && o.Description.IsSet() { + return true + } + + return false +} + +// SetDescription gets a reference to the given NullableString and assigns it to the Description field. +func (o *UpdateActorRequest) SetDescription(v string) { + o.Description.Set(&v) +} +// SetDescriptionNil sets the value for Description to be an explicit nil +func (o *UpdateActorRequest) SetDescriptionNil() { + o.Description.Set(nil) +} + +// UnsetDescription ensures that no value is present for Description, not even an explicit nil +func (o *UpdateActorRequest) UnsetDescription() { + o.Description.Unset() +} + +// GetIsPublic returns the IsPublic field value if set, zero value otherwise. +func (o *UpdateActorRequest) GetIsPublic() bool { + if o == nil || IsNil(o.IsPublic) { + var ret bool + return ret + } + return *o.IsPublic +} + +// GetIsPublicOk returns a tuple with the IsPublic field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateActorRequest) GetIsPublicOk() (*bool, bool) { + if o == nil || IsNil(o.IsPublic) { + return nil, false + } + return o.IsPublic, true +} + +// HasIsPublic returns a boolean if a field has been set. +func (o *UpdateActorRequest) HasIsPublic() bool { + if o != nil && !IsNil(o.IsPublic) { + return true + } + + return false +} + +// SetIsPublic gets a reference to the given bool and assigns it to the IsPublic field. +func (o *UpdateActorRequest) SetIsPublic(v bool) { + o.IsPublic = &v +} + +// GetActorPermissionLevel returns the ActorPermissionLevel field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *UpdateActorRequest) GetActorPermissionLevel() ActorPermissionLevel { + if o == nil || IsNil(o.ActorPermissionLevel.Get()) { + var ret ActorPermissionLevel + return ret + } + return *o.ActorPermissionLevel.Get() +} + +// GetActorPermissionLevelOk returns a tuple with the ActorPermissionLevel field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *UpdateActorRequest) GetActorPermissionLevelOk() (*ActorPermissionLevel, bool) { + if o == nil { + return nil, false + } + return o.ActorPermissionLevel.Get(), o.ActorPermissionLevel.IsSet() +} + +// HasActorPermissionLevel returns a boolean if a field has been set. +func (o *UpdateActorRequest) HasActorPermissionLevel() bool { + if o != nil && o.ActorPermissionLevel.IsSet() { + return true + } + + return false +} + +// SetActorPermissionLevel gets a reference to the given NullableActorPermissionLevel and assigns it to the ActorPermissionLevel field. +func (o *UpdateActorRequest) SetActorPermissionLevel(v ActorPermissionLevel) { + o.ActorPermissionLevel.Set(&v) +} +// SetActorPermissionLevelNil sets the value for ActorPermissionLevel to be an explicit nil +func (o *UpdateActorRequest) SetActorPermissionLevelNil() { + o.ActorPermissionLevel.Set(nil) +} + +// UnsetActorPermissionLevel ensures that no value is present for ActorPermissionLevel, not even an explicit nil +func (o *UpdateActorRequest) UnsetActorPermissionLevel() { + o.ActorPermissionLevel.Unset() +} + +// GetSeoTitle returns the SeoTitle field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *UpdateActorRequest) GetSeoTitle() string { + if o == nil || IsNil(o.SeoTitle.Get()) { + var ret string + return ret + } + return *o.SeoTitle.Get() +} + +// GetSeoTitleOk returns a tuple with the SeoTitle field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *UpdateActorRequest) GetSeoTitleOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.SeoTitle.Get(), o.SeoTitle.IsSet() +} + +// HasSeoTitle returns a boolean if a field has been set. +func (o *UpdateActorRequest) HasSeoTitle() bool { + if o != nil && o.SeoTitle.IsSet() { + return true + } + + return false +} + +// SetSeoTitle gets a reference to the given NullableString and assigns it to the SeoTitle field. +func (o *UpdateActorRequest) SetSeoTitle(v string) { + o.SeoTitle.Set(&v) +} +// SetSeoTitleNil sets the value for SeoTitle to be an explicit nil +func (o *UpdateActorRequest) SetSeoTitleNil() { + o.SeoTitle.Set(nil) +} + +// UnsetSeoTitle ensures that no value is present for SeoTitle, not even an explicit nil +func (o *UpdateActorRequest) UnsetSeoTitle() { + o.SeoTitle.Unset() +} + +// GetSeoDescription returns the SeoDescription field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *UpdateActorRequest) GetSeoDescription() string { + if o == nil || IsNil(o.SeoDescription.Get()) { + var ret string + return ret + } + return *o.SeoDescription.Get() +} + +// GetSeoDescriptionOk returns a tuple with the SeoDescription field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *UpdateActorRequest) GetSeoDescriptionOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.SeoDescription.Get(), o.SeoDescription.IsSet() +} + +// HasSeoDescription returns a boolean if a field has been set. +func (o *UpdateActorRequest) HasSeoDescription() bool { + if o != nil && o.SeoDescription.IsSet() { + return true + } + + return false +} + +// SetSeoDescription gets a reference to the given NullableString and assigns it to the SeoDescription field. +func (o *UpdateActorRequest) SetSeoDescription(v string) { + o.SeoDescription.Set(&v) +} +// SetSeoDescriptionNil sets the value for SeoDescription to be an explicit nil +func (o *UpdateActorRequest) SetSeoDescriptionNil() { + o.SeoDescription.Set(nil) +} + +// UnsetSeoDescription ensures that no value is present for SeoDescription, not even an explicit nil +func (o *UpdateActorRequest) UnsetSeoDescription() { + o.SeoDescription.Unset() +} + +// GetTitle returns the Title field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *UpdateActorRequest) GetTitle() string { + if o == nil || IsNil(o.Title.Get()) { + var ret string + return ret + } + return *o.Title.Get() +} + +// GetTitleOk returns a tuple with the Title field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *UpdateActorRequest) GetTitleOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Title.Get(), o.Title.IsSet() +} + +// HasTitle returns a boolean if a field has been set. +func (o *UpdateActorRequest) HasTitle() bool { + if o != nil && o.Title.IsSet() { + return true + } + + return false +} + +// SetTitle gets a reference to the given NullableString and assigns it to the Title field. +func (o *UpdateActorRequest) SetTitle(v string) { + o.Title.Set(&v) +} +// SetTitleNil sets the value for Title to be an explicit nil +func (o *UpdateActorRequest) SetTitleNil() { + o.Title.Set(nil) +} + +// UnsetTitle ensures that no value is present for Title, not even an explicit nil +func (o *UpdateActorRequest) UnsetTitle() { + o.Title.Unset() +} + +// GetRestartOnError returns the RestartOnError field value if set, zero value otherwise. +// Deprecated +func (o *UpdateActorRequest) GetRestartOnError() bool { + if o == nil || IsNil(o.RestartOnError) { + var ret bool + return ret + } + return *o.RestartOnError +} + +// GetRestartOnErrorOk returns a tuple with the RestartOnError field value if set, nil otherwise +// and a boolean to check if the value has been set. +// Deprecated +func (o *UpdateActorRequest) GetRestartOnErrorOk() (*bool, bool) { + if o == nil || IsNil(o.RestartOnError) { + return nil, false + } + return o.RestartOnError, true +} + +// HasRestartOnError returns a boolean if a field has been set. +func (o *UpdateActorRequest) HasRestartOnError() bool { + if o != nil && !IsNil(o.RestartOnError) { + return true + } + + return false +} + +// SetRestartOnError gets a reference to the given bool and assigns it to the RestartOnError field. +// Deprecated +func (o *UpdateActorRequest) SetRestartOnError(v bool) { + o.RestartOnError = &v +} + +// GetVersions returns the Versions field value if set, zero value otherwise. +func (o *UpdateActorRequest) GetVersions() []CreateOrUpdateVersionRequest { + if o == nil || IsNil(o.Versions) { + var ret []CreateOrUpdateVersionRequest + return ret + } + return o.Versions +} + +// GetVersionsOk returns a tuple with the Versions field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateActorRequest) GetVersionsOk() ([]CreateOrUpdateVersionRequest, bool) { + if o == nil || IsNil(o.Versions) { + return nil, false + } + return o.Versions, true +} + +// HasVersions returns a boolean if a field has been set. +func (o *UpdateActorRequest) HasVersions() bool { + if o != nil && !IsNil(o.Versions) { + return true + } + + return false +} + +// SetVersions gets a reference to the given []CreateOrUpdateVersionRequest and assigns it to the Versions field. +func (o *UpdateActorRequest) SetVersions(v []CreateOrUpdateVersionRequest) { + o.Versions = v +} + +// GetPricingInfos returns the PricingInfos field value if set, zero value otherwise. +func (o *UpdateActorRequest) GetPricingInfos() []ActorRunPricingInfo { + if o == nil || IsNil(o.PricingInfos) { + var ret []ActorRunPricingInfo + return ret + } + return o.PricingInfos +} + +// GetPricingInfosOk returns a tuple with the PricingInfos field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateActorRequest) GetPricingInfosOk() ([]ActorRunPricingInfo, bool) { + if o == nil || IsNil(o.PricingInfos) { + return nil, false + } + return o.PricingInfos, true +} + +// HasPricingInfos returns a boolean if a field has been set. +func (o *UpdateActorRequest) HasPricingInfos() bool { + if o != nil && !IsNil(o.PricingInfos) { + return true + } + + return false +} + +// SetPricingInfos gets a reference to the given []ActorRunPricingInfo and assigns it to the PricingInfos field. +func (o *UpdateActorRequest) SetPricingInfos(v []ActorRunPricingInfo) { + o.PricingInfos = v +} + +// GetCategories returns the Categories field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *UpdateActorRequest) GetCategories() []string { + if o == nil { + var ret []string + return ret + } + return o.Categories +} + +// GetCategoriesOk returns a tuple with the Categories field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *UpdateActorRequest) GetCategoriesOk() ([]string, bool) { + if o == nil || IsNil(o.Categories) { + return nil, false + } + return o.Categories, true +} + +// HasCategories returns a boolean if a field has been set. +func (o *UpdateActorRequest) HasCategories() bool { + if o != nil && !IsNil(o.Categories) { + return true + } + + return false +} + +// SetCategories gets a reference to the given []string and assigns it to the Categories field. +func (o *UpdateActorRequest) SetCategories(v []string) { + o.Categories = v +} + +// GetDefaultRunOptions returns the DefaultRunOptions field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *UpdateActorRequest) GetDefaultRunOptions() DefaultRunOptions { + if o == nil || IsNil(o.DefaultRunOptions.Get()) { + var ret DefaultRunOptions + return ret + } + return *o.DefaultRunOptions.Get() +} + +// GetDefaultRunOptionsOk returns a tuple with the DefaultRunOptions field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *UpdateActorRequest) GetDefaultRunOptionsOk() (*DefaultRunOptions, bool) { + if o == nil { + return nil, false + } + return o.DefaultRunOptions.Get(), o.DefaultRunOptions.IsSet() +} + +// HasDefaultRunOptions returns a boolean if a field has been set. +func (o *UpdateActorRequest) HasDefaultRunOptions() bool { + if o != nil && o.DefaultRunOptions.IsSet() { + return true + } + + return false +} + +// SetDefaultRunOptions gets a reference to the given NullableDefaultRunOptions and assigns it to the DefaultRunOptions field. +func (o *UpdateActorRequest) SetDefaultRunOptions(v DefaultRunOptions) { + o.DefaultRunOptions.Set(&v) +} +// SetDefaultRunOptionsNil sets the value for DefaultRunOptions to be an explicit nil +func (o *UpdateActorRequest) SetDefaultRunOptionsNil() { + o.DefaultRunOptions.Set(nil) +} + +// UnsetDefaultRunOptions ensures that no value is present for DefaultRunOptions, not even an explicit nil +func (o *UpdateActorRequest) UnsetDefaultRunOptions() { + o.DefaultRunOptions.Unset() +} + +// GetTaggedBuilds returns the TaggedBuilds field value if set, zero value otherwise. +func (o *UpdateActorRequest) GetTaggedBuilds() map[string]BuildTag { + if o == nil || IsNil(o.TaggedBuilds) { + var ret map[string]BuildTag + return ret + } + return o.TaggedBuilds +} + +// GetTaggedBuildsOk returns a tuple with the TaggedBuilds field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateActorRequest) GetTaggedBuildsOk() (map[string]BuildTag, bool) { + if o == nil || IsNil(o.TaggedBuilds) { + return map[string]BuildTag{}, false + } + return o.TaggedBuilds, true +} + +// HasTaggedBuilds returns a boolean if a field has been set. +func (o *UpdateActorRequest) HasTaggedBuilds() bool { + if o != nil && !IsNil(o.TaggedBuilds) { + return true + } + + return false +} + +// SetTaggedBuilds gets a reference to the given map[string]BuildTag and assigns it to the TaggedBuilds field. +func (o *UpdateActorRequest) SetTaggedBuilds(v map[string]BuildTag) { + o.TaggedBuilds = v +} + +// GetActorStandby returns the ActorStandby field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *UpdateActorRequest) GetActorStandby() ActorStandby { + if o == nil || IsNil(o.ActorStandby.Get()) { + var ret ActorStandby + return ret + } + return *o.ActorStandby.Get() +} + +// GetActorStandbyOk returns a tuple with the ActorStandby field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *UpdateActorRequest) GetActorStandbyOk() (*ActorStandby, bool) { + if o == nil { + return nil, false + } + return o.ActorStandby.Get(), o.ActorStandby.IsSet() +} + +// HasActorStandby returns a boolean if a field has been set. +func (o *UpdateActorRequest) HasActorStandby() bool { + if o != nil && o.ActorStandby.IsSet() { + return true + } + + return false +} + +// SetActorStandby gets a reference to the given NullableActorStandby and assigns it to the ActorStandby field. +func (o *UpdateActorRequest) SetActorStandby(v ActorStandby) { + o.ActorStandby.Set(&v) +} +// SetActorStandbyNil sets the value for ActorStandby to be an explicit nil +func (o *UpdateActorRequest) SetActorStandbyNil() { + o.ActorStandby.Set(nil) +} + +// UnsetActorStandby ensures that no value is present for ActorStandby, not even an explicit nil +func (o *UpdateActorRequest) UnsetActorStandby() { + o.ActorStandby.Unset() +} + +// GetExampleRunInput returns the ExampleRunInput field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *UpdateActorRequest) GetExampleRunInput() ExampleRunInput { + if o == nil || IsNil(o.ExampleRunInput.Get()) { + var ret ExampleRunInput + return ret + } + return *o.ExampleRunInput.Get() +} + +// GetExampleRunInputOk returns a tuple with the ExampleRunInput field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *UpdateActorRequest) GetExampleRunInputOk() (*ExampleRunInput, bool) { + if o == nil { + return nil, false + } + return o.ExampleRunInput.Get(), o.ExampleRunInput.IsSet() +} + +// HasExampleRunInput returns a boolean if a field has been set. +func (o *UpdateActorRequest) HasExampleRunInput() bool { + if o != nil && o.ExampleRunInput.IsSet() { + return true + } + + return false +} + +// SetExampleRunInput gets a reference to the given NullableExampleRunInput and assigns it to the ExampleRunInput field. +func (o *UpdateActorRequest) SetExampleRunInput(v ExampleRunInput) { + o.ExampleRunInput.Set(&v) +} +// SetExampleRunInputNil sets the value for ExampleRunInput to be an explicit nil +func (o *UpdateActorRequest) SetExampleRunInputNil() { + o.ExampleRunInput.Set(nil) +} + +// UnsetExampleRunInput ensures that no value is present for ExampleRunInput, not even an explicit nil +func (o *UpdateActorRequest) UnsetExampleRunInput() { + o.ExampleRunInput.Unset() +} + +// GetIsDeprecated returns the IsDeprecated field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *UpdateActorRequest) GetIsDeprecated() bool { + if o == nil || IsNil(o.IsDeprecated.Get()) { + var ret bool + return ret + } + return *o.IsDeprecated.Get() +} + +// GetIsDeprecatedOk returns a tuple with the IsDeprecated field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *UpdateActorRequest) GetIsDeprecatedOk() (*bool, bool) { + if o == nil { + return nil, false + } + return o.IsDeprecated.Get(), o.IsDeprecated.IsSet() +} + +// HasIsDeprecated returns a boolean if a field has been set. +func (o *UpdateActorRequest) HasIsDeprecated() bool { + if o != nil && o.IsDeprecated.IsSet() { + return true + } + + return false +} + +// SetIsDeprecated gets a reference to the given NullableBool and assigns it to the IsDeprecated field. +func (o *UpdateActorRequest) SetIsDeprecated(v bool) { + o.IsDeprecated.Set(&v) +} +// SetIsDeprecatedNil sets the value for IsDeprecated to be an explicit nil +func (o *UpdateActorRequest) SetIsDeprecatedNil() { + o.IsDeprecated.Set(nil) +} + +// UnsetIsDeprecated ensures that no value is present for IsDeprecated, not even an explicit nil +func (o *UpdateActorRequest) UnsetIsDeprecated() { + o.IsDeprecated.Unset() +} + +func (o UpdateActorRequest) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o UpdateActorRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if o.Description.IsSet() { + toSerialize["description"] = o.Description.Get() + } + if !IsNil(o.IsPublic) { + toSerialize["isPublic"] = o.IsPublic + } + if o.ActorPermissionLevel.IsSet() { + toSerialize["actorPermissionLevel"] = o.ActorPermissionLevel.Get() + } + if o.SeoTitle.IsSet() { + toSerialize["seoTitle"] = o.SeoTitle.Get() + } + if o.SeoDescription.IsSet() { + toSerialize["seoDescription"] = o.SeoDescription.Get() + } + if o.Title.IsSet() { + toSerialize["title"] = o.Title.Get() + } + if !IsNil(o.RestartOnError) { + toSerialize["restartOnError"] = o.RestartOnError + } + if !IsNil(o.Versions) { + toSerialize["versions"] = o.Versions + } + if !IsNil(o.PricingInfos) { + toSerialize["pricingInfos"] = o.PricingInfos + } + if o.Categories != nil { + toSerialize["categories"] = o.Categories + } + if o.DefaultRunOptions.IsSet() { + toSerialize["defaultRunOptions"] = o.DefaultRunOptions.Get() + } + if !IsNil(o.TaggedBuilds) { + toSerialize["taggedBuilds"] = o.TaggedBuilds + } + if o.ActorStandby.IsSet() { + toSerialize["actorStandby"] = o.ActorStandby.Get() + } + if o.ExampleRunInput.IsSet() { + toSerialize["exampleRunInput"] = o.ExampleRunInput.Get() + } + if o.IsDeprecated.IsSet() { + toSerialize["isDeprecated"] = o.IsDeprecated.Get() + } + return toSerialize, nil +} + +type NullableUpdateActorRequest struct { + value *UpdateActorRequest + isSet bool +} + +func (v NullableUpdateActorRequest) Get() *UpdateActorRequest { + return v.value +} + +func (v *NullableUpdateActorRequest) Set(val *UpdateActorRequest) { + v.value = val + v.isSet = true +} + +func (v NullableUpdateActorRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableUpdateActorRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUpdateActorRequest(val *UpdateActorRequest) *NullableUpdateActorRequest { + return &NullableUpdateActorRequest{value: val, isSet: true} +} + +func (v NullableUpdateActorRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUpdateActorRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_update_dataset_request.go b/model_update_dataset_request.go new file mode 100644 index 0000000..a9979ea --- /dev/null +++ b/model_update_dataset_request.go @@ -0,0 +1,172 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" +) + +// checks if the UpdateDatasetRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UpdateDatasetRequest{} + +// UpdateDatasetRequest struct for UpdateDatasetRequest +type UpdateDatasetRequest struct { + Name NullableString `json:"name,omitempty"` + GeneralAccess *GeneralAccess `json:"generalAccess,omitempty"` +} + +// NewUpdateDatasetRequest instantiates a new UpdateDatasetRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUpdateDatasetRequest() *UpdateDatasetRequest { + this := UpdateDatasetRequest{} + return &this +} + +// NewUpdateDatasetRequestWithDefaults instantiates a new UpdateDatasetRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUpdateDatasetRequestWithDefaults() *UpdateDatasetRequest { + this := UpdateDatasetRequest{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *UpdateDatasetRequest) GetName() string { + if o == nil || IsNil(o.Name.Get()) { + var ret string + return ret + } + return *o.Name.Get() +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *UpdateDatasetRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Name.Get(), o.Name.IsSet() +} + +// HasName returns a boolean if a field has been set. +func (o *UpdateDatasetRequest) HasName() bool { + if o != nil && o.Name.IsSet() { + return true + } + + return false +} + +// SetName gets a reference to the given NullableString and assigns it to the Name field. +func (o *UpdateDatasetRequest) SetName(v string) { + o.Name.Set(&v) +} +// SetNameNil sets the value for Name to be an explicit nil +func (o *UpdateDatasetRequest) SetNameNil() { + o.Name.Set(nil) +} + +// UnsetName ensures that no value is present for Name, not even an explicit nil +func (o *UpdateDatasetRequest) UnsetName() { + o.Name.Unset() +} + +// GetGeneralAccess returns the GeneralAccess field value if set, zero value otherwise. +func (o *UpdateDatasetRequest) GetGeneralAccess() GeneralAccess { + if o == nil || IsNil(o.GeneralAccess) { + var ret GeneralAccess + return ret + } + return *o.GeneralAccess +} + +// GetGeneralAccessOk returns a tuple with the GeneralAccess field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateDatasetRequest) GetGeneralAccessOk() (*GeneralAccess, bool) { + if o == nil || IsNil(o.GeneralAccess) { + return nil, false + } + return o.GeneralAccess, true +} + +// HasGeneralAccess returns a boolean if a field has been set. +func (o *UpdateDatasetRequest) HasGeneralAccess() bool { + if o != nil && !IsNil(o.GeneralAccess) { + return true + } + + return false +} + +// SetGeneralAccess gets a reference to the given GeneralAccess and assigns it to the GeneralAccess field. +func (o *UpdateDatasetRequest) SetGeneralAccess(v GeneralAccess) { + o.GeneralAccess = &v +} + +func (o UpdateDatasetRequest) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o UpdateDatasetRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.Name.IsSet() { + toSerialize["name"] = o.Name.Get() + } + if !IsNil(o.GeneralAccess) { + toSerialize["generalAccess"] = o.GeneralAccess + } + return toSerialize, nil +} + +type NullableUpdateDatasetRequest struct { + value *UpdateDatasetRequest + isSet bool +} + +func (v NullableUpdateDatasetRequest) Get() *UpdateDatasetRequest { + return v.value +} + +func (v *NullableUpdateDatasetRequest) Set(val *UpdateDatasetRequest) { + v.value = val + v.isSet = true +} + +func (v NullableUpdateDatasetRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableUpdateDatasetRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUpdateDatasetRequest(val *UpdateDatasetRequest) *NullableUpdateDatasetRequest { + return &NullableUpdateDatasetRequest{value: val, isSet: true} +} + +func (v NullableUpdateDatasetRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUpdateDatasetRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_update_limits_request.go b/model_update_limits_request.go new file mode 100644 index 0000000..3bde37a --- /dev/null +++ b/model_update_limits_request.go @@ -0,0 +1,164 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" +) + +// checks if the UpdateLimitsRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UpdateLimitsRequest{} + +// UpdateLimitsRequest struct for UpdateLimitsRequest +type UpdateLimitsRequest struct { + // If your platform usage in the billing period exceeds the prepaid usage, you will be charged extra. Setting this property you can update your hard limit on monthly platform usage to prevent accidental overage or to limit the extra charges. + MaxMonthlyUsageUsd *float32 `json:"maxMonthlyUsageUsd,omitempty"` + // Apify securely stores your ten most recent Actor runs indefinitely, ensuring they are always accessible. Unnamed storages and other Actor runs are automatically deleted after the retention period. If you're subscribed, you can change it to keep data for longer or to limit your usage. [Lear more](https://docs.apify.com/platform/storage/usage#data-retention). + DataRetentionDays *int32 `json:"dataRetentionDays,omitempty"` +} + +// NewUpdateLimitsRequest instantiates a new UpdateLimitsRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUpdateLimitsRequest() *UpdateLimitsRequest { + this := UpdateLimitsRequest{} + return &this +} + +// NewUpdateLimitsRequestWithDefaults instantiates a new UpdateLimitsRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUpdateLimitsRequestWithDefaults() *UpdateLimitsRequest { + this := UpdateLimitsRequest{} + return &this +} + +// GetMaxMonthlyUsageUsd returns the MaxMonthlyUsageUsd field value if set, zero value otherwise. +func (o *UpdateLimitsRequest) GetMaxMonthlyUsageUsd() float32 { + if o == nil || IsNil(o.MaxMonthlyUsageUsd) { + var ret float32 + return ret + } + return *o.MaxMonthlyUsageUsd +} + +// GetMaxMonthlyUsageUsdOk returns a tuple with the MaxMonthlyUsageUsd field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateLimitsRequest) GetMaxMonthlyUsageUsdOk() (*float32, bool) { + if o == nil || IsNil(o.MaxMonthlyUsageUsd) { + return nil, false + } + return o.MaxMonthlyUsageUsd, true +} + +// HasMaxMonthlyUsageUsd returns a boolean if a field has been set. +func (o *UpdateLimitsRequest) HasMaxMonthlyUsageUsd() bool { + if o != nil && !IsNil(o.MaxMonthlyUsageUsd) { + return true + } + + return false +} + +// SetMaxMonthlyUsageUsd gets a reference to the given float32 and assigns it to the MaxMonthlyUsageUsd field. +func (o *UpdateLimitsRequest) SetMaxMonthlyUsageUsd(v float32) { + o.MaxMonthlyUsageUsd = &v +} + +// GetDataRetentionDays returns the DataRetentionDays field value if set, zero value otherwise. +func (o *UpdateLimitsRequest) GetDataRetentionDays() int32 { + if o == nil || IsNil(o.DataRetentionDays) { + var ret int32 + return ret + } + return *o.DataRetentionDays +} + +// GetDataRetentionDaysOk returns a tuple with the DataRetentionDays field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateLimitsRequest) GetDataRetentionDaysOk() (*int32, bool) { + if o == nil || IsNil(o.DataRetentionDays) { + return nil, false + } + return o.DataRetentionDays, true +} + +// HasDataRetentionDays returns a boolean if a field has been set. +func (o *UpdateLimitsRequest) HasDataRetentionDays() bool { + if o != nil && !IsNil(o.DataRetentionDays) { + return true + } + + return false +} + +// SetDataRetentionDays gets a reference to the given int32 and assigns it to the DataRetentionDays field. +func (o *UpdateLimitsRequest) SetDataRetentionDays(v int32) { + o.DataRetentionDays = &v +} + +func (o UpdateLimitsRequest) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o UpdateLimitsRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.MaxMonthlyUsageUsd) { + toSerialize["maxMonthlyUsageUsd"] = o.MaxMonthlyUsageUsd + } + if !IsNil(o.DataRetentionDays) { + toSerialize["dataRetentionDays"] = o.DataRetentionDays + } + return toSerialize, nil +} + +type NullableUpdateLimitsRequest struct { + value *UpdateLimitsRequest + isSet bool +} + +func (v NullableUpdateLimitsRequest) Get() *UpdateLimitsRequest { + return v.value +} + +func (v *NullableUpdateLimitsRequest) Set(val *UpdateLimitsRequest) { + v.value = val + v.isSet = true +} + +func (v NullableUpdateLimitsRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableUpdateLimitsRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUpdateLimitsRequest(val *UpdateLimitsRequest) *NullableUpdateLimitsRequest { + return &NullableUpdateLimitsRequest{value: val, isSet: true} +} + +func (v NullableUpdateLimitsRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUpdateLimitsRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_update_request_queue_request.go b/model_update_request_queue_request.go new file mode 100644 index 0000000..52e46f8 --- /dev/null +++ b/model_update_request_queue_request.go @@ -0,0 +1,173 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" +) + +// checks if the UpdateRequestQueueRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UpdateRequestQueueRequest{} + +// UpdateRequestQueueRequest Request object for updating a request queue. +type UpdateRequestQueueRequest struct { + // The new name for the request queue. + Name NullableString `json:"name,omitempty"` + GeneralAccess *GeneralAccess `json:"generalAccess,omitempty"` +} + +// NewUpdateRequestQueueRequest instantiates a new UpdateRequestQueueRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUpdateRequestQueueRequest() *UpdateRequestQueueRequest { + this := UpdateRequestQueueRequest{} + return &this +} + +// NewUpdateRequestQueueRequestWithDefaults instantiates a new UpdateRequestQueueRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUpdateRequestQueueRequestWithDefaults() *UpdateRequestQueueRequest { + this := UpdateRequestQueueRequest{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *UpdateRequestQueueRequest) GetName() string { + if o == nil || IsNil(o.Name.Get()) { + var ret string + return ret + } + return *o.Name.Get() +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *UpdateRequestQueueRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Name.Get(), o.Name.IsSet() +} + +// HasName returns a boolean if a field has been set. +func (o *UpdateRequestQueueRequest) HasName() bool { + if o != nil && o.Name.IsSet() { + return true + } + + return false +} + +// SetName gets a reference to the given NullableString and assigns it to the Name field. +func (o *UpdateRequestQueueRequest) SetName(v string) { + o.Name.Set(&v) +} +// SetNameNil sets the value for Name to be an explicit nil +func (o *UpdateRequestQueueRequest) SetNameNil() { + o.Name.Set(nil) +} + +// UnsetName ensures that no value is present for Name, not even an explicit nil +func (o *UpdateRequestQueueRequest) UnsetName() { + o.Name.Unset() +} + +// GetGeneralAccess returns the GeneralAccess field value if set, zero value otherwise. +func (o *UpdateRequestQueueRequest) GetGeneralAccess() GeneralAccess { + if o == nil || IsNil(o.GeneralAccess) { + var ret GeneralAccess + return ret + } + return *o.GeneralAccess +} + +// GetGeneralAccessOk returns a tuple with the GeneralAccess field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateRequestQueueRequest) GetGeneralAccessOk() (*GeneralAccess, bool) { + if o == nil || IsNil(o.GeneralAccess) { + return nil, false + } + return o.GeneralAccess, true +} + +// HasGeneralAccess returns a boolean if a field has been set. +func (o *UpdateRequestQueueRequest) HasGeneralAccess() bool { + if o != nil && !IsNil(o.GeneralAccess) { + return true + } + + return false +} + +// SetGeneralAccess gets a reference to the given GeneralAccess and assigns it to the GeneralAccess field. +func (o *UpdateRequestQueueRequest) SetGeneralAccess(v GeneralAccess) { + o.GeneralAccess = &v +} + +func (o UpdateRequestQueueRequest) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o UpdateRequestQueueRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.Name.IsSet() { + toSerialize["name"] = o.Name.Get() + } + if !IsNil(o.GeneralAccess) { + toSerialize["generalAccess"] = o.GeneralAccess + } + return toSerialize, nil +} + +type NullableUpdateRequestQueueRequest struct { + value *UpdateRequestQueueRequest + isSet bool +} + +func (v NullableUpdateRequestQueueRequest) Get() *UpdateRequestQueueRequest { + return v.value +} + +func (v *NullableUpdateRequestQueueRequest) Set(val *UpdateRequestQueueRequest) { + v.value = val + v.isSet = true +} + +func (v NullableUpdateRequestQueueRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableUpdateRequestQueueRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUpdateRequestQueueRequest(val *UpdateRequestQueueRequest) *NullableUpdateRequestQueueRequest { + return &NullableUpdateRequestQueueRequest{value: val, isSet: true} +} + +func (v NullableUpdateRequestQueueRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUpdateRequestQueueRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_update_request_response.go b/model_update_request_response.go new file mode 100644 index 0000000..63273d0 --- /dev/null +++ b/model_update_request_response.go @@ -0,0 +1,158 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" + "bytes" + "fmt" +) + +// checks if the UpdateRequestResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UpdateRequestResponse{} + +// UpdateRequestResponse Response containing the result of updating a request in the request queue. +type UpdateRequestResponse struct { + Data RequestRegistration `json:"data"` +} + +type _UpdateRequestResponse UpdateRequestResponse + +// NewUpdateRequestResponse instantiates a new UpdateRequestResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUpdateRequestResponse(data RequestRegistration) *UpdateRequestResponse { + this := UpdateRequestResponse{} + this.Data = data + return &this +} + +// NewUpdateRequestResponseWithDefaults instantiates a new UpdateRequestResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUpdateRequestResponseWithDefaults() *UpdateRequestResponse { + this := UpdateRequestResponse{} + return &this +} + +// GetData returns the Data field value +func (o *UpdateRequestResponse) GetData() RequestRegistration { + if o == nil { + var ret RequestRegistration + return ret + } + + return o.Data +} + +// GetDataOk returns a tuple with the Data field value +// and a boolean to check if the value has been set. +func (o *UpdateRequestResponse) GetDataOk() (*RequestRegistration, bool) { + if o == nil { + return nil, false + } + return &o.Data, true +} + +// SetData sets field value +func (o *UpdateRequestResponse) SetData(v RequestRegistration) { + o.Data = v +} + +func (o UpdateRequestResponse) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o UpdateRequestResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["data"] = o.Data + return toSerialize, nil +} + +func (o *UpdateRequestResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "data", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varUpdateRequestResponse := _UpdateRequestResponse{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varUpdateRequestResponse) + + if err != nil { + return err + } + + *o = UpdateRequestResponse(varUpdateRequestResponse) + + return err +} + +type NullableUpdateRequestResponse struct { + value *UpdateRequestResponse + isSet bool +} + +func (v NullableUpdateRequestResponse) Get() *UpdateRequestResponse { + return v.value +} + +func (v *NullableUpdateRequestResponse) Set(val *UpdateRequestResponse) { + v.value = val + v.isSet = true +} + +func (v NullableUpdateRequestResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableUpdateRequestResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUpdateRequestResponse(val *UpdateRequestResponse) *NullableUpdateRequestResponse { + return &NullableUpdateRequestResponse{value: val, isSet: true} +} + +func (v NullableUpdateRequestResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUpdateRequestResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_update_run_request.go b/model_update_run_request.go new file mode 100644 index 0000000..792707e --- /dev/null +++ b/model_update_run_request.go @@ -0,0 +1,234 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" +) + +// checks if the UpdateRunRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UpdateRunRequest{} + +// UpdateRunRequest struct for UpdateRunRequest +type UpdateRunRequest struct { + RunId *string `json:"runId,omitempty"` + StatusMessage *string `json:"statusMessage,omitempty"` + IsStatusMessageTerminal *bool `json:"isStatusMessageTerminal,omitempty"` + GeneralAccess *GeneralAccess `json:"generalAccess,omitempty"` +} + +// NewUpdateRunRequest instantiates a new UpdateRunRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUpdateRunRequest() *UpdateRunRequest { + this := UpdateRunRequest{} + return &this +} + +// NewUpdateRunRequestWithDefaults instantiates a new UpdateRunRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUpdateRunRequestWithDefaults() *UpdateRunRequest { + this := UpdateRunRequest{} + return &this +} + +// GetRunId returns the RunId field value if set, zero value otherwise. +func (o *UpdateRunRequest) GetRunId() string { + if o == nil || IsNil(o.RunId) { + var ret string + return ret + } + return *o.RunId +} + +// GetRunIdOk returns a tuple with the RunId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateRunRequest) GetRunIdOk() (*string, bool) { + if o == nil || IsNil(o.RunId) { + return nil, false + } + return o.RunId, true +} + +// HasRunId returns a boolean if a field has been set. +func (o *UpdateRunRequest) HasRunId() bool { + if o != nil && !IsNil(o.RunId) { + return true + } + + return false +} + +// SetRunId gets a reference to the given string and assigns it to the RunId field. +func (o *UpdateRunRequest) SetRunId(v string) { + o.RunId = &v +} + +// GetStatusMessage returns the StatusMessage field value if set, zero value otherwise. +func (o *UpdateRunRequest) GetStatusMessage() string { + if o == nil || IsNil(o.StatusMessage) { + var ret string + return ret + } + return *o.StatusMessage +} + +// GetStatusMessageOk returns a tuple with the StatusMessage field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateRunRequest) GetStatusMessageOk() (*string, bool) { + if o == nil || IsNil(o.StatusMessage) { + return nil, false + } + return o.StatusMessage, true +} + +// HasStatusMessage returns a boolean if a field has been set. +func (o *UpdateRunRequest) HasStatusMessage() bool { + if o != nil && !IsNil(o.StatusMessage) { + return true + } + + return false +} + +// SetStatusMessage gets a reference to the given string and assigns it to the StatusMessage field. +func (o *UpdateRunRequest) SetStatusMessage(v string) { + o.StatusMessage = &v +} + +// GetIsStatusMessageTerminal returns the IsStatusMessageTerminal field value if set, zero value otherwise. +func (o *UpdateRunRequest) GetIsStatusMessageTerminal() bool { + if o == nil || IsNil(o.IsStatusMessageTerminal) { + var ret bool + return ret + } + return *o.IsStatusMessageTerminal +} + +// GetIsStatusMessageTerminalOk returns a tuple with the IsStatusMessageTerminal field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateRunRequest) GetIsStatusMessageTerminalOk() (*bool, bool) { + if o == nil || IsNil(o.IsStatusMessageTerminal) { + return nil, false + } + return o.IsStatusMessageTerminal, true +} + +// HasIsStatusMessageTerminal returns a boolean if a field has been set. +func (o *UpdateRunRequest) HasIsStatusMessageTerminal() bool { + if o != nil && !IsNil(o.IsStatusMessageTerminal) { + return true + } + + return false +} + +// SetIsStatusMessageTerminal gets a reference to the given bool and assigns it to the IsStatusMessageTerminal field. +func (o *UpdateRunRequest) SetIsStatusMessageTerminal(v bool) { + o.IsStatusMessageTerminal = &v +} + +// GetGeneralAccess returns the GeneralAccess field value if set, zero value otherwise. +func (o *UpdateRunRequest) GetGeneralAccess() GeneralAccess { + if o == nil || IsNil(o.GeneralAccess) { + var ret GeneralAccess + return ret + } + return *o.GeneralAccess +} + +// GetGeneralAccessOk returns a tuple with the GeneralAccess field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateRunRequest) GetGeneralAccessOk() (*GeneralAccess, bool) { + if o == nil || IsNil(o.GeneralAccess) { + return nil, false + } + return o.GeneralAccess, true +} + +// HasGeneralAccess returns a boolean if a field has been set. +func (o *UpdateRunRequest) HasGeneralAccess() bool { + if o != nil && !IsNil(o.GeneralAccess) { + return true + } + + return false +} + +// SetGeneralAccess gets a reference to the given GeneralAccess and assigns it to the GeneralAccess field. +func (o *UpdateRunRequest) SetGeneralAccess(v GeneralAccess) { + o.GeneralAccess = &v +} + +func (o UpdateRunRequest) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o UpdateRunRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.RunId) { + toSerialize["runId"] = o.RunId + } + if !IsNil(o.StatusMessage) { + toSerialize["statusMessage"] = o.StatusMessage + } + if !IsNil(o.IsStatusMessageTerminal) { + toSerialize["isStatusMessageTerminal"] = o.IsStatusMessageTerminal + } + if !IsNil(o.GeneralAccess) { + toSerialize["generalAccess"] = o.GeneralAccess + } + return toSerialize, nil +} + +type NullableUpdateRunRequest struct { + value *UpdateRunRequest + isSet bool +} + +func (v NullableUpdateRunRequest) Get() *UpdateRunRequest { + return v.value +} + +func (v *NullableUpdateRunRequest) Set(val *UpdateRunRequest) { + v.value = val + v.isSet = true +} + +func (v NullableUpdateRunRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableUpdateRunRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUpdateRunRequest(val *UpdateRunRequest) *NullableUpdateRunRequest { + return &NullableUpdateRunRequest{value: val, isSet: true} +} + +func (v NullableUpdateRunRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUpdateRunRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_update_store_request.go b/model_update_store_request.go new file mode 100644 index 0000000..1b4cb82 --- /dev/null +++ b/model_update_store_request.go @@ -0,0 +1,172 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" +) + +// checks if the UpdateStoreRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UpdateStoreRequest{} + +// UpdateStoreRequest struct for UpdateStoreRequest +type UpdateStoreRequest struct { + Name NullableString `json:"name,omitempty"` + GeneralAccess *GeneralAccess `json:"generalAccess,omitempty"` +} + +// NewUpdateStoreRequest instantiates a new UpdateStoreRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUpdateStoreRequest() *UpdateStoreRequest { + this := UpdateStoreRequest{} + return &this +} + +// NewUpdateStoreRequestWithDefaults instantiates a new UpdateStoreRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUpdateStoreRequestWithDefaults() *UpdateStoreRequest { + this := UpdateStoreRequest{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *UpdateStoreRequest) GetName() string { + if o == nil || IsNil(o.Name.Get()) { + var ret string + return ret + } + return *o.Name.Get() +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *UpdateStoreRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Name.Get(), o.Name.IsSet() +} + +// HasName returns a boolean if a field has been set. +func (o *UpdateStoreRequest) HasName() bool { + if o != nil && o.Name.IsSet() { + return true + } + + return false +} + +// SetName gets a reference to the given NullableString and assigns it to the Name field. +func (o *UpdateStoreRequest) SetName(v string) { + o.Name.Set(&v) +} +// SetNameNil sets the value for Name to be an explicit nil +func (o *UpdateStoreRequest) SetNameNil() { + o.Name.Set(nil) +} + +// UnsetName ensures that no value is present for Name, not even an explicit nil +func (o *UpdateStoreRequest) UnsetName() { + o.Name.Unset() +} + +// GetGeneralAccess returns the GeneralAccess field value if set, zero value otherwise. +func (o *UpdateStoreRequest) GetGeneralAccess() GeneralAccess { + if o == nil || IsNil(o.GeneralAccess) { + var ret GeneralAccess + return ret + } + return *o.GeneralAccess +} + +// GetGeneralAccessOk returns a tuple with the GeneralAccess field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateStoreRequest) GetGeneralAccessOk() (*GeneralAccess, bool) { + if o == nil || IsNil(o.GeneralAccess) { + return nil, false + } + return o.GeneralAccess, true +} + +// HasGeneralAccess returns a boolean if a field has been set. +func (o *UpdateStoreRequest) HasGeneralAccess() bool { + if o != nil && !IsNil(o.GeneralAccess) { + return true + } + + return false +} + +// SetGeneralAccess gets a reference to the given GeneralAccess and assigns it to the GeneralAccess field. +func (o *UpdateStoreRequest) SetGeneralAccess(v GeneralAccess) { + o.GeneralAccess = &v +} + +func (o UpdateStoreRequest) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o UpdateStoreRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.Name.IsSet() { + toSerialize["name"] = o.Name.Get() + } + if !IsNil(o.GeneralAccess) { + toSerialize["generalAccess"] = o.GeneralAccess + } + return toSerialize, nil +} + +type NullableUpdateStoreRequest struct { + value *UpdateStoreRequest + isSet bool +} + +func (v NullableUpdateStoreRequest) Get() *UpdateStoreRequest { + return v.value +} + +func (v *NullableUpdateStoreRequest) Set(val *UpdateStoreRequest) { + v.value = val + v.isSet = true +} + +func (v NullableUpdateStoreRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableUpdateStoreRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUpdateStoreRequest(val *UpdateStoreRequest) *NullableUpdateStoreRequest { + return &NullableUpdateStoreRequest{value: val, isSet: true} +} + +func (v NullableUpdateStoreRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUpdateStoreRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_update_task_request.go b/model_update_task_request.go new file mode 100644 index 0000000..928ecff --- /dev/null +++ b/model_update_task_request.go @@ -0,0 +1,302 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" +) + +// checks if the UpdateTaskRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UpdateTaskRequest{} + +// UpdateTaskRequest struct for UpdateTaskRequest +type UpdateTaskRequest struct { + Name *string `json:"name,omitempty"` + Options NullableTaskOptions `json:"options,omitempty"` + // The input configuration for the Actor task. This is a user-defined JSON object that will be passed to the Actor when the task is run. + Input map[string]interface{} `json:"input,omitempty"` + Title NullableString `json:"title,omitempty"` + ActorStandby NullableActorStandby `json:"actorStandby,omitempty"` +} + +// NewUpdateTaskRequest instantiates a new UpdateTaskRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUpdateTaskRequest() *UpdateTaskRequest { + this := UpdateTaskRequest{} + return &this +} + +// NewUpdateTaskRequestWithDefaults instantiates a new UpdateTaskRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUpdateTaskRequestWithDefaults() *UpdateTaskRequest { + this := UpdateTaskRequest{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *UpdateTaskRequest) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateTaskRequest) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *UpdateTaskRequest) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *UpdateTaskRequest) SetName(v string) { + o.Name = &v +} + +// GetOptions returns the Options field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *UpdateTaskRequest) GetOptions() TaskOptions { + if o == nil || IsNil(o.Options.Get()) { + var ret TaskOptions + return ret + } + return *o.Options.Get() +} + +// GetOptionsOk returns a tuple with the Options field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *UpdateTaskRequest) GetOptionsOk() (*TaskOptions, bool) { + if o == nil { + return nil, false + } + return o.Options.Get(), o.Options.IsSet() +} + +// HasOptions returns a boolean if a field has been set. +func (o *UpdateTaskRequest) HasOptions() bool { + if o != nil && o.Options.IsSet() { + return true + } + + return false +} + +// SetOptions gets a reference to the given NullableTaskOptions and assigns it to the Options field. +func (o *UpdateTaskRequest) SetOptions(v TaskOptions) { + o.Options.Set(&v) +} +// SetOptionsNil sets the value for Options to be an explicit nil +func (o *UpdateTaskRequest) SetOptionsNil() { + o.Options.Set(nil) +} + +// UnsetOptions ensures that no value is present for Options, not even an explicit nil +func (o *UpdateTaskRequest) UnsetOptions() { + o.Options.Unset() +} + +// GetInput returns the Input field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *UpdateTaskRequest) GetInput() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + return o.Input +} + +// GetInputOk returns a tuple with the Input field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *UpdateTaskRequest) GetInputOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Input) { + return map[string]interface{}{}, false + } + return o.Input, true +} + +// HasInput returns a boolean if a field has been set. +func (o *UpdateTaskRequest) HasInput() bool { + if o != nil && !IsNil(o.Input) { + return true + } + + return false +} + +// SetInput gets a reference to the given map[string]interface{} and assigns it to the Input field. +func (o *UpdateTaskRequest) SetInput(v map[string]interface{}) { + o.Input = v +} + +// GetTitle returns the Title field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *UpdateTaskRequest) GetTitle() string { + if o == nil || IsNil(o.Title.Get()) { + var ret string + return ret + } + return *o.Title.Get() +} + +// GetTitleOk returns a tuple with the Title field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *UpdateTaskRequest) GetTitleOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Title.Get(), o.Title.IsSet() +} + +// HasTitle returns a boolean if a field has been set. +func (o *UpdateTaskRequest) HasTitle() bool { + if o != nil && o.Title.IsSet() { + return true + } + + return false +} + +// SetTitle gets a reference to the given NullableString and assigns it to the Title field. +func (o *UpdateTaskRequest) SetTitle(v string) { + o.Title.Set(&v) +} +// SetTitleNil sets the value for Title to be an explicit nil +func (o *UpdateTaskRequest) SetTitleNil() { + o.Title.Set(nil) +} + +// UnsetTitle ensures that no value is present for Title, not even an explicit nil +func (o *UpdateTaskRequest) UnsetTitle() { + o.Title.Unset() +} + +// GetActorStandby returns the ActorStandby field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *UpdateTaskRequest) GetActorStandby() ActorStandby { + if o == nil || IsNil(o.ActorStandby.Get()) { + var ret ActorStandby + return ret + } + return *o.ActorStandby.Get() +} + +// GetActorStandbyOk returns a tuple with the ActorStandby field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *UpdateTaskRequest) GetActorStandbyOk() (*ActorStandby, bool) { + if o == nil { + return nil, false + } + return o.ActorStandby.Get(), o.ActorStandby.IsSet() +} + +// HasActorStandby returns a boolean if a field has been set. +func (o *UpdateTaskRequest) HasActorStandby() bool { + if o != nil && o.ActorStandby.IsSet() { + return true + } + + return false +} + +// SetActorStandby gets a reference to the given NullableActorStandby and assigns it to the ActorStandby field. +func (o *UpdateTaskRequest) SetActorStandby(v ActorStandby) { + o.ActorStandby.Set(&v) +} +// SetActorStandbyNil sets the value for ActorStandby to be an explicit nil +func (o *UpdateTaskRequest) SetActorStandbyNil() { + o.ActorStandby.Set(nil) +} + +// UnsetActorStandby ensures that no value is present for ActorStandby, not even an explicit nil +func (o *UpdateTaskRequest) UnsetActorStandby() { + o.ActorStandby.Unset() +} + +func (o UpdateTaskRequest) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o UpdateTaskRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if o.Options.IsSet() { + toSerialize["options"] = o.Options.Get() + } + if o.Input != nil { + toSerialize["input"] = o.Input + } + if o.Title.IsSet() { + toSerialize["title"] = o.Title.Get() + } + if o.ActorStandby.IsSet() { + toSerialize["actorStandby"] = o.ActorStandby.Get() + } + return toSerialize, nil +} + +type NullableUpdateTaskRequest struct { + value *UpdateTaskRequest + isSet bool +} + +func (v NullableUpdateTaskRequest) Get() *UpdateTaskRequest { + return v.value +} + +func (v *NullableUpdateTaskRequest) Set(val *UpdateTaskRequest) { + v.value = val + v.isSet = true +} + +func (v NullableUpdateTaskRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableUpdateTaskRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUpdateTaskRequest(val *UpdateTaskRequest) *NullableUpdateTaskRequest { + return &NullableUpdateTaskRequest{value: val, isSet: true} +} + +func (v NullableUpdateTaskRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUpdateTaskRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_usage_cycle.go b/model_usage_cycle.go new file mode 100644 index 0000000..b7ddb75 --- /dev/null +++ b/model_usage_cycle.go @@ -0,0 +1,187 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" + "time" + "bytes" + "fmt" +) + +// checks if the UsageCycle type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UsageCycle{} + +// UsageCycle struct for UsageCycle +type UsageCycle struct { + StartAt time.Time `json:"startAt"` + EndAt time.Time `json:"endAt"` +} + +type _UsageCycle UsageCycle + +// NewUsageCycle instantiates a new UsageCycle object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUsageCycle(startAt time.Time, endAt time.Time) *UsageCycle { + this := UsageCycle{} + this.StartAt = startAt + this.EndAt = endAt + return &this +} + +// NewUsageCycleWithDefaults instantiates a new UsageCycle object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUsageCycleWithDefaults() *UsageCycle { + this := UsageCycle{} + return &this +} + +// GetStartAt returns the StartAt field value +func (o *UsageCycle) GetStartAt() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.StartAt +} + +// GetStartAtOk returns a tuple with the StartAt field value +// and a boolean to check if the value has been set. +func (o *UsageCycle) GetStartAtOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.StartAt, true +} + +// SetStartAt sets field value +func (o *UsageCycle) SetStartAt(v time.Time) { + o.StartAt = v +} + +// GetEndAt returns the EndAt field value +func (o *UsageCycle) GetEndAt() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.EndAt +} + +// GetEndAtOk returns a tuple with the EndAt field value +// and a boolean to check if the value has been set. +func (o *UsageCycle) GetEndAtOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.EndAt, true +} + +// SetEndAt sets field value +func (o *UsageCycle) SetEndAt(v time.Time) { + o.EndAt = v +} + +func (o UsageCycle) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o UsageCycle) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["startAt"] = o.StartAt + toSerialize["endAt"] = o.EndAt + return toSerialize, nil +} + +func (o *UsageCycle) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "startAt", + "endAt", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varUsageCycle := _UsageCycle{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varUsageCycle) + + if err != nil { + return err + } + + *o = UsageCycle(varUsageCycle) + + return err +} + +type NullableUsageCycle struct { + value *UsageCycle + isSet bool +} + +func (v NullableUsageCycle) Get() *UsageCycle { + return v.value +} + +func (v *NullableUsageCycle) Set(val *UsageCycle) { + v.value = val + v.isSet = true +} + +func (v NullableUsageCycle) IsSet() bool { + return v.isSet +} + +func (v *NullableUsageCycle) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUsageCycle(val *UsageCycle) *NullableUsageCycle { + return &NullableUsageCycle{value: val, isSet: true} +} + +func (v NullableUsageCycle) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUsageCycle) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_usage_item.go b/model_usage_item.go new file mode 100644 index 0000000..f763ba5 --- /dev/null +++ b/model_usage_item.go @@ -0,0 +1,295 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" + "bytes" + "fmt" +) + +// checks if the UsageItem type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UsageItem{} + +// UsageItem struct for UsageItem +type UsageItem struct { + Quantity float32 `json:"quantity"` + BaseAmountUsd float32 `json:"baseAmountUsd"` + BaseUnitPriceUsd *float32 `json:"baseUnitPriceUsd,omitempty"` + AmountAfterVolumeDiscountUsd *float32 `json:"amountAfterVolumeDiscountUsd,omitempty"` + // + PriceTiers []PriceTiers `json:"priceTiers,omitempty"` +} + +type _UsageItem UsageItem + +// NewUsageItem instantiates a new UsageItem object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUsageItem(quantity float32, baseAmountUsd float32) *UsageItem { + this := UsageItem{} + this.Quantity = quantity + this.BaseAmountUsd = baseAmountUsd + return &this +} + +// NewUsageItemWithDefaults instantiates a new UsageItem object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUsageItemWithDefaults() *UsageItem { + this := UsageItem{} + return &this +} + +// GetQuantity returns the Quantity field value +func (o *UsageItem) GetQuantity() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.Quantity +} + +// GetQuantityOk returns a tuple with the Quantity field value +// and a boolean to check if the value has been set. +func (o *UsageItem) GetQuantityOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.Quantity, true +} + +// SetQuantity sets field value +func (o *UsageItem) SetQuantity(v float32) { + o.Quantity = v +} + +// GetBaseAmountUsd returns the BaseAmountUsd field value +func (o *UsageItem) GetBaseAmountUsd() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.BaseAmountUsd +} + +// GetBaseAmountUsdOk returns a tuple with the BaseAmountUsd field value +// and a boolean to check if the value has been set. +func (o *UsageItem) GetBaseAmountUsdOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.BaseAmountUsd, true +} + +// SetBaseAmountUsd sets field value +func (o *UsageItem) SetBaseAmountUsd(v float32) { + o.BaseAmountUsd = v +} + +// GetBaseUnitPriceUsd returns the BaseUnitPriceUsd field value if set, zero value otherwise. +func (o *UsageItem) GetBaseUnitPriceUsd() float32 { + if o == nil || IsNil(o.BaseUnitPriceUsd) { + var ret float32 + return ret + } + return *o.BaseUnitPriceUsd +} + +// GetBaseUnitPriceUsdOk returns a tuple with the BaseUnitPriceUsd field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UsageItem) GetBaseUnitPriceUsdOk() (*float32, bool) { + if o == nil || IsNil(o.BaseUnitPriceUsd) { + return nil, false + } + return o.BaseUnitPriceUsd, true +} + +// HasBaseUnitPriceUsd returns a boolean if a field has been set. +func (o *UsageItem) HasBaseUnitPriceUsd() bool { + if o != nil && !IsNil(o.BaseUnitPriceUsd) { + return true + } + + return false +} + +// SetBaseUnitPriceUsd gets a reference to the given float32 and assigns it to the BaseUnitPriceUsd field. +func (o *UsageItem) SetBaseUnitPriceUsd(v float32) { + o.BaseUnitPriceUsd = &v +} + +// GetAmountAfterVolumeDiscountUsd returns the AmountAfterVolumeDiscountUsd field value if set, zero value otherwise. +func (o *UsageItem) GetAmountAfterVolumeDiscountUsd() float32 { + if o == nil || IsNil(o.AmountAfterVolumeDiscountUsd) { + var ret float32 + return ret + } + return *o.AmountAfterVolumeDiscountUsd +} + +// GetAmountAfterVolumeDiscountUsdOk returns a tuple with the AmountAfterVolumeDiscountUsd field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UsageItem) GetAmountAfterVolumeDiscountUsdOk() (*float32, bool) { + if o == nil || IsNil(o.AmountAfterVolumeDiscountUsd) { + return nil, false + } + return o.AmountAfterVolumeDiscountUsd, true +} + +// HasAmountAfterVolumeDiscountUsd returns a boolean if a field has been set. +func (o *UsageItem) HasAmountAfterVolumeDiscountUsd() bool { + if o != nil && !IsNil(o.AmountAfterVolumeDiscountUsd) { + return true + } + + return false +} + +// SetAmountAfterVolumeDiscountUsd gets a reference to the given float32 and assigns it to the AmountAfterVolumeDiscountUsd field. +func (o *UsageItem) SetAmountAfterVolumeDiscountUsd(v float32) { + o.AmountAfterVolumeDiscountUsd = &v +} + +// GetPriceTiers returns the PriceTiers field value if set, zero value otherwise. +func (o *UsageItem) GetPriceTiers() []PriceTiers { + if o == nil || IsNil(o.PriceTiers) { + var ret []PriceTiers + return ret + } + return o.PriceTiers +} + +// GetPriceTiersOk returns a tuple with the PriceTiers field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UsageItem) GetPriceTiersOk() ([]PriceTiers, bool) { + if o == nil || IsNil(o.PriceTiers) { + return nil, false + } + return o.PriceTiers, true +} + +// HasPriceTiers returns a boolean if a field has been set. +func (o *UsageItem) HasPriceTiers() bool { + if o != nil && !IsNil(o.PriceTiers) { + return true + } + + return false +} + +// SetPriceTiers gets a reference to the given []PriceTiers and assigns it to the PriceTiers field. +func (o *UsageItem) SetPriceTiers(v []PriceTiers) { + o.PriceTiers = v +} + +func (o UsageItem) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o UsageItem) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["quantity"] = o.Quantity + toSerialize["baseAmountUsd"] = o.BaseAmountUsd + if !IsNil(o.BaseUnitPriceUsd) { + toSerialize["baseUnitPriceUsd"] = o.BaseUnitPriceUsd + } + if !IsNil(o.AmountAfterVolumeDiscountUsd) { + toSerialize["amountAfterVolumeDiscountUsd"] = o.AmountAfterVolumeDiscountUsd + } + if !IsNil(o.PriceTiers) { + toSerialize["priceTiers"] = o.PriceTiers + } + return toSerialize, nil +} + +func (o *UsageItem) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "quantity", + "baseAmountUsd", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varUsageItem := _UsageItem{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varUsageItem) + + if err != nil { + return err + } + + *o = UsageItem(varUsageItem) + + return err +} + +type NullableUsageItem struct { + value *UsageItem + isSet bool +} + +func (v NullableUsageItem) Get() *UsageItem { + return v.value +} + +func (v *NullableUsageItem) Set(val *UsageItem) { + v.value = val + v.isSet = true +} + +func (v NullableUsageItem) IsSet() bool { + return v.isSet +} + +func (v *NullableUsageItem) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUsageItem(val *UsageItem) *NullableUsageItem { + return &NullableUsageItem{value: val, isSet: true} +} + +func (v NullableUsageItem) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUsageItem) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_user_private_info.go b/model_user_private_info.go new file mode 100644 index 0000000..d5cc034 --- /dev/null +++ b/model_user_private_info.go @@ -0,0 +1,383 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" + "time" + "bytes" + "fmt" +) + +// checks if the UserPrivateInfo type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UserPrivateInfo{} + +// UserPrivateInfo struct for UserPrivateInfo +type UserPrivateInfo struct { + Id string `json:"id"` + Username string `json:"username"` + Profile Profile `json:"profile"` + Email string `json:"email"` + Proxy Proxy `json:"proxy"` + Plan Plan `json:"plan"` + EffectivePlatformFeatures EffectivePlatformFeatures `json:"effectivePlatformFeatures"` + CreatedAt time.Time `json:"createdAt"` + IsPaying bool `json:"isPaying"` +} + +type _UserPrivateInfo UserPrivateInfo + +// NewUserPrivateInfo instantiates a new UserPrivateInfo object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUserPrivateInfo(id string, username string, profile Profile, email string, proxy Proxy, plan Plan, effectivePlatformFeatures EffectivePlatformFeatures, createdAt time.Time, isPaying bool) *UserPrivateInfo { + this := UserPrivateInfo{} + this.Id = id + this.Username = username + this.Profile = profile + this.Email = email + this.Proxy = proxy + this.Plan = plan + this.EffectivePlatformFeatures = effectivePlatformFeatures + this.CreatedAt = createdAt + this.IsPaying = isPaying + return &this +} + +// NewUserPrivateInfoWithDefaults instantiates a new UserPrivateInfo object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUserPrivateInfoWithDefaults() *UserPrivateInfo { + this := UserPrivateInfo{} + return &this +} + +// GetId returns the Id field value +func (o *UserPrivateInfo) GetId() string { + if o == nil { + var ret string + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *UserPrivateInfo) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *UserPrivateInfo) SetId(v string) { + o.Id = v +} + +// GetUsername returns the Username field value +func (o *UserPrivateInfo) GetUsername() string { + if o == nil { + var ret string + return ret + } + + return o.Username +} + +// GetUsernameOk returns a tuple with the Username field value +// and a boolean to check if the value has been set. +func (o *UserPrivateInfo) GetUsernameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Username, true +} + +// SetUsername sets field value +func (o *UserPrivateInfo) SetUsername(v string) { + o.Username = v +} + +// GetProfile returns the Profile field value +func (o *UserPrivateInfo) GetProfile() Profile { + if o == nil { + var ret Profile + return ret + } + + return o.Profile +} + +// GetProfileOk returns a tuple with the Profile field value +// and a boolean to check if the value has been set. +func (o *UserPrivateInfo) GetProfileOk() (*Profile, bool) { + if o == nil { + return nil, false + } + return &o.Profile, true +} + +// SetProfile sets field value +func (o *UserPrivateInfo) SetProfile(v Profile) { + o.Profile = v +} + +// GetEmail returns the Email field value +func (o *UserPrivateInfo) GetEmail() string { + if o == nil { + var ret string + return ret + } + + return o.Email +} + +// GetEmailOk returns a tuple with the Email field value +// and a boolean to check if the value has been set. +func (o *UserPrivateInfo) GetEmailOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Email, true +} + +// SetEmail sets field value +func (o *UserPrivateInfo) SetEmail(v string) { + o.Email = v +} + +// GetProxy returns the Proxy field value +func (o *UserPrivateInfo) GetProxy() Proxy { + if o == nil { + var ret Proxy + return ret + } + + return o.Proxy +} + +// GetProxyOk returns a tuple with the Proxy field value +// and a boolean to check if the value has been set. +func (o *UserPrivateInfo) GetProxyOk() (*Proxy, bool) { + if o == nil { + return nil, false + } + return &o.Proxy, true +} + +// SetProxy sets field value +func (o *UserPrivateInfo) SetProxy(v Proxy) { + o.Proxy = v +} + +// GetPlan returns the Plan field value +func (o *UserPrivateInfo) GetPlan() Plan { + if o == nil { + var ret Plan + return ret + } + + return o.Plan +} + +// GetPlanOk returns a tuple with the Plan field value +// and a boolean to check if the value has been set. +func (o *UserPrivateInfo) GetPlanOk() (*Plan, bool) { + if o == nil { + return nil, false + } + return &o.Plan, true +} + +// SetPlan sets field value +func (o *UserPrivateInfo) SetPlan(v Plan) { + o.Plan = v +} + +// GetEffectivePlatformFeatures returns the EffectivePlatformFeatures field value +func (o *UserPrivateInfo) GetEffectivePlatformFeatures() EffectivePlatformFeatures { + if o == nil { + var ret EffectivePlatformFeatures + return ret + } + + return o.EffectivePlatformFeatures +} + +// GetEffectivePlatformFeaturesOk returns a tuple with the EffectivePlatformFeatures field value +// and a boolean to check if the value has been set. +func (o *UserPrivateInfo) GetEffectivePlatformFeaturesOk() (*EffectivePlatformFeatures, bool) { + if o == nil { + return nil, false + } + return &o.EffectivePlatformFeatures, true +} + +// SetEffectivePlatformFeatures sets field value +func (o *UserPrivateInfo) SetEffectivePlatformFeatures(v EffectivePlatformFeatures) { + o.EffectivePlatformFeatures = v +} + +// GetCreatedAt returns the CreatedAt field value +func (o *UserPrivateInfo) GetCreatedAt() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value +// and a boolean to check if the value has been set. +func (o *UserPrivateInfo) GetCreatedAtOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.CreatedAt, true +} + +// SetCreatedAt sets field value +func (o *UserPrivateInfo) SetCreatedAt(v time.Time) { + o.CreatedAt = v +} + +// GetIsPaying returns the IsPaying field value +func (o *UserPrivateInfo) GetIsPaying() bool { + if o == nil { + var ret bool + return ret + } + + return o.IsPaying +} + +// GetIsPayingOk returns a tuple with the IsPaying field value +// and a boolean to check if the value has been set. +func (o *UserPrivateInfo) GetIsPayingOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.IsPaying, true +} + +// SetIsPaying sets field value +func (o *UserPrivateInfo) SetIsPaying(v bool) { + o.IsPaying = v +} + +func (o UserPrivateInfo) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o UserPrivateInfo) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["username"] = o.Username + toSerialize["profile"] = o.Profile + toSerialize["email"] = o.Email + toSerialize["proxy"] = o.Proxy + toSerialize["plan"] = o.Plan + toSerialize["effectivePlatformFeatures"] = o.EffectivePlatformFeatures + toSerialize["createdAt"] = o.CreatedAt + toSerialize["isPaying"] = o.IsPaying + return toSerialize, nil +} + +func (o *UserPrivateInfo) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "username", + "profile", + "email", + "proxy", + "plan", + "effectivePlatformFeatures", + "createdAt", + "isPaying", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varUserPrivateInfo := _UserPrivateInfo{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varUserPrivateInfo) + + if err != nil { + return err + } + + *o = UserPrivateInfo(varUserPrivateInfo) + + return err +} + +type NullableUserPrivateInfo struct { + value *UserPrivateInfo + isSet bool +} + +func (v NullableUserPrivateInfo) Get() *UserPrivateInfo { + return v.value +} + +func (v *NullableUserPrivateInfo) Set(val *UserPrivateInfo) { + v.value = val + v.isSet = true +} + +func (v NullableUserPrivateInfo) IsSet() bool { + return v.isSet +} + +func (v *NullableUserPrivateInfo) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUserPrivateInfo(val *UserPrivateInfo) *NullableUserPrivateInfo { + return &NullableUserPrivateInfo{value: val, isSet: true} +} + +func (v NullableUserPrivateInfo) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUserPrivateInfo) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_user_public_info.go b/model_user_public_info.go new file mode 100644 index 0000000..5da7484 --- /dev/null +++ b/model_user_public_info.go @@ -0,0 +1,194 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" + "bytes" + "fmt" +) + +// checks if the UserPublicInfo type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UserPublicInfo{} + +// UserPublicInfo struct for UserPublicInfo +type UserPublicInfo struct { + Username string `json:"username"` + Profile *Profile `json:"profile,omitempty"` +} + +type _UserPublicInfo UserPublicInfo + +// NewUserPublicInfo instantiates a new UserPublicInfo object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUserPublicInfo(username string) *UserPublicInfo { + this := UserPublicInfo{} + this.Username = username + return &this +} + +// NewUserPublicInfoWithDefaults instantiates a new UserPublicInfo object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUserPublicInfoWithDefaults() *UserPublicInfo { + this := UserPublicInfo{} + return &this +} + +// GetUsername returns the Username field value +func (o *UserPublicInfo) GetUsername() string { + if o == nil { + var ret string + return ret + } + + return o.Username +} + +// GetUsernameOk returns a tuple with the Username field value +// and a boolean to check if the value has been set. +func (o *UserPublicInfo) GetUsernameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Username, true +} + +// SetUsername sets field value +func (o *UserPublicInfo) SetUsername(v string) { + o.Username = v +} + +// GetProfile returns the Profile field value if set, zero value otherwise. +func (o *UserPublicInfo) GetProfile() Profile { + if o == nil || IsNil(o.Profile) { + var ret Profile + return ret + } + return *o.Profile +} + +// GetProfileOk returns a tuple with the Profile field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UserPublicInfo) GetProfileOk() (*Profile, bool) { + if o == nil || IsNil(o.Profile) { + return nil, false + } + return o.Profile, true +} + +// HasProfile returns a boolean if a field has been set. +func (o *UserPublicInfo) HasProfile() bool { + if o != nil && !IsNil(o.Profile) { + return true + } + + return false +} + +// SetProfile gets a reference to the given Profile and assigns it to the Profile field. +func (o *UserPublicInfo) SetProfile(v Profile) { + o.Profile = &v +} + +func (o UserPublicInfo) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o UserPublicInfo) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["username"] = o.Username + if !IsNil(o.Profile) { + toSerialize["profile"] = o.Profile + } + return toSerialize, nil +} + +func (o *UserPublicInfo) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "username", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varUserPublicInfo := _UserPublicInfo{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varUserPublicInfo) + + if err != nil { + return err + } + + *o = UserPublicInfo(varUserPublicInfo) + + return err +} + +type NullableUserPublicInfo struct { + value *UserPublicInfo + isSet bool +} + +func (v NullableUserPublicInfo) Get() *UserPublicInfo { + return v.value +} + +func (v *NullableUserPublicInfo) Set(val *UserPublicInfo) { + v.value = val + v.isSet = true +} + +func (v NullableUserPublicInfo) IsSet() bool { + return v.isSet +} + +func (v *NullableUserPublicInfo) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUserPublicInfo(val *UserPublicInfo) *NullableUserPublicInfo { + return &NullableUserPublicInfo{value: val, isSet: true} +} + +func (v NullableUserPublicInfo) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUserPublicInfo) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_validation_error.go b/model_validation_error.go new file mode 100644 index 0000000..79d2459 --- /dev/null +++ b/model_validation_error.go @@ -0,0 +1,275 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" +) + +// checks if the ValidationError type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ValidationError{} + +// ValidationError struct for ValidationError +type ValidationError struct { + // The path to the instance being validated. + InstancePath *string `json:"instancePath,omitempty"` + // The path to the schema that failed the validation. + SchemaPath *string `json:"schemaPath,omitempty"` + // The validation keyword that caused the error. + Keyword *string `json:"keyword,omitempty"` + // A message describing the validation error. + Message *string `json:"message,omitempty"` + // Additional parameters specific to the validation error. + Params map[string]interface{} `json:"params,omitempty"` +} + +// NewValidationError instantiates a new ValidationError object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewValidationError() *ValidationError { + this := ValidationError{} + return &this +} + +// NewValidationErrorWithDefaults instantiates a new ValidationError object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewValidationErrorWithDefaults() *ValidationError { + this := ValidationError{} + return &this +} + +// GetInstancePath returns the InstancePath field value if set, zero value otherwise. +func (o *ValidationError) GetInstancePath() string { + if o == nil || IsNil(o.InstancePath) { + var ret string + return ret + } + return *o.InstancePath +} + +// GetInstancePathOk returns a tuple with the InstancePath field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ValidationError) GetInstancePathOk() (*string, bool) { + if o == nil || IsNil(o.InstancePath) { + return nil, false + } + return o.InstancePath, true +} + +// HasInstancePath returns a boolean if a field has been set. +func (o *ValidationError) HasInstancePath() bool { + if o != nil && !IsNil(o.InstancePath) { + return true + } + + return false +} + +// SetInstancePath gets a reference to the given string and assigns it to the InstancePath field. +func (o *ValidationError) SetInstancePath(v string) { + o.InstancePath = &v +} + +// GetSchemaPath returns the SchemaPath field value if set, zero value otherwise. +func (o *ValidationError) GetSchemaPath() string { + if o == nil || IsNil(o.SchemaPath) { + var ret string + return ret + } + return *o.SchemaPath +} + +// GetSchemaPathOk returns a tuple with the SchemaPath field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ValidationError) GetSchemaPathOk() (*string, bool) { + if o == nil || IsNil(o.SchemaPath) { + return nil, false + } + return o.SchemaPath, true +} + +// HasSchemaPath returns a boolean if a field has been set. +func (o *ValidationError) HasSchemaPath() bool { + if o != nil && !IsNil(o.SchemaPath) { + return true + } + + return false +} + +// SetSchemaPath gets a reference to the given string and assigns it to the SchemaPath field. +func (o *ValidationError) SetSchemaPath(v string) { + o.SchemaPath = &v +} + +// GetKeyword returns the Keyword field value if set, zero value otherwise. +func (o *ValidationError) GetKeyword() string { + if o == nil || IsNil(o.Keyword) { + var ret string + return ret + } + return *o.Keyword +} + +// GetKeywordOk returns a tuple with the Keyword field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ValidationError) GetKeywordOk() (*string, bool) { + if o == nil || IsNil(o.Keyword) { + return nil, false + } + return o.Keyword, true +} + +// HasKeyword returns a boolean if a field has been set. +func (o *ValidationError) HasKeyword() bool { + if o != nil && !IsNil(o.Keyword) { + return true + } + + return false +} + +// SetKeyword gets a reference to the given string and assigns it to the Keyword field. +func (o *ValidationError) SetKeyword(v string) { + o.Keyword = &v +} + +// GetMessage returns the Message field value if set, zero value otherwise. +func (o *ValidationError) GetMessage() string { + if o == nil || IsNil(o.Message) { + var ret string + return ret + } + return *o.Message +} + +// GetMessageOk returns a tuple with the Message field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ValidationError) GetMessageOk() (*string, bool) { + if o == nil || IsNil(o.Message) { + return nil, false + } + return o.Message, true +} + +// HasMessage returns a boolean if a field has been set. +func (o *ValidationError) HasMessage() bool { + if o != nil && !IsNil(o.Message) { + return true + } + + return false +} + +// SetMessage gets a reference to the given string and assigns it to the Message field. +func (o *ValidationError) SetMessage(v string) { + o.Message = &v +} + +// GetParams returns the Params field value if set, zero value otherwise. +func (o *ValidationError) GetParams() map[string]interface{} { + if o == nil || IsNil(o.Params) { + var ret map[string]interface{} + return ret + } + return o.Params +} + +// GetParamsOk returns a tuple with the Params field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ValidationError) GetParamsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Params) { + return map[string]interface{}{}, false + } + return o.Params, true +} + +// HasParams returns a boolean if a field has been set. +func (o *ValidationError) HasParams() bool { + if o != nil && !IsNil(o.Params) { + return true + } + + return false +} + +// SetParams gets a reference to the given map[string]interface{} and assigns it to the Params field. +func (o *ValidationError) SetParams(v map[string]interface{}) { + o.Params = v +} + +func (o ValidationError) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ValidationError) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.InstancePath) { + toSerialize["instancePath"] = o.InstancePath + } + if !IsNil(o.SchemaPath) { + toSerialize["schemaPath"] = o.SchemaPath + } + if !IsNil(o.Keyword) { + toSerialize["keyword"] = o.Keyword + } + if !IsNil(o.Message) { + toSerialize["message"] = o.Message + } + if !IsNil(o.Params) { + toSerialize["params"] = o.Params + } + return toSerialize, nil +} + +type NullableValidationError struct { + value *ValidationError + isSet bool +} + +func (v NullableValidationError) Get() *ValidationError { + return v.value +} + +func (v *NullableValidationError) Set(val *ValidationError) { + v.value = val + v.isSet = true +} + +func (v NullableValidationError) IsSet() bool { + return v.isSet +} + +func (v *NullableValidationError) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableValidationError(val *ValidationError) *NullableValidationError { + return &NullableValidationError{value: val, isSet: true} +} + +func (v NullableValidationError) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableValidationError) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_version.go b/model_version.go new file mode 100644 index 0000000..7ccd5f9 --- /dev/null +++ b/model_version.go @@ -0,0 +1,485 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" + "bytes" + "fmt" +) + +// checks if the Version type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Version{} + +// Version struct for Version +type Version struct { + VersionNumber string `json:"versionNumber" validate:"regexp=^([0-9]|[1-9][0-9])\\\\.([0-9]|[1-9][0-9])$"` + SourceType NullableVersionSourceType `json:"sourceType"` + // + EnvVars []EnvVar `json:"envVars,omitempty"` + ApplyEnvVarsToBuild NullableBool `json:"applyEnvVarsToBuild,omitempty"` + BuildTag *string `json:"buildTag,omitempty"` + SourceFiles []VersionSourceFilesInner `json:"sourceFiles,omitempty"` + // URL of the Git repository when sourceType is GIT_REPO. + GitRepoUrl NullableString `json:"gitRepoUrl,omitempty"` + // URL of the tarball when sourceType is TARBALL. + TarballUrl NullableString `json:"tarballUrl,omitempty"` + // URL of the GitHub Gist when sourceType is GITHUB_GIST. + GitHubGistUrl NullableString `json:"gitHubGistUrl,omitempty"` +} + +type _Version Version + +// NewVersion instantiates a new Version object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewVersion(versionNumber string, sourceType NullableVersionSourceType) *Version { + this := Version{} + this.VersionNumber = versionNumber + this.SourceType = sourceType + return &this +} + +// NewVersionWithDefaults instantiates a new Version object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewVersionWithDefaults() *Version { + this := Version{} + return &this +} + +// GetVersionNumber returns the VersionNumber field value +func (o *Version) GetVersionNumber() string { + if o == nil { + var ret string + return ret + } + + return o.VersionNumber +} + +// GetVersionNumberOk returns a tuple with the VersionNumber field value +// and a boolean to check if the value has been set. +func (o *Version) GetVersionNumberOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.VersionNumber, true +} + +// SetVersionNumber sets field value +func (o *Version) SetVersionNumber(v string) { + o.VersionNumber = v +} + +// GetSourceType returns the SourceType field value +// If the value is explicit nil, the zero value for VersionSourceType will be returned +func (o *Version) GetSourceType() VersionSourceType { + if o == nil || o.SourceType.Get() == nil { + var ret VersionSourceType + return ret + } + + return *o.SourceType.Get() +} + +// GetSourceTypeOk returns a tuple with the SourceType field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Version) GetSourceTypeOk() (*VersionSourceType, bool) { + if o == nil { + return nil, false + } + return o.SourceType.Get(), o.SourceType.IsSet() +} + +// SetSourceType sets field value +func (o *Version) SetSourceType(v VersionSourceType) { + o.SourceType.Set(&v) +} + +// GetEnvVars returns the EnvVars field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Version) GetEnvVars() []EnvVar { + if o == nil { + var ret []EnvVar + return ret + } + return o.EnvVars +} + +// GetEnvVarsOk returns a tuple with the EnvVars field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Version) GetEnvVarsOk() ([]EnvVar, bool) { + if o == nil || IsNil(o.EnvVars) { + return nil, false + } + return o.EnvVars, true +} + +// HasEnvVars returns a boolean if a field has been set. +func (o *Version) HasEnvVars() bool { + if o != nil && !IsNil(o.EnvVars) { + return true + } + + return false +} + +// SetEnvVars gets a reference to the given []EnvVar and assigns it to the EnvVars field. +func (o *Version) SetEnvVars(v []EnvVar) { + o.EnvVars = v +} + +// GetApplyEnvVarsToBuild returns the ApplyEnvVarsToBuild field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Version) GetApplyEnvVarsToBuild() bool { + if o == nil || IsNil(o.ApplyEnvVarsToBuild.Get()) { + var ret bool + return ret + } + return *o.ApplyEnvVarsToBuild.Get() +} + +// GetApplyEnvVarsToBuildOk returns a tuple with the ApplyEnvVarsToBuild field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Version) GetApplyEnvVarsToBuildOk() (*bool, bool) { + if o == nil { + return nil, false + } + return o.ApplyEnvVarsToBuild.Get(), o.ApplyEnvVarsToBuild.IsSet() +} + +// HasApplyEnvVarsToBuild returns a boolean if a field has been set. +func (o *Version) HasApplyEnvVarsToBuild() bool { + if o != nil && o.ApplyEnvVarsToBuild.IsSet() { + return true + } + + return false +} + +// SetApplyEnvVarsToBuild gets a reference to the given NullableBool and assigns it to the ApplyEnvVarsToBuild field. +func (o *Version) SetApplyEnvVarsToBuild(v bool) { + o.ApplyEnvVarsToBuild.Set(&v) +} +// SetApplyEnvVarsToBuildNil sets the value for ApplyEnvVarsToBuild to be an explicit nil +func (o *Version) SetApplyEnvVarsToBuildNil() { + o.ApplyEnvVarsToBuild.Set(nil) +} + +// UnsetApplyEnvVarsToBuild ensures that no value is present for ApplyEnvVarsToBuild, not even an explicit nil +func (o *Version) UnsetApplyEnvVarsToBuild() { + o.ApplyEnvVarsToBuild.Unset() +} + +// GetBuildTag returns the BuildTag field value if set, zero value otherwise. +func (o *Version) GetBuildTag() string { + if o == nil || IsNil(o.BuildTag) { + var ret string + return ret + } + return *o.BuildTag +} + +// GetBuildTagOk returns a tuple with the BuildTag field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Version) GetBuildTagOk() (*string, bool) { + if o == nil || IsNil(o.BuildTag) { + return nil, false + } + return o.BuildTag, true +} + +// HasBuildTag returns a boolean if a field has been set. +func (o *Version) HasBuildTag() bool { + if o != nil && !IsNil(o.BuildTag) { + return true + } + + return false +} + +// SetBuildTag gets a reference to the given string and assigns it to the BuildTag field. +func (o *Version) SetBuildTag(v string) { + o.BuildTag = &v +} + +// GetSourceFiles returns the SourceFiles field value if set, zero value otherwise. +func (o *Version) GetSourceFiles() []VersionSourceFilesInner { + if o == nil || IsNil(o.SourceFiles) { + var ret []VersionSourceFilesInner + return ret + } + return o.SourceFiles +} + +// GetSourceFilesOk returns a tuple with the SourceFiles field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Version) GetSourceFilesOk() ([]VersionSourceFilesInner, bool) { + if o == nil || IsNil(o.SourceFiles) { + return nil, false + } + return o.SourceFiles, true +} + +// HasSourceFiles returns a boolean if a field has been set. +func (o *Version) HasSourceFiles() bool { + if o != nil && !IsNil(o.SourceFiles) { + return true + } + + return false +} + +// SetSourceFiles gets a reference to the given []VersionSourceFilesInner and assigns it to the SourceFiles field. +func (o *Version) SetSourceFiles(v []VersionSourceFilesInner) { + o.SourceFiles = v +} + +// GetGitRepoUrl returns the GitRepoUrl field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Version) GetGitRepoUrl() string { + if o == nil || IsNil(o.GitRepoUrl.Get()) { + var ret string + return ret + } + return *o.GitRepoUrl.Get() +} + +// GetGitRepoUrlOk returns a tuple with the GitRepoUrl field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Version) GetGitRepoUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.GitRepoUrl.Get(), o.GitRepoUrl.IsSet() +} + +// HasGitRepoUrl returns a boolean if a field has been set. +func (o *Version) HasGitRepoUrl() bool { + if o != nil && o.GitRepoUrl.IsSet() { + return true + } + + return false +} + +// SetGitRepoUrl gets a reference to the given NullableString and assigns it to the GitRepoUrl field. +func (o *Version) SetGitRepoUrl(v string) { + o.GitRepoUrl.Set(&v) +} +// SetGitRepoUrlNil sets the value for GitRepoUrl to be an explicit nil +func (o *Version) SetGitRepoUrlNil() { + o.GitRepoUrl.Set(nil) +} + +// UnsetGitRepoUrl ensures that no value is present for GitRepoUrl, not even an explicit nil +func (o *Version) UnsetGitRepoUrl() { + o.GitRepoUrl.Unset() +} + +// GetTarballUrl returns the TarballUrl field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Version) GetTarballUrl() string { + if o == nil || IsNil(o.TarballUrl.Get()) { + var ret string + return ret + } + return *o.TarballUrl.Get() +} + +// GetTarballUrlOk returns a tuple with the TarballUrl field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Version) GetTarballUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.TarballUrl.Get(), o.TarballUrl.IsSet() +} + +// HasTarballUrl returns a boolean if a field has been set. +func (o *Version) HasTarballUrl() bool { + if o != nil && o.TarballUrl.IsSet() { + return true + } + + return false +} + +// SetTarballUrl gets a reference to the given NullableString and assigns it to the TarballUrl field. +func (o *Version) SetTarballUrl(v string) { + o.TarballUrl.Set(&v) +} +// SetTarballUrlNil sets the value for TarballUrl to be an explicit nil +func (o *Version) SetTarballUrlNil() { + o.TarballUrl.Set(nil) +} + +// UnsetTarballUrl ensures that no value is present for TarballUrl, not even an explicit nil +func (o *Version) UnsetTarballUrl() { + o.TarballUrl.Unset() +} + +// GetGitHubGistUrl returns the GitHubGistUrl field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Version) GetGitHubGistUrl() string { + if o == nil || IsNil(o.GitHubGistUrl.Get()) { + var ret string + return ret + } + return *o.GitHubGistUrl.Get() +} + +// GetGitHubGistUrlOk returns a tuple with the GitHubGistUrl field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Version) GetGitHubGistUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.GitHubGistUrl.Get(), o.GitHubGistUrl.IsSet() +} + +// HasGitHubGistUrl returns a boolean if a field has been set. +func (o *Version) HasGitHubGistUrl() bool { + if o != nil && o.GitHubGistUrl.IsSet() { + return true + } + + return false +} + +// SetGitHubGistUrl gets a reference to the given NullableString and assigns it to the GitHubGistUrl field. +func (o *Version) SetGitHubGistUrl(v string) { + o.GitHubGistUrl.Set(&v) +} +// SetGitHubGistUrlNil sets the value for GitHubGistUrl to be an explicit nil +func (o *Version) SetGitHubGistUrlNil() { + o.GitHubGistUrl.Set(nil) +} + +// UnsetGitHubGistUrl ensures that no value is present for GitHubGistUrl, not even an explicit nil +func (o *Version) UnsetGitHubGistUrl() { + o.GitHubGistUrl.Unset() +} + +func (o Version) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Version) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["versionNumber"] = o.VersionNumber + toSerialize["sourceType"] = o.SourceType.Get() + if o.EnvVars != nil { + toSerialize["envVars"] = o.EnvVars + } + if o.ApplyEnvVarsToBuild.IsSet() { + toSerialize["applyEnvVarsToBuild"] = o.ApplyEnvVarsToBuild.Get() + } + if !IsNil(o.BuildTag) { + toSerialize["buildTag"] = o.BuildTag + } + if !IsNil(o.SourceFiles) { + toSerialize["sourceFiles"] = o.SourceFiles + } + if o.GitRepoUrl.IsSet() { + toSerialize["gitRepoUrl"] = o.GitRepoUrl.Get() + } + if o.TarballUrl.IsSet() { + toSerialize["tarballUrl"] = o.TarballUrl.Get() + } + if o.GitHubGistUrl.IsSet() { + toSerialize["gitHubGistUrl"] = o.GitHubGistUrl.Get() + } + return toSerialize, nil +} + +func (o *Version) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "versionNumber", + "sourceType", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varVersion := _Version{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varVersion) + + if err != nil { + return err + } + + *o = Version(varVersion) + + return err +} + +type NullableVersion struct { + value *Version + isSet bool +} + +func (v NullableVersion) Get() *Version { + return v.value +} + +func (v *NullableVersion) Set(val *Version) { + v.value = val + v.isSet = true +} + +func (v NullableVersion) IsSet() bool { + return v.isSet +} + +func (v *NullableVersion) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableVersion(val *Version) *NullableVersion { + return &NullableVersion{value: val, isSet: true} +} + +func (v NullableVersion) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableVersion) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_version_response.go b/model_version_response.go new file mode 100644 index 0000000..12cb4ae --- /dev/null +++ b/model_version_response.go @@ -0,0 +1,158 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" + "bytes" + "fmt" +) + +// checks if the VersionResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &VersionResponse{} + +// VersionResponse struct for VersionResponse +type VersionResponse struct { + Data Version `json:"data"` +} + +type _VersionResponse VersionResponse + +// NewVersionResponse instantiates a new VersionResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewVersionResponse(data Version) *VersionResponse { + this := VersionResponse{} + this.Data = data + return &this +} + +// NewVersionResponseWithDefaults instantiates a new VersionResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewVersionResponseWithDefaults() *VersionResponse { + this := VersionResponse{} + return &this +} + +// GetData returns the Data field value +func (o *VersionResponse) GetData() Version { + if o == nil { + var ret Version + return ret + } + + return o.Data +} + +// GetDataOk returns a tuple with the Data field value +// and a boolean to check if the value has been set. +func (o *VersionResponse) GetDataOk() (*Version, bool) { + if o == nil { + return nil, false + } + return &o.Data, true +} + +// SetData sets field value +func (o *VersionResponse) SetData(v Version) { + o.Data = v +} + +func (o VersionResponse) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o VersionResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["data"] = o.Data + return toSerialize, nil +} + +func (o *VersionResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "data", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varVersionResponse := _VersionResponse{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varVersionResponse) + + if err != nil { + return err + } + + *o = VersionResponse(varVersionResponse) + + return err +} + +type NullableVersionResponse struct { + value *VersionResponse + isSet bool +} + +func (v NullableVersionResponse) Get() *VersionResponse { + return v.value +} + +func (v *NullableVersionResponse) Set(val *VersionResponse) { + v.value = val + v.isSet = true +} + +func (v NullableVersionResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableVersionResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableVersionResponse(val *VersionResponse) *NullableVersionResponse { + return &NullableVersionResponse{value: val, isSet: true} +} + +func (v NullableVersionResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableVersionResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_version_source_files_inner.go b/model_version_source_files_inner.go new file mode 100644 index 0000000..1db6552 --- /dev/null +++ b/model_version_source_files_inner.go @@ -0,0 +1,107 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" + "fmt" +) + + +// VersionSourceFilesInner struct for VersionSourceFilesInner +type VersionSourceFilesInner struct { + SourceCodeFile *SourceCodeFile + SourceCodeFolder *SourceCodeFolder +} + +// Unmarshal JSON data into any of the pointers in the struct +func (dst *VersionSourceFilesInner) UnmarshalJSON(data []byte) error { + var err error + // try to unmarshal JSON data into SourceCodeFile + err = json.Unmarshal(data, &dst.SourceCodeFile); + if err == nil { + jsonSourceCodeFile, _ := json.Marshal(dst.SourceCodeFile) + if string(jsonSourceCodeFile) == "{}" { // empty struct + dst.SourceCodeFile = nil + } else { + return nil // data stored in dst.SourceCodeFile, return on the first match + } + } else { + dst.SourceCodeFile = nil + } + + // try to unmarshal JSON data into SourceCodeFolder + err = json.Unmarshal(data, &dst.SourceCodeFolder); + if err == nil { + jsonSourceCodeFolder, _ := json.Marshal(dst.SourceCodeFolder) + if string(jsonSourceCodeFolder) == "{}" { // empty struct + dst.SourceCodeFolder = nil + } else { + return nil // data stored in dst.SourceCodeFolder, return on the first match + } + } else { + dst.SourceCodeFolder = nil + } + + return fmt.Errorf("data failed to match schemas in anyOf(VersionSourceFilesInner)") +} + +// Marshal data from the first non-nil pointers in the struct to JSON +func (src VersionSourceFilesInner) MarshalJSON() ([]byte, error) { + if src.SourceCodeFile != nil { + return json.Marshal(&src.SourceCodeFile) + } + + if src.SourceCodeFolder != nil { + return json.Marshal(&src.SourceCodeFolder) + } + + return nil, nil // no data in anyOf schemas +} + + +type NullableVersionSourceFilesInner struct { + value *VersionSourceFilesInner + isSet bool +} + +func (v NullableVersionSourceFilesInner) Get() *VersionSourceFilesInner { + return v.value +} + +func (v *NullableVersionSourceFilesInner) Set(val *VersionSourceFilesInner) { + v.value = val + v.isSet = true +} + +func (v NullableVersionSourceFilesInner) IsSet() bool { + return v.isSet +} + +func (v *NullableVersionSourceFilesInner) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableVersionSourceFilesInner(val *VersionSourceFilesInner) *NullableVersionSourceFilesInner { + return &NullableVersionSourceFilesInner{value: val, isSet: true} +} + +func (v NullableVersionSourceFilesInner) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableVersionSourceFilesInner) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_version_source_type.go b/model_version_source_type.go new file mode 100644 index 0000000..2c64a20 --- /dev/null +++ b/model_version_source_type.go @@ -0,0 +1,117 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" + "fmt" +) + +// VersionSourceType the model 'VersionSourceType' +type VersionSourceType string + +// List of VersionSourceType +const ( + SOURCE_FILES VersionSourceType = "SOURCE_FILES" + GIT_REPO VersionSourceType = "GIT_REPO" + TARBALL VersionSourceType = "TARBALL" + GITHUB_GIST VersionSourceType = "GITHUB_GIST" + SOURCE_CODE VersionSourceType = "SOURCE_CODE" +) + +// All allowed values of VersionSourceType enum +var AllowedVersionSourceTypeEnumValues = []VersionSourceType{ + "SOURCE_FILES", + "GIT_REPO", + "TARBALL", + "GITHUB_GIST", + "SOURCE_CODE", +} + +func (v *VersionSourceType) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := VersionSourceType(value) + for _, existing := range AllowedVersionSourceTypeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid VersionSourceType", value) +} + +// NewVersionSourceTypeFromValue returns a pointer to a valid VersionSourceType +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewVersionSourceTypeFromValue(v string) (*VersionSourceType, error) { + ev := VersionSourceType(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for VersionSourceType: valid values are %v", v, AllowedVersionSourceTypeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v VersionSourceType) IsValid() bool { + for _, existing := range AllowedVersionSourceTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to VersionSourceType value +func (v VersionSourceType) Ptr() *VersionSourceType { + return &v +} + +type NullableVersionSourceType struct { + value *VersionSourceType + isSet bool +} + +func (v NullableVersionSourceType) Get() *VersionSourceType { + return v.value +} + +func (v *NullableVersionSourceType) Set(val *VersionSourceType) { + v.value = val + v.isSet = true +} + +func (v NullableVersionSourceType) IsSet() bool { + return v.isSet +} + +func (v *NullableVersionSourceType) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableVersionSourceType(val *VersionSourceType) *NullableVersionSourceType { + return &NullableVersionSourceType{value: val, isSet: true} +} + +func (v NullableVersionSourceType) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableVersionSourceType) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + diff --git a/model_webhook.go b/model_webhook.go new file mode 100644 index 0000000..4cd1adf --- /dev/null +++ b/model_webhook.go @@ -0,0 +1,723 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" + "time" + "bytes" + "fmt" +) + +// checks if the Webhook type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Webhook{} + +// Webhook struct for Webhook +type Webhook struct { + Id string `json:"id"` + CreatedAt time.Time `json:"createdAt"` + ModifiedAt time.Time `json:"modifiedAt"` + UserId string `json:"userId"` + IsAdHoc NullableBool `json:"isAdHoc,omitempty"` + ShouldInterpolateStrings NullableBool `json:"shouldInterpolateStrings,omitempty"` + EventTypes []WebhookEventType `json:"eventTypes"` + Condition WebhookCondition `json:"condition"` + IgnoreSslErrors bool `json:"ignoreSslErrors"` + DoNotRetry NullableBool `json:"doNotRetry,omitempty"` + RequestUrl string `json:"requestUrl"` + PayloadTemplate NullableString `json:"payloadTemplate,omitempty"` + HeadersTemplate NullableString `json:"headersTemplate,omitempty"` + Description NullableString `json:"description,omitempty"` + LastDispatch NullableExampleWebhookDispatch `json:"lastDispatch,omitempty"` + Stats NullableWebhookStats `json:"stats,omitempty"` +} + +type _Webhook Webhook + +// NewWebhook instantiates a new Webhook object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewWebhook(id string, createdAt time.Time, modifiedAt time.Time, userId string, eventTypes []WebhookEventType, condition WebhookCondition, ignoreSslErrors bool, requestUrl string) *Webhook { + this := Webhook{} + this.Id = id + this.CreatedAt = createdAt + this.ModifiedAt = modifiedAt + this.UserId = userId + this.EventTypes = eventTypes + this.Condition = condition + this.IgnoreSslErrors = ignoreSslErrors + this.RequestUrl = requestUrl + return &this +} + +// NewWebhookWithDefaults instantiates a new Webhook object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWebhookWithDefaults() *Webhook { + this := Webhook{} + return &this +} + +// GetId returns the Id field value +func (o *Webhook) GetId() string { + if o == nil { + var ret string + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *Webhook) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *Webhook) SetId(v string) { + o.Id = v +} + +// GetCreatedAt returns the CreatedAt field value +func (o *Webhook) GetCreatedAt() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value +// and a boolean to check if the value has been set. +func (o *Webhook) GetCreatedAtOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.CreatedAt, true +} + +// SetCreatedAt sets field value +func (o *Webhook) SetCreatedAt(v time.Time) { + o.CreatedAt = v +} + +// GetModifiedAt returns the ModifiedAt field value +func (o *Webhook) GetModifiedAt() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.ModifiedAt +} + +// GetModifiedAtOk returns a tuple with the ModifiedAt field value +// and a boolean to check if the value has been set. +func (o *Webhook) GetModifiedAtOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.ModifiedAt, true +} + +// SetModifiedAt sets field value +func (o *Webhook) SetModifiedAt(v time.Time) { + o.ModifiedAt = v +} + +// GetUserId returns the UserId field value +func (o *Webhook) GetUserId() string { + if o == nil { + var ret string + return ret + } + + return o.UserId +} + +// GetUserIdOk returns a tuple with the UserId field value +// and a boolean to check if the value has been set. +func (o *Webhook) GetUserIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.UserId, true +} + +// SetUserId sets field value +func (o *Webhook) SetUserId(v string) { + o.UserId = v +} + +// GetIsAdHoc returns the IsAdHoc field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Webhook) GetIsAdHoc() bool { + if o == nil || IsNil(o.IsAdHoc.Get()) { + var ret bool + return ret + } + return *o.IsAdHoc.Get() +} + +// GetIsAdHocOk returns a tuple with the IsAdHoc field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Webhook) GetIsAdHocOk() (*bool, bool) { + if o == nil { + return nil, false + } + return o.IsAdHoc.Get(), o.IsAdHoc.IsSet() +} + +// HasIsAdHoc returns a boolean if a field has been set. +func (o *Webhook) HasIsAdHoc() bool { + if o != nil && o.IsAdHoc.IsSet() { + return true + } + + return false +} + +// SetIsAdHoc gets a reference to the given NullableBool and assigns it to the IsAdHoc field. +func (o *Webhook) SetIsAdHoc(v bool) { + o.IsAdHoc.Set(&v) +} +// SetIsAdHocNil sets the value for IsAdHoc to be an explicit nil +func (o *Webhook) SetIsAdHocNil() { + o.IsAdHoc.Set(nil) +} + +// UnsetIsAdHoc ensures that no value is present for IsAdHoc, not even an explicit nil +func (o *Webhook) UnsetIsAdHoc() { + o.IsAdHoc.Unset() +} + +// GetShouldInterpolateStrings returns the ShouldInterpolateStrings field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Webhook) GetShouldInterpolateStrings() bool { + if o == nil || IsNil(o.ShouldInterpolateStrings.Get()) { + var ret bool + return ret + } + return *o.ShouldInterpolateStrings.Get() +} + +// GetShouldInterpolateStringsOk returns a tuple with the ShouldInterpolateStrings field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Webhook) GetShouldInterpolateStringsOk() (*bool, bool) { + if o == nil { + return nil, false + } + return o.ShouldInterpolateStrings.Get(), o.ShouldInterpolateStrings.IsSet() +} + +// HasShouldInterpolateStrings returns a boolean if a field has been set. +func (o *Webhook) HasShouldInterpolateStrings() bool { + if o != nil && o.ShouldInterpolateStrings.IsSet() { + return true + } + + return false +} + +// SetShouldInterpolateStrings gets a reference to the given NullableBool and assigns it to the ShouldInterpolateStrings field. +func (o *Webhook) SetShouldInterpolateStrings(v bool) { + o.ShouldInterpolateStrings.Set(&v) +} +// SetShouldInterpolateStringsNil sets the value for ShouldInterpolateStrings to be an explicit nil +func (o *Webhook) SetShouldInterpolateStringsNil() { + o.ShouldInterpolateStrings.Set(nil) +} + +// UnsetShouldInterpolateStrings ensures that no value is present for ShouldInterpolateStrings, not even an explicit nil +func (o *Webhook) UnsetShouldInterpolateStrings() { + o.ShouldInterpolateStrings.Unset() +} + +// GetEventTypes returns the EventTypes field value +func (o *Webhook) GetEventTypes() []WebhookEventType { + if o == nil { + var ret []WebhookEventType + return ret + } + + return o.EventTypes +} + +// GetEventTypesOk returns a tuple with the EventTypes field value +// and a boolean to check if the value has been set. +func (o *Webhook) GetEventTypesOk() ([]WebhookEventType, bool) { + if o == nil { + return nil, false + } + return o.EventTypes, true +} + +// SetEventTypes sets field value +func (o *Webhook) SetEventTypes(v []WebhookEventType) { + o.EventTypes = v +} + +// GetCondition returns the Condition field value +func (o *Webhook) GetCondition() WebhookCondition { + if o == nil { + var ret WebhookCondition + return ret + } + + return o.Condition +} + +// GetConditionOk returns a tuple with the Condition field value +// and a boolean to check if the value has been set. +func (o *Webhook) GetConditionOk() (*WebhookCondition, bool) { + if o == nil { + return nil, false + } + return &o.Condition, true +} + +// SetCondition sets field value +func (o *Webhook) SetCondition(v WebhookCondition) { + o.Condition = v +} + +// GetIgnoreSslErrors returns the IgnoreSslErrors field value +func (o *Webhook) GetIgnoreSslErrors() bool { + if o == nil { + var ret bool + return ret + } + + return o.IgnoreSslErrors +} + +// GetIgnoreSslErrorsOk returns a tuple with the IgnoreSslErrors field value +// and a boolean to check if the value has been set. +func (o *Webhook) GetIgnoreSslErrorsOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.IgnoreSslErrors, true +} + +// SetIgnoreSslErrors sets field value +func (o *Webhook) SetIgnoreSslErrors(v bool) { + o.IgnoreSslErrors = v +} + +// GetDoNotRetry returns the DoNotRetry field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Webhook) GetDoNotRetry() bool { + if o == nil || IsNil(o.DoNotRetry.Get()) { + var ret bool + return ret + } + return *o.DoNotRetry.Get() +} + +// GetDoNotRetryOk returns a tuple with the DoNotRetry field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Webhook) GetDoNotRetryOk() (*bool, bool) { + if o == nil { + return nil, false + } + return o.DoNotRetry.Get(), o.DoNotRetry.IsSet() +} + +// HasDoNotRetry returns a boolean if a field has been set. +func (o *Webhook) HasDoNotRetry() bool { + if o != nil && o.DoNotRetry.IsSet() { + return true + } + + return false +} + +// SetDoNotRetry gets a reference to the given NullableBool and assigns it to the DoNotRetry field. +func (o *Webhook) SetDoNotRetry(v bool) { + o.DoNotRetry.Set(&v) +} +// SetDoNotRetryNil sets the value for DoNotRetry to be an explicit nil +func (o *Webhook) SetDoNotRetryNil() { + o.DoNotRetry.Set(nil) +} + +// UnsetDoNotRetry ensures that no value is present for DoNotRetry, not even an explicit nil +func (o *Webhook) UnsetDoNotRetry() { + o.DoNotRetry.Unset() +} + +// GetRequestUrl returns the RequestUrl field value +func (o *Webhook) GetRequestUrl() string { + if o == nil { + var ret string + return ret + } + + return o.RequestUrl +} + +// GetRequestUrlOk returns a tuple with the RequestUrl field value +// and a boolean to check if the value has been set. +func (o *Webhook) GetRequestUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.RequestUrl, true +} + +// SetRequestUrl sets field value +func (o *Webhook) SetRequestUrl(v string) { + o.RequestUrl = v +} + +// GetPayloadTemplate returns the PayloadTemplate field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Webhook) GetPayloadTemplate() string { + if o == nil || IsNil(o.PayloadTemplate.Get()) { + var ret string + return ret + } + return *o.PayloadTemplate.Get() +} + +// GetPayloadTemplateOk returns a tuple with the PayloadTemplate field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Webhook) GetPayloadTemplateOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.PayloadTemplate.Get(), o.PayloadTemplate.IsSet() +} + +// HasPayloadTemplate returns a boolean if a field has been set. +func (o *Webhook) HasPayloadTemplate() bool { + if o != nil && o.PayloadTemplate.IsSet() { + return true + } + + return false +} + +// SetPayloadTemplate gets a reference to the given NullableString and assigns it to the PayloadTemplate field. +func (o *Webhook) SetPayloadTemplate(v string) { + o.PayloadTemplate.Set(&v) +} +// SetPayloadTemplateNil sets the value for PayloadTemplate to be an explicit nil +func (o *Webhook) SetPayloadTemplateNil() { + o.PayloadTemplate.Set(nil) +} + +// UnsetPayloadTemplate ensures that no value is present for PayloadTemplate, not even an explicit nil +func (o *Webhook) UnsetPayloadTemplate() { + o.PayloadTemplate.Unset() +} + +// GetHeadersTemplate returns the HeadersTemplate field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Webhook) GetHeadersTemplate() string { + if o == nil || IsNil(o.HeadersTemplate.Get()) { + var ret string + return ret + } + return *o.HeadersTemplate.Get() +} + +// GetHeadersTemplateOk returns a tuple with the HeadersTemplate field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Webhook) GetHeadersTemplateOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.HeadersTemplate.Get(), o.HeadersTemplate.IsSet() +} + +// HasHeadersTemplate returns a boolean if a field has been set. +func (o *Webhook) HasHeadersTemplate() bool { + if o != nil && o.HeadersTemplate.IsSet() { + return true + } + + return false +} + +// SetHeadersTemplate gets a reference to the given NullableString and assigns it to the HeadersTemplate field. +func (o *Webhook) SetHeadersTemplate(v string) { + o.HeadersTemplate.Set(&v) +} +// SetHeadersTemplateNil sets the value for HeadersTemplate to be an explicit nil +func (o *Webhook) SetHeadersTemplateNil() { + o.HeadersTemplate.Set(nil) +} + +// UnsetHeadersTemplate ensures that no value is present for HeadersTemplate, not even an explicit nil +func (o *Webhook) UnsetHeadersTemplate() { + o.HeadersTemplate.Unset() +} + +// GetDescription returns the Description field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Webhook) GetDescription() string { + if o == nil || IsNil(o.Description.Get()) { + var ret string + return ret + } + return *o.Description.Get() +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Webhook) GetDescriptionOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Description.Get(), o.Description.IsSet() +} + +// HasDescription returns a boolean if a field has been set. +func (o *Webhook) HasDescription() bool { + if o != nil && o.Description.IsSet() { + return true + } + + return false +} + +// SetDescription gets a reference to the given NullableString and assigns it to the Description field. +func (o *Webhook) SetDescription(v string) { + o.Description.Set(&v) +} +// SetDescriptionNil sets the value for Description to be an explicit nil +func (o *Webhook) SetDescriptionNil() { + o.Description.Set(nil) +} + +// UnsetDescription ensures that no value is present for Description, not even an explicit nil +func (o *Webhook) UnsetDescription() { + o.Description.Unset() +} + +// GetLastDispatch returns the LastDispatch field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Webhook) GetLastDispatch() ExampleWebhookDispatch { + if o == nil || IsNil(o.LastDispatch.Get()) { + var ret ExampleWebhookDispatch + return ret + } + return *o.LastDispatch.Get() +} + +// GetLastDispatchOk returns a tuple with the LastDispatch field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Webhook) GetLastDispatchOk() (*ExampleWebhookDispatch, bool) { + if o == nil { + return nil, false + } + return o.LastDispatch.Get(), o.LastDispatch.IsSet() +} + +// HasLastDispatch returns a boolean if a field has been set. +func (o *Webhook) HasLastDispatch() bool { + if o != nil && o.LastDispatch.IsSet() { + return true + } + + return false +} + +// SetLastDispatch gets a reference to the given NullableExampleWebhookDispatch and assigns it to the LastDispatch field. +func (o *Webhook) SetLastDispatch(v ExampleWebhookDispatch) { + o.LastDispatch.Set(&v) +} +// SetLastDispatchNil sets the value for LastDispatch to be an explicit nil +func (o *Webhook) SetLastDispatchNil() { + o.LastDispatch.Set(nil) +} + +// UnsetLastDispatch ensures that no value is present for LastDispatch, not even an explicit nil +func (o *Webhook) UnsetLastDispatch() { + o.LastDispatch.Unset() +} + +// GetStats returns the Stats field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Webhook) GetStats() WebhookStats { + if o == nil || IsNil(o.Stats.Get()) { + var ret WebhookStats + return ret + } + return *o.Stats.Get() +} + +// GetStatsOk returns a tuple with the Stats field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Webhook) GetStatsOk() (*WebhookStats, bool) { + if o == nil { + return nil, false + } + return o.Stats.Get(), o.Stats.IsSet() +} + +// HasStats returns a boolean if a field has been set. +func (o *Webhook) HasStats() bool { + if o != nil && o.Stats.IsSet() { + return true + } + + return false +} + +// SetStats gets a reference to the given NullableWebhookStats and assigns it to the Stats field. +func (o *Webhook) SetStats(v WebhookStats) { + o.Stats.Set(&v) +} +// SetStatsNil sets the value for Stats to be an explicit nil +func (o *Webhook) SetStatsNil() { + o.Stats.Set(nil) +} + +// UnsetStats ensures that no value is present for Stats, not even an explicit nil +func (o *Webhook) UnsetStats() { + o.Stats.Unset() +} + +func (o Webhook) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Webhook) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["createdAt"] = o.CreatedAt + toSerialize["modifiedAt"] = o.ModifiedAt + toSerialize["userId"] = o.UserId + if o.IsAdHoc.IsSet() { + toSerialize["isAdHoc"] = o.IsAdHoc.Get() + } + if o.ShouldInterpolateStrings.IsSet() { + toSerialize["shouldInterpolateStrings"] = o.ShouldInterpolateStrings.Get() + } + toSerialize["eventTypes"] = o.EventTypes + toSerialize["condition"] = o.Condition + toSerialize["ignoreSslErrors"] = o.IgnoreSslErrors + if o.DoNotRetry.IsSet() { + toSerialize["doNotRetry"] = o.DoNotRetry.Get() + } + toSerialize["requestUrl"] = o.RequestUrl + if o.PayloadTemplate.IsSet() { + toSerialize["payloadTemplate"] = o.PayloadTemplate.Get() + } + if o.HeadersTemplate.IsSet() { + toSerialize["headersTemplate"] = o.HeadersTemplate.Get() + } + if o.Description.IsSet() { + toSerialize["description"] = o.Description.Get() + } + if o.LastDispatch.IsSet() { + toSerialize["lastDispatch"] = o.LastDispatch.Get() + } + if o.Stats.IsSet() { + toSerialize["stats"] = o.Stats.Get() + } + return toSerialize, nil +} + +func (o *Webhook) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "createdAt", + "modifiedAt", + "userId", + "eventTypes", + "condition", + "ignoreSslErrors", + "requestUrl", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varWebhook := _Webhook{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varWebhook) + + if err != nil { + return err + } + + *o = Webhook(varWebhook) + + return err +} + +type NullableWebhook struct { + value *Webhook + isSet bool +} + +func (v NullableWebhook) Get() *Webhook { + return v.value +} + +func (v *NullableWebhook) Set(val *Webhook) { + v.value = val + v.isSet = true +} + +func (v NullableWebhook) IsSet() bool { + return v.isSet +} + +func (v *NullableWebhook) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWebhook(val *Webhook) *NullableWebhook { + return &NullableWebhook{value: val, isSet: true} +} + +func (v NullableWebhook) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWebhook) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_webhook_condition.go b/model_webhook_condition.go new file mode 100644 index 0000000..5624de2 --- /dev/null +++ b/model_webhook_condition.go @@ -0,0 +1,228 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" +) + +// checks if the WebhookCondition type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &WebhookCondition{} + +// WebhookCondition struct for WebhookCondition +type WebhookCondition struct { + ActorId NullableString `json:"actorId,omitempty"` + ActorTaskId NullableString `json:"actorTaskId,omitempty"` + ActorRunId NullableString `json:"actorRunId,omitempty"` +} + +// NewWebhookCondition instantiates a new WebhookCondition object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewWebhookCondition() *WebhookCondition { + this := WebhookCondition{} + return &this +} + +// NewWebhookConditionWithDefaults instantiates a new WebhookCondition object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWebhookConditionWithDefaults() *WebhookCondition { + this := WebhookCondition{} + return &this +} + +// GetActorId returns the ActorId field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WebhookCondition) GetActorId() string { + if o == nil || IsNil(o.ActorId.Get()) { + var ret string + return ret + } + return *o.ActorId.Get() +} + +// GetActorIdOk returns a tuple with the ActorId field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WebhookCondition) GetActorIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.ActorId.Get(), o.ActorId.IsSet() +} + +// HasActorId returns a boolean if a field has been set. +func (o *WebhookCondition) HasActorId() bool { + if o != nil && o.ActorId.IsSet() { + return true + } + + return false +} + +// SetActorId gets a reference to the given NullableString and assigns it to the ActorId field. +func (o *WebhookCondition) SetActorId(v string) { + o.ActorId.Set(&v) +} +// SetActorIdNil sets the value for ActorId to be an explicit nil +func (o *WebhookCondition) SetActorIdNil() { + o.ActorId.Set(nil) +} + +// UnsetActorId ensures that no value is present for ActorId, not even an explicit nil +func (o *WebhookCondition) UnsetActorId() { + o.ActorId.Unset() +} + +// GetActorTaskId returns the ActorTaskId field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WebhookCondition) GetActorTaskId() string { + if o == nil || IsNil(o.ActorTaskId.Get()) { + var ret string + return ret + } + return *o.ActorTaskId.Get() +} + +// GetActorTaskIdOk returns a tuple with the ActorTaskId field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WebhookCondition) GetActorTaskIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.ActorTaskId.Get(), o.ActorTaskId.IsSet() +} + +// HasActorTaskId returns a boolean if a field has been set. +func (o *WebhookCondition) HasActorTaskId() bool { + if o != nil && o.ActorTaskId.IsSet() { + return true + } + + return false +} + +// SetActorTaskId gets a reference to the given NullableString and assigns it to the ActorTaskId field. +func (o *WebhookCondition) SetActorTaskId(v string) { + o.ActorTaskId.Set(&v) +} +// SetActorTaskIdNil sets the value for ActorTaskId to be an explicit nil +func (o *WebhookCondition) SetActorTaskIdNil() { + o.ActorTaskId.Set(nil) +} + +// UnsetActorTaskId ensures that no value is present for ActorTaskId, not even an explicit nil +func (o *WebhookCondition) UnsetActorTaskId() { + o.ActorTaskId.Unset() +} + +// GetActorRunId returns the ActorRunId field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WebhookCondition) GetActorRunId() string { + if o == nil || IsNil(o.ActorRunId.Get()) { + var ret string + return ret + } + return *o.ActorRunId.Get() +} + +// GetActorRunIdOk returns a tuple with the ActorRunId field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WebhookCondition) GetActorRunIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.ActorRunId.Get(), o.ActorRunId.IsSet() +} + +// HasActorRunId returns a boolean if a field has been set. +func (o *WebhookCondition) HasActorRunId() bool { + if o != nil && o.ActorRunId.IsSet() { + return true + } + + return false +} + +// SetActorRunId gets a reference to the given NullableString and assigns it to the ActorRunId field. +func (o *WebhookCondition) SetActorRunId(v string) { + o.ActorRunId.Set(&v) +} +// SetActorRunIdNil sets the value for ActorRunId to be an explicit nil +func (o *WebhookCondition) SetActorRunIdNil() { + o.ActorRunId.Set(nil) +} + +// UnsetActorRunId ensures that no value is present for ActorRunId, not even an explicit nil +func (o *WebhookCondition) UnsetActorRunId() { + o.ActorRunId.Unset() +} + +func (o WebhookCondition) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o WebhookCondition) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.ActorId.IsSet() { + toSerialize["actorId"] = o.ActorId.Get() + } + if o.ActorTaskId.IsSet() { + toSerialize["actorTaskId"] = o.ActorTaskId.Get() + } + if o.ActorRunId.IsSet() { + toSerialize["actorRunId"] = o.ActorRunId.Get() + } + return toSerialize, nil +} + +type NullableWebhookCondition struct { + value *WebhookCondition + isSet bool +} + +func (v NullableWebhookCondition) Get() *WebhookCondition { + return v.value +} + +func (v *NullableWebhookCondition) Set(val *WebhookCondition) { + v.value = val + v.isSet = true +} + +func (v NullableWebhookCondition) IsSet() bool { + return v.isSet +} + +func (v *NullableWebhookCondition) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWebhookCondition(val *WebhookCondition) *NullableWebhookCondition { + return &NullableWebhookCondition{value: val, isSet: true} +} + +func (v NullableWebhookCondition) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWebhookCondition) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_webhook_create.go b/model_webhook_create.go new file mode 100644 index 0000000..c7563b4 --- /dev/null +++ b/model_webhook_create.go @@ -0,0 +1,582 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" + "bytes" + "fmt" +) + +// checks if the WebhookCreate type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &WebhookCreate{} + +// WebhookCreate struct for WebhookCreate +type WebhookCreate struct { + IsAdHoc NullableBool `json:"isAdHoc,omitempty"` + EventTypes []WebhookEventType `json:"eventTypes"` + Condition WebhookCondition `json:"condition"` + IdempotencyKey NullableString `json:"idempotencyKey,omitempty"` + IgnoreSslErrors NullableBool `json:"ignoreSslErrors,omitempty"` + DoNotRetry NullableBool `json:"doNotRetry,omitempty"` + RequestUrl string `json:"requestUrl"` + PayloadTemplate NullableString `json:"payloadTemplate,omitempty"` + HeadersTemplate NullableString `json:"headersTemplate,omitempty"` + Description NullableString `json:"description,omitempty"` + ShouldInterpolateStrings NullableBool `json:"shouldInterpolateStrings,omitempty"` +} + +type _WebhookCreate WebhookCreate + +// NewWebhookCreate instantiates a new WebhookCreate object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewWebhookCreate(eventTypes []WebhookEventType, condition WebhookCondition, requestUrl string) *WebhookCreate { + this := WebhookCreate{} + this.EventTypes = eventTypes + this.Condition = condition + this.RequestUrl = requestUrl + return &this +} + +// NewWebhookCreateWithDefaults instantiates a new WebhookCreate object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWebhookCreateWithDefaults() *WebhookCreate { + this := WebhookCreate{} + return &this +} + +// GetIsAdHoc returns the IsAdHoc field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WebhookCreate) GetIsAdHoc() bool { + if o == nil || IsNil(o.IsAdHoc.Get()) { + var ret bool + return ret + } + return *o.IsAdHoc.Get() +} + +// GetIsAdHocOk returns a tuple with the IsAdHoc field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WebhookCreate) GetIsAdHocOk() (*bool, bool) { + if o == nil { + return nil, false + } + return o.IsAdHoc.Get(), o.IsAdHoc.IsSet() +} + +// HasIsAdHoc returns a boolean if a field has been set. +func (o *WebhookCreate) HasIsAdHoc() bool { + if o != nil && o.IsAdHoc.IsSet() { + return true + } + + return false +} + +// SetIsAdHoc gets a reference to the given NullableBool and assigns it to the IsAdHoc field. +func (o *WebhookCreate) SetIsAdHoc(v bool) { + o.IsAdHoc.Set(&v) +} +// SetIsAdHocNil sets the value for IsAdHoc to be an explicit nil +func (o *WebhookCreate) SetIsAdHocNil() { + o.IsAdHoc.Set(nil) +} + +// UnsetIsAdHoc ensures that no value is present for IsAdHoc, not even an explicit nil +func (o *WebhookCreate) UnsetIsAdHoc() { + o.IsAdHoc.Unset() +} + +// GetEventTypes returns the EventTypes field value +func (o *WebhookCreate) GetEventTypes() []WebhookEventType { + if o == nil { + var ret []WebhookEventType + return ret + } + + return o.EventTypes +} + +// GetEventTypesOk returns a tuple with the EventTypes field value +// and a boolean to check if the value has been set. +func (o *WebhookCreate) GetEventTypesOk() ([]WebhookEventType, bool) { + if o == nil { + return nil, false + } + return o.EventTypes, true +} + +// SetEventTypes sets field value +func (o *WebhookCreate) SetEventTypes(v []WebhookEventType) { + o.EventTypes = v +} + +// GetCondition returns the Condition field value +func (o *WebhookCreate) GetCondition() WebhookCondition { + if o == nil { + var ret WebhookCondition + return ret + } + + return o.Condition +} + +// GetConditionOk returns a tuple with the Condition field value +// and a boolean to check if the value has been set. +func (o *WebhookCreate) GetConditionOk() (*WebhookCondition, bool) { + if o == nil { + return nil, false + } + return &o.Condition, true +} + +// SetCondition sets field value +func (o *WebhookCreate) SetCondition(v WebhookCondition) { + o.Condition = v +} + +// GetIdempotencyKey returns the IdempotencyKey field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WebhookCreate) GetIdempotencyKey() string { + if o == nil || IsNil(o.IdempotencyKey.Get()) { + var ret string + return ret + } + return *o.IdempotencyKey.Get() +} + +// GetIdempotencyKeyOk returns a tuple with the IdempotencyKey field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WebhookCreate) GetIdempotencyKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.IdempotencyKey.Get(), o.IdempotencyKey.IsSet() +} + +// HasIdempotencyKey returns a boolean if a field has been set. +func (o *WebhookCreate) HasIdempotencyKey() bool { + if o != nil && o.IdempotencyKey.IsSet() { + return true + } + + return false +} + +// SetIdempotencyKey gets a reference to the given NullableString and assigns it to the IdempotencyKey field. +func (o *WebhookCreate) SetIdempotencyKey(v string) { + o.IdempotencyKey.Set(&v) +} +// SetIdempotencyKeyNil sets the value for IdempotencyKey to be an explicit nil +func (o *WebhookCreate) SetIdempotencyKeyNil() { + o.IdempotencyKey.Set(nil) +} + +// UnsetIdempotencyKey ensures that no value is present for IdempotencyKey, not even an explicit nil +func (o *WebhookCreate) UnsetIdempotencyKey() { + o.IdempotencyKey.Unset() +} + +// GetIgnoreSslErrors returns the IgnoreSslErrors field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WebhookCreate) GetIgnoreSslErrors() bool { + if o == nil || IsNil(o.IgnoreSslErrors.Get()) { + var ret bool + return ret + } + return *o.IgnoreSslErrors.Get() +} + +// GetIgnoreSslErrorsOk returns a tuple with the IgnoreSslErrors field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WebhookCreate) GetIgnoreSslErrorsOk() (*bool, bool) { + if o == nil { + return nil, false + } + return o.IgnoreSslErrors.Get(), o.IgnoreSslErrors.IsSet() +} + +// HasIgnoreSslErrors returns a boolean if a field has been set. +func (o *WebhookCreate) HasIgnoreSslErrors() bool { + if o != nil && o.IgnoreSslErrors.IsSet() { + return true + } + + return false +} + +// SetIgnoreSslErrors gets a reference to the given NullableBool and assigns it to the IgnoreSslErrors field. +func (o *WebhookCreate) SetIgnoreSslErrors(v bool) { + o.IgnoreSslErrors.Set(&v) +} +// SetIgnoreSslErrorsNil sets the value for IgnoreSslErrors to be an explicit nil +func (o *WebhookCreate) SetIgnoreSslErrorsNil() { + o.IgnoreSslErrors.Set(nil) +} + +// UnsetIgnoreSslErrors ensures that no value is present for IgnoreSslErrors, not even an explicit nil +func (o *WebhookCreate) UnsetIgnoreSslErrors() { + o.IgnoreSslErrors.Unset() +} + +// GetDoNotRetry returns the DoNotRetry field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WebhookCreate) GetDoNotRetry() bool { + if o == nil || IsNil(o.DoNotRetry.Get()) { + var ret bool + return ret + } + return *o.DoNotRetry.Get() +} + +// GetDoNotRetryOk returns a tuple with the DoNotRetry field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WebhookCreate) GetDoNotRetryOk() (*bool, bool) { + if o == nil { + return nil, false + } + return o.DoNotRetry.Get(), o.DoNotRetry.IsSet() +} + +// HasDoNotRetry returns a boolean if a field has been set. +func (o *WebhookCreate) HasDoNotRetry() bool { + if o != nil && o.DoNotRetry.IsSet() { + return true + } + + return false +} + +// SetDoNotRetry gets a reference to the given NullableBool and assigns it to the DoNotRetry field. +func (o *WebhookCreate) SetDoNotRetry(v bool) { + o.DoNotRetry.Set(&v) +} +// SetDoNotRetryNil sets the value for DoNotRetry to be an explicit nil +func (o *WebhookCreate) SetDoNotRetryNil() { + o.DoNotRetry.Set(nil) +} + +// UnsetDoNotRetry ensures that no value is present for DoNotRetry, not even an explicit nil +func (o *WebhookCreate) UnsetDoNotRetry() { + o.DoNotRetry.Unset() +} + +// GetRequestUrl returns the RequestUrl field value +func (o *WebhookCreate) GetRequestUrl() string { + if o == nil { + var ret string + return ret + } + + return o.RequestUrl +} + +// GetRequestUrlOk returns a tuple with the RequestUrl field value +// and a boolean to check if the value has been set. +func (o *WebhookCreate) GetRequestUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.RequestUrl, true +} + +// SetRequestUrl sets field value +func (o *WebhookCreate) SetRequestUrl(v string) { + o.RequestUrl = v +} + +// GetPayloadTemplate returns the PayloadTemplate field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WebhookCreate) GetPayloadTemplate() string { + if o == nil || IsNil(o.PayloadTemplate.Get()) { + var ret string + return ret + } + return *o.PayloadTemplate.Get() +} + +// GetPayloadTemplateOk returns a tuple with the PayloadTemplate field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WebhookCreate) GetPayloadTemplateOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.PayloadTemplate.Get(), o.PayloadTemplate.IsSet() +} + +// HasPayloadTemplate returns a boolean if a field has been set. +func (o *WebhookCreate) HasPayloadTemplate() bool { + if o != nil && o.PayloadTemplate.IsSet() { + return true + } + + return false +} + +// SetPayloadTemplate gets a reference to the given NullableString and assigns it to the PayloadTemplate field. +func (o *WebhookCreate) SetPayloadTemplate(v string) { + o.PayloadTemplate.Set(&v) +} +// SetPayloadTemplateNil sets the value for PayloadTemplate to be an explicit nil +func (o *WebhookCreate) SetPayloadTemplateNil() { + o.PayloadTemplate.Set(nil) +} + +// UnsetPayloadTemplate ensures that no value is present for PayloadTemplate, not even an explicit nil +func (o *WebhookCreate) UnsetPayloadTemplate() { + o.PayloadTemplate.Unset() +} + +// GetHeadersTemplate returns the HeadersTemplate field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WebhookCreate) GetHeadersTemplate() string { + if o == nil || IsNil(o.HeadersTemplate.Get()) { + var ret string + return ret + } + return *o.HeadersTemplate.Get() +} + +// GetHeadersTemplateOk returns a tuple with the HeadersTemplate field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WebhookCreate) GetHeadersTemplateOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.HeadersTemplate.Get(), o.HeadersTemplate.IsSet() +} + +// HasHeadersTemplate returns a boolean if a field has been set. +func (o *WebhookCreate) HasHeadersTemplate() bool { + if o != nil && o.HeadersTemplate.IsSet() { + return true + } + + return false +} + +// SetHeadersTemplate gets a reference to the given NullableString and assigns it to the HeadersTemplate field. +func (o *WebhookCreate) SetHeadersTemplate(v string) { + o.HeadersTemplate.Set(&v) +} +// SetHeadersTemplateNil sets the value for HeadersTemplate to be an explicit nil +func (o *WebhookCreate) SetHeadersTemplateNil() { + o.HeadersTemplate.Set(nil) +} + +// UnsetHeadersTemplate ensures that no value is present for HeadersTemplate, not even an explicit nil +func (o *WebhookCreate) UnsetHeadersTemplate() { + o.HeadersTemplate.Unset() +} + +// GetDescription returns the Description field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WebhookCreate) GetDescription() string { + if o == nil || IsNil(o.Description.Get()) { + var ret string + return ret + } + return *o.Description.Get() +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WebhookCreate) GetDescriptionOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Description.Get(), o.Description.IsSet() +} + +// HasDescription returns a boolean if a field has been set. +func (o *WebhookCreate) HasDescription() bool { + if o != nil && o.Description.IsSet() { + return true + } + + return false +} + +// SetDescription gets a reference to the given NullableString and assigns it to the Description field. +func (o *WebhookCreate) SetDescription(v string) { + o.Description.Set(&v) +} +// SetDescriptionNil sets the value for Description to be an explicit nil +func (o *WebhookCreate) SetDescriptionNil() { + o.Description.Set(nil) +} + +// UnsetDescription ensures that no value is present for Description, not even an explicit nil +func (o *WebhookCreate) UnsetDescription() { + o.Description.Unset() +} + +// GetShouldInterpolateStrings returns the ShouldInterpolateStrings field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WebhookCreate) GetShouldInterpolateStrings() bool { + if o == nil || IsNil(o.ShouldInterpolateStrings.Get()) { + var ret bool + return ret + } + return *o.ShouldInterpolateStrings.Get() +} + +// GetShouldInterpolateStringsOk returns a tuple with the ShouldInterpolateStrings field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WebhookCreate) GetShouldInterpolateStringsOk() (*bool, bool) { + if o == nil { + return nil, false + } + return o.ShouldInterpolateStrings.Get(), o.ShouldInterpolateStrings.IsSet() +} + +// HasShouldInterpolateStrings returns a boolean if a field has been set. +func (o *WebhookCreate) HasShouldInterpolateStrings() bool { + if o != nil && o.ShouldInterpolateStrings.IsSet() { + return true + } + + return false +} + +// SetShouldInterpolateStrings gets a reference to the given NullableBool and assigns it to the ShouldInterpolateStrings field. +func (o *WebhookCreate) SetShouldInterpolateStrings(v bool) { + o.ShouldInterpolateStrings.Set(&v) +} +// SetShouldInterpolateStringsNil sets the value for ShouldInterpolateStrings to be an explicit nil +func (o *WebhookCreate) SetShouldInterpolateStringsNil() { + o.ShouldInterpolateStrings.Set(nil) +} + +// UnsetShouldInterpolateStrings ensures that no value is present for ShouldInterpolateStrings, not even an explicit nil +func (o *WebhookCreate) UnsetShouldInterpolateStrings() { + o.ShouldInterpolateStrings.Unset() +} + +func (o WebhookCreate) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o WebhookCreate) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.IsAdHoc.IsSet() { + toSerialize["isAdHoc"] = o.IsAdHoc.Get() + } + toSerialize["eventTypes"] = o.EventTypes + toSerialize["condition"] = o.Condition + if o.IdempotencyKey.IsSet() { + toSerialize["idempotencyKey"] = o.IdempotencyKey.Get() + } + if o.IgnoreSslErrors.IsSet() { + toSerialize["ignoreSslErrors"] = o.IgnoreSslErrors.Get() + } + if o.DoNotRetry.IsSet() { + toSerialize["doNotRetry"] = o.DoNotRetry.Get() + } + toSerialize["requestUrl"] = o.RequestUrl + if o.PayloadTemplate.IsSet() { + toSerialize["payloadTemplate"] = o.PayloadTemplate.Get() + } + if o.HeadersTemplate.IsSet() { + toSerialize["headersTemplate"] = o.HeadersTemplate.Get() + } + if o.Description.IsSet() { + toSerialize["description"] = o.Description.Get() + } + if o.ShouldInterpolateStrings.IsSet() { + toSerialize["shouldInterpolateStrings"] = o.ShouldInterpolateStrings.Get() + } + return toSerialize, nil +} + +func (o *WebhookCreate) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "eventTypes", + "condition", + "requestUrl", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varWebhookCreate := _WebhookCreate{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varWebhookCreate) + + if err != nil { + return err + } + + *o = WebhookCreate(varWebhookCreate) + + return err +} + +type NullableWebhookCreate struct { + value *WebhookCreate + isSet bool +} + +func (v NullableWebhookCreate) Get() *WebhookCreate { + return v.value +} + +func (v *NullableWebhookCreate) Set(val *WebhookCreate) { + v.value = val + v.isSet = true +} + +func (v NullableWebhookCreate) IsSet() bool { + return v.isSet +} + +func (v *NullableWebhookCreate) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWebhookCreate(val *WebhookCreate) *NullableWebhookCreate { + return &NullableWebhookCreate{value: val, isSet: true} +} + +func (v NullableWebhookCreate) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWebhookCreate) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_webhook_dispatch.go b/model_webhook_dispatch.go new file mode 100644 index 0000000..c5d31e8 --- /dev/null +++ b/model_webhook_dispatch.go @@ -0,0 +1,417 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" + "time" + "bytes" + "fmt" +) + +// checks if the WebhookDispatch type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &WebhookDispatch{} + +// WebhookDispatch struct for WebhookDispatch +type WebhookDispatch struct { + Id string `json:"id"` + UserId string `json:"userId"` + WebhookId string `json:"webhookId"` + CreatedAt time.Time `json:"createdAt"` + Status WebhookDispatchStatus `json:"status"` + EventType WebhookEventType `json:"eventType"` + EventData *EventData `json:"eventData,omitempty"` + Webhook NullableWebhookDispatchWebhookSummary `json:"webhook,omitempty"` + Calls []CallsInner `json:"calls,omitempty"` +} + +type _WebhookDispatch WebhookDispatch + +// NewWebhookDispatch instantiates a new WebhookDispatch object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewWebhookDispatch(id string, userId string, webhookId string, createdAt time.Time, status WebhookDispatchStatus, eventType WebhookEventType) *WebhookDispatch { + this := WebhookDispatch{} + this.Id = id + this.UserId = userId + this.WebhookId = webhookId + this.CreatedAt = createdAt + this.Status = status + this.EventType = eventType + return &this +} + +// NewWebhookDispatchWithDefaults instantiates a new WebhookDispatch object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWebhookDispatchWithDefaults() *WebhookDispatch { + this := WebhookDispatch{} + return &this +} + +// GetId returns the Id field value +func (o *WebhookDispatch) GetId() string { + if o == nil { + var ret string + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *WebhookDispatch) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *WebhookDispatch) SetId(v string) { + o.Id = v +} + +// GetUserId returns the UserId field value +func (o *WebhookDispatch) GetUserId() string { + if o == nil { + var ret string + return ret + } + + return o.UserId +} + +// GetUserIdOk returns a tuple with the UserId field value +// and a boolean to check if the value has been set. +func (o *WebhookDispatch) GetUserIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.UserId, true +} + +// SetUserId sets field value +func (o *WebhookDispatch) SetUserId(v string) { + o.UserId = v +} + +// GetWebhookId returns the WebhookId field value +func (o *WebhookDispatch) GetWebhookId() string { + if o == nil { + var ret string + return ret + } + + return o.WebhookId +} + +// GetWebhookIdOk returns a tuple with the WebhookId field value +// and a boolean to check if the value has been set. +func (o *WebhookDispatch) GetWebhookIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.WebhookId, true +} + +// SetWebhookId sets field value +func (o *WebhookDispatch) SetWebhookId(v string) { + o.WebhookId = v +} + +// GetCreatedAt returns the CreatedAt field value +func (o *WebhookDispatch) GetCreatedAt() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value +// and a boolean to check if the value has been set. +func (o *WebhookDispatch) GetCreatedAtOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.CreatedAt, true +} + +// SetCreatedAt sets field value +func (o *WebhookDispatch) SetCreatedAt(v time.Time) { + o.CreatedAt = v +} + +// GetStatus returns the Status field value +func (o *WebhookDispatch) GetStatus() WebhookDispatchStatus { + if o == nil { + var ret WebhookDispatchStatus + return ret + } + + return o.Status +} + +// GetStatusOk returns a tuple with the Status field value +// and a boolean to check if the value has been set. +func (o *WebhookDispatch) GetStatusOk() (*WebhookDispatchStatus, bool) { + if o == nil { + return nil, false + } + return &o.Status, true +} + +// SetStatus sets field value +func (o *WebhookDispatch) SetStatus(v WebhookDispatchStatus) { + o.Status = v +} + +// GetEventType returns the EventType field value +func (o *WebhookDispatch) GetEventType() WebhookEventType { + if o == nil { + var ret WebhookEventType + return ret + } + + return o.EventType +} + +// GetEventTypeOk returns a tuple with the EventType field value +// and a boolean to check if the value has been set. +func (o *WebhookDispatch) GetEventTypeOk() (*WebhookEventType, bool) { + if o == nil { + return nil, false + } + return &o.EventType, true +} + +// SetEventType sets field value +func (o *WebhookDispatch) SetEventType(v WebhookEventType) { + o.EventType = v +} + +// GetEventData returns the EventData field value if set, zero value otherwise. +func (o *WebhookDispatch) GetEventData() EventData { + if o == nil || IsNil(o.EventData) { + var ret EventData + return ret + } + return *o.EventData +} + +// GetEventDataOk returns a tuple with the EventData field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WebhookDispatch) GetEventDataOk() (*EventData, bool) { + if o == nil || IsNil(o.EventData) { + return nil, false + } + return o.EventData, true +} + +// HasEventData returns a boolean if a field has been set. +func (o *WebhookDispatch) HasEventData() bool { + if o != nil && !IsNil(o.EventData) { + return true + } + + return false +} + +// SetEventData gets a reference to the given EventData and assigns it to the EventData field. +func (o *WebhookDispatch) SetEventData(v EventData) { + o.EventData = &v +} + +// GetWebhook returns the Webhook field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WebhookDispatch) GetWebhook() WebhookDispatchWebhookSummary { + if o == nil || IsNil(o.Webhook.Get()) { + var ret WebhookDispatchWebhookSummary + return ret + } + return *o.Webhook.Get() +} + +// GetWebhookOk returns a tuple with the Webhook field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WebhookDispatch) GetWebhookOk() (*WebhookDispatchWebhookSummary, bool) { + if o == nil { + return nil, false + } + return o.Webhook.Get(), o.Webhook.IsSet() +} + +// HasWebhook returns a boolean if a field has been set. +func (o *WebhookDispatch) HasWebhook() bool { + if o != nil && o.Webhook.IsSet() { + return true + } + + return false +} + +// SetWebhook gets a reference to the given NullableWebhookDispatchWebhookSummary and assigns it to the Webhook field. +func (o *WebhookDispatch) SetWebhook(v WebhookDispatchWebhookSummary) { + o.Webhook.Set(&v) +} +// SetWebhookNil sets the value for Webhook to be an explicit nil +func (o *WebhookDispatch) SetWebhookNil() { + o.Webhook.Set(nil) +} + +// UnsetWebhook ensures that no value is present for Webhook, not even an explicit nil +func (o *WebhookDispatch) UnsetWebhook() { + o.Webhook.Unset() +} + +// GetCalls returns the Calls field value if set, zero value otherwise. +func (o *WebhookDispatch) GetCalls() []CallsInner { + if o == nil || IsNil(o.Calls) { + var ret []CallsInner + return ret + } + return o.Calls +} + +// GetCallsOk returns a tuple with the Calls field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WebhookDispatch) GetCallsOk() ([]CallsInner, bool) { + if o == nil || IsNil(o.Calls) { + return nil, false + } + return o.Calls, true +} + +// HasCalls returns a boolean if a field has been set. +func (o *WebhookDispatch) HasCalls() bool { + if o != nil && !IsNil(o.Calls) { + return true + } + + return false +} + +// SetCalls gets a reference to the given []CallsInner and assigns it to the Calls field. +func (o *WebhookDispatch) SetCalls(v []CallsInner) { + o.Calls = v +} + +func (o WebhookDispatch) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o WebhookDispatch) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["userId"] = o.UserId + toSerialize["webhookId"] = o.WebhookId + toSerialize["createdAt"] = o.CreatedAt + toSerialize["status"] = o.Status + toSerialize["eventType"] = o.EventType + if !IsNil(o.EventData) { + toSerialize["eventData"] = o.EventData + } + if o.Webhook.IsSet() { + toSerialize["webhook"] = o.Webhook.Get() + } + if !IsNil(o.Calls) { + toSerialize["calls"] = o.Calls + } + return toSerialize, nil +} + +func (o *WebhookDispatch) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "userId", + "webhookId", + "createdAt", + "status", + "eventType", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varWebhookDispatch := _WebhookDispatch{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varWebhookDispatch) + + if err != nil { + return err + } + + *o = WebhookDispatch(varWebhookDispatch) + + return err +} + +type NullableWebhookDispatch struct { + value *WebhookDispatch + isSet bool +} + +func (v NullableWebhookDispatch) Get() *WebhookDispatch { + return v.value +} + +func (v *NullableWebhookDispatch) Set(val *WebhookDispatch) { + v.value = val + v.isSet = true +} + +func (v NullableWebhookDispatch) IsSet() bool { + return v.isSet +} + +func (v *NullableWebhookDispatch) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWebhookDispatch(val *WebhookDispatch) *NullableWebhookDispatch { + return &NullableWebhookDispatch{value: val, isSet: true} +} + +func (v NullableWebhookDispatch) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWebhookDispatch) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_webhook_dispatch_response.go b/model_webhook_dispatch_response.go new file mode 100644 index 0000000..83857db --- /dev/null +++ b/model_webhook_dispatch_response.go @@ -0,0 +1,158 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" + "bytes" + "fmt" +) + +// checks if the WebhookDispatchResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &WebhookDispatchResponse{} + +// WebhookDispatchResponse struct for WebhookDispatchResponse +type WebhookDispatchResponse struct { + Data WebhookDispatch `json:"data"` +} + +type _WebhookDispatchResponse WebhookDispatchResponse + +// NewWebhookDispatchResponse instantiates a new WebhookDispatchResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewWebhookDispatchResponse(data WebhookDispatch) *WebhookDispatchResponse { + this := WebhookDispatchResponse{} + this.Data = data + return &this +} + +// NewWebhookDispatchResponseWithDefaults instantiates a new WebhookDispatchResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWebhookDispatchResponseWithDefaults() *WebhookDispatchResponse { + this := WebhookDispatchResponse{} + return &this +} + +// GetData returns the Data field value +func (o *WebhookDispatchResponse) GetData() WebhookDispatch { + if o == nil { + var ret WebhookDispatch + return ret + } + + return o.Data +} + +// GetDataOk returns a tuple with the Data field value +// and a boolean to check if the value has been set. +func (o *WebhookDispatchResponse) GetDataOk() (*WebhookDispatch, bool) { + if o == nil { + return nil, false + } + return &o.Data, true +} + +// SetData sets field value +func (o *WebhookDispatchResponse) SetData(v WebhookDispatch) { + o.Data = v +} + +func (o WebhookDispatchResponse) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o WebhookDispatchResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["data"] = o.Data + return toSerialize, nil +} + +func (o *WebhookDispatchResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "data", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varWebhookDispatchResponse := _WebhookDispatchResponse{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varWebhookDispatchResponse) + + if err != nil { + return err + } + + *o = WebhookDispatchResponse(varWebhookDispatchResponse) + + return err +} + +type NullableWebhookDispatchResponse struct { + value *WebhookDispatchResponse + isSet bool +} + +func (v NullableWebhookDispatchResponse) Get() *WebhookDispatchResponse { + return v.value +} + +func (v *NullableWebhookDispatchResponse) Set(val *WebhookDispatchResponse) { + v.value = val + v.isSet = true +} + +func (v NullableWebhookDispatchResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableWebhookDispatchResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWebhookDispatchResponse(val *WebhookDispatchResponse) *NullableWebhookDispatchResponse { + return &NullableWebhookDispatchResponse{value: val, isSet: true} +} + +func (v NullableWebhookDispatchResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWebhookDispatchResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_webhook_dispatch_status.go b/model_webhook_dispatch_status.go new file mode 100644 index 0000000..b381e99 --- /dev/null +++ b/model_webhook_dispatch_status.go @@ -0,0 +1,113 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" + "fmt" +) + +// WebhookDispatchStatus Status of the webhook dispatch indicating whether the HTTP request was successful. +type WebhookDispatchStatus string + +// List of WebhookDispatchStatus +const ( + ACTIVE WebhookDispatchStatus = "ACTIVE" + SUCCEEDED WebhookDispatchStatus = "SUCCEEDED" + FAILED WebhookDispatchStatus = "FAILED" +) + +// All allowed values of WebhookDispatchStatus enum +var AllowedWebhookDispatchStatusEnumValues = []WebhookDispatchStatus{ + "ACTIVE", + "SUCCEEDED", + "FAILED", +} + +func (v *WebhookDispatchStatus) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := WebhookDispatchStatus(value) + for _, existing := range AllowedWebhookDispatchStatusEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid WebhookDispatchStatus", value) +} + +// NewWebhookDispatchStatusFromValue returns a pointer to a valid WebhookDispatchStatus +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewWebhookDispatchStatusFromValue(v string) (*WebhookDispatchStatus, error) { + ev := WebhookDispatchStatus(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for WebhookDispatchStatus: valid values are %v", v, AllowedWebhookDispatchStatusEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v WebhookDispatchStatus) IsValid() bool { + for _, existing := range AllowedWebhookDispatchStatusEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to WebhookDispatchStatus value +func (v WebhookDispatchStatus) Ptr() *WebhookDispatchStatus { + return &v +} + +type NullableWebhookDispatchStatus struct { + value *WebhookDispatchStatus + isSet bool +} + +func (v NullableWebhookDispatchStatus) Get() *WebhookDispatchStatus { + return v.value +} + +func (v *NullableWebhookDispatchStatus) Set(val *WebhookDispatchStatus) { + v.value = val + v.isSet = true +} + +func (v NullableWebhookDispatchStatus) IsSet() bool { + return v.isSet +} + +func (v *NullableWebhookDispatchStatus) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWebhookDispatchStatus(val *WebhookDispatchStatus) *NullableWebhookDispatchStatus { + return &NullableWebhookDispatchStatus{value: val, isSet: true} +} + +func (v NullableWebhookDispatchStatus) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWebhookDispatchStatus) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + diff --git a/model_webhook_dispatch_webhook_summary.go b/model_webhook_dispatch_webhook_summary.go new file mode 100644 index 0000000..bcb4eee --- /dev/null +++ b/model_webhook_dispatch_webhook_summary.go @@ -0,0 +1,234 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" +) + +// checks if the WebhookDispatchWebhookSummary type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &WebhookDispatchWebhookSummary{} + +// WebhookDispatchWebhookSummary A summary of the webhook that triggered this dispatch. +type WebhookDispatchWebhookSummary struct { + ActionType *string `json:"actionType,omitempty"` + Condition *WebhookCondition `json:"condition,omitempty"` + RequestUrl *string `json:"requestUrl,omitempty"` + IsAdHoc *bool `json:"isAdHoc,omitempty"` +} + +// NewWebhookDispatchWebhookSummary instantiates a new WebhookDispatchWebhookSummary object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewWebhookDispatchWebhookSummary() *WebhookDispatchWebhookSummary { + this := WebhookDispatchWebhookSummary{} + return &this +} + +// NewWebhookDispatchWebhookSummaryWithDefaults instantiates a new WebhookDispatchWebhookSummary object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWebhookDispatchWebhookSummaryWithDefaults() *WebhookDispatchWebhookSummary { + this := WebhookDispatchWebhookSummary{} + return &this +} + +// GetActionType returns the ActionType field value if set, zero value otherwise. +func (o *WebhookDispatchWebhookSummary) GetActionType() string { + if o == nil || IsNil(o.ActionType) { + var ret string + return ret + } + return *o.ActionType +} + +// GetActionTypeOk returns a tuple with the ActionType field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WebhookDispatchWebhookSummary) GetActionTypeOk() (*string, bool) { + if o == nil || IsNil(o.ActionType) { + return nil, false + } + return o.ActionType, true +} + +// HasActionType returns a boolean if a field has been set. +func (o *WebhookDispatchWebhookSummary) HasActionType() bool { + if o != nil && !IsNil(o.ActionType) { + return true + } + + return false +} + +// SetActionType gets a reference to the given string and assigns it to the ActionType field. +func (o *WebhookDispatchWebhookSummary) SetActionType(v string) { + o.ActionType = &v +} + +// GetCondition returns the Condition field value if set, zero value otherwise. +func (o *WebhookDispatchWebhookSummary) GetCondition() WebhookCondition { + if o == nil || IsNil(o.Condition) { + var ret WebhookCondition + return ret + } + return *o.Condition +} + +// GetConditionOk returns a tuple with the Condition field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WebhookDispatchWebhookSummary) GetConditionOk() (*WebhookCondition, bool) { + if o == nil || IsNil(o.Condition) { + return nil, false + } + return o.Condition, true +} + +// HasCondition returns a boolean if a field has been set. +func (o *WebhookDispatchWebhookSummary) HasCondition() bool { + if o != nil && !IsNil(o.Condition) { + return true + } + + return false +} + +// SetCondition gets a reference to the given WebhookCondition and assigns it to the Condition field. +func (o *WebhookDispatchWebhookSummary) SetCondition(v WebhookCondition) { + o.Condition = &v +} + +// GetRequestUrl returns the RequestUrl field value if set, zero value otherwise. +func (o *WebhookDispatchWebhookSummary) GetRequestUrl() string { + if o == nil || IsNil(o.RequestUrl) { + var ret string + return ret + } + return *o.RequestUrl +} + +// GetRequestUrlOk returns a tuple with the RequestUrl field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WebhookDispatchWebhookSummary) GetRequestUrlOk() (*string, bool) { + if o == nil || IsNil(o.RequestUrl) { + return nil, false + } + return o.RequestUrl, true +} + +// HasRequestUrl returns a boolean if a field has been set. +func (o *WebhookDispatchWebhookSummary) HasRequestUrl() bool { + if o != nil && !IsNil(o.RequestUrl) { + return true + } + + return false +} + +// SetRequestUrl gets a reference to the given string and assigns it to the RequestUrl field. +func (o *WebhookDispatchWebhookSummary) SetRequestUrl(v string) { + o.RequestUrl = &v +} + +// GetIsAdHoc returns the IsAdHoc field value if set, zero value otherwise. +func (o *WebhookDispatchWebhookSummary) GetIsAdHoc() bool { + if o == nil || IsNil(o.IsAdHoc) { + var ret bool + return ret + } + return *o.IsAdHoc +} + +// GetIsAdHocOk returns a tuple with the IsAdHoc field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WebhookDispatchWebhookSummary) GetIsAdHocOk() (*bool, bool) { + if o == nil || IsNil(o.IsAdHoc) { + return nil, false + } + return o.IsAdHoc, true +} + +// HasIsAdHoc returns a boolean if a field has been set. +func (o *WebhookDispatchWebhookSummary) HasIsAdHoc() bool { + if o != nil && !IsNil(o.IsAdHoc) { + return true + } + + return false +} + +// SetIsAdHoc gets a reference to the given bool and assigns it to the IsAdHoc field. +func (o *WebhookDispatchWebhookSummary) SetIsAdHoc(v bool) { + o.IsAdHoc = &v +} + +func (o WebhookDispatchWebhookSummary) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o WebhookDispatchWebhookSummary) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.ActionType) { + toSerialize["actionType"] = o.ActionType + } + if !IsNil(o.Condition) { + toSerialize["condition"] = o.Condition + } + if !IsNil(o.RequestUrl) { + toSerialize["requestUrl"] = o.RequestUrl + } + if !IsNil(o.IsAdHoc) { + toSerialize["isAdHoc"] = o.IsAdHoc + } + return toSerialize, nil +} + +type NullableWebhookDispatchWebhookSummary struct { + value *WebhookDispatchWebhookSummary + isSet bool +} + +func (v NullableWebhookDispatchWebhookSummary) Get() *WebhookDispatchWebhookSummary { + return v.value +} + +func (v *NullableWebhookDispatchWebhookSummary) Set(val *WebhookDispatchWebhookSummary) { + v.value = val + v.isSet = true +} + +func (v NullableWebhookDispatchWebhookSummary) IsSet() bool { + return v.isSet +} + +func (v *NullableWebhookDispatchWebhookSummary) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWebhookDispatchWebhookSummary(val *WebhookDispatchWebhookSummary) *NullableWebhookDispatchWebhookSummary { + return &NullableWebhookDispatchWebhookSummary{value: val, isSet: true} +} + +func (v NullableWebhookDispatchWebhookSummary) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWebhookDispatchWebhookSummary) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_webhook_event_type.go b/model_webhook_event_type.go new file mode 100644 index 0000000..617b8fc --- /dev/null +++ b/model_webhook_event_type.go @@ -0,0 +1,131 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" + "fmt" +) + +// WebhookEventType Type of event that triggers the webhook. +type WebhookEventType string + +// List of WebhookEventType +const ( + ACTOR_BUILD_ABORTED WebhookEventType = "ACTOR.BUILD.ABORTED" + ACTOR_BUILD_CREATED WebhookEventType = "ACTOR.BUILD.CREATED" + ACTOR_BUILD_FAILED WebhookEventType = "ACTOR.BUILD.FAILED" + ACTOR_BUILD_SUCCEEDED WebhookEventType = "ACTOR.BUILD.SUCCEEDED" + ACTOR_BUILD_TIMED_OUT WebhookEventType = "ACTOR.BUILD.TIMED_OUT" + ACTOR_RUN_ABORTED WebhookEventType = "ACTOR.RUN.ABORTED" + ACTOR_RUN_CREATED WebhookEventType = "ACTOR.RUN.CREATED" + ACTOR_RUN_FAILED WebhookEventType = "ACTOR.RUN.FAILED" + ACTOR_RUN_RESURRECTED WebhookEventType = "ACTOR.RUN.RESURRECTED" + ACTOR_RUN_SUCCEEDED WebhookEventType = "ACTOR.RUN.SUCCEEDED" + ACTOR_RUN_TIMED_OUT WebhookEventType = "ACTOR.RUN.TIMED_OUT" + TEST WebhookEventType = "TEST" +) + +// All allowed values of WebhookEventType enum +var AllowedWebhookEventTypeEnumValues = []WebhookEventType{ + "ACTOR.BUILD.ABORTED", + "ACTOR.BUILD.CREATED", + "ACTOR.BUILD.FAILED", + "ACTOR.BUILD.SUCCEEDED", + "ACTOR.BUILD.TIMED_OUT", + "ACTOR.RUN.ABORTED", + "ACTOR.RUN.CREATED", + "ACTOR.RUN.FAILED", + "ACTOR.RUN.RESURRECTED", + "ACTOR.RUN.SUCCEEDED", + "ACTOR.RUN.TIMED_OUT", + "TEST", +} + +func (v *WebhookEventType) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := WebhookEventType(value) + for _, existing := range AllowedWebhookEventTypeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid WebhookEventType", value) +} + +// NewWebhookEventTypeFromValue returns a pointer to a valid WebhookEventType +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewWebhookEventTypeFromValue(v string) (*WebhookEventType, error) { + ev := WebhookEventType(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for WebhookEventType: valid values are %v", v, AllowedWebhookEventTypeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v WebhookEventType) IsValid() bool { + for _, existing := range AllowedWebhookEventTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to WebhookEventType value +func (v WebhookEventType) Ptr() *WebhookEventType { + return &v +} + +type NullableWebhookEventType struct { + value *WebhookEventType + isSet bool +} + +func (v NullableWebhookEventType) Get() *WebhookEventType { + return v.value +} + +func (v *NullableWebhookEventType) Set(val *WebhookEventType) { + v.value = val + v.isSet = true +} + +func (v NullableWebhookEventType) IsSet() bool { + return v.isSet +} + +func (v *NullableWebhookEventType) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWebhookEventType(val *WebhookEventType) *NullableWebhookEventType { + return &NullableWebhookEventType{value: val, isSet: true} +} + +func (v NullableWebhookEventType) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWebhookEventType) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + diff --git a/model_webhook_representation.go b/model_webhook_representation.go new file mode 100644 index 0000000..dd12907 --- /dev/null +++ b/model_webhook_representation.go @@ -0,0 +1,469 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" + "bytes" + "fmt" +) + +// checks if the WebhookRepresentation type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &WebhookRepresentation{} + +// WebhookRepresentation Minimal representation of an ad-hoc webhook attached to a single Actor run or build via the `webhooks` query parameter. The query parameter value is a Base64-encoded JSON array whose items match this schema. Persistent webhook fields (e.g. `condition`) are not used here. +type WebhookRepresentation struct { + EventTypes []WebhookEventType `json:"eventTypes"` + // The URL to which the webhook sends its payload. + RequestUrl string `json:"requestUrl"` + // Optional template for the JSON payload sent by the webhook. + PayloadTemplate NullableString `json:"payloadTemplate,omitempty"` + // Optional template for the HTTP headers sent by the webhook. + HeadersTemplate NullableString `json:"headersTemplate,omitempty"` + // Flag to also interpolate `{{...}}` variables inside string values of the payload and headers templates. + ShouldInterpolateStrings NullableBool `json:"shouldInterpolateStrings,omitempty"` + // Key that prevents creating duplicate webhooks, e.g. when the run-starting request is retried. + IdempotencyKey NullableString `json:"idempotencyKey,omitempty"` + // Flag to ignore SSL errors when the webhook sends the request. + IgnoreSslErrors NullableBool `json:"ignoreSslErrors,omitempty"` + // Flag to skip retrying the webhook request on failure. + DoNotRetry NullableBool `json:"doNotRetry,omitempty"` +} + +type _WebhookRepresentation WebhookRepresentation + +// NewWebhookRepresentation instantiates a new WebhookRepresentation object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewWebhookRepresentation(eventTypes []WebhookEventType, requestUrl string) *WebhookRepresentation { + this := WebhookRepresentation{} + this.EventTypes = eventTypes + this.RequestUrl = requestUrl + return &this +} + +// NewWebhookRepresentationWithDefaults instantiates a new WebhookRepresentation object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWebhookRepresentationWithDefaults() *WebhookRepresentation { + this := WebhookRepresentation{} + return &this +} + +// GetEventTypes returns the EventTypes field value +func (o *WebhookRepresentation) GetEventTypes() []WebhookEventType { + if o == nil { + var ret []WebhookEventType + return ret + } + + return o.EventTypes +} + +// GetEventTypesOk returns a tuple with the EventTypes field value +// and a boolean to check if the value has been set. +func (o *WebhookRepresentation) GetEventTypesOk() ([]WebhookEventType, bool) { + if o == nil { + return nil, false + } + return o.EventTypes, true +} + +// SetEventTypes sets field value +func (o *WebhookRepresentation) SetEventTypes(v []WebhookEventType) { + o.EventTypes = v +} + +// GetRequestUrl returns the RequestUrl field value +func (o *WebhookRepresentation) GetRequestUrl() string { + if o == nil { + var ret string + return ret + } + + return o.RequestUrl +} + +// GetRequestUrlOk returns a tuple with the RequestUrl field value +// and a boolean to check if the value has been set. +func (o *WebhookRepresentation) GetRequestUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.RequestUrl, true +} + +// SetRequestUrl sets field value +func (o *WebhookRepresentation) SetRequestUrl(v string) { + o.RequestUrl = v +} + +// GetPayloadTemplate returns the PayloadTemplate field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WebhookRepresentation) GetPayloadTemplate() string { + if o == nil || IsNil(o.PayloadTemplate.Get()) { + var ret string + return ret + } + return *o.PayloadTemplate.Get() +} + +// GetPayloadTemplateOk returns a tuple with the PayloadTemplate field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WebhookRepresentation) GetPayloadTemplateOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.PayloadTemplate.Get(), o.PayloadTemplate.IsSet() +} + +// HasPayloadTemplate returns a boolean if a field has been set. +func (o *WebhookRepresentation) HasPayloadTemplate() bool { + if o != nil && o.PayloadTemplate.IsSet() { + return true + } + + return false +} + +// SetPayloadTemplate gets a reference to the given NullableString and assigns it to the PayloadTemplate field. +func (o *WebhookRepresentation) SetPayloadTemplate(v string) { + o.PayloadTemplate.Set(&v) +} +// SetPayloadTemplateNil sets the value for PayloadTemplate to be an explicit nil +func (o *WebhookRepresentation) SetPayloadTemplateNil() { + o.PayloadTemplate.Set(nil) +} + +// UnsetPayloadTemplate ensures that no value is present for PayloadTemplate, not even an explicit nil +func (o *WebhookRepresentation) UnsetPayloadTemplate() { + o.PayloadTemplate.Unset() +} + +// GetHeadersTemplate returns the HeadersTemplate field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WebhookRepresentation) GetHeadersTemplate() string { + if o == nil || IsNil(o.HeadersTemplate.Get()) { + var ret string + return ret + } + return *o.HeadersTemplate.Get() +} + +// GetHeadersTemplateOk returns a tuple with the HeadersTemplate field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WebhookRepresentation) GetHeadersTemplateOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.HeadersTemplate.Get(), o.HeadersTemplate.IsSet() +} + +// HasHeadersTemplate returns a boolean if a field has been set. +func (o *WebhookRepresentation) HasHeadersTemplate() bool { + if o != nil && o.HeadersTemplate.IsSet() { + return true + } + + return false +} + +// SetHeadersTemplate gets a reference to the given NullableString and assigns it to the HeadersTemplate field. +func (o *WebhookRepresentation) SetHeadersTemplate(v string) { + o.HeadersTemplate.Set(&v) +} +// SetHeadersTemplateNil sets the value for HeadersTemplate to be an explicit nil +func (o *WebhookRepresentation) SetHeadersTemplateNil() { + o.HeadersTemplate.Set(nil) +} + +// UnsetHeadersTemplate ensures that no value is present for HeadersTemplate, not even an explicit nil +func (o *WebhookRepresentation) UnsetHeadersTemplate() { + o.HeadersTemplate.Unset() +} + +// GetShouldInterpolateStrings returns the ShouldInterpolateStrings field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WebhookRepresentation) GetShouldInterpolateStrings() bool { + if o == nil || IsNil(o.ShouldInterpolateStrings.Get()) { + var ret bool + return ret + } + return *o.ShouldInterpolateStrings.Get() +} + +// GetShouldInterpolateStringsOk returns a tuple with the ShouldInterpolateStrings field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WebhookRepresentation) GetShouldInterpolateStringsOk() (*bool, bool) { + if o == nil { + return nil, false + } + return o.ShouldInterpolateStrings.Get(), o.ShouldInterpolateStrings.IsSet() +} + +// HasShouldInterpolateStrings returns a boolean if a field has been set. +func (o *WebhookRepresentation) HasShouldInterpolateStrings() bool { + if o != nil && o.ShouldInterpolateStrings.IsSet() { + return true + } + + return false +} + +// SetShouldInterpolateStrings gets a reference to the given NullableBool and assigns it to the ShouldInterpolateStrings field. +func (o *WebhookRepresentation) SetShouldInterpolateStrings(v bool) { + o.ShouldInterpolateStrings.Set(&v) +} +// SetShouldInterpolateStringsNil sets the value for ShouldInterpolateStrings to be an explicit nil +func (o *WebhookRepresentation) SetShouldInterpolateStringsNil() { + o.ShouldInterpolateStrings.Set(nil) +} + +// UnsetShouldInterpolateStrings ensures that no value is present for ShouldInterpolateStrings, not even an explicit nil +func (o *WebhookRepresentation) UnsetShouldInterpolateStrings() { + o.ShouldInterpolateStrings.Unset() +} + +// GetIdempotencyKey returns the IdempotencyKey field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WebhookRepresentation) GetIdempotencyKey() string { + if o == nil || IsNil(o.IdempotencyKey.Get()) { + var ret string + return ret + } + return *o.IdempotencyKey.Get() +} + +// GetIdempotencyKeyOk returns a tuple with the IdempotencyKey field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WebhookRepresentation) GetIdempotencyKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.IdempotencyKey.Get(), o.IdempotencyKey.IsSet() +} + +// HasIdempotencyKey returns a boolean if a field has been set. +func (o *WebhookRepresentation) HasIdempotencyKey() bool { + if o != nil && o.IdempotencyKey.IsSet() { + return true + } + + return false +} + +// SetIdempotencyKey gets a reference to the given NullableString and assigns it to the IdempotencyKey field. +func (o *WebhookRepresentation) SetIdempotencyKey(v string) { + o.IdempotencyKey.Set(&v) +} +// SetIdempotencyKeyNil sets the value for IdempotencyKey to be an explicit nil +func (o *WebhookRepresentation) SetIdempotencyKeyNil() { + o.IdempotencyKey.Set(nil) +} + +// UnsetIdempotencyKey ensures that no value is present for IdempotencyKey, not even an explicit nil +func (o *WebhookRepresentation) UnsetIdempotencyKey() { + o.IdempotencyKey.Unset() +} + +// GetIgnoreSslErrors returns the IgnoreSslErrors field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WebhookRepresentation) GetIgnoreSslErrors() bool { + if o == nil || IsNil(o.IgnoreSslErrors.Get()) { + var ret bool + return ret + } + return *o.IgnoreSslErrors.Get() +} + +// GetIgnoreSslErrorsOk returns a tuple with the IgnoreSslErrors field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WebhookRepresentation) GetIgnoreSslErrorsOk() (*bool, bool) { + if o == nil { + return nil, false + } + return o.IgnoreSslErrors.Get(), o.IgnoreSslErrors.IsSet() +} + +// HasIgnoreSslErrors returns a boolean if a field has been set. +func (o *WebhookRepresentation) HasIgnoreSslErrors() bool { + if o != nil && o.IgnoreSslErrors.IsSet() { + return true + } + + return false +} + +// SetIgnoreSslErrors gets a reference to the given NullableBool and assigns it to the IgnoreSslErrors field. +func (o *WebhookRepresentation) SetIgnoreSslErrors(v bool) { + o.IgnoreSslErrors.Set(&v) +} +// SetIgnoreSslErrorsNil sets the value for IgnoreSslErrors to be an explicit nil +func (o *WebhookRepresentation) SetIgnoreSslErrorsNil() { + o.IgnoreSslErrors.Set(nil) +} + +// UnsetIgnoreSslErrors ensures that no value is present for IgnoreSslErrors, not even an explicit nil +func (o *WebhookRepresentation) UnsetIgnoreSslErrors() { + o.IgnoreSslErrors.Unset() +} + +// GetDoNotRetry returns the DoNotRetry field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WebhookRepresentation) GetDoNotRetry() bool { + if o == nil || IsNil(o.DoNotRetry.Get()) { + var ret bool + return ret + } + return *o.DoNotRetry.Get() +} + +// GetDoNotRetryOk returns a tuple with the DoNotRetry field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WebhookRepresentation) GetDoNotRetryOk() (*bool, bool) { + if o == nil { + return nil, false + } + return o.DoNotRetry.Get(), o.DoNotRetry.IsSet() +} + +// HasDoNotRetry returns a boolean if a field has been set. +func (o *WebhookRepresentation) HasDoNotRetry() bool { + if o != nil && o.DoNotRetry.IsSet() { + return true + } + + return false +} + +// SetDoNotRetry gets a reference to the given NullableBool and assigns it to the DoNotRetry field. +func (o *WebhookRepresentation) SetDoNotRetry(v bool) { + o.DoNotRetry.Set(&v) +} +// SetDoNotRetryNil sets the value for DoNotRetry to be an explicit nil +func (o *WebhookRepresentation) SetDoNotRetryNil() { + o.DoNotRetry.Set(nil) +} + +// UnsetDoNotRetry ensures that no value is present for DoNotRetry, not even an explicit nil +func (o *WebhookRepresentation) UnsetDoNotRetry() { + o.DoNotRetry.Unset() +} + +func (o WebhookRepresentation) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o WebhookRepresentation) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["eventTypes"] = o.EventTypes + toSerialize["requestUrl"] = o.RequestUrl + if o.PayloadTemplate.IsSet() { + toSerialize["payloadTemplate"] = o.PayloadTemplate.Get() + } + if o.HeadersTemplate.IsSet() { + toSerialize["headersTemplate"] = o.HeadersTemplate.Get() + } + if o.ShouldInterpolateStrings.IsSet() { + toSerialize["shouldInterpolateStrings"] = o.ShouldInterpolateStrings.Get() + } + if o.IdempotencyKey.IsSet() { + toSerialize["idempotencyKey"] = o.IdempotencyKey.Get() + } + if o.IgnoreSslErrors.IsSet() { + toSerialize["ignoreSslErrors"] = o.IgnoreSslErrors.Get() + } + if o.DoNotRetry.IsSet() { + toSerialize["doNotRetry"] = o.DoNotRetry.Get() + } + return toSerialize, nil +} + +func (o *WebhookRepresentation) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "eventTypes", + "requestUrl", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varWebhookRepresentation := _WebhookRepresentation{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varWebhookRepresentation) + + if err != nil { + return err + } + + *o = WebhookRepresentation(varWebhookRepresentation) + + return err +} + +type NullableWebhookRepresentation struct { + value *WebhookRepresentation + isSet bool +} + +func (v NullableWebhookRepresentation) Get() *WebhookRepresentation { + return v.value +} + +func (v *NullableWebhookRepresentation) Set(val *WebhookRepresentation) { + v.value = val + v.isSet = true +} + +func (v NullableWebhookRepresentation) IsSet() bool { + return v.isSet +} + +func (v *NullableWebhookRepresentation) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWebhookRepresentation(val *WebhookRepresentation) *NullableWebhookRepresentation { + return &NullableWebhookRepresentation{value: val, isSet: true} +} + +func (v NullableWebhookRepresentation) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWebhookRepresentation) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_webhook_response.go b/model_webhook_response.go new file mode 100644 index 0000000..ae5a74d --- /dev/null +++ b/model_webhook_response.go @@ -0,0 +1,158 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" + "bytes" + "fmt" +) + +// checks if the WebhookResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &WebhookResponse{} + +// WebhookResponse Response containing webhook data. +type WebhookResponse struct { + Data Webhook `json:"data"` +} + +type _WebhookResponse WebhookResponse + +// NewWebhookResponse instantiates a new WebhookResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewWebhookResponse(data Webhook) *WebhookResponse { + this := WebhookResponse{} + this.Data = data + return &this +} + +// NewWebhookResponseWithDefaults instantiates a new WebhookResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWebhookResponseWithDefaults() *WebhookResponse { + this := WebhookResponse{} + return &this +} + +// GetData returns the Data field value +func (o *WebhookResponse) GetData() Webhook { + if o == nil { + var ret Webhook + return ret + } + + return o.Data +} + +// GetDataOk returns a tuple with the Data field value +// and a boolean to check if the value has been set. +func (o *WebhookResponse) GetDataOk() (*Webhook, bool) { + if o == nil { + return nil, false + } + return &o.Data, true +} + +// SetData sets field value +func (o *WebhookResponse) SetData(v Webhook) { + o.Data = v +} + +func (o WebhookResponse) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o WebhookResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["data"] = o.Data + return toSerialize, nil +} + +func (o *WebhookResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "data", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varWebhookResponse := _WebhookResponse{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varWebhookResponse) + + if err != nil { + return err + } + + *o = WebhookResponse(varWebhookResponse) + + return err +} + +type NullableWebhookResponse struct { + value *WebhookResponse + isSet bool +} + +func (v NullableWebhookResponse) Get() *WebhookResponse { + return v.value +} + +func (v *NullableWebhookResponse) Set(val *WebhookResponse) { + v.value = val + v.isSet = true +} + +func (v NullableWebhookResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableWebhookResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWebhookResponse(val *WebhookResponse) *NullableWebhookResponse { + return &NullableWebhookResponse{value: val, isSet: true} +} + +func (v NullableWebhookResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWebhookResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_webhook_short.go b/model_webhook_short.go new file mode 100644 index 0000000..5f65b7a --- /dev/null +++ b/model_webhook_short.go @@ -0,0 +1,675 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" + "time" + "bytes" + "fmt" +) + +// checks if the WebhookShort type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &WebhookShort{} + +// WebhookShort struct for WebhookShort +type WebhookShort struct { + Id string `json:"id"` + CreatedAt time.Time `json:"createdAt"` + ModifiedAt time.Time `json:"modifiedAt"` + UserId string `json:"userId"` + IsAdHoc NullableBool `json:"isAdHoc,omitempty"` + IsApifyIntegration *bool `json:"isApifyIntegration,omitempty"` + IsEnabled *bool `json:"isEnabled,omitempty"` + ActionType *string `json:"actionType,omitempty"` + ShouldInterpolateStrings NullableBool `json:"shouldInterpolateStrings,omitempty"` + EventTypes []WebhookEventType `json:"eventTypes"` + Condition WebhookCondition `json:"condition"` + IgnoreSslErrors bool `json:"ignoreSslErrors"` + DoNotRetry bool `json:"doNotRetry"` + RequestUrl string `json:"requestUrl"` + LastDispatch NullableExampleWebhookDispatch `json:"lastDispatch,omitempty"` + Stats NullableWebhookStats `json:"stats,omitempty"` +} + +type _WebhookShort WebhookShort + +// NewWebhookShort instantiates a new WebhookShort object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewWebhookShort(id string, createdAt time.Time, modifiedAt time.Time, userId string, eventTypes []WebhookEventType, condition WebhookCondition, ignoreSslErrors bool, doNotRetry bool, requestUrl string) *WebhookShort { + this := WebhookShort{} + this.Id = id + this.CreatedAt = createdAt + this.ModifiedAt = modifiedAt + this.UserId = userId + this.EventTypes = eventTypes + this.Condition = condition + this.IgnoreSslErrors = ignoreSslErrors + this.DoNotRetry = doNotRetry + this.RequestUrl = requestUrl + return &this +} + +// NewWebhookShortWithDefaults instantiates a new WebhookShort object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWebhookShortWithDefaults() *WebhookShort { + this := WebhookShort{} + return &this +} + +// GetId returns the Id field value +func (o *WebhookShort) GetId() string { + if o == nil { + var ret string + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *WebhookShort) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *WebhookShort) SetId(v string) { + o.Id = v +} + +// GetCreatedAt returns the CreatedAt field value +func (o *WebhookShort) GetCreatedAt() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value +// and a boolean to check if the value has been set. +func (o *WebhookShort) GetCreatedAtOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.CreatedAt, true +} + +// SetCreatedAt sets field value +func (o *WebhookShort) SetCreatedAt(v time.Time) { + o.CreatedAt = v +} + +// GetModifiedAt returns the ModifiedAt field value +func (o *WebhookShort) GetModifiedAt() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.ModifiedAt +} + +// GetModifiedAtOk returns a tuple with the ModifiedAt field value +// and a boolean to check if the value has been set. +func (o *WebhookShort) GetModifiedAtOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.ModifiedAt, true +} + +// SetModifiedAt sets field value +func (o *WebhookShort) SetModifiedAt(v time.Time) { + o.ModifiedAt = v +} + +// GetUserId returns the UserId field value +func (o *WebhookShort) GetUserId() string { + if o == nil { + var ret string + return ret + } + + return o.UserId +} + +// GetUserIdOk returns a tuple with the UserId field value +// and a boolean to check if the value has been set. +func (o *WebhookShort) GetUserIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.UserId, true +} + +// SetUserId sets field value +func (o *WebhookShort) SetUserId(v string) { + o.UserId = v +} + +// GetIsAdHoc returns the IsAdHoc field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WebhookShort) GetIsAdHoc() bool { + if o == nil || IsNil(o.IsAdHoc.Get()) { + var ret bool + return ret + } + return *o.IsAdHoc.Get() +} + +// GetIsAdHocOk returns a tuple with the IsAdHoc field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WebhookShort) GetIsAdHocOk() (*bool, bool) { + if o == nil { + return nil, false + } + return o.IsAdHoc.Get(), o.IsAdHoc.IsSet() +} + +// HasIsAdHoc returns a boolean if a field has been set. +func (o *WebhookShort) HasIsAdHoc() bool { + if o != nil && o.IsAdHoc.IsSet() { + return true + } + + return false +} + +// SetIsAdHoc gets a reference to the given NullableBool and assigns it to the IsAdHoc field. +func (o *WebhookShort) SetIsAdHoc(v bool) { + o.IsAdHoc.Set(&v) +} +// SetIsAdHocNil sets the value for IsAdHoc to be an explicit nil +func (o *WebhookShort) SetIsAdHocNil() { + o.IsAdHoc.Set(nil) +} + +// UnsetIsAdHoc ensures that no value is present for IsAdHoc, not even an explicit nil +func (o *WebhookShort) UnsetIsAdHoc() { + o.IsAdHoc.Unset() +} + +// GetIsApifyIntegration returns the IsApifyIntegration field value if set, zero value otherwise. +func (o *WebhookShort) GetIsApifyIntegration() bool { + if o == nil || IsNil(o.IsApifyIntegration) { + var ret bool + return ret + } + return *o.IsApifyIntegration +} + +// GetIsApifyIntegrationOk returns a tuple with the IsApifyIntegration field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WebhookShort) GetIsApifyIntegrationOk() (*bool, bool) { + if o == nil || IsNil(o.IsApifyIntegration) { + return nil, false + } + return o.IsApifyIntegration, true +} + +// HasIsApifyIntegration returns a boolean if a field has been set. +func (o *WebhookShort) HasIsApifyIntegration() bool { + if o != nil && !IsNil(o.IsApifyIntegration) { + return true + } + + return false +} + +// SetIsApifyIntegration gets a reference to the given bool and assigns it to the IsApifyIntegration field. +func (o *WebhookShort) SetIsApifyIntegration(v bool) { + o.IsApifyIntegration = &v +} + +// GetIsEnabled returns the IsEnabled field value if set, zero value otherwise. +func (o *WebhookShort) GetIsEnabled() bool { + if o == nil || IsNil(o.IsEnabled) { + var ret bool + return ret + } + return *o.IsEnabled +} + +// GetIsEnabledOk returns a tuple with the IsEnabled field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WebhookShort) GetIsEnabledOk() (*bool, bool) { + if o == nil || IsNil(o.IsEnabled) { + return nil, false + } + return o.IsEnabled, true +} + +// HasIsEnabled returns a boolean if a field has been set. +func (o *WebhookShort) HasIsEnabled() bool { + if o != nil && !IsNil(o.IsEnabled) { + return true + } + + return false +} + +// SetIsEnabled gets a reference to the given bool and assigns it to the IsEnabled field. +func (o *WebhookShort) SetIsEnabled(v bool) { + o.IsEnabled = &v +} + +// GetActionType returns the ActionType field value if set, zero value otherwise. +func (o *WebhookShort) GetActionType() string { + if o == nil || IsNil(o.ActionType) { + var ret string + return ret + } + return *o.ActionType +} + +// GetActionTypeOk returns a tuple with the ActionType field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WebhookShort) GetActionTypeOk() (*string, bool) { + if o == nil || IsNil(o.ActionType) { + return nil, false + } + return o.ActionType, true +} + +// HasActionType returns a boolean if a field has been set. +func (o *WebhookShort) HasActionType() bool { + if o != nil && !IsNil(o.ActionType) { + return true + } + + return false +} + +// SetActionType gets a reference to the given string and assigns it to the ActionType field. +func (o *WebhookShort) SetActionType(v string) { + o.ActionType = &v +} + +// GetShouldInterpolateStrings returns the ShouldInterpolateStrings field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WebhookShort) GetShouldInterpolateStrings() bool { + if o == nil || IsNil(o.ShouldInterpolateStrings.Get()) { + var ret bool + return ret + } + return *o.ShouldInterpolateStrings.Get() +} + +// GetShouldInterpolateStringsOk returns a tuple with the ShouldInterpolateStrings field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WebhookShort) GetShouldInterpolateStringsOk() (*bool, bool) { + if o == nil { + return nil, false + } + return o.ShouldInterpolateStrings.Get(), o.ShouldInterpolateStrings.IsSet() +} + +// HasShouldInterpolateStrings returns a boolean if a field has been set. +func (o *WebhookShort) HasShouldInterpolateStrings() bool { + if o != nil && o.ShouldInterpolateStrings.IsSet() { + return true + } + + return false +} + +// SetShouldInterpolateStrings gets a reference to the given NullableBool and assigns it to the ShouldInterpolateStrings field. +func (o *WebhookShort) SetShouldInterpolateStrings(v bool) { + o.ShouldInterpolateStrings.Set(&v) +} +// SetShouldInterpolateStringsNil sets the value for ShouldInterpolateStrings to be an explicit nil +func (o *WebhookShort) SetShouldInterpolateStringsNil() { + o.ShouldInterpolateStrings.Set(nil) +} + +// UnsetShouldInterpolateStrings ensures that no value is present for ShouldInterpolateStrings, not even an explicit nil +func (o *WebhookShort) UnsetShouldInterpolateStrings() { + o.ShouldInterpolateStrings.Unset() +} + +// GetEventTypes returns the EventTypes field value +func (o *WebhookShort) GetEventTypes() []WebhookEventType { + if o == nil { + var ret []WebhookEventType + return ret + } + + return o.EventTypes +} + +// GetEventTypesOk returns a tuple with the EventTypes field value +// and a boolean to check if the value has been set. +func (o *WebhookShort) GetEventTypesOk() ([]WebhookEventType, bool) { + if o == nil { + return nil, false + } + return o.EventTypes, true +} + +// SetEventTypes sets field value +func (o *WebhookShort) SetEventTypes(v []WebhookEventType) { + o.EventTypes = v +} + +// GetCondition returns the Condition field value +func (o *WebhookShort) GetCondition() WebhookCondition { + if o == nil { + var ret WebhookCondition + return ret + } + + return o.Condition +} + +// GetConditionOk returns a tuple with the Condition field value +// and a boolean to check if the value has been set. +func (o *WebhookShort) GetConditionOk() (*WebhookCondition, bool) { + if o == nil { + return nil, false + } + return &o.Condition, true +} + +// SetCondition sets field value +func (o *WebhookShort) SetCondition(v WebhookCondition) { + o.Condition = v +} + +// GetIgnoreSslErrors returns the IgnoreSslErrors field value +func (o *WebhookShort) GetIgnoreSslErrors() bool { + if o == nil { + var ret bool + return ret + } + + return o.IgnoreSslErrors +} + +// GetIgnoreSslErrorsOk returns a tuple with the IgnoreSslErrors field value +// and a boolean to check if the value has been set. +func (o *WebhookShort) GetIgnoreSslErrorsOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.IgnoreSslErrors, true +} + +// SetIgnoreSslErrors sets field value +func (o *WebhookShort) SetIgnoreSslErrors(v bool) { + o.IgnoreSslErrors = v +} + +// GetDoNotRetry returns the DoNotRetry field value +func (o *WebhookShort) GetDoNotRetry() bool { + if o == nil { + var ret bool + return ret + } + + return o.DoNotRetry +} + +// GetDoNotRetryOk returns a tuple with the DoNotRetry field value +// and a boolean to check if the value has been set. +func (o *WebhookShort) GetDoNotRetryOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.DoNotRetry, true +} + +// SetDoNotRetry sets field value +func (o *WebhookShort) SetDoNotRetry(v bool) { + o.DoNotRetry = v +} + +// GetRequestUrl returns the RequestUrl field value +func (o *WebhookShort) GetRequestUrl() string { + if o == nil { + var ret string + return ret + } + + return o.RequestUrl +} + +// GetRequestUrlOk returns a tuple with the RequestUrl field value +// and a boolean to check if the value has been set. +func (o *WebhookShort) GetRequestUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.RequestUrl, true +} + +// SetRequestUrl sets field value +func (o *WebhookShort) SetRequestUrl(v string) { + o.RequestUrl = v +} + +// GetLastDispatch returns the LastDispatch field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WebhookShort) GetLastDispatch() ExampleWebhookDispatch { + if o == nil || IsNil(o.LastDispatch.Get()) { + var ret ExampleWebhookDispatch + return ret + } + return *o.LastDispatch.Get() +} + +// GetLastDispatchOk returns a tuple with the LastDispatch field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WebhookShort) GetLastDispatchOk() (*ExampleWebhookDispatch, bool) { + if o == nil { + return nil, false + } + return o.LastDispatch.Get(), o.LastDispatch.IsSet() +} + +// HasLastDispatch returns a boolean if a field has been set. +func (o *WebhookShort) HasLastDispatch() bool { + if o != nil && o.LastDispatch.IsSet() { + return true + } + + return false +} + +// SetLastDispatch gets a reference to the given NullableExampleWebhookDispatch and assigns it to the LastDispatch field. +func (o *WebhookShort) SetLastDispatch(v ExampleWebhookDispatch) { + o.LastDispatch.Set(&v) +} +// SetLastDispatchNil sets the value for LastDispatch to be an explicit nil +func (o *WebhookShort) SetLastDispatchNil() { + o.LastDispatch.Set(nil) +} + +// UnsetLastDispatch ensures that no value is present for LastDispatch, not even an explicit nil +func (o *WebhookShort) UnsetLastDispatch() { + o.LastDispatch.Unset() +} + +// GetStats returns the Stats field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WebhookShort) GetStats() WebhookStats { + if o == nil || IsNil(o.Stats.Get()) { + var ret WebhookStats + return ret + } + return *o.Stats.Get() +} + +// GetStatsOk returns a tuple with the Stats field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WebhookShort) GetStatsOk() (*WebhookStats, bool) { + if o == nil { + return nil, false + } + return o.Stats.Get(), o.Stats.IsSet() +} + +// HasStats returns a boolean if a field has been set. +func (o *WebhookShort) HasStats() bool { + if o != nil && o.Stats.IsSet() { + return true + } + + return false +} + +// SetStats gets a reference to the given NullableWebhookStats and assigns it to the Stats field. +func (o *WebhookShort) SetStats(v WebhookStats) { + o.Stats.Set(&v) +} +// SetStatsNil sets the value for Stats to be an explicit nil +func (o *WebhookShort) SetStatsNil() { + o.Stats.Set(nil) +} + +// UnsetStats ensures that no value is present for Stats, not even an explicit nil +func (o *WebhookShort) UnsetStats() { + o.Stats.Unset() +} + +func (o WebhookShort) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o WebhookShort) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["createdAt"] = o.CreatedAt + toSerialize["modifiedAt"] = o.ModifiedAt + toSerialize["userId"] = o.UserId + if o.IsAdHoc.IsSet() { + toSerialize["isAdHoc"] = o.IsAdHoc.Get() + } + if !IsNil(o.IsApifyIntegration) { + toSerialize["isApifyIntegration"] = o.IsApifyIntegration + } + if !IsNil(o.IsEnabled) { + toSerialize["isEnabled"] = o.IsEnabled + } + if !IsNil(o.ActionType) { + toSerialize["actionType"] = o.ActionType + } + if o.ShouldInterpolateStrings.IsSet() { + toSerialize["shouldInterpolateStrings"] = o.ShouldInterpolateStrings.Get() + } + toSerialize["eventTypes"] = o.EventTypes + toSerialize["condition"] = o.Condition + toSerialize["ignoreSslErrors"] = o.IgnoreSslErrors + toSerialize["doNotRetry"] = o.DoNotRetry + toSerialize["requestUrl"] = o.RequestUrl + if o.LastDispatch.IsSet() { + toSerialize["lastDispatch"] = o.LastDispatch.Get() + } + if o.Stats.IsSet() { + toSerialize["stats"] = o.Stats.Get() + } + return toSerialize, nil +} + +func (o *WebhookShort) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "createdAt", + "modifiedAt", + "userId", + "eventTypes", + "condition", + "ignoreSslErrors", + "doNotRetry", + "requestUrl", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varWebhookShort := _WebhookShort{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varWebhookShort) + + if err != nil { + return err + } + + *o = WebhookShort(varWebhookShort) + + return err +} + +type NullableWebhookShort struct { + value *WebhookShort + isSet bool +} + +func (v NullableWebhookShort) Get() *WebhookShort { + return v.value +} + +func (v *NullableWebhookShort) Set(val *WebhookShort) { + v.value = val + v.isSet = true +} + +func (v NullableWebhookShort) IsSet() bool { + return v.isSet +} + +func (v *NullableWebhookShort) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWebhookShort(val *WebhookShort) *NullableWebhookShort { + return &NullableWebhookShort{value: val, isSet: true} +} + +func (v NullableWebhookShort) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWebhookShort) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_webhook_stats.go b/model_webhook_stats.go new file mode 100644 index 0000000..02de22c --- /dev/null +++ b/model_webhook_stats.go @@ -0,0 +1,158 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" + "bytes" + "fmt" +) + +// checks if the WebhookStats type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &WebhookStats{} + +// WebhookStats struct for WebhookStats +type WebhookStats struct { + TotalDispatches int32 `json:"totalDispatches"` +} + +type _WebhookStats WebhookStats + +// NewWebhookStats instantiates a new WebhookStats object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewWebhookStats(totalDispatches int32) *WebhookStats { + this := WebhookStats{} + this.TotalDispatches = totalDispatches + return &this +} + +// NewWebhookStatsWithDefaults instantiates a new WebhookStats object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWebhookStatsWithDefaults() *WebhookStats { + this := WebhookStats{} + return &this +} + +// GetTotalDispatches returns the TotalDispatches field value +func (o *WebhookStats) GetTotalDispatches() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.TotalDispatches +} + +// GetTotalDispatchesOk returns a tuple with the TotalDispatches field value +// and a boolean to check if the value has been set. +func (o *WebhookStats) GetTotalDispatchesOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.TotalDispatches, true +} + +// SetTotalDispatches sets field value +func (o *WebhookStats) SetTotalDispatches(v int32) { + o.TotalDispatches = v +} + +func (o WebhookStats) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o WebhookStats) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["totalDispatches"] = o.TotalDispatches + return toSerialize, nil +} + +func (o *WebhookStats) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "totalDispatches", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varWebhookStats := _WebhookStats{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varWebhookStats) + + if err != nil { + return err + } + + *o = WebhookStats(varWebhookStats) + + return err +} + +type NullableWebhookStats struct { + value *WebhookStats + isSet bool +} + +func (v NullableWebhookStats) Get() *WebhookStats { + return v.value +} + +func (v *NullableWebhookStats) Set(val *WebhookStats) { + v.value = val + v.isSet = true +} + +func (v NullableWebhookStats) IsSet() bool { + return v.isSet +} + +func (v *NullableWebhookStats) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWebhookStats(val *WebhookStats) *NullableWebhookStats { + return &NullableWebhookStats{value: val, isSet: true} +} + +func (v NullableWebhookStats) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWebhookStats) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_webhook_update.go b/model_webhook_update.go new file mode 100644 index 0000000..3659609 --- /dev/null +++ b/model_webhook_update.go @@ -0,0 +1,542 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "encoding/json" +) + +// checks if the WebhookUpdate type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &WebhookUpdate{} + +// WebhookUpdate struct for WebhookUpdate +type WebhookUpdate struct { + IsAdHoc NullableBool `json:"isAdHoc,omitempty"` + // + EventTypes []WebhookEventType `json:"eventTypes,omitempty"` + Condition NullableWebhookCondition `json:"condition,omitempty"` + IgnoreSslErrors NullableBool `json:"ignoreSslErrors,omitempty"` + DoNotRetry NullableBool `json:"doNotRetry,omitempty"` + RequestUrl NullableString `json:"requestUrl,omitempty"` + PayloadTemplate NullableString `json:"payloadTemplate,omitempty"` + HeadersTemplate NullableString `json:"headersTemplate,omitempty"` + Description NullableString `json:"description,omitempty"` + ShouldInterpolateStrings NullableBool `json:"shouldInterpolateStrings,omitempty"` +} + +// NewWebhookUpdate instantiates a new WebhookUpdate object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewWebhookUpdate() *WebhookUpdate { + this := WebhookUpdate{} + return &this +} + +// NewWebhookUpdateWithDefaults instantiates a new WebhookUpdate object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWebhookUpdateWithDefaults() *WebhookUpdate { + this := WebhookUpdate{} + return &this +} + +// GetIsAdHoc returns the IsAdHoc field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WebhookUpdate) GetIsAdHoc() bool { + if o == nil || IsNil(o.IsAdHoc.Get()) { + var ret bool + return ret + } + return *o.IsAdHoc.Get() +} + +// GetIsAdHocOk returns a tuple with the IsAdHoc field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WebhookUpdate) GetIsAdHocOk() (*bool, bool) { + if o == nil { + return nil, false + } + return o.IsAdHoc.Get(), o.IsAdHoc.IsSet() +} + +// HasIsAdHoc returns a boolean if a field has been set. +func (o *WebhookUpdate) HasIsAdHoc() bool { + if o != nil && o.IsAdHoc.IsSet() { + return true + } + + return false +} + +// SetIsAdHoc gets a reference to the given NullableBool and assigns it to the IsAdHoc field. +func (o *WebhookUpdate) SetIsAdHoc(v bool) { + o.IsAdHoc.Set(&v) +} +// SetIsAdHocNil sets the value for IsAdHoc to be an explicit nil +func (o *WebhookUpdate) SetIsAdHocNil() { + o.IsAdHoc.Set(nil) +} + +// UnsetIsAdHoc ensures that no value is present for IsAdHoc, not even an explicit nil +func (o *WebhookUpdate) UnsetIsAdHoc() { + o.IsAdHoc.Unset() +} + +// GetEventTypes returns the EventTypes field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WebhookUpdate) GetEventTypes() []WebhookEventType { + if o == nil { + var ret []WebhookEventType + return ret + } + return o.EventTypes +} + +// GetEventTypesOk returns a tuple with the EventTypes field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WebhookUpdate) GetEventTypesOk() ([]WebhookEventType, bool) { + if o == nil || IsNil(o.EventTypes) { + return nil, false + } + return o.EventTypes, true +} + +// HasEventTypes returns a boolean if a field has been set. +func (o *WebhookUpdate) HasEventTypes() bool { + if o != nil && !IsNil(o.EventTypes) { + return true + } + + return false +} + +// SetEventTypes gets a reference to the given []WebhookEventType and assigns it to the EventTypes field. +func (o *WebhookUpdate) SetEventTypes(v []WebhookEventType) { + o.EventTypes = v +} + +// GetCondition returns the Condition field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WebhookUpdate) GetCondition() WebhookCondition { + if o == nil || IsNil(o.Condition.Get()) { + var ret WebhookCondition + return ret + } + return *o.Condition.Get() +} + +// GetConditionOk returns a tuple with the Condition field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WebhookUpdate) GetConditionOk() (*WebhookCondition, bool) { + if o == nil { + return nil, false + } + return o.Condition.Get(), o.Condition.IsSet() +} + +// HasCondition returns a boolean if a field has been set. +func (o *WebhookUpdate) HasCondition() bool { + if o != nil && o.Condition.IsSet() { + return true + } + + return false +} + +// SetCondition gets a reference to the given NullableWebhookCondition and assigns it to the Condition field. +func (o *WebhookUpdate) SetCondition(v WebhookCondition) { + o.Condition.Set(&v) +} +// SetConditionNil sets the value for Condition to be an explicit nil +func (o *WebhookUpdate) SetConditionNil() { + o.Condition.Set(nil) +} + +// UnsetCondition ensures that no value is present for Condition, not even an explicit nil +func (o *WebhookUpdate) UnsetCondition() { + o.Condition.Unset() +} + +// GetIgnoreSslErrors returns the IgnoreSslErrors field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WebhookUpdate) GetIgnoreSslErrors() bool { + if o == nil || IsNil(o.IgnoreSslErrors.Get()) { + var ret bool + return ret + } + return *o.IgnoreSslErrors.Get() +} + +// GetIgnoreSslErrorsOk returns a tuple with the IgnoreSslErrors field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WebhookUpdate) GetIgnoreSslErrorsOk() (*bool, bool) { + if o == nil { + return nil, false + } + return o.IgnoreSslErrors.Get(), o.IgnoreSslErrors.IsSet() +} + +// HasIgnoreSslErrors returns a boolean if a field has been set. +func (o *WebhookUpdate) HasIgnoreSslErrors() bool { + if o != nil && o.IgnoreSslErrors.IsSet() { + return true + } + + return false +} + +// SetIgnoreSslErrors gets a reference to the given NullableBool and assigns it to the IgnoreSslErrors field. +func (o *WebhookUpdate) SetIgnoreSslErrors(v bool) { + o.IgnoreSslErrors.Set(&v) +} +// SetIgnoreSslErrorsNil sets the value for IgnoreSslErrors to be an explicit nil +func (o *WebhookUpdate) SetIgnoreSslErrorsNil() { + o.IgnoreSslErrors.Set(nil) +} + +// UnsetIgnoreSslErrors ensures that no value is present for IgnoreSslErrors, not even an explicit nil +func (o *WebhookUpdate) UnsetIgnoreSslErrors() { + o.IgnoreSslErrors.Unset() +} + +// GetDoNotRetry returns the DoNotRetry field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WebhookUpdate) GetDoNotRetry() bool { + if o == nil || IsNil(o.DoNotRetry.Get()) { + var ret bool + return ret + } + return *o.DoNotRetry.Get() +} + +// GetDoNotRetryOk returns a tuple with the DoNotRetry field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WebhookUpdate) GetDoNotRetryOk() (*bool, bool) { + if o == nil { + return nil, false + } + return o.DoNotRetry.Get(), o.DoNotRetry.IsSet() +} + +// HasDoNotRetry returns a boolean if a field has been set. +func (o *WebhookUpdate) HasDoNotRetry() bool { + if o != nil && o.DoNotRetry.IsSet() { + return true + } + + return false +} + +// SetDoNotRetry gets a reference to the given NullableBool and assigns it to the DoNotRetry field. +func (o *WebhookUpdate) SetDoNotRetry(v bool) { + o.DoNotRetry.Set(&v) +} +// SetDoNotRetryNil sets the value for DoNotRetry to be an explicit nil +func (o *WebhookUpdate) SetDoNotRetryNil() { + o.DoNotRetry.Set(nil) +} + +// UnsetDoNotRetry ensures that no value is present for DoNotRetry, not even an explicit nil +func (o *WebhookUpdate) UnsetDoNotRetry() { + o.DoNotRetry.Unset() +} + +// GetRequestUrl returns the RequestUrl field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WebhookUpdate) GetRequestUrl() string { + if o == nil || IsNil(o.RequestUrl.Get()) { + var ret string + return ret + } + return *o.RequestUrl.Get() +} + +// GetRequestUrlOk returns a tuple with the RequestUrl field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WebhookUpdate) GetRequestUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.RequestUrl.Get(), o.RequestUrl.IsSet() +} + +// HasRequestUrl returns a boolean if a field has been set. +func (o *WebhookUpdate) HasRequestUrl() bool { + if o != nil && o.RequestUrl.IsSet() { + return true + } + + return false +} + +// SetRequestUrl gets a reference to the given NullableString and assigns it to the RequestUrl field. +func (o *WebhookUpdate) SetRequestUrl(v string) { + o.RequestUrl.Set(&v) +} +// SetRequestUrlNil sets the value for RequestUrl to be an explicit nil +func (o *WebhookUpdate) SetRequestUrlNil() { + o.RequestUrl.Set(nil) +} + +// UnsetRequestUrl ensures that no value is present for RequestUrl, not even an explicit nil +func (o *WebhookUpdate) UnsetRequestUrl() { + o.RequestUrl.Unset() +} + +// GetPayloadTemplate returns the PayloadTemplate field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WebhookUpdate) GetPayloadTemplate() string { + if o == nil || IsNil(o.PayloadTemplate.Get()) { + var ret string + return ret + } + return *o.PayloadTemplate.Get() +} + +// GetPayloadTemplateOk returns a tuple with the PayloadTemplate field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WebhookUpdate) GetPayloadTemplateOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.PayloadTemplate.Get(), o.PayloadTemplate.IsSet() +} + +// HasPayloadTemplate returns a boolean if a field has been set. +func (o *WebhookUpdate) HasPayloadTemplate() bool { + if o != nil && o.PayloadTemplate.IsSet() { + return true + } + + return false +} + +// SetPayloadTemplate gets a reference to the given NullableString and assigns it to the PayloadTemplate field. +func (o *WebhookUpdate) SetPayloadTemplate(v string) { + o.PayloadTemplate.Set(&v) +} +// SetPayloadTemplateNil sets the value for PayloadTemplate to be an explicit nil +func (o *WebhookUpdate) SetPayloadTemplateNil() { + o.PayloadTemplate.Set(nil) +} + +// UnsetPayloadTemplate ensures that no value is present for PayloadTemplate, not even an explicit nil +func (o *WebhookUpdate) UnsetPayloadTemplate() { + o.PayloadTemplate.Unset() +} + +// GetHeadersTemplate returns the HeadersTemplate field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WebhookUpdate) GetHeadersTemplate() string { + if o == nil || IsNil(o.HeadersTemplate.Get()) { + var ret string + return ret + } + return *o.HeadersTemplate.Get() +} + +// GetHeadersTemplateOk returns a tuple with the HeadersTemplate field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WebhookUpdate) GetHeadersTemplateOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.HeadersTemplate.Get(), o.HeadersTemplate.IsSet() +} + +// HasHeadersTemplate returns a boolean if a field has been set. +func (o *WebhookUpdate) HasHeadersTemplate() bool { + if o != nil && o.HeadersTemplate.IsSet() { + return true + } + + return false +} + +// SetHeadersTemplate gets a reference to the given NullableString and assigns it to the HeadersTemplate field. +func (o *WebhookUpdate) SetHeadersTemplate(v string) { + o.HeadersTemplate.Set(&v) +} +// SetHeadersTemplateNil sets the value for HeadersTemplate to be an explicit nil +func (o *WebhookUpdate) SetHeadersTemplateNil() { + o.HeadersTemplate.Set(nil) +} + +// UnsetHeadersTemplate ensures that no value is present for HeadersTemplate, not even an explicit nil +func (o *WebhookUpdate) UnsetHeadersTemplate() { + o.HeadersTemplate.Unset() +} + +// GetDescription returns the Description field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WebhookUpdate) GetDescription() string { + if o == nil || IsNil(o.Description.Get()) { + var ret string + return ret + } + return *o.Description.Get() +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WebhookUpdate) GetDescriptionOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Description.Get(), o.Description.IsSet() +} + +// HasDescription returns a boolean if a field has been set. +func (o *WebhookUpdate) HasDescription() bool { + if o != nil && o.Description.IsSet() { + return true + } + + return false +} + +// SetDescription gets a reference to the given NullableString and assigns it to the Description field. +func (o *WebhookUpdate) SetDescription(v string) { + o.Description.Set(&v) +} +// SetDescriptionNil sets the value for Description to be an explicit nil +func (o *WebhookUpdate) SetDescriptionNil() { + o.Description.Set(nil) +} + +// UnsetDescription ensures that no value is present for Description, not even an explicit nil +func (o *WebhookUpdate) UnsetDescription() { + o.Description.Unset() +} + +// GetShouldInterpolateStrings returns the ShouldInterpolateStrings field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WebhookUpdate) GetShouldInterpolateStrings() bool { + if o == nil || IsNil(o.ShouldInterpolateStrings.Get()) { + var ret bool + return ret + } + return *o.ShouldInterpolateStrings.Get() +} + +// GetShouldInterpolateStringsOk returns a tuple with the ShouldInterpolateStrings field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WebhookUpdate) GetShouldInterpolateStringsOk() (*bool, bool) { + if o == nil { + return nil, false + } + return o.ShouldInterpolateStrings.Get(), o.ShouldInterpolateStrings.IsSet() +} + +// HasShouldInterpolateStrings returns a boolean if a field has been set. +func (o *WebhookUpdate) HasShouldInterpolateStrings() bool { + if o != nil && o.ShouldInterpolateStrings.IsSet() { + return true + } + + return false +} + +// SetShouldInterpolateStrings gets a reference to the given NullableBool and assigns it to the ShouldInterpolateStrings field. +func (o *WebhookUpdate) SetShouldInterpolateStrings(v bool) { + o.ShouldInterpolateStrings.Set(&v) +} +// SetShouldInterpolateStringsNil sets the value for ShouldInterpolateStrings to be an explicit nil +func (o *WebhookUpdate) SetShouldInterpolateStringsNil() { + o.ShouldInterpolateStrings.Set(nil) +} + +// UnsetShouldInterpolateStrings ensures that no value is present for ShouldInterpolateStrings, not even an explicit nil +func (o *WebhookUpdate) UnsetShouldInterpolateStrings() { + o.ShouldInterpolateStrings.Unset() +} + +func (o WebhookUpdate) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o WebhookUpdate) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.IsAdHoc.IsSet() { + toSerialize["isAdHoc"] = o.IsAdHoc.Get() + } + if o.EventTypes != nil { + toSerialize["eventTypes"] = o.EventTypes + } + if o.Condition.IsSet() { + toSerialize["condition"] = o.Condition.Get() + } + if o.IgnoreSslErrors.IsSet() { + toSerialize["ignoreSslErrors"] = o.IgnoreSslErrors.Get() + } + if o.DoNotRetry.IsSet() { + toSerialize["doNotRetry"] = o.DoNotRetry.Get() + } + if o.RequestUrl.IsSet() { + toSerialize["requestUrl"] = o.RequestUrl.Get() + } + if o.PayloadTemplate.IsSet() { + toSerialize["payloadTemplate"] = o.PayloadTemplate.Get() + } + if o.HeadersTemplate.IsSet() { + toSerialize["headersTemplate"] = o.HeadersTemplate.Get() + } + if o.Description.IsSet() { + toSerialize["description"] = o.Description.Get() + } + if o.ShouldInterpolateStrings.IsSet() { + toSerialize["shouldInterpolateStrings"] = o.ShouldInterpolateStrings.Get() + } + return toSerialize, nil +} + +type NullableWebhookUpdate struct { + value *WebhookUpdate + isSet bool +} + +func (v NullableWebhookUpdate) Get() *WebhookUpdate { + return v.value +} + +func (v *NullableWebhookUpdate) Set(val *WebhookUpdate) { + v.value = val + v.isSet = true +} + +func (v NullableWebhookUpdate) IsSet() bool { + return v.isSet +} + +func (v *NullableWebhookUpdate) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWebhookUpdate(val *WebhookUpdate) *NullableWebhookUpdate { + return &NullableWebhookUpdate{value: val, isSet: true} +} + +func (v NullableWebhookUpdate) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWebhookUpdate) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/openapitools.json b/openapitools.json new file mode 100644 index 0000000..f3237ad --- /dev/null +++ b/openapitools.json @@ -0,0 +1,7 @@ +{ + "$schema": "./node_modules/@openapitools/openapi-generator-cli/config.schema.json", + "spaces": 2, + "generator-cli": { + "version": "7.23.0" + } +} diff --git a/response.go b/response.go new file mode 100644 index 0000000..5f02520 --- /dev/null +++ b/response.go @@ -0,0 +1,47 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "net/http" +) + +// APIResponse stores the API response returned by the server. +type APIResponse struct { + *http.Response `json:"-"` + Message string `json:"message,omitempty"` + // Operation is the name of the OpenAPI operation. + Operation string `json:"operation,omitempty"` + // RequestURL is the request URL. This value is always available, even if the + // embedded *http.Response is nil. + RequestURL string `json:"url,omitempty"` + // Method is the HTTP method used for the request. This value is always + // available, even if the embedded *http.Response is nil. + Method string `json:"method,omitempty"` + // Payload holds the contents of the response body (which may be nil or empty). + // This is provided here as the raw response.Body() reader will have already + // been drained. + Payload []byte `json:"-"` +} + +// NewAPIResponse returns a new APIResponse object. +func NewAPIResponse(r *http.Response) *APIResponse { + + response := &APIResponse{Response: r} + return response +} + +// NewAPIResponseWithError returns a new APIResponse object with the provided error message. +func NewAPIResponseWithError(errorMessage string) *APIResponse { + + response := &APIResponse{Message: errorMessage} + return response +} diff --git a/test/api_actor_builds_test.go b/test/api_actor_builds_test.go new file mode 100644 index 0000000..2b6ad31 --- /dev/null +++ b/test/api_actor_builds_test.go @@ -0,0 +1,106 @@ +/* +Apify API + +Testing ActorBuildsAPIService + +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); + +package apifyclient + +import ( + "context" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "testing" + openapiclient "github.com/apify/apify-client-go" +) + +func Test_apifyclient_ActorBuildsAPIService(t *testing.T) { + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + + t.Run("Test ActorBuildsAPIService ActorBuildAbortPost", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var buildId string + + resp, httpRes, err := apiClient.ActorBuildsAPI.ActorBuildAbortPost(context.Background(), buildId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test ActorBuildsAPIService ActorBuildDelete", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var buildId string + + httpRes, err := apiClient.ActorBuildsAPI.ActorBuildDelete(context.Background(), buildId).Execute() + + require.Nil(t, err) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test ActorBuildsAPIService ActorBuildGet", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var buildId string + + resp, httpRes, err := apiClient.ActorBuildsAPI.ActorBuildGet(context.Background(), buildId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test ActorBuildsAPIService ActorBuildLogGet", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var buildId string + + resp, httpRes, err := apiClient.ActorBuildsAPI.ActorBuildLogGet(context.Background(), buildId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test ActorBuildsAPIService ActorBuildOpenapiJsonGet", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var buildId string + + resp, httpRes, err := apiClient.ActorBuildsAPI.ActorBuildOpenapiJsonGet(context.Background(), buildId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test ActorBuildsAPIService ActorBuildsGet", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.ActorBuildsAPI.ActorBuildsGet(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + +} diff --git a/test/api_actor_runs_test.go b/test/api_actor_runs_test.go new file mode 100644 index 0000000..9ff499d --- /dev/null +++ b/test/api_actor_runs_test.go @@ -0,0 +1,162 @@ +/* +Apify API + +Testing ActorRunsAPIService + +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); + +package apifyclient + +import ( + "context" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "testing" + openapiclient "github.com/apify/apify-client-go" +) + +func Test_apifyclient_ActorRunsAPIService(t *testing.T) { + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + + t.Run("Test ActorRunsAPIService ActorRunAbortPost", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var runId string + + resp, httpRes, err := apiClient.ActorRunsAPI.ActorRunAbortPost(context.Background(), runId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test ActorRunsAPIService ActorRunDelete", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var runId string + + httpRes, err := apiClient.ActorRunsAPI.ActorRunDelete(context.Background(), runId).Execute() + + require.Nil(t, err) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test ActorRunsAPIService ActorRunGet", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var runId string + + resp, httpRes, err := apiClient.ActorRunsAPI.ActorRunGet(context.Background(), runId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test ActorRunsAPIService ActorRunLogGet", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var runId string + + resp, httpRes, err := apiClient.ActorRunsAPI.ActorRunLogGet(context.Background(), runId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test ActorRunsAPIService ActorRunMetamorphPost", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var runId string + + resp, httpRes, err := apiClient.ActorRunsAPI.ActorRunMetamorphPost(context.Background(), runId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test ActorRunsAPIService ActorRunPut", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var runId string + + resp, httpRes, err := apiClient.ActorRunsAPI.ActorRunPut(context.Background(), runId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test ActorRunsAPIService ActorRunRebootPost", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var runId string + + resp, httpRes, err := apiClient.ActorRunsAPI.ActorRunRebootPost(context.Background(), runId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test ActorRunsAPIService ActorRunsGet", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.ActorRunsAPI.ActorRunsGet(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test ActorRunsAPIService PostChargeRun", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var runId string + + resp, httpRes, err := apiClient.ActorRunsAPI.PostChargeRun(context.Background(), runId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test ActorRunsAPIService PostResurrectRun", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var runId string + + resp, httpRes, err := apiClient.ActorRunsAPI.PostResurrectRun(context.Background(), runId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + +} diff --git a/test/api_actor_tasks_test.go b/test/api_actor_tasks_test.go new file mode 100644 index 0000000..5dded6e --- /dev/null +++ b/test/api_actor_tasks_test.go @@ -0,0 +1,231 @@ +/* +Apify API + +Testing ActorTasksAPIService + +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); + +package apifyclient + +import ( + "context" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "testing" + openapiclient "github.com/apify/apify-client-go" +) + +func Test_apifyclient_ActorTasksAPIService(t *testing.T) { + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + + t.Run("Test ActorTasksAPIService ActorTaskDelete", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var actorTaskId string + + resp, httpRes, err := apiClient.ActorTasksAPI.ActorTaskDelete(context.Background(), actorTaskId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test ActorTasksAPIService ActorTaskGet", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var actorTaskId string + + resp, httpRes, err := apiClient.ActorTasksAPI.ActorTaskGet(context.Background(), actorTaskId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test ActorTasksAPIService ActorTaskInputGet", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var actorTaskId string + + resp, httpRes, err := apiClient.ActorTasksAPI.ActorTaskInputGet(context.Background(), actorTaskId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test ActorTasksAPIService ActorTaskInputPut", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var actorTaskId string + + resp, httpRes, err := apiClient.ActorTasksAPI.ActorTaskInputPut(context.Background(), actorTaskId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test ActorTasksAPIService ActorTaskPut", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var actorTaskId string + + resp, httpRes, err := apiClient.ActorTasksAPI.ActorTaskPut(context.Background(), actorTaskId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test ActorTasksAPIService ActorTaskRunSyncGet", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var actorTaskId string + + resp, httpRes, err := apiClient.ActorTasksAPI.ActorTaskRunSyncGet(context.Background(), actorTaskId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test ActorTasksAPIService ActorTaskRunSyncGetDatasetItemsGet", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var actorTaskId string + + resp, httpRes, err := apiClient.ActorTasksAPI.ActorTaskRunSyncGetDatasetItemsGet(context.Background(), actorTaskId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test ActorTasksAPIService ActorTaskRunSyncGetDatasetItemsPost", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var actorTaskId string + + resp, httpRes, err := apiClient.ActorTasksAPI.ActorTaskRunSyncGetDatasetItemsPost(context.Background(), actorTaskId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test ActorTasksAPIService ActorTaskRunSyncPost", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var actorTaskId string + + resp, httpRes, err := apiClient.ActorTasksAPI.ActorTaskRunSyncPost(context.Background(), actorTaskId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test ActorTasksAPIService ActorTaskRunsGet", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var actorTaskId string + + resp, httpRes, err := apiClient.ActorTasksAPI.ActorTaskRunsGet(context.Background(), actorTaskId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test ActorTasksAPIService ActorTaskRunsLastGet", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var actorTaskId string + + resp, httpRes, err := apiClient.ActorTasksAPI.ActorTaskRunsLastGet(context.Background(), actorTaskId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test ActorTasksAPIService ActorTaskRunsPost", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var actorTaskId string + + resp, httpRes, err := apiClient.ActorTasksAPI.ActorTaskRunsPost(context.Background(), actorTaskId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test ActorTasksAPIService ActorTaskWebhooksGet", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var actorTaskId string + + resp, httpRes, err := apiClient.ActorTasksAPI.ActorTaskWebhooksGet(context.Background(), actorTaskId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test ActorTasksAPIService ActorTasksGet", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.ActorTasksAPI.ActorTasksGet(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test ActorTasksAPIService ActorTasksPost", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.ActorTasksAPI.ActorTasksPost(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + +} diff --git a/test/api_actors_actor_builds_test.go b/test/api_actors_actor_builds_test.go new file mode 100644 index 0000000..964bd6c --- /dev/null +++ b/test/api_actors_actor_builds_test.go @@ -0,0 +1,112 @@ +/* +Apify API + +Testing ActorsActorBuildsAPIService + +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); + +package apifyclient + +import ( + "context" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "testing" + openapiclient "github.com/apify/apify-client-go" +) + +func Test_apifyclient_ActorsActorBuildsAPIService(t *testing.T) { + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + + t.Run("Test ActorsActorBuildsAPIService ActBuildAbortPost", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var actorId string + var buildId string + + resp, httpRes, err := apiClient.ActorsActorBuildsAPI.ActBuildAbortPost(context.Background(), actorId, buildId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test ActorsActorBuildsAPIService ActBuildDefaultGet", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var actorId string + + resp, httpRes, err := apiClient.ActorsActorBuildsAPI.ActBuildDefaultGet(context.Background(), actorId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test ActorsActorBuildsAPIService ActBuildGet", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var actorId string + var buildId string + + resp, httpRes, err := apiClient.ActorsActorBuildsAPI.ActBuildGet(context.Background(), actorId, buildId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test ActorsActorBuildsAPIService ActBuildsGet", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var actorId string + + resp, httpRes, err := apiClient.ActorsActorBuildsAPI.ActBuildsGet(context.Background(), actorId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test ActorsActorBuildsAPIService ActBuildsPost", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var actorId string + + resp, httpRes, err := apiClient.ActorsActorBuildsAPI.ActBuildsPost(context.Background(), actorId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test ActorsActorBuildsAPIService ActOpenapiJsonGet", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var actorId string + var buildId string + + resp, httpRes, err := apiClient.ActorsActorBuildsAPI.ActOpenapiJsonGet(context.Background(), actorId, buildId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + +} diff --git a/test/api_actors_actor_runs_test.go b/test/api_actors_actor_runs_test.go new file mode 100644 index 0000000..932df62 --- /dev/null +++ b/test/api_actors_actor_runs_test.go @@ -0,0 +1,183 @@ +/* +Apify API + +Testing ActorsActorRunsAPIService + +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); + +package apifyclient + +import ( + "context" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "testing" + openapiclient "github.com/apify/apify-client-go" +) + +func Test_apifyclient_ActorsActorRunsAPIService(t *testing.T) { + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + + t.Run("Test ActorsActorRunsAPIService ActRunAbortPost", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var actorId string + var runId string + + resp, httpRes, err := apiClient.ActorsActorRunsAPI.ActRunAbortPost(context.Background(), actorId, runId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test ActorsActorRunsAPIService ActRunGet", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var actorId string + var runId string + + resp, httpRes, err := apiClient.ActorsActorRunsAPI.ActRunGet(context.Background(), actorId, runId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test ActorsActorRunsAPIService ActRunMetamorphPost", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var actorId string + var runId string + + resp, httpRes, err := apiClient.ActorsActorRunsAPI.ActRunMetamorphPost(context.Background(), actorId, runId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test ActorsActorRunsAPIService ActRunResurrectPost", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var actorId string + var runId string + + resp, httpRes, err := apiClient.ActorsActorRunsAPI.ActRunResurrectPost(context.Background(), actorId, runId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test ActorsActorRunsAPIService ActRunSyncGet", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var actorId string + + resp, httpRes, err := apiClient.ActorsActorRunsAPI.ActRunSyncGet(context.Background(), actorId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test ActorsActorRunsAPIService ActRunSyncGetDatasetItemsGet", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var actorId string + + resp, httpRes, err := apiClient.ActorsActorRunsAPI.ActRunSyncGetDatasetItemsGet(context.Background(), actorId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test ActorsActorRunsAPIService ActRunSyncGetDatasetItemsPost", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var actorId string + + resp, httpRes, err := apiClient.ActorsActorRunsAPI.ActRunSyncGetDatasetItemsPost(context.Background(), actorId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test ActorsActorRunsAPIService ActRunSyncPost", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var actorId string + + resp, httpRes, err := apiClient.ActorsActorRunsAPI.ActRunSyncPost(context.Background(), actorId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test ActorsActorRunsAPIService ActRunsGet", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var actorId string + + resp, httpRes, err := apiClient.ActorsActorRunsAPI.ActRunsGet(context.Background(), actorId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test ActorsActorRunsAPIService ActRunsLastGet", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var actorId string + + resp, httpRes, err := apiClient.ActorsActorRunsAPI.ActRunsLastGet(context.Background(), actorId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test ActorsActorRunsAPIService ActRunsPost", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var actorId string + + resp, httpRes, err := apiClient.ActorsActorRunsAPI.ActRunsPost(context.Background(), actorId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + +} diff --git a/test/api_actors_actor_versions_test.go b/test/api_actors_actor_versions_test.go new file mode 100644 index 0000000..c009cd2 --- /dev/null +++ b/test/api_actors_actor_versions_test.go @@ -0,0 +1,207 @@ +/* +Apify API + +Testing ActorsActorVersionsAPIService + +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); + +package apifyclient + +import ( + "context" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "testing" + openapiclient "github.com/apify/apify-client-go" +) + +func Test_apifyclient_ActorsActorVersionsAPIService(t *testing.T) { + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + + t.Run("Test ActorsActorVersionsAPIService ActVersionDelete", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var actorId string + var versionNumber string + + resp, httpRes, err := apiClient.ActorsActorVersionsAPI.ActVersionDelete(context.Background(), actorId, versionNumber).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test ActorsActorVersionsAPIService ActVersionEnvVarDelete", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var actorId string + var versionNumber string + var envVarName string + + resp, httpRes, err := apiClient.ActorsActorVersionsAPI.ActVersionEnvVarDelete(context.Background(), actorId, versionNumber, envVarName).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test ActorsActorVersionsAPIService ActVersionEnvVarGet", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var actorId string + var versionNumber string + var envVarName string + + resp, httpRes, err := apiClient.ActorsActorVersionsAPI.ActVersionEnvVarGet(context.Background(), actorId, versionNumber, envVarName).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test ActorsActorVersionsAPIService ActVersionEnvVarPost", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var actorId string + var versionNumber string + var envVarName string + + resp, httpRes, err := apiClient.ActorsActorVersionsAPI.ActVersionEnvVarPost(context.Background(), actorId, versionNumber, envVarName).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test ActorsActorVersionsAPIService ActVersionEnvVarPut", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var actorId string + var versionNumber string + var envVarName string + + resp, httpRes, err := apiClient.ActorsActorVersionsAPI.ActVersionEnvVarPut(context.Background(), actorId, versionNumber, envVarName).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test ActorsActorVersionsAPIService ActVersionEnvVarsGet", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var actorId string + var versionNumber string + + resp, httpRes, err := apiClient.ActorsActorVersionsAPI.ActVersionEnvVarsGet(context.Background(), actorId, versionNumber).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test ActorsActorVersionsAPIService ActVersionEnvVarsPost", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var actorId string + var versionNumber string + + resp, httpRes, err := apiClient.ActorsActorVersionsAPI.ActVersionEnvVarsPost(context.Background(), actorId, versionNumber).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test ActorsActorVersionsAPIService ActVersionGet", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var actorId string + var versionNumber string + + resp, httpRes, err := apiClient.ActorsActorVersionsAPI.ActVersionGet(context.Background(), actorId, versionNumber).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test ActorsActorVersionsAPIService ActVersionPost", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var actorId string + var versionNumber string + + resp, httpRes, err := apiClient.ActorsActorVersionsAPI.ActVersionPost(context.Background(), actorId, versionNumber).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test ActorsActorVersionsAPIService ActVersionPut", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var actorId string + var versionNumber string + + resp, httpRes, err := apiClient.ActorsActorVersionsAPI.ActVersionPut(context.Background(), actorId, versionNumber).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test ActorsActorVersionsAPIService ActVersionsGet", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var actorId string + + resp, httpRes, err := apiClient.ActorsActorVersionsAPI.ActVersionsGet(context.Background(), actorId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test ActorsActorVersionsAPIService ActVersionsPost", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var actorId string + + resp, httpRes, err := apiClient.ActorsActorVersionsAPI.ActVersionsPost(context.Background(), actorId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + +} diff --git a/test/api_actors_test.go b/test/api_actors_test.go new file mode 100644 index 0000000..8bd3c73 --- /dev/null +++ b/test/api_actors_test.go @@ -0,0 +1,105 @@ +/* +Apify API + +Testing ActorsAPIService + +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); + +package apifyclient + +import ( + "context" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "testing" + openapiclient "github.com/apify/apify-client-go" +) + +func Test_apifyclient_ActorsAPIService(t *testing.T) { + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + + t.Run("Test ActorsAPIService ActDelete", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var actorId string + + resp, httpRes, err := apiClient.ActorsAPI.ActDelete(context.Background(), actorId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test ActorsAPIService ActGet", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var actorId string + + resp, httpRes, err := apiClient.ActorsAPI.ActGet(context.Background(), actorId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test ActorsAPIService ActPut", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var actorId string + + resp, httpRes, err := apiClient.ActorsAPI.ActPut(context.Background(), actorId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test ActorsAPIService ActValidateInputPost", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var actorId string + + resp, httpRes, err := apiClient.ActorsAPI.ActValidateInputPost(context.Background(), actorId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test ActorsAPIService ActsGet", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.ActorsAPI.ActsGet(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test ActorsAPIService ActsPost", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.ActorsAPI.ActsPost(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + +} diff --git a/test/api_actors_webhook_collection_test.go b/test/api_actors_webhook_collection_test.go new file mode 100644 index 0000000..a7b7e96 --- /dev/null +++ b/test/api_actors_webhook_collection_test.go @@ -0,0 +1,39 @@ +/* +Apify API + +Testing ActorsWebhookCollectionAPIService + +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); + +package apifyclient + +import ( + "context" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "testing" + openapiclient "github.com/apify/apify-client-go" +) + +func Test_apifyclient_ActorsWebhookCollectionAPIService(t *testing.T) { + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + + t.Run("Test ActorsWebhookCollectionAPIService ActWebhooksGet", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var actorId string + + resp, httpRes, err := apiClient.ActorsWebhookCollectionAPI.ActWebhooksGet(context.Background(), actorId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + +} diff --git a/test/api_default_dataset_test.go b/test/api_default_dataset_test.go new file mode 100644 index 0000000..96764aa --- /dev/null +++ b/test/api_default_dataset_test.go @@ -0,0 +1,108 @@ +/* +Apify API + +Testing DefaultDatasetAPIService + +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); + +package apifyclient + +import ( + "context" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "testing" + openapiclient "github.com/apify/apify-client-go" +) + +func Test_apifyclient_DefaultDatasetAPIService(t *testing.T) { + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + + t.Run("Test DefaultDatasetAPIService ActorRunDatasetDelete", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var runId string + + httpRes, err := apiClient.DefaultDatasetAPI.ActorRunDatasetDelete(context.Background(), runId).Execute() + + require.Nil(t, err) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test DefaultDatasetAPIService ActorRunDatasetGet", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var runId string + + resp, httpRes, err := apiClient.DefaultDatasetAPI.ActorRunDatasetGet(context.Background(), runId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test DefaultDatasetAPIService ActorRunDatasetItemsGet", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var runId string + + resp, httpRes, err := apiClient.DefaultDatasetAPI.ActorRunDatasetItemsGet(context.Background(), runId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test DefaultDatasetAPIService ActorRunDatasetItemsPost", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var runId string + + resp, httpRes, err := apiClient.DefaultDatasetAPI.ActorRunDatasetItemsPost(context.Background(), runId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test DefaultDatasetAPIService ActorRunDatasetPut", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var runId string + + resp, httpRes, err := apiClient.DefaultDatasetAPI.ActorRunDatasetPut(context.Background(), runId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test DefaultDatasetAPIService ActorRunDatasetStatisticsGet", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var runId string + + resp, httpRes, err := apiClient.DefaultDatasetAPI.ActorRunDatasetStatisticsGet(context.Background(), runId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + +} diff --git a/test/api_default_key_value_store_test.go b/test/api_default_key_value_store_test.go new file mode 100644 index 0000000..6787707 --- /dev/null +++ b/test/api_default_key_value_store_test.go @@ -0,0 +1,153 @@ +/* +Apify API + +Testing DefaultKeyValueStoreAPIService + +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); + +package apifyclient + +import ( + "context" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "testing" + openapiclient "github.com/apify/apify-client-go" +) + +func Test_apifyclient_DefaultKeyValueStoreAPIService(t *testing.T) { + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + + t.Run("Test DefaultKeyValueStoreAPIService ActorRunKeyValueStoreDelete", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var runId string + + httpRes, err := apiClient.DefaultKeyValueStoreAPI.ActorRunKeyValueStoreDelete(context.Background(), runId).Execute() + + require.Nil(t, err) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test DefaultKeyValueStoreAPIService ActorRunKeyValueStoreGet", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var runId string + + resp, httpRes, err := apiClient.DefaultKeyValueStoreAPI.ActorRunKeyValueStoreGet(context.Background(), runId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test DefaultKeyValueStoreAPIService ActorRunKeyValueStoreKeysGet", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var runId string + + resp, httpRes, err := apiClient.DefaultKeyValueStoreAPI.ActorRunKeyValueStoreKeysGet(context.Background(), runId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test DefaultKeyValueStoreAPIService ActorRunKeyValueStorePut", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var runId string + + resp, httpRes, err := apiClient.DefaultKeyValueStoreAPI.ActorRunKeyValueStorePut(context.Background(), runId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test DefaultKeyValueStoreAPIService ActorRunKeyValueStoreRecordDelete", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var runId string + var recordKey string + + httpRes, err := apiClient.DefaultKeyValueStoreAPI.ActorRunKeyValueStoreRecordDelete(context.Background(), runId, recordKey).Execute() + + require.Nil(t, err) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test DefaultKeyValueStoreAPIService ActorRunKeyValueStoreRecordGet", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var runId string + var recordKey string + + resp, httpRes, err := apiClient.DefaultKeyValueStoreAPI.ActorRunKeyValueStoreRecordGet(context.Background(), runId, recordKey).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test DefaultKeyValueStoreAPIService ActorRunKeyValueStoreRecordPost", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var runId string + var recordKey string + + resp, httpRes, err := apiClient.DefaultKeyValueStoreAPI.ActorRunKeyValueStoreRecordPost(context.Background(), runId, recordKey).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test DefaultKeyValueStoreAPIService ActorRunKeyValueStoreRecordPut", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var runId string + var recordKey string + + resp, httpRes, err := apiClient.DefaultKeyValueStoreAPI.ActorRunKeyValueStoreRecordPut(context.Background(), runId, recordKey).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test DefaultKeyValueStoreAPIService ActorRunKeyValueStoreRecordsGet", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var runId string + + resp, httpRes, err := apiClient.DefaultKeyValueStoreAPI.ActorRunKeyValueStoreRecordsGet(context.Background(), runId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + +} diff --git a/test/api_default_request_queue_test.go b/test/api_default_request_queue_test.go new file mode 100644 index 0000000..1e1e1bd --- /dev/null +++ b/test/api_default_request_queue_test.go @@ -0,0 +1,237 @@ +/* +Apify API + +Testing DefaultRequestQueueAPIService + +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); + +package apifyclient + +import ( + "context" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "testing" + openapiclient "github.com/apify/apify-client-go" +) + +func Test_apifyclient_DefaultRequestQueueAPIService(t *testing.T) { + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + + t.Run("Test DefaultRequestQueueAPIService ActorRunRequestQueueDelete", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var runId string + + httpRes, err := apiClient.DefaultRequestQueueAPI.ActorRunRequestQueueDelete(context.Background(), runId).Execute() + + require.Nil(t, err) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test DefaultRequestQueueAPIService ActorRunRequestQueueGet", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var runId string + + resp, httpRes, err := apiClient.DefaultRequestQueueAPI.ActorRunRequestQueueGet(context.Background(), runId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test DefaultRequestQueueAPIService ActorRunRequestQueueHeadGet", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var runId string + + resp, httpRes, err := apiClient.DefaultRequestQueueAPI.ActorRunRequestQueueHeadGet(context.Background(), runId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test DefaultRequestQueueAPIService ActorRunRequestQueueHeadLockPost", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var runId string + + resp, httpRes, err := apiClient.DefaultRequestQueueAPI.ActorRunRequestQueueHeadLockPost(context.Background(), runId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test DefaultRequestQueueAPIService ActorRunRequestQueuePut", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var runId string + + resp, httpRes, err := apiClient.DefaultRequestQueueAPI.ActorRunRequestQueuePut(context.Background(), runId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test DefaultRequestQueueAPIService ActorRunRequestQueueRequestDelete", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var runId string + var requestId string + + httpRes, err := apiClient.DefaultRequestQueueAPI.ActorRunRequestQueueRequestDelete(context.Background(), runId, requestId).Execute() + + require.Nil(t, err) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test DefaultRequestQueueAPIService ActorRunRequestQueueRequestGet", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var runId string + var requestId string + + resp, httpRes, err := apiClient.DefaultRequestQueueAPI.ActorRunRequestQueueRequestGet(context.Background(), runId, requestId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test DefaultRequestQueueAPIService ActorRunRequestQueueRequestLockDelete", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var runId string + var requestId string + + httpRes, err := apiClient.DefaultRequestQueueAPI.ActorRunRequestQueueRequestLockDelete(context.Background(), runId, requestId).Execute() + + require.Nil(t, err) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test DefaultRequestQueueAPIService ActorRunRequestQueueRequestLockPut", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var runId string + var requestId string + + resp, httpRes, err := apiClient.DefaultRequestQueueAPI.ActorRunRequestQueueRequestLockPut(context.Background(), runId, requestId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test DefaultRequestQueueAPIService ActorRunRequestQueueRequestPut", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var runId string + var requestId string + + resp, httpRes, err := apiClient.DefaultRequestQueueAPI.ActorRunRequestQueueRequestPut(context.Background(), runId, requestId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test DefaultRequestQueueAPIService ActorRunRequestQueueRequestsBatchDelete", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var runId string + + resp, httpRes, err := apiClient.DefaultRequestQueueAPI.ActorRunRequestQueueRequestsBatchDelete(context.Background(), runId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test DefaultRequestQueueAPIService ActorRunRequestQueueRequestsBatchPost", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var runId string + + resp, httpRes, err := apiClient.DefaultRequestQueueAPI.ActorRunRequestQueueRequestsBatchPost(context.Background(), runId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test DefaultRequestQueueAPIService ActorRunRequestQueueRequestsGet", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var runId string + + resp, httpRes, err := apiClient.DefaultRequestQueueAPI.ActorRunRequestQueueRequestsGet(context.Background(), runId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test DefaultRequestQueueAPIService ActorRunRequestQueueRequestsPost", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var runId string + + resp, httpRes, err := apiClient.DefaultRequestQueueAPI.ActorRunRequestQueueRequestsPost(context.Background(), runId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test DefaultRequestQueueAPIService ActorRunRequestQueueRequestsUnlockPost", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var runId string + + resp, httpRes, err := apiClient.DefaultRequestQueueAPI.ActorRunRequestQueueRequestsUnlockPost(context.Background(), runId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + +} diff --git a/test/api_last_actor_runs_abort_test.go b/test/api_last_actor_runs_abort_test.go new file mode 100644 index 0000000..bfa2589 --- /dev/null +++ b/test/api_last_actor_runs_abort_test.go @@ -0,0 +1,39 @@ +/* +Apify API + +Testing LastActorRunsAbortAPIService + +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); + +package apifyclient + +import ( + "context" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "testing" + openapiclient "github.com/apify/apify-client-go" +) + +func Test_apifyclient_LastActorRunsAbortAPIService(t *testing.T) { + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + + t.Run("Test LastActorRunsAbortAPIService ActRunsLastAbortPost", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var actorId string + + resp, httpRes, err := apiClient.LastActorRunsAbortAPI.ActRunsLastAbortPost(context.Background(), actorId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + +} diff --git a/test/api_last_actor_runs_default_dataset_test.go b/test/api_last_actor_runs_default_dataset_test.go new file mode 100644 index 0000000..fc37c7b --- /dev/null +++ b/test/api_last_actor_runs_default_dataset_test.go @@ -0,0 +1,108 @@ +/* +Apify API + +Testing LastActorRunsDefaultDatasetAPIService + +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); + +package apifyclient + +import ( + "context" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "testing" + openapiclient "github.com/apify/apify-client-go" +) + +func Test_apifyclient_LastActorRunsDefaultDatasetAPIService(t *testing.T) { + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + + t.Run("Test LastActorRunsDefaultDatasetAPIService ActRunsLastDatasetDelete", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var actorId string + + httpRes, err := apiClient.LastActorRunsDefaultDatasetAPI.ActRunsLastDatasetDelete(context.Background(), actorId).Execute() + + require.Nil(t, err) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test LastActorRunsDefaultDatasetAPIService ActRunsLastDatasetGet", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var actorId string + + resp, httpRes, err := apiClient.LastActorRunsDefaultDatasetAPI.ActRunsLastDatasetGet(context.Background(), actorId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test LastActorRunsDefaultDatasetAPIService ActRunsLastDatasetItemsGet", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var actorId string + + resp, httpRes, err := apiClient.LastActorRunsDefaultDatasetAPI.ActRunsLastDatasetItemsGet(context.Background(), actorId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test LastActorRunsDefaultDatasetAPIService ActRunsLastDatasetItemsPost", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var actorId string + + resp, httpRes, err := apiClient.LastActorRunsDefaultDatasetAPI.ActRunsLastDatasetItemsPost(context.Background(), actorId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test LastActorRunsDefaultDatasetAPIService ActRunsLastDatasetPut", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var actorId string + + resp, httpRes, err := apiClient.LastActorRunsDefaultDatasetAPI.ActRunsLastDatasetPut(context.Background(), actorId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test LastActorRunsDefaultDatasetAPIService ActRunsLastDatasetStatisticsGet", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var actorId string + + resp, httpRes, err := apiClient.LastActorRunsDefaultDatasetAPI.ActRunsLastDatasetStatisticsGet(context.Background(), actorId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + +} diff --git a/test/api_last_actor_runs_default_key_value_store_test.go b/test/api_last_actor_runs_default_key_value_store_test.go new file mode 100644 index 0000000..70a9563 --- /dev/null +++ b/test/api_last_actor_runs_default_key_value_store_test.go @@ -0,0 +1,153 @@ +/* +Apify API + +Testing LastActorRunsDefaultKeyValueStoreAPIService + +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); + +package apifyclient + +import ( + "context" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "testing" + openapiclient "github.com/apify/apify-client-go" +) + +func Test_apifyclient_LastActorRunsDefaultKeyValueStoreAPIService(t *testing.T) { + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + + t.Run("Test LastActorRunsDefaultKeyValueStoreAPIService ActRunsLastKeyValueStoreDelete", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var actorId string + + httpRes, err := apiClient.LastActorRunsDefaultKeyValueStoreAPI.ActRunsLastKeyValueStoreDelete(context.Background(), actorId).Execute() + + require.Nil(t, err) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test LastActorRunsDefaultKeyValueStoreAPIService ActRunsLastKeyValueStoreGet", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var actorId string + + resp, httpRes, err := apiClient.LastActorRunsDefaultKeyValueStoreAPI.ActRunsLastKeyValueStoreGet(context.Background(), actorId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test LastActorRunsDefaultKeyValueStoreAPIService ActRunsLastKeyValueStoreKeysGet", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var actorId string + + resp, httpRes, err := apiClient.LastActorRunsDefaultKeyValueStoreAPI.ActRunsLastKeyValueStoreKeysGet(context.Background(), actorId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test LastActorRunsDefaultKeyValueStoreAPIService ActRunsLastKeyValueStorePut", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var actorId string + + resp, httpRes, err := apiClient.LastActorRunsDefaultKeyValueStoreAPI.ActRunsLastKeyValueStorePut(context.Background(), actorId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test LastActorRunsDefaultKeyValueStoreAPIService ActRunsLastKeyValueStoreRecordDelete", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var actorId string + var recordKey string + + httpRes, err := apiClient.LastActorRunsDefaultKeyValueStoreAPI.ActRunsLastKeyValueStoreRecordDelete(context.Background(), actorId, recordKey).Execute() + + require.Nil(t, err) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test LastActorRunsDefaultKeyValueStoreAPIService ActRunsLastKeyValueStoreRecordGet", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var actorId string + var recordKey string + + resp, httpRes, err := apiClient.LastActorRunsDefaultKeyValueStoreAPI.ActRunsLastKeyValueStoreRecordGet(context.Background(), actorId, recordKey).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test LastActorRunsDefaultKeyValueStoreAPIService ActRunsLastKeyValueStoreRecordPost", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var actorId string + var recordKey string + + resp, httpRes, err := apiClient.LastActorRunsDefaultKeyValueStoreAPI.ActRunsLastKeyValueStoreRecordPost(context.Background(), actorId, recordKey).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test LastActorRunsDefaultKeyValueStoreAPIService ActRunsLastKeyValueStoreRecordPut", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var actorId string + var recordKey string + + resp, httpRes, err := apiClient.LastActorRunsDefaultKeyValueStoreAPI.ActRunsLastKeyValueStoreRecordPut(context.Background(), actorId, recordKey).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test LastActorRunsDefaultKeyValueStoreAPIService ActRunsLastKeyValueStoreRecordsGet", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var actorId string + + resp, httpRes, err := apiClient.LastActorRunsDefaultKeyValueStoreAPI.ActRunsLastKeyValueStoreRecordsGet(context.Background(), actorId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + +} diff --git a/test/api_last_actor_runs_default_request_queue_test.go b/test/api_last_actor_runs_default_request_queue_test.go new file mode 100644 index 0000000..989bba0 --- /dev/null +++ b/test/api_last_actor_runs_default_request_queue_test.go @@ -0,0 +1,237 @@ +/* +Apify API + +Testing LastActorRunsDefaultRequestQueueAPIService + +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); + +package apifyclient + +import ( + "context" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "testing" + openapiclient "github.com/apify/apify-client-go" +) + +func Test_apifyclient_LastActorRunsDefaultRequestQueueAPIService(t *testing.T) { + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + + t.Run("Test LastActorRunsDefaultRequestQueueAPIService ActRunsLastRequestQueueDelete", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var actorId string + + httpRes, err := apiClient.LastActorRunsDefaultRequestQueueAPI.ActRunsLastRequestQueueDelete(context.Background(), actorId).Execute() + + require.Nil(t, err) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test LastActorRunsDefaultRequestQueueAPIService ActRunsLastRequestQueueGet", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var actorId string + + resp, httpRes, err := apiClient.LastActorRunsDefaultRequestQueueAPI.ActRunsLastRequestQueueGet(context.Background(), actorId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test LastActorRunsDefaultRequestQueueAPIService ActRunsLastRequestQueueHeadGet", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var actorId string + + resp, httpRes, err := apiClient.LastActorRunsDefaultRequestQueueAPI.ActRunsLastRequestQueueHeadGet(context.Background(), actorId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test LastActorRunsDefaultRequestQueueAPIService ActRunsLastRequestQueueHeadLockPost", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var actorId string + + resp, httpRes, err := apiClient.LastActorRunsDefaultRequestQueueAPI.ActRunsLastRequestQueueHeadLockPost(context.Background(), actorId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test LastActorRunsDefaultRequestQueueAPIService ActRunsLastRequestQueuePut", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var actorId string + + resp, httpRes, err := apiClient.LastActorRunsDefaultRequestQueueAPI.ActRunsLastRequestQueuePut(context.Background(), actorId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test LastActorRunsDefaultRequestQueueAPIService ActRunsLastRequestQueueRequestDelete", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var actorId string + var requestId string + + httpRes, err := apiClient.LastActorRunsDefaultRequestQueueAPI.ActRunsLastRequestQueueRequestDelete(context.Background(), actorId, requestId).Execute() + + require.Nil(t, err) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test LastActorRunsDefaultRequestQueueAPIService ActRunsLastRequestQueueRequestGet", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var actorId string + var requestId string + + resp, httpRes, err := apiClient.LastActorRunsDefaultRequestQueueAPI.ActRunsLastRequestQueueRequestGet(context.Background(), actorId, requestId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test LastActorRunsDefaultRequestQueueAPIService ActRunsLastRequestQueueRequestLockDelete", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var actorId string + var requestId string + + httpRes, err := apiClient.LastActorRunsDefaultRequestQueueAPI.ActRunsLastRequestQueueRequestLockDelete(context.Background(), actorId, requestId).Execute() + + require.Nil(t, err) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test LastActorRunsDefaultRequestQueueAPIService ActRunsLastRequestQueueRequestLockPut", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var actorId string + var requestId string + + resp, httpRes, err := apiClient.LastActorRunsDefaultRequestQueueAPI.ActRunsLastRequestQueueRequestLockPut(context.Background(), actorId, requestId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test LastActorRunsDefaultRequestQueueAPIService ActRunsLastRequestQueueRequestPut", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var actorId string + var requestId string + + resp, httpRes, err := apiClient.LastActorRunsDefaultRequestQueueAPI.ActRunsLastRequestQueueRequestPut(context.Background(), actorId, requestId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test LastActorRunsDefaultRequestQueueAPIService ActRunsLastRequestQueueRequestsBatchDelete", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var actorId string + + resp, httpRes, err := apiClient.LastActorRunsDefaultRequestQueueAPI.ActRunsLastRequestQueueRequestsBatchDelete(context.Background(), actorId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test LastActorRunsDefaultRequestQueueAPIService ActRunsLastRequestQueueRequestsBatchPost", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var actorId string + + resp, httpRes, err := apiClient.LastActorRunsDefaultRequestQueueAPI.ActRunsLastRequestQueueRequestsBatchPost(context.Background(), actorId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test LastActorRunsDefaultRequestQueueAPIService ActRunsLastRequestQueueRequestsGet", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var actorId string + + resp, httpRes, err := apiClient.LastActorRunsDefaultRequestQueueAPI.ActRunsLastRequestQueueRequestsGet(context.Background(), actorId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test LastActorRunsDefaultRequestQueueAPIService ActRunsLastRequestQueueRequestsPost", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var actorId string + + resp, httpRes, err := apiClient.LastActorRunsDefaultRequestQueueAPI.ActRunsLastRequestQueueRequestsPost(context.Background(), actorId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test LastActorRunsDefaultRequestQueueAPIService ActRunsLastRequestQueueRequestsUnlockPost", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var actorId string + + resp, httpRes, err := apiClient.LastActorRunsDefaultRequestQueueAPI.ActRunsLastRequestQueueRequestsUnlockPost(context.Background(), actorId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + +} diff --git a/test/api_last_actor_runs_log_test.go b/test/api_last_actor_runs_log_test.go new file mode 100644 index 0000000..41a3aa4 --- /dev/null +++ b/test/api_last_actor_runs_log_test.go @@ -0,0 +1,39 @@ +/* +Apify API + +Testing LastActorRunsLogAPIService + +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); + +package apifyclient + +import ( + "context" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "testing" + openapiclient "github.com/apify/apify-client-go" +) + +func Test_apifyclient_LastActorRunsLogAPIService(t *testing.T) { + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + + t.Run("Test LastActorRunsLogAPIService ActRunsLastLogGet", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var actorId string + + resp, httpRes, err := apiClient.LastActorRunsLogAPI.ActRunsLastLogGet(context.Background(), actorId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + +} diff --git a/test/api_last_actor_runs_metamorph_test.go b/test/api_last_actor_runs_metamorph_test.go new file mode 100644 index 0000000..282bf6b --- /dev/null +++ b/test/api_last_actor_runs_metamorph_test.go @@ -0,0 +1,39 @@ +/* +Apify API + +Testing LastActorRunsMetamorphAPIService + +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); + +package apifyclient + +import ( + "context" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "testing" + openapiclient "github.com/apify/apify-client-go" +) + +func Test_apifyclient_LastActorRunsMetamorphAPIService(t *testing.T) { + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + + t.Run("Test LastActorRunsMetamorphAPIService ActRunsLastMetamorphPost", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var actorId string + + resp, httpRes, err := apiClient.LastActorRunsMetamorphAPI.ActRunsLastMetamorphPost(context.Background(), actorId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + +} diff --git a/test/api_last_actor_runs_reboot_test.go b/test/api_last_actor_runs_reboot_test.go new file mode 100644 index 0000000..7fc7677 --- /dev/null +++ b/test/api_last_actor_runs_reboot_test.go @@ -0,0 +1,39 @@ +/* +Apify API + +Testing LastActorRunsRebootAPIService + +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); + +package apifyclient + +import ( + "context" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "testing" + openapiclient "github.com/apify/apify-client-go" +) + +func Test_apifyclient_LastActorRunsRebootAPIService(t *testing.T) { + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + + t.Run("Test LastActorRunsRebootAPIService ActRunsLastRebootPost", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var actorId string + + resp, httpRes, err := apiClient.LastActorRunsRebootAPI.ActRunsLastRebootPost(context.Background(), actorId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + +} diff --git a/test/api_last_actor_task_runs_abort_test.go b/test/api_last_actor_task_runs_abort_test.go new file mode 100644 index 0000000..f5c770f --- /dev/null +++ b/test/api_last_actor_task_runs_abort_test.go @@ -0,0 +1,39 @@ +/* +Apify API + +Testing LastActorTaskRunsAbortAPIService + +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); + +package apifyclient + +import ( + "context" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "testing" + openapiclient "github.com/apify/apify-client-go" +) + +func Test_apifyclient_LastActorTaskRunsAbortAPIService(t *testing.T) { + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + + t.Run("Test LastActorTaskRunsAbortAPIService ActorTaskRunsLastAbortPost", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var actorTaskId string + + resp, httpRes, err := apiClient.LastActorTaskRunsAbortAPI.ActorTaskRunsLastAbortPost(context.Background(), actorTaskId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + +} diff --git a/test/api_last_actor_task_runs_default_dataset_test.go b/test/api_last_actor_task_runs_default_dataset_test.go new file mode 100644 index 0000000..1f719e7 --- /dev/null +++ b/test/api_last_actor_task_runs_default_dataset_test.go @@ -0,0 +1,108 @@ +/* +Apify API + +Testing LastActorTaskRunsDefaultDatasetAPIService + +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); + +package apifyclient + +import ( + "context" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "testing" + openapiclient "github.com/apify/apify-client-go" +) + +func Test_apifyclient_LastActorTaskRunsDefaultDatasetAPIService(t *testing.T) { + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + + t.Run("Test LastActorTaskRunsDefaultDatasetAPIService ActorTaskRunsLastDatasetDelete", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var actorTaskId string + + httpRes, err := apiClient.LastActorTaskRunsDefaultDatasetAPI.ActorTaskRunsLastDatasetDelete(context.Background(), actorTaskId).Execute() + + require.Nil(t, err) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test LastActorTaskRunsDefaultDatasetAPIService ActorTaskRunsLastDatasetGet", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var actorTaskId string + + resp, httpRes, err := apiClient.LastActorTaskRunsDefaultDatasetAPI.ActorTaskRunsLastDatasetGet(context.Background(), actorTaskId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test LastActorTaskRunsDefaultDatasetAPIService ActorTaskRunsLastDatasetItemsGet", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var actorTaskId string + + resp, httpRes, err := apiClient.LastActorTaskRunsDefaultDatasetAPI.ActorTaskRunsLastDatasetItemsGet(context.Background(), actorTaskId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test LastActorTaskRunsDefaultDatasetAPIService ActorTaskRunsLastDatasetItemsPost", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var actorTaskId string + + resp, httpRes, err := apiClient.LastActorTaskRunsDefaultDatasetAPI.ActorTaskRunsLastDatasetItemsPost(context.Background(), actorTaskId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test LastActorTaskRunsDefaultDatasetAPIService ActorTaskRunsLastDatasetPut", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var actorTaskId string + + resp, httpRes, err := apiClient.LastActorTaskRunsDefaultDatasetAPI.ActorTaskRunsLastDatasetPut(context.Background(), actorTaskId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test LastActorTaskRunsDefaultDatasetAPIService ActorTaskRunsLastDatasetStatisticsGet", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var actorTaskId string + + resp, httpRes, err := apiClient.LastActorTaskRunsDefaultDatasetAPI.ActorTaskRunsLastDatasetStatisticsGet(context.Background(), actorTaskId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + +} diff --git a/test/api_last_actor_task_runs_default_key_value_store_test.go b/test/api_last_actor_task_runs_default_key_value_store_test.go new file mode 100644 index 0000000..0c965f1 --- /dev/null +++ b/test/api_last_actor_task_runs_default_key_value_store_test.go @@ -0,0 +1,153 @@ +/* +Apify API + +Testing LastActorTaskRunsDefaultKeyValueStoreAPIService + +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); + +package apifyclient + +import ( + "context" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "testing" + openapiclient "github.com/apify/apify-client-go" +) + +func Test_apifyclient_LastActorTaskRunsDefaultKeyValueStoreAPIService(t *testing.T) { + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + + t.Run("Test LastActorTaskRunsDefaultKeyValueStoreAPIService ActorTaskRunsLastKeyValueStoreDelete", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var actorTaskId string + + httpRes, err := apiClient.LastActorTaskRunsDefaultKeyValueStoreAPI.ActorTaskRunsLastKeyValueStoreDelete(context.Background(), actorTaskId).Execute() + + require.Nil(t, err) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test LastActorTaskRunsDefaultKeyValueStoreAPIService ActorTaskRunsLastKeyValueStoreGet", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var actorTaskId string + + resp, httpRes, err := apiClient.LastActorTaskRunsDefaultKeyValueStoreAPI.ActorTaskRunsLastKeyValueStoreGet(context.Background(), actorTaskId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test LastActorTaskRunsDefaultKeyValueStoreAPIService ActorTaskRunsLastKeyValueStoreKeysGet", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var actorTaskId string + + resp, httpRes, err := apiClient.LastActorTaskRunsDefaultKeyValueStoreAPI.ActorTaskRunsLastKeyValueStoreKeysGet(context.Background(), actorTaskId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test LastActorTaskRunsDefaultKeyValueStoreAPIService ActorTaskRunsLastKeyValueStorePut", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var actorTaskId string + + resp, httpRes, err := apiClient.LastActorTaskRunsDefaultKeyValueStoreAPI.ActorTaskRunsLastKeyValueStorePut(context.Background(), actorTaskId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test LastActorTaskRunsDefaultKeyValueStoreAPIService ActorTaskRunsLastKeyValueStoreRecordDelete", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var actorTaskId string + var recordKey string + + httpRes, err := apiClient.LastActorTaskRunsDefaultKeyValueStoreAPI.ActorTaskRunsLastKeyValueStoreRecordDelete(context.Background(), actorTaskId, recordKey).Execute() + + require.Nil(t, err) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test LastActorTaskRunsDefaultKeyValueStoreAPIService ActorTaskRunsLastKeyValueStoreRecordGet", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var actorTaskId string + var recordKey string + + resp, httpRes, err := apiClient.LastActorTaskRunsDefaultKeyValueStoreAPI.ActorTaskRunsLastKeyValueStoreRecordGet(context.Background(), actorTaskId, recordKey).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test LastActorTaskRunsDefaultKeyValueStoreAPIService ActorTaskRunsLastKeyValueStoreRecordPost", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var actorTaskId string + var recordKey string + + resp, httpRes, err := apiClient.LastActorTaskRunsDefaultKeyValueStoreAPI.ActorTaskRunsLastKeyValueStoreRecordPost(context.Background(), actorTaskId, recordKey).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test LastActorTaskRunsDefaultKeyValueStoreAPIService ActorTaskRunsLastKeyValueStoreRecordPut", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var actorTaskId string + var recordKey string + + resp, httpRes, err := apiClient.LastActorTaskRunsDefaultKeyValueStoreAPI.ActorTaskRunsLastKeyValueStoreRecordPut(context.Background(), actorTaskId, recordKey).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test LastActorTaskRunsDefaultKeyValueStoreAPIService ActorTaskRunsLastKeyValueStoreRecordsGet", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var actorTaskId string + + resp, httpRes, err := apiClient.LastActorTaskRunsDefaultKeyValueStoreAPI.ActorTaskRunsLastKeyValueStoreRecordsGet(context.Background(), actorTaskId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + +} diff --git a/test/api_last_actor_task_runs_default_request_queue_test.go b/test/api_last_actor_task_runs_default_request_queue_test.go new file mode 100644 index 0000000..dff1983 --- /dev/null +++ b/test/api_last_actor_task_runs_default_request_queue_test.go @@ -0,0 +1,237 @@ +/* +Apify API + +Testing LastActorTaskRunsDefaultRequestQueueAPIService + +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); + +package apifyclient + +import ( + "context" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "testing" + openapiclient "github.com/apify/apify-client-go" +) + +func Test_apifyclient_LastActorTaskRunsDefaultRequestQueueAPIService(t *testing.T) { + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + + t.Run("Test LastActorTaskRunsDefaultRequestQueueAPIService ActorTaskRunsLastRequestQueueDelete", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var actorTaskId string + + httpRes, err := apiClient.LastActorTaskRunsDefaultRequestQueueAPI.ActorTaskRunsLastRequestQueueDelete(context.Background(), actorTaskId).Execute() + + require.Nil(t, err) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test LastActorTaskRunsDefaultRequestQueueAPIService ActorTaskRunsLastRequestQueueGet", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var actorTaskId string + + resp, httpRes, err := apiClient.LastActorTaskRunsDefaultRequestQueueAPI.ActorTaskRunsLastRequestQueueGet(context.Background(), actorTaskId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test LastActorTaskRunsDefaultRequestQueueAPIService ActorTaskRunsLastRequestQueueHeadGet", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var actorTaskId string + + resp, httpRes, err := apiClient.LastActorTaskRunsDefaultRequestQueueAPI.ActorTaskRunsLastRequestQueueHeadGet(context.Background(), actorTaskId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test LastActorTaskRunsDefaultRequestQueueAPIService ActorTaskRunsLastRequestQueueHeadLockPost", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var actorTaskId string + + resp, httpRes, err := apiClient.LastActorTaskRunsDefaultRequestQueueAPI.ActorTaskRunsLastRequestQueueHeadLockPost(context.Background(), actorTaskId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test LastActorTaskRunsDefaultRequestQueueAPIService ActorTaskRunsLastRequestQueuePut", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var actorTaskId string + + resp, httpRes, err := apiClient.LastActorTaskRunsDefaultRequestQueueAPI.ActorTaskRunsLastRequestQueuePut(context.Background(), actorTaskId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test LastActorTaskRunsDefaultRequestQueueAPIService ActorTaskRunsLastRequestQueueRequestDelete", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var actorTaskId string + var requestId string + + httpRes, err := apiClient.LastActorTaskRunsDefaultRequestQueueAPI.ActorTaskRunsLastRequestQueueRequestDelete(context.Background(), actorTaskId, requestId).Execute() + + require.Nil(t, err) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test LastActorTaskRunsDefaultRequestQueueAPIService ActorTaskRunsLastRequestQueueRequestGet", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var actorTaskId string + var requestId string + + resp, httpRes, err := apiClient.LastActorTaskRunsDefaultRequestQueueAPI.ActorTaskRunsLastRequestQueueRequestGet(context.Background(), actorTaskId, requestId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test LastActorTaskRunsDefaultRequestQueueAPIService ActorTaskRunsLastRequestQueueRequestLockDelete", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var actorTaskId string + var requestId string + + httpRes, err := apiClient.LastActorTaskRunsDefaultRequestQueueAPI.ActorTaskRunsLastRequestQueueRequestLockDelete(context.Background(), actorTaskId, requestId).Execute() + + require.Nil(t, err) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test LastActorTaskRunsDefaultRequestQueueAPIService ActorTaskRunsLastRequestQueueRequestLockPut", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var actorTaskId string + var requestId string + + resp, httpRes, err := apiClient.LastActorTaskRunsDefaultRequestQueueAPI.ActorTaskRunsLastRequestQueueRequestLockPut(context.Background(), actorTaskId, requestId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test LastActorTaskRunsDefaultRequestQueueAPIService ActorTaskRunsLastRequestQueueRequestPut", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var actorTaskId string + var requestId string + + resp, httpRes, err := apiClient.LastActorTaskRunsDefaultRequestQueueAPI.ActorTaskRunsLastRequestQueueRequestPut(context.Background(), actorTaskId, requestId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test LastActorTaskRunsDefaultRequestQueueAPIService ActorTaskRunsLastRequestQueueRequestsBatchDelete", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var actorTaskId string + + resp, httpRes, err := apiClient.LastActorTaskRunsDefaultRequestQueueAPI.ActorTaskRunsLastRequestQueueRequestsBatchDelete(context.Background(), actorTaskId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test LastActorTaskRunsDefaultRequestQueueAPIService ActorTaskRunsLastRequestQueueRequestsBatchPost", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var actorTaskId string + + resp, httpRes, err := apiClient.LastActorTaskRunsDefaultRequestQueueAPI.ActorTaskRunsLastRequestQueueRequestsBatchPost(context.Background(), actorTaskId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test LastActorTaskRunsDefaultRequestQueueAPIService ActorTaskRunsLastRequestQueueRequestsGet", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var actorTaskId string + + resp, httpRes, err := apiClient.LastActorTaskRunsDefaultRequestQueueAPI.ActorTaskRunsLastRequestQueueRequestsGet(context.Background(), actorTaskId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test LastActorTaskRunsDefaultRequestQueueAPIService ActorTaskRunsLastRequestQueueRequestsPost", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var actorTaskId string + + resp, httpRes, err := apiClient.LastActorTaskRunsDefaultRequestQueueAPI.ActorTaskRunsLastRequestQueueRequestsPost(context.Background(), actorTaskId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test LastActorTaskRunsDefaultRequestQueueAPIService ActorTaskRunsLastRequestQueueRequestsUnlockPost", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var actorTaskId string + + resp, httpRes, err := apiClient.LastActorTaskRunsDefaultRequestQueueAPI.ActorTaskRunsLastRequestQueueRequestsUnlockPost(context.Background(), actorTaskId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + +} diff --git a/test/api_last_actor_task_runs_log_test.go b/test/api_last_actor_task_runs_log_test.go new file mode 100644 index 0000000..3c0cb5a --- /dev/null +++ b/test/api_last_actor_task_runs_log_test.go @@ -0,0 +1,39 @@ +/* +Apify API + +Testing LastActorTaskRunsLogAPIService + +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); + +package apifyclient + +import ( + "context" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "testing" + openapiclient "github.com/apify/apify-client-go" +) + +func Test_apifyclient_LastActorTaskRunsLogAPIService(t *testing.T) { + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + + t.Run("Test LastActorTaskRunsLogAPIService ActorTaskLastLogGet", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var actorTaskId string + + resp, httpRes, err := apiClient.LastActorTaskRunsLogAPI.ActorTaskLastLogGet(context.Background(), actorTaskId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + +} diff --git a/test/api_last_actor_task_runs_metamorph_test.go b/test/api_last_actor_task_runs_metamorph_test.go new file mode 100644 index 0000000..946bd96 --- /dev/null +++ b/test/api_last_actor_task_runs_metamorph_test.go @@ -0,0 +1,39 @@ +/* +Apify API + +Testing LastActorTaskRunsMetamorphAPIService + +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); + +package apifyclient + +import ( + "context" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "testing" + openapiclient "github.com/apify/apify-client-go" +) + +func Test_apifyclient_LastActorTaskRunsMetamorphAPIService(t *testing.T) { + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + + t.Run("Test LastActorTaskRunsMetamorphAPIService ActorTaskRunsLastMetamorphPost", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var actorTaskId string + + resp, httpRes, err := apiClient.LastActorTaskRunsMetamorphAPI.ActorTaskRunsLastMetamorphPost(context.Background(), actorTaskId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + +} diff --git a/test/api_last_actor_task_runs_reboot_test.go b/test/api_last_actor_task_runs_reboot_test.go new file mode 100644 index 0000000..979258a --- /dev/null +++ b/test/api_last_actor_task_runs_reboot_test.go @@ -0,0 +1,39 @@ +/* +Apify API + +Testing LastActorTaskRunsRebootAPIService + +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); + +package apifyclient + +import ( + "context" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "testing" + openapiclient "github.com/apify/apify-client-go" +) + +func Test_apifyclient_LastActorTaskRunsRebootAPIService(t *testing.T) { + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + + t.Run("Test LastActorTaskRunsRebootAPIService ActorTaskRunsLastRebootPost", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var actorTaskId string + + resp, httpRes, err := apiClient.LastActorTaskRunsRebootAPI.ActorTaskRunsLastRebootPost(context.Background(), actorTaskId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + +} diff --git a/test/api_logs_test.go b/test/api_logs_test.go new file mode 100644 index 0000000..26e927a --- /dev/null +++ b/test/api_logs_test.go @@ -0,0 +1,39 @@ +/* +Apify API + +Testing LogsAPIService + +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); + +package apifyclient + +import ( + "context" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "testing" + openapiclient "github.com/apify/apify-client-go" +) + +func Test_apifyclient_LogsAPIService(t *testing.T) { + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + + t.Run("Test LogsAPIService LogGet", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var buildOrRunId string + + resp, httpRes, err := apiClient.LogsAPI.LogGet(context.Background(), buildOrRunId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + +} diff --git a/test/api_schedules_test.go b/test/api_schedules_test.go new file mode 100644 index 0000000..fd851ba --- /dev/null +++ b/test/api_schedules_test.go @@ -0,0 +1,105 @@ +/* +Apify API + +Testing SchedulesAPIService + +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); + +package apifyclient + +import ( + "context" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "testing" + openapiclient "github.com/apify/apify-client-go" +) + +func Test_apifyclient_SchedulesAPIService(t *testing.T) { + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + + t.Run("Test SchedulesAPIService ScheduleDelete", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var scheduleId string + + resp, httpRes, err := apiClient.SchedulesAPI.ScheduleDelete(context.Background(), scheduleId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test SchedulesAPIService ScheduleGet", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var scheduleId string + + resp, httpRes, err := apiClient.SchedulesAPI.ScheduleGet(context.Background(), scheduleId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test SchedulesAPIService ScheduleLogGet", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var scheduleId string + + resp, httpRes, err := apiClient.SchedulesAPI.ScheduleLogGet(context.Background(), scheduleId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test SchedulesAPIService SchedulePut", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var scheduleId string + + resp, httpRes, err := apiClient.SchedulesAPI.SchedulePut(context.Background(), scheduleId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test SchedulesAPIService SchedulesGet", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.SchedulesAPI.SchedulesGet(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test SchedulesAPIService SchedulesPost", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.SchedulesAPI.SchedulesPost(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + +} diff --git a/test/api_storage_datasets_test.go b/test/api_storage_datasets_test.go new file mode 100644 index 0000000..b7fc870 --- /dev/null +++ b/test/api_storage_datasets_test.go @@ -0,0 +1,145 @@ +/* +Apify API + +Testing StorageDatasetsAPIService + +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); + +package apifyclient + +import ( + "context" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "testing" + openapiclient "github.com/apify/apify-client-go" +) + +func Test_apifyclient_StorageDatasetsAPIService(t *testing.T) { + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + + t.Run("Test StorageDatasetsAPIService DatasetDelete", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var datasetId string + + httpRes, err := apiClient.StorageDatasetsAPI.DatasetDelete(context.Background(), datasetId).Execute() + + require.Nil(t, err) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test StorageDatasetsAPIService DatasetGet", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var datasetId string + + resp, httpRes, err := apiClient.StorageDatasetsAPI.DatasetGet(context.Background(), datasetId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test StorageDatasetsAPIService DatasetItemsGet", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var datasetId string + + resp, httpRes, err := apiClient.StorageDatasetsAPI.DatasetItemsGet(context.Background(), datasetId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test StorageDatasetsAPIService DatasetItemsHead", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var datasetId string + + httpRes, err := apiClient.StorageDatasetsAPI.DatasetItemsHead(context.Background(), datasetId).Execute() + + require.Nil(t, err) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test StorageDatasetsAPIService DatasetItemsPost", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var datasetId string + + resp, httpRes, err := apiClient.StorageDatasetsAPI.DatasetItemsPost(context.Background(), datasetId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test StorageDatasetsAPIService DatasetPut", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var datasetId string + + resp, httpRes, err := apiClient.StorageDatasetsAPI.DatasetPut(context.Background(), datasetId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test StorageDatasetsAPIService DatasetStatisticsGet", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var datasetId string + + resp, httpRes, err := apiClient.StorageDatasetsAPI.DatasetStatisticsGet(context.Background(), datasetId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test StorageDatasetsAPIService DatasetsGet", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.StorageDatasetsAPI.DatasetsGet(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test StorageDatasetsAPIService DatasetsPost", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.StorageDatasetsAPI.DatasetsPost(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + +} diff --git a/test/api_storage_key_value_stores_test.go b/test/api_storage_key_value_stores_test.go new file mode 100644 index 0000000..a759837 --- /dev/null +++ b/test/api_storage_key_value_stores_test.go @@ -0,0 +1,191 @@ +/* +Apify API + +Testing StorageKeyValueStoresAPIService + +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); + +package apifyclient + +import ( + "context" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "testing" + openapiclient "github.com/apify/apify-client-go" +) + +func Test_apifyclient_StorageKeyValueStoresAPIService(t *testing.T) { + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + + t.Run("Test StorageKeyValueStoresAPIService KeyValueStoreDelete", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var storeId string + + httpRes, err := apiClient.StorageKeyValueStoresAPI.KeyValueStoreDelete(context.Background(), storeId).Execute() + + require.Nil(t, err) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test StorageKeyValueStoresAPIService KeyValueStoreGet", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var storeId string + + resp, httpRes, err := apiClient.StorageKeyValueStoresAPI.KeyValueStoreGet(context.Background(), storeId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test StorageKeyValueStoresAPIService KeyValueStoreKeysGet", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var storeId string + + resp, httpRes, err := apiClient.StorageKeyValueStoresAPI.KeyValueStoreKeysGet(context.Background(), storeId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test StorageKeyValueStoresAPIService KeyValueStorePut", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var storeId string + + resp, httpRes, err := apiClient.StorageKeyValueStoresAPI.KeyValueStorePut(context.Background(), storeId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test StorageKeyValueStoresAPIService KeyValueStoreRecordDelete", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var storeId string + var recordKey string + + httpRes, err := apiClient.StorageKeyValueStoresAPI.KeyValueStoreRecordDelete(context.Background(), storeId, recordKey).Execute() + + require.Nil(t, err) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test StorageKeyValueStoresAPIService KeyValueStoreRecordGet", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var storeId string + var recordKey string + + resp, httpRes, err := apiClient.StorageKeyValueStoresAPI.KeyValueStoreRecordGet(context.Background(), storeId, recordKey).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test StorageKeyValueStoresAPIService KeyValueStoreRecordHead", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var storeId string + var recordKey string + + httpRes, err := apiClient.StorageKeyValueStoresAPI.KeyValueStoreRecordHead(context.Background(), storeId, recordKey).Execute() + + require.Nil(t, err) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test StorageKeyValueStoresAPIService KeyValueStoreRecordPost", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var storeId string + var recordKey string + + resp, httpRes, err := apiClient.StorageKeyValueStoresAPI.KeyValueStoreRecordPost(context.Background(), storeId, recordKey).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test StorageKeyValueStoresAPIService KeyValueStoreRecordPut", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var storeId string + var recordKey string + + resp, httpRes, err := apiClient.StorageKeyValueStoresAPI.KeyValueStoreRecordPut(context.Background(), storeId, recordKey).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test StorageKeyValueStoresAPIService KeyValueStoreRecordsGet", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var storeId string + + resp, httpRes, err := apiClient.StorageKeyValueStoresAPI.KeyValueStoreRecordsGet(context.Background(), storeId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test StorageKeyValueStoresAPIService KeyValueStoresGet", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.StorageKeyValueStoresAPI.KeyValueStoresGet(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test StorageKeyValueStoresAPIService KeyValueStoresPost", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.StorageKeyValueStoresAPI.KeyValueStoresPost(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + +} diff --git a/test/api_storage_request_queues_requests_locks_test.go b/test/api_storage_request_queues_requests_locks_test.go new file mode 100644 index 0000000..dd7cf83 --- /dev/null +++ b/test/api_storage_request_queues_requests_locks_test.go @@ -0,0 +1,96 @@ +/* +Apify API + +Testing StorageRequestQueuesRequestsLocksAPIService + +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); + +package apifyclient + +import ( + "context" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "testing" + openapiclient "github.com/apify/apify-client-go" +) + +func Test_apifyclient_StorageRequestQueuesRequestsLocksAPIService(t *testing.T) { + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + + t.Run("Test StorageRequestQueuesRequestsLocksAPIService RequestQueueHeadGet", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var queueId string + + resp, httpRes, err := apiClient.StorageRequestQueuesRequestsLocksAPI.RequestQueueHeadGet(context.Background(), queueId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test StorageRequestQueuesRequestsLocksAPIService RequestQueueHeadLockPost", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var queueId string + + resp, httpRes, err := apiClient.StorageRequestQueuesRequestsLocksAPI.RequestQueueHeadLockPost(context.Background(), queueId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test StorageRequestQueuesRequestsLocksAPIService RequestQueueRequestLockDelete", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var queueId string + var requestId string + + httpRes, err := apiClient.StorageRequestQueuesRequestsLocksAPI.RequestQueueRequestLockDelete(context.Background(), queueId, requestId).Execute() + + require.Nil(t, err) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test StorageRequestQueuesRequestsLocksAPIService RequestQueueRequestLockPut", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var queueId string + var requestId string + + resp, httpRes, err := apiClient.StorageRequestQueuesRequestsLocksAPI.RequestQueueRequestLockPut(context.Background(), queueId, requestId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test StorageRequestQueuesRequestsLocksAPIService RequestQueueRequestsUnlockPost", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var queueId string + + resp, httpRes, err := apiClient.StorageRequestQueuesRequestsLocksAPI.RequestQueueRequestsUnlockPost(context.Background(), queueId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + +} diff --git a/test/api_storage_request_queues_requests_test.go b/test/api_storage_request_queues_requests_test.go new file mode 100644 index 0000000..b0097d8 --- /dev/null +++ b/test/api_storage_request_queues_requests_test.go @@ -0,0 +1,97 @@ +/* +Apify API + +Testing StorageRequestQueuesRequestsAPIService + +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); + +package apifyclient + +import ( + "context" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "testing" + openapiclient "github.com/apify/apify-client-go" +) + +func Test_apifyclient_StorageRequestQueuesRequestsAPIService(t *testing.T) { + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + + t.Run("Test StorageRequestQueuesRequestsAPIService RequestQueueRequestDelete", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var queueId string + var requestId string + + httpRes, err := apiClient.StorageRequestQueuesRequestsAPI.RequestQueueRequestDelete(context.Background(), queueId, requestId).Execute() + + require.Nil(t, err) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test StorageRequestQueuesRequestsAPIService RequestQueueRequestGet", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var queueId string + var requestId string + + resp, httpRes, err := apiClient.StorageRequestQueuesRequestsAPI.RequestQueueRequestGet(context.Background(), queueId, requestId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test StorageRequestQueuesRequestsAPIService RequestQueueRequestPut", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var queueId string + var requestId string + + resp, httpRes, err := apiClient.StorageRequestQueuesRequestsAPI.RequestQueueRequestPut(context.Background(), queueId, requestId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test StorageRequestQueuesRequestsAPIService RequestQueueRequestsGet", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var queueId string + + resp, httpRes, err := apiClient.StorageRequestQueuesRequestsAPI.RequestQueueRequestsGet(context.Background(), queueId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test StorageRequestQueuesRequestsAPIService RequestQueueRequestsPost", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var queueId string + + resp, httpRes, err := apiClient.StorageRequestQueuesRequestsAPI.RequestQueueRequestsPost(context.Background(), queueId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + +} diff --git a/test/api_storage_request_queues_test.go b/test/api_storage_request_queues_test.go new file mode 100644 index 0000000..4711673 --- /dev/null +++ b/test/api_storage_request_queues_test.go @@ -0,0 +1,118 @@ +/* +Apify API + +Testing StorageRequestQueuesAPIService + +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); + +package apifyclient + +import ( + "context" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "testing" + openapiclient "github.com/apify/apify-client-go" +) + +func Test_apifyclient_StorageRequestQueuesAPIService(t *testing.T) { + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + + t.Run("Test StorageRequestQueuesAPIService RequestQueueDelete", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var queueId string + + httpRes, err := apiClient.StorageRequestQueuesAPI.RequestQueueDelete(context.Background(), queueId).Execute() + + require.Nil(t, err) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test StorageRequestQueuesAPIService RequestQueueGet", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var queueId string + + resp, httpRes, err := apiClient.StorageRequestQueuesAPI.RequestQueueGet(context.Background(), queueId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test StorageRequestQueuesAPIService RequestQueuePut", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var queueId string + + resp, httpRes, err := apiClient.StorageRequestQueuesAPI.RequestQueuePut(context.Background(), queueId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test StorageRequestQueuesAPIService RequestQueueRequestsBatchDelete", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var queueId string + + resp, httpRes, err := apiClient.StorageRequestQueuesAPI.RequestQueueRequestsBatchDelete(context.Background(), queueId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test StorageRequestQueuesAPIService RequestQueueRequestsBatchPost", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var queueId string + + resp, httpRes, err := apiClient.StorageRequestQueuesAPI.RequestQueueRequestsBatchPost(context.Background(), queueId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test StorageRequestQueuesAPIService RequestQueuesGet", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.StorageRequestQueuesAPI.RequestQueuesGet(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test StorageRequestQueuesAPIService RequestQueuesPost", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.StorageRequestQueuesAPI.RequestQueuesPost(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + +} diff --git a/test/api_store_test.go b/test/api_store_test.go new file mode 100644 index 0000000..fb258ee --- /dev/null +++ b/test/api_store_test.go @@ -0,0 +1,37 @@ +/* +Apify API + +Testing StoreAPIService + +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); + +package apifyclient + +import ( + "context" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "testing" + openapiclient "github.com/apify/apify-client-go" +) + +func Test_apifyclient_StoreAPIService(t *testing.T) { + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + + t.Run("Test StoreAPIService StoreGet", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.StoreAPI.StoreGet(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + +} diff --git a/test/api_tools_test.go b/test/api_tools_test.go new file mode 100644 index 0000000..64149ff --- /dev/null +++ b/test/api_tools_test.go @@ -0,0 +1,97 @@ +/* +Apify API + +Testing ToolsAPIService + +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); + +package apifyclient + +import ( + "context" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "testing" + openapiclient "github.com/apify/apify-client-go" +) + +func Test_apifyclient_ToolsAPIService(t *testing.T) { + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + + t.Run("Test ToolsAPIService ToolsBrowserInfoDelete", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.ToolsAPI.ToolsBrowserInfoDelete(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test ToolsAPIService ToolsBrowserInfoGet", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.ToolsAPI.ToolsBrowserInfoGet(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test ToolsAPIService ToolsBrowserInfoPost", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.ToolsAPI.ToolsBrowserInfoPost(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test ToolsAPIService ToolsBrowserInfoPut", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.ToolsAPI.ToolsBrowserInfoPut(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test ToolsAPIService ToolsDecodeAndVerifyPost", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.ToolsAPI.ToolsDecodeAndVerifyPost(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test ToolsAPIService ToolsEncodeAndSignPost", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.ToolsAPI.ToolsEncodeAndSignPost(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + +} diff --git a/test/api_users_test.go b/test/api_users_test.go new file mode 100644 index 0000000..82635ae --- /dev/null +++ b/test/api_users_test.go @@ -0,0 +1,87 @@ +/* +Apify API + +Testing UsersAPIService + +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); + +package apifyclient + +import ( + "context" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "testing" + openapiclient "github.com/apify/apify-client-go" +) + +func Test_apifyclient_UsersAPIService(t *testing.T) { + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + + t.Run("Test UsersAPIService UserGet", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var userId string + + resp, httpRes, err := apiClient.UsersAPI.UserGet(context.Background(), userId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test UsersAPIService UsersMeGet", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.UsersAPI.UsersMeGet(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test UsersAPIService UsersMeLimitsGet", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.UsersAPI.UsersMeLimitsGet(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test UsersAPIService UsersMeLimitsPut", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.UsersAPI.UsersMeLimitsPut(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test UsersAPIService UsersMeUsageMonthlyGet", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.UsersAPI.UsersMeUsageMonthlyGet(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + +} diff --git a/test/api_webhooks_webhook_dispatches_test.go b/test/api_webhooks_webhook_dispatches_test.go new file mode 100644 index 0000000..98d66a0 --- /dev/null +++ b/test/api_webhooks_webhook_dispatches_test.go @@ -0,0 +1,51 @@ +/* +Apify API + +Testing WebhooksWebhookDispatchesAPIService + +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); + +package apifyclient + +import ( + "context" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "testing" + openapiclient "github.com/apify/apify-client-go" +) + +func Test_apifyclient_WebhooksWebhookDispatchesAPIService(t *testing.T) { + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + + t.Run("Test WebhooksWebhookDispatchesAPIService WebhookDispatchGet", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var dispatchId string + + resp, httpRes, err := apiClient.WebhooksWebhookDispatchesAPI.WebhookDispatchGet(context.Background(), dispatchId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test WebhooksWebhookDispatchesAPIService WebhookDispatchesGet", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.WebhooksWebhookDispatchesAPI.WebhookDispatchesGet(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + +} diff --git a/test/api_webhooks_webhooks_test.go b/test/api_webhooks_webhooks_test.go new file mode 100644 index 0000000..ba76d9d --- /dev/null +++ b/test/api_webhooks_webhooks_test.go @@ -0,0 +1,119 @@ +/* +Apify API + +Testing WebhooksWebhooksAPIService + +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); + +package apifyclient + +import ( + "context" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "testing" + openapiclient "github.com/apify/apify-client-go" +) + +func Test_apifyclient_WebhooksWebhooksAPIService(t *testing.T) { + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + + t.Run("Test WebhooksWebhooksAPIService WebhookDelete", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var webhookId string + + resp, httpRes, err := apiClient.WebhooksWebhooksAPI.WebhookDelete(context.Background(), webhookId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test WebhooksWebhooksAPIService WebhookGet", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var webhookId string + + resp, httpRes, err := apiClient.WebhooksWebhooksAPI.WebhookGet(context.Background(), webhookId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test WebhooksWebhooksAPIService WebhookPut", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var webhookId string + + resp, httpRes, err := apiClient.WebhooksWebhooksAPI.WebhookPut(context.Background(), webhookId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test WebhooksWebhooksAPIService WebhookTestPost", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var webhookId string + + resp, httpRes, err := apiClient.WebhooksWebhooksAPI.WebhookTestPost(context.Background(), webhookId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test WebhooksWebhooksAPIService WebhookWebhookDispatchesGet", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var webhookId string + + resp, httpRes, err := apiClient.WebhooksWebhooksAPI.WebhookWebhookDispatchesGet(context.Background(), webhookId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test WebhooksWebhooksAPIService WebhooksGet", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.WebhooksWebhooksAPI.WebhooksGet(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test WebhooksWebhooksAPIService WebhooksPost", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.WebhooksWebhooksAPI.WebhooksPost(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + +} diff --git a/utils.go b/utils.go new file mode 100644 index 0000000..a857029 --- /dev/null +++ b/utils.go @@ -0,0 +1,361 @@ +/* +Apify API + + The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. + +API version: v2-2026-06-16T064758Z +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apifyclient + +import ( + "bytes" + "encoding/json" + "fmt" + "reflect" + "time" +) + +// PtrBool is a helper routine that returns a pointer to given boolean value. +func PtrBool(v bool) *bool { return &v } + +// PtrInt is a helper routine that returns a pointer to given integer value. +func PtrInt(v int) *int { return &v } + +// PtrInt32 is a helper routine that returns a pointer to given integer value. +func PtrInt32(v int32) *int32 { return &v } + +// PtrInt64 is a helper routine that returns a pointer to given integer value. +func PtrInt64(v int64) *int64 { return &v } + +// PtrFloat32 is a helper routine that returns a pointer to given float value. +func PtrFloat32(v float32) *float32 { return &v } + +// PtrFloat64 is a helper routine that returns a pointer to given float value. +func PtrFloat64(v float64) *float64 { return &v } + +// PtrString is a helper routine that returns a pointer to given string value. +func PtrString(v string) *string { return &v } + +// PtrTime is helper routine that returns a pointer to given Time value. +func PtrTime(v time.Time) *time.Time { return &v } + +type NullableBool struct { + value *bool + isSet bool +} + +func (v NullableBool) Get() *bool { + return v.value +} + +func (v *NullableBool) Set(val *bool) { + v.value = val + v.isSet = true +} + +func (v NullableBool) IsSet() bool { + return v.isSet +} + +func (v *NullableBool) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBool(val *bool) *NullableBool { + return &NullableBool{value: val, isSet: true} +} + +func (v NullableBool) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBool) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt struct { + value *int + isSet bool +} + +func (v NullableInt) Get() *int { + return v.value +} + +func (v *NullableInt) Set(val *int) { + v.value = val + v.isSet = true +} + +func (v NullableInt) IsSet() bool { + return v.isSet +} + +func (v *NullableInt) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt(val *int) *NullableInt { + return &NullableInt{value: val, isSet: true} +} + +func (v NullableInt) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt32 struct { + value *int32 + isSet bool +} + +func (v NullableInt32) Get() *int32 { + return v.value +} + +func (v *NullableInt32) Set(val *int32) { + v.value = val + v.isSet = true +} + +func (v NullableInt32) IsSet() bool { + return v.isSet +} + +func (v *NullableInt32) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt32(val *int32) *NullableInt32 { + return &NullableInt32{value: val, isSet: true} +} + +func (v NullableInt32) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt32) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt64 struct { + value *int64 + isSet bool +} + +func (v NullableInt64) Get() *int64 { + return v.value +} + +func (v *NullableInt64) Set(val *int64) { + v.value = val + v.isSet = true +} + +func (v NullableInt64) IsSet() bool { + return v.isSet +} + +func (v *NullableInt64) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt64(val *int64) *NullableInt64 { + return &NullableInt64{value: val, isSet: true} +} + +func (v NullableInt64) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt64) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableFloat32 struct { + value *float32 + isSet bool +} + +func (v NullableFloat32) Get() *float32 { + return v.value +} + +func (v *NullableFloat32) Set(val *float32) { + v.value = val + v.isSet = true +} + +func (v NullableFloat32) IsSet() bool { + return v.isSet +} + +func (v *NullableFloat32) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFloat32(val *float32) *NullableFloat32 { + return &NullableFloat32{value: val, isSet: true} +} + +func (v NullableFloat32) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFloat32) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableFloat64 struct { + value *float64 + isSet bool +} + +func (v NullableFloat64) Get() *float64 { + return v.value +} + +func (v *NullableFloat64) Set(val *float64) { + v.value = val + v.isSet = true +} + +func (v NullableFloat64) IsSet() bool { + return v.isSet +} + +func (v *NullableFloat64) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFloat64(val *float64) *NullableFloat64 { + return &NullableFloat64{value: val, isSet: true} +} + +func (v NullableFloat64) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFloat64) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableString struct { + value *string + isSet bool +} + +func (v NullableString) Get() *string { + return v.value +} + +func (v *NullableString) Set(val *string) { + v.value = val + v.isSet = true +} + +func (v NullableString) IsSet() bool { + return v.isSet +} + +func (v *NullableString) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableString(val *string) *NullableString { + return &NullableString{value: val, isSet: true} +} + +func (v NullableString) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableString) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableTime struct { + value *time.Time + isSet bool +} + +func (v NullableTime) Get() *time.Time { + return v.value +} + +func (v *NullableTime) Set(val *time.Time) { + v.value = val + v.isSet = true +} + +func (v NullableTime) IsSet() bool { + return v.isSet +} + +func (v *NullableTime) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTime(val *time.Time) *NullableTime { + return &NullableTime{value: val, isSet: true} +} + +func (v NullableTime) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTime) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +// IsNil checks if an input is nil +func IsNil(i interface{}) bool { + if i == nil { + return true + } + switch reflect.TypeOf(i).Kind() { + case reflect.Chan, reflect.Func, reflect.Map, reflect.Ptr, reflect.UnsafePointer, reflect.Interface, reflect.Slice: + return reflect.ValueOf(i).IsNil() + case reflect.Array: + return reflect.ValueOf(i).IsZero() + } + return false +} + +type MappedNullable interface { + ToMap() (map[string]interface{}, error) +} + +// A wrapper for strict JSON decoding +func newStrictDecoder(data []byte) *json.Decoder { + dec := json.NewDecoder(bytes.NewBuffer(data)) + dec.DisallowUnknownFields() + return dec +} + +// Prevent trying to import "fmt" +func reportError(format string, a ...interface{}) error { + return fmt.Errorf(format, a...) +} \ No newline at end of file From 90b1c3494d0ee88772959f25aca995fea2d852d3 Mon Sep 17 00:00:00 2001 From: Claude <noreply@anthropic.com> Date: Thu, 18 Jun 2026 17:24:52 +0000 Subject: [PATCH 2/5] feat: develop full Apify API client in Go Develop the openapi-generator draft into a complete, idiomatic, fully OpenAPI-compliant Apify API client (package apify, stdlib-only) mirroring the canonical JS reference and the Rust sibling: resource-oriented client, replaceable HTTP backend, retries with exponential backoff, mandated User-Agent, convenience methods (call, wait, pagination, log redirection, URL signing), versioning constants, integration + unit tests, doc examples, CI workflow, docs and CHANGELOG. Based on OpenAPI spec v2-2026-06-16T064758Z. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> --- .github/workflows/go-integration-tests.yml | 70 + .openapi-generator-ignore | 23 - .openapi-generator/FILES | 593 - .openapi-generator/VERSION | 1 - .travis.yml | 8 - CHANGELOG.md | 76 + README.md | 1195 +- actor.go | 233 + actor_collection.go | 46 + actor_env_var.go | 48 + actor_version.go | 62 + api/openapi.yaml | 23400 ---------------- api_actor_builds.go | 1144 - api_actor_runs.go | 2192 -- api_actor_tasks.go | 4086 --- api_actors.go | 1303 - api_actors_actor_builds.go | 1199 - api_actors_actor_runs.go | 3255 --- api_actors_actor_versions.go | 2562 -- api_actors_webhook_collection.go | 244 - api_default_dataset.go | 1415 - api_default_key_value_store.go | 1921 -- api_default_request_queue.go | 3226 --- api_last_actor_runs_abort.go | 233 - api_last_actor_runs_default_dataset.go | 1475 - ...last_actor_runs_default_key_value_store.go | 2010 -- api_last_actor_runs_default_request_queue.go | 3376 --- api_last_actor_runs_log.go | 239 - api_last_actor_runs_metamorph.go | 242 - api_last_actor_runs_reboot.go | 223 - api_last_actor_task_runs_abort.go | 233 - api_last_actor_task_runs_default_dataset.go | 1475 - ...actor_task_runs_default_key_value_store.go | 2009 -- ...t_actor_task_runs_default_request_queue.go | 3376 --- api_last_actor_task_runs_log.go | 239 - api_last_actor_task_runs_metamorph.go | 242 - api_last_actor_task_runs_reboot.go | 223 - api_logs.go | 237 - api_schedules.go | 1236 - api_storage_datasets.go | 2385 -- api_storage_key_value_stores.go | 2470 -- api_storage_request_queues.go | 1503 - api_storage_request_queues_requests.go | 1114 - api_storage_request_queues_requests_locks.go | 1076 - api_store.go | 284 - api_tools.go | 985 - api_users.go | 915 - api_webhooks_webhook_dispatches.go | 410 - api_webhooks_webhooks.go | 1437 - base.go | 341 + build.go | 92 + client.go | 942 +- client_meta_test.go | 67 + common.go | 233 + configuration.go | 221 - dataset.go | 284 + dataset_collection.go | 25 + docs/AccountLimits.md | 93 - .../ActRunsLastDatasetItemsPost400Response.md | 51 - docs/ActRunsLastDatasetItemsPostRequest.md | 30 - docs/ActValidateInputPost200Response.md | 51 - docs/Actor.md | 886 - docs/ActorBuildsAPI.md | 438 - docs/ActorChargeEvent.md | 176 - docs/ActorDefinition.md | 420 - docs/ActorDefinitionDefaultMemoryMbytes.md | 30 - docs/ActorDefinitionStorages.md | 56 - docs/ActorJobStatus.md | 25 - docs/ActorPermissionLevel.md | 13 - docs/ActorResponse.md | 51 - docs/ActorRunFailedError.md | 56 - docs/ActorRunPricingInfo.md | 380 - docs/ActorRunTimeoutExceededError.md | 56 - docs/ActorRunsAPI.md | 755 - docs/ActorShort.md | 197 - docs/ActorStandby.md | 318 - docs/ActorStats.md | 342 - docs/ActorStatsPublicActorRunStats30Days.md | 160 - docs/ActorTaskGet200Response.md | 51 - docs/ActorTaskRunsGet200Response.md | 51 - docs/ActorTaskRunsGet200ResponseData.md | 156 - docs/ActorTaskRunsPost201Response.md | 51 - docs/ActorTaskWebhooksGet200Response.md | 51 - docs/ActorTaskWebhooksGet200ResponseData.md | 156 - docs/ActorTasksAPI.md | 1257 - docs/ActorsAPI.md | 440 - docs/ActorsActorBuildsAPI.md | 463 - docs/ActorsActorRunsAPI.md | 1010 - docs/ActorsActorVersionsAPI.md | 914 - docs/ActorsWebhookCollectionAPI.md | 85 - docs/AddRequestResponse.md | 51 - docs/AddedRequest.md | 114 - docs/BatchAddResponse.md | 51 - docs/BatchAddResult.md | 72 - docs/BatchDeleteResponse.md | 51 - docs/BatchDeleteResult.md | 72 - docs/BrowserInfoResponse.md | 186 - docs/BrowserInfoResponseHeadersValue.md | 30 - docs/Build.md | 527 - docs/BuildActVersion.md | 160 - docs/BuildOptions.md | 174 - docs/BuildResponse.md | 51 - docs/BuildShort.md | 275 - docs/BuildStats.md | 129 - docs/BuildTag.md | 51 - docs/BuildUsage.md | 66 - docs/BuildsMeta.md | 103 - docs/CallsInner.md | 210 - docs/ChargeRunRequest.md | 72 - docs/CommonActorPricingInfo.md | 253 - docs/CreateActorRequest.md | 504 - docs/CreateOrUpdateVersionRequest.md | 344 - docs/CreateTaskRequest.md | 221 - docs/Current.md | 266 - docs/CurrentPricingInfo.md | 495 - docs/DailyServiceUsages.md | 93 - docs/Dataset.md | 492 - docs/DatasetFieldStatistics.md | 174 - docs/DatasetListItem.md | 384 - docs/DatasetResponse.md | 51 - docs/DatasetSchemaValidationError.md | 108 - docs/DatasetStatistics.md | 56 - docs/DatasetStatisticsResponse.md | 51 - docs/DatasetStats.md | 134 - docs/DecodeAndVerifyData.md | 113 - docs/DecodeAndVerifyRequest.md | 51 - docs/DecodeAndVerifyResponse.md | 51 - docs/DefaultDatasetAPI.md | 484 - docs/DefaultKeyValueStoreAPI.md | 685 - docs/DefaultRequestQueueAPI.md | 1142 - docs/DefaultRunOptions.md | 206 - docs/DeletedRequest.md | 72 - docs/DeletedRequestById.md | 77 - docs/DeletedRequestByUniqueKey.md | 77 - docs/EffectivePlatformFeature.md | 165 - docs/EffectivePlatformFeatures.md | 240 - docs/EncodeAndSignData.md | 51 - docs/EncodeAndSignResponse.md | 51 - docs/EnvVar.md | 113 - docs/EnvVarRequest.md | 103 - docs/EnvVarResponse.md | 51 - docs/ErrorDetail.md | 82 - docs/ErrorResponse.md | 51 - docs/ErrorType.md | 791 - docs/EventData.md | 72 - docs/ExampleRunInput.md | 82 - docs/ExampleWebhookDispatch.md | 123 - docs/FlatPricePerMonthActorPricingInfo.md | 286 - docs/FreeActorPricingInfo.md | 244 - docs/GeneralAccess.md | 17 - docs/HeadAndLockResponse.md | 51 - docs/HeadRequest.md | 145 - docs/HeadResponse.md | 51 - docs/HttpMethod.md | 27 - docs/InvalidItem.md | 82 - docs/KeyValueStore.md | 496 - docs/KeyValueStoreKey.md | 93 - docs/KeyValueStoreResponse.md | 51 - docs/KeyValueStoreStats.md | 166 - docs/LastActorRunsAbortAPI.md | 83 - docs/LastActorRunsDefaultDatasetAPI.md | 496 - docs/LastActorRunsDefaultKeyValueStoreAPI.md | 703 - docs/LastActorRunsDefaultRequestQueueAPI.md | 1172 - docs/LastActorRunsLogAPI.md | 85 - docs/LastActorRunsMetamorphAPI.md | 85 - docs/LastActorRunsRebootAPI.md | 81 - docs/LastActorTaskRunsAbortAPI.md | 83 - docs/LastActorTaskRunsDefaultDatasetAPI.md | 496 - ...astActorTaskRunsDefaultKeyValueStoreAPI.md | 703 - ...LastActorTaskRunsDefaultRequestQueueAPI.md | 1172 - docs/LastActorTaskRunsLogAPI.md | 85 - docs/LastActorTaskRunsMetamorphAPI.md | 85 - docs/LastActorTaskRunsRebootAPI.md | 81 - docs/Limits.md | 287 - docs/LimitsResponse.md | 51 - docs/ListOfActors.md | 156 - docs/ListOfActorsInStoreResponse.md | 51 - docs/ListOfActorsResponse.md | 51 - docs/ListOfBuilds.md | 156 - docs/ListOfBuildsResponse.md | 51 - docs/ListOfDatasets.md | 182 - docs/ListOfDatasetsResponse.md | 51 - docs/ListOfEnvVars.md | 72 - docs/ListOfEnvVarsResponse.md | 51 - docs/ListOfKeyValueStores.md | 182 - docs/ListOfKeyValueStoresResponse.md | 51 - docs/ListOfKeys.md | 186 - docs/ListOfKeysResponse.md | 51 - docs/ListOfRequestQueues.md | 182 - docs/ListOfRequestQueuesResponse.md | 51 - docs/ListOfRequests.md | 150 - docs/ListOfRequestsResponse.md | 51 - docs/ListOfRuns.md | 156 - docs/ListOfRunsResponse.md | 51 - docs/ListOfSchedules.md | 156 - docs/ListOfSchedulesResponse.md | 51 - docs/ListOfStoreActors.md | 156 - docs/ListOfTasks.md | 156 - docs/ListOfTasksResponse.md | 51 - docs/ListOfVersions.md | 72 - docs/ListOfVersionsResponse.md | 51 - docs/ListOfWebhookDispatches.md | 156 - docs/ListOfWebhookDispatchesResponse.md | 51 - docs/ListOfWebhooks.md | 156 - docs/ListOfWebhooksResponse.md | 51 - docs/LockedHeadRequest.md | 166 - docs/LockedRequestQueueHead.md | 187 - docs/LogsAPI.md | 85 - docs/Metamorph.md | 129 - docs/MonthlyUsage.md | 135 - docs/MonthlyUsageResponse.md | 51 - docs/PaginationResponse.md | 135 - docs/PayPerEventActorPricingInfo.md | 301 - ...entActorPricingInfoAllOfPricingPerEvent.md | 56 - docs/Plan.md | 585 - docs/PricePerDatasetItemActorPricingInfo.md | 317 - docs/PriceTiers.md | 135 - docs/PrivateUserDataResponse.md | 51 - docs/Profile.md | 186 - docs/ProlongRequestLockResponse.md | 51 - docs/Proxy.md | 72 - docs/ProxyGroup.md | 103 - docs/PublicUserDataResponse.md | 51 - docs/PutItemResponseError.md | 51 - docs/README.md | 32 + docs/Request.md | 352 - docs/RequestBase.md | 376 - docs/RequestBasePayload.md | 30 - docs/RequestDraft.md | 124 - docs/RequestDraftDelete.md | 72 - docs/RequestDraftDeleteById.md | 77 - docs/RequestDraftDeleteByUniqueKey.md | 77 - docs/RequestLockInfo.md | 51 - docs/RequestQueue.md | 400 - docs/RequestQueueHead.md | 114 - docs/RequestQueueResponse.md | 51 - docs/RequestQueueShort.md | 411 - docs/RequestQueueStats.md | 160 - docs/RequestRegistration.md | 93 - docs/RequestResponse.md | 51 - docs/Run.md | 865 - docs/RunFailedErrorDetail.md | 92 - docs/RunMeta.md | 195 - docs/RunOptions.md | 176 - docs/RunOrigin.md | 29 - docs/RunResponse.md | 51 - docs/RunShort.md | 390 - docs/RunStats.md | 467 - docs/RunStorageIds.md | 108 - docs/RunStorageIdsDatasets.md | 56 - docs/RunTimeoutExceededErrorDetail.md | 92 - docs/RunUsage.md | 462 - docs/RunUsageUsd.md | 462 - docs/Schedule.md | 390 - docs/ScheduleAction.md | 202 - docs/ScheduleActionRunActor.md | 175 - docs/ScheduleActionRunActorTask.md | 139 - docs/ScheduleActionRunInput.md | 102 - docs/ScheduleActionShort.md | 124 - docs/ScheduleActionShortRunActor.md | 103 - docs/ScheduleActionShortRunActorTask.md | 103 - docs/ScheduleBase.md | 291 - docs/ScheduleCreate.md | 318 - docs/ScheduleCreateAction.md | 181 - docs/ScheduleCreateActionRunActor.md | 154 - docs/ScheduleCreateActionRunActorTask.md | 118 - docs/ScheduleInvoked.md | 93 - docs/ScheduleLogResponse.md | 51 - docs/ScheduleNotifications.md | 56 - docs/ScheduleResponse.md | 51 - docs/ScheduleShort.md | 292 - docs/SchedulesAPI.md | 432 - docs/SchemaValidationErrorData.md | 51 - docs/SourceCodeFile.md | 103 - docs/SourceCodeFileFormat.md | 13 - docs/SourceCodeFolder.md | 72 - docs/StorageDatasetsAPI.md | 743 - docs/StorageKeyValueStoresAPI.md | 899 - docs/StorageOwnership.md | 13 - docs/StorageRequestQueuesAPI.md | 517 - docs/StorageRequestQueuesRequestsAPI.md | 394 - docs/StorageRequestQueuesRequestsLocksAPI.md | 389 - docs/StoreAPI.md | 93 - docs/StoreListActor.md | 534 - docs/TaggedBuildInfo.md | 144 - docs/TaggedBuildsValue.md | 144 - docs/Task.md | 444 - docs/TaskOptions.md | 246 - docs/TaskResponse.md | 51 - docs/TaskShort.md | 300 - docs/TaskStats.md | 56 - docs/TestWebhookResponse.md | 51 - docs/TieredPricingPerDatasetItemEntry.md | 51 - docs/TieredPricingPerEventEntry.md | 51 - docs/ToolsAPI.md | 418 - docs/UnlockRequestsResponse.md | 51 - docs/UnlockRequestsResult.md | 51 - docs/UpdateActorRequest.md | 546 - docs/UpdateDatasetRequest.md | 92 - docs/UpdateLimitsRequest.md | 82 - docs/UpdateRequestQueueRequest.md | 92 - docs/UpdateRequestResponse.md | 51 - docs/UpdateRunRequest.md | 134 - docs/UpdateStoreRequest.md | 92 - docs/UpdateTaskRequest.md | 200 - docs/UsageCycle.md | 72 - docs/UsageItem.md | 150 - docs/UserPrivateInfo.md | 219 - docs/UserPublicInfo.md | 77 - docs/UsersAPI.md | 337 - docs/ValidationError.md | 160 - docs/Version.md | 314 - docs/VersionResponse.md | 51 - docs/VersionSourceFilesInner.md | 124 - docs/VersionSourceType.md | 19 - docs/Webhook.md | 486 - docs/WebhookCondition.md | 138 - docs/WebhookCreate.md | 381 - docs/WebhookDispatch.md | 244 - docs/WebhookDispatchResponse.md | 51 - docs/WebhookDispatchStatus.md | 15 - docs/WebhookDispatchWebhookSummary.md | 134 - docs/WebhookEventType.md | 33 - docs/WebhookRepresentation.md | 288 - docs/WebhookResponse.md | 51 - docs/WebhookShort.md | 441 - docs/WebhookStats.md | 51 - docs/WebhookUpdate.md | 390 - docs/WebhooksWebhookDispatchesAPI.md | 150 - docs/WebhooksWebhooksAPI.md | 503 - docs/actors.md | 69 + docs/builds.md | 37 + docs/misc.md | 67 + docs/runs.md | 56 + docs/schedules.md | 34 + docs/storages.md | 103 + docs/tasks.md | 43 + docs/webhooks.md | 45 + errors.go | 84 + examples/create_build_run_actor/main.go | 78 + examples/get_account/main.go | 30 + examples/iterate_store/main.go | 41 + examples/log_redirection/main.go | 38 + examples/run_and_last_run_storages/main.go | 53 + examples/run_store_actor/main.go | 36 + examples/storages/main.go | 79 + git_push.sh | 57 - go.mod | 4 - go.sum | 13 - http_client.go | 261 + key_value_store.go | 205 + key_value_store_collection.go | 26 + log.go | 95 + model_account_limits.go | 214 - ...ns_last_dataset_items_post_400_response.go | 107 - ...ct_runs_last_dataset_items_post_request.go | 171 - model_act_validate_input_post_200_response.go | 159 - model_actor.go | 1265 - model_actor_charge_event.go | 336 - model_actor_definition.go | 643 - ..._actor_definition_default_memory_mbytes.go | 171 - model_actor_definition_storages.go | 127 - model_actor_job_status.go | 123 - model_actor_permission_level.go | 111 - model_actor_response.go | 158 - model_actor_run_failed_error.go | 126 - model_actor_run_pricing_info.go | 247 - model_actor_run_timeout_exceeded_error.go | 126 - model_actor_short.go | 353 - model_actor_standby.go | 458 - model_actor_stats.go | 523 - ...tor_stats_public_actor_run_stats30_days.go | 270 - model_actor_task_get_200_response.go | 158 - model_actor_task_runs_get_200_response.go | 158 - ...l_actor_task_runs_get_200_response_data.go | 303 - model_actor_task_runs_post_201_response.go | 158 - model_actor_task_webhooks_get_200_response.go | 158 - ...tor_task_webhooks_get_200_response_data.go | 303 - model_add_request_response.go | 158 - model_added_request.go | 246 - model_batch_add_response.go | 158 - model_batch_add_result.go | 188 - model_batch_delete_response.go | 158 - model_batch_delete_result.go | 188 - model_browser_info_response.go | 324 - model_browser_info_response_headers_value.go | 171 - model_build.go | 787 - model_build_act_version.go | 272 - model_build_options.go | 274 - model_build_response.go | 158 - model_build_short.go | 461 - model_build_stats.go | 266 - model_build_tag.go | 158 - model_build_usage.go | 136 - model_builds_meta.go | 232 - model_calls_inner.go | 321 - model_charge_run_request.go | 186 - model_common_actor_pricing_info.go | 428 - model_create_actor_request.go | 692 - model_create_or_update_version_request.go | 489 - model_create_task_request.go | 370 - model_current.go | 446 - model_current_pricing_info.go | 735 - model_daily_service_usages.go | 215 - model_dataset.go | 725 - model_dataset_field_statistics.go | 278 - model_dataset_list_item.go | 601 - model_dataset_response.go | 158 - model_dataset_schema_validation_error.go | 200 - model_dataset_statistics.go | 127 - model_dataset_statistics_response.go | 158 - model_dataset_stats.go | 236 - model_decode_and_verify_data.go | 220 - model_decode_and_verify_request.go | 158 - model_decode_and_verify_response.go | 158 - model_default_run_options.go | 326 - model_deleted_request.go | 107 - model_deleted_request_by_id.go | 196 - model_deleted_request_by_unique_key.go | 196 - model_effective_platform_feature.go | 277 - model_effective_platform_features.go | 410 - model_encode_and_sign_data.go | 158 - model_encode_and_sign_response.go | 158 - model_env_var.go | 241 - model_env_var_request.go | 231 - model_env_var_response.go | 158 - model_error_detail.go | 163 - model_error_response.go | 158 - model_error_type.go | 889 - model_event_data.go | 186 - model_example_run_input.go | 162 - model_example_webhook_dispatch.go | 251 - ...flat_price_per_month_actor_pricing_info.go | 484 - model_free_actor_pricing_info.go | 426 - model_general_access.go | 115 - model_head_and_lock_response.go | 158 - model_head_request.go | 290 - model_head_response.go | 158 - model_http_method.go | 125 - model_invalid_item.go | 164 - model_key_value_store.go | 740 - model_key_value_store_key.go | 215 - model_key_value_store_response.go | 158 - model_key_value_store_stats.go | 314 - model_limits.go | 474 - model_limits_response.go | 158 - model_list_of_actors.go | 303 - model_list_of_actors_in_store_response.go | 158 - model_list_of_actors_response.go | 158 - model_list_of_builds.go | 303 - model_list_of_builds_response.go | 158 - model_list_of_datasets.go | 340 - model_list_of_datasets_response.go | 158 - model_list_of_env_vars.go | 187 - model_list_of_env_vars_response.go | 158 - model_list_of_key_value_stores.go | 340 - model_list_of_key_value_stores_response.go | 158 - model_list_of_keys.go | 335 - model_list_of_keys_response.go | 158 - model_list_of_request_queues.go | 341 - model_list_of_request_queues_response.go | 158 - model_list_of_requests.go | 303 - model_list_of_requests_response.go | 158 - model_list_of_runs.go | 303 - model_list_of_runs_response.go | 158 - model_list_of_schedules.go | 303 - model_list_of_schedules_response.go | 158 - model_list_of_store_actors.go | 303 - model_list_of_tasks.go | 303 - model_list_of_tasks_response.go | 158 - model_list_of_versions.go | 187 - model_list_of_versions_response.go | 158 - model_list_of_webhook_dispatches.go | 303 - model_list_of_webhook_dispatches_response.go | 158 - model_list_of_webhooks.go | 303 - model_list_of_webhooks_response.go | 158 - model_locked_head_request.go | 320 - model_locked_request_queue_head.go | 350 - model_metamorph.go | 265 - model_monthly_usage.go | 272 - model_monthly_usage_response.go | 158 - model_pagination_response.go | 275 - model_pay_per_event_actor_pricing_info.go | 500 - ...r_pricing_info_all_of_pricing_per_event.go | 126 - model_plan.go | 880 - ...ice_per_dataset_item_actor_pricing_info.go | 529 - model_price_tiers.go | 270 - model_private_user_data_response.go | 158 - model_profile.go | 306 - model_prolong_request_lock_response.go | 158 - model_proxy.go | 186 - model_proxy_group.go | 216 - model_public_user_data_response.go | 158 - model_put_item_response_error.go | 158 - model_request.go | 543 - model_request_base.go | 538 - model_request_base_payload.go | 94 - model_request_draft.go | 261 - model_request_draft_delete.go | 107 - model_request_draft_delete_by_id.go | 196 - model_request_draft_delete_by_unique_key.go | 196 - model_request_lock_info.go | 160 - model_request_queue.go | 634 - model_request_queue_head.go | 247 - model_request_queue_response.go | 158 - model_request_queue_short.go | 653 - model_request_queue_stats.go | 275 - model_request_registration.go | 217 - model_request_response.go | 158 - model_run.go | 1247 - model_run_failed_error_detail.go | 164 - model_run_meta.go | 347 - model_run_options.go | 324 - model_run_origin.go | 127 - model_run_response.go | 158 - model_run_short.go | 611 - model_run_stats.go | 728 - model_run_storage_ids.go | 198 - model_run_storage_ids_datasets.go | 156 - model_run_timeout_exceeded_error_detail.go | 164 - model_run_usage.go | 642 - model_run_usage_usd.go | 642 - model_schedule.go | 612 - model_schedule_action.go | 171 - model_schedule_action_run_actor.go | 310 - model_schedule_action_run_actor_task.go | 255 - model_schedule_action_run_input.go | 182 - model_schedule_action_short.go | 171 - model_schedule_action_short_run_actor.go | 218 - model_schedule_action_short_run_actor_task.go | 218 - model_schedule_base.go | 475 - model_schedule_create.go | 450 - model_schedule_create_action.go | 171 - model_schedule_create_action_run_actor.go | 282 - ...l_schedule_create_action_run_actor_task.go | 227 - model_schedule_invoked.go | 215 - model_schedule_log_response.go | 159 - model_schedule_notifications.go | 126 - model_schedule_response.go | 158 - model_schedule_short.go | 484 - model_schema_validation_error_data.go | 159 - model_source_code_file.go | 230 - model_source_code_file_format.go | 111 - model_source_code_folder.go | 188 - model_storage_ownership.go | 111 - model_store_list_actor.go | 802 - model_tagged_build_info.go | 249 - model_tagged_builds_value.go | 94 - model_task.go | 659 - model_task_options.go | 366 - model_task_response.go | 158 - model_task_short.go | 483 - model_task_stats.go | 126 - model_test_webhook_response.go | 158 - ...l_tiered_pricing_per_dataset_item_entry.go | 159 - model_tiered_pricing_per_event_entry.go | 159 - model_unlock_requests_response.go | 158 - model_unlock_requests_result.go | 159 - model_update_actor_request.go | 764 - model_update_dataset_request.go | 172 - model_update_limits_request.go | 164 - model_update_request_queue_request.go | 173 - model_update_request_response.go | 158 - model_update_run_request.go | 234 - model_update_store_request.go | 172 - model_update_task_request.go | 302 - model_usage_cycle.go | 187 - model_usage_item.go | 295 - model_user_private_info.go | 383 - model_user_public_info.go | 194 - model_validation_error.go | 275 - model_version.go | 485 - model_version_response.go | 158 - model_version_source_files_inner.go | 107 - model_version_source_type.go | 117 - model_webhook.go | 723 - model_webhook_condition.go | 228 - model_webhook_create.go | 582 - model_webhook_dispatch.go | 417 - model_webhook_dispatch_response.go | 158 - model_webhook_dispatch_status.go | 113 - model_webhook_dispatch_webhook_summary.go | 234 - model_webhook_event_type.go | 131 - model_webhook_representation.go | 469 - model_webhook_response.go | 158 - model_webhook_short.go | 675 - model_webhook_stats.go | 158 - model_webhook_update.go | 542 - models.go | 454 + openapitools.json | 7 - reflect.go | 54 + request_queue.go | 329 + request_queue_collection.go | 26 + response.go | 47 - review_fixes_test.go | 128 + run.go | 210 + run_collection.go | 41 + schedule.go | 61 + signature.go | 84 + signature_test.go | 41 + store_collection.go | 109 + task.go | 138 + task_collection.go | 25 + test/api_actor_builds_test.go | 106 - test/api_actor_runs_test.go | 162 - test/api_actor_tasks_test.go | 231 - test/api_actors_actor_builds_test.go | 112 - test/api_actors_actor_runs_test.go | 183 - test/api_actors_actor_versions_test.go | 207 - test/api_actors_test.go | 105 - test/api_actors_webhook_collection_test.go | 39 - test/api_default_dataset_test.go | 108 - test/api_default_key_value_store_test.go | 153 - test/api_default_request_queue_test.go | 237 - test/api_last_actor_runs_abort_test.go | 39 - ...pi_last_actor_runs_default_dataset_test.go | 108 - ...actor_runs_default_key_value_store_test.go | 153 - ...t_actor_runs_default_request_queue_test.go | 237 - test/api_last_actor_runs_log_test.go | 39 - test/api_last_actor_runs_metamorph_test.go | 39 - test/api_last_actor_runs_reboot_test.go | 39 - test/api_last_actor_task_runs_abort_test.go | 39 - ...st_actor_task_runs_default_dataset_test.go | 108 - ..._task_runs_default_key_value_store_test.go | 153 - ...or_task_runs_default_request_queue_test.go | 237 - test/api_last_actor_task_runs_log_test.go | 39 - ...api_last_actor_task_runs_metamorph_test.go | 39 - test/api_last_actor_task_runs_reboot_test.go | 39 - test/api_logs_test.go | 39 - test/api_schedules_test.go | 105 - test/api_storage_datasets_test.go | 145 - test/api_storage_key_value_stores_test.go | 191 - ...rage_request_queues_requests_locks_test.go | 96 - ...pi_storage_request_queues_requests_test.go | 97 - test/api_storage_request_queues_test.go | 118 - test/api_store_test.go | 37 - test/api_tools_test.go | 97 - test/api_users_test.go | 87 - test/api_webhooks_webhook_dispatches_test.go | 51 - test/api_webhooks_webhooks_test.go | 119 - tests/actor_run_test.go | 73 + tests/actor_test.go | 175 + tests/build_test.go | 60 + tests/config_test.go | 18 + tests/dataset_test.go | 109 + tests/examples_test.go | 32 + tests/helpers_test.go | 71 + tests/key_value_store_test.go | 185 + tests/request_queue_test.go | 198 + tests/schedule_test.go | 75 + tests/store_test.go | 46 + tests/task_test.go | 76 + tests/user_test.go | 45 + tests/webhook_test.go | 112 + unit_http_test.go | 220 + user.go | 62 + utils.go | 361 - version.go | 14 + webhook.go | 65 + webhook_dispatch.go | 41 + 660 files changed, 6868 insertions(+), 204525 deletions(-) create mode 100644 .github/workflows/go-integration-tests.yml delete mode 100644 .openapi-generator-ignore delete mode 100644 .openapi-generator/FILES delete mode 100644 .openapi-generator/VERSION delete mode 100644 .travis.yml create mode 100644 CHANGELOG.md create mode 100644 actor.go create mode 100644 actor_collection.go create mode 100644 actor_env_var.go create mode 100644 actor_version.go delete mode 100644 api/openapi.yaml delete mode 100644 api_actor_builds.go delete mode 100644 api_actor_runs.go delete mode 100644 api_actor_tasks.go delete mode 100644 api_actors.go delete mode 100644 api_actors_actor_builds.go delete mode 100644 api_actors_actor_runs.go delete mode 100644 api_actors_actor_versions.go delete mode 100644 api_actors_webhook_collection.go delete mode 100644 api_default_dataset.go delete mode 100644 api_default_key_value_store.go delete mode 100644 api_default_request_queue.go delete mode 100644 api_last_actor_runs_abort.go delete mode 100644 api_last_actor_runs_default_dataset.go delete mode 100644 api_last_actor_runs_default_key_value_store.go delete mode 100644 api_last_actor_runs_default_request_queue.go delete mode 100644 api_last_actor_runs_log.go delete mode 100644 api_last_actor_runs_metamorph.go delete mode 100644 api_last_actor_runs_reboot.go delete mode 100644 api_last_actor_task_runs_abort.go delete mode 100644 api_last_actor_task_runs_default_dataset.go delete mode 100644 api_last_actor_task_runs_default_key_value_store.go delete mode 100644 api_last_actor_task_runs_default_request_queue.go delete mode 100644 api_last_actor_task_runs_log.go delete mode 100644 api_last_actor_task_runs_metamorph.go delete mode 100644 api_last_actor_task_runs_reboot.go delete mode 100644 api_logs.go delete mode 100644 api_schedules.go delete mode 100644 api_storage_datasets.go delete mode 100644 api_storage_key_value_stores.go delete mode 100644 api_storage_request_queues.go delete mode 100644 api_storage_request_queues_requests.go delete mode 100644 api_storage_request_queues_requests_locks.go delete mode 100644 api_store.go delete mode 100644 api_tools.go delete mode 100644 api_users.go delete mode 100644 api_webhooks_webhook_dispatches.go delete mode 100644 api_webhooks_webhooks.go create mode 100644 base.go create mode 100644 build.go create mode 100644 client_meta_test.go create mode 100644 common.go delete mode 100644 configuration.go create mode 100644 dataset.go create mode 100644 dataset_collection.go delete mode 100644 docs/AccountLimits.md delete mode 100644 docs/ActRunsLastDatasetItemsPost400Response.md delete mode 100644 docs/ActRunsLastDatasetItemsPostRequest.md delete mode 100644 docs/ActValidateInputPost200Response.md delete mode 100644 docs/Actor.md delete mode 100644 docs/ActorBuildsAPI.md delete mode 100644 docs/ActorChargeEvent.md delete mode 100644 docs/ActorDefinition.md delete mode 100644 docs/ActorDefinitionDefaultMemoryMbytes.md delete mode 100644 docs/ActorDefinitionStorages.md delete mode 100644 docs/ActorJobStatus.md delete mode 100644 docs/ActorPermissionLevel.md delete mode 100644 docs/ActorResponse.md delete mode 100644 docs/ActorRunFailedError.md delete mode 100644 docs/ActorRunPricingInfo.md delete mode 100644 docs/ActorRunTimeoutExceededError.md delete mode 100644 docs/ActorRunsAPI.md delete mode 100644 docs/ActorShort.md delete mode 100644 docs/ActorStandby.md delete mode 100644 docs/ActorStats.md delete mode 100644 docs/ActorStatsPublicActorRunStats30Days.md delete mode 100644 docs/ActorTaskGet200Response.md delete mode 100644 docs/ActorTaskRunsGet200Response.md delete mode 100644 docs/ActorTaskRunsGet200ResponseData.md delete mode 100644 docs/ActorTaskRunsPost201Response.md delete mode 100644 docs/ActorTaskWebhooksGet200Response.md delete mode 100644 docs/ActorTaskWebhooksGet200ResponseData.md delete mode 100644 docs/ActorTasksAPI.md delete mode 100644 docs/ActorsAPI.md delete mode 100644 docs/ActorsActorBuildsAPI.md delete mode 100644 docs/ActorsActorRunsAPI.md delete mode 100644 docs/ActorsActorVersionsAPI.md delete mode 100644 docs/ActorsWebhookCollectionAPI.md delete mode 100644 docs/AddRequestResponse.md delete mode 100644 docs/AddedRequest.md delete mode 100644 docs/BatchAddResponse.md delete mode 100644 docs/BatchAddResult.md delete mode 100644 docs/BatchDeleteResponse.md delete mode 100644 docs/BatchDeleteResult.md delete mode 100644 docs/BrowserInfoResponse.md delete mode 100644 docs/BrowserInfoResponseHeadersValue.md delete mode 100644 docs/Build.md delete mode 100644 docs/BuildActVersion.md delete mode 100644 docs/BuildOptions.md delete mode 100644 docs/BuildResponse.md delete mode 100644 docs/BuildShort.md delete mode 100644 docs/BuildStats.md delete mode 100644 docs/BuildTag.md delete mode 100644 docs/BuildUsage.md delete mode 100644 docs/BuildsMeta.md delete mode 100644 docs/CallsInner.md delete mode 100644 docs/ChargeRunRequest.md delete mode 100644 docs/CommonActorPricingInfo.md delete mode 100644 docs/CreateActorRequest.md delete mode 100644 docs/CreateOrUpdateVersionRequest.md delete mode 100644 docs/CreateTaskRequest.md delete mode 100644 docs/Current.md delete mode 100644 docs/CurrentPricingInfo.md delete mode 100644 docs/DailyServiceUsages.md delete mode 100644 docs/Dataset.md delete mode 100644 docs/DatasetFieldStatistics.md delete mode 100644 docs/DatasetListItem.md delete mode 100644 docs/DatasetResponse.md delete mode 100644 docs/DatasetSchemaValidationError.md delete mode 100644 docs/DatasetStatistics.md delete mode 100644 docs/DatasetStatisticsResponse.md delete mode 100644 docs/DatasetStats.md delete mode 100644 docs/DecodeAndVerifyData.md delete mode 100644 docs/DecodeAndVerifyRequest.md delete mode 100644 docs/DecodeAndVerifyResponse.md delete mode 100644 docs/DefaultDatasetAPI.md delete mode 100644 docs/DefaultKeyValueStoreAPI.md delete mode 100644 docs/DefaultRequestQueueAPI.md delete mode 100644 docs/DefaultRunOptions.md delete mode 100644 docs/DeletedRequest.md delete mode 100644 docs/DeletedRequestById.md delete mode 100644 docs/DeletedRequestByUniqueKey.md delete mode 100644 docs/EffectivePlatformFeature.md delete mode 100644 docs/EffectivePlatformFeatures.md delete mode 100644 docs/EncodeAndSignData.md delete mode 100644 docs/EncodeAndSignResponse.md delete mode 100644 docs/EnvVar.md delete mode 100644 docs/EnvVarRequest.md delete mode 100644 docs/EnvVarResponse.md delete mode 100644 docs/ErrorDetail.md delete mode 100644 docs/ErrorResponse.md delete mode 100644 docs/ErrorType.md delete mode 100644 docs/EventData.md delete mode 100644 docs/ExampleRunInput.md delete mode 100644 docs/ExampleWebhookDispatch.md delete mode 100644 docs/FlatPricePerMonthActorPricingInfo.md delete mode 100644 docs/FreeActorPricingInfo.md delete mode 100644 docs/GeneralAccess.md delete mode 100644 docs/HeadAndLockResponse.md delete mode 100644 docs/HeadRequest.md delete mode 100644 docs/HeadResponse.md delete mode 100644 docs/HttpMethod.md delete mode 100644 docs/InvalidItem.md delete mode 100644 docs/KeyValueStore.md delete mode 100644 docs/KeyValueStoreKey.md delete mode 100644 docs/KeyValueStoreResponse.md delete mode 100644 docs/KeyValueStoreStats.md delete mode 100644 docs/LastActorRunsAbortAPI.md delete mode 100644 docs/LastActorRunsDefaultDatasetAPI.md delete mode 100644 docs/LastActorRunsDefaultKeyValueStoreAPI.md delete mode 100644 docs/LastActorRunsDefaultRequestQueueAPI.md delete mode 100644 docs/LastActorRunsLogAPI.md delete mode 100644 docs/LastActorRunsMetamorphAPI.md delete mode 100644 docs/LastActorRunsRebootAPI.md delete mode 100644 docs/LastActorTaskRunsAbortAPI.md delete mode 100644 docs/LastActorTaskRunsDefaultDatasetAPI.md delete mode 100644 docs/LastActorTaskRunsDefaultKeyValueStoreAPI.md delete mode 100644 docs/LastActorTaskRunsDefaultRequestQueueAPI.md delete mode 100644 docs/LastActorTaskRunsLogAPI.md delete mode 100644 docs/LastActorTaskRunsMetamorphAPI.md delete mode 100644 docs/LastActorTaskRunsRebootAPI.md delete mode 100644 docs/Limits.md delete mode 100644 docs/LimitsResponse.md delete mode 100644 docs/ListOfActors.md delete mode 100644 docs/ListOfActorsInStoreResponse.md delete mode 100644 docs/ListOfActorsResponse.md delete mode 100644 docs/ListOfBuilds.md delete mode 100644 docs/ListOfBuildsResponse.md delete mode 100644 docs/ListOfDatasets.md delete mode 100644 docs/ListOfDatasetsResponse.md delete mode 100644 docs/ListOfEnvVars.md delete mode 100644 docs/ListOfEnvVarsResponse.md delete mode 100644 docs/ListOfKeyValueStores.md delete mode 100644 docs/ListOfKeyValueStoresResponse.md delete mode 100644 docs/ListOfKeys.md delete mode 100644 docs/ListOfKeysResponse.md delete mode 100644 docs/ListOfRequestQueues.md delete mode 100644 docs/ListOfRequestQueuesResponse.md delete mode 100644 docs/ListOfRequests.md delete mode 100644 docs/ListOfRequestsResponse.md delete mode 100644 docs/ListOfRuns.md delete mode 100644 docs/ListOfRunsResponse.md delete mode 100644 docs/ListOfSchedules.md delete mode 100644 docs/ListOfSchedulesResponse.md delete mode 100644 docs/ListOfStoreActors.md delete mode 100644 docs/ListOfTasks.md delete mode 100644 docs/ListOfTasksResponse.md delete mode 100644 docs/ListOfVersions.md delete mode 100644 docs/ListOfVersionsResponse.md delete mode 100644 docs/ListOfWebhookDispatches.md delete mode 100644 docs/ListOfWebhookDispatchesResponse.md delete mode 100644 docs/ListOfWebhooks.md delete mode 100644 docs/ListOfWebhooksResponse.md delete mode 100644 docs/LockedHeadRequest.md delete mode 100644 docs/LockedRequestQueueHead.md delete mode 100644 docs/LogsAPI.md delete mode 100644 docs/Metamorph.md delete mode 100644 docs/MonthlyUsage.md delete mode 100644 docs/MonthlyUsageResponse.md delete mode 100644 docs/PaginationResponse.md delete mode 100644 docs/PayPerEventActorPricingInfo.md delete mode 100644 docs/PayPerEventActorPricingInfoAllOfPricingPerEvent.md delete mode 100644 docs/Plan.md delete mode 100644 docs/PricePerDatasetItemActorPricingInfo.md delete mode 100644 docs/PriceTiers.md delete mode 100644 docs/PrivateUserDataResponse.md delete mode 100644 docs/Profile.md delete mode 100644 docs/ProlongRequestLockResponse.md delete mode 100644 docs/Proxy.md delete mode 100644 docs/ProxyGroup.md delete mode 100644 docs/PublicUserDataResponse.md delete mode 100644 docs/PutItemResponseError.md create mode 100644 docs/README.md delete mode 100644 docs/Request.md delete mode 100644 docs/RequestBase.md delete mode 100644 docs/RequestBasePayload.md delete mode 100644 docs/RequestDraft.md delete mode 100644 docs/RequestDraftDelete.md delete mode 100644 docs/RequestDraftDeleteById.md delete mode 100644 docs/RequestDraftDeleteByUniqueKey.md delete mode 100644 docs/RequestLockInfo.md delete mode 100644 docs/RequestQueue.md delete mode 100644 docs/RequestQueueHead.md delete mode 100644 docs/RequestQueueResponse.md delete mode 100644 docs/RequestQueueShort.md delete mode 100644 docs/RequestQueueStats.md delete mode 100644 docs/RequestRegistration.md delete mode 100644 docs/RequestResponse.md delete mode 100644 docs/Run.md delete mode 100644 docs/RunFailedErrorDetail.md delete mode 100644 docs/RunMeta.md delete mode 100644 docs/RunOptions.md delete mode 100644 docs/RunOrigin.md delete mode 100644 docs/RunResponse.md delete mode 100644 docs/RunShort.md delete mode 100644 docs/RunStats.md delete mode 100644 docs/RunStorageIds.md delete mode 100644 docs/RunStorageIdsDatasets.md delete mode 100644 docs/RunTimeoutExceededErrorDetail.md delete mode 100644 docs/RunUsage.md delete mode 100644 docs/RunUsageUsd.md delete mode 100644 docs/Schedule.md delete mode 100644 docs/ScheduleAction.md delete mode 100644 docs/ScheduleActionRunActor.md delete mode 100644 docs/ScheduleActionRunActorTask.md delete mode 100644 docs/ScheduleActionRunInput.md delete mode 100644 docs/ScheduleActionShort.md delete mode 100644 docs/ScheduleActionShortRunActor.md delete mode 100644 docs/ScheduleActionShortRunActorTask.md delete mode 100644 docs/ScheduleBase.md delete mode 100644 docs/ScheduleCreate.md delete mode 100644 docs/ScheduleCreateAction.md delete mode 100644 docs/ScheduleCreateActionRunActor.md delete mode 100644 docs/ScheduleCreateActionRunActorTask.md delete mode 100644 docs/ScheduleInvoked.md delete mode 100644 docs/ScheduleLogResponse.md delete mode 100644 docs/ScheduleNotifications.md delete mode 100644 docs/ScheduleResponse.md delete mode 100644 docs/ScheduleShort.md delete mode 100644 docs/SchedulesAPI.md delete mode 100644 docs/SchemaValidationErrorData.md delete mode 100644 docs/SourceCodeFile.md delete mode 100644 docs/SourceCodeFileFormat.md delete mode 100644 docs/SourceCodeFolder.md delete mode 100644 docs/StorageDatasetsAPI.md delete mode 100644 docs/StorageKeyValueStoresAPI.md delete mode 100644 docs/StorageOwnership.md delete mode 100644 docs/StorageRequestQueuesAPI.md delete mode 100644 docs/StorageRequestQueuesRequestsAPI.md delete mode 100644 docs/StorageRequestQueuesRequestsLocksAPI.md delete mode 100644 docs/StoreAPI.md delete mode 100644 docs/StoreListActor.md delete mode 100644 docs/TaggedBuildInfo.md delete mode 100644 docs/TaggedBuildsValue.md delete mode 100644 docs/Task.md delete mode 100644 docs/TaskOptions.md delete mode 100644 docs/TaskResponse.md delete mode 100644 docs/TaskShort.md delete mode 100644 docs/TaskStats.md delete mode 100644 docs/TestWebhookResponse.md delete mode 100644 docs/TieredPricingPerDatasetItemEntry.md delete mode 100644 docs/TieredPricingPerEventEntry.md delete mode 100644 docs/ToolsAPI.md delete mode 100644 docs/UnlockRequestsResponse.md delete mode 100644 docs/UnlockRequestsResult.md delete mode 100644 docs/UpdateActorRequest.md delete mode 100644 docs/UpdateDatasetRequest.md delete mode 100644 docs/UpdateLimitsRequest.md delete mode 100644 docs/UpdateRequestQueueRequest.md delete mode 100644 docs/UpdateRequestResponse.md delete mode 100644 docs/UpdateRunRequest.md delete mode 100644 docs/UpdateStoreRequest.md delete mode 100644 docs/UpdateTaskRequest.md delete mode 100644 docs/UsageCycle.md delete mode 100644 docs/UsageItem.md delete mode 100644 docs/UserPrivateInfo.md delete mode 100644 docs/UserPublicInfo.md delete mode 100644 docs/UsersAPI.md delete mode 100644 docs/ValidationError.md delete mode 100644 docs/Version.md delete mode 100644 docs/VersionResponse.md delete mode 100644 docs/VersionSourceFilesInner.md delete mode 100644 docs/VersionSourceType.md delete mode 100644 docs/Webhook.md delete mode 100644 docs/WebhookCondition.md delete mode 100644 docs/WebhookCreate.md delete mode 100644 docs/WebhookDispatch.md delete mode 100644 docs/WebhookDispatchResponse.md delete mode 100644 docs/WebhookDispatchStatus.md delete mode 100644 docs/WebhookDispatchWebhookSummary.md delete mode 100644 docs/WebhookEventType.md delete mode 100644 docs/WebhookRepresentation.md delete mode 100644 docs/WebhookResponse.md delete mode 100644 docs/WebhookShort.md delete mode 100644 docs/WebhookStats.md delete mode 100644 docs/WebhookUpdate.md delete mode 100644 docs/WebhooksWebhookDispatchesAPI.md delete mode 100644 docs/WebhooksWebhooksAPI.md create mode 100644 docs/actors.md create mode 100644 docs/builds.md create mode 100644 docs/misc.md create mode 100644 docs/runs.md create mode 100644 docs/schedules.md create mode 100644 docs/storages.md create mode 100644 docs/tasks.md create mode 100644 docs/webhooks.md create mode 100644 errors.go create mode 100644 examples/create_build_run_actor/main.go create mode 100644 examples/get_account/main.go create mode 100644 examples/iterate_store/main.go create mode 100644 examples/log_redirection/main.go create mode 100644 examples/run_and_last_run_storages/main.go create mode 100644 examples/run_store_actor/main.go create mode 100644 examples/storages/main.go delete mode 100644 git_push.sh delete mode 100644 go.sum create mode 100644 http_client.go create mode 100644 key_value_store.go create mode 100644 key_value_store_collection.go create mode 100644 log.go delete mode 100644 model_account_limits.go delete mode 100644 model_act_runs_last_dataset_items_post_400_response.go delete mode 100644 model_act_runs_last_dataset_items_post_request.go delete mode 100644 model_act_validate_input_post_200_response.go delete mode 100644 model_actor.go delete mode 100644 model_actor_charge_event.go delete mode 100644 model_actor_definition.go delete mode 100644 model_actor_definition_default_memory_mbytes.go delete mode 100644 model_actor_definition_storages.go delete mode 100644 model_actor_job_status.go delete mode 100644 model_actor_permission_level.go delete mode 100644 model_actor_response.go delete mode 100644 model_actor_run_failed_error.go delete mode 100644 model_actor_run_pricing_info.go delete mode 100644 model_actor_run_timeout_exceeded_error.go delete mode 100644 model_actor_short.go delete mode 100644 model_actor_standby.go delete mode 100644 model_actor_stats.go delete mode 100644 model_actor_stats_public_actor_run_stats30_days.go delete mode 100644 model_actor_task_get_200_response.go delete mode 100644 model_actor_task_runs_get_200_response.go delete mode 100644 model_actor_task_runs_get_200_response_data.go delete mode 100644 model_actor_task_runs_post_201_response.go delete mode 100644 model_actor_task_webhooks_get_200_response.go delete mode 100644 model_actor_task_webhooks_get_200_response_data.go delete mode 100644 model_add_request_response.go delete mode 100644 model_added_request.go delete mode 100644 model_batch_add_response.go delete mode 100644 model_batch_add_result.go delete mode 100644 model_batch_delete_response.go delete mode 100644 model_batch_delete_result.go delete mode 100644 model_browser_info_response.go delete mode 100644 model_browser_info_response_headers_value.go delete mode 100644 model_build.go delete mode 100644 model_build_act_version.go delete mode 100644 model_build_options.go delete mode 100644 model_build_response.go delete mode 100644 model_build_short.go delete mode 100644 model_build_stats.go delete mode 100644 model_build_tag.go delete mode 100644 model_build_usage.go delete mode 100644 model_builds_meta.go delete mode 100644 model_calls_inner.go delete mode 100644 model_charge_run_request.go delete mode 100644 model_common_actor_pricing_info.go delete mode 100644 model_create_actor_request.go delete mode 100644 model_create_or_update_version_request.go delete mode 100644 model_create_task_request.go delete mode 100644 model_current.go delete mode 100644 model_current_pricing_info.go delete mode 100644 model_daily_service_usages.go delete mode 100644 model_dataset.go delete mode 100644 model_dataset_field_statistics.go delete mode 100644 model_dataset_list_item.go delete mode 100644 model_dataset_response.go delete mode 100644 model_dataset_schema_validation_error.go delete mode 100644 model_dataset_statistics.go delete mode 100644 model_dataset_statistics_response.go delete mode 100644 model_dataset_stats.go delete mode 100644 model_decode_and_verify_data.go delete mode 100644 model_decode_and_verify_request.go delete mode 100644 model_decode_and_verify_response.go delete mode 100644 model_default_run_options.go delete mode 100644 model_deleted_request.go delete mode 100644 model_deleted_request_by_id.go delete mode 100644 model_deleted_request_by_unique_key.go delete mode 100644 model_effective_platform_feature.go delete mode 100644 model_effective_platform_features.go delete mode 100644 model_encode_and_sign_data.go delete mode 100644 model_encode_and_sign_response.go delete mode 100644 model_env_var.go delete mode 100644 model_env_var_request.go delete mode 100644 model_env_var_response.go delete mode 100644 model_error_detail.go delete mode 100644 model_error_response.go delete mode 100644 model_error_type.go delete mode 100644 model_event_data.go delete mode 100644 model_example_run_input.go delete mode 100644 model_example_webhook_dispatch.go delete mode 100644 model_flat_price_per_month_actor_pricing_info.go delete mode 100644 model_free_actor_pricing_info.go delete mode 100644 model_general_access.go delete mode 100644 model_head_and_lock_response.go delete mode 100644 model_head_request.go delete mode 100644 model_head_response.go delete mode 100644 model_http_method.go delete mode 100644 model_invalid_item.go delete mode 100644 model_key_value_store.go delete mode 100644 model_key_value_store_key.go delete mode 100644 model_key_value_store_response.go delete mode 100644 model_key_value_store_stats.go delete mode 100644 model_limits.go delete mode 100644 model_limits_response.go delete mode 100644 model_list_of_actors.go delete mode 100644 model_list_of_actors_in_store_response.go delete mode 100644 model_list_of_actors_response.go delete mode 100644 model_list_of_builds.go delete mode 100644 model_list_of_builds_response.go delete mode 100644 model_list_of_datasets.go delete mode 100644 model_list_of_datasets_response.go delete mode 100644 model_list_of_env_vars.go delete mode 100644 model_list_of_env_vars_response.go delete mode 100644 model_list_of_key_value_stores.go delete mode 100644 model_list_of_key_value_stores_response.go delete mode 100644 model_list_of_keys.go delete mode 100644 model_list_of_keys_response.go delete mode 100644 model_list_of_request_queues.go delete mode 100644 model_list_of_request_queues_response.go delete mode 100644 model_list_of_requests.go delete mode 100644 model_list_of_requests_response.go delete mode 100644 model_list_of_runs.go delete mode 100644 model_list_of_runs_response.go delete mode 100644 model_list_of_schedules.go delete mode 100644 model_list_of_schedules_response.go delete mode 100644 model_list_of_store_actors.go delete mode 100644 model_list_of_tasks.go delete mode 100644 model_list_of_tasks_response.go delete mode 100644 model_list_of_versions.go delete mode 100644 model_list_of_versions_response.go delete mode 100644 model_list_of_webhook_dispatches.go delete mode 100644 model_list_of_webhook_dispatches_response.go delete mode 100644 model_list_of_webhooks.go delete mode 100644 model_list_of_webhooks_response.go delete mode 100644 model_locked_head_request.go delete mode 100644 model_locked_request_queue_head.go delete mode 100644 model_metamorph.go delete mode 100644 model_monthly_usage.go delete mode 100644 model_monthly_usage_response.go delete mode 100644 model_pagination_response.go delete mode 100644 model_pay_per_event_actor_pricing_info.go delete mode 100644 model_pay_per_event_actor_pricing_info_all_of_pricing_per_event.go delete mode 100644 model_plan.go delete mode 100644 model_price_per_dataset_item_actor_pricing_info.go delete mode 100644 model_price_tiers.go delete mode 100644 model_private_user_data_response.go delete mode 100644 model_profile.go delete mode 100644 model_prolong_request_lock_response.go delete mode 100644 model_proxy.go delete mode 100644 model_proxy_group.go delete mode 100644 model_public_user_data_response.go delete mode 100644 model_put_item_response_error.go delete mode 100644 model_request.go delete mode 100644 model_request_base.go delete mode 100644 model_request_base_payload.go delete mode 100644 model_request_draft.go delete mode 100644 model_request_draft_delete.go delete mode 100644 model_request_draft_delete_by_id.go delete mode 100644 model_request_draft_delete_by_unique_key.go delete mode 100644 model_request_lock_info.go delete mode 100644 model_request_queue.go delete mode 100644 model_request_queue_head.go delete mode 100644 model_request_queue_response.go delete mode 100644 model_request_queue_short.go delete mode 100644 model_request_queue_stats.go delete mode 100644 model_request_registration.go delete mode 100644 model_request_response.go delete mode 100644 model_run.go delete mode 100644 model_run_failed_error_detail.go delete mode 100644 model_run_meta.go delete mode 100644 model_run_options.go delete mode 100644 model_run_origin.go delete mode 100644 model_run_response.go delete mode 100644 model_run_short.go delete mode 100644 model_run_stats.go delete mode 100644 model_run_storage_ids.go delete mode 100644 model_run_storage_ids_datasets.go delete mode 100644 model_run_timeout_exceeded_error_detail.go delete mode 100644 model_run_usage.go delete mode 100644 model_run_usage_usd.go delete mode 100644 model_schedule.go delete mode 100644 model_schedule_action.go delete mode 100644 model_schedule_action_run_actor.go delete mode 100644 model_schedule_action_run_actor_task.go delete mode 100644 model_schedule_action_run_input.go delete mode 100644 model_schedule_action_short.go delete mode 100644 model_schedule_action_short_run_actor.go delete mode 100644 model_schedule_action_short_run_actor_task.go delete mode 100644 model_schedule_base.go delete mode 100644 model_schedule_create.go delete mode 100644 model_schedule_create_action.go delete mode 100644 model_schedule_create_action_run_actor.go delete mode 100644 model_schedule_create_action_run_actor_task.go delete mode 100644 model_schedule_invoked.go delete mode 100644 model_schedule_log_response.go delete mode 100644 model_schedule_notifications.go delete mode 100644 model_schedule_response.go delete mode 100644 model_schedule_short.go delete mode 100644 model_schema_validation_error_data.go delete mode 100644 model_source_code_file.go delete mode 100644 model_source_code_file_format.go delete mode 100644 model_source_code_folder.go delete mode 100644 model_storage_ownership.go delete mode 100644 model_store_list_actor.go delete mode 100644 model_tagged_build_info.go delete mode 100644 model_tagged_builds_value.go delete mode 100644 model_task.go delete mode 100644 model_task_options.go delete mode 100644 model_task_response.go delete mode 100644 model_task_short.go delete mode 100644 model_task_stats.go delete mode 100644 model_test_webhook_response.go delete mode 100644 model_tiered_pricing_per_dataset_item_entry.go delete mode 100644 model_tiered_pricing_per_event_entry.go delete mode 100644 model_unlock_requests_response.go delete mode 100644 model_unlock_requests_result.go delete mode 100644 model_update_actor_request.go delete mode 100644 model_update_dataset_request.go delete mode 100644 model_update_limits_request.go delete mode 100644 model_update_request_queue_request.go delete mode 100644 model_update_request_response.go delete mode 100644 model_update_run_request.go delete mode 100644 model_update_store_request.go delete mode 100644 model_update_task_request.go delete mode 100644 model_usage_cycle.go delete mode 100644 model_usage_item.go delete mode 100644 model_user_private_info.go delete mode 100644 model_user_public_info.go delete mode 100644 model_validation_error.go delete mode 100644 model_version.go delete mode 100644 model_version_response.go delete mode 100644 model_version_source_files_inner.go delete mode 100644 model_version_source_type.go delete mode 100644 model_webhook.go delete mode 100644 model_webhook_condition.go delete mode 100644 model_webhook_create.go delete mode 100644 model_webhook_dispatch.go delete mode 100644 model_webhook_dispatch_response.go delete mode 100644 model_webhook_dispatch_status.go delete mode 100644 model_webhook_dispatch_webhook_summary.go delete mode 100644 model_webhook_event_type.go delete mode 100644 model_webhook_representation.go delete mode 100644 model_webhook_response.go delete mode 100644 model_webhook_short.go delete mode 100644 model_webhook_stats.go delete mode 100644 model_webhook_update.go create mode 100644 models.go delete mode 100644 openapitools.json create mode 100644 reflect.go create mode 100644 request_queue.go create mode 100644 request_queue_collection.go delete mode 100644 response.go create mode 100644 review_fixes_test.go create mode 100644 run.go create mode 100644 run_collection.go create mode 100644 schedule.go create mode 100644 signature.go create mode 100644 signature_test.go create mode 100644 store_collection.go create mode 100644 task.go create mode 100644 task_collection.go delete mode 100644 test/api_actor_builds_test.go delete mode 100644 test/api_actor_runs_test.go delete mode 100644 test/api_actor_tasks_test.go delete mode 100644 test/api_actors_actor_builds_test.go delete mode 100644 test/api_actors_actor_runs_test.go delete mode 100644 test/api_actors_actor_versions_test.go delete mode 100644 test/api_actors_test.go delete mode 100644 test/api_actors_webhook_collection_test.go delete mode 100644 test/api_default_dataset_test.go delete mode 100644 test/api_default_key_value_store_test.go delete mode 100644 test/api_default_request_queue_test.go delete mode 100644 test/api_last_actor_runs_abort_test.go delete mode 100644 test/api_last_actor_runs_default_dataset_test.go delete mode 100644 test/api_last_actor_runs_default_key_value_store_test.go delete mode 100644 test/api_last_actor_runs_default_request_queue_test.go delete mode 100644 test/api_last_actor_runs_log_test.go delete mode 100644 test/api_last_actor_runs_metamorph_test.go delete mode 100644 test/api_last_actor_runs_reboot_test.go delete mode 100644 test/api_last_actor_task_runs_abort_test.go delete mode 100644 test/api_last_actor_task_runs_default_dataset_test.go delete mode 100644 test/api_last_actor_task_runs_default_key_value_store_test.go delete mode 100644 test/api_last_actor_task_runs_default_request_queue_test.go delete mode 100644 test/api_last_actor_task_runs_log_test.go delete mode 100644 test/api_last_actor_task_runs_metamorph_test.go delete mode 100644 test/api_last_actor_task_runs_reboot_test.go delete mode 100644 test/api_logs_test.go delete mode 100644 test/api_schedules_test.go delete mode 100644 test/api_storage_datasets_test.go delete mode 100644 test/api_storage_key_value_stores_test.go delete mode 100644 test/api_storage_request_queues_requests_locks_test.go delete mode 100644 test/api_storage_request_queues_requests_test.go delete mode 100644 test/api_storage_request_queues_test.go delete mode 100644 test/api_store_test.go delete mode 100644 test/api_tools_test.go delete mode 100644 test/api_users_test.go delete mode 100644 test/api_webhooks_webhook_dispatches_test.go delete mode 100644 test/api_webhooks_webhooks_test.go create mode 100644 tests/actor_run_test.go create mode 100644 tests/actor_test.go create mode 100644 tests/build_test.go create mode 100644 tests/config_test.go create mode 100644 tests/dataset_test.go create mode 100644 tests/examples_test.go create mode 100644 tests/helpers_test.go create mode 100644 tests/key_value_store_test.go create mode 100644 tests/request_queue_test.go create mode 100644 tests/schedule_test.go create mode 100644 tests/store_test.go create mode 100644 tests/task_test.go create mode 100644 tests/user_test.go create mode 100644 tests/webhook_test.go create mode 100644 unit_http_test.go create mode 100644 user.go delete mode 100644 utils.go create mode 100644 version.go create mode 100644 webhook.go create mode 100644 webhook_dispatch.go diff --git a/.github/workflows/go-integration-tests.yml b/.github/workflows/go-integration-tests.yml new file mode 100644 index 0000000..17de82e --- /dev/null +++ b/.github/workflows/go-integration-tests.yml @@ -0,0 +1,70 @@ +name: Go integration tests + +# Language-specific workflow: only runs for the Go client. Triggers on PRs to master that +# touch Go client, test, or example code, and can be dispatched manually from any branch. +on: + pull_request: + branches: [master] + paths: + - '**/*.go' + - 'go.mod' + - 'go.sum' + - '.github/workflows/go-integration-tests.yml' + workflow_dispatch: + +# Avoid concurrent runs of the same ref racing on the shared test account. +concurrency: + group: go-integration-${{ github.ref }} + cancel-in-progress: true + +jobs: + test: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version: '1.23' + cache: true + + - name: Check formatting + run: | + unformatted=$(gofmt -l .) + if [ -n "$unformatted" ]; then + echo "::error::The following files are not gofmt-formatted:" + echo "$unformatted" + exit 1 + fi + + - name: Vet + run: go vet ./... + + - name: Build + run: go build ./... + + - name: Unit tests + # The unit tests are offline (mock HTTP backend) and prove the retry/error/signature + # logic without hitting the API. + run: go test . -v + + # Fail fast if the integration-test secret is missing or empty. Without this guard the + # integration tests silently "pass" (they skip when APIFY_TOKEN is unset), so a green + # run would not prove the API logic actually executed. + - name: Require APIFY_TOKEN secret + env: + APIFY_TOKEN: ${{ secrets.APIFY_TOKEN }} + run: | + if [ -z "${APIFY_TOKEN}" ]; then + echo "::error::APIFY_TOKEN secret is empty or missing; integration tests would not run against the API." + exit 1 + fi + + - name: Integration tests + env: + # The integration-test token is stored as a repository secret. + APIFY_TOKEN: ${{ secrets.APIFY_TOKEN }} + # Limit parallelism to be gentle on the shared test account. + run: go test ./tests/ -v -timeout 900s -p 1 -parallel 4 diff --git a/.openapi-generator-ignore b/.openapi-generator-ignore deleted file mode 100644 index 7484ee5..0000000 --- a/.openapi-generator-ignore +++ /dev/null @@ -1,23 +0,0 @@ -# OpenAPI Generator Ignore -# Generated by openapi-generator https://github.com/openapitools/openapi-generator - -# Use this file to prevent files from being overwritten by the generator. -# The patterns follow closely to .gitignore or .dockerignore. - -# As an example, the C# client generator defines ApiClient.cs. -# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: -#ApiClient.cs - -# You can match any string of characters against a directory, file or extension with a single asterisk (*): -#foo/*/qux -# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux - -# You can recursively match patterns against a directory, file or extension with a double asterisk (**): -#foo/**/qux -# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux - -# You can also negate patterns with an exclamation (!). -# For example, you can ignore all files in a docs folder with the file extension .md: -#docs/*.md -# Then explicitly reverse the ignore rule for a single file: -#!docs/README.md diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES deleted file mode 100644 index 67cf02c..0000000 --- a/.openapi-generator/FILES +++ /dev/null @@ -1,593 +0,0 @@ -.gitignore -.openapi-generator-ignore -.travis.yml -README.md -api/openapi.yaml -api_actor_builds.go -api_actor_runs.go -api_actor_tasks.go -api_actors.go -api_actors_actor_builds.go -api_actors_actor_runs.go -api_actors_actor_versions.go -api_actors_webhook_collection.go -api_default_dataset.go -api_default_key_value_store.go -api_default_request_queue.go -api_last_actor_runs_abort.go -api_last_actor_runs_default_dataset.go -api_last_actor_runs_default_key_value_store.go -api_last_actor_runs_default_request_queue.go -api_last_actor_runs_log.go -api_last_actor_runs_metamorph.go -api_last_actor_runs_reboot.go -api_last_actor_task_runs_abort.go -api_last_actor_task_runs_default_dataset.go -api_last_actor_task_runs_default_key_value_store.go -api_last_actor_task_runs_default_request_queue.go -api_last_actor_task_runs_log.go -api_last_actor_task_runs_metamorph.go -api_last_actor_task_runs_reboot.go -api_logs.go -api_schedules.go -api_storage_datasets.go -api_storage_key_value_stores.go -api_storage_request_queues.go -api_storage_request_queues_requests.go -api_storage_request_queues_requests_locks.go -api_store.go -api_tools.go -api_users.go -api_webhooks_webhook_dispatches.go -api_webhooks_webhooks.go -client.go -configuration.go -docs/AccountLimits.md -docs/ActRunsLastDatasetItemsPost400Response.md -docs/ActRunsLastDatasetItemsPostRequest.md -docs/ActValidateInputPost200Response.md -docs/Actor.md -docs/ActorBuildsAPI.md -docs/ActorChargeEvent.md -docs/ActorDefinition.md -docs/ActorDefinitionDefaultMemoryMbytes.md -docs/ActorDefinitionStorages.md -docs/ActorJobStatus.md -docs/ActorPermissionLevel.md -docs/ActorResponse.md -docs/ActorRunFailedError.md -docs/ActorRunPricingInfo.md -docs/ActorRunTimeoutExceededError.md -docs/ActorRunsAPI.md -docs/ActorShort.md -docs/ActorStandby.md -docs/ActorStats.md -docs/ActorStatsPublicActorRunStats30Days.md -docs/ActorTaskGet200Response.md -docs/ActorTaskRunsGet200Response.md -docs/ActorTaskRunsGet200ResponseData.md -docs/ActorTaskRunsPost201Response.md -docs/ActorTaskWebhooksGet200Response.md -docs/ActorTaskWebhooksGet200ResponseData.md -docs/ActorTasksAPI.md -docs/ActorsAPI.md -docs/ActorsActorBuildsAPI.md -docs/ActorsActorRunsAPI.md -docs/ActorsActorVersionsAPI.md -docs/ActorsWebhookCollectionAPI.md -docs/AddRequestResponse.md -docs/AddedRequest.md -docs/BatchAddResponse.md -docs/BatchAddResult.md -docs/BatchDeleteResponse.md -docs/BatchDeleteResult.md -docs/BrowserInfoResponse.md -docs/BrowserInfoResponseHeadersValue.md -docs/Build.md -docs/BuildActVersion.md -docs/BuildOptions.md -docs/BuildResponse.md -docs/BuildShort.md -docs/BuildStats.md -docs/BuildTag.md -docs/BuildUsage.md -docs/BuildsMeta.md -docs/CallsInner.md -docs/ChargeRunRequest.md -docs/CommonActorPricingInfo.md -docs/CreateActorRequest.md -docs/CreateOrUpdateVersionRequest.md -docs/CreateTaskRequest.md -docs/Current.md -docs/CurrentPricingInfo.md -docs/DailyServiceUsages.md -docs/Dataset.md -docs/DatasetFieldStatistics.md -docs/DatasetListItem.md -docs/DatasetResponse.md -docs/DatasetSchemaValidationError.md -docs/DatasetStatistics.md -docs/DatasetStatisticsResponse.md -docs/DatasetStats.md -docs/DecodeAndVerifyData.md -docs/DecodeAndVerifyRequest.md -docs/DecodeAndVerifyResponse.md -docs/DefaultDatasetAPI.md -docs/DefaultKeyValueStoreAPI.md -docs/DefaultRequestQueueAPI.md -docs/DefaultRunOptions.md -docs/DeletedRequest.md -docs/DeletedRequestById.md -docs/DeletedRequestByUniqueKey.md -docs/EffectivePlatformFeature.md -docs/EffectivePlatformFeatures.md -docs/EncodeAndSignData.md -docs/EncodeAndSignResponse.md -docs/EnvVar.md -docs/EnvVarRequest.md -docs/EnvVarResponse.md -docs/ErrorDetail.md -docs/ErrorResponse.md -docs/ErrorType.md -docs/EventData.md -docs/ExampleRunInput.md -docs/ExampleWebhookDispatch.md -docs/FlatPricePerMonthActorPricingInfo.md -docs/FreeActorPricingInfo.md -docs/GeneralAccess.md -docs/HeadAndLockResponse.md -docs/HeadRequest.md -docs/HeadResponse.md -docs/HttpMethod.md -docs/InvalidItem.md -docs/KeyValueStore.md -docs/KeyValueStoreKey.md -docs/KeyValueStoreResponse.md -docs/KeyValueStoreStats.md -docs/LastActorRunsAbortAPI.md -docs/LastActorRunsDefaultDatasetAPI.md -docs/LastActorRunsDefaultKeyValueStoreAPI.md -docs/LastActorRunsDefaultRequestQueueAPI.md -docs/LastActorRunsLogAPI.md -docs/LastActorRunsMetamorphAPI.md -docs/LastActorRunsRebootAPI.md -docs/LastActorTaskRunsAbortAPI.md -docs/LastActorTaskRunsDefaultDatasetAPI.md -docs/LastActorTaskRunsDefaultKeyValueStoreAPI.md -docs/LastActorTaskRunsDefaultRequestQueueAPI.md -docs/LastActorTaskRunsLogAPI.md -docs/LastActorTaskRunsMetamorphAPI.md -docs/LastActorTaskRunsRebootAPI.md -docs/Limits.md -docs/LimitsResponse.md -docs/ListOfActors.md -docs/ListOfActorsInStoreResponse.md -docs/ListOfActorsResponse.md -docs/ListOfBuilds.md -docs/ListOfBuildsResponse.md -docs/ListOfDatasets.md -docs/ListOfDatasetsResponse.md -docs/ListOfEnvVars.md -docs/ListOfEnvVarsResponse.md -docs/ListOfKeyValueStores.md -docs/ListOfKeyValueStoresResponse.md -docs/ListOfKeys.md -docs/ListOfKeysResponse.md -docs/ListOfRequestQueues.md -docs/ListOfRequestQueuesResponse.md -docs/ListOfRequests.md -docs/ListOfRequestsResponse.md -docs/ListOfRuns.md -docs/ListOfRunsResponse.md -docs/ListOfSchedules.md -docs/ListOfSchedulesResponse.md -docs/ListOfStoreActors.md -docs/ListOfTasks.md -docs/ListOfTasksResponse.md -docs/ListOfVersions.md -docs/ListOfVersionsResponse.md -docs/ListOfWebhookDispatches.md -docs/ListOfWebhookDispatchesResponse.md -docs/ListOfWebhooks.md -docs/ListOfWebhooksResponse.md -docs/LockedHeadRequest.md -docs/LockedRequestQueueHead.md -docs/LogsAPI.md -docs/Metamorph.md -docs/MonthlyUsage.md -docs/MonthlyUsageResponse.md -docs/PaginationResponse.md -docs/PayPerEventActorPricingInfo.md -docs/PayPerEventActorPricingInfoAllOfPricingPerEvent.md -docs/Plan.md -docs/PricePerDatasetItemActorPricingInfo.md -docs/PriceTiers.md -docs/PrivateUserDataResponse.md -docs/Profile.md -docs/ProlongRequestLockResponse.md -docs/Proxy.md -docs/ProxyGroup.md -docs/PublicUserDataResponse.md -docs/PutItemResponseError.md -docs/Request.md -docs/RequestBase.md -docs/RequestBasePayload.md -docs/RequestDraft.md -docs/RequestDraftDelete.md -docs/RequestDraftDeleteById.md -docs/RequestDraftDeleteByUniqueKey.md -docs/RequestLockInfo.md -docs/RequestQueue.md -docs/RequestQueueHead.md -docs/RequestQueueResponse.md -docs/RequestQueueShort.md -docs/RequestQueueStats.md -docs/RequestRegistration.md -docs/RequestResponse.md -docs/Run.md -docs/RunFailedErrorDetail.md -docs/RunMeta.md -docs/RunOptions.md -docs/RunOrigin.md -docs/RunResponse.md -docs/RunShort.md -docs/RunStats.md -docs/RunStorageIds.md -docs/RunStorageIdsDatasets.md -docs/RunTimeoutExceededErrorDetail.md -docs/RunUsage.md -docs/RunUsageUsd.md -docs/Schedule.md -docs/ScheduleAction.md -docs/ScheduleActionRunActor.md -docs/ScheduleActionRunActorTask.md -docs/ScheduleActionRunInput.md -docs/ScheduleActionShort.md -docs/ScheduleActionShortRunActor.md -docs/ScheduleActionShortRunActorTask.md -docs/ScheduleBase.md -docs/ScheduleCreate.md -docs/ScheduleCreateAction.md -docs/ScheduleCreateActionRunActor.md -docs/ScheduleCreateActionRunActorTask.md -docs/ScheduleInvoked.md -docs/ScheduleLogResponse.md -docs/ScheduleNotifications.md -docs/ScheduleResponse.md -docs/ScheduleShort.md -docs/SchedulesAPI.md -docs/SchemaValidationErrorData.md -docs/SourceCodeFile.md -docs/SourceCodeFileFormat.md -docs/SourceCodeFolder.md -docs/StorageDatasetsAPI.md -docs/StorageKeyValueStoresAPI.md -docs/StorageOwnership.md -docs/StorageRequestQueuesAPI.md -docs/StorageRequestQueuesRequestsAPI.md -docs/StorageRequestQueuesRequestsLocksAPI.md -docs/StoreAPI.md -docs/StoreListActor.md -docs/TaggedBuildInfo.md -docs/TaggedBuildsValue.md -docs/Task.md -docs/TaskOptions.md -docs/TaskResponse.md -docs/TaskShort.md -docs/TaskStats.md -docs/TestWebhookResponse.md -docs/TieredPricingPerDatasetItemEntry.md -docs/TieredPricingPerEventEntry.md -docs/ToolsAPI.md -docs/UnlockRequestsResponse.md -docs/UnlockRequestsResult.md -docs/UpdateActorRequest.md -docs/UpdateDatasetRequest.md -docs/UpdateLimitsRequest.md -docs/UpdateRequestQueueRequest.md -docs/UpdateRequestResponse.md -docs/UpdateRunRequest.md -docs/UpdateStoreRequest.md -docs/UpdateTaskRequest.md -docs/UsageCycle.md -docs/UsageItem.md -docs/UserPrivateInfo.md -docs/UserPublicInfo.md -docs/UsersAPI.md -docs/ValidationError.md -docs/Version.md -docs/VersionResponse.md -docs/VersionSourceFilesInner.md -docs/VersionSourceType.md -docs/Webhook.md -docs/WebhookCondition.md -docs/WebhookCreate.md -docs/WebhookDispatch.md -docs/WebhookDispatchResponse.md -docs/WebhookDispatchStatus.md -docs/WebhookDispatchWebhookSummary.md -docs/WebhookEventType.md -docs/WebhookRepresentation.md -docs/WebhookResponse.md -docs/WebhookShort.md -docs/WebhookStats.md -docs/WebhookUpdate.md -docs/WebhooksWebhookDispatchesAPI.md -docs/WebhooksWebhooksAPI.md -git_push.sh -go.mod -go.sum -model_account_limits.go -model_act_runs_last_dataset_items_post_400_response.go -model_act_runs_last_dataset_items_post_request.go -model_act_validate_input_post_200_response.go -model_actor.go -model_actor_charge_event.go -model_actor_definition.go -model_actor_definition_default_memory_mbytes.go -model_actor_definition_storages.go -model_actor_job_status.go -model_actor_permission_level.go -model_actor_response.go -model_actor_run_failed_error.go -model_actor_run_pricing_info.go -model_actor_run_timeout_exceeded_error.go -model_actor_short.go -model_actor_standby.go -model_actor_stats.go -model_actor_stats_public_actor_run_stats30_days.go -model_actor_task_get_200_response.go -model_actor_task_runs_get_200_response.go -model_actor_task_runs_get_200_response_data.go -model_actor_task_runs_post_201_response.go -model_actor_task_webhooks_get_200_response.go -model_actor_task_webhooks_get_200_response_data.go -model_add_request_response.go -model_added_request.go -model_batch_add_response.go -model_batch_add_result.go -model_batch_delete_response.go -model_batch_delete_result.go -model_browser_info_response.go -model_browser_info_response_headers_value.go -model_build.go -model_build_act_version.go -model_build_options.go -model_build_response.go -model_build_short.go -model_build_stats.go -model_build_tag.go -model_build_usage.go -model_builds_meta.go -model_calls_inner.go -model_charge_run_request.go -model_common_actor_pricing_info.go -model_create_actor_request.go -model_create_or_update_version_request.go -model_create_task_request.go -model_current.go -model_current_pricing_info.go -model_daily_service_usages.go -model_dataset.go -model_dataset_field_statistics.go -model_dataset_list_item.go -model_dataset_response.go -model_dataset_schema_validation_error.go -model_dataset_statistics.go -model_dataset_statistics_response.go -model_dataset_stats.go -model_decode_and_verify_data.go -model_decode_and_verify_request.go -model_decode_and_verify_response.go -model_default_run_options.go -model_deleted_request.go -model_deleted_request_by_id.go -model_deleted_request_by_unique_key.go -model_effective_platform_feature.go -model_effective_platform_features.go -model_encode_and_sign_data.go -model_encode_and_sign_response.go -model_env_var.go -model_env_var_request.go -model_env_var_response.go -model_error_detail.go -model_error_response.go -model_error_type.go -model_event_data.go -model_example_run_input.go -model_example_webhook_dispatch.go -model_flat_price_per_month_actor_pricing_info.go -model_free_actor_pricing_info.go -model_general_access.go -model_head_and_lock_response.go -model_head_request.go -model_head_response.go -model_http_method.go -model_invalid_item.go -model_key_value_store.go -model_key_value_store_key.go -model_key_value_store_response.go -model_key_value_store_stats.go -model_limits.go -model_limits_response.go -model_list_of_actors.go -model_list_of_actors_in_store_response.go -model_list_of_actors_response.go -model_list_of_builds.go -model_list_of_builds_response.go -model_list_of_datasets.go -model_list_of_datasets_response.go -model_list_of_env_vars.go -model_list_of_env_vars_response.go -model_list_of_key_value_stores.go -model_list_of_key_value_stores_response.go -model_list_of_keys.go -model_list_of_keys_response.go -model_list_of_request_queues.go -model_list_of_request_queues_response.go -model_list_of_requests.go -model_list_of_requests_response.go -model_list_of_runs.go -model_list_of_runs_response.go -model_list_of_schedules.go -model_list_of_schedules_response.go -model_list_of_store_actors.go -model_list_of_tasks.go -model_list_of_tasks_response.go -model_list_of_versions.go -model_list_of_versions_response.go -model_list_of_webhook_dispatches.go -model_list_of_webhook_dispatches_response.go -model_list_of_webhooks.go -model_list_of_webhooks_response.go -model_locked_head_request.go -model_locked_request_queue_head.go -model_metamorph.go -model_monthly_usage.go -model_monthly_usage_response.go -model_pagination_response.go -model_pay_per_event_actor_pricing_info.go -model_pay_per_event_actor_pricing_info_all_of_pricing_per_event.go -model_plan.go -model_price_per_dataset_item_actor_pricing_info.go -model_price_tiers.go -model_private_user_data_response.go -model_profile.go -model_prolong_request_lock_response.go -model_proxy.go -model_proxy_group.go -model_public_user_data_response.go -model_put_item_response_error.go -model_request.go -model_request_base.go -model_request_base_payload.go -model_request_draft.go -model_request_draft_delete.go -model_request_draft_delete_by_id.go -model_request_draft_delete_by_unique_key.go -model_request_lock_info.go -model_request_queue.go -model_request_queue_head.go -model_request_queue_response.go -model_request_queue_short.go -model_request_queue_stats.go -model_request_registration.go -model_request_response.go -model_run.go -model_run_failed_error_detail.go -model_run_meta.go -model_run_options.go -model_run_origin.go -model_run_response.go -model_run_short.go -model_run_stats.go -model_run_storage_ids.go -model_run_storage_ids_datasets.go -model_run_timeout_exceeded_error_detail.go -model_run_usage.go -model_run_usage_usd.go -model_schedule.go -model_schedule_action.go -model_schedule_action_run_actor.go -model_schedule_action_run_actor_task.go -model_schedule_action_run_input.go -model_schedule_action_short.go -model_schedule_action_short_run_actor.go -model_schedule_action_short_run_actor_task.go -model_schedule_base.go -model_schedule_create.go -model_schedule_create_action.go -model_schedule_create_action_run_actor.go -model_schedule_create_action_run_actor_task.go -model_schedule_invoked.go -model_schedule_log_response.go -model_schedule_notifications.go -model_schedule_response.go -model_schedule_short.go -model_schema_validation_error_data.go -model_source_code_file.go -model_source_code_file_format.go -model_source_code_folder.go -model_storage_ownership.go -model_store_list_actor.go -model_tagged_build_info.go -model_tagged_builds_value.go -model_task.go -model_task_options.go -model_task_response.go -model_task_short.go -model_task_stats.go -model_test_webhook_response.go -model_tiered_pricing_per_dataset_item_entry.go -model_tiered_pricing_per_event_entry.go -model_unlock_requests_response.go -model_unlock_requests_result.go -model_update_actor_request.go -model_update_dataset_request.go -model_update_limits_request.go -model_update_request_queue_request.go -model_update_request_response.go -model_update_run_request.go -model_update_store_request.go -model_update_task_request.go -model_usage_cycle.go -model_usage_item.go -model_user_private_info.go -model_user_public_info.go -model_validation_error.go -model_version.go -model_version_response.go -model_version_source_files_inner.go -model_version_source_type.go -model_webhook.go -model_webhook_condition.go -model_webhook_create.go -model_webhook_dispatch.go -model_webhook_dispatch_response.go -model_webhook_dispatch_status.go -model_webhook_dispatch_webhook_summary.go -model_webhook_event_type.go -model_webhook_representation.go -model_webhook_response.go -model_webhook_short.go -model_webhook_stats.go -model_webhook_update.go -response.go -test/api_actor_builds_test.go -test/api_actor_runs_test.go -test/api_actor_tasks_test.go -test/api_actors_actor_builds_test.go -test/api_actors_actor_runs_test.go -test/api_actors_actor_versions_test.go -test/api_actors_test.go -test/api_actors_webhook_collection_test.go -test/api_default_dataset_test.go -test/api_default_key_value_store_test.go -test/api_default_request_queue_test.go -test/api_last_actor_runs_abort_test.go -test/api_last_actor_runs_default_dataset_test.go -test/api_last_actor_runs_default_key_value_store_test.go -test/api_last_actor_runs_default_request_queue_test.go -test/api_last_actor_runs_log_test.go -test/api_last_actor_runs_metamorph_test.go -test/api_last_actor_runs_reboot_test.go -test/api_last_actor_task_runs_abort_test.go -test/api_last_actor_task_runs_default_dataset_test.go -test/api_last_actor_task_runs_default_key_value_store_test.go -test/api_last_actor_task_runs_default_request_queue_test.go -test/api_last_actor_task_runs_log_test.go -test/api_last_actor_task_runs_metamorph_test.go -test/api_last_actor_task_runs_reboot_test.go -test/api_logs_test.go -test/api_schedules_test.go -test/api_storage_datasets_test.go -test/api_storage_key_value_stores_test.go -test/api_storage_request_queues_requests_locks_test.go -test/api_storage_request_queues_requests_test.go -test/api_storage_request_queues_test.go -test/api_store_test.go -test/api_tools_test.go -test/api_users_test.go -test/api_webhooks_webhook_dispatches_test.go -test/api_webhooks_webhooks_test.go -utils.go diff --git a/.openapi-generator/VERSION b/.openapi-generator/VERSION deleted file mode 100644 index 14d6b5d..0000000 --- a/.openapi-generator/VERSION +++ /dev/null @@ -1 +0,0 @@ -7.23.0 diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index f5cb2ce..0000000 --- a/.travis.yml +++ /dev/null @@ -1,8 +0,0 @@ -language: go - -install: - - go get -d -v . - -script: - - go build -v ./ - diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..63c1f4d --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,76 @@ +# Changelog + +All notable changes to the Apify Go client are documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [0.1.0] - 2026-06-18 + +Initial release of the official Go client for the Apify API, verified against OpenAPI +specification version `v2-2026-06-16T064758Z`. + +### Added + +- Resource-oriented `ApifyClient` mirroring the official JavaScript and Rust clients, with + accessors for Actors, Actor versions and environment variables, builds, runs, datasets, + key-value stores, request queues, tasks, schedules, webhooks, webhook dispatches, the + Apify Store, users, and logs. +- Replaceable HTTP transport via the `HTTPBackend` interface (default `DefaultHTTPBackend`), + configurable through `WithHTTPBackend`. +- Cross-cutting request behaviour applied to every call: bearer-token authentication, the + mandated `User-Agent` header, exponential-backoff-with-jitter retries (429 and 5xx and + network errors), and a growing-but-capped per-attempt timeout. +- Convenience helpers matching the reference clients: `Actor.Call`/`Task.Call` (start and + wait), `Build.WaitForFinish`/`Run.WaitForFinish`, `Actor.DefaultBuild`, + `Actor.ValidateInput`, `Run.Metamorph`/`Reboot`/`Resurrect`/`Charge`, + run-nested default storages (`Run.Dataset`/`KeyValueStore`/`RequestQueue`/`Log`), + lazy `Store.Iterate` and `RequestQueue.PaginateRequests` iterators, + dataset `DownloadItems`/`GetStatistics`/`CreateItemsPublicURL`, + key-value-store `GetRecords` (ZIP), record public URLs and key-list public URLs with + HMAC-SHA256 signing, request-queue lock lifecycle, and `ApifyClient.SetStatusMessage`. +- Public version constants `CLIENT_VERSION` and `API_SPEC_VERSION`. +- Forward-compatible models that capture unmodelled API fields in an `Extra` map. +- Offline unit tests (mock HTTP backend) covering retries, error parsing, 404→absent + mapping, the User-Agent format, base-URL resolution, and the storage-signature scheme. +- Integration test suite (one simple GET plus one CRUD flow per resource) and runnable, + CI-tested documentation examples. +- A language-specific GitHub Actions workflow that runs gofmt, go vet, build, unit tests and + integration tests, triggered by PRs to master touching Go code or manual dispatch. + +### Fixed + +- `RunClient.Charge` now always sends an `idempotency-key` header (auto-generated when not + supplied), so a transport-retried charge is applied at most once — matching the reference + client and preventing double-charging. +- `KeyValueStoreClient.GetRecord` now defaults `attachment=true`, matching the reference + client's record-fetch behaviour. + +### Changed + +- `RunClient.Charge` now takes a `RunChargeOptions{EventName, Count, IdempotencyKey}` struct. +- `RunClient.Metamorph` now takes a `MetamorphOptions{Build, ContentType}` struct. +- `RunResurrectOptions` gained `MaxItems`, `MaxTotalChargeUsd`, `RestartOnError` (all in the + spec and the reference client). +- `RunClient.GetWithWait` and `BuildClient.GetWithWait` expose the spec's `waitForFinish` + query parameter for a server-side synchronous fetch. +- `RunCollectionClient.List` `Status` filter accepts multiple statuses (`[]string`, + comma-separated), as the API allows. +- `RequestQueueClient.BatchAddRequests` auto-chunks inputs at the API's 25-per-call limit and + returns a typed `BatchAddResult{ProcessedRequests, UnprocessedRequests}`. +- `RequestQueueClient.ListRequests` validates its options (mutually-exclusive + `ExclusiveStartID`/`Cursor`; `Filter` restricted to `locked`/`pending`). +- Tasks use a dedicated `TaskStartOptions` that omits the Actor-only `contentType` and + `forcePermissionLevel` fields (which the task run endpoint does not accept). +- `LogClient` exposes the spec's `raw`/`download` options via `GetWithOptions`/ + `StreamWithOptions`, and `RunClient.GetStreamedLog` provides a raw live-stream convenience. + +### Notes + +- Intentionally unimplemented endpoints (matching the JavaScript reference scope): the + synchronous run endpoints (`run-sync`, `run-sync-get-dataset-items`), and the keyed-POST + record aliases. Only documented endpoints are implemented. +- `Dataset`/`KeyValueStore` `GetOrCreate` take only a name: this spec version's create + endpoints declare no request body or `schema` parameter, so a schema argument would be an + undocumented extension. The `runs/last` endpoints accept only `status` (no `origin`) in + this spec version. These choices favour strict OpenAPI compliance over the JS superset. diff --git a/README.md b/README.md index 21c00e0..74de277 100644 --- a/README.md +++ b/README.md @@ -1,1088 +1,185 @@ -# Go API client for apifyclient +# Apify API client for Go +The official, idiomatic Go client for the [Apify API](https://docs.apify.com/api/v2). -The Apify API (version 2) provides programmatic access to the [Apify -platform](https://docs.apify.com). The API is organized -around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) -HTTP endpoints. +It provides a resource-oriented interface that mirrors the official +[JavaScript](https://github.com/apify/apify-client-js) and Rust clients: start from an +`ApifyClient`, then drill down into resources (Actors, runs, datasets, key-value stores, +request queues, tasks, schedules, webhooks, the store, users and logs). -You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). +## Features -All requests and responses (including errors) are encoded in -[JSON](http://www.json.org/) format with UTF-8 encoding, -with a few exceptions that are explicitly described in the reference. - -- To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM -package](https://www.npmjs.com/package/apify-client). -- To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI -package](https://pypi.org/project/apify-client/). - -The clients' functions correspond to the API endpoints and have the same -parameters. This simplifies development of apps that depend on the Apify -platform. - -:::note Important Request Details - -- `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - -- Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. - -::: - -## Authentication -<span id=\"/introduction/authentication\"></span> - -**You can find your API token on the -[Integrations](https://console.apify.com/settings/integrations) page in the -Apify Console.** - -To use your token in a request, either: - -- Add the token to your request's `Authorization` header as `Bearer <token>`. -E.g., `Authorization: Bearer xxxxxxx`. -[More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). -(Recommended). -- Add it as the `token` parameter to your request URL. (Less secure). - -Using your token in the request header is more secure than using it as a URL -parameter because URLs are often stored -in browser history and server logs. This creates a chance for someone -unauthorized to access your API token. - -**Never share your API token or password with untrusted parties!** - -For more information, see our -[integrations](https://docs.apify.com/platform/integrations) documentation. - -### Agentic payments - -AI agents can authenticate and pay for Actor runs without an Apify account -using agentic payments. Instead of an API token, the request carries a -payment credential that both authorizes and pays for the call. Apify supports -the [x402 protocol](https://docs.apify.com/platform/integrations/x402) -(`PAYMENT-SIGNATURE` header) and -[Skyfire](https://docs.apify.com/platform/integrations/skyfire) -(`skyfire-pay-id` header). - -## Basic usage -<span id=\"/introduction/basic-usage\"></span> - -To run an Actor, send a POST request to the [Run -Actor](#/reference/actors/run-collection/run-actor) endpoint using either the -Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. -`janedoe~my-actor`): - -`https://api.apify.com/v2/actors/[actor_id]/runs` - -If the Actor is not runnable anonymously, you will receive a 401 or 403 -[response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). -This means you need to add your [secret API -token](https://console.apify.com/account#/integrations) to the request's -`Authorization` header ([recommended](#/introduction/authentication)) or as a -URL query parameter `?token=[your_token]` (less secure). - -Optionally, you can include the query parameters described in the [Run -Actor](#/reference/actors/run-collection/run-actor) section to customize your -run. - -If you're using Node.js, the best way to run an Actor is using the -`Apify.call()` method from the [Apify -SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It -runs the Actor using the account you are currently logged into (determined -by the [secret API token](https://console.apify.com/account#/integrations)). -The result is an [Actor run -object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if -any). - -A typical workflow is as follows: - -1. Run an Actor or task using the [Run -Actor](#/reference/actors/run-collection/run-actor) or [Run -task](#/reference/actor-tasks/run-collection/run-task) API endpoints. -2. Monitor the Actor run by periodically polling its progress using the [Get -run](#/reference/actor-runs/run-object-and-its-storages/get-run) API -endpoint. -3. Fetch the results from the [Get -items](#/reference/datasets/item-collection/get-items) API endpoint using the -`defaultDatasetId`, which you receive in the Run request response. -Additional data may be stored in a key-value store. You can fetch them from -the [Get record](#/reference/key-value-stores/record/get-record) API endpoint -using the `defaultKeyValueStoreId` and the store's `key`. - -**Note**: Instead of periodic polling, you can also run your -[Actor](#/reference/actors/run-actor-synchronously) or -[task](#/reference/actor-tasks/runs-collection/run-task-synchronously) -synchronously. This will ensure that the request waits for 300 seconds (5 -minutes) for the run to finish and returns its output. If the run takes -longer, the request will time out and throw an error. - -## Legacy `/v2/acts/` URL prefix -<span id=\"/introduction/legacy-acts-prefix\"></span> - -The `/v2/acts/` prefix is deprecated but still fully functional, and -such endpoint routes to the same handler as its `/v2/actors/...` counterpart. -New integrations should use the canonical /v2/actors/ prefix, -but existing clients keep working without changes. - -## Response structure -<span id=\"/introduction/response-structure\"></span> - -Most API endpoints return a JSON object with the `data` property: - -``` -{ - \"data\": { - ... - } -} -``` - -However, there are a few explicitly described exceptions, such as -[Get dataset items](#/reference/datasets/item-collection/get-items) or -Key-value store [Get record](#/reference/key-value-stores/record/get-record) -API endpoints, which return data in other formats. -In case of an error, the response has the HTTP status code in the range of -4xx or 5xx and the `data` property is replaced with `error`. For example: - -``` -{ - \"error\": { - \"type\": \"record-not-found\", - \"message\": \"Store was not found.\" - } -} -``` - -See [Errors](#/introduction/errors) for more details. - -## Pagination -<span id=\"/introduction/pagination\"></span> - -All API endpoints that return a list of records -(e.g. [Get list of -Actors](#/reference/actors/actor-collection/get-list-of-actors)) -enforce pagination in order to limit the size of their responses. - -Most of these API endpoints are paginated using the `offset` and `limit` -query parameters. -The only exception is [Get list of -keys](#/reference/key-value-stores/key-collection/get-list-of-keys), -which is paginated using the `exclusiveStartKey` query parameter. - -**IMPORTANT**: Each API endpoint that supports pagination enforces a certain -maximum value for the `limit` parameter, -in order to reduce the load on Apify servers. -The maximum limit could change in future so you should never -rely on a specific value and check the responses of these API endpoints. - -### Using offset -<span id=\"/introduction/pagination/using-offset\"></span> - -Most API endpoints that return a list of records enable pagination using the -following query parameters: - -<table> - <tr> - <td><code>limit</code></td> - <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> - </tr> - <tr> - <td><code>offset</code></td> - <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> - </tr> - <tr> - <td><code>desc</code></td> - <td> - By default, items are sorted in the order in which they were created or added to the list. - This feature is useful when fetching all the items, because it ensures that items - created after the client started the pagination will not be skipped. - If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, - i.e. from the newest to the oldest items. - </td> - </tr> -</table> - -The response of these API endpoints is always a JSON object with the -following structure: - -``` -{ - \"data\": { - \"total\": 2560, - \"offset\": 250, - \"limit\": 1000, - \"count\": 1000, - \"desc\": false, - \"items\": [ - { 1st object }, - { 2nd object }, - ... - { 1000th object } - ] - } -} -``` - -The following table describes the meaning of the response properties: - -<table> - <tr> - <th>Property</th> - <th>Description</th> - </tr> - <tr> - <td><code>total</code></td> - <td>The total number of items available in the list.</td> - </tr> - <tr> - <td><code>offset</code></td> - <td>The number of items that were skipped at the start. - This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> - </tr> - <tr> - <td><code>limit</code></td> - <td>The maximum number of items that can be returned in the HTTP response. - It equals to the <code>limit</code> query parameter if it was provided or - the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> - </tr> - <tr> - <td><code>count</code></td> - <td>The actual number of items returned in the HTTP response.</td> - </tr> - <tr> - <td><code>desc</code></td> - <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> - </tr> - <tr> - <td><code>items</code></td> - <td>An array of requested items.</td> - </tr> -</table> - -### Using key -<span id=\"/introduction/pagination/using-key\"></span> - -The records in the [key-value -store](https://docs.apify.com/platform/storage/key-value-store) -are not ordered based on numerical indexes, -but rather by their keys in the UTF-8 binary order. -Therefore the [Get list of -keys](#/reference/key-value-stores/key-collection/get-list-of-keys) -API endpoint only supports pagination using the following query parameters: - -<table> - <tr> - <td><code>limit</code></td> - <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> - </tr> - <tr> - <td><code>exclusiveStartKey</code></td> - <td>Skips all records with keys up to the given key including the given key, - in the UTF-8 binary order.</td> - </tr> -</table> - -The response of the API endpoint is always a JSON object with following -structure: - -``` -{ - \"data\": { - \"limit\": 1000, - \"isTruncated\": true, - \"exclusiveStartKey\": \"my-key\", - \"nextExclusiveStartKey\": \"some-other-key\", - \"items\": [ - { 1st object }, - { 2nd object }, - ... - { 1000th object } - ] - } -} -``` - -The following table describes the meaning of the response properties: - -<table> - <tr> - <th>Property</th> - <th>Description</th> - </tr> - <tr> - <td><code>limit</code></td> - <td>The maximum number of items that can be returned in the HTTP response. - It equals to the <code>limit</code> query parameter if it was provided or - the maximum limit enforced for the particular endpoint, whichever is smaller.</td> - </tr> - <tr> - <td><code>isTruncated</code></td> - <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> - </tr> - <tr> - <td><code>exclusiveStartKey</code></td> - <td>The last key that was skipped at the start. Is `null` for the first page.</td> - </tr> - <tr> - <td><code>nextExclusiveStartKey</code></td> - <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> - </tr> -</table> - -## Errors -<span id=\"/introduction/errors\"></span> - -The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` -range for errors caused by the caller -(invalid requests) and `5xx` range for server errors (these are rare). -Each error response contains a JSON object defining the `error` property, -which is an object with -the `type` and `message` properties that contain the error code and a -human-readable error description, respectively. - -For example: - -``` -{ - \"error\": { - \"type\": \"record-not-found\", - \"message\": \"Store was not found.\" - } -} -``` - -Here is the table of the most common errors that can occur for many API -endpoints: - -<table> - <tr> - <th>status</th> - <th>type</th> - <th>message</th> - </tr> - <tr> - <td><code>400</code></td> - <td><code>invalid-request</code></td> - <td>POST data must be a JSON object</td> - </tr> - <tr> - <td><code>400</code></td> - <td><code>invalid-value</code></td> - <td>Invalid value provided: Comments required</td> - </tr> - <tr> - <td><code>400</code></td> - <td><code>invalid-record-key</code></td> - <td>Record key contains invalid character</td> - </tr> - <tr> - <td><code>401</code></td> - <td><code>token-not-provided</code></td> - <td>Authentication token was not provided</td> - </tr> - <tr> - <td><code>404</code></td> - <td><code>record-not-found</code></td> - <td>Store was not found</td> - </tr> - <tr> - <td><code>429</code></td> - <td><code>rate-limit-exceeded</code></td> - <td>You have exceeded the rate limit of ... requests per second</td> - </tr> - <tr> - <td><code>405</code></td> - <td><code>method-not-allowed</code></td> - <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> - </tr> -</table> - -## Rate limiting -<span id=\"/introduction/rate-limiting\"></span> - -All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. - -There are two kinds of rate limits - a global rate limit and a per-resource rate limit. - -### Global rate limit -<span id=\"/introduction/rate-limiting/global-rate-limit\"></span> - -The global rate limit is set to _250 000 requests per minute_. -For [authenticated](#/introduction/authentication) requests, it is counted per user, -and for unauthenticated requests, it is counted per IP address. - -### Per-resource rate limit -<span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> - -The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. -The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. -Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. - -These endpoints have a rate limit of _200 requests per second per resource_: - -* CRUD ([get](#/reference/key-value-stores/record/get-record), - [put](#/reference/key-value-stores/record/put-record), - [delete](#/reference/key-value-stores/record/delete-record)) - operations on key-value store records - -These endpoints have a rate limit of _400 requests per second per resource_: -* [Run Actor](#/reference/actors/run-collection/run-actor) -* [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) -* [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) -* [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) -* [Push items](#/reference/datasets/item-collection/put-items) to dataset -* CRUD - ([add](#/reference/request-queues/request-collection/add-request), - [get](#/reference/request-queues/request-collection/get-request), - [update](#/reference/request-queues/request-collection/update-request), - [delete](#/reference/request-queues/request-collection/delete-request)) - operations on requests in request queues - -### Rate limit exceeded errors -<span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> - -If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` -and the following body: - -``` -{ - \"error\": { - \"type\": \"rate-limit-exceeded\", - \"message\": \"You have exceeded the rate limit of ... requests per second\" - } -} -``` - -### Retrying rate-limited requests with exponential backoff -<span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> - -If the client receives the rate limit error, it should wait a certain period of time and then retry the request. -If the error happens again, the client should double the wait period and retry the request, -and so on. This algorithm is known as _exponential backoff_ -and it can be described using the following pseudo-code: - -1. Define a variable `DELAY=500` -2. Send the HTTP request to the API endpoint -3. If the response has status code not equal to `429` then you are done. Otherwise: - * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds - * Double the future wait period by setting `DELAY = 2*DELAY` - * Continue with step 2 - -If all requests sent by the client implement the above steps, -the client will automatically use the maximum available bandwidth for its requests. - -Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) -and [for Python](https://docs.apify.com/api/client/python) -use the exponential backoff algorithm transparently, so that you do not need to worry about it. - -## Referring to resources -<span id=\"/introduction/referring-to-resources\"></span> - -There are three main ways to refer to a resource you're accessing via API. - -- the resource ID (e.g. `iKkPcIgVvwmztduf8`) -- `username~resourcename` - when using this access method, you will need to -use your API token, and access will only work if you have the correct -permissions. -- `~resourcename` - for this, you need to use an API token, and the -`resourcename` refers to a resource in the API token owner's account. - - -## Overview -This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client. - -- API version: v2-2026-06-16T064758Z -- Package version: 1.0.0 -- Generator version: 7.23.0 -- Build package: org.openapitools.codegen.languages.GoClientCodegen +- Resource-oriented API surface consistent with the reference clients. +- Transparent authentication, `User-Agent` header, retries with exponential backoff, and + per-request timeouts applied to every call. +- Replaceable HTTP transport (the `HTTPBackend` interface) with a default implementation. +- Convenience helpers: start-and-wait, build/run polling, lazy store and request-queue + iterators, dataset export, signed public URLs, request-queue locking, and more. +- Forward-compatible models that keep unknown API fields in an `Extra` map. +- Zero third-party dependencies (standard library only). ## Installation -Import the package in a go file in your project and run `go mod tidy`: - -```go -import apifyclient "github.com/apify/apify-client-go" -``` - -To use a proxy, set the environment variable `HTTP_PROXY`: - -```go -os.Setenv("HTTP_PROXY", "http://proxy_name:proxy_port") +```sh +go get github.com/apify/apify-client-go ``` -## Configuration of Server URL - -Default configuration comes with `Servers` field that contains server objects as defined in the OpenAPI specification. +Requires Go 1.23 or newer. -### Select Server Configuration - -For using other server than the one defined on index 0 set context value `apifyclient.ContextServerIndex` of type `int`. +## Quick start ```go -ctx := context.WithValue(context.Background(), apifyclient.ContextServerIndex, 1) +package main + +import ( + "context" + "fmt" + "log" + + apify "github.com/apify/apify-client-go" +) + +func main() { + client := apify.NewClient("my-api-token") + ctx := context.Background() + + // Start an Actor and wait for it to finish. + waitSecs := int64(120) + run, err := client.Actor("apify/hello-world").Call(ctx, nil, apify.ActorStartOptions{}, &waitSecs) + if err != nil { + log.Fatal(err) + } + + // Read items from the run's default dataset. + page, err := client.Dataset(run.DefaultDatasetID).ListItems(ctx, apify.DatasetListItemsOptions{}) + if err != nil { + log.Fatal(err) + } + fmt.Printf("Got %d items\n", page.Count) +} ``` -### Templated Server URL +## Configuration -Templated server URL is formatted using default variables from configuration or from context value `apifyclient.ContextServerVariables` of type `map[string]string`. +Use `NewClient(token)` for a token-only setup, or `NewClientWithOptions` with functional +options for full control: ```go -ctx := context.WithValue(context.Background(), apifyclient.ContextServerVariables, map[string]string{ - "basePath": "v2", -}) -``` - -Note, enum values are always validated and all unused variables are silently ignored. - -### URLs Configuration per Operation - -Each operation can use different server URL defined using `OperationServers` map in the `Configuration`. -An operation is uniquely identified by `"{classname}Service.{nickname}"` string. -Similar rules for overriding default operation server index and variables applies by using `apifyclient.ContextOperationServerIndices` and `apifyclient.ContextOperationServerVariables` context maps. +client := apify.NewClientWithOptions( + apify.WithToken("my-api-token"), + apify.WithBaseURL("https://api.apify.com"), // /v2 is appended automatically + apify.WithMaxRetries(8), // default 8 + apify.WithMinDelayBetweenRetries(500*time.Millisecond), + apify.WithTimeout(360*time.Second), // default 6 minutes + apify.WithUserAgentSuffix("MyTool/1.0"), + apify.WithHTTPBackend(apify.NewDefaultHTTPBackend()), +) +``` + +| Option | Default | Description | +| --- | --- | --- | +| `WithToken` | — | API token, sent as a `Bearer` token. | +| `WithBaseURL` | `https://api.apify.com` | API base URL; `/v2` is appended automatically. | +| `WithPublicBaseURL` | API base URL | Base URL used for building public, shareable URLs. | +| `WithMaxRetries` | `8` | Maximum retries for failed requests. | +| `WithMinDelayBetweenRetries` | `500ms` | Minimum delay between retries (doubled each retry). | +| `WithTimeout` | `360s` | Overall per-request timeout. | +| `WithUserAgentSuffix` | — | Suffix appended to the `User-Agent` header. | +| `WithHTTPBackend` | `DefaultHTTPBackend` | Replaceable HTTP transport. | + +## Resource clients + +| Accessor | Returns | Purpose | +| --- | --- | --- | +| `client.Actors()` / `client.Actor(id)` | `*ActorCollectionClient` / `*ActorClient` | List/create Actors; manage a single Actor and its runs, builds, versions, webhooks. | +| `client.Builds()` / `client.Build(id)` | `*BuildCollectionClient` / `*BuildClient` | List builds; inspect, abort, wait for, and read a build's log/OpenAPI. | +| `client.Runs()` / `client.Run(id)` | `*RunCollectionClient` / `*RunClient` | List runs; manage a run, its default storages, and its log. | +| `client.Datasets()` / `client.Dataset(id)` | `*DatasetCollectionClient` / `*DatasetClient` | List/get-or-create datasets; read/write/export items. | +| `client.KeyValueStores()` / `client.KeyValueStore(id)` | `*KeyValueStoreCollectionClient` / `*KeyValueStoreClient` | List/get-or-create stores; read/write records and keys. | +| `client.RequestQueues()` / `client.RequestQueue(id)` | `*RequestQueueCollectionClient` / `*RequestQueueClient` | List/get-or-create queues; add/list/lock requests. | +| `client.Tasks()` / `client.Task(id)` | `*TaskCollectionClient` / `*TaskClient` | List/create tasks; manage a task, its input and runs. | +| `client.Schedules()` / `client.Schedule(id)` | `*ScheduleCollectionClient` / `*ScheduleClient` | List/create schedules; manage a single schedule. | +| `client.Webhooks()` / `client.Webhook(id)` | `*WebhookCollectionClient` / `*WebhookClient` | List/create webhooks; manage and test a single webhook. | +| `client.WebhookDispatches()` / `client.WebhookDispatch(id)` | `*WebhookDispatchCollectionClient` / `*WebhookDispatchClient` | List/inspect webhook dispatches. | +| `client.Store()` | `*StoreCollectionClient` | Browse and iterate the Apify Store. | +| `client.Me()` / `client.User(id)` | `*UserClient` | Account details, usage and limits (account scope for `Me()`). | +| `client.Log(buildOrRunID)` | `*LogClient` | Read or stream a build/run log. | + +## Error handling + +API errors are returned as `*APIError`, with the HTTP status, error type, message, attempt +count, and request method/path. `get`/`delete` on a missing resource is *not* an error: the +methods report absence via a boolean (`ok`) instead. ```go -ctx := context.WithValue(context.Background(), apifyclient.ContextOperationServerIndices, map[string]int{ - "{classname}Service.{nickname}": 2, -}) -ctx = context.WithValue(context.Background(), apifyclient.ContextOperationServerVariables, map[string]map[string]string{ - "{classname}Service.{nickname}": { - "port": "8443", - }, -}) +user, ok, err := client.Me().Get(ctx) +if err != nil { + if apiErr, isAPI := apify.AsAPIError(err); isAPI { + fmt.Printf("API error %d (%s): %s\n", apiErr.StatusCode, apiErr.Type, apiErr.Message) + } + log.Fatal(err) +} +if !ok { + log.Fatal("user not found") +} ``` -## Documentation for API Endpoints - -All URIs are relative to *https://api.apify.com* - -Class | Method | HTTP request | Description ------------- | ------------- | ------------- | ------------- -*ActorBuildsAPI* | [**ActorBuildAbortPost**](docs/ActorBuildsAPI.md#actorbuildabortpost) | **Post** /v2/actor-builds/{buildId}/abort | Abort build -*ActorBuildsAPI* | [**ActorBuildDelete**](docs/ActorBuildsAPI.md#actorbuilddelete) | **Delete** /v2/actor-builds/{buildId} | Delete build -*ActorBuildsAPI* | [**ActorBuildGet**](docs/ActorBuildsAPI.md#actorbuildget) | **Get** /v2/actor-builds/{buildId} | Get build -*ActorBuildsAPI* | [**ActorBuildLogGet**](docs/ActorBuildsAPI.md#actorbuildlogget) | **Get** /v2/actor-builds/{buildId}/log | Get build's Log -*ActorBuildsAPI* | [**ActorBuildOpenapiJsonGet**](docs/ActorBuildsAPI.md#actorbuildopenapijsonget) | **Get** /v2/actor-builds/{buildId}/openapi.json | Get OpenAPI definition -*ActorBuildsAPI* | [**ActorBuildsGet**](docs/ActorBuildsAPI.md#actorbuildsget) | **Get** /v2/actor-builds | Get user builds list -*ActorRunsAPI* | [**ActorRunAbortPost**](docs/ActorRunsAPI.md#actorrunabortpost) | **Post** /v2/actor-runs/{runId}/abort | Abort run -*ActorRunsAPI* | [**ActorRunDelete**](docs/ActorRunsAPI.md#actorrundelete) | **Delete** /v2/actor-runs/{runId} | Delete run -*ActorRunsAPI* | [**ActorRunGet**](docs/ActorRunsAPI.md#actorrunget) | **Get** /v2/actor-runs/{runId} | Get run -*ActorRunsAPI* | [**ActorRunLogGet**](docs/ActorRunsAPI.md#actorrunlogget) | **Get** /v2/actor-runs/{runId}/log | Get run's log -*ActorRunsAPI* | [**ActorRunMetamorphPost**](docs/ActorRunsAPI.md#actorrunmetamorphpost) | **Post** /v2/actor-runs/{runId}/metamorph | Metamorph run -*ActorRunsAPI* | [**ActorRunPut**](docs/ActorRunsAPI.md#actorrunput) | **Put** /v2/actor-runs/{runId} | Update run -*ActorRunsAPI* | [**ActorRunRebootPost**](docs/ActorRunsAPI.md#actorrunrebootpost) | **Post** /v2/actor-runs/{runId}/reboot | Reboot run -*ActorRunsAPI* | [**ActorRunsGet**](docs/ActorRunsAPI.md#actorrunsget) | **Get** /v2/actor-runs | Get user runs list -*ActorRunsAPI* | [**PostChargeRun**](docs/ActorRunsAPI.md#postchargerun) | **Post** /v2/actor-runs/{runId}/charge | Charge events in run -*ActorRunsAPI* | [**PostResurrectRun**](docs/ActorRunsAPI.md#postresurrectrun) | **Post** /v2/actor-runs/{runId}/resurrect | Resurrect run -*ActorTasksAPI* | [**ActorTaskDelete**](docs/ActorTasksAPI.md#actortaskdelete) | **Delete** /v2/actor-tasks/{actorTaskId} | Delete task -*ActorTasksAPI* | [**ActorTaskGet**](docs/ActorTasksAPI.md#actortaskget) | **Get** /v2/actor-tasks/{actorTaskId} | Get task -*ActorTasksAPI* | [**ActorTaskInputGet**](docs/ActorTasksAPI.md#actortaskinputget) | **Get** /v2/actor-tasks/{actorTaskId}/input | Get task input -*ActorTasksAPI* | [**ActorTaskInputPut**](docs/ActorTasksAPI.md#actortaskinputput) | **Put** /v2/actor-tasks/{actorTaskId}/input | Update task input -*ActorTasksAPI* | [**ActorTaskPut**](docs/ActorTasksAPI.md#actortaskput) | **Put** /v2/actor-tasks/{actorTaskId} | Update task -*ActorTasksAPI* | [**ActorTaskRunSyncGet**](docs/ActorTasksAPI.md#actortaskrunsyncget) | **Get** /v2/actor-tasks/{actorTaskId}/run-sync | Run task synchronously -*ActorTasksAPI* | [**ActorTaskRunSyncGetDatasetItemsGet**](docs/ActorTasksAPI.md#actortaskrunsyncgetdatasetitemsget) | **Get** /v2/actor-tasks/{actorTaskId}/run-sync-get-dataset-items | Run task synchronously and get dataset items -*ActorTasksAPI* | [**ActorTaskRunSyncGetDatasetItemsPost**](docs/ActorTasksAPI.md#actortaskrunsyncgetdatasetitemspost) | **Post** /v2/actor-tasks/{actorTaskId}/run-sync-get-dataset-items | Run task synchronously and get dataset items -*ActorTasksAPI* | [**ActorTaskRunSyncPost**](docs/ActorTasksAPI.md#actortaskrunsyncpost) | **Post** /v2/actor-tasks/{actorTaskId}/run-sync | Run task synchronously -*ActorTasksAPI* | [**ActorTaskRunsGet**](docs/ActorTasksAPI.md#actortaskrunsget) | **Get** /v2/actor-tasks/{actorTaskId}/runs | Get list of task runs -*ActorTasksAPI* | [**ActorTaskRunsLastGet**](docs/ActorTasksAPI.md#actortaskrunslastget) | **Get** /v2/actor-tasks/{actorTaskId}/runs/last | Get last run -*ActorTasksAPI* | [**ActorTaskRunsPost**](docs/ActorTasksAPI.md#actortaskrunspost) | **Post** /v2/actor-tasks/{actorTaskId}/runs | Run task -*ActorTasksAPI* | [**ActorTaskWebhooksGet**](docs/ActorTasksAPI.md#actortaskwebhooksget) | **Get** /v2/actor-tasks/{actorTaskId}/webhooks | Get list of webhooks -*ActorTasksAPI* | [**ActorTasksGet**](docs/ActorTasksAPI.md#actortasksget) | **Get** /v2/actor-tasks | Get list of tasks -*ActorTasksAPI* | [**ActorTasksPost**](docs/ActorTasksAPI.md#actortaskspost) | **Post** /v2/actor-tasks | Create task -*ActorsAPI* | [**ActDelete**](docs/ActorsAPI.md#actdelete) | **Delete** /v2/actors/{actorId} | Delete Actor -*ActorsAPI* | [**ActGet**](docs/ActorsAPI.md#actget) | **Get** /v2/actors/{actorId} | Get Actor -*ActorsAPI* | [**ActPut**](docs/ActorsAPI.md#actput) | **Put** /v2/actors/{actorId} | Update Actor -*ActorsAPI* | [**ActValidateInputPost**](docs/ActorsAPI.md#actvalidateinputpost) | **Post** /v2/actors/{actorId}/validate-input | Validate Actor input -*ActorsAPI* | [**ActsGet**](docs/ActorsAPI.md#actsget) | **Get** /v2/actors | Get list of Actors -*ActorsAPI* | [**ActsPost**](docs/ActorsAPI.md#actspost) | **Post** /v2/actors | Create Actor -*ActorsActorBuildsAPI* | [**ActBuildAbortPost**](docs/ActorsActorBuildsAPI.md#actbuildabortpost) | **Post** /v2/actors/{actorId}/builds/{buildId}/abort | Abort build -*ActorsActorBuildsAPI* | [**ActBuildDefaultGet**](docs/ActorsActorBuildsAPI.md#actbuilddefaultget) | **Get** /v2/actors/{actorId}/builds/default | Get default build -*ActorsActorBuildsAPI* | [**ActBuildGet**](docs/ActorsActorBuildsAPI.md#actbuildget) | **Get** /v2/actors/{actorId}/builds/{buildId} | Get build -*ActorsActorBuildsAPI* | [**ActBuildsGet**](docs/ActorsActorBuildsAPI.md#actbuildsget) | **Get** /v2/actors/{actorId}/builds | Get list of builds -*ActorsActorBuildsAPI* | [**ActBuildsPost**](docs/ActorsActorBuildsAPI.md#actbuildspost) | **Post** /v2/actors/{actorId}/builds | Build Actor -*ActorsActorBuildsAPI* | [**ActOpenapiJsonGet**](docs/ActorsActorBuildsAPI.md#actopenapijsonget) | **Get** /v2/actors/{actorId}/builds/{buildId}/openapi.json | Get OpenAPI definition -*ActorsActorRunsAPI* | [**ActRunAbortPost**](docs/ActorsActorRunsAPI.md#actrunabortpost) | **Post** /v2/actors/{actorId}/runs/{runId}/abort | Abort run -*ActorsActorRunsAPI* | [**ActRunGet**](docs/ActorsActorRunsAPI.md#actrunget) | **Get** /v2/actors/{actorId}/runs/{runId} | Get run -*ActorsActorRunsAPI* | [**ActRunMetamorphPost**](docs/ActorsActorRunsAPI.md#actrunmetamorphpost) | **Post** /v2/actors/{actorId}/runs/{runId}/metamorph | Metamorph run -*ActorsActorRunsAPI* | [**ActRunResurrectPost**](docs/ActorsActorRunsAPI.md#actrunresurrectpost) | **Post** /v2/actors/{actorId}/runs/{runId}/resurrect | Resurrect run -*ActorsActorRunsAPI* | [**ActRunSyncGet**](docs/ActorsActorRunsAPI.md#actrunsyncget) | **Get** /v2/actors/{actorId}/run-sync | Run Actor synchronously without input -*ActorsActorRunsAPI* | [**ActRunSyncGetDatasetItemsGet**](docs/ActorsActorRunsAPI.md#actrunsyncgetdatasetitemsget) | **Get** /v2/actors/{actorId}/run-sync-get-dataset-items | Run Actor synchronously without input and get dataset items -*ActorsActorRunsAPI* | [**ActRunSyncGetDatasetItemsPost**](docs/ActorsActorRunsAPI.md#actrunsyncgetdatasetitemspost) | **Post** /v2/actors/{actorId}/run-sync-get-dataset-items | Run Actor synchronously and get dataset items -*ActorsActorRunsAPI* | [**ActRunSyncPost**](docs/ActorsActorRunsAPI.md#actrunsyncpost) | **Post** /v2/actors/{actorId}/run-sync | Run Actor synchronously and return output -*ActorsActorRunsAPI* | [**ActRunsGet**](docs/ActorsActorRunsAPI.md#actrunsget) | **Get** /v2/actors/{actorId}/runs | Get list of runs -*ActorsActorRunsAPI* | [**ActRunsLastGet**](docs/ActorsActorRunsAPI.md#actrunslastget) | **Get** /v2/actors/{actorId}/runs/last | Get last run -*ActorsActorRunsAPI* | [**ActRunsPost**](docs/ActorsActorRunsAPI.md#actrunspost) | **Post** /v2/actors/{actorId}/runs | Run Actor -*ActorsActorVersionsAPI* | [**ActVersionDelete**](docs/ActorsActorVersionsAPI.md#actversiondelete) | **Delete** /v2/actors/{actorId}/versions/{versionNumber} | Delete version -*ActorsActorVersionsAPI* | [**ActVersionEnvVarDelete**](docs/ActorsActorVersionsAPI.md#actversionenvvardelete) | **Delete** /v2/actors/{actorId}/versions/{versionNumber}/env-vars/{envVarName} | Delete environment variable -*ActorsActorVersionsAPI* | [**ActVersionEnvVarGet**](docs/ActorsActorVersionsAPI.md#actversionenvvarget) | **Get** /v2/actors/{actorId}/versions/{versionNumber}/env-vars/{envVarName} | Get environment variable -*ActorsActorVersionsAPI* | [**ActVersionEnvVarPost**](docs/ActorsActorVersionsAPI.md#actversionenvvarpost) | **Post** /v2/actors/{actorId}/versions/{versionNumber}/env-vars/{envVarName} | Update environment variable (POST) -*ActorsActorVersionsAPI* | [**ActVersionEnvVarPut**](docs/ActorsActorVersionsAPI.md#actversionenvvarput) | **Put** /v2/actors/{actorId}/versions/{versionNumber}/env-vars/{envVarName} | Update environment variable -*ActorsActorVersionsAPI* | [**ActVersionEnvVarsGet**](docs/ActorsActorVersionsAPI.md#actversionenvvarsget) | **Get** /v2/actors/{actorId}/versions/{versionNumber}/env-vars | Get list of environment variables -*ActorsActorVersionsAPI* | [**ActVersionEnvVarsPost**](docs/ActorsActorVersionsAPI.md#actversionenvvarspost) | **Post** /v2/actors/{actorId}/versions/{versionNumber}/env-vars | Create environment variable -*ActorsActorVersionsAPI* | [**ActVersionGet**](docs/ActorsActorVersionsAPI.md#actversionget) | **Get** /v2/actors/{actorId}/versions/{versionNumber} | Get version -*ActorsActorVersionsAPI* | [**ActVersionPost**](docs/ActorsActorVersionsAPI.md#actversionpost) | **Post** /v2/actors/{actorId}/versions/{versionNumber} | Update version (POST) -*ActorsActorVersionsAPI* | [**ActVersionPut**](docs/ActorsActorVersionsAPI.md#actversionput) | **Put** /v2/actors/{actorId}/versions/{versionNumber} | Update version -*ActorsActorVersionsAPI* | [**ActVersionsGet**](docs/ActorsActorVersionsAPI.md#actversionsget) | **Get** /v2/actors/{actorId}/versions | Get list of versions -*ActorsActorVersionsAPI* | [**ActVersionsPost**](docs/ActorsActorVersionsAPI.md#actversionspost) | **Post** /v2/actors/{actorId}/versions | Create version -*ActorsWebhookCollectionAPI* | [**ActWebhooksGet**](docs/ActorsWebhookCollectionAPI.md#actwebhooksget) | **Get** /v2/actors/{actorId}/webhooks | Get list of webhooks -*DefaultDatasetAPI* | [**ActorRunDatasetDelete**](docs/DefaultDatasetAPI.md#actorrundatasetdelete) | **Delete** /v2/actor-runs/{runId}/dataset | Delete default dataset -*DefaultDatasetAPI* | [**ActorRunDatasetGet**](docs/DefaultDatasetAPI.md#actorrundatasetget) | **Get** /v2/actor-runs/{runId}/dataset | Get default dataset -*DefaultDatasetAPI* | [**ActorRunDatasetItemsGet**](docs/DefaultDatasetAPI.md#actorrundatasetitemsget) | **Get** /v2/actor-runs/{runId}/dataset/items | Get default dataset items -*DefaultDatasetAPI* | [**ActorRunDatasetItemsPost**](docs/DefaultDatasetAPI.md#actorrundatasetitemspost) | **Post** /v2/actor-runs/{runId}/dataset/items | Store items -*DefaultDatasetAPI* | [**ActorRunDatasetPut**](docs/DefaultDatasetAPI.md#actorrundatasetput) | **Put** /v2/actor-runs/{runId}/dataset | Update default dataset -*DefaultDatasetAPI* | [**ActorRunDatasetStatisticsGet**](docs/DefaultDatasetAPI.md#actorrundatasetstatisticsget) | **Get** /v2/actor-runs/{runId}/dataset/statistics | Get default dataset statistics -*DefaultKeyValueStoreAPI* | [**ActorRunKeyValueStoreDelete**](docs/DefaultKeyValueStoreAPI.md#actorrunkeyvaluestoredelete) | **Delete** /v2/actor-runs/{runId}/key-value-store | Delete default store -*DefaultKeyValueStoreAPI* | [**ActorRunKeyValueStoreGet**](docs/DefaultKeyValueStoreAPI.md#actorrunkeyvaluestoreget) | **Get** /v2/actor-runs/{runId}/key-value-store | Get default store -*DefaultKeyValueStoreAPI* | [**ActorRunKeyValueStoreKeysGet**](docs/DefaultKeyValueStoreAPI.md#actorrunkeyvaluestorekeysget) | **Get** /v2/actor-runs/{runId}/key-value-store/keys | Get default store's list of keys -*DefaultKeyValueStoreAPI* | [**ActorRunKeyValueStorePut**](docs/DefaultKeyValueStoreAPI.md#actorrunkeyvaluestoreput) | **Put** /v2/actor-runs/{runId}/key-value-store | Update default store -*DefaultKeyValueStoreAPI* | [**ActorRunKeyValueStoreRecordDelete**](docs/DefaultKeyValueStoreAPI.md#actorrunkeyvaluestorerecorddelete) | **Delete** /v2/actor-runs/{runId}/key-value-store/records/{recordKey} | Delete default store's record -*DefaultKeyValueStoreAPI* | [**ActorRunKeyValueStoreRecordGet**](docs/DefaultKeyValueStoreAPI.md#actorrunkeyvaluestorerecordget) | **Get** /v2/actor-runs/{runId}/key-value-store/records/{recordKey} | Get default store's record -*DefaultKeyValueStoreAPI* | [**ActorRunKeyValueStoreRecordPost**](docs/DefaultKeyValueStoreAPI.md#actorrunkeyvaluestorerecordpost) | **Post** /v2/actor-runs/{runId}/key-value-store/records/{recordKey} | Store record in default store (POST) -*DefaultKeyValueStoreAPI* | [**ActorRunKeyValueStoreRecordPut**](docs/DefaultKeyValueStoreAPI.md#actorrunkeyvaluestorerecordput) | **Put** /v2/actor-runs/{runId}/key-value-store/records/{recordKey} | Store record in default store -*DefaultKeyValueStoreAPI* | [**ActorRunKeyValueStoreRecordsGet**](docs/DefaultKeyValueStoreAPI.md#actorrunkeyvaluestorerecordsget) | **Get** /v2/actor-runs/{runId}/key-value-store/records | Download default store's records -*DefaultRequestQueueAPI* | [**ActorRunRequestQueueDelete**](docs/DefaultRequestQueueAPI.md#actorrunrequestqueuedelete) | **Delete** /v2/actor-runs/{runId}/request-queue | Delete default request queue -*DefaultRequestQueueAPI* | [**ActorRunRequestQueueGet**](docs/DefaultRequestQueueAPI.md#actorrunrequestqueueget) | **Get** /v2/actor-runs/{runId}/request-queue | Get default request queue -*DefaultRequestQueueAPI* | [**ActorRunRequestQueueHeadGet**](docs/DefaultRequestQueueAPI.md#actorrunrequestqueueheadget) | **Get** /v2/actor-runs/{runId}/request-queue/head | Get default request queue head -*DefaultRequestQueueAPI* | [**ActorRunRequestQueueHeadLockPost**](docs/DefaultRequestQueueAPI.md#actorrunrequestqueueheadlockpost) | **Post** /v2/actor-runs/{runId}/request-queue/head/lock | Get and lock default request queue head -*DefaultRequestQueueAPI* | [**ActorRunRequestQueuePut**](docs/DefaultRequestQueueAPI.md#actorrunrequestqueueput) | **Put** /v2/actor-runs/{runId}/request-queue | Update default request queue -*DefaultRequestQueueAPI* | [**ActorRunRequestQueueRequestDelete**](docs/DefaultRequestQueueAPI.md#actorrunrequestqueuerequestdelete) | **Delete** /v2/actor-runs/{runId}/request-queue/requests/{requestId} | Delete request from default request queue -*DefaultRequestQueueAPI* | [**ActorRunRequestQueueRequestGet**](docs/DefaultRequestQueueAPI.md#actorrunrequestqueuerequestget) | **Get** /v2/actor-runs/{runId}/request-queue/requests/{requestId} | Get request from default request queue -*DefaultRequestQueueAPI* | [**ActorRunRequestQueueRequestLockDelete**](docs/DefaultRequestQueueAPI.md#actorrunrequestqueuerequestlockdelete) | **Delete** /v2/actor-runs/{runId}/request-queue/requests/{requestId}/lock | Delete lock on request in default request queue -*DefaultRequestQueueAPI* | [**ActorRunRequestQueueRequestLockPut**](docs/DefaultRequestQueueAPI.md#actorrunrequestqueuerequestlockput) | **Put** /v2/actor-runs/{runId}/request-queue/requests/{requestId}/lock | Prolong lock on request in default request queue -*DefaultRequestQueueAPI* | [**ActorRunRequestQueueRequestPut**](docs/DefaultRequestQueueAPI.md#actorrunrequestqueuerequestput) | **Put** /v2/actor-runs/{runId}/request-queue/requests/{requestId} | Update request in default request queue -*DefaultRequestQueueAPI* | [**ActorRunRequestQueueRequestsBatchDelete**](docs/DefaultRequestQueueAPI.md#actorrunrequestqueuerequestsbatchdelete) | **Delete** /v2/actor-runs/{runId}/request-queue/requests/batch | Batch delete requests from default request queue -*DefaultRequestQueueAPI* | [**ActorRunRequestQueueRequestsBatchPost**](docs/DefaultRequestQueueAPI.md#actorrunrequestqueuerequestsbatchpost) | **Post** /v2/actor-runs/{runId}/request-queue/requests/batch | Batch add requests to default request queue -*DefaultRequestQueueAPI* | [**ActorRunRequestQueueRequestsGet**](docs/DefaultRequestQueueAPI.md#actorrunrequestqueuerequestsget) | **Get** /v2/actor-runs/{runId}/request-queue/requests | List default request queue's requests -*DefaultRequestQueueAPI* | [**ActorRunRequestQueueRequestsPost**](docs/DefaultRequestQueueAPI.md#actorrunrequestqueuerequestspost) | **Post** /v2/actor-runs/{runId}/request-queue/requests | Add request to default request queue -*DefaultRequestQueueAPI* | [**ActorRunRequestQueueRequestsUnlockPost**](docs/DefaultRequestQueueAPI.md#actorrunrequestqueuerequestsunlockpost) | **Post** /v2/actor-runs/{runId}/request-queue/requests/unlock | Unlock requests in default request queue -*LastActorRunsAbortAPI* | [**ActRunsLastAbortPost**](docs/LastActorRunsAbortAPI.md#actrunslastabortpost) | **Post** /v2/actors/{actorId}/runs/last/abort | Abort Actor's last run -*LastActorRunsDefaultDatasetAPI* | [**ActRunsLastDatasetDelete**](docs/LastActorRunsDefaultDatasetAPI.md#actrunslastdatasetdelete) | **Delete** /v2/actors/{actorId}/runs/last/dataset | Delete last run's default dataset -*LastActorRunsDefaultDatasetAPI* | [**ActRunsLastDatasetGet**](docs/LastActorRunsDefaultDatasetAPI.md#actrunslastdatasetget) | **Get** /v2/actors/{actorId}/runs/last/dataset | Get last run's default dataset -*LastActorRunsDefaultDatasetAPI* | [**ActRunsLastDatasetItemsGet**](docs/LastActorRunsDefaultDatasetAPI.md#actrunslastdatasetitemsget) | **Get** /v2/actors/{actorId}/runs/last/dataset/items | Get last run's dataset items -*LastActorRunsDefaultDatasetAPI* | [**ActRunsLastDatasetItemsPost**](docs/LastActorRunsDefaultDatasetAPI.md#actrunslastdatasetitemspost) | **Post** /v2/actors/{actorId}/runs/last/dataset/items | Store items in last run's dataset -*LastActorRunsDefaultDatasetAPI* | [**ActRunsLastDatasetPut**](docs/LastActorRunsDefaultDatasetAPI.md#actrunslastdatasetput) | **Put** /v2/actors/{actorId}/runs/last/dataset | Update last run's default dataset -*LastActorRunsDefaultDatasetAPI* | [**ActRunsLastDatasetStatisticsGet**](docs/LastActorRunsDefaultDatasetAPI.md#actrunslastdatasetstatisticsget) | **Get** /v2/actors/{actorId}/runs/last/dataset/statistics | Get last run's dataset statistics -*LastActorRunsDefaultKeyValueStoreAPI* | [**ActRunsLastKeyValueStoreDelete**](docs/LastActorRunsDefaultKeyValueStoreAPI.md#actrunslastkeyvaluestoredelete) | **Delete** /v2/actors/{actorId}/runs/last/key-value-store | Delete last run's default store -*LastActorRunsDefaultKeyValueStoreAPI* | [**ActRunsLastKeyValueStoreGet**](docs/LastActorRunsDefaultKeyValueStoreAPI.md#actrunslastkeyvaluestoreget) | **Get** /v2/actors/{actorId}/runs/last/key-value-store | Get last run's default store -*LastActorRunsDefaultKeyValueStoreAPI* | [**ActRunsLastKeyValueStoreKeysGet**](docs/LastActorRunsDefaultKeyValueStoreAPI.md#actrunslastkeyvaluestorekeysget) | **Get** /v2/actors/{actorId}/runs/last/key-value-store/keys | Get last run's default store's list of keys -*LastActorRunsDefaultKeyValueStoreAPI* | [**ActRunsLastKeyValueStorePut**](docs/LastActorRunsDefaultKeyValueStoreAPI.md#actrunslastkeyvaluestoreput) | **Put** /v2/actors/{actorId}/runs/last/key-value-store | Update last run's default store -*LastActorRunsDefaultKeyValueStoreAPI* | [**ActRunsLastKeyValueStoreRecordDelete**](docs/LastActorRunsDefaultKeyValueStoreAPI.md#actrunslastkeyvaluestorerecorddelete) | **Delete** /v2/actors/{actorId}/runs/last/key-value-store/records/{recordKey} | Delete last run's default store's record -*LastActorRunsDefaultKeyValueStoreAPI* | [**ActRunsLastKeyValueStoreRecordGet**](docs/LastActorRunsDefaultKeyValueStoreAPI.md#actrunslastkeyvaluestorerecordget) | **Get** /v2/actors/{actorId}/runs/last/key-value-store/records/{recordKey} | Get last run's default store's record -*LastActorRunsDefaultKeyValueStoreAPI* | [**ActRunsLastKeyValueStoreRecordPost**](docs/LastActorRunsDefaultKeyValueStoreAPI.md#actrunslastkeyvaluestorerecordpost) | **Post** /v2/actors/{actorId}/runs/last/key-value-store/records/{recordKey} | Store record in last run's default store (POST) -*LastActorRunsDefaultKeyValueStoreAPI* | [**ActRunsLastKeyValueStoreRecordPut**](docs/LastActorRunsDefaultKeyValueStoreAPI.md#actrunslastkeyvaluestorerecordput) | **Put** /v2/actors/{actorId}/runs/last/key-value-store/records/{recordKey} | Store record in last run's default store -*LastActorRunsDefaultKeyValueStoreAPI* | [**ActRunsLastKeyValueStoreRecordsGet**](docs/LastActorRunsDefaultKeyValueStoreAPI.md#actrunslastkeyvaluestorerecordsget) | **Get** /v2/actors/{actorId}/runs/last/key-value-store/records | Download last run's default store's records -*LastActorRunsDefaultRequestQueueAPI* | [**ActRunsLastRequestQueueDelete**](docs/LastActorRunsDefaultRequestQueueAPI.md#actrunslastrequestqueuedelete) | **Delete** /v2/actors/{actorId}/runs/last/request-queue | Delete last run's default request queue -*LastActorRunsDefaultRequestQueueAPI* | [**ActRunsLastRequestQueueGet**](docs/LastActorRunsDefaultRequestQueueAPI.md#actrunslastrequestqueueget) | **Get** /v2/actors/{actorId}/runs/last/request-queue | Get last run's default request queue -*LastActorRunsDefaultRequestQueueAPI* | [**ActRunsLastRequestQueueHeadGet**](docs/LastActorRunsDefaultRequestQueueAPI.md#actrunslastrequestqueueheadget) | **Get** /v2/actors/{actorId}/runs/last/request-queue/head | Get last run's default request queue head -*LastActorRunsDefaultRequestQueueAPI* | [**ActRunsLastRequestQueueHeadLockPost**](docs/LastActorRunsDefaultRequestQueueAPI.md#actrunslastrequestqueueheadlockpost) | **Post** /v2/actors/{actorId}/runs/last/request-queue/head/lock | Get and lock last run's default request queue head -*LastActorRunsDefaultRequestQueueAPI* | [**ActRunsLastRequestQueuePut**](docs/LastActorRunsDefaultRequestQueueAPI.md#actrunslastrequestqueueput) | **Put** /v2/actors/{actorId}/runs/last/request-queue | Update last run's default request queue -*LastActorRunsDefaultRequestQueueAPI* | [**ActRunsLastRequestQueueRequestDelete**](docs/LastActorRunsDefaultRequestQueueAPI.md#actrunslastrequestqueuerequestdelete) | **Delete** /v2/actors/{actorId}/runs/last/request-queue/requests/{requestId} | Delete request from last run's default request queue -*LastActorRunsDefaultRequestQueueAPI* | [**ActRunsLastRequestQueueRequestGet**](docs/LastActorRunsDefaultRequestQueueAPI.md#actrunslastrequestqueuerequestget) | **Get** /v2/actors/{actorId}/runs/last/request-queue/requests/{requestId} | Get request from last run's default request queue -*LastActorRunsDefaultRequestQueueAPI* | [**ActRunsLastRequestQueueRequestLockDelete**](docs/LastActorRunsDefaultRequestQueueAPI.md#actrunslastrequestqueuerequestlockdelete) | **Delete** /v2/actors/{actorId}/runs/last/request-queue/requests/{requestId}/lock | Delete lock on request in last run's default request queue -*LastActorRunsDefaultRequestQueueAPI* | [**ActRunsLastRequestQueueRequestLockPut**](docs/LastActorRunsDefaultRequestQueueAPI.md#actrunslastrequestqueuerequestlockput) | **Put** /v2/actors/{actorId}/runs/last/request-queue/requests/{requestId}/lock | Prolong lock on request in last run's default request queue -*LastActorRunsDefaultRequestQueueAPI* | [**ActRunsLastRequestQueueRequestPut**](docs/LastActorRunsDefaultRequestQueueAPI.md#actrunslastrequestqueuerequestput) | **Put** /v2/actors/{actorId}/runs/last/request-queue/requests/{requestId} | Update request in last run's default request queue -*LastActorRunsDefaultRequestQueueAPI* | [**ActRunsLastRequestQueueRequestsBatchDelete**](docs/LastActorRunsDefaultRequestQueueAPI.md#actrunslastrequestqueuerequestsbatchdelete) | **Delete** /v2/actors/{actorId}/runs/last/request-queue/requests/batch | Batch delete requests from last run's default request queue -*LastActorRunsDefaultRequestQueueAPI* | [**ActRunsLastRequestQueueRequestsBatchPost**](docs/LastActorRunsDefaultRequestQueueAPI.md#actrunslastrequestqueuerequestsbatchpost) | **Post** /v2/actors/{actorId}/runs/last/request-queue/requests/batch | Batch add requests to last run's default request queue -*LastActorRunsDefaultRequestQueueAPI* | [**ActRunsLastRequestQueueRequestsGet**](docs/LastActorRunsDefaultRequestQueueAPI.md#actrunslastrequestqueuerequestsget) | **Get** /v2/actors/{actorId}/runs/last/request-queue/requests | List last run's default request queue's requests -*LastActorRunsDefaultRequestQueueAPI* | [**ActRunsLastRequestQueueRequestsPost**](docs/LastActorRunsDefaultRequestQueueAPI.md#actrunslastrequestqueuerequestspost) | **Post** /v2/actors/{actorId}/runs/last/request-queue/requests | Add request to last run's default request queue -*LastActorRunsDefaultRequestQueueAPI* | [**ActRunsLastRequestQueueRequestsUnlockPost**](docs/LastActorRunsDefaultRequestQueueAPI.md#actrunslastrequestqueuerequestsunlockpost) | **Post** /v2/actors/{actorId}/runs/last/request-queue/requests/unlock | Unlock requests in last run's default request queue -*LastActorRunsLogAPI* | [**ActRunsLastLogGet**](docs/LastActorRunsLogAPI.md#actrunslastlogget) | **Get** /v2/actors/{actorId}/runs/last/log | Get last Actor run's log -*LastActorRunsMetamorphAPI* | [**ActRunsLastMetamorphPost**](docs/LastActorRunsMetamorphAPI.md#actrunslastmetamorphpost) | **Post** /v2/actors/{actorId}/runs/last/metamorph | Metamorph Actor's last run -*LastActorRunsRebootAPI* | [**ActRunsLastRebootPost**](docs/LastActorRunsRebootAPI.md#actrunslastrebootpost) | **Post** /v2/actors/{actorId}/runs/last/reboot | Reboot Actor's last run -*LastActorTaskRunsAbortAPI* | [**ActorTaskRunsLastAbortPost**](docs/LastActorTaskRunsAbortAPI.md#actortaskrunslastabortpost) | **Post** /v2/actor-tasks/{actorTaskId}/runs/last/abort | Abort Actor task's last run -*LastActorTaskRunsDefaultDatasetAPI* | [**ActorTaskRunsLastDatasetDelete**](docs/LastActorTaskRunsDefaultDatasetAPI.md#actortaskrunslastdatasetdelete) | **Delete** /v2/actor-tasks/{actorTaskId}/runs/last/dataset | Delete last task run's default dataset -*LastActorTaskRunsDefaultDatasetAPI* | [**ActorTaskRunsLastDatasetGet**](docs/LastActorTaskRunsDefaultDatasetAPI.md#actortaskrunslastdatasetget) | **Get** /v2/actor-tasks/{actorTaskId}/runs/last/dataset | Get last task run's default dataset -*LastActorTaskRunsDefaultDatasetAPI* | [**ActorTaskRunsLastDatasetItemsGet**](docs/LastActorTaskRunsDefaultDatasetAPI.md#actortaskrunslastdatasetitemsget) | **Get** /v2/actor-tasks/{actorTaskId}/runs/last/dataset/items | Get last task run's dataset items -*LastActorTaskRunsDefaultDatasetAPI* | [**ActorTaskRunsLastDatasetItemsPost**](docs/LastActorTaskRunsDefaultDatasetAPI.md#actortaskrunslastdatasetitemspost) | **Post** /v2/actor-tasks/{actorTaskId}/runs/last/dataset/items | Store items in last task run's dataset -*LastActorTaskRunsDefaultDatasetAPI* | [**ActorTaskRunsLastDatasetPut**](docs/LastActorTaskRunsDefaultDatasetAPI.md#actortaskrunslastdatasetput) | **Put** /v2/actor-tasks/{actorTaskId}/runs/last/dataset | Update last task run's default dataset -*LastActorTaskRunsDefaultDatasetAPI* | [**ActorTaskRunsLastDatasetStatisticsGet**](docs/LastActorTaskRunsDefaultDatasetAPI.md#actortaskrunslastdatasetstatisticsget) | **Get** /v2/actor-tasks/{actorTaskId}/runs/last/dataset/statistics | Get last task run's dataset statistics -*LastActorTaskRunsDefaultKeyValueStoreAPI* | [**ActorTaskRunsLastKeyValueStoreDelete**](docs/LastActorTaskRunsDefaultKeyValueStoreAPI.md#actortaskrunslastkeyvaluestoredelete) | **Delete** /v2/actor-tasks/{actorTaskId}/runs/last/key-value-store | Delete last task run's default store -*LastActorTaskRunsDefaultKeyValueStoreAPI* | [**ActorTaskRunsLastKeyValueStoreGet**](docs/LastActorTaskRunsDefaultKeyValueStoreAPI.md#actortaskrunslastkeyvaluestoreget) | **Get** /v2/actor-tasks/{actorTaskId}/runs/last/key-value-store | Get last task run's default store -*LastActorTaskRunsDefaultKeyValueStoreAPI* | [**ActorTaskRunsLastKeyValueStoreKeysGet**](docs/LastActorTaskRunsDefaultKeyValueStoreAPI.md#actortaskrunslastkeyvaluestorekeysget) | **Get** /v2/actor-tasks/{actorTaskId}/runs/last/key-value-store/keys | Get last task run's default store's list of keys -*LastActorTaskRunsDefaultKeyValueStoreAPI* | [**ActorTaskRunsLastKeyValueStorePut**](docs/LastActorTaskRunsDefaultKeyValueStoreAPI.md#actortaskrunslastkeyvaluestoreput) | **Put** /v2/actor-tasks/{actorTaskId}/runs/last/key-value-store | Update last task run's default store -*LastActorTaskRunsDefaultKeyValueStoreAPI* | [**ActorTaskRunsLastKeyValueStoreRecordDelete**](docs/LastActorTaskRunsDefaultKeyValueStoreAPI.md#actortaskrunslastkeyvaluestorerecorddelete) | **Delete** /v2/actor-tasks/{actorTaskId}/runs/last/key-value-store/records/{recordKey} | Delete last task run's default store's record -*LastActorTaskRunsDefaultKeyValueStoreAPI* | [**ActorTaskRunsLastKeyValueStoreRecordGet**](docs/LastActorTaskRunsDefaultKeyValueStoreAPI.md#actortaskrunslastkeyvaluestorerecordget) | **Get** /v2/actor-tasks/{actorTaskId}/runs/last/key-value-store/records/{recordKey} | Get last task run's default store's record -*LastActorTaskRunsDefaultKeyValueStoreAPI* | [**ActorTaskRunsLastKeyValueStoreRecordPost**](docs/LastActorTaskRunsDefaultKeyValueStoreAPI.md#actortaskrunslastkeyvaluestorerecordpost) | **Post** /v2/actor-tasks/{actorTaskId}/runs/last/key-value-store/records/{recordKey} | Store record in last task run's default store (POST) -*LastActorTaskRunsDefaultKeyValueStoreAPI* | [**ActorTaskRunsLastKeyValueStoreRecordPut**](docs/LastActorTaskRunsDefaultKeyValueStoreAPI.md#actortaskrunslastkeyvaluestorerecordput) | **Put** /v2/actor-tasks/{actorTaskId}/runs/last/key-value-store/records/{recordKey} | Store record in last task run's default store -*LastActorTaskRunsDefaultKeyValueStoreAPI* | [**ActorTaskRunsLastKeyValueStoreRecordsGet**](docs/LastActorTaskRunsDefaultKeyValueStoreAPI.md#actortaskrunslastkeyvaluestorerecordsget) | **Get** /v2/actor-tasks/{actorTaskId}/runs/last/key-value-store/records | Download last task run's default store's records -*LastActorTaskRunsDefaultRequestQueueAPI* | [**ActorTaskRunsLastRequestQueueDelete**](docs/LastActorTaskRunsDefaultRequestQueueAPI.md#actortaskrunslastrequestqueuedelete) | **Delete** /v2/actor-tasks/{actorTaskId}/runs/last/request-queue | Delete last task run's default request queue -*LastActorTaskRunsDefaultRequestQueueAPI* | [**ActorTaskRunsLastRequestQueueGet**](docs/LastActorTaskRunsDefaultRequestQueueAPI.md#actortaskrunslastrequestqueueget) | **Get** /v2/actor-tasks/{actorTaskId}/runs/last/request-queue | Get last task run's default request queue -*LastActorTaskRunsDefaultRequestQueueAPI* | [**ActorTaskRunsLastRequestQueueHeadGet**](docs/LastActorTaskRunsDefaultRequestQueueAPI.md#actortaskrunslastrequestqueueheadget) | **Get** /v2/actor-tasks/{actorTaskId}/runs/last/request-queue/head | Get last task run's default request queue head -*LastActorTaskRunsDefaultRequestQueueAPI* | [**ActorTaskRunsLastRequestQueueHeadLockPost**](docs/LastActorTaskRunsDefaultRequestQueueAPI.md#actortaskrunslastrequestqueueheadlockpost) | **Post** /v2/actor-tasks/{actorTaskId}/runs/last/request-queue/head/lock | Get and lock last task run's default request queue head -*LastActorTaskRunsDefaultRequestQueueAPI* | [**ActorTaskRunsLastRequestQueuePut**](docs/LastActorTaskRunsDefaultRequestQueueAPI.md#actortaskrunslastrequestqueueput) | **Put** /v2/actor-tasks/{actorTaskId}/runs/last/request-queue | Update last task run's default request queue -*LastActorTaskRunsDefaultRequestQueueAPI* | [**ActorTaskRunsLastRequestQueueRequestDelete**](docs/LastActorTaskRunsDefaultRequestQueueAPI.md#actortaskrunslastrequestqueuerequestdelete) | **Delete** /v2/actor-tasks/{actorTaskId}/runs/last/request-queue/requests/{requestId} | Delete request from last task run's default request queue -*LastActorTaskRunsDefaultRequestQueueAPI* | [**ActorTaskRunsLastRequestQueueRequestGet**](docs/LastActorTaskRunsDefaultRequestQueueAPI.md#actortaskrunslastrequestqueuerequestget) | **Get** /v2/actor-tasks/{actorTaskId}/runs/last/request-queue/requests/{requestId} | Get request from last task run's default request queue -*LastActorTaskRunsDefaultRequestQueueAPI* | [**ActorTaskRunsLastRequestQueueRequestLockDelete**](docs/LastActorTaskRunsDefaultRequestQueueAPI.md#actortaskrunslastrequestqueuerequestlockdelete) | **Delete** /v2/actor-tasks/{actorTaskId}/runs/last/request-queue/requests/{requestId}/lock | Delete lock on request in last task run's default request queue -*LastActorTaskRunsDefaultRequestQueueAPI* | [**ActorTaskRunsLastRequestQueueRequestLockPut**](docs/LastActorTaskRunsDefaultRequestQueueAPI.md#actortaskrunslastrequestqueuerequestlockput) | **Put** /v2/actor-tasks/{actorTaskId}/runs/last/request-queue/requests/{requestId}/lock | Prolong lock on request in last task run's default request queue -*LastActorTaskRunsDefaultRequestQueueAPI* | [**ActorTaskRunsLastRequestQueueRequestPut**](docs/LastActorTaskRunsDefaultRequestQueueAPI.md#actortaskrunslastrequestqueuerequestput) | **Put** /v2/actor-tasks/{actorTaskId}/runs/last/request-queue/requests/{requestId} | Update request in last task run's default request queue -*LastActorTaskRunsDefaultRequestQueueAPI* | [**ActorTaskRunsLastRequestQueueRequestsBatchDelete**](docs/LastActorTaskRunsDefaultRequestQueueAPI.md#actortaskrunslastrequestqueuerequestsbatchdelete) | **Delete** /v2/actor-tasks/{actorTaskId}/runs/last/request-queue/requests/batch | Batch delete requests from last task run's default request queue -*LastActorTaskRunsDefaultRequestQueueAPI* | [**ActorTaskRunsLastRequestQueueRequestsBatchPost**](docs/LastActorTaskRunsDefaultRequestQueueAPI.md#actortaskrunslastrequestqueuerequestsbatchpost) | **Post** /v2/actor-tasks/{actorTaskId}/runs/last/request-queue/requests/batch | Batch add requests to last task run's default request queue -*LastActorTaskRunsDefaultRequestQueueAPI* | [**ActorTaskRunsLastRequestQueueRequestsGet**](docs/LastActorTaskRunsDefaultRequestQueueAPI.md#actortaskrunslastrequestqueuerequestsget) | **Get** /v2/actor-tasks/{actorTaskId}/runs/last/request-queue/requests | List last task run's default request queue's requests -*LastActorTaskRunsDefaultRequestQueueAPI* | [**ActorTaskRunsLastRequestQueueRequestsPost**](docs/LastActorTaskRunsDefaultRequestQueueAPI.md#actortaskrunslastrequestqueuerequestspost) | **Post** /v2/actor-tasks/{actorTaskId}/runs/last/request-queue/requests | Add request to last task run's default request queue -*LastActorTaskRunsDefaultRequestQueueAPI* | [**ActorTaskRunsLastRequestQueueRequestsUnlockPost**](docs/LastActorTaskRunsDefaultRequestQueueAPI.md#actortaskrunslastrequestqueuerequestsunlockpost) | **Post** /v2/actor-tasks/{actorTaskId}/runs/last/request-queue/requests/unlock | Unlock requests in last task run's default request queue -*LastActorTaskRunsLogAPI* | [**ActorTaskLastLogGet**](docs/LastActorTaskRunsLogAPI.md#actortasklastlogget) | **Get** /v2/actor-tasks/{actorTaskId}/runs/last/log | Get last Actor task run's log -*LastActorTaskRunsMetamorphAPI* | [**ActorTaskRunsLastMetamorphPost**](docs/LastActorTaskRunsMetamorphAPI.md#actortaskrunslastmetamorphpost) | **Post** /v2/actor-tasks/{actorTaskId}/runs/last/metamorph | Metamorph Actor task's last run -*LastActorTaskRunsRebootAPI* | [**ActorTaskRunsLastRebootPost**](docs/LastActorTaskRunsRebootAPI.md#actortaskrunslastrebootpost) | **Post** /v2/actor-tasks/{actorTaskId}/runs/last/reboot | Reboot Actor task's last run -*LogsAPI* | [**LogGet**](docs/LogsAPI.md#logget) | **Get** /v2/logs/{buildOrRunId} | Get log -*SchedulesAPI* | [**ScheduleDelete**](docs/SchedulesAPI.md#scheduledelete) | **Delete** /v2/schedules/{scheduleId} | Delete schedule -*SchedulesAPI* | [**ScheduleGet**](docs/SchedulesAPI.md#scheduleget) | **Get** /v2/schedules/{scheduleId} | Get schedule -*SchedulesAPI* | [**ScheduleLogGet**](docs/SchedulesAPI.md#schedulelogget) | **Get** /v2/schedules/{scheduleId}/log | Get schedule log -*SchedulesAPI* | [**SchedulePut**](docs/SchedulesAPI.md#scheduleput) | **Put** /v2/schedules/{scheduleId} | Update schedule -*SchedulesAPI* | [**SchedulesGet**](docs/SchedulesAPI.md#schedulesget) | **Get** /v2/schedules | Get list of schedules -*SchedulesAPI* | [**SchedulesPost**](docs/SchedulesAPI.md#schedulespost) | **Post** /v2/schedules | Create schedule -*StorageDatasetsAPI* | [**DatasetDelete**](docs/StorageDatasetsAPI.md#datasetdelete) | **Delete** /v2/datasets/{datasetId} | Delete dataset -*StorageDatasetsAPI* | [**DatasetGet**](docs/StorageDatasetsAPI.md#datasetget) | **Get** /v2/datasets/{datasetId} | Get dataset -*StorageDatasetsAPI* | [**DatasetItemsGet**](docs/StorageDatasetsAPI.md#datasetitemsget) | **Get** /v2/datasets/{datasetId}/items | Get dataset items -*StorageDatasetsAPI* | [**DatasetItemsHead**](docs/StorageDatasetsAPI.md#datasetitemshead) | **Head** /v2/datasets/{datasetId}/items | Get dataset items headers -*StorageDatasetsAPI* | [**DatasetItemsPost**](docs/StorageDatasetsAPI.md#datasetitemspost) | **Post** /v2/datasets/{datasetId}/items | Store items -*StorageDatasetsAPI* | [**DatasetPut**](docs/StorageDatasetsAPI.md#datasetput) | **Put** /v2/datasets/{datasetId} | Update dataset -*StorageDatasetsAPI* | [**DatasetStatisticsGet**](docs/StorageDatasetsAPI.md#datasetstatisticsget) | **Get** /v2/datasets/{datasetId}/statistics | Get dataset statistics -*StorageDatasetsAPI* | [**DatasetsGet**](docs/StorageDatasetsAPI.md#datasetsget) | **Get** /v2/datasets | Get list of datasets -*StorageDatasetsAPI* | [**DatasetsPost**](docs/StorageDatasetsAPI.md#datasetspost) | **Post** /v2/datasets | Create dataset -*StorageKeyValueStoresAPI* | [**KeyValueStoreDelete**](docs/StorageKeyValueStoresAPI.md#keyvaluestoredelete) | **Delete** /v2/key-value-stores/{storeId} | Delete store -*StorageKeyValueStoresAPI* | [**KeyValueStoreGet**](docs/StorageKeyValueStoresAPI.md#keyvaluestoreget) | **Get** /v2/key-value-stores/{storeId} | Get store -*StorageKeyValueStoresAPI* | [**KeyValueStoreKeysGet**](docs/StorageKeyValueStoresAPI.md#keyvaluestorekeysget) | **Get** /v2/key-value-stores/{storeId}/keys | Get list of keys -*StorageKeyValueStoresAPI* | [**KeyValueStorePut**](docs/StorageKeyValueStoresAPI.md#keyvaluestoreput) | **Put** /v2/key-value-stores/{storeId} | Update store -*StorageKeyValueStoresAPI* | [**KeyValueStoreRecordDelete**](docs/StorageKeyValueStoresAPI.md#keyvaluestorerecorddelete) | **Delete** /v2/key-value-stores/{storeId}/records/{recordKey} | Delete record -*StorageKeyValueStoresAPI* | [**KeyValueStoreRecordGet**](docs/StorageKeyValueStoresAPI.md#keyvaluestorerecordget) | **Get** /v2/key-value-stores/{storeId}/records/{recordKey} | Get record -*StorageKeyValueStoresAPI* | [**KeyValueStoreRecordHead**](docs/StorageKeyValueStoresAPI.md#keyvaluestorerecordhead) | **Head** /v2/key-value-stores/{storeId}/records/{recordKey} | Check if a record exists -*StorageKeyValueStoresAPI* | [**KeyValueStoreRecordPost**](docs/StorageKeyValueStoresAPI.md#keyvaluestorerecordpost) | **Post** /v2/key-value-stores/{storeId}/records/{recordKey} | Store record (POST) -*StorageKeyValueStoresAPI* | [**KeyValueStoreRecordPut**](docs/StorageKeyValueStoresAPI.md#keyvaluestorerecordput) | **Put** /v2/key-value-stores/{storeId}/records/{recordKey} | Store record -*StorageKeyValueStoresAPI* | [**KeyValueStoreRecordsGet**](docs/StorageKeyValueStoresAPI.md#keyvaluestorerecordsget) | **Get** /v2/key-value-stores/{storeId}/records | Download records -*StorageKeyValueStoresAPI* | [**KeyValueStoresGet**](docs/StorageKeyValueStoresAPI.md#keyvaluestoresget) | **Get** /v2/key-value-stores | Get list of key-value stores -*StorageKeyValueStoresAPI* | [**KeyValueStoresPost**](docs/StorageKeyValueStoresAPI.md#keyvaluestorespost) | **Post** /v2/key-value-stores | Create key-value store -*StorageRequestQueuesAPI* | [**RequestQueueDelete**](docs/StorageRequestQueuesAPI.md#requestqueuedelete) | **Delete** /v2/request-queues/{queueId} | Delete request queue -*StorageRequestQueuesAPI* | [**RequestQueueGet**](docs/StorageRequestQueuesAPI.md#requestqueueget) | **Get** /v2/request-queues/{queueId} | Get request queue -*StorageRequestQueuesAPI* | [**RequestQueuePut**](docs/StorageRequestQueuesAPI.md#requestqueueput) | **Put** /v2/request-queues/{queueId} | Update request queue -*StorageRequestQueuesAPI* | [**RequestQueueRequestsBatchDelete**](docs/StorageRequestQueuesAPI.md#requestqueuerequestsbatchdelete) | **Delete** /v2/request-queues/{queueId}/requests/batch | Delete requests -*StorageRequestQueuesAPI* | [**RequestQueueRequestsBatchPost**](docs/StorageRequestQueuesAPI.md#requestqueuerequestsbatchpost) | **Post** /v2/request-queues/{queueId}/requests/batch | Add requests -*StorageRequestQueuesAPI* | [**RequestQueuesGet**](docs/StorageRequestQueuesAPI.md#requestqueuesget) | **Get** /v2/request-queues | Get list of request queues -*StorageRequestQueuesAPI* | [**RequestQueuesPost**](docs/StorageRequestQueuesAPI.md#requestqueuespost) | **Post** /v2/request-queues | Create request queue -*StorageRequestQueuesRequestsAPI* | [**RequestQueueRequestDelete**](docs/StorageRequestQueuesRequestsAPI.md#requestqueuerequestdelete) | **Delete** /v2/request-queues/{queueId}/requests/{requestId} | Delete request -*StorageRequestQueuesRequestsAPI* | [**RequestQueueRequestGet**](docs/StorageRequestQueuesRequestsAPI.md#requestqueuerequestget) | **Get** /v2/request-queues/{queueId}/requests/{requestId} | Get request -*StorageRequestQueuesRequestsAPI* | [**RequestQueueRequestPut**](docs/StorageRequestQueuesRequestsAPI.md#requestqueuerequestput) | **Put** /v2/request-queues/{queueId}/requests/{requestId} | Update request -*StorageRequestQueuesRequestsAPI* | [**RequestQueueRequestsGet**](docs/StorageRequestQueuesRequestsAPI.md#requestqueuerequestsget) | **Get** /v2/request-queues/{queueId}/requests | List requests -*StorageRequestQueuesRequestsAPI* | [**RequestQueueRequestsPost**](docs/StorageRequestQueuesRequestsAPI.md#requestqueuerequestspost) | **Post** /v2/request-queues/{queueId}/requests | Add request -*StorageRequestQueuesRequestsLocksAPI* | [**RequestQueueHeadGet**](docs/StorageRequestQueuesRequestsLocksAPI.md#requestqueueheadget) | **Get** /v2/request-queues/{queueId}/head | Get head -*StorageRequestQueuesRequestsLocksAPI* | [**RequestQueueHeadLockPost**](docs/StorageRequestQueuesRequestsLocksAPI.md#requestqueueheadlockpost) | **Post** /v2/request-queues/{queueId}/head/lock | Get head and lock -*StorageRequestQueuesRequestsLocksAPI* | [**RequestQueueRequestLockDelete**](docs/StorageRequestQueuesRequestsLocksAPI.md#requestqueuerequestlockdelete) | **Delete** /v2/request-queues/{queueId}/requests/{requestId}/lock | Delete request lock -*StorageRequestQueuesRequestsLocksAPI* | [**RequestQueueRequestLockPut**](docs/StorageRequestQueuesRequestsLocksAPI.md#requestqueuerequestlockput) | **Put** /v2/request-queues/{queueId}/requests/{requestId}/lock | Prolong request lock -*StorageRequestQueuesRequestsLocksAPI* | [**RequestQueueRequestsUnlockPost**](docs/StorageRequestQueuesRequestsLocksAPI.md#requestqueuerequestsunlockpost) | **Post** /v2/request-queues/{queueId}/requests/unlock | Unlock requests -*StoreAPI* | [**StoreGet**](docs/StoreAPI.md#storeget) | **Get** /v2/store | Get list of Actors in Store -*ToolsAPI* | [**ToolsBrowserInfoDelete**](docs/ToolsAPI.md#toolsbrowserinfodelete) | **Delete** /v2/browser-info | Get browser info -*ToolsAPI* | [**ToolsBrowserInfoGet**](docs/ToolsAPI.md#toolsbrowserinfoget) | **Get** /v2/browser-info | Get browser info -*ToolsAPI* | [**ToolsBrowserInfoPost**](docs/ToolsAPI.md#toolsbrowserinfopost) | **Post** /v2/browser-info | Get browser info -*ToolsAPI* | [**ToolsBrowserInfoPut**](docs/ToolsAPI.md#toolsbrowserinfoput) | **Put** /v2/browser-info | Get browser info -*ToolsAPI* | [**ToolsDecodeAndVerifyPost**](docs/ToolsAPI.md#toolsdecodeandverifypost) | **Post** /v2/tools/decode-and-verify | Decode and verify object -*ToolsAPI* | [**ToolsEncodeAndSignPost**](docs/ToolsAPI.md#toolsencodeandsignpost) | **Post** /v2/tools/encode-and-sign | Encode and sign object -*UsersAPI* | [**UserGet**](docs/UsersAPI.md#userget) | **Get** /v2/users/{userId} | Get public user data -*UsersAPI* | [**UsersMeGet**](docs/UsersAPI.md#usersmeget) | **Get** /v2/users/me | Get private user data -*UsersAPI* | [**UsersMeLimitsGet**](docs/UsersAPI.md#usersmelimitsget) | **Get** /v2/users/me/limits | Get limits -*UsersAPI* | [**UsersMeLimitsPut**](docs/UsersAPI.md#usersmelimitsput) | **Put** /v2/users/me/limits | Update limits -*UsersAPI* | [**UsersMeUsageMonthlyGet**](docs/UsersAPI.md#usersmeusagemonthlyget) | **Get** /v2/users/me/usage/monthly | Get monthly usage -*WebhooksWebhookDispatchesAPI* | [**WebhookDispatchGet**](docs/WebhooksWebhookDispatchesAPI.md#webhookdispatchget) | **Get** /v2/webhook-dispatches/{dispatchId} | Get webhook dispatch -*WebhooksWebhookDispatchesAPI* | [**WebhookDispatchesGet**](docs/WebhooksWebhookDispatchesAPI.md#webhookdispatchesget) | **Get** /v2/webhook-dispatches | Get list of webhook dispatches -*WebhooksWebhooksAPI* | [**WebhookDelete**](docs/WebhooksWebhooksAPI.md#webhookdelete) | **Delete** /v2/webhooks/{webhookId} | Delete webhook -*WebhooksWebhooksAPI* | [**WebhookGet**](docs/WebhooksWebhooksAPI.md#webhookget) | **Get** /v2/webhooks/{webhookId} | Get webhook -*WebhooksWebhooksAPI* | [**WebhookPut**](docs/WebhooksWebhooksAPI.md#webhookput) | **Put** /v2/webhooks/{webhookId} | Update webhook -*WebhooksWebhooksAPI* | [**WebhookTestPost**](docs/WebhooksWebhooksAPI.md#webhooktestpost) | **Post** /v2/webhooks/{webhookId}/test | Test webhook -*WebhooksWebhooksAPI* | [**WebhookWebhookDispatchesGet**](docs/WebhooksWebhooksAPI.md#webhookwebhookdispatchesget) | **Get** /v2/webhooks/{webhookId}/dispatches | Get collection -*WebhooksWebhooksAPI* | [**WebhooksGet**](docs/WebhooksWebhooksAPI.md#webhooksget) | **Get** /v2/webhooks | Get list of webhooks -*WebhooksWebhooksAPI* | [**WebhooksPost**](docs/WebhooksWebhooksAPI.md#webhookspost) | **Post** /v2/webhooks | Create webhook - - -## Documentation For Models - - - [AccountLimits](docs/AccountLimits.md) - - [ActRunsLastDatasetItemsPost400Response](docs/ActRunsLastDatasetItemsPost400Response.md) - - [ActRunsLastDatasetItemsPostRequest](docs/ActRunsLastDatasetItemsPostRequest.md) - - [ActValidateInputPost200Response](docs/ActValidateInputPost200Response.md) - - [Actor](docs/Actor.md) - - [ActorChargeEvent](docs/ActorChargeEvent.md) - - [ActorDefinition](docs/ActorDefinition.md) - - [ActorDefinitionDefaultMemoryMbytes](docs/ActorDefinitionDefaultMemoryMbytes.md) - - [ActorDefinitionStorages](docs/ActorDefinitionStorages.md) - - [ActorJobStatus](docs/ActorJobStatus.md) - - [ActorPermissionLevel](docs/ActorPermissionLevel.md) - - [ActorResponse](docs/ActorResponse.md) - - [ActorRunFailedError](docs/ActorRunFailedError.md) - - [ActorRunPricingInfo](docs/ActorRunPricingInfo.md) - - [ActorRunTimeoutExceededError](docs/ActorRunTimeoutExceededError.md) - - [ActorShort](docs/ActorShort.md) - - [ActorStandby](docs/ActorStandby.md) - - [ActorStats](docs/ActorStats.md) - - [ActorStatsPublicActorRunStats30Days](docs/ActorStatsPublicActorRunStats30Days.md) - - [ActorTaskGet200Response](docs/ActorTaskGet200Response.md) - - [ActorTaskRunsGet200Response](docs/ActorTaskRunsGet200Response.md) - - [ActorTaskRunsGet200ResponseData](docs/ActorTaskRunsGet200ResponseData.md) - - [ActorTaskRunsPost201Response](docs/ActorTaskRunsPost201Response.md) - - [ActorTaskWebhooksGet200Response](docs/ActorTaskWebhooksGet200Response.md) - - [ActorTaskWebhooksGet200ResponseData](docs/ActorTaskWebhooksGet200ResponseData.md) - - [AddRequestResponse](docs/AddRequestResponse.md) - - [AddedRequest](docs/AddedRequest.md) - - [BatchAddResponse](docs/BatchAddResponse.md) - - [BatchAddResult](docs/BatchAddResult.md) - - [BatchDeleteResponse](docs/BatchDeleteResponse.md) - - [BatchDeleteResult](docs/BatchDeleteResult.md) - - [BrowserInfoResponse](docs/BrowserInfoResponse.md) - - [BrowserInfoResponseHeadersValue](docs/BrowserInfoResponseHeadersValue.md) - - [Build](docs/Build.md) - - [BuildActVersion](docs/BuildActVersion.md) - - [BuildOptions](docs/BuildOptions.md) - - [BuildResponse](docs/BuildResponse.md) - - [BuildShort](docs/BuildShort.md) - - [BuildStats](docs/BuildStats.md) - - [BuildTag](docs/BuildTag.md) - - [BuildUsage](docs/BuildUsage.md) - - [BuildsMeta](docs/BuildsMeta.md) - - [CallsInner](docs/CallsInner.md) - - [ChargeRunRequest](docs/ChargeRunRequest.md) - - [CommonActorPricingInfo](docs/CommonActorPricingInfo.md) - - [CreateActorRequest](docs/CreateActorRequest.md) - - [CreateOrUpdateVersionRequest](docs/CreateOrUpdateVersionRequest.md) - - [CreateTaskRequest](docs/CreateTaskRequest.md) - - [Current](docs/Current.md) - - [CurrentPricingInfo](docs/CurrentPricingInfo.md) - - [DailyServiceUsages](docs/DailyServiceUsages.md) - - [Dataset](docs/Dataset.md) - - [DatasetFieldStatistics](docs/DatasetFieldStatistics.md) - - [DatasetListItem](docs/DatasetListItem.md) - - [DatasetResponse](docs/DatasetResponse.md) - - [DatasetSchemaValidationError](docs/DatasetSchemaValidationError.md) - - [DatasetStatistics](docs/DatasetStatistics.md) - - [DatasetStatisticsResponse](docs/DatasetStatisticsResponse.md) - - [DatasetStats](docs/DatasetStats.md) - - [DecodeAndVerifyData](docs/DecodeAndVerifyData.md) - - [DecodeAndVerifyRequest](docs/DecodeAndVerifyRequest.md) - - [DecodeAndVerifyResponse](docs/DecodeAndVerifyResponse.md) - - [DefaultRunOptions](docs/DefaultRunOptions.md) - - [DeletedRequest](docs/DeletedRequest.md) - - [DeletedRequestById](docs/DeletedRequestById.md) - - [DeletedRequestByUniqueKey](docs/DeletedRequestByUniqueKey.md) - - [EffectivePlatformFeature](docs/EffectivePlatformFeature.md) - - [EffectivePlatformFeatures](docs/EffectivePlatformFeatures.md) - - [EncodeAndSignData](docs/EncodeAndSignData.md) - - [EncodeAndSignResponse](docs/EncodeAndSignResponse.md) - - [EnvVar](docs/EnvVar.md) - - [EnvVarRequest](docs/EnvVarRequest.md) - - [EnvVarResponse](docs/EnvVarResponse.md) - - [ErrorDetail](docs/ErrorDetail.md) - - [ErrorResponse](docs/ErrorResponse.md) - - [ErrorType](docs/ErrorType.md) - - [EventData](docs/EventData.md) - - [ExampleRunInput](docs/ExampleRunInput.md) - - [ExampleWebhookDispatch](docs/ExampleWebhookDispatch.md) - - [FlatPricePerMonthActorPricingInfo](docs/FlatPricePerMonthActorPricingInfo.md) - - [FreeActorPricingInfo](docs/FreeActorPricingInfo.md) - - [GeneralAccess](docs/GeneralAccess.md) - - [HeadAndLockResponse](docs/HeadAndLockResponse.md) - - [HeadRequest](docs/HeadRequest.md) - - [HeadResponse](docs/HeadResponse.md) - - [HttpMethod](docs/HttpMethod.md) - - [InvalidItem](docs/InvalidItem.md) - - [KeyValueStore](docs/KeyValueStore.md) - - [KeyValueStoreKey](docs/KeyValueStoreKey.md) - - [KeyValueStoreResponse](docs/KeyValueStoreResponse.md) - - [KeyValueStoreStats](docs/KeyValueStoreStats.md) - - [Limits](docs/Limits.md) - - [LimitsResponse](docs/LimitsResponse.md) - - [ListOfActors](docs/ListOfActors.md) - - [ListOfActorsInStoreResponse](docs/ListOfActorsInStoreResponse.md) - - [ListOfActorsResponse](docs/ListOfActorsResponse.md) - - [ListOfBuilds](docs/ListOfBuilds.md) - - [ListOfBuildsResponse](docs/ListOfBuildsResponse.md) - - [ListOfDatasets](docs/ListOfDatasets.md) - - [ListOfDatasetsResponse](docs/ListOfDatasetsResponse.md) - - [ListOfEnvVars](docs/ListOfEnvVars.md) - - [ListOfEnvVarsResponse](docs/ListOfEnvVarsResponse.md) - - [ListOfKeyValueStores](docs/ListOfKeyValueStores.md) - - [ListOfKeyValueStoresResponse](docs/ListOfKeyValueStoresResponse.md) - - [ListOfKeys](docs/ListOfKeys.md) - - [ListOfKeysResponse](docs/ListOfKeysResponse.md) - - [ListOfRequestQueues](docs/ListOfRequestQueues.md) - - [ListOfRequestQueuesResponse](docs/ListOfRequestQueuesResponse.md) - - [ListOfRequests](docs/ListOfRequests.md) - - [ListOfRequestsResponse](docs/ListOfRequestsResponse.md) - - [ListOfRuns](docs/ListOfRuns.md) - - [ListOfRunsResponse](docs/ListOfRunsResponse.md) - - [ListOfSchedules](docs/ListOfSchedules.md) - - [ListOfSchedulesResponse](docs/ListOfSchedulesResponse.md) - - [ListOfStoreActors](docs/ListOfStoreActors.md) - - [ListOfTasks](docs/ListOfTasks.md) - - [ListOfTasksResponse](docs/ListOfTasksResponse.md) - - [ListOfVersions](docs/ListOfVersions.md) - - [ListOfVersionsResponse](docs/ListOfVersionsResponse.md) - - [ListOfWebhookDispatches](docs/ListOfWebhookDispatches.md) - - [ListOfWebhookDispatchesResponse](docs/ListOfWebhookDispatchesResponse.md) - - [ListOfWebhooks](docs/ListOfWebhooks.md) - - [ListOfWebhooksResponse](docs/ListOfWebhooksResponse.md) - - [LockedHeadRequest](docs/LockedHeadRequest.md) - - [LockedRequestQueueHead](docs/LockedRequestQueueHead.md) - - [Metamorph](docs/Metamorph.md) - - [MonthlyUsage](docs/MonthlyUsage.md) - - [MonthlyUsageResponse](docs/MonthlyUsageResponse.md) - - [PaginationResponse](docs/PaginationResponse.md) - - [PayPerEventActorPricingInfo](docs/PayPerEventActorPricingInfo.md) - - [PayPerEventActorPricingInfoAllOfPricingPerEvent](docs/PayPerEventActorPricingInfoAllOfPricingPerEvent.md) - - [Plan](docs/Plan.md) - - [PricePerDatasetItemActorPricingInfo](docs/PricePerDatasetItemActorPricingInfo.md) - - [PriceTiers](docs/PriceTiers.md) - - [PrivateUserDataResponse](docs/PrivateUserDataResponse.md) - - [Profile](docs/Profile.md) - - [ProlongRequestLockResponse](docs/ProlongRequestLockResponse.md) - - [Proxy](docs/Proxy.md) - - [ProxyGroup](docs/ProxyGroup.md) - - [PublicUserDataResponse](docs/PublicUserDataResponse.md) - - [PutItemResponseError](docs/PutItemResponseError.md) - - [Request](docs/Request.md) - - [RequestBase](docs/RequestBase.md) - - [RequestBasePayload](docs/RequestBasePayload.md) - - [RequestDraft](docs/RequestDraft.md) - - [RequestDraftDelete](docs/RequestDraftDelete.md) - - [RequestDraftDeleteById](docs/RequestDraftDeleteById.md) - - [RequestDraftDeleteByUniqueKey](docs/RequestDraftDeleteByUniqueKey.md) - - [RequestLockInfo](docs/RequestLockInfo.md) - - [RequestQueue](docs/RequestQueue.md) - - [RequestQueueHead](docs/RequestQueueHead.md) - - [RequestQueueResponse](docs/RequestQueueResponse.md) - - [RequestQueueShort](docs/RequestQueueShort.md) - - [RequestQueueStats](docs/RequestQueueStats.md) - - [RequestRegistration](docs/RequestRegistration.md) - - [RequestResponse](docs/RequestResponse.md) - - [Run](docs/Run.md) - - [RunFailedErrorDetail](docs/RunFailedErrorDetail.md) - - [RunMeta](docs/RunMeta.md) - - [RunOptions](docs/RunOptions.md) - - [RunOrigin](docs/RunOrigin.md) - - [RunResponse](docs/RunResponse.md) - - [RunShort](docs/RunShort.md) - - [RunStats](docs/RunStats.md) - - [RunStorageIds](docs/RunStorageIds.md) - - [RunStorageIdsDatasets](docs/RunStorageIdsDatasets.md) - - [RunTimeoutExceededErrorDetail](docs/RunTimeoutExceededErrorDetail.md) - - [RunUsage](docs/RunUsage.md) - - [RunUsageUsd](docs/RunUsageUsd.md) - - [Schedule](docs/Schedule.md) - - [ScheduleAction](docs/ScheduleAction.md) - - [ScheduleActionRunActor](docs/ScheduleActionRunActor.md) - - [ScheduleActionRunActorTask](docs/ScheduleActionRunActorTask.md) - - [ScheduleActionRunInput](docs/ScheduleActionRunInput.md) - - [ScheduleActionShort](docs/ScheduleActionShort.md) - - [ScheduleActionShortRunActor](docs/ScheduleActionShortRunActor.md) - - [ScheduleActionShortRunActorTask](docs/ScheduleActionShortRunActorTask.md) - - [ScheduleBase](docs/ScheduleBase.md) - - [ScheduleCreate](docs/ScheduleCreate.md) - - [ScheduleCreateAction](docs/ScheduleCreateAction.md) - - [ScheduleCreateActionRunActor](docs/ScheduleCreateActionRunActor.md) - - [ScheduleCreateActionRunActorTask](docs/ScheduleCreateActionRunActorTask.md) - - [ScheduleInvoked](docs/ScheduleInvoked.md) - - [ScheduleLogResponse](docs/ScheduleLogResponse.md) - - [ScheduleNotifications](docs/ScheduleNotifications.md) - - [ScheduleResponse](docs/ScheduleResponse.md) - - [ScheduleShort](docs/ScheduleShort.md) - - [SchemaValidationErrorData](docs/SchemaValidationErrorData.md) - - [SourceCodeFile](docs/SourceCodeFile.md) - - [SourceCodeFileFormat](docs/SourceCodeFileFormat.md) - - [SourceCodeFolder](docs/SourceCodeFolder.md) - - [StorageOwnership](docs/StorageOwnership.md) - - [StoreListActor](docs/StoreListActor.md) - - [TaggedBuildInfo](docs/TaggedBuildInfo.md) - - [TaggedBuildsValue](docs/TaggedBuildsValue.md) - - [Task](docs/Task.md) - - [TaskOptions](docs/TaskOptions.md) - - [TaskResponse](docs/TaskResponse.md) - - [TaskShort](docs/TaskShort.md) - - [TaskStats](docs/TaskStats.md) - - [TestWebhookResponse](docs/TestWebhookResponse.md) - - [TieredPricingPerDatasetItemEntry](docs/TieredPricingPerDatasetItemEntry.md) - - [TieredPricingPerEventEntry](docs/TieredPricingPerEventEntry.md) - - [UnlockRequestsResponse](docs/UnlockRequestsResponse.md) - - [UnlockRequestsResult](docs/UnlockRequestsResult.md) - - [UpdateActorRequest](docs/UpdateActorRequest.md) - - [UpdateDatasetRequest](docs/UpdateDatasetRequest.md) - - [UpdateLimitsRequest](docs/UpdateLimitsRequest.md) - - [UpdateRequestQueueRequest](docs/UpdateRequestQueueRequest.md) - - [UpdateRequestResponse](docs/UpdateRequestResponse.md) - - [UpdateRunRequest](docs/UpdateRunRequest.md) - - [UpdateStoreRequest](docs/UpdateStoreRequest.md) - - [UpdateTaskRequest](docs/UpdateTaskRequest.md) - - [UsageCycle](docs/UsageCycle.md) - - [UsageItem](docs/UsageItem.md) - - [UserPrivateInfo](docs/UserPrivateInfo.md) - - [UserPublicInfo](docs/UserPublicInfo.md) - - [ValidationError](docs/ValidationError.md) - - [Version](docs/Version.md) - - [VersionResponse](docs/VersionResponse.md) - - [VersionSourceFilesInner](docs/VersionSourceFilesInner.md) - - [VersionSourceType](docs/VersionSourceType.md) - - [Webhook](docs/Webhook.md) - - [WebhookCondition](docs/WebhookCondition.md) - - [WebhookCreate](docs/WebhookCreate.md) - - [WebhookDispatch](docs/WebhookDispatch.md) - - [WebhookDispatchResponse](docs/WebhookDispatchResponse.md) - - [WebhookDispatchStatus](docs/WebhookDispatchStatus.md) - - [WebhookDispatchWebhookSummary](docs/WebhookDispatchWebhookSummary.md) - - [WebhookEventType](docs/WebhookEventType.md) - - [WebhookRepresentation](docs/WebhookRepresentation.md) - - [WebhookResponse](docs/WebhookResponse.md) - - [WebhookShort](docs/WebhookShort.md) - - [WebhookStats](docs/WebhookStats.md) - - [WebhookUpdate](docs/WebhookUpdate.md) - +## Custom HTTP transport -## Documentation For Authorization +The transport is replaceable. Implement `HTTPBackend` (a single `Do` method) to integrate a +custom client, proxy, or test double, and pass it with `WithHTTPBackend`: +```go +type myBackend struct{ inner *http.Client } -Authentication schemes defined for the API: -### httpBearer - -- **Type**: HTTP Bearer token authentication - -Example +func (b *myBackend) Do(req *http.Request) (*http.Response, error) { + return b.inner.Do(req) +} -```go -auth := context.WithValue(context.Background(), apifyclient.ContextAccessToken, "BEARER_TOKEN_STRING") -r, err := client.Service.Operation(auth, args) +client := apify.NewClientWithOptions( + apify.WithToken("my-api-token"), + apify.WithHTTPBackend(&myBackend{inner: http.DefaultClient}), +) ``` -### apiKey +## Versioning -- **Type**: API key -- **API key parameter name**: token -- **Location**: URL query string +- `apify.CLIENT_VERSION` — the semantic version of this library. +- `apify.API_SPEC_VERSION` — the Apify OpenAPI spec version this client was built against + (`v2-2026-06-16T064758Z`). -Note, each API key must be added to a map of `map[string]APIKey` where the key is: apiKey and passed in as the auth context for each request. +## Examples -Example +Runnable examples live in [`examples/`](examples) and are exercised in CI. Run any of them +with your token: -```go -auth := context.WithValue( - context.Background(), - apifyclient.ContextAPIKeys, - map[string]apifyclient.APIKey{ - "apiKey": {Key: "API_KEY_STRING"}, - }, - ) -r, err := client.Service.Operation(auth, args) +```sh +APIFY_TOKEN=<your-token> go run ./examples/run_store_actor ``` +| Example | Description | +| --- | --- | +| `get_account` | Fetch and print the current account details. | +| `storages` | Create, write to, and read from a dataset, key-value store, and request queue. | +| `run_store_actor` | Run a Store Actor, wait for it, and read its default dataset. | +| `run_and_last_run_storages` | Start a run, then fetch the Actor's last run and its storages. | +| `iterate_store` | Lazily iterate Actors in the Apify Store. | +| `log_redirection` | Start an Actor and stream its log in real time. | +| `create_build_run_actor` | Create an Actor, build it, run it, and print the run log. | -## Documentation for Utility Methods - -Due to the fact that model structure members are all pointers, this package contains -a number of utility functions to easily obtain pointers to values of basic types. -Each of these functions takes a value of the given basic type and returns a pointer to it: +## Documentation -* `PtrBool` -* `PtrInt` -* `PtrInt32` -* `PtrInt64` -* `PtrFloat` -* `PtrFloat32` -* `PtrFloat64` -* `PtrString` -* `PtrTime` +Per-resource guides are in [`docs/`](docs): +[actors](docs/actors.md), [builds](docs/builds.md), [runs](docs/runs.md), +[tasks](docs/tasks.md), [storages](docs/storages.md), [schedules](docs/schedules.md), +[webhooks](docs/webhooks.md), [misc (store, users, logs)](docs/misc.md). -## Author +## Scope +The client implements only documented API endpoints. Matching the JavaScript reference, the +synchronous run endpoints (`run-sync`, `run-sync-get-dataset-items`) and the keyed-POST +record aliases are intentionally not implemented. +## License +Licensed under the Apache License, Version 2.0. See [LICENSE](LICENSE). diff --git a/actor.go b/actor.go new file mode 100644 index 0000000..9b939fb --- /dev/null +++ b/actor.go @@ -0,0 +1,233 @@ +package apify + +import ( + "context" + "encoding/base64" + "encoding/json" + "net/http" +) + +// ActorStartOptions configures starting an Actor or task run +// ([ActorClient.Start]/[ActorClient.Call] and the task equivalents). +type ActorStartOptions struct { + // Build is the tag or number of the build to run (e.g. "latest", "0.1.2"). + Build *string + // MemoryMbytes is the memory in megabytes allocated for the run. + MemoryMbytes *int64 + // TimeoutSecs is the timeout for the run in seconds (0 means no timeout). + TimeoutSecs *int64 + // WaitForFinish is the maximum seconds to wait server-side for the run to finish (max 60). + WaitForFinish *int64 + // MaxItems is the maximum number of dataset items to charge (pay-per-result Actors). + MaxItems *int64 + // MaxTotalChargeUsd is the maximum total charge in USD (pay-per-event Actors). + MaxTotalChargeUsd *float64 + // ContentType is the content type of the input body. Defaults to application/json. + ContentType *string + // RestartOnError, if true, restarts the run if it fails. + RestartOnError *bool + // ForcePermissionLevel overrides the Actor's permission level for this run. + ForcePermissionLevel *string + // Webhooks are ad-hoc webhooks to attach to this run. They are serialized to + // base64-encoded JSON as the `webhooks` query parameter, matching the reference clients. + Webhooks []any +} + +func (o ActorStartOptions) apply(q *QueryParams) { + q.AddString("build", o.Build). + AddInt("memory", o.MemoryMbytes). + AddInt("timeout", o.TimeoutSecs). + AddInt("waitForFinish", o.WaitForFinish). + AddInt("maxItems", o.MaxItems). + AddFloat("maxTotalChargeUsd", o.MaxTotalChargeUsd). + AddBool("restartOnError", o.RestartOnError). + AddString("forcePermissionLevel", o.ForcePermissionLevel) + if encoded := encodeWebhooks(o.Webhooks); encoded != nil { + q.AddString("webhooks", encoded) + } +} + +// encodeWebhooks encodes an ad-hoc webhooks slice as base64-encoded JSON, as the API's +// `webhooks` query parameter requires. Returns nil for a nil slice. Shared by the Actor and +// task start options (DRY). +func encodeWebhooks(webhooks []any) *string { + if webhooks == nil { + return nil + } + data, err := json.Marshal(webhooks) + if err != nil { + return nil + } + encoded := base64.StdEncoding.EncodeToString(data) + return &encoded +} + +func (o ActorStartOptions) contentTypeOrDefault() string { + if o.ContentType != nil && *o.ContentType != "" { + return *o.ContentType + } + return contentTypeJSON +} + +// ActorBuildOptions configures [ActorClient.Build]. +type ActorBuildOptions struct { + // BetaPackages, if true, uses beta versions of Apify packages. + BetaPackages *bool + // Tag is the tag to apply to the build (e.g. "latest"). + Tag *string + // UseCache, if set, controls whether to use the Docker build cache (default true). + UseCache *bool + // WaitForFinish is the maximum seconds to wait server-side for the build (max 60). + WaitForFinish *int64 +} + +// ActorClient is a client for a specific Actor. +// +// It provides CRUD methods plus convenience helpers to start/call the Actor, build it, and +// access its runs, builds, versions and webhooks. +type ActorClient struct { + root *ApifyClient + ctx *resourceContext + baseURL string + id string +} + +func newActorClient(root *ApifyClient, hc *httpClient, baseURL, id string) *ActorClient { + return &ActorClient{ + root: root, + ctx: newSingleContext(hc, baseURL, "actors", id), + baseURL: baseURL, + id: id, + } +} + +// ID returns the Actor's ID (or username~name) as provided. +func (c *ActorClient) ID() string { return c.id } + +// Get fetches the Actor object. The bool reports whether the Actor exists. +func (c *ActorClient) Get(ctx context.Context) (Actor, bool, error) { + return getResource[Actor](ctx, c.ctx, "", NewQueryParams()) +} + +// Update updates the Actor with the given fields and returns the updated object. +func (c *ActorClient) Update(ctx context.Context, newFields any) (Actor, error) { + return updateResource[Actor](ctx, c.ctx, "", newFields) +} + +// Delete deletes the Actor. +func (c *ActorClient) Delete(ctx context.Context) error { + return deleteResource(ctx, c.ctx, "") +} + +// Start starts the Actor and returns immediately with the created run. +// +// input is any JSON-serializable value (or nil for no input). +func (c *ActorClient) Start(ctx context.Context, input any, options ActorStartOptions) (ActorRun, error) { + params := NewQueryParams() + options.apply(params) + body, err := marshalInput(input) + if err != nil { + return ActorRun{}, err + } + return postWithBody[ActorRun](ctx, c.ctx, "runs", params, body, options.contentTypeOrDefault()) +} + +// Call starts the Actor and waits (client-side polling) for it to finish. +// +// waitSecs bounds the wait; nil waits indefinitely. It returns the finished run (or the +// still-running run if the wait budget was exhausted). +func (c *ActorClient) Call(ctx context.Context, input any, options ActorStartOptions, waitSecs *int64) (ActorRun, error) { + run, err := c.Start(ctx, input, options) + if err != nil { + return ActorRun{}, err + } + // Use the root client's run client so polling targets the canonical run route. + return c.root.Run(run.ID).WaitForFinish(ctx, waitSecs) +} + +// Build builds the given version of the Actor and returns the created build. +func (c *ActorClient) Build(ctx context.Context, versionNumber string, options ActorBuildOptions) (Build, error) { + params := NewQueryParams() + params.AddString("version", &versionNumber). + AddBool("betaPackages", options.BetaPackages). + AddString("tag", options.Tag). + AddBool("useCache", options.UseCache). + AddInt("waitForFinish", options.WaitForFinish) + return postWithBody[Build](ctx, c.ctx, "builds", params, nil, contentTypeJSON) +} + +// DefaultBuild resolves the Actor's default build and returns a client for it. +// +// waitForFinish optionally bounds how long (in seconds) the API waits for the build to +// finish before responding, matching the reference client's defaultBuild(options). +func (c *ActorClient) DefaultBuild(ctx context.Context, waitForFinish *int64) (*BuildClient, error) { + params := NewQueryParams() + params.AddInt("waitForFinish", waitForFinish) + url := params.applyToURL(c.ctx.subURL("builds/default")) + resp, err := c.ctx.http.call(ctx, http.MethodGet, url, nil, "", defaultRequestTimeout) + if err != nil { + return nil, err + } + build, err := parseDataEnvelope[Build](resp.body) + if err != nil { + return nil, err + } + return newBuildClient(c.ctx.http, c.baseURL, build.ID), nil +} + +// ValidateInput validates the given input against the Actor's input schema. +func (c *ActorClient) ValidateInput(ctx context.Context, input any) (json.RawMessage, error) { + body, err := json.Marshal(input) + if err != nil { + return nil, err + } + url := c.ctx.subURL("validate-input") + resp, err := c.ctx.http.call(ctx, http.MethodPost, url, body, contentTypeJSON, defaultRequestTimeout) + if err != nil { + return nil, err + } + return resp.body, nil +} + +// LastRun returns a client for the last run of this Actor, optionally filtered by status +// (e.g. "SUCCEEDED"). Pass an empty status for no filter. +func (c *ActorClient) LastRun(status string) *RunClient { + client := newRunClient(c.root, c.ctx.http, c.ctx.subURL(""), "runs", "last") + if status != "" { + client.setStatusParam(status) + } + return client +} + +// Builds returns a client for this Actor's build collection. +func (c *ActorClient) Builds() *BuildCollectionClient { + return newBuildCollectionClientWithBase(c.ctx.http, c.ctx.subURL(""), "builds") +} + +// Runs returns a client for this Actor's run collection. +func (c *ActorClient) Runs() *RunCollectionClient { + return newRunCollectionClient(c.ctx.http, c.ctx.subURL(""), "runs") +} + +// Version returns a client for a specific version of this Actor. +func (c *ActorClient) Version(versionNumber string) *ActorVersionClient { + return newActorVersionClient(c.ctx.http, c.ctx.subURL(""), versionNumber) +} + +// Versions returns a client for this Actor's version collection. +func (c *ActorClient) Versions() *ActorVersionCollectionClient { + return newActorVersionCollectionClient(c.ctx.http, c.ctx.subURL("")) +} + +// Webhooks returns a client for this Actor's webhook collection. +func (c *ActorClient) Webhooks() *WebhookCollectionClient { + return newWebhookCollectionClientWithBase(c.ctx.http, c.ctx.subURL("")) +} + +// marshalInput serializes a non-nil input to JSON, returning nil bytes for a nil input. +func marshalInput(input any) ([]byte, error) { + if input == nil { + return nil, nil + } + return json.Marshal(input) +} diff --git a/actor_collection.go b/actor_collection.go new file mode 100644 index 0000000..e816145 --- /dev/null +++ b/actor_collection.go @@ -0,0 +1,46 @@ +package apify + +import "context" + +// ActorListOptions configures [ActorCollectionClient.List]. +type ActorListOptions struct { + // Offset is the number of Actors to skip. + Offset *int64 + // Limit is the maximum number of Actors to return. + Limit *int64 + // Desc, if true, returns Actors newest-first. + Desc *bool + // My, if true, returns only Actors owned by the current user. + My *bool + // SortBy sets the sort field (e.g. "createdAt", "stats.lastRunStartedAt"). + SortBy *string +} + +func (o ActorListOptions) apply(q *QueryParams) { + q.AddInt("offset", o.Offset). + AddInt("limit", o.Limit). + AddBool("desc", o.Desc). + AddBool("my", o.My). + AddString("sortBy", o.SortBy) +} + +// ActorCollectionClient is a client for the Actor collection (GET/POST /v2/actors). +type ActorCollectionClient struct { + ctx *resourceContext +} + +func newActorCollectionClient(hc *httpClient, baseURL string) *ActorCollectionClient { + return &ActorCollectionClient{ctx: newCollectionContext(hc, baseURL, "actors")} +} + +// List lists the account's Actors. +func (c *ActorCollectionClient) List(ctx context.Context, options ActorListOptions) (PaginationList[Actor], error) { + params := NewQueryParams() + options.apply(params) + return listResource[Actor](ctx, c.ctx, "", params) +} + +// Create creates a new Actor. actor is any JSON-serializable Actor definition. +func (c *ActorCollectionClient) Create(ctx context.Context, actor any) (Actor, error) { + return createResource[Actor](ctx, c.ctx, NewQueryParams(), actor) +} diff --git a/actor_env_var.go b/actor_env_var.go new file mode 100644 index 0000000..c7c1263 --- /dev/null +++ b/actor_env_var.go @@ -0,0 +1,48 @@ +package apify + +import "context" + +// ActorEnvVarCollectionClient is a client for an Actor version's environment variable +// collection (GET/POST /v2/actors/{actorId}/versions/{versionNumber}/env-vars). +type ActorEnvVarCollectionClient struct { + ctx *resourceContext +} + +func newActorEnvVarCollectionClient(hc *httpClient, versionURL string) *ActorEnvVarCollectionClient { + return &ActorEnvVarCollectionClient{ctx: newCollectionContext(hc, versionURL, "env-vars")} +} + +// List lists the version's environment variables. +func (c *ActorEnvVarCollectionClient) List(ctx context.Context) (PaginationList[ActorEnvVar], error) { + return listResource[ActorEnvVar](ctx, c.ctx, "", NewQueryParams()) +} + +// Create creates a new environment variable. +func (c *ActorEnvVarCollectionClient) Create(ctx context.Context, envVar ActorEnvVar) (ActorEnvVar, error) { + return createResource[ActorEnvVar](ctx, c.ctx, NewQueryParams(), envVar) +} + +// ActorEnvVarClient is a client for a single environment variable +// (GET/PUT/DELETE /v2/actors/{actorId}/versions/{versionNumber}/env-vars/{name}). +type ActorEnvVarClient struct { + ctx *resourceContext +} + +func newActorEnvVarClient(hc *httpClient, versionURL, name string) *ActorEnvVarClient { + return &ActorEnvVarClient{ctx: newSingleContext(hc, versionURL, "env-vars", name)} +} + +// Get fetches the environment variable. The bool reports whether it exists. +func (c *ActorEnvVarClient) Get(ctx context.Context) (ActorEnvVar, bool, error) { + return getResource[ActorEnvVar](ctx, c.ctx, "", NewQueryParams()) +} + +// Update updates the environment variable and returns the updated object. +func (c *ActorEnvVarClient) Update(ctx context.Context, envVar ActorEnvVar) (ActorEnvVar, error) { + return updateResource[ActorEnvVar](ctx, c.ctx, "", envVar) +} + +// Delete deletes the environment variable. +func (c *ActorEnvVarClient) Delete(ctx context.Context) error { + return deleteResource(ctx, c.ctx, "") +} diff --git a/actor_version.go b/actor_version.go new file mode 100644 index 0000000..7058ecf --- /dev/null +++ b/actor_version.go @@ -0,0 +1,62 @@ +package apify + +import "context" + +// ActorVersionCollectionClient is a client for an Actor's version collection +// (GET/POST /v2/actors/{actorId}/versions). +type ActorVersionCollectionClient struct { + ctx *resourceContext +} + +func newActorVersionCollectionClient(hc *httpClient, actorURL string) *ActorVersionCollectionClient { + return &ActorVersionCollectionClient{ctx: newCollectionContext(hc, actorURL, "versions")} +} + +// List lists the Actor's versions. +func (c *ActorVersionCollectionClient) List(ctx context.Context, options ListOptions) (PaginationList[ActorVersion], error) { + params := NewQueryParams() + options.apply(params) + return listResource[ActorVersion](ctx, c.ctx, "", params) +} + +// Create creates a new Actor version. version is any JSON-serializable version definition. +func (c *ActorVersionCollectionClient) Create(ctx context.Context, version any) (ActorVersion, error) { + return createResource[ActorVersion](ctx, c.ctx, NewQueryParams(), version) +} + +// ActorVersionClient is a client for a specific Actor version +// (GET/PUT/DELETE /v2/actors/{actorId}/versions/{versionNumber}). +type ActorVersionClient struct { + ctx *resourceContext + versionURL string +} + +func newActorVersionClient(hc *httpClient, actorURL, versionNumber string) *ActorVersionClient { + ctx := newSingleContext(hc, actorURL, "versions", versionNumber) + return &ActorVersionClient{ctx: ctx, versionURL: ctx.subURL("")} +} + +// Get fetches the version. The bool reports whether it exists. +func (c *ActorVersionClient) Get(ctx context.Context) (ActorVersion, bool, error) { + return getResource[ActorVersion](ctx, c.ctx, "", NewQueryParams()) +} + +// Update updates the version with the given fields and returns the updated object. +func (c *ActorVersionClient) Update(ctx context.Context, newFields any) (ActorVersion, error) { + return updateResource[ActorVersion](ctx, c.ctx, "", newFields) +} + +// Delete deletes the version. +func (c *ActorVersionClient) Delete(ctx context.Context) error { + return deleteResource(ctx, c.ctx, "") +} + +// EnvVar returns a client for a specific environment variable of this version. +func (c *ActorVersionClient) EnvVar(name string) *ActorEnvVarClient { + return newActorEnvVarClient(c.ctx.http, c.versionURL, name) +} + +// EnvVars returns a client for this version's environment variable collection. +func (c *ActorVersionClient) EnvVars() *ActorEnvVarCollectionClient { + return newActorEnvVarCollectionClient(c.ctx.http, c.versionURL) +} diff --git a/api/openapi.yaml b/api/openapi.yaml deleted file mode 100644 index ae73517..0000000 --- a/api/openapi.yaml +++ /dev/null @@ -1,23400 +0,0 @@ -openapi: 3.1.2 -info: - contact: {} - description: "\nThe Apify API (version 2) provides programmatic access to the [Apify\n\ - platform](https://docs.apify.com). The API is organized\naround [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer)\n\ - HTTP endpoints.\n\nYou can download the complete OpenAPI schema of Apify API in\ - \ the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json)\ - \ formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi).\n\ - \nAll requests and responses (including errors) are encoded in\n[JSON](http://www.json.org/)\ - \ format with UTF-8 encoding,\nwith a few exceptions that are explicitly described\ - \ in the reference.\n\n- To access the API using [Node.js](https://nodejs.org/en/),\ - \ we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM\n\ - package](https://www.npmjs.com/package/apify-client).\n- To access the API using\ - \ [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python)\ - \ [PyPI\npackage](https://pypi.org/project/apify-client/).\n\nThe clients' functions\ - \ correspond to the API endpoints and have the same\nparameters. This simplifies\ - \ development of apps that depend on the Apify\nplatform.\n\n:::note Important\ - \ Request Details\n\n- `Content-Type` header: For requests with a JSON body, you\ - \ must include the `Content-Type: application/json` header.\n\n- Method override:\ - \ You can override the HTTP method using the `method` query parameter. This is\ - \ useful for clients that can only send `GET` requests. For example, to call a\ - \ `POST` endpoint, append `?method=POST` to the URL of your `GET` request.\n\n\ - :::\n\n## Authentication\n<span id=\"/introduction/authentication\"></span>\n\n\ - **You can find your API token on the\n[Integrations](https://console.apify.com/settings/integrations)\ - \ page in the\nApify Console.**\n\nTo use your token in a request, either:\n\n\ - - Add the token to your request's `Authorization` header as `Bearer <token>`.\n\ - E.g., `Authorization: Bearer xxxxxxx`.\n[More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization).\n\ - (Recommended).\n- Add it as the `token` parameter to your request URL. (Less secure).\n\ - \nUsing your token in the request header is more secure than using it as a URL\n\ - parameter because URLs are often stored\nin browser history and server logs. This\ - \ creates a chance for someone\nunauthorized to access your API token.\n\n**Never\ - \ share your API token or password with untrusted parties!**\n\nFor more information,\ - \ see our\n[integrations](https://docs.apify.com/platform/integrations) documentation.\n\ - \n### Agentic payments\n\nAI agents can authenticate and pay for Actor runs without\ - \ an Apify account\nusing agentic payments. Instead of an API token, the request\ - \ carries a\npayment credential that both authorizes and pays for the call. Apify\ - \ supports\nthe [x402 protocol](https://docs.apify.com/platform/integrations/x402)\n\ - (`PAYMENT-SIGNATURE` header) and\n[Skyfire](https://docs.apify.com/platform/integrations/skyfire)\n\ - (`skyfire-pay-id` header).\n\n## Basic usage\n<span id=\"/introduction/basic-usage\"\ - ></span>\n\nTo run an Actor, send a POST request to the [Run\nActor](#/reference/actors/run-collection/run-actor)\ - \ endpoint using either the\nActor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name\ - \ (e.g.\n`janedoe~my-actor`):\n\n`https://api.apify.com/v2/actors/[actor_id]/runs`\n\ - \nIf the Actor is not runnable anonymously, you will receive a 401 or 403\n[response\ - \ code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status).\nThis means\ - \ you need to add your [secret API\ntoken](https://console.apify.com/account#/integrations)\ - \ to the request's\n`Authorization` header ([recommended](#/introduction/authentication))\ - \ or as a\nURL query parameter `?token=[your_token]` (less secure).\n\nOptionally,\ - \ you can include the query parameters described in the [Run\nActor](#/reference/actors/run-collection/run-actor)\ - \ section to customize your\nrun.\n\nIf you're using Node.js, the best way to\ - \ run an Actor is using the\n`Apify.call()` method from the [Apify\nSDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options).\ - \ It\nruns the Actor using the account you are currently logged into (determined\n\ - by the [secret API token](https://console.apify.com/account#/integrations)).\n\ - The result is an [Actor run\nobject](https://sdk.apify.com/docs/typedefs/actor-run)\ - \ and its output (if\nany).\n\nA typical workflow is as follows:\n\n1. Run an\ - \ Actor or task using the [Run\nActor](#/reference/actors/run-collection/run-actor)\ - \ or [Run\ntask](#/reference/actor-tasks/run-collection/run-task) API endpoints.\n\ - 2. Monitor the Actor run by periodically polling its progress using the [Get\n\ - run](#/reference/actor-runs/run-object-and-its-storages/get-run) API\nendpoint.\n\ - 3. Fetch the results from the [Get\nitems](#/reference/datasets/item-collection/get-items)\ - \ API endpoint using the\n`defaultDatasetId`, which you receive in the Run request\ - \ response.\nAdditional data may be stored in a key-value store. You can fetch\ - \ them from\nthe [Get record](#/reference/key-value-stores/record/get-record)\ - \ API endpoint\nusing the `defaultKeyValueStoreId` and the store's `key`.\n\n\ - **Note**: Instead of periodic polling, you can also run your\n[Actor](#/reference/actors/run-actor-synchronously)\ - \ or\n[task](#/reference/actor-tasks/runs-collection/run-task-synchronously)\n\ - synchronously. This will ensure that the request waits for 300 seconds (5\nminutes)\ - \ for the run to finish and returns its output. If the run takes\nlonger, the\ - \ request will time out and throw an error.\n\n## Legacy `/v2/acts/` URL prefix\n\ - <span id=\"/introduction/legacy-acts-prefix\"></span>\n\nThe `/v2/acts/` prefix\ - \ is deprecated but still fully functional, and \nsuch endpoint routes to the\ - \ same handler as its `/v2/actors/...` counterpart. \nNew integrations should\ - \ use the canonical /v2/actors/ prefix, \nbut existing clients keep working without\ - \ changes.\n\n## Response structure\n<span id=\"/introduction/response-structure\"\ - ></span>\n\nMost API endpoints return a JSON object with the `data` property:\n\ - \n```\n{\n \"data\": {\n ...\n }\n}\n```\n\nHowever, there are a\ - \ few explicitly described exceptions, such as\n[Get dataset items](#/reference/datasets/item-collection/get-items)\ - \ or\nKey-value store [Get record](#/reference/key-value-stores/record/get-record)\n\ - API endpoints, which return data in other formats.\nIn case of an error, the response\ - \ has the HTTP status code in the range of\n4xx or 5xx and the `data` property\ - \ is replaced with `error`. For example:\n\n```\n{\n \"error\": {\n \ - \ \"type\": \"record-not-found\",\n \"message\": \"Store was not found.\"\ - \n }\n}\n```\n\nSee [Errors](#/introduction/errors) for more details.\n\n##\ - \ Pagination\n<span id=\"/introduction/pagination\"></span>\n\nAll API endpoints\ - \ that return a list of records\n(e.g. [Get list of\nActors](#/reference/actors/actor-collection/get-list-of-actors))\n\ - enforce pagination in order to limit the size of their responses.\n\nMost of these\ - \ API endpoints are paginated using the `offset` and `limit`\nquery parameters.\n\ - The only exception is [Get list of\nkeys](#/reference/key-value-stores/key-collection/get-list-of-keys),\n\ - which is paginated using the `exclusiveStartKey` query parameter.\n\n**IMPORTANT**:\ - \ Each API endpoint that supports pagination enforces a certain\nmaximum value\ - \ for the `limit` parameter,\nin order to reduce the load on Apify servers.\n\ - The maximum limit could change in future so you should never\nrely on a specific\ - \ value and check the responses of these API endpoints.\n\n### Using offset\n\ - <span id=\"/introduction/pagination/using-offset\"></span>\n\nMost API endpoints\ - \ that return a list of records enable pagination using the\nfollowing query parameters:\n\ - \n<table>\n <tr>\n <td><code>limit</code></td>\n <td>Limits the response\ - \ to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td>\n\ - \ </tr>\n <tr>\n <td><code>offset</code></td>\n <td>Skips a number of\ - \ items from the beginning of the list, e.g. <code>offset=100</code>.</td>\n \ - \ </tr>\n <tr>\n <td><code>desc</code></td>\n <td>\n By default, items\ - \ are sorted in the order in which they were created or added to the list.\n \ - \ This feature is useful when fetching all the items, because it ensures that\ - \ items\n created after the client started the pagination will not be skipped.\n\ - \ If you specify the <code>desc=1</code> parameter, the items will be returned\ - \ in the reverse order,\n i.e. from the newest to the oldest items.\n </td>\n\ - \ </tr>\n</table>\n\nThe response of these API endpoints is always a JSON object\ - \ with the\nfollowing structure:\n\n```\n{\n \"data\": {\n \"total\"\ - : 2560,\n \"offset\": 250,\n \"limit\": 1000,\n \"count\"\ - : 1000,\n \"desc\": false,\n \"items\": [\n { 1st object\ - \ },\n { 2nd object },\n ...\n { 1000th object\ - \ }\n ]\n }\n}\n```\n\nThe following table describes the meaning of\ - \ the response properties:\n\n<table>\n <tr>\n <th>Property</th>\n <th>Description</th>\n\ - \ </tr>\n <tr>\n <td><code>total</code></td>\n <td>The total number of\ - \ items available in the list.</td>\n </tr>\n <tr>\n <td><code>offset</code></td>\n\ - \ <td>The number of items that were skipped at the start.\n This is equal\ - \ to the <code>offset</code> query parameter if it was provided, otherwise it\ - \ is <code>0</code>.</td>\n </tr>\n <tr>\n <td><code>limit</code></td>\n\ - \ <td>The maximum number of items that can be returned in the HTTP response.\n\ - \ It equals to the <code>limit</code> query parameter if it was provided or\n\ - \ the maximum limit enforced for the particular API endpoint, whichever is\ - \ smaller.</td>\n </tr>\n <tr>\n <td><code>count</code></td>\n <td>The\ - \ actual number of items returned in the HTTP response.</td>\n </tr>\n <tr>\n\ - \ <td><code>desc</code></td>\n <td><code>true</code> if data were requested\ - \ in descending order and <code>false</code> otherwise.</td>\n </tr>\n <tr>\n\ - \ <td><code>items</code></td>\n <td>An array of requested items.</td>\n\ - \ </tr>\n</table>\n\n### Using key\n<span id=\"/introduction/pagination/using-key\"\ - ></span>\n\nThe records in the [key-value\nstore](https://docs.apify.com/platform/storage/key-value-store)\n\ - are not ordered based on numerical indexes,\nbut rather by their keys in the UTF-8\ - \ binary order.\nTherefore the [Get list of\nkeys](#/reference/key-value-stores/key-collection/get-list-of-keys)\n\ - API endpoint only supports pagination using the following query parameters:\n\n\ - <table>\n <tr>\n <td><code>limit</code></td>\n <td>Limits the response\ - \ to contain a specific maximum number items, e.g. <code>limit=20</code>.</td>\n\ - \ </tr>\n <tr>\n <td><code>exclusiveStartKey</code></td>\n <td>Skips all\ - \ records with keys up to the given key including the given key,\n in the UTF-8\ - \ binary order.</td>\n </tr>\n</table>\n\nThe response of the API endpoint is\ - \ always a JSON object with following\nstructure:\n\n```\n{\n \"data\": {\n\ - \ \"limit\": 1000,\n \"isTruncated\": true,\n \"exclusiveStartKey\"\ - : \"my-key\",\n \"nextExclusiveStartKey\": \"some-other-key\",\n \ - \ \"items\": [\n { 1st object },\n { 2nd object },\n \ - \ ...\n { 1000th object }\n ]\n }\n}\n```\n\nThe\ - \ following table describes the meaning of the response properties:\n\n<table>\n\ - \ <tr>\n <th>Property</th>\n <th>Description</th>\n </tr>\n <tr>\n \ - \ <td><code>limit</code></td>\n <td>The maximum number of items that can be\ - \ returned in the HTTP response.\n It equals to the <code>limit</code> query\ - \ parameter if it was provided or\n the maximum limit enforced for the particular\ - \ endpoint, whichever is smaller.</td>\n </tr>\n <tr>\n <td><code>isTruncated</code></td>\n\ - \ <td><code>true</code> if there are more items left to be queried. Otherwise\ - \ <code>false</code>.</td>\n </tr>\n <tr>\n <td><code>exclusiveStartKey</code></td>\n\ - \ <td>The last key that was skipped at the start. Is `null` for the first page.</td>\n\ - \ </tr>\n <tr>\n <td><code>nextExclusiveStartKey</code></td>\n <td>The\ - \ value for the <code>exclusiveStartKey</code> parameter to query the next page\ - \ of items.</td>\n </tr>\n</table>\n\n## Errors\n<span id=\"/introduction/errors\"\ - ></span>\n\nThe Apify API uses common HTTP status codes: `2xx` range for success,\ - \ `4xx`\nrange for errors caused by the caller\n(invalid requests) and `5xx` range\ - \ for server errors (these are rare).\nEach error response contains a JSON object\ - \ defining the `error` property,\nwhich is an object with\nthe `type` and `message`\ - \ properties that contain the error code and a\nhuman-readable error description,\ - \ respectively.\n\nFor example:\n\n```\n{\n \"error\": {\n \"type\"\ - : \"record-not-found\",\n \"message\": \"Store was not found.\"\n }\n\ - }\n```\n\nHere is the table of the most common errors that can occur for many\ - \ API\nendpoints:\n\n<table>\n <tr>\n <th>status</th>\n <th>type</th>\n\ - \ <th>message</th>\n </tr>\n <tr>\n <td><code>400</code></td>\n <td><code>invalid-request</code></td>\n\ - \ <td>POST data must be a JSON object</td>\n </tr>\n <tr>\n <td><code>400</code></td>\n\ - \ <td><code>invalid-value</code></td>\n <td>Invalid value provided: Comments\ - \ required</td>\n </tr>\n <tr>\n <td><code>400</code></td>\n <td><code>invalid-record-key</code></td>\n\ - \ <td>Record key contains invalid character</td>\n </tr>\n <tr>\n <td><code>401</code></td>\n\ - \ <td><code>token-not-provided</code></td>\n <td>Authentication token was\ - \ not provided</td>\n </tr>\n <tr>\n <td><code>404</code></td>\n <td><code>record-not-found</code></td>\n\ - \ <td>Store was not found</td>\n </tr>\n <tr>\n <td><code>429</code></td>\n\ - \ <td><code>rate-limit-exceeded</code></td>\n <td>You have exceeded the\ - \ rate limit of ... requests per second</td>\n </tr>\n <tr>\n <td><code>405</code></td>\n\ - \ <td><code>method-not-allowed</code></td>\n <td>This API endpoint can only\ - \ be accessed using the following HTTP methods: OPTIONS, POST</td>\n </tr>\n\ - </table>\n\n## Rate limiting\n<span id=\"/introduction/rate-limiting\"></span>\n\ - \nAll API endpoints limit the rate of requests in order to prevent overloading\ - \ of Apify servers by misbehaving clients.\n\nThere are two kinds of rate limits\ - \ - a global rate limit and a per-resource rate limit.\n\n### Global rate limit\n\ - <span id=\"/introduction/rate-limiting/global-rate-limit\"></span>\n\nThe global\ - \ rate limit is set to _250 000 requests per minute_.\nFor [authenticated](#/introduction/authentication)\ - \ requests, it is counted per user,\nand for unauthenticated requests, it is counted\ - \ per IP address.\n\n### Per-resource rate limit\n<span id=\"/introduction/rate-limiting/per-resource-rate-limit\"\ - ></span>\n\nThe default per-resource rate limit is _60 requests per second per\ - \ resource_, which in this context means a single Actor, a single Actor run, a\ - \ single dataset, single key-value store etc.\nThe default rate limit is applied\ - \ to every API endpoint except a few select ones, which have higher rate limits.\n\ - Each API endpoint returns its rate limit in `X-RateLimit-Limit` header.\n\nThese\ - \ endpoints have a rate limit of _200 requests per second per resource_:\n\n*\ - \ CRUD ([get](#/reference/key-value-stores/record/get-record),\n [put](#/reference/key-value-stores/record/put-record),\n\ - \ [delete](#/reference/key-value-stores/record/delete-record))\n operations\ - \ on key-value store records\n\nThese endpoints have a rate limit of _400 requests\ - \ per second per resource_:\n* [Run Actor](#/reference/actors/run-collection/run-actor)\n\ - * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously)\n\ - * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously)\n\ - * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run)\n* [Push\ - \ items](#/reference/datasets/item-collection/put-items) to dataset\n* CRUD\n\ - \ ([add](#/reference/request-queues/request-collection/add-request),\n [get](#/reference/request-queues/request-collection/get-request),\n\ - \ [update](#/reference/request-queues/request-collection/update-request),\n \ - \ [delete](#/reference/request-queues/request-collection/delete-request))\n operations\ - \ on requests in request queues\n\n### Rate limit exceeded errors\n<span id=\"\ - /introduction/rate-limiting/rate-limit-exceeded-errors\"></span>\n\nIf the client\ - \ is sending too many requests, the API endpoints respond with the HTTP status\ - \ code `429 Too Many Requests`\nand the following body:\n\n```\n{\n \"error\"\ - : {\n \"type\": \"rate-limit-exceeded\",\n \"message\": \"You have\ - \ exceeded the rate limit of ... requests per second\"\n }\n}\n```\n\n### Retrying\ - \ rate-limited requests with exponential backoff\n<span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"\ - ></span>\n\nIf the client receives the rate limit error, it should wait a certain\ - \ period of time and then retry the request.\nIf the error happens again, the\ - \ client should double the wait period and retry the request,\nand so on. This\ - \ algorithm is known as _exponential backoff_\nand it can be described using the\ - \ following pseudo-code:\n\n1. Define a variable `DELAY=500`\n2. Send the HTTP\ - \ request to the API endpoint\n3. If the response has status code not equal to\ - \ `429` then you are done. Otherwise:\n * Wait for a period of time chosen randomly\ - \ from the interval `DELAY` to `2*DELAY` milliseconds\n * Double the future\ - \ wait period by setting `DELAY = 2*DELAY`\n * Continue with step 2\n\nIf all\ - \ requests sent by the client implement the above steps,\nthe client will automatically\ - \ use the maximum available bandwidth for its requests.\n\nNote that the Apify\ - \ API clients [for JavaScript](https://docs.apify.com/api/client/js)\nand [for\ - \ Python](https://docs.apify.com/api/client/python)\nuse the exponential backoff\ - \ algorithm transparently, so that you do not need to worry about it.\n\n## Referring\ - \ to resources\n<span id=\"/introduction/referring-to-resources\"></span>\n\n\ - There are three main ways to refer to a resource you're accessing via API.\n\n\ - - the resource ID (e.g. `iKkPcIgVvwmztduf8`)\n- `username~resourcename` - when\ - \ using this access method, you will need to\nuse your API token, and access will\ - \ only work if you have the correct\npermissions.\n- `~resourcename` - for this,\ - \ you need to use an API token, and the\n`resourcename` refers to a resource in\ - \ the API token owner's account.\n" - license: - name: Apache 2.0 - url: https://www.apache.org/licenses/LICENSE-2.0.html - title: Apify API - version: v2-2026-06-16T064758Z -servers: -- url: https://api.apify.com -security: -- httpBearer: [] -- apiKey: [] -tags: -- description: | - The API endpoints in this section allow you to manage Apify Actors. For more details about Actors, refer to the [Actor documentation](https://docs.apify.com/platform/actors). - - For API endpoints that require the `actorId` parameter to identify an Actor, you can provide either: - - The Actor ID (e.g., `HG7ML7M8z78YcAPEB`), or - - A tilde-separated combination of the Actor owner's username and the Actor name (e.g., `janedoe~my-actor`). - name: Actors - x-displayName: Actors - Introduction - x-legacy-doc-urls: - - "#/reference/actors" - - "#tag/Actors" - - "#/reference/actors/actor-collection" - - "#tag/ActorsActor-collection" - - "#/reference/actors/actor-object" - - "#tag/ActorsActor-object" -- description: | - The API endpoints in this section allow you to manage your Apify Actors versions. - - - The version object contains the source code of a specific version of an Actor. - - The `sourceType` property indicates where the source code is hosted, and based - on its value the Version object has the following additional property: - - | **Value** | **Description** | - |---|---| - | `"SOURCE_FILES"` | Source code is comprised of multiple files specified in the `sourceFiles` array. Each item of the array is an object with the following fields:<br/> - `name`: File path and name<br/> - `format`: Format of the content, can be either `"TEXT"` or `"BASE64"`<br/> - `content`: File content<br/><br/>Source files can be shown and edited in the Apify Console's Web IDE. | - | `"GIT_REPO"` | Source code is cloned from a Git repository, whose URL is specified in the `gitRepoUrl` field. | - | `"TARBALL"` | Source code is downloaded using a tarball or Zip file from a URL specified in the `tarballUrl` field. | - |`"GITHUB_GIST"`| Source code is taken from a GitHub Gist, whose URL is specified in the `gitHubGistUrl` field. | - - For more information about source code and Actor versions, check out [Source code](https://docs.apify.com/platform/actors/development/actor-definition/source-code) - in Actors documentation. - name: Actors/Actor versions - x-displayName: Actor versions - Introduction - x-parent-tag-name: Actors - x-legacy-doc-urls: - - "#/reference/actors/version-collection" - - "#tag/ActorsVersion-collection" - - "#/reference/actors/version-object" - - "#tag/ActorsVersion-object" - - "#/reference/actors/environment-variable-collection" - - "#tag/ActorsEnvironment-variable-collection" - - "#/reference/actors/environment-variable-object" - - "#tag/ActorsEnvironment-variable-object" - x-trait: "true" -- description: | - The API endpoints in this section allow you to manage your Apify Actors builds. - name: Actors/Actor builds - x-displayName: Actor builds - Introduction - x-parent-tag-name: Actors - x-legacy-doc-urls: - - "#/reference/actors/build-collection" - - "#tag/ActorsBuild-collection" - - "#/reference/actors/build-object" - - "#tag/ActorsBuild-object" - - "#tag/ActorsAbort-build" - x-trait: "true" -- description: | - The API endpoints in this section allow you to manage your Apify Actors runs. - - Some API endpoints return run objects. If a run object includes usage costs in dollars, note that these values are calculated based on your effective unit pricing at the time of the query. As a result, the dollar amounts should be treated as informational only and not as exact figures. - - For completed runs, aggregated fields such as `stats` or dollar usage totals are eventually consistent and update within a few seconds. For values that must match finalized totals, wait about 10 seconds after the run completed, then fetch the run again. - - For more information about platform usage and resource calculations, see the [Usage and Resources documentation](https://docs.apify.com/platform/actors/running/usage-and-resources#usage). - name: Actors/Actor runs - x-displayName: Actor runs - Introduction - x-parent-tag-name: Actors - x-legacy-doc-urls: - - "#/reference/actors/run-collection" - - "#tag/ActorsRun-collection" - - "#tag/ActorsResurrect-run" - - "#tag/ActorsMetamorph-run" - - "#tag/ActorsAbort-run" - - "#/reference/actors/run-object" - - "#tag/ActorsRun-object" - - "#/reference/actors/run-actor-synchronously" - - "#tag/ActorsRun-actor-synchronously" - - "#/reference/actors/run-actor-synchronously-and-get-dataset-items" - - "#tag/ActorsRun-Actor-synchronously-and-get-dataset-items" - - "#/reference/actors/last-run-object-and-its-storages" - - "#tag/ActorsLast-run-object-and-its-storages" - x-trait: "true" -- description: | - The API endpoint in this section allows you to get a list of webhooks of a specific Actor. - name: Actors/Webhook collection - x-displayName: Webhook collection - Introduction - x-parent-tag-name: Actors - x-legacy-doc-urls: - - "#/reference/actors/webhook-collection" - - "#tag/ActorsWebhook-collection" - x-trait: "true" -- description: | - The API endpoints described in this section enable you to manage, and delete Apify Actor builds. - - Note that if any returned build object contains usage in dollars, your effective - unit pricing at the time of query has been used for computation of this dollar equivalent, and hence it should be - used only for informative purposes. - - You can learn more about platform usage in the [documentation](https://docs.apify.com/platform/actors/running/usage-and-resources#usage). - name: Actor builds - x-displayName: Actor builds - Introduction - x-legacy-doc-urls: - - "#/reference/actor-builds" - - "#tag/Actor-builds" - - "#/reference/actor-builds/build-collection" - - "#tag/Actor-buildsBuild-collection" - - "#/reference/actor-builds/build-object" - - "#tag/Actor-buildsBuild-object" - - "#tag/Actor-buildsDelete-build" - - "#tag/Actor-buildsAbort-build" - - "#/reference/actor-builds/build-log" - - "#tag/Actor-buildsBuild-log" -- description: | - The API endpoints described in this section enable you to manage, and delete Apify Actor runs. - - If any returned run object contains usage in dollars, your effective unit pricing at the time of query - has been used for computation of this dollar equivalent, and hence it should be used only for informative purposes. - - For completed runs, aggregated fields such as `stats` or dollar usage totals are eventually consistent and update within a few seconds. For values that must match finalized totals, wait about 10 seconds after the run completed, then fetch the run again. - - You can learn more about platform usage in the [documentation](https://docs.apify.com/platform/actors/running/usage-and-resources#usage). - name: Actor runs - x-displayName: Actor runs - Introduction - x-legacy-doc-urls: - - "#/reference/actor-runs" - - "#tag/Actor-runs" - - "#/reference/actor-runs/run-collection" - - "#tag/Actor-runsRun-collection" - - "#/reference/actor-runs/run-object-and-its-storages" - - "#tag/Actor-runsRun-object-and-its-storages" -- description: | - The API endpoints described in this section enable you to create, manage, delete, and run Apify Actor tasks. - For more information, see the [Actor tasts documentation](https://docs.apify.com/platform/actors/running/tasks). - - :::note - - For all the API endpoints that accept the `actorTaskId` parameter to - specify a task, you can pass either the task ID (e.g. `HG7ML7M8z78YcAPEB`) or a tilde-separated - username of the task's owner and the task's name (e.g. `janedoe~my-task`). - - ::: - - Some of the API endpoints return run objects. If any such run object - contains usage in dollars, your effective unit pricing at the time of query - has been used for computation of this dollar equivalent, and hence it should be - used only for informative purposes. - - You can learn more about platform usage in the [documentation](https://docs.apify.com/platform/actors/running/usage-and-resources#usage). - name: Actor tasks - x-displayName: Actor tasks - Introduction - x-legacy-doc-urls: - - "#/reference/actor-tasks" - - "#tag/Actor-tasks" - - "#/reference/actor-tasks/task-collection" - - "#tag/Actor-tasksTask-collection" - - "#/reference/actor-tasks/task-object" - - "#tag/Actor-tasksTask-object" - - "#/reference/actor-tasks/task-input-object" - - "#tag/Actor-tasksTask-input-object" - - "#/reference/actor-tasks/webhook-collection" - - "#tag/Actor-tasksWebhook-collection" - - "#/reference/actor-tasks/run-collection" - - "#tag/Actor-tasksRun-collection" - - "#/reference/actor-tasks/run-task-synchronously" - - "#tag/Actor-tasksRun-task-synchronously" - - "#/reference/actor-tasks/run-task-synchronously-and-get-dataset-items" - - "#tag/Actor-tasksRun-task-synchronously-and-get-dataset-items" - - "#/reference/actor-tasks/last-run-object-and-its-storages" - - "#tag/Actor-tasksLast-run-object-and-its-storages" -- description: "Storage-related API endpoints for managing datasets, key-value stores,\ - \ and request queues." - name: Storage - x-displayName: "" -- description: | - This section describes API endpoints to manage Datasets. - - Dataset is a storage for structured data, where each record stored has the same attributes, - such as online store products or real estate offers. You can imagine it as a table, - where each object is a row and its attributes are columns. Dataset is an append-only - storage - you can only add new records to it but you cannot modify or remove existing - records. Typically it is used to store crawling results. - - For more information, see the [Datasets documentation](https://docs.apify.com/platform/storage/dataset). - - :::note - - Some of the endpoints do not require the authentication token, the calls - are authenticated using the hard-to-guess ID of the dataset. - - ::: - name: Storage/Datasets - x-displayName: Datasets - Introduction - x-parent-tag-name: Storage - x-legacy-doc-urls: - - "#/reference/datasets" - - "#tag/Datasets" - - "#/reference/datasets/dataset-collection" - - "#tag/DatasetsDataset-collection" - - "#/reference/datasets/dataset" - - "#tag/DatasetsDataset" - - "#/reference/datasets/item-collection" - - "#tag/DatasetsItem-collection" - x-trait: "true" -- description: | - This section describes API endpoints to manage Key-value stores. - Key-value store is a simple storage for saving and reading data records or files. - Each data record is represented by a unique key and associated with a MIME content type. - Key-value stores are ideal for saving screenshots, Actor inputs and outputs, web pages, - PDFs or to persist the state of crawlers. - - For more information, see the [Key-value store documentation](https://docs.apify.com/platform/storage/key-value-store). - - :::note - - Some of the endpoints do not require the authentication token, the calls - are authenticated using a hard-to-guess ID of the key-value store. - - ::: - name: Storage/Key-value stores - x-displayName: Key-value stores - Introduction - x-parent-tag-name: Storage - x-legacy-doc-urls: - - "#/reference/key-value-stores/key-collection" - - "#tag/Key-value-storesKey-collection" - - "#/reference/key-value-stores/store-collection" - - "#tag/Key-value-storesStore-collection" - - "#/reference/key-value-stores/store-object" - - "#tag/Key-value-storesStore-object" - - "#/reference/key-value-stores/record" - - "#tag/Key-value-storesRecord" - - "#/reference/key-value-stores" - - "#tag/Key-value-stores" - x-trait: "true" -- description: | - This section describes API endpoints to create, manage, and delete request queues. - - Request queue is a storage for a queue of HTTP URLs to crawl, which is typically - used for deep crawling of websites where you - start with several URLs and then recursively follow links to other pages. - The storage supports both breadth-first and depth-first crawling orders. - - For more information, see the [Request queue documentation](https://docs.apify.com/platform/storage/request-queue). - - :::note - - Some of the endpoints do not require the authentication token, the calls - are authenticated using the hard-to-guess ID of the queue. - - ::: - name: Storage/Request queues - x-displayName: Request queues - Introduction - x-parent-tag-name: Storage - x-legacy-doc-urls: - - "#/reference/request-queues" - - "#tag/Request-queues" - - "#/reference/request-queues/queue-collection" - - "#tag/Request-queuesQueue-collection" - - "#/reference/request-queues/queue" - - "#tag/Request-queuesQueue" - - "#/reference/request-queues/batch-request-operations" - - "#tag/Request-queuesBatch-request-operations" -- description: | - This section describes API endpoints to create, manage, and delete requests within request queues. - - Request queue is a storage for a queue of HTTP URLs to crawl, which is typically - used for deep crawling of websites where you - start with several URLs and then recursively follow links to other pages. - The storage supports both breadth-first and depth-first crawling orders. - - For more information, see the [Request queue documentation](https://docs.apify.com/platform/storage/request-queue). - - :::note - - Some of the endpoints do not require the authentication token, the calls - are authenticated using the hard-to-guess ID of the queue. - - ::: - name: Storage/Request queues/Requests - x-displayName: Requests - Introduction - x-parent-tag-name: Storage - x-legacy-doc-urls: - - "#/reference/request-queues/request-collection" - - "#tag/Request-queuesRequest-collection" - - "#/reference/request-queues/request" - - "#tag/Request-queuesRequest" -- description: | - This section describes API endpoints to create, manage, and delete request locks within request queues. - - Request queue is a storage for a queue of HTTP URLs to crawl, which is typically - used for deep crawling of websites where you - start with several URLs and then recursively follow links to other pages. - The storage supports both breadth-first and depth-first crawling orders. - - For more information, see the [Request queue documentation](https://docs.apify.com/platform/storage/request-queue). - - :::note - - Some of the endpoints do not require the authentication token, the calls - are authenticated using the hard-to-guess ID of the queue. - - ::: - name: Storage/Request queues/Requests locks - x-displayName: Requests locks - Introduction - x-parent-tag-name: Storage - x-legacy-doc-urls: - - "#/reference/request-queues/request-lock" - - "#tag/Request-queuesRequest-lock" - - "#/reference/request-queues/queue-head" - - "#tag/Request-queuesQueue-head" - - "#/reference/request-queues/queue-head-with-locks" - - "#tag/Request-queuesQueue-head-with-locks" -- description: Webhook-related API endpoints for configuring automated notifications. - name: Webhooks - x-displayName: "" -- description: | - This section describes API endpoints to manage webhooks. - - Webhooks provide an easy and reliable way to configure the Apify platform - to carry out an action (e.g. a HTTP request to another service) when a certain - system event occurs. - For example, you can use webhooks to start another Actor when an Actor run finishes - or fails. - - For more information see [Webhooks documentation](https://docs.apify.com/platform/integrations/webhooks). - name: Webhooks/Webhooks - x-displayName: Webhooks - Introduction - x-parent-tag-name: Webhooks - x-legacy-doc-urls: - - "#/reference/webhooks" - - "#tag/Webhooks" - - "#/reference/webhooks/webhook-collection" - - "#tag/WebhooksWebhook-collection" - - "#/reference/webhooks/webhook-object" - - "#tag/WebhooksWebhook-object" - - "#/reference/webhooks/webhook-test" - - "#tag/WebhooksWebhook-test" - - "#/reference/webhooks/dispatches-collection" - - "#tag/WebhooksDispatches-collection" -- description: This section describes API endpoints to get webhook dispatches. - name: Webhooks/Webhook dispatches - x-displayName: Webhook dispatches - Introduction - x-parent-tag-name: Webhooks - x-legacy-doc-urls: - - "#/reference/webhook-dispatches" - - "#tag/Webhook-dispatches" - - "#/reference/webhook-dispatches/webhook-dispatches-collection" - - "#tag/Webhook-dispatchesWebhook-dispatches-collection" - - "#/reference/webhook-dispatches/webhook-dispatch-object" - - "#tag/Webhook-dispatchesWebhook-dispatch-object" -- description: | - This section describes API endpoints for managing schedules. - - Schedules are used to automatically start your Actors at certain times. Each schedule - can be associated with a number of Actors and Actor tasks. It is also possible - to override the settings of each Actor (task) similarly to when invoking the Actor - (task) using the API. - For more information, see [Schedules documentation](https://docs.apify.com/platform/schedules). - - Each schedule is assigned actions for it to perform. Actions can be of two types - - `RUN_ACTOR` and `RUN_ACTOR_TASK`. - - For details, see the documentation of the [Get schedule](#/reference/schedules/schedule-object/get-schedule) endpoint. - name: Schedules - x-displayName: Schedules - Introduction - x-legacy-doc-urls: - - "#/reference/schedules" - - "#tag/Schedules" - - "#/reference/schedules/schedules-collection" - - "#tag/SchedulesSchedules-collection" - - "#/reference/schedules/schedule-object" - - "#tag/SchedulesSchedule-object" - - "#/reference/schedules/schedule-log" - - "#tag/SchedulesSchedule-log" - x-trait: "true" -- description: | - [Apify Store](https://apify.com/store) is home to thousands of public Actors available - to the Apify community. - The API endpoints described in this section are used to retrieve these Actors. - - :::note - - These endpoints do not require the authentication token. - - ::: - name: Store - x-displayName: Store - Introduction - x-legacy-doc-urls: - - "#/reference/store" - - "#tag/Store" - - "#/reference/store/store-actors-collection" - - "#tag/StoreStore-Actors-collection" - x-trait: true -- description: | - The API endpoints described in this section are used the download the logs - generated by Actor builds and runs. Note that only the trailing 5M characters - of the log are stored, the rest is discarded. - - :::note - - Note that the endpoints do not require the authentication token, the calls - are authenticated using a hard-to-guess ID of the Actor build or run. - - ::: - name: Logs - x-displayName: Logs - Introduction - x-legacy-doc-urls: - - "#/reference/logs" - - "#tag/Logs" - - "#/reference/logs/log" - - "#tag/LogsLog" - x-trait: true -- description: The API endpoints described in this section return information about - user accounts. - name: Users - x-displayName: Users - Introduction - x-legacy-doc-urls: - - "#/reference/users" - - "#tag/Users" - - "#/reference/users/public-data" - - "#tag/UsersPublic-data" - - "#/reference/users/private-data" - - "#tag/UsersPrivate-data" - - "#/reference/users/monthly-usage" - - "#tag/UsersMonthly-usage" - - "#/reference/users/account-and-usage-limits" - - "#tag/UsersAccount-and-usage-limits" - x-trait: true -- description: | - The API endpoints described in this section provide utility tools for encoding, - signing, and verifying data, as well as inspecting HTTP request details. - name: Tools - x-displayName: Tools - Introduction -- description: | - The API endpoints described in this section are convenience endpoints that provide access to Actor run's default dataset without the need to resolve the dataset ID first. - - Subset of functionality described in: [Datasets](/api/v2/storage-datasets) - name: Default dataset - x-displayName: Default dataset - Introduction -- description: | - The API endpoints described in this section are convenience endpoints that provide access to Actor run's default key-value store without the need to resolve the key-value store ID first. - - Subset of functionality described in: [Key-value stores](/api/v2/storage-key-value-stores) - name: Default key-value store - x-displayName: Default key-value store - Introduction -- description: | - The API endpoints described in this section are convenience endpoints that provide access to Actor run's default request queue without the need to resolve the request queue ID first. - - Subset of functionality described in: [Request queues](/api/v2/storage-request-queues) - name: Default request queue - x-displayName: Default request queue - Introduction -- description: | - The API endpoints described in this section are convenience endpoints that provide access to Actor's last run's default dataset without the need to resolve the dataset ID first. - - Subset of functionality described in: [Datasets](/api/v2/storage-datasets) - name: Last Actor run's default dataset - x-displayName: Last Actor run's default dataset - Introduction -- description: | - The API endpoints described in this section are convenience endpoints that provide access to Actor's last run's default key-value store without the need to resolve the key-value store ID first. - - Subset of functionality described in: [Key-value stores](/api/v2/storage-key-value-stores) - name: Last Actor run's default key-value store - x-displayName: Last Actor run's default key-value store - Introduction -- description: | - The API endpoints described in this section are convenience endpoints that provide access to Actor's last run's default request queue without the need to resolve the request queue ID first. - - Subset of functionality described in: [Request queues](/api/v2/storage-request-queues) - name: Last Actor run's default request queue - x-displayName: Last Actor run's default request queue - Introduction -- description: | - The API endpoint described in this section is convenience endpoint that provides access to last Actor run's log. - - Same as of functionality described in: [Logs](/api/v2/logs) - name: Last Actor run's log - x-displayName: Last Actor run's log - Introduction -- description: | - The API endpoint described in this section is a convenience endpoint that aborts the Actor's last run. - - Same as of functionality described in: [Abort run](/api/v2/actor-run-abort-post) - name: Last Actor run's abort - x-displayName: Last Actor run's abort - Introduction -- description: | - The API endpoint described in this section is a convenience endpoint that metamorphs the Actor's last run into a run of another Actor. - - Same as of functionality described in: [Metamorph run](/api/v2/actor-run-metamorph-post) - name: Last Actor run's metamorph - x-displayName: Last Actor run's metamorph - Introduction -- description: | - The API endpoint described in this section is a convenience endpoint that reboots the Actor's last run. - - Same as of functionality described in: [Reboot run](/api/v2/actor-run-reboot-post) - name: Last Actor run's reboot - x-displayName: Last Actor run's reboot - Introduction -- description: | - The API endpoint described in this section is convenience endpoint that provides access to last Actor task run's log. - - Same as of functionality described in: [Logs](/api/v2/logs) - name: Last Actor task run's log - x-displayName: Last Actor task run's log - Introduction -- description: | - The API endpoint described in this section is a convenience endpoint that aborts the Actor task's last run. - - Same as of functionality described in: [Abort run](/api/v2/actor-run-abort-post) - name: Last Actor task run's abort - x-displayName: Last Actor task run's abort - Introduction -- description: | - The API endpoint described in this section is a convenience endpoint that metamorphs the Actor task's last run into a run of another Actor. - - Same as of functionality described in: [Metamorph run](/api/v2/actor-run-metamorph-post) - name: Last Actor task run's metamorph - x-displayName: Last Actor task run's metamorph - Introduction -- description: | - The API endpoint described in this section is a convenience endpoint that reboots the Actor task's last run. - - Same as of functionality described in: [Reboot run](/api/v2/actor-run-reboot-post) - name: Last Actor task run's reboot - x-displayName: Last Actor task run's reboot - Introduction -- description: | - The API endpoints described in this section are convenience endpoints that provide access to Actor task's last run's default dataset without the need to resolve the dataset ID first. - - Subset of functionality described in: [Datasets](/api/v2/storage-datasets) - name: Last Actor task run's default dataset - x-displayName: Last Actor task run's default dataset - Introduction -- description: | - The API endpoints described in this section are convenience endpoints that provide access to Actor task's last run's default key-value store without the need to resolve the key-value store ID first. - - Subset of functionality described in: [Key-value stores](/api/v2/storage-key-value-stores) - name: Last Actor task run's default key-value store - x-displayName: Last Actor task run's default key-value store - Introduction -- description: | - The API endpoints described in this section are convenience endpoints that provide access to Actor task's last run's default request queue without the need to resolve the request queue ID first. - - Subset of functionality described in: [Request queues](/api/v2/storage-request-queues) - name: Last Actor task run's default request queue - x-displayName: Last Actor task run's default request queue - Introduction -paths: - /v2/actors: - get: - deprecated: false - description: | - Gets the list of all Actors that the user created or used. The response is a - list of objects, where each object contains a basic information about a single Actor. - - To only get Actors created by the user, add the `my=1` query parameter. - - The endpoint supports pagination using the `limit` and `offset` parameters - and it will not return more than 1000 records. - - By default, the records are sorted by the `createdAt` field in ascending - order, therefore you can use pagination to incrementally fetch all Actors while new - ones are still being created. To sort the records in descending order, use the `desc=1` parameter. - - You can also sort by your last run by using the `sortBy=stats.lastRunStartedAt` query parameter. - In this case, descending order means the most recently run Actor appears first. - operationId: acts_get - parameters: - - description: | - If `true` or `1` then the returned list only contains Actors owned by the user. The default value is `false`. - explode: true - in: query - name: my - required: false - schema: - example: true - type: boolean - style: form - - $ref: "#/components/parameters/offset" - - $ref: "#/components/parameters/limit" - - $ref: "#/components/parameters/descCreatedAt" - - description: | - Field to sort the records by. The default is `createdAt`. You can also use `stats.lastRunStartedAt` to sort - by the most recently ran Actors. - explode: true - in: query - name: sortBy - required: false - schema: - enum: - - createdAt - - stats.lastRunStartedAt - example: createdAt - type: string - style: form - responses: - "200": - content: - application/json: - example: - data: - total: 2 - count: 2 - offset: 0 - limit: 1000 - desc: false - items: - - id: br9CKmk457 - createdAt: 2019-10-29T07:34:24.202Z - modifiedAt: 2019-10-30T07:34:24.202Z - name: MyAct - username: janedoe - - id: ksiEKo23pz - createdAt: 2019-11-30T07:34:24.202Z - modifiedAt: 2019-12-12T07:34:24.202Z - name: MySecondAct - username: janedoe - schema: - $ref: "#/components/schemas/ListOfActorsResponse" - description: "" - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Get list of Actors - tags: - - Actors - x-legacy-doc-urls: - - https://docs.apify.com/api/v2#/reference/actors/actor-collection/get-list-of-actors - - https://docs.apify.com/api/v2#/reference/actors/get-list-of-actors - - https://docs.apify.com/api/v2#tag/ActorsActor-collection/operation/acts_get - x-js-parent: ActorCollectionClient - x-js-name: list - x-js-doc-url: https://docs.apify.com/api/client/js/reference/class/ActorCollectionClient#list - x-py-parent: ActorCollectionClientAsync - x-py-name: list - x-py-doc-url: https://docs.apify.com/api/client/python/reference/class/ActorCollectionClientAsync#list - post: - deprecated: false - description: | - Creates a new Actor with settings specified in an Actor object passed as - JSON in the POST payload. - The response is the full Actor object as returned by the - [Get Actor](#/reference/actors/actor-object/get-actor) endpoint. - - The HTTP request must have the `Content-Type: application/json` HTTP header! - - The Actor needs to define at least one version of the source code. - For more information, see [Version object](#/reference/actors/version-object). - - If you want to make your Actor - [public](https://docs.apify.com/platform/actors/publishing) using `isPublic: - true`, you will need to provide the Actor's `title` and the `categories` - under which that Actor will be classified in Apify Store. For this, it's - best to use the [constants from our `apify-shared-js` - package](https://github.com/apify/apify-shared-js/blob/2d43ebc41ece9ad31cd6525bd523fb86939bf860/packages/consts/src/consts.ts#L452-L471). - operationId: acts_post - requestBody: - content: - application/json: - example: - name: MyActor - description: My favourite Actor! - title: My Actor - isPublic: false - seoTitle: My Actor - seoDescription: My Actor is the best - versions: - - versionNumber: "0.0" - sourceType: SOURCE_FILES - envVars: - - name: DOMAIN - value: http://example.com - isSecret: false - - name: SECRET_PASSWORD - value: MyTopSecretPassword123 - isSecret: true - applyEnvVarsToBuild: false - buildTag: latest - sourceFiles: [] - categories: [] - defaultRunOptions: - build: latest - timeoutSecs: 3600 - memoryMbytes: 2048 - restartOnError: false - schema: - $ref: "#/components/schemas/CreateActorRequest" - description: "" - required: true - responses: - "201": - content: - application/json: - example: - data: - id: zdc3Pyhyz3m8vjDeM - userId: wRsJZtadYvn4mBZmm - name: MyActor - username: jane35 - description: My favourite Actor! - isPublic: false - createdAt: 2019-07-08T11:27:57.401Z - modifiedAt: 2019-07-08T14:01:05.546Z - stats: - totalBuilds: 9 - totalRuns: 16 - totalUsers: 6 - totalUsers7Days: 2 - totalUsers30Days: 6 - totalUsers90Days: 6 - totalMetamorphs: 2 - lastRunStartedAt: 2019-07-08T14:01:05.546Z - versions: - - versionNumber: "0.1" - envVars: null - sourceType: SOURCE_FILES - applyEnvVarsToBuild: false - buildTag: latest - sourceFiles: [] - - versionNumber: "0.2" - sourceType: GIT_REPO - envVars: null - applyEnvVarsToBuild: false - buildTag: latest - gitRepoUrl: https://github.com/jane35/my-actor - - versionNumber: "0.3" - sourceType: TARBALL - envVars: null - applyEnvVarsToBuild: false - buildTag: latest - tarballUrl: https://github.com/jane35/my-actor/archive/master.zip - - versionNumber: "0.4" - sourceType: GITHUB_GIST - envVars: null - applyEnvVarsToBuild: false - buildTag: latest - gitHubGistUrl: https://gist.github.com/jane35/e51feb784yu89 - defaultRunOptions: - build: latest - timeoutSecs: 3600 - memoryMbytes: 2048 - restartOnError: false - exampleRunInput: - body: "{ \"helloWorld\": 123 }" - contentType: application/json; charset=utf-8 - isDeprecated: false - deploymentKey: ssh-rsa AAAA ... - title: My Actor - taggedBuilds: - latest: - buildId: z2EryhbfhgSyqj6Hn - buildNumber: 0.0.2 - finishedAt: 2019-06-10T11:15:49.286Z - schema: - $ref: "#/components/schemas/ActorResponse" - description: "" - headers: - Location: - content: - text/plain: - example: https://api.apify.com/v2/actors/zdc3Pyhyz3m8vjDeM - schema: - type: string - explode: false - style: simple - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "413": - $ref: "#/components/responses/PayloadTooLarge" - "415": - $ref: "#/components/responses/UnsupportedMediaType" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Create Actor - tags: - - Actors - x-legacy-doc-urls: - - https://docs.apify.com/api/v2#/reference/actors/actor-collection/create-actor - - https://docs.apify.com/api/v2#/reference/actors/create-actor - - https://docs.apify.com/api/v2#tag/ActorsActor-collection/operation/acts_post - x-js-parent: ActorCollectionClient - x-js-name: create - x-js-doc-url: https://docs.apify.com/api/client/js/reference/class/ActorCollectionClient#create - x-py-parent: ActorCollectionClientAsync - x-py-name: create - x-py-doc-url: https://docs.apify.com/api/client/python/reference/class/ActorCollectionClientAsync#create - /v2/actors/{actorId}: - delete: - deprecated: false - description: Deletes an Actor. - operationId: act_delete - parameters: - - $ref: "#/components/parameters/actorId" - responses: - "204": - content: - application/json: - example: {} - schema: - example: {} - type: object - description: "" - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Delete Actor - tags: - - Actors - x-legacy-doc-urls: - - https://docs.apify.com/api/v2#/reference/actors/actor-object/delete-actor - - https://docs.apify.com/api/v2#/reference/actors/delete-actor - - https://docs.apify.com/api/v2#tag/ActorsActor-object/operation/act_delete - x-js-parent: ActorClient - x-js-name: delete - x-js-doc-url: https://docs.apify.com/api/client/js/reference/class/ActorClient#delete - get: - deprecated: false - description: Gets an object that contains all the details about a specific Actor. - operationId: act_get - parameters: - - $ref: "#/components/parameters/actorId" - responses: - "200": - content: - application/json: - example: - data: - id: zdc3Pyhyz3m8vjDeM - userId: wRsJZtadYvn4mBZmm - name: MyActor - username: jane35 - description: My favourite Actor! - isPublic: false - createdAt: 2019-07-08T11:27:57.401Z - modifiedAt: 2019-07-08T14:01:05.546Z - stats: - totalBuilds: 9 - totalRuns: 16 - totalUsers: 6 - totalUsers7Days: 2 - totalUsers30Days: 6 - totalUsers90Days: 6 - totalMetamorphs: 2 - lastRunStartedAt: 2019-07-08T14:01:05.546Z - versions: - - versionNumber: "0.1" - envVars: null - sourceType: SOURCE_FILES - applyEnvVarsToBuild: false - buildTag: latest - sourceFiles: [] - - versionNumber: "0.2" - sourceType: GIT_REPO - envVars: null - applyEnvVarsToBuild: false - buildTag: latest - gitRepoUrl: https://github.com/jane35/my-actor - - versionNumber: "0.3" - sourceType: TARBALL - envVars: null - applyEnvVarsToBuild: false - buildTag: latest - tarballUrl: https://github.com/jane35/my-actor/archive/master.zip - - versionNumber: "0.4" - sourceType: GITHUB_GIST - envVars: null - applyEnvVarsToBuild: false - buildTag: latest - gitHubGistUrl: https://gist.github.com/jane35/e51feb784yu89 - defaultRunOptions: - build: latest - timeoutSecs: 3600 - memoryMbytes: 2048 - restartOnError: false - exampleRunInput: - body: "{ \"helloWorld\": 123 }" - contentType: application/json; charset=utf-8 - isDeprecated: false - deploymentKey: ssh-rsa AAAA ... - title: My Actor - taggedBuilds: - latest: - buildId: z2EryhbfhgSyqj6Hn - buildNumber: 0.0.2 - finishedAt: 2019-06-10T11:15:49.286Z - schema: - $ref: "#/components/schemas/ActorResponse" - description: "" - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Get Actor - tags: - - Actors - x-legacy-doc-urls: - - https://docs.apify.com/api/v2#/reference/actors/actor-object/get-actor - - https://docs.apify.com/api/v2#/reference/actors/get-actor - - https://docs.apify.com/api/v2#tag/ActorsActor-object/operation/act_get - x-js-parent: ActorClient - x-js-name: get - x-js-doc-url: https://docs.apify.com/api/client/js/reference/class/ActorClient#get - x-py-parent: ActorClientAsync - x-py-name: get - x-py-doc-url: https://docs.apify.com/api/client/python/reference/class/ActorClientAsync#get - put: - deprecated: false - description: | - Updates settings of an Actor using values specified by an Actor object - passed as JSON in the POST payload. - If the object does not define a specific property, its value will not be - updated. - - The response is the full Actor object as returned by the - [Get Actor](#/reference/actors/actor-object/get-actor) endpoint. - - The request needs to specify the `Content-Type: application/json` HTTP header! - - When providing your API authentication token, we recommend using the - request's `Authorization` header, rather than the URL. ([More - info](#/introduction/authentication)). - - If you want to make your Actor - [public](https://docs.apify.com/platform/actors/publishing) using `isPublic: - true`, you will need to provide the Actor's `title` and the `categories` - under which that Actor will be classified in Apify Store. For this, it's - best to use the [constants from our `apify-shared-js` - package](https://github.com/apify/apify-shared-js/blob/2d43ebc41ece9ad31cd6525bd523fb86939bf860/packages/consts/src/consts.ts#L452-L471). - operationId: act_put - parameters: - - $ref: "#/components/parameters/actorId" - requestBody: - content: - application/json: - examples: - common: - summary: Common example - value: - name: MyActor - description: My favourite Actor! - isPublic: false - actorPermissionLevel: LIMITED_PERMISSIONS - seoTitle: My Actor - seoDescription: My Actor is the best - title: My Actor - versions: - - versionNumber: "0.0" - sourceType: SOURCE_FILES - envVars: - - name: DOMAIN - value: http://example.com - isSecret: false - - name: SECRET_PASSWORD - value: MyTopSecretPassword123 - isSecret: true - applyEnvVarsToBuild: false - buildTag: latest - sourceFiles: [] - categories: [] - defaultRunOptions: - build: latest - timeoutSecs: 3600 - memoryMbytes: 2048 - restartOnError: false - taggedBuildsCreateOrReassignTag: - summary: Create or reassign a build tag - value: - name: MyActor - isPublic: false - versions: [] - taggedBuilds: - latest: - buildId: z2EryhbfhgSyqj6Hn - taggedBuildsRemoveTag: - summary: Remove a build tag - value: - name: MyActor - isPublic: false - versions: [] - taggedBuilds: - latest: null - taggedBuildsMultipleOperations: - summary: Update multiple build tags at once - value: - name: MyActor - isPublic: false - versions: [] - taggedBuilds: - latest: - buildId: z2EryhbfhgSyqj6Hn - beta: null - schema: - $ref: "#/components/schemas/UpdateActorRequest" - description: "" - required: true - responses: - "200": - content: - application/json: - example: - data: - id: zdc3Pyhyz3m8vjDeM - userId: wRsJZtadYvn4mBZmm - name: MyActor - username: jane35 - description: My favourite Actor! - isPublic: false - actorPermissionLevel: LIMITED_PERMISSIONS - createdAt: 2019-07-08T11:27:57.401Z - modifiedAt: 2019-07-08T14:01:05.546Z - stats: - totalBuilds: 9 - totalRuns: 16 - totalUsers: 6 - totalUsers7Days: 2 - totalUsers30Days: 6 - totalUsers90Days: 6 - totalMetamorphs: 2 - lastRunStartedAt: 2019-07-08T14:01:05.546Z - versions: - - versionNumber: "0.1" - envVars: null - sourceType: SOURCE_FILES - applyEnvVarsToBuild: false - buildTag: latest - sourceFiles: [] - - versionNumber: "0.2" - sourceType: GIT_REPO - envVars: null - applyEnvVarsToBuild: false - buildTag: latest - gitRepoUrl: https://github.com/jane35/my-actor - - versionNumber: "0.3" - sourceType: TARBALL - envVars: null - applyEnvVarsToBuild: false - buildTag: latest - tarballUrl: https://github.com/jane35/my-actor/archive/master.zip - - versionNumber: "0.4" - sourceType: GITHUB_GIST - envVars: null - applyEnvVarsToBuild: false - buildTag: latest - gitHubGistUrl: https://gist.github.com/jane35/e51feb784yu89 - defaultRunOptions: - build: latest - timeoutSecs: 3600 - memoryMbytes: 2048 - restartOnError: false - exampleRunInput: - body: "{ \"helloWorld\": 123 }" - contentType: application/json; charset=utf-8 - isDeprecated: false - deploymentKey: ssh-rsa AAAA ... - title: My Actor - taggedBuilds: - latest: - buildId: z2EryhbfhgSyqj6Hn - buildNumber: 0.0.2 - finishedAt: 2019-06-10T11:15:49.286Z - schema: - $ref: "#/components/schemas/ActorResponse" - description: "" - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "413": - $ref: "#/components/responses/PayloadTooLarge" - "415": - $ref: "#/components/responses/UnsupportedMediaType" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Update Actor - tags: - - Actors - x-legacy-doc-urls: - - https://docs.apify.com/api/v2#/reference/actors/actor-object/update-actor - - https://docs.apify.com/api/v2#/reference/actors/update-actor - - https://docs.apify.com/api/v2#tag/ActorsActor-object/operation/act_put - x-js-parent: ActorClient - x-js-name: update - x-js-doc-url: https://docs.apify.com/api/client/js/reference/class/ActorClient#update - x-py-parent: ActorClientAsync - x-py-name: update - x-py-doc-url: https://docs.apify.com/api/client/python/reference/class/ActorClientAsync#update - /v2/actors/{actorId}/versions: - get: - deprecated: false - description: | - Gets the list of versions of a specific Actor. The response is a JSON object - with the list of [Version objects](#/reference/actors/version-object), where each - contains basic information about a single version. - operationId: act_versions_get - parameters: - - $ref: "#/components/parameters/actorId" - responses: - "200": - content: - application/json: - example: - data: - total: 5 - items: - - versionNumber: "0.1" - envVars: null - sourceType: SOURCE_FILES - applyEnvVarsToBuild: false - buildTag: latest - sourceFiles: [] - - versionNumber: "0.2" - sourceType: GIT_REPO - envVars: null - applyEnvVarsToBuild: false - buildTag: latest - gitRepoUrl: https://github.com/jane35/my-actor - - versionNumber: "0.3" - sourceType: TARBALL - envVars: null - applyEnvVarsToBuild: false - buildTag: latest - tarballUrl: https://github.com/jane35/my-actor/archive/master.zip - - versionNumber: "0.4" - sourceType: GITHUB_GIST - envVars: null - applyEnvVarsToBuild: false - buildTag: latest - gitHubGistUrl: https://gist.github.com/jane35/e51feb784yu89 - schema: - $ref: "#/components/schemas/ListOfVersionsResponse" - description: "" - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Get list of versions - tags: - - Actors/Actor versions - x-legacy-doc-urls: - - https://docs.apify.com/api/v2#/reference/actors/version-collection/get-list-of-versions - - https://docs.apify.com/api/v2#/reference/actors/get-list-of-versions - - https://docs.apify.com/api/v2#tag/ActorsVersion-collection/operation/act_versions_get - x-py-parent: ActorVersionCollectionClientAsync - x-py-name: list - x-py-doc-url: https://docs.apify.com/api/client/python/reference/class/ActorVersionCollectionClientAsync#list - post: - deprecated: false - description: | - Creates a version of an Actor using values specified in a [Version - object](#/reference/actors/version-object) passed as JSON in the POST - payload. - - The request must specify `versionNumber` and `sourceType` parameters (as - strings) in the JSON payload and a `Content-Type: application/json` HTTP - header. - - Each `sourceType` requires its own additional properties to be passed to the - JSON payload object. These are outlined in the [Version - object](#/reference/actors/version-object) table below and in more detail in - the [Apify - documentation](https://docs.apify.com/platform/actors/development/deployment/source-types). - - For example, if an Actor's source code is stored in a [GitHub - repository](https://docs.apify.com/platform/actors/development/deployment/source-types#git-repository), - you will set the `sourceType` to `GIT_REPO` and pass the repository's URL in - the `gitRepoUrl` property. - - ``` - { - "versionNumber": "0.1", - "sourceType": "GIT_REPO", - "gitRepoUrl": "https://github.com/my-github-account/actor-repo" - } - ``` - - The response is the [Version object](#/reference/actors/version-object) as - returned by the [Get version](#/reference/actors/version-object/get-version) endpoint. - operationId: act_versions_post - parameters: - - $ref: "#/components/parameters/actorId" - requestBody: - content: - application/json: - example: - versionNumber: "0.1" - sourceType: GIT_REPO - gitRepoUrl: https://github.com/my-github-account/actor-repo - schema: - $ref: "#/components/schemas/CreateOrUpdateVersionRequest" - description: "" - required: true - responses: - "201": - content: - application/json: - schema: - $ref: "#/components/schemas/VersionResponse" - description: "" - headers: - Location: - content: - text/plain: - example: https://api.apify.com/v2/actors/zdc3Pyhyz3m8vjDeM/versions/0.0 - schema: - type: string - explode: false - style: simple - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "413": - $ref: "#/components/responses/PayloadTooLarge" - "415": - $ref: "#/components/responses/UnsupportedMediaType" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Create version - tags: - - Actors/Actor versions - x-legacy-doc-urls: - - https://docs.apify.com/api/v2#/reference/actors/version-collection/create-version - - https://docs.apify.com/api/v2#/reference/actors/create-version - - https://docs.apify.com/api/v2#tag/ActorsVersion-collection/operation/act_versions_post - x-py-parent: ActorVersionCollectionClientAsync - x-py-name: create - x-py-doc-url: https://docs.apify.com/api/client/python/reference/class/ActorVersionCollectionClientAsync#create - /v2/actors/{actorId}/versions/{versionNumber}: - delete: - deprecated: false - description: | - Deletes a specific version of Actor's source code. - operationId: act_version_delete - parameters: - - $ref: "#/components/parameters/actorId" - - $ref: "#/components/parameters/versionNumber" - responses: - "204": - content: - application/json: - example: {} - schema: - example: {} - type: object - description: "" - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Delete version - tags: - - Actors/Actor versions - x-legacy-doc-urls: - - https://docs.apify.com/api/v2#/reference/actors/version-object/delete-version - - https://docs.apify.com/api/v2#/reference/actors/delete-version - - https://docs.apify.com/api/v2#tag/ActorsVersion-object/operation/act_version_delete - get: - deprecated: false - description: | - Gets a [Version object](#/reference/actors/version-object) that contains all the details about a specific version of an Actor. - operationId: act_version_get - parameters: - - $ref: "#/components/parameters/actorId" - - $ref: "#/components/parameters/versionNumber" - responses: - "200": - content: - application/json: - schema: - $ref: "#/components/schemas/VersionResponse" - description: "" - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Get version - tags: - - Actors/Actor versions - x-legacy-doc-urls: - - https://docs.apify.com/api/v2#/reference/actors/version-object/get-version - - https://docs.apify.com/api/v2#/reference/actors/get-version - - https://docs.apify.com/api/v2#tag/ActorsVersion-object/operation/act_version_get - x-py-parent: ActorVersionClientAsync - x-py-name: get - x-py-doc-url: https://docs.apify.com/api/client/python/reference/class/ActorVersionClientAsync#get - post: - deprecated: false - description: | - Updates Actor version using values specified by a [Version object](#/reference/actors/version-object) passed as JSON in the POST payload. - This endpoint is an alias for the [`PUT` update version](#tag/ActorsVersion-object/operation/act_version_put) method and behaves identically. - operationId: act_version_post - parameters: - - $ref: "#/components/parameters/actorId" - - $ref: "#/components/parameters/versionNumber" - requestBody: - content: - application/json: - example: - versionNumber: "0.0" - sourceType: SOURCE_FILES - envVars: - - name: DOMAIN - value: http://example.com - isSecret: false - - name: SECRET_PASSWORD - value: MyTopSecretPassword123 - isSecret: true - applyEnvVarsToBuild: false - buildTag: latest - sourceFiles: [] - schema: - $ref: "#/components/schemas/CreateOrUpdateVersionRequest" - description: "" - required: true - responses: - "200": - content: - application/json: - schema: - $ref: "#/components/schemas/VersionResponse" - description: "" - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "413": - $ref: "#/components/responses/PayloadTooLarge" - "415": - $ref: "#/components/responses/UnsupportedMediaType" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Update version (POST) - tags: - - Actors/Actor versions - x-py-parent: ActorVersionClientAsync - x-py-name: update - x-py-doc-url: https://docs.apify.com/api/client/python/reference/class/ActorVersionClientAsync#update - x-legacy-doc-urls: - - https://docs.apify.com/api/v2#/reference/actors/version-object/update-version - - https://docs.apify.com/api/v2#/reference/actors/update-version - - https://docs.apify.com/api/v2#tag/ActorsVersion-object/operation/act_version_post - put: - deprecated: false - description: | - Updates Actor version using values specified by a [Version object](#/reference/actors/version-object) passed as JSON in the POST payload. - - If the object does not define a specific property, its value will not be - updated. - - The request needs to specify the `Content-Type: application/json` HTTP - header! - - When providing your API authentication token, we recommend using the - request's `Authorization` header, rather than the URL. ([More - info](#/introduction/authentication)). - - The response is the [Version object](#/reference/actors/version-object) as - returned by the [Get version](#/reference/actors/version-object/get-version) endpoint. - operationId: act_version_put - parameters: - - $ref: "#/components/parameters/actorId" - - $ref: "#/components/parameters/versionNumber" - requestBody: - content: - application/json: - example: - versionNumber: "0.0" - sourceType: SOURCE_FILES - envVars: - - name: DOMAIN - value: http://example.com - isSecret: false - - name: SECRET_PASSWORD - value: MyTopSecretPassword123 - isSecret: true - applyEnvVarsToBuild: false - buildTag: latest - sourceFiles: [] - schema: - $ref: "#/components/schemas/CreateOrUpdateVersionRequest" - description: "" - required: true - responses: - "200": - content: - application/json: - schema: - $ref: "#/components/schemas/VersionResponse" - description: "" - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "413": - $ref: "#/components/responses/PayloadTooLarge" - "415": - $ref: "#/components/responses/UnsupportedMediaType" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Update version - tags: - - Actors/Actor versions - x-py-parent: ActorVersionClientAsync - x-py-name: update - x-py-doc-url: https://docs.apify.com/api/client/python/reference/class/ActorVersionClientAsync#update - x-legacy-doc-urls: - - https://docs.apify.com/api/v2#/reference/actors/version-object/update-version - - https://docs.apify.com/api/v2#/reference/actors/update-version - - https://docs.apify.com/api/v2#tag/ActorsVersion-object/operation/act_version_put - /v2/actors/{actorId}/versions/{versionNumber}/env-vars: - get: - deprecated: false - description: | - Gets the list of environment variables for a specific version of an Actor. - The response is a JSON object with the list of [EnvVar objects](#/reference/actors/environment-variable-object), where each contains basic information about a single environment variable. - operationId: act_version_envVars_get - parameters: - - $ref: "#/components/parameters/actorId" - - $ref: "#/components/parameters/versionNumber" - responses: - "200": - content: - application/json: - schema: - $ref: "#/components/schemas/ListOfEnvVarsResponse" - description: "" - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Get list of environment variables - tags: - - Actors/Actor versions - x-legacy-doc-urls: - - https://docs.apify.com/api/v2#/reference/actors/environment-variable-collection/get-list-of-environment-variables - - https://docs.apify.com/api/v2#/reference/actors/get-list-of-environment-variables - - https://docs.apify.com/api/v2#tag/ActorsEnvironment-variable-collection/operation/act_version_envVars_get - x-py-parent: ActorEnvVarCollectionClientAsync - x-py-name: list - x-py-doc-url: https://docs.apify.com/api/client/python/reference/class/ActorEnvVarCollectionClientAsync#list - post: - deprecated: false - description: | - Creates an environment variable of an Actor using values specified in a - [EnvVar object](#/reference/actors/environment-variable-object) passed as - JSON in the POST payload. - - The request must specify `name` and `value` parameters (as strings) in the - JSON payload and a `Content-Type: application/json` HTTP header. - - ``` - { - "name": "ENV_VAR_NAME", - "value": "my-env-var" - } - ``` - - The response is the [EnvVar - object](#/reference/actors/environment-variable-object) as returned by the [Get environment - variable](#/reference/actors/environment-variable-object/get-environment-variable) - endpoint. - operationId: act_version_envVars_post - parameters: - - $ref: "#/components/parameters/actorId" - - $ref: "#/components/parameters/versionNumber" - requestBody: - content: - application/json: - example: - name: ENV_VAR_NAME - value: my-env-var - schema: - $ref: "#/components/schemas/EnvVarRequest" - description: "" - required: true - responses: - "201": - content: - application/json: - example: - data: - name: MY_ENV_VAR - value: my-value - isSecret: false - schema: - $ref: "#/components/schemas/EnvVarResponse" - description: "" - headers: - Location: - content: - text/plain: - example: https://api.apify.com/v2/actors/zdc3Pyhyz3m8vjDeM/versions/1.0/env-vars/ENV_VAR_NAME - schema: - type: string - explode: false - style: simple - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "413": - $ref: "#/components/responses/PayloadTooLarge" - "415": - $ref: "#/components/responses/UnsupportedMediaType" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Create environment variable - tags: - - Actors/Actor versions - x-legacy-doc-urls: - - https://docs.apify.com/api/v2#/reference/actors/environment-variable-collection/create-environment-variable - - https://docs.apify.com/api/v2#/reference/actors/create-environment-variable - - https://docs.apify.com/api/v2#tag/ActorsEnvironment-variable-collection/operation/act_version_envVars_post - x-py-parent: ActorEnvVarCollectionClientAsync - x-py-name: create - x-py-doc-url: https://docs.apify.com/api/client/python/reference/class/ActorEnvVarCollectionClientAsync#create - /v2/actors/{actorId}/versions/{versionNumber}/env-vars/{envVarName}: - delete: - deprecated: false - description: Deletes a specific environment variable. - operationId: act_version_envVar_delete - parameters: - - $ref: "#/components/parameters/actorId" - - $ref: "#/components/parameters/versionNumber" - - description: The name of the environment variable - explode: false - in: path - name: envVarName - required: true - schema: - example: MY_ENV_VAR - type: string - style: simple - responses: - "204": - content: - application/json: - example: {} - schema: - example: {} - type: object - description: "" - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Delete environment variable - tags: - - Actors/Actor versions - x-legacy-doc-urls: - - https://docs.apify.com/api/v2#/reference/actors/environment-variable-object/delete-environment-variable - - https://docs.apify.com/api/v2#/reference/actors/delete-environment-variable - - https://docs.apify.com/api/v2#tag/ActorsEnvironment-variable-object/operation/act_version_envVar_delete - get: - deprecated: false - description: | - Gets a [EnvVar object](#/reference/actors/environment-variable-object) that - contains all the details about a specific environment variable of an Actor. - - If `isSecret` is set to `true`, then `value` will never be returned. - operationId: act_version_envVar_get - parameters: - - $ref: "#/components/parameters/actorId" - - $ref: "#/components/parameters/versionNumber" - - description: The name of the environment variable - explode: false - in: path - name: envVarName - required: true - schema: - example: MY_ENV_VAR - type: string - style: simple - responses: - "200": - content: - application/json: - example: - data: - name: MY_ENV_VAR - value: my-value - isSecret: false - schema: - $ref: "#/components/schemas/EnvVarResponse" - description: "" - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Get environment variable - tags: - - Actors/Actor versions - x-legacy-doc-urls: - - https://docs.apify.com/api/v2#/reference/actors/environment-variable-object/get-environment-variable - - https://docs.apify.com/api/v2#/reference/actors/get-environment-variable - - https://docs.apify.com/api/v2#tag/ActorsEnvironment-variable-object/operation/act_version_envVar_get - x-py-parent: ActorEnvVarClientAsync - x-py-name: get - x-py-doc-url: https://docs.apify.com/api/client/python/reference/class/ActorEnvVarClientAsync#get - post: - deprecated: false - description: | - Updates Actor environment variable using values specified by a [EnvVar - object](#/reference/actors/environment-variable-object) - passed as JSON in the POST payload. - This endpoint is an alias for the [`PUT` update environment variable](#tag/ActorsEnvironment-variable-object/operation/act_version_envVar_put) method and behaves identically. - operationId: act_version_envVar_post - parameters: - - $ref: "#/components/parameters/actorId" - - $ref: "#/components/parameters/versionNumber" - - description: The name of the environment variable - explode: false - in: path - name: envVarName - required: true - schema: - example: MY_ENV_VAR - type: string - style: simple - requestBody: - content: - application/json: - example: - name: MY_ENV_VAR - value: my-new-value - isSecret: false - schema: - $ref: "#/components/schemas/EnvVarRequest" - description: "" - required: true - responses: - "200": - content: - application/json: - example: - data: - name: MY_ENV_VAR - value: my-value - isSecret: false - schema: - $ref: "#/components/schemas/EnvVarResponse" - description: "" - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "413": - $ref: "#/components/responses/PayloadTooLarge" - "415": - $ref: "#/components/responses/UnsupportedMediaType" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Update environment variable (POST) - tags: - - Actors/Actor versions - x-py-parent: ActorEnvVarClientAsync - x-py-name: update - x-py-doc-url: https://docs.apify.com/api/client/python/reference/class/ActorEnvVarClientAsync#update - x-legacy-doc-urls: - - https://docs.apify.com/api/v2#/reference/actors/environment-variable-object/update-environment-variable - - https://docs.apify.com/api/v2#/reference/actors/update-environment-variable - - https://docs.apify.com/api/v2#tag/ActorsEnvironment-variable-object/operation/act_version_envVar_post - put: - deprecated: false - description: | - Updates Actor environment variable using values specified by a [EnvVar - object](#/reference/actors/environment-variable-object) - passed as JSON in the POST payload. - If the object does not define a specific property, its value will not be - updated. - - The request needs to specify the `Content-Type: application/json` HTTP - header! - - When providing your API authentication token, we recommend using the - request's `Authorization` header, rather than the URL. ([More - info](#/introduction/authentication)). - - The response is the [EnvVar object](#/reference/actors/environment-variable-object) as returned by the - [Get environment variable](#/reference/actors/environment-variable-object/get-environment-variable) - endpoint. - operationId: act_version_envVar_put - parameters: - - $ref: "#/components/parameters/actorId" - - $ref: "#/components/parameters/versionNumber" - - description: The name of the environment variable - explode: false - in: path - name: envVarName - required: true - schema: - example: MY_ENV_VAR - type: string - style: simple - requestBody: - content: - application/json: - example: - name: MY_ENV_VAR - value: my-new-value - isSecret: false - schema: - $ref: "#/components/schemas/EnvVarRequest" - description: "" - required: true - responses: - "200": - content: - application/json: - example: - data: - name: MY_ENV_VAR - value: my-value - isSecret: false - schema: - $ref: "#/components/schemas/EnvVarResponse" - description: "" - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "413": - $ref: "#/components/responses/PayloadTooLarge" - "415": - $ref: "#/components/responses/UnsupportedMediaType" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Update environment variable - tags: - - Actors/Actor versions - x-py-parent: ActorEnvVarClientAsync - x-py-name: update - x-py-doc-url: https://docs.apify.com/api/client/python/reference/class/ActorEnvVarClientAsync#update - x-legacy-doc-urls: - - https://docs.apify.com/api/v2#/reference/actors/environment-variable-object/update-environment-variable - - https://docs.apify.com/api/v2#/reference/actors/update-environment-variable - - https://docs.apify.com/api/v2#tag/ActorsEnvironment-variable-object/operation/act_version_envVar_put - /v2/actors/{actorId}/webhooks: - get: - deprecated: false - description: | - Gets the list of webhooks of a specific Actor. The response is a JSON with - the list of objects, where each object contains basic information about a single webhook. - - The endpoint supports pagination using the `limit` and `offset` parameters - and it will not return more than 1000 records. - - By default, the records are sorted by the `createdAt` field in ascending - order, to sort the records in descending order, use the `desc=1` parameter. - operationId: act_webhooks_get - parameters: - - $ref: "#/components/parameters/actorId" - - $ref: "#/components/parameters/offset" - - $ref: "#/components/parameters/limit" - - $ref: "#/components/parameters/descCreatedAt" - responses: - "200": - content: - application/json: - schema: - $ref: "#/components/schemas/ListOfWebhooksResponse" - description: "" - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Get list of webhooks - tags: - - Actors/Webhook collection - x-legacy-doc-urls: - - https://docs.apify.com/api/v2#/reference/actors/webhook-collection/get-list-of-webhooks - - https://docs.apify.com/api/v2#/reference/actors/get-list-of-webhooks - - https://docs.apify.com/api/v2#tag/ActorsWebhook-collection/operation/act_webhooks_get - /v2/actors/{actorId}/builds: - get: - deprecated: false - description: | - Gets the list of builds of a specific Actor. The response is a JSON with the - list of objects, where each object contains basic information about a single build. - - The endpoint supports pagination using the `limit` and `offset` parameters - and it will not return more than 1000 records. - - By default, the records are sorted by the `startedAt` field in ascending order, - therefore you can use pagination to incrementally fetch all builds while new - ones are still being started. To sort the records in descending order, use - the `desc=1` parameter. - operationId: act_builds_get - parameters: - - $ref: "#/components/parameters/actorId" - - $ref: "#/components/parameters/offset" - - $ref: "#/components/parameters/limit" - - $ref: "#/components/parameters/descStartedAt" - responses: - "200": - content: - application/json: - schema: - $ref: "#/components/schemas/ListOfBuildsResponse" - description: "" - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Get list of builds - tags: - - Actors/Actor builds - x-legacy-doc-urls: - - https://docs.apify.com/api/v2#/reference/actors/build-collection/get-list-of-builds - - https://docs.apify.com/api/v2#/reference/actors/get-list-of-builds - - https://docs.apify.com/api/v2#tag/ActorsBuild-collection/operation/act_builds_get - x-js-parent: BuildCollectionClient - x-js-name: list - x-js-doc-url: https://docs.apify.com/api/client/js/reference/class/BuildCollectionClient#list - x-py-parent: BuildCollectionClientAsync - x-py-name: list - x-py-doc-url: https://docs.apify.com/api/client/python/reference/class/BuildCollectionClientAsync#list - post: - deprecated: false - description: | - Builds an Actor. - The response is the build object as returned by the - [Get build](#/reference/actors/build-object/get-build) endpoint. - operationId: act_builds_post - parameters: - - $ref: "#/components/parameters/actorId" - - description: Actor version number to be built. - explode: true - in: query - name: version - required: true - schema: - example: "0.0" - type: string - style: form - - description: | - If `true` or `1`, the system will use a cache to speed up the build - process. By default, cache is not used. - explode: true - in: query - name: useCache - required: false - schema: - example: true - type: boolean - style: form - - description: | - If `true` or `1` then the Actor is built with beta versions of Apify NPM - packages. By default, the build uses `latest` packages. - explode: true - in: query - name: betaPackages - required: false - schema: - example: true - type: boolean - style: form - - description: | - Tag to be applied to the build on success. By default, the tag is taken - from Actor version's `buildTag` property. - explode: true - in: query - name: tag - required: false - schema: - example: latest - type: string - style: form - - $ref: "#/components/parameters/waitForFinishBuild" - responses: - "201": - content: - application/json: - schema: - $ref: "#/components/schemas/BuildResponse" - description: "" - headers: - Location: - content: - text/plain: - example: https://api.apify.com/v2/actors/zdc3Pyhyz3m8vjDeM/runs/HG7ML7M8z78YcAPEB - schema: - type: string - explode: false - style: simple - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Build Actor - tags: - - Actors/Actor builds - x-legacy-doc-urls: - - https://docs.apify.com/api/v2#/reference/actors/build-collection/build-actor - - https://docs.apify.com/api/v2#/reference/actors/build-actor - - https://docs.apify.com/api/v2#tag/ActorsBuild-collection/operation/act_builds_post - x-js-parent: ActorClient - x-js-name: build - x-js-doc-url: https://docs.apify.com/api/client/js/reference/class/ActorClient#build - x-py-parent: ActorClientAsync - x-py-name: build - x-py-doc-url: https://docs.apify.com/api/client/python/reference/class/ActorClientAsync#build - /v2/actors/{actorId}/builds/default: - get: - description: | - Get the default build for an Actor. - - Use the optional `waitForFinish` parameter to synchronously wait for the build to finish. - This avoids the need for periodic polling when waiting for the build to complete. - - This endpoint does not require an authentication token. Instead, calls are authenticated using the Actor's unique ID. - However, if you access the endpoint without a token, certain attributes (e.g., `usageUsd` and `usageTotalUsd`) will be hidden. - operationId: act_build_default_get - parameters: - - $ref: "#/components/parameters/actorId" - - $ref: "#/components/parameters/waitForFinishBuild" - responses: - "200": - content: - application/json: - schema: - $ref: "#/components/schemas/BuildResponse" - description: "" - "400": - $ref: "#/components/responses/BadRequest" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "429": - $ref: "#/components/responses/TooManyRequests" - security: [] - summary: Get default build - tags: - - Actors/Actor builds - x-js-parent: ActorClient - x-js-name: defaultBuild - x-js-doc-url: https://docs.apify.com/api/client/js/reference/class/ActorClient#defaultBuild - x-py-parent: ActorClient - x-py-name: default_build - x-py-doc-url: https://docs.apify.com/api/client/python/reference/class/ActorClient#default_build - /v2/actors/{actorId}/builds/{buildId}/openapi.json: - get: - description: | - Get the OpenAPI definition for Actor builds. Two similar endpoints are available: - - - [First endpoint](/api/v2/act-openapi-json-get): Requires both `actorId` and `buildId`. Use `default` as the `buildId` to get the OpenAPI schema for the default Actor build. - - - [Second endpoint](/api/v2/actor-build-openapi-json-get): Requires only `buildId`. - - Get the OpenAPI definition for a specific Actor build. - - To fetch the default Actor build, simply pass `default` as the `buildId`. - Authentication is based on the build's unique ID. No authentication token is required. - - :::note - - You can also use the [`/api/v2/actor-build-openapi-json-get`](/api/v2/actor-build-openapi-json-get) endpoint to get the OpenAPI definition for a build. - - ::: - operationId: act_openapi_json_get - parameters: - - $ref: "#/components/parameters/actorId" - - $ref: "#/components/parameters/buildIdWithDefault" - responses: - "200": - content: - application/json: - schema: - description: A standard OpenAPI 3.x JSON document. - type: object - description: The OpenAPI specification document for the Actor build. - "400": - $ref: "#/components/responses/BadRequest" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "429": - $ref: "#/components/responses/TooManyRequests" - security: [] - summary: Get OpenAPI definition - tags: - - Actors/Actor builds - /v2/actors/{actorId}/builds/{buildId}: - get: - deprecated: true - description: | - By passing the optional `waitForFinish` parameter the API endpoint will - synchronously wait for the build to finish. - This is useful to avoid periodic polling when waiting for an Actor build to - finish. - - This endpoint does not require the authentication token. Instead, calls are authenticated using a hard-to-guess ID of the build. However, - if you access the endpoint without the token, certain attributes, such as `usageUsd` and `usageTotalUsd`, will be hidden. - operationId: act_build_get - parameters: - - $ref: "#/components/parameters/actorId" - - $ref: "#/components/parameters/buildId" - - $ref: "#/components/parameters/waitForFinishBuild" - responses: - "200": - content: - application/json: - schema: - $ref: "#/components/schemas/BuildResponse" - description: "" - "400": - $ref: "#/components/responses/BadRequest" - "404": - $ref: "#/components/responses/NotFound" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "429": - $ref: "#/components/responses/TooManyRequests" - security: [] - summary: Get build - tags: - - Actors/Actor builds - x-deprecated-description: "API endpoints related to build of the Actor were\ - \ moved under new namespace [`actor-builds`](#/reference/actor-builds). Gets\ - \ an object that contains all the details about a specific build of an Actor." - x-legacy-doc-urls: - - https://docs.apify.com/api/v2#/reference/actors/build-object/get-build - - https://docs.apify.com/api/v2#/reference/actors/get-build - - https://docs.apify.com/api/v2#tag/ActorsBuild-object/operation/act_build_get - /v2/actors/{actorId}/builds/{buildId}/abort: - post: - deprecated: true - description: | - **[DEPRECATED]** API endpoints related to build of the Actor were moved - under new namespace [`actor-builds`](#/reference/actor-builds). Aborts an - Actor build and returns an object that contains all the details about the - build. - - Only builds that are starting or running are aborted. For builds with status - `FINISHED`, `FAILED`, `ABORTING` and `TIMED-OUT` this call does nothing. - operationId: act_build_abort_post - parameters: - - $ref: "#/components/parameters/actorId" - - $ref: "#/components/parameters/buildId" - responses: - "200": - content: - application/json: - example: - data: - id: HG7ML7M8z78YcAPEB - actId: janedoe~my-actor - userId: klmdEpoiojmdEMlk3 - startedAt: 2019-11-30T07:34:24.202Z - finishedAt: 2019-12-12T09:30:12.202Z - status: ABORTED - meta: - origin: WEB - userAgent: Mozilla/5.0 (iPad) - stats: - durationMillis: 1000 - runTimeSecs: 5.718 - computeUnits: 0.012699444444444444 - options: - useCache: false - memoryMbytes: 1024 - diskMbytes: 2048 - usage: - ACTOR_COMPUTE_UNITS: 0.08 - usageTotalUsd: 0.02 - usageUsd: - ACTOR_COMPUTE_UNITS: 0.02 - buildNumber: 0.1.1 - schema: - $ref: "#/components/schemas/BuildResponse" - description: "" - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Abort build - tags: - - Actors/Actor builds - x-legacy-doc-urls: - - https://docs.apify.com/api/v2#/reference/actors/abort-build/abort-build - - https://docs.apify.com/api/v2#/reference/actors/abort-build - - https://docs.apify.com/api/v2#tag/ActorsAbort-build/operation/act_build_abort_post - /v2/actors/{actorId}/runs: - get: - deprecated: false - description: | - Gets the list of runs of a specific Actor. The response is a list of - objects, where each object contains basic information about a single Actor run. - - The endpoint supports pagination using the `limit` and `offset` parameters - and it will not return more than 1000 array elements. - - By default, the records are sorted by the `startedAt` field in ascending - order, therefore you can use pagination to incrementally fetch all records while - new ones are still being created. To sort the records in descending order, use - `desc=1` parameter. You can also filter runs by status ([available - statuses](https://docs.apify.com/platform/actors/running/runs-and-builds#lifecycle)). - operationId: act_runs_get - parameters: - - $ref: "#/components/parameters/actorId" - - $ref: "#/components/parameters/offset" - - $ref: "#/components/parameters/limit" - - $ref: "#/components/parameters/descStartedAt" - - $ref: "#/components/parameters/status" - - $ref: "#/components/parameters/startedAfter" - - $ref: "#/components/parameters/startedBefore" - responses: - "200": - content: - application/json: - examples: - example: - $ref: "#/components/examples/ListOfRunsResponseExample" - schema: - $ref: "#/components/schemas/ListOfRunsResponse" - description: "" - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Get list of runs - tags: - - Actors/Actor runs - x-legacy-doc-urls: - - https://docs.apify.com/api/v2#/reference/actors/run-collection/get-list-of-runs - - https://docs.apify.com/api/v2#/reference/actors/get-list-of-runs - - https://docs.apify.com/api/v2#tag/ActorsRun-collection/operation/act_runs_get - x-js-parent: RunCollectionClient - x-js-name: list - x-js-doc-url: https://docs.apify.com/api/client/js/reference/class/RunCollectionClient#list - x-py-parent: RunCollectionClientAsync - x-py-name: list - x-py-doc-url: https://docs.apify.com/api/client/python/reference/class/RunCollectionClientAsync#list - post: - deprecated: false - description: | - Runs an Actor and immediately returns without waiting for the run to finish. - - The POST payload including its `Content-Type` header is passed as `INPUT` to - the Actor (usually `application/json`). - - The Actor is started with the default options; you can override them using - various URL query parameters. - - The response is the Run object as returned by the [Get - run](#/reference/actor-runs/run-object-and-its-storages/get-run) API - endpoint. - - If you want to wait for the run to finish and receive the actual output of - the Actor as the response, please use one of the [Run Actor - synchronously](#/reference/actors/run-actor-synchronously) API endpoints - instead. - - To fetch the Actor run results that are typically stored in the default - dataset, you'll need to pass the ID received in the `defaultDatasetId` field - received in the response JSON to the [Get dataset items](#/reference/datasets/item-collection/get-items) - API endpoint. - operationId: act_runs_post - parameters: - - $ref: "#/components/parameters/actorId" - - $ref: "#/components/parameters/timeout" - - $ref: "#/components/parameters/memory" - - $ref: "#/components/parameters/maxItems" - - $ref: "#/components/parameters/maxTotalChargeUsd" - - $ref: "#/components/parameters/restartOnError" - - $ref: "#/components/parameters/build" - - $ref: "#/components/parameters/waitForFinishRun" - - $ref: "#/components/parameters/webhooks" - - description: | - Overrides the Actor's permission level for this specific run. Use to test restricted permissions - before deploying changes to your Actor or to temporarily elevate or restrict access. If you don't specify this - parameter, the Actor uses its configured default permission level. For more information on permissions, see the - [documentation](https://docs.apify.com/platform/actors/development/permissions). - explode: true - in: query - name: forcePermissionLevel - required: false - schema: - enum: - - LIMITED_PERMISSIONS - - FULL_PERMISSIONS - example: LIMITED_PERMISSIONS - type: string - style: form - requestBody: - content: - application/json: - example: - foo: bar - schema: - type: object - '*/*': - schema: {} - description: "" - required: true - responses: - "201": - content: - application/json: - schema: - $ref: "#/components/schemas/RunResponse" - description: "" - headers: - Location: - content: - text/plain: - example: https://api.apify.com/v2/actors/zdc3Pyhyz3m8vjDeM/runs/HG7ML7M8z78YcAPEB - schema: {} - explode: false - style: simple - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "402": - $ref: "#/components/responses/PaymentRequired" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "413": - $ref: "#/components/responses/PayloadTooLarge" - "415": - $ref: "#/components/responses/UnsupportedMediaType" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Run Actor - tags: - - Actors/Actor runs - x-legacy-doc-urls: - - https://docs.apify.com/api/v2#/reference/actors/run-collection/run-actor - - https://docs.apify.com/api/v2#/reference/actors/run-actor - - https://docs.apify.com/api/v2#tag/ActorsRun-collection/operation/act_runs_post - x-js-parent: ActorClient - x-js-name: start - x-js-doc-url: https://docs.apify.com/api/client/js/reference/class/ActorClient#start - x-py-parent: ActorClientAsync - x-py-name: call - x-py-doc-url: https://docs.apify.com/api/client/python/reference/class/ActorClientAsync#call - /v2/actors/{actorId}/run-sync: - get: - deprecated: false - description: | - Runs a specific Actor and returns its output. - The run must finish in 300<!-- MAX_ACTOR_JOB_SYNC_WAIT_SECS --> seconds - otherwise the API endpoint returns a timeout error. - The Actor is not passed any input. - - Beware that it might be impossible to maintain an idle HTTP connection for a - long period of time, - due to client timeout or network conditions. Make sure your HTTP client is - configured to have a long enough connection timeout. - If the connection breaks, you will not receive any information about the run - and its status. - - To run the Actor asynchronously, use the [Run - Actor](#/reference/actors/run-collection/run-actor) API endpoint instead. - operationId: act_runSync_get - parameters: - - $ref: "#/components/parameters/actorId" - - $ref: "#/components/parameters/outputRecordKey" - - $ref: "#/components/parameters/timeout" - - $ref: "#/components/parameters/memory" - - $ref: "#/components/parameters/maxItems" - - $ref: "#/components/parameters/maxTotalChargeUsd" - - $ref: "#/components/parameters/restartOnError" - - $ref: "#/components/parameters/build" - - $ref: "#/components/parameters/webhooks" - responses: - "201": - content: - application/json: - example: - foo: bar - schema: - type: object - description: "" - "400": - content: - application/json: - schema: - $ref: "#/components/schemas/ActorRunFailedError" - description: "" - "404": - $ref: "#/components/responses/NotFound" - "408": - content: - application/json: - schema: - $ref: "#/components/schemas/ActorRunTimeoutExceededError" - description: "" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Run Actor synchronously without input - tags: - - Actors/Actor runs - x-legacy-doc-urls: - - https://docs.apify.com/api/v2#/reference/actors/run-actor-synchronously/without-input - - https://docs.apify.com/api/v2#/reference/actors/without-input - - https://docs.apify.com/api/v2#tag/ActorsRun-actor-synchronously/operation/act_runSync_get - post: - deprecated: false - description: | - Runs a specific Actor and returns its output. - - The POST payload including its `Content-Type` header is passed as `INPUT` to - the Actor (usually <code>application/json</code>). - The HTTP response contains Actors `OUTPUT` record from its default - key-value store. - - The Actor is started with the default options; you can override them using - various URL query parameters. - If the Actor run exceeds 300<!-- MAX_ACTOR_JOB_SYNC_WAIT_SECS --> seconds, - the HTTP response will have status 408 (Request Timeout). - - Beware that it might be impossible to maintain an idle HTTP connection for a - long period of time, due to client timeout or network conditions. Make sure your HTTP client is - configured to have a long enough connection timeout. - If the connection breaks, you will not receive any information about the run - and its status. - - To run the Actor asynchronously, use the [Run - Actor](#/reference/actors/run-collection/run-actor) API endpoint instead. - operationId: act_runSync_post - parameters: - - $ref: "#/components/parameters/actorId" - - $ref: "#/components/parameters/outputRecordKey" - - $ref: "#/components/parameters/timeout" - - $ref: "#/components/parameters/memory" - - $ref: "#/components/parameters/maxItems" - - $ref: "#/components/parameters/maxTotalChargeUsd" - - $ref: "#/components/parameters/restartOnError" - - $ref: "#/components/parameters/build" - - $ref: "#/components/parameters/webhooks" - requestBody: - content: - application/json: - example: - foo: bar - schema: - type: object - '*/*': - schema: {} - description: "" - required: true - responses: - "201": - content: - application/json: - example: - bar: foo - schema: - type: object - description: "" - "400": - content: - application/json: - schema: - $ref: "#/components/schemas/ActorRunFailedError" - description: "" - "402": - $ref: "#/components/responses/PaymentRequired" - "404": - $ref: "#/components/responses/NotFound" - "408": - content: - application/json: - schema: - $ref: "#/components/schemas/ActorRunTimeoutExceededError" - description: "" - "415": - $ref: "#/components/responses/UnsupportedMediaType" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Run Actor synchronously and return output - tags: - - Actors/Actor runs - x-legacy-doc-urls: - - https://docs.apify.com/api/v2#/reference/actors/run-actor-synchronously/with-input - - https://docs.apify.com/api/v2#/reference/actors/with-input - - https://docs.apify.com/api/v2#tag/ActorsRun-actor-synchronously/operation/act_runSync_post - /v2/actors/{actorId}/run-sync-get-dataset-items: - get: - deprecated: false - description: | - Runs a specific Actor and returns its dataset items. - The run must finish in 300<!-- MAX_ACTOR_JOB_SYNC_WAIT_SECS --> seconds - otherwise the API endpoint returns a timeout error. - The Actor is not passed any input. - - It allows to send all possible options in parameters from [Get Dataset - Items](#/reference/datasets/item-collection/get-items) API endpoint. - - Beware that it might be impossible to maintain an idle HTTP connection for a - long period of time, - due to client timeout or network conditions. Make sure your HTTP client is - configured to have a long enough connection timeout. - If the connection breaks, you will not receive any information about the run - and its status. - - To run the Actor asynchronously, use the [Run - Actor](#/reference/actors/run-collection/run-actor) API endpoint instead. - operationId: act_runSyncGetDatasetItems_get - parameters: - - $ref: "#/components/parameters/actorId" - - $ref: "#/components/parameters/timeout" - - $ref: "#/components/parameters/memory" - - $ref: "#/components/parameters/maxItems" - - $ref: "#/components/parameters/maxTotalChargeUsd" - - $ref: "#/components/parameters/restartOnError" - - $ref: "#/components/parameters/build" - - $ref: "#/components/parameters/webhooks" - - $ref: "#/components/parameters/format" - - $ref: "#/components/parameters/clean" - - $ref: "#/components/parameters/offset" - - $ref: "#/components/parameters/datasetParameters_limit" - - $ref: "#/components/parameters/fields" - - $ref: "#/components/parameters/outputFields" - - $ref: "#/components/parameters/omit" - - $ref: "#/components/parameters/unwind" - - $ref: "#/components/parameters/flatten" - - $ref: "#/components/parameters/descDataset" - - $ref: "#/components/parameters/attachment" - - $ref: "#/components/parameters/delimiter" - - $ref: "#/components/parameters/bom" - - $ref: "#/components/parameters/xmlRoot" - - $ref: "#/components/parameters/xmlRow" - - $ref: "#/components/parameters/skipHeaderRow" - - $ref: "#/components/parameters/skipHidden" - - $ref: "#/components/parameters/skipEmpty" - - $ref: "#/components/parameters/simplified" - - $ref: "#/components/parameters/view" - - $ref: "#/components/parameters/skipFailedPages" - - $ref: "#/components/parameters/feedTitle" - - $ref: "#/components/parameters/feedDescription" - responses: - "201": - content: - application/json: - example: - - myValue: some value - myOtherValue: some other value - schema: - items: - type: object - type: array - default: null - description: "" - headers: - X-Apify-Pagination-Offset: - content: - text/plain: - example: "0" - schema: - type: string - description: The offset of the first item in the current page. - explode: false - style: simple - X-Apify-Pagination-Limit: - content: - text/plain: - example: "100" - schema: - type: string - description: The maximum number of items returned per page. - explode: false - style: simple - X-Apify-Pagination-Count: - content: - text/plain: - example: "100" - schema: - type: string - description: The number of items returned in the current page. - explode: false - style: simple - X-Apify-Pagination-Total: - content: - text/plain: - example: "10204" - schema: - type: string - description: The total number of items in the dataset. - explode: false - style: simple - "400": - content: - application/json: - schema: - $ref: "#/components/schemas/ActorRunFailedError" - description: "" - "404": - $ref: "#/components/responses/NotFound" - "408": - content: - application/json: - schema: - $ref: "#/components/schemas/ActorRunTimeoutExceededError" - description: "" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Run Actor synchronously without input and get dataset items - tags: - - Actors/Actor runs - x-legacy-doc-urls: - - https://docs.apify.com/api/v2#/reference/actors/run-actor-synchronously-and-get-dataset-items/run-actor-synchronously-without-input-and-get-dataset-items - - https://docs.apify.com/api/v2#/reference/actors/run-actor-synchronously-without-input-and-get-dataset-items - - https://docs.apify.com/api/v2#tag/ActorsRun-Actor-synchronously-and-get-dataset-items/operation/act_runSyncGetDatasetItems_get - post: - deprecated: false - description: | - Runs a specific Actor and returns its dataset items. - - The POST payload including its `Content-Type` header is passed as `INPUT` to - the Actor (usually `application/json`). - The HTTP response contains the Actors dataset items, while the format of - items depends on specifying dataset items' `format` parameter. - - You can send all the same options in parameters as the [Get Dataset - Items](#/reference/datasets/item-collection/get-items) API endpoint. - - The Actor is started with the default options; you can override them using - URL query parameters. - If the Actor run exceeds 300<!-- MAX_ACTOR_JOB_SYNC_WAIT_SECS --> seconds, - the HTTP response will return the 408 status code (Request Timeout). - - Beware that it might be impossible to maintain an idle HTTP connection for a - long period of time, - due to client timeout or network conditions. Make sure your HTTP client is - configured to have a long enough connection timeout. - If the connection breaks, you will not receive any information about the run - and its status. - - To run the Actor asynchronously, use the [Run - Actor](#/reference/actors/run-collection/run-actor) API endpoint instead. - operationId: act_runSyncGetDatasetItems_post - parameters: - - $ref: "#/components/parameters/actorId" - - $ref: "#/components/parameters/timeout" - - $ref: "#/components/parameters/memory" - - $ref: "#/components/parameters/maxItems" - - $ref: "#/components/parameters/maxTotalChargeUsd" - - $ref: "#/components/parameters/restartOnError" - - $ref: "#/components/parameters/build" - - $ref: "#/components/parameters/webhooks" - - $ref: "#/components/parameters/format" - - $ref: "#/components/parameters/clean" - - $ref: "#/components/parameters/offset" - - $ref: "#/components/parameters/datasetParameters_limit" - - $ref: "#/components/parameters/fields" - - $ref: "#/components/parameters/outputFields" - - $ref: "#/components/parameters/omit" - - $ref: "#/components/parameters/unwind" - - $ref: "#/components/parameters/flatten" - - $ref: "#/components/parameters/descDataset" - - $ref: "#/components/parameters/attachment" - - $ref: "#/components/parameters/delimiter" - - $ref: "#/components/parameters/bom" - - $ref: "#/components/parameters/xmlRoot" - - $ref: "#/components/parameters/xmlRow" - - $ref: "#/components/parameters/skipHeaderRow" - - $ref: "#/components/parameters/skipHidden" - - $ref: "#/components/parameters/skipEmpty" - - $ref: "#/components/parameters/simplified" - - $ref: "#/components/parameters/view" - - $ref: "#/components/parameters/skipFailedPages" - - $ref: "#/components/parameters/feedTitle" - - $ref: "#/components/parameters/feedDescription" - requestBody: - content: - application/json: - example: - foo: bar - schema: - type: object - '*/*': - schema: {} - description: "" - required: true - responses: - "201": - content: - application/json: - example: - - myValue: some value - myOtherValue: some other value - schema: - items: - type: object - type: array - default: null - description: "" - headers: - X-Apify-Pagination-Offset: - content: - text/plain: - example: "0" - schema: {} - description: The offset of the first item in the current page. - explode: false - style: simple - X-Apify-Pagination-Limit: - content: - text/plain: - example: "100" - schema: {} - description: The maximum number of items returned per page. - explode: false - style: simple - X-Apify-Pagination-Count: - content: - text/plain: - example: "100" - schema: {} - description: The number of items returned in the current page. - explode: false - style: simple - X-Apify-Pagination-Total: - content: - text/plain: - example: "10204" - schema: {} - description: The total number of items in the dataset. - explode: false - style: simple - "400": - content: - application/json: - schema: - $ref: "#/components/schemas/ActorRunFailedError" - description: "" - "402": - $ref: "#/components/responses/PaymentRequired" - "404": - $ref: "#/components/responses/NotFound" - "408": - content: - application/json: - schema: - $ref: "#/components/schemas/ActorRunTimeoutExceededError" - description: "" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Run Actor synchronously and get dataset items - tags: - - Actors/Actor runs - x-legacy-doc-urls: - - https://docs.apify.com/api/v2#/reference/actors/run-actor-synchronously-and-get-dataset-items/run-actor-synchronously-with-input-and-get-dataset-items - - https://docs.apify.com/api/v2#/reference/actors/run-actor-synchronously-with-input-and-get-dataset-items - - https://docs.apify.com/api/v2#tag/ActorsRun-Actor-synchronously-and-get-dataset-items/operation/act_runSyncGetDatasetItems_post - /v2/actors/{actorId}/validate-input: - post: - deprecated: false - description: | - Validates the provided input against the Actor's input schema for the specified build. - - The endpoint checks whether the JSON payload conforms to the input schema - defined in the Actor's build. If no `build` query parameter is provided, - the `latest` build tag is used by default. - operationId: act_validateInput_post - parameters: - - $ref: "#/components/parameters/actorId" - - description: | - Optional tag or number of the Actor build to use for input schema validation. - By default, the `latest` build tag is used. - explode: true - in: query - name: build - required: false - schema: - example: latest - type: string - style: form - requestBody: - content: - application/json: - schema: - type: object - description: JSON input to validate against the Actor's input schema. - required: true - responses: - "200": - content: - application/json: - schema: - $ref: "#/components/schemas/act_validateInput_post_200_response" - description: "" - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "413": - $ref: "#/components/responses/PayloadTooLarge" - "415": - $ref: "#/components/responses/UnsupportedMediaType" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Validate Actor input - tags: - - Actors - /v2/actors/{actorId}/runs/{runId}/resurrect: - post: - deprecated: false - description: | - **[DEPRECATED]** API endpoints related to run of the Actor were moved under - new namespace [`actor-runs`](#/reference/actor-runs).Resurrects a finished - Actor run and returns an object that contains all the details about the - resurrected run. - - Only finished runs, i.e. runs with status `FINISHED`, `FAILED`, `ABORTED` - and `TIMED-OUT` can be resurrected. - Run status will be updated to RUNNING and its container will be restarted - with the same storages - (the same behaviour as when the run gets migrated to the new server). - - For more information, see the [Actor - docs](https://docs.apify.com/platform/actors/running/runs-and-builds#resurrection-of-finished-run). - operationId: act_run_resurrect_post - parameters: - - $ref: "#/components/parameters/actorId" - - $ref: "#/components/parameters/runId" - - $ref: "#/components/parameters/buildResurrect" - - $ref: "#/components/parameters/timeoutResurrect" - - $ref: "#/components/parameters/memoryResurrect" - - $ref: "#/components/parameters/restartOnErrorResurrect" - responses: - "200": - content: - application/json: - schema: - allOf: - - $ref: "#/components/schemas/RunResponse" - description: "" - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Resurrect run - tags: - - Actors/Actor runs - x-legacy-doc-urls: - - https://docs.apify.com/api/v2#/reference/actors/resurrect-run/resurrect-run - - https://docs.apify.com/api/v2#/reference/actors/resurrect-run - - https://docs.apify.com/api/v2#tag/ActorsResurrect-run/operation/act_run_resurrect_post - /v2/actors/{actorId}/runs/last: - get: - deprecated: false - description: | - This is not a single endpoint, but an entire group of endpoints that lets you to - retrieve and manage the last run of given Actor or any of its default storages. - All the endpoints require an authentication token. - - The base path represents the last Actor run object is: - - `/v2/actors/{actorId}/runs/last{?token,status}` - - Using the `status` query parameter you can ensure to only get a run with a certain status - (e.g. `status=SUCCEEDED`). The output of this endpoint and other query parameters - are the same as in the [Run object](#/reference/actors/run-object) endpoint. - - ##### Convenience endpoints for last Actor run - - * [Dataset](/api/v2/last-actor-runs-default-dataset) - - * [Key-value store](/api/v2/last-actor-runs-default-key-value-store) - - * [Request queue](/api/v2/last-actor-runs-default-request-queue) - - * [Log](/api/v2/last-actor-runs-log) - operationId: act_runs_last_get - parameters: - - $ref: "#/components/parameters/actorId" - - $ref: "#/components/parameters/statusLastRun" - - $ref: "#/components/parameters/waitForFinishRun" - responses: - "200": - content: - application/json: - schema: - $ref: "#/components/schemas/RunResponse" - description: "" - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Get last run - tags: - - Actors/Actor runs - x-legacy-doc-urls: - - https://docs.apify.com/api/v2#/reference/actors/last-run-object-and-its-storages/get-last-run - - https://docs.apify.com/api/v2#tag/ActorsLast-run-object-and-its-storages/operation/act_runs_last_get - /v2/actors/{actorId}/runs/last/dataset: - delete: - deprecated: false - description: | - Deletes the default dataset associated with the last Actor run. - - This endpoint is a shortcut for getting the last run's `defaultDatasetId` and then using the - [Delete dataset](/api/v2/dataset-delete) endpoint. - operationId: act_runs_last_dataset_delete - parameters: - - $ref: "#/components/parameters/actorId" - - $ref: "#/components/parameters/statusLastRun" - responses: - "204": - $ref: "#/components/responses/NoContent" - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Delete last run's default dataset - tags: - - Last Actor run's default dataset - get: - deprecated: false - description: | - Returns the default dataset associated with the last Actor run. - - This endpoint is a shortcut for getting the last run's `defaultDatasetId` and then using the - [Get dataset](/api/v2/dataset-get) endpoint. - operationId: act_runs_last_dataset_get - parameters: - - $ref: "#/components/parameters/actorId" - - $ref: "#/components/parameters/statusLastRun" - responses: - "200": - content: - application/json: - schema: - $ref: "#/components/schemas/DatasetResponse" - description: "" - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Get last run's default dataset - tags: - - Last Actor run's default dataset - put: - deprecated: false - description: | - Updates the default dataset associated with the last Actor run. - - This endpoint is a shortcut for getting the last run's `defaultDatasetId` and then using the - [Update dataset](/api/v2/dataset-put) endpoint. - operationId: act_runs_last_dataset_put - parameters: - - $ref: "#/components/parameters/actorId" - - $ref: "#/components/parameters/statusLastRun" - requestBody: - content: - application/json: - schema: - $ref: "#/components/schemas/UpdateDatasetRequest" - description: "" - required: true - responses: - "200": - content: - application/json: - schema: - $ref: "#/components/schemas/DatasetResponse" - description: "" - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "413": - $ref: "#/components/responses/PayloadTooLarge" - "415": - $ref: "#/components/responses/UnsupportedMediaType" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Update last run's default dataset - tags: - - Last Actor run's default dataset - /v2/actors/{actorId}/runs/last/dataset/items: - get: - deprecated: false - description: | - Returns data stored in the default dataset of the last Actor run in the desired format. - - This endpoint is a shortcut that resolves the last run's `defaultDatasetId` and proxies to the - [Get dataset items](/api/v2/dataset-items-get) endpoint. - operationId: act_runs_last_dataset_items_get - parameters: - - $ref: "#/components/parameters/actorId" - - $ref: "#/components/parameters/statusLastRun" - - $ref: "#/components/parameters/format" - - $ref: "#/components/parameters/clean" - - $ref: "#/components/parameters/offset" - - $ref: "#/components/parameters/datasetParameters_limit" - - $ref: "#/components/parameters/fields" - - $ref: "#/components/parameters/outputFields" - - $ref: "#/components/parameters/omit" - - $ref: "#/components/parameters/unwind" - - $ref: "#/components/parameters/flatten" - - $ref: "#/components/parameters/descDataset" - - $ref: "#/components/parameters/attachment" - - $ref: "#/components/parameters/delimiter" - - $ref: "#/components/parameters/bom" - - $ref: "#/components/parameters/xmlRoot" - - $ref: "#/components/parameters/xmlRow" - - $ref: "#/components/parameters/skipHeaderRow" - - $ref: "#/components/parameters/skipHidden" - - $ref: "#/components/parameters/skipEmpty" - - $ref: "#/components/parameters/simplified" - - $ref: "#/components/parameters/view" - - $ref: "#/components/parameters/skipFailedPages" - - $ref: "#/components/parameters/feedTitle" - - $ref: "#/components/parameters/feedDescription" - - $ref: "#/components/parameters/signature" - responses: - "200": - content: - application/json: - schema: - example: - - foo: bar - - foo2: bar2 - items: - type: object - type: array - default: null - application/jsonl: - example: "{\"foo\":\"bar\"}\\n{\"foo2\":\"bar2\"}\\n" - schema: - type: string - text/csv: - example: "foo,bar\\nfoo2,bar2\\n" - schema: - type: string - text/html: - example: <table><tr><th>foo</th><th>bar</th></tr><tr><td>foo</td><td>bar</td></tr><tr><td>foo2</td><td>bar2</td></tr></table> - schema: - type: string - application/vnd.openxmlformats-officedocument.spreadsheetml.sheet: - schema: - type: string - application/rss+xml: - example: <rss><channel><item><foo>bar</foo></item><item><foo2>bar2</foo2></item></channel></rss> - schema: - type: string - application/xml: - example: <items><item><foo>bar</foo></item><item><foo2>bar2</foo2></item></items> - schema: - type: string - description: "" - headers: - X-Apify-Pagination-Offset: - content: - text/plain: - example: "0" - schema: {} - description: The offset of the first item in the current page. - explode: false - style: simple - X-Apify-Pagination-Limit: - content: - text/plain: - example: "100" - schema: {} - description: The maximum number of items returned per page. - explode: false - style: simple - X-Apify-Pagination-Count: - content: - text/plain: - example: "100" - schema: {} - description: The number of items returned in the current page. - explode: false - style: simple - X-Apify-Pagination-Total: - content: - text/plain: - example: "10204" - schema: {} - description: The total number of items in the dataset. - explode: false - style: simple - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Get last run's dataset items - tags: - - Last Actor run's default dataset - post: - deprecated: false - description: | - Appends an item or an array of items to the end of the last Actor run's default dataset. - - This endpoint is a shortcut that resolves the last run's `defaultDatasetId` and proxies to the - [Store items](/api/v2/dataset-items-post) endpoint. - operationId: act_runs_last_dataset_items_post - parameters: - - $ref: "#/components/parameters/actorId" - - $ref: "#/components/parameters/statusLastRun" - requestBody: - content: - application/json: - schema: - $ref: "#/components/schemas/act_runs_last_dataset_items_post_request" - description: "" - required: true - responses: - "201": - content: - application/json: - schema: - example: {} - type: object - description: "" - headers: - Location: - content: - text/plain: - example: https://api.apify.com/v2/datasets/WkzbQMuFYuamGv3YF/items - schema: - type: string - explode: false - style: simple - "400": - content: - application/json: - schema: - $ref: "#/components/schemas/act_runs_last_dataset_items_post_400_response" - description: "" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Store items in last run's dataset - tags: - - Last Actor run's default dataset - /v2/actors/{actorId}/runs/last/dataset/statistics: - get: - description: | - Returns statistics for the last Actor run's default dataset. - - This endpoint is a shortcut that resolves the last run's `defaultDatasetId` and proxies to the - [Get dataset statistics](/api/v2/dataset-statistics-get) endpoint. - operationId: act_runs_last_dataset_statistics_get - parameters: - - $ref: "#/components/parameters/actorId" - - $ref: "#/components/parameters/statusLastRun" - responses: - "200": - content: - application/json: - schema: - $ref: "#/components/schemas/DatasetStatisticsResponse" - description: "" - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Get last run's dataset statistics - tags: - - Last Actor run's default dataset - /v2/actors/{actorId}/runs/last/key-value-store: - delete: - deprecated: false - description: | - Deletes the last Actor run key-value store. - - This endpoint is a shortcut for getting the run's `defaultKeyValueStoreId` and then using the - [Delete store](/api/v2/key-value-store-delete) endpoint. - operationId: act_runs_last_keyValueStore_delete - parameters: - - $ref: "#/components/parameters/actorId" - - $ref: "#/components/parameters/statusLastRun" - responses: - "204": - $ref: "#/components/responses/NoContent" - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Delete last run's default store - tags: - - Last Actor run's default key-value store - get: - deprecated: false - description: | - Gets an object that contains all the details about the default key-value store associated with the last Actor run. - - This endpoint is a shortcut for getting the run's `defaultKeyValueStoreId` and then using the - [Get store](/api/v2/key-value-store-get) endpoint. - operationId: act_runs_last_keyValueStore_get - parameters: - - $ref: "#/components/parameters/actorId" - - $ref: "#/components/parameters/statusLastRun" - responses: - "200": - content: - application/json: - schema: - $ref: "#/components/schemas/KeyValueStoreResponse" - description: "" - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Get last run's default store - tags: - - Last Actor run's default key-value store - put: - deprecated: false - description: | - Updates the last Actor run key-value store's name and general resource access level using a value specified by a JSON object - passed in the PUT payload. - - This endpoint is a shortcut for getting the run's `defaultKeyValueStoreId` and then using the - [Update store](/api/v2/key-value-store-put) endpoint. - operationId: act_runs_last_keyValueStore_put - parameters: - - $ref: "#/components/parameters/actorId" - - $ref: "#/components/parameters/statusLastRun" - requestBody: - content: - application/json: - example: - name: new-store-name - schema: - $ref: "#/components/schemas/UpdateStoreRequest" - description: "" - required: true - responses: - "200": - content: - application/json: - schema: - $ref: "#/components/schemas/KeyValueStoreResponse" - description: "" - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "413": - $ref: "#/components/responses/PayloadTooLarge" - "415": - $ref: "#/components/responses/UnsupportedMediaType" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Update last run's default store - tags: - - Last Actor run's default key-value store - /v2/actors/{actorId}/runs/last/key-value-store/keys: - get: - deprecated: false - description: | - Returns a list of keys for the default key-value store of the last Actor run. - - This endpoint is a shortcut for getting the last run's `defaultKeyValueStoreId` and then using the - [Get list of keys](/api/v2/key-value-store-keys-get) endpoint. - operationId: act_runs_last_keyValueStore_keys_get - parameters: - - $ref: "#/components/parameters/actorId" - - $ref: "#/components/parameters/statusLastRun" - - $ref: "#/components/parameters/exclusiveStartKey" - - $ref: "#/components/parameters/keyValueStoreParameters_limit" - - $ref: "#/components/parameters/collectionKeys" - - $ref: "#/components/parameters/prefixKeys" - - $ref: "#/components/parameters/signature" - responses: - "200": - content: - application/json: - schema: - $ref: "#/components/schemas/ListOfKeysResponse" - description: "" - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Get last run's default store's list of keys - tags: - - Last Actor run's default key-value store - /v2/actors/{actorId}/runs/last/key-value-store/records: - get: - deprecated: false - description: | - Downloads all records from the default key-value store of the last Actor run as a ZIP archive. - - This endpoint is a shortcut for getting the last run's `defaultKeyValueStoreId` and then using the - [Download records](/api/v2/key-value-store-records-get) endpoint. - operationId: act_runs_last_keyValueStore_records_get - parameters: - - $ref: "#/components/parameters/actorId" - - $ref: "#/components/parameters/statusLastRun" - - $ref: "#/components/parameters/collectionRecords" - - $ref: "#/components/parameters/prefixRecords" - - $ref: "#/components/parameters/signature" - responses: - "200": - content: - application/zip: - schema: - format: binary - type: string - description: A ZIP archive containing the requested records. - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Download last run's default store's records - tags: - - Last Actor run's default key-value store - /v2/actors/{actorId}/runs/last/key-value-store/records/{recordKey}: - delete: - deprecated: false - description: | - Removes a record specified by a key from the default key-value store of the last Actor run. - - This endpoint is a shortcut for getting the last run's `defaultKeyValueStoreId` and then using the - [Delete record](/api/v2/key-value-store-record-delete) endpoint. - operationId: act_runs_last_keyValueStore_record_delete - parameters: - - $ref: "#/components/parameters/actorId" - - $ref: "#/components/parameters/statusLastRun" - - $ref: "#/components/parameters/recordKey" - responses: - "204": - $ref: "#/components/responses/NoContent" - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Delete last run's default store's record - tags: - - Last Actor run's default key-value store - get: - deprecated: false - description: | - Gets a value stored under a specific key in the default key-value store of the last Actor run. - - This endpoint is a shortcut for getting the last run's `defaultKeyValueStoreId` and then using the - [Get record](/api/v2/key-value-store-record-get) endpoint. - operationId: act_runs_last_keyValueStore_record_get - parameters: - - $ref: "#/components/parameters/actorId" - - $ref: "#/components/parameters/statusLastRun" - - $ref: "#/components/parameters/recordKey" - - $ref: "#/components/parameters/signature" - - $ref: "#/components/parameters/keyValueStoreParameters_attachment" - responses: - "200": - content: - application/json: - schema: - $ref: "#/components/schemas/RecordResponse" - '*/*': - schema: {} - description: "" - "302": - content: {} - description: "" - headers: - Location: - content: - text/plain: - example: https://apifier-key-value-store-prod.s3.amazonaws.com/tqx6jeMia43gYY6eE/INPUT?AWSAccessKeyId=NKDOUN&Expires=1502720992&Signature=DKLVPI4lDDKC - schema: - type: string - explode: false - style: simple - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Get last run's default store's record - tags: - - Last Actor run's default key-value store - post: - deprecated: false - description: | - Stores a value under a specific key in the default key-value store of the last Actor run. - - This endpoint is a shortcut for getting the last run's `defaultKeyValueStoreId` and then using the - [Store record](/api/v2/key-value-store-record-post) endpoint. - operationId: act_runs_last_keyValueStore_record_post - parameters: - - $ref: "#/components/parameters/actorId" - - $ref: "#/components/parameters/statusLastRun" - - $ref: "#/components/parameters/recordKey" - - $ref: "#/components/parameters/Content-Encoding" - requestBody: - content: - application/json: - schema: - $ref: "#/components/schemas/PutRecordRequest" - '*/*': - schema: {} - description: "" - required: true - responses: - "201": - content: - application/json: - example: {} - schema: - type: object - description: "" - headers: - Location: - content: - text/plain: - example: https://api.apify.com/v2/key-value-stores/WkzbQMuFYuamGv3YF/records/some-key - schema: - type: string - explode: false - style: simple - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "413": - $ref: "#/components/responses/PayloadTooLarge" - "415": - $ref: "#/components/responses/UnsupportedMediaType" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Store record in last run's default store (POST) - tags: - - Last Actor run's default key-value store - put: - deprecated: false - description: | - Stores a value under a specific key in the default key-value store of the last Actor run. - - This endpoint is a shortcut for getting the last run's `defaultKeyValueStoreId` and then using the - [Store record](/api/v2/key-value-store-record-put) endpoint. - operationId: act_runs_last_keyValueStore_record_put - parameters: - - $ref: "#/components/parameters/actorId" - - $ref: "#/components/parameters/statusLastRun" - - $ref: "#/components/parameters/recordKey" - - $ref: "#/components/parameters/Content-Encoding" - requestBody: - content: - application/json: - schema: - $ref: "#/components/schemas/PutRecordRequest" - '*/*': - schema: {} - description: "" - required: true - responses: - "201": - content: - application/json: - example: {} - schema: - type: object - description: "" - headers: - Location: - content: - text/plain: - example: https://api.apify.com/v2/key-value-stores/WkzbQMuFYuamGv3YF/records/some-key - schema: - type: string - explode: false - style: simple - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "413": - $ref: "#/components/responses/PayloadTooLarge" - "415": - $ref: "#/components/responses/UnsupportedMediaType" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Store record in last run's default store - tags: - - Last Actor run's default key-value store - /v2/actors/{actorId}/runs/last/request-queue: - delete: - deprecated: false - description: | - Deletes the default request queue associated with the last Actor run. - - This endpoint is a shortcut for getting the last run's `defaultRequestQueueId` and then using the - [Delete request queue](/api/v2/request-queue-delete) endpoint. - operationId: act_runs_last_requestQueue_delete - parameters: - - $ref: "#/components/parameters/actorId" - - $ref: "#/components/parameters/statusLastRun" - responses: - "204": - $ref: "#/components/responses/NoContent" - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Delete last run's default request queue - tags: - - Last Actor run's default request queue - get: - deprecated: false - description: | - Returns the default request queue associated with the last Actor run. - - This endpoint is a shortcut for getting the last run's `defaultRequestQueueId` and then using the - [Get request queue](/api/v2/request-queue-get) endpoint. - operationId: act_runs_last_requestQueue_get - parameters: - - $ref: "#/components/parameters/actorId" - - $ref: "#/components/parameters/statusLastRun" - responses: - "200": - content: - application/json: - schema: - $ref: "#/components/schemas/RequestQueueResponse" - description: "" - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Get last run's default request queue - tags: - - Last Actor run's default request queue - put: - deprecated: false - description: | - Updates the default request queue associated with the last Actor run. - - This endpoint is a shortcut for getting the last run's `defaultRequestQueueId` and then using the - [Update request queue](/api/v2/request-queue-put) endpoint. - operationId: act_runs_last_requestQueue_put - parameters: - - $ref: "#/components/parameters/actorId" - - $ref: "#/components/parameters/statusLastRun" - requestBody: - content: - application/json: - example: - name: new-request-queue-name - schema: - allOf: - - $ref: "#/components/schemas/UpdateRequestQueueRequest" - example: - name: new-request-queue-name - description: "" - required: true - responses: - "200": - content: - application/json: - schema: - $ref: "#/components/schemas/RequestQueueResponse" - description: "" - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "413": - $ref: "#/components/responses/PayloadTooLarge" - "415": - $ref: "#/components/responses/UnsupportedMediaType" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Update last run's default request queue - tags: - - Last Actor run's default request queue - /v2/actors/{actorId}/runs/last/request-queue/requests: - get: - deprecated: false - description: | - Returns a list of requests from the default request queue of the last Actor run. - - This endpoint is a shortcut for getting the last run's `defaultRequestQueueId` and then using the - [List requests](/api/v2/request-queue-requests-get) endpoint. - operationId: act_runs_last_requestQueue_requests_get - parameters: - - $ref: "#/components/parameters/actorId" - - $ref: "#/components/parameters/statusLastRun" - - $ref: "#/components/parameters/clientKey" - - $ref: "#/components/parameters/exclusiveStartId" - - $ref: "#/components/parameters/listLimit" - - $ref: "#/components/parameters/cursor" - - $ref: "#/components/parameters/filter" - responses: - "200": - content: - application/json: - schema: - $ref: "#/components/schemas/ListOfRequestsResponse" - description: "" - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: List last run's default request queue's requests - tags: - - Last Actor run's default request queue - post: - deprecated: false - description: | - Adds a request to the default request queue of the last Actor run. - - This endpoint is a shortcut for getting the last run's `defaultRequestQueueId` and then using the - [Add request](/api/v2/request-queue-requests-post) endpoint. - operationId: act_runs_last_requestQueue_requests_post - parameters: - - $ref: "#/components/parameters/actorId" - - $ref: "#/components/parameters/statusLastRun" - - $ref: "#/components/parameters/clientKey" - - $ref: "#/components/parameters/forefront" - requestBody: - content: - application/json: - schema: - $ref: "#/components/schemas/RequestBase" - description: "" - required: true - responses: - "201": - content: - application/json: - schema: - $ref: "#/components/schemas/AddRequestResponse" - description: "" - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "413": - $ref: "#/components/responses/PayloadTooLarge" - "415": - $ref: "#/components/responses/UnsupportedMediaType" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Add request to last run's default request queue - tags: - - Last Actor run's default request queue - /v2/actors/{actorId}/runs/last/request-queue/requests/batch: - delete: - deprecated: false - description: | - Batch-deletes requests from the default request queue of the last Actor run. - - This endpoint is a shortcut for getting the last run's `defaultRequestQueueId` and then using the - [Delete requests](/api/v2/request-queue-requests-batch-delete) endpoint. - operationId: act_runs_last_requestQueue_requests_batch_delete - parameters: - - $ref: "#/components/parameters/actorId" - - $ref: "#/components/parameters/statusLastRun" - - $ref: "#/components/parameters/contentTypeJson" - - $ref: "#/components/parameters/clientKey" - requestBody: - content: - application/json: - schema: - items: - $ref: "#/components/schemas/RequestDraftDelete" - type: array - default: null - description: "" - required: true - responses: - "200": - content: - application/json: - schema: - $ref: "#/components/schemas/BatchDeleteResponse" - description: "" - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "413": - $ref: "#/components/responses/PayloadTooLarge" - "415": - $ref: "#/components/responses/UnsupportedMediaType" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Batch delete requests from last run's default request queue - tags: - - Last Actor run's default request queue - post: - deprecated: false - description: | - Adds requests to the default request queue of the last Actor run in batch. - - This endpoint is a shortcut for getting the last run's `defaultRequestQueueId` and then using the - [Add requests](/api/v2/request-queue-requests-batch-post) endpoint. - operationId: act_runs_last_requestQueue_requests_batch_post - parameters: - - $ref: "#/components/parameters/actorId" - - $ref: "#/components/parameters/statusLastRun" - - $ref: "#/components/parameters/clientKey" - - $ref: "#/components/parameters/forefront" - requestBody: - content: - application/json: - schema: - description: "" - items: - $ref: "#/components/schemas/RequestBase" - type: array - default: null - description: "" - required: true - responses: - "201": - content: - application/json: - schema: - $ref: "#/components/schemas/BatchAddResponse" - description: "" - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "413": - $ref: "#/components/responses/PayloadTooLarge" - "415": - $ref: "#/components/responses/UnsupportedMediaType" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Batch add requests to last run's default request queue - tags: - - Last Actor run's default request queue - /v2/actors/{actorId}/runs/last/request-queue/requests/unlock: - post: - deprecated: false - description: | - Unlocks requests in the default request queue of the last Actor run that are currently locked by the client. - - This endpoint is a shortcut for getting the last run's `defaultRequestQueueId` and then using the - [Unlock requests](/api/v2/request-queue-requests-unlock-post) endpoint. - operationId: act_runs_last_requestQueue_requests_unlock_post - parameters: - - $ref: "#/components/parameters/actorId" - - $ref: "#/components/parameters/statusLastRun" - - $ref: "#/components/parameters/clientKey" - responses: - "200": - content: - application/json: - schema: - $ref: "#/components/schemas/UnlockRequestsResponse" - description: Number of requests that were unlocked - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Unlock requests in last run's default request queue - tags: - - Last Actor run's default request queue - /v2/actors/{actorId}/runs/last/request-queue/requests/{requestId}: - delete: - deprecated: false - description: | - Deletes a request from the default request queue of the last Actor run. - - This endpoint is a shortcut for getting the last run's `defaultRequestQueueId` and then using the - [Delete request](/api/v2/request-queue-request-delete) endpoint. - operationId: act_runs_last_requestQueue_request_delete - parameters: - - $ref: "#/components/parameters/actorId" - - $ref: "#/components/parameters/statusLastRun" - - $ref: "#/components/parameters/requestId" - - $ref: "#/components/parameters/clientKey" - responses: - "204": - $ref: "#/components/responses/NoContent" - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Delete request from last run's default request queue - tags: - - Last Actor run's default request queue - get: - deprecated: false - description: | - Returns a request from the default request queue of the last Actor run. - - This endpoint is a shortcut for getting the last run's `defaultRequestQueueId` and then using the - [Get request](/api/v2/request-queue-request-get) endpoint. - operationId: act_runs_last_requestQueue_request_get - parameters: - - $ref: "#/components/parameters/actorId" - - $ref: "#/components/parameters/statusLastRun" - - $ref: "#/components/parameters/requestId" - responses: - "200": - content: - application/json: - schema: - $ref: "#/components/schemas/RequestResponse" - description: "" - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Get request from last run's default request queue - tags: - - Last Actor run's default request queue - put: - deprecated: false - description: | - Updates a request in the default request queue of the last Actor run. - - This endpoint is a shortcut for getting the last run's `defaultRequestQueueId` and then using the - [Update request](/api/v2/request-queue-request-put) endpoint. - operationId: act_runs_last_requestQueue_request_put - parameters: - - $ref: "#/components/parameters/actorId" - - $ref: "#/components/parameters/statusLastRun" - - $ref: "#/components/parameters/requestId" - - $ref: "#/components/parameters/forefront" - - $ref: "#/components/parameters/clientKey" - requestBody: - content: - application/json: - schema: - $ref: "#/components/schemas/Request" - description: "" - required: true - responses: - "200": - content: - application/json: - schema: - $ref: "#/components/schemas/UpdateRequestResponse" - description: "" - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "413": - $ref: "#/components/responses/PayloadTooLarge" - "415": - $ref: "#/components/responses/UnsupportedMediaType" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Update request in last run's default request queue - tags: - - Last Actor run's default request queue - /v2/actors/{actorId}/runs/last/request-queue/requests/{requestId}/lock: - delete: - deprecated: false - description: | - Deletes a request lock in the default request queue of the last Actor run. - - This endpoint is a shortcut for getting the last run's `defaultRequestQueueId` and then using the - [Delete request lock](/api/v2/request-queue-request-lock-delete) endpoint. - operationId: act_runs_last_requestQueue_request_lock_delete - parameters: - - $ref: "#/components/parameters/actorId" - - $ref: "#/components/parameters/statusLastRun" - - $ref: "#/components/parameters/requestId" - - $ref: "#/components/parameters/clientKey" - - $ref: "#/components/parameters/deleteForefront" - responses: - "204": - $ref: "#/components/responses/NoContent" - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Delete lock on request in last run's default request queue - tags: - - Last Actor run's default request queue - put: - deprecated: false - description: | - Prolongs a request lock in the default request queue of the last Actor run. - - This endpoint is a shortcut for getting the last run's `defaultRequestQueueId` and then using the - [Prolong request lock](/api/v2/request-queue-request-lock-put) endpoint. - operationId: act_runs_last_requestQueue_request_lock_put - parameters: - - $ref: "#/components/parameters/actorId" - - $ref: "#/components/parameters/statusLastRun" - - $ref: "#/components/parameters/requestId" - - $ref: "#/components/parameters/lockSecs" - - $ref: "#/components/parameters/clientKey" - - $ref: "#/components/parameters/lockForefront" - responses: - "200": - content: - application/json: - schema: - $ref: "#/components/schemas/ProlongRequestLockResponse" - description: "" - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Prolong lock on request in last run's default request queue - tags: - - Last Actor run's default request queue - /v2/actors/{actorId}/runs/last/request-queue/head: - get: - deprecated: false - description: | - Returns the given number of first requests from the default request queue of the last Actor run. - - This endpoint is a shortcut for getting the last run's `defaultRequestQueueId` and then using the - [Get head](/api/v2/request-queue-head-get) endpoint. - operationId: act_runs_last_requestQueue_head_get - parameters: - - $ref: "#/components/parameters/actorId" - - $ref: "#/components/parameters/statusLastRun" - - $ref: "#/components/parameters/headLimit" - - $ref: "#/components/parameters/clientKey" - responses: - "200": - content: - application/json: - schema: - $ref: "#/components/schemas/HeadResponse" - description: "" - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Get last run's default request queue head - tags: - - Last Actor run's default request queue - /v2/actors/{actorId}/runs/last/request-queue/head/lock: - post: - deprecated: false - description: | - Returns the given number of first requests from the default request queue of the last Actor run - and locks them for the given time. - - This endpoint is a shortcut for getting the last run's `defaultRequestQueueId` and then using the - [Get head and lock](/api/v2/request-queue-head-lock-post) endpoint. - operationId: act_runs_last_requestQueue_head_lock_post - parameters: - - $ref: "#/components/parameters/actorId" - - $ref: "#/components/parameters/statusLastRun" - - $ref: "#/components/parameters/lockSecs" - - $ref: "#/components/parameters/headLockLimit" - - $ref: "#/components/parameters/clientKey" - responses: - "201": - content: - application/json: - schema: - $ref: "#/components/schemas/HeadAndLockResponse" - description: "" - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Get and lock last run's default request queue head - tags: - - Last Actor run's default request queue - /v2/actors/{actorId}/runs/last/log: - get: - deprecated: false - description: | - Retrieves last Actor run's logs. - - This endpoint is a shortcut for getting last Actor run's log. Same as [Get log](/api/v2/log-get) endpoint. - operationId: act_runs_last_log_get - parameters: - - $ref: "#/components/parameters/actorId" - - $ref: "#/components/parameters/stream" - - $ref: "#/components/parameters/download" - - $ref: "#/components/parameters/raw" - responses: - "200": - content: - text/plain: - schema: - example: | - 2017-07-14T06:00:49.733Z Application started. - 2017-07-14T06:00:49.741Z Input: { test: 123 } - 2017-07-14T06:00:49.752Z Some useful debug information follows. - type: string - description: "" - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Get last Actor run's log - tags: - - Last Actor run's log - /v2/actors/{actorId}/runs/last/abort: - post: - deprecated: false - description: | - Aborts the last run of the specified Actor and returns an object that - contains all the details about the run. - - This endpoint is a shortcut for [Abort run](#/reference/actor-runs/abort-run/abort-run) - on the Actor's last run. Only runs that are starting or running are aborted. - For runs with status `FINISHED`, `FAILED`, `ABORTING` and `TIMED-OUT` this call - does nothing. - operationId: act_runs_last_abort_post - parameters: - - $ref: "#/components/parameters/actorId" - - $ref: "#/components/parameters/statusLastRun" - - $ref: "#/components/parameters/gracefully" - responses: - "200": - content: - application/json: - example: - data: - id: HG7ML7M8z78YcAPEB - actId: janedoe~my-actor - userId: BPWZBd7Z9c746JAng - actorTaskId: rANaydYhUxjsnA3oz - startedAt: 2019-11-30T07:34:24.202Z - finishedAt: 2019-12-12T09:30:12.202Z - status: ABORTED - statusMessage: Actor was aborted - isStatusMessageTerminal: true - meta: - origin: WEB - clientIp: 172.234.12.34 - userAgent: Mozilla/5.0 (iPad) - stats: - inputBodyLen: 240 - migrationCount: 0 - restartCount: 0 - resurrectCount: 1 - memAvgBytes: 3.59142284E7 - memMaxBytes: 38244352 - memCurrentBytes: 0 - cpuAvgUsage: 0.00955965 - cpuMaxUsage: 3.1546 - cpuCurrentUsage: 0 - netRxBytes: 2652 - netTxBytes: 1338 - durationMillis: 26239 - runTimeSecs: 26.239 - metamorph: 0 - computeUnits: 0.0072886 - options: - build: latest - timeoutSecs: 300 - memoryMbytes: 1024 - diskMbytes: 2048 - buildId: 7sT5jcggjjA9fNcxF - exitCode: 0 - generalAccess: RESTRICTED - defaultKeyValueStoreId: eJNzqsbPiopwJcgGQ - defaultDatasetId: wmKPijuyDnPZAPRMk - defaultRequestQueueId: FL35cSF7jrxr3BY39 - storageIds: - datasets: - default: wmKPijuyDnPZAPRMk - keyValueStores: - default: eJNzqsbPiopwJcgGQ - requestQueues: - default: FL35cSF7jrxr3BY39 - isContainerServerReady: false - gitBranchName: master - usage: - ACTOR_COMPUTE_UNITS: 3 - DATASET_READS: 4 - DATASET_WRITES: 4 - KEY_VALUE_STORE_READS: 5 - KEY_VALUE_STORE_WRITES: 3 - KEY_VALUE_STORE_LISTS: 5 - REQUEST_QUEUE_READS: 2 - REQUEST_QUEUE_WRITES: 1 - DATA_TRANSFER_INTERNAL_GBYTES: 1 - DATA_TRANSFER_EXTERNAL_GBYTES: 3 - PROXY_RESIDENTIAL_TRANSFER_GBYTES: 34 - PROXY_SERPS: 3 - usageTotalUsd: 0.2654 - usageUsd: - ACTOR_COMPUTE_UNITS: 0.072 - DATASET_READS: 4.0E-4 - DATASET_WRITES: 2.0E-4 - KEY_VALUE_STORE_READS: 6.0E-4 - KEY_VALUE_STORE_WRITES: 0.002 - KEY_VALUE_STORE_LISTS: 0.004 - REQUEST_QUEUE_READS: 0.005 - REQUEST_QUEUE_WRITES: 0.02 - DATA_TRANSFER_INTERNAL_GBYTES: 4.0E-4 - DATA_TRANSFER_EXTERNAL_GBYTES: 2.0E-4 - PROXY_RESIDENTIAL_TRANSFER_GBYTES: 0.16 - PROXY_SERPS: 6.0E-4 - schema: - $ref: "#/components/schemas/RunResponse" - description: "" - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Abort Actor's last run - tags: - - Last Actor run's abort - /v2/actors/{actorId}/runs/last/metamorph: - post: - deprecated: false - description: | - Transforms the last run of the specified Actor into a run of another Actor with - a new input. - - This endpoint is a shortcut for [Metamorph run](#/reference/actor-runs/metamorph-run/metamorph-run) - on the Actor's last run. - operationId: act_runs_last_metamorph_post - parameters: - - $ref: "#/components/parameters/actorId" - - $ref: "#/components/parameters/statusLastRun" - - $ref: "#/components/parameters/targetActorId" - - description: | - Optional build of the target Actor. - - It can be either a build tag or build number. By default, the run uses - the build specified in the default run configuration for the target - Actor (typically `latest`). - explode: true - in: query - name: build - required: false - schema: - example: beta - type: string - style: form - responses: - "200": - content: - application/json: - schema: - $ref: "#/components/schemas/RunResponse" - description: "" - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Metamorph Actor's last run - tags: - - Last Actor run's metamorph - /v2/actors/{actorId}/runs/last/reboot: - post: - deprecated: false - description: | - Reboots the last run of the specified Actor and returns an object that - contains all the details about the rebooted run. - - This endpoint is a shortcut for [Reboot run](#/reference/actor-runs/reboot-run/reboot-run) - on the Actor's last run. Only runs with status `RUNNING` can be rebooted. The run's - container will be restarted, so any data not persisted in the key-value store, dataset, - or request queue will be lost. - operationId: act_runs_last_reboot_post - parameters: - - $ref: "#/components/parameters/actorId" - - $ref: "#/components/parameters/statusLastRun" - responses: - "200": - content: - application/json: - schema: - $ref: "#/components/schemas/RunResponse" - description: "" - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Reboot Actor's last run - tags: - - Last Actor run's reboot - /v2/actors/{actorId}/runs/{runId}: - get: - deprecated: true - description: | - **[DEPRECATED]** API endpoints related to run of the Actor were moved under - new namespace [`actor-runs`](#/reference/actor-runs). - - Gets an object that contains all the details about a specific run of an Actor. - - By passing the optional `waitForFinish` parameter the API endpoint will - synchronously wait for the run to finish. - This is useful to avoid periodic polling when waiting for Actor run to - complete. - - This endpoint does not require the authentication token. Instead, calls are authenticated using a hard-to-guess ID of the run. However, - if you access the endpoint without the token, certain attributes, such as `usageUsd` and `usageTotalUsd`, will be hidden. - operationId: act_run_get - parameters: - - $ref: "#/components/parameters/actorId" - - $ref: "#/components/parameters/runId" - - $ref: "#/components/parameters/waitForFinishRun" - responses: - "200": - content: - application/json: - schema: - $ref: "#/components/schemas/RunResponse" - description: "" - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Get run - tags: - - Actors/Actor runs - x-legacy-doc-urls: - - https://docs.apify.com/api/v2#/reference/actors/run-object/get-run - - https://docs.apify.com/api/v2#/reference/actors/get-run - - https://docs.apify.com/api/v2#tag/ActorsRun-object/operation/act_run_get - /v2/actors/{actorId}/runs/{runId}/abort: - post: - deprecated: true - description: | - **[DEPRECATED]** API endpoints related to run of the Actor were moved under - new namespace [`actor-runs`](#/reference/actor-runs). Aborts an Actor run and - returns an object that contains all the details about the run. - - Only runs that are starting or running are aborted. For runs with status - `FINISHED`, `FAILED`, `ABORTING` and `TIMED-OUT` this call does nothing. - operationId: act_run_abort_post - parameters: - - $ref: "#/components/parameters/actorId" - - $ref: "#/components/parameters/runId" - - $ref: "#/components/parameters/gracefully" - responses: - "200": - content: - application/json: - example: - data: - id: HG7ML7M8z78YcAPEB - actId: janedoe~my-actor - userId: BPWZBd7Z9c746JAng - actorTaskId: rANaydYhUxjsnA3oz - startedAt: 2019-11-30T07:34:24.202Z - finishedAt: 2019-12-12T09:30:12.202Z - status: ABORTED - statusMessage: Actor was aborted - isStatusMessageTerminal: true - meta: - origin: WEB - clientIp: 172.234.12.34 - userAgent: Mozilla/5.0 (iPad) - stats: - inputBodyLen: 240 - migrationCount: 0 - restartCount: 0 - resurrectCount: 1 - memAvgBytes: 3.59142284E7 - memMaxBytes: 38244352 - memCurrentBytes: 0 - cpuAvgUsage: 0.00955965 - cpuMaxUsage: 3.1546 - cpuCurrentUsage: 0 - netRxBytes: 2652 - netTxBytes: 1338 - durationMillis: 26239 - runTimeSecs: 26.239 - metamorph: 0 - computeUnits: 0.0072886 - options: - build: latest - timeoutSecs: 300 - memoryMbytes: 1024 - diskMbytes: 2048 - buildId: 7sT5jcggjjA9fNcxF - exitCode: 0 - generalAccess: RESTRICTED - defaultKeyValueStoreId: eJNzqsbPiopwJcgGQ - defaultDatasetId: wmKPijuyDnPZAPRMk - defaultRequestQueueId: FL35cSF7jrxr3BY39 - storageIds: - datasets: - default: wmKPijuyDnPZAPRMk - keyValueStores: - default: eJNzqsbPiopwJcgGQ - requestQueues: - default: FL35cSF7jrxr3BY39 - isContainerServerReady: false - gitBranchName: master - usage: - ACTOR_COMPUTE_UNITS: 3 - DATASET_READS: 4 - DATASET_WRITES: 4 - KEY_VALUE_STORE_READS: 5 - KEY_VALUE_STORE_WRITES: 3 - KEY_VALUE_STORE_LISTS: 5 - REQUEST_QUEUE_READS: 2 - REQUEST_QUEUE_WRITES: 1 - DATA_TRANSFER_INTERNAL_GBYTES: 1 - DATA_TRANSFER_EXTERNAL_GBYTES: 3 - PROXY_RESIDENTIAL_TRANSFER_GBYTES: 34 - PROXY_SERPS: 3 - usageTotalUsd: 0.2654 - usageUsd: - ACTOR_COMPUTE_UNITS: 0.072 - DATASET_READS: 4.0E-4 - DATASET_WRITES: 2.0E-4 - KEY_VALUE_STORE_READS: 6.0E-4 - KEY_VALUE_STORE_WRITES: 0.002 - KEY_VALUE_STORE_LISTS: 0.004 - REQUEST_QUEUE_READS: 0.005 - REQUEST_QUEUE_WRITES: 0.02 - DATA_TRANSFER_INTERNAL_GBYTES: 4.0E-4 - DATA_TRANSFER_EXTERNAL_GBYTES: 2.0E-4 - PROXY_RESIDENTIAL_TRANSFER_GBYTES: 0.16 - PROXY_SERPS: 6.0E-4 - schema: - $ref: "#/components/schemas/RunResponse" - description: "" - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Abort run - tags: - - Actors/Actor runs - x-legacy-doc-urls: - - https://docs.apify.com/api/v2#/reference/actors/abort-run/abort-run - - https://docs.apify.com/api/v2#/reference/actors/abort-run - - https://docs.apify.com/api/v2#tag/ActorsAbort-run/operation/act_run_abort_post - /v2/actors/{actorId}/runs/{runId}/metamorph: - post: - deprecated: true - description: | - **[DEPRECATED]** API endpoints related to run of the Actor were moved under - new namespace [`actor-runs`](#/reference/actor-runs). Transforms an Actor run - into a run of another Actor with a new input. - - This is useful if you want to use another Actor to finish the work - of your current Actor run, without the need to create a completely new run - and waiting for its finish. - For the users of your Actors, the metamorph operation is transparent, they - will just see your Actor got the work done. - - There is a limit on how many times you can metamorph a single run. You can - check the limit in [the Actor runtime limits](https://docs.apify.com/platform/limits#actor-limits). - - Internally, the system stops the Docker container corresponding to the Actor - run and starts a new container using a different Docker image. - All the default storages are preserved and the new input is stored under the - `INPUT-METAMORPH-1` key in the same default key-value store. - - For more information, see the [Actor docs](https://docs.apify.com/platform/actors/development/programming-interface/metamorph). - operationId: act_run_metamorph_post - parameters: - - $ref: "#/components/parameters/actorId" - - $ref: "#/components/parameters/runId" - - $ref: "#/components/parameters/targetActorId" - - description: | - Optional build of the target Actor. - - It can be either a build tag or build number. By default, the run uses - the build specified in the default run configuration for the target - Actor (typically `latest`). - explode: true - in: query - name: build - required: false - schema: - example: beta - type: string - style: form - responses: - "200": - content: - application/json: - schema: - $ref: "#/components/schemas/RunResponse" - description: "" - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Metamorph run - tags: - - Actors/Actor runs - x-legacy-doc-urls: - - https://docs.apify.com/api/v2#/reference/actors/metamorph-run/metamorph-run - - https://docs.apify.com/api/v2#/reference/actors/metamorph-run - - https://docs.apify.com/api/v2#tag/ActorsMetamorph-run/operation/act_run_metamorph_post - /v2/actor-tasks: - get: - deprecated: false - description: | - Gets the complete list of tasks that a user has created or used. - - The response is a list of objects in which each object contains essential - information about a single task. - - The endpoint supports pagination using the `limit` and `offset` parameters, - and it does not return more than a 1000 records. - - By default, the records are sorted by the `createdAt` field in ascending - order; therefore you can use pagination to incrementally fetch all tasks while new - ones are still being created. To sort the records in descending order, use - the `desc=1` parameter. - operationId: actorTasks_get - parameters: - - $ref: "#/components/parameters/offset" - - $ref: "#/components/parameters/limit" - - $ref: "#/components/parameters/descCreatedAt" - responses: - "200": - content: - application/json: - example: - data: - total: 2 - offset: 0 - limit: 1000 - desc: false - count: 2 - items: - - id: zdc3Pyhyz3m8vjDeM - userId: wRsJZtadYvn4mBZmm - actId: asADASadYvn4mBZmm - actName: my-actor - name: my-task - username: janedoe - actUsername: janedoe - createdAt: 2018-10-26T07:23:14.855Z - modifiedAt: 2018-10-26T13:30:49.578Z - stats: - totalRuns: 15 - - id: aWE3asdas3m8vjDeM - userId: wRsJZtadYvn4mBZmm - actId: asADASadYvn4mBZmm - actName: my-actor - actUsername: janedoe - name: my-task-2 - username: janedoe - createdAt: 2018-10-26T07:23:14.855Z - modifiedAt: 2018-10-26T13:30:49.578Z - stats: - totalRuns: 4 - schema: - $ref: "#/components/schemas/ListOfTasksResponse" - description: "" - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Get list of tasks - tags: - - Actor tasks - x-legacy-doc-urls: - - https://docs.apify.com/api/v2#/reference/actor-tasks/task-collection/get-list-of-tasks - - https://docs.apify.com/api/v2#/reference/actor-tasks/get-list-of-tasks - - https://docs.apify.com/api/v2#tag/Actor-tasksTask-collection/operation/actorTasks_get - x-js-parent: TaskCollectionClient - x-js-name: list - x-js-doc-url: https://docs.apify.com/api/client/js/reference/class/TaskCollectionClient#list - x-py-parent: TaskCollectionClientAsync - x-py-name: list - x-py-doc-url: https://docs.apify.com/api/client/python/reference/class/TaskCollectionClientAsync#list - post: - deprecated: false - description: | - Create a new task with settings specified by the object passed as JSON in - the POST payload. - - The response is the full task object as returned by the - [Get task](/api/v2/actor-task-get) endpoint. - - The request needs to specify the `Content-Type: application/json` HTTP header! - - When providing your API authentication token, we recommend using the - request's `Authorization` header, rather than the URL. - operationId: actorTasks_post - requestBody: - content: - application/json: - example: - actId: asADASadYvn4mBZmm - name: my-task - options: - build: latest - timeoutSecs: 300 - memoryMbytes: 128 - schema: - allOf: - - $ref: "#/components/schemas/CreateTaskRequest" - example: - actId: asADASadYvn4mBZmm - name: my-task - options: - build: latest - timeoutSecs: 300 - memoryMbytes: 128 - input: - hello: world - description: "" - required: true - responses: - "201": - content: - application/json: - schema: - $ref: "#/components/schemas/TaskResponse" - description: "" - headers: - Location: - content: - text/plain: - example: https://api.apify.com/v2/actor-tasks/zdc3Pyhyz3m8vjDeM - schema: - type: string - explode: false - style: simple - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "409": - $ref: "#/components/responses/Conflict" - "413": - $ref: "#/components/responses/PayloadTooLarge" - "415": - $ref: "#/components/responses/UnsupportedMediaType" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Create task - tags: - - Actor tasks - x-legacy-doc-urls: - - https://docs.apify.com/api/v2#/reference/actor-tasks/task-collection/create-task - - https://docs.apify.com/api/v2#/reference/actor-tasks/create-task - - https://docs.apify.com/api/v2#tag/Actor-tasksTask-collection/operation/actorTasks_post - x-js-parent: TaskCollectionClient - x-js-name: create - x-js-doc-url: https://docs.apify.com/api/client/js/reference/class/TaskCollectionClient#create - x-py-parent: TaskCollectionClientAsync - x-py-name: create - x-py-doc-url: https://docs.apify.com/api/client/python/reference/class/TaskCollectionClientAsync#create - /v2/actor-tasks/{actorTaskId}: - delete: - deprecated: false - description: Delete the task specified through the `actorTaskId` parameter. - operationId: actorTask_delete - parameters: - - $ref: "#/components/parameters/actorTaskId" - responses: - "204": - content: - application/json: - example: {} - schema: - type: object - description: "" - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Delete task - tags: - - Actor tasks - x-legacy-doc-urls: - - https://docs.apify.com/api/v2#/reference/actor-tasks/task-object/delete-task - - https://docs.apify.com/api/v2#/reference/actor-tasks/delete-task - - https://docs.apify.com/api/v2#tag/Actor-tasksTask-object/operation/actorTask_delete - x-js-parent: TaskClient - x-js-name: delete - x-js-doc-url: https://docs.apify.com/api/client/js/reference/class/TaskClient#delete - get: - deprecated: false - description: Get an object that contains all the details about a task. - operationId: actorTask_get - parameters: - - $ref: "#/components/parameters/actorTaskId" - responses: - "200": - content: - application/json: - schema: - $ref: "#/components/schemas/actorTask_get_200_response" - description: "" - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Get task - tags: - - Actor tasks - x-legacy-doc-urls: - - https://docs.apify.com/api/v2#/reference/actor-tasks/task-object/get-task - - https://docs.apify.com/api/v2#/reference/actor-tasks/get-task - - https://docs.apify.com/api/v2#tag/Actor-tasksTask-object/operation/actorTask_get - x-js-parent: TaskClient - x-js-name: get - x-js-doc-url: https://docs.apify.com/api/client/js/reference/class/TaskClient#get - x-py-parent: TaskClientAsync - x-py-name: get - x-py-doc-url: https://docs.apify.com/api/client/python/reference/class/TaskClientAsync#get - put: - deprecated: false - description: | - Update settings of a task using values specified by an object passed as JSON - in the POST payload. - - If the object does not define a specific property, its value is not updated. - - The response is the full task object as returned by the - [Get task](/api/v2/actor-task-get) endpoint. - - The request needs to specify the `Content-Type: application/json` HTTP - header! - - When providing your API authentication token, we recommend using the - request's `Authorization` header, rather than the URL. - operationId: actorTask_put - parameters: - - $ref: "#/components/parameters/actorTaskId" - requestBody: - content: - application/json: - example: - name: my-task - options: - build: latest - timeoutSecs: 300 - memoryMbytes: 128 - input: - hello: world - schema: - $ref: "#/components/schemas/UpdateTaskRequest" - description: "" - required: true - responses: - "200": - content: - application/json: - schema: - $ref: "#/components/schemas/actorTask_get_200_response" - description: "" - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "413": - $ref: "#/components/responses/PayloadTooLarge" - "415": - $ref: "#/components/responses/UnsupportedMediaType" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Update task - tags: - - Actor tasks - x-legacy-doc-urls: - - https://docs.apify.com/api/v2#/reference/actor-tasks/task-object/update-task - - https://docs.apify.com/api/v2#/reference/actor-tasks/update-task - - https://docs.apify.com/api/v2#tag/Actor-tasksTask-object/operation/actorTask_put - x-js-parent: TaskClient - x-js-name: update - x-js-doc-url: https://docs.apify.com/api/client/js/reference/class/TaskClient#update - x-py-parent: TaskClientAsync - x-py-name: update - x-py-doc-url: https://docs.apify.com/api/client/python/reference/class/TaskClientAsync#update - /v2/actor-tasks/{actorTaskId}/input: - get: - deprecated: false - description: Returns the input of a given task. - operationId: actorTask_input_get - parameters: - - $ref: "#/components/parameters/actorTaskId" - responses: - "200": - content: - application/json: - example: - myField1: some-value - myField2: another-value - myField3: 1 - schema: - type: object - description: "" - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Get task input - tags: - - Actor tasks - x-legacy-doc-urls: - - https://docs.apify.com/api/v2#/reference/actor-tasks/task-input-object/get-task-input - - https://docs.apify.com/api/v2#/reference/actor-tasks/get-task-input - - https://docs.apify.com/api/v2#tag/Actor-tasksTask-input-object/operation/actorTask_input_get - x-js-parent: TaskClient - x-js-name: getInput - x-js-doc-url: https://docs.apify.com/api/client/js/reference/class/TaskClient#getInput - x-py-parent: TaskClientAsync - x-py-name: get_input - x-py-doc-url: https://docs.apify.com/api/client/python/reference/class/TaskClientAsync#get_input - put: - deprecated: false - description: | - Updates the input of a task using values specified by an object passed as - JSON in the PUT payload. - - If the object does not define a specific property, its value is not updated. - - The response is the full task input as returned by the - [Get task input](#/reference/tasks/task-input-object/get-task-input) endpoint. - - The request needs to specify the `Content-Type: application/json` HTTP - header! - - When providing your API authentication token, we recommend using the - request's `Authorization` header, rather than the URL. ([More - info](#/introduction/authentication)). - operationId: actorTask_input_put - parameters: - - $ref: "#/components/parameters/actorTaskId" - requestBody: - content: - application/json: - example: - myField2: updated-value - schema: - type: object - description: "" - required: true - responses: - "200": - content: - application/json: - example: - myField1: some-value - myField2: updated-value - myField3: 1 - schema: - type: object - description: "" - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "413": - $ref: "#/components/responses/PayloadTooLarge" - "415": - $ref: "#/components/responses/UnsupportedMediaType" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Update task input - tags: - - Actor tasks - x-legacy-doc-urls: - - https://docs.apify.com/api/v2#/reference/actor-tasks/task-input-object/update-task-input - - https://docs.apify.com/api/v2#/reference/actor-tasks/update-task-input - - https://docs.apify.com/api/v2#tag/Actor-tasksTask-input-object/operation/actorTask_input_put - x-js-parent: TaskClient - x-js-name: updateInput - x-js-doc-url: https://docs.apify.com/api/client/js/reference/class/TaskClient#updateInput - x-py-parent: TaskClientAsync - x-py-name: update_input - x-py-doc-url: https://docs.apify.com/api/client/python/reference/class/TaskClientAsync#update_input - /v2/actor-tasks/{actorTaskId}/webhooks: - get: - deprecated: false - description: | - Gets the list of webhooks of a specific Actor task. The response is a JSON - with the list of objects, where each object contains basic information about a single webhook. - - The endpoint supports pagination using the `limit` and `offset` parameters - and it will not return more than 1000 records. - - By default, the records are sorted by the `createdAt` field in ascending - order, to sort the records in descending order, use the `desc=1` parameter. - operationId: actorTask_webhooks_get - parameters: - - $ref: "#/components/parameters/actorTaskId" - - $ref: "#/components/parameters/offset" - - $ref: "#/components/parameters/limit" - - $ref: "#/components/parameters/descCreatedAt" - responses: - "200": - content: - application/json: - example: - data: - total: 2 - offset: 0 - limit: 1000 - desc: false - count: 2 - items: - - id: YiKoxjkaS9gjGTqhF - createdAt: 2019-12-12T07:34:14.202Z - modifiedAt: 2019-12-13T08:36:13.202Z - userId: wRsJZtadYvn4mBZmm - isAdHoc: false - shouldInterpolateStrings: false - eventTypes: - - ACTOR.RUN.SUCCEEDED - condition: - actorId: hksJZtadYvn4mBuin - actorTaskId: asdLZtadYvn4mBZmm - actorRunId: hgdKZtadYvn4mBpoi - ignoreSslErrors: false - doNotRetry: false - requestUrl: http://example.com/ - payloadTemplate: "{\\n \\\"userId\\\": {{userId}}..." - headersTemplate: "{\\n \\\"Authorization\\\": Bearer..." - description: this is webhook description - lastDispatch: - status: SUCCEEDED - finishedAt: 2019-12-13T08:36:13.202Z - stats: - totalDispatches: 1 - - id: YiKoxjkaS9gjGTqhF - createdAt: 2019-12-12T07:34:14.202Z - modifiedAt: 2019-12-13T08:36:13.202Z - userId: wRsJZtadYvn4mBZmm - isAdHoc: false - shouldInterpolateStrings: false - eventTypes: - - ACTOR.RUN.SUCCEEDED - condition: - actorId: hksJZtadYvn4mBuin - actorTaskId: asdLZtadYvn4mBZmm - actorRunId: hgdKZtadYvn4mBpoi - ignoreSslErrors: false - doNotRetry: false - requestUrl: http://example.com/ - payloadTemplate: "{\\n \\\"userId\\\": {{userId}}..." - headersTemplate: "{\\n \\\"Authorization\\\": Bearer..." - description: this is webhook description - lastDispatch: - status: SUCCEEDED - finishedAt: 2019-12-13T08:36:13.202Z - stats: - totalDispatches: 1 - schema: - $ref: "#/components/schemas/actorTask_webhooks_get_200_response" - description: "" - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Get list of webhooks - tags: - - Actor tasks - x-legacy-doc-urls: - - https://docs.apify.com/api/v2#/reference/actor-tasks/webhook-collection/get-list-of-webhooks - - https://docs.apify.com/api/v2#/reference/actor-tasks/get-list-of-webhooks - - https://docs.apify.com/api/v2#tag/Actor-tasksWebhook-collection/operation/actorTask_webhooks_get - /v2/actor-tasks/{actorTaskId}/runs: - get: - deprecated: false - description: | - Get a list of runs of a specific task. The response is a list of objects, - where each object contains essential information about a single task run. - - The endpoint supports pagination using the `limit` and `offset` parameters, - and it does not return more than a 1000 array elements. - - By default, the records are sorted by the `startedAt` field in ascending - order; therefore you can use pagination to incrementally fetch all records while - new ones are still being created. To sort the records in descending order, use - the `desc=1` parameter. You can also filter runs by status ([available - statuses](https://docs.apify.com/platform/actors/running/runs-and-builds#lifecycle)). - operationId: actorTask_runs_get - parameters: - - $ref: "#/components/parameters/actorTaskId" - - $ref: "#/components/parameters/offset" - - $ref: "#/components/parameters/limit" - - $ref: "#/components/parameters/descStartedAt" - - $ref: "#/components/parameters/status" - responses: - "200": - content: - application/json: - schema: - $ref: "#/components/schemas/actorTask_runs_get_200_response" - description: "" - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Get list of task runs - tags: - - Actor tasks - x-legacy-doc-urls: - - https://docs.apify.com/api/v2#/reference/actor-tasks/run-collection/get-list-of-task-runs - - https://docs.apify.com/api/v2#/reference/actor-tasks/get-list-of-task-runs - - https://docs.apify.com/api/v2#tag/Actor-tasksRun-collection/operation/actorTask_runs_get - post: - deprecated: false - description: | - Runs an Actor task and immediately returns without waiting for the run to - finish. - - Optionally, you can override the Actor input configuration by passing a JSON - object as the POST payload and setting the `Content-Type: application/json` HTTP header. - - Note that if the object in the POST payload does not define a particular - input property, the Actor run uses the default value defined by the task (or Actor's input - schema if not defined by the task). - - The response is the Actor Run object as returned by the [Get - run](#/reference/actor-runs/run-object-and-its-storages/get-run) endpoint. - - If you want to wait for the run to finish and receive the actual output of - the Actor run as the response, use one of the [Run task - synchronously](#/reference/actor-tasks/run-task-synchronously) API endpoints - instead. - - To fetch the Actor run results that are typically stored in the default - dataset, you'll need to pass the ID received in the `defaultDatasetId` field - received in the response JSON to the - [Get dataset items](#/reference/datasets/item-collection/get-items) API endpoint. - operationId: actorTask_runs_post - parameters: - - $ref: "#/components/parameters/actorTaskId" - - $ref: "#/components/parameters/timeout" - - $ref: "#/components/parameters/memory" - - $ref: "#/components/parameters/maxItems" - - $ref: "#/components/parameters/maxTotalChargeUsd" - - $ref: "#/components/parameters/restartOnError" - - $ref: "#/components/parameters/build" - - $ref: "#/components/parameters/waitForFinishRun" - - $ref: "#/components/parameters/webhooks" - requestBody: - content: - application/json: - example: - foo: bar - schema: - type: object - '*/*': - schema: {} - description: "" - required: true - responses: - "201": - content: - application/json: - schema: - $ref: "#/components/schemas/actorTask_runs_post_201_response" - description: "" - headers: - Location: - content: - text/plain: - example: https://api.apify.com/v2/actor-tasks/zdc3Pyhyz3m8vjDeM/runs/HG7ML7M8z78YcAPEB - schema: - type: string - explode: false - style: simple - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "413": - $ref: "#/components/responses/PayloadTooLarge" - "415": - $ref: "#/components/responses/UnsupportedMediaType" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Run task - tags: - - Actor tasks - x-legacy-doc-urls: - - https://docs.apify.com/api/v2#/reference/actor-tasks/run-collection/run-task - - https://docs.apify.com/api/v2#/reference/actor-tasks/run-task - - https://docs.apify.com/api/v2#tag/Actor-tasksRun-collection/operation/actorTask_runs_post - x-js-parent: TaskClient - x-js-name: start - x-js-doc-url: https://docs.apify.com/api/client/js/reference/class/TaskClient#start - x-py-parent: TaskClientAsync - x-py-name: call - x-py-doc-url: https://docs.apify.com/api/client/python/reference/class/TaskClientAsync#call - /v2/actor-tasks/{actorTaskId}/run-sync: - get: - deprecated: false - description: | - Run a specific task and return its output. - - The run must finish in 300<!-- MAX_ACTOR_JOB_SYNC_WAIT_SECS --> seconds - otherwise the HTTP request fails with a timeout error (this won't abort - the run itself). - - Beware that it might be impossible to maintain an idle HTTP connection for - an extended period, due to client timeout or network conditions. Make sure your HTTP client is - configured to have a long enough connection timeout. - - If the connection breaks, you will not receive any information about the run - and its status. - - To run the Task asynchronously, use the - [Run task asynchronously](#/reference/actor-tasks/run-collection/run-task) - endpoint instead. - operationId: actorTask_runSync_get - parameters: - - $ref: "#/components/parameters/actorTaskId" - - $ref: "#/components/parameters/timeout" - - $ref: "#/components/parameters/memory" - - $ref: "#/components/parameters/maxItems" - - $ref: "#/components/parameters/build" - - $ref: "#/components/parameters/outputRecordKey" - - $ref: "#/components/parameters/webhooks" - responses: - "201": - content: - application/json: - example: - bar: foo - schema: - type: object - description: "" - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "408": - $ref: "#/components/responses/RunTimeout" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Run task synchronously - tags: - - Actor tasks - x-legacy-doc-urls: - - https://docs.apify.com/api/v2#/reference/actor-tasks/run-task-synchronously/run-task-synchronously-get - - https://docs.apify.com/api/v2#/reference/actor-tasks/run-task-synchronously-get - - https://docs.apify.com/api/v2#tag/Actor-tasksRun-task-synchronously/operation/actorTask_runSync_get - post: - deprecated: false - description: | - Runs an Actor task and synchronously returns its output. - - The run must finish in 300<!-- MAX_ACTOR_JOB_SYNC_WAIT_SECS --> seconds - otherwise the HTTP request fails with a timeout error (this won't abort - the run itself). - - Optionally, you can override the Actor input configuration by passing a JSON - object as the POST payload and setting the `Content-Type: application/json` HTTP header. - - Note that if the object in the POST payload does not define a particular - input property, the Actor run uses the default value defined by the task (or Actor's input - schema if not defined by the task). - - Beware that it might be impossible to maintain an idle HTTP connection for - an extended period, due to client timeout or network conditions. Make sure your HTTP client is - configured to have a long enough connection timeout. - - If the connection breaks, you will not receive any information about the run - and its status. - - Input fields from Actor task configuration can be overloaded with values - passed as the POST payload. - - Just make sure to specify `Content-Type` header to be `application/json` and - input to be an object. - - To run the task asynchronously, use the [Run - task](#/reference/actor-tasks/run-collection/run-task) API endpoint instead. - operationId: actorTask_runSync_post - parameters: - - $ref: "#/components/parameters/actorTaskId" - - $ref: "#/components/parameters/timeout" - - $ref: "#/components/parameters/memory" - - $ref: "#/components/parameters/maxItems" - - $ref: "#/components/parameters/maxTotalChargeUsd" - - $ref: "#/components/parameters/restartOnError" - - $ref: "#/components/parameters/build" - - $ref: "#/components/parameters/outputRecordKey" - - $ref: "#/components/parameters/webhooks" - requestBody: - content: - application/json: - example: - foo: bar - schema: - type: object - '*/*': - schema: {} - description: "" - required: true - responses: - "201": - content: - application/json: - example: - bar: foo - schema: - type: object - description: "" - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "413": - $ref: "#/components/responses/PayloadTooLarge" - "415": - $ref: "#/components/responses/UnsupportedMediaType" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Run task synchronously - tags: - - Actor tasks - x-legacy-doc-urls: - - https://docs.apify.com/api/v2#/reference/actor-tasks/run-task-synchronously/run-task-synchronously-post - - https://docs.apify.com/api/v2#/reference/actor-tasks/run-task-synchronously-post - - https://docs.apify.com/api/v2#tag/Actor-tasksRun-task-synchronously/operation/actorTask_runSync_post - /v2/actor-tasks/{actorTaskId}/run-sync-get-dataset-items: - get: - deprecated: false - description: | - Run a specific task and return its dataset items. - - The run must finish in 300<!-- MAX_ACTOR_JOB_SYNC_WAIT_SECS --> seconds - otherwise the HTTP request fails with a timeout error (this won't abort - the run itself). - - You can send all the same options in parameters as the [Get Dataset - Items](#/reference/datasets/item-collection/get-items) API endpoint. - - Beware that it might be impossible to maintain an idle HTTP connection for - an extended period, due to client timeout or network conditions. Make sure your HTTP client is - configured to have a long enough connection timeout. - - If the connection breaks, you will not receive any information about the run - and its status. - - To run the Task asynchronously, use the [Run task - asynchronously](#/reference/actor-tasks/run-collection/run-task) endpoint - instead. - operationId: actorTask_runSyncGetDatasetItems_get - parameters: - - $ref: "#/components/parameters/actorTaskId" - - $ref: "#/components/parameters/timeout" - - $ref: "#/components/parameters/memory" - - $ref: "#/components/parameters/maxItems" - - $ref: "#/components/parameters/build" - - $ref: "#/components/parameters/webhooks" - - $ref: "#/components/parameters/format" - - $ref: "#/components/parameters/clean" - - $ref: "#/components/parameters/offset" - - $ref: "#/components/parameters/datasetParameters_limit" - - $ref: "#/components/parameters/fields" - - $ref: "#/components/parameters/outputFields" - - $ref: "#/components/parameters/omit" - - $ref: "#/components/parameters/unwind" - - $ref: "#/components/parameters/flatten" - - $ref: "#/components/parameters/descDataset" - - $ref: "#/components/parameters/attachment" - - $ref: "#/components/parameters/delimiter" - - $ref: "#/components/parameters/bom" - - $ref: "#/components/parameters/xmlRoot" - - $ref: "#/components/parameters/xmlRow" - - $ref: "#/components/parameters/skipHeaderRow" - - $ref: "#/components/parameters/skipHidden" - - $ref: "#/components/parameters/skipEmpty" - - $ref: "#/components/parameters/simplified" - - $ref: "#/components/parameters/view" - - $ref: "#/components/parameters/skipFailedPages" - - $ref: "#/components/parameters/feedTitle" - - $ref: "#/components/parameters/feedDescription" - responses: - "201": - content: - application/json: - schema: - type: object - description: "" - headers: - X-Apify-Pagination-Offset: - content: - text/plain: - example: "0" - schema: {} - description: The offset of the first item in the current page. - explode: false - style: simple - X-Apify-Pagination-Limit: - content: - text/plain: - example: "100" - schema: {} - description: The maximum number of items returned per page. - explode: false - style: simple - X-Apify-Pagination-Count: - content: - text/plain: - example: "100" - schema: {} - description: The number of items returned in the current page. - explode: false - style: simple - X-Apify-Pagination-Total: - content: - text/plain: - example: "10204" - schema: {} - description: The total number of items in the dataset. - explode: false - style: simple - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "408": - $ref: "#/components/responses/RunTimeout" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Run task synchronously and get dataset items - tags: - - Actor tasks - x-legacy-doc-urls: - - https://docs.apify.com/api/v2#/reference/actor-tasks/run-task-synchronously-and-get-dataset-items/run-task-synchronously-and-get-dataset-items-get - - https://docs.apify.com/api/v2#/reference/actor-tasks/run-task-synchronously-and-get-dataset-items-get - - https://docs.apify.com/api/v2#tag/Actor-tasksRun-task-synchronously-and-get-dataset-items/operation/actorTask_runSyncGetDatasetItems_get - post: - deprecated: false - description: | - Runs an Actor task and synchronously returns its dataset items. - - The run must finish in 300<!-- MAX_ACTOR_JOB_SYNC_WAIT_SECS --> seconds - otherwise the HTTP request fails with a timeout error (this won't abort - the run itself). - - Optionally, you can override the Actor input configuration by passing a JSON - object as the POST payload and setting the `Content-Type: application/json` HTTP header. - - Note that if the object in the POST payload does not define a particular - input property, the Actor run uses the default value defined by the task (or the Actor's - input schema if not defined by the task). - - You can send all the same options in parameters as the [Get Dataset - Items](#/reference/datasets/item-collection/get-items) API endpoint. - - Beware that it might be impossible to maintain an idle HTTP connection for - an extended period, due to client timeout or network conditions. Make sure your HTTP client is - configured to have a long enough connection timeout. - - If the connection breaks, you will not receive any information about the run - and its status. - - Input fields from Actor task configuration can be overloaded with values - passed as the POST payload. - - Just make sure to specify the `Content-Type` header as `application/json` - and that the input is an object. - - To run the task asynchronously, use the [Run - task](#/reference/actor-tasks/run-collection/run-task) API endpoint instead. - operationId: actorTask_runSyncGetDatasetItems_post - parameters: - - $ref: "#/components/parameters/actorTaskId" - - $ref: "#/components/parameters/timeout" - - $ref: "#/components/parameters/memory" - - $ref: "#/components/parameters/maxItems" - - $ref: "#/components/parameters/maxTotalChargeUsd" - - $ref: "#/components/parameters/restartOnError" - - $ref: "#/components/parameters/build" - - $ref: "#/components/parameters/webhooks" - - $ref: "#/components/parameters/format" - - $ref: "#/components/parameters/clean" - - $ref: "#/components/parameters/offset" - - $ref: "#/components/parameters/datasetParameters_limit" - - $ref: "#/components/parameters/fields" - - $ref: "#/components/parameters/outputFields" - - $ref: "#/components/parameters/omit" - - $ref: "#/components/parameters/unwind" - - $ref: "#/components/parameters/flatten" - - $ref: "#/components/parameters/descDataset" - - $ref: "#/components/parameters/attachment" - - $ref: "#/components/parameters/delimiter" - - $ref: "#/components/parameters/bom" - - $ref: "#/components/parameters/xmlRoot" - - $ref: "#/components/parameters/xmlRow" - - $ref: "#/components/parameters/skipHeaderRow" - - $ref: "#/components/parameters/skipHidden" - - $ref: "#/components/parameters/skipEmpty" - - $ref: "#/components/parameters/simplified" - - $ref: "#/components/parameters/view" - - $ref: "#/components/parameters/skipFailedPages" - - $ref: "#/components/parameters/feedTitle" - - $ref: "#/components/parameters/feedDescription" - requestBody: - content: - application/json: - example: - foo: bar - schema: - type: object - '*/*': - schema: {} - description: "" - required: true - responses: - "201": - content: - application/json: - schema: - type: object - description: "" - headers: - X-Apify-Pagination-Offset: - content: - text/plain: - example: "0" - schema: {} - description: The offset of the first item in the current page. - explode: false - style: simple - X-Apify-Pagination-Limit: - content: - text/plain: - example: "100" - schema: {} - description: The maximum number of items returned per page. - explode: false - style: simple - X-Apify-Pagination-Count: - content: - text/plain: - example: "100" - schema: {} - description: The number of items returned in the current page. - explode: false - style: simple - X-Apify-Pagination-Total: - content: - text/plain: - example: "10204" - schema: {} - description: The total number of items in the dataset. - explode: false - style: simple - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "413": - $ref: "#/components/responses/PayloadTooLarge" - "415": - $ref: "#/components/responses/UnsupportedMediaType" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Run task synchronously and get dataset items - tags: - - Actor tasks - x-legacy-doc-urls: - - https://docs.apify.com/api/v2#/reference/actor-tasks/run-task-synchronously-and-get-dataset-items/run-task-synchronously-and-get-dataset-items-post - - https://docs.apify.com/api/v2#/reference/actor-tasks/run-task-synchronously-and-get-dataset-items-post - - https://docs.apify.com/api/v2#tag/Actor-tasksRun-task-synchronously-and-get-dataset-items/operation/actorTask_runSyncGetDatasetItems_post - /v2/actor-tasks/{actorTaskId}/runs/last: - get: - deprecated: false - description: | - This is not a single endpoint, but an entire group of endpoints that lets you to - retrieve and manage the last run of given actor task or any of its default storages. - All the endpoints require an authentication token. - - The base path represents the last actor task run object is: - - `/v2/actor-tasks/{actorTaskId}/runs/last{?token,status}` - - Using the `status` query parameter you can ensure to only get a run with a certain status - (e.g. `status=SUCCEEDED`). The output of this endpoint and other query parameters - are the same as in the [Run object](/api/v2/actor-run-get) endpoint. - - ##### Convenience endpoints for last Actor task run - - * [Dataset](/api/v2/last-actor-task-runs-default-dataset) - - * [Key-value store](/api/v2/last-actor-task-runs-default-key-value-store) - - * [Request queue](/api/v2/last-actor-task-runs-default-request-queue) - - * [Log](/api/v2/last-actor-task-runs-log) - operationId: actorTask_runs_last_get - parameters: - - $ref: "#/components/parameters/actorTaskId" - - $ref: "#/components/parameters/statusLastRun" - - $ref: "#/components/parameters/waitForFinishRun" - responses: - "200": - content: - application/json: - schema: - $ref: "#/components/schemas/actorTask_runs_post_201_response" - description: "" - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Get last run - tags: - - Actor tasks - x-legacy-doc-urls: - - https://docs.apify.com/api/v2#/reference/actor-tasks/last-run-object-and-its-storages - /v2/actor-tasks/{actorTaskId}/runs/last/log: - get: - deprecated: false - description: | - Retrieves last Actor task run's logs. - - This endpoint is a shortcut for getting last Actor task run's log. Same as [Get log](/api/v2/log-get) endpoint. - operationId: actorTask_last_log_get - parameters: - - $ref: "#/components/parameters/actorTaskId" - - $ref: "#/components/parameters/stream" - - $ref: "#/components/parameters/download" - - $ref: "#/components/parameters/raw" - responses: - "200": - content: - text/plain: - schema: - example: | - 2017-07-14T06:00:49.733Z Application started. - 2017-07-14T06:00:49.741Z Input: { test: 123 } - 2017-07-14T06:00:49.752Z Some useful debug information follows. - type: string - description: "" - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Get last Actor task run's log - tags: - - Last Actor task run's log - /v2/actor-tasks/{actorTaskId}/runs/last/abort: - post: - deprecated: false - description: | - Aborts the last run of the specified Actor task and returns an object that - contains all the details about the run. - - This endpoint is a shortcut for [Abort run](#/reference/actor-runs/abort-run/abort-run) - on the Actor task's last run. Only runs that are starting or running are aborted. - For runs with status `FINISHED`, `FAILED`, `ABORTING` and `TIMED-OUT` this call - does nothing. - operationId: actorTask_runs_last_abort_post - parameters: - - $ref: "#/components/parameters/actorTaskId" - - $ref: "#/components/parameters/statusLastRun" - - $ref: "#/components/parameters/gracefully" - responses: - "200": - content: - application/json: - example: - data: - id: HG7ML7M8z78YcAPEB - actId: janedoe~my-actor - userId: BPWZBd7Z9c746JAng - actorTaskId: rANaydYhUxjsnA3oz - startedAt: 2019-11-30T07:34:24.202Z - finishedAt: 2019-12-12T09:30:12.202Z - status: ABORTED - statusMessage: Actor was aborted - isStatusMessageTerminal: true - meta: - origin: WEB - clientIp: 172.234.12.34 - userAgent: Mozilla/5.0 (iPad) - stats: - inputBodyLen: 240 - migrationCount: 0 - restartCount: 0 - resurrectCount: 1 - memAvgBytes: 3.59142284E7 - memMaxBytes: 38244352 - memCurrentBytes: 0 - cpuAvgUsage: 0.00955965 - cpuMaxUsage: 3.1546 - cpuCurrentUsage: 0 - netRxBytes: 2652 - netTxBytes: 1338 - durationMillis: 26239 - runTimeSecs: 26.239 - metamorph: 0 - computeUnits: 0.0072886 - options: - build: latest - timeoutSecs: 300 - memoryMbytes: 1024 - diskMbytes: 2048 - buildId: 7sT5jcggjjA9fNcxF - exitCode: 0 - generalAccess: RESTRICTED - defaultKeyValueStoreId: eJNzqsbPiopwJcgGQ - defaultDatasetId: wmKPijuyDnPZAPRMk - defaultRequestQueueId: FL35cSF7jrxr3BY39 - storageIds: - datasets: - default: wmKPijuyDnPZAPRMk - keyValueStores: - default: eJNzqsbPiopwJcgGQ - requestQueues: - default: FL35cSF7jrxr3BY39 - isContainerServerReady: false - gitBranchName: master - usage: - ACTOR_COMPUTE_UNITS: 3 - DATASET_READS: 4 - DATASET_WRITES: 4 - KEY_VALUE_STORE_READS: 5 - KEY_VALUE_STORE_WRITES: 3 - KEY_VALUE_STORE_LISTS: 5 - REQUEST_QUEUE_READS: 2 - REQUEST_QUEUE_WRITES: 1 - DATA_TRANSFER_INTERNAL_GBYTES: 1 - DATA_TRANSFER_EXTERNAL_GBYTES: 3 - PROXY_RESIDENTIAL_TRANSFER_GBYTES: 34 - PROXY_SERPS: 3 - usageTotalUsd: 0.2654 - usageUsd: - ACTOR_COMPUTE_UNITS: 0.072 - DATASET_READS: 4.0E-4 - DATASET_WRITES: 2.0E-4 - KEY_VALUE_STORE_READS: 6.0E-4 - KEY_VALUE_STORE_WRITES: 0.002 - KEY_VALUE_STORE_LISTS: 0.004 - REQUEST_QUEUE_READS: 0.005 - REQUEST_QUEUE_WRITES: 0.02 - DATA_TRANSFER_INTERNAL_GBYTES: 4.0E-4 - DATA_TRANSFER_EXTERNAL_GBYTES: 2.0E-4 - PROXY_RESIDENTIAL_TRANSFER_GBYTES: 0.16 - PROXY_SERPS: 6.0E-4 - schema: - $ref: "#/components/schemas/RunResponse" - description: "" - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Abort Actor task's last run - tags: - - Last Actor task run's abort - /v2/actor-tasks/{actorTaskId}/runs/last/metamorph: - post: - deprecated: false - description: | - Transforms the last run of the specified Actor task into a run of another Actor with - a new input. - - This endpoint is a shortcut for [Metamorph run](#/reference/actor-runs/metamorph-run/metamorph-run) - on the Actor task's last run. - operationId: actorTask_runs_last_metamorph_post - parameters: - - $ref: "#/components/parameters/actorTaskId" - - $ref: "#/components/parameters/statusLastRun" - - $ref: "#/components/parameters/targetActorId" - - description: | - Optional build of the target Actor. - - It can be either a build tag or build number. By default, the run uses - the build specified in the default run configuration for the target - Actor (typically `latest`). - explode: true - in: query - name: build - required: false - schema: - example: beta - type: string - style: form - responses: - "200": - content: - application/json: - schema: - $ref: "#/components/schemas/RunResponse" - description: "" - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Metamorph Actor task's last run - tags: - - Last Actor task run's metamorph - /v2/actor-tasks/{actorTaskId}/runs/last/reboot: - post: - deprecated: false - description: | - Reboots the last run of the specified Actor task and returns an object that - contains all the details about the rebooted run. - - This endpoint is a shortcut for [Reboot run](#/reference/actor-runs/reboot-run/reboot-run) - on the Actor task's last run. Only runs with status `RUNNING` can be rebooted. The run's - container will be restarted, so any data not persisted in the key-value store, dataset, - or request queue will be lost. - operationId: actorTask_runs_last_reboot_post - parameters: - - $ref: "#/components/parameters/actorTaskId" - - $ref: "#/components/parameters/statusLastRun" - responses: - "200": - content: - application/json: - schema: - $ref: "#/components/schemas/RunResponse" - description: "" - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Reboot Actor task's last run - tags: - - Last Actor task run's reboot - /v2/actor-tasks/{actorTaskId}/runs/last/dataset: - delete: - deprecated: false - description: | - Deletes the default dataset associated with the last Actor task run. - - This endpoint is a shortcut for getting the last task run's `defaultDatasetId` and then using the - [Delete dataset](/api/v2/dataset-delete) endpoint. - operationId: actorTask_runs_last_dataset_delete - parameters: - - $ref: "#/components/parameters/actorTaskId" - - $ref: "#/components/parameters/statusLastRun" - responses: - "204": - $ref: "#/components/responses/NoContent" - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Delete last task run's default dataset - tags: - - Last Actor task run's default dataset - get: - deprecated: false - description: | - Returns the default dataset associated with the last Actor task run. - - This endpoint is a shortcut for getting the last task run's `defaultDatasetId` and then using the - [Get dataset](/api/v2/dataset-get) endpoint. - operationId: actorTask_runs_last_dataset_get - parameters: - - $ref: "#/components/parameters/actorTaskId" - - $ref: "#/components/parameters/statusLastRun" - responses: - "200": - content: - application/json: - schema: - $ref: "#/components/schemas/DatasetResponse" - description: "" - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Get last task run's default dataset - tags: - - Last Actor task run's default dataset - put: - deprecated: false - description: | - Updates the default dataset associated with the last Actor task run. - - This endpoint is a shortcut for getting the last task run's `defaultDatasetId` and then using the - [Update dataset](/api/v2/dataset-put) endpoint. - operationId: actorTask_runs_last_dataset_put - parameters: - - $ref: "#/components/parameters/actorTaskId" - - $ref: "#/components/parameters/statusLastRun" - requestBody: - content: - application/json: - schema: - $ref: "#/components/schemas/UpdateDatasetRequest" - description: "" - required: true - responses: - "200": - content: - application/json: - schema: - $ref: "#/components/schemas/DatasetResponse" - description: "" - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "413": - $ref: "#/components/responses/PayloadTooLarge" - "415": - $ref: "#/components/responses/UnsupportedMediaType" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Update last task run's default dataset - tags: - - Last Actor task run's default dataset - /v2/actor-tasks/{actorTaskId}/runs/last/dataset/items: - get: - deprecated: false - description: | - Returns data stored in the default dataset of the last Actor task run in the desired format. - - This endpoint is a shortcut that resolves the last task run's `defaultDatasetId` and proxies to the - [Get dataset items](/api/v2/dataset-items-get) endpoint. - operationId: actorTask_runs_last_dataset_items_get - parameters: - - $ref: "#/components/parameters/actorTaskId" - - $ref: "#/components/parameters/statusLastRun" - - $ref: "#/components/parameters/format" - - $ref: "#/components/parameters/clean" - - $ref: "#/components/parameters/offset" - - $ref: "#/components/parameters/datasetParameters_limit" - - $ref: "#/components/parameters/fields" - - $ref: "#/components/parameters/outputFields" - - $ref: "#/components/parameters/omit" - - $ref: "#/components/parameters/unwind" - - $ref: "#/components/parameters/flatten" - - $ref: "#/components/parameters/descDataset" - - $ref: "#/components/parameters/attachment" - - $ref: "#/components/parameters/delimiter" - - $ref: "#/components/parameters/bom" - - $ref: "#/components/parameters/xmlRoot" - - $ref: "#/components/parameters/xmlRow" - - $ref: "#/components/parameters/skipHeaderRow" - - $ref: "#/components/parameters/skipHidden" - - $ref: "#/components/parameters/skipEmpty" - - $ref: "#/components/parameters/simplified" - - $ref: "#/components/parameters/view" - - $ref: "#/components/parameters/skipFailedPages" - - $ref: "#/components/parameters/feedTitle" - - $ref: "#/components/parameters/feedDescription" - - $ref: "#/components/parameters/signature" - responses: - "200": - content: - application/json: - schema: - example: - - foo: bar - - foo2: bar2 - items: - type: object - type: array - default: null - application/jsonl: - example: "{\"foo\":\"bar\"}\\n{\"foo2\":\"bar2\"}\\n" - schema: - type: string - text/csv: - example: "foo,bar\\nfoo2,bar2\\n" - schema: - type: string - text/html: - example: <table><tr><th>foo</th><th>bar</th></tr><tr><td>foo</td><td>bar</td></tr><tr><td>foo2</td><td>bar2</td></tr></table> - schema: - type: string - application/vnd.openxmlformats-officedocument.spreadsheetml.sheet: - schema: - type: string - application/rss+xml: - example: <rss><channel><item><foo>bar</foo></item><item><foo2>bar2</foo2></item></channel></rss> - schema: - type: string - application/xml: - example: <items><item><foo>bar</foo></item><item><foo2>bar2</foo2></item></items> - schema: - type: string - description: "" - headers: - X-Apify-Pagination-Offset: - content: - text/plain: - example: "0" - schema: {} - description: The offset of the first item in the current page. - explode: false - style: simple - X-Apify-Pagination-Limit: - content: - text/plain: - example: "100" - schema: {} - description: The maximum number of items returned per page. - explode: false - style: simple - X-Apify-Pagination-Count: - content: - text/plain: - example: "100" - schema: {} - description: The number of items returned in the current page. - explode: false - style: simple - X-Apify-Pagination-Total: - content: - text/plain: - example: "10204" - schema: {} - description: The total number of items in the dataset. - explode: false - style: simple - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Get last task run's dataset items - tags: - - Last Actor task run's default dataset - post: - deprecated: false - description: | - Appends an item or an array of items to the end of the last Actor task run's default dataset. - - This endpoint is a shortcut that resolves the last task run's `defaultDatasetId` and proxies to the - [Store items](/api/v2/dataset-items-post) endpoint. - operationId: actorTask_runs_last_dataset_items_post - parameters: - - $ref: "#/components/parameters/actorTaskId" - - $ref: "#/components/parameters/statusLastRun" - requestBody: - content: - application/json: - schema: - $ref: "#/components/schemas/act_runs_last_dataset_items_post_request" - description: "" - required: true - responses: - "201": - content: - application/json: - schema: - example: {} - type: object - description: "" - headers: - Location: - content: - text/plain: - example: https://api.apify.com/v2/datasets/WkzbQMuFYuamGv3YF/items - schema: - type: string - explode: false - style: simple - "400": - content: - application/json: - schema: - $ref: "#/components/schemas/act_runs_last_dataset_items_post_400_response" - description: "" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Store items in last task run's dataset - tags: - - Last Actor task run's default dataset - /v2/actor-tasks/{actorTaskId}/runs/last/dataset/statistics: - get: - description: | - Returns statistics for the last Actor task run's default dataset. - - This endpoint is a shortcut that resolves the last task run's `defaultDatasetId` and proxies to the - [Get dataset statistics](/api/v2/dataset-statistics-get) endpoint. - operationId: actorTask_runs_last_dataset_statistics_get - parameters: - - $ref: "#/components/parameters/actorTaskId" - - $ref: "#/components/parameters/statusLastRun" - responses: - "200": - content: - application/json: - schema: - $ref: "#/components/schemas/DatasetStatisticsResponse" - description: "" - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Get last task run's dataset statistics - tags: - - Last Actor task run's default dataset - /v2/actor-tasks/{actorTaskId}/runs/last/key-value-store: - delete: - deprecated: false - description: | - Deletes the default key-value store of the last Actor task run. - - This endpoint is a shortcut for getting the last task run's `defaultKeyValueStoreId` and then using the - [Delete store](/api/v2/key-value-store-delete) endpoint. - operationId: actorTask_runs_last_keyValueStore_delete - parameters: - - $ref: "#/components/parameters/actorTaskId" - - $ref: "#/components/parameters/statusLastRun" - responses: - "204": - $ref: "#/components/responses/NoContent" - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Delete last task run's default store - tags: - - Last Actor task run's default key-value store - get: - deprecated: false - description: | - Gets an object that contains all the details about the default key-value store of the last Actor task run. - - This endpoint is a shortcut for getting the last task run's `defaultKeyValueStoreId` and then using the - [Get store](/api/v2/key-value-store-get) endpoint. - operationId: actorTask_runs_last_keyValueStore_get - parameters: - - $ref: "#/components/parameters/actorTaskId" - - $ref: "#/components/parameters/statusLastRun" - responses: - "200": - content: - application/json: - schema: - $ref: "#/components/schemas/KeyValueStoreResponse" - description: "" - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Get last task run's default store - tags: - - Last Actor task run's default key-value store - put: - deprecated: false - description: | - Updates the default key-value store associated with the last Actor task run. - - This endpoint is a shortcut for getting the last task run's `defaultKeyValueStoreId` and then using the - [Update store](/api/v2/key-value-store-put) endpoint. - operationId: actorTask_runs_last_keyValueStore_put - parameters: - - $ref: "#/components/parameters/actorTaskId" - - $ref: "#/components/parameters/statusLastRun" - requestBody: - content: - application/json: - example: - name: new-store-name - schema: - $ref: "#/components/schemas/UpdateStoreRequest" - description: "" - required: true - responses: - "200": - content: - application/json: - schema: - $ref: "#/components/schemas/KeyValueStoreResponse" - description: "" - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "413": - $ref: "#/components/responses/PayloadTooLarge" - "415": - $ref: "#/components/responses/UnsupportedMediaType" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Update last task run's default store - tags: - - Last Actor task run's default key-value store - /v2/actor-tasks/{actorTaskId}/runs/last/key-value-store/keys: - get: - deprecated: false - description: | - Returns a list of keys for the default key-value store of the last Actor task run. - - This endpoint is a shortcut for getting the last task run's `defaultKeyValueStoreId` and then using the - [Get list of keys](/api/v2/key-value-store-keys-get) endpoint. - operationId: actorTask_runs_last_keyValueStore_keys_get - parameters: - - $ref: "#/components/parameters/actorTaskId" - - $ref: "#/components/parameters/statusLastRun" - - $ref: "#/components/parameters/exclusiveStartKey" - - $ref: "#/components/parameters/keyValueStoreParameters_limit" - - $ref: "#/components/parameters/collectionKeys" - - $ref: "#/components/parameters/prefixKeys" - - $ref: "#/components/parameters/signature" - responses: - "200": - content: - application/json: - schema: - $ref: "#/components/schemas/ListOfKeysResponse" - description: "" - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Get last task run's default store's list of keys - tags: - - Last Actor task run's default key-value store - /v2/actor-tasks/{actorTaskId}/runs/last/key-value-store/records: - get: - deprecated: false - description: | - Downloads all records from the default key-value store of the last Actor task run as a ZIP archive. - - This endpoint is a shortcut for getting the last task run's `defaultKeyValueStoreId` and then using the - [Download records](/api/v2/key-value-store-records-get) endpoint. - operationId: actorTask_runs_last_keyValueStore_records_get - parameters: - - $ref: "#/components/parameters/actorTaskId" - - $ref: "#/components/parameters/statusLastRun" - - $ref: "#/components/parameters/collectionRecords" - - $ref: "#/components/parameters/prefixRecords" - - $ref: "#/components/parameters/signature" - responses: - "200": - content: - application/zip: - schema: - format: binary - type: string - description: A ZIP archive containing the requested records. - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Download last task run's default store's records - tags: - - Last Actor task run's default key-value store - /v2/actor-tasks/{actorTaskId}/runs/last/key-value-store/records/{recordKey}: - delete: - deprecated: false - description: | - Removes a record specified by a key from the default key-value store of the last Actor task run. - - This endpoint is a shortcut for getting the last task run's `defaultKeyValueStoreId` and then using the - [Delete record](/api/v2/key-value-store-record-delete) endpoint. - operationId: actorTask_runs_last_keyValueStore_record_delete - parameters: - - $ref: "#/components/parameters/actorTaskId" - - $ref: "#/components/parameters/statusLastRun" - - $ref: "#/components/parameters/recordKey" - responses: - "204": - $ref: "#/components/responses/NoContent" - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Delete last task run's default store's record - tags: - - Last Actor task run's default key-value store - get: - deprecated: false - description: | - Gets a value stored under a specific key in the default key-value store of the last Actor task run. - - This endpoint is a shortcut for getting the last task run's `defaultKeyValueStoreId` and then using the - [Get record](/api/v2/key-value-store-record-get) endpoint. - operationId: actorTask_runs_last_keyValueStore_record_get - parameters: - - $ref: "#/components/parameters/actorTaskId" - - $ref: "#/components/parameters/statusLastRun" - - $ref: "#/components/parameters/recordKey" - - $ref: "#/components/parameters/signature" - - $ref: "#/components/parameters/keyValueStoreParameters_attachment" - responses: - "200": - content: - application/json: - schema: - $ref: "#/components/schemas/RecordResponse" - '*/*': - schema: {} - description: "" - "302": - content: {} - description: "" - headers: - Location: - content: - text/plain: - example: https://apifier-key-value-store-prod.s3.amazonaws.com/tqx6jeMia43gYY6eE/INPUT?AWSAccessKeyId=NKDOUN&Expires=1502720992&Signature=DKLVPI4lDDKC - schema: - type: string - explode: false - style: simple - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Get last task run's default store's record - tags: - - Last Actor task run's default key-value store - post: - deprecated: false - description: | - Stores a value under a specific key in the default key-value store of the last Actor task run. - - This endpoint is a shortcut for getting the last task run's `defaultKeyValueStoreId` and then using the - [Store record](/api/v2/key-value-store-record-post) endpoint. - operationId: actorTask_runs_last_keyValueStore_record_post - parameters: - - $ref: "#/components/parameters/actorTaskId" - - $ref: "#/components/parameters/statusLastRun" - - $ref: "#/components/parameters/recordKey" - - $ref: "#/components/parameters/Content-Encoding" - requestBody: - content: - application/json: - schema: - $ref: "#/components/schemas/PutRecordRequest" - '*/*': - schema: {} - description: "" - required: true - responses: - "201": - content: - application/json: - example: {} - schema: - type: object - description: "" - headers: - Location: - content: - text/plain: - example: https://api.apify.com/v2/key-value-stores/WkzbQMuFYuamGv3YF/records/some-key - schema: - type: string - explode: false - style: simple - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "413": - $ref: "#/components/responses/PayloadTooLarge" - "415": - $ref: "#/components/responses/UnsupportedMediaType" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Store record in last task run's default store (POST) - tags: - - Last Actor task run's default key-value store - put: - deprecated: false - description: | - Stores a value under a specific key in the default key-value store of the last Actor task run. - - This endpoint is a shortcut for getting the last task run's `defaultKeyValueStoreId` and then using the - [Store record](/api/v2/key-value-store-record-put) endpoint. - operationId: actorTask_runs_last_keyValueStore_record_put - parameters: - - $ref: "#/components/parameters/actorTaskId" - - $ref: "#/components/parameters/statusLastRun" - - $ref: "#/components/parameters/recordKey" - - $ref: "#/components/parameters/Content-Encoding" - requestBody: - content: - application/json: - schema: - $ref: "#/components/schemas/PutRecordRequest" - '*/*': - schema: {} - description: "" - required: true - responses: - "201": - content: - application/json: - example: {} - schema: - type: object - description: "" - headers: - Location: - content: - text/plain: - example: https://api.apify.com/v2/key-value-stores/WkzbQMuFYuamGv3YF/records/some-key - schema: - type: string - explode: false - style: simple - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "413": - $ref: "#/components/responses/PayloadTooLarge" - "415": - $ref: "#/components/responses/UnsupportedMediaType" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Store record in last task run's default store - tags: - - Last Actor task run's default key-value store - /v2/actor-tasks/{actorTaskId}/runs/last/request-queue: - delete: - deprecated: false - description: | - Deletes the default request queue associated with the last Actor task run. - - This endpoint is a shortcut for getting the last task run's `defaultRequestQueueId` and then using the - [Delete request queue](/api/v2/request-queue-delete) endpoint. - operationId: actorTask_runs_last_requestQueue_delete - parameters: - - $ref: "#/components/parameters/actorTaskId" - - $ref: "#/components/parameters/statusLastRun" - responses: - "204": - $ref: "#/components/responses/NoContent" - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Delete last task run's default request queue - tags: - - Last Actor task run's default request queue - get: - deprecated: false - description: | - Returns the default request queue associated with the last Actor task run. - - This endpoint is a shortcut for getting the last task run's `defaultRequestQueueId` and then using the - [Get request queue](/api/v2/request-queue-get) endpoint. - operationId: actorTask_runs_last_requestQueue_get - parameters: - - $ref: "#/components/parameters/actorTaskId" - - $ref: "#/components/parameters/statusLastRun" - responses: - "200": - content: - application/json: - schema: - $ref: "#/components/schemas/RequestQueueResponse" - description: "" - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Get last task run's default request queue - tags: - - Last Actor task run's default request queue - put: - deprecated: false - description: | - Updates the default request queue associated with the last Actor task run. - - This endpoint is a shortcut for getting the last task run's `defaultRequestQueueId` and then using the - [Update request queue](/api/v2/request-queue-put) endpoint. - operationId: actorTask_runs_last_requestQueue_put - parameters: - - $ref: "#/components/parameters/actorTaskId" - - $ref: "#/components/parameters/statusLastRun" - requestBody: - content: - application/json: - example: - name: new-request-queue-name - schema: - allOf: - - $ref: "#/components/schemas/UpdateRequestQueueRequest" - example: - name: new-request-queue-name - description: "" - required: true - responses: - "200": - content: - application/json: - schema: - $ref: "#/components/schemas/RequestQueueResponse" - description: "" - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "413": - $ref: "#/components/responses/PayloadTooLarge" - "415": - $ref: "#/components/responses/UnsupportedMediaType" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Update last task run's default request queue - tags: - - Last Actor task run's default request queue - /v2/actor-tasks/{actorTaskId}/runs/last/request-queue/head: - get: - deprecated: false - description: | - Returns the given number of first requests from the default request queue of the last Actor task run. - - This endpoint is a shortcut for getting the last task run's `defaultRequestQueueId` and then using the - [Get head](/api/v2/request-queue-head-get) endpoint. - operationId: actorTask_runs_last_requestQueue_head_get - parameters: - - $ref: "#/components/parameters/actorTaskId" - - $ref: "#/components/parameters/statusLastRun" - - $ref: "#/components/parameters/headLimit" - - $ref: "#/components/parameters/clientKey" - responses: - "200": - content: - application/json: - schema: - $ref: "#/components/schemas/HeadResponse" - description: "" - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Get last task run's default request queue head - tags: - - Last Actor task run's default request queue - /v2/actor-tasks/{actorTaskId}/runs/last/request-queue/head/lock: - post: - deprecated: false - description: | - Returns the given number of first requests from the default request queue of the last Actor task run - and locks them for the given time. - - This endpoint is a shortcut for getting the last task run's `defaultRequestQueueId` and then using the - [Get head and lock](/api/v2/request-queue-head-lock-post) endpoint. - operationId: actorTask_runs_last_requestQueue_head_lock_post - parameters: - - $ref: "#/components/parameters/actorTaskId" - - $ref: "#/components/parameters/statusLastRun" - - $ref: "#/components/parameters/lockSecs" - - $ref: "#/components/parameters/headLockLimit" - - $ref: "#/components/parameters/clientKey" - responses: - "201": - content: - application/json: - schema: - $ref: "#/components/schemas/HeadAndLockResponse" - description: "" - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Get and lock last task run's default request queue head - tags: - - Last Actor task run's default request queue - /v2/actor-tasks/{actorTaskId}/runs/last/request-queue/requests: - get: - deprecated: false - description: | - Returns a list of requests from the default request queue of the last Actor task run. - - This endpoint is a shortcut for getting the last task run's `defaultRequestQueueId` and then using the - [List requests](/api/v2/request-queue-requests-get) endpoint. - operationId: actorTask_runs_last_requestQueue_requests_get - parameters: - - $ref: "#/components/parameters/actorTaskId" - - $ref: "#/components/parameters/statusLastRun" - - $ref: "#/components/parameters/clientKey" - - $ref: "#/components/parameters/exclusiveStartId" - - $ref: "#/components/parameters/listLimit" - - $ref: "#/components/parameters/cursor" - - $ref: "#/components/parameters/filter" - responses: - "200": - content: - application/json: - schema: - $ref: "#/components/schemas/ListOfRequestsResponse" - description: "" - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: List last task run's default request queue's requests - tags: - - Last Actor task run's default request queue - post: - deprecated: false - description: | - Adds a request to the default request queue of the last Actor task run. - - This endpoint is a shortcut for getting the last task run's `defaultRequestQueueId` and then using the - [Add request](/api/v2/request-queue-requests-post) endpoint. - operationId: actorTask_runs_last_requestQueue_requests_post - parameters: - - $ref: "#/components/parameters/actorTaskId" - - $ref: "#/components/parameters/statusLastRun" - - $ref: "#/components/parameters/clientKey" - - $ref: "#/components/parameters/forefront" - requestBody: - content: - application/json: - schema: - $ref: "#/components/schemas/RequestBase" - description: "" - required: true - responses: - "201": - content: - application/json: - schema: - $ref: "#/components/schemas/AddRequestResponse" - description: "" - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "413": - $ref: "#/components/responses/PayloadTooLarge" - "415": - $ref: "#/components/responses/UnsupportedMediaType" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Add request to last task run's default request queue - tags: - - Last Actor task run's default request queue - /v2/actor-tasks/{actorTaskId}/runs/last/request-queue/requests/batch: - delete: - deprecated: false - description: | - Batch-deletes requests from the default request queue of the last Actor task run. - - This endpoint is a shortcut for getting the last task run's `defaultRequestQueueId` and then using the - [Delete requests](/api/v2/request-queue-requests-batch-delete) endpoint. - operationId: actorTask_runs_last_requestQueue_requests_batch_delete - parameters: - - $ref: "#/components/parameters/actorTaskId" - - $ref: "#/components/parameters/statusLastRun" - - $ref: "#/components/parameters/contentTypeJson" - - $ref: "#/components/parameters/clientKey" - requestBody: - content: - application/json: - schema: - items: - $ref: "#/components/schemas/RequestDraftDelete" - type: array - default: null - description: "" - required: true - responses: - "200": - content: - application/json: - schema: - $ref: "#/components/schemas/BatchDeleteResponse" - description: "" - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "413": - $ref: "#/components/responses/PayloadTooLarge" - "415": - $ref: "#/components/responses/UnsupportedMediaType" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Batch delete requests from last task run's default request queue - tags: - - Last Actor task run's default request queue - post: - deprecated: false - description: | - Adds requests to the default request queue of the last Actor task run in batch. - - This endpoint is a shortcut for getting the last task run's `defaultRequestQueueId` and then using the - [Add requests](/api/v2/request-queue-requests-batch-post) endpoint. - operationId: actorTask_runs_last_requestQueue_requests_batch_post - parameters: - - $ref: "#/components/parameters/actorTaskId" - - $ref: "#/components/parameters/statusLastRun" - - $ref: "#/components/parameters/clientKey" - - $ref: "#/components/parameters/forefront" - requestBody: - content: - application/json: - schema: - description: "" - items: - $ref: "#/components/schemas/RequestBase" - type: array - default: null - description: "" - required: true - responses: - "201": - content: - application/json: - schema: - $ref: "#/components/schemas/BatchAddResponse" - description: "" - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "413": - $ref: "#/components/responses/PayloadTooLarge" - "415": - $ref: "#/components/responses/UnsupportedMediaType" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Batch add requests to last task run's default request queue - tags: - - Last Actor task run's default request queue - /v2/actor-tasks/{actorTaskId}/runs/last/request-queue/requests/unlock: - post: - deprecated: false - description: | - Unlocks requests in the default request queue of the last Actor task run that are currently locked by the client. - - This endpoint is a shortcut for getting the last task run's `defaultRequestQueueId` and then using the - [Unlock requests](/api/v2/request-queue-requests-unlock-post) endpoint. - operationId: actorTask_runs_last_requestQueue_requests_unlock_post - parameters: - - $ref: "#/components/parameters/actorTaskId" - - $ref: "#/components/parameters/statusLastRun" - - $ref: "#/components/parameters/clientKey" - responses: - "200": - content: - application/json: - schema: - $ref: "#/components/schemas/UnlockRequestsResponse" - description: Number of requests that were unlocked - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Unlock requests in last task run's default request queue - tags: - - Last Actor task run's default request queue - /v2/actor-tasks/{actorTaskId}/runs/last/request-queue/requests/{requestId}: - delete: - deprecated: false - description: | - Deletes a request from the default request queue of the last Actor task run. - - This endpoint is a shortcut for getting the last task run's `defaultRequestQueueId` and then using the - [Delete request](/api/v2/request-queue-request-delete) endpoint. - operationId: actorTask_runs_last_requestQueue_request_delete - parameters: - - $ref: "#/components/parameters/actorTaskId" - - $ref: "#/components/parameters/statusLastRun" - - $ref: "#/components/parameters/requestId" - - $ref: "#/components/parameters/clientKey" - responses: - "204": - $ref: "#/components/responses/NoContent" - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Delete request from last task run's default request queue - tags: - - Last Actor task run's default request queue - get: - deprecated: false - description: | - Returns a request from the default request queue of the last Actor task run. - - This endpoint is a shortcut for getting the last task run's `defaultRequestQueueId` and then using the - [Get request](/api/v2/request-queue-request-get) endpoint. - operationId: actorTask_runs_last_requestQueue_request_get - parameters: - - $ref: "#/components/parameters/actorTaskId" - - $ref: "#/components/parameters/statusLastRun" - - $ref: "#/components/parameters/requestId" - responses: - "200": - content: - application/json: - schema: - $ref: "#/components/schemas/RequestResponse" - description: "" - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Get request from last task run's default request queue - tags: - - Last Actor task run's default request queue - put: - deprecated: false - description: | - Updates a request in the default request queue of the last Actor task run. - - This endpoint is a shortcut for getting the last task run's `defaultRequestQueueId` and then using the - [Update request](/api/v2/request-queue-request-put) endpoint. - operationId: actorTask_runs_last_requestQueue_request_put - parameters: - - $ref: "#/components/parameters/actorTaskId" - - $ref: "#/components/parameters/statusLastRun" - - $ref: "#/components/parameters/requestId" - - $ref: "#/components/parameters/forefront" - - $ref: "#/components/parameters/clientKey" - requestBody: - content: - application/json: - schema: - $ref: "#/components/schemas/Request" - description: "" - required: true - responses: - "200": - content: - application/json: - schema: - $ref: "#/components/schemas/UpdateRequestResponse" - description: "" - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "413": - $ref: "#/components/responses/PayloadTooLarge" - "415": - $ref: "#/components/responses/UnsupportedMediaType" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Update request in last task run's default request queue - tags: - - Last Actor task run's default request queue - /v2/actor-tasks/{actorTaskId}/runs/last/request-queue/requests/{requestId}/lock: - delete: - deprecated: false - description: | - Deletes a request lock in the default request queue of the last Actor task run. - - This endpoint is a shortcut for getting the last task run's `defaultRequestQueueId` and then using the - [Delete request lock](/api/v2/request-queue-request-lock-delete) endpoint. - operationId: actorTask_runs_last_requestQueue_request_lock_delete - parameters: - - $ref: "#/components/parameters/actorTaskId" - - $ref: "#/components/parameters/statusLastRun" - - $ref: "#/components/parameters/requestId" - - $ref: "#/components/parameters/clientKey" - - $ref: "#/components/parameters/deleteForefront" - responses: - "204": - $ref: "#/components/responses/NoContent" - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Delete lock on request in last task run's default request queue - tags: - - Last Actor task run's default request queue - put: - deprecated: false - description: | - Prolongs a request lock in the default request queue of the last Actor task run. - - This endpoint is a shortcut for getting the last task run's `defaultRequestQueueId` and then using the - [Prolong request lock](/api/v2/request-queue-request-lock-put) endpoint. - operationId: actorTask_runs_last_requestQueue_request_lock_put - parameters: - - $ref: "#/components/parameters/actorTaskId" - - $ref: "#/components/parameters/statusLastRun" - - $ref: "#/components/parameters/requestId" - - $ref: "#/components/parameters/lockSecs" - - $ref: "#/components/parameters/clientKey" - - $ref: "#/components/parameters/lockForefront" - responses: - "200": - content: - application/json: - schema: - $ref: "#/components/schemas/ProlongRequestLockResponse" - description: "" - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Prolong lock on request in last task run's default request queue - tags: - - Last Actor task run's default request queue - /v2/actor-runs: - get: - deprecated: false - description: | - Gets a list of all runs for a user. The response is a list of objects, where - each object contains basic information about a single Actor run. - - The endpoint supports pagination using the `limit` and `offset` parameters - and it will not return more than 1000 array elements. - - By default, the records are sorted by the `startedAt` field in ascending - order. Therefore, you can use pagination to incrementally fetch all records while - new ones are still being created. To sort the records in descending order, use - `desc=1` parameter. You can also filter runs by `startedAt`` and `status`` fields ([available - statuses](https://docs.apify.com/platform/actors/running/runs-and-builds#lifecycle)). - operationId: actorRuns_get - parameters: - - $ref: "#/components/parameters/offset" - - $ref: "#/components/parameters/limit" - - $ref: "#/components/parameters/descStartedAt" - - $ref: "#/components/parameters/status" - - $ref: "#/components/parameters/startedAfter" - - $ref: "#/components/parameters/startedBefore" - responses: - "200": - content: - application/json: - examples: - example: - $ref: "#/components/examples/ListOfRunsResponseExample" - schema: - allOf: - - $ref: "#/components/schemas/ListOfRunsResponse" - description: "" - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Get user runs list - tags: - - Actor runs - x-legacy-doc-urls: - - https://docs.apify.com/api/v2#/reference/actor-runs/run-collection/get-user-runs-list - - https://docs.apify.com/api/v2#/reference/actor-runs/get-user-runs-list - - https://docs.apify.com/api/v2#tag/Actor-runsRun-collection/operation/actorRuns_get - /v2/actor-runs/{runId}: - delete: - deprecated: false - description: | - Delete the run. Only finished runs can be deleted. Only the person or - organization that initiated the run can delete it. - operationId: actorRun_delete - parameters: - - $ref: "#/components/parameters/runId" - responses: - "204": - $ref: "#/components/responses/NoContent" - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Delete run - tags: - - Actor runs - x-legacy-doc-urls: - - https://docs.apify.com/api/v2#/reference/actor-runs/delete-run/delete-run - - https://docs.apify.com/api/v2#/reference/actor-runs/delete-run - - https://docs.apify.com/api/v2#tag/Actor-runsDelete-run/operation/actorRun_delete - x-js-parent: RunClient - x-js-name: delete - x-js-doc-url: https://docs.apify.com/api/client/js/reference/class/RunClient#delete - get: - deprecated: false - description: | - This is not a single endpoint, but an entire group of endpoints that lets - you retrieve the run or any of its default storages. - - ##### Convenience endpoints for Actor run default storages - - * [Dataset](/api/v2/default-dataset) - - * [Key-value store](/api/v2/default-key-value-store) - - * [Request queue](/api/v2/default-request-queue) - - Gets an object that contains all the details about a - specific run of an Actor. - - By passing the optional `waitForFinish` parameter the API endpoint will synchronously wait - for the run to finish. This is useful to avoid periodic polling when waiting for Actor run to complete. - Note that the first response after completion can still show preliminary `stats`, costs, and event counts. - For stable figures, wait about 10 seconds and call the endpoint again. - - This endpoint does not require the authentication token. Instead, calls are authenticated using a hard-to-guess ID of the run. However, - if you access the endpoint without the token, certain attributes, such as `usageUsd` and `usageTotalUsd`, will be hidden. - operationId: actorRun_get - parameters: - - $ref: "#/components/parameters/runId" - - $ref: "#/components/parameters/waitForFinishRun" - responses: - "200": - content: - application/json: - schema: - allOf: - - $ref: "#/components/schemas/RunResponse" - description: "" - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Get run - tags: - - Actor runs - x-legacy-doc-urls: - - https://docs.apify.com/api/v2#/reference/actor-runs/run-object-and-its-storages/get-run - - https://docs.apify.com/api/v2#/reference/actor-runs/get-run - - https://docs.apify.com/api/v2#tag/Actor-runsRun-object-and-its-storages/operation/actorRun_get - put: - deprecated: false - description: | - This endpoint can be used to update both the run's status message and to configure its general resource access level. - - **Status message:** - - You can set a single status message on your run that will be displayed in - the Apify Console UI. During an Actor run, you will typically do this in order - to inform users of your Actor about the Actor's progress. - - The request body must contain `runId` and `statusMessage` properties. The - `isStatusMessageTerminal` property is optional and it indicates if the - status message is the very last one. In the absence of a status message, the - platform will try to substitute sensible defaults. - - **General resource access:** - - You can also update the run's general resource access setting, which determines who can view the run and its related data. - - Allowed values: - - * `FOLLOW_USER_SETTING` - The run inherits the general access setting from the account level. - * `ANYONE_WITH_ID_CAN_READ` - The run can be viewed anonymously by anyone who has its ID. - * `RESTRICTED` - Only users with explicit access to the resource can access the run. - - When a run is accessible anonymously, all of the run's default storages and logs also become accessible anonymously. - operationId: actorRun_put - parameters: - - $ref: "#/components/parameters/runId" - requestBody: - content: - application/json: - example: - runId: 3KH8gEpp4d8uQSe8T - statusMessage: Actor has finished - isStatusMessageTerminal: true - schema: - allOf: - - $ref: "#/components/schemas/UpdateRunRequest" - example: - runId: 3KH8gEpp4d8uQSe8T - statusMessage: Actor has finished - isStatusMessageTerminal: true - description: "" - required: true - responses: - "200": - content: - application/json: - schema: - $ref: "#/components/schemas/RunResponse" - description: "" - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "413": - $ref: "#/components/responses/PayloadTooLarge" - "415": - $ref: "#/components/responses/UnsupportedMediaType" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Update run - tags: - - Actor runs - x-legacy-doc-urls: - - https://docs.apify.com/api/v2#/reference/actor-runs/update-status-message/update-status-message - - https://docs.apify.com/api/v2#/reference/actor-runs/update-status-message - - https://docs.apify.com/api/v2#tag/Actor-runsUpdate-status-message/operation/actorRun_put - /v2/actor-runs/{runId}/abort: - post: - deprecated: false - description: | - Aborts an Actor run and returns an object that contains all the details - about the run. - - Only runs that are starting or running are aborted. For runs with status - `FINISHED`, `FAILED`, `ABORTING` and `TIMED-OUT` this call does nothing. - operationId: actorRun_abort_post - parameters: - - $ref: "#/components/parameters/runId" - - $ref: "#/components/parameters/gracefully" - responses: - "200": - content: - application/json: - example: - data: - id: HG7ML7M8z78YcAPEB - actId: janedoe~my-actor - userId: BPWZBd7Z9c746JAng - actorTaskId: rANaydYhUxjsnA3oz - startedAt: 2019-11-30T07:34:24.202Z - finishedAt: 2019-12-12T09:30:12.202Z - status: ABORTED - statusMessage: Actor was aborted - isStatusMessageTerminal: true - meta: - origin: WEB - clientIp: 172.234.12.34 - userAgent: Mozilla/5.0 (iPad) - stats: - inputBodyLen: 240 - migrationCount: 0 - restartCount: 0 - resurrectCount: 1 - memAvgBytes: 3.59142284E7 - memMaxBytes: 38244352 - memCurrentBytes: 0 - cpuAvgUsage: 0.00955965 - cpuMaxUsage: 3.1546 - cpuCurrentUsage: 0 - netRxBytes: 2652 - netTxBytes: 1338 - durationMillis: 26239 - runTimeSecs: 26.239 - metamorph: 0 - computeUnits: 0.0072886 - options: - build: latest - timeoutSecs: 300 - memoryMbytes: 1024 - diskMbytes: 2048 - buildId: 7sT5jcggjjA9fNcxF - exitCode: 0 - generalAccess: RESTRICTED - defaultKeyValueStoreId: eJNzqsbPiopwJcgGQ - defaultDatasetId: wmKPijuyDnPZAPRMk - defaultRequestQueueId: FL35cSF7jrxr3BY39 - storageIds: - datasets: - default: wmKPijuyDnPZAPRMk - keyValueStores: - default: eJNzqsbPiopwJcgGQ - requestQueues: - default: FL35cSF7jrxr3BY39 - isContainerServerReady: false - gitBranchName: master - usage: - ACTOR_COMPUTE_UNITS: 3 - DATASET_READS: 4 - DATASET_WRITES: 4 - KEY_VALUE_STORE_READS: 5 - KEY_VALUE_STORE_WRITES: 3 - KEY_VALUE_STORE_LISTS: 5 - REQUEST_QUEUE_READS: 2 - REQUEST_QUEUE_WRITES: 1 - DATA_TRANSFER_INTERNAL_GBYTES: 1 - DATA_TRANSFER_EXTERNAL_GBYTES: 3 - PROXY_RESIDENTIAL_TRANSFER_GBYTES: 34 - PROXY_SERPS: 3 - usageTotalUsd: 0.2654 - usageUsd: - ACTOR_COMPUTE_UNITS: 0.072 - DATASET_READS: 4.0E-4 - DATASET_WRITES: 2.0E-4 - KEY_VALUE_STORE_READS: 6.0E-4 - KEY_VALUE_STORE_WRITES: 0.002 - KEY_VALUE_STORE_LISTS: 0.004 - REQUEST_QUEUE_READS: 0.005 - REQUEST_QUEUE_WRITES: 0.02 - DATA_TRANSFER_INTERNAL_GBYTES: 4.0E-4 - DATA_TRANSFER_EXTERNAL_GBYTES: 2.0E-4 - PROXY_RESIDENTIAL_TRANSFER_GBYTES: 0.16 - PROXY_SERPS: 6.0E-4 - schema: - $ref: "#/components/schemas/RunResponse" - description: "" - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Abort run - tags: - - Actor runs - x-legacy-doc-urls: - - https://docs.apify.com/api/v2#/reference/actor-runs/abort-run/abort-run - - https://docs.apify.com/api/v2#/reference/actor-runs/abort-run - - https://docs.apify.com/api/v2#tag/Actor-runsAbort-run/operation/actorRun_abort_post - x-js-parent: RunClient - x-js-name: abort - x-js-doc-url: https://docs.apify.com/api/client/js/reference/class/RunClient#abort - x-py-parent: RunClientAsync - x-py-name: abort - x-py-doc-url: https://docs.apify.com/api/client/python/reference/class/RunClientAsync#abort - /v2/actor-runs/{runId}/metamorph: - post: - deprecated: false - description: | - Transforms an Actor run into a run of another Actor with a new input. - - This is useful if you want to use another Actor to finish the work - of your current Actor run, without the need to create a completely new run - and waiting for its finish. - - For the users of your Actors, the metamorph operation is transparent, they - will just see your Actor got the work done. - - Internally, the system stops the Docker container corresponding to the Actor - run and starts a new container using a different Docker image. - - All the default storages are preserved and the new input is stored under the - `INPUT-METAMORPH-1` key in the same default key-value store. - - For more information, see the [Actor docs](https://docs.apify.com/platform/actors/development/programming-interface/metamorph). - operationId: actorRun_metamorph_post - parameters: - - $ref: "#/components/parameters/runId" - - $ref: "#/components/parameters/targetActorId" - - description: | - Optional build of the target Actor. - - It can be either a build tag or build number. By default, the run uses - the build specified in the default run configuration for the target - Actor (typically `latest`). - explode: true - in: query - name: build - required: false - schema: - example: beta - type: string - style: form - responses: - "200": - content: - application/json: - schema: - $ref: "#/components/schemas/RunResponse" - description: "" - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Metamorph run - tags: - - Actor runs - x-legacy-doc-urls: - - https://docs.apify.com/api/v2#/reference/actor-runs/metamorph-run/metamorph-run - - https://docs.apify.com/api/v2#/reference/actor-runs/metamorph-run - - https://docs.apify.com/api/v2#tag/Actor-runsMetamorph-run/operation/actorRun_metamorph_post - x-js-parent: RunClient - x-js-name: metamorph - x-js-doc-url: https://docs.apify.com/api/client/js/reference/class/RunClient#metamorph - x-py-parent: RunClientAsync - x-py-name: metamorph - x-py-doc-url: https://docs.apify.com/api/client/python/reference/class/RunClientAsync#metamorph - /v2/actor-runs/{runId}/reboot: - post: - deprecated: false - description: | - Reboots an Actor run and returns an object that contains all the details - about the rebooted run. - - Only runs that are running, i.e. runs with status `RUNNING` can be rebooted. - - The run's container will be restarted, so any data not persisted in the - key-value store, dataset, or request queue will be lost. - operationId: actorRun_reboot_post - parameters: - - $ref: "#/components/parameters/runId" - responses: - "200": - content: - application/json: - schema: - $ref: "#/components/schemas/RunResponse" - description: "" - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Reboot run - tags: - - Actor runs - x-legacy-doc-urls: - - https://docs.apify.com/api/v2#/reference/actor-runs/reboot-run/reboot-run - - https://docs.apify.com/api/v2#/reference/actor-runs/reboot-run - - https://docs.apify.com/api/v2#tag/Actor-runsReboot-run/operation/actorRun_reboot_post - x-js-parent: RunClient - x-js-name: reboot - x-js-doc-url: https://docs.apify.com/api/client/js/reference/class/RunClient#reboot - x-py-parent: RunClientAsync - x-py-name: reboot - x-py-doc-url: https://docs.apify.com/api/client/python/reference/class/RunClientAsync#reboot - /v2/actor-runs/{runId}/resurrect: - post: - deprecated: false - description: | - Resurrects a finished Actor run and returns an object that contains all the details about the resurrected run. - Only finished runs, i.e. runs with status `FINISHED`, `FAILED`, `ABORTED` and `TIMED-OUT` can be resurrected. - Run status will be updated to RUNNING and its container will be restarted with the same storages - (the same behaviour as when the run gets migrated to the new server). - - For more information, see the [Actor docs](https://docs.apify.com/platform/actors/running/runs-and-builds#resurrection-of-finished-run). - operationId: PostResurrectRun - parameters: - - $ref: "#/components/parameters/runId" - - $ref: "#/components/parameters/buildResurrect" - - $ref: "#/components/parameters/timeoutResurrect" - - $ref: "#/components/parameters/memoryResurrect" - - $ref: "#/components/parameters/maxItems" - - $ref: "#/components/parameters/maxTotalChargeUsd" - - $ref: "#/components/parameters/restartOnErrorResurrect" - responses: - "200": - content: - application/json: - schema: - allOf: - - $ref: "#/components/schemas/RunResponse" - description: "" - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Resurrect run - tags: - - Actor runs - x-legacy-doc-urls: - - https://docs.apify.com/api/v2#/reference/actor-runs/resurrect-run/resurrect-run - - https://docs.apify.com/api/v2#/reference/actor-runs/resurrect-run - - https://docs.apify.com/api/v2#tag/Actor-runsResurrect-run/operation/PostResurrectRun - x-js-parent: RunClient - x-js-name: resurrect - x-js-doc-url: https://docs.apify.com/api/client/js/reference/class/RunClient#resurrect - x-py-parent: RunClientAsync - x-py-name: resurrect - x-py-doc-url: https://docs.apify.com/api/client/python/reference/class/RunClientAsync#resurrect - /v2/actor-runs/{runId}/charge: - post: - deprecated: false - description: | - Charge for events in the run of your [pay per event Actor](https://docs.apify.com/platform/actors/running/actors-in-store#pay-per-event). - The event you are charging for must be one of the configured events in your Actor. If the Actor is not set up as pay per event, or if the event is not configured, - the endpoint will return an error. The endpoint must be called from the Actor run itself, with the same API token that the run was started with. - - :::info Learn more about pay-per-event pricing - - For more details about pay-per-event (PPE) pricing, refer to our [PPE documentation](/platform/actors/publishing/monetize/pay-per-event). - - ::: - operationId: PostChargeRun - parameters: - - $ref: "#/components/parameters/runId" - - description: Always pass a unique idempotency key (any unique string) for - each charge to avoid double charging in case of retries or network errors. - example: 2024-12-09T01:23:45.000Z-random-uuid - explode: false - in: header - name: idempotency-key - required: false - schema: - type: string - style: simple - requestBody: - content: - application/json: - example: - eventName: ANALYZE_PAGE - count: 1 - schema: - $ref: "#/components/schemas/ChargeRunRequest" - description: "Define which event, and how many times, you want to charge for." - required: true - responses: - "201": - content: - application/json: - schema: - additionalProperties: {} - description: "The charge was successful. Note that you still have to make\ - \ sure in your Actor that the total charge for the run respects the maximum\ - \ value set by the user, as the API does not check this. Above the limit,\ - \ the charges reported as successful in API will not be added to your\ - \ payouts, but you will still bear the associated costs. Use the Apify\ - \ charge manager or SDK to avoid having to deal with this manually." - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "413": - $ref: "#/components/responses/PayloadTooLarge" - "415": - $ref: "#/components/responses/UnsupportedMediaType" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Charge events in run - tags: - - Actor runs - x-js-parent: RunClient - x-js-name: charge - x-js-doc-url: https://docs.apify.com/api/client/js/reference/class/RunClient#charge - x-py-parent: RunClientAsync - x-py-name: charge - x-py-doc-url: https://docs.apify.com/api/client/python/reference/class/RunClientAsync#charge - x-legacy-doc-urls: - - https://docs.apify.com/api/v2#/reference/actor-runs/charge-events-in-run - - https://docs.apify.com/api/v2#tag/Actor-runsCharge-events-in-run/operation/PostChargeRun - /v2/actor-runs/{runId}/dataset: - delete: - deprecated: false - description: | - Deletes default dataset associated with an Actor run. - - This endpoint is a shortcut for getting the last run's `defaultDatasetId` and then using the - [ Delete dataset ](/api/v2/dataset-delete) endpoint. - operationId: actorRun_dataset_delete - parameters: - - $ref: "#/components/parameters/runId" - responses: - "204": - $ref: "#/components/responses/NoContent" - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Delete default dataset - tags: - - Default dataset - get: - deprecated: false - description: | - Returns the default dataset associated with an Actor run. - - This endpoint is a shortcut for getting the run's `defaultDatasetId` and then using the - [Get dataset](/api/v2/dataset-get) endpoint. - operationId: actorRun_dataset_get - parameters: - - $ref: "#/components/parameters/runId" - responses: - "200": - content: - application/json: - schema: - $ref: "#/components/schemas/DatasetResponse" - description: "" - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Get default dataset - tags: - - Default dataset - put: - deprecated: false - description: | - Updates the default dataset associated with an Actor run. - - This endpoint is a shortcut for getting the run's `defaultDatasetId` and then using the - [Put dataset](/api/v2/dataset-put) endpoint. - operationId: actorRun_dataset_put - parameters: - - $ref: "#/components/parameters/runId" - requestBody: - content: - application/json: - schema: - $ref: "#/components/schemas/UpdateDatasetRequest" - description: "" - required: true - responses: - "200": - content: - application/json: - schema: - $ref: "#/components/schemas/DatasetResponse" - description: "" - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "413": - $ref: "#/components/responses/PayloadTooLarge" - "415": - $ref: "#/components/responses/UnsupportedMediaType" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Update default dataset - tags: - - Default dataset - /v2/actor-runs/{runId}/dataset/items: - get: - deprecated: false - description: | - Returns data stored in the default dataset of the Actor run in the desired format. - - This endpoint is a shortcut that resolves the run's `defaultDatasetId` and proxies to the - [Get dataset items](/api/v2/dataset-items-get) endpoint. - operationId: actorRun_dataset_items_get - parameters: - - $ref: "#/components/parameters/runId" - - $ref: "#/components/parameters/format" - - $ref: "#/components/parameters/clean" - - $ref: "#/components/parameters/offset" - - $ref: "#/components/parameters/datasetParameters_limit" - - $ref: "#/components/parameters/fields" - - $ref: "#/components/parameters/outputFields" - - $ref: "#/components/parameters/omit" - - $ref: "#/components/parameters/unwind" - - $ref: "#/components/parameters/flatten" - - $ref: "#/components/parameters/descDataset" - - $ref: "#/components/parameters/attachment" - - $ref: "#/components/parameters/delimiter" - - $ref: "#/components/parameters/bom" - - $ref: "#/components/parameters/xmlRoot" - - $ref: "#/components/parameters/xmlRow" - - $ref: "#/components/parameters/skipHeaderRow" - - $ref: "#/components/parameters/skipHidden" - - $ref: "#/components/parameters/skipEmpty" - - $ref: "#/components/parameters/simplified" - - $ref: "#/components/parameters/view" - - $ref: "#/components/parameters/skipFailedPages" - - $ref: "#/components/parameters/feedTitle" - - $ref: "#/components/parameters/feedDescription" - - $ref: "#/components/parameters/signature" - responses: - "200": - content: - application/json: - schema: - example: - - foo: bar - - foo2: bar2 - items: - type: object - type: array - default: null - application/jsonl: - example: "{\"foo\":\"bar\"}\\n{\"foo2\":\"bar2\"}\\n" - schema: - type: string - text/csv: - example: "foo,bar\\nfoo2,bar2\\n" - schema: - type: string - text/html: - example: <table><tr><th>foo</th><th>bar</th></tr><tr><td>foo</td><td>bar</td></tr><tr><td>foo2</td><td>bar2</td></tr></table> - schema: - type: string - application/vnd.openxmlformats-officedocument.spreadsheetml.sheet: - schema: - type: string - application/rss+xml: - example: <rss><channel><item><foo>bar</foo></item><item><foo2>bar2</foo2></item></channel></rss> - schema: - type: string - application/xml: - example: <items><item><foo>bar</foo></item><item><foo2>bar2</foo2></item></items> - schema: - type: string - description: "" - headers: - X-Apify-Pagination-Offset: - content: - text/plain: - example: "0" - schema: {} - description: The offset of the first item in the current page. - explode: false - style: simple - X-Apify-Pagination-Limit: - content: - text/plain: - example: "100" - schema: {} - description: The maximum number of items returned per page. - explode: false - style: simple - X-Apify-Pagination-Count: - content: - text/plain: - example: "100" - schema: {} - description: The number of items returned in the current page. - explode: false - style: simple - X-Apify-Pagination-Total: - content: - text/plain: - example: "10204" - schema: {} - description: The total number of items in the dataset. - explode: false - style: simple - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Get default dataset items - tags: - - Default dataset - post: - deprecated: false - description: | - Appends an item or an array of items to the end of the Actor run's default dataset. - - This endpoint is a shortcut that resolves the run's `defaultDatasetId` and proxies to the - [Store items](/api/v2/dataset-items-post) endpoint. - operationId: actorRun_dataset_items_post - parameters: - - $ref: "#/components/parameters/runId" - requestBody: - content: - application/json: - schema: - $ref: "#/components/schemas/act_runs_last_dataset_items_post_request" - description: "" - required: true - responses: - "201": - content: - application/json: - schema: - example: {} - type: object - description: "" - headers: - Location: - content: - text/plain: - example: https://api.apify.com/v2/datasets/WkzbQMuFYuamGv3YF/items - schema: - type: string - explode: false - style: simple - "400": - content: - application/json: - schema: - $ref: "#/components/schemas/act_runs_last_dataset_items_post_400_response" - description: "" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Store items - tags: - - Default dataset - /v2/actor-runs/{runId}/dataset/statistics: - get: - description: | - Returns statistics for the Actor run's default dataset. - - This endpoint is a shortcut that resolves the run's `defaultDatasetId` and proxies to the - [Get dataset statistics](/api/v2/dataset-statistics-get) endpoint. - operationId: actorRun_dataset_statistics_get - parameters: - - $ref: "#/components/parameters/runId" - responses: - "200": - content: - application/json: - schema: - $ref: "#/components/schemas/DatasetStatisticsResponse" - description: "" - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Get default dataset statistics - tags: - - Default dataset - /v2/actor-runs/{runId}/key-value-store: - delete: - deprecated: false - description: | - Delete the default key-value store. - - This endpoint is a shortcut for getting the run's `defaultKeyValueStoreId` and then using the - [Delete store](/api/v2/key-value-store-delete) endpoint. - operationId: actorRun_keyValueStore_delete - parameters: - - $ref: "#/components/parameters/runId" - responses: - "204": - $ref: "#/components/responses/NoContent" - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Delete default store - tags: - - Default key-value store - get: - deprecated: false - description: | - Gets an object that contains all the details about the default key-value - store. - - This endpoint is a shortcut for getting the run's `defaultKeyValueStoreId` and then using the - [Get store](/api/v2/key-value-store-get) endpoint. - operationId: actorRun_keyValueStore_get - parameters: - - $ref: "#/components/parameters/runId" - responses: - "200": - content: - application/json: - schema: - $ref: "#/components/schemas/KeyValueStoreResponse" - description: "" - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Get default store - tags: - - Default key-value store - put: - deprecated: false - description: | - Updates the default key-value store's name and general resource access level using a value specified by a JSON object - passed in the PUT payload. - - This endpoint is a shortcut for getting the run's `defaultKeyValueStoreId` and then using the - [Update store](/api/v2/key-value-store-put) endpoint. - operationId: actorRun_keyValueStore_put - parameters: - - $ref: "#/components/parameters/runId" - requestBody: - content: - application/json: - example: - name: new-store-name - schema: - $ref: "#/components/schemas/UpdateStoreRequest" - description: "" - required: true - responses: - "200": - content: - application/json: - schema: - $ref: "#/components/schemas/KeyValueStoreResponse" - description: "" - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "413": - $ref: "#/components/responses/PayloadTooLarge" - "415": - $ref: "#/components/responses/UnsupportedMediaType" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Update default store - tags: - - Default key-value store - /v2/actor-runs/{runId}/key-value-store/keys: - get: - deprecated: false - description: | - Returns a list of keys for the default key-value store of the Actor run. - - This endpoint is a shortcut for getting the run's `defaultKeyValueStoreId` and then using the - [Get list of keys](/api/v2/key-value-store-keys-get) endpoint. - operationId: actorRun_keyValueStore_keys_get - parameters: - - $ref: "#/components/parameters/runId" - - $ref: "#/components/parameters/exclusiveStartKey" - - $ref: "#/components/parameters/keyValueStoreParameters_limit" - - $ref: "#/components/parameters/collectionKeys" - - $ref: "#/components/parameters/prefixKeys" - - $ref: "#/components/parameters/signature" - responses: - "200": - content: - application/json: - schema: - $ref: "#/components/schemas/ListOfKeysResponse" - description: "" - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Get default store's list of keys - tags: - - Default key-value store - /v2/actor-runs/{runId}/key-value-store/records: - get: - deprecated: false - description: | - Downloads all records from the default key-value store of the Actor run as a ZIP archive. - - This endpoint is a shortcut for getting the run's `defaultKeyValueStoreId` and then using the - [Download records](/api/v2/key-value-store-records-get) endpoint. - operationId: actorRun_keyValueStore_records_get - parameters: - - $ref: "#/components/parameters/runId" - - $ref: "#/components/parameters/collectionRecords" - - $ref: "#/components/parameters/prefixRecords" - - $ref: "#/components/parameters/signature" - responses: - "200": - content: - application/zip: - schema: - format: binary - type: string - description: A ZIP archive containing the requested records. - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Download default store's records - tags: - - Default key-value store - /v2/actor-runs/{runId}/key-value-store/records/{recordKey}: - delete: - deprecated: false - description: | - Removes a record specified by a key from the default key-value store of the Actor run. - - This endpoint is a shortcut for getting the run's `defaultKeyValueStoreId` and then using the - [Delete record](/api/v2/key-value-store-record-delete) endpoint. - operationId: actorRun_keyValueStore_record_delete - parameters: - - $ref: "#/components/parameters/runId" - - $ref: "#/components/parameters/recordKey" - responses: - "204": - $ref: "#/components/responses/NoContent" - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Delete default store's record - tags: - - Default key-value store - get: - deprecated: false - description: | - Gets a value stored under a specific key in the default key-value store of the Actor run. - - This endpoint is a shortcut for getting the run's `defaultKeyValueStoreId` and then using the - [Get record](/api/v2/key-value-store-record-get) endpoint. - operationId: actorRun_keyValueStore_record_get - parameters: - - $ref: "#/components/parameters/runId" - - $ref: "#/components/parameters/recordKey" - - $ref: "#/components/parameters/signature" - - $ref: "#/components/parameters/keyValueStoreParameters_attachment" - responses: - "200": - content: - application/json: - schema: - $ref: "#/components/schemas/RecordResponse" - '*/*': - schema: {} - description: "" - "302": - content: {} - description: "" - headers: - Location: - content: - text/plain: - example: https://apifier-key-value-store-prod.s3.amazonaws.com/tqx6jeMia43gYY6eE/INPUT?AWSAccessKeyId=NKDOUN&Expires=1502720992&Signature=DKLVPI4lDDKC - schema: - type: string - explode: false - style: simple - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Get default store's record - tags: - - Default key-value store - post: - deprecated: false - description: | - Stores a value under a specific key in the default key-value store of the Actor run. - - This endpoint is a shortcut for getting the run's `defaultKeyValueStoreId` and then using the - [Store record](/api/v2/key-value-store-record-post) endpoint. - operationId: actorRun_keyValueStore_record_post - parameters: - - $ref: "#/components/parameters/runId" - - $ref: "#/components/parameters/recordKey" - - $ref: "#/components/parameters/Content-Encoding" - requestBody: - content: - application/json: - schema: - $ref: "#/components/schemas/PutRecordRequest" - '*/*': - schema: {} - description: "" - required: true - responses: - "201": - content: - application/json: - example: {} - schema: - type: object - description: "" - headers: - Location: - content: - text/plain: - example: https://api.apify.com/v2/key-value-stores/WkzbQMuFYuamGv3YF/records/some-key - schema: - type: string - explode: false - style: simple - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "413": - $ref: "#/components/responses/PayloadTooLarge" - "415": - $ref: "#/components/responses/UnsupportedMediaType" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Store record in default store (POST) - tags: - - Default key-value store - put: - deprecated: false - description: | - Stores a value under a specific key in the default key-value store of the Actor run. - - This endpoint is a shortcut for getting the run's `defaultKeyValueStoreId` and then using the - [Store record](/api/v2/key-value-store-record-put) endpoint. - operationId: actorRun_keyValueStore_record_put - parameters: - - $ref: "#/components/parameters/runId" - - $ref: "#/components/parameters/recordKey" - - $ref: "#/components/parameters/Content-Encoding" - requestBody: - content: - application/json: - schema: - $ref: "#/components/schemas/PutRecordRequest" - '*/*': - schema: {} - description: "" - required: true - responses: - "201": - content: - application/json: - example: {} - schema: - type: object - description: "" - headers: - Location: - content: - text/plain: - example: https://api.apify.com/v2/key-value-stores/WkzbQMuFYuamGv3YF/records/some-key - schema: - type: string - explode: false - style: simple - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "413": - $ref: "#/components/responses/PayloadTooLarge" - "415": - $ref: "#/components/responses/UnsupportedMediaType" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Store record in default store - tags: - - Default key-value store - /v2/actor-runs/{runId}/request-queue: - delete: - deprecated: false - description: | - Deletes the default request queue associated with an Actor run. - - This endpoint is a shortcut for getting the run's `defaultRequestQueueId` and then using the - [Delete request queue](/api/v2/request-queue-delete) endpoint. - operationId: actorRun_requestQueue_delete - parameters: - - $ref: "#/components/parameters/runId" - responses: - "204": - $ref: "#/components/responses/NoContent" - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Delete default request queue - tags: - - Default request queue - get: - deprecated: false - description: | - Returns the default request queue associated with an Actor run. - - This endpoint is a shortcut for getting the run's `defaultRequestQueueId` and then using the - [Get request queue](/api/v2/request-queue-get) endpoint. - operationId: actorRun_requestQueue_get - parameters: - - $ref: "#/components/parameters/runId" - responses: - "200": - content: - application/json: - schema: - $ref: "#/components/schemas/RequestQueueResponse" - description: "" - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Get default request queue - tags: - - Default request queue - put: - deprecated: false - description: | - Updates the default request queue associated with an Actor run. - - This endpoint is a shortcut for getting the run's `defaultRequestQueueId` and then using the - [Update request queue](/api/v2/request-queue-put) endpoint. - operationId: actorRun_requestQueue_put - parameters: - - $ref: "#/components/parameters/runId" - requestBody: - content: - application/json: - example: - name: new-request-queue-name - schema: - allOf: - - $ref: "#/components/schemas/UpdateRequestQueueRequest" - example: - name: new-request-queue-name - description: "" - required: true - responses: - "200": - content: - application/json: - schema: - $ref: "#/components/schemas/RequestQueueResponse" - description: "" - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "413": - $ref: "#/components/responses/PayloadTooLarge" - "415": - $ref: "#/components/responses/UnsupportedMediaType" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Update default request queue - tags: - - Default request queue - /v2/actor-runs/{runId}/request-queue/requests: - get: - deprecated: false - description: | - Returns a list of requests from the default request queue of the Actor run. - - This endpoint is a shortcut for getting the run's `defaultRequestQueueId` and then using the - [List requests](/api/v2/request-queue-requests-get) endpoint. - operationId: actorRun_requestQueue_requests_get - parameters: - - $ref: "#/components/parameters/runId" - - $ref: "#/components/parameters/clientKey" - - $ref: "#/components/parameters/exclusiveStartId" - - $ref: "#/components/parameters/listLimit" - - $ref: "#/components/parameters/cursor" - - $ref: "#/components/parameters/filter" - responses: - "200": - content: - application/json: - schema: - $ref: "#/components/schemas/ListOfRequestsResponse" - description: "" - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: List default request queue's requests - tags: - - Default request queue - post: - deprecated: false - description: | - Adds a request to the default request queue of the Actor run. - - This endpoint is a shortcut for getting the run's `defaultRequestQueueId` and then using the - [Add request](/api/v2/request-queue-requests-post) endpoint. - operationId: actorRun_requestQueue_requests_post - parameters: - - $ref: "#/components/parameters/runId" - - $ref: "#/components/parameters/clientKey" - - $ref: "#/components/parameters/forefront" - requestBody: - content: - application/json: - schema: - $ref: "#/components/schemas/RequestBase" - description: "" - required: true - responses: - "201": - content: - application/json: - schema: - $ref: "#/components/schemas/AddRequestResponse" - description: "" - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "413": - $ref: "#/components/responses/PayloadTooLarge" - "415": - $ref: "#/components/responses/UnsupportedMediaType" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Add request to default request queue - tags: - - Default request queue - /v2/actor-runs/{runId}/request-queue/requests/batch: - delete: - deprecated: false - description: | - Batch-deletes requests from the default request queue of the Actor run. - - This endpoint is a shortcut for getting the run's `defaultRequestQueueId` and then using the - [Delete requests](/api/v2/request-queue-requests-batch-delete) endpoint. - operationId: actorRun_requestQueue_requests_batch_delete - parameters: - - $ref: "#/components/parameters/runId" - - $ref: "#/components/parameters/contentTypeJson" - - $ref: "#/components/parameters/clientKey" - requestBody: - content: - application/json: - schema: - items: - $ref: "#/components/schemas/RequestDraftDelete" - type: array - default: null - description: "" - required: true - responses: - "200": - content: - application/json: - schema: - $ref: "#/components/schemas/BatchDeleteResponse" - description: "" - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "413": - $ref: "#/components/responses/PayloadTooLarge" - "415": - $ref: "#/components/responses/UnsupportedMediaType" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Batch delete requests from default request queue - tags: - - Default request queue - post: - deprecated: false - description: | - Adds requests to the default request queue of the Actor run in batch. - - This endpoint is a shortcut for getting the run's `defaultRequestQueueId` and then using the - [Add requests](/api/v2/request-queue-requests-batch-post) endpoint. - operationId: actorRun_requestQueue_requests_batch_post - parameters: - - $ref: "#/components/parameters/runId" - - $ref: "#/components/parameters/clientKey" - - $ref: "#/components/parameters/forefront" - requestBody: - content: - application/json: - schema: - description: "" - items: - $ref: "#/components/schemas/RequestBase" - type: array - default: null - description: "" - required: true - responses: - "201": - content: - application/json: - schema: - $ref: "#/components/schemas/BatchAddResponse" - description: "" - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "413": - $ref: "#/components/responses/PayloadTooLarge" - "415": - $ref: "#/components/responses/UnsupportedMediaType" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Batch add requests to default request queue - tags: - - Default request queue - /v2/actor-runs/{runId}/request-queue/requests/unlock: - post: - deprecated: false - description: | - Unlocks requests in the default request queue of the Actor run that are currently locked by the client. - - This endpoint is a shortcut for getting the run's `defaultRequestQueueId` and then using the - [Unlock requests](/api/v2/request-queue-requests-unlock-post) endpoint. - operationId: actorRun_requestQueue_requests_unlock_post - parameters: - - $ref: "#/components/parameters/runId" - - $ref: "#/components/parameters/clientKey" - responses: - "200": - content: - application/json: - schema: - $ref: "#/components/schemas/UnlockRequestsResponse" - description: Number of requests that were unlocked - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Unlock requests in default request queue - tags: - - Default request queue - /v2/actor-runs/{runId}/request-queue/requests/{requestId}: - delete: - deprecated: false - description: | - Deletes a request from the default request queue of the Actor run. - - This endpoint is a shortcut for getting the run's `defaultRequestQueueId` and then using the - [Delete request](/api/v2/request-queue-request-delete) endpoint. - operationId: actorRun_requestQueue_request_delete - parameters: - - $ref: "#/components/parameters/runId" - - $ref: "#/components/parameters/requestId" - - $ref: "#/components/parameters/clientKey" - responses: - "204": - $ref: "#/components/responses/NoContent" - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Delete request from default request queue - tags: - - Default request queue - get: - deprecated: false - description: | - Returns a request from the default request queue of the Actor run. - - This endpoint is a shortcut for getting the run's `defaultRequestQueueId` and then using the - [Get request](/api/v2/request-queue-request-get) endpoint. - operationId: actorRun_requestQueue_request_get - parameters: - - $ref: "#/components/parameters/runId" - - $ref: "#/components/parameters/requestId" - responses: - "200": - content: - application/json: - schema: - $ref: "#/components/schemas/RequestResponse" - description: "" - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Get request from default request queue - tags: - - Default request queue - put: - deprecated: false - description: | - Updates a request in the default request queue of the Actor run. - - This endpoint is a shortcut for getting the run's `defaultRequestQueueId` and then using the - [Update request](/api/v2/request-queue-request-put) endpoint. - operationId: actorRun_requestQueue_request_put - parameters: - - $ref: "#/components/parameters/runId" - - $ref: "#/components/parameters/requestId" - - $ref: "#/components/parameters/forefront" - - $ref: "#/components/parameters/clientKey" - requestBody: - content: - application/json: - schema: - $ref: "#/components/schemas/Request" - description: "" - required: true - responses: - "200": - content: - application/json: - schema: - $ref: "#/components/schemas/UpdateRequestResponse" - description: "" - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "413": - $ref: "#/components/responses/PayloadTooLarge" - "415": - $ref: "#/components/responses/UnsupportedMediaType" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Update request in default request queue - tags: - - Default request queue - /v2/actor-runs/{runId}/request-queue/requests/{requestId}/lock: - delete: - deprecated: false - description: | - Deletes a request lock in the default request queue of the Actor run. - - This endpoint is a shortcut for getting the run's `defaultRequestQueueId` and then using the - [Delete request lock](/api/v2/request-queue-request-lock-delete) endpoint. - operationId: actorRun_requestQueue_request_lock_delete - parameters: - - $ref: "#/components/parameters/runId" - - $ref: "#/components/parameters/requestId" - - $ref: "#/components/parameters/clientKey" - - $ref: "#/components/parameters/deleteForefront" - responses: - "204": - $ref: "#/components/responses/NoContent" - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Delete lock on request in default request queue - tags: - - Default request queue - put: - deprecated: false - description: | - Prolongs a request lock in the default request queue of the Actor run. - - This endpoint is a shortcut for getting the run's `defaultRequestQueueId` and then using the - [Prolong request lock](/api/v2/request-queue-request-lock-put) endpoint. - operationId: actorRun_requestQueue_request_lock_put - parameters: - - $ref: "#/components/parameters/runId" - - $ref: "#/components/parameters/requestId" - - $ref: "#/components/parameters/lockSecs" - - $ref: "#/components/parameters/clientKey" - - $ref: "#/components/parameters/lockForefront" - responses: - "200": - content: - application/json: - schema: - $ref: "#/components/schemas/ProlongRequestLockResponse" - description: "" - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Prolong lock on request in default request queue - tags: - - Default request queue - /v2/actor-runs/{runId}/request-queue/head: - get: - deprecated: false - description: | - Returns the given number of first requests from the default request queue of the Actor run. - - This endpoint is a shortcut for getting the run's `defaultRequestQueueId` and then using the - [Get head](/api/v2/request-queue-head-get) endpoint. - operationId: actorRun_requestQueue_head_get - parameters: - - $ref: "#/components/parameters/runId" - - $ref: "#/components/parameters/headLimit" - - $ref: "#/components/parameters/clientKey" - responses: - "200": - content: - application/json: - schema: - $ref: "#/components/schemas/HeadResponse" - description: "" - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Get default request queue head - tags: - - Default request queue - /v2/actor-runs/{runId}/request-queue/head/lock: - post: - deprecated: false - description: | - Returns the given number of first requests from the default request queue of the Actor run - and locks them for the given time. - - This endpoint is a shortcut for getting the run's `defaultRequestQueueId` and then using the - [Get head and lock](/api/v2/request-queue-head-lock-post) endpoint. - operationId: actorRun_requestQueue_head_lock_post - parameters: - - $ref: "#/components/parameters/runId" - - $ref: "#/components/parameters/lockSecs" - - $ref: "#/components/parameters/headLockLimit" - - $ref: "#/components/parameters/clientKey" - responses: - "201": - content: - application/json: - schema: - $ref: "#/components/schemas/HeadAndLockResponse" - description: "" - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Get and lock default request queue head - tags: - - Default request queue - /v2/actor-runs/{runId}/log: - get: - deprecated: false - description: | - Retrieves Actor run's logs. - - This endpoint is a shortcut for getting the run's log. Same as [Get log](/api/v2/log-get) endpoint. - operationId: actorRun_log_get - parameters: - - $ref: "#/components/parameters/runId" - - $ref: "#/components/parameters/stream" - - $ref: "#/components/parameters/download" - - $ref: "#/components/parameters/raw" - responses: - "200": - content: - text/plain: - schema: - example: | - 2017-07-14T06:00:49.733Z Application started. - 2017-07-14T06:00:49.741Z Input: { test: 123 } - 2017-07-14T06:00:49.752Z Some useful debug information follows. - type: string - description: "" - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Get run's log - tags: - - Actor runs - /v2/actor-builds: - get: - deprecated: false - description: | - Gets a list of all builds for a user. The response is a JSON array of - objects, where each object contains basic information about a single build. - - The endpoint supports pagination using the `limit` and `offset` parameters - and it will not return more than 1000 records. - - By default, the records are sorted by the `startedAt` field in ascending - order. Therefore, you can use pagination to incrementally fetch all builds while - new ones are still being started. To sort the records in descending order, use - the `desc=1` parameter. - operationId: actorBuilds_get - parameters: - - $ref: "#/components/parameters/offset" - - $ref: "#/components/parameters/limit" - - $ref: "#/components/parameters/descStartedAt" - responses: - "200": - content: - application/json: - schema: - $ref: "#/components/schemas/ListOfBuildsResponse" - description: "" - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Get user builds list - tags: - - Actor builds - x-legacy-doc-urls: - - https://docs.apify.com/api/v2#/reference/actor-builds/build-collection/get-user-builds-list - - https://docs.apify.com/api/v2#/reference/actor-builds/get-user-builds-list - - https://docs.apify.com/api/v2#tag/Actor-buildsBuild-collection/operation/actorBuilds_get - /v2/actor-builds/{buildId}: - delete: - deprecated: false - description: | - Delete the build. The build that is the current default build for the Actor - cannot be deleted. - - Only users with build permissions for the Actor can delete builds. - operationId: actorBuild_delete - parameters: - - $ref: "#/components/parameters/buildId" - responses: - "204": - $ref: "#/components/responses/NoContent" - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Delete build - tags: - - Actor builds - x-legacy-doc-urls: - - https://docs.apify.com/api/v2#/reference/actor-builds/delete-build/delete-build - - https://docs.apify.com/api/v2#/reference/actor-builds/delete-build - - https://docs.apify.com/api/v2#tag/Actor-builds/operation/actorBuild_delete - x-js-parent: BuildClient - x-js-name: delete - x-js-doc-url: https://docs.apify.com/api/client/js/reference/class/BuildClient#delete - get: - deprecated: false - description: | - Gets an object that contains all the details about a specific build of an - Actor. - - By passing the optional `waitForFinish` parameter the API endpoint will - synchronously wait for the build to finish. This is useful to avoid periodic - polling when waiting for an Actor build to finish. - - This endpoint does not require the authentication token. Instead, calls are authenticated using a hard-to-guess ID of the build. However, - if you access the endpoint without the token, certain attributes, such as `usageUsd` and `usageTotalUsd`, will be hidden. - operationId: actorBuild_get - parameters: - - $ref: "#/components/parameters/buildId" - - $ref: "#/components/parameters/waitForFinishBuild" - responses: - "200": - content: - application/json: - schema: - allOf: - - $ref: "#/components/schemas/BuildResponse" - description: "" - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "429": - $ref: "#/components/responses/TooManyRequests" - security: [] - summary: Get build - tags: - - Actor builds - x-legacy-doc-urls: - - https://docs.apify.com/api/v2#/reference/actor-builds/build-object/get-build - - https://docs.apify.com/api/v2#/reference/actor-builds/get-build - - https://docs.apify.com/api/v2#tag/Actor-buildsBuild-object/operation/actorBuild_get - x-js-parent: BuildClient - x-js-name: get - x-js-doc-url: https://docs.apify.com/api/client/js/reference/class/BuildClient#get - x-py-parent: BuildClientAsync - x-py-name: get - x-py-doc-url: https://docs.apify.com/api/client/python/reference/class/BuildClientAsync#get - /v2/actor-builds/{buildId}/abort: - post: - deprecated: false - description: | - Aborts an Actor build and returns an object that contains all the details - about the build. - - Only builds that are starting or running are aborted. For builds with status - `FINISHED`, `FAILED`, `ABORTING` and `TIMED-OUT` this call does nothing. - operationId: actorBuild_abort_post - parameters: - - $ref: "#/components/parameters/buildId" - responses: - "200": - content: - application/json: - schema: - allOf: - - $ref: "#/components/schemas/BuildResponse" - description: "" - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Abort build - tags: - - Actor builds - x-legacy-doc-urls: - - https://docs.apify.com/api/v2#/reference/actor-builds/abort-build/abort-build - - https://docs.apify.com/api/v2#/reference/actor-builds/abort-build - - https://docs.apify.com/api/v2#tag/Actor-buildsAbort-build/operation/actorBuild_abort_post - x-js-parent: BuildClient - x-js-name: abort - x-js-doc-url: https://docs.apify.com/api/client/js/reference/class/BuildClient#abort - x-py-parent: BuildClientAsync - x-py-name: abort - x-py-doc-url: https://docs.apify.com/api/client/python/reference/class/BuildClientAsync#abort - /v2/actor-builds/{buildId}/log: - get: - deprecated: false - description: | - Retrieves Actor build's logs. - - This endpoint is a shortcut for getting the build's log. Same as [Get log](/api/v2/log-get) endpoint. - operationId: actorBuild_log_get - parameters: - - $ref: "#/components/parameters/buildId" - - $ref: "#/components/parameters/stream" - - $ref: "#/components/parameters/download" - responses: - "200": - content: - text/plain: - schema: - example: | - 2017-07-14T06:00:49.733Z Application started. - 2017-07-14T06:00:49.741Z Input: { test: 123 } - 2017-07-14T06:00:49.752Z Some useful debug information follows. - type: string - description: "" - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Get build's Log - tags: - - Actor builds - x-legacy-doc-urls: - - https://docs.apify.com/api/v2#/reference/actor-builds/build-log/get-log - - https://docs.apify.com/api/v2#/reference/actor-builds/get-log - - https://docs.apify.com/api/v2#tag/Actor-buildsBuild-log/operation/actorBuild_log_get - /v2/actor-builds/{buildId}/openapi.json: - get: - description: | - Get the OpenAPI definition for Actor builds. Two similar endpoints are available: - - - [First endpoint](/api/v2/act-openapi-json-get): Requires both `actorId` and `buildId`. Use `default` as the `buildId` to get the OpenAPI schema for the default Actor build. - - [Second endpoint](/api/v2/actor-build-openapi-json-get): Requires only `buildId`. - - Get the OpenAPI definition for a specific Actor build. - Authentication is based on the build's unique ID. No authentication token is required. - - :::note - - You can also use the [`/api/v2/act-openapi-json-get`](/api/v2/act-openapi-json-get) endpoint to get the OpenAPI definition for a build. - - ::: - operationId: actorBuild_openapi_json_get - parameters: - - $ref: "#/components/parameters/buildIdWithDefault" - responses: - "200": - content: - application/json: - schema: - description: A standard OpenAPI 3.x JSON document. - type: object - description: The OpenAPI specification document for the Actor build. - "400": - $ref: "#/components/responses/BadRequest" - "404": - $ref: "#/components/responses/NotFound" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "429": - $ref: "#/components/responses/TooManyRequests" - security: [] - summary: Get OpenAPI definition - tags: - - Actor builds - x-js-parent: BuildClient - x-js-name: getOpenApiDefinition - x-js-doc-url: https://docs.apify.com/api/client/js/reference/class/BuildClient#getOpenApiDefinition - x-py-parent: BuildClient - x-py-name: get_open_api_definition - x-py-doc-url: https://docs.apify.com/api/client/python/reference/class/BuildClient#get_open_api_definition - /v2/key-value-stores: - get: - deprecated: false - description: | - Gets the list of key-value stores owned by the user. - - The response is a list of objects, where each objects contains a basic - information about a single key-value store. - - The endpoint supports pagination using the `limit` and `offset` parameters - and it will not return more than 1000 array elements. - - By default, the records are sorted by the `createdAt` field in ascending - order, therefore you can use pagination to incrementally fetch all key-value stores - while new ones are still being created. To sort the records in descending order, use - the `desc=1` parameter. - operationId: keyValueStores_get - parameters: - - $ref: "#/components/parameters/offset" - - $ref: "#/components/parameters/limit" - - $ref: "#/components/parameters/descCreatedAt" - - $ref: "#/components/parameters/unnamed" - - description: | - Filter by ownership. If this parameter is omitted, all accessible key-value stores are returned. - - - `ownedByMe`: Return only key-value stores owned by the user. - - `sharedWithMe`: Return only key-value stores shared with the user by other users. - explode: true - in: query - name: ownership - required: false - schema: - $ref: "#/components/schemas/StorageOwnership" - style: form - responses: - "200": - content: - application/json: - schema: - $ref: "#/components/schemas/ListOfKeyValueStoresResponse" - description: "" - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Get list of key-value stores - tags: - - Storage/Key-value stores - x-legacy-doc-urls: - - https://docs.apify.com/api/v2#/reference/key-value-stores/store-collection/get-list-of-key-value-stores - - https://docs.apify.com/api/v2#/reference/key-value-stores/get-list-of-key-value-stores - - https://docs.apify.com/api/v2#tag/Key-value-storesStore-collection/operation/keyValueStores_get - x-js-parent: KeyValueStoreCollectionClient - x-js-name: list - x-js-doc-url: https://docs.apify.com/api/client/js/reference/class/KeyValueStoreCollectionClient#list - x-py-parent: KeyValueStoreCollectionClientAsync - x-py-name: list - x-py-doc-url: https://docs.apify.com/api/client/python/reference/class/KeyValueStoreCollectionClientAsync#list - post: - deprecated: false - description: | - Creates a key-value store and returns its object. The response is the same - object as returned by the [Get store](#/reference/key-value-stores/store-object/get-store) - endpoint. - - Keep in mind that data stored under unnamed store follows [data retention - period](https://docs.apify.com/platform/storage#data-retention). - - It creates a store with the given name if the parameter name is used. - If there is another store with the same name, the endpoint does not create a - new one and returns the existing object instead. - operationId: keyValueStores_post - parameters: - - description: Custom unique name to easily identify the store in the future. - explode: true - in: query - name: name - required: false - schema: - example: eshop-values - type: string - style: form - responses: - "200": - content: - application/json: - schema: - $ref: "#/components/schemas/KeyValueStoreResponse" - description: Returns the existing key-value store object if a store with - the given name already exists. - "201": - content: - application/json: - schema: - $ref: "#/components/schemas/KeyValueStoreResponse" - description: "" - headers: - Location: - content: - text/plain: - example: https://api.apify.com/v2/key-value-stores/WkzbQMuFYuamGv3YF - schema: - type: string - explode: false - style: simple - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Create key-value store - tags: - - Storage/Key-value stores - x-legacy-doc-urls: - - https://docs.apify.com/api/v2#/reference/key-value-stores/store-collection/create-key-value-store - - https://docs.apify.com/api/v2#/reference/key-value-stores/create-key-value-store - - https://docs.apify.com/api/v2#tag/Key-value-storesStore-collection/operation/keyValueStores_post - x-js-parent: KeyValueStoreCollectionClient - x-js-name: getOrCreate - x-js-doc-url: https://docs.apify.com/api/client/js/reference/class/KeyValueStoreCollectionClient#getOrCreate - x-py-parent: KeyValueStoreCollectionClientAsync - x-py-name: get_or_create - x-py-doc-url: https://docs.apify.com/api/client/python/reference/class/KeyValueStoreCollectionClientAsync#get_or_create - /v2/key-value-stores/{storeId}: - delete: - deprecated: false - description: Deletes a key-value store. - operationId: keyValueStore_delete - parameters: - - $ref: "#/components/parameters/storeId" - responses: - "204": - $ref: "#/components/responses/NoContent" - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Delete store - tags: - - Storage/Key-value stores - x-legacy-doc-urls: - - https://docs.apify.com/api/v2#/reference/key-value-stores/store-object/delete-store - - https://docs.apify.com/api/v2#/reference/key-value-stores/delete-store - - https://docs.apify.com/api/v2#tag/Key-value-storesStore-object/operation/keyValueStore_delete - x-js-parent: KeyValueStoreClient - x-js-name: delete - x-js-doc-url: https://docs.apify.com/api/client/js/reference/class/KeyValueStoreClient#delete - get: - deprecated: false - description: | - Gets an object that contains all the details about a specific key-value - store. - operationId: keyValueStore_get - parameters: - - $ref: "#/components/parameters/storeId" - responses: - "200": - content: - application/json: - schema: - $ref: "#/components/schemas/KeyValueStoreResponse" - description: "" - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Get store - tags: - - Storage/Key-value stores - x-legacy-doc-urls: - - https://docs.apify.com/api/v2#/reference/key-value-stores/store-object/get-store - - https://docs.apify.com/api/v2#/reference/key-value-stores/get-store - - https://docs.apify.com/api/v2#tag/Key-value-storesStore-object/operation/keyValueStore_get - x-js-parent: KeyValueStoreClient - x-js-name: get - x-js-doc-url: https://docs.apify.com/api/client/js/reference/class/KeyValueStoreClient#get - x-py-parent: KeyValueStoreClientAsync - x-py-name: get - x-py-doc-url: https://docs.apify.com/api/client/python/reference/class/KeyValueStoreClientAsync#get - put: - deprecated: false - description: | - Updates a key-value store's name and general resource access level using a value specified by a JSON object - passed in the PUT payload. - - The response is the updated key-value store object, as returned by the [Get - store](#/reference/key-value-stores/store-object/get-store) API endpoint. - operationId: keyValueStore_put - parameters: - - $ref: "#/components/parameters/storeId" - requestBody: - content: - application/json: - example: - name: new-store-name - schema: - $ref: "#/components/schemas/UpdateStoreRequest" - description: "" - required: true - responses: - "200": - content: - application/json: - schema: - $ref: "#/components/schemas/KeyValueStoreResponse" - description: "" - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "413": - $ref: "#/components/responses/PayloadTooLarge" - "415": - $ref: "#/components/responses/UnsupportedMediaType" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Update store - tags: - - Storage/Key-value stores - x-legacy-doc-urls: - - https://docs.apify.com/api/v2#/reference/key-value-stores/store-object/update-store - - https://docs.apify.com/api/v2#/reference/key-value-stores/update-store - - https://docs.apify.com/api/v2#tag/Key-value-storesStore-object/operation/keyValueStore_put - x-js-parent: KeyValueStoreClient - x-js-name: update - x-js-doc-url: https://docs.apify.com/api/client/js/reference/class/KeyValueStoreClient#update - x-py-parent: KeyValueStoreClientAsync - x-py-name: update - x-py-doc-url: https://docs.apify.com/api/client/python/reference/class/KeyValueStoreClientAsync#update - /v2/key-value-stores/{storeId}/keys: - get: - deprecated: false - description: | - Returns a list of objects describing keys of a given key-value store, as - well as some information about the values (e.g. size). - - This endpoint is paginated using `exclusiveStartKey` and `limit` parameters - - see [Pagination](/api/v2#using-key) for more details. - operationId: keyValueStore_keys_get - parameters: - - $ref: "#/components/parameters/storeId" - - $ref: "#/components/parameters/exclusiveStartKey" - - $ref: "#/components/parameters/keyValueStoreParameters_limit" - - $ref: "#/components/parameters/collectionKeys" - - $ref: "#/components/parameters/prefixKeys" - - $ref: "#/components/parameters/signature" - responses: - "200": - content: - application/json: - schema: - $ref: "#/components/schemas/ListOfKeysResponse" - description: "" - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Get list of keys - tags: - - Storage/Key-value stores - x-legacy-doc-urls: - - https://docs.apify.com/api/v2#/reference/key-value-stores/key-collection/get-list-of-keys - - https://docs.apify.com/api/v2#/reference/key-value-stores/get-list-of-keys - - https://docs.apify.com/api/v2#tag/Key-value-storesKey-collection/operation/keyValueStore_keys_get - x-js-parent: KeyValueStoreClient - x-js-name: listKeys - x-js-doc-url: https://docs.apify.com/api/client/js/reference/class/KeyValueStoreClient#listKeys - x-py-parent: KeyValueStoreClientAsync - x-py-name: list_keys - x-py-doc-url: https://docs.apify.com/api/client/python/reference/class/KeyValueStoreClientAsync#list_keys - /v2/key-value-stores/{storeId}/records: - get: - deprecated: false - description: | - Downloads all records from the key-value store as a ZIP archive. - Each record is stored as a separate file in the archive, with the filename equal to the record key. - - You can optionally filter the records by `collection` or `prefix` to download only a subset of the store. - operationId: keyValueStore_records_get - parameters: - - $ref: "#/components/parameters/storeId" - - $ref: "#/components/parameters/collectionRecords" - - $ref: "#/components/parameters/prefixRecords" - - $ref: "#/components/parameters/signature" - responses: - "200": - content: - application/zip: - schema: - format: binary - type: string - description: A ZIP archive containing the requested records. - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Download records - tags: - - Storage/Key-value stores - /v2/key-value-stores/{storeId}/records/{recordKey}: - delete: - deprecated: false - description: Removes a record specified by a key from the key-value store. - operationId: keyValueStore_record_delete - parameters: - - $ref: "#/components/parameters/storeId" - - $ref: "#/components/parameters/recordKey" - responses: - "204": - $ref: "#/components/responses/NoContent" - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Delete record - tags: - - Storage/Key-value stores - x-legacy-doc-urls: - - https://docs.apify.com/api/v2#/reference/key-value-stores/record/delete-record - - https://docs.apify.com/api/v2#/reference/key-value-stores/delete-record - - https://docs.apify.com/api/v2#tag/Key-value-storesRecord/operation/keyValueStore_record_delete - x-js-parent: KeyValueStoreClient - x-js-name: deleteRecord - x-js-doc-url: https://docs.apify.com/api/client/js/reference/class/KeyValueStoreClient#deleteRecord - x-py-parent: KeyValueStoreClientAsync - x-py-name: delete_record - x-py-doc-url: https://docs.apify.com/api/client/python/reference/class/KeyValueStoreClientAsync#delete_record - get: - deprecated: false - description: | - Gets a value stored in the key-value store under a specific key. - - The response body has the same `Content-Encoding` header as it was set in - [Put record](#tag/Key-value-storesRecord/operation/keyValueStore_record_put). - - If the request does not define the `Accept-Encoding` HTTP header with the - right encoding, the record will be decompressed. - - Most HTTP clients support decompression by default. After using the HTTP - client with decompression support, the `Accept-Encoding` header is set by - the client and body is decompressed automatically. - - Please note that for security reasons, Apify API can perform small modifications - to HTML documents before they are served via this endpoint. To fetch the raw HTML - content without any modifications, use the `attachment` query parameter. - operationId: keyValueStore_record_get - parameters: - - $ref: "#/components/parameters/storeId" - - $ref: "#/components/parameters/recordKey" - - $ref: "#/components/parameters/keyValueStoreParameters_attachment" - - $ref: "#/components/parameters/signature" - responses: - "200": - content: - application/json: - schema: - $ref: "#/components/schemas/RecordResponse" - '*/*': - schema: {} - description: "" - "302": - content: {} - description: "" - headers: - Location: - content: - text/plain: - example: https://apifier-key-value-store-prod.s3.amazonaws.com/tqx6jeMia43gYY6eE/INPUT?AWSAccessKeyId=NKDOUN&Expires=1502720992&Signature=DKLVPI4lDDKC - schema: - type: string - explode: false - style: simple - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Get record - tags: - - Storage/Key-value stores - x-legacy-doc-urls: - - https://docs.apify.com/api/v2#/reference/key-value-stores/record/get-record - - https://docs.apify.com/api/v2#/reference/key-value-stores/get-record - - https://docs.apify.com/api/v2#tag/Key-value-storesRecord/operation/keyValueStore_record_get - x-js-parent: KeyValueStoreClient - x-js-name: getRecord - x-js-doc-url: https://docs.apify.com/api/client/js/reference/class/KeyValueStoreClient#getRecord - x-py-parent: KeyValueStoreClientAsync - x-py-name: get_record - x-py-doc-url: https://docs.apify.com/api/client/python/reference/class/KeyValueStoreClientAsync#get_record - head: - deprecated: false - description: | - Check if a value is stored in the key-value store under a specific key. - operationId: keyValueStore_record_head - parameters: - - $ref: "#/components/parameters/storeId" - - $ref: "#/components/parameters/recordKey" - responses: - "200": - description: The record exists - "404": - $ref: "#/components/responses/NotFound" - summary: Check if a record exists - tags: - - Storage/Key-value stores - x-js-parent: KeyValueStoreClient - x-js-name: recordExists - x-js-doc-url: https://docs.apify.com/api/client/js/reference/class/KeyValueStoreClient#recordExists - x-py-parent: KeyValueStoreClientAsync - x-py-name: record_exists - x-py-doc-url: https://docs.apify.com/api/client/python/reference/class/KeyValueStoreClientAsync#record_exists - post: - deprecated: false - description: | - Stores a value under a specific key to the key-value store. - - This endpoint is an alias for the [`PUT` record](#tag/Key-value-storesRecord/operation/keyValueStore_record_put) method and behaves identically. - operationId: keyValueStore_record_post - parameters: - - $ref: "#/components/parameters/storeId" - - $ref: "#/components/parameters/recordKey" - - $ref: "#/components/parameters/Content-Encoding" - requestBody: - content: - application/json: - schema: - $ref: "#/components/schemas/PutRecordRequest" - '*/*': - schema: {} - description: "" - required: true - responses: - "201": - content: - application/json: - example: {} - schema: - type: object - description: "" - headers: - Location: - content: - text/plain: - example: https://api.apify.com/v2/key-value-stores/WkzbQMuFYuamGv3YF/records/some-key - schema: - type: string - explode: false - style: simple - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "413": - $ref: "#/components/responses/PayloadTooLarge" - "415": - $ref: "#/components/responses/UnsupportedMediaType" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Store record (POST) - tags: - - Storage/Key-value stores - x-legacy-doc-urls: - - https://docs.apify.com/api/v2#/reference/key-value-stores/record/put-record - - https://docs.apify.com/api/v2#/reference/key-value-stores/put-record - - https://docs.apify.com/api/v2#tag/Key-value-storesRecord/operation/keyValueStore_record_post - put: - deprecated: false - description: | - Stores a value under a specific key to the key-value store. - - The value is passed as the PUT payload and it is stored with a MIME content - type defined by the `Content-Type` header and with encoding defined by the - `Content-Encoding` header. - - To save bandwidth, storage, and speed up your upload, send the request - payload compressed with Gzip compression and add the `Content-Encoding: gzip` - header. It is possible to set up another compression type with `Content-Encoding` - request header. - - Below is a list of supported `Content-Encoding` types. - - * Gzip compression: `Content-Encoding: gzip` - * Deflate compression: `Content-Encoding: deflate` - * Brotli compression: `Content-Encoding: br` - operationId: keyValueStore_record_put - parameters: - - $ref: "#/components/parameters/storeId" - - $ref: "#/components/parameters/recordKey" - - $ref: "#/components/parameters/Content-Encoding" - requestBody: - content: - application/json: - schema: - $ref: "#/components/schemas/PutRecordRequest" - '*/*': - schema: {} - description: "" - required: true - responses: - "201": - content: - application/json: - example: {} - schema: - type: object - description: "" - headers: - Location: - content: - text/plain: - example: https://api.apify.com/v2/key-value-stores/WkzbQMuFYuamGv3YF/records/some-key - schema: - type: string - explode: false - style: simple - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "413": - $ref: "#/components/responses/PayloadTooLarge" - "415": - $ref: "#/components/responses/UnsupportedMediaType" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Store record - tags: - - Storage/Key-value stores - x-legacy-doc-urls: - - https://docs.apify.com/api/v2#/reference/key-value-stores/record/put-record - - https://docs.apify.com/api/v2#/reference/key-value-stores/put-record - - https://docs.apify.com/api/v2#tag/Key-value-storesRecord/operation/keyValueStore_record_put - x-js-parent: KeyValueStoreClient - x-js-name: setRecord - x-js-doc-url: https://docs.apify.com/api/client/js/reference/class/KeyValueStoreClient#setRecord - x-py-parent: KeyValueStoreClientAsync - x-py-name: set_record - x-py-doc-url: https://docs.apify.com/api/client/python/reference/class/KeyValueStoreClientAsync#set_record - /v2/datasets: - get: - deprecated: false - description: | - Lists all of a user's datasets. - - The response is a JSON array of objects, - where each object contains basic information about one dataset. - - By default, the objects are sorted by the `createdAt` field in ascending - order, therefore you can use pagination to incrementally fetch all datasets while new - ones are still being created. To sort them in descending order, use `desc=1` - parameter. The endpoint supports pagination using `limit` and `offset` - parameters and it will not return more than 1000 array elements. - operationId: datasets_get - parameters: - - $ref: "#/components/parameters/offset" - - $ref: "#/components/parameters/limit" - - $ref: "#/components/parameters/descCreatedAt" - - $ref: "#/components/parameters/unnamed" - - description: | - Filter by ownership. If this parameter is omitted, all accessible datasets are returned. - - - `ownedByMe`: Return only datasets owned by the user. - - `sharedWithMe`: Return only datasets shared with the user by other users. - explode: true - in: query - name: ownership - required: false - schema: - $ref: "#/components/schemas/StorageOwnership" - style: form - responses: - "200": - content: - application/json: - schema: - $ref: "#/components/schemas/ListOfDatasetsResponse" - description: "" - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Get list of datasets - tags: - - Storage/Datasets - x-legacy-doc-urls: - - https://docs.apify.com/api/v2#/reference/datasets/dataset-collection/get-list-of-datasets - - https://docs.apify.com/api/v2#/reference/datasets/get-list-of-datasets - - https://docs.apify.com/api/v2#tag/DatasetsDataset-collection/operation/datasets_get - x-js-parent: DatasetCollectionClient - x-js-name: list - x-js-doc-url: https://docs.apify.com/api/client/js/reference/class/DatasetCollectionClient#list - x-py-parent: DatasetCollectionClientAsync - x-py-name: list - x-py-doc-url: https://docs.apify.com/api/client/python/reference/class/DatasetCollectionClientAsync#list - post: - deprecated: false - description: | - Creates a dataset and returns its object. - Keep in mind that data stored under unnamed dataset follows [data retention period](https://docs.apify.com/platform/storage#data-retention). - It creates a dataset with the given name if the parameter name is used. - If a dataset with the given name already exists then returns its object. - operationId: datasets_post - parameters: - - description: Custom unique name to easily identify the dataset in the future. - explode: true - in: query - name: name - required: false - schema: - example: eshop-items - type: string - style: form - responses: - "200": - content: - application/json: - schema: - $ref: "#/components/schemas/DatasetResponse" - description: Returns the existing dataset object if a dataset with the given - name already exists. - "201": - content: - application/json: - schema: - $ref: "#/components/schemas/DatasetResponse" - description: "" - headers: - Location: - content: - text/plain: - example: https://api.apify.com/v2/datasets/WkzbQMuFYuamGv3YF - schema: - type: string - explode: false - style: simple - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Create dataset - tags: - - Storage/Datasets - x-legacy-doc-urls: - - https://docs.apify.com/api/v2#/reference/datasets/dataset-collection/create-dataset - - https://docs.apify.com/api/v2#/reference/datasets/create-dataset - - https://docs.apify.com/api/v2#tag/DatasetsDataset-collection/operation/datasets_post - x-js-parent: DatasetCollectionClient - x-js-name: getOrCreate - x-js-doc-url: https://docs.apify.com/api/client/js/reference/class/DatasetCollectionClient#getOrCreate - x-py-parent: DatasetCollectionClientAsync - x-py-name: get_or_create - x-py-doc-url: https://docs.apify.com/api/client/python/reference/class/DatasetCollectionClientAsync#get_or_create - /v2/datasets/{datasetId}: - delete: - deprecated: false - description: Deletes a specific dataset. - operationId: dataset_delete - parameters: - - $ref: "#/components/parameters/datasetId" - responses: - "204": - $ref: "#/components/responses/NoContent" - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Delete dataset - tags: - - Storage/Datasets - x-legacy-doc-urls: - - https://docs.apify.com/api/v2#/reference/datasets/dataset/delete-dataset - - https://docs.apify.com/api/v2#/reference/datasets/delete-dataset - - https://docs.apify.com/api/v2#tag/DatasetsDataset/operation/dataset_delete - x-js-parent: DatasetClient - x-js-name: delete - x-js-doc-url: https://docs.apify.com/api/client/js/reference/class/DatasetClient#delete - get: - deprecated: false - description: | - Returns dataset object for given dataset ID. - - This does not return dataset items, only information about the storage itself. - To retrieve dataset items, use the [List dataset items](/api/v2/dataset-items-get) endpoint. - - :::note - - Keep in mind that attributes `itemCount` and `cleanItemCount` are not propagated right away after data are pushed into a dataset. - - ::: - - There is a short period (up to 5 seconds) during which these counters may not match with exact counts in dataset items. - operationId: dataset_get - parameters: - - $ref: "#/components/parameters/datasetId" - responses: - "200": - content: - application/json: - schema: - $ref: "#/components/schemas/DatasetResponse" - description: "" - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Get dataset - tags: - - Storage/Datasets - x-legacy-doc-urls: - - https://docs.apify.com/api/v2#/reference/datasets/dataset/get-dataset - - https://docs.apify.com/api/v2#/reference/datasets/get-dataset - - https://docs.apify.com/api/v2#tag/DatasetsDataset/operation/dataset_get - x-js-parent: DatasetClient - x-js-name: get - x-js-doc-url: https://docs.apify.com/api/client/js/reference/class/DatasetClient#get - x-py-parent: DatasetClientAsync - x-py-name: get - x-py-doc-url: https://docs.apify.com/api/client/python/reference/class/DatasetClientAsync#get - put: - deprecated: false - description: | - Updates a dataset's name and general resource access level using a value specified by a JSON object passed in the PUT payload. - The response is the updated dataset object, as returned by the [Get dataset](/api/v2/dataset-get) API endpoint. - operationId: dataset_put - parameters: - - $ref: "#/components/parameters/datasetId" - requestBody: - content: - application/json: - schema: - $ref: "#/components/schemas/UpdateDatasetRequest" - description: "" - required: true - responses: - "200": - content: - application/json: - schema: - $ref: "#/components/schemas/DatasetResponse" - description: "" - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "413": - $ref: "#/components/responses/PayloadTooLarge" - "415": - $ref: "#/components/responses/UnsupportedMediaType" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Update dataset - tags: - - Storage/Datasets - x-legacy-doc-urls: - - https://docs.apify.com/api/v2#/reference/datasets/dataset/update-dataset - - https://docs.apify.com/api/v2#/reference/datasets/update-dataset - - https://docs.apify.com/api/v2#tag/DatasetsDataset/operation/dataset_put - x-js-parent: DatasetClient - x-js-name: update - x-js-doc-url: https://docs.apify.com/api/client/js/reference/class/DatasetClient#update - x-py-parent: DatasetClientAsync - x-py-name: update - x-py-doc-url: https://docs.apify.com/api/client/python/reference/class/DatasetClientAsync#update - /v2/datasets/{datasetId}/items: - get: - deprecated: false - description: | - Returns data stored in the dataset in a desired format. - - ### Response format - - The format of the response depends on <code>format</code> query parameter. - - The <code>format</code> parameter can have one of the following values: - <code>json</code>, <code>jsonl</code>, <code>xml</code>, <code>html</code>, - <code>csv</code>, <code>xlsx</code> and <code>rss</code>. - - The following table describes how each format is treated. - - <table> - <tr> - <th>Format</th> - <th>Items</th> - </tr> - <tr> - <td><code>json</code></td> - <td rowspan="3">The response is a JSON, JSONL or XML array of raw item objects.</td> - </tr> - <tr> - <td><code>jsonl</code></td> - </tr> - <tr> - <td><code>xml</code></td> - </tr> - <tr> - <td><code>html</code></td> - <td rowspan="3">The response is a HTML, CSV or XLSX table, where columns correspond to the - properties of the item and rows correspond to each dataset item.</td> - </tr> - <tr> - <td><code>csv</code></td> - </tr> - <tr> - <td><code>xlsx</code></td> - </tr> - <tr> - <td><code>rss</code></td> - <td colspan="2">The response is a RSS file. Each item is displayed as child elements of one - <code><item></code>.</td> - </tr> - </table> - - Note that CSV, XLSX and HTML tables are limited to 2000 columns and the column names cannot be longer than 200 characters. - JSON, XML and RSS formats do not have such restrictions. - - ### Hidden fields - - The top-level fields starting with the `#` character are considered hidden. - These are useful to store debugging information and can be omitted from the output by providing the `skipHidden=1` or `clean=1` query parameters. - For example, if you store the following object to the dataset: - - ``` - { - productName: "iPhone Xs", - description: "Welcome to the big screens." - #debug: { - url: "https://www.apple.com/lae/iphone-xs/", - crawledAt: "2019-01-21T16:06:03.683Z" - } - } - ``` - - The `#debug` field will be considered as hidden and can be omitted from the - results. This is useful to - provide nice cleaned data to end users, while keeping debugging info - available if needed. The Dataset object - returned by the API contains the number of such clean items in the`dataset.cleanItemCount` property. - - ### XML format extension - - When exporting results to XML or RSS formats, the names of object properties become XML tags and the corresponding values become tag's children. For example, the following JavaScript object: - - ``` - { - name: "Paul Newman", - address: [ - { type: "home", street: "21st", city: "Chicago" }, - { type: "office", street: null, city: null } - ] - } - ``` - - will be transformed to the following XML snippet: - - ``` - <name>Paul Newman</name> - <address> - <type>home</type> - <street>21st</street> - <city>Chicago</city> - </address> - <address> - <type>office</type> - <street/> - <city/> - </address> - ``` - - If the JavaScript object contains a property named `@` then its sub-properties are exported as attributes of the parent XML - element. - If the parent XML element does not have any child elements then its value is taken from a JavaScript object property named `#`. - - For example, the following JavaScript object: - - ``` - { - "address": [{ - "@": { - "type": "home" - }, - "street": "21st", - "city": "Chicago" - }, - { - "@": { - "type": "office" - }, - "#": 'unknown' - }] - } - ``` - - will be transformed to the following XML snippet: - - ``` - <address type="home"> - <street>21st</street> - <city>Chicago</city> - </address> - <address type="office">unknown</address> - ``` - - This feature is also useful to customize your RSS feeds generated for various websites. - - By default the whole result is wrapped in a `<items>` element and each page object is wrapped in a `<item>` element. - You can change this using <code>xmlRoot</code> and <code>xmlRow</code> url parameters. - - ### Pagination - - The generated response supports [pagination](#/introduction/pagination). - The pagination is always performed with the granularity of a single item, regardless whether <code>unwind</code> parameter was provided. - By default, the **Items** in the response are sorted by the time they were stored to the database, therefore you can use pagination to incrementally fetch the items as they are being added. - No limit exists to how many items can be returned in one response. - - If you specify `desc=1` query parameter, the results are returned in the reverse order than they were stored (i.e. from newest to oldest items). - Note that only the order of **Items** is reversed, but not the order of the `unwind` array elements. - operationId: dataset_items_get - parameters: - - $ref: "#/components/parameters/datasetId" - - $ref: "#/components/parameters/format" - - $ref: "#/components/parameters/clean" - - $ref: "#/components/parameters/offset" - - $ref: "#/components/parameters/datasetParameters_limit" - - $ref: "#/components/parameters/fields" - - $ref: "#/components/parameters/outputFields" - - $ref: "#/components/parameters/omit" - - $ref: "#/components/parameters/unwind" - - $ref: "#/components/parameters/flatten" - - $ref: "#/components/parameters/descDataset" - - $ref: "#/components/parameters/attachment" - - $ref: "#/components/parameters/delimiter" - - $ref: "#/components/parameters/bom" - - $ref: "#/components/parameters/xmlRoot" - - $ref: "#/components/parameters/xmlRow" - - $ref: "#/components/parameters/skipHeaderRow" - - $ref: "#/components/parameters/skipHidden" - - $ref: "#/components/parameters/skipEmpty" - - $ref: "#/components/parameters/simplified" - - $ref: "#/components/parameters/view" - - $ref: "#/components/parameters/skipFailedPages" - - $ref: "#/components/parameters/feedTitle" - - $ref: "#/components/parameters/feedDescription" - - $ref: "#/components/parameters/signature" - responses: - "200": - content: - application/json: - schema: - example: - - foo: bar - - foo2: bar2 - items: - type: object - type: array - default: null - application/jsonl: - example: "{\"foo\":\"bar\"}\\n{\"foo2\":\"bar2\"}\\n" - schema: - type: string - text/csv: - example: "foo,bar\\nfoo2,bar2\\n" - schema: - type: string - text/html: - example: <table><tr><th>foo</th><th>bar</th></tr><tr><td>foo</td><td>bar</td></tr><tr><td>foo2</td><td>bar2</td></tr></table> - schema: - type: string - application/vnd.openxmlformats-officedocument.spreadsheetml.sheet: - schema: - type: string - application/rss+xml: - example: <rss><channel><item><foo>bar</foo></item><item><foo2>bar2</foo2></item></channel></rss> - schema: - type: string - application/xml: - example: <items><item><foo>bar</foo></item><item><foo2>bar2</foo2></item></items> - schema: - type: string - description: "" - headers: - X-Apify-Pagination-Offset: - content: - text/plain: - example: "0" - schema: {} - description: The offset of the first item in the current page. - explode: false - style: simple - X-Apify-Pagination-Limit: - content: - text/plain: - example: "100" - schema: {} - description: The maximum number of items returned per page. - explode: false - style: simple - X-Apify-Pagination-Count: - content: - text/plain: - example: "100" - schema: {} - description: The number of items returned in the current page. - explode: false - style: simple - X-Apify-Pagination-Total: - content: - text/plain: - example: "10204" - schema: {} - description: The total number of items in the dataset. - explode: false - style: simple - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Get dataset items - tags: - - Storage/Datasets - x-legacy-doc-urls: - - https://docs.apify.com/api/v2#/reference/datasets/item-collection/get-items - - https://docs.apify.com/api/v2#/reference/datasets/get-items - - https://docs.apify.com/api/v2#tag/DatasetsItem-collection/operation/dataset_items_get - x-js-parent: DatasetClient - x-js-name: listItems - x-js-doc-url: https://docs.apify.com/api/client/js/reference/class/DatasetClient#listItems - x-py-parent: DatasetClientAsync - x-py-name: stream_items - x-py-doc-url: https://docs.apify.com/api/client/python/reference/class/DatasetClientAsync#stream_items - head: - deprecated: false - description: | - Returns only the HTTP headers for the dataset items endpoint, without the response body. - This is useful to check pagination metadata or verify access without downloading the full dataset. - operationId: dataset_items_head - parameters: - - $ref: "#/components/parameters/datasetId" - - $ref: "#/components/parameters/format" - - $ref: "#/components/parameters/clean" - - $ref: "#/components/parameters/offset" - - $ref: "#/components/parameters/datasetParameters_limit" - - $ref: "#/components/parameters/fields" - - $ref: "#/components/parameters/outputFields" - - $ref: "#/components/parameters/omit" - - $ref: "#/components/parameters/unwind" - - $ref: "#/components/parameters/flatten" - - $ref: "#/components/parameters/descDataset" - - $ref: "#/components/parameters/attachment" - - $ref: "#/components/parameters/delimiter" - - $ref: "#/components/parameters/bom" - - $ref: "#/components/parameters/xmlRoot" - - $ref: "#/components/parameters/xmlRow" - - $ref: "#/components/parameters/skipHeaderRow" - - $ref: "#/components/parameters/skipHidden" - - $ref: "#/components/parameters/skipEmpty" - - $ref: "#/components/parameters/simplified" - - $ref: "#/components/parameters/view" - - $ref: "#/components/parameters/skipFailedPages" - - $ref: "#/components/parameters/feedTitle" - - $ref: "#/components/parameters/feedDescription" - - $ref: "#/components/parameters/signature" - responses: - "200": - content: {} - description: "" - headers: - X-Apify-Pagination-Offset: - content: - text/plain: - example: "0" - schema: {} - description: The offset of the first item in the current page. - explode: false - style: simple - X-Apify-Pagination-Limit: - content: - text/plain: - example: "100" - schema: {} - description: The maximum number of items returned per page. - explode: false - style: simple - X-Apify-Pagination-Count: - content: - text/plain: - example: "100" - schema: {} - description: The number of items returned in the current page. - explode: false - style: simple - X-Apify-Pagination-Total: - content: - text/plain: - example: "10204" - schema: {} - description: The total number of items in the dataset. - explode: false - style: simple - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Get dataset items headers - tags: - - Storage/Datasets - post: - deprecated: false - description: | - Appends an item or an array of items to the end of the dataset. - The POST payload is a JSON object or a JSON array of objects to save into the dataset. - - If the data you attempt to store in the dataset is invalid (meaning any of the items received by the API fails the validation), the whole request is discarded and the API will return a response with status code 400. - For more information about dataset schema validation, see [Dataset schema](https://docs.apify.com/platform/actors/development/actor-definition/dataset-schema/validation). - - **IMPORTANT:** The limit of request payload size for the dataset is 5 MB. If the array exceeds the size, you'll need to split it into a number of smaller arrays. - operationId: dataset_items_post - parameters: - - $ref: "#/components/parameters/datasetId" - requestBody: - content: - application/json: - schema: - $ref: "#/components/schemas/act_runs_last_dataset_items_post_request" - description: "" - required: true - responses: - "201": - content: - application/json: - schema: - example: {} - type: object - description: "" - headers: - Location: - content: - text/plain: - example: https://api.apify.com/v2/datasets/WkzbQMuFYuamGv3YF/items - schema: - type: string - explode: false - style: simple - "400": - content: - application/json: - schema: - $ref: "#/components/schemas/act_runs_last_dataset_items_post_400_response" - description: "" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Store items - tags: - - Storage/Datasets - x-legacy-doc-urls: - - https://docs.apify.com/api/v2#/reference/datasets/item-collection/put-items - - https://docs.apify.com/api/v2#/reference/datasets/put-items - - https://docs.apify.com/api/v2#tag/DatasetsItem-collection/operation/dataset_items_post - x-js-parent: DatasetClient - x-js-name: pushItems - x-js-doc-url: https://docs.apify.com/api/client/js/reference/class/DatasetClient#pushItems - x-py-parent: DatasetClientAsync - x-py-name: push_items - x-py-doc-url: https://docs.apify.com/api/client/python/reference/class/DatasetClientAsync#push_items - /v2/datasets/{datasetId}/statistics: - get: - description: | - Returns statistics for given dataset. - - Provides only [field statistics](https://docs.apify.com/platform/actors/development/actor-definition/dataset-schema/validation#dataset-field-statistics). - operationId: dataset_statistics_get - parameters: - - $ref: "#/components/parameters/datasetId" - responses: - "200": - content: - application/json: - schema: - $ref: "#/components/schemas/DatasetStatisticsResponse" - description: "" - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Get dataset statistics - tags: - - Storage/Datasets - /v2/request-queues: - get: - deprecated: false - description: | - Lists all of a user's request queues. The response is a JSON array of - objects, where each object - contains basic information about one queue. - - By default, the objects are sorted by the `createdAt` field in ascending order, - therefore you can use pagination to incrementally fetch all queues while new - ones are still being created. To sort them in descending order, use `desc=1` - parameter. The endpoint supports pagination using `limit` and `offset` - parameters and it will not return more than 1000 - array elements. - operationId: requestQueues_get - parameters: - - $ref: "#/components/parameters/offset" - - $ref: "#/components/parameters/limit" - - $ref: "#/components/parameters/descCreatedAt" - - $ref: "#/components/parameters/unnamed" - - description: | - Filter by ownership. If this parameter is omitted, all accessible request queues are returned. - - - `ownedByMe`: Return only request queues owned by the user. - - `sharedWithMe`: Return only request queues shared with the user by other users. - explode: true - in: query - name: ownership - required: false - schema: - $ref: "#/components/schemas/StorageOwnership" - style: form - responses: - "200": - content: - application/json: - schema: - $ref: "#/components/schemas/ListOfRequestQueuesResponse" - description: "" - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Get list of request queues - tags: - - Storage/Request queues - x-legacy-doc-urls: - - https://docs.apify.com/api/v2#/reference/request-queues/queue-collection/get-list-of-request-queues - - https://docs.apify.com/api/v2#/reference/request-queues/get-list-of-request-queues - - https://docs.apify.com/api/v2#tag/Request-queuesQueue-collection/operation/requestQueues_get - x-js-parent: RequestQueueCollectionClient - x-js-name: list - x-js-doc-url: https://docs.apify.com/api/client/js/reference/class/RequestQueueCollectionClient#list - x-py-parent: RequestQueueCollectionClientAsync - x-py-name: list - x-py-doc-url: https://docs.apify.com/api/client/python/reference/class/RequestQueueCollectionClientAsync#list - post: - deprecated: false - description: | - Creates a request queue and returns its object. - Keep in mind that requests stored under unnamed queue follows [data - retention period](https://docs.apify.com/platform/storage#data-retention). - - It creates a queue of given name if the parameter name is used. If a queue - with the given name already exists then the endpoint returns - its object. - operationId: requestQueues_post - parameters: - - description: Custom unique name to easily identify the queue in the future. - explode: true - in: query - name: name - required: false - schema: - example: example-com - type: string - style: form - responses: - "200": - content: - application/json: - schema: - $ref: "#/components/schemas/RequestQueueResponse" - description: Returns the existing request queue object if a queue with the - given name already exists. - "201": - content: - application/json: - schema: - $ref: "#/components/schemas/RequestQueueResponse" - description: "" - headers: - Location: - content: - text/plain: - example: https://api.apify.com/v2/request-queues/WkzbQMuFYuamGv3YF - schema: - type: string - explode: false - style: simple - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Create request queue - tags: - - Storage/Request queues - x-legacy-doc-urls: - - https://docs.apify.com/api/v2#/reference/request-queues/queue-collection/create-request-queue - - https://docs.apify.com/api/v2#/reference/request-queues/create-request-queue - - https://docs.apify.com/api/v2#tag/Request-queuesQueue-collection/operation/requestQueues_post - x-js-parent: RequestQueueCollectionClient - x-js-name: getOrCreate - x-js-doc-url: https://docs.apify.com/api/client/js/reference/class/RequestQueueCollectionClient#getOrCreate - x-py-parent: RequestQueueCollectionClientAsync - x-py-name: get_or_create - x-py-doc-url: https://docs.apify.com/api/client/python/reference/class/RequestQueueCollectionClientAsync#get_or_create - /v2/request-queues/{queueId}: - delete: - deprecated: false - description: Deletes given queue. - operationId: requestQueue_delete - parameters: - - $ref: "#/components/parameters/queueId" - responses: - "204": - $ref: "#/components/responses/NoContent" - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Delete request queue - tags: - - Storage/Request queues - x-legacy-doc-urls: - - https://docs.apify.com/api/v2#/reference/request-queues/queue/delete-request-queue - - https://docs.apify.com/api/v2#/reference/request-queues/delete-request-queue - - https://docs.apify.com/api/v2#tag/Request-queuesQueue/operation/requestQueue_delete - x-js-parent: RequestQueueClient - x-js-name: delete - x-js-doc-url: https://docs.apify.com/api/client/js/reference/class/RequestQueueClient#delete - get: - deprecated: false - description: Returns queue object for given queue ID. - operationId: requestQueue_get - parameters: - - $ref: "#/components/parameters/queueId" - responses: - "200": - content: - application/json: - schema: - $ref: "#/components/schemas/RequestQueueResponse" - description: "" - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Get request queue - tags: - - Storage/Request queues - x-legacy-doc-urls: - - https://docs.apify.com/api/v2#/reference/request-queues/queue/get-request-queue - - https://docs.apify.com/api/v2#/reference/request-queues/get-request-queue - - https://docs.apify.com/api/v2#tag/Request-queuesQueue/operation/requestQueue_get - x-js-parent: RequestQueueClient - x-js-name: get - x-js-doc-url: https://docs.apify.com/api/client/js/reference/class/RequestQueueClient#get - x-py-parent: RequestQueueClientAsync - x-py-name: get - x-py-doc-url: https://docs.apify.com/api/client/python/reference/class/RequestQueueClientAsync#get - put: - deprecated: false - description: | - Updates a request queue's name and general resource access level using a value specified by a JSON object - passed in the PUT payload. - - The response is the updated request queue object, as returned by the - [Get request queue](#/reference/request-queues/queue-collection/get-request-queue) API endpoint. - operationId: requestQueue_put - parameters: - - $ref: "#/components/parameters/queueId" - requestBody: - content: - application/json: - example: - name: new-request-queue-name - schema: - allOf: - - $ref: "#/components/schemas/UpdateRequestQueueRequest" - example: - name: new-request-queue-name - description: "" - required: true - responses: - "200": - content: - application/json: - schema: - $ref: "#/components/schemas/RequestQueueResponse" - description: "" - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "413": - $ref: "#/components/responses/PayloadTooLarge" - "415": - $ref: "#/components/responses/UnsupportedMediaType" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Update request queue - tags: - - Storage/Request queues - x-legacy-doc-urls: - - https://docs.apify.com/api/v2#/reference/request-queues/queue/update-request-queue - - https://docs.apify.com/api/v2#/reference/request-queues/update-request-queue - - https://docs.apify.com/api/v2#tag/Request-queuesQueue/operation/requestQueue_put - x-js-parent: RequestQueueClient - x-js-name: update - x-js-doc-url: https://docs.apify.com/api/client/js/reference/class/RequestQueueClient#update - x-py-parent: RequestQueueClientAsync - x-py-name: update - x-py-doc-url: https://docs.apify.com/api/client/python/reference/class/RequestQueueClientAsync#update - /v2/request-queues/{queueId}/requests/batch: - delete: - deprecated: false - description: | - Batch-deletes given requests from the queue. The number of requests in a - batch is limited to 25. The response contains an array of unprocessed and - processed requests. - If any delete operation fails because the request queue rate limit is - exceeded or an internal failure occurs, - the failed request is returned in the `unprocessedRequests` response - parameter. - You can re-send these delete requests. It is recommended to use an - exponential backoff algorithm for these retries. - Each request is identified by its ID or uniqueKey parameter. You can use - either of them to identify the request. - operationId: requestQueue_requests_batch_delete - parameters: - - $ref: "#/components/parameters/queueId" - - $ref: "#/components/parameters/contentTypeJson" - - $ref: "#/components/parameters/clientKey" - requestBody: - content: - application/json: - schema: - items: - $ref: "#/components/schemas/RequestDraftDelete" - type: array - default: null - description: "" - required: true - responses: - "200": - content: - application/json: - schema: - $ref: "#/components/schemas/BatchDeleteResponse" - description: "" - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "413": - $ref: "#/components/responses/PayloadTooLarge" - "415": - $ref: "#/components/responses/UnsupportedMediaType" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Delete requests - tags: - - Storage/Request queues - x-legacy-doc-urls: - - https://docs.apify.com/api/v2#/reference/request-queues/batch-request-operations/delete-requests - - https://docs.apify.com/api/v2#/reference/request-queues/delete-requests - - https://docs.apify.com/api/v2#tag/Request-queuesBatch-request-operations/operation/requestQueue_requests_batch_delete - x-js-parent: RequestQueueClient - x-js-name: batchDeleteRequests - x-js-doc-url: https://docs.apify.com/api/client/js/reference/class/RequestQueueClient#batchDeleteRequests - x-py-parent: RequestQueueClientAsync - x-py-name: batch_delete_requests - x-py-doc-url: https://docs.apify.com/api/client/python/reference/class/RequestQueueClientAsync#batch_delete_requests - post: - deprecated: false - description: | - Adds requests to the queue in batch. The maximum requests in batch is limited - to 25. The response contains an array of unprocessed and processed requests. - If any add operation fails because the request queue rate limit is exceeded - or an internal failure occurs, - the failed request is returned in the unprocessedRequests response - parameter. - You can resend these requests to add. It is recommended to use an - exponential backoff algorithm for these retries. - If a request with the same `uniqueKey` was already present in the queue, - then it returns an ID of the existing request. - operationId: requestQueue_requests_batch_post - parameters: - - $ref: "#/components/parameters/queueId" - - $ref: "#/components/parameters/clientKey" - - $ref: "#/components/parameters/forefront" - requestBody: - content: - application/json: - schema: - description: "" - items: - $ref: "#/components/schemas/RequestBase" - type: array - default: null - description: "" - required: true - responses: - "201": - content: - application/json: - schema: - $ref: "#/components/schemas/BatchAddResponse" - description: "" - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "413": - $ref: "#/components/responses/PayloadTooLarge" - "415": - $ref: "#/components/responses/UnsupportedMediaType" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Add requests - tags: - - Storage/Request queues - x-legacy-doc-urls: - - https://docs.apify.com/api/v2#/reference/request-queues/batch-request-operations/add-requests - - https://docs.apify.com/api/v2#/reference/request-queues/add-requests - - https://docs.apify.com/api/v2#tag/Request-queuesBatch-request-operations/operation/requestQueue_requests_batch_post - x-js-parent: RequestQueueClient - x-js-name: batchAddRequests - x-js-doc-url: https://docs.apify.com/api/client/js/reference/class/RequestQueueClient#batchAddRequests - x-py-parent: RequestQueueClientAsync - x-py-name: batch_add_requests - x-py-doc-url: https://docs.apify.com/api/client/python/reference/class/RequestQueueClientAsync#batch_add_requests - /v2/request-queues/{queueId}/requests/unlock: - post: - deprecated: false - description: | - Unlocks requests in the queue that are currently locked by the client. - - * If the client is within an Actor run, it unlocks all requests locked by that specific run plus all requests locked by the same clientKey. - * If the client is outside of an Actor run, it unlocks all requests locked using the same clientKey. - operationId: requestQueue_requests_unlock_post - parameters: - - $ref: "#/components/parameters/queueId" - - $ref: "#/components/parameters/clientKey" - responses: - "200": - content: - application/json: - schema: - $ref: "#/components/schemas/UnlockRequestsResponse" - description: Number of requests that were unlocked - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Unlock requests - tags: - - Storage/Request queues/Requests locks - x-js-parent: RequestQueueClient - x-js-name: unlockRequests - x-js-doc-url: https://docs.apify.com/api/client/js/reference/class/RequestQueueClient#unlockRequests - x-py-parent: RequestQueueClientAsync - x-py-name: unlock_requests - x-py-doc-url: https://docs.apify.com/api/client/python/reference/class/RequestQueueClientAsync#unlock_requests - /v2/request-queues/{queueId}/requests: - get: - deprecated: false - description: | - Returns a list of requests. This endpoint is paginated using - cursor (pagination by `exclusiveStartId` is deprecated) and limit parameters. - operationId: requestQueue_requests_get - parameters: - - $ref: "#/components/parameters/queueId" - - $ref: "#/components/parameters/clientKey" - - $ref: "#/components/parameters/exclusiveStartId" - - $ref: "#/components/parameters/listLimit" - - $ref: "#/components/parameters/cursor" - - $ref: "#/components/parameters/filter" - responses: - "200": - content: - application/json: - schema: - $ref: "#/components/schemas/ListOfRequestsResponse" - description: "" - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: List requests - tags: - - Storage/Request queues/Requests - x-legacy-doc-urls: - - https://docs.apify.com/api/v2#/reference/request-queues/request-collection/list-requests - - https://docs.apify.com/api/v2#/reference/request-queues/list-requests - - https://docs.apify.com/api/v2#tag/Request-queuesRequest-collection/operation/requestQueue_requests_get - x-js-parent: RequestQueueClient - x-js-name: paginateRequests - x-js-doc-url: https://docs.apify.com/api/client/js/reference/class/RequestQueueClient#paginateRequests - x-py-parent: RequestQueueClientAsync - x-py-name: list_requests - x-py-doc-url: https://docs.apify.com/api/client/python/reference/class/RequestQueueClientAsync#list_requests - post: - deprecated: false - description: | - Adds request to the queue. Response contains ID of the request and info if - request was already present in the queue or handled. - - If request with same `uniqueKey` was already present in the queue then - returns an ID of existing request. - operationId: requestQueue_requests_post - parameters: - - $ref: "#/components/parameters/queueId" - - $ref: "#/components/parameters/clientKey" - - $ref: "#/components/parameters/forefront" - requestBody: - content: - application/json: - schema: - $ref: "#/components/schemas/RequestBase" - description: "" - required: true - responses: - "201": - content: - application/json: - schema: - $ref: "#/components/schemas/AddRequestResponse" - description: "" - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "413": - $ref: "#/components/responses/PayloadTooLarge" - "415": - $ref: "#/components/responses/UnsupportedMediaType" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Add request - tags: - - Storage/Request queues/Requests - x-legacy-doc-urls: - - https://docs.apify.com/api/v2#/reference/request-queues/request-collection/add-request - - https://docs.apify.com/api/v2#/reference/request-queues/add-request - - https://docs.apify.com/api/v2#tag/Request-queuesRequest-collection/operation/requestQueue_requests_post - x-js-parent: RequestQueueClient - x-js-name: addRequest - x-js-doc-url: https://docs.apify.com/api/client/js/reference/class/RequestQueueClient#addRequest - x-py-parent: RequestQueueClientAsync - x-py-name: add_request - x-py-doc-url: https://docs.apify.com/api/client/python/reference/class/RequestQueueClientAsync#add_request - /v2/request-queues/{queueId}/requests/{requestId}: - delete: - deprecated: false - description: Deletes given request from queue. - operationId: requestQueue_request_delete - parameters: - - $ref: "#/components/parameters/queueId" - - $ref: "#/components/parameters/requestId" - - $ref: "#/components/parameters/clientKey" - responses: - "204": - $ref: "#/components/responses/NoContent" - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Delete request - tags: - - Storage/Request queues/Requests - x-legacy-doc-urls: - - https://docs.apify.com/api/v2#/reference/request-queues/queue/delete-request - - https://docs.apify.com/api/v2#/reference/request-queues/delete-request - - https://docs.apify.com/api/v2#tag/Request-queuesQueue/operation/requestQueue_request_delete - x-js-parent: RequestQueueClient - x-js-name: delete - x-js-doc-url: https://docs.apify.com/api/client/js/reference/class/RequestQueueClient#delete - get: - deprecated: false - description: Returns request from queue. - operationId: requestQueue_request_get - parameters: - - $ref: "#/components/parameters/queueId" - - $ref: "#/components/parameters/requestId" - responses: - "200": - content: - application/json: - schema: - $ref: "#/components/schemas/RequestResponse" - description: "" - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Get request - tags: - - Storage/Request queues/Requests - x-legacy-doc-urls: - - https://docs.apify.com/api/v2#/reference/request-queues/queue/get-request - - https://docs.apify.com/api/v2#/reference/request-queues/get-request - - https://docs.apify.com/api/v2#tag/Request-queuesQueue/operation/requestQueue_request_get - x-js-parent: RequestQueueClient - x-js-name: get - x-js-doc-url: https://docs.apify.com/api/client/js/reference/class/RequestQueueClient#get - x-py-parent: RequestQueueClientAsync - x-py-name: get - x-py-doc-url: https://docs.apify.com/api/client/python/reference/class/RequestQueueClientAsync#get - put: - deprecated: false - description: | - Updates a request in a queue. Mark request as handled by setting - `request.handledAt = new Date()`. - If `handledAt` is set, the request will be removed from head of the queue (and unlocked, if applicable). - operationId: requestQueue_request_put - parameters: - - $ref: "#/components/parameters/queueId" - - $ref: "#/components/parameters/requestId" - - $ref: "#/components/parameters/forefront" - - $ref: "#/components/parameters/clientKey" - requestBody: - content: - application/json: - schema: - $ref: "#/components/schemas/Request" - description: "" - required: true - responses: - "200": - content: - application/json: - schema: - $ref: "#/components/schemas/UpdateRequestResponse" - description: "" - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "413": - $ref: "#/components/responses/PayloadTooLarge" - "415": - $ref: "#/components/responses/UnsupportedMediaType" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Update request - tags: - - Storage/Request queues/Requests - x-legacy-doc-urls: - - https://docs.apify.com/api/v2#/reference/request-queues/queue/update-request - - https://docs.apify.com/api/v2#/reference/request-queues/update-request - - https://docs.apify.com/api/v2#tag/Request-queuesQueue/operation/requestQueue_request_put - x-js-parent: RequestQueueClient - x-js-name: update - x-js-doc-url: https://docs.apify.com/api/client/js/reference/class/RequestQueueClient#update - x-py-parent: RequestQueueClientAsync - x-py-name: update - x-py-doc-url: https://docs.apify.com/api/client/python/reference/class/RequestQueueClientAsync#update - /v2/request-queues/{queueId}/head: - get: - deprecated: false - description: | - Returns given number of first requests from the queue. - - The response contains the `hadMultipleClients` boolean field which indicates - that the queue was accessed by more than one client (with unique or empty - `clientKey`). - This field is used by [Apify SDK](https://sdk.apify.com) to determine - whether the local cache is consistent with the request queue, and thus - optimize performance of certain operations. - operationId: requestQueue_head_get - parameters: - - $ref: "#/components/parameters/queueId" - - $ref: "#/components/parameters/headLimit" - - $ref: "#/components/parameters/clientKey" - responses: - "200": - content: - application/json: - schema: - $ref: "#/components/schemas/HeadResponse" - description: "" - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Get head - tags: - - Storage/Request queues/Requests locks - x-legacy-doc-urls: - - https://docs.apify.com/api/v2#/reference/request-queues/queue-head/get-head - - https://docs.apify.com/api/v2#/reference/request-queues/get-head - - https://docs.apify.com/api/v2#tag/Request-queuesQueue-head/operation/requestQueue_head_get - x-js-parent: RequestQueueClient - x-js-name: listHead - x-js-doc-url: https://docs.apify.com/api/client/js/reference/class/RequestQueueClient#listHead - x-py-parent: RequestQueueClientAsync - x-py-name: list_head - x-py-doc-url: https://docs.apify.com/api/client/python/reference/class/RequestQueueClientAsync#list_head - /v2/request-queues/{queueId}/head/lock: - post: - deprecated: false - description: | - Returns the given number of first requests from the queue and locks them for - the given time. - - If this endpoint locks the request, no other client or run will be able to get and - lock these requests. - - The response contains the `hadMultipleClients` boolean field which indicates - that the queue was accessed by more than one client (with unique or empty - `clientKey`). - operationId: requestQueue_head_lock_post - parameters: - - $ref: "#/components/parameters/queueId" - - $ref: "#/components/parameters/lockSecs" - - $ref: "#/components/parameters/headLockLimit" - - $ref: "#/components/parameters/clientKey" - responses: - "201": - content: - application/json: - schema: - $ref: "#/components/schemas/HeadAndLockResponse" - description: "" - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Get head and lock - tags: - - Storage/Request queues/Requests locks - x-legacy-doc-urls: - - https://docs.apify.com/api/v2#/reference/request-queues/queue-head-with-locks/get-head-and-lock - - https://docs.apify.com/api/v2#/reference/request-queues/get-head-and-lock - - https://docs.apify.com/api/v2#tag/Request-queuesQueue-head-with-locks/operation/requestQueue_head_lock_post - x-js-parent: RequestQueueClient - x-js-name: listAndLockHead - x-js-doc-url: https://docs.apify.com/api/client/js/reference/class/RequestQueueClient#listAndLockHead - x-py-parent: RequestQueueClientAsync - x-py-name: list_and_lock_head - x-py-doc-url: https://docs.apify.com/api/client/python/reference/class/RequestQueueClientAsync#list_and_lock_head - /v2/request-queues/{queueId}/requests/{requestId}/lock: - delete: - deprecated: false - description: | - Deletes a request lock. The request lock can be deleted only by the client - that has locked it using [Get and lock head - operation](#/request-queue-head-lock-post). - - The clientKey identifier is used for locking and unlocking requests. - You can delete or prolong the lock only for requests that were locked by the same client key or from the same Actor run. - operationId: requestQueue_request_lock_delete - parameters: - - $ref: "#/components/parameters/queueId" - - $ref: "#/components/parameters/requestId" - - $ref: "#/components/parameters/clientKey" - - $ref: "#/components/parameters/deleteForefront" - responses: - "204": - $ref: "#/components/responses/NoContent" - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Delete request lock - tags: - - Storage/Request queues/Requests locks - x-legacy-doc-urls: - - https://docs.apify.com/api/v2#/reference/request-queues/request-lock/delete-request-lock - - https://docs.apify.com/api/v2#/reference/request-queues/delete-request-lock - - https://docs.apify.com/api/v2#tag/Request-queuesRequest-lock/operation/requestQueue_request_lock_delete - x-js-parent: RequestQueueClient - x-js-name: deleteRequestLock - x-js-doc-url: https://docs.apify.com/api/client/js/reference/class/RequestQueueClient#deleteRequestLock - x-py-parent: RequestQueueClientAsync - x-py-name: delete_request_lock - x-py-doc-url: https://docs.apify.com/api/client/python/reference/class/RequestQueueClientAsync#delete_request_lock - put: - deprecated: false - description: | - Prolongs request lock. The request lock can be prolonged only by the client - that has locked it using [Get and lock head - operation](#/request-queue-head-lock-post). - - The clientKey identifier is used for locking and unlocking requests. - You can delete or prolong the lock only for requests that were locked by the same client key or from the same Actor run. - operationId: requestQueue_request_lock_put - parameters: - - $ref: "#/components/parameters/queueId" - - $ref: "#/components/parameters/requestId" - - $ref: "#/components/parameters/lockSecs" - - $ref: "#/components/parameters/clientKey" - - $ref: "#/components/parameters/lockForefront" - responses: - "200": - content: - application/json: - schema: - $ref: "#/components/schemas/ProlongRequestLockResponse" - description: "" - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Prolong request lock - tags: - - Storage/Request queues/Requests locks - x-legacy-doc-urls: - - https://docs.apify.com/api/v2#/reference/request-queues/request-lock/prolong-request-lock - - https://docs.apify.com/api/v2#/reference/request-queues/prolong-request-lock - - https://docs.apify.com/api/v2#tag/Request-queuesRequest-lock/operation/requestQueue_request_lock_put - x-js-parent: RequestQueueClient - x-js-name: prolongRequestLock - x-js-doc-url: https://docs.apify.com/api/client/js/reference/class/RequestQueueClient#prolongRequestLock - x-py-parent: RequestQueueClientAsync - x-py-name: prolong_request_lock - x-py-doc-url: https://docs.apify.com/api/client/python/reference/class/RequestQueueClientAsync#prolong_request_lock - /v2/webhooks: - get: - deprecated: false - description: | - Gets the list of webhooks that the user created. - - The endpoint supports pagination using the `limit` and `offset` parameters - and it will not return more than 1000 records. - By default, the records are sorted by the `createdAt` field in ascending - order. To sort the records in descending order, use the `desc=1` - parameter. - operationId: webhooks_get - parameters: - - $ref: "#/components/parameters/offset" - - $ref: "#/components/parameters/limit" - - $ref: "#/components/parameters/descCreatedAt" - responses: - "200": - content: - application/json: - schema: - $ref: "#/components/schemas/ListOfWebhooksResponse" - description: "" - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Get list of webhooks - tags: - - Webhooks/Webhooks - x-legacy-doc-urls: - - https://docs.apify.com/api/v2#/reference/webhooks/webhook-collection/get-list-of-webhooks - - https://docs.apify.com/api/v2#/reference/webhooks/get-list-of-webhooks - - https://docs.apify.com/api/v2#tag/WebhooksWebhook-collection/operation/webhooks_get - x-js-parent: WebhookCollectionClient - x-js-name: list - x-js-doc-url: https://docs.apify.com/api/client/js/reference/class/WebhookCollectionClient#list - x-py-parent: WebhookCollectionClientAsync - x-py-name: list - x-py-doc-url: https://docs.apify.com/api/client/python/reference/class/WebhookCollectionClientAsync#list - post: - deprecated: false - description: | - Creates a new webhook with settings provided by the webhook object passed as - JSON in the payload. - The response is the created webhook object. - - To avoid duplicating a webhook, use the `idempotencyKey` parameter in the - request body. - Multiple calls to create a webhook with the same `idempotencyKey` will only - create the webhook with the first call and return the existing webhook on - subsequent calls. - Idempotency keys must be unique, so use a UUID or another random string with - enough entropy. - - To assign the new webhook to an Actor or task, the request body must contain - `requestUrl`, `eventTypes`, and `condition` properties. - - * `requestUrl` is the webhook's target URL, to which data is sent as a POST - request with a JSON payload. - * `eventTypes` is a list of events that will trigger the webhook, e.g. when - the Actor run succeeds. - * `condition` should be an object containing the ID of the Actor or task to - which the webhook will be assigned. - * `payloadTemplate` is a JSON-like string, whose syntax is extended with the - use of variables. - * `headersTemplate` is a JSON-like string, whose syntax is extended with the - use of variables. Following values will be re-written to defaults: "host", - "Content-Type", "X-Apify-Webhook", "X-Apify-Webhook-Dispatch-Id", - "X-Apify-Request-Origin" - * `description` is an optional string. - * `shouldInterpolateStrings` is a boolean indicating whether to interpolate - variables contained inside strings in the `payloadTemplate` - - ``` - "isAdHoc" : false, - "requestUrl" : "https://example.com", - "eventTypes" : [ - "ACTOR.RUN.SUCCEEDED", - "ACTOR.RUN.ABORTED" - ], - "condition" : { - "actorId": "5sTMwDQywwsLzKRRh", - "actorTaskId" : "W9bs9JE9v7wprjAnJ" - }, - "payloadTemplate": "", - "headersTemplate": "", - "description": "my awesome webhook", - "shouldInterpolateStrings": false, - ``` - - **Important**: The request must specify the `Content-Type: application/json` - HTTP header. - operationId: webhooks_post - requestBody: - content: - application/json: - schema: - $ref: "#/components/schemas/WebhookCreate" - description: "" - required: true - responses: - "201": - content: - application/json: - schema: - $ref: "#/components/schemas/WebhookResponse" - description: "" - headers: - Location: - content: - text/plain: - example: https://api.apify.com/v2/webhook/zdc3Pyhyz3m8vjDeM - schema: - type: string - explode: false - style: simple - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "413": - $ref: "#/components/responses/PayloadTooLarge" - "415": - $ref: "#/components/responses/UnsupportedMediaType" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Create webhook - tags: - - Webhooks/Webhooks - x-legacy-doc-urls: - - https://docs.apify.com/api/v2#/reference/webhooks/webhook-collection/create-webhook - - https://docs.apify.com/api/v2#/reference/webhooks/create-webhook - - https://docs.apify.com/api/v2#tag/WebhooksWebhook-collection/operation/webhooks_post - x-js-parent: WebhookCollectionClient - x-js-name: create - x-js-doc-url: https://docs.apify.com/api/client/js/reference/class/WebhookCollectionClient#create - x-py-parent: WebhookCollectionClientAsync - x-py-name: create - x-py-doc-url: https://docs.apify.com/api/client/python/reference/class/WebhookCollectionClientAsync#create - /v2/webhooks/{webhookId}: - delete: - deprecated: false - description: Deletes a webhook. - operationId: webhook_delete - parameters: - - $ref: "#/components/parameters/webhookId" - responses: - "204": - content: - application/json: - example: {} - schema: - type: object - description: "" - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Delete webhook - tags: - - Webhooks/Webhooks - x-legacy-doc-urls: - - https://docs.apify.com/api/v2#/reference/webhooks/webhook-object/delete-webhook - - https://docs.apify.com/api/v2#/reference/webhooks/delete-webhook - - https://docs.apify.com/api/v2#tag/WebhooksWebhook-object/operation/webhook_delete - x-js-parent: WebhookClient - x-js-name: delete - x-js-doc-url: https://docs.apify.com/api/client/js/reference/class/WebhookClient#delete - get: - deprecated: false - description: Gets webhook object with all details. - operationId: webhook_get - parameters: - - $ref: "#/components/parameters/webhookId" - responses: - "200": - content: - application/json: - schema: - $ref: "#/components/schemas/WebhookResponse" - description: "" - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Get webhook - tags: - - Webhooks/Webhooks - x-legacy-doc-urls: - - https://docs.apify.com/api/v2#/reference/webhooks/webhook-object/get-webhook - - https://docs.apify.com/api/v2#/reference/webhooks/get-webhook - - https://docs.apify.com/api/v2#tag/WebhooksWebhook-object/operation/webhook_get - x-js-parent: WebhookClient - x-js-name: get - x-js-doc-url: https://docs.apify.com/api/client/js/reference/class/WebhookClient#get - x-py-parent: WebhookClientAsync - x-py-name: get - x-py-doc-url: https://docs.apify.com/api/client/python/reference/class/WebhookClientAsync#get - put: - deprecated: false - description: | - Updates a webhook using values specified by a webhook object passed as JSON - in the POST payload. - If the object does not define a specific property, its value will not be - updated. - - The response is the full webhook object as returned by the - [Get webhook](#/reference/webhooks/webhook-object/get-webhook) endpoint. - - The request needs to specify the `Content-Type: application/json` HTTP - header! - - When providing your API authentication token, we recommend using the - request's `Authorization` header, rather than the URL. ([More - info](#/introduction/authentication)). - operationId: webhook_put - parameters: - - $ref: "#/components/parameters/webhookId" - requestBody: - content: - application/json: - schema: - $ref: "#/components/schemas/WebhookUpdate" - description: "" - required: true - responses: - "200": - content: - application/json: - schema: - $ref: "#/components/schemas/WebhookResponse" - description: "" - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "413": - $ref: "#/components/responses/PayloadTooLarge" - "415": - $ref: "#/components/responses/UnsupportedMediaType" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Update webhook - tags: - - Webhooks/Webhooks - x-legacy-doc-urls: - - https://docs.apify.com/api/v2#/reference/webhooks/webhook-object/update-webhook - - https://docs.apify.com/api/v2#/reference/webhooks/update-webhook - - https://docs.apify.com/api/v2#tag/WebhooksWebhook-object/operation/webhook_put - x-js-parent: WebhookClient - x-js-name: update - x-js-doc-url: https://docs.apify.com/api/client/js/reference/class/WebhookClient#update - x-py-parent: WebhookClientAsync - x-py-name: update - x-py-doc-url: https://docs.apify.com/api/client/python/reference/class/WebhookClientAsync#update - /v2/webhooks/{webhookId}/test: - post: - deprecated: false - description: Tests a webhook. Creates a webhook dispatch with a dummy payload. - operationId: webhook_test_post - parameters: - - $ref: "#/components/parameters/webhookId" - responses: - "201": - content: - application/json: - schema: - $ref: "#/components/schemas/TestWebhookResponse" - description: "" - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Test webhook - tags: - - Webhooks/Webhooks - x-legacy-doc-urls: - - https://docs.apify.com/api/v2#/reference/webhooks/webhook-test/test-webhook - - https://docs.apify.com/api/v2#/reference/webhooks/test-webhook - - https://docs.apify.com/api/v2#tag/WebhooksWebhook-test/operation/webhook_test_post - x-js-parent: WebhookClient - x-js-name: test - x-js-doc-url: https://docs.apify.com/api/client/js/reference/class/WebhookClient#test - x-py-parent: WebhookClientAsync - x-py-name: test - x-py-doc-url: https://docs.apify.com/api/client/python/reference/class/WebhookClientAsync#test - /v2/webhooks/{webhookId}/dispatches: - get: - deprecated: false - description: Gets a given webhook's list of dispatches. - operationId: webhook_webhookDispatches_get - parameters: - - $ref: "#/components/parameters/webhookId" - responses: - "200": - content: - application/json: - schema: - $ref: "#/components/schemas/ListOfWebhookDispatchesResponse" - description: "" - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Get collection - tags: - - Webhooks/Webhooks - x-legacy-doc-urls: - - https://docs.apify.com/api/v2#/reference/webhooks/dispatches-collection/get-collection - - https://docs.apify.com/api/v2#/reference/webhooks/get-collection - - https://docs.apify.com/api/v2#tag/WebhooksDispatches-collection/operation/webhook_dispatches_get - x-py-parent: WebhookClientAsync - x-py-name: dispatches - x-py-doc-url: https://docs.apify.com/api/client/python/reference/class/WebhookClientAsync#dispatches - /v2/webhook-dispatches: - get: - deprecated: false - description: | - Gets the list of webhook dispatches that the user have. - - The endpoint supports pagination using the `limit` and `offset` parameters - and it will not return more than 1000 records. - By default, the records are sorted by the `createdAt` field in ascending - order. To sort the records in descending order, use the `desc=1` - parameter. - operationId: webhookDispatches_get - parameters: - - $ref: "#/components/parameters/offset" - - $ref: "#/components/parameters/limit" - - $ref: "#/components/parameters/descCreatedAt" - responses: - "200": - content: - application/json: - schema: - $ref: "#/components/schemas/ListOfWebhookDispatchesResponse" - description: "" - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Get list of webhook dispatches - tags: - - Webhooks/Webhook dispatches - x-legacy-doc-urls: - - https://docs.apify.com/api/v2#/reference/webhook-dispatches/webhook-dispatches-collection/get-list-of-webhook-dispatches - - https://docs.apify.com/api/v2#/reference/webhook-dispatches/get-list-of-webhook-dispatches - - https://docs.apify.com/api/v2#tag/Webhook-dispatchesWebhook-dispatches-collection/operation/webhookDispatches_get - x-js-parent: WebhookDispatchCollectionClient - x-js-name: list - x-js-doc-url: https://docs.apify.com/api/client/js/reference/class/WebhookDispatchCollectionClient#list - x-py-parent: WebhookDispatchCollectionClientAsync - x-py-name: list - x-py-doc-url: https://docs.apify.com/api/client/python/reference/class/WebhookDispatchCollectionClientAsync#list - /v2/webhook-dispatches/{dispatchId}: - get: - deprecated: false - description: Gets webhook dispatch object with all details. - operationId: webhookDispatch_get - parameters: - - description: Webhook dispatch ID. - explode: false - in: path - name: dispatchId - required: true - schema: - example: Zib4xbZsmvZeK55ua - type: string - style: simple - responses: - "200": - content: - application/json: - schema: - $ref: "#/components/schemas/WebhookDispatchResponse" - description: "" - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Get webhook dispatch - tags: - - Webhooks/Webhook dispatches - x-legacy-doc-urls: - - https://docs.apify.com/api/v2#/reference/webhook-dispatches/webhook-dispatch-object/get-webhook-dispatch - - https://docs.apify.com/api/v2#/reference/webhook-dispatches/get-webhook-dispatch - - https://docs.apify.com/api/v2#tag/Webhook-dispatchesWebhook-dispatch-object/operation/webhookDispatch_get - x-js-parent: WebhookDispatchClient - x-js-name: get - x-js-doc-url: https://docs.apify.com/api/client/js/reference/class/WebhookDispatchClient#get - x-py-parent: WebhookDispatchClientAsync - x-py-name: get - x-py-doc-url: https://docs.apify.com/api/client/python/reference/class/WebhookDispatchClientAsync#get - /v2/schedules: - get: - deprecated: false - description: | - Gets the list of schedules that the user created. - - The endpoint supports pagination using the `limit` and `offset` parameters. - It will not return more than 1000 records. - - By default, the records are sorted by the `createdAt` field in ascending - order. To sort the records in descending order, use the `desc=1` parameter. - operationId: schedules_get - parameters: - - $ref: "#/components/parameters/offset" - - $ref: "#/components/parameters/limit" - - $ref: "#/components/parameters/descCreatedAt" - responses: - "200": - content: - application/json: - schema: - $ref: "#/components/schemas/ListOfSchedulesResponse" - description: "" - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Get list of schedules - tags: - - Schedules - x-legacy-doc-urls: - - https://docs.apify.com/api/v2#/reference/schedules/schedules-collection/get-list-of-schedules - - https://docs.apify.com/api/v2#/reference/schedules/get-list-of-schedules - - https://docs.apify.com/api/v2#tag/SchedulesSchedules-collection/operation/schedules_get - x-js-parent: ScheduleCollectionClient - x-js-name: list - x-js-doc-url: https://docs.apify.com/api/client/js/reference/class/ScheduleCollectionClient#list - x-py-parent: ScheduleCollectionClientAsync - x-py-name: list - x-py-doc-url: https://docs.apify.com/api/client/python/reference/class/ScheduleCollectionClientAsync#list - post: - deprecated: false - description: | - Creates a new schedule with settings provided by the schedule object passed - as JSON in the payload. The response is the created schedule object. - - The request needs to specify the `Content-Type: application/json` HTTP header! - - When providing your API authentication token, we recommend using the - request's `Authorization` header, rather than the URL. ([More - info](#/introduction/authentication)). - operationId: schedules_post - requestBody: - content: - application/json: - schema: - $ref: "#/components/schemas/ScheduleCreate" - description: "" - required: true - responses: - "201": - content: - application/json: - schema: - $ref: "#/components/schemas/ScheduleResponse" - description: "" - headers: - Location: - content: - text/plain: - example: https://api.apify.com/v2/schedules/asdLZtadYvn4mBZmm - schema: - type: string - explode: false - style: simple - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "409": - $ref: "#/components/responses/Conflict" - "413": - $ref: "#/components/responses/PayloadTooLarge" - "415": - $ref: "#/components/responses/UnsupportedMediaType" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Create schedule - tags: - - Schedules - x-legacy-doc-urls: - - https://docs.apify.com/api/v2#/reference/schedules/schedules-collection/create-schedule - - https://docs.apify.com/api/v2#/reference/schedules/create-schedule - - https://docs.apify.com/api/v2#tag/SchedulesSchedules-collection/operation/schedules_post - x-js-parent: ScheduleCollectionClient - x-js-name: create - x-js-doc-url: https://docs.apify.com/api/client/js/reference/class/ScheduleCollectionClient#create - x-py-parent: ScheduleCollectionClientAsync - x-py-name: create - x-py-doc-url: https://docs.apify.com/api/client/python/reference/class/ScheduleCollectionClientAsync#create - /v2/schedules/{scheduleId}: - delete: - deprecated: false - description: Deletes a schedule. - operationId: schedule_delete - parameters: - - $ref: "#/components/parameters/scheduleId" - responses: - "204": - content: - application/json: - example: {} - schema: - example: {} - type: object - description: "" - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Delete schedule - tags: - - Schedules - x-legacy-doc-urls: - - https://docs.apify.com/api/v2#/reference/schedules/schedule-object/delete-schedule - - https://docs.apify.com/api/v2#/reference/schedules/delete-schedule - - https://docs.apify.com/api/v2#tag/SchedulesSchedule-object/operation/schedule_delete - x-js-parent: ScheduleClient - x-js-name: delete - x-js-doc-url: https://docs.apify.com/api/client/js/reference/class/ScheduleClient#delete - get: - deprecated: false - description: Gets the schedule object with all details. - operationId: schedule_get - parameters: - - $ref: "#/components/parameters/scheduleId" - responses: - "200": - content: - application/json: - schema: - $ref: "#/components/schemas/ScheduleResponse" - description: "" - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Get schedule - tags: - - Schedules - x-legacy-doc-urls: - - https://docs.apify.com/api/v2#/reference/schedules/schedule-object/get-schedule - - https://docs.apify.com/api/v2#/reference/schedules/get-schedule - - https://docs.apify.com/api/v2#tag/SchedulesSchedule-object/operation/schedule_get - x-js-parent: ScheduleClient - x-js-name: get - x-js-doc-url: https://docs.apify.com/api/client/js/reference/class/ScheduleClient#get - x-py-parent: ScheduleClientAsync - x-py-name: get - x-py-doc-url: https://docs.apify.com/api/client/python/reference/class/ScheduleClientAsync#get - put: - deprecated: false - description: | - Updates a schedule using values specified by a schedule object passed as - JSON in the POST payload. If the object does not define a specific property, - its value will not be updated. - - The response is the full schedule object as returned by the - [Get schedule](#/reference/schedules/schedule-object/get-schedule) endpoint. - - **The request needs to specify the `Content-Type: application/json` HTTP - header!** - - When providing your API authentication token, we recommend using the - request's `Authorization` header, rather than the URL. ([More - info](#/introduction/authentication)). - operationId: schedule_put - parameters: - - $ref: "#/components/parameters/scheduleId" - requestBody: - content: - application/json: - schema: - $ref: "#/components/schemas/ScheduleCreate" - description: "" - required: true - responses: - "200": - content: - application/json: - schema: - $ref: "#/components/schemas/ScheduleResponse" - description: "" - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "413": - $ref: "#/components/responses/PayloadTooLarge" - "415": - $ref: "#/components/responses/UnsupportedMediaType" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Update schedule - tags: - - Schedules - x-legacy-doc-urls: - - https://docs.apify.com/api/v2#/reference/schedules/schedule-object/update-schedule - - https://docs.apify.com/api/v2#/reference/schedules/update-schedule - - https://docs.apify.com/api/v2#tag/SchedulesSchedule-object/operation/schedule_put - x-js-parent: ScheduleClient - x-js-name: update - x-js-doc-url: https://docs.apify.com/api/client/js/reference/class/ScheduleClient#update - x-py-parent: ScheduleClientAsync - x-py-name: update - x-py-doc-url: https://docs.apify.com/api/client/python/reference/class/ScheduleClientAsync#update - /v2/schedules/{scheduleId}/log: - get: - deprecated: false - description: | - Gets the schedule log as a JSON array containing information about up to a - 1000 invocations of the schedule. - operationId: schedule_log_get - parameters: - - $ref: "#/components/parameters/scheduleId" - responses: - "200": - content: - application/json: - example: - data: - - message: Schedule invoked - level: INFO - createdAt: 2019-03-26T12:28:00.370Z - - message: "Cannot start Actor task \\\"iEvfA6pm6DWjRTGxS\\\": Provided\ - \ input must be object, got \\\"string\\\" instead." - level: ERROR - createdAt: 2019-03-26T12:30:00.325Z - schema: - $ref: "#/components/schemas/ScheduleLogResponse" - description: "" - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Get schedule log - tags: - - Schedules - x-legacy-doc-urls: - - https://docs.apify.com/api/v2#/reference/schedules/schedule-log/get-schedule-log - - https://docs.apify.com/api/v2#/reference/schedules/get-schedule-log - - https://docs.apify.com/api/v2#tag/SchedulesSchedule-log/operation/schedule_log_get - x-js-parent: ScheduleClient - x-js-name: getLog - x-js-doc-url: https://docs.apify.com/api/client/js/reference/class/ScheduleClient#getLog - x-py-parent: ScheduleClientAsync - x-py-name: get_log - x-py-doc-url: https://docs.apify.com/api/client/python/reference/class/ScheduleClientAsync#get_log - /v2/store: - get: - deprecated: false - description: | - Gets the list of public Actors in Apify Store. You can use `search` - parameter to search Actors by string in title, name, description, username - and readme. - If you need detailed info about a specific Actor, use the [Get - Actor](#/reference/actors/actor-object/get-actor) endpoint. - - The endpoint supports pagination using the `limit` and `offset` parameters. - It will not return more than 1,000 records. - operationId: store_get - parameters: - - $ref: "#/components/parameters/limit" - - $ref: "#/components/parameters/offset" - - description: | - String to search by. The search runs on the following fields: `title`, - `name`, `description`, `username`, `readme`. - explode: true - in: query - name: search - required: false - schema: - example: web scraper - type: string - style: form - - description: | - Specifies the field by which to sort the results. The supported values - are `relevance` (default), `popularity`, `newest` and `lastUpdate`. - explode: true - in: query - name: sortBy - required: false - schema: - example: '''popularity''' - type: string - style: form - - description: Filters the results by the specified category. - explode: true - in: query - name: category - required: false - schema: - example: '''AI''' - type: string - style: form - - description: Filters the results by the specified username. - explode: true - in: query - name: username - required: false - schema: - example: '''apify''' - type: string - style: form - - description: | - Only return Actors with the specified pricing model. - explode: true - in: query - name: pricingModel - required: false - schema: - enum: - - FREE - - FLAT_PRICE_PER_MONTH - - PRICE_PER_DATASET_ITEM - - PAY_PER_EVENT - example: FREE - type: string - style: form - - description: | - If true, only return Actors that allow agentic users. If false, only - return Actors that do not allow agentic users. - explode: true - in: query - name: allowsAgenticUsers - required: false - schema: - example: true - type: boolean - style: form - - description: | - Controls the shape of the response. Use `full` (default) for the - complete response including image URLs and all fields. Use `agent` - for a reduced field set optimized for LLM consumers, which only - includes `id`, `title`, `name`, `username`, `description`, `notice`, - `badge`, `categories`, and minimal `stats`. - explode: true - in: query - name: responseFormat - required: false - schema: - default: full - enum: - - full - - agent - example: agent - type: string - style: form - - description: | - By default, search results exclude Actors that are not safe to run - automatically (e.g. Actors from developers who haven't passed KYC, or - full-permission Actors without a large user base). Set to `true` to - bypass this safety filtering and include all Actors in the results. - explode: true - in: query - name: includeUnrunnableActors - required: false - schema: - default: false - example: true - type: boolean - style: form - responses: - "200": - content: - application/json: - schema: - $ref: "#/components/schemas/ListOfActorsInStoreResponse" - description: "" - "400": - $ref: "#/components/responses/BadRequest" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Get list of Actors in Store - tags: - - Store - x-legacy-doc-urls: - - https://docs.apify.com/api/v2#/reference/store/store-actors-collection/get-list-of-actors-in-store - - https://docs.apify.com/api/v2#/reference/store/get-list-of-actors-in-store - - https://docs.apify.com/api/v2#tag/StoreStore-Actors-collection/operation/store_get - /v2/logs/{buildOrRunId}: - get: - deprecated: false - description: | - Retrieves logs for a specific Actor build or run. - operationId: log_get - parameters: - - $ref: "#/components/parameters/buildOrRunId" - - $ref: "#/components/parameters/stream" - - $ref: "#/components/parameters/download" - - $ref: "#/components/parameters/raw" - responses: - "200": - content: - text/plain: - schema: - example: | - 2017-07-14T06:00:49.733Z Application started. - 2017-07-14T06:00:49.741Z Input: { test: 123 } - 2017-07-14T06:00:49.752Z Some useful debug information follows. - type: string - description: "" - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "429": - $ref: "#/components/responses/TooManyRequests" - security: - - httpBearer: [] - - apiKey: [] - - {} - summary: Get log - tags: - - Logs - x-legacy-doc-urls: - - https://docs.apify.com/api/v2#/reference/logs/log/get-log - - https://docs.apify.com/api/v2#/reference/logs/get-log - - https://docs.apify.com/api/v2#tag/LogsLog/operation/log_get - x-js-parent: LogClient - x-js-name: stream - x-js-doc-url: https://docs.apify.com/api/client/js/reference/class/LogClient#stream - x-py-parent: LogClientAsync - x-py-name: stream - x-py-doc-url: https://docs.apify.com/api/client/python/reference/class/LogClientAsync#stream - /v2/users/{userId}: - get: - deprecated: false - description: | - Returns public information about a specific user account, similar to what - can be seen on public profile pages (e.g. https://apify.com/apify). - - This operation requires no authentication token. - operationId: user_get - parameters: - - description: User ID or username. - explode: false - in: path - name: userId - required: true - schema: - example: HGzIk8z78YcAPEB - type: string - style: simple - responses: - "200": - content: - application/json: - schema: - $ref: "#/components/schemas/PublicUserDataResponse" - description: "" - "400": - $ref: "#/components/responses/BadRequest" - "404": - $ref: "#/components/responses/NotFound" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Get public user data - tags: - - Users - x-legacy-doc-urls: - - https://docs.apify.com/api/v2#/reference/users/public-data/get-public-user-data - - https://docs.apify.com/api/v2#/reference/users/get-public-user-data - - https://docs.apify.com/api/v2#tag/UsersPublic-data/operation/user_get - /v2/users/me: - get: - deprecated: false - description: | - Returns information about the current user account, including both public - and private information. - - The user account is identified by the provided authentication token. - - The fields `plan`, `email` and `profile` are omitted when this endpoint is accessed from Actor run. - operationId: users_me_get - responses: - "200": - content: - application/json: - schema: - $ref: "#/components/schemas/PrivateUserDataResponse" - description: "" - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Get private user data - tags: - - Users - x-legacy-doc-urls: - - https://docs.apify.com/api/v2#/reference/users/private-data/get-private-user-data - - https://docs.apify.com/api/v2#/reference/users/get-private-user-data - - https://docs.apify.com/api/v2#tag/UsersPrivate-data/operation/users_me_get - /v2/users/me/usage/monthly: - get: - deprecated: false - description: | - Returns a complete summary of your usage for the current monthly usage cycle, - an overall sum, as well as a daily breakdown of usage. It is the same - information you will see on your account's [Billing > Historical usage page](https://console.apify.com/billing/historical-usage). The information - includes your use of Actors, compute, data transfer, and storage. - - Using the `date` parameter will show your usage in the monthly usage cycle that - includes that date. - operationId: users_me_usage_monthly_get - parameters: - - description: Date in the YYYY-MM-DD format. - explode: true - in: query - name: date - required: false - schema: - example: 2020-06-14 - type: string - style: form - responses: - "200": - content: - application/json: - schema: - $ref: "#/components/schemas/MonthlyUsageResponse" - description: "" - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Get monthly usage - tags: - - Users - x-legacy-doc-urls: - - https://docs.apify.com/api/v2#/reference/users/monthly-usage/get-monthly-usage - - https://docs.apify.com/api/v2#/reference/users/get-monthly-usage - - https://docs.apify.com/api/v2#tag/UsersMonthly-usage/operation/users_me_usage_monthly_get - /v2/users/me/limits: - get: - deprecated: false - description: | - Returns a complete summary of your account's limits. It is the same - information you will see on your account's [Limits page](https://console.apify.com/billing#/limits). The returned data - includes the current usage cycle, a summary of your limits, and your current usage. - operationId: users_me_limits_get - responses: - "200": - content: - application/json: - schema: - $ref: "#/components/schemas/LimitsResponse" - description: "" - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Get limits - tags: - - Users - x-legacy-doc-urls: - - https://docs.apify.com/api/v2#/reference/users/account-and-usage-limits/get-limits - - https://docs.apify.com/api/v2#/reference/users/get-limits - - https://docs.apify.com/api/v2#tag/UsersAccount-and-usage-limits/operation/users_me_limits_get - put: - deprecated: false - description: | - Updates the account's limits manageable on your account's [Limits page](https://console.apify.com/billing#/limits). - Specifically the: `maxMonthlyUsageUsd` and `dataRetentionDays` limits (see request body schema for more details). - operationId: users_me_limits_put - requestBody: - content: - application/json: - schema: - $ref: "#/components/schemas/UpdateLimitsRequest" - description: "" - responses: - "201": - content: - application/json: - schema: - type: object - description: "" - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "413": - $ref: "#/components/responses/PayloadTooLarge" - "415": - $ref: "#/components/responses/UnsupportedMediaType" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Update limits - tags: - - Users - x-legacy-doc-urls: - - https://docs.apify.com/api/v2#/reference/users/account-and-usage-limits/update-limits - - https://docs.apify.com/api/v2#/reference/users/update-limits - - https://docs.apify.com/api/v2#tag/UsersAccount-and-usage-limits/operation/users_me_limits_put - /v2/browser-info: - delete: - deprecated: false - description: | - Returns information about the HTTP request, including the client IP address, - country code, request headers, and body length. - - This endpoint is designed for proxy testing. It accepts any HTTP method so you - can verify that your proxy correctly forwards requests of any type and that - client IP addresses are anonymized. - operationId: tools_browser_info_delete - parameters: - - description: "If `true` or `1`, the response omits the `headers` field." - explode: true - in: query - name: skipHeaders - required: false - schema: - type: boolean - style: form - - description: "If `true` or `1`, the response includes the `rawHeaders` field\ - \ with the raw request headers." - explode: true - in: query - name: rawHeaders - required: false - schema: - type: boolean - style: form - responses: - "200": - content: - application/json: - schema: - $ref: "#/components/schemas/BrowserInfoResponse" - description: "" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "429": - $ref: "#/components/responses/TooManyRequests" - security: [] - summary: Get browser info - tags: - - Tools - get: - deprecated: false - description: | - Returns information about the HTTP request, including the client IP address, - country code, request headers, and body length. - - This endpoint is designed for proxy testing. It accepts any HTTP method so you - can verify that your proxy correctly forwards requests of any type and that - client IP addresses are anonymized. - operationId: tools_browser_info_get - parameters: - - description: "If `true` or `1`, the response omits the `headers` field." - explode: true - in: query - name: skipHeaders - required: false - schema: - type: boolean - style: form - - description: "If `true` or `1`, the response includes the `rawHeaders` field\ - \ with the raw request headers." - explode: true - in: query - name: rawHeaders - required: false - schema: - type: boolean - style: form - responses: - "200": - content: - application/json: - schema: - $ref: "#/components/schemas/BrowserInfoResponse" - description: "" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "429": - $ref: "#/components/responses/TooManyRequests" - security: [] - summary: Get browser info - tags: - - Tools - post: - deprecated: false - description: | - Returns information about the HTTP request, including the client IP address, - country code, request headers, and body length. - - This endpoint is designed for proxy testing. It accepts any HTTP method so you - can verify that your proxy correctly forwards requests of any type and that - client IP addresses are anonymized. - operationId: tools_browser_info_post - parameters: - - description: "If `true` or `1`, the response omits the `headers` field." - explode: true - in: query - name: skipHeaders - required: false - schema: - type: boolean - style: form - - description: "If `true` or `1`, the response includes the `rawHeaders` field\ - \ with the raw request headers." - explode: true - in: query - name: rawHeaders - required: false - schema: - type: boolean - style: form - responses: - "200": - content: - application/json: - schema: - $ref: "#/components/schemas/BrowserInfoResponse" - description: "" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "429": - $ref: "#/components/responses/TooManyRequests" - security: [] - summary: Get browser info - tags: - - Tools - put: - deprecated: false - description: | - Returns information about the HTTP request, including the client IP address, - country code, request headers, and body length. - - This endpoint is designed for proxy testing. It accepts any HTTP method so you - can verify that your proxy correctly forwards requests of any type and that - client IP addresses are anonymized. - operationId: tools_browser_info_put - parameters: - - description: "If `true` or `1`, the response omits the `headers` field." - explode: true - in: query - name: skipHeaders - required: false - schema: - type: boolean - style: form - - description: "If `true` or `1`, the response includes the `rawHeaders` field\ - \ with the raw request headers." - explode: true - in: query - name: rawHeaders - required: false - schema: - type: boolean - style: form - responses: - "200": - content: - application/json: - schema: - $ref: "#/components/schemas/BrowserInfoResponse" - description: "" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "429": - $ref: "#/components/responses/TooManyRequests" - security: [] - summary: Get browser info - tags: - - Tools - /v2/tools/encode-and-sign: - post: - deprecated: false - description: | - Encodes and signs any JSON object. The encoded value includes a signature - tied to the authenticated user's ID, which can later be verified using the - decode-and-verify endpoint. - - **Important**: The request must specify the `Content-Type: application/json` - HTTP header. - operationId: tools_encode_and_sign_post - requestBody: - content: - application/json: - example: - key: value - schema: - type: object - description: "" - required: true - responses: - "200": - content: - application/json: - schema: - $ref: "#/components/schemas/EncodeAndSignResponse" - description: "" - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "413": - $ref: "#/components/responses/PayloadTooLarge" - "415": - $ref: "#/components/responses/UnsupportedMediaType" - "429": - $ref: "#/components/responses/TooManyRequests" - summary: Encode and sign object - tags: - - Tools - /v2/tools/decode-and-verify: - post: - deprecated: false - description: | - Decodes and verifies an encoded value previously created by the - encode-and-sign endpoint. Returns the original decoded object along with - information about the user who encoded it and whether that user is verified. - - **Important**: The request must specify the `Content-Type: application/json` - HTTP header. - operationId: tools_decode_and_verify_post - requestBody: - content: - application/json: - schema: - $ref: "#/components/schemas/DecodeAndVerifyRequest" - description: "" - required: true - responses: - "200": - content: - application/json: - schema: - $ref: "#/components/schemas/DecodeAndVerifyResponse" - description: "" - "400": - $ref: "#/components/responses/BadRequest" - "405": - $ref: "#/components/responses/MethodNotAllowed" - "413": - $ref: "#/components/responses/PayloadTooLarge" - "415": - $ref: "#/components/responses/UnsupportedMediaType" - "429": - $ref: "#/components/responses/TooManyRequests" - security: [] - summary: Decode and verify object - tags: - - Tools -components: - examples: - ListOfRunsResponseExample: - value: - data: - total: 2 - offset: 0 - limit: 1000 - desc: false - count: 2 - items: - - id: HG7ML7M8z78YcAPEB - actId: HDSasDasz78YcAPEB - actorTaskId: KJHSKHausidyaJKHs - status: SUCCEEDED - startedAt: 2019-11-30T07:34:24.202Z - finishedAt: 2019-12-12T09:30:12.202Z - buildId: HG7ML7M8z78YcAPEB - buildNumber: 0.0.2 - meta: - origin: WEB - usageTotalUsd: 0.2 - defaultKeyValueStoreId: sfAjeR4QmeJCQzTfe - defaultDatasetId: 3ZojQDdFTsyE7Moy4 - defaultRequestQueueId: so93g2shcDzK3pA85 - - id: HG7ML7M8z78YcAPEB - actId: HDSasDasz78YcAPEB - actorTaskId: KJHSKHausidyaJKHs - status: FAILED - startedAt: 2019-12-12T07:34:14.202Z - finishedAt: 2019-12-13T08:36:13.202Z - buildId: u78dML7M8z78YcAPEB - buildNumber: 0.2.2 - meta: - origin: DEVELOPMENT - usageTotalUsd: 0.6 - defaultKeyValueStoreId: sffsouqlseJCQzTfe - defaultDatasetId: CFGggdjQDsyE7Moyw - defaultRequestQueueId: soowucklrmDzKpA8x - parameters: - offset: - description: | - Number of items that should be skipped at the start. The default value is `0`. - explode: true - in: query - name: offset - required: false - schema: - example: 0 - format: double - type: number - style: form - limit: - description: | - Maximum number of items to return. The default value as well as the maximum is `1000`. - explode: true - in: query - name: limit - required: false - schema: - example: 1000 - format: double - type: number - style: form - descCreatedAt: - description: | - If `true` or `1` then the objects are sorted by the `createdAt` field in - descending order. By default, they are sorted in ascending order. - explode: true - in: query - name: desc - required: false - schema: - example: true - type: boolean - style: form - actorId: - description: Actor ID or a tilde-separated owner's username and Actor name. - explode: false - in: path - name: actorId - required: true - schema: - example: janedoe~my-actor - type: string - style: simple - versionNumber: - description: Actor version. - explode: false - in: path - name: versionNumber - required: true - schema: - example: "0.1" - type: string - style: simple - descStartedAt: - description: | - If `true` or `1` then the objects are sorted by the `startedAt` field in - descending order. By default, they are sorted in ascending order. - explode: true - in: query - name: desc - required: false - schema: - example: true - type: boolean - style: form - waitForFinishBuild: - description: | - The maximum number of seconds the server waits for the build to finish. - By default it is `0`, the maximum value is `60`. <!-- MAX_ACTOR_JOB_ASYNC_WAIT_SECS --> - If the build finishes in time then the returned build object will have a - terminal status (e.g. `SUCCEEDED`), otherwise it will have a transitional status (e.g. `RUNNING`). - explode: true - in: query - name: waitForFinish - required: false - schema: - example: 60 - format: double - type: number - style: form - buildIdWithDefault: - description: | - ID of the build, found in the build's Info tab. - Use the special value `default` to get the OpenAPI schema for the Actor's default build. - explode: false - in: path - name: buildId - required: true - schema: - example: soSkq9ekdmfOslopH - type: string - style: simple - buildId: - description: "ID of the build, found in the build's Info tab." - explode: false - in: path - name: buildId - required: true - schema: - example: soSkq9ekdmfOslopH - type: string - style: simple - status: - description: | - Single status or comma-separated list of statuses, see ([available - statuses](https://docs.apify.com/platform/actors/running/runs-and-builds#lifecycle)). Used to filter runs by the specified statuses only. - explode: false - in: query - name: status - required: false - schema: - example: - - SUCCEEDED - items: - type: string - type: array - default: null - style: form - startedAfter: - allowReserved: true - description: | - Filter runs that started after the specified date and time (inclusive). - The value must be a valid ISO 8601 datetime string (UTC). - explode: true - in: query - name: startedAfter - required: false - schema: - example: 2025-09-01T00:00:00.000Z - format: date-time - type: string - style: form - startedBefore: - allowReserved: true - description: | - Filter runs that started before the specified date and time (inclusive). - The value must be a valid ISO 8601 datetime string (UTC). - explode: true - in: query - name: startedBefore - required: false - schema: - example: 2025-09-17T23:59:59.000Z - format: date-time - type: string - style: form - timeout: - description: | - Optional timeout for the run, in seconds. By default, the run uses the timeout from its configuration. - explode: true - in: query - name: timeout - required: false - schema: - example: 60 - format: double - type: number - style: form - memory: - description: | - Memory limit for the run, in megabytes. The amount of memory can be set to a power of 2 with a minimum of 128. - By default, the run uses the memory limit from its configuration. - explode: true - in: query - name: memory - required: false - schema: - example: 256 - format: double - type: number - style: form - maxItems: - description: | - Specifies the maximum number of dataset items that will be charged for pay-per-result Actors. - This does NOT guarantee that the Actor will return only this many items. - It only ensures you won't be charged for more than this number of items. - Only works for pay-per-result Actors. - Value can be accessed in the actor run using `ACTOR_MAX_PAID_DATASET_ITEMS` environment variable. - explode: true - in: query - name: maxItems - required: false - schema: - example: 1000 - format: double - type: number - style: form - maxTotalChargeUsd: - description: | - Specifies the maximum cost of the run. This parameter is - useful for pay-per-event Actors, as it allows you to limit the amount - charged to your subscription. You can access the maximum cost in your Actor - by using the `ACTOR_MAX_TOTAL_CHARGE_USD` environment variable. - explode: true - in: query - name: maxTotalChargeUsd - required: false - schema: - example: 5 - format: double - type: number - style: form - restartOnError: - description: | - Determines whether the run will be restarted if it fails. - explode: true - in: query - name: restartOnError - required: false - schema: - example: false - type: boolean - style: form - build: - description: | - Specifies the Actor build to run. It can be either a build tag or build number. - By default, the run uses the build from its configuration (typically `latest`). - explode: true - in: query - name: build - required: false - schema: - example: 0.1.234 - type: string - style: form - waitForFinishRun: - description: | - The maximum number of seconds the server waits for the run to finish. By - default it is `0`, the maximum value is `60`. <!-- MAX_ACTOR_JOB_ASYNC_WAIT_SECS --> - If the run finishes in time then the returned run object will have a terminal status (e.g. `SUCCEEDED`), - otherwise it will have a transitional status (e.g. `RUNNING`). - explode: true - in: query - name: waitForFinish - required: false - schema: - example: 60 - format: double - type: number - style: form - webhooks: - description: | - Specifies optional webhooks associated with the Actor run, which can be used to receive a notification - e.g. when the Actor finished or failed. The value is a Base64-encoded JSON array whose items follow - the WebhookRepresentation schema. For more information, see - [Webhooks documentation](https://docs.apify.com/platform/integrations/webhooks). - explode: true - in: query - name: webhooks - required: false - schema: - example: dGhpcyBpcyBqdXN0IGV4YW1wbGUK... - type: string - style: form - outputRecordKey: - description: | - Key of the record from run's default key-value store to be returned - in the response. By default, it is `OUTPUT`. - explode: true - in: query - name: outputRecordKey - required: false - schema: - example: OUTPUT - type: string - style: form - format: - description: | - Format of the results, possible values are: `json`, `jsonl`, `csv`, `html`, `xlsx`, `xml` and `rss`. The default value is `json`. - explode: true - in: query - name: format - required: false - schema: - example: json - type: string - style: form - clean: - description: | - If `true` or `1` then the API endpoint returns only non-empty items and skips hidden fields (i.e. fields starting with the # character). - The `clean` parameter is just a shortcut for `skipHidden=true` and `skipEmpty=true` parameters. - Note that since some objects might be skipped from the output, that the result might contain less items than the `limit` value. - explode: true - in: query - name: clean - required: false - schema: - example: false - type: boolean - style: form - datasetParameters_limit: - description: Maximum number of items to return. By default there is no limit. - explode: true - in: query - name: limit - required: false - schema: - format: double - type: number - style: form - fields: - description: | - A comma-separated list of fields which should be picked from the items, only these fields will remain in the resulting record objects. - Note that the fields in the outputted items are sorted the same way as they are specified in the `fields` query parameter. - You can use this feature to effectively fix the output format. - explode: true - in: query - name: fields - required: false - schema: - example: "myValue,myOtherValue" - type: string - style: form - outputFields: - description: | - A comma-separated list of output field names that positionally rename the fields specified in the `fields` parameter. - For example, `?fields=headline,url&outputFields=title,link` renames `headline` to `title` and `url` to `link` in the output. - The number of names in `outputFields` must match the number of names in `fields`. - Requires the `fields` parameter to be specified as well. - explode: true - in: query - name: outputFields - required: false - schema: - example: "title,link" - type: string - style: form - omit: - description: A comma-separated list of fields which should be omitted from the - items. - explode: true - in: query - name: omit - required: false - schema: - example: "myValue,myOtherValue" - type: string - style: form - unwind: - description: | - A comma-separated list of fields which should be unwound, in order which they should be processed. Each field should be either an array or an object. - If the field is an array then every element of the array will become a separate record and merged with parent object. - If the unwound field is an object then it is merged with the parent object. - If the unwound field is missing or its value is neither an array nor an object and therefore cannot be merged with a parent object then the item gets preserved as it is. - Note that the unwound items ignore the `desc` parameter. - explode: true - in: query - name: unwind - required: false - schema: - example: "myValue,myOtherValue" - type: string - style: form - flatten: - description: | - A comma-separated list of fields which should transform nested objects into flat structures. - - For example, with `flatten="foo"` the object `{"foo":{"bar": "hello"}}` is turned into `{"foo.bar": "hello"}`. - - The original object with properties is replaced with the flattened object. - explode: true - in: query - name: flatten - required: false - schema: - example: myValue - type: string - style: form - descDataset: - description: | - By default, results are returned in the same order as they were stored. - To reverse the order, set this parameter to `true` or `1`. - explode: true - in: query - name: desc - required: false - schema: - example: true - type: boolean - style: form - attachment: - description: | - If `true` or `1` then the response will define the `Content-Disposition: - attachment` header, forcing a web browser to download the file rather - than to display it. By default this header is not present. - explode: true - in: query - name: attachment - required: false - schema: - example: true - type: boolean - style: form - delimiter: - description: | - A delimiter character for CSV files, only used if `format=csv`. You - might need to URL-encode the character (e.g. use `%09` for tab or `%3B` - for semicolon). The default delimiter is a simple comma (`,`). - explode: true - in: query - name: delimiter - required: false - schema: - example: ; - type: string - style: form - bom: - description: | - All text responses are encoded in UTF-8 encoding. By default, the - `format=csv` files are prefixed with the UTF-8 Byte Order Mark (BOM), while `json`, `jsonl`, `xml`, `html` and `rss` files are not. - - If you want to override this default behavior, specify `bom=1` query parameter to include the BOM or `bom=0` to skip it. - explode: true - in: query - name: bom - required: false - schema: - example: false - type: boolean - style: form - xmlRoot: - description: | - Overrides default root element name of `xml` output. By default the root element is `items`. - explode: true - in: query - name: xmlRoot - required: false - schema: - example: items - type: string - style: form - xmlRow: - description: | - Overrides default element name that wraps each page or page function result object in `xml` output. By default the element name is `item`. - explode: true - in: query - name: xmlRow - required: false - schema: - example: item - type: string - style: form - skipHeaderRow: - description: If `true` or `1` then header row in the `csv` format is skipped. - explode: true - in: query - name: skipHeaderRow - required: false - schema: - example: true - type: boolean - style: form - skipHidden: - description: | - If `true` or `1` then hidden fields are skipped from the output, i.e. fields starting with the `#` character. - explode: true - in: query - name: skipHidden - required: false - schema: - example: false - type: boolean - style: form - skipEmpty: - description: | - If `true` or `1` then empty items are skipped from the output. - - Note that if used, the results might contain less items than the limit value. - explode: true - in: query - name: skipEmpty - required: false - schema: - example: false - type: boolean - style: form - simplified: - description: | - If `true` or `1` then, the endpoint applies the `fields=url,pageFunctionResult,errorInfo` - and `unwind=pageFunctionResult` query parameters. This feature is used to emulate simplified results provided by the - legacy Apify Crawler product and it's not recommended to use it in new integrations. - explode: true - in: query - name: simplified - required: false - schema: - example: false - type: boolean - style: form - view: - description: | - Defines the view configuration for dataset items based on the schema definition. - This parameter determines how the data will be filtered and presented. - For complete specification details, see the [dataset schema documentation](/platform/actors/development/actor-definition/dataset-schema). - explode: true - in: query - name: view - required: false - schema: - example: overview - type: string - style: form - skipFailedPages: - description: | - If `true` or `1` then, the all the items with errorInfo property will be skipped from the output. - - This feature is here to emulate functionality of API version 1 used for the legacy Apify Crawler product and it's not recommended to use it in new integrations. - explode: true - in: query - name: skipFailedPages - required: false - schema: - example: false - type: boolean - style: form - feedTitle: - description: | - Overrides the auto-generated RSS channel `<title>` element. - Only used when `format=rss`. If not provided, the title defaults to `Dataset <label>`. - explode: true - in: query - name: feedTitle - required: false - schema: - example: Latest posts from r/pasta - type: string - style: form - feedDescription: - description: | - Overrides the auto-generated RSS channel `<description>` element. - Only used when `format=rss`. If not provided, the description defaults to `Items in dataset with id "<datasetId>".` - explode: true - in: query - name: feedDescription - required: false - schema: - example: Scraped forum posts - type: string - style: form - runId: - description: Actor run ID. - explode: false - in: path - name: runId - required: true - schema: - example: 3KH8gEpp4d8uQSe8T - type: string - style: simple - buildResurrect: - description: | - Specifies the Actor build to run. It can be either a build tag or build number. - By default, the run is resurrected with the same build it originally used. Specifically, - if a run was first started with the `latest` tag, which resolves to version `0.0.3` at the - time, a run resurrected without this parameter will continue running with `0.0.3`, even if - `latest` already points to a newer build. - explode: true - in: query - name: build - required: false - schema: - example: 0.1.234 - type: string - style: form - timeoutResurrect: - description: | - Optional timeout for the run, in seconds. By default, the run uses the timeout - specified in the run that is being resurrected. - explode: true - in: query - name: timeout - required: false - schema: - example: 60 - format: double - type: number - style: form - memoryResurrect: - description: | - Memory limit for the run, in megabytes. The amount of memory can be set to a power of 2 - with a minimum of 128. By default, the run uses the memory limit specified in the run - that is being resurrected. - explode: true - in: query - name: memory - required: false - schema: - example: 256 - format: double - type: number - style: form - restartOnErrorResurrect: - description: | - Determines whether the resurrected run will be restarted if it fails. - By default, the resurrected run uses the same setting as before. - explode: true - in: query - name: restartOnError - required: false - schema: - example: false - type: boolean - style: form - statusLastRun: - description: Filter for the run status. - explode: true - in: query - name: status - required: false - schema: - example: SUCCEEDED - type: string - style: form - signature: - description: Signature used for the access. - explode: true - in: query - name: signature - required: false - schema: - example: 2wTI46Bg8qWQrV7tavlPI - type: string - style: form - exclusiveStartKey: - description: All keys up to this one (including) are skipped from the result. - explode: true - in: query - name: exclusiveStartKey - required: false - schema: - example: Ihnsp8YrvJ8102Kj - type: string - style: form - keyValueStoreParameters_limit: - description: Number of keys to be returned. - explode: true - in: query - name: limit - required: false - schema: - default: 1000 - example: 100 - format: int32 - maximum: 1000 - minimum: 1 - type: number - style: form - collectionKeys: - description: Limit the results to keys that belong to a specific collection - from the key-value store schema. The key-value store need to have a schema - defined for this parameter to work. - explode: true - in: query - name: collection - required: false - schema: - example: postImages - type: string - style: form - prefixKeys: - description: Limit the results to keys that start with a specific prefix. - explode: true - in: query - name: prefix - required: false - schema: - example: post-images- - type: string - style: form - collectionRecords: - description: | - If specified, only records belonging to a specific collection from the key-value store schema. The key-value store need to have a schema defined for this parameter to work. - explode: true - in: query - name: collection - required: false - schema: - example: my-collection - type: string - style: form - prefixRecords: - description: | - If specified, only records whose key starts with the given prefix are included in the archive. - explode: true - in: query - name: prefix - required: false - schema: - example: my-prefix/ - type: string - style: form - recordKey: - description: Key of the record. - explode: false - in: path - name: recordKey - required: true - schema: - example: someKey - type: string - style: simple - keyValueStoreParameters_attachment: - description: | - If `true` or `1`, the response will be served with `Content-Disposition: attachment` header, - causing web browsers to offer downloading HTML records instead of displaying them. - explode: true - in: query - name: attachment - required: false - schema: - example: true - type: boolean - style: form - Content-Encoding: - description: "" - explode: false - in: header - name: Content-Encoding - required: false - schema: - enum: - - gzip - - deflate - - br - - identity - type: string - style: simple - clientKey: - description: | - A unique identifier of the client accessing the request queue. It must - be a string between 1 and 32 characters long. This identifier is used to - determine whether the queue was accessed by multiple clients. If - `clientKey` is not provided, - the system considers this API call to come from a new client. For - details, see the `hadMultipleClients` field returned by the [Get - head](#/reference/request-queues/queue-head) operation. - explode: true - in: query - name: clientKey - required: false - schema: - example: client-abc - type: string - style: form - exclusiveStartId: - deprecated: true - description: "All requests up to this one (including) are skipped from the result.\ - \ (Deprecated, use `cursor` instead.)" - explode: true - in: query - name: exclusiveStartId - required: false - schema: - example: Ihnsp8YrvJ8102Kj - type: string - style: form - listLimit: - description: Number of keys to be returned. Maximum value is `10000`. - explode: true - in: query - name: limit - required: false - schema: - example: 100 - format: double - type: number - style: form - cursor: - description: "A cursor string for pagination, returned in the previous response\ - \ as `nextCursor`. Use this to retrieve the next page of requests." - explode: true - in: query - name: cursor - required: false - schema: - example: eyJyZXF1ZXN0SWQiOiI2OFRqQ2RaTDNvM2hiUU0ifQ - type: string - style: form - filter: - description: "Filter requests by their state. Possible values are `locked` and\ - \ `pending`. You can combine multiple values separated by commas, which will\ - \ mean the union of these filters – requests matching any of the specified\ - \ states will be returned. (Not compatible with deprecated `exclusiveStartId`\ - \ parameter.)" - explode: false - in: query - name: filter - required: false - schema: - example: - - locked - items: - enum: - - locked - - pending - type: string - type: array - default: null - style: form - forefront: - description: | - Determines if request should be added to the head of the queue or to the - end. Default value is `false` (end of queue). - explode: true - in: query - name: forefront - required: false - schema: - example: "false" - type: string - style: form - contentTypeJson: - description: "" - explode: false - in: header - name: Content-Type - required: true - schema: - enum: - - application/json - type: string - style: simple - requestId: - description: Request ID. - explode: false - in: path - name: requestId - required: true - schema: - example: xpsmkDlspokDSmklS - type: string - style: simple - lockSecs: - description: How long the requests will be locked for (in seconds). - explode: true - in: query - name: lockSecs - required: true - schema: - example: 60 - format: double - type: number - style: form - lockForefront: - description: | - Determines if request should be added to the head of the queue or to the - end after lock expires. - explode: true - in: query - name: forefront - required: false - schema: - example: "false" - type: string - style: form - deleteForefront: - description: | - Determines if request should be added to the head of the queue or to the - end after lock was removed. - explode: true - in: query - name: forefront - required: false - schema: - example: "false" - type: string - style: form - headLimit: - description: How many items from queue should be returned. - explode: true - in: query - name: limit - required: false - schema: - example: 100 - format: double - type: number - style: form - headLockLimit: - description: How many items from the queue should be returned. - explode: true - in: query - name: limit - required: false - schema: - example: 25 - format: double - maximum: 25 - type: number - style: form - stream: - description: | - If `true` or `1` then the logs will be streamed as long as the run or build is running. - explode: true - in: query - name: stream - required: false - schema: - example: false - type: boolean - style: form - download: - description: | - If `true` or `1` then the web browser will download the log file rather than open it in a tab. - explode: true - in: query - name: download - required: false - schema: - example: false - type: boolean - style: form - raw: - description: | - If `true` or `1`, the logs will be kept verbatim. By default, the API removes - ANSI escape codes from the logs, keeping only printable characters. - explode: true - in: query - name: raw - required: false - schema: - example: false - type: boolean - style: form - gracefully: - description: | - If true passed, the Actor run will abort gracefully. - It will send `aborting` and `persistState` event into run and force-stop the run after 30 seconds. - It is helpful in cases where you plan to resurrect the run later. - explode: true - in: query - name: gracefully - required: false - schema: - example: true - type: boolean - style: form - targetActorId: - description: ID of a target Actor that the run should be transformed into. - explode: true - in: query - name: targetActorId - required: true - schema: - example: HDSasDasz78YcAPEB - type: string - style: form - actorTaskId: - description: Task ID or a tilde-separated owner's username and task's name. - explode: false - in: path - name: actorTaskId - required: true - schema: - example: janedoe~my-task - type: string - style: simple - unnamed: - description: | - If `true` or `1` then all the storages are returned. By default, only - named storages are returned. - explode: true - in: query - name: unnamed - required: false - schema: - example: true - type: boolean - style: form - storeId: - description: Key-value store ID or `username~store-name`. - explode: false - in: path - name: storeId - required: true - schema: - example: WkzbQMuFYuamGv3YF - type: string - style: simple - datasetId: - description: Dataset ID or `username~dataset-name`. - explode: false - in: path - name: datasetId - required: true - schema: - example: WkzbQMuFYuamGv3YF - type: string - style: simple - queueId: - description: Queue ID or `username~queue-name`. - explode: false - in: path - name: queueId - required: true - schema: - example: WkzbQMuFYuamGv3YF - type: string - style: simple - webhookId: - description: Webhook ID. - explode: false - in: path - name: webhookId - required: true - schema: - example: pVJtoTelgYUq4qJOt - type: string - style: simple - scheduleId: - description: Schedule ID. - explode: false - in: path - name: scheduleId - required: true - schema: - example: asdLZtadYvn4mBZmm - type: string - style: simple - buildOrRunId: - description: ID of the Actor build or run. - explode: false - in: path - name: buildOrRunId - required: true - schema: - example: HG7ML7M8z78YcAPE - type: string - style: simple - responses: - BadRequest: - content: - application/json: - example: - error: - type: invalid-input - message: "Invalid input: The request body contains invalid data." - schema: - $ref: "#/components/schemas/ErrorResponse" - description: Bad request - invalid input parameters or request body. - Unauthorized: - content: - application/json: - example: - error: - type: invalid-token - message: Authentication token is not valid. - schema: - $ref: "#/components/schemas/ErrorResponse" - description: Unauthorized - authentication required or invalid token. - Forbidden: - content: - application/json: - example: - error: - type: insufficient-permissions - message: You do not have permission to perform this action. - schema: - $ref: "#/components/schemas/ErrorResponse" - description: Forbidden - insufficient permissions to perform this action. - MethodNotAllowed: - content: - application/json: - example: - error: - type: method-not-allowed - message: "This API end-point can only be accessed using the following\ - \ HTTP methods: OPTIONS,GET" - schema: - $ref: "#/components/schemas/ErrorResponse" - description: Method not allowed. - TooManyRequests: - content: - application/json: - example: - error: - type: rate-limit-exceeded - message: You have exceeded the rate limit. Please try again later. - schema: - $ref: "#/components/schemas/ErrorResponse" - description: Too many requests - rate limit exceeded. - PayloadTooLarge: - content: - application/json: - example: - error: - type: request-too-large - message: "The POST payload is too large (limit: 9437184 bytes, actual\ - \ length: 10485760 bytes)." - schema: - $ref: "#/components/schemas/ErrorResponse" - description: Payload too large - the request body exceeds the size limit. - UnsupportedMediaType: - content: - application/json: - example: - error: - type: unsupported-content-encoding - message: Content-Encoding "bla" is not supported. - schema: - $ref: "#/components/schemas/ErrorResponse" - description: Unsupported media type - the Content-Encoding of the request is - not supported. - NotFound: - content: - application/json: - example: - error: - type: record-not-found - message: The requested resource was not found. - schema: - $ref: "#/components/schemas/ErrorResponse" - description: Not found - the requested resource does not exist. - PaymentRequired: - content: - application/json: - example: - error: - type: x402-payment-required - message: Please provide X402-PAYMENT-SIGNATURE header with the payment. - See https://x402.org. - schema: - $ref: "#/components/schemas/ErrorResponse" - description: "Payment required - the user has exceeded their usage limit, does\ - \ not have enough credits, or the request lacks authentication and payment\ - \ credentials." - NoContent: - description: No content - Conflict: - content: - application/json: - example: - error: - type: actor-name-not-unique - message: Record with the given name already exists. - schema: - $ref: "#/components/schemas/ErrorResponse" - description: Conflict - the request could not be completed due to a conflict - with the current state of the resource. - RunTimeout: - content: - application/json: - example: - error: - type: run-timeout-exceeded - message: Actor run exceeded the timeout of 300 seconds for this API - endpoint - schema: - $ref: "#/components/schemas/ErrorResponse" - description: The HTTP request exceeded the timeout limit - schemas: - PaginationResponse: - description: Common pagination fields for list responses. - properties: - total: - description: The total number of items available across all pages. - minimum: 0 - type: integer - offset: - description: The starting position for this page of results. - minimum: 0 - type: integer - limit: - description: The maximum number of items returned per page. - minimum: 1 - type: integer - desc: - description: Whether the results are sorted in descending order. - type: boolean - count: - description: The number of items returned in this response. - minimum: 0 - type: integer - required: - - count - - desc - - limit - - offset - - total - title: PaginationResponse - ActorStats: - example: - totalBuilds: 0 - totalRuns: 6 - totalUsers: 1 - totalUsers7Days: 5 - totalUsers30Days: 5 - totalUsers90Days: 2 - totalMetamorphs: 7 - lastRunStartedAt: 2000-01-23T04:56:07.000+00:00 - actorReviewCount: 9 - actorReviewRating: 3.616076749251911 - bookmarkCount: 2 - publicActorRunStats30Days: - ABORTED: 4 - FAILED: 7 - SUCCEEDED: 1 - TIMED-OUT: 1 - TOTAL: 1 - properties: - totalBuilds: - type: integer - totalRuns: - type: integer - totalUsers: - type: integer - totalUsers7Days: - type: integer - totalUsers30Days: - type: integer - totalUsers90Days: - type: integer - totalMetamorphs: - type: integer - lastRunStartedAt: - format: date-time - type: string - actorReviewCount: - type: integer - actorReviewRating: - type: number - bookmarkCount: - type: integer - publicActorRunStats30Days: - $ref: "#/components/schemas/ActorStats_publicActorRunStats30Days" - title: ActorStats - ActorShort: - example: - id: id - createdAt: 2000-01-23T04:56:07.000+00:00 - modifiedAt: 2000-01-23T04:56:07.000+00:00 - name: name - username: username - title: title - stats: "" - properties: - id: - type: string - createdAt: - format: date-time - type: string - modifiedAt: - format: date-time - type: string - name: - type: string - username: - type: string - title: - type: string - stats: - allOf: - - $ref: "#/components/schemas/ActorStats" - nullable: true - required: - - createdAt - - id - - modifiedAt - - name - - username - title: ActorShort - ListOfActors: - allOf: - - $ref: "#/components/schemas/PaginationResponse" - - properties: - items: - items: - $ref: "#/components/schemas/ActorShort" - type: array - default: null - required: - - items - example: - total: 0 - offset: 0 - limit: 1 - desc: true - count: 0 - items: - - id: id - createdAt: 2000-01-23T04:56:07.000+00:00 - modifiedAt: 2000-01-23T04:56:07.000+00:00 - name: name - username: username - title: title - stats: "" - - id: id - createdAt: 2000-01-23T04:56:07.000+00:00 - modifiedAt: 2000-01-23T04:56:07.000+00:00 - name: name - username: username - title: title - stats: "" - title: ListOfActors - ListOfActorsResponse: - example: - data: - total: 0 - offset: 0 - limit: 1 - desc: true - count: 0 - items: - - id: id - createdAt: 2000-01-23T04:56:07.000+00:00 - modifiedAt: 2000-01-23T04:56:07.000+00:00 - name: name - username: username - title: title - stats: "" - - id: id - createdAt: 2000-01-23T04:56:07.000+00:00 - modifiedAt: 2000-01-23T04:56:07.000+00:00 - name: name - username: username - title: title - stats: "" - properties: - data: - $ref: "#/components/schemas/ListOfActors" - required: - - data - title: ListOfActorsResponse - ErrorType: - description: Machine-processable error type identifier. - enum: - - 3d-secure-auth-failed - - access-right-already-exists - - action-not-found - - actor-already-rented - - actor-can-not-be-rented - - actor-disabled - - actor-is-not-rented - - actor-memory-limit-exceeded - - actor-name-exists-new-owner - - actor-name-not-unique - - actor-not-found - - actor-not-github-actor - - actor-not-public - - actor-permission-level-not-supported-for-agentic-payments - - actor-review-already-exists - - actor-run-failed - - actor-standby-not-supported-for-agentic-payments - - actor-task-name-not-unique - - agentic-payment-info-retrieval-error - - agentic-payment-information-missing - - agentic-payment-insufficient-amount - - agentic-payment-provider-internal-error - - agentic-payment-provider-unauthorized - - airtable-webhook-deprecated - - already-subscribed-to-paid-actor - - apify-plan-required-to-use-paid-actor - - apify-signup-not-allowed - - auth-method-not-supported - - authorization-server-not-found - - auto-issue-date-invalid - - background-check-required - - billing-system-error - - black-friday-plan-expired - - braintree-error - - braintree-not-linked - - braintree-operation-timed-out - - braintree-unsupported-currency - - build-not-found - - build-outdated - - cannot-add-apify-events-to-ppe-actor - - cannot-add-multiple-pricing-infos - - cannot-add-pricing-info-that-alters-past - - cannot-add-second-future-pricing-info - - cannot-build-actor-from-webhook - - cannot-change-billing-interval - - cannot-change-owner - - cannot-charge-apify-event - - cannot-charge-non-pay-per-event-actor - - cannot-comment-as-other-user - - cannot-copy-actor-task - - cannot-create-payout - - cannot-create-public-actor - - cannot-create-tax-transaction - - cannot-delete-critical-actor - - cannot-delete-invoice - - cannot-delete-paid-actor - - cannot-disable-one-time-event-for-apify-start-event - - cannot-disable-organization-with-enabled-members - - cannot-disable-user-with-subscription - - cannot-link-oauth-to-unverified-email - - cannot-metamorph-to-pay-per-result-actor - - cannot-modify-actor-pricing-too-frequently - - cannot-modify-actor-pricing-with-immediate-effect - - cannot-override-paid-actor-trial - - cannot-permanently-delete-subscription - - cannot-publish-actor - - cannot-reduce-last-full-token - - cannot-reimburse-more-than-original-charge - - cannot-reimburse-non-rental-charge - - cannot-remove-own-actor-from-recently-used - - cannot-remove-payment-method - - cannot-remove-pricing-info - - cannot-remove-running-run - - cannot-remove-user-with-public-actors - - cannot-remove-user-with-subscription - - cannot-remove-user-with-unpaid-invoice - - cannot-rename-env-var - - cannot-rent-paid-actor - - cannot-review-own-actor - - cannot-set-access-rights-for-owner - - cannot-set-is-status-message-terminal - - cannot-unpublish-critical-actor - - cannot-unpublish-paid-actor - - cannot-unpublish-profile - - cannot-update-invoice-field - - concurrent-runs-limit-exceeded - - concurrent-update-detected - - conference-token-not-found - - content-encoding-forbidden-for-html - - coupon-already-redeemed - - coupon-expired - - coupon-for-new-customers - - coupon-for-subscribed-users - - coupon-limits-are-in-conflict-with-current-limits - - coupon-max-number-of-redemptions-reached - - coupon-not-found - - coupon-not-unique - - coupons-disabled - - create-github-issue-not-allowed - - creator-plan-not-available - - cron-expression-invalid - - daily-ai-token-limit-exceeded - - daily-publication-limit-exceeded - - dataset-does-not-have-fields-schema - - dataset-does-not-have-schema - - dataset-locked - - dataset-schema-invalid - - dcr-not-supported - - default-dataset-not-found - - deleting-default-build - - deleting-unfinished-build - - email-already-taken - - email-already-taken-removed-user - - email-domain-not-allowed-for-coupon - - email-invalid - - email-not-allowed - - email-not-valid - - email-update-too-soon - - elevated-permissions-needed - - env-var-already-exists - - exchange-rate-fetch-failed - - expired-conference-token - - failed-to-charge-user - - final-invoice-negative - - full-permission-actor-not-approved - - github-branch-empty - - github-issue-already-exists - - github-public-key-not-found - - github-repository-not-found - - github-signature-does-not-match-payload - - github-user-not-authorized-for-issues - - gmail-not-allowed - - id-does-not-match - - incompatible-billing-interval - - incomplete-payout-billing-info - - inconsistent-currencies - - incorrect-pricing-modifier-prefix - - input-json-invalid-characters - - input-json-not-object - - input-json-too-long - - input-update-collision - - insufficient-permissions - - insufficient-permissions-to-change-field - - insufficient-security-measures - - insufficient-tax-country-evidence - - integration-auth-error - - internal-server-error - - invalid-billing-info - - invalid-billing-period-for-payout - - invalid-build - - invalid-client-key - - invalid-collection - - invalid-conference-login-password - - invalid-content-type-header - - invalid-credentials - - invalid-git-auth-token - - invalid-github-issue-url - - invalid-header - - invalid-id - - invalid-idempotency-key - - invalid-input - - invalid-input-schema - - invalid-invoice - - invalid-invoice-type - - invalid-issue-date - - invalid-label-params - - invalid-main-account-user-id - - invalid-oauth-app - - invalid-oauth-scope - - invalid-one-time-invoice - - invalid-parameter - - invalid-payout-status - - invalid-picture-url - - invalid-record-key - - invalid-request - - invalid-resource-type - - invalid-signature - - invalid-subscription-plan - - invalid-tax-number - - invalid-tax-number-format - - invalid-token - - invalid-token-type - - invalid-two-factor-code - - invalid-two-factor-code-or-recovery-code - - invalid-two-factor-recovery-code - - invalid-username - - invalid-value - - invitation-invalid-resource-type - - invitation-no-longer-valid - - invoice-canceled - - invoice-cannot-be-refunded-due-to-too-high-amount - - invoice-incomplete - - invoice-is-draft - - invoice-locked - - invoice-must-be-buffer - - invoice-not-canceled - - invoice-not-draft - - invoice-not-found - - invoice-outdated - - invoice-paid-already - - issue-already-connected-to-github - - issue-not-found - - issues-bad-request - - issuer-not-registered - - job-finished - - label-already-linked - - last-api-token - - limit-reached - - max-items-must-be-greater-than-zero - - max-metamorphs-exceeded - - max-total-charge-usd-below-minimum - - max-total-charge-usd-must-be-greater-than-zero - - method-not-allowed - - migration-disabled - - missing-actor-rights - - missing-api-token - - missing-billing-info - - missing-line-items - - missing-payment-date - - missing-payout-billing-info - - missing-proxy-password - - missing-reporting-fields - - missing-resource-name - - missing-settings - - missing-username - - monthly-usage-limit-too-low - - more-than-one-update-not-allowed - - multiple-records-found - - must-be-admin - - name-not-unique - - next-runtime-computation-failed - - no-columns-in-exported-dataset - - no-payment-attempt-for-refund-found - - no-payment-method-available - - no-team-account-seats-available - - non-temporary-email - - not-enough-usage-to-run-paid-actor - - not-implemented - - not-supported-currencies - - o-auth-service-already-connected - - o-auth-service-not-connected - - oauth-resource-access-failed - - one-time-invoice-already-marked-paid - - only-drafts-can-be-deleted - - operation-canceled - - operation-not-allowed - - operation-timed-out - - organization-cannot-own-itself - - organization-role-not-found - - overlapping-payout-billing-periods - - own-token-required - - page-not-found - - param-not-one-of - - parameter-required - - parameters-mismatched - - password-reset-email-already-sent - - password-reset-token-expired - - pay-as-you-go-without-monthly-interval - - payment-attempt-status-message-required - - payout-already-paid - - payout-canceled - - payout-invalid-state - - payout-must-be-approved-to-be-marked-paid - - payout-not-found - - payout-number-already-exists - - phone-number-invalid - - phone-number-landline - - phone-number-opted-out - - phone-verification-disabled - - platform-feature-disabled - - price-overrides-validation-failed - - pricing-model-not-supported - - promotional-plan-not-available - - proxy-auth-ip-not-unique - - public-actor-disabled - - query-timeout - - quoted-price-outdated - - rate-limit-exceeded - - recaptcha-invalid - - recaptcha-required - - record-not-found - - record-not-public - - record-or-token-not-found - - record-too-large - - redirect-uri-mismatch - - reduced-plan-not-available - - rental-charge-already-reimbursed - - rental-not-allowed - - request-aborted-prematurely - - request-handled-or-locked - - request-id-invalid - - request-queue-duplicate-requests - - request-too-large - - requested-dataset-view-does-not-exist - - resume-token-expired - - run-failed - - run-input-body-not-valid-json - - run-timeout-exceeded - - russia-is-evil - - same-user - - schedule-actor-not-found - - schedule-actor-task-not-found - - schedule-name-not-unique - - schema-validation - - schema-validation-error - - schema-validation-failed - - sign-up-method-not-allowed - - slack-integration-not-custom - - socket-closed - - socket-destroyed - - store-schema-invalid - - store-terms-not-accepted - - stripe-enabled - - stripe-generic-decline - - stripe-not-enabled - - stripe-not-enabled-for-user - - tagged-build-required - - tax-country-invalid - - tax-number-invalid - - tax-number-validation-failed - - taxamo-call-failed - - taxamo-request-failed - - testing-error - - token-not-provided - - too-few-versions - - too-many-actor-tasks - - too-many-actors - - too-many-labels-on-resource - - too-many-mcp-connectors - - too-many-o-auth-apps - - too-many-organizations - - too-many-requests - - too-many-schedules - - too-many-ui-access-keys - - too-many-user-labels - - too-many-values - - too-many-versions - - too-many-webhooks - - unexpected-route - - unknown-build-tag - - unknown-payment-provider - - unsubscribe-token-invalid - - unsupported-actor-pricing-model-for-agentic-payments - - unsupported-content-encoding - - unsupported-file-type-for-issue - - unsupported-file-type-image-expected - - unsupported-file-type-text-or-json-expected - - unsupported-permission - - upcoming-subscription-bill-not-up-to-date - - user-already-exists - - user-already-verified - - user-creates-organizations-too-fast - - user-disabled - - user-email-is-disposable - - user-email-not-set - - user-email-not-verified - - user-has-no-subscription - - user-integration-not-found - - user-is-already-invited - - user-is-already-organization-member - - user-is-not-member-of-organization - - user-is-not-organization - - user-is-organization - - user-is-organization-owner - - user-is-removed - - user-not-found - - user-not-logged-in - - user-not-verified - - user-or-token-not-found - - user-plan-not-allowed-for-coupon - - user-problem-with-card - - user-record-not-found - - username-already-taken - - username-missing - - username-not-allowed - - username-removal-forbidden - - username-required - - verification-email-already-sent - - verification-token-expired - - version-already-exists - - versions-size-exceeded - - weak-password - - x402-agentic-payment-already-finalized - - x402-agentic-payment-insufficient-amount - - x402-agentic-payment-malformed-token - - x402-agentic-payment-settlement-failed - - x402-agentic-payment-settlement-in-progress - - x402-agentic-payment-settlement-stuck - - x402-agentic-payment-unauthorized - - x402-payment-required - - zero-invoice - title: ErrorType - type: string - ErrorDetail: - example: - type: 3d-secure-auth-failed - message: message - properties: - type: - $ref: "#/components/schemas/ErrorType" - message: - description: Human-readable error message describing what went wrong. - type: string - title: ErrorDetail - ErrorResponse: - example: - error: - type: 3d-secure-auth-failed - message: message - properties: - error: - $ref: "#/components/schemas/ErrorDetail" - required: - - error - title: ErrorResponse - VersionSourceType: - enum: - - SOURCE_FILES - - GIT_REPO - - TARBALL - - GITHUB_GIST - - SOURCE_CODE - title: VersionSourceType - type: string - EnvVar: - example: - name: name - value: value - isSecret: true - properties: - name: - type: string - value: - description: "The environment variable value. This field is absent in responses\ - \ when `isSecret` is `true`, as secret values are never returned by the\ - \ API." - type: string - isSecret: - nullable: true - type: boolean - required: - - name - title: EnvVar - SourceCodeFileFormat: - enum: - - BASE64 - - TEXT - type: string - SourceCodeFile: - example: - format: BASE64 - content: content - name: name - properties: - format: - $ref: "#/components/schemas/SourceCodeFileFormat" - content: - type: string - name: - type: string - required: - - name - title: SourceCodeFile - SourceCodeFolder: - description: | - Represents a folder in the Actor's source code structure. Distinguished from - SourceCodeFile by the presence of the `folder` property set to `true`. - properties: - name: - description: The folder path relative to the Actor's root directory. - type: string - folder: - description: Always `true` for folders. Used to distinguish folders from - files. - type: boolean - required: - - folder - - name - title: SourceCodeFolder - VersionSourceFiles: - items: - $ref: "#/components/schemas/VersionSourceFiles_inner" - title: VersionSourceFiles - type: array - default: null - Version: - example: - versionNumber: versionNumber - sourceType: "" - envVars: - - name: name - value: value - isSecret: true - - name: name - value: value - isSecret: true - applyEnvVarsToBuild: true - buildTag: buildTag - sourceFiles: - - format: BASE64 - content: content - name: name - - format: BASE64 - content: content - name: name - gitRepoUrl: gitRepoUrl - tarballUrl: tarballUrl - gitHubGistUrl: gitHubGistUrl - properties: - versionNumber: - pattern: "^([0-9]|[1-9][0-9])\\.([0-9]|[1-9][0-9])$" - type: string - sourceType: - allOf: - - $ref: "#/components/schemas/VersionSourceType" - nullable: true - envVars: - description: "" - items: - $ref: "#/components/schemas/EnvVar" - nullable: true - type: array - default: null - applyEnvVarsToBuild: - nullable: true - type: boolean - buildTag: - type: string - sourceFiles: - items: - $ref: "#/components/schemas/VersionSourceFiles_inner" - title: VersionSourceFiles - type: array - default: null - gitRepoUrl: - description: URL of the Git repository when sourceType is GIT_REPO. - nullable: true - type: string - tarballUrl: - description: URL of the tarball when sourceType is TARBALL. - nullable: true - type: string - gitHubGistUrl: - description: URL of the GitHub Gist when sourceType is GITHUB_GIST. - nullable: true - type: string - required: - - sourceType - - versionNumber - title: Version - CommonActorPricingInfo: - properties: - apifyMarginPercentage: - description: "In [0, 1], fraction of pricePerUnitUsd that goes to Apify" - type: number - createdAt: - description: When this pricing info record has been created - format: date-time - type: string - startedAt: - description: Since when is this pricing info record effective for a given - Actor - format: date-time - type: string - notifiedAboutFutureChangeAt: - format: date-time - nullable: true - type: string - x-internal: true - notifiedAboutChangeAt: - format: date-time - nullable: true - type: string - x-internal: true - reasonForChange: - nullable: true - type: string - x-internal: true - isPriceChangeNotificationSuppressed: - type: boolean - x-internal: true - forceContainsSignificantPriceChange: - type: boolean - x-internal: true - required: - - apifyMarginPercentage - - createdAt - - startedAt - title: CommonActorPricingInfo - TieredPricingPerEventEntry: - description: A single tier's price-per-event entry. - example: - tieredEventPriceUsd: 1.1730742509559433 - properties: - tieredEventPriceUsd: - description: Price per event in USD for this tier. - type: number - required: - - tieredEventPriceUsd - title: TieredPricingPerEventEntry - TieredPricingPerEvent: - additionalProperties: - $ref: "#/components/schemas/TieredPricingPerEventEntry" - description: | - Tiered price-per-event pricing for a single charge event, keyed by subscription tier (e.g. `FREE`, `BRONZE`, - `SILVER`, `GOLD`, `PLATINUM`, `DIAMOND`). The actual price applied is resolved from the user's tier. - title: TieredPricingPerEvent - ActorChargeEvent: - description: | - Definition of a single chargeable event for a pay-per-event Actor. Each event is either flat-priced - (`eventPriceUsd` is set) or tier-priced (`eventTieredPricingUsd` is set); the two are mutually exclusive. - example: - eventTitle: eventTitle - eventDescription: eventDescription - eventPriceUsd: 7.457744773683766 - eventTieredPricingUsd: - key: - tieredEventPriceUsd: 1.1730742509559433 - isPrimaryEvent: true - isOneTimeEvent: true - properties: - eventTitle: - description: Human-readable title shown to users in the billing UI. - type: string - eventDescription: - description: Human-readable description of what triggers this event. - type: string - eventPriceUsd: - description: | - Flat price per event in USD. Present only for non-tiered events. Mutually exclusive with `eventTieredPricingUsd`. - type: number - eventTieredPricingUsd: - additionalProperties: - $ref: "#/components/schemas/TieredPricingPerEventEntry" - description: | - Tiered price-per-event pricing for a single charge event, keyed by subscription tier (e.g. `FREE`, `BRONZE`, - `SILVER`, `GOLD`, `PLATINUM`, `DIAMOND`). The actual price applied is resolved from the user's tier. - title: TieredPricingPerEvent - isPrimaryEvent: - description: Whether this event is the Actor's primary chargeable event. - type: boolean - isOneTimeEvent: - description: Whether this event can only be charged once per Actor run. - type: boolean - required: - - eventDescription - - eventTitle - title: ActorChargeEvent - PayPerEventActorPricingInfo: - allOf: - - $ref: "#/components/schemas/CommonActorPricingInfo" - - properties: - pricingModel: - enum: - - PAY_PER_EVENT - type: string - pricingPerEvent: - $ref: "#/components/schemas/PayPerEventActorPricingInfo_allOf_pricingPerEvent" - minimalMaxTotalChargeUsd: - nullable: true - type: number - required: - - pricingModel - - pricingPerEvent - example: - apifyMarginPercentage: 6.84685269835264 - createdAt: 2000-01-23T04:56:07.000+00:00 - startedAt: 2000-01-23T04:56:07.000+00:00 - notifiedAboutFutureChangeAt: 2000-01-23T04:56:07.000+00:00 - notifiedAboutChangeAt: 2000-01-23T04:56:07.000+00:00 - reasonForChange: reasonForChange - isPriceChangeNotificationSuppressed: true - forceContainsSignificantPriceChange: true - pricingModel: PAY_PER_EVENT - pricingPerEvent: - actorChargeEvents: - key: - eventTitle: eventTitle - eventDescription: eventDescription - eventPriceUsd: 7.457744773683766 - eventTieredPricingUsd: - key: - tieredEventPriceUsd: 1.1730742509559433 - isPrimaryEvent: true - isOneTimeEvent: true - minimalMaxTotalChargeUsd: 4.965218492984954 - title: PayPerEventActorPricingInfo - TieredPricingPerDatasetItemEntry: - description: A single tier's price-per-dataset-item entry. - properties: - tieredPricePerUnitUsd: - description: Price per unit in USD for this tier. - type: number - required: - - tieredPricePerUnitUsd - title: TieredPricingPerDatasetItemEntry - TieredPricingPerDatasetItem: - additionalProperties: - $ref: "#/components/schemas/TieredPricingPerDatasetItemEntry" - description: | - Tiered price-per-dataset-item pricing, keyed by subscription tier (e.g. `FREE`, `BRONZE`, `SILVER`, `GOLD`, - `PLATINUM`, `DIAMOND`). The actual price applied to a run is resolved from the user's tier. - title: TieredPricingPerDatasetItem - PricePerDatasetItemActorPricingInfo: - allOf: - - $ref: "#/components/schemas/CommonActorPricingInfo" - - properties: - pricingModel: - enum: - - PRICE_PER_DATASET_ITEM - type: string - unitName: - description: Name of the unit that is being charged - type: string - pricePerUnitUsd: - description: | - Price per unit in USD. Mutually exclusive with `tieredPricing` - exactly one of the two is present - on a pricing record. - type: number - tieredPricing: - $ref: "#/components/schemas/TieredPricingPerDatasetItem" - required: - - pricingModel - - unitName - title: PricePerDatasetItemActorPricingInfo - FlatPricePerMonthActorPricingInfo: - allOf: - - $ref: "#/components/schemas/CommonActorPricingInfo" - - properties: - pricingModel: - enum: - - FLAT_PRICE_PER_MONTH - type: string - trialMinutes: - description: For how long this Actor can be used for free in trial period - type: integer - pricePerUnitUsd: - description: Monthly flat price in USD - type: number - required: - - pricePerUnitUsd - - pricingModel - - trialMinutes - title: FlatPricePerMonthActorPricingInfo - FreeActorPricingInfo: - allOf: - - $ref: "#/components/schemas/CommonActorPricingInfo" - - properties: - pricingModel: - enum: - - FREE - type: string - required: - - pricingModel - title: FreeActorPricingInfo - ActorRunPricingInfo: - discriminator: - mapping: - PAY_PER_EVENT: "#/components/schemas/PayPerEventActorPricingInfo" - PRICE_PER_DATASET_ITEM: "#/components/schemas/PricePerDatasetItemActorPricingInfo" - FLAT_PRICE_PER_MONTH: "#/components/schemas/FlatPricePerMonthActorPricingInfo" - FREE: "#/components/schemas/FreeActorPricingInfo" - propertyName: pricingModel - oneOf: - - $ref: "#/components/schemas/PayPerEventActorPricingInfo" - - $ref: "#/components/schemas/PricePerDatasetItemActorPricingInfo" - - $ref: "#/components/schemas/FlatPricePerMonthActorPricingInfo" - - $ref: "#/components/schemas/FreeActorPricingInfo" - title: ActorRunPricingInfo - ActorPermissionLevel: - description: | - Determines permissions that the Actor requires to run. For more information, see the [Actor permissions documentation](https://docs.apify.com/platform/actors/development/permissions). - enum: - - LIMITED_PERMISSIONS - - FULL_PERMISSIONS - type: string - DefaultRunOptions: - example: - build: build - timeoutSecs: 5 - memoryMbytes: 9 - restartOnError: true - maxItems: 9 - forcePermissionLevel: "" - properties: - build: - type: string - timeoutSecs: - type: integer - memoryMbytes: - type: integer - restartOnError: - type: boolean - maxItems: - nullable: true - type: integer - forcePermissionLevel: - allOf: - - $ref: "#/components/schemas/ActorPermissionLevel" - nullable: true - title: DefaultRunOptions - ActorStandby: - properties: - isEnabled: - nullable: true - type: boolean - desiredRequestsPerActorRun: - nullable: true - type: integer - maxRequestsPerActorRun: - nullable: true - type: integer - idleTimeoutSecs: - nullable: true - type: integer - build: - nullable: true - type: string - memoryMbytes: - nullable: true - type: integer - disableStandbyFieldsOverride: - nullable: true - type: boolean - shouldPassActorInput: - nullable: true - type: boolean - title: ActorStandby - ExampleRunInput: - properties: - body: - example: "{ \"helloWorld\": 123 }" - type: string - contentType: - type: string - title: ExampleRunInput - CreateActorRequest: - example: - name: name - description: description - title: title - isPublic: true - seoTitle: seoTitle - seoDescription: seoDescription - restartOnError: true - versions: - - versionNumber: versionNumber - sourceType: "" - envVars: - - name: name - value: value - isSecret: true - - name: name - value: value - isSecret: true - applyEnvVarsToBuild: true - buildTag: buildTag - sourceFiles: - - format: BASE64 - content: content - name: name - - format: BASE64 - content: content - name: name - gitRepoUrl: gitRepoUrl - tarballUrl: tarballUrl - gitHubGistUrl: gitHubGistUrl - - versionNumber: versionNumber - sourceType: "" - envVars: - - name: name - value: value - isSecret: true - - name: name - value: value - isSecret: true - applyEnvVarsToBuild: true - buildTag: buildTag - sourceFiles: - - format: BASE64 - content: content - name: name - - format: BASE64 - content: content - name: name - gitRepoUrl: gitRepoUrl - tarballUrl: tarballUrl - gitHubGistUrl: gitHubGistUrl - pricingInfos: - - apifyMarginPercentage: 6.84685269835264 - createdAt: 2000-01-23T04:56:07.000+00:00 - startedAt: 2000-01-23T04:56:07.000+00:00 - notifiedAboutFutureChangeAt: 2000-01-23T04:56:07.000+00:00 - notifiedAboutChangeAt: 2000-01-23T04:56:07.000+00:00 - reasonForChange: reasonForChange - isPriceChangeNotificationSuppressed: true - forceContainsSignificantPriceChange: true - pricingModel: PAY_PER_EVENT - pricingPerEvent: - actorChargeEvents: - key: - eventTitle: eventTitle - eventDescription: eventDescription - eventPriceUsd: 7.457744773683766 - eventTieredPricingUsd: - key: - tieredEventPriceUsd: 1.1730742509559433 - isPrimaryEvent: true - isOneTimeEvent: true - minimalMaxTotalChargeUsd: 4.965218492984954 - - apifyMarginPercentage: 6.84685269835264 - createdAt: 2000-01-23T04:56:07.000+00:00 - startedAt: 2000-01-23T04:56:07.000+00:00 - notifiedAboutFutureChangeAt: 2000-01-23T04:56:07.000+00:00 - notifiedAboutChangeAt: 2000-01-23T04:56:07.000+00:00 - reasonForChange: reasonForChange - isPriceChangeNotificationSuppressed: true - forceContainsSignificantPriceChange: true - pricingModel: PAY_PER_EVENT - pricingPerEvent: - actorChargeEvents: - key: - eventTitle: eventTitle - eventDescription: eventDescription - eventPriceUsd: 7.457744773683766 - eventTieredPricingUsd: - key: - tieredEventPriceUsd: 1.1730742509559433 - isPrimaryEvent: true - isOneTimeEvent: true - minimalMaxTotalChargeUsd: 4.965218492984954 - categories: - - categories - - categories - defaultRunOptions: - build: build - timeoutSecs: 5 - memoryMbytes: 9 - restartOnError: true - maxItems: 9 - forcePermissionLevel: "" - actorStandby: "" - exampleRunInput: "" - isDeprecated: true - properties: - name: - nullable: true - type: string - description: - nullable: true - type: string - title: - nullable: true - type: string - isPublic: - nullable: true - type: boolean - seoTitle: - nullable: true - type: string - seoDescription: - nullable: true - type: string - restartOnError: - deprecated: true - type: boolean - versions: - description: "" - items: - $ref: "#/components/schemas/Version" - nullable: true - type: array - default: null - pricingInfos: - items: - $ref: "#/components/schemas/ActorRunPricingInfo" - type: array - default: null - categories: - description: "" - items: - type: string - nullable: true - type: array - default: null - defaultRunOptions: - $ref: "#/components/schemas/DefaultRunOptions" - actorStandby: - allOf: - - $ref: "#/components/schemas/ActorStandby" - nullable: true - exampleRunInput: - allOf: - - $ref: "#/components/schemas/ExampleRunInput" - nullable: true - isDeprecated: - nullable: true - type: boolean - title: CreateActorRequest - TaggedBuildInfo: - description: Information about a tagged build. - properties: - buildId: - description: The ID of the build associated with this tag. - type: string - buildNumber: - description: The build number/version string. - pattern: "^([0-9]|[1-9][0-9])\\.([0-9]|[1-9][0-9])(\\.[1-9][0-9]{0,4})$" - type: string - buildNumberInt: - description: The build number encoded as a single integer. - type: integer - finishedAt: - description: The timestamp when the build finished. - format: date-time - nullable: true - type: string - title: TaggedBuildInfo - TaggedBuilds: - additionalProperties: - $ref: "#/components/schemas/TaggedBuilds_value" - description: "A dictionary mapping build tag names (e.g., \"latest\", \"beta\"\ - ) to their build information." - example: - latest: - buildId: z2EryhbfhgSyqj6Hn - buildNumber: 0.0.2 - finishedAt: 2019-06-10T11:15:49.286Z - beta: - buildId: abc123def456 - buildNumber: 1.0.5 - finishedAt: 2019-07-15T14:30:00.000Z - title: TaggedBuilds - Actor: - example: - id: id - userId: userId - name: name - username: username - description: description - restartOnError: true - isPublic: true - actorPermissionLevel: LIMITED_PERMISSIONS - createdAt: 2000-01-23T04:56:07.000+00:00 - modifiedAt: 2000-01-23T04:56:07.000+00:00 - stats: - totalBuilds: 0 - totalRuns: 6 - totalUsers: 1 - totalUsers7Days: 5 - totalUsers30Days: 5 - totalUsers90Days: 2 - totalMetamorphs: 7 - lastRunStartedAt: 2000-01-23T04:56:07.000+00:00 - actorReviewCount: 9 - actorReviewRating: 3.616076749251911 - bookmarkCount: 2 - publicActorRunStats30Days: - ABORTED: 4 - FAILED: 7 - SUCCEEDED: 1 - TIMED-OUT: 1 - TOTAL: 1 - versions: - - versionNumber: versionNumber - sourceType: "" - envVars: - - name: name - value: value - isSecret: true - - name: name - value: value - isSecret: true - applyEnvVarsToBuild: true - buildTag: buildTag - sourceFiles: - - format: BASE64 - content: content - name: name - - format: BASE64 - content: content - name: name - gitRepoUrl: gitRepoUrl - tarballUrl: tarballUrl - gitHubGistUrl: gitHubGistUrl - - versionNumber: versionNumber - sourceType: "" - envVars: - - name: name - value: value - isSecret: true - - name: name - value: value - isSecret: true - applyEnvVarsToBuild: true - buildTag: buildTag - sourceFiles: - - format: BASE64 - content: content - name: name - - format: BASE64 - content: content - name: name - gitRepoUrl: gitRepoUrl - tarballUrl: tarballUrl - gitHubGistUrl: gitHubGistUrl - pricingInfos: - - apifyMarginPercentage: 6.84685269835264 - createdAt: 2000-01-23T04:56:07.000+00:00 - startedAt: 2000-01-23T04:56:07.000+00:00 - notifiedAboutFutureChangeAt: 2000-01-23T04:56:07.000+00:00 - notifiedAboutChangeAt: 2000-01-23T04:56:07.000+00:00 - reasonForChange: reasonForChange - isPriceChangeNotificationSuppressed: true - forceContainsSignificantPriceChange: true - pricingModel: PAY_PER_EVENT - pricingPerEvent: - actorChargeEvents: - key: - eventTitle: eventTitle - eventDescription: eventDescription - eventPriceUsd: 7.457744773683766 - eventTieredPricingUsd: - key: - tieredEventPriceUsd: 1.1730742509559433 - isPrimaryEvent: true - isOneTimeEvent: true - minimalMaxTotalChargeUsd: 4.965218492984954 - - apifyMarginPercentage: 6.84685269835264 - createdAt: 2000-01-23T04:56:07.000+00:00 - startedAt: 2000-01-23T04:56:07.000+00:00 - notifiedAboutFutureChangeAt: 2000-01-23T04:56:07.000+00:00 - notifiedAboutChangeAt: 2000-01-23T04:56:07.000+00:00 - reasonForChange: reasonForChange - isPriceChangeNotificationSuppressed: true - forceContainsSignificantPriceChange: true - pricingModel: PAY_PER_EVENT - pricingPerEvent: - actorChargeEvents: - key: - eventTitle: eventTitle - eventDescription: eventDescription - eventPriceUsd: 7.457744773683766 - eventTieredPricingUsd: - key: - tieredEventPriceUsd: 1.1730742509559433 - isPrimaryEvent: true - isOneTimeEvent: true - minimalMaxTotalChargeUsd: 4.965218492984954 - defaultRunOptions: - build: build - timeoutSecs: 5 - memoryMbytes: 9 - restartOnError: true - maxItems: 9 - forcePermissionLevel: "" - exampleRunInput: "" - isDeprecated: true - deploymentKey: deploymentKey - title: title - taggedBuilds: "" - actorStandby: "" - readmeSummary: readmeSummary - seoTitle: seoTitle - seoDescription: seoDescription - pictureUrl: pictureUrl - standbyUrl: standbyUrl - notice: notice - categories: - - categories - - categories - isCritical: true - isGeneric: true - isSourceCodeHidden: true - hasNoDataset: true - properties: - id: - type: string - userId: - type: string - name: - type: string - username: - type: string - description: - nullable: true - type: string - restartOnError: - deprecated: true - type: boolean - isPublic: - type: boolean - actorPermissionLevel: - $ref: "#/components/schemas/ActorPermissionLevel" - createdAt: - format: date-time - type: string - modifiedAt: - format: date-time - type: string - stats: - $ref: "#/components/schemas/ActorStats" - versions: - description: "" - items: - $ref: "#/components/schemas/Version" - type: array - default: null - pricingInfos: - items: - $ref: "#/components/schemas/ActorRunPricingInfo" - type: array - default: null - defaultRunOptions: - $ref: "#/components/schemas/DefaultRunOptions" - exampleRunInput: - allOf: - - $ref: "#/components/schemas/ExampleRunInput" - nullable: true - isDeprecated: - nullable: true - type: boolean - deploymentKey: - type: string - title: - nullable: true - type: string - taggedBuilds: - allOf: - - $ref: "#/components/schemas/TaggedBuilds" - nullable: true - actorStandby: - allOf: - - $ref: "#/components/schemas/ActorStandby" - nullable: true - readmeSummary: - description: "A brief, LLM-generated readme summary" - type: string - seoTitle: - nullable: true - type: string - seoDescription: - nullable: true - type: string - pictureUrl: - nullable: true - type: string - standbyUrl: - nullable: true - type: string - notice: - type: string - categories: - items: - type: string - type: array - default: null - isCritical: - type: boolean - isGeneric: - type: boolean - isSourceCodeHidden: - type: boolean - hasNoDataset: - type: boolean - required: - - createdAt - - defaultRunOptions - - id - - isPublic - - modifiedAt - - name - - stats - - userId - - username - - versions - title: Actor - ActorResponse: - description: Response containing Actor data. - example: - data: - id: id - userId: userId - name: name - username: username - description: description - restartOnError: true - isPublic: true - actorPermissionLevel: LIMITED_PERMISSIONS - createdAt: 2000-01-23T04:56:07.000+00:00 - modifiedAt: 2000-01-23T04:56:07.000+00:00 - stats: - totalBuilds: 0 - totalRuns: 6 - totalUsers: 1 - totalUsers7Days: 5 - totalUsers30Days: 5 - totalUsers90Days: 2 - totalMetamorphs: 7 - lastRunStartedAt: 2000-01-23T04:56:07.000+00:00 - actorReviewCount: 9 - actorReviewRating: 3.616076749251911 - bookmarkCount: 2 - publicActorRunStats30Days: - ABORTED: 4 - FAILED: 7 - SUCCEEDED: 1 - TIMED-OUT: 1 - TOTAL: 1 - versions: - - versionNumber: versionNumber - sourceType: "" - envVars: - - name: name - value: value - isSecret: true - - name: name - value: value - isSecret: true - applyEnvVarsToBuild: true - buildTag: buildTag - sourceFiles: - - format: BASE64 - content: content - name: name - - format: BASE64 - content: content - name: name - gitRepoUrl: gitRepoUrl - tarballUrl: tarballUrl - gitHubGistUrl: gitHubGistUrl - - versionNumber: versionNumber - sourceType: "" - envVars: - - name: name - value: value - isSecret: true - - name: name - value: value - isSecret: true - applyEnvVarsToBuild: true - buildTag: buildTag - sourceFiles: - - format: BASE64 - content: content - name: name - - format: BASE64 - content: content - name: name - gitRepoUrl: gitRepoUrl - tarballUrl: tarballUrl - gitHubGistUrl: gitHubGistUrl - pricingInfos: - - apifyMarginPercentage: 6.84685269835264 - createdAt: 2000-01-23T04:56:07.000+00:00 - startedAt: 2000-01-23T04:56:07.000+00:00 - notifiedAboutFutureChangeAt: 2000-01-23T04:56:07.000+00:00 - notifiedAboutChangeAt: 2000-01-23T04:56:07.000+00:00 - reasonForChange: reasonForChange - isPriceChangeNotificationSuppressed: true - forceContainsSignificantPriceChange: true - pricingModel: PAY_PER_EVENT - pricingPerEvent: - actorChargeEvents: - key: - eventTitle: eventTitle - eventDescription: eventDescription - eventPriceUsd: 7.457744773683766 - eventTieredPricingUsd: - key: - tieredEventPriceUsd: 1.1730742509559433 - isPrimaryEvent: true - isOneTimeEvent: true - minimalMaxTotalChargeUsd: 4.965218492984954 - - apifyMarginPercentage: 6.84685269835264 - createdAt: 2000-01-23T04:56:07.000+00:00 - startedAt: 2000-01-23T04:56:07.000+00:00 - notifiedAboutFutureChangeAt: 2000-01-23T04:56:07.000+00:00 - notifiedAboutChangeAt: 2000-01-23T04:56:07.000+00:00 - reasonForChange: reasonForChange - isPriceChangeNotificationSuppressed: true - forceContainsSignificantPriceChange: true - pricingModel: PAY_PER_EVENT - pricingPerEvent: - actorChargeEvents: - key: - eventTitle: eventTitle - eventDescription: eventDescription - eventPriceUsd: 7.457744773683766 - eventTieredPricingUsd: - key: - tieredEventPriceUsd: 1.1730742509559433 - isPrimaryEvent: true - isOneTimeEvent: true - minimalMaxTotalChargeUsd: 4.965218492984954 - defaultRunOptions: - build: build - timeoutSecs: 5 - memoryMbytes: 9 - restartOnError: true - maxItems: 9 - forcePermissionLevel: "" - exampleRunInput: "" - isDeprecated: true - deploymentKey: deploymentKey - title: title - taggedBuilds: "" - actorStandby: "" - readmeSummary: readmeSummary - seoTitle: seoTitle - seoDescription: seoDescription - pictureUrl: pictureUrl - standbyUrl: standbyUrl - notice: notice - categories: - - categories - - categories - isCritical: true - isGeneric: true - isSourceCodeHidden: true - hasNoDataset: true - properties: - data: - $ref: "#/components/schemas/Actor" - required: - - data - title: ActorResponse - EnvVarRequest: - allOf: - - $ref: "#/components/schemas/EnvVar" - example: - name: name - value: value - isSecret: true - title: EnvVarRequest - CreateOrUpdateVersionRequest: - example: - versionNumber: versionNumber - sourceType: "" - envVars: - - name: name - value: value - isSecret: true - - name: name - value: value - isSecret: true - applyEnvVarsToBuild: true - buildTag: buildTag - sourceFiles: - - format: BASE64 - content: content - name: name - - format: BASE64 - content: content - name: name - gitRepoUrl: gitRepoUrl - tarballUrl: tarballUrl - gitHubGistUrl: gitHubGistUrl - properties: - versionNumber: - nullable: true - pattern: "^([0-9]|[1-9][0-9])\\.([0-9]|[1-9][0-9])$" - type: string - sourceType: - allOf: - - $ref: "#/components/schemas/VersionSourceType" - nullable: true - envVars: - description: "" - items: - $ref: "#/components/schemas/EnvVarRequest" - nullable: true - type: array - default: null - applyEnvVarsToBuild: - nullable: true - type: boolean - buildTag: - nullable: true - type: string - sourceFiles: - items: - $ref: "#/components/schemas/VersionSourceFiles_inner" - title: VersionSourceFiles - type: array - default: null - gitRepoUrl: - description: URL of the Git repository when sourceType is GIT_REPO. - nullable: true - type: string - tarballUrl: - description: URL of the tarball when sourceType is TARBALL. - nullable: true - type: string - gitHubGistUrl: - description: URL of the GitHub Gist when sourceType is GITHUB_GIST. - nullable: true - type: string - title: CreateOrUpdateVersionRequest - BuildTag: - properties: - buildId: - type: string - required: - - buildId - title: BuildTag - UpdateActorRequest: - example: - name: name - description: description - isPublic: true - actorPermissionLevel: "" - seoTitle: seoTitle - seoDescription: seoDescription - title: title - restartOnError: true - versions: - - versionNumber: versionNumber - sourceType: "" - envVars: - - name: name - value: value - isSecret: true - - name: name - value: value - isSecret: true - applyEnvVarsToBuild: true - buildTag: buildTag - sourceFiles: - - format: BASE64 - content: content - name: name - - format: BASE64 - content: content - name: name - gitRepoUrl: gitRepoUrl - tarballUrl: tarballUrl - gitHubGistUrl: gitHubGistUrl - - versionNumber: versionNumber - sourceType: "" - envVars: - - name: name - value: value - isSecret: true - - name: name - value: value - isSecret: true - applyEnvVarsToBuild: true - buildTag: buildTag - sourceFiles: - - format: BASE64 - content: content - name: name - - format: BASE64 - content: content - name: name - gitRepoUrl: gitRepoUrl - tarballUrl: tarballUrl - gitHubGistUrl: gitHubGistUrl - pricingInfos: - - apifyMarginPercentage: 6.84685269835264 - createdAt: 2000-01-23T04:56:07.000+00:00 - startedAt: 2000-01-23T04:56:07.000+00:00 - notifiedAboutFutureChangeAt: 2000-01-23T04:56:07.000+00:00 - notifiedAboutChangeAt: 2000-01-23T04:56:07.000+00:00 - reasonForChange: reasonForChange - isPriceChangeNotificationSuppressed: true - forceContainsSignificantPriceChange: true - pricingModel: PAY_PER_EVENT - pricingPerEvent: - actorChargeEvents: - key: - eventTitle: eventTitle - eventDescription: eventDescription - eventPriceUsd: 7.457744773683766 - eventTieredPricingUsd: - key: - tieredEventPriceUsd: 1.1730742509559433 - isPrimaryEvent: true - isOneTimeEvent: true - minimalMaxTotalChargeUsd: 4.965218492984954 - - apifyMarginPercentage: 6.84685269835264 - createdAt: 2000-01-23T04:56:07.000+00:00 - startedAt: 2000-01-23T04:56:07.000+00:00 - notifiedAboutFutureChangeAt: 2000-01-23T04:56:07.000+00:00 - notifiedAboutChangeAt: 2000-01-23T04:56:07.000+00:00 - reasonForChange: reasonForChange - isPriceChangeNotificationSuppressed: true - forceContainsSignificantPriceChange: true - pricingModel: PAY_PER_EVENT - pricingPerEvent: - actorChargeEvents: - key: - eventTitle: eventTitle - eventDescription: eventDescription - eventPriceUsd: 7.457744773683766 - eventTieredPricingUsd: - key: - tieredEventPriceUsd: 1.1730742509559433 - isPrimaryEvent: true - isOneTimeEvent: true - minimalMaxTotalChargeUsd: 4.965218492984954 - categories: - - categories - - categories - defaultRunOptions: "" - taggedBuilds: - latest: - buildId: z2EryhbfhgSyqj6Hn - beta: null - actorStandby: "" - exampleRunInput: "" - isDeprecated: true - properties: - name: - type: string - description: - nullable: true - type: string - isPublic: - type: boolean - actorPermissionLevel: - allOf: - - $ref: "#/components/schemas/ActorPermissionLevel" - nullable: true - seoTitle: - nullable: true - type: string - seoDescription: - nullable: true - type: string - title: - nullable: true - type: string - restartOnError: - deprecated: true - type: boolean - versions: - description: "" - items: - $ref: "#/components/schemas/CreateOrUpdateVersionRequest" - type: array - default: null - pricingInfos: - items: - $ref: "#/components/schemas/ActorRunPricingInfo" - type: array - default: null - categories: - description: "" - items: - type: string - nullable: true - type: array - default: null - defaultRunOptions: - allOf: - - $ref: "#/components/schemas/DefaultRunOptions" - nullable: true - taggedBuilds: - additionalProperties: - $ref: "#/components/schemas/BuildTag" - description: | - An object to modify tags on the Actor's builds. The key is the tag name (e.g., _latest_), and the value is either an object with a `buildId` or `null`. - - This operation is a patch; any existing tags that you omit from this object will be preserved. - - - **To create or reassign a tag**, provide the tag name with a `buildId`. e.g., to assign the _latest_ tag: - -   - - ```json - { - "latest": { - "buildId": "z2EryhbfhgSyqj6Hn" - } - } - ``` - - - **To remove a tag**, provide the tag name with a `null` value. e.g., to remove the _beta_ tag: - -   - - ```json - { - "beta": null - } - ``` - - - **To perform multiple operations**, combine them. The following reassigns _latest_ and removes _beta_, while preserving any other existing tags. - -   - - ```json - { - "latest": { - "buildId": "z2EryhbfhgSyqj6Hn" - }, - "beta": null - } - ``` - example: - latest: - buildId: z2EryhbfhgSyqj6Hn - beta: null - actorStandby: - allOf: - - $ref: "#/components/schemas/ActorStandby" - nullable: true - exampleRunInput: - allOf: - - $ref: "#/components/schemas/ExampleRunInput" - nullable: true - isDeprecated: - nullable: true - type: boolean - title: UpdateActorRequest - ListOfVersions: - example: - total: 0 - items: - - versionNumber: versionNumber - sourceType: "" - envVars: - - name: name - value: value - isSecret: true - - name: name - value: value - isSecret: true - applyEnvVarsToBuild: true - buildTag: buildTag - sourceFiles: - - format: BASE64 - content: content - name: name - - format: BASE64 - content: content - name: name - gitRepoUrl: gitRepoUrl - tarballUrl: tarballUrl - gitHubGistUrl: gitHubGistUrl - - versionNumber: versionNumber - sourceType: "" - envVars: - - name: name - value: value - isSecret: true - - name: name - value: value - isSecret: true - applyEnvVarsToBuild: true - buildTag: buildTag - sourceFiles: - - format: BASE64 - content: content - name: name - - format: BASE64 - content: content - name: name - gitRepoUrl: gitRepoUrl - tarballUrl: tarballUrl - gitHubGistUrl: gitHubGistUrl - properties: - total: - type: integer - items: - description: "" - items: - $ref: "#/components/schemas/Version" - type: array - default: null - required: - - items - - total - title: ListOfVersions - ListOfVersionsResponse: - example: - data: - total: 0 - items: - - versionNumber: versionNumber - sourceType: "" - envVars: - - name: name - value: value - isSecret: true - - name: name - value: value - isSecret: true - applyEnvVarsToBuild: true - buildTag: buildTag - sourceFiles: - - format: BASE64 - content: content - name: name - - format: BASE64 - content: content - name: name - gitRepoUrl: gitRepoUrl - tarballUrl: tarballUrl - gitHubGistUrl: gitHubGistUrl - - versionNumber: versionNumber - sourceType: "" - envVars: - - name: name - value: value - isSecret: true - - name: name - value: value - isSecret: true - applyEnvVarsToBuild: true - buildTag: buildTag - sourceFiles: - - format: BASE64 - content: content - name: name - - format: BASE64 - content: content - name: name - gitRepoUrl: gitRepoUrl - tarballUrl: tarballUrl - gitHubGistUrl: gitHubGistUrl - properties: - data: - $ref: "#/components/schemas/ListOfVersions" - required: - - data - title: ListOfVersionsResponse - VersionResponse: - example: - data: - versionNumber: versionNumber - sourceType: "" - envVars: - - name: name - value: value - isSecret: true - - name: name - value: value - isSecret: true - applyEnvVarsToBuild: true - buildTag: buildTag - sourceFiles: - - format: BASE64 - content: content - name: name - - format: BASE64 - content: content - name: name - gitRepoUrl: gitRepoUrl - tarballUrl: tarballUrl - gitHubGistUrl: gitHubGistUrl - properties: - data: - $ref: "#/components/schemas/Version" - required: - - data - title: VersionResponse - ListOfEnvVars: - example: - total: 0 - items: - - name: name - value: value - isSecret: true - - name: name - value: value - isSecret: true - properties: - total: - type: integer - items: - description: "" - items: - $ref: "#/components/schemas/EnvVar" - type: array - default: null - required: - - items - - total - title: ListOfEnvVars - ListOfEnvVarsResponse: - example: - data: - total: 0 - items: - - name: name - value: value - isSecret: true - - name: name - value: value - isSecret: true - properties: - data: - $ref: "#/components/schemas/ListOfEnvVars" - required: - - data - title: ListOfEnvVarsResponse - EnvVarResponse: - example: - data: - name: name - value: value - isSecret: true - properties: - data: - $ref: "#/components/schemas/EnvVar" - required: - - data - title: EnvVarResponse - WebhookEventType: - description: Type of event that triggers the webhook. - enum: - - ACTOR.BUILD.ABORTED - - ACTOR.BUILD.CREATED - - ACTOR.BUILD.FAILED - - ACTOR.BUILD.SUCCEEDED - - ACTOR.BUILD.TIMED_OUT - - ACTOR.RUN.ABORTED - - ACTOR.RUN.CREATED - - ACTOR.RUN.FAILED - - ACTOR.RUN.RESURRECTED - - ACTOR.RUN.SUCCEEDED - - ACTOR.RUN.TIMED_OUT - - TEST - title: WebhookEventType - type: string - WebhookCondition: - example: - actorId: actorId - actorTaskId: actorTaskId - actorRunId: actorRunId - properties: - actorId: - nullable: true - type: string - actorTaskId: - nullable: true - type: string - actorRunId: - nullable: true - type: string - title: WebhookCondition - WebhookDispatchStatus: - description: Status of the webhook dispatch indicating whether the HTTP request - was successful. - enum: - - ACTIVE - - SUCCEEDED - - FAILED - title: WebhookDispatchStatus - type: string - ExampleWebhookDispatch: - properties: - status: - $ref: "#/components/schemas/WebhookDispatchStatus" - finishedAt: - format: date-time - nullable: true - type: string - removedAt: - format: date-time - nullable: true - type: string - required: - - status - title: ExampleWebhookDispatch - WebhookStats: - properties: - totalDispatches: - type: integer - required: - - totalDispatches - title: WebhookStats - WebhookShort: - example: - id: id - createdAt: 2000-01-23T04:56:07.000+00:00 - modifiedAt: 2000-01-23T04:56:07.000+00:00 - userId: userId - isAdHoc: true - isApifyIntegration: true - isEnabled: true - actionType: actionType - shouldInterpolateStrings: true - eventTypes: - - ACTOR.BUILD.ABORTED - - ACTOR.BUILD.ABORTED - condition: - actorId: actorId - actorTaskId: actorTaskId - actorRunId: actorRunId - ignoreSslErrors: true - doNotRetry: true - requestUrl: https://openapi-generator.tech - lastDispatch: "" - stats: "" - properties: - id: - type: string - createdAt: - format: date-time - type: string - modifiedAt: - format: date-time - type: string - userId: - type: string - isAdHoc: - nullable: true - type: boolean - isApifyIntegration: - type: boolean - isEnabled: - type: boolean - actionType: - type: string - shouldInterpolateStrings: - nullable: true - type: boolean - eventTypes: - items: - $ref: "#/components/schemas/WebhookEventType" - type: array - default: null - condition: - $ref: "#/components/schemas/WebhookCondition" - ignoreSslErrors: - type: boolean - doNotRetry: - type: boolean - requestUrl: - format: uri - type: string - lastDispatch: - allOf: - - $ref: "#/components/schemas/ExampleWebhookDispatch" - nullable: true - stats: - allOf: - - $ref: "#/components/schemas/WebhookStats" - nullable: true - required: - - condition - - createdAt - - doNotRetry - - eventTypes - - id - - ignoreSslErrors - - modifiedAt - - requestUrl - - userId - title: WebhookShort - ListOfWebhooks: - allOf: - - $ref: "#/components/schemas/PaginationResponse" - - properties: - items: - items: - $ref: "#/components/schemas/WebhookShort" - type: array - default: null - required: - - items - example: - total: 0 - offset: 0 - limit: 1 - desc: true - count: 0 - items: - - id: id - createdAt: 2000-01-23T04:56:07.000+00:00 - modifiedAt: 2000-01-23T04:56:07.000+00:00 - userId: userId - isAdHoc: true - isApifyIntegration: true - isEnabled: true - actionType: actionType - shouldInterpolateStrings: true - eventTypes: - - ACTOR.BUILD.ABORTED - - ACTOR.BUILD.ABORTED - condition: - actorId: actorId - actorTaskId: actorTaskId - actorRunId: actorRunId - ignoreSslErrors: true - doNotRetry: true - requestUrl: https://openapi-generator.tech - lastDispatch: "" - stats: "" - - id: id - createdAt: 2000-01-23T04:56:07.000+00:00 - modifiedAt: 2000-01-23T04:56:07.000+00:00 - userId: userId - isAdHoc: true - isApifyIntegration: true - isEnabled: true - actionType: actionType - shouldInterpolateStrings: true - eventTypes: - - ACTOR.BUILD.ABORTED - - ACTOR.BUILD.ABORTED - condition: - actorId: actorId - actorTaskId: actorTaskId - actorRunId: actorRunId - ignoreSslErrors: true - doNotRetry: true - requestUrl: https://openapi-generator.tech - lastDispatch: "" - stats: "" - title: ListOfWebhooks - ListOfWebhooksResponse: - example: - data: - total: 0 - offset: 0 - limit: 1 - desc: true - count: 0 - items: - - id: id - createdAt: 2000-01-23T04:56:07.000+00:00 - modifiedAt: 2000-01-23T04:56:07.000+00:00 - userId: userId - isAdHoc: true - isApifyIntegration: true - isEnabled: true - actionType: actionType - shouldInterpolateStrings: true - eventTypes: - - ACTOR.BUILD.ABORTED - - ACTOR.BUILD.ABORTED - condition: - actorId: actorId - actorTaskId: actorTaskId - actorRunId: actorRunId - ignoreSslErrors: true - doNotRetry: true - requestUrl: https://openapi-generator.tech - lastDispatch: "" - stats: "" - - id: id - createdAt: 2000-01-23T04:56:07.000+00:00 - modifiedAt: 2000-01-23T04:56:07.000+00:00 - userId: userId - isAdHoc: true - isApifyIntegration: true - isEnabled: true - actionType: actionType - shouldInterpolateStrings: true - eventTypes: - - ACTOR.BUILD.ABORTED - - ACTOR.BUILD.ABORTED - condition: - actorId: actorId - actorTaskId: actorTaskId - actorRunId: actorRunId - ignoreSslErrors: true - doNotRetry: true - requestUrl: https://openapi-generator.tech - lastDispatch: "" - stats: "" - properties: - data: - $ref: "#/components/schemas/ListOfWebhooks" - required: - - data - title: ListOfWebhooksResponse - ActorJobStatus: - description: Status of an Actor job (run or build). - enum: - - READY - - RUNNING - - SUCCEEDED - - FAILED - - TIMING-OUT - - TIMED-OUT - - ABORTING - - ABORTED - title: ActorJobStatus - type: string - RunOrigin: - enum: - - DEVELOPMENT - - WEB - - API - - SCHEDULER - - TEST - - WEBHOOK - - ACTOR - - CLI - - CI - - STANDBY - title: RunOrigin - type: string - BuildsMeta: - example: - origin: DEVELOPMENT - clientIp: clientIp - userAgent: userAgent - properties: - origin: - $ref: "#/components/schemas/RunOrigin" - clientIp: - description: IP address of the client that started the build. - type: string - userAgent: - description: User agent of the client that started the build. - type: string - required: - - origin - title: BuildsMeta - BuildShort: - example: - id: id - actId: actId - userId: userId - status: READY - startedAt: 2000-01-23T04:56:07.000+00:00 - finishedAt: 2000-01-23T04:56:07.000+00:00 - usageTotalUsd: 5.637376656633329 - buildNumber: buildNumber - buildNumberInt: 2 - meta: - origin: DEVELOPMENT - clientIp: clientIp - userAgent: userAgent - properties: - id: - type: string - actId: - type: string - userId: - type: string - status: - $ref: "#/components/schemas/ActorJobStatus" - startedAt: - format: date-time - type: string - finishedAt: - format: date-time - nullable: true - type: string - usageTotalUsd: - type: number - buildNumber: - pattern: "^([0-9]|[1-9][0-9])\\.([0-9]|[1-9][0-9])(\\.[1-9][0-9]{0,4})$" - type: string - buildNumberInt: - type: integer - meta: - $ref: "#/components/schemas/BuildsMeta" - required: - - buildNumber - - id - - startedAt - - status - - usageTotalUsd - title: BuildShort - ListOfBuilds: - allOf: - - $ref: "#/components/schemas/PaginationResponse" - - properties: - items: - items: - $ref: "#/components/schemas/BuildShort" - type: array - default: null - required: - - items - example: - total: 0 - offset: 0 - limit: 1 - desc: true - count: 0 - items: - - id: id - actId: actId - userId: userId - status: READY - startedAt: 2000-01-23T04:56:07.000+00:00 - finishedAt: 2000-01-23T04:56:07.000+00:00 - usageTotalUsd: 5.637376656633329 - buildNumber: buildNumber - buildNumberInt: 2 - meta: - origin: DEVELOPMENT - clientIp: clientIp - userAgent: userAgent - - id: id - actId: actId - userId: userId - status: READY - startedAt: 2000-01-23T04:56:07.000+00:00 - finishedAt: 2000-01-23T04:56:07.000+00:00 - usageTotalUsd: 5.637376656633329 - buildNumber: buildNumber - buildNumberInt: 2 - meta: - origin: DEVELOPMENT - clientIp: clientIp - userAgent: userAgent - title: ListOfBuilds - ListOfBuildsResponse: - example: - data: - total: 0 - offset: 0 - limit: 1 - desc: true - count: 0 - items: - - id: id - actId: actId - userId: userId - status: READY - startedAt: 2000-01-23T04:56:07.000+00:00 - finishedAt: 2000-01-23T04:56:07.000+00:00 - usageTotalUsd: 5.637376656633329 - buildNumber: buildNumber - buildNumberInt: 2 - meta: - origin: DEVELOPMENT - clientIp: clientIp - userAgent: userAgent - - id: id - actId: actId - userId: userId - status: READY - startedAt: 2000-01-23T04:56:07.000+00:00 - finishedAt: 2000-01-23T04:56:07.000+00:00 - usageTotalUsd: 5.637376656633329 - buildNumber: buildNumber - buildNumberInt: 2 - meta: - origin: DEVELOPMENT - clientIp: clientIp - userAgent: userAgent - properties: - data: - $ref: "#/components/schemas/ListOfBuilds" - required: - - data - title: ListOfBuildsResponse - BuildStats: - properties: - durationMillis: - type: integer - runTimeSecs: - type: number - computeUnits: - type: number - imageSizeBytes: - type: integer - required: - - computeUnits - title: BuildStats - BuildOptions: - properties: - useCache: - nullable: true - type: boolean - betaPackages: - nullable: true - type: boolean - memoryMbytes: - nullable: true - type: integer - diskMbytes: - nullable: true - type: integer - title: BuildOptions - BuildUsage: - properties: - ACTOR_COMPUTE_UNITS: - nullable: true - type: number - title: BuildUsage - ActorDefinition: - description: "The definition of the Actor, the full specification of this field\ - \ can be found in [Apify docs](https://docs.apify.com/platform/actors/development/actor-definition/actor-json)" - properties: - actorSpecification: - description: The Actor specification version that this Actor follows. This - property must be set to 1. - enum: - - 1 - type: integer - name: - description: The name of the Actor. - type: string - version: - description: "The version of the Actor, typically a dot-separated sequence\ - \ of numbers (e.g., `0.1`, `1.0`, or `0.0.1`)." - pattern: "^[0-9]+(\\.[0-9]+)+$" - type: string - buildTag: - description: The tag name to be applied to a successful build of the Actor. - Defaults to 'latest' if not specified. - type: string - environmentVariables: - additionalProperties: - type: string - description: A map of environment variables to be used during local development - and deployment. - dockerfile: - description: The path to the Dockerfile used for building the Actor on the - platform. - type: string - dockerContextDir: - description: The path to the directory used as the Docker context when building - the Actor. - type: string - readme: - description: The path to the README file for the Actor. - type: string - input: - description: "The input schema object, the full specification can be found\ - \ in [Apify docs](https://docs.apify.com/platform/actors/development/actor-definition/input-schema)" - type: object - changelog: - description: The path to the CHANGELOG file displayed in the Actor's information - tab. - type: string - storages: - $ref: "#/components/schemas/ActorDefinition_storages" - defaultMemoryMbytes: - $ref: "#/components/schemas/ActorDefinition_defaultMemoryMbytes" - minMemoryMbytes: - description: Specifies the minimum amount of memory in megabytes required - by the Actor. - minimum: 128 - type: integer - maxMemoryMbytes: - description: Specifies the maximum amount of memory in megabytes required - by the Actor. - minimum: 128 - type: integer - usesStandbyMode: - description: Specifies whether Standby mode is enabled for the Actor. - type: boolean - title: ActorDefinition - Build: - example: - id: HG7ML7M8z78YcAPEB - actId: janedoe~my-actor - userId: klmdEpoiojmdEMlk3 - startedAt: 2019-11-30T07:34:24.202Z - finishedAt: 2019-12-12T09:30:12.202Z - status: SUCCEEDED - meta: - origin: WEB - clientIp: 172.234.12.34 - userAgent: Mozilla/5.0 (iPad) - stats: - durationMillis: 1000 - runTimeSecs: 45.718 - computeUnits: 0.012699444444444444 - options: - useCache: false - betaPackages: false - memoryMbytes: 1024 - diskMbytes: 2048 - usage: - ACTOR_COMPUTE_UNITS: 0.08 - usageTotalUsd: 0.02 - usageUsd: - ACTOR_COMPUTE_UNITS: 0.02 - inputSchema: "{\\n \"title\": \"Schema for ...\"}" - readme: "# Magic Actor\\nThis Actor is magic." - buildNumber: 0.1.1 - actorDefinition: - actorSpecification: 1 - name: example-actor - version: "1.0" - buildTag: latest - environmentVariables: - DEBUG_MODE: "false" - input: - type: object - properties: - prompt: - type: string - description: The text prompt to generate completions for. - maxTokens: - type: integer - description: The maximum number of tokens to generate. - required: - - prompt - storages: - dataset: - type: object - $schema: http://json-schema.org/draft-07/schema# - properties: - id: - type: string - description: Unique identifier for the generated text. - text: - type: string - description: The generated text output from the model. - required: - - id - - text - minMemoryMbytes: 512 - maxMemoryMbytes: 2048 - usesStandbyMode: false - properties: - id: - type: string - actId: - type: string - userId: - type: string - startedAt: - format: date-time - type: string - finishedAt: - format: date-time - nullable: true - type: string - status: - $ref: "#/components/schemas/ActorJobStatus" - meta: - $ref: "#/components/schemas/BuildsMeta" - stats: - allOf: - - $ref: "#/components/schemas/BuildStats" - nullable: true - options: - allOf: - - $ref: "#/components/schemas/BuildOptions" - nullable: true - usage: - allOf: - - $ref: "#/components/schemas/BuildUsage" - nullable: true - usageTotalUsd: - description: Total cost in USD for this build. Requires authentication token - to access. - nullable: true - type: number - usageUsd: - allOf: - - $ref: "#/components/schemas/BuildUsage" - description: Platform usage costs breakdown in USD for this build. Requires - authentication token to access. - nullable: true - inputSchema: - deprecated: true - nullable: true - type: string - readme: - deprecated: true - nullable: true - type: string - buildNumber: - pattern: "^([0-9]|[1-9][0-9])\\.([0-9]|[1-9][0-9])(\\.[1-9][0-9]{0,4})$" - type: string - actVersion: - $ref: "#/components/schemas/BuildActVersion" - actorDefinition: - allOf: - - $ref: "#/components/schemas/ActorDefinition" - nullable: true - required: - - actId - - buildNumber - - id - - meta - - startedAt - - status - - userId - title: Build - BuildResponse: - description: Response containing Actor build data. - example: - data: - id: HG7ML7M8z78YcAPEB - actId: janedoe~my-actor - userId: klmdEpoiojmdEMlk3 - startedAt: 2019-11-30T07:34:24.202Z - finishedAt: 2019-12-12T09:30:12.202Z - status: SUCCEEDED - meta: - origin: WEB - clientIp: 172.234.12.34 - userAgent: Mozilla/5.0 (iPad) - stats: - durationMillis: 1000 - runTimeSecs: 45.718 - computeUnits: 0.012699444444444444 - options: - useCache: false - betaPackages: false - memoryMbytes: 1024 - diskMbytes: 2048 - usage: - ACTOR_COMPUTE_UNITS: 0.08 - usageTotalUsd: 0.02 - usageUsd: - ACTOR_COMPUTE_UNITS: 0.02 - inputSchema: "{\\n \"title\": \"Schema for ...\"}" - readme: "# Magic Actor\\nThis Actor is magic." - buildNumber: 0.1.1 - actorDefinition: - actorSpecification: 1 - name: example-actor - version: "1.0" - buildTag: latest - environmentVariables: - DEBUG_MODE: "false" - input: - type: object - properties: - prompt: - type: string - description: The text prompt to generate completions for. - maxTokens: - type: integer - description: The maximum number of tokens to generate. - required: - - prompt - storages: - dataset: - type: object - $schema: http://json-schema.org/draft-07/schema# - properties: - id: - type: string - description: Unique identifier for the generated text. - text: - type: string - description: The generated text output from the model. - required: - - id - - text - minMemoryMbytes: 512 - maxMemoryMbytes: 2048 - usesStandbyMode: false - properties: - data: - $ref: "#/components/schemas/Build" - required: - - data - title: BuildResponse - RunMeta: - example: - origin: DEVELOPMENT - clientIp: clientIp - userAgent: userAgent - scheduleId: scheduleId - scheduledAt: 2000-01-23T04:56:07.000+00:00 - properties: - origin: - $ref: "#/components/schemas/RunOrigin" - clientIp: - description: IP address of the client that started the run. - nullable: true - type: string - userAgent: - description: User agent of the client that started the run. - nullable: true - type: string - scheduleId: - description: ID of the schedule that triggered the run. - nullable: true - type: string - scheduledAt: - description: Time when the run was scheduled. - format: date-time - nullable: true - type: string - required: - - origin - title: RunMeta - RunShort: - example: - id: id - actId: actId - userId: userId - actorTaskId: actorTaskId - status: READY - startedAt: 2000-01-23T04:56:07.000+00:00 - finishedAt: 2000-01-23T04:56:07.000+00:00 - buildId: buildId - buildNumber: buildNumber - buildNumberInt: 5 - meta: - origin: DEVELOPMENT - clientIp: clientIp - userAgent: userAgent - scheduleId: scheduleId - scheduledAt: 2000-01-23T04:56:07.000+00:00 - usageTotalUsd: 2.3021358869347655 - defaultKeyValueStoreId: defaultKeyValueStoreId - defaultDatasetId: defaultDatasetId - defaultRequestQueueId: defaultRequestQueueId - properties: - id: - type: string - actId: - type: string - userId: - type: string - actorTaskId: - nullable: true - type: string - status: - $ref: "#/components/schemas/ActorJobStatus" - startedAt: - format: date-time - type: string - finishedAt: - format: date-time - nullable: true - type: string - buildId: - type: string - buildNumber: - pattern: "^([0-9]|[1-9][0-9])\\.([0-9]|[1-9][0-9])(\\.[1-9][0-9]{0,4})$" - type: string - buildNumberInt: - type: integer - meta: - $ref: "#/components/schemas/RunMeta" - usageTotalUsd: - type: number - defaultKeyValueStoreId: - type: string - defaultDatasetId: - type: string - defaultRequestQueueId: - type: string - required: - - actId - - buildId - - defaultDatasetId - - defaultKeyValueStoreId - - defaultRequestQueueId - - id - - meta - - startedAt - - status - - usageTotalUsd - title: RunShort - ListOfRuns: - allOf: - - $ref: "#/components/schemas/PaginationResponse" - - properties: - items: - items: - $ref: "#/components/schemas/RunShort" - type: array - default: null - required: - - items - example: - total: 0 - offset: 0 - limit: 1 - desc: true - count: 0 - items: - - id: id - actId: actId - userId: userId - actorTaskId: actorTaskId - status: READY - startedAt: 2000-01-23T04:56:07.000+00:00 - finishedAt: 2000-01-23T04:56:07.000+00:00 - buildId: buildId - buildNumber: buildNumber - buildNumberInt: 5 - meta: - origin: DEVELOPMENT - clientIp: clientIp - userAgent: userAgent - scheduleId: scheduleId - scheduledAt: 2000-01-23T04:56:07.000+00:00 - usageTotalUsd: 2.3021358869347655 - defaultKeyValueStoreId: defaultKeyValueStoreId - defaultDatasetId: defaultDatasetId - defaultRequestQueueId: defaultRequestQueueId - - id: id - actId: actId - userId: userId - actorTaskId: actorTaskId - status: READY - startedAt: 2000-01-23T04:56:07.000+00:00 - finishedAt: 2000-01-23T04:56:07.000+00:00 - buildId: buildId - buildNumber: buildNumber - buildNumberInt: 5 - meta: - origin: DEVELOPMENT - clientIp: clientIp - userAgent: userAgent - scheduleId: scheduleId - scheduledAt: 2000-01-23T04:56:07.000+00:00 - usageTotalUsd: 2.3021358869347655 - defaultKeyValueStoreId: defaultKeyValueStoreId - defaultDatasetId: defaultDatasetId - defaultRequestQueueId: defaultRequestQueueId - title: ListOfRuns - ListOfRunsResponse: - example: - data: - total: 0 - offset: 0 - limit: 1 - desc: true - count: 0 - items: - - id: id - actId: actId - userId: userId - actorTaskId: actorTaskId - status: READY - startedAt: 2000-01-23T04:56:07.000+00:00 - finishedAt: 2000-01-23T04:56:07.000+00:00 - buildId: buildId - buildNumber: buildNumber - buildNumberInt: 5 - meta: - origin: DEVELOPMENT - clientIp: clientIp - userAgent: userAgent - scheduleId: scheduleId - scheduledAt: 2000-01-23T04:56:07.000+00:00 - usageTotalUsd: 2.3021358869347655 - defaultKeyValueStoreId: defaultKeyValueStoreId - defaultDatasetId: defaultDatasetId - defaultRequestQueueId: defaultRequestQueueId - - id: id - actId: actId - userId: userId - actorTaskId: actorTaskId - status: READY - startedAt: 2000-01-23T04:56:07.000+00:00 - finishedAt: 2000-01-23T04:56:07.000+00:00 - buildId: buildId - buildNumber: buildNumber - buildNumberInt: 5 - meta: - origin: DEVELOPMENT - clientIp: clientIp - userAgent: userAgent - scheduleId: scheduleId - scheduledAt: 2000-01-23T04:56:07.000+00:00 - usageTotalUsd: 2.3021358869347655 - defaultKeyValueStoreId: defaultKeyValueStoreId - defaultDatasetId: defaultDatasetId - defaultRequestQueueId: defaultRequestQueueId - properties: - data: - $ref: "#/components/schemas/ListOfRuns" - required: - - data - title: ListOfRunsResponse - WebhookRepresentation: - description: | - Minimal representation of an ad-hoc webhook attached to a single Actor run or build via the - `webhooks` query parameter. The query parameter value is a Base64-encoded JSON array whose - items match this schema. Persistent webhook fields (e.g. `condition`) are not used here. - properties: - eventTypes: - items: - $ref: "#/components/schemas/WebhookEventType" - type: array - default: null - requestUrl: - description: The URL to which the webhook sends its payload. - type: string - payloadTemplate: - description: Optional template for the JSON payload sent by the webhook. - nullable: true - type: string - headersTemplate: - description: Optional template for the HTTP headers sent by the webhook. - nullable: true - type: string - shouldInterpolateStrings: - description: "Flag to also interpolate `{{...}}` variables inside string\ - \ values of the payload and headers templates." - nullable: true - type: boolean - idempotencyKey: - description: "Key that prevents creating duplicate webhooks, e.g. when the\ - \ run-starting request is retried." - nullable: true - type: string - ignoreSslErrors: - description: Flag to ignore SSL errors when the webhook sends the request. - nullable: true - type: boolean - doNotRetry: - description: Flag to skip retrying the webhook request on failure. - nullable: true - type: boolean - required: - - eventTypes - - requestUrl - title: WebhookRepresentation - RunStats: - properties: - inputBodyLen: - minimum: 0 - nullable: true - type: integer - migrationCount: - minimum: 0 - type: integer - rebootCount: - minimum: 0 - type: integer - restartCount: - minimum: 0 - type: integer - resurrectCount: - minimum: 0 - type: integer - memAvgBytes: - type: number - memMaxBytes: - minimum: 0 - type: integer - memCurrentBytes: - minimum: 0 - type: integer - cpuAvgUsage: - type: number - cpuMaxUsage: - type: number - cpuCurrentUsage: - type: number - netRxBytes: - minimum: 0 - type: integer - netTxBytes: - minimum: 0 - type: integer - durationMillis: - minimum: 0 - type: integer - runTimeSecs: - minimum: 0 - type: number - metamorph: - minimum: 0 - type: integer - computeUnits: - minimum: 0 - type: number - required: - - computeUnits - - restartCount - - resurrectCount - title: RunStats - RunOptions: - properties: - build: - type: string - timeoutSecs: - minimum: 0 - type: integer - memoryMbytes: - maximum: 32768 - minimum: 128 - type: integer - diskMbytes: - minimum: 0 - type: integer - maxItems: - minimum: 1 - nullable: true - type: integer - maxTotalChargeUsd: - minimum: 0 - type: number - required: - - build - - diskMbytes - - memoryMbytes - - timeoutSecs - title: RunOptions - GeneralAccess: - description: Defines the general access level for the resource. - enum: - - ANYONE_WITH_ID_CAN_READ - - ANYONE_WITH_NAME_CAN_READ - - FOLLOW_USER_SETTING - - RESTRICTED - title: GeneralAccess - type: string - RunUsage: - properties: - ACTOR_COMPUTE_UNITS: - nullable: true - type: number - DATASET_READS: - nullable: true - type: integer - DATASET_WRITES: - nullable: true - type: integer - KEY_VALUE_STORE_READS: - nullable: true - type: integer - KEY_VALUE_STORE_WRITES: - nullable: true - type: integer - KEY_VALUE_STORE_LISTS: - nullable: true - type: integer - REQUEST_QUEUE_READS: - nullable: true - type: integer - REQUEST_QUEUE_WRITES: - nullable: true - type: integer - DATA_TRANSFER_INTERNAL_GBYTES: - nullable: true - type: number - DATA_TRANSFER_EXTERNAL_GBYTES: - nullable: true - type: number - PROXY_RESIDENTIAL_TRANSFER_GBYTES: - nullable: true - type: number - PROXY_SERPS: - nullable: true - type: integer - title: RunUsage - RunUsageUsd: - description: Resource usage costs in USD. All values are monetary amounts in - US dollars. - properties: - ACTOR_COMPUTE_UNITS: - nullable: true - type: number - DATASET_READS: - nullable: true - type: number - DATASET_WRITES: - nullable: true - type: number - KEY_VALUE_STORE_READS: - nullable: true - type: number - KEY_VALUE_STORE_WRITES: - nullable: true - type: number - KEY_VALUE_STORE_LISTS: - nullable: true - type: number - REQUEST_QUEUE_READS: - nullable: true - type: number - REQUEST_QUEUE_WRITES: - nullable: true - type: number - DATA_TRANSFER_INTERNAL_GBYTES: - nullable: true - type: number - DATA_TRANSFER_EXTERNAL_GBYTES: - nullable: true - type: number - PROXY_RESIDENTIAL_TRANSFER_GBYTES: - nullable: true - type: number - PROXY_SERPS: - nullable: true - type: number - title: RunUsageUsd - Metamorph: - description: Information about a metamorph event that occurred during the run. - example: - createdAt: 2000-01-23T04:56:07.000+00:00 - actorId: actorId - buildId: buildId - inputKey: inputKey - properties: - createdAt: - description: Time when the metamorph occurred. - format: date-time - type: string - actorId: - description: ID of the Actor that the run was metamorphed to. - type: string - buildId: - description: ID of the build used for the metamorphed Actor. - type: string - inputKey: - description: Key of the input record in the key-value store. - nullable: true - type: string - required: - - actorId - - buildId - - createdAt - title: Metamorph - Run: - description: Represents an Actor run and its associated data. - example: - id: id - actId: actId - userId: userId - actorTaskId: actorTaskId - startedAt: 2000-01-23T04:56:07.000+00:00 - finishedAt: 2000-01-23T04:56:07.000+00:00 - status: "" - statusMessage: statusMessage - isStatusMessageTerminal: true - meta: "" - pricingInfo: "" - stats: "" - chargedEventCounts: - actor-start: 1 - page-crawled: 150 - data-extracted: 75 - options: "" - buildId: buildId - exitCode: 0 - generalAccess: "" - defaultKeyValueStoreId: defaultKeyValueStoreId - defaultDatasetId: defaultDatasetId - defaultRequestQueueId: defaultRequestQueueId - storageIds: - datasets: - default: wmKPijuyDnPZAPRMk - keyValueStores: - default: wmKPijuyDnPZAPRMk - requestQueues: - default: wmKPijuyDnPZAPRMk - buildNumber: buildNumber - containerUrl: https://openapi-generator.tech - isContainerServerReady: true - gitBranchName: gitBranchName - usage: "" - usageTotalUsd: 6.027456183070403 - usageUsd: "" - metamorphs: - - createdAt: 2000-01-23T04:56:07.000+00:00 - actorId: actorId - buildId: buildId - inputKey: inputKey - - createdAt: 2000-01-23T04:56:07.000+00:00 - actorId: actorId - buildId: buildId - inputKey: inputKey - platformUsageBillingModel: platformUsageBillingModel - properties: - id: - description: Unique identifier of the Actor run. - type: string - actId: - description: ID of the Actor that was run. - type: string - userId: - description: ID of the user who started the run. - type: string - actorTaskId: - description: "ID of the Actor task, if the run was started from a task." - nullable: true - type: string - startedAt: - description: Time when the Actor run started. - format: date-time - type: string - finishedAt: - description: Time when the Actor run finished. - format: date-time - nullable: true - type: string - status: - allOf: - - $ref: "#/components/schemas/ActorJobStatus" - description: Current status of the Actor run. - statusMessage: - description: Detailed message about the run status. - nullable: true - type: string - isStatusMessageTerminal: - description: Whether the status message is terminal (final). - nullable: true - type: boolean - meta: - allOf: - - $ref: "#/components/schemas/RunMeta" - description: Metadata about the Actor run. - pricingInfo: - allOf: - - $ref: "#/components/schemas/ActorRunPricingInfo" - description: Pricing information for the Actor. - stats: - allOf: - - $ref: "#/components/schemas/RunStats" - description: Statistics of the Actor run. - chargedEventCounts: - additionalProperties: - type: integer - description: "A map of charged event types to their counts. The keys are\ - \ event type identifiers defined by the Actor's pricing model (pay-per-event),\ - \ and the values are the number of times each event was charged during\ - \ this run." - example: - actor-start: 1 - page-crawled: 150 - data-extracted: 75 - options: - allOf: - - $ref: "#/components/schemas/RunOptions" - description: Configuration options for the Actor run. - buildId: - description: ID of the Actor build used for this run. - type: string - exitCode: - description: Exit code of the Actor run process. - nullable: true - type: integer - generalAccess: - allOf: - - $ref: "#/components/schemas/GeneralAccess" - description: General access level for the Actor run. - defaultKeyValueStoreId: - description: ID of the default key-value store for this run. - type: string - defaultDatasetId: - description: ID of the default dataset for this run. - type: string - defaultRequestQueueId: - description: ID of the default request queue for this run. - type: string - storageIds: - $ref: "#/components/schemas/Run_storageIds" - buildNumber: - description: Build number of the Actor build used for this run. - nullable: true - pattern: "^([0-9]|[1-9][0-9])\\.([0-9]|[1-9][0-9])(\\.[1-9][0-9]{0,4})$" - type: string - containerUrl: - description: URL of the container running the Actor. - format: uri - type: string - isContainerServerReady: - description: Whether the container's HTTP server is ready to accept requests. - nullable: true - type: boolean - gitBranchName: - description: Name of the git branch used for the Actor build. - nullable: true - type: string - usage: - allOf: - - $ref: "#/components/schemas/RunUsage" - description: Resource usage statistics for the run. - nullable: true - usageTotalUsd: - description: "Total cost in USD for this run. Represents what you actually\ - \ pay. For run owners: includes platform usage (compute units) and/or\ - \ event costs depending on the Actor's pricing model. For run non-owners:\ - \ only available for Pay-Per-Event Actors (event costs only). Requires\ - \ authentication token to access." - nullable: true - type: number - usageUsd: - allOf: - - $ref: "#/components/schemas/RunUsageUsd" - description: "Platform usage costs breakdown in USD. Only present if you\ - \ own the run AND are paying for platform usage (Pay-Per-Usage, Rental,\ - \ or Pay-Per-Event with usage costs like standby Actors). Not available\ - \ for standard Pay-Per-Event Actors. Requires authentication token to\ - \ access." - nullable: true - metamorphs: - description: List of metamorph events that occurred during the run. - items: - $ref: "#/components/schemas/Metamorph" - nullable: true - type: array - default: null - platformUsageBillingModel: - description: Indicates which party covers platform usage costs for this - run. - type: string - required: - - actId - - buildId - - defaultDatasetId - - defaultKeyValueStoreId - - defaultRequestQueueId - - generalAccess - - id - - meta - - options - - startedAt - - stats - - status - - userId - title: Run - RunResponse: - example: - data: - id: id - actId: actId - userId: userId - actorTaskId: actorTaskId - startedAt: 2000-01-23T04:56:07.000+00:00 - finishedAt: 2000-01-23T04:56:07.000+00:00 - status: "" - statusMessage: statusMessage - isStatusMessageTerminal: true - meta: "" - pricingInfo: "" - stats: "" - chargedEventCounts: - actor-start: 1 - page-crawled: 150 - data-extracted: 75 - options: "" - buildId: buildId - exitCode: 0 - generalAccess: "" - defaultKeyValueStoreId: defaultKeyValueStoreId - defaultDatasetId: defaultDatasetId - defaultRequestQueueId: defaultRequestQueueId - storageIds: - datasets: - default: wmKPijuyDnPZAPRMk - keyValueStores: - default: wmKPijuyDnPZAPRMk - requestQueues: - default: wmKPijuyDnPZAPRMk - buildNumber: buildNumber - containerUrl: https://openapi-generator.tech - isContainerServerReady: true - gitBranchName: gitBranchName - usage: "" - usageTotalUsd: 6.027456183070403 - usageUsd: "" - metamorphs: - - createdAt: 2000-01-23T04:56:07.000+00:00 - actorId: actorId - buildId: buildId - inputKey: inputKey - - createdAt: 2000-01-23T04:56:07.000+00:00 - actorId: actorId - buildId: buildId - inputKey: inputKey - platformUsageBillingModel: platformUsageBillingModel - properties: - data: - $ref: "#/components/schemas/Run" - required: - - data - title: RunResponse - RunFailedErrorDetail: - allOf: - - $ref: "#/components/schemas/ErrorDetail" - - properties: - type: {} - ActorRunFailedError: - example: - error: - type: run-failed - message: "Actor run did not succeed (run ID: 55uatRrZib4xbZs, status: FAILED)" - properties: - error: - $ref: "#/components/schemas/RunFailedErrorDetail" - RunTimeoutExceededErrorDetail: - allOf: - - $ref: "#/components/schemas/ErrorDetail" - - properties: - type: {} - ActorRunTimeoutExceededError: - example: - error: - type: run-timeout-exceeded - message: Actor run exceeded the timeout of 300 seconds for this API endpoint - properties: - error: - $ref: "#/components/schemas/RunTimeoutExceededErrorDetail" - DatasetStats: - example: - readCount: 1 - writeCount: 5 - storageBytes: 5 - inflatedBytes: 2 - properties: - readCount: - type: integer - writeCount: - type: integer - storageBytes: - description: Total storage size in bytes. Only returned by the single-dataset - endpoint. - type: integer - inflatedBytes: - description: Uncompressed size in bytes. Only returned by the dataset list - endpoint. - type: integer - title: DatasetStats - Dataset: - example: - id: id - name: name - userId: userId - createdAt: 2000-01-23T04:56:07.000+00:00 - modifiedAt: 2000-01-23T04:56:07.000+00:00 - accessedAt: 2000-01-23T04:56:07.000+00:00 - itemCount: 0 - cleanItemCount: 0 - actId: actId - actRunId: actRunId - fields: - - fields - - fields - schema: - actorSpecification: 1 - title: My dataset - views: - overview: - title: Overview - transformation: - fields: - - linkUrl - display: - component: table - properties: - linkUrl: - label: Link URL - format: link - consoleUrl: https://openapi-generator.tech - itemsPublicUrl: https://openapi-generator.tech - urlSigningSecretKey: urlSigningSecretKey - generalAccess: ANYONE_WITH_ID_CAN_READ - stats: - readCount: 1 - writeCount: 5 - storageBytes: 5 - inflatedBytes: 2 - properties: - id: - type: string - name: - nullable: true - type: string - userId: - type: string - createdAt: - format: date-time - type: string - modifiedAt: - format: date-time - type: string - accessedAt: - format: date-time - type: string - itemCount: - minimum: 0 - type: integer - cleanItemCount: - minimum: 0 - type: integer - actId: - nullable: true - type: string - actRunId: - nullable: true - type: string - fields: - description: "" - items: - type: string - nullable: true - type: array - default: null - schema: - description: "Defines the schema of items in your dataset, the full specification\ - \ can be found in [Apify docs](/platform/actors/development/actor-definition/dataset-schema)" - example: - actorSpecification: 1 - title: My dataset - views: - overview: - title: Overview - transformation: - fields: - - linkUrl - display: - component: table - properties: - linkUrl: - label: Link URL - format: link - nullable: true - type: object - consoleUrl: - format: uri - type: string - itemsPublicUrl: - description: A public link to access the dataset items directly. - format: uri - type: string - urlSigningSecretKey: - description: A secret key for generating signed public URLs. It is only - provided to clients with WRITE permission for the dataset. - nullable: true - type: string - generalAccess: - $ref: "#/components/schemas/GeneralAccess" - stats: - $ref: "#/components/schemas/DatasetStats" - required: - - accessedAt - - cleanItemCount - - consoleUrl - - createdAt - - id - - itemCount - - modifiedAt - - userId - title: Dataset - DatasetResponse: - description: Response containing dataset metadata. - example: - data: - id: id - name: name - userId: userId - createdAt: 2000-01-23T04:56:07.000+00:00 - modifiedAt: 2000-01-23T04:56:07.000+00:00 - accessedAt: 2000-01-23T04:56:07.000+00:00 - itemCount: 0 - cleanItemCount: 0 - actId: actId - actRunId: actRunId - fields: - - fields - - fields - schema: - actorSpecification: 1 - title: My dataset - views: - overview: - title: Overview - transformation: - fields: - - linkUrl - display: - component: table - properties: - linkUrl: - label: Link URL - format: link - consoleUrl: https://openapi-generator.tech - itemsPublicUrl: https://openapi-generator.tech - urlSigningSecretKey: urlSigningSecretKey - generalAccess: ANYONE_WITH_ID_CAN_READ - stats: - readCount: 1 - writeCount: 5 - storageBytes: 5 - inflatedBytes: 2 - properties: - data: - $ref: "#/components/schemas/Dataset" - required: - - data - title: DatasetResponse - UpdateDatasetRequest: - example: - name: new-dataset-name - generalAccess: RESTRICTED - properties: - name: - nullable: true - type: string - generalAccess: - $ref: "#/components/schemas/GeneralAccess" - title: UpdateDatasetRequest - PutItemsRequest: - additionalProperties: true - description: | - The request body containing the item(s) to add to the dataset. Can be a single - object or an array of objects. Each object represents one dataset item. - example: - title: Example Item - url: https://example.com - price: 19.99 - title: PutItemsRequest - type: object - ValidationError: - properties: - instancePath: - description: The path to the instance being validated. - type: string - schemaPath: - description: The path to the schema that failed the validation. - type: string - keyword: - description: The validation keyword that caused the error. - type: string - message: - description: A message describing the validation error. - type: string - params: - description: Additional parameters specific to the validation error. - type: object - title: ValidationError - InvalidItem: - properties: - itemPosition: - description: The position of the invalid item in the array. - type: integer - validationErrors: - description: A complete list of AJV validation error objects for the invalid - item. - items: - $ref: "#/components/schemas/ValidationError" - type: array - default: null - title: InvalidItem - SchemaValidationErrorData: - properties: - invalidItems: - description: A list of invalid items in the received array of items. - items: - $ref: "#/components/schemas/InvalidItem" - type: array - default: null - required: - - invalidItems - title: SchemaValidationErrorData - DatasetSchemaValidationError: - properties: - type: - description: The type of the error. - type: string - message: - description: A human-readable message describing the error. - type: string - data: - $ref: "#/components/schemas/SchemaValidationErrorData" - title: DatasetSchemaValidationError - PutItemResponseError: - example: - error: - type: schema-validation-error - message: Schema validation failed - data: - invalidItems: - - itemPosition: 2 - validationErrors: - - instancePath: /1/stringField - schemaPath: /items/properties/stringField/type - keyword: type - params: - type: string - message: must be string - properties: - error: - $ref: "#/components/schemas/DatasetSchemaValidationError" - required: - - error - title: PutItemResponseError - DatasetFieldStatistics: - properties: - min: - description: "Minimum value of the field. For numbers, this is calculated\ - \ directly. For strings, this is the length of the shortest string. For\ - \ arrays, this is the length of the shortest array. For objects, this\ - \ is the number of keys in the smallest object." - nullable: true - type: number - max: - description: "Maximum value of the field. For numbers, this is calculated\ - \ directly. For strings, this is the length of the longest string. For\ - \ arrays, this is the length of the longest array. For objects, this is\ - \ the number of keys in the largest object." - nullable: true - type: number - nullCount: - description: How many items in the dataset have a null value for this field. - nullable: true - type: integer - emptyCount: - description: "How many items in the dataset are `undefined`, meaning that\ - \ for example empty string is not considered empty." - nullable: true - type: integer - title: DatasetFieldStatistics - DatasetStatistics: - example: - fieldStatistics: - name: - nullCount: 122 - price: - min: 59 - max: 89 - properties: - fieldStatistics: - additionalProperties: - $ref: "#/components/schemas/DatasetFieldStatistics" - description: "When you configure the dataset [fields schema](https://docs.apify.com/platform/actors/development/actor-definition/dataset-schema/validation),\ - \ we measure the statistics such as `min`, `max`, `nullCount` and `emptyCount`\ - \ for each field. This property provides statistics for each field from\ - \ dataset fields schema. <br/></br>See dataset field statistics [documentation](https://docs.apify.com/platform/actors/development/actor-definition/dataset-schema/validation#dataset-field-statistics)\ - \ for more information." - title: DatasetStatistics - DatasetStatisticsResponse: - example: - data: - fieldStatistics: - name: - nullCount: 122 - price: - min: 59 - max: 89 - properties: - data: - $ref: "#/components/schemas/DatasetStatistics" - required: - - data - title: DatasetStatisticsResponse - KeyValueStoreStats: - example: - readCount: 0 - writeCount: 6 - deleteCount: 1 - listCount: 5 - s3StorageBytes: 5 - storageBytes: 2 - properties: - readCount: - type: integer - writeCount: - type: integer - deleteCount: - type: integer - listCount: - type: integer - s3StorageBytes: - type: integer - storageBytes: - type: integer - required: - - deleteCount - - listCount - - readCount - - writeCount - title: KeyValueStoreStats - KeyValueStore: - example: - id: id - name: name - userId: userId - username: username - createdAt: 2000-01-23T04:56:07.000+00:00 - modifiedAt: 2000-01-23T04:56:07.000+00:00 - accessedAt: 2000-01-23T04:56:07.000+00:00 - actId: actId - actRunId: actRunId - consoleUrl: https://openapi-generator.tech - keysPublicUrl: https://openapi-generator.tech - recordsPublicUrl: https://openapi-generator.tech - schema: "{}" - urlSigningSecretKey: urlSigningSecretKey - generalAccess: ANYONE_WITH_ID_CAN_READ - stats: - readCount: 0 - writeCount: 6 - deleteCount: 1 - listCount: 5 - s3StorageBytes: 5 - storageBytes: 2 - properties: - id: - type: string - name: - nullable: true - type: string - userId: - nullable: true - type: string - username: - nullable: true - type: string - createdAt: - format: date-time - type: string - modifiedAt: - format: date-time - type: string - accessedAt: - format: date-time - type: string - actId: - nullable: true - type: string - actRunId: - nullable: true - type: string - consoleUrl: - format: uri - type: string - keysPublicUrl: - description: A public link to access keys of the key-value store directly. - format: uri - type: string - recordsPublicUrl: - description: A public link to access records of the key-value store directly. - format: uri - type: string - schema: - description: Optional JSON schema describing the keys stored in the key-value - store. - nullable: true - type: object - urlSigningSecretKey: - description: A secret key for generating signed public URLs. It is only - provided to clients with WRITE permission for the key-value store. - nullable: true - type: string - generalAccess: - $ref: "#/components/schemas/GeneralAccess" - stats: - $ref: "#/components/schemas/KeyValueStoreStats" - required: - - accessedAt - - createdAt - - id - - modifiedAt - title: KeyValueStore - KeyValueStoreResponse: - description: Response containing key-value store data. - example: - data: - id: id - name: name - userId: userId - username: username - createdAt: 2000-01-23T04:56:07.000+00:00 - modifiedAt: 2000-01-23T04:56:07.000+00:00 - accessedAt: 2000-01-23T04:56:07.000+00:00 - actId: actId - actRunId: actRunId - consoleUrl: https://openapi-generator.tech - keysPublicUrl: https://openapi-generator.tech - recordsPublicUrl: https://openapi-generator.tech - schema: "{}" - urlSigningSecretKey: urlSigningSecretKey - generalAccess: ANYONE_WITH_ID_CAN_READ - stats: - readCount: 0 - writeCount: 6 - deleteCount: 1 - listCount: 5 - s3StorageBytes: 5 - storageBytes: 2 - properties: - data: - $ref: "#/components/schemas/KeyValueStore" - required: - - data - title: KeyValueStoreResponse - UpdateStoreRequest: - example: - name: new-store-name - generalAccess: RESTRICTED - properties: - name: - nullable: true - type: string - generalAccess: - $ref: "#/components/schemas/GeneralAccess" - title: UpdateStoreRequest - KeyValueStoreKey: - properties: - key: - type: string - size: - type: integer - recordPublicUrl: - description: A public link to access this record directly. - format: uri - type: string - required: - - key - - recordPublicUrl - - size - title: KeyValueStoreKey - ListOfKeys: - properties: - items: - description: "" - items: - $ref: "#/components/schemas/KeyValueStoreKey" - type: array - default: null - count: - type: integer - limit: - type: integer - exclusiveStartKey: - nullable: true - type: string - isTruncated: - type: boolean - nextExclusiveStartKey: - nullable: true - type: string - required: - - count - - isTruncated - - items - - limit - title: ListOfKeys - ListOfKeysResponse: - example: - data: - items: - - key: second-key - size: 36 - recordPublicUrl: https://api.apify.com/v2/key-value-stores/WkzbQMuFYuamGv3YF/records/second-key?signature=abc123 - - key: third-key - size: 128 - recordPublicUrl: https://api.apify.com/v2/key-value-stores/WkzbQMuFYuamGv3YF/records/third-key?signature=abc123 - count: 2 - limit: 2 - exclusiveStartKey: some-key - isTruncated: true - nextExclusiveStartKey: third-key - properties: - data: - $ref: "#/components/schemas/ListOfKeys" - required: - - data - title: ListOfKeysResponse - RecordResponse: - additionalProperties: true - description: | - The response body contains the value of the record. The content type of the response - is determined by the Content-Type header stored with the record. - example: - message: "Hello, world!" - count: 42 - title: RecordResponse - type: object - PutRecordRequest: - additionalProperties: true - description: | - The request body contains the value to store in the record. The content type - should be specified in the Content-Type header. - example: - message: "Hello, world!" - count: 42 - title: PutRecordRequest - type: object - QueueId: - description: A unique identifier assigned to the request queue. - type: string - QueueUserId: - description: The ID of the user who owns the request queue. - type: string - QueueCreatedAt: - description: The timestamp when the request queue was created. - format: date-time - type: string - QueueModifiedAt: - description: "The timestamp when the request queue was last modified. Modifications\ - \ include adding, updating, or removing requests, as well as locking or unlocking\ - \ requests in the request queue." - format: date-time - type: string - QueueAccessedAt: - description: The timestamp when the request queue was last accessed. - format: date-time - type: string - TotalRequestCount: - description: The total number of requests in the request queue. - minimum: 0 - type: integer - HandledRequestCount: - description: The number of requests that have been handled. - minimum: 0 - type: integer - PendingRequestCount: - description: The number of requests that are pending and have not been handled - yet. - type: integer - HadMultipleClients: - description: Whether the request queue has been accessed by multiple different - clients. - type: boolean - RequestQueueStats: - description: Statistics about request queue operations and storage. - example: - deleteCount: 5 - headItemReadCount: 5 - readCount: 2 - storageBytes: 7 - writeCount: 9 - properties: - deleteCount: - description: The number of delete operations performed on the request queue. - type: integer - headItemReadCount: - description: The number of times requests from the head were read. - type: integer - readCount: - description: The total number of read operations performed on the request - queue. - type: integer - storageBytes: - description: The total storage size in bytes used by the request queue. - type: integer - writeCount: - description: The total number of write operations performed on the request - queue. - type: integer - title: RequestQueueStats - RequestQueue: - description: A request queue object containing metadata and statistics. - example: - id: id - name: name - userId: userId - actId: actId - actRunId: actRunId - createdAt: 2000-01-23T04:56:07.000+00:00 - modifiedAt: 2000-01-23T04:56:07.000+00:00 - accessedAt: 2000-01-23T04:56:07.000+00:00 - totalRequestCount: 0 - handledRequestCount: 0 - pendingRequestCount: 1 - hadMultipleClients: true - consoleUrl: https://openapi-generator.tech - stats: - deleteCount: 5 - headItemReadCount: 5 - readCount: 2 - storageBytes: 7 - writeCount: 9 - generalAccess: ANYONE_WITH_ID_CAN_READ - properties: - id: - description: A unique identifier assigned to the request queue. - type: string - name: - description: The name of the request queue. - nullable: true - type: string - userId: - description: The ID of the user who owns the request queue. - type: string - actId: - description: The ID of the Actor that created this request queue. - nullable: true - type: string - actRunId: - description: The ID of the Actor run that created this request queue. - nullable: true - type: string - createdAt: - description: The timestamp when the request queue was created. - format: date-time - type: string - modifiedAt: - description: "The timestamp when the request queue was last modified. Modifications\ - \ include adding, updating, or removing requests, as well as locking or\ - \ unlocking requests in the request queue." - format: date-time - type: string - accessedAt: - description: The timestamp when the request queue was last accessed. - format: date-time - type: string - totalRequestCount: - description: The total number of requests in the request queue. - minimum: 0 - type: integer - handledRequestCount: - description: The number of requests that have been handled. - minimum: 0 - type: integer - pendingRequestCount: - description: The number of requests that are pending and have not been handled - yet. - type: integer - hadMultipleClients: - description: Whether the request queue has been accessed by multiple different - clients. - type: boolean - consoleUrl: - description: The URL to view the request queue in the Apify console. - format: uri - type: string - stats: - $ref: "#/components/schemas/RequestQueueStats" - generalAccess: - $ref: "#/components/schemas/GeneralAccess" - required: - - accessedAt - - consoleUrl - - createdAt - - hadMultipleClients - - handledRequestCount - - id - - modifiedAt - - pendingRequestCount - - totalRequestCount - - userId - title: RequestQueue - RequestQueueResponse: - description: Response containing request queue data. - example: - data: - id: id - name: name - userId: userId - actId: actId - actRunId: actRunId - createdAt: 2000-01-23T04:56:07.000+00:00 - modifiedAt: 2000-01-23T04:56:07.000+00:00 - accessedAt: 2000-01-23T04:56:07.000+00:00 - totalRequestCount: 0 - handledRequestCount: 0 - pendingRequestCount: 1 - hadMultipleClients: true - consoleUrl: https://openapi-generator.tech - stats: - deleteCount: 5 - headItemReadCount: 5 - readCount: 2 - storageBytes: 7 - writeCount: 9 - generalAccess: ANYONE_WITH_ID_CAN_READ - properties: - data: - $ref: "#/components/schemas/RequestQueue" - required: - - data - title: RequestQueueResponse - UpdateRequestQueueRequest: - description: Request object for updating a request queue. - example: - name: new-request-queue-name - generalAccess: RESTRICTED - properties: - name: - description: The new name for the request queue. - nullable: true - type: string - generalAccess: - $ref: "#/components/schemas/GeneralAccess" - title: UpdateRequestQueueRequest - UniqueKey: - description: A unique key used for request de-duplication. Requests with the - same unique key are considered identical. - type: string - RequestUrl: - description: The URL of the request. - type: string - HttpMethod: - enum: - - GET - - HEAD - - POST - - PUT - - DELETE - - CONNECT - - OPTIONS - - TRACE - - PATCH - type: string - RetryCount: - description: The number of times this request has been retried. - type: integer - RequestUserData: - additionalProperties: true - description: Custom user data attached to the request. Can contain arbitrary - fields. - example: - label: DETAIL - customField: custom-value - title: RequestUserData - type: object - RequestBase: - example: - uniqueKey: uniqueKey - url: url - method: GET - retryCount: 0 - loadedUrl: loadedUrl - payload: RequestBase_payload - headers: "{}" - userData: - label: DETAIL - customField: custom-value - noRetry: true - errorMessages: - - errorMessages - - errorMessages - handledAt: 2000-01-23T04:56:07.000+00:00 - properties: - uniqueKey: - description: A unique key used for request de-duplication. Requests with - the same unique key are considered identical. - type: string - url: - description: The URL of the request. - type: string - method: - $ref: "#/components/schemas/HttpMethod" - retryCount: - description: The number of times this request has been retried. - type: integer - loadedUrl: - description: "The final URL that was loaded, after redirects (if any)." - nullable: true - type: string - payload: - $ref: "#/components/schemas/RequestBase_payload" - headers: - description: HTTP headers sent with the request. - nullable: true - type: object - userData: - additionalProperties: true - description: Custom user data attached to the request. Can contain arbitrary - fields. - example: - label: DETAIL - customField: custom-value - title: RequestUserData - type: object - noRetry: - description: Indicates whether the request should not be retried if processing - fails. - nullable: true - type: boolean - errorMessages: - description: Error messages recorded from failed processing attempts. - items: - type: string - nullable: true - type: array - default: null - handledAt: - description: "The timestamp when the request was marked as handled, if applicable." - format: date-time - nullable: true - type: string - title: RequestBase - RequestId: - description: A unique identifier assigned to the request. - type: string - Request: - allOf: - - $ref: "#/components/schemas/RequestBase" - - properties: - id: - $ref: "#/components/schemas/RequestId" - description: "A request stored in the request queue, including its metadata\ - \ and processing state." - example: - uniqueKey: uniqueKey - url: url - method: GET - retryCount: 0 - loadedUrl: loadedUrl - payload: RequestBase_payload - headers: "{}" - userData: - label: DETAIL - customField: custom-value - noRetry: true - errorMessages: - - errorMessages - - errorMessages - handledAt: 2000-01-23T04:56:07.000+00:00 - id: null - title: Request - ListOfRequests: - description: A paginated list of requests from the request queue. - properties: - items: - description: The array of requests. - items: - $ref: "#/components/schemas/Request" - type: array - default: null - limit: - description: The maximum number of requests returned in this response. - type: integer - exclusiveStartId: - deprecated: true - description: "The ID of the last request from the previous page, used for\ - \ pagination." - type: string - cursor: - description: A cursor string used for current page of results. - type: string - nextCursor: - description: A cursor string to be used to continue pagination. - type: string - required: - - items - - limit - title: ListOfRequests - ListOfRequestsResponse: - description: Response containing a list of requests from the request queue. - example: - data: - items: - - id: dnjkDMKLmdlkmlkmld - retryCount: 0 - uniqueKey: http://example.com - url: http://example.com - method: GET - loadedUrl: http://example.com/example-1 - payload: null - noRetry: false - errorMessages: null - headers: null - userData: - label: DETAIL - image: https://picserver1.eu - handledAt: 2019-06-16T10:23:31.607Z - - id: dnjkDMKLmdlkmlkmld - retryCount: 0 - uniqueKey: http://example.com - url: http://example.com - method: GET - loadedUrl: http://example.com/example-1 - payload: null - noRetry: false - errorMessages: null - headers: null - userData: - label: DETAIL - image: https://picserver1.eu - handledAt: 2019-06-16T10:23:31.607Z - limit: 2 - exclusiveStartId: Ihnsp8YrvJ8102Kj - properties: - data: - $ref: "#/components/schemas/ListOfRequests" - required: - - data - title: ListOfRequestsResponse - WasAlreadyPresent: - description: "Indicates whether a request with the same unique key already existed\ - \ in the request queue. If true, no new request was created." - type: boolean - WasAlreadyHandled: - description: Indicates whether a request with the same unique key has already - been processed by the request queue. - type: boolean - RequestRegistration: - description: "Result of registering a request in the request queue, either by\ - \ adding a new request or updating an existing one." - example: - requestId: requestId - wasAlreadyPresent: true - wasAlreadyHandled: true - properties: - requestId: - description: A unique identifier assigned to the request. - type: string - wasAlreadyPresent: - description: "Indicates whether a request with the same unique key already\ - \ existed in the request queue. If true, no new request was created." - type: boolean - wasAlreadyHandled: - description: Indicates whether a request with the same unique key has already - been processed by the request queue. - type: boolean - required: - - requestId - - wasAlreadyHandled - - wasAlreadyPresent - title: RequestRegistration - AddRequestResponse: - description: Response containing the result of adding a request to the request - queue. - example: - data: - requestId: requestId - wasAlreadyPresent: true - wasAlreadyHandled: true - properties: - data: - $ref: "#/components/schemas/RequestRegistration" - required: - - data - title: AddRequestResponse - AddedRequest: - description: Information about a request that was successfully added to a request - queue. - properties: - requestId: - description: A unique identifier assigned to the request. - type: string - uniqueKey: - description: A unique key used for request de-duplication. Requests with - the same unique key are considered identical. - type: string - wasAlreadyPresent: - description: "Indicates whether a request with the same unique key already\ - \ existed in the request queue. If true, no new request was created." - type: boolean - wasAlreadyHandled: - description: Indicates whether a request with the same unique key has already - been processed by the request queue. - type: boolean - required: - - requestId - - uniqueKey - - wasAlreadyHandled - - wasAlreadyPresent - title: AddedRequest - RequestDraft: - description: A request that failed to be processed during a request queue operation - and can be retried. - example: - id: id - uniqueKey: uniqueKey - url: url - method: GET - properties: - id: - description: A unique identifier assigned to the request. - type: string - uniqueKey: - description: A unique key used for request de-duplication. Requests with - the same unique key are considered identical. - type: string - url: - description: The URL of the request. - type: string - method: - $ref: "#/components/schemas/HttpMethod" - required: - - uniqueKey - - url - title: RequestDraft - BatchAddResult: - description: Result of a batch add operation containing successfully processed - and failed requests. - properties: - processedRequests: - description: Requests that were successfully added to the request queue. - items: - $ref: "#/components/schemas/AddedRequest" - type: array - default: null - unprocessedRequests: - description: Requests that failed to be added and can be retried. - items: - $ref: "#/components/schemas/RequestDraft" - type: array - default: null - required: - - processedRequests - - unprocessedRequests - title: BatchAddResult - BatchAddResponse: - description: Response containing the result of a batch add operation. - example: - data: - processedRequests: - - requestId: YiKoxjkaS9gjGTqhF - uniqueKey: http://example.com - wasAlreadyPresent: true - wasAlreadyHandled: false - unprocessedRequests: - - uniqueKey: http://example.com/2 - url: http://example.com/2 - method: GET - properties: - data: - $ref: "#/components/schemas/BatchAddResult" - required: - - data - title: BatchAddResponse - RequestDraftDeleteById: - description: "A request that should be deleted, identified by its ID." - example: - id: id - uniqueKey: uniqueKey - properties: - id: - description: A unique identifier assigned to the request. - type: string - uniqueKey: - description: A unique key used for request de-duplication. Requests with - the same unique key are considered identical. - type: string - required: - - id - title: RequestDraftDeleteById - RequestDraftDeleteByUniqueKey: - description: "A request that should be deleted, identified by its unique key." - properties: - id: - description: A unique identifier assigned to the request. - type: string - uniqueKey: - description: A unique key used for request de-duplication. Requests with - the same unique key are considered identical. - type: string - required: - - uniqueKey - title: RequestDraftDeleteByUniqueKey - RequestDraftDelete: - anyOf: - - $ref: "#/components/schemas/RequestDraftDeleteById" - - $ref: "#/components/schemas/RequestDraftDeleteByUniqueKey" - description: A request that should be deleted. - title: RequestDraftDelete - DeletedRequestById: - description: "Confirmation of a request that was successfully deleted, identified\ - \ by its ID." - example: - uniqueKey: uniqueKey - id: id - properties: - uniqueKey: - description: A unique key used for request de-duplication. Requests with - the same unique key are considered identical. - type: string - id: - description: A unique identifier assigned to the request. - type: string - required: - - id - title: DeletedRequestById - DeletedRequestByUniqueKey: - description: "Confirmation of a request that was successfully deleted, identified\ - \ by its unique key." - properties: - uniqueKey: - description: A unique key used for request de-duplication. Requests with - the same unique key are considered identical. - type: string - id: - description: A unique identifier assigned to the request. - type: string - required: - - uniqueKey - title: DeletedRequestByUniqueKey - DeletedRequest: - anyOf: - - $ref: "#/components/schemas/DeletedRequestById" - - $ref: "#/components/schemas/DeletedRequestByUniqueKey" - description: Confirmation of a request that was successfully deleted from a - request queue. - title: DeletedRequest - BatchDeleteResult: - description: Result of a batch delete operation containing successfully deleted - and failed requests. - example: - processedRequests: - - uniqueKey: uniqueKey - id: id - - uniqueKey: uniqueKey - id: id - unprocessedRequests: - - id: id - uniqueKey: uniqueKey - url: url - method: GET - - id: id - uniqueKey: uniqueKey - url: url - method: GET - properties: - processedRequests: - description: Requests that were successfully deleted from the request queue. - items: - $ref: "#/components/schemas/DeletedRequest" - type: array - default: null - unprocessedRequests: - description: Requests that failed to be deleted and can be retried. - items: - $ref: "#/components/schemas/RequestDraft" - type: array - default: null - required: - - processedRequests - - unprocessedRequests - title: BatchDeleteResult - BatchDeleteResponse: - description: Response containing the result of a batch delete operation. - example: - data: - processedRequests: - - uniqueKey: uniqueKey - id: id - - uniqueKey: uniqueKey - id: id - unprocessedRequests: - - id: id - uniqueKey: uniqueKey - url: url - method: GET - - id: id - uniqueKey: uniqueKey - url: url - method: GET - properties: - data: - $ref: "#/components/schemas/BatchDeleteResult" - required: - - data - title: BatchDeleteResponse - UnlockRequestsResult: - description: Result of unlocking requests in the request queue. - example: - unlockedCount: 0 - properties: - unlockedCount: - description: Number of requests that were successfully unlocked. - type: integer - required: - - unlockedCount - title: UnlockRequestsResult - UnlockRequestsResponse: - description: Response containing the result of unlocking requests. - example: - data: - unlockedCount: 0 - properties: - data: - $ref: "#/components/schemas/UnlockRequestsResult" - required: - - data - title: UnlockRequestsResponse - RequestResponse: - description: Response containing a single request from the request queue. - example: - data: - uniqueKey: uniqueKey - url: url - method: GET - retryCount: 0 - loadedUrl: loadedUrl - payload: RequestBase_payload - headers: "{}" - userData: - label: DETAIL - customField: custom-value - noRetry: true - errorMessages: - - errorMessages - - errorMessages - handledAt: 2000-01-23T04:56:07.000+00:00 - id: null - properties: - data: - $ref: "#/components/schemas/Request" - required: - - data - title: RequestResponse - UpdateRequestResponse: - description: Response containing the result of updating a request in the request - queue. - example: - data: - requestId: requestId - wasAlreadyPresent: true - wasAlreadyHandled: true - properties: - data: - $ref: "#/components/schemas/RequestRegistration" - required: - - data - title: UpdateRequestResponse - LockExpiresAt: - description: The timestamp when the lock on this request expires. - format: date-time - type: string - RequestLockInfo: - description: Information about a request lock. - example: - lockExpiresAt: 2000-01-23T04:56:07.000+00:00 - properties: - lockExpiresAt: - description: The timestamp when the lock on this request expires. - format: date-time - type: string - required: - - lockExpiresAt - title: RequestLockInfo - ProlongRequestLockResponse: - description: Response containing updated lock information after prolonging a - request lock. - example: - data: - lockExpiresAt: 2000-01-23T04:56:07.000+00:00 - properties: - data: - $ref: "#/components/schemas/RequestLockInfo" - required: - - data - title: ProlongRequestLockResponse - HeadLimit: - description: The maximum number of requests returned. - type: integer - HeadRequest: - description: A request from the request queue head without lock information. - properties: - id: - description: A unique identifier assigned to the request. - type: string - uniqueKey: - description: A unique key used for request de-duplication. Requests with - the same unique key are considered identical. - type: string - url: - description: The URL of the request. - type: string - method: - $ref: "#/components/schemas/HttpMethod" - retryCount: - description: The number of times this request has been retried. - type: integer - required: - - id - - uniqueKey - - url - title: HeadRequest - RequestQueueHead: - description: A batch of requests from the request queue head without locking. - properties: - limit: - description: The maximum number of requests returned. - type: integer - queueModifiedAt: - description: "The timestamp when the request queue was last modified. Modifications\ - \ include adding, updating, or removing requests, as well as locking or\ - \ unlocking requests in the request queue." - format: date-time - type: string - hadMultipleClients: - description: Whether the request queue has been accessed by multiple different - clients. - type: boolean - items: - description: The array of requests from the request queue head. - items: - $ref: "#/components/schemas/HeadRequest" - type: array - default: null - required: - - hadMultipleClients - - items - - limit - - queueModifiedAt - title: RequestQueueHead - HeadResponse: - description: Response containing requests from the request queue head without - locking. - example: - data: - limit: 1000 - queueModifiedAt: 2018-03-14T23:00:00.000Z - hadMultipleClients: false - items: - - id: 8OamqXBCpPHxyH9 - retryCount: 0 - uniqueKey: http://example.com - url: http://example.com - method: GET - - id: ZJAoqlRijenMQIn - retryCount: 0 - uniqueKey: http://example.com/a/b - url: http://example.com/a/b - method: GET - - id: hAhkwyk5oOBHKQC - retryCount: 1 - uniqueKey: http://example.com/c/d - url: http://example.com/c/d - method: GET - properties: - data: - $ref: "#/components/schemas/RequestQueueHead" - required: - - data - title: HeadResponse - LockedHeadRequest: - description: A request from the request queue head that has been locked for - processing. - properties: - id: - description: A unique identifier assigned to the request. - type: string - uniqueKey: - description: A unique key used for request de-duplication. Requests with - the same unique key are considered identical. - type: string - url: - description: The URL of the request. - type: string - method: - $ref: "#/components/schemas/HttpMethod" - retryCount: - description: The number of times this request has been retried. - type: integer - lockExpiresAt: - description: The timestamp when the lock on this request expires. - format: date-time - type: string - required: - - id - - lockExpiresAt - - uniqueKey - - url - title: LockedHeadRequest - LockedRequestQueueHead: - description: A batch of locked requests from the request queue head. - properties: - limit: - description: The maximum number of requests returned. - type: integer - queueModifiedAt: - description: "The timestamp when the request queue was last modified. Modifications\ - \ include adding, updating, or removing requests, as well as locking or\ - \ unlocking requests in the request queue." - format: date-time - type: string - queueHasLockedRequests: - description: Whether the request queue contains requests locked by any client - (either the one calling the endpoint or a different one). - type: boolean - clientKey: - description: The client key used for locking the requests. - type: string - hadMultipleClients: - description: Whether the request queue has been accessed by multiple different - clients. - type: boolean - lockSecs: - description: The number of seconds the locks will be held. - type: integer - items: - description: The array of locked requests from the request queue head. - items: - $ref: "#/components/schemas/LockedHeadRequest" - type: array - default: null - required: - - hadMultipleClients - - items - - limit - - lockSecs - - queueModifiedAt - title: LockedRequestQueueHead - HeadAndLockResponse: - description: Response containing locked requests from the request queue head. - example: - data: - limit: 3 - queueModifiedAt: 2018-03-14T23:00:00.000Z - hadMultipleClients: true - lockSecs: 60 - items: - - id: 8OamqXBCpPHxyj9 - retryCount: 0 - uniqueKey: http://example.com - url: http://example.com - method: GET - lockExpiresAt: 2022-06-14T23:00:00.000Z - - id: 8OamqXBCpPHxyx9 - retryCount: 0 - uniqueKey: http://example.com/a - url: http://example.com/a - method: GET - lockExpiresAt: 2022-06-14T23:00:00.000Z - - id: 8OamqXBCpPHxy08 - retryCount: 0 - uniqueKey: http://example.com/a/b - url: http://example.com/a/b - method: GET - lockExpiresAt: 2022-06-14T23:00:00.000Z - properties: - data: - $ref: "#/components/schemas/LockedRequestQueueHead" - required: - - data - title: HeadAndLockResponse - TaskStats: - properties: - totalRuns: - type: integer - title: TaskStats - TaskShort: - example: - id: id - userId: userId - actId: actId - actName: actName - name: name - username: username - actUsername: actUsername - createdAt: 2000-01-23T04:56:07.000+00:00 - modifiedAt: 2000-01-23T04:56:07.000+00:00 - stats: "" - properties: - id: - type: string - userId: - type: string - actId: - type: string - actName: - nullable: true - type: string - name: - type: string - username: - nullable: true - type: string - actUsername: - nullable: true - type: string - createdAt: - format: date-time - type: string - modifiedAt: - format: date-time - type: string - stats: - allOf: - - $ref: "#/components/schemas/TaskStats" - nullable: true - required: - - actId - - createdAt - - id - - modifiedAt - - name - - userId - title: TaskShort - ListOfTasks: - allOf: - - $ref: "#/components/schemas/PaginationResponse" - - properties: - items: - items: - $ref: "#/components/schemas/TaskShort" - type: array - default: null - required: - - items - example: - total: 0 - offset: 0 - limit: 1 - desc: true - count: 0 - items: - - id: id - userId: userId - actId: actId - actName: actName - name: name - username: username - actUsername: actUsername - createdAt: 2000-01-23T04:56:07.000+00:00 - modifiedAt: 2000-01-23T04:56:07.000+00:00 - stats: "" - - id: id - userId: userId - actId: actId - actName: actName - name: name - username: username - actUsername: actUsername - createdAt: 2000-01-23T04:56:07.000+00:00 - modifiedAt: 2000-01-23T04:56:07.000+00:00 - stats: "" - title: ListOfTasks - ListOfTasksResponse: - example: - data: - total: 0 - offset: 0 - limit: 1 - desc: true - count: 0 - items: - - id: id - userId: userId - actId: actId - actName: actName - name: name - username: username - actUsername: actUsername - createdAt: 2000-01-23T04:56:07.000+00:00 - modifiedAt: 2000-01-23T04:56:07.000+00:00 - stats: "" - - id: id - userId: userId - actId: actId - actName: actName - name: name - username: username - actUsername: actUsername - createdAt: 2000-01-23T04:56:07.000+00:00 - modifiedAt: 2000-01-23T04:56:07.000+00:00 - stats: "" - properties: - data: - $ref: "#/components/schemas/ListOfTasks" - required: - - data - title: ListOfTasksResponse - TaskOptions: - properties: - build: - nullable: true - type: string - timeoutSecs: - nullable: true - type: integer - memoryMbytes: - nullable: true - type: integer - maxItems: - nullable: true - type: integer - maxTotalChargeUsd: - nullable: true - type: number - restartOnError: - nullable: true - type: boolean - title: TaskOptions - TaskInput: - additionalProperties: true - description: | - The input configuration for the Actor task. This is a user-defined JSON object - that will be passed to the Actor when the task is run. - example: - startUrls: - - url: https://example.com - maxRequestsPerCrawl: 100 - title: TaskInput - type: object - CreateTaskRequest: - example: - actId: actId - name: name - options: "" - input: "" - title: title - actorStandby: "" - properties: - actId: - type: string - name: - type: string - options: - allOf: - - $ref: "#/components/schemas/TaskOptions" - nullable: true - input: - allOf: - - $ref: "#/components/schemas/TaskInput" - nullable: true - title: - nullable: true - type: string - actorStandby: - allOf: - - $ref: "#/components/schemas/ActorStandby" - nullable: true - required: - - actId - title: CreateTaskRequest - Task: - example: - id: id - userId: userId - actId: actId - name: name - username: username - createdAt: 2000-01-23T04:56:07.000+00:00 - modifiedAt: 2000-01-23T04:56:07.000+00:00 - removedAt: 2000-01-23T04:56:07.000+00:00 - stats: "" - options: "" - input: "" - title: title - actorStandby: "" - standbyUrl: https://openapi-generator.tech - properties: - id: - type: string - userId: - type: string - actId: - type: string - name: - type: string - username: - nullable: true - type: string - createdAt: - format: date-time - type: string - modifiedAt: - format: date-time - type: string - removedAt: - format: date-time - nullable: true - type: string - stats: - allOf: - - $ref: "#/components/schemas/TaskStats" - nullable: true - options: - allOf: - - $ref: "#/components/schemas/TaskOptions" - nullable: true - input: - allOf: - - $ref: "#/components/schemas/TaskInput" - nullable: true - title: - nullable: true - type: string - actorStandby: - allOf: - - $ref: "#/components/schemas/ActorStandby" - nullable: true - standbyUrl: - format: uri - nullable: true - type: string - required: - - actId - - createdAt - - id - - modifiedAt - - name - - userId - title: Task - TaskResponse: - description: Response containing Actor task data. - example: - data: - id: zdc3Pyhyz3m8vjDeM - userId: wRsJZtadYvn4mBZmm - actId: asADASadYvn4mBZmm - name: my-task - username: janedoe - createdAt: 2018-10-26T07:23:14.855Z - modifiedAt: 2018-10-26T13:30:49.578Z - removedAt: null - stats: - totalRuns: 15 - options: - build: latest - timeoutSecs: 300 - memoryMbytes: 128 - input: - hello: world - properties: - data: - $ref: "#/components/schemas/Task" - required: - - data - title: TaskResponse - UpdateTaskRequest: - example: - name: name - options: "" - input: "" - title: title - actorStandby: "" - properties: - name: - type: string - options: - allOf: - - $ref: "#/components/schemas/TaskOptions" - nullable: true - input: - allOf: - - $ref: "#/components/schemas/TaskInput" - nullable: true - title: - nullable: true - type: string - actorStandby: - allOf: - - $ref: "#/components/schemas/ActorStandby" - nullable: true - title: UpdateTaskRequest - Webhook: - example: - id: id - createdAt: 2000-01-23T04:56:07.000+00:00 - modifiedAt: 2000-01-23T04:56:07.000+00:00 - userId: userId - isAdHoc: true - shouldInterpolateStrings: true - eventTypes: - - ACTOR.BUILD.ABORTED - - ACTOR.BUILD.ABORTED - condition: - actorId: actorId - actorTaskId: actorTaskId - actorRunId: actorRunId - ignoreSslErrors: true - doNotRetry: true - requestUrl: https://openapi-generator.tech - payloadTemplate: payloadTemplate - headersTemplate: headersTemplate - description: description - lastDispatch: "" - stats: "" - properties: - id: - type: string - createdAt: - format: date-time - type: string - modifiedAt: - format: date-time - type: string - userId: - type: string - isAdHoc: - nullable: true - type: boolean - shouldInterpolateStrings: - nullable: true - type: boolean - eventTypes: - items: - $ref: "#/components/schemas/WebhookEventType" - type: array - default: null - condition: - $ref: "#/components/schemas/WebhookCondition" - ignoreSslErrors: - type: boolean - doNotRetry: - nullable: true - type: boolean - requestUrl: - format: uri - type: string - payloadTemplate: - nullable: true - type: string - headersTemplate: - nullable: true - type: string - description: - nullable: true - type: string - lastDispatch: - allOf: - - $ref: "#/components/schemas/ExampleWebhookDispatch" - nullable: true - stats: - allOf: - - $ref: "#/components/schemas/WebhookStats" - nullable: true - required: - - condition - - createdAt - - eventTypes - - id - - ignoreSslErrors - - modifiedAt - - requestUrl - - userId - title: Webhook - UpdateRunRequest: - example: - runId: runId - statusMessage: statusMessage - isStatusMessageTerminal: true - generalAccess: ANYONE_WITH_ID_CAN_READ - properties: - runId: - type: string - statusMessage: - type: string - isStatusMessageTerminal: - type: boolean - generalAccess: - $ref: "#/components/schemas/GeneralAccess" - title: UpdateRunRequest - ChargeRunRequest: - example: - eventName: eventName - count: 0 - properties: - eventName: - type: string - count: - type: integer - required: - - count - - eventName - title: ChargeRunRequest - StorageOwnership: - enum: - - ownedByMe - - sharedWithMe - type: string - ListOfKeyValueStores: - allOf: - - $ref: "#/components/schemas/PaginationResponse" - - properties: - unnamed: - description: Whether the listing was filtered to only unnamed key-value - stores. - type: boolean - items: - items: - $ref: "#/components/schemas/KeyValueStore" - type: array - default: null - required: - - items - example: - total: 0 - offset: 0 - limit: 1 - desc: true - count: 0 - unnamed: true - items: - - id: id - name: name - userId: userId - username: username - createdAt: 2000-01-23T04:56:07.000+00:00 - modifiedAt: 2000-01-23T04:56:07.000+00:00 - accessedAt: 2000-01-23T04:56:07.000+00:00 - actId: actId - actRunId: actRunId - consoleUrl: https://openapi-generator.tech - keysPublicUrl: https://openapi-generator.tech - recordsPublicUrl: https://openapi-generator.tech - schema: "{}" - urlSigningSecretKey: urlSigningSecretKey - generalAccess: ANYONE_WITH_ID_CAN_READ - stats: - readCount: 0 - writeCount: 6 - deleteCount: 1 - listCount: 5 - s3StorageBytes: 5 - storageBytes: 2 - - id: id - name: name - userId: userId - username: username - createdAt: 2000-01-23T04:56:07.000+00:00 - modifiedAt: 2000-01-23T04:56:07.000+00:00 - accessedAt: 2000-01-23T04:56:07.000+00:00 - actId: actId - actRunId: actRunId - consoleUrl: https://openapi-generator.tech - keysPublicUrl: https://openapi-generator.tech - recordsPublicUrl: https://openapi-generator.tech - schema: "{}" - urlSigningSecretKey: urlSigningSecretKey - generalAccess: ANYONE_WITH_ID_CAN_READ - stats: - readCount: 0 - writeCount: 6 - deleteCount: 1 - listCount: 5 - s3StorageBytes: 5 - storageBytes: 2 - title: ListOfKeyValueStores - ListOfKeyValueStoresResponse: - example: - data: - total: 0 - offset: 0 - limit: 1 - desc: true - count: 0 - unnamed: true - items: - - id: id - name: name - userId: userId - username: username - createdAt: 2000-01-23T04:56:07.000+00:00 - modifiedAt: 2000-01-23T04:56:07.000+00:00 - accessedAt: 2000-01-23T04:56:07.000+00:00 - actId: actId - actRunId: actRunId - consoleUrl: https://openapi-generator.tech - keysPublicUrl: https://openapi-generator.tech - recordsPublicUrl: https://openapi-generator.tech - schema: "{}" - urlSigningSecretKey: urlSigningSecretKey - generalAccess: ANYONE_WITH_ID_CAN_READ - stats: - readCount: 0 - writeCount: 6 - deleteCount: 1 - listCount: 5 - s3StorageBytes: 5 - storageBytes: 2 - - id: id - name: name - userId: userId - username: username - createdAt: 2000-01-23T04:56:07.000+00:00 - modifiedAt: 2000-01-23T04:56:07.000+00:00 - accessedAt: 2000-01-23T04:56:07.000+00:00 - actId: actId - actRunId: actRunId - consoleUrl: https://openapi-generator.tech - keysPublicUrl: https://openapi-generator.tech - recordsPublicUrl: https://openapi-generator.tech - schema: "{}" - urlSigningSecretKey: urlSigningSecretKey - generalAccess: ANYONE_WITH_ID_CAN_READ - stats: - readCount: 0 - writeCount: 6 - deleteCount: 1 - listCount: 5 - s3StorageBytes: 5 - storageBytes: 2 - properties: - data: - $ref: "#/components/schemas/ListOfKeyValueStores" - required: - - data - title: ListOfKeyValueStoresResponse - DatasetListItem: - example: - id: id - name: name - userId: userId - createdAt: 2000-01-23T04:56:07.000+00:00 - modifiedAt: 2000-01-23T04:56:07.000+00:00 - accessedAt: 2000-01-23T04:56:07.000+00:00 - itemCount: 5 - cleanItemCount: 2 - actId: actId - actRunId: actRunId - title: title - username: username - generalAccess: ANYONE_WITH_ID_CAN_READ - stats: - readCount: 1 - writeCount: 5 - storageBytes: 5 - inflatedBytes: 2 - properties: - id: - type: string - name: - type: string - userId: - type: string - createdAt: - format: date-time - type: string - modifiedAt: - format: date-time - type: string - accessedAt: - format: date-time - type: string - itemCount: - type: integer - cleanItemCount: - type: integer - actId: - nullable: true - type: string - actRunId: - nullable: true - type: string - title: - nullable: true - type: string - username: - type: string - generalAccess: - $ref: "#/components/schemas/GeneralAccess" - stats: - $ref: "#/components/schemas/DatasetStats" - required: - - accessedAt - - cleanItemCount - - createdAt - - id - - itemCount - - modifiedAt - - name - - userId - title: DatasetListItem - ListOfDatasets: - allOf: - - $ref: "#/components/schemas/PaginationResponse" - - properties: - unnamed: - description: Whether the listing was filtered to only unnamed datasets. - type: boolean - items: - items: - $ref: "#/components/schemas/DatasetListItem" - type: array - default: null - required: - - items - example: - total: 0 - offset: 0 - limit: 1 - desc: true - count: 0 - unnamed: true - items: - - id: id - name: name - userId: userId - createdAt: 2000-01-23T04:56:07.000+00:00 - modifiedAt: 2000-01-23T04:56:07.000+00:00 - accessedAt: 2000-01-23T04:56:07.000+00:00 - itemCount: 5 - cleanItemCount: 2 - actId: actId - actRunId: actRunId - title: title - username: username - generalAccess: ANYONE_WITH_ID_CAN_READ - stats: - readCount: 1 - writeCount: 5 - storageBytes: 5 - inflatedBytes: 2 - - id: id - name: name - userId: userId - createdAt: 2000-01-23T04:56:07.000+00:00 - modifiedAt: 2000-01-23T04:56:07.000+00:00 - accessedAt: 2000-01-23T04:56:07.000+00:00 - itemCount: 5 - cleanItemCount: 2 - actId: actId - actRunId: actRunId - title: title - username: username - generalAccess: ANYONE_WITH_ID_CAN_READ - stats: - readCount: 1 - writeCount: 5 - storageBytes: 5 - inflatedBytes: 2 - title: ListOfDatasets - ListOfDatasetsResponse: - example: - data: - total: 0 - offset: 0 - limit: 1 - desc: true - count: 0 - unnamed: true - items: - - id: id - name: name - userId: userId - createdAt: 2000-01-23T04:56:07.000+00:00 - modifiedAt: 2000-01-23T04:56:07.000+00:00 - accessedAt: 2000-01-23T04:56:07.000+00:00 - itemCount: 5 - cleanItemCount: 2 - actId: actId - actRunId: actRunId - title: title - username: username - generalAccess: ANYONE_WITH_ID_CAN_READ - stats: - readCount: 1 - writeCount: 5 - storageBytes: 5 - inflatedBytes: 2 - - id: id - name: name - userId: userId - createdAt: 2000-01-23T04:56:07.000+00:00 - modifiedAt: 2000-01-23T04:56:07.000+00:00 - accessedAt: 2000-01-23T04:56:07.000+00:00 - itemCount: 5 - cleanItemCount: 2 - actId: actId - actRunId: actRunId - title: title - username: username - generalAccess: ANYONE_WITH_ID_CAN_READ - stats: - readCount: 1 - writeCount: 5 - storageBytes: 5 - inflatedBytes: 2 - properties: - data: - $ref: "#/components/schemas/ListOfDatasets" - required: - - data - title: ListOfDatasetsResponse - RequestQueueShort: - description: A shortened request queue object for list responses. - example: - id: id - name: name - userId: userId - username: username - createdAt: 2000-01-23T04:56:07.000+00:00 - modifiedAt: 2000-01-23T04:56:07.000+00:00 - accessedAt: 2000-01-23T04:56:07.000+00:00 - expireAt: 2000-01-23T04:56:07.000+00:00 - totalRequestCount: 0 - handledRequestCount: 0 - pendingRequestCount: 7 - actId: actId - actRunId: actRunId - hadMultipleClients: true - generalAccess: ANYONE_WITH_ID_CAN_READ - stats: - deleteCount: 5 - headItemReadCount: 5 - readCount: 2 - storageBytes: 7 - writeCount: 9 - properties: - id: - description: A unique identifier assigned to the request queue. - type: string - name: - description: The name of the request queue. - type: string - userId: - description: The ID of the user who owns the request queue. - type: string - username: - description: The username of the user who owns the request queue. - type: string - createdAt: - description: The timestamp when the request queue was created. - format: date-time - type: string - modifiedAt: - description: "The timestamp when the request queue was last modified. Modifications\ - \ include adding, updating, or removing requests, as well as locking or\ - \ unlocking requests in the request queue." - format: date-time - type: string - accessedAt: - description: The timestamp when the request queue was last accessed. - format: date-time - type: string - expireAt: - description: The timestamp when the request queue will expire and be deleted. - format: date-time - type: string - totalRequestCount: - description: The total number of requests in the request queue. - minimum: 0 - type: integer - handledRequestCount: - description: The number of requests that have been handled. - minimum: 0 - type: integer - pendingRequestCount: - description: The number of requests that are pending and have not been handled - yet. - type: integer - actId: - description: The ID of the Actor that created this request queue. - nullable: true - type: string - actRunId: - description: The ID of the Actor run that created this request queue. - nullable: true - type: string - hadMultipleClients: - description: Whether the request queue has been accessed by multiple different - clients. - type: boolean - generalAccess: - $ref: "#/components/schemas/GeneralAccess" - stats: - $ref: "#/components/schemas/RequestQueueStats" - required: - - accessedAt - - createdAt - - hadMultipleClients - - handledRequestCount - - id - - modifiedAt - - name - - pendingRequestCount - - totalRequestCount - - userId - - username - title: RequestQueueShort - ListOfRequestQueues: - allOf: - - $ref: "#/components/schemas/PaginationResponse" - - properties: - unnamed: - description: Whether the listing was filtered to only unnamed request - queues. - type: boolean - items: - description: The array of request queues. - items: - $ref: "#/components/schemas/RequestQueueShort" - type: array - default: null - required: - - items - description: A paginated list of request queues. - example: - total: 0 - offset: 0 - limit: 1 - desc: true - count: 0 - unnamed: true - items: - - id: id - name: name - userId: userId - username: username - createdAt: 2000-01-23T04:56:07.000+00:00 - modifiedAt: 2000-01-23T04:56:07.000+00:00 - accessedAt: 2000-01-23T04:56:07.000+00:00 - expireAt: 2000-01-23T04:56:07.000+00:00 - totalRequestCount: 0 - handledRequestCount: 0 - pendingRequestCount: 7 - actId: actId - actRunId: actRunId - hadMultipleClients: true - generalAccess: ANYONE_WITH_ID_CAN_READ - stats: - deleteCount: 5 - headItemReadCount: 5 - readCount: 2 - storageBytes: 7 - writeCount: 9 - - id: id - name: name - userId: userId - username: username - createdAt: 2000-01-23T04:56:07.000+00:00 - modifiedAt: 2000-01-23T04:56:07.000+00:00 - accessedAt: 2000-01-23T04:56:07.000+00:00 - expireAt: 2000-01-23T04:56:07.000+00:00 - totalRequestCount: 0 - handledRequestCount: 0 - pendingRequestCount: 7 - actId: actId - actRunId: actRunId - hadMultipleClients: true - generalAccess: ANYONE_WITH_ID_CAN_READ - stats: - deleteCount: 5 - headItemReadCount: 5 - readCount: 2 - storageBytes: 7 - writeCount: 9 - title: ListOfRequestQueues - ListOfRequestQueuesResponse: - description: Response containing a list of request queues. - example: - data: - total: 0 - offset: 0 - limit: 1 - desc: true - count: 0 - unnamed: true - items: - - id: id - name: name - userId: userId - username: username - createdAt: 2000-01-23T04:56:07.000+00:00 - modifiedAt: 2000-01-23T04:56:07.000+00:00 - accessedAt: 2000-01-23T04:56:07.000+00:00 - expireAt: 2000-01-23T04:56:07.000+00:00 - totalRequestCount: 0 - handledRequestCount: 0 - pendingRequestCount: 7 - actId: actId - actRunId: actRunId - hadMultipleClients: true - generalAccess: ANYONE_WITH_ID_CAN_READ - stats: - deleteCount: 5 - headItemReadCount: 5 - readCount: 2 - storageBytes: 7 - writeCount: 9 - - id: id - name: name - userId: userId - username: username - createdAt: 2000-01-23T04:56:07.000+00:00 - modifiedAt: 2000-01-23T04:56:07.000+00:00 - accessedAt: 2000-01-23T04:56:07.000+00:00 - expireAt: 2000-01-23T04:56:07.000+00:00 - totalRequestCount: 0 - handledRequestCount: 0 - pendingRequestCount: 7 - actId: actId - actRunId: actRunId - hadMultipleClients: true - generalAccess: ANYONE_WITH_ID_CAN_READ - stats: - deleteCount: 5 - headItemReadCount: 5 - readCount: 2 - storageBytes: 7 - writeCount: 9 - properties: - data: - $ref: "#/components/schemas/ListOfRequestQueues" - required: - - data - title: ListOfRequestQueuesResponse - WebhookCreate: - example: - isAdHoc: true - eventTypes: - - ACTOR.BUILD.ABORTED - - ACTOR.BUILD.ABORTED - condition: - actorId: actorId - actorTaskId: actorTaskId - actorRunId: actorRunId - idempotencyKey: idempotencyKey - ignoreSslErrors: true - doNotRetry: true - requestUrl: requestUrl - payloadTemplate: payloadTemplate - headersTemplate: headersTemplate - description: description - shouldInterpolateStrings: true - properties: - isAdHoc: - nullable: true - type: boolean - eventTypes: - items: - $ref: "#/components/schemas/WebhookEventType" - type: array - default: null - condition: - $ref: "#/components/schemas/WebhookCondition" - idempotencyKey: - nullable: true - type: string - ignoreSslErrors: - nullable: true - type: boolean - doNotRetry: - nullable: true - type: boolean - requestUrl: - type: string - payloadTemplate: - nullable: true - type: string - headersTemplate: - nullable: true - type: string - description: - nullable: true - type: string - shouldInterpolateStrings: - nullable: true - type: boolean - required: - - condition - - eventTypes - - requestUrl - title: WebhookCreate - WebhookResponse: - description: Response containing webhook data. - example: - data: - id: id - createdAt: 2000-01-23T04:56:07.000+00:00 - modifiedAt: 2000-01-23T04:56:07.000+00:00 - userId: userId - isAdHoc: true - shouldInterpolateStrings: true - eventTypes: - - ACTOR.BUILD.ABORTED - - ACTOR.BUILD.ABORTED - condition: - actorId: actorId - actorTaskId: actorTaskId - actorRunId: actorRunId - ignoreSslErrors: true - doNotRetry: true - requestUrl: https://openapi-generator.tech - payloadTemplate: payloadTemplate - headersTemplate: headersTemplate - description: description - lastDispatch: "" - stats: "" - properties: - data: - $ref: "#/components/schemas/Webhook" - required: - - data - title: WebhookResponse - WebhookUpdate: - example: - isAdHoc: true - eventTypes: - - ACTOR.BUILD.ABORTED - - ACTOR.BUILD.ABORTED - condition: "" - ignoreSslErrors: true - doNotRetry: true - requestUrl: https://openapi-generator.tech - payloadTemplate: payloadTemplate - headersTemplate: headersTemplate - description: description - shouldInterpolateStrings: true - properties: - isAdHoc: - nullable: true - type: boolean - eventTypes: - description: "" - items: - $ref: "#/components/schemas/WebhookEventType" - nullable: true - type: array - default: null - condition: - allOf: - - $ref: "#/components/schemas/WebhookCondition" - nullable: true - ignoreSslErrors: - nullable: true - type: boolean - doNotRetry: - nullable: true - type: boolean - requestUrl: - format: uri - nullable: true - type: string - payloadTemplate: - nullable: true - type: string - headersTemplate: - nullable: true - type: string - description: - nullable: true - type: string - shouldInterpolateStrings: - nullable: true - type: boolean - title: WebhookUpdate - WebhookDispatchWebhookSummary: - description: A summary of the webhook that triggered this dispatch. - properties: - actionType: - type: string - condition: - $ref: "#/components/schemas/WebhookCondition" - requestUrl: - format: uri - type: string - isAdHoc: - type: boolean - title: WebhookDispatchWebhookSummary - WebhookDispatch: - example: - id: id - userId: userId - webhookId: webhookId - createdAt: 2000-01-23T04:56:07.000+00:00 - status: ACTIVE - eventType: ACTOR.BUILD.ABORTED - eventData: - actorId: actorId - actorRunId: actorRunId - webhook: "" - calls: - - startedAt: 2000-01-23T04:56:07.000+00:00 - finishedAt: 2000-01-23T04:56:07.000+00:00 - errorMessage: errorMessage - responseStatus: 0 - responseBody: "{\"foo\": \"bar\"}" - - startedAt: 2000-01-23T04:56:07.000+00:00 - finishedAt: 2000-01-23T04:56:07.000+00:00 - errorMessage: errorMessage - responseStatus: 0 - responseBody: "{\"foo\": \"bar\"}" - properties: - id: - type: string - userId: - type: string - webhookId: - type: string - createdAt: - format: date-time - type: string - status: - $ref: "#/components/schemas/WebhookDispatchStatus" - eventType: - $ref: "#/components/schemas/WebhookEventType" - eventData: - $ref: "#/components/schemas/eventData" - webhook: - allOf: - - $ref: "#/components/schemas/WebhookDispatchWebhookSummary" - nullable: true - calls: - items: - $ref: "#/components/schemas/calls_inner" - title: calls - type: array - default: null - required: - - createdAt - - eventType - - id - - status - - userId - - webhookId - title: WebhookDispatch - TestWebhookResponse: - example: - data: - id: id - userId: userId - webhookId: webhookId - createdAt: 2000-01-23T04:56:07.000+00:00 - status: ACTIVE - eventType: ACTOR.BUILD.ABORTED - eventData: - actorId: actorId - actorRunId: actorRunId - webhook: "" - calls: - - startedAt: 2000-01-23T04:56:07.000+00:00 - finishedAt: 2000-01-23T04:56:07.000+00:00 - errorMessage: errorMessage - responseStatus: 0 - responseBody: "{\"foo\": \"bar\"}" - - startedAt: 2000-01-23T04:56:07.000+00:00 - finishedAt: 2000-01-23T04:56:07.000+00:00 - errorMessage: errorMessage - responseStatus: 0 - responseBody: "{\"foo\": \"bar\"}" - properties: - data: - $ref: "#/components/schemas/WebhookDispatch" - required: - - data - title: TestWebhookResponse - ListOfWebhookDispatches: - allOf: - - $ref: "#/components/schemas/PaginationResponse" - - properties: - items: - items: - $ref: "#/components/schemas/WebhookDispatch" - type: array - default: null - required: - - items - example: - total: 0 - offset: 0 - limit: 1 - desc: true - count: 0 - items: - - id: id - userId: userId - webhookId: webhookId - createdAt: 2000-01-23T04:56:07.000+00:00 - status: ACTIVE - eventType: ACTOR.BUILD.ABORTED - eventData: - actorId: actorId - actorRunId: actorRunId - webhook: "" - calls: - - startedAt: 2000-01-23T04:56:07.000+00:00 - finishedAt: 2000-01-23T04:56:07.000+00:00 - errorMessage: errorMessage - responseStatus: 0 - responseBody: "{\"foo\": \"bar\"}" - - startedAt: 2000-01-23T04:56:07.000+00:00 - finishedAt: 2000-01-23T04:56:07.000+00:00 - errorMessage: errorMessage - responseStatus: 0 - responseBody: "{\"foo\": \"bar\"}" - - id: id - userId: userId - webhookId: webhookId - createdAt: 2000-01-23T04:56:07.000+00:00 - status: ACTIVE - eventType: ACTOR.BUILD.ABORTED - eventData: - actorId: actorId - actorRunId: actorRunId - webhook: "" - calls: - - startedAt: 2000-01-23T04:56:07.000+00:00 - finishedAt: 2000-01-23T04:56:07.000+00:00 - errorMessage: errorMessage - responseStatus: 0 - responseBody: "{\"foo\": \"bar\"}" - - startedAt: 2000-01-23T04:56:07.000+00:00 - finishedAt: 2000-01-23T04:56:07.000+00:00 - errorMessage: errorMessage - responseStatus: 0 - responseBody: "{\"foo\": \"bar\"}" - title: ListOfWebhookDispatches - ListOfWebhookDispatchesResponse: - example: - data: - total: 0 - offset: 0 - limit: 1 - desc: true - count: 0 - items: - - id: id - userId: userId - webhookId: webhookId - createdAt: 2000-01-23T04:56:07.000+00:00 - status: ACTIVE - eventType: ACTOR.BUILD.ABORTED - eventData: - actorId: actorId - actorRunId: actorRunId - webhook: "" - calls: - - startedAt: 2000-01-23T04:56:07.000+00:00 - finishedAt: 2000-01-23T04:56:07.000+00:00 - errorMessage: errorMessage - responseStatus: 0 - responseBody: "{\"foo\": \"bar\"}" - - startedAt: 2000-01-23T04:56:07.000+00:00 - finishedAt: 2000-01-23T04:56:07.000+00:00 - errorMessage: errorMessage - responseStatus: 0 - responseBody: "{\"foo\": \"bar\"}" - - id: id - userId: userId - webhookId: webhookId - createdAt: 2000-01-23T04:56:07.000+00:00 - status: ACTIVE - eventType: ACTOR.BUILD.ABORTED - eventData: - actorId: actorId - actorRunId: actorRunId - webhook: "" - calls: - - startedAt: 2000-01-23T04:56:07.000+00:00 - finishedAt: 2000-01-23T04:56:07.000+00:00 - errorMessage: errorMessage - responseStatus: 0 - responseBody: "{\"foo\": \"bar\"}" - - startedAt: 2000-01-23T04:56:07.000+00:00 - finishedAt: 2000-01-23T04:56:07.000+00:00 - errorMessage: errorMessage - responseStatus: 0 - responseBody: "{\"foo\": \"bar\"}" - properties: - data: - $ref: "#/components/schemas/ListOfWebhookDispatches" - required: - - data - title: ListOfWebhookDispatchesResponse - WebhookDispatchResponse: - example: - data: - id: id - userId: userId - webhookId: webhookId - createdAt: 2000-01-23T04:56:07.000+00:00 - status: ACTIVE - eventType: ACTOR.BUILD.ABORTED - eventData: - actorId: actorId - actorRunId: actorRunId - webhook: "" - calls: - - startedAt: 2000-01-23T04:56:07.000+00:00 - finishedAt: 2000-01-23T04:56:07.000+00:00 - errorMessage: errorMessage - responseStatus: 0 - responseBody: "{\"foo\": \"bar\"}" - - startedAt: 2000-01-23T04:56:07.000+00:00 - finishedAt: 2000-01-23T04:56:07.000+00:00 - errorMessage: errorMessage - responseStatus: 0 - responseBody: "{\"foo\": \"bar\"}" - properties: - data: - $ref: "#/components/schemas/WebhookDispatch" - required: - - data - title: WebhookDispatchResponse - ScheduleBase: - properties: - id: - type: string - userId: - type: string - name: - type: string - cronExpression: - type: string - timezone: - type: string - isEnabled: - type: boolean - isExclusive: - type: boolean - createdAt: - format: date-time - type: string - modifiedAt: - format: date-time - type: string - nextRunAt: - format: date-time - nullable: true - type: string - lastRunAt: - format: date-time - nullable: true - type: string - required: - - createdAt - - cronExpression - - id - - isEnabled - - isExclusive - - modifiedAt - - name - - timezone - - userId - title: ScheduleBase - ScheduleActionShortRunActor: - example: - id: id - type: "" - actorId: actorId - properties: - id: - type: string - type: {} - actorId: - type: string - required: - - actorId - - id - - type - title: ScheduleActionShortRunActor - ScheduleActionShortRunActorTask: - properties: - id: - type: string - type: {} - actorTaskId: - type: string - required: - - actorTaskId - - id - - type - title: ScheduleActionShortRunActorTask - ScheduleActionShort: - discriminator: - mapping: - RUN_ACTOR: "#/components/schemas/ScheduleActionShortRunActor" - RUN_ACTOR_TASK: "#/components/schemas/ScheduleActionShortRunActorTask" - propertyName: type - oneOf: - - $ref: "#/components/schemas/ScheduleActionShortRunActor" - - $ref: "#/components/schemas/ScheduleActionShortRunActorTask" - title: ScheduleActionShort - ScheduleShort: - allOf: - - $ref: "#/components/schemas/ScheduleBase" - - properties: - actions: - description: "" - items: - $ref: "#/components/schemas/ScheduleActionShort" - type: array - default: null - required: - - actions - example: - id: id - userId: userId - name: name - cronExpression: cronExpression - timezone: timezone - isEnabled: true - isExclusive: true - createdAt: 2000-01-23T04:56:07.000+00:00 - modifiedAt: 2000-01-23T04:56:07.000+00:00 - nextRunAt: 2000-01-23T04:56:07.000+00:00 - lastRunAt: 2000-01-23T04:56:07.000+00:00 - actions: - - id: id - type: "" - actorId: actorId - - id: id - type: "" - actorId: actorId - title: ScheduleShort - ListOfSchedules: - allOf: - - $ref: "#/components/schemas/PaginationResponse" - - properties: - items: - items: - $ref: "#/components/schemas/ScheduleShort" - type: array - default: null - required: - - items - example: - total: 0 - offset: 0 - limit: 1 - desc: true - count: 0 - items: - - id: id - userId: userId - name: name - cronExpression: cronExpression - timezone: timezone - isEnabled: true - isExclusive: true - createdAt: 2000-01-23T04:56:07.000+00:00 - modifiedAt: 2000-01-23T04:56:07.000+00:00 - nextRunAt: 2000-01-23T04:56:07.000+00:00 - lastRunAt: 2000-01-23T04:56:07.000+00:00 - actions: - - id: id - type: "" - actorId: actorId - - id: id - type: "" - actorId: actorId - - id: id - userId: userId - name: name - cronExpression: cronExpression - timezone: timezone - isEnabled: true - isExclusive: true - createdAt: 2000-01-23T04:56:07.000+00:00 - modifiedAt: 2000-01-23T04:56:07.000+00:00 - nextRunAt: 2000-01-23T04:56:07.000+00:00 - lastRunAt: 2000-01-23T04:56:07.000+00:00 - actions: - - id: id - type: "" - actorId: actorId - - id: id - type: "" - actorId: actorId - title: ListOfSchedules - ListOfSchedulesResponse: - example: - data: - total: 0 - offset: 0 - limit: 1 - desc: true - count: 0 - items: - - id: id - userId: userId - name: name - cronExpression: cronExpression - timezone: timezone - isEnabled: true - isExclusive: true - createdAt: 2000-01-23T04:56:07.000+00:00 - modifiedAt: 2000-01-23T04:56:07.000+00:00 - nextRunAt: 2000-01-23T04:56:07.000+00:00 - lastRunAt: 2000-01-23T04:56:07.000+00:00 - actions: - - id: id - type: "" - actorId: actorId - - id: id - type: "" - actorId: actorId - - id: id - userId: userId - name: name - cronExpression: cronExpression - timezone: timezone - isEnabled: true - isExclusive: true - createdAt: 2000-01-23T04:56:07.000+00:00 - modifiedAt: 2000-01-23T04:56:07.000+00:00 - nextRunAt: 2000-01-23T04:56:07.000+00:00 - lastRunAt: 2000-01-23T04:56:07.000+00:00 - actions: - - id: id - type: "" - actorId: actorId - - id: id - type: "" - actorId: actorId - properties: - data: - $ref: "#/components/schemas/ListOfSchedules" - required: - - data - title: ListOfSchedulesResponse - ScheduleActionRunInput: - properties: - body: - nullable: true - type: string - contentType: - nullable: true - type: string - title: ScheduleActionRunInput - ScheduleCreateActionRunActor: - example: - type: "" - actorId: actorId - runInput: "" - runOptions: "" - properties: - type: {} - actorId: - type: string - runInput: - allOf: - - $ref: "#/components/schemas/ScheduleActionRunInput" - nullable: true - runOptions: - allOf: - - $ref: "#/components/schemas/TaskOptions" - nullable: true - required: - - actorId - - type - title: ScheduleCreateActionRunActor - ScheduleCreateActionRunActorTask: - properties: - type: {} - actorTaskId: - type: string - input: - nullable: true - type: object - required: - - actorTaskId - - type - title: ScheduleCreateActionRunActorTask - ScheduleCreateAction: - discriminator: - mapping: - RUN_ACTOR: "#/components/schemas/ScheduleCreateActionRunActor" - RUN_ACTOR_TASK: "#/components/schemas/ScheduleCreateActionRunActorTask" - propertyName: type - oneOf: - - $ref: "#/components/schemas/ScheduleCreateActionRunActor" - - $ref: "#/components/schemas/ScheduleCreateActionRunActorTask" - title: ScheduleCreateAction - ScheduleCreate: - example: - name: name - isEnabled: true - isExclusive: true - cronExpression: cronExpression - timezone: timezone - description: description - title: title - actions: - - type: "" - actorId: actorId - runInput: "" - runOptions: "" - - type: "" - actorId: actorId - runInput: "" - runOptions: "" - properties: - name: - nullable: true - type: string - isEnabled: - nullable: true - type: boolean - isExclusive: - nullable: true - type: boolean - cronExpression: - nullable: true - type: string - timezone: - nullable: true - type: string - description: - nullable: true - type: string - title: - nullable: true - type: string - actions: - description: "" - items: - $ref: "#/components/schemas/ScheduleCreateAction" - nullable: true - type: array - default: null - title: ScheduleCreate - ScheduleActionRunActor: - example: - id: id - type: "" - actorId: actorId - runInput: "" - runOptions: "" - properties: - id: - type: string - type: {} - actorId: - type: string - runInput: - allOf: - - $ref: "#/components/schemas/ScheduleActionRunInput" - nullable: true - runOptions: - allOf: - - $ref: "#/components/schemas/TaskOptions" - nullable: true - required: - - actorId - - id - - type - title: ScheduleActionRunActor - ScheduleActionRunActorTask: - properties: - id: - type: string - type: {} - actorTaskId: - type: string - input: - nullable: true - type: object - required: - - actorTaskId - - id - - type - title: ScheduleActionRunActorTask - ScheduleAction: - discriminator: - mapping: - RUN_ACTOR: "#/components/schemas/ScheduleActionRunActor" - RUN_ACTOR_TASK: "#/components/schemas/ScheduleActionRunActorTask" - propertyName: type - oneOf: - - $ref: "#/components/schemas/ScheduleActionRunActor" - - $ref: "#/components/schemas/ScheduleActionRunActorTask" - title: ScheduleAction - Schedule: - allOf: - - $ref: "#/components/schemas/ScheduleBase" - - properties: - description: - nullable: true - type: string - title: - nullable: true - type: string - notifications: - $ref: "#/components/schemas/ScheduleNotifications" - actions: - description: "" - items: - $ref: "#/components/schemas/ScheduleAction" - type: array - default: null - required: - - actions - example: - id: id - userId: userId - name: name - cronExpression: cronExpression - timezone: timezone - isEnabled: true - isExclusive: true - createdAt: 2000-01-23T04:56:07.000+00:00 - modifiedAt: 2000-01-23T04:56:07.000+00:00 - nextRunAt: 2000-01-23T04:56:07.000+00:00 - lastRunAt: 2000-01-23T04:56:07.000+00:00 - description: description - title: title - notifications: - email: true - actions: - - id: id - type: "" - actorId: actorId - runInput: "" - runOptions: "" - - id: id - type: "" - actorId: actorId - runInput: "" - runOptions: "" - title: Schedule - ScheduleResponse: - example: - data: - id: id - userId: userId - name: name - cronExpression: cronExpression - timezone: timezone - isEnabled: true - isExclusive: true - createdAt: 2000-01-23T04:56:07.000+00:00 - modifiedAt: 2000-01-23T04:56:07.000+00:00 - nextRunAt: 2000-01-23T04:56:07.000+00:00 - lastRunAt: 2000-01-23T04:56:07.000+00:00 - description: description - title: title - notifications: - email: true - actions: - - id: id - type: "" - actorId: actorId - runInput: "" - runOptions: "" - - id: id - type: "" - actorId: actorId - runInput: "" - runOptions: "" - properties: - data: - $ref: "#/components/schemas/Schedule" - required: - - data - title: ScheduleResponse - ScheduleInvoked: - example: - message: message - level: level - createdAt: 2000-01-23T04:56:07.000+00:00 - properties: - message: - type: string - level: - type: string - createdAt: - format: date-time - type: string - required: - - createdAt - - level - - message - title: ScheduleInvoked - ScheduleLogResponse: - example: - data: - - message: message - level: level - createdAt: 2000-01-23T04:56:07.000+00:00 - - message: message - level: level - createdAt: 2000-01-23T04:56:07.000+00:00 - properties: - data: - description: "" - items: - $ref: "#/components/schemas/ScheduleInvoked" - type: array - default: null - required: - - data - title: ScheduleLogResponse - CurrentPricingInfo: - properties: - pricingModel: - type: string - apifyMarginPercentage: - type: number - createdAt: - format: date-time - type: string - startedAt: - format: date-time - type: string - notifiedAboutChangeAt: - format: date-time - nullable: true - type: string - notifiedAboutFutureChangeAt: - format: date-time - nullable: true - type: string - isPriceChangeNotificationSuppressed: - type: boolean - forceContainsSignificantPriceChange: - type: boolean - isPPEPlatformUsagePaidByUser: - type: boolean - reasonForChange: - nullable: true - type: string - trialMinutes: - nullable: true - type: integer - unitName: - nullable: true - type: string - pricePerUnitUsd: - nullable: true - type: number - minimalMaxTotalChargeUsd: - nullable: true - type: number - pricingPerEvent: - additionalProperties: true - description: Per-event pricing configuration for pay-per-event Actors. - nullable: true - type: object - required: - - pricingModel - title: CurrentPricingInfo - StoreListActor: - properties: - id: - type: string - title: - type: string - name: - type: string - username: - type: string - userFullName: - type: string - description: - type: string - categories: - example: - - MARKETING - - LEAD_GENERATION - items: - type: string - type: array - default: null - notice: - type: string - pictureUrl: - format: uri - nullable: true - type: string - userPictureUrl: - format: uri - nullable: true - type: string - url: - format: uri - nullable: true - type: string - stats: - $ref: "#/components/schemas/ActorStats" - currentPricingInfo: - $ref: "#/components/schemas/CurrentPricingInfo" - isWhiteListedForAgenticPayments: - description: Whether the Actor is whitelisted for agentic payment processing. - nullable: true - type: boolean - actorReviewCount: - type: integer - actorReviewRating: - type: number - bookmarkCount: - type: integer - badge: - nullable: true - type: string - readmeSummary: - description: "A brief, LLM-generated readme summary" - type: string - required: - - currentPricingInfo - - description - - id - - name - - stats - - title - - userFullName - - username - title: StoreListActor - ListOfStoreActors: - allOf: - - $ref: "#/components/schemas/PaginationResponse" - - properties: - items: - items: - $ref: "#/components/schemas/StoreListActor" - type: array - default: null - required: - - items - title: ListOfStoreActors - ListOfActorsInStoreResponse: - example: - data: - total: 100 - offset: 0 - limit: 1000 - desc: false - count: 1 - items: - - id: zdc3Pyhyz3m8vjDeM - title: My Public Actor - name: my-public-actor - username: jane35 - userFullName: Jane Doe - description: My public Actor! - pictureUrl: https://... - userPictureUrl: https://... - url: https://... - stats: - totalBuilds: 9 - totalRuns: 16 - totalUsers: 6 - totalUsers7Days: 2 - totalUsers30Days: 6 - totalUsers90Days: 6 - totalMetamorphs: 2 - lastRunStartedAt: 2019-07-08T14:01:05.546Z - currentPricingInfo: - pricingModel: FREE - isWhiteListedForAgenticPayments: true - - id: zdc3Pyhyz3m8vjDeM - title: My Public Actor - name: my-public-actor - username: jane35 - userFullName: Jane H. Doe - categories: - - MARKETING - - LEAD_GENERATION - description: My public Actor! - pictureUrl: https://... - userPictureUrl: https://... - url: https://... - stats: - totalBuilds: 9 - totalRuns: 16 - totalUsers: 6 - totalUsers7Days: 2 - totalUsers30Days: 6 - totalUsers90Days: 6 - totalMetamorphs: 2 - lastRunStartedAt: 2019-07-08T14:01:05.546Z - currentPricingInfo: - pricingModel: FREE - isWhiteListedForAgenticPayments: false - properties: - data: - $ref: "#/components/schemas/ListOfStoreActors" - required: - - data - title: ListOfActorsInStoreResponse - Profile: - example: - bio: bio - name: name - pictureUrl: https://openapi-generator.tech - githubUsername: githubUsername - websiteUrl: https://openapi-generator.tech - twitterUsername: twitterUsername - properties: - bio: - type: string - name: - type: string - pictureUrl: - format: uri - type: string - githubUsername: - type: string - websiteUrl: - format: uri - type: string - twitterUsername: - type: string - title: Profile - UserPublicInfo: - example: - username: username - profile: - bio: bio - name: name - pictureUrl: https://openapi-generator.tech - githubUsername: githubUsername - websiteUrl: https://openapi-generator.tech - twitterUsername: twitterUsername - properties: - username: - type: string - profile: - $ref: "#/components/schemas/Profile" - required: - - username - title: UserPublicInfo - PublicUserDataResponse: - example: - data: - username: username - profile: - bio: bio - name: name - pictureUrl: https://openapi-generator.tech - githubUsername: githubUsername - websiteUrl: https://openapi-generator.tech - twitterUsername: twitterUsername - properties: - data: - $ref: "#/components/schemas/UserPublicInfo" - required: - - data - title: PublicUserDataResponse - ProxyGroup: - example: - name: name - description: description - availableCount: 0 - properties: - name: - type: string - description: - nullable: true - type: string - availableCount: - type: integer - required: - - availableCount - - description - - name - title: ProxyGroup - Proxy: - example: - password: password - groups: - - name: name - description: description - availableCount: 0 - - name: name - description: description - availableCount: 0 - properties: - password: - type: string - groups: - items: - $ref: "#/components/schemas/ProxyGroup" - type: array - default: null - required: - - groups - - password - title: Proxy - AvailableProxyGroups: - additionalProperties: - description: The number of available proxies in this group. - type: integer - description: | - A dictionary mapping proxy group names to the number of available proxies in each group. - The keys are proxy group names (e.g., "RESIDENTIAL", "DATACENTER") and values are - the count of available proxies. - example: - RESIDENTIAL: 1000 - DATACENTER: 500 - GOOGLE_SERP: 200 - title: AvailableProxyGroups - Plan: - example: - id: id - description: description - isEnabled: true - monthlyBasePriceUsd: 6.027456183070403 - monthlyUsageCreditsUsd: 1.4658129805029452 - usageDiscountPercent: 5.962133916683182 - enabledPlatformFeatures: - - ACTORS - - STORAGE - - PROXY_SERPS - - SCHEDULER - - WEBHOOKS - maxMonthlyUsageUsd: 5.637376656633329 - maxActorMemoryGbytes: 2.3021358869347655 - maxMonthlyActorComputeUnits: 7.061401241503109 - maxMonthlyResidentialProxyGbytes: 9.301444243932576 - maxMonthlyProxySerps: 3 - maxMonthlyExternalDataTransferGbytes: 2.027123023002322 - maxActorCount: 4 - maxActorTaskCount: 7 - dataRetentionDays: 1 - availableProxyGroups: - RESIDENTIAL: 1000 - DATACENTER: 500 - GOOGLE_SERP: 200 - teamAccountSeatCount: 1 - supportLevel: supportLevel - availableAddOns: - - availableAddOns - - availableAddOns - tier: tier - apiRateLimitBoosts: 1 - maxScheduleCount: 6 - maxConcurrentActorRuns: 7 - planPricing: - key: "" - properties: - id: - type: string - description: - type: string - isEnabled: - type: boolean - monthlyBasePriceUsd: - type: number - monthlyUsageCreditsUsd: - type: number - usageDiscountPercent: - type: number - enabledPlatformFeatures: - example: - - ACTORS - - STORAGE - - PROXY_SERPS - - SCHEDULER - - WEBHOOKS - items: - type: string - type: array - default: null - maxMonthlyUsageUsd: - type: number - maxActorMemoryGbytes: - type: number - maxMonthlyActorComputeUnits: - type: number - maxMonthlyResidentialProxyGbytes: - type: number - maxMonthlyProxySerps: - type: integer - maxMonthlyExternalDataTransferGbytes: - type: number - maxActorCount: - type: integer - maxActorTaskCount: - type: integer - dataRetentionDays: - type: integer - availableProxyGroups: - additionalProperties: - description: The number of available proxies in this group. - type: integer - description: | - A dictionary mapping proxy group names to the number of available proxies in each group. - The keys are proxy group names (e.g., "RESIDENTIAL", "DATACENTER") and values are - the count of available proxies. - example: - RESIDENTIAL: 1000 - DATACENTER: 500 - GOOGLE_SERP: 200 - title: AvailableProxyGroups - teamAccountSeatCount: - type: integer - supportLevel: - type: string - availableAddOns: - items: - type: string - type: array - default: null - tier: - type: string - apiRateLimitBoosts: - type: integer - maxScheduleCount: - type: integer - maxConcurrentActorRuns: - type: integer - planPricing: - additionalProperties: true - description: Pricing details for this plan. - type: object - required: - - availableAddOns - - availableProxyGroups - - dataRetentionDays - - description - - enabledPlatformFeatures - - id - - isEnabled - - maxActorCount - - maxActorMemoryGbytes - - maxActorTaskCount - - maxMonthlyActorComputeUnits - - maxMonthlyExternalDataTransferGbytes - - maxMonthlyProxySerps - - maxMonthlyResidentialProxyGbytes - - maxMonthlyUsageUsd - - monthlyBasePriceUsd - - monthlyUsageCreditsUsd - - supportLevel - - teamAccountSeatCount - title: Plan - EffectivePlatformFeature: - example: - isEnabled: true - disabledReason: disabledReason - disabledReasonType: disabledReasonType - isTrial: true - trialExpirationAt: 2000-01-23T04:56:07.000+00:00 - properties: - isEnabled: - type: boolean - disabledReason: - nullable: true - type: string - disabledReasonType: - nullable: true - type: string - isTrial: - type: boolean - trialExpirationAt: - format: date-time - nullable: true - type: string - required: - - disabledReason - - disabledReasonType - - isEnabled - - isTrial - - trialExpirationAt - title: EffectivePlatformFeature - EffectivePlatformFeatures: - example: - ACTORS: - isEnabled: true - disabledReason: disabledReason - disabledReasonType: disabledReasonType - isTrial: true - trialExpirationAt: 2000-01-23T04:56:07.000+00:00 - STORAGE: - isEnabled: true - disabledReason: disabledReason - disabledReasonType: disabledReasonType - isTrial: true - trialExpirationAt: 2000-01-23T04:56:07.000+00:00 - SCHEDULER: - isEnabled: true - disabledReason: disabledReason - disabledReasonType: disabledReasonType - isTrial: true - trialExpirationAt: 2000-01-23T04:56:07.000+00:00 - PROXY: - isEnabled: true - disabledReason: disabledReason - disabledReasonType: disabledReasonType - isTrial: true - trialExpirationAt: 2000-01-23T04:56:07.000+00:00 - PROXY_EXTERNAL_ACCESS: - isEnabled: true - disabledReason: disabledReason - disabledReasonType: disabledReasonType - isTrial: true - trialExpirationAt: 2000-01-23T04:56:07.000+00:00 - PROXY_RESIDENTIAL: - isEnabled: true - disabledReason: disabledReason - disabledReasonType: disabledReasonType - isTrial: true - trialExpirationAt: 2000-01-23T04:56:07.000+00:00 - PROXY_SERPS: - isEnabled: true - disabledReason: disabledReason - disabledReasonType: disabledReasonType - isTrial: true - trialExpirationAt: 2000-01-23T04:56:07.000+00:00 - WEBHOOKS: - isEnabled: true - disabledReason: disabledReason - disabledReasonType: disabledReasonType - isTrial: true - trialExpirationAt: 2000-01-23T04:56:07.000+00:00 - ACTORS_PUBLIC_ALL: - isEnabled: true - disabledReason: disabledReason - disabledReasonType: disabledReasonType - isTrial: true - trialExpirationAt: 2000-01-23T04:56:07.000+00:00 - ACTORS_PUBLIC_DEVELOPER: - isEnabled: true - disabledReason: disabledReason - disabledReasonType: disabledReasonType - isTrial: true - trialExpirationAt: 2000-01-23T04:56:07.000+00:00 - properties: - ACTORS: - $ref: "#/components/schemas/EffectivePlatformFeature" - STORAGE: - $ref: "#/components/schemas/EffectivePlatformFeature" - SCHEDULER: - $ref: "#/components/schemas/EffectivePlatformFeature" - PROXY: - $ref: "#/components/schemas/EffectivePlatformFeature" - PROXY_EXTERNAL_ACCESS: - $ref: "#/components/schemas/EffectivePlatformFeature" - PROXY_RESIDENTIAL: - $ref: "#/components/schemas/EffectivePlatformFeature" - PROXY_SERPS: - $ref: "#/components/schemas/EffectivePlatformFeature" - WEBHOOKS: - $ref: "#/components/schemas/EffectivePlatformFeature" - ACTORS_PUBLIC_ALL: - $ref: "#/components/schemas/EffectivePlatformFeature" - ACTORS_PUBLIC_DEVELOPER: - $ref: "#/components/schemas/EffectivePlatformFeature" - required: - - ACTORS - - ACTORS_PUBLIC_ALL - - ACTORS_PUBLIC_DEVELOPER - - PROXY - - PROXY_EXTERNAL_ACCESS - - PROXY_RESIDENTIAL - - PROXY_SERPS - - SCHEDULER - - STORAGE - - WEBHOOKS - title: EffectivePlatformFeatures - UserPrivateInfo: - example: - id: id - username: username - profile: - bio: bio - name: name - pictureUrl: https://openapi-generator.tech - githubUsername: githubUsername - websiteUrl: https://openapi-generator.tech - twitterUsername: twitterUsername - email: email - proxy: - password: password - groups: - - name: name - description: description - availableCount: 0 - - name: name - description: description - availableCount: 0 - plan: - id: id - description: description - isEnabled: true - monthlyBasePriceUsd: 6.027456183070403 - monthlyUsageCreditsUsd: 1.4658129805029452 - usageDiscountPercent: 5.962133916683182 - enabledPlatformFeatures: - - ACTORS - - STORAGE - - PROXY_SERPS - - SCHEDULER - - WEBHOOKS - maxMonthlyUsageUsd: 5.637376656633329 - maxActorMemoryGbytes: 2.3021358869347655 - maxMonthlyActorComputeUnits: 7.061401241503109 - maxMonthlyResidentialProxyGbytes: 9.301444243932576 - maxMonthlyProxySerps: 3 - maxMonthlyExternalDataTransferGbytes: 2.027123023002322 - maxActorCount: 4 - maxActorTaskCount: 7 - dataRetentionDays: 1 - availableProxyGroups: - RESIDENTIAL: 1000 - DATACENTER: 500 - GOOGLE_SERP: 200 - teamAccountSeatCount: 1 - supportLevel: supportLevel - availableAddOns: - - availableAddOns - - availableAddOns - tier: tier - apiRateLimitBoosts: 1 - maxScheduleCount: 6 - maxConcurrentActorRuns: 7 - planPricing: - key: "" - effectivePlatformFeatures: - ACTORS: - isEnabled: true - disabledReason: disabledReason - disabledReasonType: disabledReasonType - isTrial: true - trialExpirationAt: 2000-01-23T04:56:07.000+00:00 - STORAGE: - isEnabled: true - disabledReason: disabledReason - disabledReasonType: disabledReasonType - isTrial: true - trialExpirationAt: 2000-01-23T04:56:07.000+00:00 - SCHEDULER: - isEnabled: true - disabledReason: disabledReason - disabledReasonType: disabledReasonType - isTrial: true - trialExpirationAt: 2000-01-23T04:56:07.000+00:00 - PROXY: - isEnabled: true - disabledReason: disabledReason - disabledReasonType: disabledReasonType - isTrial: true - trialExpirationAt: 2000-01-23T04:56:07.000+00:00 - PROXY_EXTERNAL_ACCESS: - isEnabled: true - disabledReason: disabledReason - disabledReasonType: disabledReasonType - isTrial: true - trialExpirationAt: 2000-01-23T04:56:07.000+00:00 - PROXY_RESIDENTIAL: - isEnabled: true - disabledReason: disabledReason - disabledReasonType: disabledReasonType - isTrial: true - trialExpirationAt: 2000-01-23T04:56:07.000+00:00 - PROXY_SERPS: - isEnabled: true - disabledReason: disabledReason - disabledReasonType: disabledReasonType - isTrial: true - trialExpirationAt: 2000-01-23T04:56:07.000+00:00 - WEBHOOKS: - isEnabled: true - disabledReason: disabledReason - disabledReasonType: disabledReasonType - isTrial: true - trialExpirationAt: 2000-01-23T04:56:07.000+00:00 - ACTORS_PUBLIC_ALL: - isEnabled: true - disabledReason: disabledReason - disabledReasonType: disabledReasonType - isTrial: true - trialExpirationAt: 2000-01-23T04:56:07.000+00:00 - ACTORS_PUBLIC_DEVELOPER: - isEnabled: true - disabledReason: disabledReason - disabledReasonType: disabledReasonType - isTrial: true - trialExpirationAt: 2000-01-23T04:56:07.000+00:00 - createdAt: 2000-01-23T04:56:07.000+00:00 - isPaying: true - properties: - id: - type: string - username: - type: string - profile: - $ref: "#/components/schemas/Profile" - email: - format: email - type: string - proxy: - $ref: "#/components/schemas/Proxy" - plan: - $ref: "#/components/schemas/Plan" - effectivePlatformFeatures: - $ref: "#/components/schemas/EffectivePlatformFeatures" - createdAt: - format: date-time - type: string - isPaying: - type: boolean - required: - - createdAt - - effectivePlatformFeatures - - email - - id - - isPaying - - plan - - profile - - proxy - - username - title: UserPrivateInfo - PrivateUserDataResponse: - example: - data: - id: id - username: username - profile: - bio: bio - name: name - pictureUrl: https://openapi-generator.tech - githubUsername: githubUsername - websiteUrl: https://openapi-generator.tech - twitterUsername: twitterUsername - email: email - proxy: - password: password - groups: - - name: name - description: description - availableCount: 0 - - name: name - description: description - availableCount: 0 - plan: - id: id - description: description - isEnabled: true - monthlyBasePriceUsd: 6.027456183070403 - monthlyUsageCreditsUsd: 1.4658129805029452 - usageDiscountPercent: 5.962133916683182 - enabledPlatformFeatures: - - ACTORS - - STORAGE - - PROXY_SERPS - - SCHEDULER - - WEBHOOKS - maxMonthlyUsageUsd: 5.637376656633329 - maxActorMemoryGbytes: 2.3021358869347655 - maxMonthlyActorComputeUnits: 7.061401241503109 - maxMonthlyResidentialProxyGbytes: 9.301444243932576 - maxMonthlyProxySerps: 3 - maxMonthlyExternalDataTransferGbytes: 2.027123023002322 - maxActorCount: 4 - maxActorTaskCount: 7 - dataRetentionDays: 1 - availableProxyGroups: - RESIDENTIAL: 1000 - DATACENTER: 500 - GOOGLE_SERP: 200 - teamAccountSeatCount: 1 - supportLevel: supportLevel - availableAddOns: - - availableAddOns - - availableAddOns - tier: tier - apiRateLimitBoosts: 1 - maxScheduleCount: 6 - maxConcurrentActorRuns: 7 - planPricing: - key: "" - effectivePlatformFeatures: - ACTORS: - isEnabled: true - disabledReason: disabledReason - disabledReasonType: disabledReasonType - isTrial: true - trialExpirationAt: 2000-01-23T04:56:07.000+00:00 - STORAGE: - isEnabled: true - disabledReason: disabledReason - disabledReasonType: disabledReasonType - isTrial: true - trialExpirationAt: 2000-01-23T04:56:07.000+00:00 - SCHEDULER: - isEnabled: true - disabledReason: disabledReason - disabledReasonType: disabledReasonType - isTrial: true - trialExpirationAt: 2000-01-23T04:56:07.000+00:00 - PROXY: - isEnabled: true - disabledReason: disabledReason - disabledReasonType: disabledReasonType - isTrial: true - trialExpirationAt: 2000-01-23T04:56:07.000+00:00 - PROXY_EXTERNAL_ACCESS: - isEnabled: true - disabledReason: disabledReason - disabledReasonType: disabledReasonType - isTrial: true - trialExpirationAt: 2000-01-23T04:56:07.000+00:00 - PROXY_RESIDENTIAL: - isEnabled: true - disabledReason: disabledReason - disabledReasonType: disabledReasonType - isTrial: true - trialExpirationAt: 2000-01-23T04:56:07.000+00:00 - PROXY_SERPS: - isEnabled: true - disabledReason: disabledReason - disabledReasonType: disabledReasonType - isTrial: true - trialExpirationAt: 2000-01-23T04:56:07.000+00:00 - WEBHOOKS: - isEnabled: true - disabledReason: disabledReason - disabledReasonType: disabledReasonType - isTrial: true - trialExpirationAt: 2000-01-23T04:56:07.000+00:00 - ACTORS_PUBLIC_ALL: - isEnabled: true - disabledReason: disabledReason - disabledReasonType: disabledReasonType - isTrial: true - trialExpirationAt: 2000-01-23T04:56:07.000+00:00 - ACTORS_PUBLIC_DEVELOPER: - isEnabled: true - disabledReason: disabledReason - disabledReasonType: disabledReasonType - isTrial: true - trialExpirationAt: 2000-01-23T04:56:07.000+00:00 - createdAt: 2000-01-23T04:56:07.000+00:00 - isPaying: true - properties: - data: - $ref: "#/components/schemas/UserPrivateInfo" - required: - - data - title: PrivateUserDataResponse - UsageCycle: - example: - startAt: 2000-01-23T04:56:07.000+00:00 - endAt: 2000-01-23T04:56:07.000+00:00 - properties: - startAt: - format: date-time - type: string - endAt: - format: date-time - type: string - required: - - endAt - - startAt - title: UsageCycle - PriceTiers: - example: - quantityAbove: 5.637376656633329 - discountPercent: 2.3021358869347655 - tierQuantity: 7.061401241503109 - unitPriceUsd: 9.301444243932576 - priceUsd: 3.616076749251911 - properties: - quantityAbove: - type: number - discountPercent: - type: number - tierQuantity: - type: number - unitPriceUsd: - type: number - priceUsd: - type: number - required: - - discountPercent - - priceUsd - - quantityAbove - - tierQuantity - - unitPriceUsd - title: PriceTiers - UsageItem: - example: - quantity: 0.8008281904610115 - baseAmountUsd: 6.027456183070403 - baseUnitPriceUsd: 1.4658129805029452 - amountAfterVolumeDiscountUsd: 5.962133916683182 - priceTiers: - - quantityAbove: 5.637376656633329 - discountPercent: 2.3021358869347655 - tierQuantity: 7.061401241503109 - unitPriceUsd: 9.301444243932576 - priceUsd: 3.616076749251911 - - quantityAbove: 5.637376656633329 - discountPercent: 2.3021358869347655 - tierQuantity: 7.061401241503109 - unitPriceUsd: 9.301444243932576 - priceUsd: 3.616076749251911 - properties: - quantity: - type: number - baseAmountUsd: - type: number - baseUnitPriceUsd: - type: number - amountAfterVolumeDiscountUsd: - type: number - priceTiers: - description: "" - items: - $ref: "#/components/schemas/PriceTiers" - type: array - default: null - required: - - baseAmountUsd - - quantity - title: UsageItem - MonthlyServiceUsage: - additionalProperties: - $ref: "#/components/schemas/UsageItem" - description: "A map of usage item names (e.g., ACTOR_COMPUTE_UNITS) to their\ - \ usage details." - title: MonthlyServiceUsage - ServiceUsage: - additionalProperties: - $ref: "#/components/schemas/UsageItem" - description: A map of service usage item names to their usage details. - example: - ACTOR_COMPUTE_UNITS: - quantity: 60 - baseAmountUsd: 3.0000000000000003E-4 - baseUnitPriceUsd: 5.0E-6 - amountAfterVolumeDiscountUsd: 3.0000000000000003E-4 - priceTiers: [] - title: ServiceUsage - DailyServiceUsages: - example: - date: date - serviceUsage: - ACTOR_COMPUTE_UNITS: - quantity: 60 - baseAmountUsd: 3.0000000000000003E-4 - baseUnitPriceUsd: 5.0E-6 - amountAfterVolumeDiscountUsd: 3.0000000000000003E-4 - priceTiers: [] - totalUsageCreditsUsd: 2.027123023002322 - properties: - date: - type: string - serviceUsage: - additionalProperties: - $ref: "#/components/schemas/UsageItem" - description: A map of service usage item names to their usage details. - example: - ACTOR_COMPUTE_UNITS: - quantity: 60 - baseAmountUsd: 3.0000000000000003E-4 - baseUnitPriceUsd: 5.0E-6 - amountAfterVolumeDiscountUsd: 3.0000000000000003E-4 - priceTiers: [] - title: ServiceUsage - totalUsageCreditsUsd: - type: number - required: - - date - - serviceUsage - - totalUsageCreditsUsd - title: DailyServiceUsages - MonthlyUsage: - example: - usageCycle: - startAt: 2000-01-23T04:56:07.000+00:00 - endAt: 2000-01-23T04:56:07.000+00:00 - monthlyServiceUsage: - key: - quantity: 0.8008281904610115 - baseAmountUsd: 6.027456183070403 - baseUnitPriceUsd: 1.4658129805029452 - amountAfterVolumeDiscountUsd: 5.962133916683182 - priceTiers: - - quantityAbove: 5.637376656633329 - discountPercent: 2.3021358869347655 - tierQuantity: 7.061401241503109 - unitPriceUsd: 9.301444243932576 - priceUsd: 3.616076749251911 - - quantityAbove: 5.637376656633329 - discountPercent: 2.3021358869347655 - tierQuantity: 7.061401241503109 - unitPriceUsd: 9.301444243932576 - priceUsd: 3.616076749251911 - dailyServiceUsages: - - date: date - serviceUsage: - ACTOR_COMPUTE_UNITS: - quantity: 60 - baseAmountUsd: 3.0000000000000003E-4 - baseUnitPriceUsd: 5.0E-6 - amountAfterVolumeDiscountUsd: 3.0000000000000003E-4 - priceTiers: [] - totalUsageCreditsUsd: 2.027123023002322 - - date: date - serviceUsage: - ACTOR_COMPUTE_UNITS: - quantity: 60 - baseAmountUsd: 3.0000000000000003E-4 - baseUnitPriceUsd: 5.0E-6 - amountAfterVolumeDiscountUsd: 3.0000000000000003E-4 - priceTiers: [] - totalUsageCreditsUsd: 2.027123023002322 - totalUsageCreditsUsdBeforeVolumeDiscount: 4.145608029883936 - totalUsageCreditsUsdAfterVolumeDiscount: 7.386281948385884 - properties: - usageCycle: - $ref: "#/components/schemas/UsageCycle" - monthlyServiceUsage: - additionalProperties: - $ref: "#/components/schemas/UsageItem" - description: "A map of usage item names (e.g., ACTOR_COMPUTE_UNITS) to their\ - \ usage details." - title: MonthlyServiceUsage - dailyServiceUsages: - description: "" - items: - $ref: "#/components/schemas/DailyServiceUsages" - type: array - default: null - totalUsageCreditsUsdBeforeVolumeDiscount: - type: number - totalUsageCreditsUsdAfterVolumeDiscount: - type: number - required: - - dailyServiceUsages - - monthlyServiceUsage - - totalUsageCreditsUsdAfterVolumeDiscount - - totalUsageCreditsUsdBeforeVolumeDiscount - - usageCycle - title: MonthlyUsage - MonthlyUsageResponse: - example: - data: - usageCycle: - startAt: 2000-01-23T04:56:07.000+00:00 - endAt: 2000-01-23T04:56:07.000+00:00 - monthlyServiceUsage: - key: - quantity: 0.8008281904610115 - baseAmountUsd: 6.027456183070403 - baseUnitPriceUsd: 1.4658129805029452 - amountAfterVolumeDiscountUsd: 5.962133916683182 - priceTiers: - - quantityAbove: 5.637376656633329 - discountPercent: 2.3021358869347655 - tierQuantity: 7.061401241503109 - unitPriceUsd: 9.301444243932576 - priceUsd: 3.616076749251911 - - quantityAbove: 5.637376656633329 - discountPercent: 2.3021358869347655 - tierQuantity: 7.061401241503109 - unitPriceUsd: 9.301444243932576 - priceUsd: 3.616076749251911 - dailyServiceUsages: - - date: date - serviceUsage: - ACTOR_COMPUTE_UNITS: - quantity: 60 - baseAmountUsd: 3.0000000000000003E-4 - baseUnitPriceUsd: 5.0E-6 - amountAfterVolumeDiscountUsd: 3.0000000000000003E-4 - priceTiers: [] - totalUsageCreditsUsd: 2.027123023002322 - - date: date - serviceUsage: - ACTOR_COMPUTE_UNITS: - quantity: 60 - baseAmountUsd: 3.0000000000000003E-4 - baseUnitPriceUsd: 5.0E-6 - amountAfterVolumeDiscountUsd: 3.0000000000000003E-4 - priceTiers: [] - totalUsageCreditsUsd: 2.027123023002322 - totalUsageCreditsUsdBeforeVolumeDiscount: 4.145608029883936 - totalUsageCreditsUsdAfterVolumeDiscount: 7.386281948385884 - properties: - data: - $ref: "#/components/schemas/MonthlyUsage" - required: - - data - title: MonthlyUsageResponse - Limits: - example: - maxMonthlyUsageUsd: 0.8008281904610115 - maxMonthlyActorComputeUnits: 6.027456183070403 - maxMonthlyExternalDataTransferGbytes: 1.4658129805029452 - maxMonthlyProxySerps: 5 - maxMonthlyResidentialProxyGbytes: 5.637376656633329 - maxActorMemoryGbytes: 2.3021358869347655 - maxActorCount: 7 - maxActorTaskCount: 9 - maxConcurrentActorJobs: 3 - maxTeamAccountSeatCount: 2 - dataRetentionDays: 4 - maxScheduleCount: 7 - properties: - maxMonthlyUsageUsd: - type: number - maxMonthlyActorComputeUnits: - type: number - maxMonthlyExternalDataTransferGbytes: - type: number - maxMonthlyProxySerps: - type: integer - maxMonthlyResidentialProxyGbytes: - type: number - maxActorMemoryGbytes: - type: number - maxActorCount: - type: integer - maxActorTaskCount: - type: integer - maxConcurrentActorJobs: - type: integer - maxTeamAccountSeatCount: - type: integer - dataRetentionDays: - type: integer - maxScheduleCount: - type: integer - required: - - dataRetentionDays - - maxActorCount - - maxActorMemoryGbytes - - maxActorTaskCount - - maxConcurrentActorJobs - - maxMonthlyActorComputeUnits - - maxMonthlyExternalDataTransferGbytes - - maxMonthlyProxySerps - - maxMonthlyResidentialProxyGbytes - - maxMonthlyUsageUsd - - maxTeamAccountSeatCount - title: Limits - Current: - example: - monthlyUsageUsd: 1.2315135367772556 - monthlyActorComputeUnits: 1.0246457001441578 - monthlyExternalDataTransferGbytes: 1.4894159098541704 - monthlyProxySerps: 6 - monthlyResidentialProxyGbytes: 7.457744773683766 - actorMemoryGbytes: 1.1730742509559433 - actorCount: 4 - actorTaskCount: 5 - activeActorJobCount: 9 - teamAccountSeatCount: 9 - scheduleCount: 6 - properties: - monthlyUsageUsd: - type: number - monthlyActorComputeUnits: - type: number - monthlyExternalDataTransferGbytes: - type: number - monthlyProxySerps: - type: integer - monthlyResidentialProxyGbytes: - type: number - actorMemoryGbytes: - type: number - actorCount: - type: integer - actorTaskCount: - type: integer - activeActorJobCount: - type: integer - teamAccountSeatCount: - type: integer - scheduleCount: - type: integer - required: - - activeActorJobCount - - actorCount - - actorMemoryGbytes - - actorTaskCount - - monthlyActorComputeUnits - - monthlyExternalDataTransferGbytes - - monthlyProxySerps - - monthlyResidentialProxyGbytes - - monthlyUsageUsd - - teamAccountSeatCount - title: Current - AccountLimits: - example: - monthlyUsageCycle: - startAt: 2000-01-23T04:56:07.000+00:00 - endAt: 2000-01-23T04:56:07.000+00:00 - limits: - maxMonthlyUsageUsd: 0.8008281904610115 - maxMonthlyActorComputeUnits: 6.027456183070403 - maxMonthlyExternalDataTransferGbytes: 1.4658129805029452 - maxMonthlyProxySerps: 5 - maxMonthlyResidentialProxyGbytes: 5.637376656633329 - maxActorMemoryGbytes: 2.3021358869347655 - maxActorCount: 7 - maxActorTaskCount: 9 - maxConcurrentActorJobs: 3 - maxTeamAccountSeatCount: 2 - dataRetentionDays: 4 - maxScheduleCount: 7 - current: - monthlyUsageUsd: 1.2315135367772556 - monthlyActorComputeUnits: 1.0246457001441578 - monthlyExternalDataTransferGbytes: 1.4894159098541704 - monthlyProxySerps: 6 - monthlyResidentialProxyGbytes: 7.457744773683766 - actorMemoryGbytes: 1.1730742509559433 - actorCount: 4 - actorTaskCount: 5 - activeActorJobCount: 9 - teamAccountSeatCount: 9 - scheduleCount: 6 - properties: - monthlyUsageCycle: - $ref: "#/components/schemas/UsageCycle" - limits: - $ref: "#/components/schemas/Limits" - current: - $ref: "#/components/schemas/Current" - required: - - current - - limits - - monthlyUsageCycle - title: AccountLimits - LimitsResponse: - example: - data: - monthlyUsageCycle: - startAt: 2000-01-23T04:56:07.000+00:00 - endAt: 2000-01-23T04:56:07.000+00:00 - limits: - maxMonthlyUsageUsd: 0.8008281904610115 - maxMonthlyActorComputeUnits: 6.027456183070403 - maxMonthlyExternalDataTransferGbytes: 1.4658129805029452 - maxMonthlyProxySerps: 5 - maxMonthlyResidentialProxyGbytes: 5.637376656633329 - maxActorMemoryGbytes: 2.3021358869347655 - maxActorCount: 7 - maxActorTaskCount: 9 - maxConcurrentActorJobs: 3 - maxTeamAccountSeatCount: 2 - dataRetentionDays: 4 - maxScheduleCount: 7 - current: - monthlyUsageUsd: 1.2315135367772556 - monthlyActorComputeUnits: 1.0246457001441578 - monthlyExternalDataTransferGbytes: 1.4894159098541704 - monthlyProxySerps: 6 - monthlyResidentialProxyGbytes: 7.457744773683766 - actorMemoryGbytes: 1.1730742509559433 - actorCount: 4 - actorTaskCount: 5 - activeActorJobCount: 9 - teamAccountSeatCount: 9 - scheduleCount: 6 - properties: - data: - $ref: "#/components/schemas/AccountLimits" - required: - - data - title: LimitsResponse - UpdateLimitsRequest: - example: - maxMonthlyUsageUsd: 0.8008281904610115 - dataRetentionDays: 6 - properties: - maxMonthlyUsageUsd: - description: | - If your platform usage in the billing period exceeds the prepaid usage, you will be charged extra. Setting this property you can update your hard limit on monthly platform usage to prevent accidental overage or to limit the extra charges. - type: number - dataRetentionDays: - description: | - Apify securely stores your ten most recent Actor runs indefinitely, ensuring they are always accessible. Unnamed storages and other Actor runs are automatically deleted after the retention period. If you're subscribed, you can change it to keep data for longer or to limit your usage. [Lear more](https://docs.apify.com/platform/storage/usage#data-retention). - type: integer - title: UpdateLimitsRequest - BrowserInfoResponse: - example: - method: GET - clientIp: 1.2.3.4 - countryCode: US - bodyLength: 0 - headers: - key: BrowserInfoResponse_headers_value - rawHeaders: - - rawHeaders - - rawHeaders - properties: - method: - description: HTTP method of the request. - example: GET - type: string - clientIp: - description: IP address of the client. - example: 1.2.3.4 - nullable: true - type: string - countryCode: - description: Two-letter country code resolved from the client IP address. - example: US - nullable: true - type: string - bodyLength: - description: Length of the request body in bytes. - example: 0 - type: integer - headers: - additionalProperties: - $ref: "#/components/schemas/BrowserInfoResponse_headers_value" - description: | - Request headers. Omitted when `skipHeaders=true`. - rawHeaders: - description: | - Raw request headers as a flat list of alternating name/value strings. - Included only when `rawHeaders=true`. - items: - type: string - type: array - default: null - required: - - bodyLength - - clientIp - - countryCode - - method - EncodeAndSignData: - example: - encoded: encoded - properties: - encoded: - type: string - required: - - encoded - title: EncodeAndSignData - EncodeAndSignResponse: - example: - data: - encoded: encoded - properties: - data: - $ref: "#/components/schemas/EncodeAndSignData" - required: - - data - title: EncodeAndSignResponse - DecodeAndVerifyRequest: - example: - encoded: encoded - properties: - encoded: - type: string - required: - - encoded - title: DecodeAndVerifyRequest - DecodeAndVerifyData: - example: - decoded: "" - encodedByUserId: encodedByUserId - isVerifiedUser: true - properties: - decoded: {} - encodedByUserId: - nullable: true - type: string - isVerifiedUser: - type: boolean - required: - - decoded - - encodedByUserId - - isVerifiedUser - title: DecodeAndVerifyData - DecodeAndVerifyResponse: - example: - data: - decoded: "" - encodedByUserId: encodedByUserId - isVerifiedUser: true - properties: - data: - $ref: "#/components/schemas/DecodeAndVerifyData" - required: - - data - title: DecodeAndVerifyResponse - act_validateInput_post_200_response: - example: - valid: true - properties: - valid: - description: Whether the input is valid according to the Actor's input schema. - type: boolean - required: - - valid - act_runs_last_dataset_items_post_request: - description: "" - oneOf: - - $ref: "#/components/schemas/PutItemsRequest" - - items: - $ref: "#/components/schemas/PutItemsRequest" - type: array - default: null - act_runs_last_dataset_items_post_400_response: - anyOf: - - $ref: "#/components/schemas/PutItemResponseError" - - $ref: "#/components/schemas/ErrorResponse" - actorTask_get_200_response: - example: - data: - id: id - userId: userId - actId: actId - name: name - username: username - createdAt: 2000-01-23T04:56:07.000+00:00 - modifiedAt: 2000-01-23T04:56:07.000+00:00 - removedAt: 2000-01-23T04:56:07.000+00:00 - stats: "" - options: "" - input: "" - title: title - actorStandby: "" - standbyUrl: https://openapi-generator.tech - properties: - data: - $ref: "#/components/schemas/Task" - required: - - data - actorTask_webhooks_get_200_response_data: - allOf: - - $ref: "#/components/schemas/PaginationResponse" - - properties: - items: - items: - $ref: "#/components/schemas/Webhook" - type: array - default: null - required: - - items - example: - total: 0 - offset: 0 - limit: 1 - desc: true - count: 0 - items: - - id: id - createdAt: 2000-01-23T04:56:07.000+00:00 - modifiedAt: 2000-01-23T04:56:07.000+00:00 - userId: userId - isAdHoc: true - shouldInterpolateStrings: true - eventTypes: - - ACTOR.BUILD.ABORTED - - ACTOR.BUILD.ABORTED - condition: - actorId: actorId - actorTaskId: actorTaskId - actorRunId: actorRunId - ignoreSslErrors: true - doNotRetry: true - requestUrl: https://openapi-generator.tech - payloadTemplate: payloadTemplate - headersTemplate: headersTemplate - description: description - lastDispatch: "" - stats: "" - - id: id - createdAt: 2000-01-23T04:56:07.000+00:00 - modifiedAt: 2000-01-23T04:56:07.000+00:00 - userId: userId - isAdHoc: true - shouldInterpolateStrings: true - eventTypes: - - ACTOR.BUILD.ABORTED - - ACTOR.BUILD.ABORTED - condition: - actorId: actorId - actorTaskId: actorTaskId - actorRunId: actorRunId - ignoreSslErrors: true - doNotRetry: true - requestUrl: https://openapi-generator.tech - payloadTemplate: payloadTemplate - headersTemplate: headersTemplate - description: description - lastDispatch: "" - stats: "" - actorTask_webhooks_get_200_response: - example: - data: - total: 0 - offset: 0 - limit: 1 - desc: true - count: 0 - items: - - id: id - createdAt: 2000-01-23T04:56:07.000+00:00 - modifiedAt: 2000-01-23T04:56:07.000+00:00 - userId: userId - isAdHoc: true - shouldInterpolateStrings: true - eventTypes: - - ACTOR.BUILD.ABORTED - - ACTOR.BUILD.ABORTED - condition: - actorId: actorId - actorTaskId: actorTaskId - actorRunId: actorRunId - ignoreSslErrors: true - doNotRetry: true - requestUrl: https://openapi-generator.tech - payloadTemplate: payloadTemplate - headersTemplate: headersTemplate - description: description - lastDispatch: "" - stats: "" - - id: id - createdAt: 2000-01-23T04:56:07.000+00:00 - modifiedAt: 2000-01-23T04:56:07.000+00:00 - userId: userId - isAdHoc: true - shouldInterpolateStrings: true - eventTypes: - - ACTOR.BUILD.ABORTED - - ACTOR.BUILD.ABORTED - condition: - actorId: actorId - actorTaskId: actorTaskId - actorRunId: actorRunId - ignoreSslErrors: true - doNotRetry: true - requestUrl: https://openapi-generator.tech - payloadTemplate: payloadTemplate - headersTemplate: headersTemplate - description: description - lastDispatch: "" - stats: "" - properties: - data: - $ref: "#/components/schemas/actorTask_webhooks_get_200_response_data" - required: - - data - actorTask_runs_get_200_response_data: - allOf: - - $ref: "#/components/schemas/PaginationResponse" - - properties: - items: - items: - $ref: "#/components/schemas/RunShort" - type: array - default: null - required: - - items - example: - total: 0 - offset: 0 - limit: 1 - desc: true - count: 0 - items: - - id: id - actId: actId - userId: userId - actorTaskId: actorTaskId - status: READY - startedAt: 2000-01-23T04:56:07.000+00:00 - finishedAt: 2000-01-23T04:56:07.000+00:00 - buildId: buildId - buildNumber: buildNumber - buildNumberInt: 5 - meta: - origin: DEVELOPMENT - clientIp: clientIp - userAgent: userAgent - scheduleId: scheduleId - scheduledAt: 2000-01-23T04:56:07.000+00:00 - usageTotalUsd: 2.3021358869347655 - defaultKeyValueStoreId: defaultKeyValueStoreId - defaultDatasetId: defaultDatasetId - defaultRequestQueueId: defaultRequestQueueId - - id: id - actId: actId - userId: userId - actorTaskId: actorTaskId - status: READY - startedAt: 2000-01-23T04:56:07.000+00:00 - finishedAt: 2000-01-23T04:56:07.000+00:00 - buildId: buildId - buildNumber: buildNumber - buildNumberInt: 5 - meta: - origin: DEVELOPMENT - clientIp: clientIp - userAgent: userAgent - scheduleId: scheduleId - scheduledAt: 2000-01-23T04:56:07.000+00:00 - usageTotalUsd: 2.3021358869347655 - defaultKeyValueStoreId: defaultKeyValueStoreId - defaultDatasetId: defaultDatasetId - defaultRequestQueueId: defaultRequestQueueId - actorTask_runs_get_200_response: - example: - data: - total: 0 - offset: 0 - limit: 1 - desc: true - count: 0 - items: - - id: id - actId: actId - userId: userId - actorTaskId: actorTaskId - status: READY - startedAt: 2000-01-23T04:56:07.000+00:00 - finishedAt: 2000-01-23T04:56:07.000+00:00 - buildId: buildId - buildNumber: buildNumber - buildNumberInt: 5 - meta: - origin: DEVELOPMENT - clientIp: clientIp - userAgent: userAgent - scheduleId: scheduleId - scheduledAt: 2000-01-23T04:56:07.000+00:00 - usageTotalUsd: 2.3021358869347655 - defaultKeyValueStoreId: defaultKeyValueStoreId - defaultDatasetId: defaultDatasetId - defaultRequestQueueId: defaultRequestQueueId - - id: id - actId: actId - userId: userId - actorTaskId: actorTaskId - status: READY - startedAt: 2000-01-23T04:56:07.000+00:00 - finishedAt: 2000-01-23T04:56:07.000+00:00 - buildId: buildId - buildNumber: buildNumber - buildNumberInt: 5 - meta: - origin: DEVELOPMENT - clientIp: clientIp - userAgent: userAgent - scheduleId: scheduleId - scheduledAt: 2000-01-23T04:56:07.000+00:00 - usageTotalUsd: 2.3021358869347655 - defaultKeyValueStoreId: defaultKeyValueStoreId - defaultDatasetId: defaultDatasetId - defaultRequestQueueId: defaultRequestQueueId - properties: - data: - $ref: "#/components/schemas/actorTask_runs_get_200_response_data" - required: - - data - actorTask_runs_post_201_response: - example: - data: - id: id - actId: actId - userId: userId - actorTaskId: actorTaskId - startedAt: 2000-01-23T04:56:07.000+00:00 - finishedAt: 2000-01-23T04:56:07.000+00:00 - status: "" - statusMessage: statusMessage - isStatusMessageTerminal: true - meta: "" - pricingInfo: "" - stats: "" - chargedEventCounts: - actor-start: 1 - page-crawled: 150 - data-extracted: 75 - options: "" - buildId: buildId - exitCode: 0 - generalAccess: "" - defaultKeyValueStoreId: defaultKeyValueStoreId - defaultDatasetId: defaultDatasetId - defaultRequestQueueId: defaultRequestQueueId - storageIds: - datasets: - default: wmKPijuyDnPZAPRMk - keyValueStores: - default: wmKPijuyDnPZAPRMk - requestQueues: - default: wmKPijuyDnPZAPRMk - buildNumber: buildNumber - containerUrl: https://openapi-generator.tech - isContainerServerReady: true - gitBranchName: gitBranchName - usage: "" - usageTotalUsd: 6.027456183070403 - usageUsd: "" - metamorphs: - - createdAt: 2000-01-23T04:56:07.000+00:00 - actorId: actorId - buildId: buildId - inputKey: inputKey - - createdAt: 2000-01-23T04:56:07.000+00:00 - actorId: actorId - buildId: buildId - inputKey: inputKey - platformUsageBillingModel: platformUsageBillingModel - properties: - data: - $ref: "#/components/schemas/Run" - required: - - data - ActorStats_publicActorRunStats30Days: - description: Run status counts over the past 30 days. - example: - ABORTED: 4 - FAILED: 7 - SUCCEEDED: 1 - TIMED-OUT: 1 - TOTAL: 1 - properties: - ABORTED: - type: integer - FAILED: - type: integer - SUCCEEDED: - type: integer - TIMED-OUT: - type: integer - TOTAL: - type: integer - VersionSourceFiles_inner: - anyOf: - - $ref: "#/components/schemas/SourceCodeFile" - - $ref: "#/components/schemas/SourceCodeFolder" - PayPerEventActorPricingInfo_allOf_pricingPerEvent: - example: - actorChargeEvents: - key: - eventTitle: eventTitle - eventDescription: eventDescription - eventPriceUsd: 7.457744773683766 - eventTieredPricingUsd: - key: - tieredEventPriceUsd: 1.1730742509559433 - isPrimaryEvent: true - isOneTimeEvent: true - properties: - actorChargeEvents: - additionalProperties: - $ref: "#/components/schemas/ActorChargeEvent" - TaggedBuilds_value: - anyOf: - - allOf: - - $ref: "#/components/schemas/TaggedBuildInfo" - nullable: true - nullable: true - ActorDefinition_storages: - properties: - dataset: - description: "Defines the schema of items in your dataset, the full specification\ - \ can be found in [Apify docs](https://docs.apify.com/platform/actors/development/actor-definition/dataset-schema)" - type: object - ActorDefinition_defaultMemoryMbytes: - description: "Specifies the default amount of memory in megabytes to be used\ - \ when the Actor is started. Can be an integer or a [dynamic memory expression](/platform/actors/development/actor-definition/dynamic-actor-memory)." - oneOf: - - type: string - - type: integer - BuildActVersion: - description: Snapshot of the Actor version that this build was created from. - properties: - sourceType: - $ref: "#/components/schemas/VersionSourceType" - buildTag: - type: string - versionNumber: - pattern: "^([0-9]|[1-9][0-9])\\.([0-9]|[1-9][0-9])$" - type: string - gitRepoUrl: - description: "URL of the git repository, present when sourceType is GIT_REPO." - type: string - sourceFiles: - description: "Inline source files, present when sourceType is SOURCE_FILES." - items: - $ref: "#/components/schemas/SourceCodeFile" - type: array - default: null - title: BuildActVersion - Run_storageIds_datasets: - additionalProperties: {} - description: Aliased dataset IDs for this run. - example: - default: wmKPijuyDnPZAPRMk - properties: - default: - description: ID of the default dataset for this run. - example: wmKPijuyDnPZAPRMk - type: string - Run_storageIds: - description: "A map of aliased storage IDs associated with this run, grouped\ - \ by storage type." - example: - datasets: - default: wmKPijuyDnPZAPRMk - keyValueStores: - default: wmKPijuyDnPZAPRMk - requestQueues: - default: wmKPijuyDnPZAPRMk - properties: - datasets: - $ref: "#/components/schemas/Run_storageIds_datasets" - keyValueStores: - $ref: "#/components/schemas/Run_storageIds_datasets" - requestQueues: - $ref: "#/components/schemas/Run_storageIds_datasets" - RequestBase_payload: - anyOf: - - type: string - description: "The request payload, typically used with POST or PUT requests." - nullable: true - eventData: - example: - actorId: actorId - actorRunId: actorRunId - properties: - actorId: - type: string - actorRunId: - type: string - required: - - actorId - - actorRunId - title: eventData - calls_inner: - example: - startedAt: 2000-01-23T04:56:07.000+00:00 - finishedAt: 2000-01-23T04:56:07.000+00:00 - errorMessage: errorMessage - responseStatus: 0 - responseBody: "{\"foo\": \"bar\"}" - properties: - startedAt: - format: date-time - nullable: true - type: string - finishedAt: - format: date-time - nullable: true - type: string - errorMessage: - nullable: true - type: string - responseStatus: - nullable: true - type: integer - responseBody: - example: "{\"foo\": \"bar\"}" - nullable: true - type: string - ScheduleNotifications: - description: Notification settings for this schedule. - example: - email: true - properties: - email: - type: boolean - title: ScheduleNotifications - BrowserInfoResponse_headers_value: - oneOf: - - type: string - - items: - type: string - type: array - default: null - securitySchemes: - httpBearer: - description: |- - Bearer token provided in the `Authorization` header (e.g., `Authorization: Bearer your_token`—recommended). [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). - - Use your API token to authenticate requests. You can find it on the [Integrations page](https://console.apify.com/account#/integrations) in Apify Console. This method is more secure than query parameters, as headers are not logged in browser history or server logs. - - :::danger Security - - Do not share your API token (or account password) with untrusted parties. - - ::: - - _When is authentication required?_ - - _Required_ for private Actors, tasks, or resources (e.g., builds of private Actors). - - _Required_ when using named formats for IDs (e.g., `username~store-name` for stores or `username~queue-name` for queues). - - _Optional_ for public Actors or resources (e.g., builds of public Actors can be queried without a token). - - For more information, see our [integrations documentation](https://docs.apify.com/platform/integrations). - scheme: bearer - type: http - apiKey: - description: |- - API token provided as a query parameter (e.g., `?token=your_token`—less secure). - - Use your API token to authenticate requests. You can find it on the [Integrations page](https://console.apify.com/account#/integrations) in Apify Console. - - :::danger Security - - Do not share your API token (or account password) with untrusted parties. - - ::: - - _When is authentication required?_ - - _Required_ for private Actors, tasks, or resources (e.g., builds of private Actors). - - _Required_ when using named formats for IDs (e.g., `username~store-name` for stores or `username~queue-name` for queues). - - _Optional_ for public Actors or resources (e.g., builds of public Actors can be queried without a token). - - For more information, see our [integrations documentation](https://docs.apify.com/platform/integrations). - in: query - name: token - type: apiKey -x-tagGroups: -- name: Actors - tags: - - Actors - - Actors/Actor versions - - Actors/Actor builds - - Actors/Actor runs - - Actors/Webhook collection - - Actors/Last run object and its storages -- name: Actor builds - tags: - - Actor builds -- name: Actor runs - tags: - - Actor runs -- name: Actor tasks - tags: - - Actor tasks -- name: Storage - tags: - - Storage/Datasets - - Storage/Key-value stores - - Storage/Request queues - - Storage/Request queues/Requests - - Storage/Request queues/Requests locks -- name: Webhooks - tags: - - Webhooks/Webhooks - - Webhooks/Webhook dispatches -- name: Schedules - tags: - - Schedules -- name: Store - tags: - - Store -- name: Logs - tags: - - Logs -- name: Users - tags: - - Users -- name: Tools - tags: - - Tools -- name: Convenience endpoints - tags: - - Default dataset - - Default key-value store - - Default request queue - - Last Actor run's default dataset - - Last Actor run's default key-value store - - Last Actor run's default request queue - - Last Actor run's log - - Last Actor run's abort - - Last Actor run's metamorph - - Last Actor run's reboot - - Last Actor task run's default dataset - - Last Actor task run's default key-value store - - Last Actor task run's default request queue - - Last Actor task run's log - - Last Actor task run's abort - - Last Actor task run's metamorph - - Last Actor task run's reboot diff --git a/api_actor_builds.go b/api_actor_builds.go deleted file mode 100644 index 5c0d557..0000000 --- a/api_actor_builds.go +++ /dev/null @@ -1,1144 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "bytes" - "context" - "io" - "net/http" - "net/url" - "strings" -) - - -// ActorBuildsAPIService ActorBuildsAPI service -type ActorBuildsAPIService service - -type ApiActorBuildAbortPostRequest struct { - ctx context.Context - ApiService *ActorBuildsAPIService - buildId string -} - -func (r ApiActorBuildAbortPostRequest) Execute() (*BuildResponse, *http.Response, error) { - return r.ApiService.ActorBuildAbortPostExecute(r) -} - -/* -ActorBuildAbortPost Abort build - -Aborts an Actor build and returns an object that contains all the details -about the build. - -Only builds that are starting or running are aborted. For builds with status -`FINISHED`, `FAILED`, `ABORTING` and `TIMED-OUT` this call does nothing. - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param buildId ID of the build, found in the build's Info tab. - @return ApiActorBuildAbortPostRequest -*/ -func (a *ActorBuildsAPIService) ActorBuildAbortPost(ctx context.Context, buildId string) ApiActorBuildAbortPostRequest { - return ApiActorBuildAbortPostRequest{ - ApiService: a, - ctx: ctx, - buildId: buildId, - } -} - -// Execute executes the request -// @return BuildResponse -func (a *ActorBuildsAPIService) ActorBuildAbortPostExecute(r ApiActorBuildAbortPostRequest) (*BuildResponse, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodPost - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *BuildResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ActorBuildsAPIService.ActorBuildAbortPost") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/actor-builds/{buildId}/abort" - localVarPath = strings.Replace(localVarPath, "{"+"buildId"+"}", url.PathEscape(parameterValueToString(r.buildId, "buildId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiActorBuildDeleteRequest struct { - ctx context.Context - ApiService *ActorBuildsAPIService - buildId string -} - -func (r ApiActorBuildDeleteRequest) Execute() (*http.Response, error) { - return r.ApiService.ActorBuildDeleteExecute(r) -} - -/* -ActorBuildDelete Delete build - -Delete the build. The build that is the current default build for the Actor -cannot be deleted. - -Only users with build permissions for the Actor can delete builds. - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param buildId ID of the build, found in the build's Info tab. - @return ApiActorBuildDeleteRequest -*/ -func (a *ActorBuildsAPIService) ActorBuildDelete(ctx context.Context, buildId string) ApiActorBuildDeleteRequest { - return ApiActorBuildDeleteRequest{ - ApiService: a, - ctx: ctx, - buildId: buildId, - } -} - -// Execute executes the request -func (a *ActorBuildsAPIService) ActorBuildDeleteExecute(r ApiActorBuildDeleteRequest) (*http.Response, error) { - var ( - localVarHTTPMethod = http.MethodDelete - localVarPostBody interface{} - formFiles []formFile - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ActorBuildsAPIService.ActorBuildDelete") - if err != nil { - return nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/actor-builds/{buildId}" - localVarPath = strings.Replace(localVarPath, "{"+"buildId"+"}", url.PathEscape(parameterValueToString(r.buildId, "buildId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarHTTPResponse, newErr - } - - return localVarHTTPResponse, nil -} - -type ApiActorBuildGetRequest struct { - ctx context.Context - ApiService *ActorBuildsAPIService - buildId string - waitForFinish *float64 -} - -// The maximum number of seconds the server waits for the build to finish. By default it is `0`, the maximum value is `60`. <!-- MAX_ACTOR_JOB_ASYNC_WAIT_SECS --> If the build finishes in time then the returned build object will have a terminal status (e.g. `SUCCEEDED`), otherwise it will have a transitional status (e.g. `RUNNING`). -func (r ApiActorBuildGetRequest) WaitForFinish(waitForFinish float64) ApiActorBuildGetRequest { - r.waitForFinish = &waitForFinish - return r -} - -func (r ApiActorBuildGetRequest) Execute() (*BuildResponse, *http.Response, error) { - return r.ApiService.ActorBuildGetExecute(r) -} - -/* -ActorBuildGet Get build - -Gets an object that contains all the details about a specific build of an -Actor. - -By passing the optional `waitForFinish` parameter the API endpoint will -synchronously wait for the build to finish. This is useful to avoid periodic -polling when waiting for an Actor build to finish. - -This endpoint does not require the authentication token. Instead, calls are authenticated using a hard-to-guess ID of the build. However, -if you access the endpoint without the token, certain attributes, such as `usageUsd` and `usageTotalUsd`, will be hidden. - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param buildId ID of the build, found in the build's Info tab. - @return ApiActorBuildGetRequest -*/ -func (a *ActorBuildsAPIService) ActorBuildGet(ctx context.Context, buildId string) ApiActorBuildGetRequest { - return ApiActorBuildGetRequest{ - ApiService: a, - ctx: ctx, - buildId: buildId, - } -} - -// Execute executes the request -// @return BuildResponse -func (a *ActorBuildsAPIService) ActorBuildGetExecute(r ApiActorBuildGetRequest) (*BuildResponse, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *BuildResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ActorBuildsAPIService.ActorBuildGet") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/actor-builds/{buildId}" - localVarPath = strings.Replace(localVarPath, "{"+"buildId"+"}", url.PathEscape(parameterValueToString(r.buildId, "buildId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if r.waitForFinish != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "waitForFinish", r.waitForFinish, "form", "") - } - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiActorBuildLogGetRequest struct { - ctx context.Context - ApiService *ActorBuildsAPIService - buildId string - stream *bool - download *bool -} - -// If `true` or `1` then the logs will be streamed as long as the run or build is running. -func (r ApiActorBuildLogGetRequest) Stream(stream bool) ApiActorBuildLogGetRequest { - r.stream = &stream - return r -} - -// If `true` or `1` then the web browser will download the log file rather than open it in a tab. -func (r ApiActorBuildLogGetRequest) Download(download bool) ApiActorBuildLogGetRequest { - r.download = &download - return r -} - -func (r ApiActorBuildLogGetRequest) Execute() (string, *http.Response, error) { - return r.ApiService.ActorBuildLogGetExecute(r) -} - -/* -ActorBuildLogGet Get build's Log - -Retrieves Actor build's logs. - -This endpoint is a shortcut for getting the build's log. Same as [Get log](/api/v2/log-get) endpoint. - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param buildId ID of the build, found in the build's Info tab. - @return ApiActorBuildLogGetRequest -*/ -func (a *ActorBuildsAPIService) ActorBuildLogGet(ctx context.Context, buildId string) ApiActorBuildLogGetRequest { - return ApiActorBuildLogGetRequest{ - ApiService: a, - ctx: ctx, - buildId: buildId, - } -} - -// Execute executes the request -// @return string -func (a *ActorBuildsAPIService) ActorBuildLogGetExecute(r ApiActorBuildLogGetRequest) (string, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue string - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ActorBuildsAPIService.ActorBuildLogGet") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/actor-builds/{buildId}/log" - localVarPath = strings.Replace(localVarPath, "{"+"buildId"+"}", url.PathEscape(parameterValueToString(r.buildId, "buildId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if r.stream != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "stream", r.stream, "form", "") - } - if r.download != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "download", r.download, "form", "") - } - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"text/plain", "application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiActorBuildOpenapiJsonGetRequest struct { - ctx context.Context - ApiService *ActorBuildsAPIService - buildId string -} - -func (r ApiActorBuildOpenapiJsonGetRequest) Execute() (map[string]interface{}, *http.Response, error) { - return r.ApiService.ActorBuildOpenapiJsonGetExecute(r) -} - -/* -ActorBuildOpenapiJsonGet Get OpenAPI definition - -Get the OpenAPI definition for Actor builds. Two similar endpoints are available: - -- [First endpoint](/api/v2/act-openapi-json-get): Requires both `actorId` and `buildId`. Use `default` as the `buildId` to get the OpenAPI schema for the default Actor build. -- [Second endpoint](/api/v2/actor-build-openapi-json-get): Requires only `buildId`. - -Get the OpenAPI definition for a specific Actor build. -Authentication is based on the build's unique ID. No authentication token is required. - -:::note - -You can also use the [`/api/v2/act-openapi-json-get`](/api/v2/act-openapi-json-get) endpoint to get the OpenAPI definition for a build. - -::: - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param buildId ID of the build, found in the build's Info tab. Use the special value `default` to get the OpenAPI schema for the Actor's default build. - @return ApiActorBuildOpenapiJsonGetRequest -*/ -func (a *ActorBuildsAPIService) ActorBuildOpenapiJsonGet(ctx context.Context, buildId string) ApiActorBuildOpenapiJsonGetRequest { - return ApiActorBuildOpenapiJsonGetRequest{ - ApiService: a, - ctx: ctx, - buildId: buildId, - } -} - -// Execute executes the request -// @return map[string]interface{} -func (a *ActorBuildsAPIService) ActorBuildOpenapiJsonGetExecute(r ApiActorBuildOpenapiJsonGetRequest) (map[string]interface{}, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue map[string]interface{} - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ActorBuildsAPIService.ActorBuildOpenapiJsonGet") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/actor-builds/{buildId}/openapi.json" - localVarPath = strings.Replace(localVarPath, "{"+"buildId"+"}", url.PathEscape(parameterValueToString(r.buildId, "buildId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiActorBuildsGetRequest struct { - ctx context.Context - ApiService *ActorBuildsAPIService - offset *float64 - limit *float64 - desc *bool -} - -// Number of items that should be skipped at the start. The default value is `0`. -func (r ApiActorBuildsGetRequest) Offset(offset float64) ApiActorBuildsGetRequest { - r.offset = &offset - return r -} - -// Maximum number of items to return. The default value as well as the maximum is `1000`. -func (r ApiActorBuildsGetRequest) Limit(limit float64) ApiActorBuildsGetRequest { - r.limit = &limit - return r -} - -// If `true` or `1` then the objects are sorted by the `startedAt` field in descending order. By default, they are sorted in ascending order. -func (r ApiActorBuildsGetRequest) Desc(desc bool) ApiActorBuildsGetRequest { - r.desc = &desc - return r -} - -func (r ApiActorBuildsGetRequest) Execute() (*ListOfBuildsResponse, *http.Response, error) { - return r.ApiService.ActorBuildsGetExecute(r) -} - -/* -ActorBuildsGet Get user builds list - -Gets a list of all builds for a user. The response is a JSON array of -objects, where each object contains basic information about a single build. - -The endpoint supports pagination using the `limit` and `offset` parameters -and it will not return more than 1000 records. - -By default, the records are sorted by the `startedAt` field in ascending -order. Therefore, you can use pagination to incrementally fetch all builds while -new ones are still being started. To sort the records in descending order, use -the `desc=1` parameter. - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return ApiActorBuildsGetRequest -*/ -func (a *ActorBuildsAPIService) ActorBuildsGet(ctx context.Context) ApiActorBuildsGetRequest { - return ApiActorBuildsGetRequest{ - ApiService: a, - ctx: ctx, - } -} - -// Execute executes the request -// @return ListOfBuildsResponse -func (a *ActorBuildsAPIService) ActorBuildsGetExecute(r ApiActorBuildsGetRequest) (*ListOfBuildsResponse, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *ListOfBuildsResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ActorBuildsAPIService.ActorBuildsGet") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/actor-builds" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if r.offset != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "form", "") - } - if r.limit != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "form", "") - } - if r.desc != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "desc", r.desc, "form", "") - } - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} diff --git a/api_actor_runs.go b/api_actor_runs.go deleted file mode 100644 index de26178..0000000 --- a/api_actor_runs.go +++ /dev/null @@ -1,2192 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "bytes" - "context" - "io" - "net/http" - "net/url" - "strings" - "time" -) - - -// ActorRunsAPIService ActorRunsAPI service -type ActorRunsAPIService service - -type ApiActorRunAbortPostRequest struct { - ctx context.Context - ApiService *ActorRunsAPIService - runId string - gracefully *bool -} - -// If true passed, the Actor run will abort gracefully. It will send `aborting` and `persistState` event into run and force-stop the run after 30 seconds. It is helpful in cases where you plan to resurrect the run later. -func (r ApiActorRunAbortPostRequest) Gracefully(gracefully bool) ApiActorRunAbortPostRequest { - r.gracefully = &gracefully - return r -} - -func (r ApiActorRunAbortPostRequest) Execute() (*RunResponse, *http.Response, error) { - return r.ApiService.ActorRunAbortPostExecute(r) -} - -/* -ActorRunAbortPost Abort run - -Aborts an Actor run and returns an object that contains all the details -about the run. - -Only runs that are starting or running are aborted. For runs with status -`FINISHED`, `FAILED`, `ABORTING` and `TIMED-OUT` this call does nothing. - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param runId Actor run ID. - @return ApiActorRunAbortPostRequest -*/ -func (a *ActorRunsAPIService) ActorRunAbortPost(ctx context.Context, runId string) ApiActorRunAbortPostRequest { - return ApiActorRunAbortPostRequest{ - ApiService: a, - ctx: ctx, - runId: runId, - } -} - -// Execute executes the request -// @return RunResponse -func (a *ActorRunsAPIService) ActorRunAbortPostExecute(r ApiActorRunAbortPostRequest) (*RunResponse, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodPost - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *RunResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ActorRunsAPIService.ActorRunAbortPost") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/actor-runs/{runId}/abort" - localVarPath = strings.Replace(localVarPath, "{"+"runId"+"}", url.PathEscape(parameterValueToString(r.runId, "runId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if r.gracefully != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "gracefully", r.gracefully, "form", "") - } - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiActorRunDeleteRequest struct { - ctx context.Context - ApiService *ActorRunsAPIService - runId string -} - -func (r ApiActorRunDeleteRequest) Execute() (*http.Response, error) { - return r.ApiService.ActorRunDeleteExecute(r) -} - -/* -ActorRunDelete Delete run - -Delete the run. Only finished runs can be deleted. Only the person or -organization that initiated the run can delete it. - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param runId Actor run ID. - @return ApiActorRunDeleteRequest -*/ -func (a *ActorRunsAPIService) ActorRunDelete(ctx context.Context, runId string) ApiActorRunDeleteRequest { - return ApiActorRunDeleteRequest{ - ApiService: a, - ctx: ctx, - runId: runId, - } -} - -// Execute executes the request -func (a *ActorRunsAPIService) ActorRunDeleteExecute(r ApiActorRunDeleteRequest) (*http.Response, error) { - var ( - localVarHTTPMethod = http.MethodDelete - localVarPostBody interface{} - formFiles []formFile - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ActorRunsAPIService.ActorRunDelete") - if err != nil { - return nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/actor-runs/{runId}" - localVarPath = strings.Replace(localVarPath, "{"+"runId"+"}", url.PathEscape(parameterValueToString(r.runId, "runId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarHTTPResponse, newErr - } - - return localVarHTTPResponse, nil -} - -type ApiActorRunGetRequest struct { - ctx context.Context - ApiService *ActorRunsAPIService - runId string - waitForFinish *float64 -} - -// The maximum number of seconds the server waits for the run to finish. By default it is `0`, the maximum value is `60`. <!-- MAX_ACTOR_JOB_ASYNC_WAIT_SECS --> If the run finishes in time then the returned run object will have a terminal status (e.g. `SUCCEEDED`), otherwise it will have a transitional status (e.g. `RUNNING`). -func (r ApiActorRunGetRequest) WaitForFinish(waitForFinish float64) ApiActorRunGetRequest { - r.waitForFinish = &waitForFinish - return r -} - -func (r ApiActorRunGetRequest) Execute() (*RunResponse, *http.Response, error) { - return r.ApiService.ActorRunGetExecute(r) -} - -/* -ActorRunGet Get run - -This is not a single endpoint, but an entire group of endpoints that lets -you retrieve the run or any of its default storages. - -##### Convenience endpoints for Actor run default storages - -* [Dataset](/api/v2/default-dataset) - -* [Key-value store](/api/v2/default-key-value-store) - -* [Request queue](/api/v2/default-request-queue) - -Gets an object that contains all the details about a -specific run of an Actor. - -By passing the optional `waitForFinish` parameter the API endpoint will synchronously wait -for the run to finish. This is useful to avoid periodic polling when waiting for Actor run to complete. -Note that the first response after completion can still show preliminary `stats`, costs, and event counts. -For stable figures, wait about 10 seconds and call the endpoint again. - -This endpoint does not require the authentication token. Instead, calls are authenticated using a hard-to-guess ID of the run. However, -if you access the endpoint without the token, certain attributes, such as `usageUsd` and `usageTotalUsd`, will be hidden. - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param runId Actor run ID. - @return ApiActorRunGetRequest -*/ -func (a *ActorRunsAPIService) ActorRunGet(ctx context.Context, runId string) ApiActorRunGetRequest { - return ApiActorRunGetRequest{ - ApiService: a, - ctx: ctx, - runId: runId, - } -} - -// Execute executes the request -// @return RunResponse -func (a *ActorRunsAPIService) ActorRunGetExecute(r ApiActorRunGetRequest) (*RunResponse, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *RunResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ActorRunsAPIService.ActorRunGet") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/actor-runs/{runId}" - localVarPath = strings.Replace(localVarPath, "{"+"runId"+"}", url.PathEscape(parameterValueToString(r.runId, "runId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if r.waitForFinish != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "waitForFinish", r.waitForFinish, "form", "") - } - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiActorRunLogGetRequest struct { - ctx context.Context - ApiService *ActorRunsAPIService - runId string - stream *bool - download *bool - raw *bool -} - -// If `true` or `1` then the logs will be streamed as long as the run or build is running. -func (r ApiActorRunLogGetRequest) Stream(stream bool) ApiActorRunLogGetRequest { - r.stream = &stream - return r -} - -// If `true` or `1` then the web browser will download the log file rather than open it in a tab. -func (r ApiActorRunLogGetRequest) Download(download bool) ApiActorRunLogGetRequest { - r.download = &download - return r -} - -// If `true` or `1`, the logs will be kept verbatim. By default, the API removes ANSI escape codes from the logs, keeping only printable characters. -func (r ApiActorRunLogGetRequest) Raw(raw bool) ApiActorRunLogGetRequest { - r.raw = &raw - return r -} - -func (r ApiActorRunLogGetRequest) Execute() (string, *http.Response, error) { - return r.ApiService.ActorRunLogGetExecute(r) -} - -/* -ActorRunLogGet Get run's log - -Retrieves Actor run's logs. - -This endpoint is a shortcut for getting the run's log. Same as [Get log](/api/v2/log-get) endpoint. - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param runId Actor run ID. - @return ApiActorRunLogGetRequest -*/ -func (a *ActorRunsAPIService) ActorRunLogGet(ctx context.Context, runId string) ApiActorRunLogGetRequest { - return ApiActorRunLogGetRequest{ - ApiService: a, - ctx: ctx, - runId: runId, - } -} - -// Execute executes the request -// @return string -func (a *ActorRunsAPIService) ActorRunLogGetExecute(r ApiActorRunLogGetRequest) (string, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue string - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ActorRunsAPIService.ActorRunLogGet") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/actor-runs/{runId}/log" - localVarPath = strings.Replace(localVarPath, "{"+"runId"+"}", url.PathEscape(parameterValueToString(r.runId, "runId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if r.stream != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "stream", r.stream, "form", "") - } - if r.download != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "download", r.download, "form", "") - } - if r.raw != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "raw", r.raw, "form", "") - } - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"text/plain", "application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiActorRunMetamorphPostRequest struct { - ctx context.Context - ApiService *ActorRunsAPIService - runId string - targetActorId *string - build *string -} - -// ID of a target Actor that the run should be transformed into. -func (r ApiActorRunMetamorphPostRequest) TargetActorId(targetActorId string) ApiActorRunMetamorphPostRequest { - r.targetActorId = &targetActorId - return r -} - -// Optional build of the target Actor. It can be either a build tag or build number. By default, the run uses the build specified in the default run configuration for the target Actor (typically `latest`). -func (r ApiActorRunMetamorphPostRequest) Build(build string) ApiActorRunMetamorphPostRequest { - r.build = &build - return r -} - -func (r ApiActorRunMetamorphPostRequest) Execute() (*RunResponse, *http.Response, error) { - return r.ApiService.ActorRunMetamorphPostExecute(r) -} - -/* -ActorRunMetamorphPost Metamorph run - -Transforms an Actor run into a run of another Actor with a new input. - -This is useful if you want to use another Actor to finish the work -of your current Actor run, without the need to create a completely new run -and waiting for its finish. - -For the users of your Actors, the metamorph operation is transparent, they -will just see your Actor got the work done. - -Internally, the system stops the Docker container corresponding to the Actor -run and starts a new container using a different Docker image. - -All the default storages are preserved and the new input is stored under the -`INPUT-METAMORPH-1` key in the same default key-value store. - -For more information, see the [Actor docs](https://docs.apify.com/platform/actors/development/programming-interface/metamorph). - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param runId Actor run ID. - @return ApiActorRunMetamorphPostRequest -*/ -func (a *ActorRunsAPIService) ActorRunMetamorphPost(ctx context.Context, runId string) ApiActorRunMetamorphPostRequest { - return ApiActorRunMetamorphPostRequest{ - ApiService: a, - ctx: ctx, - runId: runId, - } -} - -// Execute executes the request -// @return RunResponse -func (a *ActorRunsAPIService) ActorRunMetamorphPostExecute(r ApiActorRunMetamorphPostRequest) (*RunResponse, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodPost - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *RunResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ActorRunsAPIService.ActorRunMetamorphPost") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/actor-runs/{runId}/metamorph" - localVarPath = strings.Replace(localVarPath, "{"+"runId"+"}", url.PathEscape(parameterValueToString(r.runId, "runId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - if r.targetActorId == nil { - return localVarReturnValue, nil, reportError("targetActorId is required and must be specified") - } - - parameterAddToHeaderOrQuery(localVarQueryParams, "targetActorId", r.targetActorId, "form", "") - if r.build != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "build", r.build, "form", "") - } - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiActorRunPutRequest struct { - ctx context.Context - ApiService *ActorRunsAPIService - runId string - updateRunRequest *UpdateRunRequest -} - -// -func (r ApiActorRunPutRequest) UpdateRunRequest(updateRunRequest UpdateRunRequest) ApiActorRunPutRequest { - r.updateRunRequest = &updateRunRequest - return r -} - -func (r ApiActorRunPutRequest) Execute() (*RunResponse, *http.Response, error) { - return r.ApiService.ActorRunPutExecute(r) -} - -/* -ActorRunPut Update run - -This endpoint can be used to update both the run's status message and to configure its general resource access level. - -**Status message:** - -You can set a single status message on your run that will be displayed in -the Apify Console UI. During an Actor run, you will typically do this in order -to inform users of your Actor about the Actor's progress. - -The request body must contain `runId` and `statusMessage` properties. The -`isStatusMessageTerminal` property is optional and it indicates if the -status message is the very last one. In the absence of a status message, the -platform will try to substitute sensible defaults. - -**General resource access:** - -You can also update the run's general resource access setting, which determines who can view the run and its related data. - -Allowed values: - -* `FOLLOW_USER_SETTING` - The run inherits the general access setting from the account level. -* `ANYONE_WITH_ID_CAN_READ` - The run can be viewed anonymously by anyone who has its ID. -* `RESTRICTED` - Only users with explicit access to the resource can access the run. - -When a run is accessible anonymously, all of the run's default storages and logs also become accessible anonymously. - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param runId Actor run ID. - @return ApiActorRunPutRequest -*/ -func (a *ActorRunsAPIService) ActorRunPut(ctx context.Context, runId string) ApiActorRunPutRequest { - return ApiActorRunPutRequest{ - ApiService: a, - ctx: ctx, - runId: runId, - } -} - -// Execute executes the request -// @return RunResponse -func (a *ActorRunsAPIService) ActorRunPutExecute(r ApiActorRunPutRequest) (*RunResponse, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodPut - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *RunResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ActorRunsAPIService.ActorRunPut") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/actor-runs/{runId}" - localVarPath = strings.Replace(localVarPath, "{"+"runId"+"}", url.PathEscape(parameterValueToString(r.runId, "runId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - if r.updateRunRequest == nil { - return localVarReturnValue, nil, reportError("updateRunRequest is required and must be specified") - } - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/json"} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - // body params - localVarPostBody = r.updateRunRequest - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 413 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 415 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiActorRunRebootPostRequest struct { - ctx context.Context - ApiService *ActorRunsAPIService - runId string -} - -func (r ApiActorRunRebootPostRequest) Execute() (*RunResponse, *http.Response, error) { - return r.ApiService.ActorRunRebootPostExecute(r) -} - -/* -ActorRunRebootPost Reboot run - -Reboots an Actor run and returns an object that contains all the details -about the rebooted run. - -Only runs that are running, i.e. runs with status `RUNNING` can be rebooted. - -The run's container will be restarted, so any data not persisted in the -key-value store, dataset, or request queue will be lost. - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param runId Actor run ID. - @return ApiActorRunRebootPostRequest -*/ -func (a *ActorRunsAPIService) ActorRunRebootPost(ctx context.Context, runId string) ApiActorRunRebootPostRequest { - return ApiActorRunRebootPostRequest{ - ApiService: a, - ctx: ctx, - runId: runId, - } -} - -// Execute executes the request -// @return RunResponse -func (a *ActorRunsAPIService) ActorRunRebootPostExecute(r ApiActorRunRebootPostRequest) (*RunResponse, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodPost - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *RunResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ActorRunsAPIService.ActorRunRebootPost") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/actor-runs/{runId}/reboot" - localVarPath = strings.Replace(localVarPath, "{"+"runId"+"}", url.PathEscape(parameterValueToString(r.runId, "runId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiActorRunsGetRequest struct { - ctx context.Context - ApiService *ActorRunsAPIService - offset *float64 - limit *float64 - desc *bool - status *[]string - startedAfter *time.Time - startedBefore *time.Time -} - -// Number of items that should be skipped at the start. The default value is `0`. -func (r ApiActorRunsGetRequest) Offset(offset float64) ApiActorRunsGetRequest { - r.offset = &offset - return r -} - -// Maximum number of items to return. The default value as well as the maximum is `1000`. -func (r ApiActorRunsGetRequest) Limit(limit float64) ApiActorRunsGetRequest { - r.limit = &limit - return r -} - -// If `true` or `1` then the objects are sorted by the `startedAt` field in descending order. By default, they are sorted in ascending order. -func (r ApiActorRunsGetRequest) Desc(desc bool) ApiActorRunsGetRequest { - r.desc = &desc - return r -} - -// Single status or comma-separated list of statuses, see ([available statuses](https://docs.apify.com/platform/actors/running/runs-and-builds#lifecycle)). Used to filter runs by the specified statuses only. -func (r ApiActorRunsGetRequest) Status(status []string) ApiActorRunsGetRequest { - r.status = &status - return r -} - -// Filter runs that started after the specified date and time (inclusive). The value must be a valid ISO 8601 datetime string (UTC). -func (r ApiActorRunsGetRequest) StartedAfter(startedAfter time.Time) ApiActorRunsGetRequest { - r.startedAfter = &startedAfter - return r -} - -// Filter runs that started before the specified date and time (inclusive). The value must be a valid ISO 8601 datetime string (UTC). -func (r ApiActorRunsGetRequest) StartedBefore(startedBefore time.Time) ApiActorRunsGetRequest { - r.startedBefore = &startedBefore - return r -} - -func (r ApiActorRunsGetRequest) Execute() (*ListOfRunsResponse, *http.Response, error) { - return r.ApiService.ActorRunsGetExecute(r) -} - -/* -ActorRunsGet Get user runs list - -Gets a list of all runs for a user. The response is a list of objects, where -each object contains basic information about a single Actor run. - -The endpoint supports pagination using the `limit` and `offset` parameters -and it will not return more than 1000 array elements. - -By default, the records are sorted by the `startedAt` field in ascending -order. Therefore, you can use pagination to incrementally fetch all records while -new ones are still being created. To sort the records in descending order, use -`desc=1` parameter. You can also filter runs by `startedAt`` and `status`` fields ([available -statuses](https://docs.apify.com/platform/actors/running/runs-and-builds#lifecycle)). - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return ApiActorRunsGetRequest -*/ -func (a *ActorRunsAPIService) ActorRunsGet(ctx context.Context) ApiActorRunsGetRequest { - return ApiActorRunsGetRequest{ - ApiService: a, - ctx: ctx, - } -} - -// Execute executes the request -// @return ListOfRunsResponse -func (a *ActorRunsAPIService) ActorRunsGetExecute(r ApiActorRunsGetRequest) (*ListOfRunsResponse, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *ListOfRunsResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ActorRunsAPIService.ActorRunsGet") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/actor-runs" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if r.offset != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "form", "") - } - if r.limit != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "form", "") - } - if r.desc != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "desc", r.desc, "form", "") - } - if r.status != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "status", r.status, "form", "csv") - } - if r.startedAfter != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "startedAfter", r.startedAfter, "form", "") - } - if r.startedBefore != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "startedBefore", r.startedBefore, "form", "") - } - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiPostChargeRunRequest struct { - ctx context.Context - ApiService *ActorRunsAPIService - runId string - chargeRunRequest *ChargeRunRequest - idempotencyKey *string -} - -// Define which event, and how many times, you want to charge for. -func (r ApiPostChargeRunRequest) ChargeRunRequest(chargeRunRequest ChargeRunRequest) ApiPostChargeRunRequest { - r.chargeRunRequest = &chargeRunRequest - return r -} - -// Always pass a unique idempotency key (any unique string) for each charge to avoid double charging in case of retries or network errors. -func (r ApiPostChargeRunRequest) IdempotencyKey(idempotencyKey string) ApiPostChargeRunRequest { - r.idempotencyKey = &idempotencyKey - return r -} - -func (r ApiPostChargeRunRequest) Execute() (map[string]interface{}, *http.Response, error) { - return r.ApiService.PostChargeRunExecute(r) -} - -/* -PostChargeRun Charge events in run - -Charge for events in the run of your [pay per event Actor](https://docs.apify.com/platform/actors/running/actors-in-store#pay-per-event). -The event you are charging for must be one of the configured events in your Actor. If the Actor is not set up as pay per event, or if the event is not configured, -the endpoint will return an error. The endpoint must be called from the Actor run itself, with the same API token that the run was started with. - -:::info Learn more about pay-per-event pricing - -For more details about pay-per-event (PPE) pricing, refer to our [PPE documentation](/platform/actors/publishing/monetize/pay-per-event). - -::: - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param runId Actor run ID. - @return ApiPostChargeRunRequest -*/ -func (a *ActorRunsAPIService) PostChargeRun(ctx context.Context, runId string) ApiPostChargeRunRequest { - return ApiPostChargeRunRequest{ - ApiService: a, - ctx: ctx, - runId: runId, - } -} - -// Execute executes the request -// @return map[string]interface{} -func (a *ActorRunsAPIService) PostChargeRunExecute(r ApiPostChargeRunRequest) (map[string]interface{}, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodPost - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue map[string]interface{} - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ActorRunsAPIService.PostChargeRun") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/actor-runs/{runId}/charge" - localVarPath = strings.Replace(localVarPath, "{"+"runId"+"}", url.PathEscape(parameterValueToString(r.runId, "runId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - if r.chargeRunRequest == nil { - return localVarReturnValue, nil, reportError("chargeRunRequest is required and must be specified") - } - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/json"} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - if r.idempotencyKey != nil { - parameterAddToHeaderOrQuery(localVarHeaderParams, "idempotency-key", r.idempotencyKey, "simple", "") - } - // body params - localVarPostBody = r.chargeRunRequest - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 413 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 415 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiPostResurrectRunRequest struct { - ctx context.Context - ApiService *ActorRunsAPIService - runId string - build *string - timeout *float64 - memory *float64 - maxItems *float64 - maxTotalChargeUsd *float64 - restartOnError *bool -} - -// Specifies the Actor build to run. It can be either a build tag or build number. By default, the run is resurrected with the same build it originally used. Specifically, if a run was first started with the `latest` tag, which resolves to version `0.0.3` at the time, a run resurrected without this parameter will continue running with `0.0.3`, even if `latest` already points to a newer build. -func (r ApiPostResurrectRunRequest) Build(build string) ApiPostResurrectRunRequest { - r.build = &build - return r -} - -// Optional timeout for the run, in seconds. By default, the run uses the timeout specified in the run that is being resurrected. -func (r ApiPostResurrectRunRequest) Timeout(timeout float64) ApiPostResurrectRunRequest { - r.timeout = &timeout - return r -} - -// Memory limit for the run, in megabytes. The amount of memory can be set to a power of 2 with a minimum of 128. By default, the run uses the memory limit specified in the run that is being resurrected. -func (r ApiPostResurrectRunRequest) Memory(memory float64) ApiPostResurrectRunRequest { - r.memory = &memory - return r -} - -// Specifies the maximum number of dataset items that will be charged for pay-per-result Actors. This does NOT guarantee that the Actor will return only this many items. It only ensures you won't be charged for more than this number of items. Only works for pay-per-result Actors. Value can be accessed in the actor run using `ACTOR_MAX_PAID_DATASET_ITEMS` environment variable. -func (r ApiPostResurrectRunRequest) MaxItems(maxItems float64) ApiPostResurrectRunRequest { - r.maxItems = &maxItems - return r -} - -// Specifies the maximum cost of the run. This parameter is useful for pay-per-event Actors, as it allows you to limit the amount charged to your subscription. You can access the maximum cost in your Actor by using the `ACTOR_MAX_TOTAL_CHARGE_USD` environment variable. -func (r ApiPostResurrectRunRequest) MaxTotalChargeUsd(maxTotalChargeUsd float64) ApiPostResurrectRunRequest { - r.maxTotalChargeUsd = &maxTotalChargeUsd - return r -} - -// Determines whether the resurrected run will be restarted if it fails. By default, the resurrected run uses the same setting as before. -func (r ApiPostResurrectRunRequest) RestartOnError(restartOnError bool) ApiPostResurrectRunRequest { - r.restartOnError = &restartOnError - return r -} - -func (r ApiPostResurrectRunRequest) Execute() (*RunResponse, *http.Response, error) { - return r.ApiService.PostResurrectRunExecute(r) -} - -/* -PostResurrectRun Resurrect run - -Resurrects a finished Actor run and returns an object that contains all the details about the resurrected run. -Only finished runs, i.e. runs with status `FINISHED`, `FAILED`, `ABORTED` and `TIMED-OUT` can be resurrected. -Run status will be updated to RUNNING and its container will be restarted with the same storages -(the same behaviour as when the run gets migrated to the new server). - -For more information, see the [Actor docs](https://docs.apify.com/platform/actors/running/runs-and-builds#resurrection-of-finished-run). - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param runId Actor run ID. - @return ApiPostResurrectRunRequest -*/ -func (a *ActorRunsAPIService) PostResurrectRun(ctx context.Context, runId string) ApiPostResurrectRunRequest { - return ApiPostResurrectRunRequest{ - ApiService: a, - ctx: ctx, - runId: runId, - } -} - -// Execute executes the request -// @return RunResponse -func (a *ActorRunsAPIService) PostResurrectRunExecute(r ApiPostResurrectRunRequest) (*RunResponse, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodPost - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *RunResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ActorRunsAPIService.PostResurrectRun") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/actor-runs/{runId}/resurrect" - localVarPath = strings.Replace(localVarPath, "{"+"runId"+"}", url.PathEscape(parameterValueToString(r.runId, "runId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if r.build != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "build", r.build, "form", "") - } - if r.timeout != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "timeout", r.timeout, "form", "") - } - if r.memory != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "memory", r.memory, "form", "") - } - if r.maxItems != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "maxItems", r.maxItems, "form", "") - } - if r.maxTotalChargeUsd != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "maxTotalChargeUsd", r.maxTotalChargeUsd, "form", "") - } - if r.restartOnError != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "restartOnError", r.restartOnError, "form", "") - } - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} diff --git a/api_actor_tasks.go b/api_actor_tasks.go deleted file mode 100644 index fc6645a..0000000 --- a/api_actor_tasks.go +++ /dev/null @@ -1,4086 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "bytes" - "context" - "io" - "net/http" - "net/url" - "strings" -) - - -// ActorTasksAPIService ActorTasksAPI service -type ActorTasksAPIService service - -type ApiActorTaskDeleteRequest struct { - ctx context.Context - ApiService *ActorTasksAPIService - actorTaskId string -} - -func (r ApiActorTaskDeleteRequest) Execute() (map[string]interface{}, *http.Response, error) { - return r.ApiService.ActorTaskDeleteExecute(r) -} - -/* -ActorTaskDelete Delete task - -Delete the task specified through the `actorTaskId` parameter. - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param actorTaskId Task ID or a tilde-separated owner's username and task's name. - @return ApiActorTaskDeleteRequest -*/ -func (a *ActorTasksAPIService) ActorTaskDelete(ctx context.Context, actorTaskId string) ApiActorTaskDeleteRequest { - return ApiActorTaskDeleteRequest{ - ApiService: a, - ctx: ctx, - actorTaskId: actorTaskId, - } -} - -// Execute executes the request -// @return map[string]interface{} -func (a *ActorTasksAPIService) ActorTaskDeleteExecute(r ApiActorTaskDeleteRequest) (map[string]interface{}, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodDelete - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue map[string]interface{} - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ActorTasksAPIService.ActorTaskDelete") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/actor-tasks/{actorTaskId}" - localVarPath = strings.Replace(localVarPath, "{"+"actorTaskId"+"}", url.PathEscape(parameterValueToString(r.actorTaskId, "actorTaskId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiActorTaskGetRequest struct { - ctx context.Context - ApiService *ActorTasksAPIService - actorTaskId string -} - -func (r ApiActorTaskGetRequest) Execute() (*ActorTaskGet200Response, *http.Response, error) { - return r.ApiService.ActorTaskGetExecute(r) -} - -/* -ActorTaskGet Get task - -Get an object that contains all the details about a task. - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param actorTaskId Task ID or a tilde-separated owner's username and task's name. - @return ApiActorTaskGetRequest -*/ -func (a *ActorTasksAPIService) ActorTaskGet(ctx context.Context, actorTaskId string) ApiActorTaskGetRequest { - return ApiActorTaskGetRequest{ - ApiService: a, - ctx: ctx, - actorTaskId: actorTaskId, - } -} - -// Execute executes the request -// @return ActorTaskGet200Response -func (a *ActorTasksAPIService) ActorTaskGetExecute(r ApiActorTaskGetRequest) (*ActorTaskGet200Response, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *ActorTaskGet200Response - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ActorTasksAPIService.ActorTaskGet") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/actor-tasks/{actorTaskId}" - localVarPath = strings.Replace(localVarPath, "{"+"actorTaskId"+"}", url.PathEscape(parameterValueToString(r.actorTaskId, "actorTaskId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiActorTaskInputGetRequest struct { - ctx context.Context - ApiService *ActorTasksAPIService - actorTaskId string -} - -func (r ApiActorTaskInputGetRequest) Execute() (map[string]interface{}, *http.Response, error) { - return r.ApiService.ActorTaskInputGetExecute(r) -} - -/* -ActorTaskInputGet Get task input - -Returns the input of a given task. - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param actorTaskId Task ID or a tilde-separated owner's username and task's name. - @return ApiActorTaskInputGetRequest -*/ -func (a *ActorTasksAPIService) ActorTaskInputGet(ctx context.Context, actorTaskId string) ApiActorTaskInputGetRequest { - return ApiActorTaskInputGetRequest{ - ApiService: a, - ctx: ctx, - actorTaskId: actorTaskId, - } -} - -// Execute executes the request -// @return map[string]interface{} -func (a *ActorTasksAPIService) ActorTaskInputGetExecute(r ApiActorTaskInputGetRequest) (map[string]interface{}, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue map[string]interface{} - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ActorTasksAPIService.ActorTaskInputGet") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/actor-tasks/{actorTaskId}/input" - localVarPath = strings.Replace(localVarPath, "{"+"actorTaskId"+"}", url.PathEscape(parameterValueToString(r.actorTaskId, "actorTaskId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiActorTaskInputPutRequest struct { - ctx context.Context - ApiService *ActorTasksAPIService - actorTaskId string - body *map[string]interface{} -} - -// -func (r ApiActorTaskInputPutRequest) Body(body map[string]interface{}) ApiActorTaskInputPutRequest { - r.body = &body - return r -} - -func (r ApiActorTaskInputPutRequest) Execute() (map[string]interface{}, *http.Response, error) { - return r.ApiService.ActorTaskInputPutExecute(r) -} - -/* -ActorTaskInputPut Update task input - -Updates the input of a task using values specified by an object passed as -JSON in the PUT payload. - -If the object does not define a specific property, its value is not updated. - -The response is the full task input as returned by the -[Get task input](#/reference/tasks/task-input-object/get-task-input) endpoint. - -The request needs to specify the `Content-Type: application/json` HTTP -header! - -When providing your API authentication token, we recommend using the -request's `Authorization` header, rather than the URL. ([More -info](#/introduction/authentication)). - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param actorTaskId Task ID or a tilde-separated owner's username and task's name. - @return ApiActorTaskInputPutRequest -*/ -func (a *ActorTasksAPIService) ActorTaskInputPut(ctx context.Context, actorTaskId string) ApiActorTaskInputPutRequest { - return ApiActorTaskInputPutRequest{ - ApiService: a, - ctx: ctx, - actorTaskId: actorTaskId, - } -} - -// Execute executes the request -// @return map[string]interface{} -func (a *ActorTasksAPIService) ActorTaskInputPutExecute(r ApiActorTaskInputPutRequest) (map[string]interface{}, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodPut - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue map[string]interface{} - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ActorTasksAPIService.ActorTaskInputPut") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/actor-tasks/{actorTaskId}/input" - localVarPath = strings.Replace(localVarPath, "{"+"actorTaskId"+"}", url.PathEscape(parameterValueToString(r.actorTaskId, "actorTaskId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - if r.body == nil { - return localVarReturnValue, nil, reportError("body is required and must be specified") - } - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/json"} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - // body params - localVarPostBody = r.body - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 413 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 415 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiActorTaskPutRequest struct { - ctx context.Context - ApiService *ActorTasksAPIService - actorTaskId string - updateTaskRequest *UpdateTaskRequest -} - -// -func (r ApiActorTaskPutRequest) UpdateTaskRequest(updateTaskRequest UpdateTaskRequest) ApiActorTaskPutRequest { - r.updateTaskRequest = &updateTaskRequest - return r -} - -func (r ApiActorTaskPutRequest) Execute() (*ActorTaskGet200Response, *http.Response, error) { - return r.ApiService.ActorTaskPutExecute(r) -} - -/* -ActorTaskPut Update task - -Update settings of a task using values specified by an object passed as JSON -in the POST payload. - -If the object does not define a specific property, its value is not updated. - -The response is the full task object as returned by the -[Get task](/api/v2/actor-task-get) endpoint. - -The request needs to specify the `Content-Type: application/json` HTTP -header! - -When providing your API authentication token, we recommend using the -request's `Authorization` header, rather than the URL. - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param actorTaskId Task ID or a tilde-separated owner's username and task's name. - @return ApiActorTaskPutRequest -*/ -func (a *ActorTasksAPIService) ActorTaskPut(ctx context.Context, actorTaskId string) ApiActorTaskPutRequest { - return ApiActorTaskPutRequest{ - ApiService: a, - ctx: ctx, - actorTaskId: actorTaskId, - } -} - -// Execute executes the request -// @return ActorTaskGet200Response -func (a *ActorTasksAPIService) ActorTaskPutExecute(r ApiActorTaskPutRequest) (*ActorTaskGet200Response, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodPut - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *ActorTaskGet200Response - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ActorTasksAPIService.ActorTaskPut") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/actor-tasks/{actorTaskId}" - localVarPath = strings.Replace(localVarPath, "{"+"actorTaskId"+"}", url.PathEscape(parameterValueToString(r.actorTaskId, "actorTaskId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - if r.updateTaskRequest == nil { - return localVarReturnValue, nil, reportError("updateTaskRequest is required and must be specified") - } - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/json"} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - // body params - localVarPostBody = r.updateTaskRequest - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 413 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 415 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiActorTaskRunSyncGetRequest struct { - ctx context.Context - ApiService *ActorTasksAPIService - actorTaskId string - timeout *float64 - memory *float64 - maxItems *float64 - build *string - outputRecordKey *string - webhooks *string -} - -// Optional timeout for the run, in seconds. By default, the run uses the timeout from its configuration. -func (r ApiActorTaskRunSyncGetRequest) Timeout(timeout float64) ApiActorTaskRunSyncGetRequest { - r.timeout = &timeout - return r -} - -// Memory limit for the run, in megabytes. The amount of memory can be set to a power of 2 with a minimum of 128. By default, the run uses the memory limit from its configuration. -func (r ApiActorTaskRunSyncGetRequest) Memory(memory float64) ApiActorTaskRunSyncGetRequest { - r.memory = &memory - return r -} - -// Specifies the maximum number of dataset items that will be charged for pay-per-result Actors. This does NOT guarantee that the Actor will return only this many items. It only ensures you won't be charged for more than this number of items. Only works for pay-per-result Actors. Value can be accessed in the actor run using `ACTOR_MAX_PAID_DATASET_ITEMS` environment variable. -func (r ApiActorTaskRunSyncGetRequest) MaxItems(maxItems float64) ApiActorTaskRunSyncGetRequest { - r.maxItems = &maxItems - return r -} - -// Specifies the Actor build to run. It can be either a build tag or build number. By default, the run uses the build from its configuration (typically `latest`). -func (r ApiActorTaskRunSyncGetRequest) Build(build string) ApiActorTaskRunSyncGetRequest { - r.build = &build - return r -} - -// Key of the record from run's default key-value store to be returned in the response. By default, it is `OUTPUT`. -func (r ApiActorTaskRunSyncGetRequest) OutputRecordKey(outputRecordKey string) ApiActorTaskRunSyncGetRequest { - r.outputRecordKey = &outputRecordKey - return r -} - -// Specifies optional webhooks associated with the Actor run, which can be used to receive a notification e.g. when the Actor finished or failed. The value is a Base64-encoded JSON array whose items follow the WebhookRepresentation schema. For more information, see [Webhooks documentation](https://docs.apify.com/platform/integrations/webhooks). -func (r ApiActorTaskRunSyncGetRequest) Webhooks(webhooks string) ApiActorTaskRunSyncGetRequest { - r.webhooks = &webhooks - return r -} - -func (r ApiActorTaskRunSyncGetRequest) Execute() (map[string]interface{}, *http.Response, error) { - return r.ApiService.ActorTaskRunSyncGetExecute(r) -} - -/* -ActorTaskRunSyncGet Run task synchronously - -Run a specific task and return its output. - -The run must finish in 300<!-- MAX_ACTOR_JOB_SYNC_WAIT_SECS --> seconds -otherwise the HTTP request fails with a timeout error (this won't abort -the run itself). - -Beware that it might be impossible to maintain an idle HTTP connection for -an extended period, due to client timeout or network conditions. Make sure your HTTP client is -configured to have a long enough connection timeout. - -If the connection breaks, you will not receive any information about the run -and its status. - -To run the Task asynchronously, use the -[Run task asynchronously](#/reference/actor-tasks/run-collection/run-task) -endpoint instead. - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param actorTaskId Task ID or a tilde-separated owner's username and task's name. - @return ApiActorTaskRunSyncGetRequest -*/ -func (a *ActorTasksAPIService) ActorTaskRunSyncGet(ctx context.Context, actorTaskId string) ApiActorTaskRunSyncGetRequest { - return ApiActorTaskRunSyncGetRequest{ - ApiService: a, - ctx: ctx, - actorTaskId: actorTaskId, - } -} - -// Execute executes the request -// @return map[string]interface{} -func (a *ActorTasksAPIService) ActorTaskRunSyncGetExecute(r ApiActorTaskRunSyncGetRequest) (map[string]interface{}, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue map[string]interface{} - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ActorTasksAPIService.ActorTaskRunSyncGet") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/actor-tasks/{actorTaskId}/run-sync" - localVarPath = strings.Replace(localVarPath, "{"+"actorTaskId"+"}", url.PathEscape(parameterValueToString(r.actorTaskId, "actorTaskId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if r.timeout != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "timeout", r.timeout, "form", "") - } - if r.memory != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "memory", r.memory, "form", "") - } - if r.maxItems != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "maxItems", r.maxItems, "form", "") - } - if r.build != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "build", r.build, "form", "") - } - if r.outputRecordKey != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "outputRecordKey", r.outputRecordKey, "form", "") - } - if r.webhooks != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "webhooks", r.webhooks, "form", "") - } - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 408 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiActorTaskRunSyncGetDatasetItemsGetRequest struct { - ctx context.Context - ApiService *ActorTasksAPIService - actorTaskId string - timeout *float64 - memory *float64 - maxItems *float64 - build *string - webhooks *string - format *string - clean *bool - offset *float64 - limit *float64 - fields *string - outputFields *string - omit *string - unwind *string - flatten *string - desc *bool - attachment *bool - delimiter *string - bom *bool - xmlRoot *string - xmlRow *string - skipHeaderRow *bool - skipHidden *bool - skipEmpty *bool - simplified *bool - view *string - skipFailedPages *bool - feedTitle *string - feedDescription *string -} - -// Optional timeout for the run, in seconds. By default, the run uses the timeout from its configuration. -func (r ApiActorTaskRunSyncGetDatasetItemsGetRequest) Timeout(timeout float64) ApiActorTaskRunSyncGetDatasetItemsGetRequest { - r.timeout = &timeout - return r -} - -// Memory limit for the run, in megabytes. The amount of memory can be set to a power of 2 with a minimum of 128. By default, the run uses the memory limit from its configuration. -func (r ApiActorTaskRunSyncGetDatasetItemsGetRequest) Memory(memory float64) ApiActorTaskRunSyncGetDatasetItemsGetRequest { - r.memory = &memory - return r -} - -// Specifies the maximum number of dataset items that will be charged for pay-per-result Actors. This does NOT guarantee that the Actor will return only this many items. It only ensures you won't be charged for more than this number of items. Only works for pay-per-result Actors. Value can be accessed in the actor run using `ACTOR_MAX_PAID_DATASET_ITEMS` environment variable. -func (r ApiActorTaskRunSyncGetDatasetItemsGetRequest) MaxItems(maxItems float64) ApiActorTaskRunSyncGetDatasetItemsGetRequest { - r.maxItems = &maxItems - return r -} - -// Specifies the Actor build to run. It can be either a build tag or build number. By default, the run uses the build from its configuration (typically `latest`). -func (r ApiActorTaskRunSyncGetDatasetItemsGetRequest) Build(build string) ApiActorTaskRunSyncGetDatasetItemsGetRequest { - r.build = &build - return r -} - -// Specifies optional webhooks associated with the Actor run, which can be used to receive a notification e.g. when the Actor finished or failed. The value is a Base64-encoded JSON array whose items follow the WebhookRepresentation schema. For more information, see [Webhooks documentation](https://docs.apify.com/platform/integrations/webhooks). -func (r ApiActorTaskRunSyncGetDatasetItemsGetRequest) Webhooks(webhooks string) ApiActorTaskRunSyncGetDatasetItemsGetRequest { - r.webhooks = &webhooks - return r -} - -// Format of the results, possible values are: `json`, `jsonl`, `csv`, `html`, `xlsx`, `xml` and `rss`. The default value is `json`. -func (r ApiActorTaskRunSyncGetDatasetItemsGetRequest) Format(format string) ApiActorTaskRunSyncGetDatasetItemsGetRequest { - r.format = &format - return r -} - -// If `true` or `1` then the API endpoint returns only non-empty items and skips hidden fields (i.e. fields starting with the # character). The `clean` parameter is just a shortcut for `skipHidden=true` and `skipEmpty=true` parameters. Note that since some objects might be skipped from the output, that the result might contain less items than the `limit` value. -func (r ApiActorTaskRunSyncGetDatasetItemsGetRequest) Clean(clean bool) ApiActorTaskRunSyncGetDatasetItemsGetRequest { - r.clean = &clean - return r -} - -// Number of items that should be skipped at the start. The default value is `0`. -func (r ApiActorTaskRunSyncGetDatasetItemsGetRequest) Offset(offset float64) ApiActorTaskRunSyncGetDatasetItemsGetRequest { - r.offset = &offset - return r -} - -// Maximum number of items to return. By default there is no limit. -func (r ApiActorTaskRunSyncGetDatasetItemsGetRequest) Limit(limit float64) ApiActorTaskRunSyncGetDatasetItemsGetRequest { - r.limit = &limit - return r -} - -// A comma-separated list of fields which should be picked from the items, only these fields will remain in the resulting record objects. Note that the fields in the outputted items are sorted the same way as they are specified in the `fields` query parameter. You can use this feature to effectively fix the output format. -func (r ApiActorTaskRunSyncGetDatasetItemsGetRequest) Fields(fields string) ApiActorTaskRunSyncGetDatasetItemsGetRequest { - r.fields = &fields - return r -} - -// A comma-separated list of output field names that positionally rename the fields specified in the `fields` parameter. For example, `?fields=headline,url&outputFields=title,link` renames `headline` to `title` and `url` to `link` in the output. The number of names in `outputFields` must match the number of names in `fields`. Requires the `fields` parameter to be specified as well. -func (r ApiActorTaskRunSyncGetDatasetItemsGetRequest) OutputFields(outputFields string) ApiActorTaskRunSyncGetDatasetItemsGetRequest { - r.outputFields = &outputFields - return r -} - -// A comma-separated list of fields which should be omitted from the items. -func (r ApiActorTaskRunSyncGetDatasetItemsGetRequest) Omit(omit string) ApiActorTaskRunSyncGetDatasetItemsGetRequest { - r.omit = &omit - return r -} - -// A comma-separated list of fields which should be unwound, in order which they should be processed. Each field should be either an array or an object. If the field is an array then every element of the array will become a separate record and merged with parent object. If the unwound field is an object then it is merged with the parent object. If the unwound field is missing or its value is neither an array nor an object and therefore cannot be merged with a parent object then the item gets preserved as it is. Note that the unwound items ignore the `desc` parameter. -func (r ApiActorTaskRunSyncGetDatasetItemsGetRequest) Unwind(unwind string) ApiActorTaskRunSyncGetDatasetItemsGetRequest { - r.unwind = &unwind - return r -} - -// A comma-separated list of fields which should transform nested objects into flat structures. For example, with `flatten=\"foo\"` the object `{\"foo\":{\"bar\": \"hello\"}}` is turned into `{\"foo.bar\": \"hello\"}`. The original object with properties is replaced with the flattened object. -func (r ApiActorTaskRunSyncGetDatasetItemsGetRequest) Flatten(flatten string) ApiActorTaskRunSyncGetDatasetItemsGetRequest { - r.flatten = &flatten - return r -} - -// By default, results are returned in the same order as they were stored. To reverse the order, set this parameter to `true` or `1`. -func (r ApiActorTaskRunSyncGetDatasetItemsGetRequest) Desc(desc bool) ApiActorTaskRunSyncGetDatasetItemsGetRequest { - r.desc = &desc - return r -} - -// If `true` or `1` then the response will define the `Content-Disposition: attachment` header, forcing a web browser to download the file rather than to display it. By default this header is not present. -func (r ApiActorTaskRunSyncGetDatasetItemsGetRequest) Attachment(attachment bool) ApiActorTaskRunSyncGetDatasetItemsGetRequest { - r.attachment = &attachment - return r -} - -// A delimiter character for CSV files, only used if `format=csv`. You might need to URL-encode the character (e.g. use `%09` for tab or `%3B` for semicolon). The default delimiter is a simple comma (`,`). -func (r ApiActorTaskRunSyncGetDatasetItemsGetRequest) Delimiter(delimiter string) ApiActorTaskRunSyncGetDatasetItemsGetRequest { - r.delimiter = &delimiter - return r -} - -// All text responses are encoded in UTF-8 encoding. By default, the `format=csv` files are prefixed with the UTF-8 Byte Order Mark (BOM), while `json`, `jsonl`, `xml`, `html` and `rss` files are not. If you want to override this default behavior, specify `bom=1` query parameter to include the BOM or `bom=0` to skip it. -func (r ApiActorTaskRunSyncGetDatasetItemsGetRequest) Bom(bom bool) ApiActorTaskRunSyncGetDatasetItemsGetRequest { - r.bom = &bom - return r -} - -// Overrides default root element name of `xml` output. By default the root element is `items`. -func (r ApiActorTaskRunSyncGetDatasetItemsGetRequest) XmlRoot(xmlRoot string) ApiActorTaskRunSyncGetDatasetItemsGetRequest { - r.xmlRoot = &xmlRoot - return r -} - -// Overrides default element name that wraps each page or page function result object in `xml` output. By default the element name is `item`. -func (r ApiActorTaskRunSyncGetDatasetItemsGetRequest) XmlRow(xmlRow string) ApiActorTaskRunSyncGetDatasetItemsGetRequest { - r.xmlRow = &xmlRow - return r -} - -// If `true` or `1` then header row in the `csv` format is skipped. -func (r ApiActorTaskRunSyncGetDatasetItemsGetRequest) SkipHeaderRow(skipHeaderRow bool) ApiActorTaskRunSyncGetDatasetItemsGetRequest { - r.skipHeaderRow = &skipHeaderRow - return r -} - -// If `true` or `1` then hidden fields are skipped from the output, i.e. fields starting with the `#` character. -func (r ApiActorTaskRunSyncGetDatasetItemsGetRequest) SkipHidden(skipHidden bool) ApiActorTaskRunSyncGetDatasetItemsGetRequest { - r.skipHidden = &skipHidden - return r -} - -// If `true` or `1` then empty items are skipped from the output. Note that if used, the results might contain less items than the limit value. -func (r ApiActorTaskRunSyncGetDatasetItemsGetRequest) SkipEmpty(skipEmpty bool) ApiActorTaskRunSyncGetDatasetItemsGetRequest { - r.skipEmpty = &skipEmpty - return r -} - -// If `true` or `1` then, the endpoint applies the `fields=url,pageFunctionResult,errorInfo` and `unwind=pageFunctionResult` query parameters. This feature is used to emulate simplified results provided by the legacy Apify Crawler product and it's not recommended to use it in new integrations. -func (r ApiActorTaskRunSyncGetDatasetItemsGetRequest) Simplified(simplified bool) ApiActorTaskRunSyncGetDatasetItemsGetRequest { - r.simplified = &simplified - return r -} - -// Defines the view configuration for dataset items based on the schema definition. This parameter determines how the data will be filtered and presented. For complete specification details, see the [dataset schema documentation](/platform/actors/development/actor-definition/dataset-schema). -func (r ApiActorTaskRunSyncGetDatasetItemsGetRequest) View(view string) ApiActorTaskRunSyncGetDatasetItemsGetRequest { - r.view = &view - return r -} - -// If `true` or `1` then, the all the items with errorInfo property will be skipped from the output. This feature is here to emulate functionality of API version 1 used for the legacy Apify Crawler product and it's not recommended to use it in new integrations. -func (r ApiActorTaskRunSyncGetDatasetItemsGetRequest) SkipFailedPages(skipFailedPages bool) ApiActorTaskRunSyncGetDatasetItemsGetRequest { - r.skipFailedPages = &skipFailedPages - return r -} - -// Overrides the auto-generated RSS channel `<title>` element. Only used when `format=rss`. If not provided, the title defaults to `Dataset <label>`. -func (r ApiActorTaskRunSyncGetDatasetItemsGetRequest) FeedTitle(feedTitle string) ApiActorTaskRunSyncGetDatasetItemsGetRequest { - r.feedTitle = &feedTitle - return r -} - -// Overrides the auto-generated RSS channel `<description>` element. Only used when `format=rss`. If not provided, the description defaults to `Items in dataset with id \"<datasetId>\".` -func (r ApiActorTaskRunSyncGetDatasetItemsGetRequest) FeedDescription(feedDescription string) ApiActorTaskRunSyncGetDatasetItemsGetRequest { - r.feedDescription = &feedDescription - return r -} - -func (r ApiActorTaskRunSyncGetDatasetItemsGetRequest) Execute() (map[string]interface{}, *http.Response, error) { - return r.ApiService.ActorTaskRunSyncGetDatasetItemsGetExecute(r) -} - -/* -ActorTaskRunSyncGetDatasetItemsGet Run task synchronously and get dataset items - -Run a specific task and return its dataset items. - -The run must finish in 300<!-- MAX_ACTOR_JOB_SYNC_WAIT_SECS --> seconds -otherwise the HTTP request fails with a timeout error (this won't abort -the run itself). - -You can send all the same options in parameters as the [Get Dataset -Items](#/reference/datasets/item-collection/get-items) API endpoint. - -Beware that it might be impossible to maintain an idle HTTP connection for -an extended period, due to client timeout or network conditions. Make sure your HTTP client is -configured to have a long enough connection timeout. - -If the connection breaks, you will not receive any information about the run -and its status. - -To run the Task asynchronously, use the [Run task -asynchronously](#/reference/actor-tasks/run-collection/run-task) endpoint -instead. - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param actorTaskId Task ID or a tilde-separated owner's username and task's name. - @return ApiActorTaskRunSyncGetDatasetItemsGetRequest -*/ -func (a *ActorTasksAPIService) ActorTaskRunSyncGetDatasetItemsGet(ctx context.Context, actorTaskId string) ApiActorTaskRunSyncGetDatasetItemsGetRequest { - return ApiActorTaskRunSyncGetDatasetItemsGetRequest{ - ApiService: a, - ctx: ctx, - actorTaskId: actorTaskId, - } -} - -// Execute executes the request -// @return map[string]interface{} -func (a *ActorTasksAPIService) ActorTaskRunSyncGetDatasetItemsGetExecute(r ApiActorTaskRunSyncGetDatasetItemsGetRequest) (map[string]interface{}, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue map[string]interface{} - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ActorTasksAPIService.ActorTaskRunSyncGetDatasetItemsGet") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/actor-tasks/{actorTaskId}/run-sync-get-dataset-items" - localVarPath = strings.Replace(localVarPath, "{"+"actorTaskId"+"}", url.PathEscape(parameterValueToString(r.actorTaskId, "actorTaskId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if r.timeout != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "timeout", r.timeout, "form", "") - } - if r.memory != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "memory", r.memory, "form", "") - } - if r.maxItems != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "maxItems", r.maxItems, "form", "") - } - if r.build != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "build", r.build, "form", "") - } - if r.webhooks != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "webhooks", r.webhooks, "form", "") - } - if r.format != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "format", r.format, "form", "") - } - if r.clean != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "clean", r.clean, "form", "") - } - if r.offset != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "form", "") - } - if r.limit != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "form", "") - } - if r.fields != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "fields", r.fields, "form", "") - } - if r.outputFields != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "outputFields", r.outputFields, "form", "") - } - if r.omit != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "omit", r.omit, "form", "") - } - if r.unwind != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "unwind", r.unwind, "form", "") - } - if r.flatten != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "flatten", r.flatten, "form", "") - } - if r.desc != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "desc", r.desc, "form", "") - } - if r.attachment != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "attachment", r.attachment, "form", "") - } - if r.delimiter != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "delimiter", r.delimiter, "form", "") - } - if r.bom != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "bom", r.bom, "form", "") - } - if r.xmlRoot != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "xmlRoot", r.xmlRoot, "form", "") - } - if r.xmlRow != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "xmlRow", r.xmlRow, "form", "") - } - if r.skipHeaderRow != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "skipHeaderRow", r.skipHeaderRow, "form", "") - } - if r.skipHidden != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "skipHidden", r.skipHidden, "form", "") - } - if r.skipEmpty != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "skipEmpty", r.skipEmpty, "form", "") - } - if r.simplified != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "simplified", r.simplified, "form", "") - } - if r.view != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "view", r.view, "form", "") - } - if r.skipFailedPages != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "skipFailedPages", r.skipFailedPages, "form", "") - } - if r.feedTitle != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "feedTitle", r.feedTitle, "form", "") - } - if r.feedDescription != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "feedDescription", r.feedDescription, "form", "") - } - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 408 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiActorTaskRunSyncGetDatasetItemsPostRequest struct { - ctx context.Context - ApiService *ActorTasksAPIService - actorTaskId string - body *map[string]interface{} - timeout *float64 - memory *float64 - maxItems *float64 - maxTotalChargeUsd *float64 - restartOnError *bool - build *string - webhooks *string - format *string - clean *bool - offset *float64 - limit *float64 - fields *string - outputFields *string - omit *string - unwind *string - flatten *string - desc *bool - attachment *bool - delimiter *string - bom *bool - xmlRoot *string - xmlRow *string - skipHeaderRow *bool - skipHidden *bool - skipEmpty *bool - simplified *bool - view *string - skipFailedPages *bool - feedTitle *string - feedDescription *string -} - -// -func (r ApiActorTaskRunSyncGetDatasetItemsPostRequest) Body(body map[string]interface{}) ApiActorTaskRunSyncGetDatasetItemsPostRequest { - r.body = &body - return r -} - -// Optional timeout for the run, in seconds. By default, the run uses the timeout from its configuration. -func (r ApiActorTaskRunSyncGetDatasetItemsPostRequest) Timeout(timeout float64) ApiActorTaskRunSyncGetDatasetItemsPostRequest { - r.timeout = &timeout - return r -} - -// Memory limit for the run, in megabytes. The amount of memory can be set to a power of 2 with a minimum of 128. By default, the run uses the memory limit from its configuration. -func (r ApiActorTaskRunSyncGetDatasetItemsPostRequest) Memory(memory float64) ApiActorTaskRunSyncGetDatasetItemsPostRequest { - r.memory = &memory - return r -} - -// Specifies the maximum number of dataset items that will be charged for pay-per-result Actors. This does NOT guarantee that the Actor will return only this many items. It only ensures you won't be charged for more than this number of items. Only works for pay-per-result Actors. Value can be accessed in the actor run using `ACTOR_MAX_PAID_DATASET_ITEMS` environment variable. -func (r ApiActorTaskRunSyncGetDatasetItemsPostRequest) MaxItems(maxItems float64) ApiActorTaskRunSyncGetDatasetItemsPostRequest { - r.maxItems = &maxItems - return r -} - -// Specifies the maximum cost of the run. This parameter is useful for pay-per-event Actors, as it allows you to limit the amount charged to your subscription. You can access the maximum cost in your Actor by using the `ACTOR_MAX_TOTAL_CHARGE_USD` environment variable. -func (r ApiActorTaskRunSyncGetDatasetItemsPostRequest) MaxTotalChargeUsd(maxTotalChargeUsd float64) ApiActorTaskRunSyncGetDatasetItemsPostRequest { - r.maxTotalChargeUsd = &maxTotalChargeUsd - return r -} - -// Determines whether the run will be restarted if it fails. -func (r ApiActorTaskRunSyncGetDatasetItemsPostRequest) RestartOnError(restartOnError bool) ApiActorTaskRunSyncGetDatasetItemsPostRequest { - r.restartOnError = &restartOnError - return r -} - -// Specifies the Actor build to run. It can be either a build tag or build number. By default, the run uses the build from its configuration (typically `latest`). -func (r ApiActorTaskRunSyncGetDatasetItemsPostRequest) Build(build string) ApiActorTaskRunSyncGetDatasetItemsPostRequest { - r.build = &build - return r -} - -// Specifies optional webhooks associated with the Actor run, which can be used to receive a notification e.g. when the Actor finished or failed. The value is a Base64-encoded JSON array whose items follow the WebhookRepresentation schema. For more information, see [Webhooks documentation](https://docs.apify.com/platform/integrations/webhooks). -func (r ApiActorTaskRunSyncGetDatasetItemsPostRequest) Webhooks(webhooks string) ApiActorTaskRunSyncGetDatasetItemsPostRequest { - r.webhooks = &webhooks - return r -} - -// Format of the results, possible values are: `json`, `jsonl`, `csv`, `html`, `xlsx`, `xml` and `rss`. The default value is `json`. -func (r ApiActorTaskRunSyncGetDatasetItemsPostRequest) Format(format string) ApiActorTaskRunSyncGetDatasetItemsPostRequest { - r.format = &format - return r -} - -// If `true` or `1` then the API endpoint returns only non-empty items and skips hidden fields (i.e. fields starting with the # character). The `clean` parameter is just a shortcut for `skipHidden=true` and `skipEmpty=true` parameters. Note that since some objects might be skipped from the output, that the result might contain less items than the `limit` value. -func (r ApiActorTaskRunSyncGetDatasetItemsPostRequest) Clean(clean bool) ApiActorTaskRunSyncGetDatasetItemsPostRequest { - r.clean = &clean - return r -} - -// Number of items that should be skipped at the start. The default value is `0`. -func (r ApiActorTaskRunSyncGetDatasetItemsPostRequest) Offset(offset float64) ApiActorTaskRunSyncGetDatasetItemsPostRequest { - r.offset = &offset - return r -} - -// Maximum number of items to return. By default there is no limit. -func (r ApiActorTaskRunSyncGetDatasetItemsPostRequest) Limit(limit float64) ApiActorTaskRunSyncGetDatasetItemsPostRequest { - r.limit = &limit - return r -} - -// A comma-separated list of fields which should be picked from the items, only these fields will remain in the resulting record objects. Note that the fields in the outputted items are sorted the same way as they are specified in the `fields` query parameter. You can use this feature to effectively fix the output format. -func (r ApiActorTaskRunSyncGetDatasetItemsPostRequest) Fields(fields string) ApiActorTaskRunSyncGetDatasetItemsPostRequest { - r.fields = &fields - return r -} - -// A comma-separated list of output field names that positionally rename the fields specified in the `fields` parameter. For example, `?fields=headline,url&outputFields=title,link` renames `headline` to `title` and `url` to `link` in the output. The number of names in `outputFields` must match the number of names in `fields`. Requires the `fields` parameter to be specified as well. -func (r ApiActorTaskRunSyncGetDatasetItemsPostRequest) OutputFields(outputFields string) ApiActorTaskRunSyncGetDatasetItemsPostRequest { - r.outputFields = &outputFields - return r -} - -// A comma-separated list of fields which should be omitted from the items. -func (r ApiActorTaskRunSyncGetDatasetItemsPostRequest) Omit(omit string) ApiActorTaskRunSyncGetDatasetItemsPostRequest { - r.omit = &omit - return r -} - -// A comma-separated list of fields which should be unwound, in order which they should be processed. Each field should be either an array or an object. If the field is an array then every element of the array will become a separate record and merged with parent object. If the unwound field is an object then it is merged with the parent object. If the unwound field is missing or its value is neither an array nor an object and therefore cannot be merged with a parent object then the item gets preserved as it is. Note that the unwound items ignore the `desc` parameter. -func (r ApiActorTaskRunSyncGetDatasetItemsPostRequest) Unwind(unwind string) ApiActorTaskRunSyncGetDatasetItemsPostRequest { - r.unwind = &unwind - return r -} - -// A comma-separated list of fields which should transform nested objects into flat structures. For example, with `flatten=\"foo\"` the object `{\"foo\":{\"bar\": \"hello\"}}` is turned into `{\"foo.bar\": \"hello\"}`. The original object with properties is replaced with the flattened object. -func (r ApiActorTaskRunSyncGetDatasetItemsPostRequest) Flatten(flatten string) ApiActorTaskRunSyncGetDatasetItemsPostRequest { - r.flatten = &flatten - return r -} - -// By default, results are returned in the same order as they were stored. To reverse the order, set this parameter to `true` or `1`. -func (r ApiActorTaskRunSyncGetDatasetItemsPostRequest) Desc(desc bool) ApiActorTaskRunSyncGetDatasetItemsPostRequest { - r.desc = &desc - return r -} - -// If `true` or `1` then the response will define the `Content-Disposition: attachment` header, forcing a web browser to download the file rather than to display it. By default this header is not present. -func (r ApiActorTaskRunSyncGetDatasetItemsPostRequest) Attachment(attachment bool) ApiActorTaskRunSyncGetDatasetItemsPostRequest { - r.attachment = &attachment - return r -} - -// A delimiter character for CSV files, only used if `format=csv`. You might need to URL-encode the character (e.g. use `%09` for tab or `%3B` for semicolon). The default delimiter is a simple comma (`,`). -func (r ApiActorTaskRunSyncGetDatasetItemsPostRequest) Delimiter(delimiter string) ApiActorTaskRunSyncGetDatasetItemsPostRequest { - r.delimiter = &delimiter - return r -} - -// All text responses are encoded in UTF-8 encoding. By default, the `format=csv` files are prefixed with the UTF-8 Byte Order Mark (BOM), while `json`, `jsonl`, `xml`, `html` and `rss` files are not. If you want to override this default behavior, specify `bom=1` query parameter to include the BOM or `bom=0` to skip it. -func (r ApiActorTaskRunSyncGetDatasetItemsPostRequest) Bom(bom bool) ApiActorTaskRunSyncGetDatasetItemsPostRequest { - r.bom = &bom - return r -} - -// Overrides default root element name of `xml` output. By default the root element is `items`. -func (r ApiActorTaskRunSyncGetDatasetItemsPostRequest) XmlRoot(xmlRoot string) ApiActorTaskRunSyncGetDatasetItemsPostRequest { - r.xmlRoot = &xmlRoot - return r -} - -// Overrides default element name that wraps each page or page function result object in `xml` output. By default the element name is `item`. -func (r ApiActorTaskRunSyncGetDatasetItemsPostRequest) XmlRow(xmlRow string) ApiActorTaskRunSyncGetDatasetItemsPostRequest { - r.xmlRow = &xmlRow - return r -} - -// If `true` or `1` then header row in the `csv` format is skipped. -func (r ApiActorTaskRunSyncGetDatasetItemsPostRequest) SkipHeaderRow(skipHeaderRow bool) ApiActorTaskRunSyncGetDatasetItemsPostRequest { - r.skipHeaderRow = &skipHeaderRow - return r -} - -// If `true` or `1` then hidden fields are skipped from the output, i.e. fields starting with the `#` character. -func (r ApiActorTaskRunSyncGetDatasetItemsPostRequest) SkipHidden(skipHidden bool) ApiActorTaskRunSyncGetDatasetItemsPostRequest { - r.skipHidden = &skipHidden - return r -} - -// If `true` or `1` then empty items are skipped from the output. Note that if used, the results might contain less items than the limit value. -func (r ApiActorTaskRunSyncGetDatasetItemsPostRequest) SkipEmpty(skipEmpty bool) ApiActorTaskRunSyncGetDatasetItemsPostRequest { - r.skipEmpty = &skipEmpty - return r -} - -// If `true` or `1` then, the endpoint applies the `fields=url,pageFunctionResult,errorInfo` and `unwind=pageFunctionResult` query parameters. This feature is used to emulate simplified results provided by the legacy Apify Crawler product and it's not recommended to use it in new integrations. -func (r ApiActorTaskRunSyncGetDatasetItemsPostRequest) Simplified(simplified bool) ApiActorTaskRunSyncGetDatasetItemsPostRequest { - r.simplified = &simplified - return r -} - -// Defines the view configuration for dataset items based on the schema definition. This parameter determines how the data will be filtered and presented. For complete specification details, see the [dataset schema documentation](/platform/actors/development/actor-definition/dataset-schema). -func (r ApiActorTaskRunSyncGetDatasetItemsPostRequest) View(view string) ApiActorTaskRunSyncGetDatasetItemsPostRequest { - r.view = &view - return r -} - -// If `true` or `1` then, the all the items with errorInfo property will be skipped from the output. This feature is here to emulate functionality of API version 1 used for the legacy Apify Crawler product and it's not recommended to use it in new integrations. -func (r ApiActorTaskRunSyncGetDatasetItemsPostRequest) SkipFailedPages(skipFailedPages bool) ApiActorTaskRunSyncGetDatasetItemsPostRequest { - r.skipFailedPages = &skipFailedPages - return r -} - -// Overrides the auto-generated RSS channel `<title>` element. Only used when `format=rss`. If not provided, the title defaults to `Dataset <label>`. -func (r ApiActorTaskRunSyncGetDatasetItemsPostRequest) FeedTitle(feedTitle string) ApiActorTaskRunSyncGetDatasetItemsPostRequest { - r.feedTitle = &feedTitle - return r -} - -// Overrides the auto-generated RSS channel `<description>` element. Only used when `format=rss`. If not provided, the description defaults to `Items in dataset with id \"<datasetId>\".` -func (r ApiActorTaskRunSyncGetDatasetItemsPostRequest) FeedDescription(feedDescription string) ApiActorTaskRunSyncGetDatasetItemsPostRequest { - r.feedDescription = &feedDescription - return r -} - -func (r ApiActorTaskRunSyncGetDatasetItemsPostRequest) Execute() (map[string]interface{}, *http.Response, error) { - return r.ApiService.ActorTaskRunSyncGetDatasetItemsPostExecute(r) -} - -/* -ActorTaskRunSyncGetDatasetItemsPost Run task synchronously and get dataset items - -Runs an Actor task and synchronously returns its dataset items. - -The run must finish in 300<!-- MAX_ACTOR_JOB_SYNC_WAIT_SECS --> seconds -otherwise the HTTP request fails with a timeout error (this won't abort -the run itself). - -Optionally, you can override the Actor input configuration by passing a JSON -object as the POST payload and setting the `Content-Type: application/json` HTTP header. - -Note that if the object in the POST payload does not define a particular -input property, the Actor run uses the default value defined by the task (or the Actor's -input schema if not defined by the task). - -You can send all the same options in parameters as the [Get Dataset -Items](#/reference/datasets/item-collection/get-items) API endpoint. - -Beware that it might be impossible to maintain an idle HTTP connection for -an extended period, due to client timeout or network conditions. Make sure your HTTP client is -configured to have a long enough connection timeout. - -If the connection breaks, you will not receive any information about the run -and its status. - -Input fields from Actor task configuration can be overloaded with values -passed as the POST payload. - -Just make sure to specify the `Content-Type` header as `application/json` -and that the input is an object. - -To run the task asynchronously, use the [Run -task](#/reference/actor-tasks/run-collection/run-task) API endpoint instead. - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param actorTaskId Task ID or a tilde-separated owner's username and task's name. - @return ApiActorTaskRunSyncGetDatasetItemsPostRequest -*/ -func (a *ActorTasksAPIService) ActorTaskRunSyncGetDatasetItemsPost(ctx context.Context, actorTaskId string) ApiActorTaskRunSyncGetDatasetItemsPostRequest { - return ApiActorTaskRunSyncGetDatasetItemsPostRequest{ - ApiService: a, - ctx: ctx, - actorTaskId: actorTaskId, - } -} - -// Execute executes the request -// @return map[string]interface{} -func (a *ActorTasksAPIService) ActorTaskRunSyncGetDatasetItemsPostExecute(r ApiActorTaskRunSyncGetDatasetItemsPostRequest) (map[string]interface{}, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodPost - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue map[string]interface{} - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ActorTasksAPIService.ActorTaskRunSyncGetDatasetItemsPost") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/actor-tasks/{actorTaskId}/run-sync-get-dataset-items" - localVarPath = strings.Replace(localVarPath, "{"+"actorTaskId"+"}", url.PathEscape(parameterValueToString(r.actorTaskId, "actorTaskId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - if r.body == nil { - return localVarReturnValue, nil, reportError("body is required and must be specified") - } - - if r.timeout != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "timeout", r.timeout, "form", "") - } - if r.memory != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "memory", r.memory, "form", "") - } - if r.maxItems != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "maxItems", r.maxItems, "form", "") - } - if r.maxTotalChargeUsd != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "maxTotalChargeUsd", r.maxTotalChargeUsd, "form", "") - } - if r.restartOnError != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "restartOnError", r.restartOnError, "form", "") - } - if r.build != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "build", r.build, "form", "") - } - if r.webhooks != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "webhooks", r.webhooks, "form", "") - } - if r.format != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "format", r.format, "form", "") - } - if r.clean != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "clean", r.clean, "form", "") - } - if r.offset != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "form", "") - } - if r.limit != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "form", "") - } - if r.fields != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "fields", r.fields, "form", "") - } - if r.outputFields != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "outputFields", r.outputFields, "form", "") - } - if r.omit != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "omit", r.omit, "form", "") - } - if r.unwind != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "unwind", r.unwind, "form", "") - } - if r.flatten != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "flatten", r.flatten, "form", "") - } - if r.desc != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "desc", r.desc, "form", "") - } - if r.attachment != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "attachment", r.attachment, "form", "") - } - if r.delimiter != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "delimiter", r.delimiter, "form", "") - } - if r.bom != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "bom", r.bom, "form", "") - } - if r.xmlRoot != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "xmlRoot", r.xmlRoot, "form", "") - } - if r.xmlRow != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "xmlRow", r.xmlRow, "form", "") - } - if r.skipHeaderRow != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "skipHeaderRow", r.skipHeaderRow, "form", "") - } - if r.skipHidden != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "skipHidden", r.skipHidden, "form", "") - } - if r.skipEmpty != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "skipEmpty", r.skipEmpty, "form", "") - } - if r.simplified != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "simplified", r.simplified, "form", "") - } - if r.view != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "view", r.view, "form", "") - } - if r.skipFailedPages != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "skipFailedPages", r.skipFailedPages, "form", "") - } - if r.feedTitle != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "feedTitle", r.feedTitle, "form", "") - } - if r.feedDescription != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "feedDescription", r.feedDescription, "form", "") - } - // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/json"} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - // body params - localVarPostBody = r.body - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 413 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 415 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiActorTaskRunSyncPostRequest struct { - ctx context.Context - ApiService *ActorTasksAPIService - actorTaskId string - body *map[string]interface{} - timeout *float64 - memory *float64 - maxItems *float64 - maxTotalChargeUsd *float64 - restartOnError *bool - build *string - outputRecordKey *string - webhooks *string -} - -// -func (r ApiActorTaskRunSyncPostRequest) Body(body map[string]interface{}) ApiActorTaskRunSyncPostRequest { - r.body = &body - return r -} - -// Optional timeout for the run, in seconds. By default, the run uses the timeout from its configuration. -func (r ApiActorTaskRunSyncPostRequest) Timeout(timeout float64) ApiActorTaskRunSyncPostRequest { - r.timeout = &timeout - return r -} - -// Memory limit for the run, in megabytes. The amount of memory can be set to a power of 2 with a minimum of 128. By default, the run uses the memory limit from its configuration. -func (r ApiActorTaskRunSyncPostRequest) Memory(memory float64) ApiActorTaskRunSyncPostRequest { - r.memory = &memory - return r -} - -// Specifies the maximum number of dataset items that will be charged for pay-per-result Actors. This does NOT guarantee that the Actor will return only this many items. It only ensures you won't be charged for more than this number of items. Only works for pay-per-result Actors. Value can be accessed in the actor run using `ACTOR_MAX_PAID_DATASET_ITEMS` environment variable. -func (r ApiActorTaskRunSyncPostRequest) MaxItems(maxItems float64) ApiActorTaskRunSyncPostRequest { - r.maxItems = &maxItems - return r -} - -// Specifies the maximum cost of the run. This parameter is useful for pay-per-event Actors, as it allows you to limit the amount charged to your subscription. You can access the maximum cost in your Actor by using the `ACTOR_MAX_TOTAL_CHARGE_USD` environment variable. -func (r ApiActorTaskRunSyncPostRequest) MaxTotalChargeUsd(maxTotalChargeUsd float64) ApiActorTaskRunSyncPostRequest { - r.maxTotalChargeUsd = &maxTotalChargeUsd - return r -} - -// Determines whether the run will be restarted if it fails. -func (r ApiActorTaskRunSyncPostRequest) RestartOnError(restartOnError bool) ApiActorTaskRunSyncPostRequest { - r.restartOnError = &restartOnError - return r -} - -// Specifies the Actor build to run. It can be either a build tag or build number. By default, the run uses the build from its configuration (typically `latest`). -func (r ApiActorTaskRunSyncPostRequest) Build(build string) ApiActorTaskRunSyncPostRequest { - r.build = &build - return r -} - -// Key of the record from run's default key-value store to be returned in the response. By default, it is `OUTPUT`. -func (r ApiActorTaskRunSyncPostRequest) OutputRecordKey(outputRecordKey string) ApiActorTaskRunSyncPostRequest { - r.outputRecordKey = &outputRecordKey - return r -} - -// Specifies optional webhooks associated with the Actor run, which can be used to receive a notification e.g. when the Actor finished or failed. The value is a Base64-encoded JSON array whose items follow the WebhookRepresentation schema. For more information, see [Webhooks documentation](https://docs.apify.com/platform/integrations/webhooks). -func (r ApiActorTaskRunSyncPostRequest) Webhooks(webhooks string) ApiActorTaskRunSyncPostRequest { - r.webhooks = &webhooks - return r -} - -func (r ApiActorTaskRunSyncPostRequest) Execute() (map[string]interface{}, *http.Response, error) { - return r.ApiService.ActorTaskRunSyncPostExecute(r) -} - -/* -ActorTaskRunSyncPost Run task synchronously - -Runs an Actor task and synchronously returns its output. - -The run must finish in 300<!-- MAX_ACTOR_JOB_SYNC_WAIT_SECS --> seconds -otherwise the HTTP request fails with a timeout error (this won't abort -the run itself). - -Optionally, you can override the Actor input configuration by passing a JSON -object as the POST payload and setting the `Content-Type: application/json` HTTP header. - -Note that if the object in the POST payload does not define a particular -input property, the Actor run uses the default value defined by the task (or Actor's input -schema if not defined by the task). - -Beware that it might be impossible to maintain an idle HTTP connection for -an extended period, due to client timeout or network conditions. Make sure your HTTP client is -configured to have a long enough connection timeout. - -If the connection breaks, you will not receive any information about the run -and its status. - -Input fields from Actor task configuration can be overloaded with values -passed as the POST payload. - -Just make sure to specify `Content-Type` header to be `application/json` and -input to be an object. - -To run the task asynchronously, use the [Run -task](#/reference/actor-tasks/run-collection/run-task) API endpoint instead. - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param actorTaskId Task ID or a tilde-separated owner's username and task's name. - @return ApiActorTaskRunSyncPostRequest -*/ -func (a *ActorTasksAPIService) ActorTaskRunSyncPost(ctx context.Context, actorTaskId string) ApiActorTaskRunSyncPostRequest { - return ApiActorTaskRunSyncPostRequest{ - ApiService: a, - ctx: ctx, - actorTaskId: actorTaskId, - } -} - -// Execute executes the request -// @return map[string]interface{} -func (a *ActorTasksAPIService) ActorTaskRunSyncPostExecute(r ApiActorTaskRunSyncPostRequest) (map[string]interface{}, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodPost - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue map[string]interface{} - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ActorTasksAPIService.ActorTaskRunSyncPost") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/actor-tasks/{actorTaskId}/run-sync" - localVarPath = strings.Replace(localVarPath, "{"+"actorTaskId"+"}", url.PathEscape(parameterValueToString(r.actorTaskId, "actorTaskId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - if r.body == nil { - return localVarReturnValue, nil, reportError("body is required and must be specified") - } - - if r.timeout != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "timeout", r.timeout, "form", "") - } - if r.memory != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "memory", r.memory, "form", "") - } - if r.maxItems != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "maxItems", r.maxItems, "form", "") - } - if r.maxTotalChargeUsd != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "maxTotalChargeUsd", r.maxTotalChargeUsd, "form", "") - } - if r.restartOnError != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "restartOnError", r.restartOnError, "form", "") - } - if r.build != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "build", r.build, "form", "") - } - if r.outputRecordKey != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "outputRecordKey", r.outputRecordKey, "form", "") - } - if r.webhooks != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "webhooks", r.webhooks, "form", "") - } - // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/json"} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - // body params - localVarPostBody = r.body - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 413 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 415 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiActorTaskRunsGetRequest struct { - ctx context.Context - ApiService *ActorTasksAPIService - actorTaskId string - offset *float64 - limit *float64 - desc *bool - status *[]string -} - -// Number of items that should be skipped at the start. The default value is `0`. -func (r ApiActorTaskRunsGetRequest) Offset(offset float64) ApiActorTaskRunsGetRequest { - r.offset = &offset - return r -} - -// Maximum number of items to return. The default value as well as the maximum is `1000`. -func (r ApiActorTaskRunsGetRequest) Limit(limit float64) ApiActorTaskRunsGetRequest { - r.limit = &limit - return r -} - -// If `true` or `1` then the objects are sorted by the `startedAt` field in descending order. By default, they are sorted in ascending order. -func (r ApiActorTaskRunsGetRequest) Desc(desc bool) ApiActorTaskRunsGetRequest { - r.desc = &desc - return r -} - -// Single status or comma-separated list of statuses, see ([available statuses](https://docs.apify.com/platform/actors/running/runs-and-builds#lifecycle)). Used to filter runs by the specified statuses only. -func (r ApiActorTaskRunsGetRequest) Status(status []string) ApiActorTaskRunsGetRequest { - r.status = &status - return r -} - -func (r ApiActorTaskRunsGetRequest) Execute() (*ActorTaskRunsGet200Response, *http.Response, error) { - return r.ApiService.ActorTaskRunsGetExecute(r) -} - -/* -ActorTaskRunsGet Get list of task runs - -Get a list of runs of a specific task. The response is a list of objects, -where each object contains essential information about a single task run. - -The endpoint supports pagination using the `limit` and `offset` parameters, -and it does not return more than a 1000 array elements. - -By default, the records are sorted by the `startedAt` field in ascending -order; therefore you can use pagination to incrementally fetch all records while -new ones are still being created. To sort the records in descending order, use -the `desc=1` parameter. You can also filter runs by status ([available -statuses](https://docs.apify.com/platform/actors/running/runs-and-builds#lifecycle)). - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param actorTaskId Task ID or a tilde-separated owner's username and task's name. - @return ApiActorTaskRunsGetRequest -*/ -func (a *ActorTasksAPIService) ActorTaskRunsGet(ctx context.Context, actorTaskId string) ApiActorTaskRunsGetRequest { - return ApiActorTaskRunsGetRequest{ - ApiService: a, - ctx: ctx, - actorTaskId: actorTaskId, - } -} - -// Execute executes the request -// @return ActorTaskRunsGet200Response -func (a *ActorTasksAPIService) ActorTaskRunsGetExecute(r ApiActorTaskRunsGetRequest) (*ActorTaskRunsGet200Response, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *ActorTaskRunsGet200Response - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ActorTasksAPIService.ActorTaskRunsGet") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/actor-tasks/{actorTaskId}/runs" - localVarPath = strings.Replace(localVarPath, "{"+"actorTaskId"+"}", url.PathEscape(parameterValueToString(r.actorTaskId, "actorTaskId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if r.offset != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "form", "") - } - if r.limit != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "form", "") - } - if r.desc != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "desc", r.desc, "form", "") - } - if r.status != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "status", r.status, "form", "csv") - } - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiActorTaskRunsLastGetRequest struct { - ctx context.Context - ApiService *ActorTasksAPIService - actorTaskId string - status *string - waitForFinish *float64 -} - -// Filter for the run status. -func (r ApiActorTaskRunsLastGetRequest) Status(status string) ApiActorTaskRunsLastGetRequest { - r.status = &status - return r -} - -// The maximum number of seconds the server waits for the run to finish. By default it is `0`, the maximum value is `60`. <!-- MAX_ACTOR_JOB_ASYNC_WAIT_SECS --> If the run finishes in time then the returned run object will have a terminal status (e.g. `SUCCEEDED`), otherwise it will have a transitional status (e.g. `RUNNING`). -func (r ApiActorTaskRunsLastGetRequest) WaitForFinish(waitForFinish float64) ApiActorTaskRunsLastGetRequest { - r.waitForFinish = &waitForFinish - return r -} - -func (r ApiActorTaskRunsLastGetRequest) Execute() (*ActorTaskRunsPost201Response, *http.Response, error) { - return r.ApiService.ActorTaskRunsLastGetExecute(r) -} - -/* -ActorTaskRunsLastGet Get last run - -This is not a single endpoint, but an entire group of endpoints that lets you to -retrieve and manage the last run of given actor task or any of its default storages. -All the endpoints require an authentication token. - -The base path represents the last actor task run object is: - -`/v2/actor-tasks/{actorTaskId}/runs/last{?token,status}` - -Using the `status` query parameter you can ensure to only get a run with a certain status -(e.g. `status=SUCCEEDED`). The output of this endpoint and other query parameters -are the same as in the [Run object](/api/v2/actor-run-get) endpoint. - -##### Convenience endpoints for last Actor task run - -* [Dataset](/api/v2/last-actor-task-runs-default-dataset) - -* [Key-value store](/api/v2/last-actor-task-runs-default-key-value-store) - -* [Request queue](/api/v2/last-actor-task-runs-default-request-queue) - -* [Log](/api/v2/last-actor-task-runs-log) - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param actorTaskId Task ID or a tilde-separated owner's username and task's name. - @return ApiActorTaskRunsLastGetRequest -*/ -func (a *ActorTasksAPIService) ActorTaskRunsLastGet(ctx context.Context, actorTaskId string) ApiActorTaskRunsLastGetRequest { - return ApiActorTaskRunsLastGetRequest{ - ApiService: a, - ctx: ctx, - actorTaskId: actorTaskId, - } -} - -// Execute executes the request -// @return ActorTaskRunsPost201Response -func (a *ActorTasksAPIService) ActorTaskRunsLastGetExecute(r ApiActorTaskRunsLastGetRequest) (*ActorTaskRunsPost201Response, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *ActorTaskRunsPost201Response - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ActorTasksAPIService.ActorTaskRunsLastGet") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/actor-tasks/{actorTaskId}/runs/last" - localVarPath = strings.Replace(localVarPath, "{"+"actorTaskId"+"}", url.PathEscape(parameterValueToString(r.actorTaskId, "actorTaskId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if r.status != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "status", r.status, "form", "") - } - if r.waitForFinish != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "waitForFinish", r.waitForFinish, "form", "") - } - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiActorTaskRunsPostRequest struct { - ctx context.Context - ApiService *ActorTasksAPIService - actorTaskId string - body *map[string]interface{} - timeout *float64 - memory *float64 - maxItems *float64 - maxTotalChargeUsd *float64 - restartOnError *bool - build *string - waitForFinish *float64 - webhooks *string -} - -// -func (r ApiActorTaskRunsPostRequest) Body(body map[string]interface{}) ApiActorTaskRunsPostRequest { - r.body = &body - return r -} - -// Optional timeout for the run, in seconds. By default, the run uses the timeout from its configuration. -func (r ApiActorTaskRunsPostRequest) Timeout(timeout float64) ApiActorTaskRunsPostRequest { - r.timeout = &timeout - return r -} - -// Memory limit for the run, in megabytes. The amount of memory can be set to a power of 2 with a minimum of 128. By default, the run uses the memory limit from its configuration. -func (r ApiActorTaskRunsPostRequest) Memory(memory float64) ApiActorTaskRunsPostRequest { - r.memory = &memory - return r -} - -// Specifies the maximum number of dataset items that will be charged for pay-per-result Actors. This does NOT guarantee that the Actor will return only this many items. It only ensures you won't be charged for more than this number of items. Only works for pay-per-result Actors. Value can be accessed in the actor run using `ACTOR_MAX_PAID_DATASET_ITEMS` environment variable. -func (r ApiActorTaskRunsPostRequest) MaxItems(maxItems float64) ApiActorTaskRunsPostRequest { - r.maxItems = &maxItems - return r -} - -// Specifies the maximum cost of the run. This parameter is useful for pay-per-event Actors, as it allows you to limit the amount charged to your subscription. You can access the maximum cost in your Actor by using the `ACTOR_MAX_TOTAL_CHARGE_USD` environment variable. -func (r ApiActorTaskRunsPostRequest) MaxTotalChargeUsd(maxTotalChargeUsd float64) ApiActorTaskRunsPostRequest { - r.maxTotalChargeUsd = &maxTotalChargeUsd - return r -} - -// Determines whether the run will be restarted if it fails. -func (r ApiActorTaskRunsPostRequest) RestartOnError(restartOnError bool) ApiActorTaskRunsPostRequest { - r.restartOnError = &restartOnError - return r -} - -// Specifies the Actor build to run. It can be either a build tag or build number. By default, the run uses the build from its configuration (typically `latest`). -func (r ApiActorTaskRunsPostRequest) Build(build string) ApiActorTaskRunsPostRequest { - r.build = &build - return r -} - -// The maximum number of seconds the server waits for the run to finish. By default it is `0`, the maximum value is `60`. <!-- MAX_ACTOR_JOB_ASYNC_WAIT_SECS --> If the run finishes in time then the returned run object will have a terminal status (e.g. `SUCCEEDED`), otherwise it will have a transitional status (e.g. `RUNNING`). -func (r ApiActorTaskRunsPostRequest) WaitForFinish(waitForFinish float64) ApiActorTaskRunsPostRequest { - r.waitForFinish = &waitForFinish - return r -} - -// Specifies optional webhooks associated with the Actor run, which can be used to receive a notification e.g. when the Actor finished or failed. The value is a Base64-encoded JSON array whose items follow the WebhookRepresentation schema. For more information, see [Webhooks documentation](https://docs.apify.com/platform/integrations/webhooks). -func (r ApiActorTaskRunsPostRequest) Webhooks(webhooks string) ApiActorTaskRunsPostRequest { - r.webhooks = &webhooks - return r -} - -func (r ApiActorTaskRunsPostRequest) Execute() (*ActorTaskRunsPost201Response, *http.Response, error) { - return r.ApiService.ActorTaskRunsPostExecute(r) -} - -/* -ActorTaskRunsPost Run task - -Runs an Actor task and immediately returns without waiting for the run to -finish. - -Optionally, you can override the Actor input configuration by passing a JSON -object as the POST payload and setting the `Content-Type: application/json` HTTP header. - -Note that if the object in the POST payload does not define a particular -input property, the Actor run uses the default value defined by the task (or Actor's input -schema if not defined by the task). - -The response is the Actor Run object as returned by the [Get -run](#/reference/actor-runs/run-object-and-its-storages/get-run) endpoint. - -If you want to wait for the run to finish and receive the actual output of -the Actor run as the response, use one of the [Run task -synchronously](#/reference/actor-tasks/run-task-synchronously) API endpoints -instead. - -To fetch the Actor run results that are typically stored in the default -dataset, you'll need to pass the ID received in the `defaultDatasetId` field -received in the response JSON to the -[Get dataset items](#/reference/datasets/item-collection/get-items) API endpoint. - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param actorTaskId Task ID or a tilde-separated owner's username and task's name. - @return ApiActorTaskRunsPostRequest -*/ -func (a *ActorTasksAPIService) ActorTaskRunsPost(ctx context.Context, actorTaskId string) ApiActorTaskRunsPostRequest { - return ApiActorTaskRunsPostRequest{ - ApiService: a, - ctx: ctx, - actorTaskId: actorTaskId, - } -} - -// Execute executes the request -// @return ActorTaskRunsPost201Response -func (a *ActorTasksAPIService) ActorTaskRunsPostExecute(r ApiActorTaskRunsPostRequest) (*ActorTaskRunsPost201Response, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodPost - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *ActorTaskRunsPost201Response - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ActorTasksAPIService.ActorTaskRunsPost") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/actor-tasks/{actorTaskId}/runs" - localVarPath = strings.Replace(localVarPath, "{"+"actorTaskId"+"}", url.PathEscape(parameterValueToString(r.actorTaskId, "actorTaskId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - if r.body == nil { - return localVarReturnValue, nil, reportError("body is required and must be specified") - } - - if r.timeout != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "timeout", r.timeout, "form", "") - } - if r.memory != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "memory", r.memory, "form", "") - } - if r.maxItems != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "maxItems", r.maxItems, "form", "") - } - if r.maxTotalChargeUsd != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "maxTotalChargeUsd", r.maxTotalChargeUsd, "form", "") - } - if r.restartOnError != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "restartOnError", r.restartOnError, "form", "") - } - if r.build != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "build", r.build, "form", "") - } - if r.waitForFinish != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "waitForFinish", r.waitForFinish, "form", "") - } - if r.webhooks != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "webhooks", r.webhooks, "form", "") - } - // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/json"} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - // body params - localVarPostBody = r.body - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 413 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 415 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiActorTaskWebhooksGetRequest struct { - ctx context.Context - ApiService *ActorTasksAPIService - actorTaskId string - offset *float64 - limit *float64 - desc *bool -} - -// Number of items that should be skipped at the start. The default value is `0`. -func (r ApiActorTaskWebhooksGetRequest) Offset(offset float64) ApiActorTaskWebhooksGetRequest { - r.offset = &offset - return r -} - -// Maximum number of items to return. The default value as well as the maximum is `1000`. -func (r ApiActorTaskWebhooksGetRequest) Limit(limit float64) ApiActorTaskWebhooksGetRequest { - r.limit = &limit - return r -} - -// If `true` or `1` then the objects are sorted by the `createdAt` field in descending order. By default, they are sorted in ascending order. -func (r ApiActorTaskWebhooksGetRequest) Desc(desc bool) ApiActorTaskWebhooksGetRequest { - r.desc = &desc - return r -} - -func (r ApiActorTaskWebhooksGetRequest) Execute() (*ActorTaskWebhooksGet200Response, *http.Response, error) { - return r.ApiService.ActorTaskWebhooksGetExecute(r) -} - -/* -ActorTaskWebhooksGet Get list of webhooks - -Gets the list of webhooks of a specific Actor task. The response is a JSON -with the list of objects, where each object contains basic information about a single webhook. - -The endpoint supports pagination using the `limit` and `offset` parameters -and it will not return more than 1000 records. - -By default, the records are sorted by the `createdAt` field in ascending -order, to sort the records in descending order, use the `desc=1` parameter. - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param actorTaskId Task ID or a tilde-separated owner's username and task's name. - @return ApiActorTaskWebhooksGetRequest -*/ -func (a *ActorTasksAPIService) ActorTaskWebhooksGet(ctx context.Context, actorTaskId string) ApiActorTaskWebhooksGetRequest { - return ApiActorTaskWebhooksGetRequest{ - ApiService: a, - ctx: ctx, - actorTaskId: actorTaskId, - } -} - -// Execute executes the request -// @return ActorTaskWebhooksGet200Response -func (a *ActorTasksAPIService) ActorTaskWebhooksGetExecute(r ApiActorTaskWebhooksGetRequest) (*ActorTaskWebhooksGet200Response, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *ActorTaskWebhooksGet200Response - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ActorTasksAPIService.ActorTaskWebhooksGet") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/actor-tasks/{actorTaskId}/webhooks" - localVarPath = strings.Replace(localVarPath, "{"+"actorTaskId"+"}", url.PathEscape(parameterValueToString(r.actorTaskId, "actorTaskId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if r.offset != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "form", "") - } - if r.limit != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "form", "") - } - if r.desc != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "desc", r.desc, "form", "") - } - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiActorTasksGetRequest struct { - ctx context.Context - ApiService *ActorTasksAPIService - offset *float64 - limit *float64 - desc *bool -} - -// Number of items that should be skipped at the start. The default value is `0`. -func (r ApiActorTasksGetRequest) Offset(offset float64) ApiActorTasksGetRequest { - r.offset = &offset - return r -} - -// Maximum number of items to return. The default value as well as the maximum is `1000`. -func (r ApiActorTasksGetRequest) Limit(limit float64) ApiActorTasksGetRequest { - r.limit = &limit - return r -} - -// If `true` or `1` then the objects are sorted by the `createdAt` field in descending order. By default, they are sorted in ascending order. -func (r ApiActorTasksGetRequest) Desc(desc bool) ApiActorTasksGetRequest { - r.desc = &desc - return r -} - -func (r ApiActorTasksGetRequest) Execute() (*ListOfTasksResponse, *http.Response, error) { - return r.ApiService.ActorTasksGetExecute(r) -} - -/* -ActorTasksGet Get list of tasks - -Gets the complete list of tasks that a user has created or used. - -The response is a list of objects in which each object contains essential -information about a single task. - -The endpoint supports pagination using the `limit` and `offset` parameters, -and it does not return more than a 1000 records. - -By default, the records are sorted by the `createdAt` field in ascending -order; therefore you can use pagination to incrementally fetch all tasks while new -ones are still being created. To sort the records in descending order, use -the `desc=1` parameter. - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return ApiActorTasksGetRequest -*/ -func (a *ActorTasksAPIService) ActorTasksGet(ctx context.Context) ApiActorTasksGetRequest { - return ApiActorTasksGetRequest{ - ApiService: a, - ctx: ctx, - } -} - -// Execute executes the request -// @return ListOfTasksResponse -func (a *ActorTasksAPIService) ActorTasksGetExecute(r ApiActorTasksGetRequest) (*ListOfTasksResponse, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *ListOfTasksResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ActorTasksAPIService.ActorTasksGet") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/actor-tasks" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if r.offset != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "form", "") - } - if r.limit != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "form", "") - } - if r.desc != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "desc", r.desc, "form", "") - } - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiActorTasksPostRequest struct { - ctx context.Context - ApiService *ActorTasksAPIService - createTaskRequest *CreateTaskRequest -} - -// -func (r ApiActorTasksPostRequest) CreateTaskRequest(createTaskRequest CreateTaskRequest) ApiActorTasksPostRequest { - r.createTaskRequest = &createTaskRequest - return r -} - -func (r ApiActorTasksPostRequest) Execute() (*TaskResponse, *http.Response, error) { - return r.ApiService.ActorTasksPostExecute(r) -} - -/* -ActorTasksPost Create task - -Create a new task with settings specified by the object passed as JSON in -the POST payload. - -The response is the full task object as returned by the -[Get task](/api/v2/actor-task-get) endpoint. - -The request needs to specify the `Content-Type: application/json` HTTP header! - -When providing your API authentication token, we recommend using the -request's `Authorization` header, rather than the URL. - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return ApiActorTasksPostRequest -*/ -func (a *ActorTasksAPIService) ActorTasksPost(ctx context.Context) ApiActorTasksPostRequest { - return ApiActorTasksPostRequest{ - ApiService: a, - ctx: ctx, - } -} - -// Execute executes the request -// @return TaskResponse -func (a *ActorTasksAPIService) ActorTasksPostExecute(r ApiActorTasksPostRequest) (*TaskResponse, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodPost - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *TaskResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ActorTasksAPIService.ActorTasksPost") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/actor-tasks" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - if r.createTaskRequest == nil { - return localVarReturnValue, nil, reportError("createTaskRequest is required and must be specified") - } - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/json"} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - // body params - localVarPostBody = r.createTaskRequest - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 409 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 413 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 415 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} diff --git a/api_actors.go b/api_actors.go deleted file mode 100644 index 75df943..0000000 --- a/api_actors.go +++ /dev/null @@ -1,1303 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "bytes" - "context" - "io" - "net/http" - "net/url" - "strings" -) - - -// ActorsAPIService ActorsAPI service -type ActorsAPIService service - -type ApiActDeleteRequest struct { - ctx context.Context - ApiService *ActorsAPIService - actorId string -} - -func (r ApiActDeleteRequest) Execute() (map[string]interface{}, *http.Response, error) { - return r.ApiService.ActDeleteExecute(r) -} - -/* -ActDelete Delete Actor - -Deletes an Actor. - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param actorId Actor ID or a tilde-separated owner's username and Actor name. - @return ApiActDeleteRequest -*/ -func (a *ActorsAPIService) ActDelete(ctx context.Context, actorId string) ApiActDeleteRequest { - return ApiActDeleteRequest{ - ApiService: a, - ctx: ctx, - actorId: actorId, - } -} - -// Execute executes the request -// @return map[string]interface{} -func (a *ActorsAPIService) ActDeleteExecute(r ApiActDeleteRequest) (map[string]interface{}, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodDelete - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue map[string]interface{} - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ActorsAPIService.ActDelete") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/actors/{actorId}" - localVarPath = strings.Replace(localVarPath, "{"+"actorId"+"}", url.PathEscape(parameterValueToString(r.actorId, "actorId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiActGetRequest struct { - ctx context.Context - ApiService *ActorsAPIService - actorId string -} - -func (r ApiActGetRequest) Execute() (*ActorResponse, *http.Response, error) { - return r.ApiService.ActGetExecute(r) -} - -/* -ActGet Get Actor - -Gets an object that contains all the details about a specific Actor. - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param actorId Actor ID or a tilde-separated owner's username and Actor name. - @return ApiActGetRequest -*/ -func (a *ActorsAPIService) ActGet(ctx context.Context, actorId string) ApiActGetRequest { - return ApiActGetRequest{ - ApiService: a, - ctx: ctx, - actorId: actorId, - } -} - -// Execute executes the request -// @return ActorResponse -func (a *ActorsAPIService) ActGetExecute(r ApiActGetRequest) (*ActorResponse, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *ActorResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ActorsAPIService.ActGet") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/actors/{actorId}" - localVarPath = strings.Replace(localVarPath, "{"+"actorId"+"}", url.PathEscape(parameterValueToString(r.actorId, "actorId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiActPutRequest struct { - ctx context.Context - ApiService *ActorsAPIService - actorId string - updateActorRequest *UpdateActorRequest -} - -// -func (r ApiActPutRequest) UpdateActorRequest(updateActorRequest UpdateActorRequest) ApiActPutRequest { - r.updateActorRequest = &updateActorRequest - return r -} - -func (r ApiActPutRequest) Execute() (*ActorResponse, *http.Response, error) { - return r.ApiService.ActPutExecute(r) -} - -/* -ActPut Update Actor - -Updates settings of an Actor using values specified by an Actor object -passed as JSON in the POST payload. -If the object does not define a specific property, its value will not be -updated. - -The response is the full Actor object as returned by the -[Get Actor](#/reference/actors/actor-object/get-actor) endpoint. - -The request needs to specify the `Content-Type: application/json` HTTP header! - -When providing your API authentication token, we recommend using the -request's `Authorization` header, rather than the URL. ([More -info](#/introduction/authentication)). - -If you want to make your Actor -[public](https://docs.apify.com/platform/actors/publishing) using `isPublic: -true`, you will need to provide the Actor's `title` and the `categories` -under which that Actor will be classified in Apify Store. For this, it's -best to use the [constants from our `apify-shared-js` -package](https://github.com/apify/apify-shared-js/blob/2d43ebc41ece9ad31cd6525bd523fb86939bf860/packages/consts/src/consts.ts#L452-L471). - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param actorId Actor ID or a tilde-separated owner's username and Actor name. - @return ApiActPutRequest -*/ -func (a *ActorsAPIService) ActPut(ctx context.Context, actorId string) ApiActPutRequest { - return ApiActPutRequest{ - ApiService: a, - ctx: ctx, - actorId: actorId, - } -} - -// Execute executes the request -// @return ActorResponse -func (a *ActorsAPIService) ActPutExecute(r ApiActPutRequest) (*ActorResponse, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodPut - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *ActorResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ActorsAPIService.ActPut") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/actors/{actorId}" - localVarPath = strings.Replace(localVarPath, "{"+"actorId"+"}", url.PathEscape(parameterValueToString(r.actorId, "actorId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - if r.updateActorRequest == nil { - return localVarReturnValue, nil, reportError("updateActorRequest is required and must be specified") - } - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/json"} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - // body params - localVarPostBody = r.updateActorRequest - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 413 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 415 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiActValidateInputPostRequest struct { - ctx context.Context - ApiService *ActorsAPIService - actorId string - body *map[string]interface{} - build *string -} - -// JSON input to validate against the Actor's input schema. -func (r ApiActValidateInputPostRequest) Body(body map[string]interface{}) ApiActValidateInputPostRequest { - r.body = &body - return r -} - -// Optional tag or number of the Actor build to use for input schema validation. By default, the `latest` build tag is used. -func (r ApiActValidateInputPostRequest) Build(build string) ApiActValidateInputPostRequest { - r.build = &build - return r -} - -func (r ApiActValidateInputPostRequest) Execute() (*ActValidateInputPost200Response, *http.Response, error) { - return r.ApiService.ActValidateInputPostExecute(r) -} - -/* -ActValidateInputPost Validate Actor input - -Validates the provided input against the Actor's input schema for the specified build. - -The endpoint checks whether the JSON payload conforms to the input schema -defined in the Actor's build. If no `build` query parameter is provided, -the `latest` build tag is used by default. - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param actorId Actor ID or a tilde-separated owner's username and Actor name. - @return ApiActValidateInputPostRequest -*/ -func (a *ActorsAPIService) ActValidateInputPost(ctx context.Context, actorId string) ApiActValidateInputPostRequest { - return ApiActValidateInputPostRequest{ - ApiService: a, - ctx: ctx, - actorId: actorId, - } -} - -// Execute executes the request -// @return ActValidateInputPost200Response -func (a *ActorsAPIService) ActValidateInputPostExecute(r ApiActValidateInputPostRequest) (*ActValidateInputPost200Response, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodPost - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *ActValidateInputPost200Response - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ActorsAPIService.ActValidateInputPost") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/actors/{actorId}/validate-input" - localVarPath = strings.Replace(localVarPath, "{"+"actorId"+"}", url.PathEscape(parameterValueToString(r.actorId, "actorId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - if r.body == nil { - return localVarReturnValue, nil, reportError("body is required and must be specified") - } - - if r.build != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "build", r.build, "form", "") - } - // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/json"} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - // body params - localVarPostBody = r.body - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 413 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 415 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiActsGetRequest struct { - ctx context.Context - ApiService *ActorsAPIService - my *bool - offset *float64 - limit *float64 - desc *bool - sortBy *string -} - -// If `true` or `1` then the returned list only contains Actors owned by the user. The default value is `false`. -func (r ApiActsGetRequest) My(my bool) ApiActsGetRequest { - r.my = &my - return r -} - -// Number of items that should be skipped at the start. The default value is `0`. -func (r ApiActsGetRequest) Offset(offset float64) ApiActsGetRequest { - r.offset = &offset - return r -} - -// Maximum number of items to return. The default value as well as the maximum is `1000`. -func (r ApiActsGetRequest) Limit(limit float64) ApiActsGetRequest { - r.limit = &limit - return r -} - -// If `true` or `1` then the objects are sorted by the `createdAt` field in descending order. By default, they are sorted in ascending order. -func (r ApiActsGetRequest) Desc(desc bool) ApiActsGetRequest { - r.desc = &desc - return r -} - -// Field to sort the records by. The default is `createdAt`. You can also use `stats.lastRunStartedAt` to sort by the most recently ran Actors. -func (r ApiActsGetRequest) SortBy(sortBy string) ApiActsGetRequest { - r.sortBy = &sortBy - return r -} - -func (r ApiActsGetRequest) Execute() (*ListOfActorsResponse, *http.Response, error) { - return r.ApiService.ActsGetExecute(r) -} - -/* -ActsGet Get list of Actors - -Gets the list of all Actors that the user created or used. The response is a -list of objects, where each object contains a basic information about a single Actor. - -To only get Actors created by the user, add the `my=1` query parameter. - -The endpoint supports pagination using the `limit` and `offset` parameters -and it will not return more than 1000 records. - -By default, the records are sorted by the `createdAt` field in ascending -order, therefore you can use pagination to incrementally fetch all Actors while new -ones are still being created. To sort the records in descending order, use the `desc=1` parameter. - -You can also sort by your last run by using the `sortBy=stats.lastRunStartedAt` query parameter. -In this case, descending order means the most recently run Actor appears first. - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return ApiActsGetRequest -*/ -func (a *ActorsAPIService) ActsGet(ctx context.Context) ApiActsGetRequest { - return ApiActsGetRequest{ - ApiService: a, - ctx: ctx, - } -} - -// Execute executes the request -// @return ListOfActorsResponse -func (a *ActorsAPIService) ActsGetExecute(r ApiActsGetRequest) (*ListOfActorsResponse, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *ListOfActorsResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ActorsAPIService.ActsGet") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/actors" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if r.my != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "my", r.my, "form", "") - } - if r.offset != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "form", "") - } - if r.limit != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "form", "") - } - if r.desc != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "desc", r.desc, "form", "") - } - if r.sortBy != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "sortBy", r.sortBy, "form", "") - } - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiActsPostRequest struct { - ctx context.Context - ApiService *ActorsAPIService - createActorRequest *CreateActorRequest -} - -// -func (r ApiActsPostRequest) CreateActorRequest(createActorRequest CreateActorRequest) ApiActsPostRequest { - r.createActorRequest = &createActorRequest - return r -} - -func (r ApiActsPostRequest) Execute() (*ActorResponse, *http.Response, error) { - return r.ApiService.ActsPostExecute(r) -} - -/* -ActsPost Create Actor - -Creates a new Actor with settings specified in an Actor object passed as -JSON in the POST payload. -The response is the full Actor object as returned by the -[Get Actor](#/reference/actors/actor-object/get-actor) endpoint. - -The HTTP request must have the `Content-Type: application/json` HTTP header! - -The Actor needs to define at least one version of the source code. -For more information, see [Version object](#/reference/actors/version-object). - -If you want to make your Actor -[public](https://docs.apify.com/platform/actors/publishing) using `isPublic: -true`, you will need to provide the Actor's `title` and the `categories` -under which that Actor will be classified in Apify Store. For this, it's -best to use the [constants from our `apify-shared-js` -package](https://github.com/apify/apify-shared-js/blob/2d43ebc41ece9ad31cd6525bd523fb86939bf860/packages/consts/src/consts.ts#L452-L471). - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return ApiActsPostRequest -*/ -func (a *ActorsAPIService) ActsPost(ctx context.Context) ApiActsPostRequest { - return ApiActsPostRequest{ - ApiService: a, - ctx: ctx, - } -} - -// Execute executes the request -// @return ActorResponse -func (a *ActorsAPIService) ActsPostExecute(r ApiActsPostRequest) (*ActorResponse, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodPost - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *ActorResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ActorsAPIService.ActsPost") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/actors" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - if r.createActorRequest == nil { - return localVarReturnValue, nil, reportError("createActorRequest is required and must be specified") - } - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/json"} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - // body params - localVarPostBody = r.createActorRequest - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 413 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 415 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} diff --git a/api_actors_actor_builds.go b/api_actors_actor_builds.go deleted file mode 100644 index 722f4e4..0000000 --- a/api_actors_actor_builds.go +++ /dev/null @@ -1,1199 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "bytes" - "context" - "io" - "net/http" - "net/url" - "strings" -) - - -// ActorsActorBuildsAPIService ActorsActorBuildsAPI service -type ActorsActorBuildsAPIService service - -type ApiActBuildAbortPostRequest struct { - ctx context.Context - ApiService *ActorsActorBuildsAPIService - actorId string - buildId string -} - -func (r ApiActBuildAbortPostRequest) Execute() (*BuildResponse, *http.Response, error) { - return r.ApiService.ActBuildAbortPostExecute(r) -} - -/* -ActBuildAbortPost Abort build - -**[DEPRECATED]** API endpoints related to build of the Actor were moved -under new namespace [`actor-builds`](#/reference/actor-builds). Aborts an -Actor build and returns an object that contains all the details about the -build. - -Only builds that are starting or running are aborted. For builds with status -`FINISHED`, `FAILED`, `ABORTING` and `TIMED-OUT` this call does nothing. - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param actorId Actor ID or a tilde-separated owner's username and Actor name. - @param buildId ID of the build, found in the build's Info tab. - @return ApiActBuildAbortPostRequest - -Deprecated -*/ -func (a *ActorsActorBuildsAPIService) ActBuildAbortPost(ctx context.Context, actorId string, buildId string) ApiActBuildAbortPostRequest { - return ApiActBuildAbortPostRequest{ - ApiService: a, - ctx: ctx, - actorId: actorId, - buildId: buildId, - } -} - -// Execute executes the request -// @return BuildResponse -// Deprecated -func (a *ActorsActorBuildsAPIService) ActBuildAbortPostExecute(r ApiActBuildAbortPostRequest) (*BuildResponse, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodPost - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *BuildResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ActorsActorBuildsAPIService.ActBuildAbortPost") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/actors/{actorId}/builds/{buildId}/abort" - localVarPath = strings.Replace(localVarPath, "{"+"actorId"+"}", url.PathEscape(parameterValueToString(r.actorId, "actorId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"buildId"+"}", url.PathEscape(parameterValueToString(r.buildId, "buildId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiActBuildDefaultGetRequest struct { - ctx context.Context - ApiService *ActorsActorBuildsAPIService - actorId string - waitForFinish *float64 -} - -// The maximum number of seconds the server waits for the build to finish. By default it is `0`, the maximum value is `60`. <!-- MAX_ACTOR_JOB_ASYNC_WAIT_SECS --> If the build finishes in time then the returned build object will have a terminal status (e.g. `SUCCEEDED`), otherwise it will have a transitional status (e.g. `RUNNING`). -func (r ApiActBuildDefaultGetRequest) WaitForFinish(waitForFinish float64) ApiActBuildDefaultGetRequest { - r.waitForFinish = &waitForFinish - return r -} - -func (r ApiActBuildDefaultGetRequest) Execute() (*BuildResponse, *http.Response, error) { - return r.ApiService.ActBuildDefaultGetExecute(r) -} - -/* -ActBuildDefaultGet Get default build - -Get the default build for an Actor. - -Use the optional `waitForFinish` parameter to synchronously wait for the build to finish. -This avoids the need for periodic polling when waiting for the build to complete. - -This endpoint does not require an authentication token. Instead, calls are authenticated using the Actor's unique ID. -However, if you access the endpoint without a token, certain attributes (e.g., `usageUsd` and `usageTotalUsd`) will be hidden. - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param actorId Actor ID or a tilde-separated owner's username and Actor name. - @return ApiActBuildDefaultGetRequest -*/ -func (a *ActorsActorBuildsAPIService) ActBuildDefaultGet(ctx context.Context, actorId string) ApiActBuildDefaultGetRequest { - return ApiActBuildDefaultGetRequest{ - ApiService: a, - ctx: ctx, - actorId: actorId, - } -} - -// Execute executes the request -// @return BuildResponse -func (a *ActorsActorBuildsAPIService) ActBuildDefaultGetExecute(r ApiActBuildDefaultGetRequest) (*BuildResponse, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *BuildResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ActorsActorBuildsAPIService.ActBuildDefaultGet") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/actors/{actorId}/builds/default" - localVarPath = strings.Replace(localVarPath, "{"+"actorId"+"}", url.PathEscape(parameterValueToString(r.actorId, "actorId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if r.waitForFinish != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "waitForFinish", r.waitForFinish, "form", "") - } - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiActBuildGetRequest struct { - ctx context.Context - ApiService *ActorsActorBuildsAPIService - actorId string - buildId string - waitForFinish *float64 -} - -// The maximum number of seconds the server waits for the build to finish. By default it is `0`, the maximum value is `60`. <!-- MAX_ACTOR_JOB_ASYNC_WAIT_SECS --> If the build finishes in time then the returned build object will have a terminal status (e.g. `SUCCEEDED`), otherwise it will have a transitional status (e.g. `RUNNING`). -func (r ApiActBuildGetRequest) WaitForFinish(waitForFinish float64) ApiActBuildGetRequest { - r.waitForFinish = &waitForFinish - return r -} - -func (r ApiActBuildGetRequest) Execute() (*BuildResponse, *http.Response, error) { - return r.ApiService.ActBuildGetExecute(r) -} - -/* -ActBuildGet Get build - -By passing the optional `waitForFinish` parameter the API endpoint will -synchronously wait for the build to finish. -This is useful to avoid periodic polling when waiting for an Actor build to -finish. - -This endpoint does not require the authentication token. Instead, calls are authenticated using a hard-to-guess ID of the build. However, -if you access the endpoint without the token, certain attributes, such as `usageUsd` and `usageTotalUsd`, will be hidden. - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param actorId Actor ID or a tilde-separated owner's username and Actor name. - @param buildId ID of the build, found in the build's Info tab. - @return ApiActBuildGetRequest - -Deprecated -*/ -func (a *ActorsActorBuildsAPIService) ActBuildGet(ctx context.Context, actorId string, buildId string) ApiActBuildGetRequest { - return ApiActBuildGetRequest{ - ApiService: a, - ctx: ctx, - actorId: actorId, - buildId: buildId, - } -} - -// Execute executes the request -// @return BuildResponse -// Deprecated -func (a *ActorsActorBuildsAPIService) ActBuildGetExecute(r ApiActBuildGetRequest) (*BuildResponse, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *BuildResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ActorsActorBuildsAPIService.ActBuildGet") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/actors/{actorId}/builds/{buildId}" - localVarPath = strings.Replace(localVarPath, "{"+"actorId"+"}", url.PathEscape(parameterValueToString(r.actorId, "actorId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"buildId"+"}", url.PathEscape(parameterValueToString(r.buildId, "buildId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if r.waitForFinish != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "waitForFinish", r.waitForFinish, "form", "") - } - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiActBuildsGetRequest struct { - ctx context.Context - ApiService *ActorsActorBuildsAPIService - actorId string - offset *float64 - limit *float64 - desc *bool -} - -// Number of items that should be skipped at the start. The default value is `0`. -func (r ApiActBuildsGetRequest) Offset(offset float64) ApiActBuildsGetRequest { - r.offset = &offset - return r -} - -// Maximum number of items to return. The default value as well as the maximum is `1000`. -func (r ApiActBuildsGetRequest) Limit(limit float64) ApiActBuildsGetRequest { - r.limit = &limit - return r -} - -// If `true` or `1` then the objects are sorted by the `startedAt` field in descending order. By default, they are sorted in ascending order. -func (r ApiActBuildsGetRequest) Desc(desc bool) ApiActBuildsGetRequest { - r.desc = &desc - return r -} - -func (r ApiActBuildsGetRequest) Execute() (*ListOfBuildsResponse, *http.Response, error) { - return r.ApiService.ActBuildsGetExecute(r) -} - -/* -ActBuildsGet Get list of builds - -Gets the list of builds of a specific Actor. The response is a JSON with the -list of objects, where each object contains basic information about a single build. - -The endpoint supports pagination using the `limit` and `offset` parameters -and it will not return more than 1000 records. - -By default, the records are sorted by the `startedAt` field in ascending order, -therefore you can use pagination to incrementally fetch all builds while new -ones are still being started. To sort the records in descending order, use -the `desc=1` parameter. - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param actorId Actor ID or a tilde-separated owner's username and Actor name. - @return ApiActBuildsGetRequest -*/ -func (a *ActorsActorBuildsAPIService) ActBuildsGet(ctx context.Context, actorId string) ApiActBuildsGetRequest { - return ApiActBuildsGetRequest{ - ApiService: a, - ctx: ctx, - actorId: actorId, - } -} - -// Execute executes the request -// @return ListOfBuildsResponse -func (a *ActorsActorBuildsAPIService) ActBuildsGetExecute(r ApiActBuildsGetRequest) (*ListOfBuildsResponse, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *ListOfBuildsResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ActorsActorBuildsAPIService.ActBuildsGet") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/actors/{actorId}/builds" - localVarPath = strings.Replace(localVarPath, "{"+"actorId"+"}", url.PathEscape(parameterValueToString(r.actorId, "actorId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if r.offset != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "form", "") - } - if r.limit != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "form", "") - } - if r.desc != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "desc", r.desc, "form", "") - } - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiActBuildsPostRequest struct { - ctx context.Context - ApiService *ActorsActorBuildsAPIService - actorId string - version *string - useCache *bool - betaPackages *bool - tag *string - waitForFinish *float64 -} - -// Actor version number to be built. -func (r ApiActBuildsPostRequest) Version(version string) ApiActBuildsPostRequest { - r.version = &version - return r -} - -// If `true` or `1`, the system will use a cache to speed up the build process. By default, cache is not used. -func (r ApiActBuildsPostRequest) UseCache(useCache bool) ApiActBuildsPostRequest { - r.useCache = &useCache - return r -} - -// If `true` or `1` then the Actor is built with beta versions of Apify NPM packages. By default, the build uses `latest` packages. -func (r ApiActBuildsPostRequest) BetaPackages(betaPackages bool) ApiActBuildsPostRequest { - r.betaPackages = &betaPackages - return r -} - -// Tag to be applied to the build on success. By default, the tag is taken from Actor version's `buildTag` property. -func (r ApiActBuildsPostRequest) Tag(tag string) ApiActBuildsPostRequest { - r.tag = &tag - return r -} - -// The maximum number of seconds the server waits for the build to finish. By default it is `0`, the maximum value is `60`. <!-- MAX_ACTOR_JOB_ASYNC_WAIT_SECS --> If the build finishes in time then the returned build object will have a terminal status (e.g. `SUCCEEDED`), otherwise it will have a transitional status (e.g. `RUNNING`). -func (r ApiActBuildsPostRequest) WaitForFinish(waitForFinish float64) ApiActBuildsPostRequest { - r.waitForFinish = &waitForFinish - return r -} - -func (r ApiActBuildsPostRequest) Execute() (*BuildResponse, *http.Response, error) { - return r.ApiService.ActBuildsPostExecute(r) -} - -/* -ActBuildsPost Build Actor - -Builds an Actor. -The response is the build object as returned by the -[Get build](#/reference/actors/build-object/get-build) endpoint. - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param actorId Actor ID or a tilde-separated owner's username and Actor name. - @return ApiActBuildsPostRequest -*/ -func (a *ActorsActorBuildsAPIService) ActBuildsPost(ctx context.Context, actorId string) ApiActBuildsPostRequest { - return ApiActBuildsPostRequest{ - ApiService: a, - ctx: ctx, - actorId: actorId, - } -} - -// Execute executes the request -// @return BuildResponse -func (a *ActorsActorBuildsAPIService) ActBuildsPostExecute(r ApiActBuildsPostRequest) (*BuildResponse, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodPost - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *BuildResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ActorsActorBuildsAPIService.ActBuildsPost") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/actors/{actorId}/builds" - localVarPath = strings.Replace(localVarPath, "{"+"actorId"+"}", url.PathEscape(parameterValueToString(r.actorId, "actorId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - if r.version == nil { - return localVarReturnValue, nil, reportError("version is required and must be specified") - } - - parameterAddToHeaderOrQuery(localVarQueryParams, "version", r.version, "form", "") - if r.useCache != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "useCache", r.useCache, "form", "") - } - if r.betaPackages != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "betaPackages", r.betaPackages, "form", "") - } - if r.tag != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "tag", r.tag, "form", "") - } - if r.waitForFinish != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "waitForFinish", r.waitForFinish, "form", "") - } - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiActOpenapiJsonGetRequest struct { - ctx context.Context - ApiService *ActorsActorBuildsAPIService - actorId string - buildId string -} - -func (r ApiActOpenapiJsonGetRequest) Execute() (map[string]interface{}, *http.Response, error) { - return r.ApiService.ActOpenapiJsonGetExecute(r) -} - -/* -ActOpenapiJsonGet Get OpenAPI definition - -Get the OpenAPI definition for Actor builds. Two similar endpoints are available: - -- [First endpoint](/api/v2/act-openapi-json-get): Requires both `actorId` and `buildId`. Use `default` as the `buildId` to get the OpenAPI schema for the default Actor build. - -- [Second endpoint](/api/v2/actor-build-openapi-json-get): Requires only `buildId`. - -Get the OpenAPI definition for a specific Actor build. - -To fetch the default Actor build, simply pass `default` as the `buildId`. -Authentication is based on the build's unique ID. No authentication token is required. - -:::note - -You can also use the [`/api/v2/actor-build-openapi-json-get`](/api/v2/actor-build-openapi-json-get) endpoint to get the OpenAPI definition for a build. - -::: - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param actorId Actor ID or a tilde-separated owner's username and Actor name. - @param buildId ID of the build, found in the build's Info tab. Use the special value `default` to get the OpenAPI schema for the Actor's default build. - @return ApiActOpenapiJsonGetRequest -*/ -func (a *ActorsActorBuildsAPIService) ActOpenapiJsonGet(ctx context.Context, actorId string, buildId string) ApiActOpenapiJsonGetRequest { - return ApiActOpenapiJsonGetRequest{ - ApiService: a, - ctx: ctx, - actorId: actorId, - buildId: buildId, - } -} - -// Execute executes the request -// @return map[string]interface{} -func (a *ActorsActorBuildsAPIService) ActOpenapiJsonGetExecute(r ApiActOpenapiJsonGetRequest) (map[string]interface{}, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue map[string]interface{} - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ActorsActorBuildsAPIService.ActOpenapiJsonGet") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/actors/{actorId}/builds/{buildId}/openapi.json" - localVarPath = strings.Replace(localVarPath, "{"+"actorId"+"}", url.PathEscape(parameterValueToString(r.actorId, "actorId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"buildId"+"}", url.PathEscape(parameterValueToString(r.buildId, "buildId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} diff --git a/api_actors_actor_runs.go b/api_actors_actor_runs.go deleted file mode 100644 index 1f148ef..0000000 --- a/api_actors_actor_runs.go +++ /dev/null @@ -1,3255 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "bytes" - "context" - "io" - "net/http" - "net/url" - "strings" - "time" -) - - -// ActorsActorRunsAPIService ActorsActorRunsAPI service -type ActorsActorRunsAPIService service - -type ApiActRunAbortPostRequest struct { - ctx context.Context - ApiService *ActorsActorRunsAPIService - actorId string - runId string - gracefully *bool -} - -// If true passed, the Actor run will abort gracefully. It will send `aborting` and `persistState` event into run and force-stop the run after 30 seconds. It is helpful in cases where you plan to resurrect the run later. -func (r ApiActRunAbortPostRequest) Gracefully(gracefully bool) ApiActRunAbortPostRequest { - r.gracefully = &gracefully - return r -} - -func (r ApiActRunAbortPostRequest) Execute() (*RunResponse, *http.Response, error) { - return r.ApiService.ActRunAbortPostExecute(r) -} - -/* -ActRunAbortPost Abort run - -**[DEPRECATED]** API endpoints related to run of the Actor were moved under -new namespace [`actor-runs`](#/reference/actor-runs). Aborts an Actor run and -returns an object that contains all the details about the run. - -Only runs that are starting or running are aborted. For runs with status -`FINISHED`, `FAILED`, `ABORTING` and `TIMED-OUT` this call does nothing. - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param actorId Actor ID or a tilde-separated owner's username and Actor name. - @param runId Actor run ID. - @return ApiActRunAbortPostRequest - -Deprecated -*/ -func (a *ActorsActorRunsAPIService) ActRunAbortPost(ctx context.Context, actorId string, runId string) ApiActRunAbortPostRequest { - return ApiActRunAbortPostRequest{ - ApiService: a, - ctx: ctx, - actorId: actorId, - runId: runId, - } -} - -// Execute executes the request -// @return RunResponse -// Deprecated -func (a *ActorsActorRunsAPIService) ActRunAbortPostExecute(r ApiActRunAbortPostRequest) (*RunResponse, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodPost - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *RunResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ActorsActorRunsAPIService.ActRunAbortPost") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/actors/{actorId}/runs/{runId}/abort" - localVarPath = strings.Replace(localVarPath, "{"+"actorId"+"}", url.PathEscape(parameterValueToString(r.actorId, "actorId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"runId"+"}", url.PathEscape(parameterValueToString(r.runId, "runId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if r.gracefully != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "gracefully", r.gracefully, "form", "") - } - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiActRunGetRequest struct { - ctx context.Context - ApiService *ActorsActorRunsAPIService - actorId string - runId string - waitForFinish *float64 -} - -// The maximum number of seconds the server waits for the run to finish. By default it is `0`, the maximum value is `60`. <!-- MAX_ACTOR_JOB_ASYNC_WAIT_SECS --> If the run finishes in time then the returned run object will have a terminal status (e.g. `SUCCEEDED`), otherwise it will have a transitional status (e.g. `RUNNING`). -func (r ApiActRunGetRequest) WaitForFinish(waitForFinish float64) ApiActRunGetRequest { - r.waitForFinish = &waitForFinish - return r -} - -func (r ApiActRunGetRequest) Execute() (*RunResponse, *http.Response, error) { - return r.ApiService.ActRunGetExecute(r) -} - -/* -ActRunGet Get run - -**[DEPRECATED]** API endpoints related to run of the Actor were moved under -new namespace [`actor-runs`](#/reference/actor-runs). - -Gets an object that contains all the details about a specific run of an Actor. - -By passing the optional `waitForFinish` parameter the API endpoint will -synchronously wait for the run to finish. -This is useful to avoid periodic polling when waiting for Actor run to -complete. - -This endpoint does not require the authentication token. Instead, calls are authenticated using a hard-to-guess ID of the run. However, -if you access the endpoint without the token, certain attributes, such as `usageUsd` and `usageTotalUsd`, will be hidden. - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param actorId Actor ID or a tilde-separated owner's username and Actor name. - @param runId Actor run ID. - @return ApiActRunGetRequest - -Deprecated -*/ -func (a *ActorsActorRunsAPIService) ActRunGet(ctx context.Context, actorId string, runId string) ApiActRunGetRequest { - return ApiActRunGetRequest{ - ApiService: a, - ctx: ctx, - actorId: actorId, - runId: runId, - } -} - -// Execute executes the request -// @return RunResponse -// Deprecated -func (a *ActorsActorRunsAPIService) ActRunGetExecute(r ApiActRunGetRequest) (*RunResponse, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *RunResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ActorsActorRunsAPIService.ActRunGet") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/actors/{actorId}/runs/{runId}" - localVarPath = strings.Replace(localVarPath, "{"+"actorId"+"}", url.PathEscape(parameterValueToString(r.actorId, "actorId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"runId"+"}", url.PathEscape(parameterValueToString(r.runId, "runId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if r.waitForFinish != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "waitForFinish", r.waitForFinish, "form", "") - } - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiActRunMetamorphPostRequest struct { - ctx context.Context - ApiService *ActorsActorRunsAPIService - actorId string - runId string - targetActorId *string - build *string -} - -// ID of a target Actor that the run should be transformed into. -func (r ApiActRunMetamorphPostRequest) TargetActorId(targetActorId string) ApiActRunMetamorphPostRequest { - r.targetActorId = &targetActorId - return r -} - -// Optional build of the target Actor. It can be either a build tag or build number. By default, the run uses the build specified in the default run configuration for the target Actor (typically `latest`). -func (r ApiActRunMetamorphPostRequest) Build(build string) ApiActRunMetamorphPostRequest { - r.build = &build - return r -} - -func (r ApiActRunMetamorphPostRequest) Execute() (*RunResponse, *http.Response, error) { - return r.ApiService.ActRunMetamorphPostExecute(r) -} - -/* -ActRunMetamorphPost Metamorph run - -**[DEPRECATED]** API endpoints related to run of the Actor were moved under -new namespace [`actor-runs`](#/reference/actor-runs). Transforms an Actor run -into a run of another Actor with a new input. - -This is useful if you want to use another Actor to finish the work -of your current Actor run, without the need to create a completely new run -and waiting for its finish. -For the users of your Actors, the metamorph operation is transparent, they -will just see your Actor got the work done. - -There is a limit on how many times you can metamorph a single run. You can -check the limit in [the Actor runtime limits](https://docs.apify.com/platform/limits#actor-limits). - -Internally, the system stops the Docker container corresponding to the Actor -run and starts a new container using a different Docker image. -All the default storages are preserved and the new input is stored under the -`INPUT-METAMORPH-1` key in the same default key-value store. - -For more information, see the [Actor docs](https://docs.apify.com/platform/actors/development/programming-interface/metamorph). - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param actorId Actor ID or a tilde-separated owner's username and Actor name. - @param runId Actor run ID. - @return ApiActRunMetamorphPostRequest - -Deprecated -*/ -func (a *ActorsActorRunsAPIService) ActRunMetamorphPost(ctx context.Context, actorId string, runId string) ApiActRunMetamorphPostRequest { - return ApiActRunMetamorphPostRequest{ - ApiService: a, - ctx: ctx, - actorId: actorId, - runId: runId, - } -} - -// Execute executes the request -// @return RunResponse -// Deprecated -func (a *ActorsActorRunsAPIService) ActRunMetamorphPostExecute(r ApiActRunMetamorphPostRequest) (*RunResponse, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodPost - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *RunResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ActorsActorRunsAPIService.ActRunMetamorphPost") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/actors/{actorId}/runs/{runId}/metamorph" - localVarPath = strings.Replace(localVarPath, "{"+"actorId"+"}", url.PathEscape(parameterValueToString(r.actorId, "actorId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"runId"+"}", url.PathEscape(parameterValueToString(r.runId, "runId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - if r.targetActorId == nil { - return localVarReturnValue, nil, reportError("targetActorId is required and must be specified") - } - - parameterAddToHeaderOrQuery(localVarQueryParams, "targetActorId", r.targetActorId, "form", "") - if r.build != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "build", r.build, "form", "") - } - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiActRunResurrectPostRequest struct { - ctx context.Context - ApiService *ActorsActorRunsAPIService - actorId string - runId string - build *string - timeout *float64 - memory *float64 - restartOnError *bool -} - -// Specifies the Actor build to run. It can be either a build tag or build number. By default, the run is resurrected with the same build it originally used. Specifically, if a run was first started with the `latest` tag, which resolves to version `0.0.3` at the time, a run resurrected without this parameter will continue running with `0.0.3`, even if `latest` already points to a newer build. -func (r ApiActRunResurrectPostRequest) Build(build string) ApiActRunResurrectPostRequest { - r.build = &build - return r -} - -// Optional timeout for the run, in seconds. By default, the run uses the timeout specified in the run that is being resurrected. -func (r ApiActRunResurrectPostRequest) Timeout(timeout float64) ApiActRunResurrectPostRequest { - r.timeout = &timeout - return r -} - -// Memory limit for the run, in megabytes. The amount of memory can be set to a power of 2 with a minimum of 128. By default, the run uses the memory limit specified in the run that is being resurrected. -func (r ApiActRunResurrectPostRequest) Memory(memory float64) ApiActRunResurrectPostRequest { - r.memory = &memory - return r -} - -// Determines whether the resurrected run will be restarted if it fails. By default, the resurrected run uses the same setting as before. -func (r ApiActRunResurrectPostRequest) RestartOnError(restartOnError bool) ApiActRunResurrectPostRequest { - r.restartOnError = &restartOnError - return r -} - -func (r ApiActRunResurrectPostRequest) Execute() (*RunResponse, *http.Response, error) { - return r.ApiService.ActRunResurrectPostExecute(r) -} - -/* -ActRunResurrectPost Resurrect run - -**[DEPRECATED]** API endpoints related to run of the Actor were moved under -new namespace [`actor-runs`](#/reference/actor-runs).Resurrects a finished -Actor run and returns an object that contains all the details about the -resurrected run. - -Only finished runs, i.e. runs with status `FINISHED`, `FAILED`, `ABORTED` -and `TIMED-OUT` can be resurrected. -Run status will be updated to RUNNING and its container will be restarted -with the same storages -(the same behaviour as when the run gets migrated to the new server). - -For more information, see the [Actor -docs](https://docs.apify.com/platform/actors/running/runs-and-builds#resurrection-of-finished-run). - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param actorId Actor ID or a tilde-separated owner's username and Actor name. - @param runId Actor run ID. - @return ApiActRunResurrectPostRequest -*/ -func (a *ActorsActorRunsAPIService) ActRunResurrectPost(ctx context.Context, actorId string, runId string) ApiActRunResurrectPostRequest { - return ApiActRunResurrectPostRequest{ - ApiService: a, - ctx: ctx, - actorId: actorId, - runId: runId, - } -} - -// Execute executes the request -// @return RunResponse -func (a *ActorsActorRunsAPIService) ActRunResurrectPostExecute(r ApiActRunResurrectPostRequest) (*RunResponse, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodPost - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *RunResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ActorsActorRunsAPIService.ActRunResurrectPost") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/actors/{actorId}/runs/{runId}/resurrect" - localVarPath = strings.Replace(localVarPath, "{"+"actorId"+"}", url.PathEscape(parameterValueToString(r.actorId, "actorId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"runId"+"}", url.PathEscape(parameterValueToString(r.runId, "runId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if r.build != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "build", r.build, "form", "") - } - if r.timeout != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "timeout", r.timeout, "form", "") - } - if r.memory != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "memory", r.memory, "form", "") - } - if r.restartOnError != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "restartOnError", r.restartOnError, "form", "") - } - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiActRunSyncGetRequest struct { - ctx context.Context - ApiService *ActorsActorRunsAPIService - actorId string - outputRecordKey *string - timeout *float64 - memory *float64 - maxItems *float64 - maxTotalChargeUsd *float64 - restartOnError *bool - build *string - webhooks *string -} - -// Key of the record from run's default key-value store to be returned in the response. By default, it is `OUTPUT`. -func (r ApiActRunSyncGetRequest) OutputRecordKey(outputRecordKey string) ApiActRunSyncGetRequest { - r.outputRecordKey = &outputRecordKey - return r -} - -// Optional timeout for the run, in seconds. By default, the run uses the timeout from its configuration. -func (r ApiActRunSyncGetRequest) Timeout(timeout float64) ApiActRunSyncGetRequest { - r.timeout = &timeout - return r -} - -// Memory limit for the run, in megabytes. The amount of memory can be set to a power of 2 with a minimum of 128. By default, the run uses the memory limit from its configuration. -func (r ApiActRunSyncGetRequest) Memory(memory float64) ApiActRunSyncGetRequest { - r.memory = &memory - return r -} - -// Specifies the maximum number of dataset items that will be charged for pay-per-result Actors. This does NOT guarantee that the Actor will return only this many items. It only ensures you won't be charged for more than this number of items. Only works for pay-per-result Actors. Value can be accessed in the actor run using `ACTOR_MAX_PAID_DATASET_ITEMS` environment variable. -func (r ApiActRunSyncGetRequest) MaxItems(maxItems float64) ApiActRunSyncGetRequest { - r.maxItems = &maxItems - return r -} - -// Specifies the maximum cost of the run. This parameter is useful for pay-per-event Actors, as it allows you to limit the amount charged to your subscription. You can access the maximum cost in your Actor by using the `ACTOR_MAX_TOTAL_CHARGE_USD` environment variable. -func (r ApiActRunSyncGetRequest) MaxTotalChargeUsd(maxTotalChargeUsd float64) ApiActRunSyncGetRequest { - r.maxTotalChargeUsd = &maxTotalChargeUsd - return r -} - -// Determines whether the run will be restarted if it fails. -func (r ApiActRunSyncGetRequest) RestartOnError(restartOnError bool) ApiActRunSyncGetRequest { - r.restartOnError = &restartOnError - return r -} - -// Specifies the Actor build to run. It can be either a build tag or build number. By default, the run uses the build from its configuration (typically `latest`). -func (r ApiActRunSyncGetRequest) Build(build string) ApiActRunSyncGetRequest { - r.build = &build - return r -} - -// Specifies optional webhooks associated with the Actor run, which can be used to receive a notification e.g. when the Actor finished or failed. The value is a Base64-encoded JSON array whose items follow the WebhookRepresentation schema. For more information, see [Webhooks documentation](https://docs.apify.com/platform/integrations/webhooks). -func (r ApiActRunSyncGetRequest) Webhooks(webhooks string) ApiActRunSyncGetRequest { - r.webhooks = &webhooks - return r -} - -func (r ApiActRunSyncGetRequest) Execute() (map[string]interface{}, *http.Response, error) { - return r.ApiService.ActRunSyncGetExecute(r) -} - -/* -ActRunSyncGet Run Actor synchronously without input - -Runs a specific Actor and returns its output. -The run must finish in 300<!-- MAX_ACTOR_JOB_SYNC_WAIT_SECS --> seconds -otherwise the API endpoint returns a timeout error. -The Actor is not passed any input. - -Beware that it might be impossible to maintain an idle HTTP connection for a -long period of time, -due to client timeout or network conditions. Make sure your HTTP client is -configured to have a long enough connection timeout. -If the connection breaks, you will not receive any information about the run -and its status. - -To run the Actor asynchronously, use the [Run -Actor](#/reference/actors/run-collection/run-actor) API endpoint instead. - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param actorId Actor ID or a tilde-separated owner's username and Actor name. - @return ApiActRunSyncGetRequest -*/ -func (a *ActorsActorRunsAPIService) ActRunSyncGet(ctx context.Context, actorId string) ApiActRunSyncGetRequest { - return ApiActRunSyncGetRequest{ - ApiService: a, - ctx: ctx, - actorId: actorId, - } -} - -// Execute executes the request -// @return map[string]interface{} -func (a *ActorsActorRunsAPIService) ActRunSyncGetExecute(r ApiActRunSyncGetRequest) (map[string]interface{}, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue map[string]interface{} - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ActorsActorRunsAPIService.ActRunSyncGet") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/actors/{actorId}/run-sync" - localVarPath = strings.Replace(localVarPath, "{"+"actorId"+"}", url.PathEscape(parameterValueToString(r.actorId, "actorId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if r.outputRecordKey != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "outputRecordKey", r.outputRecordKey, "form", "") - } - if r.timeout != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "timeout", r.timeout, "form", "") - } - if r.memory != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "memory", r.memory, "form", "") - } - if r.maxItems != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "maxItems", r.maxItems, "form", "") - } - if r.maxTotalChargeUsd != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "maxTotalChargeUsd", r.maxTotalChargeUsd, "form", "") - } - if r.restartOnError != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "restartOnError", r.restartOnError, "form", "") - } - if r.build != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "build", r.build, "form", "") - } - if r.webhooks != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "webhooks", r.webhooks, "form", "") - } - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ActorRunFailedError - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 408 { - var v ActorRunTimeoutExceededError - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiActRunSyncGetDatasetItemsGetRequest struct { - ctx context.Context - ApiService *ActorsActorRunsAPIService - actorId string - timeout *float64 - memory *float64 - maxItems *float64 - maxTotalChargeUsd *float64 - restartOnError *bool - build *string - webhooks *string - format *string - clean *bool - offset *float64 - limit *float64 - fields *string - outputFields *string - omit *string - unwind *string - flatten *string - desc *bool - attachment *bool - delimiter *string - bom *bool - xmlRoot *string - xmlRow *string - skipHeaderRow *bool - skipHidden *bool - skipEmpty *bool - simplified *bool - view *string - skipFailedPages *bool - feedTitle *string - feedDescription *string -} - -// Optional timeout for the run, in seconds. By default, the run uses the timeout from its configuration. -func (r ApiActRunSyncGetDatasetItemsGetRequest) Timeout(timeout float64) ApiActRunSyncGetDatasetItemsGetRequest { - r.timeout = &timeout - return r -} - -// Memory limit for the run, in megabytes. The amount of memory can be set to a power of 2 with a minimum of 128. By default, the run uses the memory limit from its configuration. -func (r ApiActRunSyncGetDatasetItemsGetRequest) Memory(memory float64) ApiActRunSyncGetDatasetItemsGetRequest { - r.memory = &memory - return r -} - -// Specifies the maximum number of dataset items that will be charged for pay-per-result Actors. This does NOT guarantee that the Actor will return only this many items. It only ensures you won't be charged for more than this number of items. Only works for pay-per-result Actors. Value can be accessed in the actor run using `ACTOR_MAX_PAID_DATASET_ITEMS` environment variable. -func (r ApiActRunSyncGetDatasetItemsGetRequest) MaxItems(maxItems float64) ApiActRunSyncGetDatasetItemsGetRequest { - r.maxItems = &maxItems - return r -} - -// Specifies the maximum cost of the run. This parameter is useful for pay-per-event Actors, as it allows you to limit the amount charged to your subscription. You can access the maximum cost in your Actor by using the `ACTOR_MAX_TOTAL_CHARGE_USD` environment variable. -func (r ApiActRunSyncGetDatasetItemsGetRequest) MaxTotalChargeUsd(maxTotalChargeUsd float64) ApiActRunSyncGetDatasetItemsGetRequest { - r.maxTotalChargeUsd = &maxTotalChargeUsd - return r -} - -// Determines whether the run will be restarted if it fails. -func (r ApiActRunSyncGetDatasetItemsGetRequest) RestartOnError(restartOnError bool) ApiActRunSyncGetDatasetItemsGetRequest { - r.restartOnError = &restartOnError - return r -} - -// Specifies the Actor build to run. It can be either a build tag or build number. By default, the run uses the build from its configuration (typically `latest`). -func (r ApiActRunSyncGetDatasetItemsGetRequest) Build(build string) ApiActRunSyncGetDatasetItemsGetRequest { - r.build = &build - return r -} - -// Specifies optional webhooks associated with the Actor run, which can be used to receive a notification e.g. when the Actor finished or failed. The value is a Base64-encoded JSON array whose items follow the WebhookRepresentation schema. For more information, see [Webhooks documentation](https://docs.apify.com/platform/integrations/webhooks). -func (r ApiActRunSyncGetDatasetItemsGetRequest) Webhooks(webhooks string) ApiActRunSyncGetDatasetItemsGetRequest { - r.webhooks = &webhooks - return r -} - -// Format of the results, possible values are: `json`, `jsonl`, `csv`, `html`, `xlsx`, `xml` and `rss`. The default value is `json`. -func (r ApiActRunSyncGetDatasetItemsGetRequest) Format(format string) ApiActRunSyncGetDatasetItemsGetRequest { - r.format = &format - return r -} - -// If `true` or `1` then the API endpoint returns only non-empty items and skips hidden fields (i.e. fields starting with the # character). The `clean` parameter is just a shortcut for `skipHidden=true` and `skipEmpty=true` parameters. Note that since some objects might be skipped from the output, that the result might contain less items than the `limit` value. -func (r ApiActRunSyncGetDatasetItemsGetRequest) Clean(clean bool) ApiActRunSyncGetDatasetItemsGetRequest { - r.clean = &clean - return r -} - -// Number of items that should be skipped at the start. The default value is `0`. -func (r ApiActRunSyncGetDatasetItemsGetRequest) Offset(offset float64) ApiActRunSyncGetDatasetItemsGetRequest { - r.offset = &offset - return r -} - -// Maximum number of items to return. By default there is no limit. -func (r ApiActRunSyncGetDatasetItemsGetRequest) Limit(limit float64) ApiActRunSyncGetDatasetItemsGetRequest { - r.limit = &limit - return r -} - -// A comma-separated list of fields which should be picked from the items, only these fields will remain in the resulting record objects. Note that the fields in the outputted items are sorted the same way as they are specified in the `fields` query parameter. You can use this feature to effectively fix the output format. -func (r ApiActRunSyncGetDatasetItemsGetRequest) Fields(fields string) ApiActRunSyncGetDatasetItemsGetRequest { - r.fields = &fields - return r -} - -// A comma-separated list of output field names that positionally rename the fields specified in the `fields` parameter. For example, `?fields=headline,url&outputFields=title,link` renames `headline` to `title` and `url` to `link` in the output. The number of names in `outputFields` must match the number of names in `fields`. Requires the `fields` parameter to be specified as well. -func (r ApiActRunSyncGetDatasetItemsGetRequest) OutputFields(outputFields string) ApiActRunSyncGetDatasetItemsGetRequest { - r.outputFields = &outputFields - return r -} - -// A comma-separated list of fields which should be omitted from the items. -func (r ApiActRunSyncGetDatasetItemsGetRequest) Omit(omit string) ApiActRunSyncGetDatasetItemsGetRequest { - r.omit = &omit - return r -} - -// A comma-separated list of fields which should be unwound, in order which they should be processed. Each field should be either an array or an object. If the field is an array then every element of the array will become a separate record and merged with parent object. If the unwound field is an object then it is merged with the parent object. If the unwound field is missing or its value is neither an array nor an object and therefore cannot be merged with a parent object then the item gets preserved as it is. Note that the unwound items ignore the `desc` parameter. -func (r ApiActRunSyncGetDatasetItemsGetRequest) Unwind(unwind string) ApiActRunSyncGetDatasetItemsGetRequest { - r.unwind = &unwind - return r -} - -// A comma-separated list of fields which should transform nested objects into flat structures. For example, with `flatten=\"foo\"` the object `{\"foo\":{\"bar\": \"hello\"}}` is turned into `{\"foo.bar\": \"hello\"}`. The original object with properties is replaced with the flattened object. -func (r ApiActRunSyncGetDatasetItemsGetRequest) Flatten(flatten string) ApiActRunSyncGetDatasetItemsGetRequest { - r.flatten = &flatten - return r -} - -// By default, results are returned in the same order as they were stored. To reverse the order, set this parameter to `true` or `1`. -func (r ApiActRunSyncGetDatasetItemsGetRequest) Desc(desc bool) ApiActRunSyncGetDatasetItemsGetRequest { - r.desc = &desc - return r -} - -// If `true` or `1` then the response will define the `Content-Disposition: attachment` header, forcing a web browser to download the file rather than to display it. By default this header is not present. -func (r ApiActRunSyncGetDatasetItemsGetRequest) Attachment(attachment bool) ApiActRunSyncGetDatasetItemsGetRequest { - r.attachment = &attachment - return r -} - -// A delimiter character for CSV files, only used if `format=csv`. You might need to URL-encode the character (e.g. use `%09` for tab or `%3B` for semicolon). The default delimiter is a simple comma (`,`). -func (r ApiActRunSyncGetDatasetItemsGetRequest) Delimiter(delimiter string) ApiActRunSyncGetDatasetItemsGetRequest { - r.delimiter = &delimiter - return r -} - -// All text responses are encoded in UTF-8 encoding. By default, the `format=csv` files are prefixed with the UTF-8 Byte Order Mark (BOM), while `json`, `jsonl`, `xml`, `html` and `rss` files are not. If you want to override this default behavior, specify `bom=1` query parameter to include the BOM or `bom=0` to skip it. -func (r ApiActRunSyncGetDatasetItemsGetRequest) Bom(bom bool) ApiActRunSyncGetDatasetItemsGetRequest { - r.bom = &bom - return r -} - -// Overrides default root element name of `xml` output. By default the root element is `items`. -func (r ApiActRunSyncGetDatasetItemsGetRequest) XmlRoot(xmlRoot string) ApiActRunSyncGetDatasetItemsGetRequest { - r.xmlRoot = &xmlRoot - return r -} - -// Overrides default element name that wraps each page or page function result object in `xml` output. By default the element name is `item`. -func (r ApiActRunSyncGetDatasetItemsGetRequest) XmlRow(xmlRow string) ApiActRunSyncGetDatasetItemsGetRequest { - r.xmlRow = &xmlRow - return r -} - -// If `true` or `1` then header row in the `csv` format is skipped. -func (r ApiActRunSyncGetDatasetItemsGetRequest) SkipHeaderRow(skipHeaderRow bool) ApiActRunSyncGetDatasetItemsGetRequest { - r.skipHeaderRow = &skipHeaderRow - return r -} - -// If `true` or `1` then hidden fields are skipped from the output, i.e. fields starting with the `#` character. -func (r ApiActRunSyncGetDatasetItemsGetRequest) SkipHidden(skipHidden bool) ApiActRunSyncGetDatasetItemsGetRequest { - r.skipHidden = &skipHidden - return r -} - -// If `true` or `1` then empty items are skipped from the output. Note that if used, the results might contain less items than the limit value. -func (r ApiActRunSyncGetDatasetItemsGetRequest) SkipEmpty(skipEmpty bool) ApiActRunSyncGetDatasetItemsGetRequest { - r.skipEmpty = &skipEmpty - return r -} - -// If `true` or `1` then, the endpoint applies the `fields=url,pageFunctionResult,errorInfo` and `unwind=pageFunctionResult` query parameters. This feature is used to emulate simplified results provided by the legacy Apify Crawler product and it's not recommended to use it in new integrations. -func (r ApiActRunSyncGetDatasetItemsGetRequest) Simplified(simplified bool) ApiActRunSyncGetDatasetItemsGetRequest { - r.simplified = &simplified - return r -} - -// Defines the view configuration for dataset items based on the schema definition. This parameter determines how the data will be filtered and presented. For complete specification details, see the [dataset schema documentation](/platform/actors/development/actor-definition/dataset-schema). -func (r ApiActRunSyncGetDatasetItemsGetRequest) View(view string) ApiActRunSyncGetDatasetItemsGetRequest { - r.view = &view - return r -} - -// If `true` or `1` then, the all the items with errorInfo property will be skipped from the output. This feature is here to emulate functionality of API version 1 used for the legacy Apify Crawler product and it's not recommended to use it in new integrations. -func (r ApiActRunSyncGetDatasetItemsGetRequest) SkipFailedPages(skipFailedPages bool) ApiActRunSyncGetDatasetItemsGetRequest { - r.skipFailedPages = &skipFailedPages - return r -} - -// Overrides the auto-generated RSS channel `<title>` element. Only used when `format=rss`. If not provided, the title defaults to `Dataset <label>`. -func (r ApiActRunSyncGetDatasetItemsGetRequest) FeedTitle(feedTitle string) ApiActRunSyncGetDatasetItemsGetRequest { - r.feedTitle = &feedTitle - return r -} - -// Overrides the auto-generated RSS channel `<description>` element. Only used when `format=rss`. If not provided, the description defaults to `Items in dataset with id \"<datasetId>\".` -func (r ApiActRunSyncGetDatasetItemsGetRequest) FeedDescription(feedDescription string) ApiActRunSyncGetDatasetItemsGetRequest { - r.feedDescription = &feedDescription - return r -} - -func (r ApiActRunSyncGetDatasetItemsGetRequest) Execute() ([]map[string]interface{}, *http.Response, error) { - return r.ApiService.ActRunSyncGetDatasetItemsGetExecute(r) -} - -/* -ActRunSyncGetDatasetItemsGet Run Actor synchronously without input and get dataset items - -Runs a specific Actor and returns its dataset items. -The run must finish in 300<!-- MAX_ACTOR_JOB_SYNC_WAIT_SECS --> seconds -otherwise the API endpoint returns a timeout error. -The Actor is not passed any input. - -It allows to send all possible options in parameters from [Get Dataset -Items](#/reference/datasets/item-collection/get-items) API endpoint. - -Beware that it might be impossible to maintain an idle HTTP connection for a -long period of time, -due to client timeout or network conditions. Make sure your HTTP client is -configured to have a long enough connection timeout. -If the connection breaks, you will not receive any information about the run -and its status. - -To run the Actor asynchronously, use the [Run -Actor](#/reference/actors/run-collection/run-actor) API endpoint instead. - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param actorId Actor ID or a tilde-separated owner's username and Actor name. - @return ApiActRunSyncGetDatasetItemsGetRequest -*/ -func (a *ActorsActorRunsAPIService) ActRunSyncGetDatasetItemsGet(ctx context.Context, actorId string) ApiActRunSyncGetDatasetItemsGetRequest { - return ApiActRunSyncGetDatasetItemsGetRequest{ - ApiService: a, - ctx: ctx, - actorId: actorId, - } -} - -// Execute executes the request -// @return []map[string]interface{} -func (a *ActorsActorRunsAPIService) ActRunSyncGetDatasetItemsGetExecute(r ApiActRunSyncGetDatasetItemsGetRequest) ([]map[string]interface{}, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue []map[string]interface{} - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ActorsActorRunsAPIService.ActRunSyncGetDatasetItemsGet") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/actors/{actorId}/run-sync-get-dataset-items" - localVarPath = strings.Replace(localVarPath, "{"+"actorId"+"}", url.PathEscape(parameterValueToString(r.actorId, "actorId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if r.timeout != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "timeout", r.timeout, "form", "") - } - if r.memory != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "memory", r.memory, "form", "") - } - if r.maxItems != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "maxItems", r.maxItems, "form", "") - } - if r.maxTotalChargeUsd != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "maxTotalChargeUsd", r.maxTotalChargeUsd, "form", "") - } - if r.restartOnError != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "restartOnError", r.restartOnError, "form", "") - } - if r.build != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "build", r.build, "form", "") - } - if r.webhooks != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "webhooks", r.webhooks, "form", "") - } - if r.format != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "format", r.format, "form", "") - } - if r.clean != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "clean", r.clean, "form", "") - } - if r.offset != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "form", "") - } - if r.limit != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "form", "") - } - if r.fields != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "fields", r.fields, "form", "") - } - if r.outputFields != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "outputFields", r.outputFields, "form", "") - } - if r.omit != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "omit", r.omit, "form", "") - } - if r.unwind != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "unwind", r.unwind, "form", "") - } - if r.flatten != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "flatten", r.flatten, "form", "") - } - if r.desc != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "desc", r.desc, "form", "") - } - if r.attachment != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "attachment", r.attachment, "form", "") - } - if r.delimiter != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "delimiter", r.delimiter, "form", "") - } - if r.bom != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "bom", r.bom, "form", "") - } - if r.xmlRoot != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "xmlRoot", r.xmlRoot, "form", "") - } - if r.xmlRow != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "xmlRow", r.xmlRow, "form", "") - } - if r.skipHeaderRow != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "skipHeaderRow", r.skipHeaderRow, "form", "") - } - if r.skipHidden != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "skipHidden", r.skipHidden, "form", "") - } - if r.skipEmpty != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "skipEmpty", r.skipEmpty, "form", "") - } - if r.simplified != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "simplified", r.simplified, "form", "") - } - if r.view != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "view", r.view, "form", "") - } - if r.skipFailedPages != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "skipFailedPages", r.skipFailedPages, "form", "") - } - if r.feedTitle != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "feedTitle", r.feedTitle, "form", "") - } - if r.feedDescription != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "feedDescription", r.feedDescription, "form", "") - } - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ActorRunFailedError - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 408 { - var v ActorRunTimeoutExceededError - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiActRunSyncGetDatasetItemsPostRequest struct { - ctx context.Context - ApiService *ActorsActorRunsAPIService - actorId string - body *map[string]interface{} - timeout *float64 - memory *float64 - maxItems *float64 - maxTotalChargeUsd *float64 - restartOnError *bool - build *string - webhooks *string - format *string - clean *bool - offset *float64 - limit *float64 - fields *string - outputFields *string - omit *string - unwind *string - flatten *string - desc *bool - attachment *bool - delimiter *string - bom *bool - xmlRoot *string - xmlRow *string - skipHeaderRow *bool - skipHidden *bool - skipEmpty *bool - simplified *bool - view *string - skipFailedPages *bool - feedTitle *string - feedDescription *string -} - -// -func (r ApiActRunSyncGetDatasetItemsPostRequest) Body(body map[string]interface{}) ApiActRunSyncGetDatasetItemsPostRequest { - r.body = &body - return r -} - -// Optional timeout for the run, in seconds. By default, the run uses the timeout from its configuration. -func (r ApiActRunSyncGetDatasetItemsPostRequest) Timeout(timeout float64) ApiActRunSyncGetDatasetItemsPostRequest { - r.timeout = &timeout - return r -} - -// Memory limit for the run, in megabytes. The amount of memory can be set to a power of 2 with a minimum of 128. By default, the run uses the memory limit from its configuration. -func (r ApiActRunSyncGetDatasetItemsPostRequest) Memory(memory float64) ApiActRunSyncGetDatasetItemsPostRequest { - r.memory = &memory - return r -} - -// Specifies the maximum number of dataset items that will be charged for pay-per-result Actors. This does NOT guarantee that the Actor will return only this many items. It only ensures you won't be charged for more than this number of items. Only works for pay-per-result Actors. Value can be accessed in the actor run using `ACTOR_MAX_PAID_DATASET_ITEMS` environment variable. -func (r ApiActRunSyncGetDatasetItemsPostRequest) MaxItems(maxItems float64) ApiActRunSyncGetDatasetItemsPostRequest { - r.maxItems = &maxItems - return r -} - -// Specifies the maximum cost of the run. This parameter is useful for pay-per-event Actors, as it allows you to limit the amount charged to your subscription. You can access the maximum cost in your Actor by using the `ACTOR_MAX_TOTAL_CHARGE_USD` environment variable. -func (r ApiActRunSyncGetDatasetItemsPostRequest) MaxTotalChargeUsd(maxTotalChargeUsd float64) ApiActRunSyncGetDatasetItemsPostRequest { - r.maxTotalChargeUsd = &maxTotalChargeUsd - return r -} - -// Determines whether the run will be restarted if it fails. -func (r ApiActRunSyncGetDatasetItemsPostRequest) RestartOnError(restartOnError bool) ApiActRunSyncGetDatasetItemsPostRequest { - r.restartOnError = &restartOnError - return r -} - -// Specifies the Actor build to run. It can be either a build tag or build number. By default, the run uses the build from its configuration (typically `latest`). -func (r ApiActRunSyncGetDatasetItemsPostRequest) Build(build string) ApiActRunSyncGetDatasetItemsPostRequest { - r.build = &build - return r -} - -// Specifies optional webhooks associated with the Actor run, which can be used to receive a notification e.g. when the Actor finished or failed. The value is a Base64-encoded JSON array whose items follow the WebhookRepresentation schema. For more information, see [Webhooks documentation](https://docs.apify.com/platform/integrations/webhooks). -func (r ApiActRunSyncGetDatasetItemsPostRequest) Webhooks(webhooks string) ApiActRunSyncGetDatasetItemsPostRequest { - r.webhooks = &webhooks - return r -} - -// Format of the results, possible values are: `json`, `jsonl`, `csv`, `html`, `xlsx`, `xml` and `rss`. The default value is `json`. -func (r ApiActRunSyncGetDatasetItemsPostRequest) Format(format string) ApiActRunSyncGetDatasetItemsPostRequest { - r.format = &format - return r -} - -// If `true` or `1` then the API endpoint returns only non-empty items and skips hidden fields (i.e. fields starting with the # character). The `clean` parameter is just a shortcut for `skipHidden=true` and `skipEmpty=true` parameters. Note that since some objects might be skipped from the output, that the result might contain less items than the `limit` value. -func (r ApiActRunSyncGetDatasetItemsPostRequest) Clean(clean bool) ApiActRunSyncGetDatasetItemsPostRequest { - r.clean = &clean - return r -} - -// Number of items that should be skipped at the start. The default value is `0`. -func (r ApiActRunSyncGetDatasetItemsPostRequest) Offset(offset float64) ApiActRunSyncGetDatasetItemsPostRequest { - r.offset = &offset - return r -} - -// Maximum number of items to return. By default there is no limit. -func (r ApiActRunSyncGetDatasetItemsPostRequest) Limit(limit float64) ApiActRunSyncGetDatasetItemsPostRequest { - r.limit = &limit - return r -} - -// A comma-separated list of fields which should be picked from the items, only these fields will remain in the resulting record objects. Note that the fields in the outputted items are sorted the same way as they are specified in the `fields` query parameter. You can use this feature to effectively fix the output format. -func (r ApiActRunSyncGetDatasetItemsPostRequest) Fields(fields string) ApiActRunSyncGetDatasetItemsPostRequest { - r.fields = &fields - return r -} - -// A comma-separated list of output field names that positionally rename the fields specified in the `fields` parameter. For example, `?fields=headline,url&outputFields=title,link` renames `headline` to `title` and `url` to `link` in the output. The number of names in `outputFields` must match the number of names in `fields`. Requires the `fields` parameter to be specified as well. -func (r ApiActRunSyncGetDatasetItemsPostRequest) OutputFields(outputFields string) ApiActRunSyncGetDatasetItemsPostRequest { - r.outputFields = &outputFields - return r -} - -// A comma-separated list of fields which should be omitted from the items. -func (r ApiActRunSyncGetDatasetItemsPostRequest) Omit(omit string) ApiActRunSyncGetDatasetItemsPostRequest { - r.omit = &omit - return r -} - -// A comma-separated list of fields which should be unwound, in order which they should be processed. Each field should be either an array or an object. If the field is an array then every element of the array will become a separate record and merged with parent object. If the unwound field is an object then it is merged with the parent object. If the unwound field is missing or its value is neither an array nor an object and therefore cannot be merged with a parent object then the item gets preserved as it is. Note that the unwound items ignore the `desc` parameter. -func (r ApiActRunSyncGetDatasetItemsPostRequest) Unwind(unwind string) ApiActRunSyncGetDatasetItemsPostRequest { - r.unwind = &unwind - return r -} - -// A comma-separated list of fields which should transform nested objects into flat structures. For example, with `flatten=\"foo\"` the object `{\"foo\":{\"bar\": \"hello\"}}` is turned into `{\"foo.bar\": \"hello\"}`. The original object with properties is replaced with the flattened object. -func (r ApiActRunSyncGetDatasetItemsPostRequest) Flatten(flatten string) ApiActRunSyncGetDatasetItemsPostRequest { - r.flatten = &flatten - return r -} - -// By default, results are returned in the same order as they were stored. To reverse the order, set this parameter to `true` or `1`. -func (r ApiActRunSyncGetDatasetItemsPostRequest) Desc(desc bool) ApiActRunSyncGetDatasetItemsPostRequest { - r.desc = &desc - return r -} - -// If `true` or `1` then the response will define the `Content-Disposition: attachment` header, forcing a web browser to download the file rather than to display it. By default this header is not present. -func (r ApiActRunSyncGetDatasetItemsPostRequest) Attachment(attachment bool) ApiActRunSyncGetDatasetItemsPostRequest { - r.attachment = &attachment - return r -} - -// A delimiter character for CSV files, only used if `format=csv`. You might need to URL-encode the character (e.g. use `%09` for tab or `%3B` for semicolon). The default delimiter is a simple comma (`,`). -func (r ApiActRunSyncGetDatasetItemsPostRequest) Delimiter(delimiter string) ApiActRunSyncGetDatasetItemsPostRequest { - r.delimiter = &delimiter - return r -} - -// All text responses are encoded in UTF-8 encoding. By default, the `format=csv` files are prefixed with the UTF-8 Byte Order Mark (BOM), while `json`, `jsonl`, `xml`, `html` and `rss` files are not. If you want to override this default behavior, specify `bom=1` query parameter to include the BOM or `bom=0` to skip it. -func (r ApiActRunSyncGetDatasetItemsPostRequest) Bom(bom bool) ApiActRunSyncGetDatasetItemsPostRequest { - r.bom = &bom - return r -} - -// Overrides default root element name of `xml` output. By default the root element is `items`. -func (r ApiActRunSyncGetDatasetItemsPostRequest) XmlRoot(xmlRoot string) ApiActRunSyncGetDatasetItemsPostRequest { - r.xmlRoot = &xmlRoot - return r -} - -// Overrides default element name that wraps each page or page function result object in `xml` output. By default the element name is `item`. -func (r ApiActRunSyncGetDatasetItemsPostRequest) XmlRow(xmlRow string) ApiActRunSyncGetDatasetItemsPostRequest { - r.xmlRow = &xmlRow - return r -} - -// If `true` or `1` then header row in the `csv` format is skipped. -func (r ApiActRunSyncGetDatasetItemsPostRequest) SkipHeaderRow(skipHeaderRow bool) ApiActRunSyncGetDatasetItemsPostRequest { - r.skipHeaderRow = &skipHeaderRow - return r -} - -// If `true` or `1` then hidden fields are skipped from the output, i.e. fields starting with the `#` character. -func (r ApiActRunSyncGetDatasetItemsPostRequest) SkipHidden(skipHidden bool) ApiActRunSyncGetDatasetItemsPostRequest { - r.skipHidden = &skipHidden - return r -} - -// If `true` or `1` then empty items are skipped from the output. Note that if used, the results might contain less items than the limit value. -func (r ApiActRunSyncGetDatasetItemsPostRequest) SkipEmpty(skipEmpty bool) ApiActRunSyncGetDatasetItemsPostRequest { - r.skipEmpty = &skipEmpty - return r -} - -// If `true` or `1` then, the endpoint applies the `fields=url,pageFunctionResult,errorInfo` and `unwind=pageFunctionResult` query parameters. This feature is used to emulate simplified results provided by the legacy Apify Crawler product and it's not recommended to use it in new integrations. -func (r ApiActRunSyncGetDatasetItemsPostRequest) Simplified(simplified bool) ApiActRunSyncGetDatasetItemsPostRequest { - r.simplified = &simplified - return r -} - -// Defines the view configuration for dataset items based on the schema definition. This parameter determines how the data will be filtered and presented. For complete specification details, see the [dataset schema documentation](/platform/actors/development/actor-definition/dataset-schema). -func (r ApiActRunSyncGetDatasetItemsPostRequest) View(view string) ApiActRunSyncGetDatasetItemsPostRequest { - r.view = &view - return r -} - -// If `true` or `1` then, the all the items with errorInfo property will be skipped from the output. This feature is here to emulate functionality of API version 1 used for the legacy Apify Crawler product and it's not recommended to use it in new integrations. -func (r ApiActRunSyncGetDatasetItemsPostRequest) SkipFailedPages(skipFailedPages bool) ApiActRunSyncGetDatasetItemsPostRequest { - r.skipFailedPages = &skipFailedPages - return r -} - -// Overrides the auto-generated RSS channel `<title>` element. Only used when `format=rss`. If not provided, the title defaults to `Dataset <label>`. -func (r ApiActRunSyncGetDatasetItemsPostRequest) FeedTitle(feedTitle string) ApiActRunSyncGetDatasetItemsPostRequest { - r.feedTitle = &feedTitle - return r -} - -// Overrides the auto-generated RSS channel `<description>` element. Only used when `format=rss`. If not provided, the description defaults to `Items in dataset with id \"<datasetId>\".` -func (r ApiActRunSyncGetDatasetItemsPostRequest) FeedDescription(feedDescription string) ApiActRunSyncGetDatasetItemsPostRequest { - r.feedDescription = &feedDescription - return r -} - -func (r ApiActRunSyncGetDatasetItemsPostRequest) Execute() ([]map[string]interface{}, *http.Response, error) { - return r.ApiService.ActRunSyncGetDatasetItemsPostExecute(r) -} - -/* -ActRunSyncGetDatasetItemsPost Run Actor synchronously and get dataset items - -Runs a specific Actor and returns its dataset items. - -The POST payload including its `Content-Type` header is passed as `INPUT` to -the Actor (usually `application/json`). -The HTTP response contains the Actors dataset items, while the format of -items depends on specifying dataset items' `format` parameter. - -You can send all the same options in parameters as the [Get Dataset -Items](#/reference/datasets/item-collection/get-items) API endpoint. - -The Actor is started with the default options; you can override them using -URL query parameters. -If the Actor run exceeds 300<!-- MAX_ACTOR_JOB_SYNC_WAIT_SECS --> seconds, -the HTTP response will return the 408 status code (Request Timeout). - -Beware that it might be impossible to maintain an idle HTTP connection for a -long period of time, -due to client timeout or network conditions. Make sure your HTTP client is -configured to have a long enough connection timeout. -If the connection breaks, you will not receive any information about the run -and its status. - -To run the Actor asynchronously, use the [Run -Actor](#/reference/actors/run-collection/run-actor) API endpoint instead. - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param actorId Actor ID or a tilde-separated owner's username and Actor name. - @return ApiActRunSyncGetDatasetItemsPostRequest -*/ -func (a *ActorsActorRunsAPIService) ActRunSyncGetDatasetItemsPost(ctx context.Context, actorId string) ApiActRunSyncGetDatasetItemsPostRequest { - return ApiActRunSyncGetDatasetItemsPostRequest{ - ApiService: a, - ctx: ctx, - actorId: actorId, - } -} - -// Execute executes the request -// @return []map[string]interface{} -func (a *ActorsActorRunsAPIService) ActRunSyncGetDatasetItemsPostExecute(r ApiActRunSyncGetDatasetItemsPostRequest) ([]map[string]interface{}, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodPost - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue []map[string]interface{} - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ActorsActorRunsAPIService.ActRunSyncGetDatasetItemsPost") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/actors/{actorId}/run-sync-get-dataset-items" - localVarPath = strings.Replace(localVarPath, "{"+"actorId"+"}", url.PathEscape(parameterValueToString(r.actorId, "actorId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - if r.body == nil { - return localVarReturnValue, nil, reportError("body is required and must be specified") - } - - if r.timeout != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "timeout", r.timeout, "form", "") - } - if r.memory != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "memory", r.memory, "form", "") - } - if r.maxItems != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "maxItems", r.maxItems, "form", "") - } - if r.maxTotalChargeUsd != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "maxTotalChargeUsd", r.maxTotalChargeUsd, "form", "") - } - if r.restartOnError != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "restartOnError", r.restartOnError, "form", "") - } - if r.build != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "build", r.build, "form", "") - } - if r.webhooks != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "webhooks", r.webhooks, "form", "") - } - if r.format != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "format", r.format, "form", "") - } - if r.clean != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "clean", r.clean, "form", "") - } - if r.offset != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "form", "") - } - if r.limit != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "form", "") - } - if r.fields != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "fields", r.fields, "form", "") - } - if r.outputFields != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "outputFields", r.outputFields, "form", "") - } - if r.omit != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "omit", r.omit, "form", "") - } - if r.unwind != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "unwind", r.unwind, "form", "") - } - if r.flatten != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "flatten", r.flatten, "form", "") - } - if r.desc != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "desc", r.desc, "form", "") - } - if r.attachment != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "attachment", r.attachment, "form", "") - } - if r.delimiter != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "delimiter", r.delimiter, "form", "") - } - if r.bom != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "bom", r.bom, "form", "") - } - if r.xmlRoot != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "xmlRoot", r.xmlRoot, "form", "") - } - if r.xmlRow != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "xmlRow", r.xmlRow, "form", "") - } - if r.skipHeaderRow != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "skipHeaderRow", r.skipHeaderRow, "form", "") - } - if r.skipHidden != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "skipHidden", r.skipHidden, "form", "") - } - if r.skipEmpty != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "skipEmpty", r.skipEmpty, "form", "") - } - if r.simplified != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "simplified", r.simplified, "form", "") - } - if r.view != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "view", r.view, "form", "") - } - if r.skipFailedPages != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "skipFailedPages", r.skipFailedPages, "form", "") - } - if r.feedTitle != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "feedTitle", r.feedTitle, "form", "") - } - if r.feedDescription != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "feedDescription", r.feedDescription, "form", "") - } - // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/json"} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - // body params - localVarPostBody = r.body - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ActorRunFailedError - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 402 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 408 { - var v ActorRunTimeoutExceededError - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiActRunSyncPostRequest struct { - ctx context.Context - ApiService *ActorsActorRunsAPIService - actorId string - body *map[string]interface{} - outputRecordKey *string - timeout *float64 - memory *float64 - maxItems *float64 - maxTotalChargeUsd *float64 - restartOnError *bool - build *string - webhooks *string -} - -// -func (r ApiActRunSyncPostRequest) Body(body map[string]interface{}) ApiActRunSyncPostRequest { - r.body = &body - return r -} - -// Key of the record from run's default key-value store to be returned in the response. By default, it is `OUTPUT`. -func (r ApiActRunSyncPostRequest) OutputRecordKey(outputRecordKey string) ApiActRunSyncPostRequest { - r.outputRecordKey = &outputRecordKey - return r -} - -// Optional timeout for the run, in seconds. By default, the run uses the timeout from its configuration. -func (r ApiActRunSyncPostRequest) Timeout(timeout float64) ApiActRunSyncPostRequest { - r.timeout = &timeout - return r -} - -// Memory limit for the run, in megabytes. The amount of memory can be set to a power of 2 with a minimum of 128. By default, the run uses the memory limit from its configuration. -func (r ApiActRunSyncPostRequest) Memory(memory float64) ApiActRunSyncPostRequest { - r.memory = &memory - return r -} - -// Specifies the maximum number of dataset items that will be charged for pay-per-result Actors. This does NOT guarantee that the Actor will return only this many items. It only ensures you won't be charged for more than this number of items. Only works for pay-per-result Actors. Value can be accessed in the actor run using `ACTOR_MAX_PAID_DATASET_ITEMS` environment variable. -func (r ApiActRunSyncPostRequest) MaxItems(maxItems float64) ApiActRunSyncPostRequest { - r.maxItems = &maxItems - return r -} - -// Specifies the maximum cost of the run. This parameter is useful for pay-per-event Actors, as it allows you to limit the amount charged to your subscription. You can access the maximum cost in your Actor by using the `ACTOR_MAX_TOTAL_CHARGE_USD` environment variable. -func (r ApiActRunSyncPostRequest) MaxTotalChargeUsd(maxTotalChargeUsd float64) ApiActRunSyncPostRequest { - r.maxTotalChargeUsd = &maxTotalChargeUsd - return r -} - -// Determines whether the run will be restarted if it fails. -func (r ApiActRunSyncPostRequest) RestartOnError(restartOnError bool) ApiActRunSyncPostRequest { - r.restartOnError = &restartOnError - return r -} - -// Specifies the Actor build to run. It can be either a build tag or build number. By default, the run uses the build from its configuration (typically `latest`). -func (r ApiActRunSyncPostRequest) Build(build string) ApiActRunSyncPostRequest { - r.build = &build - return r -} - -// Specifies optional webhooks associated with the Actor run, which can be used to receive a notification e.g. when the Actor finished or failed. The value is a Base64-encoded JSON array whose items follow the WebhookRepresentation schema. For more information, see [Webhooks documentation](https://docs.apify.com/platform/integrations/webhooks). -func (r ApiActRunSyncPostRequest) Webhooks(webhooks string) ApiActRunSyncPostRequest { - r.webhooks = &webhooks - return r -} - -func (r ApiActRunSyncPostRequest) Execute() (map[string]interface{}, *http.Response, error) { - return r.ApiService.ActRunSyncPostExecute(r) -} - -/* -ActRunSyncPost Run Actor synchronously and return output - -Runs a specific Actor and returns its output. - -The POST payload including its `Content-Type` header is passed as `INPUT` to -the Actor (usually <code>application/json</code>). -The HTTP response contains Actors `OUTPUT` record from its default -key-value store. - -The Actor is started with the default options; you can override them using -various URL query parameters. -If the Actor run exceeds 300<!-- MAX_ACTOR_JOB_SYNC_WAIT_SECS --> seconds, -the HTTP response will have status 408 (Request Timeout). - -Beware that it might be impossible to maintain an idle HTTP connection for a -long period of time, due to client timeout or network conditions. Make sure your HTTP client is -configured to have a long enough connection timeout. -If the connection breaks, you will not receive any information about the run -and its status. - -To run the Actor asynchronously, use the [Run -Actor](#/reference/actors/run-collection/run-actor) API endpoint instead. - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param actorId Actor ID or a tilde-separated owner's username and Actor name. - @return ApiActRunSyncPostRequest -*/ -func (a *ActorsActorRunsAPIService) ActRunSyncPost(ctx context.Context, actorId string) ApiActRunSyncPostRequest { - return ApiActRunSyncPostRequest{ - ApiService: a, - ctx: ctx, - actorId: actorId, - } -} - -// Execute executes the request -// @return map[string]interface{} -func (a *ActorsActorRunsAPIService) ActRunSyncPostExecute(r ApiActRunSyncPostRequest) (map[string]interface{}, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodPost - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue map[string]interface{} - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ActorsActorRunsAPIService.ActRunSyncPost") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/actors/{actorId}/run-sync" - localVarPath = strings.Replace(localVarPath, "{"+"actorId"+"}", url.PathEscape(parameterValueToString(r.actorId, "actorId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - if r.body == nil { - return localVarReturnValue, nil, reportError("body is required and must be specified") - } - - if r.outputRecordKey != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "outputRecordKey", r.outputRecordKey, "form", "") - } - if r.timeout != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "timeout", r.timeout, "form", "") - } - if r.memory != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "memory", r.memory, "form", "") - } - if r.maxItems != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "maxItems", r.maxItems, "form", "") - } - if r.maxTotalChargeUsd != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "maxTotalChargeUsd", r.maxTotalChargeUsd, "form", "") - } - if r.restartOnError != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "restartOnError", r.restartOnError, "form", "") - } - if r.build != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "build", r.build, "form", "") - } - if r.webhooks != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "webhooks", r.webhooks, "form", "") - } - // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/json"} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - // body params - localVarPostBody = r.body - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ActorRunFailedError - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 402 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 408 { - var v ActorRunTimeoutExceededError - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 415 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiActRunsGetRequest struct { - ctx context.Context - ApiService *ActorsActorRunsAPIService - actorId string - offset *float64 - limit *float64 - desc *bool - status *[]string - startedAfter *time.Time - startedBefore *time.Time -} - -// Number of items that should be skipped at the start. The default value is `0`. -func (r ApiActRunsGetRequest) Offset(offset float64) ApiActRunsGetRequest { - r.offset = &offset - return r -} - -// Maximum number of items to return. The default value as well as the maximum is `1000`. -func (r ApiActRunsGetRequest) Limit(limit float64) ApiActRunsGetRequest { - r.limit = &limit - return r -} - -// If `true` or `1` then the objects are sorted by the `startedAt` field in descending order. By default, they are sorted in ascending order. -func (r ApiActRunsGetRequest) Desc(desc bool) ApiActRunsGetRequest { - r.desc = &desc - return r -} - -// Single status or comma-separated list of statuses, see ([available statuses](https://docs.apify.com/platform/actors/running/runs-and-builds#lifecycle)). Used to filter runs by the specified statuses only. -func (r ApiActRunsGetRequest) Status(status []string) ApiActRunsGetRequest { - r.status = &status - return r -} - -// Filter runs that started after the specified date and time (inclusive). The value must be a valid ISO 8601 datetime string (UTC). -func (r ApiActRunsGetRequest) StartedAfter(startedAfter time.Time) ApiActRunsGetRequest { - r.startedAfter = &startedAfter - return r -} - -// Filter runs that started before the specified date and time (inclusive). The value must be a valid ISO 8601 datetime string (UTC). -func (r ApiActRunsGetRequest) StartedBefore(startedBefore time.Time) ApiActRunsGetRequest { - r.startedBefore = &startedBefore - return r -} - -func (r ApiActRunsGetRequest) Execute() (*ListOfRunsResponse, *http.Response, error) { - return r.ApiService.ActRunsGetExecute(r) -} - -/* -ActRunsGet Get list of runs - -Gets the list of runs of a specific Actor. The response is a list of -objects, where each object contains basic information about a single Actor run. - -The endpoint supports pagination using the `limit` and `offset` parameters -and it will not return more than 1000 array elements. - -By default, the records are sorted by the `startedAt` field in ascending -order, therefore you can use pagination to incrementally fetch all records while -new ones are still being created. To sort the records in descending order, use -`desc=1` parameter. You can also filter runs by status ([available -statuses](https://docs.apify.com/platform/actors/running/runs-and-builds#lifecycle)). - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param actorId Actor ID or a tilde-separated owner's username and Actor name. - @return ApiActRunsGetRequest -*/ -func (a *ActorsActorRunsAPIService) ActRunsGet(ctx context.Context, actorId string) ApiActRunsGetRequest { - return ApiActRunsGetRequest{ - ApiService: a, - ctx: ctx, - actorId: actorId, - } -} - -// Execute executes the request -// @return ListOfRunsResponse -func (a *ActorsActorRunsAPIService) ActRunsGetExecute(r ApiActRunsGetRequest) (*ListOfRunsResponse, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *ListOfRunsResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ActorsActorRunsAPIService.ActRunsGet") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/actors/{actorId}/runs" - localVarPath = strings.Replace(localVarPath, "{"+"actorId"+"}", url.PathEscape(parameterValueToString(r.actorId, "actorId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if r.offset != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "form", "") - } - if r.limit != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "form", "") - } - if r.desc != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "desc", r.desc, "form", "") - } - if r.status != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "status", r.status, "form", "csv") - } - if r.startedAfter != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "startedAfter", r.startedAfter, "form", "") - } - if r.startedBefore != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "startedBefore", r.startedBefore, "form", "") - } - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiActRunsLastGetRequest struct { - ctx context.Context - ApiService *ActorsActorRunsAPIService - actorId string - status *string - waitForFinish *float64 -} - -// Filter for the run status. -func (r ApiActRunsLastGetRequest) Status(status string) ApiActRunsLastGetRequest { - r.status = &status - return r -} - -// The maximum number of seconds the server waits for the run to finish. By default it is `0`, the maximum value is `60`. <!-- MAX_ACTOR_JOB_ASYNC_WAIT_SECS --> If the run finishes in time then the returned run object will have a terminal status (e.g. `SUCCEEDED`), otherwise it will have a transitional status (e.g. `RUNNING`). -func (r ApiActRunsLastGetRequest) WaitForFinish(waitForFinish float64) ApiActRunsLastGetRequest { - r.waitForFinish = &waitForFinish - return r -} - -func (r ApiActRunsLastGetRequest) Execute() (*RunResponse, *http.Response, error) { - return r.ApiService.ActRunsLastGetExecute(r) -} - -/* -ActRunsLastGet Get last run - -This is not a single endpoint, but an entire group of endpoints that lets you to -retrieve and manage the last run of given Actor or any of its default storages. -All the endpoints require an authentication token. - -The base path represents the last Actor run object is: - -`/v2/actors/{actorId}/runs/last{?token,status}` - -Using the `status` query parameter you can ensure to only get a run with a certain status -(e.g. `status=SUCCEEDED`). The output of this endpoint and other query parameters -are the same as in the [Run object](#/reference/actors/run-object) endpoint. - -##### Convenience endpoints for last Actor run - -* [Dataset](/api/v2/last-actor-runs-default-dataset) - -* [Key-value store](/api/v2/last-actor-runs-default-key-value-store) - -* [Request queue](/api/v2/last-actor-runs-default-request-queue) - -* [Log](/api/v2/last-actor-runs-log) - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param actorId Actor ID or a tilde-separated owner's username and Actor name. - @return ApiActRunsLastGetRequest -*/ -func (a *ActorsActorRunsAPIService) ActRunsLastGet(ctx context.Context, actorId string) ApiActRunsLastGetRequest { - return ApiActRunsLastGetRequest{ - ApiService: a, - ctx: ctx, - actorId: actorId, - } -} - -// Execute executes the request -// @return RunResponse -func (a *ActorsActorRunsAPIService) ActRunsLastGetExecute(r ApiActRunsLastGetRequest) (*RunResponse, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *RunResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ActorsActorRunsAPIService.ActRunsLastGet") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/actors/{actorId}/runs/last" - localVarPath = strings.Replace(localVarPath, "{"+"actorId"+"}", url.PathEscape(parameterValueToString(r.actorId, "actorId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if r.status != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "status", r.status, "form", "") - } - if r.waitForFinish != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "waitForFinish", r.waitForFinish, "form", "") - } - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiActRunsPostRequest struct { - ctx context.Context - ApiService *ActorsActorRunsAPIService - actorId string - body *map[string]interface{} - timeout *float64 - memory *float64 - maxItems *float64 - maxTotalChargeUsd *float64 - restartOnError *bool - build *string - waitForFinish *float64 - webhooks *string - forcePermissionLevel *string -} - -// -func (r ApiActRunsPostRequest) Body(body map[string]interface{}) ApiActRunsPostRequest { - r.body = &body - return r -} - -// Optional timeout for the run, in seconds. By default, the run uses the timeout from its configuration. -func (r ApiActRunsPostRequest) Timeout(timeout float64) ApiActRunsPostRequest { - r.timeout = &timeout - return r -} - -// Memory limit for the run, in megabytes. The amount of memory can be set to a power of 2 with a minimum of 128. By default, the run uses the memory limit from its configuration. -func (r ApiActRunsPostRequest) Memory(memory float64) ApiActRunsPostRequest { - r.memory = &memory - return r -} - -// Specifies the maximum number of dataset items that will be charged for pay-per-result Actors. This does NOT guarantee that the Actor will return only this many items. It only ensures you won't be charged for more than this number of items. Only works for pay-per-result Actors. Value can be accessed in the actor run using `ACTOR_MAX_PAID_DATASET_ITEMS` environment variable. -func (r ApiActRunsPostRequest) MaxItems(maxItems float64) ApiActRunsPostRequest { - r.maxItems = &maxItems - return r -} - -// Specifies the maximum cost of the run. This parameter is useful for pay-per-event Actors, as it allows you to limit the amount charged to your subscription. You can access the maximum cost in your Actor by using the `ACTOR_MAX_TOTAL_CHARGE_USD` environment variable. -func (r ApiActRunsPostRequest) MaxTotalChargeUsd(maxTotalChargeUsd float64) ApiActRunsPostRequest { - r.maxTotalChargeUsd = &maxTotalChargeUsd - return r -} - -// Determines whether the run will be restarted if it fails. -func (r ApiActRunsPostRequest) RestartOnError(restartOnError bool) ApiActRunsPostRequest { - r.restartOnError = &restartOnError - return r -} - -// Specifies the Actor build to run. It can be either a build tag or build number. By default, the run uses the build from its configuration (typically `latest`). -func (r ApiActRunsPostRequest) Build(build string) ApiActRunsPostRequest { - r.build = &build - return r -} - -// The maximum number of seconds the server waits for the run to finish. By default it is `0`, the maximum value is `60`. <!-- MAX_ACTOR_JOB_ASYNC_WAIT_SECS --> If the run finishes in time then the returned run object will have a terminal status (e.g. `SUCCEEDED`), otherwise it will have a transitional status (e.g. `RUNNING`). -func (r ApiActRunsPostRequest) WaitForFinish(waitForFinish float64) ApiActRunsPostRequest { - r.waitForFinish = &waitForFinish - return r -} - -// Specifies optional webhooks associated with the Actor run, which can be used to receive a notification e.g. when the Actor finished or failed. The value is a Base64-encoded JSON array whose items follow the WebhookRepresentation schema. For more information, see [Webhooks documentation](https://docs.apify.com/platform/integrations/webhooks). -func (r ApiActRunsPostRequest) Webhooks(webhooks string) ApiActRunsPostRequest { - r.webhooks = &webhooks - return r -} - -// Overrides the Actor's permission level for this specific run. Use to test restricted permissions before deploying changes to your Actor or to temporarily elevate or restrict access. If you don't specify this parameter, the Actor uses its configured default permission level. For more information on permissions, see the [documentation](https://docs.apify.com/platform/actors/development/permissions). -func (r ApiActRunsPostRequest) ForcePermissionLevel(forcePermissionLevel string) ApiActRunsPostRequest { - r.forcePermissionLevel = &forcePermissionLevel - return r -} - -func (r ApiActRunsPostRequest) Execute() (*RunResponse, *http.Response, error) { - return r.ApiService.ActRunsPostExecute(r) -} - -/* -ActRunsPost Run Actor - -Runs an Actor and immediately returns without waiting for the run to finish. - -The POST payload including its `Content-Type` header is passed as `INPUT` to -the Actor (usually `application/json`). - -The Actor is started with the default options; you can override them using -various URL query parameters. - -The response is the Run object as returned by the [Get -run](#/reference/actor-runs/run-object-and-its-storages/get-run) API -endpoint. - -If you want to wait for the run to finish and receive the actual output of -the Actor as the response, please use one of the [Run Actor -synchronously](#/reference/actors/run-actor-synchronously) API endpoints -instead. - -To fetch the Actor run results that are typically stored in the default -dataset, you'll need to pass the ID received in the `defaultDatasetId` field -received in the response JSON to the [Get dataset items](#/reference/datasets/item-collection/get-items) -API endpoint. - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param actorId Actor ID or a tilde-separated owner's username and Actor name. - @return ApiActRunsPostRequest -*/ -func (a *ActorsActorRunsAPIService) ActRunsPost(ctx context.Context, actorId string) ApiActRunsPostRequest { - return ApiActRunsPostRequest{ - ApiService: a, - ctx: ctx, - actorId: actorId, - } -} - -// Execute executes the request -// @return RunResponse -func (a *ActorsActorRunsAPIService) ActRunsPostExecute(r ApiActRunsPostRequest) (*RunResponse, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodPost - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *RunResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ActorsActorRunsAPIService.ActRunsPost") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/actors/{actorId}/runs" - localVarPath = strings.Replace(localVarPath, "{"+"actorId"+"}", url.PathEscape(parameterValueToString(r.actorId, "actorId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - if r.body == nil { - return localVarReturnValue, nil, reportError("body is required and must be specified") - } - - if r.timeout != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "timeout", r.timeout, "form", "") - } - if r.memory != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "memory", r.memory, "form", "") - } - if r.maxItems != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "maxItems", r.maxItems, "form", "") - } - if r.maxTotalChargeUsd != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "maxTotalChargeUsd", r.maxTotalChargeUsd, "form", "") - } - if r.restartOnError != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "restartOnError", r.restartOnError, "form", "") - } - if r.build != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "build", r.build, "form", "") - } - if r.waitForFinish != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "waitForFinish", r.waitForFinish, "form", "") - } - if r.webhooks != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "webhooks", r.webhooks, "form", "") - } - if r.forcePermissionLevel != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "forcePermissionLevel", r.forcePermissionLevel, "form", "") - } - // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/json"} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - // body params - localVarPostBody = r.body - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 402 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 413 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 415 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} diff --git a/api_actors_actor_versions.go b/api_actors_actor_versions.go deleted file mode 100644 index 03f8661..0000000 --- a/api_actors_actor_versions.go +++ /dev/null @@ -1,2562 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "bytes" - "context" - "io" - "net/http" - "net/url" - "strings" -) - - -// ActorsActorVersionsAPIService ActorsActorVersionsAPI service -type ActorsActorVersionsAPIService service - -type ApiActVersionDeleteRequest struct { - ctx context.Context - ApiService *ActorsActorVersionsAPIService - actorId string - versionNumber string -} - -func (r ApiActVersionDeleteRequest) Execute() (map[string]interface{}, *http.Response, error) { - return r.ApiService.ActVersionDeleteExecute(r) -} - -/* -ActVersionDelete Delete version - -Deletes a specific version of Actor's source code. - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param actorId Actor ID or a tilde-separated owner's username and Actor name. - @param versionNumber Actor version. - @return ApiActVersionDeleteRequest -*/ -func (a *ActorsActorVersionsAPIService) ActVersionDelete(ctx context.Context, actorId string, versionNumber string) ApiActVersionDeleteRequest { - return ApiActVersionDeleteRequest{ - ApiService: a, - ctx: ctx, - actorId: actorId, - versionNumber: versionNumber, - } -} - -// Execute executes the request -// @return map[string]interface{} -func (a *ActorsActorVersionsAPIService) ActVersionDeleteExecute(r ApiActVersionDeleteRequest) (map[string]interface{}, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodDelete - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue map[string]interface{} - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ActorsActorVersionsAPIService.ActVersionDelete") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/actors/{actorId}/versions/{versionNumber}" - localVarPath = strings.Replace(localVarPath, "{"+"actorId"+"}", url.PathEscape(parameterValueToString(r.actorId, "actorId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"versionNumber"+"}", url.PathEscape(parameterValueToString(r.versionNumber, "versionNumber")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiActVersionEnvVarDeleteRequest struct { - ctx context.Context - ApiService *ActorsActorVersionsAPIService - actorId string - versionNumber string - envVarName string -} - -func (r ApiActVersionEnvVarDeleteRequest) Execute() (map[string]interface{}, *http.Response, error) { - return r.ApiService.ActVersionEnvVarDeleteExecute(r) -} - -/* -ActVersionEnvVarDelete Delete environment variable - -Deletes a specific environment variable. - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param actorId Actor ID or a tilde-separated owner's username and Actor name. - @param versionNumber Actor version. - @param envVarName The name of the environment variable - @return ApiActVersionEnvVarDeleteRequest -*/ -func (a *ActorsActorVersionsAPIService) ActVersionEnvVarDelete(ctx context.Context, actorId string, versionNumber string, envVarName string) ApiActVersionEnvVarDeleteRequest { - return ApiActVersionEnvVarDeleteRequest{ - ApiService: a, - ctx: ctx, - actorId: actorId, - versionNumber: versionNumber, - envVarName: envVarName, - } -} - -// Execute executes the request -// @return map[string]interface{} -func (a *ActorsActorVersionsAPIService) ActVersionEnvVarDeleteExecute(r ApiActVersionEnvVarDeleteRequest) (map[string]interface{}, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodDelete - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue map[string]interface{} - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ActorsActorVersionsAPIService.ActVersionEnvVarDelete") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/actors/{actorId}/versions/{versionNumber}/env-vars/{envVarName}" - localVarPath = strings.Replace(localVarPath, "{"+"actorId"+"}", url.PathEscape(parameterValueToString(r.actorId, "actorId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"versionNumber"+"}", url.PathEscape(parameterValueToString(r.versionNumber, "versionNumber")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"envVarName"+"}", url.PathEscape(parameterValueToString(r.envVarName, "envVarName")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiActVersionEnvVarGetRequest struct { - ctx context.Context - ApiService *ActorsActorVersionsAPIService - actorId string - versionNumber string - envVarName string -} - -func (r ApiActVersionEnvVarGetRequest) Execute() (*EnvVarResponse, *http.Response, error) { - return r.ApiService.ActVersionEnvVarGetExecute(r) -} - -/* -ActVersionEnvVarGet Get environment variable - -Gets a [EnvVar object](#/reference/actors/environment-variable-object) that -contains all the details about a specific environment variable of an Actor. - -If `isSecret` is set to `true`, then `value` will never be returned. - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param actorId Actor ID or a tilde-separated owner's username and Actor name. - @param versionNumber Actor version. - @param envVarName The name of the environment variable - @return ApiActVersionEnvVarGetRequest -*/ -func (a *ActorsActorVersionsAPIService) ActVersionEnvVarGet(ctx context.Context, actorId string, versionNumber string, envVarName string) ApiActVersionEnvVarGetRequest { - return ApiActVersionEnvVarGetRequest{ - ApiService: a, - ctx: ctx, - actorId: actorId, - versionNumber: versionNumber, - envVarName: envVarName, - } -} - -// Execute executes the request -// @return EnvVarResponse -func (a *ActorsActorVersionsAPIService) ActVersionEnvVarGetExecute(r ApiActVersionEnvVarGetRequest) (*EnvVarResponse, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *EnvVarResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ActorsActorVersionsAPIService.ActVersionEnvVarGet") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/actors/{actorId}/versions/{versionNumber}/env-vars/{envVarName}" - localVarPath = strings.Replace(localVarPath, "{"+"actorId"+"}", url.PathEscape(parameterValueToString(r.actorId, "actorId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"versionNumber"+"}", url.PathEscape(parameterValueToString(r.versionNumber, "versionNumber")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"envVarName"+"}", url.PathEscape(parameterValueToString(r.envVarName, "envVarName")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiActVersionEnvVarPostRequest struct { - ctx context.Context - ApiService *ActorsActorVersionsAPIService - actorId string - versionNumber string - envVarName string - envVarRequest *EnvVarRequest -} - -// -func (r ApiActVersionEnvVarPostRequest) EnvVarRequest(envVarRequest EnvVarRequest) ApiActVersionEnvVarPostRequest { - r.envVarRequest = &envVarRequest - return r -} - -func (r ApiActVersionEnvVarPostRequest) Execute() (*EnvVarResponse, *http.Response, error) { - return r.ApiService.ActVersionEnvVarPostExecute(r) -} - -/* -ActVersionEnvVarPost Update environment variable (POST) - -Updates Actor environment variable using values specified by a [EnvVar -object](#/reference/actors/environment-variable-object) -passed as JSON in the POST payload. -This endpoint is an alias for the [`PUT` update environment variable](#tag/ActorsEnvironment-variable-object/operation/act_version_envVar_put) method and behaves identically. - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param actorId Actor ID or a tilde-separated owner's username and Actor name. - @param versionNumber Actor version. - @param envVarName The name of the environment variable - @return ApiActVersionEnvVarPostRequest -*/ -func (a *ActorsActorVersionsAPIService) ActVersionEnvVarPost(ctx context.Context, actorId string, versionNumber string, envVarName string) ApiActVersionEnvVarPostRequest { - return ApiActVersionEnvVarPostRequest{ - ApiService: a, - ctx: ctx, - actorId: actorId, - versionNumber: versionNumber, - envVarName: envVarName, - } -} - -// Execute executes the request -// @return EnvVarResponse -func (a *ActorsActorVersionsAPIService) ActVersionEnvVarPostExecute(r ApiActVersionEnvVarPostRequest) (*EnvVarResponse, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodPost - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *EnvVarResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ActorsActorVersionsAPIService.ActVersionEnvVarPost") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/actors/{actorId}/versions/{versionNumber}/env-vars/{envVarName}" - localVarPath = strings.Replace(localVarPath, "{"+"actorId"+"}", url.PathEscape(parameterValueToString(r.actorId, "actorId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"versionNumber"+"}", url.PathEscape(parameterValueToString(r.versionNumber, "versionNumber")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"envVarName"+"}", url.PathEscape(parameterValueToString(r.envVarName, "envVarName")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - if r.envVarRequest == nil { - return localVarReturnValue, nil, reportError("envVarRequest is required and must be specified") - } - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/json"} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - // body params - localVarPostBody = r.envVarRequest - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 413 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 415 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiActVersionEnvVarPutRequest struct { - ctx context.Context - ApiService *ActorsActorVersionsAPIService - actorId string - versionNumber string - envVarName string - envVarRequest *EnvVarRequest -} - -// -func (r ApiActVersionEnvVarPutRequest) EnvVarRequest(envVarRequest EnvVarRequest) ApiActVersionEnvVarPutRequest { - r.envVarRequest = &envVarRequest - return r -} - -func (r ApiActVersionEnvVarPutRequest) Execute() (*EnvVarResponse, *http.Response, error) { - return r.ApiService.ActVersionEnvVarPutExecute(r) -} - -/* -ActVersionEnvVarPut Update environment variable - -Updates Actor environment variable using values specified by a [EnvVar -object](#/reference/actors/environment-variable-object) -passed as JSON in the POST payload. -If the object does not define a specific property, its value will not be -updated. - -The request needs to specify the `Content-Type: application/json` HTTP -header! - -When providing your API authentication token, we recommend using the -request's `Authorization` header, rather than the URL. ([More -info](#/introduction/authentication)). - -The response is the [EnvVar object](#/reference/actors/environment-variable-object) as returned by the -[Get environment variable](#/reference/actors/environment-variable-object/get-environment-variable) -endpoint. - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param actorId Actor ID or a tilde-separated owner's username and Actor name. - @param versionNumber Actor version. - @param envVarName The name of the environment variable - @return ApiActVersionEnvVarPutRequest -*/ -func (a *ActorsActorVersionsAPIService) ActVersionEnvVarPut(ctx context.Context, actorId string, versionNumber string, envVarName string) ApiActVersionEnvVarPutRequest { - return ApiActVersionEnvVarPutRequest{ - ApiService: a, - ctx: ctx, - actorId: actorId, - versionNumber: versionNumber, - envVarName: envVarName, - } -} - -// Execute executes the request -// @return EnvVarResponse -func (a *ActorsActorVersionsAPIService) ActVersionEnvVarPutExecute(r ApiActVersionEnvVarPutRequest) (*EnvVarResponse, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodPut - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *EnvVarResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ActorsActorVersionsAPIService.ActVersionEnvVarPut") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/actors/{actorId}/versions/{versionNumber}/env-vars/{envVarName}" - localVarPath = strings.Replace(localVarPath, "{"+"actorId"+"}", url.PathEscape(parameterValueToString(r.actorId, "actorId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"versionNumber"+"}", url.PathEscape(parameterValueToString(r.versionNumber, "versionNumber")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"envVarName"+"}", url.PathEscape(parameterValueToString(r.envVarName, "envVarName")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - if r.envVarRequest == nil { - return localVarReturnValue, nil, reportError("envVarRequest is required and must be specified") - } - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/json"} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - // body params - localVarPostBody = r.envVarRequest - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 413 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 415 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiActVersionEnvVarsGetRequest struct { - ctx context.Context - ApiService *ActorsActorVersionsAPIService - actorId string - versionNumber string -} - -func (r ApiActVersionEnvVarsGetRequest) Execute() (*ListOfEnvVarsResponse, *http.Response, error) { - return r.ApiService.ActVersionEnvVarsGetExecute(r) -} - -/* -ActVersionEnvVarsGet Get list of environment variables - -Gets the list of environment variables for a specific version of an Actor. -The response is a JSON object with the list of [EnvVar objects](#/reference/actors/environment-variable-object), where each contains basic information about a single environment variable. - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param actorId Actor ID or a tilde-separated owner's username and Actor name. - @param versionNumber Actor version. - @return ApiActVersionEnvVarsGetRequest -*/ -func (a *ActorsActorVersionsAPIService) ActVersionEnvVarsGet(ctx context.Context, actorId string, versionNumber string) ApiActVersionEnvVarsGetRequest { - return ApiActVersionEnvVarsGetRequest{ - ApiService: a, - ctx: ctx, - actorId: actorId, - versionNumber: versionNumber, - } -} - -// Execute executes the request -// @return ListOfEnvVarsResponse -func (a *ActorsActorVersionsAPIService) ActVersionEnvVarsGetExecute(r ApiActVersionEnvVarsGetRequest) (*ListOfEnvVarsResponse, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *ListOfEnvVarsResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ActorsActorVersionsAPIService.ActVersionEnvVarsGet") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/actors/{actorId}/versions/{versionNumber}/env-vars" - localVarPath = strings.Replace(localVarPath, "{"+"actorId"+"}", url.PathEscape(parameterValueToString(r.actorId, "actorId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"versionNumber"+"}", url.PathEscape(parameterValueToString(r.versionNumber, "versionNumber")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiActVersionEnvVarsPostRequest struct { - ctx context.Context - ApiService *ActorsActorVersionsAPIService - actorId string - versionNumber string - envVarRequest *EnvVarRequest -} - -// -func (r ApiActVersionEnvVarsPostRequest) EnvVarRequest(envVarRequest EnvVarRequest) ApiActVersionEnvVarsPostRequest { - r.envVarRequest = &envVarRequest - return r -} - -func (r ApiActVersionEnvVarsPostRequest) Execute() (*EnvVarResponse, *http.Response, error) { - return r.ApiService.ActVersionEnvVarsPostExecute(r) -} - -/* -ActVersionEnvVarsPost Create environment variable - -Creates an environment variable of an Actor using values specified in a -[EnvVar object](#/reference/actors/environment-variable-object) passed as -JSON in the POST payload. - -The request must specify `name` and `value` parameters (as strings) in the -JSON payload and a `Content-Type: application/json` HTTP header. - -``` -{ - "name": "ENV_VAR_NAME", - "value": "my-env-var" -} -``` - -The response is the [EnvVar -object](#/reference/actors/environment-variable-object) as returned by the [Get environment -variable](#/reference/actors/environment-variable-object/get-environment-variable) -endpoint. - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param actorId Actor ID or a tilde-separated owner's username and Actor name. - @param versionNumber Actor version. - @return ApiActVersionEnvVarsPostRequest -*/ -func (a *ActorsActorVersionsAPIService) ActVersionEnvVarsPost(ctx context.Context, actorId string, versionNumber string) ApiActVersionEnvVarsPostRequest { - return ApiActVersionEnvVarsPostRequest{ - ApiService: a, - ctx: ctx, - actorId: actorId, - versionNumber: versionNumber, - } -} - -// Execute executes the request -// @return EnvVarResponse -func (a *ActorsActorVersionsAPIService) ActVersionEnvVarsPostExecute(r ApiActVersionEnvVarsPostRequest) (*EnvVarResponse, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodPost - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *EnvVarResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ActorsActorVersionsAPIService.ActVersionEnvVarsPost") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/actors/{actorId}/versions/{versionNumber}/env-vars" - localVarPath = strings.Replace(localVarPath, "{"+"actorId"+"}", url.PathEscape(parameterValueToString(r.actorId, "actorId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"versionNumber"+"}", url.PathEscape(parameterValueToString(r.versionNumber, "versionNumber")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - if r.envVarRequest == nil { - return localVarReturnValue, nil, reportError("envVarRequest is required and must be specified") - } - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/json"} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - // body params - localVarPostBody = r.envVarRequest - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 413 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 415 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiActVersionGetRequest struct { - ctx context.Context - ApiService *ActorsActorVersionsAPIService - actorId string - versionNumber string -} - -func (r ApiActVersionGetRequest) Execute() (*VersionResponse, *http.Response, error) { - return r.ApiService.ActVersionGetExecute(r) -} - -/* -ActVersionGet Get version - -Gets a [Version object](#/reference/actors/version-object) that contains all the details about a specific version of an Actor. - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param actorId Actor ID or a tilde-separated owner's username and Actor name. - @param versionNumber Actor version. - @return ApiActVersionGetRequest -*/ -func (a *ActorsActorVersionsAPIService) ActVersionGet(ctx context.Context, actorId string, versionNumber string) ApiActVersionGetRequest { - return ApiActVersionGetRequest{ - ApiService: a, - ctx: ctx, - actorId: actorId, - versionNumber: versionNumber, - } -} - -// Execute executes the request -// @return VersionResponse -func (a *ActorsActorVersionsAPIService) ActVersionGetExecute(r ApiActVersionGetRequest) (*VersionResponse, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *VersionResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ActorsActorVersionsAPIService.ActVersionGet") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/actors/{actorId}/versions/{versionNumber}" - localVarPath = strings.Replace(localVarPath, "{"+"actorId"+"}", url.PathEscape(parameterValueToString(r.actorId, "actorId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"versionNumber"+"}", url.PathEscape(parameterValueToString(r.versionNumber, "versionNumber")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiActVersionPostRequest struct { - ctx context.Context - ApiService *ActorsActorVersionsAPIService - actorId string - versionNumber string - createOrUpdateVersionRequest *CreateOrUpdateVersionRequest -} - -// -func (r ApiActVersionPostRequest) CreateOrUpdateVersionRequest(createOrUpdateVersionRequest CreateOrUpdateVersionRequest) ApiActVersionPostRequest { - r.createOrUpdateVersionRequest = &createOrUpdateVersionRequest - return r -} - -func (r ApiActVersionPostRequest) Execute() (*VersionResponse, *http.Response, error) { - return r.ApiService.ActVersionPostExecute(r) -} - -/* -ActVersionPost Update version (POST) - -Updates Actor version using values specified by a [Version object](#/reference/actors/version-object) passed as JSON in the POST payload. -This endpoint is an alias for the [`PUT` update version](#tag/ActorsVersion-object/operation/act_version_put) method and behaves identically. - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param actorId Actor ID or a tilde-separated owner's username and Actor name. - @param versionNumber Actor version. - @return ApiActVersionPostRequest -*/ -func (a *ActorsActorVersionsAPIService) ActVersionPost(ctx context.Context, actorId string, versionNumber string) ApiActVersionPostRequest { - return ApiActVersionPostRequest{ - ApiService: a, - ctx: ctx, - actorId: actorId, - versionNumber: versionNumber, - } -} - -// Execute executes the request -// @return VersionResponse -func (a *ActorsActorVersionsAPIService) ActVersionPostExecute(r ApiActVersionPostRequest) (*VersionResponse, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodPost - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *VersionResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ActorsActorVersionsAPIService.ActVersionPost") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/actors/{actorId}/versions/{versionNumber}" - localVarPath = strings.Replace(localVarPath, "{"+"actorId"+"}", url.PathEscape(parameterValueToString(r.actorId, "actorId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"versionNumber"+"}", url.PathEscape(parameterValueToString(r.versionNumber, "versionNumber")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - if r.createOrUpdateVersionRequest == nil { - return localVarReturnValue, nil, reportError("createOrUpdateVersionRequest is required and must be specified") - } - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/json"} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - // body params - localVarPostBody = r.createOrUpdateVersionRequest - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 413 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 415 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiActVersionPutRequest struct { - ctx context.Context - ApiService *ActorsActorVersionsAPIService - actorId string - versionNumber string - createOrUpdateVersionRequest *CreateOrUpdateVersionRequest -} - -// -func (r ApiActVersionPutRequest) CreateOrUpdateVersionRequest(createOrUpdateVersionRequest CreateOrUpdateVersionRequest) ApiActVersionPutRequest { - r.createOrUpdateVersionRequest = &createOrUpdateVersionRequest - return r -} - -func (r ApiActVersionPutRequest) Execute() (*VersionResponse, *http.Response, error) { - return r.ApiService.ActVersionPutExecute(r) -} - -/* -ActVersionPut Update version - -Updates Actor version using values specified by a [Version object](#/reference/actors/version-object) passed as JSON in the POST payload. - -If the object does not define a specific property, its value will not be -updated. - -The request needs to specify the `Content-Type: application/json` HTTP -header! - -When providing your API authentication token, we recommend using the -request's `Authorization` header, rather than the URL. ([More -info](#/introduction/authentication)). - -The response is the [Version object](#/reference/actors/version-object) as -returned by the [Get version](#/reference/actors/version-object/get-version) endpoint. - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param actorId Actor ID or a tilde-separated owner's username and Actor name. - @param versionNumber Actor version. - @return ApiActVersionPutRequest -*/ -func (a *ActorsActorVersionsAPIService) ActVersionPut(ctx context.Context, actorId string, versionNumber string) ApiActVersionPutRequest { - return ApiActVersionPutRequest{ - ApiService: a, - ctx: ctx, - actorId: actorId, - versionNumber: versionNumber, - } -} - -// Execute executes the request -// @return VersionResponse -func (a *ActorsActorVersionsAPIService) ActVersionPutExecute(r ApiActVersionPutRequest) (*VersionResponse, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodPut - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *VersionResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ActorsActorVersionsAPIService.ActVersionPut") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/actors/{actorId}/versions/{versionNumber}" - localVarPath = strings.Replace(localVarPath, "{"+"actorId"+"}", url.PathEscape(parameterValueToString(r.actorId, "actorId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"versionNumber"+"}", url.PathEscape(parameterValueToString(r.versionNumber, "versionNumber")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - if r.createOrUpdateVersionRequest == nil { - return localVarReturnValue, nil, reportError("createOrUpdateVersionRequest is required and must be specified") - } - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/json"} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - // body params - localVarPostBody = r.createOrUpdateVersionRequest - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 413 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 415 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiActVersionsGetRequest struct { - ctx context.Context - ApiService *ActorsActorVersionsAPIService - actorId string -} - -func (r ApiActVersionsGetRequest) Execute() (*ListOfVersionsResponse, *http.Response, error) { - return r.ApiService.ActVersionsGetExecute(r) -} - -/* -ActVersionsGet Get list of versions - -Gets the list of versions of a specific Actor. The response is a JSON object -with the list of [Version objects](#/reference/actors/version-object), where each -contains basic information about a single version. - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param actorId Actor ID or a tilde-separated owner's username and Actor name. - @return ApiActVersionsGetRequest -*/ -func (a *ActorsActorVersionsAPIService) ActVersionsGet(ctx context.Context, actorId string) ApiActVersionsGetRequest { - return ApiActVersionsGetRequest{ - ApiService: a, - ctx: ctx, - actorId: actorId, - } -} - -// Execute executes the request -// @return ListOfVersionsResponse -func (a *ActorsActorVersionsAPIService) ActVersionsGetExecute(r ApiActVersionsGetRequest) (*ListOfVersionsResponse, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *ListOfVersionsResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ActorsActorVersionsAPIService.ActVersionsGet") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/actors/{actorId}/versions" - localVarPath = strings.Replace(localVarPath, "{"+"actorId"+"}", url.PathEscape(parameterValueToString(r.actorId, "actorId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiActVersionsPostRequest struct { - ctx context.Context - ApiService *ActorsActorVersionsAPIService - actorId string - createOrUpdateVersionRequest *CreateOrUpdateVersionRequest -} - -// -func (r ApiActVersionsPostRequest) CreateOrUpdateVersionRequest(createOrUpdateVersionRequest CreateOrUpdateVersionRequest) ApiActVersionsPostRequest { - r.createOrUpdateVersionRequest = &createOrUpdateVersionRequest - return r -} - -func (r ApiActVersionsPostRequest) Execute() (*VersionResponse, *http.Response, error) { - return r.ApiService.ActVersionsPostExecute(r) -} - -/* -ActVersionsPost Create version - -Creates a version of an Actor using values specified in a [Version -object](#/reference/actors/version-object) passed as JSON in the POST -payload. - -The request must specify `versionNumber` and `sourceType` parameters (as -strings) in the JSON payload and a `Content-Type: application/json` HTTP -header. - -Each `sourceType` requires its own additional properties to be passed to the -JSON payload object. These are outlined in the [Version -object](#/reference/actors/version-object) table below and in more detail in -the [Apify -documentation](https://docs.apify.com/platform/actors/development/deployment/source-types). - -For example, if an Actor's source code is stored in a [GitHub -repository](https://docs.apify.com/platform/actors/development/deployment/source-types#git-repository), -you will set the `sourceType` to `GIT_REPO` and pass the repository's URL in -the `gitRepoUrl` property. - -``` -{ - "versionNumber": "0.1", - "sourceType": "GIT_REPO", - "gitRepoUrl": "https://github.com/my-github-account/actor-repo" -} -``` - -The response is the [Version object](#/reference/actors/version-object) as -returned by the [Get version](#/reference/actors/version-object/get-version) endpoint. - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param actorId Actor ID or a tilde-separated owner's username and Actor name. - @return ApiActVersionsPostRequest -*/ -func (a *ActorsActorVersionsAPIService) ActVersionsPost(ctx context.Context, actorId string) ApiActVersionsPostRequest { - return ApiActVersionsPostRequest{ - ApiService: a, - ctx: ctx, - actorId: actorId, - } -} - -// Execute executes the request -// @return VersionResponse -func (a *ActorsActorVersionsAPIService) ActVersionsPostExecute(r ApiActVersionsPostRequest) (*VersionResponse, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodPost - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *VersionResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ActorsActorVersionsAPIService.ActVersionsPost") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/actors/{actorId}/versions" - localVarPath = strings.Replace(localVarPath, "{"+"actorId"+"}", url.PathEscape(parameterValueToString(r.actorId, "actorId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - if r.createOrUpdateVersionRequest == nil { - return localVarReturnValue, nil, reportError("createOrUpdateVersionRequest is required and must be specified") - } - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/json"} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - // body params - localVarPostBody = r.createOrUpdateVersionRequest - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 413 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 415 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} diff --git a/api_actors_webhook_collection.go b/api_actors_webhook_collection.go deleted file mode 100644 index e82c5fc..0000000 --- a/api_actors_webhook_collection.go +++ /dev/null @@ -1,244 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "bytes" - "context" - "io" - "net/http" - "net/url" - "strings" -) - - -// ActorsWebhookCollectionAPIService ActorsWebhookCollectionAPI service -type ActorsWebhookCollectionAPIService service - -type ApiActWebhooksGetRequest struct { - ctx context.Context - ApiService *ActorsWebhookCollectionAPIService - actorId string - offset *float64 - limit *float64 - desc *bool -} - -// Number of items that should be skipped at the start. The default value is `0`. -func (r ApiActWebhooksGetRequest) Offset(offset float64) ApiActWebhooksGetRequest { - r.offset = &offset - return r -} - -// Maximum number of items to return. The default value as well as the maximum is `1000`. -func (r ApiActWebhooksGetRequest) Limit(limit float64) ApiActWebhooksGetRequest { - r.limit = &limit - return r -} - -// If `true` or `1` then the objects are sorted by the `createdAt` field in descending order. By default, they are sorted in ascending order. -func (r ApiActWebhooksGetRequest) Desc(desc bool) ApiActWebhooksGetRequest { - r.desc = &desc - return r -} - -func (r ApiActWebhooksGetRequest) Execute() (*ListOfWebhooksResponse, *http.Response, error) { - return r.ApiService.ActWebhooksGetExecute(r) -} - -/* -ActWebhooksGet Get list of webhooks - -Gets the list of webhooks of a specific Actor. The response is a JSON with -the list of objects, where each object contains basic information about a single webhook. - -The endpoint supports pagination using the `limit` and `offset` parameters -and it will not return more than 1000 records. - -By default, the records are sorted by the `createdAt` field in ascending -order, to sort the records in descending order, use the `desc=1` parameter. - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param actorId Actor ID or a tilde-separated owner's username and Actor name. - @return ApiActWebhooksGetRequest -*/ -func (a *ActorsWebhookCollectionAPIService) ActWebhooksGet(ctx context.Context, actorId string) ApiActWebhooksGetRequest { - return ApiActWebhooksGetRequest{ - ApiService: a, - ctx: ctx, - actorId: actorId, - } -} - -// Execute executes the request -// @return ListOfWebhooksResponse -func (a *ActorsWebhookCollectionAPIService) ActWebhooksGetExecute(r ApiActWebhooksGetRequest) (*ListOfWebhooksResponse, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *ListOfWebhooksResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ActorsWebhookCollectionAPIService.ActWebhooksGet") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/actors/{actorId}/webhooks" - localVarPath = strings.Replace(localVarPath, "{"+"actorId"+"}", url.PathEscape(parameterValueToString(r.actorId, "actorId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if r.offset != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "form", "") - } - if r.limit != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "form", "") - } - if r.desc != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "desc", r.desc, "form", "") - } - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} diff --git a/api_default_dataset.go b/api_default_dataset.go deleted file mode 100644 index 2da8987..0000000 --- a/api_default_dataset.go +++ /dev/null @@ -1,1415 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "bytes" - "context" - "io" - "net/http" - "net/url" - "strings" -) - - -// DefaultDatasetAPIService DefaultDatasetAPI service -type DefaultDatasetAPIService service - -type ApiActorRunDatasetDeleteRequest struct { - ctx context.Context - ApiService *DefaultDatasetAPIService - runId string -} - -func (r ApiActorRunDatasetDeleteRequest) Execute() (*http.Response, error) { - return r.ApiService.ActorRunDatasetDeleteExecute(r) -} - -/* -ActorRunDatasetDelete Delete default dataset - -Deletes default dataset associated with an Actor run. - -This endpoint is a shortcut for getting the last run's `defaultDatasetId` and then using the -[ Delete dataset ](/api/v2/dataset-delete) endpoint. - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param runId Actor run ID. - @return ApiActorRunDatasetDeleteRequest -*/ -func (a *DefaultDatasetAPIService) ActorRunDatasetDelete(ctx context.Context, runId string) ApiActorRunDatasetDeleteRequest { - return ApiActorRunDatasetDeleteRequest{ - ApiService: a, - ctx: ctx, - runId: runId, - } -} - -// Execute executes the request -func (a *DefaultDatasetAPIService) ActorRunDatasetDeleteExecute(r ApiActorRunDatasetDeleteRequest) (*http.Response, error) { - var ( - localVarHTTPMethod = http.MethodDelete - localVarPostBody interface{} - formFiles []formFile - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultDatasetAPIService.ActorRunDatasetDelete") - if err != nil { - return nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/actor-runs/{runId}/dataset" - localVarPath = strings.Replace(localVarPath, "{"+"runId"+"}", url.PathEscape(parameterValueToString(r.runId, "runId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarHTTPResponse, newErr - } - - return localVarHTTPResponse, nil -} - -type ApiActorRunDatasetGetRequest struct { - ctx context.Context - ApiService *DefaultDatasetAPIService - runId string -} - -func (r ApiActorRunDatasetGetRequest) Execute() (*DatasetResponse, *http.Response, error) { - return r.ApiService.ActorRunDatasetGetExecute(r) -} - -/* -ActorRunDatasetGet Get default dataset - -Returns the default dataset associated with an Actor run. - -This endpoint is a shortcut for getting the run's `defaultDatasetId` and then using the -[Get dataset](/api/v2/dataset-get) endpoint. - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param runId Actor run ID. - @return ApiActorRunDatasetGetRequest -*/ -func (a *DefaultDatasetAPIService) ActorRunDatasetGet(ctx context.Context, runId string) ApiActorRunDatasetGetRequest { - return ApiActorRunDatasetGetRequest{ - ApiService: a, - ctx: ctx, - runId: runId, - } -} - -// Execute executes the request -// @return DatasetResponse -func (a *DefaultDatasetAPIService) ActorRunDatasetGetExecute(r ApiActorRunDatasetGetRequest) (*DatasetResponse, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *DatasetResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultDatasetAPIService.ActorRunDatasetGet") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/actor-runs/{runId}/dataset" - localVarPath = strings.Replace(localVarPath, "{"+"runId"+"}", url.PathEscape(parameterValueToString(r.runId, "runId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiActorRunDatasetItemsGetRequest struct { - ctx context.Context - ApiService *DefaultDatasetAPIService - runId string - format *string - clean *bool - offset *float64 - limit *float64 - fields *string - outputFields *string - omit *string - unwind *string - flatten *string - desc *bool - attachment *bool - delimiter *string - bom *bool - xmlRoot *string - xmlRow *string - skipHeaderRow *bool - skipHidden *bool - skipEmpty *bool - simplified *bool - view *string - skipFailedPages *bool - feedTitle *string - feedDescription *string - signature *string -} - -// Format of the results, possible values are: `json`, `jsonl`, `csv`, `html`, `xlsx`, `xml` and `rss`. The default value is `json`. -func (r ApiActorRunDatasetItemsGetRequest) Format(format string) ApiActorRunDatasetItemsGetRequest { - r.format = &format - return r -} - -// If `true` or `1` then the API endpoint returns only non-empty items and skips hidden fields (i.e. fields starting with the # character). The `clean` parameter is just a shortcut for `skipHidden=true` and `skipEmpty=true` parameters. Note that since some objects might be skipped from the output, that the result might contain less items than the `limit` value. -func (r ApiActorRunDatasetItemsGetRequest) Clean(clean bool) ApiActorRunDatasetItemsGetRequest { - r.clean = &clean - return r -} - -// Number of items that should be skipped at the start. The default value is `0`. -func (r ApiActorRunDatasetItemsGetRequest) Offset(offset float64) ApiActorRunDatasetItemsGetRequest { - r.offset = &offset - return r -} - -// Maximum number of items to return. By default there is no limit. -func (r ApiActorRunDatasetItemsGetRequest) Limit(limit float64) ApiActorRunDatasetItemsGetRequest { - r.limit = &limit - return r -} - -// A comma-separated list of fields which should be picked from the items, only these fields will remain in the resulting record objects. Note that the fields in the outputted items are sorted the same way as they are specified in the `fields` query parameter. You can use this feature to effectively fix the output format. -func (r ApiActorRunDatasetItemsGetRequest) Fields(fields string) ApiActorRunDatasetItemsGetRequest { - r.fields = &fields - return r -} - -// A comma-separated list of output field names that positionally rename the fields specified in the `fields` parameter. For example, `?fields=headline,url&outputFields=title,link` renames `headline` to `title` and `url` to `link` in the output. The number of names in `outputFields` must match the number of names in `fields`. Requires the `fields` parameter to be specified as well. -func (r ApiActorRunDatasetItemsGetRequest) OutputFields(outputFields string) ApiActorRunDatasetItemsGetRequest { - r.outputFields = &outputFields - return r -} - -// A comma-separated list of fields which should be omitted from the items. -func (r ApiActorRunDatasetItemsGetRequest) Omit(omit string) ApiActorRunDatasetItemsGetRequest { - r.omit = &omit - return r -} - -// A comma-separated list of fields which should be unwound, in order which they should be processed. Each field should be either an array or an object. If the field is an array then every element of the array will become a separate record and merged with parent object. If the unwound field is an object then it is merged with the parent object. If the unwound field is missing or its value is neither an array nor an object and therefore cannot be merged with a parent object then the item gets preserved as it is. Note that the unwound items ignore the `desc` parameter. -func (r ApiActorRunDatasetItemsGetRequest) Unwind(unwind string) ApiActorRunDatasetItemsGetRequest { - r.unwind = &unwind - return r -} - -// A comma-separated list of fields which should transform nested objects into flat structures. For example, with `flatten=\"foo\"` the object `{\"foo\":{\"bar\": \"hello\"}}` is turned into `{\"foo.bar\": \"hello\"}`. The original object with properties is replaced with the flattened object. -func (r ApiActorRunDatasetItemsGetRequest) Flatten(flatten string) ApiActorRunDatasetItemsGetRequest { - r.flatten = &flatten - return r -} - -// By default, results are returned in the same order as they were stored. To reverse the order, set this parameter to `true` or `1`. -func (r ApiActorRunDatasetItemsGetRequest) Desc(desc bool) ApiActorRunDatasetItemsGetRequest { - r.desc = &desc - return r -} - -// If `true` or `1` then the response will define the `Content-Disposition: attachment` header, forcing a web browser to download the file rather than to display it. By default this header is not present. -func (r ApiActorRunDatasetItemsGetRequest) Attachment(attachment bool) ApiActorRunDatasetItemsGetRequest { - r.attachment = &attachment - return r -} - -// A delimiter character for CSV files, only used if `format=csv`. You might need to URL-encode the character (e.g. use `%09` for tab or `%3B` for semicolon). The default delimiter is a simple comma (`,`). -func (r ApiActorRunDatasetItemsGetRequest) Delimiter(delimiter string) ApiActorRunDatasetItemsGetRequest { - r.delimiter = &delimiter - return r -} - -// All text responses are encoded in UTF-8 encoding. By default, the `format=csv` files are prefixed with the UTF-8 Byte Order Mark (BOM), while `json`, `jsonl`, `xml`, `html` and `rss` files are not. If you want to override this default behavior, specify `bom=1` query parameter to include the BOM or `bom=0` to skip it. -func (r ApiActorRunDatasetItemsGetRequest) Bom(bom bool) ApiActorRunDatasetItemsGetRequest { - r.bom = &bom - return r -} - -// Overrides default root element name of `xml` output. By default the root element is `items`. -func (r ApiActorRunDatasetItemsGetRequest) XmlRoot(xmlRoot string) ApiActorRunDatasetItemsGetRequest { - r.xmlRoot = &xmlRoot - return r -} - -// Overrides default element name that wraps each page or page function result object in `xml` output. By default the element name is `item`. -func (r ApiActorRunDatasetItemsGetRequest) XmlRow(xmlRow string) ApiActorRunDatasetItemsGetRequest { - r.xmlRow = &xmlRow - return r -} - -// If `true` or `1` then header row in the `csv` format is skipped. -func (r ApiActorRunDatasetItemsGetRequest) SkipHeaderRow(skipHeaderRow bool) ApiActorRunDatasetItemsGetRequest { - r.skipHeaderRow = &skipHeaderRow - return r -} - -// If `true` or `1` then hidden fields are skipped from the output, i.e. fields starting with the `#` character. -func (r ApiActorRunDatasetItemsGetRequest) SkipHidden(skipHidden bool) ApiActorRunDatasetItemsGetRequest { - r.skipHidden = &skipHidden - return r -} - -// If `true` or `1` then empty items are skipped from the output. Note that if used, the results might contain less items than the limit value. -func (r ApiActorRunDatasetItemsGetRequest) SkipEmpty(skipEmpty bool) ApiActorRunDatasetItemsGetRequest { - r.skipEmpty = &skipEmpty - return r -} - -// If `true` or `1` then, the endpoint applies the `fields=url,pageFunctionResult,errorInfo` and `unwind=pageFunctionResult` query parameters. This feature is used to emulate simplified results provided by the legacy Apify Crawler product and it's not recommended to use it in new integrations. -func (r ApiActorRunDatasetItemsGetRequest) Simplified(simplified bool) ApiActorRunDatasetItemsGetRequest { - r.simplified = &simplified - return r -} - -// Defines the view configuration for dataset items based on the schema definition. This parameter determines how the data will be filtered and presented. For complete specification details, see the [dataset schema documentation](/platform/actors/development/actor-definition/dataset-schema). -func (r ApiActorRunDatasetItemsGetRequest) View(view string) ApiActorRunDatasetItemsGetRequest { - r.view = &view - return r -} - -// If `true` or `1` then, the all the items with errorInfo property will be skipped from the output. This feature is here to emulate functionality of API version 1 used for the legacy Apify Crawler product and it's not recommended to use it in new integrations. -func (r ApiActorRunDatasetItemsGetRequest) SkipFailedPages(skipFailedPages bool) ApiActorRunDatasetItemsGetRequest { - r.skipFailedPages = &skipFailedPages - return r -} - -// Overrides the auto-generated RSS channel `<title>` element. Only used when `format=rss`. If not provided, the title defaults to `Dataset <label>`. -func (r ApiActorRunDatasetItemsGetRequest) FeedTitle(feedTitle string) ApiActorRunDatasetItemsGetRequest { - r.feedTitle = &feedTitle - return r -} - -// Overrides the auto-generated RSS channel `<description>` element. Only used when `format=rss`. If not provided, the description defaults to `Items in dataset with id \"<datasetId>\".` -func (r ApiActorRunDatasetItemsGetRequest) FeedDescription(feedDescription string) ApiActorRunDatasetItemsGetRequest { - r.feedDescription = &feedDescription - return r -} - -// Signature used for the access. -func (r ApiActorRunDatasetItemsGetRequest) Signature(signature string) ApiActorRunDatasetItemsGetRequest { - r.signature = &signature - return r -} - -func (r ApiActorRunDatasetItemsGetRequest) Execute() ([]map[string]interface{}, *http.Response, error) { - return r.ApiService.ActorRunDatasetItemsGetExecute(r) -} - -/* -ActorRunDatasetItemsGet Get default dataset items - -Returns data stored in the default dataset of the Actor run in the desired format. - -This endpoint is a shortcut that resolves the run's `defaultDatasetId` and proxies to the -[Get dataset items](/api/v2/dataset-items-get) endpoint. - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param runId Actor run ID. - @return ApiActorRunDatasetItemsGetRequest -*/ -func (a *DefaultDatasetAPIService) ActorRunDatasetItemsGet(ctx context.Context, runId string) ApiActorRunDatasetItemsGetRequest { - return ApiActorRunDatasetItemsGetRequest{ - ApiService: a, - ctx: ctx, - runId: runId, - } -} - -// Execute executes the request -// @return []map[string]interface{} -func (a *DefaultDatasetAPIService) ActorRunDatasetItemsGetExecute(r ApiActorRunDatasetItemsGetRequest) ([]map[string]interface{}, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue []map[string]interface{} - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultDatasetAPIService.ActorRunDatasetItemsGet") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/actor-runs/{runId}/dataset/items" - localVarPath = strings.Replace(localVarPath, "{"+"runId"+"}", url.PathEscape(parameterValueToString(r.runId, "runId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if r.format != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "format", r.format, "form", "") - } - if r.clean != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "clean", r.clean, "form", "") - } - if r.offset != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "form", "") - } - if r.limit != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "form", "") - } - if r.fields != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "fields", r.fields, "form", "") - } - if r.outputFields != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "outputFields", r.outputFields, "form", "") - } - if r.omit != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "omit", r.omit, "form", "") - } - if r.unwind != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "unwind", r.unwind, "form", "") - } - if r.flatten != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "flatten", r.flatten, "form", "") - } - if r.desc != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "desc", r.desc, "form", "") - } - if r.attachment != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "attachment", r.attachment, "form", "") - } - if r.delimiter != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "delimiter", r.delimiter, "form", "") - } - if r.bom != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "bom", r.bom, "form", "") - } - if r.xmlRoot != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "xmlRoot", r.xmlRoot, "form", "") - } - if r.xmlRow != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "xmlRow", r.xmlRow, "form", "") - } - if r.skipHeaderRow != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "skipHeaderRow", r.skipHeaderRow, "form", "") - } - if r.skipHidden != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "skipHidden", r.skipHidden, "form", "") - } - if r.skipEmpty != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "skipEmpty", r.skipEmpty, "form", "") - } - if r.simplified != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "simplified", r.simplified, "form", "") - } - if r.view != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "view", r.view, "form", "") - } - if r.skipFailedPages != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "skipFailedPages", r.skipFailedPages, "form", "") - } - if r.feedTitle != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "feedTitle", r.feedTitle, "form", "") - } - if r.feedDescription != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "feedDescription", r.feedDescription, "form", "") - } - if r.signature != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "signature", r.signature, "form", "") - } - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json", "application/jsonl", "text/csv", "text/html", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", "application/rss+xml", "application/xml"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiActorRunDatasetItemsPostRequest struct { - ctx context.Context - ApiService *DefaultDatasetAPIService - runId string - actRunsLastDatasetItemsPostRequest *ActRunsLastDatasetItemsPostRequest -} - -// -func (r ApiActorRunDatasetItemsPostRequest) ActRunsLastDatasetItemsPostRequest(actRunsLastDatasetItemsPostRequest ActRunsLastDatasetItemsPostRequest) ApiActorRunDatasetItemsPostRequest { - r.actRunsLastDatasetItemsPostRequest = &actRunsLastDatasetItemsPostRequest - return r -} - -func (r ApiActorRunDatasetItemsPostRequest) Execute() (map[string]interface{}, *http.Response, error) { - return r.ApiService.ActorRunDatasetItemsPostExecute(r) -} - -/* -ActorRunDatasetItemsPost Store items - -Appends an item or an array of items to the end of the Actor run's default dataset. - -This endpoint is a shortcut that resolves the run's `defaultDatasetId` and proxies to the -[Store items](/api/v2/dataset-items-post) endpoint. - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param runId Actor run ID. - @return ApiActorRunDatasetItemsPostRequest -*/ -func (a *DefaultDatasetAPIService) ActorRunDatasetItemsPost(ctx context.Context, runId string) ApiActorRunDatasetItemsPostRequest { - return ApiActorRunDatasetItemsPostRequest{ - ApiService: a, - ctx: ctx, - runId: runId, - } -} - -// Execute executes the request -// @return map[string]interface{} -func (a *DefaultDatasetAPIService) ActorRunDatasetItemsPostExecute(r ApiActorRunDatasetItemsPostRequest) (map[string]interface{}, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodPost - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue map[string]interface{} - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultDatasetAPIService.ActorRunDatasetItemsPost") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/actor-runs/{runId}/dataset/items" - localVarPath = strings.Replace(localVarPath, "{"+"runId"+"}", url.PathEscape(parameterValueToString(r.runId, "runId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - if r.actRunsLastDatasetItemsPostRequest == nil { - return localVarReturnValue, nil, reportError("actRunsLastDatasetItemsPostRequest is required and must be specified") - } - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/json"} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - // body params - localVarPostBody = r.actRunsLastDatasetItemsPostRequest - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ActRunsLastDatasetItemsPost400Response - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiActorRunDatasetPutRequest struct { - ctx context.Context - ApiService *DefaultDatasetAPIService - runId string - updateDatasetRequest *UpdateDatasetRequest -} - -// -func (r ApiActorRunDatasetPutRequest) UpdateDatasetRequest(updateDatasetRequest UpdateDatasetRequest) ApiActorRunDatasetPutRequest { - r.updateDatasetRequest = &updateDatasetRequest - return r -} - -func (r ApiActorRunDatasetPutRequest) Execute() (*DatasetResponse, *http.Response, error) { - return r.ApiService.ActorRunDatasetPutExecute(r) -} - -/* -ActorRunDatasetPut Update default dataset - -Updates the default dataset associated with an Actor run. - -This endpoint is a shortcut for getting the run's `defaultDatasetId` and then using the -[Put dataset](/api/v2/dataset-put) endpoint. - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param runId Actor run ID. - @return ApiActorRunDatasetPutRequest -*/ -func (a *DefaultDatasetAPIService) ActorRunDatasetPut(ctx context.Context, runId string) ApiActorRunDatasetPutRequest { - return ApiActorRunDatasetPutRequest{ - ApiService: a, - ctx: ctx, - runId: runId, - } -} - -// Execute executes the request -// @return DatasetResponse -func (a *DefaultDatasetAPIService) ActorRunDatasetPutExecute(r ApiActorRunDatasetPutRequest) (*DatasetResponse, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodPut - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *DatasetResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultDatasetAPIService.ActorRunDatasetPut") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/actor-runs/{runId}/dataset" - localVarPath = strings.Replace(localVarPath, "{"+"runId"+"}", url.PathEscape(parameterValueToString(r.runId, "runId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - if r.updateDatasetRequest == nil { - return localVarReturnValue, nil, reportError("updateDatasetRequest is required and must be specified") - } - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/json"} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - // body params - localVarPostBody = r.updateDatasetRequest - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 413 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 415 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiActorRunDatasetStatisticsGetRequest struct { - ctx context.Context - ApiService *DefaultDatasetAPIService - runId string -} - -func (r ApiActorRunDatasetStatisticsGetRequest) Execute() (*DatasetStatisticsResponse, *http.Response, error) { - return r.ApiService.ActorRunDatasetStatisticsGetExecute(r) -} - -/* -ActorRunDatasetStatisticsGet Get default dataset statistics - -Returns statistics for the Actor run's default dataset. - -This endpoint is a shortcut that resolves the run's `defaultDatasetId` and proxies to the -[Get dataset statistics](/api/v2/dataset-statistics-get) endpoint. - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param runId Actor run ID. - @return ApiActorRunDatasetStatisticsGetRequest -*/ -func (a *DefaultDatasetAPIService) ActorRunDatasetStatisticsGet(ctx context.Context, runId string) ApiActorRunDatasetStatisticsGetRequest { - return ApiActorRunDatasetStatisticsGetRequest{ - ApiService: a, - ctx: ctx, - runId: runId, - } -} - -// Execute executes the request -// @return DatasetStatisticsResponse -func (a *DefaultDatasetAPIService) ActorRunDatasetStatisticsGetExecute(r ApiActorRunDatasetStatisticsGetRequest) (*DatasetStatisticsResponse, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *DatasetStatisticsResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultDatasetAPIService.ActorRunDatasetStatisticsGet") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/actor-runs/{runId}/dataset/statistics" - localVarPath = strings.Replace(localVarPath, "{"+"runId"+"}", url.PathEscape(parameterValueToString(r.runId, "runId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} diff --git a/api_default_key_value_store.go b/api_default_key_value_store.go deleted file mode 100644 index b41f89f..0000000 --- a/api_default_key_value_store.go +++ /dev/null @@ -1,1921 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "bytes" - "context" - "io" - "net/http" - "net/url" - "strings" - "os" -) - - -// DefaultKeyValueStoreAPIService DefaultKeyValueStoreAPI service -type DefaultKeyValueStoreAPIService service - -type ApiActorRunKeyValueStoreDeleteRequest struct { - ctx context.Context - ApiService *DefaultKeyValueStoreAPIService - runId string -} - -func (r ApiActorRunKeyValueStoreDeleteRequest) Execute() (*http.Response, error) { - return r.ApiService.ActorRunKeyValueStoreDeleteExecute(r) -} - -/* -ActorRunKeyValueStoreDelete Delete default store - -Delete the default key-value store. - -This endpoint is a shortcut for getting the run's `defaultKeyValueStoreId` and then using the -[Delete store](/api/v2/key-value-store-delete) endpoint. - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param runId Actor run ID. - @return ApiActorRunKeyValueStoreDeleteRequest -*/ -func (a *DefaultKeyValueStoreAPIService) ActorRunKeyValueStoreDelete(ctx context.Context, runId string) ApiActorRunKeyValueStoreDeleteRequest { - return ApiActorRunKeyValueStoreDeleteRequest{ - ApiService: a, - ctx: ctx, - runId: runId, - } -} - -// Execute executes the request -func (a *DefaultKeyValueStoreAPIService) ActorRunKeyValueStoreDeleteExecute(r ApiActorRunKeyValueStoreDeleteRequest) (*http.Response, error) { - var ( - localVarHTTPMethod = http.MethodDelete - localVarPostBody interface{} - formFiles []formFile - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultKeyValueStoreAPIService.ActorRunKeyValueStoreDelete") - if err != nil { - return nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/actor-runs/{runId}/key-value-store" - localVarPath = strings.Replace(localVarPath, "{"+"runId"+"}", url.PathEscape(parameterValueToString(r.runId, "runId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarHTTPResponse, newErr - } - - return localVarHTTPResponse, nil -} - -type ApiActorRunKeyValueStoreGetRequest struct { - ctx context.Context - ApiService *DefaultKeyValueStoreAPIService - runId string -} - -func (r ApiActorRunKeyValueStoreGetRequest) Execute() (*KeyValueStoreResponse, *http.Response, error) { - return r.ApiService.ActorRunKeyValueStoreGetExecute(r) -} - -/* -ActorRunKeyValueStoreGet Get default store - -Gets an object that contains all the details about the default key-value -store. - -This endpoint is a shortcut for getting the run's `defaultKeyValueStoreId` and then using the -[Get store](/api/v2/key-value-store-get) endpoint. - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param runId Actor run ID. - @return ApiActorRunKeyValueStoreGetRequest -*/ -func (a *DefaultKeyValueStoreAPIService) ActorRunKeyValueStoreGet(ctx context.Context, runId string) ApiActorRunKeyValueStoreGetRequest { - return ApiActorRunKeyValueStoreGetRequest{ - ApiService: a, - ctx: ctx, - runId: runId, - } -} - -// Execute executes the request -// @return KeyValueStoreResponse -func (a *DefaultKeyValueStoreAPIService) ActorRunKeyValueStoreGetExecute(r ApiActorRunKeyValueStoreGetRequest) (*KeyValueStoreResponse, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *KeyValueStoreResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultKeyValueStoreAPIService.ActorRunKeyValueStoreGet") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/actor-runs/{runId}/key-value-store" - localVarPath = strings.Replace(localVarPath, "{"+"runId"+"}", url.PathEscape(parameterValueToString(r.runId, "runId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiActorRunKeyValueStoreKeysGetRequest struct { - ctx context.Context - ApiService *DefaultKeyValueStoreAPIService - runId string - exclusiveStartKey *string - limit *float32 - collection *string - prefix *string - signature *string -} - -// All keys up to this one (including) are skipped from the result. -func (r ApiActorRunKeyValueStoreKeysGetRequest) ExclusiveStartKey(exclusiveStartKey string) ApiActorRunKeyValueStoreKeysGetRequest { - r.exclusiveStartKey = &exclusiveStartKey - return r -} - -// Number of keys to be returned. -func (r ApiActorRunKeyValueStoreKeysGetRequest) Limit(limit float32) ApiActorRunKeyValueStoreKeysGetRequest { - r.limit = &limit - return r -} - -// Limit the results to keys that belong to a specific collection from the key-value store schema. The key-value store need to have a schema defined for this parameter to work. -func (r ApiActorRunKeyValueStoreKeysGetRequest) Collection(collection string) ApiActorRunKeyValueStoreKeysGetRequest { - r.collection = &collection - return r -} - -// Limit the results to keys that start with a specific prefix. -func (r ApiActorRunKeyValueStoreKeysGetRequest) Prefix(prefix string) ApiActorRunKeyValueStoreKeysGetRequest { - r.prefix = &prefix - return r -} - -// Signature used for the access. -func (r ApiActorRunKeyValueStoreKeysGetRequest) Signature(signature string) ApiActorRunKeyValueStoreKeysGetRequest { - r.signature = &signature - return r -} - -func (r ApiActorRunKeyValueStoreKeysGetRequest) Execute() (*ListOfKeysResponse, *http.Response, error) { - return r.ApiService.ActorRunKeyValueStoreKeysGetExecute(r) -} - -/* -ActorRunKeyValueStoreKeysGet Get default store's list of keys - -Returns a list of keys for the default key-value store of the Actor run. - -This endpoint is a shortcut for getting the run's `defaultKeyValueStoreId` and then using the -[Get list of keys](/api/v2/key-value-store-keys-get) endpoint. - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param runId Actor run ID. - @return ApiActorRunKeyValueStoreKeysGetRequest -*/ -func (a *DefaultKeyValueStoreAPIService) ActorRunKeyValueStoreKeysGet(ctx context.Context, runId string) ApiActorRunKeyValueStoreKeysGetRequest { - return ApiActorRunKeyValueStoreKeysGetRequest{ - ApiService: a, - ctx: ctx, - runId: runId, - } -} - -// Execute executes the request -// @return ListOfKeysResponse -func (a *DefaultKeyValueStoreAPIService) ActorRunKeyValueStoreKeysGetExecute(r ApiActorRunKeyValueStoreKeysGetRequest) (*ListOfKeysResponse, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *ListOfKeysResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultKeyValueStoreAPIService.ActorRunKeyValueStoreKeysGet") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/actor-runs/{runId}/key-value-store/keys" - localVarPath = strings.Replace(localVarPath, "{"+"runId"+"}", url.PathEscape(parameterValueToString(r.runId, "runId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if r.exclusiveStartKey != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "exclusiveStartKey", r.exclusiveStartKey, "form", "") - } - if r.limit != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "form", "") - } else { - var defaultValue float32 = 1000 - parameterAddToHeaderOrQuery(localVarQueryParams, "limit", defaultValue, "form", "") - r.limit = &defaultValue - } - if r.collection != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "collection", r.collection, "form", "") - } - if r.prefix != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "prefix", r.prefix, "form", "") - } - if r.signature != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "signature", r.signature, "form", "") - } - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiActorRunKeyValueStorePutRequest struct { - ctx context.Context - ApiService *DefaultKeyValueStoreAPIService - runId string - updateStoreRequest *UpdateStoreRequest -} - -// -func (r ApiActorRunKeyValueStorePutRequest) UpdateStoreRequest(updateStoreRequest UpdateStoreRequest) ApiActorRunKeyValueStorePutRequest { - r.updateStoreRequest = &updateStoreRequest - return r -} - -func (r ApiActorRunKeyValueStorePutRequest) Execute() (*KeyValueStoreResponse, *http.Response, error) { - return r.ApiService.ActorRunKeyValueStorePutExecute(r) -} - -/* -ActorRunKeyValueStorePut Update default store - -Updates the default key-value store's name and general resource access level using a value specified by a JSON object -passed in the PUT payload. - -This endpoint is a shortcut for getting the run's `defaultKeyValueStoreId` and then using the -[Update store](/api/v2/key-value-store-put) endpoint. - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param runId Actor run ID. - @return ApiActorRunKeyValueStorePutRequest -*/ -func (a *DefaultKeyValueStoreAPIService) ActorRunKeyValueStorePut(ctx context.Context, runId string) ApiActorRunKeyValueStorePutRequest { - return ApiActorRunKeyValueStorePutRequest{ - ApiService: a, - ctx: ctx, - runId: runId, - } -} - -// Execute executes the request -// @return KeyValueStoreResponse -func (a *DefaultKeyValueStoreAPIService) ActorRunKeyValueStorePutExecute(r ApiActorRunKeyValueStorePutRequest) (*KeyValueStoreResponse, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodPut - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *KeyValueStoreResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultKeyValueStoreAPIService.ActorRunKeyValueStorePut") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/actor-runs/{runId}/key-value-store" - localVarPath = strings.Replace(localVarPath, "{"+"runId"+"}", url.PathEscape(parameterValueToString(r.runId, "runId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - if r.updateStoreRequest == nil { - return localVarReturnValue, nil, reportError("updateStoreRequest is required and must be specified") - } - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/json"} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - // body params - localVarPostBody = r.updateStoreRequest - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 413 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 415 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiActorRunKeyValueStoreRecordDeleteRequest struct { - ctx context.Context - ApiService *DefaultKeyValueStoreAPIService - runId string - recordKey string -} - -func (r ApiActorRunKeyValueStoreRecordDeleteRequest) Execute() (*http.Response, error) { - return r.ApiService.ActorRunKeyValueStoreRecordDeleteExecute(r) -} - -/* -ActorRunKeyValueStoreRecordDelete Delete default store's record - -Removes a record specified by a key from the default key-value store of the Actor run. - -This endpoint is a shortcut for getting the run's `defaultKeyValueStoreId` and then using the -[Delete record](/api/v2/key-value-store-record-delete) endpoint. - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param runId Actor run ID. - @param recordKey Key of the record. - @return ApiActorRunKeyValueStoreRecordDeleteRequest -*/ -func (a *DefaultKeyValueStoreAPIService) ActorRunKeyValueStoreRecordDelete(ctx context.Context, runId string, recordKey string) ApiActorRunKeyValueStoreRecordDeleteRequest { - return ApiActorRunKeyValueStoreRecordDeleteRequest{ - ApiService: a, - ctx: ctx, - runId: runId, - recordKey: recordKey, - } -} - -// Execute executes the request -func (a *DefaultKeyValueStoreAPIService) ActorRunKeyValueStoreRecordDeleteExecute(r ApiActorRunKeyValueStoreRecordDeleteRequest) (*http.Response, error) { - var ( - localVarHTTPMethod = http.MethodDelete - localVarPostBody interface{} - formFiles []formFile - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultKeyValueStoreAPIService.ActorRunKeyValueStoreRecordDelete") - if err != nil { - return nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/actor-runs/{runId}/key-value-store/records/{recordKey}" - localVarPath = strings.Replace(localVarPath, "{"+"runId"+"}", url.PathEscape(parameterValueToString(r.runId, "runId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"recordKey"+"}", url.PathEscape(parameterValueToString(r.recordKey, "recordKey")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarHTTPResponse, newErr - } - - return localVarHTTPResponse, nil -} - -type ApiActorRunKeyValueStoreRecordGetRequest struct { - ctx context.Context - ApiService *DefaultKeyValueStoreAPIService - runId string - recordKey string - signature *string - attachment *bool -} - -// Signature used for the access. -func (r ApiActorRunKeyValueStoreRecordGetRequest) Signature(signature string) ApiActorRunKeyValueStoreRecordGetRequest { - r.signature = &signature - return r -} - -// If `true` or `1`, the response will be served with `Content-Disposition: attachment` header, causing web browsers to offer downloading HTML records instead of displaying them. -func (r ApiActorRunKeyValueStoreRecordGetRequest) Attachment(attachment bool) ApiActorRunKeyValueStoreRecordGetRequest { - r.attachment = &attachment - return r -} - -func (r ApiActorRunKeyValueStoreRecordGetRequest) Execute() (map[string]interface{}, *http.Response, error) { - return r.ApiService.ActorRunKeyValueStoreRecordGetExecute(r) -} - -/* -ActorRunKeyValueStoreRecordGet Get default store's record - -Gets a value stored under a specific key in the default key-value store of the Actor run. - -This endpoint is a shortcut for getting the run's `defaultKeyValueStoreId` and then using the -[Get record](/api/v2/key-value-store-record-get) endpoint. - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param runId Actor run ID. - @param recordKey Key of the record. - @return ApiActorRunKeyValueStoreRecordGetRequest -*/ -func (a *DefaultKeyValueStoreAPIService) ActorRunKeyValueStoreRecordGet(ctx context.Context, runId string, recordKey string) ApiActorRunKeyValueStoreRecordGetRequest { - return ApiActorRunKeyValueStoreRecordGetRequest{ - ApiService: a, - ctx: ctx, - runId: runId, - recordKey: recordKey, - } -} - -// Execute executes the request -// @return map[string]interface{} -func (a *DefaultKeyValueStoreAPIService) ActorRunKeyValueStoreRecordGetExecute(r ApiActorRunKeyValueStoreRecordGetRequest) (map[string]interface{}, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue map[string]interface{} - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultKeyValueStoreAPIService.ActorRunKeyValueStoreRecordGet") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/actor-runs/{runId}/key-value-store/records/{recordKey}" - localVarPath = strings.Replace(localVarPath, "{"+"runId"+"}", url.PathEscape(parameterValueToString(r.runId, "runId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"recordKey"+"}", url.PathEscape(parameterValueToString(r.recordKey, "recordKey")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if r.signature != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "signature", r.signature, "form", "") - } - if r.attachment != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "attachment", r.attachment, "form", "") - } - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json", "*/*"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiActorRunKeyValueStoreRecordPostRequest struct { - ctx context.Context - ApiService *DefaultKeyValueStoreAPIService - runId string - recordKey string - requestBody *map[string]interface{} - contentEncoding *string -} - -// -func (r ApiActorRunKeyValueStoreRecordPostRequest) RequestBody(requestBody map[string]interface{}) ApiActorRunKeyValueStoreRecordPostRequest { - r.requestBody = &requestBody - return r -} - -// -func (r ApiActorRunKeyValueStoreRecordPostRequest) ContentEncoding(contentEncoding string) ApiActorRunKeyValueStoreRecordPostRequest { - r.contentEncoding = &contentEncoding - return r -} - -func (r ApiActorRunKeyValueStoreRecordPostRequest) Execute() (map[string]interface{}, *http.Response, error) { - return r.ApiService.ActorRunKeyValueStoreRecordPostExecute(r) -} - -/* -ActorRunKeyValueStoreRecordPost Store record in default store (POST) - -Stores a value under a specific key in the default key-value store of the Actor run. - -This endpoint is a shortcut for getting the run's `defaultKeyValueStoreId` and then using the -[Store record](/api/v2/key-value-store-record-post) endpoint. - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param runId Actor run ID. - @param recordKey Key of the record. - @return ApiActorRunKeyValueStoreRecordPostRequest -*/ -func (a *DefaultKeyValueStoreAPIService) ActorRunKeyValueStoreRecordPost(ctx context.Context, runId string, recordKey string) ApiActorRunKeyValueStoreRecordPostRequest { - return ApiActorRunKeyValueStoreRecordPostRequest{ - ApiService: a, - ctx: ctx, - runId: runId, - recordKey: recordKey, - } -} - -// Execute executes the request -// @return map[string]interface{} -func (a *DefaultKeyValueStoreAPIService) ActorRunKeyValueStoreRecordPostExecute(r ApiActorRunKeyValueStoreRecordPostRequest) (map[string]interface{}, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodPost - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue map[string]interface{} - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultKeyValueStoreAPIService.ActorRunKeyValueStoreRecordPost") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/actor-runs/{runId}/key-value-store/records/{recordKey}" - localVarPath = strings.Replace(localVarPath, "{"+"runId"+"}", url.PathEscape(parameterValueToString(r.runId, "runId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"recordKey"+"}", url.PathEscape(parameterValueToString(r.recordKey, "recordKey")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - if r.requestBody == nil { - return localVarReturnValue, nil, reportError("requestBody is required and must be specified") - } - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/json"} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - if r.contentEncoding != nil { - parameterAddToHeaderOrQuery(localVarHeaderParams, "Content-Encoding", r.contentEncoding, "simple", "") - } - // body params - localVarPostBody = r.requestBody - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 413 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 415 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiActorRunKeyValueStoreRecordPutRequest struct { - ctx context.Context - ApiService *DefaultKeyValueStoreAPIService - runId string - recordKey string - requestBody *map[string]interface{} - contentEncoding *string -} - -// -func (r ApiActorRunKeyValueStoreRecordPutRequest) RequestBody(requestBody map[string]interface{}) ApiActorRunKeyValueStoreRecordPutRequest { - r.requestBody = &requestBody - return r -} - -// -func (r ApiActorRunKeyValueStoreRecordPutRequest) ContentEncoding(contentEncoding string) ApiActorRunKeyValueStoreRecordPutRequest { - r.contentEncoding = &contentEncoding - return r -} - -func (r ApiActorRunKeyValueStoreRecordPutRequest) Execute() (map[string]interface{}, *http.Response, error) { - return r.ApiService.ActorRunKeyValueStoreRecordPutExecute(r) -} - -/* -ActorRunKeyValueStoreRecordPut Store record in default store - -Stores a value under a specific key in the default key-value store of the Actor run. - -This endpoint is a shortcut for getting the run's `defaultKeyValueStoreId` and then using the -[Store record](/api/v2/key-value-store-record-put) endpoint. - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param runId Actor run ID. - @param recordKey Key of the record. - @return ApiActorRunKeyValueStoreRecordPutRequest -*/ -func (a *DefaultKeyValueStoreAPIService) ActorRunKeyValueStoreRecordPut(ctx context.Context, runId string, recordKey string) ApiActorRunKeyValueStoreRecordPutRequest { - return ApiActorRunKeyValueStoreRecordPutRequest{ - ApiService: a, - ctx: ctx, - runId: runId, - recordKey: recordKey, - } -} - -// Execute executes the request -// @return map[string]interface{} -func (a *DefaultKeyValueStoreAPIService) ActorRunKeyValueStoreRecordPutExecute(r ApiActorRunKeyValueStoreRecordPutRequest) (map[string]interface{}, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodPut - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue map[string]interface{} - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultKeyValueStoreAPIService.ActorRunKeyValueStoreRecordPut") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/actor-runs/{runId}/key-value-store/records/{recordKey}" - localVarPath = strings.Replace(localVarPath, "{"+"runId"+"}", url.PathEscape(parameterValueToString(r.runId, "runId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"recordKey"+"}", url.PathEscape(parameterValueToString(r.recordKey, "recordKey")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - if r.requestBody == nil { - return localVarReturnValue, nil, reportError("requestBody is required and must be specified") - } - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/json"} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - if r.contentEncoding != nil { - parameterAddToHeaderOrQuery(localVarHeaderParams, "Content-Encoding", r.contentEncoding, "simple", "") - } - // body params - localVarPostBody = r.requestBody - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 413 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 415 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiActorRunKeyValueStoreRecordsGetRequest struct { - ctx context.Context - ApiService *DefaultKeyValueStoreAPIService - runId string - collection *string - prefix *string - signature *string -} - -// If specified, only records belonging to a specific collection from the key-value store schema. The key-value store need to have a schema defined for this parameter to work. -func (r ApiActorRunKeyValueStoreRecordsGetRequest) Collection(collection string) ApiActorRunKeyValueStoreRecordsGetRequest { - r.collection = &collection - return r -} - -// If specified, only records whose key starts with the given prefix are included in the archive. -func (r ApiActorRunKeyValueStoreRecordsGetRequest) Prefix(prefix string) ApiActorRunKeyValueStoreRecordsGetRequest { - r.prefix = &prefix - return r -} - -// Signature used for the access. -func (r ApiActorRunKeyValueStoreRecordsGetRequest) Signature(signature string) ApiActorRunKeyValueStoreRecordsGetRequest { - r.signature = &signature - return r -} - -func (r ApiActorRunKeyValueStoreRecordsGetRequest) Execute() (*os.File, *http.Response, error) { - return r.ApiService.ActorRunKeyValueStoreRecordsGetExecute(r) -} - -/* -ActorRunKeyValueStoreRecordsGet Download default store's records - -Downloads all records from the default key-value store of the Actor run as a ZIP archive. - -This endpoint is a shortcut for getting the run's `defaultKeyValueStoreId` and then using the -[Download records](/api/v2/key-value-store-records-get) endpoint. - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param runId Actor run ID. - @return ApiActorRunKeyValueStoreRecordsGetRequest -*/ -func (a *DefaultKeyValueStoreAPIService) ActorRunKeyValueStoreRecordsGet(ctx context.Context, runId string) ApiActorRunKeyValueStoreRecordsGetRequest { - return ApiActorRunKeyValueStoreRecordsGetRequest{ - ApiService: a, - ctx: ctx, - runId: runId, - } -} - -// Execute executes the request -// @return *os.File -func (a *DefaultKeyValueStoreAPIService) ActorRunKeyValueStoreRecordsGetExecute(r ApiActorRunKeyValueStoreRecordsGetRequest) (*os.File, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *os.File - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultKeyValueStoreAPIService.ActorRunKeyValueStoreRecordsGet") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/actor-runs/{runId}/key-value-store/records" - localVarPath = strings.Replace(localVarPath, "{"+"runId"+"}", url.PathEscape(parameterValueToString(r.runId, "runId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if r.collection != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "collection", r.collection, "form", "") - } - if r.prefix != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "prefix", r.prefix, "form", "") - } - if r.signature != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "signature", r.signature, "form", "") - } - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/zip", "application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} diff --git a/api_default_request_queue.go b/api_default_request_queue.go deleted file mode 100644 index d43fa1a..0000000 --- a/api_default_request_queue.go +++ /dev/null @@ -1,3226 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "bytes" - "context" - "io" - "net/http" - "net/url" - "strings" -) - - -// DefaultRequestQueueAPIService DefaultRequestQueueAPI service -type DefaultRequestQueueAPIService service - -type ApiActorRunRequestQueueDeleteRequest struct { - ctx context.Context - ApiService *DefaultRequestQueueAPIService - runId string -} - -func (r ApiActorRunRequestQueueDeleteRequest) Execute() (*http.Response, error) { - return r.ApiService.ActorRunRequestQueueDeleteExecute(r) -} - -/* -ActorRunRequestQueueDelete Delete default request queue - -Deletes the default request queue associated with an Actor run. - -This endpoint is a shortcut for getting the run's `defaultRequestQueueId` and then using the -[Delete request queue](/api/v2/request-queue-delete) endpoint. - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param runId Actor run ID. - @return ApiActorRunRequestQueueDeleteRequest -*/ -func (a *DefaultRequestQueueAPIService) ActorRunRequestQueueDelete(ctx context.Context, runId string) ApiActorRunRequestQueueDeleteRequest { - return ApiActorRunRequestQueueDeleteRequest{ - ApiService: a, - ctx: ctx, - runId: runId, - } -} - -// Execute executes the request -func (a *DefaultRequestQueueAPIService) ActorRunRequestQueueDeleteExecute(r ApiActorRunRequestQueueDeleteRequest) (*http.Response, error) { - var ( - localVarHTTPMethod = http.MethodDelete - localVarPostBody interface{} - formFiles []formFile - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultRequestQueueAPIService.ActorRunRequestQueueDelete") - if err != nil { - return nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/actor-runs/{runId}/request-queue" - localVarPath = strings.Replace(localVarPath, "{"+"runId"+"}", url.PathEscape(parameterValueToString(r.runId, "runId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarHTTPResponse, newErr - } - - return localVarHTTPResponse, nil -} - -type ApiActorRunRequestQueueGetRequest struct { - ctx context.Context - ApiService *DefaultRequestQueueAPIService - runId string -} - -func (r ApiActorRunRequestQueueGetRequest) Execute() (*RequestQueueResponse, *http.Response, error) { - return r.ApiService.ActorRunRequestQueueGetExecute(r) -} - -/* -ActorRunRequestQueueGet Get default request queue - -Returns the default request queue associated with an Actor run. - -This endpoint is a shortcut for getting the run's `defaultRequestQueueId` and then using the -[Get request queue](/api/v2/request-queue-get) endpoint. - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param runId Actor run ID. - @return ApiActorRunRequestQueueGetRequest -*/ -func (a *DefaultRequestQueueAPIService) ActorRunRequestQueueGet(ctx context.Context, runId string) ApiActorRunRequestQueueGetRequest { - return ApiActorRunRequestQueueGetRequest{ - ApiService: a, - ctx: ctx, - runId: runId, - } -} - -// Execute executes the request -// @return RequestQueueResponse -func (a *DefaultRequestQueueAPIService) ActorRunRequestQueueGetExecute(r ApiActorRunRequestQueueGetRequest) (*RequestQueueResponse, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *RequestQueueResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultRequestQueueAPIService.ActorRunRequestQueueGet") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/actor-runs/{runId}/request-queue" - localVarPath = strings.Replace(localVarPath, "{"+"runId"+"}", url.PathEscape(parameterValueToString(r.runId, "runId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiActorRunRequestQueueHeadGetRequest struct { - ctx context.Context - ApiService *DefaultRequestQueueAPIService - runId string - limit *float64 - clientKey *string -} - -// How many items from queue should be returned. -func (r ApiActorRunRequestQueueHeadGetRequest) Limit(limit float64) ApiActorRunRequestQueueHeadGetRequest { - r.limit = &limit - return r -} - -// A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. -func (r ApiActorRunRequestQueueHeadGetRequest) ClientKey(clientKey string) ApiActorRunRequestQueueHeadGetRequest { - r.clientKey = &clientKey - return r -} - -func (r ApiActorRunRequestQueueHeadGetRequest) Execute() (*HeadResponse, *http.Response, error) { - return r.ApiService.ActorRunRequestQueueHeadGetExecute(r) -} - -/* -ActorRunRequestQueueHeadGet Get default request queue head - -Returns the given number of first requests from the default request queue of the Actor run. - -This endpoint is a shortcut for getting the run's `defaultRequestQueueId` and then using the -[Get head](/api/v2/request-queue-head-get) endpoint. - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param runId Actor run ID. - @return ApiActorRunRequestQueueHeadGetRequest -*/ -func (a *DefaultRequestQueueAPIService) ActorRunRequestQueueHeadGet(ctx context.Context, runId string) ApiActorRunRequestQueueHeadGetRequest { - return ApiActorRunRequestQueueHeadGetRequest{ - ApiService: a, - ctx: ctx, - runId: runId, - } -} - -// Execute executes the request -// @return HeadResponse -func (a *DefaultRequestQueueAPIService) ActorRunRequestQueueHeadGetExecute(r ApiActorRunRequestQueueHeadGetRequest) (*HeadResponse, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *HeadResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultRequestQueueAPIService.ActorRunRequestQueueHeadGet") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/actor-runs/{runId}/request-queue/head" - localVarPath = strings.Replace(localVarPath, "{"+"runId"+"}", url.PathEscape(parameterValueToString(r.runId, "runId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if r.limit != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "form", "") - } - if r.clientKey != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "clientKey", r.clientKey, "form", "") - } - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiActorRunRequestQueueHeadLockPostRequest struct { - ctx context.Context - ApiService *DefaultRequestQueueAPIService - runId string - lockSecs *float64 - limit *float64 - clientKey *string -} - -// How long the requests will be locked for (in seconds). -func (r ApiActorRunRequestQueueHeadLockPostRequest) LockSecs(lockSecs float64) ApiActorRunRequestQueueHeadLockPostRequest { - r.lockSecs = &lockSecs - return r -} - -// How many items from the queue should be returned. -func (r ApiActorRunRequestQueueHeadLockPostRequest) Limit(limit float64) ApiActorRunRequestQueueHeadLockPostRequest { - r.limit = &limit - return r -} - -// A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. -func (r ApiActorRunRequestQueueHeadLockPostRequest) ClientKey(clientKey string) ApiActorRunRequestQueueHeadLockPostRequest { - r.clientKey = &clientKey - return r -} - -func (r ApiActorRunRequestQueueHeadLockPostRequest) Execute() (*HeadAndLockResponse, *http.Response, error) { - return r.ApiService.ActorRunRequestQueueHeadLockPostExecute(r) -} - -/* -ActorRunRequestQueueHeadLockPost Get and lock default request queue head - -Returns the given number of first requests from the default request queue of the Actor run -and locks them for the given time. - -This endpoint is a shortcut for getting the run's `defaultRequestQueueId` and then using the -[Get head and lock](/api/v2/request-queue-head-lock-post) endpoint. - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param runId Actor run ID. - @return ApiActorRunRequestQueueHeadLockPostRequest -*/ -func (a *DefaultRequestQueueAPIService) ActorRunRequestQueueHeadLockPost(ctx context.Context, runId string) ApiActorRunRequestQueueHeadLockPostRequest { - return ApiActorRunRequestQueueHeadLockPostRequest{ - ApiService: a, - ctx: ctx, - runId: runId, - } -} - -// Execute executes the request -// @return HeadAndLockResponse -func (a *DefaultRequestQueueAPIService) ActorRunRequestQueueHeadLockPostExecute(r ApiActorRunRequestQueueHeadLockPostRequest) (*HeadAndLockResponse, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodPost - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *HeadAndLockResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultRequestQueueAPIService.ActorRunRequestQueueHeadLockPost") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/actor-runs/{runId}/request-queue/head/lock" - localVarPath = strings.Replace(localVarPath, "{"+"runId"+"}", url.PathEscape(parameterValueToString(r.runId, "runId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - if r.lockSecs == nil { - return localVarReturnValue, nil, reportError("lockSecs is required and must be specified") - } - - parameterAddToHeaderOrQuery(localVarQueryParams, "lockSecs", r.lockSecs, "form", "") - if r.limit != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "form", "") - } - if r.clientKey != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "clientKey", r.clientKey, "form", "") - } - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiActorRunRequestQueuePutRequest struct { - ctx context.Context - ApiService *DefaultRequestQueueAPIService - runId string - updateRequestQueueRequest *UpdateRequestQueueRequest -} - -// -func (r ApiActorRunRequestQueuePutRequest) UpdateRequestQueueRequest(updateRequestQueueRequest UpdateRequestQueueRequest) ApiActorRunRequestQueuePutRequest { - r.updateRequestQueueRequest = &updateRequestQueueRequest - return r -} - -func (r ApiActorRunRequestQueuePutRequest) Execute() (*RequestQueueResponse, *http.Response, error) { - return r.ApiService.ActorRunRequestQueuePutExecute(r) -} - -/* -ActorRunRequestQueuePut Update default request queue - -Updates the default request queue associated with an Actor run. - -This endpoint is a shortcut for getting the run's `defaultRequestQueueId` and then using the -[Update request queue](/api/v2/request-queue-put) endpoint. - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param runId Actor run ID. - @return ApiActorRunRequestQueuePutRequest -*/ -func (a *DefaultRequestQueueAPIService) ActorRunRequestQueuePut(ctx context.Context, runId string) ApiActorRunRequestQueuePutRequest { - return ApiActorRunRequestQueuePutRequest{ - ApiService: a, - ctx: ctx, - runId: runId, - } -} - -// Execute executes the request -// @return RequestQueueResponse -func (a *DefaultRequestQueueAPIService) ActorRunRequestQueuePutExecute(r ApiActorRunRequestQueuePutRequest) (*RequestQueueResponse, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodPut - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *RequestQueueResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultRequestQueueAPIService.ActorRunRequestQueuePut") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/actor-runs/{runId}/request-queue" - localVarPath = strings.Replace(localVarPath, "{"+"runId"+"}", url.PathEscape(parameterValueToString(r.runId, "runId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - if r.updateRequestQueueRequest == nil { - return localVarReturnValue, nil, reportError("updateRequestQueueRequest is required and must be specified") - } - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/json"} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - // body params - localVarPostBody = r.updateRequestQueueRequest - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 413 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 415 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiActorRunRequestQueueRequestDeleteRequest struct { - ctx context.Context - ApiService *DefaultRequestQueueAPIService - runId string - requestId string - clientKey *string -} - -// A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. -func (r ApiActorRunRequestQueueRequestDeleteRequest) ClientKey(clientKey string) ApiActorRunRequestQueueRequestDeleteRequest { - r.clientKey = &clientKey - return r -} - -func (r ApiActorRunRequestQueueRequestDeleteRequest) Execute() (*http.Response, error) { - return r.ApiService.ActorRunRequestQueueRequestDeleteExecute(r) -} - -/* -ActorRunRequestQueueRequestDelete Delete request from default request queue - -Deletes a request from the default request queue of the Actor run. - -This endpoint is a shortcut for getting the run's `defaultRequestQueueId` and then using the -[Delete request](/api/v2/request-queue-request-delete) endpoint. - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param runId Actor run ID. - @param requestId Request ID. - @return ApiActorRunRequestQueueRequestDeleteRequest -*/ -func (a *DefaultRequestQueueAPIService) ActorRunRequestQueueRequestDelete(ctx context.Context, runId string, requestId string) ApiActorRunRequestQueueRequestDeleteRequest { - return ApiActorRunRequestQueueRequestDeleteRequest{ - ApiService: a, - ctx: ctx, - runId: runId, - requestId: requestId, - } -} - -// Execute executes the request -func (a *DefaultRequestQueueAPIService) ActorRunRequestQueueRequestDeleteExecute(r ApiActorRunRequestQueueRequestDeleteRequest) (*http.Response, error) { - var ( - localVarHTTPMethod = http.MethodDelete - localVarPostBody interface{} - formFiles []formFile - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultRequestQueueAPIService.ActorRunRequestQueueRequestDelete") - if err != nil { - return nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/actor-runs/{runId}/request-queue/requests/{requestId}" - localVarPath = strings.Replace(localVarPath, "{"+"runId"+"}", url.PathEscape(parameterValueToString(r.runId, "runId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"requestId"+"}", url.PathEscape(parameterValueToString(r.requestId, "requestId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if r.clientKey != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "clientKey", r.clientKey, "form", "") - } - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarHTTPResponse, newErr - } - - return localVarHTTPResponse, nil -} - -type ApiActorRunRequestQueueRequestGetRequest struct { - ctx context.Context - ApiService *DefaultRequestQueueAPIService - runId string - requestId string -} - -func (r ApiActorRunRequestQueueRequestGetRequest) Execute() (*RequestResponse, *http.Response, error) { - return r.ApiService.ActorRunRequestQueueRequestGetExecute(r) -} - -/* -ActorRunRequestQueueRequestGet Get request from default request queue - -Returns a request from the default request queue of the Actor run. - -This endpoint is a shortcut for getting the run's `defaultRequestQueueId` and then using the -[Get request](/api/v2/request-queue-request-get) endpoint. - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param runId Actor run ID. - @param requestId Request ID. - @return ApiActorRunRequestQueueRequestGetRequest -*/ -func (a *DefaultRequestQueueAPIService) ActorRunRequestQueueRequestGet(ctx context.Context, runId string, requestId string) ApiActorRunRequestQueueRequestGetRequest { - return ApiActorRunRequestQueueRequestGetRequest{ - ApiService: a, - ctx: ctx, - runId: runId, - requestId: requestId, - } -} - -// Execute executes the request -// @return RequestResponse -func (a *DefaultRequestQueueAPIService) ActorRunRequestQueueRequestGetExecute(r ApiActorRunRequestQueueRequestGetRequest) (*RequestResponse, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *RequestResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultRequestQueueAPIService.ActorRunRequestQueueRequestGet") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/actor-runs/{runId}/request-queue/requests/{requestId}" - localVarPath = strings.Replace(localVarPath, "{"+"runId"+"}", url.PathEscape(parameterValueToString(r.runId, "runId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"requestId"+"}", url.PathEscape(parameterValueToString(r.requestId, "requestId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiActorRunRequestQueueRequestLockDeleteRequest struct { - ctx context.Context - ApiService *DefaultRequestQueueAPIService - runId string - requestId string - clientKey *string - forefront *string -} - -// A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. -func (r ApiActorRunRequestQueueRequestLockDeleteRequest) ClientKey(clientKey string) ApiActorRunRequestQueueRequestLockDeleteRequest { - r.clientKey = &clientKey - return r -} - -// Determines if request should be added to the head of the queue or to the end after lock was removed. -func (r ApiActorRunRequestQueueRequestLockDeleteRequest) Forefront(forefront string) ApiActorRunRequestQueueRequestLockDeleteRequest { - r.forefront = &forefront - return r -} - -func (r ApiActorRunRequestQueueRequestLockDeleteRequest) Execute() (*http.Response, error) { - return r.ApiService.ActorRunRequestQueueRequestLockDeleteExecute(r) -} - -/* -ActorRunRequestQueueRequestLockDelete Delete lock on request in default request queue - -Deletes a request lock in the default request queue of the Actor run. - -This endpoint is a shortcut for getting the run's `defaultRequestQueueId` and then using the -[Delete request lock](/api/v2/request-queue-request-lock-delete) endpoint. - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param runId Actor run ID. - @param requestId Request ID. - @return ApiActorRunRequestQueueRequestLockDeleteRequest -*/ -func (a *DefaultRequestQueueAPIService) ActorRunRequestQueueRequestLockDelete(ctx context.Context, runId string, requestId string) ApiActorRunRequestQueueRequestLockDeleteRequest { - return ApiActorRunRequestQueueRequestLockDeleteRequest{ - ApiService: a, - ctx: ctx, - runId: runId, - requestId: requestId, - } -} - -// Execute executes the request -func (a *DefaultRequestQueueAPIService) ActorRunRequestQueueRequestLockDeleteExecute(r ApiActorRunRequestQueueRequestLockDeleteRequest) (*http.Response, error) { - var ( - localVarHTTPMethod = http.MethodDelete - localVarPostBody interface{} - formFiles []formFile - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultRequestQueueAPIService.ActorRunRequestQueueRequestLockDelete") - if err != nil { - return nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/actor-runs/{runId}/request-queue/requests/{requestId}/lock" - localVarPath = strings.Replace(localVarPath, "{"+"runId"+"}", url.PathEscape(parameterValueToString(r.runId, "runId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"requestId"+"}", url.PathEscape(parameterValueToString(r.requestId, "requestId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if r.clientKey != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "clientKey", r.clientKey, "form", "") - } - if r.forefront != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "forefront", r.forefront, "form", "") - } - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarHTTPResponse, newErr - } - - return localVarHTTPResponse, nil -} - -type ApiActorRunRequestQueueRequestLockPutRequest struct { - ctx context.Context - ApiService *DefaultRequestQueueAPIService - runId string - requestId string - lockSecs *float64 - clientKey *string - forefront *string -} - -// How long the requests will be locked for (in seconds). -func (r ApiActorRunRequestQueueRequestLockPutRequest) LockSecs(lockSecs float64) ApiActorRunRequestQueueRequestLockPutRequest { - r.lockSecs = &lockSecs - return r -} - -// A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. -func (r ApiActorRunRequestQueueRequestLockPutRequest) ClientKey(clientKey string) ApiActorRunRequestQueueRequestLockPutRequest { - r.clientKey = &clientKey - return r -} - -// Determines if request should be added to the head of the queue or to the end after lock expires. -func (r ApiActorRunRequestQueueRequestLockPutRequest) Forefront(forefront string) ApiActorRunRequestQueueRequestLockPutRequest { - r.forefront = &forefront - return r -} - -func (r ApiActorRunRequestQueueRequestLockPutRequest) Execute() (*ProlongRequestLockResponse, *http.Response, error) { - return r.ApiService.ActorRunRequestQueueRequestLockPutExecute(r) -} - -/* -ActorRunRequestQueueRequestLockPut Prolong lock on request in default request queue - -Prolongs a request lock in the default request queue of the Actor run. - -This endpoint is a shortcut for getting the run's `defaultRequestQueueId` and then using the -[Prolong request lock](/api/v2/request-queue-request-lock-put) endpoint. - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param runId Actor run ID. - @param requestId Request ID. - @return ApiActorRunRequestQueueRequestLockPutRequest -*/ -func (a *DefaultRequestQueueAPIService) ActorRunRequestQueueRequestLockPut(ctx context.Context, runId string, requestId string) ApiActorRunRequestQueueRequestLockPutRequest { - return ApiActorRunRequestQueueRequestLockPutRequest{ - ApiService: a, - ctx: ctx, - runId: runId, - requestId: requestId, - } -} - -// Execute executes the request -// @return ProlongRequestLockResponse -func (a *DefaultRequestQueueAPIService) ActorRunRequestQueueRequestLockPutExecute(r ApiActorRunRequestQueueRequestLockPutRequest) (*ProlongRequestLockResponse, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodPut - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *ProlongRequestLockResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultRequestQueueAPIService.ActorRunRequestQueueRequestLockPut") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/actor-runs/{runId}/request-queue/requests/{requestId}/lock" - localVarPath = strings.Replace(localVarPath, "{"+"runId"+"}", url.PathEscape(parameterValueToString(r.runId, "runId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"requestId"+"}", url.PathEscape(parameterValueToString(r.requestId, "requestId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - if r.lockSecs == nil { - return localVarReturnValue, nil, reportError("lockSecs is required and must be specified") - } - - parameterAddToHeaderOrQuery(localVarQueryParams, "lockSecs", r.lockSecs, "form", "") - if r.clientKey != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "clientKey", r.clientKey, "form", "") - } - if r.forefront != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "forefront", r.forefront, "form", "") - } - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiActorRunRequestQueueRequestPutRequest struct { - ctx context.Context - ApiService *DefaultRequestQueueAPIService - runId string - requestId string - request *Request - forefront *string - clientKey *string -} - -// -func (r ApiActorRunRequestQueueRequestPutRequest) Request(request Request) ApiActorRunRequestQueueRequestPutRequest { - r.request = &request - return r -} - -// Determines if request should be added to the head of the queue or to the end. Default value is `false` (end of queue). -func (r ApiActorRunRequestQueueRequestPutRequest) Forefront(forefront string) ApiActorRunRequestQueueRequestPutRequest { - r.forefront = &forefront - return r -} - -// A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. -func (r ApiActorRunRequestQueueRequestPutRequest) ClientKey(clientKey string) ApiActorRunRequestQueueRequestPutRequest { - r.clientKey = &clientKey - return r -} - -func (r ApiActorRunRequestQueueRequestPutRequest) Execute() (*UpdateRequestResponse, *http.Response, error) { - return r.ApiService.ActorRunRequestQueueRequestPutExecute(r) -} - -/* -ActorRunRequestQueueRequestPut Update request in default request queue - -Updates a request in the default request queue of the Actor run. - -This endpoint is a shortcut for getting the run's `defaultRequestQueueId` and then using the -[Update request](/api/v2/request-queue-request-put) endpoint. - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param runId Actor run ID. - @param requestId Request ID. - @return ApiActorRunRequestQueueRequestPutRequest -*/ -func (a *DefaultRequestQueueAPIService) ActorRunRequestQueueRequestPut(ctx context.Context, runId string, requestId string) ApiActorRunRequestQueueRequestPutRequest { - return ApiActorRunRequestQueueRequestPutRequest{ - ApiService: a, - ctx: ctx, - runId: runId, - requestId: requestId, - } -} - -// Execute executes the request -// @return UpdateRequestResponse -func (a *DefaultRequestQueueAPIService) ActorRunRequestQueueRequestPutExecute(r ApiActorRunRequestQueueRequestPutRequest) (*UpdateRequestResponse, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodPut - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *UpdateRequestResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultRequestQueueAPIService.ActorRunRequestQueueRequestPut") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/actor-runs/{runId}/request-queue/requests/{requestId}" - localVarPath = strings.Replace(localVarPath, "{"+"runId"+"}", url.PathEscape(parameterValueToString(r.runId, "runId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"requestId"+"}", url.PathEscape(parameterValueToString(r.requestId, "requestId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - if r.request == nil { - return localVarReturnValue, nil, reportError("request is required and must be specified") - } - - if r.forefront != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "forefront", r.forefront, "form", "") - } - if r.clientKey != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "clientKey", r.clientKey, "form", "") - } - // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/json"} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - // body params - localVarPostBody = r.request - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 413 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 415 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiActorRunRequestQueueRequestsBatchDeleteRequest struct { - ctx context.Context - ApiService *DefaultRequestQueueAPIService - runId string - contentType *string - requestDraftDelete *[]RequestDraftDelete - clientKey *string -} - -// -func (r ApiActorRunRequestQueueRequestsBatchDeleteRequest) ContentType(contentType string) ApiActorRunRequestQueueRequestsBatchDeleteRequest { - r.contentType = &contentType - return r -} - -// -func (r ApiActorRunRequestQueueRequestsBatchDeleteRequest) RequestDraftDelete(requestDraftDelete []RequestDraftDelete) ApiActorRunRequestQueueRequestsBatchDeleteRequest { - r.requestDraftDelete = &requestDraftDelete - return r -} - -// A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. -func (r ApiActorRunRequestQueueRequestsBatchDeleteRequest) ClientKey(clientKey string) ApiActorRunRequestQueueRequestsBatchDeleteRequest { - r.clientKey = &clientKey - return r -} - -func (r ApiActorRunRequestQueueRequestsBatchDeleteRequest) Execute() (*BatchDeleteResponse, *http.Response, error) { - return r.ApiService.ActorRunRequestQueueRequestsBatchDeleteExecute(r) -} - -/* -ActorRunRequestQueueRequestsBatchDelete Batch delete requests from default request queue - -Batch-deletes requests from the default request queue of the Actor run. - -This endpoint is a shortcut for getting the run's `defaultRequestQueueId` and then using the -[Delete requests](/api/v2/request-queue-requests-batch-delete) endpoint. - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param runId Actor run ID. - @return ApiActorRunRequestQueueRequestsBatchDeleteRequest -*/ -func (a *DefaultRequestQueueAPIService) ActorRunRequestQueueRequestsBatchDelete(ctx context.Context, runId string) ApiActorRunRequestQueueRequestsBatchDeleteRequest { - return ApiActorRunRequestQueueRequestsBatchDeleteRequest{ - ApiService: a, - ctx: ctx, - runId: runId, - } -} - -// Execute executes the request -// @return BatchDeleteResponse -func (a *DefaultRequestQueueAPIService) ActorRunRequestQueueRequestsBatchDeleteExecute(r ApiActorRunRequestQueueRequestsBatchDeleteRequest) (*BatchDeleteResponse, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodDelete - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *BatchDeleteResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultRequestQueueAPIService.ActorRunRequestQueueRequestsBatchDelete") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/actor-runs/{runId}/request-queue/requests/batch" - localVarPath = strings.Replace(localVarPath, "{"+"runId"+"}", url.PathEscape(parameterValueToString(r.runId, "runId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - if r.contentType == nil { - return localVarReturnValue, nil, reportError("contentType is required and must be specified") - } - if r.requestDraftDelete == nil { - return localVarReturnValue, nil, reportError("requestDraftDelete is required and must be specified") - } - - if r.clientKey != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "clientKey", r.clientKey, "form", "") - } - // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/json"} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - parameterAddToHeaderOrQuery(localVarHeaderParams, "Content-Type", r.contentType, "simple", "") - // body params - localVarPostBody = r.requestDraftDelete - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 413 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 415 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiActorRunRequestQueueRequestsBatchPostRequest struct { - ctx context.Context - ApiService *DefaultRequestQueueAPIService - runId string - requestBase *[]RequestBase - clientKey *string - forefront *string -} - -// -func (r ApiActorRunRequestQueueRequestsBatchPostRequest) RequestBase(requestBase []RequestBase) ApiActorRunRequestQueueRequestsBatchPostRequest { - r.requestBase = &requestBase - return r -} - -// A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. -func (r ApiActorRunRequestQueueRequestsBatchPostRequest) ClientKey(clientKey string) ApiActorRunRequestQueueRequestsBatchPostRequest { - r.clientKey = &clientKey - return r -} - -// Determines if request should be added to the head of the queue or to the end. Default value is `false` (end of queue). -func (r ApiActorRunRequestQueueRequestsBatchPostRequest) Forefront(forefront string) ApiActorRunRequestQueueRequestsBatchPostRequest { - r.forefront = &forefront - return r -} - -func (r ApiActorRunRequestQueueRequestsBatchPostRequest) Execute() (*BatchAddResponse, *http.Response, error) { - return r.ApiService.ActorRunRequestQueueRequestsBatchPostExecute(r) -} - -/* -ActorRunRequestQueueRequestsBatchPost Batch add requests to default request queue - -Adds requests to the default request queue of the Actor run in batch. - -This endpoint is a shortcut for getting the run's `defaultRequestQueueId` and then using the -[Add requests](/api/v2/request-queue-requests-batch-post) endpoint. - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param runId Actor run ID. - @return ApiActorRunRequestQueueRequestsBatchPostRequest -*/ -func (a *DefaultRequestQueueAPIService) ActorRunRequestQueueRequestsBatchPost(ctx context.Context, runId string) ApiActorRunRequestQueueRequestsBatchPostRequest { - return ApiActorRunRequestQueueRequestsBatchPostRequest{ - ApiService: a, - ctx: ctx, - runId: runId, - } -} - -// Execute executes the request -// @return BatchAddResponse -func (a *DefaultRequestQueueAPIService) ActorRunRequestQueueRequestsBatchPostExecute(r ApiActorRunRequestQueueRequestsBatchPostRequest) (*BatchAddResponse, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodPost - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *BatchAddResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultRequestQueueAPIService.ActorRunRequestQueueRequestsBatchPost") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/actor-runs/{runId}/request-queue/requests/batch" - localVarPath = strings.Replace(localVarPath, "{"+"runId"+"}", url.PathEscape(parameterValueToString(r.runId, "runId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - if r.requestBase == nil { - return localVarReturnValue, nil, reportError("requestBase is required and must be specified") - } - - if r.clientKey != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "clientKey", r.clientKey, "form", "") - } - if r.forefront != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "forefront", r.forefront, "form", "") - } - // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/json"} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - // body params - localVarPostBody = r.requestBase - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 413 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 415 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiActorRunRequestQueueRequestsGetRequest struct { - ctx context.Context - ApiService *DefaultRequestQueueAPIService - runId string - clientKey *string - exclusiveStartId *string - limit *float64 - cursor *string - filter *[]string -} - -// A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. -func (r ApiActorRunRequestQueueRequestsGetRequest) ClientKey(clientKey string) ApiActorRunRequestQueueRequestsGetRequest { - r.clientKey = &clientKey - return r -} - -// All requests up to this one (including) are skipped from the result. (Deprecated, use `cursor` instead.) -// Deprecated -func (r ApiActorRunRequestQueueRequestsGetRequest) ExclusiveStartId(exclusiveStartId string) ApiActorRunRequestQueueRequestsGetRequest { - r.exclusiveStartId = &exclusiveStartId - return r -} - -// Number of keys to be returned. Maximum value is `10000`. -func (r ApiActorRunRequestQueueRequestsGetRequest) Limit(limit float64) ApiActorRunRequestQueueRequestsGetRequest { - r.limit = &limit - return r -} - -// A cursor string for pagination, returned in the previous response as `nextCursor`. Use this to retrieve the next page of requests. -func (r ApiActorRunRequestQueueRequestsGetRequest) Cursor(cursor string) ApiActorRunRequestQueueRequestsGetRequest { - r.cursor = &cursor - return r -} - -// Filter requests by their state. Possible values are `locked` and `pending`. You can combine multiple values separated by commas, which will mean the union of these filters – requests matching any of the specified states will be returned. (Not compatible with deprecated `exclusiveStartId` parameter.) -func (r ApiActorRunRequestQueueRequestsGetRequest) Filter(filter []string) ApiActorRunRequestQueueRequestsGetRequest { - r.filter = &filter - return r -} - -func (r ApiActorRunRequestQueueRequestsGetRequest) Execute() (*ListOfRequestsResponse, *http.Response, error) { - return r.ApiService.ActorRunRequestQueueRequestsGetExecute(r) -} - -/* -ActorRunRequestQueueRequestsGet List default request queue's requests - -Returns a list of requests from the default request queue of the Actor run. - -This endpoint is a shortcut for getting the run's `defaultRequestQueueId` and then using the -[List requests](/api/v2/request-queue-requests-get) endpoint. - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param runId Actor run ID. - @return ApiActorRunRequestQueueRequestsGetRequest -*/ -func (a *DefaultRequestQueueAPIService) ActorRunRequestQueueRequestsGet(ctx context.Context, runId string) ApiActorRunRequestQueueRequestsGetRequest { - return ApiActorRunRequestQueueRequestsGetRequest{ - ApiService: a, - ctx: ctx, - runId: runId, - } -} - -// Execute executes the request -// @return ListOfRequestsResponse -func (a *DefaultRequestQueueAPIService) ActorRunRequestQueueRequestsGetExecute(r ApiActorRunRequestQueueRequestsGetRequest) (*ListOfRequestsResponse, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *ListOfRequestsResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultRequestQueueAPIService.ActorRunRequestQueueRequestsGet") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/actor-runs/{runId}/request-queue/requests" - localVarPath = strings.Replace(localVarPath, "{"+"runId"+"}", url.PathEscape(parameterValueToString(r.runId, "runId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if r.clientKey != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "clientKey", r.clientKey, "form", "") - } - if r.exclusiveStartId != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "exclusiveStartId", r.exclusiveStartId, "form", "") - } - if r.limit != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "form", "") - } - if r.cursor != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "cursor", r.cursor, "form", "") - } - if r.filter != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "filter", r.filter, "form", "csv") - } - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiActorRunRequestQueueRequestsPostRequest struct { - ctx context.Context - ApiService *DefaultRequestQueueAPIService - runId string - requestBase *RequestBase - clientKey *string - forefront *string -} - -// -func (r ApiActorRunRequestQueueRequestsPostRequest) RequestBase(requestBase RequestBase) ApiActorRunRequestQueueRequestsPostRequest { - r.requestBase = &requestBase - return r -} - -// A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. -func (r ApiActorRunRequestQueueRequestsPostRequest) ClientKey(clientKey string) ApiActorRunRequestQueueRequestsPostRequest { - r.clientKey = &clientKey - return r -} - -// Determines if request should be added to the head of the queue or to the end. Default value is `false` (end of queue). -func (r ApiActorRunRequestQueueRequestsPostRequest) Forefront(forefront string) ApiActorRunRequestQueueRequestsPostRequest { - r.forefront = &forefront - return r -} - -func (r ApiActorRunRequestQueueRequestsPostRequest) Execute() (*AddRequestResponse, *http.Response, error) { - return r.ApiService.ActorRunRequestQueueRequestsPostExecute(r) -} - -/* -ActorRunRequestQueueRequestsPost Add request to default request queue - -Adds a request to the default request queue of the Actor run. - -This endpoint is a shortcut for getting the run's `defaultRequestQueueId` and then using the -[Add request](/api/v2/request-queue-requests-post) endpoint. - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param runId Actor run ID. - @return ApiActorRunRequestQueueRequestsPostRequest -*/ -func (a *DefaultRequestQueueAPIService) ActorRunRequestQueueRequestsPost(ctx context.Context, runId string) ApiActorRunRequestQueueRequestsPostRequest { - return ApiActorRunRequestQueueRequestsPostRequest{ - ApiService: a, - ctx: ctx, - runId: runId, - } -} - -// Execute executes the request -// @return AddRequestResponse -func (a *DefaultRequestQueueAPIService) ActorRunRequestQueueRequestsPostExecute(r ApiActorRunRequestQueueRequestsPostRequest) (*AddRequestResponse, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodPost - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *AddRequestResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultRequestQueueAPIService.ActorRunRequestQueueRequestsPost") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/actor-runs/{runId}/request-queue/requests" - localVarPath = strings.Replace(localVarPath, "{"+"runId"+"}", url.PathEscape(parameterValueToString(r.runId, "runId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - if r.requestBase == nil { - return localVarReturnValue, nil, reportError("requestBase is required and must be specified") - } - - if r.clientKey != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "clientKey", r.clientKey, "form", "") - } - if r.forefront != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "forefront", r.forefront, "form", "") - } - // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/json"} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - // body params - localVarPostBody = r.requestBase - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 413 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 415 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiActorRunRequestQueueRequestsUnlockPostRequest struct { - ctx context.Context - ApiService *DefaultRequestQueueAPIService - runId string - clientKey *string -} - -// A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. -func (r ApiActorRunRequestQueueRequestsUnlockPostRequest) ClientKey(clientKey string) ApiActorRunRequestQueueRequestsUnlockPostRequest { - r.clientKey = &clientKey - return r -} - -func (r ApiActorRunRequestQueueRequestsUnlockPostRequest) Execute() (*UnlockRequestsResponse, *http.Response, error) { - return r.ApiService.ActorRunRequestQueueRequestsUnlockPostExecute(r) -} - -/* -ActorRunRequestQueueRequestsUnlockPost Unlock requests in default request queue - -Unlocks requests in the default request queue of the Actor run that are currently locked by the client. - -This endpoint is a shortcut for getting the run's `defaultRequestQueueId` and then using the -[Unlock requests](/api/v2/request-queue-requests-unlock-post) endpoint. - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param runId Actor run ID. - @return ApiActorRunRequestQueueRequestsUnlockPostRequest -*/ -func (a *DefaultRequestQueueAPIService) ActorRunRequestQueueRequestsUnlockPost(ctx context.Context, runId string) ApiActorRunRequestQueueRequestsUnlockPostRequest { - return ApiActorRunRequestQueueRequestsUnlockPostRequest{ - ApiService: a, - ctx: ctx, - runId: runId, - } -} - -// Execute executes the request -// @return UnlockRequestsResponse -func (a *DefaultRequestQueueAPIService) ActorRunRequestQueueRequestsUnlockPostExecute(r ApiActorRunRequestQueueRequestsUnlockPostRequest) (*UnlockRequestsResponse, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodPost - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *UnlockRequestsResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultRequestQueueAPIService.ActorRunRequestQueueRequestsUnlockPost") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/actor-runs/{runId}/request-queue/requests/unlock" - localVarPath = strings.Replace(localVarPath, "{"+"runId"+"}", url.PathEscape(parameterValueToString(r.runId, "runId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if r.clientKey != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "clientKey", r.clientKey, "form", "") - } - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} diff --git a/api_last_actor_runs_abort.go b/api_last_actor_runs_abort.go deleted file mode 100644 index 5938d29..0000000 --- a/api_last_actor_runs_abort.go +++ /dev/null @@ -1,233 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "bytes" - "context" - "io" - "net/http" - "net/url" - "strings" -) - - -// LastActorRunsAbortAPIService LastActorRunsAbortAPI service -type LastActorRunsAbortAPIService service - -type ApiActRunsLastAbortPostRequest struct { - ctx context.Context - ApiService *LastActorRunsAbortAPIService - actorId string - status *string - gracefully *bool -} - -// Filter for the run status. -func (r ApiActRunsLastAbortPostRequest) Status(status string) ApiActRunsLastAbortPostRequest { - r.status = &status - return r -} - -// If true passed, the Actor run will abort gracefully. It will send `aborting` and `persistState` event into run and force-stop the run after 30 seconds. It is helpful in cases where you plan to resurrect the run later. -func (r ApiActRunsLastAbortPostRequest) Gracefully(gracefully bool) ApiActRunsLastAbortPostRequest { - r.gracefully = &gracefully - return r -} - -func (r ApiActRunsLastAbortPostRequest) Execute() (*RunResponse, *http.Response, error) { - return r.ApiService.ActRunsLastAbortPostExecute(r) -} - -/* -ActRunsLastAbortPost Abort Actor's last run - -Aborts the last run of the specified Actor and returns an object that -contains all the details about the run. - -This endpoint is a shortcut for [Abort run](#/reference/actor-runs/abort-run/abort-run) -on the Actor's last run. Only runs that are starting or running are aborted. -For runs with status `FINISHED`, `FAILED`, `ABORTING` and `TIMED-OUT` this call -does nothing. - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param actorId Actor ID or a tilde-separated owner's username and Actor name. - @return ApiActRunsLastAbortPostRequest -*/ -func (a *LastActorRunsAbortAPIService) ActRunsLastAbortPost(ctx context.Context, actorId string) ApiActRunsLastAbortPostRequest { - return ApiActRunsLastAbortPostRequest{ - ApiService: a, - ctx: ctx, - actorId: actorId, - } -} - -// Execute executes the request -// @return RunResponse -func (a *LastActorRunsAbortAPIService) ActRunsLastAbortPostExecute(r ApiActRunsLastAbortPostRequest) (*RunResponse, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodPost - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *RunResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LastActorRunsAbortAPIService.ActRunsLastAbortPost") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/actors/{actorId}/runs/last/abort" - localVarPath = strings.Replace(localVarPath, "{"+"actorId"+"}", url.PathEscape(parameterValueToString(r.actorId, "actorId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if r.status != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "status", r.status, "form", "") - } - if r.gracefully != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "gracefully", r.gracefully, "form", "") - } - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} diff --git a/api_last_actor_runs_default_dataset.go b/api_last_actor_runs_default_dataset.go deleted file mode 100644 index 8745309..0000000 --- a/api_last_actor_runs_default_dataset.go +++ /dev/null @@ -1,1475 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "bytes" - "context" - "io" - "net/http" - "net/url" - "strings" -) - - -// LastActorRunsDefaultDatasetAPIService LastActorRunsDefaultDatasetAPI service -type LastActorRunsDefaultDatasetAPIService service - -type ApiActRunsLastDatasetDeleteRequest struct { - ctx context.Context - ApiService *LastActorRunsDefaultDatasetAPIService - actorId string - status *string -} - -// Filter for the run status. -func (r ApiActRunsLastDatasetDeleteRequest) Status(status string) ApiActRunsLastDatasetDeleteRequest { - r.status = &status - return r -} - -func (r ApiActRunsLastDatasetDeleteRequest) Execute() (*http.Response, error) { - return r.ApiService.ActRunsLastDatasetDeleteExecute(r) -} - -/* -ActRunsLastDatasetDelete Delete last run's default dataset - -Deletes the default dataset associated with the last Actor run. - -This endpoint is a shortcut for getting the last run's `defaultDatasetId` and then using the -[Delete dataset](/api/v2/dataset-delete) endpoint. - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param actorId Actor ID or a tilde-separated owner's username and Actor name. - @return ApiActRunsLastDatasetDeleteRequest -*/ -func (a *LastActorRunsDefaultDatasetAPIService) ActRunsLastDatasetDelete(ctx context.Context, actorId string) ApiActRunsLastDatasetDeleteRequest { - return ApiActRunsLastDatasetDeleteRequest{ - ApiService: a, - ctx: ctx, - actorId: actorId, - } -} - -// Execute executes the request -func (a *LastActorRunsDefaultDatasetAPIService) ActRunsLastDatasetDeleteExecute(r ApiActRunsLastDatasetDeleteRequest) (*http.Response, error) { - var ( - localVarHTTPMethod = http.MethodDelete - localVarPostBody interface{} - formFiles []formFile - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LastActorRunsDefaultDatasetAPIService.ActRunsLastDatasetDelete") - if err != nil { - return nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/actors/{actorId}/runs/last/dataset" - localVarPath = strings.Replace(localVarPath, "{"+"actorId"+"}", url.PathEscape(parameterValueToString(r.actorId, "actorId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if r.status != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "status", r.status, "form", "") - } - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarHTTPResponse, newErr - } - - return localVarHTTPResponse, nil -} - -type ApiActRunsLastDatasetGetRequest struct { - ctx context.Context - ApiService *LastActorRunsDefaultDatasetAPIService - actorId string - status *string -} - -// Filter for the run status. -func (r ApiActRunsLastDatasetGetRequest) Status(status string) ApiActRunsLastDatasetGetRequest { - r.status = &status - return r -} - -func (r ApiActRunsLastDatasetGetRequest) Execute() (*DatasetResponse, *http.Response, error) { - return r.ApiService.ActRunsLastDatasetGetExecute(r) -} - -/* -ActRunsLastDatasetGet Get last run's default dataset - -Returns the default dataset associated with the last Actor run. - -This endpoint is a shortcut for getting the last run's `defaultDatasetId` and then using the -[Get dataset](/api/v2/dataset-get) endpoint. - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param actorId Actor ID or a tilde-separated owner's username and Actor name. - @return ApiActRunsLastDatasetGetRequest -*/ -func (a *LastActorRunsDefaultDatasetAPIService) ActRunsLastDatasetGet(ctx context.Context, actorId string) ApiActRunsLastDatasetGetRequest { - return ApiActRunsLastDatasetGetRequest{ - ApiService: a, - ctx: ctx, - actorId: actorId, - } -} - -// Execute executes the request -// @return DatasetResponse -func (a *LastActorRunsDefaultDatasetAPIService) ActRunsLastDatasetGetExecute(r ApiActRunsLastDatasetGetRequest) (*DatasetResponse, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *DatasetResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LastActorRunsDefaultDatasetAPIService.ActRunsLastDatasetGet") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/actors/{actorId}/runs/last/dataset" - localVarPath = strings.Replace(localVarPath, "{"+"actorId"+"}", url.PathEscape(parameterValueToString(r.actorId, "actorId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if r.status != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "status", r.status, "form", "") - } - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiActRunsLastDatasetItemsGetRequest struct { - ctx context.Context - ApiService *LastActorRunsDefaultDatasetAPIService - actorId string - status *string - format *string - clean *bool - offset *float64 - limit *float64 - fields *string - outputFields *string - omit *string - unwind *string - flatten *string - desc *bool - attachment *bool - delimiter *string - bom *bool - xmlRoot *string - xmlRow *string - skipHeaderRow *bool - skipHidden *bool - skipEmpty *bool - simplified *bool - view *string - skipFailedPages *bool - feedTitle *string - feedDescription *string - signature *string -} - -// Filter for the run status. -func (r ApiActRunsLastDatasetItemsGetRequest) Status(status string) ApiActRunsLastDatasetItemsGetRequest { - r.status = &status - return r -} - -// Format of the results, possible values are: `json`, `jsonl`, `csv`, `html`, `xlsx`, `xml` and `rss`. The default value is `json`. -func (r ApiActRunsLastDatasetItemsGetRequest) Format(format string) ApiActRunsLastDatasetItemsGetRequest { - r.format = &format - return r -} - -// If `true` or `1` then the API endpoint returns only non-empty items and skips hidden fields (i.e. fields starting with the # character). The `clean` parameter is just a shortcut for `skipHidden=true` and `skipEmpty=true` parameters. Note that since some objects might be skipped from the output, that the result might contain less items than the `limit` value. -func (r ApiActRunsLastDatasetItemsGetRequest) Clean(clean bool) ApiActRunsLastDatasetItemsGetRequest { - r.clean = &clean - return r -} - -// Number of items that should be skipped at the start. The default value is `0`. -func (r ApiActRunsLastDatasetItemsGetRequest) Offset(offset float64) ApiActRunsLastDatasetItemsGetRequest { - r.offset = &offset - return r -} - -// Maximum number of items to return. By default there is no limit. -func (r ApiActRunsLastDatasetItemsGetRequest) Limit(limit float64) ApiActRunsLastDatasetItemsGetRequest { - r.limit = &limit - return r -} - -// A comma-separated list of fields which should be picked from the items, only these fields will remain in the resulting record objects. Note that the fields in the outputted items are sorted the same way as they are specified in the `fields` query parameter. You can use this feature to effectively fix the output format. -func (r ApiActRunsLastDatasetItemsGetRequest) Fields(fields string) ApiActRunsLastDatasetItemsGetRequest { - r.fields = &fields - return r -} - -// A comma-separated list of output field names that positionally rename the fields specified in the `fields` parameter. For example, `?fields=headline,url&outputFields=title,link` renames `headline` to `title` and `url` to `link` in the output. The number of names in `outputFields` must match the number of names in `fields`. Requires the `fields` parameter to be specified as well. -func (r ApiActRunsLastDatasetItemsGetRequest) OutputFields(outputFields string) ApiActRunsLastDatasetItemsGetRequest { - r.outputFields = &outputFields - return r -} - -// A comma-separated list of fields which should be omitted from the items. -func (r ApiActRunsLastDatasetItemsGetRequest) Omit(omit string) ApiActRunsLastDatasetItemsGetRequest { - r.omit = &omit - return r -} - -// A comma-separated list of fields which should be unwound, in order which they should be processed. Each field should be either an array or an object. If the field is an array then every element of the array will become a separate record and merged with parent object. If the unwound field is an object then it is merged with the parent object. If the unwound field is missing or its value is neither an array nor an object and therefore cannot be merged with a parent object then the item gets preserved as it is. Note that the unwound items ignore the `desc` parameter. -func (r ApiActRunsLastDatasetItemsGetRequest) Unwind(unwind string) ApiActRunsLastDatasetItemsGetRequest { - r.unwind = &unwind - return r -} - -// A comma-separated list of fields which should transform nested objects into flat structures. For example, with `flatten=\"foo\"` the object `{\"foo\":{\"bar\": \"hello\"}}` is turned into `{\"foo.bar\": \"hello\"}`. The original object with properties is replaced with the flattened object. -func (r ApiActRunsLastDatasetItemsGetRequest) Flatten(flatten string) ApiActRunsLastDatasetItemsGetRequest { - r.flatten = &flatten - return r -} - -// By default, results are returned in the same order as they were stored. To reverse the order, set this parameter to `true` or `1`. -func (r ApiActRunsLastDatasetItemsGetRequest) Desc(desc bool) ApiActRunsLastDatasetItemsGetRequest { - r.desc = &desc - return r -} - -// If `true` or `1` then the response will define the `Content-Disposition: attachment` header, forcing a web browser to download the file rather than to display it. By default this header is not present. -func (r ApiActRunsLastDatasetItemsGetRequest) Attachment(attachment bool) ApiActRunsLastDatasetItemsGetRequest { - r.attachment = &attachment - return r -} - -// A delimiter character for CSV files, only used if `format=csv`. You might need to URL-encode the character (e.g. use `%09` for tab or `%3B` for semicolon). The default delimiter is a simple comma (`,`). -func (r ApiActRunsLastDatasetItemsGetRequest) Delimiter(delimiter string) ApiActRunsLastDatasetItemsGetRequest { - r.delimiter = &delimiter - return r -} - -// All text responses are encoded in UTF-8 encoding. By default, the `format=csv` files are prefixed with the UTF-8 Byte Order Mark (BOM), while `json`, `jsonl`, `xml`, `html` and `rss` files are not. If you want to override this default behavior, specify `bom=1` query parameter to include the BOM or `bom=0` to skip it. -func (r ApiActRunsLastDatasetItemsGetRequest) Bom(bom bool) ApiActRunsLastDatasetItemsGetRequest { - r.bom = &bom - return r -} - -// Overrides default root element name of `xml` output. By default the root element is `items`. -func (r ApiActRunsLastDatasetItemsGetRequest) XmlRoot(xmlRoot string) ApiActRunsLastDatasetItemsGetRequest { - r.xmlRoot = &xmlRoot - return r -} - -// Overrides default element name that wraps each page or page function result object in `xml` output. By default the element name is `item`. -func (r ApiActRunsLastDatasetItemsGetRequest) XmlRow(xmlRow string) ApiActRunsLastDatasetItemsGetRequest { - r.xmlRow = &xmlRow - return r -} - -// If `true` or `1` then header row in the `csv` format is skipped. -func (r ApiActRunsLastDatasetItemsGetRequest) SkipHeaderRow(skipHeaderRow bool) ApiActRunsLastDatasetItemsGetRequest { - r.skipHeaderRow = &skipHeaderRow - return r -} - -// If `true` or `1` then hidden fields are skipped from the output, i.e. fields starting with the `#` character. -func (r ApiActRunsLastDatasetItemsGetRequest) SkipHidden(skipHidden bool) ApiActRunsLastDatasetItemsGetRequest { - r.skipHidden = &skipHidden - return r -} - -// If `true` or `1` then empty items are skipped from the output. Note that if used, the results might contain less items than the limit value. -func (r ApiActRunsLastDatasetItemsGetRequest) SkipEmpty(skipEmpty bool) ApiActRunsLastDatasetItemsGetRequest { - r.skipEmpty = &skipEmpty - return r -} - -// If `true` or `1` then, the endpoint applies the `fields=url,pageFunctionResult,errorInfo` and `unwind=pageFunctionResult` query parameters. This feature is used to emulate simplified results provided by the legacy Apify Crawler product and it's not recommended to use it in new integrations. -func (r ApiActRunsLastDatasetItemsGetRequest) Simplified(simplified bool) ApiActRunsLastDatasetItemsGetRequest { - r.simplified = &simplified - return r -} - -// Defines the view configuration for dataset items based on the schema definition. This parameter determines how the data will be filtered and presented. For complete specification details, see the [dataset schema documentation](/platform/actors/development/actor-definition/dataset-schema). -func (r ApiActRunsLastDatasetItemsGetRequest) View(view string) ApiActRunsLastDatasetItemsGetRequest { - r.view = &view - return r -} - -// If `true` or `1` then, the all the items with errorInfo property will be skipped from the output. This feature is here to emulate functionality of API version 1 used for the legacy Apify Crawler product and it's not recommended to use it in new integrations. -func (r ApiActRunsLastDatasetItemsGetRequest) SkipFailedPages(skipFailedPages bool) ApiActRunsLastDatasetItemsGetRequest { - r.skipFailedPages = &skipFailedPages - return r -} - -// Overrides the auto-generated RSS channel `<title>` element. Only used when `format=rss`. If not provided, the title defaults to `Dataset <label>`. -func (r ApiActRunsLastDatasetItemsGetRequest) FeedTitle(feedTitle string) ApiActRunsLastDatasetItemsGetRequest { - r.feedTitle = &feedTitle - return r -} - -// Overrides the auto-generated RSS channel `<description>` element. Only used when `format=rss`. If not provided, the description defaults to `Items in dataset with id \"<datasetId>\".` -func (r ApiActRunsLastDatasetItemsGetRequest) FeedDescription(feedDescription string) ApiActRunsLastDatasetItemsGetRequest { - r.feedDescription = &feedDescription - return r -} - -// Signature used for the access. -func (r ApiActRunsLastDatasetItemsGetRequest) Signature(signature string) ApiActRunsLastDatasetItemsGetRequest { - r.signature = &signature - return r -} - -func (r ApiActRunsLastDatasetItemsGetRequest) Execute() ([]map[string]interface{}, *http.Response, error) { - return r.ApiService.ActRunsLastDatasetItemsGetExecute(r) -} - -/* -ActRunsLastDatasetItemsGet Get last run's dataset items - -Returns data stored in the default dataset of the last Actor run in the desired format. - -This endpoint is a shortcut that resolves the last run's `defaultDatasetId` and proxies to the -[Get dataset items](/api/v2/dataset-items-get) endpoint. - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param actorId Actor ID or a tilde-separated owner's username and Actor name. - @return ApiActRunsLastDatasetItemsGetRequest -*/ -func (a *LastActorRunsDefaultDatasetAPIService) ActRunsLastDatasetItemsGet(ctx context.Context, actorId string) ApiActRunsLastDatasetItemsGetRequest { - return ApiActRunsLastDatasetItemsGetRequest{ - ApiService: a, - ctx: ctx, - actorId: actorId, - } -} - -// Execute executes the request -// @return []map[string]interface{} -func (a *LastActorRunsDefaultDatasetAPIService) ActRunsLastDatasetItemsGetExecute(r ApiActRunsLastDatasetItemsGetRequest) ([]map[string]interface{}, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue []map[string]interface{} - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LastActorRunsDefaultDatasetAPIService.ActRunsLastDatasetItemsGet") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/actors/{actorId}/runs/last/dataset/items" - localVarPath = strings.Replace(localVarPath, "{"+"actorId"+"}", url.PathEscape(parameterValueToString(r.actorId, "actorId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if r.status != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "status", r.status, "form", "") - } - if r.format != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "format", r.format, "form", "") - } - if r.clean != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "clean", r.clean, "form", "") - } - if r.offset != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "form", "") - } - if r.limit != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "form", "") - } - if r.fields != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "fields", r.fields, "form", "") - } - if r.outputFields != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "outputFields", r.outputFields, "form", "") - } - if r.omit != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "omit", r.omit, "form", "") - } - if r.unwind != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "unwind", r.unwind, "form", "") - } - if r.flatten != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "flatten", r.flatten, "form", "") - } - if r.desc != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "desc", r.desc, "form", "") - } - if r.attachment != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "attachment", r.attachment, "form", "") - } - if r.delimiter != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "delimiter", r.delimiter, "form", "") - } - if r.bom != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "bom", r.bom, "form", "") - } - if r.xmlRoot != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "xmlRoot", r.xmlRoot, "form", "") - } - if r.xmlRow != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "xmlRow", r.xmlRow, "form", "") - } - if r.skipHeaderRow != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "skipHeaderRow", r.skipHeaderRow, "form", "") - } - if r.skipHidden != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "skipHidden", r.skipHidden, "form", "") - } - if r.skipEmpty != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "skipEmpty", r.skipEmpty, "form", "") - } - if r.simplified != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "simplified", r.simplified, "form", "") - } - if r.view != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "view", r.view, "form", "") - } - if r.skipFailedPages != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "skipFailedPages", r.skipFailedPages, "form", "") - } - if r.feedTitle != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "feedTitle", r.feedTitle, "form", "") - } - if r.feedDescription != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "feedDescription", r.feedDescription, "form", "") - } - if r.signature != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "signature", r.signature, "form", "") - } - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json", "application/jsonl", "text/csv", "text/html", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", "application/rss+xml", "application/xml"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiActRunsLastDatasetItemsPostRequest struct { - ctx context.Context - ApiService *LastActorRunsDefaultDatasetAPIService - actorId string - actRunsLastDatasetItemsPostRequest *ActRunsLastDatasetItemsPostRequest - status *string -} - -// -func (r ApiActRunsLastDatasetItemsPostRequest) ActRunsLastDatasetItemsPostRequest(actRunsLastDatasetItemsPostRequest ActRunsLastDatasetItemsPostRequest) ApiActRunsLastDatasetItemsPostRequest { - r.actRunsLastDatasetItemsPostRequest = &actRunsLastDatasetItemsPostRequest - return r -} - -// Filter for the run status. -func (r ApiActRunsLastDatasetItemsPostRequest) Status(status string) ApiActRunsLastDatasetItemsPostRequest { - r.status = &status - return r -} - -func (r ApiActRunsLastDatasetItemsPostRequest) Execute() (map[string]interface{}, *http.Response, error) { - return r.ApiService.ActRunsLastDatasetItemsPostExecute(r) -} - -/* -ActRunsLastDatasetItemsPost Store items in last run's dataset - -Appends an item or an array of items to the end of the last Actor run's default dataset. - -This endpoint is a shortcut that resolves the last run's `defaultDatasetId` and proxies to the -[Store items](/api/v2/dataset-items-post) endpoint. - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param actorId Actor ID or a tilde-separated owner's username and Actor name. - @return ApiActRunsLastDatasetItemsPostRequest -*/ -func (a *LastActorRunsDefaultDatasetAPIService) ActRunsLastDatasetItemsPost(ctx context.Context, actorId string) ApiActRunsLastDatasetItemsPostRequest { - return ApiActRunsLastDatasetItemsPostRequest{ - ApiService: a, - ctx: ctx, - actorId: actorId, - } -} - -// Execute executes the request -// @return map[string]interface{} -func (a *LastActorRunsDefaultDatasetAPIService) ActRunsLastDatasetItemsPostExecute(r ApiActRunsLastDatasetItemsPostRequest) (map[string]interface{}, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodPost - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue map[string]interface{} - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LastActorRunsDefaultDatasetAPIService.ActRunsLastDatasetItemsPost") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/actors/{actorId}/runs/last/dataset/items" - localVarPath = strings.Replace(localVarPath, "{"+"actorId"+"}", url.PathEscape(parameterValueToString(r.actorId, "actorId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - if r.actRunsLastDatasetItemsPostRequest == nil { - return localVarReturnValue, nil, reportError("actRunsLastDatasetItemsPostRequest is required and must be specified") - } - - if r.status != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "status", r.status, "form", "") - } - // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/json"} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - // body params - localVarPostBody = r.actRunsLastDatasetItemsPostRequest - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ActRunsLastDatasetItemsPost400Response - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiActRunsLastDatasetPutRequest struct { - ctx context.Context - ApiService *LastActorRunsDefaultDatasetAPIService - actorId string - updateDatasetRequest *UpdateDatasetRequest - status *string -} - -// -func (r ApiActRunsLastDatasetPutRequest) UpdateDatasetRequest(updateDatasetRequest UpdateDatasetRequest) ApiActRunsLastDatasetPutRequest { - r.updateDatasetRequest = &updateDatasetRequest - return r -} - -// Filter for the run status. -func (r ApiActRunsLastDatasetPutRequest) Status(status string) ApiActRunsLastDatasetPutRequest { - r.status = &status - return r -} - -func (r ApiActRunsLastDatasetPutRequest) Execute() (*DatasetResponse, *http.Response, error) { - return r.ApiService.ActRunsLastDatasetPutExecute(r) -} - -/* -ActRunsLastDatasetPut Update last run's default dataset - -Updates the default dataset associated with the last Actor run. - -This endpoint is a shortcut for getting the last run's `defaultDatasetId` and then using the -[Update dataset](/api/v2/dataset-put) endpoint. - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param actorId Actor ID or a tilde-separated owner's username and Actor name. - @return ApiActRunsLastDatasetPutRequest -*/ -func (a *LastActorRunsDefaultDatasetAPIService) ActRunsLastDatasetPut(ctx context.Context, actorId string) ApiActRunsLastDatasetPutRequest { - return ApiActRunsLastDatasetPutRequest{ - ApiService: a, - ctx: ctx, - actorId: actorId, - } -} - -// Execute executes the request -// @return DatasetResponse -func (a *LastActorRunsDefaultDatasetAPIService) ActRunsLastDatasetPutExecute(r ApiActRunsLastDatasetPutRequest) (*DatasetResponse, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodPut - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *DatasetResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LastActorRunsDefaultDatasetAPIService.ActRunsLastDatasetPut") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/actors/{actorId}/runs/last/dataset" - localVarPath = strings.Replace(localVarPath, "{"+"actorId"+"}", url.PathEscape(parameterValueToString(r.actorId, "actorId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - if r.updateDatasetRequest == nil { - return localVarReturnValue, nil, reportError("updateDatasetRequest is required and must be specified") - } - - if r.status != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "status", r.status, "form", "") - } - // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/json"} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - // body params - localVarPostBody = r.updateDatasetRequest - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 413 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 415 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiActRunsLastDatasetStatisticsGetRequest struct { - ctx context.Context - ApiService *LastActorRunsDefaultDatasetAPIService - actorId string - status *string -} - -// Filter for the run status. -func (r ApiActRunsLastDatasetStatisticsGetRequest) Status(status string) ApiActRunsLastDatasetStatisticsGetRequest { - r.status = &status - return r -} - -func (r ApiActRunsLastDatasetStatisticsGetRequest) Execute() (*DatasetStatisticsResponse, *http.Response, error) { - return r.ApiService.ActRunsLastDatasetStatisticsGetExecute(r) -} - -/* -ActRunsLastDatasetStatisticsGet Get last run's dataset statistics - -Returns statistics for the last Actor run's default dataset. - -This endpoint is a shortcut that resolves the last run's `defaultDatasetId` and proxies to the -[Get dataset statistics](/api/v2/dataset-statistics-get) endpoint. - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param actorId Actor ID or a tilde-separated owner's username and Actor name. - @return ApiActRunsLastDatasetStatisticsGetRequest -*/ -func (a *LastActorRunsDefaultDatasetAPIService) ActRunsLastDatasetStatisticsGet(ctx context.Context, actorId string) ApiActRunsLastDatasetStatisticsGetRequest { - return ApiActRunsLastDatasetStatisticsGetRequest{ - ApiService: a, - ctx: ctx, - actorId: actorId, - } -} - -// Execute executes the request -// @return DatasetStatisticsResponse -func (a *LastActorRunsDefaultDatasetAPIService) ActRunsLastDatasetStatisticsGetExecute(r ApiActRunsLastDatasetStatisticsGetRequest) (*DatasetStatisticsResponse, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *DatasetStatisticsResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LastActorRunsDefaultDatasetAPIService.ActRunsLastDatasetStatisticsGet") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/actors/{actorId}/runs/last/dataset/statistics" - localVarPath = strings.Replace(localVarPath, "{"+"actorId"+"}", url.PathEscape(parameterValueToString(r.actorId, "actorId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if r.status != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "status", r.status, "form", "") - } - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} diff --git a/api_last_actor_runs_default_key_value_store.go b/api_last_actor_runs_default_key_value_store.go deleted file mode 100644 index ae0c51a..0000000 --- a/api_last_actor_runs_default_key_value_store.go +++ /dev/null @@ -1,2010 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "bytes" - "context" - "io" - "net/http" - "net/url" - "strings" - "os" -) - - -// LastActorRunsDefaultKeyValueStoreAPIService LastActorRunsDefaultKeyValueStoreAPI service -type LastActorRunsDefaultKeyValueStoreAPIService service - -type ApiActRunsLastKeyValueStoreDeleteRequest struct { - ctx context.Context - ApiService *LastActorRunsDefaultKeyValueStoreAPIService - actorId string - status *string -} - -// Filter for the run status. -func (r ApiActRunsLastKeyValueStoreDeleteRequest) Status(status string) ApiActRunsLastKeyValueStoreDeleteRequest { - r.status = &status - return r -} - -func (r ApiActRunsLastKeyValueStoreDeleteRequest) Execute() (*http.Response, error) { - return r.ApiService.ActRunsLastKeyValueStoreDeleteExecute(r) -} - -/* -ActRunsLastKeyValueStoreDelete Delete last run's default store - -Deletes the last Actor run key-value store. - -This endpoint is a shortcut for getting the run's `defaultKeyValueStoreId` and then using the -[Delete store](/api/v2/key-value-store-delete) endpoint. - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param actorId Actor ID or a tilde-separated owner's username and Actor name. - @return ApiActRunsLastKeyValueStoreDeleteRequest -*/ -func (a *LastActorRunsDefaultKeyValueStoreAPIService) ActRunsLastKeyValueStoreDelete(ctx context.Context, actorId string) ApiActRunsLastKeyValueStoreDeleteRequest { - return ApiActRunsLastKeyValueStoreDeleteRequest{ - ApiService: a, - ctx: ctx, - actorId: actorId, - } -} - -// Execute executes the request -func (a *LastActorRunsDefaultKeyValueStoreAPIService) ActRunsLastKeyValueStoreDeleteExecute(r ApiActRunsLastKeyValueStoreDeleteRequest) (*http.Response, error) { - var ( - localVarHTTPMethod = http.MethodDelete - localVarPostBody interface{} - formFiles []formFile - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LastActorRunsDefaultKeyValueStoreAPIService.ActRunsLastKeyValueStoreDelete") - if err != nil { - return nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/actors/{actorId}/runs/last/key-value-store" - localVarPath = strings.Replace(localVarPath, "{"+"actorId"+"}", url.PathEscape(parameterValueToString(r.actorId, "actorId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if r.status != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "status", r.status, "form", "") - } - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarHTTPResponse, newErr - } - - return localVarHTTPResponse, nil -} - -type ApiActRunsLastKeyValueStoreGetRequest struct { - ctx context.Context - ApiService *LastActorRunsDefaultKeyValueStoreAPIService - actorId string - status *string -} - -// Filter for the run status. -func (r ApiActRunsLastKeyValueStoreGetRequest) Status(status string) ApiActRunsLastKeyValueStoreGetRequest { - r.status = &status - return r -} - -func (r ApiActRunsLastKeyValueStoreGetRequest) Execute() (*KeyValueStoreResponse, *http.Response, error) { - return r.ApiService.ActRunsLastKeyValueStoreGetExecute(r) -} - -/* -ActRunsLastKeyValueStoreGet Get last run's default store - -Gets an object that contains all the details about the default key-value store associated with the last Actor run. - -This endpoint is a shortcut for getting the run's `defaultKeyValueStoreId` and then using the -[Get store](/api/v2/key-value-store-get) endpoint. - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param actorId Actor ID or a tilde-separated owner's username and Actor name. - @return ApiActRunsLastKeyValueStoreGetRequest -*/ -func (a *LastActorRunsDefaultKeyValueStoreAPIService) ActRunsLastKeyValueStoreGet(ctx context.Context, actorId string) ApiActRunsLastKeyValueStoreGetRequest { - return ApiActRunsLastKeyValueStoreGetRequest{ - ApiService: a, - ctx: ctx, - actorId: actorId, - } -} - -// Execute executes the request -// @return KeyValueStoreResponse -func (a *LastActorRunsDefaultKeyValueStoreAPIService) ActRunsLastKeyValueStoreGetExecute(r ApiActRunsLastKeyValueStoreGetRequest) (*KeyValueStoreResponse, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *KeyValueStoreResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LastActorRunsDefaultKeyValueStoreAPIService.ActRunsLastKeyValueStoreGet") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/actors/{actorId}/runs/last/key-value-store" - localVarPath = strings.Replace(localVarPath, "{"+"actorId"+"}", url.PathEscape(parameterValueToString(r.actorId, "actorId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if r.status != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "status", r.status, "form", "") - } - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiActRunsLastKeyValueStoreKeysGetRequest struct { - ctx context.Context - ApiService *LastActorRunsDefaultKeyValueStoreAPIService - actorId string - status *string - exclusiveStartKey *string - limit *float32 - collection *string - prefix *string - signature *string -} - -// Filter for the run status. -func (r ApiActRunsLastKeyValueStoreKeysGetRequest) Status(status string) ApiActRunsLastKeyValueStoreKeysGetRequest { - r.status = &status - return r -} - -// All keys up to this one (including) are skipped from the result. -func (r ApiActRunsLastKeyValueStoreKeysGetRequest) ExclusiveStartKey(exclusiveStartKey string) ApiActRunsLastKeyValueStoreKeysGetRequest { - r.exclusiveStartKey = &exclusiveStartKey - return r -} - -// Number of keys to be returned. -func (r ApiActRunsLastKeyValueStoreKeysGetRequest) Limit(limit float32) ApiActRunsLastKeyValueStoreKeysGetRequest { - r.limit = &limit - return r -} - -// Limit the results to keys that belong to a specific collection from the key-value store schema. The key-value store need to have a schema defined for this parameter to work. -func (r ApiActRunsLastKeyValueStoreKeysGetRequest) Collection(collection string) ApiActRunsLastKeyValueStoreKeysGetRequest { - r.collection = &collection - return r -} - -// Limit the results to keys that start with a specific prefix. -func (r ApiActRunsLastKeyValueStoreKeysGetRequest) Prefix(prefix string) ApiActRunsLastKeyValueStoreKeysGetRequest { - r.prefix = &prefix - return r -} - -// Signature used for the access. -func (r ApiActRunsLastKeyValueStoreKeysGetRequest) Signature(signature string) ApiActRunsLastKeyValueStoreKeysGetRequest { - r.signature = &signature - return r -} - -func (r ApiActRunsLastKeyValueStoreKeysGetRequest) Execute() (*ListOfKeysResponse, *http.Response, error) { - return r.ApiService.ActRunsLastKeyValueStoreKeysGetExecute(r) -} - -/* -ActRunsLastKeyValueStoreKeysGet Get last run's default store's list of keys - -Returns a list of keys for the default key-value store of the last Actor run. - -This endpoint is a shortcut for getting the last run's `defaultKeyValueStoreId` and then using the -[Get list of keys](/api/v2/key-value-store-keys-get) endpoint. - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param actorId Actor ID or a tilde-separated owner's username and Actor name. - @return ApiActRunsLastKeyValueStoreKeysGetRequest -*/ -func (a *LastActorRunsDefaultKeyValueStoreAPIService) ActRunsLastKeyValueStoreKeysGet(ctx context.Context, actorId string) ApiActRunsLastKeyValueStoreKeysGetRequest { - return ApiActRunsLastKeyValueStoreKeysGetRequest{ - ApiService: a, - ctx: ctx, - actorId: actorId, - } -} - -// Execute executes the request -// @return ListOfKeysResponse -func (a *LastActorRunsDefaultKeyValueStoreAPIService) ActRunsLastKeyValueStoreKeysGetExecute(r ApiActRunsLastKeyValueStoreKeysGetRequest) (*ListOfKeysResponse, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *ListOfKeysResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LastActorRunsDefaultKeyValueStoreAPIService.ActRunsLastKeyValueStoreKeysGet") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/actors/{actorId}/runs/last/key-value-store/keys" - localVarPath = strings.Replace(localVarPath, "{"+"actorId"+"}", url.PathEscape(parameterValueToString(r.actorId, "actorId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if r.status != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "status", r.status, "form", "") - } - if r.exclusiveStartKey != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "exclusiveStartKey", r.exclusiveStartKey, "form", "") - } - if r.limit != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "form", "") - } else { - var defaultValue float32 = 1000 - parameterAddToHeaderOrQuery(localVarQueryParams, "limit", defaultValue, "form", "") - r.limit = &defaultValue - } - if r.collection != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "collection", r.collection, "form", "") - } - if r.prefix != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "prefix", r.prefix, "form", "") - } - if r.signature != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "signature", r.signature, "form", "") - } - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiActRunsLastKeyValueStorePutRequest struct { - ctx context.Context - ApiService *LastActorRunsDefaultKeyValueStoreAPIService - actorId string - updateStoreRequest *UpdateStoreRequest - status *string -} - -// -func (r ApiActRunsLastKeyValueStorePutRequest) UpdateStoreRequest(updateStoreRequest UpdateStoreRequest) ApiActRunsLastKeyValueStorePutRequest { - r.updateStoreRequest = &updateStoreRequest - return r -} - -// Filter for the run status. -func (r ApiActRunsLastKeyValueStorePutRequest) Status(status string) ApiActRunsLastKeyValueStorePutRequest { - r.status = &status - return r -} - -func (r ApiActRunsLastKeyValueStorePutRequest) Execute() (*KeyValueStoreResponse, *http.Response, error) { - return r.ApiService.ActRunsLastKeyValueStorePutExecute(r) -} - -/* -ActRunsLastKeyValueStorePut Update last run's default store - -Updates the last Actor run key-value store's name and general resource access level using a value specified by a JSON object -passed in the PUT payload. - -This endpoint is a shortcut for getting the run's `defaultKeyValueStoreId` and then using the -[Update store](/api/v2/key-value-store-put) endpoint. - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param actorId Actor ID or a tilde-separated owner's username and Actor name. - @return ApiActRunsLastKeyValueStorePutRequest -*/ -func (a *LastActorRunsDefaultKeyValueStoreAPIService) ActRunsLastKeyValueStorePut(ctx context.Context, actorId string) ApiActRunsLastKeyValueStorePutRequest { - return ApiActRunsLastKeyValueStorePutRequest{ - ApiService: a, - ctx: ctx, - actorId: actorId, - } -} - -// Execute executes the request -// @return KeyValueStoreResponse -func (a *LastActorRunsDefaultKeyValueStoreAPIService) ActRunsLastKeyValueStorePutExecute(r ApiActRunsLastKeyValueStorePutRequest) (*KeyValueStoreResponse, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodPut - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *KeyValueStoreResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LastActorRunsDefaultKeyValueStoreAPIService.ActRunsLastKeyValueStorePut") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/actors/{actorId}/runs/last/key-value-store" - localVarPath = strings.Replace(localVarPath, "{"+"actorId"+"}", url.PathEscape(parameterValueToString(r.actorId, "actorId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - if r.updateStoreRequest == nil { - return localVarReturnValue, nil, reportError("updateStoreRequest is required and must be specified") - } - - if r.status != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "status", r.status, "form", "") - } - // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/json"} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - // body params - localVarPostBody = r.updateStoreRequest - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 413 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 415 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiActRunsLastKeyValueStoreRecordDeleteRequest struct { - ctx context.Context - ApiService *LastActorRunsDefaultKeyValueStoreAPIService - actorId string - recordKey string - status *string -} - -// Filter for the run status. -func (r ApiActRunsLastKeyValueStoreRecordDeleteRequest) Status(status string) ApiActRunsLastKeyValueStoreRecordDeleteRequest { - r.status = &status - return r -} - -func (r ApiActRunsLastKeyValueStoreRecordDeleteRequest) Execute() (*http.Response, error) { - return r.ApiService.ActRunsLastKeyValueStoreRecordDeleteExecute(r) -} - -/* -ActRunsLastKeyValueStoreRecordDelete Delete last run's default store's record - -Removes a record specified by a key from the default key-value store of the last Actor run. - -This endpoint is a shortcut for getting the last run's `defaultKeyValueStoreId` and then using the -[Delete record](/api/v2/key-value-store-record-delete) endpoint. - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param actorId Actor ID or a tilde-separated owner's username and Actor name. - @param recordKey Key of the record. - @return ApiActRunsLastKeyValueStoreRecordDeleteRequest -*/ -func (a *LastActorRunsDefaultKeyValueStoreAPIService) ActRunsLastKeyValueStoreRecordDelete(ctx context.Context, actorId string, recordKey string) ApiActRunsLastKeyValueStoreRecordDeleteRequest { - return ApiActRunsLastKeyValueStoreRecordDeleteRequest{ - ApiService: a, - ctx: ctx, - actorId: actorId, - recordKey: recordKey, - } -} - -// Execute executes the request -func (a *LastActorRunsDefaultKeyValueStoreAPIService) ActRunsLastKeyValueStoreRecordDeleteExecute(r ApiActRunsLastKeyValueStoreRecordDeleteRequest) (*http.Response, error) { - var ( - localVarHTTPMethod = http.MethodDelete - localVarPostBody interface{} - formFiles []formFile - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LastActorRunsDefaultKeyValueStoreAPIService.ActRunsLastKeyValueStoreRecordDelete") - if err != nil { - return nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/actors/{actorId}/runs/last/key-value-store/records/{recordKey}" - localVarPath = strings.Replace(localVarPath, "{"+"actorId"+"}", url.PathEscape(parameterValueToString(r.actorId, "actorId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"recordKey"+"}", url.PathEscape(parameterValueToString(r.recordKey, "recordKey")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if r.status != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "status", r.status, "form", "") - } - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarHTTPResponse, newErr - } - - return localVarHTTPResponse, nil -} - -type ApiActRunsLastKeyValueStoreRecordGetRequest struct { - ctx context.Context - ApiService *LastActorRunsDefaultKeyValueStoreAPIService - actorId string - recordKey string - status *string - signature *string - attachment *bool -} - -// Filter for the run status. -func (r ApiActRunsLastKeyValueStoreRecordGetRequest) Status(status string) ApiActRunsLastKeyValueStoreRecordGetRequest { - r.status = &status - return r -} - -// Signature used for the access. -func (r ApiActRunsLastKeyValueStoreRecordGetRequest) Signature(signature string) ApiActRunsLastKeyValueStoreRecordGetRequest { - r.signature = &signature - return r -} - -// If `true` or `1`, the response will be served with `Content-Disposition: attachment` header, causing web browsers to offer downloading HTML records instead of displaying them. -func (r ApiActRunsLastKeyValueStoreRecordGetRequest) Attachment(attachment bool) ApiActRunsLastKeyValueStoreRecordGetRequest { - r.attachment = &attachment - return r -} - -func (r ApiActRunsLastKeyValueStoreRecordGetRequest) Execute() (map[string]interface{}, *http.Response, error) { - return r.ApiService.ActRunsLastKeyValueStoreRecordGetExecute(r) -} - -/* -ActRunsLastKeyValueStoreRecordGet Get last run's default store's record - -Gets a value stored under a specific key in the default key-value store of the last Actor run. - -This endpoint is a shortcut for getting the last run's `defaultKeyValueStoreId` and then using the -[Get record](/api/v2/key-value-store-record-get) endpoint. - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param actorId Actor ID or a tilde-separated owner's username and Actor name. - @param recordKey Key of the record. - @return ApiActRunsLastKeyValueStoreRecordGetRequest -*/ -func (a *LastActorRunsDefaultKeyValueStoreAPIService) ActRunsLastKeyValueStoreRecordGet(ctx context.Context, actorId string, recordKey string) ApiActRunsLastKeyValueStoreRecordGetRequest { - return ApiActRunsLastKeyValueStoreRecordGetRequest{ - ApiService: a, - ctx: ctx, - actorId: actorId, - recordKey: recordKey, - } -} - -// Execute executes the request -// @return map[string]interface{} -func (a *LastActorRunsDefaultKeyValueStoreAPIService) ActRunsLastKeyValueStoreRecordGetExecute(r ApiActRunsLastKeyValueStoreRecordGetRequest) (map[string]interface{}, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue map[string]interface{} - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LastActorRunsDefaultKeyValueStoreAPIService.ActRunsLastKeyValueStoreRecordGet") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/actors/{actorId}/runs/last/key-value-store/records/{recordKey}" - localVarPath = strings.Replace(localVarPath, "{"+"actorId"+"}", url.PathEscape(parameterValueToString(r.actorId, "actorId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"recordKey"+"}", url.PathEscape(parameterValueToString(r.recordKey, "recordKey")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if r.status != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "status", r.status, "form", "") - } - if r.signature != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "signature", r.signature, "form", "") - } - if r.attachment != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "attachment", r.attachment, "form", "") - } - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json", "*/*"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiActRunsLastKeyValueStoreRecordPostRequest struct { - ctx context.Context - ApiService *LastActorRunsDefaultKeyValueStoreAPIService - actorId string - recordKey string - requestBody *map[string]interface{} - status *string - contentEncoding *string -} - -// -func (r ApiActRunsLastKeyValueStoreRecordPostRequest) RequestBody(requestBody map[string]interface{}) ApiActRunsLastKeyValueStoreRecordPostRequest { - r.requestBody = &requestBody - return r -} - -// Filter for the run status. -func (r ApiActRunsLastKeyValueStoreRecordPostRequest) Status(status string) ApiActRunsLastKeyValueStoreRecordPostRequest { - r.status = &status - return r -} - -// -func (r ApiActRunsLastKeyValueStoreRecordPostRequest) ContentEncoding(contentEncoding string) ApiActRunsLastKeyValueStoreRecordPostRequest { - r.contentEncoding = &contentEncoding - return r -} - -func (r ApiActRunsLastKeyValueStoreRecordPostRequest) Execute() (map[string]interface{}, *http.Response, error) { - return r.ApiService.ActRunsLastKeyValueStoreRecordPostExecute(r) -} - -/* -ActRunsLastKeyValueStoreRecordPost Store record in last run's default store (POST) - -Stores a value under a specific key in the default key-value store of the last Actor run. - -This endpoint is a shortcut for getting the last run's `defaultKeyValueStoreId` and then using the -[Store record](/api/v2/key-value-store-record-post) endpoint. - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param actorId Actor ID or a tilde-separated owner's username and Actor name. - @param recordKey Key of the record. - @return ApiActRunsLastKeyValueStoreRecordPostRequest -*/ -func (a *LastActorRunsDefaultKeyValueStoreAPIService) ActRunsLastKeyValueStoreRecordPost(ctx context.Context, actorId string, recordKey string) ApiActRunsLastKeyValueStoreRecordPostRequest { - return ApiActRunsLastKeyValueStoreRecordPostRequest{ - ApiService: a, - ctx: ctx, - actorId: actorId, - recordKey: recordKey, - } -} - -// Execute executes the request -// @return map[string]interface{} -func (a *LastActorRunsDefaultKeyValueStoreAPIService) ActRunsLastKeyValueStoreRecordPostExecute(r ApiActRunsLastKeyValueStoreRecordPostRequest) (map[string]interface{}, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodPost - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue map[string]interface{} - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LastActorRunsDefaultKeyValueStoreAPIService.ActRunsLastKeyValueStoreRecordPost") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/actors/{actorId}/runs/last/key-value-store/records/{recordKey}" - localVarPath = strings.Replace(localVarPath, "{"+"actorId"+"}", url.PathEscape(parameterValueToString(r.actorId, "actorId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"recordKey"+"}", url.PathEscape(parameterValueToString(r.recordKey, "recordKey")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - if r.requestBody == nil { - return localVarReturnValue, nil, reportError("requestBody is required and must be specified") - } - - if r.status != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "status", r.status, "form", "") - } - // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/json"} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - if r.contentEncoding != nil { - parameterAddToHeaderOrQuery(localVarHeaderParams, "Content-Encoding", r.contentEncoding, "simple", "") - } - // body params - localVarPostBody = r.requestBody - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 413 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 415 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiActRunsLastKeyValueStoreRecordPutRequest struct { - ctx context.Context - ApiService *LastActorRunsDefaultKeyValueStoreAPIService - actorId string - recordKey string - requestBody *map[string]interface{} - status *string - contentEncoding *string -} - -// -func (r ApiActRunsLastKeyValueStoreRecordPutRequest) RequestBody(requestBody map[string]interface{}) ApiActRunsLastKeyValueStoreRecordPutRequest { - r.requestBody = &requestBody - return r -} - -// Filter for the run status. -func (r ApiActRunsLastKeyValueStoreRecordPutRequest) Status(status string) ApiActRunsLastKeyValueStoreRecordPutRequest { - r.status = &status - return r -} - -// -func (r ApiActRunsLastKeyValueStoreRecordPutRequest) ContentEncoding(contentEncoding string) ApiActRunsLastKeyValueStoreRecordPutRequest { - r.contentEncoding = &contentEncoding - return r -} - -func (r ApiActRunsLastKeyValueStoreRecordPutRequest) Execute() (map[string]interface{}, *http.Response, error) { - return r.ApiService.ActRunsLastKeyValueStoreRecordPutExecute(r) -} - -/* -ActRunsLastKeyValueStoreRecordPut Store record in last run's default store - -Stores a value under a specific key in the default key-value store of the last Actor run. - -This endpoint is a shortcut for getting the last run's `defaultKeyValueStoreId` and then using the -[Store record](/api/v2/key-value-store-record-put) endpoint. - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param actorId Actor ID or a tilde-separated owner's username and Actor name. - @param recordKey Key of the record. - @return ApiActRunsLastKeyValueStoreRecordPutRequest -*/ -func (a *LastActorRunsDefaultKeyValueStoreAPIService) ActRunsLastKeyValueStoreRecordPut(ctx context.Context, actorId string, recordKey string) ApiActRunsLastKeyValueStoreRecordPutRequest { - return ApiActRunsLastKeyValueStoreRecordPutRequest{ - ApiService: a, - ctx: ctx, - actorId: actorId, - recordKey: recordKey, - } -} - -// Execute executes the request -// @return map[string]interface{} -func (a *LastActorRunsDefaultKeyValueStoreAPIService) ActRunsLastKeyValueStoreRecordPutExecute(r ApiActRunsLastKeyValueStoreRecordPutRequest) (map[string]interface{}, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodPut - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue map[string]interface{} - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LastActorRunsDefaultKeyValueStoreAPIService.ActRunsLastKeyValueStoreRecordPut") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/actors/{actorId}/runs/last/key-value-store/records/{recordKey}" - localVarPath = strings.Replace(localVarPath, "{"+"actorId"+"}", url.PathEscape(parameterValueToString(r.actorId, "actorId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"recordKey"+"}", url.PathEscape(parameterValueToString(r.recordKey, "recordKey")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - if r.requestBody == nil { - return localVarReturnValue, nil, reportError("requestBody is required and must be specified") - } - - if r.status != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "status", r.status, "form", "") - } - // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/json"} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - if r.contentEncoding != nil { - parameterAddToHeaderOrQuery(localVarHeaderParams, "Content-Encoding", r.contentEncoding, "simple", "") - } - // body params - localVarPostBody = r.requestBody - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 413 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 415 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiActRunsLastKeyValueStoreRecordsGetRequest struct { - ctx context.Context - ApiService *LastActorRunsDefaultKeyValueStoreAPIService - actorId string - status *string - collection *string - prefix *string - signature *string -} - -// Filter for the run status. -func (r ApiActRunsLastKeyValueStoreRecordsGetRequest) Status(status string) ApiActRunsLastKeyValueStoreRecordsGetRequest { - r.status = &status - return r -} - -// If specified, only records belonging to a specific collection from the key-value store schema. The key-value store need to have a schema defined for this parameter to work. -func (r ApiActRunsLastKeyValueStoreRecordsGetRequest) Collection(collection string) ApiActRunsLastKeyValueStoreRecordsGetRequest { - r.collection = &collection - return r -} - -// If specified, only records whose key starts with the given prefix are included in the archive. -func (r ApiActRunsLastKeyValueStoreRecordsGetRequest) Prefix(prefix string) ApiActRunsLastKeyValueStoreRecordsGetRequest { - r.prefix = &prefix - return r -} - -// Signature used for the access. -func (r ApiActRunsLastKeyValueStoreRecordsGetRequest) Signature(signature string) ApiActRunsLastKeyValueStoreRecordsGetRequest { - r.signature = &signature - return r -} - -func (r ApiActRunsLastKeyValueStoreRecordsGetRequest) Execute() (*os.File, *http.Response, error) { - return r.ApiService.ActRunsLastKeyValueStoreRecordsGetExecute(r) -} - -/* -ActRunsLastKeyValueStoreRecordsGet Download last run's default store's records - -Downloads all records from the default key-value store of the last Actor run as a ZIP archive. - -This endpoint is a shortcut for getting the last run's `defaultKeyValueStoreId` and then using the -[Download records](/api/v2/key-value-store-records-get) endpoint. - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param actorId Actor ID or a tilde-separated owner's username and Actor name. - @return ApiActRunsLastKeyValueStoreRecordsGetRequest -*/ -func (a *LastActorRunsDefaultKeyValueStoreAPIService) ActRunsLastKeyValueStoreRecordsGet(ctx context.Context, actorId string) ApiActRunsLastKeyValueStoreRecordsGetRequest { - return ApiActRunsLastKeyValueStoreRecordsGetRequest{ - ApiService: a, - ctx: ctx, - actorId: actorId, - } -} - -// Execute executes the request -// @return *os.File -func (a *LastActorRunsDefaultKeyValueStoreAPIService) ActRunsLastKeyValueStoreRecordsGetExecute(r ApiActRunsLastKeyValueStoreRecordsGetRequest) (*os.File, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *os.File - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LastActorRunsDefaultKeyValueStoreAPIService.ActRunsLastKeyValueStoreRecordsGet") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/actors/{actorId}/runs/last/key-value-store/records" - localVarPath = strings.Replace(localVarPath, "{"+"actorId"+"}", url.PathEscape(parameterValueToString(r.actorId, "actorId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if r.status != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "status", r.status, "form", "") - } - if r.collection != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "collection", r.collection, "form", "") - } - if r.prefix != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "prefix", r.prefix, "form", "") - } - if r.signature != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "signature", r.signature, "form", "") - } - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/zip", "application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} diff --git a/api_last_actor_runs_default_request_queue.go b/api_last_actor_runs_default_request_queue.go deleted file mode 100644 index eb4fc5f..0000000 --- a/api_last_actor_runs_default_request_queue.go +++ /dev/null @@ -1,3376 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "bytes" - "context" - "io" - "net/http" - "net/url" - "strings" -) - - -// LastActorRunsDefaultRequestQueueAPIService LastActorRunsDefaultRequestQueueAPI service -type LastActorRunsDefaultRequestQueueAPIService service - -type ApiActRunsLastRequestQueueDeleteRequest struct { - ctx context.Context - ApiService *LastActorRunsDefaultRequestQueueAPIService - actorId string - status *string -} - -// Filter for the run status. -func (r ApiActRunsLastRequestQueueDeleteRequest) Status(status string) ApiActRunsLastRequestQueueDeleteRequest { - r.status = &status - return r -} - -func (r ApiActRunsLastRequestQueueDeleteRequest) Execute() (*http.Response, error) { - return r.ApiService.ActRunsLastRequestQueueDeleteExecute(r) -} - -/* -ActRunsLastRequestQueueDelete Delete last run's default request queue - -Deletes the default request queue associated with the last Actor run. - -This endpoint is a shortcut for getting the last run's `defaultRequestQueueId` and then using the -[Delete request queue](/api/v2/request-queue-delete) endpoint. - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param actorId Actor ID or a tilde-separated owner's username and Actor name. - @return ApiActRunsLastRequestQueueDeleteRequest -*/ -func (a *LastActorRunsDefaultRequestQueueAPIService) ActRunsLastRequestQueueDelete(ctx context.Context, actorId string) ApiActRunsLastRequestQueueDeleteRequest { - return ApiActRunsLastRequestQueueDeleteRequest{ - ApiService: a, - ctx: ctx, - actorId: actorId, - } -} - -// Execute executes the request -func (a *LastActorRunsDefaultRequestQueueAPIService) ActRunsLastRequestQueueDeleteExecute(r ApiActRunsLastRequestQueueDeleteRequest) (*http.Response, error) { - var ( - localVarHTTPMethod = http.MethodDelete - localVarPostBody interface{} - formFiles []formFile - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LastActorRunsDefaultRequestQueueAPIService.ActRunsLastRequestQueueDelete") - if err != nil { - return nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/actors/{actorId}/runs/last/request-queue" - localVarPath = strings.Replace(localVarPath, "{"+"actorId"+"}", url.PathEscape(parameterValueToString(r.actorId, "actorId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if r.status != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "status", r.status, "form", "") - } - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarHTTPResponse, newErr - } - - return localVarHTTPResponse, nil -} - -type ApiActRunsLastRequestQueueGetRequest struct { - ctx context.Context - ApiService *LastActorRunsDefaultRequestQueueAPIService - actorId string - status *string -} - -// Filter for the run status. -func (r ApiActRunsLastRequestQueueGetRequest) Status(status string) ApiActRunsLastRequestQueueGetRequest { - r.status = &status - return r -} - -func (r ApiActRunsLastRequestQueueGetRequest) Execute() (*RequestQueueResponse, *http.Response, error) { - return r.ApiService.ActRunsLastRequestQueueGetExecute(r) -} - -/* -ActRunsLastRequestQueueGet Get last run's default request queue - -Returns the default request queue associated with the last Actor run. - -This endpoint is a shortcut for getting the last run's `defaultRequestQueueId` and then using the -[Get request queue](/api/v2/request-queue-get) endpoint. - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param actorId Actor ID or a tilde-separated owner's username and Actor name. - @return ApiActRunsLastRequestQueueGetRequest -*/ -func (a *LastActorRunsDefaultRequestQueueAPIService) ActRunsLastRequestQueueGet(ctx context.Context, actorId string) ApiActRunsLastRequestQueueGetRequest { - return ApiActRunsLastRequestQueueGetRequest{ - ApiService: a, - ctx: ctx, - actorId: actorId, - } -} - -// Execute executes the request -// @return RequestQueueResponse -func (a *LastActorRunsDefaultRequestQueueAPIService) ActRunsLastRequestQueueGetExecute(r ApiActRunsLastRequestQueueGetRequest) (*RequestQueueResponse, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *RequestQueueResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LastActorRunsDefaultRequestQueueAPIService.ActRunsLastRequestQueueGet") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/actors/{actorId}/runs/last/request-queue" - localVarPath = strings.Replace(localVarPath, "{"+"actorId"+"}", url.PathEscape(parameterValueToString(r.actorId, "actorId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if r.status != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "status", r.status, "form", "") - } - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiActRunsLastRequestQueueHeadGetRequest struct { - ctx context.Context - ApiService *LastActorRunsDefaultRequestQueueAPIService - actorId string - status *string - limit *float64 - clientKey *string -} - -// Filter for the run status. -func (r ApiActRunsLastRequestQueueHeadGetRequest) Status(status string) ApiActRunsLastRequestQueueHeadGetRequest { - r.status = &status - return r -} - -// How many items from queue should be returned. -func (r ApiActRunsLastRequestQueueHeadGetRequest) Limit(limit float64) ApiActRunsLastRequestQueueHeadGetRequest { - r.limit = &limit - return r -} - -// A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. -func (r ApiActRunsLastRequestQueueHeadGetRequest) ClientKey(clientKey string) ApiActRunsLastRequestQueueHeadGetRequest { - r.clientKey = &clientKey - return r -} - -func (r ApiActRunsLastRequestQueueHeadGetRequest) Execute() (*HeadResponse, *http.Response, error) { - return r.ApiService.ActRunsLastRequestQueueHeadGetExecute(r) -} - -/* -ActRunsLastRequestQueueHeadGet Get last run's default request queue head - -Returns the given number of first requests from the default request queue of the last Actor run. - -This endpoint is a shortcut for getting the last run's `defaultRequestQueueId` and then using the -[Get head](/api/v2/request-queue-head-get) endpoint. - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param actorId Actor ID or a tilde-separated owner's username and Actor name. - @return ApiActRunsLastRequestQueueHeadGetRequest -*/ -func (a *LastActorRunsDefaultRequestQueueAPIService) ActRunsLastRequestQueueHeadGet(ctx context.Context, actorId string) ApiActRunsLastRequestQueueHeadGetRequest { - return ApiActRunsLastRequestQueueHeadGetRequest{ - ApiService: a, - ctx: ctx, - actorId: actorId, - } -} - -// Execute executes the request -// @return HeadResponse -func (a *LastActorRunsDefaultRequestQueueAPIService) ActRunsLastRequestQueueHeadGetExecute(r ApiActRunsLastRequestQueueHeadGetRequest) (*HeadResponse, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *HeadResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LastActorRunsDefaultRequestQueueAPIService.ActRunsLastRequestQueueHeadGet") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/actors/{actorId}/runs/last/request-queue/head" - localVarPath = strings.Replace(localVarPath, "{"+"actorId"+"}", url.PathEscape(parameterValueToString(r.actorId, "actorId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if r.status != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "status", r.status, "form", "") - } - if r.limit != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "form", "") - } - if r.clientKey != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "clientKey", r.clientKey, "form", "") - } - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiActRunsLastRequestQueueHeadLockPostRequest struct { - ctx context.Context - ApiService *LastActorRunsDefaultRequestQueueAPIService - actorId string - lockSecs *float64 - status *string - limit *float64 - clientKey *string -} - -// How long the requests will be locked for (in seconds). -func (r ApiActRunsLastRequestQueueHeadLockPostRequest) LockSecs(lockSecs float64) ApiActRunsLastRequestQueueHeadLockPostRequest { - r.lockSecs = &lockSecs - return r -} - -// Filter for the run status. -func (r ApiActRunsLastRequestQueueHeadLockPostRequest) Status(status string) ApiActRunsLastRequestQueueHeadLockPostRequest { - r.status = &status - return r -} - -// How many items from the queue should be returned. -func (r ApiActRunsLastRequestQueueHeadLockPostRequest) Limit(limit float64) ApiActRunsLastRequestQueueHeadLockPostRequest { - r.limit = &limit - return r -} - -// A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. -func (r ApiActRunsLastRequestQueueHeadLockPostRequest) ClientKey(clientKey string) ApiActRunsLastRequestQueueHeadLockPostRequest { - r.clientKey = &clientKey - return r -} - -func (r ApiActRunsLastRequestQueueHeadLockPostRequest) Execute() (*HeadAndLockResponse, *http.Response, error) { - return r.ApiService.ActRunsLastRequestQueueHeadLockPostExecute(r) -} - -/* -ActRunsLastRequestQueueHeadLockPost Get and lock last run's default request queue head - -Returns the given number of first requests from the default request queue of the last Actor run -and locks them for the given time. - -This endpoint is a shortcut for getting the last run's `defaultRequestQueueId` and then using the -[Get head and lock](/api/v2/request-queue-head-lock-post) endpoint. - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param actorId Actor ID or a tilde-separated owner's username and Actor name. - @return ApiActRunsLastRequestQueueHeadLockPostRequest -*/ -func (a *LastActorRunsDefaultRequestQueueAPIService) ActRunsLastRequestQueueHeadLockPost(ctx context.Context, actorId string) ApiActRunsLastRequestQueueHeadLockPostRequest { - return ApiActRunsLastRequestQueueHeadLockPostRequest{ - ApiService: a, - ctx: ctx, - actorId: actorId, - } -} - -// Execute executes the request -// @return HeadAndLockResponse -func (a *LastActorRunsDefaultRequestQueueAPIService) ActRunsLastRequestQueueHeadLockPostExecute(r ApiActRunsLastRequestQueueHeadLockPostRequest) (*HeadAndLockResponse, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodPost - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *HeadAndLockResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LastActorRunsDefaultRequestQueueAPIService.ActRunsLastRequestQueueHeadLockPost") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/actors/{actorId}/runs/last/request-queue/head/lock" - localVarPath = strings.Replace(localVarPath, "{"+"actorId"+"}", url.PathEscape(parameterValueToString(r.actorId, "actorId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - if r.lockSecs == nil { - return localVarReturnValue, nil, reportError("lockSecs is required and must be specified") - } - - if r.status != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "status", r.status, "form", "") - } - parameterAddToHeaderOrQuery(localVarQueryParams, "lockSecs", r.lockSecs, "form", "") - if r.limit != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "form", "") - } - if r.clientKey != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "clientKey", r.clientKey, "form", "") - } - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiActRunsLastRequestQueuePutRequest struct { - ctx context.Context - ApiService *LastActorRunsDefaultRequestQueueAPIService - actorId string - updateRequestQueueRequest *UpdateRequestQueueRequest - status *string -} - -// -func (r ApiActRunsLastRequestQueuePutRequest) UpdateRequestQueueRequest(updateRequestQueueRequest UpdateRequestQueueRequest) ApiActRunsLastRequestQueuePutRequest { - r.updateRequestQueueRequest = &updateRequestQueueRequest - return r -} - -// Filter for the run status. -func (r ApiActRunsLastRequestQueuePutRequest) Status(status string) ApiActRunsLastRequestQueuePutRequest { - r.status = &status - return r -} - -func (r ApiActRunsLastRequestQueuePutRequest) Execute() (*RequestQueueResponse, *http.Response, error) { - return r.ApiService.ActRunsLastRequestQueuePutExecute(r) -} - -/* -ActRunsLastRequestQueuePut Update last run's default request queue - -Updates the default request queue associated with the last Actor run. - -This endpoint is a shortcut for getting the last run's `defaultRequestQueueId` and then using the -[Update request queue](/api/v2/request-queue-put) endpoint. - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param actorId Actor ID or a tilde-separated owner's username and Actor name. - @return ApiActRunsLastRequestQueuePutRequest -*/ -func (a *LastActorRunsDefaultRequestQueueAPIService) ActRunsLastRequestQueuePut(ctx context.Context, actorId string) ApiActRunsLastRequestQueuePutRequest { - return ApiActRunsLastRequestQueuePutRequest{ - ApiService: a, - ctx: ctx, - actorId: actorId, - } -} - -// Execute executes the request -// @return RequestQueueResponse -func (a *LastActorRunsDefaultRequestQueueAPIService) ActRunsLastRequestQueuePutExecute(r ApiActRunsLastRequestQueuePutRequest) (*RequestQueueResponse, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodPut - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *RequestQueueResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LastActorRunsDefaultRequestQueueAPIService.ActRunsLastRequestQueuePut") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/actors/{actorId}/runs/last/request-queue" - localVarPath = strings.Replace(localVarPath, "{"+"actorId"+"}", url.PathEscape(parameterValueToString(r.actorId, "actorId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - if r.updateRequestQueueRequest == nil { - return localVarReturnValue, nil, reportError("updateRequestQueueRequest is required and must be specified") - } - - if r.status != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "status", r.status, "form", "") - } - // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/json"} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - // body params - localVarPostBody = r.updateRequestQueueRequest - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 413 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 415 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiActRunsLastRequestQueueRequestDeleteRequest struct { - ctx context.Context - ApiService *LastActorRunsDefaultRequestQueueAPIService - actorId string - requestId string - status *string - clientKey *string -} - -// Filter for the run status. -func (r ApiActRunsLastRequestQueueRequestDeleteRequest) Status(status string) ApiActRunsLastRequestQueueRequestDeleteRequest { - r.status = &status - return r -} - -// A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. -func (r ApiActRunsLastRequestQueueRequestDeleteRequest) ClientKey(clientKey string) ApiActRunsLastRequestQueueRequestDeleteRequest { - r.clientKey = &clientKey - return r -} - -func (r ApiActRunsLastRequestQueueRequestDeleteRequest) Execute() (*http.Response, error) { - return r.ApiService.ActRunsLastRequestQueueRequestDeleteExecute(r) -} - -/* -ActRunsLastRequestQueueRequestDelete Delete request from last run's default request queue - -Deletes a request from the default request queue of the last Actor run. - -This endpoint is a shortcut for getting the last run's `defaultRequestQueueId` and then using the -[Delete request](/api/v2/request-queue-request-delete) endpoint. - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param actorId Actor ID or a tilde-separated owner's username and Actor name. - @param requestId Request ID. - @return ApiActRunsLastRequestQueueRequestDeleteRequest -*/ -func (a *LastActorRunsDefaultRequestQueueAPIService) ActRunsLastRequestQueueRequestDelete(ctx context.Context, actorId string, requestId string) ApiActRunsLastRequestQueueRequestDeleteRequest { - return ApiActRunsLastRequestQueueRequestDeleteRequest{ - ApiService: a, - ctx: ctx, - actorId: actorId, - requestId: requestId, - } -} - -// Execute executes the request -func (a *LastActorRunsDefaultRequestQueueAPIService) ActRunsLastRequestQueueRequestDeleteExecute(r ApiActRunsLastRequestQueueRequestDeleteRequest) (*http.Response, error) { - var ( - localVarHTTPMethod = http.MethodDelete - localVarPostBody interface{} - formFiles []formFile - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LastActorRunsDefaultRequestQueueAPIService.ActRunsLastRequestQueueRequestDelete") - if err != nil { - return nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/actors/{actorId}/runs/last/request-queue/requests/{requestId}" - localVarPath = strings.Replace(localVarPath, "{"+"actorId"+"}", url.PathEscape(parameterValueToString(r.actorId, "actorId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"requestId"+"}", url.PathEscape(parameterValueToString(r.requestId, "requestId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if r.status != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "status", r.status, "form", "") - } - if r.clientKey != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "clientKey", r.clientKey, "form", "") - } - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarHTTPResponse, newErr - } - - return localVarHTTPResponse, nil -} - -type ApiActRunsLastRequestQueueRequestGetRequest struct { - ctx context.Context - ApiService *LastActorRunsDefaultRequestQueueAPIService - actorId string - requestId string - status *string -} - -// Filter for the run status. -func (r ApiActRunsLastRequestQueueRequestGetRequest) Status(status string) ApiActRunsLastRequestQueueRequestGetRequest { - r.status = &status - return r -} - -func (r ApiActRunsLastRequestQueueRequestGetRequest) Execute() (*RequestResponse, *http.Response, error) { - return r.ApiService.ActRunsLastRequestQueueRequestGetExecute(r) -} - -/* -ActRunsLastRequestQueueRequestGet Get request from last run's default request queue - -Returns a request from the default request queue of the last Actor run. - -This endpoint is a shortcut for getting the last run's `defaultRequestQueueId` and then using the -[Get request](/api/v2/request-queue-request-get) endpoint. - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param actorId Actor ID or a tilde-separated owner's username and Actor name. - @param requestId Request ID. - @return ApiActRunsLastRequestQueueRequestGetRequest -*/ -func (a *LastActorRunsDefaultRequestQueueAPIService) ActRunsLastRequestQueueRequestGet(ctx context.Context, actorId string, requestId string) ApiActRunsLastRequestQueueRequestGetRequest { - return ApiActRunsLastRequestQueueRequestGetRequest{ - ApiService: a, - ctx: ctx, - actorId: actorId, - requestId: requestId, - } -} - -// Execute executes the request -// @return RequestResponse -func (a *LastActorRunsDefaultRequestQueueAPIService) ActRunsLastRequestQueueRequestGetExecute(r ApiActRunsLastRequestQueueRequestGetRequest) (*RequestResponse, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *RequestResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LastActorRunsDefaultRequestQueueAPIService.ActRunsLastRequestQueueRequestGet") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/actors/{actorId}/runs/last/request-queue/requests/{requestId}" - localVarPath = strings.Replace(localVarPath, "{"+"actorId"+"}", url.PathEscape(parameterValueToString(r.actorId, "actorId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"requestId"+"}", url.PathEscape(parameterValueToString(r.requestId, "requestId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if r.status != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "status", r.status, "form", "") - } - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiActRunsLastRequestQueueRequestLockDeleteRequest struct { - ctx context.Context - ApiService *LastActorRunsDefaultRequestQueueAPIService - actorId string - requestId string - status *string - clientKey *string - forefront *string -} - -// Filter for the run status. -func (r ApiActRunsLastRequestQueueRequestLockDeleteRequest) Status(status string) ApiActRunsLastRequestQueueRequestLockDeleteRequest { - r.status = &status - return r -} - -// A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. -func (r ApiActRunsLastRequestQueueRequestLockDeleteRequest) ClientKey(clientKey string) ApiActRunsLastRequestQueueRequestLockDeleteRequest { - r.clientKey = &clientKey - return r -} - -// Determines if request should be added to the head of the queue or to the end after lock was removed. -func (r ApiActRunsLastRequestQueueRequestLockDeleteRequest) Forefront(forefront string) ApiActRunsLastRequestQueueRequestLockDeleteRequest { - r.forefront = &forefront - return r -} - -func (r ApiActRunsLastRequestQueueRequestLockDeleteRequest) Execute() (*http.Response, error) { - return r.ApiService.ActRunsLastRequestQueueRequestLockDeleteExecute(r) -} - -/* -ActRunsLastRequestQueueRequestLockDelete Delete lock on request in last run's default request queue - -Deletes a request lock in the default request queue of the last Actor run. - -This endpoint is a shortcut for getting the last run's `defaultRequestQueueId` and then using the -[Delete request lock](/api/v2/request-queue-request-lock-delete) endpoint. - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param actorId Actor ID or a tilde-separated owner's username and Actor name. - @param requestId Request ID. - @return ApiActRunsLastRequestQueueRequestLockDeleteRequest -*/ -func (a *LastActorRunsDefaultRequestQueueAPIService) ActRunsLastRequestQueueRequestLockDelete(ctx context.Context, actorId string, requestId string) ApiActRunsLastRequestQueueRequestLockDeleteRequest { - return ApiActRunsLastRequestQueueRequestLockDeleteRequest{ - ApiService: a, - ctx: ctx, - actorId: actorId, - requestId: requestId, - } -} - -// Execute executes the request -func (a *LastActorRunsDefaultRequestQueueAPIService) ActRunsLastRequestQueueRequestLockDeleteExecute(r ApiActRunsLastRequestQueueRequestLockDeleteRequest) (*http.Response, error) { - var ( - localVarHTTPMethod = http.MethodDelete - localVarPostBody interface{} - formFiles []formFile - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LastActorRunsDefaultRequestQueueAPIService.ActRunsLastRequestQueueRequestLockDelete") - if err != nil { - return nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/actors/{actorId}/runs/last/request-queue/requests/{requestId}/lock" - localVarPath = strings.Replace(localVarPath, "{"+"actorId"+"}", url.PathEscape(parameterValueToString(r.actorId, "actorId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"requestId"+"}", url.PathEscape(parameterValueToString(r.requestId, "requestId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if r.status != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "status", r.status, "form", "") - } - if r.clientKey != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "clientKey", r.clientKey, "form", "") - } - if r.forefront != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "forefront", r.forefront, "form", "") - } - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarHTTPResponse, newErr - } - - return localVarHTTPResponse, nil -} - -type ApiActRunsLastRequestQueueRequestLockPutRequest struct { - ctx context.Context - ApiService *LastActorRunsDefaultRequestQueueAPIService - actorId string - requestId string - lockSecs *float64 - status *string - clientKey *string - forefront *string -} - -// How long the requests will be locked for (in seconds). -func (r ApiActRunsLastRequestQueueRequestLockPutRequest) LockSecs(lockSecs float64) ApiActRunsLastRequestQueueRequestLockPutRequest { - r.lockSecs = &lockSecs - return r -} - -// Filter for the run status. -func (r ApiActRunsLastRequestQueueRequestLockPutRequest) Status(status string) ApiActRunsLastRequestQueueRequestLockPutRequest { - r.status = &status - return r -} - -// A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. -func (r ApiActRunsLastRequestQueueRequestLockPutRequest) ClientKey(clientKey string) ApiActRunsLastRequestQueueRequestLockPutRequest { - r.clientKey = &clientKey - return r -} - -// Determines if request should be added to the head of the queue or to the end after lock expires. -func (r ApiActRunsLastRequestQueueRequestLockPutRequest) Forefront(forefront string) ApiActRunsLastRequestQueueRequestLockPutRequest { - r.forefront = &forefront - return r -} - -func (r ApiActRunsLastRequestQueueRequestLockPutRequest) Execute() (*ProlongRequestLockResponse, *http.Response, error) { - return r.ApiService.ActRunsLastRequestQueueRequestLockPutExecute(r) -} - -/* -ActRunsLastRequestQueueRequestLockPut Prolong lock on request in last run's default request queue - -Prolongs a request lock in the default request queue of the last Actor run. - -This endpoint is a shortcut for getting the last run's `defaultRequestQueueId` and then using the -[Prolong request lock](/api/v2/request-queue-request-lock-put) endpoint. - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param actorId Actor ID or a tilde-separated owner's username and Actor name. - @param requestId Request ID. - @return ApiActRunsLastRequestQueueRequestLockPutRequest -*/ -func (a *LastActorRunsDefaultRequestQueueAPIService) ActRunsLastRequestQueueRequestLockPut(ctx context.Context, actorId string, requestId string) ApiActRunsLastRequestQueueRequestLockPutRequest { - return ApiActRunsLastRequestQueueRequestLockPutRequest{ - ApiService: a, - ctx: ctx, - actorId: actorId, - requestId: requestId, - } -} - -// Execute executes the request -// @return ProlongRequestLockResponse -func (a *LastActorRunsDefaultRequestQueueAPIService) ActRunsLastRequestQueueRequestLockPutExecute(r ApiActRunsLastRequestQueueRequestLockPutRequest) (*ProlongRequestLockResponse, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodPut - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *ProlongRequestLockResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LastActorRunsDefaultRequestQueueAPIService.ActRunsLastRequestQueueRequestLockPut") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/actors/{actorId}/runs/last/request-queue/requests/{requestId}/lock" - localVarPath = strings.Replace(localVarPath, "{"+"actorId"+"}", url.PathEscape(parameterValueToString(r.actorId, "actorId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"requestId"+"}", url.PathEscape(parameterValueToString(r.requestId, "requestId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - if r.lockSecs == nil { - return localVarReturnValue, nil, reportError("lockSecs is required and must be specified") - } - - if r.status != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "status", r.status, "form", "") - } - parameterAddToHeaderOrQuery(localVarQueryParams, "lockSecs", r.lockSecs, "form", "") - if r.clientKey != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "clientKey", r.clientKey, "form", "") - } - if r.forefront != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "forefront", r.forefront, "form", "") - } - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiActRunsLastRequestQueueRequestPutRequest struct { - ctx context.Context - ApiService *LastActorRunsDefaultRequestQueueAPIService - actorId string - requestId string - request *Request - status *string - forefront *string - clientKey *string -} - -// -func (r ApiActRunsLastRequestQueueRequestPutRequest) Request(request Request) ApiActRunsLastRequestQueueRequestPutRequest { - r.request = &request - return r -} - -// Filter for the run status. -func (r ApiActRunsLastRequestQueueRequestPutRequest) Status(status string) ApiActRunsLastRequestQueueRequestPutRequest { - r.status = &status - return r -} - -// Determines if request should be added to the head of the queue or to the end. Default value is `false` (end of queue). -func (r ApiActRunsLastRequestQueueRequestPutRequest) Forefront(forefront string) ApiActRunsLastRequestQueueRequestPutRequest { - r.forefront = &forefront - return r -} - -// A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. -func (r ApiActRunsLastRequestQueueRequestPutRequest) ClientKey(clientKey string) ApiActRunsLastRequestQueueRequestPutRequest { - r.clientKey = &clientKey - return r -} - -func (r ApiActRunsLastRequestQueueRequestPutRequest) Execute() (*UpdateRequestResponse, *http.Response, error) { - return r.ApiService.ActRunsLastRequestQueueRequestPutExecute(r) -} - -/* -ActRunsLastRequestQueueRequestPut Update request in last run's default request queue - -Updates a request in the default request queue of the last Actor run. - -This endpoint is a shortcut for getting the last run's `defaultRequestQueueId` and then using the -[Update request](/api/v2/request-queue-request-put) endpoint. - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param actorId Actor ID or a tilde-separated owner's username and Actor name. - @param requestId Request ID. - @return ApiActRunsLastRequestQueueRequestPutRequest -*/ -func (a *LastActorRunsDefaultRequestQueueAPIService) ActRunsLastRequestQueueRequestPut(ctx context.Context, actorId string, requestId string) ApiActRunsLastRequestQueueRequestPutRequest { - return ApiActRunsLastRequestQueueRequestPutRequest{ - ApiService: a, - ctx: ctx, - actorId: actorId, - requestId: requestId, - } -} - -// Execute executes the request -// @return UpdateRequestResponse -func (a *LastActorRunsDefaultRequestQueueAPIService) ActRunsLastRequestQueueRequestPutExecute(r ApiActRunsLastRequestQueueRequestPutRequest) (*UpdateRequestResponse, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodPut - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *UpdateRequestResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LastActorRunsDefaultRequestQueueAPIService.ActRunsLastRequestQueueRequestPut") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/actors/{actorId}/runs/last/request-queue/requests/{requestId}" - localVarPath = strings.Replace(localVarPath, "{"+"actorId"+"}", url.PathEscape(parameterValueToString(r.actorId, "actorId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"requestId"+"}", url.PathEscape(parameterValueToString(r.requestId, "requestId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - if r.request == nil { - return localVarReturnValue, nil, reportError("request is required and must be specified") - } - - if r.status != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "status", r.status, "form", "") - } - if r.forefront != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "forefront", r.forefront, "form", "") - } - if r.clientKey != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "clientKey", r.clientKey, "form", "") - } - // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/json"} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - // body params - localVarPostBody = r.request - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 413 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 415 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiActRunsLastRequestQueueRequestsBatchDeleteRequest struct { - ctx context.Context - ApiService *LastActorRunsDefaultRequestQueueAPIService - actorId string - contentType *string - requestDraftDelete *[]RequestDraftDelete - status *string - clientKey *string -} - -// -func (r ApiActRunsLastRequestQueueRequestsBatchDeleteRequest) ContentType(contentType string) ApiActRunsLastRequestQueueRequestsBatchDeleteRequest { - r.contentType = &contentType - return r -} - -// -func (r ApiActRunsLastRequestQueueRequestsBatchDeleteRequest) RequestDraftDelete(requestDraftDelete []RequestDraftDelete) ApiActRunsLastRequestQueueRequestsBatchDeleteRequest { - r.requestDraftDelete = &requestDraftDelete - return r -} - -// Filter for the run status. -func (r ApiActRunsLastRequestQueueRequestsBatchDeleteRequest) Status(status string) ApiActRunsLastRequestQueueRequestsBatchDeleteRequest { - r.status = &status - return r -} - -// A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. -func (r ApiActRunsLastRequestQueueRequestsBatchDeleteRequest) ClientKey(clientKey string) ApiActRunsLastRequestQueueRequestsBatchDeleteRequest { - r.clientKey = &clientKey - return r -} - -func (r ApiActRunsLastRequestQueueRequestsBatchDeleteRequest) Execute() (*BatchDeleteResponse, *http.Response, error) { - return r.ApiService.ActRunsLastRequestQueueRequestsBatchDeleteExecute(r) -} - -/* -ActRunsLastRequestQueueRequestsBatchDelete Batch delete requests from last run's default request queue - -Batch-deletes requests from the default request queue of the last Actor run. - -This endpoint is a shortcut for getting the last run's `defaultRequestQueueId` and then using the -[Delete requests](/api/v2/request-queue-requests-batch-delete) endpoint. - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param actorId Actor ID or a tilde-separated owner's username and Actor name. - @return ApiActRunsLastRequestQueueRequestsBatchDeleteRequest -*/ -func (a *LastActorRunsDefaultRequestQueueAPIService) ActRunsLastRequestQueueRequestsBatchDelete(ctx context.Context, actorId string) ApiActRunsLastRequestQueueRequestsBatchDeleteRequest { - return ApiActRunsLastRequestQueueRequestsBatchDeleteRequest{ - ApiService: a, - ctx: ctx, - actorId: actorId, - } -} - -// Execute executes the request -// @return BatchDeleteResponse -func (a *LastActorRunsDefaultRequestQueueAPIService) ActRunsLastRequestQueueRequestsBatchDeleteExecute(r ApiActRunsLastRequestQueueRequestsBatchDeleteRequest) (*BatchDeleteResponse, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodDelete - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *BatchDeleteResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LastActorRunsDefaultRequestQueueAPIService.ActRunsLastRequestQueueRequestsBatchDelete") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/actors/{actorId}/runs/last/request-queue/requests/batch" - localVarPath = strings.Replace(localVarPath, "{"+"actorId"+"}", url.PathEscape(parameterValueToString(r.actorId, "actorId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - if r.contentType == nil { - return localVarReturnValue, nil, reportError("contentType is required and must be specified") - } - if r.requestDraftDelete == nil { - return localVarReturnValue, nil, reportError("requestDraftDelete is required and must be specified") - } - - if r.status != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "status", r.status, "form", "") - } - if r.clientKey != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "clientKey", r.clientKey, "form", "") - } - // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/json"} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - parameterAddToHeaderOrQuery(localVarHeaderParams, "Content-Type", r.contentType, "simple", "") - // body params - localVarPostBody = r.requestDraftDelete - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 413 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 415 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiActRunsLastRequestQueueRequestsBatchPostRequest struct { - ctx context.Context - ApiService *LastActorRunsDefaultRequestQueueAPIService - actorId string - requestBase *[]RequestBase - status *string - clientKey *string - forefront *string -} - -// -func (r ApiActRunsLastRequestQueueRequestsBatchPostRequest) RequestBase(requestBase []RequestBase) ApiActRunsLastRequestQueueRequestsBatchPostRequest { - r.requestBase = &requestBase - return r -} - -// Filter for the run status. -func (r ApiActRunsLastRequestQueueRequestsBatchPostRequest) Status(status string) ApiActRunsLastRequestQueueRequestsBatchPostRequest { - r.status = &status - return r -} - -// A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. -func (r ApiActRunsLastRequestQueueRequestsBatchPostRequest) ClientKey(clientKey string) ApiActRunsLastRequestQueueRequestsBatchPostRequest { - r.clientKey = &clientKey - return r -} - -// Determines if request should be added to the head of the queue or to the end. Default value is `false` (end of queue). -func (r ApiActRunsLastRequestQueueRequestsBatchPostRequest) Forefront(forefront string) ApiActRunsLastRequestQueueRequestsBatchPostRequest { - r.forefront = &forefront - return r -} - -func (r ApiActRunsLastRequestQueueRequestsBatchPostRequest) Execute() (*BatchAddResponse, *http.Response, error) { - return r.ApiService.ActRunsLastRequestQueueRequestsBatchPostExecute(r) -} - -/* -ActRunsLastRequestQueueRequestsBatchPost Batch add requests to last run's default request queue - -Adds requests to the default request queue of the last Actor run in batch. - -This endpoint is a shortcut for getting the last run's `defaultRequestQueueId` and then using the -[Add requests](/api/v2/request-queue-requests-batch-post) endpoint. - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param actorId Actor ID or a tilde-separated owner's username and Actor name. - @return ApiActRunsLastRequestQueueRequestsBatchPostRequest -*/ -func (a *LastActorRunsDefaultRequestQueueAPIService) ActRunsLastRequestQueueRequestsBatchPost(ctx context.Context, actorId string) ApiActRunsLastRequestQueueRequestsBatchPostRequest { - return ApiActRunsLastRequestQueueRequestsBatchPostRequest{ - ApiService: a, - ctx: ctx, - actorId: actorId, - } -} - -// Execute executes the request -// @return BatchAddResponse -func (a *LastActorRunsDefaultRequestQueueAPIService) ActRunsLastRequestQueueRequestsBatchPostExecute(r ApiActRunsLastRequestQueueRequestsBatchPostRequest) (*BatchAddResponse, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodPost - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *BatchAddResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LastActorRunsDefaultRequestQueueAPIService.ActRunsLastRequestQueueRequestsBatchPost") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/actors/{actorId}/runs/last/request-queue/requests/batch" - localVarPath = strings.Replace(localVarPath, "{"+"actorId"+"}", url.PathEscape(parameterValueToString(r.actorId, "actorId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - if r.requestBase == nil { - return localVarReturnValue, nil, reportError("requestBase is required and must be specified") - } - - if r.status != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "status", r.status, "form", "") - } - if r.clientKey != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "clientKey", r.clientKey, "form", "") - } - if r.forefront != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "forefront", r.forefront, "form", "") - } - // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/json"} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - // body params - localVarPostBody = r.requestBase - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 413 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 415 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiActRunsLastRequestQueueRequestsGetRequest struct { - ctx context.Context - ApiService *LastActorRunsDefaultRequestQueueAPIService - actorId string - status *string - clientKey *string - exclusiveStartId *string - limit *float64 - cursor *string - filter *[]string -} - -// Filter for the run status. -func (r ApiActRunsLastRequestQueueRequestsGetRequest) Status(status string) ApiActRunsLastRequestQueueRequestsGetRequest { - r.status = &status - return r -} - -// A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. -func (r ApiActRunsLastRequestQueueRequestsGetRequest) ClientKey(clientKey string) ApiActRunsLastRequestQueueRequestsGetRequest { - r.clientKey = &clientKey - return r -} - -// All requests up to this one (including) are skipped from the result. (Deprecated, use `cursor` instead.) -// Deprecated -func (r ApiActRunsLastRequestQueueRequestsGetRequest) ExclusiveStartId(exclusiveStartId string) ApiActRunsLastRequestQueueRequestsGetRequest { - r.exclusiveStartId = &exclusiveStartId - return r -} - -// Number of keys to be returned. Maximum value is `10000`. -func (r ApiActRunsLastRequestQueueRequestsGetRequest) Limit(limit float64) ApiActRunsLastRequestQueueRequestsGetRequest { - r.limit = &limit - return r -} - -// A cursor string for pagination, returned in the previous response as `nextCursor`. Use this to retrieve the next page of requests. -func (r ApiActRunsLastRequestQueueRequestsGetRequest) Cursor(cursor string) ApiActRunsLastRequestQueueRequestsGetRequest { - r.cursor = &cursor - return r -} - -// Filter requests by their state. Possible values are `locked` and `pending`. You can combine multiple values separated by commas, which will mean the union of these filters – requests matching any of the specified states will be returned. (Not compatible with deprecated `exclusiveStartId` parameter.) -func (r ApiActRunsLastRequestQueueRequestsGetRequest) Filter(filter []string) ApiActRunsLastRequestQueueRequestsGetRequest { - r.filter = &filter - return r -} - -func (r ApiActRunsLastRequestQueueRequestsGetRequest) Execute() (*ListOfRequestsResponse, *http.Response, error) { - return r.ApiService.ActRunsLastRequestQueueRequestsGetExecute(r) -} - -/* -ActRunsLastRequestQueueRequestsGet List last run's default request queue's requests - -Returns a list of requests from the default request queue of the last Actor run. - -This endpoint is a shortcut for getting the last run's `defaultRequestQueueId` and then using the -[List requests](/api/v2/request-queue-requests-get) endpoint. - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param actorId Actor ID or a tilde-separated owner's username and Actor name. - @return ApiActRunsLastRequestQueueRequestsGetRequest -*/ -func (a *LastActorRunsDefaultRequestQueueAPIService) ActRunsLastRequestQueueRequestsGet(ctx context.Context, actorId string) ApiActRunsLastRequestQueueRequestsGetRequest { - return ApiActRunsLastRequestQueueRequestsGetRequest{ - ApiService: a, - ctx: ctx, - actorId: actorId, - } -} - -// Execute executes the request -// @return ListOfRequestsResponse -func (a *LastActorRunsDefaultRequestQueueAPIService) ActRunsLastRequestQueueRequestsGetExecute(r ApiActRunsLastRequestQueueRequestsGetRequest) (*ListOfRequestsResponse, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *ListOfRequestsResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LastActorRunsDefaultRequestQueueAPIService.ActRunsLastRequestQueueRequestsGet") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/actors/{actorId}/runs/last/request-queue/requests" - localVarPath = strings.Replace(localVarPath, "{"+"actorId"+"}", url.PathEscape(parameterValueToString(r.actorId, "actorId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if r.status != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "status", r.status, "form", "") - } - if r.clientKey != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "clientKey", r.clientKey, "form", "") - } - if r.exclusiveStartId != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "exclusiveStartId", r.exclusiveStartId, "form", "") - } - if r.limit != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "form", "") - } - if r.cursor != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "cursor", r.cursor, "form", "") - } - if r.filter != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "filter", r.filter, "form", "csv") - } - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiActRunsLastRequestQueueRequestsPostRequest struct { - ctx context.Context - ApiService *LastActorRunsDefaultRequestQueueAPIService - actorId string - requestBase *RequestBase - status *string - clientKey *string - forefront *string -} - -// -func (r ApiActRunsLastRequestQueueRequestsPostRequest) RequestBase(requestBase RequestBase) ApiActRunsLastRequestQueueRequestsPostRequest { - r.requestBase = &requestBase - return r -} - -// Filter for the run status. -func (r ApiActRunsLastRequestQueueRequestsPostRequest) Status(status string) ApiActRunsLastRequestQueueRequestsPostRequest { - r.status = &status - return r -} - -// A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. -func (r ApiActRunsLastRequestQueueRequestsPostRequest) ClientKey(clientKey string) ApiActRunsLastRequestQueueRequestsPostRequest { - r.clientKey = &clientKey - return r -} - -// Determines if request should be added to the head of the queue or to the end. Default value is `false` (end of queue). -func (r ApiActRunsLastRequestQueueRequestsPostRequest) Forefront(forefront string) ApiActRunsLastRequestQueueRequestsPostRequest { - r.forefront = &forefront - return r -} - -func (r ApiActRunsLastRequestQueueRequestsPostRequest) Execute() (*AddRequestResponse, *http.Response, error) { - return r.ApiService.ActRunsLastRequestQueueRequestsPostExecute(r) -} - -/* -ActRunsLastRequestQueueRequestsPost Add request to last run's default request queue - -Adds a request to the default request queue of the last Actor run. - -This endpoint is a shortcut for getting the last run's `defaultRequestQueueId` and then using the -[Add request](/api/v2/request-queue-requests-post) endpoint. - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param actorId Actor ID or a tilde-separated owner's username and Actor name. - @return ApiActRunsLastRequestQueueRequestsPostRequest -*/ -func (a *LastActorRunsDefaultRequestQueueAPIService) ActRunsLastRequestQueueRequestsPost(ctx context.Context, actorId string) ApiActRunsLastRequestQueueRequestsPostRequest { - return ApiActRunsLastRequestQueueRequestsPostRequest{ - ApiService: a, - ctx: ctx, - actorId: actorId, - } -} - -// Execute executes the request -// @return AddRequestResponse -func (a *LastActorRunsDefaultRequestQueueAPIService) ActRunsLastRequestQueueRequestsPostExecute(r ApiActRunsLastRequestQueueRequestsPostRequest) (*AddRequestResponse, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodPost - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *AddRequestResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LastActorRunsDefaultRequestQueueAPIService.ActRunsLastRequestQueueRequestsPost") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/actors/{actorId}/runs/last/request-queue/requests" - localVarPath = strings.Replace(localVarPath, "{"+"actorId"+"}", url.PathEscape(parameterValueToString(r.actorId, "actorId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - if r.requestBase == nil { - return localVarReturnValue, nil, reportError("requestBase is required and must be specified") - } - - if r.status != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "status", r.status, "form", "") - } - if r.clientKey != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "clientKey", r.clientKey, "form", "") - } - if r.forefront != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "forefront", r.forefront, "form", "") - } - // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/json"} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - // body params - localVarPostBody = r.requestBase - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 413 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 415 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiActRunsLastRequestQueueRequestsUnlockPostRequest struct { - ctx context.Context - ApiService *LastActorRunsDefaultRequestQueueAPIService - actorId string - status *string - clientKey *string -} - -// Filter for the run status. -func (r ApiActRunsLastRequestQueueRequestsUnlockPostRequest) Status(status string) ApiActRunsLastRequestQueueRequestsUnlockPostRequest { - r.status = &status - return r -} - -// A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. -func (r ApiActRunsLastRequestQueueRequestsUnlockPostRequest) ClientKey(clientKey string) ApiActRunsLastRequestQueueRequestsUnlockPostRequest { - r.clientKey = &clientKey - return r -} - -func (r ApiActRunsLastRequestQueueRequestsUnlockPostRequest) Execute() (*UnlockRequestsResponse, *http.Response, error) { - return r.ApiService.ActRunsLastRequestQueueRequestsUnlockPostExecute(r) -} - -/* -ActRunsLastRequestQueueRequestsUnlockPost Unlock requests in last run's default request queue - -Unlocks requests in the default request queue of the last Actor run that are currently locked by the client. - -This endpoint is a shortcut for getting the last run's `defaultRequestQueueId` and then using the -[Unlock requests](/api/v2/request-queue-requests-unlock-post) endpoint. - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param actorId Actor ID or a tilde-separated owner's username and Actor name. - @return ApiActRunsLastRequestQueueRequestsUnlockPostRequest -*/ -func (a *LastActorRunsDefaultRequestQueueAPIService) ActRunsLastRequestQueueRequestsUnlockPost(ctx context.Context, actorId string) ApiActRunsLastRequestQueueRequestsUnlockPostRequest { - return ApiActRunsLastRequestQueueRequestsUnlockPostRequest{ - ApiService: a, - ctx: ctx, - actorId: actorId, - } -} - -// Execute executes the request -// @return UnlockRequestsResponse -func (a *LastActorRunsDefaultRequestQueueAPIService) ActRunsLastRequestQueueRequestsUnlockPostExecute(r ApiActRunsLastRequestQueueRequestsUnlockPostRequest) (*UnlockRequestsResponse, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodPost - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *UnlockRequestsResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LastActorRunsDefaultRequestQueueAPIService.ActRunsLastRequestQueueRequestsUnlockPost") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/actors/{actorId}/runs/last/request-queue/requests/unlock" - localVarPath = strings.Replace(localVarPath, "{"+"actorId"+"}", url.PathEscape(parameterValueToString(r.actorId, "actorId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if r.status != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "status", r.status, "form", "") - } - if r.clientKey != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "clientKey", r.clientKey, "form", "") - } - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} diff --git a/api_last_actor_runs_log.go b/api_last_actor_runs_log.go deleted file mode 100644 index 40dc20a..0000000 --- a/api_last_actor_runs_log.go +++ /dev/null @@ -1,239 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "bytes" - "context" - "io" - "net/http" - "net/url" - "strings" -) - - -// LastActorRunsLogAPIService LastActorRunsLogAPI service -type LastActorRunsLogAPIService service - -type ApiActRunsLastLogGetRequest struct { - ctx context.Context - ApiService *LastActorRunsLogAPIService - actorId string - stream *bool - download *bool - raw *bool -} - -// If `true` or `1` then the logs will be streamed as long as the run or build is running. -func (r ApiActRunsLastLogGetRequest) Stream(stream bool) ApiActRunsLastLogGetRequest { - r.stream = &stream - return r -} - -// If `true` or `1` then the web browser will download the log file rather than open it in a tab. -func (r ApiActRunsLastLogGetRequest) Download(download bool) ApiActRunsLastLogGetRequest { - r.download = &download - return r -} - -// If `true` or `1`, the logs will be kept verbatim. By default, the API removes ANSI escape codes from the logs, keeping only printable characters. -func (r ApiActRunsLastLogGetRequest) Raw(raw bool) ApiActRunsLastLogGetRequest { - r.raw = &raw - return r -} - -func (r ApiActRunsLastLogGetRequest) Execute() (string, *http.Response, error) { - return r.ApiService.ActRunsLastLogGetExecute(r) -} - -/* -ActRunsLastLogGet Get last Actor run's log - -Retrieves last Actor run's logs. - -This endpoint is a shortcut for getting last Actor run's log. Same as [Get log](/api/v2/log-get) endpoint. - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param actorId Actor ID or a tilde-separated owner's username and Actor name. - @return ApiActRunsLastLogGetRequest -*/ -func (a *LastActorRunsLogAPIService) ActRunsLastLogGet(ctx context.Context, actorId string) ApiActRunsLastLogGetRequest { - return ApiActRunsLastLogGetRequest{ - ApiService: a, - ctx: ctx, - actorId: actorId, - } -} - -// Execute executes the request -// @return string -func (a *LastActorRunsLogAPIService) ActRunsLastLogGetExecute(r ApiActRunsLastLogGetRequest) (string, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue string - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LastActorRunsLogAPIService.ActRunsLastLogGet") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/actors/{actorId}/runs/last/log" - localVarPath = strings.Replace(localVarPath, "{"+"actorId"+"}", url.PathEscape(parameterValueToString(r.actorId, "actorId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if r.stream != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "stream", r.stream, "form", "") - } - if r.download != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "download", r.download, "form", "") - } - if r.raw != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "raw", r.raw, "form", "") - } - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"text/plain", "application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} diff --git a/api_last_actor_runs_metamorph.go b/api_last_actor_runs_metamorph.go deleted file mode 100644 index 87196d0..0000000 --- a/api_last_actor_runs_metamorph.go +++ /dev/null @@ -1,242 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "bytes" - "context" - "io" - "net/http" - "net/url" - "strings" -) - - -// LastActorRunsMetamorphAPIService LastActorRunsMetamorphAPI service -type LastActorRunsMetamorphAPIService service - -type ApiActRunsLastMetamorphPostRequest struct { - ctx context.Context - ApiService *LastActorRunsMetamorphAPIService - actorId string - targetActorId *string - status *string - build *string -} - -// ID of a target Actor that the run should be transformed into. -func (r ApiActRunsLastMetamorphPostRequest) TargetActorId(targetActorId string) ApiActRunsLastMetamorphPostRequest { - r.targetActorId = &targetActorId - return r -} - -// Filter for the run status. -func (r ApiActRunsLastMetamorphPostRequest) Status(status string) ApiActRunsLastMetamorphPostRequest { - r.status = &status - return r -} - -// Optional build of the target Actor. It can be either a build tag or build number. By default, the run uses the build specified in the default run configuration for the target Actor (typically `latest`). -func (r ApiActRunsLastMetamorphPostRequest) Build(build string) ApiActRunsLastMetamorphPostRequest { - r.build = &build - return r -} - -func (r ApiActRunsLastMetamorphPostRequest) Execute() (*RunResponse, *http.Response, error) { - return r.ApiService.ActRunsLastMetamorphPostExecute(r) -} - -/* -ActRunsLastMetamorphPost Metamorph Actor's last run - -Transforms the last run of the specified Actor into a run of another Actor with -a new input. - -This endpoint is a shortcut for [Metamorph run](#/reference/actor-runs/metamorph-run/metamorph-run) -on the Actor's last run. - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param actorId Actor ID or a tilde-separated owner's username and Actor name. - @return ApiActRunsLastMetamorphPostRequest -*/ -func (a *LastActorRunsMetamorphAPIService) ActRunsLastMetamorphPost(ctx context.Context, actorId string) ApiActRunsLastMetamorphPostRequest { - return ApiActRunsLastMetamorphPostRequest{ - ApiService: a, - ctx: ctx, - actorId: actorId, - } -} - -// Execute executes the request -// @return RunResponse -func (a *LastActorRunsMetamorphAPIService) ActRunsLastMetamorphPostExecute(r ApiActRunsLastMetamorphPostRequest) (*RunResponse, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodPost - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *RunResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LastActorRunsMetamorphAPIService.ActRunsLastMetamorphPost") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/actors/{actorId}/runs/last/metamorph" - localVarPath = strings.Replace(localVarPath, "{"+"actorId"+"}", url.PathEscape(parameterValueToString(r.actorId, "actorId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - if r.targetActorId == nil { - return localVarReturnValue, nil, reportError("targetActorId is required and must be specified") - } - - if r.status != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "status", r.status, "form", "") - } - parameterAddToHeaderOrQuery(localVarQueryParams, "targetActorId", r.targetActorId, "form", "") - if r.build != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "build", r.build, "form", "") - } - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} diff --git a/api_last_actor_runs_reboot.go b/api_last_actor_runs_reboot.go deleted file mode 100644 index 46dd799..0000000 --- a/api_last_actor_runs_reboot.go +++ /dev/null @@ -1,223 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "bytes" - "context" - "io" - "net/http" - "net/url" - "strings" -) - - -// LastActorRunsRebootAPIService LastActorRunsRebootAPI service -type LastActorRunsRebootAPIService service - -type ApiActRunsLastRebootPostRequest struct { - ctx context.Context - ApiService *LastActorRunsRebootAPIService - actorId string - status *string -} - -// Filter for the run status. -func (r ApiActRunsLastRebootPostRequest) Status(status string) ApiActRunsLastRebootPostRequest { - r.status = &status - return r -} - -func (r ApiActRunsLastRebootPostRequest) Execute() (*RunResponse, *http.Response, error) { - return r.ApiService.ActRunsLastRebootPostExecute(r) -} - -/* -ActRunsLastRebootPost Reboot Actor's last run - -Reboots the last run of the specified Actor and returns an object that -contains all the details about the rebooted run. - -This endpoint is a shortcut for [Reboot run](#/reference/actor-runs/reboot-run/reboot-run) -on the Actor's last run. Only runs with status `RUNNING` can be rebooted. The run's -container will be restarted, so any data not persisted in the key-value store, dataset, -or request queue will be lost. - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param actorId Actor ID or a tilde-separated owner's username and Actor name. - @return ApiActRunsLastRebootPostRequest -*/ -func (a *LastActorRunsRebootAPIService) ActRunsLastRebootPost(ctx context.Context, actorId string) ApiActRunsLastRebootPostRequest { - return ApiActRunsLastRebootPostRequest{ - ApiService: a, - ctx: ctx, - actorId: actorId, - } -} - -// Execute executes the request -// @return RunResponse -func (a *LastActorRunsRebootAPIService) ActRunsLastRebootPostExecute(r ApiActRunsLastRebootPostRequest) (*RunResponse, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodPost - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *RunResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LastActorRunsRebootAPIService.ActRunsLastRebootPost") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/actors/{actorId}/runs/last/reboot" - localVarPath = strings.Replace(localVarPath, "{"+"actorId"+"}", url.PathEscape(parameterValueToString(r.actorId, "actorId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if r.status != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "status", r.status, "form", "") - } - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} diff --git a/api_last_actor_task_runs_abort.go b/api_last_actor_task_runs_abort.go deleted file mode 100644 index f59e1a0..0000000 --- a/api_last_actor_task_runs_abort.go +++ /dev/null @@ -1,233 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "bytes" - "context" - "io" - "net/http" - "net/url" - "strings" -) - - -// LastActorTaskRunsAbortAPIService LastActorTaskRunsAbortAPI service -type LastActorTaskRunsAbortAPIService service - -type ApiActorTaskRunsLastAbortPostRequest struct { - ctx context.Context - ApiService *LastActorTaskRunsAbortAPIService - actorTaskId string - status *string - gracefully *bool -} - -// Filter for the run status. -func (r ApiActorTaskRunsLastAbortPostRequest) Status(status string) ApiActorTaskRunsLastAbortPostRequest { - r.status = &status - return r -} - -// If true passed, the Actor run will abort gracefully. It will send `aborting` and `persistState` event into run and force-stop the run after 30 seconds. It is helpful in cases where you plan to resurrect the run later. -func (r ApiActorTaskRunsLastAbortPostRequest) Gracefully(gracefully bool) ApiActorTaskRunsLastAbortPostRequest { - r.gracefully = &gracefully - return r -} - -func (r ApiActorTaskRunsLastAbortPostRequest) Execute() (*RunResponse, *http.Response, error) { - return r.ApiService.ActorTaskRunsLastAbortPostExecute(r) -} - -/* -ActorTaskRunsLastAbortPost Abort Actor task's last run - -Aborts the last run of the specified Actor task and returns an object that -contains all the details about the run. - -This endpoint is a shortcut for [Abort run](#/reference/actor-runs/abort-run/abort-run) -on the Actor task's last run. Only runs that are starting or running are aborted. -For runs with status `FINISHED`, `FAILED`, `ABORTING` and `TIMED-OUT` this call -does nothing. - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param actorTaskId Task ID or a tilde-separated owner's username and task's name. - @return ApiActorTaskRunsLastAbortPostRequest -*/ -func (a *LastActorTaskRunsAbortAPIService) ActorTaskRunsLastAbortPost(ctx context.Context, actorTaskId string) ApiActorTaskRunsLastAbortPostRequest { - return ApiActorTaskRunsLastAbortPostRequest{ - ApiService: a, - ctx: ctx, - actorTaskId: actorTaskId, - } -} - -// Execute executes the request -// @return RunResponse -func (a *LastActorTaskRunsAbortAPIService) ActorTaskRunsLastAbortPostExecute(r ApiActorTaskRunsLastAbortPostRequest) (*RunResponse, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodPost - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *RunResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LastActorTaskRunsAbortAPIService.ActorTaskRunsLastAbortPost") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/actor-tasks/{actorTaskId}/runs/last/abort" - localVarPath = strings.Replace(localVarPath, "{"+"actorTaskId"+"}", url.PathEscape(parameterValueToString(r.actorTaskId, "actorTaskId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if r.status != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "status", r.status, "form", "") - } - if r.gracefully != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "gracefully", r.gracefully, "form", "") - } - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} diff --git a/api_last_actor_task_runs_default_dataset.go b/api_last_actor_task_runs_default_dataset.go deleted file mode 100644 index 63d7b8a..0000000 --- a/api_last_actor_task_runs_default_dataset.go +++ /dev/null @@ -1,1475 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "bytes" - "context" - "io" - "net/http" - "net/url" - "strings" -) - - -// LastActorTaskRunsDefaultDatasetAPIService LastActorTaskRunsDefaultDatasetAPI service -type LastActorTaskRunsDefaultDatasetAPIService service - -type ApiActorTaskRunsLastDatasetDeleteRequest struct { - ctx context.Context - ApiService *LastActorTaskRunsDefaultDatasetAPIService - actorTaskId string - status *string -} - -// Filter for the run status. -func (r ApiActorTaskRunsLastDatasetDeleteRequest) Status(status string) ApiActorTaskRunsLastDatasetDeleteRequest { - r.status = &status - return r -} - -func (r ApiActorTaskRunsLastDatasetDeleteRequest) Execute() (*http.Response, error) { - return r.ApiService.ActorTaskRunsLastDatasetDeleteExecute(r) -} - -/* -ActorTaskRunsLastDatasetDelete Delete last task run's default dataset - -Deletes the default dataset associated with the last Actor task run. - -This endpoint is a shortcut for getting the last task run's `defaultDatasetId` and then using the -[Delete dataset](/api/v2/dataset-delete) endpoint. - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param actorTaskId Task ID or a tilde-separated owner's username and task's name. - @return ApiActorTaskRunsLastDatasetDeleteRequest -*/ -func (a *LastActorTaskRunsDefaultDatasetAPIService) ActorTaskRunsLastDatasetDelete(ctx context.Context, actorTaskId string) ApiActorTaskRunsLastDatasetDeleteRequest { - return ApiActorTaskRunsLastDatasetDeleteRequest{ - ApiService: a, - ctx: ctx, - actorTaskId: actorTaskId, - } -} - -// Execute executes the request -func (a *LastActorTaskRunsDefaultDatasetAPIService) ActorTaskRunsLastDatasetDeleteExecute(r ApiActorTaskRunsLastDatasetDeleteRequest) (*http.Response, error) { - var ( - localVarHTTPMethod = http.MethodDelete - localVarPostBody interface{} - formFiles []formFile - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LastActorTaskRunsDefaultDatasetAPIService.ActorTaskRunsLastDatasetDelete") - if err != nil { - return nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/actor-tasks/{actorTaskId}/runs/last/dataset" - localVarPath = strings.Replace(localVarPath, "{"+"actorTaskId"+"}", url.PathEscape(parameterValueToString(r.actorTaskId, "actorTaskId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if r.status != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "status", r.status, "form", "") - } - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarHTTPResponse, newErr - } - - return localVarHTTPResponse, nil -} - -type ApiActorTaskRunsLastDatasetGetRequest struct { - ctx context.Context - ApiService *LastActorTaskRunsDefaultDatasetAPIService - actorTaskId string - status *string -} - -// Filter for the run status. -func (r ApiActorTaskRunsLastDatasetGetRequest) Status(status string) ApiActorTaskRunsLastDatasetGetRequest { - r.status = &status - return r -} - -func (r ApiActorTaskRunsLastDatasetGetRequest) Execute() (*DatasetResponse, *http.Response, error) { - return r.ApiService.ActorTaskRunsLastDatasetGetExecute(r) -} - -/* -ActorTaskRunsLastDatasetGet Get last task run's default dataset - -Returns the default dataset associated with the last Actor task run. - -This endpoint is a shortcut for getting the last task run's `defaultDatasetId` and then using the -[Get dataset](/api/v2/dataset-get) endpoint. - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param actorTaskId Task ID or a tilde-separated owner's username and task's name. - @return ApiActorTaskRunsLastDatasetGetRequest -*/ -func (a *LastActorTaskRunsDefaultDatasetAPIService) ActorTaskRunsLastDatasetGet(ctx context.Context, actorTaskId string) ApiActorTaskRunsLastDatasetGetRequest { - return ApiActorTaskRunsLastDatasetGetRequest{ - ApiService: a, - ctx: ctx, - actorTaskId: actorTaskId, - } -} - -// Execute executes the request -// @return DatasetResponse -func (a *LastActorTaskRunsDefaultDatasetAPIService) ActorTaskRunsLastDatasetGetExecute(r ApiActorTaskRunsLastDatasetGetRequest) (*DatasetResponse, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *DatasetResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LastActorTaskRunsDefaultDatasetAPIService.ActorTaskRunsLastDatasetGet") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/actor-tasks/{actorTaskId}/runs/last/dataset" - localVarPath = strings.Replace(localVarPath, "{"+"actorTaskId"+"}", url.PathEscape(parameterValueToString(r.actorTaskId, "actorTaskId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if r.status != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "status", r.status, "form", "") - } - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiActorTaskRunsLastDatasetItemsGetRequest struct { - ctx context.Context - ApiService *LastActorTaskRunsDefaultDatasetAPIService - actorTaskId string - status *string - format *string - clean *bool - offset *float64 - limit *float64 - fields *string - outputFields *string - omit *string - unwind *string - flatten *string - desc *bool - attachment *bool - delimiter *string - bom *bool - xmlRoot *string - xmlRow *string - skipHeaderRow *bool - skipHidden *bool - skipEmpty *bool - simplified *bool - view *string - skipFailedPages *bool - feedTitle *string - feedDescription *string - signature *string -} - -// Filter for the run status. -func (r ApiActorTaskRunsLastDatasetItemsGetRequest) Status(status string) ApiActorTaskRunsLastDatasetItemsGetRequest { - r.status = &status - return r -} - -// Format of the results, possible values are: `json`, `jsonl`, `csv`, `html`, `xlsx`, `xml` and `rss`. The default value is `json`. -func (r ApiActorTaskRunsLastDatasetItemsGetRequest) Format(format string) ApiActorTaskRunsLastDatasetItemsGetRequest { - r.format = &format - return r -} - -// If `true` or `1` then the API endpoint returns only non-empty items and skips hidden fields (i.e. fields starting with the # character). The `clean` parameter is just a shortcut for `skipHidden=true` and `skipEmpty=true` parameters. Note that since some objects might be skipped from the output, that the result might contain less items than the `limit` value. -func (r ApiActorTaskRunsLastDatasetItemsGetRequest) Clean(clean bool) ApiActorTaskRunsLastDatasetItemsGetRequest { - r.clean = &clean - return r -} - -// Number of items that should be skipped at the start. The default value is `0`. -func (r ApiActorTaskRunsLastDatasetItemsGetRequest) Offset(offset float64) ApiActorTaskRunsLastDatasetItemsGetRequest { - r.offset = &offset - return r -} - -// Maximum number of items to return. By default there is no limit. -func (r ApiActorTaskRunsLastDatasetItemsGetRequest) Limit(limit float64) ApiActorTaskRunsLastDatasetItemsGetRequest { - r.limit = &limit - return r -} - -// A comma-separated list of fields which should be picked from the items, only these fields will remain in the resulting record objects. Note that the fields in the outputted items are sorted the same way as they are specified in the `fields` query parameter. You can use this feature to effectively fix the output format. -func (r ApiActorTaskRunsLastDatasetItemsGetRequest) Fields(fields string) ApiActorTaskRunsLastDatasetItemsGetRequest { - r.fields = &fields - return r -} - -// A comma-separated list of output field names that positionally rename the fields specified in the `fields` parameter. For example, `?fields=headline,url&outputFields=title,link` renames `headline` to `title` and `url` to `link` in the output. The number of names in `outputFields` must match the number of names in `fields`. Requires the `fields` parameter to be specified as well. -func (r ApiActorTaskRunsLastDatasetItemsGetRequest) OutputFields(outputFields string) ApiActorTaskRunsLastDatasetItemsGetRequest { - r.outputFields = &outputFields - return r -} - -// A comma-separated list of fields which should be omitted from the items. -func (r ApiActorTaskRunsLastDatasetItemsGetRequest) Omit(omit string) ApiActorTaskRunsLastDatasetItemsGetRequest { - r.omit = &omit - return r -} - -// A comma-separated list of fields which should be unwound, in order which they should be processed. Each field should be either an array or an object. If the field is an array then every element of the array will become a separate record and merged with parent object. If the unwound field is an object then it is merged with the parent object. If the unwound field is missing or its value is neither an array nor an object and therefore cannot be merged with a parent object then the item gets preserved as it is. Note that the unwound items ignore the `desc` parameter. -func (r ApiActorTaskRunsLastDatasetItemsGetRequest) Unwind(unwind string) ApiActorTaskRunsLastDatasetItemsGetRequest { - r.unwind = &unwind - return r -} - -// A comma-separated list of fields which should transform nested objects into flat structures. For example, with `flatten=\"foo\"` the object `{\"foo\":{\"bar\": \"hello\"}}` is turned into `{\"foo.bar\": \"hello\"}`. The original object with properties is replaced with the flattened object. -func (r ApiActorTaskRunsLastDatasetItemsGetRequest) Flatten(flatten string) ApiActorTaskRunsLastDatasetItemsGetRequest { - r.flatten = &flatten - return r -} - -// By default, results are returned in the same order as they were stored. To reverse the order, set this parameter to `true` or `1`. -func (r ApiActorTaskRunsLastDatasetItemsGetRequest) Desc(desc bool) ApiActorTaskRunsLastDatasetItemsGetRequest { - r.desc = &desc - return r -} - -// If `true` or `1` then the response will define the `Content-Disposition: attachment` header, forcing a web browser to download the file rather than to display it. By default this header is not present. -func (r ApiActorTaskRunsLastDatasetItemsGetRequest) Attachment(attachment bool) ApiActorTaskRunsLastDatasetItemsGetRequest { - r.attachment = &attachment - return r -} - -// A delimiter character for CSV files, only used if `format=csv`. You might need to URL-encode the character (e.g. use `%09` for tab or `%3B` for semicolon). The default delimiter is a simple comma (`,`). -func (r ApiActorTaskRunsLastDatasetItemsGetRequest) Delimiter(delimiter string) ApiActorTaskRunsLastDatasetItemsGetRequest { - r.delimiter = &delimiter - return r -} - -// All text responses are encoded in UTF-8 encoding. By default, the `format=csv` files are prefixed with the UTF-8 Byte Order Mark (BOM), while `json`, `jsonl`, `xml`, `html` and `rss` files are not. If you want to override this default behavior, specify `bom=1` query parameter to include the BOM or `bom=0` to skip it. -func (r ApiActorTaskRunsLastDatasetItemsGetRequest) Bom(bom bool) ApiActorTaskRunsLastDatasetItemsGetRequest { - r.bom = &bom - return r -} - -// Overrides default root element name of `xml` output. By default the root element is `items`. -func (r ApiActorTaskRunsLastDatasetItemsGetRequest) XmlRoot(xmlRoot string) ApiActorTaskRunsLastDatasetItemsGetRequest { - r.xmlRoot = &xmlRoot - return r -} - -// Overrides default element name that wraps each page or page function result object in `xml` output. By default the element name is `item`. -func (r ApiActorTaskRunsLastDatasetItemsGetRequest) XmlRow(xmlRow string) ApiActorTaskRunsLastDatasetItemsGetRequest { - r.xmlRow = &xmlRow - return r -} - -// If `true` or `1` then header row in the `csv` format is skipped. -func (r ApiActorTaskRunsLastDatasetItemsGetRequest) SkipHeaderRow(skipHeaderRow bool) ApiActorTaskRunsLastDatasetItemsGetRequest { - r.skipHeaderRow = &skipHeaderRow - return r -} - -// If `true` or `1` then hidden fields are skipped from the output, i.e. fields starting with the `#` character. -func (r ApiActorTaskRunsLastDatasetItemsGetRequest) SkipHidden(skipHidden bool) ApiActorTaskRunsLastDatasetItemsGetRequest { - r.skipHidden = &skipHidden - return r -} - -// If `true` or `1` then empty items are skipped from the output. Note that if used, the results might contain less items than the limit value. -func (r ApiActorTaskRunsLastDatasetItemsGetRequest) SkipEmpty(skipEmpty bool) ApiActorTaskRunsLastDatasetItemsGetRequest { - r.skipEmpty = &skipEmpty - return r -} - -// If `true` or `1` then, the endpoint applies the `fields=url,pageFunctionResult,errorInfo` and `unwind=pageFunctionResult` query parameters. This feature is used to emulate simplified results provided by the legacy Apify Crawler product and it's not recommended to use it in new integrations. -func (r ApiActorTaskRunsLastDatasetItemsGetRequest) Simplified(simplified bool) ApiActorTaskRunsLastDatasetItemsGetRequest { - r.simplified = &simplified - return r -} - -// Defines the view configuration for dataset items based on the schema definition. This parameter determines how the data will be filtered and presented. For complete specification details, see the [dataset schema documentation](/platform/actors/development/actor-definition/dataset-schema). -func (r ApiActorTaskRunsLastDatasetItemsGetRequest) View(view string) ApiActorTaskRunsLastDatasetItemsGetRequest { - r.view = &view - return r -} - -// If `true` or `1` then, the all the items with errorInfo property will be skipped from the output. This feature is here to emulate functionality of API version 1 used for the legacy Apify Crawler product and it's not recommended to use it in new integrations. -func (r ApiActorTaskRunsLastDatasetItemsGetRequest) SkipFailedPages(skipFailedPages bool) ApiActorTaskRunsLastDatasetItemsGetRequest { - r.skipFailedPages = &skipFailedPages - return r -} - -// Overrides the auto-generated RSS channel `<title>` element. Only used when `format=rss`. If not provided, the title defaults to `Dataset <label>`. -func (r ApiActorTaskRunsLastDatasetItemsGetRequest) FeedTitle(feedTitle string) ApiActorTaskRunsLastDatasetItemsGetRequest { - r.feedTitle = &feedTitle - return r -} - -// Overrides the auto-generated RSS channel `<description>` element. Only used when `format=rss`. If not provided, the description defaults to `Items in dataset with id \"<datasetId>\".` -func (r ApiActorTaskRunsLastDatasetItemsGetRequest) FeedDescription(feedDescription string) ApiActorTaskRunsLastDatasetItemsGetRequest { - r.feedDescription = &feedDescription - return r -} - -// Signature used for the access. -func (r ApiActorTaskRunsLastDatasetItemsGetRequest) Signature(signature string) ApiActorTaskRunsLastDatasetItemsGetRequest { - r.signature = &signature - return r -} - -func (r ApiActorTaskRunsLastDatasetItemsGetRequest) Execute() ([]map[string]interface{}, *http.Response, error) { - return r.ApiService.ActorTaskRunsLastDatasetItemsGetExecute(r) -} - -/* -ActorTaskRunsLastDatasetItemsGet Get last task run's dataset items - -Returns data stored in the default dataset of the last Actor task run in the desired format. - -This endpoint is a shortcut that resolves the last task run's `defaultDatasetId` and proxies to the -[Get dataset items](/api/v2/dataset-items-get) endpoint. - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param actorTaskId Task ID or a tilde-separated owner's username and task's name. - @return ApiActorTaskRunsLastDatasetItemsGetRequest -*/ -func (a *LastActorTaskRunsDefaultDatasetAPIService) ActorTaskRunsLastDatasetItemsGet(ctx context.Context, actorTaskId string) ApiActorTaskRunsLastDatasetItemsGetRequest { - return ApiActorTaskRunsLastDatasetItemsGetRequest{ - ApiService: a, - ctx: ctx, - actorTaskId: actorTaskId, - } -} - -// Execute executes the request -// @return []map[string]interface{} -func (a *LastActorTaskRunsDefaultDatasetAPIService) ActorTaskRunsLastDatasetItemsGetExecute(r ApiActorTaskRunsLastDatasetItemsGetRequest) ([]map[string]interface{}, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue []map[string]interface{} - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LastActorTaskRunsDefaultDatasetAPIService.ActorTaskRunsLastDatasetItemsGet") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/actor-tasks/{actorTaskId}/runs/last/dataset/items" - localVarPath = strings.Replace(localVarPath, "{"+"actorTaskId"+"}", url.PathEscape(parameterValueToString(r.actorTaskId, "actorTaskId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if r.status != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "status", r.status, "form", "") - } - if r.format != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "format", r.format, "form", "") - } - if r.clean != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "clean", r.clean, "form", "") - } - if r.offset != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "form", "") - } - if r.limit != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "form", "") - } - if r.fields != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "fields", r.fields, "form", "") - } - if r.outputFields != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "outputFields", r.outputFields, "form", "") - } - if r.omit != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "omit", r.omit, "form", "") - } - if r.unwind != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "unwind", r.unwind, "form", "") - } - if r.flatten != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "flatten", r.flatten, "form", "") - } - if r.desc != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "desc", r.desc, "form", "") - } - if r.attachment != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "attachment", r.attachment, "form", "") - } - if r.delimiter != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "delimiter", r.delimiter, "form", "") - } - if r.bom != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "bom", r.bom, "form", "") - } - if r.xmlRoot != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "xmlRoot", r.xmlRoot, "form", "") - } - if r.xmlRow != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "xmlRow", r.xmlRow, "form", "") - } - if r.skipHeaderRow != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "skipHeaderRow", r.skipHeaderRow, "form", "") - } - if r.skipHidden != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "skipHidden", r.skipHidden, "form", "") - } - if r.skipEmpty != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "skipEmpty", r.skipEmpty, "form", "") - } - if r.simplified != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "simplified", r.simplified, "form", "") - } - if r.view != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "view", r.view, "form", "") - } - if r.skipFailedPages != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "skipFailedPages", r.skipFailedPages, "form", "") - } - if r.feedTitle != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "feedTitle", r.feedTitle, "form", "") - } - if r.feedDescription != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "feedDescription", r.feedDescription, "form", "") - } - if r.signature != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "signature", r.signature, "form", "") - } - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json", "application/jsonl", "text/csv", "text/html", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", "application/rss+xml", "application/xml"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiActorTaskRunsLastDatasetItemsPostRequest struct { - ctx context.Context - ApiService *LastActorTaskRunsDefaultDatasetAPIService - actorTaskId string - actRunsLastDatasetItemsPostRequest *ActRunsLastDatasetItemsPostRequest - status *string -} - -// -func (r ApiActorTaskRunsLastDatasetItemsPostRequest) ActRunsLastDatasetItemsPostRequest(actRunsLastDatasetItemsPostRequest ActRunsLastDatasetItemsPostRequest) ApiActorTaskRunsLastDatasetItemsPostRequest { - r.actRunsLastDatasetItemsPostRequest = &actRunsLastDatasetItemsPostRequest - return r -} - -// Filter for the run status. -func (r ApiActorTaskRunsLastDatasetItemsPostRequest) Status(status string) ApiActorTaskRunsLastDatasetItemsPostRequest { - r.status = &status - return r -} - -func (r ApiActorTaskRunsLastDatasetItemsPostRequest) Execute() (map[string]interface{}, *http.Response, error) { - return r.ApiService.ActorTaskRunsLastDatasetItemsPostExecute(r) -} - -/* -ActorTaskRunsLastDatasetItemsPost Store items in last task run's dataset - -Appends an item or an array of items to the end of the last Actor task run's default dataset. - -This endpoint is a shortcut that resolves the last task run's `defaultDatasetId` and proxies to the -[Store items](/api/v2/dataset-items-post) endpoint. - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param actorTaskId Task ID or a tilde-separated owner's username and task's name. - @return ApiActorTaskRunsLastDatasetItemsPostRequest -*/ -func (a *LastActorTaskRunsDefaultDatasetAPIService) ActorTaskRunsLastDatasetItemsPost(ctx context.Context, actorTaskId string) ApiActorTaskRunsLastDatasetItemsPostRequest { - return ApiActorTaskRunsLastDatasetItemsPostRequest{ - ApiService: a, - ctx: ctx, - actorTaskId: actorTaskId, - } -} - -// Execute executes the request -// @return map[string]interface{} -func (a *LastActorTaskRunsDefaultDatasetAPIService) ActorTaskRunsLastDatasetItemsPostExecute(r ApiActorTaskRunsLastDatasetItemsPostRequest) (map[string]interface{}, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodPost - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue map[string]interface{} - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LastActorTaskRunsDefaultDatasetAPIService.ActorTaskRunsLastDatasetItemsPost") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/actor-tasks/{actorTaskId}/runs/last/dataset/items" - localVarPath = strings.Replace(localVarPath, "{"+"actorTaskId"+"}", url.PathEscape(parameterValueToString(r.actorTaskId, "actorTaskId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - if r.actRunsLastDatasetItemsPostRequest == nil { - return localVarReturnValue, nil, reportError("actRunsLastDatasetItemsPostRequest is required and must be specified") - } - - if r.status != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "status", r.status, "form", "") - } - // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/json"} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - // body params - localVarPostBody = r.actRunsLastDatasetItemsPostRequest - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ActRunsLastDatasetItemsPost400Response - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiActorTaskRunsLastDatasetPutRequest struct { - ctx context.Context - ApiService *LastActorTaskRunsDefaultDatasetAPIService - actorTaskId string - updateDatasetRequest *UpdateDatasetRequest - status *string -} - -// -func (r ApiActorTaskRunsLastDatasetPutRequest) UpdateDatasetRequest(updateDatasetRequest UpdateDatasetRequest) ApiActorTaskRunsLastDatasetPutRequest { - r.updateDatasetRequest = &updateDatasetRequest - return r -} - -// Filter for the run status. -func (r ApiActorTaskRunsLastDatasetPutRequest) Status(status string) ApiActorTaskRunsLastDatasetPutRequest { - r.status = &status - return r -} - -func (r ApiActorTaskRunsLastDatasetPutRequest) Execute() (*DatasetResponse, *http.Response, error) { - return r.ApiService.ActorTaskRunsLastDatasetPutExecute(r) -} - -/* -ActorTaskRunsLastDatasetPut Update last task run's default dataset - -Updates the default dataset associated with the last Actor task run. - -This endpoint is a shortcut for getting the last task run's `defaultDatasetId` and then using the -[Update dataset](/api/v2/dataset-put) endpoint. - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param actorTaskId Task ID or a tilde-separated owner's username and task's name. - @return ApiActorTaskRunsLastDatasetPutRequest -*/ -func (a *LastActorTaskRunsDefaultDatasetAPIService) ActorTaskRunsLastDatasetPut(ctx context.Context, actorTaskId string) ApiActorTaskRunsLastDatasetPutRequest { - return ApiActorTaskRunsLastDatasetPutRequest{ - ApiService: a, - ctx: ctx, - actorTaskId: actorTaskId, - } -} - -// Execute executes the request -// @return DatasetResponse -func (a *LastActorTaskRunsDefaultDatasetAPIService) ActorTaskRunsLastDatasetPutExecute(r ApiActorTaskRunsLastDatasetPutRequest) (*DatasetResponse, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodPut - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *DatasetResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LastActorTaskRunsDefaultDatasetAPIService.ActorTaskRunsLastDatasetPut") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/actor-tasks/{actorTaskId}/runs/last/dataset" - localVarPath = strings.Replace(localVarPath, "{"+"actorTaskId"+"}", url.PathEscape(parameterValueToString(r.actorTaskId, "actorTaskId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - if r.updateDatasetRequest == nil { - return localVarReturnValue, nil, reportError("updateDatasetRequest is required and must be specified") - } - - if r.status != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "status", r.status, "form", "") - } - // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/json"} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - // body params - localVarPostBody = r.updateDatasetRequest - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 413 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 415 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiActorTaskRunsLastDatasetStatisticsGetRequest struct { - ctx context.Context - ApiService *LastActorTaskRunsDefaultDatasetAPIService - actorTaskId string - status *string -} - -// Filter for the run status. -func (r ApiActorTaskRunsLastDatasetStatisticsGetRequest) Status(status string) ApiActorTaskRunsLastDatasetStatisticsGetRequest { - r.status = &status - return r -} - -func (r ApiActorTaskRunsLastDatasetStatisticsGetRequest) Execute() (*DatasetStatisticsResponse, *http.Response, error) { - return r.ApiService.ActorTaskRunsLastDatasetStatisticsGetExecute(r) -} - -/* -ActorTaskRunsLastDatasetStatisticsGet Get last task run's dataset statistics - -Returns statistics for the last Actor task run's default dataset. - -This endpoint is a shortcut that resolves the last task run's `defaultDatasetId` and proxies to the -[Get dataset statistics](/api/v2/dataset-statistics-get) endpoint. - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param actorTaskId Task ID or a tilde-separated owner's username and task's name. - @return ApiActorTaskRunsLastDatasetStatisticsGetRequest -*/ -func (a *LastActorTaskRunsDefaultDatasetAPIService) ActorTaskRunsLastDatasetStatisticsGet(ctx context.Context, actorTaskId string) ApiActorTaskRunsLastDatasetStatisticsGetRequest { - return ApiActorTaskRunsLastDatasetStatisticsGetRequest{ - ApiService: a, - ctx: ctx, - actorTaskId: actorTaskId, - } -} - -// Execute executes the request -// @return DatasetStatisticsResponse -func (a *LastActorTaskRunsDefaultDatasetAPIService) ActorTaskRunsLastDatasetStatisticsGetExecute(r ApiActorTaskRunsLastDatasetStatisticsGetRequest) (*DatasetStatisticsResponse, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *DatasetStatisticsResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LastActorTaskRunsDefaultDatasetAPIService.ActorTaskRunsLastDatasetStatisticsGet") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/actor-tasks/{actorTaskId}/runs/last/dataset/statistics" - localVarPath = strings.Replace(localVarPath, "{"+"actorTaskId"+"}", url.PathEscape(parameterValueToString(r.actorTaskId, "actorTaskId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if r.status != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "status", r.status, "form", "") - } - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} diff --git a/api_last_actor_task_runs_default_key_value_store.go b/api_last_actor_task_runs_default_key_value_store.go deleted file mode 100644 index 7c73c7a..0000000 --- a/api_last_actor_task_runs_default_key_value_store.go +++ /dev/null @@ -1,2009 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "bytes" - "context" - "io" - "net/http" - "net/url" - "strings" - "os" -) - - -// LastActorTaskRunsDefaultKeyValueStoreAPIService LastActorTaskRunsDefaultKeyValueStoreAPI service -type LastActorTaskRunsDefaultKeyValueStoreAPIService service - -type ApiActorTaskRunsLastKeyValueStoreDeleteRequest struct { - ctx context.Context - ApiService *LastActorTaskRunsDefaultKeyValueStoreAPIService - actorTaskId string - status *string -} - -// Filter for the run status. -func (r ApiActorTaskRunsLastKeyValueStoreDeleteRequest) Status(status string) ApiActorTaskRunsLastKeyValueStoreDeleteRequest { - r.status = &status - return r -} - -func (r ApiActorTaskRunsLastKeyValueStoreDeleteRequest) Execute() (*http.Response, error) { - return r.ApiService.ActorTaskRunsLastKeyValueStoreDeleteExecute(r) -} - -/* -ActorTaskRunsLastKeyValueStoreDelete Delete last task run's default store - -Deletes the default key-value store of the last Actor task run. - -This endpoint is a shortcut for getting the last task run's `defaultKeyValueStoreId` and then using the -[Delete store](/api/v2/key-value-store-delete) endpoint. - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param actorTaskId Task ID or a tilde-separated owner's username and task's name. - @return ApiActorTaskRunsLastKeyValueStoreDeleteRequest -*/ -func (a *LastActorTaskRunsDefaultKeyValueStoreAPIService) ActorTaskRunsLastKeyValueStoreDelete(ctx context.Context, actorTaskId string) ApiActorTaskRunsLastKeyValueStoreDeleteRequest { - return ApiActorTaskRunsLastKeyValueStoreDeleteRequest{ - ApiService: a, - ctx: ctx, - actorTaskId: actorTaskId, - } -} - -// Execute executes the request -func (a *LastActorTaskRunsDefaultKeyValueStoreAPIService) ActorTaskRunsLastKeyValueStoreDeleteExecute(r ApiActorTaskRunsLastKeyValueStoreDeleteRequest) (*http.Response, error) { - var ( - localVarHTTPMethod = http.MethodDelete - localVarPostBody interface{} - formFiles []formFile - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LastActorTaskRunsDefaultKeyValueStoreAPIService.ActorTaskRunsLastKeyValueStoreDelete") - if err != nil { - return nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/actor-tasks/{actorTaskId}/runs/last/key-value-store" - localVarPath = strings.Replace(localVarPath, "{"+"actorTaskId"+"}", url.PathEscape(parameterValueToString(r.actorTaskId, "actorTaskId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if r.status != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "status", r.status, "form", "") - } - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarHTTPResponse, newErr - } - - return localVarHTTPResponse, nil -} - -type ApiActorTaskRunsLastKeyValueStoreGetRequest struct { - ctx context.Context - ApiService *LastActorTaskRunsDefaultKeyValueStoreAPIService - actorTaskId string - status *string -} - -// Filter for the run status. -func (r ApiActorTaskRunsLastKeyValueStoreGetRequest) Status(status string) ApiActorTaskRunsLastKeyValueStoreGetRequest { - r.status = &status - return r -} - -func (r ApiActorTaskRunsLastKeyValueStoreGetRequest) Execute() (*KeyValueStoreResponse, *http.Response, error) { - return r.ApiService.ActorTaskRunsLastKeyValueStoreGetExecute(r) -} - -/* -ActorTaskRunsLastKeyValueStoreGet Get last task run's default store - -Gets an object that contains all the details about the default key-value store of the last Actor task run. - -This endpoint is a shortcut for getting the last task run's `defaultKeyValueStoreId` and then using the -[Get store](/api/v2/key-value-store-get) endpoint. - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param actorTaskId Task ID or a tilde-separated owner's username and task's name. - @return ApiActorTaskRunsLastKeyValueStoreGetRequest -*/ -func (a *LastActorTaskRunsDefaultKeyValueStoreAPIService) ActorTaskRunsLastKeyValueStoreGet(ctx context.Context, actorTaskId string) ApiActorTaskRunsLastKeyValueStoreGetRequest { - return ApiActorTaskRunsLastKeyValueStoreGetRequest{ - ApiService: a, - ctx: ctx, - actorTaskId: actorTaskId, - } -} - -// Execute executes the request -// @return KeyValueStoreResponse -func (a *LastActorTaskRunsDefaultKeyValueStoreAPIService) ActorTaskRunsLastKeyValueStoreGetExecute(r ApiActorTaskRunsLastKeyValueStoreGetRequest) (*KeyValueStoreResponse, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *KeyValueStoreResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LastActorTaskRunsDefaultKeyValueStoreAPIService.ActorTaskRunsLastKeyValueStoreGet") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/actor-tasks/{actorTaskId}/runs/last/key-value-store" - localVarPath = strings.Replace(localVarPath, "{"+"actorTaskId"+"}", url.PathEscape(parameterValueToString(r.actorTaskId, "actorTaskId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if r.status != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "status", r.status, "form", "") - } - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiActorTaskRunsLastKeyValueStoreKeysGetRequest struct { - ctx context.Context - ApiService *LastActorTaskRunsDefaultKeyValueStoreAPIService - actorTaskId string - status *string - exclusiveStartKey *string - limit *float32 - collection *string - prefix *string - signature *string -} - -// Filter for the run status. -func (r ApiActorTaskRunsLastKeyValueStoreKeysGetRequest) Status(status string) ApiActorTaskRunsLastKeyValueStoreKeysGetRequest { - r.status = &status - return r -} - -// All keys up to this one (including) are skipped from the result. -func (r ApiActorTaskRunsLastKeyValueStoreKeysGetRequest) ExclusiveStartKey(exclusiveStartKey string) ApiActorTaskRunsLastKeyValueStoreKeysGetRequest { - r.exclusiveStartKey = &exclusiveStartKey - return r -} - -// Number of keys to be returned. -func (r ApiActorTaskRunsLastKeyValueStoreKeysGetRequest) Limit(limit float32) ApiActorTaskRunsLastKeyValueStoreKeysGetRequest { - r.limit = &limit - return r -} - -// Limit the results to keys that belong to a specific collection from the key-value store schema. The key-value store need to have a schema defined for this parameter to work. -func (r ApiActorTaskRunsLastKeyValueStoreKeysGetRequest) Collection(collection string) ApiActorTaskRunsLastKeyValueStoreKeysGetRequest { - r.collection = &collection - return r -} - -// Limit the results to keys that start with a specific prefix. -func (r ApiActorTaskRunsLastKeyValueStoreKeysGetRequest) Prefix(prefix string) ApiActorTaskRunsLastKeyValueStoreKeysGetRequest { - r.prefix = &prefix - return r -} - -// Signature used for the access. -func (r ApiActorTaskRunsLastKeyValueStoreKeysGetRequest) Signature(signature string) ApiActorTaskRunsLastKeyValueStoreKeysGetRequest { - r.signature = &signature - return r -} - -func (r ApiActorTaskRunsLastKeyValueStoreKeysGetRequest) Execute() (*ListOfKeysResponse, *http.Response, error) { - return r.ApiService.ActorTaskRunsLastKeyValueStoreKeysGetExecute(r) -} - -/* -ActorTaskRunsLastKeyValueStoreKeysGet Get last task run's default store's list of keys - -Returns a list of keys for the default key-value store of the last Actor task run. - -This endpoint is a shortcut for getting the last task run's `defaultKeyValueStoreId` and then using the -[Get list of keys](/api/v2/key-value-store-keys-get) endpoint. - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param actorTaskId Task ID or a tilde-separated owner's username and task's name. - @return ApiActorTaskRunsLastKeyValueStoreKeysGetRequest -*/ -func (a *LastActorTaskRunsDefaultKeyValueStoreAPIService) ActorTaskRunsLastKeyValueStoreKeysGet(ctx context.Context, actorTaskId string) ApiActorTaskRunsLastKeyValueStoreKeysGetRequest { - return ApiActorTaskRunsLastKeyValueStoreKeysGetRequest{ - ApiService: a, - ctx: ctx, - actorTaskId: actorTaskId, - } -} - -// Execute executes the request -// @return ListOfKeysResponse -func (a *LastActorTaskRunsDefaultKeyValueStoreAPIService) ActorTaskRunsLastKeyValueStoreKeysGetExecute(r ApiActorTaskRunsLastKeyValueStoreKeysGetRequest) (*ListOfKeysResponse, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *ListOfKeysResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LastActorTaskRunsDefaultKeyValueStoreAPIService.ActorTaskRunsLastKeyValueStoreKeysGet") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/actor-tasks/{actorTaskId}/runs/last/key-value-store/keys" - localVarPath = strings.Replace(localVarPath, "{"+"actorTaskId"+"}", url.PathEscape(parameterValueToString(r.actorTaskId, "actorTaskId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if r.status != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "status", r.status, "form", "") - } - if r.exclusiveStartKey != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "exclusiveStartKey", r.exclusiveStartKey, "form", "") - } - if r.limit != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "form", "") - } else { - var defaultValue float32 = 1000 - parameterAddToHeaderOrQuery(localVarQueryParams, "limit", defaultValue, "form", "") - r.limit = &defaultValue - } - if r.collection != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "collection", r.collection, "form", "") - } - if r.prefix != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "prefix", r.prefix, "form", "") - } - if r.signature != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "signature", r.signature, "form", "") - } - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiActorTaskRunsLastKeyValueStorePutRequest struct { - ctx context.Context - ApiService *LastActorTaskRunsDefaultKeyValueStoreAPIService - actorTaskId string - updateStoreRequest *UpdateStoreRequest - status *string -} - -// -func (r ApiActorTaskRunsLastKeyValueStorePutRequest) UpdateStoreRequest(updateStoreRequest UpdateStoreRequest) ApiActorTaskRunsLastKeyValueStorePutRequest { - r.updateStoreRequest = &updateStoreRequest - return r -} - -// Filter for the run status. -func (r ApiActorTaskRunsLastKeyValueStorePutRequest) Status(status string) ApiActorTaskRunsLastKeyValueStorePutRequest { - r.status = &status - return r -} - -func (r ApiActorTaskRunsLastKeyValueStorePutRequest) Execute() (*KeyValueStoreResponse, *http.Response, error) { - return r.ApiService.ActorTaskRunsLastKeyValueStorePutExecute(r) -} - -/* -ActorTaskRunsLastKeyValueStorePut Update last task run's default store - -Updates the default key-value store associated with the last Actor task run. - -This endpoint is a shortcut for getting the last task run's `defaultKeyValueStoreId` and then using the -[Update store](/api/v2/key-value-store-put) endpoint. - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param actorTaskId Task ID or a tilde-separated owner's username and task's name. - @return ApiActorTaskRunsLastKeyValueStorePutRequest -*/ -func (a *LastActorTaskRunsDefaultKeyValueStoreAPIService) ActorTaskRunsLastKeyValueStorePut(ctx context.Context, actorTaskId string) ApiActorTaskRunsLastKeyValueStorePutRequest { - return ApiActorTaskRunsLastKeyValueStorePutRequest{ - ApiService: a, - ctx: ctx, - actorTaskId: actorTaskId, - } -} - -// Execute executes the request -// @return KeyValueStoreResponse -func (a *LastActorTaskRunsDefaultKeyValueStoreAPIService) ActorTaskRunsLastKeyValueStorePutExecute(r ApiActorTaskRunsLastKeyValueStorePutRequest) (*KeyValueStoreResponse, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodPut - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *KeyValueStoreResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LastActorTaskRunsDefaultKeyValueStoreAPIService.ActorTaskRunsLastKeyValueStorePut") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/actor-tasks/{actorTaskId}/runs/last/key-value-store" - localVarPath = strings.Replace(localVarPath, "{"+"actorTaskId"+"}", url.PathEscape(parameterValueToString(r.actorTaskId, "actorTaskId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - if r.updateStoreRequest == nil { - return localVarReturnValue, nil, reportError("updateStoreRequest is required and must be specified") - } - - if r.status != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "status", r.status, "form", "") - } - // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/json"} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - // body params - localVarPostBody = r.updateStoreRequest - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 413 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 415 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiActorTaskRunsLastKeyValueStoreRecordDeleteRequest struct { - ctx context.Context - ApiService *LastActorTaskRunsDefaultKeyValueStoreAPIService - actorTaskId string - recordKey string - status *string -} - -// Filter for the run status. -func (r ApiActorTaskRunsLastKeyValueStoreRecordDeleteRequest) Status(status string) ApiActorTaskRunsLastKeyValueStoreRecordDeleteRequest { - r.status = &status - return r -} - -func (r ApiActorTaskRunsLastKeyValueStoreRecordDeleteRequest) Execute() (*http.Response, error) { - return r.ApiService.ActorTaskRunsLastKeyValueStoreRecordDeleteExecute(r) -} - -/* -ActorTaskRunsLastKeyValueStoreRecordDelete Delete last task run's default store's record - -Removes a record specified by a key from the default key-value store of the last Actor task run. - -This endpoint is a shortcut for getting the last task run's `defaultKeyValueStoreId` and then using the -[Delete record](/api/v2/key-value-store-record-delete) endpoint. - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param actorTaskId Task ID or a tilde-separated owner's username and task's name. - @param recordKey Key of the record. - @return ApiActorTaskRunsLastKeyValueStoreRecordDeleteRequest -*/ -func (a *LastActorTaskRunsDefaultKeyValueStoreAPIService) ActorTaskRunsLastKeyValueStoreRecordDelete(ctx context.Context, actorTaskId string, recordKey string) ApiActorTaskRunsLastKeyValueStoreRecordDeleteRequest { - return ApiActorTaskRunsLastKeyValueStoreRecordDeleteRequest{ - ApiService: a, - ctx: ctx, - actorTaskId: actorTaskId, - recordKey: recordKey, - } -} - -// Execute executes the request -func (a *LastActorTaskRunsDefaultKeyValueStoreAPIService) ActorTaskRunsLastKeyValueStoreRecordDeleteExecute(r ApiActorTaskRunsLastKeyValueStoreRecordDeleteRequest) (*http.Response, error) { - var ( - localVarHTTPMethod = http.MethodDelete - localVarPostBody interface{} - formFiles []formFile - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LastActorTaskRunsDefaultKeyValueStoreAPIService.ActorTaskRunsLastKeyValueStoreRecordDelete") - if err != nil { - return nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/actor-tasks/{actorTaskId}/runs/last/key-value-store/records/{recordKey}" - localVarPath = strings.Replace(localVarPath, "{"+"actorTaskId"+"}", url.PathEscape(parameterValueToString(r.actorTaskId, "actorTaskId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"recordKey"+"}", url.PathEscape(parameterValueToString(r.recordKey, "recordKey")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if r.status != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "status", r.status, "form", "") - } - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarHTTPResponse, newErr - } - - return localVarHTTPResponse, nil -} - -type ApiActorTaskRunsLastKeyValueStoreRecordGetRequest struct { - ctx context.Context - ApiService *LastActorTaskRunsDefaultKeyValueStoreAPIService - actorTaskId string - recordKey string - status *string - signature *string - attachment *bool -} - -// Filter for the run status. -func (r ApiActorTaskRunsLastKeyValueStoreRecordGetRequest) Status(status string) ApiActorTaskRunsLastKeyValueStoreRecordGetRequest { - r.status = &status - return r -} - -// Signature used for the access. -func (r ApiActorTaskRunsLastKeyValueStoreRecordGetRequest) Signature(signature string) ApiActorTaskRunsLastKeyValueStoreRecordGetRequest { - r.signature = &signature - return r -} - -// If `true` or `1`, the response will be served with `Content-Disposition: attachment` header, causing web browsers to offer downloading HTML records instead of displaying them. -func (r ApiActorTaskRunsLastKeyValueStoreRecordGetRequest) Attachment(attachment bool) ApiActorTaskRunsLastKeyValueStoreRecordGetRequest { - r.attachment = &attachment - return r -} - -func (r ApiActorTaskRunsLastKeyValueStoreRecordGetRequest) Execute() (map[string]interface{}, *http.Response, error) { - return r.ApiService.ActorTaskRunsLastKeyValueStoreRecordGetExecute(r) -} - -/* -ActorTaskRunsLastKeyValueStoreRecordGet Get last task run's default store's record - -Gets a value stored under a specific key in the default key-value store of the last Actor task run. - -This endpoint is a shortcut for getting the last task run's `defaultKeyValueStoreId` and then using the -[Get record](/api/v2/key-value-store-record-get) endpoint. - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param actorTaskId Task ID or a tilde-separated owner's username and task's name. - @param recordKey Key of the record. - @return ApiActorTaskRunsLastKeyValueStoreRecordGetRequest -*/ -func (a *LastActorTaskRunsDefaultKeyValueStoreAPIService) ActorTaskRunsLastKeyValueStoreRecordGet(ctx context.Context, actorTaskId string, recordKey string) ApiActorTaskRunsLastKeyValueStoreRecordGetRequest { - return ApiActorTaskRunsLastKeyValueStoreRecordGetRequest{ - ApiService: a, - ctx: ctx, - actorTaskId: actorTaskId, - recordKey: recordKey, - } -} - -// Execute executes the request -// @return map[string]interface{} -func (a *LastActorTaskRunsDefaultKeyValueStoreAPIService) ActorTaskRunsLastKeyValueStoreRecordGetExecute(r ApiActorTaskRunsLastKeyValueStoreRecordGetRequest) (map[string]interface{}, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue map[string]interface{} - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LastActorTaskRunsDefaultKeyValueStoreAPIService.ActorTaskRunsLastKeyValueStoreRecordGet") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/actor-tasks/{actorTaskId}/runs/last/key-value-store/records/{recordKey}" - localVarPath = strings.Replace(localVarPath, "{"+"actorTaskId"+"}", url.PathEscape(parameterValueToString(r.actorTaskId, "actorTaskId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"recordKey"+"}", url.PathEscape(parameterValueToString(r.recordKey, "recordKey")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if r.status != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "status", r.status, "form", "") - } - if r.signature != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "signature", r.signature, "form", "") - } - if r.attachment != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "attachment", r.attachment, "form", "") - } - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json", "*/*"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiActorTaskRunsLastKeyValueStoreRecordPostRequest struct { - ctx context.Context - ApiService *LastActorTaskRunsDefaultKeyValueStoreAPIService - actorTaskId string - recordKey string - requestBody *map[string]interface{} - status *string - contentEncoding *string -} - -// -func (r ApiActorTaskRunsLastKeyValueStoreRecordPostRequest) RequestBody(requestBody map[string]interface{}) ApiActorTaskRunsLastKeyValueStoreRecordPostRequest { - r.requestBody = &requestBody - return r -} - -// Filter for the run status. -func (r ApiActorTaskRunsLastKeyValueStoreRecordPostRequest) Status(status string) ApiActorTaskRunsLastKeyValueStoreRecordPostRequest { - r.status = &status - return r -} - -// -func (r ApiActorTaskRunsLastKeyValueStoreRecordPostRequest) ContentEncoding(contentEncoding string) ApiActorTaskRunsLastKeyValueStoreRecordPostRequest { - r.contentEncoding = &contentEncoding - return r -} - -func (r ApiActorTaskRunsLastKeyValueStoreRecordPostRequest) Execute() (map[string]interface{}, *http.Response, error) { - return r.ApiService.ActorTaskRunsLastKeyValueStoreRecordPostExecute(r) -} - -/* -ActorTaskRunsLastKeyValueStoreRecordPost Store record in last task run's default store (POST) - -Stores a value under a specific key in the default key-value store of the last Actor task run. - -This endpoint is a shortcut for getting the last task run's `defaultKeyValueStoreId` and then using the -[Store record](/api/v2/key-value-store-record-post) endpoint. - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param actorTaskId Task ID or a tilde-separated owner's username and task's name. - @param recordKey Key of the record. - @return ApiActorTaskRunsLastKeyValueStoreRecordPostRequest -*/ -func (a *LastActorTaskRunsDefaultKeyValueStoreAPIService) ActorTaskRunsLastKeyValueStoreRecordPost(ctx context.Context, actorTaskId string, recordKey string) ApiActorTaskRunsLastKeyValueStoreRecordPostRequest { - return ApiActorTaskRunsLastKeyValueStoreRecordPostRequest{ - ApiService: a, - ctx: ctx, - actorTaskId: actorTaskId, - recordKey: recordKey, - } -} - -// Execute executes the request -// @return map[string]interface{} -func (a *LastActorTaskRunsDefaultKeyValueStoreAPIService) ActorTaskRunsLastKeyValueStoreRecordPostExecute(r ApiActorTaskRunsLastKeyValueStoreRecordPostRequest) (map[string]interface{}, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodPost - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue map[string]interface{} - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LastActorTaskRunsDefaultKeyValueStoreAPIService.ActorTaskRunsLastKeyValueStoreRecordPost") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/actor-tasks/{actorTaskId}/runs/last/key-value-store/records/{recordKey}" - localVarPath = strings.Replace(localVarPath, "{"+"actorTaskId"+"}", url.PathEscape(parameterValueToString(r.actorTaskId, "actorTaskId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"recordKey"+"}", url.PathEscape(parameterValueToString(r.recordKey, "recordKey")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - if r.requestBody == nil { - return localVarReturnValue, nil, reportError("requestBody is required and must be specified") - } - - if r.status != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "status", r.status, "form", "") - } - // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/json"} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - if r.contentEncoding != nil { - parameterAddToHeaderOrQuery(localVarHeaderParams, "Content-Encoding", r.contentEncoding, "simple", "") - } - // body params - localVarPostBody = r.requestBody - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 413 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 415 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiActorTaskRunsLastKeyValueStoreRecordPutRequest struct { - ctx context.Context - ApiService *LastActorTaskRunsDefaultKeyValueStoreAPIService - actorTaskId string - recordKey string - requestBody *map[string]interface{} - status *string - contentEncoding *string -} - -// -func (r ApiActorTaskRunsLastKeyValueStoreRecordPutRequest) RequestBody(requestBody map[string]interface{}) ApiActorTaskRunsLastKeyValueStoreRecordPutRequest { - r.requestBody = &requestBody - return r -} - -// Filter for the run status. -func (r ApiActorTaskRunsLastKeyValueStoreRecordPutRequest) Status(status string) ApiActorTaskRunsLastKeyValueStoreRecordPutRequest { - r.status = &status - return r -} - -// -func (r ApiActorTaskRunsLastKeyValueStoreRecordPutRequest) ContentEncoding(contentEncoding string) ApiActorTaskRunsLastKeyValueStoreRecordPutRequest { - r.contentEncoding = &contentEncoding - return r -} - -func (r ApiActorTaskRunsLastKeyValueStoreRecordPutRequest) Execute() (map[string]interface{}, *http.Response, error) { - return r.ApiService.ActorTaskRunsLastKeyValueStoreRecordPutExecute(r) -} - -/* -ActorTaskRunsLastKeyValueStoreRecordPut Store record in last task run's default store - -Stores a value under a specific key in the default key-value store of the last Actor task run. - -This endpoint is a shortcut for getting the last task run's `defaultKeyValueStoreId` and then using the -[Store record](/api/v2/key-value-store-record-put) endpoint. - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param actorTaskId Task ID or a tilde-separated owner's username and task's name. - @param recordKey Key of the record. - @return ApiActorTaskRunsLastKeyValueStoreRecordPutRequest -*/ -func (a *LastActorTaskRunsDefaultKeyValueStoreAPIService) ActorTaskRunsLastKeyValueStoreRecordPut(ctx context.Context, actorTaskId string, recordKey string) ApiActorTaskRunsLastKeyValueStoreRecordPutRequest { - return ApiActorTaskRunsLastKeyValueStoreRecordPutRequest{ - ApiService: a, - ctx: ctx, - actorTaskId: actorTaskId, - recordKey: recordKey, - } -} - -// Execute executes the request -// @return map[string]interface{} -func (a *LastActorTaskRunsDefaultKeyValueStoreAPIService) ActorTaskRunsLastKeyValueStoreRecordPutExecute(r ApiActorTaskRunsLastKeyValueStoreRecordPutRequest) (map[string]interface{}, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodPut - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue map[string]interface{} - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LastActorTaskRunsDefaultKeyValueStoreAPIService.ActorTaskRunsLastKeyValueStoreRecordPut") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/actor-tasks/{actorTaskId}/runs/last/key-value-store/records/{recordKey}" - localVarPath = strings.Replace(localVarPath, "{"+"actorTaskId"+"}", url.PathEscape(parameterValueToString(r.actorTaskId, "actorTaskId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"recordKey"+"}", url.PathEscape(parameterValueToString(r.recordKey, "recordKey")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - if r.requestBody == nil { - return localVarReturnValue, nil, reportError("requestBody is required and must be specified") - } - - if r.status != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "status", r.status, "form", "") - } - // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/json"} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - if r.contentEncoding != nil { - parameterAddToHeaderOrQuery(localVarHeaderParams, "Content-Encoding", r.contentEncoding, "simple", "") - } - // body params - localVarPostBody = r.requestBody - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 413 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 415 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiActorTaskRunsLastKeyValueStoreRecordsGetRequest struct { - ctx context.Context - ApiService *LastActorTaskRunsDefaultKeyValueStoreAPIService - actorTaskId string - status *string - collection *string - prefix *string - signature *string -} - -// Filter for the run status. -func (r ApiActorTaskRunsLastKeyValueStoreRecordsGetRequest) Status(status string) ApiActorTaskRunsLastKeyValueStoreRecordsGetRequest { - r.status = &status - return r -} - -// If specified, only records belonging to a specific collection from the key-value store schema. The key-value store need to have a schema defined for this parameter to work. -func (r ApiActorTaskRunsLastKeyValueStoreRecordsGetRequest) Collection(collection string) ApiActorTaskRunsLastKeyValueStoreRecordsGetRequest { - r.collection = &collection - return r -} - -// If specified, only records whose key starts with the given prefix are included in the archive. -func (r ApiActorTaskRunsLastKeyValueStoreRecordsGetRequest) Prefix(prefix string) ApiActorTaskRunsLastKeyValueStoreRecordsGetRequest { - r.prefix = &prefix - return r -} - -// Signature used for the access. -func (r ApiActorTaskRunsLastKeyValueStoreRecordsGetRequest) Signature(signature string) ApiActorTaskRunsLastKeyValueStoreRecordsGetRequest { - r.signature = &signature - return r -} - -func (r ApiActorTaskRunsLastKeyValueStoreRecordsGetRequest) Execute() (*os.File, *http.Response, error) { - return r.ApiService.ActorTaskRunsLastKeyValueStoreRecordsGetExecute(r) -} - -/* -ActorTaskRunsLastKeyValueStoreRecordsGet Download last task run's default store's records - -Downloads all records from the default key-value store of the last Actor task run as a ZIP archive. - -This endpoint is a shortcut for getting the last task run's `defaultKeyValueStoreId` and then using the -[Download records](/api/v2/key-value-store-records-get) endpoint. - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param actorTaskId Task ID or a tilde-separated owner's username and task's name. - @return ApiActorTaskRunsLastKeyValueStoreRecordsGetRequest -*/ -func (a *LastActorTaskRunsDefaultKeyValueStoreAPIService) ActorTaskRunsLastKeyValueStoreRecordsGet(ctx context.Context, actorTaskId string) ApiActorTaskRunsLastKeyValueStoreRecordsGetRequest { - return ApiActorTaskRunsLastKeyValueStoreRecordsGetRequest{ - ApiService: a, - ctx: ctx, - actorTaskId: actorTaskId, - } -} - -// Execute executes the request -// @return *os.File -func (a *LastActorTaskRunsDefaultKeyValueStoreAPIService) ActorTaskRunsLastKeyValueStoreRecordsGetExecute(r ApiActorTaskRunsLastKeyValueStoreRecordsGetRequest) (*os.File, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *os.File - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LastActorTaskRunsDefaultKeyValueStoreAPIService.ActorTaskRunsLastKeyValueStoreRecordsGet") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/actor-tasks/{actorTaskId}/runs/last/key-value-store/records" - localVarPath = strings.Replace(localVarPath, "{"+"actorTaskId"+"}", url.PathEscape(parameterValueToString(r.actorTaskId, "actorTaskId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if r.status != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "status", r.status, "form", "") - } - if r.collection != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "collection", r.collection, "form", "") - } - if r.prefix != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "prefix", r.prefix, "form", "") - } - if r.signature != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "signature", r.signature, "form", "") - } - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/zip", "application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} diff --git a/api_last_actor_task_runs_default_request_queue.go b/api_last_actor_task_runs_default_request_queue.go deleted file mode 100644 index 64360e9..0000000 --- a/api_last_actor_task_runs_default_request_queue.go +++ /dev/null @@ -1,3376 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "bytes" - "context" - "io" - "net/http" - "net/url" - "strings" -) - - -// LastActorTaskRunsDefaultRequestQueueAPIService LastActorTaskRunsDefaultRequestQueueAPI service -type LastActorTaskRunsDefaultRequestQueueAPIService service - -type ApiActorTaskRunsLastRequestQueueDeleteRequest struct { - ctx context.Context - ApiService *LastActorTaskRunsDefaultRequestQueueAPIService - actorTaskId string - status *string -} - -// Filter for the run status. -func (r ApiActorTaskRunsLastRequestQueueDeleteRequest) Status(status string) ApiActorTaskRunsLastRequestQueueDeleteRequest { - r.status = &status - return r -} - -func (r ApiActorTaskRunsLastRequestQueueDeleteRequest) Execute() (*http.Response, error) { - return r.ApiService.ActorTaskRunsLastRequestQueueDeleteExecute(r) -} - -/* -ActorTaskRunsLastRequestQueueDelete Delete last task run's default request queue - -Deletes the default request queue associated with the last Actor task run. - -This endpoint is a shortcut for getting the last task run's `defaultRequestQueueId` and then using the -[Delete request queue](/api/v2/request-queue-delete) endpoint. - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param actorTaskId Task ID or a tilde-separated owner's username and task's name. - @return ApiActorTaskRunsLastRequestQueueDeleteRequest -*/ -func (a *LastActorTaskRunsDefaultRequestQueueAPIService) ActorTaskRunsLastRequestQueueDelete(ctx context.Context, actorTaskId string) ApiActorTaskRunsLastRequestQueueDeleteRequest { - return ApiActorTaskRunsLastRequestQueueDeleteRequest{ - ApiService: a, - ctx: ctx, - actorTaskId: actorTaskId, - } -} - -// Execute executes the request -func (a *LastActorTaskRunsDefaultRequestQueueAPIService) ActorTaskRunsLastRequestQueueDeleteExecute(r ApiActorTaskRunsLastRequestQueueDeleteRequest) (*http.Response, error) { - var ( - localVarHTTPMethod = http.MethodDelete - localVarPostBody interface{} - formFiles []formFile - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LastActorTaskRunsDefaultRequestQueueAPIService.ActorTaskRunsLastRequestQueueDelete") - if err != nil { - return nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/actor-tasks/{actorTaskId}/runs/last/request-queue" - localVarPath = strings.Replace(localVarPath, "{"+"actorTaskId"+"}", url.PathEscape(parameterValueToString(r.actorTaskId, "actorTaskId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if r.status != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "status", r.status, "form", "") - } - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarHTTPResponse, newErr - } - - return localVarHTTPResponse, nil -} - -type ApiActorTaskRunsLastRequestQueueGetRequest struct { - ctx context.Context - ApiService *LastActorTaskRunsDefaultRequestQueueAPIService - actorTaskId string - status *string -} - -// Filter for the run status. -func (r ApiActorTaskRunsLastRequestQueueGetRequest) Status(status string) ApiActorTaskRunsLastRequestQueueGetRequest { - r.status = &status - return r -} - -func (r ApiActorTaskRunsLastRequestQueueGetRequest) Execute() (*RequestQueueResponse, *http.Response, error) { - return r.ApiService.ActorTaskRunsLastRequestQueueGetExecute(r) -} - -/* -ActorTaskRunsLastRequestQueueGet Get last task run's default request queue - -Returns the default request queue associated with the last Actor task run. - -This endpoint is a shortcut for getting the last task run's `defaultRequestQueueId` and then using the -[Get request queue](/api/v2/request-queue-get) endpoint. - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param actorTaskId Task ID or a tilde-separated owner's username and task's name. - @return ApiActorTaskRunsLastRequestQueueGetRequest -*/ -func (a *LastActorTaskRunsDefaultRequestQueueAPIService) ActorTaskRunsLastRequestQueueGet(ctx context.Context, actorTaskId string) ApiActorTaskRunsLastRequestQueueGetRequest { - return ApiActorTaskRunsLastRequestQueueGetRequest{ - ApiService: a, - ctx: ctx, - actorTaskId: actorTaskId, - } -} - -// Execute executes the request -// @return RequestQueueResponse -func (a *LastActorTaskRunsDefaultRequestQueueAPIService) ActorTaskRunsLastRequestQueueGetExecute(r ApiActorTaskRunsLastRequestQueueGetRequest) (*RequestQueueResponse, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *RequestQueueResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LastActorTaskRunsDefaultRequestQueueAPIService.ActorTaskRunsLastRequestQueueGet") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/actor-tasks/{actorTaskId}/runs/last/request-queue" - localVarPath = strings.Replace(localVarPath, "{"+"actorTaskId"+"}", url.PathEscape(parameterValueToString(r.actorTaskId, "actorTaskId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if r.status != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "status", r.status, "form", "") - } - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiActorTaskRunsLastRequestQueueHeadGetRequest struct { - ctx context.Context - ApiService *LastActorTaskRunsDefaultRequestQueueAPIService - actorTaskId string - status *string - limit *float64 - clientKey *string -} - -// Filter for the run status. -func (r ApiActorTaskRunsLastRequestQueueHeadGetRequest) Status(status string) ApiActorTaskRunsLastRequestQueueHeadGetRequest { - r.status = &status - return r -} - -// How many items from queue should be returned. -func (r ApiActorTaskRunsLastRequestQueueHeadGetRequest) Limit(limit float64) ApiActorTaskRunsLastRequestQueueHeadGetRequest { - r.limit = &limit - return r -} - -// A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. -func (r ApiActorTaskRunsLastRequestQueueHeadGetRequest) ClientKey(clientKey string) ApiActorTaskRunsLastRequestQueueHeadGetRequest { - r.clientKey = &clientKey - return r -} - -func (r ApiActorTaskRunsLastRequestQueueHeadGetRequest) Execute() (*HeadResponse, *http.Response, error) { - return r.ApiService.ActorTaskRunsLastRequestQueueHeadGetExecute(r) -} - -/* -ActorTaskRunsLastRequestQueueHeadGet Get last task run's default request queue head - -Returns the given number of first requests from the default request queue of the last Actor task run. - -This endpoint is a shortcut for getting the last task run's `defaultRequestQueueId` and then using the -[Get head](/api/v2/request-queue-head-get) endpoint. - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param actorTaskId Task ID or a tilde-separated owner's username and task's name. - @return ApiActorTaskRunsLastRequestQueueHeadGetRequest -*/ -func (a *LastActorTaskRunsDefaultRequestQueueAPIService) ActorTaskRunsLastRequestQueueHeadGet(ctx context.Context, actorTaskId string) ApiActorTaskRunsLastRequestQueueHeadGetRequest { - return ApiActorTaskRunsLastRequestQueueHeadGetRequest{ - ApiService: a, - ctx: ctx, - actorTaskId: actorTaskId, - } -} - -// Execute executes the request -// @return HeadResponse -func (a *LastActorTaskRunsDefaultRequestQueueAPIService) ActorTaskRunsLastRequestQueueHeadGetExecute(r ApiActorTaskRunsLastRequestQueueHeadGetRequest) (*HeadResponse, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *HeadResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LastActorTaskRunsDefaultRequestQueueAPIService.ActorTaskRunsLastRequestQueueHeadGet") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/actor-tasks/{actorTaskId}/runs/last/request-queue/head" - localVarPath = strings.Replace(localVarPath, "{"+"actorTaskId"+"}", url.PathEscape(parameterValueToString(r.actorTaskId, "actorTaskId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if r.status != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "status", r.status, "form", "") - } - if r.limit != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "form", "") - } - if r.clientKey != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "clientKey", r.clientKey, "form", "") - } - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiActorTaskRunsLastRequestQueueHeadLockPostRequest struct { - ctx context.Context - ApiService *LastActorTaskRunsDefaultRequestQueueAPIService - actorTaskId string - lockSecs *float64 - status *string - limit *float64 - clientKey *string -} - -// How long the requests will be locked for (in seconds). -func (r ApiActorTaskRunsLastRequestQueueHeadLockPostRequest) LockSecs(lockSecs float64) ApiActorTaskRunsLastRequestQueueHeadLockPostRequest { - r.lockSecs = &lockSecs - return r -} - -// Filter for the run status. -func (r ApiActorTaskRunsLastRequestQueueHeadLockPostRequest) Status(status string) ApiActorTaskRunsLastRequestQueueHeadLockPostRequest { - r.status = &status - return r -} - -// How many items from the queue should be returned. -func (r ApiActorTaskRunsLastRequestQueueHeadLockPostRequest) Limit(limit float64) ApiActorTaskRunsLastRequestQueueHeadLockPostRequest { - r.limit = &limit - return r -} - -// A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. -func (r ApiActorTaskRunsLastRequestQueueHeadLockPostRequest) ClientKey(clientKey string) ApiActorTaskRunsLastRequestQueueHeadLockPostRequest { - r.clientKey = &clientKey - return r -} - -func (r ApiActorTaskRunsLastRequestQueueHeadLockPostRequest) Execute() (*HeadAndLockResponse, *http.Response, error) { - return r.ApiService.ActorTaskRunsLastRequestQueueHeadLockPostExecute(r) -} - -/* -ActorTaskRunsLastRequestQueueHeadLockPost Get and lock last task run's default request queue head - -Returns the given number of first requests from the default request queue of the last Actor task run -and locks them for the given time. - -This endpoint is a shortcut for getting the last task run's `defaultRequestQueueId` and then using the -[Get head and lock](/api/v2/request-queue-head-lock-post) endpoint. - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param actorTaskId Task ID or a tilde-separated owner's username and task's name. - @return ApiActorTaskRunsLastRequestQueueHeadLockPostRequest -*/ -func (a *LastActorTaskRunsDefaultRequestQueueAPIService) ActorTaskRunsLastRequestQueueHeadLockPost(ctx context.Context, actorTaskId string) ApiActorTaskRunsLastRequestQueueHeadLockPostRequest { - return ApiActorTaskRunsLastRequestQueueHeadLockPostRequest{ - ApiService: a, - ctx: ctx, - actorTaskId: actorTaskId, - } -} - -// Execute executes the request -// @return HeadAndLockResponse -func (a *LastActorTaskRunsDefaultRequestQueueAPIService) ActorTaskRunsLastRequestQueueHeadLockPostExecute(r ApiActorTaskRunsLastRequestQueueHeadLockPostRequest) (*HeadAndLockResponse, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodPost - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *HeadAndLockResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LastActorTaskRunsDefaultRequestQueueAPIService.ActorTaskRunsLastRequestQueueHeadLockPost") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/actor-tasks/{actorTaskId}/runs/last/request-queue/head/lock" - localVarPath = strings.Replace(localVarPath, "{"+"actorTaskId"+"}", url.PathEscape(parameterValueToString(r.actorTaskId, "actorTaskId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - if r.lockSecs == nil { - return localVarReturnValue, nil, reportError("lockSecs is required and must be specified") - } - - if r.status != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "status", r.status, "form", "") - } - parameterAddToHeaderOrQuery(localVarQueryParams, "lockSecs", r.lockSecs, "form", "") - if r.limit != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "form", "") - } - if r.clientKey != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "clientKey", r.clientKey, "form", "") - } - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiActorTaskRunsLastRequestQueuePutRequest struct { - ctx context.Context - ApiService *LastActorTaskRunsDefaultRequestQueueAPIService - actorTaskId string - updateRequestQueueRequest *UpdateRequestQueueRequest - status *string -} - -// -func (r ApiActorTaskRunsLastRequestQueuePutRequest) UpdateRequestQueueRequest(updateRequestQueueRequest UpdateRequestQueueRequest) ApiActorTaskRunsLastRequestQueuePutRequest { - r.updateRequestQueueRequest = &updateRequestQueueRequest - return r -} - -// Filter for the run status. -func (r ApiActorTaskRunsLastRequestQueuePutRequest) Status(status string) ApiActorTaskRunsLastRequestQueuePutRequest { - r.status = &status - return r -} - -func (r ApiActorTaskRunsLastRequestQueuePutRequest) Execute() (*RequestQueueResponse, *http.Response, error) { - return r.ApiService.ActorTaskRunsLastRequestQueuePutExecute(r) -} - -/* -ActorTaskRunsLastRequestQueuePut Update last task run's default request queue - -Updates the default request queue associated with the last Actor task run. - -This endpoint is a shortcut for getting the last task run's `defaultRequestQueueId` and then using the -[Update request queue](/api/v2/request-queue-put) endpoint. - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param actorTaskId Task ID or a tilde-separated owner's username and task's name. - @return ApiActorTaskRunsLastRequestQueuePutRequest -*/ -func (a *LastActorTaskRunsDefaultRequestQueueAPIService) ActorTaskRunsLastRequestQueuePut(ctx context.Context, actorTaskId string) ApiActorTaskRunsLastRequestQueuePutRequest { - return ApiActorTaskRunsLastRequestQueuePutRequest{ - ApiService: a, - ctx: ctx, - actorTaskId: actorTaskId, - } -} - -// Execute executes the request -// @return RequestQueueResponse -func (a *LastActorTaskRunsDefaultRequestQueueAPIService) ActorTaskRunsLastRequestQueuePutExecute(r ApiActorTaskRunsLastRequestQueuePutRequest) (*RequestQueueResponse, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodPut - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *RequestQueueResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LastActorTaskRunsDefaultRequestQueueAPIService.ActorTaskRunsLastRequestQueuePut") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/actor-tasks/{actorTaskId}/runs/last/request-queue" - localVarPath = strings.Replace(localVarPath, "{"+"actorTaskId"+"}", url.PathEscape(parameterValueToString(r.actorTaskId, "actorTaskId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - if r.updateRequestQueueRequest == nil { - return localVarReturnValue, nil, reportError("updateRequestQueueRequest is required and must be specified") - } - - if r.status != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "status", r.status, "form", "") - } - // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/json"} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - // body params - localVarPostBody = r.updateRequestQueueRequest - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 413 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 415 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiActorTaskRunsLastRequestQueueRequestDeleteRequest struct { - ctx context.Context - ApiService *LastActorTaskRunsDefaultRequestQueueAPIService - actorTaskId string - requestId string - status *string - clientKey *string -} - -// Filter for the run status. -func (r ApiActorTaskRunsLastRequestQueueRequestDeleteRequest) Status(status string) ApiActorTaskRunsLastRequestQueueRequestDeleteRequest { - r.status = &status - return r -} - -// A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. -func (r ApiActorTaskRunsLastRequestQueueRequestDeleteRequest) ClientKey(clientKey string) ApiActorTaskRunsLastRequestQueueRequestDeleteRequest { - r.clientKey = &clientKey - return r -} - -func (r ApiActorTaskRunsLastRequestQueueRequestDeleteRequest) Execute() (*http.Response, error) { - return r.ApiService.ActorTaskRunsLastRequestQueueRequestDeleteExecute(r) -} - -/* -ActorTaskRunsLastRequestQueueRequestDelete Delete request from last task run's default request queue - -Deletes a request from the default request queue of the last Actor task run. - -This endpoint is a shortcut for getting the last task run's `defaultRequestQueueId` and then using the -[Delete request](/api/v2/request-queue-request-delete) endpoint. - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param actorTaskId Task ID or a tilde-separated owner's username and task's name. - @param requestId Request ID. - @return ApiActorTaskRunsLastRequestQueueRequestDeleteRequest -*/ -func (a *LastActorTaskRunsDefaultRequestQueueAPIService) ActorTaskRunsLastRequestQueueRequestDelete(ctx context.Context, actorTaskId string, requestId string) ApiActorTaskRunsLastRequestQueueRequestDeleteRequest { - return ApiActorTaskRunsLastRequestQueueRequestDeleteRequest{ - ApiService: a, - ctx: ctx, - actorTaskId: actorTaskId, - requestId: requestId, - } -} - -// Execute executes the request -func (a *LastActorTaskRunsDefaultRequestQueueAPIService) ActorTaskRunsLastRequestQueueRequestDeleteExecute(r ApiActorTaskRunsLastRequestQueueRequestDeleteRequest) (*http.Response, error) { - var ( - localVarHTTPMethod = http.MethodDelete - localVarPostBody interface{} - formFiles []formFile - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LastActorTaskRunsDefaultRequestQueueAPIService.ActorTaskRunsLastRequestQueueRequestDelete") - if err != nil { - return nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/actor-tasks/{actorTaskId}/runs/last/request-queue/requests/{requestId}" - localVarPath = strings.Replace(localVarPath, "{"+"actorTaskId"+"}", url.PathEscape(parameterValueToString(r.actorTaskId, "actorTaskId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"requestId"+"}", url.PathEscape(parameterValueToString(r.requestId, "requestId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if r.status != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "status", r.status, "form", "") - } - if r.clientKey != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "clientKey", r.clientKey, "form", "") - } - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarHTTPResponse, newErr - } - - return localVarHTTPResponse, nil -} - -type ApiActorTaskRunsLastRequestQueueRequestGetRequest struct { - ctx context.Context - ApiService *LastActorTaskRunsDefaultRequestQueueAPIService - actorTaskId string - requestId string - status *string -} - -// Filter for the run status. -func (r ApiActorTaskRunsLastRequestQueueRequestGetRequest) Status(status string) ApiActorTaskRunsLastRequestQueueRequestGetRequest { - r.status = &status - return r -} - -func (r ApiActorTaskRunsLastRequestQueueRequestGetRequest) Execute() (*RequestResponse, *http.Response, error) { - return r.ApiService.ActorTaskRunsLastRequestQueueRequestGetExecute(r) -} - -/* -ActorTaskRunsLastRequestQueueRequestGet Get request from last task run's default request queue - -Returns a request from the default request queue of the last Actor task run. - -This endpoint is a shortcut for getting the last task run's `defaultRequestQueueId` and then using the -[Get request](/api/v2/request-queue-request-get) endpoint. - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param actorTaskId Task ID or a tilde-separated owner's username and task's name. - @param requestId Request ID. - @return ApiActorTaskRunsLastRequestQueueRequestGetRequest -*/ -func (a *LastActorTaskRunsDefaultRequestQueueAPIService) ActorTaskRunsLastRequestQueueRequestGet(ctx context.Context, actorTaskId string, requestId string) ApiActorTaskRunsLastRequestQueueRequestGetRequest { - return ApiActorTaskRunsLastRequestQueueRequestGetRequest{ - ApiService: a, - ctx: ctx, - actorTaskId: actorTaskId, - requestId: requestId, - } -} - -// Execute executes the request -// @return RequestResponse -func (a *LastActorTaskRunsDefaultRequestQueueAPIService) ActorTaskRunsLastRequestQueueRequestGetExecute(r ApiActorTaskRunsLastRequestQueueRequestGetRequest) (*RequestResponse, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *RequestResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LastActorTaskRunsDefaultRequestQueueAPIService.ActorTaskRunsLastRequestQueueRequestGet") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/actor-tasks/{actorTaskId}/runs/last/request-queue/requests/{requestId}" - localVarPath = strings.Replace(localVarPath, "{"+"actorTaskId"+"}", url.PathEscape(parameterValueToString(r.actorTaskId, "actorTaskId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"requestId"+"}", url.PathEscape(parameterValueToString(r.requestId, "requestId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if r.status != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "status", r.status, "form", "") - } - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiActorTaskRunsLastRequestQueueRequestLockDeleteRequest struct { - ctx context.Context - ApiService *LastActorTaskRunsDefaultRequestQueueAPIService - actorTaskId string - requestId string - status *string - clientKey *string - forefront *string -} - -// Filter for the run status. -func (r ApiActorTaskRunsLastRequestQueueRequestLockDeleteRequest) Status(status string) ApiActorTaskRunsLastRequestQueueRequestLockDeleteRequest { - r.status = &status - return r -} - -// A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. -func (r ApiActorTaskRunsLastRequestQueueRequestLockDeleteRequest) ClientKey(clientKey string) ApiActorTaskRunsLastRequestQueueRequestLockDeleteRequest { - r.clientKey = &clientKey - return r -} - -// Determines if request should be added to the head of the queue or to the end after lock was removed. -func (r ApiActorTaskRunsLastRequestQueueRequestLockDeleteRequest) Forefront(forefront string) ApiActorTaskRunsLastRequestQueueRequestLockDeleteRequest { - r.forefront = &forefront - return r -} - -func (r ApiActorTaskRunsLastRequestQueueRequestLockDeleteRequest) Execute() (*http.Response, error) { - return r.ApiService.ActorTaskRunsLastRequestQueueRequestLockDeleteExecute(r) -} - -/* -ActorTaskRunsLastRequestQueueRequestLockDelete Delete lock on request in last task run's default request queue - -Deletes a request lock in the default request queue of the last Actor task run. - -This endpoint is a shortcut for getting the last task run's `defaultRequestQueueId` and then using the -[Delete request lock](/api/v2/request-queue-request-lock-delete) endpoint. - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param actorTaskId Task ID or a tilde-separated owner's username and task's name. - @param requestId Request ID. - @return ApiActorTaskRunsLastRequestQueueRequestLockDeleteRequest -*/ -func (a *LastActorTaskRunsDefaultRequestQueueAPIService) ActorTaskRunsLastRequestQueueRequestLockDelete(ctx context.Context, actorTaskId string, requestId string) ApiActorTaskRunsLastRequestQueueRequestLockDeleteRequest { - return ApiActorTaskRunsLastRequestQueueRequestLockDeleteRequest{ - ApiService: a, - ctx: ctx, - actorTaskId: actorTaskId, - requestId: requestId, - } -} - -// Execute executes the request -func (a *LastActorTaskRunsDefaultRequestQueueAPIService) ActorTaskRunsLastRequestQueueRequestLockDeleteExecute(r ApiActorTaskRunsLastRequestQueueRequestLockDeleteRequest) (*http.Response, error) { - var ( - localVarHTTPMethod = http.MethodDelete - localVarPostBody interface{} - formFiles []formFile - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LastActorTaskRunsDefaultRequestQueueAPIService.ActorTaskRunsLastRequestQueueRequestLockDelete") - if err != nil { - return nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/actor-tasks/{actorTaskId}/runs/last/request-queue/requests/{requestId}/lock" - localVarPath = strings.Replace(localVarPath, "{"+"actorTaskId"+"}", url.PathEscape(parameterValueToString(r.actorTaskId, "actorTaskId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"requestId"+"}", url.PathEscape(parameterValueToString(r.requestId, "requestId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if r.status != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "status", r.status, "form", "") - } - if r.clientKey != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "clientKey", r.clientKey, "form", "") - } - if r.forefront != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "forefront", r.forefront, "form", "") - } - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarHTTPResponse, newErr - } - - return localVarHTTPResponse, nil -} - -type ApiActorTaskRunsLastRequestQueueRequestLockPutRequest struct { - ctx context.Context - ApiService *LastActorTaskRunsDefaultRequestQueueAPIService - actorTaskId string - requestId string - lockSecs *float64 - status *string - clientKey *string - forefront *string -} - -// How long the requests will be locked for (in seconds). -func (r ApiActorTaskRunsLastRequestQueueRequestLockPutRequest) LockSecs(lockSecs float64) ApiActorTaskRunsLastRequestQueueRequestLockPutRequest { - r.lockSecs = &lockSecs - return r -} - -// Filter for the run status. -func (r ApiActorTaskRunsLastRequestQueueRequestLockPutRequest) Status(status string) ApiActorTaskRunsLastRequestQueueRequestLockPutRequest { - r.status = &status - return r -} - -// A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. -func (r ApiActorTaskRunsLastRequestQueueRequestLockPutRequest) ClientKey(clientKey string) ApiActorTaskRunsLastRequestQueueRequestLockPutRequest { - r.clientKey = &clientKey - return r -} - -// Determines if request should be added to the head of the queue or to the end after lock expires. -func (r ApiActorTaskRunsLastRequestQueueRequestLockPutRequest) Forefront(forefront string) ApiActorTaskRunsLastRequestQueueRequestLockPutRequest { - r.forefront = &forefront - return r -} - -func (r ApiActorTaskRunsLastRequestQueueRequestLockPutRequest) Execute() (*ProlongRequestLockResponse, *http.Response, error) { - return r.ApiService.ActorTaskRunsLastRequestQueueRequestLockPutExecute(r) -} - -/* -ActorTaskRunsLastRequestQueueRequestLockPut Prolong lock on request in last task run's default request queue - -Prolongs a request lock in the default request queue of the last Actor task run. - -This endpoint is a shortcut for getting the last task run's `defaultRequestQueueId` and then using the -[Prolong request lock](/api/v2/request-queue-request-lock-put) endpoint. - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param actorTaskId Task ID or a tilde-separated owner's username and task's name. - @param requestId Request ID. - @return ApiActorTaskRunsLastRequestQueueRequestLockPutRequest -*/ -func (a *LastActorTaskRunsDefaultRequestQueueAPIService) ActorTaskRunsLastRequestQueueRequestLockPut(ctx context.Context, actorTaskId string, requestId string) ApiActorTaskRunsLastRequestQueueRequestLockPutRequest { - return ApiActorTaskRunsLastRequestQueueRequestLockPutRequest{ - ApiService: a, - ctx: ctx, - actorTaskId: actorTaskId, - requestId: requestId, - } -} - -// Execute executes the request -// @return ProlongRequestLockResponse -func (a *LastActorTaskRunsDefaultRequestQueueAPIService) ActorTaskRunsLastRequestQueueRequestLockPutExecute(r ApiActorTaskRunsLastRequestQueueRequestLockPutRequest) (*ProlongRequestLockResponse, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodPut - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *ProlongRequestLockResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LastActorTaskRunsDefaultRequestQueueAPIService.ActorTaskRunsLastRequestQueueRequestLockPut") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/actor-tasks/{actorTaskId}/runs/last/request-queue/requests/{requestId}/lock" - localVarPath = strings.Replace(localVarPath, "{"+"actorTaskId"+"}", url.PathEscape(parameterValueToString(r.actorTaskId, "actorTaskId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"requestId"+"}", url.PathEscape(parameterValueToString(r.requestId, "requestId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - if r.lockSecs == nil { - return localVarReturnValue, nil, reportError("lockSecs is required and must be specified") - } - - if r.status != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "status", r.status, "form", "") - } - parameterAddToHeaderOrQuery(localVarQueryParams, "lockSecs", r.lockSecs, "form", "") - if r.clientKey != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "clientKey", r.clientKey, "form", "") - } - if r.forefront != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "forefront", r.forefront, "form", "") - } - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiActorTaskRunsLastRequestQueueRequestPutRequest struct { - ctx context.Context - ApiService *LastActorTaskRunsDefaultRequestQueueAPIService - actorTaskId string - requestId string - request *Request - status *string - forefront *string - clientKey *string -} - -// -func (r ApiActorTaskRunsLastRequestQueueRequestPutRequest) Request(request Request) ApiActorTaskRunsLastRequestQueueRequestPutRequest { - r.request = &request - return r -} - -// Filter for the run status. -func (r ApiActorTaskRunsLastRequestQueueRequestPutRequest) Status(status string) ApiActorTaskRunsLastRequestQueueRequestPutRequest { - r.status = &status - return r -} - -// Determines if request should be added to the head of the queue or to the end. Default value is `false` (end of queue). -func (r ApiActorTaskRunsLastRequestQueueRequestPutRequest) Forefront(forefront string) ApiActorTaskRunsLastRequestQueueRequestPutRequest { - r.forefront = &forefront - return r -} - -// A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. -func (r ApiActorTaskRunsLastRequestQueueRequestPutRequest) ClientKey(clientKey string) ApiActorTaskRunsLastRequestQueueRequestPutRequest { - r.clientKey = &clientKey - return r -} - -func (r ApiActorTaskRunsLastRequestQueueRequestPutRequest) Execute() (*UpdateRequestResponse, *http.Response, error) { - return r.ApiService.ActorTaskRunsLastRequestQueueRequestPutExecute(r) -} - -/* -ActorTaskRunsLastRequestQueueRequestPut Update request in last task run's default request queue - -Updates a request in the default request queue of the last Actor task run. - -This endpoint is a shortcut for getting the last task run's `defaultRequestQueueId` and then using the -[Update request](/api/v2/request-queue-request-put) endpoint. - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param actorTaskId Task ID or a tilde-separated owner's username and task's name. - @param requestId Request ID. - @return ApiActorTaskRunsLastRequestQueueRequestPutRequest -*/ -func (a *LastActorTaskRunsDefaultRequestQueueAPIService) ActorTaskRunsLastRequestQueueRequestPut(ctx context.Context, actorTaskId string, requestId string) ApiActorTaskRunsLastRequestQueueRequestPutRequest { - return ApiActorTaskRunsLastRequestQueueRequestPutRequest{ - ApiService: a, - ctx: ctx, - actorTaskId: actorTaskId, - requestId: requestId, - } -} - -// Execute executes the request -// @return UpdateRequestResponse -func (a *LastActorTaskRunsDefaultRequestQueueAPIService) ActorTaskRunsLastRequestQueueRequestPutExecute(r ApiActorTaskRunsLastRequestQueueRequestPutRequest) (*UpdateRequestResponse, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodPut - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *UpdateRequestResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LastActorTaskRunsDefaultRequestQueueAPIService.ActorTaskRunsLastRequestQueueRequestPut") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/actor-tasks/{actorTaskId}/runs/last/request-queue/requests/{requestId}" - localVarPath = strings.Replace(localVarPath, "{"+"actorTaskId"+"}", url.PathEscape(parameterValueToString(r.actorTaskId, "actorTaskId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"requestId"+"}", url.PathEscape(parameterValueToString(r.requestId, "requestId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - if r.request == nil { - return localVarReturnValue, nil, reportError("request is required and must be specified") - } - - if r.status != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "status", r.status, "form", "") - } - if r.forefront != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "forefront", r.forefront, "form", "") - } - if r.clientKey != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "clientKey", r.clientKey, "form", "") - } - // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/json"} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - // body params - localVarPostBody = r.request - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 413 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 415 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiActorTaskRunsLastRequestQueueRequestsBatchDeleteRequest struct { - ctx context.Context - ApiService *LastActorTaskRunsDefaultRequestQueueAPIService - actorTaskId string - contentType *string - requestDraftDelete *[]RequestDraftDelete - status *string - clientKey *string -} - -// -func (r ApiActorTaskRunsLastRequestQueueRequestsBatchDeleteRequest) ContentType(contentType string) ApiActorTaskRunsLastRequestQueueRequestsBatchDeleteRequest { - r.contentType = &contentType - return r -} - -// -func (r ApiActorTaskRunsLastRequestQueueRequestsBatchDeleteRequest) RequestDraftDelete(requestDraftDelete []RequestDraftDelete) ApiActorTaskRunsLastRequestQueueRequestsBatchDeleteRequest { - r.requestDraftDelete = &requestDraftDelete - return r -} - -// Filter for the run status. -func (r ApiActorTaskRunsLastRequestQueueRequestsBatchDeleteRequest) Status(status string) ApiActorTaskRunsLastRequestQueueRequestsBatchDeleteRequest { - r.status = &status - return r -} - -// A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. -func (r ApiActorTaskRunsLastRequestQueueRequestsBatchDeleteRequest) ClientKey(clientKey string) ApiActorTaskRunsLastRequestQueueRequestsBatchDeleteRequest { - r.clientKey = &clientKey - return r -} - -func (r ApiActorTaskRunsLastRequestQueueRequestsBatchDeleteRequest) Execute() (*BatchDeleteResponse, *http.Response, error) { - return r.ApiService.ActorTaskRunsLastRequestQueueRequestsBatchDeleteExecute(r) -} - -/* -ActorTaskRunsLastRequestQueueRequestsBatchDelete Batch delete requests from last task run's default request queue - -Batch-deletes requests from the default request queue of the last Actor task run. - -This endpoint is a shortcut for getting the last task run's `defaultRequestQueueId` and then using the -[Delete requests](/api/v2/request-queue-requests-batch-delete) endpoint. - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param actorTaskId Task ID or a tilde-separated owner's username and task's name. - @return ApiActorTaskRunsLastRequestQueueRequestsBatchDeleteRequest -*/ -func (a *LastActorTaskRunsDefaultRequestQueueAPIService) ActorTaskRunsLastRequestQueueRequestsBatchDelete(ctx context.Context, actorTaskId string) ApiActorTaskRunsLastRequestQueueRequestsBatchDeleteRequest { - return ApiActorTaskRunsLastRequestQueueRequestsBatchDeleteRequest{ - ApiService: a, - ctx: ctx, - actorTaskId: actorTaskId, - } -} - -// Execute executes the request -// @return BatchDeleteResponse -func (a *LastActorTaskRunsDefaultRequestQueueAPIService) ActorTaskRunsLastRequestQueueRequestsBatchDeleteExecute(r ApiActorTaskRunsLastRequestQueueRequestsBatchDeleteRequest) (*BatchDeleteResponse, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodDelete - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *BatchDeleteResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LastActorTaskRunsDefaultRequestQueueAPIService.ActorTaskRunsLastRequestQueueRequestsBatchDelete") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/actor-tasks/{actorTaskId}/runs/last/request-queue/requests/batch" - localVarPath = strings.Replace(localVarPath, "{"+"actorTaskId"+"}", url.PathEscape(parameterValueToString(r.actorTaskId, "actorTaskId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - if r.contentType == nil { - return localVarReturnValue, nil, reportError("contentType is required and must be specified") - } - if r.requestDraftDelete == nil { - return localVarReturnValue, nil, reportError("requestDraftDelete is required and must be specified") - } - - if r.status != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "status", r.status, "form", "") - } - if r.clientKey != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "clientKey", r.clientKey, "form", "") - } - // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/json"} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - parameterAddToHeaderOrQuery(localVarHeaderParams, "Content-Type", r.contentType, "simple", "") - // body params - localVarPostBody = r.requestDraftDelete - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 413 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 415 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiActorTaskRunsLastRequestQueueRequestsBatchPostRequest struct { - ctx context.Context - ApiService *LastActorTaskRunsDefaultRequestQueueAPIService - actorTaskId string - requestBase *[]RequestBase - status *string - clientKey *string - forefront *string -} - -// -func (r ApiActorTaskRunsLastRequestQueueRequestsBatchPostRequest) RequestBase(requestBase []RequestBase) ApiActorTaskRunsLastRequestQueueRequestsBatchPostRequest { - r.requestBase = &requestBase - return r -} - -// Filter for the run status. -func (r ApiActorTaskRunsLastRequestQueueRequestsBatchPostRequest) Status(status string) ApiActorTaskRunsLastRequestQueueRequestsBatchPostRequest { - r.status = &status - return r -} - -// A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. -func (r ApiActorTaskRunsLastRequestQueueRequestsBatchPostRequest) ClientKey(clientKey string) ApiActorTaskRunsLastRequestQueueRequestsBatchPostRequest { - r.clientKey = &clientKey - return r -} - -// Determines if request should be added to the head of the queue or to the end. Default value is `false` (end of queue). -func (r ApiActorTaskRunsLastRequestQueueRequestsBatchPostRequest) Forefront(forefront string) ApiActorTaskRunsLastRequestQueueRequestsBatchPostRequest { - r.forefront = &forefront - return r -} - -func (r ApiActorTaskRunsLastRequestQueueRequestsBatchPostRequest) Execute() (*BatchAddResponse, *http.Response, error) { - return r.ApiService.ActorTaskRunsLastRequestQueueRequestsBatchPostExecute(r) -} - -/* -ActorTaskRunsLastRequestQueueRequestsBatchPost Batch add requests to last task run's default request queue - -Adds requests to the default request queue of the last Actor task run in batch. - -This endpoint is a shortcut for getting the last task run's `defaultRequestQueueId` and then using the -[Add requests](/api/v2/request-queue-requests-batch-post) endpoint. - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param actorTaskId Task ID or a tilde-separated owner's username and task's name. - @return ApiActorTaskRunsLastRequestQueueRequestsBatchPostRequest -*/ -func (a *LastActorTaskRunsDefaultRequestQueueAPIService) ActorTaskRunsLastRequestQueueRequestsBatchPost(ctx context.Context, actorTaskId string) ApiActorTaskRunsLastRequestQueueRequestsBatchPostRequest { - return ApiActorTaskRunsLastRequestQueueRequestsBatchPostRequest{ - ApiService: a, - ctx: ctx, - actorTaskId: actorTaskId, - } -} - -// Execute executes the request -// @return BatchAddResponse -func (a *LastActorTaskRunsDefaultRequestQueueAPIService) ActorTaskRunsLastRequestQueueRequestsBatchPostExecute(r ApiActorTaskRunsLastRequestQueueRequestsBatchPostRequest) (*BatchAddResponse, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodPost - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *BatchAddResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LastActorTaskRunsDefaultRequestQueueAPIService.ActorTaskRunsLastRequestQueueRequestsBatchPost") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/actor-tasks/{actorTaskId}/runs/last/request-queue/requests/batch" - localVarPath = strings.Replace(localVarPath, "{"+"actorTaskId"+"}", url.PathEscape(parameterValueToString(r.actorTaskId, "actorTaskId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - if r.requestBase == nil { - return localVarReturnValue, nil, reportError("requestBase is required and must be specified") - } - - if r.status != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "status", r.status, "form", "") - } - if r.clientKey != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "clientKey", r.clientKey, "form", "") - } - if r.forefront != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "forefront", r.forefront, "form", "") - } - // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/json"} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - // body params - localVarPostBody = r.requestBase - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 413 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 415 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiActorTaskRunsLastRequestQueueRequestsGetRequest struct { - ctx context.Context - ApiService *LastActorTaskRunsDefaultRequestQueueAPIService - actorTaskId string - status *string - clientKey *string - exclusiveStartId *string - limit *float64 - cursor *string - filter *[]string -} - -// Filter for the run status. -func (r ApiActorTaskRunsLastRequestQueueRequestsGetRequest) Status(status string) ApiActorTaskRunsLastRequestQueueRequestsGetRequest { - r.status = &status - return r -} - -// A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. -func (r ApiActorTaskRunsLastRequestQueueRequestsGetRequest) ClientKey(clientKey string) ApiActorTaskRunsLastRequestQueueRequestsGetRequest { - r.clientKey = &clientKey - return r -} - -// All requests up to this one (including) are skipped from the result. (Deprecated, use `cursor` instead.) -// Deprecated -func (r ApiActorTaskRunsLastRequestQueueRequestsGetRequest) ExclusiveStartId(exclusiveStartId string) ApiActorTaskRunsLastRequestQueueRequestsGetRequest { - r.exclusiveStartId = &exclusiveStartId - return r -} - -// Number of keys to be returned. Maximum value is `10000`. -func (r ApiActorTaskRunsLastRequestQueueRequestsGetRequest) Limit(limit float64) ApiActorTaskRunsLastRequestQueueRequestsGetRequest { - r.limit = &limit - return r -} - -// A cursor string for pagination, returned in the previous response as `nextCursor`. Use this to retrieve the next page of requests. -func (r ApiActorTaskRunsLastRequestQueueRequestsGetRequest) Cursor(cursor string) ApiActorTaskRunsLastRequestQueueRequestsGetRequest { - r.cursor = &cursor - return r -} - -// Filter requests by their state. Possible values are `locked` and `pending`. You can combine multiple values separated by commas, which will mean the union of these filters – requests matching any of the specified states will be returned. (Not compatible with deprecated `exclusiveStartId` parameter.) -func (r ApiActorTaskRunsLastRequestQueueRequestsGetRequest) Filter(filter []string) ApiActorTaskRunsLastRequestQueueRequestsGetRequest { - r.filter = &filter - return r -} - -func (r ApiActorTaskRunsLastRequestQueueRequestsGetRequest) Execute() (*ListOfRequestsResponse, *http.Response, error) { - return r.ApiService.ActorTaskRunsLastRequestQueueRequestsGetExecute(r) -} - -/* -ActorTaskRunsLastRequestQueueRequestsGet List last task run's default request queue's requests - -Returns a list of requests from the default request queue of the last Actor task run. - -This endpoint is a shortcut for getting the last task run's `defaultRequestQueueId` and then using the -[List requests](/api/v2/request-queue-requests-get) endpoint. - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param actorTaskId Task ID or a tilde-separated owner's username and task's name. - @return ApiActorTaskRunsLastRequestQueueRequestsGetRequest -*/ -func (a *LastActorTaskRunsDefaultRequestQueueAPIService) ActorTaskRunsLastRequestQueueRequestsGet(ctx context.Context, actorTaskId string) ApiActorTaskRunsLastRequestQueueRequestsGetRequest { - return ApiActorTaskRunsLastRequestQueueRequestsGetRequest{ - ApiService: a, - ctx: ctx, - actorTaskId: actorTaskId, - } -} - -// Execute executes the request -// @return ListOfRequestsResponse -func (a *LastActorTaskRunsDefaultRequestQueueAPIService) ActorTaskRunsLastRequestQueueRequestsGetExecute(r ApiActorTaskRunsLastRequestQueueRequestsGetRequest) (*ListOfRequestsResponse, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *ListOfRequestsResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LastActorTaskRunsDefaultRequestQueueAPIService.ActorTaskRunsLastRequestQueueRequestsGet") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/actor-tasks/{actorTaskId}/runs/last/request-queue/requests" - localVarPath = strings.Replace(localVarPath, "{"+"actorTaskId"+"}", url.PathEscape(parameterValueToString(r.actorTaskId, "actorTaskId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if r.status != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "status", r.status, "form", "") - } - if r.clientKey != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "clientKey", r.clientKey, "form", "") - } - if r.exclusiveStartId != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "exclusiveStartId", r.exclusiveStartId, "form", "") - } - if r.limit != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "form", "") - } - if r.cursor != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "cursor", r.cursor, "form", "") - } - if r.filter != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "filter", r.filter, "form", "csv") - } - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiActorTaskRunsLastRequestQueueRequestsPostRequest struct { - ctx context.Context - ApiService *LastActorTaskRunsDefaultRequestQueueAPIService - actorTaskId string - requestBase *RequestBase - status *string - clientKey *string - forefront *string -} - -// -func (r ApiActorTaskRunsLastRequestQueueRequestsPostRequest) RequestBase(requestBase RequestBase) ApiActorTaskRunsLastRequestQueueRequestsPostRequest { - r.requestBase = &requestBase - return r -} - -// Filter for the run status. -func (r ApiActorTaskRunsLastRequestQueueRequestsPostRequest) Status(status string) ApiActorTaskRunsLastRequestQueueRequestsPostRequest { - r.status = &status - return r -} - -// A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. -func (r ApiActorTaskRunsLastRequestQueueRequestsPostRequest) ClientKey(clientKey string) ApiActorTaskRunsLastRequestQueueRequestsPostRequest { - r.clientKey = &clientKey - return r -} - -// Determines if request should be added to the head of the queue or to the end. Default value is `false` (end of queue). -func (r ApiActorTaskRunsLastRequestQueueRequestsPostRequest) Forefront(forefront string) ApiActorTaskRunsLastRequestQueueRequestsPostRequest { - r.forefront = &forefront - return r -} - -func (r ApiActorTaskRunsLastRequestQueueRequestsPostRequest) Execute() (*AddRequestResponse, *http.Response, error) { - return r.ApiService.ActorTaskRunsLastRequestQueueRequestsPostExecute(r) -} - -/* -ActorTaskRunsLastRequestQueueRequestsPost Add request to last task run's default request queue - -Adds a request to the default request queue of the last Actor task run. - -This endpoint is a shortcut for getting the last task run's `defaultRequestQueueId` and then using the -[Add request](/api/v2/request-queue-requests-post) endpoint. - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param actorTaskId Task ID or a tilde-separated owner's username and task's name. - @return ApiActorTaskRunsLastRequestQueueRequestsPostRequest -*/ -func (a *LastActorTaskRunsDefaultRequestQueueAPIService) ActorTaskRunsLastRequestQueueRequestsPost(ctx context.Context, actorTaskId string) ApiActorTaskRunsLastRequestQueueRequestsPostRequest { - return ApiActorTaskRunsLastRequestQueueRequestsPostRequest{ - ApiService: a, - ctx: ctx, - actorTaskId: actorTaskId, - } -} - -// Execute executes the request -// @return AddRequestResponse -func (a *LastActorTaskRunsDefaultRequestQueueAPIService) ActorTaskRunsLastRequestQueueRequestsPostExecute(r ApiActorTaskRunsLastRequestQueueRequestsPostRequest) (*AddRequestResponse, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodPost - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *AddRequestResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LastActorTaskRunsDefaultRequestQueueAPIService.ActorTaskRunsLastRequestQueueRequestsPost") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/actor-tasks/{actorTaskId}/runs/last/request-queue/requests" - localVarPath = strings.Replace(localVarPath, "{"+"actorTaskId"+"}", url.PathEscape(parameterValueToString(r.actorTaskId, "actorTaskId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - if r.requestBase == nil { - return localVarReturnValue, nil, reportError("requestBase is required and must be specified") - } - - if r.status != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "status", r.status, "form", "") - } - if r.clientKey != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "clientKey", r.clientKey, "form", "") - } - if r.forefront != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "forefront", r.forefront, "form", "") - } - // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/json"} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - // body params - localVarPostBody = r.requestBase - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 413 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 415 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiActorTaskRunsLastRequestQueueRequestsUnlockPostRequest struct { - ctx context.Context - ApiService *LastActorTaskRunsDefaultRequestQueueAPIService - actorTaskId string - status *string - clientKey *string -} - -// Filter for the run status. -func (r ApiActorTaskRunsLastRequestQueueRequestsUnlockPostRequest) Status(status string) ApiActorTaskRunsLastRequestQueueRequestsUnlockPostRequest { - r.status = &status - return r -} - -// A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. -func (r ApiActorTaskRunsLastRequestQueueRequestsUnlockPostRequest) ClientKey(clientKey string) ApiActorTaskRunsLastRequestQueueRequestsUnlockPostRequest { - r.clientKey = &clientKey - return r -} - -func (r ApiActorTaskRunsLastRequestQueueRequestsUnlockPostRequest) Execute() (*UnlockRequestsResponse, *http.Response, error) { - return r.ApiService.ActorTaskRunsLastRequestQueueRequestsUnlockPostExecute(r) -} - -/* -ActorTaskRunsLastRequestQueueRequestsUnlockPost Unlock requests in last task run's default request queue - -Unlocks requests in the default request queue of the last Actor task run that are currently locked by the client. - -This endpoint is a shortcut for getting the last task run's `defaultRequestQueueId` and then using the -[Unlock requests](/api/v2/request-queue-requests-unlock-post) endpoint. - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param actorTaskId Task ID or a tilde-separated owner's username and task's name. - @return ApiActorTaskRunsLastRequestQueueRequestsUnlockPostRequest -*/ -func (a *LastActorTaskRunsDefaultRequestQueueAPIService) ActorTaskRunsLastRequestQueueRequestsUnlockPost(ctx context.Context, actorTaskId string) ApiActorTaskRunsLastRequestQueueRequestsUnlockPostRequest { - return ApiActorTaskRunsLastRequestQueueRequestsUnlockPostRequest{ - ApiService: a, - ctx: ctx, - actorTaskId: actorTaskId, - } -} - -// Execute executes the request -// @return UnlockRequestsResponse -func (a *LastActorTaskRunsDefaultRequestQueueAPIService) ActorTaskRunsLastRequestQueueRequestsUnlockPostExecute(r ApiActorTaskRunsLastRequestQueueRequestsUnlockPostRequest) (*UnlockRequestsResponse, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodPost - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *UnlockRequestsResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LastActorTaskRunsDefaultRequestQueueAPIService.ActorTaskRunsLastRequestQueueRequestsUnlockPost") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/actor-tasks/{actorTaskId}/runs/last/request-queue/requests/unlock" - localVarPath = strings.Replace(localVarPath, "{"+"actorTaskId"+"}", url.PathEscape(parameterValueToString(r.actorTaskId, "actorTaskId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if r.status != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "status", r.status, "form", "") - } - if r.clientKey != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "clientKey", r.clientKey, "form", "") - } - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} diff --git a/api_last_actor_task_runs_log.go b/api_last_actor_task_runs_log.go deleted file mode 100644 index bf755d9..0000000 --- a/api_last_actor_task_runs_log.go +++ /dev/null @@ -1,239 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "bytes" - "context" - "io" - "net/http" - "net/url" - "strings" -) - - -// LastActorTaskRunsLogAPIService LastActorTaskRunsLogAPI service -type LastActorTaskRunsLogAPIService service - -type ApiActorTaskLastLogGetRequest struct { - ctx context.Context - ApiService *LastActorTaskRunsLogAPIService - actorTaskId string - stream *bool - download *bool - raw *bool -} - -// If `true` or `1` then the logs will be streamed as long as the run or build is running. -func (r ApiActorTaskLastLogGetRequest) Stream(stream bool) ApiActorTaskLastLogGetRequest { - r.stream = &stream - return r -} - -// If `true` or `1` then the web browser will download the log file rather than open it in a tab. -func (r ApiActorTaskLastLogGetRequest) Download(download bool) ApiActorTaskLastLogGetRequest { - r.download = &download - return r -} - -// If `true` or `1`, the logs will be kept verbatim. By default, the API removes ANSI escape codes from the logs, keeping only printable characters. -func (r ApiActorTaskLastLogGetRequest) Raw(raw bool) ApiActorTaskLastLogGetRequest { - r.raw = &raw - return r -} - -func (r ApiActorTaskLastLogGetRequest) Execute() (string, *http.Response, error) { - return r.ApiService.ActorTaskLastLogGetExecute(r) -} - -/* -ActorTaskLastLogGet Get last Actor task run's log - -Retrieves last Actor task run's logs. - -This endpoint is a shortcut for getting last Actor task run's log. Same as [Get log](/api/v2/log-get) endpoint. - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param actorTaskId Task ID or a tilde-separated owner's username and task's name. - @return ApiActorTaskLastLogGetRequest -*/ -func (a *LastActorTaskRunsLogAPIService) ActorTaskLastLogGet(ctx context.Context, actorTaskId string) ApiActorTaskLastLogGetRequest { - return ApiActorTaskLastLogGetRequest{ - ApiService: a, - ctx: ctx, - actorTaskId: actorTaskId, - } -} - -// Execute executes the request -// @return string -func (a *LastActorTaskRunsLogAPIService) ActorTaskLastLogGetExecute(r ApiActorTaskLastLogGetRequest) (string, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue string - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LastActorTaskRunsLogAPIService.ActorTaskLastLogGet") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/actor-tasks/{actorTaskId}/runs/last/log" - localVarPath = strings.Replace(localVarPath, "{"+"actorTaskId"+"}", url.PathEscape(parameterValueToString(r.actorTaskId, "actorTaskId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if r.stream != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "stream", r.stream, "form", "") - } - if r.download != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "download", r.download, "form", "") - } - if r.raw != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "raw", r.raw, "form", "") - } - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"text/plain", "application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} diff --git a/api_last_actor_task_runs_metamorph.go b/api_last_actor_task_runs_metamorph.go deleted file mode 100644 index ae1aec9..0000000 --- a/api_last_actor_task_runs_metamorph.go +++ /dev/null @@ -1,242 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "bytes" - "context" - "io" - "net/http" - "net/url" - "strings" -) - - -// LastActorTaskRunsMetamorphAPIService LastActorTaskRunsMetamorphAPI service -type LastActorTaskRunsMetamorphAPIService service - -type ApiActorTaskRunsLastMetamorphPostRequest struct { - ctx context.Context - ApiService *LastActorTaskRunsMetamorphAPIService - actorTaskId string - targetActorId *string - status *string - build *string -} - -// ID of a target Actor that the run should be transformed into. -func (r ApiActorTaskRunsLastMetamorphPostRequest) TargetActorId(targetActorId string) ApiActorTaskRunsLastMetamorphPostRequest { - r.targetActorId = &targetActorId - return r -} - -// Filter for the run status. -func (r ApiActorTaskRunsLastMetamorphPostRequest) Status(status string) ApiActorTaskRunsLastMetamorphPostRequest { - r.status = &status - return r -} - -// Optional build of the target Actor. It can be either a build tag or build number. By default, the run uses the build specified in the default run configuration for the target Actor (typically `latest`). -func (r ApiActorTaskRunsLastMetamorphPostRequest) Build(build string) ApiActorTaskRunsLastMetamorphPostRequest { - r.build = &build - return r -} - -func (r ApiActorTaskRunsLastMetamorphPostRequest) Execute() (*RunResponse, *http.Response, error) { - return r.ApiService.ActorTaskRunsLastMetamorphPostExecute(r) -} - -/* -ActorTaskRunsLastMetamorphPost Metamorph Actor task's last run - -Transforms the last run of the specified Actor task into a run of another Actor with -a new input. - -This endpoint is a shortcut for [Metamorph run](#/reference/actor-runs/metamorph-run/metamorph-run) -on the Actor task's last run. - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param actorTaskId Task ID or a tilde-separated owner's username and task's name. - @return ApiActorTaskRunsLastMetamorphPostRequest -*/ -func (a *LastActorTaskRunsMetamorphAPIService) ActorTaskRunsLastMetamorphPost(ctx context.Context, actorTaskId string) ApiActorTaskRunsLastMetamorphPostRequest { - return ApiActorTaskRunsLastMetamorphPostRequest{ - ApiService: a, - ctx: ctx, - actorTaskId: actorTaskId, - } -} - -// Execute executes the request -// @return RunResponse -func (a *LastActorTaskRunsMetamorphAPIService) ActorTaskRunsLastMetamorphPostExecute(r ApiActorTaskRunsLastMetamorphPostRequest) (*RunResponse, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodPost - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *RunResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LastActorTaskRunsMetamorphAPIService.ActorTaskRunsLastMetamorphPost") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/actor-tasks/{actorTaskId}/runs/last/metamorph" - localVarPath = strings.Replace(localVarPath, "{"+"actorTaskId"+"}", url.PathEscape(parameterValueToString(r.actorTaskId, "actorTaskId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - if r.targetActorId == nil { - return localVarReturnValue, nil, reportError("targetActorId is required and must be specified") - } - - if r.status != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "status", r.status, "form", "") - } - parameterAddToHeaderOrQuery(localVarQueryParams, "targetActorId", r.targetActorId, "form", "") - if r.build != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "build", r.build, "form", "") - } - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} diff --git a/api_last_actor_task_runs_reboot.go b/api_last_actor_task_runs_reboot.go deleted file mode 100644 index ac2f6b9..0000000 --- a/api_last_actor_task_runs_reboot.go +++ /dev/null @@ -1,223 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "bytes" - "context" - "io" - "net/http" - "net/url" - "strings" -) - - -// LastActorTaskRunsRebootAPIService LastActorTaskRunsRebootAPI service -type LastActorTaskRunsRebootAPIService service - -type ApiActorTaskRunsLastRebootPostRequest struct { - ctx context.Context - ApiService *LastActorTaskRunsRebootAPIService - actorTaskId string - status *string -} - -// Filter for the run status. -func (r ApiActorTaskRunsLastRebootPostRequest) Status(status string) ApiActorTaskRunsLastRebootPostRequest { - r.status = &status - return r -} - -func (r ApiActorTaskRunsLastRebootPostRequest) Execute() (*RunResponse, *http.Response, error) { - return r.ApiService.ActorTaskRunsLastRebootPostExecute(r) -} - -/* -ActorTaskRunsLastRebootPost Reboot Actor task's last run - -Reboots the last run of the specified Actor task and returns an object that -contains all the details about the rebooted run. - -This endpoint is a shortcut for [Reboot run](#/reference/actor-runs/reboot-run/reboot-run) -on the Actor task's last run. Only runs with status `RUNNING` can be rebooted. The run's -container will be restarted, so any data not persisted in the key-value store, dataset, -or request queue will be lost. - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param actorTaskId Task ID or a tilde-separated owner's username and task's name. - @return ApiActorTaskRunsLastRebootPostRequest -*/ -func (a *LastActorTaskRunsRebootAPIService) ActorTaskRunsLastRebootPost(ctx context.Context, actorTaskId string) ApiActorTaskRunsLastRebootPostRequest { - return ApiActorTaskRunsLastRebootPostRequest{ - ApiService: a, - ctx: ctx, - actorTaskId: actorTaskId, - } -} - -// Execute executes the request -// @return RunResponse -func (a *LastActorTaskRunsRebootAPIService) ActorTaskRunsLastRebootPostExecute(r ApiActorTaskRunsLastRebootPostRequest) (*RunResponse, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodPost - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *RunResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LastActorTaskRunsRebootAPIService.ActorTaskRunsLastRebootPost") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/actor-tasks/{actorTaskId}/runs/last/reboot" - localVarPath = strings.Replace(localVarPath, "{"+"actorTaskId"+"}", url.PathEscape(parameterValueToString(r.actorTaskId, "actorTaskId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if r.status != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "status", r.status, "form", "") - } - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} diff --git a/api_logs.go b/api_logs.go deleted file mode 100644 index 178d314..0000000 --- a/api_logs.go +++ /dev/null @@ -1,237 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "bytes" - "context" - "io" - "net/http" - "net/url" - "strings" -) - - -// LogsAPIService LogsAPI service -type LogsAPIService service - -type ApiLogGetRequest struct { - ctx context.Context - ApiService *LogsAPIService - buildOrRunId string - stream *bool - download *bool - raw *bool -} - -// If `true` or `1` then the logs will be streamed as long as the run or build is running. -func (r ApiLogGetRequest) Stream(stream bool) ApiLogGetRequest { - r.stream = &stream - return r -} - -// If `true` or `1` then the web browser will download the log file rather than open it in a tab. -func (r ApiLogGetRequest) Download(download bool) ApiLogGetRequest { - r.download = &download - return r -} - -// If `true` or `1`, the logs will be kept verbatim. By default, the API removes ANSI escape codes from the logs, keeping only printable characters. -func (r ApiLogGetRequest) Raw(raw bool) ApiLogGetRequest { - r.raw = &raw - return r -} - -func (r ApiLogGetRequest) Execute() (string, *http.Response, error) { - return r.ApiService.LogGetExecute(r) -} - -/* -LogGet Get log - -Retrieves logs for a specific Actor build or run. - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param buildOrRunId ID of the Actor build or run. - @return ApiLogGetRequest -*/ -func (a *LogsAPIService) LogGet(ctx context.Context, buildOrRunId string) ApiLogGetRequest { - return ApiLogGetRequest{ - ApiService: a, - ctx: ctx, - buildOrRunId: buildOrRunId, - } -} - -// Execute executes the request -// @return string -func (a *LogsAPIService) LogGetExecute(r ApiLogGetRequest) (string, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue string - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LogsAPIService.LogGet") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/logs/{buildOrRunId}" - localVarPath = strings.Replace(localVarPath, "{"+"buildOrRunId"+"}", url.PathEscape(parameterValueToString(r.buildOrRunId, "buildOrRunId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if r.stream != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "stream", r.stream, "form", "") - } - if r.download != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "download", r.download, "form", "") - } - if r.raw != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "raw", r.raw, "form", "") - } - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"text/plain", "application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} diff --git a/api_schedules.go b/api_schedules.go deleted file mode 100644 index 9d1e327..0000000 --- a/api_schedules.go +++ /dev/null @@ -1,1236 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "bytes" - "context" - "io" - "net/http" - "net/url" - "strings" -) - - -// SchedulesAPIService SchedulesAPI service -type SchedulesAPIService service - -type ApiScheduleDeleteRequest struct { - ctx context.Context - ApiService *SchedulesAPIService - scheduleId string -} - -func (r ApiScheduleDeleteRequest) Execute() (map[string]interface{}, *http.Response, error) { - return r.ApiService.ScheduleDeleteExecute(r) -} - -/* -ScheduleDelete Delete schedule - -Deletes a schedule. - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param scheduleId Schedule ID. - @return ApiScheduleDeleteRequest -*/ -func (a *SchedulesAPIService) ScheduleDelete(ctx context.Context, scheduleId string) ApiScheduleDeleteRequest { - return ApiScheduleDeleteRequest{ - ApiService: a, - ctx: ctx, - scheduleId: scheduleId, - } -} - -// Execute executes the request -// @return map[string]interface{} -func (a *SchedulesAPIService) ScheduleDeleteExecute(r ApiScheduleDeleteRequest) (map[string]interface{}, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodDelete - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue map[string]interface{} - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SchedulesAPIService.ScheduleDelete") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/schedules/{scheduleId}" - localVarPath = strings.Replace(localVarPath, "{"+"scheduleId"+"}", url.PathEscape(parameterValueToString(r.scheduleId, "scheduleId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiScheduleGetRequest struct { - ctx context.Context - ApiService *SchedulesAPIService - scheduleId string -} - -func (r ApiScheduleGetRequest) Execute() (*ScheduleResponse, *http.Response, error) { - return r.ApiService.ScheduleGetExecute(r) -} - -/* -ScheduleGet Get schedule - -Gets the schedule object with all details. - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param scheduleId Schedule ID. - @return ApiScheduleGetRequest -*/ -func (a *SchedulesAPIService) ScheduleGet(ctx context.Context, scheduleId string) ApiScheduleGetRequest { - return ApiScheduleGetRequest{ - ApiService: a, - ctx: ctx, - scheduleId: scheduleId, - } -} - -// Execute executes the request -// @return ScheduleResponse -func (a *SchedulesAPIService) ScheduleGetExecute(r ApiScheduleGetRequest) (*ScheduleResponse, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *ScheduleResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SchedulesAPIService.ScheduleGet") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/schedules/{scheduleId}" - localVarPath = strings.Replace(localVarPath, "{"+"scheduleId"+"}", url.PathEscape(parameterValueToString(r.scheduleId, "scheduleId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiScheduleLogGetRequest struct { - ctx context.Context - ApiService *SchedulesAPIService - scheduleId string -} - -func (r ApiScheduleLogGetRequest) Execute() (*ScheduleLogResponse, *http.Response, error) { - return r.ApiService.ScheduleLogGetExecute(r) -} - -/* -ScheduleLogGet Get schedule log - -Gets the schedule log as a JSON array containing information about up to a -1000 invocations of the schedule. - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param scheduleId Schedule ID. - @return ApiScheduleLogGetRequest -*/ -func (a *SchedulesAPIService) ScheduleLogGet(ctx context.Context, scheduleId string) ApiScheduleLogGetRequest { - return ApiScheduleLogGetRequest{ - ApiService: a, - ctx: ctx, - scheduleId: scheduleId, - } -} - -// Execute executes the request -// @return ScheduleLogResponse -func (a *SchedulesAPIService) ScheduleLogGetExecute(r ApiScheduleLogGetRequest) (*ScheduleLogResponse, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *ScheduleLogResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SchedulesAPIService.ScheduleLogGet") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/schedules/{scheduleId}/log" - localVarPath = strings.Replace(localVarPath, "{"+"scheduleId"+"}", url.PathEscape(parameterValueToString(r.scheduleId, "scheduleId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiSchedulePutRequest struct { - ctx context.Context - ApiService *SchedulesAPIService - scheduleId string - scheduleCreate *ScheduleCreate -} - -// -func (r ApiSchedulePutRequest) ScheduleCreate(scheduleCreate ScheduleCreate) ApiSchedulePutRequest { - r.scheduleCreate = &scheduleCreate - return r -} - -func (r ApiSchedulePutRequest) Execute() (*ScheduleResponse, *http.Response, error) { - return r.ApiService.SchedulePutExecute(r) -} - -/* -SchedulePut Update schedule - -Updates a schedule using values specified by a schedule object passed as -JSON in the POST payload. If the object does not define a specific property, -its value will not be updated. - -The response is the full schedule object as returned by the -[Get schedule](#/reference/schedules/schedule-object/get-schedule) endpoint. - -**The request needs to specify the `Content-Type: application/json` HTTP -header!** - -When providing your API authentication token, we recommend using the -request's `Authorization` header, rather than the URL. ([More -info](#/introduction/authentication)). - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param scheduleId Schedule ID. - @return ApiSchedulePutRequest -*/ -func (a *SchedulesAPIService) SchedulePut(ctx context.Context, scheduleId string) ApiSchedulePutRequest { - return ApiSchedulePutRequest{ - ApiService: a, - ctx: ctx, - scheduleId: scheduleId, - } -} - -// Execute executes the request -// @return ScheduleResponse -func (a *SchedulesAPIService) SchedulePutExecute(r ApiSchedulePutRequest) (*ScheduleResponse, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodPut - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *ScheduleResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SchedulesAPIService.SchedulePut") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/schedules/{scheduleId}" - localVarPath = strings.Replace(localVarPath, "{"+"scheduleId"+"}", url.PathEscape(parameterValueToString(r.scheduleId, "scheduleId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - if r.scheduleCreate == nil { - return localVarReturnValue, nil, reportError("scheduleCreate is required and must be specified") - } - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/json"} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - // body params - localVarPostBody = r.scheduleCreate - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 413 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 415 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiSchedulesGetRequest struct { - ctx context.Context - ApiService *SchedulesAPIService - offset *float64 - limit *float64 - desc *bool -} - -// Number of items that should be skipped at the start. The default value is `0`. -func (r ApiSchedulesGetRequest) Offset(offset float64) ApiSchedulesGetRequest { - r.offset = &offset - return r -} - -// Maximum number of items to return. The default value as well as the maximum is `1000`. -func (r ApiSchedulesGetRequest) Limit(limit float64) ApiSchedulesGetRequest { - r.limit = &limit - return r -} - -// If `true` or `1` then the objects are sorted by the `createdAt` field in descending order. By default, they are sorted in ascending order. -func (r ApiSchedulesGetRequest) Desc(desc bool) ApiSchedulesGetRequest { - r.desc = &desc - return r -} - -func (r ApiSchedulesGetRequest) Execute() (*ListOfSchedulesResponse, *http.Response, error) { - return r.ApiService.SchedulesGetExecute(r) -} - -/* -SchedulesGet Get list of schedules - -Gets the list of schedules that the user created. - -The endpoint supports pagination using the `limit` and `offset` parameters. -It will not return more than 1000 records. - -By default, the records are sorted by the `createdAt` field in ascending -order. To sort the records in descending order, use the `desc=1` parameter. - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return ApiSchedulesGetRequest -*/ -func (a *SchedulesAPIService) SchedulesGet(ctx context.Context) ApiSchedulesGetRequest { - return ApiSchedulesGetRequest{ - ApiService: a, - ctx: ctx, - } -} - -// Execute executes the request -// @return ListOfSchedulesResponse -func (a *SchedulesAPIService) SchedulesGetExecute(r ApiSchedulesGetRequest) (*ListOfSchedulesResponse, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *ListOfSchedulesResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SchedulesAPIService.SchedulesGet") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/schedules" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if r.offset != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "form", "") - } - if r.limit != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "form", "") - } - if r.desc != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "desc", r.desc, "form", "") - } - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiSchedulesPostRequest struct { - ctx context.Context - ApiService *SchedulesAPIService - scheduleCreate *ScheduleCreate -} - -// -func (r ApiSchedulesPostRequest) ScheduleCreate(scheduleCreate ScheduleCreate) ApiSchedulesPostRequest { - r.scheduleCreate = &scheduleCreate - return r -} - -func (r ApiSchedulesPostRequest) Execute() (*ScheduleResponse, *http.Response, error) { - return r.ApiService.SchedulesPostExecute(r) -} - -/* -SchedulesPost Create schedule - -Creates a new schedule with settings provided by the schedule object passed -as JSON in the payload. The response is the created schedule object. - -The request needs to specify the `Content-Type: application/json` HTTP header! - -When providing your API authentication token, we recommend using the -request's `Authorization` header, rather than the URL. ([More -info](#/introduction/authentication)). - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return ApiSchedulesPostRequest -*/ -func (a *SchedulesAPIService) SchedulesPost(ctx context.Context) ApiSchedulesPostRequest { - return ApiSchedulesPostRequest{ - ApiService: a, - ctx: ctx, - } -} - -// Execute executes the request -// @return ScheduleResponse -func (a *SchedulesAPIService) SchedulesPostExecute(r ApiSchedulesPostRequest) (*ScheduleResponse, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodPost - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *ScheduleResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SchedulesAPIService.SchedulesPost") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/schedules" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - if r.scheduleCreate == nil { - return localVarReturnValue, nil, reportError("scheduleCreate is required and must be specified") - } - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/json"} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - // body params - localVarPostBody = r.scheduleCreate - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 409 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 413 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 415 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} diff --git a/api_storage_datasets.go b/api_storage_datasets.go deleted file mode 100644 index 82cb485..0000000 --- a/api_storage_datasets.go +++ /dev/null @@ -1,2385 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "bytes" - "context" - "io" - "net/http" - "net/url" - "strings" -) - - -// StorageDatasetsAPIService StorageDatasetsAPI service -type StorageDatasetsAPIService service - -type ApiDatasetDeleteRequest struct { - ctx context.Context - ApiService *StorageDatasetsAPIService - datasetId string -} - -func (r ApiDatasetDeleteRequest) Execute() (*http.Response, error) { - return r.ApiService.DatasetDeleteExecute(r) -} - -/* -DatasetDelete Delete dataset - -Deletes a specific dataset. - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param datasetId Dataset ID or `username~dataset-name`. - @return ApiDatasetDeleteRequest -*/ -func (a *StorageDatasetsAPIService) DatasetDelete(ctx context.Context, datasetId string) ApiDatasetDeleteRequest { - return ApiDatasetDeleteRequest{ - ApiService: a, - ctx: ctx, - datasetId: datasetId, - } -} - -// Execute executes the request -func (a *StorageDatasetsAPIService) DatasetDeleteExecute(r ApiDatasetDeleteRequest) (*http.Response, error) { - var ( - localVarHTTPMethod = http.MethodDelete - localVarPostBody interface{} - formFiles []formFile - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StorageDatasetsAPIService.DatasetDelete") - if err != nil { - return nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/datasets/{datasetId}" - localVarPath = strings.Replace(localVarPath, "{"+"datasetId"+"}", url.PathEscape(parameterValueToString(r.datasetId, "datasetId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarHTTPResponse, newErr - } - - return localVarHTTPResponse, nil -} - -type ApiDatasetGetRequest struct { - ctx context.Context - ApiService *StorageDatasetsAPIService - datasetId string -} - -func (r ApiDatasetGetRequest) Execute() (*DatasetResponse, *http.Response, error) { - return r.ApiService.DatasetGetExecute(r) -} - -/* -DatasetGet Get dataset - -Returns dataset object for given dataset ID. - -This does not return dataset items, only information about the storage itself. -To retrieve dataset items, use the [List dataset items](/api/v2/dataset-items-get) endpoint. - -:::note - -Keep in mind that attributes `itemCount` and `cleanItemCount` are not propagated right away after data are pushed into a dataset. - -::: - -There is a short period (up to 5 seconds) during which these counters may not match with exact counts in dataset items. - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param datasetId Dataset ID or `username~dataset-name`. - @return ApiDatasetGetRequest -*/ -func (a *StorageDatasetsAPIService) DatasetGet(ctx context.Context, datasetId string) ApiDatasetGetRequest { - return ApiDatasetGetRequest{ - ApiService: a, - ctx: ctx, - datasetId: datasetId, - } -} - -// Execute executes the request -// @return DatasetResponse -func (a *StorageDatasetsAPIService) DatasetGetExecute(r ApiDatasetGetRequest) (*DatasetResponse, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *DatasetResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StorageDatasetsAPIService.DatasetGet") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/datasets/{datasetId}" - localVarPath = strings.Replace(localVarPath, "{"+"datasetId"+"}", url.PathEscape(parameterValueToString(r.datasetId, "datasetId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiDatasetItemsGetRequest struct { - ctx context.Context - ApiService *StorageDatasetsAPIService - datasetId string - format *string - clean *bool - offset *float64 - limit *float64 - fields *string - outputFields *string - omit *string - unwind *string - flatten *string - desc *bool - attachment *bool - delimiter *string - bom *bool - xmlRoot *string - xmlRow *string - skipHeaderRow *bool - skipHidden *bool - skipEmpty *bool - simplified *bool - view *string - skipFailedPages *bool - feedTitle *string - feedDescription *string - signature *string -} - -// Format of the results, possible values are: `json`, `jsonl`, `csv`, `html`, `xlsx`, `xml` and `rss`. The default value is `json`. -func (r ApiDatasetItemsGetRequest) Format(format string) ApiDatasetItemsGetRequest { - r.format = &format - return r -} - -// If `true` or `1` then the API endpoint returns only non-empty items and skips hidden fields (i.e. fields starting with the # character). The `clean` parameter is just a shortcut for `skipHidden=true` and `skipEmpty=true` parameters. Note that since some objects might be skipped from the output, that the result might contain less items than the `limit` value. -func (r ApiDatasetItemsGetRequest) Clean(clean bool) ApiDatasetItemsGetRequest { - r.clean = &clean - return r -} - -// Number of items that should be skipped at the start. The default value is `0`. -func (r ApiDatasetItemsGetRequest) Offset(offset float64) ApiDatasetItemsGetRequest { - r.offset = &offset - return r -} - -// Maximum number of items to return. By default there is no limit. -func (r ApiDatasetItemsGetRequest) Limit(limit float64) ApiDatasetItemsGetRequest { - r.limit = &limit - return r -} - -// A comma-separated list of fields which should be picked from the items, only these fields will remain in the resulting record objects. Note that the fields in the outputted items are sorted the same way as they are specified in the `fields` query parameter. You can use this feature to effectively fix the output format. -func (r ApiDatasetItemsGetRequest) Fields(fields string) ApiDatasetItemsGetRequest { - r.fields = &fields - return r -} - -// A comma-separated list of output field names that positionally rename the fields specified in the `fields` parameter. For example, `?fields=headline,url&outputFields=title,link` renames `headline` to `title` and `url` to `link` in the output. The number of names in `outputFields` must match the number of names in `fields`. Requires the `fields` parameter to be specified as well. -func (r ApiDatasetItemsGetRequest) OutputFields(outputFields string) ApiDatasetItemsGetRequest { - r.outputFields = &outputFields - return r -} - -// A comma-separated list of fields which should be omitted from the items. -func (r ApiDatasetItemsGetRequest) Omit(omit string) ApiDatasetItemsGetRequest { - r.omit = &omit - return r -} - -// A comma-separated list of fields which should be unwound, in order which they should be processed. Each field should be either an array or an object. If the field is an array then every element of the array will become a separate record and merged with parent object. If the unwound field is an object then it is merged with the parent object. If the unwound field is missing or its value is neither an array nor an object and therefore cannot be merged with a parent object then the item gets preserved as it is. Note that the unwound items ignore the `desc` parameter. -func (r ApiDatasetItemsGetRequest) Unwind(unwind string) ApiDatasetItemsGetRequest { - r.unwind = &unwind - return r -} - -// A comma-separated list of fields which should transform nested objects into flat structures. For example, with `flatten=\"foo\"` the object `{\"foo\":{\"bar\": \"hello\"}}` is turned into `{\"foo.bar\": \"hello\"}`. The original object with properties is replaced with the flattened object. -func (r ApiDatasetItemsGetRequest) Flatten(flatten string) ApiDatasetItemsGetRequest { - r.flatten = &flatten - return r -} - -// By default, results are returned in the same order as they were stored. To reverse the order, set this parameter to `true` or `1`. -func (r ApiDatasetItemsGetRequest) Desc(desc bool) ApiDatasetItemsGetRequest { - r.desc = &desc - return r -} - -// If `true` or `1` then the response will define the `Content-Disposition: attachment` header, forcing a web browser to download the file rather than to display it. By default this header is not present. -func (r ApiDatasetItemsGetRequest) Attachment(attachment bool) ApiDatasetItemsGetRequest { - r.attachment = &attachment - return r -} - -// A delimiter character for CSV files, only used if `format=csv`. You might need to URL-encode the character (e.g. use `%09` for tab or `%3B` for semicolon). The default delimiter is a simple comma (`,`). -func (r ApiDatasetItemsGetRequest) Delimiter(delimiter string) ApiDatasetItemsGetRequest { - r.delimiter = &delimiter - return r -} - -// All text responses are encoded in UTF-8 encoding. By default, the `format=csv` files are prefixed with the UTF-8 Byte Order Mark (BOM), while `json`, `jsonl`, `xml`, `html` and `rss` files are not. If you want to override this default behavior, specify `bom=1` query parameter to include the BOM or `bom=0` to skip it. -func (r ApiDatasetItemsGetRequest) Bom(bom bool) ApiDatasetItemsGetRequest { - r.bom = &bom - return r -} - -// Overrides default root element name of `xml` output. By default the root element is `items`. -func (r ApiDatasetItemsGetRequest) XmlRoot(xmlRoot string) ApiDatasetItemsGetRequest { - r.xmlRoot = &xmlRoot - return r -} - -// Overrides default element name that wraps each page or page function result object in `xml` output. By default the element name is `item`. -func (r ApiDatasetItemsGetRequest) XmlRow(xmlRow string) ApiDatasetItemsGetRequest { - r.xmlRow = &xmlRow - return r -} - -// If `true` or `1` then header row in the `csv` format is skipped. -func (r ApiDatasetItemsGetRequest) SkipHeaderRow(skipHeaderRow bool) ApiDatasetItemsGetRequest { - r.skipHeaderRow = &skipHeaderRow - return r -} - -// If `true` or `1` then hidden fields are skipped from the output, i.e. fields starting with the `#` character. -func (r ApiDatasetItemsGetRequest) SkipHidden(skipHidden bool) ApiDatasetItemsGetRequest { - r.skipHidden = &skipHidden - return r -} - -// If `true` or `1` then empty items are skipped from the output. Note that if used, the results might contain less items than the limit value. -func (r ApiDatasetItemsGetRequest) SkipEmpty(skipEmpty bool) ApiDatasetItemsGetRequest { - r.skipEmpty = &skipEmpty - return r -} - -// If `true` or `1` then, the endpoint applies the `fields=url,pageFunctionResult,errorInfo` and `unwind=pageFunctionResult` query parameters. This feature is used to emulate simplified results provided by the legacy Apify Crawler product and it's not recommended to use it in new integrations. -func (r ApiDatasetItemsGetRequest) Simplified(simplified bool) ApiDatasetItemsGetRequest { - r.simplified = &simplified - return r -} - -// Defines the view configuration for dataset items based on the schema definition. This parameter determines how the data will be filtered and presented. For complete specification details, see the [dataset schema documentation](/platform/actors/development/actor-definition/dataset-schema). -func (r ApiDatasetItemsGetRequest) View(view string) ApiDatasetItemsGetRequest { - r.view = &view - return r -} - -// If `true` or `1` then, the all the items with errorInfo property will be skipped from the output. This feature is here to emulate functionality of API version 1 used for the legacy Apify Crawler product and it's not recommended to use it in new integrations. -func (r ApiDatasetItemsGetRequest) SkipFailedPages(skipFailedPages bool) ApiDatasetItemsGetRequest { - r.skipFailedPages = &skipFailedPages - return r -} - -// Overrides the auto-generated RSS channel `<title>` element. Only used when `format=rss`. If not provided, the title defaults to `Dataset <label>`. -func (r ApiDatasetItemsGetRequest) FeedTitle(feedTitle string) ApiDatasetItemsGetRequest { - r.feedTitle = &feedTitle - return r -} - -// Overrides the auto-generated RSS channel `<description>` element. Only used when `format=rss`. If not provided, the description defaults to `Items in dataset with id \"<datasetId>\".` -func (r ApiDatasetItemsGetRequest) FeedDescription(feedDescription string) ApiDatasetItemsGetRequest { - r.feedDescription = &feedDescription - return r -} - -// Signature used for the access. -func (r ApiDatasetItemsGetRequest) Signature(signature string) ApiDatasetItemsGetRequest { - r.signature = &signature - return r -} - -func (r ApiDatasetItemsGetRequest) Execute() ([]map[string]interface{}, *http.Response, error) { - return r.ApiService.DatasetItemsGetExecute(r) -} - -/* -DatasetItemsGet Get dataset items - -Returns data stored in the dataset in a desired format. - -### Response format - -The format of the response depends on <code>format</code> query parameter. - -The <code>format</code> parameter can have one of the following values: -<code>json</code>, <code>jsonl</code>, <code>xml</code>, <code>html</code>, -<code>csv</code>, <code>xlsx</code> and <code>rss</code>. - -The following table describes how each format is treated. - -<table> - <tr> - <th>Format</th> - <th>Items</th> - </tr> - <tr> - <td><code>json</code></td> - <td rowspan="3">The response is a JSON, JSONL or XML array of raw item objects.</td> - </tr> - <tr> - <td><code>jsonl</code></td> - </tr> - <tr> - <td><code>xml</code></td> - </tr> - <tr> - <td><code>html</code></td> - <td rowspan="3">The response is a HTML, CSV or XLSX table, where columns correspond to the - properties of the item and rows correspond to each dataset item.</td> - </tr> - <tr> - <td><code>csv</code></td> - </tr> - <tr> - <td><code>xlsx</code></td> - </tr> - <tr> - <td><code>rss</code></td> - <td colspan="2">The response is a RSS file. Each item is displayed as child elements of one - <code><item></code>.</td> - </tr> -</table> - -Note that CSV, XLSX and HTML tables are limited to 2000 columns and the column names cannot be longer than 200 characters. -JSON, XML and RSS formats do not have such restrictions. - -### Hidden fields - -The top-level fields starting with the `#` character are considered hidden. -These are useful to store debugging information and can be omitted from the output by providing the `skipHidden=1` or `clean=1` query parameters. -For example, if you store the following object to the dataset: - -``` -{ - productName: "iPhone Xs", - description: "Welcome to the big screens." - #debug: { - url: "https://www.apple.com/lae/iphone-xs/", - crawledAt: "2019-01-21T16:06:03.683Z" - } -} -``` - -The `#debug` field will be considered as hidden and can be omitted from the -results. This is useful to -provide nice cleaned data to end users, while keeping debugging info -available if needed. The Dataset object -returned by the API contains the number of such clean items in the`dataset.cleanItemCount` property. - -### XML format extension - -When exporting results to XML or RSS formats, the names of object properties become XML tags and the corresponding values become tag's children. For example, the following JavaScript object: - -``` -{ - name: "Paul Newman", - address: [ - { type: "home", street: "21st", city: "Chicago" }, - { type: "office", street: null, city: null } - ] -} -``` - -will be transformed to the following XML snippet: - -``` -<name>Paul Newman</name> -<address> - <type>home</type> - <street>21st</street> - <city>Chicago</city> -</address> -<address> - <type>office</type> - <street/> - <city/> -</address> -``` - -If the JavaScript object contains a property named `@` then its sub-properties are exported as attributes of the parent XML -element. -If the parent XML element does not have any child elements then its value is taken from a JavaScript object property named `#`. - -For example, the following JavaScript object: - -``` -{ - "address": [{ - "@": { - "type": "home" - }, - "street": "21st", - "city": "Chicago" - }, - { - "@": { - "type": "office" - }, - "#": 'unknown' - }] -} -``` - -will be transformed to the following XML snippet: - -``` -<address type="home"> - <street>21st</street> - <city>Chicago</city> -</address> -<address type="office">unknown</address> -``` - -This feature is also useful to customize your RSS feeds generated for various websites. - -By default the whole result is wrapped in a `<items>` element and each page object is wrapped in a `<item>` element. -You can change this using <code>xmlRoot</code> and <code>xmlRow</code> url parameters. - -### Pagination - -The generated response supports [pagination](#/introduction/pagination). -The pagination is always performed with the granularity of a single item, regardless whether <code>unwind</code> parameter was provided. -By default, the **Items** in the response are sorted by the time they were stored to the database, therefore you can use pagination to incrementally fetch the items as they are being added. -No limit exists to how many items can be returned in one response. - -If you specify `desc=1` query parameter, the results are returned in the reverse order than they were stored (i.e. from newest to oldest items). -Note that only the order of **Items** is reversed, but not the order of the `unwind` array elements. - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param datasetId Dataset ID or `username~dataset-name`. - @return ApiDatasetItemsGetRequest -*/ -func (a *StorageDatasetsAPIService) DatasetItemsGet(ctx context.Context, datasetId string) ApiDatasetItemsGetRequest { - return ApiDatasetItemsGetRequest{ - ApiService: a, - ctx: ctx, - datasetId: datasetId, - } -} - -// Execute executes the request -// @return []map[string]interface{} -func (a *StorageDatasetsAPIService) DatasetItemsGetExecute(r ApiDatasetItemsGetRequest) ([]map[string]interface{}, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue []map[string]interface{} - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StorageDatasetsAPIService.DatasetItemsGet") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/datasets/{datasetId}/items" - localVarPath = strings.Replace(localVarPath, "{"+"datasetId"+"}", url.PathEscape(parameterValueToString(r.datasetId, "datasetId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if r.format != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "format", r.format, "form", "") - } - if r.clean != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "clean", r.clean, "form", "") - } - if r.offset != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "form", "") - } - if r.limit != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "form", "") - } - if r.fields != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "fields", r.fields, "form", "") - } - if r.outputFields != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "outputFields", r.outputFields, "form", "") - } - if r.omit != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "omit", r.omit, "form", "") - } - if r.unwind != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "unwind", r.unwind, "form", "") - } - if r.flatten != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "flatten", r.flatten, "form", "") - } - if r.desc != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "desc", r.desc, "form", "") - } - if r.attachment != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "attachment", r.attachment, "form", "") - } - if r.delimiter != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "delimiter", r.delimiter, "form", "") - } - if r.bom != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "bom", r.bom, "form", "") - } - if r.xmlRoot != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "xmlRoot", r.xmlRoot, "form", "") - } - if r.xmlRow != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "xmlRow", r.xmlRow, "form", "") - } - if r.skipHeaderRow != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "skipHeaderRow", r.skipHeaderRow, "form", "") - } - if r.skipHidden != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "skipHidden", r.skipHidden, "form", "") - } - if r.skipEmpty != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "skipEmpty", r.skipEmpty, "form", "") - } - if r.simplified != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "simplified", r.simplified, "form", "") - } - if r.view != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "view", r.view, "form", "") - } - if r.skipFailedPages != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "skipFailedPages", r.skipFailedPages, "form", "") - } - if r.feedTitle != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "feedTitle", r.feedTitle, "form", "") - } - if r.feedDescription != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "feedDescription", r.feedDescription, "form", "") - } - if r.signature != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "signature", r.signature, "form", "") - } - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json", "application/jsonl", "text/csv", "text/html", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", "application/rss+xml", "application/xml"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiDatasetItemsHeadRequest struct { - ctx context.Context - ApiService *StorageDatasetsAPIService - datasetId string - format *string - clean *bool - offset *float64 - limit *float64 - fields *string - outputFields *string - omit *string - unwind *string - flatten *string - desc *bool - attachment *bool - delimiter *string - bom *bool - xmlRoot *string - xmlRow *string - skipHeaderRow *bool - skipHidden *bool - skipEmpty *bool - simplified *bool - view *string - skipFailedPages *bool - feedTitle *string - feedDescription *string - signature *string -} - -// Format of the results, possible values are: `json`, `jsonl`, `csv`, `html`, `xlsx`, `xml` and `rss`. The default value is `json`. -func (r ApiDatasetItemsHeadRequest) Format(format string) ApiDatasetItemsHeadRequest { - r.format = &format - return r -} - -// If `true` or `1` then the API endpoint returns only non-empty items and skips hidden fields (i.e. fields starting with the # character). The `clean` parameter is just a shortcut for `skipHidden=true` and `skipEmpty=true` parameters. Note that since some objects might be skipped from the output, that the result might contain less items than the `limit` value. -func (r ApiDatasetItemsHeadRequest) Clean(clean bool) ApiDatasetItemsHeadRequest { - r.clean = &clean - return r -} - -// Number of items that should be skipped at the start. The default value is `0`. -func (r ApiDatasetItemsHeadRequest) Offset(offset float64) ApiDatasetItemsHeadRequest { - r.offset = &offset - return r -} - -// Maximum number of items to return. By default there is no limit. -func (r ApiDatasetItemsHeadRequest) Limit(limit float64) ApiDatasetItemsHeadRequest { - r.limit = &limit - return r -} - -// A comma-separated list of fields which should be picked from the items, only these fields will remain in the resulting record objects. Note that the fields in the outputted items are sorted the same way as they are specified in the `fields` query parameter. You can use this feature to effectively fix the output format. -func (r ApiDatasetItemsHeadRequest) Fields(fields string) ApiDatasetItemsHeadRequest { - r.fields = &fields - return r -} - -// A comma-separated list of output field names that positionally rename the fields specified in the `fields` parameter. For example, `?fields=headline,url&outputFields=title,link` renames `headline` to `title` and `url` to `link` in the output. The number of names in `outputFields` must match the number of names in `fields`. Requires the `fields` parameter to be specified as well. -func (r ApiDatasetItemsHeadRequest) OutputFields(outputFields string) ApiDatasetItemsHeadRequest { - r.outputFields = &outputFields - return r -} - -// A comma-separated list of fields which should be omitted from the items. -func (r ApiDatasetItemsHeadRequest) Omit(omit string) ApiDatasetItemsHeadRequest { - r.omit = &omit - return r -} - -// A comma-separated list of fields which should be unwound, in order which they should be processed. Each field should be either an array or an object. If the field is an array then every element of the array will become a separate record and merged with parent object. If the unwound field is an object then it is merged with the parent object. If the unwound field is missing or its value is neither an array nor an object and therefore cannot be merged with a parent object then the item gets preserved as it is. Note that the unwound items ignore the `desc` parameter. -func (r ApiDatasetItemsHeadRequest) Unwind(unwind string) ApiDatasetItemsHeadRequest { - r.unwind = &unwind - return r -} - -// A comma-separated list of fields which should transform nested objects into flat structures. For example, with `flatten=\"foo\"` the object `{\"foo\":{\"bar\": \"hello\"}}` is turned into `{\"foo.bar\": \"hello\"}`. The original object with properties is replaced with the flattened object. -func (r ApiDatasetItemsHeadRequest) Flatten(flatten string) ApiDatasetItemsHeadRequest { - r.flatten = &flatten - return r -} - -// By default, results are returned in the same order as they were stored. To reverse the order, set this parameter to `true` or `1`. -func (r ApiDatasetItemsHeadRequest) Desc(desc bool) ApiDatasetItemsHeadRequest { - r.desc = &desc - return r -} - -// If `true` or `1` then the response will define the `Content-Disposition: attachment` header, forcing a web browser to download the file rather than to display it. By default this header is not present. -func (r ApiDatasetItemsHeadRequest) Attachment(attachment bool) ApiDatasetItemsHeadRequest { - r.attachment = &attachment - return r -} - -// A delimiter character for CSV files, only used if `format=csv`. You might need to URL-encode the character (e.g. use `%09` for tab or `%3B` for semicolon). The default delimiter is a simple comma (`,`). -func (r ApiDatasetItemsHeadRequest) Delimiter(delimiter string) ApiDatasetItemsHeadRequest { - r.delimiter = &delimiter - return r -} - -// All text responses are encoded in UTF-8 encoding. By default, the `format=csv` files are prefixed with the UTF-8 Byte Order Mark (BOM), while `json`, `jsonl`, `xml`, `html` and `rss` files are not. If you want to override this default behavior, specify `bom=1` query parameter to include the BOM or `bom=0` to skip it. -func (r ApiDatasetItemsHeadRequest) Bom(bom bool) ApiDatasetItemsHeadRequest { - r.bom = &bom - return r -} - -// Overrides default root element name of `xml` output. By default the root element is `items`. -func (r ApiDatasetItemsHeadRequest) XmlRoot(xmlRoot string) ApiDatasetItemsHeadRequest { - r.xmlRoot = &xmlRoot - return r -} - -// Overrides default element name that wraps each page or page function result object in `xml` output. By default the element name is `item`. -func (r ApiDatasetItemsHeadRequest) XmlRow(xmlRow string) ApiDatasetItemsHeadRequest { - r.xmlRow = &xmlRow - return r -} - -// If `true` or `1` then header row in the `csv` format is skipped. -func (r ApiDatasetItemsHeadRequest) SkipHeaderRow(skipHeaderRow bool) ApiDatasetItemsHeadRequest { - r.skipHeaderRow = &skipHeaderRow - return r -} - -// If `true` or `1` then hidden fields are skipped from the output, i.e. fields starting with the `#` character. -func (r ApiDatasetItemsHeadRequest) SkipHidden(skipHidden bool) ApiDatasetItemsHeadRequest { - r.skipHidden = &skipHidden - return r -} - -// If `true` or `1` then empty items are skipped from the output. Note that if used, the results might contain less items than the limit value. -func (r ApiDatasetItemsHeadRequest) SkipEmpty(skipEmpty bool) ApiDatasetItemsHeadRequest { - r.skipEmpty = &skipEmpty - return r -} - -// If `true` or `1` then, the endpoint applies the `fields=url,pageFunctionResult,errorInfo` and `unwind=pageFunctionResult` query parameters. This feature is used to emulate simplified results provided by the legacy Apify Crawler product and it's not recommended to use it in new integrations. -func (r ApiDatasetItemsHeadRequest) Simplified(simplified bool) ApiDatasetItemsHeadRequest { - r.simplified = &simplified - return r -} - -// Defines the view configuration for dataset items based on the schema definition. This parameter determines how the data will be filtered and presented. For complete specification details, see the [dataset schema documentation](/platform/actors/development/actor-definition/dataset-schema). -func (r ApiDatasetItemsHeadRequest) View(view string) ApiDatasetItemsHeadRequest { - r.view = &view - return r -} - -// If `true` or `1` then, the all the items with errorInfo property will be skipped from the output. This feature is here to emulate functionality of API version 1 used for the legacy Apify Crawler product and it's not recommended to use it in new integrations. -func (r ApiDatasetItemsHeadRequest) SkipFailedPages(skipFailedPages bool) ApiDatasetItemsHeadRequest { - r.skipFailedPages = &skipFailedPages - return r -} - -// Overrides the auto-generated RSS channel `<title>` element. Only used when `format=rss`. If not provided, the title defaults to `Dataset <label>`. -func (r ApiDatasetItemsHeadRequest) FeedTitle(feedTitle string) ApiDatasetItemsHeadRequest { - r.feedTitle = &feedTitle - return r -} - -// Overrides the auto-generated RSS channel `<description>` element. Only used when `format=rss`. If not provided, the description defaults to `Items in dataset with id \"<datasetId>\".` -func (r ApiDatasetItemsHeadRequest) FeedDescription(feedDescription string) ApiDatasetItemsHeadRequest { - r.feedDescription = &feedDescription - return r -} - -// Signature used for the access. -func (r ApiDatasetItemsHeadRequest) Signature(signature string) ApiDatasetItemsHeadRequest { - r.signature = &signature - return r -} - -func (r ApiDatasetItemsHeadRequest) Execute() (*http.Response, error) { - return r.ApiService.DatasetItemsHeadExecute(r) -} - -/* -DatasetItemsHead Get dataset items headers - -Returns only the HTTP headers for the dataset items endpoint, without the response body. -This is useful to check pagination metadata or verify access without downloading the full dataset. - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param datasetId Dataset ID or `username~dataset-name`. - @return ApiDatasetItemsHeadRequest -*/ -func (a *StorageDatasetsAPIService) DatasetItemsHead(ctx context.Context, datasetId string) ApiDatasetItemsHeadRequest { - return ApiDatasetItemsHeadRequest{ - ApiService: a, - ctx: ctx, - datasetId: datasetId, - } -} - -// Execute executes the request -func (a *StorageDatasetsAPIService) DatasetItemsHeadExecute(r ApiDatasetItemsHeadRequest) (*http.Response, error) { - var ( - localVarHTTPMethod = http.MethodHead - localVarPostBody interface{} - formFiles []formFile - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StorageDatasetsAPIService.DatasetItemsHead") - if err != nil { - return nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/datasets/{datasetId}/items" - localVarPath = strings.Replace(localVarPath, "{"+"datasetId"+"}", url.PathEscape(parameterValueToString(r.datasetId, "datasetId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if r.format != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "format", r.format, "form", "") - } - if r.clean != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "clean", r.clean, "form", "") - } - if r.offset != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "form", "") - } - if r.limit != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "form", "") - } - if r.fields != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "fields", r.fields, "form", "") - } - if r.outputFields != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "outputFields", r.outputFields, "form", "") - } - if r.omit != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "omit", r.omit, "form", "") - } - if r.unwind != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "unwind", r.unwind, "form", "") - } - if r.flatten != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "flatten", r.flatten, "form", "") - } - if r.desc != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "desc", r.desc, "form", "") - } - if r.attachment != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "attachment", r.attachment, "form", "") - } - if r.delimiter != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "delimiter", r.delimiter, "form", "") - } - if r.bom != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "bom", r.bom, "form", "") - } - if r.xmlRoot != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "xmlRoot", r.xmlRoot, "form", "") - } - if r.xmlRow != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "xmlRow", r.xmlRow, "form", "") - } - if r.skipHeaderRow != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "skipHeaderRow", r.skipHeaderRow, "form", "") - } - if r.skipHidden != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "skipHidden", r.skipHidden, "form", "") - } - if r.skipEmpty != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "skipEmpty", r.skipEmpty, "form", "") - } - if r.simplified != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "simplified", r.simplified, "form", "") - } - if r.view != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "view", r.view, "form", "") - } - if r.skipFailedPages != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "skipFailedPages", r.skipFailedPages, "form", "") - } - if r.feedTitle != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "feedTitle", r.feedTitle, "form", "") - } - if r.feedDescription != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "feedDescription", r.feedDescription, "form", "") - } - if r.signature != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "signature", r.signature, "form", "") - } - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarHTTPResponse, newErr - } - - return localVarHTTPResponse, nil -} - -type ApiDatasetItemsPostRequest struct { - ctx context.Context - ApiService *StorageDatasetsAPIService - datasetId string - actRunsLastDatasetItemsPostRequest *ActRunsLastDatasetItemsPostRequest -} - -// -func (r ApiDatasetItemsPostRequest) ActRunsLastDatasetItemsPostRequest(actRunsLastDatasetItemsPostRequest ActRunsLastDatasetItemsPostRequest) ApiDatasetItemsPostRequest { - r.actRunsLastDatasetItemsPostRequest = &actRunsLastDatasetItemsPostRequest - return r -} - -func (r ApiDatasetItemsPostRequest) Execute() (map[string]interface{}, *http.Response, error) { - return r.ApiService.DatasetItemsPostExecute(r) -} - -/* -DatasetItemsPost Store items - -Appends an item or an array of items to the end of the dataset. -The POST payload is a JSON object or a JSON array of objects to save into the dataset. - -If the data you attempt to store in the dataset is invalid (meaning any of the items received by the API fails the validation), the whole request is discarded and the API will return a response with status code 400. -For more information about dataset schema validation, see [Dataset schema](https://docs.apify.com/platform/actors/development/actor-definition/dataset-schema/validation). - -**IMPORTANT:** The limit of request payload size for the dataset is 5 MB. If the array exceeds the size, you'll need to split it into a number of smaller arrays. - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param datasetId Dataset ID or `username~dataset-name`. - @return ApiDatasetItemsPostRequest -*/ -func (a *StorageDatasetsAPIService) DatasetItemsPost(ctx context.Context, datasetId string) ApiDatasetItemsPostRequest { - return ApiDatasetItemsPostRequest{ - ApiService: a, - ctx: ctx, - datasetId: datasetId, - } -} - -// Execute executes the request -// @return map[string]interface{} -func (a *StorageDatasetsAPIService) DatasetItemsPostExecute(r ApiDatasetItemsPostRequest) (map[string]interface{}, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodPost - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue map[string]interface{} - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StorageDatasetsAPIService.DatasetItemsPost") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/datasets/{datasetId}/items" - localVarPath = strings.Replace(localVarPath, "{"+"datasetId"+"}", url.PathEscape(parameterValueToString(r.datasetId, "datasetId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - if r.actRunsLastDatasetItemsPostRequest == nil { - return localVarReturnValue, nil, reportError("actRunsLastDatasetItemsPostRequest is required and must be specified") - } - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/json"} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - // body params - localVarPostBody = r.actRunsLastDatasetItemsPostRequest - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ActRunsLastDatasetItemsPost400Response - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiDatasetPutRequest struct { - ctx context.Context - ApiService *StorageDatasetsAPIService - datasetId string - updateDatasetRequest *UpdateDatasetRequest -} - -// -func (r ApiDatasetPutRequest) UpdateDatasetRequest(updateDatasetRequest UpdateDatasetRequest) ApiDatasetPutRequest { - r.updateDatasetRequest = &updateDatasetRequest - return r -} - -func (r ApiDatasetPutRequest) Execute() (*DatasetResponse, *http.Response, error) { - return r.ApiService.DatasetPutExecute(r) -} - -/* -DatasetPut Update dataset - -Updates a dataset's name and general resource access level using a value specified by a JSON object passed in the PUT payload. -The response is the updated dataset object, as returned by the [Get dataset](/api/v2/dataset-get) API endpoint. - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param datasetId Dataset ID or `username~dataset-name`. - @return ApiDatasetPutRequest -*/ -func (a *StorageDatasetsAPIService) DatasetPut(ctx context.Context, datasetId string) ApiDatasetPutRequest { - return ApiDatasetPutRequest{ - ApiService: a, - ctx: ctx, - datasetId: datasetId, - } -} - -// Execute executes the request -// @return DatasetResponse -func (a *StorageDatasetsAPIService) DatasetPutExecute(r ApiDatasetPutRequest) (*DatasetResponse, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodPut - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *DatasetResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StorageDatasetsAPIService.DatasetPut") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/datasets/{datasetId}" - localVarPath = strings.Replace(localVarPath, "{"+"datasetId"+"}", url.PathEscape(parameterValueToString(r.datasetId, "datasetId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - if r.updateDatasetRequest == nil { - return localVarReturnValue, nil, reportError("updateDatasetRequest is required and must be specified") - } - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/json"} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - // body params - localVarPostBody = r.updateDatasetRequest - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 413 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 415 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiDatasetStatisticsGetRequest struct { - ctx context.Context - ApiService *StorageDatasetsAPIService - datasetId string -} - -func (r ApiDatasetStatisticsGetRequest) Execute() (*DatasetStatisticsResponse, *http.Response, error) { - return r.ApiService.DatasetStatisticsGetExecute(r) -} - -/* -DatasetStatisticsGet Get dataset statistics - -Returns statistics for given dataset. - -Provides only [field statistics](https://docs.apify.com/platform/actors/development/actor-definition/dataset-schema/validation#dataset-field-statistics). - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param datasetId Dataset ID or `username~dataset-name`. - @return ApiDatasetStatisticsGetRequest -*/ -func (a *StorageDatasetsAPIService) DatasetStatisticsGet(ctx context.Context, datasetId string) ApiDatasetStatisticsGetRequest { - return ApiDatasetStatisticsGetRequest{ - ApiService: a, - ctx: ctx, - datasetId: datasetId, - } -} - -// Execute executes the request -// @return DatasetStatisticsResponse -func (a *StorageDatasetsAPIService) DatasetStatisticsGetExecute(r ApiDatasetStatisticsGetRequest) (*DatasetStatisticsResponse, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *DatasetStatisticsResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StorageDatasetsAPIService.DatasetStatisticsGet") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/datasets/{datasetId}/statistics" - localVarPath = strings.Replace(localVarPath, "{"+"datasetId"+"}", url.PathEscape(parameterValueToString(r.datasetId, "datasetId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiDatasetsGetRequest struct { - ctx context.Context - ApiService *StorageDatasetsAPIService - offset *float64 - limit *float64 - desc *bool - unnamed *bool - ownership *StorageOwnership -} - -// Number of items that should be skipped at the start. The default value is `0`. -func (r ApiDatasetsGetRequest) Offset(offset float64) ApiDatasetsGetRequest { - r.offset = &offset - return r -} - -// Maximum number of items to return. The default value as well as the maximum is `1000`. -func (r ApiDatasetsGetRequest) Limit(limit float64) ApiDatasetsGetRequest { - r.limit = &limit - return r -} - -// If `true` or `1` then the objects are sorted by the `createdAt` field in descending order. By default, they are sorted in ascending order. -func (r ApiDatasetsGetRequest) Desc(desc bool) ApiDatasetsGetRequest { - r.desc = &desc - return r -} - -// If `true` or `1` then all the storages are returned. By default, only named storages are returned. -func (r ApiDatasetsGetRequest) Unnamed(unnamed bool) ApiDatasetsGetRequest { - r.unnamed = &unnamed - return r -} - -// Filter by ownership. If this parameter is omitted, all accessible datasets are returned. - `ownedByMe`: Return only datasets owned by the user. - `sharedWithMe`: Return only datasets shared with the user by other users. -func (r ApiDatasetsGetRequest) Ownership(ownership StorageOwnership) ApiDatasetsGetRequest { - r.ownership = &ownership - return r -} - -func (r ApiDatasetsGetRequest) Execute() (*ListOfDatasetsResponse, *http.Response, error) { - return r.ApiService.DatasetsGetExecute(r) -} - -/* -DatasetsGet Get list of datasets - -Lists all of a user's datasets. - -The response is a JSON array of objects, -where each object contains basic information about one dataset. - -By default, the objects are sorted by the `createdAt` field in ascending -order, therefore you can use pagination to incrementally fetch all datasets while new -ones are still being created. To sort them in descending order, use `desc=1` -parameter. The endpoint supports pagination using `limit` and `offset` -parameters and it will not return more than 1000 array elements. - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return ApiDatasetsGetRequest -*/ -func (a *StorageDatasetsAPIService) DatasetsGet(ctx context.Context) ApiDatasetsGetRequest { - return ApiDatasetsGetRequest{ - ApiService: a, - ctx: ctx, - } -} - -// Execute executes the request -// @return ListOfDatasetsResponse -func (a *StorageDatasetsAPIService) DatasetsGetExecute(r ApiDatasetsGetRequest) (*ListOfDatasetsResponse, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *ListOfDatasetsResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StorageDatasetsAPIService.DatasetsGet") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/datasets" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if r.offset != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "form", "") - } - if r.limit != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "form", "") - } - if r.desc != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "desc", r.desc, "form", "") - } - if r.unnamed != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "unnamed", r.unnamed, "form", "") - } - if r.ownership != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "ownership", r.ownership, "form", "") - } - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiDatasetsPostRequest struct { - ctx context.Context - ApiService *StorageDatasetsAPIService - name *string -} - -// Custom unique name to easily identify the dataset in the future. -func (r ApiDatasetsPostRequest) Name(name string) ApiDatasetsPostRequest { - r.name = &name - return r -} - -func (r ApiDatasetsPostRequest) Execute() (*DatasetResponse, *http.Response, error) { - return r.ApiService.DatasetsPostExecute(r) -} - -/* -DatasetsPost Create dataset - -Creates a dataset and returns its object. -Keep in mind that data stored under unnamed dataset follows [data retention period](https://docs.apify.com/platform/storage#data-retention). -It creates a dataset with the given name if the parameter name is used. -If a dataset with the given name already exists then returns its object. - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return ApiDatasetsPostRequest -*/ -func (a *StorageDatasetsAPIService) DatasetsPost(ctx context.Context) ApiDatasetsPostRequest { - return ApiDatasetsPostRequest{ - ApiService: a, - ctx: ctx, - } -} - -// Execute executes the request -// @return DatasetResponse -func (a *StorageDatasetsAPIService) DatasetsPostExecute(r ApiDatasetsPostRequest) (*DatasetResponse, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodPost - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *DatasetResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StorageDatasetsAPIService.DatasetsPost") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/datasets" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if r.name != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "name", r.name, "form", "") - } - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} diff --git a/api_storage_key_value_stores.go b/api_storage_key_value_stores.go deleted file mode 100644 index 267a0b5..0000000 --- a/api_storage_key_value_stores.go +++ /dev/null @@ -1,2470 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "bytes" - "context" - "io" - "net/http" - "net/url" - "strings" - "os" -) - - -// StorageKeyValueStoresAPIService StorageKeyValueStoresAPI service -type StorageKeyValueStoresAPIService service - -type ApiKeyValueStoreDeleteRequest struct { - ctx context.Context - ApiService *StorageKeyValueStoresAPIService - storeId string -} - -func (r ApiKeyValueStoreDeleteRequest) Execute() (*http.Response, error) { - return r.ApiService.KeyValueStoreDeleteExecute(r) -} - -/* -KeyValueStoreDelete Delete store - -Deletes a key-value store. - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param storeId Key-value store ID or `username~store-name`. - @return ApiKeyValueStoreDeleteRequest -*/ -func (a *StorageKeyValueStoresAPIService) KeyValueStoreDelete(ctx context.Context, storeId string) ApiKeyValueStoreDeleteRequest { - return ApiKeyValueStoreDeleteRequest{ - ApiService: a, - ctx: ctx, - storeId: storeId, - } -} - -// Execute executes the request -func (a *StorageKeyValueStoresAPIService) KeyValueStoreDeleteExecute(r ApiKeyValueStoreDeleteRequest) (*http.Response, error) { - var ( - localVarHTTPMethod = http.MethodDelete - localVarPostBody interface{} - formFiles []formFile - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StorageKeyValueStoresAPIService.KeyValueStoreDelete") - if err != nil { - return nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/key-value-stores/{storeId}" - localVarPath = strings.Replace(localVarPath, "{"+"storeId"+"}", url.PathEscape(parameterValueToString(r.storeId, "storeId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarHTTPResponse, newErr - } - - return localVarHTTPResponse, nil -} - -type ApiKeyValueStoreGetRequest struct { - ctx context.Context - ApiService *StorageKeyValueStoresAPIService - storeId string -} - -func (r ApiKeyValueStoreGetRequest) Execute() (*KeyValueStoreResponse, *http.Response, error) { - return r.ApiService.KeyValueStoreGetExecute(r) -} - -/* -KeyValueStoreGet Get store - -Gets an object that contains all the details about a specific key-value -store. - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param storeId Key-value store ID or `username~store-name`. - @return ApiKeyValueStoreGetRequest -*/ -func (a *StorageKeyValueStoresAPIService) KeyValueStoreGet(ctx context.Context, storeId string) ApiKeyValueStoreGetRequest { - return ApiKeyValueStoreGetRequest{ - ApiService: a, - ctx: ctx, - storeId: storeId, - } -} - -// Execute executes the request -// @return KeyValueStoreResponse -func (a *StorageKeyValueStoresAPIService) KeyValueStoreGetExecute(r ApiKeyValueStoreGetRequest) (*KeyValueStoreResponse, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *KeyValueStoreResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StorageKeyValueStoresAPIService.KeyValueStoreGet") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/key-value-stores/{storeId}" - localVarPath = strings.Replace(localVarPath, "{"+"storeId"+"}", url.PathEscape(parameterValueToString(r.storeId, "storeId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiKeyValueStoreKeysGetRequest struct { - ctx context.Context - ApiService *StorageKeyValueStoresAPIService - storeId string - exclusiveStartKey *string - limit *float32 - collection *string - prefix *string - signature *string -} - -// All keys up to this one (including) are skipped from the result. -func (r ApiKeyValueStoreKeysGetRequest) ExclusiveStartKey(exclusiveStartKey string) ApiKeyValueStoreKeysGetRequest { - r.exclusiveStartKey = &exclusiveStartKey - return r -} - -// Number of keys to be returned. -func (r ApiKeyValueStoreKeysGetRequest) Limit(limit float32) ApiKeyValueStoreKeysGetRequest { - r.limit = &limit - return r -} - -// Limit the results to keys that belong to a specific collection from the key-value store schema. The key-value store need to have a schema defined for this parameter to work. -func (r ApiKeyValueStoreKeysGetRequest) Collection(collection string) ApiKeyValueStoreKeysGetRequest { - r.collection = &collection - return r -} - -// Limit the results to keys that start with a specific prefix. -func (r ApiKeyValueStoreKeysGetRequest) Prefix(prefix string) ApiKeyValueStoreKeysGetRequest { - r.prefix = &prefix - return r -} - -// Signature used for the access. -func (r ApiKeyValueStoreKeysGetRequest) Signature(signature string) ApiKeyValueStoreKeysGetRequest { - r.signature = &signature - return r -} - -func (r ApiKeyValueStoreKeysGetRequest) Execute() (*ListOfKeysResponse, *http.Response, error) { - return r.ApiService.KeyValueStoreKeysGetExecute(r) -} - -/* -KeyValueStoreKeysGet Get list of keys - -Returns a list of objects describing keys of a given key-value store, as -well as some information about the values (e.g. size). - -This endpoint is paginated using `exclusiveStartKey` and `limit` parameters -- see [Pagination](/api/v2#using-key) for more details. - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param storeId Key-value store ID or `username~store-name`. - @return ApiKeyValueStoreKeysGetRequest -*/ -func (a *StorageKeyValueStoresAPIService) KeyValueStoreKeysGet(ctx context.Context, storeId string) ApiKeyValueStoreKeysGetRequest { - return ApiKeyValueStoreKeysGetRequest{ - ApiService: a, - ctx: ctx, - storeId: storeId, - } -} - -// Execute executes the request -// @return ListOfKeysResponse -func (a *StorageKeyValueStoresAPIService) KeyValueStoreKeysGetExecute(r ApiKeyValueStoreKeysGetRequest) (*ListOfKeysResponse, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *ListOfKeysResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StorageKeyValueStoresAPIService.KeyValueStoreKeysGet") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/key-value-stores/{storeId}/keys" - localVarPath = strings.Replace(localVarPath, "{"+"storeId"+"}", url.PathEscape(parameterValueToString(r.storeId, "storeId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if r.exclusiveStartKey != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "exclusiveStartKey", r.exclusiveStartKey, "form", "") - } - if r.limit != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "form", "") - } else { - var defaultValue float32 = 1000 - parameterAddToHeaderOrQuery(localVarQueryParams, "limit", defaultValue, "form", "") - r.limit = &defaultValue - } - if r.collection != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "collection", r.collection, "form", "") - } - if r.prefix != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "prefix", r.prefix, "form", "") - } - if r.signature != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "signature", r.signature, "form", "") - } - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiKeyValueStorePutRequest struct { - ctx context.Context - ApiService *StorageKeyValueStoresAPIService - storeId string - updateStoreRequest *UpdateStoreRequest -} - -// -func (r ApiKeyValueStorePutRequest) UpdateStoreRequest(updateStoreRequest UpdateStoreRequest) ApiKeyValueStorePutRequest { - r.updateStoreRequest = &updateStoreRequest - return r -} - -func (r ApiKeyValueStorePutRequest) Execute() (*KeyValueStoreResponse, *http.Response, error) { - return r.ApiService.KeyValueStorePutExecute(r) -} - -/* -KeyValueStorePut Update store - -Updates a key-value store's name and general resource access level using a value specified by a JSON object -passed in the PUT payload. - -The response is the updated key-value store object, as returned by the [Get -store](#/reference/key-value-stores/store-object/get-store) API endpoint. - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param storeId Key-value store ID or `username~store-name`. - @return ApiKeyValueStorePutRequest -*/ -func (a *StorageKeyValueStoresAPIService) KeyValueStorePut(ctx context.Context, storeId string) ApiKeyValueStorePutRequest { - return ApiKeyValueStorePutRequest{ - ApiService: a, - ctx: ctx, - storeId: storeId, - } -} - -// Execute executes the request -// @return KeyValueStoreResponse -func (a *StorageKeyValueStoresAPIService) KeyValueStorePutExecute(r ApiKeyValueStorePutRequest) (*KeyValueStoreResponse, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodPut - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *KeyValueStoreResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StorageKeyValueStoresAPIService.KeyValueStorePut") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/key-value-stores/{storeId}" - localVarPath = strings.Replace(localVarPath, "{"+"storeId"+"}", url.PathEscape(parameterValueToString(r.storeId, "storeId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - if r.updateStoreRequest == nil { - return localVarReturnValue, nil, reportError("updateStoreRequest is required and must be specified") - } - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/json"} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - // body params - localVarPostBody = r.updateStoreRequest - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 413 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 415 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiKeyValueStoreRecordDeleteRequest struct { - ctx context.Context - ApiService *StorageKeyValueStoresAPIService - storeId string - recordKey string -} - -func (r ApiKeyValueStoreRecordDeleteRequest) Execute() (*http.Response, error) { - return r.ApiService.KeyValueStoreRecordDeleteExecute(r) -} - -/* -KeyValueStoreRecordDelete Delete record - -Removes a record specified by a key from the key-value store. - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param storeId Key-value store ID or `username~store-name`. - @param recordKey Key of the record. - @return ApiKeyValueStoreRecordDeleteRequest -*/ -func (a *StorageKeyValueStoresAPIService) KeyValueStoreRecordDelete(ctx context.Context, storeId string, recordKey string) ApiKeyValueStoreRecordDeleteRequest { - return ApiKeyValueStoreRecordDeleteRequest{ - ApiService: a, - ctx: ctx, - storeId: storeId, - recordKey: recordKey, - } -} - -// Execute executes the request -func (a *StorageKeyValueStoresAPIService) KeyValueStoreRecordDeleteExecute(r ApiKeyValueStoreRecordDeleteRequest) (*http.Response, error) { - var ( - localVarHTTPMethod = http.MethodDelete - localVarPostBody interface{} - formFiles []formFile - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StorageKeyValueStoresAPIService.KeyValueStoreRecordDelete") - if err != nil { - return nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/key-value-stores/{storeId}/records/{recordKey}" - localVarPath = strings.Replace(localVarPath, "{"+"storeId"+"}", url.PathEscape(parameterValueToString(r.storeId, "storeId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"recordKey"+"}", url.PathEscape(parameterValueToString(r.recordKey, "recordKey")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarHTTPResponse, newErr - } - - return localVarHTTPResponse, nil -} - -type ApiKeyValueStoreRecordGetRequest struct { - ctx context.Context - ApiService *StorageKeyValueStoresAPIService - storeId string - recordKey string - attachment *bool - signature *string -} - -// If `true` or `1`, the response will be served with `Content-Disposition: attachment` header, causing web browsers to offer downloading HTML records instead of displaying them. -func (r ApiKeyValueStoreRecordGetRequest) Attachment(attachment bool) ApiKeyValueStoreRecordGetRequest { - r.attachment = &attachment - return r -} - -// Signature used for the access. -func (r ApiKeyValueStoreRecordGetRequest) Signature(signature string) ApiKeyValueStoreRecordGetRequest { - r.signature = &signature - return r -} - -func (r ApiKeyValueStoreRecordGetRequest) Execute() (map[string]interface{}, *http.Response, error) { - return r.ApiService.KeyValueStoreRecordGetExecute(r) -} - -/* -KeyValueStoreRecordGet Get record - -Gets a value stored in the key-value store under a specific key. - -The response body has the same `Content-Encoding` header as it was set in -[Put record](#tag/Key-value-storesRecord/operation/keyValueStore_record_put). - -If the request does not define the `Accept-Encoding` HTTP header with the -right encoding, the record will be decompressed. - -Most HTTP clients support decompression by default. After using the HTTP -client with decompression support, the `Accept-Encoding` header is set by -the client and body is decompressed automatically. - -Please note that for security reasons, Apify API can perform small modifications -to HTML documents before they are served via this endpoint. To fetch the raw HTML -content without any modifications, use the `attachment` query parameter. - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param storeId Key-value store ID or `username~store-name`. - @param recordKey Key of the record. - @return ApiKeyValueStoreRecordGetRequest -*/ -func (a *StorageKeyValueStoresAPIService) KeyValueStoreRecordGet(ctx context.Context, storeId string, recordKey string) ApiKeyValueStoreRecordGetRequest { - return ApiKeyValueStoreRecordGetRequest{ - ApiService: a, - ctx: ctx, - storeId: storeId, - recordKey: recordKey, - } -} - -// Execute executes the request -// @return map[string]interface{} -func (a *StorageKeyValueStoresAPIService) KeyValueStoreRecordGetExecute(r ApiKeyValueStoreRecordGetRequest) (map[string]interface{}, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue map[string]interface{} - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StorageKeyValueStoresAPIService.KeyValueStoreRecordGet") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/key-value-stores/{storeId}/records/{recordKey}" - localVarPath = strings.Replace(localVarPath, "{"+"storeId"+"}", url.PathEscape(parameterValueToString(r.storeId, "storeId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"recordKey"+"}", url.PathEscape(parameterValueToString(r.recordKey, "recordKey")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if r.attachment != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "attachment", r.attachment, "form", "") - } - if r.signature != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "signature", r.signature, "form", "") - } - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json", "*/*"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiKeyValueStoreRecordHeadRequest struct { - ctx context.Context - ApiService *StorageKeyValueStoresAPIService - storeId string - recordKey string -} - -func (r ApiKeyValueStoreRecordHeadRequest) Execute() (*http.Response, error) { - return r.ApiService.KeyValueStoreRecordHeadExecute(r) -} - -/* -KeyValueStoreRecordHead Check if a record exists - -Check if a value is stored in the key-value store under a specific key. - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param storeId Key-value store ID or `username~store-name`. - @param recordKey Key of the record. - @return ApiKeyValueStoreRecordHeadRequest -*/ -func (a *StorageKeyValueStoresAPIService) KeyValueStoreRecordHead(ctx context.Context, storeId string, recordKey string) ApiKeyValueStoreRecordHeadRequest { - return ApiKeyValueStoreRecordHeadRequest{ - ApiService: a, - ctx: ctx, - storeId: storeId, - recordKey: recordKey, - } -} - -// Execute executes the request -func (a *StorageKeyValueStoresAPIService) KeyValueStoreRecordHeadExecute(r ApiKeyValueStoreRecordHeadRequest) (*http.Response, error) { - var ( - localVarHTTPMethod = http.MethodHead - localVarPostBody interface{} - formFiles []formFile - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StorageKeyValueStoresAPIService.KeyValueStoreRecordHead") - if err != nil { - return nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/key-value-stores/{storeId}/records/{recordKey}" - localVarPath = strings.Replace(localVarPath, "{"+"storeId"+"}", url.PathEscape(parameterValueToString(r.storeId, "storeId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"recordKey"+"}", url.PathEscape(parameterValueToString(r.recordKey, "recordKey")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 404 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarHTTPResponse, newErr - } - - return localVarHTTPResponse, nil -} - -type ApiKeyValueStoreRecordPostRequest struct { - ctx context.Context - ApiService *StorageKeyValueStoresAPIService - storeId string - recordKey string - requestBody *map[string]interface{} - contentEncoding *string -} - -// -func (r ApiKeyValueStoreRecordPostRequest) RequestBody(requestBody map[string]interface{}) ApiKeyValueStoreRecordPostRequest { - r.requestBody = &requestBody - return r -} - -// -func (r ApiKeyValueStoreRecordPostRequest) ContentEncoding(contentEncoding string) ApiKeyValueStoreRecordPostRequest { - r.contentEncoding = &contentEncoding - return r -} - -func (r ApiKeyValueStoreRecordPostRequest) Execute() (map[string]interface{}, *http.Response, error) { - return r.ApiService.KeyValueStoreRecordPostExecute(r) -} - -/* -KeyValueStoreRecordPost Store record (POST) - -Stores a value under a specific key to the key-value store. - -This endpoint is an alias for the [`PUT` record](#tag/Key-value-storesRecord/operation/keyValueStore_record_put) method and behaves identically. - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param storeId Key-value store ID or `username~store-name`. - @param recordKey Key of the record. - @return ApiKeyValueStoreRecordPostRequest -*/ -func (a *StorageKeyValueStoresAPIService) KeyValueStoreRecordPost(ctx context.Context, storeId string, recordKey string) ApiKeyValueStoreRecordPostRequest { - return ApiKeyValueStoreRecordPostRequest{ - ApiService: a, - ctx: ctx, - storeId: storeId, - recordKey: recordKey, - } -} - -// Execute executes the request -// @return map[string]interface{} -func (a *StorageKeyValueStoresAPIService) KeyValueStoreRecordPostExecute(r ApiKeyValueStoreRecordPostRequest) (map[string]interface{}, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodPost - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue map[string]interface{} - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StorageKeyValueStoresAPIService.KeyValueStoreRecordPost") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/key-value-stores/{storeId}/records/{recordKey}" - localVarPath = strings.Replace(localVarPath, "{"+"storeId"+"}", url.PathEscape(parameterValueToString(r.storeId, "storeId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"recordKey"+"}", url.PathEscape(parameterValueToString(r.recordKey, "recordKey")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - if r.requestBody == nil { - return localVarReturnValue, nil, reportError("requestBody is required and must be specified") - } - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/json"} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - if r.contentEncoding != nil { - parameterAddToHeaderOrQuery(localVarHeaderParams, "Content-Encoding", r.contentEncoding, "simple", "") - } - // body params - localVarPostBody = r.requestBody - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 413 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 415 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiKeyValueStoreRecordPutRequest struct { - ctx context.Context - ApiService *StorageKeyValueStoresAPIService - storeId string - recordKey string - requestBody *map[string]interface{} - contentEncoding *string -} - -// -func (r ApiKeyValueStoreRecordPutRequest) RequestBody(requestBody map[string]interface{}) ApiKeyValueStoreRecordPutRequest { - r.requestBody = &requestBody - return r -} - -// -func (r ApiKeyValueStoreRecordPutRequest) ContentEncoding(contentEncoding string) ApiKeyValueStoreRecordPutRequest { - r.contentEncoding = &contentEncoding - return r -} - -func (r ApiKeyValueStoreRecordPutRequest) Execute() (map[string]interface{}, *http.Response, error) { - return r.ApiService.KeyValueStoreRecordPutExecute(r) -} - -/* -KeyValueStoreRecordPut Store record - -Stores a value under a specific key to the key-value store. - -The value is passed as the PUT payload and it is stored with a MIME content -type defined by the `Content-Type` header and with encoding defined by the -`Content-Encoding` header. - -To save bandwidth, storage, and speed up your upload, send the request -payload compressed with Gzip compression and add the `Content-Encoding: gzip` -header. It is possible to set up another compression type with `Content-Encoding` -request header. - -Below is a list of supported `Content-Encoding` types. - -* Gzip compression: `Content-Encoding: gzip` -* Deflate compression: `Content-Encoding: deflate` -* Brotli compression: `Content-Encoding: br` - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param storeId Key-value store ID or `username~store-name`. - @param recordKey Key of the record. - @return ApiKeyValueStoreRecordPutRequest -*/ -func (a *StorageKeyValueStoresAPIService) KeyValueStoreRecordPut(ctx context.Context, storeId string, recordKey string) ApiKeyValueStoreRecordPutRequest { - return ApiKeyValueStoreRecordPutRequest{ - ApiService: a, - ctx: ctx, - storeId: storeId, - recordKey: recordKey, - } -} - -// Execute executes the request -// @return map[string]interface{} -func (a *StorageKeyValueStoresAPIService) KeyValueStoreRecordPutExecute(r ApiKeyValueStoreRecordPutRequest) (map[string]interface{}, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodPut - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue map[string]interface{} - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StorageKeyValueStoresAPIService.KeyValueStoreRecordPut") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/key-value-stores/{storeId}/records/{recordKey}" - localVarPath = strings.Replace(localVarPath, "{"+"storeId"+"}", url.PathEscape(parameterValueToString(r.storeId, "storeId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"recordKey"+"}", url.PathEscape(parameterValueToString(r.recordKey, "recordKey")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - if r.requestBody == nil { - return localVarReturnValue, nil, reportError("requestBody is required and must be specified") - } - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/json"} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - if r.contentEncoding != nil { - parameterAddToHeaderOrQuery(localVarHeaderParams, "Content-Encoding", r.contentEncoding, "simple", "") - } - // body params - localVarPostBody = r.requestBody - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 413 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 415 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiKeyValueStoreRecordsGetRequest struct { - ctx context.Context - ApiService *StorageKeyValueStoresAPIService - storeId string - collection *string - prefix *string - signature *string -} - -// If specified, only records belonging to a specific collection from the key-value store schema. The key-value store need to have a schema defined for this parameter to work. -func (r ApiKeyValueStoreRecordsGetRequest) Collection(collection string) ApiKeyValueStoreRecordsGetRequest { - r.collection = &collection - return r -} - -// If specified, only records whose key starts with the given prefix are included in the archive. -func (r ApiKeyValueStoreRecordsGetRequest) Prefix(prefix string) ApiKeyValueStoreRecordsGetRequest { - r.prefix = &prefix - return r -} - -// Signature used for the access. -func (r ApiKeyValueStoreRecordsGetRequest) Signature(signature string) ApiKeyValueStoreRecordsGetRequest { - r.signature = &signature - return r -} - -func (r ApiKeyValueStoreRecordsGetRequest) Execute() (*os.File, *http.Response, error) { - return r.ApiService.KeyValueStoreRecordsGetExecute(r) -} - -/* -KeyValueStoreRecordsGet Download records - -Downloads all records from the key-value store as a ZIP archive. -Each record is stored as a separate file in the archive, with the filename equal to the record key. - -You can optionally filter the records by `collection` or `prefix` to download only a subset of the store. - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param storeId Key-value store ID or `username~store-name`. - @return ApiKeyValueStoreRecordsGetRequest -*/ -func (a *StorageKeyValueStoresAPIService) KeyValueStoreRecordsGet(ctx context.Context, storeId string) ApiKeyValueStoreRecordsGetRequest { - return ApiKeyValueStoreRecordsGetRequest{ - ApiService: a, - ctx: ctx, - storeId: storeId, - } -} - -// Execute executes the request -// @return *os.File -func (a *StorageKeyValueStoresAPIService) KeyValueStoreRecordsGetExecute(r ApiKeyValueStoreRecordsGetRequest) (*os.File, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *os.File - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StorageKeyValueStoresAPIService.KeyValueStoreRecordsGet") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/key-value-stores/{storeId}/records" - localVarPath = strings.Replace(localVarPath, "{"+"storeId"+"}", url.PathEscape(parameterValueToString(r.storeId, "storeId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if r.collection != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "collection", r.collection, "form", "") - } - if r.prefix != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "prefix", r.prefix, "form", "") - } - if r.signature != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "signature", r.signature, "form", "") - } - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/zip", "application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiKeyValueStoresGetRequest struct { - ctx context.Context - ApiService *StorageKeyValueStoresAPIService - offset *float64 - limit *float64 - desc *bool - unnamed *bool - ownership *StorageOwnership -} - -// Number of items that should be skipped at the start. The default value is `0`. -func (r ApiKeyValueStoresGetRequest) Offset(offset float64) ApiKeyValueStoresGetRequest { - r.offset = &offset - return r -} - -// Maximum number of items to return. The default value as well as the maximum is `1000`. -func (r ApiKeyValueStoresGetRequest) Limit(limit float64) ApiKeyValueStoresGetRequest { - r.limit = &limit - return r -} - -// If `true` or `1` then the objects are sorted by the `createdAt` field in descending order. By default, they are sorted in ascending order. -func (r ApiKeyValueStoresGetRequest) Desc(desc bool) ApiKeyValueStoresGetRequest { - r.desc = &desc - return r -} - -// If `true` or `1` then all the storages are returned. By default, only named storages are returned. -func (r ApiKeyValueStoresGetRequest) Unnamed(unnamed bool) ApiKeyValueStoresGetRequest { - r.unnamed = &unnamed - return r -} - -// Filter by ownership. If this parameter is omitted, all accessible key-value stores are returned. - `ownedByMe`: Return only key-value stores owned by the user. - `sharedWithMe`: Return only key-value stores shared with the user by other users. -func (r ApiKeyValueStoresGetRequest) Ownership(ownership StorageOwnership) ApiKeyValueStoresGetRequest { - r.ownership = &ownership - return r -} - -func (r ApiKeyValueStoresGetRequest) Execute() (*ListOfKeyValueStoresResponse, *http.Response, error) { - return r.ApiService.KeyValueStoresGetExecute(r) -} - -/* -KeyValueStoresGet Get list of key-value stores - -Gets the list of key-value stores owned by the user. - -The response is a list of objects, where each objects contains a basic -information about a single key-value store. - -The endpoint supports pagination using the `limit` and `offset` parameters -and it will not return more than 1000 array elements. - -By default, the records are sorted by the `createdAt` field in ascending -order, therefore you can use pagination to incrementally fetch all key-value stores -while new ones are still being created. To sort the records in descending order, use -the `desc=1` parameter. - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return ApiKeyValueStoresGetRequest -*/ -func (a *StorageKeyValueStoresAPIService) KeyValueStoresGet(ctx context.Context) ApiKeyValueStoresGetRequest { - return ApiKeyValueStoresGetRequest{ - ApiService: a, - ctx: ctx, - } -} - -// Execute executes the request -// @return ListOfKeyValueStoresResponse -func (a *StorageKeyValueStoresAPIService) KeyValueStoresGetExecute(r ApiKeyValueStoresGetRequest) (*ListOfKeyValueStoresResponse, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *ListOfKeyValueStoresResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StorageKeyValueStoresAPIService.KeyValueStoresGet") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/key-value-stores" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if r.offset != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "form", "") - } - if r.limit != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "form", "") - } - if r.desc != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "desc", r.desc, "form", "") - } - if r.unnamed != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "unnamed", r.unnamed, "form", "") - } - if r.ownership != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "ownership", r.ownership, "form", "") - } - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiKeyValueStoresPostRequest struct { - ctx context.Context - ApiService *StorageKeyValueStoresAPIService - name *string -} - -// Custom unique name to easily identify the store in the future. -func (r ApiKeyValueStoresPostRequest) Name(name string) ApiKeyValueStoresPostRequest { - r.name = &name - return r -} - -func (r ApiKeyValueStoresPostRequest) Execute() (*KeyValueStoreResponse, *http.Response, error) { - return r.ApiService.KeyValueStoresPostExecute(r) -} - -/* -KeyValueStoresPost Create key-value store - -Creates a key-value store and returns its object. The response is the same -object as returned by the [Get store](#/reference/key-value-stores/store-object/get-store) -endpoint. - -Keep in mind that data stored under unnamed store follows [data retention -period](https://docs.apify.com/platform/storage#data-retention). - -It creates a store with the given name if the parameter name is used. -If there is another store with the same name, the endpoint does not create a -new one and returns the existing object instead. - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return ApiKeyValueStoresPostRequest -*/ -func (a *StorageKeyValueStoresAPIService) KeyValueStoresPost(ctx context.Context) ApiKeyValueStoresPostRequest { - return ApiKeyValueStoresPostRequest{ - ApiService: a, - ctx: ctx, - } -} - -// Execute executes the request -// @return KeyValueStoreResponse -func (a *StorageKeyValueStoresAPIService) KeyValueStoresPostExecute(r ApiKeyValueStoresPostRequest) (*KeyValueStoreResponse, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodPost - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *KeyValueStoreResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StorageKeyValueStoresAPIService.KeyValueStoresPost") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/key-value-stores" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if r.name != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "name", r.name, "form", "") - } - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} diff --git a/api_storage_request_queues.go b/api_storage_request_queues.go deleted file mode 100644 index 7c25faa..0000000 --- a/api_storage_request_queues.go +++ /dev/null @@ -1,1503 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "bytes" - "context" - "io" - "net/http" - "net/url" - "strings" -) - - -// StorageRequestQueuesAPIService StorageRequestQueuesAPI service -type StorageRequestQueuesAPIService service - -type ApiRequestQueueDeleteRequest struct { - ctx context.Context - ApiService *StorageRequestQueuesAPIService - queueId string -} - -func (r ApiRequestQueueDeleteRequest) Execute() (*http.Response, error) { - return r.ApiService.RequestQueueDeleteExecute(r) -} - -/* -RequestQueueDelete Delete request queue - -Deletes given queue. - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param queueId Queue ID or `username~queue-name`. - @return ApiRequestQueueDeleteRequest -*/ -func (a *StorageRequestQueuesAPIService) RequestQueueDelete(ctx context.Context, queueId string) ApiRequestQueueDeleteRequest { - return ApiRequestQueueDeleteRequest{ - ApiService: a, - ctx: ctx, - queueId: queueId, - } -} - -// Execute executes the request -func (a *StorageRequestQueuesAPIService) RequestQueueDeleteExecute(r ApiRequestQueueDeleteRequest) (*http.Response, error) { - var ( - localVarHTTPMethod = http.MethodDelete - localVarPostBody interface{} - formFiles []formFile - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StorageRequestQueuesAPIService.RequestQueueDelete") - if err != nil { - return nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/request-queues/{queueId}" - localVarPath = strings.Replace(localVarPath, "{"+"queueId"+"}", url.PathEscape(parameterValueToString(r.queueId, "queueId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarHTTPResponse, newErr - } - - return localVarHTTPResponse, nil -} - -type ApiRequestQueueGetRequest struct { - ctx context.Context - ApiService *StorageRequestQueuesAPIService - queueId string -} - -func (r ApiRequestQueueGetRequest) Execute() (*RequestQueueResponse, *http.Response, error) { - return r.ApiService.RequestQueueGetExecute(r) -} - -/* -RequestQueueGet Get request queue - -Returns queue object for given queue ID. - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param queueId Queue ID or `username~queue-name`. - @return ApiRequestQueueGetRequest -*/ -func (a *StorageRequestQueuesAPIService) RequestQueueGet(ctx context.Context, queueId string) ApiRequestQueueGetRequest { - return ApiRequestQueueGetRequest{ - ApiService: a, - ctx: ctx, - queueId: queueId, - } -} - -// Execute executes the request -// @return RequestQueueResponse -func (a *StorageRequestQueuesAPIService) RequestQueueGetExecute(r ApiRequestQueueGetRequest) (*RequestQueueResponse, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *RequestQueueResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StorageRequestQueuesAPIService.RequestQueueGet") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/request-queues/{queueId}" - localVarPath = strings.Replace(localVarPath, "{"+"queueId"+"}", url.PathEscape(parameterValueToString(r.queueId, "queueId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiRequestQueuePutRequest struct { - ctx context.Context - ApiService *StorageRequestQueuesAPIService - queueId string - updateRequestQueueRequest *UpdateRequestQueueRequest -} - -// -func (r ApiRequestQueuePutRequest) UpdateRequestQueueRequest(updateRequestQueueRequest UpdateRequestQueueRequest) ApiRequestQueuePutRequest { - r.updateRequestQueueRequest = &updateRequestQueueRequest - return r -} - -func (r ApiRequestQueuePutRequest) Execute() (*RequestQueueResponse, *http.Response, error) { - return r.ApiService.RequestQueuePutExecute(r) -} - -/* -RequestQueuePut Update request queue - -Updates a request queue's name and general resource access level using a value specified by a JSON object -passed in the PUT payload. - -The response is the updated request queue object, as returned by the -[Get request queue](#/reference/request-queues/queue-collection/get-request-queue) API endpoint. - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param queueId Queue ID or `username~queue-name`. - @return ApiRequestQueuePutRequest -*/ -func (a *StorageRequestQueuesAPIService) RequestQueuePut(ctx context.Context, queueId string) ApiRequestQueuePutRequest { - return ApiRequestQueuePutRequest{ - ApiService: a, - ctx: ctx, - queueId: queueId, - } -} - -// Execute executes the request -// @return RequestQueueResponse -func (a *StorageRequestQueuesAPIService) RequestQueuePutExecute(r ApiRequestQueuePutRequest) (*RequestQueueResponse, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodPut - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *RequestQueueResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StorageRequestQueuesAPIService.RequestQueuePut") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/request-queues/{queueId}" - localVarPath = strings.Replace(localVarPath, "{"+"queueId"+"}", url.PathEscape(parameterValueToString(r.queueId, "queueId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - if r.updateRequestQueueRequest == nil { - return localVarReturnValue, nil, reportError("updateRequestQueueRequest is required and must be specified") - } - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/json"} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - // body params - localVarPostBody = r.updateRequestQueueRequest - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 413 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 415 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiRequestQueueRequestsBatchDeleteRequest struct { - ctx context.Context - ApiService *StorageRequestQueuesAPIService - queueId string - contentType *string - requestDraftDelete *[]RequestDraftDelete - clientKey *string -} - -// -func (r ApiRequestQueueRequestsBatchDeleteRequest) ContentType(contentType string) ApiRequestQueueRequestsBatchDeleteRequest { - r.contentType = &contentType - return r -} - -// -func (r ApiRequestQueueRequestsBatchDeleteRequest) RequestDraftDelete(requestDraftDelete []RequestDraftDelete) ApiRequestQueueRequestsBatchDeleteRequest { - r.requestDraftDelete = &requestDraftDelete - return r -} - -// A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. -func (r ApiRequestQueueRequestsBatchDeleteRequest) ClientKey(clientKey string) ApiRequestQueueRequestsBatchDeleteRequest { - r.clientKey = &clientKey - return r -} - -func (r ApiRequestQueueRequestsBatchDeleteRequest) Execute() (*BatchDeleteResponse, *http.Response, error) { - return r.ApiService.RequestQueueRequestsBatchDeleteExecute(r) -} - -/* -RequestQueueRequestsBatchDelete Delete requests - -Batch-deletes given requests from the queue. The number of requests in a -batch is limited to 25. The response contains an array of unprocessed and -processed requests. -If any delete operation fails because the request queue rate limit is -exceeded or an internal failure occurs, -the failed request is returned in the `unprocessedRequests` response -parameter. -You can re-send these delete requests. It is recommended to use an -exponential backoff algorithm for these retries. -Each request is identified by its ID or uniqueKey parameter. You can use -either of them to identify the request. - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param queueId Queue ID or `username~queue-name`. - @return ApiRequestQueueRequestsBatchDeleteRequest -*/ -func (a *StorageRequestQueuesAPIService) RequestQueueRequestsBatchDelete(ctx context.Context, queueId string) ApiRequestQueueRequestsBatchDeleteRequest { - return ApiRequestQueueRequestsBatchDeleteRequest{ - ApiService: a, - ctx: ctx, - queueId: queueId, - } -} - -// Execute executes the request -// @return BatchDeleteResponse -func (a *StorageRequestQueuesAPIService) RequestQueueRequestsBatchDeleteExecute(r ApiRequestQueueRequestsBatchDeleteRequest) (*BatchDeleteResponse, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodDelete - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *BatchDeleteResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StorageRequestQueuesAPIService.RequestQueueRequestsBatchDelete") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/request-queues/{queueId}/requests/batch" - localVarPath = strings.Replace(localVarPath, "{"+"queueId"+"}", url.PathEscape(parameterValueToString(r.queueId, "queueId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - if r.contentType == nil { - return localVarReturnValue, nil, reportError("contentType is required and must be specified") - } - if r.requestDraftDelete == nil { - return localVarReturnValue, nil, reportError("requestDraftDelete is required and must be specified") - } - - if r.clientKey != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "clientKey", r.clientKey, "form", "") - } - // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/json"} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - parameterAddToHeaderOrQuery(localVarHeaderParams, "Content-Type", r.contentType, "simple", "") - // body params - localVarPostBody = r.requestDraftDelete - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 413 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 415 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiRequestQueueRequestsBatchPostRequest struct { - ctx context.Context - ApiService *StorageRequestQueuesAPIService - queueId string - requestBase *[]RequestBase - clientKey *string - forefront *string -} - -// -func (r ApiRequestQueueRequestsBatchPostRequest) RequestBase(requestBase []RequestBase) ApiRequestQueueRequestsBatchPostRequest { - r.requestBase = &requestBase - return r -} - -// A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. -func (r ApiRequestQueueRequestsBatchPostRequest) ClientKey(clientKey string) ApiRequestQueueRequestsBatchPostRequest { - r.clientKey = &clientKey - return r -} - -// Determines if request should be added to the head of the queue or to the end. Default value is `false` (end of queue). -func (r ApiRequestQueueRequestsBatchPostRequest) Forefront(forefront string) ApiRequestQueueRequestsBatchPostRequest { - r.forefront = &forefront - return r -} - -func (r ApiRequestQueueRequestsBatchPostRequest) Execute() (*BatchAddResponse, *http.Response, error) { - return r.ApiService.RequestQueueRequestsBatchPostExecute(r) -} - -/* -RequestQueueRequestsBatchPost Add requests - -Adds requests to the queue in batch. The maximum requests in batch is limited -to 25. The response contains an array of unprocessed and processed requests. -If any add operation fails because the request queue rate limit is exceeded -or an internal failure occurs, -the failed request is returned in the unprocessedRequests response -parameter. -You can resend these requests to add. It is recommended to use an -exponential backoff algorithm for these retries. -If a request with the same `uniqueKey` was already present in the queue, -then it returns an ID of the existing request. - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param queueId Queue ID or `username~queue-name`. - @return ApiRequestQueueRequestsBatchPostRequest -*/ -func (a *StorageRequestQueuesAPIService) RequestQueueRequestsBatchPost(ctx context.Context, queueId string) ApiRequestQueueRequestsBatchPostRequest { - return ApiRequestQueueRequestsBatchPostRequest{ - ApiService: a, - ctx: ctx, - queueId: queueId, - } -} - -// Execute executes the request -// @return BatchAddResponse -func (a *StorageRequestQueuesAPIService) RequestQueueRequestsBatchPostExecute(r ApiRequestQueueRequestsBatchPostRequest) (*BatchAddResponse, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodPost - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *BatchAddResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StorageRequestQueuesAPIService.RequestQueueRequestsBatchPost") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/request-queues/{queueId}/requests/batch" - localVarPath = strings.Replace(localVarPath, "{"+"queueId"+"}", url.PathEscape(parameterValueToString(r.queueId, "queueId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - if r.requestBase == nil { - return localVarReturnValue, nil, reportError("requestBase is required and must be specified") - } - - if r.clientKey != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "clientKey", r.clientKey, "form", "") - } - if r.forefront != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "forefront", r.forefront, "form", "") - } - // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/json"} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - // body params - localVarPostBody = r.requestBase - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 413 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 415 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiRequestQueuesGetRequest struct { - ctx context.Context - ApiService *StorageRequestQueuesAPIService - offset *float64 - limit *float64 - desc *bool - unnamed *bool - ownership *StorageOwnership -} - -// Number of items that should be skipped at the start. The default value is `0`. -func (r ApiRequestQueuesGetRequest) Offset(offset float64) ApiRequestQueuesGetRequest { - r.offset = &offset - return r -} - -// Maximum number of items to return. The default value as well as the maximum is `1000`. -func (r ApiRequestQueuesGetRequest) Limit(limit float64) ApiRequestQueuesGetRequest { - r.limit = &limit - return r -} - -// If `true` or `1` then the objects are sorted by the `createdAt` field in descending order. By default, they are sorted in ascending order. -func (r ApiRequestQueuesGetRequest) Desc(desc bool) ApiRequestQueuesGetRequest { - r.desc = &desc - return r -} - -// If `true` or `1` then all the storages are returned. By default, only named storages are returned. -func (r ApiRequestQueuesGetRequest) Unnamed(unnamed bool) ApiRequestQueuesGetRequest { - r.unnamed = &unnamed - return r -} - -// Filter by ownership. If this parameter is omitted, all accessible request queues are returned. - `ownedByMe`: Return only request queues owned by the user. - `sharedWithMe`: Return only request queues shared with the user by other users. -func (r ApiRequestQueuesGetRequest) Ownership(ownership StorageOwnership) ApiRequestQueuesGetRequest { - r.ownership = &ownership - return r -} - -func (r ApiRequestQueuesGetRequest) Execute() (*ListOfRequestQueuesResponse, *http.Response, error) { - return r.ApiService.RequestQueuesGetExecute(r) -} - -/* -RequestQueuesGet Get list of request queues - -Lists all of a user's request queues. The response is a JSON array of -objects, where each object -contains basic information about one queue. - -By default, the objects are sorted by the `createdAt` field in ascending order, -therefore you can use pagination to incrementally fetch all queues while new -ones are still being created. To sort them in descending order, use `desc=1` -parameter. The endpoint supports pagination using `limit` and `offset` -parameters and it will not return more than 1000 -array elements. - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return ApiRequestQueuesGetRequest -*/ -func (a *StorageRequestQueuesAPIService) RequestQueuesGet(ctx context.Context) ApiRequestQueuesGetRequest { - return ApiRequestQueuesGetRequest{ - ApiService: a, - ctx: ctx, - } -} - -// Execute executes the request -// @return ListOfRequestQueuesResponse -func (a *StorageRequestQueuesAPIService) RequestQueuesGetExecute(r ApiRequestQueuesGetRequest) (*ListOfRequestQueuesResponse, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *ListOfRequestQueuesResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StorageRequestQueuesAPIService.RequestQueuesGet") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/request-queues" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if r.offset != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "form", "") - } - if r.limit != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "form", "") - } - if r.desc != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "desc", r.desc, "form", "") - } - if r.unnamed != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "unnamed", r.unnamed, "form", "") - } - if r.ownership != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "ownership", r.ownership, "form", "") - } - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiRequestQueuesPostRequest struct { - ctx context.Context - ApiService *StorageRequestQueuesAPIService - name *string -} - -// Custom unique name to easily identify the queue in the future. -func (r ApiRequestQueuesPostRequest) Name(name string) ApiRequestQueuesPostRequest { - r.name = &name - return r -} - -func (r ApiRequestQueuesPostRequest) Execute() (*RequestQueueResponse, *http.Response, error) { - return r.ApiService.RequestQueuesPostExecute(r) -} - -/* -RequestQueuesPost Create request queue - -Creates a request queue and returns its object. -Keep in mind that requests stored under unnamed queue follows [data -retention period](https://docs.apify.com/platform/storage#data-retention). - -It creates a queue of given name if the parameter name is used. If a queue -with the given name already exists then the endpoint returns -its object. - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return ApiRequestQueuesPostRequest -*/ -func (a *StorageRequestQueuesAPIService) RequestQueuesPost(ctx context.Context) ApiRequestQueuesPostRequest { - return ApiRequestQueuesPostRequest{ - ApiService: a, - ctx: ctx, - } -} - -// Execute executes the request -// @return RequestQueueResponse -func (a *StorageRequestQueuesAPIService) RequestQueuesPostExecute(r ApiRequestQueuesPostRequest) (*RequestQueueResponse, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodPost - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *RequestQueueResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StorageRequestQueuesAPIService.RequestQueuesPost") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/request-queues" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if r.name != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "name", r.name, "form", "") - } - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} diff --git a/api_storage_request_queues_requests.go b/api_storage_request_queues_requests.go deleted file mode 100644 index 55d4054..0000000 --- a/api_storage_request_queues_requests.go +++ /dev/null @@ -1,1114 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "bytes" - "context" - "io" - "net/http" - "net/url" - "strings" -) - - -// StorageRequestQueuesRequestsAPIService StorageRequestQueuesRequestsAPI service -type StorageRequestQueuesRequestsAPIService service - -type ApiRequestQueueRequestDeleteRequest struct { - ctx context.Context - ApiService *StorageRequestQueuesRequestsAPIService - queueId string - requestId string - clientKey *string -} - -// A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. -func (r ApiRequestQueueRequestDeleteRequest) ClientKey(clientKey string) ApiRequestQueueRequestDeleteRequest { - r.clientKey = &clientKey - return r -} - -func (r ApiRequestQueueRequestDeleteRequest) Execute() (*http.Response, error) { - return r.ApiService.RequestQueueRequestDeleteExecute(r) -} - -/* -RequestQueueRequestDelete Delete request - -Deletes given request from queue. - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param queueId Queue ID or `username~queue-name`. - @param requestId Request ID. - @return ApiRequestQueueRequestDeleteRequest -*/ -func (a *StorageRequestQueuesRequestsAPIService) RequestQueueRequestDelete(ctx context.Context, queueId string, requestId string) ApiRequestQueueRequestDeleteRequest { - return ApiRequestQueueRequestDeleteRequest{ - ApiService: a, - ctx: ctx, - queueId: queueId, - requestId: requestId, - } -} - -// Execute executes the request -func (a *StorageRequestQueuesRequestsAPIService) RequestQueueRequestDeleteExecute(r ApiRequestQueueRequestDeleteRequest) (*http.Response, error) { - var ( - localVarHTTPMethod = http.MethodDelete - localVarPostBody interface{} - formFiles []formFile - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StorageRequestQueuesRequestsAPIService.RequestQueueRequestDelete") - if err != nil { - return nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/request-queues/{queueId}/requests/{requestId}" - localVarPath = strings.Replace(localVarPath, "{"+"queueId"+"}", url.PathEscape(parameterValueToString(r.queueId, "queueId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"requestId"+"}", url.PathEscape(parameterValueToString(r.requestId, "requestId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if r.clientKey != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "clientKey", r.clientKey, "form", "") - } - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarHTTPResponse, newErr - } - - return localVarHTTPResponse, nil -} - -type ApiRequestQueueRequestGetRequest struct { - ctx context.Context - ApiService *StorageRequestQueuesRequestsAPIService - queueId string - requestId string -} - -func (r ApiRequestQueueRequestGetRequest) Execute() (*RequestResponse, *http.Response, error) { - return r.ApiService.RequestQueueRequestGetExecute(r) -} - -/* -RequestQueueRequestGet Get request - -Returns request from queue. - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param queueId Queue ID or `username~queue-name`. - @param requestId Request ID. - @return ApiRequestQueueRequestGetRequest -*/ -func (a *StorageRequestQueuesRequestsAPIService) RequestQueueRequestGet(ctx context.Context, queueId string, requestId string) ApiRequestQueueRequestGetRequest { - return ApiRequestQueueRequestGetRequest{ - ApiService: a, - ctx: ctx, - queueId: queueId, - requestId: requestId, - } -} - -// Execute executes the request -// @return RequestResponse -func (a *StorageRequestQueuesRequestsAPIService) RequestQueueRequestGetExecute(r ApiRequestQueueRequestGetRequest) (*RequestResponse, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *RequestResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StorageRequestQueuesRequestsAPIService.RequestQueueRequestGet") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/request-queues/{queueId}/requests/{requestId}" - localVarPath = strings.Replace(localVarPath, "{"+"queueId"+"}", url.PathEscape(parameterValueToString(r.queueId, "queueId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"requestId"+"}", url.PathEscape(parameterValueToString(r.requestId, "requestId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiRequestQueueRequestPutRequest struct { - ctx context.Context - ApiService *StorageRequestQueuesRequestsAPIService - queueId string - requestId string - request *Request - forefront *string - clientKey *string -} - -// -func (r ApiRequestQueueRequestPutRequest) Request(request Request) ApiRequestQueueRequestPutRequest { - r.request = &request - return r -} - -// Determines if request should be added to the head of the queue or to the end. Default value is `false` (end of queue). -func (r ApiRequestQueueRequestPutRequest) Forefront(forefront string) ApiRequestQueueRequestPutRequest { - r.forefront = &forefront - return r -} - -// A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. -func (r ApiRequestQueueRequestPutRequest) ClientKey(clientKey string) ApiRequestQueueRequestPutRequest { - r.clientKey = &clientKey - return r -} - -func (r ApiRequestQueueRequestPutRequest) Execute() (*UpdateRequestResponse, *http.Response, error) { - return r.ApiService.RequestQueueRequestPutExecute(r) -} - -/* -RequestQueueRequestPut Update request - -Updates a request in a queue. Mark request as handled by setting -`request.handledAt = new Date()`. -If `handledAt` is set, the request will be removed from head of the queue (and unlocked, if applicable). - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param queueId Queue ID or `username~queue-name`. - @param requestId Request ID. - @return ApiRequestQueueRequestPutRequest -*/ -func (a *StorageRequestQueuesRequestsAPIService) RequestQueueRequestPut(ctx context.Context, queueId string, requestId string) ApiRequestQueueRequestPutRequest { - return ApiRequestQueueRequestPutRequest{ - ApiService: a, - ctx: ctx, - queueId: queueId, - requestId: requestId, - } -} - -// Execute executes the request -// @return UpdateRequestResponse -func (a *StorageRequestQueuesRequestsAPIService) RequestQueueRequestPutExecute(r ApiRequestQueueRequestPutRequest) (*UpdateRequestResponse, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodPut - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *UpdateRequestResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StorageRequestQueuesRequestsAPIService.RequestQueueRequestPut") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/request-queues/{queueId}/requests/{requestId}" - localVarPath = strings.Replace(localVarPath, "{"+"queueId"+"}", url.PathEscape(parameterValueToString(r.queueId, "queueId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"requestId"+"}", url.PathEscape(parameterValueToString(r.requestId, "requestId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - if r.request == nil { - return localVarReturnValue, nil, reportError("request is required and must be specified") - } - - if r.forefront != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "forefront", r.forefront, "form", "") - } - if r.clientKey != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "clientKey", r.clientKey, "form", "") - } - // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/json"} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - // body params - localVarPostBody = r.request - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 413 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 415 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiRequestQueueRequestsGetRequest struct { - ctx context.Context - ApiService *StorageRequestQueuesRequestsAPIService - queueId string - clientKey *string - exclusiveStartId *string - limit *float64 - cursor *string - filter *[]string -} - -// A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. -func (r ApiRequestQueueRequestsGetRequest) ClientKey(clientKey string) ApiRequestQueueRequestsGetRequest { - r.clientKey = &clientKey - return r -} - -// All requests up to this one (including) are skipped from the result. (Deprecated, use `cursor` instead.) -// Deprecated -func (r ApiRequestQueueRequestsGetRequest) ExclusiveStartId(exclusiveStartId string) ApiRequestQueueRequestsGetRequest { - r.exclusiveStartId = &exclusiveStartId - return r -} - -// Number of keys to be returned. Maximum value is `10000`. -func (r ApiRequestQueueRequestsGetRequest) Limit(limit float64) ApiRequestQueueRequestsGetRequest { - r.limit = &limit - return r -} - -// A cursor string for pagination, returned in the previous response as `nextCursor`. Use this to retrieve the next page of requests. -func (r ApiRequestQueueRequestsGetRequest) Cursor(cursor string) ApiRequestQueueRequestsGetRequest { - r.cursor = &cursor - return r -} - -// Filter requests by their state. Possible values are `locked` and `pending`. You can combine multiple values separated by commas, which will mean the union of these filters – requests matching any of the specified states will be returned. (Not compatible with deprecated `exclusiveStartId` parameter.) -func (r ApiRequestQueueRequestsGetRequest) Filter(filter []string) ApiRequestQueueRequestsGetRequest { - r.filter = &filter - return r -} - -func (r ApiRequestQueueRequestsGetRequest) Execute() (*ListOfRequestsResponse, *http.Response, error) { - return r.ApiService.RequestQueueRequestsGetExecute(r) -} - -/* -RequestQueueRequestsGet List requests - -Returns a list of requests. This endpoint is paginated using -cursor (pagination by `exclusiveStartId` is deprecated) and limit parameters. - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param queueId Queue ID or `username~queue-name`. - @return ApiRequestQueueRequestsGetRequest -*/ -func (a *StorageRequestQueuesRequestsAPIService) RequestQueueRequestsGet(ctx context.Context, queueId string) ApiRequestQueueRequestsGetRequest { - return ApiRequestQueueRequestsGetRequest{ - ApiService: a, - ctx: ctx, - queueId: queueId, - } -} - -// Execute executes the request -// @return ListOfRequestsResponse -func (a *StorageRequestQueuesRequestsAPIService) RequestQueueRequestsGetExecute(r ApiRequestQueueRequestsGetRequest) (*ListOfRequestsResponse, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *ListOfRequestsResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StorageRequestQueuesRequestsAPIService.RequestQueueRequestsGet") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/request-queues/{queueId}/requests" - localVarPath = strings.Replace(localVarPath, "{"+"queueId"+"}", url.PathEscape(parameterValueToString(r.queueId, "queueId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if r.clientKey != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "clientKey", r.clientKey, "form", "") - } - if r.exclusiveStartId != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "exclusiveStartId", r.exclusiveStartId, "form", "") - } - if r.limit != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "form", "") - } - if r.cursor != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "cursor", r.cursor, "form", "") - } - if r.filter != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "filter", r.filter, "form", "csv") - } - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiRequestQueueRequestsPostRequest struct { - ctx context.Context - ApiService *StorageRequestQueuesRequestsAPIService - queueId string - requestBase *RequestBase - clientKey *string - forefront *string -} - -// -func (r ApiRequestQueueRequestsPostRequest) RequestBase(requestBase RequestBase) ApiRequestQueueRequestsPostRequest { - r.requestBase = &requestBase - return r -} - -// A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. -func (r ApiRequestQueueRequestsPostRequest) ClientKey(clientKey string) ApiRequestQueueRequestsPostRequest { - r.clientKey = &clientKey - return r -} - -// Determines if request should be added to the head of the queue or to the end. Default value is `false` (end of queue). -func (r ApiRequestQueueRequestsPostRequest) Forefront(forefront string) ApiRequestQueueRequestsPostRequest { - r.forefront = &forefront - return r -} - -func (r ApiRequestQueueRequestsPostRequest) Execute() (*AddRequestResponse, *http.Response, error) { - return r.ApiService.RequestQueueRequestsPostExecute(r) -} - -/* -RequestQueueRequestsPost Add request - -Adds request to the queue. Response contains ID of the request and info if -request was already present in the queue or handled. - -If request with same `uniqueKey` was already present in the queue then -returns an ID of existing request. - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param queueId Queue ID or `username~queue-name`. - @return ApiRequestQueueRequestsPostRequest -*/ -func (a *StorageRequestQueuesRequestsAPIService) RequestQueueRequestsPost(ctx context.Context, queueId string) ApiRequestQueueRequestsPostRequest { - return ApiRequestQueueRequestsPostRequest{ - ApiService: a, - ctx: ctx, - queueId: queueId, - } -} - -// Execute executes the request -// @return AddRequestResponse -func (a *StorageRequestQueuesRequestsAPIService) RequestQueueRequestsPostExecute(r ApiRequestQueueRequestsPostRequest) (*AddRequestResponse, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodPost - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *AddRequestResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StorageRequestQueuesRequestsAPIService.RequestQueueRequestsPost") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/request-queues/{queueId}/requests" - localVarPath = strings.Replace(localVarPath, "{"+"queueId"+"}", url.PathEscape(parameterValueToString(r.queueId, "queueId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - if r.requestBase == nil { - return localVarReturnValue, nil, reportError("requestBase is required and must be specified") - } - - if r.clientKey != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "clientKey", r.clientKey, "form", "") - } - if r.forefront != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "forefront", r.forefront, "form", "") - } - // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/json"} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - // body params - localVarPostBody = r.requestBase - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 413 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 415 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} diff --git a/api_storage_request_queues_requests_locks.go b/api_storage_request_queues_requests_locks.go deleted file mode 100644 index b5df458..0000000 --- a/api_storage_request_queues_requests_locks.go +++ /dev/null @@ -1,1076 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "bytes" - "context" - "io" - "net/http" - "net/url" - "strings" -) - - -// StorageRequestQueuesRequestsLocksAPIService StorageRequestQueuesRequestsLocksAPI service -type StorageRequestQueuesRequestsLocksAPIService service - -type ApiRequestQueueHeadGetRequest struct { - ctx context.Context - ApiService *StorageRequestQueuesRequestsLocksAPIService - queueId string - limit *float64 - clientKey *string -} - -// How many items from queue should be returned. -func (r ApiRequestQueueHeadGetRequest) Limit(limit float64) ApiRequestQueueHeadGetRequest { - r.limit = &limit - return r -} - -// A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. -func (r ApiRequestQueueHeadGetRequest) ClientKey(clientKey string) ApiRequestQueueHeadGetRequest { - r.clientKey = &clientKey - return r -} - -func (r ApiRequestQueueHeadGetRequest) Execute() (*HeadResponse, *http.Response, error) { - return r.ApiService.RequestQueueHeadGetExecute(r) -} - -/* -RequestQueueHeadGet Get head - -Returns given number of first requests from the queue. - -The response contains the `hadMultipleClients` boolean field which indicates -that the queue was accessed by more than one client (with unique or empty -`clientKey`). -This field is used by [Apify SDK](https://sdk.apify.com) to determine -whether the local cache is consistent with the request queue, and thus -optimize performance of certain operations. - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param queueId Queue ID or `username~queue-name`. - @return ApiRequestQueueHeadGetRequest -*/ -func (a *StorageRequestQueuesRequestsLocksAPIService) RequestQueueHeadGet(ctx context.Context, queueId string) ApiRequestQueueHeadGetRequest { - return ApiRequestQueueHeadGetRequest{ - ApiService: a, - ctx: ctx, - queueId: queueId, - } -} - -// Execute executes the request -// @return HeadResponse -func (a *StorageRequestQueuesRequestsLocksAPIService) RequestQueueHeadGetExecute(r ApiRequestQueueHeadGetRequest) (*HeadResponse, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *HeadResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StorageRequestQueuesRequestsLocksAPIService.RequestQueueHeadGet") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/request-queues/{queueId}/head" - localVarPath = strings.Replace(localVarPath, "{"+"queueId"+"}", url.PathEscape(parameterValueToString(r.queueId, "queueId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if r.limit != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "form", "") - } - if r.clientKey != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "clientKey", r.clientKey, "form", "") - } - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiRequestQueueHeadLockPostRequest struct { - ctx context.Context - ApiService *StorageRequestQueuesRequestsLocksAPIService - queueId string - lockSecs *float64 - limit *float64 - clientKey *string -} - -// How long the requests will be locked for (in seconds). -func (r ApiRequestQueueHeadLockPostRequest) LockSecs(lockSecs float64) ApiRequestQueueHeadLockPostRequest { - r.lockSecs = &lockSecs - return r -} - -// How many items from the queue should be returned. -func (r ApiRequestQueueHeadLockPostRequest) Limit(limit float64) ApiRequestQueueHeadLockPostRequest { - r.limit = &limit - return r -} - -// A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. -func (r ApiRequestQueueHeadLockPostRequest) ClientKey(clientKey string) ApiRequestQueueHeadLockPostRequest { - r.clientKey = &clientKey - return r -} - -func (r ApiRequestQueueHeadLockPostRequest) Execute() (*HeadAndLockResponse, *http.Response, error) { - return r.ApiService.RequestQueueHeadLockPostExecute(r) -} - -/* -RequestQueueHeadLockPost Get head and lock - -Returns the given number of first requests from the queue and locks them for -the given time. - -If this endpoint locks the request, no other client or run will be able to get and -lock these requests. - -The response contains the `hadMultipleClients` boolean field which indicates -that the queue was accessed by more than one client (with unique or empty -`clientKey`). - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param queueId Queue ID or `username~queue-name`. - @return ApiRequestQueueHeadLockPostRequest -*/ -func (a *StorageRequestQueuesRequestsLocksAPIService) RequestQueueHeadLockPost(ctx context.Context, queueId string) ApiRequestQueueHeadLockPostRequest { - return ApiRequestQueueHeadLockPostRequest{ - ApiService: a, - ctx: ctx, - queueId: queueId, - } -} - -// Execute executes the request -// @return HeadAndLockResponse -func (a *StorageRequestQueuesRequestsLocksAPIService) RequestQueueHeadLockPostExecute(r ApiRequestQueueHeadLockPostRequest) (*HeadAndLockResponse, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodPost - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *HeadAndLockResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StorageRequestQueuesRequestsLocksAPIService.RequestQueueHeadLockPost") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/request-queues/{queueId}/head/lock" - localVarPath = strings.Replace(localVarPath, "{"+"queueId"+"}", url.PathEscape(parameterValueToString(r.queueId, "queueId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - if r.lockSecs == nil { - return localVarReturnValue, nil, reportError("lockSecs is required and must be specified") - } - - parameterAddToHeaderOrQuery(localVarQueryParams, "lockSecs", r.lockSecs, "form", "") - if r.limit != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "form", "") - } - if r.clientKey != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "clientKey", r.clientKey, "form", "") - } - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiRequestQueueRequestLockDeleteRequest struct { - ctx context.Context - ApiService *StorageRequestQueuesRequestsLocksAPIService - queueId string - requestId string - clientKey *string - forefront *string -} - -// A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. -func (r ApiRequestQueueRequestLockDeleteRequest) ClientKey(clientKey string) ApiRequestQueueRequestLockDeleteRequest { - r.clientKey = &clientKey - return r -} - -// Determines if request should be added to the head of the queue or to the end after lock was removed. -func (r ApiRequestQueueRequestLockDeleteRequest) Forefront(forefront string) ApiRequestQueueRequestLockDeleteRequest { - r.forefront = &forefront - return r -} - -func (r ApiRequestQueueRequestLockDeleteRequest) Execute() (*http.Response, error) { - return r.ApiService.RequestQueueRequestLockDeleteExecute(r) -} - -/* -RequestQueueRequestLockDelete Delete request lock - -Deletes a request lock. The request lock can be deleted only by the client -that has locked it using [Get and lock head -operation](#/request-queue-head-lock-post). - -The clientKey identifier is used for locking and unlocking requests. -You can delete or prolong the lock only for requests that were locked by the same client key or from the same Actor run. - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param queueId Queue ID or `username~queue-name`. - @param requestId Request ID. - @return ApiRequestQueueRequestLockDeleteRequest -*/ -func (a *StorageRequestQueuesRequestsLocksAPIService) RequestQueueRequestLockDelete(ctx context.Context, queueId string, requestId string) ApiRequestQueueRequestLockDeleteRequest { - return ApiRequestQueueRequestLockDeleteRequest{ - ApiService: a, - ctx: ctx, - queueId: queueId, - requestId: requestId, - } -} - -// Execute executes the request -func (a *StorageRequestQueuesRequestsLocksAPIService) RequestQueueRequestLockDeleteExecute(r ApiRequestQueueRequestLockDeleteRequest) (*http.Response, error) { - var ( - localVarHTTPMethod = http.MethodDelete - localVarPostBody interface{} - formFiles []formFile - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StorageRequestQueuesRequestsLocksAPIService.RequestQueueRequestLockDelete") - if err != nil { - return nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/request-queues/{queueId}/requests/{requestId}/lock" - localVarPath = strings.Replace(localVarPath, "{"+"queueId"+"}", url.PathEscape(parameterValueToString(r.queueId, "queueId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"requestId"+"}", url.PathEscape(parameterValueToString(r.requestId, "requestId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if r.clientKey != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "clientKey", r.clientKey, "form", "") - } - if r.forefront != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "forefront", r.forefront, "form", "") - } - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarHTTPResponse, newErr - } - - return localVarHTTPResponse, nil -} - -type ApiRequestQueueRequestLockPutRequest struct { - ctx context.Context - ApiService *StorageRequestQueuesRequestsLocksAPIService - queueId string - requestId string - lockSecs *float64 - clientKey *string - forefront *string -} - -// How long the requests will be locked for (in seconds). -func (r ApiRequestQueueRequestLockPutRequest) LockSecs(lockSecs float64) ApiRequestQueueRequestLockPutRequest { - r.lockSecs = &lockSecs - return r -} - -// A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. -func (r ApiRequestQueueRequestLockPutRequest) ClientKey(clientKey string) ApiRequestQueueRequestLockPutRequest { - r.clientKey = &clientKey - return r -} - -// Determines if request should be added to the head of the queue or to the end after lock expires. -func (r ApiRequestQueueRequestLockPutRequest) Forefront(forefront string) ApiRequestQueueRequestLockPutRequest { - r.forefront = &forefront - return r -} - -func (r ApiRequestQueueRequestLockPutRequest) Execute() (*ProlongRequestLockResponse, *http.Response, error) { - return r.ApiService.RequestQueueRequestLockPutExecute(r) -} - -/* -RequestQueueRequestLockPut Prolong request lock - -Prolongs request lock. The request lock can be prolonged only by the client -that has locked it using [Get and lock head -operation](#/request-queue-head-lock-post). - -The clientKey identifier is used for locking and unlocking requests. -You can delete or prolong the lock only for requests that were locked by the same client key or from the same Actor run. - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param queueId Queue ID or `username~queue-name`. - @param requestId Request ID. - @return ApiRequestQueueRequestLockPutRequest -*/ -func (a *StorageRequestQueuesRequestsLocksAPIService) RequestQueueRequestLockPut(ctx context.Context, queueId string, requestId string) ApiRequestQueueRequestLockPutRequest { - return ApiRequestQueueRequestLockPutRequest{ - ApiService: a, - ctx: ctx, - queueId: queueId, - requestId: requestId, - } -} - -// Execute executes the request -// @return ProlongRequestLockResponse -func (a *StorageRequestQueuesRequestsLocksAPIService) RequestQueueRequestLockPutExecute(r ApiRequestQueueRequestLockPutRequest) (*ProlongRequestLockResponse, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodPut - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *ProlongRequestLockResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StorageRequestQueuesRequestsLocksAPIService.RequestQueueRequestLockPut") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/request-queues/{queueId}/requests/{requestId}/lock" - localVarPath = strings.Replace(localVarPath, "{"+"queueId"+"}", url.PathEscape(parameterValueToString(r.queueId, "queueId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"requestId"+"}", url.PathEscape(parameterValueToString(r.requestId, "requestId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - if r.lockSecs == nil { - return localVarReturnValue, nil, reportError("lockSecs is required and must be specified") - } - - parameterAddToHeaderOrQuery(localVarQueryParams, "lockSecs", r.lockSecs, "form", "") - if r.clientKey != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "clientKey", r.clientKey, "form", "") - } - if r.forefront != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "forefront", r.forefront, "form", "") - } - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiRequestQueueRequestsUnlockPostRequest struct { - ctx context.Context - ApiService *StorageRequestQueuesRequestsLocksAPIService - queueId string - clientKey *string -} - -// A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. -func (r ApiRequestQueueRequestsUnlockPostRequest) ClientKey(clientKey string) ApiRequestQueueRequestsUnlockPostRequest { - r.clientKey = &clientKey - return r -} - -func (r ApiRequestQueueRequestsUnlockPostRequest) Execute() (*UnlockRequestsResponse, *http.Response, error) { - return r.ApiService.RequestQueueRequestsUnlockPostExecute(r) -} - -/* -RequestQueueRequestsUnlockPost Unlock requests - -Unlocks requests in the queue that are currently locked by the client. - -* If the client is within an Actor run, it unlocks all requests locked by that specific run plus all requests locked by the same clientKey. -* If the client is outside of an Actor run, it unlocks all requests locked using the same clientKey. - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param queueId Queue ID or `username~queue-name`. - @return ApiRequestQueueRequestsUnlockPostRequest -*/ -func (a *StorageRequestQueuesRequestsLocksAPIService) RequestQueueRequestsUnlockPost(ctx context.Context, queueId string) ApiRequestQueueRequestsUnlockPostRequest { - return ApiRequestQueueRequestsUnlockPostRequest{ - ApiService: a, - ctx: ctx, - queueId: queueId, - } -} - -// Execute executes the request -// @return UnlockRequestsResponse -func (a *StorageRequestQueuesRequestsLocksAPIService) RequestQueueRequestsUnlockPostExecute(r ApiRequestQueueRequestsUnlockPostRequest) (*UnlockRequestsResponse, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodPost - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *UnlockRequestsResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StorageRequestQueuesRequestsLocksAPIService.RequestQueueRequestsUnlockPost") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/request-queues/{queueId}/requests/unlock" - localVarPath = strings.Replace(localVarPath, "{"+"queueId"+"}", url.PathEscape(parameterValueToString(r.queueId, "queueId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if r.clientKey != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "clientKey", r.clientKey, "form", "") - } - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} diff --git a/api_store.go b/api_store.go deleted file mode 100644 index c910bd6..0000000 --- a/api_store.go +++ /dev/null @@ -1,284 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "bytes" - "context" - "io" - "net/http" - "net/url" -) - - -// StoreAPIService StoreAPI service -type StoreAPIService service - -type ApiStoreGetRequest struct { - ctx context.Context - ApiService *StoreAPIService - limit *float64 - offset *float64 - search *string - sortBy *string - category *string - username *string - pricingModel *string - allowsAgenticUsers *bool - responseFormat *string - includeUnrunnableActors *bool -} - -// Maximum number of items to return. The default value as well as the maximum is `1000`. -func (r ApiStoreGetRequest) Limit(limit float64) ApiStoreGetRequest { - r.limit = &limit - return r -} - -// Number of items that should be skipped at the start. The default value is `0`. -func (r ApiStoreGetRequest) Offset(offset float64) ApiStoreGetRequest { - r.offset = &offset - return r -} - -// String to search by. The search runs on the following fields: `title`, `name`, `description`, `username`, `readme`. -func (r ApiStoreGetRequest) Search(search string) ApiStoreGetRequest { - r.search = &search - return r -} - -// Specifies the field by which to sort the results. The supported values are `relevance` (default), `popularity`, `newest` and `lastUpdate`. -func (r ApiStoreGetRequest) SortBy(sortBy string) ApiStoreGetRequest { - r.sortBy = &sortBy - return r -} - -// Filters the results by the specified category. -func (r ApiStoreGetRequest) Category(category string) ApiStoreGetRequest { - r.category = &category - return r -} - -// Filters the results by the specified username. -func (r ApiStoreGetRequest) Username(username string) ApiStoreGetRequest { - r.username = &username - return r -} - -// Only return Actors with the specified pricing model. -func (r ApiStoreGetRequest) PricingModel(pricingModel string) ApiStoreGetRequest { - r.pricingModel = &pricingModel - return r -} - -// If true, only return Actors that allow agentic users. If false, only return Actors that do not allow agentic users. -func (r ApiStoreGetRequest) AllowsAgenticUsers(allowsAgenticUsers bool) ApiStoreGetRequest { - r.allowsAgenticUsers = &allowsAgenticUsers - return r -} - -// Controls the shape of the response. Use `full` (default) for the complete response including image URLs and all fields. Use `agent` for a reduced field set optimized for LLM consumers, which only includes `id`, `title`, `name`, `username`, `description`, `notice`, `badge`, `categories`, and minimal `stats`. -func (r ApiStoreGetRequest) ResponseFormat(responseFormat string) ApiStoreGetRequest { - r.responseFormat = &responseFormat - return r -} - -// By default, search results exclude Actors that are not safe to run automatically (e.g. Actors from developers who haven't passed KYC, or full-permission Actors without a large user base). Set to `true` to bypass this safety filtering and include all Actors in the results. -func (r ApiStoreGetRequest) IncludeUnrunnableActors(includeUnrunnableActors bool) ApiStoreGetRequest { - r.includeUnrunnableActors = &includeUnrunnableActors - return r -} - -func (r ApiStoreGetRequest) Execute() (*ListOfActorsInStoreResponse, *http.Response, error) { - return r.ApiService.StoreGetExecute(r) -} - -/* -StoreGet Get list of Actors in Store - -Gets the list of public Actors in Apify Store. You can use `search` -parameter to search Actors by string in title, name, description, username -and readme. -If you need detailed info about a specific Actor, use the [Get -Actor](#/reference/actors/actor-object/get-actor) endpoint. - -The endpoint supports pagination using the `limit` and `offset` parameters. -It will not return more than 1,000 records. - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return ApiStoreGetRequest -*/ -func (a *StoreAPIService) StoreGet(ctx context.Context) ApiStoreGetRequest { - return ApiStoreGetRequest{ - ApiService: a, - ctx: ctx, - } -} - -// Execute executes the request -// @return ListOfActorsInStoreResponse -func (a *StoreAPIService) StoreGetExecute(r ApiStoreGetRequest) (*ListOfActorsInStoreResponse, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *ListOfActorsInStoreResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StoreAPIService.StoreGet") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/store" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if r.limit != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "form", "") - } - if r.offset != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "form", "") - } - if r.search != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "search", r.search, "form", "") - } - if r.sortBy != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "sortBy", r.sortBy, "form", "") - } - if r.category != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "category", r.category, "form", "") - } - if r.username != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "username", r.username, "form", "") - } - if r.pricingModel != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "pricingModel", r.pricingModel, "form", "") - } - if r.allowsAgenticUsers != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "allowsAgenticUsers", r.allowsAgenticUsers, "form", "") - } - if r.responseFormat != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "responseFormat", r.responseFormat, "form", "") - } else { - var defaultValue string = "full" - parameterAddToHeaderOrQuery(localVarQueryParams, "responseFormat", defaultValue, "form", "") - r.responseFormat = &defaultValue - } - if r.includeUnrunnableActors != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "includeUnrunnableActors", r.includeUnrunnableActors, "form", "") - } else { - var defaultValue bool = false - parameterAddToHeaderOrQuery(localVarQueryParams, "includeUnrunnableActors", defaultValue, "form", "") - r.includeUnrunnableActors = &defaultValue - } - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} diff --git a/api_tools.go b/api_tools.go deleted file mode 100644 index 8a19e58..0000000 --- a/api_tools.go +++ /dev/null @@ -1,985 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "bytes" - "context" - "io" - "net/http" - "net/url" -) - - -// ToolsAPIService ToolsAPI service -type ToolsAPIService service - -type ApiToolsBrowserInfoDeleteRequest struct { - ctx context.Context - ApiService *ToolsAPIService - skipHeaders *bool - rawHeaders *bool -} - -// If `true` or `1`, the response omits the `headers` field. -func (r ApiToolsBrowserInfoDeleteRequest) SkipHeaders(skipHeaders bool) ApiToolsBrowserInfoDeleteRequest { - r.skipHeaders = &skipHeaders - return r -} - -// If `true` or `1`, the response includes the `rawHeaders` field with the raw request headers. -func (r ApiToolsBrowserInfoDeleteRequest) RawHeaders(rawHeaders bool) ApiToolsBrowserInfoDeleteRequest { - r.rawHeaders = &rawHeaders - return r -} - -func (r ApiToolsBrowserInfoDeleteRequest) Execute() (*BrowserInfoResponse, *http.Response, error) { - return r.ApiService.ToolsBrowserInfoDeleteExecute(r) -} - -/* -ToolsBrowserInfoDelete Get browser info - -Returns information about the HTTP request, including the client IP address, -country code, request headers, and body length. - -This endpoint is designed for proxy testing. It accepts any HTTP method so you -can verify that your proxy correctly forwards requests of any type and that -client IP addresses are anonymized. - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return ApiToolsBrowserInfoDeleteRequest -*/ -func (a *ToolsAPIService) ToolsBrowserInfoDelete(ctx context.Context) ApiToolsBrowserInfoDeleteRequest { - return ApiToolsBrowserInfoDeleteRequest{ - ApiService: a, - ctx: ctx, - } -} - -// Execute executes the request -// @return BrowserInfoResponse -func (a *ToolsAPIService) ToolsBrowserInfoDeleteExecute(r ApiToolsBrowserInfoDeleteRequest) (*BrowserInfoResponse, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodDelete - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *BrowserInfoResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ToolsAPIService.ToolsBrowserInfoDelete") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/browser-info" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if r.skipHeaders != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "skipHeaders", r.skipHeaders, "form", "") - } - if r.rawHeaders != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "rawHeaders", r.rawHeaders, "form", "") - } - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiToolsBrowserInfoGetRequest struct { - ctx context.Context - ApiService *ToolsAPIService - skipHeaders *bool - rawHeaders *bool -} - -// If `true` or `1`, the response omits the `headers` field. -func (r ApiToolsBrowserInfoGetRequest) SkipHeaders(skipHeaders bool) ApiToolsBrowserInfoGetRequest { - r.skipHeaders = &skipHeaders - return r -} - -// If `true` or `1`, the response includes the `rawHeaders` field with the raw request headers. -func (r ApiToolsBrowserInfoGetRequest) RawHeaders(rawHeaders bool) ApiToolsBrowserInfoGetRequest { - r.rawHeaders = &rawHeaders - return r -} - -func (r ApiToolsBrowserInfoGetRequest) Execute() (*BrowserInfoResponse, *http.Response, error) { - return r.ApiService.ToolsBrowserInfoGetExecute(r) -} - -/* -ToolsBrowserInfoGet Get browser info - -Returns information about the HTTP request, including the client IP address, -country code, request headers, and body length. - -This endpoint is designed for proxy testing. It accepts any HTTP method so you -can verify that your proxy correctly forwards requests of any type and that -client IP addresses are anonymized. - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return ApiToolsBrowserInfoGetRequest -*/ -func (a *ToolsAPIService) ToolsBrowserInfoGet(ctx context.Context) ApiToolsBrowserInfoGetRequest { - return ApiToolsBrowserInfoGetRequest{ - ApiService: a, - ctx: ctx, - } -} - -// Execute executes the request -// @return BrowserInfoResponse -func (a *ToolsAPIService) ToolsBrowserInfoGetExecute(r ApiToolsBrowserInfoGetRequest) (*BrowserInfoResponse, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *BrowserInfoResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ToolsAPIService.ToolsBrowserInfoGet") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/browser-info" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if r.skipHeaders != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "skipHeaders", r.skipHeaders, "form", "") - } - if r.rawHeaders != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "rawHeaders", r.rawHeaders, "form", "") - } - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiToolsBrowserInfoPostRequest struct { - ctx context.Context - ApiService *ToolsAPIService - skipHeaders *bool - rawHeaders *bool -} - -// If `true` or `1`, the response omits the `headers` field. -func (r ApiToolsBrowserInfoPostRequest) SkipHeaders(skipHeaders bool) ApiToolsBrowserInfoPostRequest { - r.skipHeaders = &skipHeaders - return r -} - -// If `true` or `1`, the response includes the `rawHeaders` field with the raw request headers. -func (r ApiToolsBrowserInfoPostRequest) RawHeaders(rawHeaders bool) ApiToolsBrowserInfoPostRequest { - r.rawHeaders = &rawHeaders - return r -} - -func (r ApiToolsBrowserInfoPostRequest) Execute() (*BrowserInfoResponse, *http.Response, error) { - return r.ApiService.ToolsBrowserInfoPostExecute(r) -} - -/* -ToolsBrowserInfoPost Get browser info - -Returns information about the HTTP request, including the client IP address, -country code, request headers, and body length. - -This endpoint is designed for proxy testing. It accepts any HTTP method so you -can verify that your proxy correctly forwards requests of any type and that -client IP addresses are anonymized. - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return ApiToolsBrowserInfoPostRequest -*/ -func (a *ToolsAPIService) ToolsBrowserInfoPost(ctx context.Context) ApiToolsBrowserInfoPostRequest { - return ApiToolsBrowserInfoPostRequest{ - ApiService: a, - ctx: ctx, - } -} - -// Execute executes the request -// @return BrowserInfoResponse -func (a *ToolsAPIService) ToolsBrowserInfoPostExecute(r ApiToolsBrowserInfoPostRequest) (*BrowserInfoResponse, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodPost - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *BrowserInfoResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ToolsAPIService.ToolsBrowserInfoPost") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/browser-info" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if r.skipHeaders != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "skipHeaders", r.skipHeaders, "form", "") - } - if r.rawHeaders != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "rawHeaders", r.rawHeaders, "form", "") - } - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiToolsBrowserInfoPutRequest struct { - ctx context.Context - ApiService *ToolsAPIService - skipHeaders *bool - rawHeaders *bool -} - -// If `true` or `1`, the response omits the `headers` field. -func (r ApiToolsBrowserInfoPutRequest) SkipHeaders(skipHeaders bool) ApiToolsBrowserInfoPutRequest { - r.skipHeaders = &skipHeaders - return r -} - -// If `true` or `1`, the response includes the `rawHeaders` field with the raw request headers. -func (r ApiToolsBrowserInfoPutRequest) RawHeaders(rawHeaders bool) ApiToolsBrowserInfoPutRequest { - r.rawHeaders = &rawHeaders - return r -} - -func (r ApiToolsBrowserInfoPutRequest) Execute() (*BrowserInfoResponse, *http.Response, error) { - return r.ApiService.ToolsBrowserInfoPutExecute(r) -} - -/* -ToolsBrowserInfoPut Get browser info - -Returns information about the HTTP request, including the client IP address, -country code, request headers, and body length. - -This endpoint is designed for proxy testing. It accepts any HTTP method so you -can verify that your proxy correctly forwards requests of any type and that -client IP addresses are anonymized. - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return ApiToolsBrowserInfoPutRequest -*/ -func (a *ToolsAPIService) ToolsBrowserInfoPut(ctx context.Context) ApiToolsBrowserInfoPutRequest { - return ApiToolsBrowserInfoPutRequest{ - ApiService: a, - ctx: ctx, - } -} - -// Execute executes the request -// @return BrowserInfoResponse -func (a *ToolsAPIService) ToolsBrowserInfoPutExecute(r ApiToolsBrowserInfoPutRequest) (*BrowserInfoResponse, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodPut - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *BrowserInfoResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ToolsAPIService.ToolsBrowserInfoPut") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/browser-info" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if r.skipHeaders != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "skipHeaders", r.skipHeaders, "form", "") - } - if r.rawHeaders != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "rawHeaders", r.rawHeaders, "form", "") - } - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiToolsDecodeAndVerifyPostRequest struct { - ctx context.Context - ApiService *ToolsAPIService - decodeAndVerifyRequest *DecodeAndVerifyRequest -} - -// -func (r ApiToolsDecodeAndVerifyPostRequest) DecodeAndVerifyRequest(decodeAndVerifyRequest DecodeAndVerifyRequest) ApiToolsDecodeAndVerifyPostRequest { - r.decodeAndVerifyRequest = &decodeAndVerifyRequest - return r -} - -func (r ApiToolsDecodeAndVerifyPostRequest) Execute() (*DecodeAndVerifyResponse, *http.Response, error) { - return r.ApiService.ToolsDecodeAndVerifyPostExecute(r) -} - -/* -ToolsDecodeAndVerifyPost Decode and verify object - -Decodes and verifies an encoded value previously created by the -encode-and-sign endpoint. Returns the original decoded object along with -information about the user who encoded it and whether that user is verified. - -**Important**: The request must specify the `Content-Type: application/json` -HTTP header. - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return ApiToolsDecodeAndVerifyPostRequest -*/ -func (a *ToolsAPIService) ToolsDecodeAndVerifyPost(ctx context.Context) ApiToolsDecodeAndVerifyPostRequest { - return ApiToolsDecodeAndVerifyPostRequest{ - ApiService: a, - ctx: ctx, - } -} - -// Execute executes the request -// @return DecodeAndVerifyResponse -func (a *ToolsAPIService) ToolsDecodeAndVerifyPostExecute(r ApiToolsDecodeAndVerifyPostRequest) (*DecodeAndVerifyResponse, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodPost - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *DecodeAndVerifyResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ToolsAPIService.ToolsDecodeAndVerifyPost") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/tools/decode-and-verify" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - if r.decodeAndVerifyRequest == nil { - return localVarReturnValue, nil, reportError("decodeAndVerifyRequest is required and must be specified") - } - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/json"} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - // body params - localVarPostBody = r.decodeAndVerifyRequest - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 413 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 415 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiToolsEncodeAndSignPostRequest struct { - ctx context.Context - ApiService *ToolsAPIService - body *map[string]interface{} -} - -// -func (r ApiToolsEncodeAndSignPostRequest) Body(body map[string]interface{}) ApiToolsEncodeAndSignPostRequest { - r.body = &body - return r -} - -func (r ApiToolsEncodeAndSignPostRequest) Execute() (*EncodeAndSignResponse, *http.Response, error) { - return r.ApiService.ToolsEncodeAndSignPostExecute(r) -} - -/* -ToolsEncodeAndSignPost Encode and sign object - -Encodes and signs any JSON object. The encoded value includes a signature -tied to the authenticated user's ID, which can later be verified using the -decode-and-verify endpoint. - -**Important**: The request must specify the `Content-Type: application/json` -HTTP header. - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return ApiToolsEncodeAndSignPostRequest -*/ -func (a *ToolsAPIService) ToolsEncodeAndSignPost(ctx context.Context) ApiToolsEncodeAndSignPostRequest { - return ApiToolsEncodeAndSignPostRequest{ - ApiService: a, - ctx: ctx, - } -} - -// Execute executes the request -// @return EncodeAndSignResponse -func (a *ToolsAPIService) ToolsEncodeAndSignPostExecute(r ApiToolsEncodeAndSignPostRequest) (*EncodeAndSignResponse, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodPost - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *EncodeAndSignResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ToolsAPIService.ToolsEncodeAndSignPost") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/tools/encode-and-sign" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - if r.body == nil { - return localVarReturnValue, nil, reportError("body is required and must be specified") - } - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/json"} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - // body params - localVarPostBody = r.body - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 413 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 415 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} diff --git a/api_users.go b/api_users.go deleted file mode 100644 index 37a9c05..0000000 --- a/api_users.go +++ /dev/null @@ -1,915 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "bytes" - "context" - "io" - "net/http" - "net/url" - "strings" -) - - -// UsersAPIService UsersAPI service -type UsersAPIService service - -type ApiUserGetRequest struct { - ctx context.Context - ApiService *UsersAPIService - userId string -} - -func (r ApiUserGetRequest) Execute() (*PublicUserDataResponse, *http.Response, error) { - return r.ApiService.UserGetExecute(r) -} - -/* -UserGet Get public user data - -Returns public information about a specific user account, similar to what -can be seen on public profile pages (e.g. https://apify.com/apify). - -This operation requires no authentication token. - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param userId User ID or username. - @return ApiUserGetRequest -*/ -func (a *UsersAPIService) UserGet(ctx context.Context, userId string) ApiUserGetRequest { - return ApiUserGetRequest{ - ApiService: a, - ctx: ctx, - userId: userId, - } -} - -// Execute executes the request -// @return PublicUserDataResponse -func (a *UsersAPIService) UserGetExecute(r ApiUserGetRequest) (*PublicUserDataResponse, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *PublicUserDataResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UsersAPIService.UserGet") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/users/{userId}" - localVarPath = strings.Replace(localVarPath, "{"+"userId"+"}", url.PathEscape(parameterValueToString(r.userId, "userId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiUsersMeGetRequest struct { - ctx context.Context - ApiService *UsersAPIService -} - -func (r ApiUsersMeGetRequest) Execute() (*PrivateUserDataResponse, *http.Response, error) { - return r.ApiService.UsersMeGetExecute(r) -} - -/* -UsersMeGet Get private user data - -Returns information about the current user account, including both public -and private information. - -The user account is identified by the provided authentication token. - -The fields `plan`, `email` and `profile` are omitted when this endpoint is accessed from Actor run. - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return ApiUsersMeGetRequest -*/ -func (a *UsersAPIService) UsersMeGet(ctx context.Context) ApiUsersMeGetRequest { - return ApiUsersMeGetRequest{ - ApiService: a, - ctx: ctx, - } -} - -// Execute executes the request -// @return PrivateUserDataResponse -func (a *UsersAPIService) UsersMeGetExecute(r ApiUsersMeGetRequest) (*PrivateUserDataResponse, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *PrivateUserDataResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UsersAPIService.UsersMeGet") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/users/me" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiUsersMeLimitsGetRequest struct { - ctx context.Context - ApiService *UsersAPIService -} - -func (r ApiUsersMeLimitsGetRequest) Execute() (*LimitsResponse, *http.Response, error) { - return r.ApiService.UsersMeLimitsGetExecute(r) -} - -/* -UsersMeLimitsGet Get limits - -Returns a complete summary of your account's limits. It is the same -information you will see on your account's [Limits page](https://console.apify.com/billing#/limits). The returned data -includes the current usage cycle, a summary of your limits, and your current usage. - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return ApiUsersMeLimitsGetRequest -*/ -func (a *UsersAPIService) UsersMeLimitsGet(ctx context.Context) ApiUsersMeLimitsGetRequest { - return ApiUsersMeLimitsGetRequest{ - ApiService: a, - ctx: ctx, - } -} - -// Execute executes the request -// @return LimitsResponse -func (a *UsersAPIService) UsersMeLimitsGetExecute(r ApiUsersMeLimitsGetRequest) (*LimitsResponse, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *LimitsResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UsersAPIService.UsersMeLimitsGet") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/users/me/limits" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiUsersMeLimitsPutRequest struct { - ctx context.Context - ApiService *UsersAPIService - updateLimitsRequest *UpdateLimitsRequest -} - -// -func (r ApiUsersMeLimitsPutRequest) UpdateLimitsRequest(updateLimitsRequest UpdateLimitsRequest) ApiUsersMeLimitsPutRequest { - r.updateLimitsRequest = &updateLimitsRequest - return r -} - -func (r ApiUsersMeLimitsPutRequest) Execute() (map[string]interface{}, *http.Response, error) { - return r.ApiService.UsersMeLimitsPutExecute(r) -} - -/* -UsersMeLimitsPut Update limits - -Updates the account's limits manageable on your account's [Limits page](https://console.apify.com/billing#/limits). -Specifically the: `maxMonthlyUsageUsd` and `dataRetentionDays` limits (see request body schema for more details). - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return ApiUsersMeLimitsPutRequest -*/ -func (a *UsersAPIService) UsersMeLimitsPut(ctx context.Context) ApiUsersMeLimitsPutRequest { - return ApiUsersMeLimitsPutRequest{ - ApiService: a, - ctx: ctx, - } -} - -// Execute executes the request -// @return map[string]interface{} -func (a *UsersAPIService) UsersMeLimitsPutExecute(r ApiUsersMeLimitsPutRequest) (map[string]interface{}, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodPut - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue map[string]interface{} - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UsersAPIService.UsersMeLimitsPut") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/users/me/limits" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/json"} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - // body params - localVarPostBody = r.updateLimitsRequest - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 413 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 415 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiUsersMeUsageMonthlyGetRequest struct { - ctx context.Context - ApiService *UsersAPIService - date *string -} - -// Date in the YYYY-MM-DD format. -func (r ApiUsersMeUsageMonthlyGetRequest) Date(date string) ApiUsersMeUsageMonthlyGetRequest { - r.date = &date - return r -} - -func (r ApiUsersMeUsageMonthlyGetRequest) Execute() (*MonthlyUsageResponse, *http.Response, error) { - return r.ApiService.UsersMeUsageMonthlyGetExecute(r) -} - -/* -UsersMeUsageMonthlyGet Get monthly usage - -Returns a complete summary of your usage for the current monthly usage cycle, -an overall sum, as well as a daily breakdown of usage. It is the same -information you will see on your account's [Billing > Historical usage page](https://console.apify.com/billing/historical-usage). The information -includes your use of Actors, compute, data transfer, and storage. - -Using the `date` parameter will show your usage in the monthly usage cycle that -includes that date. - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return ApiUsersMeUsageMonthlyGetRequest -*/ -func (a *UsersAPIService) UsersMeUsageMonthlyGet(ctx context.Context) ApiUsersMeUsageMonthlyGetRequest { - return ApiUsersMeUsageMonthlyGetRequest{ - ApiService: a, - ctx: ctx, - } -} - -// Execute executes the request -// @return MonthlyUsageResponse -func (a *UsersAPIService) UsersMeUsageMonthlyGetExecute(r ApiUsersMeUsageMonthlyGetRequest) (*MonthlyUsageResponse, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *MonthlyUsageResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UsersAPIService.UsersMeUsageMonthlyGet") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/users/me/usage/monthly" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if r.date != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "date", r.date, "form", "") - } - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} diff --git a/api_webhooks_webhook_dispatches.go b/api_webhooks_webhook_dispatches.go deleted file mode 100644 index 7a9924d..0000000 --- a/api_webhooks_webhook_dispatches.go +++ /dev/null @@ -1,410 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "bytes" - "context" - "io" - "net/http" - "net/url" - "strings" -) - - -// WebhooksWebhookDispatchesAPIService WebhooksWebhookDispatchesAPI service -type WebhooksWebhookDispatchesAPIService service - -type ApiWebhookDispatchGetRequest struct { - ctx context.Context - ApiService *WebhooksWebhookDispatchesAPIService - dispatchId string -} - -func (r ApiWebhookDispatchGetRequest) Execute() (*WebhookDispatchResponse, *http.Response, error) { - return r.ApiService.WebhookDispatchGetExecute(r) -} - -/* -WebhookDispatchGet Get webhook dispatch - -Gets webhook dispatch object with all details. - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param dispatchId Webhook dispatch ID. - @return ApiWebhookDispatchGetRequest -*/ -func (a *WebhooksWebhookDispatchesAPIService) WebhookDispatchGet(ctx context.Context, dispatchId string) ApiWebhookDispatchGetRequest { - return ApiWebhookDispatchGetRequest{ - ApiService: a, - ctx: ctx, - dispatchId: dispatchId, - } -} - -// Execute executes the request -// @return WebhookDispatchResponse -func (a *WebhooksWebhookDispatchesAPIService) WebhookDispatchGetExecute(r ApiWebhookDispatchGetRequest) (*WebhookDispatchResponse, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *WebhookDispatchResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "WebhooksWebhookDispatchesAPIService.WebhookDispatchGet") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/webhook-dispatches/{dispatchId}" - localVarPath = strings.Replace(localVarPath, "{"+"dispatchId"+"}", url.PathEscape(parameterValueToString(r.dispatchId, "dispatchId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiWebhookDispatchesGetRequest struct { - ctx context.Context - ApiService *WebhooksWebhookDispatchesAPIService - offset *float64 - limit *float64 - desc *bool -} - -// Number of items that should be skipped at the start. The default value is `0`. -func (r ApiWebhookDispatchesGetRequest) Offset(offset float64) ApiWebhookDispatchesGetRequest { - r.offset = &offset - return r -} - -// Maximum number of items to return. The default value as well as the maximum is `1000`. -func (r ApiWebhookDispatchesGetRequest) Limit(limit float64) ApiWebhookDispatchesGetRequest { - r.limit = &limit - return r -} - -// If `true` or `1` then the objects are sorted by the `createdAt` field in descending order. By default, they are sorted in ascending order. -func (r ApiWebhookDispatchesGetRequest) Desc(desc bool) ApiWebhookDispatchesGetRequest { - r.desc = &desc - return r -} - -func (r ApiWebhookDispatchesGetRequest) Execute() (*ListOfWebhookDispatchesResponse, *http.Response, error) { - return r.ApiService.WebhookDispatchesGetExecute(r) -} - -/* -WebhookDispatchesGet Get list of webhook dispatches - -Gets the list of webhook dispatches that the user have. - -The endpoint supports pagination using the `limit` and `offset` parameters -and it will not return more than 1000 records. -By default, the records are sorted by the `createdAt` field in ascending -order. To sort the records in descending order, use the `desc=1` -parameter. - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return ApiWebhookDispatchesGetRequest -*/ -func (a *WebhooksWebhookDispatchesAPIService) WebhookDispatchesGet(ctx context.Context) ApiWebhookDispatchesGetRequest { - return ApiWebhookDispatchesGetRequest{ - ApiService: a, - ctx: ctx, - } -} - -// Execute executes the request -// @return ListOfWebhookDispatchesResponse -func (a *WebhooksWebhookDispatchesAPIService) WebhookDispatchesGetExecute(r ApiWebhookDispatchesGetRequest) (*ListOfWebhookDispatchesResponse, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *ListOfWebhookDispatchesResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "WebhooksWebhookDispatchesAPIService.WebhookDispatchesGet") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/webhook-dispatches" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if r.offset != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "form", "") - } - if r.limit != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "form", "") - } - if r.desc != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "desc", r.desc, "form", "") - } - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} diff --git a/api_webhooks_webhooks.go b/api_webhooks_webhooks.go deleted file mode 100644 index 38590df..0000000 --- a/api_webhooks_webhooks.go +++ /dev/null @@ -1,1437 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "bytes" - "context" - "io" - "net/http" - "net/url" - "strings" -) - - -// WebhooksWebhooksAPIService WebhooksWebhooksAPI service -type WebhooksWebhooksAPIService service - -type ApiWebhookDeleteRequest struct { - ctx context.Context - ApiService *WebhooksWebhooksAPIService - webhookId string -} - -func (r ApiWebhookDeleteRequest) Execute() (map[string]interface{}, *http.Response, error) { - return r.ApiService.WebhookDeleteExecute(r) -} - -/* -WebhookDelete Delete webhook - -Deletes a webhook. - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param webhookId Webhook ID. - @return ApiWebhookDeleteRequest -*/ -func (a *WebhooksWebhooksAPIService) WebhookDelete(ctx context.Context, webhookId string) ApiWebhookDeleteRequest { - return ApiWebhookDeleteRequest{ - ApiService: a, - ctx: ctx, - webhookId: webhookId, - } -} - -// Execute executes the request -// @return map[string]interface{} -func (a *WebhooksWebhooksAPIService) WebhookDeleteExecute(r ApiWebhookDeleteRequest) (map[string]interface{}, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodDelete - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue map[string]interface{} - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "WebhooksWebhooksAPIService.WebhookDelete") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/webhooks/{webhookId}" - localVarPath = strings.Replace(localVarPath, "{"+"webhookId"+"}", url.PathEscape(parameterValueToString(r.webhookId, "webhookId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiWebhookGetRequest struct { - ctx context.Context - ApiService *WebhooksWebhooksAPIService - webhookId string -} - -func (r ApiWebhookGetRequest) Execute() (*WebhookResponse, *http.Response, error) { - return r.ApiService.WebhookGetExecute(r) -} - -/* -WebhookGet Get webhook - -Gets webhook object with all details. - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param webhookId Webhook ID. - @return ApiWebhookGetRequest -*/ -func (a *WebhooksWebhooksAPIService) WebhookGet(ctx context.Context, webhookId string) ApiWebhookGetRequest { - return ApiWebhookGetRequest{ - ApiService: a, - ctx: ctx, - webhookId: webhookId, - } -} - -// Execute executes the request -// @return WebhookResponse -func (a *WebhooksWebhooksAPIService) WebhookGetExecute(r ApiWebhookGetRequest) (*WebhookResponse, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *WebhookResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "WebhooksWebhooksAPIService.WebhookGet") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/webhooks/{webhookId}" - localVarPath = strings.Replace(localVarPath, "{"+"webhookId"+"}", url.PathEscape(parameterValueToString(r.webhookId, "webhookId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiWebhookPutRequest struct { - ctx context.Context - ApiService *WebhooksWebhooksAPIService - webhookId string - webhookUpdate *WebhookUpdate -} - -// -func (r ApiWebhookPutRequest) WebhookUpdate(webhookUpdate WebhookUpdate) ApiWebhookPutRequest { - r.webhookUpdate = &webhookUpdate - return r -} - -func (r ApiWebhookPutRequest) Execute() (*WebhookResponse, *http.Response, error) { - return r.ApiService.WebhookPutExecute(r) -} - -/* -WebhookPut Update webhook - -Updates a webhook using values specified by a webhook object passed as JSON -in the POST payload. -If the object does not define a specific property, its value will not be -updated. - -The response is the full webhook object as returned by the -[Get webhook](#/reference/webhooks/webhook-object/get-webhook) endpoint. - -The request needs to specify the `Content-Type: application/json` HTTP -header! - -When providing your API authentication token, we recommend using the -request's `Authorization` header, rather than the URL. ([More -info](#/introduction/authentication)). - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param webhookId Webhook ID. - @return ApiWebhookPutRequest -*/ -func (a *WebhooksWebhooksAPIService) WebhookPut(ctx context.Context, webhookId string) ApiWebhookPutRequest { - return ApiWebhookPutRequest{ - ApiService: a, - ctx: ctx, - webhookId: webhookId, - } -} - -// Execute executes the request -// @return WebhookResponse -func (a *WebhooksWebhooksAPIService) WebhookPutExecute(r ApiWebhookPutRequest) (*WebhookResponse, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodPut - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *WebhookResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "WebhooksWebhooksAPIService.WebhookPut") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/webhooks/{webhookId}" - localVarPath = strings.Replace(localVarPath, "{"+"webhookId"+"}", url.PathEscape(parameterValueToString(r.webhookId, "webhookId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - if r.webhookUpdate == nil { - return localVarReturnValue, nil, reportError("webhookUpdate is required and must be specified") - } - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/json"} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - // body params - localVarPostBody = r.webhookUpdate - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 413 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 415 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiWebhookTestPostRequest struct { - ctx context.Context - ApiService *WebhooksWebhooksAPIService - webhookId string -} - -func (r ApiWebhookTestPostRequest) Execute() (*TestWebhookResponse, *http.Response, error) { - return r.ApiService.WebhookTestPostExecute(r) -} - -/* -WebhookTestPost Test webhook - -Tests a webhook. Creates a webhook dispatch with a dummy payload. - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param webhookId Webhook ID. - @return ApiWebhookTestPostRequest -*/ -func (a *WebhooksWebhooksAPIService) WebhookTestPost(ctx context.Context, webhookId string) ApiWebhookTestPostRequest { - return ApiWebhookTestPostRequest{ - ApiService: a, - ctx: ctx, - webhookId: webhookId, - } -} - -// Execute executes the request -// @return TestWebhookResponse -func (a *WebhooksWebhooksAPIService) WebhookTestPostExecute(r ApiWebhookTestPostRequest) (*TestWebhookResponse, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodPost - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *TestWebhookResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "WebhooksWebhooksAPIService.WebhookTestPost") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/webhooks/{webhookId}/test" - localVarPath = strings.Replace(localVarPath, "{"+"webhookId"+"}", url.PathEscape(parameterValueToString(r.webhookId, "webhookId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiWebhookWebhookDispatchesGetRequest struct { - ctx context.Context - ApiService *WebhooksWebhooksAPIService - webhookId string -} - -func (r ApiWebhookWebhookDispatchesGetRequest) Execute() (*ListOfWebhookDispatchesResponse, *http.Response, error) { - return r.ApiService.WebhookWebhookDispatchesGetExecute(r) -} - -/* -WebhookWebhookDispatchesGet Get collection - -Gets a given webhook's list of dispatches. - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param webhookId Webhook ID. - @return ApiWebhookWebhookDispatchesGetRequest -*/ -func (a *WebhooksWebhooksAPIService) WebhookWebhookDispatchesGet(ctx context.Context, webhookId string) ApiWebhookWebhookDispatchesGetRequest { - return ApiWebhookWebhookDispatchesGetRequest{ - ApiService: a, - ctx: ctx, - webhookId: webhookId, - } -} - -// Execute executes the request -// @return ListOfWebhookDispatchesResponse -func (a *WebhooksWebhooksAPIService) WebhookWebhookDispatchesGetExecute(r ApiWebhookWebhookDispatchesGetRequest) (*ListOfWebhookDispatchesResponse, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *ListOfWebhookDispatchesResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "WebhooksWebhooksAPIService.WebhookWebhookDispatchesGet") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/webhooks/{webhookId}/dispatches" - localVarPath = strings.Replace(localVarPath, "{"+"webhookId"+"}", url.PathEscape(parameterValueToString(r.webhookId, "webhookId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiWebhooksGetRequest struct { - ctx context.Context - ApiService *WebhooksWebhooksAPIService - offset *float64 - limit *float64 - desc *bool -} - -// Number of items that should be skipped at the start. The default value is `0`. -func (r ApiWebhooksGetRequest) Offset(offset float64) ApiWebhooksGetRequest { - r.offset = &offset - return r -} - -// Maximum number of items to return. The default value as well as the maximum is `1000`. -func (r ApiWebhooksGetRequest) Limit(limit float64) ApiWebhooksGetRequest { - r.limit = &limit - return r -} - -// If `true` or `1` then the objects are sorted by the `createdAt` field in descending order. By default, they are sorted in ascending order. -func (r ApiWebhooksGetRequest) Desc(desc bool) ApiWebhooksGetRequest { - r.desc = &desc - return r -} - -func (r ApiWebhooksGetRequest) Execute() (*ListOfWebhooksResponse, *http.Response, error) { - return r.ApiService.WebhooksGetExecute(r) -} - -/* -WebhooksGet Get list of webhooks - -Gets the list of webhooks that the user created. - -The endpoint supports pagination using the `limit` and `offset` parameters -and it will not return more than 1000 records. -By default, the records are sorted by the `createdAt` field in ascending -order. To sort the records in descending order, use the `desc=1` -parameter. - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return ApiWebhooksGetRequest -*/ -func (a *WebhooksWebhooksAPIService) WebhooksGet(ctx context.Context) ApiWebhooksGetRequest { - return ApiWebhooksGetRequest{ - ApiService: a, - ctx: ctx, - } -} - -// Execute executes the request -// @return ListOfWebhooksResponse -func (a *WebhooksWebhooksAPIService) WebhooksGetExecute(r ApiWebhooksGetRequest) (*ListOfWebhooksResponse, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *ListOfWebhooksResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "WebhooksWebhooksAPIService.WebhooksGet") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/webhooks" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if r.offset != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "form", "") - } - if r.limit != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "form", "") - } - if r.desc != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "desc", r.desc, "form", "") - } - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiWebhooksPostRequest struct { - ctx context.Context - ApiService *WebhooksWebhooksAPIService - webhookCreate *WebhookCreate -} - -// -func (r ApiWebhooksPostRequest) WebhookCreate(webhookCreate WebhookCreate) ApiWebhooksPostRequest { - r.webhookCreate = &webhookCreate - return r -} - -func (r ApiWebhooksPostRequest) Execute() (*WebhookResponse, *http.Response, error) { - return r.ApiService.WebhooksPostExecute(r) -} - -/* -WebhooksPost Create webhook - -Creates a new webhook with settings provided by the webhook object passed as -JSON in the payload. -The response is the created webhook object. - -To avoid duplicating a webhook, use the `idempotencyKey` parameter in the -request body. -Multiple calls to create a webhook with the same `idempotencyKey` will only -create the webhook with the first call and return the existing webhook on -subsequent calls. -Idempotency keys must be unique, so use a UUID or another random string with -enough entropy. - -To assign the new webhook to an Actor or task, the request body must contain -`requestUrl`, `eventTypes`, and `condition` properties. - -* `requestUrl` is the webhook's target URL, to which data is sent as a POST -request with a JSON payload. -* `eventTypes` is a list of events that will trigger the webhook, e.g. when -the Actor run succeeds. -* `condition` should be an object containing the ID of the Actor or task to -which the webhook will be assigned. -* `payloadTemplate` is a JSON-like string, whose syntax is extended with the -use of variables. -* `headersTemplate` is a JSON-like string, whose syntax is extended with the -use of variables. Following values will be re-written to defaults: "host", -"Content-Type", "X-Apify-Webhook", "X-Apify-Webhook-Dispatch-Id", -"X-Apify-Request-Origin" -* `description` is an optional string. -* `shouldInterpolateStrings` is a boolean indicating whether to interpolate -variables contained inside strings in the `payloadTemplate` - -``` - "isAdHoc" : false, - "requestUrl" : "https://example.com", - "eventTypes" : [ - "ACTOR.RUN.SUCCEEDED", - "ACTOR.RUN.ABORTED" - ], - "condition" : { - "actorId": "5sTMwDQywwsLzKRRh", - "actorTaskId" : "W9bs9JE9v7wprjAnJ" - }, - "payloadTemplate": "", - "headersTemplate": "", - "description": "my awesome webhook", - "shouldInterpolateStrings": false, -``` - -**Important**: The request must specify the `Content-Type: application/json` -HTTP header. - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return ApiWebhooksPostRequest -*/ -func (a *WebhooksWebhooksAPIService) WebhooksPost(ctx context.Context) ApiWebhooksPostRequest { - return ApiWebhooksPostRequest{ - ApiService: a, - ctx: ctx, - } -} - -// Execute executes the request -// @return WebhookResponse -func (a *WebhooksWebhooksAPIService) WebhooksPostExecute(r ApiWebhooksPostRequest) (*WebhookResponse, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodPost - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *WebhookResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "WebhooksWebhooksAPIService.WebhooksPost") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/webhooks" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - if r.webhookCreate == nil { - return localVarReturnValue, nil, reportError("webhookCreate is required and must be specified") - } - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/json"} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - // body params - localVarPostBody = r.webhookCreate - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKey"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("token", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 405 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 413 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 415 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v ErrorResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} diff --git a/base.go b/base.go new file mode 100644 index 0000000..c0f09ad --- /dev/null +++ b/base.go @@ -0,0 +1,341 @@ +package apify + +import ( + "context" + "encoding/json" + "net/http" + "strings" + "time" +) + +// Per-endpoint base timeouts. These mirror the reference clients' SMALL/MEDIUM/DEFAULT +// timeouts and are the single source of truth (no magic durations sprinkled in callers). +const ( + // defaultRequestTimeout is used when an endpoint does not specify its own (6 minutes). + defaultRequestTimeout = 360 * time.Second + // smallRequestTimeout is for fast, idempotent metadata operations (mirrors JS SMALL_TIMEOUT). + smallRequestTimeout = 5 * time.Second + // mediumRequestTimeout is for operations that may take a little longer (JS MEDIUM_TIMEOUT). + mediumRequestTimeout = 30 * time.Second +) + +// JSON content types used by the client. +const ( + contentTypeJSON = "application/json" + contentTypeJSONCharset = "application/json; charset=utf-8" +) + +// How long to wait between polls while waiting for a run/build to finish, and the +// server-side waitForFinish chunk size (the API caps server waiting at 60 seconds). +const ( + waitForFinishPollInterval = 250 * time.Millisecond + waitForFinishRequestSecs = int64(60) +) + +// resourceContext is the resolved context for a resource client: its base URL and the +// shared HTTP client. The free functions in this file implement the CRUD primitives once, +// so each resource client stays small and consistent (DRY). +type resourceContext struct { + http *httpClient + // url is the fully-qualified base URL of the resource, + // e.g. https://api.apify.com/v2/actors/ID. + url string + // baseParams are parameters inherited from a parent resource (e.g. status on last_run). + baseParams *QueryParams + // apiOrigin is the origin (scheme + host) the API is reached through. + apiOrigin string + // publicOrigin is the origin used to build public, shareable URLs (defaults to apiOrigin). + publicOrigin string +} + +// newCollectionContext creates a context for a collection endpoint: {base}/{resourcePath}. +func newCollectionContext(hc *httpClient, baseURL, resourcePath string) *resourceContext { + return newResourceContext(hc, baseURL+"/"+resourcePath, baseURL) +} + +// newSingleContext creates a context for a single resource: {base}/{resourcePath}/{safeID}. +func newSingleContext(hc *httpClient, baseURL, resourcePath, id string) *resourceContext { + return newResourceContext(hc, baseURL+"/"+resourcePath+"/"+toSafeID(id), baseURL) +} + +func newResourceContext(hc *httpClient, url, baseURL string) *resourceContext { + origin := originOf(baseURL) + return &resourceContext{ + http: hc, + url: url, + baseParams: NewQueryParams(), + apiOrigin: origin, + publicOrigin: origin, + } +} + +// withPublicOrigin overrides the origin used when building public URLs. +func (c *resourceContext) withPublicOrigin(publicBaseURL string) *resourceContext { + c.publicOrigin = originOf(publicBaseURL) + return c +} + +// subURL returns this resource's URL with an optional extra path segment appended. +func (c *resourceContext) subURL(subPath string) string { + if subPath == "" { + return c.url + } + return c.url + "/" + subPath +} + +// publicURL builds the public (shareable) form of this resource's URL with an optional +// extra path segment, swapping the API origin for the configured public origin. +func (c *resourceContext) publicURL(subPath string) string { + apiURL := c.subURL(subPath) + if c.publicOrigin == c.apiOrigin { + return apiURL + } + if rest, ok := strings.CutPrefix(apiURL, c.apiOrigin); ok { + return c.publicOrigin + rest + } + return apiURL +} + +// mergedParams merges the inherited base params with per-call params. +func (c *resourceContext) mergedParams(params *QueryParams) *QueryParams { + merged := c.baseParams.clone() + merged.extend(params) + return merged +} + +// originOf extracts the origin (scheme://host[:port]) from a URL, dropping any path. +func originOf(rawURL string) string { + rest := rawURL + scheme := "" + if i := strings.Index(rest, "://"); i >= 0 { + scheme = rest[:i+3] + rest = rest[i+3:] + } + if i := strings.IndexByte(rest, '/'); i >= 0 { + rest = rest[:i] + } + return scheme + rest +} + +// getResource performs a GET that unwraps the data envelope; a not-found maps to (zero, +// false, nil). The bool reports presence. +func getResource[T any](ctx context.Context, c *resourceContext, subPath string, params *QueryParams) (T, bool, error) { + var zero T + result, err := getResourceRequired[T](ctx, c, subPath, params) + if err != nil { + if isNotFound(err) { + return zero, false, nil + } + return zero, false, err + } + return result, true, nil +} + +// getResourceRequired performs a GET that unwraps the data envelope and propagates errors. +func getResourceRequired[T any](ctx context.Context, c *resourceContext, subPath string, params *QueryParams) (T, error) { + var zero T + url := c.mergedParams(params).applyToURL(c.subURL(subPath)) + resp, err := c.http.call(ctx, http.MethodGet, url, nil, "", defaultRequestTimeout) + if err != nil { + return zero, err + } + return parseDataEnvelope[T](resp.body) +} + +// updateResource performs a PUT with a JSON body, unwrapping the data envelope. +func updateResource[T any](ctx context.Context, c *resourceContext, subPath string, body any) (T, error) { + var zero T + data, err := json.Marshal(body) + if err != nil { + return zero, err + } + url := c.mergedParams(NewQueryParams()).applyToURL(c.subURL(subPath)) + resp, err := c.http.call(ctx, http.MethodPut, url, data, contentTypeJSON, defaultRequestTimeout) + if err != nil { + return zero, err + } + return parseDataEnvelope[T](resp.body) +} + +// deleteResource performs a DELETE; a not-found is treated as a successful no-op. +func deleteResource(ctx context.Context, c *resourceContext, subPath string) error { + url := c.mergedParams(NewQueryParams()).applyToURL(c.subURL(subPath)) + _, err := c.http.call(ctx, http.MethodDelete, url, nil, "", defaultRequestTimeout) + if err != nil && !isNotFound(err) { + return err + } + return nil +} + +// listResource performs a GET returning a paginated list (data envelope wrapping items). +func listResource[T any](ctx context.Context, c *resourceContext, subPath string, params *QueryParams) (PaginationList[T], error) { + return getResourceRequired[PaginationList[T]](ctx, c, subPath, params) +} + +// createResource performs a POST with a JSON body, unwrapping the data envelope. +func createResource[T any](ctx context.Context, c *resourceContext, params *QueryParams, body any) (T, error) { + var zero T + data, err := json.Marshal(body) + if err != nil { + return zero, err + } + url := c.mergedParams(params).applyToURL(c.subURL("")) + resp, err := c.http.call(ctx, http.MethodPost, url, data, contentTypeJSON, defaultRequestTimeout) + if err != nil { + return zero, err + } + return parseDataEnvelope[T](resp.body) +} + +// getOrCreateNamed performs a POST that gets-or-creates a named resource +// (POST {collection}?name=...), unwrapping the data envelope. +func getOrCreateNamed[T any](ctx context.Context, c *resourceContext, name string) (T, error) { + var zero T + params := NewQueryParams() + if name != "" { + params.AddString("name", &name) + } + url := params.applyToURL(c.subURL("")) + resp, err := c.http.call(ctx, http.MethodPost, url, nil, "", defaultRequestTimeout) + if err != nil { + return zero, err + } + return parseDataEnvelope[T](resp.body) +} + +// postWithBody performs a POST with a raw body (optional) and content type, unwrapping the +// data envelope. Used where the input is arbitrary user JSON (actor.start, run.metamorph). +func postWithBody[T any](ctx context.Context, c *resourceContext, subPath string, params *QueryParams, body []byte, contentType string) (T, error) { + var zero T + url := c.mergedParams(params).applyToURL(c.subURL(subPath)) + resp, err := c.http.call(ctx, http.MethodPost, url, body, contentType, defaultRequestTimeout) + if err != nil { + return zero, err + } + return parseDataEnvelope[T](resp.body) +} + +// deleteWithBody performs a DELETE with a JSON body (used for batch request deletion), +// unwrapping the data envelope. +func deleteWithBody[T any](ctx context.Context, c *resourceContext, subPath string, params *QueryParams, body any) (T, error) { + var zero T + data, err := json.Marshal(body) + if err != nil { + return zero, err + } + url := c.mergedParams(params).applyToURL(c.subURL(subPath)) + resp, err := c.http.call(ctx, http.MethodDelete, url, data, contentTypeJSON, defaultRequestTimeout) + if err != nil { + return zero, err + } + return parseDataEnvelope[T](resp.body) +} + +// getRaw performs a GET returning the raw response (no data envelope). A not-found maps to +// (nil, nil). Used for logs and key-value-store record values. +func getRaw(ctx context.Context, c *resourceContext, subPath string, params *QueryParams) (*apiResponse, error) { + url := c.mergedParams(params).applyToURL(c.subURL(subPath)) + resp, err := c.http.call(ctx, http.MethodGet, url, nil, "", defaultRequestTimeout) + if err != nil { + if isNotFound(err) { + return nil, nil + } + return nil, err + } + return resp, nil +} + +// headExists performs a HEAD request, returning whether the resource exists. +func headExists(ctx context.Context, c *resourceContext, subPath string, params *QueryParams) (bool, error) { + url := c.mergedParams(params).applyToURL(c.subURL(subPath)) + _, err := c.http.call(ctx, http.MethodHead, url, nil, "", defaultRequestTimeout) + if err != nil { + if isNotFound(err) { + return false, nil + } + return false, err + } + return true, nil +} + +// putRaw performs a PUT with raw bytes and a content type (used for KVS record uploads). +func putRaw(ctx context.Context, c *resourceContext, subPath string, params *QueryParams, body []byte, contentType string) error { + url := c.mergedParams(params).applyToURL(c.subURL(subPath)) + _, err := c.http.call(ctx, http.MethodPut, url, body, contentType, defaultRequestTimeout) + return err +} + +// terminalChecker reports whether a fetched resource has reached a terminal state. +type terminalChecker[T any] func(*T) bool + +// waitForFinish polls a GET endpoint with waitForFinish until the resource reaches a +// terminal state or waitSecs elapses. waitSecs nil waits indefinitely. Returns the latest +// resource (finished, or still running if the wait budget was exhausted). +func waitForFinish[T any](ctx context.Context, c *resourceContext, waitSecs *int64, isTerminal terminalChecker[T]) (T, error) { + var zero T + start := time.Now() + var budget *time.Duration + if waitSecs != nil { + d := time.Duration(maxInt64(*waitSecs, 0)) * time.Second + budget = &d + } + + for { + var requestSecs int64 + if budget != nil { + elapsed := time.Since(start) + if elapsed >= *budget { + // Budget exhausted: one final immediate fetch. + params := NewQueryParams() + zeroSecs := int64(0) + params.AddInt("waitForFinish", &zeroSecs) + return getResourceRequired[T](ctx, c, "", params) + } + remaining := int64((*budget - elapsed).Seconds()) + requestSecs = minInt64(remaining, waitForFinishRequestSecs) + } else { + requestSecs = waitForFinishRequestSecs + } + + params := NewQueryParams() + params.AddInt("waitForFinish", &requestSecs) + + resource, present, err := getResource[T](ctx, c, "", params) + if err != nil { + return zero, err + } + if present { + if isTerminal(&resource) { + return resource, nil + } + if budget != nil && time.Since(start) >= *budget { + return resource, nil + } + } + + if !sleepWithContext(ctx, waitForFinishPollInterval) { + return zero, ctx.Err() + } + } +} + +func maxInt64(a, b int64) int64 { + if a > b { + return a + } + return b +} + +func minInt64(a, b int64) int64 { + if a < b { + return a + } + return b +} + +// mustMarshal serializes v to JSON, returning nil on error. Used for small, internally +// constructed bodies (maps of primitives) that cannot fail to marshal in practice. +func mustMarshal(v any) []byte { + data, _ := json.Marshal(v) + return data +} diff --git a/build.go b/build.go new file mode 100644 index 0000000..fa59551 --- /dev/null +++ b/build.go @@ -0,0 +1,92 @@ +package apify + +import ( + "context" + "encoding/json" +) + +// BuildCollectionClient is a client for a build collection: either the account-wide +// collection (GET /v2/actor-builds) or an Actor's builds (GET /v2/actors/{id}/builds). +type BuildCollectionClient struct { + ctx *resourceContext +} + +func newBuildCollectionClient(hc *httpClient, baseURL, resourcePath string) *BuildCollectionClient { + return &BuildCollectionClient{ctx: newCollectionContext(hc, baseURL, resourcePath)} +} + +// newBuildCollectionClientWithBase builds a collection client nested under another resource +// (e.g. an Actor), using base as the parent URL. +func newBuildCollectionClientWithBase(hc *httpClient, base, resourcePath string) *BuildCollectionClient { + return &BuildCollectionClient{ctx: newCollectionContext(hc, base, resourcePath)} +} + +// List lists builds. +func (c *BuildCollectionClient) List(ctx context.Context, options ListOptions) (PaginationList[Build], error) { + params := NewQueryParams() + options.apply(params) + return listResource[Build](ctx, c.ctx, "", params) +} + +// BuildClient is a client for a specific Actor build (/v2/actor-builds/{buildId}). +type BuildClient struct { + ctx *resourceContext + baseURL string + id string +} + +func newBuildClient(hc *httpClient, baseURL, id string) *BuildClient { + return &BuildClient{ + ctx: newSingleContext(hc, baseURL, "actor-builds", id), + baseURL: baseURL, + id: id, + } +} + +// Get fetches the build object. The bool reports whether it exists. +func (c *BuildClient) Get(ctx context.Context) (Build, bool, error) { + return c.GetWithWait(ctx, nil) +} + +// GetWithWait fetches the build, optionally asking the API to wait up to waitForFinishSecs +// seconds (max 60) for the build to finish before responding. Pass nil for an immediate +// fetch. Mirrors the reference client's get({ waitForFinish }). +func (c *BuildClient) GetWithWait(ctx context.Context, waitForFinishSecs *int64) (Build, bool, error) { + params := NewQueryParams() + params.AddInt("waitForFinish", waitForFinishSecs) + return getResource[Build](ctx, c.ctx, "", params) +} + +// Abort aborts the build and returns its updated state. +func (c *BuildClient) Abort(ctx context.Context) (Build, error) { + return postWithBody[Build](ctx, c.ctx, "abort", NewQueryParams(), nil, "") +} + +// Delete deletes the build. +func (c *BuildClient) Delete(ctx context.Context) error { + return deleteResource(ctx, c.ctx, "") +} + +// WaitForFinish polls until the build reaches a terminal state or waitSecs elapses (nil +// waits indefinitely). It returns the latest build. +func (c *BuildClient) WaitForFinish(ctx context.Context, waitSecs *int64) (Build, error) { + return waitForFinish[Build](ctx, c.ctx, waitSecs, func(b *Build) bool { return b.IsTerminal() }) +} + +// GetOpenAPIDefinition returns the OpenAPI definition generated for the build, or +// (nil, false, nil) if it is not available. The result is the raw OpenAPI document. +func (c *BuildClient) GetOpenAPIDefinition(ctx context.Context) (json.RawMessage, bool, error) { + resp, err := getRaw(ctx, c.ctx, "openapi.json", NewQueryParams()) + if err != nil { + return nil, false, err + } + if resp == nil { + return nil, false, nil + } + return resp.body, true, nil +} + +// Log returns a client for accessing this build's log. +func (c *BuildClient) Log() *LogClient { + return newNestedLogClient(c.ctx.http, c.ctx.subURL("")) +} diff --git a/client.go b/client.go index f2120e0..da2cfb8 100644 --- a/client.go +++ b/client.go @@ -1,775 +1,345 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient +// Package apify is the official, idiomatic Go client for the Apify API +// (https://docs.apify.com/api/v2). +// +// It provides a resource-oriented interface that mirrors the official JavaScript and Rust +// clients: start from an [ApifyClient], then drill down into resources (Actors, runs, +// datasets, key-value stores, request queues, tasks, schedules, webhooks, the store, users +// and logs). +// +// # Quick start +// +// client := apify.NewClient("my-api-token") +// +// // Start an Actor and wait for it to finish. +// run, err := client.Actor("apify/hello-world").Call(ctx, nil, apify.ActorStartOptions{}, nil) +// if err != nil { +// log.Fatal(err) +// } +// +// // Read items from the run's default dataset. +// page, err := client.Dataset(run.DefaultDatasetID).ListItems(ctx, apify.DatasetListItemsOptions{}) +// +// # Architecture +// +// - Public interface: [ApifyClient] and the resource clients it returns. +// - Replaceable transport: the [HTTPBackend] interface, with a default +// [DefaultHTTPBackend]. Swap it via [WithHTTPBackend]. +// - Cross-cutting behaviour (auth, User-Agent, retries with exponential backoff, +// timeouts) lives in the internal HTTP client and is applied to every request. +package apify import ( - "bytes" "context" - "encoding/json" - "encoding/xml" "errors" - "fmt" - "io" - "log" - "mime/multipart" - "net/http" - "net/http/httputil" - "net/url" "os" - "path/filepath" - "reflect" - "regexp" - "strconv" "strings" "time" - "unicode/utf8" - ) -var ( - JsonCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:[^;]+\+)?json)`) - XmlCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:[^;]+\+)?xml)`) - queryParamSplit = regexp.MustCompile(`(^|&)([^&]+)`) - queryDescape = strings.NewReplacer( "%5B", "[", "%5D", "]" ) +// Default configuration values, matching the reference clients. +const ( + // defaultBaseURL is the default base URL of the Apify API (without the /v2 suffix). + defaultBaseURL = "https://api.apify.com" + // defaultMaxRetries is the default maximum number of retries. + defaultMaxRetries = 8 + // defaultMinDelayBetweenRetries is the default minimum delay between retries. + defaultMinDelayBetweenRetries = 500 * time.Millisecond + // defaultTimeout is the default overall per-request timeout (6 minutes). + defaultTimeout = 360 * time.Second + // meUserPlaceholder addresses the current user (/users/me). + meUserPlaceholder = "me" ) -// APIClient manages communication with the Apify API API vv2-2026-06-16T064758Z -// In most cases there should be only one, shared, APIClient. -type APIClient struct { - cfg *Configuration - common service // Reuse a single struct instead of allocating one for each service on the heap. - - // API Services - - ActorBuildsAPI *ActorBuildsAPIService - - ActorRunsAPI *ActorRunsAPIService - - ActorTasksAPI *ActorTasksAPIService - - ActorsAPI *ActorsAPIService - - ActorsActorBuildsAPI *ActorsActorBuildsAPIService - - ActorsActorRunsAPI *ActorsActorRunsAPIService - - ActorsActorVersionsAPI *ActorsActorVersionsAPIService - - ActorsWebhookCollectionAPI *ActorsWebhookCollectionAPIService - - DefaultDatasetAPI *DefaultDatasetAPIService - - DefaultKeyValueStoreAPI *DefaultKeyValueStoreAPIService - - DefaultRequestQueueAPI *DefaultRequestQueueAPIService - - LastActorRunsAbortAPI *LastActorRunsAbortAPIService - - LastActorRunsDefaultDatasetAPI *LastActorRunsDefaultDatasetAPIService - - LastActorRunsDefaultKeyValueStoreAPI *LastActorRunsDefaultKeyValueStoreAPIService - - LastActorRunsDefaultRequestQueueAPI *LastActorRunsDefaultRequestQueueAPIService - - LastActorRunsLogAPI *LastActorRunsLogAPIService - - LastActorRunsMetamorphAPI *LastActorRunsMetamorphAPIService - - LastActorRunsRebootAPI *LastActorRunsRebootAPIService - - LastActorTaskRunsAbortAPI *LastActorTaskRunsAbortAPIService - - LastActorTaskRunsDefaultDatasetAPI *LastActorTaskRunsDefaultDatasetAPIService - - LastActorTaskRunsDefaultKeyValueStoreAPI *LastActorTaskRunsDefaultKeyValueStoreAPIService - - LastActorTaskRunsDefaultRequestQueueAPI *LastActorTaskRunsDefaultRequestQueueAPIService - - LastActorTaskRunsLogAPI *LastActorTaskRunsLogAPIService - - LastActorTaskRunsMetamorphAPI *LastActorTaskRunsMetamorphAPIService - - LastActorTaskRunsRebootAPI *LastActorTaskRunsRebootAPIService - - LogsAPI *LogsAPIService - - SchedulesAPI *SchedulesAPIService - - StorageDatasetsAPI *StorageDatasetsAPIService - - StorageKeyValueStoresAPI *StorageKeyValueStoresAPIService - - StorageRequestQueuesAPI *StorageRequestQueuesAPIService - - StorageRequestQueuesRequestsAPI *StorageRequestQueuesRequestsAPIService - - StorageRequestQueuesRequestsLocksAPI *StorageRequestQueuesRequestsLocksAPIService - - StoreAPI *StoreAPIService - - ToolsAPI *ToolsAPIService +// ApifyClient is the entry point for interacting with the Apify API. +// +// Construct it with [NewClient] (token-only) or [NewClientWithOptions], then obtain +// resource clients via the accessor methods, e.g. [ApifyClient.Actor], [ApifyClient.Dataset], +// [ApifyClient.Run]. It is safe for concurrent use. +type ApifyClient struct { + http *httpClient + baseURL string + publicBaseURL string +} - UsersAPI *UsersAPIService +// clientConfig accumulates the options passed to NewClientWithOptions. +type clientConfig struct { + token string + baseURL string + publicBaseURL string + maxRetries int + minDelayBetweenRetries time.Duration + timeout time.Duration + userAgentSuffix string + backend HTTPBackend + isAtHomeFn func() bool +} - WebhooksWebhookDispatchesAPI *WebhooksWebhookDispatchesAPIService +// Option configures an [ApifyClient]. Pass options to [NewClientWithOptions]. +type Option func(*clientConfig) - WebhooksWebhooksAPI *WebhooksWebhooksAPIService +// WithToken sets the API token used for authentication (sent as a Bearer token). +func WithToken(token string) Option { + return func(c *clientConfig) { c.token = token } } -type service struct { - client *APIClient +// WithBaseURL overrides the base URL of the API. The /v2 suffix is appended automatically. +// Defaults to https://api.apify.com. +func WithBaseURL(baseURL string) Option { + return func(c *clientConfig) { c.baseURL = baseURL } } -// NewAPIClient creates a new API client. Requires a userAgent string describing your application. -// optionally a custom http.Client to allow for advanced features such as caching. -func NewAPIClient(cfg *Configuration) *APIClient { - if cfg.HTTPClient == nil { - cfg.HTTPClient = http.DefaultClient - } +// WithPublicBaseURL overrides the base URL used when building public, shareable resource +// URLs (e.g. a signed dataset-items URL). Defaults to the API base URL. The /v2 suffix is +// appended automatically. +func WithPublicBaseURL(publicBaseURL string) Option { + return func(c *clientConfig) { c.publicBaseURL = publicBaseURL } +} - c := &APIClient{} - c.cfg = cfg - c.common.client = c - - // API Services - c.ActorBuildsAPI = (*ActorBuildsAPIService)(&c.common) - c.ActorRunsAPI = (*ActorRunsAPIService)(&c.common) - c.ActorTasksAPI = (*ActorTasksAPIService)(&c.common) - c.ActorsAPI = (*ActorsAPIService)(&c.common) - c.ActorsActorBuildsAPI = (*ActorsActorBuildsAPIService)(&c.common) - c.ActorsActorRunsAPI = (*ActorsActorRunsAPIService)(&c.common) - c.ActorsActorVersionsAPI = (*ActorsActorVersionsAPIService)(&c.common) - c.ActorsWebhookCollectionAPI = (*ActorsWebhookCollectionAPIService)(&c.common) - c.DefaultDatasetAPI = (*DefaultDatasetAPIService)(&c.common) - c.DefaultKeyValueStoreAPI = (*DefaultKeyValueStoreAPIService)(&c.common) - c.DefaultRequestQueueAPI = (*DefaultRequestQueueAPIService)(&c.common) - c.LastActorRunsAbortAPI = (*LastActorRunsAbortAPIService)(&c.common) - c.LastActorRunsDefaultDatasetAPI = (*LastActorRunsDefaultDatasetAPIService)(&c.common) - c.LastActorRunsDefaultKeyValueStoreAPI = (*LastActorRunsDefaultKeyValueStoreAPIService)(&c.common) - c.LastActorRunsDefaultRequestQueueAPI = (*LastActorRunsDefaultRequestQueueAPIService)(&c.common) - c.LastActorRunsLogAPI = (*LastActorRunsLogAPIService)(&c.common) - c.LastActorRunsMetamorphAPI = (*LastActorRunsMetamorphAPIService)(&c.common) - c.LastActorRunsRebootAPI = (*LastActorRunsRebootAPIService)(&c.common) - c.LastActorTaskRunsAbortAPI = (*LastActorTaskRunsAbortAPIService)(&c.common) - c.LastActorTaskRunsDefaultDatasetAPI = (*LastActorTaskRunsDefaultDatasetAPIService)(&c.common) - c.LastActorTaskRunsDefaultKeyValueStoreAPI = (*LastActorTaskRunsDefaultKeyValueStoreAPIService)(&c.common) - c.LastActorTaskRunsDefaultRequestQueueAPI = (*LastActorTaskRunsDefaultRequestQueueAPIService)(&c.common) - c.LastActorTaskRunsLogAPI = (*LastActorTaskRunsLogAPIService)(&c.common) - c.LastActorTaskRunsMetamorphAPI = (*LastActorTaskRunsMetamorphAPIService)(&c.common) - c.LastActorTaskRunsRebootAPI = (*LastActorTaskRunsRebootAPIService)(&c.common) - c.LogsAPI = (*LogsAPIService)(&c.common) - c.SchedulesAPI = (*SchedulesAPIService)(&c.common) - c.StorageDatasetsAPI = (*StorageDatasetsAPIService)(&c.common) - c.StorageKeyValueStoresAPI = (*StorageKeyValueStoresAPIService)(&c.common) - c.StorageRequestQueuesAPI = (*StorageRequestQueuesAPIService)(&c.common) - c.StorageRequestQueuesRequestsAPI = (*StorageRequestQueuesRequestsAPIService)(&c.common) - c.StorageRequestQueuesRequestsLocksAPI = (*StorageRequestQueuesRequestsLocksAPIService)(&c.common) - c.StoreAPI = (*StoreAPIService)(&c.common) - c.ToolsAPI = (*ToolsAPIService)(&c.common) - c.UsersAPI = (*UsersAPIService)(&c.common) - c.WebhooksWebhookDispatchesAPI = (*WebhooksWebhookDispatchesAPIService)(&c.common) - c.WebhooksWebhooksAPI = (*WebhooksWebhooksAPIService)(&c.common) - - return c -} - -func atoi(in string) (int, error) { - return strconv.Atoi(in) -} - -// selectHeaderContentType select a content type from the available list. -func selectHeaderContentType(contentTypes []string) string { - if len(contentTypes) == 0 { - return "" - } - if contains(contentTypes, "application/json") { - return "application/json" - } - return contentTypes[0] // use the first content type specified in 'consumes' +// WithMaxRetries sets the maximum number of retries for failed requests (default 8). +func WithMaxRetries(maxRetries int) Option { + return func(c *clientConfig) { c.maxRetries = maxRetries } } -// selectHeaderAccept join all accept types and return -func selectHeaderAccept(accepts []string) string { - if len(accepts) == 0 { - return "" - } +// WithMinDelayBetweenRetries sets the minimum delay between retries (default 500ms). +func WithMinDelayBetweenRetries(d time.Duration) Option { + return func(c *clientConfig) { c.minDelayBetweenRetries = d } +} - if contains(accepts, "application/json") { - return "application/json" - } +// WithTimeout sets the overall per-request timeout (default 360s). +func WithTimeout(d time.Duration) Option { + return func(c *clientConfig) { c.timeout = d } +} - return strings.Join(accepts, ",") +// WithUserAgentSuffix appends a custom suffix to the User-Agent header. +func WithUserAgentSuffix(suffix string) Option { + return func(c *clientConfig) { c.userAgentSuffix = suffix } } -// contains is a case insensitive match, finding needle in a haystack -func contains(haystack []string, needle string) bool { - for _, a := range haystack { - if strings.EqualFold(a, needle) { - return true - } - } - return false +// WithHTTPBackend replaces the default HTTP backend with a custom implementation. This is +// the seam that makes the transport a replaceable component. +func WithHTTPBackend(backend HTTPBackend) Option { + return func(c *clientConfig) { c.backend = backend } } -// Verify optional parameters are of the correct type. -func typeCheckParameter(obj interface{}, expected string, name string) error { - // Make sure there is an object. - if obj == nil { - return nil - } +// withIsAtHomeFn overrides how the client decides the isAtHome User-Agent flag (test seam). +func withIsAtHomeFn(fn func() bool) Option { + return func(c *clientConfig) { c.isAtHomeFn = fn } +} - // Check the type is as expected. - if reflect.TypeOf(obj).String() != expected { - return fmt.Errorf("expected %s to be of type %s but received %s", name, expected, reflect.TypeOf(obj).String()) - } - return nil +// defaultIsAtHome reports whether the client is running on the Apify platform, by reading +// the APIFY_IS_AT_HOME environment variable (matching the reference JS client). +func defaultIsAtHome() bool { + v := os.Getenv("APIFY_IS_AT_HOME") + return v != "" } -func parameterValueToString( obj interface{}, key string ) string { - if reflect.TypeOf(obj).Kind() != reflect.Ptr { - if actualObj, ok := obj.(interface{ GetActualInstanceValue() interface{} }); ok { - return fmt.Sprintf("%v", actualObj.GetActualInstanceValue()) - } +// NewClient creates a client authenticated with the given API token and default settings. +func NewClient(token string) *ApifyClient { + return NewClientWithOptions(WithToken(token)) +} - return fmt.Sprintf("%v", obj) - } - var param,ok = obj.(MappedNullable) - if !ok { - return "" +// NewClientWithOptions creates a client configured by the given options. +func NewClientWithOptions(opts ...Option) *ApifyClient { + cfg := &clientConfig{ + baseURL: defaultBaseURL, + maxRetries: defaultMaxRetries, + minDelayBetweenRetries: defaultMinDelayBetweenRetries, + timeout: defaultTimeout, + isAtHomeFn: defaultIsAtHome, } - dataMap,err := param.ToMap() - if err != nil { - return "" - } - return fmt.Sprintf("%v", dataMap[key]) -} - -// parameterAddToHeaderOrQuery adds the provided object to the request header or url query -// supporting deep object syntax -func parameterAddToHeaderOrQuery(headerOrQueryParams interface{}, keyPrefix string, obj interface{}, style string, collectionType string) { - var v = reflect.ValueOf(obj) - var value = "" - if v == reflect.ValueOf(nil) { - value = "null" - } else { - switch v.Kind() { - case reflect.Invalid: - value = "invalid" - - case reflect.Struct: - if t,ok := obj.(MappedNullable); ok { - dataMap,err := t.ToMap() - if err != nil { - return - } - parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, dataMap, style, collectionType) - return - } - if t, ok := obj.(time.Time); ok { - parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, t.Format(time.RFC3339Nano), style, collectionType) - return - } - value = v.Type().String() + " value" - case reflect.Slice: - var indValue = reflect.ValueOf(obj) - if indValue == reflect.ValueOf(nil) { - return - } - var lenIndValue = indValue.Len() - for i:=0;i<lenIndValue;i++ { - var arrayValue = indValue.Index(i) - var keyPrefixForCollectionType = keyPrefix - if style == "deepObject" { - keyPrefixForCollectionType = keyPrefix + "[" + strconv.Itoa(i) + "]" - } - parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefixForCollectionType, arrayValue.Interface(), style, collectionType) - } - return - - case reflect.Map: - var indValue = reflect.ValueOf(obj) - if indValue == reflect.ValueOf(nil) { - return - } - iter := indValue.MapRange() - for iter.Next() { - k,v := iter.Key(), iter.Value() - parameterAddToHeaderOrQuery(headerOrQueryParams, fmt.Sprintf("%s[%s]", keyPrefix, k.String()), v.Interface(), style, collectionType) - } - return - - case reflect.Interface: - fallthrough - case reflect.Ptr: - parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, v.Elem().Interface(), style, collectionType) - return - - case reflect.Int, reflect.Int8, reflect.Int16, - reflect.Int32, reflect.Int64: - value = strconv.FormatInt(v.Int(), 10) - case reflect.Uint, reflect.Uint8, reflect.Uint16, - reflect.Uint32, reflect.Uint64, reflect.Uintptr: - value = strconv.FormatUint(v.Uint(), 10) - case reflect.Float32, reflect.Float64: - value = strconv.FormatFloat(v.Float(), 'g', -1, 32) - case reflect.Bool: - value = strconv.FormatBool(v.Bool()) - case reflect.String: - value = v.String() - default: - value = v.Type().String() + " value" - } + for _, opt := range opts { + opt(cfg) } - switch valuesMap := headerOrQueryParams.(type) { - case url.Values: - if collectionType == "csv" && valuesMap.Get(keyPrefix) != "" { - valuesMap.Set(keyPrefix, valuesMap.Get(keyPrefix) + "," + value) - } else { - valuesMap.Add(keyPrefix, value) - } - break - case map[string]string: - valuesMap[keyPrefix] = value - break + backend := cfg.backend + if backend == nil { + backend = NewDefaultHTTPBackend() } -} -// helper for converting interface{} parameters to json strings -func parameterToJson(obj interface{}) (string, error) { - jsonBuf, err := json.Marshal(obj) - if err != nil { - return "", err - } - return string(jsonBuf), err -} + userAgent := BuildUserAgent(cfg.userAgentSuffix, cfg.isAtHomeFn) -// callAPI do the request. -func (c *APIClient) callAPI(request *http.Request) (*http.Response, error) { - if c.cfg.Debug { - dump, err := httputil.DumpRequestOut(request, true) - if err != nil { - return nil, err - } - log.Printf("\n%s\n", string(dump)) + hc := &httpClient{ + backend: backend, + token: cfg.token, + userAgent: userAgent, + retry: retryConfig{ + maxRetries: cfg.maxRetries, + minDelayBetweenRetries: cfg.minDelayBetweenRetries, + timeout: cfg.timeout, + }, } - resp, err := c.cfg.HTTPClient.Do(request) - if err != nil { - return resp, err + baseURL := strings.TrimRight(cfg.baseURL, "/") + "/v2" + publicSource := cfg.publicBaseURL + if publicSource == "" { + publicSource = cfg.baseURL } + publicBaseURL := strings.TrimRight(publicSource, "/") + "/v2" - if c.cfg.Debug { - dump, err := httputil.DumpResponse(resp, true) - if err != nil { - return resp, err - } - log.Printf("\n%s\n", string(dump)) - } - return resp, err -} - -// Allow modification of underlying config for alternate implementations and testing -// Caution: modifying the configuration while live can cause data races and potentially unwanted behavior -func (c *APIClient) GetConfig() *Configuration { - return c.cfg + return &ApifyClient{http: hc, baseURL: baseURL, publicBaseURL: publicBaseURL} } -type formFile struct { - fileBytes []byte - fileName string - formFileName string -} +// UserAgent returns the User-Agent header value this client sends. +func (c *ApifyClient) UserAgent() string { return c.http.userAgent } -// prepareRequest build the request -func (c *APIClient) prepareRequest( - ctx context.Context, - path string, method string, - postBody interface{}, - headerParams map[string]string, - queryParams url.Values, - formParams url.Values, - formFiles []formFile) (localVarRequest *http.Request, err error) { +// APIBaseURL returns the fully-qualified API base URL this client targets (including the +// /v2 suffix), e.g. https://api.apify.com/v2. Reflects any base-URL override. +func (c *ApifyClient) APIBaseURL() string { return c.baseURL } - var body *bytes.Buffer +// ----- Actor accessors ----------------------------------------------------- - // Detect postBody type and post. - if postBody != nil { - contentType := headerParams["Content-Type"] - if contentType == "" { - contentType = detectContentType(postBody) - headerParams["Content-Type"] = contentType - } +// Actors returns a client for the Actor collection (list & create Actors). +func (c *ApifyClient) Actors() *ActorCollectionClient { + return newActorCollectionClient(c.http, c.baseURL) +} - body, err = setBody(postBody, contentType) - if err != nil { - return nil, err - } - } +// Actor returns a client for a specific Actor, addressed by ID or username~name. +func (c *ApifyClient) Actor(id string) *ActorClient { + return newActorClient(c, c.http, c.baseURL, id) +} - // add form parameters and file if available. - if strings.HasPrefix(headerParams["Content-Type"], "multipart/form-data") && len(formParams) > 0 || (len(formFiles) > 0) { - if body != nil { - return nil, errors.New("Cannot specify postBody and multipart form at the same time.") - } - body = &bytes.Buffer{} - w := multipart.NewWriter(body) - - for k, v := range formParams { - for _, iv := range v { - if strings.HasPrefix(k, "@") { // file - err = addFile(w, k[1:], iv) - if err != nil { - return nil, err - } - } else { // form value - w.WriteField(k, iv) - } - } - } - for _, formFile := range formFiles { - if len(formFile.fileBytes) > 0 && formFile.fileName != "" { - w.Boundary() - part, err := w.CreateFormFile(formFile.formFileName, filepath.Base(formFile.fileName)) - if err != nil { - return nil, err - } - _, err = part.Write(formFile.fileBytes) - if err != nil { - return nil, err - } - } - } - - // Set the Boundary in the Content-Type - headerParams["Content-Type"] = w.FormDataContentType() - - // Set Content-Length - headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) - w.Close() - } +// ----- Build accessors ----------------------------------------------------- - if strings.HasPrefix(headerParams["Content-Type"], "application/x-www-form-urlencoded") && len(formParams) > 0 { - if body != nil { - return nil, errors.New("Cannot specify postBody and x-www-form-urlencoded form at the same time.") - } - body = &bytes.Buffer{} - body.WriteString(formParams.Encode()) - // Set Content-Length - headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) - } +// Builds returns a client for the Actor build collection (list builds). +func (c *ApifyClient) Builds() *BuildCollectionClient { + return newBuildCollectionClient(c.http, c.baseURL, "actor-builds") +} - // Setup path and query parameters - url, err := url.Parse(path) - if err != nil { - return nil, err - } +// Build returns a client for a specific Actor build. +func (c *ApifyClient) Build(id string) *BuildClient { + return newBuildClient(c.http, c.baseURL, id) +} - // Override request host, if applicable - if c.cfg.Host != "" { - url.Host = c.cfg.Host - } +// ----- Run accessors ------------------------------------------------------- - // Override request scheme, if applicable - if c.cfg.Scheme != "" { - url.Scheme = c.cfg.Scheme - } +// Runs returns a client for the Actor run collection (list runs). +func (c *ApifyClient) Runs() *RunCollectionClient { + return newRunCollectionClient(c.http, c.baseURL, "actor-runs") +} - // Adding Query Param - query := url.Query() - for k, v := range queryParams { - for _, iv := range v { - query.Add(k, iv) - } - } +// Run returns a client for a specific Actor run. +func (c *ApifyClient) Run(id string) *RunClient { + return newRunClient(c, c.http, c.baseURL, "actor-runs", id) +} - // Encode the parameters. - url.RawQuery = queryParamSplit.ReplaceAllStringFunc(query.Encode(), func(s string) string { - pieces := strings.Split(s, "=") - pieces[0] = queryDescape.Replace(pieces[0]) - return strings.Join(pieces, "=") - }) - - // Generate a new request - if body != nil { - localVarRequest, err = http.NewRequest(method, url.String(), body) - } else { - localVarRequest, err = http.NewRequest(method, url.String(), nil) - } - if err != nil { - return nil, err - } +// ----- Dataset accessors --------------------------------------------------- - // add header parameters, if any - if len(headerParams) > 0 { - headers := http.Header{} - for h, v := range headerParams { - headers[h] = []string{v} - } - localVarRequest.Header = headers - } +// Datasets returns a client for the dataset collection (list & get-or-create datasets). +func (c *ApifyClient) Datasets() *DatasetCollectionClient { + return newDatasetCollectionClient(c.http, c.baseURL) +} - // Add the user agent to the request. - localVarRequest.Header.Add("User-Agent", c.cfg.UserAgent) +// Dataset returns a client for a specific dataset, addressed by ID or name. +func (c *ApifyClient) Dataset(id string) *DatasetClient { + return newDatasetClient(c.http, c.baseURL, "datasets", id).withPublicBase(c.publicBaseURL) +} - if ctx != nil { - // add context to the request - localVarRequest = localVarRequest.WithContext(ctx) +// ----- Key-value store accessors ------------------------------------------- - // Walk through any authentication. +// KeyValueStores returns a client for the key-value store collection. +func (c *ApifyClient) KeyValueStores() *KeyValueStoreCollectionClient { + return newKeyValueStoreCollectionClient(c.http, c.baseURL) +} - // AccessToken Authentication - if auth, ok := ctx.Value(ContextAccessToken).(string); ok { - localVarRequest.Header.Add("Authorization", "Bearer "+auth) - } +// KeyValueStore returns a client for a specific key-value store, addressed by ID or name. +func (c *ApifyClient) KeyValueStore(id string) *KeyValueStoreClient { + return newKeyValueStoreClient(c.http, c.baseURL, "key-value-stores", id).withPublicBase(c.publicBaseURL) +} - } +// ----- Request queue accessors --------------------------------------------- - for header, value := range c.cfg.DefaultHeader { - localVarRequest.Header.Add(header, value) - } - return localVarRequest, nil +// RequestQueues returns a client for the request queue collection. +func (c *ApifyClient) RequestQueues() *RequestQueueCollectionClient { + return newRequestQueueCollectionClient(c.http, c.baseURL) } -func (c *APIClient) decode(v interface{}, b []byte, contentType string) (err error) { - if len(b) == 0 { - return nil - } - if s, ok := v.(*string); ok { - *s = string(b) - return nil - } - if r, ok := v.(*io.Reader); ok { - *r = bytes.NewReader(b) - return nil - } - // Must stay before the JSON branch: json.Unmarshal would base64-decode into *[]byte. - if p, ok := v.(*[]byte); ok { - *p = b - return nil - } - if f, ok := v.(*os.File); ok { - f, err = os.CreateTemp("", "HttpClientFile") - if err != nil { - return - } - _, err = f.Write(b) - if err != nil { - return - } - _, err = f.Seek(0, io.SeekStart) - return - } - if f, ok := v.(**os.File); ok { - *f, err = os.CreateTemp("", "HttpClientFile") - if err != nil { - return - } - _, err = (*f).Write(b) - if err != nil { - return - } - _, err = (*f).Seek(0, io.SeekStart) - return - } - if XmlCheck.MatchString(contentType) { - if err = xml.Unmarshal(b, v); err != nil { - return err - } - return nil - } - if JsonCheck.MatchString(contentType) { - if actualObj, ok := v.(interface{ GetActualInstance() interface{} }); ok { // oneOf, anyOf schemas - if unmarshalObj, ok := actualObj.(interface{ UnmarshalJSON([]byte) error }); ok { // make sure it has UnmarshalJSON defined - if err = unmarshalObj.UnmarshalJSON(b); err != nil { - return err - } - } else { - return errors.New("Unknown type with GetActualInstance but no unmarshalObj.UnmarshalJSON defined") - } - } else if err = json.Unmarshal(b, v); err != nil { // simple model - return err - } - return nil - } - return errors.New("undefined response type") +// RequestQueue returns a client for a specific request queue, addressed by ID or name. +func (c *ApifyClient) RequestQueue(id string) *RequestQueueClient { + return newRequestQueueClient(c.http, c.baseURL, "request-queues", id) } -// Add a file to the multipart request -func addFile(w *multipart.Writer, fieldName, path string) error { - file, err := os.Open(filepath.Clean(path)) - if err != nil { - return err - } - defer file.Close() +// ----- Task accessors ------------------------------------------------------ - part, err := w.CreateFormFile(fieldName, filepath.Base(path)) - if err != nil { - return err - } - _, err = io.Copy(part, file) +// Tasks returns a client for the Actor task collection (list & create tasks). +func (c *ApifyClient) Tasks() *TaskCollectionClient { + return newTaskCollectionClient(c.http, c.baseURL) +} - return err +// Task returns a client for a specific Actor task. +func (c *ApifyClient) Task(id string) *TaskClient { + return newTaskClient(c, c.http, c.baseURL, id) } -// Set request body from an interface{} -func setBody(body interface{}, contentType string) (bodyBuf *bytes.Buffer, err error) { - if bodyBuf == nil { - bodyBuf = &bytes.Buffer{} - } +// ----- Schedule accessors -------------------------------------------------- - if reader, ok := body.(io.Reader); ok { - _, err = bodyBuf.ReadFrom(reader) - } else if fp, ok := body.(*os.File); ok { - _, err = bodyBuf.ReadFrom(fp) - } else if b, ok := body.([]byte); ok { - _, err = bodyBuf.Write(b) - } else if s, ok := body.(string); ok { - _, err = bodyBuf.WriteString(s) - } else if s, ok := body.(*string); ok { - _, err = bodyBuf.WriteString(*s) - } else if JsonCheck.MatchString(contentType) { - err = json.NewEncoder(bodyBuf).Encode(body) - } else if XmlCheck.MatchString(contentType) { - var bs []byte - bs, err = xml.Marshal(body) - if err == nil { - bodyBuf.Write(bs) - } - } +// Schedules returns a client for the schedule collection (list & create schedules). +func (c *ApifyClient) Schedules() *ScheduleCollectionClient { + return newScheduleCollectionClient(c.http, c.baseURL) +} - if err != nil { - return nil, err - } +// Schedule returns a client for a specific schedule. +func (c *ApifyClient) Schedule(id string) *ScheduleClient { + return newScheduleClient(c.http, c.baseURL, id) +} - if bodyBuf.Len() == 0 { - err = fmt.Errorf("invalid body type %s\n", contentType) - return nil, err - } - return bodyBuf, nil -} - -// detectContentType method is used to figure out `Request.Body` content type for request header -func detectContentType(body interface{}) string { - contentType := "text/plain; charset=utf-8" - kind := reflect.TypeOf(body).Kind() - - switch kind { - case reflect.Struct, reflect.Map, reflect.Ptr: - contentType = "application/json; charset=utf-8" - case reflect.String: - contentType = "text/plain; charset=utf-8" - default: - if b, ok := body.([]byte); ok { - contentType = http.DetectContentType(b) - } else if kind == reflect.Slice { - contentType = "application/json; charset=utf-8" - } - } +// ----- Webhook accessors --------------------------------------------------- - return contentType -} - -// Ripped from https://github.com/gregjones/httpcache/blob/master/httpcache.go -type cacheControl map[string]string - -func parseCacheControl(headers http.Header) cacheControl { - cc := cacheControl{} - ccHeader := headers.Get("Cache-Control") - for _, part := range strings.Split(ccHeader, ",") { - part = strings.Trim(part, " ") - if part == "" { - continue - } - if strings.ContainsRune(part, '=') { - keyval := strings.Split(part, "=") - cc[strings.Trim(keyval[0], " ")] = strings.Trim(keyval[1], ",") - } else { - cc[part] = "" - } - } - return cc +// Webhooks returns a client for the webhook collection (list & create webhooks). +func (c *ApifyClient) Webhooks() *WebhookCollectionClient { + return newWebhookCollectionClient(c.http, c.baseURL) } -// CacheExpires helper function to determine remaining time before repeating a request. -func CacheExpires(r *http.Response) time.Time { - // Figure out when the cache expires. - var expires time.Time - now, err := time.Parse(time.RFC1123, r.Header.Get("date")) - if err != nil { - return time.Now() - } - respCacheControl := parseCacheControl(r.Header) - - if maxAge, ok := respCacheControl["max-age"]; ok { - lifetime, err := time.ParseDuration(maxAge + "s") - if err != nil { - expires = now - } else { - expires = now.Add(lifetime) - } - } else { - expiresHeader := r.Header.Get("Expires") - if expiresHeader != "" { - expires, err = time.Parse(time.RFC1123, expiresHeader) - if err != nil { - expires = now - } - } - } - return expires +// Webhook returns a client for a specific webhook. +func (c *ApifyClient) Webhook(id string) *WebhookClient { + return newWebhookClient(c.http, c.baseURL, id) } -func strlen(s string) int { - return utf8.RuneCountInString(s) +// WebhookDispatches returns a client for the webhook dispatch collection. +func (c *ApifyClient) WebhookDispatches() *WebhookDispatchCollectionClient { + return newWebhookDispatchCollectionClient(c.http, c.baseURL) } -// GenericOpenAPIError Provides access to the body, error and model on returned errors. -type GenericOpenAPIError struct { - body []byte - error string - model interface{} +// WebhookDispatch returns a client for a specific webhook dispatch. +func (c *ApifyClient) WebhookDispatch(id string) *WebhookDispatchClient { + return newWebhookDispatchClient(c.http, c.baseURL, id) } -// Error returns non-empty string if there was an error. -func (e GenericOpenAPIError) Error() string { - return e.error -} +// ----- Misc accessors ------------------------------------------------------ -// Body returns the raw bytes of the response -func (e GenericOpenAPIError) Body() []byte { - return e.body +// Store returns a client for browsing the Apify Store. +func (c *ApifyClient) Store() *StoreCollectionClient { + return newStoreCollectionClient(c.http, c.baseURL) } -// Model returns the unpacked model of the error -func (e GenericOpenAPIError) Model() interface{} { - return e.model +// Log returns a client for accessing a build's or run's log. +func (c *ApifyClient) Log(buildOrRunID string) *LogClient { + return newLogClient(c.http, c.baseURL, "logs", buildOrRunID) } -// format error message using title and detail when model implements rfc7807 -func formatErrorMessage(status string, v interface{}) string { - str := "" - metaValue := reflect.ValueOf(v).Elem() - - if metaValue.Kind() == reflect.Struct { - field := metaValue.FieldByName("Title") - if field != (reflect.Value{}) { - str = fmt.Sprintf("%s", field.Interface()) - } +// Me returns a client for the current user (/users/me). +func (c *ApifyClient) Me() *UserClient { + return newUserClient(c.http, c.baseURL, meUserPlaceholder) +} - field = metaValue.FieldByName("Detail") - if field != (reflect.Value{}) { - str = fmt.Sprintf("%s (%s)", str, field.Interface()) - } - } +// User returns a client for a specific user by ID or username. +func (c *ApifyClient) User(id string) *UserClient { + return newUserClient(c.http, c.baseURL, id) +} - return strings.TrimSpace(fmt.Sprintf("%s %s", status, str)) +// SetStatusMessage sets the status message of the current Actor run. +// +// This convenience method updates the run identified by the ACTOR_RUN_ID environment +// variable, so it only works when called from inside an Actor run. If isTerminal is true, +// the message becomes final and won't be overwritten. It returns an error if ACTOR_RUN_ID +// is not set. +func (c *ApifyClient) SetStatusMessage(ctx context.Context, message string, isTerminal bool) (ActorRun, error) { + runID := os.Getenv("ACTOR_RUN_ID") + if runID == "" { + return ActorRun{}, errors.New("ACTOR_RUN_ID environment variable is not set") + } + body := map[string]any{ + "statusMessage": message, + "isStatusMessageTerminal": isTerminal, + } + return c.Run(runID).Update(ctx, body) } diff --git a/client_meta_test.go b/client_meta_test.go new file mode 100644 index 0000000..7d180ce --- /dev/null +++ b/client_meta_test.go @@ -0,0 +1,67 @@ +package apify + +import ( + "strings" + "testing" +) + +func TestVersionConstants(t *testing.T) { + if CLIENT_VERSION == "" || !(CLIENT_VERSION[0] >= '0' && CLIENT_VERSION[0] <= '9') { + t.Fatalf("CLIENT_VERSION should start with a digit, got %q", CLIENT_VERSION) + } + if !strings.HasPrefix(API_SPEC_VERSION, "v2-") || !strings.HasSuffix(API_SPEC_VERSION, "Z") { + t.Fatalf("API_SPEC_VERSION should match v2-...Z, got %q", API_SPEC_VERSION) + } +} + +func TestUserAgentFormat(t *testing.T) { + client := NewClient("token") + ua := client.UserAgent() + if !strings.HasPrefix(ua, "ApifyClient/"+CLIENT_VERSION+" (") { + t.Fatalf("unexpected user-agent prefix: %q", ua) + } + if !strings.Contains(ua, "Go/") { + t.Fatalf("user-agent must report the Go version: %q", ua) + } + if !strings.Contains(ua, "isAtHome/") { + t.Fatalf("user-agent must report isAtHome: %q", ua) + } + // The Go/ token must be followed by a real version digit, not empty. + after := strings.SplitN(ua, "Go/", 2)[1] + if len(after) == 0 || !(after[0] >= '0' && after[0] <= '9') { + t.Fatalf("Go version must be a real version, got %q", ua) + } +} + +func TestUserAgentIsAtHomeFlag(t *testing.T) { + // isAtHome flag must be driven by the platform env var, not flipped arbitrarily. + offClient := NewClientWithOptions(WithToken("t"), withIsAtHomeFn(func() bool { return false })) + if !strings.Contains(offClient.UserAgent(), "isAtHome/false") { + t.Fatalf("expected isAtHome/false, got %q", offClient.UserAgent()) + } + onClient := NewClientWithOptions(WithToken("t"), withIsAtHomeFn(func() bool { return true })) + if !strings.Contains(onClient.UserAgent(), "isAtHome/true") { + t.Fatalf("expected isAtHome/true, got %q", onClient.UserAgent()) + } +} + +func TestUserAgentSuffix(t *testing.T) { + client := NewClientWithOptions(WithToken("t"), WithUserAgentSuffix("MyTool/1.0")) + if !strings.HasSuffix(client.UserAgent(), "; MyTool/1.0") { + t.Fatalf("expected user-agent suffix, got %q", client.UserAgent()) + } +} + +func TestBaseURLDefaultAndV2Suffix(t *testing.T) { + client := NewClient("t") + if client.APIBaseURL() != "https://api.apify.com/v2" { + t.Fatalf("unexpected default base URL: %q", client.APIBaseURL()) + } +} + +func TestBaseURLOverrideAppendsV2(t *testing.T) { + client := NewClientWithOptions(WithToken("t"), WithBaseURL("https://api.example.com/")) + if client.APIBaseURL() != "https://api.example.com/v2" { + t.Fatalf("unexpected base URL: %q", client.APIBaseURL()) + } +} diff --git a/common.go b/common.go new file mode 100644 index 0000000..edb24ad --- /dev/null +++ b/common.go @@ -0,0 +1,233 @@ +package apify + +import ( + "encoding/json" + "net/url" + "runtime" + "strconv" + "strings" +) + +// dataEnvelope unwraps the top-level `{ "data": ... }` wrapper used by most Apify endpoints. +type dataEnvelope[T any] struct { + Data T `json:"data"` +} + +// parseDataEnvelope parses a JSON response body wrapped in a `data` envelope. +func parseDataEnvelope[T any](body []byte) (T, error) { + var env dataEnvelope[T] + err := json.Unmarshal(body, &env) + return env.Data, err +} + +// Error type strings the API returns for missing resources. +const ( + recordNotFoundType = "record-not-found" + recordOrTokenNotFoundType = "record-or-token-not-found" + notFoundStatusCode = 404 +) + +// isNotFound reports whether err represents a "resource not found" API error, mirroring +// the reference clients' catchNotFoundOrThrow: a get/delete/head on a missing resource +// should resolve to "absent" rather than raise. +func isNotFound(err error) bool { + apiErr, ok := AsAPIError(err) + if !ok { + return false + } + if apiErr.StatusCode != notFoundStatusCode { + return false + } + return apiErr.Type == recordNotFoundType || + apiErr.Type == recordOrTokenNotFoundType || + apiErr.HTTPMethod == http_MethodHead +} + +// http_MethodHead avoids importing net/http here just for the constant. +const http_MethodHead = "HEAD" + +// QueryParams is an ordered collection of query parameters that omits absent values and +// encodes booleans as 1/0, matching the Apify API conventions. +type QueryParams struct { + pairs [][2]string +} + +// NewQueryParams returns an empty QueryParams. +func NewQueryParams() *QueryParams { return &QueryParams{} } + +// AddString adds a string parameter if value is non-nil. +func (q *QueryParams) AddString(key string, value *string) *QueryParams { + if value != nil { + q.pairs = append(q.pairs, [2]string{key, *value}) + } + return q +} + +// AddInt adds an integer parameter if value is non-nil. +func (q *QueryParams) AddInt(key string, value *int64) *QueryParams { + if value != nil { + q.pairs = append(q.pairs, [2]string{key, strconv.FormatInt(*value, 10)}) + } + return q +} + +// AddFloat adds a floating-point parameter if value is non-nil. +func (q *QueryParams) AddFloat(key string, value *float64) *QueryParams { + if value != nil { + q.pairs = append(q.pairs, [2]string{key, strconv.FormatFloat(*value, 'f', -1, 64)}) + } + return q +} + +// AddBool adds a boolean parameter, encoded as 1/0, if value is non-nil. +func (q *QueryParams) AddBool(key string, value *bool) *QueryParams { + if value != nil { + v := "0" + if *value { + v = "1" + } + q.pairs = append(q.pairs, [2]string{key, v}) + } + return q +} + +// AddCSV adds a comma-joined list parameter if value is non-empty. +func (q *QueryParams) AddCSV(key string, value []string) *QueryParams { + if len(value) > 0 { + q.pairs = append(q.pairs, [2]string{key, strings.Join(value, ",")}) + } + return q +} + +// addRaw appends an already-stringified key/value pair. +func (q *QueryParams) addRaw(key, value string) *QueryParams { + q.pairs = append(q.pairs, [2]string{key, value}) + return q +} + +// IsEmpty reports whether no parameters were added. +func (q *QueryParams) IsEmpty() bool { return len(q.pairs) == 0 } + +// clone returns a copy of q. +func (q *QueryParams) clone() *QueryParams { + out := &QueryParams{pairs: make([][2]string, len(q.pairs))} + copy(out.pairs, q.pairs) + return out +} + +// extend appends all pairs from other to q. +func (q *QueryParams) extend(other *QueryParams) { + if other == nil { + return + } + q.pairs = append(q.pairs, other.pairs...) +} + +// applyToURL appends the parameters to rawURL as a query string. +func (q *QueryParams) applyToURL(rawURL string) string { + if len(q.pairs) == 0 { + return rawURL + } + var b strings.Builder + for i, p := range q.pairs { + if i > 0 { + b.WriteByte('&') + } + b.WriteString(url.QueryEscape(p[0])) + b.WriteByte('=') + b.WriteString(url.QueryEscape(p[1])) + } + sep := "?" + if strings.Contains(rawURL, "?") { + sep = "&" + } + return rawURL + sep + b.String() +} + +// ListOptions holds the standard offset/limit pagination shared by most list endpoints. +type ListOptions struct { + // Offset is the number of items to skip from the beginning of the list. + Offset *int64 + // Limit is the maximum number of items to return. + Limit *int64 + // Desc, if true, returns items newest-first. + Desc *bool +} + +func (o ListOptions) apply(q *QueryParams) { + q.AddInt("offset", o.Offset).AddInt("limit", o.Limit).AddBool("desc", o.Desc) +} + +// StorageListOptions holds the options shared by the storage collection list endpoints +// (GET /v2/datasets, /v2/key-value-stores, /v2/request-queues), which add `unnamed` and +// `ownership` filters on top of the standard pagination. +type StorageListOptions struct { + // Offset is the number of items to skip from the beginning of the list. + Offset *int64 + // Limit is the maximum number of items to return. + Limit *int64 + // Desc, if true, returns items newest-first. + Desc *bool + // Unnamed, if true, includes unnamed storages in the result. + Unnamed *bool + // Ownership filters by ownership (e.g. "OWNED" / "ACCESSIBLE"). + Ownership *string +} + +func (o StorageListOptions) apply(q *QueryParams) { + q.AddInt("offset", o.Offset). + AddInt("limit", o.Limit). + AddBool("desc", o.Desc). + AddBool("unnamed", o.Unnamed). + AddString("ownership", o.Ownership) +} + +// PaginationList is a single page of an offset/limit-paginated list. +type PaginationList[T any] struct { + // Total is the total number of items available across all pages. + Total int64 `json:"total"` + // Offset is the number of items skipped at the start. + Offset int64 `json:"offset"` + // Limit is the maximum number of items the API would return for this request. + Limit int64 `json:"limit"` + // Count is the number of items actually returned in this page. + Count int64 `json:"count"` + // Desc reports whether the items are in descending order. + Desc bool `json:"desc"` + // Items are the items of this page. + Items []T `json:"items"` +} + +// BuildUserAgent builds the User-Agent header value mandated by the client requirements: +// `ApifyClient/{version} ({os}; {language version}); isAtHome/{isAtHome}`. +// +// isAtHome is driven by the platform's APIFY_IS_AT_HOME environment variable, matching the +// reference JS client (which reads it via @apify/consts). +func BuildUserAgent(suffix string, isAtHomeFn func() bool) string { + atHome := "false" + if isAtHomeFn() { + atHome = "true" + } + ua := "ApifyClient/" + CLIENT_VERSION + " (" + runtime.GOOS + "; Go/" + goVersion() + "); isAtHome/" + atHome + if suffix != "" { + ua += "; " + suffix + } + return ua +} + +// goVersion returns the runtime Go version (e.g. "1.24.7"), stripping the leading "go". +func goVersion() string { + return strings.TrimPrefix(runtime.Version(), "go") +} + +// toSafeID encodes a resource id so it is safe to embed in a URL path. Apify uses the +// `username~resourcename` form, so the first `/` of an id is replaced with `~`. +func toSafeID(id string) string { + return strings.Replace(id, "/", "~", 1) +} + +// encodePathSegment percent-encodes a single URL path segment, so that values +// interpolated into the path (record keys, request IDs) cannot break out of the segment. +func encodePathSegment(input string) string { + return url.PathEscape(input) +} diff --git a/configuration.go b/configuration.go deleted file mode 100644 index 5b92cb6..0000000 --- a/configuration.go +++ /dev/null @@ -1,221 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "context" - "fmt" - "net/http" - "strings" -) - -// contextKeys are used to identify the type of value in the context. -// Since these are string, it is possible to get a short description of the -// context key for logging and debugging using key.String(). - -type contextKey string - -func (c contextKey) String() string { - return "auth " + string(c) -} - -var ( - // ContextAccessToken takes a string oauth2 access token as authentication for the request. - ContextAccessToken = contextKey("accesstoken") - - // ContextAPIKeys takes a string apikey as authentication for the request - ContextAPIKeys = contextKey("apiKeys") - - // ContextServerIndex uses a server configuration from the index. - ContextServerIndex = contextKey("serverIndex") - - // ContextOperationServerIndices uses a server configuration from the index mapping. - ContextOperationServerIndices = contextKey("serverOperationIndices") - - // ContextServerVariables overrides a server configuration variables. - ContextServerVariables = contextKey("serverVariables") - - // ContextOperationServerVariables overrides a server configuration variables using operation specific values. - ContextOperationServerVariables = contextKey("serverOperationVariables") -) - -// BasicAuth provides basic http authentication to a request passed via context using ContextBasicAuth -type BasicAuth struct { - UserName string `json:"userName,omitempty"` - Password string `json:"password,omitempty"` -} - -// APIKey provides API key based authentication to a request passed via context using ContextAPIKey -type APIKey struct { - Key string - Prefix string -} - -// ServerVariable stores the information about a server variable -type ServerVariable struct { - Description string - DefaultValue string - EnumValues []string -} - -// ServerConfiguration stores the information about a server -type ServerConfiguration struct { - URL string - Description string - Variables map[string]ServerVariable -} - -// ServerConfigurations stores multiple ServerConfiguration items -type ServerConfigurations []ServerConfiguration - -// Configuration stores the configuration of the API client -type Configuration struct { - Host string `json:"host,omitempty"` - Scheme string `json:"scheme,omitempty"` - DefaultHeader map[string]string `json:"defaultHeader,omitempty"` - UserAgent string `json:"userAgent,omitempty"` - Debug bool `json:"debug,omitempty"` - Servers ServerConfigurations - OperationServers map[string]ServerConfigurations - HTTPClient *http.Client -} - -// NewConfiguration returns a new Configuration object -func NewConfiguration() *Configuration { - cfg := &Configuration{ - DefaultHeader: make(map[string]string), - UserAgent: "OpenAPI-Generator/1.0.0/go", - Debug: false, - Servers: ServerConfigurations{ - { - URL: "https://api.apify.com", - Description: "No description provided", - }, - }, - OperationServers: map[string]ServerConfigurations{ - }, - } - return cfg -} - -// AddDefaultHeader adds a new HTTP header to the default header in the request -func (c *Configuration) AddDefaultHeader(key string, value string) { - c.DefaultHeader[key] = value -} - -// URL formats template on a index using given variables -func (sc ServerConfigurations) URL(index int, variables map[string]string) (string, error) { - if index < 0 || len(sc) <= index { - return "", fmt.Errorf("index %v out of range %v", index, len(sc)-1) - } - server := sc[index] - url := server.URL - - // go through variables and replace placeholders - for name, variable := range server.Variables { - if value, ok := variables[name]; ok { - found := bool(len(variable.EnumValues) == 0) - for _, enumValue := range variable.EnumValues { - if value == enumValue { - found = true - } - } - if !found { - return "", fmt.Errorf("the variable %s in the server URL has invalid value %v. Must be %v", name, value, variable.EnumValues) - } - url = strings.Replace(url, "{"+name+"}", value, -1) - } else { - url = strings.Replace(url, "{"+name+"}", variable.DefaultValue, -1) - } - } - return url, nil -} - -// ServerURL returns URL based on server settings -func (c *Configuration) ServerURL(index int, variables map[string]string) (string, error) { - return c.Servers.URL(index, variables) -} - -func getServerIndex(ctx context.Context) (int, error) { - si := ctx.Value(ContextServerIndex) - if si != nil { - if index, ok := si.(int); ok { - return index, nil - } - return 0, reportError("Invalid type %T should be int", si) - } - return 0, nil -} - -func getServerOperationIndex(ctx context.Context, endpoint string) (int, error) { - osi := ctx.Value(ContextOperationServerIndices) - if osi != nil { - if operationIndices, ok := osi.(map[string]int); !ok { - return 0, reportError("Invalid type %T should be map[string]int", osi) - } else { - index, ok := operationIndices[endpoint] - if ok { - return index, nil - } - } - } - return getServerIndex(ctx) -} - -func getServerVariables(ctx context.Context) (map[string]string, error) { - sv := ctx.Value(ContextServerVariables) - if sv != nil { - if variables, ok := sv.(map[string]string); ok { - return variables, nil - } - return nil, reportError("ctx value of ContextServerVariables has invalid type %T should be map[string]string", sv) - } - return nil, nil -} - -func getServerOperationVariables(ctx context.Context, endpoint string) (map[string]string, error) { - osv := ctx.Value(ContextOperationServerVariables) - if osv != nil { - if operationVariables, ok := osv.(map[string]map[string]string); !ok { - return nil, reportError("ctx value of ContextOperationServerVariables has invalid type %T should be map[string]map[string]string", osv) - } else { - variables, ok := operationVariables[endpoint] - if ok { - return variables, nil - } - } - } - return getServerVariables(ctx) -} - -// ServerURLWithContext returns a new server URL given an endpoint -func (c *Configuration) ServerURLWithContext(ctx context.Context, endpoint string) (string, error) { - sc, ok := c.OperationServers[endpoint] - if !ok { - sc = c.Servers - } - - if ctx == nil { - return sc.URL(0, nil) - } - - index, err := getServerOperationIndex(ctx, endpoint) - if err != nil { - return "", err - } - - variables, err := getServerOperationVariables(ctx, endpoint) - if err != nil { - return "", err - } - - return sc.URL(index, variables) -} diff --git a/dataset.go b/dataset.go new file mode 100644 index 0000000..d47a0ef --- /dev/null +++ b/dataset.go @@ -0,0 +1,284 @@ +package apify + +import ( + "context" + "encoding/json" + "net/http" + "strconv" +) + +// DatasetListItemsOptions configures listing or downloading dataset items +// (GET /v2/datasets/{datasetId}/items). +type DatasetListItemsOptions struct { + // Offset is the number of items to skip. + Offset *int64 + // Limit is the maximum number of items to return. + Limit *int64 + // Desc returns items newest-first. + Desc *bool + // Fields restricts the output to these fields. + Fields []string + // OutputFields positionally renames the fields selected by Fields in the output + // (requires Fields). The i-th name becomes the output name of the i-th Fields entry. + OutputFields []string + // Omit excludes these fields from the output. + Omit []string + // SkipEmpty skips empty items. + SkipEmpty *bool + // SkipHidden skips hidden fields (those starting with "#"). + SkipHidden *bool + // Clean returns only clean (non-empty, non-hidden) items. + Clean *bool + // Unwind expands these fields (each array element becomes a separate item). + Unwind []string + // Flatten flattens these nested fields into dot-notation keys. + Flatten []string + // View selects a predefined dataset view for field selection. + View *string + // Simplified returns simplified (flattened, cleaned) items. + Simplified *bool + // SkipFailedPages skips items that come from failed pages. + SkipFailedPages *bool + // Signature is a pre-shared URL signature granting access without an API token. + Signature *string +} + +func (o DatasetListItemsOptions) apply(q *QueryParams) { + q.AddInt("offset", o.Offset). + AddInt("limit", o.Limit). + AddBool("desc", o.Desc). + AddCSV("fields", o.Fields). + AddCSV("outputFields", o.OutputFields). + AddCSV("omit", o.Omit). + AddBool("skipEmpty", o.SkipEmpty). + AddBool("skipHidden", o.SkipHidden). + AddBool("clean", o.Clean). + AddCSV("unwind", o.Unwind). + AddCSV("flatten", o.Flatten). + AddString("view", o.View). + AddBool("simplified", o.Simplified). + AddBool("skipFailedPages", o.SkipFailedPages). + AddString("signature", o.Signature) +} + +// DownloadItemsFormat is an output format for [DatasetClient.DownloadItems]. +type DownloadItemsFormat string + +const ( + // FormatJSON serializes items as a JSON array. + FormatJSON DownloadItemsFormat = "json" + // FormatJSONL serializes items as newline-delimited JSON. + FormatJSONL DownloadItemsFormat = "jsonl" + // FormatCSV serializes items as comma-separated values. + FormatCSV DownloadItemsFormat = "csv" + // FormatXLSX serializes items as a Microsoft Excel (XLSX) workbook. + FormatXLSX DownloadItemsFormat = "xlsx" + // FormatXML serializes items as XML. + FormatXML DownloadItemsFormat = "xml" + // FormatRSS serializes items as an RSS feed. + FormatRSS DownloadItemsFormat = "rss" + // FormatHTML serializes items as an HTML table. + FormatHTML DownloadItemsFormat = "html" +) + +// DatasetDownloadOptions adds format-specific options for [DatasetClient.DownloadItems] on +// top of the shared item filtering/projection options. +type DatasetDownloadOptions struct { + // Items holds the shared filtering/projection options. + Items DatasetListItemsOptions + // Attachment sets Content-Disposition: attachment on the response. + Attachment *bool + // Bom prepends a UTF-8 BOM (useful for Excel-compatible CSV). + Bom *bool + // Delimiter is the CSV field delimiter (default ","). + Delimiter *string + // SkipHeaderRow omits the CSV header row. + SkipHeaderRow *bool + // XMLRoot is the name of the root XML element (default "items"). + XMLRoot *string + // XMLRow is the name of the per-item XML element (default "item"). + XMLRow *string + // FeedTitle is the title used for RSS/Atom feed exports. + FeedTitle *string + // FeedDescription is the description used for RSS/Atom feed exports. + FeedDescription *string +} + +func (o DatasetDownloadOptions) apply(q *QueryParams) { + o.Items.apply(q) + q.AddBool("attachment", o.Attachment). + AddBool("bom", o.Bom). + AddString("delimiter", o.Delimiter). + AddBool("skipHeaderRow", o.SkipHeaderRow). + AddString("xmlRoot", o.XMLRoot). + AddString("xmlRow", o.XMLRow). + AddString("feedTitle", o.FeedTitle). + AddString("feedDescription", o.FeedDescription) +} + +// DatasetClient is a client for a specific dataset (and run-nested variants). +type DatasetClient struct { + ctx *resourceContext +} + +func newDatasetClient(hc *httpClient, baseURL, resourcePath, id string) *DatasetClient { + return &DatasetClient{ctx: newSingleContext(hc, baseURL, resourcePath, id)} +} + +// newDatasetNestedClient creates a dataset client for a run's default dataset (no ID; +// nested path only, e.g. /v2/actor-runs/{runId}/dataset). +func newDatasetNestedClient(hc *httpClient, base, subPath string) *DatasetClient { + return &DatasetClient{ctx: newCollectionContext(hc, base, subPath)} +} + +// withPublicBase sets the public origin used when building shareable URLs. +func (c *DatasetClient) withPublicBase(publicBaseURL string) *DatasetClient { + c.ctx = c.ctx.withPublicOrigin(publicBaseURL) + return c +} + +// Get fetches the dataset metadata. The bool reports whether it exists. +func (c *DatasetClient) Get(ctx context.Context) (Dataset, bool, error) { + return getResource[Dataset](ctx, c.ctx, "", NewQueryParams()) +} + +// Update updates the dataset metadata (e.g. name, title) and returns the updated object. +func (c *DatasetClient) Update(ctx context.Context, newFields any) (Dataset, error) { + return updateResource[Dataset](ctx, c.ctx, "", newFields) +} + +// Delete deletes the dataset. +func (c *DatasetClient) Delete(ctx context.Context) error { + return deleteResource(ctx, c.ctx, "") +} + +// ListItems lists items from the dataset. +// +// The dataset items endpoint returns a bare JSON array (not a data envelope) and reports +// pagination via X-Apify-Pagination-* headers, which are surfaced in the returned +// [PaginationList]. T is the item type to decode into (e.g. json.RawMessage or a struct). +func ListDatasetItems[T any](ctx context.Context, c *DatasetClient, options DatasetListItemsOptions) (PaginationList[T], error) { + var result PaginationList[T] + params := NewQueryParams() + options.apply(params) + url := params.applyToURL(c.ctx.subURL("items")) + resp, err := c.ctx.http.call(ctx, http.MethodGet, url, nil, "", defaultRequestTimeout) + if err != nil { + return result, err + } + var items []T + if err := json.Unmarshal(resp.body, &items); err != nil { + return result, err + } + count := int64(len(items)) + result.Items = items + result.Count = count + result.Total = headerInt(resp.header, "X-Apify-Pagination-Total", count) + result.Offset = headerInt(resp.header, "X-Apify-Pagination-Offset", 0) + result.Limit = headerInt(resp.header, "X-Apify-Pagination-Limit", count) + if options.Desc != nil { + result.Desc = *options.Desc + } + return result, nil +} + +// ListItems lists items from the dataset, decoding each into a generic json.RawMessage. +// For typed decoding use [ListDatasetItems]. +func (c *DatasetClient) ListItems(ctx context.Context, options DatasetListItemsOptions) (PaginationList[json.RawMessage], error) { + return ListDatasetItems[json.RawMessage](ctx, c, options) +} + +// DownloadItems downloads dataset items serialized in the given format, returning the raw +// bytes. Unlike ListItems (parsed items), this returns the items already serialized to JSON, +// CSV, XLSX, XML, RSS or HTML — useful for exporting. +func (c *DatasetClient) DownloadItems(ctx context.Context, format DownloadItemsFormat, options DatasetDownloadOptions) ([]byte, error) { + params := NewQueryParams() + fmtStr := string(format) + params.AddString("format", &fmtStr) + options.apply(params) + url := params.applyToURL(c.ctx.subURL("items")) + resp, err := c.ctx.http.call(ctx, http.MethodGet, url, nil, "", defaultRequestTimeout) + if err != nil { + return nil, err + } + return resp.body, nil +} + +// PushItems pushes one or more items to the dataset. items must serialize to a JSON object +// or an array of objects. +func (c *DatasetClient) PushItems(ctx context.Context, items any) error { + body, err := json.Marshal(items) + if err != nil { + return err + } + _, err = c.ctx.http.call(ctx, http.MethodPost, c.ctx.subURL("items"), body, contentTypeJSONCharset, defaultRequestTimeout) + return err +} + +// GetStatistics returns statistical information about the dataset, or (nil, false, nil) if +// unavailable. +func (c *DatasetClient) GetStatistics(ctx context.Context) (json.RawMessage, bool, error) { + resp, err := getRaw(ctx, c.ctx, "statistics", NewQueryParams()) + if err != nil { + return nil, false, err + } + if resp == nil { + return nil, false, nil + } + data, err := parseDataEnvelope[json.RawMessage](resp.body) + if err != nil { + return nil, false, err + } + return data, true, nil +} + +// CreateItemsPublicURL builds a public URL for downloading this dataset's items. +// +// It mirrors the reference client's createItemsPublicUrl: it fetches the dataset, and if the +// dataset exposes a URL-signing secret key (i.e. it is private), appends an HMAC-SHA256 +// signature so the URL grants access without an API token. expiresInSecs optionally bounds +// the validity of a signed URL (nil for non-expiring). The URL is built from the configured +// public base URL. +func (c *DatasetClient) CreateItemsPublicURL(ctx context.Context, options DatasetListItemsOptions, expiresInSecs *int64) (string, error) { + params := NewQueryParams() + options.apply(params) + + dataset, present, err := c.Get(ctx) + if err != nil { + return "", err + } + if present { + if secret := extractString(dataset.Extra, "urlSigningSecretKey"); secret != "" { + sig := signStorageContent(secret, dataset.ID, expiresInSecs) + params.AddString("signature", &sig) + } + } + return params.applyToURL(c.ctx.publicURL("items")), nil +} + +// headerInt parses an integer HTTP header value, returning fallback if absent or invalid. +func headerInt(h http.Header, name string, fallback int64) int64 { + v := h.Get(name) + if v == "" { + return fallback + } + n, err := strconv.ParseInt(v, 10, 64) + if err != nil { + return fallback + } + return n +} + +// extractString reads a string field from an Extra map, returning "" if absent or not a +// string. +func extractString(extra Extra, key string) string { + raw, ok := extra[key] + if !ok { + return "" + } + var s string + if err := json.Unmarshal(raw, &s); err != nil { + return "" + } + return s +} diff --git a/dataset_collection.go b/dataset_collection.go new file mode 100644 index 0000000..a04d8a7 --- /dev/null +++ b/dataset_collection.go @@ -0,0 +1,25 @@ +package apify + +import "context" + +// DatasetCollectionClient is a client for the dataset collection (GET/POST /v2/datasets). +type DatasetCollectionClient struct { + ctx *resourceContext +} + +func newDatasetCollectionClient(hc *httpClient, baseURL string) *DatasetCollectionClient { + return &DatasetCollectionClient{ctx: newCollectionContext(hc, baseURL, "datasets")} +} + +// List lists datasets. +func (c *DatasetCollectionClient) List(ctx context.Context, options StorageListOptions) (PaginationList[Dataset], error) { + params := NewQueryParams() + options.apply(params) + return listResource[Dataset](ctx, c.ctx, "", params) +} + +// GetOrCreate gets the dataset with the given name, creating it if it does not exist. An +// empty name creates a new unnamed dataset. +func (c *DatasetCollectionClient) GetOrCreate(ctx context.Context, name string) (Dataset, error) { + return getOrCreateNamed[Dataset](ctx, c.ctx, name) +} diff --git a/docs/AccountLimits.md b/docs/AccountLimits.md deleted file mode 100644 index c0b2b6d..0000000 --- a/docs/AccountLimits.md +++ /dev/null @@ -1,93 +0,0 @@ -# AccountLimits - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**MonthlyUsageCycle** | [**UsageCycle**](UsageCycle.md) | | -**Limits** | [**Limits**](Limits.md) | | -**Current** | [**Current**](Current.md) | | - -## Methods - -### NewAccountLimits - -`func NewAccountLimits(monthlyUsageCycle UsageCycle, limits Limits, current Current, ) *AccountLimits` - -NewAccountLimits instantiates a new AccountLimits object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewAccountLimitsWithDefaults - -`func NewAccountLimitsWithDefaults() *AccountLimits` - -NewAccountLimitsWithDefaults instantiates a new AccountLimits object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetMonthlyUsageCycle - -`func (o *AccountLimits) GetMonthlyUsageCycle() UsageCycle` - -GetMonthlyUsageCycle returns the MonthlyUsageCycle field if non-nil, zero value otherwise. - -### GetMonthlyUsageCycleOk - -`func (o *AccountLimits) GetMonthlyUsageCycleOk() (*UsageCycle, bool)` - -GetMonthlyUsageCycleOk returns a tuple with the MonthlyUsageCycle field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetMonthlyUsageCycle - -`func (o *AccountLimits) SetMonthlyUsageCycle(v UsageCycle)` - -SetMonthlyUsageCycle sets MonthlyUsageCycle field to given value. - - -### GetLimits - -`func (o *AccountLimits) GetLimits() Limits` - -GetLimits returns the Limits field if non-nil, zero value otherwise. - -### GetLimitsOk - -`func (o *AccountLimits) GetLimitsOk() (*Limits, bool)` - -GetLimitsOk returns a tuple with the Limits field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetLimits - -`func (o *AccountLimits) SetLimits(v Limits)` - -SetLimits sets Limits field to given value. - - -### GetCurrent - -`func (o *AccountLimits) GetCurrent() Current` - -GetCurrent returns the Current field if non-nil, zero value otherwise. - -### GetCurrentOk - -`func (o *AccountLimits) GetCurrentOk() (*Current, bool)` - -GetCurrentOk returns a tuple with the Current field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetCurrent - -`func (o *AccountLimits) SetCurrent(v Current)` - -SetCurrent sets Current field to given value. - - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/ActRunsLastDatasetItemsPost400Response.md b/docs/ActRunsLastDatasetItemsPost400Response.md deleted file mode 100644 index 07cec09..0000000 --- a/docs/ActRunsLastDatasetItemsPost400Response.md +++ /dev/null @@ -1,51 +0,0 @@ -# ActRunsLastDatasetItemsPost400Response - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Error** | [**ErrorDetail**](ErrorDetail.md) | | - -## Methods - -### NewActRunsLastDatasetItemsPost400Response - -`func NewActRunsLastDatasetItemsPost400Response(error_ ErrorDetail, ) *ActRunsLastDatasetItemsPost400Response` - -NewActRunsLastDatasetItemsPost400Response instantiates a new ActRunsLastDatasetItemsPost400Response object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewActRunsLastDatasetItemsPost400ResponseWithDefaults - -`func NewActRunsLastDatasetItemsPost400ResponseWithDefaults() *ActRunsLastDatasetItemsPost400Response` - -NewActRunsLastDatasetItemsPost400ResponseWithDefaults instantiates a new ActRunsLastDatasetItemsPost400Response object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetError - -`func (o *ActRunsLastDatasetItemsPost400Response) GetError() ErrorDetail` - -GetError returns the Error field if non-nil, zero value otherwise. - -### GetErrorOk - -`func (o *ActRunsLastDatasetItemsPost400Response) GetErrorOk() (*ErrorDetail, bool)` - -GetErrorOk returns a tuple with the Error field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetError - -`func (o *ActRunsLastDatasetItemsPost400Response) SetError(v ErrorDetail)` - -SetError sets Error field to given value. - - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/ActRunsLastDatasetItemsPostRequest.md b/docs/ActRunsLastDatasetItemsPostRequest.md deleted file mode 100644 index 8188944..0000000 --- a/docs/ActRunsLastDatasetItemsPostRequest.md +++ /dev/null @@ -1,30 +0,0 @@ -# ActRunsLastDatasetItemsPostRequest - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - -## Methods - -### NewActRunsLastDatasetItemsPostRequest - -`func NewActRunsLastDatasetItemsPostRequest() *ActRunsLastDatasetItemsPostRequest` - -NewActRunsLastDatasetItemsPostRequest instantiates a new ActRunsLastDatasetItemsPostRequest object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewActRunsLastDatasetItemsPostRequestWithDefaults - -`func NewActRunsLastDatasetItemsPostRequestWithDefaults() *ActRunsLastDatasetItemsPostRequest` - -NewActRunsLastDatasetItemsPostRequestWithDefaults instantiates a new ActRunsLastDatasetItemsPostRequest object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/ActValidateInputPost200Response.md b/docs/ActValidateInputPost200Response.md deleted file mode 100644 index 9a0a22f..0000000 --- a/docs/ActValidateInputPost200Response.md +++ /dev/null @@ -1,51 +0,0 @@ -# ActValidateInputPost200Response - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Valid** | **bool** | Whether the input is valid according to the Actor's input schema. | - -## Methods - -### NewActValidateInputPost200Response - -`func NewActValidateInputPost200Response(valid bool, ) *ActValidateInputPost200Response` - -NewActValidateInputPost200Response instantiates a new ActValidateInputPost200Response object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewActValidateInputPost200ResponseWithDefaults - -`func NewActValidateInputPost200ResponseWithDefaults() *ActValidateInputPost200Response` - -NewActValidateInputPost200ResponseWithDefaults instantiates a new ActValidateInputPost200Response object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetValid - -`func (o *ActValidateInputPost200Response) GetValid() bool` - -GetValid returns the Valid field if non-nil, zero value otherwise. - -### GetValidOk - -`func (o *ActValidateInputPost200Response) GetValidOk() (*bool, bool)` - -GetValidOk returns a tuple with the Valid field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetValid - -`func (o *ActValidateInputPost200Response) SetValid(v bool)` - -SetValid sets Valid field to given value. - - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/Actor.md b/docs/Actor.md deleted file mode 100644 index 557edd7..0000000 --- a/docs/Actor.md +++ /dev/null @@ -1,886 +0,0 @@ -# Actor - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Id** | **string** | | -**UserId** | **string** | | -**Name** | **string** | | -**Username** | **string** | | -**Description** | Pointer to **NullableString** | | [optional] -**RestartOnError** | Pointer to **bool** | | [optional] -**IsPublic** | **bool** | | -**ActorPermissionLevel** | Pointer to [**ActorPermissionLevel**](ActorPermissionLevel.md) | | [optional] -**CreatedAt** | **time.Time** | | -**ModifiedAt** | **time.Time** | | -**Stats** | [**ActorStats**](ActorStats.md) | | -**Versions** | [**[]Version**](Version.md) | | -**PricingInfos** | Pointer to [**[]ActorRunPricingInfo**](ActorRunPricingInfo.md) | | [optional] -**DefaultRunOptions** | [**DefaultRunOptions**](DefaultRunOptions.md) | | -**ExampleRunInput** | Pointer to [**NullableExampleRunInput**](ExampleRunInput.md) | | [optional] -**IsDeprecated** | Pointer to **NullableBool** | | [optional] -**DeploymentKey** | Pointer to **string** | | [optional] -**Title** | Pointer to **NullableString** | | [optional] -**TaggedBuilds** | Pointer to [**map[string]TaggedBuildsValue**](TaggedBuildsValue.md) | A dictionary mapping build tag names (e.g., \"latest\", \"beta\") to their build information. | [optional] -**ActorStandby** | Pointer to [**NullableActorStandby**](ActorStandby.md) | | [optional] -**ReadmeSummary** | Pointer to **string** | A brief, LLM-generated readme summary | [optional] -**SeoTitle** | Pointer to **NullableString** | | [optional] -**SeoDescription** | Pointer to **NullableString** | | [optional] -**PictureUrl** | Pointer to **NullableString** | | [optional] -**StandbyUrl** | Pointer to **NullableString** | | [optional] -**Notice** | Pointer to **string** | | [optional] -**Categories** | Pointer to **[]string** | | [optional] -**IsCritical** | Pointer to **bool** | | [optional] -**IsGeneric** | Pointer to **bool** | | [optional] -**IsSourceCodeHidden** | Pointer to **bool** | | [optional] -**HasNoDataset** | Pointer to **bool** | | [optional] - -## Methods - -### NewActor - -`func NewActor(id string, userId string, name string, username string, isPublic bool, createdAt time.Time, modifiedAt time.Time, stats ActorStats, versions []Version, defaultRunOptions DefaultRunOptions, ) *Actor` - -NewActor instantiates a new Actor object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewActorWithDefaults - -`func NewActorWithDefaults() *Actor` - -NewActorWithDefaults instantiates a new Actor object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetId - -`func (o *Actor) GetId() string` - -GetId returns the Id field if non-nil, zero value otherwise. - -### GetIdOk - -`func (o *Actor) GetIdOk() (*string, bool)` - -GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetId - -`func (o *Actor) SetId(v string)` - -SetId sets Id field to given value. - - -### GetUserId - -`func (o *Actor) GetUserId() string` - -GetUserId returns the UserId field if non-nil, zero value otherwise. - -### GetUserIdOk - -`func (o *Actor) GetUserIdOk() (*string, bool)` - -GetUserIdOk returns a tuple with the UserId field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetUserId - -`func (o *Actor) SetUserId(v string)` - -SetUserId sets UserId field to given value. - - -### GetName - -`func (o *Actor) GetName() string` - -GetName returns the Name field if non-nil, zero value otherwise. - -### GetNameOk - -`func (o *Actor) GetNameOk() (*string, bool)` - -GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetName - -`func (o *Actor) SetName(v string)` - -SetName sets Name field to given value. - - -### GetUsername - -`func (o *Actor) GetUsername() string` - -GetUsername returns the Username field if non-nil, zero value otherwise. - -### GetUsernameOk - -`func (o *Actor) GetUsernameOk() (*string, bool)` - -GetUsernameOk returns a tuple with the Username field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetUsername - -`func (o *Actor) SetUsername(v string)` - -SetUsername sets Username field to given value. - - -### GetDescription - -`func (o *Actor) GetDescription() string` - -GetDescription returns the Description field if non-nil, zero value otherwise. - -### GetDescriptionOk - -`func (o *Actor) GetDescriptionOk() (*string, bool)` - -GetDescriptionOk returns a tuple with the Description field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetDescription - -`func (o *Actor) SetDescription(v string)` - -SetDescription sets Description field to given value. - -### HasDescription - -`func (o *Actor) HasDescription() bool` - -HasDescription returns a boolean if a field has been set. - -### SetDescriptionNil - -`func (o *Actor) SetDescriptionNil(b bool)` - - SetDescriptionNil sets the value for Description to be an explicit nil - -### UnsetDescription -`func (o *Actor) UnsetDescription()` - -UnsetDescription ensures that no value is present for Description, not even an explicit nil -### GetRestartOnError - -`func (o *Actor) GetRestartOnError() bool` - -GetRestartOnError returns the RestartOnError field if non-nil, zero value otherwise. - -### GetRestartOnErrorOk - -`func (o *Actor) GetRestartOnErrorOk() (*bool, bool)` - -GetRestartOnErrorOk returns a tuple with the RestartOnError field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetRestartOnError - -`func (o *Actor) SetRestartOnError(v bool)` - -SetRestartOnError sets RestartOnError field to given value. - -### HasRestartOnError - -`func (o *Actor) HasRestartOnError() bool` - -HasRestartOnError returns a boolean if a field has been set. - -### GetIsPublic - -`func (o *Actor) GetIsPublic() bool` - -GetIsPublic returns the IsPublic field if non-nil, zero value otherwise. - -### GetIsPublicOk - -`func (o *Actor) GetIsPublicOk() (*bool, bool)` - -GetIsPublicOk returns a tuple with the IsPublic field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetIsPublic - -`func (o *Actor) SetIsPublic(v bool)` - -SetIsPublic sets IsPublic field to given value. - - -### GetActorPermissionLevel - -`func (o *Actor) GetActorPermissionLevel() ActorPermissionLevel` - -GetActorPermissionLevel returns the ActorPermissionLevel field if non-nil, zero value otherwise. - -### GetActorPermissionLevelOk - -`func (o *Actor) GetActorPermissionLevelOk() (*ActorPermissionLevel, bool)` - -GetActorPermissionLevelOk returns a tuple with the ActorPermissionLevel field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetActorPermissionLevel - -`func (o *Actor) SetActorPermissionLevel(v ActorPermissionLevel)` - -SetActorPermissionLevel sets ActorPermissionLevel field to given value. - -### HasActorPermissionLevel - -`func (o *Actor) HasActorPermissionLevel() bool` - -HasActorPermissionLevel returns a boolean if a field has been set. - -### GetCreatedAt - -`func (o *Actor) GetCreatedAt() time.Time` - -GetCreatedAt returns the CreatedAt field if non-nil, zero value otherwise. - -### GetCreatedAtOk - -`func (o *Actor) GetCreatedAtOk() (*time.Time, bool)` - -GetCreatedAtOk returns a tuple with the CreatedAt field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetCreatedAt - -`func (o *Actor) SetCreatedAt(v time.Time)` - -SetCreatedAt sets CreatedAt field to given value. - - -### GetModifiedAt - -`func (o *Actor) GetModifiedAt() time.Time` - -GetModifiedAt returns the ModifiedAt field if non-nil, zero value otherwise. - -### GetModifiedAtOk - -`func (o *Actor) GetModifiedAtOk() (*time.Time, bool)` - -GetModifiedAtOk returns a tuple with the ModifiedAt field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetModifiedAt - -`func (o *Actor) SetModifiedAt(v time.Time)` - -SetModifiedAt sets ModifiedAt field to given value. - - -### GetStats - -`func (o *Actor) GetStats() ActorStats` - -GetStats returns the Stats field if non-nil, zero value otherwise. - -### GetStatsOk - -`func (o *Actor) GetStatsOk() (*ActorStats, bool)` - -GetStatsOk returns a tuple with the Stats field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetStats - -`func (o *Actor) SetStats(v ActorStats)` - -SetStats sets Stats field to given value. - - -### GetVersions - -`func (o *Actor) GetVersions() []Version` - -GetVersions returns the Versions field if non-nil, zero value otherwise. - -### GetVersionsOk - -`func (o *Actor) GetVersionsOk() (*[]Version, bool)` - -GetVersionsOk returns a tuple with the Versions field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetVersions - -`func (o *Actor) SetVersions(v []Version)` - -SetVersions sets Versions field to given value. - - -### GetPricingInfos - -`func (o *Actor) GetPricingInfos() []ActorRunPricingInfo` - -GetPricingInfos returns the PricingInfos field if non-nil, zero value otherwise. - -### GetPricingInfosOk - -`func (o *Actor) GetPricingInfosOk() (*[]ActorRunPricingInfo, bool)` - -GetPricingInfosOk returns a tuple with the PricingInfos field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetPricingInfos - -`func (o *Actor) SetPricingInfos(v []ActorRunPricingInfo)` - -SetPricingInfos sets PricingInfos field to given value. - -### HasPricingInfos - -`func (o *Actor) HasPricingInfos() bool` - -HasPricingInfos returns a boolean if a field has been set. - -### GetDefaultRunOptions - -`func (o *Actor) GetDefaultRunOptions() DefaultRunOptions` - -GetDefaultRunOptions returns the DefaultRunOptions field if non-nil, zero value otherwise. - -### GetDefaultRunOptionsOk - -`func (o *Actor) GetDefaultRunOptionsOk() (*DefaultRunOptions, bool)` - -GetDefaultRunOptionsOk returns a tuple with the DefaultRunOptions field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetDefaultRunOptions - -`func (o *Actor) SetDefaultRunOptions(v DefaultRunOptions)` - -SetDefaultRunOptions sets DefaultRunOptions field to given value. - - -### GetExampleRunInput - -`func (o *Actor) GetExampleRunInput() ExampleRunInput` - -GetExampleRunInput returns the ExampleRunInput field if non-nil, zero value otherwise. - -### GetExampleRunInputOk - -`func (o *Actor) GetExampleRunInputOk() (*ExampleRunInput, bool)` - -GetExampleRunInputOk returns a tuple with the ExampleRunInput field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetExampleRunInput - -`func (o *Actor) SetExampleRunInput(v ExampleRunInput)` - -SetExampleRunInput sets ExampleRunInput field to given value. - -### HasExampleRunInput - -`func (o *Actor) HasExampleRunInput() bool` - -HasExampleRunInput returns a boolean if a field has been set. - -### SetExampleRunInputNil - -`func (o *Actor) SetExampleRunInputNil(b bool)` - - SetExampleRunInputNil sets the value for ExampleRunInput to be an explicit nil - -### UnsetExampleRunInput -`func (o *Actor) UnsetExampleRunInput()` - -UnsetExampleRunInput ensures that no value is present for ExampleRunInput, not even an explicit nil -### GetIsDeprecated - -`func (o *Actor) GetIsDeprecated() bool` - -GetIsDeprecated returns the IsDeprecated field if non-nil, zero value otherwise. - -### GetIsDeprecatedOk - -`func (o *Actor) GetIsDeprecatedOk() (*bool, bool)` - -GetIsDeprecatedOk returns a tuple with the IsDeprecated field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetIsDeprecated - -`func (o *Actor) SetIsDeprecated(v bool)` - -SetIsDeprecated sets IsDeprecated field to given value. - -### HasIsDeprecated - -`func (o *Actor) HasIsDeprecated() bool` - -HasIsDeprecated returns a boolean if a field has been set. - -### SetIsDeprecatedNil - -`func (o *Actor) SetIsDeprecatedNil(b bool)` - - SetIsDeprecatedNil sets the value for IsDeprecated to be an explicit nil - -### UnsetIsDeprecated -`func (o *Actor) UnsetIsDeprecated()` - -UnsetIsDeprecated ensures that no value is present for IsDeprecated, not even an explicit nil -### GetDeploymentKey - -`func (o *Actor) GetDeploymentKey() string` - -GetDeploymentKey returns the DeploymentKey field if non-nil, zero value otherwise. - -### GetDeploymentKeyOk - -`func (o *Actor) GetDeploymentKeyOk() (*string, bool)` - -GetDeploymentKeyOk returns a tuple with the DeploymentKey field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetDeploymentKey - -`func (o *Actor) SetDeploymentKey(v string)` - -SetDeploymentKey sets DeploymentKey field to given value. - -### HasDeploymentKey - -`func (o *Actor) HasDeploymentKey() bool` - -HasDeploymentKey returns a boolean if a field has been set. - -### GetTitle - -`func (o *Actor) GetTitle() string` - -GetTitle returns the Title field if non-nil, zero value otherwise. - -### GetTitleOk - -`func (o *Actor) GetTitleOk() (*string, bool)` - -GetTitleOk returns a tuple with the Title field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetTitle - -`func (o *Actor) SetTitle(v string)` - -SetTitle sets Title field to given value. - -### HasTitle - -`func (o *Actor) HasTitle() bool` - -HasTitle returns a boolean if a field has been set. - -### SetTitleNil - -`func (o *Actor) SetTitleNil(b bool)` - - SetTitleNil sets the value for Title to be an explicit nil - -### UnsetTitle -`func (o *Actor) UnsetTitle()` - -UnsetTitle ensures that no value is present for Title, not even an explicit nil -### GetTaggedBuilds - -`func (o *Actor) GetTaggedBuilds() map[string]TaggedBuildsValue` - -GetTaggedBuilds returns the TaggedBuilds field if non-nil, zero value otherwise. - -### GetTaggedBuildsOk - -`func (o *Actor) GetTaggedBuildsOk() (*map[string]TaggedBuildsValue, bool)` - -GetTaggedBuildsOk returns a tuple with the TaggedBuilds field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetTaggedBuilds - -`func (o *Actor) SetTaggedBuilds(v map[string]TaggedBuildsValue)` - -SetTaggedBuilds sets TaggedBuilds field to given value. - -### HasTaggedBuilds - -`func (o *Actor) HasTaggedBuilds() bool` - -HasTaggedBuilds returns a boolean if a field has been set. - -### SetTaggedBuildsNil - -`func (o *Actor) SetTaggedBuildsNil(b bool)` - - SetTaggedBuildsNil sets the value for TaggedBuilds to be an explicit nil - -### UnsetTaggedBuilds -`func (o *Actor) UnsetTaggedBuilds()` - -UnsetTaggedBuilds ensures that no value is present for TaggedBuilds, not even an explicit nil -### GetActorStandby - -`func (o *Actor) GetActorStandby() ActorStandby` - -GetActorStandby returns the ActorStandby field if non-nil, zero value otherwise. - -### GetActorStandbyOk - -`func (o *Actor) GetActorStandbyOk() (*ActorStandby, bool)` - -GetActorStandbyOk returns a tuple with the ActorStandby field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetActorStandby - -`func (o *Actor) SetActorStandby(v ActorStandby)` - -SetActorStandby sets ActorStandby field to given value. - -### HasActorStandby - -`func (o *Actor) HasActorStandby() bool` - -HasActorStandby returns a boolean if a field has been set. - -### SetActorStandbyNil - -`func (o *Actor) SetActorStandbyNil(b bool)` - - SetActorStandbyNil sets the value for ActorStandby to be an explicit nil - -### UnsetActorStandby -`func (o *Actor) UnsetActorStandby()` - -UnsetActorStandby ensures that no value is present for ActorStandby, not even an explicit nil -### GetReadmeSummary - -`func (o *Actor) GetReadmeSummary() string` - -GetReadmeSummary returns the ReadmeSummary field if non-nil, zero value otherwise. - -### GetReadmeSummaryOk - -`func (o *Actor) GetReadmeSummaryOk() (*string, bool)` - -GetReadmeSummaryOk returns a tuple with the ReadmeSummary field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetReadmeSummary - -`func (o *Actor) SetReadmeSummary(v string)` - -SetReadmeSummary sets ReadmeSummary field to given value. - -### HasReadmeSummary - -`func (o *Actor) HasReadmeSummary() bool` - -HasReadmeSummary returns a boolean if a field has been set. - -### GetSeoTitle - -`func (o *Actor) GetSeoTitle() string` - -GetSeoTitle returns the SeoTitle field if non-nil, zero value otherwise. - -### GetSeoTitleOk - -`func (o *Actor) GetSeoTitleOk() (*string, bool)` - -GetSeoTitleOk returns a tuple with the SeoTitle field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetSeoTitle - -`func (o *Actor) SetSeoTitle(v string)` - -SetSeoTitle sets SeoTitle field to given value. - -### HasSeoTitle - -`func (o *Actor) HasSeoTitle() bool` - -HasSeoTitle returns a boolean if a field has been set. - -### SetSeoTitleNil - -`func (o *Actor) SetSeoTitleNil(b bool)` - - SetSeoTitleNil sets the value for SeoTitle to be an explicit nil - -### UnsetSeoTitle -`func (o *Actor) UnsetSeoTitle()` - -UnsetSeoTitle ensures that no value is present for SeoTitle, not even an explicit nil -### GetSeoDescription - -`func (o *Actor) GetSeoDescription() string` - -GetSeoDescription returns the SeoDescription field if non-nil, zero value otherwise. - -### GetSeoDescriptionOk - -`func (o *Actor) GetSeoDescriptionOk() (*string, bool)` - -GetSeoDescriptionOk returns a tuple with the SeoDescription field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetSeoDescription - -`func (o *Actor) SetSeoDescription(v string)` - -SetSeoDescription sets SeoDescription field to given value. - -### HasSeoDescription - -`func (o *Actor) HasSeoDescription() bool` - -HasSeoDescription returns a boolean if a field has been set. - -### SetSeoDescriptionNil - -`func (o *Actor) SetSeoDescriptionNil(b bool)` - - SetSeoDescriptionNil sets the value for SeoDescription to be an explicit nil - -### UnsetSeoDescription -`func (o *Actor) UnsetSeoDescription()` - -UnsetSeoDescription ensures that no value is present for SeoDescription, not even an explicit nil -### GetPictureUrl - -`func (o *Actor) GetPictureUrl() string` - -GetPictureUrl returns the PictureUrl field if non-nil, zero value otherwise. - -### GetPictureUrlOk - -`func (o *Actor) GetPictureUrlOk() (*string, bool)` - -GetPictureUrlOk returns a tuple with the PictureUrl field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetPictureUrl - -`func (o *Actor) SetPictureUrl(v string)` - -SetPictureUrl sets PictureUrl field to given value. - -### HasPictureUrl - -`func (o *Actor) HasPictureUrl() bool` - -HasPictureUrl returns a boolean if a field has been set. - -### SetPictureUrlNil - -`func (o *Actor) SetPictureUrlNil(b bool)` - - SetPictureUrlNil sets the value for PictureUrl to be an explicit nil - -### UnsetPictureUrl -`func (o *Actor) UnsetPictureUrl()` - -UnsetPictureUrl ensures that no value is present for PictureUrl, not even an explicit nil -### GetStandbyUrl - -`func (o *Actor) GetStandbyUrl() string` - -GetStandbyUrl returns the StandbyUrl field if non-nil, zero value otherwise. - -### GetStandbyUrlOk - -`func (o *Actor) GetStandbyUrlOk() (*string, bool)` - -GetStandbyUrlOk returns a tuple with the StandbyUrl field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetStandbyUrl - -`func (o *Actor) SetStandbyUrl(v string)` - -SetStandbyUrl sets StandbyUrl field to given value. - -### HasStandbyUrl - -`func (o *Actor) HasStandbyUrl() bool` - -HasStandbyUrl returns a boolean if a field has been set. - -### SetStandbyUrlNil - -`func (o *Actor) SetStandbyUrlNil(b bool)` - - SetStandbyUrlNil sets the value for StandbyUrl to be an explicit nil - -### UnsetStandbyUrl -`func (o *Actor) UnsetStandbyUrl()` - -UnsetStandbyUrl ensures that no value is present for StandbyUrl, not even an explicit nil -### GetNotice - -`func (o *Actor) GetNotice() string` - -GetNotice returns the Notice field if non-nil, zero value otherwise. - -### GetNoticeOk - -`func (o *Actor) GetNoticeOk() (*string, bool)` - -GetNoticeOk returns a tuple with the Notice field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetNotice - -`func (o *Actor) SetNotice(v string)` - -SetNotice sets Notice field to given value. - -### HasNotice - -`func (o *Actor) HasNotice() bool` - -HasNotice returns a boolean if a field has been set. - -### GetCategories - -`func (o *Actor) GetCategories() []string` - -GetCategories returns the Categories field if non-nil, zero value otherwise. - -### GetCategoriesOk - -`func (o *Actor) GetCategoriesOk() (*[]string, bool)` - -GetCategoriesOk returns a tuple with the Categories field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetCategories - -`func (o *Actor) SetCategories(v []string)` - -SetCategories sets Categories field to given value. - -### HasCategories - -`func (o *Actor) HasCategories() bool` - -HasCategories returns a boolean if a field has been set. - -### GetIsCritical - -`func (o *Actor) GetIsCritical() bool` - -GetIsCritical returns the IsCritical field if non-nil, zero value otherwise. - -### GetIsCriticalOk - -`func (o *Actor) GetIsCriticalOk() (*bool, bool)` - -GetIsCriticalOk returns a tuple with the IsCritical field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetIsCritical - -`func (o *Actor) SetIsCritical(v bool)` - -SetIsCritical sets IsCritical field to given value. - -### HasIsCritical - -`func (o *Actor) HasIsCritical() bool` - -HasIsCritical returns a boolean if a field has been set. - -### GetIsGeneric - -`func (o *Actor) GetIsGeneric() bool` - -GetIsGeneric returns the IsGeneric field if non-nil, zero value otherwise. - -### GetIsGenericOk - -`func (o *Actor) GetIsGenericOk() (*bool, bool)` - -GetIsGenericOk returns a tuple with the IsGeneric field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetIsGeneric - -`func (o *Actor) SetIsGeneric(v bool)` - -SetIsGeneric sets IsGeneric field to given value. - -### HasIsGeneric - -`func (o *Actor) HasIsGeneric() bool` - -HasIsGeneric returns a boolean if a field has been set. - -### GetIsSourceCodeHidden - -`func (o *Actor) GetIsSourceCodeHidden() bool` - -GetIsSourceCodeHidden returns the IsSourceCodeHidden field if non-nil, zero value otherwise. - -### GetIsSourceCodeHiddenOk - -`func (o *Actor) GetIsSourceCodeHiddenOk() (*bool, bool)` - -GetIsSourceCodeHiddenOk returns a tuple with the IsSourceCodeHidden field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetIsSourceCodeHidden - -`func (o *Actor) SetIsSourceCodeHidden(v bool)` - -SetIsSourceCodeHidden sets IsSourceCodeHidden field to given value. - -### HasIsSourceCodeHidden - -`func (o *Actor) HasIsSourceCodeHidden() bool` - -HasIsSourceCodeHidden returns a boolean if a field has been set. - -### GetHasNoDataset - -`func (o *Actor) GetHasNoDataset() bool` - -GetHasNoDataset returns the HasNoDataset field if non-nil, zero value otherwise. - -### GetHasNoDatasetOk - -`func (o *Actor) GetHasNoDatasetOk() (*bool, bool)` - -GetHasNoDatasetOk returns a tuple with the HasNoDataset field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetHasNoDataset - -`func (o *Actor) SetHasNoDataset(v bool)` - -SetHasNoDataset sets HasNoDataset field to given value. - -### HasHasNoDataset - -`func (o *Actor) HasHasNoDataset() bool` - -HasHasNoDataset returns a boolean if a field has been set. - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/ActorBuildsAPI.md b/docs/ActorBuildsAPI.md deleted file mode 100644 index 8fb5704..0000000 --- a/docs/ActorBuildsAPI.md +++ /dev/null @@ -1,438 +0,0 @@ -# \ActorBuildsAPI - -All URIs are relative to *https://api.apify.com* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**ActorBuildAbortPost**](ActorBuildsAPI.md#ActorBuildAbortPost) | **Post** /v2/actor-builds/{buildId}/abort | Abort build -[**ActorBuildDelete**](ActorBuildsAPI.md#ActorBuildDelete) | **Delete** /v2/actor-builds/{buildId} | Delete build -[**ActorBuildGet**](ActorBuildsAPI.md#ActorBuildGet) | **Get** /v2/actor-builds/{buildId} | Get build -[**ActorBuildLogGet**](ActorBuildsAPI.md#ActorBuildLogGet) | **Get** /v2/actor-builds/{buildId}/log | Get build's Log -[**ActorBuildOpenapiJsonGet**](ActorBuildsAPI.md#ActorBuildOpenapiJsonGet) | **Get** /v2/actor-builds/{buildId}/openapi.json | Get OpenAPI definition -[**ActorBuildsGet**](ActorBuildsAPI.md#ActorBuildsGet) | **Get** /v2/actor-builds | Get user builds list - - - -## ActorBuildAbortPost - -> BuildResponse ActorBuildAbortPost(ctx, buildId).Execute() - -Abort build - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - buildId := "soSkq9ekdmfOslopH" // string | ID of the build, found in the build's Info tab. - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.ActorBuildsAPI.ActorBuildAbortPost(context.Background(), buildId).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `ActorBuildsAPI.ActorBuildAbortPost``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `ActorBuildAbortPost`: BuildResponse - fmt.Fprintf(os.Stdout, "Response from `ActorBuildsAPI.ActorBuildAbortPost`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**buildId** | **string** | ID of the build, found in the build's Info tab. | - -### Other Parameters - -Other parameters are passed through a pointer to a apiActorBuildAbortPostRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - -### Return type - -[**BuildResponse**](BuildResponse.md) - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## ActorBuildDelete - -> ActorBuildDelete(ctx, buildId).Execute() - -Delete build - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - buildId := "soSkq9ekdmfOslopH" // string | ID of the build, found in the build's Info tab. - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - r, err := apiClient.ActorBuildsAPI.ActorBuildDelete(context.Background(), buildId).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `ActorBuildsAPI.ActorBuildDelete``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**buildId** | **string** | ID of the build, found in the build's Info tab. | - -### Other Parameters - -Other parameters are passed through a pointer to a apiActorBuildDeleteRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - -### Return type - - (empty response body) - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## ActorBuildGet - -> BuildResponse ActorBuildGet(ctx, buildId).WaitForFinish(waitForFinish).Execute() - -Get build - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - buildId := "soSkq9ekdmfOslopH" // string | ID of the build, found in the build's Info tab. - waitForFinish := float64(60) // float64 | The maximum number of seconds the server waits for the build to finish. By default it is `0`, the maximum value is `60`. <!-- MAX_ACTOR_JOB_ASYNC_WAIT_SECS --> If the build finishes in time then the returned build object will have a terminal status (e.g. `SUCCEEDED`), otherwise it will have a transitional status (e.g. `RUNNING`). (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.ActorBuildsAPI.ActorBuildGet(context.Background(), buildId).WaitForFinish(waitForFinish).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `ActorBuildsAPI.ActorBuildGet``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `ActorBuildGet`: BuildResponse - fmt.Fprintf(os.Stdout, "Response from `ActorBuildsAPI.ActorBuildGet`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**buildId** | **string** | ID of the build, found in the build's Info tab. | - -### Other Parameters - -Other parameters are passed through a pointer to a apiActorBuildGetRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - **waitForFinish** | **float64** | The maximum number of seconds the server waits for the build to finish. By default it is `0`, the maximum value is `60`. <!-- MAX_ACTOR_JOB_ASYNC_WAIT_SECS --> If the build finishes in time then the returned build object will have a terminal status (e.g. `SUCCEEDED`), otherwise it will have a transitional status (e.g. `RUNNING`). | - -### Return type - -[**BuildResponse**](BuildResponse.md) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## ActorBuildLogGet - -> string ActorBuildLogGet(ctx, buildId).Stream(stream).Download(download).Execute() - -Get build's Log - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - buildId := "soSkq9ekdmfOslopH" // string | ID of the build, found in the build's Info tab. - stream := false // bool | If `true` or `1` then the logs will be streamed as long as the run or build is running. (optional) - download := false // bool | If `true` or `1` then the web browser will download the log file rather than open it in a tab. (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.ActorBuildsAPI.ActorBuildLogGet(context.Background(), buildId).Stream(stream).Download(download).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `ActorBuildsAPI.ActorBuildLogGet``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `ActorBuildLogGet`: string - fmt.Fprintf(os.Stdout, "Response from `ActorBuildsAPI.ActorBuildLogGet`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**buildId** | **string** | ID of the build, found in the build's Info tab. | - -### Other Parameters - -Other parameters are passed through a pointer to a apiActorBuildLogGetRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - **stream** | **bool** | If `true` or `1` then the logs will be streamed as long as the run or build is running. | - **download** | **bool** | If `true` or `1` then the web browser will download the log file rather than open it in a tab. | - -### Return type - -**string** - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: text/plain, application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## ActorBuildOpenapiJsonGet - -> map[string]interface{} ActorBuildOpenapiJsonGet(ctx, buildId).Execute() - -Get OpenAPI definition - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - buildId := "soSkq9ekdmfOslopH" // string | ID of the build, found in the build's Info tab. Use the special value `default` to get the OpenAPI schema for the Actor's default build. - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.ActorBuildsAPI.ActorBuildOpenapiJsonGet(context.Background(), buildId).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `ActorBuildsAPI.ActorBuildOpenapiJsonGet``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `ActorBuildOpenapiJsonGet`: map[string]interface{} - fmt.Fprintf(os.Stdout, "Response from `ActorBuildsAPI.ActorBuildOpenapiJsonGet`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**buildId** | **string** | ID of the build, found in the build's Info tab. Use the special value `default` to get the OpenAPI schema for the Actor's default build. | - -### Other Parameters - -Other parameters are passed through a pointer to a apiActorBuildOpenapiJsonGetRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - -### Return type - -**map[string]interface{}** - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## ActorBuildsGet - -> ListOfBuildsResponse ActorBuildsGet(ctx).Offset(offset).Limit(limit).Desc(desc).Execute() - -Get user builds list - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - offset := float64(0) // float64 | Number of items that should be skipped at the start. The default value is `0`. (optional) - limit := float64(1000) // float64 | Maximum number of items to return. The default value as well as the maximum is `1000`. (optional) - desc := true // bool | If `true` or `1` then the objects are sorted by the `startedAt` field in descending order. By default, they are sorted in ascending order. (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.ActorBuildsAPI.ActorBuildsGet(context.Background()).Offset(offset).Limit(limit).Desc(desc).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `ActorBuildsAPI.ActorBuildsGet``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `ActorBuildsGet`: ListOfBuildsResponse - fmt.Fprintf(os.Stdout, "Response from `ActorBuildsAPI.ActorBuildsGet`: %v\n", resp) -} -``` - -### Path Parameters - - - -### Other Parameters - -Other parameters are passed through a pointer to a apiActorBuildsGetRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **offset** | **float64** | Number of items that should be skipped at the start. The default value is `0`. | - **limit** | **float64** | Maximum number of items to return. The default value as well as the maximum is `1000`. | - **desc** | **bool** | If `true` or `1` then the objects are sorted by the `startedAt` field in descending order. By default, they are sorted in ascending order. | - -### Return type - -[**ListOfBuildsResponse**](ListOfBuildsResponse.md) - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - diff --git a/docs/ActorChargeEvent.md b/docs/ActorChargeEvent.md deleted file mode 100644 index d818aa9..0000000 --- a/docs/ActorChargeEvent.md +++ /dev/null @@ -1,176 +0,0 @@ -# ActorChargeEvent - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**EventTitle** | **string** | Human-readable title shown to users in the billing UI. | -**EventDescription** | **string** | Human-readable description of what triggers this event. | -**EventPriceUsd** | Pointer to **float32** | Flat price per event in USD. Present only for non-tiered events. Mutually exclusive with `eventTieredPricingUsd`. | [optional] -**EventTieredPricingUsd** | Pointer to [**map[string]TieredPricingPerEventEntry**](TieredPricingPerEventEntry.md) | Tiered price-per-event pricing for a single charge event, keyed by subscription tier (e.g. `FREE`, `BRONZE`, `SILVER`, `GOLD`, `PLATINUM`, `DIAMOND`). The actual price applied is resolved from the user's tier. | [optional] -**IsPrimaryEvent** | Pointer to **bool** | Whether this event is the Actor's primary chargeable event. | [optional] -**IsOneTimeEvent** | Pointer to **bool** | Whether this event can only be charged once per Actor run. | [optional] - -## Methods - -### NewActorChargeEvent - -`func NewActorChargeEvent(eventTitle string, eventDescription string, ) *ActorChargeEvent` - -NewActorChargeEvent instantiates a new ActorChargeEvent object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewActorChargeEventWithDefaults - -`func NewActorChargeEventWithDefaults() *ActorChargeEvent` - -NewActorChargeEventWithDefaults instantiates a new ActorChargeEvent object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetEventTitle - -`func (o *ActorChargeEvent) GetEventTitle() string` - -GetEventTitle returns the EventTitle field if non-nil, zero value otherwise. - -### GetEventTitleOk - -`func (o *ActorChargeEvent) GetEventTitleOk() (*string, bool)` - -GetEventTitleOk returns a tuple with the EventTitle field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetEventTitle - -`func (o *ActorChargeEvent) SetEventTitle(v string)` - -SetEventTitle sets EventTitle field to given value. - - -### GetEventDescription - -`func (o *ActorChargeEvent) GetEventDescription() string` - -GetEventDescription returns the EventDescription field if non-nil, zero value otherwise. - -### GetEventDescriptionOk - -`func (o *ActorChargeEvent) GetEventDescriptionOk() (*string, bool)` - -GetEventDescriptionOk returns a tuple with the EventDescription field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetEventDescription - -`func (o *ActorChargeEvent) SetEventDescription(v string)` - -SetEventDescription sets EventDescription field to given value. - - -### GetEventPriceUsd - -`func (o *ActorChargeEvent) GetEventPriceUsd() float32` - -GetEventPriceUsd returns the EventPriceUsd field if non-nil, zero value otherwise. - -### GetEventPriceUsdOk - -`func (o *ActorChargeEvent) GetEventPriceUsdOk() (*float32, bool)` - -GetEventPriceUsdOk returns a tuple with the EventPriceUsd field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetEventPriceUsd - -`func (o *ActorChargeEvent) SetEventPriceUsd(v float32)` - -SetEventPriceUsd sets EventPriceUsd field to given value. - -### HasEventPriceUsd - -`func (o *ActorChargeEvent) HasEventPriceUsd() bool` - -HasEventPriceUsd returns a boolean if a field has been set. - -### GetEventTieredPricingUsd - -`func (o *ActorChargeEvent) GetEventTieredPricingUsd() map[string]TieredPricingPerEventEntry` - -GetEventTieredPricingUsd returns the EventTieredPricingUsd field if non-nil, zero value otherwise. - -### GetEventTieredPricingUsdOk - -`func (o *ActorChargeEvent) GetEventTieredPricingUsdOk() (*map[string]TieredPricingPerEventEntry, bool)` - -GetEventTieredPricingUsdOk returns a tuple with the EventTieredPricingUsd field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetEventTieredPricingUsd - -`func (o *ActorChargeEvent) SetEventTieredPricingUsd(v map[string]TieredPricingPerEventEntry)` - -SetEventTieredPricingUsd sets EventTieredPricingUsd field to given value. - -### HasEventTieredPricingUsd - -`func (o *ActorChargeEvent) HasEventTieredPricingUsd() bool` - -HasEventTieredPricingUsd returns a boolean if a field has been set. - -### GetIsPrimaryEvent - -`func (o *ActorChargeEvent) GetIsPrimaryEvent() bool` - -GetIsPrimaryEvent returns the IsPrimaryEvent field if non-nil, zero value otherwise. - -### GetIsPrimaryEventOk - -`func (o *ActorChargeEvent) GetIsPrimaryEventOk() (*bool, bool)` - -GetIsPrimaryEventOk returns a tuple with the IsPrimaryEvent field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetIsPrimaryEvent - -`func (o *ActorChargeEvent) SetIsPrimaryEvent(v bool)` - -SetIsPrimaryEvent sets IsPrimaryEvent field to given value. - -### HasIsPrimaryEvent - -`func (o *ActorChargeEvent) HasIsPrimaryEvent() bool` - -HasIsPrimaryEvent returns a boolean if a field has been set. - -### GetIsOneTimeEvent - -`func (o *ActorChargeEvent) GetIsOneTimeEvent() bool` - -GetIsOneTimeEvent returns the IsOneTimeEvent field if non-nil, zero value otherwise. - -### GetIsOneTimeEventOk - -`func (o *ActorChargeEvent) GetIsOneTimeEventOk() (*bool, bool)` - -GetIsOneTimeEventOk returns a tuple with the IsOneTimeEvent field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetIsOneTimeEvent - -`func (o *ActorChargeEvent) SetIsOneTimeEvent(v bool)` - -SetIsOneTimeEvent sets IsOneTimeEvent field to given value. - -### HasIsOneTimeEvent - -`func (o *ActorChargeEvent) HasIsOneTimeEvent() bool` - -HasIsOneTimeEvent returns a boolean if a field has been set. - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/ActorDefinition.md b/docs/ActorDefinition.md deleted file mode 100644 index faeeb58..0000000 --- a/docs/ActorDefinition.md +++ /dev/null @@ -1,420 +0,0 @@ -# ActorDefinition - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**ActorSpecification** | Pointer to **int32** | The Actor specification version that this Actor follows. This property must be set to 1. | [optional] -**Name** | Pointer to **string** | The name of the Actor. | [optional] -**Version** | Pointer to **string** | The version of the Actor, typically a dot-separated sequence of numbers (e.g., `0.1`, `1.0`, or `0.0.1`). | [optional] -**BuildTag** | Pointer to **string** | The tag name to be applied to a successful build of the Actor. Defaults to 'latest' if not specified. | [optional] -**EnvironmentVariables** | Pointer to **map[string]string** | A map of environment variables to be used during local development and deployment. | [optional] -**Dockerfile** | Pointer to **string** | The path to the Dockerfile used for building the Actor on the platform. | [optional] -**DockerContextDir** | Pointer to **string** | The path to the directory used as the Docker context when building the Actor. | [optional] -**Readme** | Pointer to **string** | The path to the README file for the Actor. | [optional] -**Input** | Pointer to **map[string]interface{}** | The input schema object, the full specification can be found in [Apify docs](https://docs.apify.com/platform/actors/development/actor-definition/input-schema) | [optional] -**Changelog** | Pointer to **string** | The path to the CHANGELOG file displayed in the Actor's information tab. | [optional] -**Storages** | Pointer to [**ActorDefinitionStorages**](ActorDefinitionStorages.md) | | [optional] -**DefaultMemoryMbytes** | Pointer to [**ActorDefinitionDefaultMemoryMbytes**](ActorDefinitionDefaultMemoryMbytes.md) | | [optional] -**MinMemoryMbytes** | Pointer to **int32** | Specifies the minimum amount of memory in megabytes required by the Actor. | [optional] -**MaxMemoryMbytes** | Pointer to **int32** | Specifies the maximum amount of memory in megabytes required by the Actor. | [optional] -**UsesStandbyMode** | Pointer to **bool** | Specifies whether Standby mode is enabled for the Actor. | [optional] - -## Methods - -### NewActorDefinition - -`func NewActorDefinition() *ActorDefinition` - -NewActorDefinition instantiates a new ActorDefinition object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewActorDefinitionWithDefaults - -`func NewActorDefinitionWithDefaults() *ActorDefinition` - -NewActorDefinitionWithDefaults instantiates a new ActorDefinition object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetActorSpecification - -`func (o *ActorDefinition) GetActorSpecification() int32` - -GetActorSpecification returns the ActorSpecification field if non-nil, zero value otherwise. - -### GetActorSpecificationOk - -`func (o *ActorDefinition) GetActorSpecificationOk() (*int32, bool)` - -GetActorSpecificationOk returns a tuple with the ActorSpecification field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetActorSpecification - -`func (o *ActorDefinition) SetActorSpecification(v int32)` - -SetActorSpecification sets ActorSpecification field to given value. - -### HasActorSpecification - -`func (o *ActorDefinition) HasActorSpecification() bool` - -HasActorSpecification returns a boolean if a field has been set. - -### GetName - -`func (o *ActorDefinition) GetName() string` - -GetName returns the Name field if non-nil, zero value otherwise. - -### GetNameOk - -`func (o *ActorDefinition) GetNameOk() (*string, bool)` - -GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetName - -`func (o *ActorDefinition) SetName(v string)` - -SetName sets Name field to given value. - -### HasName - -`func (o *ActorDefinition) HasName() bool` - -HasName returns a boolean if a field has been set. - -### GetVersion - -`func (o *ActorDefinition) GetVersion() string` - -GetVersion returns the Version field if non-nil, zero value otherwise. - -### GetVersionOk - -`func (o *ActorDefinition) GetVersionOk() (*string, bool)` - -GetVersionOk returns a tuple with the Version field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetVersion - -`func (o *ActorDefinition) SetVersion(v string)` - -SetVersion sets Version field to given value. - -### HasVersion - -`func (o *ActorDefinition) HasVersion() bool` - -HasVersion returns a boolean if a field has been set. - -### GetBuildTag - -`func (o *ActorDefinition) GetBuildTag() string` - -GetBuildTag returns the BuildTag field if non-nil, zero value otherwise. - -### GetBuildTagOk - -`func (o *ActorDefinition) GetBuildTagOk() (*string, bool)` - -GetBuildTagOk returns a tuple with the BuildTag field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetBuildTag - -`func (o *ActorDefinition) SetBuildTag(v string)` - -SetBuildTag sets BuildTag field to given value. - -### HasBuildTag - -`func (o *ActorDefinition) HasBuildTag() bool` - -HasBuildTag returns a boolean if a field has been set. - -### GetEnvironmentVariables - -`func (o *ActorDefinition) GetEnvironmentVariables() map[string]string` - -GetEnvironmentVariables returns the EnvironmentVariables field if non-nil, zero value otherwise. - -### GetEnvironmentVariablesOk - -`func (o *ActorDefinition) GetEnvironmentVariablesOk() (*map[string]string, bool)` - -GetEnvironmentVariablesOk returns a tuple with the EnvironmentVariables field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetEnvironmentVariables - -`func (o *ActorDefinition) SetEnvironmentVariables(v map[string]string)` - -SetEnvironmentVariables sets EnvironmentVariables field to given value. - -### HasEnvironmentVariables - -`func (o *ActorDefinition) HasEnvironmentVariables() bool` - -HasEnvironmentVariables returns a boolean if a field has been set. - -### GetDockerfile - -`func (o *ActorDefinition) GetDockerfile() string` - -GetDockerfile returns the Dockerfile field if non-nil, zero value otherwise. - -### GetDockerfileOk - -`func (o *ActorDefinition) GetDockerfileOk() (*string, bool)` - -GetDockerfileOk returns a tuple with the Dockerfile field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetDockerfile - -`func (o *ActorDefinition) SetDockerfile(v string)` - -SetDockerfile sets Dockerfile field to given value. - -### HasDockerfile - -`func (o *ActorDefinition) HasDockerfile() bool` - -HasDockerfile returns a boolean if a field has been set. - -### GetDockerContextDir - -`func (o *ActorDefinition) GetDockerContextDir() string` - -GetDockerContextDir returns the DockerContextDir field if non-nil, zero value otherwise. - -### GetDockerContextDirOk - -`func (o *ActorDefinition) GetDockerContextDirOk() (*string, bool)` - -GetDockerContextDirOk returns a tuple with the DockerContextDir field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetDockerContextDir - -`func (o *ActorDefinition) SetDockerContextDir(v string)` - -SetDockerContextDir sets DockerContextDir field to given value. - -### HasDockerContextDir - -`func (o *ActorDefinition) HasDockerContextDir() bool` - -HasDockerContextDir returns a boolean if a field has been set. - -### GetReadme - -`func (o *ActorDefinition) GetReadme() string` - -GetReadme returns the Readme field if non-nil, zero value otherwise. - -### GetReadmeOk - -`func (o *ActorDefinition) GetReadmeOk() (*string, bool)` - -GetReadmeOk returns a tuple with the Readme field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetReadme - -`func (o *ActorDefinition) SetReadme(v string)` - -SetReadme sets Readme field to given value. - -### HasReadme - -`func (o *ActorDefinition) HasReadme() bool` - -HasReadme returns a boolean if a field has been set. - -### GetInput - -`func (o *ActorDefinition) GetInput() map[string]interface{}` - -GetInput returns the Input field if non-nil, zero value otherwise. - -### GetInputOk - -`func (o *ActorDefinition) GetInputOk() (*map[string]interface{}, bool)` - -GetInputOk returns a tuple with the Input field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetInput - -`func (o *ActorDefinition) SetInput(v map[string]interface{})` - -SetInput sets Input field to given value. - -### HasInput - -`func (o *ActorDefinition) HasInput() bool` - -HasInput returns a boolean if a field has been set. - -### GetChangelog - -`func (o *ActorDefinition) GetChangelog() string` - -GetChangelog returns the Changelog field if non-nil, zero value otherwise. - -### GetChangelogOk - -`func (o *ActorDefinition) GetChangelogOk() (*string, bool)` - -GetChangelogOk returns a tuple with the Changelog field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetChangelog - -`func (o *ActorDefinition) SetChangelog(v string)` - -SetChangelog sets Changelog field to given value. - -### HasChangelog - -`func (o *ActorDefinition) HasChangelog() bool` - -HasChangelog returns a boolean if a field has been set. - -### GetStorages - -`func (o *ActorDefinition) GetStorages() ActorDefinitionStorages` - -GetStorages returns the Storages field if non-nil, zero value otherwise. - -### GetStoragesOk - -`func (o *ActorDefinition) GetStoragesOk() (*ActorDefinitionStorages, bool)` - -GetStoragesOk returns a tuple with the Storages field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetStorages - -`func (o *ActorDefinition) SetStorages(v ActorDefinitionStorages)` - -SetStorages sets Storages field to given value. - -### HasStorages - -`func (o *ActorDefinition) HasStorages() bool` - -HasStorages returns a boolean if a field has been set. - -### GetDefaultMemoryMbytes - -`func (o *ActorDefinition) GetDefaultMemoryMbytes() ActorDefinitionDefaultMemoryMbytes` - -GetDefaultMemoryMbytes returns the DefaultMemoryMbytes field if non-nil, zero value otherwise. - -### GetDefaultMemoryMbytesOk - -`func (o *ActorDefinition) GetDefaultMemoryMbytesOk() (*ActorDefinitionDefaultMemoryMbytes, bool)` - -GetDefaultMemoryMbytesOk returns a tuple with the DefaultMemoryMbytes field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetDefaultMemoryMbytes - -`func (o *ActorDefinition) SetDefaultMemoryMbytes(v ActorDefinitionDefaultMemoryMbytes)` - -SetDefaultMemoryMbytes sets DefaultMemoryMbytes field to given value. - -### HasDefaultMemoryMbytes - -`func (o *ActorDefinition) HasDefaultMemoryMbytes() bool` - -HasDefaultMemoryMbytes returns a boolean if a field has been set. - -### GetMinMemoryMbytes - -`func (o *ActorDefinition) GetMinMemoryMbytes() int32` - -GetMinMemoryMbytes returns the MinMemoryMbytes field if non-nil, zero value otherwise. - -### GetMinMemoryMbytesOk - -`func (o *ActorDefinition) GetMinMemoryMbytesOk() (*int32, bool)` - -GetMinMemoryMbytesOk returns a tuple with the MinMemoryMbytes field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetMinMemoryMbytes - -`func (o *ActorDefinition) SetMinMemoryMbytes(v int32)` - -SetMinMemoryMbytes sets MinMemoryMbytes field to given value. - -### HasMinMemoryMbytes - -`func (o *ActorDefinition) HasMinMemoryMbytes() bool` - -HasMinMemoryMbytes returns a boolean if a field has been set. - -### GetMaxMemoryMbytes - -`func (o *ActorDefinition) GetMaxMemoryMbytes() int32` - -GetMaxMemoryMbytes returns the MaxMemoryMbytes field if non-nil, zero value otherwise. - -### GetMaxMemoryMbytesOk - -`func (o *ActorDefinition) GetMaxMemoryMbytesOk() (*int32, bool)` - -GetMaxMemoryMbytesOk returns a tuple with the MaxMemoryMbytes field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetMaxMemoryMbytes - -`func (o *ActorDefinition) SetMaxMemoryMbytes(v int32)` - -SetMaxMemoryMbytes sets MaxMemoryMbytes field to given value. - -### HasMaxMemoryMbytes - -`func (o *ActorDefinition) HasMaxMemoryMbytes() bool` - -HasMaxMemoryMbytes returns a boolean if a field has been set. - -### GetUsesStandbyMode - -`func (o *ActorDefinition) GetUsesStandbyMode() bool` - -GetUsesStandbyMode returns the UsesStandbyMode field if non-nil, zero value otherwise. - -### GetUsesStandbyModeOk - -`func (o *ActorDefinition) GetUsesStandbyModeOk() (*bool, bool)` - -GetUsesStandbyModeOk returns a tuple with the UsesStandbyMode field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetUsesStandbyMode - -`func (o *ActorDefinition) SetUsesStandbyMode(v bool)` - -SetUsesStandbyMode sets UsesStandbyMode field to given value. - -### HasUsesStandbyMode - -`func (o *ActorDefinition) HasUsesStandbyMode() bool` - -HasUsesStandbyMode returns a boolean if a field has been set. - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/ActorDefinitionDefaultMemoryMbytes.md b/docs/ActorDefinitionDefaultMemoryMbytes.md deleted file mode 100644 index ab2f836..0000000 --- a/docs/ActorDefinitionDefaultMemoryMbytes.md +++ /dev/null @@ -1,30 +0,0 @@ -# ActorDefinitionDefaultMemoryMbytes - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - -## Methods - -### NewActorDefinitionDefaultMemoryMbytes - -`func NewActorDefinitionDefaultMemoryMbytes() *ActorDefinitionDefaultMemoryMbytes` - -NewActorDefinitionDefaultMemoryMbytes instantiates a new ActorDefinitionDefaultMemoryMbytes object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewActorDefinitionDefaultMemoryMbytesWithDefaults - -`func NewActorDefinitionDefaultMemoryMbytesWithDefaults() *ActorDefinitionDefaultMemoryMbytes` - -NewActorDefinitionDefaultMemoryMbytesWithDefaults instantiates a new ActorDefinitionDefaultMemoryMbytes object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/ActorDefinitionStorages.md b/docs/ActorDefinitionStorages.md deleted file mode 100644 index 937541c..0000000 --- a/docs/ActorDefinitionStorages.md +++ /dev/null @@ -1,56 +0,0 @@ -# ActorDefinitionStorages - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Dataset** | Pointer to **map[string]interface{}** | Defines the schema of items in your dataset, the full specification can be found in [Apify docs](https://docs.apify.com/platform/actors/development/actor-definition/dataset-schema) | [optional] - -## Methods - -### NewActorDefinitionStorages - -`func NewActorDefinitionStorages() *ActorDefinitionStorages` - -NewActorDefinitionStorages instantiates a new ActorDefinitionStorages object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewActorDefinitionStoragesWithDefaults - -`func NewActorDefinitionStoragesWithDefaults() *ActorDefinitionStorages` - -NewActorDefinitionStoragesWithDefaults instantiates a new ActorDefinitionStorages object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetDataset - -`func (o *ActorDefinitionStorages) GetDataset() map[string]interface{}` - -GetDataset returns the Dataset field if non-nil, zero value otherwise. - -### GetDatasetOk - -`func (o *ActorDefinitionStorages) GetDatasetOk() (*map[string]interface{}, bool)` - -GetDatasetOk returns a tuple with the Dataset field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetDataset - -`func (o *ActorDefinitionStorages) SetDataset(v map[string]interface{})` - -SetDataset sets Dataset field to given value. - -### HasDataset - -`func (o *ActorDefinitionStorages) HasDataset() bool` - -HasDataset returns a boolean if a field has been set. - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/ActorJobStatus.md b/docs/ActorJobStatus.md deleted file mode 100644 index 4811a84..0000000 --- a/docs/ActorJobStatus.md +++ /dev/null @@ -1,25 +0,0 @@ -# ActorJobStatus - -## Enum - - -* `READY` (value: `"READY"`) - -* `RUNNING` (value: `"RUNNING"`) - -* `SUCCEEDED` (value: `"SUCCEEDED"`) - -* `FAILED` (value: `"FAILED"`) - -* `TIMING_OUT` (value: `"TIMING-OUT"`) - -* `TIMED_OUT` (value: `"TIMED-OUT"`) - -* `ABORTING` (value: `"ABORTING"`) - -* `ABORTED` (value: `"ABORTED"`) - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/ActorPermissionLevel.md b/docs/ActorPermissionLevel.md deleted file mode 100644 index 7f2aa27..0000000 --- a/docs/ActorPermissionLevel.md +++ /dev/null @@ -1,13 +0,0 @@ -# ActorPermissionLevel - -## Enum - - -* `LIMITED_PERMISSIONS` (value: `"LIMITED_PERMISSIONS"`) - -* `FULL_PERMISSIONS` (value: `"FULL_PERMISSIONS"`) - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/ActorResponse.md b/docs/ActorResponse.md deleted file mode 100644 index 6305a21..0000000 --- a/docs/ActorResponse.md +++ /dev/null @@ -1,51 +0,0 @@ -# ActorResponse - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Data** | [**Actor**](Actor.md) | | - -## Methods - -### NewActorResponse - -`func NewActorResponse(data Actor, ) *ActorResponse` - -NewActorResponse instantiates a new ActorResponse object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewActorResponseWithDefaults - -`func NewActorResponseWithDefaults() *ActorResponse` - -NewActorResponseWithDefaults instantiates a new ActorResponse object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetData - -`func (o *ActorResponse) GetData() Actor` - -GetData returns the Data field if non-nil, zero value otherwise. - -### GetDataOk - -`func (o *ActorResponse) GetDataOk() (*Actor, bool)` - -GetDataOk returns a tuple with the Data field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetData - -`func (o *ActorResponse) SetData(v Actor)` - -SetData sets Data field to given value. - - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/ActorRunFailedError.md b/docs/ActorRunFailedError.md deleted file mode 100644 index 493b82f..0000000 --- a/docs/ActorRunFailedError.md +++ /dev/null @@ -1,56 +0,0 @@ -# ActorRunFailedError - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Error** | Pointer to [**RunFailedErrorDetail**](RunFailedErrorDetail.md) | | [optional] - -## Methods - -### NewActorRunFailedError - -`func NewActorRunFailedError() *ActorRunFailedError` - -NewActorRunFailedError instantiates a new ActorRunFailedError object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewActorRunFailedErrorWithDefaults - -`func NewActorRunFailedErrorWithDefaults() *ActorRunFailedError` - -NewActorRunFailedErrorWithDefaults instantiates a new ActorRunFailedError object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetError - -`func (o *ActorRunFailedError) GetError() RunFailedErrorDetail` - -GetError returns the Error field if non-nil, zero value otherwise. - -### GetErrorOk - -`func (o *ActorRunFailedError) GetErrorOk() (*RunFailedErrorDetail, bool)` - -GetErrorOk returns a tuple with the Error field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetError - -`func (o *ActorRunFailedError) SetError(v RunFailedErrorDetail)` - -SetError sets Error field to given value. - -### HasError - -`func (o *ActorRunFailedError) HasError() bool` - -HasError returns a boolean if a field has been set. - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/ActorRunPricingInfo.md b/docs/ActorRunPricingInfo.md deleted file mode 100644 index 577f8c9..0000000 --- a/docs/ActorRunPricingInfo.md +++ /dev/null @@ -1,380 +0,0 @@ -# ActorRunPricingInfo - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**ApifyMarginPercentage** | **float32** | In [0, 1], fraction of pricePerUnitUsd that goes to Apify | -**CreatedAt** | **time.Time** | When this pricing info record has been created | -**StartedAt** | **time.Time** | Since when is this pricing info record effective for a given Actor | -**NotifiedAboutFutureChangeAt** | Pointer to **time.Time** | | [optional] -**NotifiedAboutChangeAt** | Pointer to **time.Time** | | [optional] -**ReasonForChange** | Pointer to **string** | | [optional] -**IsPriceChangeNotificationSuppressed** | Pointer to **bool** | | [optional] -**ForceContainsSignificantPriceChange** | Pointer to **bool** | | [optional] -**PricingModel** | **string** | | -**PricingPerEvent** | [**PayPerEventActorPricingInfoAllOfPricingPerEvent**](PayPerEventActorPricingInfoAllOfPricingPerEvent.md) | | -**MinimalMaxTotalChargeUsd** | Pointer to **float32** | | [optional] -**UnitName** | **string** | Name of the unit that is being charged | -**PricePerUnitUsd** | **float32** | Monthly flat price in USD | -**TieredPricing** | Pointer to [**map[string]TieredPricingPerDatasetItemEntry**](TieredPricingPerDatasetItemEntry.md) | Tiered price-per-dataset-item pricing, keyed by subscription tier (e.g. `FREE`, `BRONZE`, `SILVER`, `GOLD`, `PLATINUM`, `DIAMOND`). The actual price applied to a run is resolved from the user's tier. | [optional] -**TrialMinutes** | **int32** | For how long this Actor can be used for free in trial period | - -## Methods - -### NewActorRunPricingInfo - -`func NewActorRunPricingInfo(apifyMarginPercentage float32, createdAt time.Time, startedAt time.Time, pricingModel string, pricingPerEvent PayPerEventActorPricingInfoAllOfPricingPerEvent, unitName string, pricePerUnitUsd float32, trialMinutes int32, ) *ActorRunPricingInfo` - -NewActorRunPricingInfo instantiates a new ActorRunPricingInfo object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewActorRunPricingInfoWithDefaults - -`func NewActorRunPricingInfoWithDefaults() *ActorRunPricingInfo` - -NewActorRunPricingInfoWithDefaults instantiates a new ActorRunPricingInfo object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetApifyMarginPercentage - -`func (o *ActorRunPricingInfo) GetApifyMarginPercentage() float32` - -GetApifyMarginPercentage returns the ApifyMarginPercentage field if non-nil, zero value otherwise. - -### GetApifyMarginPercentageOk - -`func (o *ActorRunPricingInfo) GetApifyMarginPercentageOk() (*float32, bool)` - -GetApifyMarginPercentageOk returns a tuple with the ApifyMarginPercentage field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetApifyMarginPercentage - -`func (o *ActorRunPricingInfo) SetApifyMarginPercentage(v float32)` - -SetApifyMarginPercentage sets ApifyMarginPercentage field to given value. - - -### GetCreatedAt - -`func (o *ActorRunPricingInfo) GetCreatedAt() time.Time` - -GetCreatedAt returns the CreatedAt field if non-nil, zero value otherwise. - -### GetCreatedAtOk - -`func (o *ActorRunPricingInfo) GetCreatedAtOk() (*time.Time, bool)` - -GetCreatedAtOk returns a tuple with the CreatedAt field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetCreatedAt - -`func (o *ActorRunPricingInfo) SetCreatedAt(v time.Time)` - -SetCreatedAt sets CreatedAt field to given value. - - -### GetStartedAt - -`func (o *ActorRunPricingInfo) GetStartedAt() time.Time` - -GetStartedAt returns the StartedAt field if non-nil, zero value otherwise. - -### GetStartedAtOk - -`func (o *ActorRunPricingInfo) GetStartedAtOk() (*time.Time, bool)` - -GetStartedAtOk returns a tuple with the StartedAt field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetStartedAt - -`func (o *ActorRunPricingInfo) SetStartedAt(v time.Time)` - -SetStartedAt sets StartedAt field to given value. - - -### GetNotifiedAboutFutureChangeAt - -`func (o *ActorRunPricingInfo) GetNotifiedAboutFutureChangeAt() time.Time` - -GetNotifiedAboutFutureChangeAt returns the NotifiedAboutFutureChangeAt field if non-nil, zero value otherwise. - -### GetNotifiedAboutFutureChangeAtOk - -`func (o *ActorRunPricingInfo) GetNotifiedAboutFutureChangeAtOk() (*time.Time, bool)` - -GetNotifiedAboutFutureChangeAtOk returns a tuple with the NotifiedAboutFutureChangeAt field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetNotifiedAboutFutureChangeAt - -`func (o *ActorRunPricingInfo) SetNotifiedAboutFutureChangeAt(v time.Time)` - -SetNotifiedAboutFutureChangeAt sets NotifiedAboutFutureChangeAt field to given value. - -### HasNotifiedAboutFutureChangeAt - -`func (o *ActorRunPricingInfo) HasNotifiedAboutFutureChangeAt() bool` - -HasNotifiedAboutFutureChangeAt returns a boolean if a field has been set. - -### GetNotifiedAboutChangeAt - -`func (o *ActorRunPricingInfo) GetNotifiedAboutChangeAt() time.Time` - -GetNotifiedAboutChangeAt returns the NotifiedAboutChangeAt field if non-nil, zero value otherwise. - -### GetNotifiedAboutChangeAtOk - -`func (o *ActorRunPricingInfo) GetNotifiedAboutChangeAtOk() (*time.Time, bool)` - -GetNotifiedAboutChangeAtOk returns a tuple with the NotifiedAboutChangeAt field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetNotifiedAboutChangeAt - -`func (o *ActorRunPricingInfo) SetNotifiedAboutChangeAt(v time.Time)` - -SetNotifiedAboutChangeAt sets NotifiedAboutChangeAt field to given value. - -### HasNotifiedAboutChangeAt - -`func (o *ActorRunPricingInfo) HasNotifiedAboutChangeAt() bool` - -HasNotifiedAboutChangeAt returns a boolean if a field has been set. - -### GetReasonForChange - -`func (o *ActorRunPricingInfo) GetReasonForChange() string` - -GetReasonForChange returns the ReasonForChange field if non-nil, zero value otherwise. - -### GetReasonForChangeOk - -`func (o *ActorRunPricingInfo) GetReasonForChangeOk() (*string, bool)` - -GetReasonForChangeOk returns a tuple with the ReasonForChange field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetReasonForChange - -`func (o *ActorRunPricingInfo) SetReasonForChange(v string)` - -SetReasonForChange sets ReasonForChange field to given value. - -### HasReasonForChange - -`func (o *ActorRunPricingInfo) HasReasonForChange() bool` - -HasReasonForChange returns a boolean if a field has been set. - -### GetIsPriceChangeNotificationSuppressed - -`func (o *ActorRunPricingInfo) GetIsPriceChangeNotificationSuppressed() bool` - -GetIsPriceChangeNotificationSuppressed returns the IsPriceChangeNotificationSuppressed field if non-nil, zero value otherwise. - -### GetIsPriceChangeNotificationSuppressedOk - -`func (o *ActorRunPricingInfo) GetIsPriceChangeNotificationSuppressedOk() (*bool, bool)` - -GetIsPriceChangeNotificationSuppressedOk returns a tuple with the IsPriceChangeNotificationSuppressed field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetIsPriceChangeNotificationSuppressed - -`func (o *ActorRunPricingInfo) SetIsPriceChangeNotificationSuppressed(v bool)` - -SetIsPriceChangeNotificationSuppressed sets IsPriceChangeNotificationSuppressed field to given value. - -### HasIsPriceChangeNotificationSuppressed - -`func (o *ActorRunPricingInfo) HasIsPriceChangeNotificationSuppressed() bool` - -HasIsPriceChangeNotificationSuppressed returns a boolean if a field has been set. - -### GetForceContainsSignificantPriceChange - -`func (o *ActorRunPricingInfo) GetForceContainsSignificantPriceChange() bool` - -GetForceContainsSignificantPriceChange returns the ForceContainsSignificantPriceChange field if non-nil, zero value otherwise. - -### GetForceContainsSignificantPriceChangeOk - -`func (o *ActorRunPricingInfo) GetForceContainsSignificantPriceChangeOk() (*bool, bool)` - -GetForceContainsSignificantPriceChangeOk returns a tuple with the ForceContainsSignificantPriceChange field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetForceContainsSignificantPriceChange - -`func (o *ActorRunPricingInfo) SetForceContainsSignificantPriceChange(v bool)` - -SetForceContainsSignificantPriceChange sets ForceContainsSignificantPriceChange field to given value. - -### HasForceContainsSignificantPriceChange - -`func (o *ActorRunPricingInfo) HasForceContainsSignificantPriceChange() bool` - -HasForceContainsSignificantPriceChange returns a boolean if a field has been set. - -### GetPricingModel - -`func (o *ActorRunPricingInfo) GetPricingModel() string` - -GetPricingModel returns the PricingModel field if non-nil, zero value otherwise. - -### GetPricingModelOk - -`func (o *ActorRunPricingInfo) GetPricingModelOk() (*string, bool)` - -GetPricingModelOk returns a tuple with the PricingModel field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetPricingModel - -`func (o *ActorRunPricingInfo) SetPricingModel(v string)` - -SetPricingModel sets PricingModel field to given value. - - -### GetPricingPerEvent - -`func (o *ActorRunPricingInfo) GetPricingPerEvent() PayPerEventActorPricingInfoAllOfPricingPerEvent` - -GetPricingPerEvent returns the PricingPerEvent field if non-nil, zero value otherwise. - -### GetPricingPerEventOk - -`func (o *ActorRunPricingInfo) GetPricingPerEventOk() (*PayPerEventActorPricingInfoAllOfPricingPerEvent, bool)` - -GetPricingPerEventOk returns a tuple with the PricingPerEvent field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetPricingPerEvent - -`func (o *ActorRunPricingInfo) SetPricingPerEvent(v PayPerEventActorPricingInfoAllOfPricingPerEvent)` - -SetPricingPerEvent sets PricingPerEvent field to given value. - - -### GetMinimalMaxTotalChargeUsd - -`func (o *ActorRunPricingInfo) GetMinimalMaxTotalChargeUsd() float32` - -GetMinimalMaxTotalChargeUsd returns the MinimalMaxTotalChargeUsd field if non-nil, zero value otherwise. - -### GetMinimalMaxTotalChargeUsdOk - -`func (o *ActorRunPricingInfo) GetMinimalMaxTotalChargeUsdOk() (*float32, bool)` - -GetMinimalMaxTotalChargeUsdOk returns a tuple with the MinimalMaxTotalChargeUsd field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetMinimalMaxTotalChargeUsd - -`func (o *ActorRunPricingInfo) SetMinimalMaxTotalChargeUsd(v float32)` - -SetMinimalMaxTotalChargeUsd sets MinimalMaxTotalChargeUsd field to given value. - -### HasMinimalMaxTotalChargeUsd - -`func (o *ActorRunPricingInfo) HasMinimalMaxTotalChargeUsd() bool` - -HasMinimalMaxTotalChargeUsd returns a boolean if a field has been set. - -### GetUnitName - -`func (o *ActorRunPricingInfo) GetUnitName() string` - -GetUnitName returns the UnitName field if non-nil, zero value otherwise. - -### GetUnitNameOk - -`func (o *ActorRunPricingInfo) GetUnitNameOk() (*string, bool)` - -GetUnitNameOk returns a tuple with the UnitName field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetUnitName - -`func (o *ActorRunPricingInfo) SetUnitName(v string)` - -SetUnitName sets UnitName field to given value. - - -### GetPricePerUnitUsd - -`func (o *ActorRunPricingInfo) GetPricePerUnitUsd() float32` - -GetPricePerUnitUsd returns the PricePerUnitUsd field if non-nil, zero value otherwise. - -### GetPricePerUnitUsdOk - -`func (o *ActorRunPricingInfo) GetPricePerUnitUsdOk() (*float32, bool)` - -GetPricePerUnitUsdOk returns a tuple with the PricePerUnitUsd field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetPricePerUnitUsd - -`func (o *ActorRunPricingInfo) SetPricePerUnitUsd(v float32)` - -SetPricePerUnitUsd sets PricePerUnitUsd field to given value. - - -### GetTieredPricing - -`func (o *ActorRunPricingInfo) GetTieredPricing() map[string]TieredPricingPerDatasetItemEntry` - -GetTieredPricing returns the TieredPricing field if non-nil, zero value otherwise. - -### GetTieredPricingOk - -`func (o *ActorRunPricingInfo) GetTieredPricingOk() (*map[string]TieredPricingPerDatasetItemEntry, bool)` - -GetTieredPricingOk returns a tuple with the TieredPricing field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetTieredPricing - -`func (o *ActorRunPricingInfo) SetTieredPricing(v map[string]TieredPricingPerDatasetItemEntry)` - -SetTieredPricing sets TieredPricing field to given value. - -### HasTieredPricing - -`func (o *ActorRunPricingInfo) HasTieredPricing() bool` - -HasTieredPricing returns a boolean if a field has been set. - -### GetTrialMinutes - -`func (o *ActorRunPricingInfo) GetTrialMinutes() int32` - -GetTrialMinutes returns the TrialMinutes field if non-nil, zero value otherwise. - -### GetTrialMinutesOk - -`func (o *ActorRunPricingInfo) GetTrialMinutesOk() (*int32, bool)` - -GetTrialMinutesOk returns a tuple with the TrialMinutes field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetTrialMinutes - -`func (o *ActorRunPricingInfo) SetTrialMinutes(v int32)` - -SetTrialMinutes sets TrialMinutes field to given value. - - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/ActorRunTimeoutExceededError.md b/docs/ActorRunTimeoutExceededError.md deleted file mode 100644 index 5b4bb81..0000000 --- a/docs/ActorRunTimeoutExceededError.md +++ /dev/null @@ -1,56 +0,0 @@ -# ActorRunTimeoutExceededError - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Error** | Pointer to [**RunTimeoutExceededErrorDetail**](RunTimeoutExceededErrorDetail.md) | | [optional] - -## Methods - -### NewActorRunTimeoutExceededError - -`func NewActorRunTimeoutExceededError() *ActorRunTimeoutExceededError` - -NewActorRunTimeoutExceededError instantiates a new ActorRunTimeoutExceededError object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewActorRunTimeoutExceededErrorWithDefaults - -`func NewActorRunTimeoutExceededErrorWithDefaults() *ActorRunTimeoutExceededError` - -NewActorRunTimeoutExceededErrorWithDefaults instantiates a new ActorRunTimeoutExceededError object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetError - -`func (o *ActorRunTimeoutExceededError) GetError() RunTimeoutExceededErrorDetail` - -GetError returns the Error field if non-nil, zero value otherwise. - -### GetErrorOk - -`func (o *ActorRunTimeoutExceededError) GetErrorOk() (*RunTimeoutExceededErrorDetail, bool)` - -GetErrorOk returns a tuple with the Error field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetError - -`func (o *ActorRunTimeoutExceededError) SetError(v RunTimeoutExceededErrorDetail)` - -SetError sets Error field to given value. - -### HasError - -`func (o *ActorRunTimeoutExceededError) HasError() bool` - -HasError returns a boolean if a field has been set. - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/ActorRunsAPI.md b/docs/ActorRunsAPI.md deleted file mode 100644 index 0f58b0b..0000000 --- a/docs/ActorRunsAPI.md +++ /dev/null @@ -1,755 +0,0 @@ -# \ActorRunsAPI - -All URIs are relative to *https://api.apify.com* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**ActorRunAbortPost**](ActorRunsAPI.md#ActorRunAbortPost) | **Post** /v2/actor-runs/{runId}/abort | Abort run -[**ActorRunDelete**](ActorRunsAPI.md#ActorRunDelete) | **Delete** /v2/actor-runs/{runId} | Delete run -[**ActorRunGet**](ActorRunsAPI.md#ActorRunGet) | **Get** /v2/actor-runs/{runId} | Get run -[**ActorRunLogGet**](ActorRunsAPI.md#ActorRunLogGet) | **Get** /v2/actor-runs/{runId}/log | Get run's log -[**ActorRunMetamorphPost**](ActorRunsAPI.md#ActorRunMetamorphPost) | **Post** /v2/actor-runs/{runId}/metamorph | Metamorph run -[**ActorRunPut**](ActorRunsAPI.md#ActorRunPut) | **Put** /v2/actor-runs/{runId} | Update run -[**ActorRunRebootPost**](ActorRunsAPI.md#ActorRunRebootPost) | **Post** /v2/actor-runs/{runId}/reboot | Reboot run -[**ActorRunsGet**](ActorRunsAPI.md#ActorRunsGet) | **Get** /v2/actor-runs | Get user runs list -[**PostChargeRun**](ActorRunsAPI.md#PostChargeRun) | **Post** /v2/actor-runs/{runId}/charge | Charge events in run -[**PostResurrectRun**](ActorRunsAPI.md#PostResurrectRun) | **Post** /v2/actor-runs/{runId}/resurrect | Resurrect run - - - -## ActorRunAbortPost - -> RunResponse ActorRunAbortPost(ctx, runId).Gracefully(gracefully).Execute() - -Abort run - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - runId := "3KH8gEpp4d8uQSe8T" // string | Actor run ID. - gracefully := true // bool | If true passed, the Actor run will abort gracefully. It will send `aborting` and `persistState` event into run and force-stop the run after 30 seconds. It is helpful in cases where you plan to resurrect the run later. (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.ActorRunsAPI.ActorRunAbortPost(context.Background(), runId).Gracefully(gracefully).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `ActorRunsAPI.ActorRunAbortPost``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `ActorRunAbortPost`: RunResponse - fmt.Fprintf(os.Stdout, "Response from `ActorRunsAPI.ActorRunAbortPost`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**runId** | **string** | Actor run ID. | - -### Other Parameters - -Other parameters are passed through a pointer to a apiActorRunAbortPostRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - **gracefully** | **bool** | If true passed, the Actor run will abort gracefully. It will send `aborting` and `persistState` event into run and force-stop the run after 30 seconds. It is helpful in cases where you plan to resurrect the run later. | - -### Return type - -[**RunResponse**](RunResponse.md) - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## ActorRunDelete - -> ActorRunDelete(ctx, runId).Execute() - -Delete run - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - runId := "3KH8gEpp4d8uQSe8T" // string | Actor run ID. - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - r, err := apiClient.ActorRunsAPI.ActorRunDelete(context.Background(), runId).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `ActorRunsAPI.ActorRunDelete``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**runId** | **string** | Actor run ID. | - -### Other Parameters - -Other parameters are passed through a pointer to a apiActorRunDeleteRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - -### Return type - - (empty response body) - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## ActorRunGet - -> RunResponse ActorRunGet(ctx, runId).WaitForFinish(waitForFinish).Execute() - -Get run - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - runId := "3KH8gEpp4d8uQSe8T" // string | Actor run ID. - waitForFinish := float64(60) // float64 | The maximum number of seconds the server waits for the run to finish. By default it is `0`, the maximum value is `60`. <!-- MAX_ACTOR_JOB_ASYNC_WAIT_SECS --> If the run finishes in time then the returned run object will have a terminal status (e.g. `SUCCEEDED`), otherwise it will have a transitional status (e.g. `RUNNING`). (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.ActorRunsAPI.ActorRunGet(context.Background(), runId).WaitForFinish(waitForFinish).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `ActorRunsAPI.ActorRunGet``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `ActorRunGet`: RunResponse - fmt.Fprintf(os.Stdout, "Response from `ActorRunsAPI.ActorRunGet`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**runId** | **string** | Actor run ID. | - -### Other Parameters - -Other parameters are passed through a pointer to a apiActorRunGetRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - **waitForFinish** | **float64** | The maximum number of seconds the server waits for the run to finish. By default it is `0`, the maximum value is `60`. <!-- MAX_ACTOR_JOB_ASYNC_WAIT_SECS --> If the run finishes in time then the returned run object will have a terminal status (e.g. `SUCCEEDED`), otherwise it will have a transitional status (e.g. `RUNNING`). | - -### Return type - -[**RunResponse**](RunResponse.md) - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## ActorRunLogGet - -> string ActorRunLogGet(ctx, runId).Stream(stream).Download(download).Raw(raw).Execute() - -Get run's log - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - runId := "3KH8gEpp4d8uQSe8T" // string | Actor run ID. - stream := false // bool | If `true` or `1` then the logs will be streamed as long as the run or build is running. (optional) - download := false // bool | If `true` or `1` then the web browser will download the log file rather than open it in a tab. (optional) - raw := false // bool | If `true` or `1`, the logs will be kept verbatim. By default, the API removes ANSI escape codes from the logs, keeping only printable characters. (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.ActorRunsAPI.ActorRunLogGet(context.Background(), runId).Stream(stream).Download(download).Raw(raw).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `ActorRunsAPI.ActorRunLogGet``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `ActorRunLogGet`: string - fmt.Fprintf(os.Stdout, "Response from `ActorRunsAPI.ActorRunLogGet`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**runId** | **string** | Actor run ID. | - -### Other Parameters - -Other parameters are passed through a pointer to a apiActorRunLogGetRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - **stream** | **bool** | If `true` or `1` then the logs will be streamed as long as the run or build is running. | - **download** | **bool** | If `true` or `1` then the web browser will download the log file rather than open it in a tab. | - **raw** | **bool** | If `true` or `1`, the logs will be kept verbatim. By default, the API removes ANSI escape codes from the logs, keeping only printable characters. | - -### Return type - -**string** - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: text/plain, application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## ActorRunMetamorphPost - -> RunResponse ActorRunMetamorphPost(ctx, runId).TargetActorId(targetActorId).Build(build).Execute() - -Metamorph run - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - runId := "3KH8gEpp4d8uQSe8T" // string | Actor run ID. - targetActorId := "HDSasDasz78YcAPEB" // string | ID of a target Actor that the run should be transformed into. - build := "beta" // string | Optional build of the target Actor. It can be either a build tag or build number. By default, the run uses the build specified in the default run configuration for the target Actor (typically `latest`). (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.ActorRunsAPI.ActorRunMetamorphPost(context.Background(), runId).TargetActorId(targetActorId).Build(build).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `ActorRunsAPI.ActorRunMetamorphPost``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `ActorRunMetamorphPost`: RunResponse - fmt.Fprintf(os.Stdout, "Response from `ActorRunsAPI.ActorRunMetamorphPost`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**runId** | **string** | Actor run ID. | - -### Other Parameters - -Other parameters are passed through a pointer to a apiActorRunMetamorphPostRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - **targetActorId** | **string** | ID of a target Actor that the run should be transformed into. | - **build** | **string** | Optional build of the target Actor. It can be either a build tag or build number. By default, the run uses the build specified in the default run configuration for the target Actor (typically `latest`). | - -### Return type - -[**RunResponse**](RunResponse.md) - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## ActorRunPut - -> RunResponse ActorRunPut(ctx, runId).UpdateRunRequest(updateRunRequest).Execute() - -Update run - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - runId := "3KH8gEpp4d8uQSe8T" // string | Actor run ID. - updateRunRequest := *openapiclient.NewUpdateRunRequest() // UpdateRunRequest | - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.ActorRunsAPI.ActorRunPut(context.Background(), runId).UpdateRunRequest(updateRunRequest).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `ActorRunsAPI.ActorRunPut``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `ActorRunPut`: RunResponse - fmt.Fprintf(os.Stdout, "Response from `ActorRunsAPI.ActorRunPut`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**runId** | **string** | Actor run ID. | - -### Other Parameters - -Other parameters are passed through a pointer to a apiActorRunPutRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - **updateRunRequest** | [**UpdateRunRequest**](UpdateRunRequest.md) | | - -### Return type - -[**RunResponse**](RunResponse.md) - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## ActorRunRebootPost - -> RunResponse ActorRunRebootPost(ctx, runId).Execute() - -Reboot run - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - runId := "3KH8gEpp4d8uQSe8T" // string | Actor run ID. - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.ActorRunsAPI.ActorRunRebootPost(context.Background(), runId).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `ActorRunsAPI.ActorRunRebootPost``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `ActorRunRebootPost`: RunResponse - fmt.Fprintf(os.Stdout, "Response from `ActorRunsAPI.ActorRunRebootPost`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**runId** | **string** | Actor run ID. | - -### Other Parameters - -Other parameters are passed through a pointer to a apiActorRunRebootPostRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - -### Return type - -[**RunResponse**](RunResponse.md) - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## ActorRunsGet - -> ListOfRunsResponse ActorRunsGet(ctx).Offset(offset).Limit(limit).Desc(desc).Status(status).StartedAfter(startedAfter).StartedBefore(startedBefore).Execute() - -Get user runs list - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - "time" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - offset := float64(0) // float64 | Number of items that should be skipped at the start. The default value is `0`. (optional) - limit := float64(1000) // float64 | Maximum number of items to return. The default value as well as the maximum is `1000`. (optional) - desc := true // bool | If `true` or `1` then the objects are sorted by the `startedAt` field in descending order. By default, they are sorted in ascending order. (optional) - status := []string{"Inner_example"} // []string | Single status or comma-separated list of statuses, see ([available statuses](https://docs.apify.com/platform/actors/running/runs-and-builds#lifecycle)). Used to filter runs by the specified statuses only. (optional) - startedAfter := time.Now() // time.Time | Filter runs that started after the specified date and time (inclusive). The value must be a valid ISO 8601 datetime string (UTC). (optional) - startedBefore := time.Now() // time.Time | Filter runs that started before the specified date and time (inclusive). The value must be a valid ISO 8601 datetime string (UTC). (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.ActorRunsAPI.ActorRunsGet(context.Background()).Offset(offset).Limit(limit).Desc(desc).Status(status).StartedAfter(startedAfter).StartedBefore(startedBefore).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `ActorRunsAPI.ActorRunsGet``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `ActorRunsGet`: ListOfRunsResponse - fmt.Fprintf(os.Stdout, "Response from `ActorRunsAPI.ActorRunsGet`: %v\n", resp) -} -``` - -### Path Parameters - - - -### Other Parameters - -Other parameters are passed through a pointer to a apiActorRunsGetRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **offset** | **float64** | Number of items that should be skipped at the start. The default value is `0`. | - **limit** | **float64** | Maximum number of items to return. The default value as well as the maximum is `1000`. | - **desc** | **bool** | If `true` or `1` then the objects are sorted by the `startedAt` field in descending order. By default, they are sorted in ascending order. | - **status** | **[]string** | Single status or comma-separated list of statuses, see ([available statuses](https://docs.apify.com/platform/actors/running/runs-and-builds#lifecycle)). Used to filter runs by the specified statuses only. | - **startedAfter** | **time.Time** | Filter runs that started after the specified date and time (inclusive). The value must be a valid ISO 8601 datetime string (UTC). | - **startedBefore** | **time.Time** | Filter runs that started before the specified date and time (inclusive). The value must be a valid ISO 8601 datetime string (UTC). | - -### Return type - -[**ListOfRunsResponse**](ListOfRunsResponse.md) - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## PostChargeRun - -> map[string]interface{} PostChargeRun(ctx, runId).ChargeRunRequest(chargeRunRequest).IdempotencyKey(idempotencyKey).Execute() - -Charge events in run - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - runId := "3KH8gEpp4d8uQSe8T" // string | Actor run ID. - chargeRunRequest := *openapiclient.NewChargeRunRequest("EventName_example", int32(123)) // ChargeRunRequest | Define which event, and how many times, you want to charge for. - idempotencyKey := "2024-12-09T01:23:45.000Z-random-uuid" // string | Always pass a unique idempotency key (any unique string) for each charge to avoid double charging in case of retries or network errors. (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.ActorRunsAPI.PostChargeRun(context.Background(), runId).ChargeRunRequest(chargeRunRequest).IdempotencyKey(idempotencyKey).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `ActorRunsAPI.PostChargeRun``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `PostChargeRun`: map[string]interface{} - fmt.Fprintf(os.Stdout, "Response from `ActorRunsAPI.PostChargeRun`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**runId** | **string** | Actor run ID. | - -### Other Parameters - -Other parameters are passed through a pointer to a apiPostChargeRunRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - **chargeRunRequest** | [**ChargeRunRequest**](ChargeRunRequest.md) | Define which event, and how many times, you want to charge for. | - **idempotencyKey** | **string** | Always pass a unique idempotency key (any unique string) for each charge to avoid double charging in case of retries or network errors. | - -### Return type - -**map[string]interface{}** - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## PostResurrectRun - -> RunResponse PostResurrectRun(ctx, runId).Build(build).Timeout(timeout).Memory(memory).MaxItems(maxItems).MaxTotalChargeUsd(maxTotalChargeUsd).RestartOnError(restartOnError).Execute() - -Resurrect run - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - runId := "3KH8gEpp4d8uQSe8T" // string | Actor run ID. - build := "0.1.234" // string | Specifies the Actor build to run. It can be either a build tag or build number. By default, the run is resurrected with the same build it originally used. Specifically, if a run was first started with the `latest` tag, which resolves to version `0.0.3` at the time, a run resurrected without this parameter will continue running with `0.0.3`, even if `latest` already points to a newer build. (optional) - timeout := float64(60) // float64 | Optional timeout for the run, in seconds. By default, the run uses the timeout specified in the run that is being resurrected. (optional) - memory := float64(256) // float64 | Memory limit for the run, in megabytes. The amount of memory can be set to a power of 2 with a minimum of 128. By default, the run uses the memory limit specified in the run that is being resurrected. (optional) - maxItems := float64(1000) // float64 | Specifies the maximum number of dataset items that will be charged for pay-per-result Actors. This does NOT guarantee that the Actor will return only this many items. It only ensures you won't be charged for more than this number of items. Only works for pay-per-result Actors. Value can be accessed in the actor run using `ACTOR_MAX_PAID_DATASET_ITEMS` environment variable. (optional) - maxTotalChargeUsd := float64(5) // float64 | Specifies the maximum cost of the run. This parameter is useful for pay-per-event Actors, as it allows you to limit the amount charged to your subscription. You can access the maximum cost in your Actor by using the `ACTOR_MAX_TOTAL_CHARGE_USD` environment variable. (optional) - restartOnError := false // bool | Determines whether the resurrected run will be restarted if it fails. By default, the resurrected run uses the same setting as before. (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.ActorRunsAPI.PostResurrectRun(context.Background(), runId).Build(build).Timeout(timeout).Memory(memory).MaxItems(maxItems).MaxTotalChargeUsd(maxTotalChargeUsd).RestartOnError(restartOnError).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `ActorRunsAPI.PostResurrectRun``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `PostResurrectRun`: RunResponse - fmt.Fprintf(os.Stdout, "Response from `ActorRunsAPI.PostResurrectRun`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**runId** | **string** | Actor run ID. | - -### Other Parameters - -Other parameters are passed through a pointer to a apiPostResurrectRunRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - **build** | **string** | Specifies the Actor build to run. It can be either a build tag or build number. By default, the run is resurrected with the same build it originally used. Specifically, if a run was first started with the `latest` tag, which resolves to version `0.0.3` at the time, a run resurrected without this parameter will continue running with `0.0.3`, even if `latest` already points to a newer build. | - **timeout** | **float64** | Optional timeout for the run, in seconds. By default, the run uses the timeout specified in the run that is being resurrected. | - **memory** | **float64** | Memory limit for the run, in megabytes. The amount of memory can be set to a power of 2 with a minimum of 128. By default, the run uses the memory limit specified in the run that is being resurrected. | - **maxItems** | **float64** | Specifies the maximum number of dataset items that will be charged for pay-per-result Actors. This does NOT guarantee that the Actor will return only this many items. It only ensures you won't be charged for more than this number of items. Only works for pay-per-result Actors. Value can be accessed in the actor run using `ACTOR_MAX_PAID_DATASET_ITEMS` environment variable. | - **maxTotalChargeUsd** | **float64** | Specifies the maximum cost of the run. This parameter is useful for pay-per-event Actors, as it allows you to limit the amount charged to your subscription. You can access the maximum cost in your Actor by using the `ACTOR_MAX_TOTAL_CHARGE_USD` environment variable. | - **restartOnError** | **bool** | Determines whether the resurrected run will be restarted if it fails. By default, the resurrected run uses the same setting as before. | - -### Return type - -[**RunResponse**](RunResponse.md) - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - diff --git a/docs/ActorShort.md b/docs/ActorShort.md deleted file mode 100644 index 700d4bb..0000000 --- a/docs/ActorShort.md +++ /dev/null @@ -1,197 +0,0 @@ -# ActorShort - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Id** | **string** | | -**CreatedAt** | **time.Time** | | -**ModifiedAt** | **time.Time** | | -**Name** | **string** | | -**Username** | **string** | | -**Title** | Pointer to **string** | | [optional] -**Stats** | Pointer to [**NullableActorStats**](ActorStats.md) | | [optional] - -## Methods - -### NewActorShort - -`func NewActorShort(id string, createdAt time.Time, modifiedAt time.Time, name string, username string, ) *ActorShort` - -NewActorShort instantiates a new ActorShort object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewActorShortWithDefaults - -`func NewActorShortWithDefaults() *ActorShort` - -NewActorShortWithDefaults instantiates a new ActorShort object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetId - -`func (o *ActorShort) GetId() string` - -GetId returns the Id field if non-nil, zero value otherwise. - -### GetIdOk - -`func (o *ActorShort) GetIdOk() (*string, bool)` - -GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetId - -`func (o *ActorShort) SetId(v string)` - -SetId sets Id field to given value. - - -### GetCreatedAt - -`func (o *ActorShort) GetCreatedAt() time.Time` - -GetCreatedAt returns the CreatedAt field if non-nil, zero value otherwise. - -### GetCreatedAtOk - -`func (o *ActorShort) GetCreatedAtOk() (*time.Time, bool)` - -GetCreatedAtOk returns a tuple with the CreatedAt field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetCreatedAt - -`func (o *ActorShort) SetCreatedAt(v time.Time)` - -SetCreatedAt sets CreatedAt field to given value. - - -### GetModifiedAt - -`func (o *ActorShort) GetModifiedAt() time.Time` - -GetModifiedAt returns the ModifiedAt field if non-nil, zero value otherwise. - -### GetModifiedAtOk - -`func (o *ActorShort) GetModifiedAtOk() (*time.Time, bool)` - -GetModifiedAtOk returns a tuple with the ModifiedAt field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetModifiedAt - -`func (o *ActorShort) SetModifiedAt(v time.Time)` - -SetModifiedAt sets ModifiedAt field to given value. - - -### GetName - -`func (o *ActorShort) GetName() string` - -GetName returns the Name field if non-nil, zero value otherwise. - -### GetNameOk - -`func (o *ActorShort) GetNameOk() (*string, bool)` - -GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetName - -`func (o *ActorShort) SetName(v string)` - -SetName sets Name field to given value. - - -### GetUsername - -`func (o *ActorShort) GetUsername() string` - -GetUsername returns the Username field if non-nil, zero value otherwise. - -### GetUsernameOk - -`func (o *ActorShort) GetUsernameOk() (*string, bool)` - -GetUsernameOk returns a tuple with the Username field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetUsername - -`func (o *ActorShort) SetUsername(v string)` - -SetUsername sets Username field to given value. - - -### GetTitle - -`func (o *ActorShort) GetTitle() string` - -GetTitle returns the Title field if non-nil, zero value otherwise. - -### GetTitleOk - -`func (o *ActorShort) GetTitleOk() (*string, bool)` - -GetTitleOk returns a tuple with the Title field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetTitle - -`func (o *ActorShort) SetTitle(v string)` - -SetTitle sets Title field to given value. - -### HasTitle - -`func (o *ActorShort) HasTitle() bool` - -HasTitle returns a boolean if a field has been set. - -### GetStats - -`func (o *ActorShort) GetStats() ActorStats` - -GetStats returns the Stats field if non-nil, zero value otherwise. - -### GetStatsOk - -`func (o *ActorShort) GetStatsOk() (*ActorStats, bool)` - -GetStatsOk returns a tuple with the Stats field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetStats - -`func (o *ActorShort) SetStats(v ActorStats)` - -SetStats sets Stats field to given value. - -### HasStats - -`func (o *ActorShort) HasStats() bool` - -HasStats returns a boolean if a field has been set. - -### SetStatsNil - -`func (o *ActorShort) SetStatsNil(b bool)` - - SetStatsNil sets the value for Stats to be an explicit nil - -### UnsetStats -`func (o *ActorShort) UnsetStats()` - -UnsetStats ensures that no value is present for Stats, not even an explicit nil - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/ActorStandby.md b/docs/ActorStandby.md deleted file mode 100644 index 6874406..0000000 --- a/docs/ActorStandby.md +++ /dev/null @@ -1,318 +0,0 @@ -# ActorStandby - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**IsEnabled** | Pointer to **NullableBool** | | [optional] -**DesiredRequestsPerActorRun** | Pointer to **NullableInt32** | | [optional] -**MaxRequestsPerActorRun** | Pointer to **NullableInt32** | | [optional] -**IdleTimeoutSecs** | Pointer to **NullableInt32** | | [optional] -**Build** | Pointer to **NullableString** | | [optional] -**MemoryMbytes** | Pointer to **NullableInt32** | | [optional] -**DisableStandbyFieldsOverride** | Pointer to **NullableBool** | | [optional] -**ShouldPassActorInput** | Pointer to **NullableBool** | | [optional] - -## Methods - -### NewActorStandby - -`func NewActorStandby() *ActorStandby` - -NewActorStandby instantiates a new ActorStandby object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewActorStandbyWithDefaults - -`func NewActorStandbyWithDefaults() *ActorStandby` - -NewActorStandbyWithDefaults instantiates a new ActorStandby object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetIsEnabled - -`func (o *ActorStandby) GetIsEnabled() bool` - -GetIsEnabled returns the IsEnabled field if non-nil, zero value otherwise. - -### GetIsEnabledOk - -`func (o *ActorStandby) GetIsEnabledOk() (*bool, bool)` - -GetIsEnabledOk returns a tuple with the IsEnabled field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetIsEnabled - -`func (o *ActorStandby) SetIsEnabled(v bool)` - -SetIsEnabled sets IsEnabled field to given value. - -### HasIsEnabled - -`func (o *ActorStandby) HasIsEnabled() bool` - -HasIsEnabled returns a boolean if a field has been set. - -### SetIsEnabledNil - -`func (o *ActorStandby) SetIsEnabledNil(b bool)` - - SetIsEnabledNil sets the value for IsEnabled to be an explicit nil - -### UnsetIsEnabled -`func (o *ActorStandby) UnsetIsEnabled()` - -UnsetIsEnabled ensures that no value is present for IsEnabled, not even an explicit nil -### GetDesiredRequestsPerActorRun - -`func (o *ActorStandby) GetDesiredRequestsPerActorRun() int32` - -GetDesiredRequestsPerActorRun returns the DesiredRequestsPerActorRun field if non-nil, zero value otherwise. - -### GetDesiredRequestsPerActorRunOk - -`func (o *ActorStandby) GetDesiredRequestsPerActorRunOk() (*int32, bool)` - -GetDesiredRequestsPerActorRunOk returns a tuple with the DesiredRequestsPerActorRun field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetDesiredRequestsPerActorRun - -`func (o *ActorStandby) SetDesiredRequestsPerActorRun(v int32)` - -SetDesiredRequestsPerActorRun sets DesiredRequestsPerActorRun field to given value. - -### HasDesiredRequestsPerActorRun - -`func (o *ActorStandby) HasDesiredRequestsPerActorRun() bool` - -HasDesiredRequestsPerActorRun returns a boolean if a field has been set. - -### SetDesiredRequestsPerActorRunNil - -`func (o *ActorStandby) SetDesiredRequestsPerActorRunNil(b bool)` - - SetDesiredRequestsPerActorRunNil sets the value for DesiredRequestsPerActorRun to be an explicit nil - -### UnsetDesiredRequestsPerActorRun -`func (o *ActorStandby) UnsetDesiredRequestsPerActorRun()` - -UnsetDesiredRequestsPerActorRun ensures that no value is present for DesiredRequestsPerActorRun, not even an explicit nil -### GetMaxRequestsPerActorRun - -`func (o *ActorStandby) GetMaxRequestsPerActorRun() int32` - -GetMaxRequestsPerActorRun returns the MaxRequestsPerActorRun field if non-nil, zero value otherwise. - -### GetMaxRequestsPerActorRunOk - -`func (o *ActorStandby) GetMaxRequestsPerActorRunOk() (*int32, bool)` - -GetMaxRequestsPerActorRunOk returns a tuple with the MaxRequestsPerActorRun field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetMaxRequestsPerActorRun - -`func (o *ActorStandby) SetMaxRequestsPerActorRun(v int32)` - -SetMaxRequestsPerActorRun sets MaxRequestsPerActorRun field to given value. - -### HasMaxRequestsPerActorRun - -`func (o *ActorStandby) HasMaxRequestsPerActorRun() bool` - -HasMaxRequestsPerActorRun returns a boolean if a field has been set. - -### SetMaxRequestsPerActorRunNil - -`func (o *ActorStandby) SetMaxRequestsPerActorRunNil(b bool)` - - SetMaxRequestsPerActorRunNil sets the value for MaxRequestsPerActorRun to be an explicit nil - -### UnsetMaxRequestsPerActorRun -`func (o *ActorStandby) UnsetMaxRequestsPerActorRun()` - -UnsetMaxRequestsPerActorRun ensures that no value is present for MaxRequestsPerActorRun, not even an explicit nil -### GetIdleTimeoutSecs - -`func (o *ActorStandby) GetIdleTimeoutSecs() int32` - -GetIdleTimeoutSecs returns the IdleTimeoutSecs field if non-nil, zero value otherwise. - -### GetIdleTimeoutSecsOk - -`func (o *ActorStandby) GetIdleTimeoutSecsOk() (*int32, bool)` - -GetIdleTimeoutSecsOk returns a tuple with the IdleTimeoutSecs field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetIdleTimeoutSecs - -`func (o *ActorStandby) SetIdleTimeoutSecs(v int32)` - -SetIdleTimeoutSecs sets IdleTimeoutSecs field to given value. - -### HasIdleTimeoutSecs - -`func (o *ActorStandby) HasIdleTimeoutSecs() bool` - -HasIdleTimeoutSecs returns a boolean if a field has been set. - -### SetIdleTimeoutSecsNil - -`func (o *ActorStandby) SetIdleTimeoutSecsNil(b bool)` - - SetIdleTimeoutSecsNil sets the value for IdleTimeoutSecs to be an explicit nil - -### UnsetIdleTimeoutSecs -`func (o *ActorStandby) UnsetIdleTimeoutSecs()` - -UnsetIdleTimeoutSecs ensures that no value is present for IdleTimeoutSecs, not even an explicit nil -### GetBuild - -`func (o *ActorStandby) GetBuild() string` - -GetBuild returns the Build field if non-nil, zero value otherwise. - -### GetBuildOk - -`func (o *ActorStandby) GetBuildOk() (*string, bool)` - -GetBuildOk returns a tuple with the Build field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetBuild - -`func (o *ActorStandby) SetBuild(v string)` - -SetBuild sets Build field to given value. - -### HasBuild - -`func (o *ActorStandby) HasBuild() bool` - -HasBuild returns a boolean if a field has been set. - -### SetBuildNil - -`func (o *ActorStandby) SetBuildNil(b bool)` - - SetBuildNil sets the value for Build to be an explicit nil - -### UnsetBuild -`func (o *ActorStandby) UnsetBuild()` - -UnsetBuild ensures that no value is present for Build, not even an explicit nil -### GetMemoryMbytes - -`func (o *ActorStandby) GetMemoryMbytes() int32` - -GetMemoryMbytes returns the MemoryMbytes field if non-nil, zero value otherwise. - -### GetMemoryMbytesOk - -`func (o *ActorStandby) GetMemoryMbytesOk() (*int32, bool)` - -GetMemoryMbytesOk returns a tuple with the MemoryMbytes field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetMemoryMbytes - -`func (o *ActorStandby) SetMemoryMbytes(v int32)` - -SetMemoryMbytes sets MemoryMbytes field to given value. - -### HasMemoryMbytes - -`func (o *ActorStandby) HasMemoryMbytes() bool` - -HasMemoryMbytes returns a boolean if a field has been set. - -### SetMemoryMbytesNil - -`func (o *ActorStandby) SetMemoryMbytesNil(b bool)` - - SetMemoryMbytesNil sets the value for MemoryMbytes to be an explicit nil - -### UnsetMemoryMbytes -`func (o *ActorStandby) UnsetMemoryMbytes()` - -UnsetMemoryMbytes ensures that no value is present for MemoryMbytes, not even an explicit nil -### GetDisableStandbyFieldsOverride - -`func (o *ActorStandby) GetDisableStandbyFieldsOverride() bool` - -GetDisableStandbyFieldsOverride returns the DisableStandbyFieldsOverride field if non-nil, zero value otherwise. - -### GetDisableStandbyFieldsOverrideOk - -`func (o *ActorStandby) GetDisableStandbyFieldsOverrideOk() (*bool, bool)` - -GetDisableStandbyFieldsOverrideOk returns a tuple with the DisableStandbyFieldsOverride field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetDisableStandbyFieldsOverride - -`func (o *ActorStandby) SetDisableStandbyFieldsOverride(v bool)` - -SetDisableStandbyFieldsOverride sets DisableStandbyFieldsOverride field to given value. - -### HasDisableStandbyFieldsOverride - -`func (o *ActorStandby) HasDisableStandbyFieldsOverride() bool` - -HasDisableStandbyFieldsOverride returns a boolean if a field has been set. - -### SetDisableStandbyFieldsOverrideNil - -`func (o *ActorStandby) SetDisableStandbyFieldsOverrideNil(b bool)` - - SetDisableStandbyFieldsOverrideNil sets the value for DisableStandbyFieldsOverride to be an explicit nil - -### UnsetDisableStandbyFieldsOverride -`func (o *ActorStandby) UnsetDisableStandbyFieldsOverride()` - -UnsetDisableStandbyFieldsOverride ensures that no value is present for DisableStandbyFieldsOverride, not even an explicit nil -### GetShouldPassActorInput - -`func (o *ActorStandby) GetShouldPassActorInput() bool` - -GetShouldPassActorInput returns the ShouldPassActorInput field if non-nil, zero value otherwise. - -### GetShouldPassActorInputOk - -`func (o *ActorStandby) GetShouldPassActorInputOk() (*bool, bool)` - -GetShouldPassActorInputOk returns a tuple with the ShouldPassActorInput field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetShouldPassActorInput - -`func (o *ActorStandby) SetShouldPassActorInput(v bool)` - -SetShouldPassActorInput sets ShouldPassActorInput field to given value. - -### HasShouldPassActorInput - -`func (o *ActorStandby) HasShouldPassActorInput() bool` - -HasShouldPassActorInput returns a boolean if a field has been set. - -### SetShouldPassActorInputNil - -`func (o *ActorStandby) SetShouldPassActorInputNil(b bool)` - - SetShouldPassActorInputNil sets the value for ShouldPassActorInput to be an explicit nil - -### UnsetShouldPassActorInput -`func (o *ActorStandby) UnsetShouldPassActorInput()` - -UnsetShouldPassActorInput ensures that no value is present for ShouldPassActorInput, not even an explicit nil - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/ActorStats.md b/docs/ActorStats.md deleted file mode 100644 index 27493a6..0000000 --- a/docs/ActorStats.md +++ /dev/null @@ -1,342 +0,0 @@ -# ActorStats - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**TotalBuilds** | Pointer to **int32** | | [optional] -**TotalRuns** | Pointer to **int32** | | [optional] -**TotalUsers** | Pointer to **int32** | | [optional] -**TotalUsers7Days** | Pointer to **int32** | | [optional] -**TotalUsers30Days** | Pointer to **int32** | | [optional] -**TotalUsers90Days** | Pointer to **int32** | | [optional] -**TotalMetamorphs** | Pointer to **int32** | | [optional] -**LastRunStartedAt** | Pointer to **time.Time** | | [optional] -**ActorReviewCount** | Pointer to **int32** | | [optional] -**ActorReviewRating** | Pointer to **float32** | | [optional] -**BookmarkCount** | Pointer to **int32** | | [optional] -**PublicActorRunStats30Days** | Pointer to [**ActorStatsPublicActorRunStats30Days**](ActorStatsPublicActorRunStats30Days.md) | | [optional] - -## Methods - -### NewActorStats - -`func NewActorStats() *ActorStats` - -NewActorStats instantiates a new ActorStats object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewActorStatsWithDefaults - -`func NewActorStatsWithDefaults() *ActorStats` - -NewActorStatsWithDefaults instantiates a new ActorStats object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetTotalBuilds - -`func (o *ActorStats) GetTotalBuilds() int32` - -GetTotalBuilds returns the TotalBuilds field if non-nil, zero value otherwise. - -### GetTotalBuildsOk - -`func (o *ActorStats) GetTotalBuildsOk() (*int32, bool)` - -GetTotalBuildsOk returns a tuple with the TotalBuilds field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetTotalBuilds - -`func (o *ActorStats) SetTotalBuilds(v int32)` - -SetTotalBuilds sets TotalBuilds field to given value. - -### HasTotalBuilds - -`func (o *ActorStats) HasTotalBuilds() bool` - -HasTotalBuilds returns a boolean if a field has been set. - -### GetTotalRuns - -`func (o *ActorStats) GetTotalRuns() int32` - -GetTotalRuns returns the TotalRuns field if non-nil, zero value otherwise. - -### GetTotalRunsOk - -`func (o *ActorStats) GetTotalRunsOk() (*int32, bool)` - -GetTotalRunsOk returns a tuple with the TotalRuns field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetTotalRuns - -`func (o *ActorStats) SetTotalRuns(v int32)` - -SetTotalRuns sets TotalRuns field to given value. - -### HasTotalRuns - -`func (o *ActorStats) HasTotalRuns() bool` - -HasTotalRuns returns a boolean if a field has been set. - -### GetTotalUsers - -`func (o *ActorStats) GetTotalUsers() int32` - -GetTotalUsers returns the TotalUsers field if non-nil, zero value otherwise. - -### GetTotalUsersOk - -`func (o *ActorStats) GetTotalUsersOk() (*int32, bool)` - -GetTotalUsersOk returns a tuple with the TotalUsers field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetTotalUsers - -`func (o *ActorStats) SetTotalUsers(v int32)` - -SetTotalUsers sets TotalUsers field to given value. - -### HasTotalUsers - -`func (o *ActorStats) HasTotalUsers() bool` - -HasTotalUsers returns a boolean if a field has been set. - -### GetTotalUsers7Days - -`func (o *ActorStats) GetTotalUsers7Days() int32` - -GetTotalUsers7Days returns the TotalUsers7Days field if non-nil, zero value otherwise. - -### GetTotalUsers7DaysOk - -`func (o *ActorStats) GetTotalUsers7DaysOk() (*int32, bool)` - -GetTotalUsers7DaysOk returns a tuple with the TotalUsers7Days field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetTotalUsers7Days - -`func (o *ActorStats) SetTotalUsers7Days(v int32)` - -SetTotalUsers7Days sets TotalUsers7Days field to given value. - -### HasTotalUsers7Days - -`func (o *ActorStats) HasTotalUsers7Days() bool` - -HasTotalUsers7Days returns a boolean if a field has been set. - -### GetTotalUsers30Days - -`func (o *ActorStats) GetTotalUsers30Days() int32` - -GetTotalUsers30Days returns the TotalUsers30Days field if non-nil, zero value otherwise. - -### GetTotalUsers30DaysOk - -`func (o *ActorStats) GetTotalUsers30DaysOk() (*int32, bool)` - -GetTotalUsers30DaysOk returns a tuple with the TotalUsers30Days field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetTotalUsers30Days - -`func (o *ActorStats) SetTotalUsers30Days(v int32)` - -SetTotalUsers30Days sets TotalUsers30Days field to given value. - -### HasTotalUsers30Days - -`func (o *ActorStats) HasTotalUsers30Days() bool` - -HasTotalUsers30Days returns a boolean if a field has been set. - -### GetTotalUsers90Days - -`func (o *ActorStats) GetTotalUsers90Days() int32` - -GetTotalUsers90Days returns the TotalUsers90Days field if non-nil, zero value otherwise. - -### GetTotalUsers90DaysOk - -`func (o *ActorStats) GetTotalUsers90DaysOk() (*int32, bool)` - -GetTotalUsers90DaysOk returns a tuple with the TotalUsers90Days field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetTotalUsers90Days - -`func (o *ActorStats) SetTotalUsers90Days(v int32)` - -SetTotalUsers90Days sets TotalUsers90Days field to given value. - -### HasTotalUsers90Days - -`func (o *ActorStats) HasTotalUsers90Days() bool` - -HasTotalUsers90Days returns a boolean if a field has been set. - -### GetTotalMetamorphs - -`func (o *ActorStats) GetTotalMetamorphs() int32` - -GetTotalMetamorphs returns the TotalMetamorphs field if non-nil, zero value otherwise. - -### GetTotalMetamorphsOk - -`func (o *ActorStats) GetTotalMetamorphsOk() (*int32, bool)` - -GetTotalMetamorphsOk returns a tuple with the TotalMetamorphs field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetTotalMetamorphs - -`func (o *ActorStats) SetTotalMetamorphs(v int32)` - -SetTotalMetamorphs sets TotalMetamorphs field to given value. - -### HasTotalMetamorphs - -`func (o *ActorStats) HasTotalMetamorphs() bool` - -HasTotalMetamorphs returns a boolean if a field has been set. - -### GetLastRunStartedAt - -`func (o *ActorStats) GetLastRunStartedAt() time.Time` - -GetLastRunStartedAt returns the LastRunStartedAt field if non-nil, zero value otherwise. - -### GetLastRunStartedAtOk - -`func (o *ActorStats) GetLastRunStartedAtOk() (*time.Time, bool)` - -GetLastRunStartedAtOk returns a tuple with the LastRunStartedAt field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetLastRunStartedAt - -`func (o *ActorStats) SetLastRunStartedAt(v time.Time)` - -SetLastRunStartedAt sets LastRunStartedAt field to given value. - -### HasLastRunStartedAt - -`func (o *ActorStats) HasLastRunStartedAt() bool` - -HasLastRunStartedAt returns a boolean if a field has been set. - -### GetActorReviewCount - -`func (o *ActorStats) GetActorReviewCount() int32` - -GetActorReviewCount returns the ActorReviewCount field if non-nil, zero value otherwise. - -### GetActorReviewCountOk - -`func (o *ActorStats) GetActorReviewCountOk() (*int32, bool)` - -GetActorReviewCountOk returns a tuple with the ActorReviewCount field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetActorReviewCount - -`func (o *ActorStats) SetActorReviewCount(v int32)` - -SetActorReviewCount sets ActorReviewCount field to given value. - -### HasActorReviewCount - -`func (o *ActorStats) HasActorReviewCount() bool` - -HasActorReviewCount returns a boolean if a field has been set. - -### GetActorReviewRating - -`func (o *ActorStats) GetActorReviewRating() float32` - -GetActorReviewRating returns the ActorReviewRating field if non-nil, zero value otherwise. - -### GetActorReviewRatingOk - -`func (o *ActorStats) GetActorReviewRatingOk() (*float32, bool)` - -GetActorReviewRatingOk returns a tuple with the ActorReviewRating field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetActorReviewRating - -`func (o *ActorStats) SetActorReviewRating(v float32)` - -SetActorReviewRating sets ActorReviewRating field to given value. - -### HasActorReviewRating - -`func (o *ActorStats) HasActorReviewRating() bool` - -HasActorReviewRating returns a boolean if a field has been set. - -### GetBookmarkCount - -`func (o *ActorStats) GetBookmarkCount() int32` - -GetBookmarkCount returns the BookmarkCount field if non-nil, zero value otherwise. - -### GetBookmarkCountOk - -`func (o *ActorStats) GetBookmarkCountOk() (*int32, bool)` - -GetBookmarkCountOk returns a tuple with the BookmarkCount field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetBookmarkCount - -`func (o *ActorStats) SetBookmarkCount(v int32)` - -SetBookmarkCount sets BookmarkCount field to given value. - -### HasBookmarkCount - -`func (o *ActorStats) HasBookmarkCount() bool` - -HasBookmarkCount returns a boolean if a field has been set. - -### GetPublicActorRunStats30Days - -`func (o *ActorStats) GetPublicActorRunStats30Days() ActorStatsPublicActorRunStats30Days` - -GetPublicActorRunStats30Days returns the PublicActorRunStats30Days field if non-nil, zero value otherwise. - -### GetPublicActorRunStats30DaysOk - -`func (o *ActorStats) GetPublicActorRunStats30DaysOk() (*ActorStatsPublicActorRunStats30Days, bool)` - -GetPublicActorRunStats30DaysOk returns a tuple with the PublicActorRunStats30Days field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetPublicActorRunStats30Days - -`func (o *ActorStats) SetPublicActorRunStats30Days(v ActorStatsPublicActorRunStats30Days)` - -SetPublicActorRunStats30Days sets PublicActorRunStats30Days field to given value. - -### HasPublicActorRunStats30Days - -`func (o *ActorStats) HasPublicActorRunStats30Days() bool` - -HasPublicActorRunStats30Days returns a boolean if a field has been set. - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/ActorStatsPublicActorRunStats30Days.md b/docs/ActorStatsPublicActorRunStats30Days.md deleted file mode 100644 index f18d079..0000000 --- a/docs/ActorStatsPublicActorRunStats30Days.md +++ /dev/null @@ -1,160 +0,0 @@ -# ActorStatsPublicActorRunStats30Days - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**ABORTED** | Pointer to **int32** | | [optional] -**FAILED** | Pointer to **int32** | | [optional] -**SUCCEEDED** | Pointer to **int32** | | [optional] -**TIMED_OUT** | Pointer to **int32** | | [optional] -**TOTAL** | Pointer to **int32** | | [optional] - -## Methods - -### NewActorStatsPublicActorRunStats30Days - -`func NewActorStatsPublicActorRunStats30Days() *ActorStatsPublicActorRunStats30Days` - -NewActorStatsPublicActorRunStats30Days instantiates a new ActorStatsPublicActorRunStats30Days object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewActorStatsPublicActorRunStats30DaysWithDefaults - -`func NewActorStatsPublicActorRunStats30DaysWithDefaults() *ActorStatsPublicActorRunStats30Days` - -NewActorStatsPublicActorRunStats30DaysWithDefaults instantiates a new ActorStatsPublicActorRunStats30Days object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetABORTED - -`func (o *ActorStatsPublicActorRunStats30Days) GetABORTED() int32` - -GetABORTED returns the ABORTED field if non-nil, zero value otherwise. - -### GetABORTEDOk - -`func (o *ActorStatsPublicActorRunStats30Days) GetABORTEDOk() (*int32, bool)` - -GetABORTEDOk returns a tuple with the ABORTED field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetABORTED - -`func (o *ActorStatsPublicActorRunStats30Days) SetABORTED(v int32)` - -SetABORTED sets ABORTED field to given value. - -### HasABORTED - -`func (o *ActorStatsPublicActorRunStats30Days) HasABORTED() bool` - -HasABORTED returns a boolean if a field has been set. - -### GetFAILED - -`func (o *ActorStatsPublicActorRunStats30Days) GetFAILED() int32` - -GetFAILED returns the FAILED field if non-nil, zero value otherwise. - -### GetFAILEDOk - -`func (o *ActorStatsPublicActorRunStats30Days) GetFAILEDOk() (*int32, bool)` - -GetFAILEDOk returns a tuple with the FAILED field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetFAILED - -`func (o *ActorStatsPublicActorRunStats30Days) SetFAILED(v int32)` - -SetFAILED sets FAILED field to given value. - -### HasFAILED - -`func (o *ActorStatsPublicActorRunStats30Days) HasFAILED() bool` - -HasFAILED returns a boolean if a field has been set. - -### GetSUCCEEDED - -`func (o *ActorStatsPublicActorRunStats30Days) GetSUCCEEDED() int32` - -GetSUCCEEDED returns the SUCCEEDED field if non-nil, zero value otherwise. - -### GetSUCCEEDEDOk - -`func (o *ActorStatsPublicActorRunStats30Days) GetSUCCEEDEDOk() (*int32, bool)` - -GetSUCCEEDEDOk returns a tuple with the SUCCEEDED field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetSUCCEEDED - -`func (o *ActorStatsPublicActorRunStats30Days) SetSUCCEEDED(v int32)` - -SetSUCCEEDED sets SUCCEEDED field to given value. - -### HasSUCCEEDED - -`func (o *ActorStatsPublicActorRunStats30Days) HasSUCCEEDED() bool` - -HasSUCCEEDED returns a boolean if a field has been set. - -### GetTIMED_OUT - -`func (o *ActorStatsPublicActorRunStats30Days) GetTIMED_OUT() int32` - -GetTIMED_OUT returns the TIMED_OUT field if non-nil, zero value otherwise. - -### GetTIMED_OUTOk - -`func (o *ActorStatsPublicActorRunStats30Days) GetTIMED_OUTOk() (*int32, bool)` - -GetTIMED_OUTOk returns a tuple with the TIMED_OUT field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetTIMED_OUT - -`func (o *ActorStatsPublicActorRunStats30Days) SetTIMED_OUT(v int32)` - -SetTIMED_OUT sets TIMED_OUT field to given value. - -### HasTIMED_OUT - -`func (o *ActorStatsPublicActorRunStats30Days) HasTIMED_OUT() bool` - -HasTIMED_OUT returns a boolean if a field has been set. - -### GetTOTAL - -`func (o *ActorStatsPublicActorRunStats30Days) GetTOTAL() int32` - -GetTOTAL returns the TOTAL field if non-nil, zero value otherwise. - -### GetTOTALOk - -`func (o *ActorStatsPublicActorRunStats30Days) GetTOTALOk() (*int32, bool)` - -GetTOTALOk returns a tuple with the TOTAL field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetTOTAL - -`func (o *ActorStatsPublicActorRunStats30Days) SetTOTAL(v int32)` - -SetTOTAL sets TOTAL field to given value. - -### HasTOTAL - -`func (o *ActorStatsPublicActorRunStats30Days) HasTOTAL() bool` - -HasTOTAL returns a boolean if a field has been set. - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/ActorTaskGet200Response.md b/docs/ActorTaskGet200Response.md deleted file mode 100644 index a059f12..0000000 --- a/docs/ActorTaskGet200Response.md +++ /dev/null @@ -1,51 +0,0 @@ -# ActorTaskGet200Response - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Data** | [**Task**](Task.md) | | - -## Methods - -### NewActorTaskGet200Response - -`func NewActorTaskGet200Response(data Task, ) *ActorTaskGet200Response` - -NewActorTaskGet200Response instantiates a new ActorTaskGet200Response object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewActorTaskGet200ResponseWithDefaults - -`func NewActorTaskGet200ResponseWithDefaults() *ActorTaskGet200Response` - -NewActorTaskGet200ResponseWithDefaults instantiates a new ActorTaskGet200Response object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetData - -`func (o *ActorTaskGet200Response) GetData() Task` - -GetData returns the Data field if non-nil, zero value otherwise. - -### GetDataOk - -`func (o *ActorTaskGet200Response) GetDataOk() (*Task, bool)` - -GetDataOk returns a tuple with the Data field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetData - -`func (o *ActorTaskGet200Response) SetData(v Task)` - -SetData sets Data field to given value. - - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/ActorTaskRunsGet200Response.md b/docs/ActorTaskRunsGet200Response.md deleted file mode 100644 index 4ec813c..0000000 --- a/docs/ActorTaskRunsGet200Response.md +++ /dev/null @@ -1,51 +0,0 @@ -# ActorTaskRunsGet200Response - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Data** | [**ActorTaskRunsGet200ResponseData**](ActorTaskRunsGet200ResponseData.md) | | - -## Methods - -### NewActorTaskRunsGet200Response - -`func NewActorTaskRunsGet200Response(data ActorTaskRunsGet200ResponseData, ) *ActorTaskRunsGet200Response` - -NewActorTaskRunsGet200Response instantiates a new ActorTaskRunsGet200Response object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewActorTaskRunsGet200ResponseWithDefaults - -`func NewActorTaskRunsGet200ResponseWithDefaults() *ActorTaskRunsGet200Response` - -NewActorTaskRunsGet200ResponseWithDefaults instantiates a new ActorTaskRunsGet200Response object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetData - -`func (o *ActorTaskRunsGet200Response) GetData() ActorTaskRunsGet200ResponseData` - -GetData returns the Data field if non-nil, zero value otherwise. - -### GetDataOk - -`func (o *ActorTaskRunsGet200Response) GetDataOk() (*ActorTaskRunsGet200ResponseData, bool)` - -GetDataOk returns a tuple with the Data field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetData - -`func (o *ActorTaskRunsGet200Response) SetData(v ActorTaskRunsGet200ResponseData)` - -SetData sets Data field to given value. - - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/ActorTaskRunsGet200ResponseData.md b/docs/ActorTaskRunsGet200ResponseData.md deleted file mode 100644 index 996ee85..0000000 --- a/docs/ActorTaskRunsGet200ResponseData.md +++ /dev/null @@ -1,156 +0,0 @@ -# ActorTaskRunsGet200ResponseData - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Total** | **int32** | The total number of items available across all pages. | -**Offset** | **int32** | The starting position for this page of results. | -**Limit** | **int32** | The maximum number of items returned per page. | -**Desc** | **bool** | Whether the results are sorted in descending order. | -**Count** | **int32** | The number of items returned in this response. | -**Items** | [**[]RunShort**](RunShort.md) | | - -## Methods - -### NewActorTaskRunsGet200ResponseData - -`func NewActorTaskRunsGet200ResponseData(total int32, offset int32, limit int32, desc bool, count int32, items []RunShort, ) *ActorTaskRunsGet200ResponseData` - -NewActorTaskRunsGet200ResponseData instantiates a new ActorTaskRunsGet200ResponseData object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewActorTaskRunsGet200ResponseDataWithDefaults - -`func NewActorTaskRunsGet200ResponseDataWithDefaults() *ActorTaskRunsGet200ResponseData` - -NewActorTaskRunsGet200ResponseDataWithDefaults instantiates a new ActorTaskRunsGet200ResponseData object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetTotal - -`func (o *ActorTaskRunsGet200ResponseData) GetTotal() int32` - -GetTotal returns the Total field if non-nil, zero value otherwise. - -### GetTotalOk - -`func (o *ActorTaskRunsGet200ResponseData) GetTotalOk() (*int32, bool)` - -GetTotalOk returns a tuple with the Total field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetTotal - -`func (o *ActorTaskRunsGet200ResponseData) SetTotal(v int32)` - -SetTotal sets Total field to given value. - - -### GetOffset - -`func (o *ActorTaskRunsGet200ResponseData) GetOffset() int32` - -GetOffset returns the Offset field if non-nil, zero value otherwise. - -### GetOffsetOk - -`func (o *ActorTaskRunsGet200ResponseData) GetOffsetOk() (*int32, bool)` - -GetOffsetOk returns a tuple with the Offset field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetOffset - -`func (o *ActorTaskRunsGet200ResponseData) SetOffset(v int32)` - -SetOffset sets Offset field to given value. - - -### GetLimit - -`func (o *ActorTaskRunsGet200ResponseData) GetLimit() int32` - -GetLimit returns the Limit field if non-nil, zero value otherwise. - -### GetLimitOk - -`func (o *ActorTaskRunsGet200ResponseData) GetLimitOk() (*int32, bool)` - -GetLimitOk returns a tuple with the Limit field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetLimit - -`func (o *ActorTaskRunsGet200ResponseData) SetLimit(v int32)` - -SetLimit sets Limit field to given value. - - -### GetDesc - -`func (o *ActorTaskRunsGet200ResponseData) GetDesc() bool` - -GetDesc returns the Desc field if non-nil, zero value otherwise. - -### GetDescOk - -`func (o *ActorTaskRunsGet200ResponseData) GetDescOk() (*bool, bool)` - -GetDescOk returns a tuple with the Desc field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetDesc - -`func (o *ActorTaskRunsGet200ResponseData) SetDesc(v bool)` - -SetDesc sets Desc field to given value. - - -### GetCount - -`func (o *ActorTaskRunsGet200ResponseData) GetCount() int32` - -GetCount returns the Count field if non-nil, zero value otherwise. - -### GetCountOk - -`func (o *ActorTaskRunsGet200ResponseData) GetCountOk() (*int32, bool)` - -GetCountOk returns a tuple with the Count field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetCount - -`func (o *ActorTaskRunsGet200ResponseData) SetCount(v int32)` - -SetCount sets Count field to given value. - - -### GetItems - -`func (o *ActorTaskRunsGet200ResponseData) GetItems() []RunShort` - -GetItems returns the Items field if non-nil, zero value otherwise. - -### GetItemsOk - -`func (o *ActorTaskRunsGet200ResponseData) GetItemsOk() (*[]RunShort, bool)` - -GetItemsOk returns a tuple with the Items field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetItems - -`func (o *ActorTaskRunsGet200ResponseData) SetItems(v []RunShort)` - -SetItems sets Items field to given value. - - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/ActorTaskRunsPost201Response.md b/docs/ActorTaskRunsPost201Response.md deleted file mode 100644 index c29f11e..0000000 --- a/docs/ActorTaskRunsPost201Response.md +++ /dev/null @@ -1,51 +0,0 @@ -# ActorTaskRunsPost201Response - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Data** | [**Run**](Run.md) | | - -## Methods - -### NewActorTaskRunsPost201Response - -`func NewActorTaskRunsPost201Response(data Run, ) *ActorTaskRunsPost201Response` - -NewActorTaskRunsPost201Response instantiates a new ActorTaskRunsPost201Response object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewActorTaskRunsPost201ResponseWithDefaults - -`func NewActorTaskRunsPost201ResponseWithDefaults() *ActorTaskRunsPost201Response` - -NewActorTaskRunsPost201ResponseWithDefaults instantiates a new ActorTaskRunsPost201Response object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetData - -`func (o *ActorTaskRunsPost201Response) GetData() Run` - -GetData returns the Data field if non-nil, zero value otherwise. - -### GetDataOk - -`func (o *ActorTaskRunsPost201Response) GetDataOk() (*Run, bool)` - -GetDataOk returns a tuple with the Data field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetData - -`func (o *ActorTaskRunsPost201Response) SetData(v Run)` - -SetData sets Data field to given value. - - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/ActorTaskWebhooksGet200Response.md b/docs/ActorTaskWebhooksGet200Response.md deleted file mode 100644 index 9d64664..0000000 --- a/docs/ActorTaskWebhooksGet200Response.md +++ /dev/null @@ -1,51 +0,0 @@ -# ActorTaskWebhooksGet200Response - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Data** | [**ActorTaskWebhooksGet200ResponseData**](ActorTaskWebhooksGet200ResponseData.md) | | - -## Methods - -### NewActorTaskWebhooksGet200Response - -`func NewActorTaskWebhooksGet200Response(data ActorTaskWebhooksGet200ResponseData, ) *ActorTaskWebhooksGet200Response` - -NewActorTaskWebhooksGet200Response instantiates a new ActorTaskWebhooksGet200Response object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewActorTaskWebhooksGet200ResponseWithDefaults - -`func NewActorTaskWebhooksGet200ResponseWithDefaults() *ActorTaskWebhooksGet200Response` - -NewActorTaskWebhooksGet200ResponseWithDefaults instantiates a new ActorTaskWebhooksGet200Response object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetData - -`func (o *ActorTaskWebhooksGet200Response) GetData() ActorTaskWebhooksGet200ResponseData` - -GetData returns the Data field if non-nil, zero value otherwise. - -### GetDataOk - -`func (o *ActorTaskWebhooksGet200Response) GetDataOk() (*ActorTaskWebhooksGet200ResponseData, bool)` - -GetDataOk returns a tuple with the Data field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetData - -`func (o *ActorTaskWebhooksGet200Response) SetData(v ActorTaskWebhooksGet200ResponseData)` - -SetData sets Data field to given value. - - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/ActorTaskWebhooksGet200ResponseData.md b/docs/ActorTaskWebhooksGet200ResponseData.md deleted file mode 100644 index 861b41d..0000000 --- a/docs/ActorTaskWebhooksGet200ResponseData.md +++ /dev/null @@ -1,156 +0,0 @@ -# ActorTaskWebhooksGet200ResponseData - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Total** | **int32** | The total number of items available across all pages. | -**Offset** | **int32** | The starting position for this page of results. | -**Limit** | **int32** | The maximum number of items returned per page. | -**Desc** | **bool** | Whether the results are sorted in descending order. | -**Count** | **int32** | The number of items returned in this response. | -**Items** | [**[]Webhook**](Webhook.md) | | - -## Methods - -### NewActorTaskWebhooksGet200ResponseData - -`func NewActorTaskWebhooksGet200ResponseData(total int32, offset int32, limit int32, desc bool, count int32, items []Webhook, ) *ActorTaskWebhooksGet200ResponseData` - -NewActorTaskWebhooksGet200ResponseData instantiates a new ActorTaskWebhooksGet200ResponseData object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewActorTaskWebhooksGet200ResponseDataWithDefaults - -`func NewActorTaskWebhooksGet200ResponseDataWithDefaults() *ActorTaskWebhooksGet200ResponseData` - -NewActorTaskWebhooksGet200ResponseDataWithDefaults instantiates a new ActorTaskWebhooksGet200ResponseData object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetTotal - -`func (o *ActorTaskWebhooksGet200ResponseData) GetTotal() int32` - -GetTotal returns the Total field if non-nil, zero value otherwise. - -### GetTotalOk - -`func (o *ActorTaskWebhooksGet200ResponseData) GetTotalOk() (*int32, bool)` - -GetTotalOk returns a tuple with the Total field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetTotal - -`func (o *ActorTaskWebhooksGet200ResponseData) SetTotal(v int32)` - -SetTotal sets Total field to given value. - - -### GetOffset - -`func (o *ActorTaskWebhooksGet200ResponseData) GetOffset() int32` - -GetOffset returns the Offset field if non-nil, zero value otherwise. - -### GetOffsetOk - -`func (o *ActorTaskWebhooksGet200ResponseData) GetOffsetOk() (*int32, bool)` - -GetOffsetOk returns a tuple with the Offset field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetOffset - -`func (o *ActorTaskWebhooksGet200ResponseData) SetOffset(v int32)` - -SetOffset sets Offset field to given value. - - -### GetLimit - -`func (o *ActorTaskWebhooksGet200ResponseData) GetLimit() int32` - -GetLimit returns the Limit field if non-nil, zero value otherwise. - -### GetLimitOk - -`func (o *ActorTaskWebhooksGet200ResponseData) GetLimitOk() (*int32, bool)` - -GetLimitOk returns a tuple with the Limit field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetLimit - -`func (o *ActorTaskWebhooksGet200ResponseData) SetLimit(v int32)` - -SetLimit sets Limit field to given value. - - -### GetDesc - -`func (o *ActorTaskWebhooksGet200ResponseData) GetDesc() bool` - -GetDesc returns the Desc field if non-nil, zero value otherwise. - -### GetDescOk - -`func (o *ActorTaskWebhooksGet200ResponseData) GetDescOk() (*bool, bool)` - -GetDescOk returns a tuple with the Desc field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetDesc - -`func (o *ActorTaskWebhooksGet200ResponseData) SetDesc(v bool)` - -SetDesc sets Desc field to given value. - - -### GetCount - -`func (o *ActorTaskWebhooksGet200ResponseData) GetCount() int32` - -GetCount returns the Count field if non-nil, zero value otherwise. - -### GetCountOk - -`func (o *ActorTaskWebhooksGet200ResponseData) GetCountOk() (*int32, bool)` - -GetCountOk returns a tuple with the Count field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetCount - -`func (o *ActorTaskWebhooksGet200ResponseData) SetCount(v int32)` - -SetCount sets Count field to given value. - - -### GetItems - -`func (o *ActorTaskWebhooksGet200ResponseData) GetItems() []Webhook` - -GetItems returns the Items field if non-nil, zero value otherwise. - -### GetItemsOk - -`func (o *ActorTaskWebhooksGet200ResponseData) GetItemsOk() (*[]Webhook, bool)` - -GetItemsOk returns a tuple with the Items field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetItems - -`func (o *ActorTaskWebhooksGet200ResponseData) SetItems(v []Webhook)` - -SetItems sets Items field to given value. - - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/ActorTasksAPI.md b/docs/ActorTasksAPI.md deleted file mode 100644 index e833894..0000000 --- a/docs/ActorTasksAPI.md +++ /dev/null @@ -1,1257 +0,0 @@ -# \ActorTasksAPI - -All URIs are relative to *https://api.apify.com* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**ActorTaskDelete**](ActorTasksAPI.md#ActorTaskDelete) | **Delete** /v2/actor-tasks/{actorTaskId} | Delete task -[**ActorTaskGet**](ActorTasksAPI.md#ActorTaskGet) | **Get** /v2/actor-tasks/{actorTaskId} | Get task -[**ActorTaskInputGet**](ActorTasksAPI.md#ActorTaskInputGet) | **Get** /v2/actor-tasks/{actorTaskId}/input | Get task input -[**ActorTaskInputPut**](ActorTasksAPI.md#ActorTaskInputPut) | **Put** /v2/actor-tasks/{actorTaskId}/input | Update task input -[**ActorTaskPut**](ActorTasksAPI.md#ActorTaskPut) | **Put** /v2/actor-tasks/{actorTaskId} | Update task -[**ActorTaskRunSyncGet**](ActorTasksAPI.md#ActorTaskRunSyncGet) | **Get** /v2/actor-tasks/{actorTaskId}/run-sync | Run task synchronously -[**ActorTaskRunSyncGetDatasetItemsGet**](ActorTasksAPI.md#ActorTaskRunSyncGetDatasetItemsGet) | **Get** /v2/actor-tasks/{actorTaskId}/run-sync-get-dataset-items | Run task synchronously and get dataset items -[**ActorTaskRunSyncGetDatasetItemsPost**](ActorTasksAPI.md#ActorTaskRunSyncGetDatasetItemsPost) | **Post** /v2/actor-tasks/{actorTaskId}/run-sync-get-dataset-items | Run task synchronously and get dataset items -[**ActorTaskRunSyncPost**](ActorTasksAPI.md#ActorTaskRunSyncPost) | **Post** /v2/actor-tasks/{actorTaskId}/run-sync | Run task synchronously -[**ActorTaskRunsGet**](ActorTasksAPI.md#ActorTaskRunsGet) | **Get** /v2/actor-tasks/{actorTaskId}/runs | Get list of task runs -[**ActorTaskRunsLastGet**](ActorTasksAPI.md#ActorTaskRunsLastGet) | **Get** /v2/actor-tasks/{actorTaskId}/runs/last | Get last run -[**ActorTaskRunsPost**](ActorTasksAPI.md#ActorTaskRunsPost) | **Post** /v2/actor-tasks/{actorTaskId}/runs | Run task -[**ActorTaskWebhooksGet**](ActorTasksAPI.md#ActorTaskWebhooksGet) | **Get** /v2/actor-tasks/{actorTaskId}/webhooks | Get list of webhooks -[**ActorTasksGet**](ActorTasksAPI.md#ActorTasksGet) | **Get** /v2/actor-tasks | Get list of tasks -[**ActorTasksPost**](ActorTasksAPI.md#ActorTasksPost) | **Post** /v2/actor-tasks | Create task - - - -## ActorTaskDelete - -> map[string]interface{} ActorTaskDelete(ctx, actorTaskId).Execute() - -Delete task - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - actorTaskId := "janedoe~my-task" // string | Task ID or a tilde-separated owner's username and task's name. - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.ActorTasksAPI.ActorTaskDelete(context.Background(), actorTaskId).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `ActorTasksAPI.ActorTaskDelete``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `ActorTaskDelete`: map[string]interface{} - fmt.Fprintf(os.Stdout, "Response from `ActorTasksAPI.ActorTaskDelete`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**actorTaskId** | **string** | Task ID or a tilde-separated owner's username and task's name. | - -### Other Parameters - -Other parameters are passed through a pointer to a apiActorTaskDeleteRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - -### Return type - -**map[string]interface{}** - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## ActorTaskGet - -> ActorTaskGet200Response ActorTaskGet(ctx, actorTaskId).Execute() - -Get task - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - actorTaskId := "janedoe~my-task" // string | Task ID or a tilde-separated owner's username and task's name. - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.ActorTasksAPI.ActorTaskGet(context.Background(), actorTaskId).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `ActorTasksAPI.ActorTaskGet``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `ActorTaskGet`: ActorTaskGet200Response - fmt.Fprintf(os.Stdout, "Response from `ActorTasksAPI.ActorTaskGet`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**actorTaskId** | **string** | Task ID or a tilde-separated owner's username and task's name. | - -### Other Parameters - -Other parameters are passed through a pointer to a apiActorTaskGetRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - -### Return type - -[**ActorTaskGet200Response**](ActorTaskGet200Response.md) - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## ActorTaskInputGet - -> map[string]interface{} ActorTaskInputGet(ctx, actorTaskId).Execute() - -Get task input - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - actorTaskId := "janedoe~my-task" // string | Task ID or a tilde-separated owner's username and task's name. - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.ActorTasksAPI.ActorTaskInputGet(context.Background(), actorTaskId).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `ActorTasksAPI.ActorTaskInputGet``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `ActorTaskInputGet`: map[string]interface{} - fmt.Fprintf(os.Stdout, "Response from `ActorTasksAPI.ActorTaskInputGet`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**actorTaskId** | **string** | Task ID or a tilde-separated owner's username and task's name. | - -### Other Parameters - -Other parameters are passed through a pointer to a apiActorTaskInputGetRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - -### Return type - -**map[string]interface{}** - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## ActorTaskInputPut - -> map[string]interface{} ActorTaskInputPut(ctx, actorTaskId).Body(body).Execute() - -Update task input - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - actorTaskId := "janedoe~my-task" // string | Task ID or a tilde-separated owner's username and task's name. - body := map[string]interface{}{ ... } // map[string]interface{} | - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.ActorTasksAPI.ActorTaskInputPut(context.Background(), actorTaskId).Body(body).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `ActorTasksAPI.ActorTaskInputPut``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `ActorTaskInputPut`: map[string]interface{} - fmt.Fprintf(os.Stdout, "Response from `ActorTasksAPI.ActorTaskInputPut`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**actorTaskId** | **string** | Task ID or a tilde-separated owner's username and task's name. | - -### Other Parameters - -Other parameters are passed through a pointer to a apiActorTaskInputPutRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - **body** | **map[string]interface{}** | | - -### Return type - -**map[string]interface{}** - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## ActorTaskPut - -> ActorTaskGet200Response ActorTaskPut(ctx, actorTaskId).UpdateTaskRequest(updateTaskRequest).Execute() - -Update task - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - actorTaskId := "janedoe~my-task" // string | Task ID or a tilde-separated owner's username and task's name. - updateTaskRequest := *openapiclient.NewUpdateTaskRequest() // UpdateTaskRequest | - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.ActorTasksAPI.ActorTaskPut(context.Background(), actorTaskId).UpdateTaskRequest(updateTaskRequest).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `ActorTasksAPI.ActorTaskPut``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `ActorTaskPut`: ActorTaskGet200Response - fmt.Fprintf(os.Stdout, "Response from `ActorTasksAPI.ActorTaskPut`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**actorTaskId** | **string** | Task ID or a tilde-separated owner's username and task's name. | - -### Other Parameters - -Other parameters are passed through a pointer to a apiActorTaskPutRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - **updateTaskRequest** | [**UpdateTaskRequest**](UpdateTaskRequest.md) | | - -### Return type - -[**ActorTaskGet200Response**](ActorTaskGet200Response.md) - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## ActorTaskRunSyncGet - -> map[string]interface{} ActorTaskRunSyncGet(ctx, actorTaskId).Timeout(timeout).Memory(memory).MaxItems(maxItems).Build(build).OutputRecordKey(outputRecordKey).Webhooks(webhooks).Execute() - -Run task synchronously - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - actorTaskId := "janedoe~my-task" // string | Task ID or a tilde-separated owner's username and task's name. - timeout := float64(60) // float64 | Optional timeout for the run, in seconds. By default, the run uses the timeout from its configuration. (optional) - memory := float64(256) // float64 | Memory limit for the run, in megabytes. The amount of memory can be set to a power of 2 with a minimum of 128. By default, the run uses the memory limit from its configuration. (optional) - maxItems := float64(1000) // float64 | Specifies the maximum number of dataset items that will be charged for pay-per-result Actors. This does NOT guarantee that the Actor will return only this many items. It only ensures you won't be charged for more than this number of items. Only works for pay-per-result Actors. Value can be accessed in the actor run using `ACTOR_MAX_PAID_DATASET_ITEMS` environment variable. (optional) - build := "0.1.234" // string | Specifies the Actor build to run. It can be either a build tag or build number. By default, the run uses the build from its configuration (typically `latest`). (optional) - outputRecordKey := "OUTPUT" // string | Key of the record from run's default key-value store to be returned in the response. By default, it is `OUTPUT`. (optional) - webhooks := "dGhpcyBpcyBqdXN0IGV4YW1wbGUK..." // string | Specifies optional webhooks associated with the Actor run, which can be used to receive a notification e.g. when the Actor finished or failed. The value is a Base64-encoded JSON array whose items follow the WebhookRepresentation schema. For more information, see [Webhooks documentation](https://docs.apify.com/platform/integrations/webhooks). (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.ActorTasksAPI.ActorTaskRunSyncGet(context.Background(), actorTaskId).Timeout(timeout).Memory(memory).MaxItems(maxItems).Build(build).OutputRecordKey(outputRecordKey).Webhooks(webhooks).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `ActorTasksAPI.ActorTaskRunSyncGet``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `ActorTaskRunSyncGet`: map[string]interface{} - fmt.Fprintf(os.Stdout, "Response from `ActorTasksAPI.ActorTaskRunSyncGet`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**actorTaskId** | **string** | Task ID or a tilde-separated owner's username and task's name. | - -### Other Parameters - -Other parameters are passed through a pointer to a apiActorTaskRunSyncGetRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - **timeout** | **float64** | Optional timeout for the run, in seconds. By default, the run uses the timeout from its configuration. | - **memory** | **float64** | Memory limit for the run, in megabytes. The amount of memory can be set to a power of 2 with a minimum of 128. By default, the run uses the memory limit from its configuration. | - **maxItems** | **float64** | Specifies the maximum number of dataset items that will be charged for pay-per-result Actors. This does NOT guarantee that the Actor will return only this many items. It only ensures you won't be charged for more than this number of items. Only works for pay-per-result Actors. Value can be accessed in the actor run using `ACTOR_MAX_PAID_DATASET_ITEMS` environment variable. | - **build** | **string** | Specifies the Actor build to run. It can be either a build tag or build number. By default, the run uses the build from its configuration (typically `latest`). | - **outputRecordKey** | **string** | Key of the record from run's default key-value store to be returned in the response. By default, it is `OUTPUT`. | - **webhooks** | **string** | Specifies optional webhooks associated with the Actor run, which can be used to receive a notification e.g. when the Actor finished or failed. The value is a Base64-encoded JSON array whose items follow the WebhookRepresentation schema. For more information, see [Webhooks documentation](https://docs.apify.com/platform/integrations/webhooks). | - -### Return type - -**map[string]interface{}** - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## ActorTaskRunSyncGetDatasetItemsGet - -> map[string]interface{} ActorTaskRunSyncGetDatasetItemsGet(ctx, actorTaskId).Timeout(timeout).Memory(memory).MaxItems(maxItems).Build(build).Webhooks(webhooks).Format(format).Clean(clean).Offset(offset).Limit(limit).Fields(fields).OutputFields(outputFields).Omit(omit).Unwind(unwind).Flatten(flatten).Desc(desc).Attachment(attachment).Delimiter(delimiter).Bom(bom).XmlRoot(xmlRoot).XmlRow(xmlRow).SkipHeaderRow(skipHeaderRow).SkipHidden(skipHidden).SkipEmpty(skipEmpty).Simplified(simplified).View(view).SkipFailedPages(skipFailedPages).FeedTitle(feedTitle).FeedDescription(feedDescription).Execute() - -Run task synchronously and get dataset items - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - actorTaskId := "janedoe~my-task" // string | Task ID or a tilde-separated owner's username and task's name. - timeout := float64(60) // float64 | Optional timeout for the run, in seconds. By default, the run uses the timeout from its configuration. (optional) - memory := float64(256) // float64 | Memory limit for the run, in megabytes. The amount of memory can be set to a power of 2 with a minimum of 128. By default, the run uses the memory limit from its configuration. (optional) - maxItems := float64(1000) // float64 | Specifies the maximum number of dataset items that will be charged for pay-per-result Actors. This does NOT guarantee that the Actor will return only this many items. It only ensures you won't be charged for more than this number of items. Only works for pay-per-result Actors. Value can be accessed in the actor run using `ACTOR_MAX_PAID_DATASET_ITEMS` environment variable. (optional) - build := "0.1.234" // string | Specifies the Actor build to run. It can be either a build tag or build number. By default, the run uses the build from its configuration (typically `latest`). (optional) - webhooks := "dGhpcyBpcyBqdXN0IGV4YW1wbGUK..." // string | Specifies optional webhooks associated with the Actor run, which can be used to receive a notification e.g. when the Actor finished or failed. The value is a Base64-encoded JSON array whose items follow the WebhookRepresentation schema. For more information, see [Webhooks documentation](https://docs.apify.com/platform/integrations/webhooks). (optional) - format := "json" // string | Format of the results, possible values are: `json`, `jsonl`, `csv`, `html`, `xlsx`, `xml` and `rss`. The default value is `json`. (optional) - clean := false // bool | If `true` or `1` then the API endpoint returns only non-empty items and skips hidden fields (i.e. fields starting with the # character). The `clean` parameter is just a shortcut for `skipHidden=true` and `skipEmpty=true` parameters. Note that since some objects might be skipped from the output, that the result might contain less items than the `limit` value. (optional) - offset := float64(0) // float64 | Number of items that should be skipped at the start. The default value is `0`. (optional) - limit := float64(1.2) // float64 | Maximum number of items to return. By default there is no limit. (optional) - fields := "myValue,myOtherValue" // string | A comma-separated list of fields which should be picked from the items, only these fields will remain in the resulting record objects. Note that the fields in the outputted items are sorted the same way as they are specified in the `fields` query parameter. You can use this feature to effectively fix the output format. (optional) - outputFields := "title,link" // string | A comma-separated list of output field names that positionally rename the fields specified in the `fields` parameter. For example, `?fields=headline,url&outputFields=title,link` renames `headline` to `title` and `url` to `link` in the output. The number of names in `outputFields` must match the number of names in `fields`. Requires the `fields` parameter to be specified as well. (optional) - omit := "myValue,myOtherValue" // string | A comma-separated list of fields which should be omitted from the items. (optional) - unwind := "myValue,myOtherValue" // string | A comma-separated list of fields which should be unwound, in order which they should be processed. Each field should be either an array or an object. If the field is an array then every element of the array will become a separate record and merged with parent object. If the unwound field is an object then it is merged with the parent object. If the unwound field is missing or its value is neither an array nor an object and therefore cannot be merged with a parent object then the item gets preserved as it is. Note that the unwound items ignore the `desc` parameter. (optional) - flatten := "myValue" // string | A comma-separated list of fields which should transform nested objects into flat structures. For example, with `flatten=\"foo\"` the object `{\"foo\":{\"bar\": \"hello\"}}` is turned into `{\"foo.bar\": \"hello\"}`. The original object with properties is replaced with the flattened object. (optional) - desc := true // bool | By default, results are returned in the same order as they were stored. To reverse the order, set this parameter to `true` or `1`. (optional) - attachment := true // bool | If `true` or `1` then the response will define the `Content-Disposition: attachment` header, forcing a web browser to download the file rather than to display it. By default this header is not present. (optional) - delimiter := ";" // string | A delimiter character for CSV files, only used if `format=csv`. You might need to URL-encode the character (e.g. use `%09` for tab or `%3B` for semicolon). The default delimiter is a simple comma (`,`). (optional) - bom := false // bool | All text responses are encoded in UTF-8 encoding. By default, the `format=csv` files are prefixed with the UTF-8 Byte Order Mark (BOM), while `json`, `jsonl`, `xml`, `html` and `rss` files are not. If you want to override this default behavior, specify `bom=1` query parameter to include the BOM or `bom=0` to skip it. (optional) - xmlRoot := "items" // string | Overrides default root element name of `xml` output. By default the root element is `items`. (optional) - xmlRow := "item" // string | Overrides default element name that wraps each page or page function result object in `xml` output. By default the element name is `item`. (optional) - skipHeaderRow := true // bool | If `true` or `1` then header row in the `csv` format is skipped. (optional) - skipHidden := false // bool | If `true` or `1` then hidden fields are skipped from the output, i.e. fields starting with the `#` character. (optional) - skipEmpty := false // bool | If `true` or `1` then empty items are skipped from the output. Note that if used, the results might contain less items than the limit value. (optional) - simplified := false // bool | If `true` or `1` then, the endpoint applies the `fields=url,pageFunctionResult,errorInfo` and `unwind=pageFunctionResult` query parameters. This feature is used to emulate simplified results provided by the legacy Apify Crawler product and it's not recommended to use it in new integrations. (optional) - view := "overview" // string | Defines the view configuration for dataset items based on the schema definition. This parameter determines how the data will be filtered and presented. For complete specification details, see the [dataset schema documentation](/platform/actors/development/actor-definition/dataset-schema). (optional) - skipFailedPages := false // bool | If `true` or `1` then, the all the items with errorInfo property will be skipped from the output. This feature is here to emulate functionality of API version 1 used for the legacy Apify Crawler product and it's not recommended to use it in new integrations. (optional) - feedTitle := "Latest posts from r/pasta" // string | Overrides the auto-generated RSS channel `<title>` element. Only used when `format=rss`. If not provided, the title defaults to `Dataset <label>`. (optional) - feedDescription := "Scraped forum posts" // string | Overrides the auto-generated RSS channel `<description>` element. Only used when `format=rss`. If not provided, the description defaults to `Items in dataset with id \"<datasetId>\".` (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.ActorTasksAPI.ActorTaskRunSyncGetDatasetItemsGet(context.Background(), actorTaskId).Timeout(timeout).Memory(memory).MaxItems(maxItems).Build(build).Webhooks(webhooks).Format(format).Clean(clean).Offset(offset).Limit(limit).Fields(fields).OutputFields(outputFields).Omit(omit).Unwind(unwind).Flatten(flatten).Desc(desc).Attachment(attachment).Delimiter(delimiter).Bom(bom).XmlRoot(xmlRoot).XmlRow(xmlRow).SkipHeaderRow(skipHeaderRow).SkipHidden(skipHidden).SkipEmpty(skipEmpty).Simplified(simplified).View(view).SkipFailedPages(skipFailedPages).FeedTitle(feedTitle).FeedDescription(feedDescription).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `ActorTasksAPI.ActorTaskRunSyncGetDatasetItemsGet``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `ActorTaskRunSyncGetDatasetItemsGet`: map[string]interface{} - fmt.Fprintf(os.Stdout, "Response from `ActorTasksAPI.ActorTaskRunSyncGetDatasetItemsGet`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**actorTaskId** | **string** | Task ID or a tilde-separated owner's username and task's name. | - -### Other Parameters - -Other parameters are passed through a pointer to a apiActorTaskRunSyncGetDatasetItemsGetRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - **timeout** | **float64** | Optional timeout for the run, in seconds. By default, the run uses the timeout from its configuration. | - **memory** | **float64** | Memory limit for the run, in megabytes. The amount of memory can be set to a power of 2 with a minimum of 128. By default, the run uses the memory limit from its configuration. | - **maxItems** | **float64** | Specifies the maximum number of dataset items that will be charged for pay-per-result Actors. This does NOT guarantee that the Actor will return only this many items. It only ensures you won't be charged for more than this number of items. Only works for pay-per-result Actors. Value can be accessed in the actor run using `ACTOR_MAX_PAID_DATASET_ITEMS` environment variable. | - **build** | **string** | Specifies the Actor build to run. It can be either a build tag or build number. By default, the run uses the build from its configuration (typically `latest`). | - **webhooks** | **string** | Specifies optional webhooks associated with the Actor run, which can be used to receive a notification e.g. when the Actor finished or failed. The value is a Base64-encoded JSON array whose items follow the WebhookRepresentation schema. For more information, see [Webhooks documentation](https://docs.apify.com/platform/integrations/webhooks). | - **format** | **string** | Format of the results, possible values are: `json`, `jsonl`, `csv`, `html`, `xlsx`, `xml` and `rss`. The default value is `json`. | - **clean** | **bool** | If `true` or `1` then the API endpoint returns only non-empty items and skips hidden fields (i.e. fields starting with the # character). The `clean` parameter is just a shortcut for `skipHidden=true` and `skipEmpty=true` parameters. Note that since some objects might be skipped from the output, that the result might contain less items than the `limit` value. | - **offset** | **float64** | Number of items that should be skipped at the start. The default value is `0`. | - **limit** | **float64** | Maximum number of items to return. By default there is no limit. | - **fields** | **string** | A comma-separated list of fields which should be picked from the items, only these fields will remain in the resulting record objects. Note that the fields in the outputted items are sorted the same way as they are specified in the `fields` query parameter. You can use this feature to effectively fix the output format. | - **outputFields** | **string** | A comma-separated list of output field names that positionally rename the fields specified in the `fields` parameter. For example, `?fields=headline,url&outputFields=title,link` renames `headline` to `title` and `url` to `link` in the output. The number of names in `outputFields` must match the number of names in `fields`. Requires the `fields` parameter to be specified as well. | - **omit** | **string** | A comma-separated list of fields which should be omitted from the items. | - **unwind** | **string** | A comma-separated list of fields which should be unwound, in order which they should be processed. Each field should be either an array or an object. If the field is an array then every element of the array will become a separate record and merged with parent object. If the unwound field is an object then it is merged with the parent object. If the unwound field is missing or its value is neither an array nor an object and therefore cannot be merged with a parent object then the item gets preserved as it is. Note that the unwound items ignore the `desc` parameter. | - **flatten** | **string** | A comma-separated list of fields which should transform nested objects into flat structures. For example, with `flatten=\"foo\"` the object `{\"foo\":{\"bar\": \"hello\"}}` is turned into `{\"foo.bar\": \"hello\"}`. The original object with properties is replaced with the flattened object. | - **desc** | **bool** | By default, results are returned in the same order as they were stored. To reverse the order, set this parameter to `true` or `1`. | - **attachment** | **bool** | If `true` or `1` then the response will define the `Content-Disposition: attachment` header, forcing a web browser to download the file rather than to display it. By default this header is not present. | - **delimiter** | **string** | A delimiter character for CSV files, only used if `format=csv`. You might need to URL-encode the character (e.g. use `%09` for tab or `%3B` for semicolon). The default delimiter is a simple comma (`,`). | - **bom** | **bool** | All text responses are encoded in UTF-8 encoding. By default, the `format=csv` files are prefixed with the UTF-8 Byte Order Mark (BOM), while `json`, `jsonl`, `xml`, `html` and `rss` files are not. If you want to override this default behavior, specify `bom=1` query parameter to include the BOM or `bom=0` to skip it. | - **xmlRoot** | **string** | Overrides default root element name of `xml` output. By default the root element is `items`. | - **xmlRow** | **string** | Overrides default element name that wraps each page or page function result object in `xml` output. By default the element name is `item`. | - **skipHeaderRow** | **bool** | If `true` or `1` then header row in the `csv` format is skipped. | - **skipHidden** | **bool** | If `true` or `1` then hidden fields are skipped from the output, i.e. fields starting with the `#` character. | - **skipEmpty** | **bool** | If `true` or `1` then empty items are skipped from the output. Note that if used, the results might contain less items than the limit value. | - **simplified** | **bool** | If `true` or `1` then, the endpoint applies the `fields=url,pageFunctionResult,errorInfo` and `unwind=pageFunctionResult` query parameters. This feature is used to emulate simplified results provided by the legacy Apify Crawler product and it's not recommended to use it in new integrations. | - **view** | **string** | Defines the view configuration for dataset items based on the schema definition. This parameter determines how the data will be filtered and presented. For complete specification details, see the [dataset schema documentation](/platform/actors/development/actor-definition/dataset-schema). | - **skipFailedPages** | **bool** | If `true` or `1` then, the all the items with errorInfo property will be skipped from the output. This feature is here to emulate functionality of API version 1 used for the legacy Apify Crawler product and it's not recommended to use it in new integrations. | - **feedTitle** | **string** | Overrides the auto-generated RSS channel `<title>` element. Only used when `format=rss`. If not provided, the title defaults to `Dataset <label>`. | - **feedDescription** | **string** | Overrides the auto-generated RSS channel `<description>` element. Only used when `format=rss`. If not provided, the description defaults to `Items in dataset with id \"<datasetId>\".` | - -### Return type - -**map[string]interface{}** - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## ActorTaskRunSyncGetDatasetItemsPost - -> map[string]interface{} ActorTaskRunSyncGetDatasetItemsPost(ctx, actorTaskId).Body(body).Timeout(timeout).Memory(memory).MaxItems(maxItems).MaxTotalChargeUsd(maxTotalChargeUsd).RestartOnError(restartOnError).Build(build).Webhooks(webhooks).Format(format).Clean(clean).Offset(offset).Limit(limit).Fields(fields).OutputFields(outputFields).Omit(omit).Unwind(unwind).Flatten(flatten).Desc(desc).Attachment(attachment).Delimiter(delimiter).Bom(bom).XmlRoot(xmlRoot).XmlRow(xmlRow).SkipHeaderRow(skipHeaderRow).SkipHidden(skipHidden).SkipEmpty(skipEmpty).Simplified(simplified).View(view).SkipFailedPages(skipFailedPages).FeedTitle(feedTitle).FeedDescription(feedDescription).Execute() - -Run task synchronously and get dataset items - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - actorTaskId := "janedoe~my-task" // string | Task ID or a tilde-separated owner's username and task's name. - body := map[string]interface{}{ ... } // map[string]interface{} | - timeout := float64(60) // float64 | Optional timeout for the run, in seconds. By default, the run uses the timeout from its configuration. (optional) - memory := float64(256) // float64 | Memory limit for the run, in megabytes. The amount of memory can be set to a power of 2 with a minimum of 128. By default, the run uses the memory limit from its configuration. (optional) - maxItems := float64(1000) // float64 | Specifies the maximum number of dataset items that will be charged for pay-per-result Actors. This does NOT guarantee that the Actor will return only this many items. It only ensures you won't be charged for more than this number of items. Only works for pay-per-result Actors. Value can be accessed in the actor run using `ACTOR_MAX_PAID_DATASET_ITEMS` environment variable. (optional) - maxTotalChargeUsd := float64(5) // float64 | Specifies the maximum cost of the run. This parameter is useful for pay-per-event Actors, as it allows you to limit the amount charged to your subscription. You can access the maximum cost in your Actor by using the `ACTOR_MAX_TOTAL_CHARGE_USD` environment variable. (optional) - restartOnError := false // bool | Determines whether the run will be restarted if it fails. (optional) - build := "0.1.234" // string | Specifies the Actor build to run. It can be either a build tag or build number. By default, the run uses the build from its configuration (typically `latest`). (optional) - webhooks := "dGhpcyBpcyBqdXN0IGV4YW1wbGUK..." // string | Specifies optional webhooks associated with the Actor run, which can be used to receive a notification e.g. when the Actor finished or failed. The value is a Base64-encoded JSON array whose items follow the WebhookRepresentation schema. For more information, see [Webhooks documentation](https://docs.apify.com/platform/integrations/webhooks). (optional) - format := "json" // string | Format of the results, possible values are: `json`, `jsonl`, `csv`, `html`, `xlsx`, `xml` and `rss`. The default value is `json`. (optional) - clean := false // bool | If `true` or `1` then the API endpoint returns only non-empty items and skips hidden fields (i.e. fields starting with the # character). The `clean` parameter is just a shortcut for `skipHidden=true` and `skipEmpty=true` parameters. Note that since some objects might be skipped from the output, that the result might contain less items than the `limit` value. (optional) - offset := float64(0) // float64 | Number of items that should be skipped at the start. The default value is `0`. (optional) - limit := float64(1.2) // float64 | Maximum number of items to return. By default there is no limit. (optional) - fields := "myValue,myOtherValue" // string | A comma-separated list of fields which should be picked from the items, only these fields will remain in the resulting record objects. Note that the fields in the outputted items are sorted the same way as they are specified in the `fields` query parameter. You can use this feature to effectively fix the output format. (optional) - outputFields := "title,link" // string | A comma-separated list of output field names that positionally rename the fields specified in the `fields` parameter. For example, `?fields=headline,url&outputFields=title,link` renames `headline` to `title` and `url` to `link` in the output. The number of names in `outputFields` must match the number of names in `fields`. Requires the `fields` parameter to be specified as well. (optional) - omit := "myValue,myOtherValue" // string | A comma-separated list of fields which should be omitted from the items. (optional) - unwind := "myValue,myOtherValue" // string | A comma-separated list of fields which should be unwound, in order which they should be processed. Each field should be either an array or an object. If the field is an array then every element of the array will become a separate record and merged with parent object. If the unwound field is an object then it is merged with the parent object. If the unwound field is missing or its value is neither an array nor an object and therefore cannot be merged with a parent object then the item gets preserved as it is. Note that the unwound items ignore the `desc` parameter. (optional) - flatten := "myValue" // string | A comma-separated list of fields which should transform nested objects into flat structures. For example, with `flatten=\"foo\"` the object `{\"foo\":{\"bar\": \"hello\"}}` is turned into `{\"foo.bar\": \"hello\"}`. The original object with properties is replaced with the flattened object. (optional) - desc := true // bool | By default, results are returned in the same order as they were stored. To reverse the order, set this parameter to `true` or `1`. (optional) - attachment := true // bool | If `true` or `1` then the response will define the `Content-Disposition: attachment` header, forcing a web browser to download the file rather than to display it. By default this header is not present. (optional) - delimiter := ";" // string | A delimiter character for CSV files, only used if `format=csv`. You might need to URL-encode the character (e.g. use `%09` for tab or `%3B` for semicolon). The default delimiter is a simple comma (`,`). (optional) - bom := false // bool | All text responses are encoded in UTF-8 encoding. By default, the `format=csv` files are prefixed with the UTF-8 Byte Order Mark (BOM), while `json`, `jsonl`, `xml`, `html` and `rss` files are not. If you want to override this default behavior, specify `bom=1` query parameter to include the BOM or `bom=0` to skip it. (optional) - xmlRoot := "items" // string | Overrides default root element name of `xml` output. By default the root element is `items`. (optional) - xmlRow := "item" // string | Overrides default element name that wraps each page or page function result object in `xml` output. By default the element name is `item`. (optional) - skipHeaderRow := true // bool | If `true` or `1` then header row in the `csv` format is skipped. (optional) - skipHidden := false // bool | If `true` or `1` then hidden fields are skipped from the output, i.e. fields starting with the `#` character. (optional) - skipEmpty := false // bool | If `true` or `1` then empty items are skipped from the output. Note that if used, the results might contain less items than the limit value. (optional) - simplified := false // bool | If `true` or `1` then, the endpoint applies the `fields=url,pageFunctionResult,errorInfo` and `unwind=pageFunctionResult` query parameters. This feature is used to emulate simplified results provided by the legacy Apify Crawler product and it's not recommended to use it in new integrations. (optional) - view := "overview" // string | Defines the view configuration for dataset items based on the schema definition. This parameter determines how the data will be filtered and presented. For complete specification details, see the [dataset schema documentation](/platform/actors/development/actor-definition/dataset-schema). (optional) - skipFailedPages := false // bool | If `true` or `1` then, the all the items with errorInfo property will be skipped from the output. This feature is here to emulate functionality of API version 1 used for the legacy Apify Crawler product and it's not recommended to use it in new integrations. (optional) - feedTitle := "Latest posts from r/pasta" // string | Overrides the auto-generated RSS channel `<title>` element. Only used when `format=rss`. If not provided, the title defaults to `Dataset <label>`. (optional) - feedDescription := "Scraped forum posts" // string | Overrides the auto-generated RSS channel `<description>` element. Only used when `format=rss`. If not provided, the description defaults to `Items in dataset with id \"<datasetId>\".` (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.ActorTasksAPI.ActorTaskRunSyncGetDatasetItemsPost(context.Background(), actorTaskId).Body(body).Timeout(timeout).Memory(memory).MaxItems(maxItems).MaxTotalChargeUsd(maxTotalChargeUsd).RestartOnError(restartOnError).Build(build).Webhooks(webhooks).Format(format).Clean(clean).Offset(offset).Limit(limit).Fields(fields).OutputFields(outputFields).Omit(omit).Unwind(unwind).Flatten(flatten).Desc(desc).Attachment(attachment).Delimiter(delimiter).Bom(bom).XmlRoot(xmlRoot).XmlRow(xmlRow).SkipHeaderRow(skipHeaderRow).SkipHidden(skipHidden).SkipEmpty(skipEmpty).Simplified(simplified).View(view).SkipFailedPages(skipFailedPages).FeedTitle(feedTitle).FeedDescription(feedDescription).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `ActorTasksAPI.ActorTaskRunSyncGetDatasetItemsPost``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `ActorTaskRunSyncGetDatasetItemsPost`: map[string]interface{} - fmt.Fprintf(os.Stdout, "Response from `ActorTasksAPI.ActorTaskRunSyncGetDatasetItemsPost`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**actorTaskId** | **string** | Task ID or a tilde-separated owner's username and task's name. | - -### Other Parameters - -Other parameters are passed through a pointer to a apiActorTaskRunSyncGetDatasetItemsPostRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - **body** | **map[string]interface{}** | | - **timeout** | **float64** | Optional timeout for the run, in seconds. By default, the run uses the timeout from its configuration. | - **memory** | **float64** | Memory limit for the run, in megabytes. The amount of memory can be set to a power of 2 with a minimum of 128. By default, the run uses the memory limit from its configuration. | - **maxItems** | **float64** | Specifies the maximum number of dataset items that will be charged for pay-per-result Actors. This does NOT guarantee that the Actor will return only this many items. It only ensures you won't be charged for more than this number of items. Only works for pay-per-result Actors. Value can be accessed in the actor run using `ACTOR_MAX_PAID_DATASET_ITEMS` environment variable. | - **maxTotalChargeUsd** | **float64** | Specifies the maximum cost of the run. This parameter is useful for pay-per-event Actors, as it allows you to limit the amount charged to your subscription. You can access the maximum cost in your Actor by using the `ACTOR_MAX_TOTAL_CHARGE_USD` environment variable. | - **restartOnError** | **bool** | Determines whether the run will be restarted if it fails. | - **build** | **string** | Specifies the Actor build to run. It can be either a build tag or build number. By default, the run uses the build from its configuration (typically `latest`). | - **webhooks** | **string** | Specifies optional webhooks associated with the Actor run, which can be used to receive a notification e.g. when the Actor finished or failed. The value is a Base64-encoded JSON array whose items follow the WebhookRepresentation schema. For more information, see [Webhooks documentation](https://docs.apify.com/platform/integrations/webhooks). | - **format** | **string** | Format of the results, possible values are: `json`, `jsonl`, `csv`, `html`, `xlsx`, `xml` and `rss`. The default value is `json`. | - **clean** | **bool** | If `true` or `1` then the API endpoint returns only non-empty items and skips hidden fields (i.e. fields starting with the # character). The `clean` parameter is just a shortcut for `skipHidden=true` and `skipEmpty=true` parameters. Note that since some objects might be skipped from the output, that the result might contain less items than the `limit` value. | - **offset** | **float64** | Number of items that should be skipped at the start. The default value is `0`. | - **limit** | **float64** | Maximum number of items to return. By default there is no limit. | - **fields** | **string** | A comma-separated list of fields which should be picked from the items, only these fields will remain in the resulting record objects. Note that the fields in the outputted items are sorted the same way as they are specified in the `fields` query parameter. You can use this feature to effectively fix the output format. | - **outputFields** | **string** | A comma-separated list of output field names that positionally rename the fields specified in the `fields` parameter. For example, `?fields=headline,url&outputFields=title,link` renames `headline` to `title` and `url` to `link` in the output. The number of names in `outputFields` must match the number of names in `fields`. Requires the `fields` parameter to be specified as well. | - **omit** | **string** | A comma-separated list of fields which should be omitted from the items. | - **unwind** | **string** | A comma-separated list of fields which should be unwound, in order which they should be processed. Each field should be either an array or an object. If the field is an array then every element of the array will become a separate record and merged with parent object. If the unwound field is an object then it is merged with the parent object. If the unwound field is missing or its value is neither an array nor an object and therefore cannot be merged with a parent object then the item gets preserved as it is. Note that the unwound items ignore the `desc` parameter. | - **flatten** | **string** | A comma-separated list of fields which should transform nested objects into flat structures. For example, with `flatten=\"foo\"` the object `{\"foo\":{\"bar\": \"hello\"}}` is turned into `{\"foo.bar\": \"hello\"}`. The original object with properties is replaced with the flattened object. | - **desc** | **bool** | By default, results are returned in the same order as they were stored. To reverse the order, set this parameter to `true` or `1`. | - **attachment** | **bool** | If `true` or `1` then the response will define the `Content-Disposition: attachment` header, forcing a web browser to download the file rather than to display it. By default this header is not present. | - **delimiter** | **string** | A delimiter character for CSV files, only used if `format=csv`. You might need to URL-encode the character (e.g. use `%09` for tab or `%3B` for semicolon). The default delimiter is a simple comma (`,`). | - **bom** | **bool** | All text responses are encoded in UTF-8 encoding. By default, the `format=csv` files are prefixed with the UTF-8 Byte Order Mark (BOM), while `json`, `jsonl`, `xml`, `html` and `rss` files are not. If you want to override this default behavior, specify `bom=1` query parameter to include the BOM or `bom=0` to skip it. | - **xmlRoot** | **string** | Overrides default root element name of `xml` output. By default the root element is `items`. | - **xmlRow** | **string** | Overrides default element name that wraps each page or page function result object in `xml` output. By default the element name is `item`. | - **skipHeaderRow** | **bool** | If `true` or `1` then header row in the `csv` format is skipped. | - **skipHidden** | **bool** | If `true` or `1` then hidden fields are skipped from the output, i.e. fields starting with the `#` character. | - **skipEmpty** | **bool** | If `true` or `1` then empty items are skipped from the output. Note that if used, the results might contain less items than the limit value. | - **simplified** | **bool** | If `true` or `1` then, the endpoint applies the `fields=url,pageFunctionResult,errorInfo` and `unwind=pageFunctionResult` query parameters. This feature is used to emulate simplified results provided by the legacy Apify Crawler product and it's not recommended to use it in new integrations. | - **view** | **string** | Defines the view configuration for dataset items based on the schema definition. This parameter determines how the data will be filtered and presented. For complete specification details, see the [dataset schema documentation](/platform/actors/development/actor-definition/dataset-schema). | - **skipFailedPages** | **bool** | If `true` or `1` then, the all the items with errorInfo property will be skipped from the output. This feature is here to emulate functionality of API version 1 used for the legacy Apify Crawler product and it's not recommended to use it in new integrations. | - **feedTitle** | **string** | Overrides the auto-generated RSS channel `<title>` element. Only used when `format=rss`. If not provided, the title defaults to `Dataset <label>`. | - **feedDescription** | **string** | Overrides the auto-generated RSS channel `<description>` element. Only used when `format=rss`. If not provided, the description defaults to `Items in dataset with id \"<datasetId>\".` | - -### Return type - -**map[string]interface{}** - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## ActorTaskRunSyncPost - -> map[string]interface{} ActorTaskRunSyncPost(ctx, actorTaskId).Body(body).Timeout(timeout).Memory(memory).MaxItems(maxItems).MaxTotalChargeUsd(maxTotalChargeUsd).RestartOnError(restartOnError).Build(build).OutputRecordKey(outputRecordKey).Webhooks(webhooks).Execute() - -Run task synchronously - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - actorTaskId := "janedoe~my-task" // string | Task ID or a tilde-separated owner's username and task's name. - body := map[string]interface{}{ ... } // map[string]interface{} | - timeout := float64(60) // float64 | Optional timeout for the run, in seconds. By default, the run uses the timeout from its configuration. (optional) - memory := float64(256) // float64 | Memory limit for the run, in megabytes. The amount of memory can be set to a power of 2 with a minimum of 128. By default, the run uses the memory limit from its configuration. (optional) - maxItems := float64(1000) // float64 | Specifies the maximum number of dataset items that will be charged for pay-per-result Actors. This does NOT guarantee that the Actor will return only this many items. It only ensures you won't be charged for more than this number of items. Only works for pay-per-result Actors. Value can be accessed in the actor run using `ACTOR_MAX_PAID_DATASET_ITEMS` environment variable. (optional) - maxTotalChargeUsd := float64(5) // float64 | Specifies the maximum cost of the run. This parameter is useful for pay-per-event Actors, as it allows you to limit the amount charged to your subscription. You can access the maximum cost in your Actor by using the `ACTOR_MAX_TOTAL_CHARGE_USD` environment variable. (optional) - restartOnError := false // bool | Determines whether the run will be restarted if it fails. (optional) - build := "0.1.234" // string | Specifies the Actor build to run. It can be either a build tag or build number. By default, the run uses the build from its configuration (typically `latest`). (optional) - outputRecordKey := "OUTPUT" // string | Key of the record from run's default key-value store to be returned in the response. By default, it is `OUTPUT`. (optional) - webhooks := "dGhpcyBpcyBqdXN0IGV4YW1wbGUK..." // string | Specifies optional webhooks associated with the Actor run, which can be used to receive a notification e.g. when the Actor finished or failed. The value is a Base64-encoded JSON array whose items follow the WebhookRepresentation schema. For more information, see [Webhooks documentation](https://docs.apify.com/platform/integrations/webhooks). (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.ActorTasksAPI.ActorTaskRunSyncPost(context.Background(), actorTaskId).Body(body).Timeout(timeout).Memory(memory).MaxItems(maxItems).MaxTotalChargeUsd(maxTotalChargeUsd).RestartOnError(restartOnError).Build(build).OutputRecordKey(outputRecordKey).Webhooks(webhooks).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `ActorTasksAPI.ActorTaskRunSyncPost``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `ActorTaskRunSyncPost`: map[string]interface{} - fmt.Fprintf(os.Stdout, "Response from `ActorTasksAPI.ActorTaskRunSyncPost`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**actorTaskId** | **string** | Task ID or a tilde-separated owner's username and task's name. | - -### Other Parameters - -Other parameters are passed through a pointer to a apiActorTaskRunSyncPostRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - **body** | **map[string]interface{}** | | - **timeout** | **float64** | Optional timeout for the run, in seconds. By default, the run uses the timeout from its configuration. | - **memory** | **float64** | Memory limit for the run, in megabytes. The amount of memory can be set to a power of 2 with a minimum of 128. By default, the run uses the memory limit from its configuration. | - **maxItems** | **float64** | Specifies the maximum number of dataset items that will be charged for pay-per-result Actors. This does NOT guarantee that the Actor will return only this many items. It only ensures you won't be charged for more than this number of items. Only works for pay-per-result Actors. Value can be accessed in the actor run using `ACTOR_MAX_PAID_DATASET_ITEMS` environment variable. | - **maxTotalChargeUsd** | **float64** | Specifies the maximum cost of the run. This parameter is useful for pay-per-event Actors, as it allows you to limit the amount charged to your subscription. You can access the maximum cost in your Actor by using the `ACTOR_MAX_TOTAL_CHARGE_USD` environment variable. | - **restartOnError** | **bool** | Determines whether the run will be restarted if it fails. | - **build** | **string** | Specifies the Actor build to run. It can be either a build tag or build number. By default, the run uses the build from its configuration (typically `latest`). | - **outputRecordKey** | **string** | Key of the record from run's default key-value store to be returned in the response. By default, it is `OUTPUT`. | - **webhooks** | **string** | Specifies optional webhooks associated with the Actor run, which can be used to receive a notification e.g. when the Actor finished or failed. The value is a Base64-encoded JSON array whose items follow the WebhookRepresentation schema. For more information, see [Webhooks documentation](https://docs.apify.com/platform/integrations/webhooks). | - -### Return type - -**map[string]interface{}** - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## ActorTaskRunsGet - -> ActorTaskRunsGet200Response ActorTaskRunsGet(ctx, actorTaskId).Offset(offset).Limit(limit).Desc(desc).Status(status).Execute() - -Get list of task runs - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - actorTaskId := "janedoe~my-task" // string | Task ID or a tilde-separated owner's username and task's name. - offset := float64(0) // float64 | Number of items that should be skipped at the start. The default value is `0`. (optional) - limit := float64(1000) // float64 | Maximum number of items to return. The default value as well as the maximum is `1000`. (optional) - desc := true // bool | If `true` or `1` then the objects are sorted by the `startedAt` field in descending order. By default, they are sorted in ascending order. (optional) - status := []string{"Inner_example"} // []string | Single status or comma-separated list of statuses, see ([available statuses](https://docs.apify.com/platform/actors/running/runs-and-builds#lifecycle)). Used to filter runs by the specified statuses only. (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.ActorTasksAPI.ActorTaskRunsGet(context.Background(), actorTaskId).Offset(offset).Limit(limit).Desc(desc).Status(status).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `ActorTasksAPI.ActorTaskRunsGet``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `ActorTaskRunsGet`: ActorTaskRunsGet200Response - fmt.Fprintf(os.Stdout, "Response from `ActorTasksAPI.ActorTaskRunsGet`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**actorTaskId** | **string** | Task ID or a tilde-separated owner's username and task's name. | - -### Other Parameters - -Other parameters are passed through a pointer to a apiActorTaskRunsGetRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - **offset** | **float64** | Number of items that should be skipped at the start. The default value is `0`. | - **limit** | **float64** | Maximum number of items to return. The default value as well as the maximum is `1000`. | - **desc** | **bool** | If `true` or `1` then the objects are sorted by the `startedAt` field in descending order. By default, they are sorted in ascending order. | - **status** | **[]string** | Single status or comma-separated list of statuses, see ([available statuses](https://docs.apify.com/platform/actors/running/runs-and-builds#lifecycle)). Used to filter runs by the specified statuses only. | - -### Return type - -[**ActorTaskRunsGet200Response**](ActorTaskRunsGet200Response.md) - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## ActorTaskRunsLastGet - -> ActorTaskRunsPost201Response ActorTaskRunsLastGet(ctx, actorTaskId).Status(status).WaitForFinish(waitForFinish).Execute() - -Get last run - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - actorTaskId := "janedoe~my-task" // string | Task ID or a tilde-separated owner's username and task's name. - status := "SUCCEEDED" // string | Filter for the run status. (optional) - waitForFinish := float64(60) // float64 | The maximum number of seconds the server waits for the run to finish. By default it is `0`, the maximum value is `60`. <!-- MAX_ACTOR_JOB_ASYNC_WAIT_SECS --> If the run finishes in time then the returned run object will have a terminal status (e.g. `SUCCEEDED`), otherwise it will have a transitional status (e.g. `RUNNING`). (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.ActorTasksAPI.ActorTaskRunsLastGet(context.Background(), actorTaskId).Status(status).WaitForFinish(waitForFinish).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `ActorTasksAPI.ActorTaskRunsLastGet``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `ActorTaskRunsLastGet`: ActorTaskRunsPost201Response - fmt.Fprintf(os.Stdout, "Response from `ActorTasksAPI.ActorTaskRunsLastGet`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**actorTaskId** | **string** | Task ID or a tilde-separated owner's username and task's name. | - -### Other Parameters - -Other parameters are passed through a pointer to a apiActorTaskRunsLastGetRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - **status** | **string** | Filter for the run status. | - **waitForFinish** | **float64** | The maximum number of seconds the server waits for the run to finish. By default it is `0`, the maximum value is `60`. <!-- MAX_ACTOR_JOB_ASYNC_WAIT_SECS --> If the run finishes in time then the returned run object will have a terminal status (e.g. `SUCCEEDED`), otherwise it will have a transitional status (e.g. `RUNNING`). | - -### Return type - -[**ActorTaskRunsPost201Response**](ActorTaskRunsPost201Response.md) - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## ActorTaskRunsPost - -> ActorTaskRunsPost201Response ActorTaskRunsPost(ctx, actorTaskId).Body(body).Timeout(timeout).Memory(memory).MaxItems(maxItems).MaxTotalChargeUsd(maxTotalChargeUsd).RestartOnError(restartOnError).Build(build).WaitForFinish(waitForFinish).Webhooks(webhooks).Execute() - -Run task - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - actorTaskId := "janedoe~my-task" // string | Task ID or a tilde-separated owner's username and task's name. - body := map[string]interface{}{ ... } // map[string]interface{} | - timeout := float64(60) // float64 | Optional timeout for the run, in seconds. By default, the run uses the timeout from its configuration. (optional) - memory := float64(256) // float64 | Memory limit for the run, in megabytes. The amount of memory can be set to a power of 2 with a minimum of 128. By default, the run uses the memory limit from its configuration. (optional) - maxItems := float64(1000) // float64 | Specifies the maximum number of dataset items that will be charged for pay-per-result Actors. This does NOT guarantee that the Actor will return only this many items. It only ensures you won't be charged for more than this number of items. Only works for pay-per-result Actors. Value can be accessed in the actor run using `ACTOR_MAX_PAID_DATASET_ITEMS` environment variable. (optional) - maxTotalChargeUsd := float64(5) // float64 | Specifies the maximum cost of the run. This parameter is useful for pay-per-event Actors, as it allows you to limit the amount charged to your subscription. You can access the maximum cost in your Actor by using the `ACTOR_MAX_TOTAL_CHARGE_USD` environment variable. (optional) - restartOnError := false // bool | Determines whether the run will be restarted if it fails. (optional) - build := "0.1.234" // string | Specifies the Actor build to run. It can be either a build tag or build number. By default, the run uses the build from its configuration (typically `latest`). (optional) - waitForFinish := float64(60) // float64 | The maximum number of seconds the server waits for the run to finish. By default it is `0`, the maximum value is `60`. <!-- MAX_ACTOR_JOB_ASYNC_WAIT_SECS --> If the run finishes in time then the returned run object will have a terminal status (e.g. `SUCCEEDED`), otherwise it will have a transitional status (e.g. `RUNNING`). (optional) - webhooks := "dGhpcyBpcyBqdXN0IGV4YW1wbGUK..." // string | Specifies optional webhooks associated with the Actor run, which can be used to receive a notification e.g. when the Actor finished or failed. The value is a Base64-encoded JSON array whose items follow the WebhookRepresentation schema. For more information, see [Webhooks documentation](https://docs.apify.com/platform/integrations/webhooks). (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.ActorTasksAPI.ActorTaskRunsPost(context.Background(), actorTaskId).Body(body).Timeout(timeout).Memory(memory).MaxItems(maxItems).MaxTotalChargeUsd(maxTotalChargeUsd).RestartOnError(restartOnError).Build(build).WaitForFinish(waitForFinish).Webhooks(webhooks).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `ActorTasksAPI.ActorTaskRunsPost``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `ActorTaskRunsPost`: ActorTaskRunsPost201Response - fmt.Fprintf(os.Stdout, "Response from `ActorTasksAPI.ActorTaskRunsPost`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**actorTaskId** | **string** | Task ID or a tilde-separated owner's username and task's name. | - -### Other Parameters - -Other parameters are passed through a pointer to a apiActorTaskRunsPostRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - **body** | **map[string]interface{}** | | - **timeout** | **float64** | Optional timeout for the run, in seconds. By default, the run uses the timeout from its configuration. | - **memory** | **float64** | Memory limit for the run, in megabytes. The amount of memory can be set to a power of 2 with a minimum of 128. By default, the run uses the memory limit from its configuration. | - **maxItems** | **float64** | Specifies the maximum number of dataset items that will be charged for pay-per-result Actors. This does NOT guarantee that the Actor will return only this many items. It only ensures you won't be charged for more than this number of items. Only works for pay-per-result Actors. Value can be accessed in the actor run using `ACTOR_MAX_PAID_DATASET_ITEMS` environment variable. | - **maxTotalChargeUsd** | **float64** | Specifies the maximum cost of the run. This parameter is useful for pay-per-event Actors, as it allows you to limit the amount charged to your subscription. You can access the maximum cost in your Actor by using the `ACTOR_MAX_TOTAL_CHARGE_USD` environment variable. | - **restartOnError** | **bool** | Determines whether the run will be restarted if it fails. | - **build** | **string** | Specifies the Actor build to run. It can be either a build tag or build number. By default, the run uses the build from its configuration (typically `latest`). | - **waitForFinish** | **float64** | The maximum number of seconds the server waits for the run to finish. By default it is `0`, the maximum value is `60`. <!-- MAX_ACTOR_JOB_ASYNC_WAIT_SECS --> If the run finishes in time then the returned run object will have a terminal status (e.g. `SUCCEEDED`), otherwise it will have a transitional status (e.g. `RUNNING`). | - **webhooks** | **string** | Specifies optional webhooks associated with the Actor run, which can be used to receive a notification e.g. when the Actor finished or failed. The value is a Base64-encoded JSON array whose items follow the WebhookRepresentation schema. For more information, see [Webhooks documentation](https://docs.apify.com/platform/integrations/webhooks). | - -### Return type - -[**ActorTaskRunsPost201Response**](ActorTaskRunsPost201Response.md) - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## ActorTaskWebhooksGet - -> ActorTaskWebhooksGet200Response ActorTaskWebhooksGet(ctx, actorTaskId).Offset(offset).Limit(limit).Desc(desc).Execute() - -Get list of webhooks - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - actorTaskId := "janedoe~my-task" // string | Task ID or a tilde-separated owner's username and task's name. - offset := float64(0) // float64 | Number of items that should be skipped at the start. The default value is `0`. (optional) - limit := float64(1000) // float64 | Maximum number of items to return. The default value as well as the maximum is `1000`. (optional) - desc := true // bool | If `true` or `1` then the objects are sorted by the `createdAt` field in descending order. By default, they are sorted in ascending order. (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.ActorTasksAPI.ActorTaskWebhooksGet(context.Background(), actorTaskId).Offset(offset).Limit(limit).Desc(desc).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `ActorTasksAPI.ActorTaskWebhooksGet``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `ActorTaskWebhooksGet`: ActorTaskWebhooksGet200Response - fmt.Fprintf(os.Stdout, "Response from `ActorTasksAPI.ActorTaskWebhooksGet`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**actorTaskId** | **string** | Task ID or a tilde-separated owner's username and task's name. | - -### Other Parameters - -Other parameters are passed through a pointer to a apiActorTaskWebhooksGetRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - **offset** | **float64** | Number of items that should be skipped at the start. The default value is `0`. | - **limit** | **float64** | Maximum number of items to return. The default value as well as the maximum is `1000`. | - **desc** | **bool** | If `true` or `1` then the objects are sorted by the `createdAt` field in descending order. By default, they are sorted in ascending order. | - -### Return type - -[**ActorTaskWebhooksGet200Response**](ActorTaskWebhooksGet200Response.md) - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## ActorTasksGet - -> ListOfTasksResponse ActorTasksGet(ctx).Offset(offset).Limit(limit).Desc(desc).Execute() - -Get list of tasks - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - offset := float64(0) // float64 | Number of items that should be skipped at the start. The default value is `0`. (optional) - limit := float64(1000) // float64 | Maximum number of items to return. The default value as well as the maximum is `1000`. (optional) - desc := true // bool | If `true` or `1` then the objects are sorted by the `createdAt` field in descending order. By default, they are sorted in ascending order. (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.ActorTasksAPI.ActorTasksGet(context.Background()).Offset(offset).Limit(limit).Desc(desc).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `ActorTasksAPI.ActorTasksGet``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `ActorTasksGet`: ListOfTasksResponse - fmt.Fprintf(os.Stdout, "Response from `ActorTasksAPI.ActorTasksGet`: %v\n", resp) -} -``` - -### Path Parameters - - - -### Other Parameters - -Other parameters are passed through a pointer to a apiActorTasksGetRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **offset** | **float64** | Number of items that should be skipped at the start. The default value is `0`. | - **limit** | **float64** | Maximum number of items to return. The default value as well as the maximum is `1000`. | - **desc** | **bool** | If `true` or `1` then the objects are sorted by the `createdAt` field in descending order. By default, they are sorted in ascending order. | - -### Return type - -[**ListOfTasksResponse**](ListOfTasksResponse.md) - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## ActorTasksPost - -> TaskResponse ActorTasksPost(ctx).CreateTaskRequest(createTaskRequest).Execute() - -Create task - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - createTaskRequest := *openapiclient.NewCreateTaskRequest("ActId_example") // CreateTaskRequest | - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.ActorTasksAPI.ActorTasksPost(context.Background()).CreateTaskRequest(createTaskRequest).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `ActorTasksAPI.ActorTasksPost``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `ActorTasksPost`: TaskResponse - fmt.Fprintf(os.Stdout, "Response from `ActorTasksAPI.ActorTasksPost`: %v\n", resp) -} -``` - -### Path Parameters - - - -### Other Parameters - -Other parameters are passed through a pointer to a apiActorTasksPostRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **createTaskRequest** | [**CreateTaskRequest**](CreateTaskRequest.md) | | - -### Return type - -[**TaskResponse**](TaskResponse.md) - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - diff --git a/docs/ActorsAPI.md b/docs/ActorsAPI.md deleted file mode 100644 index cf8646a..0000000 --- a/docs/ActorsAPI.md +++ /dev/null @@ -1,440 +0,0 @@ -# \ActorsAPI - -All URIs are relative to *https://api.apify.com* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**ActDelete**](ActorsAPI.md#ActDelete) | **Delete** /v2/actors/{actorId} | Delete Actor -[**ActGet**](ActorsAPI.md#ActGet) | **Get** /v2/actors/{actorId} | Get Actor -[**ActPut**](ActorsAPI.md#ActPut) | **Put** /v2/actors/{actorId} | Update Actor -[**ActValidateInputPost**](ActorsAPI.md#ActValidateInputPost) | **Post** /v2/actors/{actorId}/validate-input | Validate Actor input -[**ActsGet**](ActorsAPI.md#ActsGet) | **Get** /v2/actors | Get list of Actors -[**ActsPost**](ActorsAPI.md#ActsPost) | **Post** /v2/actors | Create Actor - - - -## ActDelete - -> map[string]interface{} ActDelete(ctx, actorId).Execute() - -Delete Actor - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - actorId := "janedoe~my-actor" // string | Actor ID or a tilde-separated owner's username and Actor name. - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.ActorsAPI.ActDelete(context.Background(), actorId).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `ActorsAPI.ActDelete``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `ActDelete`: map[string]interface{} - fmt.Fprintf(os.Stdout, "Response from `ActorsAPI.ActDelete`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**actorId** | **string** | Actor ID or a tilde-separated owner's username and Actor name. | - -### Other Parameters - -Other parameters are passed through a pointer to a apiActDeleteRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - -### Return type - -**map[string]interface{}** - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## ActGet - -> ActorResponse ActGet(ctx, actorId).Execute() - -Get Actor - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - actorId := "janedoe~my-actor" // string | Actor ID or a tilde-separated owner's username and Actor name. - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.ActorsAPI.ActGet(context.Background(), actorId).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `ActorsAPI.ActGet``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `ActGet`: ActorResponse - fmt.Fprintf(os.Stdout, "Response from `ActorsAPI.ActGet`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**actorId** | **string** | Actor ID or a tilde-separated owner's username and Actor name. | - -### Other Parameters - -Other parameters are passed through a pointer to a apiActGetRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - -### Return type - -[**ActorResponse**](ActorResponse.md) - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## ActPut - -> ActorResponse ActPut(ctx, actorId).UpdateActorRequest(updateActorRequest).Execute() - -Update Actor - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - actorId := "janedoe~my-actor" // string | Actor ID or a tilde-separated owner's username and Actor name. - updateActorRequest := *openapiclient.NewUpdateActorRequest() // UpdateActorRequest | - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.ActorsAPI.ActPut(context.Background(), actorId).UpdateActorRequest(updateActorRequest).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `ActorsAPI.ActPut``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `ActPut`: ActorResponse - fmt.Fprintf(os.Stdout, "Response from `ActorsAPI.ActPut`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**actorId** | **string** | Actor ID or a tilde-separated owner's username and Actor name. | - -### Other Parameters - -Other parameters are passed through a pointer to a apiActPutRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - **updateActorRequest** | [**UpdateActorRequest**](UpdateActorRequest.md) | | - -### Return type - -[**ActorResponse**](ActorResponse.md) - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## ActValidateInputPost - -> ActValidateInputPost200Response ActValidateInputPost(ctx, actorId).Body(body).Build(build).Execute() - -Validate Actor input - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - actorId := "janedoe~my-actor" // string | Actor ID or a tilde-separated owner's username and Actor name. - body := map[string]interface{}{ ... } // map[string]interface{} | JSON input to validate against the Actor's input schema. - build := "latest" // string | Optional tag or number of the Actor build to use for input schema validation. By default, the `latest` build tag is used. (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.ActorsAPI.ActValidateInputPost(context.Background(), actorId).Body(body).Build(build).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `ActorsAPI.ActValidateInputPost``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `ActValidateInputPost`: ActValidateInputPost200Response - fmt.Fprintf(os.Stdout, "Response from `ActorsAPI.ActValidateInputPost`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**actorId** | **string** | Actor ID or a tilde-separated owner's username and Actor name. | - -### Other Parameters - -Other parameters are passed through a pointer to a apiActValidateInputPostRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - **body** | **map[string]interface{}** | JSON input to validate against the Actor's input schema. | - **build** | **string** | Optional tag or number of the Actor build to use for input schema validation. By default, the `latest` build tag is used. | - -### Return type - -[**ActValidateInputPost200Response**](ActValidateInputPost200Response.md) - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## ActsGet - -> ListOfActorsResponse ActsGet(ctx).My(my).Offset(offset).Limit(limit).Desc(desc).SortBy(sortBy).Execute() - -Get list of Actors - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - my := true // bool | If `true` or `1` then the returned list only contains Actors owned by the user. The default value is `false`. (optional) - offset := float64(0) // float64 | Number of items that should be skipped at the start. The default value is `0`. (optional) - limit := float64(1000) // float64 | Maximum number of items to return. The default value as well as the maximum is `1000`. (optional) - desc := true // bool | If `true` or `1` then the objects are sorted by the `createdAt` field in descending order. By default, they are sorted in ascending order. (optional) - sortBy := "createdAt" // string | Field to sort the records by. The default is `createdAt`. You can also use `stats.lastRunStartedAt` to sort by the most recently ran Actors. (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.ActorsAPI.ActsGet(context.Background()).My(my).Offset(offset).Limit(limit).Desc(desc).SortBy(sortBy).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `ActorsAPI.ActsGet``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `ActsGet`: ListOfActorsResponse - fmt.Fprintf(os.Stdout, "Response from `ActorsAPI.ActsGet`: %v\n", resp) -} -``` - -### Path Parameters - - - -### Other Parameters - -Other parameters are passed through a pointer to a apiActsGetRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **my** | **bool** | If `true` or `1` then the returned list only contains Actors owned by the user. The default value is `false`. | - **offset** | **float64** | Number of items that should be skipped at the start. The default value is `0`. | - **limit** | **float64** | Maximum number of items to return. The default value as well as the maximum is `1000`. | - **desc** | **bool** | If `true` or `1` then the objects are sorted by the `createdAt` field in descending order. By default, they are sorted in ascending order. | - **sortBy** | **string** | Field to sort the records by. The default is `createdAt`. You can also use `stats.lastRunStartedAt` to sort by the most recently ran Actors. | - -### Return type - -[**ListOfActorsResponse**](ListOfActorsResponse.md) - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## ActsPost - -> ActorResponse ActsPost(ctx).CreateActorRequest(createActorRequest).Execute() - -Create Actor - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - createActorRequest := *openapiclient.NewCreateActorRequest() // CreateActorRequest | - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.ActorsAPI.ActsPost(context.Background()).CreateActorRequest(createActorRequest).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `ActorsAPI.ActsPost``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `ActsPost`: ActorResponse - fmt.Fprintf(os.Stdout, "Response from `ActorsAPI.ActsPost`: %v\n", resp) -} -``` - -### Path Parameters - - - -### Other Parameters - -Other parameters are passed through a pointer to a apiActsPostRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **createActorRequest** | [**CreateActorRequest**](CreateActorRequest.md) | | - -### Return type - -[**ActorResponse**](ActorResponse.md) - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - diff --git a/docs/ActorsActorBuildsAPI.md b/docs/ActorsActorBuildsAPI.md deleted file mode 100644 index 600b41b..0000000 --- a/docs/ActorsActorBuildsAPI.md +++ /dev/null @@ -1,463 +0,0 @@ -# \ActorsActorBuildsAPI - -All URIs are relative to *https://api.apify.com* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**ActBuildAbortPost**](ActorsActorBuildsAPI.md#ActBuildAbortPost) | **Post** /v2/actors/{actorId}/builds/{buildId}/abort | Abort build -[**ActBuildDefaultGet**](ActorsActorBuildsAPI.md#ActBuildDefaultGet) | **Get** /v2/actors/{actorId}/builds/default | Get default build -[**ActBuildGet**](ActorsActorBuildsAPI.md#ActBuildGet) | **Get** /v2/actors/{actorId}/builds/{buildId} | Get build -[**ActBuildsGet**](ActorsActorBuildsAPI.md#ActBuildsGet) | **Get** /v2/actors/{actorId}/builds | Get list of builds -[**ActBuildsPost**](ActorsActorBuildsAPI.md#ActBuildsPost) | **Post** /v2/actors/{actorId}/builds | Build Actor -[**ActOpenapiJsonGet**](ActorsActorBuildsAPI.md#ActOpenapiJsonGet) | **Get** /v2/actors/{actorId}/builds/{buildId}/openapi.json | Get OpenAPI definition - - - -## ActBuildAbortPost - -> BuildResponse ActBuildAbortPost(ctx, actorId, buildId).Execute() - -Abort build - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - actorId := "janedoe~my-actor" // string | Actor ID or a tilde-separated owner's username and Actor name. - buildId := "soSkq9ekdmfOslopH" // string | ID of the build, found in the build's Info tab. - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.ActorsActorBuildsAPI.ActBuildAbortPost(context.Background(), actorId, buildId).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `ActorsActorBuildsAPI.ActBuildAbortPost``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `ActBuildAbortPost`: BuildResponse - fmt.Fprintf(os.Stdout, "Response from `ActorsActorBuildsAPI.ActBuildAbortPost`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**actorId** | **string** | Actor ID or a tilde-separated owner's username and Actor name. | -**buildId** | **string** | ID of the build, found in the build's Info tab. | - -### Other Parameters - -Other parameters are passed through a pointer to a apiActBuildAbortPostRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - - -### Return type - -[**BuildResponse**](BuildResponse.md) - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## ActBuildDefaultGet - -> BuildResponse ActBuildDefaultGet(ctx, actorId).WaitForFinish(waitForFinish).Execute() - -Get default build - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - actorId := "janedoe~my-actor" // string | Actor ID or a tilde-separated owner's username and Actor name. - waitForFinish := float64(60) // float64 | The maximum number of seconds the server waits for the build to finish. By default it is `0`, the maximum value is `60`. <!-- MAX_ACTOR_JOB_ASYNC_WAIT_SECS --> If the build finishes in time then the returned build object will have a terminal status (e.g. `SUCCEEDED`), otherwise it will have a transitional status (e.g. `RUNNING`). (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.ActorsActorBuildsAPI.ActBuildDefaultGet(context.Background(), actorId).WaitForFinish(waitForFinish).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `ActorsActorBuildsAPI.ActBuildDefaultGet``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `ActBuildDefaultGet`: BuildResponse - fmt.Fprintf(os.Stdout, "Response from `ActorsActorBuildsAPI.ActBuildDefaultGet`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**actorId** | **string** | Actor ID or a tilde-separated owner's username and Actor name. | - -### Other Parameters - -Other parameters are passed through a pointer to a apiActBuildDefaultGetRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - **waitForFinish** | **float64** | The maximum number of seconds the server waits for the build to finish. By default it is `0`, the maximum value is `60`. <!-- MAX_ACTOR_JOB_ASYNC_WAIT_SECS --> If the build finishes in time then the returned build object will have a terminal status (e.g. `SUCCEEDED`), otherwise it will have a transitional status (e.g. `RUNNING`). | - -### Return type - -[**BuildResponse**](BuildResponse.md) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## ActBuildGet - -> BuildResponse ActBuildGet(ctx, actorId, buildId).WaitForFinish(waitForFinish).Execute() - -Get build - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - actorId := "janedoe~my-actor" // string | Actor ID or a tilde-separated owner's username and Actor name. - buildId := "soSkq9ekdmfOslopH" // string | ID of the build, found in the build's Info tab. - waitForFinish := float64(60) // float64 | The maximum number of seconds the server waits for the build to finish. By default it is `0`, the maximum value is `60`. <!-- MAX_ACTOR_JOB_ASYNC_WAIT_SECS --> If the build finishes in time then the returned build object will have a terminal status (e.g. `SUCCEEDED`), otherwise it will have a transitional status (e.g. `RUNNING`). (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.ActorsActorBuildsAPI.ActBuildGet(context.Background(), actorId, buildId).WaitForFinish(waitForFinish).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `ActorsActorBuildsAPI.ActBuildGet``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `ActBuildGet`: BuildResponse - fmt.Fprintf(os.Stdout, "Response from `ActorsActorBuildsAPI.ActBuildGet`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**actorId** | **string** | Actor ID or a tilde-separated owner's username and Actor name. | -**buildId** | **string** | ID of the build, found in the build's Info tab. | - -### Other Parameters - -Other parameters are passed through a pointer to a apiActBuildGetRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - - **waitForFinish** | **float64** | The maximum number of seconds the server waits for the build to finish. By default it is `0`, the maximum value is `60`. <!-- MAX_ACTOR_JOB_ASYNC_WAIT_SECS --> If the build finishes in time then the returned build object will have a terminal status (e.g. `SUCCEEDED`), otherwise it will have a transitional status (e.g. `RUNNING`). | - -### Return type - -[**BuildResponse**](BuildResponse.md) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## ActBuildsGet - -> ListOfBuildsResponse ActBuildsGet(ctx, actorId).Offset(offset).Limit(limit).Desc(desc).Execute() - -Get list of builds - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - actorId := "janedoe~my-actor" // string | Actor ID or a tilde-separated owner's username and Actor name. - offset := float64(0) // float64 | Number of items that should be skipped at the start. The default value is `0`. (optional) - limit := float64(1000) // float64 | Maximum number of items to return. The default value as well as the maximum is `1000`. (optional) - desc := true // bool | If `true` or `1` then the objects are sorted by the `startedAt` field in descending order. By default, they are sorted in ascending order. (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.ActorsActorBuildsAPI.ActBuildsGet(context.Background(), actorId).Offset(offset).Limit(limit).Desc(desc).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `ActorsActorBuildsAPI.ActBuildsGet``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `ActBuildsGet`: ListOfBuildsResponse - fmt.Fprintf(os.Stdout, "Response from `ActorsActorBuildsAPI.ActBuildsGet`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**actorId** | **string** | Actor ID or a tilde-separated owner's username and Actor name. | - -### Other Parameters - -Other parameters are passed through a pointer to a apiActBuildsGetRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - **offset** | **float64** | Number of items that should be skipped at the start. The default value is `0`. | - **limit** | **float64** | Maximum number of items to return. The default value as well as the maximum is `1000`. | - **desc** | **bool** | If `true` or `1` then the objects are sorted by the `startedAt` field in descending order. By default, they are sorted in ascending order. | - -### Return type - -[**ListOfBuildsResponse**](ListOfBuildsResponse.md) - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## ActBuildsPost - -> BuildResponse ActBuildsPost(ctx, actorId).Version(version).UseCache(useCache).BetaPackages(betaPackages).Tag(tag).WaitForFinish(waitForFinish).Execute() - -Build Actor - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - actorId := "janedoe~my-actor" // string | Actor ID or a tilde-separated owner's username and Actor name. - version := "0.0" // string | Actor version number to be built. - useCache := true // bool | If `true` or `1`, the system will use a cache to speed up the build process. By default, cache is not used. (optional) - betaPackages := true // bool | If `true` or `1` then the Actor is built with beta versions of Apify NPM packages. By default, the build uses `latest` packages. (optional) - tag := "latest" // string | Tag to be applied to the build on success. By default, the tag is taken from Actor version's `buildTag` property. (optional) - waitForFinish := float64(60) // float64 | The maximum number of seconds the server waits for the build to finish. By default it is `0`, the maximum value is `60`. <!-- MAX_ACTOR_JOB_ASYNC_WAIT_SECS --> If the build finishes in time then the returned build object will have a terminal status (e.g. `SUCCEEDED`), otherwise it will have a transitional status (e.g. `RUNNING`). (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.ActorsActorBuildsAPI.ActBuildsPost(context.Background(), actorId).Version(version).UseCache(useCache).BetaPackages(betaPackages).Tag(tag).WaitForFinish(waitForFinish).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `ActorsActorBuildsAPI.ActBuildsPost``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `ActBuildsPost`: BuildResponse - fmt.Fprintf(os.Stdout, "Response from `ActorsActorBuildsAPI.ActBuildsPost`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**actorId** | **string** | Actor ID or a tilde-separated owner's username and Actor name. | - -### Other Parameters - -Other parameters are passed through a pointer to a apiActBuildsPostRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - **version** | **string** | Actor version number to be built. | - **useCache** | **bool** | If `true` or `1`, the system will use a cache to speed up the build process. By default, cache is not used. | - **betaPackages** | **bool** | If `true` or `1` then the Actor is built with beta versions of Apify NPM packages. By default, the build uses `latest` packages. | - **tag** | **string** | Tag to be applied to the build on success. By default, the tag is taken from Actor version's `buildTag` property. | - **waitForFinish** | **float64** | The maximum number of seconds the server waits for the build to finish. By default it is `0`, the maximum value is `60`. <!-- MAX_ACTOR_JOB_ASYNC_WAIT_SECS --> If the build finishes in time then the returned build object will have a terminal status (e.g. `SUCCEEDED`), otherwise it will have a transitional status (e.g. `RUNNING`). | - -### Return type - -[**BuildResponse**](BuildResponse.md) - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## ActOpenapiJsonGet - -> map[string]interface{} ActOpenapiJsonGet(ctx, actorId, buildId).Execute() - -Get OpenAPI definition - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - actorId := "janedoe~my-actor" // string | Actor ID or a tilde-separated owner's username and Actor name. - buildId := "soSkq9ekdmfOslopH" // string | ID of the build, found in the build's Info tab. Use the special value `default` to get the OpenAPI schema for the Actor's default build. - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.ActorsActorBuildsAPI.ActOpenapiJsonGet(context.Background(), actorId, buildId).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `ActorsActorBuildsAPI.ActOpenapiJsonGet``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `ActOpenapiJsonGet`: map[string]interface{} - fmt.Fprintf(os.Stdout, "Response from `ActorsActorBuildsAPI.ActOpenapiJsonGet`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**actorId** | **string** | Actor ID or a tilde-separated owner's username and Actor name. | -**buildId** | **string** | ID of the build, found in the build's Info tab. Use the special value `default` to get the OpenAPI schema for the Actor's default build. | - -### Other Parameters - -Other parameters are passed through a pointer to a apiActOpenapiJsonGetRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - - -### Return type - -**map[string]interface{}** - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - diff --git a/docs/ActorsActorRunsAPI.md b/docs/ActorsActorRunsAPI.md deleted file mode 100644 index 67a3fad..0000000 --- a/docs/ActorsActorRunsAPI.md +++ /dev/null @@ -1,1010 +0,0 @@ -# \ActorsActorRunsAPI - -All URIs are relative to *https://api.apify.com* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**ActRunAbortPost**](ActorsActorRunsAPI.md#ActRunAbortPost) | **Post** /v2/actors/{actorId}/runs/{runId}/abort | Abort run -[**ActRunGet**](ActorsActorRunsAPI.md#ActRunGet) | **Get** /v2/actors/{actorId}/runs/{runId} | Get run -[**ActRunMetamorphPost**](ActorsActorRunsAPI.md#ActRunMetamorphPost) | **Post** /v2/actors/{actorId}/runs/{runId}/metamorph | Metamorph run -[**ActRunResurrectPost**](ActorsActorRunsAPI.md#ActRunResurrectPost) | **Post** /v2/actors/{actorId}/runs/{runId}/resurrect | Resurrect run -[**ActRunSyncGet**](ActorsActorRunsAPI.md#ActRunSyncGet) | **Get** /v2/actors/{actorId}/run-sync | Run Actor synchronously without input -[**ActRunSyncGetDatasetItemsGet**](ActorsActorRunsAPI.md#ActRunSyncGetDatasetItemsGet) | **Get** /v2/actors/{actorId}/run-sync-get-dataset-items | Run Actor synchronously without input and get dataset items -[**ActRunSyncGetDatasetItemsPost**](ActorsActorRunsAPI.md#ActRunSyncGetDatasetItemsPost) | **Post** /v2/actors/{actorId}/run-sync-get-dataset-items | Run Actor synchronously and get dataset items -[**ActRunSyncPost**](ActorsActorRunsAPI.md#ActRunSyncPost) | **Post** /v2/actors/{actorId}/run-sync | Run Actor synchronously and return output -[**ActRunsGet**](ActorsActorRunsAPI.md#ActRunsGet) | **Get** /v2/actors/{actorId}/runs | Get list of runs -[**ActRunsLastGet**](ActorsActorRunsAPI.md#ActRunsLastGet) | **Get** /v2/actors/{actorId}/runs/last | Get last run -[**ActRunsPost**](ActorsActorRunsAPI.md#ActRunsPost) | **Post** /v2/actors/{actorId}/runs | Run Actor - - - -## ActRunAbortPost - -> RunResponse ActRunAbortPost(ctx, actorId, runId).Gracefully(gracefully).Execute() - -Abort run - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - actorId := "janedoe~my-actor" // string | Actor ID or a tilde-separated owner's username and Actor name. - runId := "3KH8gEpp4d8uQSe8T" // string | Actor run ID. - gracefully := true // bool | If true passed, the Actor run will abort gracefully. It will send `aborting` and `persistState` event into run and force-stop the run after 30 seconds. It is helpful in cases where you plan to resurrect the run later. (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.ActorsActorRunsAPI.ActRunAbortPost(context.Background(), actorId, runId).Gracefully(gracefully).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `ActorsActorRunsAPI.ActRunAbortPost``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `ActRunAbortPost`: RunResponse - fmt.Fprintf(os.Stdout, "Response from `ActorsActorRunsAPI.ActRunAbortPost`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**actorId** | **string** | Actor ID or a tilde-separated owner's username and Actor name. | -**runId** | **string** | Actor run ID. | - -### Other Parameters - -Other parameters are passed through a pointer to a apiActRunAbortPostRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - - **gracefully** | **bool** | If true passed, the Actor run will abort gracefully. It will send `aborting` and `persistState` event into run and force-stop the run after 30 seconds. It is helpful in cases where you plan to resurrect the run later. | - -### Return type - -[**RunResponse**](RunResponse.md) - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## ActRunGet - -> RunResponse ActRunGet(ctx, actorId, runId).WaitForFinish(waitForFinish).Execute() - -Get run - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - actorId := "janedoe~my-actor" // string | Actor ID or a tilde-separated owner's username and Actor name. - runId := "3KH8gEpp4d8uQSe8T" // string | Actor run ID. - waitForFinish := float64(60) // float64 | The maximum number of seconds the server waits for the run to finish. By default it is `0`, the maximum value is `60`. <!-- MAX_ACTOR_JOB_ASYNC_WAIT_SECS --> If the run finishes in time then the returned run object will have a terminal status (e.g. `SUCCEEDED`), otherwise it will have a transitional status (e.g. `RUNNING`). (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.ActorsActorRunsAPI.ActRunGet(context.Background(), actorId, runId).WaitForFinish(waitForFinish).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `ActorsActorRunsAPI.ActRunGet``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `ActRunGet`: RunResponse - fmt.Fprintf(os.Stdout, "Response from `ActorsActorRunsAPI.ActRunGet`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**actorId** | **string** | Actor ID or a tilde-separated owner's username and Actor name. | -**runId** | **string** | Actor run ID. | - -### Other Parameters - -Other parameters are passed through a pointer to a apiActRunGetRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - - **waitForFinish** | **float64** | The maximum number of seconds the server waits for the run to finish. By default it is `0`, the maximum value is `60`. <!-- MAX_ACTOR_JOB_ASYNC_WAIT_SECS --> If the run finishes in time then the returned run object will have a terminal status (e.g. `SUCCEEDED`), otherwise it will have a transitional status (e.g. `RUNNING`). | - -### Return type - -[**RunResponse**](RunResponse.md) - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## ActRunMetamorphPost - -> RunResponse ActRunMetamorphPost(ctx, actorId, runId).TargetActorId(targetActorId).Build(build).Execute() - -Metamorph run - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - actorId := "janedoe~my-actor" // string | Actor ID or a tilde-separated owner's username and Actor name. - runId := "3KH8gEpp4d8uQSe8T" // string | Actor run ID. - targetActorId := "HDSasDasz78YcAPEB" // string | ID of a target Actor that the run should be transformed into. - build := "beta" // string | Optional build of the target Actor. It can be either a build tag or build number. By default, the run uses the build specified in the default run configuration for the target Actor (typically `latest`). (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.ActorsActorRunsAPI.ActRunMetamorphPost(context.Background(), actorId, runId).TargetActorId(targetActorId).Build(build).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `ActorsActorRunsAPI.ActRunMetamorphPost``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `ActRunMetamorphPost`: RunResponse - fmt.Fprintf(os.Stdout, "Response from `ActorsActorRunsAPI.ActRunMetamorphPost`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**actorId** | **string** | Actor ID or a tilde-separated owner's username and Actor name. | -**runId** | **string** | Actor run ID. | - -### Other Parameters - -Other parameters are passed through a pointer to a apiActRunMetamorphPostRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - - **targetActorId** | **string** | ID of a target Actor that the run should be transformed into. | - **build** | **string** | Optional build of the target Actor. It can be either a build tag or build number. By default, the run uses the build specified in the default run configuration for the target Actor (typically `latest`). | - -### Return type - -[**RunResponse**](RunResponse.md) - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## ActRunResurrectPost - -> RunResponse ActRunResurrectPost(ctx, actorId, runId).Build(build).Timeout(timeout).Memory(memory).RestartOnError(restartOnError).Execute() - -Resurrect run - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - actorId := "janedoe~my-actor" // string | Actor ID or a tilde-separated owner's username and Actor name. - runId := "3KH8gEpp4d8uQSe8T" // string | Actor run ID. - build := "0.1.234" // string | Specifies the Actor build to run. It can be either a build tag or build number. By default, the run is resurrected with the same build it originally used. Specifically, if a run was first started with the `latest` tag, which resolves to version `0.0.3` at the time, a run resurrected without this parameter will continue running with `0.0.3`, even if `latest` already points to a newer build. (optional) - timeout := float64(60) // float64 | Optional timeout for the run, in seconds. By default, the run uses the timeout specified in the run that is being resurrected. (optional) - memory := float64(256) // float64 | Memory limit for the run, in megabytes. The amount of memory can be set to a power of 2 with a minimum of 128. By default, the run uses the memory limit specified in the run that is being resurrected. (optional) - restartOnError := false // bool | Determines whether the resurrected run will be restarted if it fails. By default, the resurrected run uses the same setting as before. (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.ActorsActorRunsAPI.ActRunResurrectPost(context.Background(), actorId, runId).Build(build).Timeout(timeout).Memory(memory).RestartOnError(restartOnError).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `ActorsActorRunsAPI.ActRunResurrectPost``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `ActRunResurrectPost`: RunResponse - fmt.Fprintf(os.Stdout, "Response from `ActorsActorRunsAPI.ActRunResurrectPost`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**actorId** | **string** | Actor ID or a tilde-separated owner's username and Actor name. | -**runId** | **string** | Actor run ID. | - -### Other Parameters - -Other parameters are passed through a pointer to a apiActRunResurrectPostRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - - **build** | **string** | Specifies the Actor build to run. It can be either a build tag or build number. By default, the run is resurrected with the same build it originally used. Specifically, if a run was first started with the `latest` tag, which resolves to version `0.0.3` at the time, a run resurrected without this parameter will continue running with `0.0.3`, even if `latest` already points to a newer build. | - **timeout** | **float64** | Optional timeout for the run, in seconds. By default, the run uses the timeout specified in the run that is being resurrected. | - **memory** | **float64** | Memory limit for the run, in megabytes. The amount of memory can be set to a power of 2 with a minimum of 128. By default, the run uses the memory limit specified in the run that is being resurrected. | - **restartOnError** | **bool** | Determines whether the resurrected run will be restarted if it fails. By default, the resurrected run uses the same setting as before. | - -### Return type - -[**RunResponse**](RunResponse.md) - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## ActRunSyncGet - -> map[string]interface{} ActRunSyncGet(ctx, actorId).OutputRecordKey(outputRecordKey).Timeout(timeout).Memory(memory).MaxItems(maxItems).MaxTotalChargeUsd(maxTotalChargeUsd).RestartOnError(restartOnError).Build(build).Webhooks(webhooks).Execute() - -Run Actor synchronously without input - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - actorId := "janedoe~my-actor" // string | Actor ID or a tilde-separated owner's username and Actor name. - outputRecordKey := "OUTPUT" // string | Key of the record from run's default key-value store to be returned in the response. By default, it is `OUTPUT`. (optional) - timeout := float64(60) // float64 | Optional timeout for the run, in seconds. By default, the run uses the timeout from its configuration. (optional) - memory := float64(256) // float64 | Memory limit for the run, in megabytes. The amount of memory can be set to a power of 2 with a minimum of 128. By default, the run uses the memory limit from its configuration. (optional) - maxItems := float64(1000) // float64 | Specifies the maximum number of dataset items that will be charged for pay-per-result Actors. This does NOT guarantee that the Actor will return only this many items. It only ensures you won't be charged for more than this number of items. Only works for pay-per-result Actors. Value can be accessed in the actor run using `ACTOR_MAX_PAID_DATASET_ITEMS` environment variable. (optional) - maxTotalChargeUsd := float64(5) // float64 | Specifies the maximum cost of the run. This parameter is useful for pay-per-event Actors, as it allows you to limit the amount charged to your subscription. You can access the maximum cost in your Actor by using the `ACTOR_MAX_TOTAL_CHARGE_USD` environment variable. (optional) - restartOnError := false // bool | Determines whether the run will be restarted if it fails. (optional) - build := "0.1.234" // string | Specifies the Actor build to run. It can be either a build tag or build number. By default, the run uses the build from its configuration (typically `latest`). (optional) - webhooks := "dGhpcyBpcyBqdXN0IGV4YW1wbGUK..." // string | Specifies optional webhooks associated with the Actor run, which can be used to receive a notification e.g. when the Actor finished or failed. The value is a Base64-encoded JSON array whose items follow the WebhookRepresentation schema. For more information, see [Webhooks documentation](https://docs.apify.com/platform/integrations/webhooks). (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.ActorsActorRunsAPI.ActRunSyncGet(context.Background(), actorId).OutputRecordKey(outputRecordKey).Timeout(timeout).Memory(memory).MaxItems(maxItems).MaxTotalChargeUsd(maxTotalChargeUsd).RestartOnError(restartOnError).Build(build).Webhooks(webhooks).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `ActorsActorRunsAPI.ActRunSyncGet``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `ActRunSyncGet`: map[string]interface{} - fmt.Fprintf(os.Stdout, "Response from `ActorsActorRunsAPI.ActRunSyncGet`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**actorId** | **string** | Actor ID or a tilde-separated owner's username and Actor name. | - -### Other Parameters - -Other parameters are passed through a pointer to a apiActRunSyncGetRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - **outputRecordKey** | **string** | Key of the record from run's default key-value store to be returned in the response. By default, it is `OUTPUT`. | - **timeout** | **float64** | Optional timeout for the run, in seconds. By default, the run uses the timeout from its configuration. | - **memory** | **float64** | Memory limit for the run, in megabytes. The amount of memory can be set to a power of 2 with a minimum of 128. By default, the run uses the memory limit from its configuration. | - **maxItems** | **float64** | Specifies the maximum number of dataset items that will be charged for pay-per-result Actors. This does NOT guarantee that the Actor will return only this many items. It only ensures you won't be charged for more than this number of items. Only works for pay-per-result Actors. Value can be accessed in the actor run using `ACTOR_MAX_PAID_DATASET_ITEMS` environment variable. | - **maxTotalChargeUsd** | **float64** | Specifies the maximum cost of the run. This parameter is useful for pay-per-event Actors, as it allows you to limit the amount charged to your subscription. You can access the maximum cost in your Actor by using the `ACTOR_MAX_TOTAL_CHARGE_USD` environment variable. | - **restartOnError** | **bool** | Determines whether the run will be restarted if it fails. | - **build** | **string** | Specifies the Actor build to run. It can be either a build tag or build number. By default, the run uses the build from its configuration (typically `latest`). | - **webhooks** | **string** | Specifies optional webhooks associated with the Actor run, which can be used to receive a notification e.g. when the Actor finished or failed. The value is a Base64-encoded JSON array whose items follow the WebhookRepresentation schema. For more information, see [Webhooks documentation](https://docs.apify.com/platform/integrations/webhooks). | - -### Return type - -**map[string]interface{}** - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## ActRunSyncGetDatasetItemsGet - -> []map[string]interface{} ActRunSyncGetDatasetItemsGet(ctx, actorId).Timeout(timeout).Memory(memory).MaxItems(maxItems).MaxTotalChargeUsd(maxTotalChargeUsd).RestartOnError(restartOnError).Build(build).Webhooks(webhooks).Format(format).Clean(clean).Offset(offset).Limit(limit).Fields(fields).OutputFields(outputFields).Omit(omit).Unwind(unwind).Flatten(flatten).Desc(desc).Attachment(attachment).Delimiter(delimiter).Bom(bom).XmlRoot(xmlRoot).XmlRow(xmlRow).SkipHeaderRow(skipHeaderRow).SkipHidden(skipHidden).SkipEmpty(skipEmpty).Simplified(simplified).View(view).SkipFailedPages(skipFailedPages).FeedTitle(feedTitle).FeedDescription(feedDescription).Execute() - -Run Actor synchronously without input and get dataset items - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - actorId := "janedoe~my-actor" // string | Actor ID or a tilde-separated owner's username and Actor name. - timeout := float64(60) // float64 | Optional timeout for the run, in seconds. By default, the run uses the timeout from its configuration. (optional) - memory := float64(256) // float64 | Memory limit for the run, in megabytes. The amount of memory can be set to a power of 2 with a minimum of 128. By default, the run uses the memory limit from its configuration. (optional) - maxItems := float64(1000) // float64 | Specifies the maximum number of dataset items that will be charged for pay-per-result Actors. This does NOT guarantee that the Actor will return only this many items. It only ensures you won't be charged for more than this number of items. Only works for pay-per-result Actors. Value can be accessed in the actor run using `ACTOR_MAX_PAID_DATASET_ITEMS` environment variable. (optional) - maxTotalChargeUsd := float64(5) // float64 | Specifies the maximum cost of the run. This parameter is useful for pay-per-event Actors, as it allows you to limit the amount charged to your subscription. You can access the maximum cost in your Actor by using the `ACTOR_MAX_TOTAL_CHARGE_USD` environment variable. (optional) - restartOnError := false // bool | Determines whether the run will be restarted if it fails. (optional) - build := "0.1.234" // string | Specifies the Actor build to run. It can be either a build tag or build number. By default, the run uses the build from its configuration (typically `latest`). (optional) - webhooks := "dGhpcyBpcyBqdXN0IGV4YW1wbGUK..." // string | Specifies optional webhooks associated with the Actor run, which can be used to receive a notification e.g. when the Actor finished or failed. The value is a Base64-encoded JSON array whose items follow the WebhookRepresentation schema. For more information, see [Webhooks documentation](https://docs.apify.com/platform/integrations/webhooks). (optional) - format := "json" // string | Format of the results, possible values are: `json`, `jsonl`, `csv`, `html`, `xlsx`, `xml` and `rss`. The default value is `json`. (optional) - clean := false // bool | If `true` or `1` then the API endpoint returns only non-empty items and skips hidden fields (i.e. fields starting with the # character). The `clean` parameter is just a shortcut for `skipHidden=true` and `skipEmpty=true` parameters. Note that since some objects might be skipped from the output, that the result might contain less items than the `limit` value. (optional) - offset := float64(0) // float64 | Number of items that should be skipped at the start. The default value is `0`. (optional) - limit := float64(1.2) // float64 | Maximum number of items to return. By default there is no limit. (optional) - fields := "myValue,myOtherValue" // string | A comma-separated list of fields which should be picked from the items, only these fields will remain in the resulting record objects. Note that the fields in the outputted items are sorted the same way as they are specified in the `fields` query parameter. You can use this feature to effectively fix the output format. (optional) - outputFields := "title,link" // string | A comma-separated list of output field names that positionally rename the fields specified in the `fields` parameter. For example, `?fields=headline,url&outputFields=title,link` renames `headline` to `title` and `url` to `link` in the output. The number of names in `outputFields` must match the number of names in `fields`. Requires the `fields` parameter to be specified as well. (optional) - omit := "myValue,myOtherValue" // string | A comma-separated list of fields which should be omitted from the items. (optional) - unwind := "myValue,myOtherValue" // string | A comma-separated list of fields which should be unwound, in order which they should be processed. Each field should be either an array or an object. If the field is an array then every element of the array will become a separate record and merged with parent object. If the unwound field is an object then it is merged with the parent object. If the unwound field is missing or its value is neither an array nor an object and therefore cannot be merged with a parent object then the item gets preserved as it is. Note that the unwound items ignore the `desc` parameter. (optional) - flatten := "myValue" // string | A comma-separated list of fields which should transform nested objects into flat structures. For example, with `flatten=\"foo\"` the object `{\"foo\":{\"bar\": \"hello\"}}` is turned into `{\"foo.bar\": \"hello\"}`. The original object with properties is replaced with the flattened object. (optional) - desc := true // bool | By default, results are returned in the same order as they were stored. To reverse the order, set this parameter to `true` or `1`. (optional) - attachment := true // bool | If `true` or `1` then the response will define the `Content-Disposition: attachment` header, forcing a web browser to download the file rather than to display it. By default this header is not present. (optional) - delimiter := ";" // string | A delimiter character for CSV files, only used if `format=csv`. You might need to URL-encode the character (e.g. use `%09` for tab or `%3B` for semicolon). The default delimiter is a simple comma (`,`). (optional) - bom := false // bool | All text responses are encoded in UTF-8 encoding. By default, the `format=csv` files are prefixed with the UTF-8 Byte Order Mark (BOM), while `json`, `jsonl`, `xml`, `html` and `rss` files are not. If you want to override this default behavior, specify `bom=1` query parameter to include the BOM or `bom=0` to skip it. (optional) - xmlRoot := "items" // string | Overrides default root element name of `xml` output. By default the root element is `items`. (optional) - xmlRow := "item" // string | Overrides default element name that wraps each page or page function result object in `xml` output. By default the element name is `item`. (optional) - skipHeaderRow := true // bool | If `true` or `1` then header row in the `csv` format is skipped. (optional) - skipHidden := false // bool | If `true` or `1` then hidden fields are skipped from the output, i.e. fields starting with the `#` character. (optional) - skipEmpty := false // bool | If `true` or `1` then empty items are skipped from the output. Note that if used, the results might contain less items than the limit value. (optional) - simplified := false // bool | If `true` or `1` then, the endpoint applies the `fields=url,pageFunctionResult,errorInfo` and `unwind=pageFunctionResult` query parameters. This feature is used to emulate simplified results provided by the legacy Apify Crawler product and it's not recommended to use it in new integrations. (optional) - view := "overview" // string | Defines the view configuration for dataset items based on the schema definition. This parameter determines how the data will be filtered and presented. For complete specification details, see the [dataset schema documentation](/platform/actors/development/actor-definition/dataset-schema). (optional) - skipFailedPages := false // bool | If `true` or `1` then, the all the items with errorInfo property will be skipped from the output. This feature is here to emulate functionality of API version 1 used for the legacy Apify Crawler product and it's not recommended to use it in new integrations. (optional) - feedTitle := "Latest posts from r/pasta" // string | Overrides the auto-generated RSS channel `<title>` element. Only used when `format=rss`. If not provided, the title defaults to `Dataset <label>`. (optional) - feedDescription := "Scraped forum posts" // string | Overrides the auto-generated RSS channel `<description>` element. Only used when `format=rss`. If not provided, the description defaults to `Items in dataset with id \"<datasetId>\".` (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.ActorsActorRunsAPI.ActRunSyncGetDatasetItemsGet(context.Background(), actorId).Timeout(timeout).Memory(memory).MaxItems(maxItems).MaxTotalChargeUsd(maxTotalChargeUsd).RestartOnError(restartOnError).Build(build).Webhooks(webhooks).Format(format).Clean(clean).Offset(offset).Limit(limit).Fields(fields).OutputFields(outputFields).Omit(omit).Unwind(unwind).Flatten(flatten).Desc(desc).Attachment(attachment).Delimiter(delimiter).Bom(bom).XmlRoot(xmlRoot).XmlRow(xmlRow).SkipHeaderRow(skipHeaderRow).SkipHidden(skipHidden).SkipEmpty(skipEmpty).Simplified(simplified).View(view).SkipFailedPages(skipFailedPages).FeedTitle(feedTitle).FeedDescription(feedDescription).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `ActorsActorRunsAPI.ActRunSyncGetDatasetItemsGet``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `ActRunSyncGetDatasetItemsGet`: []map[string]interface{} - fmt.Fprintf(os.Stdout, "Response from `ActorsActorRunsAPI.ActRunSyncGetDatasetItemsGet`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**actorId** | **string** | Actor ID or a tilde-separated owner's username and Actor name. | - -### Other Parameters - -Other parameters are passed through a pointer to a apiActRunSyncGetDatasetItemsGetRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - **timeout** | **float64** | Optional timeout for the run, in seconds. By default, the run uses the timeout from its configuration. | - **memory** | **float64** | Memory limit for the run, in megabytes. The amount of memory can be set to a power of 2 with a minimum of 128. By default, the run uses the memory limit from its configuration. | - **maxItems** | **float64** | Specifies the maximum number of dataset items that will be charged for pay-per-result Actors. This does NOT guarantee that the Actor will return only this many items. It only ensures you won't be charged for more than this number of items. Only works for pay-per-result Actors. Value can be accessed in the actor run using `ACTOR_MAX_PAID_DATASET_ITEMS` environment variable. | - **maxTotalChargeUsd** | **float64** | Specifies the maximum cost of the run. This parameter is useful for pay-per-event Actors, as it allows you to limit the amount charged to your subscription. You can access the maximum cost in your Actor by using the `ACTOR_MAX_TOTAL_CHARGE_USD` environment variable. | - **restartOnError** | **bool** | Determines whether the run will be restarted if it fails. | - **build** | **string** | Specifies the Actor build to run. It can be either a build tag or build number. By default, the run uses the build from its configuration (typically `latest`). | - **webhooks** | **string** | Specifies optional webhooks associated with the Actor run, which can be used to receive a notification e.g. when the Actor finished or failed. The value is a Base64-encoded JSON array whose items follow the WebhookRepresentation schema. For more information, see [Webhooks documentation](https://docs.apify.com/platform/integrations/webhooks). | - **format** | **string** | Format of the results, possible values are: `json`, `jsonl`, `csv`, `html`, `xlsx`, `xml` and `rss`. The default value is `json`. | - **clean** | **bool** | If `true` or `1` then the API endpoint returns only non-empty items and skips hidden fields (i.e. fields starting with the # character). The `clean` parameter is just a shortcut for `skipHidden=true` and `skipEmpty=true` parameters. Note that since some objects might be skipped from the output, that the result might contain less items than the `limit` value. | - **offset** | **float64** | Number of items that should be skipped at the start. The default value is `0`. | - **limit** | **float64** | Maximum number of items to return. By default there is no limit. | - **fields** | **string** | A comma-separated list of fields which should be picked from the items, only these fields will remain in the resulting record objects. Note that the fields in the outputted items are sorted the same way as they are specified in the `fields` query parameter. You can use this feature to effectively fix the output format. | - **outputFields** | **string** | A comma-separated list of output field names that positionally rename the fields specified in the `fields` parameter. For example, `?fields=headline,url&outputFields=title,link` renames `headline` to `title` and `url` to `link` in the output. The number of names in `outputFields` must match the number of names in `fields`. Requires the `fields` parameter to be specified as well. | - **omit** | **string** | A comma-separated list of fields which should be omitted from the items. | - **unwind** | **string** | A comma-separated list of fields which should be unwound, in order which they should be processed. Each field should be either an array or an object. If the field is an array then every element of the array will become a separate record and merged with parent object. If the unwound field is an object then it is merged with the parent object. If the unwound field is missing or its value is neither an array nor an object and therefore cannot be merged with a parent object then the item gets preserved as it is. Note that the unwound items ignore the `desc` parameter. | - **flatten** | **string** | A comma-separated list of fields which should transform nested objects into flat structures. For example, with `flatten=\"foo\"` the object `{\"foo\":{\"bar\": \"hello\"}}` is turned into `{\"foo.bar\": \"hello\"}`. The original object with properties is replaced with the flattened object. | - **desc** | **bool** | By default, results are returned in the same order as they were stored. To reverse the order, set this parameter to `true` or `1`. | - **attachment** | **bool** | If `true` or `1` then the response will define the `Content-Disposition: attachment` header, forcing a web browser to download the file rather than to display it. By default this header is not present. | - **delimiter** | **string** | A delimiter character for CSV files, only used if `format=csv`. You might need to URL-encode the character (e.g. use `%09` for tab or `%3B` for semicolon). The default delimiter is a simple comma (`,`). | - **bom** | **bool** | All text responses are encoded in UTF-8 encoding. By default, the `format=csv` files are prefixed with the UTF-8 Byte Order Mark (BOM), while `json`, `jsonl`, `xml`, `html` and `rss` files are not. If you want to override this default behavior, specify `bom=1` query parameter to include the BOM or `bom=0` to skip it. | - **xmlRoot** | **string** | Overrides default root element name of `xml` output. By default the root element is `items`. | - **xmlRow** | **string** | Overrides default element name that wraps each page or page function result object in `xml` output. By default the element name is `item`. | - **skipHeaderRow** | **bool** | If `true` or `1` then header row in the `csv` format is skipped. | - **skipHidden** | **bool** | If `true` or `1` then hidden fields are skipped from the output, i.e. fields starting with the `#` character. | - **skipEmpty** | **bool** | If `true` or `1` then empty items are skipped from the output. Note that if used, the results might contain less items than the limit value. | - **simplified** | **bool** | If `true` or `1` then, the endpoint applies the `fields=url,pageFunctionResult,errorInfo` and `unwind=pageFunctionResult` query parameters. This feature is used to emulate simplified results provided by the legacy Apify Crawler product and it's not recommended to use it in new integrations. | - **view** | **string** | Defines the view configuration for dataset items based on the schema definition. This parameter determines how the data will be filtered and presented. For complete specification details, see the [dataset schema documentation](/platform/actors/development/actor-definition/dataset-schema). | - **skipFailedPages** | **bool** | If `true` or `1` then, the all the items with errorInfo property will be skipped from the output. This feature is here to emulate functionality of API version 1 used for the legacy Apify Crawler product and it's not recommended to use it in new integrations. | - **feedTitle** | **string** | Overrides the auto-generated RSS channel `<title>` element. Only used when `format=rss`. If not provided, the title defaults to `Dataset <label>`. | - **feedDescription** | **string** | Overrides the auto-generated RSS channel `<description>` element. Only used when `format=rss`. If not provided, the description defaults to `Items in dataset with id \"<datasetId>\".` | - -### Return type - -**[]map[string]interface{}** - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## ActRunSyncGetDatasetItemsPost - -> []map[string]interface{} ActRunSyncGetDatasetItemsPost(ctx, actorId).Body(body).Timeout(timeout).Memory(memory).MaxItems(maxItems).MaxTotalChargeUsd(maxTotalChargeUsd).RestartOnError(restartOnError).Build(build).Webhooks(webhooks).Format(format).Clean(clean).Offset(offset).Limit(limit).Fields(fields).OutputFields(outputFields).Omit(omit).Unwind(unwind).Flatten(flatten).Desc(desc).Attachment(attachment).Delimiter(delimiter).Bom(bom).XmlRoot(xmlRoot).XmlRow(xmlRow).SkipHeaderRow(skipHeaderRow).SkipHidden(skipHidden).SkipEmpty(skipEmpty).Simplified(simplified).View(view).SkipFailedPages(skipFailedPages).FeedTitle(feedTitle).FeedDescription(feedDescription).Execute() - -Run Actor synchronously and get dataset items - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - actorId := "janedoe~my-actor" // string | Actor ID or a tilde-separated owner's username and Actor name. - body := map[string]interface{}{ ... } // map[string]interface{} | - timeout := float64(60) // float64 | Optional timeout for the run, in seconds. By default, the run uses the timeout from its configuration. (optional) - memory := float64(256) // float64 | Memory limit for the run, in megabytes. The amount of memory can be set to a power of 2 with a minimum of 128. By default, the run uses the memory limit from its configuration. (optional) - maxItems := float64(1000) // float64 | Specifies the maximum number of dataset items that will be charged for pay-per-result Actors. This does NOT guarantee that the Actor will return only this many items. It only ensures you won't be charged for more than this number of items. Only works for pay-per-result Actors. Value can be accessed in the actor run using `ACTOR_MAX_PAID_DATASET_ITEMS` environment variable. (optional) - maxTotalChargeUsd := float64(5) // float64 | Specifies the maximum cost of the run. This parameter is useful for pay-per-event Actors, as it allows you to limit the amount charged to your subscription. You can access the maximum cost in your Actor by using the `ACTOR_MAX_TOTAL_CHARGE_USD` environment variable. (optional) - restartOnError := false // bool | Determines whether the run will be restarted if it fails. (optional) - build := "0.1.234" // string | Specifies the Actor build to run. It can be either a build tag or build number. By default, the run uses the build from its configuration (typically `latest`). (optional) - webhooks := "dGhpcyBpcyBqdXN0IGV4YW1wbGUK..." // string | Specifies optional webhooks associated with the Actor run, which can be used to receive a notification e.g. when the Actor finished or failed. The value is a Base64-encoded JSON array whose items follow the WebhookRepresentation schema. For more information, see [Webhooks documentation](https://docs.apify.com/platform/integrations/webhooks). (optional) - format := "json" // string | Format of the results, possible values are: `json`, `jsonl`, `csv`, `html`, `xlsx`, `xml` and `rss`. The default value is `json`. (optional) - clean := false // bool | If `true` or `1` then the API endpoint returns only non-empty items and skips hidden fields (i.e. fields starting with the # character). The `clean` parameter is just a shortcut for `skipHidden=true` and `skipEmpty=true` parameters. Note that since some objects might be skipped from the output, that the result might contain less items than the `limit` value. (optional) - offset := float64(0) // float64 | Number of items that should be skipped at the start. The default value is `0`. (optional) - limit := float64(1.2) // float64 | Maximum number of items to return. By default there is no limit. (optional) - fields := "myValue,myOtherValue" // string | A comma-separated list of fields which should be picked from the items, only these fields will remain in the resulting record objects. Note that the fields in the outputted items are sorted the same way as they are specified in the `fields` query parameter. You can use this feature to effectively fix the output format. (optional) - outputFields := "title,link" // string | A comma-separated list of output field names that positionally rename the fields specified in the `fields` parameter. For example, `?fields=headline,url&outputFields=title,link` renames `headline` to `title` and `url` to `link` in the output. The number of names in `outputFields` must match the number of names in `fields`. Requires the `fields` parameter to be specified as well. (optional) - omit := "myValue,myOtherValue" // string | A comma-separated list of fields which should be omitted from the items. (optional) - unwind := "myValue,myOtherValue" // string | A comma-separated list of fields which should be unwound, in order which they should be processed. Each field should be either an array or an object. If the field is an array then every element of the array will become a separate record and merged with parent object. If the unwound field is an object then it is merged with the parent object. If the unwound field is missing or its value is neither an array nor an object and therefore cannot be merged with a parent object then the item gets preserved as it is. Note that the unwound items ignore the `desc` parameter. (optional) - flatten := "myValue" // string | A comma-separated list of fields which should transform nested objects into flat structures. For example, with `flatten=\"foo\"` the object `{\"foo\":{\"bar\": \"hello\"}}` is turned into `{\"foo.bar\": \"hello\"}`. The original object with properties is replaced with the flattened object. (optional) - desc := true // bool | By default, results are returned in the same order as they were stored. To reverse the order, set this parameter to `true` or `1`. (optional) - attachment := true // bool | If `true` or `1` then the response will define the `Content-Disposition: attachment` header, forcing a web browser to download the file rather than to display it. By default this header is not present. (optional) - delimiter := ";" // string | A delimiter character for CSV files, only used if `format=csv`. You might need to URL-encode the character (e.g. use `%09` for tab or `%3B` for semicolon). The default delimiter is a simple comma (`,`). (optional) - bom := false // bool | All text responses are encoded in UTF-8 encoding. By default, the `format=csv` files are prefixed with the UTF-8 Byte Order Mark (BOM), while `json`, `jsonl`, `xml`, `html` and `rss` files are not. If you want to override this default behavior, specify `bom=1` query parameter to include the BOM or `bom=0` to skip it. (optional) - xmlRoot := "items" // string | Overrides default root element name of `xml` output. By default the root element is `items`. (optional) - xmlRow := "item" // string | Overrides default element name that wraps each page or page function result object in `xml` output. By default the element name is `item`. (optional) - skipHeaderRow := true // bool | If `true` or `1` then header row in the `csv` format is skipped. (optional) - skipHidden := false // bool | If `true` or `1` then hidden fields are skipped from the output, i.e. fields starting with the `#` character. (optional) - skipEmpty := false // bool | If `true` or `1` then empty items are skipped from the output. Note that if used, the results might contain less items than the limit value. (optional) - simplified := false // bool | If `true` or `1` then, the endpoint applies the `fields=url,pageFunctionResult,errorInfo` and `unwind=pageFunctionResult` query parameters. This feature is used to emulate simplified results provided by the legacy Apify Crawler product and it's not recommended to use it in new integrations. (optional) - view := "overview" // string | Defines the view configuration for dataset items based on the schema definition. This parameter determines how the data will be filtered and presented. For complete specification details, see the [dataset schema documentation](/platform/actors/development/actor-definition/dataset-schema). (optional) - skipFailedPages := false // bool | If `true` or `1` then, the all the items with errorInfo property will be skipped from the output. This feature is here to emulate functionality of API version 1 used for the legacy Apify Crawler product and it's not recommended to use it in new integrations. (optional) - feedTitle := "Latest posts from r/pasta" // string | Overrides the auto-generated RSS channel `<title>` element. Only used when `format=rss`. If not provided, the title defaults to `Dataset <label>`. (optional) - feedDescription := "Scraped forum posts" // string | Overrides the auto-generated RSS channel `<description>` element. Only used when `format=rss`. If not provided, the description defaults to `Items in dataset with id \"<datasetId>\".` (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.ActorsActorRunsAPI.ActRunSyncGetDatasetItemsPost(context.Background(), actorId).Body(body).Timeout(timeout).Memory(memory).MaxItems(maxItems).MaxTotalChargeUsd(maxTotalChargeUsd).RestartOnError(restartOnError).Build(build).Webhooks(webhooks).Format(format).Clean(clean).Offset(offset).Limit(limit).Fields(fields).OutputFields(outputFields).Omit(omit).Unwind(unwind).Flatten(flatten).Desc(desc).Attachment(attachment).Delimiter(delimiter).Bom(bom).XmlRoot(xmlRoot).XmlRow(xmlRow).SkipHeaderRow(skipHeaderRow).SkipHidden(skipHidden).SkipEmpty(skipEmpty).Simplified(simplified).View(view).SkipFailedPages(skipFailedPages).FeedTitle(feedTitle).FeedDescription(feedDescription).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `ActorsActorRunsAPI.ActRunSyncGetDatasetItemsPost``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `ActRunSyncGetDatasetItemsPost`: []map[string]interface{} - fmt.Fprintf(os.Stdout, "Response from `ActorsActorRunsAPI.ActRunSyncGetDatasetItemsPost`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**actorId** | **string** | Actor ID or a tilde-separated owner's username and Actor name. | - -### Other Parameters - -Other parameters are passed through a pointer to a apiActRunSyncGetDatasetItemsPostRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - **body** | **map[string]interface{}** | | - **timeout** | **float64** | Optional timeout for the run, in seconds. By default, the run uses the timeout from its configuration. | - **memory** | **float64** | Memory limit for the run, in megabytes. The amount of memory can be set to a power of 2 with a minimum of 128. By default, the run uses the memory limit from its configuration. | - **maxItems** | **float64** | Specifies the maximum number of dataset items that will be charged for pay-per-result Actors. This does NOT guarantee that the Actor will return only this many items. It only ensures you won't be charged for more than this number of items. Only works for pay-per-result Actors. Value can be accessed in the actor run using `ACTOR_MAX_PAID_DATASET_ITEMS` environment variable. | - **maxTotalChargeUsd** | **float64** | Specifies the maximum cost of the run. This parameter is useful for pay-per-event Actors, as it allows you to limit the amount charged to your subscription. You can access the maximum cost in your Actor by using the `ACTOR_MAX_TOTAL_CHARGE_USD` environment variable. | - **restartOnError** | **bool** | Determines whether the run will be restarted if it fails. | - **build** | **string** | Specifies the Actor build to run. It can be either a build tag or build number. By default, the run uses the build from its configuration (typically `latest`). | - **webhooks** | **string** | Specifies optional webhooks associated with the Actor run, which can be used to receive a notification e.g. when the Actor finished or failed. The value is a Base64-encoded JSON array whose items follow the WebhookRepresentation schema. For more information, see [Webhooks documentation](https://docs.apify.com/platform/integrations/webhooks). | - **format** | **string** | Format of the results, possible values are: `json`, `jsonl`, `csv`, `html`, `xlsx`, `xml` and `rss`. The default value is `json`. | - **clean** | **bool** | If `true` or `1` then the API endpoint returns only non-empty items and skips hidden fields (i.e. fields starting with the # character). The `clean` parameter is just a shortcut for `skipHidden=true` and `skipEmpty=true` parameters. Note that since some objects might be skipped from the output, that the result might contain less items than the `limit` value. | - **offset** | **float64** | Number of items that should be skipped at the start. The default value is `0`. | - **limit** | **float64** | Maximum number of items to return. By default there is no limit. | - **fields** | **string** | A comma-separated list of fields which should be picked from the items, only these fields will remain in the resulting record objects. Note that the fields in the outputted items are sorted the same way as they are specified in the `fields` query parameter. You can use this feature to effectively fix the output format. | - **outputFields** | **string** | A comma-separated list of output field names that positionally rename the fields specified in the `fields` parameter. For example, `?fields=headline,url&outputFields=title,link` renames `headline` to `title` and `url` to `link` in the output. The number of names in `outputFields` must match the number of names in `fields`. Requires the `fields` parameter to be specified as well. | - **omit** | **string** | A comma-separated list of fields which should be omitted from the items. | - **unwind** | **string** | A comma-separated list of fields which should be unwound, in order which they should be processed. Each field should be either an array or an object. If the field is an array then every element of the array will become a separate record and merged with parent object. If the unwound field is an object then it is merged with the parent object. If the unwound field is missing or its value is neither an array nor an object and therefore cannot be merged with a parent object then the item gets preserved as it is. Note that the unwound items ignore the `desc` parameter. | - **flatten** | **string** | A comma-separated list of fields which should transform nested objects into flat structures. For example, with `flatten=\"foo\"` the object `{\"foo\":{\"bar\": \"hello\"}}` is turned into `{\"foo.bar\": \"hello\"}`. The original object with properties is replaced with the flattened object. | - **desc** | **bool** | By default, results are returned in the same order as they were stored. To reverse the order, set this parameter to `true` or `1`. | - **attachment** | **bool** | If `true` or `1` then the response will define the `Content-Disposition: attachment` header, forcing a web browser to download the file rather than to display it. By default this header is not present. | - **delimiter** | **string** | A delimiter character for CSV files, only used if `format=csv`. You might need to URL-encode the character (e.g. use `%09` for tab or `%3B` for semicolon). The default delimiter is a simple comma (`,`). | - **bom** | **bool** | All text responses are encoded in UTF-8 encoding. By default, the `format=csv` files are prefixed with the UTF-8 Byte Order Mark (BOM), while `json`, `jsonl`, `xml`, `html` and `rss` files are not. If you want to override this default behavior, specify `bom=1` query parameter to include the BOM or `bom=0` to skip it. | - **xmlRoot** | **string** | Overrides default root element name of `xml` output. By default the root element is `items`. | - **xmlRow** | **string** | Overrides default element name that wraps each page or page function result object in `xml` output. By default the element name is `item`. | - **skipHeaderRow** | **bool** | If `true` or `1` then header row in the `csv` format is skipped. | - **skipHidden** | **bool** | If `true` or `1` then hidden fields are skipped from the output, i.e. fields starting with the `#` character. | - **skipEmpty** | **bool** | If `true` or `1` then empty items are skipped from the output. Note that if used, the results might contain less items than the limit value. | - **simplified** | **bool** | If `true` or `1` then, the endpoint applies the `fields=url,pageFunctionResult,errorInfo` and `unwind=pageFunctionResult` query parameters. This feature is used to emulate simplified results provided by the legacy Apify Crawler product and it's not recommended to use it in new integrations. | - **view** | **string** | Defines the view configuration for dataset items based on the schema definition. This parameter determines how the data will be filtered and presented. For complete specification details, see the [dataset schema documentation](/platform/actors/development/actor-definition/dataset-schema). | - **skipFailedPages** | **bool** | If `true` or `1` then, the all the items with errorInfo property will be skipped from the output. This feature is here to emulate functionality of API version 1 used for the legacy Apify Crawler product and it's not recommended to use it in new integrations. | - **feedTitle** | **string** | Overrides the auto-generated RSS channel `<title>` element. Only used when `format=rss`. If not provided, the title defaults to `Dataset <label>`. | - **feedDescription** | **string** | Overrides the auto-generated RSS channel `<description>` element. Only used when `format=rss`. If not provided, the description defaults to `Items in dataset with id \"<datasetId>\".` | - -### Return type - -**[]map[string]interface{}** - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## ActRunSyncPost - -> map[string]interface{} ActRunSyncPost(ctx, actorId).Body(body).OutputRecordKey(outputRecordKey).Timeout(timeout).Memory(memory).MaxItems(maxItems).MaxTotalChargeUsd(maxTotalChargeUsd).RestartOnError(restartOnError).Build(build).Webhooks(webhooks).Execute() - -Run Actor synchronously and return output - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - actorId := "janedoe~my-actor" // string | Actor ID or a tilde-separated owner's username and Actor name. - body := map[string]interface{}{ ... } // map[string]interface{} | - outputRecordKey := "OUTPUT" // string | Key of the record from run's default key-value store to be returned in the response. By default, it is `OUTPUT`. (optional) - timeout := float64(60) // float64 | Optional timeout for the run, in seconds. By default, the run uses the timeout from its configuration. (optional) - memory := float64(256) // float64 | Memory limit for the run, in megabytes. The amount of memory can be set to a power of 2 with a minimum of 128. By default, the run uses the memory limit from its configuration. (optional) - maxItems := float64(1000) // float64 | Specifies the maximum number of dataset items that will be charged for pay-per-result Actors. This does NOT guarantee that the Actor will return only this many items. It only ensures you won't be charged for more than this number of items. Only works for pay-per-result Actors. Value can be accessed in the actor run using `ACTOR_MAX_PAID_DATASET_ITEMS` environment variable. (optional) - maxTotalChargeUsd := float64(5) // float64 | Specifies the maximum cost of the run. This parameter is useful for pay-per-event Actors, as it allows you to limit the amount charged to your subscription. You can access the maximum cost in your Actor by using the `ACTOR_MAX_TOTAL_CHARGE_USD` environment variable. (optional) - restartOnError := false // bool | Determines whether the run will be restarted if it fails. (optional) - build := "0.1.234" // string | Specifies the Actor build to run. It can be either a build tag or build number. By default, the run uses the build from its configuration (typically `latest`). (optional) - webhooks := "dGhpcyBpcyBqdXN0IGV4YW1wbGUK..." // string | Specifies optional webhooks associated with the Actor run, which can be used to receive a notification e.g. when the Actor finished or failed. The value is a Base64-encoded JSON array whose items follow the WebhookRepresentation schema. For more information, see [Webhooks documentation](https://docs.apify.com/platform/integrations/webhooks). (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.ActorsActorRunsAPI.ActRunSyncPost(context.Background(), actorId).Body(body).OutputRecordKey(outputRecordKey).Timeout(timeout).Memory(memory).MaxItems(maxItems).MaxTotalChargeUsd(maxTotalChargeUsd).RestartOnError(restartOnError).Build(build).Webhooks(webhooks).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `ActorsActorRunsAPI.ActRunSyncPost``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `ActRunSyncPost`: map[string]interface{} - fmt.Fprintf(os.Stdout, "Response from `ActorsActorRunsAPI.ActRunSyncPost`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**actorId** | **string** | Actor ID or a tilde-separated owner's username and Actor name. | - -### Other Parameters - -Other parameters are passed through a pointer to a apiActRunSyncPostRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - **body** | **map[string]interface{}** | | - **outputRecordKey** | **string** | Key of the record from run's default key-value store to be returned in the response. By default, it is `OUTPUT`. | - **timeout** | **float64** | Optional timeout for the run, in seconds. By default, the run uses the timeout from its configuration. | - **memory** | **float64** | Memory limit for the run, in megabytes. The amount of memory can be set to a power of 2 with a minimum of 128. By default, the run uses the memory limit from its configuration. | - **maxItems** | **float64** | Specifies the maximum number of dataset items that will be charged for pay-per-result Actors. This does NOT guarantee that the Actor will return only this many items. It only ensures you won't be charged for more than this number of items. Only works for pay-per-result Actors. Value can be accessed in the actor run using `ACTOR_MAX_PAID_DATASET_ITEMS` environment variable. | - **maxTotalChargeUsd** | **float64** | Specifies the maximum cost of the run. This parameter is useful for pay-per-event Actors, as it allows you to limit the amount charged to your subscription. You can access the maximum cost in your Actor by using the `ACTOR_MAX_TOTAL_CHARGE_USD` environment variable. | - **restartOnError** | **bool** | Determines whether the run will be restarted if it fails. | - **build** | **string** | Specifies the Actor build to run. It can be either a build tag or build number. By default, the run uses the build from its configuration (typically `latest`). | - **webhooks** | **string** | Specifies optional webhooks associated with the Actor run, which can be used to receive a notification e.g. when the Actor finished or failed. The value is a Base64-encoded JSON array whose items follow the WebhookRepresentation schema. For more information, see [Webhooks documentation](https://docs.apify.com/platform/integrations/webhooks). | - -### Return type - -**map[string]interface{}** - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## ActRunsGet - -> ListOfRunsResponse ActRunsGet(ctx, actorId).Offset(offset).Limit(limit).Desc(desc).Status(status).StartedAfter(startedAfter).StartedBefore(startedBefore).Execute() - -Get list of runs - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - "time" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - actorId := "janedoe~my-actor" // string | Actor ID or a tilde-separated owner's username and Actor name. - offset := float64(0) // float64 | Number of items that should be skipped at the start. The default value is `0`. (optional) - limit := float64(1000) // float64 | Maximum number of items to return. The default value as well as the maximum is `1000`. (optional) - desc := true // bool | If `true` or `1` then the objects are sorted by the `startedAt` field in descending order. By default, they are sorted in ascending order. (optional) - status := []string{"Inner_example"} // []string | Single status or comma-separated list of statuses, see ([available statuses](https://docs.apify.com/platform/actors/running/runs-and-builds#lifecycle)). Used to filter runs by the specified statuses only. (optional) - startedAfter := time.Now() // time.Time | Filter runs that started after the specified date and time (inclusive). The value must be a valid ISO 8601 datetime string (UTC). (optional) - startedBefore := time.Now() // time.Time | Filter runs that started before the specified date and time (inclusive). The value must be a valid ISO 8601 datetime string (UTC). (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.ActorsActorRunsAPI.ActRunsGet(context.Background(), actorId).Offset(offset).Limit(limit).Desc(desc).Status(status).StartedAfter(startedAfter).StartedBefore(startedBefore).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `ActorsActorRunsAPI.ActRunsGet``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `ActRunsGet`: ListOfRunsResponse - fmt.Fprintf(os.Stdout, "Response from `ActorsActorRunsAPI.ActRunsGet`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**actorId** | **string** | Actor ID or a tilde-separated owner's username and Actor name. | - -### Other Parameters - -Other parameters are passed through a pointer to a apiActRunsGetRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - **offset** | **float64** | Number of items that should be skipped at the start. The default value is `0`. | - **limit** | **float64** | Maximum number of items to return. The default value as well as the maximum is `1000`. | - **desc** | **bool** | If `true` or `1` then the objects are sorted by the `startedAt` field in descending order. By default, they are sorted in ascending order. | - **status** | **[]string** | Single status or comma-separated list of statuses, see ([available statuses](https://docs.apify.com/platform/actors/running/runs-and-builds#lifecycle)). Used to filter runs by the specified statuses only. | - **startedAfter** | **time.Time** | Filter runs that started after the specified date and time (inclusive). The value must be a valid ISO 8601 datetime string (UTC). | - **startedBefore** | **time.Time** | Filter runs that started before the specified date and time (inclusive). The value must be a valid ISO 8601 datetime string (UTC). | - -### Return type - -[**ListOfRunsResponse**](ListOfRunsResponse.md) - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## ActRunsLastGet - -> RunResponse ActRunsLastGet(ctx, actorId).Status(status).WaitForFinish(waitForFinish).Execute() - -Get last run - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - actorId := "janedoe~my-actor" // string | Actor ID or a tilde-separated owner's username and Actor name. - status := "SUCCEEDED" // string | Filter for the run status. (optional) - waitForFinish := float64(60) // float64 | The maximum number of seconds the server waits for the run to finish. By default it is `0`, the maximum value is `60`. <!-- MAX_ACTOR_JOB_ASYNC_WAIT_SECS --> If the run finishes in time then the returned run object will have a terminal status (e.g. `SUCCEEDED`), otherwise it will have a transitional status (e.g. `RUNNING`). (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.ActorsActorRunsAPI.ActRunsLastGet(context.Background(), actorId).Status(status).WaitForFinish(waitForFinish).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `ActorsActorRunsAPI.ActRunsLastGet``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `ActRunsLastGet`: RunResponse - fmt.Fprintf(os.Stdout, "Response from `ActorsActorRunsAPI.ActRunsLastGet`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**actorId** | **string** | Actor ID or a tilde-separated owner's username and Actor name. | - -### Other Parameters - -Other parameters are passed through a pointer to a apiActRunsLastGetRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - **status** | **string** | Filter for the run status. | - **waitForFinish** | **float64** | The maximum number of seconds the server waits for the run to finish. By default it is `0`, the maximum value is `60`. <!-- MAX_ACTOR_JOB_ASYNC_WAIT_SECS --> If the run finishes in time then the returned run object will have a terminal status (e.g. `SUCCEEDED`), otherwise it will have a transitional status (e.g. `RUNNING`). | - -### Return type - -[**RunResponse**](RunResponse.md) - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## ActRunsPost - -> RunResponse ActRunsPost(ctx, actorId).Body(body).Timeout(timeout).Memory(memory).MaxItems(maxItems).MaxTotalChargeUsd(maxTotalChargeUsd).RestartOnError(restartOnError).Build(build).WaitForFinish(waitForFinish).Webhooks(webhooks).ForcePermissionLevel(forcePermissionLevel).Execute() - -Run Actor - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - actorId := "janedoe~my-actor" // string | Actor ID or a tilde-separated owner's username and Actor name. - body := map[string]interface{}{ ... } // map[string]interface{} | - timeout := float64(60) // float64 | Optional timeout for the run, in seconds. By default, the run uses the timeout from its configuration. (optional) - memory := float64(256) // float64 | Memory limit for the run, in megabytes. The amount of memory can be set to a power of 2 with a minimum of 128. By default, the run uses the memory limit from its configuration. (optional) - maxItems := float64(1000) // float64 | Specifies the maximum number of dataset items that will be charged for pay-per-result Actors. This does NOT guarantee that the Actor will return only this many items. It only ensures you won't be charged for more than this number of items. Only works for pay-per-result Actors. Value can be accessed in the actor run using `ACTOR_MAX_PAID_DATASET_ITEMS` environment variable. (optional) - maxTotalChargeUsd := float64(5) // float64 | Specifies the maximum cost of the run. This parameter is useful for pay-per-event Actors, as it allows you to limit the amount charged to your subscription. You can access the maximum cost in your Actor by using the `ACTOR_MAX_TOTAL_CHARGE_USD` environment variable. (optional) - restartOnError := false // bool | Determines whether the run will be restarted if it fails. (optional) - build := "0.1.234" // string | Specifies the Actor build to run. It can be either a build tag or build number. By default, the run uses the build from its configuration (typically `latest`). (optional) - waitForFinish := float64(60) // float64 | The maximum number of seconds the server waits for the run to finish. By default it is `0`, the maximum value is `60`. <!-- MAX_ACTOR_JOB_ASYNC_WAIT_SECS --> If the run finishes in time then the returned run object will have a terminal status (e.g. `SUCCEEDED`), otherwise it will have a transitional status (e.g. `RUNNING`). (optional) - webhooks := "dGhpcyBpcyBqdXN0IGV4YW1wbGUK..." // string | Specifies optional webhooks associated with the Actor run, which can be used to receive a notification e.g. when the Actor finished or failed. The value is a Base64-encoded JSON array whose items follow the WebhookRepresentation schema. For more information, see [Webhooks documentation](https://docs.apify.com/platform/integrations/webhooks). (optional) - forcePermissionLevel := "LIMITED_PERMISSIONS" // string | Overrides the Actor's permission level for this specific run. Use to test restricted permissions before deploying changes to your Actor or to temporarily elevate or restrict access. If you don't specify this parameter, the Actor uses its configured default permission level. For more information on permissions, see the [documentation](https://docs.apify.com/platform/actors/development/permissions). (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.ActorsActorRunsAPI.ActRunsPost(context.Background(), actorId).Body(body).Timeout(timeout).Memory(memory).MaxItems(maxItems).MaxTotalChargeUsd(maxTotalChargeUsd).RestartOnError(restartOnError).Build(build).WaitForFinish(waitForFinish).Webhooks(webhooks).ForcePermissionLevel(forcePermissionLevel).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `ActorsActorRunsAPI.ActRunsPost``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `ActRunsPost`: RunResponse - fmt.Fprintf(os.Stdout, "Response from `ActorsActorRunsAPI.ActRunsPost`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**actorId** | **string** | Actor ID or a tilde-separated owner's username and Actor name. | - -### Other Parameters - -Other parameters are passed through a pointer to a apiActRunsPostRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - **body** | **map[string]interface{}** | | - **timeout** | **float64** | Optional timeout for the run, in seconds. By default, the run uses the timeout from its configuration. | - **memory** | **float64** | Memory limit for the run, in megabytes. The amount of memory can be set to a power of 2 with a minimum of 128. By default, the run uses the memory limit from its configuration. | - **maxItems** | **float64** | Specifies the maximum number of dataset items that will be charged for pay-per-result Actors. This does NOT guarantee that the Actor will return only this many items. It only ensures you won't be charged for more than this number of items. Only works for pay-per-result Actors. Value can be accessed in the actor run using `ACTOR_MAX_PAID_DATASET_ITEMS` environment variable. | - **maxTotalChargeUsd** | **float64** | Specifies the maximum cost of the run. This parameter is useful for pay-per-event Actors, as it allows you to limit the amount charged to your subscription. You can access the maximum cost in your Actor by using the `ACTOR_MAX_TOTAL_CHARGE_USD` environment variable. | - **restartOnError** | **bool** | Determines whether the run will be restarted if it fails. | - **build** | **string** | Specifies the Actor build to run. It can be either a build tag or build number. By default, the run uses the build from its configuration (typically `latest`). | - **waitForFinish** | **float64** | The maximum number of seconds the server waits for the run to finish. By default it is `0`, the maximum value is `60`. <!-- MAX_ACTOR_JOB_ASYNC_WAIT_SECS --> If the run finishes in time then the returned run object will have a terminal status (e.g. `SUCCEEDED`), otherwise it will have a transitional status (e.g. `RUNNING`). | - **webhooks** | **string** | Specifies optional webhooks associated with the Actor run, which can be used to receive a notification e.g. when the Actor finished or failed. The value is a Base64-encoded JSON array whose items follow the WebhookRepresentation schema. For more information, see [Webhooks documentation](https://docs.apify.com/platform/integrations/webhooks). | - **forcePermissionLevel** | **string** | Overrides the Actor's permission level for this specific run. Use to test restricted permissions before deploying changes to your Actor or to temporarily elevate or restrict access. If you don't specify this parameter, the Actor uses its configured default permission level. For more information on permissions, see the [documentation](https://docs.apify.com/platform/actors/development/permissions). | - -### Return type - -[**RunResponse**](RunResponse.md) - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - diff --git a/docs/ActorsActorVersionsAPI.md b/docs/ActorsActorVersionsAPI.md deleted file mode 100644 index 6cedba0..0000000 --- a/docs/ActorsActorVersionsAPI.md +++ /dev/null @@ -1,914 +0,0 @@ -# \ActorsActorVersionsAPI - -All URIs are relative to *https://api.apify.com* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**ActVersionDelete**](ActorsActorVersionsAPI.md#ActVersionDelete) | **Delete** /v2/actors/{actorId}/versions/{versionNumber} | Delete version -[**ActVersionEnvVarDelete**](ActorsActorVersionsAPI.md#ActVersionEnvVarDelete) | **Delete** /v2/actors/{actorId}/versions/{versionNumber}/env-vars/{envVarName} | Delete environment variable -[**ActVersionEnvVarGet**](ActorsActorVersionsAPI.md#ActVersionEnvVarGet) | **Get** /v2/actors/{actorId}/versions/{versionNumber}/env-vars/{envVarName} | Get environment variable -[**ActVersionEnvVarPost**](ActorsActorVersionsAPI.md#ActVersionEnvVarPost) | **Post** /v2/actors/{actorId}/versions/{versionNumber}/env-vars/{envVarName} | Update environment variable (POST) -[**ActVersionEnvVarPut**](ActorsActorVersionsAPI.md#ActVersionEnvVarPut) | **Put** /v2/actors/{actorId}/versions/{versionNumber}/env-vars/{envVarName} | Update environment variable -[**ActVersionEnvVarsGet**](ActorsActorVersionsAPI.md#ActVersionEnvVarsGet) | **Get** /v2/actors/{actorId}/versions/{versionNumber}/env-vars | Get list of environment variables -[**ActVersionEnvVarsPost**](ActorsActorVersionsAPI.md#ActVersionEnvVarsPost) | **Post** /v2/actors/{actorId}/versions/{versionNumber}/env-vars | Create environment variable -[**ActVersionGet**](ActorsActorVersionsAPI.md#ActVersionGet) | **Get** /v2/actors/{actorId}/versions/{versionNumber} | Get version -[**ActVersionPost**](ActorsActorVersionsAPI.md#ActVersionPost) | **Post** /v2/actors/{actorId}/versions/{versionNumber} | Update version (POST) -[**ActVersionPut**](ActorsActorVersionsAPI.md#ActVersionPut) | **Put** /v2/actors/{actorId}/versions/{versionNumber} | Update version -[**ActVersionsGet**](ActorsActorVersionsAPI.md#ActVersionsGet) | **Get** /v2/actors/{actorId}/versions | Get list of versions -[**ActVersionsPost**](ActorsActorVersionsAPI.md#ActVersionsPost) | **Post** /v2/actors/{actorId}/versions | Create version - - - -## ActVersionDelete - -> map[string]interface{} ActVersionDelete(ctx, actorId, versionNumber).Execute() - -Delete version - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - actorId := "janedoe~my-actor" // string | Actor ID or a tilde-separated owner's username and Actor name. - versionNumber := "0.1" // string | Actor version. - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.ActorsActorVersionsAPI.ActVersionDelete(context.Background(), actorId, versionNumber).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `ActorsActorVersionsAPI.ActVersionDelete``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `ActVersionDelete`: map[string]interface{} - fmt.Fprintf(os.Stdout, "Response from `ActorsActorVersionsAPI.ActVersionDelete`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**actorId** | **string** | Actor ID or a tilde-separated owner's username and Actor name. | -**versionNumber** | **string** | Actor version. | - -### Other Parameters - -Other parameters are passed through a pointer to a apiActVersionDeleteRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - - -### Return type - -**map[string]interface{}** - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## ActVersionEnvVarDelete - -> map[string]interface{} ActVersionEnvVarDelete(ctx, actorId, versionNumber, envVarName).Execute() - -Delete environment variable - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - actorId := "janedoe~my-actor" // string | Actor ID or a tilde-separated owner's username and Actor name. - versionNumber := "0.1" // string | Actor version. - envVarName := "MY_ENV_VAR" // string | The name of the environment variable - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.ActorsActorVersionsAPI.ActVersionEnvVarDelete(context.Background(), actorId, versionNumber, envVarName).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `ActorsActorVersionsAPI.ActVersionEnvVarDelete``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `ActVersionEnvVarDelete`: map[string]interface{} - fmt.Fprintf(os.Stdout, "Response from `ActorsActorVersionsAPI.ActVersionEnvVarDelete`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**actorId** | **string** | Actor ID or a tilde-separated owner's username and Actor name. | -**versionNumber** | **string** | Actor version. | -**envVarName** | **string** | The name of the environment variable | - -### Other Parameters - -Other parameters are passed through a pointer to a apiActVersionEnvVarDeleteRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - - - -### Return type - -**map[string]interface{}** - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## ActVersionEnvVarGet - -> EnvVarResponse ActVersionEnvVarGet(ctx, actorId, versionNumber, envVarName).Execute() - -Get environment variable - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - actorId := "janedoe~my-actor" // string | Actor ID or a tilde-separated owner's username and Actor name. - versionNumber := "0.1" // string | Actor version. - envVarName := "MY_ENV_VAR" // string | The name of the environment variable - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.ActorsActorVersionsAPI.ActVersionEnvVarGet(context.Background(), actorId, versionNumber, envVarName).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `ActorsActorVersionsAPI.ActVersionEnvVarGet``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `ActVersionEnvVarGet`: EnvVarResponse - fmt.Fprintf(os.Stdout, "Response from `ActorsActorVersionsAPI.ActVersionEnvVarGet`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**actorId** | **string** | Actor ID or a tilde-separated owner's username and Actor name. | -**versionNumber** | **string** | Actor version. | -**envVarName** | **string** | The name of the environment variable | - -### Other Parameters - -Other parameters are passed through a pointer to a apiActVersionEnvVarGetRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - - - -### Return type - -[**EnvVarResponse**](EnvVarResponse.md) - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## ActVersionEnvVarPost - -> EnvVarResponse ActVersionEnvVarPost(ctx, actorId, versionNumber, envVarName).EnvVarRequest(envVarRequest).Execute() - -Update environment variable (POST) - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - actorId := "janedoe~my-actor" // string | Actor ID or a tilde-separated owner's username and Actor name. - versionNumber := "0.1" // string | Actor version. - envVarName := "MY_ENV_VAR" // string | The name of the environment variable - envVarRequest := *openapiclient.NewEnvVarRequest("Name_example") // EnvVarRequest | - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.ActorsActorVersionsAPI.ActVersionEnvVarPost(context.Background(), actorId, versionNumber, envVarName).EnvVarRequest(envVarRequest).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `ActorsActorVersionsAPI.ActVersionEnvVarPost``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `ActVersionEnvVarPost`: EnvVarResponse - fmt.Fprintf(os.Stdout, "Response from `ActorsActorVersionsAPI.ActVersionEnvVarPost`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**actorId** | **string** | Actor ID or a tilde-separated owner's username and Actor name. | -**versionNumber** | **string** | Actor version. | -**envVarName** | **string** | The name of the environment variable | - -### Other Parameters - -Other parameters are passed through a pointer to a apiActVersionEnvVarPostRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - - - **envVarRequest** | [**EnvVarRequest**](EnvVarRequest.md) | | - -### Return type - -[**EnvVarResponse**](EnvVarResponse.md) - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## ActVersionEnvVarPut - -> EnvVarResponse ActVersionEnvVarPut(ctx, actorId, versionNumber, envVarName).EnvVarRequest(envVarRequest).Execute() - -Update environment variable - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - actorId := "janedoe~my-actor" // string | Actor ID or a tilde-separated owner's username and Actor name. - versionNumber := "0.1" // string | Actor version. - envVarName := "MY_ENV_VAR" // string | The name of the environment variable - envVarRequest := *openapiclient.NewEnvVarRequest("Name_example") // EnvVarRequest | - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.ActorsActorVersionsAPI.ActVersionEnvVarPut(context.Background(), actorId, versionNumber, envVarName).EnvVarRequest(envVarRequest).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `ActorsActorVersionsAPI.ActVersionEnvVarPut``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `ActVersionEnvVarPut`: EnvVarResponse - fmt.Fprintf(os.Stdout, "Response from `ActorsActorVersionsAPI.ActVersionEnvVarPut`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**actorId** | **string** | Actor ID or a tilde-separated owner's username and Actor name. | -**versionNumber** | **string** | Actor version. | -**envVarName** | **string** | The name of the environment variable | - -### Other Parameters - -Other parameters are passed through a pointer to a apiActVersionEnvVarPutRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - - - **envVarRequest** | [**EnvVarRequest**](EnvVarRequest.md) | | - -### Return type - -[**EnvVarResponse**](EnvVarResponse.md) - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## ActVersionEnvVarsGet - -> ListOfEnvVarsResponse ActVersionEnvVarsGet(ctx, actorId, versionNumber).Execute() - -Get list of environment variables - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - actorId := "janedoe~my-actor" // string | Actor ID or a tilde-separated owner's username and Actor name. - versionNumber := "0.1" // string | Actor version. - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.ActorsActorVersionsAPI.ActVersionEnvVarsGet(context.Background(), actorId, versionNumber).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `ActorsActorVersionsAPI.ActVersionEnvVarsGet``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `ActVersionEnvVarsGet`: ListOfEnvVarsResponse - fmt.Fprintf(os.Stdout, "Response from `ActorsActorVersionsAPI.ActVersionEnvVarsGet`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**actorId** | **string** | Actor ID or a tilde-separated owner's username and Actor name. | -**versionNumber** | **string** | Actor version. | - -### Other Parameters - -Other parameters are passed through a pointer to a apiActVersionEnvVarsGetRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - - -### Return type - -[**ListOfEnvVarsResponse**](ListOfEnvVarsResponse.md) - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## ActVersionEnvVarsPost - -> EnvVarResponse ActVersionEnvVarsPost(ctx, actorId, versionNumber).EnvVarRequest(envVarRequest).Execute() - -Create environment variable - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - actorId := "janedoe~my-actor" // string | Actor ID or a tilde-separated owner's username and Actor name. - versionNumber := "0.1" // string | Actor version. - envVarRequest := *openapiclient.NewEnvVarRequest("Name_example") // EnvVarRequest | - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.ActorsActorVersionsAPI.ActVersionEnvVarsPost(context.Background(), actorId, versionNumber).EnvVarRequest(envVarRequest).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `ActorsActorVersionsAPI.ActVersionEnvVarsPost``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `ActVersionEnvVarsPost`: EnvVarResponse - fmt.Fprintf(os.Stdout, "Response from `ActorsActorVersionsAPI.ActVersionEnvVarsPost`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**actorId** | **string** | Actor ID or a tilde-separated owner's username and Actor name. | -**versionNumber** | **string** | Actor version. | - -### Other Parameters - -Other parameters are passed through a pointer to a apiActVersionEnvVarsPostRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - - **envVarRequest** | [**EnvVarRequest**](EnvVarRequest.md) | | - -### Return type - -[**EnvVarResponse**](EnvVarResponse.md) - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## ActVersionGet - -> VersionResponse ActVersionGet(ctx, actorId, versionNumber).Execute() - -Get version - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - actorId := "janedoe~my-actor" // string | Actor ID or a tilde-separated owner's username and Actor name. - versionNumber := "0.1" // string | Actor version. - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.ActorsActorVersionsAPI.ActVersionGet(context.Background(), actorId, versionNumber).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `ActorsActorVersionsAPI.ActVersionGet``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `ActVersionGet`: VersionResponse - fmt.Fprintf(os.Stdout, "Response from `ActorsActorVersionsAPI.ActVersionGet`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**actorId** | **string** | Actor ID or a tilde-separated owner's username and Actor name. | -**versionNumber** | **string** | Actor version. | - -### Other Parameters - -Other parameters are passed through a pointer to a apiActVersionGetRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - - -### Return type - -[**VersionResponse**](VersionResponse.md) - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## ActVersionPost - -> VersionResponse ActVersionPost(ctx, actorId, versionNumber).CreateOrUpdateVersionRequest(createOrUpdateVersionRequest).Execute() - -Update version (POST) - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - actorId := "janedoe~my-actor" // string | Actor ID or a tilde-separated owner's username and Actor name. - versionNumber := "0.1" // string | Actor version. - createOrUpdateVersionRequest := *openapiclient.NewCreateOrUpdateVersionRequest() // CreateOrUpdateVersionRequest | - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.ActorsActorVersionsAPI.ActVersionPost(context.Background(), actorId, versionNumber).CreateOrUpdateVersionRequest(createOrUpdateVersionRequest).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `ActorsActorVersionsAPI.ActVersionPost``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `ActVersionPost`: VersionResponse - fmt.Fprintf(os.Stdout, "Response from `ActorsActorVersionsAPI.ActVersionPost`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**actorId** | **string** | Actor ID or a tilde-separated owner's username and Actor name. | -**versionNumber** | **string** | Actor version. | - -### Other Parameters - -Other parameters are passed through a pointer to a apiActVersionPostRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - - **createOrUpdateVersionRequest** | [**CreateOrUpdateVersionRequest**](CreateOrUpdateVersionRequest.md) | | - -### Return type - -[**VersionResponse**](VersionResponse.md) - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## ActVersionPut - -> VersionResponse ActVersionPut(ctx, actorId, versionNumber).CreateOrUpdateVersionRequest(createOrUpdateVersionRequest).Execute() - -Update version - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - actorId := "janedoe~my-actor" // string | Actor ID or a tilde-separated owner's username and Actor name. - versionNumber := "0.1" // string | Actor version. - createOrUpdateVersionRequest := *openapiclient.NewCreateOrUpdateVersionRequest() // CreateOrUpdateVersionRequest | - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.ActorsActorVersionsAPI.ActVersionPut(context.Background(), actorId, versionNumber).CreateOrUpdateVersionRequest(createOrUpdateVersionRequest).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `ActorsActorVersionsAPI.ActVersionPut``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `ActVersionPut`: VersionResponse - fmt.Fprintf(os.Stdout, "Response from `ActorsActorVersionsAPI.ActVersionPut`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**actorId** | **string** | Actor ID or a tilde-separated owner's username and Actor name. | -**versionNumber** | **string** | Actor version. | - -### Other Parameters - -Other parameters are passed through a pointer to a apiActVersionPutRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - - **createOrUpdateVersionRequest** | [**CreateOrUpdateVersionRequest**](CreateOrUpdateVersionRequest.md) | | - -### Return type - -[**VersionResponse**](VersionResponse.md) - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## ActVersionsGet - -> ListOfVersionsResponse ActVersionsGet(ctx, actorId).Execute() - -Get list of versions - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - actorId := "janedoe~my-actor" // string | Actor ID or a tilde-separated owner's username and Actor name. - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.ActorsActorVersionsAPI.ActVersionsGet(context.Background(), actorId).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `ActorsActorVersionsAPI.ActVersionsGet``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `ActVersionsGet`: ListOfVersionsResponse - fmt.Fprintf(os.Stdout, "Response from `ActorsActorVersionsAPI.ActVersionsGet`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**actorId** | **string** | Actor ID or a tilde-separated owner's username and Actor name. | - -### Other Parameters - -Other parameters are passed through a pointer to a apiActVersionsGetRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - -### Return type - -[**ListOfVersionsResponse**](ListOfVersionsResponse.md) - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## ActVersionsPost - -> VersionResponse ActVersionsPost(ctx, actorId).CreateOrUpdateVersionRequest(createOrUpdateVersionRequest).Execute() - -Create version - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - actorId := "janedoe~my-actor" // string | Actor ID or a tilde-separated owner's username and Actor name. - createOrUpdateVersionRequest := *openapiclient.NewCreateOrUpdateVersionRequest() // CreateOrUpdateVersionRequest | - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.ActorsActorVersionsAPI.ActVersionsPost(context.Background(), actorId).CreateOrUpdateVersionRequest(createOrUpdateVersionRequest).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `ActorsActorVersionsAPI.ActVersionsPost``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `ActVersionsPost`: VersionResponse - fmt.Fprintf(os.Stdout, "Response from `ActorsActorVersionsAPI.ActVersionsPost`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**actorId** | **string** | Actor ID or a tilde-separated owner's username and Actor name. | - -### Other Parameters - -Other parameters are passed through a pointer to a apiActVersionsPostRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - **createOrUpdateVersionRequest** | [**CreateOrUpdateVersionRequest**](CreateOrUpdateVersionRequest.md) | | - -### Return type - -[**VersionResponse**](VersionResponse.md) - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - diff --git a/docs/ActorsWebhookCollectionAPI.md b/docs/ActorsWebhookCollectionAPI.md deleted file mode 100644 index 49afb0d..0000000 --- a/docs/ActorsWebhookCollectionAPI.md +++ /dev/null @@ -1,85 +0,0 @@ -# \ActorsWebhookCollectionAPI - -All URIs are relative to *https://api.apify.com* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**ActWebhooksGet**](ActorsWebhookCollectionAPI.md#ActWebhooksGet) | **Get** /v2/actors/{actorId}/webhooks | Get list of webhooks - - - -## ActWebhooksGet - -> ListOfWebhooksResponse ActWebhooksGet(ctx, actorId).Offset(offset).Limit(limit).Desc(desc).Execute() - -Get list of webhooks - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - actorId := "janedoe~my-actor" // string | Actor ID or a tilde-separated owner's username and Actor name. - offset := float64(0) // float64 | Number of items that should be skipped at the start. The default value is `0`. (optional) - limit := float64(1000) // float64 | Maximum number of items to return. The default value as well as the maximum is `1000`. (optional) - desc := true // bool | If `true` or `1` then the objects are sorted by the `createdAt` field in descending order. By default, they are sorted in ascending order. (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.ActorsWebhookCollectionAPI.ActWebhooksGet(context.Background(), actorId).Offset(offset).Limit(limit).Desc(desc).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `ActorsWebhookCollectionAPI.ActWebhooksGet``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `ActWebhooksGet`: ListOfWebhooksResponse - fmt.Fprintf(os.Stdout, "Response from `ActorsWebhookCollectionAPI.ActWebhooksGet`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**actorId** | **string** | Actor ID or a tilde-separated owner's username and Actor name. | - -### Other Parameters - -Other parameters are passed through a pointer to a apiActWebhooksGetRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - **offset** | **float64** | Number of items that should be skipped at the start. The default value is `0`. | - **limit** | **float64** | Maximum number of items to return. The default value as well as the maximum is `1000`. | - **desc** | **bool** | If `true` or `1` then the objects are sorted by the `createdAt` field in descending order. By default, they are sorted in ascending order. | - -### Return type - -[**ListOfWebhooksResponse**](ListOfWebhooksResponse.md) - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - diff --git a/docs/AddRequestResponse.md b/docs/AddRequestResponse.md deleted file mode 100644 index 6c88213..0000000 --- a/docs/AddRequestResponse.md +++ /dev/null @@ -1,51 +0,0 @@ -# AddRequestResponse - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Data** | [**RequestRegistration**](RequestRegistration.md) | | - -## Methods - -### NewAddRequestResponse - -`func NewAddRequestResponse(data RequestRegistration, ) *AddRequestResponse` - -NewAddRequestResponse instantiates a new AddRequestResponse object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewAddRequestResponseWithDefaults - -`func NewAddRequestResponseWithDefaults() *AddRequestResponse` - -NewAddRequestResponseWithDefaults instantiates a new AddRequestResponse object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetData - -`func (o *AddRequestResponse) GetData() RequestRegistration` - -GetData returns the Data field if non-nil, zero value otherwise. - -### GetDataOk - -`func (o *AddRequestResponse) GetDataOk() (*RequestRegistration, bool)` - -GetDataOk returns a tuple with the Data field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetData - -`func (o *AddRequestResponse) SetData(v RequestRegistration)` - -SetData sets Data field to given value. - - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/AddedRequest.md b/docs/AddedRequest.md deleted file mode 100644 index 4c82ec4..0000000 --- a/docs/AddedRequest.md +++ /dev/null @@ -1,114 +0,0 @@ -# AddedRequest - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**RequestId** | **string** | A unique identifier assigned to the request. | -**UniqueKey** | **string** | A unique key used for request de-duplication. Requests with the same unique key are considered identical. | -**WasAlreadyPresent** | **bool** | Indicates whether a request with the same unique key already existed in the request queue. If true, no new request was created. | -**WasAlreadyHandled** | **bool** | Indicates whether a request with the same unique key has already been processed by the request queue. | - -## Methods - -### NewAddedRequest - -`func NewAddedRequest(requestId string, uniqueKey string, wasAlreadyPresent bool, wasAlreadyHandled bool, ) *AddedRequest` - -NewAddedRequest instantiates a new AddedRequest object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewAddedRequestWithDefaults - -`func NewAddedRequestWithDefaults() *AddedRequest` - -NewAddedRequestWithDefaults instantiates a new AddedRequest object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetRequestId - -`func (o *AddedRequest) GetRequestId() string` - -GetRequestId returns the RequestId field if non-nil, zero value otherwise. - -### GetRequestIdOk - -`func (o *AddedRequest) GetRequestIdOk() (*string, bool)` - -GetRequestIdOk returns a tuple with the RequestId field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetRequestId - -`func (o *AddedRequest) SetRequestId(v string)` - -SetRequestId sets RequestId field to given value. - - -### GetUniqueKey - -`func (o *AddedRequest) GetUniqueKey() string` - -GetUniqueKey returns the UniqueKey field if non-nil, zero value otherwise. - -### GetUniqueKeyOk - -`func (o *AddedRequest) GetUniqueKeyOk() (*string, bool)` - -GetUniqueKeyOk returns a tuple with the UniqueKey field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetUniqueKey - -`func (o *AddedRequest) SetUniqueKey(v string)` - -SetUniqueKey sets UniqueKey field to given value. - - -### GetWasAlreadyPresent - -`func (o *AddedRequest) GetWasAlreadyPresent() bool` - -GetWasAlreadyPresent returns the WasAlreadyPresent field if non-nil, zero value otherwise. - -### GetWasAlreadyPresentOk - -`func (o *AddedRequest) GetWasAlreadyPresentOk() (*bool, bool)` - -GetWasAlreadyPresentOk returns a tuple with the WasAlreadyPresent field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetWasAlreadyPresent - -`func (o *AddedRequest) SetWasAlreadyPresent(v bool)` - -SetWasAlreadyPresent sets WasAlreadyPresent field to given value. - - -### GetWasAlreadyHandled - -`func (o *AddedRequest) GetWasAlreadyHandled() bool` - -GetWasAlreadyHandled returns the WasAlreadyHandled field if non-nil, zero value otherwise. - -### GetWasAlreadyHandledOk - -`func (o *AddedRequest) GetWasAlreadyHandledOk() (*bool, bool)` - -GetWasAlreadyHandledOk returns a tuple with the WasAlreadyHandled field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetWasAlreadyHandled - -`func (o *AddedRequest) SetWasAlreadyHandled(v bool)` - -SetWasAlreadyHandled sets WasAlreadyHandled field to given value. - - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/BatchAddResponse.md b/docs/BatchAddResponse.md deleted file mode 100644 index fc57018..0000000 --- a/docs/BatchAddResponse.md +++ /dev/null @@ -1,51 +0,0 @@ -# BatchAddResponse - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Data** | [**BatchAddResult**](BatchAddResult.md) | | - -## Methods - -### NewBatchAddResponse - -`func NewBatchAddResponse(data BatchAddResult, ) *BatchAddResponse` - -NewBatchAddResponse instantiates a new BatchAddResponse object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewBatchAddResponseWithDefaults - -`func NewBatchAddResponseWithDefaults() *BatchAddResponse` - -NewBatchAddResponseWithDefaults instantiates a new BatchAddResponse object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetData - -`func (o *BatchAddResponse) GetData() BatchAddResult` - -GetData returns the Data field if non-nil, zero value otherwise. - -### GetDataOk - -`func (o *BatchAddResponse) GetDataOk() (*BatchAddResult, bool)` - -GetDataOk returns a tuple with the Data field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetData - -`func (o *BatchAddResponse) SetData(v BatchAddResult)` - -SetData sets Data field to given value. - - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/BatchAddResult.md b/docs/BatchAddResult.md deleted file mode 100644 index 30667ce..0000000 --- a/docs/BatchAddResult.md +++ /dev/null @@ -1,72 +0,0 @@ -# BatchAddResult - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**ProcessedRequests** | [**[]AddedRequest**](AddedRequest.md) | Requests that were successfully added to the request queue. | -**UnprocessedRequests** | [**[]RequestDraft**](RequestDraft.md) | Requests that failed to be added and can be retried. | - -## Methods - -### NewBatchAddResult - -`func NewBatchAddResult(processedRequests []AddedRequest, unprocessedRequests []RequestDraft, ) *BatchAddResult` - -NewBatchAddResult instantiates a new BatchAddResult object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewBatchAddResultWithDefaults - -`func NewBatchAddResultWithDefaults() *BatchAddResult` - -NewBatchAddResultWithDefaults instantiates a new BatchAddResult object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetProcessedRequests - -`func (o *BatchAddResult) GetProcessedRequests() []AddedRequest` - -GetProcessedRequests returns the ProcessedRequests field if non-nil, zero value otherwise. - -### GetProcessedRequestsOk - -`func (o *BatchAddResult) GetProcessedRequestsOk() (*[]AddedRequest, bool)` - -GetProcessedRequestsOk returns a tuple with the ProcessedRequests field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetProcessedRequests - -`func (o *BatchAddResult) SetProcessedRequests(v []AddedRequest)` - -SetProcessedRequests sets ProcessedRequests field to given value. - - -### GetUnprocessedRequests - -`func (o *BatchAddResult) GetUnprocessedRequests() []RequestDraft` - -GetUnprocessedRequests returns the UnprocessedRequests field if non-nil, zero value otherwise. - -### GetUnprocessedRequestsOk - -`func (o *BatchAddResult) GetUnprocessedRequestsOk() (*[]RequestDraft, bool)` - -GetUnprocessedRequestsOk returns a tuple with the UnprocessedRequests field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetUnprocessedRequests - -`func (o *BatchAddResult) SetUnprocessedRequests(v []RequestDraft)` - -SetUnprocessedRequests sets UnprocessedRequests field to given value. - - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/BatchDeleteResponse.md b/docs/BatchDeleteResponse.md deleted file mode 100644 index 2191e91..0000000 --- a/docs/BatchDeleteResponse.md +++ /dev/null @@ -1,51 +0,0 @@ -# BatchDeleteResponse - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Data** | [**BatchDeleteResult**](BatchDeleteResult.md) | | - -## Methods - -### NewBatchDeleteResponse - -`func NewBatchDeleteResponse(data BatchDeleteResult, ) *BatchDeleteResponse` - -NewBatchDeleteResponse instantiates a new BatchDeleteResponse object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewBatchDeleteResponseWithDefaults - -`func NewBatchDeleteResponseWithDefaults() *BatchDeleteResponse` - -NewBatchDeleteResponseWithDefaults instantiates a new BatchDeleteResponse object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetData - -`func (o *BatchDeleteResponse) GetData() BatchDeleteResult` - -GetData returns the Data field if non-nil, zero value otherwise. - -### GetDataOk - -`func (o *BatchDeleteResponse) GetDataOk() (*BatchDeleteResult, bool)` - -GetDataOk returns a tuple with the Data field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetData - -`func (o *BatchDeleteResponse) SetData(v BatchDeleteResult)` - -SetData sets Data field to given value. - - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/BatchDeleteResult.md b/docs/BatchDeleteResult.md deleted file mode 100644 index 9b5ce9e..0000000 --- a/docs/BatchDeleteResult.md +++ /dev/null @@ -1,72 +0,0 @@ -# BatchDeleteResult - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**ProcessedRequests** | [**[]DeletedRequest**](DeletedRequest.md) | Requests that were successfully deleted from the request queue. | -**UnprocessedRequests** | [**[]RequestDraft**](RequestDraft.md) | Requests that failed to be deleted and can be retried. | - -## Methods - -### NewBatchDeleteResult - -`func NewBatchDeleteResult(processedRequests []DeletedRequest, unprocessedRequests []RequestDraft, ) *BatchDeleteResult` - -NewBatchDeleteResult instantiates a new BatchDeleteResult object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewBatchDeleteResultWithDefaults - -`func NewBatchDeleteResultWithDefaults() *BatchDeleteResult` - -NewBatchDeleteResultWithDefaults instantiates a new BatchDeleteResult object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetProcessedRequests - -`func (o *BatchDeleteResult) GetProcessedRequests() []DeletedRequest` - -GetProcessedRequests returns the ProcessedRequests field if non-nil, zero value otherwise. - -### GetProcessedRequestsOk - -`func (o *BatchDeleteResult) GetProcessedRequestsOk() (*[]DeletedRequest, bool)` - -GetProcessedRequestsOk returns a tuple with the ProcessedRequests field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetProcessedRequests - -`func (o *BatchDeleteResult) SetProcessedRequests(v []DeletedRequest)` - -SetProcessedRequests sets ProcessedRequests field to given value. - - -### GetUnprocessedRequests - -`func (o *BatchDeleteResult) GetUnprocessedRequests() []RequestDraft` - -GetUnprocessedRequests returns the UnprocessedRequests field if non-nil, zero value otherwise. - -### GetUnprocessedRequestsOk - -`func (o *BatchDeleteResult) GetUnprocessedRequestsOk() (*[]RequestDraft, bool)` - -GetUnprocessedRequestsOk returns a tuple with the UnprocessedRequests field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetUnprocessedRequests - -`func (o *BatchDeleteResult) SetUnprocessedRequests(v []RequestDraft)` - -SetUnprocessedRequests sets UnprocessedRequests field to given value. - - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/BrowserInfoResponse.md b/docs/BrowserInfoResponse.md deleted file mode 100644 index babc5d0..0000000 --- a/docs/BrowserInfoResponse.md +++ /dev/null @@ -1,186 +0,0 @@ -# BrowserInfoResponse - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Method** | **string** | HTTP method of the request. | -**ClientIp** | **NullableString** | IP address of the client. | -**CountryCode** | **NullableString** | Two-letter country code resolved from the client IP address. | -**BodyLength** | **int32** | Length of the request body in bytes. | -**Headers** | Pointer to [**map[string]BrowserInfoResponseHeadersValue**](BrowserInfoResponseHeadersValue.md) | Request headers. Omitted when `skipHeaders=true`. | [optional] -**RawHeaders** | Pointer to **[]string** | Raw request headers as a flat list of alternating name/value strings. Included only when `rawHeaders=true`. | [optional] - -## Methods - -### NewBrowserInfoResponse - -`func NewBrowserInfoResponse(method string, clientIp NullableString, countryCode NullableString, bodyLength int32, ) *BrowserInfoResponse` - -NewBrowserInfoResponse instantiates a new BrowserInfoResponse object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewBrowserInfoResponseWithDefaults - -`func NewBrowserInfoResponseWithDefaults() *BrowserInfoResponse` - -NewBrowserInfoResponseWithDefaults instantiates a new BrowserInfoResponse object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetMethod - -`func (o *BrowserInfoResponse) GetMethod() string` - -GetMethod returns the Method field if non-nil, zero value otherwise. - -### GetMethodOk - -`func (o *BrowserInfoResponse) GetMethodOk() (*string, bool)` - -GetMethodOk returns a tuple with the Method field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetMethod - -`func (o *BrowserInfoResponse) SetMethod(v string)` - -SetMethod sets Method field to given value. - - -### GetClientIp - -`func (o *BrowserInfoResponse) GetClientIp() string` - -GetClientIp returns the ClientIp field if non-nil, zero value otherwise. - -### GetClientIpOk - -`func (o *BrowserInfoResponse) GetClientIpOk() (*string, bool)` - -GetClientIpOk returns a tuple with the ClientIp field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetClientIp - -`func (o *BrowserInfoResponse) SetClientIp(v string)` - -SetClientIp sets ClientIp field to given value. - - -### SetClientIpNil - -`func (o *BrowserInfoResponse) SetClientIpNil(b bool)` - - SetClientIpNil sets the value for ClientIp to be an explicit nil - -### UnsetClientIp -`func (o *BrowserInfoResponse) UnsetClientIp()` - -UnsetClientIp ensures that no value is present for ClientIp, not even an explicit nil -### GetCountryCode - -`func (o *BrowserInfoResponse) GetCountryCode() string` - -GetCountryCode returns the CountryCode field if non-nil, zero value otherwise. - -### GetCountryCodeOk - -`func (o *BrowserInfoResponse) GetCountryCodeOk() (*string, bool)` - -GetCountryCodeOk returns a tuple with the CountryCode field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetCountryCode - -`func (o *BrowserInfoResponse) SetCountryCode(v string)` - -SetCountryCode sets CountryCode field to given value. - - -### SetCountryCodeNil - -`func (o *BrowserInfoResponse) SetCountryCodeNil(b bool)` - - SetCountryCodeNil sets the value for CountryCode to be an explicit nil - -### UnsetCountryCode -`func (o *BrowserInfoResponse) UnsetCountryCode()` - -UnsetCountryCode ensures that no value is present for CountryCode, not even an explicit nil -### GetBodyLength - -`func (o *BrowserInfoResponse) GetBodyLength() int32` - -GetBodyLength returns the BodyLength field if non-nil, zero value otherwise. - -### GetBodyLengthOk - -`func (o *BrowserInfoResponse) GetBodyLengthOk() (*int32, bool)` - -GetBodyLengthOk returns a tuple with the BodyLength field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetBodyLength - -`func (o *BrowserInfoResponse) SetBodyLength(v int32)` - -SetBodyLength sets BodyLength field to given value. - - -### GetHeaders - -`func (o *BrowserInfoResponse) GetHeaders() map[string]BrowserInfoResponseHeadersValue` - -GetHeaders returns the Headers field if non-nil, zero value otherwise. - -### GetHeadersOk - -`func (o *BrowserInfoResponse) GetHeadersOk() (*map[string]BrowserInfoResponseHeadersValue, bool)` - -GetHeadersOk returns a tuple with the Headers field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetHeaders - -`func (o *BrowserInfoResponse) SetHeaders(v map[string]BrowserInfoResponseHeadersValue)` - -SetHeaders sets Headers field to given value. - -### HasHeaders - -`func (o *BrowserInfoResponse) HasHeaders() bool` - -HasHeaders returns a boolean if a field has been set. - -### GetRawHeaders - -`func (o *BrowserInfoResponse) GetRawHeaders() []string` - -GetRawHeaders returns the RawHeaders field if non-nil, zero value otherwise. - -### GetRawHeadersOk - -`func (o *BrowserInfoResponse) GetRawHeadersOk() (*[]string, bool)` - -GetRawHeadersOk returns a tuple with the RawHeaders field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetRawHeaders - -`func (o *BrowserInfoResponse) SetRawHeaders(v []string)` - -SetRawHeaders sets RawHeaders field to given value. - -### HasRawHeaders - -`func (o *BrowserInfoResponse) HasRawHeaders() bool` - -HasRawHeaders returns a boolean if a field has been set. - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/BrowserInfoResponseHeadersValue.md b/docs/BrowserInfoResponseHeadersValue.md deleted file mode 100644 index 0a4be4c..0000000 --- a/docs/BrowserInfoResponseHeadersValue.md +++ /dev/null @@ -1,30 +0,0 @@ -# BrowserInfoResponseHeadersValue - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - -## Methods - -### NewBrowserInfoResponseHeadersValue - -`func NewBrowserInfoResponseHeadersValue() *BrowserInfoResponseHeadersValue` - -NewBrowserInfoResponseHeadersValue instantiates a new BrowserInfoResponseHeadersValue object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewBrowserInfoResponseHeadersValueWithDefaults - -`func NewBrowserInfoResponseHeadersValueWithDefaults() *BrowserInfoResponseHeadersValue` - -NewBrowserInfoResponseHeadersValueWithDefaults instantiates a new BrowserInfoResponseHeadersValue object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/Build.md b/docs/Build.md deleted file mode 100644 index a10ccdc..0000000 --- a/docs/Build.md +++ /dev/null @@ -1,527 +0,0 @@ -# Build - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Id** | **string** | | -**ActId** | **string** | | -**UserId** | **string** | | -**StartedAt** | **time.Time** | | -**FinishedAt** | Pointer to **NullableTime** | | [optional] -**Status** | [**ActorJobStatus**](ActorJobStatus.md) | | -**Meta** | [**BuildsMeta**](BuildsMeta.md) | | -**Stats** | Pointer to [**NullableBuildStats**](BuildStats.md) | | [optional] -**Options** | Pointer to [**NullableBuildOptions**](BuildOptions.md) | | [optional] -**Usage** | Pointer to [**NullableBuildUsage**](BuildUsage.md) | | [optional] -**UsageTotalUsd** | Pointer to **NullableFloat32** | Total cost in USD for this build. Requires authentication token to access. | [optional] -**UsageUsd** | Pointer to [**NullableBuildUsage**](BuildUsage.md) | Platform usage costs breakdown in USD for this build. Requires authentication token to access. | [optional] -**InputSchema** | Pointer to **NullableString** | | [optional] -**Readme** | Pointer to **NullableString** | | [optional] -**BuildNumber** | **string** | | -**ActVersion** | Pointer to [**BuildActVersion**](BuildActVersion.md) | | [optional] -**ActorDefinition** | Pointer to [**NullableActorDefinition**](ActorDefinition.md) | | [optional] - -## Methods - -### NewBuild - -`func NewBuild(id string, actId string, userId string, startedAt time.Time, status ActorJobStatus, meta BuildsMeta, buildNumber string, ) *Build` - -NewBuild instantiates a new Build object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewBuildWithDefaults - -`func NewBuildWithDefaults() *Build` - -NewBuildWithDefaults instantiates a new Build object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetId - -`func (o *Build) GetId() string` - -GetId returns the Id field if non-nil, zero value otherwise. - -### GetIdOk - -`func (o *Build) GetIdOk() (*string, bool)` - -GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetId - -`func (o *Build) SetId(v string)` - -SetId sets Id field to given value. - - -### GetActId - -`func (o *Build) GetActId() string` - -GetActId returns the ActId field if non-nil, zero value otherwise. - -### GetActIdOk - -`func (o *Build) GetActIdOk() (*string, bool)` - -GetActIdOk returns a tuple with the ActId field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetActId - -`func (o *Build) SetActId(v string)` - -SetActId sets ActId field to given value. - - -### GetUserId - -`func (o *Build) GetUserId() string` - -GetUserId returns the UserId field if non-nil, zero value otherwise. - -### GetUserIdOk - -`func (o *Build) GetUserIdOk() (*string, bool)` - -GetUserIdOk returns a tuple with the UserId field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetUserId - -`func (o *Build) SetUserId(v string)` - -SetUserId sets UserId field to given value. - - -### GetStartedAt - -`func (o *Build) GetStartedAt() time.Time` - -GetStartedAt returns the StartedAt field if non-nil, zero value otherwise. - -### GetStartedAtOk - -`func (o *Build) GetStartedAtOk() (*time.Time, bool)` - -GetStartedAtOk returns a tuple with the StartedAt field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetStartedAt - -`func (o *Build) SetStartedAt(v time.Time)` - -SetStartedAt sets StartedAt field to given value. - - -### GetFinishedAt - -`func (o *Build) GetFinishedAt() time.Time` - -GetFinishedAt returns the FinishedAt field if non-nil, zero value otherwise. - -### GetFinishedAtOk - -`func (o *Build) GetFinishedAtOk() (*time.Time, bool)` - -GetFinishedAtOk returns a tuple with the FinishedAt field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetFinishedAt - -`func (o *Build) SetFinishedAt(v time.Time)` - -SetFinishedAt sets FinishedAt field to given value. - -### HasFinishedAt - -`func (o *Build) HasFinishedAt() bool` - -HasFinishedAt returns a boolean if a field has been set. - -### SetFinishedAtNil - -`func (o *Build) SetFinishedAtNil(b bool)` - - SetFinishedAtNil sets the value for FinishedAt to be an explicit nil - -### UnsetFinishedAt -`func (o *Build) UnsetFinishedAt()` - -UnsetFinishedAt ensures that no value is present for FinishedAt, not even an explicit nil -### GetStatus - -`func (o *Build) GetStatus() ActorJobStatus` - -GetStatus returns the Status field if non-nil, zero value otherwise. - -### GetStatusOk - -`func (o *Build) GetStatusOk() (*ActorJobStatus, bool)` - -GetStatusOk returns a tuple with the Status field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetStatus - -`func (o *Build) SetStatus(v ActorJobStatus)` - -SetStatus sets Status field to given value. - - -### GetMeta - -`func (o *Build) GetMeta() BuildsMeta` - -GetMeta returns the Meta field if non-nil, zero value otherwise. - -### GetMetaOk - -`func (o *Build) GetMetaOk() (*BuildsMeta, bool)` - -GetMetaOk returns a tuple with the Meta field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetMeta - -`func (o *Build) SetMeta(v BuildsMeta)` - -SetMeta sets Meta field to given value. - - -### GetStats - -`func (o *Build) GetStats() BuildStats` - -GetStats returns the Stats field if non-nil, zero value otherwise. - -### GetStatsOk - -`func (o *Build) GetStatsOk() (*BuildStats, bool)` - -GetStatsOk returns a tuple with the Stats field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetStats - -`func (o *Build) SetStats(v BuildStats)` - -SetStats sets Stats field to given value. - -### HasStats - -`func (o *Build) HasStats() bool` - -HasStats returns a boolean if a field has been set. - -### SetStatsNil - -`func (o *Build) SetStatsNil(b bool)` - - SetStatsNil sets the value for Stats to be an explicit nil - -### UnsetStats -`func (o *Build) UnsetStats()` - -UnsetStats ensures that no value is present for Stats, not even an explicit nil -### GetOptions - -`func (o *Build) GetOptions() BuildOptions` - -GetOptions returns the Options field if non-nil, zero value otherwise. - -### GetOptionsOk - -`func (o *Build) GetOptionsOk() (*BuildOptions, bool)` - -GetOptionsOk returns a tuple with the Options field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetOptions - -`func (o *Build) SetOptions(v BuildOptions)` - -SetOptions sets Options field to given value. - -### HasOptions - -`func (o *Build) HasOptions() bool` - -HasOptions returns a boolean if a field has been set. - -### SetOptionsNil - -`func (o *Build) SetOptionsNil(b bool)` - - SetOptionsNil sets the value for Options to be an explicit nil - -### UnsetOptions -`func (o *Build) UnsetOptions()` - -UnsetOptions ensures that no value is present for Options, not even an explicit nil -### GetUsage - -`func (o *Build) GetUsage() BuildUsage` - -GetUsage returns the Usage field if non-nil, zero value otherwise. - -### GetUsageOk - -`func (o *Build) GetUsageOk() (*BuildUsage, bool)` - -GetUsageOk returns a tuple with the Usage field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetUsage - -`func (o *Build) SetUsage(v BuildUsage)` - -SetUsage sets Usage field to given value. - -### HasUsage - -`func (o *Build) HasUsage() bool` - -HasUsage returns a boolean if a field has been set. - -### SetUsageNil - -`func (o *Build) SetUsageNil(b bool)` - - SetUsageNil sets the value for Usage to be an explicit nil - -### UnsetUsage -`func (o *Build) UnsetUsage()` - -UnsetUsage ensures that no value is present for Usage, not even an explicit nil -### GetUsageTotalUsd - -`func (o *Build) GetUsageTotalUsd() float32` - -GetUsageTotalUsd returns the UsageTotalUsd field if non-nil, zero value otherwise. - -### GetUsageTotalUsdOk - -`func (o *Build) GetUsageTotalUsdOk() (*float32, bool)` - -GetUsageTotalUsdOk returns a tuple with the UsageTotalUsd field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetUsageTotalUsd - -`func (o *Build) SetUsageTotalUsd(v float32)` - -SetUsageTotalUsd sets UsageTotalUsd field to given value. - -### HasUsageTotalUsd - -`func (o *Build) HasUsageTotalUsd() bool` - -HasUsageTotalUsd returns a boolean if a field has been set. - -### SetUsageTotalUsdNil - -`func (o *Build) SetUsageTotalUsdNil(b bool)` - - SetUsageTotalUsdNil sets the value for UsageTotalUsd to be an explicit nil - -### UnsetUsageTotalUsd -`func (o *Build) UnsetUsageTotalUsd()` - -UnsetUsageTotalUsd ensures that no value is present for UsageTotalUsd, not even an explicit nil -### GetUsageUsd - -`func (o *Build) GetUsageUsd() BuildUsage` - -GetUsageUsd returns the UsageUsd field if non-nil, zero value otherwise. - -### GetUsageUsdOk - -`func (o *Build) GetUsageUsdOk() (*BuildUsage, bool)` - -GetUsageUsdOk returns a tuple with the UsageUsd field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetUsageUsd - -`func (o *Build) SetUsageUsd(v BuildUsage)` - -SetUsageUsd sets UsageUsd field to given value. - -### HasUsageUsd - -`func (o *Build) HasUsageUsd() bool` - -HasUsageUsd returns a boolean if a field has been set. - -### SetUsageUsdNil - -`func (o *Build) SetUsageUsdNil(b bool)` - - SetUsageUsdNil sets the value for UsageUsd to be an explicit nil - -### UnsetUsageUsd -`func (o *Build) UnsetUsageUsd()` - -UnsetUsageUsd ensures that no value is present for UsageUsd, not even an explicit nil -### GetInputSchema - -`func (o *Build) GetInputSchema() string` - -GetInputSchema returns the InputSchema field if non-nil, zero value otherwise. - -### GetInputSchemaOk - -`func (o *Build) GetInputSchemaOk() (*string, bool)` - -GetInputSchemaOk returns a tuple with the InputSchema field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetInputSchema - -`func (o *Build) SetInputSchema(v string)` - -SetInputSchema sets InputSchema field to given value. - -### HasInputSchema - -`func (o *Build) HasInputSchema() bool` - -HasInputSchema returns a boolean if a field has been set. - -### SetInputSchemaNil - -`func (o *Build) SetInputSchemaNil(b bool)` - - SetInputSchemaNil sets the value for InputSchema to be an explicit nil - -### UnsetInputSchema -`func (o *Build) UnsetInputSchema()` - -UnsetInputSchema ensures that no value is present for InputSchema, not even an explicit nil -### GetReadme - -`func (o *Build) GetReadme() string` - -GetReadme returns the Readme field if non-nil, zero value otherwise. - -### GetReadmeOk - -`func (o *Build) GetReadmeOk() (*string, bool)` - -GetReadmeOk returns a tuple with the Readme field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetReadme - -`func (o *Build) SetReadme(v string)` - -SetReadme sets Readme field to given value. - -### HasReadme - -`func (o *Build) HasReadme() bool` - -HasReadme returns a boolean if a field has been set. - -### SetReadmeNil - -`func (o *Build) SetReadmeNil(b bool)` - - SetReadmeNil sets the value for Readme to be an explicit nil - -### UnsetReadme -`func (o *Build) UnsetReadme()` - -UnsetReadme ensures that no value is present for Readme, not even an explicit nil -### GetBuildNumber - -`func (o *Build) GetBuildNumber() string` - -GetBuildNumber returns the BuildNumber field if non-nil, zero value otherwise. - -### GetBuildNumberOk - -`func (o *Build) GetBuildNumberOk() (*string, bool)` - -GetBuildNumberOk returns a tuple with the BuildNumber field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetBuildNumber - -`func (o *Build) SetBuildNumber(v string)` - -SetBuildNumber sets BuildNumber field to given value. - - -### GetActVersion - -`func (o *Build) GetActVersion() BuildActVersion` - -GetActVersion returns the ActVersion field if non-nil, zero value otherwise. - -### GetActVersionOk - -`func (o *Build) GetActVersionOk() (*BuildActVersion, bool)` - -GetActVersionOk returns a tuple with the ActVersion field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetActVersion - -`func (o *Build) SetActVersion(v BuildActVersion)` - -SetActVersion sets ActVersion field to given value. - -### HasActVersion - -`func (o *Build) HasActVersion() bool` - -HasActVersion returns a boolean if a field has been set. - -### GetActorDefinition - -`func (o *Build) GetActorDefinition() ActorDefinition` - -GetActorDefinition returns the ActorDefinition field if non-nil, zero value otherwise. - -### GetActorDefinitionOk - -`func (o *Build) GetActorDefinitionOk() (*ActorDefinition, bool)` - -GetActorDefinitionOk returns a tuple with the ActorDefinition field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetActorDefinition - -`func (o *Build) SetActorDefinition(v ActorDefinition)` - -SetActorDefinition sets ActorDefinition field to given value. - -### HasActorDefinition - -`func (o *Build) HasActorDefinition() bool` - -HasActorDefinition returns a boolean if a field has been set. - -### SetActorDefinitionNil - -`func (o *Build) SetActorDefinitionNil(b bool)` - - SetActorDefinitionNil sets the value for ActorDefinition to be an explicit nil - -### UnsetActorDefinition -`func (o *Build) UnsetActorDefinition()` - -UnsetActorDefinition ensures that no value is present for ActorDefinition, not even an explicit nil - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/BuildActVersion.md b/docs/BuildActVersion.md deleted file mode 100644 index cb83952..0000000 --- a/docs/BuildActVersion.md +++ /dev/null @@ -1,160 +0,0 @@ -# BuildActVersion - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**SourceType** | Pointer to [**VersionSourceType**](VersionSourceType.md) | | [optional] -**BuildTag** | Pointer to **string** | | [optional] -**VersionNumber** | Pointer to **string** | | [optional] -**GitRepoUrl** | Pointer to **string** | URL of the git repository, present when sourceType is GIT_REPO. | [optional] -**SourceFiles** | Pointer to [**[]SourceCodeFile**](SourceCodeFile.md) | Inline source files, present when sourceType is SOURCE_FILES. | [optional] - -## Methods - -### NewBuildActVersion - -`func NewBuildActVersion() *BuildActVersion` - -NewBuildActVersion instantiates a new BuildActVersion object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewBuildActVersionWithDefaults - -`func NewBuildActVersionWithDefaults() *BuildActVersion` - -NewBuildActVersionWithDefaults instantiates a new BuildActVersion object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetSourceType - -`func (o *BuildActVersion) GetSourceType() VersionSourceType` - -GetSourceType returns the SourceType field if non-nil, zero value otherwise. - -### GetSourceTypeOk - -`func (o *BuildActVersion) GetSourceTypeOk() (*VersionSourceType, bool)` - -GetSourceTypeOk returns a tuple with the SourceType field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetSourceType - -`func (o *BuildActVersion) SetSourceType(v VersionSourceType)` - -SetSourceType sets SourceType field to given value. - -### HasSourceType - -`func (o *BuildActVersion) HasSourceType() bool` - -HasSourceType returns a boolean if a field has been set. - -### GetBuildTag - -`func (o *BuildActVersion) GetBuildTag() string` - -GetBuildTag returns the BuildTag field if non-nil, zero value otherwise. - -### GetBuildTagOk - -`func (o *BuildActVersion) GetBuildTagOk() (*string, bool)` - -GetBuildTagOk returns a tuple with the BuildTag field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetBuildTag - -`func (o *BuildActVersion) SetBuildTag(v string)` - -SetBuildTag sets BuildTag field to given value. - -### HasBuildTag - -`func (o *BuildActVersion) HasBuildTag() bool` - -HasBuildTag returns a boolean if a field has been set. - -### GetVersionNumber - -`func (o *BuildActVersion) GetVersionNumber() string` - -GetVersionNumber returns the VersionNumber field if non-nil, zero value otherwise. - -### GetVersionNumberOk - -`func (o *BuildActVersion) GetVersionNumberOk() (*string, bool)` - -GetVersionNumberOk returns a tuple with the VersionNumber field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetVersionNumber - -`func (o *BuildActVersion) SetVersionNumber(v string)` - -SetVersionNumber sets VersionNumber field to given value. - -### HasVersionNumber - -`func (o *BuildActVersion) HasVersionNumber() bool` - -HasVersionNumber returns a boolean if a field has been set. - -### GetGitRepoUrl - -`func (o *BuildActVersion) GetGitRepoUrl() string` - -GetGitRepoUrl returns the GitRepoUrl field if non-nil, zero value otherwise. - -### GetGitRepoUrlOk - -`func (o *BuildActVersion) GetGitRepoUrlOk() (*string, bool)` - -GetGitRepoUrlOk returns a tuple with the GitRepoUrl field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetGitRepoUrl - -`func (o *BuildActVersion) SetGitRepoUrl(v string)` - -SetGitRepoUrl sets GitRepoUrl field to given value. - -### HasGitRepoUrl - -`func (o *BuildActVersion) HasGitRepoUrl() bool` - -HasGitRepoUrl returns a boolean if a field has been set. - -### GetSourceFiles - -`func (o *BuildActVersion) GetSourceFiles() []SourceCodeFile` - -GetSourceFiles returns the SourceFiles field if non-nil, zero value otherwise. - -### GetSourceFilesOk - -`func (o *BuildActVersion) GetSourceFilesOk() (*[]SourceCodeFile, bool)` - -GetSourceFilesOk returns a tuple with the SourceFiles field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetSourceFiles - -`func (o *BuildActVersion) SetSourceFiles(v []SourceCodeFile)` - -SetSourceFiles sets SourceFiles field to given value. - -### HasSourceFiles - -`func (o *BuildActVersion) HasSourceFiles() bool` - -HasSourceFiles returns a boolean if a field has been set. - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/BuildOptions.md b/docs/BuildOptions.md deleted file mode 100644 index 152c405..0000000 --- a/docs/BuildOptions.md +++ /dev/null @@ -1,174 +0,0 @@ -# BuildOptions - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**UseCache** | Pointer to **NullableBool** | | [optional] -**BetaPackages** | Pointer to **NullableBool** | | [optional] -**MemoryMbytes** | Pointer to **NullableInt32** | | [optional] -**DiskMbytes** | Pointer to **NullableInt32** | | [optional] - -## Methods - -### NewBuildOptions - -`func NewBuildOptions() *BuildOptions` - -NewBuildOptions instantiates a new BuildOptions object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewBuildOptionsWithDefaults - -`func NewBuildOptionsWithDefaults() *BuildOptions` - -NewBuildOptionsWithDefaults instantiates a new BuildOptions object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetUseCache - -`func (o *BuildOptions) GetUseCache() bool` - -GetUseCache returns the UseCache field if non-nil, zero value otherwise. - -### GetUseCacheOk - -`func (o *BuildOptions) GetUseCacheOk() (*bool, bool)` - -GetUseCacheOk returns a tuple with the UseCache field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetUseCache - -`func (o *BuildOptions) SetUseCache(v bool)` - -SetUseCache sets UseCache field to given value. - -### HasUseCache - -`func (o *BuildOptions) HasUseCache() bool` - -HasUseCache returns a boolean if a field has been set. - -### SetUseCacheNil - -`func (o *BuildOptions) SetUseCacheNil(b bool)` - - SetUseCacheNil sets the value for UseCache to be an explicit nil - -### UnsetUseCache -`func (o *BuildOptions) UnsetUseCache()` - -UnsetUseCache ensures that no value is present for UseCache, not even an explicit nil -### GetBetaPackages - -`func (o *BuildOptions) GetBetaPackages() bool` - -GetBetaPackages returns the BetaPackages field if non-nil, zero value otherwise. - -### GetBetaPackagesOk - -`func (o *BuildOptions) GetBetaPackagesOk() (*bool, bool)` - -GetBetaPackagesOk returns a tuple with the BetaPackages field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetBetaPackages - -`func (o *BuildOptions) SetBetaPackages(v bool)` - -SetBetaPackages sets BetaPackages field to given value. - -### HasBetaPackages - -`func (o *BuildOptions) HasBetaPackages() bool` - -HasBetaPackages returns a boolean if a field has been set. - -### SetBetaPackagesNil - -`func (o *BuildOptions) SetBetaPackagesNil(b bool)` - - SetBetaPackagesNil sets the value for BetaPackages to be an explicit nil - -### UnsetBetaPackages -`func (o *BuildOptions) UnsetBetaPackages()` - -UnsetBetaPackages ensures that no value is present for BetaPackages, not even an explicit nil -### GetMemoryMbytes - -`func (o *BuildOptions) GetMemoryMbytes() int32` - -GetMemoryMbytes returns the MemoryMbytes field if non-nil, zero value otherwise. - -### GetMemoryMbytesOk - -`func (o *BuildOptions) GetMemoryMbytesOk() (*int32, bool)` - -GetMemoryMbytesOk returns a tuple with the MemoryMbytes field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetMemoryMbytes - -`func (o *BuildOptions) SetMemoryMbytes(v int32)` - -SetMemoryMbytes sets MemoryMbytes field to given value. - -### HasMemoryMbytes - -`func (o *BuildOptions) HasMemoryMbytes() bool` - -HasMemoryMbytes returns a boolean if a field has been set. - -### SetMemoryMbytesNil - -`func (o *BuildOptions) SetMemoryMbytesNil(b bool)` - - SetMemoryMbytesNil sets the value for MemoryMbytes to be an explicit nil - -### UnsetMemoryMbytes -`func (o *BuildOptions) UnsetMemoryMbytes()` - -UnsetMemoryMbytes ensures that no value is present for MemoryMbytes, not even an explicit nil -### GetDiskMbytes - -`func (o *BuildOptions) GetDiskMbytes() int32` - -GetDiskMbytes returns the DiskMbytes field if non-nil, zero value otherwise. - -### GetDiskMbytesOk - -`func (o *BuildOptions) GetDiskMbytesOk() (*int32, bool)` - -GetDiskMbytesOk returns a tuple with the DiskMbytes field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetDiskMbytes - -`func (o *BuildOptions) SetDiskMbytes(v int32)` - -SetDiskMbytes sets DiskMbytes field to given value. - -### HasDiskMbytes - -`func (o *BuildOptions) HasDiskMbytes() bool` - -HasDiskMbytes returns a boolean if a field has been set. - -### SetDiskMbytesNil - -`func (o *BuildOptions) SetDiskMbytesNil(b bool)` - - SetDiskMbytesNil sets the value for DiskMbytes to be an explicit nil - -### UnsetDiskMbytes -`func (o *BuildOptions) UnsetDiskMbytes()` - -UnsetDiskMbytes ensures that no value is present for DiskMbytes, not even an explicit nil - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/BuildResponse.md b/docs/BuildResponse.md deleted file mode 100644 index c0d617d..0000000 --- a/docs/BuildResponse.md +++ /dev/null @@ -1,51 +0,0 @@ -# BuildResponse - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Data** | [**Build**](Build.md) | | - -## Methods - -### NewBuildResponse - -`func NewBuildResponse(data Build, ) *BuildResponse` - -NewBuildResponse instantiates a new BuildResponse object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewBuildResponseWithDefaults - -`func NewBuildResponseWithDefaults() *BuildResponse` - -NewBuildResponseWithDefaults instantiates a new BuildResponse object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetData - -`func (o *BuildResponse) GetData() Build` - -GetData returns the Data field if non-nil, zero value otherwise. - -### GetDataOk - -`func (o *BuildResponse) GetDataOk() (*Build, bool)` - -GetDataOk returns a tuple with the Data field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetData - -`func (o *BuildResponse) SetData(v Build)` - -SetData sets Data field to given value. - - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/BuildShort.md b/docs/BuildShort.md deleted file mode 100644 index 6118159..0000000 --- a/docs/BuildShort.md +++ /dev/null @@ -1,275 +0,0 @@ -# BuildShort - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Id** | **string** | | -**ActId** | Pointer to **string** | | [optional] -**UserId** | Pointer to **string** | | [optional] -**Status** | [**ActorJobStatus**](ActorJobStatus.md) | | -**StartedAt** | **time.Time** | | -**FinishedAt** | Pointer to **NullableTime** | | [optional] -**UsageTotalUsd** | **float32** | | -**BuildNumber** | **string** | | -**BuildNumberInt** | Pointer to **int32** | | [optional] -**Meta** | Pointer to [**BuildsMeta**](BuildsMeta.md) | | [optional] - -## Methods - -### NewBuildShort - -`func NewBuildShort(id string, status ActorJobStatus, startedAt time.Time, usageTotalUsd float32, buildNumber string, ) *BuildShort` - -NewBuildShort instantiates a new BuildShort object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewBuildShortWithDefaults - -`func NewBuildShortWithDefaults() *BuildShort` - -NewBuildShortWithDefaults instantiates a new BuildShort object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetId - -`func (o *BuildShort) GetId() string` - -GetId returns the Id field if non-nil, zero value otherwise. - -### GetIdOk - -`func (o *BuildShort) GetIdOk() (*string, bool)` - -GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetId - -`func (o *BuildShort) SetId(v string)` - -SetId sets Id field to given value. - - -### GetActId - -`func (o *BuildShort) GetActId() string` - -GetActId returns the ActId field if non-nil, zero value otherwise. - -### GetActIdOk - -`func (o *BuildShort) GetActIdOk() (*string, bool)` - -GetActIdOk returns a tuple with the ActId field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetActId - -`func (o *BuildShort) SetActId(v string)` - -SetActId sets ActId field to given value. - -### HasActId - -`func (o *BuildShort) HasActId() bool` - -HasActId returns a boolean if a field has been set. - -### GetUserId - -`func (o *BuildShort) GetUserId() string` - -GetUserId returns the UserId field if non-nil, zero value otherwise. - -### GetUserIdOk - -`func (o *BuildShort) GetUserIdOk() (*string, bool)` - -GetUserIdOk returns a tuple with the UserId field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetUserId - -`func (o *BuildShort) SetUserId(v string)` - -SetUserId sets UserId field to given value. - -### HasUserId - -`func (o *BuildShort) HasUserId() bool` - -HasUserId returns a boolean if a field has been set. - -### GetStatus - -`func (o *BuildShort) GetStatus() ActorJobStatus` - -GetStatus returns the Status field if non-nil, zero value otherwise. - -### GetStatusOk - -`func (o *BuildShort) GetStatusOk() (*ActorJobStatus, bool)` - -GetStatusOk returns a tuple with the Status field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetStatus - -`func (o *BuildShort) SetStatus(v ActorJobStatus)` - -SetStatus sets Status field to given value. - - -### GetStartedAt - -`func (o *BuildShort) GetStartedAt() time.Time` - -GetStartedAt returns the StartedAt field if non-nil, zero value otherwise. - -### GetStartedAtOk - -`func (o *BuildShort) GetStartedAtOk() (*time.Time, bool)` - -GetStartedAtOk returns a tuple with the StartedAt field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetStartedAt - -`func (o *BuildShort) SetStartedAt(v time.Time)` - -SetStartedAt sets StartedAt field to given value. - - -### GetFinishedAt - -`func (o *BuildShort) GetFinishedAt() time.Time` - -GetFinishedAt returns the FinishedAt field if non-nil, zero value otherwise. - -### GetFinishedAtOk - -`func (o *BuildShort) GetFinishedAtOk() (*time.Time, bool)` - -GetFinishedAtOk returns a tuple with the FinishedAt field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetFinishedAt - -`func (o *BuildShort) SetFinishedAt(v time.Time)` - -SetFinishedAt sets FinishedAt field to given value. - -### HasFinishedAt - -`func (o *BuildShort) HasFinishedAt() bool` - -HasFinishedAt returns a boolean if a field has been set. - -### SetFinishedAtNil - -`func (o *BuildShort) SetFinishedAtNil(b bool)` - - SetFinishedAtNil sets the value for FinishedAt to be an explicit nil - -### UnsetFinishedAt -`func (o *BuildShort) UnsetFinishedAt()` - -UnsetFinishedAt ensures that no value is present for FinishedAt, not even an explicit nil -### GetUsageTotalUsd - -`func (o *BuildShort) GetUsageTotalUsd() float32` - -GetUsageTotalUsd returns the UsageTotalUsd field if non-nil, zero value otherwise. - -### GetUsageTotalUsdOk - -`func (o *BuildShort) GetUsageTotalUsdOk() (*float32, bool)` - -GetUsageTotalUsdOk returns a tuple with the UsageTotalUsd field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetUsageTotalUsd - -`func (o *BuildShort) SetUsageTotalUsd(v float32)` - -SetUsageTotalUsd sets UsageTotalUsd field to given value. - - -### GetBuildNumber - -`func (o *BuildShort) GetBuildNumber() string` - -GetBuildNumber returns the BuildNumber field if non-nil, zero value otherwise. - -### GetBuildNumberOk - -`func (o *BuildShort) GetBuildNumberOk() (*string, bool)` - -GetBuildNumberOk returns a tuple with the BuildNumber field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetBuildNumber - -`func (o *BuildShort) SetBuildNumber(v string)` - -SetBuildNumber sets BuildNumber field to given value. - - -### GetBuildNumberInt - -`func (o *BuildShort) GetBuildNumberInt() int32` - -GetBuildNumberInt returns the BuildNumberInt field if non-nil, zero value otherwise. - -### GetBuildNumberIntOk - -`func (o *BuildShort) GetBuildNumberIntOk() (*int32, bool)` - -GetBuildNumberIntOk returns a tuple with the BuildNumberInt field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetBuildNumberInt - -`func (o *BuildShort) SetBuildNumberInt(v int32)` - -SetBuildNumberInt sets BuildNumberInt field to given value. - -### HasBuildNumberInt - -`func (o *BuildShort) HasBuildNumberInt() bool` - -HasBuildNumberInt returns a boolean if a field has been set. - -### GetMeta - -`func (o *BuildShort) GetMeta() BuildsMeta` - -GetMeta returns the Meta field if non-nil, zero value otherwise. - -### GetMetaOk - -`func (o *BuildShort) GetMetaOk() (*BuildsMeta, bool)` - -GetMetaOk returns a tuple with the Meta field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetMeta - -`func (o *BuildShort) SetMeta(v BuildsMeta)` - -SetMeta sets Meta field to given value. - -### HasMeta - -`func (o *BuildShort) HasMeta() bool` - -HasMeta returns a boolean if a field has been set. - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/BuildStats.md b/docs/BuildStats.md deleted file mode 100644 index e188bcc..0000000 --- a/docs/BuildStats.md +++ /dev/null @@ -1,129 +0,0 @@ -# BuildStats - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**DurationMillis** | Pointer to **int32** | | [optional] -**RunTimeSecs** | Pointer to **float32** | | [optional] -**ComputeUnits** | **float32** | | -**ImageSizeBytes** | Pointer to **int32** | | [optional] - -## Methods - -### NewBuildStats - -`func NewBuildStats(computeUnits float32, ) *BuildStats` - -NewBuildStats instantiates a new BuildStats object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewBuildStatsWithDefaults - -`func NewBuildStatsWithDefaults() *BuildStats` - -NewBuildStatsWithDefaults instantiates a new BuildStats object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetDurationMillis - -`func (o *BuildStats) GetDurationMillis() int32` - -GetDurationMillis returns the DurationMillis field if non-nil, zero value otherwise. - -### GetDurationMillisOk - -`func (o *BuildStats) GetDurationMillisOk() (*int32, bool)` - -GetDurationMillisOk returns a tuple with the DurationMillis field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetDurationMillis - -`func (o *BuildStats) SetDurationMillis(v int32)` - -SetDurationMillis sets DurationMillis field to given value. - -### HasDurationMillis - -`func (o *BuildStats) HasDurationMillis() bool` - -HasDurationMillis returns a boolean if a field has been set. - -### GetRunTimeSecs - -`func (o *BuildStats) GetRunTimeSecs() float32` - -GetRunTimeSecs returns the RunTimeSecs field if non-nil, zero value otherwise. - -### GetRunTimeSecsOk - -`func (o *BuildStats) GetRunTimeSecsOk() (*float32, bool)` - -GetRunTimeSecsOk returns a tuple with the RunTimeSecs field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetRunTimeSecs - -`func (o *BuildStats) SetRunTimeSecs(v float32)` - -SetRunTimeSecs sets RunTimeSecs field to given value. - -### HasRunTimeSecs - -`func (o *BuildStats) HasRunTimeSecs() bool` - -HasRunTimeSecs returns a boolean if a field has been set. - -### GetComputeUnits - -`func (o *BuildStats) GetComputeUnits() float32` - -GetComputeUnits returns the ComputeUnits field if non-nil, zero value otherwise. - -### GetComputeUnitsOk - -`func (o *BuildStats) GetComputeUnitsOk() (*float32, bool)` - -GetComputeUnitsOk returns a tuple with the ComputeUnits field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetComputeUnits - -`func (o *BuildStats) SetComputeUnits(v float32)` - -SetComputeUnits sets ComputeUnits field to given value. - - -### GetImageSizeBytes - -`func (o *BuildStats) GetImageSizeBytes() int32` - -GetImageSizeBytes returns the ImageSizeBytes field if non-nil, zero value otherwise. - -### GetImageSizeBytesOk - -`func (o *BuildStats) GetImageSizeBytesOk() (*int32, bool)` - -GetImageSizeBytesOk returns a tuple with the ImageSizeBytes field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetImageSizeBytes - -`func (o *BuildStats) SetImageSizeBytes(v int32)` - -SetImageSizeBytes sets ImageSizeBytes field to given value. - -### HasImageSizeBytes - -`func (o *BuildStats) HasImageSizeBytes() bool` - -HasImageSizeBytes returns a boolean if a field has been set. - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/BuildTag.md b/docs/BuildTag.md deleted file mode 100644 index e6acd40..0000000 --- a/docs/BuildTag.md +++ /dev/null @@ -1,51 +0,0 @@ -# BuildTag - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**BuildId** | **string** | | - -## Methods - -### NewBuildTag - -`func NewBuildTag(buildId string, ) *BuildTag` - -NewBuildTag instantiates a new BuildTag object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewBuildTagWithDefaults - -`func NewBuildTagWithDefaults() *BuildTag` - -NewBuildTagWithDefaults instantiates a new BuildTag object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetBuildId - -`func (o *BuildTag) GetBuildId() string` - -GetBuildId returns the BuildId field if non-nil, zero value otherwise. - -### GetBuildIdOk - -`func (o *BuildTag) GetBuildIdOk() (*string, bool)` - -GetBuildIdOk returns a tuple with the BuildId field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetBuildId - -`func (o *BuildTag) SetBuildId(v string)` - -SetBuildId sets BuildId field to given value. - - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/BuildUsage.md b/docs/BuildUsage.md deleted file mode 100644 index 45e4bdb..0000000 --- a/docs/BuildUsage.md +++ /dev/null @@ -1,66 +0,0 @@ -# BuildUsage - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**ACTOR_COMPUTE_UNITS** | Pointer to **NullableFloat32** | | [optional] - -## Methods - -### NewBuildUsage - -`func NewBuildUsage() *BuildUsage` - -NewBuildUsage instantiates a new BuildUsage object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewBuildUsageWithDefaults - -`func NewBuildUsageWithDefaults() *BuildUsage` - -NewBuildUsageWithDefaults instantiates a new BuildUsage object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetACTOR_COMPUTE_UNITS - -`func (o *BuildUsage) GetACTOR_COMPUTE_UNITS() float32` - -GetACTOR_COMPUTE_UNITS returns the ACTOR_COMPUTE_UNITS field if non-nil, zero value otherwise. - -### GetACTOR_COMPUTE_UNITSOk - -`func (o *BuildUsage) GetACTOR_COMPUTE_UNITSOk() (*float32, bool)` - -GetACTOR_COMPUTE_UNITSOk returns a tuple with the ACTOR_COMPUTE_UNITS field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetACTOR_COMPUTE_UNITS - -`func (o *BuildUsage) SetACTOR_COMPUTE_UNITS(v float32)` - -SetACTOR_COMPUTE_UNITS sets ACTOR_COMPUTE_UNITS field to given value. - -### HasACTOR_COMPUTE_UNITS - -`func (o *BuildUsage) HasACTOR_COMPUTE_UNITS() bool` - -HasACTOR_COMPUTE_UNITS returns a boolean if a field has been set. - -### SetACTOR_COMPUTE_UNITSNil - -`func (o *BuildUsage) SetACTOR_COMPUTE_UNITSNil(b bool)` - - SetACTOR_COMPUTE_UNITSNil sets the value for ACTOR_COMPUTE_UNITS to be an explicit nil - -### UnsetACTOR_COMPUTE_UNITS -`func (o *BuildUsage) UnsetACTOR_COMPUTE_UNITS()` - -UnsetACTOR_COMPUTE_UNITS ensures that no value is present for ACTOR_COMPUTE_UNITS, not even an explicit nil - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/BuildsMeta.md b/docs/BuildsMeta.md deleted file mode 100644 index c06a443..0000000 --- a/docs/BuildsMeta.md +++ /dev/null @@ -1,103 +0,0 @@ -# BuildsMeta - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Origin** | [**RunOrigin**](RunOrigin.md) | | -**ClientIp** | Pointer to **string** | IP address of the client that started the build. | [optional] -**UserAgent** | Pointer to **string** | User agent of the client that started the build. | [optional] - -## Methods - -### NewBuildsMeta - -`func NewBuildsMeta(origin RunOrigin, ) *BuildsMeta` - -NewBuildsMeta instantiates a new BuildsMeta object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewBuildsMetaWithDefaults - -`func NewBuildsMetaWithDefaults() *BuildsMeta` - -NewBuildsMetaWithDefaults instantiates a new BuildsMeta object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetOrigin - -`func (o *BuildsMeta) GetOrigin() RunOrigin` - -GetOrigin returns the Origin field if non-nil, zero value otherwise. - -### GetOriginOk - -`func (o *BuildsMeta) GetOriginOk() (*RunOrigin, bool)` - -GetOriginOk returns a tuple with the Origin field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetOrigin - -`func (o *BuildsMeta) SetOrigin(v RunOrigin)` - -SetOrigin sets Origin field to given value. - - -### GetClientIp - -`func (o *BuildsMeta) GetClientIp() string` - -GetClientIp returns the ClientIp field if non-nil, zero value otherwise. - -### GetClientIpOk - -`func (o *BuildsMeta) GetClientIpOk() (*string, bool)` - -GetClientIpOk returns a tuple with the ClientIp field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetClientIp - -`func (o *BuildsMeta) SetClientIp(v string)` - -SetClientIp sets ClientIp field to given value. - -### HasClientIp - -`func (o *BuildsMeta) HasClientIp() bool` - -HasClientIp returns a boolean if a field has been set. - -### GetUserAgent - -`func (o *BuildsMeta) GetUserAgent() string` - -GetUserAgent returns the UserAgent field if non-nil, zero value otherwise. - -### GetUserAgentOk - -`func (o *BuildsMeta) GetUserAgentOk() (*string, bool)` - -GetUserAgentOk returns a tuple with the UserAgent field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetUserAgent - -`func (o *BuildsMeta) SetUserAgent(v string)` - -SetUserAgent sets UserAgent field to given value. - -### HasUserAgent - -`func (o *BuildsMeta) HasUserAgent() bool` - -HasUserAgent returns a boolean if a field has been set. - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/CallsInner.md b/docs/CallsInner.md deleted file mode 100644 index 64537fa..0000000 --- a/docs/CallsInner.md +++ /dev/null @@ -1,210 +0,0 @@ -# CallsInner - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**StartedAt** | Pointer to **NullableTime** | | [optional] -**FinishedAt** | Pointer to **NullableTime** | | [optional] -**ErrorMessage** | Pointer to **NullableString** | | [optional] -**ResponseStatus** | Pointer to **NullableInt32** | | [optional] -**ResponseBody** | Pointer to **NullableString** | | [optional] - -## Methods - -### NewCallsInner - -`func NewCallsInner() *CallsInner` - -NewCallsInner instantiates a new CallsInner object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewCallsInnerWithDefaults - -`func NewCallsInnerWithDefaults() *CallsInner` - -NewCallsInnerWithDefaults instantiates a new CallsInner object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetStartedAt - -`func (o *CallsInner) GetStartedAt() time.Time` - -GetStartedAt returns the StartedAt field if non-nil, zero value otherwise. - -### GetStartedAtOk - -`func (o *CallsInner) GetStartedAtOk() (*time.Time, bool)` - -GetStartedAtOk returns a tuple with the StartedAt field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetStartedAt - -`func (o *CallsInner) SetStartedAt(v time.Time)` - -SetStartedAt sets StartedAt field to given value. - -### HasStartedAt - -`func (o *CallsInner) HasStartedAt() bool` - -HasStartedAt returns a boolean if a field has been set. - -### SetStartedAtNil - -`func (o *CallsInner) SetStartedAtNil(b bool)` - - SetStartedAtNil sets the value for StartedAt to be an explicit nil - -### UnsetStartedAt -`func (o *CallsInner) UnsetStartedAt()` - -UnsetStartedAt ensures that no value is present for StartedAt, not even an explicit nil -### GetFinishedAt - -`func (o *CallsInner) GetFinishedAt() time.Time` - -GetFinishedAt returns the FinishedAt field if non-nil, zero value otherwise. - -### GetFinishedAtOk - -`func (o *CallsInner) GetFinishedAtOk() (*time.Time, bool)` - -GetFinishedAtOk returns a tuple with the FinishedAt field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetFinishedAt - -`func (o *CallsInner) SetFinishedAt(v time.Time)` - -SetFinishedAt sets FinishedAt field to given value. - -### HasFinishedAt - -`func (o *CallsInner) HasFinishedAt() bool` - -HasFinishedAt returns a boolean if a field has been set. - -### SetFinishedAtNil - -`func (o *CallsInner) SetFinishedAtNil(b bool)` - - SetFinishedAtNil sets the value for FinishedAt to be an explicit nil - -### UnsetFinishedAt -`func (o *CallsInner) UnsetFinishedAt()` - -UnsetFinishedAt ensures that no value is present for FinishedAt, not even an explicit nil -### GetErrorMessage - -`func (o *CallsInner) GetErrorMessage() string` - -GetErrorMessage returns the ErrorMessage field if non-nil, zero value otherwise. - -### GetErrorMessageOk - -`func (o *CallsInner) GetErrorMessageOk() (*string, bool)` - -GetErrorMessageOk returns a tuple with the ErrorMessage field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetErrorMessage - -`func (o *CallsInner) SetErrorMessage(v string)` - -SetErrorMessage sets ErrorMessage field to given value. - -### HasErrorMessage - -`func (o *CallsInner) HasErrorMessage() bool` - -HasErrorMessage returns a boolean if a field has been set. - -### SetErrorMessageNil - -`func (o *CallsInner) SetErrorMessageNil(b bool)` - - SetErrorMessageNil sets the value for ErrorMessage to be an explicit nil - -### UnsetErrorMessage -`func (o *CallsInner) UnsetErrorMessage()` - -UnsetErrorMessage ensures that no value is present for ErrorMessage, not even an explicit nil -### GetResponseStatus - -`func (o *CallsInner) GetResponseStatus() int32` - -GetResponseStatus returns the ResponseStatus field if non-nil, zero value otherwise. - -### GetResponseStatusOk - -`func (o *CallsInner) GetResponseStatusOk() (*int32, bool)` - -GetResponseStatusOk returns a tuple with the ResponseStatus field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetResponseStatus - -`func (o *CallsInner) SetResponseStatus(v int32)` - -SetResponseStatus sets ResponseStatus field to given value. - -### HasResponseStatus - -`func (o *CallsInner) HasResponseStatus() bool` - -HasResponseStatus returns a boolean if a field has been set. - -### SetResponseStatusNil - -`func (o *CallsInner) SetResponseStatusNil(b bool)` - - SetResponseStatusNil sets the value for ResponseStatus to be an explicit nil - -### UnsetResponseStatus -`func (o *CallsInner) UnsetResponseStatus()` - -UnsetResponseStatus ensures that no value is present for ResponseStatus, not even an explicit nil -### GetResponseBody - -`func (o *CallsInner) GetResponseBody() string` - -GetResponseBody returns the ResponseBody field if non-nil, zero value otherwise. - -### GetResponseBodyOk - -`func (o *CallsInner) GetResponseBodyOk() (*string, bool)` - -GetResponseBodyOk returns a tuple with the ResponseBody field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetResponseBody - -`func (o *CallsInner) SetResponseBody(v string)` - -SetResponseBody sets ResponseBody field to given value. - -### HasResponseBody - -`func (o *CallsInner) HasResponseBody() bool` - -HasResponseBody returns a boolean if a field has been set. - -### SetResponseBodyNil - -`func (o *CallsInner) SetResponseBodyNil(b bool)` - - SetResponseBodyNil sets the value for ResponseBody to be an explicit nil - -### UnsetResponseBody -`func (o *CallsInner) UnsetResponseBody()` - -UnsetResponseBody ensures that no value is present for ResponseBody, not even an explicit nil - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/ChargeRunRequest.md b/docs/ChargeRunRequest.md deleted file mode 100644 index 4aa5c1f..0000000 --- a/docs/ChargeRunRequest.md +++ /dev/null @@ -1,72 +0,0 @@ -# ChargeRunRequest - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**EventName** | **string** | | -**Count** | **int32** | | - -## Methods - -### NewChargeRunRequest - -`func NewChargeRunRequest(eventName string, count int32, ) *ChargeRunRequest` - -NewChargeRunRequest instantiates a new ChargeRunRequest object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewChargeRunRequestWithDefaults - -`func NewChargeRunRequestWithDefaults() *ChargeRunRequest` - -NewChargeRunRequestWithDefaults instantiates a new ChargeRunRequest object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetEventName - -`func (o *ChargeRunRequest) GetEventName() string` - -GetEventName returns the EventName field if non-nil, zero value otherwise. - -### GetEventNameOk - -`func (o *ChargeRunRequest) GetEventNameOk() (*string, bool)` - -GetEventNameOk returns a tuple with the EventName field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetEventName - -`func (o *ChargeRunRequest) SetEventName(v string)` - -SetEventName sets EventName field to given value. - - -### GetCount - -`func (o *ChargeRunRequest) GetCount() int32` - -GetCount returns the Count field if non-nil, zero value otherwise. - -### GetCountOk - -`func (o *ChargeRunRequest) GetCountOk() (*int32, bool)` - -GetCountOk returns a tuple with the Count field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetCount - -`func (o *ChargeRunRequest) SetCount(v int32)` - -SetCount sets Count field to given value. - - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/CommonActorPricingInfo.md b/docs/CommonActorPricingInfo.md deleted file mode 100644 index 4c6ee54..0000000 --- a/docs/CommonActorPricingInfo.md +++ /dev/null @@ -1,253 +0,0 @@ -# CommonActorPricingInfo - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**ApifyMarginPercentage** | **float32** | In [0, 1], fraction of pricePerUnitUsd that goes to Apify | -**CreatedAt** | **time.Time** | When this pricing info record has been created | -**StartedAt** | **time.Time** | Since when is this pricing info record effective for a given Actor | -**NotifiedAboutFutureChangeAt** | Pointer to **NullableTime** | | [optional] -**NotifiedAboutChangeAt** | Pointer to **NullableTime** | | [optional] -**ReasonForChange** | Pointer to **NullableString** | | [optional] -**IsPriceChangeNotificationSuppressed** | Pointer to **bool** | | [optional] -**ForceContainsSignificantPriceChange** | Pointer to **bool** | | [optional] - -## Methods - -### NewCommonActorPricingInfo - -`func NewCommonActorPricingInfo(apifyMarginPercentage float32, createdAt time.Time, startedAt time.Time, ) *CommonActorPricingInfo` - -NewCommonActorPricingInfo instantiates a new CommonActorPricingInfo object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewCommonActorPricingInfoWithDefaults - -`func NewCommonActorPricingInfoWithDefaults() *CommonActorPricingInfo` - -NewCommonActorPricingInfoWithDefaults instantiates a new CommonActorPricingInfo object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetApifyMarginPercentage - -`func (o *CommonActorPricingInfo) GetApifyMarginPercentage() float32` - -GetApifyMarginPercentage returns the ApifyMarginPercentage field if non-nil, zero value otherwise. - -### GetApifyMarginPercentageOk - -`func (o *CommonActorPricingInfo) GetApifyMarginPercentageOk() (*float32, bool)` - -GetApifyMarginPercentageOk returns a tuple with the ApifyMarginPercentage field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetApifyMarginPercentage - -`func (o *CommonActorPricingInfo) SetApifyMarginPercentage(v float32)` - -SetApifyMarginPercentage sets ApifyMarginPercentage field to given value. - - -### GetCreatedAt - -`func (o *CommonActorPricingInfo) GetCreatedAt() time.Time` - -GetCreatedAt returns the CreatedAt field if non-nil, zero value otherwise. - -### GetCreatedAtOk - -`func (o *CommonActorPricingInfo) GetCreatedAtOk() (*time.Time, bool)` - -GetCreatedAtOk returns a tuple with the CreatedAt field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetCreatedAt - -`func (o *CommonActorPricingInfo) SetCreatedAt(v time.Time)` - -SetCreatedAt sets CreatedAt field to given value. - - -### GetStartedAt - -`func (o *CommonActorPricingInfo) GetStartedAt() time.Time` - -GetStartedAt returns the StartedAt field if non-nil, zero value otherwise. - -### GetStartedAtOk - -`func (o *CommonActorPricingInfo) GetStartedAtOk() (*time.Time, bool)` - -GetStartedAtOk returns a tuple with the StartedAt field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetStartedAt - -`func (o *CommonActorPricingInfo) SetStartedAt(v time.Time)` - -SetStartedAt sets StartedAt field to given value. - - -### GetNotifiedAboutFutureChangeAt - -`func (o *CommonActorPricingInfo) GetNotifiedAboutFutureChangeAt() time.Time` - -GetNotifiedAboutFutureChangeAt returns the NotifiedAboutFutureChangeAt field if non-nil, zero value otherwise. - -### GetNotifiedAboutFutureChangeAtOk - -`func (o *CommonActorPricingInfo) GetNotifiedAboutFutureChangeAtOk() (*time.Time, bool)` - -GetNotifiedAboutFutureChangeAtOk returns a tuple with the NotifiedAboutFutureChangeAt field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetNotifiedAboutFutureChangeAt - -`func (o *CommonActorPricingInfo) SetNotifiedAboutFutureChangeAt(v time.Time)` - -SetNotifiedAboutFutureChangeAt sets NotifiedAboutFutureChangeAt field to given value. - -### HasNotifiedAboutFutureChangeAt - -`func (o *CommonActorPricingInfo) HasNotifiedAboutFutureChangeAt() bool` - -HasNotifiedAboutFutureChangeAt returns a boolean if a field has been set. - -### SetNotifiedAboutFutureChangeAtNil - -`func (o *CommonActorPricingInfo) SetNotifiedAboutFutureChangeAtNil(b bool)` - - SetNotifiedAboutFutureChangeAtNil sets the value for NotifiedAboutFutureChangeAt to be an explicit nil - -### UnsetNotifiedAboutFutureChangeAt -`func (o *CommonActorPricingInfo) UnsetNotifiedAboutFutureChangeAt()` - -UnsetNotifiedAboutFutureChangeAt ensures that no value is present for NotifiedAboutFutureChangeAt, not even an explicit nil -### GetNotifiedAboutChangeAt - -`func (o *CommonActorPricingInfo) GetNotifiedAboutChangeAt() time.Time` - -GetNotifiedAboutChangeAt returns the NotifiedAboutChangeAt field if non-nil, zero value otherwise. - -### GetNotifiedAboutChangeAtOk - -`func (o *CommonActorPricingInfo) GetNotifiedAboutChangeAtOk() (*time.Time, bool)` - -GetNotifiedAboutChangeAtOk returns a tuple with the NotifiedAboutChangeAt field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetNotifiedAboutChangeAt - -`func (o *CommonActorPricingInfo) SetNotifiedAboutChangeAt(v time.Time)` - -SetNotifiedAboutChangeAt sets NotifiedAboutChangeAt field to given value. - -### HasNotifiedAboutChangeAt - -`func (o *CommonActorPricingInfo) HasNotifiedAboutChangeAt() bool` - -HasNotifiedAboutChangeAt returns a boolean if a field has been set. - -### SetNotifiedAboutChangeAtNil - -`func (o *CommonActorPricingInfo) SetNotifiedAboutChangeAtNil(b bool)` - - SetNotifiedAboutChangeAtNil sets the value for NotifiedAboutChangeAt to be an explicit nil - -### UnsetNotifiedAboutChangeAt -`func (o *CommonActorPricingInfo) UnsetNotifiedAboutChangeAt()` - -UnsetNotifiedAboutChangeAt ensures that no value is present for NotifiedAboutChangeAt, not even an explicit nil -### GetReasonForChange - -`func (o *CommonActorPricingInfo) GetReasonForChange() string` - -GetReasonForChange returns the ReasonForChange field if non-nil, zero value otherwise. - -### GetReasonForChangeOk - -`func (o *CommonActorPricingInfo) GetReasonForChangeOk() (*string, bool)` - -GetReasonForChangeOk returns a tuple with the ReasonForChange field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetReasonForChange - -`func (o *CommonActorPricingInfo) SetReasonForChange(v string)` - -SetReasonForChange sets ReasonForChange field to given value. - -### HasReasonForChange - -`func (o *CommonActorPricingInfo) HasReasonForChange() bool` - -HasReasonForChange returns a boolean if a field has been set. - -### SetReasonForChangeNil - -`func (o *CommonActorPricingInfo) SetReasonForChangeNil(b bool)` - - SetReasonForChangeNil sets the value for ReasonForChange to be an explicit nil - -### UnsetReasonForChange -`func (o *CommonActorPricingInfo) UnsetReasonForChange()` - -UnsetReasonForChange ensures that no value is present for ReasonForChange, not even an explicit nil -### GetIsPriceChangeNotificationSuppressed - -`func (o *CommonActorPricingInfo) GetIsPriceChangeNotificationSuppressed() bool` - -GetIsPriceChangeNotificationSuppressed returns the IsPriceChangeNotificationSuppressed field if non-nil, zero value otherwise. - -### GetIsPriceChangeNotificationSuppressedOk - -`func (o *CommonActorPricingInfo) GetIsPriceChangeNotificationSuppressedOk() (*bool, bool)` - -GetIsPriceChangeNotificationSuppressedOk returns a tuple with the IsPriceChangeNotificationSuppressed field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetIsPriceChangeNotificationSuppressed - -`func (o *CommonActorPricingInfo) SetIsPriceChangeNotificationSuppressed(v bool)` - -SetIsPriceChangeNotificationSuppressed sets IsPriceChangeNotificationSuppressed field to given value. - -### HasIsPriceChangeNotificationSuppressed - -`func (o *CommonActorPricingInfo) HasIsPriceChangeNotificationSuppressed() bool` - -HasIsPriceChangeNotificationSuppressed returns a boolean if a field has been set. - -### GetForceContainsSignificantPriceChange - -`func (o *CommonActorPricingInfo) GetForceContainsSignificantPriceChange() bool` - -GetForceContainsSignificantPriceChange returns the ForceContainsSignificantPriceChange field if non-nil, zero value otherwise. - -### GetForceContainsSignificantPriceChangeOk - -`func (o *CommonActorPricingInfo) GetForceContainsSignificantPriceChangeOk() (*bool, bool)` - -GetForceContainsSignificantPriceChangeOk returns a tuple with the ForceContainsSignificantPriceChange field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetForceContainsSignificantPriceChange - -`func (o *CommonActorPricingInfo) SetForceContainsSignificantPriceChange(v bool)` - -SetForceContainsSignificantPriceChange sets ForceContainsSignificantPriceChange field to given value. - -### HasForceContainsSignificantPriceChange - -`func (o *CommonActorPricingInfo) HasForceContainsSignificantPriceChange() bool` - -HasForceContainsSignificantPriceChange returns a boolean if a field has been set. - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/CreateActorRequest.md b/docs/CreateActorRequest.md deleted file mode 100644 index 2968467..0000000 --- a/docs/CreateActorRequest.md +++ /dev/null @@ -1,504 +0,0 @@ -# CreateActorRequest - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Name** | Pointer to **NullableString** | | [optional] -**Description** | Pointer to **NullableString** | | [optional] -**Title** | Pointer to **NullableString** | | [optional] -**IsPublic** | Pointer to **NullableBool** | | [optional] -**SeoTitle** | Pointer to **NullableString** | | [optional] -**SeoDescription** | Pointer to **NullableString** | | [optional] -**RestartOnError** | Pointer to **bool** | | [optional] -**Versions** | Pointer to [**[]Version**](Version.md) | | [optional] -**PricingInfos** | Pointer to [**[]ActorRunPricingInfo**](ActorRunPricingInfo.md) | | [optional] -**Categories** | Pointer to **[]string** | | [optional] -**DefaultRunOptions** | Pointer to [**DefaultRunOptions**](DefaultRunOptions.md) | | [optional] -**ActorStandby** | Pointer to [**NullableActorStandby**](ActorStandby.md) | | [optional] -**ExampleRunInput** | Pointer to [**NullableExampleRunInput**](ExampleRunInput.md) | | [optional] -**IsDeprecated** | Pointer to **NullableBool** | | [optional] - -## Methods - -### NewCreateActorRequest - -`func NewCreateActorRequest() *CreateActorRequest` - -NewCreateActorRequest instantiates a new CreateActorRequest object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewCreateActorRequestWithDefaults - -`func NewCreateActorRequestWithDefaults() *CreateActorRequest` - -NewCreateActorRequestWithDefaults instantiates a new CreateActorRequest object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetName - -`func (o *CreateActorRequest) GetName() string` - -GetName returns the Name field if non-nil, zero value otherwise. - -### GetNameOk - -`func (o *CreateActorRequest) GetNameOk() (*string, bool)` - -GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetName - -`func (o *CreateActorRequest) SetName(v string)` - -SetName sets Name field to given value. - -### HasName - -`func (o *CreateActorRequest) HasName() bool` - -HasName returns a boolean if a field has been set. - -### SetNameNil - -`func (o *CreateActorRequest) SetNameNil(b bool)` - - SetNameNil sets the value for Name to be an explicit nil - -### UnsetName -`func (o *CreateActorRequest) UnsetName()` - -UnsetName ensures that no value is present for Name, not even an explicit nil -### GetDescription - -`func (o *CreateActorRequest) GetDescription() string` - -GetDescription returns the Description field if non-nil, zero value otherwise. - -### GetDescriptionOk - -`func (o *CreateActorRequest) GetDescriptionOk() (*string, bool)` - -GetDescriptionOk returns a tuple with the Description field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetDescription - -`func (o *CreateActorRequest) SetDescription(v string)` - -SetDescription sets Description field to given value. - -### HasDescription - -`func (o *CreateActorRequest) HasDescription() bool` - -HasDescription returns a boolean if a field has been set. - -### SetDescriptionNil - -`func (o *CreateActorRequest) SetDescriptionNil(b bool)` - - SetDescriptionNil sets the value for Description to be an explicit nil - -### UnsetDescription -`func (o *CreateActorRequest) UnsetDescription()` - -UnsetDescription ensures that no value is present for Description, not even an explicit nil -### GetTitle - -`func (o *CreateActorRequest) GetTitle() string` - -GetTitle returns the Title field if non-nil, zero value otherwise. - -### GetTitleOk - -`func (o *CreateActorRequest) GetTitleOk() (*string, bool)` - -GetTitleOk returns a tuple with the Title field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetTitle - -`func (o *CreateActorRequest) SetTitle(v string)` - -SetTitle sets Title field to given value. - -### HasTitle - -`func (o *CreateActorRequest) HasTitle() bool` - -HasTitle returns a boolean if a field has been set. - -### SetTitleNil - -`func (o *CreateActorRequest) SetTitleNil(b bool)` - - SetTitleNil sets the value for Title to be an explicit nil - -### UnsetTitle -`func (o *CreateActorRequest) UnsetTitle()` - -UnsetTitle ensures that no value is present for Title, not even an explicit nil -### GetIsPublic - -`func (o *CreateActorRequest) GetIsPublic() bool` - -GetIsPublic returns the IsPublic field if non-nil, zero value otherwise. - -### GetIsPublicOk - -`func (o *CreateActorRequest) GetIsPublicOk() (*bool, bool)` - -GetIsPublicOk returns a tuple with the IsPublic field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetIsPublic - -`func (o *CreateActorRequest) SetIsPublic(v bool)` - -SetIsPublic sets IsPublic field to given value. - -### HasIsPublic - -`func (o *CreateActorRequest) HasIsPublic() bool` - -HasIsPublic returns a boolean if a field has been set. - -### SetIsPublicNil - -`func (o *CreateActorRequest) SetIsPublicNil(b bool)` - - SetIsPublicNil sets the value for IsPublic to be an explicit nil - -### UnsetIsPublic -`func (o *CreateActorRequest) UnsetIsPublic()` - -UnsetIsPublic ensures that no value is present for IsPublic, not even an explicit nil -### GetSeoTitle - -`func (o *CreateActorRequest) GetSeoTitle() string` - -GetSeoTitle returns the SeoTitle field if non-nil, zero value otherwise. - -### GetSeoTitleOk - -`func (o *CreateActorRequest) GetSeoTitleOk() (*string, bool)` - -GetSeoTitleOk returns a tuple with the SeoTitle field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetSeoTitle - -`func (o *CreateActorRequest) SetSeoTitle(v string)` - -SetSeoTitle sets SeoTitle field to given value. - -### HasSeoTitle - -`func (o *CreateActorRequest) HasSeoTitle() bool` - -HasSeoTitle returns a boolean if a field has been set. - -### SetSeoTitleNil - -`func (o *CreateActorRequest) SetSeoTitleNil(b bool)` - - SetSeoTitleNil sets the value for SeoTitle to be an explicit nil - -### UnsetSeoTitle -`func (o *CreateActorRequest) UnsetSeoTitle()` - -UnsetSeoTitle ensures that no value is present for SeoTitle, not even an explicit nil -### GetSeoDescription - -`func (o *CreateActorRequest) GetSeoDescription() string` - -GetSeoDescription returns the SeoDescription field if non-nil, zero value otherwise. - -### GetSeoDescriptionOk - -`func (o *CreateActorRequest) GetSeoDescriptionOk() (*string, bool)` - -GetSeoDescriptionOk returns a tuple with the SeoDescription field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetSeoDescription - -`func (o *CreateActorRequest) SetSeoDescription(v string)` - -SetSeoDescription sets SeoDescription field to given value. - -### HasSeoDescription - -`func (o *CreateActorRequest) HasSeoDescription() bool` - -HasSeoDescription returns a boolean if a field has been set. - -### SetSeoDescriptionNil - -`func (o *CreateActorRequest) SetSeoDescriptionNil(b bool)` - - SetSeoDescriptionNil sets the value for SeoDescription to be an explicit nil - -### UnsetSeoDescription -`func (o *CreateActorRequest) UnsetSeoDescription()` - -UnsetSeoDescription ensures that no value is present for SeoDescription, not even an explicit nil -### GetRestartOnError - -`func (o *CreateActorRequest) GetRestartOnError() bool` - -GetRestartOnError returns the RestartOnError field if non-nil, zero value otherwise. - -### GetRestartOnErrorOk - -`func (o *CreateActorRequest) GetRestartOnErrorOk() (*bool, bool)` - -GetRestartOnErrorOk returns a tuple with the RestartOnError field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetRestartOnError - -`func (o *CreateActorRequest) SetRestartOnError(v bool)` - -SetRestartOnError sets RestartOnError field to given value. - -### HasRestartOnError - -`func (o *CreateActorRequest) HasRestartOnError() bool` - -HasRestartOnError returns a boolean if a field has been set. - -### GetVersions - -`func (o *CreateActorRequest) GetVersions() []Version` - -GetVersions returns the Versions field if non-nil, zero value otherwise. - -### GetVersionsOk - -`func (o *CreateActorRequest) GetVersionsOk() (*[]Version, bool)` - -GetVersionsOk returns a tuple with the Versions field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetVersions - -`func (o *CreateActorRequest) SetVersions(v []Version)` - -SetVersions sets Versions field to given value. - -### HasVersions - -`func (o *CreateActorRequest) HasVersions() bool` - -HasVersions returns a boolean if a field has been set. - -### SetVersionsNil - -`func (o *CreateActorRequest) SetVersionsNil(b bool)` - - SetVersionsNil sets the value for Versions to be an explicit nil - -### UnsetVersions -`func (o *CreateActorRequest) UnsetVersions()` - -UnsetVersions ensures that no value is present for Versions, not even an explicit nil -### GetPricingInfos - -`func (o *CreateActorRequest) GetPricingInfos() []ActorRunPricingInfo` - -GetPricingInfos returns the PricingInfos field if non-nil, zero value otherwise. - -### GetPricingInfosOk - -`func (o *CreateActorRequest) GetPricingInfosOk() (*[]ActorRunPricingInfo, bool)` - -GetPricingInfosOk returns a tuple with the PricingInfos field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetPricingInfos - -`func (o *CreateActorRequest) SetPricingInfos(v []ActorRunPricingInfo)` - -SetPricingInfos sets PricingInfos field to given value. - -### HasPricingInfos - -`func (o *CreateActorRequest) HasPricingInfos() bool` - -HasPricingInfos returns a boolean if a field has been set. - -### GetCategories - -`func (o *CreateActorRequest) GetCategories() []string` - -GetCategories returns the Categories field if non-nil, zero value otherwise. - -### GetCategoriesOk - -`func (o *CreateActorRequest) GetCategoriesOk() (*[]string, bool)` - -GetCategoriesOk returns a tuple with the Categories field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetCategories - -`func (o *CreateActorRequest) SetCategories(v []string)` - -SetCategories sets Categories field to given value. - -### HasCategories - -`func (o *CreateActorRequest) HasCategories() bool` - -HasCategories returns a boolean if a field has been set. - -### SetCategoriesNil - -`func (o *CreateActorRequest) SetCategoriesNil(b bool)` - - SetCategoriesNil sets the value for Categories to be an explicit nil - -### UnsetCategories -`func (o *CreateActorRequest) UnsetCategories()` - -UnsetCategories ensures that no value is present for Categories, not even an explicit nil -### GetDefaultRunOptions - -`func (o *CreateActorRequest) GetDefaultRunOptions() DefaultRunOptions` - -GetDefaultRunOptions returns the DefaultRunOptions field if non-nil, zero value otherwise. - -### GetDefaultRunOptionsOk - -`func (o *CreateActorRequest) GetDefaultRunOptionsOk() (*DefaultRunOptions, bool)` - -GetDefaultRunOptionsOk returns a tuple with the DefaultRunOptions field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetDefaultRunOptions - -`func (o *CreateActorRequest) SetDefaultRunOptions(v DefaultRunOptions)` - -SetDefaultRunOptions sets DefaultRunOptions field to given value. - -### HasDefaultRunOptions - -`func (o *CreateActorRequest) HasDefaultRunOptions() bool` - -HasDefaultRunOptions returns a boolean if a field has been set. - -### GetActorStandby - -`func (o *CreateActorRequest) GetActorStandby() ActorStandby` - -GetActorStandby returns the ActorStandby field if non-nil, zero value otherwise. - -### GetActorStandbyOk - -`func (o *CreateActorRequest) GetActorStandbyOk() (*ActorStandby, bool)` - -GetActorStandbyOk returns a tuple with the ActorStandby field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetActorStandby - -`func (o *CreateActorRequest) SetActorStandby(v ActorStandby)` - -SetActorStandby sets ActorStandby field to given value. - -### HasActorStandby - -`func (o *CreateActorRequest) HasActorStandby() bool` - -HasActorStandby returns a boolean if a field has been set. - -### SetActorStandbyNil - -`func (o *CreateActorRequest) SetActorStandbyNil(b bool)` - - SetActorStandbyNil sets the value for ActorStandby to be an explicit nil - -### UnsetActorStandby -`func (o *CreateActorRequest) UnsetActorStandby()` - -UnsetActorStandby ensures that no value is present for ActorStandby, not even an explicit nil -### GetExampleRunInput - -`func (o *CreateActorRequest) GetExampleRunInput() ExampleRunInput` - -GetExampleRunInput returns the ExampleRunInput field if non-nil, zero value otherwise. - -### GetExampleRunInputOk - -`func (o *CreateActorRequest) GetExampleRunInputOk() (*ExampleRunInput, bool)` - -GetExampleRunInputOk returns a tuple with the ExampleRunInput field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetExampleRunInput - -`func (o *CreateActorRequest) SetExampleRunInput(v ExampleRunInput)` - -SetExampleRunInput sets ExampleRunInput field to given value. - -### HasExampleRunInput - -`func (o *CreateActorRequest) HasExampleRunInput() bool` - -HasExampleRunInput returns a boolean if a field has been set. - -### SetExampleRunInputNil - -`func (o *CreateActorRequest) SetExampleRunInputNil(b bool)` - - SetExampleRunInputNil sets the value for ExampleRunInput to be an explicit nil - -### UnsetExampleRunInput -`func (o *CreateActorRequest) UnsetExampleRunInput()` - -UnsetExampleRunInput ensures that no value is present for ExampleRunInput, not even an explicit nil -### GetIsDeprecated - -`func (o *CreateActorRequest) GetIsDeprecated() bool` - -GetIsDeprecated returns the IsDeprecated field if non-nil, zero value otherwise. - -### GetIsDeprecatedOk - -`func (o *CreateActorRequest) GetIsDeprecatedOk() (*bool, bool)` - -GetIsDeprecatedOk returns a tuple with the IsDeprecated field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetIsDeprecated - -`func (o *CreateActorRequest) SetIsDeprecated(v bool)` - -SetIsDeprecated sets IsDeprecated field to given value. - -### HasIsDeprecated - -`func (o *CreateActorRequest) HasIsDeprecated() bool` - -HasIsDeprecated returns a boolean if a field has been set. - -### SetIsDeprecatedNil - -`func (o *CreateActorRequest) SetIsDeprecatedNil(b bool)` - - SetIsDeprecatedNil sets the value for IsDeprecated to be an explicit nil - -### UnsetIsDeprecated -`func (o *CreateActorRequest) UnsetIsDeprecated()` - -UnsetIsDeprecated ensures that no value is present for IsDeprecated, not even an explicit nil - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/CreateOrUpdateVersionRequest.md b/docs/CreateOrUpdateVersionRequest.md deleted file mode 100644 index e1908a7..0000000 --- a/docs/CreateOrUpdateVersionRequest.md +++ /dev/null @@ -1,344 +0,0 @@ -# CreateOrUpdateVersionRequest - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**VersionNumber** | Pointer to **NullableString** | | [optional] -**SourceType** | Pointer to [**NullableVersionSourceType**](VersionSourceType.md) | | [optional] -**EnvVars** | Pointer to [**[]EnvVarRequest**](EnvVarRequest.md) | | [optional] -**ApplyEnvVarsToBuild** | Pointer to **NullableBool** | | [optional] -**BuildTag** | Pointer to **NullableString** | | [optional] -**SourceFiles** | Pointer to [**[]VersionSourceFilesInner**](VersionSourceFilesInner.md) | | [optional] -**GitRepoUrl** | Pointer to **NullableString** | URL of the Git repository when sourceType is GIT_REPO. | [optional] -**TarballUrl** | Pointer to **NullableString** | URL of the tarball when sourceType is TARBALL. | [optional] -**GitHubGistUrl** | Pointer to **NullableString** | URL of the GitHub Gist when sourceType is GITHUB_GIST. | [optional] - -## Methods - -### NewCreateOrUpdateVersionRequest - -`func NewCreateOrUpdateVersionRequest() *CreateOrUpdateVersionRequest` - -NewCreateOrUpdateVersionRequest instantiates a new CreateOrUpdateVersionRequest object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewCreateOrUpdateVersionRequestWithDefaults - -`func NewCreateOrUpdateVersionRequestWithDefaults() *CreateOrUpdateVersionRequest` - -NewCreateOrUpdateVersionRequestWithDefaults instantiates a new CreateOrUpdateVersionRequest object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetVersionNumber - -`func (o *CreateOrUpdateVersionRequest) GetVersionNumber() string` - -GetVersionNumber returns the VersionNumber field if non-nil, zero value otherwise. - -### GetVersionNumberOk - -`func (o *CreateOrUpdateVersionRequest) GetVersionNumberOk() (*string, bool)` - -GetVersionNumberOk returns a tuple with the VersionNumber field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetVersionNumber - -`func (o *CreateOrUpdateVersionRequest) SetVersionNumber(v string)` - -SetVersionNumber sets VersionNumber field to given value. - -### HasVersionNumber - -`func (o *CreateOrUpdateVersionRequest) HasVersionNumber() bool` - -HasVersionNumber returns a boolean if a field has been set. - -### SetVersionNumberNil - -`func (o *CreateOrUpdateVersionRequest) SetVersionNumberNil(b bool)` - - SetVersionNumberNil sets the value for VersionNumber to be an explicit nil - -### UnsetVersionNumber -`func (o *CreateOrUpdateVersionRequest) UnsetVersionNumber()` - -UnsetVersionNumber ensures that no value is present for VersionNumber, not even an explicit nil -### GetSourceType - -`func (o *CreateOrUpdateVersionRequest) GetSourceType() VersionSourceType` - -GetSourceType returns the SourceType field if non-nil, zero value otherwise. - -### GetSourceTypeOk - -`func (o *CreateOrUpdateVersionRequest) GetSourceTypeOk() (*VersionSourceType, bool)` - -GetSourceTypeOk returns a tuple with the SourceType field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetSourceType - -`func (o *CreateOrUpdateVersionRequest) SetSourceType(v VersionSourceType)` - -SetSourceType sets SourceType field to given value. - -### HasSourceType - -`func (o *CreateOrUpdateVersionRequest) HasSourceType() bool` - -HasSourceType returns a boolean if a field has been set. - -### SetSourceTypeNil - -`func (o *CreateOrUpdateVersionRequest) SetSourceTypeNil(b bool)` - - SetSourceTypeNil sets the value for SourceType to be an explicit nil - -### UnsetSourceType -`func (o *CreateOrUpdateVersionRequest) UnsetSourceType()` - -UnsetSourceType ensures that no value is present for SourceType, not even an explicit nil -### GetEnvVars - -`func (o *CreateOrUpdateVersionRequest) GetEnvVars() []EnvVarRequest` - -GetEnvVars returns the EnvVars field if non-nil, zero value otherwise. - -### GetEnvVarsOk - -`func (o *CreateOrUpdateVersionRequest) GetEnvVarsOk() (*[]EnvVarRequest, bool)` - -GetEnvVarsOk returns a tuple with the EnvVars field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetEnvVars - -`func (o *CreateOrUpdateVersionRequest) SetEnvVars(v []EnvVarRequest)` - -SetEnvVars sets EnvVars field to given value. - -### HasEnvVars - -`func (o *CreateOrUpdateVersionRequest) HasEnvVars() bool` - -HasEnvVars returns a boolean if a field has been set. - -### SetEnvVarsNil - -`func (o *CreateOrUpdateVersionRequest) SetEnvVarsNil(b bool)` - - SetEnvVarsNil sets the value for EnvVars to be an explicit nil - -### UnsetEnvVars -`func (o *CreateOrUpdateVersionRequest) UnsetEnvVars()` - -UnsetEnvVars ensures that no value is present for EnvVars, not even an explicit nil -### GetApplyEnvVarsToBuild - -`func (o *CreateOrUpdateVersionRequest) GetApplyEnvVarsToBuild() bool` - -GetApplyEnvVarsToBuild returns the ApplyEnvVarsToBuild field if non-nil, zero value otherwise. - -### GetApplyEnvVarsToBuildOk - -`func (o *CreateOrUpdateVersionRequest) GetApplyEnvVarsToBuildOk() (*bool, bool)` - -GetApplyEnvVarsToBuildOk returns a tuple with the ApplyEnvVarsToBuild field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetApplyEnvVarsToBuild - -`func (o *CreateOrUpdateVersionRequest) SetApplyEnvVarsToBuild(v bool)` - -SetApplyEnvVarsToBuild sets ApplyEnvVarsToBuild field to given value. - -### HasApplyEnvVarsToBuild - -`func (o *CreateOrUpdateVersionRequest) HasApplyEnvVarsToBuild() bool` - -HasApplyEnvVarsToBuild returns a boolean if a field has been set. - -### SetApplyEnvVarsToBuildNil - -`func (o *CreateOrUpdateVersionRequest) SetApplyEnvVarsToBuildNil(b bool)` - - SetApplyEnvVarsToBuildNil sets the value for ApplyEnvVarsToBuild to be an explicit nil - -### UnsetApplyEnvVarsToBuild -`func (o *CreateOrUpdateVersionRequest) UnsetApplyEnvVarsToBuild()` - -UnsetApplyEnvVarsToBuild ensures that no value is present for ApplyEnvVarsToBuild, not even an explicit nil -### GetBuildTag - -`func (o *CreateOrUpdateVersionRequest) GetBuildTag() string` - -GetBuildTag returns the BuildTag field if non-nil, zero value otherwise. - -### GetBuildTagOk - -`func (o *CreateOrUpdateVersionRequest) GetBuildTagOk() (*string, bool)` - -GetBuildTagOk returns a tuple with the BuildTag field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetBuildTag - -`func (o *CreateOrUpdateVersionRequest) SetBuildTag(v string)` - -SetBuildTag sets BuildTag field to given value. - -### HasBuildTag - -`func (o *CreateOrUpdateVersionRequest) HasBuildTag() bool` - -HasBuildTag returns a boolean if a field has been set. - -### SetBuildTagNil - -`func (o *CreateOrUpdateVersionRequest) SetBuildTagNil(b bool)` - - SetBuildTagNil sets the value for BuildTag to be an explicit nil - -### UnsetBuildTag -`func (o *CreateOrUpdateVersionRequest) UnsetBuildTag()` - -UnsetBuildTag ensures that no value is present for BuildTag, not even an explicit nil -### GetSourceFiles - -`func (o *CreateOrUpdateVersionRequest) GetSourceFiles() []VersionSourceFilesInner` - -GetSourceFiles returns the SourceFiles field if non-nil, zero value otherwise. - -### GetSourceFilesOk - -`func (o *CreateOrUpdateVersionRequest) GetSourceFilesOk() (*[]VersionSourceFilesInner, bool)` - -GetSourceFilesOk returns a tuple with the SourceFiles field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetSourceFiles - -`func (o *CreateOrUpdateVersionRequest) SetSourceFiles(v []VersionSourceFilesInner)` - -SetSourceFiles sets SourceFiles field to given value. - -### HasSourceFiles - -`func (o *CreateOrUpdateVersionRequest) HasSourceFiles() bool` - -HasSourceFiles returns a boolean if a field has been set. - -### GetGitRepoUrl - -`func (o *CreateOrUpdateVersionRequest) GetGitRepoUrl() string` - -GetGitRepoUrl returns the GitRepoUrl field if non-nil, zero value otherwise. - -### GetGitRepoUrlOk - -`func (o *CreateOrUpdateVersionRequest) GetGitRepoUrlOk() (*string, bool)` - -GetGitRepoUrlOk returns a tuple with the GitRepoUrl field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetGitRepoUrl - -`func (o *CreateOrUpdateVersionRequest) SetGitRepoUrl(v string)` - -SetGitRepoUrl sets GitRepoUrl field to given value. - -### HasGitRepoUrl - -`func (o *CreateOrUpdateVersionRequest) HasGitRepoUrl() bool` - -HasGitRepoUrl returns a boolean if a field has been set. - -### SetGitRepoUrlNil - -`func (o *CreateOrUpdateVersionRequest) SetGitRepoUrlNil(b bool)` - - SetGitRepoUrlNil sets the value for GitRepoUrl to be an explicit nil - -### UnsetGitRepoUrl -`func (o *CreateOrUpdateVersionRequest) UnsetGitRepoUrl()` - -UnsetGitRepoUrl ensures that no value is present for GitRepoUrl, not even an explicit nil -### GetTarballUrl - -`func (o *CreateOrUpdateVersionRequest) GetTarballUrl() string` - -GetTarballUrl returns the TarballUrl field if non-nil, zero value otherwise. - -### GetTarballUrlOk - -`func (o *CreateOrUpdateVersionRequest) GetTarballUrlOk() (*string, bool)` - -GetTarballUrlOk returns a tuple with the TarballUrl field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetTarballUrl - -`func (o *CreateOrUpdateVersionRequest) SetTarballUrl(v string)` - -SetTarballUrl sets TarballUrl field to given value. - -### HasTarballUrl - -`func (o *CreateOrUpdateVersionRequest) HasTarballUrl() bool` - -HasTarballUrl returns a boolean if a field has been set. - -### SetTarballUrlNil - -`func (o *CreateOrUpdateVersionRequest) SetTarballUrlNil(b bool)` - - SetTarballUrlNil sets the value for TarballUrl to be an explicit nil - -### UnsetTarballUrl -`func (o *CreateOrUpdateVersionRequest) UnsetTarballUrl()` - -UnsetTarballUrl ensures that no value is present for TarballUrl, not even an explicit nil -### GetGitHubGistUrl - -`func (o *CreateOrUpdateVersionRequest) GetGitHubGistUrl() string` - -GetGitHubGistUrl returns the GitHubGistUrl field if non-nil, zero value otherwise. - -### GetGitHubGistUrlOk - -`func (o *CreateOrUpdateVersionRequest) GetGitHubGistUrlOk() (*string, bool)` - -GetGitHubGistUrlOk returns a tuple with the GitHubGistUrl field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetGitHubGistUrl - -`func (o *CreateOrUpdateVersionRequest) SetGitHubGistUrl(v string)` - -SetGitHubGistUrl sets GitHubGistUrl field to given value. - -### HasGitHubGistUrl - -`func (o *CreateOrUpdateVersionRequest) HasGitHubGistUrl() bool` - -HasGitHubGistUrl returns a boolean if a field has been set. - -### SetGitHubGistUrlNil - -`func (o *CreateOrUpdateVersionRequest) SetGitHubGistUrlNil(b bool)` - - SetGitHubGistUrlNil sets the value for GitHubGistUrl to be an explicit nil - -### UnsetGitHubGistUrl -`func (o *CreateOrUpdateVersionRequest) UnsetGitHubGistUrl()` - -UnsetGitHubGistUrl ensures that no value is present for GitHubGistUrl, not even an explicit nil - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/CreateTaskRequest.md b/docs/CreateTaskRequest.md deleted file mode 100644 index 732cc9e..0000000 --- a/docs/CreateTaskRequest.md +++ /dev/null @@ -1,221 +0,0 @@ -# CreateTaskRequest - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**ActId** | **string** | | -**Name** | Pointer to **string** | | [optional] -**Options** | Pointer to [**NullableTaskOptions**](TaskOptions.md) | | [optional] -**Input** | Pointer to **map[string]interface{}** | The input configuration for the Actor task. This is a user-defined JSON object that will be passed to the Actor when the task is run. | [optional] -**Title** | Pointer to **NullableString** | | [optional] -**ActorStandby** | Pointer to [**NullableActorStandby**](ActorStandby.md) | | [optional] - -## Methods - -### NewCreateTaskRequest - -`func NewCreateTaskRequest(actId string, ) *CreateTaskRequest` - -NewCreateTaskRequest instantiates a new CreateTaskRequest object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewCreateTaskRequestWithDefaults - -`func NewCreateTaskRequestWithDefaults() *CreateTaskRequest` - -NewCreateTaskRequestWithDefaults instantiates a new CreateTaskRequest object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetActId - -`func (o *CreateTaskRequest) GetActId() string` - -GetActId returns the ActId field if non-nil, zero value otherwise. - -### GetActIdOk - -`func (o *CreateTaskRequest) GetActIdOk() (*string, bool)` - -GetActIdOk returns a tuple with the ActId field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetActId - -`func (o *CreateTaskRequest) SetActId(v string)` - -SetActId sets ActId field to given value. - - -### GetName - -`func (o *CreateTaskRequest) GetName() string` - -GetName returns the Name field if non-nil, zero value otherwise. - -### GetNameOk - -`func (o *CreateTaskRequest) GetNameOk() (*string, bool)` - -GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetName - -`func (o *CreateTaskRequest) SetName(v string)` - -SetName sets Name field to given value. - -### HasName - -`func (o *CreateTaskRequest) HasName() bool` - -HasName returns a boolean if a field has been set. - -### GetOptions - -`func (o *CreateTaskRequest) GetOptions() TaskOptions` - -GetOptions returns the Options field if non-nil, zero value otherwise. - -### GetOptionsOk - -`func (o *CreateTaskRequest) GetOptionsOk() (*TaskOptions, bool)` - -GetOptionsOk returns a tuple with the Options field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetOptions - -`func (o *CreateTaskRequest) SetOptions(v TaskOptions)` - -SetOptions sets Options field to given value. - -### HasOptions - -`func (o *CreateTaskRequest) HasOptions() bool` - -HasOptions returns a boolean if a field has been set. - -### SetOptionsNil - -`func (o *CreateTaskRequest) SetOptionsNil(b bool)` - - SetOptionsNil sets the value for Options to be an explicit nil - -### UnsetOptions -`func (o *CreateTaskRequest) UnsetOptions()` - -UnsetOptions ensures that no value is present for Options, not even an explicit nil -### GetInput - -`func (o *CreateTaskRequest) GetInput() map[string]interface{}` - -GetInput returns the Input field if non-nil, zero value otherwise. - -### GetInputOk - -`func (o *CreateTaskRequest) GetInputOk() (*map[string]interface{}, bool)` - -GetInputOk returns a tuple with the Input field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetInput - -`func (o *CreateTaskRequest) SetInput(v map[string]interface{})` - -SetInput sets Input field to given value. - -### HasInput - -`func (o *CreateTaskRequest) HasInput() bool` - -HasInput returns a boolean if a field has been set. - -### SetInputNil - -`func (o *CreateTaskRequest) SetInputNil(b bool)` - - SetInputNil sets the value for Input to be an explicit nil - -### UnsetInput -`func (o *CreateTaskRequest) UnsetInput()` - -UnsetInput ensures that no value is present for Input, not even an explicit nil -### GetTitle - -`func (o *CreateTaskRequest) GetTitle() string` - -GetTitle returns the Title field if non-nil, zero value otherwise. - -### GetTitleOk - -`func (o *CreateTaskRequest) GetTitleOk() (*string, bool)` - -GetTitleOk returns a tuple with the Title field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetTitle - -`func (o *CreateTaskRequest) SetTitle(v string)` - -SetTitle sets Title field to given value. - -### HasTitle - -`func (o *CreateTaskRequest) HasTitle() bool` - -HasTitle returns a boolean if a field has been set. - -### SetTitleNil - -`func (o *CreateTaskRequest) SetTitleNil(b bool)` - - SetTitleNil sets the value for Title to be an explicit nil - -### UnsetTitle -`func (o *CreateTaskRequest) UnsetTitle()` - -UnsetTitle ensures that no value is present for Title, not even an explicit nil -### GetActorStandby - -`func (o *CreateTaskRequest) GetActorStandby() ActorStandby` - -GetActorStandby returns the ActorStandby field if non-nil, zero value otherwise. - -### GetActorStandbyOk - -`func (o *CreateTaskRequest) GetActorStandbyOk() (*ActorStandby, bool)` - -GetActorStandbyOk returns a tuple with the ActorStandby field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetActorStandby - -`func (o *CreateTaskRequest) SetActorStandby(v ActorStandby)` - -SetActorStandby sets ActorStandby field to given value. - -### HasActorStandby - -`func (o *CreateTaskRequest) HasActorStandby() bool` - -HasActorStandby returns a boolean if a field has been set. - -### SetActorStandbyNil - -`func (o *CreateTaskRequest) SetActorStandbyNil(b bool)` - - SetActorStandbyNil sets the value for ActorStandby to be an explicit nil - -### UnsetActorStandby -`func (o *CreateTaskRequest) UnsetActorStandby()` - -UnsetActorStandby ensures that no value is present for ActorStandby, not even an explicit nil - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/Current.md b/docs/Current.md deleted file mode 100644 index 9e040bc..0000000 --- a/docs/Current.md +++ /dev/null @@ -1,266 +0,0 @@ -# Current - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**MonthlyUsageUsd** | **float32** | | -**MonthlyActorComputeUnits** | **float32** | | -**MonthlyExternalDataTransferGbytes** | **float32** | | -**MonthlyProxySerps** | **int32** | | -**MonthlyResidentialProxyGbytes** | **float32** | | -**ActorMemoryGbytes** | **float32** | | -**ActorCount** | **int32** | | -**ActorTaskCount** | **int32** | | -**ActiveActorJobCount** | **int32** | | -**TeamAccountSeatCount** | **int32** | | -**ScheduleCount** | Pointer to **int32** | | [optional] - -## Methods - -### NewCurrent - -`func NewCurrent(monthlyUsageUsd float32, monthlyActorComputeUnits float32, monthlyExternalDataTransferGbytes float32, monthlyProxySerps int32, monthlyResidentialProxyGbytes float32, actorMemoryGbytes float32, actorCount int32, actorTaskCount int32, activeActorJobCount int32, teamAccountSeatCount int32, ) *Current` - -NewCurrent instantiates a new Current object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewCurrentWithDefaults - -`func NewCurrentWithDefaults() *Current` - -NewCurrentWithDefaults instantiates a new Current object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetMonthlyUsageUsd - -`func (o *Current) GetMonthlyUsageUsd() float32` - -GetMonthlyUsageUsd returns the MonthlyUsageUsd field if non-nil, zero value otherwise. - -### GetMonthlyUsageUsdOk - -`func (o *Current) GetMonthlyUsageUsdOk() (*float32, bool)` - -GetMonthlyUsageUsdOk returns a tuple with the MonthlyUsageUsd field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetMonthlyUsageUsd - -`func (o *Current) SetMonthlyUsageUsd(v float32)` - -SetMonthlyUsageUsd sets MonthlyUsageUsd field to given value. - - -### GetMonthlyActorComputeUnits - -`func (o *Current) GetMonthlyActorComputeUnits() float32` - -GetMonthlyActorComputeUnits returns the MonthlyActorComputeUnits field if non-nil, zero value otherwise. - -### GetMonthlyActorComputeUnitsOk - -`func (o *Current) GetMonthlyActorComputeUnitsOk() (*float32, bool)` - -GetMonthlyActorComputeUnitsOk returns a tuple with the MonthlyActorComputeUnits field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetMonthlyActorComputeUnits - -`func (o *Current) SetMonthlyActorComputeUnits(v float32)` - -SetMonthlyActorComputeUnits sets MonthlyActorComputeUnits field to given value. - - -### GetMonthlyExternalDataTransferGbytes - -`func (o *Current) GetMonthlyExternalDataTransferGbytes() float32` - -GetMonthlyExternalDataTransferGbytes returns the MonthlyExternalDataTransferGbytes field if non-nil, zero value otherwise. - -### GetMonthlyExternalDataTransferGbytesOk - -`func (o *Current) GetMonthlyExternalDataTransferGbytesOk() (*float32, bool)` - -GetMonthlyExternalDataTransferGbytesOk returns a tuple with the MonthlyExternalDataTransferGbytes field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetMonthlyExternalDataTransferGbytes - -`func (o *Current) SetMonthlyExternalDataTransferGbytes(v float32)` - -SetMonthlyExternalDataTransferGbytes sets MonthlyExternalDataTransferGbytes field to given value. - - -### GetMonthlyProxySerps - -`func (o *Current) GetMonthlyProxySerps() int32` - -GetMonthlyProxySerps returns the MonthlyProxySerps field if non-nil, zero value otherwise. - -### GetMonthlyProxySerpsOk - -`func (o *Current) GetMonthlyProxySerpsOk() (*int32, bool)` - -GetMonthlyProxySerpsOk returns a tuple with the MonthlyProxySerps field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetMonthlyProxySerps - -`func (o *Current) SetMonthlyProxySerps(v int32)` - -SetMonthlyProxySerps sets MonthlyProxySerps field to given value. - - -### GetMonthlyResidentialProxyGbytes - -`func (o *Current) GetMonthlyResidentialProxyGbytes() float32` - -GetMonthlyResidentialProxyGbytes returns the MonthlyResidentialProxyGbytes field if non-nil, zero value otherwise. - -### GetMonthlyResidentialProxyGbytesOk - -`func (o *Current) GetMonthlyResidentialProxyGbytesOk() (*float32, bool)` - -GetMonthlyResidentialProxyGbytesOk returns a tuple with the MonthlyResidentialProxyGbytes field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetMonthlyResidentialProxyGbytes - -`func (o *Current) SetMonthlyResidentialProxyGbytes(v float32)` - -SetMonthlyResidentialProxyGbytes sets MonthlyResidentialProxyGbytes field to given value. - - -### GetActorMemoryGbytes - -`func (o *Current) GetActorMemoryGbytes() float32` - -GetActorMemoryGbytes returns the ActorMemoryGbytes field if non-nil, zero value otherwise. - -### GetActorMemoryGbytesOk - -`func (o *Current) GetActorMemoryGbytesOk() (*float32, bool)` - -GetActorMemoryGbytesOk returns a tuple with the ActorMemoryGbytes field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetActorMemoryGbytes - -`func (o *Current) SetActorMemoryGbytes(v float32)` - -SetActorMemoryGbytes sets ActorMemoryGbytes field to given value. - - -### GetActorCount - -`func (o *Current) GetActorCount() int32` - -GetActorCount returns the ActorCount field if non-nil, zero value otherwise. - -### GetActorCountOk - -`func (o *Current) GetActorCountOk() (*int32, bool)` - -GetActorCountOk returns a tuple with the ActorCount field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetActorCount - -`func (o *Current) SetActorCount(v int32)` - -SetActorCount sets ActorCount field to given value. - - -### GetActorTaskCount - -`func (o *Current) GetActorTaskCount() int32` - -GetActorTaskCount returns the ActorTaskCount field if non-nil, zero value otherwise. - -### GetActorTaskCountOk - -`func (o *Current) GetActorTaskCountOk() (*int32, bool)` - -GetActorTaskCountOk returns a tuple with the ActorTaskCount field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetActorTaskCount - -`func (o *Current) SetActorTaskCount(v int32)` - -SetActorTaskCount sets ActorTaskCount field to given value. - - -### GetActiveActorJobCount - -`func (o *Current) GetActiveActorJobCount() int32` - -GetActiveActorJobCount returns the ActiveActorJobCount field if non-nil, zero value otherwise. - -### GetActiveActorJobCountOk - -`func (o *Current) GetActiveActorJobCountOk() (*int32, bool)` - -GetActiveActorJobCountOk returns a tuple with the ActiveActorJobCount field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetActiveActorJobCount - -`func (o *Current) SetActiveActorJobCount(v int32)` - -SetActiveActorJobCount sets ActiveActorJobCount field to given value. - - -### GetTeamAccountSeatCount - -`func (o *Current) GetTeamAccountSeatCount() int32` - -GetTeamAccountSeatCount returns the TeamAccountSeatCount field if non-nil, zero value otherwise. - -### GetTeamAccountSeatCountOk - -`func (o *Current) GetTeamAccountSeatCountOk() (*int32, bool)` - -GetTeamAccountSeatCountOk returns a tuple with the TeamAccountSeatCount field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetTeamAccountSeatCount - -`func (o *Current) SetTeamAccountSeatCount(v int32)` - -SetTeamAccountSeatCount sets TeamAccountSeatCount field to given value. - - -### GetScheduleCount - -`func (o *Current) GetScheduleCount() int32` - -GetScheduleCount returns the ScheduleCount field if non-nil, zero value otherwise. - -### GetScheduleCountOk - -`func (o *Current) GetScheduleCountOk() (*int32, bool)` - -GetScheduleCountOk returns a tuple with the ScheduleCount field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetScheduleCount - -`func (o *Current) SetScheduleCount(v int32)` - -SetScheduleCount sets ScheduleCount field to given value. - -### HasScheduleCount - -`func (o *Current) HasScheduleCount() bool` - -HasScheduleCount returns a boolean if a field has been set. - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/CurrentPricingInfo.md b/docs/CurrentPricingInfo.md deleted file mode 100644 index 996b071..0000000 --- a/docs/CurrentPricingInfo.md +++ /dev/null @@ -1,495 +0,0 @@ -# CurrentPricingInfo - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**PricingModel** | **string** | | -**ApifyMarginPercentage** | Pointer to **float32** | | [optional] -**CreatedAt** | Pointer to **time.Time** | | [optional] -**StartedAt** | Pointer to **time.Time** | | [optional] -**NotifiedAboutChangeAt** | Pointer to **NullableTime** | | [optional] -**NotifiedAboutFutureChangeAt** | Pointer to **NullableTime** | | [optional] -**IsPriceChangeNotificationSuppressed** | Pointer to **bool** | | [optional] -**ForceContainsSignificantPriceChange** | Pointer to **bool** | | [optional] -**IsPPEPlatformUsagePaidByUser** | Pointer to **bool** | | [optional] -**ReasonForChange** | Pointer to **NullableString** | | [optional] -**TrialMinutes** | Pointer to **NullableInt32** | | [optional] -**UnitName** | Pointer to **NullableString** | | [optional] -**PricePerUnitUsd** | Pointer to **NullableFloat32** | | [optional] -**MinimalMaxTotalChargeUsd** | Pointer to **NullableFloat32** | | [optional] -**PricingPerEvent** | Pointer to **map[string]interface{}** | Per-event pricing configuration for pay-per-event Actors. | [optional] - -## Methods - -### NewCurrentPricingInfo - -`func NewCurrentPricingInfo(pricingModel string, ) *CurrentPricingInfo` - -NewCurrentPricingInfo instantiates a new CurrentPricingInfo object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewCurrentPricingInfoWithDefaults - -`func NewCurrentPricingInfoWithDefaults() *CurrentPricingInfo` - -NewCurrentPricingInfoWithDefaults instantiates a new CurrentPricingInfo object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetPricingModel - -`func (o *CurrentPricingInfo) GetPricingModel() string` - -GetPricingModel returns the PricingModel field if non-nil, zero value otherwise. - -### GetPricingModelOk - -`func (o *CurrentPricingInfo) GetPricingModelOk() (*string, bool)` - -GetPricingModelOk returns a tuple with the PricingModel field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetPricingModel - -`func (o *CurrentPricingInfo) SetPricingModel(v string)` - -SetPricingModel sets PricingModel field to given value. - - -### GetApifyMarginPercentage - -`func (o *CurrentPricingInfo) GetApifyMarginPercentage() float32` - -GetApifyMarginPercentage returns the ApifyMarginPercentage field if non-nil, zero value otherwise. - -### GetApifyMarginPercentageOk - -`func (o *CurrentPricingInfo) GetApifyMarginPercentageOk() (*float32, bool)` - -GetApifyMarginPercentageOk returns a tuple with the ApifyMarginPercentage field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetApifyMarginPercentage - -`func (o *CurrentPricingInfo) SetApifyMarginPercentage(v float32)` - -SetApifyMarginPercentage sets ApifyMarginPercentage field to given value. - -### HasApifyMarginPercentage - -`func (o *CurrentPricingInfo) HasApifyMarginPercentage() bool` - -HasApifyMarginPercentage returns a boolean if a field has been set. - -### GetCreatedAt - -`func (o *CurrentPricingInfo) GetCreatedAt() time.Time` - -GetCreatedAt returns the CreatedAt field if non-nil, zero value otherwise. - -### GetCreatedAtOk - -`func (o *CurrentPricingInfo) GetCreatedAtOk() (*time.Time, bool)` - -GetCreatedAtOk returns a tuple with the CreatedAt field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetCreatedAt - -`func (o *CurrentPricingInfo) SetCreatedAt(v time.Time)` - -SetCreatedAt sets CreatedAt field to given value. - -### HasCreatedAt - -`func (o *CurrentPricingInfo) HasCreatedAt() bool` - -HasCreatedAt returns a boolean if a field has been set. - -### GetStartedAt - -`func (o *CurrentPricingInfo) GetStartedAt() time.Time` - -GetStartedAt returns the StartedAt field if non-nil, zero value otherwise. - -### GetStartedAtOk - -`func (o *CurrentPricingInfo) GetStartedAtOk() (*time.Time, bool)` - -GetStartedAtOk returns a tuple with the StartedAt field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetStartedAt - -`func (o *CurrentPricingInfo) SetStartedAt(v time.Time)` - -SetStartedAt sets StartedAt field to given value. - -### HasStartedAt - -`func (o *CurrentPricingInfo) HasStartedAt() bool` - -HasStartedAt returns a boolean if a field has been set. - -### GetNotifiedAboutChangeAt - -`func (o *CurrentPricingInfo) GetNotifiedAboutChangeAt() time.Time` - -GetNotifiedAboutChangeAt returns the NotifiedAboutChangeAt field if non-nil, zero value otherwise. - -### GetNotifiedAboutChangeAtOk - -`func (o *CurrentPricingInfo) GetNotifiedAboutChangeAtOk() (*time.Time, bool)` - -GetNotifiedAboutChangeAtOk returns a tuple with the NotifiedAboutChangeAt field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetNotifiedAboutChangeAt - -`func (o *CurrentPricingInfo) SetNotifiedAboutChangeAt(v time.Time)` - -SetNotifiedAboutChangeAt sets NotifiedAboutChangeAt field to given value. - -### HasNotifiedAboutChangeAt - -`func (o *CurrentPricingInfo) HasNotifiedAboutChangeAt() bool` - -HasNotifiedAboutChangeAt returns a boolean if a field has been set. - -### SetNotifiedAboutChangeAtNil - -`func (o *CurrentPricingInfo) SetNotifiedAboutChangeAtNil(b bool)` - - SetNotifiedAboutChangeAtNil sets the value for NotifiedAboutChangeAt to be an explicit nil - -### UnsetNotifiedAboutChangeAt -`func (o *CurrentPricingInfo) UnsetNotifiedAboutChangeAt()` - -UnsetNotifiedAboutChangeAt ensures that no value is present for NotifiedAboutChangeAt, not even an explicit nil -### GetNotifiedAboutFutureChangeAt - -`func (o *CurrentPricingInfo) GetNotifiedAboutFutureChangeAt() time.Time` - -GetNotifiedAboutFutureChangeAt returns the NotifiedAboutFutureChangeAt field if non-nil, zero value otherwise. - -### GetNotifiedAboutFutureChangeAtOk - -`func (o *CurrentPricingInfo) GetNotifiedAboutFutureChangeAtOk() (*time.Time, bool)` - -GetNotifiedAboutFutureChangeAtOk returns a tuple with the NotifiedAboutFutureChangeAt field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetNotifiedAboutFutureChangeAt - -`func (o *CurrentPricingInfo) SetNotifiedAboutFutureChangeAt(v time.Time)` - -SetNotifiedAboutFutureChangeAt sets NotifiedAboutFutureChangeAt field to given value. - -### HasNotifiedAboutFutureChangeAt - -`func (o *CurrentPricingInfo) HasNotifiedAboutFutureChangeAt() bool` - -HasNotifiedAboutFutureChangeAt returns a boolean if a field has been set. - -### SetNotifiedAboutFutureChangeAtNil - -`func (o *CurrentPricingInfo) SetNotifiedAboutFutureChangeAtNil(b bool)` - - SetNotifiedAboutFutureChangeAtNil sets the value for NotifiedAboutFutureChangeAt to be an explicit nil - -### UnsetNotifiedAboutFutureChangeAt -`func (o *CurrentPricingInfo) UnsetNotifiedAboutFutureChangeAt()` - -UnsetNotifiedAboutFutureChangeAt ensures that no value is present for NotifiedAboutFutureChangeAt, not even an explicit nil -### GetIsPriceChangeNotificationSuppressed - -`func (o *CurrentPricingInfo) GetIsPriceChangeNotificationSuppressed() bool` - -GetIsPriceChangeNotificationSuppressed returns the IsPriceChangeNotificationSuppressed field if non-nil, zero value otherwise. - -### GetIsPriceChangeNotificationSuppressedOk - -`func (o *CurrentPricingInfo) GetIsPriceChangeNotificationSuppressedOk() (*bool, bool)` - -GetIsPriceChangeNotificationSuppressedOk returns a tuple with the IsPriceChangeNotificationSuppressed field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetIsPriceChangeNotificationSuppressed - -`func (o *CurrentPricingInfo) SetIsPriceChangeNotificationSuppressed(v bool)` - -SetIsPriceChangeNotificationSuppressed sets IsPriceChangeNotificationSuppressed field to given value. - -### HasIsPriceChangeNotificationSuppressed - -`func (o *CurrentPricingInfo) HasIsPriceChangeNotificationSuppressed() bool` - -HasIsPriceChangeNotificationSuppressed returns a boolean if a field has been set. - -### GetForceContainsSignificantPriceChange - -`func (o *CurrentPricingInfo) GetForceContainsSignificantPriceChange() bool` - -GetForceContainsSignificantPriceChange returns the ForceContainsSignificantPriceChange field if non-nil, zero value otherwise. - -### GetForceContainsSignificantPriceChangeOk - -`func (o *CurrentPricingInfo) GetForceContainsSignificantPriceChangeOk() (*bool, bool)` - -GetForceContainsSignificantPriceChangeOk returns a tuple with the ForceContainsSignificantPriceChange field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetForceContainsSignificantPriceChange - -`func (o *CurrentPricingInfo) SetForceContainsSignificantPriceChange(v bool)` - -SetForceContainsSignificantPriceChange sets ForceContainsSignificantPriceChange field to given value. - -### HasForceContainsSignificantPriceChange - -`func (o *CurrentPricingInfo) HasForceContainsSignificantPriceChange() bool` - -HasForceContainsSignificantPriceChange returns a boolean if a field has been set. - -### GetIsPPEPlatformUsagePaidByUser - -`func (o *CurrentPricingInfo) GetIsPPEPlatformUsagePaidByUser() bool` - -GetIsPPEPlatformUsagePaidByUser returns the IsPPEPlatformUsagePaidByUser field if non-nil, zero value otherwise. - -### GetIsPPEPlatformUsagePaidByUserOk - -`func (o *CurrentPricingInfo) GetIsPPEPlatformUsagePaidByUserOk() (*bool, bool)` - -GetIsPPEPlatformUsagePaidByUserOk returns a tuple with the IsPPEPlatformUsagePaidByUser field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetIsPPEPlatformUsagePaidByUser - -`func (o *CurrentPricingInfo) SetIsPPEPlatformUsagePaidByUser(v bool)` - -SetIsPPEPlatformUsagePaidByUser sets IsPPEPlatformUsagePaidByUser field to given value. - -### HasIsPPEPlatformUsagePaidByUser - -`func (o *CurrentPricingInfo) HasIsPPEPlatformUsagePaidByUser() bool` - -HasIsPPEPlatformUsagePaidByUser returns a boolean if a field has been set. - -### GetReasonForChange - -`func (o *CurrentPricingInfo) GetReasonForChange() string` - -GetReasonForChange returns the ReasonForChange field if non-nil, zero value otherwise. - -### GetReasonForChangeOk - -`func (o *CurrentPricingInfo) GetReasonForChangeOk() (*string, bool)` - -GetReasonForChangeOk returns a tuple with the ReasonForChange field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetReasonForChange - -`func (o *CurrentPricingInfo) SetReasonForChange(v string)` - -SetReasonForChange sets ReasonForChange field to given value. - -### HasReasonForChange - -`func (o *CurrentPricingInfo) HasReasonForChange() bool` - -HasReasonForChange returns a boolean if a field has been set. - -### SetReasonForChangeNil - -`func (o *CurrentPricingInfo) SetReasonForChangeNil(b bool)` - - SetReasonForChangeNil sets the value for ReasonForChange to be an explicit nil - -### UnsetReasonForChange -`func (o *CurrentPricingInfo) UnsetReasonForChange()` - -UnsetReasonForChange ensures that no value is present for ReasonForChange, not even an explicit nil -### GetTrialMinutes - -`func (o *CurrentPricingInfo) GetTrialMinutes() int32` - -GetTrialMinutes returns the TrialMinutes field if non-nil, zero value otherwise. - -### GetTrialMinutesOk - -`func (o *CurrentPricingInfo) GetTrialMinutesOk() (*int32, bool)` - -GetTrialMinutesOk returns a tuple with the TrialMinutes field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetTrialMinutes - -`func (o *CurrentPricingInfo) SetTrialMinutes(v int32)` - -SetTrialMinutes sets TrialMinutes field to given value. - -### HasTrialMinutes - -`func (o *CurrentPricingInfo) HasTrialMinutes() bool` - -HasTrialMinutes returns a boolean if a field has been set. - -### SetTrialMinutesNil - -`func (o *CurrentPricingInfo) SetTrialMinutesNil(b bool)` - - SetTrialMinutesNil sets the value for TrialMinutes to be an explicit nil - -### UnsetTrialMinutes -`func (o *CurrentPricingInfo) UnsetTrialMinutes()` - -UnsetTrialMinutes ensures that no value is present for TrialMinutes, not even an explicit nil -### GetUnitName - -`func (o *CurrentPricingInfo) GetUnitName() string` - -GetUnitName returns the UnitName field if non-nil, zero value otherwise. - -### GetUnitNameOk - -`func (o *CurrentPricingInfo) GetUnitNameOk() (*string, bool)` - -GetUnitNameOk returns a tuple with the UnitName field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetUnitName - -`func (o *CurrentPricingInfo) SetUnitName(v string)` - -SetUnitName sets UnitName field to given value. - -### HasUnitName - -`func (o *CurrentPricingInfo) HasUnitName() bool` - -HasUnitName returns a boolean if a field has been set. - -### SetUnitNameNil - -`func (o *CurrentPricingInfo) SetUnitNameNil(b bool)` - - SetUnitNameNil sets the value for UnitName to be an explicit nil - -### UnsetUnitName -`func (o *CurrentPricingInfo) UnsetUnitName()` - -UnsetUnitName ensures that no value is present for UnitName, not even an explicit nil -### GetPricePerUnitUsd - -`func (o *CurrentPricingInfo) GetPricePerUnitUsd() float32` - -GetPricePerUnitUsd returns the PricePerUnitUsd field if non-nil, zero value otherwise. - -### GetPricePerUnitUsdOk - -`func (o *CurrentPricingInfo) GetPricePerUnitUsdOk() (*float32, bool)` - -GetPricePerUnitUsdOk returns a tuple with the PricePerUnitUsd field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetPricePerUnitUsd - -`func (o *CurrentPricingInfo) SetPricePerUnitUsd(v float32)` - -SetPricePerUnitUsd sets PricePerUnitUsd field to given value. - -### HasPricePerUnitUsd - -`func (o *CurrentPricingInfo) HasPricePerUnitUsd() bool` - -HasPricePerUnitUsd returns a boolean if a field has been set. - -### SetPricePerUnitUsdNil - -`func (o *CurrentPricingInfo) SetPricePerUnitUsdNil(b bool)` - - SetPricePerUnitUsdNil sets the value for PricePerUnitUsd to be an explicit nil - -### UnsetPricePerUnitUsd -`func (o *CurrentPricingInfo) UnsetPricePerUnitUsd()` - -UnsetPricePerUnitUsd ensures that no value is present for PricePerUnitUsd, not even an explicit nil -### GetMinimalMaxTotalChargeUsd - -`func (o *CurrentPricingInfo) GetMinimalMaxTotalChargeUsd() float32` - -GetMinimalMaxTotalChargeUsd returns the MinimalMaxTotalChargeUsd field if non-nil, zero value otherwise. - -### GetMinimalMaxTotalChargeUsdOk - -`func (o *CurrentPricingInfo) GetMinimalMaxTotalChargeUsdOk() (*float32, bool)` - -GetMinimalMaxTotalChargeUsdOk returns a tuple with the MinimalMaxTotalChargeUsd field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetMinimalMaxTotalChargeUsd - -`func (o *CurrentPricingInfo) SetMinimalMaxTotalChargeUsd(v float32)` - -SetMinimalMaxTotalChargeUsd sets MinimalMaxTotalChargeUsd field to given value. - -### HasMinimalMaxTotalChargeUsd - -`func (o *CurrentPricingInfo) HasMinimalMaxTotalChargeUsd() bool` - -HasMinimalMaxTotalChargeUsd returns a boolean if a field has been set. - -### SetMinimalMaxTotalChargeUsdNil - -`func (o *CurrentPricingInfo) SetMinimalMaxTotalChargeUsdNil(b bool)` - - SetMinimalMaxTotalChargeUsdNil sets the value for MinimalMaxTotalChargeUsd to be an explicit nil - -### UnsetMinimalMaxTotalChargeUsd -`func (o *CurrentPricingInfo) UnsetMinimalMaxTotalChargeUsd()` - -UnsetMinimalMaxTotalChargeUsd ensures that no value is present for MinimalMaxTotalChargeUsd, not even an explicit nil -### GetPricingPerEvent - -`func (o *CurrentPricingInfo) GetPricingPerEvent() map[string]interface{}` - -GetPricingPerEvent returns the PricingPerEvent field if non-nil, zero value otherwise. - -### GetPricingPerEventOk - -`func (o *CurrentPricingInfo) GetPricingPerEventOk() (*map[string]interface{}, bool)` - -GetPricingPerEventOk returns a tuple with the PricingPerEvent field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetPricingPerEvent - -`func (o *CurrentPricingInfo) SetPricingPerEvent(v map[string]interface{})` - -SetPricingPerEvent sets PricingPerEvent field to given value. - -### HasPricingPerEvent - -`func (o *CurrentPricingInfo) HasPricingPerEvent() bool` - -HasPricingPerEvent returns a boolean if a field has been set. - -### SetPricingPerEventNil - -`func (o *CurrentPricingInfo) SetPricingPerEventNil(b bool)` - - SetPricingPerEventNil sets the value for PricingPerEvent to be an explicit nil - -### UnsetPricingPerEvent -`func (o *CurrentPricingInfo) UnsetPricingPerEvent()` - -UnsetPricingPerEvent ensures that no value is present for PricingPerEvent, not even an explicit nil - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/DailyServiceUsages.md b/docs/DailyServiceUsages.md deleted file mode 100644 index 28bcb21..0000000 --- a/docs/DailyServiceUsages.md +++ /dev/null @@ -1,93 +0,0 @@ -# DailyServiceUsages - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Date** | **string** | | -**ServiceUsage** | [**map[string]UsageItem**](UsageItem.md) | A map of service usage item names to their usage details. | -**TotalUsageCreditsUsd** | **float32** | | - -## Methods - -### NewDailyServiceUsages - -`func NewDailyServiceUsages(date string, serviceUsage map[string]UsageItem, totalUsageCreditsUsd float32, ) *DailyServiceUsages` - -NewDailyServiceUsages instantiates a new DailyServiceUsages object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewDailyServiceUsagesWithDefaults - -`func NewDailyServiceUsagesWithDefaults() *DailyServiceUsages` - -NewDailyServiceUsagesWithDefaults instantiates a new DailyServiceUsages object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetDate - -`func (o *DailyServiceUsages) GetDate() string` - -GetDate returns the Date field if non-nil, zero value otherwise. - -### GetDateOk - -`func (o *DailyServiceUsages) GetDateOk() (*string, bool)` - -GetDateOk returns a tuple with the Date field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetDate - -`func (o *DailyServiceUsages) SetDate(v string)` - -SetDate sets Date field to given value. - - -### GetServiceUsage - -`func (o *DailyServiceUsages) GetServiceUsage() map[string]UsageItem` - -GetServiceUsage returns the ServiceUsage field if non-nil, zero value otherwise. - -### GetServiceUsageOk - -`func (o *DailyServiceUsages) GetServiceUsageOk() (*map[string]UsageItem, bool)` - -GetServiceUsageOk returns a tuple with the ServiceUsage field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetServiceUsage - -`func (o *DailyServiceUsages) SetServiceUsage(v map[string]UsageItem)` - -SetServiceUsage sets ServiceUsage field to given value. - - -### GetTotalUsageCreditsUsd - -`func (o *DailyServiceUsages) GetTotalUsageCreditsUsd() float32` - -GetTotalUsageCreditsUsd returns the TotalUsageCreditsUsd field if non-nil, zero value otherwise. - -### GetTotalUsageCreditsUsdOk - -`func (o *DailyServiceUsages) GetTotalUsageCreditsUsdOk() (*float32, bool)` - -GetTotalUsageCreditsUsdOk returns a tuple with the TotalUsageCreditsUsd field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetTotalUsageCreditsUsd - -`func (o *DailyServiceUsages) SetTotalUsageCreditsUsd(v float32)` - -SetTotalUsageCreditsUsd sets TotalUsageCreditsUsd field to given value. - - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/Dataset.md b/docs/Dataset.md deleted file mode 100644 index f07c7cf..0000000 --- a/docs/Dataset.md +++ /dev/null @@ -1,492 +0,0 @@ -# Dataset - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Id** | **string** | | -**Name** | Pointer to **NullableString** | | [optional] -**UserId** | **string** | | -**CreatedAt** | **time.Time** | | -**ModifiedAt** | **time.Time** | | -**AccessedAt** | **time.Time** | | -**ItemCount** | **int32** | | -**CleanItemCount** | **int32** | | -**ActId** | Pointer to **NullableString** | | [optional] -**ActRunId** | Pointer to **NullableString** | | [optional] -**Fields** | Pointer to **[]string** | | [optional] -**Schema** | Pointer to **map[string]interface{}** | Defines the schema of items in your dataset, the full specification can be found in [Apify docs](/platform/actors/development/actor-definition/dataset-schema) | [optional] -**ConsoleUrl** | **string** | | -**ItemsPublicUrl** | Pointer to **string** | A public link to access the dataset items directly. | [optional] -**UrlSigningSecretKey** | Pointer to **NullableString** | A secret key for generating signed public URLs. It is only provided to clients with WRITE permission for the dataset. | [optional] -**GeneralAccess** | Pointer to [**GeneralAccess**](GeneralAccess.md) | | [optional] -**Stats** | Pointer to [**DatasetStats**](DatasetStats.md) | | [optional] - -## Methods - -### NewDataset - -`func NewDataset(id string, userId string, createdAt time.Time, modifiedAt time.Time, accessedAt time.Time, itemCount int32, cleanItemCount int32, consoleUrl string, ) *Dataset` - -NewDataset instantiates a new Dataset object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewDatasetWithDefaults - -`func NewDatasetWithDefaults() *Dataset` - -NewDatasetWithDefaults instantiates a new Dataset object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetId - -`func (o *Dataset) GetId() string` - -GetId returns the Id field if non-nil, zero value otherwise. - -### GetIdOk - -`func (o *Dataset) GetIdOk() (*string, bool)` - -GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetId - -`func (o *Dataset) SetId(v string)` - -SetId sets Id field to given value. - - -### GetName - -`func (o *Dataset) GetName() string` - -GetName returns the Name field if non-nil, zero value otherwise. - -### GetNameOk - -`func (o *Dataset) GetNameOk() (*string, bool)` - -GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetName - -`func (o *Dataset) SetName(v string)` - -SetName sets Name field to given value. - -### HasName - -`func (o *Dataset) HasName() bool` - -HasName returns a boolean if a field has been set. - -### SetNameNil - -`func (o *Dataset) SetNameNil(b bool)` - - SetNameNil sets the value for Name to be an explicit nil - -### UnsetName -`func (o *Dataset) UnsetName()` - -UnsetName ensures that no value is present for Name, not even an explicit nil -### GetUserId - -`func (o *Dataset) GetUserId() string` - -GetUserId returns the UserId field if non-nil, zero value otherwise. - -### GetUserIdOk - -`func (o *Dataset) GetUserIdOk() (*string, bool)` - -GetUserIdOk returns a tuple with the UserId field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetUserId - -`func (o *Dataset) SetUserId(v string)` - -SetUserId sets UserId field to given value. - - -### GetCreatedAt - -`func (o *Dataset) GetCreatedAt() time.Time` - -GetCreatedAt returns the CreatedAt field if non-nil, zero value otherwise. - -### GetCreatedAtOk - -`func (o *Dataset) GetCreatedAtOk() (*time.Time, bool)` - -GetCreatedAtOk returns a tuple with the CreatedAt field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetCreatedAt - -`func (o *Dataset) SetCreatedAt(v time.Time)` - -SetCreatedAt sets CreatedAt field to given value. - - -### GetModifiedAt - -`func (o *Dataset) GetModifiedAt() time.Time` - -GetModifiedAt returns the ModifiedAt field if non-nil, zero value otherwise. - -### GetModifiedAtOk - -`func (o *Dataset) GetModifiedAtOk() (*time.Time, bool)` - -GetModifiedAtOk returns a tuple with the ModifiedAt field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetModifiedAt - -`func (o *Dataset) SetModifiedAt(v time.Time)` - -SetModifiedAt sets ModifiedAt field to given value. - - -### GetAccessedAt - -`func (o *Dataset) GetAccessedAt() time.Time` - -GetAccessedAt returns the AccessedAt field if non-nil, zero value otherwise. - -### GetAccessedAtOk - -`func (o *Dataset) GetAccessedAtOk() (*time.Time, bool)` - -GetAccessedAtOk returns a tuple with the AccessedAt field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetAccessedAt - -`func (o *Dataset) SetAccessedAt(v time.Time)` - -SetAccessedAt sets AccessedAt field to given value. - - -### GetItemCount - -`func (o *Dataset) GetItemCount() int32` - -GetItemCount returns the ItemCount field if non-nil, zero value otherwise. - -### GetItemCountOk - -`func (o *Dataset) GetItemCountOk() (*int32, bool)` - -GetItemCountOk returns a tuple with the ItemCount field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetItemCount - -`func (o *Dataset) SetItemCount(v int32)` - -SetItemCount sets ItemCount field to given value. - - -### GetCleanItemCount - -`func (o *Dataset) GetCleanItemCount() int32` - -GetCleanItemCount returns the CleanItemCount field if non-nil, zero value otherwise. - -### GetCleanItemCountOk - -`func (o *Dataset) GetCleanItemCountOk() (*int32, bool)` - -GetCleanItemCountOk returns a tuple with the CleanItemCount field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetCleanItemCount - -`func (o *Dataset) SetCleanItemCount(v int32)` - -SetCleanItemCount sets CleanItemCount field to given value. - - -### GetActId - -`func (o *Dataset) GetActId() string` - -GetActId returns the ActId field if non-nil, zero value otherwise. - -### GetActIdOk - -`func (o *Dataset) GetActIdOk() (*string, bool)` - -GetActIdOk returns a tuple with the ActId field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetActId - -`func (o *Dataset) SetActId(v string)` - -SetActId sets ActId field to given value. - -### HasActId - -`func (o *Dataset) HasActId() bool` - -HasActId returns a boolean if a field has been set. - -### SetActIdNil - -`func (o *Dataset) SetActIdNil(b bool)` - - SetActIdNil sets the value for ActId to be an explicit nil - -### UnsetActId -`func (o *Dataset) UnsetActId()` - -UnsetActId ensures that no value is present for ActId, not even an explicit nil -### GetActRunId - -`func (o *Dataset) GetActRunId() string` - -GetActRunId returns the ActRunId field if non-nil, zero value otherwise. - -### GetActRunIdOk - -`func (o *Dataset) GetActRunIdOk() (*string, bool)` - -GetActRunIdOk returns a tuple with the ActRunId field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetActRunId - -`func (o *Dataset) SetActRunId(v string)` - -SetActRunId sets ActRunId field to given value. - -### HasActRunId - -`func (o *Dataset) HasActRunId() bool` - -HasActRunId returns a boolean if a field has been set. - -### SetActRunIdNil - -`func (o *Dataset) SetActRunIdNil(b bool)` - - SetActRunIdNil sets the value for ActRunId to be an explicit nil - -### UnsetActRunId -`func (o *Dataset) UnsetActRunId()` - -UnsetActRunId ensures that no value is present for ActRunId, not even an explicit nil -### GetFields - -`func (o *Dataset) GetFields() []string` - -GetFields returns the Fields field if non-nil, zero value otherwise. - -### GetFieldsOk - -`func (o *Dataset) GetFieldsOk() (*[]string, bool)` - -GetFieldsOk returns a tuple with the Fields field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetFields - -`func (o *Dataset) SetFields(v []string)` - -SetFields sets Fields field to given value. - -### HasFields - -`func (o *Dataset) HasFields() bool` - -HasFields returns a boolean if a field has been set. - -### SetFieldsNil - -`func (o *Dataset) SetFieldsNil(b bool)` - - SetFieldsNil sets the value for Fields to be an explicit nil - -### UnsetFields -`func (o *Dataset) UnsetFields()` - -UnsetFields ensures that no value is present for Fields, not even an explicit nil -### GetSchema - -`func (o *Dataset) GetSchema() map[string]interface{}` - -GetSchema returns the Schema field if non-nil, zero value otherwise. - -### GetSchemaOk - -`func (o *Dataset) GetSchemaOk() (*map[string]interface{}, bool)` - -GetSchemaOk returns a tuple with the Schema field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetSchema - -`func (o *Dataset) SetSchema(v map[string]interface{})` - -SetSchema sets Schema field to given value. - -### HasSchema - -`func (o *Dataset) HasSchema() bool` - -HasSchema returns a boolean if a field has been set. - -### SetSchemaNil - -`func (o *Dataset) SetSchemaNil(b bool)` - - SetSchemaNil sets the value for Schema to be an explicit nil - -### UnsetSchema -`func (o *Dataset) UnsetSchema()` - -UnsetSchema ensures that no value is present for Schema, not even an explicit nil -### GetConsoleUrl - -`func (o *Dataset) GetConsoleUrl() string` - -GetConsoleUrl returns the ConsoleUrl field if non-nil, zero value otherwise. - -### GetConsoleUrlOk - -`func (o *Dataset) GetConsoleUrlOk() (*string, bool)` - -GetConsoleUrlOk returns a tuple with the ConsoleUrl field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetConsoleUrl - -`func (o *Dataset) SetConsoleUrl(v string)` - -SetConsoleUrl sets ConsoleUrl field to given value. - - -### GetItemsPublicUrl - -`func (o *Dataset) GetItemsPublicUrl() string` - -GetItemsPublicUrl returns the ItemsPublicUrl field if non-nil, zero value otherwise. - -### GetItemsPublicUrlOk - -`func (o *Dataset) GetItemsPublicUrlOk() (*string, bool)` - -GetItemsPublicUrlOk returns a tuple with the ItemsPublicUrl field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetItemsPublicUrl - -`func (o *Dataset) SetItemsPublicUrl(v string)` - -SetItemsPublicUrl sets ItemsPublicUrl field to given value. - -### HasItemsPublicUrl - -`func (o *Dataset) HasItemsPublicUrl() bool` - -HasItemsPublicUrl returns a boolean if a field has been set. - -### GetUrlSigningSecretKey - -`func (o *Dataset) GetUrlSigningSecretKey() string` - -GetUrlSigningSecretKey returns the UrlSigningSecretKey field if non-nil, zero value otherwise. - -### GetUrlSigningSecretKeyOk - -`func (o *Dataset) GetUrlSigningSecretKeyOk() (*string, bool)` - -GetUrlSigningSecretKeyOk returns a tuple with the UrlSigningSecretKey field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetUrlSigningSecretKey - -`func (o *Dataset) SetUrlSigningSecretKey(v string)` - -SetUrlSigningSecretKey sets UrlSigningSecretKey field to given value. - -### HasUrlSigningSecretKey - -`func (o *Dataset) HasUrlSigningSecretKey() bool` - -HasUrlSigningSecretKey returns a boolean if a field has been set. - -### SetUrlSigningSecretKeyNil - -`func (o *Dataset) SetUrlSigningSecretKeyNil(b bool)` - - SetUrlSigningSecretKeyNil sets the value for UrlSigningSecretKey to be an explicit nil - -### UnsetUrlSigningSecretKey -`func (o *Dataset) UnsetUrlSigningSecretKey()` - -UnsetUrlSigningSecretKey ensures that no value is present for UrlSigningSecretKey, not even an explicit nil -### GetGeneralAccess - -`func (o *Dataset) GetGeneralAccess() GeneralAccess` - -GetGeneralAccess returns the GeneralAccess field if non-nil, zero value otherwise. - -### GetGeneralAccessOk - -`func (o *Dataset) GetGeneralAccessOk() (*GeneralAccess, bool)` - -GetGeneralAccessOk returns a tuple with the GeneralAccess field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetGeneralAccess - -`func (o *Dataset) SetGeneralAccess(v GeneralAccess)` - -SetGeneralAccess sets GeneralAccess field to given value. - -### HasGeneralAccess - -`func (o *Dataset) HasGeneralAccess() bool` - -HasGeneralAccess returns a boolean if a field has been set. - -### GetStats - -`func (o *Dataset) GetStats() DatasetStats` - -GetStats returns the Stats field if non-nil, zero value otherwise. - -### GetStatsOk - -`func (o *Dataset) GetStatsOk() (*DatasetStats, bool)` - -GetStatsOk returns a tuple with the Stats field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetStats - -`func (o *Dataset) SetStats(v DatasetStats)` - -SetStats sets Stats field to given value. - -### HasStats - -`func (o *Dataset) HasStats() bool` - -HasStats returns a boolean if a field has been set. - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/DatasetFieldStatistics.md b/docs/DatasetFieldStatistics.md deleted file mode 100644 index a50dcc1..0000000 --- a/docs/DatasetFieldStatistics.md +++ /dev/null @@ -1,174 +0,0 @@ -# DatasetFieldStatistics - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Min** | Pointer to **NullableFloat32** | Minimum value of the field. For numbers, this is calculated directly. For strings, this is the length of the shortest string. For arrays, this is the length of the shortest array. For objects, this is the number of keys in the smallest object. | [optional] -**Max** | Pointer to **NullableFloat32** | Maximum value of the field. For numbers, this is calculated directly. For strings, this is the length of the longest string. For arrays, this is the length of the longest array. For objects, this is the number of keys in the largest object. | [optional] -**NullCount** | Pointer to **NullableInt32** | How many items in the dataset have a null value for this field. | [optional] -**EmptyCount** | Pointer to **NullableInt32** | How many items in the dataset are `undefined`, meaning that for example empty string is not considered empty. | [optional] - -## Methods - -### NewDatasetFieldStatistics - -`func NewDatasetFieldStatistics() *DatasetFieldStatistics` - -NewDatasetFieldStatistics instantiates a new DatasetFieldStatistics object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewDatasetFieldStatisticsWithDefaults - -`func NewDatasetFieldStatisticsWithDefaults() *DatasetFieldStatistics` - -NewDatasetFieldStatisticsWithDefaults instantiates a new DatasetFieldStatistics object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetMin - -`func (o *DatasetFieldStatistics) GetMin() float32` - -GetMin returns the Min field if non-nil, zero value otherwise. - -### GetMinOk - -`func (o *DatasetFieldStatistics) GetMinOk() (*float32, bool)` - -GetMinOk returns a tuple with the Min field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetMin - -`func (o *DatasetFieldStatistics) SetMin(v float32)` - -SetMin sets Min field to given value. - -### HasMin - -`func (o *DatasetFieldStatistics) HasMin() bool` - -HasMin returns a boolean if a field has been set. - -### SetMinNil - -`func (o *DatasetFieldStatistics) SetMinNil(b bool)` - - SetMinNil sets the value for Min to be an explicit nil - -### UnsetMin -`func (o *DatasetFieldStatistics) UnsetMin()` - -UnsetMin ensures that no value is present for Min, not even an explicit nil -### GetMax - -`func (o *DatasetFieldStatistics) GetMax() float32` - -GetMax returns the Max field if non-nil, zero value otherwise. - -### GetMaxOk - -`func (o *DatasetFieldStatistics) GetMaxOk() (*float32, bool)` - -GetMaxOk returns a tuple with the Max field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetMax - -`func (o *DatasetFieldStatistics) SetMax(v float32)` - -SetMax sets Max field to given value. - -### HasMax - -`func (o *DatasetFieldStatistics) HasMax() bool` - -HasMax returns a boolean if a field has been set. - -### SetMaxNil - -`func (o *DatasetFieldStatistics) SetMaxNil(b bool)` - - SetMaxNil sets the value for Max to be an explicit nil - -### UnsetMax -`func (o *DatasetFieldStatistics) UnsetMax()` - -UnsetMax ensures that no value is present for Max, not even an explicit nil -### GetNullCount - -`func (o *DatasetFieldStatistics) GetNullCount() int32` - -GetNullCount returns the NullCount field if non-nil, zero value otherwise. - -### GetNullCountOk - -`func (o *DatasetFieldStatistics) GetNullCountOk() (*int32, bool)` - -GetNullCountOk returns a tuple with the NullCount field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetNullCount - -`func (o *DatasetFieldStatistics) SetNullCount(v int32)` - -SetNullCount sets NullCount field to given value. - -### HasNullCount - -`func (o *DatasetFieldStatistics) HasNullCount() bool` - -HasNullCount returns a boolean if a field has been set. - -### SetNullCountNil - -`func (o *DatasetFieldStatistics) SetNullCountNil(b bool)` - - SetNullCountNil sets the value for NullCount to be an explicit nil - -### UnsetNullCount -`func (o *DatasetFieldStatistics) UnsetNullCount()` - -UnsetNullCount ensures that no value is present for NullCount, not even an explicit nil -### GetEmptyCount - -`func (o *DatasetFieldStatistics) GetEmptyCount() int32` - -GetEmptyCount returns the EmptyCount field if non-nil, zero value otherwise. - -### GetEmptyCountOk - -`func (o *DatasetFieldStatistics) GetEmptyCountOk() (*int32, bool)` - -GetEmptyCountOk returns a tuple with the EmptyCount field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetEmptyCount - -`func (o *DatasetFieldStatistics) SetEmptyCount(v int32)` - -SetEmptyCount sets EmptyCount field to given value. - -### HasEmptyCount - -`func (o *DatasetFieldStatistics) HasEmptyCount() bool` - -HasEmptyCount returns a boolean if a field has been set. - -### SetEmptyCountNil - -`func (o *DatasetFieldStatistics) SetEmptyCountNil(b bool)` - - SetEmptyCountNil sets the value for EmptyCount to be an explicit nil - -### UnsetEmptyCount -`func (o *DatasetFieldStatistics) UnsetEmptyCount()` - -UnsetEmptyCount ensures that no value is present for EmptyCount, not even an explicit nil - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/DatasetListItem.md b/docs/DatasetListItem.md deleted file mode 100644 index 9b2e590..0000000 --- a/docs/DatasetListItem.md +++ /dev/null @@ -1,384 +0,0 @@ -# DatasetListItem - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Id** | **string** | | -**Name** | **string** | | -**UserId** | **string** | | -**CreatedAt** | **time.Time** | | -**ModifiedAt** | **time.Time** | | -**AccessedAt** | **time.Time** | | -**ItemCount** | **int32** | | -**CleanItemCount** | **int32** | | -**ActId** | Pointer to **NullableString** | | [optional] -**ActRunId** | Pointer to **NullableString** | | [optional] -**Title** | Pointer to **NullableString** | | [optional] -**Username** | Pointer to **string** | | [optional] -**GeneralAccess** | Pointer to [**GeneralAccess**](GeneralAccess.md) | | [optional] -**Stats** | Pointer to [**DatasetStats**](DatasetStats.md) | | [optional] - -## Methods - -### NewDatasetListItem - -`func NewDatasetListItem(id string, name string, userId string, createdAt time.Time, modifiedAt time.Time, accessedAt time.Time, itemCount int32, cleanItemCount int32, ) *DatasetListItem` - -NewDatasetListItem instantiates a new DatasetListItem object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewDatasetListItemWithDefaults - -`func NewDatasetListItemWithDefaults() *DatasetListItem` - -NewDatasetListItemWithDefaults instantiates a new DatasetListItem object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetId - -`func (o *DatasetListItem) GetId() string` - -GetId returns the Id field if non-nil, zero value otherwise. - -### GetIdOk - -`func (o *DatasetListItem) GetIdOk() (*string, bool)` - -GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetId - -`func (o *DatasetListItem) SetId(v string)` - -SetId sets Id field to given value. - - -### GetName - -`func (o *DatasetListItem) GetName() string` - -GetName returns the Name field if non-nil, zero value otherwise. - -### GetNameOk - -`func (o *DatasetListItem) GetNameOk() (*string, bool)` - -GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetName - -`func (o *DatasetListItem) SetName(v string)` - -SetName sets Name field to given value. - - -### GetUserId - -`func (o *DatasetListItem) GetUserId() string` - -GetUserId returns the UserId field if non-nil, zero value otherwise. - -### GetUserIdOk - -`func (o *DatasetListItem) GetUserIdOk() (*string, bool)` - -GetUserIdOk returns a tuple with the UserId field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetUserId - -`func (o *DatasetListItem) SetUserId(v string)` - -SetUserId sets UserId field to given value. - - -### GetCreatedAt - -`func (o *DatasetListItem) GetCreatedAt() time.Time` - -GetCreatedAt returns the CreatedAt field if non-nil, zero value otherwise. - -### GetCreatedAtOk - -`func (o *DatasetListItem) GetCreatedAtOk() (*time.Time, bool)` - -GetCreatedAtOk returns a tuple with the CreatedAt field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetCreatedAt - -`func (o *DatasetListItem) SetCreatedAt(v time.Time)` - -SetCreatedAt sets CreatedAt field to given value. - - -### GetModifiedAt - -`func (o *DatasetListItem) GetModifiedAt() time.Time` - -GetModifiedAt returns the ModifiedAt field if non-nil, zero value otherwise. - -### GetModifiedAtOk - -`func (o *DatasetListItem) GetModifiedAtOk() (*time.Time, bool)` - -GetModifiedAtOk returns a tuple with the ModifiedAt field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetModifiedAt - -`func (o *DatasetListItem) SetModifiedAt(v time.Time)` - -SetModifiedAt sets ModifiedAt field to given value. - - -### GetAccessedAt - -`func (o *DatasetListItem) GetAccessedAt() time.Time` - -GetAccessedAt returns the AccessedAt field if non-nil, zero value otherwise. - -### GetAccessedAtOk - -`func (o *DatasetListItem) GetAccessedAtOk() (*time.Time, bool)` - -GetAccessedAtOk returns a tuple with the AccessedAt field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetAccessedAt - -`func (o *DatasetListItem) SetAccessedAt(v time.Time)` - -SetAccessedAt sets AccessedAt field to given value. - - -### GetItemCount - -`func (o *DatasetListItem) GetItemCount() int32` - -GetItemCount returns the ItemCount field if non-nil, zero value otherwise. - -### GetItemCountOk - -`func (o *DatasetListItem) GetItemCountOk() (*int32, bool)` - -GetItemCountOk returns a tuple with the ItemCount field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetItemCount - -`func (o *DatasetListItem) SetItemCount(v int32)` - -SetItemCount sets ItemCount field to given value. - - -### GetCleanItemCount - -`func (o *DatasetListItem) GetCleanItemCount() int32` - -GetCleanItemCount returns the CleanItemCount field if non-nil, zero value otherwise. - -### GetCleanItemCountOk - -`func (o *DatasetListItem) GetCleanItemCountOk() (*int32, bool)` - -GetCleanItemCountOk returns a tuple with the CleanItemCount field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetCleanItemCount - -`func (o *DatasetListItem) SetCleanItemCount(v int32)` - -SetCleanItemCount sets CleanItemCount field to given value. - - -### GetActId - -`func (o *DatasetListItem) GetActId() string` - -GetActId returns the ActId field if non-nil, zero value otherwise. - -### GetActIdOk - -`func (o *DatasetListItem) GetActIdOk() (*string, bool)` - -GetActIdOk returns a tuple with the ActId field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetActId - -`func (o *DatasetListItem) SetActId(v string)` - -SetActId sets ActId field to given value. - -### HasActId - -`func (o *DatasetListItem) HasActId() bool` - -HasActId returns a boolean if a field has been set. - -### SetActIdNil - -`func (o *DatasetListItem) SetActIdNil(b bool)` - - SetActIdNil sets the value for ActId to be an explicit nil - -### UnsetActId -`func (o *DatasetListItem) UnsetActId()` - -UnsetActId ensures that no value is present for ActId, not even an explicit nil -### GetActRunId - -`func (o *DatasetListItem) GetActRunId() string` - -GetActRunId returns the ActRunId field if non-nil, zero value otherwise. - -### GetActRunIdOk - -`func (o *DatasetListItem) GetActRunIdOk() (*string, bool)` - -GetActRunIdOk returns a tuple with the ActRunId field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetActRunId - -`func (o *DatasetListItem) SetActRunId(v string)` - -SetActRunId sets ActRunId field to given value. - -### HasActRunId - -`func (o *DatasetListItem) HasActRunId() bool` - -HasActRunId returns a boolean if a field has been set. - -### SetActRunIdNil - -`func (o *DatasetListItem) SetActRunIdNil(b bool)` - - SetActRunIdNil sets the value for ActRunId to be an explicit nil - -### UnsetActRunId -`func (o *DatasetListItem) UnsetActRunId()` - -UnsetActRunId ensures that no value is present for ActRunId, not even an explicit nil -### GetTitle - -`func (o *DatasetListItem) GetTitle() string` - -GetTitle returns the Title field if non-nil, zero value otherwise. - -### GetTitleOk - -`func (o *DatasetListItem) GetTitleOk() (*string, bool)` - -GetTitleOk returns a tuple with the Title field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetTitle - -`func (o *DatasetListItem) SetTitle(v string)` - -SetTitle sets Title field to given value. - -### HasTitle - -`func (o *DatasetListItem) HasTitle() bool` - -HasTitle returns a boolean if a field has been set. - -### SetTitleNil - -`func (o *DatasetListItem) SetTitleNil(b bool)` - - SetTitleNil sets the value for Title to be an explicit nil - -### UnsetTitle -`func (o *DatasetListItem) UnsetTitle()` - -UnsetTitle ensures that no value is present for Title, not even an explicit nil -### GetUsername - -`func (o *DatasetListItem) GetUsername() string` - -GetUsername returns the Username field if non-nil, zero value otherwise. - -### GetUsernameOk - -`func (o *DatasetListItem) GetUsernameOk() (*string, bool)` - -GetUsernameOk returns a tuple with the Username field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetUsername - -`func (o *DatasetListItem) SetUsername(v string)` - -SetUsername sets Username field to given value. - -### HasUsername - -`func (o *DatasetListItem) HasUsername() bool` - -HasUsername returns a boolean if a field has been set. - -### GetGeneralAccess - -`func (o *DatasetListItem) GetGeneralAccess() GeneralAccess` - -GetGeneralAccess returns the GeneralAccess field if non-nil, zero value otherwise. - -### GetGeneralAccessOk - -`func (o *DatasetListItem) GetGeneralAccessOk() (*GeneralAccess, bool)` - -GetGeneralAccessOk returns a tuple with the GeneralAccess field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetGeneralAccess - -`func (o *DatasetListItem) SetGeneralAccess(v GeneralAccess)` - -SetGeneralAccess sets GeneralAccess field to given value. - -### HasGeneralAccess - -`func (o *DatasetListItem) HasGeneralAccess() bool` - -HasGeneralAccess returns a boolean if a field has been set. - -### GetStats - -`func (o *DatasetListItem) GetStats() DatasetStats` - -GetStats returns the Stats field if non-nil, zero value otherwise. - -### GetStatsOk - -`func (o *DatasetListItem) GetStatsOk() (*DatasetStats, bool)` - -GetStatsOk returns a tuple with the Stats field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetStats - -`func (o *DatasetListItem) SetStats(v DatasetStats)` - -SetStats sets Stats field to given value. - -### HasStats - -`func (o *DatasetListItem) HasStats() bool` - -HasStats returns a boolean if a field has been set. - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/DatasetResponse.md b/docs/DatasetResponse.md deleted file mode 100644 index f1b5ffc..0000000 --- a/docs/DatasetResponse.md +++ /dev/null @@ -1,51 +0,0 @@ -# DatasetResponse - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Data** | [**Dataset**](Dataset.md) | | - -## Methods - -### NewDatasetResponse - -`func NewDatasetResponse(data Dataset, ) *DatasetResponse` - -NewDatasetResponse instantiates a new DatasetResponse object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewDatasetResponseWithDefaults - -`func NewDatasetResponseWithDefaults() *DatasetResponse` - -NewDatasetResponseWithDefaults instantiates a new DatasetResponse object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetData - -`func (o *DatasetResponse) GetData() Dataset` - -GetData returns the Data field if non-nil, zero value otherwise. - -### GetDataOk - -`func (o *DatasetResponse) GetDataOk() (*Dataset, bool)` - -GetDataOk returns a tuple with the Data field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetData - -`func (o *DatasetResponse) SetData(v Dataset)` - -SetData sets Data field to given value. - - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/DatasetSchemaValidationError.md b/docs/DatasetSchemaValidationError.md deleted file mode 100644 index 735c415..0000000 --- a/docs/DatasetSchemaValidationError.md +++ /dev/null @@ -1,108 +0,0 @@ -# DatasetSchemaValidationError - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Type** | Pointer to **string** | The type of the error. | [optional] -**Message** | Pointer to **string** | A human-readable message describing the error. | [optional] -**Data** | Pointer to [**SchemaValidationErrorData**](SchemaValidationErrorData.md) | | [optional] - -## Methods - -### NewDatasetSchemaValidationError - -`func NewDatasetSchemaValidationError() *DatasetSchemaValidationError` - -NewDatasetSchemaValidationError instantiates a new DatasetSchemaValidationError object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewDatasetSchemaValidationErrorWithDefaults - -`func NewDatasetSchemaValidationErrorWithDefaults() *DatasetSchemaValidationError` - -NewDatasetSchemaValidationErrorWithDefaults instantiates a new DatasetSchemaValidationError object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetType - -`func (o *DatasetSchemaValidationError) GetType() string` - -GetType returns the Type field if non-nil, zero value otherwise. - -### GetTypeOk - -`func (o *DatasetSchemaValidationError) GetTypeOk() (*string, bool)` - -GetTypeOk returns a tuple with the Type field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetType - -`func (o *DatasetSchemaValidationError) SetType(v string)` - -SetType sets Type field to given value. - -### HasType - -`func (o *DatasetSchemaValidationError) HasType() bool` - -HasType returns a boolean if a field has been set. - -### GetMessage - -`func (o *DatasetSchemaValidationError) GetMessage() string` - -GetMessage returns the Message field if non-nil, zero value otherwise. - -### GetMessageOk - -`func (o *DatasetSchemaValidationError) GetMessageOk() (*string, bool)` - -GetMessageOk returns a tuple with the Message field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetMessage - -`func (o *DatasetSchemaValidationError) SetMessage(v string)` - -SetMessage sets Message field to given value. - -### HasMessage - -`func (o *DatasetSchemaValidationError) HasMessage() bool` - -HasMessage returns a boolean if a field has been set. - -### GetData - -`func (o *DatasetSchemaValidationError) GetData() SchemaValidationErrorData` - -GetData returns the Data field if non-nil, zero value otherwise. - -### GetDataOk - -`func (o *DatasetSchemaValidationError) GetDataOk() (*SchemaValidationErrorData, bool)` - -GetDataOk returns a tuple with the Data field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetData - -`func (o *DatasetSchemaValidationError) SetData(v SchemaValidationErrorData)` - -SetData sets Data field to given value. - -### HasData - -`func (o *DatasetSchemaValidationError) HasData() bool` - -HasData returns a boolean if a field has been set. - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/DatasetStatistics.md b/docs/DatasetStatistics.md deleted file mode 100644 index 2c81410..0000000 --- a/docs/DatasetStatistics.md +++ /dev/null @@ -1,56 +0,0 @@ -# DatasetStatistics - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**FieldStatistics** | Pointer to [**map[string]DatasetFieldStatistics**](DatasetFieldStatistics.md) | When you configure the dataset [fields schema](https://docs.apify.com/platform/actors/development/actor-definition/dataset-schema/validation), we measure the statistics such as `min`, `max`, `nullCount` and `emptyCount` for each field. This property provides statistics for each field from dataset fields schema. <br/></br>See dataset field statistics [documentation](https://docs.apify.com/platform/actors/development/actor-definition/dataset-schema/validation#dataset-field-statistics) for more information. | [optional] - -## Methods - -### NewDatasetStatistics - -`func NewDatasetStatistics() *DatasetStatistics` - -NewDatasetStatistics instantiates a new DatasetStatistics object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewDatasetStatisticsWithDefaults - -`func NewDatasetStatisticsWithDefaults() *DatasetStatistics` - -NewDatasetStatisticsWithDefaults instantiates a new DatasetStatistics object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetFieldStatistics - -`func (o *DatasetStatistics) GetFieldStatistics() map[string]DatasetFieldStatistics` - -GetFieldStatistics returns the FieldStatistics field if non-nil, zero value otherwise. - -### GetFieldStatisticsOk - -`func (o *DatasetStatistics) GetFieldStatisticsOk() (*map[string]DatasetFieldStatistics, bool)` - -GetFieldStatisticsOk returns a tuple with the FieldStatistics field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetFieldStatistics - -`func (o *DatasetStatistics) SetFieldStatistics(v map[string]DatasetFieldStatistics)` - -SetFieldStatistics sets FieldStatistics field to given value. - -### HasFieldStatistics - -`func (o *DatasetStatistics) HasFieldStatistics() bool` - -HasFieldStatistics returns a boolean if a field has been set. - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/DatasetStatisticsResponse.md b/docs/DatasetStatisticsResponse.md deleted file mode 100644 index d01346c..0000000 --- a/docs/DatasetStatisticsResponse.md +++ /dev/null @@ -1,51 +0,0 @@ -# DatasetStatisticsResponse - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Data** | [**DatasetStatistics**](DatasetStatistics.md) | | - -## Methods - -### NewDatasetStatisticsResponse - -`func NewDatasetStatisticsResponse(data DatasetStatistics, ) *DatasetStatisticsResponse` - -NewDatasetStatisticsResponse instantiates a new DatasetStatisticsResponse object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewDatasetStatisticsResponseWithDefaults - -`func NewDatasetStatisticsResponseWithDefaults() *DatasetStatisticsResponse` - -NewDatasetStatisticsResponseWithDefaults instantiates a new DatasetStatisticsResponse object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetData - -`func (o *DatasetStatisticsResponse) GetData() DatasetStatistics` - -GetData returns the Data field if non-nil, zero value otherwise. - -### GetDataOk - -`func (o *DatasetStatisticsResponse) GetDataOk() (*DatasetStatistics, bool)` - -GetDataOk returns a tuple with the Data field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetData - -`func (o *DatasetStatisticsResponse) SetData(v DatasetStatistics)` - -SetData sets Data field to given value. - - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/DatasetStats.md b/docs/DatasetStats.md deleted file mode 100644 index 96b7e81..0000000 --- a/docs/DatasetStats.md +++ /dev/null @@ -1,134 +0,0 @@ -# DatasetStats - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**ReadCount** | Pointer to **int32** | | [optional] -**WriteCount** | Pointer to **int32** | | [optional] -**StorageBytes** | Pointer to **int32** | Total storage size in bytes. Only returned by the single-dataset endpoint. | [optional] -**InflatedBytes** | Pointer to **int32** | Uncompressed size in bytes. Only returned by the dataset list endpoint. | [optional] - -## Methods - -### NewDatasetStats - -`func NewDatasetStats() *DatasetStats` - -NewDatasetStats instantiates a new DatasetStats object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewDatasetStatsWithDefaults - -`func NewDatasetStatsWithDefaults() *DatasetStats` - -NewDatasetStatsWithDefaults instantiates a new DatasetStats object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetReadCount - -`func (o *DatasetStats) GetReadCount() int32` - -GetReadCount returns the ReadCount field if non-nil, zero value otherwise. - -### GetReadCountOk - -`func (o *DatasetStats) GetReadCountOk() (*int32, bool)` - -GetReadCountOk returns a tuple with the ReadCount field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetReadCount - -`func (o *DatasetStats) SetReadCount(v int32)` - -SetReadCount sets ReadCount field to given value. - -### HasReadCount - -`func (o *DatasetStats) HasReadCount() bool` - -HasReadCount returns a boolean if a field has been set. - -### GetWriteCount - -`func (o *DatasetStats) GetWriteCount() int32` - -GetWriteCount returns the WriteCount field if non-nil, zero value otherwise. - -### GetWriteCountOk - -`func (o *DatasetStats) GetWriteCountOk() (*int32, bool)` - -GetWriteCountOk returns a tuple with the WriteCount field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetWriteCount - -`func (o *DatasetStats) SetWriteCount(v int32)` - -SetWriteCount sets WriteCount field to given value. - -### HasWriteCount - -`func (o *DatasetStats) HasWriteCount() bool` - -HasWriteCount returns a boolean if a field has been set. - -### GetStorageBytes - -`func (o *DatasetStats) GetStorageBytes() int32` - -GetStorageBytes returns the StorageBytes field if non-nil, zero value otherwise. - -### GetStorageBytesOk - -`func (o *DatasetStats) GetStorageBytesOk() (*int32, bool)` - -GetStorageBytesOk returns a tuple with the StorageBytes field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetStorageBytes - -`func (o *DatasetStats) SetStorageBytes(v int32)` - -SetStorageBytes sets StorageBytes field to given value. - -### HasStorageBytes - -`func (o *DatasetStats) HasStorageBytes() bool` - -HasStorageBytes returns a boolean if a field has been set. - -### GetInflatedBytes - -`func (o *DatasetStats) GetInflatedBytes() int32` - -GetInflatedBytes returns the InflatedBytes field if non-nil, zero value otherwise. - -### GetInflatedBytesOk - -`func (o *DatasetStats) GetInflatedBytesOk() (*int32, bool)` - -GetInflatedBytesOk returns a tuple with the InflatedBytes field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetInflatedBytes - -`func (o *DatasetStats) SetInflatedBytes(v int32)` - -SetInflatedBytes sets InflatedBytes field to given value. - -### HasInflatedBytes - -`func (o *DatasetStats) HasInflatedBytes() bool` - -HasInflatedBytes returns a boolean if a field has been set. - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/DecodeAndVerifyData.md b/docs/DecodeAndVerifyData.md deleted file mode 100644 index cee005d..0000000 --- a/docs/DecodeAndVerifyData.md +++ /dev/null @@ -1,113 +0,0 @@ -# DecodeAndVerifyData - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Decoded** | **interface{}** | | -**EncodedByUserId** | **NullableString** | | -**IsVerifiedUser** | **bool** | | - -## Methods - -### NewDecodeAndVerifyData - -`func NewDecodeAndVerifyData(decoded interface{}, encodedByUserId NullableString, isVerifiedUser bool, ) *DecodeAndVerifyData` - -NewDecodeAndVerifyData instantiates a new DecodeAndVerifyData object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewDecodeAndVerifyDataWithDefaults - -`func NewDecodeAndVerifyDataWithDefaults() *DecodeAndVerifyData` - -NewDecodeAndVerifyDataWithDefaults instantiates a new DecodeAndVerifyData object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetDecoded - -`func (o *DecodeAndVerifyData) GetDecoded() interface{}` - -GetDecoded returns the Decoded field if non-nil, zero value otherwise. - -### GetDecodedOk - -`func (o *DecodeAndVerifyData) GetDecodedOk() (*interface{}, bool)` - -GetDecodedOk returns a tuple with the Decoded field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetDecoded - -`func (o *DecodeAndVerifyData) SetDecoded(v interface{})` - -SetDecoded sets Decoded field to given value. - - -### SetDecodedNil - -`func (o *DecodeAndVerifyData) SetDecodedNil(b bool)` - - SetDecodedNil sets the value for Decoded to be an explicit nil - -### UnsetDecoded -`func (o *DecodeAndVerifyData) UnsetDecoded()` - -UnsetDecoded ensures that no value is present for Decoded, not even an explicit nil -### GetEncodedByUserId - -`func (o *DecodeAndVerifyData) GetEncodedByUserId() string` - -GetEncodedByUserId returns the EncodedByUserId field if non-nil, zero value otherwise. - -### GetEncodedByUserIdOk - -`func (o *DecodeAndVerifyData) GetEncodedByUserIdOk() (*string, bool)` - -GetEncodedByUserIdOk returns a tuple with the EncodedByUserId field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetEncodedByUserId - -`func (o *DecodeAndVerifyData) SetEncodedByUserId(v string)` - -SetEncodedByUserId sets EncodedByUserId field to given value. - - -### SetEncodedByUserIdNil - -`func (o *DecodeAndVerifyData) SetEncodedByUserIdNil(b bool)` - - SetEncodedByUserIdNil sets the value for EncodedByUserId to be an explicit nil - -### UnsetEncodedByUserId -`func (o *DecodeAndVerifyData) UnsetEncodedByUserId()` - -UnsetEncodedByUserId ensures that no value is present for EncodedByUserId, not even an explicit nil -### GetIsVerifiedUser - -`func (o *DecodeAndVerifyData) GetIsVerifiedUser() bool` - -GetIsVerifiedUser returns the IsVerifiedUser field if non-nil, zero value otherwise. - -### GetIsVerifiedUserOk - -`func (o *DecodeAndVerifyData) GetIsVerifiedUserOk() (*bool, bool)` - -GetIsVerifiedUserOk returns a tuple with the IsVerifiedUser field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetIsVerifiedUser - -`func (o *DecodeAndVerifyData) SetIsVerifiedUser(v bool)` - -SetIsVerifiedUser sets IsVerifiedUser field to given value. - - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/DecodeAndVerifyRequest.md b/docs/DecodeAndVerifyRequest.md deleted file mode 100644 index 5d5f674..0000000 --- a/docs/DecodeAndVerifyRequest.md +++ /dev/null @@ -1,51 +0,0 @@ -# DecodeAndVerifyRequest - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Encoded** | **string** | | - -## Methods - -### NewDecodeAndVerifyRequest - -`func NewDecodeAndVerifyRequest(encoded string, ) *DecodeAndVerifyRequest` - -NewDecodeAndVerifyRequest instantiates a new DecodeAndVerifyRequest object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewDecodeAndVerifyRequestWithDefaults - -`func NewDecodeAndVerifyRequestWithDefaults() *DecodeAndVerifyRequest` - -NewDecodeAndVerifyRequestWithDefaults instantiates a new DecodeAndVerifyRequest object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetEncoded - -`func (o *DecodeAndVerifyRequest) GetEncoded() string` - -GetEncoded returns the Encoded field if non-nil, zero value otherwise. - -### GetEncodedOk - -`func (o *DecodeAndVerifyRequest) GetEncodedOk() (*string, bool)` - -GetEncodedOk returns a tuple with the Encoded field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetEncoded - -`func (o *DecodeAndVerifyRequest) SetEncoded(v string)` - -SetEncoded sets Encoded field to given value. - - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/DecodeAndVerifyResponse.md b/docs/DecodeAndVerifyResponse.md deleted file mode 100644 index cf99b1e..0000000 --- a/docs/DecodeAndVerifyResponse.md +++ /dev/null @@ -1,51 +0,0 @@ -# DecodeAndVerifyResponse - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Data** | [**DecodeAndVerifyData**](DecodeAndVerifyData.md) | | - -## Methods - -### NewDecodeAndVerifyResponse - -`func NewDecodeAndVerifyResponse(data DecodeAndVerifyData, ) *DecodeAndVerifyResponse` - -NewDecodeAndVerifyResponse instantiates a new DecodeAndVerifyResponse object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewDecodeAndVerifyResponseWithDefaults - -`func NewDecodeAndVerifyResponseWithDefaults() *DecodeAndVerifyResponse` - -NewDecodeAndVerifyResponseWithDefaults instantiates a new DecodeAndVerifyResponse object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetData - -`func (o *DecodeAndVerifyResponse) GetData() DecodeAndVerifyData` - -GetData returns the Data field if non-nil, zero value otherwise. - -### GetDataOk - -`func (o *DecodeAndVerifyResponse) GetDataOk() (*DecodeAndVerifyData, bool)` - -GetDataOk returns a tuple with the Data field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetData - -`func (o *DecodeAndVerifyResponse) SetData(v DecodeAndVerifyData)` - -SetData sets Data field to given value. - - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/DefaultDatasetAPI.md b/docs/DefaultDatasetAPI.md deleted file mode 100644 index b794de8..0000000 --- a/docs/DefaultDatasetAPI.md +++ /dev/null @@ -1,484 +0,0 @@ -# \DefaultDatasetAPI - -All URIs are relative to *https://api.apify.com* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**ActorRunDatasetDelete**](DefaultDatasetAPI.md#ActorRunDatasetDelete) | **Delete** /v2/actor-runs/{runId}/dataset | Delete default dataset -[**ActorRunDatasetGet**](DefaultDatasetAPI.md#ActorRunDatasetGet) | **Get** /v2/actor-runs/{runId}/dataset | Get default dataset -[**ActorRunDatasetItemsGet**](DefaultDatasetAPI.md#ActorRunDatasetItemsGet) | **Get** /v2/actor-runs/{runId}/dataset/items | Get default dataset items -[**ActorRunDatasetItemsPost**](DefaultDatasetAPI.md#ActorRunDatasetItemsPost) | **Post** /v2/actor-runs/{runId}/dataset/items | Store items -[**ActorRunDatasetPut**](DefaultDatasetAPI.md#ActorRunDatasetPut) | **Put** /v2/actor-runs/{runId}/dataset | Update default dataset -[**ActorRunDatasetStatisticsGet**](DefaultDatasetAPI.md#ActorRunDatasetStatisticsGet) | **Get** /v2/actor-runs/{runId}/dataset/statistics | Get default dataset statistics - - - -## ActorRunDatasetDelete - -> ActorRunDatasetDelete(ctx, runId).Execute() - -Delete default dataset - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - runId := "3KH8gEpp4d8uQSe8T" // string | Actor run ID. - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - r, err := apiClient.DefaultDatasetAPI.ActorRunDatasetDelete(context.Background(), runId).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `DefaultDatasetAPI.ActorRunDatasetDelete``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**runId** | **string** | Actor run ID. | - -### Other Parameters - -Other parameters are passed through a pointer to a apiActorRunDatasetDeleteRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - -### Return type - - (empty response body) - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## ActorRunDatasetGet - -> DatasetResponse ActorRunDatasetGet(ctx, runId).Execute() - -Get default dataset - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - runId := "3KH8gEpp4d8uQSe8T" // string | Actor run ID. - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.DefaultDatasetAPI.ActorRunDatasetGet(context.Background(), runId).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `DefaultDatasetAPI.ActorRunDatasetGet``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `ActorRunDatasetGet`: DatasetResponse - fmt.Fprintf(os.Stdout, "Response from `DefaultDatasetAPI.ActorRunDatasetGet`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**runId** | **string** | Actor run ID. | - -### Other Parameters - -Other parameters are passed through a pointer to a apiActorRunDatasetGetRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - -### Return type - -[**DatasetResponse**](DatasetResponse.md) - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## ActorRunDatasetItemsGet - -> []map[string]interface{} ActorRunDatasetItemsGet(ctx, runId).Format(format).Clean(clean).Offset(offset).Limit(limit).Fields(fields).OutputFields(outputFields).Omit(omit).Unwind(unwind).Flatten(flatten).Desc(desc).Attachment(attachment).Delimiter(delimiter).Bom(bom).XmlRoot(xmlRoot).XmlRow(xmlRow).SkipHeaderRow(skipHeaderRow).SkipHidden(skipHidden).SkipEmpty(skipEmpty).Simplified(simplified).View(view).SkipFailedPages(skipFailedPages).FeedTitle(feedTitle).FeedDescription(feedDescription).Signature(signature).Execute() - -Get default dataset items - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - runId := "3KH8gEpp4d8uQSe8T" // string | Actor run ID. - format := "json" // string | Format of the results, possible values are: `json`, `jsonl`, `csv`, `html`, `xlsx`, `xml` and `rss`. The default value is `json`. (optional) - clean := false // bool | If `true` or `1` then the API endpoint returns only non-empty items and skips hidden fields (i.e. fields starting with the # character). The `clean` parameter is just a shortcut for `skipHidden=true` and `skipEmpty=true` parameters. Note that since some objects might be skipped from the output, that the result might contain less items than the `limit` value. (optional) - offset := float64(0) // float64 | Number of items that should be skipped at the start. The default value is `0`. (optional) - limit := float64(1.2) // float64 | Maximum number of items to return. By default there is no limit. (optional) - fields := "myValue,myOtherValue" // string | A comma-separated list of fields which should be picked from the items, only these fields will remain in the resulting record objects. Note that the fields in the outputted items are sorted the same way as they are specified in the `fields` query parameter. You can use this feature to effectively fix the output format. (optional) - outputFields := "title,link" // string | A comma-separated list of output field names that positionally rename the fields specified in the `fields` parameter. For example, `?fields=headline,url&outputFields=title,link` renames `headline` to `title` and `url` to `link` in the output. The number of names in `outputFields` must match the number of names in `fields`. Requires the `fields` parameter to be specified as well. (optional) - omit := "myValue,myOtherValue" // string | A comma-separated list of fields which should be omitted from the items. (optional) - unwind := "myValue,myOtherValue" // string | A comma-separated list of fields which should be unwound, in order which they should be processed. Each field should be either an array or an object. If the field is an array then every element of the array will become a separate record and merged with parent object. If the unwound field is an object then it is merged with the parent object. If the unwound field is missing or its value is neither an array nor an object and therefore cannot be merged with a parent object then the item gets preserved as it is. Note that the unwound items ignore the `desc` parameter. (optional) - flatten := "myValue" // string | A comma-separated list of fields which should transform nested objects into flat structures. For example, with `flatten=\"foo\"` the object `{\"foo\":{\"bar\": \"hello\"}}` is turned into `{\"foo.bar\": \"hello\"}`. The original object with properties is replaced with the flattened object. (optional) - desc := true // bool | By default, results are returned in the same order as they were stored. To reverse the order, set this parameter to `true` or `1`. (optional) - attachment := true // bool | If `true` or `1` then the response will define the `Content-Disposition: attachment` header, forcing a web browser to download the file rather than to display it. By default this header is not present. (optional) - delimiter := ";" // string | A delimiter character for CSV files, only used if `format=csv`. You might need to URL-encode the character (e.g. use `%09` for tab or `%3B` for semicolon). The default delimiter is a simple comma (`,`). (optional) - bom := false // bool | All text responses are encoded in UTF-8 encoding. By default, the `format=csv` files are prefixed with the UTF-8 Byte Order Mark (BOM), while `json`, `jsonl`, `xml`, `html` and `rss` files are not. If you want to override this default behavior, specify `bom=1` query parameter to include the BOM or `bom=0` to skip it. (optional) - xmlRoot := "items" // string | Overrides default root element name of `xml` output. By default the root element is `items`. (optional) - xmlRow := "item" // string | Overrides default element name that wraps each page or page function result object in `xml` output. By default the element name is `item`. (optional) - skipHeaderRow := true // bool | If `true` or `1` then header row in the `csv` format is skipped. (optional) - skipHidden := false // bool | If `true` or `1` then hidden fields are skipped from the output, i.e. fields starting with the `#` character. (optional) - skipEmpty := false // bool | If `true` or `1` then empty items are skipped from the output. Note that if used, the results might contain less items than the limit value. (optional) - simplified := false // bool | If `true` or `1` then, the endpoint applies the `fields=url,pageFunctionResult,errorInfo` and `unwind=pageFunctionResult` query parameters. This feature is used to emulate simplified results provided by the legacy Apify Crawler product and it's not recommended to use it in new integrations. (optional) - view := "overview" // string | Defines the view configuration for dataset items based on the schema definition. This parameter determines how the data will be filtered and presented. For complete specification details, see the [dataset schema documentation](/platform/actors/development/actor-definition/dataset-schema). (optional) - skipFailedPages := false // bool | If `true` or `1` then, the all the items with errorInfo property will be skipped from the output. This feature is here to emulate functionality of API version 1 used for the legacy Apify Crawler product and it's not recommended to use it in new integrations. (optional) - feedTitle := "Latest posts from r/pasta" // string | Overrides the auto-generated RSS channel `<title>` element. Only used when `format=rss`. If not provided, the title defaults to `Dataset <label>`. (optional) - feedDescription := "Scraped forum posts" // string | Overrides the auto-generated RSS channel `<description>` element. Only used when `format=rss`. If not provided, the description defaults to `Items in dataset with id \"<datasetId>\".` (optional) - signature := "2wTI46Bg8qWQrV7tavlPI" // string | Signature used for the access. (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.DefaultDatasetAPI.ActorRunDatasetItemsGet(context.Background(), runId).Format(format).Clean(clean).Offset(offset).Limit(limit).Fields(fields).OutputFields(outputFields).Omit(omit).Unwind(unwind).Flatten(flatten).Desc(desc).Attachment(attachment).Delimiter(delimiter).Bom(bom).XmlRoot(xmlRoot).XmlRow(xmlRow).SkipHeaderRow(skipHeaderRow).SkipHidden(skipHidden).SkipEmpty(skipEmpty).Simplified(simplified).View(view).SkipFailedPages(skipFailedPages).FeedTitle(feedTitle).FeedDescription(feedDescription).Signature(signature).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `DefaultDatasetAPI.ActorRunDatasetItemsGet``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `ActorRunDatasetItemsGet`: []map[string]interface{} - fmt.Fprintf(os.Stdout, "Response from `DefaultDatasetAPI.ActorRunDatasetItemsGet`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**runId** | **string** | Actor run ID. | - -### Other Parameters - -Other parameters are passed through a pointer to a apiActorRunDatasetItemsGetRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - **format** | **string** | Format of the results, possible values are: `json`, `jsonl`, `csv`, `html`, `xlsx`, `xml` and `rss`. The default value is `json`. | - **clean** | **bool** | If `true` or `1` then the API endpoint returns only non-empty items and skips hidden fields (i.e. fields starting with the # character). The `clean` parameter is just a shortcut for `skipHidden=true` and `skipEmpty=true` parameters. Note that since some objects might be skipped from the output, that the result might contain less items than the `limit` value. | - **offset** | **float64** | Number of items that should be skipped at the start. The default value is `0`. | - **limit** | **float64** | Maximum number of items to return. By default there is no limit. | - **fields** | **string** | A comma-separated list of fields which should be picked from the items, only these fields will remain in the resulting record objects. Note that the fields in the outputted items are sorted the same way as they are specified in the `fields` query parameter. You can use this feature to effectively fix the output format. | - **outputFields** | **string** | A comma-separated list of output field names that positionally rename the fields specified in the `fields` parameter. For example, `?fields=headline,url&outputFields=title,link` renames `headline` to `title` and `url` to `link` in the output. The number of names in `outputFields` must match the number of names in `fields`. Requires the `fields` parameter to be specified as well. | - **omit** | **string** | A comma-separated list of fields which should be omitted from the items. | - **unwind** | **string** | A comma-separated list of fields which should be unwound, in order which they should be processed. Each field should be either an array or an object. If the field is an array then every element of the array will become a separate record and merged with parent object. If the unwound field is an object then it is merged with the parent object. If the unwound field is missing or its value is neither an array nor an object and therefore cannot be merged with a parent object then the item gets preserved as it is. Note that the unwound items ignore the `desc` parameter. | - **flatten** | **string** | A comma-separated list of fields which should transform nested objects into flat structures. For example, with `flatten=\"foo\"` the object `{\"foo\":{\"bar\": \"hello\"}}` is turned into `{\"foo.bar\": \"hello\"}`. The original object with properties is replaced with the flattened object. | - **desc** | **bool** | By default, results are returned in the same order as they were stored. To reverse the order, set this parameter to `true` or `1`. | - **attachment** | **bool** | If `true` or `1` then the response will define the `Content-Disposition: attachment` header, forcing a web browser to download the file rather than to display it. By default this header is not present. | - **delimiter** | **string** | A delimiter character for CSV files, only used if `format=csv`. You might need to URL-encode the character (e.g. use `%09` for tab or `%3B` for semicolon). The default delimiter is a simple comma (`,`). | - **bom** | **bool** | All text responses are encoded in UTF-8 encoding. By default, the `format=csv` files are prefixed with the UTF-8 Byte Order Mark (BOM), while `json`, `jsonl`, `xml`, `html` and `rss` files are not. If you want to override this default behavior, specify `bom=1` query parameter to include the BOM or `bom=0` to skip it. | - **xmlRoot** | **string** | Overrides default root element name of `xml` output. By default the root element is `items`. | - **xmlRow** | **string** | Overrides default element name that wraps each page or page function result object in `xml` output. By default the element name is `item`. | - **skipHeaderRow** | **bool** | If `true` or `1` then header row in the `csv` format is skipped. | - **skipHidden** | **bool** | If `true` or `1` then hidden fields are skipped from the output, i.e. fields starting with the `#` character. | - **skipEmpty** | **bool** | If `true` or `1` then empty items are skipped from the output. Note that if used, the results might contain less items than the limit value. | - **simplified** | **bool** | If `true` or `1` then, the endpoint applies the `fields=url,pageFunctionResult,errorInfo` and `unwind=pageFunctionResult` query parameters. This feature is used to emulate simplified results provided by the legacy Apify Crawler product and it's not recommended to use it in new integrations. | - **view** | **string** | Defines the view configuration for dataset items based on the schema definition. This parameter determines how the data will be filtered and presented. For complete specification details, see the [dataset schema documentation](/platform/actors/development/actor-definition/dataset-schema). | - **skipFailedPages** | **bool** | If `true` or `1` then, the all the items with errorInfo property will be skipped from the output. This feature is here to emulate functionality of API version 1 used for the legacy Apify Crawler product and it's not recommended to use it in new integrations. | - **feedTitle** | **string** | Overrides the auto-generated RSS channel `<title>` element. Only used when `format=rss`. If not provided, the title defaults to `Dataset <label>`. | - **feedDescription** | **string** | Overrides the auto-generated RSS channel `<description>` element. Only used when `format=rss`. If not provided, the description defaults to `Items in dataset with id \"<datasetId>\".` | - **signature** | **string** | Signature used for the access. | - -### Return type - -**[]map[string]interface{}** - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json, application/jsonl, text/csv, text/html, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/rss+xml, application/xml - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## ActorRunDatasetItemsPost - -> map[string]interface{} ActorRunDatasetItemsPost(ctx, runId).ActRunsLastDatasetItemsPostRequest(actRunsLastDatasetItemsPostRequest).Execute() - -Store items - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - runId := "3KH8gEpp4d8uQSe8T" // string | Actor run ID. - actRunsLastDatasetItemsPostRequest := openapiclient.act_runs_last_dataset_items_post_request{ArrayOfMapmapOfStringAny: new([]map[string]interface{})} // ActRunsLastDatasetItemsPostRequest | - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.DefaultDatasetAPI.ActorRunDatasetItemsPost(context.Background(), runId).ActRunsLastDatasetItemsPostRequest(actRunsLastDatasetItemsPostRequest).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `DefaultDatasetAPI.ActorRunDatasetItemsPost``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `ActorRunDatasetItemsPost`: map[string]interface{} - fmt.Fprintf(os.Stdout, "Response from `DefaultDatasetAPI.ActorRunDatasetItemsPost`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**runId** | **string** | Actor run ID. | - -### Other Parameters - -Other parameters are passed through a pointer to a apiActorRunDatasetItemsPostRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - **actRunsLastDatasetItemsPostRequest** | [**ActRunsLastDatasetItemsPostRequest**](ActRunsLastDatasetItemsPostRequest.md) | | - -### Return type - -**map[string]interface{}** - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## ActorRunDatasetPut - -> DatasetResponse ActorRunDatasetPut(ctx, runId).UpdateDatasetRequest(updateDatasetRequest).Execute() - -Update default dataset - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - runId := "3KH8gEpp4d8uQSe8T" // string | Actor run ID. - updateDatasetRequest := *openapiclient.NewUpdateDatasetRequest() // UpdateDatasetRequest | - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.DefaultDatasetAPI.ActorRunDatasetPut(context.Background(), runId).UpdateDatasetRequest(updateDatasetRequest).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `DefaultDatasetAPI.ActorRunDatasetPut``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `ActorRunDatasetPut`: DatasetResponse - fmt.Fprintf(os.Stdout, "Response from `DefaultDatasetAPI.ActorRunDatasetPut`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**runId** | **string** | Actor run ID. | - -### Other Parameters - -Other parameters are passed through a pointer to a apiActorRunDatasetPutRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - **updateDatasetRequest** | [**UpdateDatasetRequest**](UpdateDatasetRequest.md) | | - -### Return type - -[**DatasetResponse**](DatasetResponse.md) - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## ActorRunDatasetStatisticsGet - -> DatasetStatisticsResponse ActorRunDatasetStatisticsGet(ctx, runId).Execute() - -Get default dataset statistics - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - runId := "3KH8gEpp4d8uQSe8T" // string | Actor run ID. - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.DefaultDatasetAPI.ActorRunDatasetStatisticsGet(context.Background(), runId).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `DefaultDatasetAPI.ActorRunDatasetStatisticsGet``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `ActorRunDatasetStatisticsGet`: DatasetStatisticsResponse - fmt.Fprintf(os.Stdout, "Response from `DefaultDatasetAPI.ActorRunDatasetStatisticsGet`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**runId** | **string** | Actor run ID. | - -### Other Parameters - -Other parameters are passed through a pointer to a apiActorRunDatasetStatisticsGetRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - -### Return type - -[**DatasetStatisticsResponse**](DatasetStatisticsResponse.md) - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - diff --git a/docs/DefaultKeyValueStoreAPI.md b/docs/DefaultKeyValueStoreAPI.md deleted file mode 100644 index 835f0da..0000000 --- a/docs/DefaultKeyValueStoreAPI.md +++ /dev/null @@ -1,685 +0,0 @@ -# \DefaultKeyValueStoreAPI - -All URIs are relative to *https://api.apify.com* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**ActorRunKeyValueStoreDelete**](DefaultKeyValueStoreAPI.md#ActorRunKeyValueStoreDelete) | **Delete** /v2/actor-runs/{runId}/key-value-store | Delete default store -[**ActorRunKeyValueStoreGet**](DefaultKeyValueStoreAPI.md#ActorRunKeyValueStoreGet) | **Get** /v2/actor-runs/{runId}/key-value-store | Get default store -[**ActorRunKeyValueStoreKeysGet**](DefaultKeyValueStoreAPI.md#ActorRunKeyValueStoreKeysGet) | **Get** /v2/actor-runs/{runId}/key-value-store/keys | Get default store's list of keys -[**ActorRunKeyValueStorePut**](DefaultKeyValueStoreAPI.md#ActorRunKeyValueStorePut) | **Put** /v2/actor-runs/{runId}/key-value-store | Update default store -[**ActorRunKeyValueStoreRecordDelete**](DefaultKeyValueStoreAPI.md#ActorRunKeyValueStoreRecordDelete) | **Delete** /v2/actor-runs/{runId}/key-value-store/records/{recordKey} | Delete default store's record -[**ActorRunKeyValueStoreRecordGet**](DefaultKeyValueStoreAPI.md#ActorRunKeyValueStoreRecordGet) | **Get** /v2/actor-runs/{runId}/key-value-store/records/{recordKey} | Get default store's record -[**ActorRunKeyValueStoreRecordPost**](DefaultKeyValueStoreAPI.md#ActorRunKeyValueStoreRecordPost) | **Post** /v2/actor-runs/{runId}/key-value-store/records/{recordKey} | Store record in default store (POST) -[**ActorRunKeyValueStoreRecordPut**](DefaultKeyValueStoreAPI.md#ActorRunKeyValueStoreRecordPut) | **Put** /v2/actor-runs/{runId}/key-value-store/records/{recordKey} | Store record in default store -[**ActorRunKeyValueStoreRecordsGet**](DefaultKeyValueStoreAPI.md#ActorRunKeyValueStoreRecordsGet) | **Get** /v2/actor-runs/{runId}/key-value-store/records | Download default store's records - - - -## ActorRunKeyValueStoreDelete - -> ActorRunKeyValueStoreDelete(ctx, runId).Execute() - -Delete default store - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - runId := "3KH8gEpp4d8uQSe8T" // string | Actor run ID. - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - r, err := apiClient.DefaultKeyValueStoreAPI.ActorRunKeyValueStoreDelete(context.Background(), runId).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `DefaultKeyValueStoreAPI.ActorRunKeyValueStoreDelete``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**runId** | **string** | Actor run ID. | - -### Other Parameters - -Other parameters are passed through a pointer to a apiActorRunKeyValueStoreDeleteRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - -### Return type - - (empty response body) - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## ActorRunKeyValueStoreGet - -> KeyValueStoreResponse ActorRunKeyValueStoreGet(ctx, runId).Execute() - -Get default store - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - runId := "3KH8gEpp4d8uQSe8T" // string | Actor run ID. - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.DefaultKeyValueStoreAPI.ActorRunKeyValueStoreGet(context.Background(), runId).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `DefaultKeyValueStoreAPI.ActorRunKeyValueStoreGet``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `ActorRunKeyValueStoreGet`: KeyValueStoreResponse - fmt.Fprintf(os.Stdout, "Response from `DefaultKeyValueStoreAPI.ActorRunKeyValueStoreGet`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**runId** | **string** | Actor run ID. | - -### Other Parameters - -Other parameters are passed through a pointer to a apiActorRunKeyValueStoreGetRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - -### Return type - -[**KeyValueStoreResponse**](KeyValueStoreResponse.md) - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## ActorRunKeyValueStoreKeysGet - -> ListOfKeysResponse ActorRunKeyValueStoreKeysGet(ctx, runId).ExclusiveStartKey(exclusiveStartKey).Limit(limit).Collection(collection).Prefix(prefix).Signature(signature).Execute() - -Get default store's list of keys - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - runId := "3KH8gEpp4d8uQSe8T" // string | Actor run ID. - exclusiveStartKey := "Ihnsp8YrvJ8102Kj" // string | All keys up to this one (including) are skipped from the result. (optional) - limit := float32(100) // float32 | Number of keys to be returned. (optional) (default to 1000) - collection := "postImages" // string | Limit the results to keys that belong to a specific collection from the key-value store schema. The key-value store need to have a schema defined for this parameter to work. (optional) - prefix := "post-images-" // string | Limit the results to keys that start with a specific prefix. (optional) - signature := "2wTI46Bg8qWQrV7tavlPI" // string | Signature used for the access. (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.DefaultKeyValueStoreAPI.ActorRunKeyValueStoreKeysGet(context.Background(), runId).ExclusiveStartKey(exclusiveStartKey).Limit(limit).Collection(collection).Prefix(prefix).Signature(signature).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `DefaultKeyValueStoreAPI.ActorRunKeyValueStoreKeysGet``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `ActorRunKeyValueStoreKeysGet`: ListOfKeysResponse - fmt.Fprintf(os.Stdout, "Response from `DefaultKeyValueStoreAPI.ActorRunKeyValueStoreKeysGet`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**runId** | **string** | Actor run ID. | - -### Other Parameters - -Other parameters are passed through a pointer to a apiActorRunKeyValueStoreKeysGetRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - **exclusiveStartKey** | **string** | All keys up to this one (including) are skipped from the result. | - **limit** | **float32** | Number of keys to be returned. | [default to 1000] - **collection** | **string** | Limit the results to keys that belong to a specific collection from the key-value store schema. The key-value store need to have a schema defined for this parameter to work. | - **prefix** | **string** | Limit the results to keys that start with a specific prefix. | - **signature** | **string** | Signature used for the access. | - -### Return type - -[**ListOfKeysResponse**](ListOfKeysResponse.md) - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## ActorRunKeyValueStorePut - -> KeyValueStoreResponse ActorRunKeyValueStorePut(ctx, runId).UpdateStoreRequest(updateStoreRequest).Execute() - -Update default store - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - runId := "3KH8gEpp4d8uQSe8T" // string | Actor run ID. - updateStoreRequest := *openapiclient.NewUpdateStoreRequest() // UpdateStoreRequest | - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.DefaultKeyValueStoreAPI.ActorRunKeyValueStorePut(context.Background(), runId).UpdateStoreRequest(updateStoreRequest).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `DefaultKeyValueStoreAPI.ActorRunKeyValueStorePut``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `ActorRunKeyValueStorePut`: KeyValueStoreResponse - fmt.Fprintf(os.Stdout, "Response from `DefaultKeyValueStoreAPI.ActorRunKeyValueStorePut`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**runId** | **string** | Actor run ID. | - -### Other Parameters - -Other parameters are passed through a pointer to a apiActorRunKeyValueStorePutRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - **updateStoreRequest** | [**UpdateStoreRequest**](UpdateStoreRequest.md) | | - -### Return type - -[**KeyValueStoreResponse**](KeyValueStoreResponse.md) - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## ActorRunKeyValueStoreRecordDelete - -> ActorRunKeyValueStoreRecordDelete(ctx, runId, recordKey).Execute() - -Delete default store's record - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - runId := "3KH8gEpp4d8uQSe8T" // string | Actor run ID. - recordKey := "someKey" // string | Key of the record. - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - r, err := apiClient.DefaultKeyValueStoreAPI.ActorRunKeyValueStoreRecordDelete(context.Background(), runId, recordKey).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `DefaultKeyValueStoreAPI.ActorRunKeyValueStoreRecordDelete``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**runId** | **string** | Actor run ID. | -**recordKey** | **string** | Key of the record. | - -### Other Parameters - -Other parameters are passed through a pointer to a apiActorRunKeyValueStoreRecordDeleteRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - - -### Return type - - (empty response body) - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## ActorRunKeyValueStoreRecordGet - -> map[string]interface{} ActorRunKeyValueStoreRecordGet(ctx, runId, recordKey).Signature(signature).Attachment(attachment).Execute() - -Get default store's record - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - runId := "3KH8gEpp4d8uQSe8T" // string | Actor run ID. - recordKey := "someKey" // string | Key of the record. - signature := "2wTI46Bg8qWQrV7tavlPI" // string | Signature used for the access. (optional) - attachment := true // bool | If `true` or `1`, the response will be served with `Content-Disposition: attachment` header, causing web browsers to offer downloading HTML records instead of displaying them. (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.DefaultKeyValueStoreAPI.ActorRunKeyValueStoreRecordGet(context.Background(), runId, recordKey).Signature(signature).Attachment(attachment).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `DefaultKeyValueStoreAPI.ActorRunKeyValueStoreRecordGet``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `ActorRunKeyValueStoreRecordGet`: map[string]interface{} - fmt.Fprintf(os.Stdout, "Response from `DefaultKeyValueStoreAPI.ActorRunKeyValueStoreRecordGet`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**runId** | **string** | Actor run ID. | -**recordKey** | **string** | Key of the record. | - -### Other Parameters - -Other parameters are passed through a pointer to a apiActorRunKeyValueStoreRecordGetRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - - **signature** | **string** | Signature used for the access. | - **attachment** | **bool** | If `true` or `1`, the response will be served with `Content-Disposition: attachment` header, causing web browsers to offer downloading HTML records instead of displaying them. | - -### Return type - -**map[string]interface{}** - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json, */* - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## ActorRunKeyValueStoreRecordPost - -> map[string]interface{} ActorRunKeyValueStoreRecordPost(ctx, runId, recordKey).RequestBody(requestBody).ContentEncoding(contentEncoding).Execute() - -Store record in default store (POST) - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - runId := "3KH8gEpp4d8uQSe8T" // string | Actor run ID. - recordKey := "someKey" // string | Key of the record. - requestBody := map[string]interface{}{"key": interface{}(123)} // map[string]interface{} | - contentEncoding := "contentEncoding_example" // string | (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.DefaultKeyValueStoreAPI.ActorRunKeyValueStoreRecordPost(context.Background(), runId, recordKey).RequestBody(requestBody).ContentEncoding(contentEncoding).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `DefaultKeyValueStoreAPI.ActorRunKeyValueStoreRecordPost``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `ActorRunKeyValueStoreRecordPost`: map[string]interface{} - fmt.Fprintf(os.Stdout, "Response from `DefaultKeyValueStoreAPI.ActorRunKeyValueStoreRecordPost`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**runId** | **string** | Actor run ID. | -**recordKey** | **string** | Key of the record. | - -### Other Parameters - -Other parameters are passed through a pointer to a apiActorRunKeyValueStoreRecordPostRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - - **requestBody** | **map[string]interface{}** | | - **contentEncoding** | **string** | | - -### Return type - -**map[string]interface{}** - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## ActorRunKeyValueStoreRecordPut - -> map[string]interface{} ActorRunKeyValueStoreRecordPut(ctx, runId, recordKey).RequestBody(requestBody).ContentEncoding(contentEncoding).Execute() - -Store record in default store - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - runId := "3KH8gEpp4d8uQSe8T" // string | Actor run ID. - recordKey := "someKey" // string | Key of the record. - requestBody := map[string]interface{}{"key": interface{}(123)} // map[string]interface{} | - contentEncoding := "contentEncoding_example" // string | (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.DefaultKeyValueStoreAPI.ActorRunKeyValueStoreRecordPut(context.Background(), runId, recordKey).RequestBody(requestBody).ContentEncoding(contentEncoding).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `DefaultKeyValueStoreAPI.ActorRunKeyValueStoreRecordPut``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `ActorRunKeyValueStoreRecordPut`: map[string]interface{} - fmt.Fprintf(os.Stdout, "Response from `DefaultKeyValueStoreAPI.ActorRunKeyValueStoreRecordPut`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**runId** | **string** | Actor run ID. | -**recordKey** | **string** | Key of the record. | - -### Other Parameters - -Other parameters are passed through a pointer to a apiActorRunKeyValueStoreRecordPutRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - - **requestBody** | **map[string]interface{}** | | - **contentEncoding** | **string** | | - -### Return type - -**map[string]interface{}** - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## ActorRunKeyValueStoreRecordsGet - -> *os.File ActorRunKeyValueStoreRecordsGet(ctx, runId).Collection(collection).Prefix(prefix).Signature(signature).Execute() - -Download default store's records - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - runId := "3KH8gEpp4d8uQSe8T" // string | Actor run ID. - collection := "my-collection" // string | If specified, only records belonging to a specific collection from the key-value store schema. The key-value store need to have a schema defined for this parameter to work. (optional) - prefix := "my-prefix/" // string | If specified, only records whose key starts with the given prefix are included in the archive. (optional) - signature := "2wTI46Bg8qWQrV7tavlPI" // string | Signature used for the access. (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.DefaultKeyValueStoreAPI.ActorRunKeyValueStoreRecordsGet(context.Background(), runId).Collection(collection).Prefix(prefix).Signature(signature).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `DefaultKeyValueStoreAPI.ActorRunKeyValueStoreRecordsGet``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `ActorRunKeyValueStoreRecordsGet`: *os.File - fmt.Fprintf(os.Stdout, "Response from `DefaultKeyValueStoreAPI.ActorRunKeyValueStoreRecordsGet`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**runId** | **string** | Actor run ID. | - -### Other Parameters - -Other parameters are passed through a pointer to a apiActorRunKeyValueStoreRecordsGetRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - **collection** | **string** | If specified, only records belonging to a specific collection from the key-value store schema. The key-value store need to have a schema defined for this parameter to work. | - **prefix** | **string** | If specified, only records whose key starts with the given prefix are included in the archive. | - **signature** | **string** | Signature used for the access. | - -### Return type - -[***os.File**](*os.File.md) - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/zip, application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - diff --git a/docs/DefaultRequestQueueAPI.md b/docs/DefaultRequestQueueAPI.md deleted file mode 100644 index 7fb9036..0000000 --- a/docs/DefaultRequestQueueAPI.md +++ /dev/null @@ -1,1142 +0,0 @@ -# \DefaultRequestQueueAPI - -All URIs are relative to *https://api.apify.com* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**ActorRunRequestQueueDelete**](DefaultRequestQueueAPI.md#ActorRunRequestQueueDelete) | **Delete** /v2/actor-runs/{runId}/request-queue | Delete default request queue -[**ActorRunRequestQueueGet**](DefaultRequestQueueAPI.md#ActorRunRequestQueueGet) | **Get** /v2/actor-runs/{runId}/request-queue | Get default request queue -[**ActorRunRequestQueueHeadGet**](DefaultRequestQueueAPI.md#ActorRunRequestQueueHeadGet) | **Get** /v2/actor-runs/{runId}/request-queue/head | Get default request queue head -[**ActorRunRequestQueueHeadLockPost**](DefaultRequestQueueAPI.md#ActorRunRequestQueueHeadLockPost) | **Post** /v2/actor-runs/{runId}/request-queue/head/lock | Get and lock default request queue head -[**ActorRunRequestQueuePut**](DefaultRequestQueueAPI.md#ActorRunRequestQueuePut) | **Put** /v2/actor-runs/{runId}/request-queue | Update default request queue -[**ActorRunRequestQueueRequestDelete**](DefaultRequestQueueAPI.md#ActorRunRequestQueueRequestDelete) | **Delete** /v2/actor-runs/{runId}/request-queue/requests/{requestId} | Delete request from default request queue -[**ActorRunRequestQueueRequestGet**](DefaultRequestQueueAPI.md#ActorRunRequestQueueRequestGet) | **Get** /v2/actor-runs/{runId}/request-queue/requests/{requestId} | Get request from default request queue -[**ActorRunRequestQueueRequestLockDelete**](DefaultRequestQueueAPI.md#ActorRunRequestQueueRequestLockDelete) | **Delete** /v2/actor-runs/{runId}/request-queue/requests/{requestId}/lock | Delete lock on request in default request queue -[**ActorRunRequestQueueRequestLockPut**](DefaultRequestQueueAPI.md#ActorRunRequestQueueRequestLockPut) | **Put** /v2/actor-runs/{runId}/request-queue/requests/{requestId}/lock | Prolong lock on request in default request queue -[**ActorRunRequestQueueRequestPut**](DefaultRequestQueueAPI.md#ActorRunRequestQueueRequestPut) | **Put** /v2/actor-runs/{runId}/request-queue/requests/{requestId} | Update request in default request queue -[**ActorRunRequestQueueRequestsBatchDelete**](DefaultRequestQueueAPI.md#ActorRunRequestQueueRequestsBatchDelete) | **Delete** /v2/actor-runs/{runId}/request-queue/requests/batch | Batch delete requests from default request queue -[**ActorRunRequestQueueRequestsBatchPost**](DefaultRequestQueueAPI.md#ActorRunRequestQueueRequestsBatchPost) | **Post** /v2/actor-runs/{runId}/request-queue/requests/batch | Batch add requests to default request queue -[**ActorRunRequestQueueRequestsGet**](DefaultRequestQueueAPI.md#ActorRunRequestQueueRequestsGet) | **Get** /v2/actor-runs/{runId}/request-queue/requests | List default request queue's requests -[**ActorRunRequestQueueRequestsPost**](DefaultRequestQueueAPI.md#ActorRunRequestQueueRequestsPost) | **Post** /v2/actor-runs/{runId}/request-queue/requests | Add request to default request queue -[**ActorRunRequestQueueRequestsUnlockPost**](DefaultRequestQueueAPI.md#ActorRunRequestQueueRequestsUnlockPost) | **Post** /v2/actor-runs/{runId}/request-queue/requests/unlock | Unlock requests in default request queue - - - -## ActorRunRequestQueueDelete - -> ActorRunRequestQueueDelete(ctx, runId).Execute() - -Delete default request queue - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - runId := "3KH8gEpp4d8uQSe8T" // string | Actor run ID. - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - r, err := apiClient.DefaultRequestQueueAPI.ActorRunRequestQueueDelete(context.Background(), runId).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `DefaultRequestQueueAPI.ActorRunRequestQueueDelete``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**runId** | **string** | Actor run ID. | - -### Other Parameters - -Other parameters are passed through a pointer to a apiActorRunRequestQueueDeleteRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - -### Return type - - (empty response body) - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## ActorRunRequestQueueGet - -> RequestQueueResponse ActorRunRequestQueueGet(ctx, runId).Execute() - -Get default request queue - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - runId := "3KH8gEpp4d8uQSe8T" // string | Actor run ID. - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.DefaultRequestQueueAPI.ActorRunRequestQueueGet(context.Background(), runId).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `DefaultRequestQueueAPI.ActorRunRequestQueueGet``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `ActorRunRequestQueueGet`: RequestQueueResponse - fmt.Fprintf(os.Stdout, "Response from `DefaultRequestQueueAPI.ActorRunRequestQueueGet`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**runId** | **string** | Actor run ID. | - -### Other Parameters - -Other parameters are passed through a pointer to a apiActorRunRequestQueueGetRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - -### Return type - -[**RequestQueueResponse**](RequestQueueResponse.md) - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## ActorRunRequestQueueHeadGet - -> HeadResponse ActorRunRequestQueueHeadGet(ctx, runId).Limit(limit).ClientKey(clientKey).Execute() - -Get default request queue head - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - runId := "3KH8gEpp4d8uQSe8T" // string | Actor run ID. - limit := float64(100) // float64 | How many items from queue should be returned. (optional) - clientKey := "client-abc" // string | A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.DefaultRequestQueueAPI.ActorRunRequestQueueHeadGet(context.Background(), runId).Limit(limit).ClientKey(clientKey).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `DefaultRequestQueueAPI.ActorRunRequestQueueHeadGet``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `ActorRunRequestQueueHeadGet`: HeadResponse - fmt.Fprintf(os.Stdout, "Response from `DefaultRequestQueueAPI.ActorRunRequestQueueHeadGet`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**runId** | **string** | Actor run ID. | - -### Other Parameters - -Other parameters are passed through a pointer to a apiActorRunRequestQueueHeadGetRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - **limit** | **float64** | How many items from queue should be returned. | - **clientKey** | **string** | A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. | - -### Return type - -[**HeadResponse**](HeadResponse.md) - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## ActorRunRequestQueueHeadLockPost - -> HeadAndLockResponse ActorRunRequestQueueHeadLockPost(ctx, runId).LockSecs(lockSecs).Limit(limit).ClientKey(clientKey).Execute() - -Get and lock default request queue head - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - runId := "3KH8gEpp4d8uQSe8T" // string | Actor run ID. - lockSecs := float64(60) // float64 | How long the requests will be locked for (in seconds). - limit := float64(25) // float64 | How many items from the queue should be returned. (optional) - clientKey := "client-abc" // string | A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.DefaultRequestQueueAPI.ActorRunRequestQueueHeadLockPost(context.Background(), runId).LockSecs(lockSecs).Limit(limit).ClientKey(clientKey).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `DefaultRequestQueueAPI.ActorRunRequestQueueHeadLockPost``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `ActorRunRequestQueueHeadLockPost`: HeadAndLockResponse - fmt.Fprintf(os.Stdout, "Response from `DefaultRequestQueueAPI.ActorRunRequestQueueHeadLockPost`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**runId** | **string** | Actor run ID. | - -### Other Parameters - -Other parameters are passed through a pointer to a apiActorRunRequestQueueHeadLockPostRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - **lockSecs** | **float64** | How long the requests will be locked for (in seconds). | - **limit** | **float64** | How many items from the queue should be returned. | - **clientKey** | **string** | A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. | - -### Return type - -[**HeadAndLockResponse**](HeadAndLockResponse.md) - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## ActorRunRequestQueuePut - -> RequestQueueResponse ActorRunRequestQueuePut(ctx, runId).UpdateRequestQueueRequest(updateRequestQueueRequest).Execute() - -Update default request queue - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - runId := "3KH8gEpp4d8uQSe8T" // string | Actor run ID. - updateRequestQueueRequest := *openapiclient.NewUpdateRequestQueueRequest() // UpdateRequestQueueRequest | - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.DefaultRequestQueueAPI.ActorRunRequestQueuePut(context.Background(), runId).UpdateRequestQueueRequest(updateRequestQueueRequest).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `DefaultRequestQueueAPI.ActorRunRequestQueuePut``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `ActorRunRequestQueuePut`: RequestQueueResponse - fmt.Fprintf(os.Stdout, "Response from `DefaultRequestQueueAPI.ActorRunRequestQueuePut`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**runId** | **string** | Actor run ID. | - -### Other Parameters - -Other parameters are passed through a pointer to a apiActorRunRequestQueuePutRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - **updateRequestQueueRequest** | [**UpdateRequestQueueRequest**](UpdateRequestQueueRequest.md) | | - -### Return type - -[**RequestQueueResponse**](RequestQueueResponse.md) - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## ActorRunRequestQueueRequestDelete - -> ActorRunRequestQueueRequestDelete(ctx, runId, requestId).ClientKey(clientKey).Execute() - -Delete request from default request queue - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - runId := "3KH8gEpp4d8uQSe8T" // string | Actor run ID. - requestId := "xpsmkDlspokDSmklS" // string | Request ID. - clientKey := "client-abc" // string | A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - r, err := apiClient.DefaultRequestQueueAPI.ActorRunRequestQueueRequestDelete(context.Background(), runId, requestId).ClientKey(clientKey).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `DefaultRequestQueueAPI.ActorRunRequestQueueRequestDelete``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**runId** | **string** | Actor run ID. | -**requestId** | **string** | Request ID. | - -### Other Parameters - -Other parameters are passed through a pointer to a apiActorRunRequestQueueRequestDeleteRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - - **clientKey** | **string** | A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. | - -### Return type - - (empty response body) - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## ActorRunRequestQueueRequestGet - -> RequestResponse ActorRunRequestQueueRequestGet(ctx, runId, requestId).Execute() - -Get request from default request queue - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - runId := "3KH8gEpp4d8uQSe8T" // string | Actor run ID. - requestId := "xpsmkDlspokDSmklS" // string | Request ID. - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.DefaultRequestQueueAPI.ActorRunRequestQueueRequestGet(context.Background(), runId, requestId).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `DefaultRequestQueueAPI.ActorRunRequestQueueRequestGet``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `ActorRunRequestQueueRequestGet`: RequestResponse - fmt.Fprintf(os.Stdout, "Response from `DefaultRequestQueueAPI.ActorRunRequestQueueRequestGet`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**runId** | **string** | Actor run ID. | -**requestId** | **string** | Request ID. | - -### Other Parameters - -Other parameters are passed through a pointer to a apiActorRunRequestQueueRequestGetRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - - -### Return type - -[**RequestResponse**](RequestResponse.md) - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## ActorRunRequestQueueRequestLockDelete - -> ActorRunRequestQueueRequestLockDelete(ctx, runId, requestId).ClientKey(clientKey).Forefront(forefront).Execute() - -Delete lock on request in default request queue - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - runId := "3KH8gEpp4d8uQSe8T" // string | Actor run ID. - requestId := "xpsmkDlspokDSmklS" // string | Request ID. - clientKey := "client-abc" // string | A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. (optional) - forefront := "false" // string | Determines if request should be added to the head of the queue or to the end after lock was removed. (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - r, err := apiClient.DefaultRequestQueueAPI.ActorRunRequestQueueRequestLockDelete(context.Background(), runId, requestId).ClientKey(clientKey).Forefront(forefront).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `DefaultRequestQueueAPI.ActorRunRequestQueueRequestLockDelete``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**runId** | **string** | Actor run ID. | -**requestId** | **string** | Request ID. | - -### Other Parameters - -Other parameters are passed through a pointer to a apiActorRunRequestQueueRequestLockDeleteRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - - **clientKey** | **string** | A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. | - **forefront** | **string** | Determines if request should be added to the head of the queue or to the end after lock was removed. | - -### Return type - - (empty response body) - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## ActorRunRequestQueueRequestLockPut - -> ProlongRequestLockResponse ActorRunRequestQueueRequestLockPut(ctx, runId, requestId).LockSecs(lockSecs).ClientKey(clientKey).Forefront(forefront).Execute() - -Prolong lock on request in default request queue - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - runId := "3KH8gEpp4d8uQSe8T" // string | Actor run ID. - requestId := "xpsmkDlspokDSmklS" // string | Request ID. - lockSecs := float64(60) // float64 | How long the requests will be locked for (in seconds). - clientKey := "client-abc" // string | A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. (optional) - forefront := "false" // string | Determines if request should be added to the head of the queue or to the end after lock expires. (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.DefaultRequestQueueAPI.ActorRunRequestQueueRequestLockPut(context.Background(), runId, requestId).LockSecs(lockSecs).ClientKey(clientKey).Forefront(forefront).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `DefaultRequestQueueAPI.ActorRunRequestQueueRequestLockPut``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `ActorRunRequestQueueRequestLockPut`: ProlongRequestLockResponse - fmt.Fprintf(os.Stdout, "Response from `DefaultRequestQueueAPI.ActorRunRequestQueueRequestLockPut`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**runId** | **string** | Actor run ID. | -**requestId** | **string** | Request ID. | - -### Other Parameters - -Other parameters are passed through a pointer to a apiActorRunRequestQueueRequestLockPutRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - - **lockSecs** | **float64** | How long the requests will be locked for (in seconds). | - **clientKey** | **string** | A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. | - **forefront** | **string** | Determines if request should be added to the head of the queue or to the end after lock expires. | - -### Return type - -[**ProlongRequestLockResponse**](ProlongRequestLockResponse.md) - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## ActorRunRequestQueueRequestPut - -> UpdateRequestResponse ActorRunRequestQueueRequestPut(ctx, runId, requestId).Request(request).Forefront(forefront).ClientKey(clientKey).Execute() - -Update request in default request queue - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - runId := "3KH8gEpp4d8uQSe8T" // string | Actor run ID. - requestId := "xpsmkDlspokDSmklS" // string | Request ID. - request := *openapiclient.NewRequest() // Request | - forefront := "false" // string | Determines if request should be added to the head of the queue or to the end. Default value is `false` (end of queue). (optional) - clientKey := "client-abc" // string | A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.DefaultRequestQueueAPI.ActorRunRequestQueueRequestPut(context.Background(), runId, requestId).Request(request).Forefront(forefront).ClientKey(clientKey).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `DefaultRequestQueueAPI.ActorRunRequestQueueRequestPut``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `ActorRunRequestQueueRequestPut`: UpdateRequestResponse - fmt.Fprintf(os.Stdout, "Response from `DefaultRequestQueueAPI.ActorRunRequestQueueRequestPut`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**runId** | **string** | Actor run ID. | -**requestId** | **string** | Request ID. | - -### Other Parameters - -Other parameters are passed through a pointer to a apiActorRunRequestQueueRequestPutRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - - **request** | [**Request**](Request.md) | | - **forefront** | **string** | Determines if request should be added to the head of the queue or to the end. Default value is `false` (end of queue). | - **clientKey** | **string** | A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. | - -### Return type - -[**UpdateRequestResponse**](UpdateRequestResponse.md) - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## ActorRunRequestQueueRequestsBatchDelete - -> BatchDeleteResponse ActorRunRequestQueueRequestsBatchDelete(ctx, runId).ContentType(contentType).RequestDraftDelete(requestDraftDelete).ClientKey(clientKey).Execute() - -Batch delete requests from default request queue - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - runId := "3KH8gEpp4d8uQSe8T" // string | Actor run ID. - contentType := "contentType_example" // string | - requestDraftDelete := []openapiclient.RequestDraftDelete{*openapiclient.NewRequestDraftDelete("Id_example", "UniqueKey_example")} // []RequestDraftDelete | - clientKey := "client-abc" // string | A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.DefaultRequestQueueAPI.ActorRunRequestQueueRequestsBatchDelete(context.Background(), runId).ContentType(contentType).RequestDraftDelete(requestDraftDelete).ClientKey(clientKey).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `DefaultRequestQueueAPI.ActorRunRequestQueueRequestsBatchDelete``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `ActorRunRequestQueueRequestsBatchDelete`: BatchDeleteResponse - fmt.Fprintf(os.Stdout, "Response from `DefaultRequestQueueAPI.ActorRunRequestQueueRequestsBatchDelete`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**runId** | **string** | Actor run ID. | - -### Other Parameters - -Other parameters are passed through a pointer to a apiActorRunRequestQueueRequestsBatchDeleteRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - **contentType** | **string** | | - **requestDraftDelete** | [**[]RequestDraftDelete**](RequestDraftDelete.md) | | - **clientKey** | **string** | A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. | - -### Return type - -[**BatchDeleteResponse**](BatchDeleteResponse.md) - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## ActorRunRequestQueueRequestsBatchPost - -> BatchAddResponse ActorRunRequestQueueRequestsBatchPost(ctx, runId).RequestBase(requestBase).ClientKey(clientKey).Forefront(forefront).Execute() - -Batch add requests to default request queue - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - runId := "3KH8gEpp4d8uQSe8T" // string | Actor run ID. - requestBase := []openapiclient.RequestBase{*openapiclient.NewRequestBase()} // []RequestBase | - clientKey := "client-abc" // string | A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. (optional) - forefront := "false" // string | Determines if request should be added to the head of the queue or to the end. Default value is `false` (end of queue). (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.DefaultRequestQueueAPI.ActorRunRequestQueueRequestsBatchPost(context.Background(), runId).RequestBase(requestBase).ClientKey(clientKey).Forefront(forefront).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `DefaultRequestQueueAPI.ActorRunRequestQueueRequestsBatchPost``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `ActorRunRequestQueueRequestsBatchPost`: BatchAddResponse - fmt.Fprintf(os.Stdout, "Response from `DefaultRequestQueueAPI.ActorRunRequestQueueRequestsBatchPost`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**runId** | **string** | Actor run ID. | - -### Other Parameters - -Other parameters are passed through a pointer to a apiActorRunRequestQueueRequestsBatchPostRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - **requestBase** | [**[]RequestBase**](RequestBase.md) | | - **clientKey** | **string** | A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. | - **forefront** | **string** | Determines if request should be added to the head of the queue or to the end. Default value is `false` (end of queue). | - -### Return type - -[**BatchAddResponse**](BatchAddResponse.md) - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## ActorRunRequestQueueRequestsGet - -> ListOfRequestsResponse ActorRunRequestQueueRequestsGet(ctx, runId).ClientKey(clientKey).ExclusiveStartId(exclusiveStartId).Limit(limit).Cursor(cursor).Filter(filter).Execute() - -List default request queue's requests - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - runId := "3KH8gEpp4d8uQSe8T" // string | Actor run ID. - clientKey := "client-abc" // string | A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. (optional) - exclusiveStartId := "Ihnsp8YrvJ8102Kj" // string | All requests up to this one (including) are skipped from the result. (Deprecated, use `cursor` instead.) (optional) - limit := float64(100) // float64 | Number of keys to be returned. Maximum value is `10000`. (optional) - cursor := "eyJyZXF1ZXN0SWQiOiI2OFRqQ2RaTDNvM2hiUU0ifQ" // string | A cursor string for pagination, returned in the previous response as `nextCursor`. Use this to retrieve the next page of requests. (optional) - filter := []string{"Filter_example"} // []string | Filter requests by their state. Possible values are `locked` and `pending`. You can combine multiple values separated by commas, which will mean the union of these filters – requests matching any of the specified states will be returned. (Not compatible with deprecated `exclusiveStartId` parameter.) (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.DefaultRequestQueueAPI.ActorRunRequestQueueRequestsGet(context.Background(), runId).ClientKey(clientKey).ExclusiveStartId(exclusiveStartId).Limit(limit).Cursor(cursor).Filter(filter).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `DefaultRequestQueueAPI.ActorRunRequestQueueRequestsGet``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `ActorRunRequestQueueRequestsGet`: ListOfRequestsResponse - fmt.Fprintf(os.Stdout, "Response from `DefaultRequestQueueAPI.ActorRunRequestQueueRequestsGet`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**runId** | **string** | Actor run ID. | - -### Other Parameters - -Other parameters are passed through a pointer to a apiActorRunRequestQueueRequestsGetRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - **clientKey** | **string** | A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. | - **exclusiveStartId** | **string** | All requests up to this one (including) are skipped from the result. (Deprecated, use `cursor` instead.) | - **limit** | **float64** | Number of keys to be returned. Maximum value is `10000`. | - **cursor** | **string** | A cursor string for pagination, returned in the previous response as `nextCursor`. Use this to retrieve the next page of requests. | - **filter** | **[]string** | Filter requests by their state. Possible values are `locked` and `pending`. You can combine multiple values separated by commas, which will mean the union of these filters – requests matching any of the specified states will be returned. (Not compatible with deprecated `exclusiveStartId` parameter.) | - -### Return type - -[**ListOfRequestsResponse**](ListOfRequestsResponse.md) - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## ActorRunRequestQueueRequestsPost - -> AddRequestResponse ActorRunRequestQueueRequestsPost(ctx, runId).RequestBase(requestBase).ClientKey(clientKey).Forefront(forefront).Execute() - -Add request to default request queue - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - runId := "3KH8gEpp4d8uQSe8T" // string | Actor run ID. - requestBase := *openapiclient.NewRequestBase() // RequestBase | - clientKey := "client-abc" // string | A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. (optional) - forefront := "false" // string | Determines if request should be added to the head of the queue or to the end. Default value is `false` (end of queue). (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.DefaultRequestQueueAPI.ActorRunRequestQueueRequestsPost(context.Background(), runId).RequestBase(requestBase).ClientKey(clientKey).Forefront(forefront).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `DefaultRequestQueueAPI.ActorRunRequestQueueRequestsPost``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `ActorRunRequestQueueRequestsPost`: AddRequestResponse - fmt.Fprintf(os.Stdout, "Response from `DefaultRequestQueueAPI.ActorRunRequestQueueRequestsPost`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**runId** | **string** | Actor run ID. | - -### Other Parameters - -Other parameters are passed through a pointer to a apiActorRunRequestQueueRequestsPostRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - **requestBase** | [**RequestBase**](RequestBase.md) | | - **clientKey** | **string** | A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. | - **forefront** | **string** | Determines if request should be added to the head of the queue or to the end. Default value is `false` (end of queue). | - -### Return type - -[**AddRequestResponse**](AddRequestResponse.md) - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## ActorRunRequestQueueRequestsUnlockPost - -> UnlockRequestsResponse ActorRunRequestQueueRequestsUnlockPost(ctx, runId).ClientKey(clientKey).Execute() - -Unlock requests in default request queue - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - runId := "3KH8gEpp4d8uQSe8T" // string | Actor run ID. - clientKey := "client-abc" // string | A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.DefaultRequestQueueAPI.ActorRunRequestQueueRequestsUnlockPost(context.Background(), runId).ClientKey(clientKey).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `DefaultRequestQueueAPI.ActorRunRequestQueueRequestsUnlockPost``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `ActorRunRequestQueueRequestsUnlockPost`: UnlockRequestsResponse - fmt.Fprintf(os.Stdout, "Response from `DefaultRequestQueueAPI.ActorRunRequestQueueRequestsUnlockPost`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**runId** | **string** | Actor run ID. | - -### Other Parameters - -Other parameters are passed through a pointer to a apiActorRunRequestQueueRequestsUnlockPostRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - **clientKey** | **string** | A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. | - -### Return type - -[**UnlockRequestsResponse**](UnlockRequestsResponse.md) - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - diff --git a/docs/DefaultRunOptions.md b/docs/DefaultRunOptions.md deleted file mode 100644 index 36b8eff..0000000 --- a/docs/DefaultRunOptions.md +++ /dev/null @@ -1,206 +0,0 @@ -# DefaultRunOptions - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Build** | Pointer to **string** | | [optional] -**TimeoutSecs** | Pointer to **int32** | | [optional] -**MemoryMbytes** | Pointer to **int32** | | [optional] -**RestartOnError** | Pointer to **bool** | | [optional] -**MaxItems** | Pointer to **NullableInt32** | | [optional] -**ForcePermissionLevel** | Pointer to [**NullableActorPermissionLevel**](ActorPermissionLevel.md) | | [optional] - -## Methods - -### NewDefaultRunOptions - -`func NewDefaultRunOptions() *DefaultRunOptions` - -NewDefaultRunOptions instantiates a new DefaultRunOptions object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewDefaultRunOptionsWithDefaults - -`func NewDefaultRunOptionsWithDefaults() *DefaultRunOptions` - -NewDefaultRunOptionsWithDefaults instantiates a new DefaultRunOptions object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetBuild - -`func (o *DefaultRunOptions) GetBuild() string` - -GetBuild returns the Build field if non-nil, zero value otherwise. - -### GetBuildOk - -`func (o *DefaultRunOptions) GetBuildOk() (*string, bool)` - -GetBuildOk returns a tuple with the Build field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetBuild - -`func (o *DefaultRunOptions) SetBuild(v string)` - -SetBuild sets Build field to given value. - -### HasBuild - -`func (o *DefaultRunOptions) HasBuild() bool` - -HasBuild returns a boolean if a field has been set. - -### GetTimeoutSecs - -`func (o *DefaultRunOptions) GetTimeoutSecs() int32` - -GetTimeoutSecs returns the TimeoutSecs field if non-nil, zero value otherwise. - -### GetTimeoutSecsOk - -`func (o *DefaultRunOptions) GetTimeoutSecsOk() (*int32, bool)` - -GetTimeoutSecsOk returns a tuple with the TimeoutSecs field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetTimeoutSecs - -`func (o *DefaultRunOptions) SetTimeoutSecs(v int32)` - -SetTimeoutSecs sets TimeoutSecs field to given value. - -### HasTimeoutSecs - -`func (o *DefaultRunOptions) HasTimeoutSecs() bool` - -HasTimeoutSecs returns a boolean if a field has been set. - -### GetMemoryMbytes - -`func (o *DefaultRunOptions) GetMemoryMbytes() int32` - -GetMemoryMbytes returns the MemoryMbytes field if non-nil, zero value otherwise. - -### GetMemoryMbytesOk - -`func (o *DefaultRunOptions) GetMemoryMbytesOk() (*int32, bool)` - -GetMemoryMbytesOk returns a tuple with the MemoryMbytes field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetMemoryMbytes - -`func (o *DefaultRunOptions) SetMemoryMbytes(v int32)` - -SetMemoryMbytes sets MemoryMbytes field to given value. - -### HasMemoryMbytes - -`func (o *DefaultRunOptions) HasMemoryMbytes() bool` - -HasMemoryMbytes returns a boolean if a field has been set. - -### GetRestartOnError - -`func (o *DefaultRunOptions) GetRestartOnError() bool` - -GetRestartOnError returns the RestartOnError field if non-nil, zero value otherwise. - -### GetRestartOnErrorOk - -`func (o *DefaultRunOptions) GetRestartOnErrorOk() (*bool, bool)` - -GetRestartOnErrorOk returns a tuple with the RestartOnError field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetRestartOnError - -`func (o *DefaultRunOptions) SetRestartOnError(v bool)` - -SetRestartOnError sets RestartOnError field to given value. - -### HasRestartOnError - -`func (o *DefaultRunOptions) HasRestartOnError() bool` - -HasRestartOnError returns a boolean if a field has been set. - -### GetMaxItems - -`func (o *DefaultRunOptions) GetMaxItems() int32` - -GetMaxItems returns the MaxItems field if non-nil, zero value otherwise. - -### GetMaxItemsOk - -`func (o *DefaultRunOptions) GetMaxItemsOk() (*int32, bool)` - -GetMaxItemsOk returns a tuple with the MaxItems field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetMaxItems - -`func (o *DefaultRunOptions) SetMaxItems(v int32)` - -SetMaxItems sets MaxItems field to given value. - -### HasMaxItems - -`func (o *DefaultRunOptions) HasMaxItems() bool` - -HasMaxItems returns a boolean if a field has been set. - -### SetMaxItemsNil - -`func (o *DefaultRunOptions) SetMaxItemsNil(b bool)` - - SetMaxItemsNil sets the value for MaxItems to be an explicit nil - -### UnsetMaxItems -`func (o *DefaultRunOptions) UnsetMaxItems()` - -UnsetMaxItems ensures that no value is present for MaxItems, not even an explicit nil -### GetForcePermissionLevel - -`func (o *DefaultRunOptions) GetForcePermissionLevel() ActorPermissionLevel` - -GetForcePermissionLevel returns the ForcePermissionLevel field if non-nil, zero value otherwise. - -### GetForcePermissionLevelOk - -`func (o *DefaultRunOptions) GetForcePermissionLevelOk() (*ActorPermissionLevel, bool)` - -GetForcePermissionLevelOk returns a tuple with the ForcePermissionLevel field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetForcePermissionLevel - -`func (o *DefaultRunOptions) SetForcePermissionLevel(v ActorPermissionLevel)` - -SetForcePermissionLevel sets ForcePermissionLevel field to given value. - -### HasForcePermissionLevel - -`func (o *DefaultRunOptions) HasForcePermissionLevel() bool` - -HasForcePermissionLevel returns a boolean if a field has been set. - -### SetForcePermissionLevelNil - -`func (o *DefaultRunOptions) SetForcePermissionLevelNil(b bool)` - - SetForcePermissionLevelNil sets the value for ForcePermissionLevel to be an explicit nil - -### UnsetForcePermissionLevel -`func (o *DefaultRunOptions) UnsetForcePermissionLevel()` - -UnsetForcePermissionLevel ensures that no value is present for ForcePermissionLevel, not even an explicit nil - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/DeletedRequest.md b/docs/DeletedRequest.md deleted file mode 100644 index d141eae..0000000 --- a/docs/DeletedRequest.md +++ /dev/null @@ -1,72 +0,0 @@ -# DeletedRequest - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**UniqueKey** | **string** | A unique key used for request de-duplication. Requests with the same unique key are considered identical. | -**Id** | **string** | A unique identifier assigned to the request. | - -## Methods - -### NewDeletedRequest - -`func NewDeletedRequest(uniqueKey string, id string, ) *DeletedRequest` - -NewDeletedRequest instantiates a new DeletedRequest object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewDeletedRequestWithDefaults - -`func NewDeletedRequestWithDefaults() *DeletedRequest` - -NewDeletedRequestWithDefaults instantiates a new DeletedRequest object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetUniqueKey - -`func (o *DeletedRequest) GetUniqueKey() string` - -GetUniqueKey returns the UniqueKey field if non-nil, zero value otherwise. - -### GetUniqueKeyOk - -`func (o *DeletedRequest) GetUniqueKeyOk() (*string, bool)` - -GetUniqueKeyOk returns a tuple with the UniqueKey field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetUniqueKey - -`func (o *DeletedRequest) SetUniqueKey(v string)` - -SetUniqueKey sets UniqueKey field to given value. - - -### GetId - -`func (o *DeletedRequest) GetId() string` - -GetId returns the Id field if non-nil, zero value otherwise. - -### GetIdOk - -`func (o *DeletedRequest) GetIdOk() (*string, bool)` - -GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetId - -`func (o *DeletedRequest) SetId(v string)` - -SetId sets Id field to given value. - - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/DeletedRequestById.md b/docs/DeletedRequestById.md deleted file mode 100644 index d2b63e0..0000000 --- a/docs/DeletedRequestById.md +++ /dev/null @@ -1,77 +0,0 @@ -# DeletedRequestById - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**UniqueKey** | Pointer to **string** | A unique key used for request de-duplication. Requests with the same unique key are considered identical. | [optional] -**Id** | **string** | A unique identifier assigned to the request. | - -## Methods - -### NewDeletedRequestById - -`func NewDeletedRequestById(id string, ) *DeletedRequestById` - -NewDeletedRequestById instantiates a new DeletedRequestById object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewDeletedRequestByIdWithDefaults - -`func NewDeletedRequestByIdWithDefaults() *DeletedRequestById` - -NewDeletedRequestByIdWithDefaults instantiates a new DeletedRequestById object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetUniqueKey - -`func (o *DeletedRequestById) GetUniqueKey() string` - -GetUniqueKey returns the UniqueKey field if non-nil, zero value otherwise. - -### GetUniqueKeyOk - -`func (o *DeletedRequestById) GetUniqueKeyOk() (*string, bool)` - -GetUniqueKeyOk returns a tuple with the UniqueKey field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetUniqueKey - -`func (o *DeletedRequestById) SetUniqueKey(v string)` - -SetUniqueKey sets UniqueKey field to given value. - -### HasUniqueKey - -`func (o *DeletedRequestById) HasUniqueKey() bool` - -HasUniqueKey returns a boolean if a field has been set. - -### GetId - -`func (o *DeletedRequestById) GetId() string` - -GetId returns the Id field if non-nil, zero value otherwise. - -### GetIdOk - -`func (o *DeletedRequestById) GetIdOk() (*string, bool)` - -GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetId - -`func (o *DeletedRequestById) SetId(v string)` - -SetId sets Id field to given value. - - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/DeletedRequestByUniqueKey.md b/docs/DeletedRequestByUniqueKey.md deleted file mode 100644 index fbbbd12..0000000 --- a/docs/DeletedRequestByUniqueKey.md +++ /dev/null @@ -1,77 +0,0 @@ -# DeletedRequestByUniqueKey - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**UniqueKey** | **string** | A unique key used for request de-duplication. Requests with the same unique key are considered identical. | -**Id** | Pointer to **string** | A unique identifier assigned to the request. | [optional] - -## Methods - -### NewDeletedRequestByUniqueKey - -`func NewDeletedRequestByUniqueKey(uniqueKey string, ) *DeletedRequestByUniqueKey` - -NewDeletedRequestByUniqueKey instantiates a new DeletedRequestByUniqueKey object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewDeletedRequestByUniqueKeyWithDefaults - -`func NewDeletedRequestByUniqueKeyWithDefaults() *DeletedRequestByUniqueKey` - -NewDeletedRequestByUniqueKeyWithDefaults instantiates a new DeletedRequestByUniqueKey object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetUniqueKey - -`func (o *DeletedRequestByUniqueKey) GetUniqueKey() string` - -GetUniqueKey returns the UniqueKey field if non-nil, zero value otherwise. - -### GetUniqueKeyOk - -`func (o *DeletedRequestByUniqueKey) GetUniqueKeyOk() (*string, bool)` - -GetUniqueKeyOk returns a tuple with the UniqueKey field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetUniqueKey - -`func (o *DeletedRequestByUniqueKey) SetUniqueKey(v string)` - -SetUniqueKey sets UniqueKey field to given value. - - -### GetId - -`func (o *DeletedRequestByUniqueKey) GetId() string` - -GetId returns the Id field if non-nil, zero value otherwise. - -### GetIdOk - -`func (o *DeletedRequestByUniqueKey) GetIdOk() (*string, bool)` - -GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetId - -`func (o *DeletedRequestByUniqueKey) SetId(v string)` - -SetId sets Id field to given value. - -### HasId - -`func (o *DeletedRequestByUniqueKey) HasId() bool` - -HasId returns a boolean if a field has been set. - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/EffectivePlatformFeature.md b/docs/EffectivePlatformFeature.md deleted file mode 100644 index 7e81198..0000000 --- a/docs/EffectivePlatformFeature.md +++ /dev/null @@ -1,165 +0,0 @@ -# EffectivePlatformFeature - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**IsEnabled** | **bool** | | -**DisabledReason** | **NullableString** | | -**DisabledReasonType** | **NullableString** | | -**IsTrial** | **bool** | | -**TrialExpirationAt** | **NullableTime** | | - -## Methods - -### NewEffectivePlatformFeature - -`func NewEffectivePlatformFeature(isEnabled bool, disabledReason NullableString, disabledReasonType NullableString, isTrial bool, trialExpirationAt NullableTime, ) *EffectivePlatformFeature` - -NewEffectivePlatformFeature instantiates a new EffectivePlatformFeature object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewEffectivePlatformFeatureWithDefaults - -`func NewEffectivePlatformFeatureWithDefaults() *EffectivePlatformFeature` - -NewEffectivePlatformFeatureWithDefaults instantiates a new EffectivePlatformFeature object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetIsEnabled - -`func (o *EffectivePlatformFeature) GetIsEnabled() bool` - -GetIsEnabled returns the IsEnabled field if non-nil, zero value otherwise. - -### GetIsEnabledOk - -`func (o *EffectivePlatformFeature) GetIsEnabledOk() (*bool, bool)` - -GetIsEnabledOk returns a tuple with the IsEnabled field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetIsEnabled - -`func (o *EffectivePlatformFeature) SetIsEnabled(v bool)` - -SetIsEnabled sets IsEnabled field to given value. - - -### GetDisabledReason - -`func (o *EffectivePlatformFeature) GetDisabledReason() string` - -GetDisabledReason returns the DisabledReason field if non-nil, zero value otherwise. - -### GetDisabledReasonOk - -`func (o *EffectivePlatformFeature) GetDisabledReasonOk() (*string, bool)` - -GetDisabledReasonOk returns a tuple with the DisabledReason field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetDisabledReason - -`func (o *EffectivePlatformFeature) SetDisabledReason(v string)` - -SetDisabledReason sets DisabledReason field to given value. - - -### SetDisabledReasonNil - -`func (o *EffectivePlatformFeature) SetDisabledReasonNil(b bool)` - - SetDisabledReasonNil sets the value for DisabledReason to be an explicit nil - -### UnsetDisabledReason -`func (o *EffectivePlatformFeature) UnsetDisabledReason()` - -UnsetDisabledReason ensures that no value is present for DisabledReason, not even an explicit nil -### GetDisabledReasonType - -`func (o *EffectivePlatformFeature) GetDisabledReasonType() string` - -GetDisabledReasonType returns the DisabledReasonType field if non-nil, zero value otherwise. - -### GetDisabledReasonTypeOk - -`func (o *EffectivePlatformFeature) GetDisabledReasonTypeOk() (*string, bool)` - -GetDisabledReasonTypeOk returns a tuple with the DisabledReasonType field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetDisabledReasonType - -`func (o *EffectivePlatformFeature) SetDisabledReasonType(v string)` - -SetDisabledReasonType sets DisabledReasonType field to given value. - - -### SetDisabledReasonTypeNil - -`func (o *EffectivePlatformFeature) SetDisabledReasonTypeNil(b bool)` - - SetDisabledReasonTypeNil sets the value for DisabledReasonType to be an explicit nil - -### UnsetDisabledReasonType -`func (o *EffectivePlatformFeature) UnsetDisabledReasonType()` - -UnsetDisabledReasonType ensures that no value is present for DisabledReasonType, not even an explicit nil -### GetIsTrial - -`func (o *EffectivePlatformFeature) GetIsTrial() bool` - -GetIsTrial returns the IsTrial field if non-nil, zero value otherwise. - -### GetIsTrialOk - -`func (o *EffectivePlatformFeature) GetIsTrialOk() (*bool, bool)` - -GetIsTrialOk returns a tuple with the IsTrial field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetIsTrial - -`func (o *EffectivePlatformFeature) SetIsTrial(v bool)` - -SetIsTrial sets IsTrial field to given value. - - -### GetTrialExpirationAt - -`func (o *EffectivePlatformFeature) GetTrialExpirationAt() time.Time` - -GetTrialExpirationAt returns the TrialExpirationAt field if non-nil, zero value otherwise. - -### GetTrialExpirationAtOk - -`func (o *EffectivePlatformFeature) GetTrialExpirationAtOk() (*time.Time, bool)` - -GetTrialExpirationAtOk returns a tuple with the TrialExpirationAt field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetTrialExpirationAt - -`func (o *EffectivePlatformFeature) SetTrialExpirationAt(v time.Time)` - -SetTrialExpirationAt sets TrialExpirationAt field to given value. - - -### SetTrialExpirationAtNil - -`func (o *EffectivePlatformFeature) SetTrialExpirationAtNil(b bool)` - - SetTrialExpirationAtNil sets the value for TrialExpirationAt to be an explicit nil - -### UnsetTrialExpirationAt -`func (o *EffectivePlatformFeature) UnsetTrialExpirationAt()` - -UnsetTrialExpirationAt ensures that no value is present for TrialExpirationAt, not even an explicit nil - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/EffectivePlatformFeatures.md b/docs/EffectivePlatformFeatures.md deleted file mode 100644 index daeb16c..0000000 --- a/docs/EffectivePlatformFeatures.md +++ /dev/null @@ -1,240 +0,0 @@ -# EffectivePlatformFeatures - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**ACTORS** | [**EffectivePlatformFeature**](EffectivePlatformFeature.md) | | -**STORAGE** | [**EffectivePlatformFeature**](EffectivePlatformFeature.md) | | -**SCHEDULER** | [**EffectivePlatformFeature**](EffectivePlatformFeature.md) | | -**PROXY** | [**EffectivePlatformFeature**](EffectivePlatformFeature.md) | | -**PROXY_EXTERNAL_ACCESS** | [**EffectivePlatformFeature**](EffectivePlatformFeature.md) | | -**PROXY_RESIDENTIAL** | [**EffectivePlatformFeature**](EffectivePlatformFeature.md) | | -**PROXY_SERPS** | [**EffectivePlatformFeature**](EffectivePlatformFeature.md) | | -**WEBHOOKS** | [**EffectivePlatformFeature**](EffectivePlatformFeature.md) | | -**ACTORS_PUBLIC_ALL** | [**EffectivePlatformFeature**](EffectivePlatformFeature.md) | | -**ACTORS_PUBLIC_DEVELOPER** | [**EffectivePlatformFeature**](EffectivePlatformFeature.md) | | - -## Methods - -### NewEffectivePlatformFeatures - -`func NewEffectivePlatformFeatures(aCTORS EffectivePlatformFeature, sTORAGE EffectivePlatformFeature, sCHEDULER EffectivePlatformFeature, pROXY EffectivePlatformFeature, pROXYEXTERNALACCESS EffectivePlatformFeature, pROXYRESIDENTIAL EffectivePlatformFeature, pROXYSERPS EffectivePlatformFeature, wEBHOOKS EffectivePlatformFeature, aCTORSPUBLICALL EffectivePlatformFeature, aCTORSPUBLICDEVELOPER EffectivePlatformFeature, ) *EffectivePlatformFeatures` - -NewEffectivePlatformFeatures instantiates a new EffectivePlatformFeatures object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewEffectivePlatformFeaturesWithDefaults - -`func NewEffectivePlatformFeaturesWithDefaults() *EffectivePlatformFeatures` - -NewEffectivePlatformFeaturesWithDefaults instantiates a new EffectivePlatformFeatures object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetACTORS - -`func (o *EffectivePlatformFeatures) GetACTORS() EffectivePlatformFeature` - -GetACTORS returns the ACTORS field if non-nil, zero value otherwise. - -### GetACTORSOk - -`func (o *EffectivePlatformFeatures) GetACTORSOk() (*EffectivePlatformFeature, bool)` - -GetACTORSOk returns a tuple with the ACTORS field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetACTORS - -`func (o *EffectivePlatformFeatures) SetACTORS(v EffectivePlatformFeature)` - -SetACTORS sets ACTORS field to given value. - - -### GetSTORAGE - -`func (o *EffectivePlatformFeatures) GetSTORAGE() EffectivePlatformFeature` - -GetSTORAGE returns the STORAGE field if non-nil, zero value otherwise. - -### GetSTORAGEOk - -`func (o *EffectivePlatformFeatures) GetSTORAGEOk() (*EffectivePlatformFeature, bool)` - -GetSTORAGEOk returns a tuple with the STORAGE field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetSTORAGE - -`func (o *EffectivePlatformFeatures) SetSTORAGE(v EffectivePlatformFeature)` - -SetSTORAGE sets STORAGE field to given value. - - -### GetSCHEDULER - -`func (o *EffectivePlatformFeatures) GetSCHEDULER() EffectivePlatformFeature` - -GetSCHEDULER returns the SCHEDULER field if non-nil, zero value otherwise. - -### GetSCHEDULEROk - -`func (o *EffectivePlatformFeatures) GetSCHEDULEROk() (*EffectivePlatformFeature, bool)` - -GetSCHEDULEROk returns a tuple with the SCHEDULER field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetSCHEDULER - -`func (o *EffectivePlatformFeatures) SetSCHEDULER(v EffectivePlatformFeature)` - -SetSCHEDULER sets SCHEDULER field to given value. - - -### GetPROXY - -`func (o *EffectivePlatformFeatures) GetPROXY() EffectivePlatformFeature` - -GetPROXY returns the PROXY field if non-nil, zero value otherwise. - -### GetPROXYOk - -`func (o *EffectivePlatformFeatures) GetPROXYOk() (*EffectivePlatformFeature, bool)` - -GetPROXYOk returns a tuple with the PROXY field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetPROXY - -`func (o *EffectivePlatformFeatures) SetPROXY(v EffectivePlatformFeature)` - -SetPROXY sets PROXY field to given value. - - -### GetPROXY_EXTERNAL_ACCESS - -`func (o *EffectivePlatformFeatures) GetPROXY_EXTERNAL_ACCESS() EffectivePlatformFeature` - -GetPROXY_EXTERNAL_ACCESS returns the PROXY_EXTERNAL_ACCESS field if non-nil, zero value otherwise. - -### GetPROXY_EXTERNAL_ACCESSOk - -`func (o *EffectivePlatformFeatures) GetPROXY_EXTERNAL_ACCESSOk() (*EffectivePlatformFeature, bool)` - -GetPROXY_EXTERNAL_ACCESSOk returns a tuple with the PROXY_EXTERNAL_ACCESS field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetPROXY_EXTERNAL_ACCESS - -`func (o *EffectivePlatformFeatures) SetPROXY_EXTERNAL_ACCESS(v EffectivePlatformFeature)` - -SetPROXY_EXTERNAL_ACCESS sets PROXY_EXTERNAL_ACCESS field to given value. - - -### GetPROXY_RESIDENTIAL - -`func (o *EffectivePlatformFeatures) GetPROXY_RESIDENTIAL() EffectivePlatformFeature` - -GetPROXY_RESIDENTIAL returns the PROXY_RESIDENTIAL field if non-nil, zero value otherwise. - -### GetPROXY_RESIDENTIALOk - -`func (o *EffectivePlatformFeatures) GetPROXY_RESIDENTIALOk() (*EffectivePlatformFeature, bool)` - -GetPROXY_RESIDENTIALOk returns a tuple with the PROXY_RESIDENTIAL field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetPROXY_RESIDENTIAL - -`func (o *EffectivePlatformFeatures) SetPROXY_RESIDENTIAL(v EffectivePlatformFeature)` - -SetPROXY_RESIDENTIAL sets PROXY_RESIDENTIAL field to given value. - - -### GetPROXY_SERPS - -`func (o *EffectivePlatformFeatures) GetPROXY_SERPS() EffectivePlatformFeature` - -GetPROXY_SERPS returns the PROXY_SERPS field if non-nil, zero value otherwise. - -### GetPROXY_SERPSOk - -`func (o *EffectivePlatformFeatures) GetPROXY_SERPSOk() (*EffectivePlatformFeature, bool)` - -GetPROXY_SERPSOk returns a tuple with the PROXY_SERPS field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetPROXY_SERPS - -`func (o *EffectivePlatformFeatures) SetPROXY_SERPS(v EffectivePlatformFeature)` - -SetPROXY_SERPS sets PROXY_SERPS field to given value. - - -### GetWEBHOOKS - -`func (o *EffectivePlatformFeatures) GetWEBHOOKS() EffectivePlatformFeature` - -GetWEBHOOKS returns the WEBHOOKS field if non-nil, zero value otherwise. - -### GetWEBHOOKSOk - -`func (o *EffectivePlatformFeatures) GetWEBHOOKSOk() (*EffectivePlatformFeature, bool)` - -GetWEBHOOKSOk returns a tuple with the WEBHOOKS field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetWEBHOOKS - -`func (o *EffectivePlatformFeatures) SetWEBHOOKS(v EffectivePlatformFeature)` - -SetWEBHOOKS sets WEBHOOKS field to given value. - - -### GetACTORS_PUBLIC_ALL - -`func (o *EffectivePlatformFeatures) GetACTORS_PUBLIC_ALL() EffectivePlatformFeature` - -GetACTORS_PUBLIC_ALL returns the ACTORS_PUBLIC_ALL field if non-nil, zero value otherwise. - -### GetACTORS_PUBLIC_ALLOk - -`func (o *EffectivePlatformFeatures) GetACTORS_PUBLIC_ALLOk() (*EffectivePlatformFeature, bool)` - -GetACTORS_PUBLIC_ALLOk returns a tuple with the ACTORS_PUBLIC_ALL field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetACTORS_PUBLIC_ALL - -`func (o *EffectivePlatformFeatures) SetACTORS_PUBLIC_ALL(v EffectivePlatformFeature)` - -SetACTORS_PUBLIC_ALL sets ACTORS_PUBLIC_ALL field to given value. - - -### GetACTORS_PUBLIC_DEVELOPER - -`func (o *EffectivePlatformFeatures) GetACTORS_PUBLIC_DEVELOPER() EffectivePlatformFeature` - -GetACTORS_PUBLIC_DEVELOPER returns the ACTORS_PUBLIC_DEVELOPER field if non-nil, zero value otherwise. - -### GetACTORS_PUBLIC_DEVELOPEROk - -`func (o *EffectivePlatformFeatures) GetACTORS_PUBLIC_DEVELOPEROk() (*EffectivePlatformFeature, bool)` - -GetACTORS_PUBLIC_DEVELOPEROk returns a tuple with the ACTORS_PUBLIC_DEVELOPER field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetACTORS_PUBLIC_DEVELOPER - -`func (o *EffectivePlatformFeatures) SetACTORS_PUBLIC_DEVELOPER(v EffectivePlatformFeature)` - -SetACTORS_PUBLIC_DEVELOPER sets ACTORS_PUBLIC_DEVELOPER field to given value. - - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/EncodeAndSignData.md b/docs/EncodeAndSignData.md deleted file mode 100644 index 489a991..0000000 --- a/docs/EncodeAndSignData.md +++ /dev/null @@ -1,51 +0,0 @@ -# EncodeAndSignData - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Encoded** | **string** | | - -## Methods - -### NewEncodeAndSignData - -`func NewEncodeAndSignData(encoded string, ) *EncodeAndSignData` - -NewEncodeAndSignData instantiates a new EncodeAndSignData object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewEncodeAndSignDataWithDefaults - -`func NewEncodeAndSignDataWithDefaults() *EncodeAndSignData` - -NewEncodeAndSignDataWithDefaults instantiates a new EncodeAndSignData object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetEncoded - -`func (o *EncodeAndSignData) GetEncoded() string` - -GetEncoded returns the Encoded field if non-nil, zero value otherwise. - -### GetEncodedOk - -`func (o *EncodeAndSignData) GetEncodedOk() (*string, bool)` - -GetEncodedOk returns a tuple with the Encoded field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetEncoded - -`func (o *EncodeAndSignData) SetEncoded(v string)` - -SetEncoded sets Encoded field to given value. - - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/EncodeAndSignResponse.md b/docs/EncodeAndSignResponse.md deleted file mode 100644 index 9081b07..0000000 --- a/docs/EncodeAndSignResponse.md +++ /dev/null @@ -1,51 +0,0 @@ -# EncodeAndSignResponse - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Data** | [**EncodeAndSignData**](EncodeAndSignData.md) | | - -## Methods - -### NewEncodeAndSignResponse - -`func NewEncodeAndSignResponse(data EncodeAndSignData, ) *EncodeAndSignResponse` - -NewEncodeAndSignResponse instantiates a new EncodeAndSignResponse object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewEncodeAndSignResponseWithDefaults - -`func NewEncodeAndSignResponseWithDefaults() *EncodeAndSignResponse` - -NewEncodeAndSignResponseWithDefaults instantiates a new EncodeAndSignResponse object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetData - -`func (o *EncodeAndSignResponse) GetData() EncodeAndSignData` - -GetData returns the Data field if non-nil, zero value otherwise. - -### GetDataOk - -`func (o *EncodeAndSignResponse) GetDataOk() (*EncodeAndSignData, bool)` - -GetDataOk returns a tuple with the Data field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetData - -`func (o *EncodeAndSignResponse) SetData(v EncodeAndSignData)` - -SetData sets Data field to given value. - - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/EnvVar.md b/docs/EnvVar.md deleted file mode 100644 index 6d94447..0000000 --- a/docs/EnvVar.md +++ /dev/null @@ -1,113 +0,0 @@ -# EnvVar - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Name** | **string** | | -**Value** | Pointer to **string** | The environment variable value. This field is absent in responses when `isSecret` is `true`, as secret values are never returned by the API. | [optional] -**IsSecret** | Pointer to **NullableBool** | | [optional] - -## Methods - -### NewEnvVar - -`func NewEnvVar(name string, ) *EnvVar` - -NewEnvVar instantiates a new EnvVar object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewEnvVarWithDefaults - -`func NewEnvVarWithDefaults() *EnvVar` - -NewEnvVarWithDefaults instantiates a new EnvVar object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetName - -`func (o *EnvVar) GetName() string` - -GetName returns the Name field if non-nil, zero value otherwise. - -### GetNameOk - -`func (o *EnvVar) GetNameOk() (*string, bool)` - -GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetName - -`func (o *EnvVar) SetName(v string)` - -SetName sets Name field to given value. - - -### GetValue - -`func (o *EnvVar) GetValue() string` - -GetValue returns the Value field if non-nil, zero value otherwise. - -### GetValueOk - -`func (o *EnvVar) GetValueOk() (*string, bool)` - -GetValueOk returns a tuple with the Value field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetValue - -`func (o *EnvVar) SetValue(v string)` - -SetValue sets Value field to given value. - -### HasValue - -`func (o *EnvVar) HasValue() bool` - -HasValue returns a boolean if a field has been set. - -### GetIsSecret - -`func (o *EnvVar) GetIsSecret() bool` - -GetIsSecret returns the IsSecret field if non-nil, zero value otherwise. - -### GetIsSecretOk - -`func (o *EnvVar) GetIsSecretOk() (*bool, bool)` - -GetIsSecretOk returns a tuple with the IsSecret field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetIsSecret - -`func (o *EnvVar) SetIsSecret(v bool)` - -SetIsSecret sets IsSecret field to given value. - -### HasIsSecret - -`func (o *EnvVar) HasIsSecret() bool` - -HasIsSecret returns a boolean if a field has been set. - -### SetIsSecretNil - -`func (o *EnvVar) SetIsSecretNil(b bool)` - - SetIsSecretNil sets the value for IsSecret to be an explicit nil - -### UnsetIsSecret -`func (o *EnvVar) UnsetIsSecret()` - -UnsetIsSecret ensures that no value is present for IsSecret, not even an explicit nil - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/EnvVarRequest.md b/docs/EnvVarRequest.md deleted file mode 100644 index 71e1003..0000000 --- a/docs/EnvVarRequest.md +++ /dev/null @@ -1,103 +0,0 @@ -# EnvVarRequest - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Name** | **string** | | -**Value** | Pointer to **string** | The environment variable value. This field is absent in responses when `isSecret` is `true`, as secret values are never returned by the API. | [optional] -**IsSecret** | Pointer to **bool** | | [optional] - -## Methods - -### NewEnvVarRequest - -`func NewEnvVarRequest(name string, ) *EnvVarRequest` - -NewEnvVarRequest instantiates a new EnvVarRequest object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewEnvVarRequestWithDefaults - -`func NewEnvVarRequestWithDefaults() *EnvVarRequest` - -NewEnvVarRequestWithDefaults instantiates a new EnvVarRequest object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetName - -`func (o *EnvVarRequest) GetName() string` - -GetName returns the Name field if non-nil, zero value otherwise. - -### GetNameOk - -`func (o *EnvVarRequest) GetNameOk() (*string, bool)` - -GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetName - -`func (o *EnvVarRequest) SetName(v string)` - -SetName sets Name field to given value. - - -### GetValue - -`func (o *EnvVarRequest) GetValue() string` - -GetValue returns the Value field if non-nil, zero value otherwise. - -### GetValueOk - -`func (o *EnvVarRequest) GetValueOk() (*string, bool)` - -GetValueOk returns a tuple with the Value field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetValue - -`func (o *EnvVarRequest) SetValue(v string)` - -SetValue sets Value field to given value. - -### HasValue - -`func (o *EnvVarRequest) HasValue() bool` - -HasValue returns a boolean if a field has been set. - -### GetIsSecret - -`func (o *EnvVarRequest) GetIsSecret() bool` - -GetIsSecret returns the IsSecret field if non-nil, zero value otherwise. - -### GetIsSecretOk - -`func (o *EnvVarRequest) GetIsSecretOk() (*bool, bool)` - -GetIsSecretOk returns a tuple with the IsSecret field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetIsSecret - -`func (o *EnvVarRequest) SetIsSecret(v bool)` - -SetIsSecret sets IsSecret field to given value. - -### HasIsSecret - -`func (o *EnvVarRequest) HasIsSecret() bool` - -HasIsSecret returns a boolean if a field has been set. - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/EnvVarResponse.md b/docs/EnvVarResponse.md deleted file mode 100644 index f662e99..0000000 --- a/docs/EnvVarResponse.md +++ /dev/null @@ -1,51 +0,0 @@ -# EnvVarResponse - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Data** | [**EnvVar**](EnvVar.md) | | - -## Methods - -### NewEnvVarResponse - -`func NewEnvVarResponse(data EnvVar, ) *EnvVarResponse` - -NewEnvVarResponse instantiates a new EnvVarResponse object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewEnvVarResponseWithDefaults - -`func NewEnvVarResponseWithDefaults() *EnvVarResponse` - -NewEnvVarResponseWithDefaults instantiates a new EnvVarResponse object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetData - -`func (o *EnvVarResponse) GetData() EnvVar` - -GetData returns the Data field if non-nil, zero value otherwise. - -### GetDataOk - -`func (o *EnvVarResponse) GetDataOk() (*EnvVar, bool)` - -GetDataOk returns a tuple with the Data field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetData - -`func (o *EnvVarResponse) SetData(v EnvVar)` - -SetData sets Data field to given value. - - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/ErrorDetail.md b/docs/ErrorDetail.md deleted file mode 100644 index bf2d0a3..0000000 --- a/docs/ErrorDetail.md +++ /dev/null @@ -1,82 +0,0 @@ -# ErrorDetail - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Type** | Pointer to [**ErrorType**](ErrorType.md) | | [optional] -**Message** | Pointer to **string** | Human-readable error message describing what went wrong. | [optional] - -## Methods - -### NewErrorDetail - -`func NewErrorDetail() *ErrorDetail` - -NewErrorDetail instantiates a new ErrorDetail object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewErrorDetailWithDefaults - -`func NewErrorDetailWithDefaults() *ErrorDetail` - -NewErrorDetailWithDefaults instantiates a new ErrorDetail object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetType - -`func (o *ErrorDetail) GetType() ErrorType` - -GetType returns the Type field if non-nil, zero value otherwise. - -### GetTypeOk - -`func (o *ErrorDetail) GetTypeOk() (*ErrorType, bool)` - -GetTypeOk returns a tuple with the Type field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetType - -`func (o *ErrorDetail) SetType(v ErrorType)` - -SetType sets Type field to given value. - -### HasType - -`func (o *ErrorDetail) HasType() bool` - -HasType returns a boolean if a field has been set. - -### GetMessage - -`func (o *ErrorDetail) GetMessage() string` - -GetMessage returns the Message field if non-nil, zero value otherwise. - -### GetMessageOk - -`func (o *ErrorDetail) GetMessageOk() (*string, bool)` - -GetMessageOk returns a tuple with the Message field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetMessage - -`func (o *ErrorDetail) SetMessage(v string)` - -SetMessage sets Message field to given value. - -### HasMessage - -`func (o *ErrorDetail) HasMessage() bool` - -HasMessage returns a boolean if a field has been set. - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/ErrorResponse.md b/docs/ErrorResponse.md deleted file mode 100644 index 64485d7..0000000 --- a/docs/ErrorResponse.md +++ /dev/null @@ -1,51 +0,0 @@ -# ErrorResponse - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Error** | [**ErrorDetail**](ErrorDetail.md) | | - -## Methods - -### NewErrorResponse - -`func NewErrorResponse(error_ ErrorDetail, ) *ErrorResponse` - -NewErrorResponse instantiates a new ErrorResponse object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewErrorResponseWithDefaults - -`func NewErrorResponseWithDefaults() *ErrorResponse` - -NewErrorResponseWithDefaults instantiates a new ErrorResponse object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetError - -`func (o *ErrorResponse) GetError() ErrorDetail` - -GetError returns the Error field if non-nil, zero value otherwise. - -### GetErrorOk - -`func (o *ErrorResponse) GetErrorOk() (*ErrorDetail, bool)` - -GetErrorOk returns a tuple with the Error field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetError - -`func (o *ErrorResponse) SetError(v ErrorDetail)` - -SetError sets Error field to given value. - - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/ErrorType.md b/docs/ErrorType.md deleted file mode 100644 index dab3f58..0000000 --- a/docs/ErrorType.md +++ /dev/null @@ -1,791 +0,0 @@ -# ErrorType - -## Enum - - -* `_3D_SECURE_AUTH_FAILED` (value: `"3d-secure-auth-failed"`) - -* `ACCESS_RIGHT_ALREADY_EXISTS` (value: `"access-right-already-exists"`) - -* `ACTION_NOT_FOUND` (value: `"action-not-found"`) - -* `ACTOR_ALREADY_RENTED` (value: `"actor-already-rented"`) - -* `ACTOR_CAN_NOT_BE_RENTED` (value: `"actor-can-not-be-rented"`) - -* `ACTOR_DISABLED` (value: `"actor-disabled"`) - -* `ACTOR_IS_NOT_RENTED` (value: `"actor-is-not-rented"`) - -* `ACTOR_MEMORY_LIMIT_EXCEEDED` (value: `"actor-memory-limit-exceeded"`) - -* `ACTOR_NAME_EXISTS_NEW_OWNER` (value: `"actor-name-exists-new-owner"`) - -* `ACTOR_NAME_NOT_UNIQUE` (value: `"actor-name-not-unique"`) - -* `ACTOR_NOT_FOUND` (value: `"actor-not-found"`) - -* `ACTOR_NOT_GITHUB_ACTOR` (value: `"actor-not-github-actor"`) - -* `ACTOR_NOT_PUBLIC` (value: `"actor-not-public"`) - -* `ACTOR_PERMISSION_LEVEL_NOT_SUPPORTED_FOR_AGENTIC_PAYMENTS` (value: `"actor-permission-level-not-supported-for-agentic-payments"`) - -* `ACTOR_REVIEW_ALREADY_EXISTS` (value: `"actor-review-already-exists"`) - -* `ACTOR_RUN_FAILED` (value: `"actor-run-failed"`) - -* `ACTOR_STANDBY_NOT_SUPPORTED_FOR_AGENTIC_PAYMENTS` (value: `"actor-standby-not-supported-for-agentic-payments"`) - -* `ACTOR_TASK_NAME_NOT_UNIQUE` (value: `"actor-task-name-not-unique"`) - -* `AGENTIC_PAYMENT_INFO_RETRIEVAL_ERROR` (value: `"agentic-payment-info-retrieval-error"`) - -* `AGENTIC_PAYMENT_INFORMATION_MISSING` (value: `"agentic-payment-information-missing"`) - -* `AGENTIC_PAYMENT_INSUFFICIENT_AMOUNT` (value: `"agentic-payment-insufficient-amount"`) - -* `AGENTIC_PAYMENT_PROVIDER_INTERNAL_ERROR` (value: `"agentic-payment-provider-internal-error"`) - -* `AGENTIC_PAYMENT_PROVIDER_UNAUTHORIZED` (value: `"agentic-payment-provider-unauthorized"`) - -* `AIRTABLE_WEBHOOK_DEPRECATED` (value: `"airtable-webhook-deprecated"`) - -* `ALREADY_SUBSCRIBED_TO_PAID_ACTOR` (value: `"already-subscribed-to-paid-actor"`) - -* `APIFY_PLAN_REQUIRED_TO_USE_PAID_ACTOR` (value: `"apify-plan-required-to-use-paid-actor"`) - -* `APIFY_SIGNUP_NOT_ALLOWED` (value: `"apify-signup-not-allowed"`) - -* `AUTH_METHOD_NOT_SUPPORTED` (value: `"auth-method-not-supported"`) - -* `AUTHORIZATION_SERVER_NOT_FOUND` (value: `"authorization-server-not-found"`) - -* `AUTO_ISSUE_DATE_INVALID` (value: `"auto-issue-date-invalid"`) - -* `BACKGROUND_CHECK_REQUIRED` (value: `"background-check-required"`) - -* `BILLING_SYSTEM_ERROR` (value: `"billing-system-error"`) - -* `BLACK_FRIDAY_PLAN_EXPIRED` (value: `"black-friday-plan-expired"`) - -* `BRAINTREE_ERROR` (value: `"braintree-error"`) - -* `BRAINTREE_NOT_LINKED` (value: `"braintree-not-linked"`) - -* `BRAINTREE_OPERATION_TIMED_OUT` (value: `"braintree-operation-timed-out"`) - -* `BRAINTREE_UNSUPPORTED_CURRENCY` (value: `"braintree-unsupported-currency"`) - -* `BUILD_NOT_FOUND` (value: `"build-not-found"`) - -* `BUILD_OUTDATED` (value: `"build-outdated"`) - -* `CANNOT_ADD_APIFY_EVENTS_TO_PPE_ACTOR` (value: `"cannot-add-apify-events-to-ppe-actor"`) - -* `CANNOT_ADD_MULTIPLE_PRICING_INFOS` (value: `"cannot-add-multiple-pricing-infos"`) - -* `CANNOT_ADD_PRICING_INFO_THAT_ALTERS_PAST` (value: `"cannot-add-pricing-info-that-alters-past"`) - -* `CANNOT_ADD_SECOND_FUTURE_PRICING_INFO` (value: `"cannot-add-second-future-pricing-info"`) - -* `CANNOT_BUILD_ACTOR_FROM_WEBHOOK` (value: `"cannot-build-actor-from-webhook"`) - -* `CANNOT_CHANGE_BILLING_INTERVAL` (value: `"cannot-change-billing-interval"`) - -* `CANNOT_CHANGE_OWNER` (value: `"cannot-change-owner"`) - -* `CANNOT_CHARGE_APIFY_EVENT` (value: `"cannot-charge-apify-event"`) - -* `CANNOT_CHARGE_NON_PAY_PER_EVENT_ACTOR` (value: `"cannot-charge-non-pay-per-event-actor"`) - -* `CANNOT_COMMENT_AS_OTHER_USER` (value: `"cannot-comment-as-other-user"`) - -* `CANNOT_COPY_ACTOR_TASK` (value: `"cannot-copy-actor-task"`) - -* `CANNOT_CREATE_PAYOUT` (value: `"cannot-create-payout"`) - -* `CANNOT_CREATE_PUBLIC_ACTOR` (value: `"cannot-create-public-actor"`) - -* `CANNOT_CREATE_TAX_TRANSACTION` (value: `"cannot-create-tax-transaction"`) - -* `CANNOT_DELETE_CRITICAL_ACTOR` (value: `"cannot-delete-critical-actor"`) - -* `CANNOT_DELETE_INVOICE` (value: `"cannot-delete-invoice"`) - -* `CANNOT_DELETE_PAID_ACTOR` (value: `"cannot-delete-paid-actor"`) - -* `CANNOT_DISABLE_ONE_TIME_EVENT_FOR_APIFY_START_EVENT` (value: `"cannot-disable-one-time-event-for-apify-start-event"`) - -* `CANNOT_DISABLE_ORGANIZATION_WITH_ENABLED_MEMBERS` (value: `"cannot-disable-organization-with-enabled-members"`) - -* `CANNOT_DISABLE_USER_WITH_SUBSCRIPTION` (value: `"cannot-disable-user-with-subscription"`) - -* `CANNOT_LINK_OAUTH_TO_UNVERIFIED_EMAIL` (value: `"cannot-link-oauth-to-unverified-email"`) - -* `CANNOT_METAMORPH_TO_PAY_PER_RESULT_ACTOR` (value: `"cannot-metamorph-to-pay-per-result-actor"`) - -* `CANNOT_MODIFY_ACTOR_PRICING_TOO_FREQUENTLY` (value: `"cannot-modify-actor-pricing-too-frequently"`) - -* `CANNOT_MODIFY_ACTOR_PRICING_WITH_IMMEDIATE_EFFECT` (value: `"cannot-modify-actor-pricing-with-immediate-effect"`) - -* `CANNOT_OVERRIDE_PAID_ACTOR_TRIAL` (value: `"cannot-override-paid-actor-trial"`) - -* `CANNOT_PERMANENTLY_DELETE_SUBSCRIPTION` (value: `"cannot-permanently-delete-subscription"`) - -* `CANNOT_PUBLISH_ACTOR` (value: `"cannot-publish-actor"`) - -* `CANNOT_REDUCE_LAST_FULL_TOKEN` (value: `"cannot-reduce-last-full-token"`) - -* `CANNOT_REIMBURSE_MORE_THAN_ORIGINAL_CHARGE` (value: `"cannot-reimburse-more-than-original-charge"`) - -* `CANNOT_REIMBURSE_NON_RENTAL_CHARGE` (value: `"cannot-reimburse-non-rental-charge"`) - -* `CANNOT_REMOVE_OWN_ACTOR_FROM_RECENTLY_USED` (value: `"cannot-remove-own-actor-from-recently-used"`) - -* `CANNOT_REMOVE_PAYMENT_METHOD` (value: `"cannot-remove-payment-method"`) - -* `CANNOT_REMOVE_PRICING_INFO` (value: `"cannot-remove-pricing-info"`) - -* `CANNOT_REMOVE_RUNNING_RUN` (value: `"cannot-remove-running-run"`) - -* `CANNOT_REMOVE_USER_WITH_PUBLIC_ACTORS` (value: `"cannot-remove-user-with-public-actors"`) - -* `CANNOT_REMOVE_USER_WITH_SUBSCRIPTION` (value: `"cannot-remove-user-with-subscription"`) - -* `CANNOT_REMOVE_USER_WITH_UNPAID_INVOICE` (value: `"cannot-remove-user-with-unpaid-invoice"`) - -* `CANNOT_RENAME_ENV_VAR` (value: `"cannot-rename-env-var"`) - -* `CANNOT_RENT_PAID_ACTOR` (value: `"cannot-rent-paid-actor"`) - -* `CANNOT_REVIEW_OWN_ACTOR` (value: `"cannot-review-own-actor"`) - -* `CANNOT_SET_ACCESS_RIGHTS_FOR_OWNER` (value: `"cannot-set-access-rights-for-owner"`) - -* `CANNOT_SET_IS_STATUS_MESSAGE_TERMINAL` (value: `"cannot-set-is-status-message-terminal"`) - -* `CANNOT_UNPUBLISH_CRITICAL_ACTOR` (value: `"cannot-unpublish-critical-actor"`) - -* `CANNOT_UNPUBLISH_PAID_ACTOR` (value: `"cannot-unpublish-paid-actor"`) - -* `CANNOT_UNPUBLISH_PROFILE` (value: `"cannot-unpublish-profile"`) - -* `CANNOT_UPDATE_INVOICE_FIELD` (value: `"cannot-update-invoice-field"`) - -* `CONCURRENT_RUNS_LIMIT_EXCEEDED` (value: `"concurrent-runs-limit-exceeded"`) - -* `CONCURRENT_UPDATE_DETECTED` (value: `"concurrent-update-detected"`) - -* `CONFERENCE_TOKEN_NOT_FOUND` (value: `"conference-token-not-found"`) - -* `CONTENT_ENCODING_FORBIDDEN_FOR_HTML` (value: `"content-encoding-forbidden-for-html"`) - -* `COUPON_ALREADY_REDEEMED` (value: `"coupon-already-redeemed"`) - -* `COUPON_EXPIRED` (value: `"coupon-expired"`) - -* `COUPON_FOR_NEW_CUSTOMERS` (value: `"coupon-for-new-customers"`) - -* `COUPON_FOR_SUBSCRIBED_USERS` (value: `"coupon-for-subscribed-users"`) - -* `COUPON_LIMITS_ARE_IN_CONFLICT_WITH_CURRENT_LIMITS` (value: `"coupon-limits-are-in-conflict-with-current-limits"`) - -* `COUPON_MAX_NUMBER_OF_REDEMPTIONS_REACHED` (value: `"coupon-max-number-of-redemptions-reached"`) - -* `COUPON_NOT_FOUND` (value: `"coupon-not-found"`) - -* `COUPON_NOT_UNIQUE` (value: `"coupon-not-unique"`) - -* `COUPONS_DISABLED` (value: `"coupons-disabled"`) - -* `CREATE_GITHUB_ISSUE_NOT_ALLOWED` (value: `"create-github-issue-not-allowed"`) - -* `CREATOR_PLAN_NOT_AVAILABLE` (value: `"creator-plan-not-available"`) - -* `CRON_EXPRESSION_INVALID` (value: `"cron-expression-invalid"`) - -* `DAILY_AI_TOKEN_LIMIT_EXCEEDED` (value: `"daily-ai-token-limit-exceeded"`) - -* `DAILY_PUBLICATION_LIMIT_EXCEEDED` (value: `"daily-publication-limit-exceeded"`) - -* `DATASET_DOES_NOT_HAVE_FIELDS_SCHEMA` (value: `"dataset-does-not-have-fields-schema"`) - -* `DATASET_DOES_NOT_HAVE_SCHEMA` (value: `"dataset-does-not-have-schema"`) - -* `DATASET_LOCKED` (value: `"dataset-locked"`) - -* `DATASET_SCHEMA_INVALID` (value: `"dataset-schema-invalid"`) - -* `DCR_NOT_SUPPORTED` (value: `"dcr-not-supported"`) - -* `DEFAULT_DATASET_NOT_FOUND` (value: `"default-dataset-not-found"`) - -* `DELETING_DEFAULT_BUILD` (value: `"deleting-default-build"`) - -* `DELETING_UNFINISHED_BUILD` (value: `"deleting-unfinished-build"`) - -* `EMAIL_ALREADY_TAKEN` (value: `"email-already-taken"`) - -* `EMAIL_ALREADY_TAKEN_REMOVED_USER` (value: `"email-already-taken-removed-user"`) - -* `EMAIL_DOMAIN_NOT_ALLOWED_FOR_COUPON` (value: `"email-domain-not-allowed-for-coupon"`) - -* `EMAIL_INVALID` (value: `"email-invalid"`) - -* `EMAIL_NOT_ALLOWED` (value: `"email-not-allowed"`) - -* `EMAIL_NOT_VALID` (value: `"email-not-valid"`) - -* `EMAIL_UPDATE_TOO_SOON` (value: `"email-update-too-soon"`) - -* `ELEVATED_PERMISSIONS_NEEDED` (value: `"elevated-permissions-needed"`) - -* `ENV_VAR_ALREADY_EXISTS` (value: `"env-var-already-exists"`) - -* `EXCHANGE_RATE_FETCH_FAILED` (value: `"exchange-rate-fetch-failed"`) - -* `EXPIRED_CONFERENCE_TOKEN` (value: `"expired-conference-token"`) - -* `FAILED_TO_CHARGE_USER` (value: `"failed-to-charge-user"`) - -* `FINAL_INVOICE_NEGATIVE` (value: `"final-invoice-negative"`) - -* `FULL_PERMISSION_ACTOR_NOT_APPROVED` (value: `"full-permission-actor-not-approved"`) - -* `GITHUB_BRANCH_EMPTY` (value: `"github-branch-empty"`) - -* `GITHUB_ISSUE_ALREADY_EXISTS` (value: `"github-issue-already-exists"`) - -* `GITHUB_PUBLIC_KEY_NOT_FOUND` (value: `"github-public-key-not-found"`) - -* `GITHUB_REPOSITORY_NOT_FOUND` (value: `"github-repository-not-found"`) - -* `GITHUB_SIGNATURE_DOES_NOT_MATCH_PAYLOAD` (value: `"github-signature-does-not-match-payload"`) - -* `GITHUB_USER_NOT_AUTHORIZED_FOR_ISSUES` (value: `"github-user-not-authorized-for-issues"`) - -* `GMAIL_NOT_ALLOWED` (value: `"gmail-not-allowed"`) - -* `ID_DOES_NOT_MATCH` (value: `"id-does-not-match"`) - -* `INCOMPATIBLE_BILLING_INTERVAL` (value: `"incompatible-billing-interval"`) - -* `INCOMPLETE_PAYOUT_BILLING_INFO` (value: `"incomplete-payout-billing-info"`) - -* `INCONSISTENT_CURRENCIES` (value: `"inconsistent-currencies"`) - -* `INCORRECT_PRICING_MODIFIER_PREFIX` (value: `"incorrect-pricing-modifier-prefix"`) - -* `INPUT_JSON_INVALID_CHARACTERS` (value: `"input-json-invalid-characters"`) - -* `INPUT_JSON_NOT_OBJECT` (value: `"input-json-not-object"`) - -* `INPUT_JSON_TOO_LONG` (value: `"input-json-too-long"`) - -* `INPUT_UPDATE_COLLISION` (value: `"input-update-collision"`) - -* `INSUFFICIENT_PERMISSIONS` (value: `"insufficient-permissions"`) - -* `INSUFFICIENT_PERMISSIONS_TO_CHANGE_FIELD` (value: `"insufficient-permissions-to-change-field"`) - -* `INSUFFICIENT_SECURITY_MEASURES` (value: `"insufficient-security-measures"`) - -* `INSUFFICIENT_TAX_COUNTRY_EVIDENCE` (value: `"insufficient-tax-country-evidence"`) - -* `INTEGRATION_AUTH_ERROR` (value: `"integration-auth-error"`) - -* `INTERNAL_SERVER_ERROR` (value: `"internal-server-error"`) - -* `INVALID_BILLING_INFO` (value: `"invalid-billing-info"`) - -* `INVALID_BILLING_PERIOD_FOR_PAYOUT` (value: `"invalid-billing-period-for-payout"`) - -* `INVALID_BUILD` (value: `"invalid-build"`) - -* `INVALID_CLIENT_KEY` (value: `"invalid-client-key"`) - -* `INVALID_COLLECTION` (value: `"invalid-collection"`) - -* `INVALID_CONFERENCE_LOGIN_PASSWORD` (value: `"invalid-conference-login-password"`) - -* `INVALID_CONTENT_TYPE_HEADER` (value: `"invalid-content-type-header"`) - -* `INVALID_CREDENTIALS` (value: `"invalid-credentials"`) - -* `INVALID_GIT_AUTH_TOKEN` (value: `"invalid-git-auth-token"`) - -* `INVALID_GITHUB_ISSUE_URL` (value: `"invalid-github-issue-url"`) - -* `INVALID_HEADER` (value: `"invalid-header"`) - -* `INVALID_ID` (value: `"invalid-id"`) - -* `INVALID_IDEMPOTENCY_KEY` (value: `"invalid-idempotency-key"`) - -* `INVALID_INPUT` (value: `"invalid-input"`) - -* `INVALID_INPUT_SCHEMA` (value: `"invalid-input-schema"`) - -* `INVALID_INVOICE` (value: `"invalid-invoice"`) - -* `INVALID_INVOICE_TYPE` (value: `"invalid-invoice-type"`) - -* `INVALID_ISSUE_DATE` (value: `"invalid-issue-date"`) - -* `INVALID_LABEL_PARAMS` (value: `"invalid-label-params"`) - -* `INVALID_MAIN_ACCOUNT_USER_ID` (value: `"invalid-main-account-user-id"`) - -* `INVALID_OAUTH_APP` (value: `"invalid-oauth-app"`) - -* `INVALID_OAUTH_SCOPE` (value: `"invalid-oauth-scope"`) - -* `INVALID_ONE_TIME_INVOICE` (value: `"invalid-one-time-invoice"`) - -* `INVALID_PARAMETER` (value: `"invalid-parameter"`) - -* `INVALID_PAYOUT_STATUS` (value: `"invalid-payout-status"`) - -* `INVALID_PICTURE_URL` (value: `"invalid-picture-url"`) - -* `INVALID_RECORD_KEY` (value: `"invalid-record-key"`) - -* `INVALID_REQUEST` (value: `"invalid-request"`) - -* `INVALID_RESOURCE_TYPE` (value: `"invalid-resource-type"`) - -* `INVALID_SIGNATURE` (value: `"invalid-signature"`) - -* `INVALID_SUBSCRIPTION_PLAN` (value: `"invalid-subscription-plan"`) - -* `INVALID_TAX_NUMBER` (value: `"invalid-tax-number"`) - -* `INVALID_TAX_NUMBER_FORMAT` (value: `"invalid-tax-number-format"`) - -* `INVALID_TOKEN` (value: `"invalid-token"`) - -* `INVALID_TOKEN_TYPE` (value: `"invalid-token-type"`) - -* `INVALID_TWO_FACTOR_CODE` (value: `"invalid-two-factor-code"`) - -* `INVALID_TWO_FACTOR_CODE_OR_RECOVERY_CODE` (value: `"invalid-two-factor-code-or-recovery-code"`) - -* `INVALID_TWO_FACTOR_RECOVERY_CODE` (value: `"invalid-two-factor-recovery-code"`) - -* `INVALID_USERNAME` (value: `"invalid-username"`) - -* `INVALID_VALUE` (value: `"invalid-value"`) - -* `INVITATION_INVALID_RESOURCE_TYPE` (value: `"invitation-invalid-resource-type"`) - -* `INVITATION_NO_LONGER_VALID` (value: `"invitation-no-longer-valid"`) - -* `INVOICE_CANCELED` (value: `"invoice-canceled"`) - -* `INVOICE_CANNOT_BE_REFUNDED_DUE_TO_TOO_HIGH_AMOUNT` (value: `"invoice-cannot-be-refunded-due-to-too-high-amount"`) - -* `INVOICE_INCOMPLETE` (value: `"invoice-incomplete"`) - -* `INVOICE_IS_DRAFT` (value: `"invoice-is-draft"`) - -* `INVOICE_LOCKED` (value: `"invoice-locked"`) - -* `INVOICE_MUST_BE_BUFFER` (value: `"invoice-must-be-buffer"`) - -* `INVOICE_NOT_CANCELED` (value: `"invoice-not-canceled"`) - -* `INVOICE_NOT_DRAFT` (value: `"invoice-not-draft"`) - -* `INVOICE_NOT_FOUND` (value: `"invoice-not-found"`) - -* `INVOICE_OUTDATED` (value: `"invoice-outdated"`) - -* `INVOICE_PAID_ALREADY` (value: `"invoice-paid-already"`) - -* `ISSUE_ALREADY_CONNECTED_TO_GITHUB` (value: `"issue-already-connected-to-github"`) - -* `ISSUE_NOT_FOUND` (value: `"issue-not-found"`) - -* `ISSUES_BAD_REQUEST` (value: `"issues-bad-request"`) - -* `ISSUER_NOT_REGISTERED` (value: `"issuer-not-registered"`) - -* `JOB_FINISHED` (value: `"job-finished"`) - -* `LABEL_ALREADY_LINKED` (value: `"label-already-linked"`) - -* `LAST_API_TOKEN` (value: `"last-api-token"`) - -* `LIMIT_REACHED` (value: `"limit-reached"`) - -* `MAX_ITEMS_MUST_BE_GREATER_THAN_ZERO` (value: `"max-items-must-be-greater-than-zero"`) - -* `MAX_METAMORPHS_EXCEEDED` (value: `"max-metamorphs-exceeded"`) - -* `MAX_TOTAL_CHARGE_USD_BELOW_MINIMUM` (value: `"max-total-charge-usd-below-minimum"`) - -* `MAX_TOTAL_CHARGE_USD_MUST_BE_GREATER_THAN_ZERO` (value: `"max-total-charge-usd-must-be-greater-than-zero"`) - -* `METHOD_NOT_ALLOWED` (value: `"method-not-allowed"`) - -* `MIGRATION_DISABLED` (value: `"migration-disabled"`) - -* `MISSING_ACTOR_RIGHTS` (value: `"missing-actor-rights"`) - -* `MISSING_API_TOKEN` (value: `"missing-api-token"`) - -* `MISSING_BILLING_INFO` (value: `"missing-billing-info"`) - -* `MISSING_LINE_ITEMS` (value: `"missing-line-items"`) - -* `MISSING_PAYMENT_DATE` (value: `"missing-payment-date"`) - -* `MISSING_PAYOUT_BILLING_INFO` (value: `"missing-payout-billing-info"`) - -* `MISSING_PROXY_PASSWORD` (value: `"missing-proxy-password"`) - -* `MISSING_REPORTING_FIELDS` (value: `"missing-reporting-fields"`) - -* `MISSING_RESOURCE_NAME` (value: `"missing-resource-name"`) - -* `MISSING_SETTINGS` (value: `"missing-settings"`) - -* `MISSING_USERNAME` (value: `"missing-username"`) - -* `MONTHLY_USAGE_LIMIT_TOO_LOW` (value: `"monthly-usage-limit-too-low"`) - -* `MORE_THAN_ONE_UPDATE_NOT_ALLOWED` (value: `"more-than-one-update-not-allowed"`) - -* `MULTIPLE_RECORDS_FOUND` (value: `"multiple-records-found"`) - -* `MUST_BE_ADMIN` (value: `"must-be-admin"`) - -* `NAME_NOT_UNIQUE` (value: `"name-not-unique"`) - -* `NEXT_RUNTIME_COMPUTATION_FAILED` (value: `"next-runtime-computation-failed"`) - -* `NO_COLUMNS_IN_EXPORTED_DATASET` (value: `"no-columns-in-exported-dataset"`) - -* `NO_PAYMENT_ATTEMPT_FOR_REFUND_FOUND` (value: `"no-payment-attempt-for-refund-found"`) - -* `NO_PAYMENT_METHOD_AVAILABLE` (value: `"no-payment-method-available"`) - -* `NO_TEAM_ACCOUNT_SEATS_AVAILABLE` (value: `"no-team-account-seats-available"`) - -* `NON_TEMPORARY_EMAIL` (value: `"non-temporary-email"`) - -* `NOT_ENOUGH_USAGE_TO_RUN_PAID_ACTOR` (value: `"not-enough-usage-to-run-paid-actor"`) - -* `NOT_IMPLEMENTED` (value: `"not-implemented"`) - -* `NOT_SUPPORTED_CURRENCIES` (value: `"not-supported-currencies"`) - -* `O_AUTH_SERVICE_ALREADY_CONNECTED` (value: `"o-auth-service-already-connected"`) - -* `O_AUTH_SERVICE_NOT_CONNECTED` (value: `"o-auth-service-not-connected"`) - -* `OAUTH_RESOURCE_ACCESS_FAILED` (value: `"oauth-resource-access-failed"`) - -* `ONE_TIME_INVOICE_ALREADY_MARKED_PAID` (value: `"one-time-invoice-already-marked-paid"`) - -* `ONLY_DRAFTS_CAN_BE_DELETED` (value: `"only-drafts-can-be-deleted"`) - -* `OPERATION_CANCELED` (value: `"operation-canceled"`) - -* `OPERATION_NOT_ALLOWED` (value: `"operation-not-allowed"`) - -* `OPERATION_TIMED_OUT` (value: `"operation-timed-out"`) - -* `ORGANIZATION_CANNOT_OWN_ITSELF` (value: `"organization-cannot-own-itself"`) - -* `ORGANIZATION_ROLE_NOT_FOUND` (value: `"organization-role-not-found"`) - -* `OVERLAPPING_PAYOUT_BILLING_PERIODS` (value: `"overlapping-payout-billing-periods"`) - -* `OWN_TOKEN_REQUIRED` (value: `"own-token-required"`) - -* `PAGE_NOT_FOUND` (value: `"page-not-found"`) - -* `PARAM_NOT_ONE_OF` (value: `"param-not-one-of"`) - -* `PARAMETER_REQUIRED` (value: `"parameter-required"`) - -* `PARAMETERS_MISMATCHED` (value: `"parameters-mismatched"`) - -* `PASSWORD_RESET_EMAIL_ALREADY_SENT` (value: `"password-reset-email-already-sent"`) - -* `PASSWORD_RESET_TOKEN_EXPIRED` (value: `"password-reset-token-expired"`) - -* `PAY_AS_YOU_GO_WITHOUT_MONTHLY_INTERVAL` (value: `"pay-as-you-go-without-monthly-interval"`) - -* `PAYMENT_ATTEMPT_STATUS_MESSAGE_REQUIRED` (value: `"payment-attempt-status-message-required"`) - -* `PAYOUT_ALREADY_PAID` (value: `"payout-already-paid"`) - -* `PAYOUT_CANCELED` (value: `"payout-canceled"`) - -* `PAYOUT_INVALID_STATE` (value: `"payout-invalid-state"`) - -* `PAYOUT_MUST_BE_APPROVED_TO_BE_MARKED_PAID` (value: `"payout-must-be-approved-to-be-marked-paid"`) - -* `PAYOUT_NOT_FOUND` (value: `"payout-not-found"`) - -* `PAYOUT_NUMBER_ALREADY_EXISTS` (value: `"payout-number-already-exists"`) - -* `PHONE_NUMBER_INVALID` (value: `"phone-number-invalid"`) - -* `PHONE_NUMBER_LANDLINE` (value: `"phone-number-landline"`) - -* `PHONE_NUMBER_OPTED_OUT` (value: `"phone-number-opted-out"`) - -* `PHONE_VERIFICATION_DISABLED` (value: `"phone-verification-disabled"`) - -* `PLATFORM_FEATURE_DISABLED` (value: `"platform-feature-disabled"`) - -* `PRICE_OVERRIDES_VALIDATION_FAILED` (value: `"price-overrides-validation-failed"`) - -* `PRICING_MODEL_NOT_SUPPORTED` (value: `"pricing-model-not-supported"`) - -* `PROMOTIONAL_PLAN_NOT_AVAILABLE` (value: `"promotional-plan-not-available"`) - -* `PROXY_AUTH_IP_NOT_UNIQUE` (value: `"proxy-auth-ip-not-unique"`) - -* `PUBLIC_ACTOR_DISABLED` (value: `"public-actor-disabled"`) - -* `QUERY_TIMEOUT` (value: `"query-timeout"`) - -* `QUOTED_PRICE_OUTDATED` (value: `"quoted-price-outdated"`) - -* `RATE_LIMIT_EXCEEDED` (value: `"rate-limit-exceeded"`) - -* `RECAPTCHA_INVALID` (value: `"recaptcha-invalid"`) - -* `RECAPTCHA_REQUIRED` (value: `"recaptcha-required"`) - -* `RECORD_NOT_FOUND` (value: `"record-not-found"`) - -* `RECORD_NOT_PUBLIC` (value: `"record-not-public"`) - -* `RECORD_OR_TOKEN_NOT_FOUND` (value: `"record-or-token-not-found"`) - -* `RECORD_TOO_LARGE` (value: `"record-too-large"`) - -* `REDIRECT_URI_MISMATCH` (value: `"redirect-uri-mismatch"`) - -* `REDUCED_PLAN_NOT_AVAILABLE` (value: `"reduced-plan-not-available"`) - -* `RENTAL_CHARGE_ALREADY_REIMBURSED` (value: `"rental-charge-already-reimbursed"`) - -* `RENTAL_NOT_ALLOWED` (value: `"rental-not-allowed"`) - -* `REQUEST_ABORTED_PREMATURELY` (value: `"request-aborted-prematurely"`) - -* `REQUEST_HANDLED_OR_LOCKED` (value: `"request-handled-or-locked"`) - -* `REQUEST_ID_INVALID` (value: `"request-id-invalid"`) - -* `REQUEST_QUEUE_DUPLICATE_REQUESTS` (value: `"request-queue-duplicate-requests"`) - -* `REQUEST_TOO_LARGE` (value: `"request-too-large"`) - -* `REQUESTED_DATASET_VIEW_DOES_NOT_EXIST` (value: `"requested-dataset-view-does-not-exist"`) - -* `RESUME_TOKEN_EXPIRED` (value: `"resume-token-expired"`) - -* `RUN_FAILED` (value: `"run-failed"`) - -* `RUN_INPUT_BODY_NOT_VALID_JSON` (value: `"run-input-body-not-valid-json"`) - -* `RUN_TIMEOUT_EXCEEDED` (value: `"run-timeout-exceeded"`) - -* `RUSSIA_IS_EVIL` (value: `"russia-is-evil"`) - -* `SAME_USER` (value: `"same-user"`) - -* `SCHEDULE_ACTOR_NOT_FOUND` (value: `"schedule-actor-not-found"`) - -* `SCHEDULE_ACTOR_TASK_NOT_FOUND` (value: `"schedule-actor-task-not-found"`) - -* `SCHEDULE_NAME_NOT_UNIQUE` (value: `"schedule-name-not-unique"`) - -* `SCHEMA_VALIDATION` (value: `"schema-validation"`) - -* `SCHEMA_VALIDATION_ERROR` (value: `"schema-validation-error"`) - -* `SCHEMA_VALIDATION_FAILED` (value: `"schema-validation-failed"`) - -* `SIGN_UP_METHOD_NOT_ALLOWED` (value: `"sign-up-method-not-allowed"`) - -* `SLACK_INTEGRATION_NOT_CUSTOM` (value: `"slack-integration-not-custom"`) - -* `SOCKET_CLOSED` (value: `"socket-closed"`) - -* `SOCKET_DESTROYED` (value: `"socket-destroyed"`) - -* `STORE_SCHEMA_INVALID` (value: `"store-schema-invalid"`) - -* `STORE_TERMS_NOT_ACCEPTED` (value: `"store-terms-not-accepted"`) - -* `STRIPE_ENABLED` (value: `"stripe-enabled"`) - -* `STRIPE_GENERIC_DECLINE` (value: `"stripe-generic-decline"`) - -* `STRIPE_NOT_ENABLED` (value: `"stripe-not-enabled"`) - -* `STRIPE_NOT_ENABLED_FOR_USER` (value: `"stripe-not-enabled-for-user"`) - -* `TAGGED_BUILD_REQUIRED` (value: `"tagged-build-required"`) - -* `TAX_COUNTRY_INVALID` (value: `"tax-country-invalid"`) - -* `TAX_NUMBER_INVALID` (value: `"tax-number-invalid"`) - -* `TAX_NUMBER_VALIDATION_FAILED` (value: `"tax-number-validation-failed"`) - -* `TAXAMO_CALL_FAILED` (value: `"taxamo-call-failed"`) - -* `TAXAMO_REQUEST_FAILED` (value: `"taxamo-request-failed"`) - -* `TESTING_ERROR` (value: `"testing-error"`) - -* `TOKEN_NOT_PROVIDED` (value: `"token-not-provided"`) - -* `TOO_FEW_VERSIONS` (value: `"too-few-versions"`) - -* `TOO_MANY_ACTOR_TASKS` (value: `"too-many-actor-tasks"`) - -* `TOO_MANY_ACTORS` (value: `"too-many-actors"`) - -* `TOO_MANY_LABELS_ON_RESOURCE` (value: `"too-many-labels-on-resource"`) - -* `TOO_MANY_MCP_CONNECTORS` (value: `"too-many-mcp-connectors"`) - -* `TOO_MANY_O_AUTH_APPS` (value: `"too-many-o-auth-apps"`) - -* `TOO_MANY_ORGANIZATIONS` (value: `"too-many-organizations"`) - -* `TOO_MANY_REQUESTS` (value: `"too-many-requests"`) - -* `TOO_MANY_SCHEDULES` (value: `"too-many-schedules"`) - -* `TOO_MANY_UI_ACCESS_KEYS` (value: `"too-many-ui-access-keys"`) - -* `TOO_MANY_USER_LABELS` (value: `"too-many-user-labels"`) - -* `TOO_MANY_VALUES` (value: `"too-many-values"`) - -* `TOO_MANY_VERSIONS` (value: `"too-many-versions"`) - -* `TOO_MANY_WEBHOOKS` (value: `"too-many-webhooks"`) - -* `UNEXPECTED_ROUTE` (value: `"unexpected-route"`) - -* `UNKNOWN_BUILD_TAG` (value: `"unknown-build-tag"`) - -* `UNKNOWN_PAYMENT_PROVIDER` (value: `"unknown-payment-provider"`) - -* `UNSUBSCRIBE_TOKEN_INVALID` (value: `"unsubscribe-token-invalid"`) - -* `UNSUPPORTED_ACTOR_PRICING_MODEL_FOR_AGENTIC_PAYMENTS` (value: `"unsupported-actor-pricing-model-for-agentic-payments"`) - -* `UNSUPPORTED_CONTENT_ENCODING` (value: `"unsupported-content-encoding"`) - -* `UNSUPPORTED_FILE_TYPE_FOR_ISSUE` (value: `"unsupported-file-type-for-issue"`) - -* `UNSUPPORTED_FILE_TYPE_IMAGE_EXPECTED` (value: `"unsupported-file-type-image-expected"`) - -* `UNSUPPORTED_FILE_TYPE_TEXT_OR_JSON_EXPECTED` (value: `"unsupported-file-type-text-or-json-expected"`) - -* `UNSUPPORTED_PERMISSION` (value: `"unsupported-permission"`) - -* `UPCOMING_SUBSCRIPTION_BILL_NOT_UP_TO_DATE` (value: `"upcoming-subscription-bill-not-up-to-date"`) - -* `USER_ALREADY_EXISTS` (value: `"user-already-exists"`) - -* `USER_ALREADY_VERIFIED` (value: `"user-already-verified"`) - -* `USER_CREATES_ORGANIZATIONS_TOO_FAST` (value: `"user-creates-organizations-too-fast"`) - -* `USER_DISABLED` (value: `"user-disabled"`) - -* `USER_EMAIL_IS_DISPOSABLE` (value: `"user-email-is-disposable"`) - -* `USER_EMAIL_NOT_SET` (value: `"user-email-not-set"`) - -* `USER_EMAIL_NOT_VERIFIED` (value: `"user-email-not-verified"`) - -* `USER_HAS_NO_SUBSCRIPTION` (value: `"user-has-no-subscription"`) - -* `USER_INTEGRATION_NOT_FOUND` (value: `"user-integration-not-found"`) - -* `USER_IS_ALREADY_INVITED` (value: `"user-is-already-invited"`) - -* `USER_IS_ALREADY_ORGANIZATION_MEMBER` (value: `"user-is-already-organization-member"`) - -* `USER_IS_NOT_MEMBER_OF_ORGANIZATION` (value: `"user-is-not-member-of-organization"`) - -* `USER_IS_NOT_ORGANIZATION` (value: `"user-is-not-organization"`) - -* `USER_IS_ORGANIZATION` (value: `"user-is-organization"`) - -* `USER_IS_ORGANIZATION_OWNER` (value: `"user-is-organization-owner"`) - -* `USER_IS_REMOVED` (value: `"user-is-removed"`) - -* `USER_NOT_FOUND` (value: `"user-not-found"`) - -* `USER_NOT_LOGGED_IN` (value: `"user-not-logged-in"`) - -* `USER_NOT_VERIFIED` (value: `"user-not-verified"`) - -* `USER_OR_TOKEN_NOT_FOUND` (value: `"user-or-token-not-found"`) - -* `USER_PLAN_NOT_ALLOWED_FOR_COUPON` (value: `"user-plan-not-allowed-for-coupon"`) - -* `USER_PROBLEM_WITH_CARD` (value: `"user-problem-with-card"`) - -* `USER_RECORD_NOT_FOUND` (value: `"user-record-not-found"`) - -* `USERNAME_ALREADY_TAKEN` (value: `"username-already-taken"`) - -* `USERNAME_MISSING` (value: `"username-missing"`) - -* `USERNAME_NOT_ALLOWED` (value: `"username-not-allowed"`) - -* `USERNAME_REMOVAL_FORBIDDEN` (value: `"username-removal-forbidden"`) - -* `USERNAME_REQUIRED` (value: `"username-required"`) - -* `VERIFICATION_EMAIL_ALREADY_SENT` (value: `"verification-email-already-sent"`) - -* `VERIFICATION_TOKEN_EXPIRED` (value: `"verification-token-expired"`) - -* `VERSION_ALREADY_EXISTS` (value: `"version-already-exists"`) - -* `VERSIONS_SIZE_EXCEEDED` (value: `"versions-size-exceeded"`) - -* `WEAK_PASSWORD` (value: `"weak-password"`) - -* `X402_AGENTIC_PAYMENT_ALREADY_FINALIZED` (value: `"x402-agentic-payment-already-finalized"`) - -* `X402_AGENTIC_PAYMENT_INSUFFICIENT_AMOUNT` (value: `"x402-agentic-payment-insufficient-amount"`) - -* `X402_AGENTIC_PAYMENT_MALFORMED_TOKEN` (value: `"x402-agentic-payment-malformed-token"`) - -* `X402_AGENTIC_PAYMENT_SETTLEMENT_FAILED` (value: `"x402-agentic-payment-settlement-failed"`) - -* `X402_AGENTIC_PAYMENT_SETTLEMENT_IN_PROGRESS` (value: `"x402-agentic-payment-settlement-in-progress"`) - -* `X402_AGENTIC_PAYMENT_SETTLEMENT_STUCK` (value: `"x402-agentic-payment-settlement-stuck"`) - -* `X402_AGENTIC_PAYMENT_UNAUTHORIZED` (value: `"x402-agentic-payment-unauthorized"`) - -* `X402_PAYMENT_REQUIRED` (value: `"x402-payment-required"`) - -* `ZERO_INVOICE` (value: `"zero-invoice"`) - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/EventData.md b/docs/EventData.md deleted file mode 100644 index 8426df0..0000000 --- a/docs/EventData.md +++ /dev/null @@ -1,72 +0,0 @@ -# EventData - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**ActorId** | **string** | | -**ActorRunId** | **string** | | - -## Methods - -### NewEventData - -`func NewEventData(actorId string, actorRunId string, ) *EventData` - -NewEventData instantiates a new EventData object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewEventDataWithDefaults - -`func NewEventDataWithDefaults() *EventData` - -NewEventDataWithDefaults instantiates a new EventData object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetActorId - -`func (o *EventData) GetActorId() string` - -GetActorId returns the ActorId field if non-nil, zero value otherwise. - -### GetActorIdOk - -`func (o *EventData) GetActorIdOk() (*string, bool)` - -GetActorIdOk returns a tuple with the ActorId field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetActorId - -`func (o *EventData) SetActorId(v string)` - -SetActorId sets ActorId field to given value. - - -### GetActorRunId - -`func (o *EventData) GetActorRunId() string` - -GetActorRunId returns the ActorRunId field if non-nil, zero value otherwise. - -### GetActorRunIdOk - -`func (o *EventData) GetActorRunIdOk() (*string, bool)` - -GetActorRunIdOk returns a tuple with the ActorRunId field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetActorRunId - -`func (o *EventData) SetActorRunId(v string)` - -SetActorRunId sets ActorRunId field to given value. - - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/ExampleRunInput.md b/docs/ExampleRunInput.md deleted file mode 100644 index 4df6a64..0000000 --- a/docs/ExampleRunInput.md +++ /dev/null @@ -1,82 +0,0 @@ -# ExampleRunInput - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Body** | Pointer to **string** | | [optional] -**ContentType** | Pointer to **string** | | [optional] - -## Methods - -### NewExampleRunInput - -`func NewExampleRunInput() *ExampleRunInput` - -NewExampleRunInput instantiates a new ExampleRunInput object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewExampleRunInputWithDefaults - -`func NewExampleRunInputWithDefaults() *ExampleRunInput` - -NewExampleRunInputWithDefaults instantiates a new ExampleRunInput object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetBody - -`func (o *ExampleRunInput) GetBody() string` - -GetBody returns the Body field if non-nil, zero value otherwise. - -### GetBodyOk - -`func (o *ExampleRunInput) GetBodyOk() (*string, bool)` - -GetBodyOk returns a tuple with the Body field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetBody - -`func (o *ExampleRunInput) SetBody(v string)` - -SetBody sets Body field to given value. - -### HasBody - -`func (o *ExampleRunInput) HasBody() bool` - -HasBody returns a boolean if a field has been set. - -### GetContentType - -`func (o *ExampleRunInput) GetContentType() string` - -GetContentType returns the ContentType field if non-nil, zero value otherwise. - -### GetContentTypeOk - -`func (o *ExampleRunInput) GetContentTypeOk() (*string, bool)` - -GetContentTypeOk returns a tuple with the ContentType field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetContentType - -`func (o *ExampleRunInput) SetContentType(v string)` - -SetContentType sets ContentType field to given value. - -### HasContentType - -`func (o *ExampleRunInput) HasContentType() bool` - -HasContentType returns a boolean if a field has been set. - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/ExampleWebhookDispatch.md b/docs/ExampleWebhookDispatch.md deleted file mode 100644 index a3ce97d..0000000 --- a/docs/ExampleWebhookDispatch.md +++ /dev/null @@ -1,123 +0,0 @@ -# ExampleWebhookDispatch - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Status** | [**WebhookDispatchStatus**](WebhookDispatchStatus.md) | | -**FinishedAt** | Pointer to **NullableTime** | | [optional] -**RemovedAt** | Pointer to **NullableTime** | | [optional] - -## Methods - -### NewExampleWebhookDispatch - -`func NewExampleWebhookDispatch(status WebhookDispatchStatus, ) *ExampleWebhookDispatch` - -NewExampleWebhookDispatch instantiates a new ExampleWebhookDispatch object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewExampleWebhookDispatchWithDefaults - -`func NewExampleWebhookDispatchWithDefaults() *ExampleWebhookDispatch` - -NewExampleWebhookDispatchWithDefaults instantiates a new ExampleWebhookDispatch object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetStatus - -`func (o *ExampleWebhookDispatch) GetStatus() WebhookDispatchStatus` - -GetStatus returns the Status field if non-nil, zero value otherwise. - -### GetStatusOk - -`func (o *ExampleWebhookDispatch) GetStatusOk() (*WebhookDispatchStatus, bool)` - -GetStatusOk returns a tuple with the Status field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetStatus - -`func (o *ExampleWebhookDispatch) SetStatus(v WebhookDispatchStatus)` - -SetStatus sets Status field to given value. - - -### GetFinishedAt - -`func (o *ExampleWebhookDispatch) GetFinishedAt() time.Time` - -GetFinishedAt returns the FinishedAt field if non-nil, zero value otherwise. - -### GetFinishedAtOk - -`func (o *ExampleWebhookDispatch) GetFinishedAtOk() (*time.Time, bool)` - -GetFinishedAtOk returns a tuple with the FinishedAt field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetFinishedAt - -`func (o *ExampleWebhookDispatch) SetFinishedAt(v time.Time)` - -SetFinishedAt sets FinishedAt field to given value. - -### HasFinishedAt - -`func (o *ExampleWebhookDispatch) HasFinishedAt() bool` - -HasFinishedAt returns a boolean if a field has been set. - -### SetFinishedAtNil - -`func (o *ExampleWebhookDispatch) SetFinishedAtNil(b bool)` - - SetFinishedAtNil sets the value for FinishedAt to be an explicit nil - -### UnsetFinishedAt -`func (o *ExampleWebhookDispatch) UnsetFinishedAt()` - -UnsetFinishedAt ensures that no value is present for FinishedAt, not even an explicit nil -### GetRemovedAt - -`func (o *ExampleWebhookDispatch) GetRemovedAt() time.Time` - -GetRemovedAt returns the RemovedAt field if non-nil, zero value otherwise. - -### GetRemovedAtOk - -`func (o *ExampleWebhookDispatch) GetRemovedAtOk() (*time.Time, bool)` - -GetRemovedAtOk returns a tuple with the RemovedAt field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetRemovedAt - -`func (o *ExampleWebhookDispatch) SetRemovedAt(v time.Time)` - -SetRemovedAt sets RemovedAt field to given value. - -### HasRemovedAt - -`func (o *ExampleWebhookDispatch) HasRemovedAt() bool` - -HasRemovedAt returns a boolean if a field has been set. - -### SetRemovedAtNil - -`func (o *ExampleWebhookDispatch) SetRemovedAtNil(b bool)` - - SetRemovedAtNil sets the value for RemovedAt to be an explicit nil - -### UnsetRemovedAt -`func (o *ExampleWebhookDispatch) UnsetRemovedAt()` - -UnsetRemovedAt ensures that no value is present for RemovedAt, not even an explicit nil - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/FlatPricePerMonthActorPricingInfo.md b/docs/FlatPricePerMonthActorPricingInfo.md deleted file mode 100644 index 28159f4..0000000 --- a/docs/FlatPricePerMonthActorPricingInfo.md +++ /dev/null @@ -1,286 +0,0 @@ -# FlatPricePerMonthActorPricingInfo - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**ApifyMarginPercentage** | **float32** | In [0, 1], fraction of pricePerUnitUsd that goes to Apify | -**CreatedAt** | **time.Time** | When this pricing info record has been created | -**StartedAt** | **time.Time** | Since when is this pricing info record effective for a given Actor | -**NotifiedAboutFutureChangeAt** | Pointer to **time.Time** | | [optional] -**NotifiedAboutChangeAt** | Pointer to **time.Time** | | [optional] -**ReasonForChange** | Pointer to **string** | | [optional] -**IsPriceChangeNotificationSuppressed** | Pointer to **bool** | | [optional] -**ForceContainsSignificantPriceChange** | Pointer to **bool** | | [optional] -**PricingModel** | **string** | | -**TrialMinutes** | **int32** | For how long this Actor can be used for free in trial period | -**PricePerUnitUsd** | **float32** | Monthly flat price in USD | - -## Methods - -### NewFlatPricePerMonthActorPricingInfo - -`func NewFlatPricePerMonthActorPricingInfo(apifyMarginPercentage float32, createdAt time.Time, startedAt time.Time, pricingModel string, trialMinutes int32, pricePerUnitUsd float32, ) *FlatPricePerMonthActorPricingInfo` - -NewFlatPricePerMonthActorPricingInfo instantiates a new FlatPricePerMonthActorPricingInfo object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewFlatPricePerMonthActorPricingInfoWithDefaults - -`func NewFlatPricePerMonthActorPricingInfoWithDefaults() *FlatPricePerMonthActorPricingInfo` - -NewFlatPricePerMonthActorPricingInfoWithDefaults instantiates a new FlatPricePerMonthActorPricingInfo object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetApifyMarginPercentage - -`func (o *FlatPricePerMonthActorPricingInfo) GetApifyMarginPercentage() float32` - -GetApifyMarginPercentage returns the ApifyMarginPercentage field if non-nil, zero value otherwise. - -### GetApifyMarginPercentageOk - -`func (o *FlatPricePerMonthActorPricingInfo) GetApifyMarginPercentageOk() (*float32, bool)` - -GetApifyMarginPercentageOk returns a tuple with the ApifyMarginPercentage field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetApifyMarginPercentage - -`func (o *FlatPricePerMonthActorPricingInfo) SetApifyMarginPercentage(v float32)` - -SetApifyMarginPercentage sets ApifyMarginPercentage field to given value. - - -### GetCreatedAt - -`func (o *FlatPricePerMonthActorPricingInfo) GetCreatedAt() time.Time` - -GetCreatedAt returns the CreatedAt field if non-nil, zero value otherwise. - -### GetCreatedAtOk - -`func (o *FlatPricePerMonthActorPricingInfo) GetCreatedAtOk() (*time.Time, bool)` - -GetCreatedAtOk returns a tuple with the CreatedAt field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetCreatedAt - -`func (o *FlatPricePerMonthActorPricingInfo) SetCreatedAt(v time.Time)` - -SetCreatedAt sets CreatedAt field to given value. - - -### GetStartedAt - -`func (o *FlatPricePerMonthActorPricingInfo) GetStartedAt() time.Time` - -GetStartedAt returns the StartedAt field if non-nil, zero value otherwise. - -### GetStartedAtOk - -`func (o *FlatPricePerMonthActorPricingInfo) GetStartedAtOk() (*time.Time, bool)` - -GetStartedAtOk returns a tuple with the StartedAt field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetStartedAt - -`func (o *FlatPricePerMonthActorPricingInfo) SetStartedAt(v time.Time)` - -SetStartedAt sets StartedAt field to given value. - - -### GetNotifiedAboutFutureChangeAt - -`func (o *FlatPricePerMonthActorPricingInfo) GetNotifiedAboutFutureChangeAt() time.Time` - -GetNotifiedAboutFutureChangeAt returns the NotifiedAboutFutureChangeAt field if non-nil, zero value otherwise. - -### GetNotifiedAboutFutureChangeAtOk - -`func (o *FlatPricePerMonthActorPricingInfo) GetNotifiedAboutFutureChangeAtOk() (*time.Time, bool)` - -GetNotifiedAboutFutureChangeAtOk returns a tuple with the NotifiedAboutFutureChangeAt field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetNotifiedAboutFutureChangeAt - -`func (o *FlatPricePerMonthActorPricingInfo) SetNotifiedAboutFutureChangeAt(v time.Time)` - -SetNotifiedAboutFutureChangeAt sets NotifiedAboutFutureChangeAt field to given value. - -### HasNotifiedAboutFutureChangeAt - -`func (o *FlatPricePerMonthActorPricingInfo) HasNotifiedAboutFutureChangeAt() bool` - -HasNotifiedAboutFutureChangeAt returns a boolean if a field has been set. - -### GetNotifiedAboutChangeAt - -`func (o *FlatPricePerMonthActorPricingInfo) GetNotifiedAboutChangeAt() time.Time` - -GetNotifiedAboutChangeAt returns the NotifiedAboutChangeAt field if non-nil, zero value otherwise. - -### GetNotifiedAboutChangeAtOk - -`func (o *FlatPricePerMonthActorPricingInfo) GetNotifiedAboutChangeAtOk() (*time.Time, bool)` - -GetNotifiedAboutChangeAtOk returns a tuple with the NotifiedAboutChangeAt field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetNotifiedAboutChangeAt - -`func (o *FlatPricePerMonthActorPricingInfo) SetNotifiedAboutChangeAt(v time.Time)` - -SetNotifiedAboutChangeAt sets NotifiedAboutChangeAt field to given value. - -### HasNotifiedAboutChangeAt - -`func (o *FlatPricePerMonthActorPricingInfo) HasNotifiedAboutChangeAt() bool` - -HasNotifiedAboutChangeAt returns a boolean if a field has been set. - -### GetReasonForChange - -`func (o *FlatPricePerMonthActorPricingInfo) GetReasonForChange() string` - -GetReasonForChange returns the ReasonForChange field if non-nil, zero value otherwise. - -### GetReasonForChangeOk - -`func (o *FlatPricePerMonthActorPricingInfo) GetReasonForChangeOk() (*string, bool)` - -GetReasonForChangeOk returns a tuple with the ReasonForChange field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetReasonForChange - -`func (o *FlatPricePerMonthActorPricingInfo) SetReasonForChange(v string)` - -SetReasonForChange sets ReasonForChange field to given value. - -### HasReasonForChange - -`func (o *FlatPricePerMonthActorPricingInfo) HasReasonForChange() bool` - -HasReasonForChange returns a boolean if a field has been set. - -### GetIsPriceChangeNotificationSuppressed - -`func (o *FlatPricePerMonthActorPricingInfo) GetIsPriceChangeNotificationSuppressed() bool` - -GetIsPriceChangeNotificationSuppressed returns the IsPriceChangeNotificationSuppressed field if non-nil, zero value otherwise. - -### GetIsPriceChangeNotificationSuppressedOk - -`func (o *FlatPricePerMonthActorPricingInfo) GetIsPriceChangeNotificationSuppressedOk() (*bool, bool)` - -GetIsPriceChangeNotificationSuppressedOk returns a tuple with the IsPriceChangeNotificationSuppressed field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetIsPriceChangeNotificationSuppressed - -`func (o *FlatPricePerMonthActorPricingInfo) SetIsPriceChangeNotificationSuppressed(v bool)` - -SetIsPriceChangeNotificationSuppressed sets IsPriceChangeNotificationSuppressed field to given value. - -### HasIsPriceChangeNotificationSuppressed - -`func (o *FlatPricePerMonthActorPricingInfo) HasIsPriceChangeNotificationSuppressed() bool` - -HasIsPriceChangeNotificationSuppressed returns a boolean if a field has been set. - -### GetForceContainsSignificantPriceChange - -`func (o *FlatPricePerMonthActorPricingInfo) GetForceContainsSignificantPriceChange() bool` - -GetForceContainsSignificantPriceChange returns the ForceContainsSignificantPriceChange field if non-nil, zero value otherwise. - -### GetForceContainsSignificantPriceChangeOk - -`func (o *FlatPricePerMonthActorPricingInfo) GetForceContainsSignificantPriceChangeOk() (*bool, bool)` - -GetForceContainsSignificantPriceChangeOk returns a tuple with the ForceContainsSignificantPriceChange field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetForceContainsSignificantPriceChange - -`func (o *FlatPricePerMonthActorPricingInfo) SetForceContainsSignificantPriceChange(v bool)` - -SetForceContainsSignificantPriceChange sets ForceContainsSignificantPriceChange field to given value. - -### HasForceContainsSignificantPriceChange - -`func (o *FlatPricePerMonthActorPricingInfo) HasForceContainsSignificantPriceChange() bool` - -HasForceContainsSignificantPriceChange returns a boolean if a field has been set. - -### GetPricingModel - -`func (o *FlatPricePerMonthActorPricingInfo) GetPricingModel() string` - -GetPricingModel returns the PricingModel field if non-nil, zero value otherwise. - -### GetPricingModelOk - -`func (o *FlatPricePerMonthActorPricingInfo) GetPricingModelOk() (*string, bool)` - -GetPricingModelOk returns a tuple with the PricingModel field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetPricingModel - -`func (o *FlatPricePerMonthActorPricingInfo) SetPricingModel(v string)` - -SetPricingModel sets PricingModel field to given value. - - -### GetTrialMinutes - -`func (o *FlatPricePerMonthActorPricingInfo) GetTrialMinutes() int32` - -GetTrialMinutes returns the TrialMinutes field if non-nil, zero value otherwise. - -### GetTrialMinutesOk - -`func (o *FlatPricePerMonthActorPricingInfo) GetTrialMinutesOk() (*int32, bool)` - -GetTrialMinutesOk returns a tuple with the TrialMinutes field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetTrialMinutes - -`func (o *FlatPricePerMonthActorPricingInfo) SetTrialMinutes(v int32)` - -SetTrialMinutes sets TrialMinutes field to given value. - - -### GetPricePerUnitUsd - -`func (o *FlatPricePerMonthActorPricingInfo) GetPricePerUnitUsd() float32` - -GetPricePerUnitUsd returns the PricePerUnitUsd field if non-nil, zero value otherwise. - -### GetPricePerUnitUsdOk - -`func (o *FlatPricePerMonthActorPricingInfo) GetPricePerUnitUsdOk() (*float32, bool)` - -GetPricePerUnitUsdOk returns a tuple with the PricePerUnitUsd field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetPricePerUnitUsd - -`func (o *FlatPricePerMonthActorPricingInfo) SetPricePerUnitUsd(v float32)` - -SetPricePerUnitUsd sets PricePerUnitUsd field to given value. - - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/FreeActorPricingInfo.md b/docs/FreeActorPricingInfo.md deleted file mode 100644 index 99b74d0..0000000 --- a/docs/FreeActorPricingInfo.md +++ /dev/null @@ -1,244 +0,0 @@ -# FreeActorPricingInfo - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**ApifyMarginPercentage** | **float32** | In [0, 1], fraction of pricePerUnitUsd that goes to Apify | -**CreatedAt** | **time.Time** | When this pricing info record has been created | -**StartedAt** | **time.Time** | Since when is this pricing info record effective for a given Actor | -**NotifiedAboutFutureChangeAt** | Pointer to **time.Time** | | [optional] -**NotifiedAboutChangeAt** | Pointer to **time.Time** | | [optional] -**ReasonForChange** | Pointer to **string** | | [optional] -**IsPriceChangeNotificationSuppressed** | Pointer to **bool** | | [optional] -**ForceContainsSignificantPriceChange** | Pointer to **bool** | | [optional] -**PricingModel** | **string** | | - -## Methods - -### NewFreeActorPricingInfo - -`func NewFreeActorPricingInfo(apifyMarginPercentage float32, createdAt time.Time, startedAt time.Time, pricingModel string, ) *FreeActorPricingInfo` - -NewFreeActorPricingInfo instantiates a new FreeActorPricingInfo object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewFreeActorPricingInfoWithDefaults - -`func NewFreeActorPricingInfoWithDefaults() *FreeActorPricingInfo` - -NewFreeActorPricingInfoWithDefaults instantiates a new FreeActorPricingInfo object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetApifyMarginPercentage - -`func (o *FreeActorPricingInfo) GetApifyMarginPercentage() float32` - -GetApifyMarginPercentage returns the ApifyMarginPercentage field if non-nil, zero value otherwise. - -### GetApifyMarginPercentageOk - -`func (o *FreeActorPricingInfo) GetApifyMarginPercentageOk() (*float32, bool)` - -GetApifyMarginPercentageOk returns a tuple with the ApifyMarginPercentage field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetApifyMarginPercentage - -`func (o *FreeActorPricingInfo) SetApifyMarginPercentage(v float32)` - -SetApifyMarginPercentage sets ApifyMarginPercentage field to given value. - - -### GetCreatedAt - -`func (o *FreeActorPricingInfo) GetCreatedAt() time.Time` - -GetCreatedAt returns the CreatedAt field if non-nil, zero value otherwise. - -### GetCreatedAtOk - -`func (o *FreeActorPricingInfo) GetCreatedAtOk() (*time.Time, bool)` - -GetCreatedAtOk returns a tuple with the CreatedAt field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetCreatedAt - -`func (o *FreeActorPricingInfo) SetCreatedAt(v time.Time)` - -SetCreatedAt sets CreatedAt field to given value. - - -### GetStartedAt - -`func (o *FreeActorPricingInfo) GetStartedAt() time.Time` - -GetStartedAt returns the StartedAt field if non-nil, zero value otherwise. - -### GetStartedAtOk - -`func (o *FreeActorPricingInfo) GetStartedAtOk() (*time.Time, bool)` - -GetStartedAtOk returns a tuple with the StartedAt field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetStartedAt - -`func (o *FreeActorPricingInfo) SetStartedAt(v time.Time)` - -SetStartedAt sets StartedAt field to given value. - - -### GetNotifiedAboutFutureChangeAt - -`func (o *FreeActorPricingInfo) GetNotifiedAboutFutureChangeAt() time.Time` - -GetNotifiedAboutFutureChangeAt returns the NotifiedAboutFutureChangeAt field if non-nil, zero value otherwise. - -### GetNotifiedAboutFutureChangeAtOk - -`func (o *FreeActorPricingInfo) GetNotifiedAboutFutureChangeAtOk() (*time.Time, bool)` - -GetNotifiedAboutFutureChangeAtOk returns a tuple with the NotifiedAboutFutureChangeAt field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetNotifiedAboutFutureChangeAt - -`func (o *FreeActorPricingInfo) SetNotifiedAboutFutureChangeAt(v time.Time)` - -SetNotifiedAboutFutureChangeAt sets NotifiedAboutFutureChangeAt field to given value. - -### HasNotifiedAboutFutureChangeAt - -`func (o *FreeActorPricingInfo) HasNotifiedAboutFutureChangeAt() bool` - -HasNotifiedAboutFutureChangeAt returns a boolean if a field has been set. - -### GetNotifiedAboutChangeAt - -`func (o *FreeActorPricingInfo) GetNotifiedAboutChangeAt() time.Time` - -GetNotifiedAboutChangeAt returns the NotifiedAboutChangeAt field if non-nil, zero value otherwise. - -### GetNotifiedAboutChangeAtOk - -`func (o *FreeActorPricingInfo) GetNotifiedAboutChangeAtOk() (*time.Time, bool)` - -GetNotifiedAboutChangeAtOk returns a tuple with the NotifiedAboutChangeAt field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetNotifiedAboutChangeAt - -`func (o *FreeActorPricingInfo) SetNotifiedAboutChangeAt(v time.Time)` - -SetNotifiedAboutChangeAt sets NotifiedAboutChangeAt field to given value. - -### HasNotifiedAboutChangeAt - -`func (o *FreeActorPricingInfo) HasNotifiedAboutChangeAt() bool` - -HasNotifiedAboutChangeAt returns a boolean if a field has been set. - -### GetReasonForChange - -`func (o *FreeActorPricingInfo) GetReasonForChange() string` - -GetReasonForChange returns the ReasonForChange field if non-nil, zero value otherwise. - -### GetReasonForChangeOk - -`func (o *FreeActorPricingInfo) GetReasonForChangeOk() (*string, bool)` - -GetReasonForChangeOk returns a tuple with the ReasonForChange field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetReasonForChange - -`func (o *FreeActorPricingInfo) SetReasonForChange(v string)` - -SetReasonForChange sets ReasonForChange field to given value. - -### HasReasonForChange - -`func (o *FreeActorPricingInfo) HasReasonForChange() bool` - -HasReasonForChange returns a boolean if a field has been set. - -### GetIsPriceChangeNotificationSuppressed - -`func (o *FreeActorPricingInfo) GetIsPriceChangeNotificationSuppressed() bool` - -GetIsPriceChangeNotificationSuppressed returns the IsPriceChangeNotificationSuppressed field if non-nil, zero value otherwise. - -### GetIsPriceChangeNotificationSuppressedOk - -`func (o *FreeActorPricingInfo) GetIsPriceChangeNotificationSuppressedOk() (*bool, bool)` - -GetIsPriceChangeNotificationSuppressedOk returns a tuple with the IsPriceChangeNotificationSuppressed field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetIsPriceChangeNotificationSuppressed - -`func (o *FreeActorPricingInfo) SetIsPriceChangeNotificationSuppressed(v bool)` - -SetIsPriceChangeNotificationSuppressed sets IsPriceChangeNotificationSuppressed field to given value. - -### HasIsPriceChangeNotificationSuppressed - -`func (o *FreeActorPricingInfo) HasIsPriceChangeNotificationSuppressed() bool` - -HasIsPriceChangeNotificationSuppressed returns a boolean if a field has been set. - -### GetForceContainsSignificantPriceChange - -`func (o *FreeActorPricingInfo) GetForceContainsSignificantPriceChange() bool` - -GetForceContainsSignificantPriceChange returns the ForceContainsSignificantPriceChange field if non-nil, zero value otherwise. - -### GetForceContainsSignificantPriceChangeOk - -`func (o *FreeActorPricingInfo) GetForceContainsSignificantPriceChangeOk() (*bool, bool)` - -GetForceContainsSignificantPriceChangeOk returns a tuple with the ForceContainsSignificantPriceChange field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetForceContainsSignificantPriceChange - -`func (o *FreeActorPricingInfo) SetForceContainsSignificantPriceChange(v bool)` - -SetForceContainsSignificantPriceChange sets ForceContainsSignificantPriceChange field to given value. - -### HasForceContainsSignificantPriceChange - -`func (o *FreeActorPricingInfo) HasForceContainsSignificantPriceChange() bool` - -HasForceContainsSignificantPriceChange returns a boolean if a field has been set. - -### GetPricingModel - -`func (o *FreeActorPricingInfo) GetPricingModel() string` - -GetPricingModel returns the PricingModel field if non-nil, zero value otherwise. - -### GetPricingModelOk - -`func (o *FreeActorPricingInfo) GetPricingModelOk() (*string, bool)` - -GetPricingModelOk returns a tuple with the PricingModel field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetPricingModel - -`func (o *FreeActorPricingInfo) SetPricingModel(v string)` - -SetPricingModel sets PricingModel field to given value. - - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/GeneralAccess.md b/docs/GeneralAccess.md deleted file mode 100644 index 644386d..0000000 --- a/docs/GeneralAccess.md +++ /dev/null @@ -1,17 +0,0 @@ -# GeneralAccess - -## Enum - - -* `ANYONE_WITH_ID_CAN_READ` (value: `"ANYONE_WITH_ID_CAN_READ"`) - -* `ANYONE_WITH_NAME_CAN_READ` (value: `"ANYONE_WITH_NAME_CAN_READ"`) - -* `FOLLOW_USER_SETTING` (value: `"FOLLOW_USER_SETTING"`) - -* `RESTRICTED` (value: `"RESTRICTED"`) - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/HeadAndLockResponse.md b/docs/HeadAndLockResponse.md deleted file mode 100644 index 2306c09..0000000 --- a/docs/HeadAndLockResponse.md +++ /dev/null @@ -1,51 +0,0 @@ -# HeadAndLockResponse - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Data** | [**LockedRequestQueueHead**](LockedRequestQueueHead.md) | | - -## Methods - -### NewHeadAndLockResponse - -`func NewHeadAndLockResponse(data LockedRequestQueueHead, ) *HeadAndLockResponse` - -NewHeadAndLockResponse instantiates a new HeadAndLockResponse object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewHeadAndLockResponseWithDefaults - -`func NewHeadAndLockResponseWithDefaults() *HeadAndLockResponse` - -NewHeadAndLockResponseWithDefaults instantiates a new HeadAndLockResponse object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetData - -`func (o *HeadAndLockResponse) GetData() LockedRequestQueueHead` - -GetData returns the Data field if non-nil, zero value otherwise. - -### GetDataOk - -`func (o *HeadAndLockResponse) GetDataOk() (*LockedRequestQueueHead, bool)` - -GetDataOk returns a tuple with the Data field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetData - -`func (o *HeadAndLockResponse) SetData(v LockedRequestQueueHead)` - -SetData sets Data field to given value. - - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/HeadRequest.md b/docs/HeadRequest.md deleted file mode 100644 index f5446cf..0000000 --- a/docs/HeadRequest.md +++ /dev/null @@ -1,145 +0,0 @@ -# HeadRequest - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Id** | **string** | A unique identifier assigned to the request. | -**UniqueKey** | **string** | A unique key used for request de-duplication. Requests with the same unique key are considered identical. | -**Url** | **string** | The URL of the request. | -**Method** | Pointer to [**HttpMethod**](HttpMethod.md) | | [optional] -**RetryCount** | Pointer to **int32** | The number of times this request has been retried. | [optional] - -## Methods - -### NewHeadRequest - -`func NewHeadRequest(id string, uniqueKey string, url string, ) *HeadRequest` - -NewHeadRequest instantiates a new HeadRequest object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewHeadRequestWithDefaults - -`func NewHeadRequestWithDefaults() *HeadRequest` - -NewHeadRequestWithDefaults instantiates a new HeadRequest object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetId - -`func (o *HeadRequest) GetId() string` - -GetId returns the Id field if non-nil, zero value otherwise. - -### GetIdOk - -`func (o *HeadRequest) GetIdOk() (*string, bool)` - -GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetId - -`func (o *HeadRequest) SetId(v string)` - -SetId sets Id field to given value. - - -### GetUniqueKey - -`func (o *HeadRequest) GetUniqueKey() string` - -GetUniqueKey returns the UniqueKey field if non-nil, zero value otherwise. - -### GetUniqueKeyOk - -`func (o *HeadRequest) GetUniqueKeyOk() (*string, bool)` - -GetUniqueKeyOk returns a tuple with the UniqueKey field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetUniqueKey - -`func (o *HeadRequest) SetUniqueKey(v string)` - -SetUniqueKey sets UniqueKey field to given value. - - -### GetUrl - -`func (o *HeadRequest) GetUrl() string` - -GetUrl returns the Url field if non-nil, zero value otherwise. - -### GetUrlOk - -`func (o *HeadRequest) GetUrlOk() (*string, bool)` - -GetUrlOk returns a tuple with the Url field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetUrl - -`func (o *HeadRequest) SetUrl(v string)` - -SetUrl sets Url field to given value. - - -### GetMethod - -`func (o *HeadRequest) GetMethod() HttpMethod` - -GetMethod returns the Method field if non-nil, zero value otherwise. - -### GetMethodOk - -`func (o *HeadRequest) GetMethodOk() (*HttpMethod, bool)` - -GetMethodOk returns a tuple with the Method field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetMethod - -`func (o *HeadRequest) SetMethod(v HttpMethod)` - -SetMethod sets Method field to given value. - -### HasMethod - -`func (o *HeadRequest) HasMethod() bool` - -HasMethod returns a boolean if a field has been set. - -### GetRetryCount - -`func (o *HeadRequest) GetRetryCount() int32` - -GetRetryCount returns the RetryCount field if non-nil, zero value otherwise. - -### GetRetryCountOk - -`func (o *HeadRequest) GetRetryCountOk() (*int32, bool)` - -GetRetryCountOk returns a tuple with the RetryCount field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetRetryCount - -`func (o *HeadRequest) SetRetryCount(v int32)` - -SetRetryCount sets RetryCount field to given value. - -### HasRetryCount - -`func (o *HeadRequest) HasRetryCount() bool` - -HasRetryCount returns a boolean if a field has been set. - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/HeadResponse.md b/docs/HeadResponse.md deleted file mode 100644 index 09c6162..0000000 --- a/docs/HeadResponse.md +++ /dev/null @@ -1,51 +0,0 @@ -# HeadResponse - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Data** | [**RequestQueueHead**](RequestQueueHead.md) | | - -## Methods - -### NewHeadResponse - -`func NewHeadResponse(data RequestQueueHead, ) *HeadResponse` - -NewHeadResponse instantiates a new HeadResponse object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewHeadResponseWithDefaults - -`func NewHeadResponseWithDefaults() *HeadResponse` - -NewHeadResponseWithDefaults instantiates a new HeadResponse object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetData - -`func (o *HeadResponse) GetData() RequestQueueHead` - -GetData returns the Data field if non-nil, zero value otherwise. - -### GetDataOk - -`func (o *HeadResponse) GetDataOk() (*RequestQueueHead, bool)` - -GetDataOk returns a tuple with the Data field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetData - -`func (o *HeadResponse) SetData(v RequestQueueHead)` - -SetData sets Data field to given value. - - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/HttpMethod.md b/docs/HttpMethod.md deleted file mode 100644 index edae44c..0000000 --- a/docs/HttpMethod.md +++ /dev/null @@ -1,27 +0,0 @@ -# HttpMethod - -## Enum - - -* `GET` (value: `"GET"`) - -* `HEAD` (value: `"HEAD"`) - -* `POST` (value: `"POST"`) - -* `PUT` (value: `"PUT"`) - -* `DELETE` (value: `"DELETE"`) - -* `CONNECT` (value: `"CONNECT"`) - -* `OPTIONS` (value: `"OPTIONS"`) - -* `TRACE` (value: `"TRACE"`) - -* `PATCH` (value: `"PATCH"`) - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/InvalidItem.md b/docs/InvalidItem.md deleted file mode 100644 index 95f6d6d..0000000 --- a/docs/InvalidItem.md +++ /dev/null @@ -1,82 +0,0 @@ -# InvalidItem - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**ItemPosition** | Pointer to **int32** | The position of the invalid item in the array. | [optional] -**ValidationErrors** | Pointer to [**[]ValidationError**](ValidationError.md) | A complete list of AJV validation error objects for the invalid item. | [optional] - -## Methods - -### NewInvalidItem - -`func NewInvalidItem() *InvalidItem` - -NewInvalidItem instantiates a new InvalidItem object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewInvalidItemWithDefaults - -`func NewInvalidItemWithDefaults() *InvalidItem` - -NewInvalidItemWithDefaults instantiates a new InvalidItem object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetItemPosition - -`func (o *InvalidItem) GetItemPosition() int32` - -GetItemPosition returns the ItemPosition field if non-nil, zero value otherwise. - -### GetItemPositionOk - -`func (o *InvalidItem) GetItemPositionOk() (*int32, bool)` - -GetItemPositionOk returns a tuple with the ItemPosition field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetItemPosition - -`func (o *InvalidItem) SetItemPosition(v int32)` - -SetItemPosition sets ItemPosition field to given value. - -### HasItemPosition - -`func (o *InvalidItem) HasItemPosition() bool` - -HasItemPosition returns a boolean if a field has been set. - -### GetValidationErrors - -`func (o *InvalidItem) GetValidationErrors() []ValidationError` - -GetValidationErrors returns the ValidationErrors field if non-nil, zero value otherwise. - -### GetValidationErrorsOk - -`func (o *InvalidItem) GetValidationErrorsOk() (*[]ValidationError, bool)` - -GetValidationErrorsOk returns a tuple with the ValidationErrors field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetValidationErrors - -`func (o *InvalidItem) SetValidationErrors(v []ValidationError)` - -SetValidationErrors sets ValidationErrors field to given value. - -### HasValidationErrors - -`func (o *InvalidItem) HasValidationErrors() bool` - -HasValidationErrors returns a boolean if a field has been set. - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/KeyValueStore.md b/docs/KeyValueStore.md deleted file mode 100644 index 2d09628..0000000 --- a/docs/KeyValueStore.md +++ /dev/null @@ -1,496 +0,0 @@ -# KeyValueStore - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Id** | **string** | | -**Name** | Pointer to **NullableString** | | [optional] -**UserId** | Pointer to **NullableString** | | [optional] -**Username** | Pointer to **NullableString** | | [optional] -**CreatedAt** | **time.Time** | | -**ModifiedAt** | **time.Time** | | -**AccessedAt** | **time.Time** | | -**ActId** | Pointer to **NullableString** | | [optional] -**ActRunId** | Pointer to **NullableString** | | [optional] -**ConsoleUrl** | Pointer to **string** | | [optional] -**KeysPublicUrl** | Pointer to **string** | A public link to access keys of the key-value store directly. | [optional] -**RecordsPublicUrl** | Pointer to **string** | A public link to access records of the key-value store directly. | [optional] -**Schema** | Pointer to **map[string]interface{}** | Optional JSON schema describing the keys stored in the key-value store. | [optional] -**UrlSigningSecretKey** | Pointer to **NullableString** | A secret key for generating signed public URLs. It is only provided to clients with WRITE permission for the key-value store. | [optional] -**GeneralAccess** | Pointer to [**GeneralAccess**](GeneralAccess.md) | | [optional] -**Stats** | Pointer to [**KeyValueStoreStats**](KeyValueStoreStats.md) | | [optional] - -## Methods - -### NewKeyValueStore - -`func NewKeyValueStore(id string, createdAt time.Time, modifiedAt time.Time, accessedAt time.Time, ) *KeyValueStore` - -NewKeyValueStore instantiates a new KeyValueStore object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewKeyValueStoreWithDefaults - -`func NewKeyValueStoreWithDefaults() *KeyValueStore` - -NewKeyValueStoreWithDefaults instantiates a new KeyValueStore object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetId - -`func (o *KeyValueStore) GetId() string` - -GetId returns the Id field if non-nil, zero value otherwise. - -### GetIdOk - -`func (o *KeyValueStore) GetIdOk() (*string, bool)` - -GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetId - -`func (o *KeyValueStore) SetId(v string)` - -SetId sets Id field to given value. - - -### GetName - -`func (o *KeyValueStore) GetName() string` - -GetName returns the Name field if non-nil, zero value otherwise. - -### GetNameOk - -`func (o *KeyValueStore) GetNameOk() (*string, bool)` - -GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetName - -`func (o *KeyValueStore) SetName(v string)` - -SetName sets Name field to given value. - -### HasName - -`func (o *KeyValueStore) HasName() bool` - -HasName returns a boolean if a field has been set. - -### SetNameNil - -`func (o *KeyValueStore) SetNameNil(b bool)` - - SetNameNil sets the value for Name to be an explicit nil - -### UnsetName -`func (o *KeyValueStore) UnsetName()` - -UnsetName ensures that no value is present for Name, not even an explicit nil -### GetUserId - -`func (o *KeyValueStore) GetUserId() string` - -GetUserId returns the UserId field if non-nil, zero value otherwise. - -### GetUserIdOk - -`func (o *KeyValueStore) GetUserIdOk() (*string, bool)` - -GetUserIdOk returns a tuple with the UserId field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetUserId - -`func (o *KeyValueStore) SetUserId(v string)` - -SetUserId sets UserId field to given value. - -### HasUserId - -`func (o *KeyValueStore) HasUserId() bool` - -HasUserId returns a boolean if a field has been set. - -### SetUserIdNil - -`func (o *KeyValueStore) SetUserIdNil(b bool)` - - SetUserIdNil sets the value for UserId to be an explicit nil - -### UnsetUserId -`func (o *KeyValueStore) UnsetUserId()` - -UnsetUserId ensures that no value is present for UserId, not even an explicit nil -### GetUsername - -`func (o *KeyValueStore) GetUsername() string` - -GetUsername returns the Username field if non-nil, zero value otherwise. - -### GetUsernameOk - -`func (o *KeyValueStore) GetUsernameOk() (*string, bool)` - -GetUsernameOk returns a tuple with the Username field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetUsername - -`func (o *KeyValueStore) SetUsername(v string)` - -SetUsername sets Username field to given value. - -### HasUsername - -`func (o *KeyValueStore) HasUsername() bool` - -HasUsername returns a boolean if a field has been set. - -### SetUsernameNil - -`func (o *KeyValueStore) SetUsernameNil(b bool)` - - SetUsernameNil sets the value for Username to be an explicit nil - -### UnsetUsername -`func (o *KeyValueStore) UnsetUsername()` - -UnsetUsername ensures that no value is present for Username, not even an explicit nil -### GetCreatedAt - -`func (o *KeyValueStore) GetCreatedAt() time.Time` - -GetCreatedAt returns the CreatedAt field if non-nil, zero value otherwise. - -### GetCreatedAtOk - -`func (o *KeyValueStore) GetCreatedAtOk() (*time.Time, bool)` - -GetCreatedAtOk returns a tuple with the CreatedAt field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetCreatedAt - -`func (o *KeyValueStore) SetCreatedAt(v time.Time)` - -SetCreatedAt sets CreatedAt field to given value. - - -### GetModifiedAt - -`func (o *KeyValueStore) GetModifiedAt() time.Time` - -GetModifiedAt returns the ModifiedAt field if non-nil, zero value otherwise. - -### GetModifiedAtOk - -`func (o *KeyValueStore) GetModifiedAtOk() (*time.Time, bool)` - -GetModifiedAtOk returns a tuple with the ModifiedAt field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetModifiedAt - -`func (o *KeyValueStore) SetModifiedAt(v time.Time)` - -SetModifiedAt sets ModifiedAt field to given value. - - -### GetAccessedAt - -`func (o *KeyValueStore) GetAccessedAt() time.Time` - -GetAccessedAt returns the AccessedAt field if non-nil, zero value otherwise. - -### GetAccessedAtOk - -`func (o *KeyValueStore) GetAccessedAtOk() (*time.Time, bool)` - -GetAccessedAtOk returns a tuple with the AccessedAt field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetAccessedAt - -`func (o *KeyValueStore) SetAccessedAt(v time.Time)` - -SetAccessedAt sets AccessedAt field to given value. - - -### GetActId - -`func (o *KeyValueStore) GetActId() string` - -GetActId returns the ActId field if non-nil, zero value otherwise. - -### GetActIdOk - -`func (o *KeyValueStore) GetActIdOk() (*string, bool)` - -GetActIdOk returns a tuple with the ActId field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetActId - -`func (o *KeyValueStore) SetActId(v string)` - -SetActId sets ActId field to given value. - -### HasActId - -`func (o *KeyValueStore) HasActId() bool` - -HasActId returns a boolean if a field has been set. - -### SetActIdNil - -`func (o *KeyValueStore) SetActIdNil(b bool)` - - SetActIdNil sets the value for ActId to be an explicit nil - -### UnsetActId -`func (o *KeyValueStore) UnsetActId()` - -UnsetActId ensures that no value is present for ActId, not even an explicit nil -### GetActRunId - -`func (o *KeyValueStore) GetActRunId() string` - -GetActRunId returns the ActRunId field if non-nil, zero value otherwise. - -### GetActRunIdOk - -`func (o *KeyValueStore) GetActRunIdOk() (*string, bool)` - -GetActRunIdOk returns a tuple with the ActRunId field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetActRunId - -`func (o *KeyValueStore) SetActRunId(v string)` - -SetActRunId sets ActRunId field to given value. - -### HasActRunId - -`func (o *KeyValueStore) HasActRunId() bool` - -HasActRunId returns a boolean if a field has been set. - -### SetActRunIdNil - -`func (o *KeyValueStore) SetActRunIdNil(b bool)` - - SetActRunIdNil sets the value for ActRunId to be an explicit nil - -### UnsetActRunId -`func (o *KeyValueStore) UnsetActRunId()` - -UnsetActRunId ensures that no value is present for ActRunId, not even an explicit nil -### GetConsoleUrl - -`func (o *KeyValueStore) GetConsoleUrl() string` - -GetConsoleUrl returns the ConsoleUrl field if non-nil, zero value otherwise. - -### GetConsoleUrlOk - -`func (o *KeyValueStore) GetConsoleUrlOk() (*string, bool)` - -GetConsoleUrlOk returns a tuple with the ConsoleUrl field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetConsoleUrl - -`func (o *KeyValueStore) SetConsoleUrl(v string)` - -SetConsoleUrl sets ConsoleUrl field to given value. - -### HasConsoleUrl - -`func (o *KeyValueStore) HasConsoleUrl() bool` - -HasConsoleUrl returns a boolean if a field has been set. - -### GetKeysPublicUrl - -`func (o *KeyValueStore) GetKeysPublicUrl() string` - -GetKeysPublicUrl returns the KeysPublicUrl field if non-nil, zero value otherwise. - -### GetKeysPublicUrlOk - -`func (o *KeyValueStore) GetKeysPublicUrlOk() (*string, bool)` - -GetKeysPublicUrlOk returns a tuple with the KeysPublicUrl field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetKeysPublicUrl - -`func (o *KeyValueStore) SetKeysPublicUrl(v string)` - -SetKeysPublicUrl sets KeysPublicUrl field to given value. - -### HasKeysPublicUrl - -`func (o *KeyValueStore) HasKeysPublicUrl() bool` - -HasKeysPublicUrl returns a boolean if a field has been set. - -### GetRecordsPublicUrl - -`func (o *KeyValueStore) GetRecordsPublicUrl() string` - -GetRecordsPublicUrl returns the RecordsPublicUrl field if non-nil, zero value otherwise. - -### GetRecordsPublicUrlOk - -`func (o *KeyValueStore) GetRecordsPublicUrlOk() (*string, bool)` - -GetRecordsPublicUrlOk returns a tuple with the RecordsPublicUrl field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetRecordsPublicUrl - -`func (o *KeyValueStore) SetRecordsPublicUrl(v string)` - -SetRecordsPublicUrl sets RecordsPublicUrl field to given value. - -### HasRecordsPublicUrl - -`func (o *KeyValueStore) HasRecordsPublicUrl() bool` - -HasRecordsPublicUrl returns a boolean if a field has been set. - -### GetSchema - -`func (o *KeyValueStore) GetSchema() map[string]interface{}` - -GetSchema returns the Schema field if non-nil, zero value otherwise. - -### GetSchemaOk - -`func (o *KeyValueStore) GetSchemaOk() (*map[string]interface{}, bool)` - -GetSchemaOk returns a tuple with the Schema field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetSchema - -`func (o *KeyValueStore) SetSchema(v map[string]interface{})` - -SetSchema sets Schema field to given value. - -### HasSchema - -`func (o *KeyValueStore) HasSchema() bool` - -HasSchema returns a boolean if a field has been set. - -### SetSchemaNil - -`func (o *KeyValueStore) SetSchemaNil(b bool)` - - SetSchemaNil sets the value for Schema to be an explicit nil - -### UnsetSchema -`func (o *KeyValueStore) UnsetSchema()` - -UnsetSchema ensures that no value is present for Schema, not even an explicit nil -### GetUrlSigningSecretKey - -`func (o *KeyValueStore) GetUrlSigningSecretKey() string` - -GetUrlSigningSecretKey returns the UrlSigningSecretKey field if non-nil, zero value otherwise. - -### GetUrlSigningSecretKeyOk - -`func (o *KeyValueStore) GetUrlSigningSecretKeyOk() (*string, bool)` - -GetUrlSigningSecretKeyOk returns a tuple with the UrlSigningSecretKey field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetUrlSigningSecretKey - -`func (o *KeyValueStore) SetUrlSigningSecretKey(v string)` - -SetUrlSigningSecretKey sets UrlSigningSecretKey field to given value. - -### HasUrlSigningSecretKey - -`func (o *KeyValueStore) HasUrlSigningSecretKey() bool` - -HasUrlSigningSecretKey returns a boolean if a field has been set. - -### SetUrlSigningSecretKeyNil - -`func (o *KeyValueStore) SetUrlSigningSecretKeyNil(b bool)` - - SetUrlSigningSecretKeyNil sets the value for UrlSigningSecretKey to be an explicit nil - -### UnsetUrlSigningSecretKey -`func (o *KeyValueStore) UnsetUrlSigningSecretKey()` - -UnsetUrlSigningSecretKey ensures that no value is present for UrlSigningSecretKey, not even an explicit nil -### GetGeneralAccess - -`func (o *KeyValueStore) GetGeneralAccess() GeneralAccess` - -GetGeneralAccess returns the GeneralAccess field if non-nil, zero value otherwise. - -### GetGeneralAccessOk - -`func (o *KeyValueStore) GetGeneralAccessOk() (*GeneralAccess, bool)` - -GetGeneralAccessOk returns a tuple with the GeneralAccess field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetGeneralAccess - -`func (o *KeyValueStore) SetGeneralAccess(v GeneralAccess)` - -SetGeneralAccess sets GeneralAccess field to given value. - -### HasGeneralAccess - -`func (o *KeyValueStore) HasGeneralAccess() bool` - -HasGeneralAccess returns a boolean if a field has been set. - -### GetStats - -`func (o *KeyValueStore) GetStats() KeyValueStoreStats` - -GetStats returns the Stats field if non-nil, zero value otherwise. - -### GetStatsOk - -`func (o *KeyValueStore) GetStatsOk() (*KeyValueStoreStats, bool)` - -GetStatsOk returns a tuple with the Stats field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetStats - -`func (o *KeyValueStore) SetStats(v KeyValueStoreStats)` - -SetStats sets Stats field to given value. - -### HasStats - -`func (o *KeyValueStore) HasStats() bool` - -HasStats returns a boolean if a field has been set. - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/KeyValueStoreKey.md b/docs/KeyValueStoreKey.md deleted file mode 100644 index dedb214..0000000 --- a/docs/KeyValueStoreKey.md +++ /dev/null @@ -1,93 +0,0 @@ -# KeyValueStoreKey - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Key** | **string** | | -**Size** | **int32** | | -**RecordPublicUrl** | **string** | A public link to access this record directly. | - -## Methods - -### NewKeyValueStoreKey - -`func NewKeyValueStoreKey(key string, size int32, recordPublicUrl string, ) *KeyValueStoreKey` - -NewKeyValueStoreKey instantiates a new KeyValueStoreKey object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewKeyValueStoreKeyWithDefaults - -`func NewKeyValueStoreKeyWithDefaults() *KeyValueStoreKey` - -NewKeyValueStoreKeyWithDefaults instantiates a new KeyValueStoreKey object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetKey - -`func (o *KeyValueStoreKey) GetKey() string` - -GetKey returns the Key field if non-nil, zero value otherwise. - -### GetKeyOk - -`func (o *KeyValueStoreKey) GetKeyOk() (*string, bool)` - -GetKeyOk returns a tuple with the Key field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetKey - -`func (o *KeyValueStoreKey) SetKey(v string)` - -SetKey sets Key field to given value. - - -### GetSize - -`func (o *KeyValueStoreKey) GetSize() int32` - -GetSize returns the Size field if non-nil, zero value otherwise. - -### GetSizeOk - -`func (o *KeyValueStoreKey) GetSizeOk() (*int32, bool)` - -GetSizeOk returns a tuple with the Size field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetSize - -`func (o *KeyValueStoreKey) SetSize(v int32)` - -SetSize sets Size field to given value. - - -### GetRecordPublicUrl - -`func (o *KeyValueStoreKey) GetRecordPublicUrl() string` - -GetRecordPublicUrl returns the RecordPublicUrl field if non-nil, zero value otherwise. - -### GetRecordPublicUrlOk - -`func (o *KeyValueStoreKey) GetRecordPublicUrlOk() (*string, bool)` - -GetRecordPublicUrlOk returns a tuple with the RecordPublicUrl field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetRecordPublicUrl - -`func (o *KeyValueStoreKey) SetRecordPublicUrl(v string)` - -SetRecordPublicUrl sets RecordPublicUrl field to given value. - - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/KeyValueStoreResponse.md b/docs/KeyValueStoreResponse.md deleted file mode 100644 index 403c3d6..0000000 --- a/docs/KeyValueStoreResponse.md +++ /dev/null @@ -1,51 +0,0 @@ -# KeyValueStoreResponse - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Data** | [**KeyValueStore**](KeyValueStore.md) | | - -## Methods - -### NewKeyValueStoreResponse - -`func NewKeyValueStoreResponse(data KeyValueStore, ) *KeyValueStoreResponse` - -NewKeyValueStoreResponse instantiates a new KeyValueStoreResponse object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewKeyValueStoreResponseWithDefaults - -`func NewKeyValueStoreResponseWithDefaults() *KeyValueStoreResponse` - -NewKeyValueStoreResponseWithDefaults instantiates a new KeyValueStoreResponse object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetData - -`func (o *KeyValueStoreResponse) GetData() KeyValueStore` - -GetData returns the Data field if non-nil, zero value otherwise. - -### GetDataOk - -`func (o *KeyValueStoreResponse) GetDataOk() (*KeyValueStore, bool)` - -GetDataOk returns a tuple with the Data field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetData - -`func (o *KeyValueStoreResponse) SetData(v KeyValueStore)` - -SetData sets Data field to given value. - - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/KeyValueStoreStats.md b/docs/KeyValueStoreStats.md deleted file mode 100644 index 186f59f..0000000 --- a/docs/KeyValueStoreStats.md +++ /dev/null @@ -1,166 +0,0 @@ -# KeyValueStoreStats - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**ReadCount** | **int32** | | -**WriteCount** | **int32** | | -**DeleteCount** | **int32** | | -**ListCount** | **int32** | | -**S3StorageBytes** | Pointer to **int32** | | [optional] -**StorageBytes** | Pointer to **int32** | | [optional] - -## Methods - -### NewKeyValueStoreStats - -`func NewKeyValueStoreStats(readCount int32, writeCount int32, deleteCount int32, listCount int32, ) *KeyValueStoreStats` - -NewKeyValueStoreStats instantiates a new KeyValueStoreStats object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewKeyValueStoreStatsWithDefaults - -`func NewKeyValueStoreStatsWithDefaults() *KeyValueStoreStats` - -NewKeyValueStoreStatsWithDefaults instantiates a new KeyValueStoreStats object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetReadCount - -`func (o *KeyValueStoreStats) GetReadCount() int32` - -GetReadCount returns the ReadCount field if non-nil, zero value otherwise. - -### GetReadCountOk - -`func (o *KeyValueStoreStats) GetReadCountOk() (*int32, bool)` - -GetReadCountOk returns a tuple with the ReadCount field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetReadCount - -`func (o *KeyValueStoreStats) SetReadCount(v int32)` - -SetReadCount sets ReadCount field to given value. - - -### GetWriteCount - -`func (o *KeyValueStoreStats) GetWriteCount() int32` - -GetWriteCount returns the WriteCount field if non-nil, zero value otherwise. - -### GetWriteCountOk - -`func (o *KeyValueStoreStats) GetWriteCountOk() (*int32, bool)` - -GetWriteCountOk returns a tuple with the WriteCount field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetWriteCount - -`func (o *KeyValueStoreStats) SetWriteCount(v int32)` - -SetWriteCount sets WriteCount field to given value. - - -### GetDeleteCount - -`func (o *KeyValueStoreStats) GetDeleteCount() int32` - -GetDeleteCount returns the DeleteCount field if non-nil, zero value otherwise. - -### GetDeleteCountOk - -`func (o *KeyValueStoreStats) GetDeleteCountOk() (*int32, bool)` - -GetDeleteCountOk returns a tuple with the DeleteCount field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetDeleteCount - -`func (o *KeyValueStoreStats) SetDeleteCount(v int32)` - -SetDeleteCount sets DeleteCount field to given value. - - -### GetListCount - -`func (o *KeyValueStoreStats) GetListCount() int32` - -GetListCount returns the ListCount field if non-nil, zero value otherwise. - -### GetListCountOk - -`func (o *KeyValueStoreStats) GetListCountOk() (*int32, bool)` - -GetListCountOk returns a tuple with the ListCount field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetListCount - -`func (o *KeyValueStoreStats) SetListCount(v int32)` - -SetListCount sets ListCount field to given value. - - -### GetS3StorageBytes - -`func (o *KeyValueStoreStats) GetS3StorageBytes() int32` - -GetS3StorageBytes returns the S3StorageBytes field if non-nil, zero value otherwise. - -### GetS3StorageBytesOk - -`func (o *KeyValueStoreStats) GetS3StorageBytesOk() (*int32, bool)` - -GetS3StorageBytesOk returns a tuple with the S3StorageBytes field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetS3StorageBytes - -`func (o *KeyValueStoreStats) SetS3StorageBytes(v int32)` - -SetS3StorageBytes sets S3StorageBytes field to given value. - -### HasS3StorageBytes - -`func (o *KeyValueStoreStats) HasS3StorageBytes() bool` - -HasS3StorageBytes returns a boolean if a field has been set. - -### GetStorageBytes - -`func (o *KeyValueStoreStats) GetStorageBytes() int32` - -GetStorageBytes returns the StorageBytes field if non-nil, zero value otherwise. - -### GetStorageBytesOk - -`func (o *KeyValueStoreStats) GetStorageBytesOk() (*int32, bool)` - -GetStorageBytesOk returns a tuple with the StorageBytes field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetStorageBytes - -`func (o *KeyValueStoreStats) SetStorageBytes(v int32)` - -SetStorageBytes sets StorageBytes field to given value. - -### HasStorageBytes - -`func (o *KeyValueStoreStats) HasStorageBytes() bool` - -HasStorageBytes returns a boolean if a field has been set. - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/LastActorRunsAbortAPI.md b/docs/LastActorRunsAbortAPI.md deleted file mode 100644 index 6373ab0..0000000 --- a/docs/LastActorRunsAbortAPI.md +++ /dev/null @@ -1,83 +0,0 @@ -# \LastActorRunsAbortAPI - -All URIs are relative to *https://api.apify.com* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**ActRunsLastAbortPost**](LastActorRunsAbortAPI.md#ActRunsLastAbortPost) | **Post** /v2/actors/{actorId}/runs/last/abort | Abort Actor's last run - - - -## ActRunsLastAbortPost - -> RunResponse ActRunsLastAbortPost(ctx, actorId).Status(status).Gracefully(gracefully).Execute() - -Abort Actor's last run - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - actorId := "janedoe~my-actor" // string | Actor ID or a tilde-separated owner's username and Actor name. - status := "SUCCEEDED" // string | Filter for the run status. (optional) - gracefully := true // bool | If true passed, the Actor run will abort gracefully. It will send `aborting` and `persistState` event into run and force-stop the run after 30 seconds. It is helpful in cases where you plan to resurrect the run later. (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.LastActorRunsAbortAPI.ActRunsLastAbortPost(context.Background(), actorId).Status(status).Gracefully(gracefully).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `LastActorRunsAbortAPI.ActRunsLastAbortPost``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `ActRunsLastAbortPost`: RunResponse - fmt.Fprintf(os.Stdout, "Response from `LastActorRunsAbortAPI.ActRunsLastAbortPost`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**actorId** | **string** | Actor ID or a tilde-separated owner's username and Actor name. | - -### Other Parameters - -Other parameters are passed through a pointer to a apiActRunsLastAbortPostRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - **status** | **string** | Filter for the run status. | - **gracefully** | **bool** | If true passed, the Actor run will abort gracefully. It will send `aborting` and `persistState` event into run and force-stop the run after 30 seconds. It is helpful in cases where you plan to resurrect the run later. | - -### Return type - -[**RunResponse**](RunResponse.md) - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - diff --git a/docs/LastActorRunsDefaultDatasetAPI.md b/docs/LastActorRunsDefaultDatasetAPI.md deleted file mode 100644 index d2f659a..0000000 --- a/docs/LastActorRunsDefaultDatasetAPI.md +++ /dev/null @@ -1,496 +0,0 @@ -# \LastActorRunsDefaultDatasetAPI - -All URIs are relative to *https://api.apify.com* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**ActRunsLastDatasetDelete**](LastActorRunsDefaultDatasetAPI.md#ActRunsLastDatasetDelete) | **Delete** /v2/actors/{actorId}/runs/last/dataset | Delete last run's default dataset -[**ActRunsLastDatasetGet**](LastActorRunsDefaultDatasetAPI.md#ActRunsLastDatasetGet) | **Get** /v2/actors/{actorId}/runs/last/dataset | Get last run's default dataset -[**ActRunsLastDatasetItemsGet**](LastActorRunsDefaultDatasetAPI.md#ActRunsLastDatasetItemsGet) | **Get** /v2/actors/{actorId}/runs/last/dataset/items | Get last run's dataset items -[**ActRunsLastDatasetItemsPost**](LastActorRunsDefaultDatasetAPI.md#ActRunsLastDatasetItemsPost) | **Post** /v2/actors/{actorId}/runs/last/dataset/items | Store items in last run's dataset -[**ActRunsLastDatasetPut**](LastActorRunsDefaultDatasetAPI.md#ActRunsLastDatasetPut) | **Put** /v2/actors/{actorId}/runs/last/dataset | Update last run's default dataset -[**ActRunsLastDatasetStatisticsGet**](LastActorRunsDefaultDatasetAPI.md#ActRunsLastDatasetStatisticsGet) | **Get** /v2/actors/{actorId}/runs/last/dataset/statistics | Get last run's dataset statistics - - - -## ActRunsLastDatasetDelete - -> ActRunsLastDatasetDelete(ctx, actorId).Status(status).Execute() - -Delete last run's default dataset - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - actorId := "janedoe~my-actor" // string | Actor ID or a tilde-separated owner's username and Actor name. - status := "SUCCEEDED" // string | Filter for the run status. (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - r, err := apiClient.LastActorRunsDefaultDatasetAPI.ActRunsLastDatasetDelete(context.Background(), actorId).Status(status).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `LastActorRunsDefaultDatasetAPI.ActRunsLastDatasetDelete``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**actorId** | **string** | Actor ID or a tilde-separated owner's username and Actor name. | - -### Other Parameters - -Other parameters are passed through a pointer to a apiActRunsLastDatasetDeleteRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - **status** | **string** | Filter for the run status. | - -### Return type - - (empty response body) - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## ActRunsLastDatasetGet - -> DatasetResponse ActRunsLastDatasetGet(ctx, actorId).Status(status).Execute() - -Get last run's default dataset - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - actorId := "janedoe~my-actor" // string | Actor ID or a tilde-separated owner's username and Actor name. - status := "SUCCEEDED" // string | Filter for the run status. (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.LastActorRunsDefaultDatasetAPI.ActRunsLastDatasetGet(context.Background(), actorId).Status(status).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `LastActorRunsDefaultDatasetAPI.ActRunsLastDatasetGet``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `ActRunsLastDatasetGet`: DatasetResponse - fmt.Fprintf(os.Stdout, "Response from `LastActorRunsDefaultDatasetAPI.ActRunsLastDatasetGet`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**actorId** | **string** | Actor ID or a tilde-separated owner's username and Actor name. | - -### Other Parameters - -Other parameters are passed through a pointer to a apiActRunsLastDatasetGetRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - **status** | **string** | Filter for the run status. | - -### Return type - -[**DatasetResponse**](DatasetResponse.md) - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## ActRunsLastDatasetItemsGet - -> []map[string]interface{} ActRunsLastDatasetItemsGet(ctx, actorId).Status(status).Format(format).Clean(clean).Offset(offset).Limit(limit).Fields(fields).OutputFields(outputFields).Omit(omit).Unwind(unwind).Flatten(flatten).Desc(desc).Attachment(attachment).Delimiter(delimiter).Bom(bom).XmlRoot(xmlRoot).XmlRow(xmlRow).SkipHeaderRow(skipHeaderRow).SkipHidden(skipHidden).SkipEmpty(skipEmpty).Simplified(simplified).View(view).SkipFailedPages(skipFailedPages).FeedTitle(feedTitle).FeedDescription(feedDescription).Signature(signature).Execute() - -Get last run's dataset items - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - actorId := "janedoe~my-actor" // string | Actor ID or a tilde-separated owner's username and Actor name. - status := "SUCCEEDED" // string | Filter for the run status. (optional) - format := "json" // string | Format of the results, possible values are: `json`, `jsonl`, `csv`, `html`, `xlsx`, `xml` and `rss`. The default value is `json`. (optional) - clean := false // bool | If `true` or `1` then the API endpoint returns only non-empty items and skips hidden fields (i.e. fields starting with the # character). The `clean` parameter is just a shortcut for `skipHidden=true` and `skipEmpty=true` parameters. Note that since some objects might be skipped from the output, that the result might contain less items than the `limit` value. (optional) - offset := float64(0) // float64 | Number of items that should be skipped at the start. The default value is `0`. (optional) - limit := float64(1.2) // float64 | Maximum number of items to return. By default there is no limit. (optional) - fields := "myValue,myOtherValue" // string | A comma-separated list of fields which should be picked from the items, only these fields will remain in the resulting record objects. Note that the fields in the outputted items are sorted the same way as they are specified in the `fields` query parameter. You can use this feature to effectively fix the output format. (optional) - outputFields := "title,link" // string | A comma-separated list of output field names that positionally rename the fields specified in the `fields` parameter. For example, `?fields=headline,url&outputFields=title,link` renames `headline` to `title` and `url` to `link` in the output. The number of names in `outputFields` must match the number of names in `fields`. Requires the `fields` parameter to be specified as well. (optional) - omit := "myValue,myOtherValue" // string | A comma-separated list of fields which should be omitted from the items. (optional) - unwind := "myValue,myOtherValue" // string | A comma-separated list of fields which should be unwound, in order which they should be processed. Each field should be either an array or an object. If the field is an array then every element of the array will become a separate record and merged with parent object. If the unwound field is an object then it is merged with the parent object. If the unwound field is missing or its value is neither an array nor an object and therefore cannot be merged with a parent object then the item gets preserved as it is. Note that the unwound items ignore the `desc` parameter. (optional) - flatten := "myValue" // string | A comma-separated list of fields which should transform nested objects into flat structures. For example, with `flatten=\"foo\"` the object `{\"foo\":{\"bar\": \"hello\"}}` is turned into `{\"foo.bar\": \"hello\"}`. The original object with properties is replaced with the flattened object. (optional) - desc := true // bool | By default, results are returned in the same order as they were stored. To reverse the order, set this parameter to `true` or `1`. (optional) - attachment := true // bool | If `true` or `1` then the response will define the `Content-Disposition: attachment` header, forcing a web browser to download the file rather than to display it. By default this header is not present. (optional) - delimiter := ";" // string | A delimiter character for CSV files, only used if `format=csv`. You might need to URL-encode the character (e.g. use `%09` for tab or `%3B` for semicolon). The default delimiter is a simple comma (`,`). (optional) - bom := false // bool | All text responses are encoded in UTF-8 encoding. By default, the `format=csv` files are prefixed with the UTF-8 Byte Order Mark (BOM), while `json`, `jsonl`, `xml`, `html` and `rss` files are not. If you want to override this default behavior, specify `bom=1` query parameter to include the BOM or `bom=0` to skip it. (optional) - xmlRoot := "items" // string | Overrides default root element name of `xml` output. By default the root element is `items`. (optional) - xmlRow := "item" // string | Overrides default element name that wraps each page or page function result object in `xml` output. By default the element name is `item`. (optional) - skipHeaderRow := true // bool | If `true` or `1` then header row in the `csv` format is skipped. (optional) - skipHidden := false // bool | If `true` or `1` then hidden fields are skipped from the output, i.e. fields starting with the `#` character. (optional) - skipEmpty := false // bool | If `true` or `1` then empty items are skipped from the output. Note that if used, the results might contain less items than the limit value. (optional) - simplified := false // bool | If `true` or `1` then, the endpoint applies the `fields=url,pageFunctionResult,errorInfo` and `unwind=pageFunctionResult` query parameters. This feature is used to emulate simplified results provided by the legacy Apify Crawler product and it's not recommended to use it in new integrations. (optional) - view := "overview" // string | Defines the view configuration for dataset items based on the schema definition. This parameter determines how the data will be filtered and presented. For complete specification details, see the [dataset schema documentation](/platform/actors/development/actor-definition/dataset-schema). (optional) - skipFailedPages := false // bool | If `true` or `1` then, the all the items with errorInfo property will be skipped from the output. This feature is here to emulate functionality of API version 1 used for the legacy Apify Crawler product and it's not recommended to use it in new integrations. (optional) - feedTitle := "Latest posts from r/pasta" // string | Overrides the auto-generated RSS channel `<title>` element. Only used when `format=rss`. If not provided, the title defaults to `Dataset <label>`. (optional) - feedDescription := "Scraped forum posts" // string | Overrides the auto-generated RSS channel `<description>` element. Only used when `format=rss`. If not provided, the description defaults to `Items in dataset with id \"<datasetId>\".` (optional) - signature := "2wTI46Bg8qWQrV7tavlPI" // string | Signature used for the access. (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.LastActorRunsDefaultDatasetAPI.ActRunsLastDatasetItemsGet(context.Background(), actorId).Status(status).Format(format).Clean(clean).Offset(offset).Limit(limit).Fields(fields).OutputFields(outputFields).Omit(omit).Unwind(unwind).Flatten(flatten).Desc(desc).Attachment(attachment).Delimiter(delimiter).Bom(bom).XmlRoot(xmlRoot).XmlRow(xmlRow).SkipHeaderRow(skipHeaderRow).SkipHidden(skipHidden).SkipEmpty(skipEmpty).Simplified(simplified).View(view).SkipFailedPages(skipFailedPages).FeedTitle(feedTitle).FeedDescription(feedDescription).Signature(signature).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `LastActorRunsDefaultDatasetAPI.ActRunsLastDatasetItemsGet``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `ActRunsLastDatasetItemsGet`: []map[string]interface{} - fmt.Fprintf(os.Stdout, "Response from `LastActorRunsDefaultDatasetAPI.ActRunsLastDatasetItemsGet`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**actorId** | **string** | Actor ID or a tilde-separated owner's username and Actor name. | - -### Other Parameters - -Other parameters are passed through a pointer to a apiActRunsLastDatasetItemsGetRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - **status** | **string** | Filter for the run status. | - **format** | **string** | Format of the results, possible values are: `json`, `jsonl`, `csv`, `html`, `xlsx`, `xml` and `rss`. The default value is `json`. | - **clean** | **bool** | If `true` or `1` then the API endpoint returns only non-empty items and skips hidden fields (i.e. fields starting with the # character). The `clean` parameter is just a shortcut for `skipHidden=true` and `skipEmpty=true` parameters. Note that since some objects might be skipped from the output, that the result might contain less items than the `limit` value. | - **offset** | **float64** | Number of items that should be skipped at the start. The default value is `0`. | - **limit** | **float64** | Maximum number of items to return. By default there is no limit. | - **fields** | **string** | A comma-separated list of fields which should be picked from the items, only these fields will remain in the resulting record objects. Note that the fields in the outputted items are sorted the same way as they are specified in the `fields` query parameter. You can use this feature to effectively fix the output format. | - **outputFields** | **string** | A comma-separated list of output field names that positionally rename the fields specified in the `fields` parameter. For example, `?fields=headline,url&outputFields=title,link` renames `headline` to `title` and `url` to `link` in the output. The number of names in `outputFields` must match the number of names in `fields`. Requires the `fields` parameter to be specified as well. | - **omit** | **string** | A comma-separated list of fields which should be omitted from the items. | - **unwind** | **string** | A comma-separated list of fields which should be unwound, in order which they should be processed. Each field should be either an array or an object. If the field is an array then every element of the array will become a separate record and merged with parent object. If the unwound field is an object then it is merged with the parent object. If the unwound field is missing or its value is neither an array nor an object and therefore cannot be merged with a parent object then the item gets preserved as it is. Note that the unwound items ignore the `desc` parameter. | - **flatten** | **string** | A comma-separated list of fields which should transform nested objects into flat structures. For example, with `flatten=\"foo\"` the object `{\"foo\":{\"bar\": \"hello\"}}` is turned into `{\"foo.bar\": \"hello\"}`. The original object with properties is replaced with the flattened object. | - **desc** | **bool** | By default, results are returned in the same order as they were stored. To reverse the order, set this parameter to `true` or `1`. | - **attachment** | **bool** | If `true` or `1` then the response will define the `Content-Disposition: attachment` header, forcing a web browser to download the file rather than to display it. By default this header is not present. | - **delimiter** | **string** | A delimiter character for CSV files, only used if `format=csv`. You might need to URL-encode the character (e.g. use `%09` for tab or `%3B` for semicolon). The default delimiter is a simple comma (`,`). | - **bom** | **bool** | All text responses are encoded in UTF-8 encoding. By default, the `format=csv` files are prefixed with the UTF-8 Byte Order Mark (BOM), while `json`, `jsonl`, `xml`, `html` and `rss` files are not. If you want to override this default behavior, specify `bom=1` query parameter to include the BOM or `bom=0` to skip it. | - **xmlRoot** | **string** | Overrides default root element name of `xml` output. By default the root element is `items`. | - **xmlRow** | **string** | Overrides default element name that wraps each page or page function result object in `xml` output. By default the element name is `item`. | - **skipHeaderRow** | **bool** | If `true` or `1` then header row in the `csv` format is skipped. | - **skipHidden** | **bool** | If `true` or `1` then hidden fields are skipped from the output, i.e. fields starting with the `#` character. | - **skipEmpty** | **bool** | If `true` or `1` then empty items are skipped from the output. Note that if used, the results might contain less items than the limit value. | - **simplified** | **bool** | If `true` or `1` then, the endpoint applies the `fields=url,pageFunctionResult,errorInfo` and `unwind=pageFunctionResult` query parameters. This feature is used to emulate simplified results provided by the legacy Apify Crawler product and it's not recommended to use it in new integrations. | - **view** | **string** | Defines the view configuration for dataset items based on the schema definition. This parameter determines how the data will be filtered and presented. For complete specification details, see the [dataset schema documentation](/platform/actors/development/actor-definition/dataset-schema). | - **skipFailedPages** | **bool** | If `true` or `1` then, the all the items with errorInfo property will be skipped from the output. This feature is here to emulate functionality of API version 1 used for the legacy Apify Crawler product and it's not recommended to use it in new integrations. | - **feedTitle** | **string** | Overrides the auto-generated RSS channel `<title>` element. Only used when `format=rss`. If not provided, the title defaults to `Dataset <label>`. | - **feedDescription** | **string** | Overrides the auto-generated RSS channel `<description>` element. Only used when `format=rss`. If not provided, the description defaults to `Items in dataset with id \"<datasetId>\".` | - **signature** | **string** | Signature used for the access. | - -### Return type - -**[]map[string]interface{}** - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json, application/jsonl, text/csv, text/html, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/rss+xml, application/xml - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## ActRunsLastDatasetItemsPost - -> map[string]interface{} ActRunsLastDatasetItemsPost(ctx, actorId).ActRunsLastDatasetItemsPostRequest(actRunsLastDatasetItemsPostRequest).Status(status).Execute() - -Store items in last run's dataset - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - actorId := "janedoe~my-actor" // string | Actor ID or a tilde-separated owner's username and Actor name. - actRunsLastDatasetItemsPostRequest := openapiclient.act_runs_last_dataset_items_post_request{ArrayOfMapmapOfStringAny: new([]map[string]interface{})} // ActRunsLastDatasetItemsPostRequest | - status := "SUCCEEDED" // string | Filter for the run status. (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.LastActorRunsDefaultDatasetAPI.ActRunsLastDatasetItemsPost(context.Background(), actorId).ActRunsLastDatasetItemsPostRequest(actRunsLastDatasetItemsPostRequest).Status(status).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `LastActorRunsDefaultDatasetAPI.ActRunsLastDatasetItemsPost``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `ActRunsLastDatasetItemsPost`: map[string]interface{} - fmt.Fprintf(os.Stdout, "Response from `LastActorRunsDefaultDatasetAPI.ActRunsLastDatasetItemsPost`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**actorId** | **string** | Actor ID or a tilde-separated owner's username and Actor name. | - -### Other Parameters - -Other parameters are passed through a pointer to a apiActRunsLastDatasetItemsPostRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - **actRunsLastDatasetItemsPostRequest** | [**ActRunsLastDatasetItemsPostRequest**](ActRunsLastDatasetItemsPostRequest.md) | | - **status** | **string** | Filter for the run status. | - -### Return type - -**map[string]interface{}** - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## ActRunsLastDatasetPut - -> DatasetResponse ActRunsLastDatasetPut(ctx, actorId).UpdateDatasetRequest(updateDatasetRequest).Status(status).Execute() - -Update last run's default dataset - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - actorId := "janedoe~my-actor" // string | Actor ID or a tilde-separated owner's username and Actor name. - updateDatasetRequest := *openapiclient.NewUpdateDatasetRequest() // UpdateDatasetRequest | - status := "SUCCEEDED" // string | Filter for the run status. (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.LastActorRunsDefaultDatasetAPI.ActRunsLastDatasetPut(context.Background(), actorId).UpdateDatasetRequest(updateDatasetRequest).Status(status).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `LastActorRunsDefaultDatasetAPI.ActRunsLastDatasetPut``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `ActRunsLastDatasetPut`: DatasetResponse - fmt.Fprintf(os.Stdout, "Response from `LastActorRunsDefaultDatasetAPI.ActRunsLastDatasetPut`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**actorId** | **string** | Actor ID or a tilde-separated owner's username and Actor name. | - -### Other Parameters - -Other parameters are passed through a pointer to a apiActRunsLastDatasetPutRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - **updateDatasetRequest** | [**UpdateDatasetRequest**](UpdateDatasetRequest.md) | | - **status** | **string** | Filter for the run status. | - -### Return type - -[**DatasetResponse**](DatasetResponse.md) - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## ActRunsLastDatasetStatisticsGet - -> DatasetStatisticsResponse ActRunsLastDatasetStatisticsGet(ctx, actorId).Status(status).Execute() - -Get last run's dataset statistics - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - actorId := "janedoe~my-actor" // string | Actor ID or a tilde-separated owner's username and Actor name. - status := "SUCCEEDED" // string | Filter for the run status. (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.LastActorRunsDefaultDatasetAPI.ActRunsLastDatasetStatisticsGet(context.Background(), actorId).Status(status).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `LastActorRunsDefaultDatasetAPI.ActRunsLastDatasetStatisticsGet``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `ActRunsLastDatasetStatisticsGet`: DatasetStatisticsResponse - fmt.Fprintf(os.Stdout, "Response from `LastActorRunsDefaultDatasetAPI.ActRunsLastDatasetStatisticsGet`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**actorId** | **string** | Actor ID or a tilde-separated owner's username and Actor name. | - -### Other Parameters - -Other parameters are passed through a pointer to a apiActRunsLastDatasetStatisticsGetRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - **status** | **string** | Filter for the run status. | - -### Return type - -[**DatasetStatisticsResponse**](DatasetStatisticsResponse.md) - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - diff --git a/docs/LastActorRunsDefaultKeyValueStoreAPI.md b/docs/LastActorRunsDefaultKeyValueStoreAPI.md deleted file mode 100644 index 4f8ba56..0000000 --- a/docs/LastActorRunsDefaultKeyValueStoreAPI.md +++ /dev/null @@ -1,703 +0,0 @@ -# \LastActorRunsDefaultKeyValueStoreAPI - -All URIs are relative to *https://api.apify.com* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**ActRunsLastKeyValueStoreDelete**](LastActorRunsDefaultKeyValueStoreAPI.md#ActRunsLastKeyValueStoreDelete) | **Delete** /v2/actors/{actorId}/runs/last/key-value-store | Delete last run's default store -[**ActRunsLastKeyValueStoreGet**](LastActorRunsDefaultKeyValueStoreAPI.md#ActRunsLastKeyValueStoreGet) | **Get** /v2/actors/{actorId}/runs/last/key-value-store | Get last run's default store -[**ActRunsLastKeyValueStoreKeysGet**](LastActorRunsDefaultKeyValueStoreAPI.md#ActRunsLastKeyValueStoreKeysGet) | **Get** /v2/actors/{actorId}/runs/last/key-value-store/keys | Get last run's default store's list of keys -[**ActRunsLastKeyValueStorePut**](LastActorRunsDefaultKeyValueStoreAPI.md#ActRunsLastKeyValueStorePut) | **Put** /v2/actors/{actorId}/runs/last/key-value-store | Update last run's default store -[**ActRunsLastKeyValueStoreRecordDelete**](LastActorRunsDefaultKeyValueStoreAPI.md#ActRunsLastKeyValueStoreRecordDelete) | **Delete** /v2/actors/{actorId}/runs/last/key-value-store/records/{recordKey} | Delete last run's default store's record -[**ActRunsLastKeyValueStoreRecordGet**](LastActorRunsDefaultKeyValueStoreAPI.md#ActRunsLastKeyValueStoreRecordGet) | **Get** /v2/actors/{actorId}/runs/last/key-value-store/records/{recordKey} | Get last run's default store's record -[**ActRunsLastKeyValueStoreRecordPost**](LastActorRunsDefaultKeyValueStoreAPI.md#ActRunsLastKeyValueStoreRecordPost) | **Post** /v2/actors/{actorId}/runs/last/key-value-store/records/{recordKey} | Store record in last run's default store (POST) -[**ActRunsLastKeyValueStoreRecordPut**](LastActorRunsDefaultKeyValueStoreAPI.md#ActRunsLastKeyValueStoreRecordPut) | **Put** /v2/actors/{actorId}/runs/last/key-value-store/records/{recordKey} | Store record in last run's default store -[**ActRunsLastKeyValueStoreRecordsGet**](LastActorRunsDefaultKeyValueStoreAPI.md#ActRunsLastKeyValueStoreRecordsGet) | **Get** /v2/actors/{actorId}/runs/last/key-value-store/records | Download last run's default store's records - - - -## ActRunsLastKeyValueStoreDelete - -> ActRunsLastKeyValueStoreDelete(ctx, actorId).Status(status).Execute() - -Delete last run's default store - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - actorId := "janedoe~my-actor" // string | Actor ID or a tilde-separated owner's username and Actor name. - status := "SUCCEEDED" // string | Filter for the run status. (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - r, err := apiClient.LastActorRunsDefaultKeyValueStoreAPI.ActRunsLastKeyValueStoreDelete(context.Background(), actorId).Status(status).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `LastActorRunsDefaultKeyValueStoreAPI.ActRunsLastKeyValueStoreDelete``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**actorId** | **string** | Actor ID or a tilde-separated owner's username and Actor name. | - -### Other Parameters - -Other parameters are passed through a pointer to a apiActRunsLastKeyValueStoreDeleteRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - **status** | **string** | Filter for the run status. | - -### Return type - - (empty response body) - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## ActRunsLastKeyValueStoreGet - -> KeyValueStoreResponse ActRunsLastKeyValueStoreGet(ctx, actorId).Status(status).Execute() - -Get last run's default store - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - actorId := "janedoe~my-actor" // string | Actor ID or a tilde-separated owner's username and Actor name. - status := "SUCCEEDED" // string | Filter for the run status. (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.LastActorRunsDefaultKeyValueStoreAPI.ActRunsLastKeyValueStoreGet(context.Background(), actorId).Status(status).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `LastActorRunsDefaultKeyValueStoreAPI.ActRunsLastKeyValueStoreGet``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `ActRunsLastKeyValueStoreGet`: KeyValueStoreResponse - fmt.Fprintf(os.Stdout, "Response from `LastActorRunsDefaultKeyValueStoreAPI.ActRunsLastKeyValueStoreGet`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**actorId** | **string** | Actor ID or a tilde-separated owner's username and Actor name. | - -### Other Parameters - -Other parameters are passed through a pointer to a apiActRunsLastKeyValueStoreGetRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - **status** | **string** | Filter for the run status. | - -### Return type - -[**KeyValueStoreResponse**](KeyValueStoreResponse.md) - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## ActRunsLastKeyValueStoreKeysGet - -> ListOfKeysResponse ActRunsLastKeyValueStoreKeysGet(ctx, actorId).Status(status).ExclusiveStartKey(exclusiveStartKey).Limit(limit).Collection(collection).Prefix(prefix).Signature(signature).Execute() - -Get last run's default store's list of keys - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - actorId := "janedoe~my-actor" // string | Actor ID or a tilde-separated owner's username and Actor name. - status := "SUCCEEDED" // string | Filter for the run status. (optional) - exclusiveStartKey := "Ihnsp8YrvJ8102Kj" // string | All keys up to this one (including) are skipped from the result. (optional) - limit := float32(100) // float32 | Number of keys to be returned. (optional) (default to 1000) - collection := "postImages" // string | Limit the results to keys that belong to a specific collection from the key-value store schema. The key-value store need to have a schema defined for this parameter to work. (optional) - prefix := "post-images-" // string | Limit the results to keys that start with a specific prefix. (optional) - signature := "2wTI46Bg8qWQrV7tavlPI" // string | Signature used for the access. (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.LastActorRunsDefaultKeyValueStoreAPI.ActRunsLastKeyValueStoreKeysGet(context.Background(), actorId).Status(status).ExclusiveStartKey(exclusiveStartKey).Limit(limit).Collection(collection).Prefix(prefix).Signature(signature).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `LastActorRunsDefaultKeyValueStoreAPI.ActRunsLastKeyValueStoreKeysGet``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `ActRunsLastKeyValueStoreKeysGet`: ListOfKeysResponse - fmt.Fprintf(os.Stdout, "Response from `LastActorRunsDefaultKeyValueStoreAPI.ActRunsLastKeyValueStoreKeysGet`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**actorId** | **string** | Actor ID or a tilde-separated owner's username and Actor name. | - -### Other Parameters - -Other parameters are passed through a pointer to a apiActRunsLastKeyValueStoreKeysGetRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - **status** | **string** | Filter for the run status. | - **exclusiveStartKey** | **string** | All keys up to this one (including) are skipped from the result. | - **limit** | **float32** | Number of keys to be returned. | [default to 1000] - **collection** | **string** | Limit the results to keys that belong to a specific collection from the key-value store schema. The key-value store need to have a schema defined for this parameter to work. | - **prefix** | **string** | Limit the results to keys that start with a specific prefix. | - **signature** | **string** | Signature used for the access. | - -### Return type - -[**ListOfKeysResponse**](ListOfKeysResponse.md) - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## ActRunsLastKeyValueStorePut - -> KeyValueStoreResponse ActRunsLastKeyValueStorePut(ctx, actorId).UpdateStoreRequest(updateStoreRequest).Status(status).Execute() - -Update last run's default store - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - actorId := "janedoe~my-actor" // string | Actor ID or a tilde-separated owner's username and Actor name. - updateStoreRequest := *openapiclient.NewUpdateStoreRequest() // UpdateStoreRequest | - status := "SUCCEEDED" // string | Filter for the run status. (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.LastActorRunsDefaultKeyValueStoreAPI.ActRunsLastKeyValueStorePut(context.Background(), actorId).UpdateStoreRequest(updateStoreRequest).Status(status).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `LastActorRunsDefaultKeyValueStoreAPI.ActRunsLastKeyValueStorePut``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `ActRunsLastKeyValueStorePut`: KeyValueStoreResponse - fmt.Fprintf(os.Stdout, "Response from `LastActorRunsDefaultKeyValueStoreAPI.ActRunsLastKeyValueStorePut`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**actorId** | **string** | Actor ID or a tilde-separated owner's username and Actor name. | - -### Other Parameters - -Other parameters are passed through a pointer to a apiActRunsLastKeyValueStorePutRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - **updateStoreRequest** | [**UpdateStoreRequest**](UpdateStoreRequest.md) | | - **status** | **string** | Filter for the run status. | - -### Return type - -[**KeyValueStoreResponse**](KeyValueStoreResponse.md) - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## ActRunsLastKeyValueStoreRecordDelete - -> ActRunsLastKeyValueStoreRecordDelete(ctx, actorId, recordKey).Status(status).Execute() - -Delete last run's default store's record - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - actorId := "janedoe~my-actor" // string | Actor ID or a tilde-separated owner's username and Actor name. - recordKey := "someKey" // string | Key of the record. - status := "SUCCEEDED" // string | Filter for the run status. (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - r, err := apiClient.LastActorRunsDefaultKeyValueStoreAPI.ActRunsLastKeyValueStoreRecordDelete(context.Background(), actorId, recordKey).Status(status).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `LastActorRunsDefaultKeyValueStoreAPI.ActRunsLastKeyValueStoreRecordDelete``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**actorId** | **string** | Actor ID or a tilde-separated owner's username and Actor name. | -**recordKey** | **string** | Key of the record. | - -### Other Parameters - -Other parameters are passed through a pointer to a apiActRunsLastKeyValueStoreRecordDeleteRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - - **status** | **string** | Filter for the run status. | - -### Return type - - (empty response body) - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## ActRunsLastKeyValueStoreRecordGet - -> map[string]interface{} ActRunsLastKeyValueStoreRecordGet(ctx, actorId, recordKey).Status(status).Signature(signature).Attachment(attachment).Execute() - -Get last run's default store's record - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - actorId := "janedoe~my-actor" // string | Actor ID or a tilde-separated owner's username and Actor name. - recordKey := "someKey" // string | Key of the record. - status := "SUCCEEDED" // string | Filter for the run status. (optional) - signature := "2wTI46Bg8qWQrV7tavlPI" // string | Signature used for the access. (optional) - attachment := true // bool | If `true` or `1`, the response will be served with `Content-Disposition: attachment` header, causing web browsers to offer downloading HTML records instead of displaying them. (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.LastActorRunsDefaultKeyValueStoreAPI.ActRunsLastKeyValueStoreRecordGet(context.Background(), actorId, recordKey).Status(status).Signature(signature).Attachment(attachment).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `LastActorRunsDefaultKeyValueStoreAPI.ActRunsLastKeyValueStoreRecordGet``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `ActRunsLastKeyValueStoreRecordGet`: map[string]interface{} - fmt.Fprintf(os.Stdout, "Response from `LastActorRunsDefaultKeyValueStoreAPI.ActRunsLastKeyValueStoreRecordGet`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**actorId** | **string** | Actor ID or a tilde-separated owner's username and Actor name. | -**recordKey** | **string** | Key of the record. | - -### Other Parameters - -Other parameters are passed through a pointer to a apiActRunsLastKeyValueStoreRecordGetRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - - **status** | **string** | Filter for the run status. | - **signature** | **string** | Signature used for the access. | - **attachment** | **bool** | If `true` or `1`, the response will be served with `Content-Disposition: attachment` header, causing web browsers to offer downloading HTML records instead of displaying them. | - -### Return type - -**map[string]interface{}** - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json, */* - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## ActRunsLastKeyValueStoreRecordPost - -> map[string]interface{} ActRunsLastKeyValueStoreRecordPost(ctx, actorId, recordKey).RequestBody(requestBody).Status(status).ContentEncoding(contentEncoding).Execute() - -Store record in last run's default store (POST) - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - actorId := "janedoe~my-actor" // string | Actor ID or a tilde-separated owner's username and Actor name. - recordKey := "someKey" // string | Key of the record. - requestBody := map[string]interface{}{"key": interface{}(123)} // map[string]interface{} | - status := "SUCCEEDED" // string | Filter for the run status. (optional) - contentEncoding := "contentEncoding_example" // string | (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.LastActorRunsDefaultKeyValueStoreAPI.ActRunsLastKeyValueStoreRecordPost(context.Background(), actorId, recordKey).RequestBody(requestBody).Status(status).ContentEncoding(contentEncoding).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `LastActorRunsDefaultKeyValueStoreAPI.ActRunsLastKeyValueStoreRecordPost``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `ActRunsLastKeyValueStoreRecordPost`: map[string]interface{} - fmt.Fprintf(os.Stdout, "Response from `LastActorRunsDefaultKeyValueStoreAPI.ActRunsLastKeyValueStoreRecordPost`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**actorId** | **string** | Actor ID or a tilde-separated owner's username and Actor name. | -**recordKey** | **string** | Key of the record. | - -### Other Parameters - -Other parameters are passed through a pointer to a apiActRunsLastKeyValueStoreRecordPostRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - - **requestBody** | **map[string]interface{}** | | - **status** | **string** | Filter for the run status. | - **contentEncoding** | **string** | | - -### Return type - -**map[string]interface{}** - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## ActRunsLastKeyValueStoreRecordPut - -> map[string]interface{} ActRunsLastKeyValueStoreRecordPut(ctx, actorId, recordKey).RequestBody(requestBody).Status(status).ContentEncoding(contentEncoding).Execute() - -Store record in last run's default store - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - actorId := "janedoe~my-actor" // string | Actor ID or a tilde-separated owner's username and Actor name. - recordKey := "someKey" // string | Key of the record. - requestBody := map[string]interface{}{"key": interface{}(123)} // map[string]interface{} | - status := "SUCCEEDED" // string | Filter for the run status. (optional) - contentEncoding := "contentEncoding_example" // string | (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.LastActorRunsDefaultKeyValueStoreAPI.ActRunsLastKeyValueStoreRecordPut(context.Background(), actorId, recordKey).RequestBody(requestBody).Status(status).ContentEncoding(contentEncoding).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `LastActorRunsDefaultKeyValueStoreAPI.ActRunsLastKeyValueStoreRecordPut``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `ActRunsLastKeyValueStoreRecordPut`: map[string]interface{} - fmt.Fprintf(os.Stdout, "Response from `LastActorRunsDefaultKeyValueStoreAPI.ActRunsLastKeyValueStoreRecordPut`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**actorId** | **string** | Actor ID or a tilde-separated owner's username and Actor name. | -**recordKey** | **string** | Key of the record. | - -### Other Parameters - -Other parameters are passed through a pointer to a apiActRunsLastKeyValueStoreRecordPutRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - - **requestBody** | **map[string]interface{}** | | - **status** | **string** | Filter for the run status. | - **contentEncoding** | **string** | | - -### Return type - -**map[string]interface{}** - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## ActRunsLastKeyValueStoreRecordsGet - -> *os.File ActRunsLastKeyValueStoreRecordsGet(ctx, actorId).Status(status).Collection(collection).Prefix(prefix).Signature(signature).Execute() - -Download last run's default store's records - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - actorId := "janedoe~my-actor" // string | Actor ID or a tilde-separated owner's username and Actor name. - status := "SUCCEEDED" // string | Filter for the run status. (optional) - collection := "my-collection" // string | If specified, only records belonging to a specific collection from the key-value store schema. The key-value store need to have a schema defined for this parameter to work. (optional) - prefix := "my-prefix/" // string | If specified, only records whose key starts with the given prefix are included in the archive. (optional) - signature := "2wTI46Bg8qWQrV7tavlPI" // string | Signature used for the access. (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.LastActorRunsDefaultKeyValueStoreAPI.ActRunsLastKeyValueStoreRecordsGet(context.Background(), actorId).Status(status).Collection(collection).Prefix(prefix).Signature(signature).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `LastActorRunsDefaultKeyValueStoreAPI.ActRunsLastKeyValueStoreRecordsGet``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `ActRunsLastKeyValueStoreRecordsGet`: *os.File - fmt.Fprintf(os.Stdout, "Response from `LastActorRunsDefaultKeyValueStoreAPI.ActRunsLastKeyValueStoreRecordsGet`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**actorId** | **string** | Actor ID or a tilde-separated owner's username and Actor name. | - -### Other Parameters - -Other parameters are passed through a pointer to a apiActRunsLastKeyValueStoreRecordsGetRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - **status** | **string** | Filter for the run status. | - **collection** | **string** | If specified, only records belonging to a specific collection from the key-value store schema. The key-value store need to have a schema defined for this parameter to work. | - **prefix** | **string** | If specified, only records whose key starts with the given prefix are included in the archive. | - **signature** | **string** | Signature used for the access. | - -### Return type - -[***os.File**](*os.File.md) - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/zip, application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - diff --git a/docs/LastActorRunsDefaultRequestQueueAPI.md b/docs/LastActorRunsDefaultRequestQueueAPI.md deleted file mode 100644 index c349449..0000000 --- a/docs/LastActorRunsDefaultRequestQueueAPI.md +++ /dev/null @@ -1,1172 +0,0 @@ -# \LastActorRunsDefaultRequestQueueAPI - -All URIs are relative to *https://api.apify.com* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**ActRunsLastRequestQueueDelete**](LastActorRunsDefaultRequestQueueAPI.md#ActRunsLastRequestQueueDelete) | **Delete** /v2/actors/{actorId}/runs/last/request-queue | Delete last run's default request queue -[**ActRunsLastRequestQueueGet**](LastActorRunsDefaultRequestQueueAPI.md#ActRunsLastRequestQueueGet) | **Get** /v2/actors/{actorId}/runs/last/request-queue | Get last run's default request queue -[**ActRunsLastRequestQueueHeadGet**](LastActorRunsDefaultRequestQueueAPI.md#ActRunsLastRequestQueueHeadGet) | **Get** /v2/actors/{actorId}/runs/last/request-queue/head | Get last run's default request queue head -[**ActRunsLastRequestQueueHeadLockPost**](LastActorRunsDefaultRequestQueueAPI.md#ActRunsLastRequestQueueHeadLockPost) | **Post** /v2/actors/{actorId}/runs/last/request-queue/head/lock | Get and lock last run's default request queue head -[**ActRunsLastRequestQueuePut**](LastActorRunsDefaultRequestQueueAPI.md#ActRunsLastRequestQueuePut) | **Put** /v2/actors/{actorId}/runs/last/request-queue | Update last run's default request queue -[**ActRunsLastRequestQueueRequestDelete**](LastActorRunsDefaultRequestQueueAPI.md#ActRunsLastRequestQueueRequestDelete) | **Delete** /v2/actors/{actorId}/runs/last/request-queue/requests/{requestId} | Delete request from last run's default request queue -[**ActRunsLastRequestQueueRequestGet**](LastActorRunsDefaultRequestQueueAPI.md#ActRunsLastRequestQueueRequestGet) | **Get** /v2/actors/{actorId}/runs/last/request-queue/requests/{requestId} | Get request from last run's default request queue -[**ActRunsLastRequestQueueRequestLockDelete**](LastActorRunsDefaultRequestQueueAPI.md#ActRunsLastRequestQueueRequestLockDelete) | **Delete** /v2/actors/{actorId}/runs/last/request-queue/requests/{requestId}/lock | Delete lock on request in last run's default request queue -[**ActRunsLastRequestQueueRequestLockPut**](LastActorRunsDefaultRequestQueueAPI.md#ActRunsLastRequestQueueRequestLockPut) | **Put** /v2/actors/{actorId}/runs/last/request-queue/requests/{requestId}/lock | Prolong lock on request in last run's default request queue -[**ActRunsLastRequestQueueRequestPut**](LastActorRunsDefaultRequestQueueAPI.md#ActRunsLastRequestQueueRequestPut) | **Put** /v2/actors/{actorId}/runs/last/request-queue/requests/{requestId} | Update request in last run's default request queue -[**ActRunsLastRequestQueueRequestsBatchDelete**](LastActorRunsDefaultRequestQueueAPI.md#ActRunsLastRequestQueueRequestsBatchDelete) | **Delete** /v2/actors/{actorId}/runs/last/request-queue/requests/batch | Batch delete requests from last run's default request queue -[**ActRunsLastRequestQueueRequestsBatchPost**](LastActorRunsDefaultRequestQueueAPI.md#ActRunsLastRequestQueueRequestsBatchPost) | **Post** /v2/actors/{actorId}/runs/last/request-queue/requests/batch | Batch add requests to last run's default request queue -[**ActRunsLastRequestQueueRequestsGet**](LastActorRunsDefaultRequestQueueAPI.md#ActRunsLastRequestQueueRequestsGet) | **Get** /v2/actors/{actorId}/runs/last/request-queue/requests | List last run's default request queue's requests -[**ActRunsLastRequestQueueRequestsPost**](LastActorRunsDefaultRequestQueueAPI.md#ActRunsLastRequestQueueRequestsPost) | **Post** /v2/actors/{actorId}/runs/last/request-queue/requests | Add request to last run's default request queue -[**ActRunsLastRequestQueueRequestsUnlockPost**](LastActorRunsDefaultRequestQueueAPI.md#ActRunsLastRequestQueueRequestsUnlockPost) | **Post** /v2/actors/{actorId}/runs/last/request-queue/requests/unlock | Unlock requests in last run's default request queue - - - -## ActRunsLastRequestQueueDelete - -> ActRunsLastRequestQueueDelete(ctx, actorId).Status(status).Execute() - -Delete last run's default request queue - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - actorId := "janedoe~my-actor" // string | Actor ID or a tilde-separated owner's username and Actor name. - status := "SUCCEEDED" // string | Filter for the run status. (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - r, err := apiClient.LastActorRunsDefaultRequestQueueAPI.ActRunsLastRequestQueueDelete(context.Background(), actorId).Status(status).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `LastActorRunsDefaultRequestQueueAPI.ActRunsLastRequestQueueDelete``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**actorId** | **string** | Actor ID or a tilde-separated owner's username and Actor name. | - -### Other Parameters - -Other parameters are passed through a pointer to a apiActRunsLastRequestQueueDeleteRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - **status** | **string** | Filter for the run status. | - -### Return type - - (empty response body) - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## ActRunsLastRequestQueueGet - -> RequestQueueResponse ActRunsLastRequestQueueGet(ctx, actorId).Status(status).Execute() - -Get last run's default request queue - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - actorId := "janedoe~my-actor" // string | Actor ID or a tilde-separated owner's username and Actor name. - status := "SUCCEEDED" // string | Filter for the run status. (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.LastActorRunsDefaultRequestQueueAPI.ActRunsLastRequestQueueGet(context.Background(), actorId).Status(status).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `LastActorRunsDefaultRequestQueueAPI.ActRunsLastRequestQueueGet``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `ActRunsLastRequestQueueGet`: RequestQueueResponse - fmt.Fprintf(os.Stdout, "Response from `LastActorRunsDefaultRequestQueueAPI.ActRunsLastRequestQueueGet`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**actorId** | **string** | Actor ID or a tilde-separated owner's username and Actor name. | - -### Other Parameters - -Other parameters are passed through a pointer to a apiActRunsLastRequestQueueGetRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - **status** | **string** | Filter for the run status. | - -### Return type - -[**RequestQueueResponse**](RequestQueueResponse.md) - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## ActRunsLastRequestQueueHeadGet - -> HeadResponse ActRunsLastRequestQueueHeadGet(ctx, actorId).Status(status).Limit(limit).ClientKey(clientKey).Execute() - -Get last run's default request queue head - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - actorId := "janedoe~my-actor" // string | Actor ID or a tilde-separated owner's username and Actor name. - status := "SUCCEEDED" // string | Filter for the run status. (optional) - limit := float64(100) // float64 | How many items from queue should be returned. (optional) - clientKey := "client-abc" // string | A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.LastActorRunsDefaultRequestQueueAPI.ActRunsLastRequestQueueHeadGet(context.Background(), actorId).Status(status).Limit(limit).ClientKey(clientKey).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `LastActorRunsDefaultRequestQueueAPI.ActRunsLastRequestQueueHeadGet``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `ActRunsLastRequestQueueHeadGet`: HeadResponse - fmt.Fprintf(os.Stdout, "Response from `LastActorRunsDefaultRequestQueueAPI.ActRunsLastRequestQueueHeadGet`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**actorId** | **string** | Actor ID or a tilde-separated owner's username and Actor name. | - -### Other Parameters - -Other parameters are passed through a pointer to a apiActRunsLastRequestQueueHeadGetRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - **status** | **string** | Filter for the run status. | - **limit** | **float64** | How many items from queue should be returned. | - **clientKey** | **string** | A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. | - -### Return type - -[**HeadResponse**](HeadResponse.md) - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## ActRunsLastRequestQueueHeadLockPost - -> HeadAndLockResponse ActRunsLastRequestQueueHeadLockPost(ctx, actorId).LockSecs(lockSecs).Status(status).Limit(limit).ClientKey(clientKey).Execute() - -Get and lock last run's default request queue head - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - actorId := "janedoe~my-actor" // string | Actor ID or a tilde-separated owner's username and Actor name. - lockSecs := float64(60) // float64 | How long the requests will be locked for (in seconds). - status := "SUCCEEDED" // string | Filter for the run status. (optional) - limit := float64(25) // float64 | How many items from the queue should be returned. (optional) - clientKey := "client-abc" // string | A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.LastActorRunsDefaultRequestQueueAPI.ActRunsLastRequestQueueHeadLockPost(context.Background(), actorId).LockSecs(lockSecs).Status(status).Limit(limit).ClientKey(clientKey).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `LastActorRunsDefaultRequestQueueAPI.ActRunsLastRequestQueueHeadLockPost``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `ActRunsLastRequestQueueHeadLockPost`: HeadAndLockResponse - fmt.Fprintf(os.Stdout, "Response from `LastActorRunsDefaultRequestQueueAPI.ActRunsLastRequestQueueHeadLockPost`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**actorId** | **string** | Actor ID or a tilde-separated owner's username and Actor name. | - -### Other Parameters - -Other parameters are passed through a pointer to a apiActRunsLastRequestQueueHeadLockPostRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - **lockSecs** | **float64** | How long the requests will be locked for (in seconds). | - **status** | **string** | Filter for the run status. | - **limit** | **float64** | How many items from the queue should be returned. | - **clientKey** | **string** | A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. | - -### Return type - -[**HeadAndLockResponse**](HeadAndLockResponse.md) - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## ActRunsLastRequestQueuePut - -> RequestQueueResponse ActRunsLastRequestQueuePut(ctx, actorId).UpdateRequestQueueRequest(updateRequestQueueRequest).Status(status).Execute() - -Update last run's default request queue - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - actorId := "janedoe~my-actor" // string | Actor ID or a tilde-separated owner's username and Actor name. - updateRequestQueueRequest := *openapiclient.NewUpdateRequestQueueRequest() // UpdateRequestQueueRequest | - status := "SUCCEEDED" // string | Filter for the run status. (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.LastActorRunsDefaultRequestQueueAPI.ActRunsLastRequestQueuePut(context.Background(), actorId).UpdateRequestQueueRequest(updateRequestQueueRequest).Status(status).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `LastActorRunsDefaultRequestQueueAPI.ActRunsLastRequestQueuePut``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `ActRunsLastRequestQueuePut`: RequestQueueResponse - fmt.Fprintf(os.Stdout, "Response from `LastActorRunsDefaultRequestQueueAPI.ActRunsLastRequestQueuePut`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**actorId** | **string** | Actor ID or a tilde-separated owner's username and Actor name. | - -### Other Parameters - -Other parameters are passed through a pointer to a apiActRunsLastRequestQueuePutRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - **updateRequestQueueRequest** | [**UpdateRequestQueueRequest**](UpdateRequestQueueRequest.md) | | - **status** | **string** | Filter for the run status. | - -### Return type - -[**RequestQueueResponse**](RequestQueueResponse.md) - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## ActRunsLastRequestQueueRequestDelete - -> ActRunsLastRequestQueueRequestDelete(ctx, actorId, requestId).Status(status).ClientKey(clientKey).Execute() - -Delete request from last run's default request queue - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - actorId := "janedoe~my-actor" // string | Actor ID or a tilde-separated owner's username and Actor name. - requestId := "xpsmkDlspokDSmklS" // string | Request ID. - status := "SUCCEEDED" // string | Filter for the run status. (optional) - clientKey := "client-abc" // string | A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - r, err := apiClient.LastActorRunsDefaultRequestQueueAPI.ActRunsLastRequestQueueRequestDelete(context.Background(), actorId, requestId).Status(status).ClientKey(clientKey).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `LastActorRunsDefaultRequestQueueAPI.ActRunsLastRequestQueueRequestDelete``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**actorId** | **string** | Actor ID or a tilde-separated owner's username and Actor name. | -**requestId** | **string** | Request ID. | - -### Other Parameters - -Other parameters are passed through a pointer to a apiActRunsLastRequestQueueRequestDeleteRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - - **status** | **string** | Filter for the run status. | - **clientKey** | **string** | A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. | - -### Return type - - (empty response body) - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## ActRunsLastRequestQueueRequestGet - -> RequestResponse ActRunsLastRequestQueueRequestGet(ctx, actorId, requestId).Status(status).Execute() - -Get request from last run's default request queue - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - actorId := "janedoe~my-actor" // string | Actor ID or a tilde-separated owner's username and Actor name. - requestId := "xpsmkDlspokDSmklS" // string | Request ID. - status := "SUCCEEDED" // string | Filter for the run status. (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.LastActorRunsDefaultRequestQueueAPI.ActRunsLastRequestQueueRequestGet(context.Background(), actorId, requestId).Status(status).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `LastActorRunsDefaultRequestQueueAPI.ActRunsLastRequestQueueRequestGet``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `ActRunsLastRequestQueueRequestGet`: RequestResponse - fmt.Fprintf(os.Stdout, "Response from `LastActorRunsDefaultRequestQueueAPI.ActRunsLastRequestQueueRequestGet`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**actorId** | **string** | Actor ID or a tilde-separated owner's username and Actor name. | -**requestId** | **string** | Request ID. | - -### Other Parameters - -Other parameters are passed through a pointer to a apiActRunsLastRequestQueueRequestGetRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - - **status** | **string** | Filter for the run status. | - -### Return type - -[**RequestResponse**](RequestResponse.md) - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## ActRunsLastRequestQueueRequestLockDelete - -> ActRunsLastRequestQueueRequestLockDelete(ctx, actorId, requestId).Status(status).ClientKey(clientKey).Forefront(forefront).Execute() - -Delete lock on request in last run's default request queue - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - actorId := "janedoe~my-actor" // string | Actor ID or a tilde-separated owner's username and Actor name. - requestId := "xpsmkDlspokDSmklS" // string | Request ID. - status := "SUCCEEDED" // string | Filter for the run status. (optional) - clientKey := "client-abc" // string | A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. (optional) - forefront := "false" // string | Determines if request should be added to the head of the queue or to the end after lock was removed. (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - r, err := apiClient.LastActorRunsDefaultRequestQueueAPI.ActRunsLastRequestQueueRequestLockDelete(context.Background(), actorId, requestId).Status(status).ClientKey(clientKey).Forefront(forefront).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `LastActorRunsDefaultRequestQueueAPI.ActRunsLastRequestQueueRequestLockDelete``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**actorId** | **string** | Actor ID or a tilde-separated owner's username and Actor name. | -**requestId** | **string** | Request ID. | - -### Other Parameters - -Other parameters are passed through a pointer to a apiActRunsLastRequestQueueRequestLockDeleteRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - - **status** | **string** | Filter for the run status. | - **clientKey** | **string** | A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. | - **forefront** | **string** | Determines if request should be added to the head of the queue or to the end after lock was removed. | - -### Return type - - (empty response body) - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## ActRunsLastRequestQueueRequestLockPut - -> ProlongRequestLockResponse ActRunsLastRequestQueueRequestLockPut(ctx, actorId, requestId).LockSecs(lockSecs).Status(status).ClientKey(clientKey).Forefront(forefront).Execute() - -Prolong lock on request in last run's default request queue - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - actorId := "janedoe~my-actor" // string | Actor ID or a tilde-separated owner's username and Actor name. - requestId := "xpsmkDlspokDSmklS" // string | Request ID. - lockSecs := float64(60) // float64 | How long the requests will be locked for (in seconds). - status := "SUCCEEDED" // string | Filter for the run status. (optional) - clientKey := "client-abc" // string | A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. (optional) - forefront := "false" // string | Determines if request should be added to the head of the queue or to the end after lock expires. (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.LastActorRunsDefaultRequestQueueAPI.ActRunsLastRequestQueueRequestLockPut(context.Background(), actorId, requestId).LockSecs(lockSecs).Status(status).ClientKey(clientKey).Forefront(forefront).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `LastActorRunsDefaultRequestQueueAPI.ActRunsLastRequestQueueRequestLockPut``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `ActRunsLastRequestQueueRequestLockPut`: ProlongRequestLockResponse - fmt.Fprintf(os.Stdout, "Response from `LastActorRunsDefaultRequestQueueAPI.ActRunsLastRequestQueueRequestLockPut`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**actorId** | **string** | Actor ID or a tilde-separated owner's username and Actor name. | -**requestId** | **string** | Request ID. | - -### Other Parameters - -Other parameters are passed through a pointer to a apiActRunsLastRequestQueueRequestLockPutRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - - **lockSecs** | **float64** | How long the requests will be locked for (in seconds). | - **status** | **string** | Filter for the run status. | - **clientKey** | **string** | A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. | - **forefront** | **string** | Determines if request should be added to the head of the queue or to the end after lock expires. | - -### Return type - -[**ProlongRequestLockResponse**](ProlongRequestLockResponse.md) - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## ActRunsLastRequestQueueRequestPut - -> UpdateRequestResponse ActRunsLastRequestQueueRequestPut(ctx, actorId, requestId).Request(request).Status(status).Forefront(forefront).ClientKey(clientKey).Execute() - -Update request in last run's default request queue - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - actorId := "janedoe~my-actor" // string | Actor ID or a tilde-separated owner's username and Actor name. - requestId := "xpsmkDlspokDSmklS" // string | Request ID. - request := *openapiclient.NewRequest() // Request | - status := "SUCCEEDED" // string | Filter for the run status. (optional) - forefront := "false" // string | Determines if request should be added to the head of the queue or to the end. Default value is `false` (end of queue). (optional) - clientKey := "client-abc" // string | A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.LastActorRunsDefaultRequestQueueAPI.ActRunsLastRequestQueueRequestPut(context.Background(), actorId, requestId).Request(request).Status(status).Forefront(forefront).ClientKey(clientKey).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `LastActorRunsDefaultRequestQueueAPI.ActRunsLastRequestQueueRequestPut``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `ActRunsLastRequestQueueRequestPut`: UpdateRequestResponse - fmt.Fprintf(os.Stdout, "Response from `LastActorRunsDefaultRequestQueueAPI.ActRunsLastRequestQueueRequestPut`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**actorId** | **string** | Actor ID or a tilde-separated owner's username and Actor name. | -**requestId** | **string** | Request ID. | - -### Other Parameters - -Other parameters are passed through a pointer to a apiActRunsLastRequestQueueRequestPutRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - - **request** | [**Request**](Request.md) | | - **status** | **string** | Filter for the run status. | - **forefront** | **string** | Determines if request should be added to the head of the queue or to the end. Default value is `false` (end of queue). | - **clientKey** | **string** | A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. | - -### Return type - -[**UpdateRequestResponse**](UpdateRequestResponse.md) - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## ActRunsLastRequestQueueRequestsBatchDelete - -> BatchDeleteResponse ActRunsLastRequestQueueRequestsBatchDelete(ctx, actorId).ContentType(contentType).RequestDraftDelete(requestDraftDelete).Status(status).ClientKey(clientKey).Execute() - -Batch delete requests from last run's default request queue - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - actorId := "janedoe~my-actor" // string | Actor ID or a tilde-separated owner's username and Actor name. - contentType := "contentType_example" // string | - requestDraftDelete := []openapiclient.RequestDraftDelete{*openapiclient.NewRequestDraftDelete("Id_example", "UniqueKey_example")} // []RequestDraftDelete | - status := "SUCCEEDED" // string | Filter for the run status. (optional) - clientKey := "client-abc" // string | A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.LastActorRunsDefaultRequestQueueAPI.ActRunsLastRequestQueueRequestsBatchDelete(context.Background(), actorId).ContentType(contentType).RequestDraftDelete(requestDraftDelete).Status(status).ClientKey(clientKey).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `LastActorRunsDefaultRequestQueueAPI.ActRunsLastRequestQueueRequestsBatchDelete``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `ActRunsLastRequestQueueRequestsBatchDelete`: BatchDeleteResponse - fmt.Fprintf(os.Stdout, "Response from `LastActorRunsDefaultRequestQueueAPI.ActRunsLastRequestQueueRequestsBatchDelete`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**actorId** | **string** | Actor ID or a tilde-separated owner's username and Actor name. | - -### Other Parameters - -Other parameters are passed through a pointer to a apiActRunsLastRequestQueueRequestsBatchDeleteRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - **contentType** | **string** | | - **requestDraftDelete** | [**[]RequestDraftDelete**](RequestDraftDelete.md) | | - **status** | **string** | Filter for the run status. | - **clientKey** | **string** | A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. | - -### Return type - -[**BatchDeleteResponse**](BatchDeleteResponse.md) - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## ActRunsLastRequestQueueRequestsBatchPost - -> BatchAddResponse ActRunsLastRequestQueueRequestsBatchPost(ctx, actorId).RequestBase(requestBase).Status(status).ClientKey(clientKey).Forefront(forefront).Execute() - -Batch add requests to last run's default request queue - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - actorId := "janedoe~my-actor" // string | Actor ID or a tilde-separated owner's username and Actor name. - requestBase := []openapiclient.RequestBase{*openapiclient.NewRequestBase()} // []RequestBase | - status := "SUCCEEDED" // string | Filter for the run status. (optional) - clientKey := "client-abc" // string | A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. (optional) - forefront := "false" // string | Determines if request should be added to the head of the queue or to the end. Default value is `false` (end of queue). (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.LastActorRunsDefaultRequestQueueAPI.ActRunsLastRequestQueueRequestsBatchPost(context.Background(), actorId).RequestBase(requestBase).Status(status).ClientKey(clientKey).Forefront(forefront).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `LastActorRunsDefaultRequestQueueAPI.ActRunsLastRequestQueueRequestsBatchPost``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `ActRunsLastRequestQueueRequestsBatchPost`: BatchAddResponse - fmt.Fprintf(os.Stdout, "Response from `LastActorRunsDefaultRequestQueueAPI.ActRunsLastRequestQueueRequestsBatchPost`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**actorId** | **string** | Actor ID or a tilde-separated owner's username and Actor name. | - -### Other Parameters - -Other parameters are passed through a pointer to a apiActRunsLastRequestQueueRequestsBatchPostRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - **requestBase** | [**[]RequestBase**](RequestBase.md) | | - **status** | **string** | Filter for the run status. | - **clientKey** | **string** | A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. | - **forefront** | **string** | Determines if request should be added to the head of the queue or to the end. Default value is `false` (end of queue). | - -### Return type - -[**BatchAddResponse**](BatchAddResponse.md) - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## ActRunsLastRequestQueueRequestsGet - -> ListOfRequestsResponse ActRunsLastRequestQueueRequestsGet(ctx, actorId).Status(status).ClientKey(clientKey).ExclusiveStartId(exclusiveStartId).Limit(limit).Cursor(cursor).Filter(filter).Execute() - -List last run's default request queue's requests - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - actorId := "janedoe~my-actor" // string | Actor ID or a tilde-separated owner's username and Actor name. - status := "SUCCEEDED" // string | Filter for the run status. (optional) - clientKey := "client-abc" // string | A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. (optional) - exclusiveStartId := "Ihnsp8YrvJ8102Kj" // string | All requests up to this one (including) are skipped from the result. (Deprecated, use `cursor` instead.) (optional) - limit := float64(100) // float64 | Number of keys to be returned. Maximum value is `10000`. (optional) - cursor := "eyJyZXF1ZXN0SWQiOiI2OFRqQ2RaTDNvM2hiUU0ifQ" // string | A cursor string for pagination, returned in the previous response as `nextCursor`. Use this to retrieve the next page of requests. (optional) - filter := []string{"Filter_example"} // []string | Filter requests by their state. Possible values are `locked` and `pending`. You can combine multiple values separated by commas, which will mean the union of these filters – requests matching any of the specified states will be returned. (Not compatible with deprecated `exclusiveStartId` parameter.) (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.LastActorRunsDefaultRequestQueueAPI.ActRunsLastRequestQueueRequestsGet(context.Background(), actorId).Status(status).ClientKey(clientKey).ExclusiveStartId(exclusiveStartId).Limit(limit).Cursor(cursor).Filter(filter).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `LastActorRunsDefaultRequestQueueAPI.ActRunsLastRequestQueueRequestsGet``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `ActRunsLastRequestQueueRequestsGet`: ListOfRequestsResponse - fmt.Fprintf(os.Stdout, "Response from `LastActorRunsDefaultRequestQueueAPI.ActRunsLastRequestQueueRequestsGet`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**actorId** | **string** | Actor ID or a tilde-separated owner's username and Actor name. | - -### Other Parameters - -Other parameters are passed through a pointer to a apiActRunsLastRequestQueueRequestsGetRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - **status** | **string** | Filter for the run status. | - **clientKey** | **string** | A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. | - **exclusiveStartId** | **string** | All requests up to this one (including) are skipped from the result. (Deprecated, use `cursor` instead.) | - **limit** | **float64** | Number of keys to be returned. Maximum value is `10000`. | - **cursor** | **string** | A cursor string for pagination, returned in the previous response as `nextCursor`. Use this to retrieve the next page of requests. | - **filter** | **[]string** | Filter requests by their state. Possible values are `locked` and `pending`. You can combine multiple values separated by commas, which will mean the union of these filters – requests matching any of the specified states will be returned. (Not compatible with deprecated `exclusiveStartId` parameter.) | - -### Return type - -[**ListOfRequestsResponse**](ListOfRequestsResponse.md) - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## ActRunsLastRequestQueueRequestsPost - -> AddRequestResponse ActRunsLastRequestQueueRequestsPost(ctx, actorId).RequestBase(requestBase).Status(status).ClientKey(clientKey).Forefront(forefront).Execute() - -Add request to last run's default request queue - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - actorId := "janedoe~my-actor" // string | Actor ID or a tilde-separated owner's username and Actor name. - requestBase := *openapiclient.NewRequestBase() // RequestBase | - status := "SUCCEEDED" // string | Filter for the run status. (optional) - clientKey := "client-abc" // string | A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. (optional) - forefront := "false" // string | Determines if request should be added to the head of the queue or to the end. Default value is `false` (end of queue). (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.LastActorRunsDefaultRequestQueueAPI.ActRunsLastRequestQueueRequestsPost(context.Background(), actorId).RequestBase(requestBase).Status(status).ClientKey(clientKey).Forefront(forefront).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `LastActorRunsDefaultRequestQueueAPI.ActRunsLastRequestQueueRequestsPost``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `ActRunsLastRequestQueueRequestsPost`: AddRequestResponse - fmt.Fprintf(os.Stdout, "Response from `LastActorRunsDefaultRequestQueueAPI.ActRunsLastRequestQueueRequestsPost`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**actorId** | **string** | Actor ID or a tilde-separated owner's username and Actor name. | - -### Other Parameters - -Other parameters are passed through a pointer to a apiActRunsLastRequestQueueRequestsPostRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - **requestBase** | [**RequestBase**](RequestBase.md) | | - **status** | **string** | Filter for the run status. | - **clientKey** | **string** | A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. | - **forefront** | **string** | Determines if request should be added to the head of the queue or to the end. Default value is `false` (end of queue). | - -### Return type - -[**AddRequestResponse**](AddRequestResponse.md) - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## ActRunsLastRequestQueueRequestsUnlockPost - -> UnlockRequestsResponse ActRunsLastRequestQueueRequestsUnlockPost(ctx, actorId).Status(status).ClientKey(clientKey).Execute() - -Unlock requests in last run's default request queue - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - actorId := "janedoe~my-actor" // string | Actor ID or a tilde-separated owner's username and Actor name. - status := "SUCCEEDED" // string | Filter for the run status. (optional) - clientKey := "client-abc" // string | A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.LastActorRunsDefaultRequestQueueAPI.ActRunsLastRequestQueueRequestsUnlockPost(context.Background(), actorId).Status(status).ClientKey(clientKey).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `LastActorRunsDefaultRequestQueueAPI.ActRunsLastRequestQueueRequestsUnlockPost``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `ActRunsLastRequestQueueRequestsUnlockPost`: UnlockRequestsResponse - fmt.Fprintf(os.Stdout, "Response from `LastActorRunsDefaultRequestQueueAPI.ActRunsLastRequestQueueRequestsUnlockPost`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**actorId** | **string** | Actor ID or a tilde-separated owner's username and Actor name. | - -### Other Parameters - -Other parameters are passed through a pointer to a apiActRunsLastRequestQueueRequestsUnlockPostRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - **status** | **string** | Filter for the run status. | - **clientKey** | **string** | A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. | - -### Return type - -[**UnlockRequestsResponse**](UnlockRequestsResponse.md) - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - diff --git a/docs/LastActorRunsLogAPI.md b/docs/LastActorRunsLogAPI.md deleted file mode 100644 index 471da0d..0000000 --- a/docs/LastActorRunsLogAPI.md +++ /dev/null @@ -1,85 +0,0 @@ -# \LastActorRunsLogAPI - -All URIs are relative to *https://api.apify.com* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**ActRunsLastLogGet**](LastActorRunsLogAPI.md#ActRunsLastLogGet) | **Get** /v2/actors/{actorId}/runs/last/log | Get last Actor run's log - - - -## ActRunsLastLogGet - -> string ActRunsLastLogGet(ctx, actorId).Stream(stream).Download(download).Raw(raw).Execute() - -Get last Actor run's log - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - actorId := "janedoe~my-actor" // string | Actor ID or a tilde-separated owner's username and Actor name. - stream := false // bool | If `true` or `1` then the logs will be streamed as long as the run or build is running. (optional) - download := false // bool | If `true` or `1` then the web browser will download the log file rather than open it in a tab. (optional) - raw := false // bool | If `true` or `1`, the logs will be kept verbatim. By default, the API removes ANSI escape codes from the logs, keeping only printable characters. (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.LastActorRunsLogAPI.ActRunsLastLogGet(context.Background(), actorId).Stream(stream).Download(download).Raw(raw).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `LastActorRunsLogAPI.ActRunsLastLogGet``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `ActRunsLastLogGet`: string - fmt.Fprintf(os.Stdout, "Response from `LastActorRunsLogAPI.ActRunsLastLogGet`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**actorId** | **string** | Actor ID or a tilde-separated owner's username and Actor name. | - -### Other Parameters - -Other parameters are passed through a pointer to a apiActRunsLastLogGetRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - **stream** | **bool** | If `true` or `1` then the logs will be streamed as long as the run or build is running. | - **download** | **bool** | If `true` or `1` then the web browser will download the log file rather than open it in a tab. | - **raw** | **bool** | If `true` or `1`, the logs will be kept verbatim. By default, the API removes ANSI escape codes from the logs, keeping only printable characters. | - -### Return type - -**string** - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: text/plain, application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - diff --git a/docs/LastActorRunsMetamorphAPI.md b/docs/LastActorRunsMetamorphAPI.md deleted file mode 100644 index 4c7987c..0000000 --- a/docs/LastActorRunsMetamorphAPI.md +++ /dev/null @@ -1,85 +0,0 @@ -# \LastActorRunsMetamorphAPI - -All URIs are relative to *https://api.apify.com* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**ActRunsLastMetamorphPost**](LastActorRunsMetamorphAPI.md#ActRunsLastMetamorphPost) | **Post** /v2/actors/{actorId}/runs/last/metamorph | Metamorph Actor's last run - - - -## ActRunsLastMetamorphPost - -> RunResponse ActRunsLastMetamorphPost(ctx, actorId).TargetActorId(targetActorId).Status(status).Build(build).Execute() - -Metamorph Actor's last run - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - actorId := "janedoe~my-actor" // string | Actor ID or a tilde-separated owner's username and Actor name. - targetActorId := "HDSasDasz78YcAPEB" // string | ID of a target Actor that the run should be transformed into. - status := "SUCCEEDED" // string | Filter for the run status. (optional) - build := "beta" // string | Optional build of the target Actor. It can be either a build tag or build number. By default, the run uses the build specified in the default run configuration for the target Actor (typically `latest`). (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.LastActorRunsMetamorphAPI.ActRunsLastMetamorphPost(context.Background(), actorId).TargetActorId(targetActorId).Status(status).Build(build).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `LastActorRunsMetamorphAPI.ActRunsLastMetamorphPost``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `ActRunsLastMetamorphPost`: RunResponse - fmt.Fprintf(os.Stdout, "Response from `LastActorRunsMetamorphAPI.ActRunsLastMetamorphPost`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**actorId** | **string** | Actor ID or a tilde-separated owner's username and Actor name. | - -### Other Parameters - -Other parameters are passed through a pointer to a apiActRunsLastMetamorphPostRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - **targetActorId** | **string** | ID of a target Actor that the run should be transformed into. | - **status** | **string** | Filter for the run status. | - **build** | **string** | Optional build of the target Actor. It can be either a build tag or build number. By default, the run uses the build specified in the default run configuration for the target Actor (typically `latest`). | - -### Return type - -[**RunResponse**](RunResponse.md) - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - diff --git a/docs/LastActorRunsRebootAPI.md b/docs/LastActorRunsRebootAPI.md deleted file mode 100644 index d2201ff..0000000 --- a/docs/LastActorRunsRebootAPI.md +++ /dev/null @@ -1,81 +0,0 @@ -# \LastActorRunsRebootAPI - -All URIs are relative to *https://api.apify.com* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**ActRunsLastRebootPost**](LastActorRunsRebootAPI.md#ActRunsLastRebootPost) | **Post** /v2/actors/{actorId}/runs/last/reboot | Reboot Actor's last run - - - -## ActRunsLastRebootPost - -> RunResponse ActRunsLastRebootPost(ctx, actorId).Status(status).Execute() - -Reboot Actor's last run - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - actorId := "janedoe~my-actor" // string | Actor ID or a tilde-separated owner's username and Actor name. - status := "SUCCEEDED" // string | Filter for the run status. (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.LastActorRunsRebootAPI.ActRunsLastRebootPost(context.Background(), actorId).Status(status).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `LastActorRunsRebootAPI.ActRunsLastRebootPost``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `ActRunsLastRebootPost`: RunResponse - fmt.Fprintf(os.Stdout, "Response from `LastActorRunsRebootAPI.ActRunsLastRebootPost`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**actorId** | **string** | Actor ID or a tilde-separated owner's username and Actor name. | - -### Other Parameters - -Other parameters are passed through a pointer to a apiActRunsLastRebootPostRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - **status** | **string** | Filter for the run status. | - -### Return type - -[**RunResponse**](RunResponse.md) - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - diff --git a/docs/LastActorTaskRunsAbortAPI.md b/docs/LastActorTaskRunsAbortAPI.md deleted file mode 100644 index f9e9eee..0000000 --- a/docs/LastActorTaskRunsAbortAPI.md +++ /dev/null @@ -1,83 +0,0 @@ -# \LastActorTaskRunsAbortAPI - -All URIs are relative to *https://api.apify.com* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**ActorTaskRunsLastAbortPost**](LastActorTaskRunsAbortAPI.md#ActorTaskRunsLastAbortPost) | **Post** /v2/actor-tasks/{actorTaskId}/runs/last/abort | Abort Actor task's last run - - - -## ActorTaskRunsLastAbortPost - -> RunResponse ActorTaskRunsLastAbortPost(ctx, actorTaskId).Status(status).Gracefully(gracefully).Execute() - -Abort Actor task's last run - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - actorTaskId := "janedoe~my-task" // string | Task ID or a tilde-separated owner's username and task's name. - status := "SUCCEEDED" // string | Filter for the run status. (optional) - gracefully := true // bool | If true passed, the Actor run will abort gracefully. It will send `aborting` and `persistState` event into run and force-stop the run after 30 seconds. It is helpful in cases where you plan to resurrect the run later. (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.LastActorTaskRunsAbortAPI.ActorTaskRunsLastAbortPost(context.Background(), actorTaskId).Status(status).Gracefully(gracefully).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `LastActorTaskRunsAbortAPI.ActorTaskRunsLastAbortPost``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `ActorTaskRunsLastAbortPost`: RunResponse - fmt.Fprintf(os.Stdout, "Response from `LastActorTaskRunsAbortAPI.ActorTaskRunsLastAbortPost`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**actorTaskId** | **string** | Task ID or a tilde-separated owner's username and task's name. | - -### Other Parameters - -Other parameters are passed through a pointer to a apiActorTaskRunsLastAbortPostRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - **status** | **string** | Filter for the run status. | - **gracefully** | **bool** | If true passed, the Actor run will abort gracefully. It will send `aborting` and `persistState` event into run and force-stop the run after 30 seconds. It is helpful in cases where you plan to resurrect the run later. | - -### Return type - -[**RunResponse**](RunResponse.md) - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - diff --git a/docs/LastActorTaskRunsDefaultDatasetAPI.md b/docs/LastActorTaskRunsDefaultDatasetAPI.md deleted file mode 100644 index b2bbff0..0000000 --- a/docs/LastActorTaskRunsDefaultDatasetAPI.md +++ /dev/null @@ -1,496 +0,0 @@ -# \LastActorTaskRunsDefaultDatasetAPI - -All URIs are relative to *https://api.apify.com* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**ActorTaskRunsLastDatasetDelete**](LastActorTaskRunsDefaultDatasetAPI.md#ActorTaskRunsLastDatasetDelete) | **Delete** /v2/actor-tasks/{actorTaskId}/runs/last/dataset | Delete last task run's default dataset -[**ActorTaskRunsLastDatasetGet**](LastActorTaskRunsDefaultDatasetAPI.md#ActorTaskRunsLastDatasetGet) | **Get** /v2/actor-tasks/{actorTaskId}/runs/last/dataset | Get last task run's default dataset -[**ActorTaskRunsLastDatasetItemsGet**](LastActorTaskRunsDefaultDatasetAPI.md#ActorTaskRunsLastDatasetItemsGet) | **Get** /v2/actor-tasks/{actorTaskId}/runs/last/dataset/items | Get last task run's dataset items -[**ActorTaskRunsLastDatasetItemsPost**](LastActorTaskRunsDefaultDatasetAPI.md#ActorTaskRunsLastDatasetItemsPost) | **Post** /v2/actor-tasks/{actorTaskId}/runs/last/dataset/items | Store items in last task run's dataset -[**ActorTaskRunsLastDatasetPut**](LastActorTaskRunsDefaultDatasetAPI.md#ActorTaskRunsLastDatasetPut) | **Put** /v2/actor-tasks/{actorTaskId}/runs/last/dataset | Update last task run's default dataset -[**ActorTaskRunsLastDatasetStatisticsGet**](LastActorTaskRunsDefaultDatasetAPI.md#ActorTaskRunsLastDatasetStatisticsGet) | **Get** /v2/actor-tasks/{actorTaskId}/runs/last/dataset/statistics | Get last task run's dataset statistics - - - -## ActorTaskRunsLastDatasetDelete - -> ActorTaskRunsLastDatasetDelete(ctx, actorTaskId).Status(status).Execute() - -Delete last task run's default dataset - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - actorTaskId := "janedoe~my-task" // string | Task ID or a tilde-separated owner's username and task's name. - status := "SUCCEEDED" // string | Filter for the run status. (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - r, err := apiClient.LastActorTaskRunsDefaultDatasetAPI.ActorTaskRunsLastDatasetDelete(context.Background(), actorTaskId).Status(status).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `LastActorTaskRunsDefaultDatasetAPI.ActorTaskRunsLastDatasetDelete``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**actorTaskId** | **string** | Task ID or a tilde-separated owner's username and task's name. | - -### Other Parameters - -Other parameters are passed through a pointer to a apiActorTaskRunsLastDatasetDeleteRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - **status** | **string** | Filter for the run status. | - -### Return type - - (empty response body) - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## ActorTaskRunsLastDatasetGet - -> DatasetResponse ActorTaskRunsLastDatasetGet(ctx, actorTaskId).Status(status).Execute() - -Get last task run's default dataset - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - actorTaskId := "janedoe~my-task" // string | Task ID or a tilde-separated owner's username and task's name. - status := "SUCCEEDED" // string | Filter for the run status. (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.LastActorTaskRunsDefaultDatasetAPI.ActorTaskRunsLastDatasetGet(context.Background(), actorTaskId).Status(status).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `LastActorTaskRunsDefaultDatasetAPI.ActorTaskRunsLastDatasetGet``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `ActorTaskRunsLastDatasetGet`: DatasetResponse - fmt.Fprintf(os.Stdout, "Response from `LastActorTaskRunsDefaultDatasetAPI.ActorTaskRunsLastDatasetGet`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**actorTaskId** | **string** | Task ID or a tilde-separated owner's username and task's name. | - -### Other Parameters - -Other parameters are passed through a pointer to a apiActorTaskRunsLastDatasetGetRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - **status** | **string** | Filter for the run status. | - -### Return type - -[**DatasetResponse**](DatasetResponse.md) - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## ActorTaskRunsLastDatasetItemsGet - -> []map[string]interface{} ActorTaskRunsLastDatasetItemsGet(ctx, actorTaskId).Status(status).Format(format).Clean(clean).Offset(offset).Limit(limit).Fields(fields).OutputFields(outputFields).Omit(omit).Unwind(unwind).Flatten(flatten).Desc(desc).Attachment(attachment).Delimiter(delimiter).Bom(bom).XmlRoot(xmlRoot).XmlRow(xmlRow).SkipHeaderRow(skipHeaderRow).SkipHidden(skipHidden).SkipEmpty(skipEmpty).Simplified(simplified).View(view).SkipFailedPages(skipFailedPages).FeedTitle(feedTitle).FeedDescription(feedDescription).Signature(signature).Execute() - -Get last task run's dataset items - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - actorTaskId := "janedoe~my-task" // string | Task ID or a tilde-separated owner's username and task's name. - status := "SUCCEEDED" // string | Filter for the run status. (optional) - format := "json" // string | Format of the results, possible values are: `json`, `jsonl`, `csv`, `html`, `xlsx`, `xml` and `rss`. The default value is `json`. (optional) - clean := false // bool | If `true` or `1` then the API endpoint returns only non-empty items and skips hidden fields (i.e. fields starting with the # character). The `clean` parameter is just a shortcut for `skipHidden=true` and `skipEmpty=true` parameters. Note that since some objects might be skipped from the output, that the result might contain less items than the `limit` value. (optional) - offset := float64(0) // float64 | Number of items that should be skipped at the start. The default value is `0`. (optional) - limit := float64(1.2) // float64 | Maximum number of items to return. By default there is no limit. (optional) - fields := "myValue,myOtherValue" // string | A comma-separated list of fields which should be picked from the items, only these fields will remain in the resulting record objects. Note that the fields in the outputted items are sorted the same way as they are specified in the `fields` query parameter. You can use this feature to effectively fix the output format. (optional) - outputFields := "title,link" // string | A comma-separated list of output field names that positionally rename the fields specified in the `fields` parameter. For example, `?fields=headline,url&outputFields=title,link` renames `headline` to `title` and `url` to `link` in the output. The number of names in `outputFields` must match the number of names in `fields`. Requires the `fields` parameter to be specified as well. (optional) - omit := "myValue,myOtherValue" // string | A comma-separated list of fields which should be omitted from the items. (optional) - unwind := "myValue,myOtherValue" // string | A comma-separated list of fields which should be unwound, in order which they should be processed. Each field should be either an array or an object. If the field is an array then every element of the array will become a separate record and merged with parent object. If the unwound field is an object then it is merged with the parent object. If the unwound field is missing or its value is neither an array nor an object and therefore cannot be merged with a parent object then the item gets preserved as it is. Note that the unwound items ignore the `desc` parameter. (optional) - flatten := "myValue" // string | A comma-separated list of fields which should transform nested objects into flat structures. For example, with `flatten=\"foo\"` the object `{\"foo\":{\"bar\": \"hello\"}}` is turned into `{\"foo.bar\": \"hello\"}`. The original object with properties is replaced with the flattened object. (optional) - desc := true // bool | By default, results are returned in the same order as they were stored. To reverse the order, set this parameter to `true` or `1`. (optional) - attachment := true // bool | If `true` or `1` then the response will define the `Content-Disposition: attachment` header, forcing a web browser to download the file rather than to display it. By default this header is not present. (optional) - delimiter := ";" // string | A delimiter character for CSV files, only used if `format=csv`. You might need to URL-encode the character (e.g. use `%09` for tab or `%3B` for semicolon). The default delimiter is a simple comma (`,`). (optional) - bom := false // bool | All text responses are encoded in UTF-8 encoding. By default, the `format=csv` files are prefixed with the UTF-8 Byte Order Mark (BOM), while `json`, `jsonl`, `xml`, `html` and `rss` files are not. If you want to override this default behavior, specify `bom=1` query parameter to include the BOM or `bom=0` to skip it. (optional) - xmlRoot := "items" // string | Overrides default root element name of `xml` output. By default the root element is `items`. (optional) - xmlRow := "item" // string | Overrides default element name that wraps each page or page function result object in `xml` output. By default the element name is `item`. (optional) - skipHeaderRow := true // bool | If `true` or `1` then header row in the `csv` format is skipped. (optional) - skipHidden := false // bool | If `true` or `1` then hidden fields are skipped from the output, i.e. fields starting with the `#` character. (optional) - skipEmpty := false // bool | If `true` or `1` then empty items are skipped from the output. Note that if used, the results might contain less items than the limit value. (optional) - simplified := false // bool | If `true` or `1` then, the endpoint applies the `fields=url,pageFunctionResult,errorInfo` and `unwind=pageFunctionResult` query parameters. This feature is used to emulate simplified results provided by the legacy Apify Crawler product and it's not recommended to use it in new integrations. (optional) - view := "overview" // string | Defines the view configuration for dataset items based on the schema definition. This parameter determines how the data will be filtered and presented. For complete specification details, see the [dataset schema documentation](/platform/actors/development/actor-definition/dataset-schema). (optional) - skipFailedPages := false // bool | If `true` or `1` then, the all the items with errorInfo property will be skipped from the output. This feature is here to emulate functionality of API version 1 used for the legacy Apify Crawler product and it's not recommended to use it in new integrations. (optional) - feedTitle := "Latest posts from r/pasta" // string | Overrides the auto-generated RSS channel `<title>` element. Only used when `format=rss`. If not provided, the title defaults to `Dataset <label>`. (optional) - feedDescription := "Scraped forum posts" // string | Overrides the auto-generated RSS channel `<description>` element. Only used when `format=rss`. If not provided, the description defaults to `Items in dataset with id \"<datasetId>\".` (optional) - signature := "2wTI46Bg8qWQrV7tavlPI" // string | Signature used for the access. (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.LastActorTaskRunsDefaultDatasetAPI.ActorTaskRunsLastDatasetItemsGet(context.Background(), actorTaskId).Status(status).Format(format).Clean(clean).Offset(offset).Limit(limit).Fields(fields).OutputFields(outputFields).Omit(omit).Unwind(unwind).Flatten(flatten).Desc(desc).Attachment(attachment).Delimiter(delimiter).Bom(bom).XmlRoot(xmlRoot).XmlRow(xmlRow).SkipHeaderRow(skipHeaderRow).SkipHidden(skipHidden).SkipEmpty(skipEmpty).Simplified(simplified).View(view).SkipFailedPages(skipFailedPages).FeedTitle(feedTitle).FeedDescription(feedDescription).Signature(signature).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `LastActorTaskRunsDefaultDatasetAPI.ActorTaskRunsLastDatasetItemsGet``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `ActorTaskRunsLastDatasetItemsGet`: []map[string]interface{} - fmt.Fprintf(os.Stdout, "Response from `LastActorTaskRunsDefaultDatasetAPI.ActorTaskRunsLastDatasetItemsGet`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**actorTaskId** | **string** | Task ID or a tilde-separated owner's username and task's name. | - -### Other Parameters - -Other parameters are passed through a pointer to a apiActorTaskRunsLastDatasetItemsGetRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - **status** | **string** | Filter for the run status. | - **format** | **string** | Format of the results, possible values are: `json`, `jsonl`, `csv`, `html`, `xlsx`, `xml` and `rss`. The default value is `json`. | - **clean** | **bool** | If `true` or `1` then the API endpoint returns only non-empty items and skips hidden fields (i.e. fields starting with the # character). The `clean` parameter is just a shortcut for `skipHidden=true` and `skipEmpty=true` parameters. Note that since some objects might be skipped from the output, that the result might contain less items than the `limit` value. | - **offset** | **float64** | Number of items that should be skipped at the start. The default value is `0`. | - **limit** | **float64** | Maximum number of items to return. By default there is no limit. | - **fields** | **string** | A comma-separated list of fields which should be picked from the items, only these fields will remain in the resulting record objects. Note that the fields in the outputted items are sorted the same way as they are specified in the `fields` query parameter. You can use this feature to effectively fix the output format. | - **outputFields** | **string** | A comma-separated list of output field names that positionally rename the fields specified in the `fields` parameter. For example, `?fields=headline,url&outputFields=title,link` renames `headline` to `title` and `url` to `link` in the output. The number of names in `outputFields` must match the number of names in `fields`. Requires the `fields` parameter to be specified as well. | - **omit** | **string** | A comma-separated list of fields which should be omitted from the items. | - **unwind** | **string** | A comma-separated list of fields which should be unwound, in order which they should be processed. Each field should be either an array or an object. If the field is an array then every element of the array will become a separate record and merged with parent object. If the unwound field is an object then it is merged with the parent object. If the unwound field is missing or its value is neither an array nor an object and therefore cannot be merged with a parent object then the item gets preserved as it is. Note that the unwound items ignore the `desc` parameter. | - **flatten** | **string** | A comma-separated list of fields which should transform nested objects into flat structures. For example, with `flatten=\"foo\"` the object `{\"foo\":{\"bar\": \"hello\"}}` is turned into `{\"foo.bar\": \"hello\"}`. The original object with properties is replaced with the flattened object. | - **desc** | **bool** | By default, results are returned in the same order as they were stored. To reverse the order, set this parameter to `true` or `1`. | - **attachment** | **bool** | If `true` or `1` then the response will define the `Content-Disposition: attachment` header, forcing a web browser to download the file rather than to display it. By default this header is not present. | - **delimiter** | **string** | A delimiter character for CSV files, only used if `format=csv`. You might need to URL-encode the character (e.g. use `%09` for tab or `%3B` for semicolon). The default delimiter is a simple comma (`,`). | - **bom** | **bool** | All text responses are encoded in UTF-8 encoding. By default, the `format=csv` files are prefixed with the UTF-8 Byte Order Mark (BOM), while `json`, `jsonl`, `xml`, `html` and `rss` files are not. If you want to override this default behavior, specify `bom=1` query parameter to include the BOM or `bom=0` to skip it. | - **xmlRoot** | **string** | Overrides default root element name of `xml` output. By default the root element is `items`. | - **xmlRow** | **string** | Overrides default element name that wraps each page or page function result object in `xml` output. By default the element name is `item`. | - **skipHeaderRow** | **bool** | If `true` or `1` then header row in the `csv` format is skipped. | - **skipHidden** | **bool** | If `true` or `1` then hidden fields are skipped from the output, i.e. fields starting with the `#` character. | - **skipEmpty** | **bool** | If `true` or `1` then empty items are skipped from the output. Note that if used, the results might contain less items than the limit value. | - **simplified** | **bool** | If `true` or `1` then, the endpoint applies the `fields=url,pageFunctionResult,errorInfo` and `unwind=pageFunctionResult` query parameters. This feature is used to emulate simplified results provided by the legacy Apify Crawler product and it's not recommended to use it in new integrations. | - **view** | **string** | Defines the view configuration for dataset items based on the schema definition. This parameter determines how the data will be filtered and presented. For complete specification details, see the [dataset schema documentation](/platform/actors/development/actor-definition/dataset-schema). | - **skipFailedPages** | **bool** | If `true` or `1` then, the all the items with errorInfo property will be skipped from the output. This feature is here to emulate functionality of API version 1 used for the legacy Apify Crawler product and it's not recommended to use it in new integrations. | - **feedTitle** | **string** | Overrides the auto-generated RSS channel `<title>` element. Only used when `format=rss`. If not provided, the title defaults to `Dataset <label>`. | - **feedDescription** | **string** | Overrides the auto-generated RSS channel `<description>` element. Only used when `format=rss`. If not provided, the description defaults to `Items in dataset with id \"<datasetId>\".` | - **signature** | **string** | Signature used for the access. | - -### Return type - -**[]map[string]interface{}** - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json, application/jsonl, text/csv, text/html, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/rss+xml, application/xml - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## ActorTaskRunsLastDatasetItemsPost - -> map[string]interface{} ActorTaskRunsLastDatasetItemsPost(ctx, actorTaskId).ActRunsLastDatasetItemsPostRequest(actRunsLastDatasetItemsPostRequest).Status(status).Execute() - -Store items in last task run's dataset - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - actorTaskId := "janedoe~my-task" // string | Task ID or a tilde-separated owner's username and task's name. - actRunsLastDatasetItemsPostRequest := openapiclient.act_runs_last_dataset_items_post_request{ArrayOfMapmapOfStringAny: new([]map[string]interface{})} // ActRunsLastDatasetItemsPostRequest | - status := "SUCCEEDED" // string | Filter for the run status. (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.LastActorTaskRunsDefaultDatasetAPI.ActorTaskRunsLastDatasetItemsPost(context.Background(), actorTaskId).ActRunsLastDatasetItemsPostRequest(actRunsLastDatasetItemsPostRequest).Status(status).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `LastActorTaskRunsDefaultDatasetAPI.ActorTaskRunsLastDatasetItemsPost``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `ActorTaskRunsLastDatasetItemsPost`: map[string]interface{} - fmt.Fprintf(os.Stdout, "Response from `LastActorTaskRunsDefaultDatasetAPI.ActorTaskRunsLastDatasetItemsPost`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**actorTaskId** | **string** | Task ID or a tilde-separated owner's username and task's name. | - -### Other Parameters - -Other parameters are passed through a pointer to a apiActorTaskRunsLastDatasetItemsPostRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - **actRunsLastDatasetItemsPostRequest** | [**ActRunsLastDatasetItemsPostRequest**](ActRunsLastDatasetItemsPostRequest.md) | | - **status** | **string** | Filter for the run status. | - -### Return type - -**map[string]interface{}** - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## ActorTaskRunsLastDatasetPut - -> DatasetResponse ActorTaskRunsLastDatasetPut(ctx, actorTaskId).UpdateDatasetRequest(updateDatasetRequest).Status(status).Execute() - -Update last task run's default dataset - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - actorTaskId := "janedoe~my-task" // string | Task ID or a tilde-separated owner's username and task's name. - updateDatasetRequest := *openapiclient.NewUpdateDatasetRequest() // UpdateDatasetRequest | - status := "SUCCEEDED" // string | Filter for the run status. (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.LastActorTaskRunsDefaultDatasetAPI.ActorTaskRunsLastDatasetPut(context.Background(), actorTaskId).UpdateDatasetRequest(updateDatasetRequest).Status(status).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `LastActorTaskRunsDefaultDatasetAPI.ActorTaskRunsLastDatasetPut``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `ActorTaskRunsLastDatasetPut`: DatasetResponse - fmt.Fprintf(os.Stdout, "Response from `LastActorTaskRunsDefaultDatasetAPI.ActorTaskRunsLastDatasetPut`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**actorTaskId** | **string** | Task ID or a tilde-separated owner's username and task's name. | - -### Other Parameters - -Other parameters are passed through a pointer to a apiActorTaskRunsLastDatasetPutRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - **updateDatasetRequest** | [**UpdateDatasetRequest**](UpdateDatasetRequest.md) | | - **status** | **string** | Filter for the run status. | - -### Return type - -[**DatasetResponse**](DatasetResponse.md) - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## ActorTaskRunsLastDatasetStatisticsGet - -> DatasetStatisticsResponse ActorTaskRunsLastDatasetStatisticsGet(ctx, actorTaskId).Status(status).Execute() - -Get last task run's dataset statistics - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - actorTaskId := "janedoe~my-task" // string | Task ID or a tilde-separated owner's username and task's name. - status := "SUCCEEDED" // string | Filter for the run status. (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.LastActorTaskRunsDefaultDatasetAPI.ActorTaskRunsLastDatasetStatisticsGet(context.Background(), actorTaskId).Status(status).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `LastActorTaskRunsDefaultDatasetAPI.ActorTaskRunsLastDatasetStatisticsGet``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `ActorTaskRunsLastDatasetStatisticsGet`: DatasetStatisticsResponse - fmt.Fprintf(os.Stdout, "Response from `LastActorTaskRunsDefaultDatasetAPI.ActorTaskRunsLastDatasetStatisticsGet`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**actorTaskId** | **string** | Task ID or a tilde-separated owner's username and task's name. | - -### Other Parameters - -Other parameters are passed through a pointer to a apiActorTaskRunsLastDatasetStatisticsGetRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - **status** | **string** | Filter for the run status. | - -### Return type - -[**DatasetStatisticsResponse**](DatasetStatisticsResponse.md) - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - diff --git a/docs/LastActorTaskRunsDefaultKeyValueStoreAPI.md b/docs/LastActorTaskRunsDefaultKeyValueStoreAPI.md deleted file mode 100644 index 9f41650..0000000 --- a/docs/LastActorTaskRunsDefaultKeyValueStoreAPI.md +++ /dev/null @@ -1,703 +0,0 @@ -# \LastActorTaskRunsDefaultKeyValueStoreAPI - -All URIs are relative to *https://api.apify.com* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**ActorTaskRunsLastKeyValueStoreDelete**](LastActorTaskRunsDefaultKeyValueStoreAPI.md#ActorTaskRunsLastKeyValueStoreDelete) | **Delete** /v2/actor-tasks/{actorTaskId}/runs/last/key-value-store | Delete last task run's default store -[**ActorTaskRunsLastKeyValueStoreGet**](LastActorTaskRunsDefaultKeyValueStoreAPI.md#ActorTaskRunsLastKeyValueStoreGet) | **Get** /v2/actor-tasks/{actorTaskId}/runs/last/key-value-store | Get last task run's default store -[**ActorTaskRunsLastKeyValueStoreKeysGet**](LastActorTaskRunsDefaultKeyValueStoreAPI.md#ActorTaskRunsLastKeyValueStoreKeysGet) | **Get** /v2/actor-tasks/{actorTaskId}/runs/last/key-value-store/keys | Get last task run's default store's list of keys -[**ActorTaskRunsLastKeyValueStorePut**](LastActorTaskRunsDefaultKeyValueStoreAPI.md#ActorTaskRunsLastKeyValueStorePut) | **Put** /v2/actor-tasks/{actorTaskId}/runs/last/key-value-store | Update last task run's default store -[**ActorTaskRunsLastKeyValueStoreRecordDelete**](LastActorTaskRunsDefaultKeyValueStoreAPI.md#ActorTaskRunsLastKeyValueStoreRecordDelete) | **Delete** /v2/actor-tasks/{actorTaskId}/runs/last/key-value-store/records/{recordKey} | Delete last task run's default store's record -[**ActorTaskRunsLastKeyValueStoreRecordGet**](LastActorTaskRunsDefaultKeyValueStoreAPI.md#ActorTaskRunsLastKeyValueStoreRecordGet) | **Get** /v2/actor-tasks/{actorTaskId}/runs/last/key-value-store/records/{recordKey} | Get last task run's default store's record -[**ActorTaskRunsLastKeyValueStoreRecordPost**](LastActorTaskRunsDefaultKeyValueStoreAPI.md#ActorTaskRunsLastKeyValueStoreRecordPost) | **Post** /v2/actor-tasks/{actorTaskId}/runs/last/key-value-store/records/{recordKey} | Store record in last task run's default store (POST) -[**ActorTaskRunsLastKeyValueStoreRecordPut**](LastActorTaskRunsDefaultKeyValueStoreAPI.md#ActorTaskRunsLastKeyValueStoreRecordPut) | **Put** /v2/actor-tasks/{actorTaskId}/runs/last/key-value-store/records/{recordKey} | Store record in last task run's default store -[**ActorTaskRunsLastKeyValueStoreRecordsGet**](LastActorTaskRunsDefaultKeyValueStoreAPI.md#ActorTaskRunsLastKeyValueStoreRecordsGet) | **Get** /v2/actor-tasks/{actorTaskId}/runs/last/key-value-store/records | Download last task run's default store's records - - - -## ActorTaskRunsLastKeyValueStoreDelete - -> ActorTaskRunsLastKeyValueStoreDelete(ctx, actorTaskId).Status(status).Execute() - -Delete last task run's default store - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - actorTaskId := "janedoe~my-task" // string | Task ID or a tilde-separated owner's username and task's name. - status := "SUCCEEDED" // string | Filter for the run status. (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - r, err := apiClient.LastActorTaskRunsDefaultKeyValueStoreAPI.ActorTaskRunsLastKeyValueStoreDelete(context.Background(), actorTaskId).Status(status).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `LastActorTaskRunsDefaultKeyValueStoreAPI.ActorTaskRunsLastKeyValueStoreDelete``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**actorTaskId** | **string** | Task ID or a tilde-separated owner's username and task's name. | - -### Other Parameters - -Other parameters are passed through a pointer to a apiActorTaskRunsLastKeyValueStoreDeleteRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - **status** | **string** | Filter for the run status. | - -### Return type - - (empty response body) - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## ActorTaskRunsLastKeyValueStoreGet - -> KeyValueStoreResponse ActorTaskRunsLastKeyValueStoreGet(ctx, actorTaskId).Status(status).Execute() - -Get last task run's default store - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - actorTaskId := "janedoe~my-task" // string | Task ID or a tilde-separated owner's username and task's name. - status := "SUCCEEDED" // string | Filter for the run status. (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.LastActorTaskRunsDefaultKeyValueStoreAPI.ActorTaskRunsLastKeyValueStoreGet(context.Background(), actorTaskId).Status(status).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `LastActorTaskRunsDefaultKeyValueStoreAPI.ActorTaskRunsLastKeyValueStoreGet``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `ActorTaskRunsLastKeyValueStoreGet`: KeyValueStoreResponse - fmt.Fprintf(os.Stdout, "Response from `LastActorTaskRunsDefaultKeyValueStoreAPI.ActorTaskRunsLastKeyValueStoreGet`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**actorTaskId** | **string** | Task ID or a tilde-separated owner's username and task's name. | - -### Other Parameters - -Other parameters are passed through a pointer to a apiActorTaskRunsLastKeyValueStoreGetRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - **status** | **string** | Filter for the run status. | - -### Return type - -[**KeyValueStoreResponse**](KeyValueStoreResponse.md) - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## ActorTaskRunsLastKeyValueStoreKeysGet - -> ListOfKeysResponse ActorTaskRunsLastKeyValueStoreKeysGet(ctx, actorTaskId).Status(status).ExclusiveStartKey(exclusiveStartKey).Limit(limit).Collection(collection).Prefix(prefix).Signature(signature).Execute() - -Get last task run's default store's list of keys - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - actorTaskId := "janedoe~my-task" // string | Task ID or a tilde-separated owner's username and task's name. - status := "SUCCEEDED" // string | Filter for the run status. (optional) - exclusiveStartKey := "Ihnsp8YrvJ8102Kj" // string | All keys up to this one (including) are skipped from the result. (optional) - limit := float32(100) // float32 | Number of keys to be returned. (optional) (default to 1000) - collection := "postImages" // string | Limit the results to keys that belong to a specific collection from the key-value store schema. The key-value store need to have a schema defined for this parameter to work. (optional) - prefix := "post-images-" // string | Limit the results to keys that start with a specific prefix. (optional) - signature := "2wTI46Bg8qWQrV7tavlPI" // string | Signature used for the access. (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.LastActorTaskRunsDefaultKeyValueStoreAPI.ActorTaskRunsLastKeyValueStoreKeysGet(context.Background(), actorTaskId).Status(status).ExclusiveStartKey(exclusiveStartKey).Limit(limit).Collection(collection).Prefix(prefix).Signature(signature).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `LastActorTaskRunsDefaultKeyValueStoreAPI.ActorTaskRunsLastKeyValueStoreKeysGet``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `ActorTaskRunsLastKeyValueStoreKeysGet`: ListOfKeysResponse - fmt.Fprintf(os.Stdout, "Response from `LastActorTaskRunsDefaultKeyValueStoreAPI.ActorTaskRunsLastKeyValueStoreKeysGet`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**actorTaskId** | **string** | Task ID or a tilde-separated owner's username and task's name. | - -### Other Parameters - -Other parameters are passed through a pointer to a apiActorTaskRunsLastKeyValueStoreKeysGetRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - **status** | **string** | Filter for the run status. | - **exclusiveStartKey** | **string** | All keys up to this one (including) are skipped from the result. | - **limit** | **float32** | Number of keys to be returned. | [default to 1000] - **collection** | **string** | Limit the results to keys that belong to a specific collection from the key-value store schema. The key-value store need to have a schema defined for this parameter to work. | - **prefix** | **string** | Limit the results to keys that start with a specific prefix. | - **signature** | **string** | Signature used for the access. | - -### Return type - -[**ListOfKeysResponse**](ListOfKeysResponse.md) - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## ActorTaskRunsLastKeyValueStorePut - -> KeyValueStoreResponse ActorTaskRunsLastKeyValueStorePut(ctx, actorTaskId).UpdateStoreRequest(updateStoreRequest).Status(status).Execute() - -Update last task run's default store - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - actorTaskId := "janedoe~my-task" // string | Task ID or a tilde-separated owner's username and task's name. - updateStoreRequest := *openapiclient.NewUpdateStoreRequest() // UpdateStoreRequest | - status := "SUCCEEDED" // string | Filter for the run status. (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.LastActorTaskRunsDefaultKeyValueStoreAPI.ActorTaskRunsLastKeyValueStorePut(context.Background(), actorTaskId).UpdateStoreRequest(updateStoreRequest).Status(status).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `LastActorTaskRunsDefaultKeyValueStoreAPI.ActorTaskRunsLastKeyValueStorePut``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `ActorTaskRunsLastKeyValueStorePut`: KeyValueStoreResponse - fmt.Fprintf(os.Stdout, "Response from `LastActorTaskRunsDefaultKeyValueStoreAPI.ActorTaskRunsLastKeyValueStorePut`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**actorTaskId** | **string** | Task ID or a tilde-separated owner's username and task's name. | - -### Other Parameters - -Other parameters are passed through a pointer to a apiActorTaskRunsLastKeyValueStorePutRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - **updateStoreRequest** | [**UpdateStoreRequest**](UpdateStoreRequest.md) | | - **status** | **string** | Filter for the run status. | - -### Return type - -[**KeyValueStoreResponse**](KeyValueStoreResponse.md) - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## ActorTaskRunsLastKeyValueStoreRecordDelete - -> ActorTaskRunsLastKeyValueStoreRecordDelete(ctx, actorTaskId, recordKey).Status(status).Execute() - -Delete last task run's default store's record - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - actorTaskId := "janedoe~my-task" // string | Task ID or a tilde-separated owner's username and task's name. - recordKey := "someKey" // string | Key of the record. - status := "SUCCEEDED" // string | Filter for the run status. (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - r, err := apiClient.LastActorTaskRunsDefaultKeyValueStoreAPI.ActorTaskRunsLastKeyValueStoreRecordDelete(context.Background(), actorTaskId, recordKey).Status(status).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `LastActorTaskRunsDefaultKeyValueStoreAPI.ActorTaskRunsLastKeyValueStoreRecordDelete``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**actorTaskId** | **string** | Task ID or a tilde-separated owner's username and task's name. | -**recordKey** | **string** | Key of the record. | - -### Other Parameters - -Other parameters are passed through a pointer to a apiActorTaskRunsLastKeyValueStoreRecordDeleteRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - - **status** | **string** | Filter for the run status. | - -### Return type - - (empty response body) - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## ActorTaskRunsLastKeyValueStoreRecordGet - -> map[string]interface{} ActorTaskRunsLastKeyValueStoreRecordGet(ctx, actorTaskId, recordKey).Status(status).Signature(signature).Attachment(attachment).Execute() - -Get last task run's default store's record - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - actorTaskId := "janedoe~my-task" // string | Task ID or a tilde-separated owner's username and task's name. - recordKey := "someKey" // string | Key of the record. - status := "SUCCEEDED" // string | Filter for the run status. (optional) - signature := "2wTI46Bg8qWQrV7tavlPI" // string | Signature used for the access. (optional) - attachment := true // bool | If `true` or `1`, the response will be served with `Content-Disposition: attachment` header, causing web browsers to offer downloading HTML records instead of displaying them. (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.LastActorTaskRunsDefaultKeyValueStoreAPI.ActorTaskRunsLastKeyValueStoreRecordGet(context.Background(), actorTaskId, recordKey).Status(status).Signature(signature).Attachment(attachment).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `LastActorTaskRunsDefaultKeyValueStoreAPI.ActorTaskRunsLastKeyValueStoreRecordGet``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `ActorTaskRunsLastKeyValueStoreRecordGet`: map[string]interface{} - fmt.Fprintf(os.Stdout, "Response from `LastActorTaskRunsDefaultKeyValueStoreAPI.ActorTaskRunsLastKeyValueStoreRecordGet`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**actorTaskId** | **string** | Task ID or a tilde-separated owner's username and task's name. | -**recordKey** | **string** | Key of the record. | - -### Other Parameters - -Other parameters are passed through a pointer to a apiActorTaskRunsLastKeyValueStoreRecordGetRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - - **status** | **string** | Filter for the run status. | - **signature** | **string** | Signature used for the access. | - **attachment** | **bool** | If `true` or `1`, the response will be served with `Content-Disposition: attachment` header, causing web browsers to offer downloading HTML records instead of displaying them. | - -### Return type - -**map[string]interface{}** - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json, */* - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## ActorTaskRunsLastKeyValueStoreRecordPost - -> map[string]interface{} ActorTaskRunsLastKeyValueStoreRecordPost(ctx, actorTaskId, recordKey).RequestBody(requestBody).Status(status).ContentEncoding(contentEncoding).Execute() - -Store record in last task run's default store (POST) - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - actorTaskId := "janedoe~my-task" // string | Task ID or a tilde-separated owner's username and task's name. - recordKey := "someKey" // string | Key of the record. - requestBody := map[string]interface{}{"key": interface{}(123)} // map[string]interface{} | - status := "SUCCEEDED" // string | Filter for the run status. (optional) - contentEncoding := "contentEncoding_example" // string | (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.LastActorTaskRunsDefaultKeyValueStoreAPI.ActorTaskRunsLastKeyValueStoreRecordPost(context.Background(), actorTaskId, recordKey).RequestBody(requestBody).Status(status).ContentEncoding(contentEncoding).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `LastActorTaskRunsDefaultKeyValueStoreAPI.ActorTaskRunsLastKeyValueStoreRecordPost``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `ActorTaskRunsLastKeyValueStoreRecordPost`: map[string]interface{} - fmt.Fprintf(os.Stdout, "Response from `LastActorTaskRunsDefaultKeyValueStoreAPI.ActorTaskRunsLastKeyValueStoreRecordPost`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**actorTaskId** | **string** | Task ID or a tilde-separated owner's username and task's name. | -**recordKey** | **string** | Key of the record. | - -### Other Parameters - -Other parameters are passed through a pointer to a apiActorTaskRunsLastKeyValueStoreRecordPostRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - - **requestBody** | **map[string]interface{}** | | - **status** | **string** | Filter for the run status. | - **contentEncoding** | **string** | | - -### Return type - -**map[string]interface{}** - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## ActorTaskRunsLastKeyValueStoreRecordPut - -> map[string]interface{} ActorTaskRunsLastKeyValueStoreRecordPut(ctx, actorTaskId, recordKey).RequestBody(requestBody).Status(status).ContentEncoding(contentEncoding).Execute() - -Store record in last task run's default store - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - actorTaskId := "janedoe~my-task" // string | Task ID or a tilde-separated owner's username and task's name. - recordKey := "someKey" // string | Key of the record. - requestBody := map[string]interface{}{"key": interface{}(123)} // map[string]interface{} | - status := "SUCCEEDED" // string | Filter for the run status. (optional) - contentEncoding := "contentEncoding_example" // string | (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.LastActorTaskRunsDefaultKeyValueStoreAPI.ActorTaskRunsLastKeyValueStoreRecordPut(context.Background(), actorTaskId, recordKey).RequestBody(requestBody).Status(status).ContentEncoding(contentEncoding).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `LastActorTaskRunsDefaultKeyValueStoreAPI.ActorTaskRunsLastKeyValueStoreRecordPut``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `ActorTaskRunsLastKeyValueStoreRecordPut`: map[string]interface{} - fmt.Fprintf(os.Stdout, "Response from `LastActorTaskRunsDefaultKeyValueStoreAPI.ActorTaskRunsLastKeyValueStoreRecordPut`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**actorTaskId** | **string** | Task ID or a tilde-separated owner's username and task's name. | -**recordKey** | **string** | Key of the record. | - -### Other Parameters - -Other parameters are passed through a pointer to a apiActorTaskRunsLastKeyValueStoreRecordPutRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - - **requestBody** | **map[string]interface{}** | | - **status** | **string** | Filter for the run status. | - **contentEncoding** | **string** | | - -### Return type - -**map[string]interface{}** - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## ActorTaskRunsLastKeyValueStoreRecordsGet - -> *os.File ActorTaskRunsLastKeyValueStoreRecordsGet(ctx, actorTaskId).Status(status).Collection(collection).Prefix(prefix).Signature(signature).Execute() - -Download last task run's default store's records - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - actorTaskId := "janedoe~my-task" // string | Task ID or a tilde-separated owner's username and task's name. - status := "SUCCEEDED" // string | Filter for the run status. (optional) - collection := "my-collection" // string | If specified, only records belonging to a specific collection from the key-value store schema. The key-value store need to have a schema defined for this parameter to work. (optional) - prefix := "my-prefix/" // string | If specified, only records whose key starts with the given prefix are included in the archive. (optional) - signature := "2wTI46Bg8qWQrV7tavlPI" // string | Signature used for the access. (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.LastActorTaskRunsDefaultKeyValueStoreAPI.ActorTaskRunsLastKeyValueStoreRecordsGet(context.Background(), actorTaskId).Status(status).Collection(collection).Prefix(prefix).Signature(signature).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `LastActorTaskRunsDefaultKeyValueStoreAPI.ActorTaskRunsLastKeyValueStoreRecordsGet``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `ActorTaskRunsLastKeyValueStoreRecordsGet`: *os.File - fmt.Fprintf(os.Stdout, "Response from `LastActorTaskRunsDefaultKeyValueStoreAPI.ActorTaskRunsLastKeyValueStoreRecordsGet`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**actorTaskId** | **string** | Task ID or a tilde-separated owner's username and task's name. | - -### Other Parameters - -Other parameters are passed through a pointer to a apiActorTaskRunsLastKeyValueStoreRecordsGetRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - **status** | **string** | Filter for the run status. | - **collection** | **string** | If specified, only records belonging to a specific collection from the key-value store schema. The key-value store need to have a schema defined for this parameter to work. | - **prefix** | **string** | If specified, only records whose key starts with the given prefix are included in the archive. | - **signature** | **string** | Signature used for the access. | - -### Return type - -[***os.File**](*os.File.md) - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/zip, application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - diff --git a/docs/LastActorTaskRunsDefaultRequestQueueAPI.md b/docs/LastActorTaskRunsDefaultRequestQueueAPI.md deleted file mode 100644 index 51e94d1..0000000 --- a/docs/LastActorTaskRunsDefaultRequestQueueAPI.md +++ /dev/null @@ -1,1172 +0,0 @@ -# \LastActorTaskRunsDefaultRequestQueueAPI - -All URIs are relative to *https://api.apify.com* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**ActorTaskRunsLastRequestQueueDelete**](LastActorTaskRunsDefaultRequestQueueAPI.md#ActorTaskRunsLastRequestQueueDelete) | **Delete** /v2/actor-tasks/{actorTaskId}/runs/last/request-queue | Delete last task run's default request queue -[**ActorTaskRunsLastRequestQueueGet**](LastActorTaskRunsDefaultRequestQueueAPI.md#ActorTaskRunsLastRequestQueueGet) | **Get** /v2/actor-tasks/{actorTaskId}/runs/last/request-queue | Get last task run's default request queue -[**ActorTaskRunsLastRequestQueueHeadGet**](LastActorTaskRunsDefaultRequestQueueAPI.md#ActorTaskRunsLastRequestQueueHeadGet) | **Get** /v2/actor-tasks/{actorTaskId}/runs/last/request-queue/head | Get last task run's default request queue head -[**ActorTaskRunsLastRequestQueueHeadLockPost**](LastActorTaskRunsDefaultRequestQueueAPI.md#ActorTaskRunsLastRequestQueueHeadLockPost) | **Post** /v2/actor-tasks/{actorTaskId}/runs/last/request-queue/head/lock | Get and lock last task run's default request queue head -[**ActorTaskRunsLastRequestQueuePut**](LastActorTaskRunsDefaultRequestQueueAPI.md#ActorTaskRunsLastRequestQueuePut) | **Put** /v2/actor-tasks/{actorTaskId}/runs/last/request-queue | Update last task run's default request queue -[**ActorTaskRunsLastRequestQueueRequestDelete**](LastActorTaskRunsDefaultRequestQueueAPI.md#ActorTaskRunsLastRequestQueueRequestDelete) | **Delete** /v2/actor-tasks/{actorTaskId}/runs/last/request-queue/requests/{requestId} | Delete request from last task run's default request queue -[**ActorTaskRunsLastRequestQueueRequestGet**](LastActorTaskRunsDefaultRequestQueueAPI.md#ActorTaskRunsLastRequestQueueRequestGet) | **Get** /v2/actor-tasks/{actorTaskId}/runs/last/request-queue/requests/{requestId} | Get request from last task run's default request queue -[**ActorTaskRunsLastRequestQueueRequestLockDelete**](LastActorTaskRunsDefaultRequestQueueAPI.md#ActorTaskRunsLastRequestQueueRequestLockDelete) | **Delete** /v2/actor-tasks/{actorTaskId}/runs/last/request-queue/requests/{requestId}/lock | Delete lock on request in last task run's default request queue -[**ActorTaskRunsLastRequestQueueRequestLockPut**](LastActorTaskRunsDefaultRequestQueueAPI.md#ActorTaskRunsLastRequestQueueRequestLockPut) | **Put** /v2/actor-tasks/{actorTaskId}/runs/last/request-queue/requests/{requestId}/lock | Prolong lock on request in last task run's default request queue -[**ActorTaskRunsLastRequestQueueRequestPut**](LastActorTaskRunsDefaultRequestQueueAPI.md#ActorTaskRunsLastRequestQueueRequestPut) | **Put** /v2/actor-tasks/{actorTaskId}/runs/last/request-queue/requests/{requestId} | Update request in last task run's default request queue -[**ActorTaskRunsLastRequestQueueRequestsBatchDelete**](LastActorTaskRunsDefaultRequestQueueAPI.md#ActorTaskRunsLastRequestQueueRequestsBatchDelete) | **Delete** /v2/actor-tasks/{actorTaskId}/runs/last/request-queue/requests/batch | Batch delete requests from last task run's default request queue -[**ActorTaskRunsLastRequestQueueRequestsBatchPost**](LastActorTaskRunsDefaultRequestQueueAPI.md#ActorTaskRunsLastRequestQueueRequestsBatchPost) | **Post** /v2/actor-tasks/{actorTaskId}/runs/last/request-queue/requests/batch | Batch add requests to last task run's default request queue -[**ActorTaskRunsLastRequestQueueRequestsGet**](LastActorTaskRunsDefaultRequestQueueAPI.md#ActorTaskRunsLastRequestQueueRequestsGet) | **Get** /v2/actor-tasks/{actorTaskId}/runs/last/request-queue/requests | List last task run's default request queue's requests -[**ActorTaskRunsLastRequestQueueRequestsPost**](LastActorTaskRunsDefaultRequestQueueAPI.md#ActorTaskRunsLastRequestQueueRequestsPost) | **Post** /v2/actor-tasks/{actorTaskId}/runs/last/request-queue/requests | Add request to last task run's default request queue -[**ActorTaskRunsLastRequestQueueRequestsUnlockPost**](LastActorTaskRunsDefaultRequestQueueAPI.md#ActorTaskRunsLastRequestQueueRequestsUnlockPost) | **Post** /v2/actor-tasks/{actorTaskId}/runs/last/request-queue/requests/unlock | Unlock requests in last task run's default request queue - - - -## ActorTaskRunsLastRequestQueueDelete - -> ActorTaskRunsLastRequestQueueDelete(ctx, actorTaskId).Status(status).Execute() - -Delete last task run's default request queue - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - actorTaskId := "janedoe~my-task" // string | Task ID or a tilde-separated owner's username and task's name. - status := "SUCCEEDED" // string | Filter for the run status. (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - r, err := apiClient.LastActorTaskRunsDefaultRequestQueueAPI.ActorTaskRunsLastRequestQueueDelete(context.Background(), actorTaskId).Status(status).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `LastActorTaskRunsDefaultRequestQueueAPI.ActorTaskRunsLastRequestQueueDelete``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**actorTaskId** | **string** | Task ID or a tilde-separated owner's username and task's name. | - -### Other Parameters - -Other parameters are passed through a pointer to a apiActorTaskRunsLastRequestQueueDeleteRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - **status** | **string** | Filter for the run status. | - -### Return type - - (empty response body) - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## ActorTaskRunsLastRequestQueueGet - -> RequestQueueResponse ActorTaskRunsLastRequestQueueGet(ctx, actorTaskId).Status(status).Execute() - -Get last task run's default request queue - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - actorTaskId := "janedoe~my-task" // string | Task ID or a tilde-separated owner's username and task's name. - status := "SUCCEEDED" // string | Filter for the run status. (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.LastActorTaskRunsDefaultRequestQueueAPI.ActorTaskRunsLastRequestQueueGet(context.Background(), actorTaskId).Status(status).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `LastActorTaskRunsDefaultRequestQueueAPI.ActorTaskRunsLastRequestQueueGet``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `ActorTaskRunsLastRequestQueueGet`: RequestQueueResponse - fmt.Fprintf(os.Stdout, "Response from `LastActorTaskRunsDefaultRequestQueueAPI.ActorTaskRunsLastRequestQueueGet`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**actorTaskId** | **string** | Task ID or a tilde-separated owner's username and task's name. | - -### Other Parameters - -Other parameters are passed through a pointer to a apiActorTaskRunsLastRequestQueueGetRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - **status** | **string** | Filter for the run status. | - -### Return type - -[**RequestQueueResponse**](RequestQueueResponse.md) - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## ActorTaskRunsLastRequestQueueHeadGet - -> HeadResponse ActorTaskRunsLastRequestQueueHeadGet(ctx, actorTaskId).Status(status).Limit(limit).ClientKey(clientKey).Execute() - -Get last task run's default request queue head - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - actorTaskId := "janedoe~my-task" // string | Task ID or a tilde-separated owner's username and task's name. - status := "SUCCEEDED" // string | Filter for the run status. (optional) - limit := float64(100) // float64 | How many items from queue should be returned. (optional) - clientKey := "client-abc" // string | A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.LastActorTaskRunsDefaultRequestQueueAPI.ActorTaskRunsLastRequestQueueHeadGet(context.Background(), actorTaskId).Status(status).Limit(limit).ClientKey(clientKey).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `LastActorTaskRunsDefaultRequestQueueAPI.ActorTaskRunsLastRequestQueueHeadGet``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `ActorTaskRunsLastRequestQueueHeadGet`: HeadResponse - fmt.Fprintf(os.Stdout, "Response from `LastActorTaskRunsDefaultRequestQueueAPI.ActorTaskRunsLastRequestQueueHeadGet`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**actorTaskId** | **string** | Task ID or a tilde-separated owner's username and task's name. | - -### Other Parameters - -Other parameters are passed through a pointer to a apiActorTaskRunsLastRequestQueueHeadGetRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - **status** | **string** | Filter for the run status. | - **limit** | **float64** | How many items from queue should be returned. | - **clientKey** | **string** | A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. | - -### Return type - -[**HeadResponse**](HeadResponse.md) - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## ActorTaskRunsLastRequestQueueHeadLockPost - -> HeadAndLockResponse ActorTaskRunsLastRequestQueueHeadLockPost(ctx, actorTaskId).LockSecs(lockSecs).Status(status).Limit(limit).ClientKey(clientKey).Execute() - -Get and lock last task run's default request queue head - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - actorTaskId := "janedoe~my-task" // string | Task ID or a tilde-separated owner's username and task's name. - lockSecs := float64(60) // float64 | How long the requests will be locked for (in seconds). - status := "SUCCEEDED" // string | Filter for the run status. (optional) - limit := float64(25) // float64 | How many items from the queue should be returned. (optional) - clientKey := "client-abc" // string | A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.LastActorTaskRunsDefaultRequestQueueAPI.ActorTaskRunsLastRequestQueueHeadLockPost(context.Background(), actorTaskId).LockSecs(lockSecs).Status(status).Limit(limit).ClientKey(clientKey).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `LastActorTaskRunsDefaultRequestQueueAPI.ActorTaskRunsLastRequestQueueHeadLockPost``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `ActorTaskRunsLastRequestQueueHeadLockPost`: HeadAndLockResponse - fmt.Fprintf(os.Stdout, "Response from `LastActorTaskRunsDefaultRequestQueueAPI.ActorTaskRunsLastRequestQueueHeadLockPost`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**actorTaskId** | **string** | Task ID or a tilde-separated owner's username and task's name. | - -### Other Parameters - -Other parameters are passed through a pointer to a apiActorTaskRunsLastRequestQueueHeadLockPostRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - **lockSecs** | **float64** | How long the requests will be locked for (in seconds). | - **status** | **string** | Filter for the run status. | - **limit** | **float64** | How many items from the queue should be returned. | - **clientKey** | **string** | A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. | - -### Return type - -[**HeadAndLockResponse**](HeadAndLockResponse.md) - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## ActorTaskRunsLastRequestQueuePut - -> RequestQueueResponse ActorTaskRunsLastRequestQueuePut(ctx, actorTaskId).UpdateRequestQueueRequest(updateRequestQueueRequest).Status(status).Execute() - -Update last task run's default request queue - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - actorTaskId := "janedoe~my-task" // string | Task ID or a tilde-separated owner's username and task's name. - updateRequestQueueRequest := *openapiclient.NewUpdateRequestQueueRequest() // UpdateRequestQueueRequest | - status := "SUCCEEDED" // string | Filter for the run status. (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.LastActorTaskRunsDefaultRequestQueueAPI.ActorTaskRunsLastRequestQueuePut(context.Background(), actorTaskId).UpdateRequestQueueRequest(updateRequestQueueRequest).Status(status).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `LastActorTaskRunsDefaultRequestQueueAPI.ActorTaskRunsLastRequestQueuePut``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `ActorTaskRunsLastRequestQueuePut`: RequestQueueResponse - fmt.Fprintf(os.Stdout, "Response from `LastActorTaskRunsDefaultRequestQueueAPI.ActorTaskRunsLastRequestQueuePut`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**actorTaskId** | **string** | Task ID or a tilde-separated owner's username and task's name. | - -### Other Parameters - -Other parameters are passed through a pointer to a apiActorTaskRunsLastRequestQueuePutRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - **updateRequestQueueRequest** | [**UpdateRequestQueueRequest**](UpdateRequestQueueRequest.md) | | - **status** | **string** | Filter for the run status. | - -### Return type - -[**RequestQueueResponse**](RequestQueueResponse.md) - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## ActorTaskRunsLastRequestQueueRequestDelete - -> ActorTaskRunsLastRequestQueueRequestDelete(ctx, actorTaskId, requestId).Status(status).ClientKey(clientKey).Execute() - -Delete request from last task run's default request queue - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - actorTaskId := "janedoe~my-task" // string | Task ID or a tilde-separated owner's username and task's name. - requestId := "xpsmkDlspokDSmklS" // string | Request ID. - status := "SUCCEEDED" // string | Filter for the run status. (optional) - clientKey := "client-abc" // string | A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - r, err := apiClient.LastActorTaskRunsDefaultRequestQueueAPI.ActorTaskRunsLastRequestQueueRequestDelete(context.Background(), actorTaskId, requestId).Status(status).ClientKey(clientKey).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `LastActorTaskRunsDefaultRequestQueueAPI.ActorTaskRunsLastRequestQueueRequestDelete``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**actorTaskId** | **string** | Task ID or a tilde-separated owner's username and task's name. | -**requestId** | **string** | Request ID. | - -### Other Parameters - -Other parameters are passed through a pointer to a apiActorTaskRunsLastRequestQueueRequestDeleteRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - - **status** | **string** | Filter for the run status. | - **clientKey** | **string** | A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. | - -### Return type - - (empty response body) - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## ActorTaskRunsLastRequestQueueRequestGet - -> RequestResponse ActorTaskRunsLastRequestQueueRequestGet(ctx, actorTaskId, requestId).Status(status).Execute() - -Get request from last task run's default request queue - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - actorTaskId := "janedoe~my-task" // string | Task ID or a tilde-separated owner's username and task's name. - requestId := "xpsmkDlspokDSmklS" // string | Request ID. - status := "SUCCEEDED" // string | Filter for the run status. (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.LastActorTaskRunsDefaultRequestQueueAPI.ActorTaskRunsLastRequestQueueRequestGet(context.Background(), actorTaskId, requestId).Status(status).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `LastActorTaskRunsDefaultRequestQueueAPI.ActorTaskRunsLastRequestQueueRequestGet``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `ActorTaskRunsLastRequestQueueRequestGet`: RequestResponse - fmt.Fprintf(os.Stdout, "Response from `LastActorTaskRunsDefaultRequestQueueAPI.ActorTaskRunsLastRequestQueueRequestGet`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**actorTaskId** | **string** | Task ID or a tilde-separated owner's username and task's name. | -**requestId** | **string** | Request ID. | - -### Other Parameters - -Other parameters are passed through a pointer to a apiActorTaskRunsLastRequestQueueRequestGetRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - - **status** | **string** | Filter for the run status. | - -### Return type - -[**RequestResponse**](RequestResponse.md) - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## ActorTaskRunsLastRequestQueueRequestLockDelete - -> ActorTaskRunsLastRequestQueueRequestLockDelete(ctx, actorTaskId, requestId).Status(status).ClientKey(clientKey).Forefront(forefront).Execute() - -Delete lock on request in last task run's default request queue - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - actorTaskId := "janedoe~my-task" // string | Task ID or a tilde-separated owner's username and task's name. - requestId := "xpsmkDlspokDSmklS" // string | Request ID. - status := "SUCCEEDED" // string | Filter for the run status. (optional) - clientKey := "client-abc" // string | A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. (optional) - forefront := "false" // string | Determines if request should be added to the head of the queue or to the end after lock was removed. (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - r, err := apiClient.LastActorTaskRunsDefaultRequestQueueAPI.ActorTaskRunsLastRequestQueueRequestLockDelete(context.Background(), actorTaskId, requestId).Status(status).ClientKey(clientKey).Forefront(forefront).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `LastActorTaskRunsDefaultRequestQueueAPI.ActorTaskRunsLastRequestQueueRequestLockDelete``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**actorTaskId** | **string** | Task ID or a tilde-separated owner's username and task's name. | -**requestId** | **string** | Request ID. | - -### Other Parameters - -Other parameters are passed through a pointer to a apiActorTaskRunsLastRequestQueueRequestLockDeleteRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - - **status** | **string** | Filter for the run status. | - **clientKey** | **string** | A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. | - **forefront** | **string** | Determines if request should be added to the head of the queue or to the end after lock was removed. | - -### Return type - - (empty response body) - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## ActorTaskRunsLastRequestQueueRequestLockPut - -> ProlongRequestLockResponse ActorTaskRunsLastRequestQueueRequestLockPut(ctx, actorTaskId, requestId).LockSecs(lockSecs).Status(status).ClientKey(clientKey).Forefront(forefront).Execute() - -Prolong lock on request in last task run's default request queue - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - actorTaskId := "janedoe~my-task" // string | Task ID or a tilde-separated owner's username and task's name. - requestId := "xpsmkDlspokDSmklS" // string | Request ID. - lockSecs := float64(60) // float64 | How long the requests will be locked for (in seconds). - status := "SUCCEEDED" // string | Filter for the run status. (optional) - clientKey := "client-abc" // string | A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. (optional) - forefront := "false" // string | Determines if request should be added to the head of the queue or to the end after lock expires. (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.LastActorTaskRunsDefaultRequestQueueAPI.ActorTaskRunsLastRequestQueueRequestLockPut(context.Background(), actorTaskId, requestId).LockSecs(lockSecs).Status(status).ClientKey(clientKey).Forefront(forefront).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `LastActorTaskRunsDefaultRequestQueueAPI.ActorTaskRunsLastRequestQueueRequestLockPut``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `ActorTaskRunsLastRequestQueueRequestLockPut`: ProlongRequestLockResponse - fmt.Fprintf(os.Stdout, "Response from `LastActorTaskRunsDefaultRequestQueueAPI.ActorTaskRunsLastRequestQueueRequestLockPut`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**actorTaskId** | **string** | Task ID or a tilde-separated owner's username and task's name. | -**requestId** | **string** | Request ID. | - -### Other Parameters - -Other parameters are passed through a pointer to a apiActorTaskRunsLastRequestQueueRequestLockPutRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - - **lockSecs** | **float64** | How long the requests will be locked for (in seconds). | - **status** | **string** | Filter for the run status. | - **clientKey** | **string** | A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. | - **forefront** | **string** | Determines if request should be added to the head of the queue or to the end after lock expires. | - -### Return type - -[**ProlongRequestLockResponse**](ProlongRequestLockResponse.md) - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## ActorTaskRunsLastRequestQueueRequestPut - -> UpdateRequestResponse ActorTaskRunsLastRequestQueueRequestPut(ctx, actorTaskId, requestId).Request(request).Status(status).Forefront(forefront).ClientKey(clientKey).Execute() - -Update request in last task run's default request queue - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - actorTaskId := "janedoe~my-task" // string | Task ID or a tilde-separated owner's username and task's name. - requestId := "xpsmkDlspokDSmklS" // string | Request ID. - request := *openapiclient.NewRequest() // Request | - status := "SUCCEEDED" // string | Filter for the run status. (optional) - forefront := "false" // string | Determines if request should be added to the head of the queue or to the end. Default value is `false` (end of queue). (optional) - clientKey := "client-abc" // string | A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.LastActorTaskRunsDefaultRequestQueueAPI.ActorTaskRunsLastRequestQueueRequestPut(context.Background(), actorTaskId, requestId).Request(request).Status(status).Forefront(forefront).ClientKey(clientKey).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `LastActorTaskRunsDefaultRequestQueueAPI.ActorTaskRunsLastRequestQueueRequestPut``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `ActorTaskRunsLastRequestQueueRequestPut`: UpdateRequestResponse - fmt.Fprintf(os.Stdout, "Response from `LastActorTaskRunsDefaultRequestQueueAPI.ActorTaskRunsLastRequestQueueRequestPut`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**actorTaskId** | **string** | Task ID or a tilde-separated owner's username and task's name. | -**requestId** | **string** | Request ID. | - -### Other Parameters - -Other parameters are passed through a pointer to a apiActorTaskRunsLastRequestQueueRequestPutRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - - **request** | [**Request**](Request.md) | | - **status** | **string** | Filter for the run status. | - **forefront** | **string** | Determines if request should be added to the head of the queue or to the end. Default value is `false` (end of queue). | - **clientKey** | **string** | A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. | - -### Return type - -[**UpdateRequestResponse**](UpdateRequestResponse.md) - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## ActorTaskRunsLastRequestQueueRequestsBatchDelete - -> BatchDeleteResponse ActorTaskRunsLastRequestQueueRequestsBatchDelete(ctx, actorTaskId).ContentType(contentType).RequestDraftDelete(requestDraftDelete).Status(status).ClientKey(clientKey).Execute() - -Batch delete requests from last task run's default request queue - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - actorTaskId := "janedoe~my-task" // string | Task ID or a tilde-separated owner's username and task's name. - contentType := "contentType_example" // string | - requestDraftDelete := []openapiclient.RequestDraftDelete{*openapiclient.NewRequestDraftDelete("Id_example", "UniqueKey_example")} // []RequestDraftDelete | - status := "SUCCEEDED" // string | Filter for the run status. (optional) - clientKey := "client-abc" // string | A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.LastActorTaskRunsDefaultRequestQueueAPI.ActorTaskRunsLastRequestQueueRequestsBatchDelete(context.Background(), actorTaskId).ContentType(contentType).RequestDraftDelete(requestDraftDelete).Status(status).ClientKey(clientKey).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `LastActorTaskRunsDefaultRequestQueueAPI.ActorTaskRunsLastRequestQueueRequestsBatchDelete``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `ActorTaskRunsLastRequestQueueRequestsBatchDelete`: BatchDeleteResponse - fmt.Fprintf(os.Stdout, "Response from `LastActorTaskRunsDefaultRequestQueueAPI.ActorTaskRunsLastRequestQueueRequestsBatchDelete`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**actorTaskId** | **string** | Task ID or a tilde-separated owner's username and task's name. | - -### Other Parameters - -Other parameters are passed through a pointer to a apiActorTaskRunsLastRequestQueueRequestsBatchDeleteRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - **contentType** | **string** | | - **requestDraftDelete** | [**[]RequestDraftDelete**](RequestDraftDelete.md) | | - **status** | **string** | Filter for the run status. | - **clientKey** | **string** | A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. | - -### Return type - -[**BatchDeleteResponse**](BatchDeleteResponse.md) - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## ActorTaskRunsLastRequestQueueRequestsBatchPost - -> BatchAddResponse ActorTaskRunsLastRequestQueueRequestsBatchPost(ctx, actorTaskId).RequestBase(requestBase).Status(status).ClientKey(clientKey).Forefront(forefront).Execute() - -Batch add requests to last task run's default request queue - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - actorTaskId := "janedoe~my-task" // string | Task ID or a tilde-separated owner's username and task's name. - requestBase := []openapiclient.RequestBase{*openapiclient.NewRequestBase()} // []RequestBase | - status := "SUCCEEDED" // string | Filter for the run status. (optional) - clientKey := "client-abc" // string | A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. (optional) - forefront := "false" // string | Determines if request should be added to the head of the queue or to the end. Default value is `false` (end of queue). (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.LastActorTaskRunsDefaultRequestQueueAPI.ActorTaskRunsLastRequestQueueRequestsBatchPost(context.Background(), actorTaskId).RequestBase(requestBase).Status(status).ClientKey(clientKey).Forefront(forefront).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `LastActorTaskRunsDefaultRequestQueueAPI.ActorTaskRunsLastRequestQueueRequestsBatchPost``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `ActorTaskRunsLastRequestQueueRequestsBatchPost`: BatchAddResponse - fmt.Fprintf(os.Stdout, "Response from `LastActorTaskRunsDefaultRequestQueueAPI.ActorTaskRunsLastRequestQueueRequestsBatchPost`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**actorTaskId** | **string** | Task ID or a tilde-separated owner's username and task's name. | - -### Other Parameters - -Other parameters are passed through a pointer to a apiActorTaskRunsLastRequestQueueRequestsBatchPostRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - **requestBase** | [**[]RequestBase**](RequestBase.md) | | - **status** | **string** | Filter for the run status. | - **clientKey** | **string** | A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. | - **forefront** | **string** | Determines if request should be added to the head of the queue or to the end. Default value is `false` (end of queue). | - -### Return type - -[**BatchAddResponse**](BatchAddResponse.md) - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## ActorTaskRunsLastRequestQueueRequestsGet - -> ListOfRequestsResponse ActorTaskRunsLastRequestQueueRequestsGet(ctx, actorTaskId).Status(status).ClientKey(clientKey).ExclusiveStartId(exclusiveStartId).Limit(limit).Cursor(cursor).Filter(filter).Execute() - -List last task run's default request queue's requests - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - actorTaskId := "janedoe~my-task" // string | Task ID or a tilde-separated owner's username and task's name. - status := "SUCCEEDED" // string | Filter for the run status. (optional) - clientKey := "client-abc" // string | A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. (optional) - exclusiveStartId := "Ihnsp8YrvJ8102Kj" // string | All requests up to this one (including) are skipped from the result. (Deprecated, use `cursor` instead.) (optional) - limit := float64(100) // float64 | Number of keys to be returned. Maximum value is `10000`. (optional) - cursor := "eyJyZXF1ZXN0SWQiOiI2OFRqQ2RaTDNvM2hiUU0ifQ" // string | A cursor string for pagination, returned in the previous response as `nextCursor`. Use this to retrieve the next page of requests. (optional) - filter := []string{"Filter_example"} // []string | Filter requests by their state. Possible values are `locked` and `pending`. You can combine multiple values separated by commas, which will mean the union of these filters – requests matching any of the specified states will be returned. (Not compatible with deprecated `exclusiveStartId` parameter.) (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.LastActorTaskRunsDefaultRequestQueueAPI.ActorTaskRunsLastRequestQueueRequestsGet(context.Background(), actorTaskId).Status(status).ClientKey(clientKey).ExclusiveStartId(exclusiveStartId).Limit(limit).Cursor(cursor).Filter(filter).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `LastActorTaskRunsDefaultRequestQueueAPI.ActorTaskRunsLastRequestQueueRequestsGet``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `ActorTaskRunsLastRequestQueueRequestsGet`: ListOfRequestsResponse - fmt.Fprintf(os.Stdout, "Response from `LastActorTaskRunsDefaultRequestQueueAPI.ActorTaskRunsLastRequestQueueRequestsGet`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**actorTaskId** | **string** | Task ID or a tilde-separated owner's username and task's name. | - -### Other Parameters - -Other parameters are passed through a pointer to a apiActorTaskRunsLastRequestQueueRequestsGetRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - **status** | **string** | Filter for the run status. | - **clientKey** | **string** | A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. | - **exclusiveStartId** | **string** | All requests up to this one (including) are skipped from the result. (Deprecated, use `cursor` instead.) | - **limit** | **float64** | Number of keys to be returned. Maximum value is `10000`. | - **cursor** | **string** | A cursor string for pagination, returned in the previous response as `nextCursor`. Use this to retrieve the next page of requests. | - **filter** | **[]string** | Filter requests by their state. Possible values are `locked` and `pending`. You can combine multiple values separated by commas, which will mean the union of these filters – requests matching any of the specified states will be returned. (Not compatible with deprecated `exclusiveStartId` parameter.) | - -### Return type - -[**ListOfRequestsResponse**](ListOfRequestsResponse.md) - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## ActorTaskRunsLastRequestQueueRequestsPost - -> AddRequestResponse ActorTaskRunsLastRequestQueueRequestsPost(ctx, actorTaskId).RequestBase(requestBase).Status(status).ClientKey(clientKey).Forefront(forefront).Execute() - -Add request to last task run's default request queue - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - actorTaskId := "janedoe~my-task" // string | Task ID or a tilde-separated owner's username and task's name. - requestBase := *openapiclient.NewRequestBase() // RequestBase | - status := "SUCCEEDED" // string | Filter for the run status. (optional) - clientKey := "client-abc" // string | A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. (optional) - forefront := "false" // string | Determines if request should be added to the head of the queue or to the end. Default value is `false` (end of queue). (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.LastActorTaskRunsDefaultRequestQueueAPI.ActorTaskRunsLastRequestQueueRequestsPost(context.Background(), actorTaskId).RequestBase(requestBase).Status(status).ClientKey(clientKey).Forefront(forefront).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `LastActorTaskRunsDefaultRequestQueueAPI.ActorTaskRunsLastRequestQueueRequestsPost``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `ActorTaskRunsLastRequestQueueRequestsPost`: AddRequestResponse - fmt.Fprintf(os.Stdout, "Response from `LastActorTaskRunsDefaultRequestQueueAPI.ActorTaskRunsLastRequestQueueRequestsPost`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**actorTaskId** | **string** | Task ID or a tilde-separated owner's username and task's name. | - -### Other Parameters - -Other parameters are passed through a pointer to a apiActorTaskRunsLastRequestQueueRequestsPostRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - **requestBase** | [**RequestBase**](RequestBase.md) | | - **status** | **string** | Filter for the run status. | - **clientKey** | **string** | A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. | - **forefront** | **string** | Determines if request should be added to the head of the queue or to the end. Default value is `false` (end of queue). | - -### Return type - -[**AddRequestResponse**](AddRequestResponse.md) - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## ActorTaskRunsLastRequestQueueRequestsUnlockPost - -> UnlockRequestsResponse ActorTaskRunsLastRequestQueueRequestsUnlockPost(ctx, actorTaskId).Status(status).ClientKey(clientKey).Execute() - -Unlock requests in last task run's default request queue - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - actorTaskId := "janedoe~my-task" // string | Task ID or a tilde-separated owner's username and task's name. - status := "SUCCEEDED" // string | Filter for the run status. (optional) - clientKey := "client-abc" // string | A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.LastActorTaskRunsDefaultRequestQueueAPI.ActorTaskRunsLastRequestQueueRequestsUnlockPost(context.Background(), actorTaskId).Status(status).ClientKey(clientKey).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `LastActorTaskRunsDefaultRequestQueueAPI.ActorTaskRunsLastRequestQueueRequestsUnlockPost``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `ActorTaskRunsLastRequestQueueRequestsUnlockPost`: UnlockRequestsResponse - fmt.Fprintf(os.Stdout, "Response from `LastActorTaskRunsDefaultRequestQueueAPI.ActorTaskRunsLastRequestQueueRequestsUnlockPost`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**actorTaskId** | **string** | Task ID or a tilde-separated owner's username and task's name. | - -### Other Parameters - -Other parameters are passed through a pointer to a apiActorTaskRunsLastRequestQueueRequestsUnlockPostRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - **status** | **string** | Filter for the run status. | - **clientKey** | **string** | A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. | - -### Return type - -[**UnlockRequestsResponse**](UnlockRequestsResponse.md) - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - diff --git a/docs/LastActorTaskRunsLogAPI.md b/docs/LastActorTaskRunsLogAPI.md deleted file mode 100644 index 2d808b9..0000000 --- a/docs/LastActorTaskRunsLogAPI.md +++ /dev/null @@ -1,85 +0,0 @@ -# \LastActorTaskRunsLogAPI - -All URIs are relative to *https://api.apify.com* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**ActorTaskLastLogGet**](LastActorTaskRunsLogAPI.md#ActorTaskLastLogGet) | **Get** /v2/actor-tasks/{actorTaskId}/runs/last/log | Get last Actor task run's log - - - -## ActorTaskLastLogGet - -> string ActorTaskLastLogGet(ctx, actorTaskId).Stream(stream).Download(download).Raw(raw).Execute() - -Get last Actor task run's log - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - actorTaskId := "janedoe~my-task" // string | Task ID or a tilde-separated owner's username and task's name. - stream := false // bool | If `true` or `1` then the logs will be streamed as long as the run or build is running. (optional) - download := false // bool | If `true` or `1` then the web browser will download the log file rather than open it in a tab. (optional) - raw := false // bool | If `true` or `1`, the logs will be kept verbatim. By default, the API removes ANSI escape codes from the logs, keeping only printable characters. (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.LastActorTaskRunsLogAPI.ActorTaskLastLogGet(context.Background(), actorTaskId).Stream(stream).Download(download).Raw(raw).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `LastActorTaskRunsLogAPI.ActorTaskLastLogGet``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `ActorTaskLastLogGet`: string - fmt.Fprintf(os.Stdout, "Response from `LastActorTaskRunsLogAPI.ActorTaskLastLogGet`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**actorTaskId** | **string** | Task ID or a tilde-separated owner's username and task's name. | - -### Other Parameters - -Other parameters are passed through a pointer to a apiActorTaskLastLogGetRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - **stream** | **bool** | If `true` or `1` then the logs will be streamed as long as the run or build is running. | - **download** | **bool** | If `true` or `1` then the web browser will download the log file rather than open it in a tab. | - **raw** | **bool** | If `true` or `1`, the logs will be kept verbatim. By default, the API removes ANSI escape codes from the logs, keeping only printable characters. | - -### Return type - -**string** - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: text/plain, application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - diff --git a/docs/LastActorTaskRunsMetamorphAPI.md b/docs/LastActorTaskRunsMetamorphAPI.md deleted file mode 100644 index cb685ab..0000000 --- a/docs/LastActorTaskRunsMetamorphAPI.md +++ /dev/null @@ -1,85 +0,0 @@ -# \LastActorTaskRunsMetamorphAPI - -All URIs are relative to *https://api.apify.com* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**ActorTaskRunsLastMetamorphPost**](LastActorTaskRunsMetamorphAPI.md#ActorTaskRunsLastMetamorphPost) | **Post** /v2/actor-tasks/{actorTaskId}/runs/last/metamorph | Metamorph Actor task's last run - - - -## ActorTaskRunsLastMetamorphPost - -> RunResponse ActorTaskRunsLastMetamorphPost(ctx, actorTaskId).TargetActorId(targetActorId).Status(status).Build(build).Execute() - -Metamorph Actor task's last run - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - actorTaskId := "janedoe~my-task" // string | Task ID or a tilde-separated owner's username and task's name. - targetActorId := "HDSasDasz78YcAPEB" // string | ID of a target Actor that the run should be transformed into. - status := "SUCCEEDED" // string | Filter for the run status. (optional) - build := "beta" // string | Optional build of the target Actor. It can be either a build tag or build number. By default, the run uses the build specified in the default run configuration for the target Actor (typically `latest`). (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.LastActorTaskRunsMetamorphAPI.ActorTaskRunsLastMetamorphPost(context.Background(), actorTaskId).TargetActorId(targetActorId).Status(status).Build(build).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `LastActorTaskRunsMetamorphAPI.ActorTaskRunsLastMetamorphPost``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `ActorTaskRunsLastMetamorphPost`: RunResponse - fmt.Fprintf(os.Stdout, "Response from `LastActorTaskRunsMetamorphAPI.ActorTaskRunsLastMetamorphPost`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**actorTaskId** | **string** | Task ID or a tilde-separated owner's username and task's name. | - -### Other Parameters - -Other parameters are passed through a pointer to a apiActorTaskRunsLastMetamorphPostRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - **targetActorId** | **string** | ID of a target Actor that the run should be transformed into. | - **status** | **string** | Filter for the run status. | - **build** | **string** | Optional build of the target Actor. It can be either a build tag or build number. By default, the run uses the build specified in the default run configuration for the target Actor (typically `latest`). | - -### Return type - -[**RunResponse**](RunResponse.md) - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - diff --git a/docs/LastActorTaskRunsRebootAPI.md b/docs/LastActorTaskRunsRebootAPI.md deleted file mode 100644 index 1f514b7..0000000 --- a/docs/LastActorTaskRunsRebootAPI.md +++ /dev/null @@ -1,81 +0,0 @@ -# \LastActorTaskRunsRebootAPI - -All URIs are relative to *https://api.apify.com* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**ActorTaskRunsLastRebootPost**](LastActorTaskRunsRebootAPI.md#ActorTaskRunsLastRebootPost) | **Post** /v2/actor-tasks/{actorTaskId}/runs/last/reboot | Reboot Actor task's last run - - - -## ActorTaskRunsLastRebootPost - -> RunResponse ActorTaskRunsLastRebootPost(ctx, actorTaskId).Status(status).Execute() - -Reboot Actor task's last run - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - actorTaskId := "janedoe~my-task" // string | Task ID or a tilde-separated owner's username and task's name. - status := "SUCCEEDED" // string | Filter for the run status. (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.LastActorTaskRunsRebootAPI.ActorTaskRunsLastRebootPost(context.Background(), actorTaskId).Status(status).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `LastActorTaskRunsRebootAPI.ActorTaskRunsLastRebootPost``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `ActorTaskRunsLastRebootPost`: RunResponse - fmt.Fprintf(os.Stdout, "Response from `LastActorTaskRunsRebootAPI.ActorTaskRunsLastRebootPost`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**actorTaskId** | **string** | Task ID or a tilde-separated owner's username and task's name. | - -### Other Parameters - -Other parameters are passed through a pointer to a apiActorTaskRunsLastRebootPostRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - **status** | **string** | Filter for the run status. | - -### Return type - -[**RunResponse**](RunResponse.md) - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - diff --git a/docs/Limits.md b/docs/Limits.md deleted file mode 100644 index f807cda..0000000 --- a/docs/Limits.md +++ /dev/null @@ -1,287 +0,0 @@ -# Limits - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**MaxMonthlyUsageUsd** | **float32** | | -**MaxMonthlyActorComputeUnits** | **float32** | | -**MaxMonthlyExternalDataTransferGbytes** | **float32** | | -**MaxMonthlyProxySerps** | **int32** | | -**MaxMonthlyResidentialProxyGbytes** | **float32** | | -**MaxActorMemoryGbytes** | **float32** | | -**MaxActorCount** | **int32** | | -**MaxActorTaskCount** | **int32** | | -**MaxConcurrentActorJobs** | **int32** | | -**MaxTeamAccountSeatCount** | **int32** | | -**DataRetentionDays** | **int32** | | -**MaxScheduleCount** | Pointer to **int32** | | [optional] - -## Methods - -### NewLimits - -`func NewLimits(maxMonthlyUsageUsd float32, maxMonthlyActorComputeUnits float32, maxMonthlyExternalDataTransferGbytes float32, maxMonthlyProxySerps int32, maxMonthlyResidentialProxyGbytes float32, maxActorMemoryGbytes float32, maxActorCount int32, maxActorTaskCount int32, maxConcurrentActorJobs int32, maxTeamAccountSeatCount int32, dataRetentionDays int32, ) *Limits` - -NewLimits instantiates a new Limits object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewLimitsWithDefaults - -`func NewLimitsWithDefaults() *Limits` - -NewLimitsWithDefaults instantiates a new Limits object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetMaxMonthlyUsageUsd - -`func (o *Limits) GetMaxMonthlyUsageUsd() float32` - -GetMaxMonthlyUsageUsd returns the MaxMonthlyUsageUsd field if non-nil, zero value otherwise. - -### GetMaxMonthlyUsageUsdOk - -`func (o *Limits) GetMaxMonthlyUsageUsdOk() (*float32, bool)` - -GetMaxMonthlyUsageUsdOk returns a tuple with the MaxMonthlyUsageUsd field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetMaxMonthlyUsageUsd - -`func (o *Limits) SetMaxMonthlyUsageUsd(v float32)` - -SetMaxMonthlyUsageUsd sets MaxMonthlyUsageUsd field to given value. - - -### GetMaxMonthlyActorComputeUnits - -`func (o *Limits) GetMaxMonthlyActorComputeUnits() float32` - -GetMaxMonthlyActorComputeUnits returns the MaxMonthlyActorComputeUnits field if non-nil, zero value otherwise. - -### GetMaxMonthlyActorComputeUnitsOk - -`func (o *Limits) GetMaxMonthlyActorComputeUnitsOk() (*float32, bool)` - -GetMaxMonthlyActorComputeUnitsOk returns a tuple with the MaxMonthlyActorComputeUnits field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetMaxMonthlyActorComputeUnits - -`func (o *Limits) SetMaxMonthlyActorComputeUnits(v float32)` - -SetMaxMonthlyActorComputeUnits sets MaxMonthlyActorComputeUnits field to given value. - - -### GetMaxMonthlyExternalDataTransferGbytes - -`func (o *Limits) GetMaxMonthlyExternalDataTransferGbytes() float32` - -GetMaxMonthlyExternalDataTransferGbytes returns the MaxMonthlyExternalDataTransferGbytes field if non-nil, zero value otherwise. - -### GetMaxMonthlyExternalDataTransferGbytesOk - -`func (o *Limits) GetMaxMonthlyExternalDataTransferGbytesOk() (*float32, bool)` - -GetMaxMonthlyExternalDataTransferGbytesOk returns a tuple with the MaxMonthlyExternalDataTransferGbytes field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetMaxMonthlyExternalDataTransferGbytes - -`func (o *Limits) SetMaxMonthlyExternalDataTransferGbytes(v float32)` - -SetMaxMonthlyExternalDataTransferGbytes sets MaxMonthlyExternalDataTransferGbytes field to given value. - - -### GetMaxMonthlyProxySerps - -`func (o *Limits) GetMaxMonthlyProxySerps() int32` - -GetMaxMonthlyProxySerps returns the MaxMonthlyProxySerps field if non-nil, zero value otherwise. - -### GetMaxMonthlyProxySerpsOk - -`func (o *Limits) GetMaxMonthlyProxySerpsOk() (*int32, bool)` - -GetMaxMonthlyProxySerpsOk returns a tuple with the MaxMonthlyProxySerps field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetMaxMonthlyProxySerps - -`func (o *Limits) SetMaxMonthlyProxySerps(v int32)` - -SetMaxMonthlyProxySerps sets MaxMonthlyProxySerps field to given value. - - -### GetMaxMonthlyResidentialProxyGbytes - -`func (o *Limits) GetMaxMonthlyResidentialProxyGbytes() float32` - -GetMaxMonthlyResidentialProxyGbytes returns the MaxMonthlyResidentialProxyGbytes field if non-nil, zero value otherwise. - -### GetMaxMonthlyResidentialProxyGbytesOk - -`func (o *Limits) GetMaxMonthlyResidentialProxyGbytesOk() (*float32, bool)` - -GetMaxMonthlyResidentialProxyGbytesOk returns a tuple with the MaxMonthlyResidentialProxyGbytes field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetMaxMonthlyResidentialProxyGbytes - -`func (o *Limits) SetMaxMonthlyResidentialProxyGbytes(v float32)` - -SetMaxMonthlyResidentialProxyGbytes sets MaxMonthlyResidentialProxyGbytes field to given value. - - -### GetMaxActorMemoryGbytes - -`func (o *Limits) GetMaxActorMemoryGbytes() float32` - -GetMaxActorMemoryGbytes returns the MaxActorMemoryGbytes field if non-nil, zero value otherwise. - -### GetMaxActorMemoryGbytesOk - -`func (o *Limits) GetMaxActorMemoryGbytesOk() (*float32, bool)` - -GetMaxActorMemoryGbytesOk returns a tuple with the MaxActorMemoryGbytes field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetMaxActorMemoryGbytes - -`func (o *Limits) SetMaxActorMemoryGbytes(v float32)` - -SetMaxActorMemoryGbytes sets MaxActorMemoryGbytes field to given value. - - -### GetMaxActorCount - -`func (o *Limits) GetMaxActorCount() int32` - -GetMaxActorCount returns the MaxActorCount field if non-nil, zero value otherwise. - -### GetMaxActorCountOk - -`func (o *Limits) GetMaxActorCountOk() (*int32, bool)` - -GetMaxActorCountOk returns a tuple with the MaxActorCount field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetMaxActorCount - -`func (o *Limits) SetMaxActorCount(v int32)` - -SetMaxActorCount sets MaxActorCount field to given value. - - -### GetMaxActorTaskCount - -`func (o *Limits) GetMaxActorTaskCount() int32` - -GetMaxActorTaskCount returns the MaxActorTaskCount field if non-nil, zero value otherwise. - -### GetMaxActorTaskCountOk - -`func (o *Limits) GetMaxActorTaskCountOk() (*int32, bool)` - -GetMaxActorTaskCountOk returns a tuple with the MaxActorTaskCount field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetMaxActorTaskCount - -`func (o *Limits) SetMaxActorTaskCount(v int32)` - -SetMaxActorTaskCount sets MaxActorTaskCount field to given value. - - -### GetMaxConcurrentActorJobs - -`func (o *Limits) GetMaxConcurrentActorJobs() int32` - -GetMaxConcurrentActorJobs returns the MaxConcurrentActorJobs field if non-nil, zero value otherwise. - -### GetMaxConcurrentActorJobsOk - -`func (o *Limits) GetMaxConcurrentActorJobsOk() (*int32, bool)` - -GetMaxConcurrentActorJobsOk returns a tuple with the MaxConcurrentActorJobs field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetMaxConcurrentActorJobs - -`func (o *Limits) SetMaxConcurrentActorJobs(v int32)` - -SetMaxConcurrentActorJobs sets MaxConcurrentActorJobs field to given value. - - -### GetMaxTeamAccountSeatCount - -`func (o *Limits) GetMaxTeamAccountSeatCount() int32` - -GetMaxTeamAccountSeatCount returns the MaxTeamAccountSeatCount field if non-nil, zero value otherwise. - -### GetMaxTeamAccountSeatCountOk - -`func (o *Limits) GetMaxTeamAccountSeatCountOk() (*int32, bool)` - -GetMaxTeamAccountSeatCountOk returns a tuple with the MaxTeamAccountSeatCount field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetMaxTeamAccountSeatCount - -`func (o *Limits) SetMaxTeamAccountSeatCount(v int32)` - -SetMaxTeamAccountSeatCount sets MaxTeamAccountSeatCount field to given value. - - -### GetDataRetentionDays - -`func (o *Limits) GetDataRetentionDays() int32` - -GetDataRetentionDays returns the DataRetentionDays field if non-nil, zero value otherwise. - -### GetDataRetentionDaysOk - -`func (o *Limits) GetDataRetentionDaysOk() (*int32, bool)` - -GetDataRetentionDaysOk returns a tuple with the DataRetentionDays field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetDataRetentionDays - -`func (o *Limits) SetDataRetentionDays(v int32)` - -SetDataRetentionDays sets DataRetentionDays field to given value. - - -### GetMaxScheduleCount - -`func (o *Limits) GetMaxScheduleCount() int32` - -GetMaxScheduleCount returns the MaxScheduleCount field if non-nil, zero value otherwise. - -### GetMaxScheduleCountOk - -`func (o *Limits) GetMaxScheduleCountOk() (*int32, bool)` - -GetMaxScheduleCountOk returns a tuple with the MaxScheduleCount field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetMaxScheduleCount - -`func (o *Limits) SetMaxScheduleCount(v int32)` - -SetMaxScheduleCount sets MaxScheduleCount field to given value. - -### HasMaxScheduleCount - -`func (o *Limits) HasMaxScheduleCount() bool` - -HasMaxScheduleCount returns a boolean if a field has been set. - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/LimitsResponse.md b/docs/LimitsResponse.md deleted file mode 100644 index 0e0bca3..0000000 --- a/docs/LimitsResponse.md +++ /dev/null @@ -1,51 +0,0 @@ -# LimitsResponse - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Data** | [**AccountLimits**](AccountLimits.md) | | - -## Methods - -### NewLimitsResponse - -`func NewLimitsResponse(data AccountLimits, ) *LimitsResponse` - -NewLimitsResponse instantiates a new LimitsResponse object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewLimitsResponseWithDefaults - -`func NewLimitsResponseWithDefaults() *LimitsResponse` - -NewLimitsResponseWithDefaults instantiates a new LimitsResponse object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetData - -`func (o *LimitsResponse) GetData() AccountLimits` - -GetData returns the Data field if non-nil, zero value otherwise. - -### GetDataOk - -`func (o *LimitsResponse) GetDataOk() (*AccountLimits, bool)` - -GetDataOk returns a tuple with the Data field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetData - -`func (o *LimitsResponse) SetData(v AccountLimits)` - -SetData sets Data field to given value. - - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/ListOfActors.md b/docs/ListOfActors.md deleted file mode 100644 index ee4559b..0000000 --- a/docs/ListOfActors.md +++ /dev/null @@ -1,156 +0,0 @@ -# ListOfActors - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Total** | **int32** | The total number of items available across all pages. | -**Offset** | **int32** | The starting position for this page of results. | -**Limit** | **int32** | The maximum number of items returned per page. | -**Desc** | **bool** | Whether the results are sorted in descending order. | -**Count** | **int32** | The number of items returned in this response. | -**Items** | [**[]ActorShort**](ActorShort.md) | | - -## Methods - -### NewListOfActors - -`func NewListOfActors(total int32, offset int32, limit int32, desc bool, count int32, items []ActorShort, ) *ListOfActors` - -NewListOfActors instantiates a new ListOfActors object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewListOfActorsWithDefaults - -`func NewListOfActorsWithDefaults() *ListOfActors` - -NewListOfActorsWithDefaults instantiates a new ListOfActors object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetTotal - -`func (o *ListOfActors) GetTotal() int32` - -GetTotal returns the Total field if non-nil, zero value otherwise. - -### GetTotalOk - -`func (o *ListOfActors) GetTotalOk() (*int32, bool)` - -GetTotalOk returns a tuple with the Total field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetTotal - -`func (o *ListOfActors) SetTotal(v int32)` - -SetTotal sets Total field to given value. - - -### GetOffset - -`func (o *ListOfActors) GetOffset() int32` - -GetOffset returns the Offset field if non-nil, zero value otherwise. - -### GetOffsetOk - -`func (o *ListOfActors) GetOffsetOk() (*int32, bool)` - -GetOffsetOk returns a tuple with the Offset field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetOffset - -`func (o *ListOfActors) SetOffset(v int32)` - -SetOffset sets Offset field to given value. - - -### GetLimit - -`func (o *ListOfActors) GetLimit() int32` - -GetLimit returns the Limit field if non-nil, zero value otherwise. - -### GetLimitOk - -`func (o *ListOfActors) GetLimitOk() (*int32, bool)` - -GetLimitOk returns a tuple with the Limit field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetLimit - -`func (o *ListOfActors) SetLimit(v int32)` - -SetLimit sets Limit field to given value. - - -### GetDesc - -`func (o *ListOfActors) GetDesc() bool` - -GetDesc returns the Desc field if non-nil, zero value otherwise. - -### GetDescOk - -`func (o *ListOfActors) GetDescOk() (*bool, bool)` - -GetDescOk returns a tuple with the Desc field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetDesc - -`func (o *ListOfActors) SetDesc(v bool)` - -SetDesc sets Desc field to given value. - - -### GetCount - -`func (o *ListOfActors) GetCount() int32` - -GetCount returns the Count field if non-nil, zero value otherwise. - -### GetCountOk - -`func (o *ListOfActors) GetCountOk() (*int32, bool)` - -GetCountOk returns a tuple with the Count field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetCount - -`func (o *ListOfActors) SetCount(v int32)` - -SetCount sets Count field to given value. - - -### GetItems - -`func (o *ListOfActors) GetItems() []ActorShort` - -GetItems returns the Items field if non-nil, zero value otherwise. - -### GetItemsOk - -`func (o *ListOfActors) GetItemsOk() (*[]ActorShort, bool)` - -GetItemsOk returns a tuple with the Items field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetItems - -`func (o *ListOfActors) SetItems(v []ActorShort)` - -SetItems sets Items field to given value. - - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/ListOfActorsInStoreResponse.md b/docs/ListOfActorsInStoreResponse.md deleted file mode 100644 index a786872..0000000 --- a/docs/ListOfActorsInStoreResponse.md +++ /dev/null @@ -1,51 +0,0 @@ -# ListOfActorsInStoreResponse - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Data** | [**ListOfStoreActors**](ListOfStoreActors.md) | | - -## Methods - -### NewListOfActorsInStoreResponse - -`func NewListOfActorsInStoreResponse(data ListOfStoreActors, ) *ListOfActorsInStoreResponse` - -NewListOfActorsInStoreResponse instantiates a new ListOfActorsInStoreResponse object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewListOfActorsInStoreResponseWithDefaults - -`func NewListOfActorsInStoreResponseWithDefaults() *ListOfActorsInStoreResponse` - -NewListOfActorsInStoreResponseWithDefaults instantiates a new ListOfActorsInStoreResponse object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetData - -`func (o *ListOfActorsInStoreResponse) GetData() ListOfStoreActors` - -GetData returns the Data field if non-nil, zero value otherwise. - -### GetDataOk - -`func (o *ListOfActorsInStoreResponse) GetDataOk() (*ListOfStoreActors, bool)` - -GetDataOk returns a tuple with the Data field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetData - -`func (o *ListOfActorsInStoreResponse) SetData(v ListOfStoreActors)` - -SetData sets Data field to given value. - - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/ListOfActorsResponse.md b/docs/ListOfActorsResponse.md deleted file mode 100644 index 3152e69..0000000 --- a/docs/ListOfActorsResponse.md +++ /dev/null @@ -1,51 +0,0 @@ -# ListOfActorsResponse - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Data** | [**ListOfActors**](ListOfActors.md) | | - -## Methods - -### NewListOfActorsResponse - -`func NewListOfActorsResponse(data ListOfActors, ) *ListOfActorsResponse` - -NewListOfActorsResponse instantiates a new ListOfActorsResponse object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewListOfActorsResponseWithDefaults - -`func NewListOfActorsResponseWithDefaults() *ListOfActorsResponse` - -NewListOfActorsResponseWithDefaults instantiates a new ListOfActorsResponse object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetData - -`func (o *ListOfActorsResponse) GetData() ListOfActors` - -GetData returns the Data field if non-nil, zero value otherwise. - -### GetDataOk - -`func (o *ListOfActorsResponse) GetDataOk() (*ListOfActors, bool)` - -GetDataOk returns a tuple with the Data field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetData - -`func (o *ListOfActorsResponse) SetData(v ListOfActors)` - -SetData sets Data field to given value. - - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/ListOfBuilds.md b/docs/ListOfBuilds.md deleted file mode 100644 index 36c2a8a..0000000 --- a/docs/ListOfBuilds.md +++ /dev/null @@ -1,156 +0,0 @@ -# ListOfBuilds - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Total** | **int32** | The total number of items available across all pages. | -**Offset** | **int32** | The starting position for this page of results. | -**Limit** | **int32** | The maximum number of items returned per page. | -**Desc** | **bool** | Whether the results are sorted in descending order. | -**Count** | **int32** | The number of items returned in this response. | -**Items** | [**[]BuildShort**](BuildShort.md) | | - -## Methods - -### NewListOfBuilds - -`func NewListOfBuilds(total int32, offset int32, limit int32, desc bool, count int32, items []BuildShort, ) *ListOfBuilds` - -NewListOfBuilds instantiates a new ListOfBuilds object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewListOfBuildsWithDefaults - -`func NewListOfBuildsWithDefaults() *ListOfBuilds` - -NewListOfBuildsWithDefaults instantiates a new ListOfBuilds object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetTotal - -`func (o *ListOfBuilds) GetTotal() int32` - -GetTotal returns the Total field if non-nil, zero value otherwise. - -### GetTotalOk - -`func (o *ListOfBuilds) GetTotalOk() (*int32, bool)` - -GetTotalOk returns a tuple with the Total field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetTotal - -`func (o *ListOfBuilds) SetTotal(v int32)` - -SetTotal sets Total field to given value. - - -### GetOffset - -`func (o *ListOfBuilds) GetOffset() int32` - -GetOffset returns the Offset field if non-nil, zero value otherwise. - -### GetOffsetOk - -`func (o *ListOfBuilds) GetOffsetOk() (*int32, bool)` - -GetOffsetOk returns a tuple with the Offset field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetOffset - -`func (o *ListOfBuilds) SetOffset(v int32)` - -SetOffset sets Offset field to given value. - - -### GetLimit - -`func (o *ListOfBuilds) GetLimit() int32` - -GetLimit returns the Limit field if non-nil, zero value otherwise. - -### GetLimitOk - -`func (o *ListOfBuilds) GetLimitOk() (*int32, bool)` - -GetLimitOk returns a tuple with the Limit field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetLimit - -`func (o *ListOfBuilds) SetLimit(v int32)` - -SetLimit sets Limit field to given value. - - -### GetDesc - -`func (o *ListOfBuilds) GetDesc() bool` - -GetDesc returns the Desc field if non-nil, zero value otherwise. - -### GetDescOk - -`func (o *ListOfBuilds) GetDescOk() (*bool, bool)` - -GetDescOk returns a tuple with the Desc field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetDesc - -`func (o *ListOfBuilds) SetDesc(v bool)` - -SetDesc sets Desc field to given value. - - -### GetCount - -`func (o *ListOfBuilds) GetCount() int32` - -GetCount returns the Count field if non-nil, zero value otherwise. - -### GetCountOk - -`func (o *ListOfBuilds) GetCountOk() (*int32, bool)` - -GetCountOk returns a tuple with the Count field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetCount - -`func (o *ListOfBuilds) SetCount(v int32)` - -SetCount sets Count field to given value. - - -### GetItems - -`func (o *ListOfBuilds) GetItems() []BuildShort` - -GetItems returns the Items field if non-nil, zero value otherwise. - -### GetItemsOk - -`func (o *ListOfBuilds) GetItemsOk() (*[]BuildShort, bool)` - -GetItemsOk returns a tuple with the Items field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetItems - -`func (o *ListOfBuilds) SetItems(v []BuildShort)` - -SetItems sets Items field to given value. - - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/ListOfBuildsResponse.md b/docs/ListOfBuildsResponse.md deleted file mode 100644 index 4ce57f8..0000000 --- a/docs/ListOfBuildsResponse.md +++ /dev/null @@ -1,51 +0,0 @@ -# ListOfBuildsResponse - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Data** | [**ListOfBuilds**](ListOfBuilds.md) | | - -## Methods - -### NewListOfBuildsResponse - -`func NewListOfBuildsResponse(data ListOfBuilds, ) *ListOfBuildsResponse` - -NewListOfBuildsResponse instantiates a new ListOfBuildsResponse object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewListOfBuildsResponseWithDefaults - -`func NewListOfBuildsResponseWithDefaults() *ListOfBuildsResponse` - -NewListOfBuildsResponseWithDefaults instantiates a new ListOfBuildsResponse object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetData - -`func (o *ListOfBuildsResponse) GetData() ListOfBuilds` - -GetData returns the Data field if non-nil, zero value otherwise. - -### GetDataOk - -`func (o *ListOfBuildsResponse) GetDataOk() (*ListOfBuilds, bool)` - -GetDataOk returns a tuple with the Data field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetData - -`func (o *ListOfBuildsResponse) SetData(v ListOfBuilds)` - -SetData sets Data field to given value. - - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/ListOfDatasets.md b/docs/ListOfDatasets.md deleted file mode 100644 index fc5e8e7..0000000 --- a/docs/ListOfDatasets.md +++ /dev/null @@ -1,182 +0,0 @@ -# ListOfDatasets - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Total** | **int32** | The total number of items available across all pages. | -**Offset** | **int32** | The starting position for this page of results. | -**Limit** | **int32** | The maximum number of items returned per page. | -**Desc** | **bool** | Whether the results are sorted in descending order. | -**Count** | **int32** | The number of items returned in this response. | -**Unnamed** | Pointer to **bool** | Whether the listing was filtered to only unnamed datasets. | [optional] -**Items** | [**[]DatasetListItem**](DatasetListItem.md) | | - -## Methods - -### NewListOfDatasets - -`func NewListOfDatasets(total int32, offset int32, limit int32, desc bool, count int32, items []DatasetListItem, ) *ListOfDatasets` - -NewListOfDatasets instantiates a new ListOfDatasets object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewListOfDatasetsWithDefaults - -`func NewListOfDatasetsWithDefaults() *ListOfDatasets` - -NewListOfDatasetsWithDefaults instantiates a new ListOfDatasets object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetTotal - -`func (o *ListOfDatasets) GetTotal() int32` - -GetTotal returns the Total field if non-nil, zero value otherwise. - -### GetTotalOk - -`func (o *ListOfDatasets) GetTotalOk() (*int32, bool)` - -GetTotalOk returns a tuple with the Total field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetTotal - -`func (o *ListOfDatasets) SetTotal(v int32)` - -SetTotal sets Total field to given value. - - -### GetOffset - -`func (o *ListOfDatasets) GetOffset() int32` - -GetOffset returns the Offset field if non-nil, zero value otherwise. - -### GetOffsetOk - -`func (o *ListOfDatasets) GetOffsetOk() (*int32, bool)` - -GetOffsetOk returns a tuple with the Offset field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetOffset - -`func (o *ListOfDatasets) SetOffset(v int32)` - -SetOffset sets Offset field to given value. - - -### GetLimit - -`func (o *ListOfDatasets) GetLimit() int32` - -GetLimit returns the Limit field if non-nil, zero value otherwise. - -### GetLimitOk - -`func (o *ListOfDatasets) GetLimitOk() (*int32, bool)` - -GetLimitOk returns a tuple with the Limit field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetLimit - -`func (o *ListOfDatasets) SetLimit(v int32)` - -SetLimit sets Limit field to given value. - - -### GetDesc - -`func (o *ListOfDatasets) GetDesc() bool` - -GetDesc returns the Desc field if non-nil, zero value otherwise. - -### GetDescOk - -`func (o *ListOfDatasets) GetDescOk() (*bool, bool)` - -GetDescOk returns a tuple with the Desc field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetDesc - -`func (o *ListOfDatasets) SetDesc(v bool)` - -SetDesc sets Desc field to given value. - - -### GetCount - -`func (o *ListOfDatasets) GetCount() int32` - -GetCount returns the Count field if non-nil, zero value otherwise. - -### GetCountOk - -`func (o *ListOfDatasets) GetCountOk() (*int32, bool)` - -GetCountOk returns a tuple with the Count field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetCount - -`func (o *ListOfDatasets) SetCount(v int32)` - -SetCount sets Count field to given value. - - -### GetUnnamed - -`func (o *ListOfDatasets) GetUnnamed() bool` - -GetUnnamed returns the Unnamed field if non-nil, zero value otherwise. - -### GetUnnamedOk - -`func (o *ListOfDatasets) GetUnnamedOk() (*bool, bool)` - -GetUnnamedOk returns a tuple with the Unnamed field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetUnnamed - -`func (o *ListOfDatasets) SetUnnamed(v bool)` - -SetUnnamed sets Unnamed field to given value. - -### HasUnnamed - -`func (o *ListOfDatasets) HasUnnamed() bool` - -HasUnnamed returns a boolean if a field has been set. - -### GetItems - -`func (o *ListOfDatasets) GetItems() []DatasetListItem` - -GetItems returns the Items field if non-nil, zero value otherwise. - -### GetItemsOk - -`func (o *ListOfDatasets) GetItemsOk() (*[]DatasetListItem, bool)` - -GetItemsOk returns a tuple with the Items field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetItems - -`func (o *ListOfDatasets) SetItems(v []DatasetListItem)` - -SetItems sets Items field to given value. - - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/ListOfDatasetsResponse.md b/docs/ListOfDatasetsResponse.md deleted file mode 100644 index b2bb55e..0000000 --- a/docs/ListOfDatasetsResponse.md +++ /dev/null @@ -1,51 +0,0 @@ -# ListOfDatasetsResponse - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Data** | [**ListOfDatasets**](ListOfDatasets.md) | | - -## Methods - -### NewListOfDatasetsResponse - -`func NewListOfDatasetsResponse(data ListOfDatasets, ) *ListOfDatasetsResponse` - -NewListOfDatasetsResponse instantiates a new ListOfDatasetsResponse object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewListOfDatasetsResponseWithDefaults - -`func NewListOfDatasetsResponseWithDefaults() *ListOfDatasetsResponse` - -NewListOfDatasetsResponseWithDefaults instantiates a new ListOfDatasetsResponse object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetData - -`func (o *ListOfDatasetsResponse) GetData() ListOfDatasets` - -GetData returns the Data field if non-nil, zero value otherwise. - -### GetDataOk - -`func (o *ListOfDatasetsResponse) GetDataOk() (*ListOfDatasets, bool)` - -GetDataOk returns a tuple with the Data field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetData - -`func (o *ListOfDatasetsResponse) SetData(v ListOfDatasets)` - -SetData sets Data field to given value. - - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/ListOfEnvVars.md b/docs/ListOfEnvVars.md deleted file mode 100644 index b26bcd0..0000000 --- a/docs/ListOfEnvVars.md +++ /dev/null @@ -1,72 +0,0 @@ -# ListOfEnvVars - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Total** | **int32** | | -**Items** | [**[]EnvVar**](EnvVar.md) | | - -## Methods - -### NewListOfEnvVars - -`func NewListOfEnvVars(total int32, items []EnvVar, ) *ListOfEnvVars` - -NewListOfEnvVars instantiates a new ListOfEnvVars object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewListOfEnvVarsWithDefaults - -`func NewListOfEnvVarsWithDefaults() *ListOfEnvVars` - -NewListOfEnvVarsWithDefaults instantiates a new ListOfEnvVars object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetTotal - -`func (o *ListOfEnvVars) GetTotal() int32` - -GetTotal returns the Total field if non-nil, zero value otherwise. - -### GetTotalOk - -`func (o *ListOfEnvVars) GetTotalOk() (*int32, bool)` - -GetTotalOk returns a tuple with the Total field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetTotal - -`func (o *ListOfEnvVars) SetTotal(v int32)` - -SetTotal sets Total field to given value. - - -### GetItems - -`func (o *ListOfEnvVars) GetItems() []EnvVar` - -GetItems returns the Items field if non-nil, zero value otherwise. - -### GetItemsOk - -`func (o *ListOfEnvVars) GetItemsOk() (*[]EnvVar, bool)` - -GetItemsOk returns a tuple with the Items field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetItems - -`func (o *ListOfEnvVars) SetItems(v []EnvVar)` - -SetItems sets Items field to given value. - - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/ListOfEnvVarsResponse.md b/docs/ListOfEnvVarsResponse.md deleted file mode 100644 index e36d5d0..0000000 --- a/docs/ListOfEnvVarsResponse.md +++ /dev/null @@ -1,51 +0,0 @@ -# ListOfEnvVarsResponse - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Data** | [**ListOfEnvVars**](ListOfEnvVars.md) | | - -## Methods - -### NewListOfEnvVarsResponse - -`func NewListOfEnvVarsResponse(data ListOfEnvVars, ) *ListOfEnvVarsResponse` - -NewListOfEnvVarsResponse instantiates a new ListOfEnvVarsResponse object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewListOfEnvVarsResponseWithDefaults - -`func NewListOfEnvVarsResponseWithDefaults() *ListOfEnvVarsResponse` - -NewListOfEnvVarsResponseWithDefaults instantiates a new ListOfEnvVarsResponse object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetData - -`func (o *ListOfEnvVarsResponse) GetData() ListOfEnvVars` - -GetData returns the Data field if non-nil, zero value otherwise. - -### GetDataOk - -`func (o *ListOfEnvVarsResponse) GetDataOk() (*ListOfEnvVars, bool)` - -GetDataOk returns a tuple with the Data field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetData - -`func (o *ListOfEnvVarsResponse) SetData(v ListOfEnvVars)` - -SetData sets Data field to given value. - - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/ListOfKeyValueStores.md b/docs/ListOfKeyValueStores.md deleted file mode 100644 index 75b8f71..0000000 --- a/docs/ListOfKeyValueStores.md +++ /dev/null @@ -1,182 +0,0 @@ -# ListOfKeyValueStores - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Total** | **int32** | The total number of items available across all pages. | -**Offset** | **int32** | The starting position for this page of results. | -**Limit** | **int32** | The maximum number of items returned per page. | -**Desc** | **bool** | Whether the results are sorted in descending order. | -**Count** | **int32** | The number of items returned in this response. | -**Unnamed** | Pointer to **bool** | Whether the listing was filtered to only unnamed key-value stores. | [optional] -**Items** | [**[]KeyValueStore**](KeyValueStore.md) | | - -## Methods - -### NewListOfKeyValueStores - -`func NewListOfKeyValueStores(total int32, offset int32, limit int32, desc bool, count int32, items []KeyValueStore, ) *ListOfKeyValueStores` - -NewListOfKeyValueStores instantiates a new ListOfKeyValueStores object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewListOfKeyValueStoresWithDefaults - -`func NewListOfKeyValueStoresWithDefaults() *ListOfKeyValueStores` - -NewListOfKeyValueStoresWithDefaults instantiates a new ListOfKeyValueStores object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetTotal - -`func (o *ListOfKeyValueStores) GetTotal() int32` - -GetTotal returns the Total field if non-nil, zero value otherwise. - -### GetTotalOk - -`func (o *ListOfKeyValueStores) GetTotalOk() (*int32, bool)` - -GetTotalOk returns a tuple with the Total field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetTotal - -`func (o *ListOfKeyValueStores) SetTotal(v int32)` - -SetTotal sets Total field to given value. - - -### GetOffset - -`func (o *ListOfKeyValueStores) GetOffset() int32` - -GetOffset returns the Offset field if non-nil, zero value otherwise. - -### GetOffsetOk - -`func (o *ListOfKeyValueStores) GetOffsetOk() (*int32, bool)` - -GetOffsetOk returns a tuple with the Offset field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetOffset - -`func (o *ListOfKeyValueStores) SetOffset(v int32)` - -SetOffset sets Offset field to given value. - - -### GetLimit - -`func (o *ListOfKeyValueStores) GetLimit() int32` - -GetLimit returns the Limit field if non-nil, zero value otherwise. - -### GetLimitOk - -`func (o *ListOfKeyValueStores) GetLimitOk() (*int32, bool)` - -GetLimitOk returns a tuple with the Limit field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetLimit - -`func (o *ListOfKeyValueStores) SetLimit(v int32)` - -SetLimit sets Limit field to given value. - - -### GetDesc - -`func (o *ListOfKeyValueStores) GetDesc() bool` - -GetDesc returns the Desc field if non-nil, zero value otherwise. - -### GetDescOk - -`func (o *ListOfKeyValueStores) GetDescOk() (*bool, bool)` - -GetDescOk returns a tuple with the Desc field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetDesc - -`func (o *ListOfKeyValueStores) SetDesc(v bool)` - -SetDesc sets Desc field to given value. - - -### GetCount - -`func (o *ListOfKeyValueStores) GetCount() int32` - -GetCount returns the Count field if non-nil, zero value otherwise. - -### GetCountOk - -`func (o *ListOfKeyValueStores) GetCountOk() (*int32, bool)` - -GetCountOk returns a tuple with the Count field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetCount - -`func (o *ListOfKeyValueStores) SetCount(v int32)` - -SetCount sets Count field to given value. - - -### GetUnnamed - -`func (o *ListOfKeyValueStores) GetUnnamed() bool` - -GetUnnamed returns the Unnamed field if non-nil, zero value otherwise. - -### GetUnnamedOk - -`func (o *ListOfKeyValueStores) GetUnnamedOk() (*bool, bool)` - -GetUnnamedOk returns a tuple with the Unnamed field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetUnnamed - -`func (o *ListOfKeyValueStores) SetUnnamed(v bool)` - -SetUnnamed sets Unnamed field to given value. - -### HasUnnamed - -`func (o *ListOfKeyValueStores) HasUnnamed() bool` - -HasUnnamed returns a boolean if a field has been set. - -### GetItems - -`func (o *ListOfKeyValueStores) GetItems() []KeyValueStore` - -GetItems returns the Items field if non-nil, zero value otherwise. - -### GetItemsOk - -`func (o *ListOfKeyValueStores) GetItemsOk() (*[]KeyValueStore, bool)` - -GetItemsOk returns a tuple with the Items field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetItems - -`func (o *ListOfKeyValueStores) SetItems(v []KeyValueStore)` - -SetItems sets Items field to given value. - - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/ListOfKeyValueStoresResponse.md b/docs/ListOfKeyValueStoresResponse.md deleted file mode 100644 index 4319119..0000000 --- a/docs/ListOfKeyValueStoresResponse.md +++ /dev/null @@ -1,51 +0,0 @@ -# ListOfKeyValueStoresResponse - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Data** | [**ListOfKeyValueStores**](ListOfKeyValueStores.md) | | - -## Methods - -### NewListOfKeyValueStoresResponse - -`func NewListOfKeyValueStoresResponse(data ListOfKeyValueStores, ) *ListOfKeyValueStoresResponse` - -NewListOfKeyValueStoresResponse instantiates a new ListOfKeyValueStoresResponse object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewListOfKeyValueStoresResponseWithDefaults - -`func NewListOfKeyValueStoresResponseWithDefaults() *ListOfKeyValueStoresResponse` - -NewListOfKeyValueStoresResponseWithDefaults instantiates a new ListOfKeyValueStoresResponse object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetData - -`func (o *ListOfKeyValueStoresResponse) GetData() ListOfKeyValueStores` - -GetData returns the Data field if non-nil, zero value otherwise. - -### GetDataOk - -`func (o *ListOfKeyValueStoresResponse) GetDataOk() (*ListOfKeyValueStores, bool)` - -GetDataOk returns a tuple with the Data field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetData - -`func (o *ListOfKeyValueStoresResponse) SetData(v ListOfKeyValueStores)` - -SetData sets Data field to given value. - - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/ListOfKeys.md b/docs/ListOfKeys.md deleted file mode 100644 index 1f8e460..0000000 --- a/docs/ListOfKeys.md +++ /dev/null @@ -1,186 +0,0 @@ -# ListOfKeys - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Items** | [**[]KeyValueStoreKey**](KeyValueStoreKey.md) | | -**Count** | **int32** | | -**Limit** | **int32** | | -**ExclusiveStartKey** | Pointer to **NullableString** | | [optional] -**IsTruncated** | **bool** | | -**NextExclusiveStartKey** | Pointer to **NullableString** | | [optional] - -## Methods - -### NewListOfKeys - -`func NewListOfKeys(items []KeyValueStoreKey, count int32, limit int32, isTruncated bool, ) *ListOfKeys` - -NewListOfKeys instantiates a new ListOfKeys object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewListOfKeysWithDefaults - -`func NewListOfKeysWithDefaults() *ListOfKeys` - -NewListOfKeysWithDefaults instantiates a new ListOfKeys object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetItems - -`func (o *ListOfKeys) GetItems() []KeyValueStoreKey` - -GetItems returns the Items field if non-nil, zero value otherwise. - -### GetItemsOk - -`func (o *ListOfKeys) GetItemsOk() (*[]KeyValueStoreKey, bool)` - -GetItemsOk returns a tuple with the Items field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetItems - -`func (o *ListOfKeys) SetItems(v []KeyValueStoreKey)` - -SetItems sets Items field to given value. - - -### GetCount - -`func (o *ListOfKeys) GetCount() int32` - -GetCount returns the Count field if non-nil, zero value otherwise. - -### GetCountOk - -`func (o *ListOfKeys) GetCountOk() (*int32, bool)` - -GetCountOk returns a tuple with the Count field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetCount - -`func (o *ListOfKeys) SetCount(v int32)` - -SetCount sets Count field to given value. - - -### GetLimit - -`func (o *ListOfKeys) GetLimit() int32` - -GetLimit returns the Limit field if non-nil, zero value otherwise. - -### GetLimitOk - -`func (o *ListOfKeys) GetLimitOk() (*int32, bool)` - -GetLimitOk returns a tuple with the Limit field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetLimit - -`func (o *ListOfKeys) SetLimit(v int32)` - -SetLimit sets Limit field to given value. - - -### GetExclusiveStartKey - -`func (o *ListOfKeys) GetExclusiveStartKey() string` - -GetExclusiveStartKey returns the ExclusiveStartKey field if non-nil, zero value otherwise. - -### GetExclusiveStartKeyOk - -`func (o *ListOfKeys) GetExclusiveStartKeyOk() (*string, bool)` - -GetExclusiveStartKeyOk returns a tuple with the ExclusiveStartKey field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetExclusiveStartKey - -`func (o *ListOfKeys) SetExclusiveStartKey(v string)` - -SetExclusiveStartKey sets ExclusiveStartKey field to given value. - -### HasExclusiveStartKey - -`func (o *ListOfKeys) HasExclusiveStartKey() bool` - -HasExclusiveStartKey returns a boolean if a field has been set. - -### SetExclusiveStartKeyNil - -`func (o *ListOfKeys) SetExclusiveStartKeyNil(b bool)` - - SetExclusiveStartKeyNil sets the value for ExclusiveStartKey to be an explicit nil - -### UnsetExclusiveStartKey -`func (o *ListOfKeys) UnsetExclusiveStartKey()` - -UnsetExclusiveStartKey ensures that no value is present for ExclusiveStartKey, not even an explicit nil -### GetIsTruncated - -`func (o *ListOfKeys) GetIsTruncated() bool` - -GetIsTruncated returns the IsTruncated field if non-nil, zero value otherwise. - -### GetIsTruncatedOk - -`func (o *ListOfKeys) GetIsTruncatedOk() (*bool, bool)` - -GetIsTruncatedOk returns a tuple with the IsTruncated field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetIsTruncated - -`func (o *ListOfKeys) SetIsTruncated(v bool)` - -SetIsTruncated sets IsTruncated field to given value. - - -### GetNextExclusiveStartKey - -`func (o *ListOfKeys) GetNextExclusiveStartKey() string` - -GetNextExclusiveStartKey returns the NextExclusiveStartKey field if non-nil, zero value otherwise. - -### GetNextExclusiveStartKeyOk - -`func (o *ListOfKeys) GetNextExclusiveStartKeyOk() (*string, bool)` - -GetNextExclusiveStartKeyOk returns a tuple with the NextExclusiveStartKey field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetNextExclusiveStartKey - -`func (o *ListOfKeys) SetNextExclusiveStartKey(v string)` - -SetNextExclusiveStartKey sets NextExclusiveStartKey field to given value. - -### HasNextExclusiveStartKey - -`func (o *ListOfKeys) HasNextExclusiveStartKey() bool` - -HasNextExclusiveStartKey returns a boolean if a field has been set. - -### SetNextExclusiveStartKeyNil - -`func (o *ListOfKeys) SetNextExclusiveStartKeyNil(b bool)` - - SetNextExclusiveStartKeyNil sets the value for NextExclusiveStartKey to be an explicit nil - -### UnsetNextExclusiveStartKey -`func (o *ListOfKeys) UnsetNextExclusiveStartKey()` - -UnsetNextExclusiveStartKey ensures that no value is present for NextExclusiveStartKey, not even an explicit nil - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/ListOfKeysResponse.md b/docs/ListOfKeysResponse.md deleted file mode 100644 index 147e3da..0000000 --- a/docs/ListOfKeysResponse.md +++ /dev/null @@ -1,51 +0,0 @@ -# ListOfKeysResponse - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Data** | [**ListOfKeys**](ListOfKeys.md) | | - -## Methods - -### NewListOfKeysResponse - -`func NewListOfKeysResponse(data ListOfKeys, ) *ListOfKeysResponse` - -NewListOfKeysResponse instantiates a new ListOfKeysResponse object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewListOfKeysResponseWithDefaults - -`func NewListOfKeysResponseWithDefaults() *ListOfKeysResponse` - -NewListOfKeysResponseWithDefaults instantiates a new ListOfKeysResponse object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetData - -`func (o *ListOfKeysResponse) GetData() ListOfKeys` - -GetData returns the Data field if non-nil, zero value otherwise. - -### GetDataOk - -`func (o *ListOfKeysResponse) GetDataOk() (*ListOfKeys, bool)` - -GetDataOk returns a tuple with the Data field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetData - -`func (o *ListOfKeysResponse) SetData(v ListOfKeys)` - -SetData sets Data field to given value. - - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/ListOfRequestQueues.md b/docs/ListOfRequestQueues.md deleted file mode 100644 index db6a0a0..0000000 --- a/docs/ListOfRequestQueues.md +++ /dev/null @@ -1,182 +0,0 @@ -# ListOfRequestQueues - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Total** | **int32** | The total number of items available across all pages. | -**Offset** | **int32** | The starting position for this page of results. | -**Limit** | **int32** | The maximum number of items returned per page. | -**Desc** | **bool** | Whether the results are sorted in descending order. | -**Count** | **int32** | The number of items returned in this response. | -**Unnamed** | Pointer to **bool** | Whether the listing was filtered to only unnamed request queues. | [optional] -**Items** | [**[]RequestQueueShort**](RequestQueueShort.md) | The array of request queues. | - -## Methods - -### NewListOfRequestQueues - -`func NewListOfRequestQueues(total int32, offset int32, limit int32, desc bool, count int32, items []RequestQueueShort, ) *ListOfRequestQueues` - -NewListOfRequestQueues instantiates a new ListOfRequestQueues object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewListOfRequestQueuesWithDefaults - -`func NewListOfRequestQueuesWithDefaults() *ListOfRequestQueues` - -NewListOfRequestQueuesWithDefaults instantiates a new ListOfRequestQueues object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetTotal - -`func (o *ListOfRequestQueues) GetTotal() int32` - -GetTotal returns the Total field if non-nil, zero value otherwise. - -### GetTotalOk - -`func (o *ListOfRequestQueues) GetTotalOk() (*int32, bool)` - -GetTotalOk returns a tuple with the Total field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetTotal - -`func (o *ListOfRequestQueues) SetTotal(v int32)` - -SetTotal sets Total field to given value. - - -### GetOffset - -`func (o *ListOfRequestQueues) GetOffset() int32` - -GetOffset returns the Offset field if non-nil, zero value otherwise. - -### GetOffsetOk - -`func (o *ListOfRequestQueues) GetOffsetOk() (*int32, bool)` - -GetOffsetOk returns a tuple with the Offset field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetOffset - -`func (o *ListOfRequestQueues) SetOffset(v int32)` - -SetOffset sets Offset field to given value. - - -### GetLimit - -`func (o *ListOfRequestQueues) GetLimit() int32` - -GetLimit returns the Limit field if non-nil, zero value otherwise. - -### GetLimitOk - -`func (o *ListOfRequestQueues) GetLimitOk() (*int32, bool)` - -GetLimitOk returns a tuple with the Limit field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetLimit - -`func (o *ListOfRequestQueues) SetLimit(v int32)` - -SetLimit sets Limit field to given value. - - -### GetDesc - -`func (o *ListOfRequestQueues) GetDesc() bool` - -GetDesc returns the Desc field if non-nil, zero value otherwise. - -### GetDescOk - -`func (o *ListOfRequestQueues) GetDescOk() (*bool, bool)` - -GetDescOk returns a tuple with the Desc field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetDesc - -`func (o *ListOfRequestQueues) SetDesc(v bool)` - -SetDesc sets Desc field to given value. - - -### GetCount - -`func (o *ListOfRequestQueues) GetCount() int32` - -GetCount returns the Count field if non-nil, zero value otherwise. - -### GetCountOk - -`func (o *ListOfRequestQueues) GetCountOk() (*int32, bool)` - -GetCountOk returns a tuple with the Count field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetCount - -`func (o *ListOfRequestQueues) SetCount(v int32)` - -SetCount sets Count field to given value. - - -### GetUnnamed - -`func (o *ListOfRequestQueues) GetUnnamed() bool` - -GetUnnamed returns the Unnamed field if non-nil, zero value otherwise. - -### GetUnnamedOk - -`func (o *ListOfRequestQueues) GetUnnamedOk() (*bool, bool)` - -GetUnnamedOk returns a tuple with the Unnamed field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetUnnamed - -`func (o *ListOfRequestQueues) SetUnnamed(v bool)` - -SetUnnamed sets Unnamed field to given value. - -### HasUnnamed - -`func (o *ListOfRequestQueues) HasUnnamed() bool` - -HasUnnamed returns a boolean if a field has been set. - -### GetItems - -`func (o *ListOfRequestQueues) GetItems() []RequestQueueShort` - -GetItems returns the Items field if non-nil, zero value otherwise. - -### GetItemsOk - -`func (o *ListOfRequestQueues) GetItemsOk() (*[]RequestQueueShort, bool)` - -GetItemsOk returns a tuple with the Items field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetItems - -`func (o *ListOfRequestQueues) SetItems(v []RequestQueueShort)` - -SetItems sets Items field to given value. - - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/ListOfRequestQueuesResponse.md b/docs/ListOfRequestQueuesResponse.md deleted file mode 100644 index 0fd8b57..0000000 --- a/docs/ListOfRequestQueuesResponse.md +++ /dev/null @@ -1,51 +0,0 @@ -# ListOfRequestQueuesResponse - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Data** | [**ListOfRequestQueues**](ListOfRequestQueues.md) | | - -## Methods - -### NewListOfRequestQueuesResponse - -`func NewListOfRequestQueuesResponse(data ListOfRequestQueues, ) *ListOfRequestQueuesResponse` - -NewListOfRequestQueuesResponse instantiates a new ListOfRequestQueuesResponse object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewListOfRequestQueuesResponseWithDefaults - -`func NewListOfRequestQueuesResponseWithDefaults() *ListOfRequestQueuesResponse` - -NewListOfRequestQueuesResponseWithDefaults instantiates a new ListOfRequestQueuesResponse object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetData - -`func (o *ListOfRequestQueuesResponse) GetData() ListOfRequestQueues` - -GetData returns the Data field if non-nil, zero value otherwise. - -### GetDataOk - -`func (o *ListOfRequestQueuesResponse) GetDataOk() (*ListOfRequestQueues, bool)` - -GetDataOk returns a tuple with the Data field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetData - -`func (o *ListOfRequestQueuesResponse) SetData(v ListOfRequestQueues)` - -SetData sets Data field to given value. - - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/ListOfRequests.md b/docs/ListOfRequests.md deleted file mode 100644 index 43cf262..0000000 --- a/docs/ListOfRequests.md +++ /dev/null @@ -1,150 +0,0 @@ -# ListOfRequests - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Items** | [**[]Request**](Request.md) | The array of requests. | -**Limit** | **int32** | The maximum number of requests returned in this response. | -**ExclusiveStartId** | Pointer to **string** | The ID of the last request from the previous page, used for pagination. | [optional] -**Cursor** | Pointer to **string** | A cursor string used for current page of results. | [optional] -**NextCursor** | Pointer to **string** | A cursor string to be used to continue pagination. | [optional] - -## Methods - -### NewListOfRequests - -`func NewListOfRequests(items []Request, limit int32, ) *ListOfRequests` - -NewListOfRequests instantiates a new ListOfRequests object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewListOfRequestsWithDefaults - -`func NewListOfRequestsWithDefaults() *ListOfRequests` - -NewListOfRequestsWithDefaults instantiates a new ListOfRequests object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetItems - -`func (o *ListOfRequests) GetItems() []Request` - -GetItems returns the Items field if non-nil, zero value otherwise. - -### GetItemsOk - -`func (o *ListOfRequests) GetItemsOk() (*[]Request, bool)` - -GetItemsOk returns a tuple with the Items field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetItems - -`func (o *ListOfRequests) SetItems(v []Request)` - -SetItems sets Items field to given value. - - -### GetLimit - -`func (o *ListOfRequests) GetLimit() int32` - -GetLimit returns the Limit field if non-nil, zero value otherwise. - -### GetLimitOk - -`func (o *ListOfRequests) GetLimitOk() (*int32, bool)` - -GetLimitOk returns a tuple with the Limit field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetLimit - -`func (o *ListOfRequests) SetLimit(v int32)` - -SetLimit sets Limit field to given value. - - -### GetExclusiveStartId - -`func (o *ListOfRequests) GetExclusiveStartId() string` - -GetExclusiveStartId returns the ExclusiveStartId field if non-nil, zero value otherwise. - -### GetExclusiveStartIdOk - -`func (o *ListOfRequests) GetExclusiveStartIdOk() (*string, bool)` - -GetExclusiveStartIdOk returns a tuple with the ExclusiveStartId field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetExclusiveStartId - -`func (o *ListOfRequests) SetExclusiveStartId(v string)` - -SetExclusiveStartId sets ExclusiveStartId field to given value. - -### HasExclusiveStartId - -`func (o *ListOfRequests) HasExclusiveStartId() bool` - -HasExclusiveStartId returns a boolean if a field has been set. - -### GetCursor - -`func (o *ListOfRequests) GetCursor() string` - -GetCursor returns the Cursor field if non-nil, zero value otherwise. - -### GetCursorOk - -`func (o *ListOfRequests) GetCursorOk() (*string, bool)` - -GetCursorOk returns a tuple with the Cursor field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetCursor - -`func (o *ListOfRequests) SetCursor(v string)` - -SetCursor sets Cursor field to given value. - -### HasCursor - -`func (o *ListOfRequests) HasCursor() bool` - -HasCursor returns a boolean if a field has been set. - -### GetNextCursor - -`func (o *ListOfRequests) GetNextCursor() string` - -GetNextCursor returns the NextCursor field if non-nil, zero value otherwise. - -### GetNextCursorOk - -`func (o *ListOfRequests) GetNextCursorOk() (*string, bool)` - -GetNextCursorOk returns a tuple with the NextCursor field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetNextCursor - -`func (o *ListOfRequests) SetNextCursor(v string)` - -SetNextCursor sets NextCursor field to given value. - -### HasNextCursor - -`func (o *ListOfRequests) HasNextCursor() bool` - -HasNextCursor returns a boolean if a field has been set. - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/ListOfRequestsResponse.md b/docs/ListOfRequestsResponse.md deleted file mode 100644 index a2eb1f6..0000000 --- a/docs/ListOfRequestsResponse.md +++ /dev/null @@ -1,51 +0,0 @@ -# ListOfRequestsResponse - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Data** | [**ListOfRequests**](ListOfRequests.md) | | - -## Methods - -### NewListOfRequestsResponse - -`func NewListOfRequestsResponse(data ListOfRequests, ) *ListOfRequestsResponse` - -NewListOfRequestsResponse instantiates a new ListOfRequestsResponse object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewListOfRequestsResponseWithDefaults - -`func NewListOfRequestsResponseWithDefaults() *ListOfRequestsResponse` - -NewListOfRequestsResponseWithDefaults instantiates a new ListOfRequestsResponse object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetData - -`func (o *ListOfRequestsResponse) GetData() ListOfRequests` - -GetData returns the Data field if non-nil, zero value otherwise. - -### GetDataOk - -`func (o *ListOfRequestsResponse) GetDataOk() (*ListOfRequests, bool)` - -GetDataOk returns a tuple with the Data field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetData - -`func (o *ListOfRequestsResponse) SetData(v ListOfRequests)` - -SetData sets Data field to given value. - - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/ListOfRuns.md b/docs/ListOfRuns.md deleted file mode 100644 index 6a8a692..0000000 --- a/docs/ListOfRuns.md +++ /dev/null @@ -1,156 +0,0 @@ -# ListOfRuns - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Total** | **int32** | The total number of items available across all pages. | -**Offset** | **int32** | The starting position for this page of results. | -**Limit** | **int32** | The maximum number of items returned per page. | -**Desc** | **bool** | Whether the results are sorted in descending order. | -**Count** | **int32** | The number of items returned in this response. | -**Items** | [**[]RunShort**](RunShort.md) | | - -## Methods - -### NewListOfRuns - -`func NewListOfRuns(total int32, offset int32, limit int32, desc bool, count int32, items []RunShort, ) *ListOfRuns` - -NewListOfRuns instantiates a new ListOfRuns object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewListOfRunsWithDefaults - -`func NewListOfRunsWithDefaults() *ListOfRuns` - -NewListOfRunsWithDefaults instantiates a new ListOfRuns object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetTotal - -`func (o *ListOfRuns) GetTotal() int32` - -GetTotal returns the Total field if non-nil, zero value otherwise. - -### GetTotalOk - -`func (o *ListOfRuns) GetTotalOk() (*int32, bool)` - -GetTotalOk returns a tuple with the Total field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetTotal - -`func (o *ListOfRuns) SetTotal(v int32)` - -SetTotal sets Total field to given value. - - -### GetOffset - -`func (o *ListOfRuns) GetOffset() int32` - -GetOffset returns the Offset field if non-nil, zero value otherwise. - -### GetOffsetOk - -`func (o *ListOfRuns) GetOffsetOk() (*int32, bool)` - -GetOffsetOk returns a tuple with the Offset field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetOffset - -`func (o *ListOfRuns) SetOffset(v int32)` - -SetOffset sets Offset field to given value. - - -### GetLimit - -`func (o *ListOfRuns) GetLimit() int32` - -GetLimit returns the Limit field if non-nil, zero value otherwise. - -### GetLimitOk - -`func (o *ListOfRuns) GetLimitOk() (*int32, bool)` - -GetLimitOk returns a tuple with the Limit field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetLimit - -`func (o *ListOfRuns) SetLimit(v int32)` - -SetLimit sets Limit field to given value. - - -### GetDesc - -`func (o *ListOfRuns) GetDesc() bool` - -GetDesc returns the Desc field if non-nil, zero value otherwise. - -### GetDescOk - -`func (o *ListOfRuns) GetDescOk() (*bool, bool)` - -GetDescOk returns a tuple with the Desc field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetDesc - -`func (o *ListOfRuns) SetDesc(v bool)` - -SetDesc sets Desc field to given value. - - -### GetCount - -`func (o *ListOfRuns) GetCount() int32` - -GetCount returns the Count field if non-nil, zero value otherwise. - -### GetCountOk - -`func (o *ListOfRuns) GetCountOk() (*int32, bool)` - -GetCountOk returns a tuple with the Count field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetCount - -`func (o *ListOfRuns) SetCount(v int32)` - -SetCount sets Count field to given value. - - -### GetItems - -`func (o *ListOfRuns) GetItems() []RunShort` - -GetItems returns the Items field if non-nil, zero value otherwise. - -### GetItemsOk - -`func (o *ListOfRuns) GetItemsOk() (*[]RunShort, bool)` - -GetItemsOk returns a tuple with the Items field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetItems - -`func (o *ListOfRuns) SetItems(v []RunShort)` - -SetItems sets Items field to given value. - - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/ListOfRunsResponse.md b/docs/ListOfRunsResponse.md deleted file mode 100644 index e97dbf1..0000000 --- a/docs/ListOfRunsResponse.md +++ /dev/null @@ -1,51 +0,0 @@ -# ListOfRunsResponse - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Data** | [**ListOfRuns**](ListOfRuns.md) | | - -## Methods - -### NewListOfRunsResponse - -`func NewListOfRunsResponse(data ListOfRuns, ) *ListOfRunsResponse` - -NewListOfRunsResponse instantiates a new ListOfRunsResponse object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewListOfRunsResponseWithDefaults - -`func NewListOfRunsResponseWithDefaults() *ListOfRunsResponse` - -NewListOfRunsResponseWithDefaults instantiates a new ListOfRunsResponse object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetData - -`func (o *ListOfRunsResponse) GetData() ListOfRuns` - -GetData returns the Data field if non-nil, zero value otherwise. - -### GetDataOk - -`func (o *ListOfRunsResponse) GetDataOk() (*ListOfRuns, bool)` - -GetDataOk returns a tuple with the Data field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetData - -`func (o *ListOfRunsResponse) SetData(v ListOfRuns)` - -SetData sets Data field to given value. - - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/ListOfSchedules.md b/docs/ListOfSchedules.md deleted file mode 100644 index 42dc2ed..0000000 --- a/docs/ListOfSchedules.md +++ /dev/null @@ -1,156 +0,0 @@ -# ListOfSchedules - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Total** | **int32** | The total number of items available across all pages. | -**Offset** | **int32** | The starting position for this page of results. | -**Limit** | **int32** | The maximum number of items returned per page. | -**Desc** | **bool** | Whether the results are sorted in descending order. | -**Count** | **int32** | The number of items returned in this response. | -**Items** | [**[]ScheduleShort**](ScheduleShort.md) | | - -## Methods - -### NewListOfSchedules - -`func NewListOfSchedules(total int32, offset int32, limit int32, desc bool, count int32, items []ScheduleShort, ) *ListOfSchedules` - -NewListOfSchedules instantiates a new ListOfSchedules object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewListOfSchedulesWithDefaults - -`func NewListOfSchedulesWithDefaults() *ListOfSchedules` - -NewListOfSchedulesWithDefaults instantiates a new ListOfSchedules object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetTotal - -`func (o *ListOfSchedules) GetTotal() int32` - -GetTotal returns the Total field if non-nil, zero value otherwise. - -### GetTotalOk - -`func (o *ListOfSchedules) GetTotalOk() (*int32, bool)` - -GetTotalOk returns a tuple with the Total field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetTotal - -`func (o *ListOfSchedules) SetTotal(v int32)` - -SetTotal sets Total field to given value. - - -### GetOffset - -`func (o *ListOfSchedules) GetOffset() int32` - -GetOffset returns the Offset field if non-nil, zero value otherwise. - -### GetOffsetOk - -`func (o *ListOfSchedules) GetOffsetOk() (*int32, bool)` - -GetOffsetOk returns a tuple with the Offset field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetOffset - -`func (o *ListOfSchedules) SetOffset(v int32)` - -SetOffset sets Offset field to given value. - - -### GetLimit - -`func (o *ListOfSchedules) GetLimit() int32` - -GetLimit returns the Limit field if non-nil, zero value otherwise. - -### GetLimitOk - -`func (o *ListOfSchedules) GetLimitOk() (*int32, bool)` - -GetLimitOk returns a tuple with the Limit field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetLimit - -`func (o *ListOfSchedules) SetLimit(v int32)` - -SetLimit sets Limit field to given value. - - -### GetDesc - -`func (o *ListOfSchedules) GetDesc() bool` - -GetDesc returns the Desc field if non-nil, zero value otherwise. - -### GetDescOk - -`func (o *ListOfSchedules) GetDescOk() (*bool, bool)` - -GetDescOk returns a tuple with the Desc field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetDesc - -`func (o *ListOfSchedules) SetDesc(v bool)` - -SetDesc sets Desc field to given value. - - -### GetCount - -`func (o *ListOfSchedules) GetCount() int32` - -GetCount returns the Count field if non-nil, zero value otherwise. - -### GetCountOk - -`func (o *ListOfSchedules) GetCountOk() (*int32, bool)` - -GetCountOk returns a tuple with the Count field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetCount - -`func (o *ListOfSchedules) SetCount(v int32)` - -SetCount sets Count field to given value. - - -### GetItems - -`func (o *ListOfSchedules) GetItems() []ScheduleShort` - -GetItems returns the Items field if non-nil, zero value otherwise. - -### GetItemsOk - -`func (o *ListOfSchedules) GetItemsOk() (*[]ScheduleShort, bool)` - -GetItemsOk returns a tuple with the Items field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetItems - -`func (o *ListOfSchedules) SetItems(v []ScheduleShort)` - -SetItems sets Items field to given value. - - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/ListOfSchedulesResponse.md b/docs/ListOfSchedulesResponse.md deleted file mode 100644 index 50173f8..0000000 --- a/docs/ListOfSchedulesResponse.md +++ /dev/null @@ -1,51 +0,0 @@ -# ListOfSchedulesResponse - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Data** | [**ListOfSchedules**](ListOfSchedules.md) | | - -## Methods - -### NewListOfSchedulesResponse - -`func NewListOfSchedulesResponse(data ListOfSchedules, ) *ListOfSchedulesResponse` - -NewListOfSchedulesResponse instantiates a new ListOfSchedulesResponse object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewListOfSchedulesResponseWithDefaults - -`func NewListOfSchedulesResponseWithDefaults() *ListOfSchedulesResponse` - -NewListOfSchedulesResponseWithDefaults instantiates a new ListOfSchedulesResponse object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetData - -`func (o *ListOfSchedulesResponse) GetData() ListOfSchedules` - -GetData returns the Data field if non-nil, zero value otherwise. - -### GetDataOk - -`func (o *ListOfSchedulesResponse) GetDataOk() (*ListOfSchedules, bool)` - -GetDataOk returns a tuple with the Data field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetData - -`func (o *ListOfSchedulesResponse) SetData(v ListOfSchedules)` - -SetData sets Data field to given value. - - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/ListOfStoreActors.md b/docs/ListOfStoreActors.md deleted file mode 100644 index 2c30565..0000000 --- a/docs/ListOfStoreActors.md +++ /dev/null @@ -1,156 +0,0 @@ -# ListOfStoreActors - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Total** | **int32** | The total number of items available across all pages. | -**Offset** | **int32** | The starting position for this page of results. | -**Limit** | **int32** | The maximum number of items returned per page. | -**Desc** | **bool** | Whether the results are sorted in descending order. | -**Count** | **int32** | The number of items returned in this response. | -**Items** | [**[]StoreListActor**](StoreListActor.md) | | - -## Methods - -### NewListOfStoreActors - -`func NewListOfStoreActors(total int32, offset int32, limit int32, desc bool, count int32, items []StoreListActor, ) *ListOfStoreActors` - -NewListOfStoreActors instantiates a new ListOfStoreActors object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewListOfStoreActorsWithDefaults - -`func NewListOfStoreActorsWithDefaults() *ListOfStoreActors` - -NewListOfStoreActorsWithDefaults instantiates a new ListOfStoreActors object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetTotal - -`func (o *ListOfStoreActors) GetTotal() int32` - -GetTotal returns the Total field if non-nil, zero value otherwise. - -### GetTotalOk - -`func (o *ListOfStoreActors) GetTotalOk() (*int32, bool)` - -GetTotalOk returns a tuple with the Total field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetTotal - -`func (o *ListOfStoreActors) SetTotal(v int32)` - -SetTotal sets Total field to given value. - - -### GetOffset - -`func (o *ListOfStoreActors) GetOffset() int32` - -GetOffset returns the Offset field if non-nil, zero value otherwise. - -### GetOffsetOk - -`func (o *ListOfStoreActors) GetOffsetOk() (*int32, bool)` - -GetOffsetOk returns a tuple with the Offset field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetOffset - -`func (o *ListOfStoreActors) SetOffset(v int32)` - -SetOffset sets Offset field to given value. - - -### GetLimit - -`func (o *ListOfStoreActors) GetLimit() int32` - -GetLimit returns the Limit field if non-nil, zero value otherwise. - -### GetLimitOk - -`func (o *ListOfStoreActors) GetLimitOk() (*int32, bool)` - -GetLimitOk returns a tuple with the Limit field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetLimit - -`func (o *ListOfStoreActors) SetLimit(v int32)` - -SetLimit sets Limit field to given value. - - -### GetDesc - -`func (o *ListOfStoreActors) GetDesc() bool` - -GetDesc returns the Desc field if non-nil, zero value otherwise. - -### GetDescOk - -`func (o *ListOfStoreActors) GetDescOk() (*bool, bool)` - -GetDescOk returns a tuple with the Desc field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetDesc - -`func (o *ListOfStoreActors) SetDesc(v bool)` - -SetDesc sets Desc field to given value. - - -### GetCount - -`func (o *ListOfStoreActors) GetCount() int32` - -GetCount returns the Count field if non-nil, zero value otherwise. - -### GetCountOk - -`func (o *ListOfStoreActors) GetCountOk() (*int32, bool)` - -GetCountOk returns a tuple with the Count field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetCount - -`func (o *ListOfStoreActors) SetCount(v int32)` - -SetCount sets Count field to given value. - - -### GetItems - -`func (o *ListOfStoreActors) GetItems() []StoreListActor` - -GetItems returns the Items field if non-nil, zero value otherwise. - -### GetItemsOk - -`func (o *ListOfStoreActors) GetItemsOk() (*[]StoreListActor, bool)` - -GetItemsOk returns a tuple with the Items field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetItems - -`func (o *ListOfStoreActors) SetItems(v []StoreListActor)` - -SetItems sets Items field to given value. - - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/ListOfTasks.md b/docs/ListOfTasks.md deleted file mode 100644 index c11932c..0000000 --- a/docs/ListOfTasks.md +++ /dev/null @@ -1,156 +0,0 @@ -# ListOfTasks - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Total** | **int32** | The total number of items available across all pages. | -**Offset** | **int32** | The starting position for this page of results. | -**Limit** | **int32** | The maximum number of items returned per page. | -**Desc** | **bool** | Whether the results are sorted in descending order. | -**Count** | **int32** | The number of items returned in this response. | -**Items** | [**[]TaskShort**](TaskShort.md) | | - -## Methods - -### NewListOfTasks - -`func NewListOfTasks(total int32, offset int32, limit int32, desc bool, count int32, items []TaskShort, ) *ListOfTasks` - -NewListOfTasks instantiates a new ListOfTasks object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewListOfTasksWithDefaults - -`func NewListOfTasksWithDefaults() *ListOfTasks` - -NewListOfTasksWithDefaults instantiates a new ListOfTasks object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetTotal - -`func (o *ListOfTasks) GetTotal() int32` - -GetTotal returns the Total field if non-nil, zero value otherwise. - -### GetTotalOk - -`func (o *ListOfTasks) GetTotalOk() (*int32, bool)` - -GetTotalOk returns a tuple with the Total field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetTotal - -`func (o *ListOfTasks) SetTotal(v int32)` - -SetTotal sets Total field to given value. - - -### GetOffset - -`func (o *ListOfTasks) GetOffset() int32` - -GetOffset returns the Offset field if non-nil, zero value otherwise. - -### GetOffsetOk - -`func (o *ListOfTasks) GetOffsetOk() (*int32, bool)` - -GetOffsetOk returns a tuple with the Offset field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetOffset - -`func (o *ListOfTasks) SetOffset(v int32)` - -SetOffset sets Offset field to given value. - - -### GetLimit - -`func (o *ListOfTasks) GetLimit() int32` - -GetLimit returns the Limit field if non-nil, zero value otherwise. - -### GetLimitOk - -`func (o *ListOfTasks) GetLimitOk() (*int32, bool)` - -GetLimitOk returns a tuple with the Limit field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetLimit - -`func (o *ListOfTasks) SetLimit(v int32)` - -SetLimit sets Limit field to given value. - - -### GetDesc - -`func (o *ListOfTasks) GetDesc() bool` - -GetDesc returns the Desc field if non-nil, zero value otherwise. - -### GetDescOk - -`func (o *ListOfTasks) GetDescOk() (*bool, bool)` - -GetDescOk returns a tuple with the Desc field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetDesc - -`func (o *ListOfTasks) SetDesc(v bool)` - -SetDesc sets Desc field to given value. - - -### GetCount - -`func (o *ListOfTasks) GetCount() int32` - -GetCount returns the Count field if non-nil, zero value otherwise. - -### GetCountOk - -`func (o *ListOfTasks) GetCountOk() (*int32, bool)` - -GetCountOk returns a tuple with the Count field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetCount - -`func (o *ListOfTasks) SetCount(v int32)` - -SetCount sets Count field to given value. - - -### GetItems - -`func (o *ListOfTasks) GetItems() []TaskShort` - -GetItems returns the Items field if non-nil, zero value otherwise. - -### GetItemsOk - -`func (o *ListOfTasks) GetItemsOk() (*[]TaskShort, bool)` - -GetItemsOk returns a tuple with the Items field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetItems - -`func (o *ListOfTasks) SetItems(v []TaskShort)` - -SetItems sets Items field to given value. - - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/ListOfTasksResponse.md b/docs/ListOfTasksResponse.md deleted file mode 100644 index 2847c25..0000000 --- a/docs/ListOfTasksResponse.md +++ /dev/null @@ -1,51 +0,0 @@ -# ListOfTasksResponse - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Data** | [**ListOfTasks**](ListOfTasks.md) | | - -## Methods - -### NewListOfTasksResponse - -`func NewListOfTasksResponse(data ListOfTasks, ) *ListOfTasksResponse` - -NewListOfTasksResponse instantiates a new ListOfTasksResponse object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewListOfTasksResponseWithDefaults - -`func NewListOfTasksResponseWithDefaults() *ListOfTasksResponse` - -NewListOfTasksResponseWithDefaults instantiates a new ListOfTasksResponse object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetData - -`func (o *ListOfTasksResponse) GetData() ListOfTasks` - -GetData returns the Data field if non-nil, zero value otherwise. - -### GetDataOk - -`func (o *ListOfTasksResponse) GetDataOk() (*ListOfTasks, bool)` - -GetDataOk returns a tuple with the Data field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetData - -`func (o *ListOfTasksResponse) SetData(v ListOfTasks)` - -SetData sets Data field to given value. - - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/ListOfVersions.md b/docs/ListOfVersions.md deleted file mode 100644 index c549a8d..0000000 --- a/docs/ListOfVersions.md +++ /dev/null @@ -1,72 +0,0 @@ -# ListOfVersions - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Total** | **int32** | | -**Items** | [**[]Version**](Version.md) | | - -## Methods - -### NewListOfVersions - -`func NewListOfVersions(total int32, items []Version, ) *ListOfVersions` - -NewListOfVersions instantiates a new ListOfVersions object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewListOfVersionsWithDefaults - -`func NewListOfVersionsWithDefaults() *ListOfVersions` - -NewListOfVersionsWithDefaults instantiates a new ListOfVersions object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetTotal - -`func (o *ListOfVersions) GetTotal() int32` - -GetTotal returns the Total field if non-nil, zero value otherwise. - -### GetTotalOk - -`func (o *ListOfVersions) GetTotalOk() (*int32, bool)` - -GetTotalOk returns a tuple with the Total field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetTotal - -`func (o *ListOfVersions) SetTotal(v int32)` - -SetTotal sets Total field to given value. - - -### GetItems - -`func (o *ListOfVersions) GetItems() []Version` - -GetItems returns the Items field if non-nil, zero value otherwise. - -### GetItemsOk - -`func (o *ListOfVersions) GetItemsOk() (*[]Version, bool)` - -GetItemsOk returns a tuple with the Items field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetItems - -`func (o *ListOfVersions) SetItems(v []Version)` - -SetItems sets Items field to given value. - - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/ListOfVersionsResponse.md b/docs/ListOfVersionsResponse.md deleted file mode 100644 index fc13e2e..0000000 --- a/docs/ListOfVersionsResponse.md +++ /dev/null @@ -1,51 +0,0 @@ -# ListOfVersionsResponse - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Data** | [**ListOfVersions**](ListOfVersions.md) | | - -## Methods - -### NewListOfVersionsResponse - -`func NewListOfVersionsResponse(data ListOfVersions, ) *ListOfVersionsResponse` - -NewListOfVersionsResponse instantiates a new ListOfVersionsResponse object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewListOfVersionsResponseWithDefaults - -`func NewListOfVersionsResponseWithDefaults() *ListOfVersionsResponse` - -NewListOfVersionsResponseWithDefaults instantiates a new ListOfVersionsResponse object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetData - -`func (o *ListOfVersionsResponse) GetData() ListOfVersions` - -GetData returns the Data field if non-nil, zero value otherwise. - -### GetDataOk - -`func (o *ListOfVersionsResponse) GetDataOk() (*ListOfVersions, bool)` - -GetDataOk returns a tuple with the Data field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetData - -`func (o *ListOfVersionsResponse) SetData(v ListOfVersions)` - -SetData sets Data field to given value. - - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/ListOfWebhookDispatches.md b/docs/ListOfWebhookDispatches.md deleted file mode 100644 index cf52f53..0000000 --- a/docs/ListOfWebhookDispatches.md +++ /dev/null @@ -1,156 +0,0 @@ -# ListOfWebhookDispatches - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Total** | **int32** | The total number of items available across all pages. | -**Offset** | **int32** | The starting position for this page of results. | -**Limit** | **int32** | The maximum number of items returned per page. | -**Desc** | **bool** | Whether the results are sorted in descending order. | -**Count** | **int32** | The number of items returned in this response. | -**Items** | [**[]WebhookDispatch**](WebhookDispatch.md) | | - -## Methods - -### NewListOfWebhookDispatches - -`func NewListOfWebhookDispatches(total int32, offset int32, limit int32, desc bool, count int32, items []WebhookDispatch, ) *ListOfWebhookDispatches` - -NewListOfWebhookDispatches instantiates a new ListOfWebhookDispatches object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewListOfWebhookDispatchesWithDefaults - -`func NewListOfWebhookDispatchesWithDefaults() *ListOfWebhookDispatches` - -NewListOfWebhookDispatchesWithDefaults instantiates a new ListOfWebhookDispatches object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetTotal - -`func (o *ListOfWebhookDispatches) GetTotal() int32` - -GetTotal returns the Total field if non-nil, zero value otherwise. - -### GetTotalOk - -`func (o *ListOfWebhookDispatches) GetTotalOk() (*int32, bool)` - -GetTotalOk returns a tuple with the Total field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetTotal - -`func (o *ListOfWebhookDispatches) SetTotal(v int32)` - -SetTotal sets Total field to given value. - - -### GetOffset - -`func (o *ListOfWebhookDispatches) GetOffset() int32` - -GetOffset returns the Offset field if non-nil, zero value otherwise. - -### GetOffsetOk - -`func (o *ListOfWebhookDispatches) GetOffsetOk() (*int32, bool)` - -GetOffsetOk returns a tuple with the Offset field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetOffset - -`func (o *ListOfWebhookDispatches) SetOffset(v int32)` - -SetOffset sets Offset field to given value. - - -### GetLimit - -`func (o *ListOfWebhookDispatches) GetLimit() int32` - -GetLimit returns the Limit field if non-nil, zero value otherwise. - -### GetLimitOk - -`func (o *ListOfWebhookDispatches) GetLimitOk() (*int32, bool)` - -GetLimitOk returns a tuple with the Limit field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetLimit - -`func (o *ListOfWebhookDispatches) SetLimit(v int32)` - -SetLimit sets Limit field to given value. - - -### GetDesc - -`func (o *ListOfWebhookDispatches) GetDesc() bool` - -GetDesc returns the Desc field if non-nil, zero value otherwise. - -### GetDescOk - -`func (o *ListOfWebhookDispatches) GetDescOk() (*bool, bool)` - -GetDescOk returns a tuple with the Desc field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetDesc - -`func (o *ListOfWebhookDispatches) SetDesc(v bool)` - -SetDesc sets Desc field to given value. - - -### GetCount - -`func (o *ListOfWebhookDispatches) GetCount() int32` - -GetCount returns the Count field if non-nil, zero value otherwise. - -### GetCountOk - -`func (o *ListOfWebhookDispatches) GetCountOk() (*int32, bool)` - -GetCountOk returns a tuple with the Count field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetCount - -`func (o *ListOfWebhookDispatches) SetCount(v int32)` - -SetCount sets Count field to given value. - - -### GetItems - -`func (o *ListOfWebhookDispatches) GetItems() []WebhookDispatch` - -GetItems returns the Items field if non-nil, zero value otherwise. - -### GetItemsOk - -`func (o *ListOfWebhookDispatches) GetItemsOk() (*[]WebhookDispatch, bool)` - -GetItemsOk returns a tuple with the Items field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetItems - -`func (o *ListOfWebhookDispatches) SetItems(v []WebhookDispatch)` - -SetItems sets Items field to given value. - - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/ListOfWebhookDispatchesResponse.md b/docs/ListOfWebhookDispatchesResponse.md deleted file mode 100644 index f2a3302..0000000 --- a/docs/ListOfWebhookDispatchesResponse.md +++ /dev/null @@ -1,51 +0,0 @@ -# ListOfWebhookDispatchesResponse - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Data** | [**ListOfWebhookDispatches**](ListOfWebhookDispatches.md) | | - -## Methods - -### NewListOfWebhookDispatchesResponse - -`func NewListOfWebhookDispatchesResponse(data ListOfWebhookDispatches, ) *ListOfWebhookDispatchesResponse` - -NewListOfWebhookDispatchesResponse instantiates a new ListOfWebhookDispatchesResponse object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewListOfWebhookDispatchesResponseWithDefaults - -`func NewListOfWebhookDispatchesResponseWithDefaults() *ListOfWebhookDispatchesResponse` - -NewListOfWebhookDispatchesResponseWithDefaults instantiates a new ListOfWebhookDispatchesResponse object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetData - -`func (o *ListOfWebhookDispatchesResponse) GetData() ListOfWebhookDispatches` - -GetData returns the Data field if non-nil, zero value otherwise. - -### GetDataOk - -`func (o *ListOfWebhookDispatchesResponse) GetDataOk() (*ListOfWebhookDispatches, bool)` - -GetDataOk returns a tuple with the Data field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetData - -`func (o *ListOfWebhookDispatchesResponse) SetData(v ListOfWebhookDispatches)` - -SetData sets Data field to given value. - - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/ListOfWebhooks.md b/docs/ListOfWebhooks.md deleted file mode 100644 index 80239a7..0000000 --- a/docs/ListOfWebhooks.md +++ /dev/null @@ -1,156 +0,0 @@ -# ListOfWebhooks - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Total** | **int32** | The total number of items available across all pages. | -**Offset** | **int32** | The starting position for this page of results. | -**Limit** | **int32** | The maximum number of items returned per page. | -**Desc** | **bool** | Whether the results are sorted in descending order. | -**Count** | **int32** | The number of items returned in this response. | -**Items** | [**[]WebhookShort**](WebhookShort.md) | | - -## Methods - -### NewListOfWebhooks - -`func NewListOfWebhooks(total int32, offset int32, limit int32, desc bool, count int32, items []WebhookShort, ) *ListOfWebhooks` - -NewListOfWebhooks instantiates a new ListOfWebhooks object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewListOfWebhooksWithDefaults - -`func NewListOfWebhooksWithDefaults() *ListOfWebhooks` - -NewListOfWebhooksWithDefaults instantiates a new ListOfWebhooks object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetTotal - -`func (o *ListOfWebhooks) GetTotal() int32` - -GetTotal returns the Total field if non-nil, zero value otherwise. - -### GetTotalOk - -`func (o *ListOfWebhooks) GetTotalOk() (*int32, bool)` - -GetTotalOk returns a tuple with the Total field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetTotal - -`func (o *ListOfWebhooks) SetTotal(v int32)` - -SetTotal sets Total field to given value. - - -### GetOffset - -`func (o *ListOfWebhooks) GetOffset() int32` - -GetOffset returns the Offset field if non-nil, zero value otherwise. - -### GetOffsetOk - -`func (o *ListOfWebhooks) GetOffsetOk() (*int32, bool)` - -GetOffsetOk returns a tuple with the Offset field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetOffset - -`func (o *ListOfWebhooks) SetOffset(v int32)` - -SetOffset sets Offset field to given value. - - -### GetLimit - -`func (o *ListOfWebhooks) GetLimit() int32` - -GetLimit returns the Limit field if non-nil, zero value otherwise. - -### GetLimitOk - -`func (o *ListOfWebhooks) GetLimitOk() (*int32, bool)` - -GetLimitOk returns a tuple with the Limit field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetLimit - -`func (o *ListOfWebhooks) SetLimit(v int32)` - -SetLimit sets Limit field to given value. - - -### GetDesc - -`func (o *ListOfWebhooks) GetDesc() bool` - -GetDesc returns the Desc field if non-nil, zero value otherwise. - -### GetDescOk - -`func (o *ListOfWebhooks) GetDescOk() (*bool, bool)` - -GetDescOk returns a tuple with the Desc field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetDesc - -`func (o *ListOfWebhooks) SetDesc(v bool)` - -SetDesc sets Desc field to given value. - - -### GetCount - -`func (o *ListOfWebhooks) GetCount() int32` - -GetCount returns the Count field if non-nil, zero value otherwise. - -### GetCountOk - -`func (o *ListOfWebhooks) GetCountOk() (*int32, bool)` - -GetCountOk returns a tuple with the Count field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetCount - -`func (o *ListOfWebhooks) SetCount(v int32)` - -SetCount sets Count field to given value. - - -### GetItems - -`func (o *ListOfWebhooks) GetItems() []WebhookShort` - -GetItems returns the Items field if non-nil, zero value otherwise. - -### GetItemsOk - -`func (o *ListOfWebhooks) GetItemsOk() (*[]WebhookShort, bool)` - -GetItemsOk returns a tuple with the Items field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetItems - -`func (o *ListOfWebhooks) SetItems(v []WebhookShort)` - -SetItems sets Items field to given value. - - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/ListOfWebhooksResponse.md b/docs/ListOfWebhooksResponse.md deleted file mode 100644 index c8e3d72..0000000 --- a/docs/ListOfWebhooksResponse.md +++ /dev/null @@ -1,51 +0,0 @@ -# ListOfWebhooksResponse - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Data** | [**ListOfWebhooks**](ListOfWebhooks.md) | | - -## Methods - -### NewListOfWebhooksResponse - -`func NewListOfWebhooksResponse(data ListOfWebhooks, ) *ListOfWebhooksResponse` - -NewListOfWebhooksResponse instantiates a new ListOfWebhooksResponse object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewListOfWebhooksResponseWithDefaults - -`func NewListOfWebhooksResponseWithDefaults() *ListOfWebhooksResponse` - -NewListOfWebhooksResponseWithDefaults instantiates a new ListOfWebhooksResponse object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetData - -`func (o *ListOfWebhooksResponse) GetData() ListOfWebhooks` - -GetData returns the Data field if non-nil, zero value otherwise. - -### GetDataOk - -`func (o *ListOfWebhooksResponse) GetDataOk() (*ListOfWebhooks, bool)` - -GetDataOk returns a tuple with the Data field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetData - -`func (o *ListOfWebhooksResponse) SetData(v ListOfWebhooks)` - -SetData sets Data field to given value. - - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/LockedHeadRequest.md b/docs/LockedHeadRequest.md deleted file mode 100644 index 09180c7..0000000 --- a/docs/LockedHeadRequest.md +++ /dev/null @@ -1,166 +0,0 @@ -# LockedHeadRequest - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Id** | **string** | A unique identifier assigned to the request. | -**UniqueKey** | **string** | A unique key used for request de-duplication. Requests with the same unique key are considered identical. | -**Url** | **string** | The URL of the request. | -**Method** | Pointer to [**HttpMethod**](HttpMethod.md) | | [optional] -**RetryCount** | Pointer to **int32** | The number of times this request has been retried. | [optional] -**LockExpiresAt** | **time.Time** | The timestamp when the lock on this request expires. | - -## Methods - -### NewLockedHeadRequest - -`func NewLockedHeadRequest(id string, uniqueKey string, url string, lockExpiresAt time.Time, ) *LockedHeadRequest` - -NewLockedHeadRequest instantiates a new LockedHeadRequest object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewLockedHeadRequestWithDefaults - -`func NewLockedHeadRequestWithDefaults() *LockedHeadRequest` - -NewLockedHeadRequestWithDefaults instantiates a new LockedHeadRequest object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetId - -`func (o *LockedHeadRequest) GetId() string` - -GetId returns the Id field if non-nil, zero value otherwise. - -### GetIdOk - -`func (o *LockedHeadRequest) GetIdOk() (*string, bool)` - -GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetId - -`func (o *LockedHeadRequest) SetId(v string)` - -SetId sets Id field to given value. - - -### GetUniqueKey - -`func (o *LockedHeadRequest) GetUniqueKey() string` - -GetUniqueKey returns the UniqueKey field if non-nil, zero value otherwise. - -### GetUniqueKeyOk - -`func (o *LockedHeadRequest) GetUniqueKeyOk() (*string, bool)` - -GetUniqueKeyOk returns a tuple with the UniqueKey field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetUniqueKey - -`func (o *LockedHeadRequest) SetUniqueKey(v string)` - -SetUniqueKey sets UniqueKey field to given value. - - -### GetUrl - -`func (o *LockedHeadRequest) GetUrl() string` - -GetUrl returns the Url field if non-nil, zero value otherwise. - -### GetUrlOk - -`func (o *LockedHeadRequest) GetUrlOk() (*string, bool)` - -GetUrlOk returns a tuple with the Url field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetUrl - -`func (o *LockedHeadRequest) SetUrl(v string)` - -SetUrl sets Url field to given value. - - -### GetMethod - -`func (o *LockedHeadRequest) GetMethod() HttpMethod` - -GetMethod returns the Method field if non-nil, zero value otherwise. - -### GetMethodOk - -`func (o *LockedHeadRequest) GetMethodOk() (*HttpMethod, bool)` - -GetMethodOk returns a tuple with the Method field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetMethod - -`func (o *LockedHeadRequest) SetMethod(v HttpMethod)` - -SetMethod sets Method field to given value. - -### HasMethod - -`func (o *LockedHeadRequest) HasMethod() bool` - -HasMethod returns a boolean if a field has been set. - -### GetRetryCount - -`func (o *LockedHeadRequest) GetRetryCount() int32` - -GetRetryCount returns the RetryCount field if non-nil, zero value otherwise. - -### GetRetryCountOk - -`func (o *LockedHeadRequest) GetRetryCountOk() (*int32, bool)` - -GetRetryCountOk returns a tuple with the RetryCount field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetRetryCount - -`func (o *LockedHeadRequest) SetRetryCount(v int32)` - -SetRetryCount sets RetryCount field to given value. - -### HasRetryCount - -`func (o *LockedHeadRequest) HasRetryCount() bool` - -HasRetryCount returns a boolean if a field has been set. - -### GetLockExpiresAt - -`func (o *LockedHeadRequest) GetLockExpiresAt() time.Time` - -GetLockExpiresAt returns the LockExpiresAt field if non-nil, zero value otherwise. - -### GetLockExpiresAtOk - -`func (o *LockedHeadRequest) GetLockExpiresAtOk() (*time.Time, bool)` - -GetLockExpiresAtOk returns a tuple with the LockExpiresAt field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetLockExpiresAt - -`func (o *LockedHeadRequest) SetLockExpiresAt(v time.Time)` - -SetLockExpiresAt sets LockExpiresAt field to given value. - - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/LockedRequestQueueHead.md b/docs/LockedRequestQueueHead.md deleted file mode 100644 index fe3fc7f..0000000 --- a/docs/LockedRequestQueueHead.md +++ /dev/null @@ -1,187 +0,0 @@ -# LockedRequestQueueHead - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Limit** | **int32** | The maximum number of requests returned. | -**QueueModifiedAt** | **time.Time** | The timestamp when the request queue was last modified. Modifications include adding, updating, or removing requests, as well as locking or unlocking requests in the request queue. | -**QueueHasLockedRequests** | Pointer to **bool** | Whether the request queue contains requests locked by any client (either the one calling the endpoint or a different one). | [optional] -**ClientKey** | Pointer to **string** | The client key used for locking the requests. | [optional] -**HadMultipleClients** | **bool** | Whether the request queue has been accessed by multiple different clients. | -**LockSecs** | **int32** | The number of seconds the locks will be held. | -**Items** | [**[]LockedHeadRequest**](LockedHeadRequest.md) | The array of locked requests from the request queue head. | - -## Methods - -### NewLockedRequestQueueHead - -`func NewLockedRequestQueueHead(limit int32, queueModifiedAt time.Time, hadMultipleClients bool, lockSecs int32, items []LockedHeadRequest, ) *LockedRequestQueueHead` - -NewLockedRequestQueueHead instantiates a new LockedRequestQueueHead object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewLockedRequestQueueHeadWithDefaults - -`func NewLockedRequestQueueHeadWithDefaults() *LockedRequestQueueHead` - -NewLockedRequestQueueHeadWithDefaults instantiates a new LockedRequestQueueHead object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetLimit - -`func (o *LockedRequestQueueHead) GetLimit() int32` - -GetLimit returns the Limit field if non-nil, zero value otherwise. - -### GetLimitOk - -`func (o *LockedRequestQueueHead) GetLimitOk() (*int32, bool)` - -GetLimitOk returns a tuple with the Limit field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetLimit - -`func (o *LockedRequestQueueHead) SetLimit(v int32)` - -SetLimit sets Limit field to given value. - - -### GetQueueModifiedAt - -`func (o *LockedRequestQueueHead) GetQueueModifiedAt() time.Time` - -GetQueueModifiedAt returns the QueueModifiedAt field if non-nil, zero value otherwise. - -### GetQueueModifiedAtOk - -`func (o *LockedRequestQueueHead) GetQueueModifiedAtOk() (*time.Time, bool)` - -GetQueueModifiedAtOk returns a tuple with the QueueModifiedAt field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetQueueModifiedAt - -`func (o *LockedRequestQueueHead) SetQueueModifiedAt(v time.Time)` - -SetQueueModifiedAt sets QueueModifiedAt field to given value. - - -### GetQueueHasLockedRequests - -`func (o *LockedRequestQueueHead) GetQueueHasLockedRequests() bool` - -GetQueueHasLockedRequests returns the QueueHasLockedRequests field if non-nil, zero value otherwise. - -### GetQueueHasLockedRequestsOk - -`func (o *LockedRequestQueueHead) GetQueueHasLockedRequestsOk() (*bool, bool)` - -GetQueueHasLockedRequestsOk returns a tuple with the QueueHasLockedRequests field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetQueueHasLockedRequests - -`func (o *LockedRequestQueueHead) SetQueueHasLockedRequests(v bool)` - -SetQueueHasLockedRequests sets QueueHasLockedRequests field to given value. - -### HasQueueHasLockedRequests - -`func (o *LockedRequestQueueHead) HasQueueHasLockedRequests() bool` - -HasQueueHasLockedRequests returns a boolean if a field has been set. - -### GetClientKey - -`func (o *LockedRequestQueueHead) GetClientKey() string` - -GetClientKey returns the ClientKey field if non-nil, zero value otherwise. - -### GetClientKeyOk - -`func (o *LockedRequestQueueHead) GetClientKeyOk() (*string, bool)` - -GetClientKeyOk returns a tuple with the ClientKey field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetClientKey - -`func (o *LockedRequestQueueHead) SetClientKey(v string)` - -SetClientKey sets ClientKey field to given value. - -### HasClientKey - -`func (o *LockedRequestQueueHead) HasClientKey() bool` - -HasClientKey returns a boolean if a field has been set. - -### GetHadMultipleClients - -`func (o *LockedRequestQueueHead) GetHadMultipleClients() bool` - -GetHadMultipleClients returns the HadMultipleClients field if non-nil, zero value otherwise. - -### GetHadMultipleClientsOk - -`func (o *LockedRequestQueueHead) GetHadMultipleClientsOk() (*bool, bool)` - -GetHadMultipleClientsOk returns a tuple with the HadMultipleClients field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetHadMultipleClients - -`func (o *LockedRequestQueueHead) SetHadMultipleClients(v bool)` - -SetHadMultipleClients sets HadMultipleClients field to given value. - - -### GetLockSecs - -`func (o *LockedRequestQueueHead) GetLockSecs() int32` - -GetLockSecs returns the LockSecs field if non-nil, zero value otherwise. - -### GetLockSecsOk - -`func (o *LockedRequestQueueHead) GetLockSecsOk() (*int32, bool)` - -GetLockSecsOk returns a tuple with the LockSecs field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetLockSecs - -`func (o *LockedRequestQueueHead) SetLockSecs(v int32)` - -SetLockSecs sets LockSecs field to given value. - - -### GetItems - -`func (o *LockedRequestQueueHead) GetItems() []LockedHeadRequest` - -GetItems returns the Items field if non-nil, zero value otherwise. - -### GetItemsOk - -`func (o *LockedRequestQueueHead) GetItemsOk() (*[]LockedHeadRequest, bool)` - -GetItemsOk returns a tuple with the Items field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetItems - -`func (o *LockedRequestQueueHead) SetItems(v []LockedHeadRequest)` - -SetItems sets Items field to given value. - - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/LogsAPI.md b/docs/LogsAPI.md deleted file mode 100644 index 13a6c8b..0000000 --- a/docs/LogsAPI.md +++ /dev/null @@ -1,85 +0,0 @@ -# \LogsAPI - -All URIs are relative to *https://api.apify.com* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**LogGet**](LogsAPI.md#LogGet) | **Get** /v2/logs/{buildOrRunId} | Get log - - - -## LogGet - -> string LogGet(ctx, buildOrRunId).Stream(stream).Download(download).Raw(raw).Execute() - -Get log - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - buildOrRunId := "HG7ML7M8z78YcAPE" // string | ID of the Actor build or run. - stream := false // bool | If `true` or `1` then the logs will be streamed as long as the run or build is running. (optional) - download := false // bool | If `true` or `1` then the web browser will download the log file rather than open it in a tab. (optional) - raw := false // bool | If `true` or `1`, the logs will be kept verbatim. By default, the API removes ANSI escape codes from the logs, keeping only printable characters. (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.LogsAPI.LogGet(context.Background(), buildOrRunId).Stream(stream).Download(download).Raw(raw).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `LogsAPI.LogGet``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `LogGet`: string - fmt.Fprintf(os.Stdout, "Response from `LogsAPI.LogGet`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**buildOrRunId** | **string** | ID of the Actor build or run. | - -### Other Parameters - -Other parameters are passed through a pointer to a apiLogGetRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - **stream** | **bool** | If `true` or `1` then the logs will be streamed as long as the run or build is running. | - **download** | **bool** | If `true` or `1` then the web browser will download the log file rather than open it in a tab. | - **raw** | **bool** | If `true` or `1`, the logs will be kept verbatim. By default, the API removes ANSI escape codes from the logs, keeping only printable characters. | - -### Return type - -**string** - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: text/plain, application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - diff --git a/docs/Metamorph.md b/docs/Metamorph.md deleted file mode 100644 index aeeb893..0000000 --- a/docs/Metamorph.md +++ /dev/null @@ -1,129 +0,0 @@ -# Metamorph - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**CreatedAt** | **time.Time** | Time when the metamorph occurred. | -**ActorId** | **string** | ID of the Actor that the run was metamorphed to. | -**BuildId** | **string** | ID of the build used for the metamorphed Actor. | -**InputKey** | Pointer to **NullableString** | Key of the input record in the key-value store. | [optional] - -## Methods - -### NewMetamorph - -`func NewMetamorph(createdAt time.Time, actorId string, buildId string, ) *Metamorph` - -NewMetamorph instantiates a new Metamorph object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewMetamorphWithDefaults - -`func NewMetamorphWithDefaults() *Metamorph` - -NewMetamorphWithDefaults instantiates a new Metamorph object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetCreatedAt - -`func (o *Metamorph) GetCreatedAt() time.Time` - -GetCreatedAt returns the CreatedAt field if non-nil, zero value otherwise. - -### GetCreatedAtOk - -`func (o *Metamorph) GetCreatedAtOk() (*time.Time, bool)` - -GetCreatedAtOk returns a tuple with the CreatedAt field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetCreatedAt - -`func (o *Metamorph) SetCreatedAt(v time.Time)` - -SetCreatedAt sets CreatedAt field to given value. - - -### GetActorId - -`func (o *Metamorph) GetActorId() string` - -GetActorId returns the ActorId field if non-nil, zero value otherwise. - -### GetActorIdOk - -`func (o *Metamorph) GetActorIdOk() (*string, bool)` - -GetActorIdOk returns a tuple with the ActorId field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetActorId - -`func (o *Metamorph) SetActorId(v string)` - -SetActorId sets ActorId field to given value. - - -### GetBuildId - -`func (o *Metamorph) GetBuildId() string` - -GetBuildId returns the BuildId field if non-nil, zero value otherwise. - -### GetBuildIdOk - -`func (o *Metamorph) GetBuildIdOk() (*string, bool)` - -GetBuildIdOk returns a tuple with the BuildId field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetBuildId - -`func (o *Metamorph) SetBuildId(v string)` - -SetBuildId sets BuildId field to given value. - - -### GetInputKey - -`func (o *Metamorph) GetInputKey() string` - -GetInputKey returns the InputKey field if non-nil, zero value otherwise. - -### GetInputKeyOk - -`func (o *Metamorph) GetInputKeyOk() (*string, bool)` - -GetInputKeyOk returns a tuple with the InputKey field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetInputKey - -`func (o *Metamorph) SetInputKey(v string)` - -SetInputKey sets InputKey field to given value. - -### HasInputKey - -`func (o *Metamorph) HasInputKey() bool` - -HasInputKey returns a boolean if a field has been set. - -### SetInputKeyNil - -`func (o *Metamorph) SetInputKeyNil(b bool)` - - SetInputKeyNil sets the value for InputKey to be an explicit nil - -### UnsetInputKey -`func (o *Metamorph) UnsetInputKey()` - -UnsetInputKey ensures that no value is present for InputKey, not even an explicit nil - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/MonthlyUsage.md b/docs/MonthlyUsage.md deleted file mode 100644 index a63b736..0000000 --- a/docs/MonthlyUsage.md +++ /dev/null @@ -1,135 +0,0 @@ -# MonthlyUsage - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**UsageCycle** | [**UsageCycle**](UsageCycle.md) | | -**MonthlyServiceUsage** | [**map[string]UsageItem**](UsageItem.md) | A map of usage item names (e.g., ACTOR_COMPUTE_UNITS) to their usage details. | -**DailyServiceUsages** | [**[]DailyServiceUsages**](DailyServiceUsages.md) | | -**TotalUsageCreditsUsdBeforeVolumeDiscount** | **float32** | | -**TotalUsageCreditsUsdAfterVolumeDiscount** | **float32** | | - -## Methods - -### NewMonthlyUsage - -`func NewMonthlyUsage(usageCycle UsageCycle, monthlyServiceUsage map[string]UsageItem, dailyServiceUsages []DailyServiceUsages, totalUsageCreditsUsdBeforeVolumeDiscount float32, totalUsageCreditsUsdAfterVolumeDiscount float32, ) *MonthlyUsage` - -NewMonthlyUsage instantiates a new MonthlyUsage object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewMonthlyUsageWithDefaults - -`func NewMonthlyUsageWithDefaults() *MonthlyUsage` - -NewMonthlyUsageWithDefaults instantiates a new MonthlyUsage object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetUsageCycle - -`func (o *MonthlyUsage) GetUsageCycle() UsageCycle` - -GetUsageCycle returns the UsageCycle field if non-nil, zero value otherwise. - -### GetUsageCycleOk - -`func (o *MonthlyUsage) GetUsageCycleOk() (*UsageCycle, bool)` - -GetUsageCycleOk returns a tuple with the UsageCycle field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetUsageCycle - -`func (o *MonthlyUsage) SetUsageCycle(v UsageCycle)` - -SetUsageCycle sets UsageCycle field to given value. - - -### GetMonthlyServiceUsage - -`func (o *MonthlyUsage) GetMonthlyServiceUsage() map[string]UsageItem` - -GetMonthlyServiceUsage returns the MonthlyServiceUsage field if non-nil, zero value otherwise. - -### GetMonthlyServiceUsageOk - -`func (o *MonthlyUsage) GetMonthlyServiceUsageOk() (*map[string]UsageItem, bool)` - -GetMonthlyServiceUsageOk returns a tuple with the MonthlyServiceUsage field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetMonthlyServiceUsage - -`func (o *MonthlyUsage) SetMonthlyServiceUsage(v map[string]UsageItem)` - -SetMonthlyServiceUsage sets MonthlyServiceUsage field to given value. - - -### GetDailyServiceUsages - -`func (o *MonthlyUsage) GetDailyServiceUsages() []DailyServiceUsages` - -GetDailyServiceUsages returns the DailyServiceUsages field if non-nil, zero value otherwise. - -### GetDailyServiceUsagesOk - -`func (o *MonthlyUsage) GetDailyServiceUsagesOk() (*[]DailyServiceUsages, bool)` - -GetDailyServiceUsagesOk returns a tuple with the DailyServiceUsages field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetDailyServiceUsages - -`func (o *MonthlyUsage) SetDailyServiceUsages(v []DailyServiceUsages)` - -SetDailyServiceUsages sets DailyServiceUsages field to given value. - - -### GetTotalUsageCreditsUsdBeforeVolumeDiscount - -`func (o *MonthlyUsage) GetTotalUsageCreditsUsdBeforeVolumeDiscount() float32` - -GetTotalUsageCreditsUsdBeforeVolumeDiscount returns the TotalUsageCreditsUsdBeforeVolumeDiscount field if non-nil, zero value otherwise. - -### GetTotalUsageCreditsUsdBeforeVolumeDiscountOk - -`func (o *MonthlyUsage) GetTotalUsageCreditsUsdBeforeVolumeDiscountOk() (*float32, bool)` - -GetTotalUsageCreditsUsdBeforeVolumeDiscountOk returns a tuple with the TotalUsageCreditsUsdBeforeVolumeDiscount field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetTotalUsageCreditsUsdBeforeVolumeDiscount - -`func (o *MonthlyUsage) SetTotalUsageCreditsUsdBeforeVolumeDiscount(v float32)` - -SetTotalUsageCreditsUsdBeforeVolumeDiscount sets TotalUsageCreditsUsdBeforeVolumeDiscount field to given value. - - -### GetTotalUsageCreditsUsdAfterVolumeDiscount - -`func (o *MonthlyUsage) GetTotalUsageCreditsUsdAfterVolumeDiscount() float32` - -GetTotalUsageCreditsUsdAfterVolumeDiscount returns the TotalUsageCreditsUsdAfterVolumeDiscount field if non-nil, zero value otherwise. - -### GetTotalUsageCreditsUsdAfterVolumeDiscountOk - -`func (o *MonthlyUsage) GetTotalUsageCreditsUsdAfterVolumeDiscountOk() (*float32, bool)` - -GetTotalUsageCreditsUsdAfterVolumeDiscountOk returns a tuple with the TotalUsageCreditsUsdAfterVolumeDiscount field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetTotalUsageCreditsUsdAfterVolumeDiscount - -`func (o *MonthlyUsage) SetTotalUsageCreditsUsdAfterVolumeDiscount(v float32)` - -SetTotalUsageCreditsUsdAfterVolumeDiscount sets TotalUsageCreditsUsdAfterVolumeDiscount field to given value. - - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/MonthlyUsageResponse.md b/docs/MonthlyUsageResponse.md deleted file mode 100644 index 9e7f65c..0000000 --- a/docs/MonthlyUsageResponse.md +++ /dev/null @@ -1,51 +0,0 @@ -# MonthlyUsageResponse - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Data** | [**MonthlyUsage**](MonthlyUsage.md) | | - -## Methods - -### NewMonthlyUsageResponse - -`func NewMonthlyUsageResponse(data MonthlyUsage, ) *MonthlyUsageResponse` - -NewMonthlyUsageResponse instantiates a new MonthlyUsageResponse object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewMonthlyUsageResponseWithDefaults - -`func NewMonthlyUsageResponseWithDefaults() *MonthlyUsageResponse` - -NewMonthlyUsageResponseWithDefaults instantiates a new MonthlyUsageResponse object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetData - -`func (o *MonthlyUsageResponse) GetData() MonthlyUsage` - -GetData returns the Data field if non-nil, zero value otherwise. - -### GetDataOk - -`func (o *MonthlyUsageResponse) GetDataOk() (*MonthlyUsage, bool)` - -GetDataOk returns a tuple with the Data field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetData - -`func (o *MonthlyUsageResponse) SetData(v MonthlyUsage)` - -SetData sets Data field to given value. - - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/PaginationResponse.md b/docs/PaginationResponse.md deleted file mode 100644 index 48ee395..0000000 --- a/docs/PaginationResponse.md +++ /dev/null @@ -1,135 +0,0 @@ -# PaginationResponse - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Total** | **int32** | The total number of items available across all pages. | -**Offset** | **int32** | The starting position for this page of results. | -**Limit** | **int32** | The maximum number of items returned per page. | -**Desc** | **bool** | Whether the results are sorted in descending order. | -**Count** | **int32** | The number of items returned in this response. | - -## Methods - -### NewPaginationResponse - -`func NewPaginationResponse(total int32, offset int32, limit int32, desc bool, count int32, ) *PaginationResponse` - -NewPaginationResponse instantiates a new PaginationResponse object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewPaginationResponseWithDefaults - -`func NewPaginationResponseWithDefaults() *PaginationResponse` - -NewPaginationResponseWithDefaults instantiates a new PaginationResponse object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetTotal - -`func (o *PaginationResponse) GetTotal() int32` - -GetTotal returns the Total field if non-nil, zero value otherwise. - -### GetTotalOk - -`func (o *PaginationResponse) GetTotalOk() (*int32, bool)` - -GetTotalOk returns a tuple with the Total field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetTotal - -`func (o *PaginationResponse) SetTotal(v int32)` - -SetTotal sets Total field to given value. - - -### GetOffset - -`func (o *PaginationResponse) GetOffset() int32` - -GetOffset returns the Offset field if non-nil, zero value otherwise. - -### GetOffsetOk - -`func (o *PaginationResponse) GetOffsetOk() (*int32, bool)` - -GetOffsetOk returns a tuple with the Offset field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetOffset - -`func (o *PaginationResponse) SetOffset(v int32)` - -SetOffset sets Offset field to given value. - - -### GetLimit - -`func (o *PaginationResponse) GetLimit() int32` - -GetLimit returns the Limit field if non-nil, zero value otherwise. - -### GetLimitOk - -`func (o *PaginationResponse) GetLimitOk() (*int32, bool)` - -GetLimitOk returns a tuple with the Limit field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetLimit - -`func (o *PaginationResponse) SetLimit(v int32)` - -SetLimit sets Limit field to given value. - - -### GetDesc - -`func (o *PaginationResponse) GetDesc() bool` - -GetDesc returns the Desc field if non-nil, zero value otherwise. - -### GetDescOk - -`func (o *PaginationResponse) GetDescOk() (*bool, bool)` - -GetDescOk returns a tuple with the Desc field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetDesc - -`func (o *PaginationResponse) SetDesc(v bool)` - -SetDesc sets Desc field to given value. - - -### GetCount - -`func (o *PaginationResponse) GetCount() int32` - -GetCount returns the Count field if non-nil, zero value otherwise. - -### GetCountOk - -`func (o *PaginationResponse) GetCountOk() (*int32, bool)` - -GetCountOk returns a tuple with the Count field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetCount - -`func (o *PaginationResponse) SetCount(v int32)` - -SetCount sets Count field to given value. - - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/PayPerEventActorPricingInfo.md b/docs/PayPerEventActorPricingInfo.md deleted file mode 100644 index 5406002..0000000 --- a/docs/PayPerEventActorPricingInfo.md +++ /dev/null @@ -1,301 +0,0 @@ -# PayPerEventActorPricingInfo - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**ApifyMarginPercentage** | **float32** | In [0, 1], fraction of pricePerUnitUsd that goes to Apify | -**CreatedAt** | **time.Time** | When this pricing info record has been created | -**StartedAt** | **time.Time** | Since when is this pricing info record effective for a given Actor | -**NotifiedAboutFutureChangeAt** | Pointer to **time.Time** | | [optional] -**NotifiedAboutChangeAt** | Pointer to **time.Time** | | [optional] -**ReasonForChange** | Pointer to **string** | | [optional] -**IsPriceChangeNotificationSuppressed** | Pointer to **bool** | | [optional] -**ForceContainsSignificantPriceChange** | Pointer to **bool** | | [optional] -**PricingModel** | **string** | | -**PricingPerEvent** | [**PayPerEventActorPricingInfoAllOfPricingPerEvent**](PayPerEventActorPricingInfoAllOfPricingPerEvent.md) | | -**MinimalMaxTotalChargeUsd** | Pointer to **NullableFloat32** | | [optional] - -## Methods - -### NewPayPerEventActorPricingInfo - -`func NewPayPerEventActorPricingInfo(apifyMarginPercentage float32, createdAt time.Time, startedAt time.Time, pricingModel string, pricingPerEvent PayPerEventActorPricingInfoAllOfPricingPerEvent, ) *PayPerEventActorPricingInfo` - -NewPayPerEventActorPricingInfo instantiates a new PayPerEventActorPricingInfo object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewPayPerEventActorPricingInfoWithDefaults - -`func NewPayPerEventActorPricingInfoWithDefaults() *PayPerEventActorPricingInfo` - -NewPayPerEventActorPricingInfoWithDefaults instantiates a new PayPerEventActorPricingInfo object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetApifyMarginPercentage - -`func (o *PayPerEventActorPricingInfo) GetApifyMarginPercentage() float32` - -GetApifyMarginPercentage returns the ApifyMarginPercentage field if non-nil, zero value otherwise. - -### GetApifyMarginPercentageOk - -`func (o *PayPerEventActorPricingInfo) GetApifyMarginPercentageOk() (*float32, bool)` - -GetApifyMarginPercentageOk returns a tuple with the ApifyMarginPercentage field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetApifyMarginPercentage - -`func (o *PayPerEventActorPricingInfo) SetApifyMarginPercentage(v float32)` - -SetApifyMarginPercentage sets ApifyMarginPercentage field to given value. - - -### GetCreatedAt - -`func (o *PayPerEventActorPricingInfo) GetCreatedAt() time.Time` - -GetCreatedAt returns the CreatedAt field if non-nil, zero value otherwise. - -### GetCreatedAtOk - -`func (o *PayPerEventActorPricingInfo) GetCreatedAtOk() (*time.Time, bool)` - -GetCreatedAtOk returns a tuple with the CreatedAt field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetCreatedAt - -`func (o *PayPerEventActorPricingInfo) SetCreatedAt(v time.Time)` - -SetCreatedAt sets CreatedAt field to given value. - - -### GetStartedAt - -`func (o *PayPerEventActorPricingInfo) GetStartedAt() time.Time` - -GetStartedAt returns the StartedAt field if non-nil, zero value otherwise. - -### GetStartedAtOk - -`func (o *PayPerEventActorPricingInfo) GetStartedAtOk() (*time.Time, bool)` - -GetStartedAtOk returns a tuple with the StartedAt field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetStartedAt - -`func (o *PayPerEventActorPricingInfo) SetStartedAt(v time.Time)` - -SetStartedAt sets StartedAt field to given value. - - -### GetNotifiedAboutFutureChangeAt - -`func (o *PayPerEventActorPricingInfo) GetNotifiedAboutFutureChangeAt() time.Time` - -GetNotifiedAboutFutureChangeAt returns the NotifiedAboutFutureChangeAt field if non-nil, zero value otherwise. - -### GetNotifiedAboutFutureChangeAtOk - -`func (o *PayPerEventActorPricingInfo) GetNotifiedAboutFutureChangeAtOk() (*time.Time, bool)` - -GetNotifiedAboutFutureChangeAtOk returns a tuple with the NotifiedAboutFutureChangeAt field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetNotifiedAboutFutureChangeAt - -`func (o *PayPerEventActorPricingInfo) SetNotifiedAboutFutureChangeAt(v time.Time)` - -SetNotifiedAboutFutureChangeAt sets NotifiedAboutFutureChangeAt field to given value. - -### HasNotifiedAboutFutureChangeAt - -`func (o *PayPerEventActorPricingInfo) HasNotifiedAboutFutureChangeAt() bool` - -HasNotifiedAboutFutureChangeAt returns a boolean if a field has been set. - -### GetNotifiedAboutChangeAt - -`func (o *PayPerEventActorPricingInfo) GetNotifiedAboutChangeAt() time.Time` - -GetNotifiedAboutChangeAt returns the NotifiedAboutChangeAt field if non-nil, zero value otherwise. - -### GetNotifiedAboutChangeAtOk - -`func (o *PayPerEventActorPricingInfo) GetNotifiedAboutChangeAtOk() (*time.Time, bool)` - -GetNotifiedAboutChangeAtOk returns a tuple with the NotifiedAboutChangeAt field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetNotifiedAboutChangeAt - -`func (o *PayPerEventActorPricingInfo) SetNotifiedAboutChangeAt(v time.Time)` - -SetNotifiedAboutChangeAt sets NotifiedAboutChangeAt field to given value. - -### HasNotifiedAboutChangeAt - -`func (o *PayPerEventActorPricingInfo) HasNotifiedAboutChangeAt() bool` - -HasNotifiedAboutChangeAt returns a boolean if a field has been set. - -### GetReasonForChange - -`func (o *PayPerEventActorPricingInfo) GetReasonForChange() string` - -GetReasonForChange returns the ReasonForChange field if non-nil, zero value otherwise. - -### GetReasonForChangeOk - -`func (o *PayPerEventActorPricingInfo) GetReasonForChangeOk() (*string, bool)` - -GetReasonForChangeOk returns a tuple with the ReasonForChange field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetReasonForChange - -`func (o *PayPerEventActorPricingInfo) SetReasonForChange(v string)` - -SetReasonForChange sets ReasonForChange field to given value. - -### HasReasonForChange - -`func (o *PayPerEventActorPricingInfo) HasReasonForChange() bool` - -HasReasonForChange returns a boolean if a field has been set. - -### GetIsPriceChangeNotificationSuppressed - -`func (o *PayPerEventActorPricingInfo) GetIsPriceChangeNotificationSuppressed() bool` - -GetIsPriceChangeNotificationSuppressed returns the IsPriceChangeNotificationSuppressed field if non-nil, zero value otherwise. - -### GetIsPriceChangeNotificationSuppressedOk - -`func (o *PayPerEventActorPricingInfo) GetIsPriceChangeNotificationSuppressedOk() (*bool, bool)` - -GetIsPriceChangeNotificationSuppressedOk returns a tuple with the IsPriceChangeNotificationSuppressed field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetIsPriceChangeNotificationSuppressed - -`func (o *PayPerEventActorPricingInfo) SetIsPriceChangeNotificationSuppressed(v bool)` - -SetIsPriceChangeNotificationSuppressed sets IsPriceChangeNotificationSuppressed field to given value. - -### HasIsPriceChangeNotificationSuppressed - -`func (o *PayPerEventActorPricingInfo) HasIsPriceChangeNotificationSuppressed() bool` - -HasIsPriceChangeNotificationSuppressed returns a boolean if a field has been set. - -### GetForceContainsSignificantPriceChange - -`func (o *PayPerEventActorPricingInfo) GetForceContainsSignificantPriceChange() bool` - -GetForceContainsSignificantPriceChange returns the ForceContainsSignificantPriceChange field if non-nil, zero value otherwise. - -### GetForceContainsSignificantPriceChangeOk - -`func (o *PayPerEventActorPricingInfo) GetForceContainsSignificantPriceChangeOk() (*bool, bool)` - -GetForceContainsSignificantPriceChangeOk returns a tuple with the ForceContainsSignificantPriceChange field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetForceContainsSignificantPriceChange - -`func (o *PayPerEventActorPricingInfo) SetForceContainsSignificantPriceChange(v bool)` - -SetForceContainsSignificantPriceChange sets ForceContainsSignificantPriceChange field to given value. - -### HasForceContainsSignificantPriceChange - -`func (o *PayPerEventActorPricingInfo) HasForceContainsSignificantPriceChange() bool` - -HasForceContainsSignificantPriceChange returns a boolean if a field has been set. - -### GetPricingModel - -`func (o *PayPerEventActorPricingInfo) GetPricingModel() string` - -GetPricingModel returns the PricingModel field if non-nil, zero value otherwise. - -### GetPricingModelOk - -`func (o *PayPerEventActorPricingInfo) GetPricingModelOk() (*string, bool)` - -GetPricingModelOk returns a tuple with the PricingModel field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetPricingModel - -`func (o *PayPerEventActorPricingInfo) SetPricingModel(v string)` - -SetPricingModel sets PricingModel field to given value. - - -### GetPricingPerEvent - -`func (o *PayPerEventActorPricingInfo) GetPricingPerEvent() PayPerEventActorPricingInfoAllOfPricingPerEvent` - -GetPricingPerEvent returns the PricingPerEvent field if non-nil, zero value otherwise. - -### GetPricingPerEventOk - -`func (o *PayPerEventActorPricingInfo) GetPricingPerEventOk() (*PayPerEventActorPricingInfoAllOfPricingPerEvent, bool)` - -GetPricingPerEventOk returns a tuple with the PricingPerEvent field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetPricingPerEvent - -`func (o *PayPerEventActorPricingInfo) SetPricingPerEvent(v PayPerEventActorPricingInfoAllOfPricingPerEvent)` - -SetPricingPerEvent sets PricingPerEvent field to given value. - - -### GetMinimalMaxTotalChargeUsd - -`func (o *PayPerEventActorPricingInfo) GetMinimalMaxTotalChargeUsd() float32` - -GetMinimalMaxTotalChargeUsd returns the MinimalMaxTotalChargeUsd field if non-nil, zero value otherwise. - -### GetMinimalMaxTotalChargeUsdOk - -`func (o *PayPerEventActorPricingInfo) GetMinimalMaxTotalChargeUsdOk() (*float32, bool)` - -GetMinimalMaxTotalChargeUsdOk returns a tuple with the MinimalMaxTotalChargeUsd field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetMinimalMaxTotalChargeUsd - -`func (o *PayPerEventActorPricingInfo) SetMinimalMaxTotalChargeUsd(v float32)` - -SetMinimalMaxTotalChargeUsd sets MinimalMaxTotalChargeUsd field to given value. - -### HasMinimalMaxTotalChargeUsd - -`func (o *PayPerEventActorPricingInfo) HasMinimalMaxTotalChargeUsd() bool` - -HasMinimalMaxTotalChargeUsd returns a boolean if a field has been set. - -### SetMinimalMaxTotalChargeUsdNil - -`func (o *PayPerEventActorPricingInfo) SetMinimalMaxTotalChargeUsdNil(b bool)` - - SetMinimalMaxTotalChargeUsdNil sets the value for MinimalMaxTotalChargeUsd to be an explicit nil - -### UnsetMinimalMaxTotalChargeUsd -`func (o *PayPerEventActorPricingInfo) UnsetMinimalMaxTotalChargeUsd()` - -UnsetMinimalMaxTotalChargeUsd ensures that no value is present for MinimalMaxTotalChargeUsd, not even an explicit nil - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/PayPerEventActorPricingInfoAllOfPricingPerEvent.md b/docs/PayPerEventActorPricingInfoAllOfPricingPerEvent.md deleted file mode 100644 index 7160c47..0000000 --- a/docs/PayPerEventActorPricingInfoAllOfPricingPerEvent.md +++ /dev/null @@ -1,56 +0,0 @@ -# PayPerEventActorPricingInfoAllOfPricingPerEvent - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**ActorChargeEvents** | Pointer to [**map[string]ActorChargeEvent**](ActorChargeEvent.md) | | [optional] - -## Methods - -### NewPayPerEventActorPricingInfoAllOfPricingPerEvent - -`func NewPayPerEventActorPricingInfoAllOfPricingPerEvent() *PayPerEventActorPricingInfoAllOfPricingPerEvent` - -NewPayPerEventActorPricingInfoAllOfPricingPerEvent instantiates a new PayPerEventActorPricingInfoAllOfPricingPerEvent object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewPayPerEventActorPricingInfoAllOfPricingPerEventWithDefaults - -`func NewPayPerEventActorPricingInfoAllOfPricingPerEventWithDefaults() *PayPerEventActorPricingInfoAllOfPricingPerEvent` - -NewPayPerEventActorPricingInfoAllOfPricingPerEventWithDefaults instantiates a new PayPerEventActorPricingInfoAllOfPricingPerEvent object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetActorChargeEvents - -`func (o *PayPerEventActorPricingInfoAllOfPricingPerEvent) GetActorChargeEvents() map[string]ActorChargeEvent` - -GetActorChargeEvents returns the ActorChargeEvents field if non-nil, zero value otherwise. - -### GetActorChargeEventsOk - -`func (o *PayPerEventActorPricingInfoAllOfPricingPerEvent) GetActorChargeEventsOk() (*map[string]ActorChargeEvent, bool)` - -GetActorChargeEventsOk returns a tuple with the ActorChargeEvents field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetActorChargeEvents - -`func (o *PayPerEventActorPricingInfoAllOfPricingPerEvent) SetActorChargeEvents(v map[string]ActorChargeEvent)` - -SetActorChargeEvents sets ActorChargeEvents field to given value. - -### HasActorChargeEvents - -`func (o *PayPerEventActorPricingInfoAllOfPricingPerEvent) HasActorChargeEvents() bool` - -HasActorChargeEvents returns a boolean if a field has been set. - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/Plan.md b/docs/Plan.md deleted file mode 100644 index 8e87457..0000000 --- a/docs/Plan.md +++ /dev/null @@ -1,585 +0,0 @@ -# Plan - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Id** | **string** | | -**Description** | **string** | | -**IsEnabled** | **bool** | | -**MonthlyBasePriceUsd** | **float32** | | -**MonthlyUsageCreditsUsd** | **float32** | | -**UsageDiscountPercent** | Pointer to **float32** | | [optional] -**EnabledPlatformFeatures** | **[]string** | | -**MaxMonthlyUsageUsd** | **float32** | | -**MaxActorMemoryGbytes** | **float32** | | -**MaxMonthlyActorComputeUnits** | **float32** | | -**MaxMonthlyResidentialProxyGbytes** | **float32** | | -**MaxMonthlyProxySerps** | **int32** | | -**MaxMonthlyExternalDataTransferGbytes** | **float32** | | -**MaxActorCount** | **int32** | | -**MaxActorTaskCount** | **int32** | | -**DataRetentionDays** | **int32** | | -**AvailableProxyGroups** | **map[string]int32** | A dictionary mapping proxy group names to the number of available proxies in each group. The keys are proxy group names (e.g., \"RESIDENTIAL\", \"DATACENTER\") and values are the count of available proxies. | -**TeamAccountSeatCount** | **int32** | | -**SupportLevel** | **string** | | -**AvailableAddOns** | **[]string** | | -**Tier** | Pointer to **string** | | [optional] -**ApiRateLimitBoosts** | Pointer to **int32** | | [optional] -**MaxScheduleCount** | Pointer to **int32** | | [optional] -**MaxConcurrentActorRuns** | Pointer to **int32** | | [optional] -**PlanPricing** | Pointer to **map[string]interface{}** | Pricing details for this plan. | [optional] - -## Methods - -### NewPlan - -`func NewPlan(id string, description string, isEnabled bool, monthlyBasePriceUsd float32, monthlyUsageCreditsUsd float32, enabledPlatformFeatures []string, maxMonthlyUsageUsd float32, maxActorMemoryGbytes float32, maxMonthlyActorComputeUnits float32, maxMonthlyResidentialProxyGbytes float32, maxMonthlyProxySerps int32, maxMonthlyExternalDataTransferGbytes float32, maxActorCount int32, maxActorTaskCount int32, dataRetentionDays int32, availableProxyGroups map[string]int32, teamAccountSeatCount int32, supportLevel string, availableAddOns []string, ) *Plan` - -NewPlan instantiates a new Plan object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewPlanWithDefaults - -`func NewPlanWithDefaults() *Plan` - -NewPlanWithDefaults instantiates a new Plan object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetId - -`func (o *Plan) GetId() string` - -GetId returns the Id field if non-nil, zero value otherwise. - -### GetIdOk - -`func (o *Plan) GetIdOk() (*string, bool)` - -GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetId - -`func (o *Plan) SetId(v string)` - -SetId sets Id field to given value. - - -### GetDescription - -`func (o *Plan) GetDescription() string` - -GetDescription returns the Description field if non-nil, zero value otherwise. - -### GetDescriptionOk - -`func (o *Plan) GetDescriptionOk() (*string, bool)` - -GetDescriptionOk returns a tuple with the Description field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetDescription - -`func (o *Plan) SetDescription(v string)` - -SetDescription sets Description field to given value. - - -### GetIsEnabled - -`func (o *Plan) GetIsEnabled() bool` - -GetIsEnabled returns the IsEnabled field if non-nil, zero value otherwise. - -### GetIsEnabledOk - -`func (o *Plan) GetIsEnabledOk() (*bool, bool)` - -GetIsEnabledOk returns a tuple with the IsEnabled field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetIsEnabled - -`func (o *Plan) SetIsEnabled(v bool)` - -SetIsEnabled sets IsEnabled field to given value. - - -### GetMonthlyBasePriceUsd - -`func (o *Plan) GetMonthlyBasePriceUsd() float32` - -GetMonthlyBasePriceUsd returns the MonthlyBasePriceUsd field if non-nil, zero value otherwise. - -### GetMonthlyBasePriceUsdOk - -`func (o *Plan) GetMonthlyBasePriceUsdOk() (*float32, bool)` - -GetMonthlyBasePriceUsdOk returns a tuple with the MonthlyBasePriceUsd field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetMonthlyBasePriceUsd - -`func (o *Plan) SetMonthlyBasePriceUsd(v float32)` - -SetMonthlyBasePriceUsd sets MonthlyBasePriceUsd field to given value. - - -### GetMonthlyUsageCreditsUsd - -`func (o *Plan) GetMonthlyUsageCreditsUsd() float32` - -GetMonthlyUsageCreditsUsd returns the MonthlyUsageCreditsUsd field if non-nil, zero value otherwise. - -### GetMonthlyUsageCreditsUsdOk - -`func (o *Plan) GetMonthlyUsageCreditsUsdOk() (*float32, bool)` - -GetMonthlyUsageCreditsUsdOk returns a tuple with the MonthlyUsageCreditsUsd field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetMonthlyUsageCreditsUsd - -`func (o *Plan) SetMonthlyUsageCreditsUsd(v float32)` - -SetMonthlyUsageCreditsUsd sets MonthlyUsageCreditsUsd field to given value. - - -### GetUsageDiscountPercent - -`func (o *Plan) GetUsageDiscountPercent() float32` - -GetUsageDiscountPercent returns the UsageDiscountPercent field if non-nil, zero value otherwise. - -### GetUsageDiscountPercentOk - -`func (o *Plan) GetUsageDiscountPercentOk() (*float32, bool)` - -GetUsageDiscountPercentOk returns a tuple with the UsageDiscountPercent field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetUsageDiscountPercent - -`func (o *Plan) SetUsageDiscountPercent(v float32)` - -SetUsageDiscountPercent sets UsageDiscountPercent field to given value. - -### HasUsageDiscountPercent - -`func (o *Plan) HasUsageDiscountPercent() bool` - -HasUsageDiscountPercent returns a boolean if a field has been set. - -### GetEnabledPlatformFeatures - -`func (o *Plan) GetEnabledPlatformFeatures() []string` - -GetEnabledPlatformFeatures returns the EnabledPlatformFeatures field if non-nil, zero value otherwise. - -### GetEnabledPlatformFeaturesOk - -`func (o *Plan) GetEnabledPlatformFeaturesOk() (*[]string, bool)` - -GetEnabledPlatformFeaturesOk returns a tuple with the EnabledPlatformFeatures field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetEnabledPlatformFeatures - -`func (o *Plan) SetEnabledPlatformFeatures(v []string)` - -SetEnabledPlatformFeatures sets EnabledPlatformFeatures field to given value. - - -### GetMaxMonthlyUsageUsd - -`func (o *Plan) GetMaxMonthlyUsageUsd() float32` - -GetMaxMonthlyUsageUsd returns the MaxMonthlyUsageUsd field if non-nil, zero value otherwise. - -### GetMaxMonthlyUsageUsdOk - -`func (o *Plan) GetMaxMonthlyUsageUsdOk() (*float32, bool)` - -GetMaxMonthlyUsageUsdOk returns a tuple with the MaxMonthlyUsageUsd field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetMaxMonthlyUsageUsd - -`func (o *Plan) SetMaxMonthlyUsageUsd(v float32)` - -SetMaxMonthlyUsageUsd sets MaxMonthlyUsageUsd field to given value. - - -### GetMaxActorMemoryGbytes - -`func (o *Plan) GetMaxActorMemoryGbytes() float32` - -GetMaxActorMemoryGbytes returns the MaxActorMemoryGbytes field if non-nil, zero value otherwise. - -### GetMaxActorMemoryGbytesOk - -`func (o *Plan) GetMaxActorMemoryGbytesOk() (*float32, bool)` - -GetMaxActorMemoryGbytesOk returns a tuple with the MaxActorMemoryGbytes field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetMaxActorMemoryGbytes - -`func (o *Plan) SetMaxActorMemoryGbytes(v float32)` - -SetMaxActorMemoryGbytes sets MaxActorMemoryGbytes field to given value. - - -### GetMaxMonthlyActorComputeUnits - -`func (o *Plan) GetMaxMonthlyActorComputeUnits() float32` - -GetMaxMonthlyActorComputeUnits returns the MaxMonthlyActorComputeUnits field if non-nil, zero value otherwise. - -### GetMaxMonthlyActorComputeUnitsOk - -`func (o *Plan) GetMaxMonthlyActorComputeUnitsOk() (*float32, bool)` - -GetMaxMonthlyActorComputeUnitsOk returns a tuple with the MaxMonthlyActorComputeUnits field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetMaxMonthlyActorComputeUnits - -`func (o *Plan) SetMaxMonthlyActorComputeUnits(v float32)` - -SetMaxMonthlyActorComputeUnits sets MaxMonthlyActorComputeUnits field to given value. - - -### GetMaxMonthlyResidentialProxyGbytes - -`func (o *Plan) GetMaxMonthlyResidentialProxyGbytes() float32` - -GetMaxMonthlyResidentialProxyGbytes returns the MaxMonthlyResidentialProxyGbytes field if non-nil, zero value otherwise. - -### GetMaxMonthlyResidentialProxyGbytesOk - -`func (o *Plan) GetMaxMonthlyResidentialProxyGbytesOk() (*float32, bool)` - -GetMaxMonthlyResidentialProxyGbytesOk returns a tuple with the MaxMonthlyResidentialProxyGbytes field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetMaxMonthlyResidentialProxyGbytes - -`func (o *Plan) SetMaxMonthlyResidentialProxyGbytes(v float32)` - -SetMaxMonthlyResidentialProxyGbytes sets MaxMonthlyResidentialProxyGbytes field to given value. - - -### GetMaxMonthlyProxySerps - -`func (o *Plan) GetMaxMonthlyProxySerps() int32` - -GetMaxMonthlyProxySerps returns the MaxMonthlyProxySerps field if non-nil, zero value otherwise. - -### GetMaxMonthlyProxySerpsOk - -`func (o *Plan) GetMaxMonthlyProxySerpsOk() (*int32, bool)` - -GetMaxMonthlyProxySerpsOk returns a tuple with the MaxMonthlyProxySerps field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetMaxMonthlyProxySerps - -`func (o *Plan) SetMaxMonthlyProxySerps(v int32)` - -SetMaxMonthlyProxySerps sets MaxMonthlyProxySerps field to given value. - - -### GetMaxMonthlyExternalDataTransferGbytes - -`func (o *Plan) GetMaxMonthlyExternalDataTransferGbytes() float32` - -GetMaxMonthlyExternalDataTransferGbytes returns the MaxMonthlyExternalDataTransferGbytes field if non-nil, zero value otherwise. - -### GetMaxMonthlyExternalDataTransferGbytesOk - -`func (o *Plan) GetMaxMonthlyExternalDataTransferGbytesOk() (*float32, bool)` - -GetMaxMonthlyExternalDataTransferGbytesOk returns a tuple with the MaxMonthlyExternalDataTransferGbytes field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetMaxMonthlyExternalDataTransferGbytes - -`func (o *Plan) SetMaxMonthlyExternalDataTransferGbytes(v float32)` - -SetMaxMonthlyExternalDataTransferGbytes sets MaxMonthlyExternalDataTransferGbytes field to given value. - - -### GetMaxActorCount - -`func (o *Plan) GetMaxActorCount() int32` - -GetMaxActorCount returns the MaxActorCount field if non-nil, zero value otherwise. - -### GetMaxActorCountOk - -`func (o *Plan) GetMaxActorCountOk() (*int32, bool)` - -GetMaxActorCountOk returns a tuple with the MaxActorCount field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetMaxActorCount - -`func (o *Plan) SetMaxActorCount(v int32)` - -SetMaxActorCount sets MaxActorCount field to given value. - - -### GetMaxActorTaskCount - -`func (o *Plan) GetMaxActorTaskCount() int32` - -GetMaxActorTaskCount returns the MaxActorTaskCount field if non-nil, zero value otherwise. - -### GetMaxActorTaskCountOk - -`func (o *Plan) GetMaxActorTaskCountOk() (*int32, bool)` - -GetMaxActorTaskCountOk returns a tuple with the MaxActorTaskCount field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetMaxActorTaskCount - -`func (o *Plan) SetMaxActorTaskCount(v int32)` - -SetMaxActorTaskCount sets MaxActorTaskCount field to given value. - - -### GetDataRetentionDays - -`func (o *Plan) GetDataRetentionDays() int32` - -GetDataRetentionDays returns the DataRetentionDays field if non-nil, zero value otherwise. - -### GetDataRetentionDaysOk - -`func (o *Plan) GetDataRetentionDaysOk() (*int32, bool)` - -GetDataRetentionDaysOk returns a tuple with the DataRetentionDays field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetDataRetentionDays - -`func (o *Plan) SetDataRetentionDays(v int32)` - -SetDataRetentionDays sets DataRetentionDays field to given value. - - -### GetAvailableProxyGroups - -`func (o *Plan) GetAvailableProxyGroups() map[string]int32` - -GetAvailableProxyGroups returns the AvailableProxyGroups field if non-nil, zero value otherwise. - -### GetAvailableProxyGroupsOk - -`func (o *Plan) GetAvailableProxyGroupsOk() (*map[string]int32, bool)` - -GetAvailableProxyGroupsOk returns a tuple with the AvailableProxyGroups field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetAvailableProxyGroups - -`func (o *Plan) SetAvailableProxyGroups(v map[string]int32)` - -SetAvailableProxyGroups sets AvailableProxyGroups field to given value. - - -### GetTeamAccountSeatCount - -`func (o *Plan) GetTeamAccountSeatCount() int32` - -GetTeamAccountSeatCount returns the TeamAccountSeatCount field if non-nil, zero value otherwise. - -### GetTeamAccountSeatCountOk - -`func (o *Plan) GetTeamAccountSeatCountOk() (*int32, bool)` - -GetTeamAccountSeatCountOk returns a tuple with the TeamAccountSeatCount field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetTeamAccountSeatCount - -`func (o *Plan) SetTeamAccountSeatCount(v int32)` - -SetTeamAccountSeatCount sets TeamAccountSeatCount field to given value. - - -### GetSupportLevel - -`func (o *Plan) GetSupportLevel() string` - -GetSupportLevel returns the SupportLevel field if non-nil, zero value otherwise. - -### GetSupportLevelOk - -`func (o *Plan) GetSupportLevelOk() (*string, bool)` - -GetSupportLevelOk returns a tuple with the SupportLevel field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetSupportLevel - -`func (o *Plan) SetSupportLevel(v string)` - -SetSupportLevel sets SupportLevel field to given value. - - -### GetAvailableAddOns - -`func (o *Plan) GetAvailableAddOns() []string` - -GetAvailableAddOns returns the AvailableAddOns field if non-nil, zero value otherwise. - -### GetAvailableAddOnsOk - -`func (o *Plan) GetAvailableAddOnsOk() (*[]string, bool)` - -GetAvailableAddOnsOk returns a tuple with the AvailableAddOns field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetAvailableAddOns - -`func (o *Plan) SetAvailableAddOns(v []string)` - -SetAvailableAddOns sets AvailableAddOns field to given value. - - -### GetTier - -`func (o *Plan) GetTier() string` - -GetTier returns the Tier field if non-nil, zero value otherwise. - -### GetTierOk - -`func (o *Plan) GetTierOk() (*string, bool)` - -GetTierOk returns a tuple with the Tier field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetTier - -`func (o *Plan) SetTier(v string)` - -SetTier sets Tier field to given value. - -### HasTier - -`func (o *Plan) HasTier() bool` - -HasTier returns a boolean if a field has been set. - -### GetApiRateLimitBoosts - -`func (o *Plan) GetApiRateLimitBoosts() int32` - -GetApiRateLimitBoosts returns the ApiRateLimitBoosts field if non-nil, zero value otherwise. - -### GetApiRateLimitBoostsOk - -`func (o *Plan) GetApiRateLimitBoostsOk() (*int32, bool)` - -GetApiRateLimitBoostsOk returns a tuple with the ApiRateLimitBoosts field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetApiRateLimitBoosts - -`func (o *Plan) SetApiRateLimitBoosts(v int32)` - -SetApiRateLimitBoosts sets ApiRateLimitBoosts field to given value. - -### HasApiRateLimitBoosts - -`func (o *Plan) HasApiRateLimitBoosts() bool` - -HasApiRateLimitBoosts returns a boolean if a field has been set. - -### GetMaxScheduleCount - -`func (o *Plan) GetMaxScheduleCount() int32` - -GetMaxScheduleCount returns the MaxScheduleCount field if non-nil, zero value otherwise. - -### GetMaxScheduleCountOk - -`func (o *Plan) GetMaxScheduleCountOk() (*int32, bool)` - -GetMaxScheduleCountOk returns a tuple with the MaxScheduleCount field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetMaxScheduleCount - -`func (o *Plan) SetMaxScheduleCount(v int32)` - -SetMaxScheduleCount sets MaxScheduleCount field to given value. - -### HasMaxScheduleCount - -`func (o *Plan) HasMaxScheduleCount() bool` - -HasMaxScheduleCount returns a boolean if a field has been set. - -### GetMaxConcurrentActorRuns - -`func (o *Plan) GetMaxConcurrentActorRuns() int32` - -GetMaxConcurrentActorRuns returns the MaxConcurrentActorRuns field if non-nil, zero value otherwise. - -### GetMaxConcurrentActorRunsOk - -`func (o *Plan) GetMaxConcurrentActorRunsOk() (*int32, bool)` - -GetMaxConcurrentActorRunsOk returns a tuple with the MaxConcurrentActorRuns field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetMaxConcurrentActorRuns - -`func (o *Plan) SetMaxConcurrentActorRuns(v int32)` - -SetMaxConcurrentActorRuns sets MaxConcurrentActorRuns field to given value. - -### HasMaxConcurrentActorRuns - -`func (o *Plan) HasMaxConcurrentActorRuns() bool` - -HasMaxConcurrentActorRuns returns a boolean if a field has been set. - -### GetPlanPricing - -`func (o *Plan) GetPlanPricing() map[string]interface{}` - -GetPlanPricing returns the PlanPricing field if non-nil, zero value otherwise. - -### GetPlanPricingOk - -`func (o *Plan) GetPlanPricingOk() (*map[string]interface{}, bool)` - -GetPlanPricingOk returns a tuple with the PlanPricing field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetPlanPricing - -`func (o *Plan) SetPlanPricing(v map[string]interface{})` - -SetPlanPricing sets PlanPricing field to given value. - -### HasPlanPricing - -`func (o *Plan) HasPlanPricing() bool` - -HasPlanPricing returns a boolean if a field has been set. - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/PricePerDatasetItemActorPricingInfo.md b/docs/PricePerDatasetItemActorPricingInfo.md deleted file mode 100644 index 0846de6..0000000 --- a/docs/PricePerDatasetItemActorPricingInfo.md +++ /dev/null @@ -1,317 +0,0 @@ -# PricePerDatasetItemActorPricingInfo - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**ApifyMarginPercentage** | **float32** | In [0, 1], fraction of pricePerUnitUsd that goes to Apify | -**CreatedAt** | **time.Time** | When this pricing info record has been created | -**StartedAt** | **time.Time** | Since when is this pricing info record effective for a given Actor | -**NotifiedAboutFutureChangeAt** | Pointer to **time.Time** | | [optional] -**NotifiedAboutChangeAt** | Pointer to **time.Time** | | [optional] -**ReasonForChange** | Pointer to **string** | | [optional] -**IsPriceChangeNotificationSuppressed** | Pointer to **bool** | | [optional] -**ForceContainsSignificantPriceChange** | Pointer to **bool** | | [optional] -**PricingModel** | **string** | | -**UnitName** | **string** | Name of the unit that is being charged | -**PricePerUnitUsd** | Pointer to **float32** | Price per unit in USD. Mutually exclusive with `tieredPricing` - exactly one of the two is present on a pricing record. | [optional] -**TieredPricing** | Pointer to [**map[string]TieredPricingPerDatasetItemEntry**](TieredPricingPerDatasetItemEntry.md) | Tiered price-per-dataset-item pricing, keyed by subscription tier (e.g. `FREE`, `BRONZE`, `SILVER`, `GOLD`, `PLATINUM`, `DIAMOND`). The actual price applied to a run is resolved from the user's tier. | [optional] - -## Methods - -### NewPricePerDatasetItemActorPricingInfo - -`func NewPricePerDatasetItemActorPricingInfo(apifyMarginPercentage float32, createdAt time.Time, startedAt time.Time, pricingModel string, unitName string, ) *PricePerDatasetItemActorPricingInfo` - -NewPricePerDatasetItemActorPricingInfo instantiates a new PricePerDatasetItemActorPricingInfo object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewPricePerDatasetItemActorPricingInfoWithDefaults - -`func NewPricePerDatasetItemActorPricingInfoWithDefaults() *PricePerDatasetItemActorPricingInfo` - -NewPricePerDatasetItemActorPricingInfoWithDefaults instantiates a new PricePerDatasetItemActorPricingInfo object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetApifyMarginPercentage - -`func (o *PricePerDatasetItemActorPricingInfo) GetApifyMarginPercentage() float32` - -GetApifyMarginPercentage returns the ApifyMarginPercentage field if non-nil, zero value otherwise. - -### GetApifyMarginPercentageOk - -`func (o *PricePerDatasetItemActorPricingInfo) GetApifyMarginPercentageOk() (*float32, bool)` - -GetApifyMarginPercentageOk returns a tuple with the ApifyMarginPercentage field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetApifyMarginPercentage - -`func (o *PricePerDatasetItemActorPricingInfo) SetApifyMarginPercentage(v float32)` - -SetApifyMarginPercentage sets ApifyMarginPercentage field to given value. - - -### GetCreatedAt - -`func (o *PricePerDatasetItemActorPricingInfo) GetCreatedAt() time.Time` - -GetCreatedAt returns the CreatedAt field if non-nil, zero value otherwise. - -### GetCreatedAtOk - -`func (o *PricePerDatasetItemActorPricingInfo) GetCreatedAtOk() (*time.Time, bool)` - -GetCreatedAtOk returns a tuple with the CreatedAt field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetCreatedAt - -`func (o *PricePerDatasetItemActorPricingInfo) SetCreatedAt(v time.Time)` - -SetCreatedAt sets CreatedAt field to given value. - - -### GetStartedAt - -`func (o *PricePerDatasetItemActorPricingInfo) GetStartedAt() time.Time` - -GetStartedAt returns the StartedAt field if non-nil, zero value otherwise. - -### GetStartedAtOk - -`func (o *PricePerDatasetItemActorPricingInfo) GetStartedAtOk() (*time.Time, bool)` - -GetStartedAtOk returns a tuple with the StartedAt field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetStartedAt - -`func (o *PricePerDatasetItemActorPricingInfo) SetStartedAt(v time.Time)` - -SetStartedAt sets StartedAt field to given value. - - -### GetNotifiedAboutFutureChangeAt - -`func (o *PricePerDatasetItemActorPricingInfo) GetNotifiedAboutFutureChangeAt() time.Time` - -GetNotifiedAboutFutureChangeAt returns the NotifiedAboutFutureChangeAt field if non-nil, zero value otherwise. - -### GetNotifiedAboutFutureChangeAtOk - -`func (o *PricePerDatasetItemActorPricingInfo) GetNotifiedAboutFutureChangeAtOk() (*time.Time, bool)` - -GetNotifiedAboutFutureChangeAtOk returns a tuple with the NotifiedAboutFutureChangeAt field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetNotifiedAboutFutureChangeAt - -`func (o *PricePerDatasetItemActorPricingInfo) SetNotifiedAboutFutureChangeAt(v time.Time)` - -SetNotifiedAboutFutureChangeAt sets NotifiedAboutFutureChangeAt field to given value. - -### HasNotifiedAboutFutureChangeAt - -`func (o *PricePerDatasetItemActorPricingInfo) HasNotifiedAboutFutureChangeAt() bool` - -HasNotifiedAboutFutureChangeAt returns a boolean if a field has been set. - -### GetNotifiedAboutChangeAt - -`func (o *PricePerDatasetItemActorPricingInfo) GetNotifiedAboutChangeAt() time.Time` - -GetNotifiedAboutChangeAt returns the NotifiedAboutChangeAt field if non-nil, zero value otherwise. - -### GetNotifiedAboutChangeAtOk - -`func (o *PricePerDatasetItemActorPricingInfo) GetNotifiedAboutChangeAtOk() (*time.Time, bool)` - -GetNotifiedAboutChangeAtOk returns a tuple with the NotifiedAboutChangeAt field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetNotifiedAboutChangeAt - -`func (o *PricePerDatasetItemActorPricingInfo) SetNotifiedAboutChangeAt(v time.Time)` - -SetNotifiedAboutChangeAt sets NotifiedAboutChangeAt field to given value. - -### HasNotifiedAboutChangeAt - -`func (o *PricePerDatasetItemActorPricingInfo) HasNotifiedAboutChangeAt() bool` - -HasNotifiedAboutChangeAt returns a boolean if a field has been set. - -### GetReasonForChange - -`func (o *PricePerDatasetItemActorPricingInfo) GetReasonForChange() string` - -GetReasonForChange returns the ReasonForChange field if non-nil, zero value otherwise. - -### GetReasonForChangeOk - -`func (o *PricePerDatasetItemActorPricingInfo) GetReasonForChangeOk() (*string, bool)` - -GetReasonForChangeOk returns a tuple with the ReasonForChange field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetReasonForChange - -`func (o *PricePerDatasetItemActorPricingInfo) SetReasonForChange(v string)` - -SetReasonForChange sets ReasonForChange field to given value. - -### HasReasonForChange - -`func (o *PricePerDatasetItemActorPricingInfo) HasReasonForChange() bool` - -HasReasonForChange returns a boolean if a field has been set. - -### GetIsPriceChangeNotificationSuppressed - -`func (o *PricePerDatasetItemActorPricingInfo) GetIsPriceChangeNotificationSuppressed() bool` - -GetIsPriceChangeNotificationSuppressed returns the IsPriceChangeNotificationSuppressed field if non-nil, zero value otherwise. - -### GetIsPriceChangeNotificationSuppressedOk - -`func (o *PricePerDatasetItemActorPricingInfo) GetIsPriceChangeNotificationSuppressedOk() (*bool, bool)` - -GetIsPriceChangeNotificationSuppressedOk returns a tuple with the IsPriceChangeNotificationSuppressed field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetIsPriceChangeNotificationSuppressed - -`func (o *PricePerDatasetItemActorPricingInfo) SetIsPriceChangeNotificationSuppressed(v bool)` - -SetIsPriceChangeNotificationSuppressed sets IsPriceChangeNotificationSuppressed field to given value. - -### HasIsPriceChangeNotificationSuppressed - -`func (o *PricePerDatasetItemActorPricingInfo) HasIsPriceChangeNotificationSuppressed() bool` - -HasIsPriceChangeNotificationSuppressed returns a boolean if a field has been set. - -### GetForceContainsSignificantPriceChange - -`func (o *PricePerDatasetItemActorPricingInfo) GetForceContainsSignificantPriceChange() bool` - -GetForceContainsSignificantPriceChange returns the ForceContainsSignificantPriceChange field if non-nil, zero value otherwise. - -### GetForceContainsSignificantPriceChangeOk - -`func (o *PricePerDatasetItemActorPricingInfo) GetForceContainsSignificantPriceChangeOk() (*bool, bool)` - -GetForceContainsSignificantPriceChangeOk returns a tuple with the ForceContainsSignificantPriceChange field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetForceContainsSignificantPriceChange - -`func (o *PricePerDatasetItemActorPricingInfo) SetForceContainsSignificantPriceChange(v bool)` - -SetForceContainsSignificantPriceChange sets ForceContainsSignificantPriceChange field to given value. - -### HasForceContainsSignificantPriceChange - -`func (o *PricePerDatasetItemActorPricingInfo) HasForceContainsSignificantPriceChange() bool` - -HasForceContainsSignificantPriceChange returns a boolean if a field has been set. - -### GetPricingModel - -`func (o *PricePerDatasetItemActorPricingInfo) GetPricingModel() string` - -GetPricingModel returns the PricingModel field if non-nil, zero value otherwise. - -### GetPricingModelOk - -`func (o *PricePerDatasetItemActorPricingInfo) GetPricingModelOk() (*string, bool)` - -GetPricingModelOk returns a tuple with the PricingModel field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetPricingModel - -`func (o *PricePerDatasetItemActorPricingInfo) SetPricingModel(v string)` - -SetPricingModel sets PricingModel field to given value. - - -### GetUnitName - -`func (o *PricePerDatasetItemActorPricingInfo) GetUnitName() string` - -GetUnitName returns the UnitName field if non-nil, zero value otherwise. - -### GetUnitNameOk - -`func (o *PricePerDatasetItemActorPricingInfo) GetUnitNameOk() (*string, bool)` - -GetUnitNameOk returns a tuple with the UnitName field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetUnitName - -`func (o *PricePerDatasetItemActorPricingInfo) SetUnitName(v string)` - -SetUnitName sets UnitName field to given value. - - -### GetPricePerUnitUsd - -`func (o *PricePerDatasetItemActorPricingInfo) GetPricePerUnitUsd() float32` - -GetPricePerUnitUsd returns the PricePerUnitUsd field if non-nil, zero value otherwise. - -### GetPricePerUnitUsdOk - -`func (o *PricePerDatasetItemActorPricingInfo) GetPricePerUnitUsdOk() (*float32, bool)` - -GetPricePerUnitUsdOk returns a tuple with the PricePerUnitUsd field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetPricePerUnitUsd - -`func (o *PricePerDatasetItemActorPricingInfo) SetPricePerUnitUsd(v float32)` - -SetPricePerUnitUsd sets PricePerUnitUsd field to given value. - -### HasPricePerUnitUsd - -`func (o *PricePerDatasetItemActorPricingInfo) HasPricePerUnitUsd() bool` - -HasPricePerUnitUsd returns a boolean if a field has been set. - -### GetTieredPricing - -`func (o *PricePerDatasetItemActorPricingInfo) GetTieredPricing() map[string]TieredPricingPerDatasetItemEntry` - -GetTieredPricing returns the TieredPricing field if non-nil, zero value otherwise. - -### GetTieredPricingOk - -`func (o *PricePerDatasetItemActorPricingInfo) GetTieredPricingOk() (*map[string]TieredPricingPerDatasetItemEntry, bool)` - -GetTieredPricingOk returns a tuple with the TieredPricing field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetTieredPricing - -`func (o *PricePerDatasetItemActorPricingInfo) SetTieredPricing(v map[string]TieredPricingPerDatasetItemEntry)` - -SetTieredPricing sets TieredPricing field to given value. - -### HasTieredPricing - -`func (o *PricePerDatasetItemActorPricingInfo) HasTieredPricing() bool` - -HasTieredPricing returns a boolean if a field has been set. - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/PriceTiers.md b/docs/PriceTiers.md deleted file mode 100644 index 2cf87f0..0000000 --- a/docs/PriceTiers.md +++ /dev/null @@ -1,135 +0,0 @@ -# PriceTiers - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**QuantityAbove** | **float32** | | -**DiscountPercent** | **float32** | | -**TierQuantity** | **float32** | | -**UnitPriceUsd** | **float32** | | -**PriceUsd** | **float32** | | - -## Methods - -### NewPriceTiers - -`func NewPriceTiers(quantityAbove float32, discountPercent float32, tierQuantity float32, unitPriceUsd float32, priceUsd float32, ) *PriceTiers` - -NewPriceTiers instantiates a new PriceTiers object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewPriceTiersWithDefaults - -`func NewPriceTiersWithDefaults() *PriceTiers` - -NewPriceTiersWithDefaults instantiates a new PriceTiers object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetQuantityAbove - -`func (o *PriceTiers) GetQuantityAbove() float32` - -GetQuantityAbove returns the QuantityAbove field if non-nil, zero value otherwise. - -### GetQuantityAboveOk - -`func (o *PriceTiers) GetQuantityAboveOk() (*float32, bool)` - -GetQuantityAboveOk returns a tuple with the QuantityAbove field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetQuantityAbove - -`func (o *PriceTiers) SetQuantityAbove(v float32)` - -SetQuantityAbove sets QuantityAbove field to given value. - - -### GetDiscountPercent - -`func (o *PriceTiers) GetDiscountPercent() float32` - -GetDiscountPercent returns the DiscountPercent field if non-nil, zero value otherwise. - -### GetDiscountPercentOk - -`func (o *PriceTiers) GetDiscountPercentOk() (*float32, bool)` - -GetDiscountPercentOk returns a tuple with the DiscountPercent field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetDiscountPercent - -`func (o *PriceTiers) SetDiscountPercent(v float32)` - -SetDiscountPercent sets DiscountPercent field to given value. - - -### GetTierQuantity - -`func (o *PriceTiers) GetTierQuantity() float32` - -GetTierQuantity returns the TierQuantity field if non-nil, zero value otherwise. - -### GetTierQuantityOk - -`func (o *PriceTiers) GetTierQuantityOk() (*float32, bool)` - -GetTierQuantityOk returns a tuple with the TierQuantity field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetTierQuantity - -`func (o *PriceTiers) SetTierQuantity(v float32)` - -SetTierQuantity sets TierQuantity field to given value. - - -### GetUnitPriceUsd - -`func (o *PriceTiers) GetUnitPriceUsd() float32` - -GetUnitPriceUsd returns the UnitPriceUsd field if non-nil, zero value otherwise. - -### GetUnitPriceUsdOk - -`func (o *PriceTiers) GetUnitPriceUsdOk() (*float32, bool)` - -GetUnitPriceUsdOk returns a tuple with the UnitPriceUsd field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetUnitPriceUsd - -`func (o *PriceTiers) SetUnitPriceUsd(v float32)` - -SetUnitPriceUsd sets UnitPriceUsd field to given value. - - -### GetPriceUsd - -`func (o *PriceTiers) GetPriceUsd() float32` - -GetPriceUsd returns the PriceUsd field if non-nil, zero value otherwise. - -### GetPriceUsdOk - -`func (o *PriceTiers) GetPriceUsdOk() (*float32, bool)` - -GetPriceUsdOk returns a tuple with the PriceUsd field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetPriceUsd - -`func (o *PriceTiers) SetPriceUsd(v float32)` - -SetPriceUsd sets PriceUsd field to given value. - - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/PrivateUserDataResponse.md b/docs/PrivateUserDataResponse.md deleted file mode 100644 index 2fd55b4..0000000 --- a/docs/PrivateUserDataResponse.md +++ /dev/null @@ -1,51 +0,0 @@ -# PrivateUserDataResponse - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Data** | [**UserPrivateInfo**](UserPrivateInfo.md) | | - -## Methods - -### NewPrivateUserDataResponse - -`func NewPrivateUserDataResponse(data UserPrivateInfo, ) *PrivateUserDataResponse` - -NewPrivateUserDataResponse instantiates a new PrivateUserDataResponse object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewPrivateUserDataResponseWithDefaults - -`func NewPrivateUserDataResponseWithDefaults() *PrivateUserDataResponse` - -NewPrivateUserDataResponseWithDefaults instantiates a new PrivateUserDataResponse object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetData - -`func (o *PrivateUserDataResponse) GetData() UserPrivateInfo` - -GetData returns the Data field if non-nil, zero value otherwise. - -### GetDataOk - -`func (o *PrivateUserDataResponse) GetDataOk() (*UserPrivateInfo, bool)` - -GetDataOk returns a tuple with the Data field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetData - -`func (o *PrivateUserDataResponse) SetData(v UserPrivateInfo)` - -SetData sets Data field to given value. - - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/Profile.md b/docs/Profile.md deleted file mode 100644 index 8d627a4..0000000 --- a/docs/Profile.md +++ /dev/null @@ -1,186 +0,0 @@ -# Profile - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Bio** | Pointer to **string** | | [optional] -**Name** | Pointer to **string** | | [optional] -**PictureUrl** | Pointer to **string** | | [optional] -**GithubUsername** | Pointer to **string** | | [optional] -**WebsiteUrl** | Pointer to **string** | | [optional] -**TwitterUsername** | Pointer to **string** | | [optional] - -## Methods - -### NewProfile - -`func NewProfile() *Profile` - -NewProfile instantiates a new Profile object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewProfileWithDefaults - -`func NewProfileWithDefaults() *Profile` - -NewProfileWithDefaults instantiates a new Profile object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetBio - -`func (o *Profile) GetBio() string` - -GetBio returns the Bio field if non-nil, zero value otherwise. - -### GetBioOk - -`func (o *Profile) GetBioOk() (*string, bool)` - -GetBioOk returns a tuple with the Bio field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetBio - -`func (o *Profile) SetBio(v string)` - -SetBio sets Bio field to given value. - -### HasBio - -`func (o *Profile) HasBio() bool` - -HasBio returns a boolean if a field has been set. - -### GetName - -`func (o *Profile) GetName() string` - -GetName returns the Name field if non-nil, zero value otherwise. - -### GetNameOk - -`func (o *Profile) GetNameOk() (*string, bool)` - -GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetName - -`func (o *Profile) SetName(v string)` - -SetName sets Name field to given value. - -### HasName - -`func (o *Profile) HasName() bool` - -HasName returns a boolean if a field has been set. - -### GetPictureUrl - -`func (o *Profile) GetPictureUrl() string` - -GetPictureUrl returns the PictureUrl field if non-nil, zero value otherwise. - -### GetPictureUrlOk - -`func (o *Profile) GetPictureUrlOk() (*string, bool)` - -GetPictureUrlOk returns a tuple with the PictureUrl field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetPictureUrl - -`func (o *Profile) SetPictureUrl(v string)` - -SetPictureUrl sets PictureUrl field to given value. - -### HasPictureUrl - -`func (o *Profile) HasPictureUrl() bool` - -HasPictureUrl returns a boolean if a field has been set. - -### GetGithubUsername - -`func (o *Profile) GetGithubUsername() string` - -GetGithubUsername returns the GithubUsername field if non-nil, zero value otherwise. - -### GetGithubUsernameOk - -`func (o *Profile) GetGithubUsernameOk() (*string, bool)` - -GetGithubUsernameOk returns a tuple with the GithubUsername field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetGithubUsername - -`func (o *Profile) SetGithubUsername(v string)` - -SetGithubUsername sets GithubUsername field to given value. - -### HasGithubUsername - -`func (o *Profile) HasGithubUsername() bool` - -HasGithubUsername returns a boolean if a field has been set. - -### GetWebsiteUrl - -`func (o *Profile) GetWebsiteUrl() string` - -GetWebsiteUrl returns the WebsiteUrl field if non-nil, zero value otherwise. - -### GetWebsiteUrlOk - -`func (o *Profile) GetWebsiteUrlOk() (*string, bool)` - -GetWebsiteUrlOk returns a tuple with the WebsiteUrl field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetWebsiteUrl - -`func (o *Profile) SetWebsiteUrl(v string)` - -SetWebsiteUrl sets WebsiteUrl field to given value. - -### HasWebsiteUrl - -`func (o *Profile) HasWebsiteUrl() bool` - -HasWebsiteUrl returns a boolean if a field has been set. - -### GetTwitterUsername - -`func (o *Profile) GetTwitterUsername() string` - -GetTwitterUsername returns the TwitterUsername field if non-nil, zero value otherwise. - -### GetTwitterUsernameOk - -`func (o *Profile) GetTwitterUsernameOk() (*string, bool)` - -GetTwitterUsernameOk returns a tuple with the TwitterUsername field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetTwitterUsername - -`func (o *Profile) SetTwitterUsername(v string)` - -SetTwitterUsername sets TwitterUsername field to given value. - -### HasTwitterUsername - -`func (o *Profile) HasTwitterUsername() bool` - -HasTwitterUsername returns a boolean if a field has been set. - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/ProlongRequestLockResponse.md b/docs/ProlongRequestLockResponse.md deleted file mode 100644 index 8874909..0000000 --- a/docs/ProlongRequestLockResponse.md +++ /dev/null @@ -1,51 +0,0 @@ -# ProlongRequestLockResponse - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Data** | [**RequestLockInfo**](RequestLockInfo.md) | | - -## Methods - -### NewProlongRequestLockResponse - -`func NewProlongRequestLockResponse(data RequestLockInfo, ) *ProlongRequestLockResponse` - -NewProlongRequestLockResponse instantiates a new ProlongRequestLockResponse object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewProlongRequestLockResponseWithDefaults - -`func NewProlongRequestLockResponseWithDefaults() *ProlongRequestLockResponse` - -NewProlongRequestLockResponseWithDefaults instantiates a new ProlongRequestLockResponse object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetData - -`func (o *ProlongRequestLockResponse) GetData() RequestLockInfo` - -GetData returns the Data field if non-nil, zero value otherwise. - -### GetDataOk - -`func (o *ProlongRequestLockResponse) GetDataOk() (*RequestLockInfo, bool)` - -GetDataOk returns a tuple with the Data field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetData - -`func (o *ProlongRequestLockResponse) SetData(v RequestLockInfo)` - -SetData sets Data field to given value. - - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/Proxy.md b/docs/Proxy.md deleted file mode 100644 index b967056..0000000 --- a/docs/Proxy.md +++ /dev/null @@ -1,72 +0,0 @@ -# Proxy - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Password** | **string** | | -**Groups** | [**[]ProxyGroup**](ProxyGroup.md) | | - -## Methods - -### NewProxy - -`func NewProxy(password string, groups []ProxyGroup, ) *Proxy` - -NewProxy instantiates a new Proxy object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewProxyWithDefaults - -`func NewProxyWithDefaults() *Proxy` - -NewProxyWithDefaults instantiates a new Proxy object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetPassword - -`func (o *Proxy) GetPassword() string` - -GetPassword returns the Password field if non-nil, zero value otherwise. - -### GetPasswordOk - -`func (o *Proxy) GetPasswordOk() (*string, bool)` - -GetPasswordOk returns a tuple with the Password field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetPassword - -`func (o *Proxy) SetPassword(v string)` - -SetPassword sets Password field to given value. - - -### GetGroups - -`func (o *Proxy) GetGroups() []ProxyGroup` - -GetGroups returns the Groups field if non-nil, zero value otherwise. - -### GetGroupsOk - -`func (o *Proxy) GetGroupsOk() (*[]ProxyGroup, bool)` - -GetGroupsOk returns a tuple with the Groups field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetGroups - -`func (o *Proxy) SetGroups(v []ProxyGroup)` - -SetGroups sets Groups field to given value. - - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/ProxyGroup.md b/docs/ProxyGroup.md deleted file mode 100644 index a7a944d..0000000 --- a/docs/ProxyGroup.md +++ /dev/null @@ -1,103 +0,0 @@ -# ProxyGroup - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Name** | **string** | | -**Description** | **NullableString** | | -**AvailableCount** | **int32** | | - -## Methods - -### NewProxyGroup - -`func NewProxyGroup(name string, description NullableString, availableCount int32, ) *ProxyGroup` - -NewProxyGroup instantiates a new ProxyGroup object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewProxyGroupWithDefaults - -`func NewProxyGroupWithDefaults() *ProxyGroup` - -NewProxyGroupWithDefaults instantiates a new ProxyGroup object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetName - -`func (o *ProxyGroup) GetName() string` - -GetName returns the Name field if non-nil, zero value otherwise. - -### GetNameOk - -`func (o *ProxyGroup) GetNameOk() (*string, bool)` - -GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetName - -`func (o *ProxyGroup) SetName(v string)` - -SetName sets Name field to given value. - - -### GetDescription - -`func (o *ProxyGroup) GetDescription() string` - -GetDescription returns the Description field if non-nil, zero value otherwise. - -### GetDescriptionOk - -`func (o *ProxyGroup) GetDescriptionOk() (*string, bool)` - -GetDescriptionOk returns a tuple with the Description field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetDescription - -`func (o *ProxyGroup) SetDescription(v string)` - -SetDescription sets Description field to given value. - - -### SetDescriptionNil - -`func (o *ProxyGroup) SetDescriptionNil(b bool)` - - SetDescriptionNil sets the value for Description to be an explicit nil - -### UnsetDescription -`func (o *ProxyGroup) UnsetDescription()` - -UnsetDescription ensures that no value is present for Description, not even an explicit nil -### GetAvailableCount - -`func (o *ProxyGroup) GetAvailableCount() int32` - -GetAvailableCount returns the AvailableCount field if non-nil, zero value otherwise. - -### GetAvailableCountOk - -`func (o *ProxyGroup) GetAvailableCountOk() (*int32, bool)` - -GetAvailableCountOk returns a tuple with the AvailableCount field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetAvailableCount - -`func (o *ProxyGroup) SetAvailableCount(v int32)` - -SetAvailableCount sets AvailableCount field to given value. - - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/PublicUserDataResponse.md b/docs/PublicUserDataResponse.md deleted file mode 100644 index 638cf84..0000000 --- a/docs/PublicUserDataResponse.md +++ /dev/null @@ -1,51 +0,0 @@ -# PublicUserDataResponse - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Data** | [**UserPublicInfo**](UserPublicInfo.md) | | - -## Methods - -### NewPublicUserDataResponse - -`func NewPublicUserDataResponse(data UserPublicInfo, ) *PublicUserDataResponse` - -NewPublicUserDataResponse instantiates a new PublicUserDataResponse object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewPublicUserDataResponseWithDefaults - -`func NewPublicUserDataResponseWithDefaults() *PublicUserDataResponse` - -NewPublicUserDataResponseWithDefaults instantiates a new PublicUserDataResponse object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetData - -`func (o *PublicUserDataResponse) GetData() UserPublicInfo` - -GetData returns the Data field if non-nil, zero value otherwise. - -### GetDataOk - -`func (o *PublicUserDataResponse) GetDataOk() (*UserPublicInfo, bool)` - -GetDataOk returns a tuple with the Data field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetData - -`func (o *PublicUserDataResponse) SetData(v UserPublicInfo)` - -SetData sets Data field to given value. - - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/PutItemResponseError.md b/docs/PutItemResponseError.md deleted file mode 100644 index 63c0f27..0000000 --- a/docs/PutItemResponseError.md +++ /dev/null @@ -1,51 +0,0 @@ -# PutItemResponseError - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Error** | [**DatasetSchemaValidationError**](DatasetSchemaValidationError.md) | | - -## Methods - -### NewPutItemResponseError - -`func NewPutItemResponseError(error_ DatasetSchemaValidationError, ) *PutItemResponseError` - -NewPutItemResponseError instantiates a new PutItemResponseError object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewPutItemResponseErrorWithDefaults - -`func NewPutItemResponseErrorWithDefaults() *PutItemResponseError` - -NewPutItemResponseErrorWithDefaults instantiates a new PutItemResponseError object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetError - -`func (o *PutItemResponseError) GetError() DatasetSchemaValidationError` - -GetError returns the Error field if non-nil, zero value otherwise. - -### GetErrorOk - -`func (o *PutItemResponseError) GetErrorOk() (*DatasetSchemaValidationError, bool)` - -GetErrorOk returns a tuple with the Error field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetError - -`func (o *PutItemResponseError) SetError(v DatasetSchemaValidationError)` - -SetError sets Error field to given value. - - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/README.md b/docs/README.md new file mode 100644 index 0000000..e083b05 --- /dev/null +++ b/docs/README.md @@ -0,0 +1,32 @@ +# Apify Go client documentation + +This directory documents the public API of the Apify Go client, organized by resource. Each +page lists the available methods with their parameters and short, runnable snippets. For an +overview, configuration, error handling, and the full resource table, see the +[top-level README](../README.md). + +All snippets assume a configured client and a context: + +```go +client := apify.NewClient("my-api-token") +ctx := context.Background() +``` + +Methods that fetch a single resource return a `(value, ok, error)` triple: a missing +resource is reported by `ok == false` rather than an error. API failures are returned as +`*apify.APIError` (see [error handling](../README.md#error-handling)). + +## Pages + +- [Actors](actors.md) — Actors, versions, environment variables. +- [Builds](builds.md) — Actor builds. +- [Runs](runs.md) — Actor runs and their default storages. +- [Tasks](tasks.md) — Actor tasks. +- [Storages](storages.md) — Datasets, key-value stores, request queues. +- [Schedules](schedules.md) — Schedules. +- [Webhooks](webhooks.md) — Webhooks and webhook dispatches. +- [Misc](misc.md) — Apify Store, users, logs. + +## Examples + +Full runnable programs are in [`../examples`](../examples) and are tested in CI. diff --git a/docs/Request.md b/docs/Request.md deleted file mode 100644 index 80f6016..0000000 --- a/docs/Request.md +++ /dev/null @@ -1,352 +0,0 @@ -# Request - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**UniqueKey** | Pointer to **string** | A unique key used for request de-duplication. Requests with the same unique key are considered identical. | [optional] -**Url** | Pointer to **string** | The URL of the request. | [optional] -**Method** | Pointer to [**HttpMethod**](HttpMethod.md) | | [optional] -**RetryCount** | Pointer to **int32** | The number of times this request has been retried. | [optional] -**LoadedUrl** | Pointer to **string** | The final URL that was loaded, after redirects (if any). | [optional] -**Payload** | Pointer to [**NullableRequestBasePayload**](RequestBasePayload.md) | | [optional] -**Headers** | Pointer to **map[string]interface{}** | HTTP headers sent with the request. | [optional] -**UserData** | Pointer to **map[string]interface{}** | Custom user data attached to the request. Can contain arbitrary fields. | [optional] -**NoRetry** | Pointer to **bool** | Indicates whether the request should not be retried if processing fails. | [optional] -**ErrorMessages** | Pointer to **[]string** | Error messages recorded from failed processing attempts. | [optional] -**HandledAt** | Pointer to **time.Time** | The timestamp when the request was marked as handled, if applicable. | [optional] -**Id** | Pointer to **string** | A unique identifier assigned to the request. | [optional] - -## Methods - -### NewRequest - -`func NewRequest() *Request` - -NewRequest instantiates a new Request object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewRequestWithDefaults - -`func NewRequestWithDefaults() *Request` - -NewRequestWithDefaults instantiates a new Request object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetUniqueKey - -`func (o *Request) GetUniqueKey() string` - -GetUniqueKey returns the UniqueKey field if non-nil, zero value otherwise. - -### GetUniqueKeyOk - -`func (o *Request) GetUniqueKeyOk() (*string, bool)` - -GetUniqueKeyOk returns a tuple with the UniqueKey field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetUniqueKey - -`func (o *Request) SetUniqueKey(v string)` - -SetUniqueKey sets UniqueKey field to given value. - -### HasUniqueKey - -`func (o *Request) HasUniqueKey() bool` - -HasUniqueKey returns a boolean if a field has been set. - -### GetUrl - -`func (o *Request) GetUrl() string` - -GetUrl returns the Url field if non-nil, zero value otherwise. - -### GetUrlOk - -`func (o *Request) GetUrlOk() (*string, bool)` - -GetUrlOk returns a tuple with the Url field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetUrl - -`func (o *Request) SetUrl(v string)` - -SetUrl sets Url field to given value. - -### HasUrl - -`func (o *Request) HasUrl() bool` - -HasUrl returns a boolean if a field has been set. - -### GetMethod - -`func (o *Request) GetMethod() HttpMethod` - -GetMethod returns the Method field if non-nil, zero value otherwise. - -### GetMethodOk - -`func (o *Request) GetMethodOk() (*HttpMethod, bool)` - -GetMethodOk returns a tuple with the Method field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetMethod - -`func (o *Request) SetMethod(v HttpMethod)` - -SetMethod sets Method field to given value. - -### HasMethod - -`func (o *Request) HasMethod() bool` - -HasMethod returns a boolean if a field has been set. - -### GetRetryCount - -`func (o *Request) GetRetryCount() int32` - -GetRetryCount returns the RetryCount field if non-nil, zero value otherwise. - -### GetRetryCountOk - -`func (o *Request) GetRetryCountOk() (*int32, bool)` - -GetRetryCountOk returns a tuple with the RetryCount field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetRetryCount - -`func (o *Request) SetRetryCount(v int32)` - -SetRetryCount sets RetryCount field to given value. - -### HasRetryCount - -`func (o *Request) HasRetryCount() bool` - -HasRetryCount returns a boolean if a field has been set. - -### GetLoadedUrl - -`func (o *Request) GetLoadedUrl() string` - -GetLoadedUrl returns the LoadedUrl field if non-nil, zero value otherwise. - -### GetLoadedUrlOk - -`func (o *Request) GetLoadedUrlOk() (*string, bool)` - -GetLoadedUrlOk returns a tuple with the LoadedUrl field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetLoadedUrl - -`func (o *Request) SetLoadedUrl(v string)` - -SetLoadedUrl sets LoadedUrl field to given value. - -### HasLoadedUrl - -`func (o *Request) HasLoadedUrl() bool` - -HasLoadedUrl returns a boolean if a field has been set. - -### GetPayload - -`func (o *Request) GetPayload() RequestBasePayload` - -GetPayload returns the Payload field if non-nil, zero value otherwise. - -### GetPayloadOk - -`func (o *Request) GetPayloadOk() (*RequestBasePayload, bool)` - -GetPayloadOk returns a tuple with the Payload field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetPayload - -`func (o *Request) SetPayload(v RequestBasePayload)` - -SetPayload sets Payload field to given value. - -### HasPayload - -`func (o *Request) HasPayload() bool` - -HasPayload returns a boolean if a field has been set. - -### SetPayloadNil - -`func (o *Request) SetPayloadNil(b bool)` - - SetPayloadNil sets the value for Payload to be an explicit nil - -### UnsetPayload -`func (o *Request) UnsetPayload()` - -UnsetPayload ensures that no value is present for Payload, not even an explicit nil -### GetHeaders - -`func (o *Request) GetHeaders() map[string]interface{}` - -GetHeaders returns the Headers field if non-nil, zero value otherwise. - -### GetHeadersOk - -`func (o *Request) GetHeadersOk() (*map[string]interface{}, bool)` - -GetHeadersOk returns a tuple with the Headers field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetHeaders - -`func (o *Request) SetHeaders(v map[string]interface{})` - -SetHeaders sets Headers field to given value. - -### HasHeaders - -`func (o *Request) HasHeaders() bool` - -HasHeaders returns a boolean if a field has been set. - -### GetUserData - -`func (o *Request) GetUserData() map[string]interface{}` - -GetUserData returns the UserData field if non-nil, zero value otherwise. - -### GetUserDataOk - -`func (o *Request) GetUserDataOk() (*map[string]interface{}, bool)` - -GetUserDataOk returns a tuple with the UserData field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetUserData - -`func (o *Request) SetUserData(v map[string]interface{})` - -SetUserData sets UserData field to given value. - -### HasUserData - -`func (o *Request) HasUserData() bool` - -HasUserData returns a boolean if a field has been set. - -### GetNoRetry - -`func (o *Request) GetNoRetry() bool` - -GetNoRetry returns the NoRetry field if non-nil, zero value otherwise. - -### GetNoRetryOk - -`func (o *Request) GetNoRetryOk() (*bool, bool)` - -GetNoRetryOk returns a tuple with the NoRetry field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetNoRetry - -`func (o *Request) SetNoRetry(v bool)` - -SetNoRetry sets NoRetry field to given value. - -### HasNoRetry - -`func (o *Request) HasNoRetry() bool` - -HasNoRetry returns a boolean if a field has been set. - -### GetErrorMessages - -`func (o *Request) GetErrorMessages() []string` - -GetErrorMessages returns the ErrorMessages field if non-nil, zero value otherwise. - -### GetErrorMessagesOk - -`func (o *Request) GetErrorMessagesOk() (*[]string, bool)` - -GetErrorMessagesOk returns a tuple with the ErrorMessages field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetErrorMessages - -`func (o *Request) SetErrorMessages(v []string)` - -SetErrorMessages sets ErrorMessages field to given value. - -### HasErrorMessages - -`func (o *Request) HasErrorMessages() bool` - -HasErrorMessages returns a boolean if a field has been set. - -### GetHandledAt - -`func (o *Request) GetHandledAt() time.Time` - -GetHandledAt returns the HandledAt field if non-nil, zero value otherwise. - -### GetHandledAtOk - -`func (o *Request) GetHandledAtOk() (*time.Time, bool)` - -GetHandledAtOk returns a tuple with the HandledAt field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetHandledAt - -`func (o *Request) SetHandledAt(v time.Time)` - -SetHandledAt sets HandledAt field to given value. - -### HasHandledAt - -`func (o *Request) HasHandledAt() bool` - -HasHandledAt returns a boolean if a field has been set. - -### GetId - -`func (o *Request) GetId() string` - -GetId returns the Id field if non-nil, zero value otherwise. - -### GetIdOk - -`func (o *Request) GetIdOk() (*string, bool)` - -GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetId - -`func (o *Request) SetId(v string)` - -SetId sets Id field to given value. - -### HasId - -`func (o *Request) HasId() bool` - -HasId returns a boolean if a field has been set. - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/RequestBase.md b/docs/RequestBase.md deleted file mode 100644 index e369928..0000000 --- a/docs/RequestBase.md +++ /dev/null @@ -1,376 +0,0 @@ -# RequestBase - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**UniqueKey** | Pointer to **string** | A unique key used for request de-duplication. Requests with the same unique key are considered identical. | [optional] -**Url** | Pointer to **string** | The URL of the request. | [optional] -**Method** | Pointer to [**HttpMethod**](HttpMethod.md) | | [optional] -**RetryCount** | Pointer to **int32** | The number of times this request has been retried. | [optional] -**LoadedUrl** | Pointer to **NullableString** | The final URL that was loaded, after redirects (if any). | [optional] -**Payload** | Pointer to [**NullableRequestBasePayload**](RequestBasePayload.md) | | [optional] -**Headers** | Pointer to **map[string]interface{}** | HTTP headers sent with the request. | [optional] -**UserData** | Pointer to **map[string]interface{}** | Custom user data attached to the request. Can contain arbitrary fields. | [optional] -**NoRetry** | Pointer to **NullableBool** | Indicates whether the request should not be retried if processing fails. | [optional] -**ErrorMessages** | Pointer to **[]string** | Error messages recorded from failed processing attempts. | [optional] -**HandledAt** | Pointer to **NullableTime** | The timestamp when the request was marked as handled, if applicable. | [optional] - -## Methods - -### NewRequestBase - -`func NewRequestBase() *RequestBase` - -NewRequestBase instantiates a new RequestBase object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewRequestBaseWithDefaults - -`func NewRequestBaseWithDefaults() *RequestBase` - -NewRequestBaseWithDefaults instantiates a new RequestBase object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetUniqueKey - -`func (o *RequestBase) GetUniqueKey() string` - -GetUniqueKey returns the UniqueKey field if non-nil, zero value otherwise. - -### GetUniqueKeyOk - -`func (o *RequestBase) GetUniqueKeyOk() (*string, bool)` - -GetUniqueKeyOk returns a tuple with the UniqueKey field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetUniqueKey - -`func (o *RequestBase) SetUniqueKey(v string)` - -SetUniqueKey sets UniqueKey field to given value. - -### HasUniqueKey - -`func (o *RequestBase) HasUniqueKey() bool` - -HasUniqueKey returns a boolean if a field has been set. - -### GetUrl - -`func (o *RequestBase) GetUrl() string` - -GetUrl returns the Url field if non-nil, zero value otherwise. - -### GetUrlOk - -`func (o *RequestBase) GetUrlOk() (*string, bool)` - -GetUrlOk returns a tuple with the Url field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetUrl - -`func (o *RequestBase) SetUrl(v string)` - -SetUrl sets Url field to given value. - -### HasUrl - -`func (o *RequestBase) HasUrl() bool` - -HasUrl returns a boolean if a field has been set. - -### GetMethod - -`func (o *RequestBase) GetMethod() HttpMethod` - -GetMethod returns the Method field if non-nil, zero value otherwise. - -### GetMethodOk - -`func (o *RequestBase) GetMethodOk() (*HttpMethod, bool)` - -GetMethodOk returns a tuple with the Method field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetMethod - -`func (o *RequestBase) SetMethod(v HttpMethod)` - -SetMethod sets Method field to given value. - -### HasMethod - -`func (o *RequestBase) HasMethod() bool` - -HasMethod returns a boolean if a field has been set. - -### GetRetryCount - -`func (o *RequestBase) GetRetryCount() int32` - -GetRetryCount returns the RetryCount field if non-nil, zero value otherwise. - -### GetRetryCountOk - -`func (o *RequestBase) GetRetryCountOk() (*int32, bool)` - -GetRetryCountOk returns a tuple with the RetryCount field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetRetryCount - -`func (o *RequestBase) SetRetryCount(v int32)` - -SetRetryCount sets RetryCount field to given value. - -### HasRetryCount - -`func (o *RequestBase) HasRetryCount() bool` - -HasRetryCount returns a boolean if a field has been set. - -### GetLoadedUrl - -`func (o *RequestBase) GetLoadedUrl() string` - -GetLoadedUrl returns the LoadedUrl field if non-nil, zero value otherwise. - -### GetLoadedUrlOk - -`func (o *RequestBase) GetLoadedUrlOk() (*string, bool)` - -GetLoadedUrlOk returns a tuple with the LoadedUrl field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetLoadedUrl - -`func (o *RequestBase) SetLoadedUrl(v string)` - -SetLoadedUrl sets LoadedUrl field to given value. - -### HasLoadedUrl - -`func (o *RequestBase) HasLoadedUrl() bool` - -HasLoadedUrl returns a boolean if a field has been set. - -### SetLoadedUrlNil - -`func (o *RequestBase) SetLoadedUrlNil(b bool)` - - SetLoadedUrlNil sets the value for LoadedUrl to be an explicit nil - -### UnsetLoadedUrl -`func (o *RequestBase) UnsetLoadedUrl()` - -UnsetLoadedUrl ensures that no value is present for LoadedUrl, not even an explicit nil -### GetPayload - -`func (o *RequestBase) GetPayload() RequestBasePayload` - -GetPayload returns the Payload field if non-nil, zero value otherwise. - -### GetPayloadOk - -`func (o *RequestBase) GetPayloadOk() (*RequestBasePayload, bool)` - -GetPayloadOk returns a tuple with the Payload field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetPayload - -`func (o *RequestBase) SetPayload(v RequestBasePayload)` - -SetPayload sets Payload field to given value. - -### HasPayload - -`func (o *RequestBase) HasPayload() bool` - -HasPayload returns a boolean if a field has been set. - -### SetPayloadNil - -`func (o *RequestBase) SetPayloadNil(b bool)` - - SetPayloadNil sets the value for Payload to be an explicit nil - -### UnsetPayload -`func (o *RequestBase) UnsetPayload()` - -UnsetPayload ensures that no value is present for Payload, not even an explicit nil -### GetHeaders - -`func (o *RequestBase) GetHeaders() map[string]interface{}` - -GetHeaders returns the Headers field if non-nil, zero value otherwise. - -### GetHeadersOk - -`func (o *RequestBase) GetHeadersOk() (*map[string]interface{}, bool)` - -GetHeadersOk returns a tuple with the Headers field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetHeaders - -`func (o *RequestBase) SetHeaders(v map[string]interface{})` - -SetHeaders sets Headers field to given value. - -### HasHeaders - -`func (o *RequestBase) HasHeaders() bool` - -HasHeaders returns a boolean if a field has been set. - -### SetHeadersNil - -`func (o *RequestBase) SetHeadersNil(b bool)` - - SetHeadersNil sets the value for Headers to be an explicit nil - -### UnsetHeaders -`func (o *RequestBase) UnsetHeaders()` - -UnsetHeaders ensures that no value is present for Headers, not even an explicit nil -### GetUserData - -`func (o *RequestBase) GetUserData() map[string]interface{}` - -GetUserData returns the UserData field if non-nil, zero value otherwise. - -### GetUserDataOk - -`func (o *RequestBase) GetUserDataOk() (*map[string]interface{}, bool)` - -GetUserDataOk returns a tuple with the UserData field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetUserData - -`func (o *RequestBase) SetUserData(v map[string]interface{})` - -SetUserData sets UserData field to given value. - -### HasUserData - -`func (o *RequestBase) HasUserData() bool` - -HasUserData returns a boolean if a field has been set. - -### GetNoRetry - -`func (o *RequestBase) GetNoRetry() bool` - -GetNoRetry returns the NoRetry field if non-nil, zero value otherwise. - -### GetNoRetryOk - -`func (o *RequestBase) GetNoRetryOk() (*bool, bool)` - -GetNoRetryOk returns a tuple with the NoRetry field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetNoRetry - -`func (o *RequestBase) SetNoRetry(v bool)` - -SetNoRetry sets NoRetry field to given value. - -### HasNoRetry - -`func (o *RequestBase) HasNoRetry() bool` - -HasNoRetry returns a boolean if a field has been set. - -### SetNoRetryNil - -`func (o *RequestBase) SetNoRetryNil(b bool)` - - SetNoRetryNil sets the value for NoRetry to be an explicit nil - -### UnsetNoRetry -`func (o *RequestBase) UnsetNoRetry()` - -UnsetNoRetry ensures that no value is present for NoRetry, not even an explicit nil -### GetErrorMessages - -`func (o *RequestBase) GetErrorMessages() []string` - -GetErrorMessages returns the ErrorMessages field if non-nil, zero value otherwise. - -### GetErrorMessagesOk - -`func (o *RequestBase) GetErrorMessagesOk() (*[]string, bool)` - -GetErrorMessagesOk returns a tuple with the ErrorMessages field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetErrorMessages - -`func (o *RequestBase) SetErrorMessages(v []string)` - -SetErrorMessages sets ErrorMessages field to given value. - -### HasErrorMessages - -`func (o *RequestBase) HasErrorMessages() bool` - -HasErrorMessages returns a boolean if a field has been set. - -### SetErrorMessagesNil - -`func (o *RequestBase) SetErrorMessagesNil(b bool)` - - SetErrorMessagesNil sets the value for ErrorMessages to be an explicit nil - -### UnsetErrorMessages -`func (o *RequestBase) UnsetErrorMessages()` - -UnsetErrorMessages ensures that no value is present for ErrorMessages, not even an explicit nil -### GetHandledAt - -`func (o *RequestBase) GetHandledAt() time.Time` - -GetHandledAt returns the HandledAt field if non-nil, zero value otherwise. - -### GetHandledAtOk - -`func (o *RequestBase) GetHandledAtOk() (*time.Time, bool)` - -GetHandledAtOk returns a tuple with the HandledAt field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetHandledAt - -`func (o *RequestBase) SetHandledAt(v time.Time)` - -SetHandledAt sets HandledAt field to given value. - -### HasHandledAt - -`func (o *RequestBase) HasHandledAt() bool` - -HasHandledAt returns a boolean if a field has been set. - -### SetHandledAtNil - -`func (o *RequestBase) SetHandledAtNil(b bool)` - - SetHandledAtNil sets the value for HandledAt to be an explicit nil - -### UnsetHandledAt -`func (o *RequestBase) UnsetHandledAt()` - -UnsetHandledAt ensures that no value is present for HandledAt, not even an explicit nil - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/RequestBasePayload.md b/docs/RequestBasePayload.md deleted file mode 100644 index fec2848..0000000 --- a/docs/RequestBasePayload.md +++ /dev/null @@ -1,30 +0,0 @@ -# RequestBasePayload - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - -## Methods - -### NewRequestBasePayload - -`func NewRequestBasePayload() *RequestBasePayload` - -NewRequestBasePayload instantiates a new RequestBasePayload object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewRequestBasePayloadWithDefaults - -`func NewRequestBasePayloadWithDefaults() *RequestBasePayload` - -NewRequestBasePayloadWithDefaults instantiates a new RequestBasePayload object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/RequestDraft.md b/docs/RequestDraft.md deleted file mode 100644 index ec08436..0000000 --- a/docs/RequestDraft.md +++ /dev/null @@ -1,124 +0,0 @@ -# RequestDraft - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Id** | Pointer to **string** | A unique identifier assigned to the request. | [optional] -**UniqueKey** | **string** | A unique key used for request de-duplication. Requests with the same unique key are considered identical. | -**Url** | **string** | The URL of the request. | -**Method** | Pointer to [**HttpMethod**](HttpMethod.md) | | [optional] - -## Methods - -### NewRequestDraft - -`func NewRequestDraft(uniqueKey string, url string, ) *RequestDraft` - -NewRequestDraft instantiates a new RequestDraft object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewRequestDraftWithDefaults - -`func NewRequestDraftWithDefaults() *RequestDraft` - -NewRequestDraftWithDefaults instantiates a new RequestDraft object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetId - -`func (o *RequestDraft) GetId() string` - -GetId returns the Id field if non-nil, zero value otherwise. - -### GetIdOk - -`func (o *RequestDraft) GetIdOk() (*string, bool)` - -GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetId - -`func (o *RequestDraft) SetId(v string)` - -SetId sets Id field to given value. - -### HasId - -`func (o *RequestDraft) HasId() bool` - -HasId returns a boolean if a field has been set. - -### GetUniqueKey - -`func (o *RequestDraft) GetUniqueKey() string` - -GetUniqueKey returns the UniqueKey field if non-nil, zero value otherwise. - -### GetUniqueKeyOk - -`func (o *RequestDraft) GetUniqueKeyOk() (*string, bool)` - -GetUniqueKeyOk returns a tuple with the UniqueKey field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetUniqueKey - -`func (o *RequestDraft) SetUniqueKey(v string)` - -SetUniqueKey sets UniqueKey field to given value. - - -### GetUrl - -`func (o *RequestDraft) GetUrl() string` - -GetUrl returns the Url field if non-nil, zero value otherwise. - -### GetUrlOk - -`func (o *RequestDraft) GetUrlOk() (*string, bool)` - -GetUrlOk returns a tuple with the Url field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetUrl - -`func (o *RequestDraft) SetUrl(v string)` - -SetUrl sets Url field to given value. - - -### GetMethod - -`func (o *RequestDraft) GetMethod() HttpMethod` - -GetMethod returns the Method field if non-nil, zero value otherwise. - -### GetMethodOk - -`func (o *RequestDraft) GetMethodOk() (*HttpMethod, bool)` - -GetMethodOk returns a tuple with the Method field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetMethod - -`func (o *RequestDraft) SetMethod(v HttpMethod)` - -SetMethod sets Method field to given value. - -### HasMethod - -`func (o *RequestDraft) HasMethod() bool` - -HasMethod returns a boolean if a field has been set. - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/RequestDraftDelete.md b/docs/RequestDraftDelete.md deleted file mode 100644 index ca26d3d..0000000 --- a/docs/RequestDraftDelete.md +++ /dev/null @@ -1,72 +0,0 @@ -# RequestDraftDelete - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Id** | **string** | A unique identifier assigned to the request. | -**UniqueKey** | **string** | A unique key used for request de-duplication. Requests with the same unique key are considered identical. | - -## Methods - -### NewRequestDraftDelete - -`func NewRequestDraftDelete(id string, uniqueKey string, ) *RequestDraftDelete` - -NewRequestDraftDelete instantiates a new RequestDraftDelete object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewRequestDraftDeleteWithDefaults - -`func NewRequestDraftDeleteWithDefaults() *RequestDraftDelete` - -NewRequestDraftDeleteWithDefaults instantiates a new RequestDraftDelete object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetId - -`func (o *RequestDraftDelete) GetId() string` - -GetId returns the Id field if non-nil, zero value otherwise. - -### GetIdOk - -`func (o *RequestDraftDelete) GetIdOk() (*string, bool)` - -GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetId - -`func (o *RequestDraftDelete) SetId(v string)` - -SetId sets Id field to given value. - - -### GetUniqueKey - -`func (o *RequestDraftDelete) GetUniqueKey() string` - -GetUniqueKey returns the UniqueKey field if non-nil, zero value otherwise. - -### GetUniqueKeyOk - -`func (o *RequestDraftDelete) GetUniqueKeyOk() (*string, bool)` - -GetUniqueKeyOk returns a tuple with the UniqueKey field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetUniqueKey - -`func (o *RequestDraftDelete) SetUniqueKey(v string)` - -SetUniqueKey sets UniqueKey field to given value. - - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/RequestDraftDeleteById.md b/docs/RequestDraftDeleteById.md deleted file mode 100644 index 6e52d9a..0000000 --- a/docs/RequestDraftDeleteById.md +++ /dev/null @@ -1,77 +0,0 @@ -# RequestDraftDeleteById - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Id** | **string** | A unique identifier assigned to the request. | -**UniqueKey** | Pointer to **string** | A unique key used for request de-duplication. Requests with the same unique key are considered identical. | [optional] - -## Methods - -### NewRequestDraftDeleteById - -`func NewRequestDraftDeleteById(id string, ) *RequestDraftDeleteById` - -NewRequestDraftDeleteById instantiates a new RequestDraftDeleteById object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewRequestDraftDeleteByIdWithDefaults - -`func NewRequestDraftDeleteByIdWithDefaults() *RequestDraftDeleteById` - -NewRequestDraftDeleteByIdWithDefaults instantiates a new RequestDraftDeleteById object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetId - -`func (o *RequestDraftDeleteById) GetId() string` - -GetId returns the Id field if non-nil, zero value otherwise. - -### GetIdOk - -`func (o *RequestDraftDeleteById) GetIdOk() (*string, bool)` - -GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetId - -`func (o *RequestDraftDeleteById) SetId(v string)` - -SetId sets Id field to given value. - - -### GetUniqueKey - -`func (o *RequestDraftDeleteById) GetUniqueKey() string` - -GetUniqueKey returns the UniqueKey field if non-nil, zero value otherwise. - -### GetUniqueKeyOk - -`func (o *RequestDraftDeleteById) GetUniqueKeyOk() (*string, bool)` - -GetUniqueKeyOk returns a tuple with the UniqueKey field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetUniqueKey - -`func (o *RequestDraftDeleteById) SetUniqueKey(v string)` - -SetUniqueKey sets UniqueKey field to given value. - -### HasUniqueKey - -`func (o *RequestDraftDeleteById) HasUniqueKey() bool` - -HasUniqueKey returns a boolean if a field has been set. - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/RequestDraftDeleteByUniqueKey.md b/docs/RequestDraftDeleteByUniqueKey.md deleted file mode 100644 index a44a21f..0000000 --- a/docs/RequestDraftDeleteByUniqueKey.md +++ /dev/null @@ -1,77 +0,0 @@ -# RequestDraftDeleteByUniqueKey - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Id** | Pointer to **string** | A unique identifier assigned to the request. | [optional] -**UniqueKey** | **string** | A unique key used for request de-duplication. Requests with the same unique key are considered identical. | - -## Methods - -### NewRequestDraftDeleteByUniqueKey - -`func NewRequestDraftDeleteByUniqueKey(uniqueKey string, ) *RequestDraftDeleteByUniqueKey` - -NewRequestDraftDeleteByUniqueKey instantiates a new RequestDraftDeleteByUniqueKey object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewRequestDraftDeleteByUniqueKeyWithDefaults - -`func NewRequestDraftDeleteByUniqueKeyWithDefaults() *RequestDraftDeleteByUniqueKey` - -NewRequestDraftDeleteByUniqueKeyWithDefaults instantiates a new RequestDraftDeleteByUniqueKey object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetId - -`func (o *RequestDraftDeleteByUniqueKey) GetId() string` - -GetId returns the Id field if non-nil, zero value otherwise. - -### GetIdOk - -`func (o *RequestDraftDeleteByUniqueKey) GetIdOk() (*string, bool)` - -GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetId - -`func (o *RequestDraftDeleteByUniqueKey) SetId(v string)` - -SetId sets Id field to given value. - -### HasId - -`func (o *RequestDraftDeleteByUniqueKey) HasId() bool` - -HasId returns a boolean if a field has been set. - -### GetUniqueKey - -`func (o *RequestDraftDeleteByUniqueKey) GetUniqueKey() string` - -GetUniqueKey returns the UniqueKey field if non-nil, zero value otherwise. - -### GetUniqueKeyOk - -`func (o *RequestDraftDeleteByUniqueKey) GetUniqueKeyOk() (*string, bool)` - -GetUniqueKeyOk returns a tuple with the UniqueKey field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetUniqueKey - -`func (o *RequestDraftDeleteByUniqueKey) SetUniqueKey(v string)` - -SetUniqueKey sets UniqueKey field to given value. - - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/RequestLockInfo.md b/docs/RequestLockInfo.md deleted file mode 100644 index 6fb1e31..0000000 --- a/docs/RequestLockInfo.md +++ /dev/null @@ -1,51 +0,0 @@ -# RequestLockInfo - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**LockExpiresAt** | **time.Time** | The timestamp when the lock on this request expires. | - -## Methods - -### NewRequestLockInfo - -`func NewRequestLockInfo(lockExpiresAt time.Time, ) *RequestLockInfo` - -NewRequestLockInfo instantiates a new RequestLockInfo object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewRequestLockInfoWithDefaults - -`func NewRequestLockInfoWithDefaults() *RequestLockInfo` - -NewRequestLockInfoWithDefaults instantiates a new RequestLockInfo object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetLockExpiresAt - -`func (o *RequestLockInfo) GetLockExpiresAt() time.Time` - -GetLockExpiresAt returns the LockExpiresAt field if non-nil, zero value otherwise. - -### GetLockExpiresAtOk - -`func (o *RequestLockInfo) GetLockExpiresAtOk() (*time.Time, bool)` - -GetLockExpiresAtOk returns a tuple with the LockExpiresAt field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetLockExpiresAt - -`func (o *RequestLockInfo) SetLockExpiresAt(v time.Time)` - -SetLockExpiresAt sets LockExpiresAt field to given value. - - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/RequestQueue.md b/docs/RequestQueue.md deleted file mode 100644 index df5ae0f..0000000 --- a/docs/RequestQueue.md +++ /dev/null @@ -1,400 +0,0 @@ -# RequestQueue - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Id** | **string** | A unique identifier assigned to the request queue. | -**Name** | Pointer to **NullableString** | The name of the request queue. | [optional] -**UserId** | **string** | The ID of the user who owns the request queue. | -**ActId** | Pointer to **NullableString** | The ID of the Actor that created this request queue. | [optional] -**ActRunId** | Pointer to **NullableString** | The ID of the Actor run that created this request queue. | [optional] -**CreatedAt** | **time.Time** | The timestamp when the request queue was created. | -**ModifiedAt** | **time.Time** | The timestamp when the request queue was last modified. Modifications include adding, updating, or removing requests, as well as locking or unlocking requests in the request queue. | -**AccessedAt** | **time.Time** | The timestamp when the request queue was last accessed. | -**TotalRequestCount** | **int32** | The total number of requests in the request queue. | -**HandledRequestCount** | **int32** | The number of requests that have been handled. | -**PendingRequestCount** | **int32** | The number of requests that are pending and have not been handled yet. | -**HadMultipleClients** | **bool** | Whether the request queue has been accessed by multiple different clients. | -**ConsoleUrl** | **string** | The URL to view the request queue in the Apify console. | -**Stats** | Pointer to [**RequestQueueStats**](RequestQueueStats.md) | | [optional] -**GeneralAccess** | Pointer to [**GeneralAccess**](GeneralAccess.md) | | [optional] - -## Methods - -### NewRequestQueue - -`func NewRequestQueue(id string, userId string, createdAt time.Time, modifiedAt time.Time, accessedAt time.Time, totalRequestCount int32, handledRequestCount int32, pendingRequestCount int32, hadMultipleClients bool, consoleUrl string, ) *RequestQueue` - -NewRequestQueue instantiates a new RequestQueue object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewRequestQueueWithDefaults - -`func NewRequestQueueWithDefaults() *RequestQueue` - -NewRequestQueueWithDefaults instantiates a new RequestQueue object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetId - -`func (o *RequestQueue) GetId() string` - -GetId returns the Id field if non-nil, zero value otherwise. - -### GetIdOk - -`func (o *RequestQueue) GetIdOk() (*string, bool)` - -GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetId - -`func (o *RequestQueue) SetId(v string)` - -SetId sets Id field to given value. - - -### GetName - -`func (o *RequestQueue) GetName() string` - -GetName returns the Name field if non-nil, zero value otherwise. - -### GetNameOk - -`func (o *RequestQueue) GetNameOk() (*string, bool)` - -GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetName - -`func (o *RequestQueue) SetName(v string)` - -SetName sets Name field to given value. - -### HasName - -`func (o *RequestQueue) HasName() bool` - -HasName returns a boolean if a field has been set. - -### SetNameNil - -`func (o *RequestQueue) SetNameNil(b bool)` - - SetNameNil sets the value for Name to be an explicit nil - -### UnsetName -`func (o *RequestQueue) UnsetName()` - -UnsetName ensures that no value is present for Name, not even an explicit nil -### GetUserId - -`func (o *RequestQueue) GetUserId() string` - -GetUserId returns the UserId field if non-nil, zero value otherwise. - -### GetUserIdOk - -`func (o *RequestQueue) GetUserIdOk() (*string, bool)` - -GetUserIdOk returns a tuple with the UserId field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetUserId - -`func (o *RequestQueue) SetUserId(v string)` - -SetUserId sets UserId field to given value. - - -### GetActId - -`func (o *RequestQueue) GetActId() string` - -GetActId returns the ActId field if non-nil, zero value otherwise. - -### GetActIdOk - -`func (o *RequestQueue) GetActIdOk() (*string, bool)` - -GetActIdOk returns a tuple with the ActId field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetActId - -`func (o *RequestQueue) SetActId(v string)` - -SetActId sets ActId field to given value. - -### HasActId - -`func (o *RequestQueue) HasActId() bool` - -HasActId returns a boolean if a field has been set. - -### SetActIdNil - -`func (o *RequestQueue) SetActIdNil(b bool)` - - SetActIdNil sets the value for ActId to be an explicit nil - -### UnsetActId -`func (o *RequestQueue) UnsetActId()` - -UnsetActId ensures that no value is present for ActId, not even an explicit nil -### GetActRunId - -`func (o *RequestQueue) GetActRunId() string` - -GetActRunId returns the ActRunId field if non-nil, zero value otherwise. - -### GetActRunIdOk - -`func (o *RequestQueue) GetActRunIdOk() (*string, bool)` - -GetActRunIdOk returns a tuple with the ActRunId field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetActRunId - -`func (o *RequestQueue) SetActRunId(v string)` - -SetActRunId sets ActRunId field to given value. - -### HasActRunId - -`func (o *RequestQueue) HasActRunId() bool` - -HasActRunId returns a boolean if a field has been set. - -### SetActRunIdNil - -`func (o *RequestQueue) SetActRunIdNil(b bool)` - - SetActRunIdNil sets the value for ActRunId to be an explicit nil - -### UnsetActRunId -`func (o *RequestQueue) UnsetActRunId()` - -UnsetActRunId ensures that no value is present for ActRunId, not even an explicit nil -### GetCreatedAt - -`func (o *RequestQueue) GetCreatedAt() time.Time` - -GetCreatedAt returns the CreatedAt field if non-nil, zero value otherwise. - -### GetCreatedAtOk - -`func (o *RequestQueue) GetCreatedAtOk() (*time.Time, bool)` - -GetCreatedAtOk returns a tuple with the CreatedAt field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetCreatedAt - -`func (o *RequestQueue) SetCreatedAt(v time.Time)` - -SetCreatedAt sets CreatedAt field to given value. - - -### GetModifiedAt - -`func (o *RequestQueue) GetModifiedAt() time.Time` - -GetModifiedAt returns the ModifiedAt field if non-nil, zero value otherwise. - -### GetModifiedAtOk - -`func (o *RequestQueue) GetModifiedAtOk() (*time.Time, bool)` - -GetModifiedAtOk returns a tuple with the ModifiedAt field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetModifiedAt - -`func (o *RequestQueue) SetModifiedAt(v time.Time)` - -SetModifiedAt sets ModifiedAt field to given value. - - -### GetAccessedAt - -`func (o *RequestQueue) GetAccessedAt() time.Time` - -GetAccessedAt returns the AccessedAt field if non-nil, zero value otherwise. - -### GetAccessedAtOk - -`func (o *RequestQueue) GetAccessedAtOk() (*time.Time, bool)` - -GetAccessedAtOk returns a tuple with the AccessedAt field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetAccessedAt - -`func (o *RequestQueue) SetAccessedAt(v time.Time)` - -SetAccessedAt sets AccessedAt field to given value. - - -### GetTotalRequestCount - -`func (o *RequestQueue) GetTotalRequestCount() int32` - -GetTotalRequestCount returns the TotalRequestCount field if non-nil, zero value otherwise. - -### GetTotalRequestCountOk - -`func (o *RequestQueue) GetTotalRequestCountOk() (*int32, bool)` - -GetTotalRequestCountOk returns a tuple with the TotalRequestCount field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetTotalRequestCount - -`func (o *RequestQueue) SetTotalRequestCount(v int32)` - -SetTotalRequestCount sets TotalRequestCount field to given value. - - -### GetHandledRequestCount - -`func (o *RequestQueue) GetHandledRequestCount() int32` - -GetHandledRequestCount returns the HandledRequestCount field if non-nil, zero value otherwise. - -### GetHandledRequestCountOk - -`func (o *RequestQueue) GetHandledRequestCountOk() (*int32, bool)` - -GetHandledRequestCountOk returns a tuple with the HandledRequestCount field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetHandledRequestCount - -`func (o *RequestQueue) SetHandledRequestCount(v int32)` - -SetHandledRequestCount sets HandledRequestCount field to given value. - - -### GetPendingRequestCount - -`func (o *RequestQueue) GetPendingRequestCount() int32` - -GetPendingRequestCount returns the PendingRequestCount field if non-nil, zero value otherwise. - -### GetPendingRequestCountOk - -`func (o *RequestQueue) GetPendingRequestCountOk() (*int32, bool)` - -GetPendingRequestCountOk returns a tuple with the PendingRequestCount field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetPendingRequestCount - -`func (o *RequestQueue) SetPendingRequestCount(v int32)` - -SetPendingRequestCount sets PendingRequestCount field to given value. - - -### GetHadMultipleClients - -`func (o *RequestQueue) GetHadMultipleClients() bool` - -GetHadMultipleClients returns the HadMultipleClients field if non-nil, zero value otherwise. - -### GetHadMultipleClientsOk - -`func (o *RequestQueue) GetHadMultipleClientsOk() (*bool, bool)` - -GetHadMultipleClientsOk returns a tuple with the HadMultipleClients field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetHadMultipleClients - -`func (o *RequestQueue) SetHadMultipleClients(v bool)` - -SetHadMultipleClients sets HadMultipleClients field to given value. - - -### GetConsoleUrl - -`func (o *RequestQueue) GetConsoleUrl() string` - -GetConsoleUrl returns the ConsoleUrl field if non-nil, zero value otherwise. - -### GetConsoleUrlOk - -`func (o *RequestQueue) GetConsoleUrlOk() (*string, bool)` - -GetConsoleUrlOk returns a tuple with the ConsoleUrl field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetConsoleUrl - -`func (o *RequestQueue) SetConsoleUrl(v string)` - -SetConsoleUrl sets ConsoleUrl field to given value. - - -### GetStats - -`func (o *RequestQueue) GetStats() RequestQueueStats` - -GetStats returns the Stats field if non-nil, zero value otherwise. - -### GetStatsOk - -`func (o *RequestQueue) GetStatsOk() (*RequestQueueStats, bool)` - -GetStatsOk returns a tuple with the Stats field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetStats - -`func (o *RequestQueue) SetStats(v RequestQueueStats)` - -SetStats sets Stats field to given value. - -### HasStats - -`func (o *RequestQueue) HasStats() bool` - -HasStats returns a boolean if a field has been set. - -### GetGeneralAccess - -`func (o *RequestQueue) GetGeneralAccess() GeneralAccess` - -GetGeneralAccess returns the GeneralAccess field if non-nil, zero value otherwise. - -### GetGeneralAccessOk - -`func (o *RequestQueue) GetGeneralAccessOk() (*GeneralAccess, bool)` - -GetGeneralAccessOk returns a tuple with the GeneralAccess field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetGeneralAccess - -`func (o *RequestQueue) SetGeneralAccess(v GeneralAccess)` - -SetGeneralAccess sets GeneralAccess field to given value. - -### HasGeneralAccess - -`func (o *RequestQueue) HasGeneralAccess() bool` - -HasGeneralAccess returns a boolean if a field has been set. - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/RequestQueueHead.md b/docs/RequestQueueHead.md deleted file mode 100644 index 54d09eb..0000000 --- a/docs/RequestQueueHead.md +++ /dev/null @@ -1,114 +0,0 @@ -# RequestQueueHead - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Limit** | **int32** | The maximum number of requests returned. | -**QueueModifiedAt** | **time.Time** | The timestamp when the request queue was last modified. Modifications include adding, updating, or removing requests, as well as locking or unlocking requests in the request queue. | -**HadMultipleClients** | **bool** | Whether the request queue has been accessed by multiple different clients. | -**Items** | [**[]HeadRequest**](HeadRequest.md) | The array of requests from the request queue head. | - -## Methods - -### NewRequestQueueHead - -`func NewRequestQueueHead(limit int32, queueModifiedAt time.Time, hadMultipleClients bool, items []HeadRequest, ) *RequestQueueHead` - -NewRequestQueueHead instantiates a new RequestQueueHead object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewRequestQueueHeadWithDefaults - -`func NewRequestQueueHeadWithDefaults() *RequestQueueHead` - -NewRequestQueueHeadWithDefaults instantiates a new RequestQueueHead object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetLimit - -`func (o *RequestQueueHead) GetLimit() int32` - -GetLimit returns the Limit field if non-nil, zero value otherwise. - -### GetLimitOk - -`func (o *RequestQueueHead) GetLimitOk() (*int32, bool)` - -GetLimitOk returns a tuple with the Limit field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetLimit - -`func (o *RequestQueueHead) SetLimit(v int32)` - -SetLimit sets Limit field to given value. - - -### GetQueueModifiedAt - -`func (o *RequestQueueHead) GetQueueModifiedAt() time.Time` - -GetQueueModifiedAt returns the QueueModifiedAt field if non-nil, zero value otherwise. - -### GetQueueModifiedAtOk - -`func (o *RequestQueueHead) GetQueueModifiedAtOk() (*time.Time, bool)` - -GetQueueModifiedAtOk returns a tuple with the QueueModifiedAt field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetQueueModifiedAt - -`func (o *RequestQueueHead) SetQueueModifiedAt(v time.Time)` - -SetQueueModifiedAt sets QueueModifiedAt field to given value. - - -### GetHadMultipleClients - -`func (o *RequestQueueHead) GetHadMultipleClients() bool` - -GetHadMultipleClients returns the HadMultipleClients field if non-nil, zero value otherwise. - -### GetHadMultipleClientsOk - -`func (o *RequestQueueHead) GetHadMultipleClientsOk() (*bool, bool)` - -GetHadMultipleClientsOk returns a tuple with the HadMultipleClients field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetHadMultipleClients - -`func (o *RequestQueueHead) SetHadMultipleClients(v bool)` - -SetHadMultipleClients sets HadMultipleClients field to given value. - - -### GetItems - -`func (o *RequestQueueHead) GetItems() []HeadRequest` - -GetItems returns the Items field if non-nil, zero value otherwise. - -### GetItemsOk - -`func (o *RequestQueueHead) GetItemsOk() (*[]HeadRequest, bool)` - -GetItemsOk returns a tuple with the Items field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetItems - -`func (o *RequestQueueHead) SetItems(v []HeadRequest)` - -SetItems sets Items field to given value. - - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/RequestQueueResponse.md b/docs/RequestQueueResponse.md deleted file mode 100644 index 0c14de1..0000000 --- a/docs/RequestQueueResponse.md +++ /dev/null @@ -1,51 +0,0 @@ -# RequestQueueResponse - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Data** | [**RequestQueue**](RequestQueue.md) | | - -## Methods - -### NewRequestQueueResponse - -`func NewRequestQueueResponse(data RequestQueue, ) *RequestQueueResponse` - -NewRequestQueueResponse instantiates a new RequestQueueResponse object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewRequestQueueResponseWithDefaults - -`func NewRequestQueueResponseWithDefaults() *RequestQueueResponse` - -NewRequestQueueResponseWithDefaults instantiates a new RequestQueueResponse object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetData - -`func (o *RequestQueueResponse) GetData() RequestQueue` - -GetData returns the Data field if non-nil, zero value otherwise. - -### GetDataOk - -`func (o *RequestQueueResponse) GetDataOk() (*RequestQueue, bool)` - -GetDataOk returns a tuple with the Data field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetData - -`func (o *RequestQueueResponse) SetData(v RequestQueue)` - -SetData sets Data field to given value. - - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/RequestQueueShort.md b/docs/RequestQueueShort.md deleted file mode 100644 index 66c6852..0000000 --- a/docs/RequestQueueShort.md +++ /dev/null @@ -1,411 +0,0 @@ -# RequestQueueShort - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Id** | **string** | A unique identifier assigned to the request queue. | -**Name** | **string** | The name of the request queue. | -**UserId** | **string** | The ID of the user who owns the request queue. | -**Username** | **string** | The username of the user who owns the request queue. | -**CreatedAt** | **time.Time** | The timestamp when the request queue was created. | -**ModifiedAt** | **time.Time** | The timestamp when the request queue was last modified. Modifications include adding, updating, or removing requests, as well as locking or unlocking requests in the request queue. | -**AccessedAt** | **time.Time** | The timestamp when the request queue was last accessed. | -**ExpireAt** | Pointer to **time.Time** | The timestamp when the request queue will expire and be deleted. | [optional] -**TotalRequestCount** | **int32** | The total number of requests in the request queue. | -**HandledRequestCount** | **int32** | The number of requests that have been handled. | -**PendingRequestCount** | **int32** | The number of requests that are pending and have not been handled yet. | -**ActId** | Pointer to **NullableString** | The ID of the Actor that created this request queue. | [optional] -**ActRunId** | Pointer to **NullableString** | The ID of the Actor run that created this request queue. | [optional] -**HadMultipleClients** | **bool** | Whether the request queue has been accessed by multiple different clients. | -**GeneralAccess** | Pointer to [**GeneralAccess**](GeneralAccess.md) | | [optional] -**Stats** | Pointer to [**RequestQueueStats**](RequestQueueStats.md) | | [optional] - -## Methods - -### NewRequestQueueShort - -`func NewRequestQueueShort(id string, name string, userId string, username string, createdAt time.Time, modifiedAt time.Time, accessedAt time.Time, totalRequestCount int32, handledRequestCount int32, pendingRequestCount int32, hadMultipleClients bool, ) *RequestQueueShort` - -NewRequestQueueShort instantiates a new RequestQueueShort object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewRequestQueueShortWithDefaults - -`func NewRequestQueueShortWithDefaults() *RequestQueueShort` - -NewRequestQueueShortWithDefaults instantiates a new RequestQueueShort object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetId - -`func (o *RequestQueueShort) GetId() string` - -GetId returns the Id field if non-nil, zero value otherwise. - -### GetIdOk - -`func (o *RequestQueueShort) GetIdOk() (*string, bool)` - -GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetId - -`func (o *RequestQueueShort) SetId(v string)` - -SetId sets Id field to given value. - - -### GetName - -`func (o *RequestQueueShort) GetName() string` - -GetName returns the Name field if non-nil, zero value otherwise. - -### GetNameOk - -`func (o *RequestQueueShort) GetNameOk() (*string, bool)` - -GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetName - -`func (o *RequestQueueShort) SetName(v string)` - -SetName sets Name field to given value. - - -### GetUserId - -`func (o *RequestQueueShort) GetUserId() string` - -GetUserId returns the UserId field if non-nil, zero value otherwise. - -### GetUserIdOk - -`func (o *RequestQueueShort) GetUserIdOk() (*string, bool)` - -GetUserIdOk returns a tuple with the UserId field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetUserId - -`func (o *RequestQueueShort) SetUserId(v string)` - -SetUserId sets UserId field to given value. - - -### GetUsername - -`func (o *RequestQueueShort) GetUsername() string` - -GetUsername returns the Username field if non-nil, zero value otherwise. - -### GetUsernameOk - -`func (o *RequestQueueShort) GetUsernameOk() (*string, bool)` - -GetUsernameOk returns a tuple with the Username field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetUsername - -`func (o *RequestQueueShort) SetUsername(v string)` - -SetUsername sets Username field to given value. - - -### GetCreatedAt - -`func (o *RequestQueueShort) GetCreatedAt() time.Time` - -GetCreatedAt returns the CreatedAt field if non-nil, zero value otherwise. - -### GetCreatedAtOk - -`func (o *RequestQueueShort) GetCreatedAtOk() (*time.Time, bool)` - -GetCreatedAtOk returns a tuple with the CreatedAt field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetCreatedAt - -`func (o *RequestQueueShort) SetCreatedAt(v time.Time)` - -SetCreatedAt sets CreatedAt field to given value. - - -### GetModifiedAt - -`func (o *RequestQueueShort) GetModifiedAt() time.Time` - -GetModifiedAt returns the ModifiedAt field if non-nil, zero value otherwise. - -### GetModifiedAtOk - -`func (o *RequestQueueShort) GetModifiedAtOk() (*time.Time, bool)` - -GetModifiedAtOk returns a tuple with the ModifiedAt field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetModifiedAt - -`func (o *RequestQueueShort) SetModifiedAt(v time.Time)` - -SetModifiedAt sets ModifiedAt field to given value. - - -### GetAccessedAt - -`func (o *RequestQueueShort) GetAccessedAt() time.Time` - -GetAccessedAt returns the AccessedAt field if non-nil, zero value otherwise. - -### GetAccessedAtOk - -`func (o *RequestQueueShort) GetAccessedAtOk() (*time.Time, bool)` - -GetAccessedAtOk returns a tuple with the AccessedAt field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetAccessedAt - -`func (o *RequestQueueShort) SetAccessedAt(v time.Time)` - -SetAccessedAt sets AccessedAt field to given value. - - -### GetExpireAt - -`func (o *RequestQueueShort) GetExpireAt() time.Time` - -GetExpireAt returns the ExpireAt field if non-nil, zero value otherwise. - -### GetExpireAtOk - -`func (o *RequestQueueShort) GetExpireAtOk() (*time.Time, bool)` - -GetExpireAtOk returns a tuple with the ExpireAt field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetExpireAt - -`func (o *RequestQueueShort) SetExpireAt(v time.Time)` - -SetExpireAt sets ExpireAt field to given value. - -### HasExpireAt - -`func (o *RequestQueueShort) HasExpireAt() bool` - -HasExpireAt returns a boolean if a field has been set. - -### GetTotalRequestCount - -`func (o *RequestQueueShort) GetTotalRequestCount() int32` - -GetTotalRequestCount returns the TotalRequestCount field if non-nil, zero value otherwise. - -### GetTotalRequestCountOk - -`func (o *RequestQueueShort) GetTotalRequestCountOk() (*int32, bool)` - -GetTotalRequestCountOk returns a tuple with the TotalRequestCount field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetTotalRequestCount - -`func (o *RequestQueueShort) SetTotalRequestCount(v int32)` - -SetTotalRequestCount sets TotalRequestCount field to given value. - - -### GetHandledRequestCount - -`func (o *RequestQueueShort) GetHandledRequestCount() int32` - -GetHandledRequestCount returns the HandledRequestCount field if non-nil, zero value otherwise. - -### GetHandledRequestCountOk - -`func (o *RequestQueueShort) GetHandledRequestCountOk() (*int32, bool)` - -GetHandledRequestCountOk returns a tuple with the HandledRequestCount field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetHandledRequestCount - -`func (o *RequestQueueShort) SetHandledRequestCount(v int32)` - -SetHandledRequestCount sets HandledRequestCount field to given value. - - -### GetPendingRequestCount - -`func (o *RequestQueueShort) GetPendingRequestCount() int32` - -GetPendingRequestCount returns the PendingRequestCount field if non-nil, zero value otherwise. - -### GetPendingRequestCountOk - -`func (o *RequestQueueShort) GetPendingRequestCountOk() (*int32, bool)` - -GetPendingRequestCountOk returns a tuple with the PendingRequestCount field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetPendingRequestCount - -`func (o *RequestQueueShort) SetPendingRequestCount(v int32)` - -SetPendingRequestCount sets PendingRequestCount field to given value. - - -### GetActId - -`func (o *RequestQueueShort) GetActId() string` - -GetActId returns the ActId field if non-nil, zero value otherwise. - -### GetActIdOk - -`func (o *RequestQueueShort) GetActIdOk() (*string, bool)` - -GetActIdOk returns a tuple with the ActId field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetActId - -`func (o *RequestQueueShort) SetActId(v string)` - -SetActId sets ActId field to given value. - -### HasActId - -`func (o *RequestQueueShort) HasActId() bool` - -HasActId returns a boolean if a field has been set. - -### SetActIdNil - -`func (o *RequestQueueShort) SetActIdNil(b bool)` - - SetActIdNil sets the value for ActId to be an explicit nil - -### UnsetActId -`func (o *RequestQueueShort) UnsetActId()` - -UnsetActId ensures that no value is present for ActId, not even an explicit nil -### GetActRunId - -`func (o *RequestQueueShort) GetActRunId() string` - -GetActRunId returns the ActRunId field if non-nil, zero value otherwise. - -### GetActRunIdOk - -`func (o *RequestQueueShort) GetActRunIdOk() (*string, bool)` - -GetActRunIdOk returns a tuple with the ActRunId field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetActRunId - -`func (o *RequestQueueShort) SetActRunId(v string)` - -SetActRunId sets ActRunId field to given value. - -### HasActRunId - -`func (o *RequestQueueShort) HasActRunId() bool` - -HasActRunId returns a boolean if a field has been set. - -### SetActRunIdNil - -`func (o *RequestQueueShort) SetActRunIdNil(b bool)` - - SetActRunIdNil sets the value for ActRunId to be an explicit nil - -### UnsetActRunId -`func (o *RequestQueueShort) UnsetActRunId()` - -UnsetActRunId ensures that no value is present for ActRunId, not even an explicit nil -### GetHadMultipleClients - -`func (o *RequestQueueShort) GetHadMultipleClients() bool` - -GetHadMultipleClients returns the HadMultipleClients field if non-nil, zero value otherwise. - -### GetHadMultipleClientsOk - -`func (o *RequestQueueShort) GetHadMultipleClientsOk() (*bool, bool)` - -GetHadMultipleClientsOk returns a tuple with the HadMultipleClients field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetHadMultipleClients - -`func (o *RequestQueueShort) SetHadMultipleClients(v bool)` - -SetHadMultipleClients sets HadMultipleClients field to given value. - - -### GetGeneralAccess - -`func (o *RequestQueueShort) GetGeneralAccess() GeneralAccess` - -GetGeneralAccess returns the GeneralAccess field if non-nil, zero value otherwise. - -### GetGeneralAccessOk - -`func (o *RequestQueueShort) GetGeneralAccessOk() (*GeneralAccess, bool)` - -GetGeneralAccessOk returns a tuple with the GeneralAccess field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetGeneralAccess - -`func (o *RequestQueueShort) SetGeneralAccess(v GeneralAccess)` - -SetGeneralAccess sets GeneralAccess field to given value. - -### HasGeneralAccess - -`func (o *RequestQueueShort) HasGeneralAccess() bool` - -HasGeneralAccess returns a boolean if a field has been set. - -### GetStats - -`func (o *RequestQueueShort) GetStats() RequestQueueStats` - -GetStats returns the Stats field if non-nil, zero value otherwise. - -### GetStatsOk - -`func (o *RequestQueueShort) GetStatsOk() (*RequestQueueStats, bool)` - -GetStatsOk returns a tuple with the Stats field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetStats - -`func (o *RequestQueueShort) SetStats(v RequestQueueStats)` - -SetStats sets Stats field to given value. - -### HasStats - -`func (o *RequestQueueShort) HasStats() bool` - -HasStats returns a boolean if a field has been set. - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/RequestQueueStats.md b/docs/RequestQueueStats.md deleted file mode 100644 index 8b81d4b..0000000 --- a/docs/RequestQueueStats.md +++ /dev/null @@ -1,160 +0,0 @@ -# RequestQueueStats - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**DeleteCount** | Pointer to **int32** | The number of delete operations performed on the request queue. | [optional] -**HeadItemReadCount** | Pointer to **int32** | The number of times requests from the head were read. | [optional] -**ReadCount** | Pointer to **int32** | The total number of read operations performed on the request queue. | [optional] -**StorageBytes** | Pointer to **int32** | The total storage size in bytes used by the request queue. | [optional] -**WriteCount** | Pointer to **int32** | The total number of write operations performed on the request queue. | [optional] - -## Methods - -### NewRequestQueueStats - -`func NewRequestQueueStats() *RequestQueueStats` - -NewRequestQueueStats instantiates a new RequestQueueStats object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewRequestQueueStatsWithDefaults - -`func NewRequestQueueStatsWithDefaults() *RequestQueueStats` - -NewRequestQueueStatsWithDefaults instantiates a new RequestQueueStats object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetDeleteCount - -`func (o *RequestQueueStats) GetDeleteCount() int32` - -GetDeleteCount returns the DeleteCount field if non-nil, zero value otherwise. - -### GetDeleteCountOk - -`func (o *RequestQueueStats) GetDeleteCountOk() (*int32, bool)` - -GetDeleteCountOk returns a tuple with the DeleteCount field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetDeleteCount - -`func (o *RequestQueueStats) SetDeleteCount(v int32)` - -SetDeleteCount sets DeleteCount field to given value. - -### HasDeleteCount - -`func (o *RequestQueueStats) HasDeleteCount() bool` - -HasDeleteCount returns a boolean if a field has been set. - -### GetHeadItemReadCount - -`func (o *RequestQueueStats) GetHeadItemReadCount() int32` - -GetHeadItemReadCount returns the HeadItemReadCount field if non-nil, zero value otherwise. - -### GetHeadItemReadCountOk - -`func (o *RequestQueueStats) GetHeadItemReadCountOk() (*int32, bool)` - -GetHeadItemReadCountOk returns a tuple with the HeadItemReadCount field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetHeadItemReadCount - -`func (o *RequestQueueStats) SetHeadItemReadCount(v int32)` - -SetHeadItemReadCount sets HeadItemReadCount field to given value. - -### HasHeadItemReadCount - -`func (o *RequestQueueStats) HasHeadItemReadCount() bool` - -HasHeadItemReadCount returns a boolean if a field has been set. - -### GetReadCount - -`func (o *RequestQueueStats) GetReadCount() int32` - -GetReadCount returns the ReadCount field if non-nil, zero value otherwise. - -### GetReadCountOk - -`func (o *RequestQueueStats) GetReadCountOk() (*int32, bool)` - -GetReadCountOk returns a tuple with the ReadCount field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetReadCount - -`func (o *RequestQueueStats) SetReadCount(v int32)` - -SetReadCount sets ReadCount field to given value. - -### HasReadCount - -`func (o *RequestQueueStats) HasReadCount() bool` - -HasReadCount returns a boolean if a field has been set. - -### GetStorageBytes - -`func (o *RequestQueueStats) GetStorageBytes() int32` - -GetStorageBytes returns the StorageBytes field if non-nil, zero value otherwise. - -### GetStorageBytesOk - -`func (o *RequestQueueStats) GetStorageBytesOk() (*int32, bool)` - -GetStorageBytesOk returns a tuple with the StorageBytes field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetStorageBytes - -`func (o *RequestQueueStats) SetStorageBytes(v int32)` - -SetStorageBytes sets StorageBytes field to given value. - -### HasStorageBytes - -`func (o *RequestQueueStats) HasStorageBytes() bool` - -HasStorageBytes returns a boolean if a field has been set. - -### GetWriteCount - -`func (o *RequestQueueStats) GetWriteCount() int32` - -GetWriteCount returns the WriteCount field if non-nil, zero value otherwise. - -### GetWriteCountOk - -`func (o *RequestQueueStats) GetWriteCountOk() (*int32, bool)` - -GetWriteCountOk returns a tuple with the WriteCount field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetWriteCount - -`func (o *RequestQueueStats) SetWriteCount(v int32)` - -SetWriteCount sets WriteCount field to given value. - -### HasWriteCount - -`func (o *RequestQueueStats) HasWriteCount() bool` - -HasWriteCount returns a boolean if a field has been set. - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/RequestRegistration.md b/docs/RequestRegistration.md deleted file mode 100644 index 85e8754..0000000 --- a/docs/RequestRegistration.md +++ /dev/null @@ -1,93 +0,0 @@ -# RequestRegistration - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**RequestId** | **string** | A unique identifier assigned to the request. | -**WasAlreadyPresent** | **bool** | Indicates whether a request with the same unique key already existed in the request queue. If true, no new request was created. | -**WasAlreadyHandled** | **bool** | Indicates whether a request with the same unique key has already been processed by the request queue. | - -## Methods - -### NewRequestRegistration - -`func NewRequestRegistration(requestId string, wasAlreadyPresent bool, wasAlreadyHandled bool, ) *RequestRegistration` - -NewRequestRegistration instantiates a new RequestRegistration object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewRequestRegistrationWithDefaults - -`func NewRequestRegistrationWithDefaults() *RequestRegistration` - -NewRequestRegistrationWithDefaults instantiates a new RequestRegistration object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetRequestId - -`func (o *RequestRegistration) GetRequestId() string` - -GetRequestId returns the RequestId field if non-nil, zero value otherwise. - -### GetRequestIdOk - -`func (o *RequestRegistration) GetRequestIdOk() (*string, bool)` - -GetRequestIdOk returns a tuple with the RequestId field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetRequestId - -`func (o *RequestRegistration) SetRequestId(v string)` - -SetRequestId sets RequestId field to given value. - - -### GetWasAlreadyPresent - -`func (o *RequestRegistration) GetWasAlreadyPresent() bool` - -GetWasAlreadyPresent returns the WasAlreadyPresent field if non-nil, zero value otherwise. - -### GetWasAlreadyPresentOk - -`func (o *RequestRegistration) GetWasAlreadyPresentOk() (*bool, bool)` - -GetWasAlreadyPresentOk returns a tuple with the WasAlreadyPresent field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetWasAlreadyPresent - -`func (o *RequestRegistration) SetWasAlreadyPresent(v bool)` - -SetWasAlreadyPresent sets WasAlreadyPresent field to given value. - - -### GetWasAlreadyHandled - -`func (o *RequestRegistration) GetWasAlreadyHandled() bool` - -GetWasAlreadyHandled returns the WasAlreadyHandled field if non-nil, zero value otherwise. - -### GetWasAlreadyHandledOk - -`func (o *RequestRegistration) GetWasAlreadyHandledOk() (*bool, bool)` - -GetWasAlreadyHandledOk returns a tuple with the WasAlreadyHandled field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetWasAlreadyHandled - -`func (o *RequestRegistration) SetWasAlreadyHandled(v bool)` - -SetWasAlreadyHandled sets WasAlreadyHandled field to given value. - - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/RequestResponse.md b/docs/RequestResponse.md deleted file mode 100644 index c231425..0000000 --- a/docs/RequestResponse.md +++ /dev/null @@ -1,51 +0,0 @@ -# RequestResponse - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Data** | [**Request**](Request.md) | | - -## Methods - -### NewRequestResponse - -`func NewRequestResponse(data Request, ) *RequestResponse` - -NewRequestResponse instantiates a new RequestResponse object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewRequestResponseWithDefaults - -`func NewRequestResponseWithDefaults() *RequestResponse` - -NewRequestResponseWithDefaults instantiates a new RequestResponse object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetData - -`func (o *RequestResponse) GetData() Request` - -GetData returns the Data field if non-nil, zero value otherwise. - -### GetDataOk - -`func (o *RequestResponse) GetDataOk() (*Request, bool)` - -GetDataOk returns a tuple with the Data field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetData - -`func (o *RequestResponse) SetData(v Request)` - -SetData sets Data field to given value. - - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/Run.md b/docs/Run.md deleted file mode 100644 index 97a2362..0000000 --- a/docs/Run.md +++ /dev/null @@ -1,865 +0,0 @@ -# Run - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Id** | **string** | Unique identifier of the Actor run. | -**ActId** | **string** | ID of the Actor that was run. | -**UserId** | **string** | ID of the user who started the run. | -**ActorTaskId** | Pointer to **NullableString** | ID of the Actor task, if the run was started from a task. | [optional] -**StartedAt** | **time.Time** | Time when the Actor run started. | -**FinishedAt** | Pointer to **NullableTime** | Time when the Actor run finished. | [optional] -**Status** | [**ActorJobStatus**](ActorJobStatus.md) | Current status of the Actor run. | -**StatusMessage** | Pointer to **NullableString** | Detailed message about the run status. | [optional] -**IsStatusMessageTerminal** | Pointer to **NullableBool** | Whether the status message is terminal (final). | [optional] -**Meta** | [**RunMeta**](RunMeta.md) | Metadata about the Actor run. | -**PricingInfo** | Pointer to [**ActorRunPricingInfo**](ActorRunPricingInfo.md) | Pricing information for the Actor. | [optional] -**Stats** | [**RunStats**](RunStats.md) | Statistics of the Actor run. | -**ChargedEventCounts** | Pointer to **map[string]int32** | A map of charged event types to their counts. The keys are event type identifiers defined by the Actor's pricing model (pay-per-event), and the values are the number of times each event was charged during this run. | [optional] -**Options** | [**RunOptions**](RunOptions.md) | Configuration options for the Actor run. | -**BuildId** | **string** | ID of the Actor build used for this run. | -**ExitCode** | Pointer to **NullableInt32** | Exit code of the Actor run process. | [optional] -**GeneralAccess** | [**GeneralAccess**](GeneralAccess.md) | General access level for the Actor run. | -**DefaultKeyValueStoreId** | **string** | ID of the default key-value store for this run. | -**DefaultDatasetId** | **string** | ID of the default dataset for this run. | -**DefaultRequestQueueId** | **string** | ID of the default request queue for this run. | -**StorageIds** | Pointer to [**RunStorageIds**](RunStorageIds.md) | | [optional] -**BuildNumber** | Pointer to **NullableString** | Build number of the Actor build used for this run. | [optional] -**ContainerUrl** | Pointer to **string** | URL of the container running the Actor. | [optional] -**IsContainerServerReady** | Pointer to **NullableBool** | Whether the container's HTTP server is ready to accept requests. | [optional] -**GitBranchName** | Pointer to **NullableString** | Name of the git branch used for the Actor build. | [optional] -**Usage** | Pointer to [**NullableRunUsage**](RunUsage.md) | Resource usage statistics for the run. | [optional] -**UsageTotalUsd** | Pointer to **NullableFloat32** | Total cost in USD for this run. Represents what you actually pay. For run owners: includes platform usage (compute units) and/or event costs depending on the Actor's pricing model. For run non-owners: only available for Pay-Per-Event Actors (event costs only). Requires authentication token to access. | [optional] -**UsageUsd** | Pointer to [**NullableRunUsageUsd**](RunUsageUsd.md) | Platform usage costs breakdown in USD. Only present if you own the run AND are paying for platform usage (Pay-Per-Usage, Rental, or Pay-Per-Event with usage costs like standby Actors). Not available for standard Pay-Per-Event Actors. Requires authentication token to access. | [optional] -**Metamorphs** | Pointer to [**[]Metamorph**](Metamorph.md) | List of metamorph events that occurred during the run. | [optional] -**PlatformUsageBillingModel** | Pointer to **string** | Indicates which party covers platform usage costs for this run. | [optional] - -## Methods - -### NewRun - -`func NewRun(id string, actId string, userId string, startedAt time.Time, status ActorJobStatus, meta RunMeta, stats RunStats, options RunOptions, buildId string, generalAccess GeneralAccess, defaultKeyValueStoreId string, defaultDatasetId string, defaultRequestQueueId string, ) *Run` - -NewRun instantiates a new Run object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewRunWithDefaults - -`func NewRunWithDefaults() *Run` - -NewRunWithDefaults instantiates a new Run object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetId - -`func (o *Run) GetId() string` - -GetId returns the Id field if non-nil, zero value otherwise. - -### GetIdOk - -`func (o *Run) GetIdOk() (*string, bool)` - -GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetId - -`func (o *Run) SetId(v string)` - -SetId sets Id field to given value. - - -### GetActId - -`func (o *Run) GetActId() string` - -GetActId returns the ActId field if non-nil, zero value otherwise. - -### GetActIdOk - -`func (o *Run) GetActIdOk() (*string, bool)` - -GetActIdOk returns a tuple with the ActId field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetActId - -`func (o *Run) SetActId(v string)` - -SetActId sets ActId field to given value. - - -### GetUserId - -`func (o *Run) GetUserId() string` - -GetUserId returns the UserId field if non-nil, zero value otherwise. - -### GetUserIdOk - -`func (o *Run) GetUserIdOk() (*string, bool)` - -GetUserIdOk returns a tuple with the UserId field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetUserId - -`func (o *Run) SetUserId(v string)` - -SetUserId sets UserId field to given value. - - -### GetActorTaskId - -`func (o *Run) GetActorTaskId() string` - -GetActorTaskId returns the ActorTaskId field if non-nil, zero value otherwise. - -### GetActorTaskIdOk - -`func (o *Run) GetActorTaskIdOk() (*string, bool)` - -GetActorTaskIdOk returns a tuple with the ActorTaskId field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetActorTaskId - -`func (o *Run) SetActorTaskId(v string)` - -SetActorTaskId sets ActorTaskId field to given value. - -### HasActorTaskId - -`func (o *Run) HasActorTaskId() bool` - -HasActorTaskId returns a boolean if a field has been set. - -### SetActorTaskIdNil - -`func (o *Run) SetActorTaskIdNil(b bool)` - - SetActorTaskIdNil sets the value for ActorTaskId to be an explicit nil - -### UnsetActorTaskId -`func (o *Run) UnsetActorTaskId()` - -UnsetActorTaskId ensures that no value is present for ActorTaskId, not even an explicit nil -### GetStartedAt - -`func (o *Run) GetStartedAt() time.Time` - -GetStartedAt returns the StartedAt field if non-nil, zero value otherwise. - -### GetStartedAtOk - -`func (o *Run) GetStartedAtOk() (*time.Time, bool)` - -GetStartedAtOk returns a tuple with the StartedAt field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetStartedAt - -`func (o *Run) SetStartedAt(v time.Time)` - -SetStartedAt sets StartedAt field to given value. - - -### GetFinishedAt - -`func (o *Run) GetFinishedAt() time.Time` - -GetFinishedAt returns the FinishedAt field if non-nil, zero value otherwise. - -### GetFinishedAtOk - -`func (o *Run) GetFinishedAtOk() (*time.Time, bool)` - -GetFinishedAtOk returns a tuple with the FinishedAt field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetFinishedAt - -`func (o *Run) SetFinishedAt(v time.Time)` - -SetFinishedAt sets FinishedAt field to given value. - -### HasFinishedAt - -`func (o *Run) HasFinishedAt() bool` - -HasFinishedAt returns a boolean if a field has been set. - -### SetFinishedAtNil - -`func (o *Run) SetFinishedAtNil(b bool)` - - SetFinishedAtNil sets the value for FinishedAt to be an explicit nil - -### UnsetFinishedAt -`func (o *Run) UnsetFinishedAt()` - -UnsetFinishedAt ensures that no value is present for FinishedAt, not even an explicit nil -### GetStatus - -`func (o *Run) GetStatus() ActorJobStatus` - -GetStatus returns the Status field if non-nil, zero value otherwise. - -### GetStatusOk - -`func (o *Run) GetStatusOk() (*ActorJobStatus, bool)` - -GetStatusOk returns a tuple with the Status field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetStatus - -`func (o *Run) SetStatus(v ActorJobStatus)` - -SetStatus sets Status field to given value. - - -### GetStatusMessage - -`func (o *Run) GetStatusMessage() string` - -GetStatusMessage returns the StatusMessage field if non-nil, zero value otherwise. - -### GetStatusMessageOk - -`func (o *Run) GetStatusMessageOk() (*string, bool)` - -GetStatusMessageOk returns a tuple with the StatusMessage field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetStatusMessage - -`func (o *Run) SetStatusMessage(v string)` - -SetStatusMessage sets StatusMessage field to given value. - -### HasStatusMessage - -`func (o *Run) HasStatusMessage() bool` - -HasStatusMessage returns a boolean if a field has been set. - -### SetStatusMessageNil - -`func (o *Run) SetStatusMessageNil(b bool)` - - SetStatusMessageNil sets the value for StatusMessage to be an explicit nil - -### UnsetStatusMessage -`func (o *Run) UnsetStatusMessage()` - -UnsetStatusMessage ensures that no value is present for StatusMessage, not even an explicit nil -### GetIsStatusMessageTerminal - -`func (o *Run) GetIsStatusMessageTerminal() bool` - -GetIsStatusMessageTerminal returns the IsStatusMessageTerminal field if non-nil, zero value otherwise. - -### GetIsStatusMessageTerminalOk - -`func (o *Run) GetIsStatusMessageTerminalOk() (*bool, bool)` - -GetIsStatusMessageTerminalOk returns a tuple with the IsStatusMessageTerminal field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetIsStatusMessageTerminal - -`func (o *Run) SetIsStatusMessageTerminal(v bool)` - -SetIsStatusMessageTerminal sets IsStatusMessageTerminal field to given value. - -### HasIsStatusMessageTerminal - -`func (o *Run) HasIsStatusMessageTerminal() bool` - -HasIsStatusMessageTerminal returns a boolean if a field has been set. - -### SetIsStatusMessageTerminalNil - -`func (o *Run) SetIsStatusMessageTerminalNil(b bool)` - - SetIsStatusMessageTerminalNil sets the value for IsStatusMessageTerminal to be an explicit nil - -### UnsetIsStatusMessageTerminal -`func (o *Run) UnsetIsStatusMessageTerminal()` - -UnsetIsStatusMessageTerminal ensures that no value is present for IsStatusMessageTerminal, not even an explicit nil -### GetMeta - -`func (o *Run) GetMeta() RunMeta` - -GetMeta returns the Meta field if non-nil, zero value otherwise. - -### GetMetaOk - -`func (o *Run) GetMetaOk() (*RunMeta, bool)` - -GetMetaOk returns a tuple with the Meta field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetMeta - -`func (o *Run) SetMeta(v RunMeta)` - -SetMeta sets Meta field to given value. - - -### GetPricingInfo - -`func (o *Run) GetPricingInfo() ActorRunPricingInfo` - -GetPricingInfo returns the PricingInfo field if non-nil, zero value otherwise. - -### GetPricingInfoOk - -`func (o *Run) GetPricingInfoOk() (*ActorRunPricingInfo, bool)` - -GetPricingInfoOk returns a tuple with the PricingInfo field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetPricingInfo - -`func (o *Run) SetPricingInfo(v ActorRunPricingInfo)` - -SetPricingInfo sets PricingInfo field to given value. - -### HasPricingInfo - -`func (o *Run) HasPricingInfo() bool` - -HasPricingInfo returns a boolean if a field has been set. - -### GetStats - -`func (o *Run) GetStats() RunStats` - -GetStats returns the Stats field if non-nil, zero value otherwise. - -### GetStatsOk - -`func (o *Run) GetStatsOk() (*RunStats, bool)` - -GetStatsOk returns a tuple with the Stats field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetStats - -`func (o *Run) SetStats(v RunStats)` - -SetStats sets Stats field to given value. - - -### GetChargedEventCounts - -`func (o *Run) GetChargedEventCounts() map[string]int32` - -GetChargedEventCounts returns the ChargedEventCounts field if non-nil, zero value otherwise. - -### GetChargedEventCountsOk - -`func (o *Run) GetChargedEventCountsOk() (*map[string]int32, bool)` - -GetChargedEventCountsOk returns a tuple with the ChargedEventCounts field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetChargedEventCounts - -`func (o *Run) SetChargedEventCounts(v map[string]int32)` - -SetChargedEventCounts sets ChargedEventCounts field to given value. - -### HasChargedEventCounts - -`func (o *Run) HasChargedEventCounts() bool` - -HasChargedEventCounts returns a boolean if a field has been set. - -### GetOptions - -`func (o *Run) GetOptions() RunOptions` - -GetOptions returns the Options field if non-nil, zero value otherwise. - -### GetOptionsOk - -`func (o *Run) GetOptionsOk() (*RunOptions, bool)` - -GetOptionsOk returns a tuple with the Options field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetOptions - -`func (o *Run) SetOptions(v RunOptions)` - -SetOptions sets Options field to given value. - - -### GetBuildId - -`func (o *Run) GetBuildId() string` - -GetBuildId returns the BuildId field if non-nil, zero value otherwise. - -### GetBuildIdOk - -`func (o *Run) GetBuildIdOk() (*string, bool)` - -GetBuildIdOk returns a tuple with the BuildId field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetBuildId - -`func (o *Run) SetBuildId(v string)` - -SetBuildId sets BuildId field to given value. - - -### GetExitCode - -`func (o *Run) GetExitCode() int32` - -GetExitCode returns the ExitCode field if non-nil, zero value otherwise. - -### GetExitCodeOk - -`func (o *Run) GetExitCodeOk() (*int32, bool)` - -GetExitCodeOk returns a tuple with the ExitCode field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetExitCode - -`func (o *Run) SetExitCode(v int32)` - -SetExitCode sets ExitCode field to given value. - -### HasExitCode - -`func (o *Run) HasExitCode() bool` - -HasExitCode returns a boolean if a field has been set. - -### SetExitCodeNil - -`func (o *Run) SetExitCodeNil(b bool)` - - SetExitCodeNil sets the value for ExitCode to be an explicit nil - -### UnsetExitCode -`func (o *Run) UnsetExitCode()` - -UnsetExitCode ensures that no value is present for ExitCode, not even an explicit nil -### GetGeneralAccess - -`func (o *Run) GetGeneralAccess() GeneralAccess` - -GetGeneralAccess returns the GeneralAccess field if non-nil, zero value otherwise. - -### GetGeneralAccessOk - -`func (o *Run) GetGeneralAccessOk() (*GeneralAccess, bool)` - -GetGeneralAccessOk returns a tuple with the GeneralAccess field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetGeneralAccess - -`func (o *Run) SetGeneralAccess(v GeneralAccess)` - -SetGeneralAccess sets GeneralAccess field to given value. - - -### GetDefaultKeyValueStoreId - -`func (o *Run) GetDefaultKeyValueStoreId() string` - -GetDefaultKeyValueStoreId returns the DefaultKeyValueStoreId field if non-nil, zero value otherwise. - -### GetDefaultKeyValueStoreIdOk - -`func (o *Run) GetDefaultKeyValueStoreIdOk() (*string, bool)` - -GetDefaultKeyValueStoreIdOk returns a tuple with the DefaultKeyValueStoreId field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetDefaultKeyValueStoreId - -`func (o *Run) SetDefaultKeyValueStoreId(v string)` - -SetDefaultKeyValueStoreId sets DefaultKeyValueStoreId field to given value. - - -### GetDefaultDatasetId - -`func (o *Run) GetDefaultDatasetId() string` - -GetDefaultDatasetId returns the DefaultDatasetId field if non-nil, zero value otherwise. - -### GetDefaultDatasetIdOk - -`func (o *Run) GetDefaultDatasetIdOk() (*string, bool)` - -GetDefaultDatasetIdOk returns a tuple with the DefaultDatasetId field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetDefaultDatasetId - -`func (o *Run) SetDefaultDatasetId(v string)` - -SetDefaultDatasetId sets DefaultDatasetId field to given value. - - -### GetDefaultRequestQueueId - -`func (o *Run) GetDefaultRequestQueueId() string` - -GetDefaultRequestQueueId returns the DefaultRequestQueueId field if non-nil, zero value otherwise. - -### GetDefaultRequestQueueIdOk - -`func (o *Run) GetDefaultRequestQueueIdOk() (*string, bool)` - -GetDefaultRequestQueueIdOk returns a tuple with the DefaultRequestQueueId field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetDefaultRequestQueueId - -`func (o *Run) SetDefaultRequestQueueId(v string)` - -SetDefaultRequestQueueId sets DefaultRequestQueueId field to given value. - - -### GetStorageIds - -`func (o *Run) GetStorageIds() RunStorageIds` - -GetStorageIds returns the StorageIds field if non-nil, zero value otherwise. - -### GetStorageIdsOk - -`func (o *Run) GetStorageIdsOk() (*RunStorageIds, bool)` - -GetStorageIdsOk returns a tuple with the StorageIds field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetStorageIds - -`func (o *Run) SetStorageIds(v RunStorageIds)` - -SetStorageIds sets StorageIds field to given value. - -### HasStorageIds - -`func (o *Run) HasStorageIds() bool` - -HasStorageIds returns a boolean if a field has been set. - -### GetBuildNumber - -`func (o *Run) GetBuildNumber() string` - -GetBuildNumber returns the BuildNumber field if non-nil, zero value otherwise. - -### GetBuildNumberOk - -`func (o *Run) GetBuildNumberOk() (*string, bool)` - -GetBuildNumberOk returns a tuple with the BuildNumber field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetBuildNumber - -`func (o *Run) SetBuildNumber(v string)` - -SetBuildNumber sets BuildNumber field to given value. - -### HasBuildNumber - -`func (o *Run) HasBuildNumber() bool` - -HasBuildNumber returns a boolean if a field has been set. - -### SetBuildNumberNil - -`func (o *Run) SetBuildNumberNil(b bool)` - - SetBuildNumberNil sets the value for BuildNumber to be an explicit nil - -### UnsetBuildNumber -`func (o *Run) UnsetBuildNumber()` - -UnsetBuildNumber ensures that no value is present for BuildNumber, not even an explicit nil -### GetContainerUrl - -`func (o *Run) GetContainerUrl() string` - -GetContainerUrl returns the ContainerUrl field if non-nil, zero value otherwise. - -### GetContainerUrlOk - -`func (o *Run) GetContainerUrlOk() (*string, bool)` - -GetContainerUrlOk returns a tuple with the ContainerUrl field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetContainerUrl - -`func (o *Run) SetContainerUrl(v string)` - -SetContainerUrl sets ContainerUrl field to given value. - -### HasContainerUrl - -`func (o *Run) HasContainerUrl() bool` - -HasContainerUrl returns a boolean if a field has been set. - -### GetIsContainerServerReady - -`func (o *Run) GetIsContainerServerReady() bool` - -GetIsContainerServerReady returns the IsContainerServerReady field if non-nil, zero value otherwise. - -### GetIsContainerServerReadyOk - -`func (o *Run) GetIsContainerServerReadyOk() (*bool, bool)` - -GetIsContainerServerReadyOk returns a tuple with the IsContainerServerReady field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetIsContainerServerReady - -`func (o *Run) SetIsContainerServerReady(v bool)` - -SetIsContainerServerReady sets IsContainerServerReady field to given value. - -### HasIsContainerServerReady - -`func (o *Run) HasIsContainerServerReady() bool` - -HasIsContainerServerReady returns a boolean if a field has been set. - -### SetIsContainerServerReadyNil - -`func (o *Run) SetIsContainerServerReadyNil(b bool)` - - SetIsContainerServerReadyNil sets the value for IsContainerServerReady to be an explicit nil - -### UnsetIsContainerServerReady -`func (o *Run) UnsetIsContainerServerReady()` - -UnsetIsContainerServerReady ensures that no value is present for IsContainerServerReady, not even an explicit nil -### GetGitBranchName - -`func (o *Run) GetGitBranchName() string` - -GetGitBranchName returns the GitBranchName field if non-nil, zero value otherwise. - -### GetGitBranchNameOk - -`func (o *Run) GetGitBranchNameOk() (*string, bool)` - -GetGitBranchNameOk returns a tuple with the GitBranchName field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetGitBranchName - -`func (o *Run) SetGitBranchName(v string)` - -SetGitBranchName sets GitBranchName field to given value. - -### HasGitBranchName - -`func (o *Run) HasGitBranchName() bool` - -HasGitBranchName returns a boolean if a field has been set. - -### SetGitBranchNameNil - -`func (o *Run) SetGitBranchNameNil(b bool)` - - SetGitBranchNameNil sets the value for GitBranchName to be an explicit nil - -### UnsetGitBranchName -`func (o *Run) UnsetGitBranchName()` - -UnsetGitBranchName ensures that no value is present for GitBranchName, not even an explicit nil -### GetUsage - -`func (o *Run) GetUsage() RunUsage` - -GetUsage returns the Usage field if non-nil, zero value otherwise. - -### GetUsageOk - -`func (o *Run) GetUsageOk() (*RunUsage, bool)` - -GetUsageOk returns a tuple with the Usage field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetUsage - -`func (o *Run) SetUsage(v RunUsage)` - -SetUsage sets Usage field to given value. - -### HasUsage - -`func (o *Run) HasUsage() bool` - -HasUsage returns a boolean if a field has been set. - -### SetUsageNil - -`func (o *Run) SetUsageNil(b bool)` - - SetUsageNil sets the value for Usage to be an explicit nil - -### UnsetUsage -`func (o *Run) UnsetUsage()` - -UnsetUsage ensures that no value is present for Usage, not even an explicit nil -### GetUsageTotalUsd - -`func (o *Run) GetUsageTotalUsd() float32` - -GetUsageTotalUsd returns the UsageTotalUsd field if non-nil, zero value otherwise. - -### GetUsageTotalUsdOk - -`func (o *Run) GetUsageTotalUsdOk() (*float32, bool)` - -GetUsageTotalUsdOk returns a tuple with the UsageTotalUsd field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetUsageTotalUsd - -`func (o *Run) SetUsageTotalUsd(v float32)` - -SetUsageTotalUsd sets UsageTotalUsd field to given value. - -### HasUsageTotalUsd - -`func (o *Run) HasUsageTotalUsd() bool` - -HasUsageTotalUsd returns a boolean if a field has been set. - -### SetUsageTotalUsdNil - -`func (o *Run) SetUsageTotalUsdNil(b bool)` - - SetUsageTotalUsdNil sets the value for UsageTotalUsd to be an explicit nil - -### UnsetUsageTotalUsd -`func (o *Run) UnsetUsageTotalUsd()` - -UnsetUsageTotalUsd ensures that no value is present for UsageTotalUsd, not even an explicit nil -### GetUsageUsd - -`func (o *Run) GetUsageUsd() RunUsageUsd` - -GetUsageUsd returns the UsageUsd field if non-nil, zero value otherwise. - -### GetUsageUsdOk - -`func (o *Run) GetUsageUsdOk() (*RunUsageUsd, bool)` - -GetUsageUsdOk returns a tuple with the UsageUsd field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetUsageUsd - -`func (o *Run) SetUsageUsd(v RunUsageUsd)` - -SetUsageUsd sets UsageUsd field to given value. - -### HasUsageUsd - -`func (o *Run) HasUsageUsd() bool` - -HasUsageUsd returns a boolean if a field has been set. - -### SetUsageUsdNil - -`func (o *Run) SetUsageUsdNil(b bool)` - - SetUsageUsdNil sets the value for UsageUsd to be an explicit nil - -### UnsetUsageUsd -`func (o *Run) UnsetUsageUsd()` - -UnsetUsageUsd ensures that no value is present for UsageUsd, not even an explicit nil -### GetMetamorphs - -`func (o *Run) GetMetamorphs() []Metamorph` - -GetMetamorphs returns the Metamorphs field if non-nil, zero value otherwise. - -### GetMetamorphsOk - -`func (o *Run) GetMetamorphsOk() (*[]Metamorph, bool)` - -GetMetamorphsOk returns a tuple with the Metamorphs field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetMetamorphs - -`func (o *Run) SetMetamorphs(v []Metamorph)` - -SetMetamorphs sets Metamorphs field to given value. - -### HasMetamorphs - -`func (o *Run) HasMetamorphs() bool` - -HasMetamorphs returns a boolean if a field has been set. - -### SetMetamorphsNil - -`func (o *Run) SetMetamorphsNil(b bool)` - - SetMetamorphsNil sets the value for Metamorphs to be an explicit nil - -### UnsetMetamorphs -`func (o *Run) UnsetMetamorphs()` - -UnsetMetamorphs ensures that no value is present for Metamorphs, not even an explicit nil -### GetPlatformUsageBillingModel - -`func (o *Run) GetPlatformUsageBillingModel() string` - -GetPlatformUsageBillingModel returns the PlatformUsageBillingModel field if non-nil, zero value otherwise. - -### GetPlatformUsageBillingModelOk - -`func (o *Run) GetPlatformUsageBillingModelOk() (*string, bool)` - -GetPlatformUsageBillingModelOk returns a tuple with the PlatformUsageBillingModel field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetPlatformUsageBillingModel - -`func (o *Run) SetPlatformUsageBillingModel(v string)` - -SetPlatformUsageBillingModel sets PlatformUsageBillingModel field to given value. - -### HasPlatformUsageBillingModel - -`func (o *Run) HasPlatformUsageBillingModel() bool` - -HasPlatformUsageBillingModel returns a boolean if a field has been set. - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/RunFailedErrorDetail.md b/docs/RunFailedErrorDetail.md deleted file mode 100644 index bb67e41..0000000 --- a/docs/RunFailedErrorDetail.md +++ /dev/null @@ -1,92 +0,0 @@ -# RunFailedErrorDetail - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Type** | Pointer to **interface{}** | | [optional] -**Message** | Pointer to **string** | Human-readable error message describing what went wrong. | [optional] - -## Methods - -### NewRunFailedErrorDetail - -`func NewRunFailedErrorDetail() *RunFailedErrorDetail` - -NewRunFailedErrorDetail instantiates a new RunFailedErrorDetail object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewRunFailedErrorDetailWithDefaults - -`func NewRunFailedErrorDetailWithDefaults() *RunFailedErrorDetail` - -NewRunFailedErrorDetailWithDefaults instantiates a new RunFailedErrorDetail object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetType - -`func (o *RunFailedErrorDetail) GetType() interface{}` - -GetType returns the Type field if non-nil, zero value otherwise. - -### GetTypeOk - -`func (o *RunFailedErrorDetail) GetTypeOk() (*interface{}, bool)` - -GetTypeOk returns a tuple with the Type field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetType - -`func (o *RunFailedErrorDetail) SetType(v interface{})` - -SetType sets Type field to given value. - -### HasType - -`func (o *RunFailedErrorDetail) HasType() bool` - -HasType returns a boolean if a field has been set. - -### SetTypeNil - -`func (o *RunFailedErrorDetail) SetTypeNil(b bool)` - - SetTypeNil sets the value for Type to be an explicit nil - -### UnsetType -`func (o *RunFailedErrorDetail) UnsetType()` - -UnsetType ensures that no value is present for Type, not even an explicit nil -### GetMessage - -`func (o *RunFailedErrorDetail) GetMessage() string` - -GetMessage returns the Message field if non-nil, zero value otherwise. - -### GetMessageOk - -`func (o *RunFailedErrorDetail) GetMessageOk() (*string, bool)` - -GetMessageOk returns a tuple with the Message field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetMessage - -`func (o *RunFailedErrorDetail) SetMessage(v string)` - -SetMessage sets Message field to given value. - -### HasMessage - -`func (o *RunFailedErrorDetail) HasMessage() bool` - -HasMessage returns a boolean if a field has been set. - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/RunMeta.md b/docs/RunMeta.md deleted file mode 100644 index 6b89815..0000000 --- a/docs/RunMeta.md +++ /dev/null @@ -1,195 +0,0 @@ -# RunMeta - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Origin** | [**RunOrigin**](RunOrigin.md) | | -**ClientIp** | Pointer to **NullableString** | IP address of the client that started the run. | [optional] -**UserAgent** | Pointer to **NullableString** | User agent of the client that started the run. | [optional] -**ScheduleId** | Pointer to **NullableString** | ID of the schedule that triggered the run. | [optional] -**ScheduledAt** | Pointer to **NullableTime** | Time when the run was scheduled. | [optional] - -## Methods - -### NewRunMeta - -`func NewRunMeta(origin RunOrigin, ) *RunMeta` - -NewRunMeta instantiates a new RunMeta object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewRunMetaWithDefaults - -`func NewRunMetaWithDefaults() *RunMeta` - -NewRunMetaWithDefaults instantiates a new RunMeta object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetOrigin - -`func (o *RunMeta) GetOrigin() RunOrigin` - -GetOrigin returns the Origin field if non-nil, zero value otherwise. - -### GetOriginOk - -`func (o *RunMeta) GetOriginOk() (*RunOrigin, bool)` - -GetOriginOk returns a tuple with the Origin field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetOrigin - -`func (o *RunMeta) SetOrigin(v RunOrigin)` - -SetOrigin sets Origin field to given value. - - -### GetClientIp - -`func (o *RunMeta) GetClientIp() string` - -GetClientIp returns the ClientIp field if non-nil, zero value otherwise. - -### GetClientIpOk - -`func (o *RunMeta) GetClientIpOk() (*string, bool)` - -GetClientIpOk returns a tuple with the ClientIp field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetClientIp - -`func (o *RunMeta) SetClientIp(v string)` - -SetClientIp sets ClientIp field to given value. - -### HasClientIp - -`func (o *RunMeta) HasClientIp() bool` - -HasClientIp returns a boolean if a field has been set. - -### SetClientIpNil - -`func (o *RunMeta) SetClientIpNil(b bool)` - - SetClientIpNil sets the value for ClientIp to be an explicit nil - -### UnsetClientIp -`func (o *RunMeta) UnsetClientIp()` - -UnsetClientIp ensures that no value is present for ClientIp, not even an explicit nil -### GetUserAgent - -`func (o *RunMeta) GetUserAgent() string` - -GetUserAgent returns the UserAgent field if non-nil, zero value otherwise. - -### GetUserAgentOk - -`func (o *RunMeta) GetUserAgentOk() (*string, bool)` - -GetUserAgentOk returns a tuple with the UserAgent field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetUserAgent - -`func (o *RunMeta) SetUserAgent(v string)` - -SetUserAgent sets UserAgent field to given value. - -### HasUserAgent - -`func (o *RunMeta) HasUserAgent() bool` - -HasUserAgent returns a boolean if a field has been set. - -### SetUserAgentNil - -`func (o *RunMeta) SetUserAgentNil(b bool)` - - SetUserAgentNil sets the value for UserAgent to be an explicit nil - -### UnsetUserAgent -`func (o *RunMeta) UnsetUserAgent()` - -UnsetUserAgent ensures that no value is present for UserAgent, not even an explicit nil -### GetScheduleId - -`func (o *RunMeta) GetScheduleId() string` - -GetScheduleId returns the ScheduleId field if non-nil, zero value otherwise. - -### GetScheduleIdOk - -`func (o *RunMeta) GetScheduleIdOk() (*string, bool)` - -GetScheduleIdOk returns a tuple with the ScheduleId field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetScheduleId - -`func (o *RunMeta) SetScheduleId(v string)` - -SetScheduleId sets ScheduleId field to given value. - -### HasScheduleId - -`func (o *RunMeta) HasScheduleId() bool` - -HasScheduleId returns a boolean if a field has been set. - -### SetScheduleIdNil - -`func (o *RunMeta) SetScheduleIdNil(b bool)` - - SetScheduleIdNil sets the value for ScheduleId to be an explicit nil - -### UnsetScheduleId -`func (o *RunMeta) UnsetScheduleId()` - -UnsetScheduleId ensures that no value is present for ScheduleId, not even an explicit nil -### GetScheduledAt - -`func (o *RunMeta) GetScheduledAt() time.Time` - -GetScheduledAt returns the ScheduledAt field if non-nil, zero value otherwise. - -### GetScheduledAtOk - -`func (o *RunMeta) GetScheduledAtOk() (*time.Time, bool)` - -GetScheduledAtOk returns a tuple with the ScheduledAt field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetScheduledAt - -`func (o *RunMeta) SetScheduledAt(v time.Time)` - -SetScheduledAt sets ScheduledAt field to given value. - -### HasScheduledAt - -`func (o *RunMeta) HasScheduledAt() bool` - -HasScheduledAt returns a boolean if a field has been set. - -### SetScheduledAtNil - -`func (o *RunMeta) SetScheduledAtNil(b bool)` - - SetScheduledAtNil sets the value for ScheduledAt to be an explicit nil - -### UnsetScheduledAt -`func (o *RunMeta) UnsetScheduledAt()` - -UnsetScheduledAt ensures that no value is present for ScheduledAt, not even an explicit nil - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/RunOptions.md b/docs/RunOptions.md deleted file mode 100644 index 2d47cdf..0000000 --- a/docs/RunOptions.md +++ /dev/null @@ -1,176 +0,0 @@ -# RunOptions - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Build** | **string** | | -**TimeoutSecs** | **int32** | | -**MemoryMbytes** | **int32** | | -**DiskMbytes** | **int32** | | -**MaxItems** | Pointer to **NullableInt32** | | [optional] -**MaxTotalChargeUsd** | Pointer to **float32** | | [optional] - -## Methods - -### NewRunOptions - -`func NewRunOptions(build string, timeoutSecs int32, memoryMbytes int32, diskMbytes int32, ) *RunOptions` - -NewRunOptions instantiates a new RunOptions object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewRunOptionsWithDefaults - -`func NewRunOptionsWithDefaults() *RunOptions` - -NewRunOptionsWithDefaults instantiates a new RunOptions object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetBuild - -`func (o *RunOptions) GetBuild() string` - -GetBuild returns the Build field if non-nil, zero value otherwise. - -### GetBuildOk - -`func (o *RunOptions) GetBuildOk() (*string, bool)` - -GetBuildOk returns a tuple with the Build field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetBuild - -`func (o *RunOptions) SetBuild(v string)` - -SetBuild sets Build field to given value. - - -### GetTimeoutSecs - -`func (o *RunOptions) GetTimeoutSecs() int32` - -GetTimeoutSecs returns the TimeoutSecs field if non-nil, zero value otherwise. - -### GetTimeoutSecsOk - -`func (o *RunOptions) GetTimeoutSecsOk() (*int32, bool)` - -GetTimeoutSecsOk returns a tuple with the TimeoutSecs field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetTimeoutSecs - -`func (o *RunOptions) SetTimeoutSecs(v int32)` - -SetTimeoutSecs sets TimeoutSecs field to given value. - - -### GetMemoryMbytes - -`func (o *RunOptions) GetMemoryMbytes() int32` - -GetMemoryMbytes returns the MemoryMbytes field if non-nil, zero value otherwise. - -### GetMemoryMbytesOk - -`func (o *RunOptions) GetMemoryMbytesOk() (*int32, bool)` - -GetMemoryMbytesOk returns a tuple with the MemoryMbytes field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetMemoryMbytes - -`func (o *RunOptions) SetMemoryMbytes(v int32)` - -SetMemoryMbytes sets MemoryMbytes field to given value. - - -### GetDiskMbytes - -`func (o *RunOptions) GetDiskMbytes() int32` - -GetDiskMbytes returns the DiskMbytes field if non-nil, zero value otherwise. - -### GetDiskMbytesOk - -`func (o *RunOptions) GetDiskMbytesOk() (*int32, bool)` - -GetDiskMbytesOk returns a tuple with the DiskMbytes field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetDiskMbytes - -`func (o *RunOptions) SetDiskMbytes(v int32)` - -SetDiskMbytes sets DiskMbytes field to given value. - - -### GetMaxItems - -`func (o *RunOptions) GetMaxItems() int32` - -GetMaxItems returns the MaxItems field if non-nil, zero value otherwise. - -### GetMaxItemsOk - -`func (o *RunOptions) GetMaxItemsOk() (*int32, bool)` - -GetMaxItemsOk returns a tuple with the MaxItems field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetMaxItems - -`func (o *RunOptions) SetMaxItems(v int32)` - -SetMaxItems sets MaxItems field to given value. - -### HasMaxItems - -`func (o *RunOptions) HasMaxItems() bool` - -HasMaxItems returns a boolean if a field has been set. - -### SetMaxItemsNil - -`func (o *RunOptions) SetMaxItemsNil(b bool)` - - SetMaxItemsNil sets the value for MaxItems to be an explicit nil - -### UnsetMaxItems -`func (o *RunOptions) UnsetMaxItems()` - -UnsetMaxItems ensures that no value is present for MaxItems, not even an explicit nil -### GetMaxTotalChargeUsd - -`func (o *RunOptions) GetMaxTotalChargeUsd() float32` - -GetMaxTotalChargeUsd returns the MaxTotalChargeUsd field if non-nil, zero value otherwise. - -### GetMaxTotalChargeUsdOk - -`func (o *RunOptions) GetMaxTotalChargeUsdOk() (*float32, bool)` - -GetMaxTotalChargeUsdOk returns a tuple with the MaxTotalChargeUsd field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetMaxTotalChargeUsd - -`func (o *RunOptions) SetMaxTotalChargeUsd(v float32)` - -SetMaxTotalChargeUsd sets MaxTotalChargeUsd field to given value. - -### HasMaxTotalChargeUsd - -`func (o *RunOptions) HasMaxTotalChargeUsd() bool` - -HasMaxTotalChargeUsd returns a boolean if a field has been set. - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/RunOrigin.md b/docs/RunOrigin.md deleted file mode 100644 index d4c3839..0000000 --- a/docs/RunOrigin.md +++ /dev/null @@ -1,29 +0,0 @@ -# RunOrigin - -## Enum - - -* `DEVELOPMENT` (value: `"DEVELOPMENT"`) - -* `WEB` (value: `"WEB"`) - -* `API` (value: `"API"`) - -* `SCHEDULER` (value: `"SCHEDULER"`) - -* `TEST` (value: `"TEST"`) - -* `WEBHOOK` (value: `"WEBHOOK"`) - -* `ACTOR` (value: `"ACTOR"`) - -* `CLI` (value: `"CLI"`) - -* `CI` (value: `"CI"`) - -* `STANDBY` (value: `"STANDBY"`) - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/RunResponse.md b/docs/RunResponse.md deleted file mode 100644 index 928d27d..0000000 --- a/docs/RunResponse.md +++ /dev/null @@ -1,51 +0,0 @@ -# RunResponse - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Data** | [**Run**](Run.md) | | - -## Methods - -### NewRunResponse - -`func NewRunResponse(data Run, ) *RunResponse` - -NewRunResponse instantiates a new RunResponse object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewRunResponseWithDefaults - -`func NewRunResponseWithDefaults() *RunResponse` - -NewRunResponseWithDefaults instantiates a new RunResponse object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetData - -`func (o *RunResponse) GetData() Run` - -GetData returns the Data field if non-nil, zero value otherwise. - -### GetDataOk - -`func (o *RunResponse) GetDataOk() (*Run, bool)` - -GetDataOk returns a tuple with the Data field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetData - -`func (o *RunResponse) SetData(v Run)` - -SetData sets Data field to given value. - - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/RunShort.md b/docs/RunShort.md deleted file mode 100644 index 21e6012..0000000 --- a/docs/RunShort.md +++ /dev/null @@ -1,390 +0,0 @@ -# RunShort - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Id** | **string** | | -**ActId** | **string** | | -**UserId** | Pointer to **string** | | [optional] -**ActorTaskId** | Pointer to **NullableString** | | [optional] -**Status** | [**ActorJobStatus**](ActorJobStatus.md) | | -**StartedAt** | **time.Time** | | -**FinishedAt** | Pointer to **NullableTime** | | [optional] -**BuildId** | **string** | | -**BuildNumber** | Pointer to **string** | | [optional] -**BuildNumberInt** | Pointer to **int32** | | [optional] -**Meta** | [**RunMeta**](RunMeta.md) | | -**UsageTotalUsd** | **float32** | | -**DefaultKeyValueStoreId** | **string** | | -**DefaultDatasetId** | **string** | | -**DefaultRequestQueueId** | **string** | | - -## Methods - -### NewRunShort - -`func NewRunShort(id string, actId string, status ActorJobStatus, startedAt time.Time, buildId string, meta RunMeta, usageTotalUsd float32, defaultKeyValueStoreId string, defaultDatasetId string, defaultRequestQueueId string, ) *RunShort` - -NewRunShort instantiates a new RunShort object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewRunShortWithDefaults - -`func NewRunShortWithDefaults() *RunShort` - -NewRunShortWithDefaults instantiates a new RunShort object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetId - -`func (o *RunShort) GetId() string` - -GetId returns the Id field if non-nil, zero value otherwise. - -### GetIdOk - -`func (o *RunShort) GetIdOk() (*string, bool)` - -GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetId - -`func (o *RunShort) SetId(v string)` - -SetId sets Id field to given value. - - -### GetActId - -`func (o *RunShort) GetActId() string` - -GetActId returns the ActId field if non-nil, zero value otherwise. - -### GetActIdOk - -`func (o *RunShort) GetActIdOk() (*string, bool)` - -GetActIdOk returns a tuple with the ActId field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetActId - -`func (o *RunShort) SetActId(v string)` - -SetActId sets ActId field to given value. - - -### GetUserId - -`func (o *RunShort) GetUserId() string` - -GetUserId returns the UserId field if non-nil, zero value otherwise. - -### GetUserIdOk - -`func (o *RunShort) GetUserIdOk() (*string, bool)` - -GetUserIdOk returns a tuple with the UserId field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetUserId - -`func (o *RunShort) SetUserId(v string)` - -SetUserId sets UserId field to given value. - -### HasUserId - -`func (o *RunShort) HasUserId() bool` - -HasUserId returns a boolean if a field has been set. - -### GetActorTaskId - -`func (o *RunShort) GetActorTaskId() string` - -GetActorTaskId returns the ActorTaskId field if non-nil, zero value otherwise. - -### GetActorTaskIdOk - -`func (o *RunShort) GetActorTaskIdOk() (*string, bool)` - -GetActorTaskIdOk returns a tuple with the ActorTaskId field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetActorTaskId - -`func (o *RunShort) SetActorTaskId(v string)` - -SetActorTaskId sets ActorTaskId field to given value. - -### HasActorTaskId - -`func (o *RunShort) HasActorTaskId() bool` - -HasActorTaskId returns a boolean if a field has been set. - -### SetActorTaskIdNil - -`func (o *RunShort) SetActorTaskIdNil(b bool)` - - SetActorTaskIdNil sets the value for ActorTaskId to be an explicit nil - -### UnsetActorTaskId -`func (o *RunShort) UnsetActorTaskId()` - -UnsetActorTaskId ensures that no value is present for ActorTaskId, not even an explicit nil -### GetStatus - -`func (o *RunShort) GetStatus() ActorJobStatus` - -GetStatus returns the Status field if non-nil, zero value otherwise. - -### GetStatusOk - -`func (o *RunShort) GetStatusOk() (*ActorJobStatus, bool)` - -GetStatusOk returns a tuple with the Status field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetStatus - -`func (o *RunShort) SetStatus(v ActorJobStatus)` - -SetStatus sets Status field to given value. - - -### GetStartedAt - -`func (o *RunShort) GetStartedAt() time.Time` - -GetStartedAt returns the StartedAt field if non-nil, zero value otherwise. - -### GetStartedAtOk - -`func (o *RunShort) GetStartedAtOk() (*time.Time, bool)` - -GetStartedAtOk returns a tuple with the StartedAt field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetStartedAt - -`func (o *RunShort) SetStartedAt(v time.Time)` - -SetStartedAt sets StartedAt field to given value. - - -### GetFinishedAt - -`func (o *RunShort) GetFinishedAt() time.Time` - -GetFinishedAt returns the FinishedAt field if non-nil, zero value otherwise. - -### GetFinishedAtOk - -`func (o *RunShort) GetFinishedAtOk() (*time.Time, bool)` - -GetFinishedAtOk returns a tuple with the FinishedAt field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetFinishedAt - -`func (o *RunShort) SetFinishedAt(v time.Time)` - -SetFinishedAt sets FinishedAt field to given value. - -### HasFinishedAt - -`func (o *RunShort) HasFinishedAt() bool` - -HasFinishedAt returns a boolean if a field has been set. - -### SetFinishedAtNil - -`func (o *RunShort) SetFinishedAtNil(b bool)` - - SetFinishedAtNil sets the value for FinishedAt to be an explicit nil - -### UnsetFinishedAt -`func (o *RunShort) UnsetFinishedAt()` - -UnsetFinishedAt ensures that no value is present for FinishedAt, not even an explicit nil -### GetBuildId - -`func (o *RunShort) GetBuildId() string` - -GetBuildId returns the BuildId field if non-nil, zero value otherwise. - -### GetBuildIdOk - -`func (o *RunShort) GetBuildIdOk() (*string, bool)` - -GetBuildIdOk returns a tuple with the BuildId field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetBuildId - -`func (o *RunShort) SetBuildId(v string)` - -SetBuildId sets BuildId field to given value. - - -### GetBuildNumber - -`func (o *RunShort) GetBuildNumber() string` - -GetBuildNumber returns the BuildNumber field if non-nil, zero value otherwise. - -### GetBuildNumberOk - -`func (o *RunShort) GetBuildNumberOk() (*string, bool)` - -GetBuildNumberOk returns a tuple with the BuildNumber field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetBuildNumber - -`func (o *RunShort) SetBuildNumber(v string)` - -SetBuildNumber sets BuildNumber field to given value. - -### HasBuildNumber - -`func (o *RunShort) HasBuildNumber() bool` - -HasBuildNumber returns a boolean if a field has been set. - -### GetBuildNumberInt - -`func (o *RunShort) GetBuildNumberInt() int32` - -GetBuildNumberInt returns the BuildNumberInt field if non-nil, zero value otherwise. - -### GetBuildNumberIntOk - -`func (o *RunShort) GetBuildNumberIntOk() (*int32, bool)` - -GetBuildNumberIntOk returns a tuple with the BuildNumberInt field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetBuildNumberInt - -`func (o *RunShort) SetBuildNumberInt(v int32)` - -SetBuildNumberInt sets BuildNumberInt field to given value. - -### HasBuildNumberInt - -`func (o *RunShort) HasBuildNumberInt() bool` - -HasBuildNumberInt returns a boolean if a field has been set. - -### GetMeta - -`func (o *RunShort) GetMeta() RunMeta` - -GetMeta returns the Meta field if non-nil, zero value otherwise. - -### GetMetaOk - -`func (o *RunShort) GetMetaOk() (*RunMeta, bool)` - -GetMetaOk returns a tuple with the Meta field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetMeta - -`func (o *RunShort) SetMeta(v RunMeta)` - -SetMeta sets Meta field to given value. - - -### GetUsageTotalUsd - -`func (o *RunShort) GetUsageTotalUsd() float32` - -GetUsageTotalUsd returns the UsageTotalUsd field if non-nil, zero value otherwise. - -### GetUsageTotalUsdOk - -`func (o *RunShort) GetUsageTotalUsdOk() (*float32, bool)` - -GetUsageTotalUsdOk returns a tuple with the UsageTotalUsd field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetUsageTotalUsd - -`func (o *RunShort) SetUsageTotalUsd(v float32)` - -SetUsageTotalUsd sets UsageTotalUsd field to given value. - - -### GetDefaultKeyValueStoreId - -`func (o *RunShort) GetDefaultKeyValueStoreId() string` - -GetDefaultKeyValueStoreId returns the DefaultKeyValueStoreId field if non-nil, zero value otherwise. - -### GetDefaultKeyValueStoreIdOk - -`func (o *RunShort) GetDefaultKeyValueStoreIdOk() (*string, bool)` - -GetDefaultKeyValueStoreIdOk returns a tuple with the DefaultKeyValueStoreId field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetDefaultKeyValueStoreId - -`func (o *RunShort) SetDefaultKeyValueStoreId(v string)` - -SetDefaultKeyValueStoreId sets DefaultKeyValueStoreId field to given value. - - -### GetDefaultDatasetId - -`func (o *RunShort) GetDefaultDatasetId() string` - -GetDefaultDatasetId returns the DefaultDatasetId field if non-nil, zero value otherwise. - -### GetDefaultDatasetIdOk - -`func (o *RunShort) GetDefaultDatasetIdOk() (*string, bool)` - -GetDefaultDatasetIdOk returns a tuple with the DefaultDatasetId field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetDefaultDatasetId - -`func (o *RunShort) SetDefaultDatasetId(v string)` - -SetDefaultDatasetId sets DefaultDatasetId field to given value. - - -### GetDefaultRequestQueueId - -`func (o *RunShort) GetDefaultRequestQueueId() string` - -GetDefaultRequestQueueId returns the DefaultRequestQueueId field if non-nil, zero value otherwise. - -### GetDefaultRequestQueueIdOk - -`func (o *RunShort) GetDefaultRequestQueueIdOk() (*string, bool)` - -GetDefaultRequestQueueIdOk returns a tuple with the DefaultRequestQueueId field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetDefaultRequestQueueId - -`func (o *RunShort) SetDefaultRequestQueueId(v string)` - -SetDefaultRequestQueueId sets DefaultRequestQueueId field to given value. - - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/RunStats.md b/docs/RunStats.md deleted file mode 100644 index 52aae97..0000000 --- a/docs/RunStats.md +++ /dev/null @@ -1,467 +0,0 @@ -# RunStats - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**InputBodyLen** | Pointer to **NullableInt32** | | [optional] -**MigrationCount** | Pointer to **int32** | | [optional] -**RebootCount** | Pointer to **int32** | | [optional] -**RestartCount** | **int32** | | -**ResurrectCount** | **int32** | | -**MemAvgBytes** | Pointer to **float32** | | [optional] -**MemMaxBytes** | Pointer to **int32** | | [optional] -**MemCurrentBytes** | Pointer to **int32** | | [optional] -**CpuAvgUsage** | Pointer to **float32** | | [optional] -**CpuMaxUsage** | Pointer to **float32** | | [optional] -**CpuCurrentUsage** | Pointer to **float32** | | [optional] -**NetRxBytes** | Pointer to **int32** | | [optional] -**NetTxBytes** | Pointer to **int32** | | [optional] -**DurationMillis** | Pointer to **int32** | | [optional] -**RunTimeSecs** | Pointer to **float32** | | [optional] -**Metamorph** | Pointer to **int32** | | [optional] -**ComputeUnits** | **float32** | | - -## Methods - -### NewRunStats - -`func NewRunStats(restartCount int32, resurrectCount int32, computeUnits float32, ) *RunStats` - -NewRunStats instantiates a new RunStats object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewRunStatsWithDefaults - -`func NewRunStatsWithDefaults() *RunStats` - -NewRunStatsWithDefaults instantiates a new RunStats object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetInputBodyLen - -`func (o *RunStats) GetInputBodyLen() int32` - -GetInputBodyLen returns the InputBodyLen field if non-nil, zero value otherwise. - -### GetInputBodyLenOk - -`func (o *RunStats) GetInputBodyLenOk() (*int32, bool)` - -GetInputBodyLenOk returns a tuple with the InputBodyLen field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetInputBodyLen - -`func (o *RunStats) SetInputBodyLen(v int32)` - -SetInputBodyLen sets InputBodyLen field to given value. - -### HasInputBodyLen - -`func (o *RunStats) HasInputBodyLen() bool` - -HasInputBodyLen returns a boolean if a field has been set. - -### SetInputBodyLenNil - -`func (o *RunStats) SetInputBodyLenNil(b bool)` - - SetInputBodyLenNil sets the value for InputBodyLen to be an explicit nil - -### UnsetInputBodyLen -`func (o *RunStats) UnsetInputBodyLen()` - -UnsetInputBodyLen ensures that no value is present for InputBodyLen, not even an explicit nil -### GetMigrationCount - -`func (o *RunStats) GetMigrationCount() int32` - -GetMigrationCount returns the MigrationCount field if non-nil, zero value otherwise. - -### GetMigrationCountOk - -`func (o *RunStats) GetMigrationCountOk() (*int32, bool)` - -GetMigrationCountOk returns a tuple with the MigrationCount field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetMigrationCount - -`func (o *RunStats) SetMigrationCount(v int32)` - -SetMigrationCount sets MigrationCount field to given value. - -### HasMigrationCount - -`func (o *RunStats) HasMigrationCount() bool` - -HasMigrationCount returns a boolean if a field has been set. - -### GetRebootCount - -`func (o *RunStats) GetRebootCount() int32` - -GetRebootCount returns the RebootCount field if non-nil, zero value otherwise. - -### GetRebootCountOk - -`func (o *RunStats) GetRebootCountOk() (*int32, bool)` - -GetRebootCountOk returns a tuple with the RebootCount field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetRebootCount - -`func (o *RunStats) SetRebootCount(v int32)` - -SetRebootCount sets RebootCount field to given value. - -### HasRebootCount - -`func (o *RunStats) HasRebootCount() bool` - -HasRebootCount returns a boolean if a field has been set. - -### GetRestartCount - -`func (o *RunStats) GetRestartCount() int32` - -GetRestartCount returns the RestartCount field if non-nil, zero value otherwise. - -### GetRestartCountOk - -`func (o *RunStats) GetRestartCountOk() (*int32, bool)` - -GetRestartCountOk returns a tuple with the RestartCount field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetRestartCount - -`func (o *RunStats) SetRestartCount(v int32)` - -SetRestartCount sets RestartCount field to given value. - - -### GetResurrectCount - -`func (o *RunStats) GetResurrectCount() int32` - -GetResurrectCount returns the ResurrectCount field if non-nil, zero value otherwise. - -### GetResurrectCountOk - -`func (o *RunStats) GetResurrectCountOk() (*int32, bool)` - -GetResurrectCountOk returns a tuple with the ResurrectCount field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetResurrectCount - -`func (o *RunStats) SetResurrectCount(v int32)` - -SetResurrectCount sets ResurrectCount field to given value. - - -### GetMemAvgBytes - -`func (o *RunStats) GetMemAvgBytes() float32` - -GetMemAvgBytes returns the MemAvgBytes field if non-nil, zero value otherwise. - -### GetMemAvgBytesOk - -`func (o *RunStats) GetMemAvgBytesOk() (*float32, bool)` - -GetMemAvgBytesOk returns a tuple with the MemAvgBytes field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetMemAvgBytes - -`func (o *RunStats) SetMemAvgBytes(v float32)` - -SetMemAvgBytes sets MemAvgBytes field to given value. - -### HasMemAvgBytes - -`func (o *RunStats) HasMemAvgBytes() bool` - -HasMemAvgBytes returns a boolean if a field has been set. - -### GetMemMaxBytes - -`func (o *RunStats) GetMemMaxBytes() int32` - -GetMemMaxBytes returns the MemMaxBytes field if non-nil, zero value otherwise. - -### GetMemMaxBytesOk - -`func (o *RunStats) GetMemMaxBytesOk() (*int32, bool)` - -GetMemMaxBytesOk returns a tuple with the MemMaxBytes field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetMemMaxBytes - -`func (o *RunStats) SetMemMaxBytes(v int32)` - -SetMemMaxBytes sets MemMaxBytes field to given value. - -### HasMemMaxBytes - -`func (o *RunStats) HasMemMaxBytes() bool` - -HasMemMaxBytes returns a boolean if a field has been set. - -### GetMemCurrentBytes - -`func (o *RunStats) GetMemCurrentBytes() int32` - -GetMemCurrentBytes returns the MemCurrentBytes field if non-nil, zero value otherwise. - -### GetMemCurrentBytesOk - -`func (o *RunStats) GetMemCurrentBytesOk() (*int32, bool)` - -GetMemCurrentBytesOk returns a tuple with the MemCurrentBytes field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetMemCurrentBytes - -`func (o *RunStats) SetMemCurrentBytes(v int32)` - -SetMemCurrentBytes sets MemCurrentBytes field to given value. - -### HasMemCurrentBytes - -`func (o *RunStats) HasMemCurrentBytes() bool` - -HasMemCurrentBytes returns a boolean if a field has been set. - -### GetCpuAvgUsage - -`func (o *RunStats) GetCpuAvgUsage() float32` - -GetCpuAvgUsage returns the CpuAvgUsage field if non-nil, zero value otherwise. - -### GetCpuAvgUsageOk - -`func (o *RunStats) GetCpuAvgUsageOk() (*float32, bool)` - -GetCpuAvgUsageOk returns a tuple with the CpuAvgUsage field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetCpuAvgUsage - -`func (o *RunStats) SetCpuAvgUsage(v float32)` - -SetCpuAvgUsage sets CpuAvgUsage field to given value. - -### HasCpuAvgUsage - -`func (o *RunStats) HasCpuAvgUsage() bool` - -HasCpuAvgUsage returns a boolean if a field has been set. - -### GetCpuMaxUsage - -`func (o *RunStats) GetCpuMaxUsage() float32` - -GetCpuMaxUsage returns the CpuMaxUsage field if non-nil, zero value otherwise. - -### GetCpuMaxUsageOk - -`func (o *RunStats) GetCpuMaxUsageOk() (*float32, bool)` - -GetCpuMaxUsageOk returns a tuple with the CpuMaxUsage field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetCpuMaxUsage - -`func (o *RunStats) SetCpuMaxUsage(v float32)` - -SetCpuMaxUsage sets CpuMaxUsage field to given value. - -### HasCpuMaxUsage - -`func (o *RunStats) HasCpuMaxUsage() bool` - -HasCpuMaxUsage returns a boolean if a field has been set. - -### GetCpuCurrentUsage - -`func (o *RunStats) GetCpuCurrentUsage() float32` - -GetCpuCurrentUsage returns the CpuCurrentUsage field if non-nil, zero value otherwise. - -### GetCpuCurrentUsageOk - -`func (o *RunStats) GetCpuCurrentUsageOk() (*float32, bool)` - -GetCpuCurrentUsageOk returns a tuple with the CpuCurrentUsage field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetCpuCurrentUsage - -`func (o *RunStats) SetCpuCurrentUsage(v float32)` - -SetCpuCurrentUsage sets CpuCurrentUsage field to given value. - -### HasCpuCurrentUsage - -`func (o *RunStats) HasCpuCurrentUsage() bool` - -HasCpuCurrentUsage returns a boolean if a field has been set. - -### GetNetRxBytes - -`func (o *RunStats) GetNetRxBytes() int32` - -GetNetRxBytes returns the NetRxBytes field if non-nil, zero value otherwise. - -### GetNetRxBytesOk - -`func (o *RunStats) GetNetRxBytesOk() (*int32, bool)` - -GetNetRxBytesOk returns a tuple with the NetRxBytes field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetNetRxBytes - -`func (o *RunStats) SetNetRxBytes(v int32)` - -SetNetRxBytes sets NetRxBytes field to given value. - -### HasNetRxBytes - -`func (o *RunStats) HasNetRxBytes() bool` - -HasNetRxBytes returns a boolean if a field has been set. - -### GetNetTxBytes - -`func (o *RunStats) GetNetTxBytes() int32` - -GetNetTxBytes returns the NetTxBytes field if non-nil, zero value otherwise. - -### GetNetTxBytesOk - -`func (o *RunStats) GetNetTxBytesOk() (*int32, bool)` - -GetNetTxBytesOk returns a tuple with the NetTxBytes field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetNetTxBytes - -`func (o *RunStats) SetNetTxBytes(v int32)` - -SetNetTxBytes sets NetTxBytes field to given value. - -### HasNetTxBytes - -`func (o *RunStats) HasNetTxBytes() bool` - -HasNetTxBytes returns a boolean if a field has been set. - -### GetDurationMillis - -`func (o *RunStats) GetDurationMillis() int32` - -GetDurationMillis returns the DurationMillis field if non-nil, zero value otherwise. - -### GetDurationMillisOk - -`func (o *RunStats) GetDurationMillisOk() (*int32, bool)` - -GetDurationMillisOk returns a tuple with the DurationMillis field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetDurationMillis - -`func (o *RunStats) SetDurationMillis(v int32)` - -SetDurationMillis sets DurationMillis field to given value. - -### HasDurationMillis - -`func (o *RunStats) HasDurationMillis() bool` - -HasDurationMillis returns a boolean if a field has been set. - -### GetRunTimeSecs - -`func (o *RunStats) GetRunTimeSecs() float32` - -GetRunTimeSecs returns the RunTimeSecs field if non-nil, zero value otherwise. - -### GetRunTimeSecsOk - -`func (o *RunStats) GetRunTimeSecsOk() (*float32, bool)` - -GetRunTimeSecsOk returns a tuple with the RunTimeSecs field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetRunTimeSecs - -`func (o *RunStats) SetRunTimeSecs(v float32)` - -SetRunTimeSecs sets RunTimeSecs field to given value. - -### HasRunTimeSecs - -`func (o *RunStats) HasRunTimeSecs() bool` - -HasRunTimeSecs returns a boolean if a field has been set. - -### GetMetamorph - -`func (o *RunStats) GetMetamorph() int32` - -GetMetamorph returns the Metamorph field if non-nil, zero value otherwise. - -### GetMetamorphOk - -`func (o *RunStats) GetMetamorphOk() (*int32, bool)` - -GetMetamorphOk returns a tuple with the Metamorph field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetMetamorph - -`func (o *RunStats) SetMetamorph(v int32)` - -SetMetamorph sets Metamorph field to given value. - -### HasMetamorph - -`func (o *RunStats) HasMetamorph() bool` - -HasMetamorph returns a boolean if a field has been set. - -### GetComputeUnits - -`func (o *RunStats) GetComputeUnits() float32` - -GetComputeUnits returns the ComputeUnits field if non-nil, zero value otherwise. - -### GetComputeUnitsOk - -`func (o *RunStats) GetComputeUnitsOk() (*float32, bool)` - -GetComputeUnitsOk returns a tuple with the ComputeUnits field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetComputeUnits - -`func (o *RunStats) SetComputeUnits(v float32)` - -SetComputeUnits sets ComputeUnits field to given value. - - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/RunStorageIds.md b/docs/RunStorageIds.md deleted file mode 100644 index fc234cf..0000000 --- a/docs/RunStorageIds.md +++ /dev/null @@ -1,108 +0,0 @@ -# RunStorageIds - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Datasets** | Pointer to [**RunStorageIdsDatasets**](RunStorageIdsDatasets.md) | | [optional] -**KeyValueStores** | Pointer to [**RunStorageIdsDatasets**](RunStorageIdsDatasets.md) | | [optional] -**RequestQueues** | Pointer to [**RunStorageIdsDatasets**](RunStorageIdsDatasets.md) | | [optional] - -## Methods - -### NewRunStorageIds - -`func NewRunStorageIds() *RunStorageIds` - -NewRunStorageIds instantiates a new RunStorageIds object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewRunStorageIdsWithDefaults - -`func NewRunStorageIdsWithDefaults() *RunStorageIds` - -NewRunStorageIdsWithDefaults instantiates a new RunStorageIds object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetDatasets - -`func (o *RunStorageIds) GetDatasets() RunStorageIdsDatasets` - -GetDatasets returns the Datasets field if non-nil, zero value otherwise. - -### GetDatasetsOk - -`func (o *RunStorageIds) GetDatasetsOk() (*RunStorageIdsDatasets, bool)` - -GetDatasetsOk returns a tuple with the Datasets field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetDatasets - -`func (o *RunStorageIds) SetDatasets(v RunStorageIdsDatasets)` - -SetDatasets sets Datasets field to given value. - -### HasDatasets - -`func (o *RunStorageIds) HasDatasets() bool` - -HasDatasets returns a boolean if a field has been set. - -### GetKeyValueStores - -`func (o *RunStorageIds) GetKeyValueStores() RunStorageIdsDatasets` - -GetKeyValueStores returns the KeyValueStores field if non-nil, zero value otherwise. - -### GetKeyValueStoresOk - -`func (o *RunStorageIds) GetKeyValueStoresOk() (*RunStorageIdsDatasets, bool)` - -GetKeyValueStoresOk returns a tuple with the KeyValueStores field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetKeyValueStores - -`func (o *RunStorageIds) SetKeyValueStores(v RunStorageIdsDatasets)` - -SetKeyValueStores sets KeyValueStores field to given value. - -### HasKeyValueStores - -`func (o *RunStorageIds) HasKeyValueStores() bool` - -HasKeyValueStores returns a boolean if a field has been set. - -### GetRequestQueues - -`func (o *RunStorageIds) GetRequestQueues() RunStorageIdsDatasets` - -GetRequestQueues returns the RequestQueues field if non-nil, zero value otherwise. - -### GetRequestQueuesOk - -`func (o *RunStorageIds) GetRequestQueuesOk() (*RunStorageIdsDatasets, bool)` - -GetRequestQueuesOk returns a tuple with the RequestQueues field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetRequestQueues - -`func (o *RunStorageIds) SetRequestQueues(v RunStorageIdsDatasets)` - -SetRequestQueues sets RequestQueues field to given value. - -### HasRequestQueues - -`func (o *RunStorageIds) HasRequestQueues() bool` - -HasRequestQueues returns a boolean if a field has been set. - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/RunStorageIdsDatasets.md b/docs/RunStorageIdsDatasets.md deleted file mode 100644 index 30c7ffa..0000000 --- a/docs/RunStorageIdsDatasets.md +++ /dev/null @@ -1,56 +0,0 @@ -# RunStorageIdsDatasets - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Default** | Pointer to **string** | ID of the default dataset for this run. | [optional] - -## Methods - -### NewRunStorageIdsDatasets - -`func NewRunStorageIdsDatasets() *RunStorageIdsDatasets` - -NewRunStorageIdsDatasets instantiates a new RunStorageIdsDatasets object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewRunStorageIdsDatasetsWithDefaults - -`func NewRunStorageIdsDatasetsWithDefaults() *RunStorageIdsDatasets` - -NewRunStorageIdsDatasetsWithDefaults instantiates a new RunStorageIdsDatasets object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetDefault - -`func (o *RunStorageIdsDatasets) GetDefault() string` - -GetDefault returns the Default field if non-nil, zero value otherwise. - -### GetDefaultOk - -`func (o *RunStorageIdsDatasets) GetDefaultOk() (*string, bool)` - -GetDefaultOk returns a tuple with the Default field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetDefault - -`func (o *RunStorageIdsDatasets) SetDefault(v string)` - -SetDefault sets Default field to given value. - -### HasDefault - -`func (o *RunStorageIdsDatasets) HasDefault() bool` - -HasDefault returns a boolean if a field has been set. - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/RunTimeoutExceededErrorDetail.md b/docs/RunTimeoutExceededErrorDetail.md deleted file mode 100644 index c6a0195..0000000 --- a/docs/RunTimeoutExceededErrorDetail.md +++ /dev/null @@ -1,92 +0,0 @@ -# RunTimeoutExceededErrorDetail - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Type** | Pointer to **interface{}** | | [optional] -**Message** | Pointer to **string** | Human-readable error message describing what went wrong. | [optional] - -## Methods - -### NewRunTimeoutExceededErrorDetail - -`func NewRunTimeoutExceededErrorDetail() *RunTimeoutExceededErrorDetail` - -NewRunTimeoutExceededErrorDetail instantiates a new RunTimeoutExceededErrorDetail object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewRunTimeoutExceededErrorDetailWithDefaults - -`func NewRunTimeoutExceededErrorDetailWithDefaults() *RunTimeoutExceededErrorDetail` - -NewRunTimeoutExceededErrorDetailWithDefaults instantiates a new RunTimeoutExceededErrorDetail object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetType - -`func (o *RunTimeoutExceededErrorDetail) GetType() interface{}` - -GetType returns the Type field if non-nil, zero value otherwise. - -### GetTypeOk - -`func (o *RunTimeoutExceededErrorDetail) GetTypeOk() (*interface{}, bool)` - -GetTypeOk returns a tuple with the Type field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetType - -`func (o *RunTimeoutExceededErrorDetail) SetType(v interface{})` - -SetType sets Type field to given value. - -### HasType - -`func (o *RunTimeoutExceededErrorDetail) HasType() bool` - -HasType returns a boolean if a field has been set. - -### SetTypeNil - -`func (o *RunTimeoutExceededErrorDetail) SetTypeNil(b bool)` - - SetTypeNil sets the value for Type to be an explicit nil - -### UnsetType -`func (o *RunTimeoutExceededErrorDetail) UnsetType()` - -UnsetType ensures that no value is present for Type, not even an explicit nil -### GetMessage - -`func (o *RunTimeoutExceededErrorDetail) GetMessage() string` - -GetMessage returns the Message field if non-nil, zero value otherwise. - -### GetMessageOk - -`func (o *RunTimeoutExceededErrorDetail) GetMessageOk() (*string, bool)` - -GetMessageOk returns a tuple with the Message field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetMessage - -`func (o *RunTimeoutExceededErrorDetail) SetMessage(v string)` - -SetMessage sets Message field to given value. - -### HasMessage - -`func (o *RunTimeoutExceededErrorDetail) HasMessage() bool` - -HasMessage returns a boolean if a field has been set. - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/RunUsage.md b/docs/RunUsage.md deleted file mode 100644 index 8fe349b..0000000 --- a/docs/RunUsage.md +++ /dev/null @@ -1,462 +0,0 @@ -# RunUsage - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**ACTOR_COMPUTE_UNITS** | Pointer to **NullableFloat32** | | [optional] -**DATASET_READS** | Pointer to **NullableInt32** | | [optional] -**DATASET_WRITES** | Pointer to **NullableInt32** | | [optional] -**KEY_VALUE_STORE_READS** | Pointer to **NullableInt32** | | [optional] -**KEY_VALUE_STORE_WRITES** | Pointer to **NullableInt32** | | [optional] -**KEY_VALUE_STORE_LISTS** | Pointer to **NullableInt32** | | [optional] -**REQUEST_QUEUE_READS** | Pointer to **NullableInt32** | | [optional] -**REQUEST_QUEUE_WRITES** | Pointer to **NullableInt32** | | [optional] -**DATA_TRANSFER_INTERNAL_GBYTES** | Pointer to **NullableFloat32** | | [optional] -**DATA_TRANSFER_EXTERNAL_GBYTES** | Pointer to **NullableFloat32** | | [optional] -**PROXY_RESIDENTIAL_TRANSFER_GBYTES** | Pointer to **NullableFloat32** | | [optional] -**PROXY_SERPS** | Pointer to **NullableInt32** | | [optional] - -## Methods - -### NewRunUsage - -`func NewRunUsage() *RunUsage` - -NewRunUsage instantiates a new RunUsage object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewRunUsageWithDefaults - -`func NewRunUsageWithDefaults() *RunUsage` - -NewRunUsageWithDefaults instantiates a new RunUsage object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetACTOR_COMPUTE_UNITS - -`func (o *RunUsage) GetACTOR_COMPUTE_UNITS() float32` - -GetACTOR_COMPUTE_UNITS returns the ACTOR_COMPUTE_UNITS field if non-nil, zero value otherwise. - -### GetACTOR_COMPUTE_UNITSOk - -`func (o *RunUsage) GetACTOR_COMPUTE_UNITSOk() (*float32, bool)` - -GetACTOR_COMPUTE_UNITSOk returns a tuple with the ACTOR_COMPUTE_UNITS field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetACTOR_COMPUTE_UNITS - -`func (o *RunUsage) SetACTOR_COMPUTE_UNITS(v float32)` - -SetACTOR_COMPUTE_UNITS sets ACTOR_COMPUTE_UNITS field to given value. - -### HasACTOR_COMPUTE_UNITS - -`func (o *RunUsage) HasACTOR_COMPUTE_UNITS() bool` - -HasACTOR_COMPUTE_UNITS returns a boolean if a field has been set. - -### SetACTOR_COMPUTE_UNITSNil - -`func (o *RunUsage) SetACTOR_COMPUTE_UNITSNil(b bool)` - - SetACTOR_COMPUTE_UNITSNil sets the value for ACTOR_COMPUTE_UNITS to be an explicit nil - -### UnsetACTOR_COMPUTE_UNITS -`func (o *RunUsage) UnsetACTOR_COMPUTE_UNITS()` - -UnsetACTOR_COMPUTE_UNITS ensures that no value is present for ACTOR_COMPUTE_UNITS, not even an explicit nil -### GetDATASET_READS - -`func (o *RunUsage) GetDATASET_READS() int32` - -GetDATASET_READS returns the DATASET_READS field if non-nil, zero value otherwise. - -### GetDATASET_READSOk - -`func (o *RunUsage) GetDATASET_READSOk() (*int32, bool)` - -GetDATASET_READSOk returns a tuple with the DATASET_READS field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetDATASET_READS - -`func (o *RunUsage) SetDATASET_READS(v int32)` - -SetDATASET_READS sets DATASET_READS field to given value. - -### HasDATASET_READS - -`func (o *RunUsage) HasDATASET_READS() bool` - -HasDATASET_READS returns a boolean if a field has been set. - -### SetDATASET_READSNil - -`func (o *RunUsage) SetDATASET_READSNil(b bool)` - - SetDATASET_READSNil sets the value for DATASET_READS to be an explicit nil - -### UnsetDATASET_READS -`func (o *RunUsage) UnsetDATASET_READS()` - -UnsetDATASET_READS ensures that no value is present for DATASET_READS, not even an explicit nil -### GetDATASET_WRITES - -`func (o *RunUsage) GetDATASET_WRITES() int32` - -GetDATASET_WRITES returns the DATASET_WRITES field if non-nil, zero value otherwise. - -### GetDATASET_WRITESOk - -`func (o *RunUsage) GetDATASET_WRITESOk() (*int32, bool)` - -GetDATASET_WRITESOk returns a tuple with the DATASET_WRITES field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetDATASET_WRITES - -`func (o *RunUsage) SetDATASET_WRITES(v int32)` - -SetDATASET_WRITES sets DATASET_WRITES field to given value. - -### HasDATASET_WRITES - -`func (o *RunUsage) HasDATASET_WRITES() bool` - -HasDATASET_WRITES returns a boolean if a field has been set. - -### SetDATASET_WRITESNil - -`func (o *RunUsage) SetDATASET_WRITESNil(b bool)` - - SetDATASET_WRITESNil sets the value for DATASET_WRITES to be an explicit nil - -### UnsetDATASET_WRITES -`func (o *RunUsage) UnsetDATASET_WRITES()` - -UnsetDATASET_WRITES ensures that no value is present for DATASET_WRITES, not even an explicit nil -### GetKEY_VALUE_STORE_READS - -`func (o *RunUsage) GetKEY_VALUE_STORE_READS() int32` - -GetKEY_VALUE_STORE_READS returns the KEY_VALUE_STORE_READS field if non-nil, zero value otherwise. - -### GetKEY_VALUE_STORE_READSOk - -`func (o *RunUsage) GetKEY_VALUE_STORE_READSOk() (*int32, bool)` - -GetKEY_VALUE_STORE_READSOk returns a tuple with the KEY_VALUE_STORE_READS field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetKEY_VALUE_STORE_READS - -`func (o *RunUsage) SetKEY_VALUE_STORE_READS(v int32)` - -SetKEY_VALUE_STORE_READS sets KEY_VALUE_STORE_READS field to given value. - -### HasKEY_VALUE_STORE_READS - -`func (o *RunUsage) HasKEY_VALUE_STORE_READS() bool` - -HasKEY_VALUE_STORE_READS returns a boolean if a field has been set. - -### SetKEY_VALUE_STORE_READSNil - -`func (o *RunUsage) SetKEY_VALUE_STORE_READSNil(b bool)` - - SetKEY_VALUE_STORE_READSNil sets the value for KEY_VALUE_STORE_READS to be an explicit nil - -### UnsetKEY_VALUE_STORE_READS -`func (o *RunUsage) UnsetKEY_VALUE_STORE_READS()` - -UnsetKEY_VALUE_STORE_READS ensures that no value is present for KEY_VALUE_STORE_READS, not even an explicit nil -### GetKEY_VALUE_STORE_WRITES - -`func (o *RunUsage) GetKEY_VALUE_STORE_WRITES() int32` - -GetKEY_VALUE_STORE_WRITES returns the KEY_VALUE_STORE_WRITES field if non-nil, zero value otherwise. - -### GetKEY_VALUE_STORE_WRITESOk - -`func (o *RunUsage) GetKEY_VALUE_STORE_WRITESOk() (*int32, bool)` - -GetKEY_VALUE_STORE_WRITESOk returns a tuple with the KEY_VALUE_STORE_WRITES field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetKEY_VALUE_STORE_WRITES - -`func (o *RunUsage) SetKEY_VALUE_STORE_WRITES(v int32)` - -SetKEY_VALUE_STORE_WRITES sets KEY_VALUE_STORE_WRITES field to given value. - -### HasKEY_VALUE_STORE_WRITES - -`func (o *RunUsage) HasKEY_VALUE_STORE_WRITES() bool` - -HasKEY_VALUE_STORE_WRITES returns a boolean if a field has been set. - -### SetKEY_VALUE_STORE_WRITESNil - -`func (o *RunUsage) SetKEY_VALUE_STORE_WRITESNil(b bool)` - - SetKEY_VALUE_STORE_WRITESNil sets the value for KEY_VALUE_STORE_WRITES to be an explicit nil - -### UnsetKEY_VALUE_STORE_WRITES -`func (o *RunUsage) UnsetKEY_VALUE_STORE_WRITES()` - -UnsetKEY_VALUE_STORE_WRITES ensures that no value is present for KEY_VALUE_STORE_WRITES, not even an explicit nil -### GetKEY_VALUE_STORE_LISTS - -`func (o *RunUsage) GetKEY_VALUE_STORE_LISTS() int32` - -GetKEY_VALUE_STORE_LISTS returns the KEY_VALUE_STORE_LISTS field if non-nil, zero value otherwise. - -### GetKEY_VALUE_STORE_LISTSOk - -`func (o *RunUsage) GetKEY_VALUE_STORE_LISTSOk() (*int32, bool)` - -GetKEY_VALUE_STORE_LISTSOk returns a tuple with the KEY_VALUE_STORE_LISTS field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetKEY_VALUE_STORE_LISTS - -`func (o *RunUsage) SetKEY_VALUE_STORE_LISTS(v int32)` - -SetKEY_VALUE_STORE_LISTS sets KEY_VALUE_STORE_LISTS field to given value. - -### HasKEY_VALUE_STORE_LISTS - -`func (o *RunUsage) HasKEY_VALUE_STORE_LISTS() bool` - -HasKEY_VALUE_STORE_LISTS returns a boolean if a field has been set. - -### SetKEY_VALUE_STORE_LISTSNil - -`func (o *RunUsage) SetKEY_VALUE_STORE_LISTSNil(b bool)` - - SetKEY_VALUE_STORE_LISTSNil sets the value for KEY_VALUE_STORE_LISTS to be an explicit nil - -### UnsetKEY_VALUE_STORE_LISTS -`func (o *RunUsage) UnsetKEY_VALUE_STORE_LISTS()` - -UnsetKEY_VALUE_STORE_LISTS ensures that no value is present for KEY_VALUE_STORE_LISTS, not even an explicit nil -### GetREQUEST_QUEUE_READS - -`func (o *RunUsage) GetREQUEST_QUEUE_READS() int32` - -GetREQUEST_QUEUE_READS returns the REQUEST_QUEUE_READS field if non-nil, zero value otherwise. - -### GetREQUEST_QUEUE_READSOk - -`func (o *RunUsage) GetREQUEST_QUEUE_READSOk() (*int32, bool)` - -GetREQUEST_QUEUE_READSOk returns a tuple with the REQUEST_QUEUE_READS field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetREQUEST_QUEUE_READS - -`func (o *RunUsage) SetREQUEST_QUEUE_READS(v int32)` - -SetREQUEST_QUEUE_READS sets REQUEST_QUEUE_READS field to given value. - -### HasREQUEST_QUEUE_READS - -`func (o *RunUsage) HasREQUEST_QUEUE_READS() bool` - -HasREQUEST_QUEUE_READS returns a boolean if a field has been set. - -### SetREQUEST_QUEUE_READSNil - -`func (o *RunUsage) SetREQUEST_QUEUE_READSNil(b bool)` - - SetREQUEST_QUEUE_READSNil sets the value for REQUEST_QUEUE_READS to be an explicit nil - -### UnsetREQUEST_QUEUE_READS -`func (o *RunUsage) UnsetREQUEST_QUEUE_READS()` - -UnsetREQUEST_QUEUE_READS ensures that no value is present for REQUEST_QUEUE_READS, not even an explicit nil -### GetREQUEST_QUEUE_WRITES - -`func (o *RunUsage) GetREQUEST_QUEUE_WRITES() int32` - -GetREQUEST_QUEUE_WRITES returns the REQUEST_QUEUE_WRITES field if non-nil, zero value otherwise. - -### GetREQUEST_QUEUE_WRITESOk - -`func (o *RunUsage) GetREQUEST_QUEUE_WRITESOk() (*int32, bool)` - -GetREQUEST_QUEUE_WRITESOk returns a tuple with the REQUEST_QUEUE_WRITES field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetREQUEST_QUEUE_WRITES - -`func (o *RunUsage) SetREQUEST_QUEUE_WRITES(v int32)` - -SetREQUEST_QUEUE_WRITES sets REQUEST_QUEUE_WRITES field to given value. - -### HasREQUEST_QUEUE_WRITES - -`func (o *RunUsage) HasREQUEST_QUEUE_WRITES() bool` - -HasREQUEST_QUEUE_WRITES returns a boolean if a field has been set. - -### SetREQUEST_QUEUE_WRITESNil - -`func (o *RunUsage) SetREQUEST_QUEUE_WRITESNil(b bool)` - - SetREQUEST_QUEUE_WRITESNil sets the value for REQUEST_QUEUE_WRITES to be an explicit nil - -### UnsetREQUEST_QUEUE_WRITES -`func (o *RunUsage) UnsetREQUEST_QUEUE_WRITES()` - -UnsetREQUEST_QUEUE_WRITES ensures that no value is present for REQUEST_QUEUE_WRITES, not even an explicit nil -### GetDATA_TRANSFER_INTERNAL_GBYTES - -`func (o *RunUsage) GetDATA_TRANSFER_INTERNAL_GBYTES() float32` - -GetDATA_TRANSFER_INTERNAL_GBYTES returns the DATA_TRANSFER_INTERNAL_GBYTES field if non-nil, zero value otherwise. - -### GetDATA_TRANSFER_INTERNAL_GBYTESOk - -`func (o *RunUsage) GetDATA_TRANSFER_INTERNAL_GBYTESOk() (*float32, bool)` - -GetDATA_TRANSFER_INTERNAL_GBYTESOk returns a tuple with the DATA_TRANSFER_INTERNAL_GBYTES field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetDATA_TRANSFER_INTERNAL_GBYTES - -`func (o *RunUsage) SetDATA_TRANSFER_INTERNAL_GBYTES(v float32)` - -SetDATA_TRANSFER_INTERNAL_GBYTES sets DATA_TRANSFER_INTERNAL_GBYTES field to given value. - -### HasDATA_TRANSFER_INTERNAL_GBYTES - -`func (o *RunUsage) HasDATA_TRANSFER_INTERNAL_GBYTES() bool` - -HasDATA_TRANSFER_INTERNAL_GBYTES returns a boolean if a field has been set. - -### SetDATA_TRANSFER_INTERNAL_GBYTESNil - -`func (o *RunUsage) SetDATA_TRANSFER_INTERNAL_GBYTESNil(b bool)` - - SetDATA_TRANSFER_INTERNAL_GBYTESNil sets the value for DATA_TRANSFER_INTERNAL_GBYTES to be an explicit nil - -### UnsetDATA_TRANSFER_INTERNAL_GBYTES -`func (o *RunUsage) UnsetDATA_TRANSFER_INTERNAL_GBYTES()` - -UnsetDATA_TRANSFER_INTERNAL_GBYTES ensures that no value is present for DATA_TRANSFER_INTERNAL_GBYTES, not even an explicit nil -### GetDATA_TRANSFER_EXTERNAL_GBYTES - -`func (o *RunUsage) GetDATA_TRANSFER_EXTERNAL_GBYTES() float32` - -GetDATA_TRANSFER_EXTERNAL_GBYTES returns the DATA_TRANSFER_EXTERNAL_GBYTES field if non-nil, zero value otherwise. - -### GetDATA_TRANSFER_EXTERNAL_GBYTESOk - -`func (o *RunUsage) GetDATA_TRANSFER_EXTERNAL_GBYTESOk() (*float32, bool)` - -GetDATA_TRANSFER_EXTERNAL_GBYTESOk returns a tuple with the DATA_TRANSFER_EXTERNAL_GBYTES field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetDATA_TRANSFER_EXTERNAL_GBYTES - -`func (o *RunUsage) SetDATA_TRANSFER_EXTERNAL_GBYTES(v float32)` - -SetDATA_TRANSFER_EXTERNAL_GBYTES sets DATA_TRANSFER_EXTERNAL_GBYTES field to given value. - -### HasDATA_TRANSFER_EXTERNAL_GBYTES - -`func (o *RunUsage) HasDATA_TRANSFER_EXTERNAL_GBYTES() bool` - -HasDATA_TRANSFER_EXTERNAL_GBYTES returns a boolean if a field has been set. - -### SetDATA_TRANSFER_EXTERNAL_GBYTESNil - -`func (o *RunUsage) SetDATA_TRANSFER_EXTERNAL_GBYTESNil(b bool)` - - SetDATA_TRANSFER_EXTERNAL_GBYTESNil sets the value for DATA_TRANSFER_EXTERNAL_GBYTES to be an explicit nil - -### UnsetDATA_TRANSFER_EXTERNAL_GBYTES -`func (o *RunUsage) UnsetDATA_TRANSFER_EXTERNAL_GBYTES()` - -UnsetDATA_TRANSFER_EXTERNAL_GBYTES ensures that no value is present for DATA_TRANSFER_EXTERNAL_GBYTES, not even an explicit nil -### GetPROXY_RESIDENTIAL_TRANSFER_GBYTES - -`func (o *RunUsage) GetPROXY_RESIDENTIAL_TRANSFER_GBYTES() float32` - -GetPROXY_RESIDENTIAL_TRANSFER_GBYTES returns the PROXY_RESIDENTIAL_TRANSFER_GBYTES field if non-nil, zero value otherwise. - -### GetPROXY_RESIDENTIAL_TRANSFER_GBYTESOk - -`func (o *RunUsage) GetPROXY_RESIDENTIAL_TRANSFER_GBYTESOk() (*float32, bool)` - -GetPROXY_RESIDENTIAL_TRANSFER_GBYTESOk returns a tuple with the PROXY_RESIDENTIAL_TRANSFER_GBYTES field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetPROXY_RESIDENTIAL_TRANSFER_GBYTES - -`func (o *RunUsage) SetPROXY_RESIDENTIAL_TRANSFER_GBYTES(v float32)` - -SetPROXY_RESIDENTIAL_TRANSFER_GBYTES sets PROXY_RESIDENTIAL_TRANSFER_GBYTES field to given value. - -### HasPROXY_RESIDENTIAL_TRANSFER_GBYTES - -`func (o *RunUsage) HasPROXY_RESIDENTIAL_TRANSFER_GBYTES() bool` - -HasPROXY_RESIDENTIAL_TRANSFER_GBYTES returns a boolean if a field has been set. - -### SetPROXY_RESIDENTIAL_TRANSFER_GBYTESNil - -`func (o *RunUsage) SetPROXY_RESIDENTIAL_TRANSFER_GBYTESNil(b bool)` - - SetPROXY_RESIDENTIAL_TRANSFER_GBYTESNil sets the value for PROXY_RESIDENTIAL_TRANSFER_GBYTES to be an explicit nil - -### UnsetPROXY_RESIDENTIAL_TRANSFER_GBYTES -`func (o *RunUsage) UnsetPROXY_RESIDENTIAL_TRANSFER_GBYTES()` - -UnsetPROXY_RESIDENTIAL_TRANSFER_GBYTES ensures that no value is present for PROXY_RESIDENTIAL_TRANSFER_GBYTES, not even an explicit nil -### GetPROXY_SERPS - -`func (o *RunUsage) GetPROXY_SERPS() int32` - -GetPROXY_SERPS returns the PROXY_SERPS field if non-nil, zero value otherwise. - -### GetPROXY_SERPSOk - -`func (o *RunUsage) GetPROXY_SERPSOk() (*int32, bool)` - -GetPROXY_SERPSOk returns a tuple with the PROXY_SERPS field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetPROXY_SERPS - -`func (o *RunUsage) SetPROXY_SERPS(v int32)` - -SetPROXY_SERPS sets PROXY_SERPS field to given value. - -### HasPROXY_SERPS - -`func (o *RunUsage) HasPROXY_SERPS() bool` - -HasPROXY_SERPS returns a boolean if a field has been set. - -### SetPROXY_SERPSNil - -`func (o *RunUsage) SetPROXY_SERPSNil(b bool)` - - SetPROXY_SERPSNil sets the value for PROXY_SERPS to be an explicit nil - -### UnsetPROXY_SERPS -`func (o *RunUsage) UnsetPROXY_SERPS()` - -UnsetPROXY_SERPS ensures that no value is present for PROXY_SERPS, not even an explicit nil - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/RunUsageUsd.md b/docs/RunUsageUsd.md deleted file mode 100644 index 2ed7378..0000000 --- a/docs/RunUsageUsd.md +++ /dev/null @@ -1,462 +0,0 @@ -# RunUsageUsd - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**ACTOR_COMPUTE_UNITS** | Pointer to **NullableFloat32** | | [optional] -**DATASET_READS** | Pointer to **NullableFloat32** | | [optional] -**DATASET_WRITES** | Pointer to **NullableFloat32** | | [optional] -**KEY_VALUE_STORE_READS** | Pointer to **NullableFloat32** | | [optional] -**KEY_VALUE_STORE_WRITES** | Pointer to **NullableFloat32** | | [optional] -**KEY_VALUE_STORE_LISTS** | Pointer to **NullableFloat32** | | [optional] -**REQUEST_QUEUE_READS** | Pointer to **NullableFloat32** | | [optional] -**REQUEST_QUEUE_WRITES** | Pointer to **NullableFloat32** | | [optional] -**DATA_TRANSFER_INTERNAL_GBYTES** | Pointer to **NullableFloat32** | | [optional] -**DATA_TRANSFER_EXTERNAL_GBYTES** | Pointer to **NullableFloat32** | | [optional] -**PROXY_RESIDENTIAL_TRANSFER_GBYTES** | Pointer to **NullableFloat32** | | [optional] -**PROXY_SERPS** | Pointer to **NullableFloat32** | | [optional] - -## Methods - -### NewRunUsageUsd - -`func NewRunUsageUsd() *RunUsageUsd` - -NewRunUsageUsd instantiates a new RunUsageUsd object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewRunUsageUsdWithDefaults - -`func NewRunUsageUsdWithDefaults() *RunUsageUsd` - -NewRunUsageUsdWithDefaults instantiates a new RunUsageUsd object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetACTOR_COMPUTE_UNITS - -`func (o *RunUsageUsd) GetACTOR_COMPUTE_UNITS() float32` - -GetACTOR_COMPUTE_UNITS returns the ACTOR_COMPUTE_UNITS field if non-nil, zero value otherwise. - -### GetACTOR_COMPUTE_UNITSOk - -`func (o *RunUsageUsd) GetACTOR_COMPUTE_UNITSOk() (*float32, bool)` - -GetACTOR_COMPUTE_UNITSOk returns a tuple with the ACTOR_COMPUTE_UNITS field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetACTOR_COMPUTE_UNITS - -`func (o *RunUsageUsd) SetACTOR_COMPUTE_UNITS(v float32)` - -SetACTOR_COMPUTE_UNITS sets ACTOR_COMPUTE_UNITS field to given value. - -### HasACTOR_COMPUTE_UNITS - -`func (o *RunUsageUsd) HasACTOR_COMPUTE_UNITS() bool` - -HasACTOR_COMPUTE_UNITS returns a boolean if a field has been set. - -### SetACTOR_COMPUTE_UNITSNil - -`func (o *RunUsageUsd) SetACTOR_COMPUTE_UNITSNil(b bool)` - - SetACTOR_COMPUTE_UNITSNil sets the value for ACTOR_COMPUTE_UNITS to be an explicit nil - -### UnsetACTOR_COMPUTE_UNITS -`func (o *RunUsageUsd) UnsetACTOR_COMPUTE_UNITS()` - -UnsetACTOR_COMPUTE_UNITS ensures that no value is present for ACTOR_COMPUTE_UNITS, not even an explicit nil -### GetDATASET_READS - -`func (o *RunUsageUsd) GetDATASET_READS() float32` - -GetDATASET_READS returns the DATASET_READS field if non-nil, zero value otherwise. - -### GetDATASET_READSOk - -`func (o *RunUsageUsd) GetDATASET_READSOk() (*float32, bool)` - -GetDATASET_READSOk returns a tuple with the DATASET_READS field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetDATASET_READS - -`func (o *RunUsageUsd) SetDATASET_READS(v float32)` - -SetDATASET_READS sets DATASET_READS field to given value. - -### HasDATASET_READS - -`func (o *RunUsageUsd) HasDATASET_READS() bool` - -HasDATASET_READS returns a boolean if a field has been set. - -### SetDATASET_READSNil - -`func (o *RunUsageUsd) SetDATASET_READSNil(b bool)` - - SetDATASET_READSNil sets the value for DATASET_READS to be an explicit nil - -### UnsetDATASET_READS -`func (o *RunUsageUsd) UnsetDATASET_READS()` - -UnsetDATASET_READS ensures that no value is present for DATASET_READS, not even an explicit nil -### GetDATASET_WRITES - -`func (o *RunUsageUsd) GetDATASET_WRITES() float32` - -GetDATASET_WRITES returns the DATASET_WRITES field if non-nil, zero value otherwise. - -### GetDATASET_WRITESOk - -`func (o *RunUsageUsd) GetDATASET_WRITESOk() (*float32, bool)` - -GetDATASET_WRITESOk returns a tuple with the DATASET_WRITES field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetDATASET_WRITES - -`func (o *RunUsageUsd) SetDATASET_WRITES(v float32)` - -SetDATASET_WRITES sets DATASET_WRITES field to given value. - -### HasDATASET_WRITES - -`func (o *RunUsageUsd) HasDATASET_WRITES() bool` - -HasDATASET_WRITES returns a boolean if a field has been set. - -### SetDATASET_WRITESNil - -`func (o *RunUsageUsd) SetDATASET_WRITESNil(b bool)` - - SetDATASET_WRITESNil sets the value for DATASET_WRITES to be an explicit nil - -### UnsetDATASET_WRITES -`func (o *RunUsageUsd) UnsetDATASET_WRITES()` - -UnsetDATASET_WRITES ensures that no value is present for DATASET_WRITES, not even an explicit nil -### GetKEY_VALUE_STORE_READS - -`func (o *RunUsageUsd) GetKEY_VALUE_STORE_READS() float32` - -GetKEY_VALUE_STORE_READS returns the KEY_VALUE_STORE_READS field if non-nil, zero value otherwise. - -### GetKEY_VALUE_STORE_READSOk - -`func (o *RunUsageUsd) GetKEY_VALUE_STORE_READSOk() (*float32, bool)` - -GetKEY_VALUE_STORE_READSOk returns a tuple with the KEY_VALUE_STORE_READS field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetKEY_VALUE_STORE_READS - -`func (o *RunUsageUsd) SetKEY_VALUE_STORE_READS(v float32)` - -SetKEY_VALUE_STORE_READS sets KEY_VALUE_STORE_READS field to given value. - -### HasKEY_VALUE_STORE_READS - -`func (o *RunUsageUsd) HasKEY_VALUE_STORE_READS() bool` - -HasKEY_VALUE_STORE_READS returns a boolean if a field has been set. - -### SetKEY_VALUE_STORE_READSNil - -`func (o *RunUsageUsd) SetKEY_VALUE_STORE_READSNil(b bool)` - - SetKEY_VALUE_STORE_READSNil sets the value for KEY_VALUE_STORE_READS to be an explicit nil - -### UnsetKEY_VALUE_STORE_READS -`func (o *RunUsageUsd) UnsetKEY_VALUE_STORE_READS()` - -UnsetKEY_VALUE_STORE_READS ensures that no value is present for KEY_VALUE_STORE_READS, not even an explicit nil -### GetKEY_VALUE_STORE_WRITES - -`func (o *RunUsageUsd) GetKEY_VALUE_STORE_WRITES() float32` - -GetKEY_VALUE_STORE_WRITES returns the KEY_VALUE_STORE_WRITES field if non-nil, zero value otherwise. - -### GetKEY_VALUE_STORE_WRITESOk - -`func (o *RunUsageUsd) GetKEY_VALUE_STORE_WRITESOk() (*float32, bool)` - -GetKEY_VALUE_STORE_WRITESOk returns a tuple with the KEY_VALUE_STORE_WRITES field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetKEY_VALUE_STORE_WRITES - -`func (o *RunUsageUsd) SetKEY_VALUE_STORE_WRITES(v float32)` - -SetKEY_VALUE_STORE_WRITES sets KEY_VALUE_STORE_WRITES field to given value. - -### HasKEY_VALUE_STORE_WRITES - -`func (o *RunUsageUsd) HasKEY_VALUE_STORE_WRITES() bool` - -HasKEY_VALUE_STORE_WRITES returns a boolean if a field has been set. - -### SetKEY_VALUE_STORE_WRITESNil - -`func (o *RunUsageUsd) SetKEY_VALUE_STORE_WRITESNil(b bool)` - - SetKEY_VALUE_STORE_WRITESNil sets the value for KEY_VALUE_STORE_WRITES to be an explicit nil - -### UnsetKEY_VALUE_STORE_WRITES -`func (o *RunUsageUsd) UnsetKEY_VALUE_STORE_WRITES()` - -UnsetKEY_VALUE_STORE_WRITES ensures that no value is present for KEY_VALUE_STORE_WRITES, not even an explicit nil -### GetKEY_VALUE_STORE_LISTS - -`func (o *RunUsageUsd) GetKEY_VALUE_STORE_LISTS() float32` - -GetKEY_VALUE_STORE_LISTS returns the KEY_VALUE_STORE_LISTS field if non-nil, zero value otherwise. - -### GetKEY_VALUE_STORE_LISTSOk - -`func (o *RunUsageUsd) GetKEY_VALUE_STORE_LISTSOk() (*float32, bool)` - -GetKEY_VALUE_STORE_LISTSOk returns a tuple with the KEY_VALUE_STORE_LISTS field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetKEY_VALUE_STORE_LISTS - -`func (o *RunUsageUsd) SetKEY_VALUE_STORE_LISTS(v float32)` - -SetKEY_VALUE_STORE_LISTS sets KEY_VALUE_STORE_LISTS field to given value. - -### HasKEY_VALUE_STORE_LISTS - -`func (o *RunUsageUsd) HasKEY_VALUE_STORE_LISTS() bool` - -HasKEY_VALUE_STORE_LISTS returns a boolean if a field has been set. - -### SetKEY_VALUE_STORE_LISTSNil - -`func (o *RunUsageUsd) SetKEY_VALUE_STORE_LISTSNil(b bool)` - - SetKEY_VALUE_STORE_LISTSNil sets the value for KEY_VALUE_STORE_LISTS to be an explicit nil - -### UnsetKEY_VALUE_STORE_LISTS -`func (o *RunUsageUsd) UnsetKEY_VALUE_STORE_LISTS()` - -UnsetKEY_VALUE_STORE_LISTS ensures that no value is present for KEY_VALUE_STORE_LISTS, not even an explicit nil -### GetREQUEST_QUEUE_READS - -`func (o *RunUsageUsd) GetREQUEST_QUEUE_READS() float32` - -GetREQUEST_QUEUE_READS returns the REQUEST_QUEUE_READS field if non-nil, zero value otherwise. - -### GetREQUEST_QUEUE_READSOk - -`func (o *RunUsageUsd) GetREQUEST_QUEUE_READSOk() (*float32, bool)` - -GetREQUEST_QUEUE_READSOk returns a tuple with the REQUEST_QUEUE_READS field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetREQUEST_QUEUE_READS - -`func (o *RunUsageUsd) SetREQUEST_QUEUE_READS(v float32)` - -SetREQUEST_QUEUE_READS sets REQUEST_QUEUE_READS field to given value. - -### HasREQUEST_QUEUE_READS - -`func (o *RunUsageUsd) HasREQUEST_QUEUE_READS() bool` - -HasREQUEST_QUEUE_READS returns a boolean if a field has been set. - -### SetREQUEST_QUEUE_READSNil - -`func (o *RunUsageUsd) SetREQUEST_QUEUE_READSNil(b bool)` - - SetREQUEST_QUEUE_READSNil sets the value for REQUEST_QUEUE_READS to be an explicit nil - -### UnsetREQUEST_QUEUE_READS -`func (o *RunUsageUsd) UnsetREQUEST_QUEUE_READS()` - -UnsetREQUEST_QUEUE_READS ensures that no value is present for REQUEST_QUEUE_READS, not even an explicit nil -### GetREQUEST_QUEUE_WRITES - -`func (o *RunUsageUsd) GetREQUEST_QUEUE_WRITES() float32` - -GetREQUEST_QUEUE_WRITES returns the REQUEST_QUEUE_WRITES field if non-nil, zero value otherwise. - -### GetREQUEST_QUEUE_WRITESOk - -`func (o *RunUsageUsd) GetREQUEST_QUEUE_WRITESOk() (*float32, bool)` - -GetREQUEST_QUEUE_WRITESOk returns a tuple with the REQUEST_QUEUE_WRITES field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetREQUEST_QUEUE_WRITES - -`func (o *RunUsageUsd) SetREQUEST_QUEUE_WRITES(v float32)` - -SetREQUEST_QUEUE_WRITES sets REQUEST_QUEUE_WRITES field to given value. - -### HasREQUEST_QUEUE_WRITES - -`func (o *RunUsageUsd) HasREQUEST_QUEUE_WRITES() bool` - -HasREQUEST_QUEUE_WRITES returns a boolean if a field has been set. - -### SetREQUEST_QUEUE_WRITESNil - -`func (o *RunUsageUsd) SetREQUEST_QUEUE_WRITESNil(b bool)` - - SetREQUEST_QUEUE_WRITESNil sets the value for REQUEST_QUEUE_WRITES to be an explicit nil - -### UnsetREQUEST_QUEUE_WRITES -`func (o *RunUsageUsd) UnsetREQUEST_QUEUE_WRITES()` - -UnsetREQUEST_QUEUE_WRITES ensures that no value is present for REQUEST_QUEUE_WRITES, not even an explicit nil -### GetDATA_TRANSFER_INTERNAL_GBYTES - -`func (o *RunUsageUsd) GetDATA_TRANSFER_INTERNAL_GBYTES() float32` - -GetDATA_TRANSFER_INTERNAL_GBYTES returns the DATA_TRANSFER_INTERNAL_GBYTES field if non-nil, zero value otherwise. - -### GetDATA_TRANSFER_INTERNAL_GBYTESOk - -`func (o *RunUsageUsd) GetDATA_TRANSFER_INTERNAL_GBYTESOk() (*float32, bool)` - -GetDATA_TRANSFER_INTERNAL_GBYTESOk returns a tuple with the DATA_TRANSFER_INTERNAL_GBYTES field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetDATA_TRANSFER_INTERNAL_GBYTES - -`func (o *RunUsageUsd) SetDATA_TRANSFER_INTERNAL_GBYTES(v float32)` - -SetDATA_TRANSFER_INTERNAL_GBYTES sets DATA_TRANSFER_INTERNAL_GBYTES field to given value. - -### HasDATA_TRANSFER_INTERNAL_GBYTES - -`func (o *RunUsageUsd) HasDATA_TRANSFER_INTERNAL_GBYTES() bool` - -HasDATA_TRANSFER_INTERNAL_GBYTES returns a boolean if a field has been set. - -### SetDATA_TRANSFER_INTERNAL_GBYTESNil - -`func (o *RunUsageUsd) SetDATA_TRANSFER_INTERNAL_GBYTESNil(b bool)` - - SetDATA_TRANSFER_INTERNAL_GBYTESNil sets the value for DATA_TRANSFER_INTERNAL_GBYTES to be an explicit nil - -### UnsetDATA_TRANSFER_INTERNAL_GBYTES -`func (o *RunUsageUsd) UnsetDATA_TRANSFER_INTERNAL_GBYTES()` - -UnsetDATA_TRANSFER_INTERNAL_GBYTES ensures that no value is present for DATA_TRANSFER_INTERNAL_GBYTES, not even an explicit nil -### GetDATA_TRANSFER_EXTERNAL_GBYTES - -`func (o *RunUsageUsd) GetDATA_TRANSFER_EXTERNAL_GBYTES() float32` - -GetDATA_TRANSFER_EXTERNAL_GBYTES returns the DATA_TRANSFER_EXTERNAL_GBYTES field if non-nil, zero value otherwise. - -### GetDATA_TRANSFER_EXTERNAL_GBYTESOk - -`func (o *RunUsageUsd) GetDATA_TRANSFER_EXTERNAL_GBYTESOk() (*float32, bool)` - -GetDATA_TRANSFER_EXTERNAL_GBYTESOk returns a tuple with the DATA_TRANSFER_EXTERNAL_GBYTES field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetDATA_TRANSFER_EXTERNAL_GBYTES - -`func (o *RunUsageUsd) SetDATA_TRANSFER_EXTERNAL_GBYTES(v float32)` - -SetDATA_TRANSFER_EXTERNAL_GBYTES sets DATA_TRANSFER_EXTERNAL_GBYTES field to given value. - -### HasDATA_TRANSFER_EXTERNAL_GBYTES - -`func (o *RunUsageUsd) HasDATA_TRANSFER_EXTERNAL_GBYTES() bool` - -HasDATA_TRANSFER_EXTERNAL_GBYTES returns a boolean if a field has been set. - -### SetDATA_TRANSFER_EXTERNAL_GBYTESNil - -`func (o *RunUsageUsd) SetDATA_TRANSFER_EXTERNAL_GBYTESNil(b bool)` - - SetDATA_TRANSFER_EXTERNAL_GBYTESNil sets the value for DATA_TRANSFER_EXTERNAL_GBYTES to be an explicit nil - -### UnsetDATA_TRANSFER_EXTERNAL_GBYTES -`func (o *RunUsageUsd) UnsetDATA_TRANSFER_EXTERNAL_GBYTES()` - -UnsetDATA_TRANSFER_EXTERNAL_GBYTES ensures that no value is present for DATA_TRANSFER_EXTERNAL_GBYTES, not even an explicit nil -### GetPROXY_RESIDENTIAL_TRANSFER_GBYTES - -`func (o *RunUsageUsd) GetPROXY_RESIDENTIAL_TRANSFER_GBYTES() float32` - -GetPROXY_RESIDENTIAL_TRANSFER_GBYTES returns the PROXY_RESIDENTIAL_TRANSFER_GBYTES field if non-nil, zero value otherwise. - -### GetPROXY_RESIDENTIAL_TRANSFER_GBYTESOk - -`func (o *RunUsageUsd) GetPROXY_RESIDENTIAL_TRANSFER_GBYTESOk() (*float32, bool)` - -GetPROXY_RESIDENTIAL_TRANSFER_GBYTESOk returns a tuple with the PROXY_RESIDENTIAL_TRANSFER_GBYTES field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetPROXY_RESIDENTIAL_TRANSFER_GBYTES - -`func (o *RunUsageUsd) SetPROXY_RESIDENTIAL_TRANSFER_GBYTES(v float32)` - -SetPROXY_RESIDENTIAL_TRANSFER_GBYTES sets PROXY_RESIDENTIAL_TRANSFER_GBYTES field to given value. - -### HasPROXY_RESIDENTIAL_TRANSFER_GBYTES - -`func (o *RunUsageUsd) HasPROXY_RESIDENTIAL_TRANSFER_GBYTES() bool` - -HasPROXY_RESIDENTIAL_TRANSFER_GBYTES returns a boolean if a field has been set. - -### SetPROXY_RESIDENTIAL_TRANSFER_GBYTESNil - -`func (o *RunUsageUsd) SetPROXY_RESIDENTIAL_TRANSFER_GBYTESNil(b bool)` - - SetPROXY_RESIDENTIAL_TRANSFER_GBYTESNil sets the value for PROXY_RESIDENTIAL_TRANSFER_GBYTES to be an explicit nil - -### UnsetPROXY_RESIDENTIAL_TRANSFER_GBYTES -`func (o *RunUsageUsd) UnsetPROXY_RESIDENTIAL_TRANSFER_GBYTES()` - -UnsetPROXY_RESIDENTIAL_TRANSFER_GBYTES ensures that no value is present for PROXY_RESIDENTIAL_TRANSFER_GBYTES, not even an explicit nil -### GetPROXY_SERPS - -`func (o *RunUsageUsd) GetPROXY_SERPS() float32` - -GetPROXY_SERPS returns the PROXY_SERPS field if non-nil, zero value otherwise. - -### GetPROXY_SERPSOk - -`func (o *RunUsageUsd) GetPROXY_SERPSOk() (*float32, bool)` - -GetPROXY_SERPSOk returns a tuple with the PROXY_SERPS field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetPROXY_SERPS - -`func (o *RunUsageUsd) SetPROXY_SERPS(v float32)` - -SetPROXY_SERPS sets PROXY_SERPS field to given value. - -### HasPROXY_SERPS - -`func (o *RunUsageUsd) HasPROXY_SERPS() bool` - -HasPROXY_SERPS returns a boolean if a field has been set. - -### SetPROXY_SERPSNil - -`func (o *RunUsageUsd) SetPROXY_SERPSNil(b bool)` - - SetPROXY_SERPSNil sets the value for PROXY_SERPS to be an explicit nil - -### UnsetPROXY_SERPS -`func (o *RunUsageUsd) UnsetPROXY_SERPS()` - -UnsetPROXY_SERPS ensures that no value is present for PROXY_SERPS, not even an explicit nil - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/Schedule.md b/docs/Schedule.md deleted file mode 100644 index 918ab5c..0000000 --- a/docs/Schedule.md +++ /dev/null @@ -1,390 +0,0 @@ -# Schedule - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Id** | **string** | | -**UserId** | **string** | | -**Name** | **string** | | -**CronExpression** | **string** | | -**Timezone** | **string** | | -**IsEnabled** | **bool** | | -**IsExclusive** | **bool** | | -**CreatedAt** | **time.Time** | | -**ModifiedAt** | **time.Time** | | -**NextRunAt** | Pointer to **time.Time** | | [optional] -**LastRunAt** | Pointer to **time.Time** | | [optional] -**Description** | Pointer to **NullableString** | | [optional] -**Title** | Pointer to **NullableString** | | [optional] -**Notifications** | Pointer to [**ScheduleNotifications**](ScheduleNotifications.md) | | [optional] -**Actions** | [**[]ScheduleAction**](ScheduleAction.md) | | - -## Methods - -### NewSchedule - -`func NewSchedule(id string, userId string, name string, cronExpression string, timezone string, isEnabled bool, isExclusive bool, createdAt time.Time, modifiedAt time.Time, actions []ScheduleAction, ) *Schedule` - -NewSchedule instantiates a new Schedule object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewScheduleWithDefaults - -`func NewScheduleWithDefaults() *Schedule` - -NewScheduleWithDefaults instantiates a new Schedule object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetId - -`func (o *Schedule) GetId() string` - -GetId returns the Id field if non-nil, zero value otherwise. - -### GetIdOk - -`func (o *Schedule) GetIdOk() (*string, bool)` - -GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetId - -`func (o *Schedule) SetId(v string)` - -SetId sets Id field to given value. - - -### GetUserId - -`func (o *Schedule) GetUserId() string` - -GetUserId returns the UserId field if non-nil, zero value otherwise. - -### GetUserIdOk - -`func (o *Schedule) GetUserIdOk() (*string, bool)` - -GetUserIdOk returns a tuple with the UserId field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetUserId - -`func (o *Schedule) SetUserId(v string)` - -SetUserId sets UserId field to given value. - - -### GetName - -`func (o *Schedule) GetName() string` - -GetName returns the Name field if non-nil, zero value otherwise. - -### GetNameOk - -`func (o *Schedule) GetNameOk() (*string, bool)` - -GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetName - -`func (o *Schedule) SetName(v string)` - -SetName sets Name field to given value. - - -### GetCronExpression - -`func (o *Schedule) GetCronExpression() string` - -GetCronExpression returns the CronExpression field if non-nil, zero value otherwise. - -### GetCronExpressionOk - -`func (o *Schedule) GetCronExpressionOk() (*string, bool)` - -GetCronExpressionOk returns a tuple with the CronExpression field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetCronExpression - -`func (o *Schedule) SetCronExpression(v string)` - -SetCronExpression sets CronExpression field to given value. - - -### GetTimezone - -`func (o *Schedule) GetTimezone() string` - -GetTimezone returns the Timezone field if non-nil, zero value otherwise. - -### GetTimezoneOk - -`func (o *Schedule) GetTimezoneOk() (*string, bool)` - -GetTimezoneOk returns a tuple with the Timezone field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetTimezone - -`func (o *Schedule) SetTimezone(v string)` - -SetTimezone sets Timezone field to given value. - - -### GetIsEnabled - -`func (o *Schedule) GetIsEnabled() bool` - -GetIsEnabled returns the IsEnabled field if non-nil, zero value otherwise. - -### GetIsEnabledOk - -`func (o *Schedule) GetIsEnabledOk() (*bool, bool)` - -GetIsEnabledOk returns a tuple with the IsEnabled field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetIsEnabled - -`func (o *Schedule) SetIsEnabled(v bool)` - -SetIsEnabled sets IsEnabled field to given value. - - -### GetIsExclusive - -`func (o *Schedule) GetIsExclusive() bool` - -GetIsExclusive returns the IsExclusive field if non-nil, zero value otherwise. - -### GetIsExclusiveOk - -`func (o *Schedule) GetIsExclusiveOk() (*bool, bool)` - -GetIsExclusiveOk returns a tuple with the IsExclusive field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetIsExclusive - -`func (o *Schedule) SetIsExclusive(v bool)` - -SetIsExclusive sets IsExclusive field to given value. - - -### GetCreatedAt - -`func (o *Schedule) GetCreatedAt() time.Time` - -GetCreatedAt returns the CreatedAt field if non-nil, zero value otherwise. - -### GetCreatedAtOk - -`func (o *Schedule) GetCreatedAtOk() (*time.Time, bool)` - -GetCreatedAtOk returns a tuple with the CreatedAt field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetCreatedAt - -`func (o *Schedule) SetCreatedAt(v time.Time)` - -SetCreatedAt sets CreatedAt field to given value. - - -### GetModifiedAt - -`func (o *Schedule) GetModifiedAt() time.Time` - -GetModifiedAt returns the ModifiedAt field if non-nil, zero value otherwise. - -### GetModifiedAtOk - -`func (o *Schedule) GetModifiedAtOk() (*time.Time, bool)` - -GetModifiedAtOk returns a tuple with the ModifiedAt field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetModifiedAt - -`func (o *Schedule) SetModifiedAt(v time.Time)` - -SetModifiedAt sets ModifiedAt field to given value. - - -### GetNextRunAt - -`func (o *Schedule) GetNextRunAt() time.Time` - -GetNextRunAt returns the NextRunAt field if non-nil, zero value otherwise. - -### GetNextRunAtOk - -`func (o *Schedule) GetNextRunAtOk() (*time.Time, bool)` - -GetNextRunAtOk returns a tuple with the NextRunAt field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetNextRunAt - -`func (o *Schedule) SetNextRunAt(v time.Time)` - -SetNextRunAt sets NextRunAt field to given value. - -### HasNextRunAt - -`func (o *Schedule) HasNextRunAt() bool` - -HasNextRunAt returns a boolean if a field has been set. - -### GetLastRunAt - -`func (o *Schedule) GetLastRunAt() time.Time` - -GetLastRunAt returns the LastRunAt field if non-nil, zero value otherwise. - -### GetLastRunAtOk - -`func (o *Schedule) GetLastRunAtOk() (*time.Time, bool)` - -GetLastRunAtOk returns a tuple with the LastRunAt field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetLastRunAt - -`func (o *Schedule) SetLastRunAt(v time.Time)` - -SetLastRunAt sets LastRunAt field to given value. - -### HasLastRunAt - -`func (o *Schedule) HasLastRunAt() bool` - -HasLastRunAt returns a boolean if a field has been set. - -### GetDescription - -`func (o *Schedule) GetDescription() string` - -GetDescription returns the Description field if non-nil, zero value otherwise. - -### GetDescriptionOk - -`func (o *Schedule) GetDescriptionOk() (*string, bool)` - -GetDescriptionOk returns a tuple with the Description field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetDescription - -`func (o *Schedule) SetDescription(v string)` - -SetDescription sets Description field to given value. - -### HasDescription - -`func (o *Schedule) HasDescription() bool` - -HasDescription returns a boolean if a field has been set. - -### SetDescriptionNil - -`func (o *Schedule) SetDescriptionNil(b bool)` - - SetDescriptionNil sets the value for Description to be an explicit nil - -### UnsetDescription -`func (o *Schedule) UnsetDescription()` - -UnsetDescription ensures that no value is present for Description, not even an explicit nil -### GetTitle - -`func (o *Schedule) GetTitle() string` - -GetTitle returns the Title field if non-nil, zero value otherwise. - -### GetTitleOk - -`func (o *Schedule) GetTitleOk() (*string, bool)` - -GetTitleOk returns a tuple with the Title field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetTitle - -`func (o *Schedule) SetTitle(v string)` - -SetTitle sets Title field to given value. - -### HasTitle - -`func (o *Schedule) HasTitle() bool` - -HasTitle returns a boolean if a field has been set. - -### SetTitleNil - -`func (o *Schedule) SetTitleNil(b bool)` - - SetTitleNil sets the value for Title to be an explicit nil - -### UnsetTitle -`func (o *Schedule) UnsetTitle()` - -UnsetTitle ensures that no value is present for Title, not even an explicit nil -### GetNotifications - -`func (o *Schedule) GetNotifications() ScheduleNotifications` - -GetNotifications returns the Notifications field if non-nil, zero value otherwise. - -### GetNotificationsOk - -`func (o *Schedule) GetNotificationsOk() (*ScheduleNotifications, bool)` - -GetNotificationsOk returns a tuple with the Notifications field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetNotifications - -`func (o *Schedule) SetNotifications(v ScheduleNotifications)` - -SetNotifications sets Notifications field to given value. - -### HasNotifications - -`func (o *Schedule) HasNotifications() bool` - -HasNotifications returns a boolean if a field has been set. - -### GetActions - -`func (o *Schedule) GetActions() []ScheduleAction` - -GetActions returns the Actions field if non-nil, zero value otherwise. - -### GetActionsOk - -`func (o *Schedule) GetActionsOk() (*[]ScheduleAction, bool)` - -GetActionsOk returns a tuple with the Actions field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetActions - -`func (o *Schedule) SetActions(v []ScheduleAction)` - -SetActions sets Actions field to given value. - - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/ScheduleAction.md b/docs/ScheduleAction.md deleted file mode 100644 index b13c3ed..0000000 --- a/docs/ScheduleAction.md +++ /dev/null @@ -1,202 +0,0 @@ -# ScheduleAction - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Id** | **string** | | -**Type** | **interface{}** | | -**ActorId** | **string** | | -**RunInput** | Pointer to [**ScheduleActionRunInput**](ScheduleActionRunInput.md) | | [optional] -**RunOptions** | Pointer to [**TaskOptions**](TaskOptions.md) | | [optional] -**ActorTaskId** | **string** | | -**Input** | Pointer to **map[string]interface{}** | | [optional] - -## Methods - -### NewScheduleAction - -`func NewScheduleAction(id string, type_ interface{}, actorId string, actorTaskId string, ) *ScheduleAction` - -NewScheduleAction instantiates a new ScheduleAction object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewScheduleActionWithDefaults - -`func NewScheduleActionWithDefaults() *ScheduleAction` - -NewScheduleActionWithDefaults instantiates a new ScheduleAction object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetId - -`func (o *ScheduleAction) GetId() string` - -GetId returns the Id field if non-nil, zero value otherwise. - -### GetIdOk - -`func (o *ScheduleAction) GetIdOk() (*string, bool)` - -GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetId - -`func (o *ScheduleAction) SetId(v string)` - -SetId sets Id field to given value. - - -### GetType - -`func (o *ScheduleAction) GetType() interface{}` - -GetType returns the Type field if non-nil, zero value otherwise. - -### GetTypeOk - -`func (o *ScheduleAction) GetTypeOk() (*interface{}, bool)` - -GetTypeOk returns a tuple with the Type field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetType - -`func (o *ScheduleAction) SetType(v interface{})` - -SetType sets Type field to given value. - - -### SetTypeNil - -`func (o *ScheduleAction) SetTypeNil(b bool)` - - SetTypeNil sets the value for Type to be an explicit nil - -### UnsetType -`func (o *ScheduleAction) UnsetType()` - -UnsetType ensures that no value is present for Type, not even an explicit nil -### GetActorId - -`func (o *ScheduleAction) GetActorId() string` - -GetActorId returns the ActorId field if non-nil, zero value otherwise. - -### GetActorIdOk - -`func (o *ScheduleAction) GetActorIdOk() (*string, bool)` - -GetActorIdOk returns a tuple with the ActorId field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetActorId - -`func (o *ScheduleAction) SetActorId(v string)` - -SetActorId sets ActorId field to given value. - - -### GetRunInput - -`func (o *ScheduleAction) GetRunInput() ScheduleActionRunInput` - -GetRunInput returns the RunInput field if non-nil, zero value otherwise. - -### GetRunInputOk - -`func (o *ScheduleAction) GetRunInputOk() (*ScheduleActionRunInput, bool)` - -GetRunInputOk returns a tuple with the RunInput field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetRunInput - -`func (o *ScheduleAction) SetRunInput(v ScheduleActionRunInput)` - -SetRunInput sets RunInput field to given value. - -### HasRunInput - -`func (o *ScheduleAction) HasRunInput() bool` - -HasRunInput returns a boolean if a field has been set. - -### GetRunOptions - -`func (o *ScheduleAction) GetRunOptions() TaskOptions` - -GetRunOptions returns the RunOptions field if non-nil, zero value otherwise. - -### GetRunOptionsOk - -`func (o *ScheduleAction) GetRunOptionsOk() (*TaskOptions, bool)` - -GetRunOptionsOk returns a tuple with the RunOptions field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetRunOptions - -`func (o *ScheduleAction) SetRunOptions(v TaskOptions)` - -SetRunOptions sets RunOptions field to given value. - -### HasRunOptions - -`func (o *ScheduleAction) HasRunOptions() bool` - -HasRunOptions returns a boolean if a field has been set. - -### GetActorTaskId - -`func (o *ScheduleAction) GetActorTaskId() string` - -GetActorTaskId returns the ActorTaskId field if non-nil, zero value otherwise. - -### GetActorTaskIdOk - -`func (o *ScheduleAction) GetActorTaskIdOk() (*string, bool)` - -GetActorTaskIdOk returns a tuple with the ActorTaskId field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetActorTaskId - -`func (o *ScheduleAction) SetActorTaskId(v string)` - -SetActorTaskId sets ActorTaskId field to given value. - - -### GetInput - -`func (o *ScheduleAction) GetInput() map[string]interface{}` - -GetInput returns the Input field if non-nil, zero value otherwise. - -### GetInputOk - -`func (o *ScheduleAction) GetInputOk() (*map[string]interface{}, bool)` - -GetInputOk returns a tuple with the Input field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetInput - -`func (o *ScheduleAction) SetInput(v map[string]interface{})` - -SetInput sets Input field to given value. - -### HasInput - -`func (o *ScheduleAction) HasInput() bool` - -HasInput returns a boolean if a field has been set. - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/ScheduleActionRunActor.md b/docs/ScheduleActionRunActor.md deleted file mode 100644 index 14e9c0c..0000000 --- a/docs/ScheduleActionRunActor.md +++ /dev/null @@ -1,175 +0,0 @@ -# ScheduleActionRunActor - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Id** | **string** | | -**Type** | **interface{}** | | -**ActorId** | **string** | | -**RunInput** | Pointer to [**NullableScheduleActionRunInput**](ScheduleActionRunInput.md) | | [optional] -**RunOptions** | Pointer to [**NullableTaskOptions**](TaskOptions.md) | | [optional] - -## Methods - -### NewScheduleActionRunActor - -`func NewScheduleActionRunActor(id string, type_ interface{}, actorId string, ) *ScheduleActionRunActor` - -NewScheduleActionRunActor instantiates a new ScheduleActionRunActor object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewScheduleActionRunActorWithDefaults - -`func NewScheduleActionRunActorWithDefaults() *ScheduleActionRunActor` - -NewScheduleActionRunActorWithDefaults instantiates a new ScheduleActionRunActor object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetId - -`func (o *ScheduleActionRunActor) GetId() string` - -GetId returns the Id field if non-nil, zero value otherwise. - -### GetIdOk - -`func (o *ScheduleActionRunActor) GetIdOk() (*string, bool)` - -GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetId - -`func (o *ScheduleActionRunActor) SetId(v string)` - -SetId sets Id field to given value. - - -### GetType - -`func (o *ScheduleActionRunActor) GetType() interface{}` - -GetType returns the Type field if non-nil, zero value otherwise. - -### GetTypeOk - -`func (o *ScheduleActionRunActor) GetTypeOk() (*interface{}, bool)` - -GetTypeOk returns a tuple with the Type field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetType - -`func (o *ScheduleActionRunActor) SetType(v interface{})` - -SetType sets Type field to given value. - - -### SetTypeNil - -`func (o *ScheduleActionRunActor) SetTypeNil(b bool)` - - SetTypeNil sets the value for Type to be an explicit nil - -### UnsetType -`func (o *ScheduleActionRunActor) UnsetType()` - -UnsetType ensures that no value is present for Type, not even an explicit nil -### GetActorId - -`func (o *ScheduleActionRunActor) GetActorId() string` - -GetActorId returns the ActorId field if non-nil, zero value otherwise. - -### GetActorIdOk - -`func (o *ScheduleActionRunActor) GetActorIdOk() (*string, bool)` - -GetActorIdOk returns a tuple with the ActorId field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetActorId - -`func (o *ScheduleActionRunActor) SetActorId(v string)` - -SetActorId sets ActorId field to given value. - - -### GetRunInput - -`func (o *ScheduleActionRunActor) GetRunInput() ScheduleActionRunInput` - -GetRunInput returns the RunInput field if non-nil, zero value otherwise. - -### GetRunInputOk - -`func (o *ScheduleActionRunActor) GetRunInputOk() (*ScheduleActionRunInput, bool)` - -GetRunInputOk returns a tuple with the RunInput field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetRunInput - -`func (o *ScheduleActionRunActor) SetRunInput(v ScheduleActionRunInput)` - -SetRunInput sets RunInput field to given value. - -### HasRunInput - -`func (o *ScheduleActionRunActor) HasRunInput() bool` - -HasRunInput returns a boolean if a field has been set. - -### SetRunInputNil - -`func (o *ScheduleActionRunActor) SetRunInputNil(b bool)` - - SetRunInputNil sets the value for RunInput to be an explicit nil - -### UnsetRunInput -`func (o *ScheduleActionRunActor) UnsetRunInput()` - -UnsetRunInput ensures that no value is present for RunInput, not even an explicit nil -### GetRunOptions - -`func (o *ScheduleActionRunActor) GetRunOptions() TaskOptions` - -GetRunOptions returns the RunOptions field if non-nil, zero value otherwise. - -### GetRunOptionsOk - -`func (o *ScheduleActionRunActor) GetRunOptionsOk() (*TaskOptions, bool)` - -GetRunOptionsOk returns a tuple with the RunOptions field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetRunOptions - -`func (o *ScheduleActionRunActor) SetRunOptions(v TaskOptions)` - -SetRunOptions sets RunOptions field to given value. - -### HasRunOptions - -`func (o *ScheduleActionRunActor) HasRunOptions() bool` - -HasRunOptions returns a boolean if a field has been set. - -### SetRunOptionsNil - -`func (o *ScheduleActionRunActor) SetRunOptionsNil(b bool)` - - SetRunOptionsNil sets the value for RunOptions to be an explicit nil - -### UnsetRunOptions -`func (o *ScheduleActionRunActor) UnsetRunOptions()` - -UnsetRunOptions ensures that no value is present for RunOptions, not even an explicit nil - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/ScheduleActionRunActorTask.md b/docs/ScheduleActionRunActorTask.md deleted file mode 100644 index 962cacb..0000000 --- a/docs/ScheduleActionRunActorTask.md +++ /dev/null @@ -1,139 +0,0 @@ -# ScheduleActionRunActorTask - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Id** | **string** | | -**Type** | **interface{}** | | -**ActorTaskId** | **string** | | -**Input** | Pointer to **map[string]interface{}** | | [optional] - -## Methods - -### NewScheduleActionRunActorTask - -`func NewScheduleActionRunActorTask(id string, type_ interface{}, actorTaskId string, ) *ScheduleActionRunActorTask` - -NewScheduleActionRunActorTask instantiates a new ScheduleActionRunActorTask object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewScheduleActionRunActorTaskWithDefaults - -`func NewScheduleActionRunActorTaskWithDefaults() *ScheduleActionRunActorTask` - -NewScheduleActionRunActorTaskWithDefaults instantiates a new ScheduleActionRunActorTask object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetId - -`func (o *ScheduleActionRunActorTask) GetId() string` - -GetId returns the Id field if non-nil, zero value otherwise. - -### GetIdOk - -`func (o *ScheduleActionRunActorTask) GetIdOk() (*string, bool)` - -GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetId - -`func (o *ScheduleActionRunActorTask) SetId(v string)` - -SetId sets Id field to given value. - - -### GetType - -`func (o *ScheduleActionRunActorTask) GetType() interface{}` - -GetType returns the Type field if non-nil, zero value otherwise. - -### GetTypeOk - -`func (o *ScheduleActionRunActorTask) GetTypeOk() (*interface{}, bool)` - -GetTypeOk returns a tuple with the Type field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetType - -`func (o *ScheduleActionRunActorTask) SetType(v interface{})` - -SetType sets Type field to given value. - - -### SetTypeNil - -`func (o *ScheduleActionRunActorTask) SetTypeNil(b bool)` - - SetTypeNil sets the value for Type to be an explicit nil - -### UnsetType -`func (o *ScheduleActionRunActorTask) UnsetType()` - -UnsetType ensures that no value is present for Type, not even an explicit nil -### GetActorTaskId - -`func (o *ScheduleActionRunActorTask) GetActorTaskId() string` - -GetActorTaskId returns the ActorTaskId field if non-nil, zero value otherwise. - -### GetActorTaskIdOk - -`func (o *ScheduleActionRunActorTask) GetActorTaskIdOk() (*string, bool)` - -GetActorTaskIdOk returns a tuple with the ActorTaskId field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetActorTaskId - -`func (o *ScheduleActionRunActorTask) SetActorTaskId(v string)` - -SetActorTaskId sets ActorTaskId field to given value. - - -### GetInput - -`func (o *ScheduleActionRunActorTask) GetInput() map[string]interface{}` - -GetInput returns the Input field if non-nil, zero value otherwise. - -### GetInputOk - -`func (o *ScheduleActionRunActorTask) GetInputOk() (*map[string]interface{}, bool)` - -GetInputOk returns a tuple with the Input field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetInput - -`func (o *ScheduleActionRunActorTask) SetInput(v map[string]interface{})` - -SetInput sets Input field to given value. - -### HasInput - -`func (o *ScheduleActionRunActorTask) HasInput() bool` - -HasInput returns a boolean if a field has been set. - -### SetInputNil - -`func (o *ScheduleActionRunActorTask) SetInputNil(b bool)` - - SetInputNil sets the value for Input to be an explicit nil - -### UnsetInput -`func (o *ScheduleActionRunActorTask) UnsetInput()` - -UnsetInput ensures that no value is present for Input, not even an explicit nil - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/ScheduleActionRunInput.md b/docs/ScheduleActionRunInput.md deleted file mode 100644 index c379df4..0000000 --- a/docs/ScheduleActionRunInput.md +++ /dev/null @@ -1,102 +0,0 @@ -# ScheduleActionRunInput - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Body** | Pointer to **NullableString** | | [optional] -**ContentType** | Pointer to **NullableString** | | [optional] - -## Methods - -### NewScheduleActionRunInput - -`func NewScheduleActionRunInput() *ScheduleActionRunInput` - -NewScheduleActionRunInput instantiates a new ScheduleActionRunInput object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewScheduleActionRunInputWithDefaults - -`func NewScheduleActionRunInputWithDefaults() *ScheduleActionRunInput` - -NewScheduleActionRunInputWithDefaults instantiates a new ScheduleActionRunInput object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetBody - -`func (o *ScheduleActionRunInput) GetBody() string` - -GetBody returns the Body field if non-nil, zero value otherwise. - -### GetBodyOk - -`func (o *ScheduleActionRunInput) GetBodyOk() (*string, bool)` - -GetBodyOk returns a tuple with the Body field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetBody - -`func (o *ScheduleActionRunInput) SetBody(v string)` - -SetBody sets Body field to given value. - -### HasBody - -`func (o *ScheduleActionRunInput) HasBody() bool` - -HasBody returns a boolean if a field has been set. - -### SetBodyNil - -`func (o *ScheduleActionRunInput) SetBodyNil(b bool)` - - SetBodyNil sets the value for Body to be an explicit nil - -### UnsetBody -`func (o *ScheduleActionRunInput) UnsetBody()` - -UnsetBody ensures that no value is present for Body, not even an explicit nil -### GetContentType - -`func (o *ScheduleActionRunInput) GetContentType() string` - -GetContentType returns the ContentType field if non-nil, zero value otherwise. - -### GetContentTypeOk - -`func (o *ScheduleActionRunInput) GetContentTypeOk() (*string, bool)` - -GetContentTypeOk returns a tuple with the ContentType field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetContentType - -`func (o *ScheduleActionRunInput) SetContentType(v string)` - -SetContentType sets ContentType field to given value. - -### HasContentType - -`func (o *ScheduleActionRunInput) HasContentType() bool` - -HasContentType returns a boolean if a field has been set. - -### SetContentTypeNil - -`func (o *ScheduleActionRunInput) SetContentTypeNil(b bool)` - - SetContentTypeNil sets the value for ContentType to be an explicit nil - -### UnsetContentType -`func (o *ScheduleActionRunInput) UnsetContentType()` - -UnsetContentType ensures that no value is present for ContentType, not even an explicit nil - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/ScheduleActionShort.md b/docs/ScheduleActionShort.md deleted file mode 100644 index 90c2f8f..0000000 --- a/docs/ScheduleActionShort.md +++ /dev/null @@ -1,124 +0,0 @@ -# ScheduleActionShort - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Id** | **string** | | -**Type** | **interface{}** | | -**ActorId** | **string** | | -**ActorTaskId** | **string** | | - -## Methods - -### NewScheduleActionShort - -`func NewScheduleActionShort(id string, type_ interface{}, actorId string, actorTaskId string, ) *ScheduleActionShort` - -NewScheduleActionShort instantiates a new ScheduleActionShort object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewScheduleActionShortWithDefaults - -`func NewScheduleActionShortWithDefaults() *ScheduleActionShort` - -NewScheduleActionShortWithDefaults instantiates a new ScheduleActionShort object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetId - -`func (o *ScheduleActionShort) GetId() string` - -GetId returns the Id field if non-nil, zero value otherwise. - -### GetIdOk - -`func (o *ScheduleActionShort) GetIdOk() (*string, bool)` - -GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetId - -`func (o *ScheduleActionShort) SetId(v string)` - -SetId sets Id field to given value. - - -### GetType - -`func (o *ScheduleActionShort) GetType() interface{}` - -GetType returns the Type field if non-nil, zero value otherwise. - -### GetTypeOk - -`func (o *ScheduleActionShort) GetTypeOk() (*interface{}, bool)` - -GetTypeOk returns a tuple with the Type field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetType - -`func (o *ScheduleActionShort) SetType(v interface{})` - -SetType sets Type field to given value. - - -### SetTypeNil - -`func (o *ScheduleActionShort) SetTypeNil(b bool)` - - SetTypeNil sets the value for Type to be an explicit nil - -### UnsetType -`func (o *ScheduleActionShort) UnsetType()` - -UnsetType ensures that no value is present for Type, not even an explicit nil -### GetActorId - -`func (o *ScheduleActionShort) GetActorId() string` - -GetActorId returns the ActorId field if non-nil, zero value otherwise. - -### GetActorIdOk - -`func (o *ScheduleActionShort) GetActorIdOk() (*string, bool)` - -GetActorIdOk returns a tuple with the ActorId field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetActorId - -`func (o *ScheduleActionShort) SetActorId(v string)` - -SetActorId sets ActorId field to given value. - - -### GetActorTaskId - -`func (o *ScheduleActionShort) GetActorTaskId() string` - -GetActorTaskId returns the ActorTaskId field if non-nil, zero value otherwise. - -### GetActorTaskIdOk - -`func (o *ScheduleActionShort) GetActorTaskIdOk() (*string, bool)` - -GetActorTaskIdOk returns a tuple with the ActorTaskId field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetActorTaskId - -`func (o *ScheduleActionShort) SetActorTaskId(v string)` - -SetActorTaskId sets ActorTaskId field to given value. - - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/ScheduleActionShortRunActor.md b/docs/ScheduleActionShortRunActor.md deleted file mode 100644 index a95f5ef..0000000 --- a/docs/ScheduleActionShortRunActor.md +++ /dev/null @@ -1,103 +0,0 @@ -# ScheduleActionShortRunActor - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Id** | **string** | | -**Type** | **interface{}** | | -**ActorId** | **string** | | - -## Methods - -### NewScheduleActionShortRunActor - -`func NewScheduleActionShortRunActor(id string, type_ interface{}, actorId string, ) *ScheduleActionShortRunActor` - -NewScheduleActionShortRunActor instantiates a new ScheduleActionShortRunActor object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewScheduleActionShortRunActorWithDefaults - -`func NewScheduleActionShortRunActorWithDefaults() *ScheduleActionShortRunActor` - -NewScheduleActionShortRunActorWithDefaults instantiates a new ScheduleActionShortRunActor object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetId - -`func (o *ScheduleActionShortRunActor) GetId() string` - -GetId returns the Id field if non-nil, zero value otherwise. - -### GetIdOk - -`func (o *ScheduleActionShortRunActor) GetIdOk() (*string, bool)` - -GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetId - -`func (o *ScheduleActionShortRunActor) SetId(v string)` - -SetId sets Id field to given value. - - -### GetType - -`func (o *ScheduleActionShortRunActor) GetType() interface{}` - -GetType returns the Type field if non-nil, zero value otherwise. - -### GetTypeOk - -`func (o *ScheduleActionShortRunActor) GetTypeOk() (*interface{}, bool)` - -GetTypeOk returns a tuple with the Type field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetType - -`func (o *ScheduleActionShortRunActor) SetType(v interface{})` - -SetType sets Type field to given value. - - -### SetTypeNil - -`func (o *ScheduleActionShortRunActor) SetTypeNil(b bool)` - - SetTypeNil sets the value for Type to be an explicit nil - -### UnsetType -`func (o *ScheduleActionShortRunActor) UnsetType()` - -UnsetType ensures that no value is present for Type, not even an explicit nil -### GetActorId - -`func (o *ScheduleActionShortRunActor) GetActorId() string` - -GetActorId returns the ActorId field if non-nil, zero value otherwise. - -### GetActorIdOk - -`func (o *ScheduleActionShortRunActor) GetActorIdOk() (*string, bool)` - -GetActorIdOk returns a tuple with the ActorId field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetActorId - -`func (o *ScheduleActionShortRunActor) SetActorId(v string)` - -SetActorId sets ActorId field to given value. - - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/ScheduleActionShortRunActorTask.md b/docs/ScheduleActionShortRunActorTask.md deleted file mode 100644 index 8253ded..0000000 --- a/docs/ScheduleActionShortRunActorTask.md +++ /dev/null @@ -1,103 +0,0 @@ -# ScheduleActionShortRunActorTask - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Id** | **string** | | -**Type** | **interface{}** | | -**ActorTaskId** | **string** | | - -## Methods - -### NewScheduleActionShortRunActorTask - -`func NewScheduleActionShortRunActorTask(id string, type_ interface{}, actorTaskId string, ) *ScheduleActionShortRunActorTask` - -NewScheduleActionShortRunActorTask instantiates a new ScheduleActionShortRunActorTask object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewScheduleActionShortRunActorTaskWithDefaults - -`func NewScheduleActionShortRunActorTaskWithDefaults() *ScheduleActionShortRunActorTask` - -NewScheduleActionShortRunActorTaskWithDefaults instantiates a new ScheduleActionShortRunActorTask object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetId - -`func (o *ScheduleActionShortRunActorTask) GetId() string` - -GetId returns the Id field if non-nil, zero value otherwise. - -### GetIdOk - -`func (o *ScheduleActionShortRunActorTask) GetIdOk() (*string, bool)` - -GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetId - -`func (o *ScheduleActionShortRunActorTask) SetId(v string)` - -SetId sets Id field to given value. - - -### GetType - -`func (o *ScheduleActionShortRunActorTask) GetType() interface{}` - -GetType returns the Type field if non-nil, zero value otherwise. - -### GetTypeOk - -`func (o *ScheduleActionShortRunActorTask) GetTypeOk() (*interface{}, bool)` - -GetTypeOk returns a tuple with the Type field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetType - -`func (o *ScheduleActionShortRunActorTask) SetType(v interface{})` - -SetType sets Type field to given value. - - -### SetTypeNil - -`func (o *ScheduleActionShortRunActorTask) SetTypeNil(b bool)` - - SetTypeNil sets the value for Type to be an explicit nil - -### UnsetType -`func (o *ScheduleActionShortRunActorTask) UnsetType()` - -UnsetType ensures that no value is present for Type, not even an explicit nil -### GetActorTaskId - -`func (o *ScheduleActionShortRunActorTask) GetActorTaskId() string` - -GetActorTaskId returns the ActorTaskId field if non-nil, zero value otherwise. - -### GetActorTaskIdOk - -`func (o *ScheduleActionShortRunActorTask) GetActorTaskIdOk() (*string, bool)` - -GetActorTaskIdOk returns a tuple with the ActorTaskId field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetActorTaskId - -`func (o *ScheduleActionShortRunActorTask) SetActorTaskId(v string)` - -SetActorTaskId sets ActorTaskId field to given value. - - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/ScheduleBase.md b/docs/ScheduleBase.md deleted file mode 100644 index 44e5f7d..0000000 --- a/docs/ScheduleBase.md +++ /dev/null @@ -1,291 +0,0 @@ -# ScheduleBase - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Id** | **string** | | -**UserId** | **string** | | -**Name** | **string** | | -**CronExpression** | **string** | | -**Timezone** | **string** | | -**IsEnabled** | **bool** | | -**IsExclusive** | **bool** | | -**CreatedAt** | **time.Time** | | -**ModifiedAt** | **time.Time** | | -**NextRunAt** | Pointer to **NullableTime** | | [optional] -**LastRunAt** | Pointer to **NullableTime** | | [optional] - -## Methods - -### NewScheduleBase - -`func NewScheduleBase(id string, userId string, name string, cronExpression string, timezone string, isEnabled bool, isExclusive bool, createdAt time.Time, modifiedAt time.Time, ) *ScheduleBase` - -NewScheduleBase instantiates a new ScheduleBase object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewScheduleBaseWithDefaults - -`func NewScheduleBaseWithDefaults() *ScheduleBase` - -NewScheduleBaseWithDefaults instantiates a new ScheduleBase object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetId - -`func (o *ScheduleBase) GetId() string` - -GetId returns the Id field if non-nil, zero value otherwise. - -### GetIdOk - -`func (o *ScheduleBase) GetIdOk() (*string, bool)` - -GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetId - -`func (o *ScheduleBase) SetId(v string)` - -SetId sets Id field to given value. - - -### GetUserId - -`func (o *ScheduleBase) GetUserId() string` - -GetUserId returns the UserId field if non-nil, zero value otherwise. - -### GetUserIdOk - -`func (o *ScheduleBase) GetUserIdOk() (*string, bool)` - -GetUserIdOk returns a tuple with the UserId field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetUserId - -`func (o *ScheduleBase) SetUserId(v string)` - -SetUserId sets UserId field to given value. - - -### GetName - -`func (o *ScheduleBase) GetName() string` - -GetName returns the Name field if non-nil, zero value otherwise. - -### GetNameOk - -`func (o *ScheduleBase) GetNameOk() (*string, bool)` - -GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetName - -`func (o *ScheduleBase) SetName(v string)` - -SetName sets Name field to given value. - - -### GetCronExpression - -`func (o *ScheduleBase) GetCronExpression() string` - -GetCronExpression returns the CronExpression field if non-nil, zero value otherwise. - -### GetCronExpressionOk - -`func (o *ScheduleBase) GetCronExpressionOk() (*string, bool)` - -GetCronExpressionOk returns a tuple with the CronExpression field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetCronExpression - -`func (o *ScheduleBase) SetCronExpression(v string)` - -SetCronExpression sets CronExpression field to given value. - - -### GetTimezone - -`func (o *ScheduleBase) GetTimezone() string` - -GetTimezone returns the Timezone field if non-nil, zero value otherwise. - -### GetTimezoneOk - -`func (o *ScheduleBase) GetTimezoneOk() (*string, bool)` - -GetTimezoneOk returns a tuple with the Timezone field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetTimezone - -`func (o *ScheduleBase) SetTimezone(v string)` - -SetTimezone sets Timezone field to given value. - - -### GetIsEnabled - -`func (o *ScheduleBase) GetIsEnabled() bool` - -GetIsEnabled returns the IsEnabled field if non-nil, zero value otherwise. - -### GetIsEnabledOk - -`func (o *ScheduleBase) GetIsEnabledOk() (*bool, bool)` - -GetIsEnabledOk returns a tuple with the IsEnabled field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetIsEnabled - -`func (o *ScheduleBase) SetIsEnabled(v bool)` - -SetIsEnabled sets IsEnabled field to given value. - - -### GetIsExclusive - -`func (o *ScheduleBase) GetIsExclusive() bool` - -GetIsExclusive returns the IsExclusive field if non-nil, zero value otherwise. - -### GetIsExclusiveOk - -`func (o *ScheduleBase) GetIsExclusiveOk() (*bool, bool)` - -GetIsExclusiveOk returns a tuple with the IsExclusive field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetIsExclusive - -`func (o *ScheduleBase) SetIsExclusive(v bool)` - -SetIsExclusive sets IsExclusive field to given value. - - -### GetCreatedAt - -`func (o *ScheduleBase) GetCreatedAt() time.Time` - -GetCreatedAt returns the CreatedAt field if non-nil, zero value otherwise. - -### GetCreatedAtOk - -`func (o *ScheduleBase) GetCreatedAtOk() (*time.Time, bool)` - -GetCreatedAtOk returns a tuple with the CreatedAt field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetCreatedAt - -`func (o *ScheduleBase) SetCreatedAt(v time.Time)` - -SetCreatedAt sets CreatedAt field to given value. - - -### GetModifiedAt - -`func (o *ScheduleBase) GetModifiedAt() time.Time` - -GetModifiedAt returns the ModifiedAt field if non-nil, zero value otherwise. - -### GetModifiedAtOk - -`func (o *ScheduleBase) GetModifiedAtOk() (*time.Time, bool)` - -GetModifiedAtOk returns a tuple with the ModifiedAt field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetModifiedAt - -`func (o *ScheduleBase) SetModifiedAt(v time.Time)` - -SetModifiedAt sets ModifiedAt field to given value. - - -### GetNextRunAt - -`func (o *ScheduleBase) GetNextRunAt() time.Time` - -GetNextRunAt returns the NextRunAt field if non-nil, zero value otherwise. - -### GetNextRunAtOk - -`func (o *ScheduleBase) GetNextRunAtOk() (*time.Time, bool)` - -GetNextRunAtOk returns a tuple with the NextRunAt field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetNextRunAt - -`func (o *ScheduleBase) SetNextRunAt(v time.Time)` - -SetNextRunAt sets NextRunAt field to given value. - -### HasNextRunAt - -`func (o *ScheduleBase) HasNextRunAt() bool` - -HasNextRunAt returns a boolean if a field has been set. - -### SetNextRunAtNil - -`func (o *ScheduleBase) SetNextRunAtNil(b bool)` - - SetNextRunAtNil sets the value for NextRunAt to be an explicit nil - -### UnsetNextRunAt -`func (o *ScheduleBase) UnsetNextRunAt()` - -UnsetNextRunAt ensures that no value is present for NextRunAt, not even an explicit nil -### GetLastRunAt - -`func (o *ScheduleBase) GetLastRunAt() time.Time` - -GetLastRunAt returns the LastRunAt field if non-nil, zero value otherwise. - -### GetLastRunAtOk - -`func (o *ScheduleBase) GetLastRunAtOk() (*time.Time, bool)` - -GetLastRunAtOk returns a tuple with the LastRunAt field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetLastRunAt - -`func (o *ScheduleBase) SetLastRunAt(v time.Time)` - -SetLastRunAt sets LastRunAt field to given value. - -### HasLastRunAt - -`func (o *ScheduleBase) HasLastRunAt() bool` - -HasLastRunAt returns a boolean if a field has been set. - -### SetLastRunAtNil - -`func (o *ScheduleBase) SetLastRunAtNil(b bool)` - - SetLastRunAtNil sets the value for LastRunAt to be an explicit nil - -### UnsetLastRunAt -`func (o *ScheduleBase) UnsetLastRunAt()` - -UnsetLastRunAt ensures that no value is present for LastRunAt, not even an explicit nil - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/ScheduleCreate.md b/docs/ScheduleCreate.md deleted file mode 100644 index 49a0f4f..0000000 --- a/docs/ScheduleCreate.md +++ /dev/null @@ -1,318 +0,0 @@ -# ScheduleCreate - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Name** | Pointer to **NullableString** | | [optional] -**IsEnabled** | Pointer to **NullableBool** | | [optional] -**IsExclusive** | Pointer to **NullableBool** | | [optional] -**CronExpression** | Pointer to **NullableString** | | [optional] -**Timezone** | Pointer to **NullableString** | | [optional] -**Description** | Pointer to **NullableString** | | [optional] -**Title** | Pointer to **NullableString** | | [optional] -**Actions** | Pointer to [**[]ScheduleCreateAction**](ScheduleCreateAction.md) | | [optional] - -## Methods - -### NewScheduleCreate - -`func NewScheduleCreate() *ScheduleCreate` - -NewScheduleCreate instantiates a new ScheduleCreate object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewScheduleCreateWithDefaults - -`func NewScheduleCreateWithDefaults() *ScheduleCreate` - -NewScheduleCreateWithDefaults instantiates a new ScheduleCreate object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetName - -`func (o *ScheduleCreate) GetName() string` - -GetName returns the Name field if non-nil, zero value otherwise. - -### GetNameOk - -`func (o *ScheduleCreate) GetNameOk() (*string, bool)` - -GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetName - -`func (o *ScheduleCreate) SetName(v string)` - -SetName sets Name field to given value. - -### HasName - -`func (o *ScheduleCreate) HasName() bool` - -HasName returns a boolean if a field has been set. - -### SetNameNil - -`func (o *ScheduleCreate) SetNameNil(b bool)` - - SetNameNil sets the value for Name to be an explicit nil - -### UnsetName -`func (o *ScheduleCreate) UnsetName()` - -UnsetName ensures that no value is present for Name, not even an explicit nil -### GetIsEnabled - -`func (o *ScheduleCreate) GetIsEnabled() bool` - -GetIsEnabled returns the IsEnabled field if non-nil, zero value otherwise. - -### GetIsEnabledOk - -`func (o *ScheduleCreate) GetIsEnabledOk() (*bool, bool)` - -GetIsEnabledOk returns a tuple with the IsEnabled field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetIsEnabled - -`func (o *ScheduleCreate) SetIsEnabled(v bool)` - -SetIsEnabled sets IsEnabled field to given value. - -### HasIsEnabled - -`func (o *ScheduleCreate) HasIsEnabled() bool` - -HasIsEnabled returns a boolean if a field has been set. - -### SetIsEnabledNil - -`func (o *ScheduleCreate) SetIsEnabledNil(b bool)` - - SetIsEnabledNil sets the value for IsEnabled to be an explicit nil - -### UnsetIsEnabled -`func (o *ScheduleCreate) UnsetIsEnabled()` - -UnsetIsEnabled ensures that no value is present for IsEnabled, not even an explicit nil -### GetIsExclusive - -`func (o *ScheduleCreate) GetIsExclusive() bool` - -GetIsExclusive returns the IsExclusive field if non-nil, zero value otherwise. - -### GetIsExclusiveOk - -`func (o *ScheduleCreate) GetIsExclusiveOk() (*bool, bool)` - -GetIsExclusiveOk returns a tuple with the IsExclusive field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetIsExclusive - -`func (o *ScheduleCreate) SetIsExclusive(v bool)` - -SetIsExclusive sets IsExclusive field to given value. - -### HasIsExclusive - -`func (o *ScheduleCreate) HasIsExclusive() bool` - -HasIsExclusive returns a boolean if a field has been set. - -### SetIsExclusiveNil - -`func (o *ScheduleCreate) SetIsExclusiveNil(b bool)` - - SetIsExclusiveNil sets the value for IsExclusive to be an explicit nil - -### UnsetIsExclusive -`func (o *ScheduleCreate) UnsetIsExclusive()` - -UnsetIsExclusive ensures that no value is present for IsExclusive, not even an explicit nil -### GetCronExpression - -`func (o *ScheduleCreate) GetCronExpression() string` - -GetCronExpression returns the CronExpression field if non-nil, zero value otherwise. - -### GetCronExpressionOk - -`func (o *ScheduleCreate) GetCronExpressionOk() (*string, bool)` - -GetCronExpressionOk returns a tuple with the CronExpression field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetCronExpression - -`func (o *ScheduleCreate) SetCronExpression(v string)` - -SetCronExpression sets CronExpression field to given value. - -### HasCronExpression - -`func (o *ScheduleCreate) HasCronExpression() bool` - -HasCronExpression returns a boolean if a field has been set. - -### SetCronExpressionNil - -`func (o *ScheduleCreate) SetCronExpressionNil(b bool)` - - SetCronExpressionNil sets the value for CronExpression to be an explicit nil - -### UnsetCronExpression -`func (o *ScheduleCreate) UnsetCronExpression()` - -UnsetCronExpression ensures that no value is present for CronExpression, not even an explicit nil -### GetTimezone - -`func (o *ScheduleCreate) GetTimezone() string` - -GetTimezone returns the Timezone field if non-nil, zero value otherwise. - -### GetTimezoneOk - -`func (o *ScheduleCreate) GetTimezoneOk() (*string, bool)` - -GetTimezoneOk returns a tuple with the Timezone field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetTimezone - -`func (o *ScheduleCreate) SetTimezone(v string)` - -SetTimezone sets Timezone field to given value. - -### HasTimezone - -`func (o *ScheduleCreate) HasTimezone() bool` - -HasTimezone returns a boolean if a field has been set. - -### SetTimezoneNil - -`func (o *ScheduleCreate) SetTimezoneNil(b bool)` - - SetTimezoneNil sets the value for Timezone to be an explicit nil - -### UnsetTimezone -`func (o *ScheduleCreate) UnsetTimezone()` - -UnsetTimezone ensures that no value is present for Timezone, not even an explicit nil -### GetDescription - -`func (o *ScheduleCreate) GetDescription() string` - -GetDescription returns the Description field if non-nil, zero value otherwise. - -### GetDescriptionOk - -`func (o *ScheduleCreate) GetDescriptionOk() (*string, bool)` - -GetDescriptionOk returns a tuple with the Description field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetDescription - -`func (o *ScheduleCreate) SetDescription(v string)` - -SetDescription sets Description field to given value. - -### HasDescription - -`func (o *ScheduleCreate) HasDescription() bool` - -HasDescription returns a boolean if a field has been set. - -### SetDescriptionNil - -`func (o *ScheduleCreate) SetDescriptionNil(b bool)` - - SetDescriptionNil sets the value for Description to be an explicit nil - -### UnsetDescription -`func (o *ScheduleCreate) UnsetDescription()` - -UnsetDescription ensures that no value is present for Description, not even an explicit nil -### GetTitle - -`func (o *ScheduleCreate) GetTitle() string` - -GetTitle returns the Title field if non-nil, zero value otherwise. - -### GetTitleOk - -`func (o *ScheduleCreate) GetTitleOk() (*string, bool)` - -GetTitleOk returns a tuple with the Title field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetTitle - -`func (o *ScheduleCreate) SetTitle(v string)` - -SetTitle sets Title field to given value. - -### HasTitle - -`func (o *ScheduleCreate) HasTitle() bool` - -HasTitle returns a boolean if a field has been set. - -### SetTitleNil - -`func (o *ScheduleCreate) SetTitleNil(b bool)` - - SetTitleNil sets the value for Title to be an explicit nil - -### UnsetTitle -`func (o *ScheduleCreate) UnsetTitle()` - -UnsetTitle ensures that no value is present for Title, not even an explicit nil -### GetActions - -`func (o *ScheduleCreate) GetActions() []ScheduleCreateAction` - -GetActions returns the Actions field if non-nil, zero value otherwise. - -### GetActionsOk - -`func (o *ScheduleCreate) GetActionsOk() (*[]ScheduleCreateAction, bool)` - -GetActionsOk returns a tuple with the Actions field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetActions - -`func (o *ScheduleCreate) SetActions(v []ScheduleCreateAction)` - -SetActions sets Actions field to given value. - -### HasActions - -`func (o *ScheduleCreate) HasActions() bool` - -HasActions returns a boolean if a field has been set. - -### SetActionsNil - -`func (o *ScheduleCreate) SetActionsNil(b bool)` - - SetActionsNil sets the value for Actions to be an explicit nil - -### UnsetActions -`func (o *ScheduleCreate) UnsetActions()` - -UnsetActions ensures that no value is present for Actions, not even an explicit nil - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/ScheduleCreateAction.md b/docs/ScheduleCreateAction.md deleted file mode 100644 index e838370..0000000 --- a/docs/ScheduleCreateAction.md +++ /dev/null @@ -1,181 +0,0 @@ -# ScheduleCreateAction - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Type** | **interface{}** | | -**ActorId** | **string** | | -**RunInput** | Pointer to [**ScheduleActionRunInput**](ScheduleActionRunInput.md) | | [optional] -**RunOptions** | Pointer to [**TaskOptions**](TaskOptions.md) | | [optional] -**ActorTaskId** | **string** | | -**Input** | Pointer to **map[string]interface{}** | | [optional] - -## Methods - -### NewScheduleCreateAction - -`func NewScheduleCreateAction(type_ interface{}, actorId string, actorTaskId string, ) *ScheduleCreateAction` - -NewScheduleCreateAction instantiates a new ScheduleCreateAction object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewScheduleCreateActionWithDefaults - -`func NewScheduleCreateActionWithDefaults() *ScheduleCreateAction` - -NewScheduleCreateActionWithDefaults instantiates a new ScheduleCreateAction object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetType - -`func (o *ScheduleCreateAction) GetType() interface{}` - -GetType returns the Type field if non-nil, zero value otherwise. - -### GetTypeOk - -`func (o *ScheduleCreateAction) GetTypeOk() (*interface{}, bool)` - -GetTypeOk returns a tuple with the Type field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetType - -`func (o *ScheduleCreateAction) SetType(v interface{})` - -SetType sets Type field to given value. - - -### SetTypeNil - -`func (o *ScheduleCreateAction) SetTypeNil(b bool)` - - SetTypeNil sets the value for Type to be an explicit nil - -### UnsetType -`func (o *ScheduleCreateAction) UnsetType()` - -UnsetType ensures that no value is present for Type, not even an explicit nil -### GetActorId - -`func (o *ScheduleCreateAction) GetActorId() string` - -GetActorId returns the ActorId field if non-nil, zero value otherwise. - -### GetActorIdOk - -`func (o *ScheduleCreateAction) GetActorIdOk() (*string, bool)` - -GetActorIdOk returns a tuple with the ActorId field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetActorId - -`func (o *ScheduleCreateAction) SetActorId(v string)` - -SetActorId sets ActorId field to given value. - - -### GetRunInput - -`func (o *ScheduleCreateAction) GetRunInput() ScheduleActionRunInput` - -GetRunInput returns the RunInput field if non-nil, zero value otherwise. - -### GetRunInputOk - -`func (o *ScheduleCreateAction) GetRunInputOk() (*ScheduleActionRunInput, bool)` - -GetRunInputOk returns a tuple with the RunInput field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetRunInput - -`func (o *ScheduleCreateAction) SetRunInput(v ScheduleActionRunInput)` - -SetRunInput sets RunInput field to given value. - -### HasRunInput - -`func (o *ScheduleCreateAction) HasRunInput() bool` - -HasRunInput returns a boolean if a field has been set. - -### GetRunOptions - -`func (o *ScheduleCreateAction) GetRunOptions() TaskOptions` - -GetRunOptions returns the RunOptions field if non-nil, zero value otherwise. - -### GetRunOptionsOk - -`func (o *ScheduleCreateAction) GetRunOptionsOk() (*TaskOptions, bool)` - -GetRunOptionsOk returns a tuple with the RunOptions field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetRunOptions - -`func (o *ScheduleCreateAction) SetRunOptions(v TaskOptions)` - -SetRunOptions sets RunOptions field to given value. - -### HasRunOptions - -`func (o *ScheduleCreateAction) HasRunOptions() bool` - -HasRunOptions returns a boolean if a field has been set. - -### GetActorTaskId - -`func (o *ScheduleCreateAction) GetActorTaskId() string` - -GetActorTaskId returns the ActorTaskId field if non-nil, zero value otherwise. - -### GetActorTaskIdOk - -`func (o *ScheduleCreateAction) GetActorTaskIdOk() (*string, bool)` - -GetActorTaskIdOk returns a tuple with the ActorTaskId field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetActorTaskId - -`func (o *ScheduleCreateAction) SetActorTaskId(v string)` - -SetActorTaskId sets ActorTaskId field to given value. - - -### GetInput - -`func (o *ScheduleCreateAction) GetInput() map[string]interface{}` - -GetInput returns the Input field if non-nil, zero value otherwise. - -### GetInputOk - -`func (o *ScheduleCreateAction) GetInputOk() (*map[string]interface{}, bool)` - -GetInputOk returns a tuple with the Input field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetInput - -`func (o *ScheduleCreateAction) SetInput(v map[string]interface{})` - -SetInput sets Input field to given value. - -### HasInput - -`func (o *ScheduleCreateAction) HasInput() bool` - -HasInput returns a boolean if a field has been set. - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/ScheduleCreateActionRunActor.md b/docs/ScheduleCreateActionRunActor.md deleted file mode 100644 index 422b64b..0000000 --- a/docs/ScheduleCreateActionRunActor.md +++ /dev/null @@ -1,154 +0,0 @@ -# ScheduleCreateActionRunActor - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Type** | **interface{}** | | -**ActorId** | **string** | | -**RunInput** | Pointer to [**NullableScheduleActionRunInput**](ScheduleActionRunInput.md) | | [optional] -**RunOptions** | Pointer to [**NullableTaskOptions**](TaskOptions.md) | | [optional] - -## Methods - -### NewScheduleCreateActionRunActor - -`func NewScheduleCreateActionRunActor(type_ interface{}, actorId string, ) *ScheduleCreateActionRunActor` - -NewScheduleCreateActionRunActor instantiates a new ScheduleCreateActionRunActor object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewScheduleCreateActionRunActorWithDefaults - -`func NewScheduleCreateActionRunActorWithDefaults() *ScheduleCreateActionRunActor` - -NewScheduleCreateActionRunActorWithDefaults instantiates a new ScheduleCreateActionRunActor object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetType - -`func (o *ScheduleCreateActionRunActor) GetType() interface{}` - -GetType returns the Type field if non-nil, zero value otherwise. - -### GetTypeOk - -`func (o *ScheduleCreateActionRunActor) GetTypeOk() (*interface{}, bool)` - -GetTypeOk returns a tuple with the Type field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetType - -`func (o *ScheduleCreateActionRunActor) SetType(v interface{})` - -SetType sets Type field to given value. - - -### SetTypeNil - -`func (o *ScheduleCreateActionRunActor) SetTypeNil(b bool)` - - SetTypeNil sets the value for Type to be an explicit nil - -### UnsetType -`func (o *ScheduleCreateActionRunActor) UnsetType()` - -UnsetType ensures that no value is present for Type, not even an explicit nil -### GetActorId - -`func (o *ScheduleCreateActionRunActor) GetActorId() string` - -GetActorId returns the ActorId field if non-nil, zero value otherwise. - -### GetActorIdOk - -`func (o *ScheduleCreateActionRunActor) GetActorIdOk() (*string, bool)` - -GetActorIdOk returns a tuple with the ActorId field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetActorId - -`func (o *ScheduleCreateActionRunActor) SetActorId(v string)` - -SetActorId sets ActorId field to given value. - - -### GetRunInput - -`func (o *ScheduleCreateActionRunActor) GetRunInput() ScheduleActionRunInput` - -GetRunInput returns the RunInput field if non-nil, zero value otherwise. - -### GetRunInputOk - -`func (o *ScheduleCreateActionRunActor) GetRunInputOk() (*ScheduleActionRunInput, bool)` - -GetRunInputOk returns a tuple with the RunInput field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetRunInput - -`func (o *ScheduleCreateActionRunActor) SetRunInput(v ScheduleActionRunInput)` - -SetRunInput sets RunInput field to given value. - -### HasRunInput - -`func (o *ScheduleCreateActionRunActor) HasRunInput() bool` - -HasRunInput returns a boolean if a field has been set. - -### SetRunInputNil - -`func (o *ScheduleCreateActionRunActor) SetRunInputNil(b bool)` - - SetRunInputNil sets the value for RunInput to be an explicit nil - -### UnsetRunInput -`func (o *ScheduleCreateActionRunActor) UnsetRunInput()` - -UnsetRunInput ensures that no value is present for RunInput, not even an explicit nil -### GetRunOptions - -`func (o *ScheduleCreateActionRunActor) GetRunOptions() TaskOptions` - -GetRunOptions returns the RunOptions field if non-nil, zero value otherwise. - -### GetRunOptionsOk - -`func (o *ScheduleCreateActionRunActor) GetRunOptionsOk() (*TaskOptions, bool)` - -GetRunOptionsOk returns a tuple with the RunOptions field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetRunOptions - -`func (o *ScheduleCreateActionRunActor) SetRunOptions(v TaskOptions)` - -SetRunOptions sets RunOptions field to given value. - -### HasRunOptions - -`func (o *ScheduleCreateActionRunActor) HasRunOptions() bool` - -HasRunOptions returns a boolean if a field has been set. - -### SetRunOptionsNil - -`func (o *ScheduleCreateActionRunActor) SetRunOptionsNil(b bool)` - - SetRunOptionsNil sets the value for RunOptions to be an explicit nil - -### UnsetRunOptions -`func (o *ScheduleCreateActionRunActor) UnsetRunOptions()` - -UnsetRunOptions ensures that no value is present for RunOptions, not even an explicit nil - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/ScheduleCreateActionRunActorTask.md b/docs/ScheduleCreateActionRunActorTask.md deleted file mode 100644 index 8f0f67e..0000000 --- a/docs/ScheduleCreateActionRunActorTask.md +++ /dev/null @@ -1,118 +0,0 @@ -# ScheduleCreateActionRunActorTask - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Type** | **interface{}** | | -**ActorTaskId** | **string** | | -**Input** | Pointer to **map[string]interface{}** | | [optional] - -## Methods - -### NewScheduleCreateActionRunActorTask - -`func NewScheduleCreateActionRunActorTask(type_ interface{}, actorTaskId string, ) *ScheduleCreateActionRunActorTask` - -NewScheduleCreateActionRunActorTask instantiates a new ScheduleCreateActionRunActorTask object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewScheduleCreateActionRunActorTaskWithDefaults - -`func NewScheduleCreateActionRunActorTaskWithDefaults() *ScheduleCreateActionRunActorTask` - -NewScheduleCreateActionRunActorTaskWithDefaults instantiates a new ScheduleCreateActionRunActorTask object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetType - -`func (o *ScheduleCreateActionRunActorTask) GetType() interface{}` - -GetType returns the Type field if non-nil, zero value otherwise. - -### GetTypeOk - -`func (o *ScheduleCreateActionRunActorTask) GetTypeOk() (*interface{}, bool)` - -GetTypeOk returns a tuple with the Type field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetType - -`func (o *ScheduleCreateActionRunActorTask) SetType(v interface{})` - -SetType sets Type field to given value. - - -### SetTypeNil - -`func (o *ScheduleCreateActionRunActorTask) SetTypeNil(b bool)` - - SetTypeNil sets the value for Type to be an explicit nil - -### UnsetType -`func (o *ScheduleCreateActionRunActorTask) UnsetType()` - -UnsetType ensures that no value is present for Type, not even an explicit nil -### GetActorTaskId - -`func (o *ScheduleCreateActionRunActorTask) GetActorTaskId() string` - -GetActorTaskId returns the ActorTaskId field if non-nil, zero value otherwise. - -### GetActorTaskIdOk - -`func (o *ScheduleCreateActionRunActorTask) GetActorTaskIdOk() (*string, bool)` - -GetActorTaskIdOk returns a tuple with the ActorTaskId field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetActorTaskId - -`func (o *ScheduleCreateActionRunActorTask) SetActorTaskId(v string)` - -SetActorTaskId sets ActorTaskId field to given value. - - -### GetInput - -`func (o *ScheduleCreateActionRunActorTask) GetInput() map[string]interface{}` - -GetInput returns the Input field if non-nil, zero value otherwise. - -### GetInputOk - -`func (o *ScheduleCreateActionRunActorTask) GetInputOk() (*map[string]interface{}, bool)` - -GetInputOk returns a tuple with the Input field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetInput - -`func (o *ScheduleCreateActionRunActorTask) SetInput(v map[string]interface{})` - -SetInput sets Input field to given value. - -### HasInput - -`func (o *ScheduleCreateActionRunActorTask) HasInput() bool` - -HasInput returns a boolean if a field has been set. - -### SetInputNil - -`func (o *ScheduleCreateActionRunActorTask) SetInputNil(b bool)` - - SetInputNil sets the value for Input to be an explicit nil - -### UnsetInput -`func (o *ScheduleCreateActionRunActorTask) UnsetInput()` - -UnsetInput ensures that no value is present for Input, not even an explicit nil - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/ScheduleInvoked.md b/docs/ScheduleInvoked.md deleted file mode 100644 index a0bdd9a..0000000 --- a/docs/ScheduleInvoked.md +++ /dev/null @@ -1,93 +0,0 @@ -# ScheduleInvoked - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Message** | **string** | | -**Level** | **string** | | -**CreatedAt** | **time.Time** | | - -## Methods - -### NewScheduleInvoked - -`func NewScheduleInvoked(message string, level string, createdAt time.Time, ) *ScheduleInvoked` - -NewScheduleInvoked instantiates a new ScheduleInvoked object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewScheduleInvokedWithDefaults - -`func NewScheduleInvokedWithDefaults() *ScheduleInvoked` - -NewScheduleInvokedWithDefaults instantiates a new ScheduleInvoked object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetMessage - -`func (o *ScheduleInvoked) GetMessage() string` - -GetMessage returns the Message field if non-nil, zero value otherwise. - -### GetMessageOk - -`func (o *ScheduleInvoked) GetMessageOk() (*string, bool)` - -GetMessageOk returns a tuple with the Message field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetMessage - -`func (o *ScheduleInvoked) SetMessage(v string)` - -SetMessage sets Message field to given value. - - -### GetLevel - -`func (o *ScheduleInvoked) GetLevel() string` - -GetLevel returns the Level field if non-nil, zero value otherwise. - -### GetLevelOk - -`func (o *ScheduleInvoked) GetLevelOk() (*string, bool)` - -GetLevelOk returns a tuple with the Level field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetLevel - -`func (o *ScheduleInvoked) SetLevel(v string)` - -SetLevel sets Level field to given value. - - -### GetCreatedAt - -`func (o *ScheduleInvoked) GetCreatedAt() time.Time` - -GetCreatedAt returns the CreatedAt field if non-nil, zero value otherwise. - -### GetCreatedAtOk - -`func (o *ScheduleInvoked) GetCreatedAtOk() (*time.Time, bool)` - -GetCreatedAtOk returns a tuple with the CreatedAt field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetCreatedAt - -`func (o *ScheduleInvoked) SetCreatedAt(v time.Time)` - -SetCreatedAt sets CreatedAt field to given value. - - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/ScheduleLogResponse.md b/docs/ScheduleLogResponse.md deleted file mode 100644 index 9ccc7a1..0000000 --- a/docs/ScheduleLogResponse.md +++ /dev/null @@ -1,51 +0,0 @@ -# ScheduleLogResponse - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Data** | [**[]ScheduleInvoked**](ScheduleInvoked.md) | | - -## Methods - -### NewScheduleLogResponse - -`func NewScheduleLogResponse(data []ScheduleInvoked, ) *ScheduleLogResponse` - -NewScheduleLogResponse instantiates a new ScheduleLogResponse object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewScheduleLogResponseWithDefaults - -`func NewScheduleLogResponseWithDefaults() *ScheduleLogResponse` - -NewScheduleLogResponseWithDefaults instantiates a new ScheduleLogResponse object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetData - -`func (o *ScheduleLogResponse) GetData() []ScheduleInvoked` - -GetData returns the Data field if non-nil, zero value otherwise. - -### GetDataOk - -`func (o *ScheduleLogResponse) GetDataOk() (*[]ScheduleInvoked, bool)` - -GetDataOk returns a tuple with the Data field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetData - -`func (o *ScheduleLogResponse) SetData(v []ScheduleInvoked)` - -SetData sets Data field to given value. - - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/ScheduleNotifications.md b/docs/ScheduleNotifications.md deleted file mode 100644 index a3b32d0..0000000 --- a/docs/ScheduleNotifications.md +++ /dev/null @@ -1,56 +0,0 @@ -# ScheduleNotifications - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Email** | Pointer to **bool** | | [optional] - -## Methods - -### NewScheduleNotifications - -`func NewScheduleNotifications() *ScheduleNotifications` - -NewScheduleNotifications instantiates a new ScheduleNotifications object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewScheduleNotificationsWithDefaults - -`func NewScheduleNotificationsWithDefaults() *ScheduleNotifications` - -NewScheduleNotificationsWithDefaults instantiates a new ScheduleNotifications object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetEmail - -`func (o *ScheduleNotifications) GetEmail() bool` - -GetEmail returns the Email field if non-nil, zero value otherwise. - -### GetEmailOk - -`func (o *ScheduleNotifications) GetEmailOk() (*bool, bool)` - -GetEmailOk returns a tuple with the Email field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetEmail - -`func (o *ScheduleNotifications) SetEmail(v bool)` - -SetEmail sets Email field to given value. - -### HasEmail - -`func (o *ScheduleNotifications) HasEmail() bool` - -HasEmail returns a boolean if a field has been set. - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/ScheduleResponse.md b/docs/ScheduleResponse.md deleted file mode 100644 index 95eff18..0000000 --- a/docs/ScheduleResponse.md +++ /dev/null @@ -1,51 +0,0 @@ -# ScheduleResponse - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Data** | [**Schedule**](Schedule.md) | | - -## Methods - -### NewScheduleResponse - -`func NewScheduleResponse(data Schedule, ) *ScheduleResponse` - -NewScheduleResponse instantiates a new ScheduleResponse object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewScheduleResponseWithDefaults - -`func NewScheduleResponseWithDefaults() *ScheduleResponse` - -NewScheduleResponseWithDefaults instantiates a new ScheduleResponse object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetData - -`func (o *ScheduleResponse) GetData() Schedule` - -GetData returns the Data field if non-nil, zero value otherwise. - -### GetDataOk - -`func (o *ScheduleResponse) GetDataOk() (*Schedule, bool)` - -GetDataOk returns a tuple with the Data field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetData - -`func (o *ScheduleResponse) SetData(v Schedule)` - -SetData sets Data field to given value. - - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/ScheduleShort.md b/docs/ScheduleShort.md deleted file mode 100644 index 81faad5..0000000 --- a/docs/ScheduleShort.md +++ /dev/null @@ -1,292 +0,0 @@ -# ScheduleShort - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Id** | **string** | | -**UserId** | **string** | | -**Name** | **string** | | -**CronExpression** | **string** | | -**Timezone** | **string** | | -**IsEnabled** | **bool** | | -**IsExclusive** | **bool** | | -**CreatedAt** | **time.Time** | | -**ModifiedAt** | **time.Time** | | -**NextRunAt** | Pointer to **time.Time** | | [optional] -**LastRunAt** | Pointer to **time.Time** | | [optional] -**Actions** | [**[]ScheduleActionShort**](ScheduleActionShort.md) | | - -## Methods - -### NewScheduleShort - -`func NewScheduleShort(id string, userId string, name string, cronExpression string, timezone string, isEnabled bool, isExclusive bool, createdAt time.Time, modifiedAt time.Time, actions []ScheduleActionShort, ) *ScheduleShort` - -NewScheduleShort instantiates a new ScheduleShort object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewScheduleShortWithDefaults - -`func NewScheduleShortWithDefaults() *ScheduleShort` - -NewScheduleShortWithDefaults instantiates a new ScheduleShort object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetId - -`func (o *ScheduleShort) GetId() string` - -GetId returns the Id field if non-nil, zero value otherwise. - -### GetIdOk - -`func (o *ScheduleShort) GetIdOk() (*string, bool)` - -GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetId - -`func (o *ScheduleShort) SetId(v string)` - -SetId sets Id field to given value. - - -### GetUserId - -`func (o *ScheduleShort) GetUserId() string` - -GetUserId returns the UserId field if non-nil, zero value otherwise. - -### GetUserIdOk - -`func (o *ScheduleShort) GetUserIdOk() (*string, bool)` - -GetUserIdOk returns a tuple with the UserId field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetUserId - -`func (o *ScheduleShort) SetUserId(v string)` - -SetUserId sets UserId field to given value. - - -### GetName - -`func (o *ScheduleShort) GetName() string` - -GetName returns the Name field if non-nil, zero value otherwise. - -### GetNameOk - -`func (o *ScheduleShort) GetNameOk() (*string, bool)` - -GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetName - -`func (o *ScheduleShort) SetName(v string)` - -SetName sets Name field to given value. - - -### GetCronExpression - -`func (o *ScheduleShort) GetCronExpression() string` - -GetCronExpression returns the CronExpression field if non-nil, zero value otherwise. - -### GetCronExpressionOk - -`func (o *ScheduleShort) GetCronExpressionOk() (*string, bool)` - -GetCronExpressionOk returns a tuple with the CronExpression field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetCronExpression - -`func (o *ScheduleShort) SetCronExpression(v string)` - -SetCronExpression sets CronExpression field to given value. - - -### GetTimezone - -`func (o *ScheduleShort) GetTimezone() string` - -GetTimezone returns the Timezone field if non-nil, zero value otherwise. - -### GetTimezoneOk - -`func (o *ScheduleShort) GetTimezoneOk() (*string, bool)` - -GetTimezoneOk returns a tuple with the Timezone field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetTimezone - -`func (o *ScheduleShort) SetTimezone(v string)` - -SetTimezone sets Timezone field to given value. - - -### GetIsEnabled - -`func (o *ScheduleShort) GetIsEnabled() bool` - -GetIsEnabled returns the IsEnabled field if non-nil, zero value otherwise. - -### GetIsEnabledOk - -`func (o *ScheduleShort) GetIsEnabledOk() (*bool, bool)` - -GetIsEnabledOk returns a tuple with the IsEnabled field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetIsEnabled - -`func (o *ScheduleShort) SetIsEnabled(v bool)` - -SetIsEnabled sets IsEnabled field to given value. - - -### GetIsExclusive - -`func (o *ScheduleShort) GetIsExclusive() bool` - -GetIsExclusive returns the IsExclusive field if non-nil, zero value otherwise. - -### GetIsExclusiveOk - -`func (o *ScheduleShort) GetIsExclusiveOk() (*bool, bool)` - -GetIsExclusiveOk returns a tuple with the IsExclusive field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetIsExclusive - -`func (o *ScheduleShort) SetIsExclusive(v bool)` - -SetIsExclusive sets IsExclusive field to given value. - - -### GetCreatedAt - -`func (o *ScheduleShort) GetCreatedAt() time.Time` - -GetCreatedAt returns the CreatedAt field if non-nil, zero value otherwise. - -### GetCreatedAtOk - -`func (o *ScheduleShort) GetCreatedAtOk() (*time.Time, bool)` - -GetCreatedAtOk returns a tuple with the CreatedAt field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetCreatedAt - -`func (o *ScheduleShort) SetCreatedAt(v time.Time)` - -SetCreatedAt sets CreatedAt field to given value. - - -### GetModifiedAt - -`func (o *ScheduleShort) GetModifiedAt() time.Time` - -GetModifiedAt returns the ModifiedAt field if non-nil, zero value otherwise. - -### GetModifiedAtOk - -`func (o *ScheduleShort) GetModifiedAtOk() (*time.Time, bool)` - -GetModifiedAtOk returns a tuple with the ModifiedAt field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetModifiedAt - -`func (o *ScheduleShort) SetModifiedAt(v time.Time)` - -SetModifiedAt sets ModifiedAt field to given value. - - -### GetNextRunAt - -`func (o *ScheduleShort) GetNextRunAt() time.Time` - -GetNextRunAt returns the NextRunAt field if non-nil, zero value otherwise. - -### GetNextRunAtOk - -`func (o *ScheduleShort) GetNextRunAtOk() (*time.Time, bool)` - -GetNextRunAtOk returns a tuple with the NextRunAt field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetNextRunAt - -`func (o *ScheduleShort) SetNextRunAt(v time.Time)` - -SetNextRunAt sets NextRunAt field to given value. - -### HasNextRunAt - -`func (o *ScheduleShort) HasNextRunAt() bool` - -HasNextRunAt returns a boolean if a field has been set. - -### GetLastRunAt - -`func (o *ScheduleShort) GetLastRunAt() time.Time` - -GetLastRunAt returns the LastRunAt field if non-nil, zero value otherwise. - -### GetLastRunAtOk - -`func (o *ScheduleShort) GetLastRunAtOk() (*time.Time, bool)` - -GetLastRunAtOk returns a tuple with the LastRunAt field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetLastRunAt - -`func (o *ScheduleShort) SetLastRunAt(v time.Time)` - -SetLastRunAt sets LastRunAt field to given value. - -### HasLastRunAt - -`func (o *ScheduleShort) HasLastRunAt() bool` - -HasLastRunAt returns a boolean if a field has been set. - -### GetActions - -`func (o *ScheduleShort) GetActions() []ScheduleActionShort` - -GetActions returns the Actions field if non-nil, zero value otherwise. - -### GetActionsOk - -`func (o *ScheduleShort) GetActionsOk() (*[]ScheduleActionShort, bool)` - -GetActionsOk returns a tuple with the Actions field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetActions - -`func (o *ScheduleShort) SetActions(v []ScheduleActionShort)` - -SetActions sets Actions field to given value. - - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/SchedulesAPI.md b/docs/SchedulesAPI.md deleted file mode 100644 index f5b1d91..0000000 --- a/docs/SchedulesAPI.md +++ /dev/null @@ -1,432 +0,0 @@ -# \SchedulesAPI - -All URIs are relative to *https://api.apify.com* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**ScheduleDelete**](SchedulesAPI.md#ScheduleDelete) | **Delete** /v2/schedules/{scheduleId} | Delete schedule -[**ScheduleGet**](SchedulesAPI.md#ScheduleGet) | **Get** /v2/schedules/{scheduleId} | Get schedule -[**ScheduleLogGet**](SchedulesAPI.md#ScheduleLogGet) | **Get** /v2/schedules/{scheduleId}/log | Get schedule log -[**SchedulePut**](SchedulesAPI.md#SchedulePut) | **Put** /v2/schedules/{scheduleId} | Update schedule -[**SchedulesGet**](SchedulesAPI.md#SchedulesGet) | **Get** /v2/schedules | Get list of schedules -[**SchedulesPost**](SchedulesAPI.md#SchedulesPost) | **Post** /v2/schedules | Create schedule - - - -## ScheduleDelete - -> map[string]interface{} ScheduleDelete(ctx, scheduleId).Execute() - -Delete schedule - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - scheduleId := "asdLZtadYvn4mBZmm" // string | Schedule ID. - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.SchedulesAPI.ScheduleDelete(context.Background(), scheduleId).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `SchedulesAPI.ScheduleDelete``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `ScheduleDelete`: map[string]interface{} - fmt.Fprintf(os.Stdout, "Response from `SchedulesAPI.ScheduleDelete`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**scheduleId** | **string** | Schedule ID. | - -### Other Parameters - -Other parameters are passed through a pointer to a apiScheduleDeleteRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - -### Return type - -**map[string]interface{}** - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## ScheduleGet - -> ScheduleResponse ScheduleGet(ctx, scheduleId).Execute() - -Get schedule - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - scheduleId := "asdLZtadYvn4mBZmm" // string | Schedule ID. - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.SchedulesAPI.ScheduleGet(context.Background(), scheduleId).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `SchedulesAPI.ScheduleGet``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `ScheduleGet`: ScheduleResponse - fmt.Fprintf(os.Stdout, "Response from `SchedulesAPI.ScheduleGet`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**scheduleId** | **string** | Schedule ID. | - -### Other Parameters - -Other parameters are passed through a pointer to a apiScheduleGetRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - -### Return type - -[**ScheduleResponse**](ScheduleResponse.md) - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## ScheduleLogGet - -> ScheduleLogResponse ScheduleLogGet(ctx, scheduleId).Execute() - -Get schedule log - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - scheduleId := "asdLZtadYvn4mBZmm" // string | Schedule ID. - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.SchedulesAPI.ScheduleLogGet(context.Background(), scheduleId).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `SchedulesAPI.ScheduleLogGet``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `ScheduleLogGet`: ScheduleLogResponse - fmt.Fprintf(os.Stdout, "Response from `SchedulesAPI.ScheduleLogGet`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**scheduleId** | **string** | Schedule ID. | - -### Other Parameters - -Other parameters are passed through a pointer to a apiScheduleLogGetRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - -### Return type - -[**ScheduleLogResponse**](ScheduleLogResponse.md) - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## SchedulePut - -> ScheduleResponse SchedulePut(ctx, scheduleId).ScheduleCreate(scheduleCreate).Execute() - -Update schedule - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - scheduleId := "asdLZtadYvn4mBZmm" // string | Schedule ID. - scheduleCreate := *openapiclient.NewScheduleCreate() // ScheduleCreate | - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.SchedulesAPI.SchedulePut(context.Background(), scheduleId).ScheduleCreate(scheduleCreate).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `SchedulesAPI.SchedulePut``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `SchedulePut`: ScheduleResponse - fmt.Fprintf(os.Stdout, "Response from `SchedulesAPI.SchedulePut`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**scheduleId** | **string** | Schedule ID. | - -### Other Parameters - -Other parameters are passed through a pointer to a apiSchedulePutRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - **scheduleCreate** | [**ScheduleCreate**](ScheduleCreate.md) | | - -### Return type - -[**ScheduleResponse**](ScheduleResponse.md) - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## SchedulesGet - -> ListOfSchedulesResponse SchedulesGet(ctx).Offset(offset).Limit(limit).Desc(desc).Execute() - -Get list of schedules - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - offset := float64(0) // float64 | Number of items that should be skipped at the start. The default value is `0`. (optional) - limit := float64(1000) // float64 | Maximum number of items to return. The default value as well as the maximum is `1000`. (optional) - desc := true // bool | If `true` or `1` then the objects are sorted by the `createdAt` field in descending order. By default, they are sorted in ascending order. (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.SchedulesAPI.SchedulesGet(context.Background()).Offset(offset).Limit(limit).Desc(desc).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `SchedulesAPI.SchedulesGet``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `SchedulesGet`: ListOfSchedulesResponse - fmt.Fprintf(os.Stdout, "Response from `SchedulesAPI.SchedulesGet`: %v\n", resp) -} -``` - -### Path Parameters - - - -### Other Parameters - -Other parameters are passed through a pointer to a apiSchedulesGetRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **offset** | **float64** | Number of items that should be skipped at the start. The default value is `0`. | - **limit** | **float64** | Maximum number of items to return. The default value as well as the maximum is `1000`. | - **desc** | **bool** | If `true` or `1` then the objects are sorted by the `createdAt` field in descending order. By default, they are sorted in ascending order. | - -### Return type - -[**ListOfSchedulesResponse**](ListOfSchedulesResponse.md) - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## SchedulesPost - -> ScheduleResponse SchedulesPost(ctx).ScheduleCreate(scheduleCreate).Execute() - -Create schedule - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - scheduleCreate := *openapiclient.NewScheduleCreate() // ScheduleCreate | - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.SchedulesAPI.SchedulesPost(context.Background()).ScheduleCreate(scheduleCreate).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `SchedulesAPI.SchedulesPost``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `SchedulesPost`: ScheduleResponse - fmt.Fprintf(os.Stdout, "Response from `SchedulesAPI.SchedulesPost`: %v\n", resp) -} -``` - -### Path Parameters - - - -### Other Parameters - -Other parameters are passed through a pointer to a apiSchedulesPostRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **scheduleCreate** | [**ScheduleCreate**](ScheduleCreate.md) | | - -### Return type - -[**ScheduleResponse**](ScheduleResponse.md) - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - diff --git a/docs/SchemaValidationErrorData.md b/docs/SchemaValidationErrorData.md deleted file mode 100644 index 66acc8a..0000000 --- a/docs/SchemaValidationErrorData.md +++ /dev/null @@ -1,51 +0,0 @@ -# SchemaValidationErrorData - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**InvalidItems** | [**[]InvalidItem**](InvalidItem.md) | A list of invalid items in the received array of items. | - -## Methods - -### NewSchemaValidationErrorData - -`func NewSchemaValidationErrorData(invalidItems []InvalidItem, ) *SchemaValidationErrorData` - -NewSchemaValidationErrorData instantiates a new SchemaValidationErrorData object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewSchemaValidationErrorDataWithDefaults - -`func NewSchemaValidationErrorDataWithDefaults() *SchemaValidationErrorData` - -NewSchemaValidationErrorDataWithDefaults instantiates a new SchemaValidationErrorData object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetInvalidItems - -`func (o *SchemaValidationErrorData) GetInvalidItems() []InvalidItem` - -GetInvalidItems returns the InvalidItems field if non-nil, zero value otherwise. - -### GetInvalidItemsOk - -`func (o *SchemaValidationErrorData) GetInvalidItemsOk() (*[]InvalidItem, bool)` - -GetInvalidItemsOk returns a tuple with the InvalidItems field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetInvalidItems - -`func (o *SchemaValidationErrorData) SetInvalidItems(v []InvalidItem)` - -SetInvalidItems sets InvalidItems field to given value. - - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/SourceCodeFile.md b/docs/SourceCodeFile.md deleted file mode 100644 index 16211a4..0000000 --- a/docs/SourceCodeFile.md +++ /dev/null @@ -1,103 +0,0 @@ -# SourceCodeFile - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Format** | Pointer to [**SourceCodeFileFormat**](SourceCodeFileFormat.md) | | [optional] -**Content** | Pointer to **string** | | [optional] -**Name** | **string** | | - -## Methods - -### NewSourceCodeFile - -`func NewSourceCodeFile(name string, ) *SourceCodeFile` - -NewSourceCodeFile instantiates a new SourceCodeFile object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewSourceCodeFileWithDefaults - -`func NewSourceCodeFileWithDefaults() *SourceCodeFile` - -NewSourceCodeFileWithDefaults instantiates a new SourceCodeFile object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetFormat - -`func (o *SourceCodeFile) GetFormat() SourceCodeFileFormat` - -GetFormat returns the Format field if non-nil, zero value otherwise. - -### GetFormatOk - -`func (o *SourceCodeFile) GetFormatOk() (*SourceCodeFileFormat, bool)` - -GetFormatOk returns a tuple with the Format field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetFormat - -`func (o *SourceCodeFile) SetFormat(v SourceCodeFileFormat)` - -SetFormat sets Format field to given value. - -### HasFormat - -`func (o *SourceCodeFile) HasFormat() bool` - -HasFormat returns a boolean if a field has been set. - -### GetContent - -`func (o *SourceCodeFile) GetContent() string` - -GetContent returns the Content field if non-nil, zero value otherwise. - -### GetContentOk - -`func (o *SourceCodeFile) GetContentOk() (*string, bool)` - -GetContentOk returns a tuple with the Content field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetContent - -`func (o *SourceCodeFile) SetContent(v string)` - -SetContent sets Content field to given value. - -### HasContent - -`func (o *SourceCodeFile) HasContent() bool` - -HasContent returns a boolean if a field has been set. - -### GetName - -`func (o *SourceCodeFile) GetName() string` - -GetName returns the Name field if non-nil, zero value otherwise. - -### GetNameOk - -`func (o *SourceCodeFile) GetNameOk() (*string, bool)` - -GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetName - -`func (o *SourceCodeFile) SetName(v string)` - -SetName sets Name field to given value. - - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/SourceCodeFileFormat.md b/docs/SourceCodeFileFormat.md deleted file mode 100644 index c263a51..0000000 --- a/docs/SourceCodeFileFormat.md +++ /dev/null @@ -1,13 +0,0 @@ -# SourceCodeFileFormat - -## Enum - - -* `BASE64` (value: `"BASE64"`) - -* `TEXT` (value: `"TEXT"`) - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/SourceCodeFolder.md b/docs/SourceCodeFolder.md deleted file mode 100644 index f35824c..0000000 --- a/docs/SourceCodeFolder.md +++ /dev/null @@ -1,72 +0,0 @@ -# SourceCodeFolder - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Name** | **string** | The folder path relative to the Actor's root directory. | -**Folder** | **bool** | Always `true` for folders. Used to distinguish folders from files. | - -## Methods - -### NewSourceCodeFolder - -`func NewSourceCodeFolder(name string, folder bool, ) *SourceCodeFolder` - -NewSourceCodeFolder instantiates a new SourceCodeFolder object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewSourceCodeFolderWithDefaults - -`func NewSourceCodeFolderWithDefaults() *SourceCodeFolder` - -NewSourceCodeFolderWithDefaults instantiates a new SourceCodeFolder object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetName - -`func (o *SourceCodeFolder) GetName() string` - -GetName returns the Name field if non-nil, zero value otherwise. - -### GetNameOk - -`func (o *SourceCodeFolder) GetNameOk() (*string, bool)` - -GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetName - -`func (o *SourceCodeFolder) SetName(v string)` - -SetName sets Name field to given value. - - -### GetFolder - -`func (o *SourceCodeFolder) GetFolder() bool` - -GetFolder returns the Folder field if non-nil, zero value otherwise. - -### GetFolderOk - -`func (o *SourceCodeFolder) GetFolderOk() (*bool, bool)` - -GetFolderOk returns a tuple with the Folder field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetFolder - -`func (o *SourceCodeFolder) SetFolder(v bool)` - -SetFolder sets Folder field to given value. - - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/StorageDatasetsAPI.md b/docs/StorageDatasetsAPI.md deleted file mode 100644 index b13b2fc..0000000 --- a/docs/StorageDatasetsAPI.md +++ /dev/null @@ -1,743 +0,0 @@ -# \StorageDatasetsAPI - -All URIs are relative to *https://api.apify.com* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**DatasetDelete**](StorageDatasetsAPI.md#DatasetDelete) | **Delete** /v2/datasets/{datasetId} | Delete dataset -[**DatasetGet**](StorageDatasetsAPI.md#DatasetGet) | **Get** /v2/datasets/{datasetId} | Get dataset -[**DatasetItemsGet**](StorageDatasetsAPI.md#DatasetItemsGet) | **Get** /v2/datasets/{datasetId}/items | Get dataset items -[**DatasetItemsHead**](StorageDatasetsAPI.md#DatasetItemsHead) | **Head** /v2/datasets/{datasetId}/items | Get dataset items headers -[**DatasetItemsPost**](StorageDatasetsAPI.md#DatasetItemsPost) | **Post** /v2/datasets/{datasetId}/items | Store items -[**DatasetPut**](StorageDatasetsAPI.md#DatasetPut) | **Put** /v2/datasets/{datasetId} | Update dataset -[**DatasetStatisticsGet**](StorageDatasetsAPI.md#DatasetStatisticsGet) | **Get** /v2/datasets/{datasetId}/statistics | Get dataset statistics -[**DatasetsGet**](StorageDatasetsAPI.md#DatasetsGet) | **Get** /v2/datasets | Get list of datasets -[**DatasetsPost**](StorageDatasetsAPI.md#DatasetsPost) | **Post** /v2/datasets | Create dataset - - - -## DatasetDelete - -> DatasetDelete(ctx, datasetId).Execute() - -Delete dataset - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - datasetId := "WkzbQMuFYuamGv3YF" // string | Dataset ID or `username~dataset-name`. - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - r, err := apiClient.StorageDatasetsAPI.DatasetDelete(context.Background(), datasetId).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `StorageDatasetsAPI.DatasetDelete``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**datasetId** | **string** | Dataset ID or `username~dataset-name`. | - -### Other Parameters - -Other parameters are passed through a pointer to a apiDatasetDeleteRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - -### Return type - - (empty response body) - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## DatasetGet - -> DatasetResponse DatasetGet(ctx, datasetId).Execute() - -Get dataset - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - datasetId := "WkzbQMuFYuamGv3YF" // string | Dataset ID or `username~dataset-name`. - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.StorageDatasetsAPI.DatasetGet(context.Background(), datasetId).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `StorageDatasetsAPI.DatasetGet``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `DatasetGet`: DatasetResponse - fmt.Fprintf(os.Stdout, "Response from `StorageDatasetsAPI.DatasetGet`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**datasetId** | **string** | Dataset ID or `username~dataset-name`. | - -### Other Parameters - -Other parameters are passed through a pointer to a apiDatasetGetRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - -### Return type - -[**DatasetResponse**](DatasetResponse.md) - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## DatasetItemsGet - -> []map[string]interface{} DatasetItemsGet(ctx, datasetId).Format(format).Clean(clean).Offset(offset).Limit(limit).Fields(fields).OutputFields(outputFields).Omit(omit).Unwind(unwind).Flatten(flatten).Desc(desc).Attachment(attachment).Delimiter(delimiter).Bom(bom).XmlRoot(xmlRoot).XmlRow(xmlRow).SkipHeaderRow(skipHeaderRow).SkipHidden(skipHidden).SkipEmpty(skipEmpty).Simplified(simplified).View(view).SkipFailedPages(skipFailedPages).FeedTitle(feedTitle).FeedDescription(feedDescription).Signature(signature).Execute() - -Get dataset items - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - datasetId := "WkzbQMuFYuamGv3YF" // string | Dataset ID or `username~dataset-name`. - format := "json" // string | Format of the results, possible values are: `json`, `jsonl`, `csv`, `html`, `xlsx`, `xml` and `rss`. The default value is `json`. (optional) - clean := false // bool | If `true` or `1` then the API endpoint returns only non-empty items and skips hidden fields (i.e. fields starting with the # character). The `clean` parameter is just a shortcut for `skipHidden=true` and `skipEmpty=true` parameters. Note that since some objects might be skipped from the output, that the result might contain less items than the `limit` value. (optional) - offset := float64(0) // float64 | Number of items that should be skipped at the start. The default value is `0`. (optional) - limit := float64(1.2) // float64 | Maximum number of items to return. By default there is no limit. (optional) - fields := "myValue,myOtherValue" // string | A comma-separated list of fields which should be picked from the items, only these fields will remain in the resulting record objects. Note that the fields in the outputted items are sorted the same way as they are specified in the `fields` query parameter. You can use this feature to effectively fix the output format. (optional) - outputFields := "title,link" // string | A comma-separated list of output field names that positionally rename the fields specified in the `fields` parameter. For example, `?fields=headline,url&outputFields=title,link` renames `headline` to `title` and `url` to `link` in the output. The number of names in `outputFields` must match the number of names in `fields`. Requires the `fields` parameter to be specified as well. (optional) - omit := "myValue,myOtherValue" // string | A comma-separated list of fields which should be omitted from the items. (optional) - unwind := "myValue,myOtherValue" // string | A comma-separated list of fields which should be unwound, in order which they should be processed. Each field should be either an array or an object. If the field is an array then every element of the array will become a separate record and merged with parent object. If the unwound field is an object then it is merged with the parent object. If the unwound field is missing or its value is neither an array nor an object and therefore cannot be merged with a parent object then the item gets preserved as it is. Note that the unwound items ignore the `desc` parameter. (optional) - flatten := "myValue" // string | A comma-separated list of fields which should transform nested objects into flat structures. For example, with `flatten=\"foo\"` the object `{\"foo\":{\"bar\": \"hello\"}}` is turned into `{\"foo.bar\": \"hello\"}`. The original object with properties is replaced with the flattened object. (optional) - desc := true // bool | By default, results are returned in the same order as they were stored. To reverse the order, set this parameter to `true` or `1`. (optional) - attachment := true // bool | If `true` or `1` then the response will define the `Content-Disposition: attachment` header, forcing a web browser to download the file rather than to display it. By default this header is not present. (optional) - delimiter := ";" // string | A delimiter character for CSV files, only used if `format=csv`. You might need to URL-encode the character (e.g. use `%09` for tab or `%3B` for semicolon). The default delimiter is a simple comma (`,`). (optional) - bom := false // bool | All text responses are encoded in UTF-8 encoding. By default, the `format=csv` files are prefixed with the UTF-8 Byte Order Mark (BOM), while `json`, `jsonl`, `xml`, `html` and `rss` files are not. If you want to override this default behavior, specify `bom=1` query parameter to include the BOM or `bom=0` to skip it. (optional) - xmlRoot := "items" // string | Overrides default root element name of `xml` output. By default the root element is `items`. (optional) - xmlRow := "item" // string | Overrides default element name that wraps each page or page function result object in `xml` output. By default the element name is `item`. (optional) - skipHeaderRow := true // bool | If `true` or `1` then header row in the `csv` format is skipped. (optional) - skipHidden := false // bool | If `true` or `1` then hidden fields are skipped from the output, i.e. fields starting with the `#` character. (optional) - skipEmpty := false // bool | If `true` or `1` then empty items are skipped from the output. Note that if used, the results might contain less items than the limit value. (optional) - simplified := false // bool | If `true` or `1` then, the endpoint applies the `fields=url,pageFunctionResult,errorInfo` and `unwind=pageFunctionResult` query parameters. This feature is used to emulate simplified results provided by the legacy Apify Crawler product and it's not recommended to use it in new integrations. (optional) - view := "overview" // string | Defines the view configuration for dataset items based on the schema definition. This parameter determines how the data will be filtered and presented. For complete specification details, see the [dataset schema documentation](/platform/actors/development/actor-definition/dataset-schema). (optional) - skipFailedPages := false // bool | If `true` or `1` then, the all the items with errorInfo property will be skipped from the output. This feature is here to emulate functionality of API version 1 used for the legacy Apify Crawler product and it's not recommended to use it in new integrations. (optional) - feedTitle := "Latest posts from r/pasta" // string | Overrides the auto-generated RSS channel `<title>` element. Only used when `format=rss`. If not provided, the title defaults to `Dataset <label>`. (optional) - feedDescription := "Scraped forum posts" // string | Overrides the auto-generated RSS channel `<description>` element. Only used when `format=rss`. If not provided, the description defaults to `Items in dataset with id \"<datasetId>\".` (optional) - signature := "2wTI46Bg8qWQrV7tavlPI" // string | Signature used for the access. (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.StorageDatasetsAPI.DatasetItemsGet(context.Background(), datasetId).Format(format).Clean(clean).Offset(offset).Limit(limit).Fields(fields).OutputFields(outputFields).Omit(omit).Unwind(unwind).Flatten(flatten).Desc(desc).Attachment(attachment).Delimiter(delimiter).Bom(bom).XmlRoot(xmlRoot).XmlRow(xmlRow).SkipHeaderRow(skipHeaderRow).SkipHidden(skipHidden).SkipEmpty(skipEmpty).Simplified(simplified).View(view).SkipFailedPages(skipFailedPages).FeedTitle(feedTitle).FeedDescription(feedDescription).Signature(signature).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `StorageDatasetsAPI.DatasetItemsGet``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `DatasetItemsGet`: []map[string]interface{} - fmt.Fprintf(os.Stdout, "Response from `StorageDatasetsAPI.DatasetItemsGet`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**datasetId** | **string** | Dataset ID or `username~dataset-name`. | - -### Other Parameters - -Other parameters are passed through a pointer to a apiDatasetItemsGetRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - **format** | **string** | Format of the results, possible values are: `json`, `jsonl`, `csv`, `html`, `xlsx`, `xml` and `rss`. The default value is `json`. | - **clean** | **bool** | If `true` or `1` then the API endpoint returns only non-empty items and skips hidden fields (i.e. fields starting with the # character). The `clean` parameter is just a shortcut for `skipHidden=true` and `skipEmpty=true` parameters. Note that since some objects might be skipped from the output, that the result might contain less items than the `limit` value. | - **offset** | **float64** | Number of items that should be skipped at the start. The default value is `0`. | - **limit** | **float64** | Maximum number of items to return. By default there is no limit. | - **fields** | **string** | A comma-separated list of fields which should be picked from the items, only these fields will remain in the resulting record objects. Note that the fields in the outputted items are sorted the same way as they are specified in the `fields` query parameter. You can use this feature to effectively fix the output format. | - **outputFields** | **string** | A comma-separated list of output field names that positionally rename the fields specified in the `fields` parameter. For example, `?fields=headline,url&outputFields=title,link` renames `headline` to `title` and `url` to `link` in the output. The number of names in `outputFields` must match the number of names in `fields`. Requires the `fields` parameter to be specified as well. | - **omit** | **string** | A comma-separated list of fields which should be omitted from the items. | - **unwind** | **string** | A comma-separated list of fields which should be unwound, in order which they should be processed. Each field should be either an array or an object. If the field is an array then every element of the array will become a separate record and merged with parent object. If the unwound field is an object then it is merged with the parent object. If the unwound field is missing or its value is neither an array nor an object and therefore cannot be merged with a parent object then the item gets preserved as it is. Note that the unwound items ignore the `desc` parameter. | - **flatten** | **string** | A comma-separated list of fields which should transform nested objects into flat structures. For example, with `flatten=\"foo\"` the object `{\"foo\":{\"bar\": \"hello\"}}` is turned into `{\"foo.bar\": \"hello\"}`. The original object with properties is replaced with the flattened object. | - **desc** | **bool** | By default, results are returned in the same order as they were stored. To reverse the order, set this parameter to `true` or `1`. | - **attachment** | **bool** | If `true` or `1` then the response will define the `Content-Disposition: attachment` header, forcing a web browser to download the file rather than to display it. By default this header is not present. | - **delimiter** | **string** | A delimiter character for CSV files, only used if `format=csv`. You might need to URL-encode the character (e.g. use `%09` for tab or `%3B` for semicolon). The default delimiter is a simple comma (`,`). | - **bom** | **bool** | All text responses are encoded in UTF-8 encoding. By default, the `format=csv` files are prefixed with the UTF-8 Byte Order Mark (BOM), while `json`, `jsonl`, `xml`, `html` and `rss` files are not. If you want to override this default behavior, specify `bom=1` query parameter to include the BOM or `bom=0` to skip it. | - **xmlRoot** | **string** | Overrides default root element name of `xml` output. By default the root element is `items`. | - **xmlRow** | **string** | Overrides default element name that wraps each page or page function result object in `xml` output. By default the element name is `item`. | - **skipHeaderRow** | **bool** | If `true` or `1` then header row in the `csv` format is skipped. | - **skipHidden** | **bool** | If `true` or `1` then hidden fields are skipped from the output, i.e. fields starting with the `#` character. | - **skipEmpty** | **bool** | If `true` or `1` then empty items are skipped from the output. Note that if used, the results might contain less items than the limit value. | - **simplified** | **bool** | If `true` or `1` then, the endpoint applies the `fields=url,pageFunctionResult,errorInfo` and `unwind=pageFunctionResult` query parameters. This feature is used to emulate simplified results provided by the legacy Apify Crawler product and it's not recommended to use it in new integrations. | - **view** | **string** | Defines the view configuration for dataset items based on the schema definition. This parameter determines how the data will be filtered and presented. For complete specification details, see the [dataset schema documentation](/platform/actors/development/actor-definition/dataset-schema). | - **skipFailedPages** | **bool** | If `true` or `1` then, the all the items with errorInfo property will be skipped from the output. This feature is here to emulate functionality of API version 1 used for the legacy Apify Crawler product and it's not recommended to use it in new integrations. | - **feedTitle** | **string** | Overrides the auto-generated RSS channel `<title>` element. Only used when `format=rss`. If not provided, the title defaults to `Dataset <label>`. | - **feedDescription** | **string** | Overrides the auto-generated RSS channel `<description>` element. Only used when `format=rss`. If not provided, the description defaults to `Items in dataset with id \"<datasetId>\".` | - **signature** | **string** | Signature used for the access. | - -### Return type - -**[]map[string]interface{}** - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json, application/jsonl, text/csv, text/html, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/rss+xml, application/xml - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## DatasetItemsHead - -> DatasetItemsHead(ctx, datasetId).Format(format).Clean(clean).Offset(offset).Limit(limit).Fields(fields).OutputFields(outputFields).Omit(omit).Unwind(unwind).Flatten(flatten).Desc(desc).Attachment(attachment).Delimiter(delimiter).Bom(bom).XmlRoot(xmlRoot).XmlRow(xmlRow).SkipHeaderRow(skipHeaderRow).SkipHidden(skipHidden).SkipEmpty(skipEmpty).Simplified(simplified).View(view).SkipFailedPages(skipFailedPages).FeedTitle(feedTitle).FeedDescription(feedDescription).Signature(signature).Execute() - -Get dataset items headers - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - datasetId := "WkzbQMuFYuamGv3YF" // string | Dataset ID or `username~dataset-name`. - format := "json" // string | Format of the results, possible values are: `json`, `jsonl`, `csv`, `html`, `xlsx`, `xml` and `rss`. The default value is `json`. (optional) - clean := false // bool | If `true` or `1` then the API endpoint returns only non-empty items and skips hidden fields (i.e. fields starting with the # character). The `clean` parameter is just a shortcut for `skipHidden=true` and `skipEmpty=true` parameters. Note that since some objects might be skipped from the output, that the result might contain less items than the `limit` value. (optional) - offset := float64(0) // float64 | Number of items that should be skipped at the start. The default value is `0`. (optional) - limit := float64(1.2) // float64 | Maximum number of items to return. By default there is no limit. (optional) - fields := "myValue,myOtherValue" // string | A comma-separated list of fields which should be picked from the items, only these fields will remain in the resulting record objects. Note that the fields in the outputted items are sorted the same way as they are specified in the `fields` query parameter. You can use this feature to effectively fix the output format. (optional) - outputFields := "title,link" // string | A comma-separated list of output field names that positionally rename the fields specified in the `fields` parameter. For example, `?fields=headline,url&outputFields=title,link` renames `headline` to `title` and `url` to `link` in the output. The number of names in `outputFields` must match the number of names in `fields`. Requires the `fields` parameter to be specified as well. (optional) - omit := "myValue,myOtherValue" // string | A comma-separated list of fields which should be omitted from the items. (optional) - unwind := "myValue,myOtherValue" // string | A comma-separated list of fields which should be unwound, in order which they should be processed. Each field should be either an array or an object. If the field is an array then every element of the array will become a separate record and merged with parent object. If the unwound field is an object then it is merged with the parent object. If the unwound field is missing or its value is neither an array nor an object and therefore cannot be merged with a parent object then the item gets preserved as it is. Note that the unwound items ignore the `desc` parameter. (optional) - flatten := "myValue" // string | A comma-separated list of fields which should transform nested objects into flat structures. For example, with `flatten=\"foo\"` the object `{\"foo\":{\"bar\": \"hello\"}}` is turned into `{\"foo.bar\": \"hello\"}`. The original object with properties is replaced with the flattened object. (optional) - desc := true // bool | By default, results are returned in the same order as they were stored. To reverse the order, set this parameter to `true` or `1`. (optional) - attachment := true // bool | If `true` or `1` then the response will define the `Content-Disposition: attachment` header, forcing a web browser to download the file rather than to display it. By default this header is not present. (optional) - delimiter := ";" // string | A delimiter character for CSV files, only used if `format=csv`. You might need to URL-encode the character (e.g. use `%09` for tab or `%3B` for semicolon). The default delimiter is a simple comma (`,`). (optional) - bom := false // bool | All text responses are encoded in UTF-8 encoding. By default, the `format=csv` files are prefixed with the UTF-8 Byte Order Mark (BOM), while `json`, `jsonl`, `xml`, `html` and `rss` files are not. If you want to override this default behavior, specify `bom=1` query parameter to include the BOM or `bom=0` to skip it. (optional) - xmlRoot := "items" // string | Overrides default root element name of `xml` output. By default the root element is `items`. (optional) - xmlRow := "item" // string | Overrides default element name that wraps each page or page function result object in `xml` output. By default the element name is `item`. (optional) - skipHeaderRow := true // bool | If `true` or `1` then header row in the `csv` format is skipped. (optional) - skipHidden := false // bool | If `true` or `1` then hidden fields are skipped from the output, i.e. fields starting with the `#` character. (optional) - skipEmpty := false // bool | If `true` or `1` then empty items are skipped from the output. Note that if used, the results might contain less items than the limit value. (optional) - simplified := false // bool | If `true` or `1` then, the endpoint applies the `fields=url,pageFunctionResult,errorInfo` and `unwind=pageFunctionResult` query parameters. This feature is used to emulate simplified results provided by the legacy Apify Crawler product and it's not recommended to use it in new integrations. (optional) - view := "overview" // string | Defines the view configuration for dataset items based on the schema definition. This parameter determines how the data will be filtered and presented. For complete specification details, see the [dataset schema documentation](/platform/actors/development/actor-definition/dataset-schema). (optional) - skipFailedPages := false // bool | If `true` or `1` then, the all the items with errorInfo property will be skipped from the output. This feature is here to emulate functionality of API version 1 used for the legacy Apify Crawler product and it's not recommended to use it in new integrations. (optional) - feedTitle := "Latest posts from r/pasta" // string | Overrides the auto-generated RSS channel `<title>` element. Only used when `format=rss`. If not provided, the title defaults to `Dataset <label>`. (optional) - feedDescription := "Scraped forum posts" // string | Overrides the auto-generated RSS channel `<description>` element. Only used when `format=rss`. If not provided, the description defaults to `Items in dataset with id \"<datasetId>\".` (optional) - signature := "2wTI46Bg8qWQrV7tavlPI" // string | Signature used for the access. (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - r, err := apiClient.StorageDatasetsAPI.DatasetItemsHead(context.Background(), datasetId).Format(format).Clean(clean).Offset(offset).Limit(limit).Fields(fields).OutputFields(outputFields).Omit(omit).Unwind(unwind).Flatten(flatten).Desc(desc).Attachment(attachment).Delimiter(delimiter).Bom(bom).XmlRoot(xmlRoot).XmlRow(xmlRow).SkipHeaderRow(skipHeaderRow).SkipHidden(skipHidden).SkipEmpty(skipEmpty).Simplified(simplified).View(view).SkipFailedPages(skipFailedPages).FeedTitle(feedTitle).FeedDescription(feedDescription).Signature(signature).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `StorageDatasetsAPI.DatasetItemsHead``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**datasetId** | **string** | Dataset ID or `username~dataset-name`. | - -### Other Parameters - -Other parameters are passed through a pointer to a apiDatasetItemsHeadRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - **format** | **string** | Format of the results, possible values are: `json`, `jsonl`, `csv`, `html`, `xlsx`, `xml` and `rss`. The default value is `json`. | - **clean** | **bool** | If `true` or `1` then the API endpoint returns only non-empty items and skips hidden fields (i.e. fields starting with the # character). The `clean` parameter is just a shortcut for `skipHidden=true` and `skipEmpty=true` parameters. Note that since some objects might be skipped from the output, that the result might contain less items than the `limit` value. | - **offset** | **float64** | Number of items that should be skipped at the start. The default value is `0`. | - **limit** | **float64** | Maximum number of items to return. By default there is no limit. | - **fields** | **string** | A comma-separated list of fields which should be picked from the items, only these fields will remain in the resulting record objects. Note that the fields in the outputted items are sorted the same way as they are specified in the `fields` query parameter. You can use this feature to effectively fix the output format. | - **outputFields** | **string** | A comma-separated list of output field names that positionally rename the fields specified in the `fields` parameter. For example, `?fields=headline,url&outputFields=title,link` renames `headline` to `title` and `url` to `link` in the output. The number of names in `outputFields` must match the number of names in `fields`. Requires the `fields` parameter to be specified as well. | - **omit** | **string** | A comma-separated list of fields which should be omitted from the items. | - **unwind** | **string** | A comma-separated list of fields which should be unwound, in order which they should be processed. Each field should be either an array or an object. If the field is an array then every element of the array will become a separate record and merged with parent object. If the unwound field is an object then it is merged with the parent object. If the unwound field is missing or its value is neither an array nor an object and therefore cannot be merged with a parent object then the item gets preserved as it is. Note that the unwound items ignore the `desc` parameter. | - **flatten** | **string** | A comma-separated list of fields which should transform nested objects into flat structures. For example, with `flatten=\"foo\"` the object `{\"foo\":{\"bar\": \"hello\"}}` is turned into `{\"foo.bar\": \"hello\"}`. The original object with properties is replaced with the flattened object. | - **desc** | **bool** | By default, results are returned in the same order as they were stored. To reverse the order, set this parameter to `true` or `1`. | - **attachment** | **bool** | If `true` or `1` then the response will define the `Content-Disposition: attachment` header, forcing a web browser to download the file rather than to display it. By default this header is not present. | - **delimiter** | **string** | A delimiter character for CSV files, only used if `format=csv`. You might need to URL-encode the character (e.g. use `%09` for tab or `%3B` for semicolon). The default delimiter is a simple comma (`,`). | - **bom** | **bool** | All text responses are encoded in UTF-8 encoding. By default, the `format=csv` files are prefixed with the UTF-8 Byte Order Mark (BOM), while `json`, `jsonl`, `xml`, `html` and `rss` files are not. If you want to override this default behavior, specify `bom=1` query parameter to include the BOM or `bom=0` to skip it. | - **xmlRoot** | **string** | Overrides default root element name of `xml` output. By default the root element is `items`. | - **xmlRow** | **string** | Overrides default element name that wraps each page or page function result object in `xml` output. By default the element name is `item`. | - **skipHeaderRow** | **bool** | If `true` or `1` then header row in the `csv` format is skipped. | - **skipHidden** | **bool** | If `true` or `1` then hidden fields are skipped from the output, i.e. fields starting with the `#` character. | - **skipEmpty** | **bool** | If `true` or `1` then empty items are skipped from the output. Note that if used, the results might contain less items than the limit value. | - **simplified** | **bool** | If `true` or `1` then, the endpoint applies the `fields=url,pageFunctionResult,errorInfo` and `unwind=pageFunctionResult` query parameters. This feature is used to emulate simplified results provided by the legacy Apify Crawler product and it's not recommended to use it in new integrations. | - **view** | **string** | Defines the view configuration for dataset items based on the schema definition. This parameter determines how the data will be filtered and presented. For complete specification details, see the [dataset schema documentation](/platform/actors/development/actor-definition/dataset-schema). | - **skipFailedPages** | **bool** | If `true` or `1` then, the all the items with errorInfo property will be skipped from the output. This feature is here to emulate functionality of API version 1 used for the legacy Apify Crawler product and it's not recommended to use it in new integrations. | - **feedTitle** | **string** | Overrides the auto-generated RSS channel `<title>` element. Only used when `format=rss`. If not provided, the title defaults to `Dataset <label>`. | - **feedDescription** | **string** | Overrides the auto-generated RSS channel `<description>` element. Only used when `format=rss`. If not provided, the description defaults to `Items in dataset with id \"<datasetId>\".` | - **signature** | **string** | Signature used for the access. | - -### Return type - - (empty response body) - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## DatasetItemsPost - -> map[string]interface{} DatasetItemsPost(ctx, datasetId).ActRunsLastDatasetItemsPostRequest(actRunsLastDatasetItemsPostRequest).Execute() - -Store items - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - datasetId := "WkzbQMuFYuamGv3YF" // string | Dataset ID or `username~dataset-name`. - actRunsLastDatasetItemsPostRequest := openapiclient.act_runs_last_dataset_items_post_request{ArrayOfMapmapOfStringAny: new([]map[string]interface{})} // ActRunsLastDatasetItemsPostRequest | - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.StorageDatasetsAPI.DatasetItemsPost(context.Background(), datasetId).ActRunsLastDatasetItemsPostRequest(actRunsLastDatasetItemsPostRequest).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `StorageDatasetsAPI.DatasetItemsPost``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `DatasetItemsPost`: map[string]interface{} - fmt.Fprintf(os.Stdout, "Response from `StorageDatasetsAPI.DatasetItemsPost`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**datasetId** | **string** | Dataset ID or `username~dataset-name`. | - -### Other Parameters - -Other parameters are passed through a pointer to a apiDatasetItemsPostRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - **actRunsLastDatasetItemsPostRequest** | [**ActRunsLastDatasetItemsPostRequest**](ActRunsLastDatasetItemsPostRequest.md) | | - -### Return type - -**map[string]interface{}** - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## DatasetPut - -> DatasetResponse DatasetPut(ctx, datasetId).UpdateDatasetRequest(updateDatasetRequest).Execute() - -Update dataset - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - datasetId := "WkzbQMuFYuamGv3YF" // string | Dataset ID or `username~dataset-name`. - updateDatasetRequest := *openapiclient.NewUpdateDatasetRequest() // UpdateDatasetRequest | - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.StorageDatasetsAPI.DatasetPut(context.Background(), datasetId).UpdateDatasetRequest(updateDatasetRequest).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `StorageDatasetsAPI.DatasetPut``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `DatasetPut`: DatasetResponse - fmt.Fprintf(os.Stdout, "Response from `StorageDatasetsAPI.DatasetPut`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**datasetId** | **string** | Dataset ID or `username~dataset-name`. | - -### Other Parameters - -Other parameters are passed through a pointer to a apiDatasetPutRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - **updateDatasetRequest** | [**UpdateDatasetRequest**](UpdateDatasetRequest.md) | | - -### Return type - -[**DatasetResponse**](DatasetResponse.md) - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## DatasetStatisticsGet - -> DatasetStatisticsResponse DatasetStatisticsGet(ctx, datasetId).Execute() - -Get dataset statistics - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - datasetId := "WkzbQMuFYuamGv3YF" // string | Dataset ID or `username~dataset-name`. - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.StorageDatasetsAPI.DatasetStatisticsGet(context.Background(), datasetId).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `StorageDatasetsAPI.DatasetStatisticsGet``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `DatasetStatisticsGet`: DatasetStatisticsResponse - fmt.Fprintf(os.Stdout, "Response from `StorageDatasetsAPI.DatasetStatisticsGet`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**datasetId** | **string** | Dataset ID or `username~dataset-name`. | - -### Other Parameters - -Other parameters are passed through a pointer to a apiDatasetStatisticsGetRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - -### Return type - -[**DatasetStatisticsResponse**](DatasetStatisticsResponse.md) - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## DatasetsGet - -> ListOfDatasetsResponse DatasetsGet(ctx).Offset(offset).Limit(limit).Desc(desc).Unnamed(unnamed).Ownership(ownership).Execute() - -Get list of datasets - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - offset := float64(0) // float64 | Number of items that should be skipped at the start. The default value is `0`. (optional) - limit := float64(1000) // float64 | Maximum number of items to return. The default value as well as the maximum is `1000`. (optional) - desc := true // bool | If `true` or `1` then the objects are sorted by the `createdAt` field in descending order. By default, they are sorted in ascending order. (optional) - unnamed := true // bool | If `true` or `1` then all the storages are returned. By default, only named storages are returned. (optional) - ownership := openapiclient.StorageOwnership("ownedByMe") // StorageOwnership | Filter by ownership. If this parameter is omitted, all accessible datasets are returned. - `ownedByMe`: Return only datasets owned by the user. - `sharedWithMe`: Return only datasets shared with the user by other users. (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.StorageDatasetsAPI.DatasetsGet(context.Background()).Offset(offset).Limit(limit).Desc(desc).Unnamed(unnamed).Ownership(ownership).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `StorageDatasetsAPI.DatasetsGet``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `DatasetsGet`: ListOfDatasetsResponse - fmt.Fprintf(os.Stdout, "Response from `StorageDatasetsAPI.DatasetsGet`: %v\n", resp) -} -``` - -### Path Parameters - - - -### Other Parameters - -Other parameters are passed through a pointer to a apiDatasetsGetRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **offset** | **float64** | Number of items that should be skipped at the start. The default value is `0`. | - **limit** | **float64** | Maximum number of items to return. The default value as well as the maximum is `1000`. | - **desc** | **bool** | If `true` or `1` then the objects are sorted by the `createdAt` field in descending order. By default, they are sorted in ascending order. | - **unnamed** | **bool** | If `true` or `1` then all the storages are returned. By default, only named storages are returned. | - **ownership** | [**StorageOwnership**](StorageOwnership.md) | Filter by ownership. If this parameter is omitted, all accessible datasets are returned. - `ownedByMe`: Return only datasets owned by the user. - `sharedWithMe`: Return only datasets shared with the user by other users. | - -### Return type - -[**ListOfDatasetsResponse**](ListOfDatasetsResponse.md) - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## DatasetsPost - -> DatasetResponse DatasetsPost(ctx).Name(name).Execute() - -Create dataset - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - name := "eshop-items" // string | Custom unique name to easily identify the dataset in the future. (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.StorageDatasetsAPI.DatasetsPost(context.Background()).Name(name).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `StorageDatasetsAPI.DatasetsPost``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `DatasetsPost`: DatasetResponse - fmt.Fprintf(os.Stdout, "Response from `StorageDatasetsAPI.DatasetsPost`: %v\n", resp) -} -``` - -### Path Parameters - - - -### Other Parameters - -Other parameters are passed through a pointer to a apiDatasetsPostRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **name** | **string** | Custom unique name to easily identify the dataset in the future. | - -### Return type - -[**DatasetResponse**](DatasetResponse.md) - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - diff --git a/docs/StorageKeyValueStoresAPI.md b/docs/StorageKeyValueStoresAPI.md deleted file mode 100644 index f36da65..0000000 --- a/docs/StorageKeyValueStoresAPI.md +++ /dev/null @@ -1,899 +0,0 @@ -# \StorageKeyValueStoresAPI - -All URIs are relative to *https://api.apify.com* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**KeyValueStoreDelete**](StorageKeyValueStoresAPI.md#KeyValueStoreDelete) | **Delete** /v2/key-value-stores/{storeId} | Delete store -[**KeyValueStoreGet**](StorageKeyValueStoresAPI.md#KeyValueStoreGet) | **Get** /v2/key-value-stores/{storeId} | Get store -[**KeyValueStoreKeysGet**](StorageKeyValueStoresAPI.md#KeyValueStoreKeysGet) | **Get** /v2/key-value-stores/{storeId}/keys | Get list of keys -[**KeyValueStorePut**](StorageKeyValueStoresAPI.md#KeyValueStorePut) | **Put** /v2/key-value-stores/{storeId} | Update store -[**KeyValueStoreRecordDelete**](StorageKeyValueStoresAPI.md#KeyValueStoreRecordDelete) | **Delete** /v2/key-value-stores/{storeId}/records/{recordKey} | Delete record -[**KeyValueStoreRecordGet**](StorageKeyValueStoresAPI.md#KeyValueStoreRecordGet) | **Get** /v2/key-value-stores/{storeId}/records/{recordKey} | Get record -[**KeyValueStoreRecordHead**](StorageKeyValueStoresAPI.md#KeyValueStoreRecordHead) | **Head** /v2/key-value-stores/{storeId}/records/{recordKey} | Check if a record exists -[**KeyValueStoreRecordPost**](StorageKeyValueStoresAPI.md#KeyValueStoreRecordPost) | **Post** /v2/key-value-stores/{storeId}/records/{recordKey} | Store record (POST) -[**KeyValueStoreRecordPut**](StorageKeyValueStoresAPI.md#KeyValueStoreRecordPut) | **Put** /v2/key-value-stores/{storeId}/records/{recordKey} | Store record -[**KeyValueStoreRecordsGet**](StorageKeyValueStoresAPI.md#KeyValueStoreRecordsGet) | **Get** /v2/key-value-stores/{storeId}/records | Download records -[**KeyValueStoresGet**](StorageKeyValueStoresAPI.md#KeyValueStoresGet) | **Get** /v2/key-value-stores | Get list of key-value stores -[**KeyValueStoresPost**](StorageKeyValueStoresAPI.md#KeyValueStoresPost) | **Post** /v2/key-value-stores | Create key-value store - - - -## KeyValueStoreDelete - -> KeyValueStoreDelete(ctx, storeId).Execute() - -Delete store - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - storeId := "WkzbQMuFYuamGv3YF" // string | Key-value store ID or `username~store-name`. - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - r, err := apiClient.StorageKeyValueStoresAPI.KeyValueStoreDelete(context.Background(), storeId).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `StorageKeyValueStoresAPI.KeyValueStoreDelete``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**storeId** | **string** | Key-value store ID or `username~store-name`. | - -### Other Parameters - -Other parameters are passed through a pointer to a apiKeyValueStoreDeleteRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - -### Return type - - (empty response body) - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## KeyValueStoreGet - -> KeyValueStoreResponse KeyValueStoreGet(ctx, storeId).Execute() - -Get store - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - storeId := "WkzbQMuFYuamGv3YF" // string | Key-value store ID or `username~store-name`. - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.StorageKeyValueStoresAPI.KeyValueStoreGet(context.Background(), storeId).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `StorageKeyValueStoresAPI.KeyValueStoreGet``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `KeyValueStoreGet`: KeyValueStoreResponse - fmt.Fprintf(os.Stdout, "Response from `StorageKeyValueStoresAPI.KeyValueStoreGet`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**storeId** | **string** | Key-value store ID or `username~store-name`. | - -### Other Parameters - -Other parameters are passed through a pointer to a apiKeyValueStoreGetRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - -### Return type - -[**KeyValueStoreResponse**](KeyValueStoreResponse.md) - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## KeyValueStoreKeysGet - -> ListOfKeysResponse KeyValueStoreKeysGet(ctx, storeId).ExclusiveStartKey(exclusiveStartKey).Limit(limit).Collection(collection).Prefix(prefix).Signature(signature).Execute() - -Get list of keys - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - storeId := "WkzbQMuFYuamGv3YF" // string | Key-value store ID or `username~store-name`. - exclusiveStartKey := "Ihnsp8YrvJ8102Kj" // string | All keys up to this one (including) are skipped from the result. (optional) - limit := float32(100) // float32 | Number of keys to be returned. (optional) (default to 1000) - collection := "postImages" // string | Limit the results to keys that belong to a specific collection from the key-value store schema. The key-value store need to have a schema defined for this parameter to work. (optional) - prefix := "post-images-" // string | Limit the results to keys that start with a specific prefix. (optional) - signature := "2wTI46Bg8qWQrV7tavlPI" // string | Signature used for the access. (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.StorageKeyValueStoresAPI.KeyValueStoreKeysGet(context.Background(), storeId).ExclusiveStartKey(exclusiveStartKey).Limit(limit).Collection(collection).Prefix(prefix).Signature(signature).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `StorageKeyValueStoresAPI.KeyValueStoreKeysGet``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `KeyValueStoreKeysGet`: ListOfKeysResponse - fmt.Fprintf(os.Stdout, "Response from `StorageKeyValueStoresAPI.KeyValueStoreKeysGet`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**storeId** | **string** | Key-value store ID or `username~store-name`. | - -### Other Parameters - -Other parameters are passed through a pointer to a apiKeyValueStoreKeysGetRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - **exclusiveStartKey** | **string** | All keys up to this one (including) are skipped from the result. | - **limit** | **float32** | Number of keys to be returned. | [default to 1000] - **collection** | **string** | Limit the results to keys that belong to a specific collection from the key-value store schema. The key-value store need to have a schema defined for this parameter to work. | - **prefix** | **string** | Limit the results to keys that start with a specific prefix. | - **signature** | **string** | Signature used for the access. | - -### Return type - -[**ListOfKeysResponse**](ListOfKeysResponse.md) - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## KeyValueStorePut - -> KeyValueStoreResponse KeyValueStorePut(ctx, storeId).UpdateStoreRequest(updateStoreRequest).Execute() - -Update store - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - storeId := "WkzbQMuFYuamGv3YF" // string | Key-value store ID or `username~store-name`. - updateStoreRequest := *openapiclient.NewUpdateStoreRequest() // UpdateStoreRequest | - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.StorageKeyValueStoresAPI.KeyValueStorePut(context.Background(), storeId).UpdateStoreRequest(updateStoreRequest).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `StorageKeyValueStoresAPI.KeyValueStorePut``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `KeyValueStorePut`: KeyValueStoreResponse - fmt.Fprintf(os.Stdout, "Response from `StorageKeyValueStoresAPI.KeyValueStorePut`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**storeId** | **string** | Key-value store ID or `username~store-name`. | - -### Other Parameters - -Other parameters are passed through a pointer to a apiKeyValueStorePutRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - **updateStoreRequest** | [**UpdateStoreRequest**](UpdateStoreRequest.md) | | - -### Return type - -[**KeyValueStoreResponse**](KeyValueStoreResponse.md) - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## KeyValueStoreRecordDelete - -> KeyValueStoreRecordDelete(ctx, storeId, recordKey).Execute() - -Delete record - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - storeId := "WkzbQMuFYuamGv3YF" // string | Key-value store ID or `username~store-name`. - recordKey := "someKey" // string | Key of the record. - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - r, err := apiClient.StorageKeyValueStoresAPI.KeyValueStoreRecordDelete(context.Background(), storeId, recordKey).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `StorageKeyValueStoresAPI.KeyValueStoreRecordDelete``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**storeId** | **string** | Key-value store ID or `username~store-name`. | -**recordKey** | **string** | Key of the record. | - -### Other Parameters - -Other parameters are passed through a pointer to a apiKeyValueStoreRecordDeleteRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - - -### Return type - - (empty response body) - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## KeyValueStoreRecordGet - -> map[string]interface{} KeyValueStoreRecordGet(ctx, storeId, recordKey).Attachment(attachment).Signature(signature).Execute() - -Get record - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - storeId := "WkzbQMuFYuamGv3YF" // string | Key-value store ID or `username~store-name`. - recordKey := "someKey" // string | Key of the record. - attachment := true // bool | If `true` or `1`, the response will be served with `Content-Disposition: attachment` header, causing web browsers to offer downloading HTML records instead of displaying them. (optional) - signature := "2wTI46Bg8qWQrV7tavlPI" // string | Signature used for the access. (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.StorageKeyValueStoresAPI.KeyValueStoreRecordGet(context.Background(), storeId, recordKey).Attachment(attachment).Signature(signature).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `StorageKeyValueStoresAPI.KeyValueStoreRecordGet``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `KeyValueStoreRecordGet`: map[string]interface{} - fmt.Fprintf(os.Stdout, "Response from `StorageKeyValueStoresAPI.KeyValueStoreRecordGet`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**storeId** | **string** | Key-value store ID or `username~store-name`. | -**recordKey** | **string** | Key of the record. | - -### Other Parameters - -Other parameters are passed through a pointer to a apiKeyValueStoreRecordGetRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - - **attachment** | **bool** | If `true` or `1`, the response will be served with `Content-Disposition: attachment` header, causing web browsers to offer downloading HTML records instead of displaying them. | - **signature** | **string** | Signature used for the access. | - -### Return type - -**map[string]interface{}** - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json, */* - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## KeyValueStoreRecordHead - -> KeyValueStoreRecordHead(ctx, storeId, recordKey).Execute() - -Check if a record exists - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - storeId := "WkzbQMuFYuamGv3YF" // string | Key-value store ID or `username~store-name`. - recordKey := "someKey" // string | Key of the record. - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - r, err := apiClient.StorageKeyValueStoresAPI.KeyValueStoreRecordHead(context.Background(), storeId, recordKey).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `StorageKeyValueStoresAPI.KeyValueStoreRecordHead``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**storeId** | **string** | Key-value store ID or `username~store-name`. | -**recordKey** | **string** | Key of the record. | - -### Other Parameters - -Other parameters are passed through a pointer to a apiKeyValueStoreRecordHeadRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - - -### Return type - - (empty response body) - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## KeyValueStoreRecordPost - -> map[string]interface{} KeyValueStoreRecordPost(ctx, storeId, recordKey).RequestBody(requestBody).ContentEncoding(contentEncoding).Execute() - -Store record (POST) - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - storeId := "WkzbQMuFYuamGv3YF" // string | Key-value store ID or `username~store-name`. - recordKey := "someKey" // string | Key of the record. - requestBody := map[string]interface{}{"key": interface{}(123)} // map[string]interface{} | - contentEncoding := "contentEncoding_example" // string | (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.StorageKeyValueStoresAPI.KeyValueStoreRecordPost(context.Background(), storeId, recordKey).RequestBody(requestBody).ContentEncoding(contentEncoding).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `StorageKeyValueStoresAPI.KeyValueStoreRecordPost``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `KeyValueStoreRecordPost`: map[string]interface{} - fmt.Fprintf(os.Stdout, "Response from `StorageKeyValueStoresAPI.KeyValueStoreRecordPost`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**storeId** | **string** | Key-value store ID or `username~store-name`. | -**recordKey** | **string** | Key of the record. | - -### Other Parameters - -Other parameters are passed through a pointer to a apiKeyValueStoreRecordPostRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - - **requestBody** | **map[string]interface{}** | | - **contentEncoding** | **string** | | - -### Return type - -**map[string]interface{}** - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## KeyValueStoreRecordPut - -> map[string]interface{} KeyValueStoreRecordPut(ctx, storeId, recordKey).RequestBody(requestBody).ContentEncoding(contentEncoding).Execute() - -Store record - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - storeId := "WkzbQMuFYuamGv3YF" // string | Key-value store ID or `username~store-name`. - recordKey := "someKey" // string | Key of the record. - requestBody := map[string]interface{}{"key": interface{}(123)} // map[string]interface{} | - contentEncoding := "contentEncoding_example" // string | (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.StorageKeyValueStoresAPI.KeyValueStoreRecordPut(context.Background(), storeId, recordKey).RequestBody(requestBody).ContentEncoding(contentEncoding).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `StorageKeyValueStoresAPI.KeyValueStoreRecordPut``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `KeyValueStoreRecordPut`: map[string]interface{} - fmt.Fprintf(os.Stdout, "Response from `StorageKeyValueStoresAPI.KeyValueStoreRecordPut`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**storeId** | **string** | Key-value store ID or `username~store-name`. | -**recordKey** | **string** | Key of the record. | - -### Other Parameters - -Other parameters are passed through a pointer to a apiKeyValueStoreRecordPutRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - - **requestBody** | **map[string]interface{}** | | - **contentEncoding** | **string** | | - -### Return type - -**map[string]interface{}** - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## KeyValueStoreRecordsGet - -> *os.File KeyValueStoreRecordsGet(ctx, storeId).Collection(collection).Prefix(prefix).Signature(signature).Execute() - -Download records - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - storeId := "WkzbQMuFYuamGv3YF" // string | Key-value store ID or `username~store-name`. - collection := "my-collection" // string | If specified, only records belonging to a specific collection from the key-value store schema. The key-value store need to have a schema defined for this parameter to work. (optional) - prefix := "my-prefix/" // string | If specified, only records whose key starts with the given prefix are included in the archive. (optional) - signature := "2wTI46Bg8qWQrV7tavlPI" // string | Signature used for the access. (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.StorageKeyValueStoresAPI.KeyValueStoreRecordsGet(context.Background(), storeId).Collection(collection).Prefix(prefix).Signature(signature).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `StorageKeyValueStoresAPI.KeyValueStoreRecordsGet``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `KeyValueStoreRecordsGet`: *os.File - fmt.Fprintf(os.Stdout, "Response from `StorageKeyValueStoresAPI.KeyValueStoreRecordsGet`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**storeId** | **string** | Key-value store ID or `username~store-name`. | - -### Other Parameters - -Other parameters are passed through a pointer to a apiKeyValueStoreRecordsGetRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - **collection** | **string** | If specified, only records belonging to a specific collection from the key-value store schema. The key-value store need to have a schema defined for this parameter to work. | - **prefix** | **string** | If specified, only records whose key starts with the given prefix are included in the archive. | - **signature** | **string** | Signature used for the access. | - -### Return type - -[***os.File**](*os.File.md) - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/zip, application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## KeyValueStoresGet - -> ListOfKeyValueStoresResponse KeyValueStoresGet(ctx).Offset(offset).Limit(limit).Desc(desc).Unnamed(unnamed).Ownership(ownership).Execute() - -Get list of key-value stores - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - offset := float64(0) // float64 | Number of items that should be skipped at the start. The default value is `0`. (optional) - limit := float64(1000) // float64 | Maximum number of items to return. The default value as well as the maximum is `1000`. (optional) - desc := true // bool | If `true` or `1` then the objects are sorted by the `createdAt` field in descending order. By default, they are sorted in ascending order. (optional) - unnamed := true // bool | If `true` or `1` then all the storages are returned. By default, only named storages are returned. (optional) - ownership := openapiclient.StorageOwnership("ownedByMe") // StorageOwnership | Filter by ownership. If this parameter is omitted, all accessible key-value stores are returned. - `ownedByMe`: Return only key-value stores owned by the user. - `sharedWithMe`: Return only key-value stores shared with the user by other users. (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.StorageKeyValueStoresAPI.KeyValueStoresGet(context.Background()).Offset(offset).Limit(limit).Desc(desc).Unnamed(unnamed).Ownership(ownership).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `StorageKeyValueStoresAPI.KeyValueStoresGet``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `KeyValueStoresGet`: ListOfKeyValueStoresResponse - fmt.Fprintf(os.Stdout, "Response from `StorageKeyValueStoresAPI.KeyValueStoresGet`: %v\n", resp) -} -``` - -### Path Parameters - - - -### Other Parameters - -Other parameters are passed through a pointer to a apiKeyValueStoresGetRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **offset** | **float64** | Number of items that should be skipped at the start. The default value is `0`. | - **limit** | **float64** | Maximum number of items to return. The default value as well as the maximum is `1000`. | - **desc** | **bool** | If `true` or `1` then the objects are sorted by the `createdAt` field in descending order. By default, they are sorted in ascending order. | - **unnamed** | **bool** | If `true` or `1` then all the storages are returned. By default, only named storages are returned. | - **ownership** | [**StorageOwnership**](StorageOwnership.md) | Filter by ownership. If this parameter is omitted, all accessible key-value stores are returned. - `ownedByMe`: Return only key-value stores owned by the user. - `sharedWithMe`: Return only key-value stores shared with the user by other users. | - -### Return type - -[**ListOfKeyValueStoresResponse**](ListOfKeyValueStoresResponse.md) - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## KeyValueStoresPost - -> KeyValueStoreResponse KeyValueStoresPost(ctx).Name(name).Execute() - -Create key-value store - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - name := "eshop-values" // string | Custom unique name to easily identify the store in the future. (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.StorageKeyValueStoresAPI.KeyValueStoresPost(context.Background()).Name(name).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `StorageKeyValueStoresAPI.KeyValueStoresPost``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `KeyValueStoresPost`: KeyValueStoreResponse - fmt.Fprintf(os.Stdout, "Response from `StorageKeyValueStoresAPI.KeyValueStoresPost`: %v\n", resp) -} -``` - -### Path Parameters - - - -### Other Parameters - -Other parameters are passed through a pointer to a apiKeyValueStoresPostRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **name** | **string** | Custom unique name to easily identify the store in the future. | - -### Return type - -[**KeyValueStoreResponse**](KeyValueStoreResponse.md) - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - diff --git a/docs/StorageOwnership.md b/docs/StorageOwnership.md deleted file mode 100644 index f2a49c2..0000000 --- a/docs/StorageOwnership.md +++ /dev/null @@ -1,13 +0,0 @@ -# StorageOwnership - -## Enum - - -* `OWNED_BY_ME` (value: `"ownedByMe"`) - -* `SHARED_WITH_ME` (value: `"sharedWithMe"`) - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/StorageRequestQueuesAPI.md b/docs/StorageRequestQueuesAPI.md deleted file mode 100644 index b011785..0000000 --- a/docs/StorageRequestQueuesAPI.md +++ /dev/null @@ -1,517 +0,0 @@ -# \StorageRequestQueuesAPI - -All URIs are relative to *https://api.apify.com* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**RequestQueueDelete**](StorageRequestQueuesAPI.md#RequestQueueDelete) | **Delete** /v2/request-queues/{queueId} | Delete request queue -[**RequestQueueGet**](StorageRequestQueuesAPI.md#RequestQueueGet) | **Get** /v2/request-queues/{queueId} | Get request queue -[**RequestQueuePut**](StorageRequestQueuesAPI.md#RequestQueuePut) | **Put** /v2/request-queues/{queueId} | Update request queue -[**RequestQueueRequestsBatchDelete**](StorageRequestQueuesAPI.md#RequestQueueRequestsBatchDelete) | **Delete** /v2/request-queues/{queueId}/requests/batch | Delete requests -[**RequestQueueRequestsBatchPost**](StorageRequestQueuesAPI.md#RequestQueueRequestsBatchPost) | **Post** /v2/request-queues/{queueId}/requests/batch | Add requests -[**RequestQueuesGet**](StorageRequestQueuesAPI.md#RequestQueuesGet) | **Get** /v2/request-queues | Get list of request queues -[**RequestQueuesPost**](StorageRequestQueuesAPI.md#RequestQueuesPost) | **Post** /v2/request-queues | Create request queue - - - -## RequestQueueDelete - -> RequestQueueDelete(ctx, queueId).Execute() - -Delete request queue - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - queueId := "WkzbQMuFYuamGv3YF" // string | Queue ID or `username~queue-name`. - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - r, err := apiClient.StorageRequestQueuesAPI.RequestQueueDelete(context.Background(), queueId).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `StorageRequestQueuesAPI.RequestQueueDelete``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**queueId** | **string** | Queue ID or `username~queue-name`. | - -### Other Parameters - -Other parameters are passed through a pointer to a apiRequestQueueDeleteRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - -### Return type - - (empty response body) - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## RequestQueueGet - -> RequestQueueResponse RequestQueueGet(ctx, queueId).Execute() - -Get request queue - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - queueId := "WkzbQMuFYuamGv3YF" // string | Queue ID or `username~queue-name`. - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.StorageRequestQueuesAPI.RequestQueueGet(context.Background(), queueId).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `StorageRequestQueuesAPI.RequestQueueGet``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `RequestQueueGet`: RequestQueueResponse - fmt.Fprintf(os.Stdout, "Response from `StorageRequestQueuesAPI.RequestQueueGet`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**queueId** | **string** | Queue ID or `username~queue-name`. | - -### Other Parameters - -Other parameters are passed through a pointer to a apiRequestQueueGetRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - -### Return type - -[**RequestQueueResponse**](RequestQueueResponse.md) - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## RequestQueuePut - -> RequestQueueResponse RequestQueuePut(ctx, queueId).UpdateRequestQueueRequest(updateRequestQueueRequest).Execute() - -Update request queue - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - queueId := "WkzbQMuFYuamGv3YF" // string | Queue ID or `username~queue-name`. - updateRequestQueueRequest := *openapiclient.NewUpdateRequestQueueRequest() // UpdateRequestQueueRequest | - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.StorageRequestQueuesAPI.RequestQueuePut(context.Background(), queueId).UpdateRequestQueueRequest(updateRequestQueueRequest).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `StorageRequestQueuesAPI.RequestQueuePut``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `RequestQueuePut`: RequestQueueResponse - fmt.Fprintf(os.Stdout, "Response from `StorageRequestQueuesAPI.RequestQueuePut`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**queueId** | **string** | Queue ID or `username~queue-name`. | - -### Other Parameters - -Other parameters are passed through a pointer to a apiRequestQueuePutRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - **updateRequestQueueRequest** | [**UpdateRequestQueueRequest**](UpdateRequestQueueRequest.md) | | - -### Return type - -[**RequestQueueResponse**](RequestQueueResponse.md) - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## RequestQueueRequestsBatchDelete - -> BatchDeleteResponse RequestQueueRequestsBatchDelete(ctx, queueId).ContentType(contentType).RequestDraftDelete(requestDraftDelete).ClientKey(clientKey).Execute() - -Delete requests - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - queueId := "WkzbQMuFYuamGv3YF" // string | Queue ID or `username~queue-name`. - contentType := "contentType_example" // string | - requestDraftDelete := []openapiclient.RequestDraftDelete{*openapiclient.NewRequestDraftDelete("Id_example", "UniqueKey_example")} // []RequestDraftDelete | - clientKey := "client-abc" // string | A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.StorageRequestQueuesAPI.RequestQueueRequestsBatchDelete(context.Background(), queueId).ContentType(contentType).RequestDraftDelete(requestDraftDelete).ClientKey(clientKey).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `StorageRequestQueuesAPI.RequestQueueRequestsBatchDelete``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `RequestQueueRequestsBatchDelete`: BatchDeleteResponse - fmt.Fprintf(os.Stdout, "Response from `StorageRequestQueuesAPI.RequestQueueRequestsBatchDelete`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**queueId** | **string** | Queue ID or `username~queue-name`. | - -### Other Parameters - -Other parameters are passed through a pointer to a apiRequestQueueRequestsBatchDeleteRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - **contentType** | **string** | | - **requestDraftDelete** | [**[]RequestDraftDelete**](RequestDraftDelete.md) | | - **clientKey** | **string** | A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. | - -### Return type - -[**BatchDeleteResponse**](BatchDeleteResponse.md) - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## RequestQueueRequestsBatchPost - -> BatchAddResponse RequestQueueRequestsBatchPost(ctx, queueId).RequestBase(requestBase).ClientKey(clientKey).Forefront(forefront).Execute() - -Add requests - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - queueId := "WkzbQMuFYuamGv3YF" // string | Queue ID or `username~queue-name`. - requestBase := []openapiclient.RequestBase{*openapiclient.NewRequestBase()} // []RequestBase | - clientKey := "client-abc" // string | A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. (optional) - forefront := "false" // string | Determines if request should be added to the head of the queue or to the end. Default value is `false` (end of queue). (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.StorageRequestQueuesAPI.RequestQueueRequestsBatchPost(context.Background(), queueId).RequestBase(requestBase).ClientKey(clientKey).Forefront(forefront).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `StorageRequestQueuesAPI.RequestQueueRequestsBatchPost``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `RequestQueueRequestsBatchPost`: BatchAddResponse - fmt.Fprintf(os.Stdout, "Response from `StorageRequestQueuesAPI.RequestQueueRequestsBatchPost`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**queueId** | **string** | Queue ID or `username~queue-name`. | - -### Other Parameters - -Other parameters are passed through a pointer to a apiRequestQueueRequestsBatchPostRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - **requestBase** | [**[]RequestBase**](RequestBase.md) | | - **clientKey** | **string** | A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. | - **forefront** | **string** | Determines if request should be added to the head of the queue or to the end. Default value is `false` (end of queue). | - -### Return type - -[**BatchAddResponse**](BatchAddResponse.md) - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## RequestQueuesGet - -> ListOfRequestQueuesResponse RequestQueuesGet(ctx).Offset(offset).Limit(limit).Desc(desc).Unnamed(unnamed).Ownership(ownership).Execute() - -Get list of request queues - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - offset := float64(0) // float64 | Number of items that should be skipped at the start. The default value is `0`. (optional) - limit := float64(1000) // float64 | Maximum number of items to return. The default value as well as the maximum is `1000`. (optional) - desc := true // bool | If `true` or `1` then the objects are sorted by the `createdAt` field in descending order. By default, they are sorted in ascending order. (optional) - unnamed := true // bool | If `true` or `1` then all the storages are returned. By default, only named storages are returned. (optional) - ownership := openapiclient.StorageOwnership("ownedByMe") // StorageOwnership | Filter by ownership. If this parameter is omitted, all accessible request queues are returned. - `ownedByMe`: Return only request queues owned by the user. - `sharedWithMe`: Return only request queues shared with the user by other users. (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.StorageRequestQueuesAPI.RequestQueuesGet(context.Background()).Offset(offset).Limit(limit).Desc(desc).Unnamed(unnamed).Ownership(ownership).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `StorageRequestQueuesAPI.RequestQueuesGet``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `RequestQueuesGet`: ListOfRequestQueuesResponse - fmt.Fprintf(os.Stdout, "Response from `StorageRequestQueuesAPI.RequestQueuesGet`: %v\n", resp) -} -``` - -### Path Parameters - - - -### Other Parameters - -Other parameters are passed through a pointer to a apiRequestQueuesGetRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **offset** | **float64** | Number of items that should be skipped at the start. The default value is `0`. | - **limit** | **float64** | Maximum number of items to return. The default value as well as the maximum is `1000`. | - **desc** | **bool** | If `true` or `1` then the objects are sorted by the `createdAt` field in descending order. By default, they are sorted in ascending order. | - **unnamed** | **bool** | If `true` or `1` then all the storages are returned. By default, only named storages are returned. | - **ownership** | [**StorageOwnership**](StorageOwnership.md) | Filter by ownership. If this parameter is omitted, all accessible request queues are returned. - `ownedByMe`: Return only request queues owned by the user. - `sharedWithMe`: Return only request queues shared with the user by other users. | - -### Return type - -[**ListOfRequestQueuesResponse**](ListOfRequestQueuesResponse.md) - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## RequestQueuesPost - -> RequestQueueResponse RequestQueuesPost(ctx).Name(name).Execute() - -Create request queue - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - name := "example-com" // string | Custom unique name to easily identify the queue in the future. (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.StorageRequestQueuesAPI.RequestQueuesPost(context.Background()).Name(name).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `StorageRequestQueuesAPI.RequestQueuesPost``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `RequestQueuesPost`: RequestQueueResponse - fmt.Fprintf(os.Stdout, "Response from `StorageRequestQueuesAPI.RequestQueuesPost`: %v\n", resp) -} -``` - -### Path Parameters - - - -### Other Parameters - -Other parameters are passed through a pointer to a apiRequestQueuesPostRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **name** | **string** | Custom unique name to easily identify the queue in the future. | - -### Return type - -[**RequestQueueResponse**](RequestQueueResponse.md) - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - diff --git a/docs/StorageRequestQueuesRequestsAPI.md b/docs/StorageRequestQueuesRequestsAPI.md deleted file mode 100644 index 32e430c..0000000 --- a/docs/StorageRequestQueuesRequestsAPI.md +++ /dev/null @@ -1,394 +0,0 @@ -# \StorageRequestQueuesRequestsAPI - -All URIs are relative to *https://api.apify.com* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**RequestQueueRequestDelete**](StorageRequestQueuesRequestsAPI.md#RequestQueueRequestDelete) | **Delete** /v2/request-queues/{queueId}/requests/{requestId} | Delete request -[**RequestQueueRequestGet**](StorageRequestQueuesRequestsAPI.md#RequestQueueRequestGet) | **Get** /v2/request-queues/{queueId}/requests/{requestId} | Get request -[**RequestQueueRequestPut**](StorageRequestQueuesRequestsAPI.md#RequestQueueRequestPut) | **Put** /v2/request-queues/{queueId}/requests/{requestId} | Update request -[**RequestQueueRequestsGet**](StorageRequestQueuesRequestsAPI.md#RequestQueueRequestsGet) | **Get** /v2/request-queues/{queueId}/requests | List requests -[**RequestQueueRequestsPost**](StorageRequestQueuesRequestsAPI.md#RequestQueueRequestsPost) | **Post** /v2/request-queues/{queueId}/requests | Add request - - - -## RequestQueueRequestDelete - -> RequestQueueRequestDelete(ctx, queueId, requestId).ClientKey(clientKey).Execute() - -Delete request - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - queueId := "WkzbQMuFYuamGv3YF" // string | Queue ID or `username~queue-name`. - requestId := "xpsmkDlspokDSmklS" // string | Request ID. - clientKey := "client-abc" // string | A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - r, err := apiClient.StorageRequestQueuesRequestsAPI.RequestQueueRequestDelete(context.Background(), queueId, requestId).ClientKey(clientKey).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `StorageRequestQueuesRequestsAPI.RequestQueueRequestDelete``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**queueId** | **string** | Queue ID or `username~queue-name`. | -**requestId** | **string** | Request ID. | - -### Other Parameters - -Other parameters are passed through a pointer to a apiRequestQueueRequestDeleteRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - - **clientKey** | **string** | A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. | - -### Return type - - (empty response body) - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## RequestQueueRequestGet - -> RequestResponse RequestQueueRequestGet(ctx, queueId, requestId).Execute() - -Get request - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - queueId := "WkzbQMuFYuamGv3YF" // string | Queue ID or `username~queue-name`. - requestId := "xpsmkDlspokDSmklS" // string | Request ID. - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.StorageRequestQueuesRequestsAPI.RequestQueueRequestGet(context.Background(), queueId, requestId).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `StorageRequestQueuesRequestsAPI.RequestQueueRequestGet``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `RequestQueueRequestGet`: RequestResponse - fmt.Fprintf(os.Stdout, "Response from `StorageRequestQueuesRequestsAPI.RequestQueueRequestGet`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**queueId** | **string** | Queue ID or `username~queue-name`. | -**requestId** | **string** | Request ID. | - -### Other Parameters - -Other parameters are passed through a pointer to a apiRequestQueueRequestGetRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - - -### Return type - -[**RequestResponse**](RequestResponse.md) - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## RequestQueueRequestPut - -> UpdateRequestResponse RequestQueueRequestPut(ctx, queueId, requestId).Request(request).Forefront(forefront).ClientKey(clientKey).Execute() - -Update request - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - queueId := "WkzbQMuFYuamGv3YF" // string | Queue ID or `username~queue-name`. - requestId := "xpsmkDlspokDSmklS" // string | Request ID. - request := *openapiclient.NewRequest() // Request | - forefront := "false" // string | Determines if request should be added to the head of the queue or to the end. Default value is `false` (end of queue). (optional) - clientKey := "client-abc" // string | A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.StorageRequestQueuesRequestsAPI.RequestQueueRequestPut(context.Background(), queueId, requestId).Request(request).Forefront(forefront).ClientKey(clientKey).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `StorageRequestQueuesRequestsAPI.RequestQueueRequestPut``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `RequestQueueRequestPut`: UpdateRequestResponse - fmt.Fprintf(os.Stdout, "Response from `StorageRequestQueuesRequestsAPI.RequestQueueRequestPut`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**queueId** | **string** | Queue ID or `username~queue-name`. | -**requestId** | **string** | Request ID. | - -### Other Parameters - -Other parameters are passed through a pointer to a apiRequestQueueRequestPutRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - - **request** | [**Request**](Request.md) | | - **forefront** | **string** | Determines if request should be added to the head of the queue or to the end. Default value is `false` (end of queue). | - **clientKey** | **string** | A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. | - -### Return type - -[**UpdateRequestResponse**](UpdateRequestResponse.md) - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## RequestQueueRequestsGet - -> ListOfRequestsResponse RequestQueueRequestsGet(ctx, queueId).ClientKey(clientKey).ExclusiveStartId(exclusiveStartId).Limit(limit).Cursor(cursor).Filter(filter).Execute() - -List requests - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - queueId := "WkzbQMuFYuamGv3YF" // string | Queue ID or `username~queue-name`. - clientKey := "client-abc" // string | A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. (optional) - exclusiveStartId := "Ihnsp8YrvJ8102Kj" // string | All requests up to this one (including) are skipped from the result. (Deprecated, use `cursor` instead.) (optional) - limit := float64(100) // float64 | Number of keys to be returned. Maximum value is `10000`. (optional) - cursor := "eyJyZXF1ZXN0SWQiOiI2OFRqQ2RaTDNvM2hiUU0ifQ" // string | A cursor string for pagination, returned in the previous response as `nextCursor`. Use this to retrieve the next page of requests. (optional) - filter := []string{"Filter_example"} // []string | Filter requests by their state. Possible values are `locked` and `pending`. You can combine multiple values separated by commas, which will mean the union of these filters – requests matching any of the specified states will be returned. (Not compatible with deprecated `exclusiveStartId` parameter.) (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.StorageRequestQueuesRequestsAPI.RequestQueueRequestsGet(context.Background(), queueId).ClientKey(clientKey).ExclusiveStartId(exclusiveStartId).Limit(limit).Cursor(cursor).Filter(filter).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `StorageRequestQueuesRequestsAPI.RequestQueueRequestsGet``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `RequestQueueRequestsGet`: ListOfRequestsResponse - fmt.Fprintf(os.Stdout, "Response from `StorageRequestQueuesRequestsAPI.RequestQueueRequestsGet`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**queueId** | **string** | Queue ID or `username~queue-name`. | - -### Other Parameters - -Other parameters are passed through a pointer to a apiRequestQueueRequestsGetRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - **clientKey** | **string** | A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. | - **exclusiveStartId** | **string** | All requests up to this one (including) are skipped from the result. (Deprecated, use `cursor` instead.) | - **limit** | **float64** | Number of keys to be returned. Maximum value is `10000`. | - **cursor** | **string** | A cursor string for pagination, returned in the previous response as `nextCursor`. Use this to retrieve the next page of requests. | - **filter** | **[]string** | Filter requests by their state. Possible values are `locked` and `pending`. You can combine multiple values separated by commas, which will mean the union of these filters – requests matching any of the specified states will be returned. (Not compatible with deprecated `exclusiveStartId` parameter.) | - -### Return type - -[**ListOfRequestsResponse**](ListOfRequestsResponse.md) - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## RequestQueueRequestsPost - -> AddRequestResponse RequestQueueRequestsPost(ctx, queueId).RequestBase(requestBase).ClientKey(clientKey).Forefront(forefront).Execute() - -Add request - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - queueId := "WkzbQMuFYuamGv3YF" // string | Queue ID or `username~queue-name`. - requestBase := *openapiclient.NewRequestBase() // RequestBase | - clientKey := "client-abc" // string | A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. (optional) - forefront := "false" // string | Determines if request should be added to the head of the queue or to the end. Default value is `false` (end of queue). (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.StorageRequestQueuesRequestsAPI.RequestQueueRequestsPost(context.Background(), queueId).RequestBase(requestBase).ClientKey(clientKey).Forefront(forefront).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `StorageRequestQueuesRequestsAPI.RequestQueueRequestsPost``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `RequestQueueRequestsPost`: AddRequestResponse - fmt.Fprintf(os.Stdout, "Response from `StorageRequestQueuesRequestsAPI.RequestQueueRequestsPost`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**queueId** | **string** | Queue ID or `username~queue-name`. | - -### Other Parameters - -Other parameters are passed through a pointer to a apiRequestQueueRequestsPostRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - **requestBase** | [**RequestBase**](RequestBase.md) | | - **clientKey** | **string** | A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. | - **forefront** | **string** | Determines if request should be added to the head of the queue or to the end. Default value is `false` (end of queue). | - -### Return type - -[**AddRequestResponse**](AddRequestResponse.md) - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - diff --git a/docs/StorageRequestQueuesRequestsLocksAPI.md b/docs/StorageRequestQueuesRequestsLocksAPI.md deleted file mode 100644 index e503dd7..0000000 --- a/docs/StorageRequestQueuesRequestsLocksAPI.md +++ /dev/null @@ -1,389 +0,0 @@ -# \StorageRequestQueuesRequestsLocksAPI - -All URIs are relative to *https://api.apify.com* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**RequestQueueHeadGet**](StorageRequestQueuesRequestsLocksAPI.md#RequestQueueHeadGet) | **Get** /v2/request-queues/{queueId}/head | Get head -[**RequestQueueHeadLockPost**](StorageRequestQueuesRequestsLocksAPI.md#RequestQueueHeadLockPost) | **Post** /v2/request-queues/{queueId}/head/lock | Get head and lock -[**RequestQueueRequestLockDelete**](StorageRequestQueuesRequestsLocksAPI.md#RequestQueueRequestLockDelete) | **Delete** /v2/request-queues/{queueId}/requests/{requestId}/lock | Delete request lock -[**RequestQueueRequestLockPut**](StorageRequestQueuesRequestsLocksAPI.md#RequestQueueRequestLockPut) | **Put** /v2/request-queues/{queueId}/requests/{requestId}/lock | Prolong request lock -[**RequestQueueRequestsUnlockPost**](StorageRequestQueuesRequestsLocksAPI.md#RequestQueueRequestsUnlockPost) | **Post** /v2/request-queues/{queueId}/requests/unlock | Unlock requests - - - -## RequestQueueHeadGet - -> HeadResponse RequestQueueHeadGet(ctx, queueId).Limit(limit).ClientKey(clientKey).Execute() - -Get head - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - queueId := "WkzbQMuFYuamGv3YF" // string | Queue ID or `username~queue-name`. - limit := float64(100) // float64 | How many items from queue should be returned. (optional) - clientKey := "client-abc" // string | A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.StorageRequestQueuesRequestsLocksAPI.RequestQueueHeadGet(context.Background(), queueId).Limit(limit).ClientKey(clientKey).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `StorageRequestQueuesRequestsLocksAPI.RequestQueueHeadGet``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `RequestQueueHeadGet`: HeadResponse - fmt.Fprintf(os.Stdout, "Response from `StorageRequestQueuesRequestsLocksAPI.RequestQueueHeadGet`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**queueId** | **string** | Queue ID or `username~queue-name`. | - -### Other Parameters - -Other parameters are passed through a pointer to a apiRequestQueueHeadGetRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - **limit** | **float64** | How many items from queue should be returned. | - **clientKey** | **string** | A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. | - -### Return type - -[**HeadResponse**](HeadResponse.md) - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## RequestQueueHeadLockPost - -> HeadAndLockResponse RequestQueueHeadLockPost(ctx, queueId).LockSecs(lockSecs).Limit(limit).ClientKey(clientKey).Execute() - -Get head and lock - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - queueId := "WkzbQMuFYuamGv3YF" // string | Queue ID or `username~queue-name`. - lockSecs := float64(60) // float64 | How long the requests will be locked for (in seconds). - limit := float64(25) // float64 | How many items from the queue should be returned. (optional) - clientKey := "client-abc" // string | A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.StorageRequestQueuesRequestsLocksAPI.RequestQueueHeadLockPost(context.Background(), queueId).LockSecs(lockSecs).Limit(limit).ClientKey(clientKey).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `StorageRequestQueuesRequestsLocksAPI.RequestQueueHeadLockPost``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `RequestQueueHeadLockPost`: HeadAndLockResponse - fmt.Fprintf(os.Stdout, "Response from `StorageRequestQueuesRequestsLocksAPI.RequestQueueHeadLockPost`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**queueId** | **string** | Queue ID or `username~queue-name`. | - -### Other Parameters - -Other parameters are passed through a pointer to a apiRequestQueueHeadLockPostRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - **lockSecs** | **float64** | How long the requests will be locked for (in seconds). | - **limit** | **float64** | How many items from the queue should be returned. | - **clientKey** | **string** | A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. | - -### Return type - -[**HeadAndLockResponse**](HeadAndLockResponse.md) - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## RequestQueueRequestLockDelete - -> RequestQueueRequestLockDelete(ctx, queueId, requestId).ClientKey(clientKey).Forefront(forefront).Execute() - -Delete request lock - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - queueId := "WkzbQMuFYuamGv3YF" // string | Queue ID or `username~queue-name`. - requestId := "xpsmkDlspokDSmklS" // string | Request ID. - clientKey := "client-abc" // string | A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. (optional) - forefront := "false" // string | Determines if request should be added to the head of the queue or to the end after lock was removed. (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - r, err := apiClient.StorageRequestQueuesRequestsLocksAPI.RequestQueueRequestLockDelete(context.Background(), queueId, requestId).ClientKey(clientKey).Forefront(forefront).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `StorageRequestQueuesRequestsLocksAPI.RequestQueueRequestLockDelete``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**queueId** | **string** | Queue ID or `username~queue-name`. | -**requestId** | **string** | Request ID. | - -### Other Parameters - -Other parameters are passed through a pointer to a apiRequestQueueRequestLockDeleteRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - - **clientKey** | **string** | A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. | - **forefront** | **string** | Determines if request should be added to the head of the queue or to the end after lock was removed. | - -### Return type - - (empty response body) - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## RequestQueueRequestLockPut - -> ProlongRequestLockResponse RequestQueueRequestLockPut(ctx, queueId, requestId).LockSecs(lockSecs).ClientKey(clientKey).Forefront(forefront).Execute() - -Prolong request lock - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - queueId := "WkzbQMuFYuamGv3YF" // string | Queue ID or `username~queue-name`. - requestId := "xpsmkDlspokDSmklS" // string | Request ID. - lockSecs := float64(60) // float64 | How long the requests will be locked for (in seconds). - clientKey := "client-abc" // string | A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. (optional) - forefront := "false" // string | Determines if request should be added to the head of the queue or to the end after lock expires. (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.StorageRequestQueuesRequestsLocksAPI.RequestQueueRequestLockPut(context.Background(), queueId, requestId).LockSecs(lockSecs).ClientKey(clientKey).Forefront(forefront).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `StorageRequestQueuesRequestsLocksAPI.RequestQueueRequestLockPut``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `RequestQueueRequestLockPut`: ProlongRequestLockResponse - fmt.Fprintf(os.Stdout, "Response from `StorageRequestQueuesRequestsLocksAPI.RequestQueueRequestLockPut`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**queueId** | **string** | Queue ID or `username~queue-name`. | -**requestId** | **string** | Request ID. | - -### Other Parameters - -Other parameters are passed through a pointer to a apiRequestQueueRequestLockPutRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - - **lockSecs** | **float64** | How long the requests will be locked for (in seconds). | - **clientKey** | **string** | A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. | - **forefront** | **string** | Determines if request should be added to the head of the queue or to the end after lock expires. | - -### Return type - -[**ProlongRequestLockResponse**](ProlongRequestLockResponse.md) - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## RequestQueueRequestsUnlockPost - -> UnlockRequestsResponse RequestQueueRequestsUnlockPost(ctx, queueId).ClientKey(clientKey).Execute() - -Unlock requests - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - queueId := "WkzbQMuFYuamGv3YF" // string | Queue ID or `username~queue-name`. - clientKey := "client-abc" // string | A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.StorageRequestQueuesRequestsLocksAPI.RequestQueueRequestsUnlockPost(context.Background(), queueId).ClientKey(clientKey).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `StorageRequestQueuesRequestsLocksAPI.RequestQueueRequestsUnlockPost``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `RequestQueueRequestsUnlockPost`: UnlockRequestsResponse - fmt.Fprintf(os.Stdout, "Response from `StorageRequestQueuesRequestsLocksAPI.RequestQueueRequestsUnlockPost`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**queueId** | **string** | Queue ID or `username~queue-name`. | - -### Other Parameters - -Other parameters are passed through a pointer to a apiRequestQueueRequestsUnlockPostRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - **clientKey** | **string** | A unique identifier of the client accessing the request queue. It must be a string between 1 and 32 characters long. This identifier is used to determine whether the queue was accessed by multiple clients. If `clientKey` is not provided, the system considers this API call to come from a new client. For details, see the `hadMultipleClients` field returned by the [Get head](#/reference/request-queues/queue-head) operation. | - -### Return type - -[**UnlockRequestsResponse**](UnlockRequestsResponse.md) - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - diff --git a/docs/StoreAPI.md b/docs/StoreAPI.md deleted file mode 100644 index 3569099..0000000 --- a/docs/StoreAPI.md +++ /dev/null @@ -1,93 +0,0 @@ -# \StoreAPI - -All URIs are relative to *https://api.apify.com* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**StoreGet**](StoreAPI.md#StoreGet) | **Get** /v2/store | Get list of Actors in Store - - - -## StoreGet - -> ListOfActorsInStoreResponse StoreGet(ctx).Limit(limit).Offset(offset).Search(search).SortBy(sortBy).Category(category).Username(username).PricingModel(pricingModel).AllowsAgenticUsers(allowsAgenticUsers).ResponseFormat(responseFormat).IncludeUnrunnableActors(includeUnrunnableActors).Execute() - -Get list of Actors in Store - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - limit := float64(1000) // float64 | Maximum number of items to return. The default value as well as the maximum is `1000`. (optional) - offset := float64(0) // float64 | Number of items that should be skipped at the start. The default value is `0`. (optional) - search := "web scraper" // string | String to search by. The search runs on the following fields: `title`, `name`, `description`, `username`, `readme`. (optional) - sortBy := "'popularity'" // string | Specifies the field by which to sort the results. The supported values are `relevance` (default), `popularity`, `newest` and `lastUpdate`. (optional) - category := "'AI'" // string | Filters the results by the specified category. (optional) - username := "'apify'" // string | Filters the results by the specified username. (optional) - pricingModel := "FREE" // string | Only return Actors with the specified pricing model. (optional) - allowsAgenticUsers := true // bool | If true, only return Actors that allow agentic users. If false, only return Actors that do not allow agentic users. (optional) - responseFormat := "agent" // string | Controls the shape of the response. Use `full` (default) for the complete response including image URLs and all fields. Use `agent` for a reduced field set optimized for LLM consumers, which only includes `id`, `title`, `name`, `username`, `description`, `notice`, `badge`, `categories`, and minimal `stats`. (optional) (default to "full") - includeUnrunnableActors := true // bool | By default, search results exclude Actors that are not safe to run automatically (e.g. Actors from developers who haven't passed KYC, or full-permission Actors without a large user base). Set to `true` to bypass this safety filtering and include all Actors in the results. (optional) (default to false) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.StoreAPI.StoreGet(context.Background()).Limit(limit).Offset(offset).Search(search).SortBy(sortBy).Category(category).Username(username).PricingModel(pricingModel).AllowsAgenticUsers(allowsAgenticUsers).ResponseFormat(responseFormat).IncludeUnrunnableActors(includeUnrunnableActors).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `StoreAPI.StoreGet``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `StoreGet`: ListOfActorsInStoreResponse - fmt.Fprintf(os.Stdout, "Response from `StoreAPI.StoreGet`: %v\n", resp) -} -``` - -### Path Parameters - - - -### Other Parameters - -Other parameters are passed through a pointer to a apiStoreGetRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **limit** | **float64** | Maximum number of items to return. The default value as well as the maximum is `1000`. | - **offset** | **float64** | Number of items that should be skipped at the start. The default value is `0`. | - **search** | **string** | String to search by. The search runs on the following fields: `title`, `name`, `description`, `username`, `readme`. | - **sortBy** | **string** | Specifies the field by which to sort the results. The supported values are `relevance` (default), `popularity`, `newest` and `lastUpdate`. | - **category** | **string** | Filters the results by the specified category. | - **username** | **string** | Filters the results by the specified username. | - **pricingModel** | **string** | Only return Actors with the specified pricing model. | - **allowsAgenticUsers** | **bool** | If true, only return Actors that allow agentic users. If false, only return Actors that do not allow agentic users. | - **responseFormat** | **string** | Controls the shape of the response. Use `full` (default) for the complete response including image URLs and all fields. Use `agent` for a reduced field set optimized for LLM consumers, which only includes `id`, `title`, `name`, `username`, `description`, `notice`, `badge`, `categories`, and minimal `stats`. | [default to "full"] - **includeUnrunnableActors** | **bool** | By default, search results exclude Actors that are not safe to run automatically (e.g. Actors from developers who haven't passed KYC, or full-permission Actors without a large user base). Set to `true` to bypass this safety filtering and include all Actors in the results. | [default to false] - -### Return type - -[**ListOfActorsInStoreResponse**](ListOfActorsInStoreResponse.md) - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - diff --git a/docs/StoreListActor.md b/docs/StoreListActor.md deleted file mode 100644 index f83ee81..0000000 --- a/docs/StoreListActor.md +++ /dev/null @@ -1,534 +0,0 @@ -# StoreListActor - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Id** | **string** | | -**Title** | **string** | | -**Name** | **string** | | -**Username** | **string** | | -**UserFullName** | **string** | | -**Description** | **string** | | -**Categories** | Pointer to **[]string** | | [optional] -**Notice** | Pointer to **string** | | [optional] -**PictureUrl** | Pointer to **NullableString** | | [optional] -**UserPictureUrl** | Pointer to **NullableString** | | [optional] -**Url** | Pointer to **NullableString** | | [optional] -**Stats** | [**ActorStats**](ActorStats.md) | | -**CurrentPricingInfo** | [**CurrentPricingInfo**](CurrentPricingInfo.md) | | -**IsWhiteListedForAgenticPayments** | Pointer to **NullableBool** | Whether the Actor is whitelisted for agentic payment processing. | [optional] -**ActorReviewCount** | Pointer to **int32** | | [optional] -**ActorReviewRating** | Pointer to **float32** | | [optional] -**BookmarkCount** | Pointer to **int32** | | [optional] -**Badge** | Pointer to **NullableString** | | [optional] -**ReadmeSummary** | Pointer to **string** | A brief, LLM-generated readme summary | [optional] - -## Methods - -### NewStoreListActor - -`func NewStoreListActor(id string, title string, name string, username string, userFullName string, description string, stats ActorStats, currentPricingInfo CurrentPricingInfo, ) *StoreListActor` - -NewStoreListActor instantiates a new StoreListActor object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewStoreListActorWithDefaults - -`func NewStoreListActorWithDefaults() *StoreListActor` - -NewStoreListActorWithDefaults instantiates a new StoreListActor object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetId - -`func (o *StoreListActor) GetId() string` - -GetId returns the Id field if non-nil, zero value otherwise. - -### GetIdOk - -`func (o *StoreListActor) GetIdOk() (*string, bool)` - -GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetId - -`func (o *StoreListActor) SetId(v string)` - -SetId sets Id field to given value. - - -### GetTitle - -`func (o *StoreListActor) GetTitle() string` - -GetTitle returns the Title field if non-nil, zero value otherwise. - -### GetTitleOk - -`func (o *StoreListActor) GetTitleOk() (*string, bool)` - -GetTitleOk returns a tuple with the Title field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetTitle - -`func (o *StoreListActor) SetTitle(v string)` - -SetTitle sets Title field to given value. - - -### GetName - -`func (o *StoreListActor) GetName() string` - -GetName returns the Name field if non-nil, zero value otherwise. - -### GetNameOk - -`func (o *StoreListActor) GetNameOk() (*string, bool)` - -GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetName - -`func (o *StoreListActor) SetName(v string)` - -SetName sets Name field to given value. - - -### GetUsername - -`func (o *StoreListActor) GetUsername() string` - -GetUsername returns the Username field if non-nil, zero value otherwise. - -### GetUsernameOk - -`func (o *StoreListActor) GetUsernameOk() (*string, bool)` - -GetUsernameOk returns a tuple with the Username field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetUsername - -`func (o *StoreListActor) SetUsername(v string)` - -SetUsername sets Username field to given value. - - -### GetUserFullName - -`func (o *StoreListActor) GetUserFullName() string` - -GetUserFullName returns the UserFullName field if non-nil, zero value otherwise. - -### GetUserFullNameOk - -`func (o *StoreListActor) GetUserFullNameOk() (*string, bool)` - -GetUserFullNameOk returns a tuple with the UserFullName field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetUserFullName - -`func (o *StoreListActor) SetUserFullName(v string)` - -SetUserFullName sets UserFullName field to given value. - - -### GetDescription - -`func (o *StoreListActor) GetDescription() string` - -GetDescription returns the Description field if non-nil, zero value otherwise. - -### GetDescriptionOk - -`func (o *StoreListActor) GetDescriptionOk() (*string, bool)` - -GetDescriptionOk returns a tuple with the Description field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetDescription - -`func (o *StoreListActor) SetDescription(v string)` - -SetDescription sets Description field to given value. - - -### GetCategories - -`func (o *StoreListActor) GetCategories() []string` - -GetCategories returns the Categories field if non-nil, zero value otherwise. - -### GetCategoriesOk - -`func (o *StoreListActor) GetCategoriesOk() (*[]string, bool)` - -GetCategoriesOk returns a tuple with the Categories field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetCategories - -`func (o *StoreListActor) SetCategories(v []string)` - -SetCategories sets Categories field to given value. - -### HasCategories - -`func (o *StoreListActor) HasCategories() bool` - -HasCategories returns a boolean if a field has been set. - -### GetNotice - -`func (o *StoreListActor) GetNotice() string` - -GetNotice returns the Notice field if non-nil, zero value otherwise. - -### GetNoticeOk - -`func (o *StoreListActor) GetNoticeOk() (*string, bool)` - -GetNoticeOk returns a tuple with the Notice field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetNotice - -`func (o *StoreListActor) SetNotice(v string)` - -SetNotice sets Notice field to given value. - -### HasNotice - -`func (o *StoreListActor) HasNotice() bool` - -HasNotice returns a boolean if a field has been set. - -### GetPictureUrl - -`func (o *StoreListActor) GetPictureUrl() string` - -GetPictureUrl returns the PictureUrl field if non-nil, zero value otherwise. - -### GetPictureUrlOk - -`func (o *StoreListActor) GetPictureUrlOk() (*string, bool)` - -GetPictureUrlOk returns a tuple with the PictureUrl field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetPictureUrl - -`func (o *StoreListActor) SetPictureUrl(v string)` - -SetPictureUrl sets PictureUrl field to given value. - -### HasPictureUrl - -`func (o *StoreListActor) HasPictureUrl() bool` - -HasPictureUrl returns a boolean if a field has been set. - -### SetPictureUrlNil - -`func (o *StoreListActor) SetPictureUrlNil(b bool)` - - SetPictureUrlNil sets the value for PictureUrl to be an explicit nil - -### UnsetPictureUrl -`func (o *StoreListActor) UnsetPictureUrl()` - -UnsetPictureUrl ensures that no value is present for PictureUrl, not even an explicit nil -### GetUserPictureUrl - -`func (o *StoreListActor) GetUserPictureUrl() string` - -GetUserPictureUrl returns the UserPictureUrl field if non-nil, zero value otherwise. - -### GetUserPictureUrlOk - -`func (o *StoreListActor) GetUserPictureUrlOk() (*string, bool)` - -GetUserPictureUrlOk returns a tuple with the UserPictureUrl field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetUserPictureUrl - -`func (o *StoreListActor) SetUserPictureUrl(v string)` - -SetUserPictureUrl sets UserPictureUrl field to given value. - -### HasUserPictureUrl - -`func (o *StoreListActor) HasUserPictureUrl() bool` - -HasUserPictureUrl returns a boolean if a field has been set. - -### SetUserPictureUrlNil - -`func (o *StoreListActor) SetUserPictureUrlNil(b bool)` - - SetUserPictureUrlNil sets the value for UserPictureUrl to be an explicit nil - -### UnsetUserPictureUrl -`func (o *StoreListActor) UnsetUserPictureUrl()` - -UnsetUserPictureUrl ensures that no value is present for UserPictureUrl, not even an explicit nil -### GetUrl - -`func (o *StoreListActor) GetUrl() string` - -GetUrl returns the Url field if non-nil, zero value otherwise. - -### GetUrlOk - -`func (o *StoreListActor) GetUrlOk() (*string, bool)` - -GetUrlOk returns a tuple with the Url field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetUrl - -`func (o *StoreListActor) SetUrl(v string)` - -SetUrl sets Url field to given value. - -### HasUrl - -`func (o *StoreListActor) HasUrl() bool` - -HasUrl returns a boolean if a field has been set. - -### SetUrlNil - -`func (o *StoreListActor) SetUrlNil(b bool)` - - SetUrlNil sets the value for Url to be an explicit nil - -### UnsetUrl -`func (o *StoreListActor) UnsetUrl()` - -UnsetUrl ensures that no value is present for Url, not even an explicit nil -### GetStats - -`func (o *StoreListActor) GetStats() ActorStats` - -GetStats returns the Stats field if non-nil, zero value otherwise. - -### GetStatsOk - -`func (o *StoreListActor) GetStatsOk() (*ActorStats, bool)` - -GetStatsOk returns a tuple with the Stats field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetStats - -`func (o *StoreListActor) SetStats(v ActorStats)` - -SetStats sets Stats field to given value. - - -### GetCurrentPricingInfo - -`func (o *StoreListActor) GetCurrentPricingInfo() CurrentPricingInfo` - -GetCurrentPricingInfo returns the CurrentPricingInfo field if non-nil, zero value otherwise. - -### GetCurrentPricingInfoOk - -`func (o *StoreListActor) GetCurrentPricingInfoOk() (*CurrentPricingInfo, bool)` - -GetCurrentPricingInfoOk returns a tuple with the CurrentPricingInfo field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetCurrentPricingInfo - -`func (o *StoreListActor) SetCurrentPricingInfo(v CurrentPricingInfo)` - -SetCurrentPricingInfo sets CurrentPricingInfo field to given value. - - -### GetIsWhiteListedForAgenticPayments - -`func (o *StoreListActor) GetIsWhiteListedForAgenticPayments() bool` - -GetIsWhiteListedForAgenticPayments returns the IsWhiteListedForAgenticPayments field if non-nil, zero value otherwise. - -### GetIsWhiteListedForAgenticPaymentsOk - -`func (o *StoreListActor) GetIsWhiteListedForAgenticPaymentsOk() (*bool, bool)` - -GetIsWhiteListedForAgenticPaymentsOk returns a tuple with the IsWhiteListedForAgenticPayments field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetIsWhiteListedForAgenticPayments - -`func (o *StoreListActor) SetIsWhiteListedForAgenticPayments(v bool)` - -SetIsWhiteListedForAgenticPayments sets IsWhiteListedForAgenticPayments field to given value. - -### HasIsWhiteListedForAgenticPayments - -`func (o *StoreListActor) HasIsWhiteListedForAgenticPayments() bool` - -HasIsWhiteListedForAgenticPayments returns a boolean if a field has been set. - -### SetIsWhiteListedForAgenticPaymentsNil - -`func (o *StoreListActor) SetIsWhiteListedForAgenticPaymentsNil(b bool)` - - SetIsWhiteListedForAgenticPaymentsNil sets the value for IsWhiteListedForAgenticPayments to be an explicit nil - -### UnsetIsWhiteListedForAgenticPayments -`func (o *StoreListActor) UnsetIsWhiteListedForAgenticPayments()` - -UnsetIsWhiteListedForAgenticPayments ensures that no value is present for IsWhiteListedForAgenticPayments, not even an explicit nil -### GetActorReviewCount - -`func (o *StoreListActor) GetActorReviewCount() int32` - -GetActorReviewCount returns the ActorReviewCount field if non-nil, zero value otherwise. - -### GetActorReviewCountOk - -`func (o *StoreListActor) GetActorReviewCountOk() (*int32, bool)` - -GetActorReviewCountOk returns a tuple with the ActorReviewCount field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetActorReviewCount - -`func (o *StoreListActor) SetActorReviewCount(v int32)` - -SetActorReviewCount sets ActorReviewCount field to given value. - -### HasActorReviewCount - -`func (o *StoreListActor) HasActorReviewCount() bool` - -HasActorReviewCount returns a boolean if a field has been set. - -### GetActorReviewRating - -`func (o *StoreListActor) GetActorReviewRating() float32` - -GetActorReviewRating returns the ActorReviewRating field if non-nil, zero value otherwise. - -### GetActorReviewRatingOk - -`func (o *StoreListActor) GetActorReviewRatingOk() (*float32, bool)` - -GetActorReviewRatingOk returns a tuple with the ActorReviewRating field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetActorReviewRating - -`func (o *StoreListActor) SetActorReviewRating(v float32)` - -SetActorReviewRating sets ActorReviewRating field to given value. - -### HasActorReviewRating - -`func (o *StoreListActor) HasActorReviewRating() bool` - -HasActorReviewRating returns a boolean if a field has been set. - -### GetBookmarkCount - -`func (o *StoreListActor) GetBookmarkCount() int32` - -GetBookmarkCount returns the BookmarkCount field if non-nil, zero value otherwise. - -### GetBookmarkCountOk - -`func (o *StoreListActor) GetBookmarkCountOk() (*int32, bool)` - -GetBookmarkCountOk returns a tuple with the BookmarkCount field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetBookmarkCount - -`func (o *StoreListActor) SetBookmarkCount(v int32)` - -SetBookmarkCount sets BookmarkCount field to given value. - -### HasBookmarkCount - -`func (o *StoreListActor) HasBookmarkCount() bool` - -HasBookmarkCount returns a boolean if a field has been set. - -### GetBadge - -`func (o *StoreListActor) GetBadge() string` - -GetBadge returns the Badge field if non-nil, zero value otherwise. - -### GetBadgeOk - -`func (o *StoreListActor) GetBadgeOk() (*string, bool)` - -GetBadgeOk returns a tuple with the Badge field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetBadge - -`func (o *StoreListActor) SetBadge(v string)` - -SetBadge sets Badge field to given value. - -### HasBadge - -`func (o *StoreListActor) HasBadge() bool` - -HasBadge returns a boolean if a field has been set. - -### SetBadgeNil - -`func (o *StoreListActor) SetBadgeNil(b bool)` - - SetBadgeNil sets the value for Badge to be an explicit nil - -### UnsetBadge -`func (o *StoreListActor) UnsetBadge()` - -UnsetBadge ensures that no value is present for Badge, not even an explicit nil -### GetReadmeSummary - -`func (o *StoreListActor) GetReadmeSummary() string` - -GetReadmeSummary returns the ReadmeSummary field if non-nil, zero value otherwise. - -### GetReadmeSummaryOk - -`func (o *StoreListActor) GetReadmeSummaryOk() (*string, bool)` - -GetReadmeSummaryOk returns a tuple with the ReadmeSummary field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetReadmeSummary - -`func (o *StoreListActor) SetReadmeSummary(v string)` - -SetReadmeSummary sets ReadmeSummary field to given value. - -### HasReadmeSummary - -`func (o *StoreListActor) HasReadmeSummary() bool` - -HasReadmeSummary returns a boolean if a field has been set. - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/TaggedBuildInfo.md b/docs/TaggedBuildInfo.md deleted file mode 100644 index 216e17e..0000000 --- a/docs/TaggedBuildInfo.md +++ /dev/null @@ -1,144 +0,0 @@ -# TaggedBuildInfo - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**BuildId** | Pointer to **string** | The ID of the build associated with this tag. | [optional] -**BuildNumber** | Pointer to **string** | The build number/version string. | [optional] -**BuildNumberInt** | Pointer to **int32** | The build number encoded as a single integer. | [optional] -**FinishedAt** | Pointer to **NullableTime** | The timestamp when the build finished. | [optional] - -## Methods - -### NewTaggedBuildInfo - -`func NewTaggedBuildInfo() *TaggedBuildInfo` - -NewTaggedBuildInfo instantiates a new TaggedBuildInfo object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewTaggedBuildInfoWithDefaults - -`func NewTaggedBuildInfoWithDefaults() *TaggedBuildInfo` - -NewTaggedBuildInfoWithDefaults instantiates a new TaggedBuildInfo object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetBuildId - -`func (o *TaggedBuildInfo) GetBuildId() string` - -GetBuildId returns the BuildId field if non-nil, zero value otherwise. - -### GetBuildIdOk - -`func (o *TaggedBuildInfo) GetBuildIdOk() (*string, bool)` - -GetBuildIdOk returns a tuple with the BuildId field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetBuildId - -`func (o *TaggedBuildInfo) SetBuildId(v string)` - -SetBuildId sets BuildId field to given value. - -### HasBuildId - -`func (o *TaggedBuildInfo) HasBuildId() bool` - -HasBuildId returns a boolean if a field has been set. - -### GetBuildNumber - -`func (o *TaggedBuildInfo) GetBuildNumber() string` - -GetBuildNumber returns the BuildNumber field if non-nil, zero value otherwise. - -### GetBuildNumberOk - -`func (o *TaggedBuildInfo) GetBuildNumberOk() (*string, bool)` - -GetBuildNumberOk returns a tuple with the BuildNumber field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetBuildNumber - -`func (o *TaggedBuildInfo) SetBuildNumber(v string)` - -SetBuildNumber sets BuildNumber field to given value. - -### HasBuildNumber - -`func (o *TaggedBuildInfo) HasBuildNumber() bool` - -HasBuildNumber returns a boolean if a field has been set. - -### GetBuildNumberInt - -`func (o *TaggedBuildInfo) GetBuildNumberInt() int32` - -GetBuildNumberInt returns the BuildNumberInt field if non-nil, zero value otherwise. - -### GetBuildNumberIntOk - -`func (o *TaggedBuildInfo) GetBuildNumberIntOk() (*int32, bool)` - -GetBuildNumberIntOk returns a tuple with the BuildNumberInt field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetBuildNumberInt - -`func (o *TaggedBuildInfo) SetBuildNumberInt(v int32)` - -SetBuildNumberInt sets BuildNumberInt field to given value. - -### HasBuildNumberInt - -`func (o *TaggedBuildInfo) HasBuildNumberInt() bool` - -HasBuildNumberInt returns a boolean if a field has been set. - -### GetFinishedAt - -`func (o *TaggedBuildInfo) GetFinishedAt() time.Time` - -GetFinishedAt returns the FinishedAt field if non-nil, zero value otherwise. - -### GetFinishedAtOk - -`func (o *TaggedBuildInfo) GetFinishedAtOk() (*time.Time, bool)` - -GetFinishedAtOk returns a tuple with the FinishedAt field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetFinishedAt - -`func (o *TaggedBuildInfo) SetFinishedAt(v time.Time)` - -SetFinishedAt sets FinishedAt field to given value. - -### HasFinishedAt - -`func (o *TaggedBuildInfo) HasFinishedAt() bool` - -HasFinishedAt returns a boolean if a field has been set. - -### SetFinishedAtNil - -`func (o *TaggedBuildInfo) SetFinishedAtNil(b bool)` - - SetFinishedAtNil sets the value for FinishedAt to be an explicit nil - -### UnsetFinishedAt -`func (o *TaggedBuildInfo) UnsetFinishedAt()` - -UnsetFinishedAt ensures that no value is present for FinishedAt, not even an explicit nil - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/TaggedBuildsValue.md b/docs/TaggedBuildsValue.md deleted file mode 100644 index f950d02..0000000 --- a/docs/TaggedBuildsValue.md +++ /dev/null @@ -1,144 +0,0 @@ -# TaggedBuildsValue - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**BuildId** | Pointer to **string** | The ID of the build associated with this tag. | [optional] -**BuildNumber** | Pointer to **string** | The build number/version string. | [optional] -**BuildNumberInt** | Pointer to **int32** | The build number encoded as a single integer. | [optional] -**FinishedAt** | Pointer to **NullableTime** | The timestamp when the build finished. | [optional] - -## Methods - -### NewTaggedBuildsValue - -`func NewTaggedBuildsValue() *TaggedBuildsValue` - -NewTaggedBuildsValue instantiates a new TaggedBuildsValue object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewTaggedBuildsValueWithDefaults - -`func NewTaggedBuildsValueWithDefaults() *TaggedBuildsValue` - -NewTaggedBuildsValueWithDefaults instantiates a new TaggedBuildsValue object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetBuildId - -`func (o *TaggedBuildsValue) GetBuildId() string` - -GetBuildId returns the BuildId field if non-nil, zero value otherwise. - -### GetBuildIdOk - -`func (o *TaggedBuildsValue) GetBuildIdOk() (*string, bool)` - -GetBuildIdOk returns a tuple with the BuildId field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetBuildId - -`func (o *TaggedBuildsValue) SetBuildId(v string)` - -SetBuildId sets BuildId field to given value. - -### HasBuildId - -`func (o *TaggedBuildsValue) HasBuildId() bool` - -HasBuildId returns a boolean if a field has been set. - -### GetBuildNumber - -`func (o *TaggedBuildsValue) GetBuildNumber() string` - -GetBuildNumber returns the BuildNumber field if non-nil, zero value otherwise. - -### GetBuildNumberOk - -`func (o *TaggedBuildsValue) GetBuildNumberOk() (*string, bool)` - -GetBuildNumberOk returns a tuple with the BuildNumber field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetBuildNumber - -`func (o *TaggedBuildsValue) SetBuildNumber(v string)` - -SetBuildNumber sets BuildNumber field to given value. - -### HasBuildNumber - -`func (o *TaggedBuildsValue) HasBuildNumber() bool` - -HasBuildNumber returns a boolean if a field has been set. - -### GetBuildNumberInt - -`func (o *TaggedBuildsValue) GetBuildNumberInt() int32` - -GetBuildNumberInt returns the BuildNumberInt field if non-nil, zero value otherwise. - -### GetBuildNumberIntOk - -`func (o *TaggedBuildsValue) GetBuildNumberIntOk() (*int32, bool)` - -GetBuildNumberIntOk returns a tuple with the BuildNumberInt field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetBuildNumberInt - -`func (o *TaggedBuildsValue) SetBuildNumberInt(v int32)` - -SetBuildNumberInt sets BuildNumberInt field to given value. - -### HasBuildNumberInt - -`func (o *TaggedBuildsValue) HasBuildNumberInt() bool` - -HasBuildNumberInt returns a boolean if a field has been set. - -### GetFinishedAt - -`func (o *TaggedBuildsValue) GetFinishedAt() time.Time` - -GetFinishedAt returns the FinishedAt field if non-nil, zero value otherwise. - -### GetFinishedAtOk - -`func (o *TaggedBuildsValue) GetFinishedAtOk() (*time.Time, bool)` - -GetFinishedAtOk returns a tuple with the FinishedAt field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetFinishedAt - -`func (o *TaggedBuildsValue) SetFinishedAt(v time.Time)` - -SetFinishedAt sets FinishedAt field to given value. - -### HasFinishedAt - -`func (o *TaggedBuildsValue) HasFinishedAt() bool` - -HasFinishedAt returns a boolean if a field has been set. - -### SetFinishedAtNil - -`func (o *TaggedBuildsValue) SetFinishedAtNil(b bool)` - - SetFinishedAtNil sets the value for FinishedAt to be an explicit nil - -### UnsetFinishedAt -`func (o *TaggedBuildsValue) UnsetFinishedAt()` - -UnsetFinishedAt ensures that no value is present for FinishedAt, not even an explicit nil - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/Task.md b/docs/Task.md deleted file mode 100644 index 16ede80..0000000 --- a/docs/Task.md +++ /dev/null @@ -1,444 +0,0 @@ -# Task - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Id** | **string** | | -**UserId** | **string** | | -**ActId** | **string** | | -**Name** | **string** | | -**Username** | Pointer to **NullableString** | | [optional] -**CreatedAt** | **time.Time** | | -**ModifiedAt** | **time.Time** | | -**RemovedAt** | Pointer to **NullableTime** | | [optional] -**Stats** | Pointer to [**NullableTaskStats**](TaskStats.md) | | [optional] -**Options** | Pointer to [**NullableTaskOptions**](TaskOptions.md) | | [optional] -**Input** | Pointer to **map[string]interface{}** | The input configuration for the Actor task. This is a user-defined JSON object that will be passed to the Actor when the task is run. | [optional] -**Title** | Pointer to **NullableString** | | [optional] -**ActorStandby** | Pointer to [**NullableActorStandby**](ActorStandby.md) | | [optional] -**StandbyUrl** | Pointer to **NullableString** | | [optional] - -## Methods - -### NewTask - -`func NewTask(id string, userId string, actId string, name string, createdAt time.Time, modifiedAt time.Time, ) *Task` - -NewTask instantiates a new Task object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewTaskWithDefaults - -`func NewTaskWithDefaults() *Task` - -NewTaskWithDefaults instantiates a new Task object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetId - -`func (o *Task) GetId() string` - -GetId returns the Id field if non-nil, zero value otherwise. - -### GetIdOk - -`func (o *Task) GetIdOk() (*string, bool)` - -GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetId - -`func (o *Task) SetId(v string)` - -SetId sets Id field to given value. - - -### GetUserId - -`func (o *Task) GetUserId() string` - -GetUserId returns the UserId field if non-nil, zero value otherwise. - -### GetUserIdOk - -`func (o *Task) GetUserIdOk() (*string, bool)` - -GetUserIdOk returns a tuple with the UserId field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetUserId - -`func (o *Task) SetUserId(v string)` - -SetUserId sets UserId field to given value. - - -### GetActId - -`func (o *Task) GetActId() string` - -GetActId returns the ActId field if non-nil, zero value otherwise. - -### GetActIdOk - -`func (o *Task) GetActIdOk() (*string, bool)` - -GetActIdOk returns a tuple with the ActId field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetActId - -`func (o *Task) SetActId(v string)` - -SetActId sets ActId field to given value. - - -### GetName - -`func (o *Task) GetName() string` - -GetName returns the Name field if non-nil, zero value otherwise. - -### GetNameOk - -`func (o *Task) GetNameOk() (*string, bool)` - -GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetName - -`func (o *Task) SetName(v string)` - -SetName sets Name field to given value. - - -### GetUsername - -`func (o *Task) GetUsername() string` - -GetUsername returns the Username field if non-nil, zero value otherwise. - -### GetUsernameOk - -`func (o *Task) GetUsernameOk() (*string, bool)` - -GetUsernameOk returns a tuple with the Username field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetUsername - -`func (o *Task) SetUsername(v string)` - -SetUsername sets Username field to given value. - -### HasUsername - -`func (o *Task) HasUsername() bool` - -HasUsername returns a boolean if a field has been set. - -### SetUsernameNil - -`func (o *Task) SetUsernameNil(b bool)` - - SetUsernameNil sets the value for Username to be an explicit nil - -### UnsetUsername -`func (o *Task) UnsetUsername()` - -UnsetUsername ensures that no value is present for Username, not even an explicit nil -### GetCreatedAt - -`func (o *Task) GetCreatedAt() time.Time` - -GetCreatedAt returns the CreatedAt field if non-nil, zero value otherwise. - -### GetCreatedAtOk - -`func (o *Task) GetCreatedAtOk() (*time.Time, bool)` - -GetCreatedAtOk returns a tuple with the CreatedAt field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetCreatedAt - -`func (o *Task) SetCreatedAt(v time.Time)` - -SetCreatedAt sets CreatedAt field to given value. - - -### GetModifiedAt - -`func (o *Task) GetModifiedAt() time.Time` - -GetModifiedAt returns the ModifiedAt field if non-nil, zero value otherwise. - -### GetModifiedAtOk - -`func (o *Task) GetModifiedAtOk() (*time.Time, bool)` - -GetModifiedAtOk returns a tuple with the ModifiedAt field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetModifiedAt - -`func (o *Task) SetModifiedAt(v time.Time)` - -SetModifiedAt sets ModifiedAt field to given value. - - -### GetRemovedAt - -`func (o *Task) GetRemovedAt() time.Time` - -GetRemovedAt returns the RemovedAt field if non-nil, zero value otherwise. - -### GetRemovedAtOk - -`func (o *Task) GetRemovedAtOk() (*time.Time, bool)` - -GetRemovedAtOk returns a tuple with the RemovedAt field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetRemovedAt - -`func (o *Task) SetRemovedAt(v time.Time)` - -SetRemovedAt sets RemovedAt field to given value. - -### HasRemovedAt - -`func (o *Task) HasRemovedAt() bool` - -HasRemovedAt returns a boolean if a field has been set. - -### SetRemovedAtNil - -`func (o *Task) SetRemovedAtNil(b bool)` - - SetRemovedAtNil sets the value for RemovedAt to be an explicit nil - -### UnsetRemovedAt -`func (o *Task) UnsetRemovedAt()` - -UnsetRemovedAt ensures that no value is present for RemovedAt, not even an explicit nil -### GetStats - -`func (o *Task) GetStats() TaskStats` - -GetStats returns the Stats field if non-nil, zero value otherwise. - -### GetStatsOk - -`func (o *Task) GetStatsOk() (*TaskStats, bool)` - -GetStatsOk returns a tuple with the Stats field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetStats - -`func (o *Task) SetStats(v TaskStats)` - -SetStats sets Stats field to given value. - -### HasStats - -`func (o *Task) HasStats() bool` - -HasStats returns a boolean if a field has been set. - -### SetStatsNil - -`func (o *Task) SetStatsNil(b bool)` - - SetStatsNil sets the value for Stats to be an explicit nil - -### UnsetStats -`func (o *Task) UnsetStats()` - -UnsetStats ensures that no value is present for Stats, not even an explicit nil -### GetOptions - -`func (o *Task) GetOptions() TaskOptions` - -GetOptions returns the Options field if non-nil, zero value otherwise. - -### GetOptionsOk - -`func (o *Task) GetOptionsOk() (*TaskOptions, bool)` - -GetOptionsOk returns a tuple with the Options field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetOptions - -`func (o *Task) SetOptions(v TaskOptions)` - -SetOptions sets Options field to given value. - -### HasOptions - -`func (o *Task) HasOptions() bool` - -HasOptions returns a boolean if a field has been set. - -### SetOptionsNil - -`func (o *Task) SetOptionsNil(b bool)` - - SetOptionsNil sets the value for Options to be an explicit nil - -### UnsetOptions -`func (o *Task) UnsetOptions()` - -UnsetOptions ensures that no value is present for Options, not even an explicit nil -### GetInput - -`func (o *Task) GetInput() map[string]interface{}` - -GetInput returns the Input field if non-nil, zero value otherwise. - -### GetInputOk - -`func (o *Task) GetInputOk() (*map[string]interface{}, bool)` - -GetInputOk returns a tuple with the Input field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetInput - -`func (o *Task) SetInput(v map[string]interface{})` - -SetInput sets Input field to given value. - -### HasInput - -`func (o *Task) HasInput() bool` - -HasInput returns a boolean if a field has been set. - -### SetInputNil - -`func (o *Task) SetInputNil(b bool)` - - SetInputNil sets the value for Input to be an explicit nil - -### UnsetInput -`func (o *Task) UnsetInput()` - -UnsetInput ensures that no value is present for Input, not even an explicit nil -### GetTitle - -`func (o *Task) GetTitle() string` - -GetTitle returns the Title field if non-nil, zero value otherwise. - -### GetTitleOk - -`func (o *Task) GetTitleOk() (*string, bool)` - -GetTitleOk returns a tuple with the Title field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetTitle - -`func (o *Task) SetTitle(v string)` - -SetTitle sets Title field to given value. - -### HasTitle - -`func (o *Task) HasTitle() bool` - -HasTitle returns a boolean if a field has been set. - -### SetTitleNil - -`func (o *Task) SetTitleNil(b bool)` - - SetTitleNil sets the value for Title to be an explicit nil - -### UnsetTitle -`func (o *Task) UnsetTitle()` - -UnsetTitle ensures that no value is present for Title, not even an explicit nil -### GetActorStandby - -`func (o *Task) GetActorStandby() ActorStandby` - -GetActorStandby returns the ActorStandby field if non-nil, zero value otherwise. - -### GetActorStandbyOk - -`func (o *Task) GetActorStandbyOk() (*ActorStandby, bool)` - -GetActorStandbyOk returns a tuple with the ActorStandby field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetActorStandby - -`func (o *Task) SetActorStandby(v ActorStandby)` - -SetActorStandby sets ActorStandby field to given value. - -### HasActorStandby - -`func (o *Task) HasActorStandby() bool` - -HasActorStandby returns a boolean if a field has been set. - -### SetActorStandbyNil - -`func (o *Task) SetActorStandbyNil(b bool)` - - SetActorStandbyNil sets the value for ActorStandby to be an explicit nil - -### UnsetActorStandby -`func (o *Task) UnsetActorStandby()` - -UnsetActorStandby ensures that no value is present for ActorStandby, not even an explicit nil -### GetStandbyUrl - -`func (o *Task) GetStandbyUrl() string` - -GetStandbyUrl returns the StandbyUrl field if non-nil, zero value otherwise. - -### GetStandbyUrlOk - -`func (o *Task) GetStandbyUrlOk() (*string, bool)` - -GetStandbyUrlOk returns a tuple with the StandbyUrl field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetStandbyUrl - -`func (o *Task) SetStandbyUrl(v string)` - -SetStandbyUrl sets StandbyUrl field to given value. - -### HasStandbyUrl - -`func (o *Task) HasStandbyUrl() bool` - -HasStandbyUrl returns a boolean if a field has been set. - -### SetStandbyUrlNil - -`func (o *Task) SetStandbyUrlNil(b bool)` - - SetStandbyUrlNil sets the value for StandbyUrl to be an explicit nil - -### UnsetStandbyUrl -`func (o *Task) UnsetStandbyUrl()` - -UnsetStandbyUrl ensures that no value is present for StandbyUrl, not even an explicit nil - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/TaskOptions.md b/docs/TaskOptions.md deleted file mode 100644 index d90e430..0000000 --- a/docs/TaskOptions.md +++ /dev/null @@ -1,246 +0,0 @@ -# TaskOptions - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Build** | Pointer to **NullableString** | | [optional] -**TimeoutSecs** | Pointer to **NullableInt32** | | [optional] -**MemoryMbytes** | Pointer to **NullableInt32** | | [optional] -**MaxItems** | Pointer to **NullableInt32** | | [optional] -**MaxTotalChargeUsd** | Pointer to **NullableFloat32** | | [optional] -**RestartOnError** | Pointer to **NullableBool** | | [optional] - -## Methods - -### NewTaskOptions - -`func NewTaskOptions() *TaskOptions` - -NewTaskOptions instantiates a new TaskOptions object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewTaskOptionsWithDefaults - -`func NewTaskOptionsWithDefaults() *TaskOptions` - -NewTaskOptionsWithDefaults instantiates a new TaskOptions object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetBuild - -`func (o *TaskOptions) GetBuild() string` - -GetBuild returns the Build field if non-nil, zero value otherwise. - -### GetBuildOk - -`func (o *TaskOptions) GetBuildOk() (*string, bool)` - -GetBuildOk returns a tuple with the Build field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetBuild - -`func (o *TaskOptions) SetBuild(v string)` - -SetBuild sets Build field to given value. - -### HasBuild - -`func (o *TaskOptions) HasBuild() bool` - -HasBuild returns a boolean if a field has been set. - -### SetBuildNil - -`func (o *TaskOptions) SetBuildNil(b bool)` - - SetBuildNil sets the value for Build to be an explicit nil - -### UnsetBuild -`func (o *TaskOptions) UnsetBuild()` - -UnsetBuild ensures that no value is present for Build, not even an explicit nil -### GetTimeoutSecs - -`func (o *TaskOptions) GetTimeoutSecs() int32` - -GetTimeoutSecs returns the TimeoutSecs field if non-nil, zero value otherwise. - -### GetTimeoutSecsOk - -`func (o *TaskOptions) GetTimeoutSecsOk() (*int32, bool)` - -GetTimeoutSecsOk returns a tuple with the TimeoutSecs field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetTimeoutSecs - -`func (o *TaskOptions) SetTimeoutSecs(v int32)` - -SetTimeoutSecs sets TimeoutSecs field to given value. - -### HasTimeoutSecs - -`func (o *TaskOptions) HasTimeoutSecs() bool` - -HasTimeoutSecs returns a boolean if a field has been set. - -### SetTimeoutSecsNil - -`func (o *TaskOptions) SetTimeoutSecsNil(b bool)` - - SetTimeoutSecsNil sets the value for TimeoutSecs to be an explicit nil - -### UnsetTimeoutSecs -`func (o *TaskOptions) UnsetTimeoutSecs()` - -UnsetTimeoutSecs ensures that no value is present for TimeoutSecs, not even an explicit nil -### GetMemoryMbytes - -`func (o *TaskOptions) GetMemoryMbytes() int32` - -GetMemoryMbytes returns the MemoryMbytes field if non-nil, zero value otherwise. - -### GetMemoryMbytesOk - -`func (o *TaskOptions) GetMemoryMbytesOk() (*int32, bool)` - -GetMemoryMbytesOk returns a tuple with the MemoryMbytes field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetMemoryMbytes - -`func (o *TaskOptions) SetMemoryMbytes(v int32)` - -SetMemoryMbytes sets MemoryMbytes field to given value. - -### HasMemoryMbytes - -`func (o *TaskOptions) HasMemoryMbytes() bool` - -HasMemoryMbytes returns a boolean if a field has been set. - -### SetMemoryMbytesNil - -`func (o *TaskOptions) SetMemoryMbytesNil(b bool)` - - SetMemoryMbytesNil sets the value for MemoryMbytes to be an explicit nil - -### UnsetMemoryMbytes -`func (o *TaskOptions) UnsetMemoryMbytes()` - -UnsetMemoryMbytes ensures that no value is present for MemoryMbytes, not even an explicit nil -### GetMaxItems - -`func (o *TaskOptions) GetMaxItems() int32` - -GetMaxItems returns the MaxItems field if non-nil, zero value otherwise. - -### GetMaxItemsOk - -`func (o *TaskOptions) GetMaxItemsOk() (*int32, bool)` - -GetMaxItemsOk returns a tuple with the MaxItems field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetMaxItems - -`func (o *TaskOptions) SetMaxItems(v int32)` - -SetMaxItems sets MaxItems field to given value. - -### HasMaxItems - -`func (o *TaskOptions) HasMaxItems() bool` - -HasMaxItems returns a boolean if a field has been set. - -### SetMaxItemsNil - -`func (o *TaskOptions) SetMaxItemsNil(b bool)` - - SetMaxItemsNil sets the value for MaxItems to be an explicit nil - -### UnsetMaxItems -`func (o *TaskOptions) UnsetMaxItems()` - -UnsetMaxItems ensures that no value is present for MaxItems, not even an explicit nil -### GetMaxTotalChargeUsd - -`func (o *TaskOptions) GetMaxTotalChargeUsd() float32` - -GetMaxTotalChargeUsd returns the MaxTotalChargeUsd field if non-nil, zero value otherwise. - -### GetMaxTotalChargeUsdOk - -`func (o *TaskOptions) GetMaxTotalChargeUsdOk() (*float32, bool)` - -GetMaxTotalChargeUsdOk returns a tuple with the MaxTotalChargeUsd field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetMaxTotalChargeUsd - -`func (o *TaskOptions) SetMaxTotalChargeUsd(v float32)` - -SetMaxTotalChargeUsd sets MaxTotalChargeUsd field to given value. - -### HasMaxTotalChargeUsd - -`func (o *TaskOptions) HasMaxTotalChargeUsd() bool` - -HasMaxTotalChargeUsd returns a boolean if a field has been set. - -### SetMaxTotalChargeUsdNil - -`func (o *TaskOptions) SetMaxTotalChargeUsdNil(b bool)` - - SetMaxTotalChargeUsdNil sets the value for MaxTotalChargeUsd to be an explicit nil - -### UnsetMaxTotalChargeUsd -`func (o *TaskOptions) UnsetMaxTotalChargeUsd()` - -UnsetMaxTotalChargeUsd ensures that no value is present for MaxTotalChargeUsd, not even an explicit nil -### GetRestartOnError - -`func (o *TaskOptions) GetRestartOnError() bool` - -GetRestartOnError returns the RestartOnError field if non-nil, zero value otherwise. - -### GetRestartOnErrorOk - -`func (o *TaskOptions) GetRestartOnErrorOk() (*bool, bool)` - -GetRestartOnErrorOk returns a tuple with the RestartOnError field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetRestartOnError - -`func (o *TaskOptions) SetRestartOnError(v bool)` - -SetRestartOnError sets RestartOnError field to given value. - -### HasRestartOnError - -`func (o *TaskOptions) HasRestartOnError() bool` - -HasRestartOnError returns a boolean if a field has been set. - -### SetRestartOnErrorNil - -`func (o *TaskOptions) SetRestartOnErrorNil(b bool)` - - SetRestartOnErrorNil sets the value for RestartOnError to be an explicit nil - -### UnsetRestartOnError -`func (o *TaskOptions) UnsetRestartOnError()` - -UnsetRestartOnError ensures that no value is present for RestartOnError, not even an explicit nil - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/TaskResponse.md b/docs/TaskResponse.md deleted file mode 100644 index 7e8570b..0000000 --- a/docs/TaskResponse.md +++ /dev/null @@ -1,51 +0,0 @@ -# TaskResponse - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Data** | [**Task**](Task.md) | | - -## Methods - -### NewTaskResponse - -`func NewTaskResponse(data Task, ) *TaskResponse` - -NewTaskResponse instantiates a new TaskResponse object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewTaskResponseWithDefaults - -`func NewTaskResponseWithDefaults() *TaskResponse` - -NewTaskResponseWithDefaults instantiates a new TaskResponse object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetData - -`func (o *TaskResponse) GetData() Task` - -GetData returns the Data field if non-nil, zero value otherwise. - -### GetDataOk - -`func (o *TaskResponse) GetDataOk() (*Task, bool)` - -GetDataOk returns a tuple with the Data field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetData - -`func (o *TaskResponse) SetData(v Task)` - -SetData sets Data field to given value. - - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/TaskShort.md b/docs/TaskShort.md deleted file mode 100644 index 7eef763..0000000 --- a/docs/TaskShort.md +++ /dev/null @@ -1,300 +0,0 @@ -# TaskShort - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Id** | **string** | | -**UserId** | **string** | | -**ActId** | **string** | | -**ActName** | Pointer to **NullableString** | | [optional] -**Name** | **string** | | -**Username** | Pointer to **NullableString** | | [optional] -**ActUsername** | Pointer to **NullableString** | | [optional] -**CreatedAt** | **time.Time** | | -**ModifiedAt** | **time.Time** | | -**Stats** | Pointer to [**NullableTaskStats**](TaskStats.md) | | [optional] - -## Methods - -### NewTaskShort - -`func NewTaskShort(id string, userId string, actId string, name string, createdAt time.Time, modifiedAt time.Time, ) *TaskShort` - -NewTaskShort instantiates a new TaskShort object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewTaskShortWithDefaults - -`func NewTaskShortWithDefaults() *TaskShort` - -NewTaskShortWithDefaults instantiates a new TaskShort object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetId - -`func (o *TaskShort) GetId() string` - -GetId returns the Id field if non-nil, zero value otherwise. - -### GetIdOk - -`func (o *TaskShort) GetIdOk() (*string, bool)` - -GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetId - -`func (o *TaskShort) SetId(v string)` - -SetId sets Id field to given value. - - -### GetUserId - -`func (o *TaskShort) GetUserId() string` - -GetUserId returns the UserId field if non-nil, zero value otherwise. - -### GetUserIdOk - -`func (o *TaskShort) GetUserIdOk() (*string, bool)` - -GetUserIdOk returns a tuple with the UserId field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetUserId - -`func (o *TaskShort) SetUserId(v string)` - -SetUserId sets UserId field to given value. - - -### GetActId - -`func (o *TaskShort) GetActId() string` - -GetActId returns the ActId field if non-nil, zero value otherwise. - -### GetActIdOk - -`func (o *TaskShort) GetActIdOk() (*string, bool)` - -GetActIdOk returns a tuple with the ActId field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetActId - -`func (o *TaskShort) SetActId(v string)` - -SetActId sets ActId field to given value. - - -### GetActName - -`func (o *TaskShort) GetActName() string` - -GetActName returns the ActName field if non-nil, zero value otherwise. - -### GetActNameOk - -`func (o *TaskShort) GetActNameOk() (*string, bool)` - -GetActNameOk returns a tuple with the ActName field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetActName - -`func (o *TaskShort) SetActName(v string)` - -SetActName sets ActName field to given value. - -### HasActName - -`func (o *TaskShort) HasActName() bool` - -HasActName returns a boolean if a field has been set. - -### SetActNameNil - -`func (o *TaskShort) SetActNameNil(b bool)` - - SetActNameNil sets the value for ActName to be an explicit nil - -### UnsetActName -`func (o *TaskShort) UnsetActName()` - -UnsetActName ensures that no value is present for ActName, not even an explicit nil -### GetName - -`func (o *TaskShort) GetName() string` - -GetName returns the Name field if non-nil, zero value otherwise. - -### GetNameOk - -`func (o *TaskShort) GetNameOk() (*string, bool)` - -GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetName - -`func (o *TaskShort) SetName(v string)` - -SetName sets Name field to given value. - - -### GetUsername - -`func (o *TaskShort) GetUsername() string` - -GetUsername returns the Username field if non-nil, zero value otherwise. - -### GetUsernameOk - -`func (o *TaskShort) GetUsernameOk() (*string, bool)` - -GetUsernameOk returns a tuple with the Username field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetUsername - -`func (o *TaskShort) SetUsername(v string)` - -SetUsername sets Username field to given value. - -### HasUsername - -`func (o *TaskShort) HasUsername() bool` - -HasUsername returns a boolean if a field has been set. - -### SetUsernameNil - -`func (o *TaskShort) SetUsernameNil(b bool)` - - SetUsernameNil sets the value for Username to be an explicit nil - -### UnsetUsername -`func (o *TaskShort) UnsetUsername()` - -UnsetUsername ensures that no value is present for Username, not even an explicit nil -### GetActUsername - -`func (o *TaskShort) GetActUsername() string` - -GetActUsername returns the ActUsername field if non-nil, zero value otherwise. - -### GetActUsernameOk - -`func (o *TaskShort) GetActUsernameOk() (*string, bool)` - -GetActUsernameOk returns a tuple with the ActUsername field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetActUsername - -`func (o *TaskShort) SetActUsername(v string)` - -SetActUsername sets ActUsername field to given value. - -### HasActUsername - -`func (o *TaskShort) HasActUsername() bool` - -HasActUsername returns a boolean if a field has been set. - -### SetActUsernameNil - -`func (o *TaskShort) SetActUsernameNil(b bool)` - - SetActUsernameNil sets the value for ActUsername to be an explicit nil - -### UnsetActUsername -`func (o *TaskShort) UnsetActUsername()` - -UnsetActUsername ensures that no value is present for ActUsername, not even an explicit nil -### GetCreatedAt - -`func (o *TaskShort) GetCreatedAt() time.Time` - -GetCreatedAt returns the CreatedAt field if non-nil, zero value otherwise. - -### GetCreatedAtOk - -`func (o *TaskShort) GetCreatedAtOk() (*time.Time, bool)` - -GetCreatedAtOk returns a tuple with the CreatedAt field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetCreatedAt - -`func (o *TaskShort) SetCreatedAt(v time.Time)` - -SetCreatedAt sets CreatedAt field to given value. - - -### GetModifiedAt - -`func (o *TaskShort) GetModifiedAt() time.Time` - -GetModifiedAt returns the ModifiedAt field if non-nil, zero value otherwise. - -### GetModifiedAtOk - -`func (o *TaskShort) GetModifiedAtOk() (*time.Time, bool)` - -GetModifiedAtOk returns a tuple with the ModifiedAt field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetModifiedAt - -`func (o *TaskShort) SetModifiedAt(v time.Time)` - -SetModifiedAt sets ModifiedAt field to given value. - - -### GetStats - -`func (o *TaskShort) GetStats() TaskStats` - -GetStats returns the Stats field if non-nil, zero value otherwise. - -### GetStatsOk - -`func (o *TaskShort) GetStatsOk() (*TaskStats, bool)` - -GetStatsOk returns a tuple with the Stats field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetStats - -`func (o *TaskShort) SetStats(v TaskStats)` - -SetStats sets Stats field to given value. - -### HasStats - -`func (o *TaskShort) HasStats() bool` - -HasStats returns a boolean if a field has been set. - -### SetStatsNil - -`func (o *TaskShort) SetStatsNil(b bool)` - - SetStatsNil sets the value for Stats to be an explicit nil - -### UnsetStats -`func (o *TaskShort) UnsetStats()` - -UnsetStats ensures that no value is present for Stats, not even an explicit nil - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/TaskStats.md b/docs/TaskStats.md deleted file mode 100644 index c3331b0..0000000 --- a/docs/TaskStats.md +++ /dev/null @@ -1,56 +0,0 @@ -# TaskStats - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**TotalRuns** | Pointer to **int32** | | [optional] - -## Methods - -### NewTaskStats - -`func NewTaskStats() *TaskStats` - -NewTaskStats instantiates a new TaskStats object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewTaskStatsWithDefaults - -`func NewTaskStatsWithDefaults() *TaskStats` - -NewTaskStatsWithDefaults instantiates a new TaskStats object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetTotalRuns - -`func (o *TaskStats) GetTotalRuns() int32` - -GetTotalRuns returns the TotalRuns field if non-nil, zero value otherwise. - -### GetTotalRunsOk - -`func (o *TaskStats) GetTotalRunsOk() (*int32, bool)` - -GetTotalRunsOk returns a tuple with the TotalRuns field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetTotalRuns - -`func (o *TaskStats) SetTotalRuns(v int32)` - -SetTotalRuns sets TotalRuns field to given value. - -### HasTotalRuns - -`func (o *TaskStats) HasTotalRuns() bool` - -HasTotalRuns returns a boolean if a field has been set. - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/TestWebhookResponse.md b/docs/TestWebhookResponse.md deleted file mode 100644 index 9e81ef4..0000000 --- a/docs/TestWebhookResponse.md +++ /dev/null @@ -1,51 +0,0 @@ -# TestWebhookResponse - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Data** | [**WebhookDispatch**](WebhookDispatch.md) | | - -## Methods - -### NewTestWebhookResponse - -`func NewTestWebhookResponse(data WebhookDispatch, ) *TestWebhookResponse` - -NewTestWebhookResponse instantiates a new TestWebhookResponse object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewTestWebhookResponseWithDefaults - -`func NewTestWebhookResponseWithDefaults() *TestWebhookResponse` - -NewTestWebhookResponseWithDefaults instantiates a new TestWebhookResponse object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetData - -`func (o *TestWebhookResponse) GetData() WebhookDispatch` - -GetData returns the Data field if non-nil, zero value otherwise. - -### GetDataOk - -`func (o *TestWebhookResponse) GetDataOk() (*WebhookDispatch, bool)` - -GetDataOk returns a tuple with the Data field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetData - -`func (o *TestWebhookResponse) SetData(v WebhookDispatch)` - -SetData sets Data field to given value. - - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/TieredPricingPerDatasetItemEntry.md b/docs/TieredPricingPerDatasetItemEntry.md deleted file mode 100644 index 915bd9f..0000000 --- a/docs/TieredPricingPerDatasetItemEntry.md +++ /dev/null @@ -1,51 +0,0 @@ -# TieredPricingPerDatasetItemEntry - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**TieredPricePerUnitUsd** | **float32** | Price per unit in USD for this tier. | - -## Methods - -### NewTieredPricingPerDatasetItemEntry - -`func NewTieredPricingPerDatasetItemEntry(tieredPricePerUnitUsd float32, ) *TieredPricingPerDatasetItemEntry` - -NewTieredPricingPerDatasetItemEntry instantiates a new TieredPricingPerDatasetItemEntry object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewTieredPricingPerDatasetItemEntryWithDefaults - -`func NewTieredPricingPerDatasetItemEntryWithDefaults() *TieredPricingPerDatasetItemEntry` - -NewTieredPricingPerDatasetItemEntryWithDefaults instantiates a new TieredPricingPerDatasetItemEntry object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetTieredPricePerUnitUsd - -`func (o *TieredPricingPerDatasetItemEntry) GetTieredPricePerUnitUsd() float32` - -GetTieredPricePerUnitUsd returns the TieredPricePerUnitUsd field if non-nil, zero value otherwise. - -### GetTieredPricePerUnitUsdOk - -`func (o *TieredPricingPerDatasetItemEntry) GetTieredPricePerUnitUsdOk() (*float32, bool)` - -GetTieredPricePerUnitUsdOk returns a tuple with the TieredPricePerUnitUsd field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetTieredPricePerUnitUsd - -`func (o *TieredPricingPerDatasetItemEntry) SetTieredPricePerUnitUsd(v float32)` - -SetTieredPricePerUnitUsd sets TieredPricePerUnitUsd field to given value. - - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/TieredPricingPerEventEntry.md b/docs/TieredPricingPerEventEntry.md deleted file mode 100644 index ae97a7a..0000000 --- a/docs/TieredPricingPerEventEntry.md +++ /dev/null @@ -1,51 +0,0 @@ -# TieredPricingPerEventEntry - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**TieredEventPriceUsd** | **float32** | Price per event in USD for this tier. | - -## Methods - -### NewTieredPricingPerEventEntry - -`func NewTieredPricingPerEventEntry(tieredEventPriceUsd float32, ) *TieredPricingPerEventEntry` - -NewTieredPricingPerEventEntry instantiates a new TieredPricingPerEventEntry object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewTieredPricingPerEventEntryWithDefaults - -`func NewTieredPricingPerEventEntryWithDefaults() *TieredPricingPerEventEntry` - -NewTieredPricingPerEventEntryWithDefaults instantiates a new TieredPricingPerEventEntry object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetTieredEventPriceUsd - -`func (o *TieredPricingPerEventEntry) GetTieredEventPriceUsd() float32` - -GetTieredEventPriceUsd returns the TieredEventPriceUsd field if non-nil, zero value otherwise. - -### GetTieredEventPriceUsdOk - -`func (o *TieredPricingPerEventEntry) GetTieredEventPriceUsdOk() (*float32, bool)` - -GetTieredEventPriceUsdOk returns a tuple with the TieredEventPriceUsd field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetTieredEventPriceUsd - -`func (o *TieredPricingPerEventEntry) SetTieredEventPriceUsd(v float32)` - -SetTieredEventPriceUsd sets TieredEventPriceUsd field to given value. - - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/ToolsAPI.md b/docs/ToolsAPI.md deleted file mode 100644 index bc29aba..0000000 --- a/docs/ToolsAPI.md +++ /dev/null @@ -1,418 +0,0 @@ -# \ToolsAPI - -All URIs are relative to *https://api.apify.com* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**ToolsBrowserInfoDelete**](ToolsAPI.md#ToolsBrowserInfoDelete) | **Delete** /v2/browser-info | Get browser info -[**ToolsBrowserInfoGet**](ToolsAPI.md#ToolsBrowserInfoGet) | **Get** /v2/browser-info | Get browser info -[**ToolsBrowserInfoPost**](ToolsAPI.md#ToolsBrowserInfoPost) | **Post** /v2/browser-info | Get browser info -[**ToolsBrowserInfoPut**](ToolsAPI.md#ToolsBrowserInfoPut) | **Put** /v2/browser-info | Get browser info -[**ToolsDecodeAndVerifyPost**](ToolsAPI.md#ToolsDecodeAndVerifyPost) | **Post** /v2/tools/decode-and-verify | Decode and verify object -[**ToolsEncodeAndSignPost**](ToolsAPI.md#ToolsEncodeAndSignPost) | **Post** /v2/tools/encode-and-sign | Encode and sign object - - - -## ToolsBrowserInfoDelete - -> BrowserInfoResponse ToolsBrowserInfoDelete(ctx).SkipHeaders(skipHeaders).RawHeaders(rawHeaders).Execute() - -Get browser info - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - skipHeaders := true // bool | If `true` or `1`, the response omits the `headers` field. (optional) - rawHeaders := true // bool | If `true` or `1`, the response includes the `rawHeaders` field with the raw request headers. (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.ToolsAPI.ToolsBrowserInfoDelete(context.Background()).SkipHeaders(skipHeaders).RawHeaders(rawHeaders).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `ToolsAPI.ToolsBrowserInfoDelete``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `ToolsBrowserInfoDelete`: BrowserInfoResponse - fmt.Fprintf(os.Stdout, "Response from `ToolsAPI.ToolsBrowserInfoDelete`: %v\n", resp) -} -``` - -### Path Parameters - - - -### Other Parameters - -Other parameters are passed through a pointer to a apiToolsBrowserInfoDeleteRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **skipHeaders** | **bool** | If `true` or `1`, the response omits the `headers` field. | - **rawHeaders** | **bool** | If `true` or `1`, the response includes the `rawHeaders` field with the raw request headers. | - -### Return type - -[**BrowserInfoResponse**](BrowserInfoResponse.md) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## ToolsBrowserInfoGet - -> BrowserInfoResponse ToolsBrowserInfoGet(ctx).SkipHeaders(skipHeaders).RawHeaders(rawHeaders).Execute() - -Get browser info - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - skipHeaders := true // bool | If `true` or `1`, the response omits the `headers` field. (optional) - rawHeaders := true // bool | If `true` or `1`, the response includes the `rawHeaders` field with the raw request headers. (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.ToolsAPI.ToolsBrowserInfoGet(context.Background()).SkipHeaders(skipHeaders).RawHeaders(rawHeaders).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `ToolsAPI.ToolsBrowserInfoGet``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `ToolsBrowserInfoGet`: BrowserInfoResponse - fmt.Fprintf(os.Stdout, "Response from `ToolsAPI.ToolsBrowserInfoGet`: %v\n", resp) -} -``` - -### Path Parameters - - - -### Other Parameters - -Other parameters are passed through a pointer to a apiToolsBrowserInfoGetRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **skipHeaders** | **bool** | If `true` or `1`, the response omits the `headers` field. | - **rawHeaders** | **bool** | If `true` or `1`, the response includes the `rawHeaders` field with the raw request headers. | - -### Return type - -[**BrowserInfoResponse**](BrowserInfoResponse.md) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## ToolsBrowserInfoPost - -> BrowserInfoResponse ToolsBrowserInfoPost(ctx).SkipHeaders(skipHeaders).RawHeaders(rawHeaders).Execute() - -Get browser info - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - skipHeaders := true // bool | If `true` or `1`, the response omits the `headers` field. (optional) - rawHeaders := true // bool | If `true` or `1`, the response includes the `rawHeaders` field with the raw request headers. (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.ToolsAPI.ToolsBrowserInfoPost(context.Background()).SkipHeaders(skipHeaders).RawHeaders(rawHeaders).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `ToolsAPI.ToolsBrowserInfoPost``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `ToolsBrowserInfoPost`: BrowserInfoResponse - fmt.Fprintf(os.Stdout, "Response from `ToolsAPI.ToolsBrowserInfoPost`: %v\n", resp) -} -``` - -### Path Parameters - - - -### Other Parameters - -Other parameters are passed through a pointer to a apiToolsBrowserInfoPostRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **skipHeaders** | **bool** | If `true` or `1`, the response omits the `headers` field. | - **rawHeaders** | **bool** | If `true` or `1`, the response includes the `rawHeaders` field with the raw request headers. | - -### Return type - -[**BrowserInfoResponse**](BrowserInfoResponse.md) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## ToolsBrowserInfoPut - -> BrowserInfoResponse ToolsBrowserInfoPut(ctx).SkipHeaders(skipHeaders).RawHeaders(rawHeaders).Execute() - -Get browser info - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - skipHeaders := true // bool | If `true` or `1`, the response omits the `headers` field. (optional) - rawHeaders := true // bool | If `true` or `1`, the response includes the `rawHeaders` field with the raw request headers. (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.ToolsAPI.ToolsBrowserInfoPut(context.Background()).SkipHeaders(skipHeaders).RawHeaders(rawHeaders).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `ToolsAPI.ToolsBrowserInfoPut``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `ToolsBrowserInfoPut`: BrowserInfoResponse - fmt.Fprintf(os.Stdout, "Response from `ToolsAPI.ToolsBrowserInfoPut`: %v\n", resp) -} -``` - -### Path Parameters - - - -### Other Parameters - -Other parameters are passed through a pointer to a apiToolsBrowserInfoPutRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **skipHeaders** | **bool** | If `true` or `1`, the response omits the `headers` field. | - **rawHeaders** | **bool** | If `true` or `1`, the response includes the `rawHeaders` field with the raw request headers. | - -### Return type - -[**BrowserInfoResponse**](BrowserInfoResponse.md) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## ToolsDecodeAndVerifyPost - -> DecodeAndVerifyResponse ToolsDecodeAndVerifyPost(ctx).DecodeAndVerifyRequest(decodeAndVerifyRequest).Execute() - -Decode and verify object - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - decodeAndVerifyRequest := *openapiclient.NewDecodeAndVerifyRequest("Encoded_example") // DecodeAndVerifyRequest | - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.ToolsAPI.ToolsDecodeAndVerifyPost(context.Background()).DecodeAndVerifyRequest(decodeAndVerifyRequest).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `ToolsAPI.ToolsDecodeAndVerifyPost``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `ToolsDecodeAndVerifyPost`: DecodeAndVerifyResponse - fmt.Fprintf(os.Stdout, "Response from `ToolsAPI.ToolsDecodeAndVerifyPost`: %v\n", resp) -} -``` - -### Path Parameters - - - -### Other Parameters - -Other parameters are passed through a pointer to a apiToolsDecodeAndVerifyPostRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **decodeAndVerifyRequest** | [**DecodeAndVerifyRequest**](DecodeAndVerifyRequest.md) | | - -### Return type - -[**DecodeAndVerifyResponse**](DecodeAndVerifyResponse.md) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## ToolsEncodeAndSignPost - -> EncodeAndSignResponse ToolsEncodeAndSignPost(ctx).Body(body).Execute() - -Encode and sign object - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - body := map[string]interface{}{ ... } // map[string]interface{} | - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.ToolsAPI.ToolsEncodeAndSignPost(context.Background()).Body(body).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `ToolsAPI.ToolsEncodeAndSignPost``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `ToolsEncodeAndSignPost`: EncodeAndSignResponse - fmt.Fprintf(os.Stdout, "Response from `ToolsAPI.ToolsEncodeAndSignPost`: %v\n", resp) -} -``` - -### Path Parameters - - - -### Other Parameters - -Other parameters are passed through a pointer to a apiToolsEncodeAndSignPostRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | **map[string]interface{}** | | - -### Return type - -[**EncodeAndSignResponse**](EncodeAndSignResponse.md) - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - diff --git a/docs/UnlockRequestsResponse.md b/docs/UnlockRequestsResponse.md deleted file mode 100644 index 4bf5c2c..0000000 --- a/docs/UnlockRequestsResponse.md +++ /dev/null @@ -1,51 +0,0 @@ -# UnlockRequestsResponse - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Data** | [**UnlockRequestsResult**](UnlockRequestsResult.md) | | - -## Methods - -### NewUnlockRequestsResponse - -`func NewUnlockRequestsResponse(data UnlockRequestsResult, ) *UnlockRequestsResponse` - -NewUnlockRequestsResponse instantiates a new UnlockRequestsResponse object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewUnlockRequestsResponseWithDefaults - -`func NewUnlockRequestsResponseWithDefaults() *UnlockRequestsResponse` - -NewUnlockRequestsResponseWithDefaults instantiates a new UnlockRequestsResponse object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetData - -`func (o *UnlockRequestsResponse) GetData() UnlockRequestsResult` - -GetData returns the Data field if non-nil, zero value otherwise. - -### GetDataOk - -`func (o *UnlockRequestsResponse) GetDataOk() (*UnlockRequestsResult, bool)` - -GetDataOk returns a tuple with the Data field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetData - -`func (o *UnlockRequestsResponse) SetData(v UnlockRequestsResult)` - -SetData sets Data field to given value. - - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/UnlockRequestsResult.md b/docs/UnlockRequestsResult.md deleted file mode 100644 index e46e168..0000000 --- a/docs/UnlockRequestsResult.md +++ /dev/null @@ -1,51 +0,0 @@ -# UnlockRequestsResult - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**UnlockedCount** | **int32** | Number of requests that were successfully unlocked. | - -## Methods - -### NewUnlockRequestsResult - -`func NewUnlockRequestsResult(unlockedCount int32, ) *UnlockRequestsResult` - -NewUnlockRequestsResult instantiates a new UnlockRequestsResult object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewUnlockRequestsResultWithDefaults - -`func NewUnlockRequestsResultWithDefaults() *UnlockRequestsResult` - -NewUnlockRequestsResultWithDefaults instantiates a new UnlockRequestsResult object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetUnlockedCount - -`func (o *UnlockRequestsResult) GetUnlockedCount() int32` - -GetUnlockedCount returns the UnlockedCount field if non-nil, zero value otherwise. - -### GetUnlockedCountOk - -`func (o *UnlockRequestsResult) GetUnlockedCountOk() (*int32, bool)` - -GetUnlockedCountOk returns a tuple with the UnlockedCount field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetUnlockedCount - -`func (o *UnlockRequestsResult) SetUnlockedCount(v int32)` - -SetUnlockedCount sets UnlockedCount field to given value. - - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/UpdateActorRequest.md b/docs/UpdateActorRequest.md deleted file mode 100644 index bffcca1..0000000 --- a/docs/UpdateActorRequest.md +++ /dev/null @@ -1,546 +0,0 @@ -# UpdateActorRequest - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Name** | Pointer to **string** | | [optional] -**Description** | Pointer to **NullableString** | | [optional] -**IsPublic** | Pointer to **bool** | | [optional] -**ActorPermissionLevel** | Pointer to [**NullableActorPermissionLevel**](ActorPermissionLevel.md) | | [optional] -**SeoTitle** | Pointer to **NullableString** | | [optional] -**SeoDescription** | Pointer to **NullableString** | | [optional] -**Title** | Pointer to **NullableString** | | [optional] -**RestartOnError** | Pointer to **bool** | | [optional] -**Versions** | Pointer to [**[]CreateOrUpdateVersionRequest**](CreateOrUpdateVersionRequest.md) | | [optional] -**PricingInfos** | Pointer to [**[]ActorRunPricingInfo**](ActorRunPricingInfo.md) | | [optional] -**Categories** | Pointer to **[]string** | | [optional] -**DefaultRunOptions** | Pointer to [**NullableDefaultRunOptions**](DefaultRunOptions.md) | | [optional] -**TaggedBuilds** | Pointer to [**map[string]BuildTag**](BuildTag.md) | An object to modify tags on the Actor's builds. The key is the tag name (e.g., _latest_), and the value is either an object with a `buildId` or `null`. This operation is a patch; any existing tags that you omit from this object will be preserved. - **To create or reassign a tag**, provide the tag name with a `buildId`. e.g., to assign the _latest_ tag: &nbsp; ```json { \"latest\": { \"buildId\": \"z2EryhbfhgSyqj6Hn\" } } ``` - **To remove a tag**, provide the tag name with a `null` value. e.g., to remove the _beta_ tag: &nbsp; ```json { \"beta\": null } ``` - **To perform multiple operations**, combine them. The following reassigns _latest_ and removes _beta_, while preserving any other existing tags. &nbsp; ```json { \"latest\": { \"buildId\": \"z2EryhbfhgSyqj6Hn\" }, \"beta\": null } ``` | [optional] -**ActorStandby** | Pointer to [**NullableActorStandby**](ActorStandby.md) | | [optional] -**ExampleRunInput** | Pointer to [**NullableExampleRunInput**](ExampleRunInput.md) | | [optional] -**IsDeprecated** | Pointer to **NullableBool** | | [optional] - -## Methods - -### NewUpdateActorRequest - -`func NewUpdateActorRequest() *UpdateActorRequest` - -NewUpdateActorRequest instantiates a new UpdateActorRequest object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewUpdateActorRequestWithDefaults - -`func NewUpdateActorRequestWithDefaults() *UpdateActorRequest` - -NewUpdateActorRequestWithDefaults instantiates a new UpdateActorRequest object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetName - -`func (o *UpdateActorRequest) GetName() string` - -GetName returns the Name field if non-nil, zero value otherwise. - -### GetNameOk - -`func (o *UpdateActorRequest) GetNameOk() (*string, bool)` - -GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetName - -`func (o *UpdateActorRequest) SetName(v string)` - -SetName sets Name field to given value. - -### HasName - -`func (o *UpdateActorRequest) HasName() bool` - -HasName returns a boolean if a field has been set. - -### GetDescription - -`func (o *UpdateActorRequest) GetDescription() string` - -GetDescription returns the Description field if non-nil, zero value otherwise. - -### GetDescriptionOk - -`func (o *UpdateActorRequest) GetDescriptionOk() (*string, bool)` - -GetDescriptionOk returns a tuple with the Description field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetDescription - -`func (o *UpdateActorRequest) SetDescription(v string)` - -SetDescription sets Description field to given value. - -### HasDescription - -`func (o *UpdateActorRequest) HasDescription() bool` - -HasDescription returns a boolean if a field has been set. - -### SetDescriptionNil - -`func (o *UpdateActorRequest) SetDescriptionNil(b bool)` - - SetDescriptionNil sets the value for Description to be an explicit nil - -### UnsetDescription -`func (o *UpdateActorRequest) UnsetDescription()` - -UnsetDescription ensures that no value is present for Description, not even an explicit nil -### GetIsPublic - -`func (o *UpdateActorRequest) GetIsPublic() bool` - -GetIsPublic returns the IsPublic field if non-nil, zero value otherwise. - -### GetIsPublicOk - -`func (o *UpdateActorRequest) GetIsPublicOk() (*bool, bool)` - -GetIsPublicOk returns a tuple with the IsPublic field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetIsPublic - -`func (o *UpdateActorRequest) SetIsPublic(v bool)` - -SetIsPublic sets IsPublic field to given value. - -### HasIsPublic - -`func (o *UpdateActorRequest) HasIsPublic() bool` - -HasIsPublic returns a boolean if a field has been set. - -### GetActorPermissionLevel - -`func (o *UpdateActorRequest) GetActorPermissionLevel() ActorPermissionLevel` - -GetActorPermissionLevel returns the ActorPermissionLevel field if non-nil, zero value otherwise. - -### GetActorPermissionLevelOk - -`func (o *UpdateActorRequest) GetActorPermissionLevelOk() (*ActorPermissionLevel, bool)` - -GetActorPermissionLevelOk returns a tuple with the ActorPermissionLevel field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetActorPermissionLevel - -`func (o *UpdateActorRequest) SetActorPermissionLevel(v ActorPermissionLevel)` - -SetActorPermissionLevel sets ActorPermissionLevel field to given value. - -### HasActorPermissionLevel - -`func (o *UpdateActorRequest) HasActorPermissionLevel() bool` - -HasActorPermissionLevel returns a boolean if a field has been set. - -### SetActorPermissionLevelNil - -`func (o *UpdateActorRequest) SetActorPermissionLevelNil(b bool)` - - SetActorPermissionLevelNil sets the value for ActorPermissionLevel to be an explicit nil - -### UnsetActorPermissionLevel -`func (o *UpdateActorRequest) UnsetActorPermissionLevel()` - -UnsetActorPermissionLevel ensures that no value is present for ActorPermissionLevel, not even an explicit nil -### GetSeoTitle - -`func (o *UpdateActorRequest) GetSeoTitle() string` - -GetSeoTitle returns the SeoTitle field if non-nil, zero value otherwise. - -### GetSeoTitleOk - -`func (o *UpdateActorRequest) GetSeoTitleOk() (*string, bool)` - -GetSeoTitleOk returns a tuple with the SeoTitle field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetSeoTitle - -`func (o *UpdateActorRequest) SetSeoTitle(v string)` - -SetSeoTitle sets SeoTitle field to given value. - -### HasSeoTitle - -`func (o *UpdateActorRequest) HasSeoTitle() bool` - -HasSeoTitle returns a boolean if a field has been set. - -### SetSeoTitleNil - -`func (o *UpdateActorRequest) SetSeoTitleNil(b bool)` - - SetSeoTitleNil sets the value for SeoTitle to be an explicit nil - -### UnsetSeoTitle -`func (o *UpdateActorRequest) UnsetSeoTitle()` - -UnsetSeoTitle ensures that no value is present for SeoTitle, not even an explicit nil -### GetSeoDescription - -`func (o *UpdateActorRequest) GetSeoDescription() string` - -GetSeoDescription returns the SeoDescription field if non-nil, zero value otherwise. - -### GetSeoDescriptionOk - -`func (o *UpdateActorRequest) GetSeoDescriptionOk() (*string, bool)` - -GetSeoDescriptionOk returns a tuple with the SeoDescription field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetSeoDescription - -`func (o *UpdateActorRequest) SetSeoDescription(v string)` - -SetSeoDescription sets SeoDescription field to given value. - -### HasSeoDescription - -`func (o *UpdateActorRequest) HasSeoDescription() bool` - -HasSeoDescription returns a boolean if a field has been set. - -### SetSeoDescriptionNil - -`func (o *UpdateActorRequest) SetSeoDescriptionNil(b bool)` - - SetSeoDescriptionNil sets the value for SeoDescription to be an explicit nil - -### UnsetSeoDescription -`func (o *UpdateActorRequest) UnsetSeoDescription()` - -UnsetSeoDescription ensures that no value is present for SeoDescription, not even an explicit nil -### GetTitle - -`func (o *UpdateActorRequest) GetTitle() string` - -GetTitle returns the Title field if non-nil, zero value otherwise. - -### GetTitleOk - -`func (o *UpdateActorRequest) GetTitleOk() (*string, bool)` - -GetTitleOk returns a tuple with the Title field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetTitle - -`func (o *UpdateActorRequest) SetTitle(v string)` - -SetTitle sets Title field to given value. - -### HasTitle - -`func (o *UpdateActorRequest) HasTitle() bool` - -HasTitle returns a boolean if a field has been set. - -### SetTitleNil - -`func (o *UpdateActorRequest) SetTitleNil(b bool)` - - SetTitleNil sets the value for Title to be an explicit nil - -### UnsetTitle -`func (o *UpdateActorRequest) UnsetTitle()` - -UnsetTitle ensures that no value is present for Title, not even an explicit nil -### GetRestartOnError - -`func (o *UpdateActorRequest) GetRestartOnError() bool` - -GetRestartOnError returns the RestartOnError field if non-nil, zero value otherwise. - -### GetRestartOnErrorOk - -`func (o *UpdateActorRequest) GetRestartOnErrorOk() (*bool, bool)` - -GetRestartOnErrorOk returns a tuple with the RestartOnError field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetRestartOnError - -`func (o *UpdateActorRequest) SetRestartOnError(v bool)` - -SetRestartOnError sets RestartOnError field to given value. - -### HasRestartOnError - -`func (o *UpdateActorRequest) HasRestartOnError() bool` - -HasRestartOnError returns a boolean if a field has been set. - -### GetVersions - -`func (o *UpdateActorRequest) GetVersions() []CreateOrUpdateVersionRequest` - -GetVersions returns the Versions field if non-nil, zero value otherwise. - -### GetVersionsOk - -`func (o *UpdateActorRequest) GetVersionsOk() (*[]CreateOrUpdateVersionRequest, bool)` - -GetVersionsOk returns a tuple with the Versions field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetVersions - -`func (o *UpdateActorRequest) SetVersions(v []CreateOrUpdateVersionRequest)` - -SetVersions sets Versions field to given value. - -### HasVersions - -`func (o *UpdateActorRequest) HasVersions() bool` - -HasVersions returns a boolean if a field has been set. - -### GetPricingInfos - -`func (o *UpdateActorRequest) GetPricingInfos() []ActorRunPricingInfo` - -GetPricingInfos returns the PricingInfos field if non-nil, zero value otherwise. - -### GetPricingInfosOk - -`func (o *UpdateActorRequest) GetPricingInfosOk() (*[]ActorRunPricingInfo, bool)` - -GetPricingInfosOk returns a tuple with the PricingInfos field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetPricingInfos - -`func (o *UpdateActorRequest) SetPricingInfos(v []ActorRunPricingInfo)` - -SetPricingInfos sets PricingInfos field to given value. - -### HasPricingInfos - -`func (o *UpdateActorRequest) HasPricingInfos() bool` - -HasPricingInfos returns a boolean if a field has been set. - -### GetCategories - -`func (o *UpdateActorRequest) GetCategories() []string` - -GetCategories returns the Categories field if non-nil, zero value otherwise. - -### GetCategoriesOk - -`func (o *UpdateActorRequest) GetCategoriesOk() (*[]string, bool)` - -GetCategoriesOk returns a tuple with the Categories field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetCategories - -`func (o *UpdateActorRequest) SetCategories(v []string)` - -SetCategories sets Categories field to given value. - -### HasCategories - -`func (o *UpdateActorRequest) HasCategories() bool` - -HasCategories returns a boolean if a field has been set. - -### SetCategoriesNil - -`func (o *UpdateActorRequest) SetCategoriesNil(b bool)` - - SetCategoriesNil sets the value for Categories to be an explicit nil - -### UnsetCategories -`func (o *UpdateActorRequest) UnsetCategories()` - -UnsetCategories ensures that no value is present for Categories, not even an explicit nil -### GetDefaultRunOptions - -`func (o *UpdateActorRequest) GetDefaultRunOptions() DefaultRunOptions` - -GetDefaultRunOptions returns the DefaultRunOptions field if non-nil, zero value otherwise. - -### GetDefaultRunOptionsOk - -`func (o *UpdateActorRequest) GetDefaultRunOptionsOk() (*DefaultRunOptions, bool)` - -GetDefaultRunOptionsOk returns a tuple with the DefaultRunOptions field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetDefaultRunOptions - -`func (o *UpdateActorRequest) SetDefaultRunOptions(v DefaultRunOptions)` - -SetDefaultRunOptions sets DefaultRunOptions field to given value. - -### HasDefaultRunOptions - -`func (o *UpdateActorRequest) HasDefaultRunOptions() bool` - -HasDefaultRunOptions returns a boolean if a field has been set. - -### SetDefaultRunOptionsNil - -`func (o *UpdateActorRequest) SetDefaultRunOptionsNil(b bool)` - - SetDefaultRunOptionsNil sets the value for DefaultRunOptions to be an explicit nil - -### UnsetDefaultRunOptions -`func (o *UpdateActorRequest) UnsetDefaultRunOptions()` - -UnsetDefaultRunOptions ensures that no value is present for DefaultRunOptions, not even an explicit nil -### GetTaggedBuilds - -`func (o *UpdateActorRequest) GetTaggedBuilds() map[string]BuildTag` - -GetTaggedBuilds returns the TaggedBuilds field if non-nil, zero value otherwise. - -### GetTaggedBuildsOk - -`func (o *UpdateActorRequest) GetTaggedBuildsOk() (*map[string]BuildTag, bool)` - -GetTaggedBuildsOk returns a tuple with the TaggedBuilds field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetTaggedBuilds - -`func (o *UpdateActorRequest) SetTaggedBuilds(v map[string]BuildTag)` - -SetTaggedBuilds sets TaggedBuilds field to given value. - -### HasTaggedBuilds - -`func (o *UpdateActorRequest) HasTaggedBuilds() bool` - -HasTaggedBuilds returns a boolean if a field has been set. - -### GetActorStandby - -`func (o *UpdateActorRequest) GetActorStandby() ActorStandby` - -GetActorStandby returns the ActorStandby field if non-nil, zero value otherwise. - -### GetActorStandbyOk - -`func (o *UpdateActorRequest) GetActorStandbyOk() (*ActorStandby, bool)` - -GetActorStandbyOk returns a tuple with the ActorStandby field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetActorStandby - -`func (o *UpdateActorRequest) SetActorStandby(v ActorStandby)` - -SetActorStandby sets ActorStandby field to given value. - -### HasActorStandby - -`func (o *UpdateActorRequest) HasActorStandby() bool` - -HasActorStandby returns a boolean if a field has been set. - -### SetActorStandbyNil - -`func (o *UpdateActorRequest) SetActorStandbyNil(b bool)` - - SetActorStandbyNil sets the value for ActorStandby to be an explicit nil - -### UnsetActorStandby -`func (o *UpdateActorRequest) UnsetActorStandby()` - -UnsetActorStandby ensures that no value is present for ActorStandby, not even an explicit nil -### GetExampleRunInput - -`func (o *UpdateActorRequest) GetExampleRunInput() ExampleRunInput` - -GetExampleRunInput returns the ExampleRunInput field if non-nil, zero value otherwise. - -### GetExampleRunInputOk - -`func (o *UpdateActorRequest) GetExampleRunInputOk() (*ExampleRunInput, bool)` - -GetExampleRunInputOk returns a tuple with the ExampleRunInput field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetExampleRunInput - -`func (o *UpdateActorRequest) SetExampleRunInput(v ExampleRunInput)` - -SetExampleRunInput sets ExampleRunInput field to given value. - -### HasExampleRunInput - -`func (o *UpdateActorRequest) HasExampleRunInput() bool` - -HasExampleRunInput returns a boolean if a field has been set. - -### SetExampleRunInputNil - -`func (o *UpdateActorRequest) SetExampleRunInputNil(b bool)` - - SetExampleRunInputNil sets the value for ExampleRunInput to be an explicit nil - -### UnsetExampleRunInput -`func (o *UpdateActorRequest) UnsetExampleRunInput()` - -UnsetExampleRunInput ensures that no value is present for ExampleRunInput, not even an explicit nil -### GetIsDeprecated - -`func (o *UpdateActorRequest) GetIsDeprecated() bool` - -GetIsDeprecated returns the IsDeprecated field if non-nil, zero value otherwise. - -### GetIsDeprecatedOk - -`func (o *UpdateActorRequest) GetIsDeprecatedOk() (*bool, bool)` - -GetIsDeprecatedOk returns a tuple with the IsDeprecated field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetIsDeprecated - -`func (o *UpdateActorRequest) SetIsDeprecated(v bool)` - -SetIsDeprecated sets IsDeprecated field to given value. - -### HasIsDeprecated - -`func (o *UpdateActorRequest) HasIsDeprecated() bool` - -HasIsDeprecated returns a boolean if a field has been set. - -### SetIsDeprecatedNil - -`func (o *UpdateActorRequest) SetIsDeprecatedNil(b bool)` - - SetIsDeprecatedNil sets the value for IsDeprecated to be an explicit nil - -### UnsetIsDeprecated -`func (o *UpdateActorRequest) UnsetIsDeprecated()` - -UnsetIsDeprecated ensures that no value is present for IsDeprecated, not even an explicit nil - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/UpdateDatasetRequest.md b/docs/UpdateDatasetRequest.md deleted file mode 100644 index 4f19cca..0000000 --- a/docs/UpdateDatasetRequest.md +++ /dev/null @@ -1,92 +0,0 @@ -# UpdateDatasetRequest - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Name** | Pointer to **NullableString** | | [optional] -**GeneralAccess** | Pointer to [**GeneralAccess**](GeneralAccess.md) | | [optional] - -## Methods - -### NewUpdateDatasetRequest - -`func NewUpdateDatasetRequest() *UpdateDatasetRequest` - -NewUpdateDatasetRequest instantiates a new UpdateDatasetRequest object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewUpdateDatasetRequestWithDefaults - -`func NewUpdateDatasetRequestWithDefaults() *UpdateDatasetRequest` - -NewUpdateDatasetRequestWithDefaults instantiates a new UpdateDatasetRequest object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetName - -`func (o *UpdateDatasetRequest) GetName() string` - -GetName returns the Name field if non-nil, zero value otherwise. - -### GetNameOk - -`func (o *UpdateDatasetRequest) GetNameOk() (*string, bool)` - -GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetName - -`func (o *UpdateDatasetRequest) SetName(v string)` - -SetName sets Name field to given value. - -### HasName - -`func (o *UpdateDatasetRequest) HasName() bool` - -HasName returns a boolean if a field has been set. - -### SetNameNil - -`func (o *UpdateDatasetRequest) SetNameNil(b bool)` - - SetNameNil sets the value for Name to be an explicit nil - -### UnsetName -`func (o *UpdateDatasetRequest) UnsetName()` - -UnsetName ensures that no value is present for Name, not even an explicit nil -### GetGeneralAccess - -`func (o *UpdateDatasetRequest) GetGeneralAccess() GeneralAccess` - -GetGeneralAccess returns the GeneralAccess field if non-nil, zero value otherwise. - -### GetGeneralAccessOk - -`func (o *UpdateDatasetRequest) GetGeneralAccessOk() (*GeneralAccess, bool)` - -GetGeneralAccessOk returns a tuple with the GeneralAccess field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetGeneralAccess - -`func (o *UpdateDatasetRequest) SetGeneralAccess(v GeneralAccess)` - -SetGeneralAccess sets GeneralAccess field to given value. - -### HasGeneralAccess - -`func (o *UpdateDatasetRequest) HasGeneralAccess() bool` - -HasGeneralAccess returns a boolean if a field has been set. - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/UpdateLimitsRequest.md b/docs/UpdateLimitsRequest.md deleted file mode 100644 index 7e4f72f..0000000 --- a/docs/UpdateLimitsRequest.md +++ /dev/null @@ -1,82 +0,0 @@ -# UpdateLimitsRequest - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**MaxMonthlyUsageUsd** | Pointer to **float32** | If your platform usage in the billing period exceeds the prepaid usage, you will be charged extra. Setting this property you can update your hard limit on monthly platform usage to prevent accidental overage or to limit the extra charges. | [optional] -**DataRetentionDays** | Pointer to **int32** | Apify securely stores your ten most recent Actor runs indefinitely, ensuring they are always accessible. Unnamed storages and other Actor runs are automatically deleted after the retention period. If you're subscribed, you can change it to keep data for longer or to limit your usage. [Lear more](https://docs.apify.com/platform/storage/usage#data-retention). | [optional] - -## Methods - -### NewUpdateLimitsRequest - -`func NewUpdateLimitsRequest() *UpdateLimitsRequest` - -NewUpdateLimitsRequest instantiates a new UpdateLimitsRequest object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewUpdateLimitsRequestWithDefaults - -`func NewUpdateLimitsRequestWithDefaults() *UpdateLimitsRequest` - -NewUpdateLimitsRequestWithDefaults instantiates a new UpdateLimitsRequest object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetMaxMonthlyUsageUsd - -`func (o *UpdateLimitsRequest) GetMaxMonthlyUsageUsd() float32` - -GetMaxMonthlyUsageUsd returns the MaxMonthlyUsageUsd field if non-nil, zero value otherwise. - -### GetMaxMonthlyUsageUsdOk - -`func (o *UpdateLimitsRequest) GetMaxMonthlyUsageUsdOk() (*float32, bool)` - -GetMaxMonthlyUsageUsdOk returns a tuple with the MaxMonthlyUsageUsd field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetMaxMonthlyUsageUsd - -`func (o *UpdateLimitsRequest) SetMaxMonthlyUsageUsd(v float32)` - -SetMaxMonthlyUsageUsd sets MaxMonthlyUsageUsd field to given value. - -### HasMaxMonthlyUsageUsd - -`func (o *UpdateLimitsRequest) HasMaxMonthlyUsageUsd() bool` - -HasMaxMonthlyUsageUsd returns a boolean if a field has been set. - -### GetDataRetentionDays - -`func (o *UpdateLimitsRequest) GetDataRetentionDays() int32` - -GetDataRetentionDays returns the DataRetentionDays field if non-nil, zero value otherwise. - -### GetDataRetentionDaysOk - -`func (o *UpdateLimitsRequest) GetDataRetentionDaysOk() (*int32, bool)` - -GetDataRetentionDaysOk returns a tuple with the DataRetentionDays field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetDataRetentionDays - -`func (o *UpdateLimitsRequest) SetDataRetentionDays(v int32)` - -SetDataRetentionDays sets DataRetentionDays field to given value. - -### HasDataRetentionDays - -`func (o *UpdateLimitsRequest) HasDataRetentionDays() bool` - -HasDataRetentionDays returns a boolean if a field has been set. - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/UpdateRequestQueueRequest.md b/docs/UpdateRequestQueueRequest.md deleted file mode 100644 index 7c1cbb5..0000000 --- a/docs/UpdateRequestQueueRequest.md +++ /dev/null @@ -1,92 +0,0 @@ -# UpdateRequestQueueRequest - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Name** | Pointer to **NullableString** | The new name for the request queue. | [optional] -**GeneralAccess** | Pointer to [**GeneralAccess**](GeneralAccess.md) | | [optional] - -## Methods - -### NewUpdateRequestQueueRequest - -`func NewUpdateRequestQueueRequest() *UpdateRequestQueueRequest` - -NewUpdateRequestQueueRequest instantiates a new UpdateRequestQueueRequest object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewUpdateRequestQueueRequestWithDefaults - -`func NewUpdateRequestQueueRequestWithDefaults() *UpdateRequestQueueRequest` - -NewUpdateRequestQueueRequestWithDefaults instantiates a new UpdateRequestQueueRequest object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetName - -`func (o *UpdateRequestQueueRequest) GetName() string` - -GetName returns the Name field if non-nil, zero value otherwise. - -### GetNameOk - -`func (o *UpdateRequestQueueRequest) GetNameOk() (*string, bool)` - -GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetName - -`func (o *UpdateRequestQueueRequest) SetName(v string)` - -SetName sets Name field to given value. - -### HasName - -`func (o *UpdateRequestQueueRequest) HasName() bool` - -HasName returns a boolean if a field has been set. - -### SetNameNil - -`func (o *UpdateRequestQueueRequest) SetNameNil(b bool)` - - SetNameNil sets the value for Name to be an explicit nil - -### UnsetName -`func (o *UpdateRequestQueueRequest) UnsetName()` - -UnsetName ensures that no value is present for Name, not even an explicit nil -### GetGeneralAccess - -`func (o *UpdateRequestQueueRequest) GetGeneralAccess() GeneralAccess` - -GetGeneralAccess returns the GeneralAccess field if non-nil, zero value otherwise. - -### GetGeneralAccessOk - -`func (o *UpdateRequestQueueRequest) GetGeneralAccessOk() (*GeneralAccess, bool)` - -GetGeneralAccessOk returns a tuple with the GeneralAccess field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetGeneralAccess - -`func (o *UpdateRequestQueueRequest) SetGeneralAccess(v GeneralAccess)` - -SetGeneralAccess sets GeneralAccess field to given value. - -### HasGeneralAccess - -`func (o *UpdateRequestQueueRequest) HasGeneralAccess() bool` - -HasGeneralAccess returns a boolean if a field has been set. - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/UpdateRequestResponse.md b/docs/UpdateRequestResponse.md deleted file mode 100644 index e0ccda5..0000000 --- a/docs/UpdateRequestResponse.md +++ /dev/null @@ -1,51 +0,0 @@ -# UpdateRequestResponse - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Data** | [**RequestRegistration**](RequestRegistration.md) | | - -## Methods - -### NewUpdateRequestResponse - -`func NewUpdateRequestResponse(data RequestRegistration, ) *UpdateRequestResponse` - -NewUpdateRequestResponse instantiates a new UpdateRequestResponse object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewUpdateRequestResponseWithDefaults - -`func NewUpdateRequestResponseWithDefaults() *UpdateRequestResponse` - -NewUpdateRequestResponseWithDefaults instantiates a new UpdateRequestResponse object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetData - -`func (o *UpdateRequestResponse) GetData() RequestRegistration` - -GetData returns the Data field if non-nil, zero value otherwise. - -### GetDataOk - -`func (o *UpdateRequestResponse) GetDataOk() (*RequestRegistration, bool)` - -GetDataOk returns a tuple with the Data field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetData - -`func (o *UpdateRequestResponse) SetData(v RequestRegistration)` - -SetData sets Data field to given value. - - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/UpdateRunRequest.md b/docs/UpdateRunRequest.md deleted file mode 100644 index 40b9960..0000000 --- a/docs/UpdateRunRequest.md +++ /dev/null @@ -1,134 +0,0 @@ -# UpdateRunRequest - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**RunId** | Pointer to **string** | | [optional] -**StatusMessage** | Pointer to **string** | | [optional] -**IsStatusMessageTerminal** | Pointer to **bool** | | [optional] -**GeneralAccess** | Pointer to [**GeneralAccess**](GeneralAccess.md) | | [optional] - -## Methods - -### NewUpdateRunRequest - -`func NewUpdateRunRequest() *UpdateRunRequest` - -NewUpdateRunRequest instantiates a new UpdateRunRequest object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewUpdateRunRequestWithDefaults - -`func NewUpdateRunRequestWithDefaults() *UpdateRunRequest` - -NewUpdateRunRequestWithDefaults instantiates a new UpdateRunRequest object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetRunId - -`func (o *UpdateRunRequest) GetRunId() string` - -GetRunId returns the RunId field if non-nil, zero value otherwise. - -### GetRunIdOk - -`func (o *UpdateRunRequest) GetRunIdOk() (*string, bool)` - -GetRunIdOk returns a tuple with the RunId field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetRunId - -`func (o *UpdateRunRequest) SetRunId(v string)` - -SetRunId sets RunId field to given value. - -### HasRunId - -`func (o *UpdateRunRequest) HasRunId() bool` - -HasRunId returns a boolean if a field has been set. - -### GetStatusMessage - -`func (o *UpdateRunRequest) GetStatusMessage() string` - -GetStatusMessage returns the StatusMessage field if non-nil, zero value otherwise. - -### GetStatusMessageOk - -`func (o *UpdateRunRequest) GetStatusMessageOk() (*string, bool)` - -GetStatusMessageOk returns a tuple with the StatusMessage field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetStatusMessage - -`func (o *UpdateRunRequest) SetStatusMessage(v string)` - -SetStatusMessage sets StatusMessage field to given value. - -### HasStatusMessage - -`func (o *UpdateRunRequest) HasStatusMessage() bool` - -HasStatusMessage returns a boolean if a field has been set. - -### GetIsStatusMessageTerminal - -`func (o *UpdateRunRequest) GetIsStatusMessageTerminal() bool` - -GetIsStatusMessageTerminal returns the IsStatusMessageTerminal field if non-nil, zero value otherwise. - -### GetIsStatusMessageTerminalOk - -`func (o *UpdateRunRequest) GetIsStatusMessageTerminalOk() (*bool, bool)` - -GetIsStatusMessageTerminalOk returns a tuple with the IsStatusMessageTerminal field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetIsStatusMessageTerminal - -`func (o *UpdateRunRequest) SetIsStatusMessageTerminal(v bool)` - -SetIsStatusMessageTerminal sets IsStatusMessageTerminal field to given value. - -### HasIsStatusMessageTerminal - -`func (o *UpdateRunRequest) HasIsStatusMessageTerminal() bool` - -HasIsStatusMessageTerminal returns a boolean if a field has been set. - -### GetGeneralAccess - -`func (o *UpdateRunRequest) GetGeneralAccess() GeneralAccess` - -GetGeneralAccess returns the GeneralAccess field if non-nil, zero value otherwise. - -### GetGeneralAccessOk - -`func (o *UpdateRunRequest) GetGeneralAccessOk() (*GeneralAccess, bool)` - -GetGeneralAccessOk returns a tuple with the GeneralAccess field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetGeneralAccess - -`func (o *UpdateRunRequest) SetGeneralAccess(v GeneralAccess)` - -SetGeneralAccess sets GeneralAccess field to given value. - -### HasGeneralAccess - -`func (o *UpdateRunRequest) HasGeneralAccess() bool` - -HasGeneralAccess returns a boolean if a field has been set. - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/UpdateStoreRequest.md b/docs/UpdateStoreRequest.md deleted file mode 100644 index 16650b0..0000000 --- a/docs/UpdateStoreRequest.md +++ /dev/null @@ -1,92 +0,0 @@ -# UpdateStoreRequest - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Name** | Pointer to **NullableString** | | [optional] -**GeneralAccess** | Pointer to [**GeneralAccess**](GeneralAccess.md) | | [optional] - -## Methods - -### NewUpdateStoreRequest - -`func NewUpdateStoreRequest() *UpdateStoreRequest` - -NewUpdateStoreRequest instantiates a new UpdateStoreRequest object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewUpdateStoreRequestWithDefaults - -`func NewUpdateStoreRequestWithDefaults() *UpdateStoreRequest` - -NewUpdateStoreRequestWithDefaults instantiates a new UpdateStoreRequest object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetName - -`func (o *UpdateStoreRequest) GetName() string` - -GetName returns the Name field if non-nil, zero value otherwise. - -### GetNameOk - -`func (o *UpdateStoreRequest) GetNameOk() (*string, bool)` - -GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetName - -`func (o *UpdateStoreRequest) SetName(v string)` - -SetName sets Name field to given value. - -### HasName - -`func (o *UpdateStoreRequest) HasName() bool` - -HasName returns a boolean if a field has been set. - -### SetNameNil - -`func (o *UpdateStoreRequest) SetNameNil(b bool)` - - SetNameNil sets the value for Name to be an explicit nil - -### UnsetName -`func (o *UpdateStoreRequest) UnsetName()` - -UnsetName ensures that no value is present for Name, not even an explicit nil -### GetGeneralAccess - -`func (o *UpdateStoreRequest) GetGeneralAccess() GeneralAccess` - -GetGeneralAccess returns the GeneralAccess field if non-nil, zero value otherwise. - -### GetGeneralAccessOk - -`func (o *UpdateStoreRequest) GetGeneralAccessOk() (*GeneralAccess, bool)` - -GetGeneralAccessOk returns a tuple with the GeneralAccess field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetGeneralAccess - -`func (o *UpdateStoreRequest) SetGeneralAccess(v GeneralAccess)` - -SetGeneralAccess sets GeneralAccess field to given value. - -### HasGeneralAccess - -`func (o *UpdateStoreRequest) HasGeneralAccess() bool` - -HasGeneralAccess returns a boolean if a field has been set. - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/UpdateTaskRequest.md b/docs/UpdateTaskRequest.md deleted file mode 100644 index 26b8f50..0000000 --- a/docs/UpdateTaskRequest.md +++ /dev/null @@ -1,200 +0,0 @@ -# UpdateTaskRequest - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Name** | Pointer to **string** | | [optional] -**Options** | Pointer to [**NullableTaskOptions**](TaskOptions.md) | | [optional] -**Input** | Pointer to **map[string]interface{}** | The input configuration for the Actor task. This is a user-defined JSON object that will be passed to the Actor when the task is run. | [optional] -**Title** | Pointer to **NullableString** | | [optional] -**ActorStandby** | Pointer to [**NullableActorStandby**](ActorStandby.md) | | [optional] - -## Methods - -### NewUpdateTaskRequest - -`func NewUpdateTaskRequest() *UpdateTaskRequest` - -NewUpdateTaskRequest instantiates a new UpdateTaskRequest object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewUpdateTaskRequestWithDefaults - -`func NewUpdateTaskRequestWithDefaults() *UpdateTaskRequest` - -NewUpdateTaskRequestWithDefaults instantiates a new UpdateTaskRequest object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetName - -`func (o *UpdateTaskRequest) GetName() string` - -GetName returns the Name field if non-nil, zero value otherwise. - -### GetNameOk - -`func (o *UpdateTaskRequest) GetNameOk() (*string, bool)` - -GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetName - -`func (o *UpdateTaskRequest) SetName(v string)` - -SetName sets Name field to given value. - -### HasName - -`func (o *UpdateTaskRequest) HasName() bool` - -HasName returns a boolean if a field has been set. - -### GetOptions - -`func (o *UpdateTaskRequest) GetOptions() TaskOptions` - -GetOptions returns the Options field if non-nil, zero value otherwise. - -### GetOptionsOk - -`func (o *UpdateTaskRequest) GetOptionsOk() (*TaskOptions, bool)` - -GetOptionsOk returns a tuple with the Options field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetOptions - -`func (o *UpdateTaskRequest) SetOptions(v TaskOptions)` - -SetOptions sets Options field to given value. - -### HasOptions - -`func (o *UpdateTaskRequest) HasOptions() bool` - -HasOptions returns a boolean if a field has been set. - -### SetOptionsNil - -`func (o *UpdateTaskRequest) SetOptionsNil(b bool)` - - SetOptionsNil sets the value for Options to be an explicit nil - -### UnsetOptions -`func (o *UpdateTaskRequest) UnsetOptions()` - -UnsetOptions ensures that no value is present for Options, not even an explicit nil -### GetInput - -`func (o *UpdateTaskRequest) GetInput() map[string]interface{}` - -GetInput returns the Input field if non-nil, zero value otherwise. - -### GetInputOk - -`func (o *UpdateTaskRequest) GetInputOk() (*map[string]interface{}, bool)` - -GetInputOk returns a tuple with the Input field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetInput - -`func (o *UpdateTaskRequest) SetInput(v map[string]interface{})` - -SetInput sets Input field to given value. - -### HasInput - -`func (o *UpdateTaskRequest) HasInput() bool` - -HasInput returns a boolean if a field has been set. - -### SetInputNil - -`func (o *UpdateTaskRequest) SetInputNil(b bool)` - - SetInputNil sets the value for Input to be an explicit nil - -### UnsetInput -`func (o *UpdateTaskRequest) UnsetInput()` - -UnsetInput ensures that no value is present for Input, not even an explicit nil -### GetTitle - -`func (o *UpdateTaskRequest) GetTitle() string` - -GetTitle returns the Title field if non-nil, zero value otherwise. - -### GetTitleOk - -`func (o *UpdateTaskRequest) GetTitleOk() (*string, bool)` - -GetTitleOk returns a tuple with the Title field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetTitle - -`func (o *UpdateTaskRequest) SetTitle(v string)` - -SetTitle sets Title field to given value. - -### HasTitle - -`func (o *UpdateTaskRequest) HasTitle() bool` - -HasTitle returns a boolean if a field has been set. - -### SetTitleNil - -`func (o *UpdateTaskRequest) SetTitleNil(b bool)` - - SetTitleNil sets the value for Title to be an explicit nil - -### UnsetTitle -`func (o *UpdateTaskRequest) UnsetTitle()` - -UnsetTitle ensures that no value is present for Title, not even an explicit nil -### GetActorStandby - -`func (o *UpdateTaskRequest) GetActorStandby() ActorStandby` - -GetActorStandby returns the ActorStandby field if non-nil, zero value otherwise. - -### GetActorStandbyOk - -`func (o *UpdateTaskRequest) GetActorStandbyOk() (*ActorStandby, bool)` - -GetActorStandbyOk returns a tuple with the ActorStandby field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetActorStandby - -`func (o *UpdateTaskRequest) SetActorStandby(v ActorStandby)` - -SetActorStandby sets ActorStandby field to given value. - -### HasActorStandby - -`func (o *UpdateTaskRequest) HasActorStandby() bool` - -HasActorStandby returns a boolean if a field has been set. - -### SetActorStandbyNil - -`func (o *UpdateTaskRequest) SetActorStandbyNil(b bool)` - - SetActorStandbyNil sets the value for ActorStandby to be an explicit nil - -### UnsetActorStandby -`func (o *UpdateTaskRequest) UnsetActorStandby()` - -UnsetActorStandby ensures that no value is present for ActorStandby, not even an explicit nil - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/UsageCycle.md b/docs/UsageCycle.md deleted file mode 100644 index 99200c1..0000000 --- a/docs/UsageCycle.md +++ /dev/null @@ -1,72 +0,0 @@ -# UsageCycle - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**StartAt** | **time.Time** | | -**EndAt** | **time.Time** | | - -## Methods - -### NewUsageCycle - -`func NewUsageCycle(startAt time.Time, endAt time.Time, ) *UsageCycle` - -NewUsageCycle instantiates a new UsageCycle object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewUsageCycleWithDefaults - -`func NewUsageCycleWithDefaults() *UsageCycle` - -NewUsageCycleWithDefaults instantiates a new UsageCycle object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetStartAt - -`func (o *UsageCycle) GetStartAt() time.Time` - -GetStartAt returns the StartAt field if non-nil, zero value otherwise. - -### GetStartAtOk - -`func (o *UsageCycle) GetStartAtOk() (*time.Time, bool)` - -GetStartAtOk returns a tuple with the StartAt field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetStartAt - -`func (o *UsageCycle) SetStartAt(v time.Time)` - -SetStartAt sets StartAt field to given value. - - -### GetEndAt - -`func (o *UsageCycle) GetEndAt() time.Time` - -GetEndAt returns the EndAt field if non-nil, zero value otherwise. - -### GetEndAtOk - -`func (o *UsageCycle) GetEndAtOk() (*time.Time, bool)` - -GetEndAtOk returns a tuple with the EndAt field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetEndAt - -`func (o *UsageCycle) SetEndAt(v time.Time)` - -SetEndAt sets EndAt field to given value. - - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/UsageItem.md b/docs/UsageItem.md deleted file mode 100644 index a567c12..0000000 --- a/docs/UsageItem.md +++ /dev/null @@ -1,150 +0,0 @@ -# UsageItem - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Quantity** | **float32** | | -**BaseAmountUsd** | **float32** | | -**BaseUnitPriceUsd** | Pointer to **float32** | | [optional] -**AmountAfterVolumeDiscountUsd** | Pointer to **float32** | | [optional] -**PriceTiers** | Pointer to [**[]PriceTiers**](PriceTiers.md) | | [optional] - -## Methods - -### NewUsageItem - -`func NewUsageItem(quantity float32, baseAmountUsd float32, ) *UsageItem` - -NewUsageItem instantiates a new UsageItem object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewUsageItemWithDefaults - -`func NewUsageItemWithDefaults() *UsageItem` - -NewUsageItemWithDefaults instantiates a new UsageItem object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetQuantity - -`func (o *UsageItem) GetQuantity() float32` - -GetQuantity returns the Quantity field if non-nil, zero value otherwise. - -### GetQuantityOk - -`func (o *UsageItem) GetQuantityOk() (*float32, bool)` - -GetQuantityOk returns a tuple with the Quantity field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetQuantity - -`func (o *UsageItem) SetQuantity(v float32)` - -SetQuantity sets Quantity field to given value. - - -### GetBaseAmountUsd - -`func (o *UsageItem) GetBaseAmountUsd() float32` - -GetBaseAmountUsd returns the BaseAmountUsd field if non-nil, zero value otherwise. - -### GetBaseAmountUsdOk - -`func (o *UsageItem) GetBaseAmountUsdOk() (*float32, bool)` - -GetBaseAmountUsdOk returns a tuple with the BaseAmountUsd field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetBaseAmountUsd - -`func (o *UsageItem) SetBaseAmountUsd(v float32)` - -SetBaseAmountUsd sets BaseAmountUsd field to given value. - - -### GetBaseUnitPriceUsd - -`func (o *UsageItem) GetBaseUnitPriceUsd() float32` - -GetBaseUnitPriceUsd returns the BaseUnitPriceUsd field if non-nil, zero value otherwise. - -### GetBaseUnitPriceUsdOk - -`func (o *UsageItem) GetBaseUnitPriceUsdOk() (*float32, bool)` - -GetBaseUnitPriceUsdOk returns a tuple with the BaseUnitPriceUsd field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetBaseUnitPriceUsd - -`func (o *UsageItem) SetBaseUnitPriceUsd(v float32)` - -SetBaseUnitPriceUsd sets BaseUnitPriceUsd field to given value. - -### HasBaseUnitPriceUsd - -`func (o *UsageItem) HasBaseUnitPriceUsd() bool` - -HasBaseUnitPriceUsd returns a boolean if a field has been set. - -### GetAmountAfterVolumeDiscountUsd - -`func (o *UsageItem) GetAmountAfterVolumeDiscountUsd() float32` - -GetAmountAfterVolumeDiscountUsd returns the AmountAfterVolumeDiscountUsd field if non-nil, zero value otherwise. - -### GetAmountAfterVolumeDiscountUsdOk - -`func (o *UsageItem) GetAmountAfterVolumeDiscountUsdOk() (*float32, bool)` - -GetAmountAfterVolumeDiscountUsdOk returns a tuple with the AmountAfterVolumeDiscountUsd field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetAmountAfterVolumeDiscountUsd - -`func (o *UsageItem) SetAmountAfterVolumeDiscountUsd(v float32)` - -SetAmountAfterVolumeDiscountUsd sets AmountAfterVolumeDiscountUsd field to given value. - -### HasAmountAfterVolumeDiscountUsd - -`func (o *UsageItem) HasAmountAfterVolumeDiscountUsd() bool` - -HasAmountAfterVolumeDiscountUsd returns a boolean if a field has been set. - -### GetPriceTiers - -`func (o *UsageItem) GetPriceTiers() []PriceTiers` - -GetPriceTiers returns the PriceTiers field if non-nil, zero value otherwise. - -### GetPriceTiersOk - -`func (o *UsageItem) GetPriceTiersOk() (*[]PriceTiers, bool)` - -GetPriceTiersOk returns a tuple with the PriceTiers field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetPriceTiers - -`func (o *UsageItem) SetPriceTiers(v []PriceTiers)` - -SetPriceTiers sets PriceTiers field to given value. - -### HasPriceTiers - -`func (o *UsageItem) HasPriceTiers() bool` - -HasPriceTiers returns a boolean if a field has been set. - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/UserPrivateInfo.md b/docs/UserPrivateInfo.md deleted file mode 100644 index 179f6df..0000000 --- a/docs/UserPrivateInfo.md +++ /dev/null @@ -1,219 +0,0 @@ -# UserPrivateInfo - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Id** | **string** | | -**Username** | **string** | | -**Profile** | [**Profile**](Profile.md) | | -**Email** | **string** | | -**Proxy** | [**Proxy**](Proxy.md) | | -**Plan** | [**Plan**](Plan.md) | | -**EffectivePlatformFeatures** | [**EffectivePlatformFeatures**](EffectivePlatformFeatures.md) | | -**CreatedAt** | **time.Time** | | -**IsPaying** | **bool** | | - -## Methods - -### NewUserPrivateInfo - -`func NewUserPrivateInfo(id string, username string, profile Profile, email string, proxy Proxy, plan Plan, effectivePlatformFeatures EffectivePlatformFeatures, createdAt time.Time, isPaying bool, ) *UserPrivateInfo` - -NewUserPrivateInfo instantiates a new UserPrivateInfo object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewUserPrivateInfoWithDefaults - -`func NewUserPrivateInfoWithDefaults() *UserPrivateInfo` - -NewUserPrivateInfoWithDefaults instantiates a new UserPrivateInfo object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetId - -`func (o *UserPrivateInfo) GetId() string` - -GetId returns the Id field if non-nil, zero value otherwise. - -### GetIdOk - -`func (o *UserPrivateInfo) GetIdOk() (*string, bool)` - -GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetId - -`func (o *UserPrivateInfo) SetId(v string)` - -SetId sets Id field to given value. - - -### GetUsername - -`func (o *UserPrivateInfo) GetUsername() string` - -GetUsername returns the Username field if non-nil, zero value otherwise. - -### GetUsernameOk - -`func (o *UserPrivateInfo) GetUsernameOk() (*string, bool)` - -GetUsernameOk returns a tuple with the Username field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetUsername - -`func (o *UserPrivateInfo) SetUsername(v string)` - -SetUsername sets Username field to given value. - - -### GetProfile - -`func (o *UserPrivateInfo) GetProfile() Profile` - -GetProfile returns the Profile field if non-nil, zero value otherwise. - -### GetProfileOk - -`func (o *UserPrivateInfo) GetProfileOk() (*Profile, bool)` - -GetProfileOk returns a tuple with the Profile field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetProfile - -`func (o *UserPrivateInfo) SetProfile(v Profile)` - -SetProfile sets Profile field to given value. - - -### GetEmail - -`func (o *UserPrivateInfo) GetEmail() string` - -GetEmail returns the Email field if non-nil, zero value otherwise. - -### GetEmailOk - -`func (o *UserPrivateInfo) GetEmailOk() (*string, bool)` - -GetEmailOk returns a tuple with the Email field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetEmail - -`func (o *UserPrivateInfo) SetEmail(v string)` - -SetEmail sets Email field to given value. - - -### GetProxy - -`func (o *UserPrivateInfo) GetProxy() Proxy` - -GetProxy returns the Proxy field if non-nil, zero value otherwise. - -### GetProxyOk - -`func (o *UserPrivateInfo) GetProxyOk() (*Proxy, bool)` - -GetProxyOk returns a tuple with the Proxy field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetProxy - -`func (o *UserPrivateInfo) SetProxy(v Proxy)` - -SetProxy sets Proxy field to given value. - - -### GetPlan - -`func (o *UserPrivateInfo) GetPlan() Plan` - -GetPlan returns the Plan field if non-nil, zero value otherwise. - -### GetPlanOk - -`func (o *UserPrivateInfo) GetPlanOk() (*Plan, bool)` - -GetPlanOk returns a tuple with the Plan field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetPlan - -`func (o *UserPrivateInfo) SetPlan(v Plan)` - -SetPlan sets Plan field to given value. - - -### GetEffectivePlatformFeatures - -`func (o *UserPrivateInfo) GetEffectivePlatformFeatures() EffectivePlatformFeatures` - -GetEffectivePlatformFeatures returns the EffectivePlatformFeatures field if non-nil, zero value otherwise. - -### GetEffectivePlatformFeaturesOk - -`func (o *UserPrivateInfo) GetEffectivePlatformFeaturesOk() (*EffectivePlatformFeatures, bool)` - -GetEffectivePlatformFeaturesOk returns a tuple with the EffectivePlatformFeatures field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetEffectivePlatformFeatures - -`func (o *UserPrivateInfo) SetEffectivePlatformFeatures(v EffectivePlatformFeatures)` - -SetEffectivePlatformFeatures sets EffectivePlatformFeatures field to given value. - - -### GetCreatedAt - -`func (o *UserPrivateInfo) GetCreatedAt() time.Time` - -GetCreatedAt returns the CreatedAt field if non-nil, zero value otherwise. - -### GetCreatedAtOk - -`func (o *UserPrivateInfo) GetCreatedAtOk() (*time.Time, bool)` - -GetCreatedAtOk returns a tuple with the CreatedAt field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetCreatedAt - -`func (o *UserPrivateInfo) SetCreatedAt(v time.Time)` - -SetCreatedAt sets CreatedAt field to given value. - - -### GetIsPaying - -`func (o *UserPrivateInfo) GetIsPaying() bool` - -GetIsPaying returns the IsPaying field if non-nil, zero value otherwise. - -### GetIsPayingOk - -`func (o *UserPrivateInfo) GetIsPayingOk() (*bool, bool)` - -GetIsPayingOk returns a tuple with the IsPaying field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetIsPaying - -`func (o *UserPrivateInfo) SetIsPaying(v bool)` - -SetIsPaying sets IsPaying field to given value. - - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/UserPublicInfo.md b/docs/UserPublicInfo.md deleted file mode 100644 index a98f27c..0000000 --- a/docs/UserPublicInfo.md +++ /dev/null @@ -1,77 +0,0 @@ -# UserPublicInfo - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Username** | **string** | | -**Profile** | Pointer to [**Profile**](Profile.md) | | [optional] - -## Methods - -### NewUserPublicInfo - -`func NewUserPublicInfo(username string, ) *UserPublicInfo` - -NewUserPublicInfo instantiates a new UserPublicInfo object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewUserPublicInfoWithDefaults - -`func NewUserPublicInfoWithDefaults() *UserPublicInfo` - -NewUserPublicInfoWithDefaults instantiates a new UserPublicInfo object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetUsername - -`func (o *UserPublicInfo) GetUsername() string` - -GetUsername returns the Username field if non-nil, zero value otherwise. - -### GetUsernameOk - -`func (o *UserPublicInfo) GetUsernameOk() (*string, bool)` - -GetUsernameOk returns a tuple with the Username field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetUsername - -`func (o *UserPublicInfo) SetUsername(v string)` - -SetUsername sets Username field to given value. - - -### GetProfile - -`func (o *UserPublicInfo) GetProfile() Profile` - -GetProfile returns the Profile field if non-nil, zero value otherwise. - -### GetProfileOk - -`func (o *UserPublicInfo) GetProfileOk() (*Profile, bool)` - -GetProfileOk returns a tuple with the Profile field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetProfile - -`func (o *UserPublicInfo) SetProfile(v Profile)` - -SetProfile sets Profile field to given value. - -### HasProfile - -`func (o *UserPublicInfo) HasProfile() bool` - -HasProfile returns a boolean if a field has been set. - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/UsersAPI.md b/docs/UsersAPI.md deleted file mode 100644 index 80dc11a..0000000 --- a/docs/UsersAPI.md +++ /dev/null @@ -1,337 +0,0 @@ -# \UsersAPI - -All URIs are relative to *https://api.apify.com* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**UserGet**](UsersAPI.md#UserGet) | **Get** /v2/users/{userId} | Get public user data -[**UsersMeGet**](UsersAPI.md#UsersMeGet) | **Get** /v2/users/me | Get private user data -[**UsersMeLimitsGet**](UsersAPI.md#UsersMeLimitsGet) | **Get** /v2/users/me/limits | Get limits -[**UsersMeLimitsPut**](UsersAPI.md#UsersMeLimitsPut) | **Put** /v2/users/me/limits | Update limits -[**UsersMeUsageMonthlyGet**](UsersAPI.md#UsersMeUsageMonthlyGet) | **Get** /v2/users/me/usage/monthly | Get monthly usage - - - -## UserGet - -> PublicUserDataResponse UserGet(ctx, userId).Execute() - -Get public user data - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - userId := "HGzIk8z78YcAPEB" // string | User ID or username. - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.UsersAPI.UserGet(context.Background(), userId).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `UsersAPI.UserGet``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `UserGet`: PublicUserDataResponse - fmt.Fprintf(os.Stdout, "Response from `UsersAPI.UserGet`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**userId** | **string** | User ID or username. | - -### Other Parameters - -Other parameters are passed through a pointer to a apiUserGetRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - -### Return type - -[**PublicUserDataResponse**](PublicUserDataResponse.md) - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## UsersMeGet - -> PrivateUserDataResponse UsersMeGet(ctx).Execute() - -Get private user data - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.UsersAPI.UsersMeGet(context.Background()).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `UsersAPI.UsersMeGet``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `UsersMeGet`: PrivateUserDataResponse - fmt.Fprintf(os.Stdout, "Response from `UsersAPI.UsersMeGet`: %v\n", resp) -} -``` - -### Path Parameters - -This endpoint does not need any parameter. - -### Other Parameters - -Other parameters are passed through a pointer to a apiUsersMeGetRequest struct via the builder pattern - - -### Return type - -[**PrivateUserDataResponse**](PrivateUserDataResponse.md) - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## UsersMeLimitsGet - -> LimitsResponse UsersMeLimitsGet(ctx).Execute() - -Get limits - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.UsersAPI.UsersMeLimitsGet(context.Background()).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `UsersAPI.UsersMeLimitsGet``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `UsersMeLimitsGet`: LimitsResponse - fmt.Fprintf(os.Stdout, "Response from `UsersAPI.UsersMeLimitsGet`: %v\n", resp) -} -``` - -### Path Parameters - -This endpoint does not need any parameter. - -### Other Parameters - -Other parameters are passed through a pointer to a apiUsersMeLimitsGetRequest struct via the builder pattern - - -### Return type - -[**LimitsResponse**](LimitsResponse.md) - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## UsersMeLimitsPut - -> map[string]interface{} UsersMeLimitsPut(ctx).UpdateLimitsRequest(updateLimitsRequest).Execute() - -Update limits - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - updateLimitsRequest := *openapiclient.NewUpdateLimitsRequest() // UpdateLimitsRequest | (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.UsersAPI.UsersMeLimitsPut(context.Background()).UpdateLimitsRequest(updateLimitsRequest).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `UsersAPI.UsersMeLimitsPut``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `UsersMeLimitsPut`: map[string]interface{} - fmt.Fprintf(os.Stdout, "Response from `UsersAPI.UsersMeLimitsPut`: %v\n", resp) -} -``` - -### Path Parameters - - - -### Other Parameters - -Other parameters are passed through a pointer to a apiUsersMeLimitsPutRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **updateLimitsRequest** | [**UpdateLimitsRequest**](UpdateLimitsRequest.md) | | - -### Return type - -**map[string]interface{}** - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## UsersMeUsageMonthlyGet - -> MonthlyUsageResponse UsersMeUsageMonthlyGet(ctx).Date(date).Execute() - -Get monthly usage - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - date := "2020-06-14" // string | Date in the YYYY-MM-DD format. (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.UsersAPI.UsersMeUsageMonthlyGet(context.Background()).Date(date).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `UsersAPI.UsersMeUsageMonthlyGet``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `UsersMeUsageMonthlyGet`: MonthlyUsageResponse - fmt.Fprintf(os.Stdout, "Response from `UsersAPI.UsersMeUsageMonthlyGet`: %v\n", resp) -} -``` - -### Path Parameters - - - -### Other Parameters - -Other parameters are passed through a pointer to a apiUsersMeUsageMonthlyGetRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **date** | **string** | Date in the YYYY-MM-DD format. | - -### Return type - -[**MonthlyUsageResponse**](MonthlyUsageResponse.md) - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - diff --git a/docs/ValidationError.md b/docs/ValidationError.md deleted file mode 100644 index 064378d..0000000 --- a/docs/ValidationError.md +++ /dev/null @@ -1,160 +0,0 @@ -# ValidationError - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**InstancePath** | Pointer to **string** | The path to the instance being validated. | [optional] -**SchemaPath** | Pointer to **string** | The path to the schema that failed the validation. | [optional] -**Keyword** | Pointer to **string** | The validation keyword that caused the error. | [optional] -**Message** | Pointer to **string** | A message describing the validation error. | [optional] -**Params** | Pointer to **map[string]interface{}** | Additional parameters specific to the validation error. | [optional] - -## Methods - -### NewValidationError - -`func NewValidationError() *ValidationError` - -NewValidationError instantiates a new ValidationError object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewValidationErrorWithDefaults - -`func NewValidationErrorWithDefaults() *ValidationError` - -NewValidationErrorWithDefaults instantiates a new ValidationError object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetInstancePath - -`func (o *ValidationError) GetInstancePath() string` - -GetInstancePath returns the InstancePath field if non-nil, zero value otherwise. - -### GetInstancePathOk - -`func (o *ValidationError) GetInstancePathOk() (*string, bool)` - -GetInstancePathOk returns a tuple with the InstancePath field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetInstancePath - -`func (o *ValidationError) SetInstancePath(v string)` - -SetInstancePath sets InstancePath field to given value. - -### HasInstancePath - -`func (o *ValidationError) HasInstancePath() bool` - -HasInstancePath returns a boolean if a field has been set. - -### GetSchemaPath - -`func (o *ValidationError) GetSchemaPath() string` - -GetSchemaPath returns the SchemaPath field if non-nil, zero value otherwise. - -### GetSchemaPathOk - -`func (o *ValidationError) GetSchemaPathOk() (*string, bool)` - -GetSchemaPathOk returns a tuple with the SchemaPath field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetSchemaPath - -`func (o *ValidationError) SetSchemaPath(v string)` - -SetSchemaPath sets SchemaPath field to given value. - -### HasSchemaPath - -`func (o *ValidationError) HasSchemaPath() bool` - -HasSchemaPath returns a boolean if a field has been set. - -### GetKeyword - -`func (o *ValidationError) GetKeyword() string` - -GetKeyword returns the Keyword field if non-nil, zero value otherwise. - -### GetKeywordOk - -`func (o *ValidationError) GetKeywordOk() (*string, bool)` - -GetKeywordOk returns a tuple with the Keyword field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetKeyword - -`func (o *ValidationError) SetKeyword(v string)` - -SetKeyword sets Keyword field to given value. - -### HasKeyword - -`func (o *ValidationError) HasKeyword() bool` - -HasKeyword returns a boolean if a field has been set. - -### GetMessage - -`func (o *ValidationError) GetMessage() string` - -GetMessage returns the Message field if non-nil, zero value otherwise. - -### GetMessageOk - -`func (o *ValidationError) GetMessageOk() (*string, bool)` - -GetMessageOk returns a tuple with the Message field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetMessage - -`func (o *ValidationError) SetMessage(v string)` - -SetMessage sets Message field to given value. - -### HasMessage - -`func (o *ValidationError) HasMessage() bool` - -HasMessage returns a boolean if a field has been set. - -### GetParams - -`func (o *ValidationError) GetParams() map[string]interface{}` - -GetParams returns the Params field if non-nil, zero value otherwise. - -### GetParamsOk - -`func (o *ValidationError) GetParamsOk() (*map[string]interface{}, bool)` - -GetParamsOk returns a tuple with the Params field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetParams - -`func (o *ValidationError) SetParams(v map[string]interface{})` - -SetParams sets Params field to given value. - -### HasParams - -`func (o *ValidationError) HasParams() bool` - -HasParams returns a boolean if a field has been set. - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/Version.md b/docs/Version.md deleted file mode 100644 index 08e65e3..0000000 --- a/docs/Version.md +++ /dev/null @@ -1,314 +0,0 @@ -# Version - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**VersionNumber** | **string** | | -**SourceType** | [**NullableVersionSourceType**](VersionSourceType.md) | | -**EnvVars** | Pointer to [**[]EnvVar**](EnvVar.md) | | [optional] -**ApplyEnvVarsToBuild** | Pointer to **NullableBool** | | [optional] -**BuildTag** | Pointer to **string** | | [optional] -**SourceFiles** | Pointer to [**[]VersionSourceFilesInner**](VersionSourceFilesInner.md) | | [optional] -**GitRepoUrl** | Pointer to **NullableString** | URL of the Git repository when sourceType is GIT_REPO. | [optional] -**TarballUrl** | Pointer to **NullableString** | URL of the tarball when sourceType is TARBALL. | [optional] -**GitHubGistUrl** | Pointer to **NullableString** | URL of the GitHub Gist when sourceType is GITHUB_GIST. | [optional] - -## Methods - -### NewVersion - -`func NewVersion(versionNumber string, sourceType NullableVersionSourceType, ) *Version` - -NewVersion instantiates a new Version object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewVersionWithDefaults - -`func NewVersionWithDefaults() *Version` - -NewVersionWithDefaults instantiates a new Version object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetVersionNumber - -`func (o *Version) GetVersionNumber() string` - -GetVersionNumber returns the VersionNumber field if non-nil, zero value otherwise. - -### GetVersionNumberOk - -`func (o *Version) GetVersionNumberOk() (*string, bool)` - -GetVersionNumberOk returns a tuple with the VersionNumber field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetVersionNumber - -`func (o *Version) SetVersionNumber(v string)` - -SetVersionNumber sets VersionNumber field to given value. - - -### GetSourceType - -`func (o *Version) GetSourceType() VersionSourceType` - -GetSourceType returns the SourceType field if non-nil, zero value otherwise. - -### GetSourceTypeOk - -`func (o *Version) GetSourceTypeOk() (*VersionSourceType, bool)` - -GetSourceTypeOk returns a tuple with the SourceType field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetSourceType - -`func (o *Version) SetSourceType(v VersionSourceType)` - -SetSourceType sets SourceType field to given value. - - -### SetSourceTypeNil - -`func (o *Version) SetSourceTypeNil(b bool)` - - SetSourceTypeNil sets the value for SourceType to be an explicit nil - -### UnsetSourceType -`func (o *Version) UnsetSourceType()` - -UnsetSourceType ensures that no value is present for SourceType, not even an explicit nil -### GetEnvVars - -`func (o *Version) GetEnvVars() []EnvVar` - -GetEnvVars returns the EnvVars field if non-nil, zero value otherwise. - -### GetEnvVarsOk - -`func (o *Version) GetEnvVarsOk() (*[]EnvVar, bool)` - -GetEnvVarsOk returns a tuple with the EnvVars field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetEnvVars - -`func (o *Version) SetEnvVars(v []EnvVar)` - -SetEnvVars sets EnvVars field to given value. - -### HasEnvVars - -`func (o *Version) HasEnvVars() bool` - -HasEnvVars returns a boolean if a field has been set. - -### SetEnvVarsNil - -`func (o *Version) SetEnvVarsNil(b bool)` - - SetEnvVarsNil sets the value for EnvVars to be an explicit nil - -### UnsetEnvVars -`func (o *Version) UnsetEnvVars()` - -UnsetEnvVars ensures that no value is present for EnvVars, not even an explicit nil -### GetApplyEnvVarsToBuild - -`func (o *Version) GetApplyEnvVarsToBuild() bool` - -GetApplyEnvVarsToBuild returns the ApplyEnvVarsToBuild field if non-nil, zero value otherwise. - -### GetApplyEnvVarsToBuildOk - -`func (o *Version) GetApplyEnvVarsToBuildOk() (*bool, bool)` - -GetApplyEnvVarsToBuildOk returns a tuple with the ApplyEnvVarsToBuild field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetApplyEnvVarsToBuild - -`func (o *Version) SetApplyEnvVarsToBuild(v bool)` - -SetApplyEnvVarsToBuild sets ApplyEnvVarsToBuild field to given value. - -### HasApplyEnvVarsToBuild - -`func (o *Version) HasApplyEnvVarsToBuild() bool` - -HasApplyEnvVarsToBuild returns a boolean if a field has been set. - -### SetApplyEnvVarsToBuildNil - -`func (o *Version) SetApplyEnvVarsToBuildNil(b bool)` - - SetApplyEnvVarsToBuildNil sets the value for ApplyEnvVarsToBuild to be an explicit nil - -### UnsetApplyEnvVarsToBuild -`func (o *Version) UnsetApplyEnvVarsToBuild()` - -UnsetApplyEnvVarsToBuild ensures that no value is present for ApplyEnvVarsToBuild, not even an explicit nil -### GetBuildTag - -`func (o *Version) GetBuildTag() string` - -GetBuildTag returns the BuildTag field if non-nil, zero value otherwise. - -### GetBuildTagOk - -`func (o *Version) GetBuildTagOk() (*string, bool)` - -GetBuildTagOk returns a tuple with the BuildTag field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetBuildTag - -`func (o *Version) SetBuildTag(v string)` - -SetBuildTag sets BuildTag field to given value. - -### HasBuildTag - -`func (o *Version) HasBuildTag() bool` - -HasBuildTag returns a boolean if a field has been set. - -### GetSourceFiles - -`func (o *Version) GetSourceFiles() []VersionSourceFilesInner` - -GetSourceFiles returns the SourceFiles field if non-nil, zero value otherwise. - -### GetSourceFilesOk - -`func (o *Version) GetSourceFilesOk() (*[]VersionSourceFilesInner, bool)` - -GetSourceFilesOk returns a tuple with the SourceFiles field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetSourceFiles - -`func (o *Version) SetSourceFiles(v []VersionSourceFilesInner)` - -SetSourceFiles sets SourceFiles field to given value. - -### HasSourceFiles - -`func (o *Version) HasSourceFiles() bool` - -HasSourceFiles returns a boolean if a field has been set. - -### GetGitRepoUrl - -`func (o *Version) GetGitRepoUrl() string` - -GetGitRepoUrl returns the GitRepoUrl field if non-nil, zero value otherwise. - -### GetGitRepoUrlOk - -`func (o *Version) GetGitRepoUrlOk() (*string, bool)` - -GetGitRepoUrlOk returns a tuple with the GitRepoUrl field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetGitRepoUrl - -`func (o *Version) SetGitRepoUrl(v string)` - -SetGitRepoUrl sets GitRepoUrl field to given value. - -### HasGitRepoUrl - -`func (o *Version) HasGitRepoUrl() bool` - -HasGitRepoUrl returns a boolean if a field has been set. - -### SetGitRepoUrlNil - -`func (o *Version) SetGitRepoUrlNil(b bool)` - - SetGitRepoUrlNil sets the value for GitRepoUrl to be an explicit nil - -### UnsetGitRepoUrl -`func (o *Version) UnsetGitRepoUrl()` - -UnsetGitRepoUrl ensures that no value is present for GitRepoUrl, not even an explicit nil -### GetTarballUrl - -`func (o *Version) GetTarballUrl() string` - -GetTarballUrl returns the TarballUrl field if non-nil, zero value otherwise. - -### GetTarballUrlOk - -`func (o *Version) GetTarballUrlOk() (*string, bool)` - -GetTarballUrlOk returns a tuple with the TarballUrl field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetTarballUrl - -`func (o *Version) SetTarballUrl(v string)` - -SetTarballUrl sets TarballUrl field to given value. - -### HasTarballUrl - -`func (o *Version) HasTarballUrl() bool` - -HasTarballUrl returns a boolean if a field has been set. - -### SetTarballUrlNil - -`func (o *Version) SetTarballUrlNil(b bool)` - - SetTarballUrlNil sets the value for TarballUrl to be an explicit nil - -### UnsetTarballUrl -`func (o *Version) UnsetTarballUrl()` - -UnsetTarballUrl ensures that no value is present for TarballUrl, not even an explicit nil -### GetGitHubGistUrl - -`func (o *Version) GetGitHubGistUrl() string` - -GetGitHubGistUrl returns the GitHubGistUrl field if non-nil, zero value otherwise. - -### GetGitHubGistUrlOk - -`func (o *Version) GetGitHubGistUrlOk() (*string, bool)` - -GetGitHubGistUrlOk returns a tuple with the GitHubGistUrl field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetGitHubGistUrl - -`func (o *Version) SetGitHubGistUrl(v string)` - -SetGitHubGistUrl sets GitHubGistUrl field to given value. - -### HasGitHubGistUrl - -`func (o *Version) HasGitHubGistUrl() bool` - -HasGitHubGistUrl returns a boolean if a field has been set. - -### SetGitHubGistUrlNil - -`func (o *Version) SetGitHubGistUrlNil(b bool)` - - SetGitHubGistUrlNil sets the value for GitHubGistUrl to be an explicit nil - -### UnsetGitHubGistUrl -`func (o *Version) UnsetGitHubGistUrl()` - -UnsetGitHubGistUrl ensures that no value is present for GitHubGistUrl, not even an explicit nil - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/VersionResponse.md b/docs/VersionResponse.md deleted file mode 100644 index 0f2ca95..0000000 --- a/docs/VersionResponse.md +++ /dev/null @@ -1,51 +0,0 @@ -# VersionResponse - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Data** | [**Version**](Version.md) | | - -## Methods - -### NewVersionResponse - -`func NewVersionResponse(data Version, ) *VersionResponse` - -NewVersionResponse instantiates a new VersionResponse object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewVersionResponseWithDefaults - -`func NewVersionResponseWithDefaults() *VersionResponse` - -NewVersionResponseWithDefaults instantiates a new VersionResponse object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetData - -`func (o *VersionResponse) GetData() Version` - -GetData returns the Data field if non-nil, zero value otherwise. - -### GetDataOk - -`func (o *VersionResponse) GetDataOk() (*Version, bool)` - -GetDataOk returns a tuple with the Data field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetData - -`func (o *VersionResponse) SetData(v Version)` - -SetData sets Data field to given value. - - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/VersionSourceFilesInner.md b/docs/VersionSourceFilesInner.md deleted file mode 100644 index 5ccae44..0000000 --- a/docs/VersionSourceFilesInner.md +++ /dev/null @@ -1,124 +0,0 @@ -# VersionSourceFilesInner - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Format** | Pointer to [**SourceCodeFileFormat**](SourceCodeFileFormat.md) | | [optional] -**Content** | Pointer to **string** | | [optional] -**Name** | **string** | The folder path relative to the Actor's root directory. | -**Folder** | **bool** | Always `true` for folders. Used to distinguish folders from files. | - -## Methods - -### NewVersionSourceFilesInner - -`func NewVersionSourceFilesInner(name string, folder bool, ) *VersionSourceFilesInner` - -NewVersionSourceFilesInner instantiates a new VersionSourceFilesInner object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewVersionSourceFilesInnerWithDefaults - -`func NewVersionSourceFilesInnerWithDefaults() *VersionSourceFilesInner` - -NewVersionSourceFilesInnerWithDefaults instantiates a new VersionSourceFilesInner object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetFormat - -`func (o *VersionSourceFilesInner) GetFormat() SourceCodeFileFormat` - -GetFormat returns the Format field if non-nil, zero value otherwise. - -### GetFormatOk - -`func (o *VersionSourceFilesInner) GetFormatOk() (*SourceCodeFileFormat, bool)` - -GetFormatOk returns a tuple with the Format field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetFormat - -`func (o *VersionSourceFilesInner) SetFormat(v SourceCodeFileFormat)` - -SetFormat sets Format field to given value. - -### HasFormat - -`func (o *VersionSourceFilesInner) HasFormat() bool` - -HasFormat returns a boolean if a field has been set. - -### GetContent - -`func (o *VersionSourceFilesInner) GetContent() string` - -GetContent returns the Content field if non-nil, zero value otherwise. - -### GetContentOk - -`func (o *VersionSourceFilesInner) GetContentOk() (*string, bool)` - -GetContentOk returns a tuple with the Content field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetContent - -`func (o *VersionSourceFilesInner) SetContent(v string)` - -SetContent sets Content field to given value. - -### HasContent - -`func (o *VersionSourceFilesInner) HasContent() bool` - -HasContent returns a boolean if a field has been set. - -### GetName - -`func (o *VersionSourceFilesInner) GetName() string` - -GetName returns the Name field if non-nil, zero value otherwise. - -### GetNameOk - -`func (o *VersionSourceFilesInner) GetNameOk() (*string, bool)` - -GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetName - -`func (o *VersionSourceFilesInner) SetName(v string)` - -SetName sets Name field to given value. - - -### GetFolder - -`func (o *VersionSourceFilesInner) GetFolder() bool` - -GetFolder returns the Folder field if non-nil, zero value otherwise. - -### GetFolderOk - -`func (o *VersionSourceFilesInner) GetFolderOk() (*bool, bool)` - -GetFolderOk returns a tuple with the Folder field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetFolder - -`func (o *VersionSourceFilesInner) SetFolder(v bool)` - -SetFolder sets Folder field to given value. - - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/VersionSourceType.md b/docs/VersionSourceType.md deleted file mode 100644 index 4ecae6c..0000000 --- a/docs/VersionSourceType.md +++ /dev/null @@ -1,19 +0,0 @@ -# VersionSourceType - -## Enum - - -* `SOURCE_FILES` (value: `"SOURCE_FILES"`) - -* `GIT_REPO` (value: `"GIT_REPO"`) - -* `TARBALL` (value: `"TARBALL"`) - -* `GITHUB_GIST` (value: `"GITHUB_GIST"`) - -* `SOURCE_CODE` (value: `"SOURCE_CODE"`) - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/Webhook.md b/docs/Webhook.md deleted file mode 100644 index b92f789..0000000 --- a/docs/Webhook.md +++ /dev/null @@ -1,486 +0,0 @@ -# Webhook - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Id** | **string** | | -**CreatedAt** | **time.Time** | | -**ModifiedAt** | **time.Time** | | -**UserId** | **string** | | -**IsAdHoc** | Pointer to **NullableBool** | | [optional] -**ShouldInterpolateStrings** | Pointer to **NullableBool** | | [optional] -**EventTypes** | [**[]WebhookEventType**](WebhookEventType.md) | | -**Condition** | [**WebhookCondition**](WebhookCondition.md) | | -**IgnoreSslErrors** | **bool** | | -**DoNotRetry** | Pointer to **NullableBool** | | [optional] -**RequestUrl** | **string** | | -**PayloadTemplate** | Pointer to **NullableString** | | [optional] -**HeadersTemplate** | Pointer to **NullableString** | | [optional] -**Description** | Pointer to **NullableString** | | [optional] -**LastDispatch** | Pointer to [**NullableExampleWebhookDispatch**](ExampleWebhookDispatch.md) | | [optional] -**Stats** | Pointer to [**NullableWebhookStats**](WebhookStats.md) | | [optional] - -## Methods - -### NewWebhook - -`func NewWebhook(id string, createdAt time.Time, modifiedAt time.Time, userId string, eventTypes []WebhookEventType, condition WebhookCondition, ignoreSslErrors bool, requestUrl string, ) *Webhook` - -NewWebhook instantiates a new Webhook object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewWebhookWithDefaults - -`func NewWebhookWithDefaults() *Webhook` - -NewWebhookWithDefaults instantiates a new Webhook object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetId - -`func (o *Webhook) GetId() string` - -GetId returns the Id field if non-nil, zero value otherwise. - -### GetIdOk - -`func (o *Webhook) GetIdOk() (*string, bool)` - -GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetId - -`func (o *Webhook) SetId(v string)` - -SetId sets Id field to given value. - - -### GetCreatedAt - -`func (o *Webhook) GetCreatedAt() time.Time` - -GetCreatedAt returns the CreatedAt field if non-nil, zero value otherwise. - -### GetCreatedAtOk - -`func (o *Webhook) GetCreatedAtOk() (*time.Time, bool)` - -GetCreatedAtOk returns a tuple with the CreatedAt field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetCreatedAt - -`func (o *Webhook) SetCreatedAt(v time.Time)` - -SetCreatedAt sets CreatedAt field to given value. - - -### GetModifiedAt - -`func (o *Webhook) GetModifiedAt() time.Time` - -GetModifiedAt returns the ModifiedAt field if non-nil, zero value otherwise. - -### GetModifiedAtOk - -`func (o *Webhook) GetModifiedAtOk() (*time.Time, bool)` - -GetModifiedAtOk returns a tuple with the ModifiedAt field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetModifiedAt - -`func (o *Webhook) SetModifiedAt(v time.Time)` - -SetModifiedAt sets ModifiedAt field to given value. - - -### GetUserId - -`func (o *Webhook) GetUserId() string` - -GetUserId returns the UserId field if non-nil, zero value otherwise. - -### GetUserIdOk - -`func (o *Webhook) GetUserIdOk() (*string, bool)` - -GetUserIdOk returns a tuple with the UserId field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetUserId - -`func (o *Webhook) SetUserId(v string)` - -SetUserId sets UserId field to given value. - - -### GetIsAdHoc - -`func (o *Webhook) GetIsAdHoc() bool` - -GetIsAdHoc returns the IsAdHoc field if non-nil, zero value otherwise. - -### GetIsAdHocOk - -`func (o *Webhook) GetIsAdHocOk() (*bool, bool)` - -GetIsAdHocOk returns a tuple with the IsAdHoc field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetIsAdHoc - -`func (o *Webhook) SetIsAdHoc(v bool)` - -SetIsAdHoc sets IsAdHoc field to given value. - -### HasIsAdHoc - -`func (o *Webhook) HasIsAdHoc() bool` - -HasIsAdHoc returns a boolean if a field has been set. - -### SetIsAdHocNil - -`func (o *Webhook) SetIsAdHocNil(b bool)` - - SetIsAdHocNil sets the value for IsAdHoc to be an explicit nil - -### UnsetIsAdHoc -`func (o *Webhook) UnsetIsAdHoc()` - -UnsetIsAdHoc ensures that no value is present for IsAdHoc, not even an explicit nil -### GetShouldInterpolateStrings - -`func (o *Webhook) GetShouldInterpolateStrings() bool` - -GetShouldInterpolateStrings returns the ShouldInterpolateStrings field if non-nil, zero value otherwise. - -### GetShouldInterpolateStringsOk - -`func (o *Webhook) GetShouldInterpolateStringsOk() (*bool, bool)` - -GetShouldInterpolateStringsOk returns a tuple with the ShouldInterpolateStrings field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetShouldInterpolateStrings - -`func (o *Webhook) SetShouldInterpolateStrings(v bool)` - -SetShouldInterpolateStrings sets ShouldInterpolateStrings field to given value. - -### HasShouldInterpolateStrings - -`func (o *Webhook) HasShouldInterpolateStrings() bool` - -HasShouldInterpolateStrings returns a boolean if a field has been set. - -### SetShouldInterpolateStringsNil - -`func (o *Webhook) SetShouldInterpolateStringsNil(b bool)` - - SetShouldInterpolateStringsNil sets the value for ShouldInterpolateStrings to be an explicit nil - -### UnsetShouldInterpolateStrings -`func (o *Webhook) UnsetShouldInterpolateStrings()` - -UnsetShouldInterpolateStrings ensures that no value is present for ShouldInterpolateStrings, not even an explicit nil -### GetEventTypes - -`func (o *Webhook) GetEventTypes() []WebhookEventType` - -GetEventTypes returns the EventTypes field if non-nil, zero value otherwise. - -### GetEventTypesOk - -`func (o *Webhook) GetEventTypesOk() (*[]WebhookEventType, bool)` - -GetEventTypesOk returns a tuple with the EventTypes field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetEventTypes - -`func (o *Webhook) SetEventTypes(v []WebhookEventType)` - -SetEventTypes sets EventTypes field to given value. - - -### GetCondition - -`func (o *Webhook) GetCondition() WebhookCondition` - -GetCondition returns the Condition field if non-nil, zero value otherwise. - -### GetConditionOk - -`func (o *Webhook) GetConditionOk() (*WebhookCondition, bool)` - -GetConditionOk returns a tuple with the Condition field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetCondition - -`func (o *Webhook) SetCondition(v WebhookCondition)` - -SetCondition sets Condition field to given value. - - -### GetIgnoreSslErrors - -`func (o *Webhook) GetIgnoreSslErrors() bool` - -GetIgnoreSslErrors returns the IgnoreSslErrors field if non-nil, zero value otherwise. - -### GetIgnoreSslErrorsOk - -`func (o *Webhook) GetIgnoreSslErrorsOk() (*bool, bool)` - -GetIgnoreSslErrorsOk returns a tuple with the IgnoreSslErrors field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetIgnoreSslErrors - -`func (o *Webhook) SetIgnoreSslErrors(v bool)` - -SetIgnoreSslErrors sets IgnoreSslErrors field to given value. - - -### GetDoNotRetry - -`func (o *Webhook) GetDoNotRetry() bool` - -GetDoNotRetry returns the DoNotRetry field if non-nil, zero value otherwise. - -### GetDoNotRetryOk - -`func (o *Webhook) GetDoNotRetryOk() (*bool, bool)` - -GetDoNotRetryOk returns a tuple with the DoNotRetry field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetDoNotRetry - -`func (o *Webhook) SetDoNotRetry(v bool)` - -SetDoNotRetry sets DoNotRetry field to given value. - -### HasDoNotRetry - -`func (o *Webhook) HasDoNotRetry() bool` - -HasDoNotRetry returns a boolean if a field has been set. - -### SetDoNotRetryNil - -`func (o *Webhook) SetDoNotRetryNil(b bool)` - - SetDoNotRetryNil sets the value for DoNotRetry to be an explicit nil - -### UnsetDoNotRetry -`func (o *Webhook) UnsetDoNotRetry()` - -UnsetDoNotRetry ensures that no value is present for DoNotRetry, not even an explicit nil -### GetRequestUrl - -`func (o *Webhook) GetRequestUrl() string` - -GetRequestUrl returns the RequestUrl field if non-nil, zero value otherwise. - -### GetRequestUrlOk - -`func (o *Webhook) GetRequestUrlOk() (*string, bool)` - -GetRequestUrlOk returns a tuple with the RequestUrl field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetRequestUrl - -`func (o *Webhook) SetRequestUrl(v string)` - -SetRequestUrl sets RequestUrl field to given value. - - -### GetPayloadTemplate - -`func (o *Webhook) GetPayloadTemplate() string` - -GetPayloadTemplate returns the PayloadTemplate field if non-nil, zero value otherwise. - -### GetPayloadTemplateOk - -`func (o *Webhook) GetPayloadTemplateOk() (*string, bool)` - -GetPayloadTemplateOk returns a tuple with the PayloadTemplate field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetPayloadTemplate - -`func (o *Webhook) SetPayloadTemplate(v string)` - -SetPayloadTemplate sets PayloadTemplate field to given value. - -### HasPayloadTemplate - -`func (o *Webhook) HasPayloadTemplate() bool` - -HasPayloadTemplate returns a boolean if a field has been set. - -### SetPayloadTemplateNil - -`func (o *Webhook) SetPayloadTemplateNil(b bool)` - - SetPayloadTemplateNil sets the value for PayloadTemplate to be an explicit nil - -### UnsetPayloadTemplate -`func (o *Webhook) UnsetPayloadTemplate()` - -UnsetPayloadTemplate ensures that no value is present for PayloadTemplate, not even an explicit nil -### GetHeadersTemplate - -`func (o *Webhook) GetHeadersTemplate() string` - -GetHeadersTemplate returns the HeadersTemplate field if non-nil, zero value otherwise. - -### GetHeadersTemplateOk - -`func (o *Webhook) GetHeadersTemplateOk() (*string, bool)` - -GetHeadersTemplateOk returns a tuple with the HeadersTemplate field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetHeadersTemplate - -`func (o *Webhook) SetHeadersTemplate(v string)` - -SetHeadersTemplate sets HeadersTemplate field to given value. - -### HasHeadersTemplate - -`func (o *Webhook) HasHeadersTemplate() bool` - -HasHeadersTemplate returns a boolean if a field has been set. - -### SetHeadersTemplateNil - -`func (o *Webhook) SetHeadersTemplateNil(b bool)` - - SetHeadersTemplateNil sets the value for HeadersTemplate to be an explicit nil - -### UnsetHeadersTemplate -`func (o *Webhook) UnsetHeadersTemplate()` - -UnsetHeadersTemplate ensures that no value is present for HeadersTemplate, not even an explicit nil -### GetDescription - -`func (o *Webhook) GetDescription() string` - -GetDescription returns the Description field if non-nil, zero value otherwise. - -### GetDescriptionOk - -`func (o *Webhook) GetDescriptionOk() (*string, bool)` - -GetDescriptionOk returns a tuple with the Description field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetDescription - -`func (o *Webhook) SetDescription(v string)` - -SetDescription sets Description field to given value. - -### HasDescription - -`func (o *Webhook) HasDescription() bool` - -HasDescription returns a boolean if a field has been set. - -### SetDescriptionNil - -`func (o *Webhook) SetDescriptionNil(b bool)` - - SetDescriptionNil sets the value for Description to be an explicit nil - -### UnsetDescription -`func (o *Webhook) UnsetDescription()` - -UnsetDescription ensures that no value is present for Description, not even an explicit nil -### GetLastDispatch - -`func (o *Webhook) GetLastDispatch() ExampleWebhookDispatch` - -GetLastDispatch returns the LastDispatch field if non-nil, zero value otherwise. - -### GetLastDispatchOk - -`func (o *Webhook) GetLastDispatchOk() (*ExampleWebhookDispatch, bool)` - -GetLastDispatchOk returns a tuple with the LastDispatch field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetLastDispatch - -`func (o *Webhook) SetLastDispatch(v ExampleWebhookDispatch)` - -SetLastDispatch sets LastDispatch field to given value. - -### HasLastDispatch - -`func (o *Webhook) HasLastDispatch() bool` - -HasLastDispatch returns a boolean if a field has been set. - -### SetLastDispatchNil - -`func (o *Webhook) SetLastDispatchNil(b bool)` - - SetLastDispatchNil sets the value for LastDispatch to be an explicit nil - -### UnsetLastDispatch -`func (o *Webhook) UnsetLastDispatch()` - -UnsetLastDispatch ensures that no value is present for LastDispatch, not even an explicit nil -### GetStats - -`func (o *Webhook) GetStats() WebhookStats` - -GetStats returns the Stats field if non-nil, zero value otherwise. - -### GetStatsOk - -`func (o *Webhook) GetStatsOk() (*WebhookStats, bool)` - -GetStatsOk returns a tuple with the Stats field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetStats - -`func (o *Webhook) SetStats(v WebhookStats)` - -SetStats sets Stats field to given value. - -### HasStats - -`func (o *Webhook) HasStats() bool` - -HasStats returns a boolean if a field has been set. - -### SetStatsNil - -`func (o *Webhook) SetStatsNil(b bool)` - - SetStatsNil sets the value for Stats to be an explicit nil - -### UnsetStats -`func (o *Webhook) UnsetStats()` - -UnsetStats ensures that no value is present for Stats, not even an explicit nil - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/WebhookCondition.md b/docs/WebhookCondition.md deleted file mode 100644 index b8e00b8..0000000 --- a/docs/WebhookCondition.md +++ /dev/null @@ -1,138 +0,0 @@ -# WebhookCondition - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**ActorId** | Pointer to **NullableString** | | [optional] -**ActorTaskId** | Pointer to **NullableString** | | [optional] -**ActorRunId** | Pointer to **NullableString** | | [optional] - -## Methods - -### NewWebhookCondition - -`func NewWebhookCondition() *WebhookCondition` - -NewWebhookCondition instantiates a new WebhookCondition object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewWebhookConditionWithDefaults - -`func NewWebhookConditionWithDefaults() *WebhookCondition` - -NewWebhookConditionWithDefaults instantiates a new WebhookCondition object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetActorId - -`func (o *WebhookCondition) GetActorId() string` - -GetActorId returns the ActorId field if non-nil, zero value otherwise. - -### GetActorIdOk - -`func (o *WebhookCondition) GetActorIdOk() (*string, bool)` - -GetActorIdOk returns a tuple with the ActorId field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetActorId - -`func (o *WebhookCondition) SetActorId(v string)` - -SetActorId sets ActorId field to given value. - -### HasActorId - -`func (o *WebhookCondition) HasActorId() bool` - -HasActorId returns a boolean if a field has been set. - -### SetActorIdNil - -`func (o *WebhookCondition) SetActorIdNil(b bool)` - - SetActorIdNil sets the value for ActorId to be an explicit nil - -### UnsetActorId -`func (o *WebhookCondition) UnsetActorId()` - -UnsetActorId ensures that no value is present for ActorId, not even an explicit nil -### GetActorTaskId - -`func (o *WebhookCondition) GetActorTaskId() string` - -GetActorTaskId returns the ActorTaskId field if non-nil, zero value otherwise. - -### GetActorTaskIdOk - -`func (o *WebhookCondition) GetActorTaskIdOk() (*string, bool)` - -GetActorTaskIdOk returns a tuple with the ActorTaskId field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetActorTaskId - -`func (o *WebhookCondition) SetActorTaskId(v string)` - -SetActorTaskId sets ActorTaskId field to given value. - -### HasActorTaskId - -`func (o *WebhookCondition) HasActorTaskId() bool` - -HasActorTaskId returns a boolean if a field has been set. - -### SetActorTaskIdNil - -`func (o *WebhookCondition) SetActorTaskIdNil(b bool)` - - SetActorTaskIdNil sets the value for ActorTaskId to be an explicit nil - -### UnsetActorTaskId -`func (o *WebhookCondition) UnsetActorTaskId()` - -UnsetActorTaskId ensures that no value is present for ActorTaskId, not even an explicit nil -### GetActorRunId - -`func (o *WebhookCondition) GetActorRunId() string` - -GetActorRunId returns the ActorRunId field if non-nil, zero value otherwise. - -### GetActorRunIdOk - -`func (o *WebhookCondition) GetActorRunIdOk() (*string, bool)` - -GetActorRunIdOk returns a tuple with the ActorRunId field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetActorRunId - -`func (o *WebhookCondition) SetActorRunId(v string)` - -SetActorRunId sets ActorRunId field to given value. - -### HasActorRunId - -`func (o *WebhookCondition) HasActorRunId() bool` - -HasActorRunId returns a boolean if a field has been set. - -### SetActorRunIdNil - -`func (o *WebhookCondition) SetActorRunIdNil(b bool)` - - SetActorRunIdNil sets the value for ActorRunId to be an explicit nil - -### UnsetActorRunId -`func (o *WebhookCondition) UnsetActorRunId()` - -UnsetActorRunId ensures that no value is present for ActorRunId, not even an explicit nil - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/WebhookCreate.md b/docs/WebhookCreate.md deleted file mode 100644 index 3e6fe34..0000000 --- a/docs/WebhookCreate.md +++ /dev/null @@ -1,381 +0,0 @@ -# WebhookCreate - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**IsAdHoc** | Pointer to **NullableBool** | | [optional] -**EventTypes** | [**[]WebhookEventType**](WebhookEventType.md) | | -**Condition** | [**WebhookCondition**](WebhookCondition.md) | | -**IdempotencyKey** | Pointer to **NullableString** | | [optional] -**IgnoreSslErrors** | Pointer to **NullableBool** | | [optional] -**DoNotRetry** | Pointer to **NullableBool** | | [optional] -**RequestUrl** | **string** | | -**PayloadTemplate** | Pointer to **NullableString** | | [optional] -**HeadersTemplate** | Pointer to **NullableString** | | [optional] -**Description** | Pointer to **NullableString** | | [optional] -**ShouldInterpolateStrings** | Pointer to **NullableBool** | | [optional] - -## Methods - -### NewWebhookCreate - -`func NewWebhookCreate(eventTypes []WebhookEventType, condition WebhookCondition, requestUrl string, ) *WebhookCreate` - -NewWebhookCreate instantiates a new WebhookCreate object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewWebhookCreateWithDefaults - -`func NewWebhookCreateWithDefaults() *WebhookCreate` - -NewWebhookCreateWithDefaults instantiates a new WebhookCreate object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetIsAdHoc - -`func (o *WebhookCreate) GetIsAdHoc() bool` - -GetIsAdHoc returns the IsAdHoc field if non-nil, zero value otherwise. - -### GetIsAdHocOk - -`func (o *WebhookCreate) GetIsAdHocOk() (*bool, bool)` - -GetIsAdHocOk returns a tuple with the IsAdHoc field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetIsAdHoc - -`func (o *WebhookCreate) SetIsAdHoc(v bool)` - -SetIsAdHoc sets IsAdHoc field to given value. - -### HasIsAdHoc - -`func (o *WebhookCreate) HasIsAdHoc() bool` - -HasIsAdHoc returns a boolean if a field has been set. - -### SetIsAdHocNil - -`func (o *WebhookCreate) SetIsAdHocNil(b bool)` - - SetIsAdHocNil sets the value for IsAdHoc to be an explicit nil - -### UnsetIsAdHoc -`func (o *WebhookCreate) UnsetIsAdHoc()` - -UnsetIsAdHoc ensures that no value is present for IsAdHoc, not even an explicit nil -### GetEventTypes - -`func (o *WebhookCreate) GetEventTypes() []WebhookEventType` - -GetEventTypes returns the EventTypes field if non-nil, zero value otherwise. - -### GetEventTypesOk - -`func (o *WebhookCreate) GetEventTypesOk() (*[]WebhookEventType, bool)` - -GetEventTypesOk returns a tuple with the EventTypes field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetEventTypes - -`func (o *WebhookCreate) SetEventTypes(v []WebhookEventType)` - -SetEventTypes sets EventTypes field to given value. - - -### GetCondition - -`func (o *WebhookCreate) GetCondition() WebhookCondition` - -GetCondition returns the Condition field if non-nil, zero value otherwise. - -### GetConditionOk - -`func (o *WebhookCreate) GetConditionOk() (*WebhookCondition, bool)` - -GetConditionOk returns a tuple with the Condition field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetCondition - -`func (o *WebhookCreate) SetCondition(v WebhookCondition)` - -SetCondition sets Condition field to given value. - - -### GetIdempotencyKey - -`func (o *WebhookCreate) GetIdempotencyKey() string` - -GetIdempotencyKey returns the IdempotencyKey field if non-nil, zero value otherwise. - -### GetIdempotencyKeyOk - -`func (o *WebhookCreate) GetIdempotencyKeyOk() (*string, bool)` - -GetIdempotencyKeyOk returns a tuple with the IdempotencyKey field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetIdempotencyKey - -`func (o *WebhookCreate) SetIdempotencyKey(v string)` - -SetIdempotencyKey sets IdempotencyKey field to given value. - -### HasIdempotencyKey - -`func (o *WebhookCreate) HasIdempotencyKey() bool` - -HasIdempotencyKey returns a boolean if a field has been set. - -### SetIdempotencyKeyNil - -`func (o *WebhookCreate) SetIdempotencyKeyNil(b bool)` - - SetIdempotencyKeyNil sets the value for IdempotencyKey to be an explicit nil - -### UnsetIdempotencyKey -`func (o *WebhookCreate) UnsetIdempotencyKey()` - -UnsetIdempotencyKey ensures that no value is present for IdempotencyKey, not even an explicit nil -### GetIgnoreSslErrors - -`func (o *WebhookCreate) GetIgnoreSslErrors() bool` - -GetIgnoreSslErrors returns the IgnoreSslErrors field if non-nil, zero value otherwise. - -### GetIgnoreSslErrorsOk - -`func (o *WebhookCreate) GetIgnoreSslErrorsOk() (*bool, bool)` - -GetIgnoreSslErrorsOk returns a tuple with the IgnoreSslErrors field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetIgnoreSslErrors - -`func (o *WebhookCreate) SetIgnoreSslErrors(v bool)` - -SetIgnoreSslErrors sets IgnoreSslErrors field to given value. - -### HasIgnoreSslErrors - -`func (o *WebhookCreate) HasIgnoreSslErrors() bool` - -HasIgnoreSslErrors returns a boolean if a field has been set. - -### SetIgnoreSslErrorsNil - -`func (o *WebhookCreate) SetIgnoreSslErrorsNil(b bool)` - - SetIgnoreSslErrorsNil sets the value for IgnoreSslErrors to be an explicit nil - -### UnsetIgnoreSslErrors -`func (o *WebhookCreate) UnsetIgnoreSslErrors()` - -UnsetIgnoreSslErrors ensures that no value is present for IgnoreSslErrors, not even an explicit nil -### GetDoNotRetry - -`func (o *WebhookCreate) GetDoNotRetry() bool` - -GetDoNotRetry returns the DoNotRetry field if non-nil, zero value otherwise. - -### GetDoNotRetryOk - -`func (o *WebhookCreate) GetDoNotRetryOk() (*bool, bool)` - -GetDoNotRetryOk returns a tuple with the DoNotRetry field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetDoNotRetry - -`func (o *WebhookCreate) SetDoNotRetry(v bool)` - -SetDoNotRetry sets DoNotRetry field to given value. - -### HasDoNotRetry - -`func (o *WebhookCreate) HasDoNotRetry() bool` - -HasDoNotRetry returns a boolean if a field has been set. - -### SetDoNotRetryNil - -`func (o *WebhookCreate) SetDoNotRetryNil(b bool)` - - SetDoNotRetryNil sets the value for DoNotRetry to be an explicit nil - -### UnsetDoNotRetry -`func (o *WebhookCreate) UnsetDoNotRetry()` - -UnsetDoNotRetry ensures that no value is present for DoNotRetry, not even an explicit nil -### GetRequestUrl - -`func (o *WebhookCreate) GetRequestUrl() string` - -GetRequestUrl returns the RequestUrl field if non-nil, zero value otherwise. - -### GetRequestUrlOk - -`func (o *WebhookCreate) GetRequestUrlOk() (*string, bool)` - -GetRequestUrlOk returns a tuple with the RequestUrl field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetRequestUrl - -`func (o *WebhookCreate) SetRequestUrl(v string)` - -SetRequestUrl sets RequestUrl field to given value. - - -### GetPayloadTemplate - -`func (o *WebhookCreate) GetPayloadTemplate() string` - -GetPayloadTemplate returns the PayloadTemplate field if non-nil, zero value otherwise. - -### GetPayloadTemplateOk - -`func (o *WebhookCreate) GetPayloadTemplateOk() (*string, bool)` - -GetPayloadTemplateOk returns a tuple with the PayloadTemplate field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetPayloadTemplate - -`func (o *WebhookCreate) SetPayloadTemplate(v string)` - -SetPayloadTemplate sets PayloadTemplate field to given value. - -### HasPayloadTemplate - -`func (o *WebhookCreate) HasPayloadTemplate() bool` - -HasPayloadTemplate returns a boolean if a field has been set. - -### SetPayloadTemplateNil - -`func (o *WebhookCreate) SetPayloadTemplateNil(b bool)` - - SetPayloadTemplateNil sets the value for PayloadTemplate to be an explicit nil - -### UnsetPayloadTemplate -`func (o *WebhookCreate) UnsetPayloadTemplate()` - -UnsetPayloadTemplate ensures that no value is present for PayloadTemplate, not even an explicit nil -### GetHeadersTemplate - -`func (o *WebhookCreate) GetHeadersTemplate() string` - -GetHeadersTemplate returns the HeadersTemplate field if non-nil, zero value otherwise. - -### GetHeadersTemplateOk - -`func (o *WebhookCreate) GetHeadersTemplateOk() (*string, bool)` - -GetHeadersTemplateOk returns a tuple with the HeadersTemplate field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetHeadersTemplate - -`func (o *WebhookCreate) SetHeadersTemplate(v string)` - -SetHeadersTemplate sets HeadersTemplate field to given value. - -### HasHeadersTemplate - -`func (o *WebhookCreate) HasHeadersTemplate() bool` - -HasHeadersTemplate returns a boolean if a field has been set. - -### SetHeadersTemplateNil - -`func (o *WebhookCreate) SetHeadersTemplateNil(b bool)` - - SetHeadersTemplateNil sets the value for HeadersTemplate to be an explicit nil - -### UnsetHeadersTemplate -`func (o *WebhookCreate) UnsetHeadersTemplate()` - -UnsetHeadersTemplate ensures that no value is present for HeadersTemplate, not even an explicit nil -### GetDescription - -`func (o *WebhookCreate) GetDescription() string` - -GetDescription returns the Description field if non-nil, zero value otherwise. - -### GetDescriptionOk - -`func (o *WebhookCreate) GetDescriptionOk() (*string, bool)` - -GetDescriptionOk returns a tuple with the Description field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetDescription - -`func (o *WebhookCreate) SetDescription(v string)` - -SetDescription sets Description field to given value. - -### HasDescription - -`func (o *WebhookCreate) HasDescription() bool` - -HasDescription returns a boolean if a field has been set. - -### SetDescriptionNil - -`func (o *WebhookCreate) SetDescriptionNil(b bool)` - - SetDescriptionNil sets the value for Description to be an explicit nil - -### UnsetDescription -`func (o *WebhookCreate) UnsetDescription()` - -UnsetDescription ensures that no value is present for Description, not even an explicit nil -### GetShouldInterpolateStrings - -`func (o *WebhookCreate) GetShouldInterpolateStrings() bool` - -GetShouldInterpolateStrings returns the ShouldInterpolateStrings field if non-nil, zero value otherwise. - -### GetShouldInterpolateStringsOk - -`func (o *WebhookCreate) GetShouldInterpolateStringsOk() (*bool, bool)` - -GetShouldInterpolateStringsOk returns a tuple with the ShouldInterpolateStrings field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetShouldInterpolateStrings - -`func (o *WebhookCreate) SetShouldInterpolateStrings(v bool)` - -SetShouldInterpolateStrings sets ShouldInterpolateStrings field to given value. - -### HasShouldInterpolateStrings - -`func (o *WebhookCreate) HasShouldInterpolateStrings() bool` - -HasShouldInterpolateStrings returns a boolean if a field has been set. - -### SetShouldInterpolateStringsNil - -`func (o *WebhookCreate) SetShouldInterpolateStringsNil(b bool)` - - SetShouldInterpolateStringsNil sets the value for ShouldInterpolateStrings to be an explicit nil - -### UnsetShouldInterpolateStrings -`func (o *WebhookCreate) UnsetShouldInterpolateStrings()` - -UnsetShouldInterpolateStrings ensures that no value is present for ShouldInterpolateStrings, not even an explicit nil - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/WebhookDispatch.md b/docs/WebhookDispatch.md deleted file mode 100644 index 6d01b41..0000000 --- a/docs/WebhookDispatch.md +++ /dev/null @@ -1,244 +0,0 @@ -# WebhookDispatch - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Id** | **string** | | -**UserId** | **string** | | -**WebhookId** | **string** | | -**CreatedAt** | **time.Time** | | -**Status** | [**WebhookDispatchStatus**](WebhookDispatchStatus.md) | | -**EventType** | [**WebhookEventType**](WebhookEventType.md) | | -**EventData** | Pointer to [**EventData**](EventData.md) | | [optional] -**Webhook** | Pointer to [**NullableWebhookDispatchWebhookSummary**](WebhookDispatchWebhookSummary.md) | | [optional] -**Calls** | Pointer to [**[]CallsInner**](CallsInner.md) | | [optional] - -## Methods - -### NewWebhookDispatch - -`func NewWebhookDispatch(id string, userId string, webhookId string, createdAt time.Time, status WebhookDispatchStatus, eventType WebhookEventType, ) *WebhookDispatch` - -NewWebhookDispatch instantiates a new WebhookDispatch object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewWebhookDispatchWithDefaults - -`func NewWebhookDispatchWithDefaults() *WebhookDispatch` - -NewWebhookDispatchWithDefaults instantiates a new WebhookDispatch object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetId - -`func (o *WebhookDispatch) GetId() string` - -GetId returns the Id field if non-nil, zero value otherwise. - -### GetIdOk - -`func (o *WebhookDispatch) GetIdOk() (*string, bool)` - -GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetId - -`func (o *WebhookDispatch) SetId(v string)` - -SetId sets Id field to given value. - - -### GetUserId - -`func (o *WebhookDispatch) GetUserId() string` - -GetUserId returns the UserId field if non-nil, zero value otherwise. - -### GetUserIdOk - -`func (o *WebhookDispatch) GetUserIdOk() (*string, bool)` - -GetUserIdOk returns a tuple with the UserId field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetUserId - -`func (o *WebhookDispatch) SetUserId(v string)` - -SetUserId sets UserId field to given value. - - -### GetWebhookId - -`func (o *WebhookDispatch) GetWebhookId() string` - -GetWebhookId returns the WebhookId field if non-nil, zero value otherwise. - -### GetWebhookIdOk - -`func (o *WebhookDispatch) GetWebhookIdOk() (*string, bool)` - -GetWebhookIdOk returns a tuple with the WebhookId field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetWebhookId - -`func (o *WebhookDispatch) SetWebhookId(v string)` - -SetWebhookId sets WebhookId field to given value. - - -### GetCreatedAt - -`func (o *WebhookDispatch) GetCreatedAt() time.Time` - -GetCreatedAt returns the CreatedAt field if non-nil, zero value otherwise. - -### GetCreatedAtOk - -`func (o *WebhookDispatch) GetCreatedAtOk() (*time.Time, bool)` - -GetCreatedAtOk returns a tuple with the CreatedAt field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetCreatedAt - -`func (o *WebhookDispatch) SetCreatedAt(v time.Time)` - -SetCreatedAt sets CreatedAt field to given value. - - -### GetStatus - -`func (o *WebhookDispatch) GetStatus() WebhookDispatchStatus` - -GetStatus returns the Status field if non-nil, zero value otherwise. - -### GetStatusOk - -`func (o *WebhookDispatch) GetStatusOk() (*WebhookDispatchStatus, bool)` - -GetStatusOk returns a tuple with the Status field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetStatus - -`func (o *WebhookDispatch) SetStatus(v WebhookDispatchStatus)` - -SetStatus sets Status field to given value. - - -### GetEventType - -`func (o *WebhookDispatch) GetEventType() WebhookEventType` - -GetEventType returns the EventType field if non-nil, zero value otherwise. - -### GetEventTypeOk - -`func (o *WebhookDispatch) GetEventTypeOk() (*WebhookEventType, bool)` - -GetEventTypeOk returns a tuple with the EventType field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetEventType - -`func (o *WebhookDispatch) SetEventType(v WebhookEventType)` - -SetEventType sets EventType field to given value. - - -### GetEventData - -`func (o *WebhookDispatch) GetEventData() EventData` - -GetEventData returns the EventData field if non-nil, zero value otherwise. - -### GetEventDataOk - -`func (o *WebhookDispatch) GetEventDataOk() (*EventData, bool)` - -GetEventDataOk returns a tuple with the EventData field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetEventData - -`func (o *WebhookDispatch) SetEventData(v EventData)` - -SetEventData sets EventData field to given value. - -### HasEventData - -`func (o *WebhookDispatch) HasEventData() bool` - -HasEventData returns a boolean if a field has been set. - -### GetWebhook - -`func (o *WebhookDispatch) GetWebhook() WebhookDispatchWebhookSummary` - -GetWebhook returns the Webhook field if non-nil, zero value otherwise. - -### GetWebhookOk - -`func (o *WebhookDispatch) GetWebhookOk() (*WebhookDispatchWebhookSummary, bool)` - -GetWebhookOk returns a tuple with the Webhook field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetWebhook - -`func (o *WebhookDispatch) SetWebhook(v WebhookDispatchWebhookSummary)` - -SetWebhook sets Webhook field to given value. - -### HasWebhook - -`func (o *WebhookDispatch) HasWebhook() bool` - -HasWebhook returns a boolean if a field has been set. - -### SetWebhookNil - -`func (o *WebhookDispatch) SetWebhookNil(b bool)` - - SetWebhookNil sets the value for Webhook to be an explicit nil - -### UnsetWebhook -`func (o *WebhookDispatch) UnsetWebhook()` - -UnsetWebhook ensures that no value is present for Webhook, not even an explicit nil -### GetCalls - -`func (o *WebhookDispatch) GetCalls() []CallsInner` - -GetCalls returns the Calls field if non-nil, zero value otherwise. - -### GetCallsOk - -`func (o *WebhookDispatch) GetCallsOk() (*[]CallsInner, bool)` - -GetCallsOk returns a tuple with the Calls field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetCalls - -`func (o *WebhookDispatch) SetCalls(v []CallsInner)` - -SetCalls sets Calls field to given value. - -### HasCalls - -`func (o *WebhookDispatch) HasCalls() bool` - -HasCalls returns a boolean if a field has been set. - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/WebhookDispatchResponse.md b/docs/WebhookDispatchResponse.md deleted file mode 100644 index b558452..0000000 --- a/docs/WebhookDispatchResponse.md +++ /dev/null @@ -1,51 +0,0 @@ -# WebhookDispatchResponse - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Data** | [**WebhookDispatch**](WebhookDispatch.md) | | - -## Methods - -### NewWebhookDispatchResponse - -`func NewWebhookDispatchResponse(data WebhookDispatch, ) *WebhookDispatchResponse` - -NewWebhookDispatchResponse instantiates a new WebhookDispatchResponse object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewWebhookDispatchResponseWithDefaults - -`func NewWebhookDispatchResponseWithDefaults() *WebhookDispatchResponse` - -NewWebhookDispatchResponseWithDefaults instantiates a new WebhookDispatchResponse object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetData - -`func (o *WebhookDispatchResponse) GetData() WebhookDispatch` - -GetData returns the Data field if non-nil, zero value otherwise. - -### GetDataOk - -`func (o *WebhookDispatchResponse) GetDataOk() (*WebhookDispatch, bool)` - -GetDataOk returns a tuple with the Data field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetData - -`func (o *WebhookDispatchResponse) SetData(v WebhookDispatch)` - -SetData sets Data field to given value. - - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/WebhookDispatchStatus.md b/docs/WebhookDispatchStatus.md deleted file mode 100644 index 0bd4ed0..0000000 --- a/docs/WebhookDispatchStatus.md +++ /dev/null @@ -1,15 +0,0 @@ -# WebhookDispatchStatus - -## Enum - - -* `ACTIVE` (value: `"ACTIVE"`) - -* `SUCCEEDED` (value: `"SUCCEEDED"`) - -* `FAILED` (value: `"FAILED"`) - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/WebhookDispatchWebhookSummary.md b/docs/WebhookDispatchWebhookSummary.md deleted file mode 100644 index f413d79..0000000 --- a/docs/WebhookDispatchWebhookSummary.md +++ /dev/null @@ -1,134 +0,0 @@ -# WebhookDispatchWebhookSummary - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**ActionType** | Pointer to **string** | | [optional] -**Condition** | Pointer to [**WebhookCondition**](WebhookCondition.md) | | [optional] -**RequestUrl** | Pointer to **string** | | [optional] -**IsAdHoc** | Pointer to **bool** | | [optional] - -## Methods - -### NewWebhookDispatchWebhookSummary - -`func NewWebhookDispatchWebhookSummary() *WebhookDispatchWebhookSummary` - -NewWebhookDispatchWebhookSummary instantiates a new WebhookDispatchWebhookSummary object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewWebhookDispatchWebhookSummaryWithDefaults - -`func NewWebhookDispatchWebhookSummaryWithDefaults() *WebhookDispatchWebhookSummary` - -NewWebhookDispatchWebhookSummaryWithDefaults instantiates a new WebhookDispatchWebhookSummary object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetActionType - -`func (o *WebhookDispatchWebhookSummary) GetActionType() string` - -GetActionType returns the ActionType field if non-nil, zero value otherwise. - -### GetActionTypeOk - -`func (o *WebhookDispatchWebhookSummary) GetActionTypeOk() (*string, bool)` - -GetActionTypeOk returns a tuple with the ActionType field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetActionType - -`func (o *WebhookDispatchWebhookSummary) SetActionType(v string)` - -SetActionType sets ActionType field to given value. - -### HasActionType - -`func (o *WebhookDispatchWebhookSummary) HasActionType() bool` - -HasActionType returns a boolean if a field has been set. - -### GetCondition - -`func (o *WebhookDispatchWebhookSummary) GetCondition() WebhookCondition` - -GetCondition returns the Condition field if non-nil, zero value otherwise. - -### GetConditionOk - -`func (o *WebhookDispatchWebhookSummary) GetConditionOk() (*WebhookCondition, bool)` - -GetConditionOk returns a tuple with the Condition field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetCondition - -`func (o *WebhookDispatchWebhookSummary) SetCondition(v WebhookCondition)` - -SetCondition sets Condition field to given value. - -### HasCondition - -`func (o *WebhookDispatchWebhookSummary) HasCondition() bool` - -HasCondition returns a boolean if a field has been set. - -### GetRequestUrl - -`func (o *WebhookDispatchWebhookSummary) GetRequestUrl() string` - -GetRequestUrl returns the RequestUrl field if non-nil, zero value otherwise. - -### GetRequestUrlOk - -`func (o *WebhookDispatchWebhookSummary) GetRequestUrlOk() (*string, bool)` - -GetRequestUrlOk returns a tuple with the RequestUrl field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetRequestUrl - -`func (o *WebhookDispatchWebhookSummary) SetRequestUrl(v string)` - -SetRequestUrl sets RequestUrl field to given value. - -### HasRequestUrl - -`func (o *WebhookDispatchWebhookSummary) HasRequestUrl() bool` - -HasRequestUrl returns a boolean if a field has been set. - -### GetIsAdHoc - -`func (o *WebhookDispatchWebhookSummary) GetIsAdHoc() bool` - -GetIsAdHoc returns the IsAdHoc field if non-nil, zero value otherwise. - -### GetIsAdHocOk - -`func (o *WebhookDispatchWebhookSummary) GetIsAdHocOk() (*bool, bool)` - -GetIsAdHocOk returns a tuple with the IsAdHoc field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetIsAdHoc - -`func (o *WebhookDispatchWebhookSummary) SetIsAdHoc(v bool)` - -SetIsAdHoc sets IsAdHoc field to given value. - -### HasIsAdHoc - -`func (o *WebhookDispatchWebhookSummary) HasIsAdHoc() bool` - -HasIsAdHoc returns a boolean if a field has been set. - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/WebhookEventType.md b/docs/WebhookEventType.md deleted file mode 100644 index 703d5e0..0000000 --- a/docs/WebhookEventType.md +++ /dev/null @@ -1,33 +0,0 @@ -# WebhookEventType - -## Enum - - -* `ACTOR_BUILD_ABORTED` (value: `"ACTOR.BUILD.ABORTED"`) - -* `ACTOR_BUILD_CREATED` (value: `"ACTOR.BUILD.CREATED"`) - -* `ACTOR_BUILD_FAILED` (value: `"ACTOR.BUILD.FAILED"`) - -* `ACTOR_BUILD_SUCCEEDED` (value: `"ACTOR.BUILD.SUCCEEDED"`) - -* `ACTOR_BUILD_TIMED_OUT` (value: `"ACTOR.BUILD.TIMED_OUT"`) - -* `ACTOR_RUN_ABORTED` (value: `"ACTOR.RUN.ABORTED"`) - -* `ACTOR_RUN_CREATED` (value: `"ACTOR.RUN.CREATED"`) - -* `ACTOR_RUN_FAILED` (value: `"ACTOR.RUN.FAILED"`) - -* `ACTOR_RUN_RESURRECTED` (value: `"ACTOR.RUN.RESURRECTED"`) - -* `ACTOR_RUN_SUCCEEDED` (value: `"ACTOR.RUN.SUCCEEDED"`) - -* `ACTOR_RUN_TIMED_OUT` (value: `"ACTOR.RUN.TIMED_OUT"`) - -* `TEST` (value: `"TEST"`) - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/WebhookRepresentation.md b/docs/WebhookRepresentation.md deleted file mode 100644 index 3e68111..0000000 --- a/docs/WebhookRepresentation.md +++ /dev/null @@ -1,288 +0,0 @@ -# WebhookRepresentation - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**EventTypes** | [**[]WebhookEventType**](WebhookEventType.md) | | -**RequestUrl** | **string** | The URL to which the webhook sends its payload. | -**PayloadTemplate** | Pointer to **NullableString** | Optional template for the JSON payload sent by the webhook. | [optional] -**HeadersTemplate** | Pointer to **NullableString** | Optional template for the HTTP headers sent by the webhook. | [optional] -**ShouldInterpolateStrings** | Pointer to **NullableBool** | Flag to also interpolate `{{...}}` variables inside string values of the payload and headers templates. | [optional] -**IdempotencyKey** | Pointer to **NullableString** | Key that prevents creating duplicate webhooks, e.g. when the run-starting request is retried. | [optional] -**IgnoreSslErrors** | Pointer to **NullableBool** | Flag to ignore SSL errors when the webhook sends the request. | [optional] -**DoNotRetry** | Pointer to **NullableBool** | Flag to skip retrying the webhook request on failure. | [optional] - -## Methods - -### NewWebhookRepresentation - -`func NewWebhookRepresentation(eventTypes []WebhookEventType, requestUrl string, ) *WebhookRepresentation` - -NewWebhookRepresentation instantiates a new WebhookRepresentation object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewWebhookRepresentationWithDefaults - -`func NewWebhookRepresentationWithDefaults() *WebhookRepresentation` - -NewWebhookRepresentationWithDefaults instantiates a new WebhookRepresentation object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetEventTypes - -`func (o *WebhookRepresentation) GetEventTypes() []WebhookEventType` - -GetEventTypes returns the EventTypes field if non-nil, zero value otherwise. - -### GetEventTypesOk - -`func (o *WebhookRepresentation) GetEventTypesOk() (*[]WebhookEventType, bool)` - -GetEventTypesOk returns a tuple with the EventTypes field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetEventTypes - -`func (o *WebhookRepresentation) SetEventTypes(v []WebhookEventType)` - -SetEventTypes sets EventTypes field to given value. - - -### GetRequestUrl - -`func (o *WebhookRepresentation) GetRequestUrl() string` - -GetRequestUrl returns the RequestUrl field if non-nil, zero value otherwise. - -### GetRequestUrlOk - -`func (o *WebhookRepresentation) GetRequestUrlOk() (*string, bool)` - -GetRequestUrlOk returns a tuple with the RequestUrl field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetRequestUrl - -`func (o *WebhookRepresentation) SetRequestUrl(v string)` - -SetRequestUrl sets RequestUrl field to given value. - - -### GetPayloadTemplate - -`func (o *WebhookRepresentation) GetPayloadTemplate() string` - -GetPayloadTemplate returns the PayloadTemplate field if non-nil, zero value otherwise. - -### GetPayloadTemplateOk - -`func (o *WebhookRepresentation) GetPayloadTemplateOk() (*string, bool)` - -GetPayloadTemplateOk returns a tuple with the PayloadTemplate field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetPayloadTemplate - -`func (o *WebhookRepresentation) SetPayloadTemplate(v string)` - -SetPayloadTemplate sets PayloadTemplate field to given value. - -### HasPayloadTemplate - -`func (o *WebhookRepresentation) HasPayloadTemplate() bool` - -HasPayloadTemplate returns a boolean if a field has been set. - -### SetPayloadTemplateNil - -`func (o *WebhookRepresentation) SetPayloadTemplateNil(b bool)` - - SetPayloadTemplateNil sets the value for PayloadTemplate to be an explicit nil - -### UnsetPayloadTemplate -`func (o *WebhookRepresentation) UnsetPayloadTemplate()` - -UnsetPayloadTemplate ensures that no value is present for PayloadTemplate, not even an explicit nil -### GetHeadersTemplate - -`func (o *WebhookRepresentation) GetHeadersTemplate() string` - -GetHeadersTemplate returns the HeadersTemplate field if non-nil, zero value otherwise. - -### GetHeadersTemplateOk - -`func (o *WebhookRepresentation) GetHeadersTemplateOk() (*string, bool)` - -GetHeadersTemplateOk returns a tuple with the HeadersTemplate field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetHeadersTemplate - -`func (o *WebhookRepresentation) SetHeadersTemplate(v string)` - -SetHeadersTemplate sets HeadersTemplate field to given value. - -### HasHeadersTemplate - -`func (o *WebhookRepresentation) HasHeadersTemplate() bool` - -HasHeadersTemplate returns a boolean if a field has been set. - -### SetHeadersTemplateNil - -`func (o *WebhookRepresentation) SetHeadersTemplateNil(b bool)` - - SetHeadersTemplateNil sets the value for HeadersTemplate to be an explicit nil - -### UnsetHeadersTemplate -`func (o *WebhookRepresentation) UnsetHeadersTemplate()` - -UnsetHeadersTemplate ensures that no value is present for HeadersTemplate, not even an explicit nil -### GetShouldInterpolateStrings - -`func (o *WebhookRepresentation) GetShouldInterpolateStrings() bool` - -GetShouldInterpolateStrings returns the ShouldInterpolateStrings field if non-nil, zero value otherwise. - -### GetShouldInterpolateStringsOk - -`func (o *WebhookRepresentation) GetShouldInterpolateStringsOk() (*bool, bool)` - -GetShouldInterpolateStringsOk returns a tuple with the ShouldInterpolateStrings field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetShouldInterpolateStrings - -`func (o *WebhookRepresentation) SetShouldInterpolateStrings(v bool)` - -SetShouldInterpolateStrings sets ShouldInterpolateStrings field to given value. - -### HasShouldInterpolateStrings - -`func (o *WebhookRepresentation) HasShouldInterpolateStrings() bool` - -HasShouldInterpolateStrings returns a boolean if a field has been set. - -### SetShouldInterpolateStringsNil - -`func (o *WebhookRepresentation) SetShouldInterpolateStringsNil(b bool)` - - SetShouldInterpolateStringsNil sets the value for ShouldInterpolateStrings to be an explicit nil - -### UnsetShouldInterpolateStrings -`func (o *WebhookRepresentation) UnsetShouldInterpolateStrings()` - -UnsetShouldInterpolateStrings ensures that no value is present for ShouldInterpolateStrings, not even an explicit nil -### GetIdempotencyKey - -`func (o *WebhookRepresentation) GetIdempotencyKey() string` - -GetIdempotencyKey returns the IdempotencyKey field if non-nil, zero value otherwise. - -### GetIdempotencyKeyOk - -`func (o *WebhookRepresentation) GetIdempotencyKeyOk() (*string, bool)` - -GetIdempotencyKeyOk returns a tuple with the IdempotencyKey field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetIdempotencyKey - -`func (o *WebhookRepresentation) SetIdempotencyKey(v string)` - -SetIdempotencyKey sets IdempotencyKey field to given value. - -### HasIdempotencyKey - -`func (o *WebhookRepresentation) HasIdempotencyKey() bool` - -HasIdempotencyKey returns a boolean if a field has been set. - -### SetIdempotencyKeyNil - -`func (o *WebhookRepresentation) SetIdempotencyKeyNil(b bool)` - - SetIdempotencyKeyNil sets the value for IdempotencyKey to be an explicit nil - -### UnsetIdempotencyKey -`func (o *WebhookRepresentation) UnsetIdempotencyKey()` - -UnsetIdempotencyKey ensures that no value is present for IdempotencyKey, not even an explicit nil -### GetIgnoreSslErrors - -`func (o *WebhookRepresentation) GetIgnoreSslErrors() bool` - -GetIgnoreSslErrors returns the IgnoreSslErrors field if non-nil, zero value otherwise. - -### GetIgnoreSslErrorsOk - -`func (o *WebhookRepresentation) GetIgnoreSslErrorsOk() (*bool, bool)` - -GetIgnoreSslErrorsOk returns a tuple with the IgnoreSslErrors field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetIgnoreSslErrors - -`func (o *WebhookRepresentation) SetIgnoreSslErrors(v bool)` - -SetIgnoreSslErrors sets IgnoreSslErrors field to given value. - -### HasIgnoreSslErrors - -`func (o *WebhookRepresentation) HasIgnoreSslErrors() bool` - -HasIgnoreSslErrors returns a boolean if a field has been set. - -### SetIgnoreSslErrorsNil - -`func (o *WebhookRepresentation) SetIgnoreSslErrorsNil(b bool)` - - SetIgnoreSslErrorsNil sets the value for IgnoreSslErrors to be an explicit nil - -### UnsetIgnoreSslErrors -`func (o *WebhookRepresentation) UnsetIgnoreSslErrors()` - -UnsetIgnoreSslErrors ensures that no value is present for IgnoreSslErrors, not even an explicit nil -### GetDoNotRetry - -`func (o *WebhookRepresentation) GetDoNotRetry() bool` - -GetDoNotRetry returns the DoNotRetry field if non-nil, zero value otherwise. - -### GetDoNotRetryOk - -`func (o *WebhookRepresentation) GetDoNotRetryOk() (*bool, bool)` - -GetDoNotRetryOk returns a tuple with the DoNotRetry field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetDoNotRetry - -`func (o *WebhookRepresentation) SetDoNotRetry(v bool)` - -SetDoNotRetry sets DoNotRetry field to given value. - -### HasDoNotRetry - -`func (o *WebhookRepresentation) HasDoNotRetry() bool` - -HasDoNotRetry returns a boolean if a field has been set. - -### SetDoNotRetryNil - -`func (o *WebhookRepresentation) SetDoNotRetryNil(b bool)` - - SetDoNotRetryNil sets the value for DoNotRetry to be an explicit nil - -### UnsetDoNotRetry -`func (o *WebhookRepresentation) UnsetDoNotRetry()` - -UnsetDoNotRetry ensures that no value is present for DoNotRetry, not even an explicit nil - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/WebhookResponse.md b/docs/WebhookResponse.md deleted file mode 100644 index 933323b..0000000 --- a/docs/WebhookResponse.md +++ /dev/null @@ -1,51 +0,0 @@ -# WebhookResponse - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Data** | [**Webhook**](Webhook.md) | | - -## Methods - -### NewWebhookResponse - -`func NewWebhookResponse(data Webhook, ) *WebhookResponse` - -NewWebhookResponse instantiates a new WebhookResponse object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewWebhookResponseWithDefaults - -`func NewWebhookResponseWithDefaults() *WebhookResponse` - -NewWebhookResponseWithDefaults instantiates a new WebhookResponse object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetData - -`func (o *WebhookResponse) GetData() Webhook` - -GetData returns the Data field if non-nil, zero value otherwise. - -### GetDataOk - -`func (o *WebhookResponse) GetDataOk() (*Webhook, bool)` - -GetDataOk returns a tuple with the Data field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetData - -`func (o *WebhookResponse) SetData(v Webhook)` - -SetData sets Data field to given value. - - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/WebhookShort.md b/docs/WebhookShort.md deleted file mode 100644 index 92ae1d0..0000000 --- a/docs/WebhookShort.md +++ /dev/null @@ -1,441 +0,0 @@ -# WebhookShort - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Id** | **string** | | -**CreatedAt** | **time.Time** | | -**ModifiedAt** | **time.Time** | | -**UserId** | **string** | | -**IsAdHoc** | Pointer to **NullableBool** | | [optional] -**IsApifyIntegration** | Pointer to **bool** | | [optional] -**IsEnabled** | Pointer to **bool** | | [optional] -**ActionType** | Pointer to **string** | | [optional] -**ShouldInterpolateStrings** | Pointer to **NullableBool** | | [optional] -**EventTypes** | [**[]WebhookEventType**](WebhookEventType.md) | | -**Condition** | [**WebhookCondition**](WebhookCondition.md) | | -**IgnoreSslErrors** | **bool** | | -**DoNotRetry** | **bool** | | -**RequestUrl** | **string** | | -**LastDispatch** | Pointer to [**NullableExampleWebhookDispatch**](ExampleWebhookDispatch.md) | | [optional] -**Stats** | Pointer to [**NullableWebhookStats**](WebhookStats.md) | | [optional] - -## Methods - -### NewWebhookShort - -`func NewWebhookShort(id string, createdAt time.Time, modifiedAt time.Time, userId string, eventTypes []WebhookEventType, condition WebhookCondition, ignoreSslErrors bool, doNotRetry bool, requestUrl string, ) *WebhookShort` - -NewWebhookShort instantiates a new WebhookShort object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewWebhookShortWithDefaults - -`func NewWebhookShortWithDefaults() *WebhookShort` - -NewWebhookShortWithDefaults instantiates a new WebhookShort object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetId - -`func (o *WebhookShort) GetId() string` - -GetId returns the Id field if non-nil, zero value otherwise. - -### GetIdOk - -`func (o *WebhookShort) GetIdOk() (*string, bool)` - -GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetId - -`func (o *WebhookShort) SetId(v string)` - -SetId sets Id field to given value. - - -### GetCreatedAt - -`func (o *WebhookShort) GetCreatedAt() time.Time` - -GetCreatedAt returns the CreatedAt field if non-nil, zero value otherwise. - -### GetCreatedAtOk - -`func (o *WebhookShort) GetCreatedAtOk() (*time.Time, bool)` - -GetCreatedAtOk returns a tuple with the CreatedAt field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetCreatedAt - -`func (o *WebhookShort) SetCreatedAt(v time.Time)` - -SetCreatedAt sets CreatedAt field to given value. - - -### GetModifiedAt - -`func (o *WebhookShort) GetModifiedAt() time.Time` - -GetModifiedAt returns the ModifiedAt field if non-nil, zero value otherwise. - -### GetModifiedAtOk - -`func (o *WebhookShort) GetModifiedAtOk() (*time.Time, bool)` - -GetModifiedAtOk returns a tuple with the ModifiedAt field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetModifiedAt - -`func (o *WebhookShort) SetModifiedAt(v time.Time)` - -SetModifiedAt sets ModifiedAt field to given value. - - -### GetUserId - -`func (o *WebhookShort) GetUserId() string` - -GetUserId returns the UserId field if non-nil, zero value otherwise. - -### GetUserIdOk - -`func (o *WebhookShort) GetUserIdOk() (*string, bool)` - -GetUserIdOk returns a tuple with the UserId field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetUserId - -`func (o *WebhookShort) SetUserId(v string)` - -SetUserId sets UserId field to given value. - - -### GetIsAdHoc - -`func (o *WebhookShort) GetIsAdHoc() bool` - -GetIsAdHoc returns the IsAdHoc field if non-nil, zero value otherwise. - -### GetIsAdHocOk - -`func (o *WebhookShort) GetIsAdHocOk() (*bool, bool)` - -GetIsAdHocOk returns a tuple with the IsAdHoc field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetIsAdHoc - -`func (o *WebhookShort) SetIsAdHoc(v bool)` - -SetIsAdHoc sets IsAdHoc field to given value. - -### HasIsAdHoc - -`func (o *WebhookShort) HasIsAdHoc() bool` - -HasIsAdHoc returns a boolean if a field has been set. - -### SetIsAdHocNil - -`func (o *WebhookShort) SetIsAdHocNil(b bool)` - - SetIsAdHocNil sets the value for IsAdHoc to be an explicit nil - -### UnsetIsAdHoc -`func (o *WebhookShort) UnsetIsAdHoc()` - -UnsetIsAdHoc ensures that no value is present for IsAdHoc, not even an explicit nil -### GetIsApifyIntegration - -`func (o *WebhookShort) GetIsApifyIntegration() bool` - -GetIsApifyIntegration returns the IsApifyIntegration field if non-nil, zero value otherwise. - -### GetIsApifyIntegrationOk - -`func (o *WebhookShort) GetIsApifyIntegrationOk() (*bool, bool)` - -GetIsApifyIntegrationOk returns a tuple with the IsApifyIntegration field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetIsApifyIntegration - -`func (o *WebhookShort) SetIsApifyIntegration(v bool)` - -SetIsApifyIntegration sets IsApifyIntegration field to given value. - -### HasIsApifyIntegration - -`func (o *WebhookShort) HasIsApifyIntegration() bool` - -HasIsApifyIntegration returns a boolean if a field has been set. - -### GetIsEnabled - -`func (o *WebhookShort) GetIsEnabled() bool` - -GetIsEnabled returns the IsEnabled field if non-nil, zero value otherwise. - -### GetIsEnabledOk - -`func (o *WebhookShort) GetIsEnabledOk() (*bool, bool)` - -GetIsEnabledOk returns a tuple with the IsEnabled field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetIsEnabled - -`func (o *WebhookShort) SetIsEnabled(v bool)` - -SetIsEnabled sets IsEnabled field to given value. - -### HasIsEnabled - -`func (o *WebhookShort) HasIsEnabled() bool` - -HasIsEnabled returns a boolean if a field has been set. - -### GetActionType - -`func (o *WebhookShort) GetActionType() string` - -GetActionType returns the ActionType field if non-nil, zero value otherwise. - -### GetActionTypeOk - -`func (o *WebhookShort) GetActionTypeOk() (*string, bool)` - -GetActionTypeOk returns a tuple with the ActionType field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetActionType - -`func (o *WebhookShort) SetActionType(v string)` - -SetActionType sets ActionType field to given value. - -### HasActionType - -`func (o *WebhookShort) HasActionType() bool` - -HasActionType returns a boolean if a field has been set. - -### GetShouldInterpolateStrings - -`func (o *WebhookShort) GetShouldInterpolateStrings() bool` - -GetShouldInterpolateStrings returns the ShouldInterpolateStrings field if non-nil, zero value otherwise. - -### GetShouldInterpolateStringsOk - -`func (o *WebhookShort) GetShouldInterpolateStringsOk() (*bool, bool)` - -GetShouldInterpolateStringsOk returns a tuple with the ShouldInterpolateStrings field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetShouldInterpolateStrings - -`func (o *WebhookShort) SetShouldInterpolateStrings(v bool)` - -SetShouldInterpolateStrings sets ShouldInterpolateStrings field to given value. - -### HasShouldInterpolateStrings - -`func (o *WebhookShort) HasShouldInterpolateStrings() bool` - -HasShouldInterpolateStrings returns a boolean if a field has been set. - -### SetShouldInterpolateStringsNil - -`func (o *WebhookShort) SetShouldInterpolateStringsNil(b bool)` - - SetShouldInterpolateStringsNil sets the value for ShouldInterpolateStrings to be an explicit nil - -### UnsetShouldInterpolateStrings -`func (o *WebhookShort) UnsetShouldInterpolateStrings()` - -UnsetShouldInterpolateStrings ensures that no value is present for ShouldInterpolateStrings, not even an explicit nil -### GetEventTypes - -`func (o *WebhookShort) GetEventTypes() []WebhookEventType` - -GetEventTypes returns the EventTypes field if non-nil, zero value otherwise. - -### GetEventTypesOk - -`func (o *WebhookShort) GetEventTypesOk() (*[]WebhookEventType, bool)` - -GetEventTypesOk returns a tuple with the EventTypes field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetEventTypes - -`func (o *WebhookShort) SetEventTypes(v []WebhookEventType)` - -SetEventTypes sets EventTypes field to given value. - - -### GetCondition - -`func (o *WebhookShort) GetCondition() WebhookCondition` - -GetCondition returns the Condition field if non-nil, zero value otherwise. - -### GetConditionOk - -`func (o *WebhookShort) GetConditionOk() (*WebhookCondition, bool)` - -GetConditionOk returns a tuple with the Condition field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetCondition - -`func (o *WebhookShort) SetCondition(v WebhookCondition)` - -SetCondition sets Condition field to given value. - - -### GetIgnoreSslErrors - -`func (o *WebhookShort) GetIgnoreSslErrors() bool` - -GetIgnoreSslErrors returns the IgnoreSslErrors field if non-nil, zero value otherwise. - -### GetIgnoreSslErrorsOk - -`func (o *WebhookShort) GetIgnoreSslErrorsOk() (*bool, bool)` - -GetIgnoreSslErrorsOk returns a tuple with the IgnoreSslErrors field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetIgnoreSslErrors - -`func (o *WebhookShort) SetIgnoreSslErrors(v bool)` - -SetIgnoreSslErrors sets IgnoreSslErrors field to given value. - - -### GetDoNotRetry - -`func (o *WebhookShort) GetDoNotRetry() bool` - -GetDoNotRetry returns the DoNotRetry field if non-nil, zero value otherwise. - -### GetDoNotRetryOk - -`func (o *WebhookShort) GetDoNotRetryOk() (*bool, bool)` - -GetDoNotRetryOk returns a tuple with the DoNotRetry field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetDoNotRetry - -`func (o *WebhookShort) SetDoNotRetry(v bool)` - -SetDoNotRetry sets DoNotRetry field to given value. - - -### GetRequestUrl - -`func (o *WebhookShort) GetRequestUrl() string` - -GetRequestUrl returns the RequestUrl field if non-nil, zero value otherwise. - -### GetRequestUrlOk - -`func (o *WebhookShort) GetRequestUrlOk() (*string, bool)` - -GetRequestUrlOk returns a tuple with the RequestUrl field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetRequestUrl - -`func (o *WebhookShort) SetRequestUrl(v string)` - -SetRequestUrl sets RequestUrl field to given value. - - -### GetLastDispatch - -`func (o *WebhookShort) GetLastDispatch() ExampleWebhookDispatch` - -GetLastDispatch returns the LastDispatch field if non-nil, zero value otherwise. - -### GetLastDispatchOk - -`func (o *WebhookShort) GetLastDispatchOk() (*ExampleWebhookDispatch, bool)` - -GetLastDispatchOk returns a tuple with the LastDispatch field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetLastDispatch - -`func (o *WebhookShort) SetLastDispatch(v ExampleWebhookDispatch)` - -SetLastDispatch sets LastDispatch field to given value. - -### HasLastDispatch - -`func (o *WebhookShort) HasLastDispatch() bool` - -HasLastDispatch returns a boolean if a field has been set. - -### SetLastDispatchNil - -`func (o *WebhookShort) SetLastDispatchNil(b bool)` - - SetLastDispatchNil sets the value for LastDispatch to be an explicit nil - -### UnsetLastDispatch -`func (o *WebhookShort) UnsetLastDispatch()` - -UnsetLastDispatch ensures that no value is present for LastDispatch, not even an explicit nil -### GetStats - -`func (o *WebhookShort) GetStats() WebhookStats` - -GetStats returns the Stats field if non-nil, zero value otherwise. - -### GetStatsOk - -`func (o *WebhookShort) GetStatsOk() (*WebhookStats, bool)` - -GetStatsOk returns a tuple with the Stats field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetStats - -`func (o *WebhookShort) SetStats(v WebhookStats)` - -SetStats sets Stats field to given value. - -### HasStats - -`func (o *WebhookShort) HasStats() bool` - -HasStats returns a boolean if a field has been set. - -### SetStatsNil - -`func (o *WebhookShort) SetStatsNil(b bool)` - - SetStatsNil sets the value for Stats to be an explicit nil - -### UnsetStats -`func (o *WebhookShort) UnsetStats()` - -UnsetStats ensures that no value is present for Stats, not even an explicit nil - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/WebhookStats.md b/docs/WebhookStats.md deleted file mode 100644 index 72e1f31..0000000 --- a/docs/WebhookStats.md +++ /dev/null @@ -1,51 +0,0 @@ -# WebhookStats - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**TotalDispatches** | **int32** | | - -## Methods - -### NewWebhookStats - -`func NewWebhookStats(totalDispatches int32, ) *WebhookStats` - -NewWebhookStats instantiates a new WebhookStats object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewWebhookStatsWithDefaults - -`func NewWebhookStatsWithDefaults() *WebhookStats` - -NewWebhookStatsWithDefaults instantiates a new WebhookStats object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetTotalDispatches - -`func (o *WebhookStats) GetTotalDispatches() int32` - -GetTotalDispatches returns the TotalDispatches field if non-nil, zero value otherwise. - -### GetTotalDispatchesOk - -`func (o *WebhookStats) GetTotalDispatchesOk() (*int32, bool)` - -GetTotalDispatchesOk returns a tuple with the TotalDispatches field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetTotalDispatches - -`func (o *WebhookStats) SetTotalDispatches(v int32)` - -SetTotalDispatches sets TotalDispatches field to given value. - - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/WebhookUpdate.md b/docs/WebhookUpdate.md deleted file mode 100644 index 32810d4..0000000 --- a/docs/WebhookUpdate.md +++ /dev/null @@ -1,390 +0,0 @@ -# WebhookUpdate - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**IsAdHoc** | Pointer to **NullableBool** | | [optional] -**EventTypes** | Pointer to [**[]WebhookEventType**](WebhookEventType.md) | | [optional] -**Condition** | Pointer to [**NullableWebhookCondition**](WebhookCondition.md) | | [optional] -**IgnoreSslErrors** | Pointer to **NullableBool** | | [optional] -**DoNotRetry** | Pointer to **NullableBool** | | [optional] -**RequestUrl** | Pointer to **NullableString** | | [optional] -**PayloadTemplate** | Pointer to **NullableString** | | [optional] -**HeadersTemplate** | Pointer to **NullableString** | | [optional] -**Description** | Pointer to **NullableString** | | [optional] -**ShouldInterpolateStrings** | Pointer to **NullableBool** | | [optional] - -## Methods - -### NewWebhookUpdate - -`func NewWebhookUpdate() *WebhookUpdate` - -NewWebhookUpdate instantiates a new WebhookUpdate object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewWebhookUpdateWithDefaults - -`func NewWebhookUpdateWithDefaults() *WebhookUpdate` - -NewWebhookUpdateWithDefaults instantiates a new WebhookUpdate object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetIsAdHoc - -`func (o *WebhookUpdate) GetIsAdHoc() bool` - -GetIsAdHoc returns the IsAdHoc field if non-nil, zero value otherwise. - -### GetIsAdHocOk - -`func (o *WebhookUpdate) GetIsAdHocOk() (*bool, bool)` - -GetIsAdHocOk returns a tuple with the IsAdHoc field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetIsAdHoc - -`func (o *WebhookUpdate) SetIsAdHoc(v bool)` - -SetIsAdHoc sets IsAdHoc field to given value. - -### HasIsAdHoc - -`func (o *WebhookUpdate) HasIsAdHoc() bool` - -HasIsAdHoc returns a boolean if a field has been set. - -### SetIsAdHocNil - -`func (o *WebhookUpdate) SetIsAdHocNil(b bool)` - - SetIsAdHocNil sets the value for IsAdHoc to be an explicit nil - -### UnsetIsAdHoc -`func (o *WebhookUpdate) UnsetIsAdHoc()` - -UnsetIsAdHoc ensures that no value is present for IsAdHoc, not even an explicit nil -### GetEventTypes - -`func (o *WebhookUpdate) GetEventTypes() []WebhookEventType` - -GetEventTypes returns the EventTypes field if non-nil, zero value otherwise. - -### GetEventTypesOk - -`func (o *WebhookUpdate) GetEventTypesOk() (*[]WebhookEventType, bool)` - -GetEventTypesOk returns a tuple with the EventTypes field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetEventTypes - -`func (o *WebhookUpdate) SetEventTypes(v []WebhookEventType)` - -SetEventTypes sets EventTypes field to given value. - -### HasEventTypes - -`func (o *WebhookUpdate) HasEventTypes() bool` - -HasEventTypes returns a boolean if a field has been set. - -### SetEventTypesNil - -`func (o *WebhookUpdate) SetEventTypesNil(b bool)` - - SetEventTypesNil sets the value for EventTypes to be an explicit nil - -### UnsetEventTypes -`func (o *WebhookUpdate) UnsetEventTypes()` - -UnsetEventTypes ensures that no value is present for EventTypes, not even an explicit nil -### GetCondition - -`func (o *WebhookUpdate) GetCondition() WebhookCondition` - -GetCondition returns the Condition field if non-nil, zero value otherwise. - -### GetConditionOk - -`func (o *WebhookUpdate) GetConditionOk() (*WebhookCondition, bool)` - -GetConditionOk returns a tuple with the Condition field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetCondition - -`func (o *WebhookUpdate) SetCondition(v WebhookCondition)` - -SetCondition sets Condition field to given value. - -### HasCondition - -`func (o *WebhookUpdate) HasCondition() bool` - -HasCondition returns a boolean if a field has been set. - -### SetConditionNil - -`func (o *WebhookUpdate) SetConditionNil(b bool)` - - SetConditionNil sets the value for Condition to be an explicit nil - -### UnsetCondition -`func (o *WebhookUpdate) UnsetCondition()` - -UnsetCondition ensures that no value is present for Condition, not even an explicit nil -### GetIgnoreSslErrors - -`func (o *WebhookUpdate) GetIgnoreSslErrors() bool` - -GetIgnoreSslErrors returns the IgnoreSslErrors field if non-nil, zero value otherwise. - -### GetIgnoreSslErrorsOk - -`func (o *WebhookUpdate) GetIgnoreSslErrorsOk() (*bool, bool)` - -GetIgnoreSslErrorsOk returns a tuple with the IgnoreSslErrors field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetIgnoreSslErrors - -`func (o *WebhookUpdate) SetIgnoreSslErrors(v bool)` - -SetIgnoreSslErrors sets IgnoreSslErrors field to given value. - -### HasIgnoreSslErrors - -`func (o *WebhookUpdate) HasIgnoreSslErrors() bool` - -HasIgnoreSslErrors returns a boolean if a field has been set. - -### SetIgnoreSslErrorsNil - -`func (o *WebhookUpdate) SetIgnoreSslErrorsNil(b bool)` - - SetIgnoreSslErrorsNil sets the value for IgnoreSslErrors to be an explicit nil - -### UnsetIgnoreSslErrors -`func (o *WebhookUpdate) UnsetIgnoreSslErrors()` - -UnsetIgnoreSslErrors ensures that no value is present for IgnoreSslErrors, not even an explicit nil -### GetDoNotRetry - -`func (o *WebhookUpdate) GetDoNotRetry() bool` - -GetDoNotRetry returns the DoNotRetry field if non-nil, zero value otherwise. - -### GetDoNotRetryOk - -`func (o *WebhookUpdate) GetDoNotRetryOk() (*bool, bool)` - -GetDoNotRetryOk returns a tuple with the DoNotRetry field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetDoNotRetry - -`func (o *WebhookUpdate) SetDoNotRetry(v bool)` - -SetDoNotRetry sets DoNotRetry field to given value. - -### HasDoNotRetry - -`func (o *WebhookUpdate) HasDoNotRetry() bool` - -HasDoNotRetry returns a boolean if a field has been set. - -### SetDoNotRetryNil - -`func (o *WebhookUpdate) SetDoNotRetryNil(b bool)` - - SetDoNotRetryNil sets the value for DoNotRetry to be an explicit nil - -### UnsetDoNotRetry -`func (o *WebhookUpdate) UnsetDoNotRetry()` - -UnsetDoNotRetry ensures that no value is present for DoNotRetry, not even an explicit nil -### GetRequestUrl - -`func (o *WebhookUpdate) GetRequestUrl() string` - -GetRequestUrl returns the RequestUrl field if non-nil, zero value otherwise. - -### GetRequestUrlOk - -`func (o *WebhookUpdate) GetRequestUrlOk() (*string, bool)` - -GetRequestUrlOk returns a tuple with the RequestUrl field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetRequestUrl - -`func (o *WebhookUpdate) SetRequestUrl(v string)` - -SetRequestUrl sets RequestUrl field to given value. - -### HasRequestUrl - -`func (o *WebhookUpdate) HasRequestUrl() bool` - -HasRequestUrl returns a boolean if a field has been set. - -### SetRequestUrlNil - -`func (o *WebhookUpdate) SetRequestUrlNil(b bool)` - - SetRequestUrlNil sets the value for RequestUrl to be an explicit nil - -### UnsetRequestUrl -`func (o *WebhookUpdate) UnsetRequestUrl()` - -UnsetRequestUrl ensures that no value is present for RequestUrl, not even an explicit nil -### GetPayloadTemplate - -`func (o *WebhookUpdate) GetPayloadTemplate() string` - -GetPayloadTemplate returns the PayloadTemplate field if non-nil, zero value otherwise. - -### GetPayloadTemplateOk - -`func (o *WebhookUpdate) GetPayloadTemplateOk() (*string, bool)` - -GetPayloadTemplateOk returns a tuple with the PayloadTemplate field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetPayloadTemplate - -`func (o *WebhookUpdate) SetPayloadTemplate(v string)` - -SetPayloadTemplate sets PayloadTemplate field to given value. - -### HasPayloadTemplate - -`func (o *WebhookUpdate) HasPayloadTemplate() bool` - -HasPayloadTemplate returns a boolean if a field has been set. - -### SetPayloadTemplateNil - -`func (o *WebhookUpdate) SetPayloadTemplateNil(b bool)` - - SetPayloadTemplateNil sets the value for PayloadTemplate to be an explicit nil - -### UnsetPayloadTemplate -`func (o *WebhookUpdate) UnsetPayloadTemplate()` - -UnsetPayloadTemplate ensures that no value is present for PayloadTemplate, not even an explicit nil -### GetHeadersTemplate - -`func (o *WebhookUpdate) GetHeadersTemplate() string` - -GetHeadersTemplate returns the HeadersTemplate field if non-nil, zero value otherwise. - -### GetHeadersTemplateOk - -`func (o *WebhookUpdate) GetHeadersTemplateOk() (*string, bool)` - -GetHeadersTemplateOk returns a tuple with the HeadersTemplate field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetHeadersTemplate - -`func (o *WebhookUpdate) SetHeadersTemplate(v string)` - -SetHeadersTemplate sets HeadersTemplate field to given value. - -### HasHeadersTemplate - -`func (o *WebhookUpdate) HasHeadersTemplate() bool` - -HasHeadersTemplate returns a boolean if a field has been set. - -### SetHeadersTemplateNil - -`func (o *WebhookUpdate) SetHeadersTemplateNil(b bool)` - - SetHeadersTemplateNil sets the value for HeadersTemplate to be an explicit nil - -### UnsetHeadersTemplate -`func (o *WebhookUpdate) UnsetHeadersTemplate()` - -UnsetHeadersTemplate ensures that no value is present for HeadersTemplate, not even an explicit nil -### GetDescription - -`func (o *WebhookUpdate) GetDescription() string` - -GetDescription returns the Description field if non-nil, zero value otherwise. - -### GetDescriptionOk - -`func (o *WebhookUpdate) GetDescriptionOk() (*string, bool)` - -GetDescriptionOk returns a tuple with the Description field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetDescription - -`func (o *WebhookUpdate) SetDescription(v string)` - -SetDescription sets Description field to given value. - -### HasDescription - -`func (o *WebhookUpdate) HasDescription() bool` - -HasDescription returns a boolean if a field has been set. - -### SetDescriptionNil - -`func (o *WebhookUpdate) SetDescriptionNil(b bool)` - - SetDescriptionNil sets the value for Description to be an explicit nil - -### UnsetDescription -`func (o *WebhookUpdate) UnsetDescription()` - -UnsetDescription ensures that no value is present for Description, not even an explicit nil -### GetShouldInterpolateStrings - -`func (o *WebhookUpdate) GetShouldInterpolateStrings() bool` - -GetShouldInterpolateStrings returns the ShouldInterpolateStrings field if non-nil, zero value otherwise. - -### GetShouldInterpolateStringsOk - -`func (o *WebhookUpdate) GetShouldInterpolateStringsOk() (*bool, bool)` - -GetShouldInterpolateStringsOk returns a tuple with the ShouldInterpolateStrings field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetShouldInterpolateStrings - -`func (o *WebhookUpdate) SetShouldInterpolateStrings(v bool)` - -SetShouldInterpolateStrings sets ShouldInterpolateStrings field to given value. - -### HasShouldInterpolateStrings - -`func (o *WebhookUpdate) HasShouldInterpolateStrings() bool` - -HasShouldInterpolateStrings returns a boolean if a field has been set. - -### SetShouldInterpolateStringsNil - -`func (o *WebhookUpdate) SetShouldInterpolateStringsNil(b bool)` - - SetShouldInterpolateStringsNil sets the value for ShouldInterpolateStrings to be an explicit nil - -### UnsetShouldInterpolateStrings -`func (o *WebhookUpdate) UnsetShouldInterpolateStrings()` - -UnsetShouldInterpolateStrings ensures that no value is present for ShouldInterpolateStrings, not even an explicit nil - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/WebhooksWebhookDispatchesAPI.md b/docs/WebhooksWebhookDispatchesAPI.md deleted file mode 100644 index a02b7ee..0000000 --- a/docs/WebhooksWebhookDispatchesAPI.md +++ /dev/null @@ -1,150 +0,0 @@ -# \WebhooksWebhookDispatchesAPI - -All URIs are relative to *https://api.apify.com* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**WebhookDispatchGet**](WebhooksWebhookDispatchesAPI.md#WebhookDispatchGet) | **Get** /v2/webhook-dispatches/{dispatchId} | Get webhook dispatch -[**WebhookDispatchesGet**](WebhooksWebhookDispatchesAPI.md#WebhookDispatchesGet) | **Get** /v2/webhook-dispatches | Get list of webhook dispatches - - - -## WebhookDispatchGet - -> WebhookDispatchResponse WebhookDispatchGet(ctx, dispatchId).Execute() - -Get webhook dispatch - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - dispatchId := "Zib4xbZsmvZeK55ua" // string | Webhook dispatch ID. - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.WebhooksWebhookDispatchesAPI.WebhookDispatchGet(context.Background(), dispatchId).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `WebhooksWebhookDispatchesAPI.WebhookDispatchGet``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `WebhookDispatchGet`: WebhookDispatchResponse - fmt.Fprintf(os.Stdout, "Response from `WebhooksWebhookDispatchesAPI.WebhookDispatchGet`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**dispatchId** | **string** | Webhook dispatch ID. | - -### Other Parameters - -Other parameters are passed through a pointer to a apiWebhookDispatchGetRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - -### Return type - -[**WebhookDispatchResponse**](WebhookDispatchResponse.md) - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## WebhookDispatchesGet - -> ListOfWebhookDispatchesResponse WebhookDispatchesGet(ctx).Offset(offset).Limit(limit).Desc(desc).Execute() - -Get list of webhook dispatches - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - offset := float64(0) // float64 | Number of items that should be skipped at the start. The default value is `0`. (optional) - limit := float64(1000) // float64 | Maximum number of items to return. The default value as well as the maximum is `1000`. (optional) - desc := true // bool | If `true` or `1` then the objects are sorted by the `createdAt` field in descending order. By default, they are sorted in ascending order. (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.WebhooksWebhookDispatchesAPI.WebhookDispatchesGet(context.Background()).Offset(offset).Limit(limit).Desc(desc).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `WebhooksWebhookDispatchesAPI.WebhookDispatchesGet``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `WebhookDispatchesGet`: ListOfWebhookDispatchesResponse - fmt.Fprintf(os.Stdout, "Response from `WebhooksWebhookDispatchesAPI.WebhookDispatchesGet`: %v\n", resp) -} -``` - -### Path Parameters - - - -### Other Parameters - -Other parameters are passed through a pointer to a apiWebhookDispatchesGetRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **offset** | **float64** | Number of items that should be skipped at the start. The default value is `0`. | - **limit** | **float64** | Maximum number of items to return. The default value as well as the maximum is `1000`. | - **desc** | **bool** | If `true` or `1` then the objects are sorted by the `createdAt` field in descending order. By default, they are sorted in ascending order. | - -### Return type - -[**ListOfWebhookDispatchesResponse**](ListOfWebhookDispatchesResponse.md) - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - diff --git a/docs/WebhooksWebhooksAPI.md b/docs/WebhooksWebhooksAPI.md deleted file mode 100644 index e4ec489..0000000 --- a/docs/WebhooksWebhooksAPI.md +++ /dev/null @@ -1,503 +0,0 @@ -# \WebhooksWebhooksAPI - -All URIs are relative to *https://api.apify.com* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**WebhookDelete**](WebhooksWebhooksAPI.md#WebhookDelete) | **Delete** /v2/webhooks/{webhookId} | Delete webhook -[**WebhookGet**](WebhooksWebhooksAPI.md#WebhookGet) | **Get** /v2/webhooks/{webhookId} | Get webhook -[**WebhookPut**](WebhooksWebhooksAPI.md#WebhookPut) | **Put** /v2/webhooks/{webhookId} | Update webhook -[**WebhookTestPost**](WebhooksWebhooksAPI.md#WebhookTestPost) | **Post** /v2/webhooks/{webhookId}/test | Test webhook -[**WebhookWebhookDispatchesGet**](WebhooksWebhooksAPI.md#WebhookWebhookDispatchesGet) | **Get** /v2/webhooks/{webhookId}/dispatches | Get collection -[**WebhooksGet**](WebhooksWebhooksAPI.md#WebhooksGet) | **Get** /v2/webhooks | Get list of webhooks -[**WebhooksPost**](WebhooksWebhooksAPI.md#WebhooksPost) | **Post** /v2/webhooks | Create webhook - - - -## WebhookDelete - -> map[string]interface{} WebhookDelete(ctx, webhookId).Execute() - -Delete webhook - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - webhookId := "pVJtoTelgYUq4qJOt" // string | Webhook ID. - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.WebhooksWebhooksAPI.WebhookDelete(context.Background(), webhookId).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `WebhooksWebhooksAPI.WebhookDelete``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `WebhookDelete`: map[string]interface{} - fmt.Fprintf(os.Stdout, "Response from `WebhooksWebhooksAPI.WebhookDelete`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**webhookId** | **string** | Webhook ID. | - -### Other Parameters - -Other parameters are passed through a pointer to a apiWebhookDeleteRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - -### Return type - -**map[string]interface{}** - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## WebhookGet - -> WebhookResponse WebhookGet(ctx, webhookId).Execute() - -Get webhook - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - webhookId := "pVJtoTelgYUq4qJOt" // string | Webhook ID. - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.WebhooksWebhooksAPI.WebhookGet(context.Background(), webhookId).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `WebhooksWebhooksAPI.WebhookGet``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `WebhookGet`: WebhookResponse - fmt.Fprintf(os.Stdout, "Response from `WebhooksWebhooksAPI.WebhookGet`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**webhookId** | **string** | Webhook ID. | - -### Other Parameters - -Other parameters are passed through a pointer to a apiWebhookGetRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - -### Return type - -[**WebhookResponse**](WebhookResponse.md) - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## WebhookPut - -> WebhookResponse WebhookPut(ctx, webhookId).WebhookUpdate(webhookUpdate).Execute() - -Update webhook - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - webhookId := "pVJtoTelgYUq4qJOt" // string | Webhook ID. - webhookUpdate := *openapiclient.NewWebhookUpdate() // WebhookUpdate | - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.WebhooksWebhooksAPI.WebhookPut(context.Background(), webhookId).WebhookUpdate(webhookUpdate).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `WebhooksWebhooksAPI.WebhookPut``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `WebhookPut`: WebhookResponse - fmt.Fprintf(os.Stdout, "Response from `WebhooksWebhooksAPI.WebhookPut`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**webhookId** | **string** | Webhook ID. | - -### Other Parameters - -Other parameters are passed through a pointer to a apiWebhookPutRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - **webhookUpdate** | [**WebhookUpdate**](WebhookUpdate.md) | | - -### Return type - -[**WebhookResponse**](WebhookResponse.md) - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## WebhookTestPost - -> TestWebhookResponse WebhookTestPost(ctx, webhookId).Execute() - -Test webhook - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - webhookId := "pVJtoTelgYUq4qJOt" // string | Webhook ID. - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.WebhooksWebhooksAPI.WebhookTestPost(context.Background(), webhookId).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `WebhooksWebhooksAPI.WebhookTestPost``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `WebhookTestPost`: TestWebhookResponse - fmt.Fprintf(os.Stdout, "Response from `WebhooksWebhooksAPI.WebhookTestPost`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**webhookId** | **string** | Webhook ID. | - -### Other Parameters - -Other parameters are passed through a pointer to a apiWebhookTestPostRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - -### Return type - -[**TestWebhookResponse**](TestWebhookResponse.md) - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## WebhookWebhookDispatchesGet - -> ListOfWebhookDispatchesResponse WebhookWebhookDispatchesGet(ctx, webhookId).Execute() - -Get collection - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - webhookId := "pVJtoTelgYUq4qJOt" // string | Webhook ID. - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.WebhooksWebhooksAPI.WebhookWebhookDispatchesGet(context.Background(), webhookId).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `WebhooksWebhooksAPI.WebhookWebhookDispatchesGet``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `WebhookWebhookDispatchesGet`: ListOfWebhookDispatchesResponse - fmt.Fprintf(os.Stdout, "Response from `WebhooksWebhooksAPI.WebhookWebhookDispatchesGet`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**webhookId** | **string** | Webhook ID. | - -### Other Parameters - -Other parameters are passed through a pointer to a apiWebhookWebhookDispatchesGetRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - -### Return type - -[**ListOfWebhookDispatchesResponse**](ListOfWebhookDispatchesResponse.md) - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## WebhooksGet - -> ListOfWebhooksResponse WebhooksGet(ctx).Offset(offset).Limit(limit).Desc(desc).Execute() - -Get list of webhooks - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - offset := float64(0) // float64 | Number of items that should be skipped at the start. The default value is `0`. (optional) - limit := float64(1000) // float64 | Maximum number of items to return. The default value as well as the maximum is `1000`. (optional) - desc := true // bool | If `true` or `1` then the objects are sorted by the `createdAt` field in descending order. By default, they are sorted in ascending order. (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.WebhooksWebhooksAPI.WebhooksGet(context.Background()).Offset(offset).Limit(limit).Desc(desc).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `WebhooksWebhooksAPI.WebhooksGet``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `WebhooksGet`: ListOfWebhooksResponse - fmt.Fprintf(os.Stdout, "Response from `WebhooksWebhooksAPI.WebhooksGet`: %v\n", resp) -} -``` - -### Path Parameters - - - -### Other Parameters - -Other parameters are passed through a pointer to a apiWebhooksGetRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **offset** | **float64** | Number of items that should be skipped at the start. The default value is `0`. | - **limit** | **float64** | Maximum number of items to return. The default value as well as the maximum is `1000`. | - **desc** | **bool** | If `true` or `1` then the objects are sorted by the `createdAt` field in descending order. By default, they are sorted in ascending order. | - -### Return type - -[**ListOfWebhooksResponse**](ListOfWebhooksResponse.md) - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## WebhooksPost - -> WebhookResponse WebhooksPost(ctx).WebhookCreate(webhookCreate).Execute() - -Create webhook - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/apify/apify-client-go" -) - -func main() { - webhookCreate := *openapiclient.NewWebhookCreate([]openapiclient.WebhookEventType{openapiclient.WebhookEventType("ACTOR.BUILD.ABORTED")}, *openapiclient.NewWebhookCondition(), "RequestUrl_example") // WebhookCreate | - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.WebhooksWebhooksAPI.WebhooksPost(context.Background()).WebhookCreate(webhookCreate).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `WebhooksWebhooksAPI.WebhooksPost``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `WebhooksPost`: WebhookResponse - fmt.Fprintf(os.Stdout, "Response from `WebhooksWebhooksAPI.WebhooksPost`: %v\n", resp) -} -``` - -### Path Parameters - - - -### Other Parameters - -Other parameters are passed through a pointer to a apiWebhooksPostRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **webhookCreate** | [**WebhookCreate**](WebhookCreate.md) | | - -### Return type - -[**WebhookResponse**](WebhookResponse.md) - -### Authorization - -[apiKey](../README.md#apiKey), [httpBearer](../README.md#httpBearer) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - diff --git a/docs/actors.md b/docs/actors.md new file mode 100644 index 0000000..e96a008 --- /dev/null +++ b/docs/actors.md @@ -0,0 +1,69 @@ +# Actors + +Actors are the programs that run on the Apify platform. Access the Actor collection with +`client.Actors()` and a single Actor with `client.Actor(id)`, where `id` is the Actor ID or +`username~name`. + +## Actor collection + +| Method | Description | +| --- | --- | +| `List(ctx, ActorListOptions) (PaginationList[Actor], error)` | List the account's Actors. | +| `Create(ctx, definition any) (Actor, error)` | Create a new Actor. | + +`ActorListOptions`: `Offset`, `Limit`, `Desc`, `My`, `SortBy` (all optional pointers). + +```go +page, err := client.Actors().List(ctx, apify.ActorListOptions{My: ptr(true), Limit: ptr(int64(10))}) +``` + +## Single Actor + +| Method | Description | +| --- | --- | +| `Get(ctx) (Actor, bool, error)` | Fetch the Actor. | +| `Update(ctx, newFields any) (Actor, error)` | Update the Actor. | +| `Delete(ctx) error` | Delete the Actor. | +| `Start(ctx, input any, ActorStartOptions) (ActorRun, error)` | Start a run, return immediately. | +| `Call(ctx, input any, ActorStartOptions, waitSecs *int64) (ActorRun, error)` | Start and wait for the run to finish. | +| `Build(ctx, versionNumber string, ActorBuildOptions) (Build, error)` | Build a version. | +| `DefaultBuild(ctx, waitForFinish *int64) (*BuildClient, error)` | Resolve the default build. | +| `ValidateInput(ctx, input any) (json.RawMessage, error)` | Validate input against the schema. | +| `LastRun(status string) *RunClient` | Client for the last run (optional status filter). | +| `Builds() *BuildCollectionClient` | This Actor's builds. | +| `Runs() *RunCollectionClient` | This Actor's runs. | +| `Version(n) *ActorVersionClient` / `Versions() *ActorVersionCollectionClient` | Versions. | +| `Webhooks() *WebhookCollectionClient` | This Actor's webhooks. | + +`ActorStartOptions`: `Build`, `MemoryMbytes`, `TimeoutSecs`, `WaitForFinish`, `MaxItems`, +`MaxTotalChargeUsd`, `ContentType`, `RestartOnError`, `ForcePermissionLevel`, `Webhooks`. + +`ActorBuildOptions`: `BetaPackages`, `Tag`, `UseCache`, `WaitForFinish`. + +```go +// Start an Actor with input and wait for it to finish. +waitSecs := int64(120) +run, err := client.Actor("apify/hello-world").Call(ctx, + map[string]any{"message": "hi"}, + apify.ActorStartOptions{MemoryMbytes: ptr(int64(512))}, + &waitSecs, +) +``` + +## Versions and environment variables + +`client.Actor(id).Versions()` and `.Version(n)`: + +| Method | Description | +| --- | --- | +| `Versions().List(ctx, ListOptions)` / `Versions().Create(ctx, def)` | List/create versions. | +| `Version(n).Get/Update/Delete(ctx)` | Manage a single version. | +| `Version(n).EnvVars().List(ctx)` / `.Create(ctx, ActorEnvVar)` | List/create env vars. | +| `Version(n).EnvVar(name).Get/Update/Delete(ctx)` | Manage a single env var. | + +```go +v := client.Actor(actorID).Version("0.0") +_, err := v.EnvVars().Create(ctx, apify.ActorEnvVar{Name: "API_KEY", Value: "secret", IsSecret: ptr(true)}) +``` + +> `ptr` is a helper returning a pointer to its argument: `func ptr[T any](v T) *T { return &v }`. diff --git a/docs/builds.md b/docs/builds.md new file mode 100644 index 0000000..7c91190 --- /dev/null +++ b/docs/builds.md @@ -0,0 +1,37 @@ +# Builds + +A build is a compiled version of an Actor. Access all builds with `client.Builds()`, a +single build with `client.Build(id)`, and an Actor's builds with `client.Actor(id).Builds()`. + +## Build collection + +| Method | Description | +| --- | --- | +| `List(ctx, ListOptions) (PaginationList[Build], error)` | List builds. | + +## Single build + +| Method | Description | +| --- | --- | +| `Get(ctx) (Build, bool, error)` | Fetch the build. | +| `Abort(ctx) (Build, error)` | Abort the build. | +| `Delete(ctx) error` | Delete the build. | +| `WaitForFinish(ctx, waitSecs *int64) (Build, error)` | Poll until the build is terminal. | +| `GetOpenAPIDefinition(ctx) (json.RawMessage, bool, error)` | The build's generated OpenAPI document. | +| `Log() *LogClient` | The build's log. | + +```go +build, err := client.Actor(actorID).Build(ctx, "0.0", apify.ActorBuildOptions{}) +if err != nil { + log.Fatal(err) +} +finished, err := client.Build(build.ID).WaitForFinish(ctx, ptr(int64(300))) +if err != nil { + log.Fatal(err) +} +fmt.Println("build status:", finished.Status) + +logText, ok, err := client.Build(build.ID).Log().Get(ctx) +``` + +`Build.IsTerminal()` reports whether a build has finished. diff --git a/docs/misc.md b/docs/misc.md new file mode 100644 index 0000000..fa42570 --- /dev/null +++ b/docs/misc.md @@ -0,0 +1,67 @@ +# Store, users, and logs + +## Apify Store + +Browse public Actors with `client.Store()`: + +| Method | Description | +| --- | --- | +| `List(ctx, StoreListOptions) (PaginationList[ActorStoreListItem], error)` | One page of Store Actors. | +| `Iterate(StoreListOptions) *StoreActorIterator` | Lazy iterator over all matching Actors. | + +`StoreListOptions`: `Offset`, `Limit`, `Search`, `SortBy`, `Category`, `Username`, +`PricingModel`, `IncludeUnrunnableActors`, `AllowsAgenticUsers`, `ResponseFormat`. + +```go +it := client.Store().Iterate(apify.StoreListOptions{Limit: ptr(int64(20)), Search: ptr("scraper")}) +for { + actor, err := it.Next(ctx) + if err != nil { log.Fatal(err) } + if actor == nil { break } + fmt.Println(actor.Title, actor.ID) +} +``` + +## Users + +`client.Me()` returns a client for the current account; `client.User(id)` for another user. + +| Method | Description | +| --- | --- | +| `Get(ctx) (User, bool, error)` | Account details (private for `Me()`, public otherwise). | +| `MonthlyUsage(ctx) (json.RawMessage, error)` | Current account's monthly usage (`Me()` only). | +| `Limits(ctx) (json.RawMessage, error)` | Current account's limits (`Me()` only). | +| `UpdateLimits(ctx, newLimits any) error` | Update the account's limits (`Me()` only). | + +The usage/limits methods return an error if called on a non-`Me()` client. + +```go +user, ok, err := client.Me().Get(ctx) +usage, err := client.Me().MonthlyUsage(ctx) +``` + +## Logs + +`client.Log(buildOrRunID)` accesses a build or run log (also via `client.Run(id).Log()` / +`client.Build(id).Log()`): + +| Method | Description | +| --- | --- | +| `Get(ctx) (string, bool, error)` | The entire log as text. | +| `GetWithOptions(ctx, LogOptions) (string, bool, error)` | Read with options (`Raw`, `Download`). | +| `Stream(ctx) (io.ReadCloser, error)` | A live stream of the log; close when done. | +| `StreamWithOptions(ctx, LogOptions) (io.ReadCloser, error)` | Stream with options (`Raw`, `Download`). | + +For convenient live redirection of a run's log, `client.Run(id).GetStreamedLog(ctx)` returns +a raw live stream directly. + +```go +// Read the whole log. +logText, ok, err := client.Run(runID).Log().Get(ctx) + +// Or stream it live (log redirection). +stream, err := client.Run(runID).Log().Stream(ctx) +if err != nil { log.Fatal(err) } +defer stream.Close() +_, _ = io.Copy(os.Stdout, stream) +``` diff --git a/docs/runs.md b/docs/runs.md new file mode 100644 index 0000000..e7dc8b4 --- /dev/null +++ b/docs/runs.md @@ -0,0 +1,56 @@ +# Runs + +A run is a single execution of an Actor. Access all runs with `client.Runs()`, a single run +with `client.Run(id)`, and an Actor's or task's runs with `client.Actor(id).Runs()` / +`client.Task(id).Runs()`. + +## Run collection + +| Method | Description | +| --- | --- | +| `List(ctx, ListOptions, RunListOptions) (PaginationList[ActorRun], error)` | List runs. | + +`RunListOptions`: `Status`, `StartedAfter`, `StartedBefore` (the time filters apply only to +Actor- and task-scoped collections). + +## Single run + +| Method | Description | +| --- | --- | +| `Get(ctx) (ActorRun, bool, error)` | Fetch the run. | +| `GetWithWait(ctx, waitForFinishSecs *int64) (ActorRun, bool, error)` | Fetch, optionally waiting server-side. | +| `Update(ctx, newFields any) (ActorRun, error)` | Update the run (e.g. status message). | +| `Delete(ctx) error` | Delete the run. | +| `Abort(ctx, gracefully bool) (ActorRun, error)` | Abort the run. | +| `Metamorph(ctx, targetActorID string, input any, MetamorphOptions) (ActorRun, error)` | Metamorph into another Actor. | +| `Reboot(ctx) (ActorRun, error)` | Reboot the run. | +| `Resurrect(ctx, RunResurrectOptions) (ActorRun, error)` | Resurrect a finished run. | +| `Charge(ctx, RunChargeOptions) error` | Charge a pay-per-event run (sends an idempotency key). | +| `WaitForFinish(ctx, waitSecs *int64) (ActorRun, error)` | Poll until the run is terminal. | +| `Dataset() *DatasetClient` | The run's default dataset. | +| `KeyValueStore() *KeyValueStoreClient` | The run's default key-value store. | +| `RequestQueue() *RequestQueueClient` | The run's default request queue. | +| `Log() *LogClient` | The run's log. | +| `GetStreamedLog(ctx) (io.ReadCloser, error)` | Live stream of the run's raw log (log redirection). | + +`RunResurrectOptions`: `Build`, `MemoryMbytes`, `TimeoutSecs`, `MaxItems`, +`MaxTotalChargeUsd`, `RestartOnError`. + +`MetamorphOptions`: `Build`, `ContentType`. + +`RunChargeOptions`: `EventName` (required), `Count`, `IdempotencyKey` (auto-generated if +empty, so a retried charge is applied at most once). + +```go +run, err := client.Run(runID).WaitForFinish(ctx, nil) // nil waits indefinitely +if err != nil { + log.Fatal(err) +} + +// Read the run's default dataset. +items, err := client.Run(run.ID).Dataset().ListItems(ctx, apify.DatasetListItemsOptions{}) +``` + +`ActorRun.IsTerminal()` reports whether a run has finished. Status message convenience: +`client.SetStatusMessage(ctx, message, isTerminal)` updates the current run identified by the +`ACTOR_RUN_ID` environment variable. diff --git a/docs/schedules.md b/docs/schedules.md new file mode 100644 index 0000000..abd84e1 --- /dev/null +++ b/docs/schedules.md @@ -0,0 +1,34 @@ +# Schedules + +Schedules start Actor or task runs at specified times. Access the schedule collection with +`client.Schedules()` and a single schedule with `client.Schedule(id)`. + +## Schedule collection + +| Method | Description | +| --- | --- | +| `List(ctx, ListOptions) (PaginationList[Schedule], error)` | List the account's schedules. | +| `Create(ctx, definition any) (Schedule, error)` | Create a new schedule. | + +## Single schedule + +| Method | Description | +| --- | --- | +| `Get(ctx) (Schedule, bool, error)` | Fetch the schedule. | +| `Update(ctx, newFields any) (Schedule, error)` | Update the schedule. | +| `Delete(ctx) error` | Delete the schedule. | +| `GetLog(ctx) (string, bool, error)` | The schedule's invocation log. | + +```go +sch, err := client.Schedules().Create(ctx, map[string]any{ + "name": "nightly", + "cronExpression": "0 0 * * *", + "isEnabled": true, + "isExclusive": true, + "actions": []any{}, +}) +if err != nil { + log.Fatal(err) +} +_, err = client.Schedule(sch.ID).Update(ctx, map[string]any{"cronExpression": "0 12 * * *"}) +``` diff --git a/docs/storages.md b/docs/storages.md new file mode 100644 index 0000000..9e68d09 --- /dev/null +++ b/docs/storages.md @@ -0,0 +1,103 @@ +# Storages + +The platform offers three storage types: datasets, key-value stores, and request queues. +Each is reachable both as a top-level resource and as a run's default storage +(`client.Run(id).Dataset()` etc.). + +## Datasets + +Collection: `client.Datasets()` — `List(ctx, StorageListOptions)`, +`GetOrCreate(ctx, name string)` (empty name → unnamed dataset). + +Single dataset: `client.Dataset(id)`: + +| Method | Description | +| --- | --- | +| `Get / Update / Delete(ctx)` | CRUD. | +| `ListItems(ctx, DatasetListItemsOptions) (PaginationList[json.RawMessage], error)` | Read items. | +| `PushItems(ctx, items any) error` | Append one item or a slice of items. | +| `DownloadItems(ctx, DownloadItemsFormat, DatasetDownloadOptions) ([]byte, error)` | Export items (JSON, CSV, XLSX, XML, RSS, HTML). | +| `GetStatistics(ctx) (json.RawMessage, bool, error)` | Dataset statistics. | +| `CreateItemsPublicURL(ctx, DatasetListItemsOptions, expiresInSecs *int64) (string, error)` | Signed public items URL. | + +For typed item decoding use the generic helper `apify.ListDatasetItems[T](ctx, dataset, opts)`. + +```go +ds, _ := client.Datasets().GetOrCreate(ctx, "") +defer client.Dataset(ds.ID).Delete(ctx) + +_ = client.Dataset(ds.ID).PushItems(ctx, []map[string]any{{"x": 1}, {"x": 2}}) +page, _ := client.Dataset(ds.ID).ListItems(ctx, apify.DatasetListItemsOptions{Limit: ptr(int64(100))}) +csv, _ := client.Dataset(ds.ID).DownloadItems(ctx, apify.FormatCSV, apify.DatasetDownloadOptions{Bom: ptr(true)}) +``` + +## Key-value stores + +Collection: `client.KeyValueStores()` — `List`, `GetOrCreate`. + +Single store: `client.KeyValueStore(id)`: + +| Method | Description | +| --- | --- | +| `Get / Update / Delete(ctx)` | CRUD. | +| `ListKeys(ctx, ListKeysOptions) (KeyValueStoreKeysPage, error)` | List keys. | +| `GetRecord(ctx, key) (*KeyValueStoreRecord, bool, error)` | Read a record. | +| `GetRecordWithOptions(ctx, key, GetRecordOptions)` | Read with options. | +| `SetRecordRaw(ctx, key, value []byte, contentType string) error` | Write raw bytes. | +| `SetRecordJSON(ctx, key, value any) error` | Write JSON. | +| `RecordExists(ctx, key) (bool, error)` | HEAD check. | +| `DeleteRecord(ctx, key) error` | Delete a record. | +| `GetRecords(ctx, GetRecordsOptions) ([]byte, error)` | Download all records as a ZIP. | +| `GetRecordPublicURL(ctx, key) (string, error)` | Signed public record URL. | +| `CreateKeysPublicURL(ctx, expiresInSecs *int64) (string, error)` | Signed public key-list URL. | + +```go +store, _ := client.KeyValueStores().GetOrCreate(ctx, "") +defer client.KeyValueStore(store.ID).Delete(ctx) + +_ = client.KeyValueStore(store.ID).SetRecordJSON(ctx, "OUTPUT", map[string]any{"answer": 42}) +rec, ok, _ := client.KeyValueStore(store.ID).GetRecord(ctx, "OUTPUT") +if ok { + fmt.Println(string(rec.Value)) +} +``` + +## Request queues + +Collection: `client.RequestQueues()` — `List`, `GetOrCreate`. + +Single queue: `client.RequestQueue(id)`: + +| Method | Description | +| --- | --- | +| `Get / Update / Delete(ctx)` | CRUD. | +| `ListHead(ctx, limit *int64) (RequestQueueHead, error)` | Requests at the front. | +| `AddRequest(ctx, RequestQueueRequest, forefront bool) (RequestQueueOperationInfo, error)` | Add a request. | +| `GetRequest(ctx, id) (*RequestQueueRequest, bool, error)` | Read a request. | +| `UpdateRequest(ctx, RequestQueueRequest, forefront bool)` | Update a request (by its `ID`). | +| `DeleteRequest(ctx, id) error` | Delete a request. | +| `ListRequests(ctx, ListRequestsOptions)` | Paginated list. | +| `PaginateRequests(pageLimit *int64) *RequestQueueRequestsIterator` | Lazy iterator over all requests. | +| `BatchAddRequests(ctx, []RequestQueueRequest, forefront) (BatchAddResult, error)` | Add many requests (auto-chunked at 25/call). | +| `BatchDeleteRequests(ctx, requests any)` | Delete many requests. | +| `ListAndLockHead / ProlongRequestLock / DeleteRequestLock / UnlockRequests(ctx, ...)` | Locking. | +| `WithClientKey(key string) *RequestQueueClient` | Pin a stable client key (required to unlock own locks). | + +```go +rq, _ := client.RequestQueues().GetOrCreate(ctx, "") +defer client.RequestQueue(rq.ID).Delete(ctx) + +queue := client.RequestQueue(rq.ID) +_, _ = queue.AddRequest(ctx, apify.RequestQueueRequest{URL: "https://example.com", UniqueKey: "example"}, false) + +it := queue.PaginateRequests(ptr(int64(100))) +for { + req, err := it.Next(ctx) + if err != nil { log.Fatal(err) } + if req == nil { break } + fmt.Println(req.URL) +} +``` + +`StorageListOptions` (shared by the three collections): `Offset`, `Limit`, `Desc`, +`Unnamed`, `Ownership`. diff --git a/docs/tasks.md b/docs/tasks.md new file mode 100644 index 0000000..c878ff8 --- /dev/null +++ b/docs/tasks.md @@ -0,0 +1,43 @@ +# Tasks + +A task is a pre-configured Actor run with stored input. Access the task collection with +`client.Tasks()` and a single task with `client.Task(id)`. + +## Task collection + +| Method | Description | +| --- | --- | +| `List(ctx, ListOptions) (PaginationList[Task], error)` | List the account's tasks. | +| `Create(ctx, definition any) (Task, error)` | Create a new task. | + +## Single task + +| Method | Description | +| --- | --- | +| `Get(ctx) (Task, bool, error)` | Fetch the task. | +| `Update(ctx, newFields any) (Task, error)` | Update the task. | +| `Delete(ctx) error` | Delete the task. | +| `Start(ctx, input any, TaskStartOptions) (ActorRun, error)` | Start a run (input overrides stored input). | +| `Call(ctx, input any, TaskStartOptions, waitSecs *int64) (ActorRun, error)` | Start and wait. | +| `GetInput(ctx) (json.RawMessage, bool, error)` | Fetch the stored input. | +| `UpdateInput(ctx, input any) (json.RawMessage, error)` | Replace the stored input. | +| `LastRun(status string) *RunClient` | Client for the last run (optional status filter). | +| `Runs() *RunCollectionClient` | This task's runs. | +| `Webhooks() *WebhookCollectionClient` | This task's webhooks. | + +```go +task, err := client.Tasks().Create(ctx, map[string]any{ + "actId": "apify/hello-world", + "name": "my-task", + "options": map[string]any{"build": "latest", "memoryMbytes": 256, "timeoutSecs": 60}, + "input": map[string]any{"message": "hi"}, +}) +if err != nil { + log.Fatal(err) +} +run, err := client.Task(task.ID).Call(ctx, nil, apify.TaskStartOptions{}, ptr(int64(120))) +``` + +`TaskStartOptions` mirrors `ActorStartOptions` (see [actors.md](actors.md)) but omits the +Actor-only `ContentType` and `ForcePermissionLevel`, which the task run endpoint does not +accept. diff --git a/docs/webhooks.md b/docs/webhooks.md new file mode 100644 index 0000000..0acdadc --- /dev/null +++ b/docs/webhooks.md @@ -0,0 +1,45 @@ +# Webhooks + +Webhooks notify external services when events occur. Access the webhook collection with +`client.Webhooks()`, a single webhook with `client.Webhook(id)`, dispatches with +`client.WebhookDispatches()` / `client.WebhookDispatch(id)`. + +## Webhook collection + +| Method | Description | +| --- | --- | +| `List(ctx, ListOptions) (PaginationList[Webhook], error)` | List webhooks. | +| `Create(ctx, definition any) (Webhook, error)` | Create a webhook. | + +An Actor's or task's webhooks are also listable via `client.Actor(id).Webhooks()` / +`client.Task(id).Webhooks()`. + +## Single webhook + +| Method | Description | +| --- | --- | +| `Get(ctx) (Webhook, bool, error)` | Fetch the webhook. | +| `Update(ctx, newFields any) (Webhook, error)` | Update the webhook. | +| `Delete(ctx) error` | Delete the webhook. | +| `Test(ctx) (WebhookDispatch, error)` | Dispatch the webhook immediately. | +| `Dispatches() *WebhookDispatchCollectionClient` | The webhook's dispatches. | + +## Webhook dispatches + +| Method | Description | +| --- | --- | +| `WebhookDispatches().List(ctx, ListOptions)` | List dispatches. | +| `WebhookDispatch(id).Get(ctx) (WebhookDispatch, bool, error)` | Fetch a dispatch. | + +```go +wh, err := client.Webhooks().Create(ctx, map[string]any{ + "isAdHoc": true, + "eventTypes": []string{"ACTOR.RUN.SUCCEEDED"}, + "condition": map[string]any{"actorRunId": "RUN_ID"}, + "requestUrl": "https://example.com/webhook", +}) +if err != nil { + log.Fatal(err) +} +dispatch, err := client.Webhook(wh.ID).Test(ctx) +``` diff --git a/errors.go b/errors.go new file mode 100644 index 0000000..37ced0d --- /dev/null +++ b/errors.go @@ -0,0 +1,84 @@ +package apify + +import ( + "encoding/json" + "errors" + "fmt" +) + +// APIError is returned for HTTP requests that reach the Apify API but receive a +// non-success status code. +// +// It mirrors the `ApifyApiError` of the reference JavaScript client and exposes the +// parsed error Type, the human-readable Message, the HTTP StatusCode, the number of +// the final Attempt, and the request HTTPMethod/Path. +type APIError struct { + // StatusCode is the HTTP status code of the error response. + StatusCode int + // Type is the machine-readable error type returned by the API (e.g. "record-not-found"). + Type string + // Message is the human-readable description of the error returned by the API. + Message string + // Attempt is the number of the API call attempt that produced this error (1-based). + Attempt int + // HTTPMethod is the HTTP method of the API call (e.g. "GET", "POST"). + HTTPMethod string + // Path is the full path of the API endpoint (URL excluding origin). + Path string + // Data holds additional structured data provided by the API about the error, if any. + Data map[string]any +} + +// Error implements the error interface. +func (e *APIError) Error() string { + errType := e.Type + if errType == "" { + errType = "unknown" + } + return fmt.Sprintf("apify API error (status %d, type %s): %s", e.StatusCode, errType, e.Message) +} + +// apiErrorBody is the shape of the `error` object returned by the Apify API on failure: +// `{ "error": { "type": "...", "message": "..." } }`. +type apiErrorBody struct { + Error struct { + Type string `json:"type"` + Message string `json:"message"` + Data map[string]any `json:"data"` + } `json:"error"` +} + +// buildAPIError parses an API error response body into an *APIError. +func buildAPIError(status int, body []byte, attempt int, method, path string) *APIError { + apiErr := &APIError{ + StatusCode: status, + Attempt: attempt, + HTTPMethod: method, + Path: path, + } + + var parsed apiErrorBody + if err := json.Unmarshal(body, &parsed); err == nil && parsed.Error.Message != "" { + apiErr.Type = parsed.Error.Type + apiErr.Message = parsed.Error.Message + apiErr.Data = parsed.Error.Data + return apiErr + } + + if len(body) == 0 { + apiErr.Message = fmt.Sprintf("unexpected error with status %d", status) + } else { + apiErr.Message = fmt.Sprintf("unexpected error: %s", string(body)) + } + return apiErr +} + +// AsAPIError returns the underlying *APIError if err is (or wraps) one, and true; +// otherwise it returns nil and false. It is a convenience wrapper around errors.As. +func AsAPIError(err error) (*APIError, bool) { + var apiErr *APIError + if errors.As(err, &apiErr) { + return apiErr, true + } + return nil, false +} diff --git a/examples/create_build_run_actor/main.go b/examples/create_build_run_actor/main.go new file mode 100644 index 0000000..98f9441 --- /dev/null +++ b/examples/create_build_run_actor/main.go @@ -0,0 +1,78 @@ +// Command create_build_run_actor demonstrates the full Actor lifecycle: create a new Actor +// from source files, build it, run it, wait for it to finish, then fetch and print the run +// log. +// +// Run with: +// +// APIFY_TOKEN=<your-token> go run ./examples/create_build_run_actor +package main + +import ( + "context" + "fmt" + "log" + "os" + "time" + + apify "github.com/apify/apify-client-go" +) + +func main() { + client := apify.NewClient(os.Getenv("APIFY_TOKEN")) + ctx := context.Background() + + name := fmt.Sprintf("go-example-%d", time.Now().Unix()) + actorDef := map[string]any{ + "name": name, + "isPublic": false, + "versions": []any{ + map[string]any{ + "versionNumber": "0.0", + "sourceType": "SOURCE_FILES", + "buildTag": "latest", + "sourceFiles": []any{ + map[string]any{"name": "Dockerfile", "format": "TEXT", "content": "FROM apify/actor-node:20\nCOPY . ./\nCMD node main.js"}, + map[string]any{"name": "main.js", "format": "TEXT", "content": "console.log('hello from the go client example');"}, + }, + }, + }, + } + + created, err := client.Actors().Create(ctx, actorDef) + if err != nil { + log.Fatalf("create actor: %v", err) + } + defer func() { _ = client.Actor(created.ID).Delete(ctx) }() + fmt.Printf("Created actor %s\n", created.ID) + + actor := client.Actor(created.ID) + + // Build version 0.0 and wait for the build to finish. + build, err := actor.Build(ctx, "0.0", apify.ActorBuildOptions{}) + if err != nil { + log.Fatalf("start build: %v", err) + } + if _, err := client.Build(build.ID).WaitForFinish(ctx, ptr(int64(300))); err != nil { + log.Fatalf("wait for build: %v", err) + } + fmt.Printf("Built actor (build %s)\n", build.ID) + + // Run the actor and wait for it to finish. + run, err := actor.Call(ctx, nil, apify.ActorStartOptions{}, ptr(int64(120))) + if err != nil { + log.Fatalf("run actor: %v", err) + } + fmt.Printf("Run %s finished with status %s\n", run.ID, run.Status) + + // Fetch and print the run log. + logText, ok, err := client.Run(run.ID).Log().Get(ctx) + if err != nil { + log.Fatalf("fetch log: %v", err) + } + if ok { + fmt.Println("--- run log ---") + fmt.Println(logText) + } +} + +func ptr[T any](v T) *T { return &v } diff --git a/examples/get_account/main.go b/examples/get_account/main.go new file mode 100644 index 0000000..c9989a4 --- /dev/null +++ b/examples/get_account/main.go @@ -0,0 +1,30 @@ +// Command get_account fetches and prints the current user's account details. +// +// Run with: +// +// APIFY_TOKEN=<your-token> go run ./examples/get_account +package main + +import ( + "context" + "fmt" + "log" + "os" + + apify "github.com/apify/apify-client-go" +) + +func main() { + client := apify.NewClient(os.Getenv("APIFY_TOKEN")) + + user, ok, err := client.Me().Get(context.Background()) + if err != nil { + log.Fatalf("failed to fetch account: %v", err) + } + if !ok { + log.Fatal("current user not found") + } + + fmt.Printf("Account ID: %s\n", user.ID) + fmt.Printf("Username: %s\n", user.Username) +} diff --git a/examples/iterate_store/main.go b/examples/iterate_store/main.go new file mode 100644 index 0000000..7f1aa7e --- /dev/null +++ b/examples/iterate_store/main.go @@ -0,0 +1,41 @@ +// Command iterate_store lazily iterates over Actors in the Apify Store using the convenience +// iterator, printing the first few. +// +// Run with: +// +// APIFY_TOKEN=<your-token> go run ./examples/iterate_store +package main + +import ( + "context" + "fmt" + "log" + "os" + + apify "github.com/apify/apify-client-go" +) + +func main() { + client := apify.NewClient(os.Getenv("APIFY_TOKEN")) + ctx := context.Background() + + // Iterate the store lazily, fetching pages of 5 on demand. + limit := int64(5) + it := client.Store().Iterate(apify.StoreListOptions{Limit: &limit}) + + const want = 10 + for i := 0; i < want; i++ { + item, err := it.Next(ctx) + if err != nil { + log.Fatalf("iterate store: %v", err) + } + if item == nil { + break // store exhausted + } + title := item.Title + if title == "" { + title = item.Name + } + fmt.Printf("%2d. %s (%s)\n", i+1, title, item.ID) + } +} diff --git a/examples/log_redirection/main.go b/examples/log_redirection/main.go new file mode 100644 index 0000000..c2b35c4 --- /dev/null +++ b/examples/log_redirection/main.go @@ -0,0 +1,38 @@ +// Command log_redirection starts an Actor without waiting, then streams its log output to +// stdout in real time (log redirection). +// +// Run with: +// +// APIFY_TOKEN=<your-token> go run ./examples/log_redirection +package main + +import ( + "context" + "io" + "log" + "os" + + apify "github.com/apify/apify-client-go" +) + +func main() { + client := apify.NewClient(os.Getenv("APIFY_TOKEN")) + ctx := context.Background() + + // Start the Actor and return immediately (do not wait for it to finish). + run, err := client.Actor("apify/hello-world").Start(ctx, nil, apify.ActorStartOptions{}) + if err != nil { + log.Fatalf("start actor: %v", err) + } + + // Open a live (raw) log stream and copy it to stdout as the run produces output. + stream, err := client.Run(run.ID).GetStreamedLog(ctx) + if err != nil { + log.Fatalf("open log stream: %v", err) + } + defer stream.Close() + + if _, err := io.Copy(os.Stdout, stream); err != nil { + log.Fatalf("copy log: %v", err) + } +} diff --git a/examples/run_and_last_run_storages/main.go b/examples/run_and_last_run_storages/main.go new file mode 100644 index 0000000..9e94112 --- /dev/null +++ b/examples/run_and_last_run_storages/main.go @@ -0,0 +1,53 @@ +// Command run_and_last_run_storages starts a Store Actor run, waits for it, then fetches the +// Actor's last run and accesses all three of its default storages. +// +// Run with: +// +// APIFY_TOKEN=<your-token> go run ./examples/run_and_last_run_storages +package main + +import ( + "context" + "fmt" + "log" + "os" + + apify "github.com/apify/apify-client-go" +) + +func main() { + client := apify.NewClient(os.Getenv("APIFY_TOKEN")) + ctx := context.Background() + + waitSecs := int64(120) + if _, err := client.Actor("apify/hello-world").Call(ctx, nil, apify.ActorStartOptions{}, &waitSecs); err != nil { + log.Fatalf("run actor: %v", err) + } + + // Fetch the Actor's last successful run. + lastRun, ok, err := client.Actor("apify/hello-world").LastRun("SUCCEEDED").Get(ctx) + if err != nil || !ok { + log.Fatalf("fetch last run: ok=%v err=%v", ok, err) + } + fmt.Printf("Last run %s status %s\n", lastRun.ID, lastRun.Status) + + run := client.Run(lastRun.ID) + + items, err := run.Dataset().ListItems(ctx, apify.DatasetListItemsOptions{}) + if err != nil { + log.Fatalf("read dataset: %v", err) + } + fmt.Printf("Default dataset items: %d\n", items.Count) + + keys, err := run.KeyValueStore().ListKeys(ctx, apify.ListKeysOptions{}) + if err != nil { + log.Fatalf("read kvs keys: %v", err) + } + fmt.Printf("Default key-value store keys: %d\n", len(keys.Items)) + + head, err := run.RequestQueue().ListHead(ctx, nil) + if err != nil { + log.Fatalf("read queue head: %v", err) + } + fmt.Printf("Default request queue head: %d\n", len(head.Items)) +} diff --git a/examples/run_store_actor/main.go b/examples/run_store_actor/main.go new file mode 100644 index 0000000..b387ffe --- /dev/null +++ b/examples/run_store_actor/main.go @@ -0,0 +1,36 @@ +// Command run_store_actor runs an existing Apify Store Actor, waits for it to finish, and +// reads items from its default dataset. +// +// Run with: +// +// APIFY_TOKEN=<your-token> go run ./examples/run_store_actor +package main + +import ( + "context" + "fmt" + "log" + "os" + + apify "github.com/apify/apify-client-go" +) + +func main() { + client := apify.NewClient(os.Getenv("APIFY_TOKEN")) + ctx := context.Background() + + // Start the public hello-world Actor and wait up to 120 seconds for it to finish. + waitSecs := int64(120) + run, err := client.Actor("apify/hello-world").Call(ctx, nil, apify.ActorStartOptions{}, &waitSecs) + if err != nil { + log.Fatalf("failed to run actor: %v", err) + } + fmt.Printf("Run %s finished with status %s\n", run.ID, run.Status) + + // Read items from the run's default dataset. + page, err := client.Dataset(run.DefaultDatasetID).ListItems(ctx, apify.DatasetListItemsOptions{}) + if err != nil { + log.Fatalf("failed to read dataset: %v", err) + } + fmt.Printf("Default dataset contains %d items\n", page.Count) +} diff --git a/examples/storages/main.go b/examples/storages/main.go new file mode 100644 index 0000000..9222ef9 --- /dev/null +++ b/examples/storages/main.go @@ -0,0 +1,79 @@ +// Command storages demonstrates creating, writing to, and reading from all three Apify +// storage types: datasets, key-value stores, and request queues. +// +// Run with: +// +// APIFY_TOKEN=<your-token> go run ./examples/storages +package main + +import ( + "context" + "fmt" + "log" + "os" + + apify "github.com/apify/apify-client-go" +) + +func main() { + client := apify.NewClient(os.Getenv("APIFY_TOKEN")) + ctx := context.Background() + + datasetExample(ctx, client) + keyValueStoreExample(ctx, client) + requestQueueExample(ctx, client) +} + +func datasetExample(ctx context.Context, client *apify.ApifyClient) { + ds, err := client.Datasets().GetOrCreate(ctx, "") + if err != nil { + log.Fatalf("create dataset: %v", err) + } + defer func() { _ = client.Dataset(ds.ID).Delete(ctx) }() + + dataset := client.Dataset(ds.ID) + if err := dataset.PushItems(ctx, []map[string]any{{"name": "Alice"}, {"name": "Bob"}}); err != nil { + log.Fatalf("push items: %v", err) + } + page, err := dataset.ListItems(ctx, apify.DatasetListItemsOptions{}) + if err != nil { + log.Fatalf("list items: %v", err) + } + fmt.Printf("Dataset %s has %d items\n", ds.ID, page.Count) +} + +func keyValueStoreExample(ctx context.Context, client *apify.ApifyClient) { + store, err := client.KeyValueStores().GetOrCreate(ctx, "") + if err != nil { + log.Fatalf("create store: %v", err) + } + defer func() { _ = client.KeyValueStore(store.ID).Delete(ctx) }() + + kvs := client.KeyValueStore(store.ID) + if err := kvs.SetRecordJSON(ctx, "OUTPUT", map[string]any{"answer": 42}); err != nil { + log.Fatalf("set record: %v", err) + } + rec, ok, err := kvs.GetRecord(ctx, "OUTPUT") + if err != nil || !ok { + log.Fatalf("get record: ok=%v err=%v", ok, err) + } + fmt.Printf("Key-value store %s OUTPUT = %s\n", store.ID, string(rec.Value)) +} + +func requestQueueExample(ctx context.Context, client *apify.ApifyClient) { + rq, err := client.RequestQueues().GetOrCreate(ctx, "") + if err != nil { + log.Fatalf("create queue: %v", err) + } + defer func() { _ = client.RequestQueue(rq.ID).Delete(ctx) }() + + queue := client.RequestQueue(rq.ID) + if _, err := queue.AddRequest(ctx, apify.RequestQueueRequest{URL: "https://example.com", UniqueKey: "example"}, false); err != nil { + log.Fatalf("add request: %v", err) + } + head, err := queue.ListHead(ctx, nil) + if err != nil { + log.Fatalf("list head: %v", err) + } + fmt.Printf("Request queue %s head has %d requests\n", rq.ID, len(head.Items)) +} diff --git a/git_push.sh b/git_push.sh deleted file mode 100644 index f421bf0..0000000 --- a/git_push.sh +++ /dev/null @@ -1,57 +0,0 @@ -#!/bin/sh -# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ -# -# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" - -git_user_id=$1 -git_repo_id=$2 -release_note=$3 -git_host=$4 - -if [ "$git_host" = "" ]; then - git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" -fi - -if [ "$git_user_id" = "" ]; then - git_user_id="apify" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" -fi - -if [ "$git_repo_id" = "" ]; then - git_repo_id="apify-client-go" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" -fi - -if [ "$release_note" = "" ]; then - release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" -fi - -# Initialize the local directory as a Git repository -git init - -# Adds the files in the local repository and stages them for commit. -git add . - -# Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" - -# Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git - else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git - fi - -fi - -git pull origin master - -# Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" -git push origin master 2>&1 | grep -v 'To https' diff --git a/go.mod b/go.mod index dbfbb61..a348627 100644 --- a/go.mod +++ b/go.mod @@ -1,7 +1,3 @@ module github.com/apify/apify-client-go go 1.23 - -require ( - gopkg.in/validator.v2 v2.0.1 -) diff --git a/go.sum b/go.sum deleted file mode 100644 index 525afa0..0000000 --- a/go.sum +++ /dev/null @@ -1,13 +0,0 @@ -cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -github.com/golang/protobuf v1.2.0 h1:P3YflyNX/ehuJFLhxviNdFxQPkGK5cDcApsge1SqnvM= -github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e h1:bRhVy7zSSasaqNksaRZiA5EEI+Ei4I1nO5Jh72wfHlg= -golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4 h1:YUO/7uOKsKeq9UokNS62b8FYywz3ker1l1vDZRCRefw= -golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -google.golang.org/appengine v1.4.0 h1:/wp5JvzpHIxhs/dumFmF7BXTf3Z+dd4uXta4kVyO508= -google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -gopkg.in/validator.v2 v2.0.1 h1:xF0KWyGWXm/LM2G1TrEjqOu4pa6coO9AlWSf3msVfDY= -gopkg.in/validator.v2 v2.0.1/go.mod h1:lIUZBlB3Im4s/eYp39Ry/wkR02yOPhZ9IwIRBjuPuG8= diff --git a/http_client.go b/http_client.go new file mode 100644 index 0000000..b731639 --- /dev/null +++ b/http_client.go @@ -0,0 +1,261 @@ +package apify + +import ( + "bytes" + "context" + "io" + "math/rand" + "net/http" + "strings" + "time" +) + +// Status-code thresholds used to classify responses. Named constants so the retry +// policy has no magic numbers (see the language-agnostic coding rules). +const ( + // rateLimitExceededStatusCode is returned when the per-resource rate limit is hit. + rateLimitExceededStatusCode = 429 + // minServerErrorStatusCode and above are treated as retryable internal errors. + minServerErrorStatusCode = 500 + // maxSuccessStatusCode: responses with status < this are treated as success. + maxSuccessStatusCode = 300 + // backoffFactor is the multiplier applied to the inter-retry delay after each + // attempt (exponential backoff). Matches the reference client's async-retry factor of 2. + backoffFactor = 2 +) + +// HTTPBackend is the replaceable transport contract of the client. +// +// Implementations are responsible only for sending a single request and returning the +// raw response. Authentication, the User-Agent header, retries and (de)serialization are +// handled by httpClient, so a backend only needs to perform one network round-trip. +// +// A non-2xx HTTP status is NOT an error at this layer — return it as a normal +// *http.Response. Only transport-level failures (connection refused, DNS, timeout) +// should be returned as an error. +type HTTPBackend interface { + // Do sends a single HTTP request and returns the response. + Do(req *http.Request) (*http.Response, error) +} + +// DefaultHTTPBackend is the default HTTPBackend implementation, backed by an +// *http.Client. The per-attempt timeout is applied via the request context by the +// orchestrating client, so this backend uses no client-level timeout of its own. +type DefaultHTTPBackend struct { + client *http.Client +} + +// NewDefaultHTTPBackend creates a backend with a sensible default *http.Client that +// keeps connections alive for connection-pool reuse. +func NewDefaultHTTPBackend() *DefaultHTTPBackend { + return &DefaultHTTPBackend{client: &http.Client{}} +} + +// NewHTTPBackendWithClient wraps a caller-provided *http.Client, useful for sharing a +// connection pool or customizing proxy/TLS settings. +func NewHTTPBackendWithClient(client *http.Client) *DefaultHTTPBackend { + return &DefaultHTTPBackend{client: client} +} + +// Do implements HTTPBackend. +func (b *DefaultHTTPBackend) Do(req *http.Request) (*http.Response, error) { + return b.client.Do(req) +} + +// retryConfig configures the retry/timeout behaviour of the httpClient. +type retryConfig struct { + // maxRetries is the maximum number of retries (the request is attempted up to + // maxRetries+1 times). + maxRetries int + // minDelayBetweenRetries is doubled on each subsequent retry (exponential backoff). + minDelayBetweenRetries time.Duration + // timeout is the overall per-request timeout budget. Each attempt's timeout grows + // but is capped here. + timeout time.Duration +} + +// httpClient is the orchestrating HTTP client shared by every resource client. It owns +// the backend, the optional API token, the User-Agent, and the retry/timeout policy, and +// applies them to every request. It is safe for concurrent use and cheap to copy. +type httpClient struct { + backend HTTPBackend + token string + userAgent string + retry retryConfig +} + +// apiResponse is the parsed result of a single API call: the status, headers and the +// fully-buffered response body. +type apiResponse struct { + statusCode int + header http.Header + body []byte +} + +// call sends req with authentication, the User-Agent header and the retry policy applied, +// returning the first successful response or the final error. +// +// body, if non-nil, is the raw request body; it is re-sent on each retry (we buffer it). +// contentType, if non-empty, sets the Content-Type header. baseTimeout is the per-endpoint +// base timeout; it grows with each attempt up to the client's overall timeout budget. +func (c *httpClient) call(ctx context.Context, method, url string, body []byte, contentType string, baseTimeout time.Duration) (*apiResponse, error) { + return c.callWithHeaders(ctx, method, url, body, contentType, nil, baseTimeout) +} + +// callWithHeaders is like call but additionally sets the given extra request headers (e.g. +// the charge idempotency key). They are applied on every attempt. +func (c *httpClient) callWithHeaders(ctx context.Context, method, url string, body []byte, contentType string, extraHeaders map[string]string, baseTimeout time.Duration) (*apiResponse, error) { + delay := c.retry.minDelayBetweenRetries + maxAttempts := c.retry.maxRetries + 1 + path := extractPath(url) + + var lastErr error + for attempt := 1; attempt <= maxAttempts; attempt++ { + resp, err := c.doAttempt(ctx, method, url, body, contentType, extraHeaders, c.attemptTimeout(baseTimeout, attempt)) + + var retryable bool + if err != nil { + lastErr = err + retryable = isTransportErrorRetryable(err) + } else if resp.statusCode < maxSuccessStatusCode { + return resp, nil + } else { + lastErr = buildAPIError(resp.statusCode, resp.body, attempt, method, path) + retryable = isStatusRetryable(resp.statusCode) + } + + // Give up immediately on non-retryable errors or after the last attempt. + if !retryable || attempt == maxAttempts { + return nil, lastErr + } + + // Sleep with randomized exponential backoff before the next attempt. The backoff + // doubles each retry (matching the reference client's async-retry factor of 2) and + // is capped at the overall request timeout. + if !sleepWithContext(ctx, randomizedDelay(delay)) { + return nil, ctx.Err() + } + delay = minDuration(delay*backoffFactor, c.retry.timeout) + } + + return nil, lastErr +} + +// applyAuthHeaders sets the User-Agent and (if a token is configured) Authorization headers +// that every request to the API must carry. It is the single place those headers are set, so +// the buffered request path and the raw streaming path (LogClient.Stream) stay in sync. +func (c *httpClient) applyAuthHeaders(req *http.Request) { + req.Header.Set("User-Agent", c.userAgent) + if c.token != "" { + req.Header.Set("Authorization", "Bearer "+c.token) + } +} + +// doAttempt performs a single HTTP round-trip with the given per-attempt timeout. +func (c *httpClient) doAttempt(ctx context.Context, method, url string, body []byte, contentType string, extraHeaders map[string]string, timeout time.Duration) (*apiResponse, error) { + attemptCtx, cancel := context.WithTimeout(ctx, timeout) + defer cancel() + + var reader io.Reader + if body != nil { + reader = bytes.NewReader(body) + } + req, err := http.NewRequestWithContext(attemptCtx, method, url, reader) + if err != nil { + // A malformed request is a programming/argument error, not a transport error. + return nil, &APIError{StatusCode: 0, Type: "invalid-request", Message: err.Error(), Attempt: 1, HTTPMethod: method, Path: extractPath(url)} + } + + c.applyAuthHeaders(req) + if contentType != "" { + req.Header.Set("Content-Type", contentType) + } + for k, v := range extraHeaders { + req.Header.Set(k, v) + } + + resp, err := c.backend.Do(req) + if err != nil { + return nil, err + } + defer resp.Body.Close() + + data, err := io.ReadAll(resp.Body) + if err != nil { + // Reading the body failed mid-stream; treat as a retryable transport error. + return nil, err + } + + return &apiResponse{statusCode: resp.StatusCode, header: resp.Header, body: data}, nil +} + +// attemptTimeout returns min(overall, base * 2^(attempt-1)). +// +// The first attempt uses the per-endpoint base timeout; each retry doubles it so a +// slow-but-progressing connection gets more time, while never exceeding the overall budget. +func (c *httpClient) attemptTimeout(base time.Duration, attempt int) time.Duration { + scaled := base + for i := 1; i < attempt; i++ { + scaled *= 2 + if scaled >= c.retry.timeout { + return c.retry.timeout + } + } + return minDuration(scaled, c.retry.timeout) +} + +// isStatusRetryable reports whether a non-success status should be retried. We retry 429 +// (rate limit) and 5xx (internal server errors); other 4xx statuses are caller errors. +func isStatusRetryable(status int) bool { + return status == rateLimitExceededStatusCode || status >= minServerErrorStatusCode +} + +// isTransportErrorRetryable reports whether a transport-level error should be retried. +// Network failures and timeouts are retryable; an *APIError raised from a malformed +// request (invalid argument) is not. +func isTransportErrorRetryable(err error) bool { + if _, ok := AsAPIError(err); ok { + return false + } + return true +} + +// randomizedDelay returns a delay chosen randomly from [delay, 2*delay), matching the +// exponential-backoff-with-jitter algorithm described in the Apify API docs. +func randomizedDelay(delay time.Duration) time.Duration { + if delay <= 0 { + return delay + } + return delay + time.Duration(rand.Int63n(int64(delay))) +} + +// sleepWithContext sleeps for d, returning false if ctx is cancelled first. +func sleepWithContext(ctx context.Context, d time.Duration) bool { + timer := time.NewTimer(d) + defer timer.Stop() + select { + case <-timer.C: + return true + case <-ctx.Done(): + return false + } +} + +func minDuration(a, b time.Duration) time.Duration { + if a < b { + return a + } + return b +} + +// extractPath returns the path+query portion of a URL, for error reporting. +func extractPath(url string) string { + rest := url + if i := strings.Index(rest, "://"); i >= 0 { + rest = rest[i+3:] + } + if i := strings.IndexByte(rest, '/'); i >= 0 { + return rest[i:] + } + return "" +} diff --git a/key_value_store.go b/key_value_store.go new file mode 100644 index 0000000..4c7ec02 --- /dev/null +++ b/key_value_store.go @@ -0,0 +1,205 @@ +package apify + +import ( + "context" + "encoding/json" + "net/http" +) + +// ListKeysOptions configures [KeyValueStoreClient.ListKeys]. +type ListKeysOptions struct { + // Limit is the maximum number of keys to return. + Limit *int64 + // ExclusiveStartKey lists keys after this one (for pagination). + ExclusiveStartKey *string + // Prefix restricts the listing to keys with this prefix. + Prefix *string + // Collection restricts the listing to a named collection of keys. + Collection *string + // Signature is a pre-shared URL signature granting access without an API token. + Signature *string +} + +func (o ListKeysOptions) apply(q *QueryParams) { + q.AddInt("limit", o.Limit). + AddString("exclusiveStartKey", o.ExclusiveStartKey). + AddString("prefix", o.Prefix). + AddString("collection", o.Collection). + AddString("signature", o.Signature) +} + +// GetRecordsOptions configures [KeyValueStoreClient.GetRecords]. +type GetRecordsOptions struct { + // Collection restricts the download to a named collection of records. + Collection *string + // Prefix restricts the download to records with this key prefix. + Prefix *string + // Signature is a pre-shared URL signature granting access without an API token. + Signature *string +} + +func (o GetRecordsOptions) apply(q *QueryParams) { + q.AddString("collection", o.Collection). + AddString("prefix", o.Prefix). + AddString("signature", o.Signature) +} + +// GetRecordOptions configures [KeyValueStoreClient.GetRecordWithOptions]. +type GetRecordOptions struct { + // Attachment, if set, controls the Content-Disposition: attachment behaviour. + Attachment *bool + // Signature is a pre-shared URL signature granting access without an API token. + Signature *string +} + +func (o GetRecordOptions) apply(q *QueryParams) { + q.AddBool("attachment", o.Attachment).AddString("signature", o.Signature) +} + +// KeyValueStoreClient is a client for a specific key-value store (and run-nested variants). +type KeyValueStoreClient struct { + ctx *resourceContext +} + +func newKeyValueStoreClient(hc *httpClient, baseURL, resourcePath, id string) *KeyValueStoreClient { + return &KeyValueStoreClient{ctx: newSingleContext(hc, baseURL, resourcePath, id)} +} + +// newKeyValueStoreNestedClient creates a client for a run's default key-value store. +func newKeyValueStoreNestedClient(hc *httpClient, base, subPath string) *KeyValueStoreClient { + return &KeyValueStoreClient{ctx: newCollectionContext(hc, base, subPath)} +} + +// withPublicBase sets the public origin used when building shareable URLs. +func (c *KeyValueStoreClient) withPublicBase(publicBaseURL string) *KeyValueStoreClient { + c.ctx = c.ctx.withPublicOrigin(publicBaseURL) + return c +} + +// Get fetches the store metadata. The bool reports whether it exists. +func (c *KeyValueStoreClient) Get(ctx context.Context) (KeyValueStore, bool, error) { + return getResource[KeyValueStore](ctx, c.ctx, "", NewQueryParams()) +} + +// Update updates the store metadata (e.g. name) and returns the updated object. +func (c *KeyValueStoreClient) Update(ctx context.Context, newFields any) (KeyValueStore, error) { + return updateResource[KeyValueStore](ctx, c.ctx, "", newFields) +} + +// Delete deletes the store. +func (c *KeyValueStoreClient) Delete(ctx context.Context) error { + return deleteResource(ctx, c.ctx, "") +} + +// ListKeys lists the keys stored in this key-value store. +func (c *KeyValueStoreClient) ListKeys(ctx context.Context, options ListKeysOptions) (KeyValueStoreKeysPage, error) { + params := NewQueryParams() + options.apply(params) + return getResourceRequired[KeyValueStoreKeysPage](ctx, c.ctx, "keys", params) +} + +// GetRecords downloads all records of the store (optionally filtered) as a ZIP archive, +// returning the raw bytes. +func (c *KeyValueStoreClient) GetRecords(ctx context.Context, options GetRecordsOptions) ([]byte, error) { + params := NewQueryParams() + options.apply(params) + url := params.applyToURL(c.ctx.subURL("records")) + resp, err := c.ctx.http.call(ctx, http.MethodGet, url, nil, "", defaultRequestTimeout) + if err != nil { + return nil, err + } + return resp.body, nil +} + +// RecordExists reports whether a record with the given key exists. +func (c *KeyValueStoreClient) RecordExists(ctx context.Context, key string) (bool, error) { + return headExists(ctx, c.ctx, "records/"+encodePathSegment(key), NewQueryParams()) +} + +// GetRecord fetches a record by key, or (nil, false, nil) if it does not exist. The value +// holds the raw bytes; the content type is reported in the record. +// +// Like the reference client, it sends attachment=true so the API returns the record's raw +// bytes directly (rather than redirecting). Use [GetRecordWithOptions] to override this. +func (c *KeyValueStoreClient) GetRecord(ctx context.Context, key string) (*KeyValueStoreRecord, bool, error) { + return c.GetRecordWithOptions(ctx, key, GetRecordOptions{Attachment: ptrBool(true)}) +} + +// ptrBool returns a pointer to b. Tiny helper so GetRecord can default attachment=true. +func ptrBool(b bool) *bool { return &b } + +// GetRecordWithOptions fetches a record with explicit options (attachment, signature). +func (c *KeyValueStoreClient) GetRecordWithOptions(ctx context.Context, key string, options GetRecordOptions) (*KeyValueStoreRecord, bool, error) { + params := NewQueryParams() + options.apply(params) + resp, err := getRaw(ctx, c.ctx, "records/"+encodePathSegment(key), params) + if err != nil { + return nil, false, err + } + if resp == nil { + return nil, false, nil + } + return &KeyValueStoreRecord{ + Key: key, + Value: resp.body, + ContentType: resp.header.Get("Content-Type"), + }, true, nil +} + +// SetRecordRaw stores a record with raw bytes and the given content type. +func (c *KeyValueStoreClient) SetRecordRaw(ctx context.Context, key string, value []byte, contentType string) error { + return putRaw(ctx, c.ctx, "records/"+encodePathSegment(key), NewQueryParams(), value, contentType) +} + +// SetRecordJSON stores a record holding the JSON serialization of value. +func (c *KeyValueStoreClient) SetRecordJSON(ctx context.Context, key string, value any) error { + data, err := json.Marshal(value) + if err != nil { + return err + } + return c.SetRecordRaw(ctx, key, data, contentTypeJSONCharset) +} + +// DeleteRecord deletes a record by key. +func (c *KeyValueStoreClient) DeleteRecord(ctx context.Context, key string) error { + return deleteResource(ctx, c.ctx, "records/"+encodePathSegment(key)) +} + +// GetRecordPublicURL builds a public URL for fetching the given record. +// +// It mirrors the reference client: it fetches the store, and if the store exposes a +// URL-signing secret key (i.e. it is private), appends an HMAC-SHA256 signature so the URL +// grants access without an API token. The URL is built from the configured public base URL. +func (c *KeyValueStoreClient) GetRecordPublicURL(ctx context.Context, key string) (string, error) { + params := NewQueryParams() + store, present, err := c.Get(ctx) + if err != nil { + return "", err + } + if present { + if secret := extractString(store.Extra, "urlSigningSecretKey"); secret != "" { + sig := createHmacSignature(secret, key) + params.AddString("signature", &sig) + } + } + return params.applyToURL(c.ctx.publicURL("records/" + encodePathSegment(key))), nil +} + +// CreateKeysPublicURL builds a public URL for listing this store's keys. +// +// As with GetRecordPublicURL, a signature is appended for private stores. expiresInSecs +// optionally bounds the validity of a signed URL (nil for non-expiring). +func (c *KeyValueStoreClient) CreateKeysPublicURL(ctx context.Context, expiresInSecs *int64) (string, error) { + params := NewQueryParams() + store, present, err := c.Get(ctx) + if err != nil { + return "", err + } + if present { + if secret := extractString(store.Extra, "urlSigningSecretKey"); secret != "" { + sig := signStorageContent(secret, store.ID, expiresInSecs) + params.AddString("signature", &sig) + } + } + return params.applyToURL(c.ctx.publicURL("keys")), nil +} diff --git a/key_value_store_collection.go b/key_value_store_collection.go new file mode 100644 index 0000000..5136bd1 --- /dev/null +++ b/key_value_store_collection.go @@ -0,0 +1,26 @@ +package apify + +import "context" + +// KeyValueStoreCollectionClient is a client for the key-value store collection +// (GET/POST /v2/key-value-stores). +type KeyValueStoreCollectionClient struct { + ctx *resourceContext +} + +func newKeyValueStoreCollectionClient(hc *httpClient, baseURL string) *KeyValueStoreCollectionClient { + return &KeyValueStoreCollectionClient{ctx: newCollectionContext(hc, baseURL, "key-value-stores")} +} + +// List lists key-value stores. +func (c *KeyValueStoreCollectionClient) List(ctx context.Context, options StorageListOptions) (PaginationList[KeyValueStore], error) { + params := NewQueryParams() + options.apply(params) + return listResource[KeyValueStore](ctx, c.ctx, "", params) +} + +// GetOrCreate gets the store with the given name, creating it if it does not exist. An +// empty name creates a new unnamed store. +func (c *KeyValueStoreCollectionClient) GetOrCreate(ctx context.Context, name string) (KeyValueStore, error) { + return getOrCreateNamed[KeyValueStore](ctx, c.ctx, name) +} diff --git a/log.go b/log.go new file mode 100644 index 0000000..7e0b6ad --- /dev/null +++ b/log.go @@ -0,0 +1,95 @@ +package apify + +import ( + "context" + "io" + "net/http" +) + +// LogClient is a client for accessing the log of an Actor build or run +// (/v2/logs/{buildOrRunId}, or the run/build-nested .../log). +type LogClient struct { + ctx *resourceContext +} + +func newLogClient(hc *httpClient, baseURL, resourcePath, id string) *LogClient { + return &LogClient{ctx: newSingleContext(hc, baseURL, resourcePath, id)} +} + +// newNestedLogClient creates a log client for a run's or build's nested log endpoint +// (e.g. /v2/actor-runs/{runId}/log). +func newNestedLogClient(hc *httpClient, base string) *LogClient { + return &LogClient{ctx: newCollectionContext(hc, base, "log")} +} + +// LogOptions configures log retrieval/streaming. +type LogOptions struct { + // Raw, if true, returns the unprocessed log content (no platform post-processing). + Raw *bool + // Download, if true, sets Content-Disposition so the log is served as a download. + Download *bool +} + +func (o LogOptions) apply(q *QueryParams) { + q.AddBool("raw", o.Raw).AddBool("download", o.Download) +} + +// Get fetches the entire log as text, or ("", false, nil) if the log does not exist. +func (c *LogClient) Get(ctx context.Context) (string, bool, error) { + return c.GetWithOptions(ctx, LogOptions{}) +} + +// GetWithOptions fetches the log with explicit options (raw, download). +func (c *LogClient) GetWithOptions(ctx context.Context, options LogOptions) (string, bool, error) { + params := NewQueryParams() + options.apply(params) + resp, err := getRaw(ctx, c.ctx, "", params) + if err != nil { + return "", false, err + } + if resp == nil { + return "", false, nil + } + return string(resp.body), true, nil +} + +// Stream opens a live, streaming connection to the log and returns a reader over the log +// bytes. The caller is responsible for closing the returned [io.ReadCloser]. +// +// Unlike [LogClient.Get], this bypasses the buffered/retrying transport so the log can be +// followed in real time as the run produces it (the `stream=1` query parameter). Because the +// response is consumed incrementally, it is not retried; transient failures surface to the +// caller. This mirrors the reference clients' streamed-log behaviour used for log redirection. +func (c *LogClient) Stream(ctx context.Context) (io.ReadCloser, error) { + return c.StreamWithOptions(ctx, LogOptions{}) +} + +// StreamWithOptions opens a live log stream with explicit options (raw, download). See +// [LogClient.Stream] for the streaming semantics. +func (c *LogClient) StreamWithOptions(ctx context.Context, options LogOptions) (io.ReadCloser, error) { + params := NewQueryParams() + streamOn := true + params.AddBool("stream", &streamOn) + options.apply(params) + url := c.ctx.mergedParams(params).applyToURL(c.ctx.subURL("")) + + req, err := http.NewRequestWithContext(ctx, http.MethodGet, url, nil) + if err != nil { + return nil, err + } + // Reuse the shared auth/User-Agent header setup so the streaming path can never drift from + // the buffered request path. + c.ctx.http.applyAuthHeaders(req) + + resp, err := c.ctx.http.backend.Do(req) + if err != nil { + return nil, err + } + if resp.StatusCode >= maxSuccessStatusCode { + // Consume and classify the error body, then close. + body, _ := io.ReadAll(resp.Body) + resp.Body.Close() + return nil, buildAPIError(resp.StatusCode, body, 1, http.MethodGet, extractPath(url)) + } + return resp.Body, nil +} diff --git a/model_account_limits.go b/model_account_limits.go deleted file mode 100644 index 7faeabc..0000000 --- a/model_account_limits.go +++ /dev/null @@ -1,214 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" - "bytes" - "fmt" -) - -// checks if the AccountLimits type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &AccountLimits{} - -// AccountLimits struct for AccountLimits -type AccountLimits struct { - MonthlyUsageCycle UsageCycle `json:"monthlyUsageCycle"` - Limits Limits `json:"limits"` - Current Current `json:"current"` -} - -type _AccountLimits AccountLimits - -// NewAccountLimits instantiates a new AccountLimits object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewAccountLimits(monthlyUsageCycle UsageCycle, limits Limits, current Current) *AccountLimits { - this := AccountLimits{} - this.MonthlyUsageCycle = monthlyUsageCycle - this.Limits = limits - this.Current = current - return &this -} - -// NewAccountLimitsWithDefaults instantiates a new AccountLimits object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewAccountLimitsWithDefaults() *AccountLimits { - this := AccountLimits{} - return &this -} - -// GetMonthlyUsageCycle returns the MonthlyUsageCycle field value -func (o *AccountLimits) GetMonthlyUsageCycle() UsageCycle { - if o == nil { - var ret UsageCycle - return ret - } - - return o.MonthlyUsageCycle -} - -// GetMonthlyUsageCycleOk returns a tuple with the MonthlyUsageCycle field value -// and a boolean to check if the value has been set. -func (o *AccountLimits) GetMonthlyUsageCycleOk() (*UsageCycle, bool) { - if o == nil { - return nil, false - } - return &o.MonthlyUsageCycle, true -} - -// SetMonthlyUsageCycle sets field value -func (o *AccountLimits) SetMonthlyUsageCycle(v UsageCycle) { - o.MonthlyUsageCycle = v -} - -// GetLimits returns the Limits field value -func (o *AccountLimits) GetLimits() Limits { - if o == nil { - var ret Limits - return ret - } - - return o.Limits -} - -// GetLimitsOk returns a tuple with the Limits field value -// and a boolean to check if the value has been set. -func (o *AccountLimits) GetLimitsOk() (*Limits, bool) { - if o == nil { - return nil, false - } - return &o.Limits, true -} - -// SetLimits sets field value -func (o *AccountLimits) SetLimits(v Limits) { - o.Limits = v -} - -// GetCurrent returns the Current field value -func (o *AccountLimits) GetCurrent() Current { - if o == nil { - var ret Current - return ret - } - - return o.Current -} - -// GetCurrentOk returns a tuple with the Current field value -// and a boolean to check if the value has been set. -func (o *AccountLimits) GetCurrentOk() (*Current, bool) { - if o == nil { - return nil, false - } - return &o.Current, true -} - -// SetCurrent sets field value -func (o *AccountLimits) SetCurrent(v Current) { - o.Current = v -} - -func (o AccountLimits) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o AccountLimits) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["monthlyUsageCycle"] = o.MonthlyUsageCycle - toSerialize["limits"] = o.Limits - toSerialize["current"] = o.Current - return toSerialize, nil -} - -func (o *AccountLimits) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "monthlyUsageCycle", - "limits", - "current", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err; - } - - for _, requiredProperty := range(requiredProperties) { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varAccountLimits := _AccountLimits{} - - decoder := json.NewDecoder(bytes.NewReader(data)) - decoder.DisallowUnknownFields() - err = decoder.Decode(&varAccountLimits) - - if err != nil { - return err - } - - *o = AccountLimits(varAccountLimits) - - return err -} - -type NullableAccountLimits struct { - value *AccountLimits - isSet bool -} - -func (v NullableAccountLimits) Get() *AccountLimits { - return v.value -} - -func (v *NullableAccountLimits) Set(val *AccountLimits) { - v.value = val - v.isSet = true -} - -func (v NullableAccountLimits) IsSet() bool { - return v.isSet -} - -func (v *NullableAccountLimits) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableAccountLimits(val *AccountLimits) *NullableAccountLimits { - return &NullableAccountLimits{value: val, isSet: true} -} - -func (v NullableAccountLimits) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableAccountLimits) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_act_runs_last_dataset_items_post_400_response.go b/model_act_runs_last_dataset_items_post_400_response.go deleted file mode 100644 index 39dd953..0000000 --- a/model_act_runs_last_dataset_items_post_400_response.go +++ /dev/null @@ -1,107 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" - "fmt" -) - - -// ActRunsLastDatasetItemsPost400Response struct for ActRunsLastDatasetItemsPost400Response -type ActRunsLastDatasetItemsPost400Response struct { - ErrorResponse *ErrorResponse - PutItemResponseError *PutItemResponseError -} - -// Unmarshal JSON data into any of the pointers in the struct -func (dst *ActRunsLastDatasetItemsPost400Response) UnmarshalJSON(data []byte) error { - var err error - // try to unmarshal JSON data into ErrorResponse - err = json.Unmarshal(data, &dst.ErrorResponse); - if err == nil { - jsonErrorResponse, _ := json.Marshal(dst.ErrorResponse) - if string(jsonErrorResponse) == "{}" { // empty struct - dst.ErrorResponse = nil - } else { - return nil // data stored in dst.ErrorResponse, return on the first match - } - } else { - dst.ErrorResponse = nil - } - - // try to unmarshal JSON data into PutItemResponseError - err = json.Unmarshal(data, &dst.PutItemResponseError); - if err == nil { - jsonPutItemResponseError, _ := json.Marshal(dst.PutItemResponseError) - if string(jsonPutItemResponseError) == "{}" { // empty struct - dst.PutItemResponseError = nil - } else { - return nil // data stored in dst.PutItemResponseError, return on the first match - } - } else { - dst.PutItemResponseError = nil - } - - return fmt.Errorf("data failed to match schemas in anyOf(ActRunsLastDatasetItemsPost400Response)") -} - -// Marshal data from the first non-nil pointers in the struct to JSON -func (src ActRunsLastDatasetItemsPost400Response) MarshalJSON() ([]byte, error) { - if src.ErrorResponse != nil { - return json.Marshal(&src.ErrorResponse) - } - - if src.PutItemResponseError != nil { - return json.Marshal(&src.PutItemResponseError) - } - - return nil, nil // no data in anyOf schemas -} - - -type NullableActRunsLastDatasetItemsPost400Response struct { - value *ActRunsLastDatasetItemsPost400Response - isSet bool -} - -func (v NullableActRunsLastDatasetItemsPost400Response) Get() *ActRunsLastDatasetItemsPost400Response { - return v.value -} - -func (v *NullableActRunsLastDatasetItemsPost400Response) Set(val *ActRunsLastDatasetItemsPost400Response) { - v.value = val - v.isSet = true -} - -func (v NullableActRunsLastDatasetItemsPost400Response) IsSet() bool { - return v.isSet -} - -func (v *NullableActRunsLastDatasetItemsPost400Response) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableActRunsLastDatasetItemsPost400Response(val *ActRunsLastDatasetItemsPost400Response) *NullableActRunsLastDatasetItemsPost400Response { - return &NullableActRunsLastDatasetItemsPost400Response{value: val, isSet: true} -} - -func (v NullableActRunsLastDatasetItemsPost400Response) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableActRunsLastDatasetItemsPost400Response) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_act_runs_last_dataset_items_post_request.go b/model_act_runs_last_dataset_items_post_request.go deleted file mode 100644 index cbfbe14..0000000 --- a/model_act_runs_last_dataset_items_post_request.go +++ /dev/null @@ -1,171 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" - "fmt" - "gopkg.in/validator.v2" -) - -// ActRunsLastDatasetItemsPostRequest - -type ActRunsLastDatasetItemsPostRequest struct { - ArrayOfMapmapOfStringAny *[]map[string]interface{} - MapmapOfStringAny *map[string]interface{} -} - -// []map[string]interface{}AsActRunsLastDatasetItemsPostRequest is a convenience function that returns []map[string]interface{} wrapped in ActRunsLastDatasetItemsPostRequest -func ArrayOfMapmapOfStringAnyAsActRunsLastDatasetItemsPostRequest(v *[]map[string]interface{}) ActRunsLastDatasetItemsPostRequest { - return ActRunsLastDatasetItemsPostRequest{ - ArrayOfMapmapOfStringAny: v, - } -} - -// map[string]interface{}AsActRunsLastDatasetItemsPostRequest is a convenience function that returns map[string]interface{} wrapped in ActRunsLastDatasetItemsPostRequest -func MapmapOfStringAnyAsActRunsLastDatasetItemsPostRequest(v *map[string]interface{}) ActRunsLastDatasetItemsPostRequest { - return ActRunsLastDatasetItemsPostRequest{ - MapmapOfStringAny: v, - } -} - - -// Unmarshal JSON data into one of the pointers in the struct -func (dst *ActRunsLastDatasetItemsPostRequest) UnmarshalJSON(data []byte) error { - var err error - match := 0 - // try to unmarshal data into ArrayOfMapmapOfStringAny - err = newStrictDecoder(data).Decode(&dst.ArrayOfMapmapOfStringAny) - if err == nil { - jsonArrayOfMapmapOfStringAny, _ := json.Marshal(dst.ArrayOfMapmapOfStringAny) - if string(jsonArrayOfMapmapOfStringAny) == "{}" { // empty struct - dst.ArrayOfMapmapOfStringAny = nil - } else { - if err = validator.Validate(dst.ArrayOfMapmapOfStringAny); err != nil { - dst.ArrayOfMapmapOfStringAny = nil - } else { - match++ - } - } - } else { - dst.ArrayOfMapmapOfStringAny = nil - } - - // try to unmarshal data into MapmapOfStringAny - err = newStrictDecoder(data).Decode(&dst.MapmapOfStringAny) - if err == nil { - jsonMapmapOfStringAny, _ := json.Marshal(dst.MapmapOfStringAny) - if string(jsonMapmapOfStringAny) == "{}" { // empty struct - dst.MapmapOfStringAny = nil - } else { - if err = validator.Validate(dst.MapmapOfStringAny); err != nil { - dst.MapmapOfStringAny = nil - } else { - match++ - } - } - } else { - dst.MapmapOfStringAny = nil - } - - if match > 1 { // more than 1 match - // reset to nil - dst.ArrayOfMapmapOfStringAny = nil - dst.MapmapOfStringAny = nil - - return fmt.Errorf("data matches more than one schema in oneOf(ActRunsLastDatasetItemsPostRequest)") - } else if match == 1 { - return nil // exactly one match - } else { // no match - return fmt.Errorf("data failed to match schemas in oneOf(ActRunsLastDatasetItemsPostRequest)") - } -} - -// Marshal data from the first non-nil pointers in the struct to JSON -func (src ActRunsLastDatasetItemsPostRequest) MarshalJSON() ([]byte, error) { - if src.ArrayOfMapmapOfStringAny != nil { - return json.Marshal(&src.ArrayOfMapmapOfStringAny) - } - - if src.MapmapOfStringAny != nil { - return json.Marshal(&src.MapmapOfStringAny) - } - - return nil, nil // no data in oneOf schemas -} - -// Get the actual instance -func (obj *ActRunsLastDatasetItemsPostRequest) GetActualInstance() (interface{}) { - if obj == nil { - return nil - } - if obj.ArrayOfMapmapOfStringAny != nil { - return obj.ArrayOfMapmapOfStringAny - } - - if obj.MapmapOfStringAny != nil { - return obj.MapmapOfStringAny - } - - // all schemas are nil - return nil -} - -// Get the actual instance value -func (obj ActRunsLastDatasetItemsPostRequest) GetActualInstanceValue() (interface{}) { - if obj.ArrayOfMapmapOfStringAny != nil { - return *obj.ArrayOfMapmapOfStringAny - } - - if obj.MapmapOfStringAny != nil { - return *obj.MapmapOfStringAny - } - - // all schemas are nil - return nil -} - -type NullableActRunsLastDatasetItemsPostRequest struct { - value *ActRunsLastDatasetItemsPostRequest - isSet bool -} - -func (v NullableActRunsLastDatasetItemsPostRequest) Get() *ActRunsLastDatasetItemsPostRequest { - return v.value -} - -func (v *NullableActRunsLastDatasetItemsPostRequest) Set(val *ActRunsLastDatasetItemsPostRequest) { - v.value = val - v.isSet = true -} - -func (v NullableActRunsLastDatasetItemsPostRequest) IsSet() bool { - return v.isSet -} - -func (v *NullableActRunsLastDatasetItemsPostRequest) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableActRunsLastDatasetItemsPostRequest(val *ActRunsLastDatasetItemsPostRequest) *NullableActRunsLastDatasetItemsPostRequest { - return &NullableActRunsLastDatasetItemsPostRequest{value: val, isSet: true} -} - -func (v NullableActRunsLastDatasetItemsPostRequest) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableActRunsLastDatasetItemsPostRequest) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_act_validate_input_post_200_response.go b/model_act_validate_input_post_200_response.go deleted file mode 100644 index bc3e75e..0000000 --- a/model_act_validate_input_post_200_response.go +++ /dev/null @@ -1,159 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" - "bytes" - "fmt" -) - -// checks if the ActValidateInputPost200Response type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &ActValidateInputPost200Response{} - -// ActValidateInputPost200Response struct for ActValidateInputPost200Response -type ActValidateInputPost200Response struct { - // Whether the input is valid according to the Actor's input schema. - Valid bool `json:"valid"` -} - -type _ActValidateInputPost200Response ActValidateInputPost200Response - -// NewActValidateInputPost200Response instantiates a new ActValidateInputPost200Response object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewActValidateInputPost200Response(valid bool) *ActValidateInputPost200Response { - this := ActValidateInputPost200Response{} - this.Valid = valid - return &this -} - -// NewActValidateInputPost200ResponseWithDefaults instantiates a new ActValidateInputPost200Response object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewActValidateInputPost200ResponseWithDefaults() *ActValidateInputPost200Response { - this := ActValidateInputPost200Response{} - return &this -} - -// GetValid returns the Valid field value -func (o *ActValidateInputPost200Response) GetValid() bool { - if o == nil { - var ret bool - return ret - } - - return o.Valid -} - -// GetValidOk returns a tuple with the Valid field value -// and a boolean to check if the value has been set. -func (o *ActValidateInputPost200Response) GetValidOk() (*bool, bool) { - if o == nil { - return nil, false - } - return &o.Valid, true -} - -// SetValid sets field value -func (o *ActValidateInputPost200Response) SetValid(v bool) { - o.Valid = v -} - -func (o ActValidateInputPost200Response) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o ActValidateInputPost200Response) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["valid"] = o.Valid - return toSerialize, nil -} - -func (o *ActValidateInputPost200Response) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "valid", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err; - } - - for _, requiredProperty := range(requiredProperties) { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varActValidateInputPost200Response := _ActValidateInputPost200Response{} - - decoder := json.NewDecoder(bytes.NewReader(data)) - decoder.DisallowUnknownFields() - err = decoder.Decode(&varActValidateInputPost200Response) - - if err != nil { - return err - } - - *o = ActValidateInputPost200Response(varActValidateInputPost200Response) - - return err -} - -type NullableActValidateInputPost200Response struct { - value *ActValidateInputPost200Response - isSet bool -} - -func (v NullableActValidateInputPost200Response) Get() *ActValidateInputPost200Response { - return v.value -} - -func (v *NullableActValidateInputPost200Response) Set(val *ActValidateInputPost200Response) { - v.value = val - v.isSet = true -} - -func (v NullableActValidateInputPost200Response) IsSet() bool { - return v.isSet -} - -func (v *NullableActValidateInputPost200Response) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableActValidateInputPost200Response(val *ActValidateInputPost200Response) *NullableActValidateInputPost200Response { - return &NullableActValidateInputPost200Response{value: val, isSet: true} -} - -func (v NullableActValidateInputPost200Response) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableActValidateInputPost200Response) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_actor.go b/model_actor.go deleted file mode 100644 index 0ed1086..0000000 --- a/model_actor.go +++ /dev/null @@ -1,1265 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" - "time" - "bytes" - "fmt" -) - -// checks if the Actor type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &Actor{} - -// Actor struct for Actor -type Actor struct { - Id string `json:"id"` - UserId string `json:"userId"` - Name string `json:"name"` - Username string `json:"username"` - Description NullableString `json:"description,omitempty"` - // Deprecated - RestartOnError *bool `json:"restartOnError,omitempty"` - IsPublic bool `json:"isPublic"` - ActorPermissionLevel *ActorPermissionLevel `json:"actorPermissionLevel,omitempty"` - CreatedAt time.Time `json:"createdAt"` - ModifiedAt time.Time `json:"modifiedAt"` - Stats ActorStats `json:"stats"` - // - Versions []Version `json:"versions"` - PricingInfos []ActorRunPricingInfo `json:"pricingInfos,omitempty"` - DefaultRunOptions DefaultRunOptions `json:"defaultRunOptions"` - ExampleRunInput NullableExampleRunInput `json:"exampleRunInput,omitempty"` - IsDeprecated NullableBool `json:"isDeprecated,omitempty"` - DeploymentKey *string `json:"deploymentKey,omitempty"` - Title NullableString `json:"title,omitempty"` - // A dictionary mapping build tag names (e.g., \"latest\", \"beta\") to their build information. - TaggedBuilds map[string]TaggedBuildsValue `json:"taggedBuilds,omitempty"` - ActorStandby NullableActorStandby `json:"actorStandby,omitempty"` - // A brief, LLM-generated readme summary - ReadmeSummary *string `json:"readmeSummary,omitempty"` - SeoTitle NullableString `json:"seoTitle,omitempty"` - SeoDescription NullableString `json:"seoDescription,omitempty"` - PictureUrl NullableString `json:"pictureUrl,omitempty"` - StandbyUrl NullableString `json:"standbyUrl,omitempty"` - Notice *string `json:"notice,omitempty"` - Categories []string `json:"categories,omitempty"` - IsCritical *bool `json:"isCritical,omitempty"` - IsGeneric *bool `json:"isGeneric,omitempty"` - IsSourceCodeHidden *bool `json:"isSourceCodeHidden,omitempty"` - HasNoDataset *bool `json:"hasNoDataset,omitempty"` -} - -type _Actor Actor - -// NewActor instantiates a new Actor object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewActor(id string, userId string, name string, username string, isPublic bool, createdAt time.Time, modifiedAt time.Time, stats ActorStats, versions []Version, defaultRunOptions DefaultRunOptions) *Actor { - this := Actor{} - this.Id = id - this.UserId = userId - this.Name = name - this.Username = username - this.IsPublic = isPublic - this.CreatedAt = createdAt - this.ModifiedAt = modifiedAt - this.Stats = stats - this.Versions = versions - this.DefaultRunOptions = defaultRunOptions - return &this -} - -// NewActorWithDefaults instantiates a new Actor object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewActorWithDefaults() *Actor { - this := Actor{} - return &this -} - -// GetId returns the Id field value -func (o *Actor) GetId() string { - if o == nil { - var ret string - return ret - } - - return o.Id -} - -// GetIdOk returns a tuple with the Id field value -// and a boolean to check if the value has been set. -func (o *Actor) GetIdOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Id, true -} - -// SetId sets field value -func (o *Actor) SetId(v string) { - o.Id = v -} - -// GetUserId returns the UserId field value -func (o *Actor) GetUserId() string { - if o == nil { - var ret string - return ret - } - - return o.UserId -} - -// GetUserIdOk returns a tuple with the UserId field value -// and a boolean to check if the value has been set. -func (o *Actor) GetUserIdOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.UserId, true -} - -// SetUserId sets field value -func (o *Actor) SetUserId(v string) { - o.UserId = v -} - -// GetName returns the Name field value -func (o *Actor) GetName() string { - if o == nil { - var ret string - return ret - } - - return o.Name -} - -// GetNameOk returns a tuple with the Name field value -// and a boolean to check if the value has been set. -func (o *Actor) GetNameOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Name, true -} - -// SetName sets field value -func (o *Actor) SetName(v string) { - o.Name = v -} - -// GetUsername returns the Username field value -func (o *Actor) GetUsername() string { - if o == nil { - var ret string - return ret - } - - return o.Username -} - -// GetUsernameOk returns a tuple with the Username field value -// and a boolean to check if the value has been set. -func (o *Actor) GetUsernameOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Username, true -} - -// SetUsername sets field value -func (o *Actor) SetUsername(v string) { - o.Username = v -} - -// GetDescription returns the Description field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *Actor) GetDescription() string { - if o == nil || IsNil(o.Description.Get()) { - var ret string - return ret - } - return *o.Description.Get() -} - -// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *Actor) GetDescriptionOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.Description.Get(), o.Description.IsSet() -} - -// HasDescription returns a boolean if a field has been set. -func (o *Actor) HasDescription() bool { - if o != nil && o.Description.IsSet() { - return true - } - - return false -} - -// SetDescription gets a reference to the given NullableString and assigns it to the Description field. -func (o *Actor) SetDescription(v string) { - o.Description.Set(&v) -} -// SetDescriptionNil sets the value for Description to be an explicit nil -func (o *Actor) SetDescriptionNil() { - o.Description.Set(nil) -} - -// UnsetDescription ensures that no value is present for Description, not even an explicit nil -func (o *Actor) UnsetDescription() { - o.Description.Unset() -} - -// GetRestartOnError returns the RestartOnError field value if set, zero value otherwise. -// Deprecated -func (o *Actor) GetRestartOnError() bool { - if o == nil || IsNil(o.RestartOnError) { - var ret bool - return ret - } - return *o.RestartOnError -} - -// GetRestartOnErrorOk returns a tuple with the RestartOnError field value if set, nil otherwise -// and a boolean to check if the value has been set. -// Deprecated -func (o *Actor) GetRestartOnErrorOk() (*bool, bool) { - if o == nil || IsNil(o.RestartOnError) { - return nil, false - } - return o.RestartOnError, true -} - -// HasRestartOnError returns a boolean if a field has been set. -func (o *Actor) HasRestartOnError() bool { - if o != nil && !IsNil(o.RestartOnError) { - return true - } - - return false -} - -// SetRestartOnError gets a reference to the given bool and assigns it to the RestartOnError field. -// Deprecated -func (o *Actor) SetRestartOnError(v bool) { - o.RestartOnError = &v -} - -// GetIsPublic returns the IsPublic field value -func (o *Actor) GetIsPublic() bool { - if o == nil { - var ret bool - return ret - } - - return o.IsPublic -} - -// GetIsPublicOk returns a tuple with the IsPublic field value -// and a boolean to check if the value has been set. -func (o *Actor) GetIsPublicOk() (*bool, bool) { - if o == nil { - return nil, false - } - return &o.IsPublic, true -} - -// SetIsPublic sets field value -func (o *Actor) SetIsPublic(v bool) { - o.IsPublic = v -} - -// GetActorPermissionLevel returns the ActorPermissionLevel field value if set, zero value otherwise. -func (o *Actor) GetActorPermissionLevel() ActorPermissionLevel { - if o == nil || IsNil(o.ActorPermissionLevel) { - var ret ActorPermissionLevel - return ret - } - return *o.ActorPermissionLevel -} - -// GetActorPermissionLevelOk returns a tuple with the ActorPermissionLevel field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Actor) GetActorPermissionLevelOk() (*ActorPermissionLevel, bool) { - if o == nil || IsNil(o.ActorPermissionLevel) { - return nil, false - } - return o.ActorPermissionLevel, true -} - -// HasActorPermissionLevel returns a boolean if a field has been set. -func (o *Actor) HasActorPermissionLevel() bool { - if o != nil && !IsNil(o.ActorPermissionLevel) { - return true - } - - return false -} - -// SetActorPermissionLevel gets a reference to the given ActorPermissionLevel and assigns it to the ActorPermissionLevel field. -func (o *Actor) SetActorPermissionLevel(v ActorPermissionLevel) { - o.ActorPermissionLevel = &v -} - -// GetCreatedAt returns the CreatedAt field value -func (o *Actor) GetCreatedAt() time.Time { - if o == nil { - var ret time.Time - return ret - } - - return o.CreatedAt -} - -// GetCreatedAtOk returns a tuple with the CreatedAt field value -// and a boolean to check if the value has been set. -func (o *Actor) GetCreatedAtOk() (*time.Time, bool) { - if o == nil { - return nil, false - } - return &o.CreatedAt, true -} - -// SetCreatedAt sets field value -func (o *Actor) SetCreatedAt(v time.Time) { - o.CreatedAt = v -} - -// GetModifiedAt returns the ModifiedAt field value -func (o *Actor) GetModifiedAt() time.Time { - if o == nil { - var ret time.Time - return ret - } - - return o.ModifiedAt -} - -// GetModifiedAtOk returns a tuple with the ModifiedAt field value -// and a boolean to check if the value has been set. -func (o *Actor) GetModifiedAtOk() (*time.Time, bool) { - if o == nil { - return nil, false - } - return &o.ModifiedAt, true -} - -// SetModifiedAt sets field value -func (o *Actor) SetModifiedAt(v time.Time) { - o.ModifiedAt = v -} - -// GetStats returns the Stats field value -func (o *Actor) GetStats() ActorStats { - if o == nil { - var ret ActorStats - return ret - } - - return o.Stats -} - -// GetStatsOk returns a tuple with the Stats field value -// and a boolean to check if the value has been set. -func (o *Actor) GetStatsOk() (*ActorStats, bool) { - if o == nil { - return nil, false - } - return &o.Stats, true -} - -// SetStats sets field value -func (o *Actor) SetStats(v ActorStats) { - o.Stats = v -} - -// GetVersions returns the Versions field value -func (o *Actor) GetVersions() []Version { - if o == nil { - var ret []Version - return ret - } - - return o.Versions -} - -// GetVersionsOk returns a tuple with the Versions field value -// and a boolean to check if the value has been set. -func (o *Actor) GetVersionsOk() ([]Version, bool) { - if o == nil { - return nil, false - } - return o.Versions, true -} - -// SetVersions sets field value -func (o *Actor) SetVersions(v []Version) { - o.Versions = v -} - -// GetPricingInfos returns the PricingInfos field value if set, zero value otherwise. -func (o *Actor) GetPricingInfos() []ActorRunPricingInfo { - if o == nil || IsNil(o.PricingInfos) { - var ret []ActorRunPricingInfo - return ret - } - return o.PricingInfos -} - -// GetPricingInfosOk returns a tuple with the PricingInfos field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Actor) GetPricingInfosOk() ([]ActorRunPricingInfo, bool) { - if o == nil || IsNil(o.PricingInfos) { - return nil, false - } - return o.PricingInfos, true -} - -// HasPricingInfos returns a boolean if a field has been set. -func (o *Actor) HasPricingInfos() bool { - if o != nil && !IsNil(o.PricingInfos) { - return true - } - - return false -} - -// SetPricingInfos gets a reference to the given []ActorRunPricingInfo and assigns it to the PricingInfos field. -func (o *Actor) SetPricingInfos(v []ActorRunPricingInfo) { - o.PricingInfos = v -} - -// GetDefaultRunOptions returns the DefaultRunOptions field value -func (o *Actor) GetDefaultRunOptions() DefaultRunOptions { - if o == nil { - var ret DefaultRunOptions - return ret - } - - return o.DefaultRunOptions -} - -// GetDefaultRunOptionsOk returns a tuple with the DefaultRunOptions field value -// and a boolean to check if the value has been set. -func (o *Actor) GetDefaultRunOptionsOk() (*DefaultRunOptions, bool) { - if o == nil { - return nil, false - } - return &o.DefaultRunOptions, true -} - -// SetDefaultRunOptions sets field value -func (o *Actor) SetDefaultRunOptions(v DefaultRunOptions) { - o.DefaultRunOptions = v -} - -// GetExampleRunInput returns the ExampleRunInput field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *Actor) GetExampleRunInput() ExampleRunInput { - if o == nil || IsNil(o.ExampleRunInput.Get()) { - var ret ExampleRunInput - return ret - } - return *o.ExampleRunInput.Get() -} - -// GetExampleRunInputOk returns a tuple with the ExampleRunInput field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *Actor) GetExampleRunInputOk() (*ExampleRunInput, bool) { - if o == nil { - return nil, false - } - return o.ExampleRunInput.Get(), o.ExampleRunInput.IsSet() -} - -// HasExampleRunInput returns a boolean if a field has been set. -func (o *Actor) HasExampleRunInput() bool { - if o != nil && o.ExampleRunInput.IsSet() { - return true - } - - return false -} - -// SetExampleRunInput gets a reference to the given NullableExampleRunInput and assigns it to the ExampleRunInput field. -func (o *Actor) SetExampleRunInput(v ExampleRunInput) { - o.ExampleRunInput.Set(&v) -} -// SetExampleRunInputNil sets the value for ExampleRunInput to be an explicit nil -func (o *Actor) SetExampleRunInputNil() { - o.ExampleRunInput.Set(nil) -} - -// UnsetExampleRunInput ensures that no value is present for ExampleRunInput, not even an explicit nil -func (o *Actor) UnsetExampleRunInput() { - o.ExampleRunInput.Unset() -} - -// GetIsDeprecated returns the IsDeprecated field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *Actor) GetIsDeprecated() bool { - if o == nil || IsNil(o.IsDeprecated.Get()) { - var ret bool - return ret - } - return *o.IsDeprecated.Get() -} - -// GetIsDeprecatedOk returns a tuple with the IsDeprecated field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *Actor) GetIsDeprecatedOk() (*bool, bool) { - if o == nil { - return nil, false - } - return o.IsDeprecated.Get(), o.IsDeprecated.IsSet() -} - -// HasIsDeprecated returns a boolean if a field has been set. -func (o *Actor) HasIsDeprecated() bool { - if o != nil && o.IsDeprecated.IsSet() { - return true - } - - return false -} - -// SetIsDeprecated gets a reference to the given NullableBool and assigns it to the IsDeprecated field. -func (o *Actor) SetIsDeprecated(v bool) { - o.IsDeprecated.Set(&v) -} -// SetIsDeprecatedNil sets the value for IsDeprecated to be an explicit nil -func (o *Actor) SetIsDeprecatedNil() { - o.IsDeprecated.Set(nil) -} - -// UnsetIsDeprecated ensures that no value is present for IsDeprecated, not even an explicit nil -func (o *Actor) UnsetIsDeprecated() { - o.IsDeprecated.Unset() -} - -// GetDeploymentKey returns the DeploymentKey field value if set, zero value otherwise. -func (o *Actor) GetDeploymentKey() string { - if o == nil || IsNil(o.DeploymentKey) { - var ret string - return ret - } - return *o.DeploymentKey -} - -// GetDeploymentKeyOk returns a tuple with the DeploymentKey field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Actor) GetDeploymentKeyOk() (*string, bool) { - if o == nil || IsNil(o.DeploymentKey) { - return nil, false - } - return o.DeploymentKey, true -} - -// HasDeploymentKey returns a boolean if a field has been set. -func (o *Actor) HasDeploymentKey() bool { - if o != nil && !IsNil(o.DeploymentKey) { - return true - } - - return false -} - -// SetDeploymentKey gets a reference to the given string and assigns it to the DeploymentKey field. -func (o *Actor) SetDeploymentKey(v string) { - o.DeploymentKey = &v -} - -// GetTitle returns the Title field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *Actor) GetTitle() string { - if o == nil || IsNil(o.Title.Get()) { - var ret string - return ret - } - return *o.Title.Get() -} - -// GetTitleOk returns a tuple with the Title field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *Actor) GetTitleOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.Title.Get(), o.Title.IsSet() -} - -// HasTitle returns a boolean if a field has been set. -func (o *Actor) HasTitle() bool { - if o != nil && o.Title.IsSet() { - return true - } - - return false -} - -// SetTitle gets a reference to the given NullableString and assigns it to the Title field. -func (o *Actor) SetTitle(v string) { - o.Title.Set(&v) -} -// SetTitleNil sets the value for Title to be an explicit nil -func (o *Actor) SetTitleNil() { - o.Title.Set(nil) -} - -// UnsetTitle ensures that no value is present for Title, not even an explicit nil -func (o *Actor) UnsetTitle() { - o.Title.Unset() -} - -// GetTaggedBuilds returns the TaggedBuilds field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *Actor) GetTaggedBuilds() map[string]TaggedBuildsValue { - if o == nil { - var ret map[string]TaggedBuildsValue - return ret - } - return o.TaggedBuilds -} - -// GetTaggedBuildsOk returns a tuple with the TaggedBuilds field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *Actor) GetTaggedBuildsOk() (map[string]TaggedBuildsValue, bool) { - if o == nil || IsNil(o.TaggedBuilds) { - return map[string]TaggedBuildsValue{}, false - } - return o.TaggedBuilds, true -} - -// HasTaggedBuilds returns a boolean if a field has been set. -func (o *Actor) HasTaggedBuilds() bool { - if o != nil && !IsNil(o.TaggedBuilds) { - return true - } - - return false -} - -// SetTaggedBuilds gets a reference to the given map[string]TaggedBuildsValue and assigns it to the TaggedBuilds field. -func (o *Actor) SetTaggedBuilds(v map[string]TaggedBuildsValue) { - o.TaggedBuilds = v -} - -// GetActorStandby returns the ActorStandby field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *Actor) GetActorStandby() ActorStandby { - if o == nil || IsNil(o.ActorStandby.Get()) { - var ret ActorStandby - return ret - } - return *o.ActorStandby.Get() -} - -// GetActorStandbyOk returns a tuple with the ActorStandby field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *Actor) GetActorStandbyOk() (*ActorStandby, bool) { - if o == nil { - return nil, false - } - return o.ActorStandby.Get(), o.ActorStandby.IsSet() -} - -// HasActorStandby returns a boolean if a field has been set. -func (o *Actor) HasActorStandby() bool { - if o != nil && o.ActorStandby.IsSet() { - return true - } - - return false -} - -// SetActorStandby gets a reference to the given NullableActorStandby and assigns it to the ActorStandby field. -func (o *Actor) SetActorStandby(v ActorStandby) { - o.ActorStandby.Set(&v) -} -// SetActorStandbyNil sets the value for ActorStandby to be an explicit nil -func (o *Actor) SetActorStandbyNil() { - o.ActorStandby.Set(nil) -} - -// UnsetActorStandby ensures that no value is present for ActorStandby, not even an explicit nil -func (o *Actor) UnsetActorStandby() { - o.ActorStandby.Unset() -} - -// GetReadmeSummary returns the ReadmeSummary field value if set, zero value otherwise. -func (o *Actor) GetReadmeSummary() string { - if o == nil || IsNil(o.ReadmeSummary) { - var ret string - return ret - } - return *o.ReadmeSummary -} - -// GetReadmeSummaryOk returns a tuple with the ReadmeSummary field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Actor) GetReadmeSummaryOk() (*string, bool) { - if o == nil || IsNil(o.ReadmeSummary) { - return nil, false - } - return o.ReadmeSummary, true -} - -// HasReadmeSummary returns a boolean if a field has been set. -func (o *Actor) HasReadmeSummary() bool { - if o != nil && !IsNil(o.ReadmeSummary) { - return true - } - - return false -} - -// SetReadmeSummary gets a reference to the given string and assigns it to the ReadmeSummary field. -func (o *Actor) SetReadmeSummary(v string) { - o.ReadmeSummary = &v -} - -// GetSeoTitle returns the SeoTitle field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *Actor) GetSeoTitle() string { - if o == nil || IsNil(o.SeoTitle.Get()) { - var ret string - return ret - } - return *o.SeoTitle.Get() -} - -// GetSeoTitleOk returns a tuple with the SeoTitle field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *Actor) GetSeoTitleOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.SeoTitle.Get(), o.SeoTitle.IsSet() -} - -// HasSeoTitle returns a boolean if a field has been set. -func (o *Actor) HasSeoTitle() bool { - if o != nil && o.SeoTitle.IsSet() { - return true - } - - return false -} - -// SetSeoTitle gets a reference to the given NullableString and assigns it to the SeoTitle field. -func (o *Actor) SetSeoTitle(v string) { - o.SeoTitle.Set(&v) -} -// SetSeoTitleNil sets the value for SeoTitle to be an explicit nil -func (o *Actor) SetSeoTitleNil() { - o.SeoTitle.Set(nil) -} - -// UnsetSeoTitle ensures that no value is present for SeoTitle, not even an explicit nil -func (o *Actor) UnsetSeoTitle() { - o.SeoTitle.Unset() -} - -// GetSeoDescription returns the SeoDescription field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *Actor) GetSeoDescription() string { - if o == nil || IsNil(o.SeoDescription.Get()) { - var ret string - return ret - } - return *o.SeoDescription.Get() -} - -// GetSeoDescriptionOk returns a tuple with the SeoDescription field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *Actor) GetSeoDescriptionOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.SeoDescription.Get(), o.SeoDescription.IsSet() -} - -// HasSeoDescription returns a boolean if a field has been set. -func (o *Actor) HasSeoDescription() bool { - if o != nil && o.SeoDescription.IsSet() { - return true - } - - return false -} - -// SetSeoDescription gets a reference to the given NullableString and assigns it to the SeoDescription field. -func (o *Actor) SetSeoDescription(v string) { - o.SeoDescription.Set(&v) -} -// SetSeoDescriptionNil sets the value for SeoDescription to be an explicit nil -func (o *Actor) SetSeoDescriptionNil() { - o.SeoDescription.Set(nil) -} - -// UnsetSeoDescription ensures that no value is present for SeoDescription, not even an explicit nil -func (o *Actor) UnsetSeoDescription() { - o.SeoDescription.Unset() -} - -// GetPictureUrl returns the PictureUrl field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *Actor) GetPictureUrl() string { - if o == nil || IsNil(o.PictureUrl.Get()) { - var ret string - return ret - } - return *o.PictureUrl.Get() -} - -// GetPictureUrlOk returns a tuple with the PictureUrl field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *Actor) GetPictureUrlOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.PictureUrl.Get(), o.PictureUrl.IsSet() -} - -// HasPictureUrl returns a boolean if a field has been set. -func (o *Actor) HasPictureUrl() bool { - if o != nil && o.PictureUrl.IsSet() { - return true - } - - return false -} - -// SetPictureUrl gets a reference to the given NullableString and assigns it to the PictureUrl field. -func (o *Actor) SetPictureUrl(v string) { - o.PictureUrl.Set(&v) -} -// SetPictureUrlNil sets the value for PictureUrl to be an explicit nil -func (o *Actor) SetPictureUrlNil() { - o.PictureUrl.Set(nil) -} - -// UnsetPictureUrl ensures that no value is present for PictureUrl, not even an explicit nil -func (o *Actor) UnsetPictureUrl() { - o.PictureUrl.Unset() -} - -// GetStandbyUrl returns the StandbyUrl field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *Actor) GetStandbyUrl() string { - if o == nil || IsNil(o.StandbyUrl.Get()) { - var ret string - return ret - } - return *o.StandbyUrl.Get() -} - -// GetStandbyUrlOk returns a tuple with the StandbyUrl field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *Actor) GetStandbyUrlOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.StandbyUrl.Get(), o.StandbyUrl.IsSet() -} - -// HasStandbyUrl returns a boolean if a field has been set. -func (o *Actor) HasStandbyUrl() bool { - if o != nil && o.StandbyUrl.IsSet() { - return true - } - - return false -} - -// SetStandbyUrl gets a reference to the given NullableString and assigns it to the StandbyUrl field. -func (o *Actor) SetStandbyUrl(v string) { - o.StandbyUrl.Set(&v) -} -// SetStandbyUrlNil sets the value for StandbyUrl to be an explicit nil -func (o *Actor) SetStandbyUrlNil() { - o.StandbyUrl.Set(nil) -} - -// UnsetStandbyUrl ensures that no value is present for StandbyUrl, not even an explicit nil -func (o *Actor) UnsetStandbyUrl() { - o.StandbyUrl.Unset() -} - -// GetNotice returns the Notice field value if set, zero value otherwise. -func (o *Actor) GetNotice() string { - if o == nil || IsNil(o.Notice) { - var ret string - return ret - } - return *o.Notice -} - -// GetNoticeOk returns a tuple with the Notice field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Actor) GetNoticeOk() (*string, bool) { - if o == nil || IsNil(o.Notice) { - return nil, false - } - return o.Notice, true -} - -// HasNotice returns a boolean if a field has been set. -func (o *Actor) HasNotice() bool { - if o != nil && !IsNil(o.Notice) { - return true - } - - return false -} - -// SetNotice gets a reference to the given string and assigns it to the Notice field. -func (o *Actor) SetNotice(v string) { - o.Notice = &v -} - -// GetCategories returns the Categories field value if set, zero value otherwise. -func (o *Actor) GetCategories() []string { - if o == nil || IsNil(o.Categories) { - var ret []string - return ret - } - return o.Categories -} - -// GetCategoriesOk returns a tuple with the Categories field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Actor) GetCategoriesOk() ([]string, bool) { - if o == nil || IsNil(o.Categories) { - return nil, false - } - return o.Categories, true -} - -// HasCategories returns a boolean if a field has been set. -func (o *Actor) HasCategories() bool { - if o != nil && !IsNil(o.Categories) { - return true - } - - return false -} - -// SetCategories gets a reference to the given []string and assigns it to the Categories field. -func (o *Actor) SetCategories(v []string) { - o.Categories = v -} - -// GetIsCritical returns the IsCritical field value if set, zero value otherwise. -func (o *Actor) GetIsCritical() bool { - if o == nil || IsNil(o.IsCritical) { - var ret bool - return ret - } - return *o.IsCritical -} - -// GetIsCriticalOk returns a tuple with the IsCritical field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Actor) GetIsCriticalOk() (*bool, bool) { - if o == nil || IsNil(o.IsCritical) { - return nil, false - } - return o.IsCritical, true -} - -// HasIsCritical returns a boolean if a field has been set. -func (o *Actor) HasIsCritical() bool { - if o != nil && !IsNil(o.IsCritical) { - return true - } - - return false -} - -// SetIsCritical gets a reference to the given bool and assigns it to the IsCritical field. -func (o *Actor) SetIsCritical(v bool) { - o.IsCritical = &v -} - -// GetIsGeneric returns the IsGeneric field value if set, zero value otherwise. -func (o *Actor) GetIsGeneric() bool { - if o == nil || IsNil(o.IsGeneric) { - var ret bool - return ret - } - return *o.IsGeneric -} - -// GetIsGenericOk returns a tuple with the IsGeneric field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Actor) GetIsGenericOk() (*bool, bool) { - if o == nil || IsNil(o.IsGeneric) { - return nil, false - } - return o.IsGeneric, true -} - -// HasIsGeneric returns a boolean if a field has been set. -func (o *Actor) HasIsGeneric() bool { - if o != nil && !IsNil(o.IsGeneric) { - return true - } - - return false -} - -// SetIsGeneric gets a reference to the given bool and assigns it to the IsGeneric field. -func (o *Actor) SetIsGeneric(v bool) { - o.IsGeneric = &v -} - -// GetIsSourceCodeHidden returns the IsSourceCodeHidden field value if set, zero value otherwise. -func (o *Actor) GetIsSourceCodeHidden() bool { - if o == nil || IsNil(o.IsSourceCodeHidden) { - var ret bool - return ret - } - return *o.IsSourceCodeHidden -} - -// GetIsSourceCodeHiddenOk returns a tuple with the IsSourceCodeHidden field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Actor) GetIsSourceCodeHiddenOk() (*bool, bool) { - if o == nil || IsNil(o.IsSourceCodeHidden) { - return nil, false - } - return o.IsSourceCodeHidden, true -} - -// HasIsSourceCodeHidden returns a boolean if a field has been set. -func (o *Actor) HasIsSourceCodeHidden() bool { - if o != nil && !IsNil(o.IsSourceCodeHidden) { - return true - } - - return false -} - -// SetIsSourceCodeHidden gets a reference to the given bool and assigns it to the IsSourceCodeHidden field. -func (o *Actor) SetIsSourceCodeHidden(v bool) { - o.IsSourceCodeHidden = &v -} - -// GetHasNoDataset returns the HasNoDataset field value if set, zero value otherwise. -func (o *Actor) GetHasNoDataset() bool { - if o == nil || IsNil(o.HasNoDataset) { - var ret bool - return ret - } - return *o.HasNoDataset -} - -// GetHasNoDatasetOk returns a tuple with the HasNoDataset field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Actor) GetHasNoDatasetOk() (*bool, bool) { - if o == nil || IsNil(o.HasNoDataset) { - return nil, false - } - return o.HasNoDataset, true -} - -// HasHasNoDataset returns a boolean if a field has been set. -func (o *Actor) HasHasNoDataset() bool { - if o != nil && !IsNil(o.HasNoDataset) { - return true - } - - return false -} - -// SetHasNoDataset gets a reference to the given bool and assigns it to the HasNoDataset field. -func (o *Actor) SetHasNoDataset(v bool) { - o.HasNoDataset = &v -} - -func (o Actor) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o Actor) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["id"] = o.Id - toSerialize["userId"] = o.UserId - toSerialize["name"] = o.Name - toSerialize["username"] = o.Username - if o.Description.IsSet() { - toSerialize["description"] = o.Description.Get() - } - if !IsNil(o.RestartOnError) { - toSerialize["restartOnError"] = o.RestartOnError - } - toSerialize["isPublic"] = o.IsPublic - if !IsNil(o.ActorPermissionLevel) { - toSerialize["actorPermissionLevel"] = o.ActorPermissionLevel - } - toSerialize["createdAt"] = o.CreatedAt - toSerialize["modifiedAt"] = o.ModifiedAt - toSerialize["stats"] = o.Stats - toSerialize["versions"] = o.Versions - if !IsNil(o.PricingInfos) { - toSerialize["pricingInfos"] = o.PricingInfos - } - toSerialize["defaultRunOptions"] = o.DefaultRunOptions - if o.ExampleRunInput.IsSet() { - toSerialize["exampleRunInput"] = o.ExampleRunInput.Get() - } - if o.IsDeprecated.IsSet() { - toSerialize["isDeprecated"] = o.IsDeprecated.Get() - } - if !IsNil(o.DeploymentKey) { - toSerialize["deploymentKey"] = o.DeploymentKey - } - if o.Title.IsSet() { - toSerialize["title"] = o.Title.Get() - } - if o.TaggedBuilds != nil { - toSerialize["taggedBuilds"] = o.TaggedBuilds - } - if o.ActorStandby.IsSet() { - toSerialize["actorStandby"] = o.ActorStandby.Get() - } - if !IsNil(o.ReadmeSummary) { - toSerialize["readmeSummary"] = o.ReadmeSummary - } - if o.SeoTitle.IsSet() { - toSerialize["seoTitle"] = o.SeoTitle.Get() - } - if o.SeoDescription.IsSet() { - toSerialize["seoDescription"] = o.SeoDescription.Get() - } - if o.PictureUrl.IsSet() { - toSerialize["pictureUrl"] = o.PictureUrl.Get() - } - if o.StandbyUrl.IsSet() { - toSerialize["standbyUrl"] = o.StandbyUrl.Get() - } - if !IsNil(o.Notice) { - toSerialize["notice"] = o.Notice - } - if !IsNil(o.Categories) { - toSerialize["categories"] = o.Categories - } - if !IsNil(o.IsCritical) { - toSerialize["isCritical"] = o.IsCritical - } - if !IsNil(o.IsGeneric) { - toSerialize["isGeneric"] = o.IsGeneric - } - if !IsNil(o.IsSourceCodeHidden) { - toSerialize["isSourceCodeHidden"] = o.IsSourceCodeHidden - } - if !IsNil(o.HasNoDataset) { - toSerialize["hasNoDataset"] = o.HasNoDataset - } - return toSerialize, nil -} - -func (o *Actor) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "id", - "userId", - "name", - "username", - "isPublic", - "createdAt", - "modifiedAt", - "stats", - "versions", - "defaultRunOptions", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err; - } - - for _, requiredProperty := range(requiredProperties) { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varActor := _Actor{} - - decoder := json.NewDecoder(bytes.NewReader(data)) - decoder.DisallowUnknownFields() - err = decoder.Decode(&varActor) - - if err != nil { - return err - } - - *o = Actor(varActor) - - return err -} - -type NullableActor struct { - value *Actor - isSet bool -} - -func (v NullableActor) Get() *Actor { - return v.value -} - -func (v *NullableActor) Set(val *Actor) { - v.value = val - v.isSet = true -} - -func (v NullableActor) IsSet() bool { - return v.isSet -} - -func (v *NullableActor) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableActor(val *Actor) *NullableActor { - return &NullableActor{value: val, isSet: true} -} - -func (v NullableActor) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableActor) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_actor_charge_event.go b/model_actor_charge_event.go deleted file mode 100644 index 7daa860..0000000 --- a/model_actor_charge_event.go +++ /dev/null @@ -1,336 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" - "bytes" - "fmt" -) - -// checks if the ActorChargeEvent type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &ActorChargeEvent{} - -// ActorChargeEvent Definition of a single chargeable event for a pay-per-event Actor. Each event is either flat-priced (`eventPriceUsd` is set) or tier-priced (`eventTieredPricingUsd` is set); the two are mutually exclusive. -type ActorChargeEvent struct { - // Human-readable title shown to users in the billing UI. - EventTitle string `json:"eventTitle"` - // Human-readable description of what triggers this event. - EventDescription string `json:"eventDescription"` - // Flat price per event in USD. Present only for non-tiered events. Mutually exclusive with `eventTieredPricingUsd`. - EventPriceUsd *float32 `json:"eventPriceUsd,omitempty"` - // Tiered price-per-event pricing for a single charge event, keyed by subscription tier (e.g. `FREE`, `BRONZE`, `SILVER`, `GOLD`, `PLATINUM`, `DIAMOND`). The actual price applied is resolved from the user's tier. - EventTieredPricingUsd map[string]TieredPricingPerEventEntry `json:"eventTieredPricingUsd,omitempty"` - // Whether this event is the Actor's primary chargeable event. - IsPrimaryEvent *bool `json:"isPrimaryEvent,omitempty"` - // Whether this event can only be charged once per Actor run. - IsOneTimeEvent *bool `json:"isOneTimeEvent,omitempty"` -} - -type _ActorChargeEvent ActorChargeEvent - -// NewActorChargeEvent instantiates a new ActorChargeEvent object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewActorChargeEvent(eventTitle string, eventDescription string) *ActorChargeEvent { - this := ActorChargeEvent{} - this.EventTitle = eventTitle - this.EventDescription = eventDescription - return &this -} - -// NewActorChargeEventWithDefaults instantiates a new ActorChargeEvent object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewActorChargeEventWithDefaults() *ActorChargeEvent { - this := ActorChargeEvent{} - return &this -} - -// GetEventTitle returns the EventTitle field value -func (o *ActorChargeEvent) GetEventTitle() string { - if o == nil { - var ret string - return ret - } - - return o.EventTitle -} - -// GetEventTitleOk returns a tuple with the EventTitle field value -// and a boolean to check if the value has been set. -func (o *ActorChargeEvent) GetEventTitleOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.EventTitle, true -} - -// SetEventTitle sets field value -func (o *ActorChargeEvent) SetEventTitle(v string) { - o.EventTitle = v -} - -// GetEventDescription returns the EventDescription field value -func (o *ActorChargeEvent) GetEventDescription() string { - if o == nil { - var ret string - return ret - } - - return o.EventDescription -} - -// GetEventDescriptionOk returns a tuple with the EventDescription field value -// and a boolean to check if the value has been set. -func (o *ActorChargeEvent) GetEventDescriptionOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.EventDescription, true -} - -// SetEventDescription sets field value -func (o *ActorChargeEvent) SetEventDescription(v string) { - o.EventDescription = v -} - -// GetEventPriceUsd returns the EventPriceUsd field value if set, zero value otherwise. -func (o *ActorChargeEvent) GetEventPriceUsd() float32 { - if o == nil || IsNil(o.EventPriceUsd) { - var ret float32 - return ret - } - return *o.EventPriceUsd -} - -// GetEventPriceUsdOk returns a tuple with the EventPriceUsd field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ActorChargeEvent) GetEventPriceUsdOk() (*float32, bool) { - if o == nil || IsNil(o.EventPriceUsd) { - return nil, false - } - return o.EventPriceUsd, true -} - -// HasEventPriceUsd returns a boolean if a field has been set. -func (o *ActorChargeEvent) HasEventPriceUsd() bool { - if o != nil && !IsNil(o.EventPriceUsd) { - return true - } - - return false -} - -// SetEventPriceUsd gets a reference to the given float32 and assigns it to the EventPriceUsd field. -func (o *ActorChargeEvent) SetEventPriceUsd(v float32) { - o.EventPriceUsd = &v -} - -// GetEventTieredPricingUsd returns the EventTieredPricingUsd field value if set, zero value otherwise. -func (o *ActorChargeEvent) GetEventTieredPricingUsd() map[string]TieredPricingPerEventEntry { - if o == nil || IsNil(o.EventTieredPricingUsd) { - var ret map[string]TieredPricingPerEventEntry - return ret - } - return o.EventTieredPricingUsd -} - -// GetEventTieredPricingUsdOk returns a tuple with the EventTieredPricingUsd field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ActorChargeEvent) GetEventTieredPricingUsdOk() (map[string]TieredPricingPerEventEntry, bool) { - if o == nil || IsNil(o.EventTieredPricingUsd) { - return map[string]TieredPricingPerEventEntry{}, false - } - return o.EventTieredPricingUsd, true -} - -// HasEventTieredPricingUsd returns a boolean if a field has been set. -func (o *ActorChargeEvent) HasEventTieredPricingUsd() bool { - if o != nil && !IsNil(o.EventTieredPricingUsd) { - return true - } - - return false -} - -// SetEventTieredPricingUsd gets a reference to the given map[string]TieredPricingPerEventEntry and assigns it to the EventTieredPricingUsd field. -func (o *ActorChargeEvent) SetEventTieredPricingUsd(v map[string]TieredPricingPerEventEntry) { - o.EventTieredPricingUsd = v -} - -// GetIsPrimaryEvent returns the IsPrimaryEvent field value if set, zero value otherwise. -func (o *ActorChargeEvent) GetIsPrimaryEvent() bool { - if o == nil || IsNil(o.IsPrimaryEvent) { - var ret bool - return ret - } - return *o.IsPrimaryEvent -} - -// GetIsPrimaryEventOk returns a tuple with the IsPrimaryEvent field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ActorChargeEvent) GetIsPrimaryEventOk() (*bool, bool) { - if o == nil || IsNil(o.IsPrimaryEvent) { - return nil, false - } - return o.IsPrimaryEvent, true -} - -// HasIsPrimaryEvent returns a boolean if a field has been set. -func (o *ActorChargeEvent) HasIsPrimaryEvent() bool { - if o != nil && !IsNil(o.IsPrimaryEvent) { - return true - } - - return false -} - -// SetIsPrimaryEvent gets a reference to the given bool and assigns it to the IsPrimaryEvent field. -func (o *ActorChargeEvent) SetIsPrimaryEvent(v bool) { - o.IsPrimaryEvent = &v -} - -// GetIsOneTimeEvent returns the IsOneTimeEvent field value if set, zero value otherwise. -func (o *ActorChargeEvent) GetIsOneTimeEvent() bool { - if o == nil || IsNil(o.IsOneTimeEvent) { - var ret bool - return ret - } - return *o.IsOneTimeEvent -} - -// GetIsOneTimeEventOk returns a tuple with the IsOneTimeEvent field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ActorChargeEvent) GetIsOneTimeEventOk() (*bool, bool) { - if o == nil || IsNil(o.IsOneTimeEvent) { - return nil, false - } - return o.IsOneTimeEvent, true -} - -// HasIsOneTimeEvent returns a boolean if a field has been set. -func (o *ActorChargeEvent) HasIsOneTimeEvent() bool { - if o != nil && !IsNil(o.IsOneTimeEvent) { - return true - } - - return false -} - -// SetIsOneTimeEvent gets a reference to the given bool and assigns it to the IsOneTimeEvent field. -func (o *ActorChargeEvent) SetIsOneTimeEvent(v bool) { - o.IsOneTimeEvent = &v -} - -func (o ActorChargeEvent) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o ActorChargeEvent) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["eventTitle"] = o.EventTitle - toSerialize["eventDescription"] = o.EventDescription - if !IsNil(o.EventPriceUsd) { - toSerialize["eventPriceUsd"] = o.EventPriceUsd - } - if !IsNil(o.EventTieredPricingUsd) { - toSerialize["eventTieredPricingUsd"] = o.EventTieredPricingUsd - } - if !IsNil(o.IsPrimaryEvent) { - toSerialize["isPrimaryEvent"] = o.IsPrimaryEvent - } - if !IsNil(o.IsOneTimeEvent) { - toSerialize["isOneTimeEvent"] = o.IsOneTimeEvent - } - return toSerialize, nil -} - -func (o *ActorChargeEvent) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "eventTitle", - "eventDescription", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err; - } - - for _, requiredProperty := range(requiredProperties) { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varActorChargeEvent := _ActorChargeEvent{} - - decoder := json.NewDecoder(bytes.NewReader(data)) - decoder.DisallowUnknownFields() - err = decoder.Decode(&varActorChargeEvent) - - if err != nil { - return err - } - - *o = ActorChargeEvent(varActorChargeEvent) - - return err -} - -type NullableActorChargeEvent struct { - value *ActorChargeEvent - isSet bool -} - -func (v NullableActorChargeEvent) Get() *ActorChargeEvent { - return v.value -} - -func (v *NullableActorChargeEvent) Set(val *ActorChargeEvent) { - v.value = val - v.isSet = true -} - -func (v NullableActorChargeEvent) IsSet() bool { - return v.isSet -} - -func (v *NullableActorChargeEvent) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableActorChargeEvent(val *ActorChargeEvent) *NullableActorChargeEvent { - return &NullableActorChargeEvent{value: val, isSet: true} -} - -func (v NullableActorChargeEvent) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableActorChargeEvent) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_actor_definition.go b/model_actor_definition.go deleted file mode 100644 index 54d293a..0000000 --- a/model_actor_definition.go +++ /dev/null @@ -1,643 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" -) - -// checks if the ActorDefinition type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &ActorDefinition{} - -// ActorDefinition The definition of the Actor, the full specification of this field can be found in [Apify docs](https://docs.apify.com/platform/actors/development/actor-definition/actor-json) -type ActorDefinition struct { - // The Actor specification version that this Actor follows. This property must be set to 1. - ActorSpecification *int32 `json:"actorSpecification,omitempty"` - // The name of the Actor. - Name *string `json:"name,omitempty"` - // The version of the Actor, typically a dot-separated sequence of numbers (e.g., `0.1`, `1.0`, or `0.0.1`). - Version *string `json:"version,omitempty" validate:"regexp=^[0-9]+(\\\\.[0-9]+)+$"` - // The tag name to be applied to a successful build of the Actor. Defaults to 'latest' if not specified. - BuildTag *string `json:"buildTag,omitempty"` - // A map of environment variables to be used during local development and deployment. - EnvironmentVariables map[string]string `json:"environmentVariables,omitempty"` - // The path to the Dockerfile used for building the Actor on the platform. - Dockerfile *string `json:"dockerfile,omitempty"` - // The path to the directory used as the Docker context when building the Actor. - DockerContextDir *string `json:"dockerContextDir,omitempty"` - // The path to the README file for the Actor. - Readme *string `json:"readme,omitempty"` - // The input schema object, the full specification can be found in [Apify docs](https://docs.apify.com/platform/actors/development/actor-definition/input-schema) - Input map[string]interface{} `json:"input,omitempty"` - // The path to the CHANGELOG file displayed in the Actor's information tab. - Changelog *string `json:"changelog,omitempty"` - Storages *ActorDefinitionStorages `json:"storages,omitempty"` - DefaultMemoryMbytes *ActorDefinitionDefaultMemoryMbytes `json:"defaultMemoryMbytes,omitempty"` - // Specifies the minimum amount of memory in megabytes required by the Actor. - MinMemoryMbytes *int32 `json:"minMemoryMbytes,omitempty"` - // Specifies the maximum amount of memory in megabytes required by the Actor. - MaxMemoryMbytes *int32 `json:"maxMemoryMbytes,omitempty"` - // Specifies whether Standby mode is enabled for the Actor. - UsesStandbyMode *bool `json:"usesStandbyMode,omitempty"` -} - -// NewActorDefinition instantiates a new ActorDefinition object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewActorDefinition() *ActorDefinition { - this := ActorDefinition{} - return &this -} - -// NewActorDefinitionWithDefaults instantiates a new ActorDefinition object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewActorDefinitionWithDefaults() *ActorDefinition { - this := ActorDefinition{} - return &this -} - -// GetActorSpecification returns the ActorSpecification field value if set, zero value otherwise. -func (o *ActorDefinition) GetActorSpecification() int32 { - if o == nil || IsNil(o.ActorSpecification) { - var ret int32 - return ret - } - return *o.ActorSpecification -} - -// GetActorSpecificationOk returns a tuple with the ActorSpecification field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ActorDefinition) GetActorSpecificationOk() (*int32, bool) { - if o == nil || IsNil(o.ActorSpecification) { - return nil, false - } - return o.ActorSpecification, true -} - -// HasActorSpecification returns a boolean if a field has been set. -func (o *ActorDefinition) HasActorSpecification() bool { - if o != nil && !IsNil(o.ActorSpecification) { - return true - } - - return false -} - -// SetActorSpecification gets a reference to the given int32 and assigns it to the ActorSpecification field. -func (o *ActorDefinition) SetActorSpecification(v int32) { - o.ActorSpecification = &v -} - -// GetName returns the Name field value if set, zero value otherwise. -func (o *ActorDefinition) GetName() string { - if o == nil || IsNil(o.Name) { - var ret string - return ret - } - return *o.Name -} - -// GetNameOk returns a tuple with the Name field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ActorDefinition) GetNameOk() (*string, bool) { - if o == nil || IsNil(o.Name) { - return nil, false - } - return o.Name, true -} - -// HasName returns a boolean if a field has been set. -func (o *ActorDefinition) HasName() bool { - if o != nil && !IsNil(o.Name) { - return true - } - - return false -} - -// SetName gets a reference to the given string and assigns it to the Name field. -func (o *ActorDefinition) SetName(v string) { - o.Name = &v -} - -// GetVersion returns the Version field value if set, zero value otherwise. -func (o *ActorDefinition) GetVersion() string { - if o == nil || IsNil(o.Version) { - var ret string - return ret - } - return *o.Version -} - -// GetVersionOk returns a tuple with the Version field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ActorDefinition) GetVersionOk() (*string, bool) { - if o == nil || IsNil(o.Version) { - return nil, false - } - return o.Version, true -} - -// HasVersion returns a boolean if a field has been set. -func (o *ActorDefinition) HasVersion() bool { - if o != nil && !IsNil(o.Version) { - return true - } - - return false -} - -// SetVersion gets a reference to the given string and assigns it to the Version field. -func (o *ActorDefinition) SetVersion(v string) { - o.Version = &v -} - -// GetBuildTag returns the BuildTag field value if set, zero value otherwise. -func (o *ActorDefinition) GetBuildTag() string { - if o == nil || IsNil(o.BuildTag) { - var ret string - return ret - } - return *o.BuildTag -} - -// GetBuildTagOk returns a tuple with the BuildTag field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ActorDefinition) GetBuildTagOk() (*string, bool) { - if o == nil || IsNil(o.BuildTag) { - return nil, false - } - return o.BuildTag, true -} - -// HasBuildTag returns a boolean if a field has been set. -func (o *ActorDefinition) HasBuildTag() bool { - if o != nil && !IsNil(o.BuildTag) { - return true - } - - return false -} - -// SetBuildTag gets a reference to the given string and assigns it to the BuildTag field. -func (o *ActorDefinition) SetBuildTag(v string) { - o.BuildTag = &v -} - -// GetEnvironmentVariables returns the EnvironmentVariables field value if set, zero value otherwise. -func (o *ActorDefinition) GetEnvironmentVariables() map[string]string { - if o == nil || IsNil(o.EnvironmentVariables) { - var ret map[string]string - return ret - } - return o.EnvironmentVariables -} - -// GetEnvironmentVariablesOk returns a tuple with the EnvironmentVariables field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ActorDefinition) GetEnvironmentVariablesOk() (map[string]string, bool) { - if o == nil || IsNil(o.EnvironmentVariables) { - return map[string]string{}, false - } - return o.EnvironmentVariables, true -} - -// HasEnvironmentVariables returns a boolean if a field has been set. -func (o *ActorDefinition) HasEnvironmentVariables() bool { - if o != nil && !IsNil(o.EnvironmentVariables) { - return true - } - - return false -} - -// SetEnvironmentVariables gets a reference to the given map[string]string and assigns it to the EnvironmentVariables field. -func (o *ActorDefinition) SetEnvironmentVariables(v map[string]string) { - o.EnvironmentVariables = v -} - -// GetDockerfile returns the Dockerfile field value if set, zero value otherwise. -func (o *ActorDefinition) GetDockerfile() string { - if o == nil || IsNil(o.Dockerfile) { - var ret string - return ret - } - return *o.Dockerfile -} - -// GetDockerfileOk returns a tuple with the Dockerfile field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ActorDefinition) GetDockerfileOk() (*string, bool) { - if o == nil || IsNil(o.Dockerfile) { - return nil, false - } - return o.Dockerfile, true -} - -// HasDockerfile returns a boolean if a field has been set. -func (o *ActorDefinition) HasDockerfile() bool { - if o != nil && !IsNil(o.Dockerfile) { - return true - } - - return false -} - -// SetDockerfile gets a reference to the given string and assigns it to the Dockerfile field. -func (o *ActorDefinition) SetDockerfile(v string) { - o.Dockerfile = &v -} - -// GetDockerContextDir returns the DockerContextDir field value if set, zero value otherwise. -func (o *ActorDefinition) GetDockerContextDir() string { - if o == nil || IsNil(o.DockerContextDir) { - var ret string - return ret - } - return *o.DockerContextDir -} - -// GetDockerContextDirOk returns a tuple with the DockerContextDir field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ActorDefinition) GetDockerContextDirOk() (*string, bool) { - if o == nil || IsNil(o.DockerContextDir) { - return nil, false - } - return o.DockerContextDir, true -} - -// HasDockerContextDir returns a boolean if a field has been set. -func (o *ActorDefinition) HasDockerContextDir() bool { - if o != nil && !IsNil(o.DockerContextDir) { - return true - } - - return false -} - -// SetDockerContextDir gets a reference to the given string and assigns it to the DockerContextDir field. -func (o *ActorDefinition) SetDockerContextDir(v string) { - o.DockerContextDir = &v -} - -// GetReadme returns the Readme field value if set, zero value otherwise. -func (o *ActorDefinition) GetReadme() string { - if o == nil || IsNil(o.Readme) { - var ret string - return ret - } - return *o.Readme -} - -// GetReadmeOk returns a tuple with the Readme field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ActorDefinition) GetReadmeOk() (*string, bool) { - if o == nil || IsNil(o.Readme) { - return nil, false - } - return o.Readme, true -} - -// HasReadme returns a boolean if a field has been set. -func (o *ActorDefinition) HasReadme() bool { - if o != nil && !IsNil(o.Readme) { - return true - } - - return false -} - -// SetReadme gets a reference to the given string and assigns it to the Readme field. -func (o *ActorDefinition) SetReadme(v string) { - o.Readme = &v -} - -// GetInput returns the Input field value if set, zero value otherwise. -func (o *ActorDefinition) GetInput() map[string]interface{} { - if o == nil || IsNil(o.Input) { - var ret map[string]interface{} - return ret - } - return o.Input -} - -// GetInputOk returns a tuple with the Input field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ActorDefinition) GetInputOk() (map[string]interface{}, bool) { - if o == nil || IsNil(o.Input) { - return map[string]interface{}{}, false - } - return o.Input, true -} - -// HasInput returns a boolean if a field has been set. -func (o *ActorDefinition) HasInput() bool { - if o != nil && !IsNil(o.Input) { - return true - } - - return false -} - -// SetInput gets a reference to the given map[string]interface{} and assigns it to the Input field. -func (o *ActorDefinition) SetInput(v map[string]interface{}) { - o.Input = v -} - -// GetChangelog returns the Changelog field value if set, zero value otherwise. -func (o *ActorDefinition) GetChangelog() string { - if o == nil || IsNil(o.Changelog) { - var ret string - return ret - } - return *o.Changelog -} - -// GetChangelogOk returns a tuple with the Changelog field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ActorDefinition) GetChangelogOk() (*string, bool) { - if o == nil || IsNil(o.Changelog) { - return nil, false - } - return o.Changelog, true -} - -// HasChangelog returns a boolean if a field has been set. -func (o *ActorDefinition) HasChangelog() bool { - if o != nil && !IsNil(o.Changelog) { - return true - } - - return false -} - -// SetChangelog gets a reference to the given string and assigns it to the Changelog field. -func (o *ActorDefinition) SetChangelog(v string) { - o.Changelog = &v -} - -// GetStorages returns the Storages field value if set, zero value otherwise. -func (o *ActorDefinition) GetStorages() ActorDefinitionStorages { - if o == nil || IsNil(o.Storages) { - var ret ActorDefinitionStorages - return ret - } - return *o.Storages -} - -// GetStoragesOk returns a tuple with the Storages field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ActorDefinition) GetStoragesOk() (*ActorDefinitionStorages, bool) { - if o == nil || IsNil(o.Storages) { - return nil, false - } - return o.Storages, true -} - -// HasStorages returns a boolean if a field has been set. -func (o *ActorDefinition) HasStorages() bool { - if o != nil && !IsNil(o.Storages) { - return true - } - - return false -} - -// SetStorages gets a reference to the given ActorDefinitionStorages and assigns it to the Storages field. -func (o *ActorDefinition) SetStorages(v ActorDefinitionStorages) { - o.Storages = &v -} - -// GetDefaultMemoryMbytes returns the DefaultMemoryMbytes field value if set, zero value otherwise. -func (o *ActorDefinition) GetDefaultMemoryMbytes() ActorDefinitionDefaultMemoryMbytes { - if o == nil || IsNil(o.DefaultMemoryMbytes) { - var ret ActorDefinitionDefaultMemoryMbytes - return ret - } - return *o.DefaultMemoryMbytes -} - -// GetDefaultMemoryMbytesOk returns a tuple with the DefaultMemoryMbytes field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ActorDefinition) GetDefaultMemoryMbytesOk() (*ActorDefinitionDefaultMemoryMbytes, bool) { - if o == nil || IsNil(o.DefaultMemoryMbytes) { - return nil, false - } - return o.DefaultMemoryMbytes, true -} - -// HasDefaultMemoryMbytes returns a boolean if a field has been set. -func (o *ActorDefinition) HasDefaultMemoryMbytes() bool { - if o != nil && !IsNil(o.DefaultMemoryMbytes) { - return true - } - - return false -} - -// SetDefaultMemoryMbytes gets a reference to the given ActorDefinitionDefaultMemoryMbytes and assigns it to the DefaultMemoryMbytes field. -func (o *ActorDefinition) SetDefaultMemoryMbytes(v ActorDefinitionDefaultMemoryMbytes) { - o.DefaultMemoryMbytes = &v -} - -// GetMinMemoryMbytes returns the MinMemoryMbytes field value if set, zero value otherwise. -func (o *ActorDefinition) GetMinMemoryMbytes() int32 { - if o == nil || IsNil(o.MinMemoryMbytes) { - var ret int32 - return ret - } - return *o.MinMemoryMbytes -} - -// GetMinMemoryMbytesOk returns a tuple with the MinMemoryMbytes field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ActorDefinition) GetMinMemoryMbytesOk() (*int32, bool) { - if o == nil || IsNil(o.MinMemoryMbytes) { - return nil, false - } - return o.MinMemoryMbytes, true -} - -// HasMinMemoryMbytes returns a boolean if a field has been set. -func (o *ActorDefinition) HasMinMemoryMbytes() bool { - if o != nil && !IsNil(o.MinMemoryMbytes) { - return true - } - - return false -} - -// SetMinMemoryMbytes gets a reference to the given int32 and assigns it to the MinMemoryMbytes field. -func (o *ActorDefinition) SetMinMemoryMbytes(v int32) { - o.MinMemoryMbytes = &v -} - -// GetMaxMemoryMbytes returns the MaxMemoryMbytes field value if set, zero value otherwise. -func (o *ActorDefinition) GetMaxMemoryMbytes() int32 { - if o == nil || IsNil(o.MaxMemoryMbytes) { - var ret int32 - return ret - } - return *o.MaxMemoryMbytes -} - -// GetMaxMemoryMbytesOk returns a tuple with the MaxMemoryMbytes field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ActorDefinition) GetMaxMemoryMbytesOk() (*int32, bool) { - if o == nil || IsNil(o.MaxMemoryMbytes) { - return nil, false - } - return o.MaxMemoryMbytes, true -} - -// HasMaxMemoryMbytes returns a boolean if a field has been set. -func (o *ActorDefinition) HasMaxMemoryMbytes() bool { - if o != nil && !IsNil(o.MaxMemoryMbytes) { - return true - } - - return false -} - -// SetMaxMemoryMbytes gets a reference to the given int32 and assigns it to the MaxMemoryMbytes field. -func (o *ActorDefinition) SetMaxMemoryMbytes(v int32) { - o.MaxMemoryMbytes = &v -} - -// GetUsesStandbyMode returns the UsesStandbyMode field value if set, zero value otherwise. -func (o *ActorDefinition) GetUsesStandbyMode() bool { - if o == nil || IsNil(o.UsesStandbyMode) { - var ret bool - return ret - } - return *o.UsesStandbyMode -} - -// GetUsesStandbyModeOk returns a tuple with the UsesStandbyMode field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ActorDefinition) GetUsesStandbyModeOk() (*bool, bool) { - if o == nil || IsNil(o.UsesStandbyMode) { - return nil, false - } - return o.UsesStandbyMode, true -} - -// HasUsesStandbyMode returns a boolean if a field has been set. -func (o *ActorDefinition) HasUsesStandbyMode() bool { - if o != nil && !IsNil(o.UsesStandbyMode) { - return true - } - - return false -} - -// SetUsesStandbyMode gets a reference to the given bool and assigns it to the UsesStandbyMode field. -func (o *ActorDefinition) SetUsesStandbyMode(v bool) { - o.UsesStandbyMode = &v -} - -func (o ActorDefinition) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o ActorDefinition) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if !IsNil(o.ActorSpecification) { - toSerialize["actorSpecification"] = o.ActorSpecification - } - if !IsNil(o.Name) { - toSerialize["name"] = o.Name - } - if !IsNil(o.Version) { - toSerialize["version"] = o.Version - } - if !IsNil(o.BuildTag) { - toSerialize["buildTag"] = o.BuildTag - } - if !IsNil(o.EnvironmentVariables) { - toSerialize["environmentVariables"] = o.EnvironmentVariables - } - if !IsNil(o.Dockerfile) { - toSerialize["dockerfile"] = o.Dockerfile - } - if !IsNil(o.DockerContextDir) { - toSerialize["dockerContextDir"] = o.DockerContextDir - } - if !IsNil(o.Readme) { - toSerialize["readme"] = o.Readme - } - if !IsNil(o.Input) { - toSerialize["input"] = o.Input - } - if !IsNil(o.Changelog) { - toSerialize["changelog"] = o.Changelog - } - if !IsNil(o.Storages) { - toSerialize["storages"] = o.Storages - } - if !IsNil(o.DefaultMemoryMbytes) { - toSerialize["defaultMemoryMbytes"] = o.DefaultMemoryMbytes - } - if !IsNil(o.MinMemoryMbytes) { - toSerialize["minMemoryMbytes"] = o.MinMemoryMbytes - } - if !IsNil(o.MaxMemoryMbytes) { - toSerialize["maxMemoryMbytes"] = o.MaxMemoryMbytes - } - if !IsNil(o.UsesStandbyMode) { - toSerialize["usesStandbyMode"] = o.UsesStandbyMode - } - return toSerialize, nil -} - -type NullableActorDefinition struct { - value *ActorDefinition - isSet bool -} - -func (v NullableActorDefinition) Get() *ActorDefinition { - return v.value -} - -func (v *NullableActorDefinition) Set(val *ActorDefinition) { - v.value = val - v.isSet = true -} - -func (v NullableActorDefinition) IsSet() bool { - return v.isSet -} - -func (v *NullableActorDefinition) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableActorDefinition(val *ActorDefinition) *NullableActorDefinition { - return &NullableActorDefinition{value: val, isSet: true} -} - -func (v NullableActorDefinition) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableActorDefinition) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_actor_definition_default_memory_mbytes.go b/model_actor_definition_default_memory_mbytes.go deleted file mode 100644 index 2b5dbd0..0000000 --- a/model_actor_definition_default_memory_mbytes.go +++ /dev/null @@ -1,171 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" - "fmt" - "gopkg.in/validator.v2" -) - -// ActorDefinitionDefaultMemoryMbytes - Specifies the default amount of memory in megabytes to be used when the Actor is started. Can be an integer or a [dynamic memory expression](/platform/actors/development/actor-definition/dynamic-actor-memory). -type ActorDefinitionDefaultMemoryMbytes struct { - Int32 *int32 - String *string -} - -// int32AsActorDefinitionDefaultMemoryMbytes is a convenience function that returns int32 wrapped in ActorDefinitionDefaultMemoryMbytes -func Int32AsActorDefinitionDefaultMemoryMbytes(v *int32) ActorDefinitionDefaultMemoryMbytes { - return ActorDefinitionDefaultMemoryMbytes{ - Int32: v, - } -} - -// stringAsActorDefinitionDefaultMemoryMbytes is a convenience function that returns string wrapped in ActorDefinitionDefaultMemoryMbytes -func StringAsActorDefinitionDefaultMemoryMbytes(v *string) ActorDefinitionDefaultMemoryMbytes { - return ActorDefinitionDefaultMemoryMbytes{ - String: v, - } -} - - -// Unmarshal JSON data into one of the pointers in the struct -func (dst *ActorDefinitionDefaultMemoryMbytes) UnmarshalJSON(data []byte) error { - var err error - match := 0 - // try to unmarshal data into Int32 - err = newStrictDecoder(data).Decode(&dst.Int32) - if err == nil { - jsonInt32, _ := json.Marshal(dst.Int32) - if string(jsonInt32) == "{}" { // empty struct - dst.Int32 = nil - } else { - if err = validator.Validate(dst.Int32); err != nil { - dst.Int32 = nil - } else { - match++ - } - } - } else { - dst.Int32 = nil - } - - // try to unmarshal data into String - err = newStrictDecoder(data).Decode(&dst.String) - if err == nil { - jsonString, _ := json.Marshal(dst.String) - if string(jsonString) == "{}" { // empty struct - dst.String = nil - } else { - if err = validator.Validate(dst.String); err != nil { - dst.String = nil - } else { - match++ - } - } - } else { - dst.String = nil - } - - if match > 1 { // more than 1 match - // reset to nil - dst.Int32 = nil - dst.String = nil - - return fmt.Errorf("data matches more than one schema in oneOf(ActorDefinitionDefaultMemoryMbytes)") - } else if match == 1 { - return nil // exactly one match - } else { // no match - return fmt.Errorf("data failed to match schemas in oneOf(ActorDefinitionDefaultMemoryMbytes)") - } -} - -// Marshal data from the first non-nil pointers in the struct to JSON -func (src ActorDefinitionDefaultMemoryMbytes) MarshalJSON() ([]byte, error) { - if src.Int32 != nil { - return json.Marshal(&src.Int32) - } - - if src.String != nil { - return json.Marshal(&src.String) - } - - return nil, nil // no data in oneOf schemas -} - -// Get the actual instance -func (obj *ActorDefinitionDefaultMemoryMbytes) GetActualInstance() (interface{}) { - if obj == nil { - return nil - } - if obj.Int32 != nil { - return obj.Int32 - } - - if obj.String != nil { - return obj.String - } - - // all schemas are nil - return nil -} - -// Get the actual instance value -func (obj ActorDefinitionDefaultMemoryMbytes) GetActualInstanceValue() (interface{}) { - if obj.Int32 != nil { - return *obj.Int32 - } - - if obj.String != nil { - return *obj.String - } - - // all schemas are nil - return nil -} - -type NullableActorDefinitionDefaultMemoryMbytes struct { - value *ActorDefinitionDefaultMemoryMbytes - isSet bool -} - -func (v NullableActorDefinitionDefaultMemoryMbytes) Get() *ActorDefinitionDefaultMemoryMbytes { - return v.value -} - -func (v *NullableActorDefinitionDefaultMemoryMbytes) Set(val *ActorDefinitionDefaultMemoryMbytes) { - v.value = val - v.isSet = true -} - -func (v NullableActorDefinitionDefaultMemoryMbytes) IsSet() bool { - return v.isSet -} - -func (v *NullableActorDefinitionDefaultMemoryMbytes) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableActorDefinitionDefaultMemoryMbytes(val *ActorDefinitionDefaultMemoryMbytes) *NullableActorDefinitionDefaultMemoryMbytes { - return &NullableActorDefinitionDefaultMemoryMbytes{value: val, isSet: true} -} - -func (v NullableActorDefinitionDefaultMemoryMbytes) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableActorDefinitionDefaultMemoryMbytes) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_actor_definition_storages.go b/model_actor_definition_storages.go deleted file mode 100644 index 5637d73..0000000 --- a/model_actor_definition_storages.go +++ /dev/null @@ -1,127 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" -) - -// checks if the ActorDefinitionStorages type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &ActorDefinitionStorages{} - -// ActorDefinitionStorages struct for ActorDefinitionStorages -type ActorDefinitionStorages struct { - // Defines the schema of items in your dataset, the full specification can be found in [Apify docs](https://docs.apify.com/platform/actors/development/actor-definition/dataset-schema) - Dataset map[string]interface{} `json:"dataset,omitempty"` -} - -// NewActorDefinitionStorages instantiates a new ActorDefinitionStorages object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewActorDefinitionStorages() *ActorDefinitionStorages { - this := ActorDefinitionStorages{} - return &this -} - -// NewActorDefinitionStoragesWithDefaults instantiates a new ActorDefinitionStorages object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewActorDefinitionStoragesWithDefaults() *ActorDefinitionStorages { - this := ActorDefinitionStorages{} - return &this -} - -// GetDataset returns the Dataset field value if set, zero value otherwise. -func (o *ActorDefinitionStorages) GetDataset() map[string]interface{} { - if o == nil || IsNil(o.Dataset) { - var ret map[string]interface{} - return ret - } - return o.Dataset -} - -// GetDatasetOk returns a tuple with the Dataset field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ActorDefinitionStorages) GetDatasetOk() (map[string]interface{}, bool) { - if o == nil || IsNil(o.Dataset) { - return map[string]interface{}{}, false - } - return o.Dataset, true -} - -// HasDataset returns a boolean if a field has been set. -func (o *ActorDefinitionStorages) HasDataset() bool { - if o != nil && !IsNil(o.Dataset) { - return true - } - - return false -} - -// SetDataset gets a reference to the given map[string]interface{} and assigns it to the Dataset field. -func (o *ActorDefinitionStorages) SetDataset(v map[string]interface{}) { - o.Dataset = v -} - -func (o ActorDefinitionStorages) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o ActorDefinitionStorages) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if !IsNil(o.Dataset) { - toSerialize["dataset"] = o.Dataset - } - return toSerialize, nil -} - -type NullableActorDefinitionStorages struct { - value *ActorDefinitionStorages - isSet bool -} - -func (v NullableActorDefinitionStorages) Get() *ActorDefinitionStorages { - return v.value -} - -func (v *NullableActorDefinitionStorages) Set(val *ActorDefinitionStorages) { - v.value = val - v.isSet = true -} - -func (v NullableActorDefinitionStorages) IsSet() bool { - return v.isSet -} - -func (v *NullableActorDefinitionStorages) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableActorDefinitionStorages(val *ActorDefinitionStorages) *NullableActorDefinitionStorages { - return &NullableActorDefinitionStorages{value: val, isSet: true} -} - -func (v NullableActorDefinitionStorages) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableActorDefinitionStorages) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_actor_job_status.go b/model_actor_job_status.go deleted file mode 100644 index d2af1d2..0000000 --- a/model_actor_job_status.go +++ /dev/null @@ -1,123 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" - "fmt" -) - -// ActorJobStatus Status of an Actor job (run or build). -type ActorJobStatus string - -// List of ActorJobStatus -const ( - READY ActorJobStatus = "READY" - RUNNING ActorJobStatus = "RUNNING" - SUCCEEDED ActorJobStatus = "SUCCEEDED" - FAILED ActorJobStatus = "FAILED" - TIMING_OUT ActorJobStatus = "TIMING-OUT" - TIMED_OUT ActorJobStatus = "TIMED-OUT" - ABORTING ActorJobStatus = "ABORTING" - ABORTED ActorJobStatus = "ABORTED" -) - -// All allowed values of ActorJobStatus enum -var AllowedActorJobStatusEnumValues = []ActorJobStatus{ - "READY", - "RUNNING", - "SUCCEEDED", - "FAILED", - "TIMING-OUT", - "TIMED-OUT", - "ABORTING", - "ABORTED", -} - -func (v *ActorJobStatus) UnmarshalJSON(src []byte) error { - var value string - err := json.Unmarshal(src, &value) - if err != nil { - return err - } - enumTypeValue := ActorJobStatus(value) - for _, existing := range AllowedActorJobStatusEnumValues { - if existing == enumTypeValue { - *v = enumTypeValue - return nil - } - } - - return fmt.Errorf("%+v is not a valid ActorJobStatus", value) -} - -// NewActorJobStatusFromValue returns a pointer to a valid ActorJobStatus -// for the value passed as argument, or an error if the value passed is not allowed by the enum -func NewActorJobStatusFromValue(v string) (*ActorJobStatus, error) { - ev := ActorJobStatus(v) - if ev.IsValid() { - return &ev, nil - } else { - return nil, fmt.Errorf("invalid value '%v' for ActorJobStatus: valid values are %v", v, AllowedActorJobStatusEnumValues) - } -} - -// IsValid return true if the value is valid for the enum, false otherwise -func (v ActorJobStatus) IsValid() bool { - for _, existing := range AllowedActorJobStatusEnumValues { - if existing == v { - return true - } - } - return false -} - -// Ptr returns reference to ActorJobStatus value -func (v ActorJobStatus) Ptr() *ActorJobStatus { - return &v -} - -type NullableActorJobStatus struct { - value *ActorJobStatus - isSet bool -} - -func (v NullableActorJobStatus) Get() *ActorJobStatus { - return v.value -} - -func (v *NullableActorJobStatus) Set(val *ActorJobStatus) { - v.value = val - v.isSet = true -} - -func (v NullableActorJobStatus) IsSet() bool { - return v.isSet -} - -func (v *NullableActorJobStatus) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableActorJobStatus(val *ActorJobStatus) *NullableActorJobStatus { - return &NullableActorJobStatus{value: val, isSet: true} -} - -func (v NullableActorJobStatus) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableActorJobStatus) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - diff --git a/model_actor_permission_level.go b/model_actor_permission_level.go deleted file mode 100644 index fb656bb..0000000 --- a/model_actor_permission_level.go +++ /dev/null @@ -1,111 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" - "fmt" -) - -// ActorPermissionLevel Determines permissions that the Actor requires to run. For more information, see the [Actor permissions documentation](https://docs.apify.com/platform/actors/development/permissions). -type ActorPermissionLevel string - -// List of ActorPermissionLevel -const ( - LIMITED_PERMISSIONS ActorPermissionLevel = "LIMITED_PERMISSIONS" - FULL_PERMISSIONS ActorPermissionLevel = "FULL_PERMISSIONS" -) - -// All allowed values of ActorPermissionLevel enum -var AllowedActorPermissionLevelEnumValues = []ActorPermissionLevel{ - "LIMITED_PERMISSIONS", - "FULL_PERMISSIONS", -} - -func (v *ActorPermissionLevel) UnmarshalJSON(src []byte) error { - var value string - err := json.Unmarshal(src, &value) - if err != nil { - return err - } - enumTypeValue := ActorPermissionLevel(value) - for _, existing := range AllowedActorPermissionLevelEnumValues { - if existing == enumTypeValue { - *v = enumTypeValue - return nil - } - } - - return fmt.Errorf("%+v is not a valid ActorPermissionLevel", value) -} - -// NewActorPermissionLevelFromValue returns a pointer to a valid ActorPermissionLevel -// for the value passed as argument, or an error if the value passed is not allowed by the enum -func NewActorPermissionLevelFromValue(v string) (*ActorPermissionLevel, error) { - ev := ActorPermissionLevel(v) - if ev.IsValid() { - return &ev, nil - } else { - return nil, fmt.Errorf("invalid value '%v' for ActorPermissionLevel: valid values are %v", v, AllowedActorPermissionLevelEnumValues) - } -} - -// IsValid return true if the value is valid for the enum, false otherwise -func (v ActorPermissionLevel) IsValid() bool { - for _, existing := range AllowedActorPermissionLevelEnumValues { - if existing == v { - return true - } - } - return false -} - -// Ptr returns reference to ActorPermissionLevel value -func (v ActorPermissionLevel) Ptr() *ActorPermissionLevel { - return &v -} - -type NullableActorPermissionLevel struct { - value *ActorPermissionLevel - isSet bool -} - -func (v NullableActorPermissionLevel) Get() *ActorPermissionLevel { - return v.value -} - -func (v *NullableActorPermissionLevel) Set(val *ActorPermissionLevel) { - v.value = val - v.isSet = true -} - -func (v NullableActorPermissionLevel) IsSet() bool { - return v.isSet -} - -func (v *NullableActorPermissionLevel) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableActorPermissionLevel(val *ActorPermissionLevel) *NullableActorPermissionLevel { - return &NullableActorPermissionLevel{value: val, isSet: true} -} - -func (v NullableActorPermissionLevel) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableActorPermissionLevel) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - diff --git a/model_actor_response.go b/model_actor_response.go deleted file mode 100644 index 14e8fd1..0000000 --- a/model_actor_response.go +++ /dev/null @@ -1,158 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" - "bytes" - "fmt" -) - -// checks if the ActorResponse type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &ActorResponse{} - -// ActorResponse Response containing Actor data. -type ActorResponse struct { - Data Actor `json:"data"` -} - -type _ActorResponse ActorResponse - -// NewActorResponse instantiates a new ActorResponse object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewActorResponse(data Actor) *ActorResponse { - this := ActorResponse{} - this.Data = data - return &this -} - -// NewActorResponseWithDefaults instantiates a new ActorResponse object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewActorResponseWithDefaults() *ActorResponse { - this := ActorResponse{} - return &this -} - -// GetData returns the Data field value -func (o *ActorResponse) GetData() Actor { - if o == nil { - var ret Actor - return ret - } - - return o.Data -} - -// GetDataOk returns a tuple with the Data field value -// and a boolean to check if the value has been set. -func (o *ActorResponse) GetDataOk() (*Actor, bool) { - if o == nil { - return nil, false - } - return &o.Data, true -} - -// SetData sets field value -func (o *ActorResponse) SetData(v Actor) { - o.Data = v -} - -func (o ActorResponse) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o ActorResponse) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["data"] = o.Data - return toSerialize, nil -} - -func (o *ActorResponse) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "data", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err; - } - - for _, requiredProperty := range(requiredProperties) { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varActorResponse := _ActorResponse{} - - decoder := json.NewDecoder(bytes.NewReader(data)) - decoder.DisallowUnknownFields() - err = decoder.Decode(&varActorResponse) - - if err != nil { - return err - } - - *o = ActorResponse(varActorResponse) - - return err -} - -type NullableActorResponse struct { - value *ActorResponse - isSet bool -} - -func (v NullableActorResponse) Get() *ActorResponse { - return v.value -} - -func (v *NullableActorResponse) Set(val *ActorResponse) { - v.value = val - v.isSet = true -} - -func (v NullableActorResponse) IsSet() bool { - return v.isSet -} - -func (v *NullableActorResponse) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableActorResponse(val *ActorResponse) *NullableActorResponse { - return &NullableActorResponse{value: val, isSet: true} -} - -func (v NullableActorResponse) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableActorResponse) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_actor_run_failed_error.go b/model_actor_run_failed_error.go deleted file mode 100644 index 8bd3bcc..0000000 --- a/model_actor_run_failed_error.go +++ /dev/null @@ -1,126 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" -) - -// checks if the ActorRunFailedError type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &ActorRunFailedError{} - -// ActorRunFailedError struct for ActorRunFailedError -type ActorRunFailedError struct { - Error *RunFailedErrorDetail `json:"error,omitempty"` -} - -// NewActorRunFailedError instantiates a new ActorRunFailedError object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewActorRunFailedError() *ActorRunFailedError { - this := ActorRunFailedError{} - return &this -} - -// NewActorRunFailedErrorWithDefaults instantiates a new ActorRunFailedError object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewActorRunFailedErrorWithDefaults() *ActorRunFailedError { - this := ActorRunFailedError{} - return &this -} - -// GetError returns the Error field value if set, zero value otherwise. -func (o *ActorRunFailedError) GetError() RunFailedErrorDetail { - if o == nil || IsNil(o.Error) { - var ret RunFailedErrorDetail - return ret - } - return *o.Error -} - -// GetErrorOk returns a tuple with the Error field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ActorRunFailedError) GetErrorOk() (*RunFailedErrorDetail, bool) { - if o == nil || IsNil(o.Error) { - return nil, false - } - return o.Error, true -} - -// HasError returns a boolean if a field has been set. -func (o *ActorRunFailedError) HasError() bool { - if o != nil && !IsNil(o.Error) { - return true - } - - return false -} - -// SetError gets a reference to the given RunFailedErrorDetail and assigns it to the Error field. -func (o *ActorRunFailedError) SetError(v RunFailedErrorDetail) { - o.Error = &v -} - -func (o ActorRunFailedError) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o ActorRunFailedError) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if !IsNil(o.Error) { - toSerialize["error"] = o.Error - } - return toSerialize, nil -} - -type NullableActorRunFailedError struct { - value *ActorRunFailedError - isSet bool -} - -func (v NullableActorRunFailedError) Get() *ActorRunFailedError { - return v.value -} - -func (v *NullableActorRunFailedError) Set(val *ActorRunFailedError) { - v.value = val - v.isSet = true -} - -func (v NullableActorRunFailedError) IsSet() bool { - return v.isSet -} - -func (v *NullableActorRunFailedError) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableActorRunFailedError(val *ActorRunFailedError) *NullableActorRunFailedError { - return &NullableActorRunFailedError{value: val, isSet: true} -} - -func (v NullableActorRunFailedError) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableActorRunFailedError) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_actor_run_pricing_info.go b/model_actor_run_pricing_info.go deleted file mode 100644 index 9aa8086..0000000 --- a/model_actor_run_pricing_info.go +++ /dev/null @@ -1,247 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" - "fmt" - "gopkg.in/validator.v2" -) - -// ActorRunPricingInfo - struct for ActorRunPricingInfo -type ActorRunPricingInfo struct { - FlatPricePerMonthActorPricingInfo *FlatPricePerMonthActorPricingInfo - FreeActorPricingInfo *FreeActorPricingInfo - PayPerEventActorPricingInfo *PayPerEventActorPricingInfo - PricePerDatasetItemActorPricingInfo *PricePerDatasetItemActorPricingInfo -} - -// FlatPricePerMonthActorPricingInfoAsActorRunPricingInfo is a convenience function that returns FlatPricePerMonthActorPricingInfo wrapped in ActorRunPricingInfo -func FlatPricePerMonthActorPricingInfoAsActorRunPricingInfo(v *FlatPricePerMonthActorPricingInfo) ActorRunPricingInfo { - return ActorRunPricingInfo{ - FlatPricePerMonthActorPricingInfo: v, - } -} - -// FreeActorPricingInfoAsActorRunPricingInfo is a convenience function that returns FreeActorPricingInfo wrapped in ActorRunPricingInfo -func FreeActorPricingInfoAsActorRunPricingInfo(v *FreeActorPricingInfo) ActorRunPricingInfo { - return ActorRunPricingInfo{ - FreeActorPricingInfo: v, - } -} - -// PayPerEventActorPricingInfoAsActorRunPricingInfo is a convenience function that returns PayPerEventActorPricingInfo wrapped in ActorRunPricingInfo -func PayPerEventActorPricingInfoAsActorRunPricingInfo(v *PayPerEventActorPricingInfo) ActorRunPricingInfo { - return ActorRunPricingInfo{ - PayPerEventActorPricingInfo: v, - } -} - -// PricePerDatasetItemActorPricingInfoAsActorRunPricingInfo is a convenience function that returns PricePerDatasetItemActorPricingInfo wrapped in ActorRunPricingInfo -func PricePerDatasetItemActorPricingInfoAsActorRunPricingInfo(v *PricePerDatasetItemActorPricingInfo) ActorRunPricingInfo { - return ActorRunPricingInfo{ - PricePerDatasetItemActorPricingInfo: v, - } -} - - -// Unmarshal JSON data into one of the pointers in the struct -func (dst *ActorRunPricingInfo) UnmarshalJSON(data []byte) error { - var err error - match := 0 - // try to unmarshal data into FlatPricePerMonthActorPricingInfo - err = newStrictDecoder(data).Decode(&dst.FlatPricePerMonthActorPricingInfo) - if err == nil { - jsonFlatPricePerMonthActorPricingInfo, _ := json.Marshal(dst.FlatPricePerMonthActorPricingInfo) - if string(jsonFlatPricePerMonthActorPricingInfo) == "{}" { // empty struct - dst.FlatPricePerMonthActorPricingInfo = nil - } else { - if err = validator.Validate(dst.FlatPricePerMonthActorPricingInfo); err != nil { - dst.FlatPricePerMonthActorPricingInfo = nil - } else { - match++ - } - } - } else { - dst.FlatPricePerMonthActorPricingInfo = nil - } - - // try to unmarshal data into FreeActorPricingInfo - err = newStrictDecoder(data).Decode(&dst.FreeActorPricingInfo) - if err == nil { - jsonFreeActorPricingInfo, _ := json.Marshal(dst.FreeActorPricingInfo) - if string(jsonFreeActorPricingInfo) == "{}" { // empty struct - dst.FreeActorPricingInfo = nil - } else { - if err = validator.Validate(dst.FreeActorPricingInfo); err != nil { - dst.FreeActorPricingInfo = nil - } else { - match++ - } - } - } else { - dst.FreeActorPricingInfo = nil - } - - // try to unmarshal data into PayPerEventActorPricingInfo - err = newStrictDecoder(data).Decode(&dst.PayPerEventActorPricingInfo) - if err == nil { - jsonPayPerEventActorPricingInfo, _ := json.Marshal(dst.PayPerEventActorPricingInfo) - if string(jsonPayPerEventActorPricingInfo) == "{}" { // empty struct - dst.PayPerEventActorPricingInfo = nil - } else { - if err = validator.Validate(dst.PayPerEventActorPricingInfo); err != nil { - dst.PayPerEventActorPricingInfo = nil - } else { - match++ - } - } - } else { - dst.PayPerEventActorPricingInfo = nil - } - - // try to unmarshal data into PricePerDatasetItemActorPricingInfo - err = newStrictDecoder(data).Decode(&dst.PricePerDatasetItemActorPricingInfo) - if err == nil { - jsonPricePerDatasetItemActorPricingInfo, _ := json.Marshal(dst.PricePerDatasetItemActorPricingInfo) - if string(jsonPricePerDatasetItemActorPricingInfo) == "{}" { // empty struct - dst.PricePerDatasetItemActorPricingInfo = nil - } else { - if err = validator.Validate(dst.PricePerDatasetItemActorPricingInfo); err != nil { - dst.PricePerDatasetItemActorPricingInfo = nil - } else { - match++ - } - } - } else { - dst.PricePerDatasetItemActorPricingInfo = nil - } - - if match > 1 { // more than 1 match - // reset to nil - dst.FlatPricePerMonthActorPricingInfo = nil - dst.FreeActorPricingInfo = nil - dst.PayPerEventActorPricingInfo = nil - dst.PricePerDatasetItemActorPricingInfo = nil - - return fmt.Errorf("data matches more than one schema in oneOf(ActorRunPricingInfo)") - } else if match == 1 { - return nil // exactly one match - } else { // no match - return fmt.Errorf("data failed to match schemas in oneOf(ActorRunPricingInfo)") - } -} - -// Marshal data from the first non-nil pointers in the struct to JSON -func (src ActorRunPricingInfo) MarshalJSON() ([]byte, error) { - if src.FlatPricePerMonthActorPricingInfo != nil { - return json.Marshal(&src.FlatPricePerMonthActorPricingInfo) - } - - if src.FreeActorPricingInfo != nil { - return json.Marshal(&src.FreeActorPricingInfo) - } - - if src.PayPerEventActorPricingInfo != nil { - return json.Marshal(&src.PayPerEventActorPricingInfo) - } - - if src.PricePerDatasetItemActorPricingInfo != nil { - return json.Marshal(&src.PricePerDatasetItemActorPricingInfo) - } - - return nil, nil // no data in oneOf schemas -} - -// Get the actual instance -func (obj *ActorRunPricingInfo) GetActualInstance() (interface{}) { - if obj == nil { - return nil - } - if obj.FlatPricePerMonthActorPricingInfo != nil { - return obj.FlatPricePerMonthActorPricingInfo - } - - if obj.FreeActorPricingInfo != nil { - return obj.FreeActorPricingInfo - } - - if obj.PayPerEventActorPricingInfo != nil { - return obj.PayPerEventActorPricingInfo - } - - if obj.PricePerDatasetItemActorPricingInfo != nil { - return obj.PricePerDatasetItemActorPricingInfo - } - - // all schemas are nil - return nil -} - -// Get the actual instance value -func (obj ActorRunPricingInfo) GetActualInstanceValue() (interface{}) { - if obj.FlatPricePerMonthActorPricingInfo != nil { - return *obj.FlatPricePerMonthActorPricingInfo - } - - if obj.FreeActorPricingInfo != nil { - return *obj.FreeActorPricingInfo - } - - if obj.PayPerEventActorPricingInfo != nil { - return *obj.PayPerEventActorPricingInfo - } - - if obj.PricePerDatasetItemActorPricingInfo != nil { - return *obj.PricePerDatasetItemActorPricingInfo - } - - // all schemas are nil - return nil -} - -type NullableActorRunPricingInfo struct { - value *ActorRunPricingInfo - isSet bool -} - -func (v NullableActorRunPricingInfo) Get() *ActorRunPricingInfo { - return v.value -} - -func (v *NullableActorRunPricingInfo) Set(val *ActorRunPricingInfo) { - v.value = val - v.isSet = true -} - -func (v NullableActorRunPricingInfo) IsSet() bool { - return v.isSet -} - -func (v *NullableActorRunPricingInfo) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableActorRunPricingInfo(val *ActorRunPricingInfo) *NullableActorRunPricingInfo { - return &NullableActorRunPricingInfo{value: val, isSet: true} -} - -func (v NullableActorRunPricingInfo) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableActorRunPricingInfo) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_actor_run_timeout_exceeded_error.go b/model_actor_run_timeout_exceeded_error.go deleted file mode 100644 index 8a4b5c9..0000000 --- a/model_actor_run_timeout_exceeded_error.go +++ /dev/null @@ -1,126 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" -) - -// checks if the ActorRunTimeoutExceededError type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &ActorRunTimeoutExceededError{} - -// ActorRunTimeoutExceededError struct for ActorRunTimeoutExceededError -type ActorRunTimeoutExceededError struct { - Error *RunTimeoutExceededErrorDetail `json:"error,omitempty"` -} - -// NewActorRunTimeoutExceededError instantiates a new ActorRunTimeoutExceededError object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewActorRunTimeoutExceededError() *ActorRunTimeoutExceededError { - this := ActorRunTimeoutExceededError{} - return &this -} - -// NewActorRunTimeoutExceededErrorWithDefaults instantiates a new ActorRunTimeoutExceededError object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewActorRunTimeoutExceededErrorWithDefaults() *ActorRunTimeoutExceededError { - this := ActorRunTimeoutExceededError{} - return &this -} - -// GetError returns the Error field value if set, zero value otherwise. -func (o *ActorRunTimeoutExceededError) GetError() RunTimeoutExceededErrorDetail { - if o == nil || IsNil(o.Error) { - var ret RunTimeoutExceededErrorDetail - return ret - } - return *o.Error -} - -// GetErrorOk returns a tuple with the Error field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ActorRunTimeoutExceededError) GetErrorOk() (*RunTimeoutExceededErrorDetail, bool) { - if o == nil || IsNil(o.Error) { - return nil, false - } - return o.Error, true -} - -// HasError returns a boolean if a field has been set. -func (o *ActorRunTimeoutExceededError) HasError() bool { - if o != nil && !IsNil(o.Error) { - return true - } - - return false -} - -// SetError gets a reference to the given RunTimeoutExceededErrorDetail and assigns it to the Error field. -func (o *ActorRunTimeoutExceededError) SetError(v RunTimeoutExceededErrorDetail) { - o.Error = &v -} - -func (o ActorRunTimeoutExceededError) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o ActorRunTimeoutExceededError) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if !IsNil(o.Error) { - toSerialize["error"] = o.Error - } - return toSerialize, nil -} - -type NullableActorRunTimeoutExceededError struct { - value *ActorRunTimeoutExceededError - isSet bool -} - -func (v NullableActorRunTimeoutExceededError) Get() *ActorRunTimeoutExceededError { - return v.value -} - -func (v *NullableActorRunTimeoutExceededError) Set(val *ActorRunTimeoutExceededError) { - v.value = val - v.isSet = true -} - -func (v NullableActorRunTimeoutExceededError) IsSet() bool { - return v.isSet -} - -func (v *NullableActorRunTimeoutExceededError) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableActorRunTimeoutExceededError(val *ActorRunTimeoutExceededError) *NullableActorRunTimeoutExceededError { - return &NullableActorRunTimeoutExceededError{value: val, isSet: true} -} - -func (v NullableActorRunTimeoutExceededError) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableActorRunTimeoutExceededError) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_actor_short.go b/model_actor_short.go deleted file mode 100644 index c6c12a0..0000000 --- a/model_actor_short.go +++ /dev/null @@ -1,353 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" - "time" - "bytes" - "fmt" -) - -// checks if the ActorShort type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &ActorShort{} - -// ActorShort struct for ActorShort -type ActorShort struct { - Id string `json:"id"` - CreatedAt time.Time `json:"createdAt"` - ModifiedAt time.Time `json:"modifiedAt"` - Name string `json:"name"` - Username string `json:"username"` - Title *string `json:"title,omitempty"` - Stats NullableActorStats `json:"stats,omitempty"` -} - -type _ActorShort ActorShort - -// NewActorShort instantiates a new ActorShort object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewActorShort(id string, createdAt time.Time, modifiedAt time.Time, name string, username string) *ActorShort { - this := ActorShort{} - this.Id = id - this.CreatedAt = createdAt - this.ModifiedAt = modifiedAt - this.Name = name - this.Username = username - return &this -} - -// NewActorShortWithDefaults instantiates a new ActorShort object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewActorShortWithDefaults() *ActorShort { - this := ActorShort{} - return &this -} - -// GetId returns the Id field value -func (o *ActorShort) GetId() string { - if o == nil { - var ret string - return ret - } - - return o.Id -} - -// GetIdOk returns a tuple with the Id field value -// and a boolean to check if the value has been set. -func (o *ActorShort) GetIdOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Id, true -} - -// SetId sets field value -func (o *ActorShort) SetId(v string) { - o.Id = v -} - -// GetCreatedAt returns the CreatedAt field value -func (o *ActorShort) GetCreatedAt() time.Time { - if o == nil { - var ret time.Time - return ret - } - - return o.CreatedAt -} - -// GetCreatedAtOk returns a tuple with the CreatedAt field value -// and a boolean to check if the value has been set. -func (o *ActorShort) GetCreatedAtOk() (*time.Time, bool) { - if o == nil { - return nil, false - } - return &o.CreatedAt, true -} - -// SetCreatedAt sets field value -func (o *ActorShort) SetCreatedAt(v time.Time) { - o.CreatedAt = v -} - -// GetModifiedAt returns the ModifiedAt field value -func (o *ActorShort) GetModifiedAt() time.Time { - if o == nil { - var ret time.Time - return ret - } - - return o.ModifiedAt -} - -// GetModifiedAtOk returns a tuple with the ModifiedAt field value -// and a boolean to check if the value has been set. -func (o *ActorShort) GetModifiedAtOk() (*time.Time, bool) { - if o == nil { - return nil, false - } - return &o.ModifiedAt, true -} - -// SetModifiedAt sets field value -func (o *ActorShort) SetModifiedAt(v time.Time) { - o.ModifiedAt = v -} - -// GetName returns the Name field value -func (o *ActorShort) GetName() string { - if o == nil { - var ret string - return ret - } - - return o.Name -} - -// GetNameOk returns a tuple with the Name field value -// and a boolean to check if the value has been set. -func (o *ActorShort) GetNameOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Name, true -} - -// SetName sets field value -func (o *ActorShort) SetName(v string) { - o.Name = v -} - -// GetUsername returns the Username field value -func (o *ActorShort) GetUsername() string { - if o == nil { - var ret string - return ret - } - - return o.Username -} - -// GetUsernameOk returns a tuple with the Username field value -// and a boolean to check if the value has been set. -func (o *ActorShort) GetUsernameOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Username, true -} - -// SetUsername sets field value -func (o *ActorShort) SetUsername(v string) { - o.Username = v -} - -// GetTitle returns the Title field value if set, zero value otherwise. -func (o *ActorShort) GetTitle() string { - if o == nil || IsNil(o.Title) { - var ret string - return ret - } - return *o.Title -} - -// GetTitleOk returns a tuple with the Title field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ActorShort) GetTitleOk() (*string, bool) { - if o == nil || IsNil(o.Title) { - return nil, false - } - return o.Title, true -} - -// HasTitle returns a boolean if a field has been set. -func (o *ActorShort) HasTitle() bool { - if o != nil && !IsNil(o.Title) { - return true - } - - return false -} - -// SetTitle gets a reference to the given string and assigns it to the Title field. -func (o *ActorShort) SetTitle(v string) { - o.Title = &v -} - -// GetStats returns the Stats field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *ActorShort) GetStats() ActorStats { - if o == nil || IsNil(o.Stats.Get()) { - var ret ActorStats - return ret - } - return *o.Stats.Get() -} - -// GetStatsOk returns a tuple with the Stats field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *ActorShort) GetStatsOk() (*ActorStats, bool) { - if o == nil { - return nil, false - } - return o.Stats.Get(), o.Stats.IsSet() -} - -// HasStats returns a boolean if a field has been set. -func (o *ActorShort) HasStats() bool { - if o != nil && o.Stats.IsSet() { - return true - } - - return false -} - -// SetStats gets a reference to the given NullableActorStats and assigns it to the Stats field. -func (o *ActorShort) SetStats(v ActorStats) { - o.Stats.Set(&v) -} -// SetStatsNil sets the value for Stats to be an explicit nil -func (o *ActorShort) SetStatsNil() { - o.Stats.Set(nil) -} - -// UnsetStats ensures that no value is present for Stats, not even an explicit nil -func (o *ActorShort) UnsetStats() { - o.Stats.Unset() -} - -func (o ActorShort) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o ActorShort) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["id"] = o.Id - toSerialize["createdAt"] = o.CreatedAt - toSerialize["modifiedAt"] = o.ModifiedAt - toSerialize["name"] = o.Name - toSerialize["username"] = o.Username - if !IsNil(o.Title) { - toSerialize["title"] = o.Title - } - if o.Stats.IsSet() { - toSerialize["stats"] = o.Stats.Get() - } - return toSerialize, nil -} - -func (o *ActorShort) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "id", - "createdAt", - "modifiedAt", - "name", - "username", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err; - } - - for _, requiredProperty := range(requiredProperties) { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varActorShort := _ActorShort{} - - decoder := json.NewDecoder(bytes.NewReader(data)) - decoder.DisallowUnknownFields() - err = decoder.Decode(&varActorShort) - - if err != nil { - return err - } - - *o = ActorShort(varActorShort) - - return err -} - -type NullableActorShort struct { - value *ActorShort - isSet bool -} - -func (v NullableActorShort) Get() *ActorShort { - return v.value -} - -func (v *NullableActorShort) Set(val *ActorShort) { - v.value = val - v.isSet = true -} - -func (v NullableActorShort) IsSet() bool { - return v.isSet -} - -func (v *NullableActorShort) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableActorShort(val *ActorShort) *NullableActorShort { - return &NullableActorShort{value: val, isSet: true} -} - -func (v NullableActorShort) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableActorShort) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_actor_standby.go b/model_actor_standby.go deleted file mode 100644 index 1736c86..0000000 --- a/model_actor_standby.go +++ /dev/null @@ -1,458 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" -) - -// checks if the ActorStandby type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &ActorStandby{} - -// ActorStandby struct for ActorStandby -type ActorStandby struct { - IsEnabled NullableBool `json:"isEnabled,omitempty"` - DesiredRequestsPerActorRun NullableInt32 `json:"desiredRequestsPerActorRun,omitempty"` - MaxRequestsPerActorRun NullableInt32 `json:"maxRequestsPerActorRun,omitempty"` - IdleTimeoutSecs NullableInt32 `json:"idleTimeoutSecs,omitempty"` - Build NullableString `json:"build,omitempty"` - MemoryMbytes NullableInt32 `json:"memoryMbytes,omitempty"` - DisableStandbyFieldsOverride NullableBool `json:"disableStandbyFieldsOverride,omitempty"` - ShouldPassActorInput NullableBool `json:"shouldPassActorInput,omitempty"` -} - -// NewActorStandby instantiates a new ActorStandby object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewActorStandby() *ActorStandby { - this := ActorStandby{} - return &this -} - -// NewActorStandbyWithDefaults instantiates a new ActorStandby object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewActorStandbyWithDefaults() *ActorStandby { - this := ActorStandby{} - return &this -} - -// GetIsEnabled returns the IsEnabled field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *ActorStandby) GetIsEnabled() bool { - if o == nil || IsNil(o.IsEnabled.Get()) { - var ret bool - return ret - } - return *o.IsEnabled.Get() -} - -// GetIsEnabledOk returns a tuple with the IsEnabled field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *ActorStandby) GetIsEnabledOk() (*bool, bool) { - if o == nil { - return nil, false - } - return o.IsEnabled.Get(), o.IsEnabled.IsSet() -} - -// HasIsEnabled returns a boolean if a field has been set. -func (o *ActorStandby) HasIsEnabled() bool { - if o != nil && o.IsEnabled.IsSet() { - return true - } - - return false -} - -// SetIsEnabled gets a reference to the given NullableBool and assigns it to the IsEnabled field. -func (o *ActorStandby) SetIsEnabled(v bool) { - o.IsEnabled.Set(&v) -} -// SetIsEnabledNil sets the value for IsEnabled to be an explicit nil -func (o *ActorStandby) SetIsEnabledNil() { - o.IsEnabled.Set(nil) -} - -// UnsetIsEnabled ensures that no value is present for IsEnabled, not even an explicit nil -func (o *ActorStandby) UnsetIsEnabled() { - o.IsEnabled.Unset() -} - -// GetDesiredRequestsPerActorRun returns the DesiredRequestsPerActorRun field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *ActorStandby) GetDesiredRequestsPerActorRun() int32 { - if o == nil || IsNil(o.DesiredRequestsPerActorRun.Get()) { - var ret int32 - return ret - } - return *o.DesiredRequestsPerActorRun.Get() -} - -// GetDesiredRequestsPerActorRunOk returns a tuple with the DesiredRequestsPerActorRun field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *ActorStandby) GetDesiredRequestsPerActorRunOk() (*int32, bool) { - if o == nil { - return nil, false - } - return o.DesiredRequestsPerActorRun.Get(), o.DesiredRequestsPerActorRun.IsSet() -} - -// HasDesiredRequestsPerActorRun returns a boolean if a field has been set. -func (o *ActorStandby) HasDesiredRequestsPerActorRun() bool { - if o != nil && o.DesiredRequestsPerActorRun.IsSet() { - return true - } - - return false -} - -// SetDesiredRequestsPerActorRun gets a reference to the given NullableInt32 and assigns it to the DesiredRequestsPerActorRun field. -func (o *ActorStandby) SetDesiredRequestsPerActorRun(v int32) { - o.DesiredRequestsPerActorRun.Set(&v) -} -// SetDesiredRequestsPerActorRunNil sets the value for DesiredRequestsPerActorRun to be an explicit nil -func (o *ActorStandby) SetDesiredRequestsPerActorRunNil() { - o.DesiredRequestsPerActorRun.Set(nil) -} - -// UnsetDesiredRequestsPerActorRun ensures that no value is present for DesiredRequestsPerActorRun, not even an explicit nil -func (o *ActorStandby) UnsetDesiredRequestsPerActorRun() { - o.DesiredRequestsPerActorRun.Unset() -} - -// GetMaxRequestsPerActorRun returns the MaxRequestsPerActorRun field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *ActorStandby) GetMaxRequestsPerActorRun() int32 { - if o == nil || IsNil(o.MaxRequestsPerActorRun.Get()) { - var ret int32 - return ret - } - return *o.MaxRequestsPerActorRun.Get() -} - -// GetMaxRequestsPerActorRunOk returns a tuple with the MaxRequestsPerActorRun field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *ActorStandby) GetMaxRequestsPerActorRunOk() (*int32, bool) { - if o == nil { - return nil, false - } - return o.MaxRequestsPerActorRun.Get(), o.MaxRequestsPerActorRun.IsSet() -} - -// HasMaxRequestsPerActorRun returns a boolean if a field has been set. -func (o *ActorStandby) HasMaxRequestsPerActorRun() bool { - if o != nil && o.MaxRequestsPerActorRun.IsSet() { - return true - } - - return false -} - -// SetMaxRequestsPerActorRun gets a reference to the given NullableInt32 and assigns it to the MaxRequestsPerActorRun field. -func (o *ActorStandby) SetMaxRequestsPerActorRun(v int32) { - o.MaxRequestsPerActorRun.Set(&v) -} -// SetMaxRequestsPerActorRunNil sets the value for MaxRequestsPerActorRun to be an explicit nil -func (o *ActorStandby) SetMaxRequestsPerActorRunNil() { - o.MaxRequestsPerActorRun.Set(nil) -} - -// UnsetMaxRequestsPerActorRun ensures that no value is present for MaxRequestsPerActorRun, not even an explicit nil -func (o *ActorStandby) UnsetMaxRequestsPerActorRun() { - o.MaxRequestsPerActorRun.Unset() -} - -// GetIdleTimeoutSecs returns the IdleTimeoutSecs field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *ActorStandby) GetIdleTimeoutSecs() int32 { - if o == nil || IsNil(o.IdleTimeoutSecs.Get()) { - var ret int32 - return ret - } - return *o.IdleTimeoutSecs.Get() -} - -// GetIdleTimeoutSecsOk returns a tuple with the IdleTimeoutSecs field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *ActorStandby) GetIdleTimeoutSecsOk() (*int32, bool) { - if o == nil { - return nil, false - } - return o.IdleTimeoutSecs.Get(), o.IdleTimeoutSecs.IsSet() -} - -// HasIdleTimeoutSecs returns a boolean if a field has been set. -func (o *ActorStandby) HasIdleTimeoutSecs() bool { - if o != nil && o.IdleTimeoutSecs.IsSet() { - return true - } - - return false -} - -// SetIdleTimeoutSecs gets a reference to the given NullableInt32 and assigns it to the IdleTimeoutSecs field. -func (o *ActorStandby) SetIdleTimeoutSecs(v int32) { - o.IdleTimeoutSecs.Set(&v) -} -// SetIdleTimeoutSecsNil sets the value for IdleTimeoutSecs to be an explicit nil -func (o *ActorStandby) SetIdleTimeoutSecsNil() { - o.IdleTimeoutSecs.Set(nil) -} - -// UnsetIdleTimeoutSecs ensures that no value is present for IdleTimeoutSecs, not even an explicit nil -func (o *ActorStandby) UnsetIdleTimeoutSecs() { - o.IdleTimeoutSecs.Unset() -} - -// GetBuild returns the Build field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *ActorStandby) GetBuild() string { - if o == nil || IsNil(o.Build.Get()) { - var ret string - return ret - } - return *o.Build.Get() -} - -// GetBuildOk returns a tuple with the Build field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *ActorStandby) GetBuildOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.Build.Get(), o.Build.IsSet() -} - -// HasBuild returns a boolean if a field has been set. -func (o *ActorStandby) HasBuild() bool { - if o != nil && o.Build.IsSet() { - return true - } - - return false -} - -// SetBuild gets a reference to the given NullableString and assigns it to the Build field. -func (o *ActorStandby) SetBuild(v string) { - o.Build.Set(&v) -} -// SetBuildNil sets the value for Build to be an explicit nil -func (o *ActorStandby) SetBuildNil() { - o.Build.Set(nil) -} - -// UnsetBuild ensures that no value is present for Build, not even an explicit nil -func (o *ActorStandby) UnsetBuild() { - o.Build.Unset() -} - -// GetMemoryMbytes returns the MemoryMbytes field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *ActorStandby) GetMemoryMbytes() int32 { - if o == nil || IsNil(o.MemoryMbytes.Get()) { - var ret int32 - return ret - } - return *o.MemoryMbytes.Get() -} - -// GetMemoryMbytesOk returns a tuple with the MemoryMbytes field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *ActorStandby) GetMemoryMbytesOk() (*int32, bool) { - if o == nil { - return nil, false - } - return o.MemoryMbytes.Get(), o.MemoryMbytes.IsSet() -} - -// HasMemoryMbytes returns a boolean if a field has been set. -func (o *ActorStandby) HasMemoryMbytes() bool { - if o != nil && o.MemoryMbytes.IsSet() { - return true - } - - return false -} - -// SetMemoryMbytes gets a reference to the given NullableInt32 and assigns it to the MemoryMbytes field. -func (o *ActorStandby) SetMemoryMbytes(v int32) { - o.MemoryMbytes.Set(&v) -} -// SetMemoryMbytesNil sets the value for MemoryMbytes to be an explicit nil -func (o *ActorStandby) SetMemoryMbytesNil() { - o.MemoryMbytes.Set(nil) -} - -// UnsetMemoryMbytes ensures that no value is present for MemoryMbytes, not even an explicit nil -func (o *ActorStandby) UnsetMemoryMbytes() { - o.MemoryMbytes.Unset() -} - -// GetDisableStandbyFieldsOverride returns the DisableStandbyFieldsOverride field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *ActorStandby) GetDisableStandbyFieldsOverride() bool { - if o == nil || IsNil(o.DisableStandbyFieldsOverride.Get()) { - var ret bool - return ret - } - return *o.DisableStandbyFieldsOverride.Get() -} - -// GetDisableStandbyFieldsOverrideOk returns a tuple with the DisableStandbyFieldsOverride field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *ActorStandby) GetDisableStandbyFieldsOverrideOk() (*bool, bool) { - if o == nil { - return nil, false - } - return o.DisableStandbyFieldsOverride.Get(), o.DisableStandbyFieldsOverride.IsSet() -} - -// HasDisableStandbyFieldsOverride returns a boolean if a field has been set. -func (o *ActorStandby) HasDisableStandbyFieldsOverride() bool { - if o != nil && o.DisableStandbyFieldsOverride.IsSet() { - return true - } - - return false -} - -// SetDisableStandbyFieldsOverride gets a reference to the given NullableBool and assigns it to the DisableStandbyFieldsOverride field. -func (o *ActorStandby) SetDisableStandbyFieldsOverride(v bool) { - o.DisableStandbyFieldsOverride.Set(&v) -} -// SetDisableStandbyFieldsOverrideNil sets the value for DisableStandbyFieldsOverride to be an explicit nil -func (o *ActorStandby) SetDisableStandbyFieldsOverrideNil() { - o.DisableStandbyFieldsOverride.Set(nil) -} - -// UnsetDisableStandbyFieldsOverride ensures that no value is present for DisableStandbyFieldsOverride, not even an explicit nil -func (o *ActorStandby) UnsetDisableStandbyFieldsOverride() { - o.DisableStandbyFieldsOverride.Unset() -} - -// GetShouldPassActorInput returns the ShouldPassActorInput field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *ActorStandby) GetShouldPassActorInput() bool { - if o == nil || IsNil(o.ShouldPassActorInput.Get()) { - var ret bool - return ret - } - return *o.ShouldPassActorInput.Get() -} - -// GetShouldPassActorInputOk returns a tuple with the ShouldPassActorInput field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *ActorStandby) GetShouldPassActorInputOk() (*bool, bool) { - if o == nil { - return nil, false - } - return o.ShouldPassActorInput.Get(), o.ShouldPassActorInput.IsSet() -} - -// HasShouldPassActorInput returns a boolean if a field has been set. -func (o *ActorStandby) HasShouldPassActorInput() bool { - if o != nil && o.ShouldPassActorInput.IsSet() { - return true - } - - return false -} - -// SetShouldPassActorInput gets a reference to the given NullableBool and assigns it to the ShouldPassActorInput field. -func (o *ActorStandby) SetShouldPassActorInput(v bool) { - o.ShouldPassActorInput.Set(&v) -} -// SetShouldPassActorInputNil sets the value for ShouldPassActorInput to be an explicit nil -func (o *ActorStandby) SetShouldPassActorInputNil() { - o.ShouldPassActorInput.Set(nil) -} - -// UnsetShouldPassActorInput ensures that no value is present for ShouldPassActorInput, not even an explicit nil -func (o *ActorStandby) UnsetShouldPassActorInput() { - o.ShouldPassActorInput.Unset() -} - -func (o ActorStandby) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o ActorStandby) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if o.IsEnabled.IsSet() { - toSerialize["isEnabled"] = o.IsEnabled.Get() - } - if o.DesiredRequestsPerActorRun.IsSet() { - toSerialize["desiredRequestsPerActorRun"] = o.DesiredRequestsPerActorRun.Get() - } - if o.MaxRequestsPerActorRun.IsSet() { - toSerialize["maxRequestsPerActorRun"] = o.MaxRequestsPerActorRun.Get() - } - if o.IdleTimeoutSecs.IsSet() { - toSerialize["idleTimeoutSecs"] = o.IdleTimeoutSecs.Get() - } - if o.Build.IsSet() { - toSerialize["build"] = o.Build.Get() - } - if o.MemoryMbytes.IsSet() { - toSerialize["memoryMbytes"] = o.MemoryMbytes.Get() - } - if o.DisableStandbyFieldsOverride.IsSet() { - toSerialize["disableStandbyFieldsOverride"] = o.DisableStandbyFieldsOverride.Get() - } - if o.ShouldPassActorInput.IsSet() { - toSerialize["shouldPassActorInput"] = o.ShouldPassActorInput.Get() - } - return toSerialize, nil -} - -type NullableActorStandby struct { - value *ActorStandby - isSet bool -} - -func (v NullableActorStandby) Get() *ActorStandby { - return v.value -} - -func (v *NullableActorStandby) Set(val *ActorStandby) { - v.value = val - v.isSet = true -} - -func (v NullableActorStandby) IsSet() bool { - return v.isSet -} - -func (v *NullableActorStandby) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableActorStandby(val *ActorStandby) *NullableActorStandby { - return &NullableActorStandby{value: val, isSet: true} -} - -func (v NullableActorStandby) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableActorStandby) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_actor_stats.go b/model_actor_stats.go deleted file mode 100644 index ef8a3a4..0000000 --- a/model_actor_stats.go +++ /dev/null @@ -1,523 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" - "time" -) - -// checks if the ActorStats type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &ActorStats{} - -// ActorStats struct for ActorStats -type ActorStats struct { - TotalBuilds *int32 `json:"totalBuilds,omitempty"` - TotalRuns *int32 `json:"totalRuns,omitempty"` - TotalUsers *int32 `json:"totalUsers,omitempty"` - TotalUsers7Days *int32 `json:"totalUsers7Days,omitempty"` - TotalUsers30Days *int32 `json:"totalUsers30Days,omitempty"` - TotalUsers90Days *int32 `json:"totalUsers90Days,omitempty"` - TotalMetamorphs *int32 `json:"totalMetamorphs,omitempty"` - LastRunStartedAt *time.Time `json:"lastRunStartedAt,omitempty"` - ActorReviewCount *int32 `json:"actorReviewCount,omitempty"` - ActorReviewRating *float32 `json:"actorReviewRating,omitempty"` - BookmarkCount *int32 `json:"bookmarkCount,omitempty"` - PublicActorRunStats30Days *ActorStatsPublicActorRunStats30Days `json:"publicActorRunStats30Days,omitempty"` -} - -// NewActorStats instantiates a new ActorStats object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewActorStats() *ActorStats { - this := ActorStats{} - return &this -} - -// NewActorStatsWithDefaults instantiates a new ActorStats object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewActorStatsWithDefaults() *ActorStats { - this := ActorStats{} - return &this -} - -// GetTotalBuilds returns the TotalBuilds field value if set, zero value otherwise. -func (o *ActorStats) GetTotalBuilds() int32 { - if o == nil || IsNil(o.TotalBuilds) { - var ret int32 - return ret - } - return *o.TotalBuilds -} - -// GetTotalBuildsOk returns a tuple with the TotalBuilds field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ActorStats) GetTotalBuildsOk() (*int32, bool) { - if o == nil || IsNil(o.TotalBuilds) { - return nil, false - } - return o.TotalBuilds, true -} - -// HasTotalBuilds returns a boolean if a field has been set. -func (o *ActorStats) HasTotalBuilds() bool { - if o != nil && !IsNil(o.TotalBuilds) { - return true - } - - return false -} - -// SetTotalBuilds gets a reference to the given int32 and assigns it to the TotalBuilds field. -func (o *ActorStats) SetTotalBuilds(v int32) { - o.TotalBuilds = &v -} - -// GetTotalRuns returns the TotalRuns field value if set, zero value otherwise. -func (o *ActorStats) GetTotalRuns() int32 { - if o == nil || IsNil(o.TotalRuns) { - var ret int32 - return ret - } - return *o.TotalRuns -} - -// GetTotalRunsOk returns a tuple with the TotalRuns field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ActorStats) GetTotalRunsOk() (*int32, bool) { - if o == nil || IsNil(o.TotalRuns) { - return nil, false - } - return o.TotalRuns, true -} - -// HasTotalRuns returns a boolean if a field has been set. -func (o *ActorStats) HasTotalRuns() bool { - if o != nil && !IsNil(o.TotalRuns) { - return true - } - - return false -} - -// SetTotalRuns gets a reference to the given int32 and assigns it to the TotalRuns field. -func (o *ActorStats) SetTotalRuns(v int32) { - o.TotalRuns = &v -} - -// GetTotalUsers returns the TotalUsers field value if set, zero value otherwise. -func (o *ActorStats) GetTotalUsers() int32 { - if o == nil || IsNil(o.TotalUsers) { - var ret int32 - return ret - } - return *o.TotalUsers -} - -// GetTotalUsersOk returns a tuple with the TotalUsers field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ActorStats) GetTotalUsersOk() (*int32, bool) { - if o == nil || IsNil(o.TotalUsers) { - return nil, false - } - return o.TotalUsers, true -} - -// HasTotalUsers returns a boolean if a field has been set. -func (o *ActorStats) HasTotalUsers() bool { - if o != nil && !IsNil(o.TotalUsers) { - return true - } - - return false -} - -// SetTotalUsers gets a reference to the given int32 and assigns it to the TotalUsers field. -func (o *ActorStats) SetTotalUsers(v int32) { - o.TotalUsers = &v -} - -// GetTotalUsers7Days returns the TotalUsers7Days field value if set, zero value otherwise. -func (o *ActorStats) GetTotalUsers7Days() int32 { - if o == nil || IsNil(o.TotalUsers7Days) { - var ret int32 - return ret - } - return *o.TotalUsers7Days -} - -// GetTotalUsers7DaysOk returns a tuple with the TotalUsers7Days field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ActorStats) GetTotalUsers7DaysOk() (*int32, bool) { - if o == nil || IsNil(o.TotalUsers7Days) { - return nil, false - } - return o.TotalUsers7Days, true -} - -// HasTotalUsers7Days returns a boolean if a field has been set. -func (o *ActorStats) HasTotalUsers7Days() bool { - if o != nil && !IsNil(o.TotalUsers7Days) { - return true - } - - return false -} - -// SetTotalUsers7Days gets a reference to the given int32 and assigns it to the TotalUsers7Days field. -func (o *ActorStats) SetTotalUsers7Days(v int32) { - o.TotalUsers7Days = &v -} - -// GetTotalUsers30Days returns the TotalUsers30Days field value if set, zero value otherwise. -func (o *ActorStats) GetTotalUsers30Days() int32 { - if o == nil || IsNil(o.TotalUsers30Days) { - var ret int32 - return ret - } - return *o.TotalUsers30Days -} - -// GetTotalUsers30DaysOk returns a tuple with the TotalUsers30Days field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ActorStats) GetTotalUsers30DaysOk() (*int32, bool) { - if o == nil || IsNil(o.TotalUsers30Days) { - return nil, false - } - return o.TotalUsers30Days, true -} - -// HasTotalUsers30Days returns a boolean if a field has been set. -func (o *ActorStats) HasTotalUsers30Days() bool { - if o != nil && !IsNil(o.TotalUsers30Days) { - return true - } - - return false -} - -// SetTotalUsers30Days gets a reference to the given int32 and assigns it to the TotalUsers30Days field. -func (o *ActorStats) SetTotalUsers30Days(v int32) { - o.TotalUsers30Days = &v -} - -// GetTotalUsers90Days returns the TotalUsers90Days field value if set, zero value otherwise. -func (o *ActorStats) GetTotalUsers90Days() int32 { - if o == nil || IsNil(o.TotalUsers90Days) { - var ret int32 - return ret - } - return *o.TotalUsers90Days -} - -// GetTotalUsers90DaysOk returns a tuple with the TotalUsers90Days field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ActorStats) GetTotalUsers90DaysOk() (*int32, bool) { - if o == nil || IsNil(o.TotalUsers90Days) { - return nil, false - } - return o.TotalUsers90Days, true -} - -// HasTotalUsers90Days returns a boolean if a field has been set. -func (o *ActorStats) HasTotalUsers90Days() bool { - if o != nil && !IsNil(o.TotalUsers90Days) { - return true - } - - return false -} - -// SetTotalUsers90Days gets a reference to the given int32 and assigns it to the TotalUsers90Days field. -func (o *ActorStats) SetTotalUsers90Days(v int32) { - o.TotalUsers90Days = &v -} - -// GetTotalMetamorphs returns the TotalMetamorphs field value if set, zero value otherwise. -func (o *ActorStats) GetTotalMetamorphs() int32 { - if o == nil || IsNil(o.TotalMetamorphs) { - var ret int32 - return ret - } - return *o.TotalMetamorphs -} - -// GetTotalMetamorphsOk returns a tuple with the TotalMetamorphs field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ActorStats) GetTotalMetamorphsOk() (*int32, bool) { - if o == nil || IsNil(o.TotalMetamorphs) { - return nil, false - } - return o.TotalMetamorphs, true -} - -// HasTotalMetamorphs returns a boolean if a field has been set. -func (o *ActorStats) HasTotalMetamorphs() bool { - if o != nil && !IsNil(o.TotalMetamorphs) { - return true - } - - return false -} - -// SetTotalMetamorphs gets a reference to the given int32 and assigns it to the TotalMetamorphs field. -func (o *ActorStats) SetTotalMetamorphs(v int32) { - o.TotalMetamorphs = &v -} - -// GetLastRunStartedAt returns the LastRunStartedAt field value if set, zero value otherwise. -func (o *ActorStats) GetLastRunStartedAt() time.Time { - if o == nil || IsNil(o.LastRunStartedAt) { - var ret time.Time - return ret - } - return *o.LastRunStartedAt -} - -// GetLastRunStartedAtOk returns a tuple with the LastRunStartedAt field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ActorStats) GetLastRunStartedAtOk() (*time.Time, bool) { - if o == nil || IsNil(o.LastRunStartedAt) { - return nil, false - } - return o.LastRunStartedAt, true -} - -// HasLastRunStartedAt returns a boolean if a field has been set. -func (o *ActorStats) HasLastRunStartedAt() bool { - if o != nil && !IsNil(o.LastRunStartedAt) { - return true - } - - return false -} - -// SetLastRunStartedAt gets a reference to the given time.Time and assigns it to the LastRunStartedAt field. -func (o *ActorStats) SetLastRunStartedAt(v time.Time) { - o.LastRunStartedAt = &v -} - -// GetActorReviewCount returns the ActorReviewCount field value if set, zero value otherwise. -func (o *ActorStats) GetActorReviewCount() int32 { - if o == nil || IsNil(o.ActorReviewCount) { - var ret int32 - return ret - } - return *o.ActorReviewCount -} - -// GetActorReviewCountOk returns a tuple with the ActorReviewCount field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ActorStats) GetActorReviewCountOk() (*int32, bool) { - if o == nil || IsNil(o.ActorReviewCount) { - return nil, false - } - return o.ActorReviewCount, true -} - -// HasActorReviewCount returns a boolean if a field has been set. -func (o *ActorStats) HasActorReviewCount() bool { - if o != nil && !IsNil(o.ActorReviewCount) { - return true - } - - return false -} - -// SetActorReviewCount gets a reference to the given int32 and assigns it to the ActorReviewCount field. -func (o *ActorStats) SetActorReviewCount(v int32) { - o.ActorReviewCount = &v -} - -// GetActorReviewRating returns the ActorReviewRating field value if set, zero value otherwise. -func (o *ActorStats) GetActorReviewRating() float32 { - if o == nil || IsNil(o.ActorReviewRating) { - var ret float32 - return ret - } - return *o.ActorReviewRating -} - -// GetActorReviewRatingOk returns a tuple with the ActorReviewRating field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ActorStats) GetActorReviewRatingOk() (*float32, bool) { - if o == nil || IsNil(o.ActorReviewRating) { - return nil, false - } - return o.ActorReviewRating, true -} - -// HasActorReviewRating returns a boolean if a field has been set. -func (o *ActorStats) HasActorReviewRating() bool { - if o != nil && !IsNil(o.ActorReviewRating) { - return true - } - - return false -} - -// SetActorReviewRating gets a reference to the given float32 and assigns it to the ActorReviewRating field. -func (o *ActorStats) SetActorReviewRating(v float32) { - o.ActorReviewRating = &v -} - -// GetBookmarkCount returns the BookmarkCount field value if set, zero value otherwise. -func (o *ActorStats) GetBookmarkCount() int32 { - if o == nil || IsNil(o.BookmarkCount) { - var ret int32 - return ret - } - return *o.BookmarkCount -} - -// GetBookmarkCountOk returns a tuple with the BookmarkCount field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ActorStats) GetBookmarkCountOk() (*int32, bool) { - if o == nil || IsNil(o.BookmarkCount) { - return nil, false - } - return o.BookmarkCount, true -} - -// HasBookmarkCount returns a boolean if a field has been set. -func (o *ActorStats) HasBookmarkCount() bool { - if o != nil && !IsNil(o.BookmarkCount) { - return true - } - - return false -} - -// SetBookmarkCount gets a reference to the given int32 and assigns it to the BookmarkCount field. -func (o *ActorStats) SetBookmarkCount(v int32) { - o.BookmarkCount = &v -} - -// GetPublicActorRunStats30Days returns the PublicActorRunStats30Days field value if set, zero value otherwise. -func (o *ActorStats) GetPublicActorRunStats30Days() ActorStatsPublicActorRunStats30Days { - if o == nil || IsNil(o.PublicActorRunStats30Days) { - var ret ActorStatsPublicActorRunStats30Days - return ret - } - return *o.PublicActorRunStats30Days -} - -// GetPublicActorRunStats30DaysOk returns a tuple with the PublicActorRunStats30Days field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ActorStats) GetPublicActorRunStats30DaysOk() (*ActorStatsPublicActorRunStats30Days, bool) { - if o == nil || IsNil(o.PublicActorRunStats30Days) { - return nil, false - } - return o.PublicActorRunStats30Days, true -} - -// HasPublicActorRunStats30Days returns a boolean if a field has been set. -func (o *ActorStats) HasPublicActorRunStats30Days() bool { - if o != nil && !IsNil(o.PublicActorRunStats30Days) { - return true - } - - return false -} - -// SetPublicActorRunStats30Days gets a reference to the given ActorStatsPublicActorRunStats30Days and assigns it to the PublicActorRunStats30Days field. -func (o *ActorStats) SetPublicActorRunStats30Days(v ActorStatsPublicActorRunStats30Days) { - o.PublicActorRunStats30Days = &v -} - -func (o ActorStats) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o ActorStats) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if !IsNil(o.TotalBuilds) { - toSerialize["totalBuilds"] = o.TotalBuilds - } - if !IsNil(o.TotalRuns) { - toSerialize["totalRuns"] = o.TotalRuns - } - if !IsNil(o.TotalUsers) { - toSerialize["totalUsers"] = o.TotalUsers - } - if !IsNil(o.TotalUsers7Days) { - toSerialize["totalUsers7Days"] = o.TotalUsers7Days - } - if !IsNil(o.TotalUsers30Days) { - toSerialize["totalUsers30Days"] = o.TotalUsers30Days - } - if !IsNil(o.TotalUsers90Days) { - toSerialize["totalUsers90Days"] = o.TotalUsers90Days - } - if !IsNil(o.TotalMetamorphs) { - toSerialize["totalMetamorphs"] = o.TotalMetamorphs - } - if !IsNil(o.LastRunStartedAt) { - toSerialize["lastRunStartedAt"] = o.LastRunStartedAt - } - if !IsNil(o.ActorReviewCount) { - toSerialize["actorReviewCount"] = o.ActorReviewCount - } - if !IsNil(o.ActorReviewRating) { - toSerialize["actorReviewRating"] = o.ActorReviewRating - } - if !IsNil(o.BookmarkCount) { - toSerialize["bookmarkCount"] = o.BookmarkCount - } - if !IsNil(o.PublicActorRunStats30Days) { - toSerialize["publicActorRunStats30Days"] = o.PublicActorRunStats30Days - } - return toSerialize, nil -} - -type NullableActorStats struct { - value *ActorStats - isSet bool -} - -func (v NullableActorStats) Get() *ActorStats { - return v.value -} - -func (v *NullableActorStats) Set(val *ActorStats) { - v.value = val - v.isSet = true -} - -func (v NullableActorStats) IsSet() bool { - return v.isSet -} - -func (v *NullableActorStats) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableActorStats(val *ActorStats) *NullableActorStats { - return &NullableActorStats{value: val, isSet: true} -} - -func (v NullableActorStats) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableActorStats) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_actor_stats_public_actor_run_stats30_days.go b/model_actor_stats_public_actor_run_stats30_days.go deleted file mode 100644 index eb487ee..0000000 --- a/model_actor_stats_public_actor_run_stats30_days.go +++ /dev/null @@ -1,270 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" -) - -// checks if the ActorStatsPublicActorRunStats30Days type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &ActorStatsPublicActorRunStats30Days{} - -// ActorStatsPublicActorRunStats30Days Run status counts over the past 30 days. -type ActorStatsPublicActorRunStats30Days struct { - ABORTED *int32 `json:"ABORTED,omitempty"` - FAILED *int32 `json:"FAILED,omitempty"` - SUCCEEDED *int32 `json:"SUCCEEDED,omitempty"` - TIMED_OUT *int32 `json:"TIMED-OUT,omitempty"` - TOTAL *int32 `json:"TOTAL,omitempty"` -} - -// NewActorStatsPublicActorRunStats30Days instantiates a new ActorStatsPublicActorRunStats30Days object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewActorStatsPublicActorRunStats30Days() *ActorStatsPublicActorRunStats30Days { - this := ActorStatsPublicActorRunStats30Days{} - return &this -} - -// NewActorStatsPublicActorRunStats30DaysWithDefaults instantiates a new ActorStatsPublicActorRunStats30Days object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewActorStatsPublicActorRunStats30DaysWithDefaults() *ActorStatsPublicActorRunStats30Days { - this := ActorStatsPublicActorRunStats30Days{} - return &this -} - -// GetABORTED returns the ABORTED field value if set, zero value otherwise. -func (o *ActorStatsPublicActorRunStats30Days) GetABORTED() int32 { - if o == nil || IsNil(o.ABORTED) { - var ret int32 - return ret - } - return *o.ABORTED -} - -// GetABORTEDOk returns a tuple with the ABORTED field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ActorStatsPublicActorRunStats30Days) GetABORTEDOk() (*int32, bool) { - if o == nil || IsNil(o.ABORTED) { - return nil, false - } - return o.ABORTED, true -} - -// HasABORTED returns a boolean if a field has been set. -func (o *ActorStatsPublicActorRunStats30Days) HasABORTED() bool { - if o != nil && !IsNil(o.ABORTED) { - return true - } - - return false -} - -// SetABORTED gets a reference to the given int32 and assigns it to the ABORTED field. -func (o *ActorStatsPublicActorRunStats30Days) SetABORTED(v int32) { - o.ABORTED = &v -} - -// GetFAILED returns the FAILED field value if set, zero value otherwise. -func (o *ActorStatsPublicActorRunStats30Days) GetFAILED() int32 { - if o == nil || IsNil(o.FAILED) { - var ret int32 - return ret - } - return *o.FAILED -} - -// GetFAILEDOk returns a tuple with the FAILED field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ActorStatsPublicActorRunStats30Days) GetFAILEDOk() (*int32, bool) { - if o == nil || IsNil(o.FAILED) { - return nil, false - } - return o.FAILED, true -} - -// HasFAILED returns a boolean if a field has been set. -func (o *ActorStatsPublicActorRunStats30Days) HasFAILED() bool { - if o != nil && !IsNil(o.FAILED) { - return true - } - - return false -} - -// SetFAILED gets a reference to the given int32 and assigns it to the FAILED field. -func (o *ActorStatsPublicActorRunStats30Days) SetFAILED(v int32) { - o.FAILED = &v -} - -// GetSUCCEEDED returns the SUCCEEDED field value if set, zero value otherwise. -func (o *ActorStatsPublicActorRunStats30Days) GetSUCCEEDED() int32 { - if o == nil || IsNil(o.SUCCEEDED) { - var ret int32 - return ret - } - return *o.SUCCEEDED -} - -// GetSUCCEEDEDOk returns a tuple with the SUCCEEDED field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ActorStatsPublicActorRunStats30Days) GetSUCCEEDEDOk() (*int32, bool) { - if o == nil || IsNil(o.SUCCEEDED) { - return nil, false - } - return o.SUCCEEDED, true -} - -// HasSUCCEEDED returns a boolean if a field has been set. -func (o *ActorStatsPublicActorRunStats30Days) HasSUCCEEDED() bool { - if o != nil && !IsNil(o.SUCCEEDED) { - return true - } - - return false -} - -// SetSUCCEEDED gets a reference to the given int32 and assigns it to the SUCCEEDED field. -func (o *ActorStatsPublicActorRunStats30Days) SetSUCCEEDED(v int32) { - o.SUCCEEDED = &v -} - -// GetTIMED_OUT returns the TIMED_OUT field value if set, zero value otherwise. -func (o *ActorStatsPublicActorRunStats30Days) GetTIMED_OUT() int32 { - if o == nil || IsNil(o.TIMED_OUT) { - var ret int32 - return ret - } - return *o.TIMED_OUT -} - -// GetTIMED_OUTOk returns a tuple with the TIMED_OUT field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ActorStatsPublicActorRunStats30Days) GetTIMED_OUTOk() (*int32, bool) { - if o == nil || IsNil(o.TIMED_OUT) { - return nil, false - } - return o.TIMED_OUT, true -} - -// HasTIMED_OUT returns a boolean if a field has been set. -func (o *ActorStatsPublicActorRunStats30Days) HasTIMED_OUT() bool { - if o != nil && !IsNil(o.TIMED_OUT) { - return true - } - - return false -} - -// SetTIMED_OUT gets a reference to the given int32 and assigns it to the TIMED_OUT field. -func (o *ActorStatsPublicActorRunStats30Days) SetTIMED_OUT(v int32) { - o.TIMED_OUT = &v -} - -// GetTOTAL returns the TOTAL field value if set, zero value otherwise. -func (o *ActorStatsPublicActorRunStats30Days) GetTOTAL() int32 { - if o == nil || IsNil(o.TOTAL) { - var ret int32 - return ret - } - return *o.TOTAL -} - -// GetTOTALOk returns a tuple with the TOTAL field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ActorStatsPublicActorRunStats30Days) GetTOTALOk() (*int32, bool) { - if o == nil || IsNil(o.TOTAL) { - return nil, false - } - return o.TOTAL, true -} - -// HasTOTAL returns a boolean if a field has been set. -func (o *ActorStatsPublicActorRunStats30Days) HasTOTAL() bool { - if o != nil && !IsNil(o.TOTAL) { - return true - } - - return false -} - -// SetTOTAL gets a reference to the given int32 and assigns it to the TOTAL field. -func (o *ActorStatsPublicActorRunStats30Days) SetTOTAL(v int32) { - o.TOTAL = &v -} - -func (o ActorStatsPublicActorRunStats30Days) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o ActorStatsPublicActorRunStats30Days) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if !IsNil(o.ABORTED) { - toSerialize["ABORTED"] = o.ABORTED - } - if !IsNil(o.FAILED) { - toSerialize["FAILED"] = o.FAILED - } - if !IsNil(o.SUCCEEDED) { - toSerialize["SUCCEEDED"] = o.SUCCEEDED - } - if !IsNil(o.TIMED_OUT) { - toSerialize["TIMED-OUT"] = o.TIMED_OUT - } - if !IsNil(o.TOTAL) { - toSerialize["TOTAL"] = o.TOTAL - } - return toSerialize, nil -} - -type NullableActorStatsPublicActorRunStats30Days struct { - value *ActorStatsPublicActorRunStats30Days - isSet bool -} - -func (v NullableActorStatsPublicActorRunStats30Days) Get() *ActorStatsPublicActorRunStats30Days { - return v.value -} - -func (v *NullableActorStatsPublicActorRunStats30Days) Set(val *ActorStatsPublicActorRunStats30Days) { - v.value = val - v.isSet = true -} - -func (v NullableActorStatsPublicActorRunStats30Days) IsSet() bool { - return v.isSet -} - -func (v *NullableActorStatsPublicActorRunStats30Days) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableActorStatsPublicActorRunStats30Days(val *ActorStatsPublicActorRunStats30Days) *NullableActorStatsPublicActorRunStats30Days { - return &NullableActorStatsPublicActorRunStats30Days{value: val, isSet: true} -} - -func (v NullableActorStatsPublicActorRunStats30Days) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableActorStatsPublicActorRunStats30Days) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_actor_task_get_200_response.go b/model_actor_task_get_200_response.go deleted file mode 100644 index 990dee5..0000000 --- a/model_actor_task_get_200_response.go +++ /dev/null @@ -1,158 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" - "bytes" - "fmt" -) - -// checks if the ActorTaskGet200Response type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &ActorTaskGet200Response{} - -// ActorTaskGet200Response struct for ActorTaskGet200Response -type ActorTaskGet200Response struct { - Data Task `json:"data"` -} - -type _ActorTaskGet200Response ActorTaskGet200Response - -// NewActorTaskGet200Response instantiates a new ActorTaskGet200Response object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewActorTaskGet200Response(data Task) *ActorTaskGet200Response { - this := ActorTaskGet200Response{} - this.Data = data - return &this -} - -// NewActorTaskGet200ResponseWithDefaults instantiates a new ActorTaskGet200Response object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewActorTaskGet200ResponseWithDefaults() *ActorTaskGet200Response { - this := ActorTaskGet200Response{} - return &this -} - -// GetData returns the Data field value -func (o *ActorTaskGet200Response) GetData() Task { - if o == nil { - var ret Task - return ret - } - - return o.Data -} - -// GetDataOk returns a tuple with the Data field value -// and a boolean to check if the value has been set. -func (o *ActorTaskGet200Response) GetDataOk() (*Task, bool) { - if o == nil { - return nil, false - } - return &o.Data, true -} - -// SetData sets field value -func (o *ActorTaskGet200Response) SetData(v Task) { - o.Data = v -} - -func (o ActorTaskGet200Response) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o ActorTaskGet200Response) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["data"] = o.Data - return toSerialize, nil -} - -func (o *ActorTaskGet200Response) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "data", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err; - } - - for _, requiredProperty := range(requiredProperties) { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varActorTaskGet200Response := _ActorTaskGet200Response{} - - decoder := json.NewDecoder(bytes.NewReader(data)) - decoder.DisallowUnknownFields() - err = decoder.Decode(&varActorTaskGet200Response) - - if err != nil { - return err - } - - *o = ActorTaskGet200Response(varActorTaskGet200Response) - - return err -} - -type NullableActorTaskGet200Response struct { - value *ActorTaskGet200Response - isSet bool -} - -func (v NullableActorTaskGet200Response) Get() *ActorTaskGet200Response { - return v.value -} - -func (v *NullableActorTaskGet200Response) Set(val *ActorTaskGet200Response) { - v.value = val - v.isSet = true -} - -func (v NullableActorTaskGet200Response) IsSet() bool { - return v.isSet -} - -func (v *NullableActorTaskGet200Response) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableActorTaskGet200Response(val *ActorTaskGet200Response) *NullableActorTaskGet200Response { - return &NullableActorTaskGet200Response{value: val, isSet: true} -} - -func (v NullableActorTaskGet200Response) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableActorTaskGet200Response) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_actor_task_runs_get_200_response.go b/model_actor_task_runs_get_200_response.go deleted file mode 100644 index 9ffded6..0000000 --- a/model_actor_task_runs_get_200_response.go +++ /dev/null @@ -1,158 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" - "bytes" - "fmt" -) - -// checks if the ActorTaskRunsGet200Response type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &ActorTaskRunsGet200Response{} - -// ActorTaskRunsGet200Response struct for ActorTaskRunsGet200Response -type ActorTaskRunsGet200Response struct { - Data ActorTaskRunsGet200ResponseData `json:"data"` -} - -type _ActorTaskRunsGet200Response ActorTaskRunsGet200Response - -// NewActorTaskRunsGet200Response instantiates a new ActorTaskRunsGet200Response object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewActorTaskRunsGet200Response(data ActorTaskRunsGet200ResponseData) *ActorTaskRunsGet200Response { - this := ActorTaskRunsGet200Response{} - this.Data = data - return &this -} - -// NewActorTaskRunsGet200ResponseWithDefaults instantiates a new ActorTaskRunsGet200Response object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewActorTaskRunsGet200ResponseWithDefaults() *ActorTaskRunsGet200Response { - this := ActorTaskRunsGet200Response{} - return &this -} - -// GetData returns the Data field value -func (o *ActorTaskRunsGet200Response) GetData() ActorTaskRunsGet200ResponseData { - if o == nil { - var ret ActorTaskRunsGet200ResponseData - return ret - } - - return o.Data -} - -// GetDataOk returns a tuple with the Data field value -// and a boolean to check if the value has been set. -func (o *ActorTaskRunsGet200Response) GetDataOk() (*ActorTaskRunsGet200ResponseData, bool) { - if o == nil { - return nil, false - } - return &o.Data, true -} - -// SetData sets field value -func (o *ActorTaskRunsGet200Response) SetData(v ActorTaskRunsGet200ResponseData) { - o.Data = v -} - -func (o ActorTaskRunsGet200Response) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o ActorTaskRunsGet200Response) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["data"] = o.Data - return toSerialize, nil -} - -func (o *ActorTaskRunsGet200Response) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "data", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err; - } - - for _, requiredProperty := range(requiredProperties) { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varActorTaskRunsGet200Response := _ActorTaskRunsGet200Response{} - - decoder := json.NewDecoder(bytes.NewReader(data)) - decoder.DisallowUnknownFields() - err = decoder.Decode(&varActorTaskRunsGet200Response) - - if err != nil { - return err - } - - *o = ActorTaskRunsGet200Response(varActorTaskRunsGet200Response) - - return err -} - -type NullableActorTaskRunsGet200Response struct { - value *ActorTaskRunsGet200Response - isSet bool -} - -func (v NullableActorTaskRunsGet200Response) Get() *ActorTaskRunsGet200Response { - return v.value -} - -func (v *NullableActorTaskRunsGet200Response) Set(val *ActorTaskRunsGet200Response) { - v.value = val - v.isSet = true -} - -func (v NullableActorTaskRunsGet200Response) IsSet() bool { - return v.isSet -} - -func (v *NullableActorTaskRunsGet200Response) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableActorTaskRunsGet200Response(val *ActorTaskRunsGet200Response) *NullableActorTaskRunsGet200Response { - return &NullableActorTaskRunsGet200Response{value: val, isSet: true} -} - -func (v NullableActorTaskRunsGet200Response) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableActorTaskRunsGet200Response) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_actor_task_runs_get_200_response_data.go b/model_actor_task_runs_get_200_response_data.go deleted file mode 100644 index 7d53ade..0000000 --- a/model_actor_task_runs_get_200_response_data.go +++ /dev/null @@ -1,303 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" - "bytes" - "fmt" -) - -// checks if the ActorTaskRunsGet200ResponseData type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &ActorTaskRunsGet200ResponseData{} - -// ActorTaskRunsGet200ResponseData struct for ActorTaskRunsGet200ResponseData -type ActorTaskRunsGet200ResponseData struct { - // The total number of items available across all pages. - Total int32 `json:"total"` - // The starting position for this page of results. - Offset int32 `json:"offset"` - // The maximum number of items returned per page. - Limit int32 `json:"limit"` - // Whether the results are sorted in descending order. - Desc bool `json:"desc"` - // The number of items returned in this response. - Count int32 `json:"count"` - Items []RunShort `json:"items"` -} - -type _ActorTaskRunsGet200ResponseData ActorTaskRunsGet200ResponseData - -// NewActorTaskRunsGet200ResponseData instantiates a new ActorTaskRunsGet200ResponseData object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewActorTaskRunsGet200ResponseData(total int32, offset int32, limit int32, desc bool, count int32, items []RunShort) *ActorTaskRunsGet200ResponseData { - this := ActorTaskRunsGet200ResponseData{} - this.Total = total - this.Offset = offset - this.Limit = limit - this.Desc = desc - this.Count = count - this.Items = items - return &this -} - -// NewActorTaskRunsGet200ResponseDataWithDefaults instantiates a new ActorTaskRunsGet200ResponseData object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewActorTaskRunsGet200ResponseDataWithDefaults() *ActorTaskRunsGet200ResponseData { - this := ActorTaskRunsGet200ResponseData{} - return &this -} - -// GetTotal returns the Total field value -func (o *ActorTaskRunsGet200ResponseData) GetTotal() int32 { - if o == nil { - var ret int32 - return ret - } - - return o.Total -} - -// GetTotalOk returns a tuple with the Total field value -// and a boolean to check if the value has been set. -func (o *ActorTaskRunsGet200ResponseData) GetTotalOk() (*int32, bool) { - if o == nil { - return nil, false - } - return &o.Total, true -} - -// SetTotal sets field value -func (o *ActorTaskRunsGet200ResponseData) SetTotal(v int32) { - o.Total = v -} - -// GetOffset returns the Offset field value -func (o *ActorTaskRunsGet200ResponseData) GetOffset() int32 { - if o == nil { - var ret int32 - return ret - } - - return o.Offset -} - -// GetOffsetOk returns a tuple with the Offset field value -// and a boolean to check if the value has been set. -func (o *ActorTaskRunsGet200ResponseData) GetOffsetOk() (*int32, bool) { - if o == nil { - return nil, false - } - return &o.Offset, true -} - -// SetOffset sets field value -func (o *ActorTaskRunsGet200ResponseData) SetOffset(v int32) { - o.Offset = v -} - -// GetLimit returns the Limit field value -func (o *ActorTaskRunsGet200ResponseData) GetLimit() int32 { - if o == nil { - var ret int32 - return ret - } - - return o.Limit -} - -// GetLimitOk returns a tuple with the Limit field value -// and a boolean to check if the value has been set. -func (o *ActorTaskRunsGet200ResponseData) GetLimitOk() (*int32, bool) { - if o == nil { - return nil, false - } - return &o.Limit, true -} - -// SetLimit sets field value -func (o *ActorTaskRunsGet200ResponseData) SetLimit(v int32) { - o.Limit = v -} - -// GetDesc returns the Desc field value -func (o *ActorTaskRunsGet200ResponseData) GetDesc() bool { - if o == nil { - var ret bool - return ret - } - - return o.Desc -} - -// GetDescOk returns a tuple with the Desc field value -// and a boolean to check if the value has been set. -func (o *ActorTaskRunsGet200ResponseData) GetDescOk() (*bool, bool) { - if o == nil { - return nil, false - } - return &o.Desc, true -} - -// SetDesc sets field value -func (o *ActorTaskRunsGet200ResponseData) SetDesc(v bool) { - o.Desc = v -} - -// GetCount returns the Count field value -func (o *ActorTaskRunsGet200ResponseData) GetCount() int32 { - if o == nil { - var ret int32 - return ret - } - - return o.Count -} - -// GetCountOk returns a tuple with the Count field value -// and a boolean to check if the value has been set. -func (o *ActorTaskRunsGet200ResponseData) GetCountOk() (*int32, bool) { - if o == nil { - return nil, false - } - return &o.Count, true -} - -// SetCount sets field value -func (o *ActorTaskRunsGet200ResponseData) SetCount(v int32) { - o.Count = v -} - -// GetItems returns the Items field value -func (o *ActorTaskRunsGet200ResponseData) GetItems() []RunShort { - if o == nil { - var ret []RunShort - return ret - } - - return o.Items -} - -// GetItemsOk returns a tuple with the Items field value -// and a boolean to check if the value has been set. -func (o *ActorTaskRunsGet200ResponseData) GetItemsOk() ([]RunShort, bool) { - if o == nil { - return nil, false - } - return o.Items, true -} - -// SetItems sets field value -func (o *ActorTaskRunsGet200ResponseData) SetItems(v []RunShort) { - o.Items = v -} - -func (o ActorTaskRunsGet200ResponseData) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o ActorTaskRunsGet200ResponseData) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["total"] = o.Total - toSerialize["offset"] = o.Offset - toSerialize["limit"] = o.Limit - toSerialize["desc"] = o.Desc - toSerialize["count"] = o.Count - toSerialize["items"] = o.Items - return toSerialize, nil -} - -func (o *ActorTaskRunsGet200ResponseData) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "total", - "offset", - "limit", - "desc", - "count", - "items", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err; - } - - for _, requiredProperty := range(requiredProperties) { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varActorTaskRunsGet200ResponseData := _ActorTaskRunsGet200ResponseData{} - - decoder := json.NewDecoder(bytes.NewReader(data)) - decoder.DisallowUnknownFields() - err = decoder.Decode(&varActorTaskRunsGet200ResponseData) - - if err != nil { - return err - } - - *o = ActorTaskRunsGet200ResponseData(varActorTaskRunsGet200ResponseData) - - return err -} - -type NullableActorTaskRunsGet200ResponseData struct { - value *ActorTaskRunsGet200ResponseData - isSet bool -} - -func (v NullableActorTaskRunsGet200ResponseData) Get() *ActorTaskRunsGet200ResponseData { - return v.value -} - -func (v *NullableActorTaskRunsGet200ResponseData) Set(val *ActorTaskRunsGet200ResponseData) { - v.value = val - v.isSet = true -} - -func (v NullableActorTaskRunsGet200ResponseData) IsSet() bool { - return v.isSet -} - -func (v *NullableActorTaskRunsGet200ResponseData) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableActorTaskRunsGet200ResponseData(val *ActorTaskRunsGet200ResponseData) *NullableActorTaskRunsGet200ResponseData { - return &NullableActorTaskRunsGet200ResponseData{value: val, isSet: true} -} - -func (v NullableActorTaskRunsGet200ResponseData) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableActorTaskRunsGet200ResponseData) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_actor_task_runs_post_201_response.go b/model_actor_task_runs_post_201_response.go deleted file mode 100644 index ec29890..0000000 --- a/model_actor_task_runs_post_201_response.go +++ /dev/null @@ -1,158 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" - "bytes" - "fmt" -) - -// checks if the ActorTaskRunsPost201Response type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &ActorTaskRunsPost201Response{} - -// ActorTaskRunsPost201Response struct for ActorTaskRunsPost201Response -type ActorTaskRunsPost201Response struct { - Data Run `json:"data"` -} - -type _ActorTaskRunsPost201Response ActorTaskRunsPost201Response - -// NewActorTaskRunsPost201Response instantiates a new ActorTaskRunsPost201Response object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewActorTaskRunsPost201Response(data Run) *ActorTaskRunsPost201Response { - this := ActorTaskRunsPost201Response{} - this.Data = data - return &this -} - -// NewActorTaskRunsPost201ResponseWithDefaults instantiates a new ActorTaskRunsPost201Response object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewActorTaskRunsPost201ResponseWithDefaults() *ActorTaskRunsPost201Response { - this := ActorTaskRunsPost201Response{} - return &this -} - -// GetData returns the Data field value -func (o *ActorTaskRunsPost201Response) GetData() Run { - if o == nil { - var ret Run - return ret - } - - return o.Data -} - -// GetDataOk returns a tuple with the Data field value -// and a boolean to check if the value has been set. -func (o *ActorTaskRunsPost201Response) GetDataOk() (*Run, bool) { - if o == nil { - return nil, false - } - return &o.Data, true -} - -// SetData sets field value -func (o *ActorTaskRunsPost201Response) SetData(v Run) { - o.Data = v -} - -func (o ActorTaskRunsPost201Response) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o ActorTaskRunsPost201Response) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["data"] = o.Data - return toSerialize, nil -} - -func (o *ActorTaskRunsPost201Response) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "data", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err; - } - - for _, requiredProperty := range(requiredProperties) { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varActorTaskRunsPost201Response := _ActorTaskRunsPost201Response{} - - decoder := json.NewDecoder(bytes.NewReader(data)) - decoder.DisallowUnknownFields() - err = decoder.Decode(&varActorTaskRunsPost201Response) - - if err != nil { - return err - } - - *o = ActorTaskRunsPost201Response(varActorTaskRunsPost201Response) - - return err -} - -type NullableActorTaskRunsPost201Response struct { - value *ActorTaskRunsPost201Response - isSet bool -} - -func (v NullableActorTaskRunsPost201Response) Get() *ActorTaskRunsPost201Response { - return v.value -} - -func (v *NullableActorTaskRunsPost201Response) Set(val *ActorTaskRunsPost201Response) { - v.value = val - v.isSet = true -} - -func (v NullableActorTaskRunsPost201Response) IsSet() bool { - return v.isSet -} - -func (v *NullableActorTaskRunsPost201Response) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableActorTaskRunsPost201Response(val *ActorTaskRunsPost201Response) *NullableActorTaskRunsPost201Response { - return &NullableActorTaskRunsPost201Response{value: val, isSet: true} -} - -func (v NullableActorTaskRunsPost201Response) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableActorTaskRunsPost201Response) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_actor_task_webhooks_get_200_response.go b/model_actor_task_webhooks_get_200_response.go deleted file mode 100644 index 8a4f793..0000000 --- a/model_actor_task_webhooks_get_200_response.go +++ /dev/null @@ -1,158 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" - "bytes" - "fmt" -) - -// checks if the ActorTaskWebhooksGet200Response type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &ActorTaskWebhooksGet200Response{} - -// ActorTaskWebhooksGet200Response struct for ActorTaskWebhooksGet200Response -type ActorTaskWebhooksGet200Response struct { - Data ActorTaskWebhooksGet200ResponseData `json:"data"` -} - -type _ActorTaskWebhooksGet200Response ActorTaskWebhooksGet200Response - -// NewActorTaskWebhooksGet200Response instantiates a new ActorTaskWebhooksGet200Response object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewActorTaskWebhooksGet200Response(data ActorTaskWebhooksGet200ResponseData) *ActorTaskWebhooksGet200Response { - this := ActorTaskWebhooksGet200Response{} - this.Data = data - return &this -} - -// NewActorTaskWebhooksGet200ResponseWithDefaults instantiates a new ActorTaskWebhooksGet200Response object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewActorTaskWebhooksGet200ResponseWithDefaults() *ActorTaskWebhooksGet200Response { - this := ActorTaskWebhooksGet200Response{} - return &this -} - -// GetData returns the Data field value -func (o *ActorTaskWebhooksGet200Response) GetData() ActorTaskWebhooksGet200ResponseData { - if o == nil { - var ret ActorTaskWebhooksGet200ResponseData - return ret - } - - return o.Data -} - -// GetDataOk returns a tuple with the Data field value -// and a boolean to check if the value has been set. -func (o *ActorTaskWebhooksGet200Response) GetDataOk() (*ActorTaskWebhooksGet200ResponseData, bool) { - if o == nil { - return nil, false - } - return &o.Data, true -} - -// SetData sets field value -func (o *ActorTaskWebhooksGet200Response) SetData(v ActorTaskWebhooksGet200ResponseData) { - o.Data = v -} - -func (o ActorTaskWebhooksGet200Response) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o ActorTaskWebhooksGet200Response) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["data"] = o.Data - return toSerialize, nil -} - -func (o *ActorTaskWebhooksGet200Response) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "data", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err; - } - - for _, requiredProperty := range(requiredProperties) { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varActorTaskWebhooksGet200Response := _ActorTaskWebhooksGet200Response{} - - decoder := json.NewDecoder(bytes.NewReader(data)) - decoder.DisallowUnknownFields() - err = decoder.Decode(&varActorTaskWebhooksGet200Response) - - if err != nil { - return err - } - - *o = ActorTaskWebhooksGet200Response(varActorTaskWebhooksGet200Response) - - return err -} - -type NullableActorTaskWebhooksGet200Response struct { - value *ActorTaskWebhooksGet200Response - isSet bool -} - -func (v NullableActorTaskWebhooksGet200Response) Get() *ActorTaskWebhooksGet200Response { - return v.value -} - -func (v *NullableActorTaskWebhooksGet200Response) Set(val *ActorTaskWebhooksGet200Response) { - v.value = val - v.isSet = true -} - -func (v NullableActorTaskWebhooksGet200Response) IsSet() bool { - return v.isSet -} - -func (v *NullableActorTaskWebhooksGet200Response) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableActorTaskWebhooksGet200Response(val *ActorTaskWebhooksGet200Response) *NullableActorTaskWebhooksGet200Response { - return &NullableActorTaskWebhooksGet200Response{value: val, isSet: true} -} - -func (v NullableActorTaskWebhooksGet200Response) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableActorTaskWebhooksGet200Response) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_actor_task_webhooks_get_200_response_data.go b/model_actor_task_webhooks_get_200_response_data.go deleted file mode 100644 index 055f3f9..0000000 --- a/model_actor_task_webhooks_get_200_response_data.go +++ /dev/null @@ -1,303 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" - "bytes" - "fmt" -) - -// checks if the ActorTaskWebhooksGet200ResponseData type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &ActorTaskWebhooksGet200ResponseData{} - -// ActorTaskWebhooksGet200ResponseData struct for ActorTaskWebhooksGet200ResponseData -type ActorTaskWebhooksGet200ResponseData struct { - // The total number of items available across all pages. - Total int32 `json:"total"` - // The starting position for this page of results. - Offset int32 `json:"offset"` - // The maximum number of items returned per page. - Limit int32 `json:"limit"` - // Whether the results are sorted in descending order. - Desc bool `json:"desc"` - // The number of items returned in this response. - Count int32 `json:"count"` - Items []Webhook `json:"items"` -} - -type _ActorTaskWebhooksGet200ResponseData ActorTaskWebhooksGet200ResponseData - -// NewActorTaskWebhooksGet200ResponseData instantiates a new ActorTaskWebhooksGet200ResponseData object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewActorTaskWebhooksGet200ResponseData(total int32, offset int32, limit int32, desc bool, count int32, items []Webhook) *ActorTaskWebhooksGet200ResponseData { - this := ActorTaskWebhooksGet200ResponseData{} - this.Total = total - this.Offset = offset - this.Limit = limit - this.Desc = desc - this.Count = count - this.Items = items - return &this -} - -// NewActorTaskWebhooksGet200ResponseDataWithDefaults instantiates a new ActorTaskWebhooksGet200ResponseData object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewActorTaskWebhooksGet200ResponseDataWithDefaults() *ActorTaskWebhooksGet200ResponseData { - this := ActorTaskWebhooksGet200ResponseData{} - return &this -} - -// GetTotal returns the Total field value -func (o *ActorTaskWebhooksGet200ResponseData) GetTotal() int32 { - if o == nil { - var ret int32 - return ret - } - - return o.Total -} - -// GetTotalOk returns a tuple with the Total field value -// and a boolean to check if the value has been set. -func (o *ActorTaskWebhooksGet200ResponseData) GetTotalOk() (*int32, bool) { - if o == nil { - return nil, false - } - return &o.Total, true -} - -// SetTotal sets field value -func (o *ActorTaskWebhooksGet200ResponseData) SetTotal(v int32) { - o.Total = v -} - -// GetOffset returns the Offset field value -func (o *ActorTaskWebhooksGet200ResponseData) GetOffset() int32 { - if o == nil { - var ret int32 - return ret - } - - return o.Offset -} - -// GetOffsetOk returns a tuple with the Offset field value -// and a boolean to check if the value has been set. -func (o *ActorTaskWebhooksGet200ResponseData) GetOffsetOk() (*int32, bool) { - if o == nil { - return nil, false - } - return &o.Offset, true -} - -// SetOffset sets field value -func (o *ActorTaskWebhooksGet200ResponseData) SetOffset(v int32) { - o.Offset = v -} - -// GetLimit returns the Limit field value -func (o *ActorTaskWebhooksGet200ResponseData) GetLimit() int32 { - if o == nil { - var ret int32 - return ret - } - - return o.Limit -} - -// GetLimitOk returns a tuple with the Limit field value -// and a boolean to check if the value has been set. -func (o *ActorTaskWebhooksGet200ResponseData) GetLimitOk() (*int32, bool) { - if o == nil { - return nil, false - } - return &o.Limit, true -} - -// SetLimit sets field value -func (o *ActorTaskWebhooksGet200ResponseData) SetLimit(v int32) { - o.Limit = v -} - -// GetDesc returns the Desc field value -func (o *ActorTaskWebhooksGet200ResponseData) GetDesc() bool { - if o == nil { - var ret bool - return ret - } - - return o.Desc -} - -// GetDescOk returns a tuple with the Desc field value -// and a boolean to check if the value has been set. -func (o *ActorTaskWebhooksGet200ResponseData) GetDescOk() (*bool, bool) { - if o == nil { - return nil, false - } - return &o.Desc, true -} - -// SetDesc sets field value -func (o *ActorTaskWebhooksGet200ResponseData) SetDesc(v bool) { - o.Desc = v -} - -// GetCount returns the Count field value -func (o *ActorTaskWebhooksGet200ResponseData) GetCount() int32 { - if o == nil { - var ret int32 - return ret - } - - return o.Count -} - -// GetCountOk returns a tuple with the Count field value -// and a boolean to check if the value has been set. -func (o *ActorTaskWebhooksGet200ResponseData) GetCountOk() (*int32, bool) { - if o == nil { - return nil, false - } - return &o.Count, true -} - -// SetCount sets field value -func (o *ActorTaskWebhooksGet200ResponseData) SetCount(v int32) { - o.Count = v -} - -// GetItems returns the Items field value -func (o *ActorTaskWebhooksGet200ResponseData) GetItems() []Webhook { - if o == nil { - var ret []Webhook - return ret - } - - return o.Items -} - -// GetItemsOk returns a tuple with the Items field value -// and a boolean to check if the value has been set. -func (o *ActorTaskWebhooksGet200ResponseData) GetItemsOk() ([]Webhook, bool) { - if o == nil { - return nil, false - } - return o.Items, true -} - -// SetItems sets field value -func (o *ActorTaskWebhooksGet200ResponseData) SetItems(v []Webhook) { - o.Items = v -} - -func (o ActorTaskWebhooksGet200ResponseData) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o ActorTaskWebhooksGet200ResponseData) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["total"] = o.Total - toSerialize["offset"] = o.Offset - toSerialize["limit"] = o.Limit - toSerialize["desc"] = o.Desc - toSerialize["count"] = o.Count - toSerialize["items"] = o.Items - return toSerialize, nil -} - -func (o *ActorTaskWebhooksGet200ResponseData) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "total", - "offset", - "limit", - "desc", - "count", - "items", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err; - } - - for _, requiredProperty := range(requiredProperties) { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varActorTaskWebhooksGet200ResponseData := _ActorTaskWebhooksGet200ResponseData{} - - decoder := json.NewDecoder(bytes.NewReader(data)) - decoder.DisallowUnknownFields() - err = decoder.Decode(&varActorTaskWebhooksGet200ResponseData) - - if err != nil { - return err - } - - *o = ActorTaskWebhooksGet200ResponseData(varActorTaskWebhooksGet200ResponseData) - - return err -} - -type NullableActorTaskWebhooksGet200ResponseData struct { - value *ActorTaskWebhooksGet200ResponseData - isSet bool -} - -func (v NullableActorTaskWebhooksGet200ResponseData) Get() *ActorTaskWebhooksGet200ResponseData { - return v.value -} - -func (v *NullableActorTaskWebhooksGet200ResponseData) Set(val *ActorTaskWebhooksGet200ResponseData) { - v.value = val - v.isSet = true -} - -func (v NullableActorTaskWebhooksGet200ResponseData) IsSet() bool { - return v.isSet -} - -func (v *NullableActorTaskWebhooksGet200ResponseData) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableActorTaskWebhooksGet200ResponseData(val *ActorTaskWebhooksGet200ResponseData) *NullableActorTaskWebhooksGet200ResponseData { - return &NullableActorTaskWebhooksGet200ResponseData{value: val, isSet: true} -} - -func (v NullableActorTaskWebhooksGet200ResponseData) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableActorTaskWebhooksGet200ResponseData) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_add_request_response.go b/model_add_request_response.go deleted file mode 100644 index 70dd710..0000000 --- a/model_add_request_response.go +++ /dev/null @@ -1,158 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" - "bytes" - "fmt" -) - -// checks if the AddRequestResponse type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &AddRequestResponse{} - -// AddRequestResponse Response containing the result of adding a request to the request queue. -type AddRequestResponse struct { - Data RequestRegistration `json:"data"` -} - -type _AddRequestResponse AddRequestResponse - -// NewAddRequestResponse instantiates a new AddRequestResponse object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewAddRequestResponse(data RequestRegistration) *AddRequestResponse { - this := AddRequestResponse{} - this.Data = data - return &this -} - -// NewAddRequestResponseWithDefaults instantiates a new AddRequestResponse object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewAddRequestResponseWithDefaults() *AddRequestResponse { - this := AddRequestResponse{} - return &this -} - -// GetData returns the Data field value -func (o *AddRequestResponse) GetData() RequestRegistration { - if o == nil { - var ret RequestRegistration - return ret - } - - return o.Data -} - -// GetDataOk returns a tuple with the Data field value -// and a boolean to check if the value has been set. -func (o *AddRequestResponse) GetDataOk() (*RequestRegistration, bool) { - if o == nil { - return nil, false - } - return &o.Data, true -} - -// SetData sets field value -func (o *AddRequestResponse) SetData(v RequestRegistration) { - o.Data = v -} - -func (o AddRequestResponse) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o AddRequestResponse) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["data"] = o.Data - return toSerialize, nil -} - -func (o *AddRequestResponse) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "data", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err; - } - - for _, requiredProperty := range(requiredProperties) { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varAddRequestResponse := _AddRequestResponse{} - - decoder := json.NewDecoder(bytes.NewReader(data)) - decoder.DisallowUnknownFields() - err = decoder.Decode(&varAddRequestResponse) - - if err != nil { - return err - } - - *o = AddRequestResponse(varAddRequestResponse) - - return err -} - -type NullableAddRequestResponse struct { - value *AddRequestResponse - isSet bool -} - -func (v NullableAddRequestResponse) Get() *AddRequestResponse { - return v.value -} - -func (v *NullableAddRequestResponse) Set(val *AddRequestResponse) { - v.value = val - v.isSet = true -} - -func (v NullableAddRequestResponse) IsSet() bool { - return v.isSet -} - -func (v *NullableAddRequestResponse) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableAddRequestResponse(val *AddRequestResponse) *NullableAddRequestResponse { - return &NullableAddRequestResponse{value: val, isSet: true} -} - -func (v NullableAddRequestResponse) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableAddRequestResponse) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_added_request.go b/model_added_request.go deleted file mode 100644 index 1dfc64a..0000000 --- a/model_added_request.go +++ /dev/null @@ -1,246 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" - "bytes" - "fmt" -) - -// checks if the AddedRequest type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &AddedRequest{} - -// AddedRequest Information about a request that was successfully added to a request queue. -type AddedRequest struct { - // A unique identifier assigned to the request. - RequestId string `json:"requestId"` - // A unique key used for request de-duplication. Requests with the same unique key are considered identical. - UniqueKey string `json:"uniqueKey"` - // Indicates whether a request with the same unique key already existed in the request queue. If true, no new request was created. - WasAlreadyPresent bool `json:"wasAlreadyPresent"` - // Indicates whether a request with the same unique key has already been processed by the request queue. - WasAlreadyHandled bool `json:"wasAlreadyHandled"` -} - -type _AddedRequest AddedRequest - -// NewAddedRequest instantiates a new AddedRequest object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewAddedRequest(requestId string, uniqueKey string, wasAlreadyPresent bool, wasAlreadyHandled bool) *AddedRequest { - this := AddedRequest{} - this.RequestId = requestId - this.UniqueKey = uniqueKey - this.WasAlreadyPresent = wasAlreadyPresent - this.WasAlreadyHandled = wasAlreadyHandled - return &this -} - -// NewAddedRequestWithDefaults instantiates a new AddedRequest object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewAddedRequestWithDefaults() *AddedRequest { - this := AddedRequest{} - return &this -} - -// GetRequestId returns the RequestId field value -func (o *AddedRequest) GetRequestId() string { - if o == nil { - var ret string - return ret - } - - return o.RequestId -} - -// GetRequestIdOk returns a tuple with the RequestId field value -// and a boolean to check if the value has been set. -func (o *AddedRequest) GetRequestIdOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.RequestId, true -} - -// SetRequestId sets field value -func (o *AddedRequest) SetRequestId(v string) { - o.RequestId = v -} - -// GetUniqueKey returns the UniqueKey field value -func (o *AddedRequest) GetUniqueKey() string { - if o == nil { - var ret string - return ret - } - - return o.UniqueKey -} - -// GetUniqueKeyOk returns a tuple with the UniqueKey field value -// and a boolean to check if the value has been set. -func (o *AddedRequest) GetUniqueKeyOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.UniqueKey, true -} - -// SetUniqueKey sets field value -func (o *AddedRequest) SetUniqueKey(v string) { - o.UniqueKey = v -} - -// GetWasAlreadyPresent returns the WasAlreadyPresent field value -func (o *AddedRequest) GetWasAlreadyPresent() bool { - if o == nil { - var ret bool - return ret - } - - return o.WasAlreadyPresent -} - -// GetWasAlreadyPresentOk returns a tuple with the WasAlreadyPresent field value -// and a boolean to check if the value has been set. -func (o *AddedRequest) GetWasAlreadyPresentOk() (*bool, bool) { - if o == nil { - return nil, false - } - return &o.WasAlreadyPresent, true -} - -// SetWasAlreadyPresent sets field value -func (o *AddedRequest) SetWasAlreadyPresent(v bool) { - o.WasAlreadyPresent = v -} - -// GetWasAlreadyHandled returns the WasAlreadyHandled field value -func (o *AddedRequest) GetWasAlreadyHandled() bool { - if o == nil { - var ret bool - return ret - } - - return o.WasAlreadyHandled -} - -// GetWasAlreadyHandledOk returns a tuple with the WasAlreadyHandled field value -// and a boolean to check if the value has been set. -func (o *AddedRequest) GetWasAlreadyHandledOk() (*bool, bool) { - if o == nil { - return nil, false - } - return &o.WasAlreadyHandled, true -} - -// SetWasAlreadyHandled sets field value -func (o *AddedRequest) SetWasAlreadyHandled(v bool) { - o.WasAlreadyHandled = v -} - -func (o AddedRequest) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o AddedRequest) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["requestId"] = o.RequestId - toSerialize["uniqueKey"] = o.UniqueKey - toSerialize["wasAlreadyPresent"] = o.WasAlreadyPresent - toSerialize["wasAlreadyHandled"] = o.WasAlreadyHandled - return toSerialize, nil -} - -func (o *AddedRequest) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "requestId", - "uniqueKey", - "wasAlreadyPresent", - "wasAlreadyHandled", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err; - } - - for _, requiredProperty := range(requiredProperties) { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varAddedRequest := _AddedRequest{} - - decoder := json.NewDecoder(bytes.NewReader(data)) - decoder.DisallowUnknownFields() - err = decoder.Decode(&varAddedRequest) - - if err != nil { - return err - } - - *o = AddedRequest(varAddedRequest) - - return err -} - -type NullableAddedRequest struct { - value *AddedRequest - isSet bool -} - -func (v NullableAddedRequest) Get() *AddedRequest { - return v.value -} - -func (v *NullableAddedRequest) Set(val *AddedRequest) { - v.value = val - v.isSet = true -} - -func (v NullableAddedRequest) IsSet() bool { - return v.isSet -} - -func (v *NullableAddedRequest) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableAddedRequest(val *AddedRequest) *NullableAddedRequest { - return &NullableAddedRequest{value: val, isSet: true} -} - -func (v NullableAddedRequest) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableAddedRequest) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_batch_add_response.go b/model_batch_add_response.go deleted file mode 100644 index b54037f..0000000 --- a/model_batch_add_response.go +++ /dev/null @@ -1,158 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" - "bytes" - "fmt" -) - -// checks if the BatchAddResponse type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &BatchAddResponse{} - -// BatchAddResponse Response containing the result of a batch add operation. -type BatchAddResponse struct { - Data BatchAddResult `json:"data"` -} - -type _BatchAddResponse BatchAddResponse - -// NewBatchAddResponse instantiates a new BatchAddResponse object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewBatchAddResponse(data BatchAddResult) *BatchAddResponse { - this := BatchAddResponse{} - this.Data = data - return &this -} - -// NewBatchAddResponseWithDefaults instantiates a new BatchAddResponse object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewBatchAddResponseWithDefaults() *BatchAddResponse { - this := BatchAddResponse{} - return &this -} - -// GetData returns the Data field value -func (o *BatchAddResponse) GetData() BatchAddResult { - if o == nil { - var ret BatchAddResult - return ret - } - - return o.Data -} - -// GetDataOk returns a tuple with the Data field value -// and a boolean to check if the value has been set. -func (o *BatchAddResponse) GetDataOk() (*BatchAddResult, bool) { - if o == nil { - return nil, false - } - return &o.Data, true -} - -// SetData sets field value -func (o *BatchAddResponse) SetData(v BatchAddResult) { - o.Data = v -} - -func (o BatchAddResponse) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o BatchAddResponse) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["data"] = o.Data - return toSerialize, nil -} - -func (o *BatchAddResponse) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "data", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err; - } - - for _, requiredProperty := range(requiredProperties) { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varBatchAddResponse := _BatchAddResponse{} - - decoder := json.NewDecoder(bytes.NewReader(data)) - decoder.DisallowUnknownFields() - err = decoder.Decode(&varBatchAddResponse) - - if err != nil { - return err - } - - *o = BatchAddResponse(varBatchAddResponse) - - return err -} - -type NullableBatchAddResponse struct { - value *BatchAddResponse - isSet bool -} - -func (v NullableBatchAddResponse) Get() *BatchAddResponse { - return v.value -} - -func (v *NullableBatchAddResponse) Set(val *BatchAddResponse) { - v.value = val - v.isSet = true -} - -func (v NullableBatchAddResponse) IsSet() bool { - return v.isSet -} - -func (v *NullableBatchAddResponse) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableBatchAddResponse(val *BatchAddResponse) *NullableBatchAddResponse { - return &NullableBatchAddResponse{value: val, isSet: true} -} - -func (v NullableBatchAddResponse) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableBatchAddResponse) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_batch_add_result.go b/model_batch_add_result.go deleted file mode 100644 index f79335b..0000000 --- a/model_batch_add_result.go +++ /dev/null @@ -1,188 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" - "bytes" - "fmt" -) - -// checks if the BatchAddResult type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &BatchAddResult{} - -// BatchAddResult Result of a batch add operation containing successfully processed and failed requests. -type BatchAddResult struct { - // Requests that were successfully added to the request queue. - ProcessedRequests []AddedRequest `json:"processedRequests"` - // Requests that failed to be added and can be retried. - UnprocessedRequests []RequestDraft `json:"unprocessedRequests"` -} - -type _BatchAddResult BatchAddResult - -// NewBatchAddResult instantiates a new BatchAddResult object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewBatchAddResult(processedRequests []AddedRequest, unprocessedRequests []RequestDraft) *BatchAddResult { - this := BatchAddResult{} - this.ProcessedRequests = processedRequests - this.UnprocessedRequests = unprocessedRequests - return &this -} - -// NewBatchAddResultWithDefaults instantiates a new BatchAddResult object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewBatchAddResultWithDefaults() *BatchAddResult { - this := BatchAddResult{} - return &this -} - -// GetProcessedRequests returns the ProcessedRequests field value -func (o *BatchAddResult) GetProcessedRequests() []AddedRequest { - if o == nil { - var ret []AddedRequest - return ret - } - - return o.ProcessedRequests -} - -// GetProcessedRequestsOk returns a tuple with the ProcessedRequests field value -// and a boolean to check if the value has been set. -func (o *BatchAddResult) GetProcessedRequestsOk() ([]AddedRequest, bool) { - if o == nil { - return nil, false - } - return o.ProcessedRequests, true -} - -// SetProcessedRequests sets field value -func (o *BatchAddResult) SetProcessedRequests(v []AddedRequest) { - o.ProcessedRequests = v -} - -// GetUnprocessedRequests returns the UnprocessedRequests field value -func (o *BatchAddResult) GetUnprocessedRequests() []RequestDraft { - if o == nil { - var ret []RequestDraft - return ret - } - - return o.UnprocessedRequests -} - -// GetUnprocessedRequestsOk returns a tuple with the UnprocessedRequests field value -// and a boolean to check if the value has been set. -func (o *BatchAddResult) GetUnprocessedRequestsOk() ([]RequestDraft, bool) { - if o == nil { - return nil, false - } - return o.UnprocessedRequests, true -} - -// SetUnprocessedRequests sets field value -func (o *BatchAddResult) SetUnprocessedRequests(v []RequestDraft) { - o.UnprocessedRequests = v -} - -func (o BatchAddResult) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o BatchAddResult) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["processedRequests"] = o.ProcessedRequests - toSerialize["unprocessedRequests"] = o.UnprocessedRequests - return toSerialize, nil -} - -func (o *BatchAddResult) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "processedRequests", - "unprocessedRequests", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err; - } - - for _, requiredProperty := range(requiredProperties) { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varBatchAddResult := _BatchAddResult{} - - decoder := json.NewDecoder(bytes.NewReader(data)) - decoder.DisallowUnknownFields() - err = decoder.Decode(&varBatchAddResult) - - if err != nil { - return err - } - - *o = BatchAddResult(varBatchAddResult) - - return err -} - -type NullableBatchAddResult struct { - value *BatchAddResult - isSet bool -} - -func (v NullableBatchAddResult) Get() *BatchAddResult { - return v.value -} - -func (v *NullableBatchAddResult) Set(val *BatchAddResult) { - v.value = val - v.isSet = true -} - -func (v NullableBatchAddResult) IsSet() bool { - return v.isSet -} - -func (v *NullableBatchAddResult) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableBatchAddResult(val *BatchAddResult) *NullableBatchAddResult { - return &NullableBatchAddResult{value: val, isSet: true} -} - -func (v NullableBatchAddResult) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableBatchAddResult) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_batch_delete_response.go b/model_batch_delete_response.go deleted file mode 100644 index 568ee83..0000000 --- a/model_batch_delete_response.go +++ /dev/null @@ -1,158 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" - "bytes" - "fmt" -) - -// checks if the BatchDeleteResponse type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &BatchDeleteResponse{} - -// BatchDeleteResponse Response containing the result of a batch delete operation. -type BatchDeleteResponse struct { - Data BatchDeleteResult `json:"data"` -} - -type _BatchDeleteResponse BatchDeleteResponse - -// NewBatchDeleteResponse instantiates a new BatchDeleteResponse object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewBatchDeleteResponse(data BatchDeleteResult) *BatchDeleteResponse { - this := BatchDeleteResponse{} - this.Data = data - return &this -} - -// NewBatchDeleteResponseWithDefaults instantiates a new BatchDeleteResponse object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewBatchDeleteResponseWithDefaults() *BatchDeleteResponse { - this := BatchDeleteResponse{} - return &this -} - -// GetData returns the Data field value -func (o *BatchDeleteResponse) GetData() BatchDeleteResult { - if o == nil { - var ret BatchDeleteResult - return ret - } - - return o.Data -} - -// GetDataOk returns a tuple with the Data field value -// and a boolean to check if the value has been set. -func (o *BatchDeleteResponse) GetDataOk() (*BatchDeleteResult, bool) { - if o == nil { - return nil, false - } - return &o.Data, true -} - -// SetData sets field value -func (o *BatchDeleteResponse) SetData(v BatchDeleteResult) { - o.Data = v -} - -func (o BatchDeleteResponse) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o BatchDeleteResponse) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["data"] = o.Data - return toSerialize, nil -} - -func (o *BatchDeleteResponse) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "data", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err; - } - - for _, requiredProperty := range(requiredProperties) { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varBatchDeleteResponse := _BatchDeleteResponse{} - - decoder := json.NewDecoder(bytes.NewReader(data)) - decoder.DisallowUnknownFields() - err = decoder.Decode(&varBatchDeleteResponse) - - if err != nil { - return err - } - - *o = BatchDeleteResponse(varBatchDeleteResponse) - - return err -} - -type NullableBatchDeleteResponse struct { - value *BatchDeleteResponse - isSet bool -} - -func (v NullableBatchDeleteResponse) Get() *BatchDeleteResponse { - return v.value -} - -func (v *NullableBatchDeleteResponse) Set(val *BatchDeleteResponse) { - v.value = val - v.isSet = true -} - -func (v NullableBatchDeleteResponse) IsSet() bool { - return v.isSet -} - -func (v *NullableBatchDeleteResponse) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableBatchDeleteResponse(val *BatchDeleteResponse) *NullableBatchDeleteResponse { - return &NullableBatchDeleteResponse{value: val, isSet: true} -} - -func (v NullableBatchDeleteResponse) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableBatchDeleteResponse) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_batch_delete_result.go b/model_batch_delete_result.go deleted file mode 100644 index dbcb7e8..0000000 --- a/model_batch_delete_result.go +++ /dev/null @@ -1,188 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" - "bytes" - "fmt" -) - -// checks if the BatchDeleteResult type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &BatchDeleteResult{} - -// BatchDeleteResult Result of a batch delete operation containing successfully deleted and failed requests. -type BatchDeleteResult struct { - // Requests that were successfully deleted from the request queue. - ProcessedRequests []DeletedRequest `json:"processedRequests"` - // Requests that failed to be deleted and can be retried. - UnprocessedRequests []RequestDraft `json:"unprocessedRequests"` -} - -type _BatchDeleteResult BatchDeleteResult - -// NewBatchDeleteResult instantiates a new BatchDeleteResult object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewBatchDeleteResult(processedRequests []DeletedRequest, unprocessedRequests []RequestDraft) *BatchDeleteResult { - this := BatchDeleteResult{} - this.ProcessedRequests = processedRequests - this.UnprocessedRequests = unprocessedRequests - return &this -} - -// NewBatchDeleteResultWithDefaults instantiates a new BatchDeleteResult object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewBatchDeleteResultWithDefaults() *BatchDeleteResult { - this := BatchDeleteResult{} - return &this -} - -// GetProcessedRequests returns the ProcessedRequests field value -func (o *BatchDeleteResult) GetProcessedRequests() []DeletedRequest { - if o == nil { - var ret []DeletedRequest - return ret - } - - return o.ProcessedRequests -} - -// GetProcessedRequestsOk returns a tuple with the ProcessedRequests field value -// and a boolean to check if the value has been set. -func (o *BatchDeleteResult) GetProcessedRequestsOk() ([]DeletedRequest, bool) { - if o == nil { - return nil, false - } - return o.ProcessedRequests, true -} - -// SetProcessedRequests sets field value -func (o *BatchDeleteResult) SetProcessedRequests(v []DeletedRequest) { - o.ProcessedRequests = v -} - -// GetUnprocessedRequests returns the UnprocessedRequests field value -func (o *BatchDeleteResult) GetUnprocessedRequests() []RequestDraft { - if o == nil { - var ret []RequestDraft - return ret - } - - return o.UnprocessedRequests -} - -// GetUnprocessedRequestsOk returns a tuple with the UnprocessedRequests field value -// and a boolean to check if the value has been set. -func (o *BatchDeleteResult) GetUnprocessedRequestsOk() ([]RequestDraft, bool) { - if o == nil { - return nil, false - } - return o.UnprocessedRequests, true -} - -// SetUnprocessedRequests sets field value -func (o *BatchDeleteResult) SetUnprocessedRequests(v []RequestDraft) { - o.UnprocessedRequests = v -} - -func (o BatchDeleteResult) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o BatchDeleteResult) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["processedRequests"] = o.ProcessedRequests - toSerialize["unprocessedRequests"] = o.UnprocessedRequests - return toSerialize, nil -} - -func (o *BatchDeleteResult) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "processedRequests", - "unprocessedRequests", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err; - } - - for _, requiredProperty := range(requiredProperties) { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varBatchDeleteResult := _BatchDeleteResult{} - - decoder := json.NewDecoder(bytes.NewReader(data)) - decoder.DisallowUnknownFields() - err = decoder.Decode(&varBatchDeleteResult) - - if err != nil { - return err - } - - *o = BatchDeleteResult(varBatchDeleteResult) - - return err -} - -type NullableBatchDeleteResult struct { - value *BatchDeleteResult - isSet bool -} - -func (v NullableBatchDeleteResult) Get() *BatchDeleteResult { - return v.value -} - -func (v *NullableBatchDeleteResult) Set(val *BatchDeleteResult) { - v.value = val - v.isSet = true -} - -func (v NullableBatchDeleteResult) IsSet() bool { - return v.isSet -} - -func (v *NullableBatchDeleteResult) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableBatchDeleteResult(val *BatchDeleteResult) *NullableBatchDeleteResult { - return &NullableBatchDeleteResult{value: val, isSet: true} -} - -func (v NullableBatchDeleteResult) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableBatchDeleteResult) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_browser_info_response.go b/model_browser_info_response.go deleted file mode 100644 index 77623c1..0000000 --- a/model_browser_info_response.go +++ /dev/null @@ -1,324 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" - "bytes" - "fmt" -) - -// checks if the BrowserInfoResponse type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &BrowserInfoResponse{} - -// BrowserInfoResponse struct for BrowserInfoResponse -type BrowserInfoResponse struct { - // HTTP method of the request. - Method string `json:"method"` - // IP address of the client. - ClientIp NullableString `json:"clientIp"` - // Two-letter country code resolved from the client IP address. - CountryCode NullableString `json:"countryCode"` - // Length of the request body in bytes. - BodyLength int32 `json:"bodyLength"` - // Request headers. Omitted when `skipHeaders=true`. - Headers map[string]BrowserInfoResponseHeadersValue `json:"headers,omitempty"` - // Raw request headers as a flat list of alternating name/value strings. Included only when `rawHeaders=true`. - RawHeaders []string `json:"rawHeaders,omitempty"` -} - -type _BrowserInfoResponse BrowserInfoResponse - -// NewBrowserInfoResponse instantiates a new BrowserInfoResponse object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewBrowserInfoResponse(method string, clientIp NullableString, countryCode NullableString, bodyLength int32) *BrowserInfoResponse { - this := BrowserInfoResponse{} - this.Method = method - this.ClientIp = clientIp - this.CountryCode = countryCode - this.BodyLength = bodyLength - return &this -} - -// NewBrowserInfoResponseWithDefaults instantiates a new BrowserInfoResponse object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewBrowserInfoResponseWithDefaults() *BrowserInfoResponse { - this := BrowserInfoResponse{} - return &this -} - -// GetMethod returns the Method field value -func (o *BrowserInfoResponse) GetMethod() string { - if o == nil { - var ret string - return ret - } - - return o.Method -} - -// GetMethodOk returns a tuple with the Method field value -// and a boolean to check if the value has been set. -func (o *BrowserInfoResponse) GetMethodOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Method, true -} - -// SetMethod sets field value -func (o *BrowserInfoResponse) SetMethod(v string) { - o.Method = v -} - -// GetClientIp returns the ClientIp field value -// If the value is explicit nil, the zero value for string will be returned -func (o *BrowserInfoResponse) GetClientIp() string { - if o == nil || o.ClientIp.Get() == nil { - var ret string - return ret - } - - return *o.ClientIp.Get() -} - -// GetClientIpOk returns a tuple with the ClientIp field value -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *BrowserInfoResponse) GetClientIpOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.ClientIp.Get(), o.ClientIp.IsSet() -} - -// SetClientIp sets field value -func (o *BrowserInfoResponse) SetClientIp(v string) { - o.ClientIp.Set(&v) -} - -// GetCountryCode returns the CountryCode field value -// If the value is explicit nil, the zero value for string will be returned -func (o *BrowserInfoResponse) GetCountryCode() string { - if o == nil || o.CountryCode.Get() == nil { - var ret string - return ret - } - - return *o.CountryCode.Get() -} - -// GetCountryCodeOk returns a tuple with the CountryCode field value -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *BrowserInfoResponse) GetCountryCodeOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.CountryCode.Get(), o.CountryCode.IsSet() -} - -// SetCountryCode sets field value -func (o *BrowserInfoResponse) SetCountryCode(v string) { - o.CountryCode.Set(&v) -} - -// GetBodyLength returns the BodyLength field value -func (o *BrowserInfoResponse) GetBodyLength() int32 { - if o == nil { - var ret int32 - return ret - } - - return o.BodyLength -} - -// GetBodyLengthOk returns a tuple with the BodyLength field value -// and a boolean to check if the value has been set. -func (o *BrowserInfoResponse) GetBodyLengthOk() (*int32, bool) { - if o == nil { - return nil, false - } - return &o.BodyLength, true -} - -// SetBodyLength sets field value -func (o *BrowserInfoResponse) SetBodyLength(v int32) { - o.BodyLength = v -} - -// GetHeaders returns the Headers field value if set, zero value otherwise. -func (o *BrowserInfoResponse) GetHeaders() map[string]BrowserInfoResponseHeadersValue { - if o == nil || IsNil(o.Headers) { - var ret map[string]BrowserInfoResponseHeadersValue - return ret - } - return o.Headers -} - -// GetHeadersOk returns a tuple with the Headers field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *BrowserInfoResponse) GetHeadersOk() (map[string]BrowserInfoResponseHeadersValue, bool) { - if o == nil || IsNil(o.Headers) { - return map[string]BrowserInfoResponseHeadersValue{}, false - } - return o.Headers, true -} - -// HasHeaders returns a boolean if a field has been set. -func (o *BrowserInfoResponse) HasHeaders() bool { - if o != nil && !IsNil(o.Headers) { - return true - } - - return false -} - -// SetHeaders gets a reference to the given map[string]BrowserInfoResponseHeadersValue and assigns it to the Headers field. -func (o *BrowserInfoResponse) SetHeaders(v map[string]BrowserInfoResponseHeadersValue) { - o.Headers = v -} - -// GetRawHeaders returns the RawHeaders field value if set, zero value otherwise. -func (o *BrowserInfoResponse) GetRawHeaders() []string { - if o == nil || IsNil(o.RawHeaders) { - var ret []string - return ret - } - return o.RawHeaders -} - -// GetRawHeadersOk returns a tuple with the RawHeaders field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *BrowserInfoResponse) GetRawHeadersOk() ([]string, bool) { - if o == nil || IsNil(o.RawHeaders) { - return nil, false - } - return o.RawHeaders, true -} - -// HasRawHeaders returns a boolean if a field has been set. -func (o *BrowserInfoResponse) HasRawHeaders() bool { - if o != nil && !IsNil(o.RawHeaders) { - return true - } - - return false -} - -// SetRawHeaders gets a reference to the given []string and assigns it to the RawHeaders field. -func (o *BrowserInfoResponse) SetRawHeaders(v []string) { - o.RawHeaders = v -} - -func (o BrowserInfoResponse) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o BrowserInfoResponse) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["method"] = o.Method - toSerialize["clientIp"] = o.ClientIp.Get() - toSerialize["countryCode"] = o.CountryCode.Get() - toSerialize["bodyLength"] = o.BodyLength - if !IsNil(o.Headers) { - toSerialize["headers"] = o.Headers - } - if !IsNil(o.RawHeaders) { - toSerialize["rawHeaders"] = o.RawHeaders - } - return toSerialize, nil -} - -func (o *BrowserInfoResponse) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "method", - "clientIp", - "countryCode", - "bodyLength", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err; - } - - for _, requiredProperty := range(requiredProperties) { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varBrowserInfoResponse := _BrowserInfoResponse{} - - decoder := json.NewDecoder(bytes.NewReader(data)) - decoder.DisallowUnknownFields() - err = decoder.Decode(&varBrowserInfoResponse) - - if err != nil { - return err - } - - *o = BrowserInfoResponse(varBrowserInfoResponse) - - return err -} - -type NullableBrowserInfoResponse struct { - value *BrowserInfoResponse - isSet bool -} - -func (v NullableBrowserInfoResponse) Get() *BrowserInfoResponse { - return v.value -} - -func (v *NullableBrowserInfoResponse) Set(val *BrowserInfoResponse) { - v.value = val - v.isSet = true -} - -func (v NullableBrowserInfoResponse) IsSet() bool { - return v.isSet -} - -func (v *NullableBrowserInfoResponse) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableBrowserInfoResponse(val *BrowserInfoResponse) *NullableBrowserInfoResponse { - return &NullableBrowserInfoResponse{value: val, isSet: true} -} - -func (v NullableBrowserInfoResponse) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableBrowserInfoResponse) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_browser_info_response_headers_value.go b/model_browser_info_response_headers_value.go deleted file mode 100644 index 62266dc..0000000 --- a/model_browser_info_response_headers_value.go +++ /dev/null @@ -1,171 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" - "fmt" - "gopkg.in/validator.v2" -) - -// BrowserInfoResponseHeadersValue - struct for BrowserInfoResponseHeadersValue -type BrowserInfoResponseHeadersValue struct { - ArrayOfString *[]string - String *string -} - -// []stringAsBrowserInfoResponseHeadersValue is a convenience function that returns []string wrapped in BrowserInfoResponseHeadersValue -func ArrayOfStringAsBrowserInfoResponseHeadersValue(v *[]string) BrowserInfoResponseHeadersValue { - return BrowserInfoResponseHeadersValue{ - ArrayOfString: v, - } -} - -// stringAsBrowserInfoResponseHeadersValue is a convenience function that returns string wrapped in BrowserInfoResponseHeadersValue -func StringAsBrowserInfoResponseHeadersValue(v *string) BrowserInfoResponseHeadersValue { - return BrowserInfoResponseHeadersValue{ - String: v, - } -} - - -// Unmarshal JSON data into one of the pointers in the struct -func (dst *BrowserInfoResponseHeadersValue) UnmarshalJSON(data []byte) error { - var err error - match := 0 - // try to unmarshal data into ArrayOfString - err = newStrictDecoder(data).Decode(&dst.ArrayOfString) - if err == nil { - jsonArrayOfString, _ := json.Marshal(dst.ArrayOfString) - if string(jsonArrayOfString) == "{}" { // empty struct - dst.ArrayOfString = nil - } else { - if err = validator.Validate(dst.ArrayOfString); err != nil { - dst.ArrayOfString = nil - } else { - match++ - } - } - } else { - dst.ArrayOfString = nil - } - - // try to unmarshal data into String - err = newStrictDecoder(data).Decode(&dst.String) - if err == nil { - jsonString, _ := json.Marshal(dst.String) - if string(jsonString) == "{}" { // empty struct - dst.String = nil - } else { - if err = validator.Validate(dst.String); err != nil { - dst.String = nil - } else { - match++ - } - } - } else { - dst.String = nil - } - - if match > 1 { // more than 1 match - // reset to nil - dst.ArrayOfString = nil - dst.String = nil - - return fmt.Errorf("data matches more than one schema in oneOf(BrowserInfoResponseHeadersValue)") - } else if match == 1 { - return nil // exactly one match - } else { // no match - return fmt.Errorf("data failed to match schemas in oneOf(BrowserInfoResponseHeadersValue)") - } -} - -// Marshal data from the first non-nil pointers in the struct to JSON -func (src BrowserInfoResponseHeadersValue) MarshalJSON() ([]byte, error) { - if src.ArrayOfString != nil { - return json.Marshal(&src.ArrayOfString) - } - - if src.String != nil { - return json.Marshal(&src.String) - } - - return nil, nil // no data in oneOf schemas -} - -// Get the actual instance -func (obj *BrowserInfoResponseHeadersValue) GetActualInstance() (interface{}) { - if obj == nil { - return nil - } - if obj.ArrayOfString != nil { - return obj.ArrayOfString - } - - if obj.String != nil { - return obj.String - } - - // all schemas are nil - return nil -} - -// Get the actual instance value -func (obj BrowserInfoResponseHeadersValue) GetActualInstanceValue() (interface{}) { - if obj.ArrayOfString != nil { - return *obj.ArrayOfString - } - - if obj.String != nil { - return *obj.String - } - - // all schemas are nil - return nil -} - -type NullableBrowserInfoResponseHeadersValue struct { - value *BrowserInfoResponseHeadersValue - isSet bool -} - -func (v NullableBrowserInfoResponseHeadersValue) Get() *BrowserInfoResponseHeadersValue { - return v.value -} - -func (v *NullableBrowserInfoResponseHeadersValue) Set(val *BrowserInfoResponseHeadersValue) { - v.value = val - v.isSet = true -} - -func (v NullableBrowserInfoResponseHeadersValue) IsSet() bool { - return v.isSet -} - -func (v *NullableBrowserInfoResponseHeadersValue) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableBrowserInfoResponseHeadersValue(val *BrowserInfoResponseHeadersValue) *NullableBrowserInfoResponseHeadersValue { - return &NullableBrowserInfoResponseHeadersValue{value: val, isSet: true} -} - -func (v NullableBrowserInfoResponseHeadersValue) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableBrowserInfoResponseHeadersValue) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_build.go b/model_build.go deleted file mode 100644 index 2dcead5..0000000 --- a/model_build.go +++ /dev/null @@ -1,787 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" - "time" - "bytes" - "fmt" -) - -// checks if the Build type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &Build{} - -// Build struct for Build -type Build struct { - Id string `json:"id"` - ActId string `json:"actId"` - UserId string `json:"userId"` - StartedAt time.Time `json:"startedAt"` - FinishedAt NullableTime `json:"finishedAt,omitempty"` - Status ActorJobStatus `json:"status"` - Meta BuildsMeta `json:"meta"` - Stats NullableBuildStats `json:"stats,omitempty"` - Options NullableBuildOptions `json:"options,omitempty"` - Usage NullableBuildUsage `json:"usage,omitempty"` - // Total cost in USD for this build. Requires authentication token to access. - UsageTotalUsd NullableFloat32 `json:"usageTotalUsd,omitempty"` - // Platform usage costs breakdown in USD for this build. Requires authentication token to access. - UsageUsd NullableBuildUsage `json:"usageUsd,omitempty"` - // Deprecated - InputSchema NullableString `json:"inputSchema,omitempty"` - // Deprecated - Readme NullableString `json:"readme,omitempty"` - BuildNumber string `json:"buildNumber" validate:"regexp=^([0-9]|[1-9][0-9])\\\\.([0-9]|[1-9][0-9])(\\\\.[1-9][0-9]{0,4})$"` - ActVersion *BuildActVersion `json:"actVersion,omitempty"` - ActorDefinition NullableActorDefinition `json:"actorDefinition,omitempty"` -} - -type _Build Build - -// NewBuild instantiates a new Build object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewBuild(id string, actId string, userId string, startedAt time.Time, status ActorJobStatus, meta BuildsMeta, buildNumber string) *Build { - this := Build{} - this.Id = id - this.ActId = actId - this.UserId = userId - this.StartedAt = startedAt - this.Status = status - this.Meta = meta - this.BuildNumber = buildNumber - return &this -} - -// NewBuildWithDefaults instantiates a new Build object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewBuildWithDefaults() *Build { - this := Build{} - return &this -} - -// GetId returns the Id field value -func (o *Build) GetId() string { - if o == nil { - var ret string - return ret - } - - return o.Id -} - -// GetIdOk returns a tuple with the Id field value -// and a boolean to check if the value has been set. -func (o *Build) GetIdOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Id, true -} - -// SetId sets field value -func (o *Build) SetId(v string) { - o.Id = v -} - -// GetActId returns the ActId field value -func (o *Build) GetActId() string { - if o == nil { - var ret string - return ret - } - - return o.ActId -} - -// GetActIdOk returns a tuple with the ActId field value -// and a boolean to check if the value has been set. -func (o *Build) GetActIdOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.ActId, true -} - -// SetActId sets field value -func (o *Build) SetActId(v string) { - o.ActId = v -} - -// GetUserId returns the UserId field value -func (o *Build) GetUserId() string { - if o == nil { - var ret string - return ret - } - - return o.UserId -} - -// GetUserIdOk returns a tuple with the UserId field value -// and a boolean to check if the value has been set. -func (o *Build) GetUserIdOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.UserId, true -} - -// SetUserId sets field value -func (o *Build) SetUserId(v string) { - o.UserId = v -} - -// GetStartedAt returns the StartedAt field value -func (o *Build) GetStartedAt() time.Time { - if o == nil { - var ret time.Time - return ret - } - - return o.StartedAt -} - -// GetStartedAtOk returns a tuple with the StartedAt field value -// and a boolean to check if the value has been set. -func (o *Build) GetStartedAtOk() (*time.Time, bool) { - if o == nil { - return nil, false - } - return &o.StartedAt, true -} - -// SetStartedAt sets field value -func (o *Build) SetStartedAt(v time.Time) { - o.StartedAt = v -} - -// GetFinishedAt returns the FinishedAt field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *Build) GetFinishedAt() time.Time { - if o == nil || IsNil(o.FinishedAt.Get()) { - var ret time.Time - return ret - } - return *o.FinishedAt.Get() -} - -// GetFinishedAtOk returns a tuple with the FinishedAt field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *Build) GetFinishedAtOk() (*time.Time, bool) { - if o == nil { - return nil, false - } - return o.FinishedAt.Get(), o.FinishedAt.IsSet() -} - -// HasFinishedAt returns a boolean if a field has been set. -func (o *Build) HasFinishedAt() bool { - if o != nil && o.FinishedAt.IsSet() { - return true - } - - return false -} - -// SetFinishedAt gets a reference to the given NullableTime and assigns it to the FinishedAt field. -func (o *Build) SetFinishedAt(v time.Time) { - o.FinishedAt.Set(&v) -} -// SetFinishedAtNil sets the value for FinishedAt to be an explicit nil -func (o *Build) SetFinishedAtNil() { - o.FinishedAt.Set(nil) -} - -// UnsetFinishedAt ensures that no value is present for FinishedAt, not even an explicit nil -func (o *Build) UnsetFinishedAt() { - o.FinishedAt.Unset() -} - -// GetStatus returns the Status field value -func (o *Build) GetStatus() ActorJobStatus { - if o == nil { - var ret ActorJobStatus - return ret - } - - return o.Status -} - -// GetStatusOk returns a tuple with the Status field value -// and a boolean to check if the value has been set. -func (o *Build) GetStatusOk() (*ActorJobStatus, bool) { - if o == nil { - return nil, false - } - return &o.Status, true -} - -// SetStatus sets field value -func (o *Build) SetStatus(v ActorJobStatus) { - o.Status = v -} - -// GetMeta returns the Meta field value -func (o *Build) GetMeta() BuildsMeta { - if o == nil { - var ret BuildsMeta - return ret - } - - return o.Meta -} - -// GetMetaOk returns a tuple with the Meta field value -// and a boolean to check if the value has been set. -func (o *Build) GetMetaOk() (*BuildsMeta, bool) { - if o == nil { - return nil, false - } - return &o.Meta, true -} - -// SetMeta sets field value -func (o *Build) SetMeta(v BuildsMeta) { - o.Meta = v -} - -// GetStats returns the Stats field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *Build) GetStats() BuildStats { - if o == nil || IsNil(o.Stats.Get()) { - var ret BuildStats - return ret - } - return *o.Stats.Get() -} - -// GetStatsOk returns a tuple with the Stats field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *Build) GetStatsOk() (*BuildStats, bool) { - if o == nil { - return nil, false - } - return o.Stats.Get(), o.Stats.IsSet() -} - -// HasStats returns a boolean if a field has been set. -func (o *Build) HasStats() bool { - if o != nil && o.Stats.IsSet() { - return true - } - - return false -} - -// SetStats gets a reference to the given NullableBuildStats and assigns it to the Stats field. -func (o *Build) SetStats(v BuildStats) { - o.Stats.Set(&v) -} -// SetStatsNil sets the value for Stats to be an explicit nil -func (o *Build) SetStatsNil() { - o.Stats.Set(nil) -} - -// UnsetStats ensures that no value is present for Stats, not even an explicit nil -func (o *Build) UnsetStats() { - o.Stats.Unset() -} - -// GetOptions returns the Options field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *Build) GetOptions() BuildOptions { - if o == nil || IsNil(o.Options.Get()) { - var ret BuildOptions - return ret - } - return *o.Options.Get() -} - -// GetOptionsOk returns a tuple with the Options field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *Build) GetOptionsOk() (*BuildOptions, bool) { - if o == nil { - return nil, false - } - return o.Options.Get(), o.Options.IsSet() -} - -// HasOptions returns a boolean if a field has been set. -func (o *Build) HasOptions() bool { - if o != nil && o.Options.IsSet() { - return true - } - - return false -} - -// SetOptions gets a reference to the given NullableBuildOptions and assigns it to the Options field. -func (o *Build) SetOptions(v BuildOptions) { - o.Options.Set(&v) -} -// SetOptionsNil sets the value for Options to be an explicit nil -func (o *Build) SetOptionsNil() { - o.Options.Set(nil) -} - -// UnsetOptions ensures that no value is present for Options, not even an explicit nil -func (o *Build) UnsetOptions() { - o.Options.Unset() -} - -// GetUsage returns the Usage field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *Build) GetUsage() BuildUsage { - if o == nil || IsNil(o.Usage.Get()) { - var ret BuildUsage - return ret - } - return *o.Usage.Get() -} - -// GetUsageOk returns a tuple with the Usage field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *Build) GetUsageOk() (*BuildUsage, bool) { - if o == nil { - return nil, false - } - return o.Usage.Get(), o.Usage.IsSet() -} - -// HasUsage returns a boolean if a field has been set. -func (o *Build) HasUsage() bool { - if o != nil && o.Usage.IsSet() { - return true - } - - return false -} - -// SetUsage gets a reference to the given NullableBuildUsage and assigns it to the Usage field. -func (o *Build) SetUsage(v BuildUsage) { - o.Usage.Set(&v) -} -// SetUsageNil sets the value for Usage to be an explicit nil -func (o *Build) SetUsageNil() { - o.Usage.Set(nil) -} - -// UnsetUsage ensures that no value is present for Usage, not even an explicit nil -func (o *Build) UnsetUsage() { - o.Usage.Unset() -} - -// GetUsageTotalUsd returns the UsageTotalUsd field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *Build) GetUsageTotalUsd() float32 { - if o == nil || IsNil(o.UsageTotalUsd.Get()) { - var ret float32 - return ret - } - return *o.UsageTotalUsd.Get() -} - -// GetUsageTotalUsdOk returns a tuple with the UsageTotalUsd field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *Build) GetUsageTotalUsdOk() (*float32, bool) { - if o == nil { - return nil, false - } - return o.UsageTotalUsd.Get(), o.UsageTotalUsd.IsSet() -} - -// HasUsageTotalUsd returns a boolean if a field has been set. -func (o *Build) HasUsageTotalUsd() bool { - if o != nil && o.UsageTotalUsd.IsSet() { - return true - } - - return false -} - -// SetUsageTotalUsd gets a reference to the given NullableFloat32 and assigns it to the UsageTotalUsd field. -func (o *Build) SetUsageTotalUsd(v float32) { - o.UsageTotalUsd.Set(&v) -} -// SetUsageTotalUsdNil sets the value for UsageTotalUsd to be an explicit nil -func (o *Build) SetUsageTotalUsdNil() { - o.UsageTotalUsd.Set(nil) -} - -// UnsetUsageTotalUsd ensures that no value is present for UsageTotalUsd, not even an explicit nil -func (o *Build) UnsetUsageTotalUsd() { - o.UsageTotalUsd.Unset() -} - -// GetUsageUsd returns the UsageUsd field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *Build) GetUsageUsd() BuildUsage { - if o == nil || IsNil(o.UsageUsd.Get()) { - var ret BuildUsage - return ret - } - return *o.UsageUsd.Get() -} - -// GetUsageUsdOk returns a tuple with the UsageUsd field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *Build) GetUsageUsdOk() (*BuildUsage, bool) { - if o == nil { - return nil, false - } - return o.UsageUsd.Get(), o.UsageUsd.IsSet() -} - -// HasUsageUsd returns a boolean if a field has been set. -func (o *Build) HasUsageUsd() bool { - if o != nil && o.UsageUsd.IsSet() { - return true - } - - return false -} - -// SetUsageUsd gets a reference to the given NullableBuildUsage and assigns it to the UsageUsd field. -func (o *Build) SetUsageUsd(v BuildUsage) { - o.UsageUsd.Set(&v) -} -// SetUsageUsdNil sets the value for UsageUsd to be an explicit nil -func (o *Build) SetUsageUsdNil() { - o.UsageUsd.Set(nil) -} - -// UnsetUsageUsd ensures that no value is present for UsageUsd, not even an explicit nil -func (o *Build) UnsetUsageUsd() { - o.UsageUsd.Unset() -} - -// GetInputSchema returns the InputSchema field value if set, zero value otherwise (both if not set or set to explicit null). -// Deprecated -func (o *Build) GetInputSchema() string { - if o == nil || IsNil(o.InputSchema.Get()) { - var ret string - return ret - } - return *o.InputSchema.Get() -} - -// GetInputSchemaOk returns a tuple with the InputSchema field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -// Deprecated -func (o *Build) GetInputSchemaOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.InputSchema.Get(), o.InputSchema.IsSet() -} - -// HasInputSchema returns a boolean if a field has been set. -func (o *Build) HasInputSchema() bool { - if o != nil && o.InputSchema.IsSet() { - return true - } - - return false -} - -// SetInputSchema gets a reference to the given NullableString and assigns it to the InputSchema field. -// Deprecated -func (o *Build) SetInputSchema(v string) { - o.InputSchema.Set(&v) -} -// SetInputSchemaNil sets the value for InputSchema to be an explicit nil -func (o *Build) SetInputSchemaNil() { - o.InputSchema.Set(nil) -} - -// UnsetInputSchema ensures that no value is present for InputSchema, not even an explicit nil -func (o *Build) UnsetInputSchema() { - o.InputSchema.Unset() -} - -// GetReadme returns the Readme field value if set, zero value otherwise (both if not set or set to explicit null). -// Deprecated -func (o *Build) GetReadme() string { - if o == nil || IsNil(o.Readme.Get()) { - var ret string - return ret - } - return *o.Readme.Get() -} - -// GetReadmeOk returns a tuple with the Readme field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -// Deprecated -func (o *Build) GetReadmeOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.Readme.Get(), o.Readme.IsSet() -} - -// HasReadme returns a boolean if a field has been set. -func (o *Build) HasReadme() bool { - if o != nil && o.Readme.IsSet() { - return true - } - - return false -} - -// SetReadme gets a reference to the given NullableString and assigns it to the Readme field. -// Deprecated -func (o *Build) SetReadme(v string) { - o.Readme.Set(&v) -} -// SetReadmeNil sets the value for Readme to be an explicit nil -func (o *Build) SetReadmeNil() { - o.Readme.Set(nil) -} - -// UnsetReadme ensures that no value is present for Readme, not even an explicit nil -func (o *Build) UnsetReadme() { - o.Readme.Unset() -} - -// GetBuildNumber returns the BuildNumber field value -func (o *Build) GetBuildNumber() string { - if o == nil { - var ret string - return ret - } - - return o.BuildNumber -} - -// GetBuildNumberOk returns a tuple with the BuildNumber field value -// and a boolean to check if the value has been set. -func (o *Build) GetBuildNumberOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.BuildNumber, true -} - -// SetBuildNumber sets field value -func (o *Build) SetBuildNumber(v string) { - o.BuildNumber = v -} - -// GetActVersion returns the ActVersion field value if set, zero value otherwise. -func (o *Build) GetActVersion() BuildActVersion { - if o == nil || IsNil(o.ActVersion) { - var ret BuildActVersion - return ret - } - return *o.ActVersion -} - -// GetActVersionOk returns a tuple with the ActVersion field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Build) GetActVersionOk() (*BuildActVersion, bool) { - if o == nil || IsNil(o.ActVersion) { - return nil, false - } - return o.ActVersion, true -} - -// HasActVersion returns a boolean if a field has been set. -func (o *Build) HasActVersion() bool { - if o != nil && !IsNil(o.ActVersion) { - return true - } - - return false -} - -// SetActVersion gets a reference to the given BuildActVersion and assigns it to the ActVersion field. -func (o *Build) SetActVersion(v BuildActVersion) { - o.ActVersion = &v -} - -// GetActorDefinition returns the ActorDefinition field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *Build) GetActorDefinition() ActorDefinition { - if o == nil || IsNil(o.ActorDefinition.Get()) { - var ret ActorDefinition - return ret - } - return *o.ActorDefinition.Get() -} - -// GetActorDefinitionOk returns a tuple with the ActorDefinition field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *Build) GetActorDefinitionOk() (*ActorDefinition, bool) { - if o == nil { - return nil, false - } - return o.ActorDefinition.Get(), o.ActorDefinition.IsSet() -} - -// HasActorDefinition returns a boolean if a field has been set. -func (o *Build) HasActorDefinition() bool { - if o != nil && o.ActorDefinition.IsSet() { - return true - } - - return false -} - -// SetActorDefinition gets a reference to the given NullableActorDefinition and assigns it to the ActorDefinition field. -func (o *Build) SetActorDefinition(v ActorDefinition) { - o.ActorDefinition.Set(&v) -} -// SetActorDefinitionNil sets the value for ActorDefinition to be an explicit nil -func (o *Build) SetActorDefinitionNil() { - o.ActorDefinition.Set(nil) -} - -// UnsetActorDefinition ensures that no value is present for ActorDefinition, not even an explicit nil -func (o *Build) UnsetActorDefinition() { - o.ActorDefinition.Unset() -} - -func (o Build) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o Build) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["id"] = o.Id - toSerialize["actId"] = o.ActId - toSerialize["userId"] = o.UserId - toSerialize["startedAt"] = o.StartedAt - if o.FinishedAt.IsSet() { - toSerialize["finishedAt"] = o.FinishedAt.Get() - } - toSerialize["status"] = o.Status - toSerialize["meta"] = o.Meta - if o.Stats.IsSet() { - toSerialize["stats"] = o.Stats.Get() - } - if o.Options.IsSet() { - toSerialize["options"] = o.Options.Get() - } - if o.Usage.IsSet() { - toSerialize["usage"] = o.Usage.Get() - } - if o.UsageTotalUsd.IsSet() { - toSerialize["usageTotalUsd"] = o.UsageTotalUsd.Get() - } - if o.UsageUsd.IsSet() { - toSerialize["usageUsd"] = o.UsageUsd.Get() - } - if o.InputSchema.IsSet() { - toSerialize["inputSchema"] = o.InputSchema.Get() - } - if o.Readme.IsSet() { - toSerialize["readme"] = o.Readme.Get() - } - toSerialize["buildNumber"] = o.BuildNumber - if !IsNil(o.ActVersion) { - toSerialize["actVersion"] = o.ActVersion - } - if o.ActorDefinition.IsSet() { - toSerialize["actorDefinition"] = o.ActorDefinition.Get() - } - return toSerialize, nil -} - -func (o *Build) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "id", - "actId", - "userId", - "startedAt", - "status", - "meta", - "buildNumber", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err; - } - - for _, requiredProperty := range(requiredProperties) { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varBuild := _Build{} - - decoder := json.NewDecoder(bytes.NewReader(data)) - decoder.DisallowUnknownFields() - err = decoder.Decode(&varBuild) - - if err != nil { - return err - } - - *o = Build(varBuild) - - return err -} - -type NullableBuild struct { - value *Build - isSet bool -} - -func (v NullableBuild) Get() *Build { - return v.value -} - -func (v *NullableBuild) Set(val *Build) { - v.value = val - v.isSet = true -} - -func (v NullableBuild) IsSet() bool { - return v.isSet -} - -func (v *NullableBuild) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableBuild(val *Build) *NullableBuild { - return &NullableBuild{value: val, isSet: true} -} - -func (v NullableBuild) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableBuild) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_build_act_version.go b/model_build_act_version.go deleted file mode 100644 index 53e84a2..0000000 --- a/model_build_act_version.go +++ /dev/null @@ -1,272 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" -) - -// checks if the BuildActVersion type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &BuildActVersion{} - -// BuildActVersion Snapshot of the Actor version that this build was created from. -type BuildActVersion struct { - SourceType *VersionSourceType `json:"sourceType,omitempty"` - BuildTag *string `json:"buildTag,omitempty"` - VersionNumber *string `json:"versionNumber,omitempty" validate:"regexp=^([0-9]|[1-9][0-9])\\\\.([0-9]|[1-9][0-9])$"` - // URL of the git repository, present when sourceType is GIT_REPO. - GitRepoUrl *string `json:"gitRepoUrl,omitempty"` - // Inline source files, present when sourceType is SOURCE_FILES. - SourceFiles []SourceCodeFile `json:"sourceFiles,omitempty"` -} - -// NewBuildActVersion instantiates a new BuildActVersion object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewBuildActVersion() *BuildActVersion { - this := BuildActVersion{} - return &this -} - -// NewBuildActVersionWithDefaults instantiates a new BuildActVersion object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewBuildActVersionWithDefaults() *BuildActVersion { - this := BuildActVersion{} - return &this -} - -// GetSourceType returns the SourceType field value if set, zero value otherwise. -func (o *BuildActVersion) GetSourceType() VersionSourceType { - if o == nil || IsNil(o.SourceType) { - var ret VersionSourceType - return ret - } - return *o.SourceType -} - -// GetSourceTypeOk returns a tuple with the SourceType field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *BuildActVersion) GetSourceTypeOk() (*VersionSourceType, bool) { - if o == nil || IsNil(o.SourceType) { - return nil, false - } - return o.SourceType, true -} - -// HasSourceType returns a boolean if a field has been set. -func (o *BuildActVersion) HasSourceType() bool { - if o != nil && !IsNil(o.SourceType) { - return true - } - - return false -} - -// SetSourceType gets a reference to the given VersionSourceType and assigns it to the SourceType field. -func (o *BuildActVersion) SetSourceType(v VersionSourceType) { - o.SourceType = &v -} - -// GetBuildTag returns the BuildTag field value if set, zero value otherwise. -func (o *BuildActVersion) GetBuildTag() string { - if o == nil || IsNil(o.BuildTag) { - var ret string - return ret - } - return *o.BuildTag -} - -// GetBuildTagOk returns a tuple with the BuildTag field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *BuildActVersion) GetBuildTagOk() (*string, bool) { - if o == nil || IsNil(o.BuildTag) { - return nil, false - } - return o.BuildTag, true -} - -// HasBuildTag returns a boolean if a field has been set. -func (o *BuildActVersion) HasBuildTag() bool { - if o != nil && !IsNil(o.BuildTag) { - return true - } - - return false -} - -// SetBuildTag gets a reference to the given string and assigns it to the BuildTag field. -func (o *BuildActVersion) SetBuildTag(v string) { - o.BuildTag = &v -} - -// GetVersionNumber returns the VersionNumber field value if set, zero value otherwise. -func (o *BuildActVersion) GetVersionNumber() string { - if o == nil || IsNil(o.VersionNumber) { - var ret string - return ret - } - return *o.VersionNumber -} - -// GetVersionNumberOk returns a tuple with the VersionNumber field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *BuildActVersion) GetVersionNumberOk() (*string, bool) { - if o == nil || IsNil(o.VersionNumber) { - return nil, false - } - return o.VersionNumber, true -} - -// HasVersionNumber returns a boolean if a field has been set. -func (o *BuildActVersion) HasVersionNumber() bool { - if o != nil && !IsNil(o.VersionNumber) { - return true - } - - return false -} - -// SetVersionNumber gets a reference to the given string and assigns it to the VersionNumber field. -func (o *BuildActVersion) SetVersionNumber(v string) { - o.VersionNumber = &v -} - -// GetGitRepoUrl returns the GitRepoUrl field value if set, zero value otherwise. -func (o *BuildActVersion) GetGitRepoUrl() string { - if o == nil || IsNil(o.GitRepoUrl) { - var ret string - return ret - } - return *o.GitRepoUrl -} - -// GetGitRepoUrlOk returns a tuple with the GitRepoUrl field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *BuildActVersion) GetGitRepoUrlOk() (*string, bool) { - if o == nil || IsNil(o.GitRepoUrl) { - return nil, false - } - return o.GitRepoUrl, true -} - -// HasGitRepoUrl returns a boolean if a field has been set. -func (o *BuildActVersion) HasGitRepoUrl() bool { - if o != nil && !IsNil(o.GitRepoUrl) { - return true - } - - return false -} - -// SetGitRepoUrl gets a reference to the given string and assigns it to the GitRepoUrl field. -func (o *BuildActVersion) SetGitRepoUrl(v string) { - o.GitRepoUrl = &v -} - -// GetSourceFiles returns the SourceFiles field value if set, zero value otherwise. -func (o *BuildActVersion) GetSourceFiles() []SourceCodeFile { - if o == nil || IsNil(o.SourceFiles) { - var ret []SourceCodeFile - return ret - } - return o.SourceFiles -} - -// GetSourceFilesOk returns a tuple with the SourceFiles field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *BuildActVersion) GetSourceFilesOk() ([]SourceCodeFile, bool) { - if o == nil || IsNil(o.SourceFiles) { - return nil, false - } - return o.SourceFiles, true -} - -// HasSourceFiles returns a boolean if a field has been set. -func (o *BuildActVersion) HasSourceFiles() bool { - if o != nil && !IsNil(o.SourceFiles) { - return true - } - - return false -} - -// SetSourceFiles gets a reference to the given []SourceCodeFile and assigns it to the SourceFiles field. -func (o *BuildActVersion) SetSourceFiles(v []SourceCodeFile) { - o.SourceFiles = v -} - -func (o BuildActVersion) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o BuildActVersion) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if !IsNil(o.SourceType) { - toSerialize["sourceType"] = o.SourceType - } - if !IsNil(o.BuildTag) { - toSerialize["buildTag"] = o.BuildTag - } - if !IsNil(o.VersionNumber) { - toSerialize["versionNumber"] = o.VersionNumber - } - if !IsNil(o.GitRepoUrl) { - toSerialize["gitRepoUrl"] = o.GitRepoUrl - } - if !IsNil(o.SourceFiles) { - toSerialize["sourceFiles"] = o.SourceFiles - } - return toSerialize, nil -} - -type NullableBuildActVersion struct { - value *BuildActVersion - isSet bool -} - -func (v NullableBuildActVersion) Get() *BuildActVersion { - return v.value -} - -func (v *NullableBuildActVersion) Set(val *BuildActVersion) { - v.value = val - v.isSet = true -} - -func (v NullableBuildActVersion) IsSet() bool { - return v.isSet -} - -func (v *NullableBuildActVersion) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableBuildActVersion(val *BuildActVersion) *NullableBuildActVersion { - return &NullableBuildActVersion{value: val, isSet: true} -} - -func (v NullableBuildActVersion) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableBuildActVersion) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_build_options.go b/model_build_options.go deleted file mode 100644 index bf58486..0000000 --- a/model_build_options.go +++ /dev/null @@ -1,274 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" -) - -// checks if the BuildOptions type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &BuildOptions{} - -// BuildOptions struct for BuildOptions -type BuildOptions struct { - UseCache NullableBool `json:"useCache,omitempty"` - BetaPackages NullableBool `json:"betaPackages,omitempty"` - MemoryMbytes NullableInt32 `json:"memoryMbytes,omitempty"` - DiskMbytes NullableInt32 `json:"diskMbytes,omitempty"` -} - -// NewBuildOptions instantiates a new BuildOptions object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewBuildOptions() *BuildOptions { - this := BuildOptions{} - return &this -} - -// NewBuildOptionsWithDefaults instantiates a new BuildOptions object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewBuildOptionsWithDefaults() *BuildOptions { - this := BuildOptions{} - return &this -} - -// GetUseCache returns the UseCache field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *BuildOptions) GetUseCache() bool { - if o == nil || IsNil(o.UseCache.Get()) { - var ret bool - return ret - } - return *o.UseCache.Get() -} - -// GetUseCacheOk returns a tuple with the UseCache field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *BuildOptions) GetUseCacheOk() (*bool, bool) { - if o == nil { - return nil, false - } - return o.UseCache.Get(), o.UseCache.IsSet() -} - -// HasUseCache returns a boolean if a field has been set. -func (o *BuildOptions) HasUseCache() bool { - if o != nil && o.UseCache.IsSet() { - return true - } - - return false -} - -// SetUseCache gets a reference to the given NullableBool and assigns it to the UseCache field. -func (o *BuildOptions) SetUseCache(v bool) { - o.UseCache.Set(&v) -} -// SetUseCacheNil sets the value for UseCache to be an explicit nil -func (o *BuildOptions) SetUseCacheNil() { - o.UseCache.Set(nil) -} - -// UnsetUseCache ensures that no value is present for UseCache, not even an explicit nil -func (o *BuildOptions) UnsetUseCache() { - o.UseCache.Unset() -} - -// GetBetaPackages returns the BetaPackages field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *BuildOptions) GetBetaPackages() bool { - if o == nil || IsNil(o.BetaPackages.Get()) { - var ret bool - return ret - } - return *o.BetaPackages.Get() -} - -// GetBetaPackagesOk returns a tuple with the BetaPackages field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *BuildOptions) GetBetaPackagesOk() (*bool, bool) { - if o == nil { - return nil, false - } - return o.BetaPackages.Get(), o.BetaPackages.IsSet() -} - -// HasBetaPackages returns a boolean if a field has been set. -func (o *BuildOptions) HasBetaPackages() bool { - if o != nil && o.BetaPackages.IsSet() { - return true - } - - return false -} - -// SetBetaPackages gets a reference to the given NullableBool and assigns it to the BetaPackages field. -func (o *BuildOptions) SetBetaPackages(v bool) { - o.BetaPackages.Set(&v) -} -// SetBetaPackagesNil sets the value for BetaPackages to be an explicit nil -func (o *BuildOptions) SetBetaPackagesNil() { - o.BetaPackages.Set(nil) -} - -// UnsetBetaPackages ensures that no value is present for BetaPackages, not even an explicit nil -func (o *BuildOptions) UnsetBetaPackages() { - o.BetaPackages.Unset() -} - -// GetMemoryMbytes returns the MemoryMbytes field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *BuildOptions) GetMemoryMbytes() int32 { - if o == nil || IsNil(o.MemoryMbytes.Get()) { - var ret int32 - return ret - } - return *o.MemoryMbytes.Get() -} - -// GetMemoryMbytesOk returns a tuple with the MemoryMbytes field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *BuildOptions) GetMemoryMbytesOk() (*int32, bool) { - if o == nil { - return nil, false - } - return o.MemoryMbytes.Get(), o.MemoryMbytes.IsSet() -} - -// HasMemoryMbytes returns a boolean if a field has been set. -func (o *BuildOptions) HasMemoryMbytes() bool { - if o != nil && o.MemoryMbytes.IsSet() { - return true - } - - return false -} - -// SetMemoryMbytes gets a reference to the given NullableInt32 and assigns it to the MemoryMbytes field. -func (o *BuildOptions) SetMemoryMbytes(v int32) { - o.MemoryMbytes.Set(&v) -} -// SetMemoryMbytesNil sets the value for MemoryMbytes to be an explicit nil -func (o *BuildOptions) SetMemoryMbytesNil() { - o.MemoryMbytes.Set(nil) -} - -// UnsetMemoryMbytes ensures that no value is present for MemoryMbytes, not even an explicit nil -func (o *BuildOptions) UnsetMemoryMbytes() { - o.MemoryMbytes.Unset() -} - -// GetDiskMbytes returns the DiskMbytes field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *BuildOptions) GetDiskMbytes() int32 { - if o == nil || IsNil(o.DiskMbytes.Get()) { - var ret int32 - return ret - } - return *o.DiskMbytes.Get() -} - -// GetDiskMbytesOk returns a tuple with the DiskMbytes field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *BuildOptions) GetDiskMbytesOk() (*int32, bool) { - if o == nil { - return nil, false - } - return o.DiskMbytes.Get(), o.DiskMbytes.IsSet() -} - -// HasDiskMbytes returns a boolean if a field has been set. -func (o *BuildOptions) HasDiskMbytes() bool { - if o != nil && o.DiskMbytes.IsSet() { - return true - } - - return false -} - -// SetDiskMbytes gets a reference to the given NullableInt32 and assigns it to the DiskMbytes field. -func (o *BuildOptions) SetDiskMbytes(v int32) { - o.DiskMbytes.Set(&v) -} -// SetDiskMbytesNil sets the value for DiskMbytes to be an explicit nil -func (o *BuildOptions) SetDiskMbytesNil() { - o.DiskMbytes.Set(nil) -} - -// UnsetDiskMbytes ensures that no value is present for DiskMbytes, not even an explicit nil -func (o *BuildOptions) UnsetDiskMbytes() { - o.DiskMbytes.Unset() -} - -func (o BuildOptions) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o BuildOptions) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if o.UseCache.IsSet() { - toSerialize["useCache"] = o.UseCache.Get() - } - if o.BetaPackages.IsSet() { - toSerialize["betaPackages"] = o.BetaPackages.Get() - } - if o.MemoryMbytes.IsSet() { - toSerialize["memoryMbytes"] = o.MemoryMbytes.Get() - } - if o.DiskMbytes.IsSet() { - toSerialize["diskMbytes"] = o.DiskMbytes.Get() - } - return toSerialize, nil -} - -type NullableBuildOptions struct { - value *BuildOptions - isSet bool -} - -func (v NullableBuildOptions) Get() *BuildOptions { - return v.value -} - -func (v *NullableBuildOptions) Set(val *BuildOptions) { - v.value = val - v.isSet = true -} - -func (v NullableBuildOptions) IsSet() bool { - return v.isSet -} - -func (v *NullableBuildOptions) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableBuildOptions(val *BuildOptions) *NullableBuildOptions { - return &NullableBuildOptions{value: val, isSet: true} -} - -func (v NullableBuildOptions) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableBuildOptions) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_build_response.go b/model_build_response.go deleted file mode 100644 index fe55ccf..0000000 --- a/model_build_response.go +++ /dev/null @@ -1,158 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" - "bytes" - "fmt" -) - -// checks if the BuildResponse type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &BuildResponse{} - -// BuildResponse Response containing Actor build data. -type BuildResponse struct { - Data Build `json:"data"` -} - -type _BuildResponse BuildResponse - -// NewBuildResponse instantiates a new BuildResponse object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewBuildResponse(data Build) *BuildResponse { - this := BuildResponse{} - this.Data = data - return &this -} - -// NewBuildResponseWithDefaults instantiates a new BuildResponse object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewBuildResponseWithDefaults() *BuildResponse { - this := BuildResponse{} - return &this -} - -// GetData returns the Data field value -func (o *BuildResponse) GetData() Build { - if o == nil { - var ret Build - return ret - } - - return o.Data -} - -// GetDataOk returns a tuple with the Data field value -// and a boolean to check if the value has been set. -func (o *BuildResponse) GetDataOk() (*Build, bool) { - if o == nil { - return nil, false - } - return &o.Data, true -} - -// SetData sets field value -func (o *BuildResponse) SetData(v Build) { - o.Data = v -} - -func (o BuildResponse) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o BuildResponse) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["data"] = o.Data - return toSerialize, nil -} - -func (o *BuildResponse) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "data", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err; - } - - for _, requiredProperty := range(requiredProperties) { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varBuildResponse := _BuildResponse{} - - decoder := json.NewDecoder(bytes.NewReader(data)) - decoder.DisallowUnknownFields() - err = decoder.Decode(&varBuildResponse) - - if err != nil { - return err - } - - *o = BuildResponse(varBuildResponse) - - return err -} - -type NullableBuildResponse struct { - value *BuildResponse - isSet bool -} - -func (v NullableBuildResponse) Get() *BuildResponse { - return v.value -} - -func (v *NullableBuildResponse) Set(val *BuildResponse) { - v.value = val - v.isSet = true -} - -func (v NullableBuildResponse) IsSet() bool { - return v.isSet -} - -func (v *NullableBuildResponse) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableBuildResponse(val *BuildResponse) *NullableBuildResponse { - return &NullableBuildResponse{value: val, isSet: true} -} - -func (v NullableBuildResponse) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableBuildResponse) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_build_short.go b/model_build_short.go deleted file mode 100644 index 7327ccc..0000000 --- a/model_build_short.go +++ /dev/null @@ -1,461 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" - "time" - "bytes" - "fmt" -) - -// checks if the BuildShort type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &BuildShort{} - -// BuildShort struct for BuildShort -type BuildShort struct { - Id string `json:"id"` - ActId *string `json:"actId,omitempty"` - UserId *string `json:"userId,omitempty"` - Status ActorJobStatus `json:"status"` - StartedAt time.Time `json:"startedAt"` - FinishedAt NullableTime `json:"finishedAt,omitempty"` - UsageTotalUsd float32 `json:"usageTotalUsd"` - BuildNumber string `json:"buildNumber" validate:"regexp=^([0-9]|[1-9][0-9])\\\\.([0-9]|[1-9][0-9])(\\\\.[1-9][0-9]{0,4})$"` - BuildNumberInt *int32 `json:"buildNumberInt,omitempty"` - Meta *BuildsMeta `json:"meta,omitempty"` -} - -type _BuildShort BuildShort - -// NewBuildShort instantiates a new BuildShort object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewBuildShort(id string, status ActorJobStatus, startedAt time.Time, usageTotalUsd float32, buildNumber string) *BuildShort { - this := BuildShort{} - this.Id = id - this.Status = status - this.StartedAt = startedAt - this.UsageTotalUsd = usageTotalUsd - this.BuildNumber = buildNumber - return &this -} - -// NewBuildShortWithDefaults instantiates a new BuildShort object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewBuildShortWithDefaults() *BuildShort { - this := BuildShort{} - return &this -} - -// GetId returns the Id field value -func (o *BuildShort) GetId() string { - if o == nil { - var ret string - return ret - } - - return o.Id -} - -// GetIdOk returns a tuple with the Id field value -// and a boolean to check if the value has been set. -func (o *BuildShort) GetIdOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Id, true -} - -// SetId sets field value -func (o *BuildShort) SetId(v string) { - o.Id = v -} - -// GetActId returns the ActId field value if set, zero value otherwise. -func (o *BuildShort) GetActId() string { - if o == nil || IsNil(o.ActId) { - var ret string - return ret - } - return *o.ActId -} - -// GetActIdOk returns a tuple with the ActId field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *BuildShort) GetActIdOk() (*string, bool) { - if o == nil || IsNil(o.ActId) { - return nil, false - } - return o.ActId, true -} - -// HasActId returns a boolean if a field has been set. -func (o *BuildShort) HasActId() bool { - if o != nil && !IsNil(o.ActId) { - return true - } - - return false -} - -// SetActId gets a reference to the given string and assigns it to the ActId field. -func (o *BuildShort) SetActId(v string) { - o.ActId = &v -} - -// GetUserId returns the UserId field value if set, zero value otherwise. -func (o *BuildShort) GetUserId() string { - if o == nil || IsNil(o.UserId) { - var ret string - return ret - } - return *o.UserId -} - -// GetUserIdOk returns a tuple with the UserId field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *BuildShort) GetUserIdOk() (*string, bool) { - if o == nil || IsNil(o.UserId) { - return nil, false - } - return o.UserId, true -} - -// HasUserId returns a boolean if a field has been set. -func (o *BuildShort) HasUserId() bool { - if o != nil && !IsNil(o.UserId) { - return true - } - - return false -} - -// SetUserId gets a reference to the given string and assigns it to the UserId field. -func (o *BuildShort) SetUserId(v string) { - o.UserId = &v -} - -// GetStatus returns the Status field value -func (o *BuildShort) GetStatus() ActorJobStatus { - if o == nil { - var ret ActorJobStatus - return ret - } - - return o.Status -} - -// GetStatusOk returns a tuple with the Status field value -// and a boolean to check if the value has been set. -func (o *BuildShort) GetStatusOk() (*ActorJobStatus, bool) { - if o == nil { - return nil, false - } - return &o.Status, true -} - -// SetStatus sets field value -func (o *BuildShort) SetStatus(v ActorJobStatus) { - o.Status = v -} - -// GetStartedAt returns the StartedAt field value -func (o *BuildShort) GetStartedAt() time.Time { - if o == nil { - var ret time.Time - return ret - } - - return o.StartedAt -} - -// GetStartedAtOk returns a tuple with the StartedAt field value -// and a boolean to check if the value has been set. -func (o *BuildShort) GetStartedAtOk() (*time.Time, bool) { - if o == nil { - return nil, false - } - return &o.StartedAt, true -} - -// SetStartedAt sets field value -func (o *BuildShort) SetStartedAt(v time.Time) { - o.StartedAt = v -} - -// GetFinishedAt returns the FinishedAt field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *BuildShort) GetFinishedAt() time.Time { - if o == nil || IsNil(o.FinishedAt.Get()) { - var ret time.Time - return ret - } - return *o.FinishedAt.Get() -} - -// GetFinishedAtOk returns a tuple with the FinishedAt field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *BuildShort) GetFinishedAtOk() (*time.Time, bool) { - if o == nil { - return nil, false - } - return o.FinishedAt.Get(), o.FinishedAt.IsSet() -} - -// HasFinishedAt returns a boolean if a field has been set. -func (o *BuildShort) HasFinishedAt() bool { - if o != nil && o.FinishedAt.IsSet() { - return true - } - - return false -} - -// SetFinishedAt gets a reference to the given NullableTime and assigns it to the FinishedAt field. -func (o *BuildShort) SetFinishedAt(v time.Time) { - o.FinishedAt.Set(&v) -} -// SetFinishedAtNil sets the value for FinishedAt to be an explicit nil -func (o *BuildShort) SetFinishedAtNil() { - o.FinishedAt.Set(nil) -} - -// UnsetFinishedAt ensures that no value is present for FinishedAt, not even an explicit nil -func (o *BuildShort) UnsetFinishedAt() { - o.FinishedAt.Unset() -} - -// GetUsageTotalUsd returns the UsageTotalUsd field value -func (o *BuildShort) GetUsageTotalUsd() float32 { - if o == nil { - var ret float32 - return ret - } - - return o.UsageTotalUsd -} - -// GetUsageTotalUsdOk returns a tuple with the UsageTotalUsd field value -// and a boolean to check if the value has been set. -func (o *BuildShort) GetUsageTotalUsdOk() (*float32, bool) { - if o == nil { - return nil, false - } - return &o.UsageTotalUsd, true -} - -// SetUsageTotalUsd sets field value -func (o *BuildShort) SetUsageTotalUsd(v float32) { - o.UsageTotalUsd = v -} - -// GetBuildNumber returns the BuildNumber field value -func (o *BuildShort) GetBuildNumber() string { - if o == nil { - var ret string - return ret - } - - return o.BuildNumber -} - -// GetBuildNumberOk returns a tuple with the BuildNumber field value -// and a boolean to check if the value has been set. -func (o *BuildShort) GetBuildNumberOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.BuildNumber, true -} - -// SetBuildNumber sets field value -func (o *BuildShort) SetBuildNumber(v string) { - o.BuildNumber = v -} - -// GetBuildNumberInt returns the BuildNumberInt field value if set, zero value otherwise. -func (o *BuildShort) GetBuildNumberInt() int32 { - if o == nil || IsNil(o.BuildNumberInt) { - var ret int32 - return ret - } - return *o.BuildNumberInt -} - -// GetBuildNumberIntOk returns a tuple with the BuildNumberInt field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *BuildShort) GetBuildNumberIntOk() (*int32, bool) { - if o == nil || IsNil(o.BuildNumberInt) { - return nil, false - } - return o.BuildNumberInt, true -} - -// HasBuildNumberInt returns a boolean if a field has been set. -func (o *BuildShort) HasBuildNumberInt() bool { - if o != nil && !IsNil(o.BuildNumberInt) { - return true - } - - return false -} - -// SetBuildNumberInt gets a reference to the given int32 and assigns it to the BuildNumberInt field. -func (o *BuildShort) SetBuildNumberInt(v int32) { - o.BuildNumberInt = &v -} - -// GetMeta returns the Meta field value if set, zero value otherwise. -func (o *BuildShort) GetMeta() BuildsMeta { - if o == nil || IsNil(o.Meta) { - var ret BuildsMeta - return ret - } - return *o.Meta -} - -// GetMetaOk returns a tuple with the Meta field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *BuildShort) GetMetaOk() (*BuildsMeta, bool) { - if o == nil || IsNil(o.Meta) { - return nil, false - } - return o.Meta, true -} - -// HasMeta returns a boolean if a field has been set. -func (o *BuildShort) HasMeta() bool { - if o != nil && !IsNil(o.Meta) { - return true - } - - return false -} - -// SetMeta gets a reference to the given BuildsMeta and assigns it to the Meta field. -func (o *BuildShort) SetMeta(v BuildsMeta) { - o.Meta = &v -} - -func (o BuildShort) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o BuildShort) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["id"] = o.Id - if !IsNil(o.ActId) { - toSerialize["actId"] = o.ActId - } - if !IsNil(o.UserId) { - toSerialize["userId"] = o.UserId - } - toSerialize["status"] = o.Status - toSerialize["startedAt"] = o.StartedAt - if o.FinishedAt.IsSet() { - toSerialize["finishedAt"] = o.FinishedAt.Get() - } - toSerialize["usageTotalUsd"] = o.UsageTotalUsd - toSerialize["buildNumber"] = o.BuildNumber - if !IsNil(o.BuildNumberInt) { - toSerialize["buildNumberInt"] = o.BuildNumberInt - } - if !IsNil(o.Meta) { - toSerialize["meta"] = o.Meta - } - return toSerialize, nil -} - -func (o *BuildShort) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "id", - "status", - "startedAt", - "usageTotalUsd", - "buildNumber", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err; - } - - for _, requiredProperty := range(requiredProperties) { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varBuildShort := _BuildShort{} - - decoder := json.NewDecoder(bytes.NewReader(data)) - decoder.DisallowUnknownFields() - err = decoder.Decode(&varBuildShort) - - if err != nil { - return err - } - - *o = BuildShort(varBuildShort) - - return err -} - -type NullableBuildShort struct { - value *BuildShort - isSet bool -} - -func (v NullableBuildShort) Get() *BuildShort { - return v.value -} - -func (v *NullableBuildShort) Set(val *BuildShort) { - v.value = val - v.isSet = true -} - -func (v NullableBuildShort) IsSet() bool { - return v.isSet -} - -func (v *NullableBuildShort) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableBuildShort(val *BuildShort) *NullableBuildShort { - return &NullableBuildShort{value: val, isSet: true} -} - -func (v NullableBuildShort) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableBuildShort) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_build_stats.go b/model_build_stats.go deleted file mode 100644 index 344afca..0000000 --- a/model_build_stats.go +++ /dev/null @@ -1,266 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" - "bytes" - "fmt" -) - -// checks if the BuildStats type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &BuildStats{} - -// BuildStats struct for BuildStats -type BuildStats struct { - DurationMillis *int32 `json:"durationMillis,omitempty"` - RunTimeSecs *float32 `json:"runTimeSecs,omitempty"` - ComputeUnits float32 `json:"computeUnits"` - ImageSizeBytes *int32 `json:"imageSizeBytes,omitempty"` -} - -type _BuildStats BuildStats - -// NewBuildStats instantiates a new BuildStats object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewBuildStats(computeUnits float32) *BuildStats { - this := BuildStats{} - this.ComputeUnits = computeUnits - return &this -} - -// NewBuildStatsWithDefaults instantiates a new BuildStats object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewBuildStatsWithDefaults() *BuildStats { - this := BuildStats{} - return &this -} - -// GetDurationMillis returns the DurationMillis field value if set, zero value otherwise. -func (o *BuildStats) GetDurationMillis() int32 { - if o == nil || IsNil(o.DurationMillis) { - var ret int32 - return ret - } - return *o.DurationMillis -} - -// GetDurationMillisOk returns a tuple with the DurationMillis field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *BuildStats) GetDurationMillisOk() (*int32, bool) { - if o == nil || IsNil(o.DurationMillis) { - return nil, false - } - return o.DurationMillis, true -} - -// HasDurationMillis returns a boolean if a field has been set. -func (o *BuildStats) HasDurationMillis() bool { - if o != nil && !IsNil(o.DurationMillis) { - return true - } - - return false -} - -// SetDurationMillis gets a reference to the given int32 and assigns it to the DurationMillis field. -func (o *BuildStats) SetDurationMillis(v int32) { - o.DurationMillis = &v -} - -// GetRunTimeSecs returns the RunTimeSecs field value if set, zero value otherwise. -func (o *BuildStats) GetRunTimeSecs() float32 { - if o == nil || IsNil(o.RunTimeSecs) { - var ret float32 - return ret - } - return *o.RunTimeSecs -} - -// GetRunTimeSecsOk returns a tuple with the RunTimeSecs field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *BuildStats) GetRunTimeSecsOk() (*float32, bool) { - if o == nil || IsNil(o.RunTimeSecs) { - return nil, false - } - return o.RunTimeSecs, true -} - -// HasRunTimeSecs returns a boolean if a field has been set. -func (o *BuildStats) HasRunTimeSecs() bool { - if o != nil && !IsNil(o.RunTimeSecs) { - return true - } - - return false -} - -// SetRunTimeSecs gets a reference to the given float32 and assigns it to the RunTimeSecs field. -func (o *BuildStats) SetRunTimeSecs(v float32) { - o.RunTimeSecs = &v -} - -// GetComputeUnits returns the ComputeUnits field value -func (o *BuildStats) GetComputeUnits() float32 { - if o == nil { - var ret float32 - return ret - } - - return o.ComputeUnits -} - -// GetComputeUnitsOk returns a tuple with the ComputeUnits field value -// and a boolean to check if the value has been set. -func (o *BuildStats) GetComputeUnitsOk() (*float32, bool) { - if o == nil { - return nil, false - } - return &o.ComputeUnits, true -} - -// SetComputeUnits sets field value -func (o *BuildStats) SetComputeUnits(v float32) { - o.ComputeUnits = v -} - -// GetImageSizeBytes returns the ImageSizeBytes field value if set, zero value otherwise. -func (o *BuildStats) GetImageSizeBytes() int32 { - if o == nil || IsNil(o.ImageSizeBytes) { - var ret int32 - return ret - } - return *o.ImageSizeBytes -} - -// GetImageSizeBytesOk returns a tuple with the ImageSizeBytes field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *BuildStats) GetImageSizeBytesOk() (*int32, bool) { - if o == nil || IsNil(o.ImageSizeBytes) { - return nil, false - } - return o.ImageSizeBytes, true -} - -// HasImageSizeBytes returns a boolean if a field has been set. -func (o *BuildStats) HasImageSizeBytes() bool { - if o != nil && !IsNil(o.ImageSizeBytes) { - return true - } - - return false -} - -// SetImageSizeBytes gets a reference to the given int32 and assigns it to the ImageSizeBytes field. -func (o *BuildStats) SetImageSizeBytes(v int32) { - o.ImageSizeBytes = &v -} - -func (o BuildStats) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o BuildStats) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if !IsNil(o.DurationMillis) { - toSerialize["durationMillis"] = o.DurationMillis - } - if !IsNil(o.RunTimeSecs) { - toSerialize["runTimeSecs"] = o.RunTimeSecs - } - toSerialize["computeUnits"] = o.ComputeUnits - if !IsNil(o.ImageSizeBytes) { - toSerialize["imageSizeBytes"] = o.ImageSizeBytes - } - return toSerialize, nil -} - -func (o *BuildStats) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "computeUnits", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err; - } - - for _, requiredProperty := range(requiredProperties) { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varBuildStats := _BuildStats{} - - decoder := json.NewDecoder(bytes.NewReader(data)) - decoder.DisallowUnknownFields() - err = decoder.Decode(&varBuildStats) - - if err != nil { - return err - } - - *o = BuildStats(varBuildStats) - - return err -} - -type NullableBuildStats struct { - value *BuildStats - isSet bool -} - -func (v NullableBuildStats) Get() *BuildStats { - return v.value -} - -func (v *NullableBuildStats) Set(val *BuildStats) { - v.value = val - v.isSet = true -} - -func (v NullableBuildStats) IsSet() bool { - return v.isSet -} - -func (v *NullableBuildStats) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableBuildStats(val *BuildStats) *NullableBuildStats { - return &NullableBuildStats{value: val, isSet: true} -} - -func (v NullableBuildStats) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableBuildStats) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_build_tag.go b/model_build_tag.go deleted file mode 100644 index e74fc1d..0000000 --- a/model_build_tag.go +++ /dev/null @@ -1,158 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" - "bytes" - "fmt" -) - -// checks if the BuildTag type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &BuildTag{} - -// BuildTag struct for BuildTag -type BuildTag struct { - BuildId string `json:"buildId"` -} - -type _BuildTag BuildTag - -// NewBuildTag instantiates a new BuildTag object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewBuildTag(buildId string) *BuildTag { - this := BuildTag{} - this.BuildId = buildId - return &this -} - -// NewBuildTagWithDefaults instantiates a new BuildTag object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewBuildTagWithDefaults() *BuildTag { - this := BuildTag{} - return &this -} - -// GetBuildId returns the BuildId field value -func (o *BuildTag) GetBuildId() string { - if o == nil { - var ret string - return ret - } - - return o.BuildId -} - -// GetBuildIdOk returns a tuple with the BuildId field value -// and a boolean to check if the value has been set. -func (o *BuildTag) GetBuildIdOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.BuildId, true -} - -// SetBuildId sets field value -func (o *BuildTag) SetBuildId(v string) { - o.BuildId = v -} - -func (o BuildTag) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o BuildTag) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["buildId"] = o.BuildId - return toSerialize, nil -} - -func (o *BuildTag) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "buildId", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err; - } - - for _, requiredProperty := range(requiredProperties) { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varBuildTag := _BuildTag{} - - decoder := json.NewDecoder(bytes.NewReader(data)) - decoder.DisallowUnknownFields() - err = decoder.Decode(&varBuildTag) - - if err != nil { - return err - } - - *o = BuildTag(varBuildTag) - - return err -} - -type NullableBuildTag struct { - value *BuildTag - isSet bool -} - -func (v NullableBuildTag) Get() *BuildTag { - return v.value -} - -func (v *NullableBuildTag) Set(val *BuildTag) { - v.value = val - v.isSet = true -} - -func (v NullableBuildTag) IsSet() bool { - return v.isSet -} - -func (v *NullableBuildTag) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableBuildTag(val *BuildTag) *NullableBuildTag { - return &NullableBuildTag{value: val, isSet: true} -} - -func (v NullableBuildTag) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableBuildTag) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_build_usage.go b/model_build_usage.go deleted file mode 100644 index 73350b6..0000000 --- a/model_build_usage.go +++ /dev/null @@ -1,136 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" -) - -// checks if the BuildUsage type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &BuildUsage{} - -// BuildUsage struct for BuildUsage -type BuildUsage struct { - ACTOR_COMPUTE_UNITS NullableFloat32 `json:"ACTOR_COMPUTE_UNITS,omitempty"` -} - -// NewBuildUsage instantiates a new BuildUsage object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewBuildUsage() *BuildUsage { - this := BuildUsage{} - return &this -} - -// NewBuildUsageWithDefaults instantiates a new BuildUsage object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewBuildUsageWithDefaults() *BuildUsage { - this := BuildUsage{} - return &this -} - -// GetACTOR_COMPUTE_UNITS returns the ACTOR_COMPUTE_UNITS field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *BuildUsage) GetACTOR_COMPUTE_UNITS() float32 { - if o == nil || IsNil(o.ACTOR_COMPUTE_UNITS.Get()) { - var ret float32 - return ret - } - return *o.ACTOR_COMPUTE_UNITS.Get() -} - -// GetACTOR_COMPUTE_UNITSOk returns a tuple with the ACTOR_COMPUTE_UNITS field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *BuildUsage) GetACTOR_COMPUTE_UNITSOk() (*float32, bool) { - if o == nil { - return nil, false - } - return o.ACTOR_COMPUTE_UNITS.Get(), o.ACTOR_COMPUTE_UNITS.IsSet() -} - -// HasACTOR_COMPUTE_UNITS returns a boolean if a field has been set. -func (o *BuildUsage) HasACTOR_COMPUTE_UNITS() bool { - if o != nil && o.ACTOR_COMPUTE_UNITS.IsSet() { - return true - } - - return false -} - -// SetACTOR_COMPUTE_UNITS gets a reference to the given NullableFloat32 and assigns it to the ACTOR_COMPUTE_UNITS field. -func (o *BuildUsage) SetACTOR_COMPUTE_UNITS(v float32) { - o.ACTOR_COMPUTE_UNITS.Set(&v) -} -// SetACTOR_COMPUTE_UNITSNil sets the value for ACTOR_COMPUTE_UNITS to be an explicit nil -func (o *BuildUsage) SetACTOR_COMPUTE_UNITSNil() { - o.ACTOR_COMPUTE_UNITS.Set(nil) -} - -// UnsetACTOR_COMPUTE_UNITS ensures that no value is present for ACTOR_COMPUTE_UNITS, not even an explicit nil -func (o *BuildUsage) UnsetACTOR_COMPUTE_UNITS() { - o.ACTOR_COMPUTE_UNITS.Unset() -} - -func (o BuildUsage) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o BuildUsage) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if o.ACTOR_COMPUTE_UNITS.IsSet() { - toSerialize["ACTOR_COMPUTE_UNITS"] = o.ACTOR_COMPUTE_UNITS.Get() - } - return toSerialize, nil -} - -type NullableBuildUsage struct { - value *BuildUsage - isSet bool -} - -func (v NullableBuildUsage) Get() *BuildUsage { - return v.value -} - -func (v *NullableBuildUsage) Set(val *BuildUsage) { - v.value = val - v.isSet = true -} - -func (v NullableBuildUsage) IsSet() bool { - return v.isSet -} - -func (v *NullableBuildUsage) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableBuildUsage(val *BuildUsage) *NullableBuildUsage { - return &NullableBuildUsage{value: val, isSet: true} -} - -func (v NullableBuildUsage) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableBuildUsage) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_builds_meta.go b/model_builds_meta.go deleted file mode 100644 index 7e28911..0000000 --- a/model_builds_meta.go +++ /dev/null @@ -1,232 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" - "bytes" - "fmt" -) - -// checks if the BuildsMeta type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &BuildsMeta{} - -// BuildsMeta struct for BuildsMeta -type BuildsMeta struct { - Origin RunOrigin `json:"origin"` - // IP address of the client that started the build. - ClientIp *string `json:"clientIp,omitempty"` - // User agent of the client that started the build. - UserAgent *string `json:"userAgent,omitempty"` -} - -type _BuildsMeta BuildsMeta - -// NewBuildsMeta instantiates a new BuildsMeta object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewBuildsMeta(origin RunOrigin) *BuildsMeta { - this := BuildsMeta{} - this.Origin = origin - return &this -} - -// NewBuildsMetaWithDefaults instantiates a new BuildsMeta object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewBuildsMetaWithDefaults() *BuildsMeta { - this := BuildsMeta{} - return &this -} - -// GetOrigin returns the Origin field value -func (o *BuildsMeta) GetOrigin() RunOrigin { - if o == nil { - var ret RunOrigin - return ret - } - - return o.Origin -} - -// GetOriginOk returns a tuple with the Origin field value -// and a boolean to check if the value has been set. -func (o *BuildsMeta) GetOriginOk() (*RunOrigin, bool) { - if o == nil { - return nil, false - } - return &o.Origin, true -} - -// SetOrigin sets field value -func (o *BuildsMeta) SetOrigin(v RunOrigin) { - o.Origin = v -} - -// GetClientIp returns the ClientIp field value if set, zero value otherwise. -func (o *BuildsMeta) GetClientIp() string { - if o == nil || IsNil(o.ClientIp) { - var ret string - return ret - } - return *o.ClientIp -} - -// GetClientIpOk returns a tuple with the ClientIp field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *BuildsMeta) GetClientIpOk() (*string, bool) { - if o == nil || IsNil(o.ClientIp) { - return nil, false - } - return o.ClientIp, true -} - -// HasClientIp returns a boolean if a field has been set. -func (o *BuildsMeta) HasClientIp() bool { - if o != nil && !IsNil(o.ClientIp) { - return true - } - - return false -} - -// SetClientIp gets a reference to the given string and assigns it to the ClientIp field. -func (o *BuildsMeta) SetClientIp(v string) { - o.ClientIp = &v -} - -// GetUserAgent returns the UserAgent field value if set, zero value otherwise. -func (o *BuildsMeta) GetUserAgent() string { - if o == nil || IsNil(o.UserAgent) { - var ret string - return ret - } - return *o.UserAgent -} - -// GetUserAgentOk returns a tuple with the UserAgent field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *BuildsMeta) GetUserAgentOk() (*string, bool) { - if o == nil || IsNil(o.UserAgent) { - return nil, false - } - return o.UserAgent, true -} - -// HasUserAgent returns a boolean if a field has been set. -func (o *BuildsMeta) HasUserAgent() bool { - if o != nil && !IsNil(o.UserAgent) { - return true - } - - return false -} - -// SetUserAgent gets a reference to the given string and assigns it to the UserAgent field. -func (o *BuildsMeta) SetUserAgent(v string) { - o.UserAgent = &v -} - -func (o BuildsMeta) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o BuildsMeta) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["origin"] = o.Origin - if !IsNil(o.ClientIp) { - toSerialize["clientIp"] = o.ClientIp - } - if !IsNil(o.UserAgent) { - toSerialize["userAgent"] = o.UserAgent - } - return toSerialize, nil -} - -func (o *BuildsMeta) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "origin", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err; - } - - for _, requiredProperty := range(requiredProperties) { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varBuildsMeta := _BuildsMeta{} - - decoder := json.NewDecoder(bytes.NewReader(data)) - decoder.DisallowUnknownFields() - err = decoder.Decode(&varBuildsMeta) - - if err != nil { - return err - } - - *o = BuildsMeta(varBuildsMeta) - - return err -} - -type NullableBuildsMeta struct { - value *BuildsMeta - isSet bool -} - -func (v NullableBuildsMeta) Get() *BuildsMeta { - return v.value -} - -func (v *NullableBuildsMeta) Set(val *BuildsMeta) { - v.value = val - v.isSet = true -} - -func (v NullableBuildsMeta) IsSet() bool { - return v.isSet -} - -func (v *NullableBuildsMeta) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableBuildsMeta(val *BuildsMeta) *NullableBuildsMeta { - return &NullableBuildsMeta{value: val, isSet: true} -} - -func (v NullableBuildsMeta) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableBuildsMeta) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_calls_inner.go b/model_calls_inner.go deleted file mode 100644 index 09e00b3..0000000 --- a/model_calls_inner.go +++ /dev/null @@ -1,321 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" - "time" -) - -// checks if the CallsInner type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &CallsInner{} - -// CallsInner struct for CallsInner -type CallsInner struct { - StartedAt NullableTime `json:"startedAt,omitempty"` - FinishedAt NullableTime `json:"finishedAt,omitempty"` - ErrorMessage NullableString `json:"errorMessage,omitempty"` - ResponseStatus NullableInt32 `json:"responseStatus,omitempty"` - ResponseBody NullableString `json:"responseBody,omitempty"` -} - -// NewCallsInner instantiates a new CallsInner object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewCallsInner() *CallsInner { - this := CallsInner{} - return &this -} - -// NewCallsInnerWithDefaults instantiates a new CallsInner object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewCallsInnerWithDefaults() *CallsInner { - this := CallsInner{} - return &this -} - -// GetStartedAt returns the StartedAt field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *CallsInner) GetStartedAt() time.Time { - if o == nil || IsNil(o.StartedAt.Get()) { - var ret time.Time - return ret - } - return *o.StartedAt.Get() -} - -// GetStartedAtOk returns a tuple with the StartedAt field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *CallsInner) GetStartedAtOk() (*time.Time, bool) { - if o == nil { - return nil, false - } - return o.StartedAt.Get(), o.StartedAt.IsSet() -} - -// HasStartedAt returns a boolean if a field has been set. -func (o *CallsInner) HasStartedAt() bool { - if o != nil && o.StartedAt.IsSet() { - return true - } - - return false -} - -// SetStartedAt gets a reference to the given NullableTime and assigns it to the StartedAt field. -func (o *CallsInner) SetStartedAt(v time.Time) { - o.StartedAt.Set(&v) -} -// SetStartedAtNil sets the value for StartedAt to be an explicit nil -func (o *CallsInner) SetStartedAtNil() { - o.StartedAt.Set(nil) -} - -// UnsetStartedAt ensures that no value is present for StartedAt, not even an explicit nil -func (o *CallsInner) UnsetStartedAt() { - o.StartedAt.Unset() -} - -// GetFinishedAt returns the FinishedAt field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *CallsInner) GetFinishedAt() time.Time { - if o == nil || IsNil(o.FinishedAt.Get()) { - var ret time.Time - return ret - } - return *o.FinishedAt.Get() -} - -// GetFinishedAtOk returns a tuple with the FinishedAt field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *CallsInner) GetFinishedAtOk() (*time.Time, bool) { - if o == nil { - return nil, false - } - return o.FinishedAt.Get(), o.FinishedAt.IsSet() -} - -// HasFinishedAt returns a boolean if a field has been set. -func (o *CallsInner) HasFinishedAt() bool { - if o != nil && o.FinishedAt.IsSet() { - return true - } - - return false -} - -// SetFinishedAt gets a reference to the given NullableTime and assigns it to the FinishedAt field. -func (o *CallsInner) SetFinishedAt(v time.Time) { - o.FinishedAt.Set(&v) -} -// SetFinishedAtNil sets the value for FinishedAt to be an explicit nil -func (o *CallsInner) SetFinishedAtNil() { - o.FinishedAt.Set(nil) -} - -// UnsetFinishedAt ensures that no value is present for FinishedAt, not even an explicit nil -func (o *CallsInner) UnsetFinishedAt() { - o.FinishedAt.Unset() -} - -// GetErrorMessage returns the ErrorMessage field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *CallsInner) GetErrorMessage() string { - if o == nil || IsNil(o.ErrorMessage.Get()) { - var ret string - return ret - } - return *o.ErrorMessage.Get() -} - -// GetErrorMessageOk returns a tuple with the ErrorMessage field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *CallsInner) GetErrorMessageOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.ErrorMessage.Get(), o.ErrorMessage.IsSet() -} - -// HasErrorMessage returns a boolean if a field has been set. -func (o *CallsInner) HasErrorMessage() bool { - if o != nil && o.ErrorMessage.IsSet() { - return true - } - - return false -} - -// SetErrorMessage gets a reference to the given NullableString and assigns it to the ErrorMessage field. -func (o *CallsInner) SetErrorMessage(v string) { - o.ErrorMessage.Set(&v) -} -// SetErrorMessageNil sets the value for ErrorMessage to be an explicit nil -func (o *CallsInner) SetErrorMessageNil() { - o.ErrorMessage.Set(nil) -} - -// UnsetErrorMessage ensures that no value is present for ErrorMessage, not even an explicit nil -func (o *CallsInner) UnsetErrorMessage() { - o.ErrorMessage.Unset() -} - -// GetResponseStatus returns the ResponseStatus field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *CallsInner) GetResponseStatus() int32 { - if o == nil || IsNil(o.ResponseStatus.Get()) { - var ret int32 - return ret - } - return *o.ResponseStatus.Get() -} - -// GetResponseStatusOk returns a tuple with the ResponseStatus field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *CallsInner) GetResponseStatusOk() (*int32, bool) { - if o == nil { - return nil, false - } - return o.ResponseStatus.Get(), o.ResponseStatus.IsSet() -} - -// HasResponseStatus returns a boolean if a field has been set. -func (o *CallsInner) HasResponseStatus() bool { - if o != nil && o.ResponseStatus.IsSet() { - return true - } - - return false -} - -// SetResponseStatus gets a reference to the given NullableInt32 and assigns it to the ResponseStatus field. -func (o *CallsInner) SetResponseStatus(v int32) { - o.ResponseStatus.Set(&v) -} -// SetResponseStatusNil sets the value for ResponseStatus to be an explicit nil -func (o *CallsInner) SetResponseStatusNil() { - o.ResponseStatus.Set(nil) -} - -// UnsetResponseStatus ensures that no value is present for ResponseStatus, not even an explicit nil -func (o *CallsInner) UnsetResponseStatus() { - o.ResponseStatus.Unset() -} - -// GetResponseBody returns the ResponseBody field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *CallsInner) GetResponseBody() string { - if o == nil || IsNil(o.ResponseBody.Get()) { - var ret string - return ret - } - return *o.ResponseBody.Get() -} - -// GetResponseBodyOk returns a tuple with the ResponseBody field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *CallsInner) GetResponseBodyOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.ResponseBody.Get(), o.ResponseBody.IsSet() -} - -// HasResponseBody returns a boolean if a field has been set. -func (o *CallsInner) HasResponseBody() bool { - if o != nil && o.ResponseBody.IsSet() { - return true - } - - return false -} - -// SetResponseBody gets a reference to the given NullableString and assigns it to the ResponseBody field. -func (o *CallsInner) SetResponseBody(v string) { - o.ResponseBody.Set(&v) -} -// SetResponseBodyNil sets the value for ResponseBody to be an explicit nil -func (o *CallsInner) SetResponseBodyNil() { - o.ResponseBody.Set(nil) -} - -// UnsetResponseBody ensures that no value is present for ResponseBody, not even an explicit nil -func (o *CallsInner) UnsetResponseBody() { - o.ResponseBody.Unset() -} - -func (o CallsInner) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o CallsInner) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if o.StartedAt.IsSet() { - toSerialize["startedAt"] = o.StartedAt.Get() - } - if o.FinishedAt.IsSet() { - toSerialize["finishedAt"] = o.FinishedAt.Get() - } - if o.ErrorMessage.IsSet() { - toSerialize["errorMessage"] = o.ErrorMessage.Get() - } - if o.ResponseStatus.IsSet() { - toSerialize["responseStatus"] = o.ResponseStatus.Get() - } - if o.ResponseBody.IsSet() { - toSerialize["responseBody"] = o.ResponseBody.Get() - } - return toSerialize, nil -} - -type NullableCallsInner struct { - value *CallsInner - isSet bool -} - -func (v NullableCallsInner) Get() *CallsInner { - return v.value -} - -func (v *NullableCallsInner) Set(val *CallsInner) { - v.value = val - v.isSet = true -} - -func (v NullableCallsInner) IsSet() bool { - return v.isSet -} - -func (v *NullableCallsInner) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableCallsInner(val *CallsInner) *NullableCallsInner { - return &NullableCallsInner{value: val, isSet: true} -} - -func (v NullableCallsInner) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableCallsInner) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_charge_run_request.go b/model_charge_run_request.go deleted file mode 100644 index 59888f5..0000000 --- a/model_charge_run_request.go +++ /dev/null @@ -1,186 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" - "bytes" - "fmt" -) - -// checks if the ChargeRunRequest type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &ChargeRunRequest{} - -// ChargeRunRequest struct for ChargeRunRequest -type ChargeRunRequest struct { - EventName string `json:"eventName"` - Count int32 `json:"count"` -} - -type _ChargeRunRequest ChargeRunRequest - -// NewChargeRunRequest instantiates a new ChargeRunRequest object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewChargeRunRequest(eventName string, count int32) *ChargeRunRequest { - this := ChargeRunRequest{} - this.EventName = eventName - this.Count = count - return &this -} - -// NewChargeRunRequestWithDefaults instantiates a new ChargeRunRequest object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewChargeRunRequestWithDefaults() *ChargeRunRequest { - this := ChargeRunRequest{} - return &this -} - -// GetEventName returns the EventName field value -func (o *ChargeRunRequest) GetEventName() string { - if o == nil { - var ret string - return ret - } - - return o.EventName -} - -// GetEventNameOk returns a tuple with the EventName field value -// and a boolean to check if the value has been set. -func (o *ChargeRunRequest) GetEventNameOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.EventName, true -} - -// SetEventName sets field value -func (o *ChargeRunRequest) SetEventName(v string) { - o.EventName = v -} - -// GetCount returns the Count field value -func (o *ChargeRunRequest) GetCount() int32 { - if o == nil { - var ret int32 - return ret - } - - return o.Count -} - -// GetCountOk returns a tuple with the Count field value -// and a boolean to check if the value has been set. -func (o *ChargeRunRequest) GetCountOk() (*int32, bool) { - if o == nil { - return nil, false - } - return &o.Count, true -} - -// SetCount sets field value -func (o *ChargeRunRequest) SetCount(v int32) { - o.Count = v -} - -func (o ChargeRunRequest) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o ChargeRunRequest) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["eventName"] = o.EventName - toSerialize["count"] = o.Count - return toSerialize, nil -} - -func (o *ChargeRunRequest) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "eventName", - "count", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err; - } - - for _, requiredProperty := range(requiredProperties) { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varChargeRunRequest := _ChargeRunRequest{} - - decoder := json.NewDecoder(bytes.NewReader(data)) - decoder.DisallowUnknownFields() - err = decoder.Decode(&varChargeRunRequest) - - if err != nil { - return err - } - - *o = ChargeRunRequest(varChargeRunRequest) - - return err -} - -type NullableChargeRunRequest struct { - value *ChargeRunRequest - isSet bool -} - -func (v NullableChargeRunRequest) Get() *ChargeRunRequest { - return v.value -} - -func (v *NullableChargeRunRequest) Set(val *ChargeRunRequest) { - v.value = val - v.isSet = true -} - -func (v NullableChargeRunRequest) IsSet() bool { - return v.isSet -} - -func (v *NullableChargeRunRequest) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableChargeRunRequest(val *ChargeRunRequest) *NullableChargeRunRequest { - return &NullableChargeRunRequest{value: val, isSet: true} -} - -func (v NullableChargeRunRequest) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableChargeRunRequest) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_common_actor_pricing_info.go b/model_common_actor_pricing_info.go deleted file mode 100644 index 4de86f0..0000000 --- a/model_common_actor_pricing_info.go +++ /dev/null @@ -1,428 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" - "time" - "bytes" - "fmt" -) - -// checks if the CommonActorPricingInfo type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &CommonActorPricingInfo{} - -// CommonActorPricingInfo struct for CommonActorPricingInfo -type CommonActorPricingInfo struct { - // In [0, 1], fraction of pricePerUnitUsd that goes to Apify - ApifyMarginPercentage float32 `json:"apifyMarginPercentage"` - // When this pricing info record has been created - CreatedAt time.Time `json:"createdAt"` - // Since when is this pricing info record effective for a given Actor - StartedAt time.Time `json:"startedAt"` - NotifiedAboutFutureChangeAt NullableTime `json:"notifiedAboutFutureChangeAt,omitempty"` - NotifiedAboutChangeAt NullableTime `json:"notifiedAboutChangeAt,omitempty"` - ReasonForChange NullableString `json:"reasonForChange,omitempty"` - IsPriceChangeNotificationSuppressed *bool `json:"isPriceChangeNotificationSuppressed,omitempty"` - ForceContainsSignificantPriceChange *bool `json:"forceContainsSignificantPriceChange,omitempty"` -} - -type _CommonActorPricingInfo CommonActorPricingInfo - -// NewCommonActorPricingInfo instantiates a new CommonActorPricingInfo object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewCommonActorPricingInfo(apifyMarginPercentage float32, createdAt time.Time, startedAt time.Time) *CommonActorPricingInfo { - this := CommonActorPricingInfo{} - this.ApifyMarginPercentage = apifyMarginPercentage - this.CreatedAt = createdAt - this.StartedAt = startedAt - return &this -} - -// NewCommonActorPricingInfoWithDefaults instantiates a new CommonActorPricingInfo object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewCommonActorPricingInfoWithDefaults() *CommonActorPricingInfo { - this := CommonActorPricingInfo{} - return &this -} - -// GetApifyMarginPercentage returns the ApifyMarginPercentage field value -func (o *CommonActorPricingInfo) GetApifyMarginPercentage() float32 { - if o == nil { - var ret float32 - return ret - } - - return o.ApifyMarginPercentage -} - -// GetApifyMarginPercentageOk returns a tuple with the ApifyMarginPercentage field value -// and a boolean to check if the value has been set. -func (o *CommonActorPricingInfo) GetApifyMarginPercentageOk() (*float32, bool) { - if o == nil { - return nil, false - } - return &o.ApifyMarginPercentage, true -} - -// SetApifyMarginPercentage sets field value -func (o *CommonActorPricingInfo) SetApifyMarginPercentage(v float32) { - o.ApifyMarginPercentage = v -} - -// GetCreatedAt returns the CreatedAt field value -func (o *CommonActorPricingInfo) GetCreatedAt() time.Time { - if o == nil { - var ret time.Time - return ret - } - - return o.CreatedAt -} - -// GetCreatedAtOk returns a tuple with the CreatedAt field value -// and a boolean to check if the value has been set. -func (o *CommonActorPricingInfo) GetCreatedAtOk() (*time.Time, bool) { - if o == nil { - return nil, false - } - return &o.CreatedAt, true -} - -// SetCreatedAt sets field value -func (o *CommonActorPricingInfo) SetCreatedAt(v time.Time) { - o.CreatedAt = v -} - -// GetStartedAt returns the StartedAt field value -func (o *CommonActorPricingInfo) GetStartedAt() time.Time { - if o == nil { - var ret time.Time - return ret - } - - return o.StartedAt -} - -// GetStartedAtOk returns a tuple with the StartedAt field value -// and a boolean to check if the value has been set. -func (o *CommonActorPricingInfo) GetStartedAtOk() (*time.Time, bool) { - if o == nil { - return nil, false - } - return &o.StartedAt, true -} - -// SetStartedAt sets field value -func (o *CommonActorPricingInfo) SetStartedAt(v time.Time) { - o.StartedAt = v -} - -// GetNotifiedAboutFutureChangeAt returns the NotifiedAboutFutureChangeAt field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *CommonActorPricingInfo) GetNotifiedAboutFutureChangeAt() time.Time { - if o == nil || IsNil(o.NotifiedAboutFutureChangeAt.Get()) { - var ret time.Time - return ret - } - return *o.NotifiedAboutFutureChangeAt.Get() -} - -// GetNotifiedAboutFutureChangeAtOk returns a tuple with the NotifiedAboutFutureChangeAt field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *CommonActorPricingInfo) GetNotifiedAboutFutureChangeAtOk() (*time.Time, bool) { - if o == nil { - return nil, false - } - return o.NotifiedAboutFutureChangeAt.Get(), o.NotifiedAboutFutureChangeAt.IsSet() -} - -// HasNotifiedAboutFutureChangeAt returns a boolean if a field has been set. -func (o *CommonActorPricingInfo) HasNotifiedAboutFutureChangeAt() bool { - if o != nil && o.NotifiedAboutFutureChangeAt.IsSet() { - return true - } - - return false -} - -// SetNotifiedAboutFutureChangeAt gets a reference to the given NullableTime and assigns it to the NotifiedAboutFutureChangeAt field. -func (o *CommonActorPricingInfo) SetNotifiedAboutFutureChangeAt(v time.Time) { - o.NotifiedAboutFutureChangeAt.Set(&v) -} -// SetNotifiedAboutFutureChangeAtNil sets the value for NotifiedAboutFutureChangeAt to be an explicit nil -func (o *CommonActorPricingInfo) SetNotifiedAboutFutureChangeAtNil() { - o.NotifiedAboutFutureChangeAt.Set(nil) -} - -// UnsetNotifiedAboutFutureChangeAt ensures that no value is present for NotifiedAboutFutureChangeAt, not even an explicit nil -func (o *CommonActorPricingInfo) UnsetNotifiedAboutFutureChangeAt() { - o.NotifiedAboutFutureChangeAt.Unset() -} - -// GetNotifiedAboutChangeAt returns the NotifiedAboutChangeAt field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *CommonActorPricingInfo) GetNotifiedAboutChangeAt() time.Time { - if o == nil || IsNil(o.NotifiedAboutChangeAt.Get()) { - var ret time.Time - return ret - } - return *o.NotifiedAboutChangeAt.Get() -} - -// GetNotifiedAboutChangeAtOk returns a tuple with the NotifiedAboutChangeAt field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *CommonActorPricingInfo) GetNotifiedAboutChangeAtOk() (*time.Time, bool) { - if o == nil { - return nil, false - } - return o.NotifiedAboutChangeAt.Get(), o.NotifiedAboutChangeAt.IsSet() -} - -// HasNotifiedAboutChangeAt returns a boolean if a field has been set. -func (o *CommonActorPricingInfo) HasNotifiedAboutChangeAt() bool { - if o != nil && o.NotifiedAboutChangeAt.IsSet() { - return true - } - - return false -} - -// SetNotifiedAboutChangeAt gets a reference to the given NullableTime and assigns it to the NotifiedAboutChangeAt field. -func (o *CommonActorPricingInfo) SetNotifiedAboutChangeAt(v time.Time) { - o.NotifiedAboutChangeAt.Set(&v) -} -// SetNotifiedAboutChangeAtNil sets the value for NotifiedAboutChangeAt to be an explicit nil -func (o *CommonActorPricingInfo) SetNotifiedAboutChangeAtNil() { - o.NotifiedAboutChangeAt.Set(nil) -} - -// UnsetNotifiedAboutChangeAt ensures that no value is present for NotifiedAboutChangeAt, not even an explicit nil -func (o *CommonActorPricingInfo) UnsetNotifiedAboutChangeAt() { - o.NotifiedAboutChangeAt.Unset() -} - -// GetReasonForChange returns the ReasonForChange field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *CommonActorPricingInfo) GetReasonForChange() string { - if o == nil || IsNil(o.ReasonForChange.Get()) { - var ret string - return ret - } - return *o.ReasonForChange.Get() -} - -// GetReasonForChangeOk returns a tuple with the ReasonForChange field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *CommonActorPricingInfo) GetReasonForChangeOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.ReasonForChange.Get(), o.ReasonForChange.IsSet() -} - -// HasReasonForChange returns a boolean if a field has been set. -func (o *CommonActorPricingInfo) HasReasonForChange() bool { - if o != nil && o.ReasonForChange.IsSet() { - return true - } - - return false -} - -// SetReasonForChange gets a reference to the given NullableString and assigns it to the ReasonForChange field. -func (o *CommonActorPricingInfo) SetReasonForChange(v string) { - o.ReasonForChange.Set(&v) -} -// SetReasonForChangeNil sets the value for ReasonForChange to be an explicit nil -func (o *CommonActorPricingInfo) SetReasonForChangeNil() { - o.ReasonForChange.Set(nil) -} - -// UnsetReasonForChange ensures that no value is present for ReasonForChange, not even an explicit nil -func (o *CommonActorPricingInfo) UnsetReasonForChange() { - o.ReasonForChange.Unset() -} - -// GetIsPriceChangeNotificationSuppressed returns the IsPriceChangeNotificationSuppressed field value if set, zero value otherwise. -func (o *CommonActorPricingInfo) GetIsPriceChangeNotificationSuppressed() bool { - if o == nil || IsNil(o.IsPriceChangeNotificationSuppressed) { - var ret bool - return ret - } - return *o.IsPriceChangeNotificationSuppressed -} - -// GetIsPriceChangeNotificationSuppressedOk returns a tuple with the IsPriceChangeNotificationSuppressed field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CommonActorPricingInfo) GetIsPriceChangeNotificationSuppressedOk() (*bool, bool) { - if o == nil || IsNil(o.IsPriceChangeNotificationSuppressed) { - return nil, false - } - return o.IsPriceChangeNotificationSuppressed, true -} - -// HasIsPriceChangeNotificationSuppressed returns a boolean if a field has been set. -func (o *CommonActorPricingInfo) HasIsPriceChangeNotificationSuppressed() bool { - if o != nil && !IsNil(o.IsPriceChangeNotificationSuppressed) { - return true - } - - return false -} - -// SetIsPriceChangeNotificationSuppressed gets a reference to the given bool and assigns it to the IsPriceChangeNotificationSuppressed field. -func (o *CommonActorPricingInfo) SetIsPriceChangeNotificationSuppressed(v bool) { - o.IsPriceChangeNotificationSuppressed = &v -} - -// GetForceContainsSignificantPriceChange returns the ForceContainsSignificantPriceChange field value if set, zero value otherwise. -func (o *CommonActorPricingInfo) GetForceContainsSignificantPriceChange() bool { - if o == nil || IsNil(o.ForceContainsSignificantPriceChange) { - var ret bool - return ret - } - return *o.ForceContainsSignificantPriceChange -} - -// GetForceContainsSignificantPriceChangeOk returns a tuple with the ForceContainsSignificantPriceChange field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CommonActorPricingInfo) GetForceContainsSignificantPriceChangeOk() (*bool, bool) { - if o == nil || IsNil(o.ForceContainsSignificantPriceChange) { - return nil, false - } - return o.ForceContainsSignificantPriceChange, true -} - -// HasForceContainsSignificantPriceChange returns a boolean if a field has been set. -func (o *CommonActorPricingInfo) HasForceContainsSignificantPriceChange() bool { - if o != nil && !IsNil(o.ForceContainsSignificantPriceChange) { - return true - } - - return false -} - -// SetForceContainsSignificantPriceChange gets a reference to the given bool and assigns it to the ForceContainsSignificantPriceChange field. -func (o *CommonActorPricingInfo) SetForceContainsSignificantPriceChange(v bool) { - o.ForceContainsSignificantPriceChange = &v -} - -func (o CommonActorPricingInfo) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o CommonActorPricingInfo) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["apifyMarginPercentage"] = o.ApifyMarginPercentage - toSerialize["createdAt"] = o.CreatedAt - toSerialize["startedAt"] = o.StartedAt - if o.NotifiedAboutFutureChangeAt.IsSet() { - toSerialize["notifiedAboutFutureChangeAt"] = o.NotifiedAboutFutureChangeAt.Get() - } - if o.NotifiedAboutChangeAt.IsSet() { - toSerialize["notifiedAboutChangeAt"] = o.NotifiedAboutChangeAt.Get() - } - if o.ReasonForChange.IsSet() { - toSerialize["reasonForChange"] = o.ReasonForChange.Get() - } - if !IsNil(o.IsPriceChangeNotificationSuppressed) { - toSerialize["isPriceChangeNotificationSuppressed"] = o.IsPriceChangeNotificationSuppressed - } - if !IsNil(o.ForceContainsSignificantPriceChange) { - toSerialize["forceContainsSignificantPriceChange"] = o.ForceContainsSignificantPriceChange - } - return toSerialize, nil -} - -func (o *CommonActorPricingInfo) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "apifyMarginPercentage", - "createdAt", - "startedAt", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err; - } - - for _, requiredProperty := range(requiredProperties) { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varCommonActorPricingInfo := _CommonActorPricingInfo{} - - decoder := json.NewDecoder(bytes.NewReader(data)) - decoder.DisallowUnknownFields() - err = decoder.Decode(&varCommonActorPricingInfo) - - if err != nil { - return err - } - - *o = CommonActorPricingInfo(varCommonActorPricingInfo) - - return err -} - -type NullableCommonActorPricingInfo struct { - value *CommonActorPricingInfo - isSet bool -} - -func (v NullableCommonActorPricingInfo) Get() *CommonActorPricingInfo { - return v.value -} - -func (v *NullableCommonActorPricingInfo) Set(val *CommonActorPricingInfo) { - v.value = val - v.isSet = true -} - -func (v NullableCommonActorPricingInfo) IsSet() bool { - return v.isSet -} - -func (v *NullableCommonActorPricingInfo) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableCommonActorPricingInfo(val *CommonActorPricingInfo) *NullableCommonActorPricingInfo { - return &NullableCommonActorPricingInfo{value: val, isSet: true} -} - -func (v NullableCommonActorPricingInfo) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableCommonActorPricingInfo) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_create_actor_request.go b/model_create_actor_request.go deleted file mode 100644 index ccbafb3..0000000 --- a/model_create_actor_request.go +++ /dev/null @@ -1,692 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" -) - -// checks if the CreateActorRequest type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &CreateActorRequest{} - -// CreateActorRequest struct for CreateActorRequest -type CreateActorRequest struct { - Name NullableString `json:"name,omitempty"` - Description NullableString `json:"description,omitempty"` - Title NullableString `json:"title,omitempty"` - IsPublic NullableBool `json:"isPublic,omitempty"` - SeoTitle NullableString `json:"seoTitle,omitempty"` - SeoDescription NullableString `json:"seoDescription,omitempty"` - // Deprecated - RestartOnError *bool `json:"restartOnError,omitempty"` - // - Versions []Version `json:"versions,omitempty"` - PricingInfos []ActorRunPricingInfo `json:"pricingInfos,omitempty"` - // - Categories []string `json:"categories,omitempty"` - DefaultRunOptions *DefaultRunOptions `json:"defaultRunOptions,omitempty"` - ActorStandby NullableActorStandby `json:"actorStandby,omitempty"` - ExampleRunInput NullableExampleRunInput `json:"exampleRunInput,omitempty"` - IsDeprecated NullableBool `json:"isDeprecated,omitempty"` -} - -// NewCreateActorRequest instantiates a new CreateActorRequest object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewCreateActorRequest() *CreateActorRequest { - this := CreateActorRequest{} - return &this -} - -// NewCreateActorRequestWithDefaults instantiates a new CreateActorRequest object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewCreateActorRequestWithDefaults() *CreateActorRequest { - this := CreateActorRequest{} - return &this -} - -// GetName returns the Name field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *CreateActorRequest) GetName() string { - if o == nil || IsNil(o.Name.Get()) { - var ret string - return ret - } - return *o.Name.Get() -} - -// GetNameOk returns a tuple with the Name field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *CreateActorRequest) GetNameOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.Name.Get(), o.Name.IsSet() -} - -// HasName returns a boolean if a field has been set. -func (o *CreateActorRequest) HasName() bool { - if o != nil && o.Name.IsSet() { - return true - } - - return false -} - -// SetName gets a reference to the given NullableString and assigns it to the Name field. -func (o *CreateActorRequest) SetName(v string) { - o.Name.Set(&v) -} -// SetNameNil sets the value for Name to be an explicit nil -func (o *CreateActorRequest) SetNameNil() { - o.Name.Set(nil) -} - -// UnsetName ensures that no value is present for Name, not even an explicit nil -func (o *CreateActorRequest) UnsetName() { - o.Name.Unset() -} - -// GetDescription returns the Description field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *CreateActorRequest) GetDescription() string { - if o == nil || IsNil(o.Description.Get()) { - var ret string - return ret - } - return *o.Description.Get() -} - -// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *CreateActorRequest) GetDescriptionOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.Description.Get(), o.Description.IsSet() -} - -// HasDescription returns a boolean if a field has been set. -func (o *CreateActorRequest) HasDescription() bool { - if o != nil && o.Description.IsSet() { - return true - } - - return false -} - -// SetDescription gets a reference to the given NullableString and assigns it to the Description field. -func (o *CreateActorRequest) SetDescription(v string) { - o.Description.Set(&v) -} -// SetDescriptionNil sets the value for Description to be an explicit nil -func (o *CreateActorRequest) SetDescriptionNil() { - o.Description.Set(nil) -} - -// UnsetDescription ensures that no value is present for Description, not even an explicit nil -func (o *CreateActorRequest) UnsetDescription() { - o.Description.Unset() -} - -// GetTitle returns the Title field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *CreateActorRequest) GetTitle() string { - if o == nil || IsNil(o.Title.Get()) { - var ret string - return ret - } - return *o.Title.Get() -} - -// GetTitleOk returns a tuple with the Title field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *CreateActorRequest) GetTitleOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.Title.Get(), o.Title.IsSet() -} - -// HasTitle returns a boolean if a field has been set. -func (o *CreateActorRequest) HasTitle() bool { - if o != nil && o.Title.IsSet() { - return true - } - - return false -} - -// SetTitle gets a reference to the given NullableString and assigns it to the Title field. -func (o *CreateActorRequest) SetTitle(v string) { - o.Title.Set(&v) -} -// SetTitleNil sets the value for Title to be an explicit nil -func (o *CreateActorRequest) SetTitleNil() { - o.Title.Set(nil) -} - -// UnsetTitle ensures that no value is present for Title, not even an explicit nil -func (o *CreateActorRequest) UnsetTitle() { - o.Title.Unset() -} - -// GetIsPublic returns the IsPublic field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *CreateActorRequest) GetIsPublic() bool { - if o == nil || IsNil(o.IsPublic.Get()) { - var ret bool - return ret - } - return *o.IsPublic.Get() -} - -// GetIsPublicOk returns a tuple with the IsPublic field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *CreateActorRequest) GetIsPublicOk() (*bool, bool) { - if o == nil { - return nil, false - } - return o.IsPublic.Get(), o.IsPublic.IsSet() -} - -// HasIsPublic returns a boolean if a field has been set. -func (o *CreateActorRequest) HasIsPublic() bool { - if o != nil && o.IsPublic.IsSet() { - return true - } - - return false -} - -// SetIsPublic gets a reference to the given NullableBool and assigns it to the IsPublic field. -func (o *CreateActorRequest) SetIsPublic(v bool) { - o.IsPublic.Set(&v) -} -// SetIsPublicNil sets the value for IsPublic to be an explicit nil -func (o *CreateActorRequest) SetIsPublicNil() { - o.IsPublic.Set(nil) -} - -// UnsetIsPublic ensures that no value is present for IsPublic, not even an explicit nil -func (o *CreateActorRequest) UnsetIsPublic() { - o.IsPublic.Unset() -} - -// GetSeoTitle returns the SeoTitle field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *CreateActorRequest) GetSeoTitle() string { - if o == nil || IsNil(o.SeoTitle.Get()) { - var ret string - return ret - } - return *o.SeoTitle.Get() -} - -// GetSeoTitleOk returns a tuple with the SeoTitle field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *CreateActorRequest) GetSeoTitleOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.SeoTitle.Get(), o.SeoTitle.IsSet() -} - -// HasSeoTitle returns a boolean if a field has been set. -func (o *CreateActorRequest) HasSeoTitle() bool { - if o != nil && o.SeoTitle.IsSet() { - return true - } - - return false -} - -// SetSeoTitle gets a reference to the given NullableString and assigns it to the SeoTitle field. -func (o *CreateActorRequest) SetSeoTitle(v string) { - o.SeoTitle.Set(&v) -} -// SetSeoTitleNil sets the value for SeoTitle to be an explicit nil -func (o *CreateActorRequest) SetSeoTitleNil() { - o.SeoTitle.Set(nil) -} - -// UnsetSeoTitle ensures that no value is present for SeoTitle, not even an explicit nil -func (o *CreateActorRequest) UnsetSeoTitle() { - o.SeoTitle.Unset() -} - -// GetSeoDescription returns the SeoDescription field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *CreateActorRequest) GetSeoDescription() string { - if o == nil || IsNil(o.SeoDescription.Get()) { - var ret string - return ret - } - return *o.SeoDescription.Get() -} - -// GetSeoDescriptionOk returns a tuple with the SeoDescription field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *CreateActorRequest) GetSeoDescriptionOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.SeoDescription.Get(), o.SeoDescription.IsSet() -} - -// HasSeoDescription returns a boolean if a field has been set. -func (o *CreateActorRequest) HasSeoDescription() bool { - if o != nil && o.SeoDescription.IsSet() { - return true - } - - return false -} - -// SetSeoDescription gets a reference to the given NullableString and assigns it to the SeoDescription field. -func (o *CreateActorRequest) SetSeoDescription(v string) { - o.SeoDescription.Set(&v) -} -// SetSeoDescriptionNil sets the value for SeoDescription to be an explicit nil -func (o *CreateActorRequest) SetSeoDescriptionNil() { - o.SeoDescription.Set(nil) -} - -// UnsetSeoDescription ensures that no value is present for SeoDescription, not even an explicit nil -func (o *CreateActorRequest) UnsetSeoDescription() { - o.SeoDescription.Unset() -} - -// GetRestartOnError returns the RestartOnError field value if set, zero value otherwise. -// Deprecated -func (o *CreateActorRequest) GetRestartOnError() bool { - if o == nil || IsNil(o.RestartOnError) { - var ret bool - return ret - } - return *o.RestartOnError -} - -// GetRestartOnErrorOk returns a tuple with the RestartOnError field value if set, nil otherwise -// and a boolean to check if the value has been set. -// Deprecated -func (o *CreateActorRequest) GetRestartOnErrorOk() (*bool, bool) { - if o == nil || IsNil(o.RestartOnError) { - return nil, false - } - return o.RestartOnError, true -} - -// HasRestartOnError returns a boolean if a field has been set. -func (o *CreateActorRequest) HasRestartOnError() bool { - if o != nil && !IsNil(o.RestartOnError) { - return true - } - - return false -} - -// SetRestartOnError gets a reference to the given bool and assigns it to the RestartOnError field. -// Deprecated -func (o *CreateActorRequest) SetRestartOnError(v bool) { - o.RestartOnError = &v -} - -// GetVersions returns the Versions field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *CreateActorRequest) GetVersions() []Version { - if o == nil { - var ret []Version - return ret - } - return o.Versions -} - -// GetVersionsOk returns a tuple with the Versions field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *CreateActorRequest) GetVersionsOk() ([]Version, bool) { - if o == nil || IsNil(o.Versions) { - return nil, false - } - return o.Versions, true -} - -// HasVersions returns a boolean if a field has been set. -func (o *CreateActorRequest) HasVersions() bool { - if o != nil && !IsNil(o.Versions) { - return true - } - - return false -} - -// SetVersions gets a reference to the given []Version and assigns it to the Versions field. -func (o *CreateActorRequest) SetVersions(v []Version) { - o.Versions = v -} - -// GetPricingInfos returns the PricingInfos field value if set, zero value otherwise. -func (o *CreateActorRequest) GetPricingInfos() []ActorRunPricingInfo { - if o == nil || IsNil(o.PricingInfos) { - var ret []ActorRunPricingInfo - return ret - } - return o.PricingInfos -} - -// GetPricingInfosOk returns a tuple with the PricingInfos field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CreateActorRequest) GetPricingInfosOk() ([]ActorRunPricingInfo, bool) { - if o == nil || IsNil(o.PricingInfos) { - return nil, false - } - return o.PricingInfos, true -} - -// HasPricingInfos returns a boolean if a field has been set. -func (o *CreateActorRequest) HasPricingInfos() bool { - if o != nil && !IsNil(o.PricingInfos) { - return true - } - - return false -} - -// SetPricingInfos gets a reference to the given []ActorRunPricingInfo and assigns it to the PricingInfos field. -func (o *CreateActorRequest) SetPricingInfos(v []ActorRunPricingInfo) { - o.PricingInfos = v -} - -// GetCategories returns the Categories field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *CreateActorRequest) GetCategories() []string { - if o == nil { - var ret []string - return ret - } - return o.Categories -} - -// GetCategoriesOk returns a tuple with the Categories field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *CreateActorRequest) GetCategoriesOk() ([]string, bool) { - if o == nil || IsNil(o.Categories) { - return nil, false - } - return o.Categories, true -} - -// HasCategories returns a boolean if a field has been set. -func (o *CreateActorRequest) HasCategories() bool { - if o != nil && !IsNil(o.Categories) { - return true - } - - return false -} - -// SetCategories gets a reference to the given []string and assigns it to the Categories field. -func (o *CreateActorRequest) SetCategories(v []string) { - o.Categories = v -} - -// GetDefaultRunOptions returns the DefaultRunOptions field value if set, zero value otherwise. -func (o *CreateActorRequest) GetDefaultRunOptions() DefaultRunOptions { - if o == nil || IsNil(o.DefaultRunOptions) { - var ret DefaultRunOptions - return ret - } - return *o.DefaultRunOptions -} - -// GetDefaultRunOptionsOk returns a tuple with the DefaultRunOptions field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CreateActorRequest) GetDefaultRunOptionsOk() (*DefaultRunOptions, bool) { - if o == nil || IsNil(o.DefaultRunOptions) { - return nil, false - } - return o.DefaultRunOptions, true -} - -// HasDefaultRunOptions returns a boolean if a field has been set. -func (o *CreateActorRequest) HasDefaultRunOptions() bool { - if o != nil && !IsNil(o.DefaultRunOptions) { - return true - } - - return false -} - -// SetDefaultRunOptions gets a reference to the given DefaultRunOptions and assigns it to the DefaultRunOptions field. -func (o *CreateActorRequest) SetDefaultRunOptions(v DefaultRunOptions) { - o.DefaultRunOptions = &v -} - -// GetActorStandby returns the ActorStandby field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *CreateActorRequest) GetActorStandby() ActorStandby { - if o == nil || IsNil(o.ActorStandby.Get()) { - var ret ActorStandby - return ret - } - return *o.ActorStandby.Get() -} - -// GetActorStandbyOk returns a tuple with the ActorStandby field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *CreateActorRequest) GetActorStandbyOk() (*ActorStandby, bool) { - if o == nil { - return nil, false - } - return o.ActorStandby.Get(), o.ActorStandby.IsSet() -} - -// HasActorStandby returns a boolean if a field has been set. -func (o *CreateActorRequest) HasActorStandby() bool { - if o != nil && o.ActorStandby.IsSet() { - return true - } - - return false -} - -// SetActorStandby gets a reference to the given NullableActorStandby and assigns it to the ActorStandby field. -func (o *CreateActorRequest) SetActorStandby(v ActorStandby) { - o.ActorStandby.Set(&v) -} -// SetActorStandbyNil sets the value for ActorStandby to be an explicit nil -func (o *CreateActorRequest) SetActorStandbyNil() { - o.ActorStandby.Set(nil) -} - -// UnsetActorStandby ensures that no value is present for ActorStandby, not even an explicit nil -func (o *CreateActorRequest) UnsetActorStandby() { - o.ActorStandby.Unset() -} - -// GetExampleRunInput returns the ExampleRunInput field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *CreateActorRequest) GetExampleRunInput() ExampleRunInput { - if o == nil || IsNil(o.ExampleRunInput.Get()) { - var ret ExampleRunInput - return ret - } - return *o.ExampleRunInput.Get() -} - -// GetExampleRunInputOk returns a tuple with the ExampleRunInput field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *CreateActorRequest) GetExampleRunInputOk() (*ExampleRunInput, bool) { - if o == nil { - return nil, false - } - return o.ExampleRunInput.Get(), o.ExampleRunInput.IsSet() -} - -// HasExampleRunInput returns a boolean if a field has been set. -func (o *CreateActorRequest) HasExampleRunInput() bool { - if o != nil && o.ExampleRunInput.IsSet() { - return true - } - - return false -} - -// SetExampleRunInput gets a reference to the given NullableExampleRunInput and assigns it to the ExampleRunInput field. -func (o *CreateActorRequest) SetExampleRunInput(v ExampleRunInput) { - o.ExampleRunInput.Set(&v) -} -// SetExampleRunInputNil sets the value for ExampleRunInput to be an explicit nil -func (o *CreateActorRequest) SetExampleRunInputNil() { - o.ExampleRunInput.Set(nil) -} - -// UnsetExampleRunInput ensures that no value is present for ExampleRunInput, not even an explicit nil -func (o *CreateActorRequest) UnsetExampleRunInput() { - o.ExampleRunInput.Unset() -} - -// GetIsDeprecated returns the IsDeprecated field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *CreateActorRequest) GetIsDeprecated() bool { - if o == nil || IsNil(o.IsDeprecated.Get()) { - var ret bool - return ret - } - return *o.IsDeprecated.Get() -} - -// GetIsDeprecatedOk returns a tuple with the IsDeprecated field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *CreateActorRequest) GetIsDeprecatedOk() (*bool, bool) { - if o == nil { - return nil, false - } - return o.IsDeprecated.Get(), o.IsDeprecated.IsSet() -} - -// HasIsDeprecated returns a boolean if a field has been set. -func (o *CreateActorRequest) HasIsDeprecated() bool { - if o != nil && o.IsDeprecated.IsSet() { - return true - } - - return false -} - -// SetIsDeprecated gets a reference to the given NullableBool and assigns it to the IsDeprecated field. -func (o *CreateActorRequest) SetIsDeprecated(v bool) { - o.IsDeprecated.Set(&v) -} -// SetIsDeprecatedNil sets the value for IsDeprecated to be an explicit nil -func (o *CreateActorRequest) SetIsDeprecatedNil() { - o.IsDeprecated.Set(nil) -} - -// UnsetIsDeprecated ensures that no value is present for IsDeprecated, not even an explicit nil -func (o *CreateActorRequest) UnsetIsDeprecated() { - o.IsDeprecated.Unset() -} - -func (o CreateActorRequest) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o CreateActorRequest) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if o.Name.IsSet() { - toSerialize["name"] = o.Name.Get() - } - if o.Description.IsSet() { - toSerialize["description"] = o.Description.Get() - } - if o.Title.IsSet() { - toSerialize["title"] = o.Title.Get() - } - if o.IsPublic.IsSet() { - toSerialize["isPublic"] = o.IsPublic.Get() - } - if o.SeoTitle.IsSet() { - toSerialize["seoTitle"] = o.SeoTitle.Get() - } - if o.SeoDescription.IsSet() { - toSerialize["seoDescription"] = o.SeoDescription.Get() - } - if !IsNil(o.RestartOnError) { - toSerialize["restartOnError"] = o.RestartOnError - } - if o.Versions != nil { - toSerialize["versions"] = o.Versions - } - if !IsNil(o.PricingInfos) { - toSerialize["pricingInfos"] = o.PricingInfos - } - if o.Categories != nil { - toSerialize["categories"] = o.Categories - } - if !IsNil(o.DefaultRunOptions) { - toSerialize["defaultRunOptions"] = o.DefaultRunOptions - } - if o.ActorStandby.IsSet() { - toSerialize["actorStandby"] = o.ActorStandby.Get() - } - if o.ExampleRunInput.IsSet() { - toSerialize["exampleRunInput"] = o.ExampleRunInput.Get() - } - if o.IsDeprecated.IsSet() { - toSerialize["isDeprecated"] = o.IsDeprecated.Get() - } - return toSerialize, nil -} - -type NullableCreateActorRequest struct { - value *CreateActorRequest - isSet bool -} - -func (v NullableCreateActorRequest) Get() *CreateActorRequest { - return v.value -} - -func (v *NullableCreateActorRequest) Set(val *CreateActorRequest) { - v.value = val - v.isSet = true -} - -func (v NullableCreateActorRequest) IsSet() bool { - return v.isSet -} - -func (v *NullableCreateActorRequest) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableCreateActorRequest(val *CreateActorRequest) *NullableCreateActorRequest { - return &NullableCreateActorRequest{value: val, isSet: true} -} - -func (v NullableCreateActorRequest) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableCreateActorRequest) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_create_or_update_version_request.go b/model_create_or_update_version_request.go deleted file mode 100644 index 5632939..0000000 --- a/model_create_or_update_version_request.go +++ /dev/null @@ -1,489 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" -) - -// checks if the CreateOrUpdateVersionRequest type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &CreateOrUpdateVersionRequest{} - -// CreateOrUpdateVersionRequest struct for CreateOrUpdateVersionRequest -type CreateOrUpdateVersionRequest struct { - VersionNumber NullableString `json:"versionNumber,omitempty" validate:"regexp=^([0-9]|[1-9][0-9])\\\\.([0-9]|[1-9][0-9])$"` - SourceType NullableVersionSourceType `json:"sourceType,omitempty"` - // - EnvVars []EnvVarRequest `json:"envVars,omitempty"` - ApplyEnvVarsToBuild NullableBool `json:"applyEnvVarsToBuild,omitempty"` - BuildTag NullableString `json:"buildTag,omitempty"` - SourceFiles []VersionSourceFilesInner `json:"sourceFiles,omitempty"` - // URL of the Git repository when sourceType is GIT_REPO. - GitRepoUrl NullableString `json:"gitRepoUrl,omitempty"` - // URL of the tarball when sourceType is TARBALL. - TarballUrl NullableString `json:"tarballUrl,omitempty"` - // URL of the GitHub Gist when sourceType is GITHUB_GIST. - GitHubGistUrl NullableString `json:"gitHubGistUrl,omitempty"` -} - -// NewCreateOrUpdateVersionRequest instantiates a new CreateOrUpdateVersionRequest object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewCreateOrUpdateVersionRequest() *CreateOrUpdateVersionRequest { - this := CreateOrUpdateVersionRequest{} - return &this -} - -// NewCreateOrUpdateVersionRequestWithDefaults instantiates a new CreateOrUpdateVersionRequest object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewCreateOrUpdateVersionRequestWithDefaults() *CreateOrUpdateVersionRequest { - this := CreateOrUpdateVersionRequest{} - return &this -} - -// GetVersionNumber returns the VersionNumber field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *CreateOrUpdateVersionRequest) GetVersionNumber() string { - if o == nil || IsNil(o.VersionNumber.Get()) { - var ret string - return ret - } - return *o.VersionNumber.Get() -} - -// GetVersionNumberOk returns a tuple with the VersionNumber field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *CreateOrUpdateVersionRequest) GetVersionNumberOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.VersionNumber.Get(), o.VersionNumber.IsSet() -} - -// HasVersionNumber returns a boolean if a field has been set. -func (o *CreateOrUpdateVersionRequest) HasVersionNumber() bool { - if o != nil && o.VersionNumber.IsSet() { - return true - } - - return false -} - -// SetVersionNumber gets a reference to the given NullableString and assigns it to the VersionNumber field. -func (o *CreateOrUpdateVersionRequest) SetVersionNumber(v string) { - o.VersionNumber.Set(&v) -} -// SetVersionNumberNil sets the value for VersionNumber to be an explicit nil -func (o *CreateOrUpdateVersionRequest) SetVersionNumberNil() { - o.VersionNumber.Set(nil) -} - -// UnsetVersionNumber ensures that no value is present for VersionNumber, not even an explicit nil -func (o *CreateOrUpdateVersionRequest) UnsetVersionNumber() { - o.VersionNumber.Unset() -} - -// GetSourceType returns the SourceType field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *CreateOrUpdateVersionRequest) GetSourceType() VersionSourceType { - if o == nil || IsNil(o.SourceType.Get()) { - var ret VersionSourceType - return ret - } - return *o.SourceType.Get() -} - -// GetSourceTypeOk returns a tuple with the SourceType field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *CreateOrUpdateVersionRequest) GetSourceTypeOk() (*VersionSourceType, bool) { - if o == nil { - return nil, false - } - return o.SourceType.Get(), o.SourceType.IsSet() -} - -// HasSourceType returns a boolean if a field has been set. -func (o *CreateOrUpdateVersionRequest) HasSourceType() bool { - if o != nil && o.SourceType.IsSet() { - return true - } - - return false -} - -// SetSourceType gets a reference to the given NullableVersionSourceType and assigns it to the SourceType field. -func (o *CreateOrUpdateVersionRequest) SetSourceType(v VersionSourceType) { - o.SourceType.Set(&v) -} -// SetSourceTypeNil sets the value for SourceType to be an explicit nil -func (o *CreateOrUpdateVersionRequest) SetSourceTypeNil() { - o.SourceType.Set(nil) -} - -// UnsetSourceType ensures that no value is present for SourceType, not even an explicit nil -func (o *CreateOrUpdateVersionRequest) UnsetSourceType() { - o.SourceType.Unset() -} - -// GetEnvVars returns the EnvVars field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *CreateOrUpdateVersionRequest) GetEnvVars() []EnvVarRequest { - if o == nil { - var ret []EnvVarRequest - return ret - } - return o.EnvVars -} - -// GetEnvVarsOk returns a tuple with the EnvVars field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *CreateOrUpdateVersionRequest) GetEnvVarsOk() ([]EnvVarRequest, bool) { - if o == nil || IsNil(o.EnvVars) { - return nil, false - } - return o.EnvVars, true -} - -// HasEnvVars returns a boolean if a field has been set. -func (o *CreateOrUpdateVersionRequest) HasEnvVars() bool { - if o != nil && !IsNil(o.EnvVars) { - return true - } - - return false -} - -// SetEnvVars gets a reference to the given []EnvVarRequest and assigns it to the EnvVars field. -func (o *CreateOrUpdateVersionRequest) SetEnvVars(v []EnvVarRequest) { - o.EnvVars = v -} - -// GetApplyEnvVarsToBuild returns the ApplyEnvVarsToBuild field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *CreateOrUpdateVersionRequest) GetApplyEnvVarsToBuild() bool { - if o == nil || IsNil(o.ApplyEnvVarsToBuild.Get()) { - var ret bool - return ret - } - return *o.ApplyEnvVarsToBuild.Get() -} - -// GetApplyEnvVarsToBuildOk returns a tuple with the ApplyEnvVarsToBuild field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *CreateOrUpdateVersionRequest) GetApplyEnvVarsToBuildOk() (*bool, bool) { - if o == nil { - return nil, false - } - return o.ApplyEnvVarsToBuild.Get(), o.ApplyEnvVarsToBuild.IsSet() -} - -// HasApplyEnvVarsToBuild returns a boolean if a field has been set. -func (o *CreateOrUpdateVersionRequest) HasApplyEnvVarsToBuild() bool { - if o != nil && o.ApplyEnvVarsToBuild.IsSet() { - return true - } - - return false -} - -// SetApplyEnvVarsToBuild gets a reference to the given NullableBool and assigns it to the ApplyEnvVarsToBuild field. -func (o *CreateOrUpdateVersionRequest) SetApplyEnvVarsToBuild(v bool) { - o.ApplyEnvVarsToBuild.Set(&v) -} -// SetApplyEnvVarsToBuildNil sets the value for ApplyEnvVarsToBuild to be an explicit nil -func (o *CreateOrUpdateVersionRequest) SetApplyEnvVarsToBuildNil() { - o.ApplyEnvVarsToBuild.Set(nil) -} - -// UnsetApplyEnvVarsToBuild ensures that no value is present for ApplyEnvVarsToBuild, not even an explicit nil -func (o *CreateOrUpdateVersionRequest) UnsetApplyEnvVarsToBuild() { - o.ApplyEnvVarsToBuild.Unset() -} - -// GetBuildTag returns the BuildTag field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *CreateOrUpdateVersionRequest) GetBuildTag() string { - if o == nil || IsNil(o.BuildTag.Get()) { - var ret string - return ret - } - return *o.BuildTag.Get() -} - -// GetBuildTagOk returns a tuple with the BuildTag field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *CreateOrUpdateVersionRequest) GetBuildTagOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.BuildTag.Get(), o.BuildTag.IsSet() -} - -// HasBuildTag returns a boolean if a field has been set. -func (o *CreateOrUpdateVersionRequest) HasBuildTag() bool { - if o != nil && o.BuildTag.IsSet() { - return true - } - - return false -} - -// SetBuildTag gets a reference to the given NullableString and assigns it to the BuildTag field. -func (o *CreateOrUpdateVersionRequest) SetBuildTag(v string) { - o.BuildTag.Set(&v) -} -// SetBuildTagNil sets the value for BuildTag to be an explicit nil -func (o *CreateOrUpdateVersionRequest) SetBuildTagNil() { - o.BuildTag.Set(nil) -} - -// UnsetBuildTag ensures that no value is present for BuildTag, not even an explicit nil -func (o *CreateOrUpdateVersionRequest) UnsetBuildTag() { - o.BuildTag.Unset() -} - -// GetSourceFiles returns the SourceFiles field value if set, zero value otherwise. -func (o *CreateOrUpdateVersionRequest) GetSourceFiles() []VersionSourceFilesInner { - if o == nil || IsNil(o.SourceFiles) { - var ret []VersionSourceFilesInner - return ret - } - return o.SourceFiles -} - -// GetSourceFilesOk returns a tuple with the SourceFiles field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CreateOrUpdateVersionRequest) GetSourceFilesOk() ([]VersionSourceFilesInner, bool) { - if o == nil || IsNil(o.SourceFiles) { - return nil, false - } - return o.SourceFiles, true -} - -// HasSourceFiles returns a boolean if a field has been set. -func (o *CreateOrUpdateVersionRequest) HasSourceFiles() bool { - if o != nil && !IsNil(o.SourceFiles) { - return true - } - - return false -} - -// SetSourceFiles gets a reference to the given []VersionSourceFilesInner and assigns it to the SourceFiles field. -func (o *CreateOrUpdateVersionRequest) SetSourceFiles(v []VersionSourceFilesInner) { - o.SourceFiles = v -} - -// GetGitRepoUrl returns the GitRepoUrl field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *CreateOrUpdateVersionRequest) GetGitRepoUrl() string { - if o == nil || IsNil(o.GitRepoUrl.Get()) { - var ret string - return ret - } - return *o.GitRepoUrl.Get() -} - -// GetGitRepoUrlOk returns a tuple with the GitRepoUrl field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *CreateOrUpdateVersionRequest) GetGitRepoUrlOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.GitRepoUrl.Get(), o.GitRepoUrl.IsSet() -} - -// HasGitRepoUrl returns a boolean if a field has been set. -func (o *CreateOrUpdateVersionRequest) HasGitRepoUrl() bool { - if o != nil && o.GitRepoUrl.IsSet() { - return true - } - - return false -} - -// SetGitRepoUrl gets a reference to the given NullableString and assigns it to the GitRepoUrl field. -func (o *CreateOrUpdateVersionRequest) SetGitRepoUrl(v string) { - o.GitRepoUrl.Set(&v) -} -// SetGitRepoUrlNil sets the value for GitRepoUrl to be an explicit nil -func (o *CreateOrUpdateVersionRequest) SetGitRepoUrlNil() { - o.GitRepoUrl.Set(nil) -} - -// UnsetGitRepoUrl ensures that no value is present for GitRepoUrl, not even an explicit nil -func (o *CreateOrUpdateVersionRequest) UnsetGitRepoUrl() { - o.GitRepoUrl.Unset() -} - -// GetTarballUrl returns the TarballUrl field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *CreateOrUpdateVersionRequest) GetTarballUrl() string { - if o == nil || IsNil(o.TarballUrl.Get()) { - var ret string - return ret - } - return *o.TarballUrl.Get() -} - -// GetTarballUrlOk returns a tuple with the TarballUrl field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *CreateOrUpdateVersionRequest) GetTarballUrlOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.TarballUrl.Get(), o.TarballUrl.IsSet() -} - -// HasTarballUrl returns a boolean if a field has been set. -func (o *CreateOrUpdateVersionRequest) HasTarballUrl() bool { - if o != nil && o.TarballUrl.IsSet() { - return true - } - - return false -} - -// SetTarballUrl gets a reference to the given NullableString and assigns it to the TarballUrl field. -func (o *CreateOrUpdateVersionRequest) SetTarballUrl(v string) { - o.TarballUrl.Set(&v) -} -// SetTarballUrlNil sets the value for TarballUrl to be an explicit nil -func (o *CreateOrUpdateVersionRequest) SetTarballUrlNil() { - o.TarballUrl.Set(nil) -} - -// UnsetTarballUrl ensures that no value is present for TarballUrl, not even an explicit nil -func (o *CreateOrUpdateVersionRequest) UnsetTarballUrl() { - o.TarballUrl.Unset() -} - -// GetGitHubGistUrl returns the GitHubGistUrl field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *CreateOrUpdateVersionRequest) GetGitHubGistUrl() string { - if o == nil || IsNil(o.GitHubGistUrl.Get()) { - var ret string - return ret - } - return *o.GitHubGistUrl.Get() -} - -// GetGitHubGistUrlOk returns a tuple with the GitHubGistUrl field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *CreateOrUpdateVersionRequest) GetGitHubGistUrlOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.GitHubGistUrl.Get(), o.GitHubGistUrl.IsSet() -} - -// HasGitHubGistUrl returns a boolean if a field has been set. -func (o *CreateOrUpdateVersionRequest) HasGitHubGistUrl() bool { - if o != nil && o.GitHubGistUrl.IsSet() { - return true - } - - return false -} - -// SetGitHubGistUrl gets a reference to the given NullableString and assigns it to the GitHubGistUrl field. -func (o *CreateOrUpdateVersionRequest) SetGitHubGistUrl(v string) { - o.GitHubGistUrl.Set(&v) -} -// SetGitHubGistUrlNil sets the value for GitHubGistUrl to be an explicit nil -func (o *CreateOrUpdateVersionRequest) SetGitHubGistUrlNil() { - o.GitHubGistUrl.Set(nil) -} - -// UnsetGitHubGistUrl ensures that no value is present for GitHubGistUrl, not even an explicit nil -func (o *CreateOrUpdateVersionRequest) UnsetGitHubGistUrl() { - o.GitHubGistUrl.Unset() -} - -func (o CreateOrUpdateVersionRequest) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o CreateOrUpdateVersionRequest) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if o.VersionNumber.IsSet() { - toSerialize["versionNumber"] = o.VersionNumber.Get() - } - if o.SourceType.IsSet() { - toSerialize["sourceType"] = o.SourceType.Get() - } - if o.EnvVars != nil { - toSerialize["envVars"] = o.EnvVars - } - if o.ApplyEnvVarsToBuild.IsSet() { - toSerialize["applyEnvVarsToBuild"] = o.ApplyEnvVarsToBuild.Get() - } - if o.BuildTag.IsSet() { - toSerialize["buildTag"] = o.BuildTag.Get() - } - if !IsNil(o.SourceFiles) { - toSerialize["sourceFiles"] = o.SourceFiles - } - if o.GitRepoUrl.IsSet() { - toSerialize["gitRepoUrl"] = o.GitRepoUrl.Get() - } - if o.TarballUrl.IsSet() { - toSerialize["tarballUrl"] = o.TarballUrl.Get() - } - if o.GitHubGistUrl.IsSet() { - toSerialize["gitHubGistUrl"] = o.GitHubGistUrl.Get() - } - return toSerialize, nil -} - -type NullableCreateOrUpdateVersionRequest struct { - value *CreateOrUpdateVersionRequest - isSet bool -} - -func (v NullableCreateOrUpdateVersionRequest) Get() *CreateOrUpdateVersionRequest { - return v.value -} - -func (v *NullableCreateOrUpdateVersionRequest) Set(val *CreateOrUpdateVersionRequest) { - v.value = val - v.isSet = true -} - -func (v NullableCreateOrUpdateVersionRequest) IsSet() bool { - return v.isSet -} - -func (v *NullableCreateOrUpdateVersionRequest) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableCreateOrUpdateVersionRequest(val *CreateOrUpdateVersionRequest) *NullableCreateOrUpdateVersionRequest { - return &NullableCreateOrUpdateVersionRequest{value: val, isSet: true} -} - -func (v NullableCreateOrUpdateVersionRequest) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableCreateOrUpdateVersionRequest) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_create_task_request.go b/model_create_task_request.go deleted file mode 100644 index b41052f..0000000 --- a/model_create_task_request.go +++ /dev/null @@ -1,370 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" - "bytes" - "fmt" -) - -// checks if the CreateTaskRequest type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &CreateTaskRequest{} - -// CreateTaskRequest struct for CreateTaskRequest -type CreateTaskRequest struct { - ActId string `json:"actId"` - Name *string `json:"name,omitempty"` - Options NullableTaskOptions `json:"options,omitempty"` - // The input configuration for the Actor task. This is a user-defined JSON object that will be passed to the Actor when the task is run. - Input map[string]interface{} `json:"input,omitempty"` - Title NullableString `json:"title,omitempty"` - ActorStandby NullableActorStandby `json:"actorStandby,omitempty"` -} - -type _CreateTaskRequest CreateTaskRequest - -// NewCreateTaskRequest instantiates a new CreateTaskRequest object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewCreateTaskRequest(actId string) *CreateTaskRequest { - this := CreateTaskRequest{} - this.ActId = actId - return &this -} - -// NewCreateTaskRequestWithDefaults instantiates a new CreateTaskRequest object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewCreateTaskRequestWithDefaults() *CreateTaskRequest { - this := CreateTaskRequest{} - return &this -} - -// GetActId returns the ActId field value -func (o *CreateTaskRequest) GetActId() string { - if o == nil { - var ret string - return ret - } - - return o.ActId -} - -// GetActIdOk returns a tuple with the ActId field value -// and a boolean to check if the value has been set. -func (o *CreateTaskRequest) GetActIdOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.ActId, true -} - -// SetActId sets field value -func (o *CreateTaskRequest) SetActId(v string) { - o.ActId = v -} - -// GetName returns the Name field value if set, zero value otherwise. -func (o *CreateTaskRequest) GetName() string { - if o == nil || IsNil(o.Name) { - var ret string - return ret - } - return *o.Name -} - -// GetNameOk returns a tuple with the Name field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CreateTaskRequest) GetNameOk() (*string, bool) { - if o == nil || IsNil(o.Name) { - return nil, false - } - return o.Name, true -} - -// HasName returns a boolean if a field has been set. -func (o *CreateTaskRequest) HasName() bool { - if o != nil && !IsNil(o.Name) { - return true - } - - return false -} - -// SetName gets a reference to the given string and assigns it to the Name field. -func (o *CreateTaskRequest) SetName(v string) { - o.Name = &v -} - -// GetOptions returns the Options field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *CreateTaskRequest) GetOptions() TaskOptions { - if o == nil || IsNil(o.Options.Get()) { - var ret TaskOptions - return ret - } - return *o.Options.Get() -} - -// GetOptionsOk returns a tuple with the Options field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *CreateTaskRequest) GetOptionsOk() (*TaskOptions, bool) { - if o == nil { - return nil, false - } - return o.Options.Get(), o.Options.IsSet() -} - -// HasOptions returns a boolean if a field has been set. -func (o *CreateTaskRequest) HasOptions() bool { - if o != nil && o.Options.IsSet() { - return true - } - - return false -} - -// SetOptions gets a reference to the given NullableTaskOptions and assigns it to the Options field. -func (o *CreateTaskRequest) SetOptions(v TaskOptions) { - o.Options.Set(&v) -} -// SetOptionsNil sets the value for Options to be an explicit nil -func (o *CreateTaskRequest) SetOptionsNil() { - o.Options.Set(nil) -} - -// UnsetOptions ensures that no value is present for Options, not even an explicit nil -func (o *CreateTaskRequest) UnsetOptions() { - o.Options.Unset() -} - -// GetInput returns the Input field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *CreateTaskRequest) GetInput() map[string]interface{} { - if o == nil { - var ret map[string]interface{} - return ret - } - return o.Input -} - -// GetInputOk returns a tuple with the Input field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *CreateTaskRequest) GetInputOk() (map[string]interface{}, bool) { - if o == nil || IsNil(o.Input) { - return map[string]interface{}{}, false - } - return o.Input, true -} - -// HasInput returns a boolean if a field has been set. -func (o *CreateTaskRequest) HasInput() bool { - if o != nil && !IsNil(o.Input) { - return true - } - - return false -} - -// SetInput gets a reference to the given map[string]interface{} and assigns it to the Input field. -func (o *CreateTaskRequest) SetInput(v map[string]interface{}) { - o.Input = v -} - -// GetTitle returns the Title field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *CreateTaskRequest) GetTitle() string { - if o == nil || IsNil(o.Title.Get()) { - var ret string - return ret - } - return *o.Title.Get() -} - -// GetTitleOk returns a tuple with the Title field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *CreateTaskRequest) GetTitleOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.Title.Get(), o.Title.IsSet() -} - -// HasTitle returns a boolean if a field has been set. -func (o *CreateTaskRequest) HasTitle() bool { - if o != nil && o.Title.IsSet() { - return true - } - - return false -} - -// SetTitle gets a reference to the given NullableString and assigns it to the Title field. -func (o *CreateTaskRequest) SetTitle(v string) { - o.Title.Set(&v) -} -// SetTitleNil sets the value for Title to be an explicit nil -func (o *CreateTaskRequest) SetTitleNil() { - o.Title.Set(nil) -} - -// UnsetTitle ensures that no value is present for Title, not even an explicit nil -func (o *CreateTaskRequest) UnsetTitle() { - o.Title.Unset() -} - -// GetActorStandby returns the ActorStandby field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *CreateTaskRequest) GetActorStandby() ActorStandby { - if o == nil || IsNil(o.ActorStandby.Get()) { - var ret ActorStandby - return ret - } - return *o.ActorStandby.Get() -} - -// GetActorStandbyOk returns a tuple with the ActorStandby field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *CreateTaskRequest) GetActorStandbyOk() (*ActorStandby, bool) { - if o == nil { - return nil, false - } - return o.ActorStandby.Get(), o.ActorStandby.IsSet() -} - -// HasActorStandby returns a boolean if a field has been set. -func (o *CreateTaskRequest) HasActorStandby() bool { - if o != nil && o.ActorStandby.IsSet() { - return true - } - - return false -} - -// SetActorStandby gets a reference to the given NullableActorStandby and assigns it to the ActorStandby field. -func (o *CreateTaskRequest) SetActorStandby(v ActorStandby) { - o.ActorStandby.Set(&v) -} -// SetActorStandbyNil sets the value for ActorStandby to be an explicit nil -func (o *CreateTaskRequest) SetActorStandbyNil() { - o.ActorStandby.Set(nil) -} - -// UnsetActorStandby ensures that no value is present for ActorStandby, not even an explicit nil -func (o *CreateTaskRequest) UnsetActorStandby() { - o.ActorStandby.Unset() -} - -func (o CreateTaskRequest) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o CreateTaskRequest) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["actId"] = o.ActId - if !IsNil(o.Name) { - toSerialize["name"] = o.Name - } - if o.Options.IsSet() { - toSerialize["options"] = o.Options.Get() - } - if o.Input != nil { - toSerialize["input"] = o.Input - } - if o.Title.IsSet() { - toSerialize["title"] = o.Title.Get() - } - if o.ActorStandby.IsSet() { - toSerialize["actorStandby"] = o.ActorStandby.Get() - } - return toSerialize, nil -} - -func (o *CreateTaskRequest) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "actId", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err; - } - - for _, requiredProperty := range(requiredProperties) { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varCreateTaskRequest := _CreateTaskRequest{} - - decoder := json.NewDecoder(bytes.NewReader(data)) - decoder.DisallowUnknownFields() - err = decoder.Decode(&varCreateTaskRequest) - - if err != nil { - return err - } - - *o = CreateTaskRequest(varCreateTaskRequest) - - return err -} - -type NullableCreateTaskRequest struct { - value *CreateTaskRequest - isSet bool -} - -func (v NullableCreateTaskRequest) Get() *CreateTaskRequest { - return v.value -} - -func (v *NullableCreateTaskRequest) Set(val *CreateTaskRequest) { - v.value = val - v.isSet = true -} - -func (v NullableCreateTaskRequest) IsSet() bool { - return v.isSet -} - -func (v *NullableCreateTaskRequest) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableCreateTaskRequest(val *CreateTaskRequest) *NullableCreateTaskRequest { - return &NullableCreateTaskRequest{value: val, isSet: true} -} - -func (v NullableCreateTaskRequest) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableCreateTaskRequest) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_current.go b/model_current.go deleted file mode 100644 index eb2fbf0..0000000 --- a/model_current.go +++ /dev/null @@ -1,446 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" - "bytes" - "fmt" -) - -// checks if the Current type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &Current{} - -// Current struct for Current -type Current struct { - MonthlyUsageUsd float32 `json:"monthlyUsageUsd"` - MonthlyActorComputeUnits float32 `json:"monthlyActorComputeUnits"` - MonthlyExternalDataTransferGbytes float32 `json:"monthlyExternalDataTransferGbytes"` - MonthlyProxySerps int32 `json:"monthlyProxySerps"` - MonthlyResidentialProxyGbytes float32 `json:"monthlyResidentialProxyGbytes"` - ActorMemoryGbytes float32 `json:"actorMemoryGbytes"` - ActorCount int32 `json:"actorCount"` - ActorTaskCount int32 `json:"actorTaskCount"` - ActiveActorJobCount int32 `json:"activeActorJobCount"` - TeamAccountSeatCount int32 `json:"teamAccountSeatCount"` - ScheduleCount *int32 `json:"scheduleCount,omitempty"` -} - -type _Current Current - -// NewCurrent instantiates a new Current object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewCurrent(monthlyUsageUsd float32, monthlyActorComputeUnits float32, monthlyExternalDataTransferGbytes float32, monthlyProxySerps int32, monthlyResidentialProxyGbytes float32, actorMemoryGbytes float32, actorCount int32, actorTaskCount int32, activeActorJobCount int32, teamAccountSeatCount int32) *Current { - this := Current{} - this.MonthlyUsageUsd = monthlyUsageUsd - this.MonthlyActorComputeUnits = monthlyActorComputeUnits - this.MonthlyExternalDataTransferGbytes = monthlyExternalDataTransferGbytes - this.MonthlyProxySerps = monthlyProxySerps - this.MonthlyResidentialProxyGbytes = monthlyResidentialProxyGbytes - this.ActorMemoryGbytes = actorMemoryGbytes - this.ActorCount = actorCount - this.ActorTaskCount = actorTaskCount - this.ActiveActorJobCount = activeActorJobCount - this.TeamAccountSeatCount = teamAccountSeatCount - return &this -} - -// NewCurrentWithDefaults instantiates a new Current object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewCurrentWithDefaults() *Current { - this := Current{} - return &this -} - -// GetMonthlyUsageUsd returns the MonthlyUsageUsd field value -func (o *Current) GetMonthlyUsageUsd() float32 { - if o == nil { - var ret float32 - return ret - } - - return o.MonthlyUsageUsd -} - -// GetMonthlyUsageUsdOk returns a tuple with the MonthlyUsageUsd field value -// and a boolean to check if the value has been set. -func (o *Current) GetMonthlyUsageUsdOk() (*float32, bool) { - if o == nil { - return nil, false - } - return &o.MonthlyUsageUsd, true -} - -// SetMonthlyUsageUsd sets field value -func (o *Current) SetMonthlyUsageUsd(v float32) { - o.MonthlyUsageUsd = v -} - -// GetMonthlyActorComputeUnits returns the MonthlyActorComputeUnits field value -func (o *Current) GetMonthlyActorComputeUnits() float32 { - if o == nil { - var ret float32 - return ret - } - - return o.MonthlyActorComputeUnits -} - -// GetMonthlyActorComputeUnitsOk returns a tuple with the MonthlyActorComputeUnits field value -// and a boolean to check if the value has been set. -func (o *Current) GetMonthlyActorComputeUnitsOk() (*float32, bool) { - if o == nil { - return nil, false - } - return &o.MonthlyActorComputeUnits, true -} - -// SetMonthlyActorComputeUnits sets field value -func (o *Current) SetMonthlyActorComputeUnits(v float32) { - o.MonthlyActorComputeUnits = v -} - -// GetMonthlyExternalDataTransferGbytes returns the MonthlyExternalDataTransferGbytes field value -func (o *Current) GetMonthlyExternalDataTransferGbytes() float32 { - if o == nil { - var ret float32 - return ret - } - - return o.MonthlyExternalDataTransferGbytes -} - -// GetMonthlyExternalDataTransferGbytesOk returns a tuple with the MonthlyExternalDataTransferGbytes field value -// and a boolean to check if the value has been set. -func (o *Current) GetMonthlyExternalDataTransferGbytesOk() (*float32, bool) { - if o == nil { - return nil, false - } - return &o.MonthlyExternalDataTransferGbytes, true -} - -// SetMonthlyExternalDataTransferGbytes sets field value -func (o *Current) SetMonthlyExternalDataTransferGbytes(v float32) { - o.MonthlyExternalDataTransferGbytes = v -} - -// GetMonthlyProxySerps returns the MonthlyProxySerps field value -func (o *Current) GetMonthlyProxySerps() int32 { - if o == nil { - var ret int32 - return ret - } - - return o.MonthlyProxySerps -} - -// GetMonthlyProxySerpsOk returns a tuple with the MonthlyProxySerps field value -// and a boolean to check if the value has been set. -func (o *Current) GetMonthlyProxySerpsOk() (*int32, bool) { - if o == nil { - return nil, false - } - return &o.MonthlyProxySerps, true -} - -// SetMonthlyProxySerps sets field value -func (o *Current) SetMonthlyProxySerps(v int32) { - o.MonthlyProxySerps = v -} - -// GetMonthlyResidentialProxyGbytes returns the MonthlyResidentialProxyGbytes field value -func (o *Current) GetMonthlyResidentialProxyGbytes() float32 { - if o == nil { - var ret float32 - return ret - } - - return o.MonthlyResidentialProxyGbytes -} - -// GetMonthlyResidentialProxyGbytesOk returns a tuple with the MonthlyResidentialProxyGbytes field value -// and a boolean to check if the value has been set. -func (o *Current) GetMonthlyResidentialProxyGbytesOk() (*float32, bool) { - if o == nil { - return nil, false - } - return &o.MonthlyResidentialProxyGbytes, true -} - -// SetMonthlyResidentialProxyGbytes sets field value -func (o *Current) SetMonthlyResidentialProxyGbytes(v float32) { - o.MonthlyResidentialProxyGbytes = v -} - -// GetActorMemoryGbytes returns the ActorMemoryGbytes field value -func (o *Current) GetActorMemoryGbytes() float32 { - if o == nil { - var ret float32 - return ret - } - - return o.ActorMemoryGbytes -} - -// GetActorMemoryGbytesOk returns a tuple with the ActorMemoryGbytes field value -// and a boolean to check if the value has been set. -func (o *Current) GetActorMemoryGbytesOk() (*float32, bool) { - if o == nil { - return nil, false - } - return &o.ActorMemoryGbytes, true -} - -// SetActorMemoryGbytes sets field value -func (o *Current) SetActorMemoryGbytes(v float32) { - o.ActorMemoryGbytes = v -} - -// GetActorCount returns the ActorCount field value -func (o *Current) GetActorCount() int32 { - if o == nil { - var ret int32 - return ret - } - - return o.ActorCount -} - -// GetActorCountOk returns a tuple with the ActorCount field value -// and a boolean to check if the value has been set. -func (o *Current) GetActorCountOk() (*int32, bool) { - if o == nil { - return nil, false - } - return &o.ActorCount, true -} - -// SetActorCount sets field value -func (o *Current) SetActorCount(v int32) { - o.ActorCount = v -} - -// GetActorTaskCount returns the ActorTaskCount field value -func (o *Current) GetActorTaskCount() int32 { - if o == nil { - var ret int32 - return ret - } - - return o.ActorTaskCount -} - -// GetActorTaskCountOk returns a tuple with the ActorTaskCount field value -// and a boolean to check if the value has been set. -func (o *Current) GetActorTaskCountOk() (*int32, bool) { - if o == nil { - return nil, false - } - return &o.ActorTaskCount, true -} - -// SetActorTaskCount sets field value -func (o *Current) SetActorTaskCount(v int32) { - o.ActorTaskCount = v -} - -// GetActiveActorJobCount returns the ActiveActorJobCount field value -func (o *Current) GetActiveActorJobCount() int32 { - if o == nil { - var ret int32 - return ret - } - - return o.ActiveActorJobCount -} - -// GetActiveActorJobCountOk returns a tuple with the ActiveActorJobCount field value -// and a boolean to check if the value has been set. -func (o *Current) GetActiveActorJobCountOk() (*int32, bool) { - if o == nil { - return nil, false - } - return &o.ActiveActorJobCount, true -} - -// SetActiveActorJobCount sets field value -func (o *Current) SetActiveActorJobCount(v int32) { - o.ActiveActorJobCount = v -} - -// GetTeamAccountSeatCount returns the TeamAccountSeatCount field value -func (o *Current) GetTeamAccountSeatCount() int32 { - if o == nil { - var ret int32 - return ret - } - - return o.TeamAccountSeatCount -} - -// GetTeamAccountSeatCountOk returns a tuple with the TeamAccountSeatCount field value -// and a boolean to check if the value has been set. -func (o *Current) GetTeamAccountSeatCountOk() (*int32, bool) { - if o == nil { - return nil, false - } - return &o.TeamAccountSeatCount, true -} - -// SetTeamAccountSeatCount sets field value -func (o *Current) SetTeamAccountSeatCount(v int32) { - o.TeamAccountSeatCount = v -} - -// GetScheduleCount returns the ScheduleCount field value if set, zero value otherwise. -func (o *Current) GetScheduleCount() int32 { - if o == nil || IsNil(o.ScheduleCount) { - var ret int32 - return ret - } - return *o.ScheduleCount -} - -// GetScheduleCountOk returns a tuple with the ScheduleCount field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Current) GetScheduleCountOk() (*int32, bool) { - if o == nil || IsNil(o.ScheduleCount) { - return nil, false - } - return o.ScheduleCount, true -} - -// HasScheduleCount returns a boolean if a field has been set. -func (o *Current) HasScheduleCount() bool { - if o != nil && !IsNil(o.ScheduleCount) { - return true - } - - return false -} - -// SetScheduleCount gets a reference to the given int32 and assigns it to the ScheduleCount field. -func (o *Current) SetScheduleCount(v int32) { - o.ScheduleCount = &v -} - -func (o Current) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o Current) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["monthlyUsageUsd"] = o.MonthlyUsageUsd - toSerialize["monthlyActorComputeUnits"] = o.MonthlyActorComputeUnits - toSerialize["monthlyExternalDataTransferGbytes"] = o.MonthlyExternalDataTransferGbytes - toSerialize["monthlyProxySerps"] = o.MonthlyProxySerps - toSerialize["monthlyResidentialProxyGbytes"] = o.MonthlyResidentialProxyGbytes - toSerialize["actorMemoryGbytes"] = o.ActorMemoryGbytes - toSerialize["actorCount"] = o.ActorCount - toSerialize["actorTaskCount"] = o.ActorTaskCount - toSerialize["activeActorJobCount"] = o.ActiveActorJobCount - toSerialize["teamAccountSeatCount"] = o.TeamAccountSeatCount - if !IsNil(o.ScheduleCount) { - toSerialize["scheduleCount"] = o.ScheduleCount - } - return toSerialize, nil -} - -func (o *Current) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "monthlyUsageUsd", - "monthlyActorComputeUnits", - "monthlyExternalDataTransferGbytes", - "monthlyProxySerps", - "monthlyResidentialProxyGbytes", - "actorMemoryGbytes", - "actorCount", - "actorTaskCount", - "activeActorJobCount", - "teamAccountSeatCount", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err; - } - - for _, requiredProperty := range(requiredProperties) { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varCurrent := _Current{} - - decoder := json.NewDecoder(bytes.NewReader(data)) - decoder.DisallowUnknownFields() - err = decoder.Decode(&varCurrent) - - if err != nil { - return err - } - - *o = Current(varCurrent) - - return err -} - -type NullableCurrent struct { - value *Current - isSet bool -} - -func (v NullableCurrent) Get() *Current { - return v.value -} - -func (v *NullableCurrent) Set(val *Current) { - v.value = val - v.isSet = true -} - -func (v NullableCurrent) IsSet() bool { - return v.isSet -} - -func (v *NullableCurrent) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableCurrent(val *Current) *NullableCurrent { - return &NullableCurrent{value: val, isSet: true} -} - -func (v NullableCurrent) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableCurrent) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_current_pricing_info.go b/model_current_pricing_info.go deleted file mode 100644 index 36fa6a9..0000000 --- a/model_current_pricing_info.go +++ /dev/null @@ -1,735 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" - "time" - "bytes" - "fmt" -) - -// checks if the CurrentPricingInfo type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &CurrentPricingInfo{} - -// CurrentPricingInfo struct for CurrentPricingInfo -type CurrentPricingInfo struct { - PricingModel string `json:"pricingModel"` - ApifyMarginPercentage *float32 `json:"apifyMarginPercentage,omitempty"` - CreatedAt *time.Time `json:"createdAt,omitempty"` - StartedAt *time.Time `json:"startedAt,omitempty"` - NotifiedAboutChangeAt NullableTime `json:"notifiedAboutChangeAt,omitempty"` - NotifiedAboutFutureChangeAt NullableTime `json:"notifiedAboutFutureChangeAt,omitempty"` - IsPriceChangeNotificationSuppressed *bool `json:"isPriceChangeNotificationSuppressed,omitempty"` - ForceContainsSignificantPriceChange *bool `json:"forceContainsSignificantPriceChange,omitempty"` - IsPPEPlatformUsagePaidByUser *bool `json:"isPPEPlatformUsagePaidByUser,omitempty"` - ReasonForChange NullableString `json:"reasonForChange,omitempty"` - TrialMinutes NullableInt32 `json:"trialMinutes,omitempty"` - UnitName NullableString `json:"unitName,omitempty"` - PricePerUnitUsd NullableFloat32 `json:"pricePerUnitUsd,omitempty"` - MinimalMaxTotalChargeUsd NullableFloat32 `json:"minimalMaxTotalChargeUsd,omitempty"` - // Per-event pricing configuration for pay-per-event Actors. - PricingPerEvent map[string]interface{} `json:"pricingPerEvent,omitempty"` -} - -type _CurrentPricingInfo CurrentPricingInfo - -// NewCurrentPricingInfo instantiates a new CurrentPricingInfo object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewCurrentPricingInfo(pricingModel string) *CurrentPricingInfo { - this := CurrentPricingInfo{} - this.PricingModel = pricingModel - return &this -} - -// NewCurrentPricingInfoWithDefaults instantiates a new CurrentPricingInfo object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewCurrentPricingInfoWithDefaults() *CurrentPricingInfo { - this := CurrentPricingInfo{} - return &this -} - -// GetPricingModel returns the PricingModel field value -func (o *CurrentPricingInfo) GetPricingModel() string { - if o == nil { - var ret string - return ret - } - - return o.PricingModel -} - -// GetPricingModelOk returns a tuple with the PricingModel field value -// and a boolean to check if the value has been set. -func (o *CurrentPricingInfo) GetPricingModelOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.PricingModel, true -} - -// SetPricingModel sets field value -func (o *CurrentPricingInfo) SetPricingModel(v string) { - o.PricingModel = v -} - -// GetApifyMarginPercentage returns the ApifyMarginPercentage field value if set, zero value otherwise. -func (o *CurrentPricingInfo) GetApifyMarginPercentage() float32 { - if o == nil || IsNil(o.ApifyMarginPercentage) { - var ret float32 - return ret - } - return *o.ApifyMarginPercentage -} - -// GetApifyMarginPercentageOk returns a tuple with the ApifyMarginPercentage field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CurrentPricingInfo) GetApifyMarginPercentageOk() (*float32, bool) { - if o == nil || IsNil(o.ApifyMarginPercentage) { - return nil, false - } - return o.ApifyMarginPercentage, true -} - -// HasApifyMarginPercentage returns a boolean if a field has been set. -func (o *CurrentPricingInfo) HasApifyMarginPercentage() bool { - if o != nil && !IsNil(o.ApifyMarginPercentage) { - return true - } - - return false -} - -// SetApifyMarginPercentage gets a reference to the given float32 and assigns it to the ApifyMarginPercentage field. -func (o *CurrentPricingInfo) SetApifyMarginPercentage(v float32) { - o.ApifyMarginPercentage = &v -} - -// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. -func (o *CurrentPricingInfo) GetCreatedAt() time.Time { - if o == nil || IsNil(o.CreatedAt) { - var ret time.Time - return ret - } - return *o.CreatedAt -} - -// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CurrentPricingInfo) GetCreatedAtOk() (*time.Time, bool) { - if o == nil || IsNil(o.CreatedAt) { - return nil, false - } - return o.CreatedAt, true -} - -// HasCreatedAt returns a boolean if a field has been set. -func (o *CurrentPricingInfo) HasCreatedAt() bool { - if o != nil && !IsNil(o.CreatedAt) { - return true - } - - return false -} - -// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. -func (o *CurrentPricingInfo) SetCreatedAt(v time.Time) { - o.CreatedAt = &v -} - -// GetStartedAt returns the StartedAt field value if set, zero value otherwise. -func (o *CurrentPricingInfo) GetStartedAt() time.Time { - if o == nil || IsNil(o.StartedAt) { - var ret time.Time - return ret - } - return *o.StartedAt -} - -// GetStartedAtOk returns a tuple with the StartedAt field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CurrentPricingInfo) GetStartedAtOk() (*time.Time, bool) { - if o == nil || IsNil(o.StartedAt) { - return nil, false - } - return o.StartedAt, true -} - -// HasStartedAt returns a boolean if a field has been set. -func (o *CurrentPricingInfo) HasStartedAt() bool { - if o != nil && !IsNil(o.StartedAt) { - return true - } - - return false -} - -// SetStartedAt gets a reference to the given time.Time and assigns it to the StartedAt field. -func (o *CurrentPricingInfo) SetStartedAt(v time.Time) { - o.StartedAt = &v -} - -// GetNotifiedAboutChangeAt returns the NotifiedAboutChangeAt field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *CurrentPricingInfo) GetNotifiedAboutChangeAt() time.Time { - if o == nil || IsNil(o.NotifiedAboutChangeAt.Get()) { - var ret time.Time - return ret - } - return *o.NotifiedAboutChangeAt.Get() -} - -// GetNotifiedAboutChangeAtOk returns a tuple with the NotifiedAboutChangeAt field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *CurrentPricingInfo) GetNotifiedAboutChangeAtOk() (*time.Time, bool) { - if o == nil { - return nil, false - } - return o.NotifiedAboutChangeAt.Get(), o.NotifiedAboutChangeAt.IsSet() -} - -// HasNotifiedAboutChangeAt returns a boolean if a field has been set. -func (o *CurrentPricingInfo) HasNotifiedAboutChangeAt() bool { - if o != nil && o.NotifiedAboutChangeAt.IsSet() { - return true - } - - return false -} - -// SetNotifiedAboutChangeAt gets a reference to the given NullableTime and assigns it to the NotifiedAboutChangeAt field. -func (o *CurrentPricingInfo) SetNotifiedAboutChangeAt(v time.Time) { - o.NotifiedAboutChangeAt.Set(&v) -} -// SetNotifiedAboutChangeAtNil sets the value for NotifiedAboutChangeAt to be an explicit nil -func (o *CurrentPricingInfo) SetNotifiedAboutChangeAtNil() { - o.NotifiedAboutChangeAt.Set(nil) -} - -// UnsetNotifiedAboutChangeAt ensures that no value is present for NotifiedAboutChangeAt, not even an explicit nil -func (o *CurrentPricingInfo) UnsetNotifiedAboutChangeAt() { - o.NotifiedAboutChangeAt.Unset() -} - -// GetNotifiedAboutFutureChangeAt returns the NotifiedAboutFutureChangeAt field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *CurrentPricingInfo) GetNotifiedAboutFutureChangeAt() time.Time { - if o == nil || IsNil(o.NotifiedAboutFutureChangeAt.Get()) { - var ret time.Time - return ret - } - return *o.NotifiedAboutFutureChangeAt.Get() -} - -// GetNotifiedAboutFutureChangeAtOk returns a tuple with the NotifiedAboutFutureChangeAt field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *CurrentPricingInfo) GetNotifiedAboutFutureChangeAtOk() (*time.Time, bool) { - if o == nil { - return nil, false - } - return o.NotifiedAboutFutureChangeAt.Get(), o.NotifiedAboutFutureChangeAt.IsSet() -} - -// HasNotifiedAboutFutureChangeAt returns a boolean if a field has been set. -func (o *CurrentPricingInfo) HasNotifiedAboutFutureChangeAt() bool { - if o != nil && o.NotifiedAboutFutureChangeAt.IsSet() { - return true - } - - return false -} - -// SetNotifiedAboutFutureChangeAt gets a reference to the given NullableTime and assigns it to the NotifiedAboutFutureChangeAt field. -func (o *CurrentPricingInfo) SetNotifiedAboutFutureChangeAt(v time.Time) { - o.NotifiedAboutFutureChangeAt.Set(&v) -} -// SetNotifiedAboutFutureChangeAtNil sets the value for NotifiedAboutFutureChangeAt to be an explicit nil -func (o *CurrentPricingInfo) SetNotifiedAboutFutureChangeAtNil() { - o.NotifiedAboutFutureChangeAt.Set(nil) -} - -// UnsetNotifiedAboutFutureChangeAt ensures that no value is present for NotifiedAboutFutureChangeAt, not even an explicit nil -func (o *CurrentPricingInfo) UnsetNotifiedAboutFutureChangeAt() { - o.NotifiedAboutFutureChangeAt.Unset() -} - -// GetIsPriceChangeNotificationSuppressed returns the IsPriceChangeNotificationSuppressed field value if set, zero value otherwise. -func (o *CurrentPricingInfo) GetIsPriceChangeNotificationSuppressed() bool { - if o == nil || IsNil(o.IsPriceChangeNotificationSuppressed) { - var ret bool - return ret - } - return *o.IsPriceChangeNotificationSuppressed -} - -// GetIsPriceChangeNotificationSuppressedOk returns a tuple with the IsPriceChangeNotificationSuppressed field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CurrentPricingInfo) GetIsPriceChangeNotificationSuppressedOk() (*bool, bool) { - if o == nil || IsNil(o.IsPriceChangeNotificationSuppressed) { - return nil, false - } - return o.IsPriceChangeNotificationSuppressed, true -} - -// HasIsPriceChangeNotificationSuppressed returns a boolean if a field has been set. -func (o *CurrentPricingInfo) HasIsPriceChangeNotificationSuppressed() bool { - if o != nil && !IsNil(o.IsPriceChangeNotificationSuppressed) { - return true - } - - return false -} - -// SetIsPriceChangeNotificationSuppressed gets a reference to the given bool and assigns it to the IsPriceChangeNotificationSuppressed field. -func (o *CurrentPricingInfo) SetIsPriceChangeNotificationSuppressed(v bool) { - o.IsPriceChangeNotificationSuppressed = &v -} - -// GetForceContainsSignificantPriceChange returns the ForceContainsSignificantPriceChange field value if set, zero value otherwise. -func (o *CurrentPricingInfo) GetForceContainsSignificantPriceChange() bool { - if o == nil || IsNil(o.ForceContainsSignificantPriceChange) { - var ret bool - return ret - } - return *o.ForceContainsSignificantPriceChange -} - -// GetForceContainsSignificantPriceChangeOk returns a tuple with the ForceContainsSignificantPriceChange field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CurrentPricingInfo) GetForceContainsSignificantPriceChangeOk() (*bool, bool) { - if o == nil || IsNil(o.ForceContainsSignificantPriceChange) { - return nil, false - } - return o.ForceContainsSignificantPriceChange, true -} - -// HasForceContainsSignificantPriceChange returns a boolean if a field has been set. -func (o *CurrentPricingInfo) HasForceContainsSignificantPriceChange() bool { - if o != nil && !IsNil(o.ForceContainsSignificantPriceChange) { - return true - } - - return false -} - -// SetForceContainsSignificantPriceChange gets a reference to the given bool and assigns it to the ForceContainsSignificantPriceChange field. -func (o *CurrentPricingInfo) SetForceContainsSignificantPriceChange(v bool) { - o.ForceContainsSignificantPriceChange = &v -} - -// GetIsPPEPlatformUsagePaidByUser returns the IsPPEPlatformUsagePaidByUser field value if set, zero value otherwise. -func (o *CurrentPricingInfo) GetIsPPEPlatformUsagePaidByUser() bool { - if o == nil || IsNil(o.IsPPEPlatformUsagePaidByUser) { - var ret bool - return ret - } - return *o.IsPPEPlatformUsagePaidByUser -} - -// GetIsPPEPlatformUsagePaidByUserOk returns a tuple with the IsPPEPlatformUsagePaidByUser field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CurrentPricingInfo) GetIsPPEPlatformUsagePaidByUserOk() (*bool, bool) { - if o == nil || IsNil(o.IsPPEPlatformUsagePaidByUser) { - return nil, false - } - return o.IsPPEPlatformUsagePaidByUser, true -} - -// HasIsPPEPlatformUsagePaidByUser returns a boolean if a field has been set. -func (o *CurrentPricingInfo) HasIsPPEPlatformUsagePaidByUser() bool { - if o != nil && !IsNil(o.IsPPEPlatformUsagePaidByUser) { - return true - } - - return false -} - -// SetIsPPEPlatformUsagePaidByUser gets a reference to the given bool and assigns it to the IsPPEPlatformUsagePaidByUser field. -func (o *CurrentPricingInfo) SetIsPPEPlatformUsagePaidByUser(v bool) { - o.IsPPEPlatformUsagePaidByUser = &v -} - -// GetReasonForChange returns the ReasonForChange field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *CurrentPricingInfo) GetReasonForChange() string { - if o == nil || IsNil(o.ReasonForChange.Get()) { - var ret string - return ret - } - return *o.ReasonForChange.Get() -} - -// GetReasonForChangeOk returns a tuple with the ReasonForChange field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *CurrentPricingInfo) GetReasonForChangeOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.ReasonForChange.Get(), o.ReasonForChange.IsSet() -} - -// HasReasonForChange returns a boolean if a field has been set. -func (o *CurrentPricingInfo) HasReasonForChange() bool { - if o != nil && o.ReasonForChange.IsSet() { - return true - } - - return false -} - -// SetReasonForChange gets a reference to the given NullableString and assigns it to the ReasonForChange field. -func (o *CurrentPricingInfo) SetReasonForChange(v string) { - o.ReasonForChange.Set(&v) -} -// SetReasonForChangeNil sets the value for ReasonForChange to be an explicit nil -func (o *CurrentPricingInfo) SetReasonForChangeNil() { - o.ReasonForChange.Set(nil) -} - -// UnsetReasonForChange ensures that no value is present for ReasonForChange, not even an explicit nil -func (o *CurrentPricingInfo) UnsetReasonForChange() { - o.ReasonForChange.Unset() -} - -// GetTrialMinutes returns the TrialMinutes field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *CurrentPricingInfo) GetTrialMinutes() int32 { - if o == nil || IsNil(o.TrialMinutes.Get()) { - var ret int32 - return ret - } - return *o.TrialMinutes.Get() -} - -// GetTrialMinutesOk returns a tuple with the TrialMinutes field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *CurrentPricingInfo) GetTrialMinutesOk() (*int32, bool) { - if o == nil { - return nil, false - } - return o.TrialMinutes.Get(), o.TrialMinutes.IsSet() -} - -// HasTrialMinutes returns a boolean if a field has been set. -func (o *CurrentPricingInfo) HasTrialMinutes() bool { - if o != nil && o.TrialMinutes.IsSet() { - return true - } - - return false -} - -// SetTrialMinutes gets a reference to the given NullableInt32 and assigns it to the TrialMinutes field. -func (o *CurrentPricingInfo) SetTrialMinutes(v int32) { - o.TrialMinutes.Set(&v) -} -// SetTrialMinutesNil sets the value for TrialMinutes to be an explicit nil -func (o *CurrentPricingInfo) SetTrialMinutesNil() { - o.TrialMinutes.Set(nil) -} - -// UnsetTrialMinutes ensures that no value is present for TrialMinutes, not even an explicit nil -func (o *CurrentPricingInfo) UnsetTrialMinutes() { - o.TrialMinutes.Unset() -} - -// GetUnitName returns the UnitName field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *CurrentPricingInfo) GetUnitName() string { - if o == nil || IsNil(o.UnitName.Get()) { - var ret string - return ret - } - return *o.UnitName.Get() -} - -// GetUnitNameOk returns a tuple with the UnitName field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *CurrentPricingInfo) GetUnitNameOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.UnitName.Get(), o.UnitName.IsSet() -} - -// HasUnitName returns a boolean if a field has been set. -func (o *CurrentPricingInfo) HasUnitName() bool { - if o != nil && o.UnitName.IsSet() { - return true - } - - return false -} - -// SetUnitName gets a reference to the given NullableString and assigns it to the UnitName field. -func (o *CurrentPricingInfo) SetUnitName(v string) { - o.UnitName.Set(&v) -} -// SetUnitNameNil sets the value for UnitName to be an explicit nil -func (o *CurrentPricingInfo) SetUnitNameNil() { - o.UnitName.Set(nil) -} - -// UnsetUnitName ensures that no value is present for UnitName, not even an explicit nil -func (o *CurrentPricingInfo) UnsetUnitName() { - o.UnitName.Unset() -} - -// GetPricePerUnitUsd returns the PricePerUnitUsd field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *CurrentPricingInfo) GetPricePerUnitUsd() float32 { - if o == nil || IsNil(o.PricePerUnitUsd.Get()) { - var ret float32 - return ret - } - return *o.PricePerUnitUsd.Get() -} - -// GetPricePerUnitUsdOk returns a tuple with the PricePerUnitUsd field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *CurrentPricingInfo) GetPricePerUnitUsdOk() (*float32, bool) { - if o == nil { - return nil, false - } - return o.PricePerUnitUsd.Get(), o.PricePerUnitUsd.IsSet() -} - -// HasPricePerUnitUsd returns a boolean if a field has been set. -func (o *CurrentPricingInfo) HasPricePerUnitUsd() bool { - if o != nil && o.PricePerUnitUsd.IsSet() { - return true - } - - return false -} - -// SetPricePerUnitUsd gets a reference to the given NullableFloat32 and assigns it to the PricePerUnitUsd field. -func (o *CurrentPricingInfo) SetPricePerUnitUsd(v float32) { - o.PricePerUnitUsd.Set(&v) -} -// SetPricePerUnitUsdNil sets the value for PricePerUnitUsd to be an explicit nil -func (o *CurrentPricingInfo) SetPricePerUnitUsdNil() { - o.PricePerUnitUsd.Set(nil) -} - -// UnsetPricePerUnitUsd ensures that no value is present for PricePerUnitUsd, not even an explicit nil -func (o *CurrentPricingInfo) UnsetPricePerUnitUsd() { - o.PricePerUnitUsd.Unset() -} - -// GetMinimalMaxTotalChargeUsd returns the MinimalMaxTotalChargeUsd field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *CurrentPricingInfo) GetMinimalMaxTotalChargeUsd() float32 { - if o == nil || IsNil(o.MinimalMaxTotalChargeUsd.Get()) { - var ret float32 - return ret - } - return *o.MinimalMaxTotalChargeUsd.Get() -} - -// GetMinimalMaxTotalChargeUsdOk returns a tuple with the MinimalMaxTotalChargeUsd field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *CurrentPricingInfo) GetMinimalMaxTotalChargeUsdOk() (*float32, bool) { - if o == nil { - return nil, false - } - return o.MinimalMaxTotalChargeUsd.Get(), o.MinimalMaxTotalChargeUsd.IsSet() -} - -// HasMinimalMaxTotalChargeUsd returns a boolean if a field has been set. -func (o *CurrentPricingInfo) HasMinimalMaxTotalChargeUsd() bool { - if o != nil && o.MinimalMaxTotalChargeUsd.IsSet() { - return true - } - - return false -} - -// SetMinimalMaxTotalChargeUsd gets a reference to the given NullableFloat32 and assigns it to the MinimalMaxTotalChargeUsd field. -func (o *CurrentPricingInfo) SetMinimalMaxTotalChargeUsd(v float32) { - o.MinimalMaxTotalChargeUsd.Set(&v) -} -// SetMinimalMaxTotalChargeUsdNil sets the value for MinimalMaxTotalChargeUsd to be an explicit nil -func (o *CurrentPricingInfo) SetMinimalMaxTotalChargeUsdNil() { - o.MinimalMaxTotalChargeUsd.Set(nil) -} - -// UnsetMinimalMaxTotalChargeUsd ensures that no value is present for MinimalMaxTotalChargeUsd, not even an explicit nil -func (o *CurrentPricingInfo) UnsetMinimalMaxTotalChargeUsd() { - o.MinimalMaxTotalChargeUsd.Unset() -} - -// GetPricingPerEvent returns the PricingPerEvent field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *CurrentPricingInfo) GetPricingPerEvent() map[string]interface{} { - if o == nil { - var ret map[string]interface{} - return ret - } - return o.PricingPerEvent -} - -// GetPricingPerEventOk returns a tuple with the PricingPerEvent field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *CurrentPricingInfo) GetPricingPerEventOk() (map[string]interface{}, bool) { - if o == nil || IsNil(o.PricingPerEvent) { - return map[string]interface{}{}, false - } - return o.PricingPerEvent, true -} - -// HasPricingPerEvent returns a boolean if a field has been set. -func (o *CurrentPricingInfo) HasPricingPerEvent() bool { - if o != nil && !IsNil(o.PricingPerEvent) { - return true - } - - return false -} - -// SetPricingPerEvent gets a reference to the given map[string]interface{} and assigns it to the PricingPerEvent field. -func (o *CurrentPricingInfo) SetPricingPerEvent(v map[string]interface{}) { - o.PricingPerEvent = v -} - -func (o CurrentPricingInfo) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o CurrentPricingInfo) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["pricingModel"] = o.PricingModel - if !IsNil(o.ApifyMarginPercentage) { - toSerialize["apifyMarginPercentage"] = o.ApifyMarginPercentage - } - if !IsNil(o.CreatedAt) { - toSerialize["createdAt"] = o.CreatedAt - } - if !IsNil(o.StartedAt) { - toSerialize["startedAt"] = o.StartedAt - } - if o.NotifiedAboutChangeAt.IsSet() { - toSerialize["notifiedAboutChangeAt"] = o.NotifiedAboutChangeAt.Get() - } - if o.NotifiedAboutFutureChangeAt.IsSet() { - toSerialize["notifiedAboutFutureChangeAt"] = o.NotifiedAboutFutureChangeAt.Get() - } - if !IsNil(o.IsPriceChangeNotificationSuppressed) { - toSerialize["isPriceChangeNotificationSuppressed"] = o.IsPriceChangeNotificationSuppressed - } - if !IsNil(o.ForceContainsSignificantPriceChange) { - toSerialize["forceContainsSignificantPriceChange"] = o.ForceContainsSignificantPriceChange - } - if !IsNil(o.IsPPEPlatformUsagePaidByUser) { - toSerialize["isPPEPlatformUsagePaidByUser"] = o.IsPPEPlatformUsagePaidByUser - } - if o.ReasonForChange.IsSet() { - toSerialize["reasonForChange"] = o.ReasonForChange.Get() - } - if o.TrialMinutes.IsSet() { - toSerialize["trialMinutes"] = o.TrialMinutes.Get() - } - if o.UnitName.IsSet() { - toSerialize["unitName"] = o.UnitName.Get() - } - if o.PricePerUnitUsd.IsSet() { - toSerialize["pricePerUnitUsd"] = o.PricePerUnitUsd.Get() - } - if o.MinimalMaxTotalChargeUsd.IsSet() { - toSerialize["minimalMaxTotalChargeUsd"] = o.MinimalMaxTotalChargeUsd.Get() - } - if o.PricingPerEvent != nil { - toSerialize["pricingPerEvent"] = o.PricingPerEvent - } - return toSerialize, nil -} - -func (o *CurrentPricingInfo) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "pricingModel", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err; - } - - for _, requiredProperty := range(requiredProperties) { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varCurrentPricingInfo := _CurrentPricingInfo{} - - decoder := json.NewDecoder(bytes.NewReader(data)) - decoder.DisallowUnknownFields() - err = decoder.Decode(&varCurrentPricingInfo) - - if err != nil { - return err - } - - *o = CurrentPricingInfo(varCurrentPricingInfo) - - return err -} - -type NullableCurrentPricingInfo struct { - value *CurrentPricingInfo - isSet bool -} - -func (v NullableCurrentPricingInfo) Get() *CurrentPricingInfo { - return v.value -} - -func (v *NullableCurrentPricingInfo) Set(val *CurrentPricingInfo) { - v.value = val - v.isSet = true -} - -func (v NullableCurrentPricingInfo) IsSet() bool { - return v.isSet -} - -func (v *NullableCurrentPricingInfo) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableCurrentPricingInfo(val *CurrentPricingInfo) *NullableCurrentPricingInfo { - return &NullableCurrentPricingInfo{value: val, isSet: true} -} - -func (v NullableCurrentPricingInfo) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableCurrentPricingInfo) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_daily_service_usages.go b/model_daily_service_usages.go deleted file mode 100644 index 83e906b..0000000 --- a/model_daily_service_usages.go +++ /dev/null @@ -1,215 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" - "bytes" - "fmt" -) - -// checks if the DailyServiceUsages type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &DailyServiceUsages{} - -// DailyServiceUsages struct for DailyServiceUsages -type DailyServiceUsages struct { - Date string `json:"date"` - // A map of service usage item names to their usage details. - ServiceUsage map[string]UsageItem `json:"serviceUsage"` - TotalUsageCreditsUsd float32 `json:"totalUsageCreditsUsd"` -} - -type _DailyServiceUsages DailyServiceUsages - -// NewDailyServiceUsages instantiates a new DailyServiceUsages object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewDailyServiceUsages(date string, serviceUsage map[string]UsageItem, totalUsageCreditsUsd float32) *DailyServiceUsages { - this := DailyServiceUsages{} - this.Date = date - this.ServiceUsage = serviceUsage - this.TotalUsageCreditsUsd = totalUsageCreditsUsd - return &this -} - -// NewDailyServiceUsagesWithDefaults instantiates a new DailyServiceUsages object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewDailyServiceUsagesWithDefaults() *DailyServiceUsages { - this := DailyServiceUsages{} - return &this -} - -// GetDate returns the Date field value -func (o *DailyServiceUsages) GetDate() string { - if o == nil { - var ret string - return ret - } - - return o.Date -} - -// GetDateOk returns a tuple with the Date field value -// and a boolean to check if the value has been set. -func (o *DailyServiceUsages) GetDateOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Date, true -} - -// SetDate sets field value -func (o *DailyServiceUsages) SetDate(v string) { - o.Date = v -} - -// GetServiceUsage returns the ServiceUsage field value -func (o *DailyServiceUsages) GetServiceUsage() map[string]UsageItem { - if o == nil { - var ret map[string]UsageItem - return ret - } - - return o.ServiceUsage -} - -// GetServiceUsageOk returns a tuple with the ServiceUsage field value -// and a boolean to check if the value has been set. -func (o *DailyServiceUsages) GetServiceUsageOk() (map[string]UsageItem, bool) { - if o == nil { - return map[string]UsageItem{}, false - } - return o.ServiceUsage, true -} - -// SetServiceUsage sets field value -func (o *DailyServiceUsages) SetServiceUsage(v map[string]UsageItem) { - o.ServiceUsage = v -} - -// GetTotalUsageCreditsUsd returns the TotalUsageCreditsUsd field value -func (o *DailyServiceUsages) GetTotalUsageCreditsUsd() float32 { - if o == nil { - var ret float32 - return ret - } - - return o.TotalUsageCreditsUsd -} - -// GetTotalUsageCreditsUsdOk returns a tuple with the TotalUsageCreditsUsd field value -// and a boolean to check if the value has been set. -func (o *DailyServiceUsages) GetTotalUsageCreditsUsdOk() (*float32, bool) { - if o == nil { - return nil, false - } - return &o.TotalUsageCreditsUsd, true -} - -// SetTotalUsageCreditsUsd sets field value -func (o *DailyServiceUsages) SetTotalUsageCreditsUsd(v float32) { - o.TotalUsageCreditsUsd = v -} - -func (o DailyServiceUsages) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o DailyServiceUsages) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["date"] = o.Date - toSerialize["serviceUsage"] = o.ServiceUsage - toSerialize["totalUsageCreditsUsd"] = o.TotalUsageCreditsUsd - return toSerialize, nil -} - -func (o *DailyServiceUsages) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "date", - "serviceUsage", - "totalUsageCreditsUsd", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err; - } - - for _, requiredProperty := range(requiredProperties) { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varDailyServiceUsages := _DailyServiceUsages{} - - decoder := json.NewDecoder(bytes.NewReader(data)) - decoder.DisallowUnknownFields() - err = decoder.Decode(&varDailyServiceUsages) - - if err != nil { - return err - } - - *o = DailyServiceUsages(varDailyServiceUsages) - - return err -} - -type NullableDailyServiceUsages struct { - value *DailyServiceUsages - isSet bool -} - -func (v NullableDailyServiceUsages) Get() *DailyServiceUsages { - return v.value -} - -func (v *NullableDailyServiceUsages) Set(val *DailyServiceUsages) { - v.value = val - v.isSet = true -} - -func (v NullableDailyServiceUsages) IsSet() bool { - return v.isSet -} - -func (v *NullableDailyServiceUsages) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableDailyServiceUsages(val *DailyServiceUsages) *NullableDailyServiceUsages { - return &NullableDailyServiceUsages{value: val, isSet: true} -} - -func (v NullableDailyServiceUsages) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableDailyServiceUsages) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_dataset.go b/model_dataset.go deleted file mode 100644 index c8754b0..0000000 --- a/model_dataset.go +++ /dev/null @@ -1,725 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" - "time" - "bytes" - "fmt" -) - -// checks if the Dataset type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &Dataset{} - -// Dataset struct for Dataset -type Dataset struct { - Id string `json:"id"` - Name NullableString `json:"name,omitempty"` - UserId string `json:"userId"` - CreatedAt time.Time `json:"createdAt"` - ModifiedAt time.Time `json:"modifiedAt"` - AccessedAt time.Time `json:"accessedAt"` - ItemCount int32 `json:"itemCount"` - CleanItemCount int32 `json:"cleanItemCount"` - ActId NullableString `json:"actId,omitempty"` - ActRunId NullableString `json:"actRunId,omitempty"` - // - Fields []string `json:"fields,omitempty"` - // Defines the schema of items in your dataset, the full specification can be found in [Apify docs](/platform/actors/development/actor-definition/dataset-schema) - Schema map[string]interface{} `json:"schema,omitempty"` - ConsoleUrl string `json:"consoleUrl"` - // A public link to access the dataset items directly. - ItemsPublicUrl *string `json:"itemsPublicUrl,omitempty"` - // A secret key for generating signed public URLs. It is only provided to clients with WRITE permission for the dataset. - UrlSigningSecretKey NullableString `json:"urlSigningSecretKey,omitempty"` - GeneralAccess *GeneralAccess `json:"generalAccess,omitempty"` - Stats *DatasetStats `json:"stats,omitempty"` -} - -type _Dataset Dataset - -// NewDataset instantiates a new Dataset object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewDataset(id string, userId string, createdAt time.Time, modifiedAt time.Time, accessedAt time.Time, itemCount int32, cleanItemCount int32, consoleUrl string) *Dataset { - this := Dataset{} - this.Id = id - this.UserId = userId - this.CreatedAt = createdAt - this.ModifiedAt = modifiedAt - this.AccessedAt = accessedAt - this.ItemCount = itemCount - this.CleanItemCount = cleanItemCount - this.ConsoleUrl = consoleUrl - return &this -} - -// NewDatasetWithDefaults instantiates a new Dataset object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewDatasetWithDefaults() *Dataset { - this := Dataset{} - return &this -} - -// GetId returns the Id field value -func (o *Dataset) GetId() string { - if o == nil { - var ret string - return ret - } - - return o.Id -} - -// GetIdOk returns a tuple with the Id field value -// and a boolean to check if the value has been set. -func (o *Dataset) GetIdOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Id, true -} - -// SetId sets field value -func (o *Dataset) SetId(v string) { - o.Id = v -} - -// GetName returns the Name field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *Dataset) GetName() string { - if o == nil || IsNil(o.Name.Get()) { - var ret string - return ret - } - return *o.Name.Get() -} - -// GetNameOk returns a tuple with the Name field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *Dataset) GetNameOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.Name.Get(), o.Name.IsSet() -} - -// HasName returns a boolean if a field has been set. -func (o *Dataset) HasName() bool { - if o != nil && o.Name.IsSet() { - return true - } - - return false -} - -// SetName gets a reference to the given NullableString and assigns it to the Name field. -func (o *Dataset) SetName(v string) { - o.Name.Set(&v) -} -// SetNameNil sets the value for Name to be an explicit nil -func (o *Dataset) SetNameNil() { - o.Name.Set(nil) -} - -// UnsetName ensures that no value is present for Name, not even an explicit nil -func (o *Dataset) UnsetName() { - o.Name.Unset() -} - -// GetUserId returns the UserId field value -func (o *Dataset) GetUserId() string { - if o == nil { - var ret string - return ret - } - - return o.UserId -} - -// GetUserIdOk returns a tuple with the UserId field value -// and a boolean to check if the value has been set. -func (o *Dataset) GetUserIdOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.UserId, true -} - -// SetUserId sets field value -func (o *Dataset) SetUserId(v string) { - o.UserId = v -} - -// GetCreatedAt returns the CreatedAt field value -func (o *Dataset) GetCreatedAt() time.Time { - if o == nil { - var ret time.Time - return ret - } - - return o.CreatedAt -} - -// GetCreatedAtOk returns a tuple with the CreatedAt field value -// and a boolean to check if the value has been set. -func (o *Dataset) GetCreatedAtOk() (*time.Time, bool) { - if o == nil { - return nil, false - } - return &o.CreatedAt, true -} - -// SetCreatedAt sets field value -func (o *Dataset) SetCreatedAt(v time.Time) { - o.CreatedAt = v -} - -// GetModifiedAt returns the ModifiedAt field value -func (o *Dataset) GetModifiedAt() time.Time { - if o == nil { - var ret time.Time - return ret - } - - return o.ModifiedAt -} - -// GetModifiedAtOk returns a tuple with the ModifiedAt field value -// and a boolean to check if the value has been set. -func (o *Dataset) GetModifiedAtOk() (*time.Time, bool) { - if o == nil { - return nil, false - } - return &o.ModifiedAt, true -} - -// SetModifiedAt sets field value -func (o *Dataset) SetModifiedAt(v time.Time) { - o.ModifiedAt = v -} - -// GetAccessedAt returns the AccessedAt field value -func (o *Dataset) GetAccessedAt() time.Time { - if o == nil { - var ret time.Time - return ret - } - - return o.AccessedAt -} - -// GetAccessedAtOk returns a tuple with the AccessedAt field value -// and a boolean to check if the value has been set. -func (o *Dataset) GetAccessedAtOk() (*time.Time, bool) { - if o == nil { - return nil, false - } - return &o.AccessedAt, true -} - -// SetAccessedAt sets field value -func (o *Dataset) SetAccessedAt(v time.Time) { - o.AccessedAt = v -} - -// GetItemCount returns the ItemCount field value -func (o *Dataset) GetItemCount() int32 { - if o == nil { - var ret int32 - return ret - } - - return o.ItemCount -} - -// GetItemCountOk returns a tuple with the ItemCount field value -// and a boolean to check if the value has been set. -func (o *Dataset) GetItemCountOk() (*int32, bool) { - if o == nil { - return nil, false - } - return &o.ItemCount, true -} - -// SetItemCount sets field value -func (o *Dataset) SetItemCount(v int32) { - o.ItemCount = v -} - -// GetCleanItemCount returns the CleanItemCount field value -func (o *Dataset) GetCleanItemCount() int32 { - if o == nil { - var ret int32 - return ret - } - - return o.CleanItemCount -} - -// GetCleanItemCountOk returns a tuple with the CleanItemCount field value -// and a boolean to check if the value has been set. -func (o *Dataset) GetCleanItemCountOk() (*int32, bool) { - if o == nil { - return nil, false - } - return &o.CleanItemCount, true -} - -// SetCleanItemCount sets field value -func (o *Dataset) SetCleanItemCount(v int32) { - o.CleanItemCount = v -} - -// GetActId returns the ActId field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *Dataset) GetActId() string { - if o == nil || IsNil(o.ActId.Get()) { - var ret string - return ret - } - return *o.ActId.Get() -} - -// GetActIdOk returns a tuple with the ActId field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *Dataset) GetActIdOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.ActId.Get(), o.ActId.IsSet() -} - -// HasActId returns a boolean if a field has been set. -func (o *Dataset) HasActId() bool { - if o != nil && o.ActId.IsSet() { - return true - } - - return false -} - -// SetActId gets a reference to the given NullableString and assigns it to the ActId field. -func (o *Dataset) SetActId(v string) { - o.ActId.Set(&v) -} -// SetActIdNil sets the value for ActId to be an explicit nil -func (o *Dataset) SetActIdNil() { - o.ActId.Set(nil) -} - -// UnsetActId ensures that no value is present for ActId, not even an explicit nil -func (o *Dataset) UnsetActId() { - o.ActId.Unset() -} - -// GetActRunId returns the ActRunId field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *Dataset) GetActRunId() string { - if o == nil || IsNil(o.ActRunId.Get()) { - var ret string - return ret - } - return *o.ActRunId.Get() -} - -// GetActRunIdOk returns a tuple with the ActRunId field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *Dataset) GetActRunIdOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.ActRunId.Get(), o.ActRunId.IsSet() -} - -// HasActRunId returns a boolean if a field has been set. -func (o *Dataset) HasActRunId() bool { - if o != nil && o.ActRunId.IsSet() { - return true - } - - return false -} - -// SetActRunId gets a reference to the given NullableString and assigns it to the ActRunId field. -func (o *Dataset) SetActRunId(v string) { - o.ActRunId.Set(&v) -} -// SetActRunIdNil sets the value for ActRunId to be an explicit nil -func (o *Dataset) SetActRunIdNil() { - o.ActRunId.Set(nil) -} - -// UnsetActRunId ensures that no value is present for ActRunId, not even an explicit nil -func (o *Dataset) UnsetActRunId() { - o.ActRunId.Unset() -} - -// GetFields returns the Fields field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *Dataset) GetFields() []string { - if o == nil { - var ret []string - return ret - } - return o.Fields -} - -// GetFieldsOk returns a tuple with the Fields field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *Dataset) GetFieldsOk() ([]string, bool) { - if o == nil || IsNil(o.Fields) { - return nil, false - } - return o.Fields, true -} - -// HasFields returns a boolean if a field has been set. -func (o *Dataset) HasFields() bool { - if o != nil && !IsNil(o.Fields) { - return true - } - - return false -} - -// SetFields gets a reference to the given []string and assigns it to the Fields field. -func (o *Dataset) SetFields(v []string) { - o.Fields = v -} - -// GetSchema returns the Schema field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *Dataset) GetSchema() map[string]interface{} { - if o == nil { - var ret map[string]interface{} - return ret - } - return o.Schema -} - -// GetSchemaOk returns a tuple with the Schema field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *Dataset) GetSchemaOk() (map[string]interface{}, bool) { - if o == nil || IsNil(o.Schema) { - return map[string]interface{}{}, false - } - return o.Schema, true -} - -// HasSchema returns a boolean if a field has been set. -func (o *Dataset) HasSchema() bool { - if o != nil && !IsNil(o.Schema) { - return true - } - - return false -} - -// SetSchema gets a reference to the given map[string]interface{} and assigns it to the Schema field. -func (o *Dataset) SetSchema(v map[string]interface{}) { - o.Schema = v -} - -// GetConsoleUrl returns the ConsoleUrl field value -func (o *Dataset) GetConsoleUrl() string { - if o == nil { - var ret string - return ret - } - - return o.ConsoleUrl -} - -// GetConsoleUrlOk returns a tuple with the ConsoleUrl field value -// and a boolean to check if the value has been set. -func (o *Dataset) GetConsoleUrlOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.ConsoleUrl, true -} - -// SetConsoleUrl sets field value -func (o *Dataset) SetConsoleUrl(v string) { - o.ConsoleUrl = v -} - -// GetItemsPublicUrl returns the ItemsPublicUrl field value if set, zero value otherwise. -func (o *Dataset) GetItemsPublicUrl() string { - if o == nil || IsNil(o.ItemsPublicUrl) { - var ret string - return ret - } - return *o.ItemsPublicUrl -} - -// GetItemsPublicUrlOk returns a tuple with the ItemsPublicUrl field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Dataset) GetItemsPublicUrlOk() (*string, bool) { - if o == nil || IsNil(o.ItemsPublicUrl) { - return nil, false - } - return o.ItemsPublicUrl, true -} - -// HasItemsPublicUrl returns a boolean if a field has been set. -func (o *Dataset) HasItemsPublicUrl() bool { - if o != nil && !IsNil(o.ItemsPublicUrl) { - return true - } - - return false -} - -// SetItemsPublicUrl gets a reference to the given string and assigns it to the ItemsPublicUrl field. -func (o *Dataset) SetItemsPublicUrl(v string) { - o.ItemsPublicUrl = &v -} - -// GetUrlSigningSecretKey returns the UrlSigningSecretKey field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *Dataset) GetUrlSigningSecretKey() string { - if o == nil || IsNil(o.UrlSigningSecretKey.Get()) { - var ret string - return ret - } - return *o.UrlSigningSecretKey.Get() -} - -// GetUrlSigningSecretKeyOk returns a tuple with the UrlSigningSecretKey field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *Dataset) GetUrlSigningSecretKeyOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.UrlSigningSecretKey.Get(), o.UrlSigningSecretKey.IsSet() -} - -// HasUrlSigningSecretKey returns a boolean if a field has been set. -func (o *Dataset) HasUrlSigningSecretKey() bool { - if o != nil && o.UrlSigningSecretKey.IsSet() { - return true - } - - return false -} - -// SetUrlSigningSecretKey gets a reference to the given NullableString and assigns it to the UrlSigningSecretKey field. -func (o *Dataset) SetUrlSigningSecretKey(v string) { - o.UrlSigningSecretKey.Set(&v) -} -// SetUrlSigningSecretKeyNil sets the value for UrlSigningSecretKey to be an explicit nil -func (o *Dataset) SetUrlSigningSecretKeyNil() { - o.UrlSigningSecretKey.Set(nil) -} - -// UnsetUrlSigningSecretKey ensures that no value is present for UrlSigningSecretKey, not even an explicit nil -func (o *Dataset) UnsetUrlSigningSecretKey() { - o.UrlSigningSecretKey.Unset() -} - -// GetGeneralAccess returns the GeneralAccess field value if set, zero value otherwise. -func (o *Dataset) GetGeneralAccess() GeneralAccess { - if o == nil || IsNil(o.GeneralAccess) { - var ret GeneralAccess - return ret - } - return *o.GeneralAccess -} - -// GetGeneralAccessOk returns a tuple with the GeneralAccess field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Dataset) GetGeneralAccessOk() (*GeneralAccess, bool) { - if o == nil || IsNil(o.GeneralAccess) { - return nil, false - } - return o.GeneralAccess, true -} - -// HasGeneralAccess returns a boolean if a field has been set. -func (o *Dataset) HasGeneralAccess() bool { - if o != nil && !IsNil(o.GeneralAccess) { - return true - } - - return false -} - -// SetGeneralAccess gets a reference to the given GeneralAccess and assigns it to the GeneralAccess field. -func (o *Dataset) SetGeneralAccess(v GeneralAccess) { - o.GeneralAccess = &v -} - -// GetStats returns the Stats field value if set, zero value otherwise. -func (o *Dataset) GetStats() DatasetStats { - if o == nil || IsNil(o.Stats) { - var ret DatasetStats - return ret - } - return *o.Stats -} - -// GetStatsOk returns a tuple with the Stats field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Dataset) GetStatsOk() (*DatasetStats, bool) { - if o == nil || IsNil(o.Stats) { - return nil, false - } - return o.Stats, true -} - -// HasStats returns a boolean if a field has been set. -func (o *Dataset) HasStats() bool { - if o != nil && !IsNil(o.Stats) { - return true - } - - return false -} - -// SetStats gets a reference to the given DatasetStats and assigns it to the Stats field. -func (o *Dataset) SetStats(v DatasetStats) { - o.Stats = &v -} - -func (o Dataset) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o Dataset) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["id"] = o.Id - if o.Name.IsSet() { - toSerialize["name"] = o.Name.Get() - } - toSerialize["userId"] = o.UserId - toSerialize["createdAt"] = o.CreatedAt - toSerialize["modifiedAt"] = o.ModifiedAt - toSerialize["accessedAt"] = o.AccessedAt - toSerialize["itemCount"] = o.ItemCount - toSerialize["cleanItemCount"] = o.CleanItemCount - if o.ActId.IsSet() { - toSerialize["actId"] = o.ActId.Get() - } - if o.ActRunId.IsSet() { - toSerialize["actRunId"] = o.ActRunId.Get() - } - if o.Fields != nil { - toSerialize["fields"] = o.Fields - } - if o.Schema != nil { - toSerialize["schema"] = o.Schema - } - toSerialize["consoleUrl"] = o.ConsoleUrl - if !IsNil(o.ItemsPublicUrl) { - toSerialize["itemsPublicUrl"] = o.ItemsPublicUrl - } - if o.UrlSigningSecretKey.IsSet() { - toSerialize["urlSigningSecretKey"] = o.UrlSigningSecretKey.Get() - } - if !IsNil(o.GeneralAccess) { - toSerialize["generalAccess"] = o.GeneralAccess - } - if !IsNil(o.Stats) { - toSerialize["stats"] = o.Stats - } - return toSerialize, nil -} - -func (o *Dataset) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "id", - "userId", - "createdAt", - "modifiedAt", - "accessedAt", - "itemCount", - "cleanItemCount", - "consoleUrl", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err; - } - - for _, requiredProperty := range(requiredProperties) { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varDataset := _Dataset{} - - decoder := json.NewDecoder(bytes.NewReader(data)) - decoder.DisallowUnknownFields() - err = decoder.Decode(&varDataset) - - if err != nil { - return err - } - - *o = Dataset(varDataset) - - return err -} - -type NullableDataset struct { - value *Dataset - isSet bool -} - -func (v NullableDataset) Get() *Dataset { - return v.value -} - -func (v *NullableDataset) Set(val *Dataset) { - v.value = val - v.isSet = true -} - -func (v NullableDataset) IsSet() bool { - return v.isSet -} - -func (v *NullableDataset) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableDataset(val *Dataset) *NullableDataset { - return &NullableDataset{value: val, isSet: true} -} - -func (v NullableDataset) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableDataset) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_dataset_field_statistics.go b/model_dataset_field_statistics.go deleted file mode 100644 index 74ccb35..0000000 --- a/model_dataset_field_statistics.go +++ /dev/null @@ -1,278 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" -) - -// checks if the DatasetFieldStatistics type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &DatasetFieldStatistics{} - -// DatasetFieldStatistics struct for DatasetFieldStatistics -type DatasetFieldStatistics struct { - // Minimum value of the field. For numbers, this is calculated directly. For strings, this is the length of the shortest string. For arrays, this is the length of the shortest array. For objects, this is the number of keys in the smallest object. - Min NullableFloat32 `json:"min,omitempty"` - // Maximum value of the field. For numbers, this is calculated directly. For strings, this is the length of the longest string. For arrays, this is the length of the longest array. For objects, this is the number of keys in the largest object. - Max NullableFloat32 `json:"max,omitempty"` - // How many items in the dataset have a null value for this field. - NullCount NullableInt32 `json:"nullCount,omitempty"` - // How many items in the dataset are `undefined`, meaning that for example empty string is not considered empty. - EmptyCount NullableInt32 `json:"emptyCount,omitempty"` -} - -// NewDatasetFieldStatistics instantiates a new DatasetFieldStatistics object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewDatasetFieldStatistics() *DatasetFieldStatistics { - this := DatasetFieldStatistics{} - return &this -} - -// NewDatasetFieldStatisticsWithDefaults instantiates a new DatasetFieldStatistics object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewDatasetFieldStatisticsWithDefaults() *DatasetFieldStatistics { - this := DatasetFieldStatistics{} - return &this -} - -// GetMin returns the Min field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *DatasetFieldStatistics) GetMin() float32 { - if o == nil || IsNil(o.Min.Get()) { - var ret float32 - return ret - } - return *o.Min.Get() -} - -// GetMinOk returns a tuple with the Min field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *DatasetFieldStatistics) GetMinOk() (*float32, bool) { - if o == nil { - return nil, false - } - return o.Min.Get(), o.Min.IsSet() -} - -// HasMin returns a boolean if a field has been set. -func (o *DatasetFieldStatistics) HasMin() bool { - if o != nil && o.Min.IsSet() { - return true - } - - return false -} - -// SetMin gets a reference to the given NullableFloat32 and assigns it to the Min field. -func (o *DatasetFieldStatistics) SetMin(v float32) { - o.Min.Set(&v) -} -// SetMinNil sets the value for Min to be an explicit nil -func (o *DatasetFieldStatistics) SetMinNil() { - o.Min.Set(nil) -} - -// UnsetMin ensures that no value is present for Min, not even an explicit nil -func (o *DatasetFieldStatistics) UnsetMin() { - o.Min.Unset() -} - -// GetMax returns the Max field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *DatasetFieldStatistics) GetMax() float32 { - if o == nil || IsNil(o.Max.Get()) { - var ret float32 - return ret - } - return *o.Max.Get() -} - -// GetMaxOk returns a tuple with the Max field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *DatasetFieldStatistics) GetMaxOk() (*float32, bool) { - if o == nil { - return nil, false - } - return o.Max.Get(), o.Max.IsSet() -} - -// HasMax returns a boolean if a field has been set. -func (o *DatasetFieldStatistics) HasMax() bool { - if o != nil && o.Max.IsSet() { - return true - } - - return false -} - -// SetMax gets a reference to the given NullableFloat32 and assigns it to the Max field. -func (o *DatasetFieldStatistics) SetMax(v float32) { - o.Max.Set(&v) -} -// SetMaxNil sets the value for Max to be an explicit nil -func (o *DatasetFieldStatistics) SetMaxNil() { - o.Max.Set(nil) -} - -// UnsetMax ensures that no value is present for Max, not even an explicit nil -func (o *DatasetFieldStatistics) UnsetMax() { - o.Max.Unset() -} - -// GetNullCount returns the NullCount field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *DatasetFieldStatistics) GetNullCount() int32 { - if o == nil || IsNil(o.NullCount.Get()) { - var ret int32 - return ret - } - return *o.NullCount.Get() -} - -// GetNullCountOk returns a tuple with the NullCount field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *DatasetFieldStatistics) GetNullCountOk() (*int32, bool) { - if o == nil { - return nil, false - } - return o.NullCount.Get(), o.NullCount.IsSet() -} - -// HasNullCount returns a boolean if a field has been set. -func (o *DatasetFieldStatistics) HasNullCount() bool { - if o != nil && o.NullCount.IsSet() { - return true - } - - return false -} - -// SetNullCount gets a reference to the given NullableInt32 and assigns it to the NullCount field. -func (o *DatasetFieldStatistics) SetNullCount(v int32) { - o.NullCount.Set(&v) -} -// SetNullCountNil sets the value for NullCount to be an explicit nil -func (o *DatasetFieldStatistics) SetNullCountNil() { - o.NullCount.Set(nil) -} - -// UnsetNullCount ensures that no value is present for NullCount, not even an explicit nil -func (o *DatasetFieldStatistics) UnsetNullCount() { - o.NullCount.Unset() -} - -// GetEmptyCount returns the EmptyCount field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *DatasetFieldStatistics) GetEmptyCount() int32 { - if o == nil || IsNil(o.EmptyCount.Get()) { - var ret int32 - return ret - } - return *o.EmptyCount.Get() -} - -// GetEmptyCountOk returns a tuple with the EmptyCount field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *DatasetFieldStatistics) GetEmptyCountOk() (*int32, bool) { - if o == nil { - return nil, false - } - return o.EmptyCount.Get(), o.EmptyCount.IsSet() -} - -// HasEmptyCount returns a boolean if a field has been set. -func (o *DatasetFieldStatistics) HasEmptyCount() bool { - if o != nil && o.EmptyCount.IsSet() { - return true - } - - return false -} - -// SetEmptyCount gets a reference to the given NullableInt32 and assigns it to the EmptyCount field. -func (o *DatasetFieldStatistics) SetEmptyCount(v int32) { - o.EmptyCount.Set(&v) -} -// SetEmptyCountNil sets the value for EmptyCount to be an explicit nil -func (o *DatasetFieldStatistics) SetEmptyCountNil() { - o.EmptyCount.Set(nil) -} - -// UnsetEmptyCount ensures that no value is present for EmptyCount, not even an explicit nil -func (o *DatasetFieldStatistics) UnsetEmptyCount() { - o.EmptyCount.Unset() -} - -func (o DatasetFieldStatistics) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o DatasetFieldStatistics) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if o.Min.IsSet() { - toSerialize["min"] = o.Min.Get() - } - if o.Max.IsSet() { - toSerialize["max"] = o.Max.Get() - } - if o.NullCount.IsSet() { - toSerialize["nullCount"] = o.NullCount.Get() - } - if o.EmptyCount.IsSet() { - toSerialize["emptyCount"] = o.EmptyCount.Get() - } - return toSerialize, nil -} - -type NullableDatasetFieldStatistics struct { - value *DatasetFieldStatistics - isSet bool -} - -func (v NullableDatasetFieldStatistics) Get() *DatasetFieldStatistics { - return v.value -} - -func (v *NullableDatasetFieldStatistics) Set(val *DatasetFieldStatistics) { - v.value = val - v.isSet = true -} - -func (v NullableDatasetFieldStatistics) IsSet() bool { - return v.isSet -} - -func (v *NullableDatasetFieldStatistics) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableDatasetFieldStatistics(val *DatasetFieldStatistics) *NullableDatasetFieldStatistics { - return &NullableDatasetFieldStatistics{value: val, isSet: true} -} - -func (v NullableDatasetFieldStatistics) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableDatasetFieldStatistics) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_dataset_list_item.go b/model_dataset_list_item.go deleted file mode 100644 index 302ffc1..0000000 --- a/model_dataset_list_item.go +++ /dev/null @@ -1,601 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" - "time" - "bytes" - "fmt" -) - -// checks if the DatasetListItem type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &DatasetListItem{} - -// DatasetListItem struct for DatasetListItem -type DatasetListItem struct { - Id string `json:"id"` - Name string `json:"name"` - UserId string `json:"userId"` - CreatedAt time.Time `json:"createdAt"` - ModifiedAt time.Time `json:"modifiedAt"` - AccessedAt time.Time `json:"accessedAt"` - ItemCount int32 `json:"itemCount"` - CleanItemCount int32 `json:"cleanItemCount"` - ActId NullableString `json:"actId,omitempty"` - ActRunId NullableString `json:"actRunId,omitempty"` - Title NullableString `json:"title,omitempty"` - Username *string `json:"username,omitempty"` - GeneralAccess *GeneralAccess `json:"generalAccess,omitempty"` - Stats *DatasetStats `json:"stats,omitempty"` -} - -type _DatasetListItem DatasetListItem - -// NewDatasetListItem instantiates a new DatasetListItem object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewDatasetListItem(id string, name string, userId string, createdAt time.Time, modifiedAt time.Time, accessedAt time.Time, itemCount int32, cleanItemCount int32) *DatasetListItem { - this := DatasetListItem{} - this.Id = id - this.Name = name - this.UserId = userId - this.CreatedAt = createdAt - this.ModifiedAt = modifiedAt - this.AccessedAt = accessedAt - this.ItemCount = itemCount - this.CleanItemCount = cleanItemCount - return &this -} - -// NewDatasetListItemWithDefaults instantiates a new DatasetListItem object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewDatasetListItemWithDefaults() *DatasetListItem { - this := DatasetListItem{} - return &this -} - -// GetId returns the Id field value -func (o *DatasetListItem) GetId() string { - if o == nil { - var ret string - return ret - } - - return o.Id -} - -// GetIdOk returns a tuple with the Id field value -// and a boolean to check if the value has been set. -func (o *DatasetListItem) GetIdOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Id, true -} - -// SetId sets field value -func (o *DatasetListItem) SetId(v string) { - o.Id = v -} - -// GetName returns the Name field value -func (o *DatasetListItem) GetName() string { - if o == nil { - var ret string - return ret - } - - return o.Name -} - -// GetNameOk returns a tuple with the Name field value -// and a boolean to check if the value has been set. -func (o *DatasetListItem) GetNameOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Name, true -} - -// SetName sets field value -func (o *DatasetListItem) SetName(v string) { - o.Name = v -} - -// GetUserId returns the UserId field value -func (o *DatasetListItem) GetUserId() string { - if o == nil { - var ret string - return ret - } - - return o.UserId -} - -// GetUserIdOk returns a tuple with the UserId field value -// and a boolean to check if the value has been set. -func (o *DatasetListItem) GetUserIdOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.UserId, true -} - -// SetUserId sets field value -func (o *DatasetListItem) SetUserId(v string) { - o.UserId = v -} - -// GetCreatedAt returns the CreatedAt field value -func (o *DatasetListItem) GetCreatedAt() time.Time { - if o == nil { - var ret time.Time - return ret - } - - return o.CreatedAt -} - -// GetCreatedAtOk returns a tuple with the CreatedAt field value -// and a boolean to check if the value has been set. -func (o *DatasetListItem) GetCreatedAtOk() (*time.Time, bool) { - if o == nil { - return nil, false - } - return &o.CreatedAt, true -} - -// SetCreatedAt sets field value -func (o *DatasetListItem) SetCreatedAt(v time.Time) { - o.CreatedAt = v -} - -// GetModifiedAt returns the ModifiedAt field value -func (o *DatasetListItem) GetModifiedAt() time.Time { - if o == nil { - var ret time.Time - return ret - } - - return o.ModifiedAt -} - -// GetModifiedAtOk returns a tuple with the ModifiedAt field value -// and a boolean to check if the value has been set. -func (o *DatasetListItem) GetModifiedAtOk() (*time.Time, bool) { - if o == nil { - return nil, false - } - return &o.ModifiedAt, true -} - -// SetModifiedAt sets field value -func (o *DatasetListItem) SetModifiedAt(v time.Time) { - o.ModifiedAt = v -} - -// GetAccessedAt returns the AccessedAt field value -func (o *DatasetListItem) GetAccessedAt() time.Time { - if o == nil { - var ret time.Time - return ret - } - - return o.AccessedAt -} - -// GetAccessedAtOk returns a tuple with the AccessedAt field value -// and a boolean to check if the value has been set. -func (o *DatasetListItem) GetAccessedAtOk() (*time.Time, bool) { - if o == nil { - return nil, false - } - return &o.AccessedAt, true -} - -// SetAccessedAt sets field value -func (o *DatasetListItem) SetAccessedAt(v time.Time) { - o.AccessedAt = v -} - -// GetItemCount returns the ItemCount field value -func (o *DatasetListItem) GetItemCount() int32 { - if o == nil { - var ret int32 - return ret - } - - return o.ItemCount -} - -// GetItemCountOk returns a tuple with the ItemCount field value -// and a boolean to check if the value has been set. -func (o *DatasetListItem) GetItemCountOk() (*int32, bool) { - if o == nil { - return nil, false - } - return &o.ItemCount, true -} - -// SetItemCount sets field value -func (o *DatasetListItem) SetItemCount(v int32) { - o.ItemCount = v -} - -// GetCleanItemCount returns the CleanItemCount field value -func (o *DatasetListItem) GetCleanItemCount() int32 { - if o == nil { - var ret int32 - return ret - } - - return o.CleanItemCount -} - -// GetCleanItemCountOk returns a tuple with the CleanItemCount field value -// and a boolean to check if the value has been set. -func (o *DatasetListItem) GetCleanItemCountOk() (*int32, bool) { - if o == nil { - return nil, false - } - return &o.CleanItemCount, true -} - -// SetCleanItemCount sets field value -func (o *DatasetListItem) SetCleanItemCount(v int32) { - o.CleanItemCount = v -} - -// GetActId returns the ActId field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *DatasetListItem) GetActId() string { - if o == nil || IsNil(o.ActId.Get()) { - var ret string - return ret - } - return *o.ActId.Get() -} - -// GetActIdOk returns a tuple with the ActId field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *DatasetListItem) GetActIdOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.ActId.Get(), o.ActId.IsSet() -} - -// HasActId returns a boolean if a field has been set. -func (o *DatasetListItem) HasActId() bool { - if o != nil && o.ActId.IsSet() { - return true - } - - return false -} - -// SetActId gets a reference to the given NullableString and assigns it to the ActId field. -func (o *DatasetListItem) SetActId(v string) { - o.ActId.Set(&v) -} -// SetActIdNil sets the value for ActId to be an explicit nil -func (o *DatasetListItem) SetActIdNil() { - o.ActId.Set(nil) -} - -// UnsetActId ensures that no value is present for ActId, not even an explicit nil -func (o *DatasetListItem) UnsetActId() { - o.ActId.Unset() -} - -// GetActRunId returns the ActRunId field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *DatasetListItem) GetActRunId() string { - if o == nil || IsNil(o.ActRunId.Get()) { - var ret string - return ret - } - return *o.ActRunId.Get() -} - -// GetActRunIdOk returns a tuple with the ActRunId field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *DatasetListItem) GetActRunIdOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.ActRunId.Get(), o.ActRunId.IsSet() -} - -// HasActRunId returns a boolean if a field has been set. -func (o *DatasetListItem) HasActRunId() bool { - if o != nil && o.ActRunId.IsSet() { - return true - } - - return false -} - -// SetActRunId gets a reference to the given NullableString and assigns it to the ActRunId field. -func (o *DatasetListItem) SetActRunId(v string) { - o.ActRunId.Set(&v) -} -// SetActRunIdNil sets the value for ActRunId to be an explicit nil -func (o *DatasetListItem) SetActRunIdNil() { - o.ActRunId.Set(nil) -} - -// UnsetActRunId ensures that no value is present for ActRunId, not even an explicit nil -func (o *DatasetListItem) UnsetActRunId() { - o.ActRunId.Unset() -} - -// GetTitle returns the Title field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *DatasetListItem) GetTitle() string { - if o == nil || IsNil(o.Title.Get()) { - var ret string - return ret - } - return *o.Title.Get() -} - -// GetTitleOk returns a tuple with the Title field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *DatasetListItem) GetTitleOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.Title.Get(), o.Title.IsSet() -} - -// HasTitle returns a boolean if a field has been set. -func (o *DatasetListItem) HasTitle() bool { - if o != nil && o.Title.IsSet() { - return true - } - - return false -} - -// SetTitle gets a reference to the given NullableString and assigns it to the Title field. -func (o *DatasetListItem) SetTitle(v string) { - o.Title.Set(&v) -} -// SetTitleNil sets the value for Title to be an explicit nil -func (o *DatasetListItem) SetTitleNil() { - o.Title.Set(nil) -} - -// UnsetTitle ensures that no value is present for Title, not even an explicit nil -func (o *DatasetListItem) UnsetTitle() { - o.Title.Unset() -} - -// GetUsername returns the Username field value if set, zero value otherwise. -func (o *DatasetListItem) GetUsername() string { - if o == nil || IsNil(o.Username) { - var ret string - return ret - } - return *o.Username -} - -// GetUsernameOk returns a tuple with the Username field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *DatasetListItem) GetUsernameOk() (*string, bool) { - if o == nil || IsNil(o.Username) { - return nil, false - } - return o.Username, true -} - -// HasUsername returns a boolean if a field has been set. -func (o *DatasetListItem) HasUsername() bool { - if o != nil && !IsNil(o.Username) { - return true - } - - return false -} - -// SetUsername gets a reference to the given string and assigns it to the Username field. -func (o *DatasetListItem) SetUsername(v string) { - o.Username = &v -} - -// GetGeneralAccess returns the GeneralAccess field value if set, zero value otherwise. -func (o *DatasetListItem) GetGeneralAccess() GeneralAccess { - if o == nil || IsNil(o.GeneralAccess) { - var ret GeneralAccess - return ret - } - return *o.GeneralAccess -} - -// GetGeneralAccessOk returns a tuple with the GeneralAccess field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *DatasetListItem) GetGeneralAccessOk() (*GeneralAccess, bool) { - if o == nil || IsNil(o.GeneralAccess) { - return nil, false - } - return o.GeneralAccess, true -} - -// HasGeneralAccess returns a boolean if a field has been set. -func (o *DatasetListItem) HasGeneralAccess() bool { - if o != nil && !IsNil(o.GeneralAccess) { - return true - } - - return false -} - -// SetGeneralAccess gets a reference to the given GeneralAccess and assigns it to the GeneralAccess field. -func (o *DatasetListItem) SetGeneralAccess(v GeneralAccess) { - o.GeneralAccess = &v -} - -// GetStats returns the Stats field value if set, zero value otherwise. -func (o *DatasetListItem) GetStats() DatasetStats { - if o == nil || IsNil(o.Stats) { - var ret DatasetStats - return ret - } - return *o.Stats -} - -// GetStatsOk returns a tuple with the Stats field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *DatasetListItem) GetStatsOk() (*DatasetStats, bool) { - if o == nil || IsNil(o.Stats) { - return nil, false - } - return o.Stats, true -} - -// HasStats returns a boolean if a field has been set. -func (o *DatasetListItem) HasStats() bool { - if o != nil && !IsNil(o.Stats) { - return true - } - - return false -} - -// SetStats gets a reference to the given DatasetStats and assigns it to the Stats field. -func (o *DatasetListItem) SetStats(v DatasetStats) { - o.Stats = &v -} - -func (o DatasetListItem) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o DatasetListItem) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["id"] = o.Id - toSerialize["name"] = o.Name - toSerialize["userId"] = o.UserId - toSerialize["createdAt"] = o.CreatedAt - toSerialize["modifiedAt"] = o.ModifiedAt - toSerialize["accessedAt"] = o.AccessedAt - toSerialize["itemCount"] = o.ItemCount - toSerialize["cleanItemCount"] = o.CleanItemCount - if o.ActId.IsSet() { - toSerialize["actId"] = o.ActId.Get() - } - if o.ActRunId.IsSet() { - toSerialize["actRunId"] = o.ActRunId.Get() - } - if o.Title.IsSet() { - toSerialize["title"] = o.Title.Get() - } - if !IsNil(o.Username) { - toSerialize["username"] = o.Username - } - if !IsNil(o.GeneralAccess) { - toSerialize["generalAccess"] = o.GeneralAccess - } - if !IsNil(o.Stats) { - toSerialize["stats"] = o.Stats - } - return toSerialize, nil -} - -func (o *DatasetListItem) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "id", - "name", - "userId", - "createdAt", - "modifiedAt", - "accessedAt", - "itemCount", - "cleanItemCount", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err; - } - - for _, requiredProperty := range(requiredProperties) { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varDatasetListItem := _DatasetListItem{} - - decoder := json.NewDecoder(bytes.NewReader(data)) - decoder.DisallowUnknownFields() - err = decoder.Decode(&varDatasetListItem) - - if err != nil { - return err - } - - *o = DatasetListItem(varDatasetListItem) - - return err -} - -type NullableDatasetListItem struct { - value *DatasetListItem - isSet bool -} - -func (v NullableDatasetListItem) Get() *DatasetListItem { - return v.value -} - -func (v *NullableDatasetListItem) Set(val *DatasetListItem) { - v.value = val - v.isSet = true -} - -func (v NullableDatasetListItem) IsSet() bool { - return v.isSet -} - -func (v *NullableDatasetListItem) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableDatasetListItem(val *DatasetListItem) *NullableDatasetListItem { - return &NullableDatasetListItem{value: val, isSet: true} -} - -func (v NullableDatasetListItem) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableDatasetListItem) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_dataset_response.go b/model_dataset_response.go deleted file mode 100644 index ba2d9c6..0000000 --- a/model_dataset_response.go +++ /dev/null @@ -1,158 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" - "bytes" - "fmt" -) - -// checks if the DatasetResponse type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &DatasetResponse{} - -// DatasetResponse Response containing dataset metadata. -type DatasetResponse struct { - Data Dataset `json:"data"` -} - -type _DatasetResponse DatasetResponse - -// NewDatasetResponse instantiates a new DatasetResponse object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewDatasetResponse(data Dataset) *DatasetResponse { - this := DatasetResponse{} - this.Data = data - return &this -} - -// NewDatasetResponseWithDefaults instantiates a new DatasetResponse object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewDatasetResponseWithDefaults() *DatasetResponse { - this := DatasetResponse{} - return &this -} - -// GetData returns the Data field value -func (o *DatasetResponse) GetData() Dataset { - if o == nil { - var ret Dataset - return ret - } - - return o.Data -} - -// GetDataOk returns a tuple with the Data field value -// and a boolean to check if the value has been set. -func (o *DatasetResponse) GetDataOk() (*Dataset, bool) { - if o == nil { - return nil, false - } - return &o.Data, true -} - -// SetData sets field value -func (o *DatasetResponse) SetData(v Dataset) { - o.Data = v -} - -func (o DatasetResponse) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o DatasetResponse) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["data"] = o.Data - return toSerialize, nil -} - -func (o *DatasetResponse) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "data", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err; - } - - for _, requiredProperty := range(requiredProperties) { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varDatasetResponse := _DatasetResponse{} - - decoder := json.NewDecoder(bytes.NewReader(data)) - decoder.DisallowUnknownFields() - err = decoder.Decode(&varDatasetResponse) - - if err != nil { - return err - } - - *o = DatasetResponse(varDatasetResponse) - - return err -} - -type NullableDatasetResponse struct { - value *DatasetResponse - isSet bool -} - -func (v NullableDatasetResponse) Get() *DatasetResponse { - return v.value -} - -func (v *NullableDatasetResponse) Set(val *DatasetResponse) { - v.value = val - v.isSet = true -} - -func (v NullableDatasetResponse) IsSet() bool { - return v.isSet -} - -func (v *NullableDatasetResponse) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableDatasetResponse(val *DatasetResponse) *NullableDatasetResponse { - return &NullableDatasetResponse{value: val, isSet: true} -} - -func (v NullableDatasetResponse) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableDatasetResponse) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_dataset_schema_validation_error.go b/model_dataset_schema_validation_error.go deleted file mode 100644 index 67c0de6..0000000 --- a/model_dataset_schema_validation_error.go +++ /dev/null @@ -1,200 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" -) - -// checks if the DatasetSchemaValidationError type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &DatasetSchemaValidationError{} - -// DatasetSchemaValidationError struct for DatasetSchemaValidationError -type DatasetSchemaValidationError struct { - // The type of the error. - Type *string `json:"type,omitempty"` - // A human-readable message describing the error. - Message *string `json:"message,omitempty"` - Data *SchemaValidationErrorData `json:"data,omitempty"` -} - -// NewDatasetSchemaValidationError instantiates a new DatasetSchemaValidationError object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewDatasetSchemaValidationError() *DatasetSchemaValidationError { - this := DatasetSchemaValidationError{} - return &this -} - -// NewDatasetSchemaValidationErrorWithDefaults instantiates a new DatasetSchemaValidationError object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewDatasetSchemaValidationErrorWithDefaults() *DatasetSchemaValidationError { - this := DatasetSchemaValidationError{} - return &this -} - -// GetType returns the Type field value if set, zero value otherwise. -func (o *DatasetSchemaValidationError) GetType() string { - if o == nil || IsNil(o.Type) { - var ret string - return ret - } - return *o.Type -} - -// GetTypeOk returns a tuple with the Type field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *DatasetSchemaValidationError) GetTypeOk() (*string, bool) { - if o == nil || IsNil(o.Type) { - return nil, false - } - return o.Type, true -} - -// HasType returns a boolean if a field has been set. -func (o *DatasetSchemaValidationError) HasType() bool { - if o != nil && !IsNil(o.Type) { - return true - } - - return false -} - -// SetType gets a reference to the given string and assigns it to the Type field. -func (o *DatasetSchemaValidationError) SetType(v string) { - o.Type = &v -} - -// GetMessage returns the Message field value if set, zero value otherwise. -func (o *DatasetSchemaValidationError) GetMessage() string { - if o == nil || IsNil(o.Message) { - var ret string - return ret - } - return *o.Message -} - -// GetMessageOk returns a tuple with the Message field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *DatasetSchemaValidationError) GetMessageOk() (*string, bool) { - if o == nil || IsNil(o.Message) { - return nil, false - } - return o.Message, true -} - -// HasMessage returns a boolean if a field has been set. -func (o *DatasetSchemaValidationError) HasMessage() bool { - if o != nil && !IsNil(o.Message) { - return true - } - - return false -} - -// SetMessage gets a reference to the given string and assigns it to the Message field. -func (o *DatasetSchemaValidationError) SetMessage(v string) { - o.Message = &v -} - -// GetData returns the Data field value if set, zero value otherwise. -func (o *DatasetSchemaValidationError) GetData() SchemaValidationErrorData { - if o == nil || IsNil(o.Data) { - var ret SchemaValidationErrorData - return ret - } - return *o.Data -} - -// GetDataOk returns a tuple with the Data field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *DatasetSchemaValidationError) GetDataOk() (*SchemaValidationErrorData, bool) { - if o == nil || IsNil(o.Data) { - return nil, false - } - return o.Data, true -} - -// HasData returns a boolean if a field has been set. -func (o *DatasetSchemaValidationError) HasData() bool { - if o != nil && !IsNil(o.Data) { - return true - } - - return false -} - -// SetData gets a reference to the given SchemaValidationErrorData and assigns it to the Data field. -func (o *DatasetSchemaValidationError) SetData(v SchemaValidationErrorData) { - o.Data = &v -} - -func (o DatasetSchemaValidationError) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o DatasetSchemaValidationError) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if !IsNil(o.Type) { - toSerialize["type"] = o.Type - } - if !IsNil(o.Message) { - toSerialize["message"] = o.Message - } - if !IsNil(o.Data) { - toSerialize["data"] = o.Data - } - return toSerialize, nil -} - -type NullableDatasetSchemaValidationError struct { - value *DatasetSchemaValidationError - isSet bool -} - -func (v NullableDatasetSchemaValidationError) Get() *DatasetSchemaValidationError { - return v.value -} - -func (v *NullableDatasetSchemaValidationError) Set(val *DatasetSchemaValidationError) { - v.value = val - v.isSet = true -} - -func (v NullableDatasetSchemaValidationError) IsSet() bool { - return v.isSet -} - -func (v *NullableDatasetSchemaValidationError) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableDatasetSchemaValidationError(val *DatasetSchemaValidationError) *NullableDatasetSchemaValidationError { - return &NullableDatasetSchemaValidationError{value: val, isSet: true} -} - -func (v NullableDatasetSchemaValidationError) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableDatasetSchemaValidationError) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_dataset_statistics.go b/model_dataset_statistics.go deleted file mode 100644 index 6f2fa66..0000000 --- a/model_dataset_statistics.go +++ /dev/null @@ -1,127 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" -) - -// checks if the DatasetStatistics type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &DatasetStatistics{} - -// DatasetStatistics struct for DatasetStatistics -type DatasetStatistics struct { - // When you configure the dataset [fields schema](https://docs.apify.com/platform/actors/development/actor-definition/dataset-schema/validation), we measure the statistics such as `min`, `max`, `nullCount` and `emptyCount` for each field. This property provides statistics for each field from dataset fields schema. <br/></br>See dataset field statistics [documentation](https://docs.apify.com/platform/actors/development/actor-definition/dataset-schema/validation#dataset-field-statistics) for more information. - FieldStatistics map[string]DatasetFieldStatistics `json:"fieldStatistics,omitempty"` -} - -// NewDatasetStatistics instantiates a new DatasetStatistics object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewDatasetStatistics() *DatasetStatistics { - this := DatasetStatistics{} - return &this -} - -// NewDatasetStatisticsWithDefaults instantiates a new DatasetStatistics object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewDatasetStatisticsWithDefaults() *DatasetStatistics { - this := DatasetStatistics{} - return &this -} - -// GetFieldStatistics returns the FieldStatistics field value if set, zero value otherwise. -func (o *DatasetStatistics) GetFieldStatistics() map[string]DatasetFieldStatistics { - if o == nil || IsNil(o.FieldStatistics) { - var ret map[string]DatasetFieldStatistics - return ret - } - return o.FieldStatistics -} - -// GetFieldStatisticsOk returns a tuple with the FieldStatistics field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *DatasetStatistics) GetFieldStatisticsOk() (map[string]DatasetFieldStatistics, bool) { - if o == nil || IsNil(o.FieldStatistics) { - return map[string]DatasetFieldStatistics{}, false - } - return o.FieldStatistics, true -} - -// HasFieldStatistics returns a boolean if a field has been set. -func (o *DatasetStatistics) HasFieldStatistics() bool { - if o != nil && !IsNil(o.FieldStatistics) { - return true - } - - return false -} - -// SetFieldStatistics gets a reference to the given map[string]DatasetFieldStatistics and assigns it to the FieldStatistics field. -func (o *DatasetStatistics) SetFieldStatistics(v map[string]DatasetFieldStatistics) { - o.FieldStatistics = v -} - -func (o DatasetStatistics) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o DatasetStatistics) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if !IsNil(o.FieldStatistics) { - toSerialize["fieldStatistics"] = o.FieldStatistics - } - return toSerialize, nil -} - -type NullableDatasetStatistics struct { - value *DatasetStatistics - isSet bool -} - -func (v NullableDatasetStatistics) Get() *DatasetStatistics { - return v.value -} - -func (v *NullableDatasetStatistics) Set(val *DatasetStatistics) { - v.value = val - v.isSet = true -} - -func (v NullableDatasetStatistics) IsSet() bool { - return v.isSet -} - -func (v *NullableDatasetStatistics) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableDatasetStatistics(val *DatasetStatistics) *NullableDatasetStatistics { - return &NullableDatasetStatistics{value: val, isSet: true} -} - -func (v NullableDatasetStatistics) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableDatasetStatistics) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_dataset_statistics_response.go b/model_dataset_statistics_response.go deleted file mode 100644 index a28c5bc..0000000 --- a/model_dataset_statistics_response.go +++ /dev/null @@ -1,158 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" - "bytes" - "fmt" -) - -// checks if the DatasetStatisticsResponse type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &DatasetStatisticsResponse{} - -// DatasetStatisticsResponse struct for DatasetStatisticsResponse -type DatasetStatisticsResponse struct { - Data DatasetStatistics `json:"data"` -} - -type _DatasetStatisticsResponse DatasetStatisticsResponse - -// NewDatasetStatisticsResponse instantiates a new DatasetStatisticsResponse object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewDatasetStatisticsResponse(data DatasetStatistics) *DatasetStatisticsResponse { - this := DatasetStatisticsResponse{} - this.Data = data - return &this -} - -// NewDatasetStatisticsResponseWithDefaults instantiates a new DatasetStatisticsResponse object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewDatasetStatisticsResponseWithDefaults() *DatasetStatisticsResponse { - this := DatasetStatisticsResponse{} - return &this -} - -// GetData returns the Data field value -func (o *DatasetStatisticsResponse) GetData() DatasetStatistics { - if o == nil { - var ret DatasetStatistics - return ret - } - - return o.Data -} - -// GetDataOk returns a tuple with the Data field value -// and a boolean to check if the value has been set. -func (o *DatasetStatisticsResponse) GetDataOk() (*DatasetStatistics, bool) { - if o == nil { - return nil, false - } - return &o.Data, true -} - -// SetData sets field value -func (o *DatasetStatisticsResponse) SetData(v DatasetStatistics) { - o.Data = v -} - -func (o DatasetStatisticsResponse) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o DatasetStatisticsResponse) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["data"] = o.Data - return toSerialize, nil -} - -func (o *DatasetStatisticsResponse) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "data", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err; - } - - for _, requiredProperty := range(requiredProperties) { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varDatasetStatisticsResponse := _DatasetStatisticsResponse{} - - decoder := json.NewDecoder(bytes.NewReader(data)) - decoder.DisallowUnknownFields() - err = decoder.Decode(&varDatasetStatisticsResponse) - - if err != nil { - return err - } - - *o = DatasetStatisticsResponse(varDatasetStatisticsResponse) - - return err -} - -type NullableDatasetStatisticsResponse struct { - value *DatasetStatisticsResponse - isSet bool -} - -func (v NullableDatasetStatisticsResponse) Get() *DatasetStatisticsResponse { - return v.value -} - -func (v *NullableDatasetStatisticsResponse) Set(val *DatasetStatisticsResponse) { - v.value = val - v.isSet = true -} - -func (v NullableDatasetStatisticsResponse) IsSet() bool { - return v.isSet -} - -func (v *NullableDatasetStatisticsResponse) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableDatasetStatisticsResponse(val *DatasetStatisticsResponse) *NullableDatasetStatisticsResponse { - return &NullableDatasetStatisticsResponse{value: val, isSet: true} -} - -func (v NullableDatasetStatisticsResponse) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableDatasetStatisticsResponse) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_dataset_stats.go b/model_dataset_stats.go deleted file mode 100644 index f54b52f..0000000 --- a/model_dataset_stats.go +++ /dev/null @@ -1,236 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" -) - -// checks if the DatasetStats type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &DatasetStats{} - -// DatasetStats struct for DatasetStats -type DatasetStats struct { - ReadCount *int32 `json:"readCount,omitempty"` - WriteCount *int32 `json:"writeCount,omitempty"` - // Total storage size in bytes. Only returned by the single-dataset endpoint. - StorageBytes *int32 `json:"storageBytes,omitempty"` - // Uncompressed size in bytes. Only returned by the dataset list endpoint. - InflatedBytes *int32 `json:"inflatedBytes,omitempty"` -} - -// NewDatasetStats instantiates a new DatasetStats object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewDatasetStats() *DatasetStats { - this := DatasetStats{} - return &this -} - -// NewDatasetStatsWithDefaults instantiates a new DatasetStats object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewDatasetStatsWithDefaults() *DatasetStats { - this := DatasetStats{} - return &this -} - -// GetReadCount returns the ReadCount field value if set, zero value otherwise. -func (o *DatasetStats) GetReadCount() int32 { - if o == nil || IsNil(o.ReadCount) { - var ret int32 - return ret - } - return *o.ReadCount -} - -// GetReadCountOk returns a tuple with the ReadCount field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *DatasetStats) GetReadCountOk() (*int32, bool) { - if o == nil || IsNil(o.ReadCount) { - return nil, false - } - return o.ReadCount, true -} - -// HasReadCount returns a boolean if a field has been set. -func (o *DatasetStats) HasReadCount() bool { - if o != nil && !IsNil(o.ReadCount) { - return true - } - - return false -} - -// SetReadCount gets a reference to the given int32 and assigns it to the ReadCount field. -func (o *DatasetStats) SetReadCount(v int32) { - o.ReadCount = &v -} - -// GetWriteCount returns the WriteCount field value if set, zero value otherwise. -func (o *DatasetStats) GetWriteCount() int32 { - if o == nil || IsNil(o.WriteCount) { - var ret int32 - return ret - } - return *o.WriteCount -} - -// GetWriteCountOk returns a tuple with the WriteCount field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *DatasetStats) GetWriteCountOk() (*int32, bool) { - if o == nil || IsNil(o.WriteCount) { - return nil, false - } - return o.WriteCount, true -} - -// HasWriteCount returns a boolean if a field has been set. -func (o *DatasetStats) HasWriteCount() bool { - if o != nil && !IsNil(o.WriteCount) { - return true - } - - return false -} - -// SetWriteCount gets a reference to the given int32 and assigns it to the WriteCount field. -func (o *DatasetStats) SetWriteCount(v int32) { - o.WriteCount = &v -} - -// GetStorageBytes returns the StorageBytes field value if set, zero value otherwise. -func (o *DatasetStats) GetStorageBytes() int32 { - if o == nil || IsNil(o.StorageBytes) { - var ret int32 - return ret - } - return *o.StorageBytes -} - -// GetStorageBytesOk returns a tuple with the StorageBytes field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *DatasetStats) GetStorageBytesOk() (*int32, bool) { - if o == nil || IsNil(o.StorageBytes) { - return nil, false - } - return o.StorageBytes, true -} - -// HasStorageBytes returns a boolean if a field has been set. -func (o *DatasetStats) HasStorageBytes() bool { - if o != nil && !IsNil(o.StorageBytes) { - return true - } - - return false -} - -// SetStorageBytes gets a reference to the given int32 and assigns it to the StorageBytes field. -func (o *DatasetStats) SetStorageBytes(v int32) { - o.StorageBytes = &v -} - -// GetInflatedBytes returns the InflatedBytes field value if set, zero value otherwise. -func (o *DatasetStats) GetInflatedBytes() int32 { - if o == nil || IsNil(o.InflatedBytes) { - var ret int32 - return ret - } - return *o.InflatedBytes -} - -// GetInflatedBytesOk returns a tuple with the InflatedBytes field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *DatasetStats) GetInflatedBytesOk() (*int32, bool) { - if o == nil || IsNil(o.InflatedBytes) { - return nil, false - } - return o.InflatedBytes, true -} - -// HasInflatedBytes returns a boolean if a field has been set. -func (o *DatasetStats) HasInflatedBytes() bool { - if o != nil && !IsNil(o.InflatedBytes) { - return true - } - - return false -} - -// SetInflatedBytes gets a reference to the given int32 and assigns it to the InflatedBytes field. -func (o *DatasetStats) SetInflatedBytes(v int32) { - o.InflatedBytes = &v -} - -func (o DatasetStats) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o DatasetStats) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if !IsNil(o.ReadCount) { - toSerialize["readCount"] = o.ReadCount - } - if !IsNil(o.WriteCount) { - toSerialize["writeCount"] = o.WriteCount - } - if !IsNil(o.StorageBytes) { - toSerialize["storageBytes"] = o.StorageBytes - } - if !IsNil(o.InflatedBytes) { - toSerialize["inflatedBytes"] = o.InflatedBytes - } - return toSerialize, nil -} - -type NullableDatasetStats struct { - value *DatasetStats - isSet bool -} - -func (v NullableDatasetStats) Get() *DatasetStats { - return v.value -} - -func (v *NullableDatasetStats) Set(val *DatasetStats) { - v.value = val - v.isSet = true -} - -func (v NullableDatasetStats) IsSet() bool { - return v.isSet -} - -func (v *NullableDatasetStats) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableDatasetStats(val *DatasetStats) *NullableDatasetStats { - return &NullableDatasetStats{value: val, isSet: true} -} - -func (v NullableDatasetStats) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableDatasetStats) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_decode_and_verify_data.go b/model_decode_and_verify_data.go deleted file mode 100644 index 07bad2f..0000000 --- a/model_decode_and_verify_data.go +++ /dev/null @@ -1,220 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" - "bytes" - "fmt" -) - -// checks if the DecodeAndVerifyData type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &DecodeAndVerifyData{} - -// DecodeAndVerifyData struct for DecodeAndVerifyData -type DecodeAndVerifyData struct { - Decoded interface{} `json:"decoded"` - EncodedByUserId NullableString `json:"encodedByUserId"` - IsVerifiedUser bool `json:"isVerifiedUser"` -} - -type _DecodeAndVerifyData DecodeAndVerifyData - -// NewDecodeAndVerifyData instantiates a new DecodeAndVerifyData object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewDecodeAndVerifyData(decoded interface{}, encodedByUserId NullableString, isVerifiedUser bool) *DecodeAndVerifyData { - this := DecodeAndVerifyData{} - this.Decoded = decoded - this.EncodedByUserId = encodedByUserId - this.IsVerifiedUser = isVerifiedUser - return &this -} - -// NewDecodeAndVerifyDataWithDefaults instantiates a new DecodeAndVerifyData object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewDecodeAndVerifyDataWithDefaults() *DecodeAndVerifyData { - this := DecodeAndVerifyData{} - return &this -} - -// GetDecoded returns the Decoded field value -// If the value is explicit nil, the zero value for interface{} will be returned -func (o *DecodeAndVerifyData) GetDecoded() interface{} { - if o == nil { - var ret interface{} - return ret - } - - return o.Decoded -} - -// GetDecodedOk returns a tuple with the Decoded field value -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *DecodeAndVerifyData) GetDecodedOk() (*interface{}, bool) { - if o == nil || IsNil(o.Decoded) { - return nil, false - } - return &o.Decoded, true -} - -// SetDecoded sets field value -func (o *DecodeAndVerifyData) SetDecoded(v interface{}) { - o.Decoded = v -} - -// GetEncodedByUserId returns the EncodedByUserId field value -// If the value is explicit nil, the zero value for string will be returned -func (o *DecodeAndVerifyData) GetEncodedByUserId() string { - if o == nil || o.EncodedByUserId.Get() == nil { - var ret string - return ret - } - - return *o.EncodedByUserId.Get() -} - -// GetEncodedByUserIdOk returns a tuple with the EncodedByUserId field value -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *DecodeAndVerifyData) GetEncodedByUserIdOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.EncodedByUserId.Get(), o.EncodedByUserId.IsSet() -} - -// SetEncodedByUserId sets field value -func (o *DecodeAndVerifyData) SetEncodedByUserId(v string) { - o.EncodedByUserId.Set(&v) -} - -// GetIsVerifiedUser returns the IsVerifiedUser field value -func (o *DecodeAndVerifyData) GetIsVerifiedUser() bool { - if o == nil { - var ret bool - return ret - } - - return o.IsVerifiedUser -} - -// GetIsVerifiedUserOk returns a tuple with the IsVerifiedUser field value -// and a boolean to check if the value has been set. -func (o *DecodeAndVerifyData) GetIsVerifiedUserOk() (*bool, bool) { - if o == nil { - return nil, false - } - return &o.IsVerifiedUser, true -} - -// SetIsVerifiedUser sets field value -func (o *DecodeAndVerifyData) SetIsVerifiedUser(v bool) { - o.IsVerifiedUser = v -} - -func (o DecodeAndVerifyData) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o DecodeAndVerifyData) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if o.Decoded != nil { - toSerialize["decoded"] = o.Decoded - } - toSerialize["encodedByUserId"] = o.EncodedByUserId.Get() - toSerialize["isVerifiedUser"] = o.IsVerifiedUser - return toSerialize, nil -} - -func (o *DecodeAndVerifyData) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "decoded", - "encodedByUserId", - "isVerifiedUser", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err; - } - - for _, requiredProperty := range(requiredProperties) { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varDecodeAndVerifyData := _DecodeAndVerifyData{} - - decoder := json.NewDecoder(bytes.NewReader(data)) - decoder.DisallowUnknownFields() - err = decoder.Decode(&varDecodeAndVerifyData) - - if err != nil { - return err - } - - *o = DecodeAndVerifyData(varDecodeAndVerifyData) - - return err -} - -type NullableDecodeAndVerifyData struct { - value *DecodeAndVerifyData - isSet bool -} - -func (v NullableDecodeAndVerifyData) Get() *DecodeAndVerifyData { - return v.value -} - -func (v *NullableDecodeAndVerifyData) Set(val *DecodeAndVerifyData) { - v.value = val - v.isSet = true -} - -func (v NullableDecodeAndVerifyData) IsSet() bool { - return v.isSet -} - -func (v *NullableDecodeAndVerifyData) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableDecodeAndVerifyData(val *DecodeAndVerifyData) *NullableDecodeAndVerifyData { - return &NullableDecodeAndVerifyData{value: val, isSet: true} -} - -func (v NullableDecodeAndVerifyData) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableDecodeAndVerifyData) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_decode_and_verify_request.go b/model_decode_and_verify_request.go deleted file mode 100644 index 09d5d70..0000000 --- a/model_decode_and_verify_request.go +++ /dev/null @@ -1,158 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" - "bytes" - "fmt" -) - -// checks if the DecodeAndVerifyRequest type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &DecodeAndVerifyRequest{} - -// DecodeAndVerifyRequest struct for DecodeAndVerifyRequest -type DecodeAndVerifyRequest struct { - Encoded string `json:"encoded"` -} - -type _DecodeAndVerifyRequest DecodeAndVerifyRequest - -// NewDecodeAndVerifyRequest instantiates a new DecodeAndVerifyRequest object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewDecodeAndVerifyRequest(encoded string) *DecodeAndVerifyRequest { - this := DecodeAndVerifyRequest{} - this.Encoded = encoded - return &this -} - -// NewDecodeAndVerifyRequestWithDefaults instantiates a new DecodeAndVerifyRequest object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewDecodeAndVerifyRequestWithDefaults() *DecodeAndVerifyRequest { - this := DecodeAndVerifyRequest{} - return &this -} - -// GetEncoded returns the Encoded field value -func (o *DecodeAndVerifyRequest) GetEncoded() string { - if o == nil { - var ret string - return ret - } - - return o.Encoded -} - -// GetEncodedOk returns a tuple with the Encoded field value -// and a boolean to check if the value has been set. -func (o *DecodeAndVerifyRequest) GetEncodedOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Encoded, true -} - -// SetEncoded sets field value -func (o *DecodeAndVerifyRequest) SetEncoded(v string) { - o.Encoded = v -} - -func (o DecodeAndVerifyRequest) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o DecodeAndVerifyRequest) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["encoded"] = o.Encoded - return toSerialize, nil -} - -func (o *DecodeAndVerifyRequest) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "encoded", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err; - } - - for _, requiredProperty := range(requiredProperties) { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varDecodeAndVerifyRequest := _DecodeAndVerifyRequest{} - - decoder := json.NewDecoder(bytes.NewReader(data)) - decoder.DisallowUnknownFields() - err = decoder.Decode(&varDecodeAndVerifyRequest) - - if err != nil { - return err - } - - *o = DecodeAndVerifyRequest(varDecodeAndVerifyRequest) - - return err -} - -type NullableDecodeAndVerifyRequest struct { - value *DecodeAndVerifyRequest - isSet bool -} - -func (v NullableDecodeAndVerifyRequest) Get() *DecodeAndVerifyRequest { - return v.value -} - -func (v *NullableDecodeAndVerifyRequest) Set(val *DecodeAndVerifyRequest) { - v.value = val - v.isSet = true -} - -func (v NullableDecodeAndVerifyRequest) IsSet() bool { - return v.isSet -} - -func (v *NullableDecodeAndVerifyRequest) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableDecodeAndVerifyRequest(val *DecodeAndVerifyRequest) *NullableDecodeAndVerifyRequest { - return &NullableDecodeAndVerifyRequest{value: val, isSet: true} -} - -func (v NullableDecodeAndVerifyRequest) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableDecodeAndVerifyRequest) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_decode_and_verify_response.go b/model_decode_and_verify_response.go deleted file mode 100644 index 956b853..0000000 --- a/model_decode_and_verify_response.go +++ /dev/null @@ -1,158 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" - "bytes" - "fmt" -) - -// checks if the DecodeAndVerifyResponse type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &DecodeAndVerifyResponse{} - -// DecodeAndVerifyResponse struct for DecodeAndVerifyResponse -type DecodeAndVerifyResponse struct { - Data DecodeAndVerifyData `json:"data"` -} - -type _DecodeAndVerifyResponse DecodeAndVerifyResponse - -// NewDecodeAndVerifyResponse instantiates a new DecodeAndVerifyResponse object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewDecodeAndVerifyResponse(data DecodeAndVerifyData) *DecodeAndVerifyResponse { - this := DecodeAndVerifyResponse{} - this.Data = data - return &this -} - -// NewDecodeAndVerifyResponseWithDefaults instantiates a new DecodeAndVerifyResponse object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewDecodeAndVerifyResponseWithDefaults() *DecodeAndVerifyResponse { - this := DecodeAndVerifyResponse{} - return &this -} - -// GetData returns the Data field value -func (o *DecodeAndVerifyResponse) GetData() DecodeAndVerifyData { - if o == nil { - var ret DecodeAndVerifyData - return ret - } - - return o.Data -} - -// GetDataOk returns a tuple with the Data field value -// and a boolean to check if the value has been set. -func (o *DecodeAndVerifyResponse) GetDataOk() (*DecodeAndVerifyData, bool) { - if o == nil { - return nil, false - } - return &o.Data, true -} - -// SetData sets field value -func (o *DecodeAndVerifyResponse) SetData(v DecodeAndVerifyData) { - o.Data = v -} - -func (o DecodeAndVerifyResponse) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o DecodeAndVerifyResponse) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["data"] = o.Data - return toSerialize, nil -} - -func (o *DecodeAndVerifyResponse) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "data", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err; - } - - for _, requiredProperty := range(requiredProperties) { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varDecodeAndVerifyResponse := _DecodeAndVerifyResponse{} - - decoder := json.NewDecoder(bytes.NewReader(data)) - decoder.DisallowUnknownFields() - err = decoder.Decode(&varDecodeAndVerifyResponse) - - if err != nil { - return err - } - - *o = DecodeAndVerifyResponse(varDecodeAndVerifyResponse) - - return err -} - -type NullableDecodeAndVerifyResponse struct { - value *DecodeAndVerifyResponse - isSet bool -} - -func (v NullableDecodeAndVerifyResponse) Get() *DecodeAndVerifyResponse { - return v.value -} - -func (v *NullableDecodeAndVerifyResponse) Set(val *DecodeAndVerifyResponse) { - v.value = val - v.isSet = true -} - -func (v NullableDecodeAndVerifyResponse) IsSet() bool { - return v.isSet -} - -func (v *NullableDecodeAndVerifyResponse) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableDecodeAndVerifyResponse(val *DecodeAndVerifyResponse) *NullableDecodeAndVerifyResponse { - return &NullableDecodeAndVerifyResponse{value: val, isSet: true} -} - -func (v NullableDecodeAndVerifyResponse) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableDecodeAndVerifyResponse) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_default_run_options.go b/model_default_run_options.go deleted file mode 100644 index 49150c2..0000000 --- a/model_default_run_options.go +++ /dev/null @@ -1,326 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" -) - -// checks if the DefaultRunOptions type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &DefaultRunOptions{} - -// DefaultRunOptions struct for DefaultRunOptions -type DefaultRunOptions struct { - Build *string `json:"build,omitempty"` - TimeoutSecs *int32 `json:"timeoutSecs,omitempty"` - MemoryMbytes *int32 `json:"memoryMbytes,omitempty"` - RestartOnError *bool `json:"restartOnError,omitempty"` - MaxItems NullableInt32 `json:"maxItems,omitempty"` - ForcePermissionLevel NullableActorPermissionLevel `json:"forcePermissionLevel,omitempty"` -} - -// NewDefaultRunOptions instantiates a new DefaultRunOptions object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewDefaultRunOptions() *DefaultRunOptions { - this := DefaultRunOptions{} - return &this -} - -// NewDefaultRunOptionsWithDefaults instantiates a new DefaultRunOptions object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewDefaultRunOptionsWithDefaults() *DefaultRunOptions { - this := DefaultRunOptions{} - return &this -} - -// GetBuild returns the Build field value if set, zero value otherwise. -func (o *DefaultRunOptions) GetBuild() string { - if o == nil || IsNil(o.Build) { - var ret string - return ret - } - return *o.Build -} - -// GetBuildOk returns a tuple with the Build field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *DefaultRunOptions) GetBuildOk() (*string, bool) { - if o == nil || IsNil(o.Build) { - return nil, false - } - return o.Build, true -} - -// HasBuild returns a boolean if a field has been set. -func (o *DefaultRunOptions) HasBuild() bool { - if o != nil && !IsNil(o.Build) { - return true - } - - return false -} - -// SetBuild gets a reference to the given string and assigns it to the Build field. -func (o *DefaultRunOptions) SetBuild(v string) { - o.Build = &v -} - -// GetTimeoutSecs returns the TimeoutSecs field value if set, zero value otherwise. -func (o *DefaultRunOptions) GetTimeoutSecs() int32 { - if o == nil || IsNil(o.TimeoutSecs) { - var ret int32 - return ret - } - return *o.TimeoutSecs -} - -// GetTimeoutSecsOk returns a tuple with the TimeoutSecs field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *DefaultRunOptions) GetTimeoutSecsOk() (*int32, bool) { - if o == nil || IsNil(o.TimeoutSecs) { - return nil, false - } - return o.TimeoutSecs, true -} - -// HasTimeoutSecs returns a boolean if a field has been set. -func (o *DefaultRunOptions) HasTimeoutSecs() bool { - if o != nil && !IsNil(o.TimeoutSecs) { - return true - } - - return false -} - -// SetTimeoutSecs gets a reference to the given int32 and assigns it to the TimeoutSecs field. -func (o *DefaultRunOptions) SetTimeoutSecs(v int32) { - o.TimeoutSecs = &v -} - -// GetMemoryMbytes returns the MemoryMbytes field value if set, zero value otherwise. -func (o *DefaultRunOptions) GetMemoryMbytes() int32 { - if o == nil || IsNil(o.MemoryMbytes) { - var ret int32 - return ret - } - return *o.MemoryMbytes -} - -// GetMemoryMbytesOk returns a tuple with the MemoryMbytes field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *DefaultRunOptions) GetMemoryMbytesOk() (*int32, bool) { - if o == nil || IsNil(o.MemoryMbytes) { - return nil, false - } - return o.MemoryMbytes, true -} - -// HasMemoryMbytes returns a boolean if a field has been set. -func (o *DefaultRunOptions) HasMemoryMbytes() bool { - if o != nil && !IsNil(o.MemoryMbytes) { - return true - } - - return false -} - -// SetMemoryMbytes gets a reference to the given int32 and assigns it to the MemoryMbytes field. -func (o *DefaultRunOptions) SetMemoryMbytes(v int32) { - o.MemoryMbytes = &v -} - -// GetRestartOnError returns the RestartOnError field value if set, zero value otherwise. -func (o *DefaultRunOptions) GetRestartOnError() bool { - if o == nil || IsNil(o.RestartOnError) { - var ret bool - return ret - } - return *o.RestartOnError -} - -// GetRestartOnErrorOk returns a tuple with the RestartOnError field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *DefaultRunOptions) GetRestartOnErrorOk() (*bool, bool) { - if o == nil || IsNil(o.RestartOnError) { - return nil, false - } - return o.RestartOnError, true -} - -// HasRestartOnError returns a boolean if a field has been set. -func (o *DefaultRunOptions) HasRestartOnError() bool { - if o != nil && !IsNil(o.RestartOnError) { - return true - } - - return false -} - -// SetRestartOnError gets a reference to the given bool and assigns it to the RestartOnError field. -func (o *DefaultRunOptions) SetRestartOnError(v bool) { - o.RestartOnError = &v -} - -// GetMaxItems returns the MaxItems field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *DefaultRunOptions) GetMaxItems() int32 { - if o == nil || IsNil(o.MaxItems.Get()) { - var ret int32 - return ret - } - return *o.MaxItems.Get() -} - -// GetMaxItemsOk returns a tuple with the MaxItems field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *DefaultRunOptions) GetMaxItemsOk() (*int32, bool) { - if o == nil { - return nil, false - } - return o.MaxItems.Get(), o.MaxItems.IsSet() -} - -// HasMaxItems returns a boolean if a field has been set. -func (o *DefaultRunOptions) HasMaxItems() bool { - if o != nil && o.MaxItems.IsSet() { - return true - } - - return false -} - -// SetMaxItems gets a reference to the given NullableInt32 and assigns it to the MaxItems field. -func (o *DefaultRunOptions) SetMaxItems(v int32) { - o.MaxItems.Set(&v) -} -// SetMaxItemsNil sets the value for MaxItems to be an explicit nil -func (o *DefaultRunOptions) SetMaxItemsNil() { - o.MaxItems.Set(nil) -} - -// UnsetMaxItems ensures that no value is present for MaxItems, not even an explicit nil -func (o *DefaultRunOptions) UnsetMaxItems() { - o.MaxItems.Unset() -} - -// GetForcePermissionLevel returns the ForcePermissionLevel field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *DefaultRunOptions) GetForcePermissionLevel() ActorPermissionLevel { - if o == nil || IsNil(o.ForcePermissionLevel.Get()) { - var ret ActorPermissionLevel - return ret - } - return *o.ForcePermissionLevel.Get() -} - -// GetForcePermissionLevelOk returns a tuple with the ForcePermissionLevel field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *DefaultRunOptions) GetForcePermissionLevelOk() (*ActorPermissionLevel, bool) { - if o == nil { - return nil, false - } - return o.ForcePermissionLevel.Get(), o.ForcePermissionLevel.IsSet() -} - -// HasForcePermissionLevel returns a boolean if a field has been set. -func (o *DefaultRunOptions) HasForcePermissionLevel() bool { - if o != nil && o.ForcePermissionLevel.IsSet() { - return true - } - - return false -} - -// SetForcePermissionLevel gets a reference to the given NullableActorPermissionLevel and assigns it to the ForcePermissionLevel field. -func (o *DefaultRunOptions) SetForcePermissionLevel(v ActorPermissionLevel) { - o.ForcePermissionLevel.Set(&v) -} -// SetForcePermissionLevelNil sets the value for ForcePermissionLevel to be an explicit nil -func (o *DefaultRunOptions) SetForcePermissionLevelNil() { - o.ForcePermissionLevel.Set(nil) -} - -// UnsetForcePermissionLevel ensures that no value is present for ForcePermissionLevel, not even an explicit nil -func (o *DefaultRunOptions) UnsetForcePermissionLevel() { - o.ForcePermissionLevel.Unset() -} - -func (o DefaultRunOptions) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o DefaultRunOptions) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if !IsNil(o.Build) { - toSerialize["build"] = o.Build - } - if !IsNil(o.TimeoutSecs) { - toSerialize["timeoutSecs"] = o.TimeoutSecs - } - if !IsNil(o.MemoryMbytes) { - toSerialize["memoryMbytes"] = o.MemoryMbytes - } - if !IsNil(o.RestartOnError) { - toSerialize["restartOnError"] = o.RestartOnError - } - if o.MaxItems.IsSet() { - toSerialize["maxItems"] = o.MaxItems.Get() - } - if o.ForcePermissionLevel.IsSet() { - toSerialize["forcePermissionLevel"] = o.ForcePermissionLevel.Get() - } - return toSerialize, nil -} - -type NullableDefaultRunOptions struct { - value *DefaultRunOptions - isSet bool -} - -func (v NullableDefaultRunOptions) Get() *DefaultRunOptions { - return v.value -} - -func (v *NullableDefaultRunOptions) Set(val *DefaultRunOptions) { - v.value = val - v.isSet = true -} - -func (v NullableDefaultRunOptions) IsSet() bool { - return v.isSet -} - -func (v *NullableDefaultRunOptions) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableDefaultRunOptions(val *DefaultRunOptions) *NullableDefaultRunOptions { - return &NullableDefaultRunOptions{value: val, isSet: true} -} - -func (v NullableDefaultRunOptions) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableDefaultRunOptions) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_deleted_request.go b/model_deleted_request.go deleted file mode 100644 index 68352ca..0000000 --- a/model_deleted_request.go +++ /dev/null @@ -1,107 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" - "fmt" -) - - -// DeletedRequest Confirmation of a request that was successfully deleted from a request queue. -type DeletedRequest struct { - DeletedRequestById *DeletedRequestById - DeletedRequestByUniqueKey *DeletedRequestByUniqueKey -} - -// Unmarshal JSON data into any of the pointers in the struct -func (dst *DeletedRequest) UnmarshalJSON(data []byte) error { - var err error - // try to unmarshal JSON data into DeletedRequestById - err = json.Unmarshal(data, &dst.DeletedRequestById); - if err == nil { - jsonDeletedRequestById, _ := json.Marshal(dst.DeletedRequestById) - if string(jsonDeletedRequestById) == "{}" { // empty struct - dst.DeletedRequestById = nil - } else { - return nil // data stored in dst.DeletedRequestById, return on the first match - } - } else { - dst.DeletedRequestById = nil - } - - // try to unmarshal JSON data into DeletedRequestByUniqueKey - err = json.Unmarshal(data, &dst.DeletedRequestByUniqueKey); - if err == nil { - jsonDeletedRequestByUniqueKey, _ := json.Marshal(dst.DeletedRequestByUniqueKey) - if string(jsonDeletedRequestByUniqueKey) == "{}" { // empty struct - dst.DeletedRequestByUniqueKey = nil - } else { - return nil // data stored in dst.DeletedRequestByUniqueKey, return on the first match - } - } else { - dst.DeletedRequestByUniqueKey = nil - } - - return fmt.Errorf("data failed to match schemas in anyOf(DeletedRequest)") -} - -// Marshal data from the first non-nil pointers in the struct to JSON -func (src DeletedRequest) MarshalJSON() ([]byte, error) { - if src.DeletedRequestById != nil { - return json.Marshal(&src.DeletedRequestById) - } - - if src.DeletedRequestByUniqueKey != nil { - return json.Marshal(&src.DeletedRequestByUniqueKey) - } - - return nil, nil // no data in anyOf schemas -} - - -type NullableDeletedRequest struct { - value *DeletedRequest - isSet bool -} - -func (v NullableDeletedRequest) Get() *DeletedRequest { - return v.value -} - -func (v *NullableDeletedRequest) Set(val *DeletedRequest) { - v.value = val - v.isSet = true -} - -func (v NullableDeletedRequest) IsSet() bool { - return v.isSet -} - -func (v *NullableDeletedRequest) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableDeletedRequest(val *DeletedRequest) *NullableDeletedRequest { - return &NullableDeletedRequest{value: val, isSet: true} -} - -func (v NullableDeletedRequest) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableDeletedRequest) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_deleted_request_by_id.go b/model_deleted_request_by_id.go deleted file mode 100644 index 8d98bcb..0000000 --- a/model_deleted_request_by_id.go +++ /dev/null @@ -1,196 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" - "bytes" - "fmt" -) - -// checks if the DeletedRequestById type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &DeletedRequestById{} - -// DeletedRequestById Confirmation of a request that was successfully deleted, identified by its ID. -type DeletedRequestById struct { - // A unique key used for request de-duplication. Requests with the same unique key are considered identical. - UniqueKey *string `json:"uniqueKey,omitempty"` - // A unique identifier assigned to the request. - Id string `json:"id"` -} - -type _DeletedRequestById DeletedRequestById - -// NewDeletedRequestById instantiates a new DeletedRequestById object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewDeletedRequestById(id string) *DeletedRequestById { - this := DeletedRequestById{} - this.Id = id - return &this -} - -// NewDeletedRequestByIdWithDefaults instantiates a new DeletedRequestById object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewDeletedRequestByIdWithDefaults() *DeletedRequestById { - this := DeletedRequestById{} - return &this -} - -// GetUniqueKey returns the UniqueKey field value if set, zero value otherwise. -func (o *DeletedRequestById) GetUniqueKey() string { - if o == nil || IsNil(o.UniqueKey) { - var ret string - return ret - } - return *o.UniqueKey -} - -// GetUniqueKeyOk returns a tuple with the UniqueKey field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *DeletedRequestById) GetUniqueKeyOk() (*string, bool) { - if o == nil || IsNil(o.UniqueKey) { - return nil, false - } - return o.UniqueKey, true -} - -// HasUniqueKey returns a boolean if a field has been set. -func (o *DeletedRequestById) HasUniqueKey() bool { - if o != nil && !IsNil(o.UniqueKey) { - return true - } - - return false -} - -// SetUniqueKey gets a reference to the given string and assigns it to the UniqueKey field. -func (o *DeletedRequestById) SetUniqueKey(v string) { - o.UniqueKey = &v -} - -// GetId returns the Id field value -func (o *DeletedRequestById) GetId() string { - if o == nil { - var ret string - return ret - } - - return o.Id -} - -// GetIdOk returns a tuple with the Id field value -// and a boolean to check if the value has been set. -func (o *DeletedRequestById) GetIdOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Id, true -} - -// SetId sets field value -func (o *DeletedRequestById) SetId(v string) { - o.Id = v -} - -func (o DeletedRequestById) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o DeletedRequestById) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if !IsNil(o.UniqueKey) { - toSerialize["uniqueKey"] = o.UniqueKey - } - toSerialize["id"] = o.Id - return toSerialize, nil -} - -func (o *DeletedRequestById) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "id", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err; - } - - for _, requiredProperty := range(requiredProperties) { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varDeletedRequestById := _DeletedRequestById{} - - decoder := json.NewDecoder(bytes.NewReader(data)) - decoder.DisallowUnknownFields() - err = decoder.Decode(&varDeletedRequestById) - - if err != nil { - return err - } - - *o = DeletedRequestById(varDeletedRequestById) - - return err -} - -type NullableDeletedRequestById struct { - value *DeletedRequestById - isSet bool -} - -func (v NullableDeletedRequestById) Get() *DeletedRequestById { - return v.value -} - -func (v *NullableDeletedRequestById) Set(val *DeletedRequestById) { - v.value = val - v.isSet = true -} - -func (v NullableDeletedRequestById) IsSet() bool { - return v.isSet -} - -func (v *NullableDeletedRequestById) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableDeletedRequestById(val *DeletedRequestById) *NullableDeletedRequestById { - return &NullableDeletedRequestById{value: val, isSet: true} -} - -func (v NullableDeletedRequestById) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableDeletedRequestById) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_deleted_request_by_unique_key.go b/model_deleted_request_by_unique_key.go deleted file mode 100644 index 2e74647..0000000 --- a/model_deleted_request_by_unique_key.go +++ /dev/null @@ -1,196 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" - "bytes" - "fmt" -) - -// checks if the DeletedRequestByUniqueKey type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &DeletedRequestByUniqueKey{} - -// DeletedRequestByUniqueKey Confirmation of a request that was successfully deleted, identified by its unique key. -type DeletedRequestByUniqueKey struct { - // A unique key used for request de-duplication. Requests with the same unique key are considered identical. - UniqueKey string `json:"uniqueKey"` - // A unique identifier assigned to the request. - Id *string `json:"id,omitempty"` -} - -type _DeletedRequestByUniqueKey DeletedRequestByUniqueKey - -// NewDeletedRequestByUniqueKey instantiates a new DeletedRequestByUniqueKey object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewDeletedRequestByUniqueKey(uniqueKey string) *DeletedRequestByUniqueKey { - this := DeletedRequestByUniqueKey{} - this.UniqueKey = uniqueKey - return &this -} - -// NewDeletedRequestByUniqueKeyWithDefaults instantiates a new DeletedRequestByUniqueKey object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewDeletedRequestByUniqueKeyWithDefaults() *DeletedRequestByUniqueKey { - this := DeletedRequestByUniqueKey{} - return &this -} - -// GetUniqueKey returns the UniqueKey field value -func (o *DeletedRequestByUniqueKey) GetUniqueKey() string { - if o == nil { - var ret string - return ret - } - - return o.UniqueKey -} - -// GetUniqueKeyOk returns a tuple with the UniqueKey field value -// and a boolean to check if the value has been set. -func (o *DeletedRequestByUniqueKey) GetUniqueKeyOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.UniqueKey, true -} - -// SetUniqueKey sets field value -func (o *DeletedRequestByUniqueKey) SetUniqueKey(v string) { - o.UniqueKey = v -} - -// GetId returns the Id field value if set, zero value otherwise. -func (o *DeletedRequestByUniqueKey) GetId() string { - if o == nil || IsNil(o.Id) { - var ret string - return ret - } - return *o.Id -} - -// GetIdOk returns a tuple with the Id field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *DeletedRequestByUniqueKey) GetIdOk() (*string, bool) { - if o == nil || IsNil(o.Id) { - return nil, false - } - return o.Id, true -} - -// HasId returns a boolean if a field has been set. -func (o *DeletedRequestByUniqueKey) HasId() bool { - if o != nil && !IsNil(o.Id) { - return true - } - - return false -} - -// SetId gets a reference to the given string and assigns it to the Id field. -func (o *DeletedRequestByUniqueKey) SetId(v string) { - o.Id = &v -} - -func (o DeletedRequestByUniqueKey) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o DeletedRequestByUniqueKey) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["uniqueKey"] = o.UniqueKey - if !IsNil(o.Id) { - toSerialize["id"] = o.Id - } - return toSerialize, nil -} - -func (o *DeletedRequestByUniqueKey) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "uniqueKey", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err; - } - - for _, requiredProperty := range(requiredProperties) { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varDeletedRequestByUniqueKey := _DeletedRequestByUniqueKey{} - - decoder := json.NewDecoder(bytes.NewReader(data)) - decoder.DisallowUnknownFields() - err = decoder.Decode(&varDeletedRequestByUniqueKey) - - if err != nil { - return err - } - - *o = DeletedRequestByUniqueKey(varDeletedRequestByUniqueKey) - - return err -} - -type NullableDeletedRequestByUniqueKey struct { - value *DeletedRequestByUniqueKey - isSet bool -} - -func (v NullableDeletedRequestByUniqueKey) Get() *DeletedRequestByUniqueKey { - return v.value -} - -func (v *NullableDeletedRequestByUniqueKey) Set(val *DeletedRequestByUniqueKey) { - v.value = val - v.isSet = true -} - -func (v NullableDeletedRequestByUniqueKey) IsSet() bool { - return v.isSet -} - -func (v *NullableDeletedRequestByUniqueKey) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableDeletedRequestByUniqueKey(val *DeletedRequestByUniqueKey) *NullableDeletedRequestByUniqueKey { - return &NullableDeletedRequestByUniqueKey{value: val, isSet: true} -} - -func (v NullableDeletedRequestByUniqueKey) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableDeletedRequestByUniqueKey) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_effective_platform_feature.go b/model_effective_platform_feature.go deleted file mode 100644 index 2dca6a4..0000000 --- a/model_effective_platform_feature.go +++ /dev/null @@ -1,277 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" - "time" - "bytes" - "fmt" -) - -// checks if the EffectivePlatformFeature type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &EffectivePlatformFeature{} - -// EffectivePlatformFeature struct for EffectivePlatformFeature -type EffectivePlatformFeature struct { - IsEnabled bool `json:"isEnabled"` - DisabledReason NullableString `json:"disabledReason"` - DisabledReasonType NullableString `json:"disabledReasonType"` - IsTrial bool `json:"isTrial"` - TrialExpirationAt NullableTime `json:"trialExpirationAt"` -} - -type _EffectivePlatformFeature EffectivePlatformFeature - -// NewEffectivePlatformFeature instantiates a new EffectivePlatformFeature object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewEffectivePlatformFeature(isEnabled bool, disabledReason NullableString, disabledReasonType NullableString, isTrial bool, trialExpirationAt NullableTime) *EffectivePlatformFeature { - this := EffectivePlatformFeature{} - this.IsEnabled = isEnabled - this.DisabledReason = disabledReason - this.DisabledReasonType = disabledReasonType - this.IsTrial = isTrial - this.TrialExpirationAt = trialExpirationAt - return &this -} - -// NewEffectivePlatformFeatureWithDefaults instantiates a new EffectivePlatformFeature object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewEffectivePlatformFeatureWithDefaults() *EffectivePlatformFeature { - this := EffectivePlatformFeature{} - return &this -} - -// GetIsEnabled returns the IsEnabled field value -func (o *EffectivePlatformFeature) GetIsEnabled() bool { - if o == nil { - var ret bool - return ret - } - - return o.IsEnabled -} - -// GetIsEnabledOk returns a tuple with the IsEnabled field value -// and a boolean to check if the value has been set. -func (o *EffectivePlatformFeature) GetIsEnabledOk() (*bool, bool) { - if o == nil { - return nil, false - } - return &o.IsEnabled, true -} - -// SetIsEnabled sets field value -func (o *EffectivePlatformFeature) SetIsEnabled(v bool) { - o.IsEnabled = v -} - -// GetDisabledReason returns the DisabledReason field value -// If the value is explicit nil, the zero value for string will be returned -func (o *EffectivePlatformFeature) GetDisabledReason() string { - if o == nil || o.DisabledReason.Get() == nil { - var ret string - return ret - } - - return *o.DisabledReason.Get() -} - -// GetDisabledReasonOk returns a tuple with the DisabledReason field value -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *EffectivePlatformFeature) GetDisabledReasonOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.DisabledReason.Get(), o.DisabledReason.IsSet() -} - -// SetDisabledReason sets field value -func (o *EffectivePlatformFeature) SetDisabledReason(v string) { - o.DisabledReason.Set(&v) -} - -// GetDisabledReasonType returns the DisabledReasonType field value -// If the value is explicit nil, the zero value for string will be returned -func (o *EffectivePlatformFeature) GetDisabledReasonType() string { - if o == nil || o.DisabledReasonType.Get() == nil { - var ret string - return ret - } - - return *o.DisabledReasonType.Get() -} - -// GetDisabledReasonTypeOk returns a tuple with the DisabledReasonType field value -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *EffectivePlatformFeature) GetDisabledReasonTypeOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.DisabledReasonType.Get(), o.DisabledReasonType.IsSet() -} - -// SetDisabledReasonType sets field value -func (o *EffectivePlatformFeature) SetDisabledReasonType(v string) { - o.DisabledReasonType.Set(&v) -} - -// GetIsTrial returns the IsTrial field value -func (o *EffectivePlatformFeature) GetIsTrial() bool { - if o == nil { - var ret bool - return ret - } - - return o.IsTrial -} - -// GetIsTrialOk returns a tuple with the IsTrial field value -// and a boolean to check if the value has been set. -func (o *EffectivePlatformFeature) GetIsTrialOk() (*bool, bool) { - if o == nil { - return nil, false - } - return &o.IsTrial, true -} - -// SetIsTrial sets field value -func (o *EffectivePlatformFeature) SetIsTrial(v bool) { - o.IsTrial = v -} - -// GetTrialExpirationAt returns the TrialExpirationAt field value -// If the value is explicit nil, the zero value for time.Time will be returned -func (o *EffectivePlatformFeature) GetTrialExpirationAt() time.Time { - if o == nil || o.TrialExpirationAt.Get() == nil { - var ret time.Time - return ret - } - - return *o.TrialExpirationAt.Get() -} - -// GetTrialExpirationAtOk returns a tuple with the TrialExpirationAt field value -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *EffectivePlatformFeature) GetTrialExpirationAtOk() (*time.Time, bool) { - if o == nil { - return nil, false - } - return o.TrialExpirationAt.Get(), o.TrialExpirationAt.IsSet() -} - -// SetTrialExpirationAt sets field value -func (o *EffectivePlatformFeature) SetTrialExpirationAt(v time.Time) { - o.TrialExpirationAt.Set(&v) -} - -func (o EffectivePlatformFeature) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o EffectivePlatformFeature) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["isEnabled"] = o.IsEnabled - toSerialize["disabledReason"] = o.DisabledReason.Get() - toSerialize["disabledReasonType"] = o.DisabledReasonType.Get() - toSerialize["isTrial"] = o.IsTrial - toSerialize["trialExpirationAt"] = o.TrialExpirationAt.Get() - return toSerialize, nil -} - -func (o *EffectivePlatformFeature) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "isEnabled", - "disabledReason", - "disabledReasonType", - "isTrial", - "trialExpirationAt", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err; - } - - for _, requiredProperty := range(requiredProperties) { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varEffectivePlatformFeature := _EffectivePlatformFeature{} - - decoder := json.NewDecoder(bytes.NewReader(data)) - decoder.DisallowUnknownFields() - err = decoder.Decode(&varEffectivePlatformFeature) - - if err != nil { - return err - } - - *o = EffectivePlatformFeature(varEffectivePlatformFeature) - - return err -} - -type NullableEffectivePlatformFeature struct { - value *EffectivePlatformFeature - isSet bool -} - -func (v NullableEffectivePlatformFeature) Get() *EffectivePlatformFeature { - return v.value -} - -func (v *NullableEffectivePlatformFeature) Set(val *EffectivePlatformFeature) { - v.value = val - v.isSet = true -} - -func (v NullableEffectivePlatformFeature) IsSet() bool { - return v.isSet -} - -func (v *NullableEffectivePlatformFeature) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableEffectivePlatformFeature(val *EffectivePlatformFeature) *NullableEffectivePlatformFeature { - return &NullableEffectivePlatformFeature{value: val, isSet: true} -} - -func (v NullableEffectivePlatformFeature) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableEffectivePlatformFeature) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_effective_platform_features.go b/model_effective_platform_features.go deleted file mode 100644 index b4344e9..0000000 --- a/model_effective_platform_features.go +++ /dev/null @@ -1,410 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" - "bytes" - "fmt" -) - -// checks if the EffectivePlatformFeatures type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &EffectivePlatformFeatures{} - -// EffectivePlatformFeatures struct for EffectivePlatformFeatures -type EffectivePlatformFeatures struct { - ACTORS EffectivePlatformFeature `json:"ACTORS"` - STORAGE EffectivePlatformFeature `json:"STORAGE"` - SCHEDULER EffectivePlatformFeature `json:"SCHEDULER"` - PROXY EffectivePlatformFeature `json:"PROXY"` - PROXY_EXTERNAL_ACCESS EffectivePlatformFeature `json:"PROXY_EXTERNAL_ACCESS"` - PROXY_RESIDENTIAL EffectivePlatformFeature `json:"PROXY_RESIDENTIAL"` - PROXY_SERPS EffectivePlatformFeature `json:"PROXY_SERPS"` - WEBHOOKS EffectivePlatformFeature `json:"WEBHOOKS"` - ACTORS_PUBLIC_ALL EffectivePlatformFeature `json:"ACTORS_PUBLIC_ALL"` - ACTORS_PUBLIC_DEVELOPER EffectivePlatformFeature `json:"ACTORS_PUBLIC_DEVELOPER"` -} - -type _EffectivePlatformFeatures EffectivePlatformFeatures - -// NewEffectivePlatformFeatures instantiates a new EffectivePlatformFeatures object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewEffectivePlatformFeatures(aCTORS EffectivePlatformFeature, sTORAGE EffectivePlatformFeature, sCHEDULER EffectivePlatformFeature, pROXY EffectivePlatformFeature, pROXYEXTERNALACCESS EffectivePlatformFeature, pROXYRESIDENTIAL EffectivePlatformFeature, pROXYSERPS EffectivePlatformFeature, wEBHOOKS EffectivePlatformFeature, aCTORSPUBLICALL EffectivePlatformFeature, aCTORSPUBLICDEVELOPER EffectivePlatformFeature) *EffectivePlatformFeatures { - this := EffectivePlatformFeatures{} - this.ACTORS = aCTORS - this.STORAGE = sTORAGE - this.SCHEDULER = sCHEDULER - this.PROXY = pROXY - this.PROXY_EXTERNAL_ACCESS = pROXYEXTERNALACCESS - this.PROXY_RESIDENTIAL = pROXYRESIDENTIAL - this.PROXY_SERPS = pROXYSERPS - this.WEBHOOKS = wEBHOOKS - this.ACTORS_PUBLIC_ALL = aCTORSPUBLICALL - this.ACTORS_PUBLIC_DEVELOPER = aCTORSPUBLICDEVELOPER - return &this -} - -// NewEffectivePlatformFeaturesWithDefaults instantiates a new EffectivePlatformFeatures object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewEffectivePlatformFeaturesWithDefaults() *EffectivePlatformFeatures { - this := EffectivePlatformFeatures{} - return &this -} - -// GetACTORS returns the ACTORS field value -func (o *EffectivePlatformFeatures) GetACTORS() EffectivePlatformFeature { - if o == nil { - var ret EffectivePlatformFeature - return ret - } - - return o.ACTORS -} - -// GetACTORSOk returns a tuple with the ACTORS field value -// and a boolean to check if the value has been set. -func (o *EffectivePlatformFeatures) GetACTORSOk() (*EffectivePlatformFeature, bool) { - if o == nil { - return nil, false - } - return &o.ACTORS, true -} - -// SetACTORS sets field value -func (o *EffectivePlatformFeatures) SetACTORS(v EffectivePlatformFeature) { - o.ACTORS = v -} - -// GetSTORAGE returns the STORAGE field value -func (o *EffectivePlatformFeatures) GetSTORAGE() EffectivePlatformFeature { - if o == nil { - var ret EffectivePlatformFeature - return ret - } - - return o.STORAGE -} - -// GetSTORAGEOk returns a tuple with the STORAGE field value -// and a boolean to check if the value has been set. -func (o *EffectivePlatformFeatures) GetSTORAGEOk() (*EffectivePlatformFeature, bool) { - if o == nil { - return nil, false - } - return &o.STORAGE, true -} - -// SetSTORAGE sets field value -func (o *EffectivePlatformFeatures) SetSTORAGE(v EffectivePlatformFeature) { - o.STORAGE = v -} - -// GetSCHEDULER returns the SCHEDULER field value -func (o *EffectivePlatformFeatures) GetSCHEDULER() EffectivePlatformFeature { - if o == nil { - var ret EffectivePlatformFeature - return ret - } - - return o.SCHEDULER -} - -// GetSCHEDULEROk returns a tuple with the SCHEDULER field value -// and a boolean to check if the value has been set. -func (o *EffectivePlatformFeatures) GetSCHEDULEROk() (*EffectivePlatformFeature, bool) { - if o == nil { - return nil, false - } - return &o.SCHEDULER, true -} - -// SetSCHEDULER sets field value -func (o *EffectivePlatformFeatures) SetSCHEDULER(v EffectivePlatformFeature) { - o.SCHEDULER = v -} - -// GetPROXY returns the PROXY field value -func (o *EffectivePlatformFeatures) GetPROXY() EffectivePlatformFeature { - if o == nil { - var ret EffectivePlatformFeature - return ret - } - - return o.PROXY -} - -// GetPROXYOk returns a tuple with the PROXY field value -// and a boolean to check if the value has been set. -func (o *EffectivePlatformFeatures) GetPROXYOk() (*EffectivePlatformFeature, bool) { - if o == nil { - return nil, false - } - return &o.PROXY, true -} - -// SetPROXY sets field value -func (o *EffectivePlatformFeatures) SetPROXY(v EffectivePlatformFeature) { - o.PROXY = v -} - -// GetPROXY_EXTERNAL_ACCESS returns the PROXY_EXTERNAL_ACCESS field value -func (o *EffectivePlatformFeatures) GetPROXY_EXTERNAL_ACCESS() EffectivePlatformFeature { - if o == nil { - var ret EffectivePlatformFeature - return ret - } - - return o.PROXY_EXTERNAL_ACCESS -} - -// GetPROXY_EXTERNAL_ACCESSOk returns a tuple with the PROXY_EXTERNAL_ACCESS field value -// and a boolean to check if the value has been set. -func (o *EffectivePlatformFeatures) GetPROXY_EXTERNAL_ACCESSOk() (*EffectivePlatformFeature, bool) { - if o == nil { - return nil, false - } - return &o.PROXY_EXTERNAL_ACCESS, true -} - -// SetPROXY_EXTERNAL_ACCESS sets field value -func (o *EffectivePlatformFeatures) SetPROXY_EXTERNAL_ACCESS(v EffectivePlatformFeature) { - o.PROXY_EXTERNAL_ACCESS = v -} - -// GetPROXY_RESIDENTIAL returns the PROXY_RESIDENTIAL field value -func (o *EffectivePlatformFeatures) GetPROXY_RESIDENTIAL() EffectivePlatformFeature { - if o == nil { - var ret EffectivePlatformFeature - return ret - } - - return o.PROXY_RESIDENTIAL -} - -// GetPROXY_RESIDENTIALOk returns a tuple with the PROXY_RESIDENTIAL field value -// and a boolean to check if the value has been set. -func (o *EffectivePlatformFeatures) GetPROXY_RESIDENTIALOk() (*EffectivePlatformFeature, bool) { - if o == nil { - return nil, false - } - return &o.PROXY_RESIDENTIAL, true -} - -// SetPROXY_RESIDENTIAL sets field value -func (o *EffectivePlatformFeatures) SetPROXY_RESIDENTIAL(v EffectivePlatformFeature) { - o.PROXY_RESIDENTIAL = v -} - -// GetPROXY_SERPS returns the PROXY_SERPS field value -func (o *EffectivePlatformFeatures) GetPROXY_SERPS() EffectivePlatformFeature { - if o == nil { - var ret EffectivePlatformFeature - return ret - } - - return o.PROXY_SERPS -} - -// GetPROXY_SERPSOk returns a tuple with the PROXY_SERPS field value -// and a boolean to check if the value has been set. -func (o *EffectivePlatformFeatures) GetPROXY_SERPSOk() (*EffectivePlatformFeature, bool) { - if o == nil { - return nil, false - } - return &o.PROXY_SERPS, true -} - -// SetPROXY_SERPS sets field value -func (o *EffectivePlatformFeatures) SetPROXY_SERPS(v EffectivePlatformFeature) { - o.PROXY_SERPS = v -} - -// GetWEBHOOKS returns the WEBHOOKS field value -func (o *EffectivePlatformFeatures) GetWEBHOOKS() EffectivePlatformFeature { - if o == nil { - var ret EffectivePlatformFeature - return ret - } - - return o.WEBHOOKS -} - -// GetWEBHOOKSOk returns a tuple with the WEBHOOKS field value -// and a boolean to check if the value has been set. -func (o *EffectivePlatformFeatures) GetWEBHOOKSOk() (*EffectivePlatformFeature, bool) { - if o == nil { - return nil, false - } - return &o.WEBHOOKS, true -} - -// SetWEBHOOKS sets field value -func (o *EffectivePlatformFeatures) SetWEBHOOKS(v EffectivePlatformFeature) { - o.WEBHOOKS = v -} - -// GetACTORS_PUBLIC_ALL returns the ACTORS_PUBLIC_ALL field value -func (o *EffectivePlatformFeatures) GetACTORS_PUBLIC_ALL() EffectivePlatformFeature { - if o == nil { - var ret EffectivePlatformFeature - return ret - } - - return o.ACTORS_PUBLIC_ALL -} - -// GetACTORS_PUBLIC_ALLOk returns a tuple with the ACTORS_PUBLIC_ALL field value -// and a boolean to check if the value has been set. -func (o *EffectivePlatformFeatures) GetACTORS_PUBLIC_ALLOk() (*EffectivePlatformFeature, bool) { - if o == nil { - return nil, false - } - return &o.ACTORS_PUBLIC_ALL, true -} - -// SetACTORS_PUBLIC_ALL sets field value -func (o *EffectivePlatformFeatures) SetACTORS_PUBLIC_ALL(v EffectivePlatformFeature) { - o.ACTORS_PUBLIC_ALL = v -} - -// GetACTORS_PUBLIC_DEVELOPER returns the ACTORS_PUBLIC_DEVELOPER field value -func (o *EffectivePlatformFeatures) GetACTORS_PUBLIC_DEVELOPER() EffectivePlatformFeature { - if o == nil { - var ret EffectivePlatformFeature - return ret - } - - return o.ACTORS_PUBLIC_DEVELOPER -} - -// GetACTORS_PUBLIC_DEVELOPEROk returns a tuple with the ACTORS_PUBLIC_DEVELOPER field value -// and a boolean to check if the value has been set. -func (o *EffectivePlatformFeatures) GetACTORS_PUBLIC_DEVELOPEROk() (*EffectivePlatformFeature, bool) { - if o == nil { - return nil, false - } - return &o.ACTORS_PUBLIC_DEVELOPER, true -} - -// SetACTORS_PUBLIC_DEVELOPER sets field value -func (o *EffectivePlatformFeatures) SetACTORS_PUBLIC_DEVELOPER(v EffectivePlatformFeature) { - o.ACTORS_PUBLIC_DEVELOPER = v -} - -func (o EffectivePlatformFeatures) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o EffectivePlatformFeatures) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["ACTORS"] = o.ACTORS - toSerialize["STORAGE"] = o.STORAGE - toSerialize["SCHEDULER"] = o.SCHEDULER - toSerialize["PROXY"] = o.PROXY - toSerialize["PROXY_EXTERNAL_ACCESS"] = o.PROXY_EXTERNAL_ACCESS - toSerialize["PROXY_RESIDENTIAL"] = o.PROXY_RESIDENTIAL - toSerialize["PROXY_SERPS"] = o.PROXY_SERPS - toSerialize["WEBHOOKS"] = o.WEBHOOKS - toSerialize["ACTORS_PUBLIC_ALL"] = o.ACTORS_PUBLIC_ALL - toSerialize["ACTORS_PUBLIC_DEVELOPER"] = o.ACTORS_PUBLIC_DEVELOPER - return toSerialize, nil -} - -func (o *EffectivePlatformFeatures) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "ACTORS", - "STORAGE", - "SCHEDULER", - "PROXY", - "PROXY_EXTERNAL_ACCESS", - "PROXY_RESIDENTIAL", - "PROXY_SERPS", - "WEBHOOKS", - "ACTORS_PUBLIC_ALL", - "ACTORS_PUBLIC_DEVELOPER", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err; - } - - for _, requiredProperty := range(requiredProperties) { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varEffectivePlatformFeatures := _EffectivePlatformFeatures{} - - decoder := json.NewDecoder(bytes.NewReader(data)) - decoder.DisallowUnknownFields() - err = decoder.Decode(&varEffectivePlatformFeatures) - - if err != nil { - return err - } - - *o = EffectivePlatformFeatures(varEffectivePlatformFeatures) - - return err -} - -type NullableEffectivePlatformFeatures struct { - value *EffectivePlatformFeatures - isSet bool -} - -func (v NullableEffectivePlatformFeatures) Get() *EffectivePlatformFeatures { - return v.value -} - -func (v *NullableEffectivePlatformFeatures) Set(val *EffectivePlatformFeatures) { - v.value = val - v.isSet = true -} - -func (v NullableEffectivePlatformFeatures) IsSet() bool { - return v.isSet -} - -func (v *NullableEffectivePlatformFeatures) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableEffectivePlatformFeatures(val *EffectivePlatformFeatures) *NullableEffectivePlatformFeatures { - return &NullableEffectivePlatformFeatures{value: val, isSet: true} -} - -func (v NullableEffectivePlatformFeatures) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableEffectivePlatformFeatures) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_encode_and_sign_data.go b/model_encode_and_sign_data.go deleted file mode 100644 index 40e6e29..0000000 --- a/model_encode_and_sign_data.go +++ /dev/null @@ -1,158 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" - "bytes" - "fmt" -) - -// checks if the EncodeAndSignData type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &EncodeAndSignData{} - -// EncodeAndSignData struct for EncodeAndSignData -type EncodeAndSignData struct { - Encoded string `json:"encoded"` -} - -type _EncodeAndSignData EncodeAndSignData - -// NewEncodeAndSignData instantiates a new EncodeAndSignData object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewEncodeAndSignData(encoded string) *EncodeAndSignData { - this := EncodeAndSignData{} - this.Encoded = encoded - return &this -} - -// NewEncodeAndSignDataWithDefaults instantiates a new EncodeAndSignData object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewEncodeAndSignDataWithDefaults() *EncodeAndSignData { - this := EncodeAndSignData{} - return &this -} - -// GetEncoded returns the Encoded field value -func (o *EncodeAndSignData) GetEncoded() string { - if o == nil { - var ret string - return ret - } - - return o.Encoded -} - -// GetEncodedOk returns a tuple with the Encoded field value -// and a boolean to check if the value has been set. -func (o *EncodeAndSignData) GetEncodedOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Encoded, true -} - -// SetEncoded sets field value -func (o *EncodeAndSignData) SetEncoded(v string) { - o.Encoded = v -} - -func (o EncodeAndSignData) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o EncodeAndSignData) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["encoded"] = o.Encoded - return toSerialize, nil -} - -func (o *EncodeAndSignData) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "encoded", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err; - } - - for _, requiredProperty := range(requiredProperties) { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varEncodeAndSignData := _EncodeAndSignData{} - - decoder := json.NewDecoder(bytes.NewReader(data)) - decoder.DisallowUnknownFields() - err = decoder.Decode(&varEncodeAndSignData) - - if err != nil { - return err - } - - *o = EncodeAndSignData(varEncodeAndSignData) - - return err -} - -type NullableEncodeAndSignData struct { - value *EncodeAndSignData - isSet bool -} - -func (v NullableEncodeAndSignData) Get() *EncodeAndSignData { - return v.value -} - -func (v *NullableEncodeAndSignData) Set(val *EncodeAndSignData) { - v.value = val - v.isSet = true -} - -func (v NullableEncodeAndSignData) IsSet() bool { - return v.isSet -} - -func (v *NullableEncodeAndSignData) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableEncodeAndSignData(val *EncodeAndSignData) *NullableEncodeAndSignData { - return &NullableEncodeAndSignData{value: val, isSet: true} -} - -func (v NullableEncodeAndSignData) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableEncodeAndSignData) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_encode_and_sign_response.go b/model_encode_and_sign_response.go deleted file mode 100644 index 40b4dd9..0000000 --- a/model_encode_and_sign_response.go +++ /dev/null @@ -1,158 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" - "bytes" - "fmt" -) - -// checks if the EncodeAndSignResponse type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &EncodeAndSignResponse{} - -// EncodeAndSignResponse struct for EncodeAndSignResponse -type EncodeAndSignResponse struct { - Data EncodeAndSignData `json:"data"` -} - -type _EncodeAndSignResponse EncodeAndSignResponse - -// NewEncodeAndSignResponse instantiates a new EncodeAndSignResponse object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewEncodeAndSignResponse(data EncodeAndSignData) *EncodeAndSignResponse { - this := EncodeAndSignResponse{} - this.Data = data - return &this -} - -// NewEncodeAndSignResponseWithDefaults instantiates a new EncodeAndSignResponse object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewEncodeAndSignResponseWithDefaults() *EncodeAndSignResponse { - this := EncodeAndSignResponse{} - return &this -} - -// GetData returns the Data field value -func (o *EncodeAndSignResponse) GetData() EncodeAndSignData { - if o == nil { - var ret EncodeAndSignData - return ret - } - - return o.Data -} - -// GetDataOk returns a tuple with the Data field value -// and a boolean to check if the value has been set. -func (o *EncodeAndSignResponse) GetDataOk() (*EncodeAndSignData, bool) { - if o == nil { - return nil, false - } - return &o.Data, true -} - -// SetData sets field value -func (o *EncodeAndSignResponse) SetData(v EncodeAndSignData) { - o.Data = v -} - -func (o EncodeAndSignResponse) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o EncodeAndSignResponse) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["data"] = o.Data - return toSerialize, nil -} - -func (o *EncodeAndSignResponse) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "data", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err; - } - - for _, requiredProperty := range(requiredProperties) { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varEncodeAndSignResponse := _EncodeAndSignResponse{} - - decoder := json.NewDecoder(bytes.NewReader(data)) - decoder.DisallowUnknownFields() - err = decoder.Decode(&varEncodeAndSignResponse) - - if err != nil { - return err - } - - *o = EncodeAndSignResponse(varEncodeAndSignResponse) - - return err -} - -type NullableEncodeAndSignResponse struct { - value *EncodeAndSignResponse - isSet bool -} - -func (v NullableEncodeAndSignResponse) Get() *EncodeAndSignResponse { - return v.value -} - -func (v *NullableEncodeAndSignResponse) Set(val *EncodeAndSignResponse) { - v.value = val - v.isSet = true -} - -func (v NullableEncodeAndSignResponse) IsSet() bool { - return v.isSet -} - -func (v *NullableEncodeAndSignResponse) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableEncodeAndSignResponse(val *EncodeAndSignResponse) *NullableEncodeAndSignResponse { - return &NullableEncodeAndSignResponse{value: val, isSet: true} -} - -func (v NullableEncodeAndSignResponse) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableEncodeAndSignResponse) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_env_var.go b/model_env_var.go deleted file mode 100644 index 74c3bbc..0000000 --- a/model_env_var.go +++ /dev/null @@ -1,241 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" - "bytes" - "fmt" -) - -// checks if the EnvVar type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &EnvVar{} - -// EnvVar struct for EnvVar -type EnvVar struct { - Name string `json:"name"` - // The environment variable value. This field is absent in responses when `isSecret` is `true`, as secret values are never returned by the API. - Value *string `json:"value,omitempty"` - IsSecret NullableBool `json:"isSecret,omitempty"` -} - -type _EnvVar EnvVar - -// NewEnvVar instantiates a new EnvVar object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewEnvVar(name string) *EnvVar { - this := EnvVar{} - this.Name = name - return &this -} - -// NewEnvVarWithDefaults instantiates a new EnvVar object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewEnvVarWithDefaults() *EnvVar { - this := EnvVar{} - return &this -} - -// GetName returns the Name field value -func (o *EnvVar) GetName() string { - if o == nil { - var ret string - return ret - } - - return o.Name -} - -// GetNameOk returns a tuple with the Name field value -// and a boolean to check if the value has been set. -func (o *EnvVar) GetNameOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Name, true -} - -// SetName sets field value -func (o *EnvVar) SetName(v string) { - o.Name = v -} - -// GetValue returns the Value field value if set, zero value otherwise. -func (o *EnvVar) GetValue() string { - if o == nil || IsNil(o.Value) { - var ret string - return ret - } - return *o.Value -} - -// GetValueOk returns a tuple with the Value field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *EnvVar) GetValueOk() (*string, bool) { - if o == nil || IsNil(o.Value) { - return nil, false - } - return o.Value, true -} - -// HasValue returns a boolean if a field has been set. -func (o *EnvVar) HasValue() bool { - if o != nil && !IsNil(o.Value) { - return true - } - - return false -} - -// SetValue gets a reference to the given string and assigns it to the Value field. -func (o *EnvVar) SetValue(v string) { - o.Value = &v -} - -// GetIsSecret returns the IsSecret field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *EnvVar) GetIsSecret() bool { - if o == nil || IsNil(o.IsSecret.Get()) { - var ret bool - return ret - } - return *o.IsSecret.Get() -} - -// GetIsSecretOk returns a tuple with the IsSecret field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *EnvVar) GetIsSecretOk() (*bool, bool) { - if o == nil { - return nil, false - } - return o.IsSecret.Get(), o.IsSecret.IsSet() -} - -// HasIsSecret returns a boolean if a field has been set. -func (o *EnvVar) HasIsSecret() bool { - if o != nil && o.IsSecret.IsSet() { - return true - } - - return false -} - -// SetIsSecret gets a reference to the given NullableBool and assigns it to the IsSecret field. -func (o *EnvVar) SetIsSecret(v bool) { - o.IsSecret.Set(&v) -} -// SetIsSecretNil sets the value for IsSecret to be an explicit nil -func (o *EnvVar) SetIsSecretNil() { - o.IsSecret.Set(nil) -} - -// UnsetIsSecret ensures that no value is present for IsSecret, not even an explicit nil -func (o *EnvVar) UnsetIsSecret() { - o.IsSecret.Unset() -} - -func (o EnvVar) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o EnvVar) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["name"] = o.Name - if !IsNil(o.Value) { - toSerialize["value"] = o.Value - } - if o.IsSecret.IsSet() { - toSerialize["isSecret"] = o.IsSecret.Get() - } - return toSerialize, nil -} - -func (o *EnvVar) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "name", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err; - } - - for _, requiredProperty := range(requiredProperties) { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varEnvVar := _EnvVar{} - - decoder := json.NewDecoder(bytes.NewReader(data)) - decoder.DisallowUnknownFields() - err = decoder.Decode(&varEnvVar) - - if err != nil { - return err - } - - *o = EnvVar(varEnvVar) - - return err -} - -type NullableEnvVar struct { - value *EnvVar - isSet bool -} - -func (v NullableEnvVar) Get() *EnvVar { - return v.value -} - -func (v *NullableEnvVar) Set(val *EnvVar) { - v.value = val - v.isSet = true -} - -func (v NullableEnvVar) IsSet() bool { - return v.isSet -} - -func (v *NullableEnvVar) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableEnvVar(val *EnvVar) *NullableEnvVar { - return &NullableEnvVar{value: val, isSet: true} -} - -func (v NullableEnvVar) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableEnvVar) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_env_var_request.go b/model_env_var_request.go deleted file mode 100644 index 224ef5b..0000000 --- a/model_env_var_request.go +++ /dev/null @@ -1,231 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" - "bytes" - "fmt" -) - -// checks if the EnvVarRequest type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &EnvVarRequest{} - -// EnvVarRequest struct for EnvVarRequest -type EnvVarRequest struct { - Name string `json:"name"` - // The environment variable value. This field is absent in responses when `isSecret` is `true`, as secret values are never returned by the API. - Value *string `json:"value,omitempty"` - IsSecret *bool `json:"isSecret,omitempty"` -} - -type _EnvVarRequest EnvVarRequest - -// NewEnvVarRequest instantiates a new EnvVarRequest object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewEnvVarRequest(name string) *EnvVarRequest { - this := EnvVarRequest{} - this.Name = name - return &this -} - -// NewEnvVarRequestWithDefaults instantiates a new EnvVarRequest object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewEnvVarRequestWithDefaults() *EnvVarRequest { - this := EnvVarRequest{} - return &this -} - -// GetName returns the Name field value -func (o *EnvVarRequest) GetName() string { - if o == nil { - var ret string - return ret - } - - return o.Name -} - -// GetNameOk returns a tuple with the Name field value -// and a boolean to check if the value has been set. -func (o *EnvVarRequest) GetNameOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Name, true -} - -// SetName sets field value -func (o *EnvVarRequest) SetName(v string) { - o.Name = v -} - -// GetValue returns the Value field value if set, zero value otherwise. -func (o *EnvVarRequest) GetValue() string { - if o == nil || IsNil(o.Value) { - var ret string - return ret - } - return *o.Value -} - -// GetValueOk returns a tuple with the Value field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *EnvVarRequest) GetValueOk() (*string, bool) { - if o == nil || IsNil(o.Value) { - return nil, false - } - return o.Value, true -} - -// HasValue returns a boolean if a field has been set. -func (o *EnvVarRequest) HasValue() bool { - if o != nil && !IsNil(o.Value) { - return true - } - - return false -} - -// SetValue gets a reference to the given string and assigns it to the Value field. -func (o *EnvVarRequest) SetValue(v string) { - o.Value = &v -} - -// GetIsSecret returns the IsSecret field value if set, zero value otherwise. -func (o *EnvVarRequest) GetIsSecret() bool { - if o == nil || IsNil(o.IsSecret) { - var ret bool - return ret - } - return *o.IsSecret -} - -// GetIsSecretOk returns a tuple with the IsSecret field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *EnvVarRequest) GetIsSecretOk() (*bool, bool) { - if o == nil || IsNil(o.IsSecret) { - return nil, false - } - return o.IsSecret, true -} - -// HasIsSecret returns a boolean if a field has been set. -func (o *EnvVarRequest) HasIsSecret() bool { - if o != nil && !IsNil(o.IsSecret) { - return true - } - - return false -} - -// SetIsSecret gets a reference to the given bool and assigns it to the IsSecret field. -func (o *EnvVarRequest) SetIsSecret(v bool) { - o.IsSecret = &v -} - -func (o EnvVarRequest) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o EnvVarRequest) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["name"] = o.Name - if !IsNil(o.Value) { - toSerialize["value"] = o.Value - } - if !IsNil(o.IsSecret) { - toSerialize["isSecret"] = o.IsSecret - } - return toSerialize, nil -} - -func (o *EnvVarRequest) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "name", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err; - } - - for _, requiredProperty := range(requiredProperties) { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varEnvVarRequest := _EnvVarRequest{} - - decoder := json.NewDecoder(bytes.NewReader(data)) - decoder.DisallowUnknownFields() - err = decoder.Decode(&varEnvVarRequest) - - if err != nil { - return err - } - - *o = EnvVarRequest(varEnvVarRequest) - - return err -} - -type NullableEnvVarRequest struct { - value *EnvVarRequest - isSet bool -} - -func (v NullableEnvVarRequest) Get() *EnvVarRequest { - return v.value -} - -func (v *NullableEnvVarRequest) Set(val *EnvVarRequest) { - v.value = val - v.isSet = true -} - -func (v NullableEnvVarRequest) IsSet() bool { - return v.isSet -} - -func (v *NullableEnvVarRequest) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableEnvVarRequest(val *EnvVarRequest) *NullableEnvVarRequest { - return &NullableEnvVarRequest{value: val, isSet: true} -} - -func (v NullableEnvVarRequest) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableEnvVarRequest) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_env_var_response.go b/model_env_var_response.go deleted file mode 100644 index 7415fe8..0000000 --- a/model_env_var_response.go +++ /dev/null @@ -1,158 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" - "bytes" - "fmt" -) - -// checks if the EnvVarResponse type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &EnvVarResponse{} - -// EnvVarResponse struct for EnvVarResponse -type EnvVarResponse struct { - Data EnvVar `json:"data"` -} - -type _EnvVarResponse EnvVarResponse - -// NewEnvVarResponse instantiates a new EnvVarResponse object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewEnvVarResponse(data EnvVar) *EnvVarResponse { - this := EnvVarResponse{} - this.Data = data - return &this -} - -// NewEnvVarResponseWithDefaults instantiates a new EnvVarResponse object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewEnvVarResponseWithDefaults() *EnvVarResponse { - this := EnvVarResponse{} - return &this -} - -// GetData returns the Data field value -func (o *EnvVarResponse) GetData() EnvVar { - if o == nil { - var ret EnvVar - return ret - } - - return o.Data -} - -// GetDataOk returns a tuple with the Data field value -// and a boolean to check if the value has been set. -func (o *EnvVarResponse) GetDataOk() (*EnvVar, bool) { - if o == nil { - return nil, false - } - return &o.Data, true -} - -// SetData sets field value -func (o *EnvVarResponse) SetData(v EnvVar) { - o.Data = v -} - -func (o EnvVarResponse) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o EnvVarResponse) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["data"] = o.Data - return toSerialize, nil -} - -func (o *EnvVarResponse) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "data", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err; - } - - for _, requiredProperty := range(requiredProperties) { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varEnvVarResponse := _EnvVarResponse{} - - decoder := json.NewDecoder(bytes.NewReader(data)) - decoder.DisallowUnknownFields() - err = decoder.Decode(&varEnvVarResponse) - - if err != nil { - return err - } - - *o = EnvVarResponse(varEnvVarResponse) - - return err -} - -type NullableEnvVarResponse struct { - value *EnvVarResponse - isSet bool -} - -func (v NullableEnvVarResponse) Get() *EnvVarResponse { - return v.value -} - -func (v *NullableEnvVarResponse) Set(val *EnvVarResponse) { - v.value = val - v.isSet = true -} - -func (v NullableEnvVarResponse) IsSet() bool { - return v.isSet -} - -func (v *NullableEnvVarResponse) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableEnvVarResponse(val *EnvVarResponse) *NullableEnvVarResponse { - return &NullableEnvVarResponse{value: val, isSet: true} -} - -func (v NullableEnvVarResponse) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableEnvVarResponse) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_error_detail.go b/model_error_detail.go deleted file mode 100644 index ba9be6f..0000000 --- a/model_error_detail.go +++ /dev/null @@ -1,163 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" -) - -// checks if the ErrorDetail type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &ErrorDetail{} - -// ErrorDetail struct for ErrorDetail -type ErrorDetail struct { - Type *ErrorType `json:"type,omitempty"` - // Human-readable error message describing what went wrong. - Message *string `json:"message,omitempty"` -} - -// NewErrorDetail instantiates a new ErrorDetail object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewErrorDetail() *ErrorDetail { - this := ErrorDetail{} - return &this -} - -// NewErrorDetailWithDefaults instantiates a new ErrorDetail object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewErrorDetailWithDefaults() *ErrorDetail { - this := ErrorDetail{} - return &this -} - -// GetType returns the Type field value if set, zero value otherwise. -func (o *ErrorDetail) GetType() ErrorType { - if o == nil || IsNil(o.Type) { - var ret ErrorType - return ret - } - return *o.Type -} - -// GetTypeOk returns a tuple with the Type field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ErrorDetail) GetTypeOk() (*ErrorType, bool) { - if o == nil || IsNil(o.Type) { - return nil, false - } - return o.Type, true -} - -// HasType returns a boolean if a field has been set. -func (o *ErrorDetail) HasType() bool { - if o != nil && !IsNil(o.Type) { - return true - } - - return false -} - -// SetType gets a reference to the given ErrorType and assigns it to the Type field. -func (o *ErrorDetail) SetType(v ErrorType) { - o.Type = &v -} - -// GetMessage returns the Message field value if set, zero value otherwise. -func (o *ErrorDetail) GetMessage() string { - if o == nil || IsNil(o.Message) { - var ret string - return ret - } - return *o.Message -} - -// GetMessageOk returns a tuple with the Message field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ErrorDetail) GetMessageOk() (*string, bool) { - if o == nil || IsNil(o.Message) { - return nil, false - } - return o.Message, true -} - -// HasMessage returns a boolean if a field has been set. -func (o *ErrorDetail) HasMessage() bool { - if o != nil && !IsNil(o.Message) { - return true - } - - return false -} - -// SetMessage gets a reference to the given string and assigns it to the Message field. -func (o *ErrorDetail) SetMessage(v string) { - o.Message = &v -} - -func (o ErrorDetail) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o ErrorDetail) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if !IsNil(o.Type) { - toSerialize["type"] = o.Type - } - if !IsNil(o.Message) { - toSerialize["message"] = o.Message - } - return toSerialize, nil -} - -type NullableErrorDetail struct { - value *ErrorDetail - isSet bool -} - -func (v NullableErrorDetail) Get() *ErrorDetail { - return v.value -} - -func (v *NullableErrorDetail) Set(val *ErrorDetail) { - v.value = val - v.isSet = true -} - -func (v NullableErrorDetail) IsSet() bool { - return v.isSet -} - -func (v *NullableErrorDetail) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableErrorDetail(val *ErrorDetail) *NullableErrorDetail { - return &NullableErrorDetail{value: val, isSet: true} -} - -func (v NullableErrorDetail) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableErrorDetail) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_error_response.go b/model_error_response.go deleted file mode 100644 index ed43df4..0000000 --- a/model_error_response.go +++ /dev/null @@ -1,158 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" - "bytes" - "fmt" -) - -// checks if the ErrorResponse type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &ErrorResponse{} - -// ErrorResponse struct for ErrorResponse -type ErrorResponse struct { - Error ErrorDetail `json:"error"` -} - -type _ErrorResponse ErrorResponse - -// NewErrorResponse instantiates a new ErrorResponse object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewErrorResponse(error_ ErrorDetail) *ErrorResponse { - this := ErrorResponse{} - this.Error = error_ - return &this -} - -// NewErrorResponseWithDefaults instantiates a new ErrorResponse object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewErrorResponseWithDefaults() *ErrorResponse { - this := ErrorResponse{} - return &this -} - -// GetError returns the Error field value -func (o *ErrorResponse) GetError() ErrorDetail { - if o == nil { - var ret ErrorDetail - return ret - } - - return o.Error -} - -// GetErrorOk returns a tuple with the Error field value -// and a boolean to check if the value has been set. -func (o *ErrorResponse) GetErrorOk() (*ErrorDetail, bool) { - if o == nil { - return nil, false - } - return &o.Error, true -} - -// SetError sets field value -func (o *ErrorResponse) SetError(v ErrorDetail) { - o.Error = v -} - -func (o ErrorResponse) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o ErrorResponse) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["error"] = o.Error - return toSerialize, nil -} - -func (o *ErrorResponse) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "error", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err; - } - - for _, requiredProperty := range(requiredProperties) { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varErrorResponse := _ErrorResponse{} - - decoder := json.NewDecoder(bytes.NewReader(data)) - decoder.DisallowUnknownFields() - err = decoder.Decode(&varErrorResponse) - - if err != nil { - return err - } - - *o = ErrorResponse(varErrorResponse) - - return err -} - -type NullableErrorResponse struct { - value *ErrorResponse - isSet bool -} - -func (v NullableErrorResponse) Get() *ErrorResponse { - return v.value -} - -func (v *NullableErrorResponse) Set(val *ErrorResponse) { - v.value = val - v.isSet = true -} - -func (v NullableErrorResponse) IsSet() bool { - return v.isSet -} - -func (v *NullableErrorResponse) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableErrorResponse(val *ErrorResponse) *NullableErrorResponse { - return &NullableErrorResponse{value: val, isSet: true} -} - -func (v NullableErrorResponse) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableErrorResponse) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_error_type.go b/model_error_type.go deleted file mode 100644 index bf133e7..0000000 --- a/model_error_type.go +++ /dev/null @@ -1,889 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" - "fmt" -) - -// ErrorType Machine-processable error type identifier. -type ErrorType string - -// List of ErrorType -const ( - _3D_SECURE_AUTH_FAILED ErrorType = "3d-secure-auth-failed" - ACCESS_RIGHT_ALREADY_EXISTS ErrorType = "access-right-already-exists" - ACTION_NOT_FOUND ErrorType = "action-not-found" - ACTOR_ALREADY_RENTED ErrorType = "actor-already-rented" - ACTOR_CAN_NOT_BE_RENTED ErrorType = "actor-can-not-be-rented" - ACTOR_DISABLED ErrorType = "actor-disabled" - ACTOR_IS_NOT_RENTED ErrorType = "actor-is-not-rented" - ACTOR_MEMORY_LIMIT_EXCEEDED ErrorType = "actor-memory-limit-exceeded" - ACTOR_NAME_EXISTS_NEW_OWNER ErrorType = "actor-name-exists-new-owner" - ACTOR_NAME_NOT_UNIQUE ErrorType = "actor-name-not-unique" - ACTOR_NOT_FOUND ErrorType = "actor-not-found" - ACTOR_NOT_GITHUB_ACTOR ErrorType = "actor-not-github-actor" - ACTOR_NOT_PUBLIC ErrorType = "actor-not-public" - ACTOR_PERMISSION_LEVEL_NOT_SUPPORTED_FOR_AGENTIC_PAYMENTS ErrorType = "actor-permission-level-not-supported-for-agentic-payments" - ACTOR_REVIEW_ALREADY_EXISTS ErrorType = "actor-review-already-exists" - ACTOR_RUN_FAILED ErrorType = "actor-run-failed" - ACTOR_STANDBY_NOT_SUPPORTED_FOR_AGENTIC_PAYMENTS ErrorType = "actor-standby-not-supported-for-agentic-payments" - ACTOR_TASK_NAME_NOT_UNIQUE ErrorType = "actor-task-name-not-unique" - AGENTIC_PAYMENT_INFO_RETRIEVAL_ERROR ErrorType = "agentic-payment-info-retrieval-error" - AGENTIC_PAYMENT_INFORMATION_MISSING ErrorType = "agentic-payment-information-missing" - AGENTIC_PAYMENT_INSUFFICIENT_AMOUNT ErrorType = "agentic-payment-insufficient-amount" - AGENTIC_PAYMENT_PROVIDER_INTERNAL_ERROR ErrorType = "agentic-payment-provider-internal-error" - AGENTIC_PAYMENT_PROVIDER_UNAUTHORIZED ErrorType = "agentic-payment-provider-unauthorized" - AIRTABLE_WEBHOOK_DEPRECATED ErrorType = "airtable-webhook-deprecated" - ALREADY_SUBSCRIBED_TO_PAID_ACTOR ErrorType = "already-subscribed-to-paid-actor" - APIFY_PLAN_REQUIRED_TO_USE_PAID_ACTOR ErrorType = "apify-plan-required-to-use-paid-actor" - APIFY_SIGNUP_NOT_ALLOWED ErrorType = "apify-signup-not-allowed" - AUTH_METHOD_NOT_SUPPORTED ErrorType = "auth-method-not-supported" - AUTHORIZATION_SERVER_NOT_FOUND ErrorType = "authorization-server-not-found" - AUTO_ISSUE_DATE_INVALID ErrorType = "auto-issue-date-invalid" - BACKGROUND_CHECK_REQUIRED ErrorType = "background-check-required" - BILLING_SYSTEM_ERROR ErrorType = "billing-system-error" - BLACK_FRIDAY_PLAN_EXPIRED ErrorType = "black-friday-plan-expired" - BRAINTREE_ERROR ErrorType = "braintree-error" - BRAINTREE_NOT_LINKED ErrorType = "braintree-not-linked" - BRAINTREE_OPERATION_TIMED_OUT ErrorType = "braintree-operation-timed-out" - BRAINTREE_UNSUPPORTED_CURRENCY ErrorType = "braintree-unsupported-currency" - BUILD_NOT_FOUND ErrorType = "build-not-found" - BUILD_OUTDATED ErrorType = "build-outdated" - CANNOT_ADD_APIFY_EVENTS_TO_PPE_ACTOR ErrorType = "cannot-add-apify-events-to-ppe-actor" - CANNOT_ADD_MULTIPLE_PRICING_INFOS ErrorType = "cannot-add-multiple-pricing-infos" - CANNOT_ADD_PRICING_INFO_THAT_ALTERS_PAST ErrorType = "cannot-add-pricing-info-that-alters-past" - CANNOT_ADD_SECOND_FUTURE_PRICING_INFO ErrorType = "cannot-add-second-future-pricing-info" - CANNOT_BUILD_ACTOR_FROM_WEBHOOK ErrorType = "cannot-build-actor-from-webhook" - CANNOT_CHANGE_BILLING_INTERVAL ErrorType = "cannot-change-billing-interval" - CANNOT_CHANGE_OWNER ErrorType = "cannot-change-owner" - CANNOT_CHARGE_APIFY_EVENT ErrorType = "cannot-charge-apify-event" - CANNOT_CHARGE_NON_PAY_PER_EVENT_ACTOR ErrorType = "cannot-charge-non-pay-per-event-actor" - CANNOT_COMMENT_AS_OTHER_USER ErrorType = "cannot-comment-as-other-user" - CANNOT_COPY_ACTOR_TASK ErrorType = "cannot-copy-actor-task" - CANNOT_CREATE_PAYOUT ErrorType = "cannot-create-payout" - CANNOT_CREATE_PUBLIC_ACTOR ErrorType = "cannot-create-public-actor" - CANNOT_CREATE_TAX_TRANSACTION ErrorType = "cannot-create-tax-transaction" - CANNOT_DELETE_CRITICAL_ACTOR ErrorType = "cannot-delete-critical-actor" - CANNOT_DELETE_INVOICE ErrorType = "cannot-delete-invoice" - CANNOT_DELETE_PAID_ACTOR ErrorType = "cannot-delete-paid-actor" - CANNOT_DISABLE_ONE_TIME_EVENT_FOR_APIFY_START_EVENT ErrorType = "cannot-disable-one-time-event-for-apify-start-event" - CANNOT_DISABLE_ORGANIZATION_WITH_ENABLED_MEMBERS ErrorType = "cannot-disable-organization-with-enabled-members" - CANNOT_DISABLE_USER_WITH_SUBSCRIPTION ErrorType = "cannot-disable-user-with-subscription" - CANNOT_LINK_OAUTH_TO_UNVERIFIED_EMAIL ErrorType = "cannot-link-oauth-to-unverified-email" - CANNOT_METAMORPH_TO_PAY_PER_RESULT_ACTOR ErrorType = "cannot-metamorph-to-pay-per-result-actor" - CANNOT_MODIFY_ACTOR_PRICING_TOO_FREQUENTLY ErrorType = "cannot-modify-actor-pricing-too-frequently" - CANNOT_MODIFY_ACTOR_PRICING_WITH_IMMEDIATE_EFFECT ErrorType = "cannot-modify-actor-pricing-with-immediate-effect" - CANNOT_OVERRIDE_PAID_ACTOR_TRIAL ErrorType = "cannot-override-paid-actor-trial" - CANNOT_PERMANENTLY_DELETE_SUBSCRIPTION ErrorType = "cannot-permanently-delete-subscription" - CANNOT_PUBLISH_ACTOR ErrorType = "cannot-publish-actor" - CANNOT_REDUCE_LAST_FULL_TOKEN ErrorType = "cannot-reduce-last-full-token" - CANNOT_REIMBURSE_MORE_THAN_ORIGINAL_CHARGE ErrorType = "cannot-reimburse-more-than-original-charge" - CANNOT_REIMBURSE_NON_RENTAL_CHARGE ErrorType = "cannot-reimburse-non-rental-charge" - CANNOT_REMOVE_OWN_ACTOR_FROM_RECENTLY_USED ErrorType = "cannot-remove-own-actor-from-recently-used" - CANNOT_REMOVE_PAYMENT_METHOD ErrorType = "cannot-remove-payment-method" - CANNOT_REMOVE_PRICING_INFO ErrorType = "cannot-remove-pricing-info" - CANNOT_REMOVE_RUNNING_RUN ErrorType = "cannot-remove-running-run" - CANNOT_REMOVE_USER_WITH_PUBLIC_ACTORS ErrorType = "cannot-remove-user-with-public-actors" - CANNOT_REMOVE_USER_WITH_SUBSCRIPTION ErrorType = "cannot-remove-user-with-subscription" - CANNOT_REMOVE_USER_WITH_UNPAID_INVOICE ErrorType = "cannot-remove-user-with-unpaid-invoice" - CANNOT_RENAME_ENV_VAR ErrorType = "cannot-rename-env-var" - CANNOT_RENT_PAID_ACTOR ErrorType = "cannot-rent-paid-actor" - CANNOT_REVIEW_OWN_ACTOR ErrorType = "cannot-review-own-actor" - CANNOT_SET_ACCESS_RIGHTS_FOR_OWNER ErrorType = "cannot-set-access-rights-for-owner" - CANNOT_SET_IS_STATUS_MESSAGE_TERMINAL ErrorType = "cannot-set-is-status-message-terminal" - CANNOT_UNPUBLISH_CRITICAL_ACTOR ErrorType = "cannot-unpublish-critical-actor" - CANNOT_UNPUBLISH_PAID_ACTOR ErrorType = "cannot-unpublish-paid-actor" - CANNOT_UNPUBLISH_PROFILE ErrorType = "cannot-unpublish-profile" - CANNOT_UPDATE_INVOICE_FIELD ErrorType = "cannot-update-invoice-field" - CONCURRENT_RUNS_LIMIT_EXCEEDED ErrorType = "concurrent-runs-limit-exceeded" - CONCURRENT_UPDATE_DETECTED ErrorType = "concurrent-update-detected" - CONFERENCE_TOKEN_NOT_FOUND ErrorType = "conference-token-not-found" - CONTENT_ENCODING_FORBIDDEN_FOR_HTML ErrorType = "content-encoding-forbidden-for-html" - COUPON_ALREADY_REDEEMED ErrorType = "coupon-already-redeemed" - COUPON_EXPIRED ErrorType = "coupon-expired" - COUPON_FOR_NEW_CUSTOMERS ErrorType = "coupon-for-new-customers" - COUPON_FOR_SUBSCRIBED_USERS ErrorType = "coupon-for-subscribed-users" - COUPON_LIMITS_ARE_IN_CONFLICT_WITH_CURRENT_LIMITS ErrorType = "coupon-limits-are-in-conflict-with-current-limits" - COUPON_MAX_NUMBER_OF_REDEMPTIONS_REACHED ErrorType = "coupon-max-number-of-redemptions-reached" - COUPON_NOT_FOUND ErrorType = "coupon-not-found" - COUPON_NOT_UNIQUE ErrorType = "coupon-not-unique" - COUPONS_DISABLED ErrorType = "coupons-disabled" - CREATE_GITHUB_ISSUE_NOT_ALLOWED ErrorType = "create-github-issue-not-allowed" - CREATOR_PLAN_NOT_AVAILABLE ErrorType = "creator-plan-not-available" - CRON_EXPRESSION_INVALID ErrorType = "cron-expression-invalid" - DAILY_AI_TOKEN_LIMIT_EXCEEDED ErrorType = "daily-ai-token-limit-exceeded" - DAILY_PUBLICATION_LIMIT_EXCEEDED ErrorType = "daily-publication-limit-exceeded" - DATASET_DOES_NOT_HAVE_FIELDS_SCHEMA ErrorType = "dataset-does-not-have-fields-schema" - DATASET_DOES_NOT_HAVE_SCHEMA ErrorType = "dataset-does-not-have-schema" - DATASET_LOCKED ErrorType = "dataset-locked" - DATASET_SCHEMA_INVALID ErrorType = "dataset-schema-invalid" - DCR_NOT_SUPPORTED ErrorType = "dcr-not-supported" - DEFAULT_DATASET_NOT_FOUND ErrorType = "default-dataset-not-found" - DELETING_DEFAULT_BUILD ErrorType = "deleting-default-build" - DELETING_UNFINISHED_BUILD ErrorType = "deleting-unfinished-build" - EMAIL_ALREADY_TAKEN ErrorType = "email-already-taken" - EMAIL_ALREADY_TAKEN_REMOVED_USER ErrorType = "email-already-taken-removed-user" - EMAIL_DOMAIN_NOT_ALLOWED_FOR_COUPON ErrorType = "email-domain-not-allowed-for-coupon" - EMAIL_INVALID ErrorType = "email-invalid" - EMAIL_NOT_ALLOWED ErrorType = "email-not-allowed" - EMAIL_NOT_VALID ErrorType = "email-not-valid" - EMAIL_UPDATE_TOO_SOON ErrorType = "email-update-too-soon" - ELEVATED_PERMISSIONS_NEEDED ErrorType = "elevated-permissions-needed" - ENV_VAR_ALREADY_EXISTS ErrorType = "env-var-already-exists" - EXCHANGE_RATE_FETCH_FAILED ErrorType = "exchange-rate-fetch-failed" - EXPIRED_CONFERENCE_TOKEN ErrorType = "expired-conference-token" - FAILED_TO_CHARGE_USER ErrorType = "failed-to-charge-user" - FINAL_INVOICE_NEGATIVE ErrorType = "final-invoice-negative" - FULL_PERMISSION_ACTOR_NOT_APPROVED ErrorType = "full-permission-actor-not-approved" - GITHUB_BRANCH_EMPTY ErrorType = "github-branch-empty" - GITHUB_ISSUE_ALREADY_EXISTS ErrorType = "github-issue-already-exists" - GITHUB_PUBLIC_KEY_NOT_FOUND ErrorType = "github-public-key-not-found" - GITHUB_REPOSITORY_NOT_FOUND ErrorType = "github-repository-not-found" - GITHUB_SIGNATURE_DOES_NOT_MATCH_PAYLOAD ErrorType = "github-signature-does-not-match-payload" - GITHUB_USER_NOT_AUTHORIZED_FOR_ISSUES ErrorType = "github-user-not-authorized-for-issues" - GMAIL_NOT_ALLOWED ErrorType = "gmail-not-allowed" - ID_DOES_NOT_MATCH ErrorType = "id-does-not-match" - INCOMPATIBLE_BILLING_INTERVAL ErrorType = "incompatible-billing-interval" - INCOMPLETE_PAYOUT_BILLING_INFO ErrorType = "incomplete-payout-billing-info" - INCONSISTENT_CURRENCIES ErrorType = "inconsistent-currencies" - INCORRECT_PRICING_MODIFIER_PREFIX ErrorType = "incorrect-pricing-modifier-prefix" - INPUT_JSON_INVALID_CHARACTERS ErrorType = "input-json-invalid-characters" - INPUT_JSON_NOT_OBJECT ErrorType = "input-json-not-object" - INPUT_JSON_TOO_LONG ErrorType = "input-json-too-long" - INPUT_UPDATE_COLLISION ErrorType = "input-update-collision" - INSUFFICIENT_PERMISSIONS ErrorType = "insufficient-permissions" - INSUFFICIENT_PERMISSIONS_TO_CHANGE_FIELD ErrorType = "insufficient-permissions-to-change-field" - INSUFFICIENT_SECURITY_MEASURES ErrorType = "insufficient-security-measures" - INSUFFICIENT_TAX_COUNTRY_EVIDENCE ErrorType = "insufficient-tax-country-evidence" - INTEGRATION_AUTH_ERROR ErrorType = "integration-auth-error" - INTERNAL_SERVER_ERROR ErrorType = "internal-server-error" - INVALID_BILLING_INFO ErrorType = "invalid-billing-info" - INVALID_BILLING_PERIOD_FOR_PAYOUT ErrorType = "invalid-billing-period-for-payout" - INVALID_BUILD ErrorType = "invalid-build" - INVALID_CLIENT_KEY ErrorType = "invalid-client-key" - INVALID_COLLECTION ErrorType = "invalid-collection" - INVALID_CONFERENCE_LOGIN_PASSWORD ErrorType = "invalid-conference-login-password" - INVALID_CONTENT_TYPE_HEADER ErrorType = "invalid-content-type-header" - INVALID_CREDENTIALS ErrorType = "invalid-credentials" - INVALID_GIT_AUTH_TOKEN ErrorType = "invalid-git-auth-token" - INVALID_GITHUB_ISSUE_URL ErrorType = "invalid-github-issue-url" - INVALID_HEADER ErrorType = "invalid-header" - INVALID_ID ErrorType = "invalid-id" - INVALID_IDEMPOTENCY_KEY ErrorType = "invalid-idempotency-key" - INVALID_INPUT ErrorType = "invalid-input" - INVALID_INPUT_SCHEMA ErrorType = "invalid-input-schema" - INVALID_INVOICE ErrorType = "invalid-invoice" - INVALID_INVOICE_TYPE ErrorType = "invalid-invoice-type" - INVALID_ISSUE_DATE ErrorType = "invalid-issue-date" - INVALID_LABEL_PARAMS ErrorType = "invalid-label-params" - INVALID_MAIN_ACCOUNT_USER_ID ErrorType = "invalid-main-account-user-id" - INVALID_OAUTH_APP ErrorType = "invalid-oauth-app" - INVALID_OAUTH_SCOPE ErrorType = "invalid-oauth-scope" - INVALID_ONE_TIME_INVOICE ErrorType = "invalid-one-time-invoice" - INVALID_PARAMETER ErrorType = "invalid-parameter" - INVALID_PAYOUT_STATUS ErrorType = "invalid-payout-status" - INVALID_PICTURE_URL ErrorType = "invalid-picture-url" - INVALID_RECORD_KEY ErrorType = "invalid-record-key" - INVALID_REQUEST ErrorType = "invalid-request" - INVALID_RESOURCE_TYPE ErrorType = "invalid-resource-type" - INVALID_SIGNATURE ErrorType = "invalid-signature" - INVALID_SUBSCRIPTION_PLAN ErrorType = "invalid-subscription-plan" - INVALID_TAX_NUMBER ErrorType = "invalid-tax-number" - INVALID_TAX_NUMBER_FORMAT ErrorType = "invalid-tax-number-format" - INVALID_TOKEN ErrorType = "invalid-token" - INVALID_TOKEN_TYPE ErrorType = "invalid-token-type" - INVALID_TWO_FACTOR_CODE ErrorType = "invalid-two-factor-code" - INVALID_TWO_FACTOR_CODE_OR_RECOVERY_CODE ErrorType = "invalid-two-factor-code-or-recovery-code" - INVALID_TWO_FACTOR_RECOVERY_CODE ErrorType = "invalid-two-factor-recovery-code" - INVALID_USERNAME ErrorType = "invalid-username" - INVALID_VALUE ErrorType = "invalid-value" - INVITATION_INVALID_RESOURCE_TYPE ErrorType = "invitation-invalid-resource-type" - INVITATION_NO_LONGER_VALID ErrorType = "invitation-no-longer-valid" - INVOICE_CANCELED ErrorType = "invoice-canceled" - INVOICE_CANNOT_BE_REFUNDED_DUE_TO_TOO_HIGH_AMOUNT ErrorType = "invoice-cannot-be-refunded-due-to-too-high-amount" - INVOICE_INCOMPLETE ErrorType = "invoice-incomplete" - INVOICE_IS_DRAFT ErrorType = "invoice-is-draft" - INVOICE_LOCKED ErrorType = "invoice-locked" - INVOICE_MUST_BE_BUFFER ErrorType = "invoice-must-be-buffer" - INVOICE_NOT_CANCELED ErrorType = "invoice-not-canceled" - INVOICE_NOT_DRAFT ErrorType = "invoice-not-draft" - INVOICE_NOT_FOUND ErrorType = "invoice-not-found" - INVOICE_OUTDATED ErrorType = "invoice-outdated" - INVOICE_PAID_ALREADY ErrorType = "invoice-paid-already" - ISSUE_ALREADY_CONNECTED_TO_GITHUB ErrorType = "issue-already-connected-to-github" - ISSUE_NOT_FOUND ErrorType = "issue-not-found" - ISSUES_BAD_REQUEST ErrorType = "issues-bad-request" - ISSUER_NOT_REGISTERED ErrorType = "issuer-not-registered" - JOB_FINISHED ErrorType = "job-finished" - LABEL_ALREADY_LINKED ErrorType = "label-already-linked" - LAST_API_TOKEN ErrorType = "last-api-token" - LIMIT_REACHED ErrorType = "limit-reached" - MAX_ITEMS_MUST_BE_GREATER_THAN_ZERO ErrorType = "max-items-must-be-greater-than-zero" - MAX_METAMORPHS_EXCEEDED ErrorType = "max-metamorphs-exceeded" - MAX_TOTAL_CHARGE_USD_BELOW_MINIMUM ErrorType = "max-total-charge-usd-below-minimum" - MAX_TOTAL_CHARGE_USD_MUST_BE_GREATER_THAN_ZERO ErrorType = "max-total-charge-usd-must-be-greater-than-zero" - METHOD_NOT_ALLOWED ErrorType = "method-not-allowed" - MIGRATION_DISABLED ErrorType = "migration-disabled" - MISSING_ACTOR_RIGHTS ErrorType = "missing-actor-rights" - MISSING_API_TOKEN ErrorType = "missing-api-token" - MISSING_BILLING_INFO ErrorType = "missing-billing-info" - MISSING_LINE_ITEMS ErrorType = "missing-line-items" - MISSING_PAYMENT_DATE ErrorType = "missing-payment-date" - MISSING_PAYOUT_BILLING_INFO ErrorType = "missing-payout-billing-info" - MISSING_PROXY_PASSWORD ErrorType = "missing-proxy-password" - MISSING_REPORTING_FIELDS ErrorType = "missing-reporting-fields" - MISSING_RESOURCE_NAME ErrorType = "missing-resource-name" - MISSING_SETTINGS ErrorType = "missing-settings" - MISSING_USERNAME ErrorType = "missing-username" - MONTHLY_USAGE_LIMIT_TOO_LOW ErrorType = "monthly-usage-limit-too-low" - MORE_THAN_ONE_UPDATE_NOT_ALLOWED ErrorType = "more-than-one-update-not-allowed" - MULTIPLE_RECORDS_FOUND ErrorType = "multiple-records-found" - MUST_BE_ADMIN ErrorType = "must-be-admin" - NAME_NOT_UNIQUE ErrorType = "name-not-unique" - NEXT_RUNTIME_COMPUTATION_FAILED ErrorType = "next-runtime-computation-failed" - NO_COLUMNS_IN_EXPORTED_DATASET ErrorType = "no-columns-in-exported-dataset" - NO_PAYMENT_ATTEMPT_FOR_REFUND_FOUND ErrorType = "no-payment-attempt-for-refund-found" - NO_PAYMENT_METHOD_AVAILABLE ErrorType = "no-payment-method-available" - NO_TEAM_ACCOUNT_SEATS_AVAILABLE ErrorType = "no-team-account-seats-available" - NON_TEMPORARY_EMAIL ErrorType = "non-temporary-email" - NOT_ENOUGH_USAGE_TO_RUN_PAID_ACTOR ErrorType = "not-enough-usage-to-run-paid-actor" - NOT_IMPLEMENTED ErrorType = "not-implemented" - NOT_SUPPORTED_CURRENCIES ErrorType = "not-supported-currencies" - O_AUTH_SERVICE_ALREADY_CONNECTED ErrorType = "o-auth-service-already-connected" - O_AUTH_SERVICE_NOT_CONNECTED ErrorType = "o-auth-service-not-connected" - OAUTH_RESOURCE_ACCESS_FAILED ErrorType = "oauth-resource-access-failed" - ONE_TIME_INVOICE_ALREADY_MARKED_PAID ErrorType = "one-time-invoice-already-marked-paid" - ONLY_DRAFTS_CAN_BE_DELETED ErrorType = "only-drafts-can-be-deleted" - OPERATION_CANCELED ErrorType = "operation-canceled" - OPERATION_NOT_ALLOWED ErrorType = "operation-not-allowed" - OPERATION_TIMED_OUT ErrorType = "operation-timed-out" - ORGANIZATION_CANNOT_OWN_ITSELF ErrorType = "organization-cannot-own-itself" - ORGANIZATION_ROLE_NOT_FOUND ErrorType = "organization-role-not-found" - OVERLAPPING_PAYOUT_BILLING_PERIODS ErrorType = "overlapping-payout-billing-periods" - OWN_TOKEN_REQUIRED ErrorType = "own-token-required" - PAGE_NOT_FOUND ErrorType = "page-not-found" - PARAM_NOT_ONE_OF ErrorType = "param-not-one-of" - PARAMETER_REQUIRED ErrorType = "parameter-required" - PARAMETERS_MISMATCHED ErrorType = "parameters-mismatched" - PASSWORD_RESET_EMAIL_ALREADY_SENT ErrorType = "password-reset-email-already-sent" - PASSWORD_RESET_TOKEN_EXPIRED ErrorType = "password-reset-token-expired" - PAY_AS_YOU_GO_WITHOUT_MONTHLY_INTERVAL ErrorType = "pay-as-you-go-without-monthly-interval" - PAYMENT_ATTEMPT_STATUS_MESSAGE_REQUIRED ErrorType = "payment-attempt-status-message-required" - PAYOUT_ALREADY_PAID ErrorType = "payout-already-paid" - PAYOUT_CANCELED ErrorType = "payout-canceled" - PAYOUT_INVALID_STATE ErrorType = "payout-invalid-state" - PAYOUT_MUST_BE_APPROVED_TO_BE_MARKED_PAID ErrorType = "payout-must-be-approved-to-be-marked-paid" - PAYOUT_NOT_FOUND ErrorType = "payout-not-found" - PAYOUT_NUMBER_ALREADY_EXISTS ErrorType = "payout-number-already-exists" - PHONE_NUMBER_INVALID ErrorType = "phone-number-invalid" - PHONE_NUMBER_LANDLINE ErrorType = "phone-number-landline" - PHONE_NUMBER_OPTED_OUT ErrorType = "phone-number-opted-out" - PHONE_VERIFICATION_DISABLED ErrorType = "phone-verification-disabled" - PLATFORM_FEATURE_DISABLED ErrorType = "platform-feature-disabled" - PRICE_OVERRIDES_VALIDATION_FAILED ErrorType = "price-overrides-validation-failed" - PRICING_MODEL_NOT_SUPPORTED ErrorType = "pricing-model-not-supported" - PROMOTIONAL_PLAN_NOT_AVAILABLE ErrorType = "promotional-plan-not-available" - PROXY_AUTH_IP_NOT_UNIQUE ErrorType = "proxy-auth-ip-not-unique" - PUBLIC_ACTOR_DISABLED ErrorType = "public-actor-disabled" - QUERY_TIMEOUT ErrorType = "query-timeout" - QUOTED_PRICE_OUTDATED ErrorType = "quoted-price-outdated" - RATE_LIMIT_EXCEEDED ErrorType = "rate-limit-exceeded" - RECAPTCHA_INVALID ErrorType = "recaptcha-invalid" - RECAPTCHA_REQUIRED ErrorType = "recaptcha-required" - RECORD_NOT_FOUND ErrorType = "record-not-found" - RECORD_NOT_PUBLIC ErrorType = "record-not-public" - RECORD_OR_TOKEN_NOT_FOUND ErrorType = "record-or-token-not-found" - RECORD_TOO_LARGE ErrorType = "record-too-large" - REDIRECT_URI_MISMATCH ErrorType = "redirect-uri-mismatch" - REDUCED_PLAN_NOT_AVAILABLE ErrorType = "reduced-plan-not-available" - RENTAL_CHARGE_ALREADY_REIMBURSED ErrorType = "rental-charge-already-reimbursed" - RENTAL_NOT_ALLOWED ErrorType = "rental-not-allowed" - REQUEST_ABORTED_PREMATURELY ErrorType = "request-aborted-prematurely" - REQUEST_HANDLED_OR_LOCKED ErrorType = "request-handled-or-locked" - REQUEST_ID_INVALID ErrorType = "request-id-invalid" - REQUEST_QUEUE_DUPLICATE_REQUESTS ErrorType = "request-queue-duplicate-requests" - REQUEST_TOO_LARGE ErrorType = "request-too-large" - REQUESTED_DATASET_VIEW_DOES_NOT_EXIST ErrorType = "requested-dataset-view-does-not-exist" - RESUME_TOKEN_EXPIRED ErrorType = "resume-token-expired" - RUN_FAILED ErrorType = "run-failed" - RUN_INPUT_BODY_NOT_VALID_JSON ErrorType = "run-input-body-not-valid-json" - RUN_TIMEOUT_EXCEEDED ErrorType = "run-timeout-exceeded" - RUSSIA_IS_EVIL ErrorType = "russia-is-evil" - SAME_USER ErrorType = "same-user" - SCHEDULE_ACTOR_NOT_FOUND ErrorType = "schedule-actor-not-found" - SCHEDULE_ACTOR_TASK_NOT_FOUND ErrorType = "schedule-actor-task-not-found" - SCHEDULE_NAME_NOT_UNIQUE ErrorType = "schedule-name-not-unique" - SCHEMA_VALIDATION ErrorType = "schema-validation" - SCHEMA_VALIDATION_ERROR ErrorType = "schema-validation-error" - SCHEMA_VALIDATION_FAILED ErrorType = "schema-validation-failed" - SIGN_UP_METHOD_NOT_ALLOWED ErrorType = "sign-up-method-not-allowed" - SLACK_INTEGRATION_NOT_CUSTOM ErrorType = "slack-integration-not-custom" - SOCKET_CLOSED ErrorType = "socket-closed" - SOCKET_DESTROYED ErrorType = "socket-destroyed" - STORE_SCHEMA_INVALID ErrorType = "store-schema-invalid" - STORE_TERMS_NOT_ACCEPTED ErrorType = "store-terms-not-accepted" - STRIPE_ENABLED ErrorType = "stripe-enabled" - STRIPE_GENERIC_DECLINE ErrorType = "stripe-generic-decline" - STRIPE_NOT_ENABLED ErrorType = "stripe-not-enabled" - STRIPE_NOT_ENABLED_FOR_USER ErrorType = "stripe-not-enabled-for-user" - TAGGED_BUILD_REQUIRED ErrorType = "tagged-build-required" - TAX_COUNTRY_INVALID ErrorType = "tax-country-invalid" - TAX_NUMBER_INVALID ErrorType = "tax-number-invalid" - TAX_NUMBER_VALIDATION_FAILED ErrorType = "tax-number-validation-failed" - TAXAMO_CALL_FAILED ErrorType = "taxamo-call-failed" - TAXAMO_REQUEST_FAILED ErrorType = "taxamo-request-failed" - TESTING_ERROR ErrorType = "testing-error" - TOKEN_NOT_PROVIDED ErrorType = "token-not-provided" - TOO_FEW_VERSIONS ErrorType = "too-few-versions" - TOO_MANY_ACTOR_TASKS ErrorType = "too-many-actor-tasks" - TOO_MANY_ACTORS ErrorType = "too-many-actors" - TOO_MANY_LABELS_ON_RESOURCE ErrorType = "too-many-labels-on-resource" - TOO_MANY_MCP_CONNECTORS ErrorType = "too-many-mcp-connectors" - TOO_MANY_O_AUTH_APPS ErrorType = "too-many-o-auth-apps" - TOO_MANY_ORGANIZATIONS ErrorType = "too-many-organizations" - TOO_MANY_REQUESTS ErrorType = "too-many-requests" - TOO_MANY_SCHEDULES ErrorType = "too-many-schedules" - TOO_MANY_UI_ACCESS_KEYS ErrorType = "too-many-ui-access-keys" - TOO_MANY_USER_LABELS ErrorType = "too-many-user-labels" - TOO_MANY_VALUES ErrorType = "too-many-values" - TOO_MANY_VERSIONS ErrorType = "too-many-versions" - TOO_MANY_WEBHOOKS ErrorType = "too-many-webhooks" - UNEXPECTED_ROUTE ErrorType = "unexpected-route" - UNKNOWN_BUILD_TAG ErrorType = "unknown-build-tag" - UNKNOWN_PAYMENT_PROVIDER ErrorType = "unknown-payment-provider" - UNSUBSCRIBE_TOKEN_INVALID ErrorType = "unsubscribe-token-invalid" - UNSUPPORTED_ACTOR_PRICING_MODEL_FOR_AGENTIC_PAYMENTS ErrorType = "unsupported-actor-pricing-model-for-agentic-payments" - UNSUPPORTED_CONTENT_ENCODING ErrorType = "unsupported-content-encoding" - UNSUPPORTED_FILE_TYPE_FOR_ISSUE ErrorType = "unsupported-file-type-for-issue" - UNSUPPORTED_FILE_TYPE_IMAGE_EXPECTED ErrorType = "unsupported-file-type-image-expected" - UNSUPPORTED_FILE_TYPE_TEXT_OR_JSON_EXPECTED ErrorType = "unsupported-file-type-text-or-json-expected" - UNSUPPORTED_PERMISSION ErrorType = "unsupported-permission" - UPCOMING_SUBSCRIPTION_BILL_NOT_UP_TO_DATE ErrorType = "upcoming-subscription-bill-not-up-to-date" - USER_ALREADY_EXISTS ErrorType = "user-already-exists" - USER_ALREADY_VERIFIED ErrorType = "user-already-verified" - USER_CREATES_ORGANIZATIONS_TOO_FAST ErrorType = "user-creates-organizations-too-fast" - USER_DISABLED ErrorType = "user-disabled" - USER_EMAIL_IS_DISPOSABLE ErrorType = "user-email-is-disposable" - USER_EMAIL_NOT_SET ErrorType = "user-email-not-set" - USER_EMAIL_NOT_VERIFIED ErrorType = "user-email-not-verified" - USER_HAS_NO_SUBSCRIPTION ErrorType = "user-has-no-subscription" - USER_INTEGRATION_NOT_FOUND ErrorType = "user-integration-not-found" - USER_IS_ALREADY_INVITED ErrorType = "user-is-already-invited" - USER_IS_ALREADY_ORGANIZATION_MEMBER ErrorType = "user-is-already-organization-member" - USER_IS_NOT_MEMBER_OF_ORGANIZATION ErrorType = "user-is-not-member-of-organization" - USER_IS_NOT_ORGANIZATION ErrorType = "user-is-not-organization" - USER_IS_ORGANIZATION ErrorType = "user-is-organization" - USER_IS_ORGANIZATION_OWNER ErrorType = "user-is-organization-owner" - USER_IS_REMOVED ErrorType = "user-is-removed" - USER_NOT_FOUND ErrorType = "user-not-found" - USER_NOT_LOGGED_IN ErrorType = "user-not-logged-in" - USER_NOT_VERIFIED ErrorType = "user-not-verified" - USER_OR_TOKEN_NOT_FOUND ErrorType = "user-or-token-not-found" - USER_PLAN_NOT_ALLOWED_FOR_COUPON ErrorType = "user-plan-not-allowed-for-coupon" - USER_PROBLEM_WITH_CARD ErrorType = "user-problem-with-card" - USER_RECORD_NOT_FOUND ErrorType = "user-record-not-found" - USERNAME_ALREADY_TAKEN ErrorType = "username-already-taken" - USERNAME_MISSING ErrorType = "username-missing" - USERNAME_NOT_ALLOWED ErrorType = "username-not-allowed" - USERNAME_REMOVAL_FORBIDDEN ErrorType = "username-removal-forbidden" - USERNAME_REQUIRED ErrorType = "username-required" - VERIFICATION_EMAIL_ALREADY_SENT ErrorType = "verification-email-already-sent" - VERIFICATION_TOKEN_EXPIRED ErrorType = "verification-token-expired" - VERSION_ALREADY_EXISTS ErrorType = "version-already-exists" - VERSIONS_SIZE_EXCEEDED ErrorType = "versions-size-exceeded" - WEAK_PASSWORD ErrorType = "weak-password" - X402_AGENTIC_PAYMENT_ALREADY_FINALIZED ErrorType = "x402-agentic-payment-already-finalized" - X402_AGENTIC_PAYMENT_INSUFFICIENT_AMOUNT ErrorType = "x402-agentic-payment-insufficient-amount" - X402_AGENTIC_PAYMENT_MALFORMED_TOKEN ErrorType = "x402-agentic-payment-malformed-token" - X402_AGENTIC_PAYMENT_SETTLEMENT_FAILED ErrorType = "x402-agentic-payment-settlement-failed" - X402_AGENTIC_PAYMENT_SETTLEMENT_IN_PROGRESS ErrorType = "x402-agentic-payment-settlement-in-progress" - X402_AGENTIC_PAYMENT_SETTLEMENT_STUCK ErrorType = "x402-agentic-payment-settlement-stuck" - X402_AGENTIC_PAYMENT_UNAUTHORIZED ErrorType = "x402-agentic-payment-unauthorized" - X402_PAYMENT_REQUIRED ErrorType = "x402-payment-required" - ZERO_INVOICE ErrorType = "zero-invoice" -) - -// All allowed values of ErrorType enum -var AllowedErrorTypeEnumValues = []ErrorType{ - "3d-secure-auth-failed", - "access-right-already-exists", - "action-not-found", - "actor-already-rented", - "actor-can-not-be-rented", - "actor-disabled", - "actor-is-not-rented", - "actor-memory-limit-exceeded", - "actor-name-exists-new-owner", - "actor-name-not-unique", - "actor-not-found", - "actor-not-github-actor", - "actor-not-public", - "actor-permission-level-not-supported-for-agentic-payments", - "actor-review-already-exists", - "actor-run-failed", - "actor-standby-not-supported-for-agentic-payments", - "actor-task-name-not-unique", - "agentic-payment-info-retrieval-error", - "agentic-payment-information-missing", - "agentic-payment-insufficient-amount", - "agentic-payment-provider-internal-error", - "agentic-payment-provider-unauthorized", - "airtable-webhook-deprecated", - "already-subscribed-to-paid-actor", - "apify-plan-required-to-use-paid-actor", - "apify-signup-not-allowed", - "auth-method-not-supported", - "authorization-server-not-found", - "auto-issue-date-invalid", - "background-check-required", - "billing-system-error", - "black-friday-plan-expired", - "braintree-error", - "braintree-not-linked", - "braintree-operation-timed-out", - "braintree-unsupported-currency", - "build-not-found", - "build-outdated", - "cannot-add-apify-events-to-ppe-actor", - "cannot-add-multiple-pricing-infos", - "cannot-add-pricing-info-that-alters-past", - "cannot-add-second-future-pricing-info", - "cannot-build-actor-from-webhook", - "cannot-change-billing-interval", - "cannot-change-owner", - "cannot-charge-apify-event", - "cannot-charge-non-pay-per-event-actor", - "cannot-comment-as-other-user", - "cannot-copy-actor-task", - "cannot-create-payout", - "cannot-create-public-actor", - "cannot-create-tax-transaction", - "cannot-delete-critical-actor", - "cannot-delete-invoice", - "cannot-delete-paid-actor", - "cannot-disable-one-time-event-for-apify-start-event", - "cannot-disable-organization-with-enabled-members", - "cannot-disable-user-with-subscription", - "cannot-link-oauth-to-unverified-email", - "cannot-metamorph-to-pay-per-result-actor", - "cannot-modify-actor-pricing-too-frequently", - "cannot-modify-actor-pricing-with-immediate-effect", - "cannot-override-paid-actor-trial", - "cannot-permanently-delete-subscription", - "cannot-publish-actor", - "cannot-reduce-last-full-token", - "cannot-reimburse-more-than-original-charge", - "cannot-reimburse-non-rental-charge", - "cannot-remove-own-actor-from-recently-used", - "cannot-remove-payment-method", - "cannot-remove-pricing-info", - "cannot-remove-running-run", - "cannot-remove-user-with-public-actors", - "cannot-remove-user-with-subscription", - "cannot-remove-user-with-unpaid-invoice", - "cannot-rename-env-var", - "cannot-rent-paid-actor", - "cannot-review-own-actor", - "cannot-set-access-rights-for-owner", - "cannot-set-is-status-message-terminal", - "cannot-unpublish-critical-actor", - "cannot-unpublish-paid-actor", - "cannot-unpublish-profile", - "cannot-update-invoice-field", - "concurrent-runs-limit-exceeded", - "concurrent-update-detected", - "conference-token-not-found", - "content-encoding-forbidden-for-html", - "coupon-already-redeemed", - "coupon-expired", - "coupon-for-new-customers", - "coupon-for-subscribed-users", - "coupon-limits-are-in-conflict-with-current-limits", - "coupon-max-number-of-redemptions-reached", - "coupon-not-found", - "coupon-not-unique", - "coupons-disabled", - "create-github-issue-not-allowed", - "creator-plan-not-available", - "cron-expression-invalid", - "daily-ai-token-limit-exceeded", - "daily-publication-limit-exceeded", - "dataset-does-not-have-fields-schema", - "dataset-does-not-have-schema", - "dataset-locked", - "dataset-schema-invalid", - "dcr-not-supported", - "default-dataset-not-found", - "deleting-default-build", - "deleting-unfinished-build", - "email-already-taken", - "email-already-taken-removed-user", - "email-domain-not-allowed-for-coupon", - "email-invalid", - "email-not-allowed", - "email-not-valid", - "email-update-too-soon", - "elevated-permissions-needed", - "env-var-already-exists", - "exchange-rate-fetch-failed", - "expired-conference-token", - "failed-to-charge-user", - "final-invoice-negative", - "full-permission-actor-not-approved", - "github-branch-empty", - "github-issue-already-exists", - "github-public-key-not-found", - "github-repository-not-found", - "github-signature-does-not-match-payload", - "github-user-not-authorized-for-issues", - "gmail-not-allowed", - "id-does-not-match", - "incompatible-billing-interval", - "incomplete-payout-billing-info", - "inconsistent-currencies", - "incorrect-pricing-modifier-prefix", - "input-json-invalid-characters", - "input-json-not-object", - "input-json-too-long", - "input-update-collision", - "insufficient-permissions", - "insufficient-permissions-to-change-field", - "insufficient-security-measures", - "insufficient-tax-country-evidence", - "integration-auth-error", - "internal-server-error", - "invalid-billing-info", - "invalid-billing-period-for-payout", - "invalid-build", - "invalid-client-key", - "invalid-collection", - "invalid-conference-login-password", - "invalid-content-type-header", - "invalid-credentials", - "invalid-git-auth-token", - "invalid-github-issue-url", - "invalid-header", - "invalid-id", - "invalid-idempotency-key", - "invalid-input", - "invalid-input-schema", - "invalid-invoice", - "invalid-invoice-type", - "invalid-issue-date", - "invalid-label-params", - "invalid-main-account-user-id", - "invalid-oauth-app", - "invalid-oauth-scope", - "invalid-one-time-invoice", - "invalid-parameter", - "invalid-payout-status", - "invalid-picture-url", - "invalid-record-key", - "invalid-request", - "invalid-resource-type", - "invalid-signature", - "invalid-subscription-plan", - "invalid-tax-number", - "invalid-tax-number-format", - "invalid-token", - "invalid-token-type", - "invalid-two-factor-code", - "invalid-two-factor-code-or-recovery-code", - "invalid-two-factor-recovery-code", - "invalid-username", - "invalid-value", - "invitation-invalid-resource-type", - "invitation-no-longer-valid", - "invoice-canceled", - "invoice-cannot-be-refunded-due-to-too-high-amount", - "invoice-incomplete", - "invoice-is-draft", - "invoice-locked", - "invoice-must-be-buffer", - "invoice-not-canceled", - "invoice-not-draft", - "invoice-not-found", - "invoice-outdated", - "invoice-paid-already", - "issue-already-connected-to-github", - "issue-not-found", - "issues-bad-request", - "issuer-not-registered", - "job-finished", - "label-already-linked", - "last-api-token", - "limit-reached", - "max-items-must-be-greater-than-zero", - "max-metamorphs-exceeded", - "max-total-charge-usd-below-minimum", - "max-total-charge-usd-must-be-greater-than-zero", - "method-not-allowed", - "migration-disabled", - "missing-actor-rights", - "missing-api-token", - "missing-billing-info", - "missing-line-items", - "missing-payment-date", - "missing-payout-billing-info", - "missing-proxy-password", - "missing-reporting-fields", - "missing-resource-name", - "missing-settings", - "missing-username", - "monthly-usage-limit-too-low", - "more-than-one-update-not-allowed", - "multiple-records-found", - "must-be-admin", - "name-not-unique", - "next-runtime-computation-failed", - "no-columns-in-exported-dataset", - "no-payment-attempt-for-refund-found", - "no-payment-method-available", - "no-team-account-seats-available", - "non-temporary-email", - "not-enough-usage-to-run-paid-actor", - "not-implemented", - "not-supported-currencies", - "o-auth-service-already-connected", - "o-auth-service-not-connected", - "oauth-resource-access-failed", - "one-time-invoice-already-marked-paid", - "only-drafts-can-be-deleted", - "operation-canceled", - "operation-not-allowed", - "operation-timed-out", - "organization-cannot-own-itself", - "organization-role-not-found", - "overlapping-payout-billing-periods", - "own-token-required", - "page-not-found", - "param-not-one-of", - "parameter-required", - "parameters-mismatched", - "password-reset-email-already-sent", - "password-reset-token-expired", - "pay-as-you-go-without-monthly-interval", - "payment-attempt-status-message-required", - "payout-already-paid", - "payout-canceled", - "payout-invalid-state", - "payout-must-be-approved-to-be-marked-paid", - "payout-not-found", - "payout-number-already-exists", - "phone-number-invalid", - "phone-number-landline", - "phone-number-opted-out", - "phone-verification-disabled", - "platform-feature-disabled", - "price-overrides-validation-failed", - "pricing-model-not-supported", - "promotional-plan-not-available", - "proxy-auth-ip-not-unique", - "public-actor-disabled", - "query-timeout", - "quoted-price-outdated", - "rate-limit-exceeded", - "recaptcha-invalid", - "recaptcha-required", - "record-not-found", - "record-not-public", - "record-or-token-not-found", - "record-too-large", - "redirect-uri-mismatch", - "reduced-plan-not-available", - "rental-charge-already-reimbursed", - "rental-not-allowed", - "request-aborted-prematurely", - "request-handled-or-locked", - "request-id-invalid", - "request-queue-duplicate-requests", - "request-too-large", - "requested-dataset-view-does-not-exist", - "resume-token-expired", - "run-failed", - "run-input-body-not-valid-json", - "run-timeout-exceeded", - "russia-is-evil", - "same-user", - "schedule-actor-not-found", - "schedule-actor-task-not-found", - "schedule-name-not-unique", - "schema-validation", - "schema-validation-error", - "schema-validation-failed", - "sign-up-method-not-allowed", - "slack-integration-not-custom", - "socket-closed", - "socket-destroyed", - "store-schema-invalid", - "store-terms-not-accepted", - "stripe-enabled", - "stripe-generic-decline", - "stripe-not-enabled", - "stripe-not-enabled-for-user", - "tagged-build-required", - "tax-country-invalid", - "tax-number-invalid", - "tax-number-validation-failed", - "taxamo-call-failed", - "taxamo-request-failed", - "testing-error", - "token-not-provided", - "too-few-versions", - "too-many-actor-tasks", - "too-many-actors", - "too-many-labels-on-resource", - "too-many-mcp-connectors", - "too-many-o-auth-apps", - "too-many-organizations", - "too-many-requests", - "too-many-schedules", - "too-many-ui-access-keys", - "too-many-user-labels", - "too-many-values", - "too-many-versions", - "too-many-webhooks", - "unexpected-route", - "unknown-build-tag", - "unknown-payment-provider", - "unsubscribe-token-invalid", - "unsupported-actor-pricing-model-for-agentic-payments", - "unsupported-content-encoding", - "unsupported-file-type-for-issue", - "unsupported-file-type-image-expected", - "unsupported-file-type-text-or-json-expected", - "unsupported-permission", - "upcoming-subscription-bill-not-up-to-date", - "user-already-exists", - "user-already-verified", - "user-creates-organizations-too-fast", - "user-disabled", - "user-email-is-disposable", - "user-email-not-set", - "user-email-not-verified", - "user-has-no-subscription", - "user-integration-not-found", - "user-is-already-invited", - "user-is-already-organization-member", - "user-is-not-member-of-organization", - "user-is-not-organization", - "user-is-organization", - "user-is-organization-owner", - "user-is-removed", - "user-not-found", - "user-not-logged-in", - "user-not-verified", - "user-or-token-not-found", - "user-plan-not-allowed-for-coupon", - "user-problem-with-card", - "user-record-not-found", - "username-already-taken", - "username-missing", - "username-not-allowed", - "username-removal-forbidden", - "username-required", - "verification-email-already-sent", - "verification-token-expired", - "version-already-exists", - "versions-size-exceeded", - "weak-password", - "x402-agentic-payment-already-finalized", - "x402-agentic-payment-insufficient-amount", - "x402-agentic-payment-malformed-token", - "x402-agentic-payment-settlement-failed", - "x402-agentic-payment-settlement-in-progress", - "x402-agentic-payment-settlement-stuck", - "x402-agentic-payment-unauthorized", - "x402-payment-required", - "zero-invoice", -} - -func (v *ErrorType) UnmarshalJSON(src []byte) error { - var value string - err := json.Unmarshal(src, &value) - if err != nil { - return err - } - enumTypeValue := ErrorType(value) - for _, existing := range AllowedErrorTypeEnumValues { - if existing == enumTypeValue { - *v = enumTypeValue - return nil - } - } - - return fmt.Errorf("%+v is not a valid ErrorType", value) -} - -// NewErrorTypeFromValue returns a pointer to a valid ErrorType -// for the value passed as argument, or an error if the value passed is not allowed by the enum -func NewErrorTypeFromValue(v string) (*ErrorType, error) { - ev := ErrorType(v) - if ev.IsValid() { - return &ev, nil - } else { - return nil, fmt.Errorf("invalid value '%v' for ErrorType: valid values are %v", v, AllowedErrorTypeEnumValues) - } -} - -// IsValid return true if the value is valid for the enum, false otherwise -func (v ErrorType) IsValid() bool { - for _, existing := range AllowedErrorTypeEnumValues { - if existing == v { - return true - } - } - return false -} - -// Ptr returns reference to ErrorType value -func (v ErrorType) Ptr() *ErrorType { - return &v -} - -type NullableErrorType struct { - value *ErrorType - isSet bool -} - -func (v NullableErrorType) Get() *ErrorType { - return v.value -} - -func (v *NullableErrorType) Set(val *ErrorType) { - v.value = val - v.isSet = true -} - -func (v NullableErrorType) IsSet() bool { - return v.isSet -} - -func (v *NullableErrorType) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableErrorType(val *ErrorType) *NullableErrorType { - return &NullableErrorType{value: val, isSet: true} -} - -func (v NullableErrorType) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableErrorType) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - diff --git a/model_event_data.go b/model_event_data.go deleted file mode 100644 index 5188498..0000000 --- a/model_event_data.go +++ /dev/null @@ -1,186 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" - "bytes" - "fmt" -) - -// checks if the EventData type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &EventData{} - -// EventData struct for EventData -type EventData struct { - ActorId string `json:"actorId"` - ActorRunId string `json:"actorRunId"` -} - -type _EventData EventData - -// NewEventData instantiates a new EventData object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewEventData(actorId string, actorRunId string) *EventData { - this := EventData{} - this.ActorId = actorId - this.ActorRunId = actorRunId - return &this -} - -// NewEventDataWithDefaults instantiates a new EventData object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewEventDataWithDefaults() *EventData { - this := EventData{} - return &this -} - -// GetActorId returns the ActorId field value -func (o *EventData) GetActorId() string { - if o == nil { - var ret string - return ret - } - - return o.ActorId -} - -// GetActorIdOk returns a tuple with the ActorId field value -// and a boolean to check if the value has been set. -func (o *EventData) GetActorIdOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.ActorId, true -} - -// SetActorId sets field value -func (o *EventData) SetActorId(v string) { - o.ActorId = v -} - -// GetActorRunId returns the ActorRunId field value -func (o *EventData) GetActorRunId() string { - if o == nil { - var ret string - return ret - } - - return o.ActorRunId -} - -// GetActorRunIdOk returns a tuple with the ActorRunId field value -// and a boolean to check if the value has been set. -func (o *EventData) GetActorRunIdOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.ActorRunId, true -} - -// SetActorRunId sets field value -func (o *EventData) SetActorRunId(v string) { - o.ActorRunId = v -} - -func (o EventData) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o EventData) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["actorId"] = o.ActorId - toSerialize["actorRunId"] = o.ActorRunId - return toSerialize, nil -} - -func (o *EventData) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "actorId", - "actorRunId", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err; - } - - for _, requiredProperty := range(requiredProperties) { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varEventData := _EventData{} - - decoder := json.NewDecoder(bytes.NewReader(data)) - decoder.DisallowUnknownFields() - err = decoder.Decode(&varEventData) - - if err != nil { - return err - } - - *o = EventData(varEventData) - - return err -} - -type NullableEventData struct { - value *EventData - isSet bool -} - -func (v NullableEventData) Get() *EventData { - return v.value -} - -func (v *NullableEventData) Set(val *EventData) { - v.value = val - v.isSet = true -} - -func (v NullableEventData) IsSet() bool { - return v.isSet -} - -func (v *NullableEventData) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableEventData(val *EventData) *NullableEventData { - return &NullableEventData{value: val, isSet: true} -} - -func (v NullableEventData) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableEventData) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_example_run_input.go b/model_example_run_input.go deleted file mode 100644 index b238d68..0000000 --- a/model_example_run_input.go +++ /dev/null @@ -1,162 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" -) - -// checks if the ExampleRunInput type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &ExampleRunInput{} - -// ExampleRunInput struct for ExampleRunInput -type ExampleRunInput struct { - Body *string `json:"body,omitempty"` - ContentType *string `json:"contentType,omitempty"` -} - -// NewExampleRunInput instantiates a new ExampleRunInput object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewExampleRunInput() *ExampleRunInput { - this := ExampleRunInput{} - return &this -} - -// NewExampleRunInputWithDefaults instantiates a new ExampleRunInput object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewExampleRunInputWithDefaults() *ExampleRunInput { - this := ExampleRunInput{} - return &this -} - -// GetBody returns the Body field value if set, zero value otherwise. -func (o *ExampleRunInput) GetBody() string { - if o == nil || IsNil(o.Body) { - var ret string - return ret - } - return *o.Body -} - -// GetBodyOk returns a tuple with the Body field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ExampleRunInput) GetBodyOk() (*string, bool) { - if o == nil || IsNil(o.Body) { - return nil, false - } - return o.Body, true -} - -// HasBody returns a boolean if a field has been set. -func (o *ExampleRunInput) HasBody() bool { - if o != nil && !IsNil(o.Body) { - return true - } - - return false -} - -// SetBody gets a reference to the given string and assigns it to the Body field. -func (o *ExampleRunInput) SetBody(v string) { - o.Body = &v -} - -// GetContentType returns the ContentType field value if set, zero value otherwise. -func (o *ExampleRunInput) GetContentType() string { - if o == nil || IsNil(o.ContentType) { - var ret string - return ret - } - return *o.ContentType -} - -// GetContentTypeOk returns a tuple with the ContentType field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ExampleRunInput) GetContentTypeOk() (*string, bool) { - if o == nil || IsNil(o.ContentType) { - return nil, false - } - return o.ContentType, true -} - -// HasContentType returns a boolean if a field has been set. -func (o *ExampleRunInput) HasContentType() bool { - if o != nil && !IsNil(o.ContentType) { - return true - } - - return false -} - -// SetContentType gets a reference to the given string and assigns it to the ContentType field. -func (o *ExampleRunInput) SetContentType(v string) { - o.ContentType = &v -} - -func (o ExampleRunInput) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o ExampleRunInput) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if !IsNil(o.Body) { - toSerialize["body"] = o.Body - } - if !IsNil(o.ContentType) { - toSerialize["contentType"] = o.ContentType - } - return toSerialize, nil -} - -type NullableExampleRunInput struct { - value *ExampleRunInput - isSet bool -} - -func (v NullableExampleRunInput) Get() *ExampleRunInput { - return v.value -} - -func (v *NullableExampleRunInput) Set(val *ExampleRunInput) { - v.value = val - v.isSet = true -} - -func (v NullableExampleRunInput) IsSet() bool { - return v.isSet -} - -func (v *NullableExampleRunInput) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableExampleRunInput(val *ExampleRunInput) *NullableExampleRunInput { - return &NullableExampleRunInput{value: val, isSet: true} -} - -func (v NullableExampleRunInput) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableExampleRunInput) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_example_webhook_dispatch.go b/model_example_webhook_dispatch.go deleted file mode 100644 index 9bc4c1b..0000000 --- a/model_example_webhook_dispatch.go +++ /dev/null @@ -1,251 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" - "time" - "bytes" - "fmt" -) - -// checks if the ExampleWebhookDispatch type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &ExampleWebhookDispatch{} - -// ExampleWebhookDispatch struct for ExampleWebhookDispatch -type ExampleWebhookDispatch struct { - Status WebhookDispatchStatus `json:"status"` - FinishedAt NullableTime `json:"finishedAt,omitempty"` - RemovedAt NullableTime `json:"removedAt,omitempty"` -} - -type _ExampleWebhookDispatch ExampleWebhookDispatch - -// NewExampleWebhookDispatch instantiates a new ExampleWebhookDispatch object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewExampleWebhookDispatch(status WebhookDispatchStatus) *ExampleWebhookDispatch { - this := ExampleWebhookDispatch{} - this.Status = status - return &this -} - -// NewExampleWebhookDispatchWithDefaults instantiates a new ExampleWebhookDispatch object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewExampleWebhookDispatchWithDefaults() *ExampleWebhookDispatch { - this := ExampleWebhookDispatch{} - return &this -} - -// GetStatus returns the Status field value -func (o *ExampleWebhookDispatch) GetStatus() WebhookDispatchStatus { - if o == nil { - var ret WebhookDispatchStatus - return ret - } - - return o.Status -} - -// GetStatusOk returns a tuple with the Status field value -// and a boolean to check if the value has been set. -func (o *ExampleWebhookDispatch) GetStatusOk() (*WebhookDispatchStatus, bool) { - if o == nil { - return nil, false - } - return &o.Status, true -} - -// SetStatus sets field value -func (o *ExampleWebhookDispatch) SetStatus(v WebhookDispatchStatus) { - o.Status = v -} - -// GetFinishedAt returns the FinishedAt field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *ExampleWebhookDispatch) GetFinishedAt() time.Time { - if o == nil || IsNil(o.FinishedAt.Get()) { - var ret time.Time - return ret - } - return *o.FinishedAt.Get() -} - -// GetFinishedAtOk returns a tuple with the FinishedAt field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *ExampleWebhookDispatch) GetFinishedAtOk() (*time.Time, bool) { - if o == nil { - return nil, false - } - return o.FinishedAt.Get(), o.FinishedAt.IsSet() -} - -// HasFinishedAt returns a boolean if a field has been set. -func (o *ExampleWebhookDispatch) HasFinishedAt() bool { - if o != nil && o.FinishedAt.IsSet() { - return true - } - - return false -} - -// SetFinishedAt gets a reference to the given NullableTime and assigns it to the FinishedAt field. -func (o *ExampleWebhookDispatch) SetFinishedAt(v time.Time) { - o.FinishedAt.Set(&v) -} -// SetFinishedAtNil sets the value for FinishedAt to be an explicit nil -func (o *ExampleWebhookDispatch) SetFinishedAtNil() { - o.FinishedAt.Set(nil) -} - -// UnsetFinishedAt ensures that no value is present for FinishedAt, not even an explicit nil -func (o *ExampleWebhookDispatch) UnsetFinishedAt() { - o.FinishedAt.Unset() -} - -// GetRemovedAt returns the RemovedAt field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *ExampleWebhookDispatch) GetRemovedAt() time.Time { - if o == nil || IsNil(o.RemovedAt.Get()) { - var ret time.Time - return ret - } - return *o.RemovedAt.Get() -} - -// GetRemovedAtOk returns a tuple with the RemovedAt field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *ExampleWebhookDispatch) GetRemovedAtOk() (*time.Time, bool) { - if o == nil { - return nil, false - } - return o.RemovedAt.Get(), o.RemovedAt.IsSet() -} - -// HasRemovedAt returns a boolean if a field has been set. -func (o *ExampleWebhookDispatch) HasRemovedAt() bool { - if o != nil && o.RemovedAt.IsSet() { - return true - } - - return false -} - -// SetRemovedAt gets a reference to the given NullableTime and assigns it to the RemovedAt field. -func (o *ExampleWebhookDispatch) SetRemovedAt(v time.Time) { - o.RemovedAt.Set(&v) -} -// SetRemovedAtNil sets the value for RemovedAt to be an explicit nil -func (o *ExampleWebhookDispatch) SetRemovedAtNil() { - o.RemovedAt.Set(nil) -} - -// UnsetRemovedAt ensures that no value is present for RemovedAt, not even an explicit nil -func (o *ExampleWebhookDispatch) UnsetRemovedAt() { - o.RemovedAt.Unset() -} - -func (o ExampleWebhookDispatch) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o ExampleWebhookDispatch) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["status"] = o.Status - if o.FinishedAt.IsSet() { - toSerialize["finishedAt"] = o.FinishedAt.Get() - } - if o.RemovedAt.IsSet() { - toSerialize["removedAt"] = o.RemovedAt.Get() - } - return toSerialize, nil -} - -func (o *ExampleWebhookDispatch) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "status", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err; - } - - for _, requiredProperty := range(requiredProperties) { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varExampleWebhookDispatch := _ExampleWebhookDispatch{} - - decoder := json.NewDecoder(bytes.NewReader(data)) - decoder.DisallowUnknownFields() - err = decoder.Decode(&varExampleWebhookDispatch) - - if err != nil { - return err - } - - *o = ExampleWebhookDispatch(varExampleWebhookDispatch) - - return err -} - -type NullableExampleWebhookDispatch struct { - value *ExampleWebhookDispatch - isSet bool -} - -func (v NullableExampleWebhookDispatch) Get() *ExampleWebhookDispatch { - return v.value -} - -func (v *NullableExampleWebhookDispatch) Set(val *ExampleWebhookDispatch) { - v.value = val - v.isSet = true -} - -func (v NullableExampleWebhookDispatch) IsSet() bool { - return v.isSet -} - -func (v *NullableExampleWebhookDispatch) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableExampleWebhookDispatch(val *ExampleWebhookDispatch) *NullableExampleWebhookDispatch { - return &NullableExampleWebhookDispatch{value: val, isSet: true} -} - -func (v NullableExampleWebhookDispatch) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableExampleWebhookDispatch) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_flat_price_per_month_actor_pricing_info.go b/model_flat_price_per_month_actor_pricing_info.go deleted file mode 100644 index cba4c18..0000000 --- a/model_flat_price_per_month_actor_pricing_info.go +++ /dev/null @@ -1,484 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" - "time" - "bytes" - "fmt" -) - -// checks if the FlatPricePerMonthActorPricingInfo type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &FlatPricePerMonthActorPricingInfo{} - -// FlatPricePerMonthActorPricingInfo struct for FlatPricePerMonthActorPricingInfo -type FlatPricePerMonthActorPricingInfo struct { - // In [0, 1], fraction of pricePerUnitUsd that goes to Apify - ApifyMarginPercentage float32 `json:"apifyMarginPercentage"` - // When this pricing info record has been created - CreatedAt time.Time `json:"createdAt"` - // Since when is this pricing info record effective for a given Actor - StartedAt time.Time `json:"startedAt"` - NotifiedAboutFutureChangeAt *time.Time `json:"notifiedAboutFutureChangeAt,omitempty"` - NotifiedAboutChangeAt *time.Time `json:"notifiedAboutChangeAt,omitempty"` - ReasonForChange *string `json:"reasonForChange,omitempty"` - IsPriceChangeNotificationSuppressed *bool `json:"isPriceChangeNotificationSuppressed,omitempty"` - ForceContainsSignificantPriceChange *bool `json:"forceContainsSignificantPriceChange,omitempty"` - PricingModel string `json:"pricingModel"` - // For how long this Actor can be used for free in trial period - TrialMinutes int32 `json:"trialMinutes"` - // Monthly flat price in USD - PricePerUnitUsd float32 `json:"pricePerUnitUsd"` -} - -type _FlatPricePerMonthActorPricingInfo FlatPricePerMonthActorPricingInfo - -// NewFlatPricePerMonthActorPricingInfo instantiates a new FlatPricePerMonthActorPricingInfo object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewFlatPricePerMonthActorPricingInfo(apifyMarginPercentage float32, createdAt time.Time, startedAt time.Time, pricingModel string, trialMinutes int32, pricePerUnitUsd float32) *FlatPricePerMonthActorPricingInfo { - this := FlatPricePerMonthActorPricingInfo{} - this.ApifyMarginPercentage = apifyMarginPercentage - this.CreatedAt = createdAt - this.StartedAt = startedAt - this.PricingModel = pricingModel - this.TrialMinutes = trialMinutes - this.PricePerUnitUsd = pricePerUnitUsd - return &this -} - -// NewFlatPricePerMonthActorPricingInfoWithDefaults instantiates a new FlatPricePerMonthActorPricingInfo object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewFlatPricePerMonthActorPricingInfoWithDefaults() *FlatPricePerMonthActorPricingInfo { - this := FlatPricePerMonthActorPricingInfo{} - return &this -} - -// GetApifyMarginPercentage returns the ApifyMarginPercentage field value -func (o *FlatPricePerMonthActorPricingInfo) GetApifyMarginPercentage() float32 { - if o == nil { - var ret float32 - return ret - } - - return o.ApifyMarginPercentage -} - -// GetApifyMarginPercentageOk returns a tuple with the ApifyMarginPercentage field value -// and a boolean to check if the value has been set. -func (o *FlatPricePerMonthActorPricingInfo) GetApifyMarginPercentageOk() (*float32, bool) { - if o == nil { - return nil, false - } - return &o.ApifyMarginPercentage, true -} - -// SetApifyMarginPercentage sets field value -func (o *FlatPricePerMonthActorPricingInfo) SetApifyMarginPercentage(v float32) { - o.ApifyMarginPercentage = v -} - -// GetCreatedAt returns the CreatedAt field value -func (o *FlatPricePerMonthActorPricingInfo) GetCreatedAt() time.Time { - if o == nil { - var ret time.Time - return ret - } - - return o.CreatedAt -} - -// GetCreatedAtOk returns a tuple with the CreatedAt field value -// and a boolean to check if the value has been set. -func (o *FlatPricePerMonthActorPricingInfo) GetCreatedAtOk() (*time.Time, bool) { - if o == nil { - return nil, false - } - return &o.CreatedAt, true -} - -// SetCreatedAt sets field value -func (o *FlatPricePerMonthActorPricingInfo) SetCreatedAt(v time.Time) { - o.CreatedAt = v -} - -// GetStartedAt returns the StartedAt field value -func (o *FlatPricePerMonthActorPricingInfo) GetStartedAt() time.Time { - if o == nil { - var ret time.Time - return ret - } - - return o.StartedAt -} - -// GetStartedAtOk returns a tuple with the StartedAt field value -// and a boolean to check if the value has been set. -func (o *FlatPricePerMonthActorPricingInfo) GetStartedAtOk() (*time.Time, bool) { - if o == nil { - return nil, false - } - return &o.StartedAt, true -} - -// SetStartedAt sets field value -func (o *FlatPricePerMonthActorPricingInfo) SetStartedAt(v time.Time) { - o.StartedAt = v -} - -// GetNotifiedAboutFutureChangeAt returns the NotifiedAboutFutureChangeAt field value if set, zero value otherwise. -func (o *FlatPricePerMonthActorPricingInfo) GetNotifiedAboutFutureChangeAt() time.Time { - if o == nil || IsNil(o.NotifiedAboutFutureChangeAt) { - var ret time.Time - return ret - } - return *o.NotifiedAboutFutureChangeAt -} - -// GetNotifiedAboutFutureChangeAtOk returns a tuple with the NotifiedAboutFutureChangeAt field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *FlatPricePerMonthActorPricingInfo) GetNotifiedAboutFutureChangeAtOk() (*time.Time, bool) { - if o == nil || IsNil(o.NotifiedAboutFutureChangeAt) { - return nil, false - } - return o.NotifiedAboutFutureChangeAt, true -} - -// HasNotifiedAboutFutureChangeAt returns a boolean if a field has been set. -func (o *FlatPricePerMonthActorPricingInfo) HasNotifiedAboutFutureChangeAt() bool { - if o != nil && !IsNil(o.NotifiedAboutFutureChangeAt) { - return true - } - - return false -} - -// SetNotifiedAboutFutureChangeAt gets a reference to the given time.Time and assigns it to the NotifiedAboutFutureChangeAt field. -func (o *FlatPricePerMonthActorPricingInfo) SetNotifiedAboutFutureChangeAt(v time.Time) { - o.NotifiedAboutFutureChangeAt = &v -} - -// GetNotifiedAboutChangeAt returns the NotifiedAboutChangeAt field value if set, zero value otherwise. -func (o *FlatPricePerMonthActorPricingInfo) GetNotifiedAboutChangeAt() time.Time { - if o == nil || IsNil(o.NotifiedAboutChangeAt) { - var ret time.Time - return ret - } - return *o.NotifiedAboutChangeAt -} - -// GetNotifiedAboutChangeAtOk returns a tuple with the NotifiedAboutChangeAt field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *FlatPricePerMonthActorPricingInfo) GetNotifiedAboutChangeAtOk() (*time.Time, bool) { - if o == nil || IsNil(o.NotifiedAboutChangeAt) { - return nil, false - } - return o.NotifiedAboutChangeAt, true -} - -// HasNotifiedAboutChangeAt returns a boolean if a field has been set. -func (o *FlatPricePerMonthActorPricingInfo) HasNotifiedAboutChangeAt() bool { - if o != nil && !IsNil(o.NotifiedAboutChangeAt) { - return true - } - - return false -} - -// SetNotifiedAboutChangeAt gets a reference to the given time.Time and assigns it to the NotifiedAboutChangeAt field. -func (o *FlatPricePerMonthActorPricingInfo) SetNotifiedAboutChangeAt(v time.Time) { - o.NotifiedAboutChangeAt = &v -} - -// GetReasonForChange returns the ReasonForChange field value if set, zero value otherwise. -func (o *FlatPricePerMonthActorPricingInfo) GetReasonForChange() string { - if o == nil || IsNil(o.ReasonForChange) { - var ret string - return ret - } - return *o.ReasonForChange -} - -// GetReasonForChangeOk returns a tuple with the ReasonForChange field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *FlatPricePerMonthActorPricingInfo) GetReasonForChangeOk() (*string, bool) { - if o == nil || IsNil(o.ReasonForChange) { - return nil, false - } - return o.ReasonForChange, true -} - -// HasReasonForChange returns a boolean if a field has been set. -func (o *FlatPricePerMonthActorPricingInfo) HasReasonForChange() bool { - if o != nil && !IsNil(o.ReasonForChange) { - return true - } - - return false -} - -// SetReasonForChange gets a reference to the given string and assigns it to the ReasonForChange field. -func (o *FlatPricePerMonthActorPricingInfo) SetReasonForChange(v string) { - o.ReasonForChange = &v -} - -// GetIsPriceChangeNotificationSuppressed returns the IsPriceChangeNotificationSuppressed field value if set, zero value otherwise. -func (o *FlatPricePerMonthActorPricingInfo) GetIsPriceChangeNotificationSuppressed() bool { - if o == nil || IsNil(o.IsPriceChangeNotificationSuppressed) { - var ret bool - return ret - } - return *o.IsPriceChangeNotificationSuppressed -} - -// GetIsPriceChangeNotificationSuppressedOk returns a tuple with the IsPriceChangeNotificationSuppressed field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *FlatPricePerMonthActorPricingInfo) GetIsPriceChangeNotificationSuppressedOk() (*bool, bool) { - if o == nil || IsNil(o.IsPriceChangeNotificationSuppressed) { - return nil, false - } - return o.IsPriceChangeNotificationSuppressed, true -} - -// HasIsPriceChangeNotificationSuppressed returns a boolean if a field has been set. -func (o *FlatPricePerMonthActorPricingInfo) HasIsPriceChangeNotificationSuppressed() bool { - if o != nil && !IsNil(o.IsPriceChangeNotificationSuppressed) { - return true - } - - return false -} - -// SetIsPriceChangeNotificationSuppressed gets a reference to the given bool and assigns it to the IsPriceChangeNotificationSuppressed field. -func (o *FlatPricePerMonthActorPricingInfo) SetIsPriceChangeNotificationSuppressed(v bool) { - o.IsPriceChangeNotificationSuppressed = &v -} - -// GetForceContainsSignificantPriceChange returns the ForceContainsSignificantPriceChange field value if set, zero value otherwise. -func (o *FlatPricePerMonthActorPricingInfo) GetForceContainsSignificantPriceChange() bool { - if o == nil || IsNil(o.ForceContainsSignificantPriceChange) { - var ret bool - return ret - } - return *o.ForceContainsSignificantPriceChange -} - -// GetForceContainsSignificantPriceChangeOk returns a tuple with the ForceContainsSignificantPriceChange field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *FlatPricePerMonthActorPricingInfo) GetForceContainsSignificantPriceChangeOk() (*bool, bool) { - if o == nil || IsNil(o.ForceContainsSignificantPriceChange) { - return nil, false - } - return o.ForceContainsSignificantPriceChange, true -} - -// HasForceContainsSignificantPriceChange returns a boolean if a field has been set. -func (o *FlatPricePerMonthActorPricingInfo) HasForceContainsSignificantPriceChange() bool { - if o != nil && !IsNil(o.ForceContainsSignificantPriceChange) { - return true - } - - return false -} - -// SetForceContainsSignificantPriceChange gets a reference to the given bool and assigns it to the ForceContainsSignificantPriceChange field. -func (o *FlatPricePerMonthActorPricingInfo) SetForceContainsSignificantPriceChange(v bool) { - o.ForceContainsSignificantPriceChange = &v -} - -// GetPricingModel returns the PricingModel field value -func (o *FlatPricePerMonthActorPricingInfo) GetPricingModel() string { - if o == nil { - var ret string - return ret - } - - return o.PricingModel -} - -// GetPricingModelOk returns a tuple with the PricingModel field value -// and a boolean to check if the value has been set. -func (o *FlatPricePerMonthActorPricingInfo) GetPricingModelOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.PricingModel, true -} - -// SetPricingModel sets field value -func (o *FlatPricePerMonthActorPricingInfo) SetPricingModel(v string) { - o.PricingModel = v -} - -// GetTrialMinutes returns the TrialMinutes field value -func (o *FlatPricePerMonthActorPricingInfo) GetTrialMinutes() int32 { - if o == nil { - var ret int32 - return ret - } - - return o.TrialMinutes -} - -// GetTrialMinutesOk returns a tuple with the TrialMinutes field value -// and a boolean to check if the value has been set. -func (o *FlatPricePerMonthActorPricingInfo) GetTrialMinutesOk() (*int32, bool) { - if o == nil { - return nil, false - } - return &o.TrialMinutes, true -} - -// SetTrialMinutes sets field value -func (o *FlatPricePerMonthActorPricingInfo) SetTrialMinutes(v int32) { - o.TrialMinutes = v -} - -// GetPricePerUnitUsd returns the PricePerUnitUsd field value -func (o *FlatPricePerMonthActorPricingInfo) GetPricePerUnitUsd() float32 { - if o == nil { - var ret float32 - return ret - } - - return o.PricePerUnitUsd -} - -// GetPricePerUnitUsdOk returns a tuple with the PricePerUnitUsd field value -// and a boolean to check if the value has been set. -func (o *FlatPricePerMonthActorPricingInfo) GetPricePerUnitUsdOk() (*float32, bool) { - if o == nil { - return nil, false - } - return &o.PricePerUnitUsd, true -} - -// SetPricePerUnitUsd sets field value -func (o *FlatPricePerMonthActorPricingInfo) SetPricePerUnitUsd(v float32) { - o.PricePerUnitUsd = v -} - -func (o FlatPricePerMonthActorPricingInfo) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o FlatPricePerMonthActorPricingInfo) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["apifyMarginPercentage"] = o.ApifyMarginPercentage - toSerialize["createdAt"] = o.CreatedAt - toSerialize["startedAt"] = o.StartedAt - if !IsNil(o.NotifiedAboutFutureChangeAt) { - toSerialize["notifiedAboutFutureChangeAt"] = o.NotifiedAboutFutureChangeAt - } - if !IsNil(o.NotifiedAboutChangeAt) { - toSerialize["notifiedAboutChangeAt"] = o.NotifiedAboutChangeAt - } - if !IsNil(o.ReasonForChange) { - toSerialize["reasonForChange"] = o.ReasonForChange - } - if !IsNil(o.IsPriceChangeNotificationSuppressed) { - toSerialize["isPriceChangeNotificationSuppressed"] = o.IsPriceChangeNotificationSuppressed - } - if !IsNil(o.ForceContainsSignificantPriceChange) { - toSerialize["forceContainsSignificantPriceChange"] = o.ForceContainsSignificantPriceChange - } - toSerialize["pricingModel"] = o.PricingModel - toSerialize["trialMinutes"] = o.TrialMinutes - toSerialize["pricePerUnitUsd"] = o.PricePerUnitUsd - return toSerialize, nil -} - -func (o *FlatPricePerMonthActorPricingInfo) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "apifyMarginPercentage", - "createdAt", - "startedAt", - "pricingModel", - "trialMinutes", - "pricePerUnitUsd", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err; - } - - for _, requiredProperty := range(requiredProperties) { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varFlatPricePerMonthActorPricingInfo := _FlatPricePerMonthActorPricingInfo{} - - decoder := json.NewDecoder(bytes.NewReader(data)) - decoder.DisallowUnknownFields() - err = decoder.Decode(&varFlatPricePerMonthActorPricingInfo) - - if err != nil { - return err - } - - *o = FlatPricePerMonthActorPricingInfo(varFlatPricePerMonthActorPricingInfo) - - return err -} - -type NullableFlatPricePerMonthActorPricingInfo struct { - value *FlatPricePerMonthActorPricingInfo - isSet bool -} - -func (v NullableFlatPricePerMonthActorPricingInfo) Get() *FlatPricePerMonthActorPricingInfo { - return v.value -} - -func (v *NullableFlatPricePerMonthActorPricingInfo) Set(val *FlatPricePerMonthActorPricingInfo) { - v.value = val - v.isSet = true -} - -func (v NullableFlatPricePerMonthActorPricingInfo) IsSet() bool { - return v.isSet -} - -func (v *NullableFlatPricePerMonthActorPricingInfo) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableFlatPricePerMonthActorPricingInfo(val *FlatPricePerMonthActorPricingInfo) *NullableFlatPricePerMonthActorPricingInfo { - return &NullableFlatPricePerMonthActorPricingInfo{value: val, isSet: true} -} - -func (v NullableFlatPricePerMonthActorPricingInfo) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableFlatPricePerMonthActorPricingInfo) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_free_actor_pricing_info.go b/model_free_actor_pricing_info.go deleted file mode 100644 index 3d19001..0000000 --- a/model_free_actor_pricing_info.go +++ /dev/null @@ -1,426 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" - "time" - "bytes" - "fmt" -) - -// checks if the FreeActorPricingInfo type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &FreeActorPricingInfo{} - -// FreeActorPricingInfo struct for FreeActorPricingInfo -type FreeActorPricingInfo struct { - // In [0, 1], fraction of pricePerUnitUsd that goes to Apify - ApifyMarginPercentage float32 `json:"apifyMarginPercentage"` - // When this pricing info record has been created - CreatedAt time.Time `json:"createdAt"` - // Since when is this pricing info record effective for a given Actor - StartedAt time.Time `json:"startedAt"` - NotifiedAboutFutureChangeAt *time.Time `json:"notifiedAboutFutureChangeAt,omitempty"` - NotifiedAboutChangeAt *time.Time `json:"notifiedAboutChangeAt,omitempty"` - ReasonForChange *string `json:"reasonForChange,omitempty"` - IsPriceChangeNotificationSuppressed *bool `json:"isPriceChangeNotificationSuppressed,omitempty"` - ForceContainsSignificantPriceChange *bool `json:"forceContainsSignificantPriceChange,omitempty"` - PricingModel string `json:"pricingModel"` -} - -type _FreeActorPricingInfo FreeActorPricingInfo - -// NewFreeActorPricingInfo instantiates a new FreeActorPricingInfo object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewFreeActorPricingInfo(apifyMarginPercentage float32, createdAt time.Time, startedAt time.Time, pricingModel string) *FreeActorPricingInfo { - this := FreeActorPricingInfo{} - this.ApifyMarginPercentage = apifyMarginPercentage - this.CreatedAt = createdAt - this.StartedAt = startedAt - this.PricingModel = pricingModel - return &this -} - -// NewFreeActorPricingInfoWithDefaults instantiates a new FreeActorPricingInfo object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewFreeActorPricingInfoWithDefaults() *FreeActorPricingInfo { - this := FreeActorPricingInfo{} - return &this -} - -// GetApifyMarginPercentage returns the ApifyMarginPercentage field value -func (o *FreeActorPricingInfo) GetApifyMarginPercentage() float32 { - if o == nil { - var ret float32 - return ret - } - - return o.ApifyMarginPercentage -} - -// GetApifyMarginPercentageOk returns a tuple with the ApifyMarginPercentage field value -// and a boolean to check if the value has been set. -func (o *FreeActorPricingInfo) GetApifyMarginPercentageOk() (*float32, bool) { - if o == nil { - return nil, false - } - return &o.ApifyMarginPercentage, true -} - -// SetApifyMarginPercentage sets field value -func (o *FreeActorPricingInfo) SetApifyMarginPercentage(v float32) { - o.ApifyMarginPercentage = v -} - -// GetCreatedAt returns the CreatedAt field value -func (o *FreeActorPricingInfo) GetCreatedAt() time.Time { - if o == nil { - var ret time.Time - return ret - } - - return o.CreatedAt -} - -// GetCreatedAtOk returns a tuple with the CreatedAt field value -// and a boolean to check if the value has been set. -func (o *FreeActorPricingInfo) GetCreatedAtOk() (*time.Time, bool) { - if o == nil { - return nil, false - } - return &o.CreatedAt, true -} - -// SetCreatedAt sets field value -func (o *FreeActorPricingInfo) SetCreatedAt(v time.Time) { - o.CreatedAt = v -} - -// GetStartedAt returns the StartedAt field value -func (o *FreeActorPricingInfo) GetStartedAt() time.Time { - if o == nil { - var ret time.Time - return ret - } - - return o.StartedAt -} - -// GetStartedAtOk returns a tuple with the StartedAt field value -// and a boolean to check if the value has been set. -func (o *FreeActorPricingInfo) GetStartedAtOk() (*time.Time, bool) { - if o == nil { - return nil, false - } - return &o.StartedAt, true -} - -// SetStartedAt sets field value -func (o *FreeActorPricingInfo) SetStartedAt(v time.Time) { - o.StartedAt = v -} - -// GetNotifiedAboutFutureChangeAt returns the NotifiedAboutFutureChangeAt field value if set, zero value otherwise. -func (o *FreeActorPricingInfo) GetNotifiedAboutFutureChangeAt() time.Time { - if o == nil || IsNil(o.NotifiedAboutFutureChangeAt) { - var ret time.Time - return ret - } - return *o.NotifiedAboutFutureChangeAt -} - -// GetNotifiedAboutFutureChangeAtOk returns a tuple with the NotifiedAboutFutureChangeAt field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *FreeActorPricingInfo) GetNotifiedAboutFutureChangeAtOk() (*time.Time, bool) { - if o == nil || IsNil(o.NotifiedAboutFutureChangeAt) { - return nil, false - } - return o.NotifiedAboutFutureChangeAt, true -} - -// HasNotifiedAboutFutureChangeAt returns a boolean if a field has been set. -func (o *FreeActorPricingInfo) HasNotifiedAboutFutureChangeAt() bool { - if o != nil && !IsNil(o.NotifiedAboutFutureChangeAt) { - return true - } - - return false -} - -// SetNotifiedAboutFutureChangeAt gets a reference to the given time.Time and assigns it to the NotifiedAboutFutureChangeAt field. -func (o *FreeActorPricingInfo) SetNotifiedAboutFutureChangeAt(v time.Time) { - o.NotifiedAboutFutureChangeAt = &v -} - -// GetNotifiedAboutChangeAt returns the NotifiedAboutChangeAt field value if set, zero value otherwise. -func (o *FreeActorPricingInfo) GetNotifiedAboutChangeAt() time.Time { - if o == nil || IsNil(o.NotifiedAboutChangeAt) { - var ret time.Time - return ret - } - return *o.NotifiedAboutChangeAt -} - -// GetNotifiedAboutChangeAtOk returns a tuple with the NotifiedAboutChangeAt field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *FreeActorPricingInfo) GetNotifiedAboutChangeAtOk() (*time.Time, bool) { - if o == nil || IsNil(o.NotifiedAboutChangeAt) { - return nil, false - } - return o.NotifiedAboutChangeAt, true -} - -// HasNotifiedAboutChangeAt returns a boolean if a field has been set. -func (o *FreeActorPricingInfo) HasNotifiedAboutChangeAt() bool { - if o != nil && !IsNil(o.NotifiedAboutChangeAt) { - return true - } - - return false -} - -// SetNotifiedAboutChangeAt gets a reference to the given time.Time and assigns it to the NotifiedAboutChangeAt field. -func (o *FreeActorPricingInfo) SetNotifiedAboutChangeAt(v time.Time) { - o.NotifiedAboutChangeAt = &v -} - -// GetReasonForChange returns the ReasonForChange field value if set, zero value otherwise. -func (o *FreeActorPricingInfo) GetReasonForChange() string { - if o == nil || IsNil(o.ReasonForChange) { - var ret string - return ret - } - return *o.ReasonForChange -} - -// GetReasonForChangeOk returns a tuple with the ReasonForChange field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *FreeActorPricingInfo) GetReasonForChangeOk() (*string, bool) { - if o == nil || IsNil(o.ReasonForChange) { - return nil, false - } - return o.ReasonForChange, true -} - -// HasReasonForChange returns a boolean if a field has been set. -func (o *FreeActorPricingInfo) HasReasonForChange() bool { - if o != nil && !IsNil(o.ReasonForChange) { - return true - } - - return false -} - -// SetReasonForChange gets a reference to the given string and assigns it to the ReasonForChange field. -func (o *FreeActorPricingInfo) SetReasonForChange(v string) { - o.ReasonForChange = &v -} - -// GetIsPriceChangeNotificationSuppressed returns the IsPriceChangeNotificationSuppressed field value if set, zero value otherwise. -func (o *FreeActorPricingInfo) GetIsPriceChangeNotificationSuppressed() bool { - if o == nil || IsNil(o.IsPriceChangeNotificationSuppressed) { - var ret bool - return ret - } - return *o.IsPriceChangeNotificationSuppressed -} - -// GetIsPriceChangeNotificationSuppressedOk returns a tuple with the IsPriceChangeNotificationSuppressed field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *FreeActorPricingInfo) GetIsPriceChangeNotificationSuppressedOk() (*bool, bool) { - if o == nil || IsNil(o.IsPriceChangeNotificationSuppressed) { - return nil, false - } - return o.IsPriceChangeNotificationSuppressed, true -} - -// HasIsPriceChangeNotificationSuppressed returns a boolean if a field has been set. -func (o *FreeActorPricingInfo) HasIsPriceChangeNotificationSuppressed() bool { - if o != nil && !IsNil(o.IsPriceChangeNotificationSuppressed) { - return true - } - - return false -} - -// SetIsPriceChangeNotificationSuppressed gets a reference to the given bool and assigns it to the IsPriceChangeNotificationSuppressed field. -func (o *FreeActorPricingInfo) SetIsPriceChangeNotificationSuppressed(v bool) { - o.IsPriceChangeNotificationSuppressed = &v -} - -// GetForceContainsSignificantPriceChange returns the ForceContainsSignificantPriceChange field value if set, zero value otherwise. -func (o *FreeActorPricingInfo) GetForceContainsSignificantPriceChange() bool { - if o == nil || IsNil(o.ForceContainsSignificantPriceChange) { - var ret bool - return ret - } - return *o.ForceContainsSignificantPriceChange -} - -// GetForceContainsSignificantPriceChangeOk returns a tuple with the ForceContainsSignificantPriceChange field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *FreeActorPricingInfo) GetForceContainsSignificantPriceChangeOk() (*bool, bool) { - if o == nil || IsNil(o.ForceContainsSignificantPriceChange) { - return nil, false - } - return o.ForceContainsSignificantPriceChange, true -} - -// HasForceContainsSignificantPriceChange returns a boolean if a field has been set. -func (o *FreeActorPricingInfo) HasForceContainsSignificantPriceChange() bool { - if o != nil && !IsNil(o.ForceContainsSignificantPriceChange) { - return true - } - - return false -} - -// SetForceContainsSignificantPriceChange gets a reference to the given bool and assigns it to the ForceContainsSignificantPriceChange field. -func (o *FreeActorPricingInfo) SetForceContainsSignificantPriceChange(v bool) { - o.ForceContainsSignificantPriceChange = &v -} - -// GetPricingModel returns the PricingModel field value -func (o *FreeActorPricingInfo) GetPricingModel() string { - if o == nil { - var ret string - return ret - } - - return o.PricingModel -} - -// GetPricingModelOk returns a tuple with the PricingModel field value -// and a boolean to check if the value has been set. -func (o *FreeActorPricingInfo) GetPricingModelOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.PricingModel, true -} - -// SetPricingModel sets field value -func (o *FreeActorPricingInfo) SetPricingModel(v string) { - o.PricingModel = v -} - -func (o FreeActorPricingInfo) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o FreeActorPricingInfo) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["apifyMarginPercentage"] = o.ApifyMarginPercentage - toSerialize["createdAt"] = o.CreatedAt - toSerialize["startedAt"] = o.StartedAt - if !IsNil(o.NotifiedAboutFutureChangeAt) { - toSerialize["notifiedAboutFutureChangeAt"] = o.NotifiedAboutFutureChangeAt - } - if !IsNil(o.NotifiedAboutChangeAt) { - toSerialize["notifiedAboutChangeAt"] = o.NotifiedAboutChangeAt - } - if !IsNil(o.ReasonForChange) { - toSerialize["reasonForChange"] = o.ReasonForChange - } - if !IsNil(o.IsPriceChangeNotificationSuppressed) { - toSerialize["isPriceChangeNotificationSuppressed"] = o.IsPriceChangeNotificationSuppressed - } - if !IsNil(o.ForceContainsSignificantPriceChange) { - toSerialize["forceContainsSignificantPriceChange"] = o.ForceContainsSignificantPriceChange - } - toSerialize["pricingModel"] = o.PricingModel - return toSerialize, nil -} - -func (o *FreeActorPricingInfo) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "apifyMarginPercentage", - "createdAt", - "startedAt", - "pricingModel", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err; - } - - for _, requiredProperty := range(requiredProperties) { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varFreeActorPricingInfo := _FreeActorPricingInfo{} - - decoder := json.NewDecoder(bytes.NewReader(data)) - decoder.DisallowUnknownFields() - err = decoder.Decode(&varFreeActorPricingInfo) - - if err != nil { - return err - } - - *o = FreeActorPricingInfo(varFreeActorPricingInfo) - - return err -} - -type NullableFreeActorPricingInfo struct { - value *FreeActorPricingInfo - isSet bool -} - -func (v NullableFreeActorPricingInfo) Get() *FreeActorPricingInfo { - return v.value -} - -func (v *NullableFreeActorPricingInfo) Set(val *FreeActorPricingInfo) { - v.value = val - v.isSet = true -} - -func (v NullableFreeActorPricingInfo) IsSet() bool { - return v.isSet -} - -func (v *NullableFreeActorPricingInfo) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableFreeActorPricingInfo(val *FreeActorPricingInfo) *NullableFreeActorPricingInfo { - return &NullableFreeActorPricingInfo{value: val, isSet: true} -} - -func (v NullableFreeActorPricingInfo) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableFreeActorPricingInfo) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_general_access.go b/model_general_access.go deleted file mode 100644 index 60f3e8a..0000000 --- a/model_general_access.go +++ /dev/null @@ -1,115 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" - "fmt" -) - -// GeneralAccess Defines the general access level for the resource. -type GeneralAccess string - -// List of GeneralAccess -const ( - ANYONE_WITH_ID_CAN_READ GeneralAccess = "ANYONE_WITH_ID_CAN_READ" - ANYONE_WITH_NAME_CAN_READ GeneralAccess = "ANYONE_WITH_NAME_CAN_READ" - FOLLOW_USER_SETTING GeneralAccess = "FOLLOW_USER_SETTING" - RESTRICTED GeneralAccess = "RESTRICTED" -) - -// All allowed values of GeneralAccess enum -var AllowedGeneralAccessEnumValues = []GeneralAccess{ - "ANYONE_WITH_ID_CAN_READ", - "ANYONE_WITH_NAME_CAN_READ", - "FOLLOW_USER_SETTING", - "RESTRICTED", -} - -func (v *GeneralAccess) UnmarshalJSON(src []byte) error { - var value string - err := json.Unmarshal(src, &value) - if err != nil { - return err - } - enumTypeValue := GeneralAccess(value) - for _, existing := range AllowedGeneralAccessEnumValues { - if existing == enumTypeValue { - *v = enumTypeValue - return nil - } - } - - return fmt.Errorf("%+v is not a valid GeneralAccess", value) -} - -// NewGeneralAccessFromValue returns a pointer to a valid GeneralAccess -// for the value passed as argument, or an error if the value passed is not allowed by the enum -func NewGeneralAccessFromValue(v string) (*GeneralAccess, error) { - ev := GeneralAccess(v) - if ev.IsValid() { - return &ev, nil - } else { - return nil, fmt.Errorf("invalid value '%v' for GeneralAccess: valid values are %v", v, AllowedGeneralAccessEnumValues) - } -} - -// IsValid return true if the value is valid for the enum, false otherwise -func (v GeneralAccess) IsValid() bool { - for _, existing := range AllowedGeneralAccessEnumValues { - if existing == v { - return true - } - } - return false -} - -// Ptr returns reference to GeneralAccess value -func (v GeneralAccess) Ptr() *GeneralAccess { - return &v -} - -type NullableGeneralAccess struct { - value *GeneralAccess - isSet bool -} - -func (v NullableGeneralAccess) Get() *GeneralAccess { - return v.value -} - -func (v *NullableGeneralAccess) Set(val *GeneralAccess) { - v.value = val - v.isSet = true -} - -func (v NullableGeneralAccess) IsSet() bool { - return v.isSet -} - -func (v *NullableGeneralAccess) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableGeneralAccess(val *GeneralAccess) *NullableGeneralAccess { - return &NullableGeneralAccess{value: val, isSet: true} -} - -func (v NullableGeneralAccess) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableGeneralAccess) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - diff --git a/model_head_and_lock_response.go b/model_head_and_lock_response.go deleted file mode 100644 index c1d3fcb..0000000 --- a/model_head_and_lock_response.go +++ /dev/null @@ -1,158 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" - "bytes" - "fmt" -) - -// checks if the HeadAndLockResponse type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &HeadAndLockResponse{} - -// HeadAndLockResponse Response containing locked requests from the request queue head. -type HeadAndLockResponse struct { - Data LockedRequestQueueHead `json:"data"` -} - -type _HeadAndLockResponse HeadAndLockResponse - -// NewHeadAndLockResponse instantiates a new HeadAndLockResponse object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewHeadAndLockResponse(data LockedRequestQueueHead) *HeadAndLockResponse { - this := HeadAndLockResponse{} - this.Data = data - return &this -} - -// NewHeadAndLockResponseWithDefaults instantiates a new HeadAndLockResponse object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewHeadAndLockResponseWithDefaults() *HeadAndLockResponse { - this := HeadAndLockResponse{} - return &this -} - -// GetData returns the Data field value -func (o *HeadAndLockResponse) GetData() LockedRequestQueueHead { - if o == nil { - var ret LockedRequestQueueHead - return ret - } - - return o.Data -} - -// GetDataOk returns a tuple with the Data field value -// and a boolean to check if the value has been set. -func (o *HeadAndLockResponse) GetDataOk() (*LockedRequestQueueHead, bool) { - if o == nil { - return nil, false - } - return &o.Data, true -} - -// SetData sets field value -func (o *HeadAndLockResponse) SetData(v LockedRequestQueueHead) { - o.Data = v -} - -func (o HeadAndLockResponse) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o HeadAndLockResponse) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["data"] = o.Data - return toSerialize, nil -} - -func (o *HeadAndLockResponse) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "data", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err; - } - - for _, requiredProperty := range(requiredProperties) { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varHeadAndLockResponse := _HeadAndLockResponse{} - - decoder := json.NewDecoder(bytes.NewReader(data)) - decoder.DisallowUnknownFields() - err = decoder.Decode(&varHeadAndLockResponse) - - if err != nil { - return err - } - - *o = HeadAndLockResponse(varHeadAndLockResponse) - - return err -} - -type NullableHeadAndLockResponse struct { - value *HeadAndLockResponse - isSet bool -} - -func (v NullableHeadAndLockResponse) Get() *HeadAndLockResponse { - return v.value -} - -func (v *NullableHeadAndLockResponse) Set(val *HeadAndLockResponse) { - v.value = val - v.isSet = true -} - -func (v NullableHeadAndLockResponse) IsSet() bool { - return v.isSet -} - -func (v *NullableHeadAndLockResponse) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableHeadAndLockResponse(val *HeadAndLockResponse) *NullableHeadAndLockResponse { - return &NullableHeadAndLockResponse{value: val, isSet: true} -} - -func (v NullableHeadAndLockResponse) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableHeadAndLockResponse) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_head_request.go b/model_head_request.go deleted file mode 100644 index a620907..0000000 --- a/model_head_request.go +++ /dev/null @@ -1,290 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" - "bytes" - "fmt" -) - -// checks if the HeadRequest type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &HeadRequest{} - -// HeadRequest A request from the request queue head without lock information. -type HeadRequest struct { - // A unique identifier assigned to the request. - Id string `json:"id"` - // A unique key used for request de-duplication. Requests with the same unique key are considered identical. - UniqueKey string `json:"uniqueKey"` - // The URL of the request. - Url string `json:"url"` - Method *HttpMethod `json:"method,omitempty"` - // The number of times this request has been retried. - RetryCount *int32 `json:"retryCount,omitempty"` -} - -type _HeadRequest HeadRequest - -// NewHeadRequest instantiates a new HeadRequest object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewHeadRequest(id string, uniqueKey string, url string) *HeadRequest { - this := HeadRequest{} - this.Id = id - this.UniqueKey = uniqueKey - this.Url = url - return &this -} - -// NewHeadRequestWithDefaults instantiates a new HeadRequest object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewHeadRequestWithDefaults() *HeadRequest { - this := HeadRequest{} - return &this -} - -// GetId returns the Id field value -func (o *HeadRequest) GetId() string { - if o == nil { - var ret string - return ret - } - - return o.Id -} - -// GetIdOk returns a tuple with the Id field value -// and a boolean to check if the value has been set. -func (o *HeadRequest) GetIdOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Id, true -} - -// SetId sets field value -func (o *HeadRequest) SetId(v string) { - o.Id = v -} - -// GetUniqueKey returns the UniqueKey field value -func (o *HeadRequest) GetUniqueKey() string { - if o == nil { - var ret string - return ret - } - - return o.UniqueKey -} - -// GetUniqueKeyOk returns a tuple with the UniqueKey field value -// and a boolean to check if the value has been set. -func (o *HeadRequest) GetUniqueKeyOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.UniqueKey, true -} - -// SetUniqueKey sets field value -func (o *HeadRequest) SetUniqueKey(v string) { - o.UniqueKey = v -} - -// GetUrl returns the Url field value -func (o *HeadRequest) GetUrl() string { - if o == nil { - var ret string - return ret - } - - return o.Url -} - -// GetUrlOk returns a tuple with the Url field value -// and a boolean to check if the value has been set. -func (o *HeadRequest) GetUrlOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Url, true -} - -// SetUrl sets field value -func (o *HeadRequest) SetUrl(v string) { - o.Url = v -} - -// GetMethod returns the Method field value if set, zero value otherwise. -func (o *HeadRequest) GetMethod() HttpMethod { - if o == nil || IsNil(o.Method) { - var ret HttpMethod - return ret - } - return *o.Method -} - -// GetMethodOk returns a tuple with the Method field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *HeadRequest) GetMethodOk() (*HttpMethod, bool) { - if o == nil || IsNil(o.Method) { - return nil, false - } - return o.Method, true -} - -// HasMethod returns a boolean if a field has been set. -func (o *HeadRequest) HasMethod() bool { - if o != nil && !IsNil(o.Method) { - return true - } - - return false -} - -// SetMethod gets a reference to the given HttpMethod and assigns it to the Method field. -func (o *HeadRequest) SetMethod(v HttpMethod) { - o.Method = &v -} - -// GetRetryCount returns the RetryCount field value if set, zero value otherwise. -func (o *HeadRequest) GetRetryCount() int32 { - if o == nil || IsNil(o.RetryCount) { - var ret int32 - return ret - } - return *o.RetryCount -} - -// GetRetryCountOk returns a tuple with the RetryCount field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *HeadRequest) GetRetryCountOk() (*int32, bool) { - if o == nil || IsNil(o.RetryCount) { - return nil, false - } - return o.RetryCount, true -} - -// HasRetryCount returns a boolean if a field has been set. -func (o *HeadRequest) HasRetryCount() bool { - if o != nil && !IsNil(o.RetryCount) { - return true - } - - return false -} - -// SetRetryCount gets a reference to the given int32 and assigns it to the RetryCount field. -func (o *HeadRequest) SetRetryCount(v int32) { - o.RetryCount = &v -} - -func (o HeadRequest) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o HeadRequest) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["id"] = o.Id - toSerialize["uniqueKey"] = o.UniqueKey - toSerialize["url"] = o.Url - if !IsNil(o.Method) { - toSerialize["method"] = o.Method - } - if !IsNil(o.RetryCount) { - toSerialize["retryCount"] = o.RetryCount - } - return toSerialize, nil -} - -func (o *HeadRequest) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "id", - "uniqueKey", - "url", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err; - } - - for _, requiredProperty := range(requiredProperties) { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varHeadRequest := _HeadRequest{} - - decoder := json.NewDecoder(bytes.NewReader(data)) - decoder.DisallowUnknownFields() - err = decoder.Decode(&varHeadRequest) - - if err != nil { - return err - } - - *o = HeadRequest(varHeadRequest) - - return err -} - -type NullableHeadRequest struct { - value *HeadRequest - isSet bool -} - -func (v NullableHeadRequest) Get() *HeadRequest { - return v.value -} - -func (v *NullableHeadRequest) Set(val *HeadRequest) { - v.value = val - v.isSet = true -} - -func (v NullableHeadRequest) IsSet() bool { - return v.isSet -} - -func (v *NullableHeadRequest) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableHeadRequest(val *HeadRequest) *NullableHeadRequest { - return &NullableHeadRequest{value: val, isSet: true} -} - -func (v NullableHeadRequest) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableHeadRequest) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_head_response.go b/model_head_response.go deleted file mode 100644 index 5dedb87..0000000 --- a/model_head_response.go +++ /dev/null @@ -1,158 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" - "bytes" - "fmt" -) - -// checks if the HeadResponse type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &HeadResponse{} - -// HeadResponse Response containing requests from the request queue head without locking. -type HeadResponse struct { - Data RequestQueueHead `json:"data"` -} - -type _HeadResponse HeadResponse - -// NewHeadResponse instantiates a new HeadResponse object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewHeadResponse(data RequestQueueHead) *HeadResponse { - this := HeadResponse{} - this.Data = data - return &this -} - -// NewHeadResponseWithDefaults instantiates a new HeadResponse object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewHeadResponseWithDefaults() *HeadResponse { - this := HeadResponse{} - return &this -} - -// GetData returns the Data field value -func (o *HeadResponse) GetData() RequestQueueHead { - if o == nil { - var ret RequestQueueHead - return ret - } - - return o.Data -} - -// GetDataOk returns a tuple with the Data field value -// and a boolean to check if the value has been set. -func (o *HeadResponse) GetDataOk() (*RequestQueueHead, bool) { - if o == nil { - return nil, false - } - return &o.Data, true -} - -// SetData sets field value -func (o *HeadResponse) SetData(v RequestQueueHead) { - o.Data = v -} - -func (o HeadResponse) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o HeadResponse) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["data"] = o.Data - return toSerialize, nil -} - -func (o *HeadResponse) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "data", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err; - } - - for _, requiredProperty := range(requiredProperties) { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varHeadResponse := _HeadResponse{} - - decoder := json.NewDecoder(bytes.NewReader(data)) - decoder.DisallowUnknownFields() - err = decoder.Decode(&varHeadResponse) - - if err != nil { - return err - } - - *o = HeadResponse(varHeadResponse) - - return err -} - -type NullableHeadResponse struct { - value *HeadResponse - isSet bool -} - -func (v NullableHeadResponse) Get() *HeadResponse { - return v.value -} - -func (v *NullableHeadResponse) Set(val *HeadResponse) { - v.value = val - v.isSet = true -} - -func (v NullableHeadResponse) IsSet() bool { - return v.isSet -} - -func (v *NullableHeadResponse) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableHeadResponse(val *HeadResponse) *NullableHeadResponse { - return &NullableHeadResponse{value: val, isSet: true} -} - -func (v NullableHeadResponse) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableHeadResponse) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_http_method.go b/model_http_method.go deleted file mode 100644 index 9243eef..0000000 --- a/model_http_method.go +++ /dev/null @@ -1,125 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" - "fmt" -) - -// HttpMethod the model 'HttpMethod' -type HttpMethod string - -// List of HttpMethod -const ( - GET HttpMethod = "GET" - HEAD HttpMethod = "HEAD" - POST HttpMethod = "POST" - PUT HttpMethod = "PUT" - DELETE HttpMethod = "DELETE" - CONNECT HttpMethod = "CONNECT" - OPTIONS HttpMethod = "OPTIONS" - TRACE HttpMethod = "TRACE" - PATCH HttpMethod = "PATCH" -) - -// All allowed values of HttpMethod enum -var AllowedHttpMethodEnumValues = []HttpMethod{ - "GET", - "HEAD", - "POST", - "PUT", - "DELETE", - "CONNECT", - "OPTIONS", - "TRACE", - "PATCH", -} - -func (v *HttpMethod) UnmarshalJSON(src []byte) error { - var value string - err := json.Unmarshal(src, &value) - if err != nil { - return err - } - enumTypeValue := HttpMethod(value) - for _, existing := range AllowedHttpMethodEnumValues { - if existing == enumTypeValue { - *v = enumTypeValue - return nil - } - } - - return fmt.Errorf("%+v is not a valid HttpMethod", value) -} - -// NewHttpMethodFromValue returns a pointer to a valid HttpMethod -// for the value passed as argument, or an error if the value passed is not allowed by the enum -func NewHttpMethodFromValue(v string) (*HttpMethod, error) { - ev := HttpMethod(v) - if ev.IsValid() { - return &ev, nil - } else { - return nil, fmt.Errorf("invalid value '%v' for HttpMethod: valid values are %v", v, AllowedHttpMethodEnumValues) - } -} - -// IsValid return true if the value is valid for the enum, false otherwise -func (v HttpMethod) IsValid() bool { - for _, existing := range AllowedHttpMethodEnumValues { - if existing == v { - return true - } - } - return false -} - -// Ptr returns reference to HttpMethod value -func (v HttpMethod) Ptr() *HttpMethod { - return &v -} - -type NullableHttpMethod struct { - value *HttpMethod - isSet bool -} - -func (v NullableHttpMethod) Get() *HttpMethod { - return v.value -} - -func (v *NullableHttpMethod) Set(val *HttpMethod) { - v.value = val - v.isSet = true -} - -func (v NullableHttpMethod) IsSet() bool { - return v.isSet -} - -func (v *NullableHttpMethod) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableHttpMethod(val *HttpMethod) *NullableHttpMethod { - return &NullableHttpMethod{value: val, isSet: true} -} - -func (v NullableHttpMethod) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableHttpMethod) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - diff --git a/model_invalid_item.go b/model_invalid_item.go deleted file mode 100644 index dd0cc92..0000000 --- a/model_invalid_item.go +++ /dev/null @@ -1,164 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" -) - -// checks if the InvalidItem type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &InvalidItem{} - -// InvalidItem struct for InvalidItem -type InvalidItem struct { - // The position of the invalid item in the array. - ItemPosition *int32 `json:"itemPosition,omitempty"` - // A complete list of AJV validation error objects for the invalid item. - ValidationErrors []ValidationError `json:"validationErrors,omitempty"` -} - -// NewInvalidItem instantiates a new InvalidItem object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewInvalidItem() *InvalidItem { - this := InvalidItem{} - return &this -} - -// NewInvalidItemWithDefaults instantiates a new InvalidItem object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewInvalidItemWithDefaults() *InvalidItem { - this := InvalidItem{} - return &this -} - -// GetItemPosition returns the ItemPosition field value if set, zero value otherwise. -func (o *InvalidItem) GetItemPosition() int32 { - if o == nil || IsNil(o.ItemPosition) { - var ret int32 - return ret - } - return *o.ItemPosition -} - -// GetItemPositionOk returns a tuple with the ItemPosition field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *InvalidItem) GetItemPositionOk() (*int32, bool) { - if o == nil || IsNil(o.ItemPosition) { - return nil, false - } - return o.ItemPosition, true -} - -// HasItemPosition returns a boolean if a field has been set. -func (o *InvalidItem) HasItemPosition() bool { - if o != nil && !IsNil(o.ItemPosition) { - return true - } - - return false -} - -// SetItemPosition gets a reference to the given int32 and assigns it to the ItemPosition field. -func (o *InvalidItem) SetItemPosition(v int32) { - o.ItemPosition = &v -} - -// GetValidationErrors returns the ValidationErrors field value if set, zero value otherwise. -func (o *InvalidItem) GetValidationErrors() []ValidationError { - if o == nil || IsNil(o.ValidationErrors) { - var ret []ValidationError - return ret - } - return o.ValidationErrors -} - -// GetValidationErrorsOk returns a tuple with the ValidationErrors field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *InvalidItem) GetValidationErrorsOk() ([]ValidationError, bool) { - if o == nil || IsNil(o.ValidationErrors) { - return nil, false - } - return o.ValidationErrors, true -} - -// HasValidationErrors returns a boolean if a field has been set. -func (o *InvalidItem) HasValidationErrors() bool { - if o != nil && !IsNil(o.ValidationErrors) { - return true - } - - return false -} - -// SetValidationErrors gets a reference to the given []ValidationError and assigns it to the ValidationErrors field. -func (o *InvalidItem) SetValidationErrors(v []ValidationError) { - o.ValidationErrors = v -} - -func (o InvalidItem) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o InvalidItem) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if !IsNil(o.ItemPosition) { - toSerialize["itemPosition"] = o.ItemPosition - } - if !IsNil(o.ValidationErrors) { - toSerialize["validationErrors"] = o.ValidationErrors - } - return toSerialize, nil -} - -type NullableInvalidItem struct { - value *InvalidItem - isSet bool -} - -func (v NullableInvalidItem) Get() *InvalidItem { - return v.value -} - -func (v *NullableInvalidItem) Set(val *InvalidItem) { - v.value = val - v.isSet = true -} - -func (v NullableInvalidItem) IsSet() bool { - return v.isSet -} - -func (v *NullableInvalidItem) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableInvalidItem(val *InvalidItem) *NullableInvalidItem { - return &NullableInvalidItem{value: val, isSet: true} -} - -func (v NullableInvalidItem) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableInvalidItem) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_key_value_store.go b/model_key_value_store.go deleted file mode 100644 index 339e95b..0000000 --- a/model_key_value_store.go +++ /dev/null @@ -1,740 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" - "time" - "bytes" - "fmt" -) - -// checks if the KeyValueStore type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &KeyValueStore{} - -// KeyValueStore struct for KeyValueStore -type KeyValueStore struct { - Id string `json:"id"` - Name NullableString `json:"name,omitempty"` - UserId NullableString `json:"userId,omitempty"` - Username NullableString `json:"username,omitempty"` - CreatedAt time.Time `json:"createdAt"` - ModifiedAt time.Time `json:"modifiedAt"` - AccessedAt time.Time `json:"accessedAt"` - ActId NullableString `json:"actId,omitempty"` - ActRunId NullableString `json:"actRunId,omitempty"` - ConsoleUrl *string `json:"consoleUrl,omitempty"` - // A public link to access keys of the key-value store directly. - KeysPublicUrl *string `json:"keysPublicUrl,omitempty"` - // A public link to access records of the key-value store directly. - RecordsPublicUrl *string `json:"recordsPublicUrl,omitempty"` - // Optional JSON schema describing the keys stored in the key-value store. - Schema map[string]interface{} `json:"schema,omitempty"` - // A secret key for generating signed public URLs. It is only provided to clients with WRITE permission for the key-value store. - UrlSigningSecretKey NullableString `json:"urlSigningSecretKey,omitempty"` - GeneralAccess *GeneralAccess `json:"generalAccess,omitempty"` - Stats *KeyValueStoreStats `json:"stats,omitempty"` -} - -type _KeyValueStore KeyValueStore - -// NewKeyValueStore instantiates a new KeyValueStore object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewKeyValueStore(id string, createdAt time.Time, modifiedAt time.Time, accessedAt time.Time) *KeyValueStore { - this := KeyValueStore{} - this.Id = id - this.CreatedAt = createdAt - this.ModifiedAt = modifiedAt - this.AccessedAt = accessedAt - return &this -} - -// NewKeyValueStoreWithDefaults instantiates a new KeyValueStore object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewKeyValueStoreWithDefaults() *KeyValueStore { - this := KeyValueStore{} - return &this -} - -// GetId returns the Id field value -func (o *KeyValueStore) GetId() string { - if o == nil { - var ret string - return ret - } - - return o.Id -} - -// GetIdOk returns a tuple with the Id field value -// and a boolean to check if the value has been set. -func (o *KeyValueStore) GetIdOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Id, true -} - -// SetId sets field value -func (o *KeyValueStore) SetId(v string) { - o.Id = v -} - -// GetName returns the Name field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *KeyValueStore) GetName() string { - if o == nil || IsNil(o.Name.Get()) { - var ret string - return ret - } - return *o.Name.Get() -} - -// GetNameOk returns a tuple with the Name field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *KeyValueStore) GetNameOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.Name.Get(), o.Name.IsSet() -} - -// HasName returns a boolean if a field has been set. -func (o *KeyValueStore) HasName() bool { - if o != nil && o.Name.IsSet() { - return true - } - - return false -} - -// SetName gets a reference to the given NullableString and assigns it to the Name field. -func (o *KeyValueStore) SetName(v string) { - o.Name.Set(&v) -} -// SetNameNil sets the value for Name to be an explicit nil -func (o *KeyValueStore) SetNameNil() { - o.Name.Set(nil) -} - -// UnsetName ensures that no value is present for Name, not even an explicit nil -func (o *KeyValueStore) UnsetName() { - o.Name.Unset() -} - -// GetUserId returns the UserId field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *KeyValueStore) GetUserId() string { - if o == nil || IsNil(o.UserId.Get()) { - var ret string - return ret - } - return *o.UserId.Get() -} - -// GetUserIdOk returns a tuple with the UserId field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *KeyValueStore) GetUserIdOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.UserId.Get(), o.UserId.IsSet() -} - -// HasUserId returns a boolean if a field has been set. -func (o *KeyValueStore) HasUserId() bool { - if o != nil && o.UserId.IsSet() { - return true - } - - return false -} - -// SetUserId gets a reference to the given NullableString and assigns it to the UserId field. -func (o *KeyValueStore) SetUserId(v string) { - o.UserId.Set(&v) -} -// SetUserIdNil sets the value for UserId to be an explicit nil -func (o *KeyValueStore) SetUserIdNil() { - o.UserId.Set(nil) -} - -// UnsetUserId ensures that no value is present for UserId, not even an explicit nil -func (o *KeyValueStore) UnsetUserId() { - o.UserId.Unset() -} - -// GetUsername returns the Username field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *KeyValueStore) GetUsername() string { - if o == nil || IsNil(o.Username.Get()) { - var ret string - return ret - } - return *o.Username.Get() -} - -// GetUsernameOk returns a tuple with the Username field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *KeyValueStore) GetUsernameOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.Username.Get(), o.Username.IsSet() -} - -// HasUsername returns a boolean if a field has been set. -func (o *KeyValueStore) HasUsername() bool { - if o != nil && o.Username.IsSet() { - return true - } - - return false -} - -// SetUsername gets a reference to the given NullableString and assigns it to the Username field. -func (o *KeyValueStore) SetUsername(v string) { - o.Username.Set(&v) -} -// SetUsernameNil sets the value for Username to be an explicit nil -func (o *KeyValueStore) SetUsernameNil() { - o.Username.Set(nil) -} - -// UnsetUsername ensures that no value is present for Username, not even an explicit nil -func (o *KeyValueStore) UnsetUsername() { - o.Username.Unset() -} - -// GetCreatedAt returns the CreatedAt field value -func (o *KeyValueStore) GetCreatedAt() time.Time { - if o == nil { - var ret time.Time - return ret - } - - return o.CreatedAt -} - -// GetCreatedAtOk returns a tuple with the CreatedAt field value -// and a boolean to check if the value has been set. -func (o *KeyValueStore) GetCreatedAtOk() (*time.Time, bool) { - if o == nil { - return nil, false - } - return &o.CreatedAt, true -} - -// SetCreatedAt sets field value -func (o *KeyValueStore) SetCreatedAt(v time.Time) { - o.CreatedAt = v -} - -// GetModifiedAt returns the ModifiedAt field value -func (o *KeyValueStore) GetModifiedAt() time.Time { - if o == nil { - var ret time.Time - return ret - } - - return o.ModifiedAt -} - -// GetModifiedAtOk returns a tuple with the ModifiedAt field value -// and a boolean to check if the value has been set. -func (o *KeyValueStore) GetModifiedAtOk() (*time.Time, bool) { - if o == nil { - return nil, false - } - return &o.ModifiedAt, true -} - -// SetModifiedAt sets field value -func (o *KeyValueStore) SetModifiedAt(v time.Time) { - o.ModifiedAt = v -} - -// GetAccessedAt returns the AccessedAt field value -func (o *KeyValueStore) GetAccessedAt() time.Time { - if o == nil { - var ret time.Time - return ret - } - - return o.AccessedAt -} - -// GetAccessedAtOk returns a tuple with the AccessedAt field value -// and a boolean to check if the value has been set. -func (o *KeyValueStore) GetAccessedAtOk() (*time.Time, bool) { - if o == nil { - return nil, false - } - return &o.AccessedAt, true -} - -// SetAccessedAt sets field value -func (o *KeyValueStore) SetAccessedAt(v time.Time) { - o.AccessedAt = v -} - -// GetActId returns the ActId field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *KeyValueStore) GetActId() string { - if o == nil || IsNil(o.ActId.Get()) { - var ret string - return ret - } - return *o.ActId.Get() -} - -// GetActIdOk returns a tuple with the ActId field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *KeyValueStore) GetActIdOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.ActId.Get(), o.ActId.IsSet() -} - -// HasActId returns a boolean if a field has been set. -func (o *KeyValueStore) HasActId() bool { - if o != nil && o.ActId.IsSet() { - return true - } - - return false -} - -// SetActId gets a reference to the given NullableString and assigns it to the ActId field. -func (o *KeyValueStore) SetActId(v string) { - o.ActId.Set(&v) -} -// SetActIdNil sets the value for ActId to be an explicit nil -func (o *KeyValueStore) SetActIdNil() { - o.ActId.Set(nil) -} - -// UnsetActId ensures that no value is present for ActId, not even an explicit nil -func (o *KeyValueStore) UnsetActId() { - o.ActId.Unset() -} - -// GetActRunId returns the ActRunId field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *KeyValueStore) GetActRunId() string { - if o == nil || IsNil(o.ActRunId.Get()) { - var ret string - return ret - } - return *o.ActRunId.Get() -} - -// GetActRunIdOk returns a tuple with the ActRunId field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *KeyValueStore) GetActRunIdOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.ActRunId.Get(), o.ActRunId.IsSet() -} - -// HasActRunId returns a boolean if a field has been set. -func (o *KeyValueStore) HasActRunId() bool { - if o != nil && o.ActRunId.IsSet() { - return true - } - - return false -} - -// SetActRunId gets a reference to the given NullableString and assigns it to the ActRunId field. -func (o *KeyValueStore) SetActRunId(v string) { - o.ActRunId.Set(&v) -} -// SetActRunIdNil sets the value for ActRunId to be an explicit nil -func (o *KeyValueStore) SetActRunIdNil() { - o.ActRunId.Set(nil) -} - -// UnsetActRunId ensures that no value is present for ActRunId, not even an explicit nil -func (o *KeyValueStore) UnsetActRunId() { - o.ActRunId.Unset() -} - -// GetConsoleUrl returns the ConsoleUrl field value if set, zero value otherwise. -func (o *KeyValueStore) GetConsoleUrl() string { - if o == nil || IsNil(o.ConsoleUrl) { - var ret string - return ret - } - return *o.ConsoleUrl -} - -// GetConsoleUrlOk returns a tuple with the ConsoleUrl field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *KeyValueStore) GetConsoleUrlOk() (*string, bool) { - if o == nil || IsNil(o.ConsoleUrl) { - return nil, false - } - return o.ConsoleUrl, true -} - -// HasConsoleUrl returns a boolean if a field has been set. -func (o *KeyValueStore) HasConsoleUrl() bool { - if o != nil && !IsNil(o.ConsoleUrl) { - return true - } - - return false -} - -// SetConsoleUrl gets a reference to the given string and assigns it to the ConsoleUrl field. -func (o *KeyValueStore) SetConsoleUrl(v string) { - o.ConsoleUrl = &v -} - -// GetKeysPublicUrl returns the KeysPublicUrl field value if set, zero value otherwise. -func (o *KeyValueStore) GetKeysPublicUrl() string { - if o == nil || IsNil(o.KeysPublicUrl) { - var ret string - return ret - } - return *o.KeysPublicUrl -} - -// GetKeysPublicUrlOk returns a tuple with the KeysPublicUrl field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *KeyValueStore) GetKeysPublicUrlOk() (*string, bool) { - if o == nil || IsNil(o.KeysPublicUrl) { - return nil, false - } - return o.KeysPublicUrl, true -} - -// HasKeysPublicUrl returns a boolean if a field has been set. -func (o *KeyValueStore) HasKeysPublicUrl() bool { - if o != nil && !IsNil(o.KeysPublicUrl) { - return true - } - - return false -} - -// SetKeysPublicUrl gets a reference to the given string and assigns it to the KeysPublicUrl field. -func (o *KeyValueStore) SetKeysPublicUrl(v string) { - o.KeysPublicUrl = &v -} - -// GetRecordsPublicUrl returns the RecordsPublicUrl field value if set, zero value otherwise. -func (o *KeyValueStore) GetRecordsPublicUrl() string { - if o == nil || IsNil(o.RecordsPublicUrl) { - var ret string - return ret - } - return *o.RecordsPublicUrl -} - -// GetRecordsPublicUrlOk returns a tuple with the RecordsPublicUrl field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *KeyValueStore) GetRecordsPublicUrlOk() (*string, bool) { - if o == nil || IsNil(o.RecordsPublicUrl) { - return nil, false - } - return o.RecordsPublicUrl, true -} - -// HasRecordsPublicUrl returns a boolean if a field has been set. -func (o *KeyValueStore) HasRecordsPublicUrl() bool { - if o != nil && !IsNil(o.RecordsPublicUrl) { - return true - } - - return false -} - -// SetRecordsPublicUrl gets a reference to the given string and assigns it to the RecordsPublicUrl field. -func (o *KeyValueStore) SetRecordsPublicUrl(v string) { - o.RecordsPublicUrl = &v -} - -// GetSchema returns the Schema field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *KeyValueStore) GetSchema() map[string]interface{} { - if o == nil { - var ret map[string]interface{} - return ret - } - return o.Schema -} - -// GetSchemaOk returns a tuple with the Schema field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *KeyValueStore) GetSchemaOk() (map[string]interface{}, bool) { - if o == nil || IsNil(o.Schema) { - return map[string]interface{}{}, false - } - return o.Schema, true -} - -// HasSchema returns a boolean if a field has been set. -func (o *KeyValueStore) HasSchema() bool { - if o != nil && !IsNil(o.Schema) { - return true - } - - return false -} - -// SetSchema gets a reference to the given map[string]interface{} and assigns it to the Schema field. -func (o *KeyValueStore) SetSchema(v map[string]interface{}) { - o.Schema = v -} - -// GetUrlSigningSecretKey returns the UrlSigningSecretKey field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *KeyValueStore) GetUrlSigningSecretKey() string { - if o == nil || IsNil(o.UrlSigningSecretKey.Get()) { - var ret string - return ret - } - return *o.UrlSigningSecretKey.Get() -} - -// GetUrlSigningSecretKeyOk returns a tuple with the UrlSigningSecretKey field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *KeyValueStore) GetUrlSigningSecretKeyOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.UrlSigningSecretKey.Get(), o.UrlSigningSecretKey.IsSet() -} - -// HasUrlSigningSecretKey returns a boolean if a field has been set. -func (o *KeyValueStore) HasUrlSigningSecretKey() bool { - if o != nil && o.UrlSigningSecretKey.IsSet() { - return true - } - - return false -} - -// SetUrlSigningSecretKey gets a reference to the given NullableString and assigns it to the UrlSigningSecretKey field. -func (o *KeyValueStore) SetUrlSigningSecretKey(v string) { - o.UrlSigningSecretKey.Set(&v) -} -// SetUrlSigningSecretKeyNil sets the value for UrlSigningSecretKey to be an explicit nil -func (o *KeyValueStore) SetUrlSigningSecretKeyNil() { - o.UrlSigningSecretKey.Set(nil) -} - -// UnsetUrlSigningSecretKey ensures that no value is present for UrlSigningSecretKey, not even an explicit nil -func (o *KeyValueStore) UnsetUrlSigningSecretKey() { - o.UrlSigningSecretKey.Unset() -} - -// GetGeneralAccess returns the GeneralAccess field value if set, zero value otherwise. -func (o *KeyValueStore) GetGeneralAccess() GeneralAccess { - if o == nil || IsNil(o.GeneralAccess) { - var ret GeneralAccess - return ret - } - return *o.GeneralAccess -} - -// GetGeneralAccessOk returns a tuple with the GeneralAccess field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *KeyValueStore) GetGeneralAccessOk() (*GeneralAccess, bool) { - if o == nil || IsNil(o.GeneralAccess) { - return nil, false - } - return o.GeneralAccess, true -} - -// HasGeneralAccess returns a boolean if a field has been set. -func (o *KeyValueStore) HasGeneralAccess() bool { - if o != nil && !IsNil(o.GeneralAccess) { - return true - } - - return false -} - -// SetGeneralAccess gets a reference to the given GeneralAccess and assigns it to the GeneralAccess field. -func (o *KeyValueStore) SetGeneralAccess(v GeneralAccess) { - o.GeneralAccess = &v -} - -// GetStats returns the Stats field value if set, zero value otherwise. -func (o *KeyValueStore) GetStats() KeyValueStoreStats { - if o == nil || IsNil(o.Stats) { - var ret KeyValueStoreStats - return ret - } - return *o.Stats -} - -// GetStatsOk returns a tuple with the Stats field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *KeyValueStore) GetStatsOk() (*KeyValueStoreStats, bool) { - if o == nil || IsNil(o.Stats) { - return nil, false - } - return o.Stats, true -} - -// HasStats returns a boolean if a field has been set. -func (o *KeyValueStore) HasStats() bool { - if o != nil && !IsNil(o.Stats) { - return true - } - - return false -} - -// SetStats gets a reference to the given KeyValueStoreStats and assigns it to the Stats field. -func (o *KeyValueStore) SetStats(v KeyValueStoreStats) { - o.Stats = &v -} - -func (o KeyValueStore) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o KeyValueStore) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["id"] = o.Id - if o.Name.IsSet() { - toSerialize["name"] = o.Name.Get() - } - if o.UserId.IsSet() { - toSerialize["userId"] = o.UserId.Get() - } - if o.Username.IsSet() { - toSerialize["username"] = o.Username.Get() - } - toSerialize["createdAt"] = o.CreatedAt - toSerialize["modifiedAt"] = o.ModifiedAt - toSerialize["accessedAt"] = o.AccessedAt - if o.ActId.IsSet() { - toSerialize["actId"] = o.ActId.Get() - } - if o.ActRunId.IsSet() { - toSerialize["actRunId"] = o.ActRunId.Get() - } - if !IsNil(o.ConsoleUrl) { - toSerialize["consoleUrl"] = o.ConsoleUrl - } - if !IsNil(o.KeysPublicUrl) { - toSerialize["keysPublicUrl"] = o.KeysPublicUrl - } - if !IsNil(o.RecordsPublicUrl) { - toSerialize["recordsPublicUrl"] = o.RecordsPublicUrl - } - if o.Schema != nil { - toSerialize["schema"] = o.Schema - } - if o.UrlSigningSecretKey.IsSet() { - toSerialize["urlSigningSecretKey"] = o.UrlSigningSecretKey.Get() - } - if !IsNil(o.GeneralAccess) { - toSerialize["generalAccess"] = o.GeneralAccess - } - if !IsNil(o.Stats) { - toSerialize["stats"] = o.Stats - } - return toSerialize, nil -} - -func (o *KeyValueStore) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "id", - "createdAt", - "modifiedAt", - "accessedAt", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err; - } - - for _, requiredProperty := range(requiredProperties) { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varKeyValueStore := _KeyValueStore{} - - decoder := json.NewDecoder(bytes.NewReader(data)) - decoder.DisallowUnknownFields() - err = decoder.Decode(&varKeyValueStore) - - if err != nil { - return err - } - - *o = KeyValueStore(varKeyValueStore) - - return err -} - -type NullableKeyValueStore struct { - value *KeyValueStore - isSet bool -} - -func (v NullableKeyValueStore) Get() *KeyValueStore { - return v.value -} - -func (v *NullableKeyValueStore) Set(val *KeyValueStore) { - v.value = val - v.isSet = true -} - -func (v NullableKeyValueStore) IsSet() bool { - return v.isSet -} - -func (v *NullableKeyValueStore) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableKeyValueStore(val *KeyValueStore) *NullableKeyValueStore { - return &NullableKeyValueStore{value: val, isSet: true} -} - -func (v NullableKeyValueStore) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableKeyValueStore) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_key_value_store_key.go b/model_key_value_store_key.go deleted file mode 100644 index 52193b4..0000000 --- a/model_key_value_store_key.go +++ /dev/null @@ -1,215 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" - "bytes" - "fmt" -) - -// checks if the KeyValueStoreKey type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &KeyValueStoreKey{} - -// KeyValueStoreKey struct for KeyValueStoreKey -type KeyValueStoreKey struct { - Key string `json:"key"` - Size int32 `json:"size"` - // A public link to access this record directly. - RecordPublicUrl string `json:"recordPublicUrl"` -} - -type _KeyValueStoreKey KeyValueStoreKey - -// NewKeyValueStoreKey instantiates a new KeyValueStoreKey object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewKeyValueStoreKey(key string, size int32, recordPublicUrl string) *KeyValueStoreKey { - this := KeyValueStoreKey{} - this.Key = key - this.Size = size - this.RecordPublicUrl = recordPublicUrl - return &this -} - -// NewKeyValueStoreKeyWithDefaults instantiates a new KeyValueStoreKey object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewKeyValueStoreKeyWithDefaults() *KeyValueStoreKey { - this := KeyValueStoreKey{} - return &this -} - -// GetKey returns the Key field value -func (o *KeyValueStoreKey) GetKey() string { - if o == nil { - var ret string - return ret - } - - return o.Key -} - -// GetKeyOk returns a tuple with the Key field value -// and a boolean to check if the value has been set. -func (o *KeyValueStoreKey) GetKeyOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Key, true -} - -// SetKey sets field value -func (o *KeyValueStoreKey) SetKey(v string) { - o.Key = v -} - -// GetSize returns the Size field value -func (o *KeyValueStoreKey) GetSize() int32 { - if o == nil { - var ret int32 - return ret - } - - return o.Size -} - -// GetSizeOk returns a tuple with the Size field value -// and a boolean to check if the value has been set. -func (o *KeyValueStoreKey) GetSizeOk() (*int32, bool) { - if o == nil { - return nil, false - } - return &o.Size, true -} - -// SetSize sets field value -func (o *KeyValueStoreKey) SetSize(v int32) { - o.Size = v -} - -// GetRecordPublicUrl returns the RecordPublicUrl field value -func (o *KeyValueStoreKey) GetRecordPublicUrl() string { - if o == nil { - var ret string - return ret - } - - return o.RecordPublicUrl -} - -// GetRecordPublicUrlOk returns a tuple with the RecordPublicUrl field value -// and a boolean to check if the value has been set. -func (o *KeyValueStoreKey) GetRecordPublicUrlOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.RecordPublicUrl, true -} - -// SetRecordPublicUrl sets field value -func (o *KeyValueStoreKey) SetRecordPublicUrl(v string) { - o.RecordPublicUrl = v -} - -func (o KeyValueStoreKey) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o KeyValueStoreKey) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["key"] = o.Key - toSerialize["size"] = o.Size - toSerialize["recordPublicUrl"] = o.RecordPublicUrl - return toSerialize, nil -} - -func (o *KeyValueStoreKey) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "key", - "size", - "recordPublicUrl", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err; - } - - for _, requiredProperty := range(requiredProperties) { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varKeyValueStoreKey := _KeyValueStoreKey{} - - decoder := json.NewDecoder(bytes.NewReader(data)) - decoder.DisallowUnknownFields() - err = decoder.Decode(&varKeyValueStoreKey) - - if err != nil { - return err - } - - *o = KeyValueStoreKey(varKeyValueStoreKey) - - return err -} - -type NullableKeyValueStoreKey struct { - value *KeyValueStoreKey - isSet bool -} - -func (v NullableKeyValueStoreKey) Get() *KeyValueStoreKey { - return v.value -} - -func (v *NullableKeyValueStoreKey) Set(val *KeyValueStoreKey) { - v.value = val - v.isSet = true -} - -func (v NullableKeyValueStoreKey) IsSet() bool { - return v.isSet -} - -func (v *NullableKeyValueStoreKey) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableKeyValueStoreKey(val *KeyValueStoreKey) *NullableKeyValueStoreKey { - return &NullableKeyValueStoreKey{value: val, isSet: true} -} - -func (v NullableKeyValueStoreKey) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableKeyValueStoreKey) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_key_value_store_response.go b/model_key_value_store_response.go deleted file mode 100644 index 252dbb3..0000000 --- a/model_key_value_store_response.go +++ /dev/null @@ -1,158 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" - "bytes" - "fmt" -) - -// checks if the KeyValueStoreResponse type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &KeyValueStoreResponse{} - -// KeyValueStoreResponse Response containing key-value store data. -type KeyValueStoreResponse struct { - Data KeyValueStore `json:"data"` -} - -type _KeyValueStoreResponse KeyValueStoreResponse - -// NewKeyValueStoreResponse instantiates a new KeyValueStoreResponse object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewKeyValueStoreResponse(data KeyValueStore) *KeyValueStoreResponse { - this := KeyValueStoreResponse{} - this.Data = data - return &this -} - -// NewKeyValueStoreResponseWithDefaults instantiates a new KeyValueStoreResponse object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewKeyValueStoreResponseWithDefaults() *KeyValueStoreResponse { - this := KeyValueStoreResponse{} - return &this -} - -// GetData returns the Data field value -func (o *KeyValueStoreResponse) GetData() KeyValueStore { - if o == nil { - var ret KeyValueStore - return ret - } - - return o.Data -} - -// GetDataOk returns a tuple with the Data field value -// and a boolean to check if the value has been set. -func (o *KeyValueStoreResponse) GetDataOk() (*KeyValueStore, bool) { - if o == nil { - return nil, false - } - return &o.Data, true -} - -// SetData sets field value -func (o *KeyValueStoreResponse) SetData(v KeyValueStore) { - o.Data = v -} - -func (o KeyValueStoreResponse) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o KeyValueStoreResponse) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["data"] = o.Data - return toSerialize, nil -} - -func (o *KeyValueStoreResponse) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "data", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err; - } - - for _, requiredProperty := range(requiredProperties) { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varKeyValueStoreResponse := _KeyValueStoreResponse{} - - decoder := json.NewDecoder(bytes.NewReader(data)) - decoder.DisallowUnknownFields() - err = decoder.Decode(&varKeyValueStoreResponse) - - if err != nil { - return err - } - - *o = KeyValueStoreResponse(varKeyValueStoreResponse) - - return err -} - -type NullableKeyValueStoreResponse struct { - value *KeyValueStoreResponse - isSet bool -} - -func (v NullableKeyValueStoreResponse) Get() *KeyValueStoreResponse { - return v.value -} - -func (v *NullableKeyValueStoreResponse) Set(val *KeyValueStoreResponse) { - v.value = val - v.isSet = true -} - -func (v NullableKeyValueStoreResponse) IsSet() bool { - return v.isSet -} - -func (v *NullableKeyValueStoreResponse) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableKeyValueStoreResponse(val *KeyValueStoreResponse) *NullableKeyValueStoreResponse { - return &NullableKeyValueStoreResponse{value: val, isSet: true} -} - -func (v NullableKeyValueStoreResponse) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableKeyValueStoreResponse) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_key_value_store_stats.go b/model_key_value_store_stats.go deleted file mode 100644 index 86242f7..0000000 --- a/model_key_value_store_stats.go +++ /dev/null @@ -1,314 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" - "bytes" - "fmt" -) - -// checks if the KeyValueStoreStats type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &KeyValueStoreStats{} - -// KeyValueStoreStats struct for KeyValueStoreStats -type KeyValueStoreStats struct { - ReadCount int32 `json:"readCount"` - WriteCount int32 `json:"writeCount"` - DeleteCount int32 `json:"deleteCount"` - ListCount int32 `json:"listCount"` - S3StorageBytes *int32 `json:"s3StorageBytes,omitempty"` - StorageBytes *int32 `json:"storageBytes,omitempty"` -} - -type _KeyValueStoreStats KeyValueStoreStats - -// NewKeyValueStoreStats instantiates a new KeyValueStoreStats object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewKeyValueStoreStats(readCount int32, writeCount int32, deleteCount int32, listCount int32) *KeyValueStoreStats { - this := KeyValueStoreStats{} - this.ReadCount = readCount - this.WriteCount = writeCount - this.DeleteCount = deleteCount - this.ListCount = listCount - return &this -} - -// NewKeyValueStoreStatsWithDefaults instantiates a new KeyValueStoreStats object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewKeyValueStoreStatsWithDefaults() *KeyValueStoreStats { - this := KeyValueStoreStats{} - return &this -} - -// GetReadCount returns the ReadCount field value -func (o *KeyValueStoreStats) GetReadCount() int32 { - if o == nil { - var ret int32 - return ret - } - - return o.ReadCount -} - -// GetReadCountOk returns a tuple with the ReadCount field value -// and a boolean to check if the value has been set. -func (o *KeyValueStoreStats) GetReadCountOk() (*int32, bool) { - if o == nil { - return nil, false - } - return &o.ReadCount, true -} - -// SetReadCount sets field value -func (o *KeyValueStoreStats) SetReadCount(v int32) { - o.ReadCount = v -} - -// GetWriteCount returns the WriteCount field value -func (o *KeyValueStoreStats) GetWriteCount() int32 { - if o == nil { - var ret int32 - return ret - } - - return o.WriteCount -} - -// GetWriteCountOk returns a tuple with the WriteCount field value -// and a boolean to check if the value has been set. -func (o *KeyValueStoreStats) GetWriteCountOk() (*int32, bool) { - if o == nil { - return nil, false - } - return &o.WriteCount, true -} - -// SetWriteCount sets field value -func (o *KeyValueStoreStats) SetWriteCount(v int32) { - o.WriteCount = v -} - -// GetDeleteCount returns the DeleteCount field value -func (o *KeyValueStoreStats) GetDeleteCount() int32 { - if o == nil { - var ret int32 - return ret - } - - return o.DeleteCount -} - -// GetDeleteCountOk returns a tuple with the DeleteCount field value -// and a boolean to check if the value has been set. -func (o *KeyValueStoreStats) GetDeleteCountOk() (*int32, bool) { - if o == nil { - return nil, false - } - return &o.DeleteCount, true -} - -// SetDeleteCount sets field value -func (o *KeyValueStoreStats) SetDeleteCount(v int32) { - o.DeleteCount = v -} - -// GetListCount returns the ListCount field value -func (o *KeyValueStoreStats) GetListCount() int32 { - if o == nil { - var ret int32 - return ret - } - - return o.ListCount -} - -// GetListCountOk returns a tuple with the ListCount field value -// and a boolean to check if the value has been set. -func (o *KeyValueStoreStats) GetListCountOk() (*int32, bool) { - if o == nil { - return nil, false - } - return &o.ListCount, true -} - -// SetListCount sets field value -func (o *KeyValueStoreStats) SetListCount(v int32) { - o.ListCount = v -} - -// GetS3StorageBytes returns the S3StorageBytes field value if set, zero value otherwise. -func (o *KeyValueStoreStats) GetS3StorageBytes() int32 { - if o == nil || IsNil(o.S3StorageBytes) { - var ret int32 - return ret - } - return *o.S3StorageBytes -} - -// GetS3StorageBytesOk returns a tuple with the S3StorageBytes field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *KeyValueStoreStats) GetS3StorageBytesOk() (*int32, bool) { - if o == nil || IsNil(o.S3StorageBytes) { - return nil, false - } - return o.S3StorageBytes, true -} - -// HasS3StorageBytes returns a boolean if a field has been set. -func (o *KeyValueStoreStats) HasS3StorageBytes() bool { - if o != nil && !IsNil(o.S3StorageBytes) { - return true - } - - return false -} - -// SetS3StorageBytes gets a reference to the given int32 and assigns it to the S3StorageBytes field. -func (o *KeyValueStoreStats) SetS3StorageBytes(v int32) { - o.S3StorageBytes = &v -} - -// GetStorageBytes returns the StorageBytes field value if set, zero value otherwise. -func (o *KeyValueStoreStats) GetStorageBytes() int32 { - if o == nil || IsNil(o.StorageBytes) { - var ret int32 - return ret - } - return *o.StorageBytes -} - -// GetStorageBytesOk returns a tuple with the StorageBytes field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *KeyValueStoreStats) GetStorageBytesOk() (*int32, bool) { - if o == nil || IsNil(o.StorageBytes) { - return nil, false - } - return o.StorageBytes, true -} - -// HasStorageBytes returns a boolean if a field has been set. -func (o *KeyValueStoreStats) HasStorageBytes() bool { - if o != nil && !IsNil(o.StorageBytes) { - return true - } - - return false -} - -// SetStorageBytes gets a reference to the given int32 and assigns it to the StorageBytes field. -func (o *KeyValueStoreStats) SetStorageBytes(v int32) { - o.StorageBytes = &v -} - -func (o KeyValueStoreStats) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o KeyValueStoreStats) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["readCount"] = o.ReadCount - toSerialize["writeCount"] = o.WriteCount - toSerialize["deleteCount"] = o.DeleteCount - toSerialize["listCount"] = o.ListCount - if !IsNil(o.S3StorageBytes) { - toSerialize["s3StorageBytes"] = o.S3StorageBytes - } - if !IsNil(o.StorageBytes) { - toSerialize["storageBytes"] = o.StorageBytes - } - return toSerialize, nil -} - -func (o *KeyValueStoreStats) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "readCount", - "writeCount", - "deleteCount", - "listCount", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err; - } - - for _, requiredProperty := range(requiredProperties) { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varKeyValueStoreStats := _KeyValueStoreStats{} - - decoder := json.NewDecoder(bytes.NewReader(data)) - decoder.DisallowUnknownFields() - err = decoder.Decode(&varKeyValueStoreStats) - - if err != nil { - return err - } - - *o = KeyValueStoreStats(varKeyValueStoreStats) - - return err -} - -type NullableKeyValueStoreStats struct { - value *KeyValueStoreStats - isSet bool -} - -func (v NullableKeyValueStoreStats) Get() *KeyValueStoreStats { - return v.value -} - -func (v *NullableKeyValueStoreStats) Set(val *KeyValueStoreStats) { - v.value = val - v.isSet = true -} - -func (v NullableKeyValueStoreStats) IsSet() bool { - return v.isSet -} - -func (v *NullableKeyValueStoreStats) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableKeyValueStoreStats(val *KeyValueStoreStats) *NullableKeyValueStoreStats { - return &NullableKeyValueStoreStats{value: val, isSet: true} -} - -func (v NullableKeyValueStoreStats) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableKeyValueStoreStats) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_limits.go b/model_limits.go deleted file mode 100644 index a387fdd..0000000 --- a/model_limits.go +++ /dev/null @@ -1,474 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" - "bytes" - "fmt" -) - -// checks if the Limits type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &Limits{} - -// Limits struct for Limits -type Limits struct { - MaxMonthlyUsageUsd float32 `json:"maxMonthlyUsageUsd"` - MaxMonthlyActorComputeUnits float32 `json:"maxMonthlyActorComputeUnits"` - MaxMonthlyExternalDataTransferGbytes float32 `json:"maxMonthlyExternalDataTransferGbytes"` - MaxMonthlyProxySerps int32 `json:"maxMonthlyProxySerps"` - MaxMonthlyResidentialProxyGbytes float32 `json:"maxMonthlyResidentialProxyGbytes"` - MaxActorMemoryGbytes float32 `json:"maxActorMemoryGbytes"` - MaxActorCount int32 `json:"maxActorCount"` - MaxActorTaskCount int32 `json:"maxActorTaskCount"` - MaxConcurrentActorJobs int32 `json:"maxConcurrentActorJobs"` - MaxTeamAccountSeatCount int32 `json:"maxTeamAccountSeatCount"` - DataRetentionDays int32 `json:"dataRetentionDays"` - MaxScheduleCount *int32 `json:"maxScheduleCount,omitempty"` -} - -type _Limits Limits - -// NewLimits instantiates a new Limits object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewLimits(maxMonthlyUsageUsd float32, maxMonthlyActorComputeUnits float32, maxMonthlyExternalDataTransferGbytes float32, maxMonthlyProxySerps int32, maxMonthlyResidentialProxyGbytes float32, maxActorMemoryGbytes float32, maxActorCount int32, maxActorTaskCount int32, maxConcurrentActorJobs int32, maxTeamAccountSeatCount int32, dataRetentionDays int32) *Limits { - this := Limits{} - this.MaxMonthlyUsageUsd = maxMonthlyUsageUsd - this.MaxMonthlyActorComputeUnits = maxMonthlyActorComputeUnits - this.MaxMonthlyExternalDataTransferGbytes = maxMonthlyExternalDataTransferGbytes - this.MaxMonthlyProxySerps = maxMonthlyProxySerps - this.MaxMonthlyResidentialProxyGbytes = maxMonthlyResidentialProxyGbytes - this.MaxActorMemoryGbytes = maxActorMemoryGbytes - this.MaxActorCount = maxActorCount - this.MaxActorTaskCount = maxActorTaskCount - this.MaxConcurrentActorJobs = maxConcurrentActorJobs - this.MaxTeamAccountSeatCount = maxTeamAccountSeatCount - this.DataRetentionDays = dataRetentionDays - return &this -} - -// NewLimitsWithDefaults instantiates a new Limits object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewLimitsWithDefaults() *Limits { - this := Limits{} - return &this -} - -// GetMaxMonthlyUsageUsd returns the MaxMonthlyUsageUsd field value -func (o *Limits) GetMaxMonthlyUsageUsd() float32 { - if o == nil { - var ret float32 - return ret - } - - return o.MaxMonthlyUsageUsd -} - -// GetMaxMonthlyUsageUsdOk returns a tuple with the MaxMonthlyUsageUsd field value -// and a boolean to check if the value has been set. -func (o *Limits) GetMaxMonthlyUsageUsdOk() (*float32, bool) { - if o == nil { - return nil, false - } - return &o.MaxMonthlyUsageUsd, true -} - -// SetMaxMonthlyUsageUsd sets field value -func (o *Limits) SetMaxMonthlyUsageUsd(v float32) { - o.MaxMonthlyUsageUsd = v -} - -// GetMaxMonthlyActorComputeUnits returns the MaxMonthlyActorComputeUnits field value -func (o *Limits) GetMaxMonthlyActorComputeUnits() float32 { - if o == nil { - var ret float32 - return ret - } - - return o.MaxMonthlyActorComputeUnits -} - -// GetMaxMonthlyActorComputeUnitsOk returns a tuple with the MaxMonthlyActorComputeUnits field value -// and a boolean to check if the value has been set. -func (o *Limits) GetMaxMonthlyActorComputeUnitsOk() (*float32, bool) { - if o == nil { - return nil, false - } - return &o.MaxMonthlyActorComputeUnits, true -} - -// SetMaxMonthlyActorComputeUnits sets field value -func (o *Limits) SetMaxMonthlyActorComputeUnits(v float32) { - o.MaxMonthlyActorComputeUnits = v -} - -// GetMaxMonthlyExternalDataTransferGbytes returns the MaxMonthlyExternalDataTransferGbytes field value -func (o *Limits) GetMaxMonthlyExternalDataTransferGbytes() float32 { - if o == nil { - var ret float32 - return ret - } - - return o.MaxMonthlyExternalDataTransferGbytes -} - -// GetMaxMonthlyExternalDataTransferGbytesOk returns a tuple with the MaxMonthlyExternalDataTransferGbytes field value -// and a boolean to check if the value has been set. -func (o *Limits) GetMaxMonthlyExternalDataTransferGbytesOk() (*float32, bool) { - if o == nil { - return nil, false - } - return &o.MaxMonthlyExternalDataTransferGbytes, true -} - -// SetMaxMonthlyExternalDataTransferGbytes sets field value -func (o *Limits) SetMaxMonthlyExternalDataTransferGbytes(v float32) { - o.MaxMonthlyExternalDataTransferGbytes = v -} - -// GetMaxMonthlyProxySerps returns the MaxMonthlyProxySerps field value -func (o *Limits) GetMaxMonthlyProxySerps() int32 { - if o == nil { - var ret int32 - return ret - } - - return o.MaxMonthlyProxySerps -} - -// GetMaxMonthlyProxySerpsOk returns a tuple with the MaxMonthlyProxySerps field value -// and a boolean to check if the value has been set. -func (o *Limits) GetMaxMonthlyProxySerpsOk() (*int32, bool) { - if o == nil { - return nil, false - } - return &o.MaxMonthlyProxySerps, true -} - -// SetMaxMonthlyProxySerps sets field value -func (o *Limits) SetMaxMonthlyProxySerps(v int32) { - o.MaxMonthlyProxySerps = v -} - -// GetMaxMonthlyResidentialProxyGbytes returns the MaxMonthlyResidentialProxyGbytes field value -func (o *Limits) GetMaxMonthlyResidentialProxyGbytes() float32 { - if o == nil { - var ret float32 - return ret - } - - return o.MaxMonthlyResidentialProxyGbytes -} - -// GetMaxMonthlyResidentialProxyGbytesOk returns a tuple with the MaxMonthlyResidentialProxyGbytes field value -// and a boolean to check if the value has been set. -func (o *Limits) GetMaxMonthlyResidentialProxyGbytesOk() (*float32, bool) { - if o == nil { - return nil, false - } - return &o.MaxMonthlyResidentialProxyGbytes, true -} - -// SetMaxMonthlyResidentialProxyGbytes sets field value -func (o *Limits) SetMaxMonthlyResidentialProxyGbytes(v float32) { - o.MaxMonthlyResidentialProxyGbytes = v -} - -// GetMaxActorMemoryGbytes returns the MaxActorMemoryGbytes field value -func (o *Limits) GetMaxActorMemoryGbytes() float32 { - if o == nil { - var ret float32 - return ret - } - - return o.MaxActorMemoryGbytes -} - -// GetMaxActorMemoryGbytesOk returns a tuple with the MaxActorMemoryGbytes field value -// and a boolean to check if the value has been set. -func (o *Limits) GetMaxActorMemoryGbytesOk() (*float32, bool) { - if o == nil { - return nil, false - } - return &o.MaxActorMemoryGbytes, true -} - -// SetMaxActorMemoryGbytes sets field value -func (o *Limits) SetMaxActorMemoryGbytes(v float32) { - o.MaxActorMemoryGbytes = v -} - -// GetMaxActorCount returns the MaxActorCount field value -func (o *Limits) GetMaxActorCount() int32 { - if o == nil { - var ret int32 - return ret - } - - return o.MaxActorCount -} - -// GetMaxActorCountOk returns a tuple with the MaxActorCount field value -// and a boolean to check if the value has been set. -func (o *Limits) GetMaxActorCountOk() (*int32, bool) { - if o == nil { - return nil, false - } - return &o.MaxActorCount, true -} - -// SetMaxActorCount sets field value -func (o *Limits) SetMaxActorCount(v int32) { - o.MaxActorCount = v -} - -// GetMaxActorTaskCount returns the MaxActorTaskCount field value -func (o *Limits) GetMaxActorTaskCount() int32 { - if o == nil { - var ret int32 - return ret - } - - return o.MaxActorTaskCount -} - -// GetMaxActorTaskCountOk returns a tuple with the MaxActorTaskCount field value -// and a boolean to check if the value has been set. -func (o *Limits) GetMaxActorTaskCountOk() (*int32, bool) { - if o == nil { - return nil, false - } - return &o.MaxActorTaskCount, true -} - -// SetMaxActorTaskCount sets field value -func (o *Limits) SetMaxActorTaskCount(v int32) { - o.MaxActorTaskCount = v -} - -// GetMaxConcurrentActorJobs returns the MaxConcurrentActorJobs field value -func (o *Limits) GetMaxConcurrentActorJobs() int32 { - if o == nil { - var ret int32 - return ret - } - - return o.MaxConcurrentActorJobs -} - -// GetMaxConcurrentActorJobsOk returns a tuple with the MaxConcurrentActorJobs field value -// and a boolean to check if the value has been set. -func (o *Limits) GetMaxConcurrentActorJobsOk() (*int32, bool) { - if o == nil { - return nil, false - } - return &o.MaxConcurrentActorJobs, true -} - -// SetMaxConcurrentActorJobs sets field value -func (o *Limits) SetMaxConcurrentActorJobs(v int32) { - o.MaxConcurrentActorJobs = v -} - -// GetMaxTeamAccountSeatCount returns the MaxTeamAccountSeatCount field value -func (o *Limits) GetMaxTeamAccountSeatCount() int32 { - if o == nil { - var ret int32 - return ret - } - - return o.MaxTeamAccountSeatCount -} - -// GetMaxTeamAccountSeatCountOk returns a tuple with the MaxTeamAccountSeatCount field value -// and a boolean to check if the value has been set. -func (o *Limits) GetMaxTeamAccountSeatCountOk() (*int32, bool) { - if o == nil { - return nil, false - } - return &o.MaxTeamAccountSeatCount, true -} - -// SetMaxTeamAccountSeatCount sets field value -func (o *Limits) SetMaxTeamAccountSeatCount(v int32) { - o.MaxTeamAccountSeatCount = v -} - -// GetDataRetentionDays returns the DataRetentionDays field value -func (o *Limits) GetDataRetentionDays() int32 { - if o == nil { - var ret int32 - return ret - } - - return o.DataRetentionDays -} - -// GetDataRetentionDaysOk returns a tuple with the DataRetentionDays field value -// and a boolean to check if the value has been set. -func (o *Limits) GetDataRetentionDaysOk() (*int32, bool) { - if o == nil { - return nil, false - } - return &o.DataRetentionDays, true -} - -// SetDataRetentionDays sets field value -func (o *Limits) SetDataRetentionDays(v int32) { - o.DataRetentionDays = v -} - -// GetMaxScheduleCount returns the MaxScheduleCount field value if set, zero value otherwise. -func (o *Limits) GetMaxScheduleCount() int32 { - if o == nil || IsNil(o.MaxScheduleCount) { - var ret int32 - return ret - } - return *o.MaxScheduleCount -} - -// GetMaxScheduleCountOk returns a tuple with the MaxScheduleCount field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Limits) GetMaxScheduleCountOk() (*int32, bool) { - if o == nil || IsNil(o.MaxScheduleCount) { - return nil, false - } - return o.MaxScheduleCount, true -} - -// HasMaxScheduleCount returns a boolean if a field has been set. -func (o *Limits) HasMaxScheduleCount() bool { - if o != nil && !IsNil(o.MaxScheduleCount) { - return true - } - - return false -} - -// SetMaxScheduleCount gets a reference to the given int32 and assigns it to the MaxScheduleCount field. -func (o *Limits) SetMaxScheduleCount(v int32) { - o.MaxScheduleCount = &v -} - -func (o Limits) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o Limits) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["maxMonthlyUsageUsd"] = o.MaxMonthlyUsageUsd - toSerialize["maxMonthlyActorComputeUnits"] = o.MaxMonthlyActorComputeUnits - toSerialize["maxMonthlyExternalDataTransferGbytes"] = o.MaxMonthlyExternalDataTransferGbytes - toSerialize["maxMonthlyProxySerps"] = o.MaxMonthlyProxySerps - toSerialize["maxMonthlyResidentialProxyGbytes"] = o.MaxMonthlyResidentialProxyGbytes - toSerialize["maxActorMemoryGbytes"] = o.MaxActorMemoryGbytes - toSerialize["maxActorCount"] = o.MaxActorCount - toSerialize["maxActorTaskCount"] = o.MaxActorTaskCount - toSerialize["maxConcurrentActorJobs"] = o.MaxConcurrentActorJobs - toSerialize["maxTeamAccountSeatCount"] = o.MaxTeamAccountSeatCount - toSerialize["dataRetentionDays"] = o.DataRetentionDays - if !IsNil(o.MaxScheduleCount) { - toSerialize["maxScheduleCount"] = o.MaxScheduleCount - } - return toSerialize, nil -} - -func (o *Limits) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "maxMonthlyUsageUsd", - "maxMonthlyActorComputeUnits", - "maxMonthlyExternalDataTransferGbytes", - "maxMonthlyProxySerps", - "maxMonthlyResidentialProxyGbytes", - "maxActorMemoryGbytes", - "maxActorCount", - "maxActorTaskCount", - "maxConcurrentActorJobs", - "maxTeamAccountSeatCount", - "dataRetentionDays", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err; - } - - for _, requiredProperty := range(requiredProperties) { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varLimits := _Limits{} - - decoder := json.NewDecoder(bytes.NewReader(data)) - decoder.DisallowUnknownFields() - err = decoder.Decode(&varLimits) - - if err != nil { - return err - } - - *o = Limits(varLimits) - - return err -} - -type NullableLimits struct { - value *Limits - isSet bool -} - -func (v NullableLimits) Get() *Limits { - return v.value -} - -func (v *NullableLimits) Set(val *Limits) { - v.value = val - v.isSet = true -} - -func (v NullableLimits) IsSet() bool { - return v.isSet -} - -func (v *NullableLimits) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableLimits(val *Limits) *NullableLimits { - return &NullableLimits{value: val, isSet: true} -} - -func (v NullableLimits) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableLimits) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_limits_response.go b/model_limits_response.go deleted file mode 100644 index b540193..0000000 --- a/model_limits_response.go +++ /dev/null @@ -1,158 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" - "bytes" - "fmt" -) - -// checks if the LimitsResponse type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &LimitsResponse{} - -// LimitsResponse struct for LimitsResponse -type LimitsResponse struct { - Data AccountLimits `json:"data"` -} - -type _LimitsResponse LimitsResponse - -// NewLimitsResponse instantiates a new LimitsResponse object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewLimitsResponse(data AccountLimits) *LimitsResponse { - this := LimitsResponse{} - this.Data = data - return &this -} - -// NewLimitsResponseWithDefaults instantiates a new LimitsResponse object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewLimitsResponseWithDefaults() *LimitsResponse { - this := LimitsResponse{} - return &this -} - -// GetData returns the Data field value -func (o *LimitsResponse) GetData() AccountLimits { - if o == nil { - var ret AccountLimits - return ret - } - - return o.Data -} - -// GetDataOk returns a tuple with the Data field value -// and a boolean to check if the value has been set. -func (o *LimitsResponse) GetDataOk() (*AccountLimits, bool) { - if o == nil { - return nil, false - } - return &o.Data, true -} - -// SetData sets field value -func (o *LimitsResponse) SetData(v AccountLimits) { - o.Data = v -} - -func (o LimitsResponse) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o LimitsResponse) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["data"] = o.Data - return toSerialize, nil -} - -func (o *LimitsResponse) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "data", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err; - } - - for _, requiredProperty := range(requiredProperties) { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varLimitsResponse := _LimitsResponse{} - - decoder := json.NewDecoder(bytes.NewReader(data)) - decoder.DisallowUnknownFields() - err = decoder.Decode(&varLimitsResponse) - - if err != nil { - return err - } - - *o = LimitsResponse(varLimitsResponse) - - return err -} - -type NullableLimitsResponse struct { - value *LimitsResponse - isSet bool -} - -func (v NullableLimitsResponse) Get() *LimitsResponse { - return v.value -} - -func (v *NullableLimitsResponse) Set(val *LimitsResponse) { - v.value = val - v.isSet = true -} - -func (v NullableLimitsResponse) IsSet() bool { - return v.isSet -} - -func (v *NullableLimitsResponse) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableLimitsResponse(val *LimitsResponse) *NullableLimitsResponse { - return &NullableLimitsResponse{value: val, isSet: true} -} - -func (v NullableLimitsResponse) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableLimitsResponse) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_list_of_actors.go b/model_list_of_actors.go deleted file mode 100644 index 53c4ed3..0000000 --- a/model_list_of_actors.go +++ /dev/null @@ -1,303 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" - "bytes" - "fmt" -) - -// checks if the ListOfActors type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &ListOfActors{} - -// ListOfActors struct for ListOfActors -type ListOfActors struct { - // The total number of items available across all pages. - Total int32 `json:"total"` - // The starting position for this page of results. - Offset int32 `json:"offset"` - // The maximum number of items returned per page. - Limit int32 `json:"limit"` - // Whether the results are sorted in descending order. - Desc bool `json:"desc"` - // The number of items returned in this response. - Count int32 `json:"count"` - Items []ActorShort `json:"items"` -} - -type _ListOfActors ListOfActors - -// NewListOfActors instantiates a new ListOfActors object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewListOfActors(total int32, offset int32, limit int32, desc bool, count int32, items []ActorShort) *ListOfActors { - this := ListOfActors{} - this.Total = total - this.Offset = offset - this.Limit = limit - this.Desc = desc - this.Count = count - this.Items = items - return &this -} - -// NewListOfActorsWithDefaults instantiates a new ListOfActors object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewListOfActorsWithDefaults() *ListOfActors { - this := ListOfActors{} - return &this -} - -// GetTotal returns the Total field value -func (o *ListOfActors) GetTotal() int32 { - if o == nil { - var ret int32 - return ret - } - - return o.Total -} - -// GetTotalOk returns a tuple with the Total field value -// and a boolean to check if the value has been set. -func (o *ListOfActors) GetTotalOk() (*int32, bool) { - if o == nil { - return nil, false - } - return &o.Total, true -} - -// SetTotal sets field value -func (o *ListOfActors) SetTotal(v int32) { - o.Total = v -} - -// GetOffset returns the Offset field value -func (o *ListOfActors) GetOffset() int32 { - if o == nil { - var ret int32 - return ret - } - - return o.Offset -} - -// GetOffsetOk returns a tuple with the Offset field value -// and a boolean to check if the value has been set. -func (o *ListOfActors) GetOffsetOk() (*int32, bool) { - if o == nil { - return nil, false - } - return &o.Offset, true -} - -// SetOffset sets field value -func (o *ListOfActors) SetOffset(v int32) { - o.Offset = v -} - -// GetLimit returns the Limit field value -func (o *ListOfActors) GetLimit() int32 { - if o == nil { - var ret int32 - return ret - } - - return o.Limit -} - -// GetLimitOk returns a tuple with the Limit field value -// and a boolean to check if the value has been set. -func (o *ListOfActors) GetLimitOk() (*int32, bool) { - if o == nil { - return nil, false - } - return &o.Limit, true -} - -// SetLimit sets field value -func (o *ListOfActors) SetLimit(v int32) { - o.Limit = v -} - -// GetDesc returns the Desc field value -func (o *ListOfActors) GetDesc() bool { - if o == nil { - var ret bool - return ret - } - - return o.Desc -} - -// GetDescOk returns a tuple with the Desc field value -// and a boolean to check if the value has been set. -func (o *ListOfActors) GetDescOk() (*bool, bool) { - if o == nil { - return nil, false - } - return &o.Desc, true -} - -// SetDesc sets field value -func (o *ListOfActors) SetDesc(v bool) { - o.Desc = v -} - -// GetCount returns the Count field value -func (o *ListOfActors) GetCount() int32 { - if o == nil { - var ret int32 - return ret - } - - return o.Count -} - -// GetCountOk returns a tuple with the Count field value -// and a boolean to check if the value has been set. -func (o *ListOfActors) GetCountOk() (*int32, bool) { - if o == nil { - return nil, false - } - return &o.Count, true -} - -// SetCount sets field value -func (o *ListOfActors) SetCount(v int32) { - o.Count = v -} - -// GetItems returns the Items field value -func (o *ListOfActors) GetItems() []ActorShort { - if o == nil { - var ret []ActorShort - return ret - } - - return o.Items -} - -// GetItemsOk returns a tuple with the Items field value -// and a boolean to check if the value has been set. -func (o *ListOfActors) GetItemsOk() ([]ActorShort, bool) { - if o == nil { - return nil, false - } - return o.Items, true -} - -// SetItems sets field value -func (o *ListOfActors) SetItems(v []ActorShort) { - o.Items = v -} - -func (o ListOfActors) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o ListOfActors) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["total"] = o.Total - toSerialize["offset"] = o.Offset - toSerialize["limit"] = o.Limit - toSerialize["desc"] = o.Desc - toSerialize["count"] = o.Count - toSerialize["items"] = o.Items - return toSerialize, nil -} - -func (o *ListOfActors) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "total", - "offset", - "limit", - "desc", - "count", - "items", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err; - } - - for _, requiredProperty := range(requiredProperties) { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varListOfActors := _ListOfActors{} - - decoder := json.NewDecoder(bytes.NewReader(data)) - decoder.DisallowUnknownFields() - err = decoder.Decode(&varListOfActors) - - if err != nil { - return err - } - - *o = ListOfActors(varListOfActors) - - return err -} - -type NullableListOfActors struct { - value *ListOfActors - isSet bool -} - -func (v NullableListOfActors) Get() *ListOfActors { - return v.value -} - -func (v *NullableListOfActors) Set(val *ListOfActors) { - v.value = val - v.isSet = true -} - -func (v NullableListOfActors) IsSet() bool { - return v.isSet -} - -func (v *NullableListOfActors) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableListOfActors(val *ListOfActors) *NullableListOfActors { - return &NullableListOfActors{value: val, isSet: true} -} - -func (v NullableListOfActors) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableListOfActors) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_list_of_actors_in_store_response.go b/model_list_of_actors_in_store_response.go deleted file mode 100644 index edea3ef..0000000 --- a/model_list_of_actors_in_store_response.go +++ /dev/null @@ -1,158 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" - "bytes" - "fmt" -) - -// checks if the ListOfActorsInStoreResponse type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &ListOfActorsInStoreResponse{} - -// ListOfActorsInStoreResponse struct for ListOfActorsInStoreResponse -type ListOfActorsInStoreResponse struct { - Data ListOfStoreActors `json:"data"` -} - -type _ListOfActorsInStoreResponse ListOfActorsInStoreResponse - -// NewListOfActorsInStoreResponse instantiates a new ListOfActorsInStoreResponse object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewListOfActorsInStoreResponse(data ListOfStoreActors) *ListOfActorsInStoreResponse { - this := ListOfActorsInStoreResponse{} - this.Data = data - return &this -} - -// NewListOfActorsInStoreResponseWithDefaults instantiates a new ListOfActorsInStoreResponse object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewListOfActorsInStoreResponseWithDefaults() *ListOfActorsInStoreResponse { - this := ListOfActorsInStoreResponse{} - return &this -} - -// GetData returns the Data field value -func (o *ListOfActorsInStoreResponse) GetData() ListOfStoreActors { - if o == nil { - var ret ListOfStoreActors - return ret - } - - return o.Data -} - -// GetDataOk returns a tuple with the Data field value -// and a boolean to check if the value has been set. -func (o *ListOfActorsInStoreResponse) GetDataOk() (*ListOfStoreActors, bool) { - if o == nil { - return nil, false - } - return &o.Data, true -} - -// SetData sets field value -func (o *ListOfActorsInStoreResponse) SetData(v ListOfStoreActors) { - o.Data = v -} - -func (o ListOfActorsInStoreResponse) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o ListOfActorsInStoreResponse) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["data"] = o.Data - return toSerialize, nil -} - -func (o *ListOfActorsInStoreResponse) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "data", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err; - } - - for _, requiredProperty := range(requiredProperties) { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varListOfActorsInStoreResponse := _ListOfActorsInStoreResponse{} - - decoder := json.NewDecoder(bytes.NewReader(data)) - decoder.DisallowUnknownFields() - err = decoder.Decode(&varListOfActorsInStoreResponse) - - if err != nil { - return err - } - - *o = ListOfActorsInStoreResponse(varListOfActorsInStoreResponse) - - return err -} - -type NullableListOfActorsInStoreResponse struct { - value *ListOfActorsInStoreResponse - isSet bool -} - -func (v NullableListOfActorsInStoreResponse) Get() *ListOfActorsInStoreResponse { - return v.value -} - -func (v *NullableListOfActorsInStoreResponse) Set(val *ListOfActorsInStoreResponse) { - v.value = val - v.isSet = true -} - -func (v NullableListOfActorsInStoreResponse) IsSet() bool { - return v.isSet -} - -func (v *NullableListOfActorsInStoreResponse) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableListOfActorsInStoreResponse(val *ListOfActorsInStoreResponse) *NullableListOfActorsInStoreResponse { - return &NullableListOfActorsInStoreResponse{value: val, isSet: true} -} - -func (v NullableListOfActorsInStoreResponse) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableListOfActorsInStoreResponse) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_list_of_actors_response.go b/model_list_of_actors_response.go deleted file mode 100644 index 386abad..0000000 --- a/model_list_of_actors_response.go +++ /dev/null @@ -1,158 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" - "bytes" - "fmt" -) - -// checks if the ListOfActorsResponse type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &ListOfActorsResponse{} - -// ListOfActorsResponse struct for ListOfActorsResponse -type ListOfActorsResponse struct { - Data ListOfActors `json:"data"` -} - -type _ListOfActorsResponse ListOfActorsResponse - -// NewListOfActorsResponse instantiates a new ListOfActorsResponse object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewListOfActorsResponse(data ListOfActors) *ListOfActorsResponse { - this := ListOfActorsResponse{} - this.Data = data - return &this -} - -// NewListOfActorsResponseWithDefaults instantiates a new ListOfActorsResponse object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewListOfActorsResponseWithDefaults() *ListOfActorsResponse { - this := ListOfActorsResponse{} - return &this -} - -// GetData returns the Data field value -func (o *ListOfActorsResponse) GetData() ListOfActors { - if o == nil { - var ret ListOfActors - return ret - } - - return o.Data -} - -// GetDataOk returns a tuple with the Data field value -// and a boolean to check if the value has been set. -func (o *ListOfActorsResponse) GetDataOk() (*ListOfActors, bool) { - if o == nil { - return nil, false - } - return &o.Data, true -} - -// SetData sets field value -func (o *ListOfActorsResponse) SetData(v ListOfActors) { - o.Data = v -} - -func (o ListOfActorsResponse) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o ListOfActorsResponse) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["data"] = o.Data - return toSerialize, nil -} - -func (o *ListOfActorsResponse) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "data", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err; - } - - for _, requiredProperty := range(requiredProperties) { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varListOfActorsResponse := _ListOfActorsResponse{} - - decoder := json.NewDecoder(bytes.NewReader(data)) - decoder.DisallowUnknownFields() - err = decoder.Decode(&varListOfActorsResponse) - - if err != nil { - return err - } - - *o = ListOfActorsResponse(varListOfActorsResponse) - - return err -} - -type NullableListOfActorsResponse struct { - value *ListOfActorsResponse - isSet bool -} - -func (v NullableListOfActorsResponse) Get() *ListOfActorsResponse { - return v.value -} - -func (v *NullableListOfActorsResponse) Set(val *ListOfActorsResponse) { - v.value = val - v.isSet = true -} - -func (v NullableListOfActorsResponse) IsSet() bool { - return v.isSet -} - -func (v *NullableListOfActorsResponse) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableListOfActorsResponse(val *ListOfActorsResponse) *NullableListOfActorsResponse { - return &NullableListOfActorsResponse{value: val, isSet: true} -} - -func (v NullableListOfActorsResponse) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableListOfActorsResponse) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_list_of_builds.go b/model_list_of_builds.go deleted file mode 100644 index be42db7..0000000 --- a/model_list_of_builds.go +++ /dev/null @@ -1,303 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" - "bytes" - "fmt" -) - -// checks if the ListOfBuilds type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &ListOfBuilds{} - -// ListOfBuilds struct for ListOfBuilds -type ListOfBuilds struct { - // The total number of items available across all pages. - Total int32 `json:"total"` - // The starting position for this page of results. - Offset int32 `json:"offset"` - // The maximum number of items returned per page. - Limit int32 `json:"limit"` - // Whether the results are sorted in descending order. - Desc bool `json:"desc"` - // The number of items returned in this response. - Count int32 `json:"count"` - Items []BuildShort `json:"items"` -} - -type _ListOfBuilds ListOfBuilds - -// NewListOfBuilds instantiates a new ListOfBuilds object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewListOfBuilds(total int32, offset int32, limit int32, desc bool, count int32, items []BuildShort) *ListOfBuilds { - this := ListOfBuilds{} - this.Total = total - this.Offset = offset - this.Limit = limit - this.Desc = desc - this.Count = count - this.Items = items - return &this -} - -// NewListOfBuildsWithDefaults instantiates a new ListOfBuilds object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewListOfBuildsWithDefaults() *ListOfBuilds { - this := ListOfBuilds{} - return &this -} - -// GetTotal returns the Total field value -func (o *ListOfBuilds) GetTotal() int32 { - if o == nil { - var ret int32 - return ret - } - - return o.Total -} - -// GetTotalOk returns a tuple with the Total field value -// and a boolean to check if the value has been set. -func (o *ListOfBuilds) GetTotalOk() (*int32, bool) { - if o == nil { - return nil, false - } - return &o.Total, true -} - -// SetTotal sets field value -func (o *ListOfBuilds) SetTotal(v int32) { - o.Total = v -} - -// GetOffset returns the Offset field value -func (o *ListOfBuilds) GetOffset() int32 { - if o == nil { - var ret int32 - return ret - } - - return o.Offset -} - -// GetOffsetOk returns a tuple with the Offset field value -// and a boolean to check if the value has been set. -func (o *ListOfBuilds) GetOffsetOk() (*int32, bool) { - if o == nil { - return nil, false - } - return &o.Offset, true -} - -// SetOffset sets field value -func (o *ListOfBuilds) SetOffset(v int32) { - o.Offset = v -} - -// GetLimit returns the Limit field value -func (o *ListOfBuilds) GetLimit() int32 { - if o == nil { - var ret int32 - return ret - } - - return o.Limit -} - -// GetLimitOk returns a tuple with the Limit field value -// and a boolean to check if the value has been set. -func (o *ListOfBuilds) GetLimitOk() (*int32, bool) { - if o == nil { - return nil, false - } - return &o.Limit, true -} - -// SetLimit sets field value -func (o *ListOfBuilds) SetLimit(v int32) { - o.Limit = v -} - -// GetDesc returns the Desc field value -func (o *ListOfBuilds) GetDesc() bool { - if o == nil { - var ret bool - return ret - } - - return o.Desc -} - -// GetDescOk returns a tuple with the Desc field value -// and a boolean to check if the value has been set. -func (o *ListOfBuilds) GetDescOk() (*bool, bool) { - if o == nil { - return nil, false - } - return &o.Desc, true -} - -// SetDesc sets field value -func (o *ListOfBuilds) SetDesc(v bool) { - o.Desc = v -} - -// GetCount returns the Count field value -func (o *ListOfBuilds) GetCount() int32 { - if o == nil { - var ret int32 - return ret - } - - return o.Count -} - -// GetCountOk returns a tuple with the Count field value -// and a boolean to check if the value has been set. -func (o *ListOfBuilds) GetCountOk() (*int32, bool) { - if o == nil { - return nil, false - } - return &o.Count, true -} - -// SetCount sets field value -func (o *ListOfBuilds) SetCount(v int32) { - o.Count = v -} - -// GetItems returns the Items field value -func (o *ListOfBuilds) GetItems() []BuildShort { - if o == nil { - var ret []BuildShort - return ret - } - - return o.Items -} - -// GetItemsOk returns a tuple with the Items field value -// and a boolean to check if the value has been set. -func (o *ListOfBuilds) GetItemsOk() ([]BuildShort, bool) { - if o == nil { - return nil, false - } - return o.Items, true -} - -// SetItems sets field value -func (o *ListOfBuilds) SetItems(v []BuildShort) { - o.Items = v -} - -func (o ListOfBuilds) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o ListOfBuilds) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["total"] = o.Total - toSerialize["offset"] = o.Offset - toSerialize["limit"] = o.Limit - toSerialize["desc"] = o.Desc - toSerialize["count"] = o.Count - toSerialize["items"] = o.Items - return toSerialize, nil -} - -func (o *ListOfBuilds) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "total", - "offset", - "limit", - "desc", - "count", - "items", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err; - } - - for _, requiredProperty := range(requiredProperties) { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varListOfBuilds := _ListOfBuilds{} - - decoder := json.NewDecoder(bytes.NewReader(data)) - decoder.DisallowUnknownFields() - err = decoder.Decode(&varListOfBuilds) - - if err != nil { - return err - } - - *o = ListOfBuilds(varListOfBuilds) - - return err -} - -type NullableListOfBuilds struct { - value *ListOfBuilds - isSet bool -} - -func (v NullableListOfBuilds) Get() *ListOfBuilds { - return v.value -} - -func (v *NullableListOfBuilds) Set(val *ListOfBuilds) { - v.value = val - v.isSet = true -} - -func (v NullableListOfBuilds) IsSet() bool { - return v.isSet -} - -func (v *NullableListOfBuilds) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableListOfBuilds(val *ListOfBuilds) *NullableListOfBuilds { - return &NullableListOfBuilds{value: val, isSet: true} -} - -func (v NullableListOfBuilds) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableListOfBuilds) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_list_of_builds_response.go b/model_list_of_builds_response.go deleted file mode 100644 index 84efb3b..0000000 --- a/model_list_of_builds_response.go +++ /dev/null @@ -1,158 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" - "bytes" - "fmt" -) - -// checks if the ListOfBuildsResponse type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &ListOfBuildsResponse{} - -// ListOfBuildsResponse struct for ListOfBuildsResponse -type ListOfBuildsResponse struct { - Data ListOfBuilds `json:"data"` -} - -type _ListOfBuildsResponse ListOfBuildsResponse - -// NewListOfBuildsResponse instantiates a new ListOfBuildsResponse object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewListOfBuildsResponse(data ListOfBuilds) *ListOfBuildsResponse { - this := ListOfBuildsResponse{} - this.Data = data - return &this -} - -// NewListOfBuildsResponseWithDefaults instantiates a new ListOfBuildsResponse object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewListOfBuildsResponseWithDefaults() *ListOfBuildsResponse { - this := ListOfBuildsResponse{} - return &this -} - -// GetData returns the Data field value -func (o *ListOfBuildsResponse) GetData() ListOfBuilds { - if o == nil { - var ret ListOfBuilds - return ret - } - - return o.Data -} - -// GetDataOk returns a tuple with the Data field value -// and a boolean to check if the value has been set. -func (o *ListOfBuildsResponse) GetDataOk() (*ListOfBuilds, bool) { - if o == nil { - return nil, false - } - return &o.Data, true -} - -// SetData sets field value -func (o *ListOfBuildsResponse) SetData(v ListOfBuilds) { - o.Data = v -} - -func (o ListOfBuildsResponse) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o ListOfBuildsResponse) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["data"] = o.Data - return toSerialize, nil -} - -func (o *ListOfBuildsResponse) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "data", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err; - } - - for _, requiredProperty := range(requiredProperties) { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varListOfBuildsResponse := _ListOfBuildsResponse{} - - decoder := json.NewDecoder(bytes.NewReader(data)) - decoder.DisallowUnknownFields() - err = decoder.Decode(&varListOfBuildsResponse) - - if err != nil { - return err - } - - *o = ListOfBuildsResponse(varListOfBuildsResponse) - - return err -} - -type NullableListOfBuildsResponse struct { - value *ListOfBuildsResponse - isSet bool -} - -func (v NullableListOfBuildsResponse) Get() *ListOfBuildsResponse { - return v.value -} - -func (v *NullableListOfBuildsResponse) Set(val *ListOfBuildsResponse) { - v.value = val - v.isSet = true -} - -func (v NullableListOfBuildsResponse) IsSet() bool { - return v.isSet -} - -func (v *NullableListOfBuildsResponse) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableListOfBuildsResponse(val *ListOfBuildsResponse) *NullableListOfBuildsResponse { - return &NullableListOfBuildsResponse{value: val, isSet: true} -} - -func (v NullableListOfBuildsResponse) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableListOfBuildsResponse) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_list_of_datasets.go b/model_list_of_datasets.go deleted file mode 100644 index 7f48197..0000000 --- a/model_list_of_datasets.go +++ /dev/null @@ -1,340 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" - "bytes" - "fmt" -) - -// checks if the ListOfDatasets type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &ListOfDatasets{} - -// ListOfDatasets struct for ListOfDatasets -type ListOfDatasets struct { - // The total number of items available across all pages. - Total int32 `json:"total"` - // The starting position for this page of results. - Offset int32 `json:"offset"` - // The maximum number of items returned per page. - Limit int32 `json:"limit"` - // Whether the results are sorted in descending order. - Desc bool `json:"desc"` - // The number of items returned in this response. - Count int32 `json:"count"` - // Whether the listing was filtered to only unnamed datasets. - Unnamed *bool `json:"unnamed,omitempty"` - Items []DatasetListItem `json:"items"` -} - -type _ListOfDatasets ListOfDatasets - -// NewListOfDatasets instantiates a new ListOfDatasets object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewListOfDatasets(total int32, offset int32, limit int32, desc bool, count int32, items []DatasetListItem) *ListOfDatasets { - this := ListOfDatasets{} - this.Total = total - this.Offset = offset - this.Limit = limit - this.Desc = desc - this.Count = count - this.Items = items - return &this -} - -// NewListOfDatasetsWithDefaults instantiates a new ListOfDatasets object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewListOfDatasetsWithDefaults() *ListOfDatasets { - this := ListOfDatasets{} - return &this -} - -// GetTotal returns the Total field value -func (o *ListOfDatasets) GetTotal() int32 { - if o == nil { - var ret int32 - return ret - } - - return o.Total -} - -// GetTotalOk returns a tuple with the Total field value -// and a boolean to check if the value has been set. -func (o *ListOfDatasets) GetTotalOk() (*int32, bool) { - if o == nil { - return nil, false - } - return &o.Total, true -} - -// SetTotal sets field value -func (o *ListOfDatasets) SetTotal(v int32) { - o.Total = v -} - -// GetOffset returns the Offset field value -func (o *ListOfDatasets) GetOffset() int32 { - if o == nil { - var ret int32 - return ret - } - - return o.Offset -} - -// GetOffsetOk returns a tuple with the Offset field value -// and a boolean to check if the value has been set. -func (o *ListOfDatasets) GetOffsetOk() (*int32, bool) { - if o == nil { - return nil, false - } - return &o.Offset, true -} - -// SetOffset sets field value -func (o *ListOfDatasets) SetOffset(v int32) { - o.Offset = v -} - -// GetLimit returns the Limit field value -func (o *ListOfDatasets) GetLimit() int32 { - if o == nil { - var ret int32 - return ret - } - - return o.Limit -} - -// GetLimitOk returns a tuple with the Limit field value -// and a boolean to check if the value has been set. -func (o *ListOfDatasets) GetLimitOk() (*int32, bool) { - if o == nil { - return nil, false - } - return &o.Limit, true -} - -// SetLimit sets field value -func (o *ListOfDatasets) SetLimit(v int32) { - o.Limit = v -} - -// GetDesc returns the Desc field value -func (o *ListOfDatasets) GetDesc() bool { - if o == nil { - var ret bool - return ret - } - - return o.Desc -} - -// GetDescOk returns a tuple with the Desc field value -// and a boolean to check if the value has been set. -func (o *ListOfDatasets) GetDescOk() (*bool, bool) { - if o == nil { - return nil, false - } - return &o.Desc, true -} - -// SetDesc sets field value -func (o *ListOfDatasets) SetDesc(v bool) { - o.Desc = v -} - -// GetCount returns the Count field value -func (o *ListOfDatasets) GetCount() int32 { - if o == nil { - var ret int32 - return ret - } - - return o.Count -} - -// GetCountOk returns a tuple with the Count field value -// and a boolean to check if the value has been set. -func (o *ListOfDatasets) GetCountOk() (*int32, bool) { - if o == nil { - return nil, false - } - return &o.Count, true -} - -// SetCount sets field value -func (o *ListOfDatasets) SetCount(v int32) { - o.Count = v -} - -// GetUnnamed returns the Unnamed field value if set, zero value otherwise. -func (o *ListOfDatasets) GetUnnamed() bool { - if o == nil || IsNil(o.Unnamed) { - var ret bool - return ret - } - return *o.Unnamed -} - -// GetUnnamedOk returns a tuple with the Unnamed field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ListOfDatasets) GetUnnamedOk() (*bool, bool) { - if o == nil || IsNil(o.Unnamed) { - return nil, false - } - return o.Unnamed, true -} - -// HasUnnamed returns a boolean if a field has been set. -func (o *ListOfDatasets) HasUnnamed() bool { - if o != nil && !IsNil(o.Unnamed) { - return true - } - - return false -} - -// SetUnnamed gets a reference to the given bool and assigns it to the Unnamed field. -func (o *ListOfDatasets) SetUnnamed(v bool) { - o.Unnamed = &v -} - -// GetItems returns the Items field value -func (o *ListOfDatasets) GetItems() []DatasetListItem { - if o == nil { - var ret []DatasetListItem - return ret - } - - return o.Items -} - -// GetItemsOk returns a tuple with the Items field value -// and a boolean to check if the value has been set. -func (o *ListOfDatasets) GetItemsOk() ([]DatasetListItem, bool) { - if o == nil { - return nil, false - } - return o.Items, true -} - -// SetItems sets field value -func (o *ListOfDatasets) SetItems(v []DatasetListItem) { - o.Items = v -} - -func (o ListOfDatasets) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o ListOfDatasets) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["total"] = o.Total - toSerialize["offset"] = o.Offset - toSerialize["limit"] = o.Limit - toSerialize["desc"] = o.Desc - toSerialize["count"] = o.Count - if !IsNil(o.Unnamed) { - toSerialize["unnamed"] = o.Unnamed - } - toSerialize["items"] = o.Items - return toSerialize, nil -} - -func (o *ListOfDatasets) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "total", - "offset", - "limit", - "desc", - "count", - "items", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err; - } - - for _, requiredProperty := range(requiredProperties) { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varListOfDatasets := _ListOfDatasets{} - - decoder := json.NewDecoder(bytes.NewReader(data)) - decoder.DisallowUnknownFields() - err = decoder.Decode(&varListOfDatasets) - - if err != nil { - return err - } - - *o = ListOfDatasets(varListOfDatasets) - - return err -} - -type NullableListOfDatasets struct { - value *ListOfDatasets - isSet bool -} - -func (v NullableListOfDatasets) Get() *ListOfDatasets { - return v.value -} - -func (v *NullableListOfDatasets) Set(val *ListOfDatasets) { - v.value = val - v.isSet = true -} - -func (v NullableListOfDatasets) IsSet() bool { - return v.isSet -} - -func (v *NullableListOfDatasets) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableListOfDatasets(val *ListOfDatasets) *NullableListOfDatasets { - return &NullableListOfDatasets{value: val, isSet: true} -} - -func (v NullableListOfDatasets) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableListOfDatasets) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_list_of_datasets_response.go b/model_list_of_datasets_response.go deleted file mode 100644 index 331e0d0..0000000 --- a/model_list_of_datasets_response.go +++ /dev/null @@ -1,158 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" - "bytes" - "fmt" -) - -// checks if the ListOfDatasetsResponse type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &ListOfDatasetsResponse{} - -// ListOfDatasetsResponse struct for ListOfDatasetsResponse -type ListOfDatasetsResponse struct { - Data ListOfDatasets `json:"data"` -} - -type _ListOfDatasetsResponse ListOfDatasetsResponse - -// NewListOfDatasetsResponse instantiates a new ListOfDatasetsResponse object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewListOfDatasetsResponse(data ListOfDatasets) *ListOfDatasetsResponse { - this := ListOfDatasetsResponse{} - this.Data = data - return &this -} - -// NewListOfDatasetsResponseWithDefaults instantiates a new ListOfDatasetsResponse object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewListOfDatasetsResponseWithDefaults() *ListOfDatasetsResponse { - this := ListOfDatasetsResponse{} - return &this -} - -// GetData returns the Data field value -func (o *ListOfDatasetsResponse) GetData() ListOfDatasets { - if o == nil { - var ret ListOfDatasets - return ret - } - - return o.Data -} - -// GetDataOk returns a tuple with the Data field value -// and a boolean to check if the value has been set. -func (o *ListOfDatasetsResponse) GetDataOk() (*ListOfDatasets, bool) { - if o == nil { - return nil, false - } - return &o.Data, true -} - -// SetData sets field value -func (o *ListOfDatasetsResponse) SetData(v ListOfDatasets) { - o.Data = v -} - -func (o ListOfDatasetsResponse) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o ListOfDatasetsResponse) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["data"] = o.Data - return toSerialize, nil -} - -func (o *ListOfDatasetsResponse) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "data", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err; - } - - for _, requiredProperty := range(requiredProperties) { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varListOfDatasetsResponse := _ListOfDatasetsResponse{} - - decoder := json.NewDecoder(bytes.NewReader(data)) - decoder.DisallowUnknownFields() - err = decoder.Decode(&varListOfDatasetsResponse) - - if err != nil { - return err - } - - *o = ListOfDatasetsResponse(varListOfDatasetsResponse) - - return err -} - -type NullableListOfDatasetsResponse struct { - value *ListOfDatasetsResponse - isSet bool -} - -func (v NullableListOfDatasetsResponse) Get() *ListOfDatasetsResponse { - return v.value -} - -func (v *NullableListOfDatasetsResponse) Set(val *ListOfDatasetsResponse) { - v.value = val - v.isSet = true -} - -func (v NullableListOfDatasetsResponse) IsSet() bool { - return v.isSet -} - -func (v *NullableListOfDatasetsResponse) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableListOfDatasetsResponse(val *ListOfDatasetsResponse) *NullableListOfDatasetsResponse { - return &NullableListOfDatasetsResponse{value: val, isSet: true} -} - -func (v NullableListOfDatasetsResponse) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableListOfDatasetsResponse) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_list_of_env_vars.go b/model_list_of_env_vars.go deleted file mode 100644 index e016f39..0000000 --- a/model_list_of_env_vars.go +++ /dev/null @@ -1,187 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" - "bytes" - "fmt" -) - -// checks if the ListOfEnvVars type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &ListOfEnvVars{} - -// ListOfEnvVars struct for ListOfEnvVars -type ListOfEnvVars struct { - Total int32 `json:"total"` - // - Items []EnvVar `json:"items"` -} - -type _ListOfEnvVars ListOfEnvVars - -// NewListOfEnvVars instantiates a new ListOfEnvVars object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewListOfEnvVars(total int32, items []EnvVar) *ListOfEnvVars { - this := ListOfEnvVars{} - this.Total = total - this.Items = items - return &this -} - -// NewListOfEnvVarsWithDefaults instantiates a new ListOfEnvVars object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewListOfEnvVarsWithDefaults() *ListOfEnvVars { - this := ListOfEnvVars{} - return &this -} - -// GetTotal returns the Total field value -func (o *ListOfEnvVars) GetTotal() int32 { - if o == nil { - var ret int32 - return ret - } - - return o.Total -} - -// GetTotalOk returns a tuple with the Total field value -// and a boolean to check if the value has been set. -func (o *ListOfEnvVars) GetTotalOk() (*int32, bool) { - if o == nil { - return nil, false - } - return &o.Total, true -} - -// SetTotal sets field value -func (o *ListOfEnvVars) SetTotal(v int32) { - o.Total = v -} - -// GetItems returns the Items field value -func (o *ListOfEnvVars) GetItems() []EnvVar { - if o == nil { - var ret []EnvVar - return ret - } - - return o.Items -} - -// GetItemsOk returns a tuple with the Items field value -// and a boolean to check if the value has been set. -func (o *ListOfEnvVars) GetItemsOk() ([]EnvVar, bool) { - if o == nil { - return nil, false - } - return o.Items, true -} - -// SetItems sets field value -func (o *ListOfEnvVars) SetItems(v []EnvVar) { - o.Items = v -} - -func (o ListOfEnvVars) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o ListOfEnvVars) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["total"] = o.Total - toSerialize["items"] = o.Items - return toSerialize, nil -} - -func (o *ListOfEnvVars) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "total", - "items", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err; - } - - for _, requiredProperty := range(requiredProperties) { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varListOfEnvVars := _ListOfEnvVars{} - - decoder := json.NewDecoder(bytes.NewReader(data)) - decoder.DisallowUnknownFields() - err = decoder.Decode(&varListOfEnvVars) - - if err != nil { - return err - } - - *o = ListOfEnvVars(varListOfEnvVars) - - return err -} - -type NullableListOfEnvVars struct { - value *ListOfEnvVars - isSet bool -} - -func (v NullableListOfEnvVars) Get() *ListOfEnvVars { - return v.value -} - -func (v *NullableListOfEnvVars) Set(val *ListOfEnvVars) { - v.value = val - v.isSet = true -} - -func (v NullableListOfEnvVars) IsSet() bool { - return v.isSet -} - -func (v *NullableListOfEnvVars) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableListOfEnvVars(val *ListOfEnvVars) *NullableListOfEnvVars { - return &NullableListOfEnvVars{value: val, isSet: true} -} - -func (v NullableListOfEnvVars) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableListOfEnvVars) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_list_of_env_vars_response.go b/model_list_of_env_vars_response.go deleted file mode 100644 index 41e833d..0000000 --- a/model_list_of_env_vars_response.go +++ /dev/null @@ -1,158 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" - "bytes" - "fmt" -) - -// checks if the ListOfEnvVarsResponse type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &ListOfEnvVarsResponse{} - -// ListOfEnvVarsResponse struct for ListOfEnvVarsResponse -type ListOfEnvVarsResponse struct { - Data ListOfEnvVars `json:"data"` -} - -type _ListOfEnvVarsResponse ListOfEnvVarsResponse - -// NewListOfEnvVarsResponse instantiates a new ListOfEnvVarsResponse object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewListOfEnvVarsResponse(data ListOfEnvVars) *ListOfEnvVarsResponse { - this := ListOfEnvVarsResponse{} - this.Data = data - return &this -} - -// NewListOfEnvVarsResponseWithDefaults instantiates a new ListOfEnvVarsResponse object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewListOfEnvVarsResponseWithDefaults() *ListOfEnvVarsResponse { - this := ListOfEnvVarsResponse{} - return &this -} - -// GetData returns the Data field value -func (o *ListOfEnvVarsResponse) GetData() ListOfEnvVars { - if o == nil { - var ret ListOfEnvVars - return ret - } - - return o.Data -} - -// GetDataOk returns a tuple with the Data field value -// and a boolean to check if the value has been set. -func (o *ListOfEnvVarsResponse) GetDataOk() (*ListOfEnvVars, bool) { - if o == nil { - return nil, false - } - return &o.Data, true -} - -// SetData sets field value -func (o *ListOfEnvVarsResponse) SetData(v ListOfEnvVars) { - o.Data = v -} - -func (o ListOfEnvVarsResponse) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o ListOfEnvVarsResponse) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["data"] = o.Data - return toSerialize, nil -} - -func (o *ListOfEnvVarsResponse) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "data", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err; - } - - for _, requiredProperty := range(requiredProperties) { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varListOfEnvVarsResponse := _ListOfEnvVarsResponse{} - - decoder := json.NewDecoder(bytes.NewReader(data)) - decoder.DisallowUnknownFields() - err = decoder.Decode(&varListOfEnvVarsResponse) - - if err != nil { - return err - } - - *o = ListOfEnvVarsResponse(varListOfEnvVarsResponse) - - return err -} - -type NullableListOfEnvVarsResponse struct { - value *ListOfEnvVarsResponse - isSet bool -} - -func (v NullableListOfEnvVarsResponse) Get() *ListOfEnvVarsResponse { - return v.value -} - -func (v *NullableListOfEnvVarsResponse) Set(val *ListOfEnvVarsResponse) { - v.value = val - v.isSet = true -} - -func (v NullableListOfEnvVarsResponse) IsSet() bool { - return v.isSet -} - -func (v *NullableListOfEnvVarsResponse) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableListOfEnvVarsResponse(val *ListOfEnvVarsResponse) *NullableListOfEnvVarsResponse { - return &NullableListOfEnvVarsResponse{value: val, isSet: true} -} - -func (v NullableListOfEnvVarsResponse) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableListOfEnvVarsResponse) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_list_of_key_value_stores.go b/model_list_of_key_value_stores.go deleted file mode 100644 index dadf0d0..0000000 --- a/model_list_of_key_value_stores.go +++ /dev/null @@ -1,340 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" - "bytes" - "fmt" -) - -// checks if the ListOfKeyValueStores type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &ListOfKeyValueStores{} - -// ListOfKeyValueStores struct for ListOfKeyValueStores -type ListOfKeyValueStores struct { - // The total number of items available across all pages. - Total int32 `json:"total"` - // The starting position for this page of results. - Offset int32 `json:"offset"` - // The maximum number of items returned per page. - Limit int32 `json:"limit"` - // Whether the results are sorted in descending order. - Desc bool `json:"desc"` - // The number of items returned in this response. - Count int32 `json:"count"` - // Whether the listing was filtered to only unnamed key-value stores. - Unnamed *bool `json:"unnamed,omitempty"` - Items []KeyValueStore `json:"items"` -} - -type _ListOfKeyValueStores ListOfKeyValueStores - -// NewListOfKeyValueStores instantiates a new ListOfKeyValueStores object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewListOfKeyValueStores(total int32, offset int32, limit int32, desc bool, count int32, items []KeyValueStore) *ListOfKeyValueStores { - this := ListOfKeyValueStores{} - this.Total = total - this.Offset = offset - this.Limit = limit - this.Desc = desc - this.Count = count - this.Items = items - return &this -} - -// NewListOfKeyValueStoresWithDefaults instantiates a new ListOfKeyValueStores object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewListOfKeyValueStoresWithDefaults() *ListOfKeyValueStores { - this := ListOfKeyValueStores{} - return &this -} - -// GetTotal returns the Total field value -func (o *ListOfKeyValueStores) GetTotal() int32 { - if o == nil { - var ret int32 - return ret - } - - return o.Total -} - -// GetTotalOk returns a tuple with the Total field value -// and a boolean to check if the value has been set. -func (o *ListOfKeyValueStores) GetTotalOk() (*int32, bool) { - if o == nil { - return nil, false - } - return &o.Total, true -} - -// SetTotal sets field value -func (o *ListOfKeyValueStores) SetTotal(v int32) { - o.Total = v -} - -// GetOffset returns the Offset field value -func (o *ListOfKeyValueStores) GetOffset() int32 { - if o == nil { - var ret int32 - return ret - } - - return o.Offset -} - -// GetOffsetOk returns a tuple with the Offset field value -// and a boolean to check if the value has been set. -func (o *ListOfKeyValueStores) GetOffsetOk() (*int32, bool) { - if o == nil { - return nil, false - } - return &o.Offset, true -} - -// SetOffset sets field value -func (o *ListOfKeyValueStores) SetOffset(v int32) { - o.Offset = v -} - -// GetLimit returns the Limit field value -func (o *ListOfKeyValueStores) GetLimit() int32 { - if o == nil { - var ret int32 - return ret - } - - return o.Limit -} - -// GetLimitOk returns a tuple with the Limit field value -// and a boolean to check if the value has been set. -func (o *ListOfKeyValueStores) GetLimitOk() (*int32, bool) { - if o == nil { - return nil, false - } - return &o.Limit, true -} - -// SetLimit sets field value -func (o *ListOfKeyValueStores) SetLimit(v int32) { - o.Limit = v -} - -// GetDesc returns the Desc field value -func (o *ListOfKeyValueStores) GetDesc() bool { - if o == nil { - var ret bool - return ret - } - - return o.Desc -} - -// GetDescOk returns a tuple with the Desc field value -// and a boolean to check if the value has been set. -func (o *ListOfKeyValueStores) GetDescOk() (*bool, bool) { - if o == nil { - return nil, false - } - return &o.Desc, true -} - -// SetDesc sets field value -func (o *ListOfKeyValueStores) SetDesc(v bool) { - o.Desc = v -} - -// GetCount returns the Count field value -func (o *ListOfKeyValueStores) GetCount() int32 { - if o == nil { - var ret int32 - return ret - } - - return o.Count -} - -// GetCountOk returns a tuple with the Count field value -// and a boolean to check if the value has been set. -func (o *ListOfKeyValueStores) GetCountOk() (*int32, bool) { - if o == nil { - return nil, false - } - return &o.Count, true -} - -// SetCount sets field value -func (o *ListOfKeyValueStores) SetCount(v int32) { - o.Count = v -} - -// GetUnnamed returns the Unnamed field value if set, zero value otherwise. -func (o *ListOfKeyValueStores) GetUnnamed() bool { - if o == nil || IsNil(o.Unnamed) { - var ret bool - return ret - } - return *o.Unnamed -} - -// GetUnnamedOk returns a tuple with the Unnamed field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ListOfKeyValueStores) GetUnnamedOk() (*bool, bool) { - if o == nil || IsNil(o.Unnamed) { - return nil, false - } - return o.Unnamed, true -} - -// HasUnnamed returns a boolean if a field has been set. -func (o *ListOfKeyValueStores) HasUnnamed() bool { - if o != nil && !IsNil(o.Unnamed) { - return true - } - - return false -} - -// SetUnnamed gets a reference to the given bool and assigns it to the Unnamed field. -func (o *ListOfKeyValueStores) SetUnnamed(v bool) { - o.Unnamed = &v -} - -// GetItems returns the Items field value -func (o *ListOfKeyValueStores) GetItems() []KeyValueStore { - if o == nil { - var ret []KeyValueStore - return ret - } - - return o.Items -} - -// GetItemsOk returns a tuple with the Items field value -// and a boolean to check if the value has been set. -func (o *ListOfKeyValueStores) GetItemsOk() ([]KeyValueStore, bool) { - if o == nil { - return nil, false - } - return o.Items, true -} - -// SetItems sets field value -func (o *ListOfKeyValueStores) SetItems(v []KeyValueStore) { - o.Items = v -} - -func (o ListOfKeyValueStores) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o ListOfKeyValueStores) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["total"] = o.Total - toSerialize["offset"] = o.Offset - toSerialize["limit"] = o.Limit - toSerialize["desc"] = o.Desc - toSerialize["count"] = o.Count - if !IsNil(o.Unnamed) { - toSerialize["unnamed"] = o.Unnamed - } - toSerialize["items"] = o.Items - return toSerialize, nil -} - -func (o *ListOfKeyValueStores) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "total", - "offset", - "limit", - "desc", - "count", - "items", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err; - } - - for _, requiredProperty := range(requiredProperties) { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varListOfKeyValueStores := _ListOfKeyValueStores{} - - decoder := json.NewDecoder(bytes.NewReader(data)) - decoder.DisallowUnknownFields() - err = decoder.Decode(&varListOfKeyValueStores) - - if err != nil { - return err - } - - *o = ListOfKeyValueStores(varListOfKeyValueStores) - - return err -} - -type NullableListOfKeyValueStores struct { - value *ListOfKeyValueStores - isSet bool -} - -func (v NullableListOfKeyValueStores) Get() *ListOfKeyValueStores { - return v.value -} - -func (v *NullableListOfKeyValueStores) Set(val *ListOfKeyValueStores) { - v.value = val - v.isSet = true -} - -func (v NullableListOfKeyValueStores) IsSet() bool { - return v.isSet -} - -func (v *NullableListOfKeyValueStores) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableListOfKeyValueStores(val *ListOfKeyValueStores) *NullableListOfKeyValueStores { - return &NullableListOfKeyValueStores{value: val, isSet: true} -} - -func (v NullableListOfKeyValueStores) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableListOfKeyValueStores) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_list_of_key_value_stores_response.go b/model_list_of_key_value_stores_response.go deleted file mode 100644 index 361a06f..0000000 --- a/model_list_of_key_value_stores_response.go +++ /dev/null @@ -1,158 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" - "bytes" - "fmt" -) - -// checks if the ListOfKeyValueStoresResponse type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &ListOfKeyValueStoresResponse{} - -// ListOfKeyValueStoresResponse struct for ListOfKeyValueStoresResponse -type ListOfKeyValueStoresResponse struct { - Data ListOfKeyValueStores `json:"data"` -} - -type _ListOfKeyValueStoresResponse ListOfKeyValueStoresResponse - -// NewListOfKeyValueStoresResponse instantiates a new ListOfKeyValueStoresResponse object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewListOfKeyValueStoresResponse(data ListOfKeyValueStores) *ListOfKeyValueStoresResponse { - this := ListOfKeyValueStoresResponse{} - this.Data = data - return &this -} - -// NewListOfKeyValueStoresResponseWithDefaults instantiates a new ListOfKeyValueStoresResponse object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewListOfKeyValueStoresResponseWithDefaults() *ListOfKeyValueStoresResponse { - this := ListOfKeyValueStoresResponse{} - return &this -} - -// GetData returns the Data field value -func (o *ListOfKeyValueStoresResponse) GetData() ListOfKeyValueStores { - if o == nil { - var ret ListOfKeyValueStores - return ret - } - - return o.Data -} - -// GetDataOk returns a tuple with the Data field value -// and a boolean to check if the value has been set. -func (o *ListOfKeyValueStoresResponse) GetDataOk() (*ListOfKeyValueStores, bool) { - if o == nil { - return nil, false - } - return &o.Data, true -} - -// SetData sets field value -func (o *ListOfKeyValueStoresResponse) SetData(v ListOfKeyValueStores) { - o.Data = v -} - -func (o ListOfKeyValueStoresResponse) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o ListOfKeyValueStoresResponse) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["data"] = o.Data - return toSerialize, nil -} - -func (o *ListOfKeyValueStoresResponse) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "data", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err; - } - - for _, requiredProperty := range(requiredProperties) { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varListOfKeyValueStoresResponse := _ListOfKeyValueStoresResponse{} - - decoder := json.NewDecoder(bytes.NewReader(data)) - decoder.DisallowUnknownFields() - err = decoder.Decode(&varListOfKeyValueStoresResponse) - - if err != nil { - return err - } - - *o = ListOfKeyValueStoresResponse(varListOfKeyValueStoresResponse) - - return err -} - -type NullableListOfKeyValueStoresResponse struct { - value *ListOfKeyValueStoresResponse - isSet bool -} - -func (v NullableListOfKeyValueStoresResponse) Get() *ListOfKeyValueStoresResponse { - return v.value -} - -func (v *NullableListOfKeyValueStoresResponse) Set(val *ListOfKeyValueStoresResponse) { - v.value = val - v.isSet = true -} - -func (v NullableListOfKeyValueStoresResponse) IsSet() bool { - return v.isSet -} - -func (v *NullableListOfKeyValueStoresResponse) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableListOfKeyValueStoresResponse(val *ListOfKeyValueStoresResponse) *NullableListOfKeyValueStoresResponse { - return &NullableListOfKeyValueStoresResponse{value: val, isSet: true} -} - -func (v NullableListOfKeyValueStoresResponse) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableListOfKeyValueStoresResponse) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_list_of_keys.go b/model_list_of_keys.go deleted file mode 100644 index a87c1b7..0000000 --- a/model_list_of_keys.go +++ /dev/null @@ -1,335 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" - "bytes" - "fmt" -) - -// checks if the ListOfKeys type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &ListOfKeys{} - -// ListOfKeys struct for ListOfKeys -type ListOfKeys struct { - // - Items []KeyValueStoreKey `json:"items"` - Count int32 `json:"count"` - Limit int32 `json:"limit"` - ExclusiveStartKey NullableString `json:"exclusiveStartKey,omitempty"` - IsTruncated bool `json:"isTruncated"` - NextExclusiveStartKey NullableString `json:"nextExclusiveStartKey,omitempty"` -} - -type _ListOfKeys ListOfKeys - -// NewListOfKeys instantiates a new ListOfKeys object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewListOfKeys(items []KeyValueStoreKey, count int32, limit int32, isTruncated bool) *ListOfKeys { - this := ListOfKeys{} - this.Items = items - this.Count = count - this.Limit = limit - this.IsTruncated = isTruncated - return &this -} - -// NewListOfKeysWithDefaults instantiates a new ListOfKeys object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewListOfKeysWithDefaults() *ListOfKeys { - this := ListOfKeys{} - return &this -} - -// GetItems returns the Items field value -func (o *ListOfKeys) GetItems() []KeyValueStoreKey { - if o == nil { - var ret []KeyValueStoreKey - return ret - } - - return o.Items -} - -// GetItemsOk returns a tuple with the Items field value -// and a boolean to check if the value has been set. -func (o *ListOfKeys) GetItemsOk() ([]KeyValueStoreKey, bool) { - if o == nil { - return nil, false - } - return o.Items, true -} - -// SetItems sets field value -func (o *ListOfKeys) SetItems(v []KeyValueStoreKey) { - o.Items = v -} - -// GetCount returns the Count field value -func (o *ListOfKeys) GetCount() int32 { - if o == nil { - var ret int32 - return ret - } - - return o.Count -} - -// GetCountOk returns a tuple with the Count field value -// and a boolean to check if the value has been set. -func (o *ListOfKeys) GetCountOk() (*int32, bool) { - if o == nil { - return nil, false - } - return &o.Count, true -} - -// SetCount sets field value -func (o *ListOfKeys) SetCount(v int32) { - o.Count = v -} - -// GetLimit returns the Limit field value -func (o *ListOfKeys) GetLimit() int32 { - if o == nil { - var ret int32 - return ret - } - - return o.Limit -} - -// GetLimitOk returns a tuple with the Limit field value -// and a boolean to check if the value has been set. -func (o *ListOfKeys) GetLimitOk() (*int32, bool) { - if o == nil { - return nil, false - } - return &o.Limit, true -} - -// SetLimit sets field value -func (o *ListOfKeys) SetLimit(v int32) { - o.Limit = v -} - -// GetExclusiveStartKey returns the ExclusiveStartKey field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *ListOfKeys) GetExclusiveStartKey() string { - if o == nil || IsNil(o.ExclusiveStartKey.Get()) { - var ret string - return ret - } - return *o.ExclusiveStartKey.Get() -} - -// GetExclusiveStartKeyOk returns a tuple with the ExclusiveStartKey field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *ListOfKeys) GetExclusiveStartKeyOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.ExclusiveStartKey.Get(), o.ExclusiveStartKey.IsSet() -} - -// HasExclusiveStartKey returns a boolean if a field has been set. -func (o *ListOfKeys) HasExclusiveStartKey() bool { - if o != nil && o.ExclusiveStartKey.IsSet() { - return true - } - - return false -} - -// SetExclusiveStartKey gets a reference to the given NullableString and assigns it to the ExclusiveStartKey field. -func (o *ListOfKeys) SetExclusiveStartKey(v string) { - o.ExclusiveStartKey.Set(&v) -} -// SetExclusiveStartKeyNil sets the value for ExclusiveStartKey to be an explicit nil -func (o *ListOfKeys) SetExclusiveStartKeyNil() { - o.ExclusiveStartKey.Set(nil) -} - -// UnsetExclusiveStartKey ensures that no value is present for ExclusiveStartKey, not even an explicit nil -func (o *ListOfKeys) UnsetExclusiveStartKey() { - o.ExclusiveStartKey.Unset() -} - -// GetIsTruncated returns the IsTruncated field value -func (o *ListOfKeys) GetIsTruncated() bool { - if o == nil { - var ret bool - return ret - } - - return o.IsTruncated -} - -// GetIsTruncatedOk returns a tuple with the IsTruncated field value -// and a boolean to check if the value has been set. -func (o *ListOfKeys) GetIsTruncatedOk() (*bool, bool) { - if o == nil { - return nil, false - } - return &o.IsTruncated, true -} - -// SetIsTruncated sets field value -func (o *ListOfKeys) SetIsTruncated(v bool) { - o.IsTruncated = v -} - -// GetNextExclusiveStartKey returns the NextExclusiveStartKey field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *ListOfKeys) GetNextExclusiveStartKey() string { - if o == nil || IsNil(o.NextExclusiveStartKey.Get()) { - var ret string - return ret - } - return *o.NextExclusiveStartKey.Get() -} - -// GetNextExclusiveStartKeyOk returns a tuple with the NextExclusiveStartKey field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *ListOfKeys) GetNextExclusiveStartKeyOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.NextExclusiveStartKey.Get(), o.NextExclusiveStartKey.IsSet() -} - -// HasNextExclusiveStartKey returns a boolean if a field has been set. -func (o *ListOfKeys) HasNextExclusiveStartKey() bool { - if o != nil && o.NextExclusiveStartKey.IsSet() { - return true - } - - return false -} - -// SetNextExclusiveStartKey gets a reference to the given NullableString and assigns it to the NextExclusiveStartKey field. -func (o *ListOfKeys) SetNextExclusiveStartKey(v string) { - o.NextExclusiveStartKey.Set(&v) -} -// SetNextExclusiveStartKeyNil sets the value for NextExclusiveStartKey to be an explicit nil -func (o *ListOfKeys) SetNextExclusiveStartKeyNil() { - o.NextExclusiveStartKey.Set(nil) -} - -// UnsetNextExclusiveStartKey ensures that no value is present for NextExclusiveStartKey, not even an explicit nil -func (o *ListOfKeys) UnsetNextExclusiveStartKey() { - o.NextExclusiveStartKey.Unset() -} - -func (o ListOfKeys) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o ListOfKeys) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["items"] = o.Items - toSerialize["count"] = o.Count - toSerialize["limit"] = o.Limit - if o.ExclusiveStartKey.IsSet() { - toSerialize["exclusiveStartKey"] = o.ExclusiveStartKey.Get() - } - toSerialize["isTruncated"] = o.IsTruncated - if o.NextExclusiveStartKey.IsSet() { - toSerialize["nextExclusiveStartKey"] = o.NextExclusiveStartKey.Get() - } - return toSerialize, nil -} - -func (o *ListOfKeys) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "items", - "count", - "limit", - "isTruncated", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err; - } - - for _, requiredProperty := range(requiredProperties) { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varListOfKeys := _ListOfKeys{} - - decoder := json.NewDecoder(bytes.NewReader(data)) - decoder.DisallowUnknownFields() - err = decoder.Decode(&varListOfKeys) - - if err != nil { - return err - } - - *o = ListOfKeys(varListOfKeys) - - return err -} - -type NullableListOfKeys struct { - value *ListOfKeys - isSet bool -} - -func (v NullableListOfKeys) Get() *ListOfKeys { - return v.value -} - -func (v *NullableListOfKeys) Set(val *ListOfKeys) { - v.value = val - v.isSet = true -} - -func (v NullableListOfKeys) IsSet() bool { - return v.isSet -} - -func (v *NullableListOfKeys) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableListOfKeys(val *ListOfKeys) *NullableListOfKeys { - return &NullableListOfKeys{value: val, isSet: true} -} - -func (v NullableListOfKeys) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableListOfKeys) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_list_of_keys_response.go b/model_list_of_keys_response.go deleted file mode 100644 index 45268d9..0000000 --- a/model_list_of_keys_response.go +++ /dev/null @@ -1,158 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" - "bytes" - "fmt" -) - -// checks if the ListOfKeysResponse type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &ListOfKeysResponse{} - -// ListOfKeysResponse struct for ListOfKeysResponse -type ListOfKeysResponse struct { - Data ListOfKeys `json:"data"` -} - -type _ListOfKeysResponse ListOfKeysResponse - -// NewListOfKeysResponse instantiates a new ListOfKeysResponse object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewListOfKeysResponse(data ListOfKeys) *ListOfKeysResponse { - this := ListOfKeysResponse{} - this.Data = data - return &this -} - -// NewListOfKeysResponseWithDefaults instantiates a new ListOfKeysResponse object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewListOfKeysResponseWithDefaults() *ListOfKeysResponse { - this := ListOfKeysResponse{} - return &this -} - -// GetData returns the Data field value -func (o *ListOfKeysResponse) GetData() ListOfKeys { - if o == nil { - var ret ListOfKeys - return ret - } - - return o.Data -} - -// GetDataOk returns a tuple with the Data field value -// and a boolean to check if the value has been set. -func (o *ListOfKeysResponse) GetDataOk() (*ListOfKeys, bool) { - if o == nil { - return nil, false - } - return &o.Data, true -} - -// SetData sets field value -func (o *ListOfKeysResponse) SetData(v ListOfKeys) { - o.Data = v -} - -func (o ListOfKeysResponse) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o ListOfKeysResponse) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["data"] = o.Data - return toSerialize, nil -} - -func (o *ListOfKeysResponse) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "data", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err; - } - - for _, requiredProperty := range(requiredProperties) { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varListOfKeysResponse := _ListOfKeysResponse{} - - decoder := json.NewDecoder(bytes.NewReader(data)) - decoder.DisallowUnknownFields() - err = decoder.Decode(&varListOfKeysResponse) - - if err != nil { - return err - } - - *o = ListOfKeysResponse(varListOfKeysResponse) - - return err -} - -type NullableListOfKeysResponse struct { - value *ListOfKeysResponse - isSet bool -} - -func (v NullableListOfKeysResponse) Get() *ListOfKeysResponse { - return v.value -} - -func (v *NullableListOfKeysResponse) Set(val *ListOfKeysResponse) { - v.value = val - v.isSet = true -} - -func (v NullableListOfKeysResponse) IsSet() bool { - return v.isSet -} - -func (v *NullableListOfKeysResponse) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableListOfKeysResponse(val *ListOfKeysResponse) *NullableListOfKeysResponse { - return &NullableListOfKeysResponse{value: val, isSet: true} -} - -func (v NullableListOfKeysResponse) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableListOfKeysResponse) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_list_of_request_queues.go b/model_list_of_request_queues.go deleted file mode 100644 index 49f17cd..0000000 --- a/model_list_of_request_queues.go +++ /dev/null @@ -1,341 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" - "bytes" - "fmt" -) - -// checks if the ListOfRequestQueues type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &ListOfRequestQueues{} - -// ListOfRequestQueues A paginated list of request queues. -type ListOfRequestQueues struct { - // The total number of items available across all pages. - Total int32 `json:"total"` - // The starting position for this page of results. - Offset int32 `json:"offset"` - // The maximum number of items returned per page. - Limit int32 `json:"limit"` - // Whether the results are sorted in descending order. - Desc bool `json:"desc"` - // The number of items returned in this response. - Count int32 `json:"count"` - // Whether the listing was filtered to only unnamed request queues. - Unnamed *bool `json:"unnamed,omitempty"` - // The array of request queues. - Items []RequestQueueShort `json:"items"` -} - -type _ListOfRequestQueues ListOfRequestQueues - -// NewListOfRequestQueues instantiates a new ListOfRequestQueues object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewListOfRequestQueues(total int32, offset int32, limit int32, desc bool, count int32, items []RequestQueueShort) *ListOfRequestQueues { - this := ListOfRequestQueues{} - this.Total = total - this.Offset = offset - this.Limit = limit - this.Desc = desc - this.Count = count - this.Items = items - return &this -} - -// NewListOfRequestQueuesWithDefaults instantiates a new ListOfRequestQueues object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewListOfRequestQueuesWithDefaults() *ListOfRequestQueues { - this := ListOfRequestQueues{} - return &this -} - -// GetTotal returns the Total field value -func (o *ListOfRequestQueues) GetTotal() int32 { - if o == nil { - var ret int32 - return ret - } - - return o.Total -} - -// GetTotalOk returns a tuple with the Total field value -// and a boolean to check if the value has been set. -func (o *ListOfRequestQueues) GetTotalOk() (*int32, bool) { - if o == nil { - return nil, false - } - return &o.Total, true -} - -// SetTotal sets field value -func (o *ListOfRequestQueues) SetTotal(v int32) { - o.Total = v -} - -// GetOffset returns the Offset field value -func (o *ListOfRequestQueues) GetOffset() int32 { - if o == nil { - var ret int32 - return ret - } - - return o.Offset -} - -// GetOffsetOk returns a tuple with the Offset field value -// and a boolean to check if the value has been set. -func (o *ListOfRequestQueues) GetOffsetOk() (*int32, bool) { - if o == nil { - return nil, false - } - return &o.Offset, true -} - -// SetOffset sets field value -func (o *ListOfRequestQueues) SetOffset(v int32) { - o.Offset = v -} - -// GetLimit returns the Limit field value -func (o *ListOfRequestQueues) GetLimit() int32 { - if o == nil { - var ret int32 - return ret - } - - return o.Limit -} - -// GetLimitOk returns a tuple with the Limit field value -// and a boolean to check if the value has been set. -func (o *ListOfRequestQueues) GetLimitOk() (*int32, bool) { - if o == nil { - return nil, false - } - return &o.Limit, true -} - -// SetLimit sets field value -func (o *ListOfRequestQueues) SetLimit(v int32) { - o.Limit = v -} - -// GetDesc returns the Desc field value -func (o *ListOfRequestQueues) GetDesc() bool { - if o == nil { - var ret bool - return ret - } - - return o.Desc -} - -// GetDescOk returns a tuple with the Desc field value -// and a boolean to check if the value has been set. -func (o *ListOfRequestQueues) GetDescOk() (*bool, bool) { - if o == nil { - return nil, false - } - return &o.Desc, true -} - -// SetDesc sets field value -func (o *ListOfRequestQueues) SetDesc(v bool) { - o.Desc = v -} - -// GetCount returns the Count field value -func (o *ListOfRequestQueues) GetCount() int32 { - if o == nil { - var ret int32 - return ret - } - - return o.Count -} - -// GetCountOk returns a tuple with the Count field value -// and a boolean to check if the value has been set. -func (o *ListOfRequestQueues) GetCountOk() (*int32, bool) { - if o == nil { - return nil, false - } - return &o.Count, true -} - -// SetCount sets field value -func (o *ListOfRequestQueues) SetCount(v int32) { - o.Count = v -} - -// GetUnnamed returns the Unnamed field value if set, zero value otherwise. -func (o *ListOfRequestQueues) GetUnnamed() bool { - if o == nil || IsNil(o.Unnamed) { - var ret bool - return ret - } - return *o.Unnamed -} - -// GetUnnamedOk returns a tuple with the Unnamed field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ListOfRequestQueues) GetUnnamedOk() (*bool, bool) { - if o == nil || IsNil(o.Unnamed) { - return nil, false - } - return o.Unnamed, true -} - -// HasUnnamed returns a boolean if a field has been set. -func (o *ListOfRequestQueues) HasUnnamed() bool { - if o != nil && !IsNil(o.Unnamed) { - return true - } - - return false -} - -// SetUnnamed gets a reference to the given bool and assigns it to the Unnamed field. -func (o *ListOfRequestQueues) SetUnnamed(v bool) { - o.Unnamed = &v -} - -// GetItems returns the Items field value -func (o *ListOfRequestQueues) GetItems() []RequestQueueShort { - if o == nil { - var ret []RequestQueueShort - return ret - } - - return o.Items -} - -// GetItemsOk returns a tuple with the Items field value -// and a boolean to check if the value has been set. -func (o *ListOfRequestQueues) GetItemsOk() ([]RequestQueueShort, bool) { - if o == nil { - return nil, false - } - return o.Items, true -} - -// SetItems sets field value -func (o *ListOfRequestQueues) SetItems(v []RequestQueueShort) { - o.Items = v -} - -func (o ListOfRequestQueues) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o ListOfRequestQueues) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["total"] = o.Total - toSerialize["offset"] = o.Offset - toSerialize["limit"] = o.Limit - toSerialize["desc"] = o.Desc - toSerialize["count"] = o.Count - if !IsNil(o.Unnamed) { - toSerialize["unnamed"] = o.Unnamed - } - toSerialize["items"] = o.Items - return toSerialize, nil -} - -func (o *ListOfRequestQueues) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "total", - "offset", - "limit", - "desc", - "count", - "items", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err; - } - - for _, requiredProperty := range(requiredProperties) { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varListOfRequestQueues := _ListOfRequestQueues{} - - decoder := json.NewDecoder(bytes.NewReader(data)) - decoder.DisallowUnknownFields() - err = decoder.Decode(&varListOfRequestQueues) - - if err != nil { - return err - } - - *o = ListOfRequestQueues(varListOfRequestQueues) - - return err -} - -type NullableListOfRequestQueues struct { - value *ListOfRequestQueues - isSet bool -} - -func (v NullableListOfRequestQueues) Get() *ListOfRequestQueues { - return v.value -} - -func (v *NullableListOfRequestQueues) Set(val *ListOfRequestQueues) { - v.value = val - v.isSet = true -} - -func (v NullableListOfRequestQueues) IsSet() bool { - return v.isSet -} - -func (v *NullableListOfRequestQueues) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableListOfRequestQueues(val *ListOfRequestQueues) *NullableListOfRequestQueues { - return &NullableListOfRequestQueues{value: val, isSet: true} -} - -func (v NullableListOfRequestQueues) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableListOfRequestQueues) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_list_of_request_queues_response.go b/model_list_of_request_queues_response.go deleted file mode 100644 index a4837a0..0000000 --- a/model_list_of_request_queues_response.go +++ /dev/null @@ -1,158 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" - "bytes" - "fmt" -) - -// checks if the ListOfRequestQueuesResponse type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &ListOfRequestQueuesResponse{} - -// ListOfRequestQueuesResponse Response containing a list of request queues. -type ListOfRequestQueuesResponse struct { - Data ListOfRequestQueues `json:"data"` -} - -type _ListOfRequestQueuesResponse ListOfRequestQueuesResponse - -// NewListOfRequestQueuesResponse instantiates a new ListOfRequestQueuesResponse object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewListOfRequestQueuesResponse(data ListOfRequestQueues) *ListOfRequestQueuesResponse { - this := ListOfRequestQueuesResponse{} - this.Data = data - return &this -} - -// NewListOfRequestQueuesResponseWithDefaults instantiates a new ListOfRequestQueuesResponse object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewListOfRequestQueuesResponseWithDefaults() *ListOfRequestQueuesResponse { - this := ListOfRequestQueuesResponse{} - return &this -} - -// GetData returns the Data field value -func (o *ListOfRequestQueuesResponse) GetData() ListOfRequestQueues { - if o == nil { - var ret ListOfRequestQueues - return ret - } - - return o.Data -} - -// GetDataOk returns a tuple with the Data field value -// and a boolean to check if the value has been set. -func (o *ListOfRequestQueuesResponse) GetDataOk() (*ListOfRequestQueues, bool) { - if o == nil { - return nil, false - } - return &o.Data, true -} - -// SetData sets field value -func (o *ListOfRequestQueuesResponse) SetData(v ListOfRequestQueues) { - o.Data = v -} - -func (o ListOfRequestQueuesResponse) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o ListOfRequestQueuesResponse) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["data"] = o.Data - return toSerialize, nil -} - -func (o *ListOfRequestQueuesResponse) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "data", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err; - } - - for _, requiredProperty := range(requiredProperties) { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varListOfRequestQueuesResponse := _ListOfRequestQueuesResponse{} - - decoder := json.NewDecoder(bytes.NewReader(data)) - decoder.DisallowUnknownFields() - err = decoder.Decode(&varListOfRequestQueuesResponse) - - if err != nil { - return err - } - - *o = ListOfRequestQueuesResponse(varListOfRequestQueuesResponse) - - return err -} - -type NullableListOfRequestQueuesResponse struct { - value *ListOfRequestQueuesResponse - isSet bool -} - -func (v NullableListOfRequestQueuesResponse) Get() *ListOfRequestQueuesResponse { - return v.value -} - -func (v *NullableListOfRequestQueuesResponse) Set(val *ListOfRequestQueuesResponse) { - v.value = val - v.isSet = true -} - -func (v NullableListOfRequestQueuesResponse) IsSet() bool { - return v.isSet -} - -func (v *NullableListOfRequestQueuesResponse) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableListOfRequestQueuesResponse(val *ListOfRequestQueuesResponse) *NullableListOfRequestQueuesResponse { - return &NullableListOfRequestQueuesResponse{value: val, isSet: true} -} - -func (v NullableListOfRequestQueuesResponse) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableListOfRequestQueuesResponse) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_list_of_requests.go b/model_list_of_requests.go deleted file mode 100644 index 6a15642..0000000 --- a/model_list_of_requests.go +++ /dev/null @@ -1,303 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" - "bytes" - "fmt" -) - -// checks if the ListOfRequests type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &ListOfRequests{} - -// ListOfRequests A paginated list of requests from the request queue. -type ListOfRequests struct { - // The array of requests. - Items []Request `json:"items"` - // The maximum number of requests returned in this response. - Limit int32 `json:"limit"` - // The ID of the last request from the previous page, used for pagination. - // Deprecated - ExclusiveStartId *string `json:"exclusiveStartId,omitempty"` - // A cursor string used for current page of results. - Cursor *string `json:"cursor,omitempty"` - // A cursor string to be used to continue pagination. - NextCursor *string `json:"nextCursor,omitempty"` -} - -type _ListOfRequests ListOfRequests - -// NewListOfRequests instantiates a new ListOfRequests object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewListOfRequests(items []Request, limit int32) *ListOfRequests { - this := ListOfRequests{} - this.Items = items - this.Limit = limit - return &this -} - -// NewListOfRequestsWithDefaults instantiates a new ListOfRequests object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewListOfRequestsWithDefaults() *ListOfRequests { - this := ListOfRequests{} - return &this -} - -// GetItems returns the Items field value -func (o *ListOfRequests) GetItems() []Request { - if o == nil { - var ret []Request - return ret - } - - return o.Items -} - -// GetItemsOk returns a tuple with the Items field value -// and a boolean to check if the value has been set. -func (o *ListOfRequests) GetItemsOk() ([]Request, bool) { - if o == nil { - return nil, false - } - return o.Items, true -} - -// SetItems sets field value -func (o *ListOfRequests) SetItems(v []Request) { - o.Items = v -} - -// GetLimit returns the Limit field value -func (o *ListOfRequests) GetLimit() int32 { - if o == nil { - var ret int32 - return ret - } - - return o.Limit -} - -// GetLimitOk returns a tuple with the Limit field value -// and a boolean to check if the value has been set. -func (o *ListOfRequests) GetLimitOk() (*int32, bool) { - if o == nil { - return nil, false - } - return &o.Limit, true -} - -// SetLimit sets field value -func (o *ListOfRequests) SetLimit(v int32) { - o.Limit = v -} - -// GetExclusiveStartId returns the ExclusiveStartId field value if set, zero value otherwise. -// Deprecated -func (o *ListOfRequests) GetExclusiveStartId() string { - if o == nil || IsNil(o.ExclusiveStartId) { - var ret string - return ret - } - return *o.ExclusiveStartId -} - -// GetExclusiveStartIdOk returns a tuple with the ExclusiveStartId field value if set, nil otherwise -// and a boolean to check if the value has been set. -// Deprecated -func (o *ListOfRequests) GetExclusiveStartIdOk() (*string, bool) { - if o == nil || IsNil(o.ExclusiveStartId) { - return nil, false - } - return o.ExclusiveStartId, true -} - -// HasExclusiveStartId returns a boolean if a field has been set. -func (o *ListOfRequests) HasExclusiveStartId() bool { - if o != nil && !IsNil(o.ExclusiveStartId) { - return true - } - - return false -} - -// SetExclusiveStartId gets a reference to the given string and assigns it to the ExclusiveStartId field. -// Deprecated -func (o *ListOfRequests) SetExclusiveStartId(v string) { - o.ExclusiveStartId = &v -} - -// GetCursor returns the Cursor field value if set, zero value otherwise. -func (o *ListOfRequests) GetCursor() string { - if o == nil || IsNil(o.Cursor) { - var ret string - return ret - } - return *o.Cursor -} - -// GetCursorOk returns a tuple with the Cursor field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ListOfRequests) GetCursorOk() (*string, bool) { - if o == nil || IsNil(o.Cursor) { - return nil, false - } - return o.Cursor, true -} - -// HasCursor returns a boolean if a field has been set. -func (o *ListOfRequests) HasCursor() bool { - if o != nil && !IsNil(o.Cursor) { - return true - } - - return false -} - -// SetCursor gets a reference to the given string and assigns it to the Cursor field. -func (o *ListOfRequests) SetCursor(v string) { - o.Cursor = &v -} - -// GetNextCursor returns the NextCursor field value if set, zero value otherwise. -func (o *ListOfRequests) GetNextCursor() string { - if o == nil || IsNil(o.NextCursor) { - var ret string - return ret - } - return *o.NextCursor -} - -// GetNextCursorOk returns a tuple with the NextCursor field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ListOfRequests) GetNextCursorOk() (*string, bool) { - if o == nil || IsNil(o.NextCursor) { - return nil, false - } - return o.NextCursor, true -} - -// HasNextCursor returns a boolean if a field has been set. -func (o *ListOfRequests) HasNextCursor() bool { - if o != nil && !IsNil(o.NextCursor) { - return true - } - - return false -} - -// SetNextCursor gets a reference to the given string and assigns it to the NextCursor field. -func (o *ListOfRequests) SetNextCursor(v string) { - o.NextCursor = &v -} - -func (o ListOfRequests) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o ListOfRequests) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["items"] = o.Items - toSerialize["limit"] = o.Limit - if !IsNil(o.ExclusiveStartId) { - toSerialize["exclusiveStartId"] = o.ExclusiveStartId - } - if !IsNil(o.Cursor) { - toSerialize["cursor"] = o.Cursor - } - if !IsNil(o.NextCursor) { - toSerialize["nextCursor"] = o.NextCursor - } - return toSerialize, nil -} - -func (o *ListOfRequests) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "items", - "limit", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err; - } - - for _, requiredProperty := range(requiredProperties) { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varListOfRequests := _ListOfRequests{} - - decoder := json.NewDecoder(bytes.NewReader(data)) - decoder.DisallowUnknownFields() - err = decoder.Decode(&varListOfRequests) - - if err != nil { - return err - } - - *o = ListOfRequests(varListOfRequests) - - return err -} - -type NullableListOfRequests struct { - value *ListOfRequests - isSet bool -} - -func (v NullableListOfRequests) Get() *ListOfRequests { - return v.value -} - -func (v *NullableListOfRequests) Set(val *ListOfRequests) { - v.value = val - v.isSet = true -} - -func (v NullableListOfRequests) IsSet() bool { - return v.isSet -} - -func (v *NullableListOfRequests) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableListOfRequests(val *ListOfRequests) *NullableListOfRequests { - return &NullableListOfRequests{value: val, isSet: true} -} - -func (v NullableListOfRequests) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableListOfRequests) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_list_of_requests_response.go b/model_list_of_requests_response.go deleted file mode 100644 index 0162428..0000000 --- a/model_list_of_requests_response.go +++ /dev/null @@ -1,158 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" - "bytes" - "fmt" -) - -// checks if the ListOfRequestsResponse type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &ListOfRequestsResponse{} - -// ListOfRequestsResponse Response containing a list of requests from the request queue. -type ListOfRequestsResponse struct { - Data ListOfRequests `json:"data"` -} - -type _ListOfRequestsResponse ListOfRequestsResponse - -// NewListOfRequestsResponse instantiates a new ListOfRequestsResponse object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewListOfRequestsResponse(data ListOfRequests) *ListOfRequestsResponse { - this := ListOfRequestsResponse{} - this.Data = data - return &this -} - -// NewListOfRequestsResponseWithDefaults instantiates a new ListOfRequestsResponse object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewListOfRequestsResponseWithDefaults() *ListOfRequestsResponse { - this := ListOfRequestsResponse{} - return &this -} - -// GetData returns the Data field value -func (o *ListOfRequestsResponse) GetData() ListOfRequests { - if o == nil { - var ret ListOfRequests - return ret - } - - return o.Data -} - -// GetDataOk returns a tuple with the Data field value -// and a boolean to check if the value has been set. -func (o *ListOfRequestsResponse) GetDataOk() (*ListOfRequests, bool) { - if o == nil { - return nil, false - } - return &o.Data, true -} - -// SetData sets field value -func (o *ListOfRequestsResponse) SetData(v ListOfRequests) { - o.Data = v -} - -func (o ListOfRequestsResponse) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o ListOfRequestsResponse) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["data"] = o.Data - return toSerialize, nil -} - -func (o *ListOfRequestsResponse) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "data", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err; - } - - for _, requiredProperty := range(requiredProperties) { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varListOfRequestsResponse := _ListOfRequestsResponse{} - - decoder := json.NewDecoder(bytes.NewReader(data)) - decoder.DisallowUnknownFields() - err = decoder.Decode(&varListOfRequestsResponse) - - if err != nil { - return err - } - - *o = ListOfRequestsResponse(varListOfRequestsResponse) - - return err -} - -type NullableListOfRequestsResponse struct { - value *ListOfRequestsResponse - isSet bool -} - -func (v NullableListOfRequestsResponse) Get() *ListOfRequestsResponse { - return v.value -} - -func (v *NullableListOfRequestsResponse) Set(val *ListOfRequestsResponse) { - v.value = val - v.isSet = true -} - -func (v NullableListOfRequestsResponse) IsSet() bool { - return v.isSet -} - -func (v *NullableListOfRequestsResponse) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableListOfRequestsResponse(val *ListOfRequestsResponse) *NullableListOfRequestsResponse { - return &NullableListOfRequestsResponse{value: val, isSet: true} -} - -func (v NullableListOfRequestsResponse) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableListOfRequestsResponse) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_list_of_runs.go b/model_list_of_runs.go deleted file mode 100644 index ad04afb..0000000 --- a/model_list_of_runs.go +++ /dev/null @@ -1,303 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" - "bytes" - "fmt" -) - -// checks if the ListOfRuns type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &ListOfRuns{} - -// ListOfRuns struct for ListOfRuns -type ListOfRuns struct { - // The total number of items available across all pages. - Total int32 `json:"total"` - // The starting position for this page of results. - Offset int32 `json:"offset"` - // The maximum number of items returned per page. - Limit int32 `json:"limit"` - // Whether the results are sorted in descending order. - Desc bool `json:"desc"` - // The number of items returned in this response. - Count int32 `json:"count"` - Items []RunShort `json:"items"` -} - -type _ListOfRuns ListOfRuns - -// NewListOfRuns instantiates a new ListOfRuns object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewListOfRuns(total int32, offset int32, limit int32, desc bool, count int32, items []RunShort) *ListOfRuns { - this := ListOfRuns{} - this.Total = total - this.Offset = offset - this.Limit = limit - this.Desc = desc - this.Count = count - this.Items = items - return &this -} - -// NewListOfRunsWithDefaults instantiates a new ListOfRuns object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewListOfRunsWithDefaults() *ListOfRuns { - this := ListOfRuns{} - return &this -} - -// GetTotal returns the Total field value -func (o *ListOfRuns) GetTotal() int32 { - if o == nil { - var ret int32 - return ret - } - - return o.Total -} - -// GetTotalOk returns a tuple with the Total field value -// and a boolean to check if the value has been set. -func (o *ListOfRuns) GetTotalOk() (*int32, bool) { - if o == nil { - return nil, false - } - return &o.Total, true -} - -// SetTotal sets field value -func (o *ListOfRuns) SetTotal(v int32) { - o.Total = v -} - -// GetOffset returns the Offset field value -func (o *ListOfRuns) GetOffset() int32 { - if o == nil { - var ret int32 - return ret - } - - return o.Offset -} - -// GetOffsetOk returns a tuple with the Offset field value -// and a boolean to check if the value has been set. -func (o *ListOfRuns) GetOffsetOk() (*int32, bool) { - if o == nil { - return nil, false - } - return &o.Offset, true -} - -// SetOffset sets field value -func (o *ListOfRuns) SetOffset(v int32) { - o.Offset = v -} - -// GetLimit returns the Limit field value -func (o *ListOfRuns) GetLimit() int32 { - if o == nil { - var ret int32 - return ret - } - - return o.Limit -} - -// GetLimitOk returns a tuple with the Limit field value -// and a boolean to check if the value has been set. -func (o *ListOfRuns) GetLimitOk() (*int32, bool) { - if o == nil { - return nil, false - } - return &o.Limit, true -} - -// SetLimit sets field value -func (o *ListOfRuns) SetLimit(v int32) { - o.Limit = v -} - -// GetDesc returns the Desc field value -func (o *ListOfRuns) GetDesc() bool { - if o == nil { - var ret bool - return ret - } - - return o.Desc -} - -// GetDescOk returns a tuple with the Desc field value -// and a boolean to check if the value has been set. -func (o *ListOfRuns) GetDescOk() (*bool, bool) { - if o == nil { - return nil, false - } - return &o.Desc, true -} - -// SetDesc sets field value -func (o *ListOfRuns) SetDesc(v bool) { - o.Desc = v -} - -// GetCount returns the Count field value -func (o *ListOfRuns) GetCount() int32 { - if o == nil { - var ret int32 - return ret - } - - return o.Count -} - -// GetCountOk returns a tuple with the Count field value -// and a boolean to check if the value has been set. -func (o *ListOfRuns) GetCountOk() (*int32, bool) { - if o == nil { - return nil, false - } - return &o.Count, true -} - -// SetCount sets field value -func (o *ListOfRuns) SetCount(v int32) { - o.Count = v -} - -// GetItems returns the Items field value -func (o *ListOfRuns) GetItems() []RunShort { - if o == nil { - var ret []RunShort - return ret - } - - return o.Items -} - -// GetItemsOk returns a tuple with the Items field value -// and a boolean to check if the value has been set. -func (o *ListOfRuns) GetItemsOk() ([]RunShort, bool) { - if o == nil { - return nil, false - } - return o.Items, true -} - -// SetItems sets field value -func (o *ListOfRuns) SetItems(v []RunShort) { - o.Items = v -} - -func (o ListOfRuns) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o ListOfRuns) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["total"] = o.Total - toSerialize["offset"] = o.Offset - toSerialize["limit"] = o.Limit - toSerialize["desc"] = o.Desc - toSerialize["count"] = o.Count - toSerialize["items"] = o.Items - return toSerialize, nil -} - -func (o *ListOfRuns) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "total", - "offset", - "limit", - "desc", - "count", - "items", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err; - } - - for _, requiredProperty := range(requiredProperties) { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varListOfRuns := _ListOfRuns{} - - decoder := json.NewDecoder(bytes.NewReader(data)) - decoder.DisallowUnknownFields() - err = decoder.Decode(&varListOfRuns) - - if err != nil { - return err - } - - *o = ListOfRuns(varListOfRuns) - - return err -} - -type NullableListOfRuns struct { - value *ListOfRuns - isSet bool -} - -func (v NullableListOfRuns) Get() *ListOfRuns { - return v.value -} - -func (v *NullableListOfRuns) Set(val *ListOfRuns) { - v.value = val - v.isSet = true -} - -func (v NullableListOfRuns) IsSet() bool { - return v.isSet -} - -func (v *NullableListOfRuns) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableListOfRuns(val *ListOfRuns) *NullableListOfRuns { - return &NullableListOfRuns{value: val, isSet: true} -} - -func (v NullableListOfRuns) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableListOfRuns) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_list_of_runs_response.go b/model_list_of_runs_response.go deleted file mode 100644 index cad1247..0000000 --- a/model_list_of_runs_response.go +++ /dev/null @@ -1,158 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" - "bytes" - "fmt" -) - -// checks if the ListOfRunsResponse type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &ListOfRunsResponse{} - -// ListOfRunsResponse struct for ListOfRunsResponse -type ListOfRunsResponse struct { - Data ListOfRuns `json:"data"` -} - -type _ListOfRunsResponse ListOfRunsResponse - -// NewListOfRunsResponse instantiates a new ListOfRunsResponse object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewListOfRunsResponse(data ListOfRuns) *ListOfRunsResponse { - this := ListOfRunsResponse{} - this.Data = data - return &this -} - -// NewListOfRunsResponseWithDefaults instantiates a new ListOfRunsResponse object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewListOfRunsResponseWithDefaults() *ListOfRunsResponse { - this := ListOfRunsResponse{} - return &this -} - -// GetData returns the Data field value -func (o *ListOfRunsResponse) GetData() ListOfRuns { - if o == nil { - var ret ListOfRuns - return ret - } - - return o.Data -} - -// GetDataOk returns a tuple with the Data field value -// and a boolean to check if the value has been set. -func (o *ListOfRunsResponse) GetDataOk() (*ListOfRuns, bool) { - if o == nil { - return nil, false - } - return &o.Data, true -} - -// SetData sets field value -func (o *ListOfRunsResponse) SetData(v ListOfRuns) { - o.Data = v -} - -func (o ListOfRunsResponse) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o ListOfRunsResponse) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["data"] = o.Data - return toSerialize, nil -} - -func (o *ListOfRunsResponse) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "data", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err; - } - - for _, requiredProperty := range(requiredProperties) { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varListOfRunsResponse := _ListOfRunsResponse{} - - decoder := json.NewDecoder(bytes.NewReader(data)) - decoder.DisallowUnknownFields() - err = decoder.Decode(&varListOfRunsResponse) - - if err != nil { - return err - } - - *o = ListOfRunsResponse(varListOfRunsResponse) - - return err -} - -type NullableListOfRunsResponse struct { - value *ListOfRunsResponse - isSet bool -} - -func (v NullableListOfRunsResponse) Get() *ListOfRunsResponse { - return v.value -} - -func (v *NullableListOfRunsResponse) Set(val *ListOfRunsResponse) { - v.value = val - v.isSet = true -} - -func (v NullableListOfRunsResponse) IsSet() bool { - return v.isSet -} - -func (v *NullableListOfRunsResponse) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableListOfRunsResponse(val *ListOfRunsResponse) *NullableListOfRunsResponse { - return &NullableListOfRunsResponse{value: val, isSet: true} -} - -func (v NullableListOfRunsResponse) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableListOfRunsResponse) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_list_of_schedules.go b/model_list_of_schedules.go deleted file mode 100644 index 422a7f2..0000000 --- a/model_list_of_schedules.go +++ /dev/null @@ -1,303 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" - "bytes" - "fmt" -) - -// checks if the ListOfSchedules type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &ListOfSchedules{} - -// ListOfSchedules struct for ListOfSchedules -type ListOfSchedules struct { - // The total number of items available across all pages. - Total int32 `json:"total"` - // The starting position for this page of results. - Offset int32 `json:"offset"` - // The maximum number of items returned per page. - Limit int32 `json:"limit"` - // Whether the results are sorted in descending order. - Desc bool `json:"desc"` - // The number of items returned in this response. - Count int32 `json:"count"` - Items []ScheduleShort `json:"items"` -} - -type _ListOfSchedules ListOfSchedules - -// NewListOfSchedules instantiates a new ListOfSchedules object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewListOfSchedules(total int32, offset int32, limit int32, desc bool, count int32, items []ScheduleShort) *ListOfSchedules { - this := ListOfSchedules{} - this.Total = total - this.Offset = offset - this.Limit = limit - this.Desc = desc - this.Count = count - this.Items = items - return &this -} - -// NewListOfSchedulesWithDefaults instantiates a new ListOfSchedules object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewListOfSchedulesWithDefaults() *ListOfSchedules { - this := ListOfSchedules{} - return &this -} - -// GetTotal returns the Total field value -func (o *ListOfSchedules) GetTotal() int32 { - if o == nil { - var ret int32 - return ret - } - - return o.Total -} - -// GetTotalOk returns a tuple with the Total field value -// and a boolean to check if the value has been set. -func (o *ListOfSchedules) GetTotalOk() (*int32, bool) { - if o == nil { - return nil, false - } - return &o.Total, true -} - -// SetTotal sets field value -func (o *ListOfSchedules) SetTotal(v int32) { - o.Total = v -} - -// GetOffset returns the Offset field value -func (o *ListOfSchedules) GetOffset() int32 { - if o == nil { - var ret int32 - return ret - } - - return o.Offset -} - -// GetOffsetOk returns a tuple with the Offset field value -// and a boolean to check if the value has been set. -func (o *ListOfSchedules) GetOffsetOk() (*int32, bool) { - if o == nil { - return nil, false - } - return &o.Offset, true -} - -// SetOffset sets field value -func (o *ListOfSchedules) SetOffset(v int32) { - o.Offset = v -} - -// GetLimit returns the Limit field value -func (o *ListOfSchedules) GetLimit() int32 { - if o == nil { - var ret int32 - return ret - } - - return o.Limit -} - -// GetLimitOk returns a tuple with the Limit field value -// and a boolean to check if the value has been set. -func (o *ListOfSchedules) GetLimitOk() (*int32, bool) { - if o == nil { - return nil, false - } - return &o.Limit, true -} - -// SetLimit sets field value -func (o *ListOfSchedules) SetLimit(v int32) { - o.Limit = v -} - -// GetDesc returns the Desc field value -func (o *ListOfSchedules) GetDesc() bool { - if o == nil { - var ret bool - return ret - } - - return o.Desc -} - -// GetDescOk returns a tuple with the Desc field value -// and a boolean to check if the value has been set. -func (o *ListOfSchedules) GetDescOk() (*bool, bool) { - if o == nil { - return nil, false - } - return &o.Desc, true -} - -// SetDesc sets field value -func (o *ListOfSchedules) SetDesc(v bool) { - o.Desc = v -} - -// GetCount returns the Count field value -func (o *ListOfSchedules) GetCount() int32 { - if o == nil { - var ret int32 - return ret - } - - return o.Count -} - -// GetCountOk returns a tuple with the Count field value -// and a boolean to check if the value has been set. -func (o *ListOfSchedules) GetCountOk() (*int32, bool) { - if o == nil { - return nil, false - } - return &o.Count, true -} - -// SetCount sets field value -func (o *ListOfSchedules) SetCount(v int32) { - o.Count = v -} - -// GetItems returns the Items field value -func (o *ListOfSchedules) GetItems() []ScheduleShort { - if o == nil { - var ret []ScheduleShort - return ret - } - - return o.Items -} - -// GetItemsOk returns a tuple with the Items field value -// and a boolean to check if the value has been set. -func (o *ListOfSchedules) GetItemsOk() ([]ScheduleShort, bool) { - if o == nil { - return nil, false - } - return o.Items, true -} - -// SetItems sets field value -func (o *ListOfSchedules) SetItems(v []ScheduleShort) { - o.Items = v -} - -func (o ListOfSchedules) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o ListOfSchedules) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["total"] = o.Total - toSerialize["offset"] = o.Offset - toSerialize["limit"] = o.Limit - toSerialize["desc"] = o.Desc - toSerialize["count"] = o.Count - toSerialize["items"] = o.Items - return toSerialize, nil -} - -func (o *ListOfSchedules) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "total", - "offset", - "limit", - "desc", - "count", - "items", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err; - } - - for _, requiredProperty := range(requiredProperties) { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varListOfSchedules := _ListOfSchedules{} - - decoder := json.NewDecoder(bytes.NewReader(data)) - decoder.DisallowUnknownFields() - err = decoder.Decode(&varListOfSchedules) - - if err != nil { - return err - } - - *o = ListOfSchedules(varListOfSchedules) - - return err -} - -type NullableListOfSchedules struct { - value *ListOfSchedules - isSet bool -} - -func (v NullableListOfSchedules) Get() *ListOfSchedules { - return v.value -} - -func (v *NullableListOfSchedules) Set(val *ListOfSchedules) { - v.value = val - v.isSet = true -} - -func (v NullableListOfSchedules) IsSet() bool { - return v.isSet -} - -func (v *NullableListOfSchedules) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableListOfSchedules(val *ListOfSchedules) *NullableListOfSchedules { - return &NullableListOfSchedules{value: val, isSet: true} -} - -func (v NullableListOfSchedules) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableListOfSchedules) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_list_of_schedules_response.go b/model_list_of_schedules_response.go deleted file mode 100644 index 5414901..0000000 --- a/model_list_of_schedules_response.go +++ /dev/null @@ -1,158 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" - "bytes" - "fmt" -) - -// checks if the ListOfSchedulesResponse type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &ListOfSchedulesResponse{} - -// ListOfSchedulesResponse struct for ListOfSchedulesResponse -type ListOfSchedulesResponse struct { - Data ListOfSchedules `json:"data"` -} - -type _ListOfSchedulesResponse ListOfSchedulesResponse - -// NewListOfSchedulesResponse instantiates a new ListOfSchedulesResponse object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewListOfSchedulesResponse(data ListOfSchedules) *ListOfSchedulesResponse { - this := ListOfSchedulesResponse{} - this.Data = data - return &this -} - -// NewListOfSchedulesResponseWithDefaults instantiates a new ListOfSchedulesResponse object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewListOfSchedulesResponseWithDefaults() *ListOfSchedulesResponse { - this := ListOfSchedulesResponse{} - return &this -} - -// GetData returns the Data field value -func (o *ListOfSchedulesResponse) GetData() ListOfSchedules { - if o == nil { - var ret ListOfSchedules - return ret - } - - return o.Data -} - -// GetDataOk returns a tuple with the Data field value -// and a boolean to check if the value has been set. -func (o *ListOfSchedulesResponse) GetDataOk() (*ListOfSchedules, bool) { - if o == nil { - return nil, false - } - return &o.Data, true -} - -// SetData sets field value -func (o *ListOfSchedulesResponse) SetData(v ListOfSchedules) { - o.Data = v -} - -func (o ListOfSchedulesResponse) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o ListOfSchedulesResponse) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["data"] = o.Data - return toSerialize, nil -} - -func (o *ListOfSchedulesResponse) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "data", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err; - } - - for _, requiredProperty := range(requiredProperties) { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varListOfSchedulesResponse := _ListOfSchedulesResponse{} - - decoder := json.NewDecoder(bytes.NewReader(data)) - decoder.DisallowUnknownFields() - err = decoder.Decode(&varListOfSchedulesResponse) - - if err != nil { - return err - } - - *o = ListOfSchedulesResponse(varListOfSchedulesResponse) - - return err -} - -type NullableListOfSchedulesResponse struct { - value *ListOfSchedulesResponse - isSet bool -} - -func (v NullableListOfSchedulesResponse) Get() *ListOfSchedulesResponse { - return v.value -} - -func (v *NullableListOfSchedulesResponse) Set(val *ListOfSchedulesResponse) { - v.value = val - v.isSet = true -} - -func (v NullableListOfSchedulesResponse) IsSet() bool { - return v.isSet -} - -func (v *NullableListOfSchedulesResponse) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableListOfSchedulesResponse(val *ListOfSchedulesResponse) *NullableListOfSchedulesResponse { - return &NullableListOfSchedulesResponse{value: val, isSet: true} -} - -func (v NullableListOfSchedulesResponse) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableListOfSchedulesResponse) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_list_of_store_actors.go b/model_list_of_store_actors.go deleted file mode 100644 index b599a0e..0000000 --- a/model_list_of_store_actors.go +++ /dev/null @@ -1,303 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" - "bytes" - "fmt" -) - -// checks if the ListOfStoreActors type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &ListOfStoreActors{} - -// ListOfStoreActors struct for ListOfStoreActors -type ListOfStoreActors struct { - // The total number of items available across all pages. - Total int32 `json:"total"` - // The starting position for this page of results. - Offset int32 `json:"offset"` - // The maximum number of items returned per page. - Limit int32 `json:"limit"` - // Whether the results are sorted in descending order. - Desc bool `json:"desc"` - // The number of items returned in this response. - Count int32 `json:"count"` - Items []StoreListActor `json:"items"` -} - -type _ListOfStoreActors ListOfStoreActors - -// NewListOfStoreActors instantiates a new ListOfStoreActors object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewListOfStoreActors(total int32, offset int32, limit int32, desc bool, count int32, items []StoreListActor) *ListOfStoreActors { - this := ListOfStoreActors{} - this.Total = total - this.Offset = offset - this.Limit = limit - this.Desc = desc - this.Count = count - this.Items = items - return &this -} - -// NewListOfStoreActorsWithDefaults instantiates a new ListOfStoreActors object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewListOfStoreActorsWithDefaults() *ListOfStoreActors { - this := ListOfStoreActors{} - return &this -} - -// GetTotal returns the Total field value -func (o *ListOfStoreActors) GetTotal() int32 { - if o == nil { - var ret int32 - return ret - } - - return o.Total -} - -// GetTotalOk returns a tuple with the Total field value -// and a boolean to check if the value has been set. -func (o *ListOfStoreActors) GetTotalOk() (*int32, bool) { - if o == nil { - return nil, false - } - return &o.Total, true -} - -// SetTotal sets field value -func (o *ListOfStoreActors) SetTotal(v int32) { - o.Total = v -} - -// GetOffset returns the Offset field value -func (o *ListOfStoreActors) GetOffset() int32 { - if o == nil { - var ret int32 - return ret - } - - return o.Offset -} - -// GetOffsetOk returns a tuple with the Offset field value -// and a boolean to check if the value has been set. -func (o *ListOfStoreActors) GetOffsetOk() (*int32, bool) { - if o == nil { - return nil, false - } - return &o.Offset, true -} - -// SetOffset sets field value -func (o *ListOfStoreActors) SetOffset(v int32) { - o.Offset = v -} - -// GetLimit returns the Limit field value -func (o *ListOfStoreActors) GetLimit() int32 { - if o == nil { - var ret int32 - return ret - } - - return o.Limit -} - -// GetLimitOk returns a tuple with the Limit field value -// and a boolean to check if the value has been set. -func (o *ListOfStoreActors) GetLimitOk() (*int32, bool) { - if o == nil { - return nil, false - } - return &o.Limit, true -} - -// SetLimit sets field value -func (o *ListOfStoreActors) SetLimit(v int32) { - o.Limit = v -} - -// GetDesc returns the Desc field value -func (o *ListOfStoreActors) GetDesc() bool { - if o == nil { - var ret bool - return ret - } - - return o.Desc -} - -// GetDescOk returns a tuple with the Desc field value -// and a boolean to check if the value has been set. -func (o *ListOfStoreActors) GetDescOk() (*bool, bool) { - if o == nil { - return nil, false - } - return &o.Desc, true -} - -// SetDesc sets field value -func (o *ListOfStoreActors) SetDesc(v bool) { - o.Desc = v -} - -// GetCount returns the Count field value -func (o *ListOfStoreActors) GetCount() int32 { - if o == nil { - var ret int32 - return ret - } - - return o.Count -} - -// GetCountOk returns a tuple with the Count field value -// and a boolean to check if the value has been set. -func (o *ListOfStoreActors) GetCountOk() (*int32, bool) { - if o == nil { - return nil, false - } - return &o.Count, true -} - -// SetCount sets field value -func (o *ListOfStoreActors) SetCount(v int32) { - o.Count = v -} - -// GetItems returns the Items field value -func (o *ListOfStoreActors) GetItems() []StoreListActor { - if o == nil { - var ret []StoreListActor - return ret - } - - return o.Items -} - -// GetItemsOk returns a tuple with the Items field value -// and a boolean to check if the value has been set. -func (o *ListOfStoreActors) GetItemsOk() ([]StoreListActor, bool) { - if o == nil { - return nil, false - } - return o.Items, true -} - -// SetItems sets field value -func (o *ListOfStoreActors) SetItems(v []StoreListActor) { - o.Items = v -} - -func (o ListOfStoreActors) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o ListOfStoreActors) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["total"] = o.Total - toSerialize["offset"] = o.Offset - toSerialize["limit"] = o.Limit - toSerialize["desc"] = o.Desc - toSerialize["count"] = o.Count - toSerialize["items"] = o.Items - return toSerialize, nil -} - -func (o *ListOfStoreActors) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "total", - "offset", - "limit", - "desc", - "count", - "items", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err; - } - - for _, requiredProperty := range(requiredProperties) { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varListOfStoreActors := _ListOfStoreActors{} - - decoder := json.NewDecoder(bytes.NewReader(data)) - decoder.DisallowUnknownFields() - err = decoder.Decode(&varListOfStoreActors) - - if err != nil { - return err - } - - *o = ListOfStoreActors(varListOfStoreActors) - - return err -} - -type NullableListOfStoreActors struct { - value *ListOfStoreActors - isSet bool -} - -func (v NullableListOfStoreActors) Get() *ListOfStoreActors { - return v.value -} - -func (v *NullableListOfStoreActors) Set(val *ListOfStoreActors) { - v.value = val - v.isSet = true -} - -func (v NullableListOfStoreActors) IsSet() bool { - return v.isSet -} - -func (v *NullableListOfStoreActors) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableListOfStoreActors(val *ListOfStoreActors) *NullableListOfStoreActors { - return &NullableListOfStoreActors{value: val, isSet: true} -} - -func (v NullableListOfStoreActors) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableListOfStoreActors) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_list_of_tasks.go b/model_list_of_tasks.go deleted file mode 100644 index 379bfd9..0000000 --- a/model_list_of_tasks.go +++ /dev/null @@ -1,303 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" - "bytes" - "fmt" -) - -// checks if the ListOfTasks type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &ListOfTasks{} - -// ListOfTasks struct for ListOfTasks -type ListOfTasks struct { - // The total number of items available across all pages. - Total int32 `json:"total"` - // The starting position for this page of results. - Offset int32 `json:"offset"` - // The maximum number of items returned per page. - Limit int32 `json:"limit"` - // Whether the results are sorted in descending order. - Desc bool `json:"desc"` - // The number of items returned in this response. - Count int32 `json:"count"` - Items []TaskShort `json:"items"` -} - -type _ListOfTasks ListOfTasks - -// NewListOfTasks instantiates a new ListOfTasks object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewListOfTasks(total int32, offset int32, limit int32, desc bool, count int32, items []TaskShort) *ListOfTasks { - this := ListOfTasks{} - this.Total = total - this.Offset = offset - this.Limit = limit - this.Desc = desc - this.Count = count - this.Items = items - return &this -} - -// NewListOfTasksWithDefaults instantiates a new ListOfTasks object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewListOfTasksWithDefaults() *ListOfTasks { - this := ListOfTasks{} - return &this -} - -// GetTotal returns the Total field value -func (o *ListOfTasks) GetTotal() int32 { - if o == nil { - var ret int32 - return ret - } - - return o.Total -} - -// GetTotalOk returns a tuple with the Total field value -// and a boolean to check if the value has been set. -func (o *ListOfTasks) GetTotalOk() (*int32, bool) { - if o == nil { - return nil, false - } - return &o.Total, true -} - -// SetTotal sets field value -func (o *ListOfTasks) SetTotal(v int32) { - o.Total = v -} - -// GetOffset returns the Offset field value -func (o *ListOfTasks) GetOffset() int32 { - if o == nil { - var ret int32 - return ret - } - - return o.Offset -} - -// GetOffsetOk returns a tuple with the Offset field value -// and a boolean to check if the value has been set. -func (o *ListOfTasks) GetOffsetOk() (*int32, bool) { - if o == nil { - return nil, false - } - return &o.Offset, true -} - -// SetOffset sets field value -func (o *ListOfTasks) SetOffset(v int32) { - o.Offset = v -} - -// GetLimit returns the Limit field value -func (o *ListOfTasks) GetLimit() int32 { - if o == nil { - var ret int32 - return ret - } - - return o.Limit -} - -// GetLimitOk returns a tuple with the Limit field value -// and a boolean to check if the value has been set. -func (o *ListOfTasks) GetLimitOk() (*int32, bool) { - if o == nil { - return nil, false - } - return &o.Limit, true -} - -// SetLimit sets field value -func (o *ListOfTasks) SetLimit(v int32) { - o.Limit = v -} - -// GetDesc returns the Desc field value -func (o *ListOfTasks) GetDesc() bool { - if o == nil { - var ret bool - return ret - } - - return o.Desc -} - -// GetDescOk returns a tuple with the Desc field value -// and a boolean to check if the value has been set. -func (o *ListOfTasks) GetDescOk() (*bool, bool) { - if o == nil { - return nil, false - } - return &o.Desc, true -} - -// SetDesc sets field value -func (o *ListOfTasks) SetDesc(v bool) { - o.Desc = v -} - -// GetCount returns the Count field value -func (o *ListOfTasks) GetCount() int32 { - if o == nil { - var ret int32 - return ret - } - - return o.Count -} - -// GetCountOk returns a tuple with the Count field value -// and a boolean to check if the value has been set. -func (o *ListOfTasks) GetCountOk() (*int32, bool) { - if o == nil { - return nil, false - } - return &o.Count, true -} - -// SetCount sets field value -func (o *ListOfTasks) SetCount(v int32) { - o.Count = v -} - -// GetItems returns the Items field value -func (o *ListOfTasks) GetItems() []TaskShort { - if o == nil { - var ret []TaskShort - return ret - } - - return o.Items -} - -// GetItemsOk returns a tuple with the Items field value -// and a boolean to check if the value has been set. -func (o *ListOfTasks) GetItemsOk() ([]TaskShort, bool) { - if o == nil { - return nil, false - } - return o.Items, true -} - -// SetItems sets field value -func (o *ListOfTasks) SetItems(v []TaskShort) { - o.Items = v -} - -func (o ListOfTasks) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o ListOfTasks) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["total"] = o.Total - toSerialize["offset"] = o.Offset - toSerialize["limit"] = o.Limit - toSerialize["desc"] = o.Desc - toSerialize["count"] = o.Count - toSerialize["items"] = o.Items - return toSerialize, nil -} - -func (o *ListOfTasks) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "total", - "offset", - "limit", - "desc", - "count", - "items", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err; - } - - for _, requiredProperty := range(requiredProperties) { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varListOfTasks := _ListOfTasks{} - - decoder := json.NewDecoder(bytes.NewReader(data)) - decoder.DisallowUnknownFields() - err = decoder.Decode(&varListOfTasks) - - if err != nil { - return err - } - - *o = ListOfTasks(varListOfTasks) - - return err -} - -type NullableListOfTasks struct { - value *ListOfTasks - isSet bool -} - -func (v NullableListOfTasks) Get() *ListOfTasks { - return v.value -} - -func (v *NullableListOfTasks) Set(val *ListOfTasks) { - v.value = val - v.isSet = true -} - -func (v NullableListOfTasks) IsSet() bool { - return v.isSet -} - -func (v *NullableListOfTasks) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableListOfTasks(val *ListOfTasks) *NullableListOfTasks { - return &NullableListOfTasks{value: val, isSet: true} -} - -func (v NullableListOfTasks) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableListOfTasks) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_list_of_tasks_response.go b/model_list_of_tasks_response.go deleted file mode 100644 index 0b299e0..0000000 --- a/model_list_of_tasks_response.go +++ /dev/null @@ -1,158 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" - "bytes" - "fmt" -) - -// checks if the ListOfTasksResponse type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &ListOfTasksResponse{} - -// ListOfTasksResponse struct for ListOfTasksResponse -type ListOfTasksResponse struct { - Data ListOfTasks `json:"data"` -} - -type _ListOfTasksResponse ListOfTasksResponse - -// NewListOfTasksResponse instantiates a new ListOfTasksResponse object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewListOfTasksResponse(data ListOfTasks) *ListOfTasksResponse { - this := ListOfTasksResponse{} - this.Data = data - return &this -} - -// NewListOfTasksResponseWithDefaults instantiates a new ListOfTasksResponse object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewListOfTasksResponseWithDefaults() *ListOfTasksResponse { - this := ListOfTasksResponse{} - return &this -} - -// GetData returns the Data field value -func (o *ListOfTasksResponse) GetData() ListOfTasks { - if o == nil { - var ret ListOfTasks - return ret - } - - return o.Data -} - -// GetDataOk returns a tuple with the Data field value -// and a boolean to check if the value has been set. -func (o *ListOfTasksResponse) GetDataOk() (*ListOfTasks, bool) { - if o == nil { - return nil, false - } - return &o.Data, true -} - -// SetData sets field value -func (o *ListOfTasksResponse) SetData(v ListOfTasks) { - o.Data = v -} - -func (o ListOfTasksResponse) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o ListOfTasksResponse) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["data"] = o.Data - return toSerialize, nil -} - -func (o *ListOfTasksResponse) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "data", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err; - } - - for _, requiredProperty := range(requiredProperties) { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varListOfTasksResponse := _ListOfTasksResponse{} - - decoder := json.NewDecoder(bytes.NewReader(data)) - decoder.DisallowUnknownFields() - err = decoder.Decode(&varListOfTasksResponse) - - if err != nil { - return err - } - - *o = ListOfTasksResponse(varListOfTasksResponse) - - return err -} - -type NullableListOfTasksResponse struct { - value *ListOfTasksResponse - isSet bool -} - -func (v NullableListOfTasksResponse) Get() *ListOfTasksResponse { - return v.value -} - -func (v *NullableListOfTasksResponse) Set(val *ListOfTasksResponse) { - v.value = val - v.isSet = true -} - -func (v NullableListOfTasksResponse) IsSet() bool { - return v.isSet -} - -func (v *NullableListOfTasksResponse) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableListOfTasksResponse(val *ListOfTasksResponse) *NullableListOfTasksResponse { - return &NullableListOfTasksResponse{value: val, isSet: true} -} - -func (v NullableListOfTasksResponse) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableListOfTasksResponse) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_list_of_versions.go b/model_list_of_versions.go deleted file mode 100644 index 18049b7..0000000 --- a/model_list_of_versions.go +++ /dev/null @@ -1,187 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" - "bytes" - "fmt" -) - -// checks if the ListOfVersions type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &ListOfVersions{} - -// ListOfVersions struct for ListOfVersions -type ListOfVersions struct { - Total int32 `json:"total"` - // - Items []Version `json:"items"` -} - -type _ListOfVersions ListOfVersions - -// NewListOfVersions instantiates a new ListOfVersions object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewListOfVersions(total int32, items []Version) *ListOfVersions { - this := ListOfVersions{} - this.Total = total - this.Items = items - return &this -} - -// NewListOfVersionsWithDefaults instantiates a new ListOfVersions object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewListOfVersionsWithDefaults() *ListOfVersions { - this := ListOfVersions{} - return &this -} - -// GetTotal returns the Total field value -func (o *ListOfVersions) GetTotal() int32 { - if o == nil { - var ret int32 - return ret - } - - return o.Total -} - -// GetTotalOk returns a tuple with the Total field value -// and a boolean to check if the value has been set. -func (o *ListOfVersions) GetTotalOk() (*int32, bool) { - if o == nil { - return nil, false - } - return &o.Total, true -} - -// SetTotal sets field value -func (o *ListOfVersions) SetTotal(v int32) { - o.Total = v -} - -// GetItems returns the Items field value -func (o *ListOfVersions) GetItems() []Version { - if o == nil { - var ret []Version - return ret - } - - return o.Items -} - -// GetItemsOk returns a tuple with the Items field value -// and a boolean to check if the value has been set. -func (o *ListOfVersions) GetItemsOk() ([]Version, bool) { - if o == nil { - return nil, false - } - return o.Items, true -} - -// SetItems sets field value -func (o *ListOfVersions) SetItems(v []Version) { - o.Items = v -} - -func (o ListOfVersions) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o ListOfVersions) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["total"] = o.Total - toSerialize["items"] = o.Items - return toSerialize, nil -} - -func (o *ListOfVersions) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "total", - "items", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err; - } - - for _, requiredProperty := range(requiredProperties) { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varListOfVersions := _ListOfVersions{} - - decoder := json.NewDecoder(bytes.NewReader(data)) - decoder.DisallowUnknownFields() - err = decoder.Decode(&varListOfVersions) - - if err != nil { - return err - } - - *o = ListOfVersions(varListOfVersions) - - return err -} - -type NullableListOfVersions struct { - value *ListOfVersions - isSet bool -} - -func (v NullableListOfVersions) Get() *ListOfVersions { - return v.value -} - -func (v *NullableListOfVersions) Set(val *ListOfVersions) { - v.value = val - v.isSet = true -} - -func (v NullableListOfVersions) IsSet() bool { - return v.isSet -} - -func (v *NullableListOfVersions) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableListOfVersions(val *ListOfVersions) *NullableListOfVersions { - return &NullableListOfVersions{value: val, isSet: true} -} - -func (v NullableListOfVersions) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableListOfVersions) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_list_of_versions_response.go b/model_list_of_versions_response.go deleted file mode 100644 index dc413d1..0000000 --- a/model_list_of_versions_response.go +++ /dev/null @@ -1,158 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" - "bytes" - "fmt" -) - -// checks if the ListOfVersionsResponse type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &ListOfVersionsResponse{} - -// ListOfVersionsResponse struct for ListOfVersionsResponse -type ListOfVersionsResponse struct { - Data ListOfVersions `json:"data"` -} - -type _ListOfVersionsResponse ListOfVersionsResponse - -// NewListOfVersionsResponse instantiates a new ListOfVersionsResponse object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewListOfVersionsResponse(data ListOfVersions) *ListOfVersionsResponse { - this := ListOfVersionsResponse{} - this.Data = data - return &this -} - -// NewListOfVersionsResponseWithDefaults instantiates a new ListOfVersionsResponse object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewListOfVersionsResponseWithDefaults() *ListOfVersionsResponse { - this := ListOfVersionsResponse{} - return &this -} - -// GetData returns the Data field value -func (o *ListOfVersionsResponse) GetData() ListOfVersions { - if o == nil { - var ret ListOfVersions - return ret - } - - return o.Data -} - -// GetDataOk returns a tuple with the Data field value -// and a boolean to check if the value has been set. -func (o *ListOfVersionsResponse) GetDataOk() (*ListOfVersions, bool) { - if o == nil { - return nil, false - } - return &o.Data, true -} - -// SetData sets field value -func (o *ListOfVersionsResponse) SetData(v ListOfVersions) { - o.Data = v -} - -func (o ListOfVersionsResponse) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o ListOfVersionsResponse) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["data"] = o.Data - return toSerialize, nil -} - -func (o *ListOfVersionsResponse) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "data", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err; - } - - for _, requiredProperty := range(requiredProperties) { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varListOfVersionsResponse := _ListOfVersionsResponse{} - - decoder := json.NewDecoder(bytes.NewReader(data)) - decoder.DisallowUnknownFields() - err = decoder.Decode(&varListOfVersionsResponse) - - if err != nil { - return err - } - - *o = ListOfVersionsResponse(varListOfVersionsResponse) - - return err -} - -type NullableListOfVersionsResponse struct { - value *ListOfVersionsResponse - isSet bool -} - -func (v NullableListOfVersionsResponse) Get() *ListOfVersionsResponse { - return v.value -} - -func (v *NullableListOfVersionsResponse) Set(val *ListOfVersionsResponse) { - v.value = val - v.isSet = true -} - -func (v NullableListOfVersionsResponse) IsSet() bool { - return v.isSet -} - -func (v *NullableListOfVersionsResponse) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableListOfVersionsResponse(val *ListOfVersionsResponse) *NullableListOfVersionsResponse { - return &NullableListOfVersionsResponse{value: val, isSet: true} -} - -func (v NullableListOfVersionsResponse) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableListOfVersionsResponse) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_list_of_webhook_dispatches.go b/model_list_of_webhook_dispatches.go deleted file mode 100644 index c8e7d9d..0000000 --- a/model_list_of_webhook_dispatches.go +++ /dev/null @@ -1,303 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" - "bytes" - "fmt" -) - -// checks if the ListOfWebhookDispatches type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &ListOfWebhookDispatches{} - -// ListOfWebhookDispatches struct for ListOfWebhookDispatches -type ListOfWebhookDispatches struct { - // The total number of items available across all pages. - Total int32 `json:"total"` - // The starting position for this page of results. - Offset int32 `json:"offset"` - // The maximum number of items returned per page. - Limit int32 `json:"limit"` - // Whether the results are sorted in descending order. - Desc bool `json:"desc"` - // The number of items returned in this response. - Count int32 `json:"count"` - Items []WebhookDispatch `json:"items"` -} - -type _ListOfWebhookDispatches ListOfWebhookDispatches - -// NewListOfWebhookDispatches instantiates a new ListOfWebhookDispatches object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewListOfWebhookDispatches(total int32, offset int32, limit int32, desc bool, count int32, items []WebhookDispatch) *ListOfWebhookDispatches { - this := ListOfWebhookDispatches{} - this.Total = total - this.Offset = offset - this.Limit = limit - this.Desc = desc - this.Count = count - this.Items = items - return &this -} - -// NewListOfWebhookDispatchesWithDefaults instantiates a new ListOfWebhookDispatches object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewListOfWebhookDispatchesWithDefaults() *ListOfWebhookDispatches { - this := ListOfWebhookDispatches{} - return &this -} - -// GetTotal returns the Total field value -func (o *ListOfWebhookDispatches) GetTotal() int32 { - if o == nil { - var ret int32 - return ret - } - - return o.Total -} - -// GetTotalOk returns a tuple with the Total field value -// and a boolean to check if the value has been set. -func (o *ListOfWebhookDispatches) GetTotalOk() (*int32, bool) { - if o == nil { - return nil, false - } - return &o.Total, true -} - -// SetTotal sets field value -func (o *ListOfWebhookDispatches) SetTotal(v int32) { - o.Total = v -} - -// GetOffset returns the Offset field value -func (o *ListOfWebhookDispatches) GetOffset() int32 { - if o == nil { - var ret int32 - return ret - } - - return o.Offset -} - -// GetOffsetOk returns a tuple with the Offset field value -// and a boolean to check if the value has been set. -func (o *ListOfWebhookDispatches) GetOffsetOk() (*int32, bool) { - if o == nil { - return nil, false - } - return &o.Offset, true -} - -// SetOffset sets field value -func (o *ListOfWebhookDispatches) SetOffset(v int32) { - o.Offset = v -} - -// GetLimit returns the Limit field value -func (o *ListOfWebhookDispatches) GetLimit() int32 { - if o == nil { - var ret int32 - return ret - } - - return o.Limit -} - -// GetLimitOk returns a tuple with the Limit field value -// and a boolean to check if the value has been set. -func (o *ListOfWebhookDispatches) GetLimitOk() (*int32, bool) { - if o == nil { - return nil, false - } - return &o.Limit, true -} - -// SetLimit sets field value -func (o *ListOfWebhookDispatches) SetLimit(v int32) { - o.Limit = v -} - -// GetDesc returns the Desc field value -func (o *ListOfWebhookDispatches) GetDesc() bool { - if o == nil { - var ret bool - return ret - } - - return o.Desc -} - -// GetDescOk returns a tuple with the Desc field value -// and a boolean to check if the value has been set. -func (o *ListOfWebhookDispatches) GetDescOk() (*bool, bool) { - if o == nil { - return nil, false - } - return &o.Desc, true -} - -// SetDesc sets field value -func (o *ListOfWebhookDispatches) SetDesc(v bool) { - o.Desc = v -} - -// GetCount returns the Count field value -func (o *ListOfWebhookDispatches) GetCount() int32 { - if o == nil { - var ret int32 - return ret - } - - return o.Count -} - -// GetCountOk returns a tuple with the Count field value -// and a boolean to check if the value has been set. -func (o *ListOfWebhookDispatches) GetCountOk() (*int32, bool) { - if o == nil { - return nil, false - } - return &o.Count, true -} - -// SetCount sets field value -func (o *ListOfWebhookDispatches) SetCount(v int32) { - o.Count = v -} - -// GetItems returns the Items field value -func (o *ListOfWebhookDispatches) GetItems() []WebhookDispatch { - if o == nil { - var ret []WebhookDispatch - return ret - } - - return o.Items -} - -// GetItemsOk returns a tuple with the Items field value -// and a boolean to check if the value has been set. -func (o *ListOfWebhookDispatches) GetItemsOk() ([]WebhookDispatch, bool) { - if o == nil { - return nil, false - } - return o.Items, true -} - -// SetItems sets field value -func (o *ListOfWebhookDispatches) SetItems(v []WebhookDispatch) { - o.Items = v -} - -func (o ListOfWebhookDispatches) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o ListOfWebhookDispatches) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["total"] = o.Total - toSerialize["offset"] = o.Offset - toSerialize["limit"] = o.Limit - toSerialize["desc"] = o.Desc - toSerialize["count"] = o.Count - toSerialize["items"] = o.Items - return toSerialize, nil -} - -func (o *ListOfWebhookDispatches) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "total", - "offset", - "limit", - "desc", - "count", - "items", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err; - } - - for _, requiredProperty := range(requiredProperties) { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varListOfWebhookDispatches := _ListOfWebhookDispatches{} - - decoder := json.NewDecoder(bytes.NewReader(data)) - decoder.DisallowUnknownFields() - err = decoder.Decode(&varListOfWebhookDispatches) - - if err != nil { - return err - } - - *o = ListOfWebhookDispatches(varListOfWebhookDispatches) - - return err -} - -type NullableListOfWebhookDispatches struct { - value *ListOfWebhookDispatches - isSet bool -} - -func (v NullableListOfWebhookDispatches) Get() *ListOfWebhookDispatches { - return v.value -} - -func (v *NullableListOfWebhookDispatches) Set(val *ListOfWebhookDispatches) { - v.value = val - v.isSet = true -} - -func (v NullableListOfWebhookDispatches) IsSet() bool { - return v.isSet -} - -func (v *NullableListOfWebhookDispatches) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableListOfWebhookDispatches(val *ListOfWebhookDispatches) *NullableListOfWebhookDispatches { - return &NullableListOfWebhookDispatches{value: val, isSet: true} -} - -func (v NullableListOfWebhookDispatches) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableListOfWebhookDispatches) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_list_of_webhook_dispatches_response.go b/model_list_of_webhook_dispatches_response.go deleted file mode 100644 index 336a2b4..0000000 --- a/model_list_of_webhook_dispatches_response.go +++ /dev/null @@ -1,158 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" - "bytes" - "fmt" -) - -// checks if the ListOfWebhookDispatchesResponse type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &ListOfWebhookDispatchesResponse{} - -// ListOfWebhookDispatchesResponse struct for ListOfWebhookDispatchesResponse -type ListOfWebhookDispatchesResponse struct { - Data ListOfWebhookDispatches `json:"data"` -} - -type _ListOfWebhookDispatchesResponse ListOfWebhookDispatchesResponse - -// NewListOfWebhookDispatchesResponse instantiates a new ListOfWebhookDispatchesResponse object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewListOfWebhookDispatchesResponse(data ListOfWebhookDispatches) *ListOfWebhookDispatchesResponse { - this := ListOfWebhookDispatchesResponse{} - this.Data = data - return &this -} - -// NewListOfWebhookDispatchesResponseWithDefaults instantiates a new ListOfWebhookDispatchesResponse object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewListOfWebhookDispatchesResponseWithDefaults() *ListOfWebhookDispatchesResponse { - this := ListOfWebhookDispatchesResponse{} - return &this -} - -// GetData returns the Data field value -func (o *ListOfWebhookDispatchesResponse) GetData() ListOfWebhookDispatches { - if o == nil { - var ret ListOfWebhookDispatches - return ret - } - - return o.Data -} - -// GetDataOk returns a tuple with the Data field value -// and a boolean to check if the value has been set. -func (o *ListOfWebhookDispatchesResponse) GetDataOk() (*ListOfWebhookDispatches, bool) { - if o == nil { - return nil, false - } - return &o.Data, true -} - -// SetData sets field value -func (o *ListOfWebhookDispatchesResponse) SetData(v ListOfWebhookDispatches) { - o.Data = v -} - -func (o ListOfWebhookDispatchesResponse) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o ListOfWebhookDispatchesResponse) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["data"] = o.Data - return toSerialize, nil -} - -func (o *ListOfWebhookDispatchesResponse) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "data", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err; - } - - for _, requiredProperty := range(requiredProperties) { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varListOfWebhookDispatchesResponse := _ListOfWebhookDispatchesResponse{} - - decoder := json.NewDecoder(bytes.NewReader(data)) - decoder.DisallowUnknownFields() - err = decoder.Decode(&varListOfWebhookDispatchesResponse) - - if err != nil { - return err - } - - *o = ListOfWebhookDispatchesResponse(varListOfWebhookDispatchesResponse) - - return err -} - -type NullableListOfWebhookDispatchesResponse struct { - value *ListOfWebhookDispatchesResponse - isSet bool -} - -func (v NullableListOfWebhookDispatchesResponse) Get() *ListOfWebhookDispatchesResponse { - return v.value -} - -func (v *NullableListOfWebhookDispatchesResponse) Set(val *ListOfWebhookDispatchesResponse) { - v.value = val - v.isSet = true -} - -func (v NullableListOfWebhookDispatchesResponse) IsSet() bool { - return v.isSet -} - -func (v *NullableListOfWebhookDispatchesResponse) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableListOfWebhookDispatchesResponse(val *ListOfWebhookDispatchesResponse) *NullableListOfWebhookDispatchesResponse { - return &NullableListOfWebhookDispatchesResponse{value: val, isSet: true} -} - -func (v NullableListOfWebhookDispatchesResponse) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableListOfWebhookDispatchesResponse) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_list_of_webhooks.go b/model_list_of_webhooks.go deleted file mode 100644 index b293139..0000000 --- a/model_list_of_webhooks.go +++ /dev/null @@ -1,303 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" - "bytes" - "fmt" -) - -// checks if the ListOfWebhooks type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &ListOfWebhooks{} - -// ListOfWebhooks struct for ListOfWebhooks -type ListOfWebhooks struct { - // The total number of items available across all pages. - Total int32 `json:"total"` - // The starting position for this page of results. - Offset int32 `json:"offset"` - // The maximum number of items returned per page. - Limit int32 `json:"limit"` - // Whether the results are sorted in descending order. - Desc bool `json:"desc"` - // The number of items returned in this response. - Count int32 `json:"count"` - Items []WebhookShort `json:"items"` -} - -type _ListOfWebhooks ListOfWebhooks - -// NewListOfWebhooks instantiates a new ListOfWebhooks object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewListOfWebhooks(total int32, offset int32, limit int32, desc bool, count int32, items []WebhookShort) *ListOfWebhooks { - this := ListOfWebhooks{} - this.Total = total - this.Offset = offset - this.Limit = limit - this.Desc = desc - this.Count = count - this.Items = items - return &this -} - -// NewListOfWebhooksWithDefaults instantiates a new ListOfWebhooks object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewListOfWebhooksWithDefaults() *ListOfWebhooks { - this := ListOfWebhooks{} - return &this -} - -// GetTotal returns the Total field value -func (o *ListOfWebhooks) GetTotal() int32 { - if o == nil { - var ret int32 - return ret - } - - return o.Total -} - -// GetTotalOk returns a tuple with the Total field value -// and a boolean to check if the value has been set. -func (o *ListOfWebhooks) GetTotalOk() (*int32, bool) { - if o == nil { - return nil, false - } - return &o.Total, true -} - -// SetTotal sets field value -func (o *ListOfWebhooks) SetTotal(v int32) { - o.Total = v -} - -// GetOffset returns the Offset field value -func (o *ListOfWebhooks) GetOffset() int32 { - if o == nil { - var ret int32 - return ret - } - - return o.Offset -} - -// GetOffsetOk returns a tuple with the Offset field value -// and a boolean to check if the value has been set. -func (o *ListOfWebhooks) GetOffsetOk() (*int32, bool) { - if o == nil { - return nil, false - } - return &o.Offset, true -} - -// SetOffset sets field value -func (o *ListOfWebhooks) SetOffset(v int32) { - o.Offset = v -} - -// GetLimit returns the Limit field value -func (o *ListOfWebhooks) GetLimit() int32 { - if o == nil { - var ret int32 - return ret - } - - return o.Limit -} - -// GetLimitOk returns a tuple with the Limit field value -// and a boolean to check if the value has been set. -func (o *ListOfWebhooks) GetLimitOk() (*int32, bool) { - if o == nil { - return nil, false - } - return &o.Limit, true -} - -// SetLimit sets field value -func (o *ListOfWebhooks) SetLimit(v int32) { - o.Limit = v -} - -// GetDesc returns the Desc field value -func (o *ListOfWebhooks) GetDesc() bool { - if o == nil { - var ret bool - return ret - } - - return o.Desc -} - -// GetDescOk returns a tuple with the Desc field value -// and a boolean to check if the value has been set. -func (o *ListOfWebhooks) GetDescOk() (*bool, bool) { - if o == nil { - return nil, false - } - return &o.Desc, true -} - -// SetDesc sets field value -func (o *ListOfWebhooks) SetDesc(v bool) { - o.Desc = v -} - -// GetCount returns the Count field value -func (o *ListOfWebhooks) GetCount() int32 { - if o == nil { - var ret int32 - return ret - } - - return o.Count -} - -// GetCountOk returns a tuple with the Count field value -// and a boolean to check if the value has been set. -func (o *ListOfWebhooks) GetCountOk() (*int32, bool) { - if o == nil { - return nil, false - } - return &o.Count, true -} - -// SetCount sets field value -func (o *ListOfWebhooks) SetCount(v int32) { - o.Count = v -} - -// GetItems returns the Items field value -func (o *ListOfWebhooks) GetItems() []WebhookShort { - if o == nil { - var ret []WebhookShort - return ret - } - - return o.Items -} - -// GetItemsOk returns a tuple with the Items field value -// and a boolean to check if the value has been set. -func (o *ListOfWebhooks) GetItemsOk() ([]WebhookShort, bool) { - if o == nil { - return nil, false - } - return o.Items, true -} - -// SetItems sets field value -func (o *ListOfWebhooks) SetItems(v []WebhookShort) { - o.Items = v -} - -func (o ListOfWebhooks) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o ListOfWebhooks) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["total"] = o.Total - toSerialize["offset"] = o.Offset - toSerialize["limit"] = o.Limit - toSerialize["desc"] = o.Desc - toSerialize["count"] = o.Count - toSerialize["items"] = o.Items - return toSerialize, nil -} - -func (o *ListOfWebhooks) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "total", - "offset", - "limit", - "desc", - "count", - "items", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err; - } - - for _, requiredProperty := range(requiredProperties) { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varListOfWebhooks := _ListOfWebhooks{} - - decoder := json.NewDecoder(bytes.NewReader(data)) - decoder.DisallowUnknownFields() - err = decoder.Decode(&varListOfWebhooks) - - if err != nil { - return err - } - - *o = ListOfWebhooks(varListOfWebhooks) - - return err -} - -type NullableListOfWebhooks struct { - value *ListOfWebhooks - isSet bool -} - -func (v NullableListOfWebhooks) Get() *ListOfWebhooks { - return v.value -} - -func (v *NullableListOfWebhooks) Set(val *ListOfWebhooks) { - v.value = val - v.isSet = true -} - -func (v NullableListOfWebhooks) IsSet() bool { - return v.isSet -} - -func (v *NullableListOfWebhooks) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableListOfWebhooks(val *ListOfWebhooks) *NullableListOfWebhooks { - return &NullableListOfWebhooks{value: val, isSet: true} -} - -func (v NullableListOfWebhooks) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableListOfWebhooks) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_list_of_webhooks_response.go b/model_list_of_webhooks_response.go deleted file mode 100644 index bbebf66..0000000 --- a/model_list_of_webhooks_response.go +++ /dev/null @@ -1,158 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" - "bytes" - "fmt" -) - -// checks if the ListOfWebhooksResponse type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &ListOfWebhooksResponse{} - -// ListOfWebhooksResponse struct for ListOfWebhooksResponse -type ListOfWebhooksResponse struct { - Data ListOfWebhooks `json:"data"` -} - -type _ListOfWebhooksResponse ListOfWebhooksResponse - -// NewListOfWebhooksResponse instantiates a new ListOfWebhooksResponse object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewListOfWebhooksResponse(data ListOfWebhooks) *ListOfWebhooksResponse { - this := ListOfWebhooksResponse{} - this.Data = data - return &this -} - -// NewListOfWebhooksResponseWithDefaults instantiates a new ListOfWebhooksResponse object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewListOfWebhooksResponseWithDefaults() *ListOfWebhooksResponse { - this := ListOfWebhooksResponse{} - return &this -} - -// GetData returns the Data field value -func (o *ListOfWebhooksResponse) GetData() ListOfWebhooks { - if o == nil { - var ret ListOfWebhooks - return ret - } - - return o.Data -} - -// GetDataOk returns a tuple with the Data field value -// and a boolean to check if the value has been set. -func (o *ListOfWebhooksResponse) GetDataOk() (*ListOfWebhooks, bool) { - if o == nil { - return nil, false - } - return &o.Data, true -} - -// SetData sets field value -func (o *ListOfWebhooksResponse) SetData(v ListOfWebhooks) { - o.Data = v -} - -func (o ListOfWebhooksResponse) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o ListOfWebhooksResponse) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["data"] = o.Data - return toSerialize, nil -} - -func (o *ListOfWebhooksResponse) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "data", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err; - } - - for _, requiredProperty := range(requiredProperties) { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varListOfWebhooksResponse := _ListOfWebhooksResponse{} - - decoder := json.NewDecoder(bytes.NewReader(data)) - decoder.DisallowUnknownFields() - err = decoder.Decode(&varListOfWebhooksResponse) - - if err != nil { - return err - } - - *o = ListOfWebhooksResponse(varListOfWebhooksResponse) - - return err -} - -type NullableListOfWebhooksResponse struct { - value *ListOfWebhooksResponse - isSet bool -} - -func (v NullableListOfWebhooksResponse) Get() *ListOfWebhooksResponse { - return v.value -} - -func (v *NullableListOfWebhooksResponse) Set(val *ListOfWebhooksResponse) { - v.value = val - v.isSet = true -} - -func (v NullableListOfWebhooksResponse) IsSet() bool { - return v.isSet -} - -func (v *NullableListOfWebhooksResponse) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableListOfWebhooksResponse(val *ListOfWebhooksResponse) *NullableListOfWebhooksResponse { - return &NullableListOfWebhooksResponse{value: val, isSet: true} -} - -func (v NullableListOfWebhooksResponse) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableListOfWebhooksResponse) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_locked_head_request.go b/model_locked_head_request.go deleted file mode 100644 index 3425faa..0000000 --- a/model_locked_head_request.go +++ /dev/null @@ -1,320 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" - "time" - "bytes" - "fmt" -) - -// checks if the LockedHeadRequest type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &LockedHeadRequest{} - -// LockedHeadRequest A request from the request queue head that has been locked for processing. -type LockedHeadRequest struct { - // A unique identifier assigned to the request. - Id string `json:"id"` - // A unique key used for request de-duplication. Requests with the same unique key are considered identical. - UniqueKey string `json:"uniqueKey"` - // The URL of the request. - Url string `json:"url"` - Method *HttpMethod `json:"method,omitempty"` - // The number of times this request has been retried. - RetryCount *int32 `json:"retryCount,omitempty"` - // The timestamp when the lock on this request expires. - LockExpiresAt time.Time `json:"lockExpiresAt"` -} - -type _LockedHeadRequest LockedHeadRequest - -// NewLockedHeadRequest instantiates a new LockedHeadRequest object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewLockedHeadRequest(id string, uniqueKey string, url string, lockExpiresAt time.Time) *LockedHeadRequest { - this := LockedHeadRequest{} - this.Id = id - this.UniqueKey = uniqueKey - this.Url = url - this.LockExpiresAt = lockExpiresAt - return &this -} - -// NewLockedHeadRequestWithDefaults instantiates a new LockedHeadRequest object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewLockedHeadRequestWithDefaults() *LockedHeadRequest { - this := LockedHeadRequest{} - return &this -} - -// GetId returns the Id field value -func (o *LockedHeadRequest) GetId() string { - if o == nil { - var ret string - return ret - } - - return o.Id -} - -// GetIdOk returns a tuple with the Id field value -// and a boolean to check if the value has been set. -func (o *LockedHeadRequest) GetIdOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Id, true -} - -// SetId sets field value -func (o *LockedHeadRequest) SetId(v string) { - o.Id = v -} - -// GetUniqueKey returns the UniqueKey field value -func (o *LockedHeadRequest) GetUniqueKey() string { - if o == nil { - var ret string - return ret - } - - return o.UniqueKey -} - -// GetUniqueKeyOk returns a tuple with the UniqueKey field value -// and a boolean to check if the value has been set. -func (o *LockedHeadRequest) GetUniqueKeyOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.UniqueKey, true -} - -// SetUniqueKey sets field value -func (o *LockedHeadRequest) SetUniqueKey(v string) { - o.UniqueKey = v -} - -// GetUrl returns the Url field value -func (o *LockedHeadRequest) GetUrl() string { - if o == nil { - var ret string - return ret - } - - return o.Url -} - -// GetUrlOk returns a tuple with the Url field value -// and a boolean to check if the value has been set. -func (o *LockedHeadRequest) GetUrlOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Url, true -} - -// SetUrl sets field value -func (o *LockedHeadRequest) SetUrl(v string) { - o.Url = v -} - -// GetMethod returns the Method field value if set, zero value otherwise. -func (o *LockedHeadRequest) GetMethod() HttpMethod { - if o == nil || IsNil(o.Method) { - var ret HttpMethod - return ret - } - return *o.Method -} - -// GetMethodOk returns a tuple with the Method field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *LockedHeadRequest) GetMethodOk() (*HttpMethod, bool) { - if o == nil || IsNil(o.Method) { - return nil, false - } - return o.Method, true -} - -// HasMethod returns a boolean if a field has been set. -func (o *LockedHeadRequest) HasMethod() bool { - if o != nil && !IsNil(o.Method) { - return true - } - - return false -} - -// SetMethod gets a reference to the given HttpMethod and assigns it to the Method field. -func (o *LockedHeadRequest) SetMethod(v HttpMethod) { - o.Method = &v -} - -// GetRetryCount returns the RetryCount field value if set, zero value otherwise. -func (o *LockedHeadRequest) GetRetryCount() int32 { - if o == nil || IsNil(o.RetryCount) { - var ret int32 - return ret - } - return *o.RetryCount -} - -// GetRetryCountOk returns a tuple with the RetryCount field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *LockedHeadRequest) GetRetryCountOk() (*int32, bool) { - if o == nil || IsNil(o.RetryCount) { - return nil, false - } - return o.RetryCount, true -} - -// HasRetryCount returns a boolean if a field has been set. -func (o *LockedHeadRequest) HasRetryCount() bool { - if o != nil && !IsNil(o.RetryCount) { - return true - } - - return false -} - -// SetRetryCount gets a reference to the given int32 and assigns it to the RetryCount field. -func (o *LockedHeadRequest) SetRetryCount(v int32) { - o.RetryCount = &v -} - -// GetLockExpiresAt returns the LockExpiresAt field value -func (o *LockedHeadRequest) GetLockExpiresAt() time.Time { - if o == nil { - var ret time.Time - return ret - } - - return o.LockExpiresAt -} - -// GetLockExpiresAtOk returns a tuple with the LockExpiresAt field value -// and a boolean to check if the value has been set. -func (o *LockedHeadRequest) GetLockExpiresAtOk() (*time.Time, bool) { - if o == nil { - return nil, false - } - return &o.LockExpiresAt, true -} - -// SetLockExpiresAt sets field value -func (o *LockedHeadRequest) SetLockExpiresAt(v time.Time) { - o.LockExpiresAt = v -} - -func (o LockedHeadRequest) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o LockedHeadRequest) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["id"] = o.Id - toSerialize["uniqueKey"] = o.UniqueKey - toSerialize["url"] = o.Url - if !IsNil(o.Method) { - toSerialize["method"] = o.Method - } - if !IsNil(o.RetryCount) { - toSerialize["retryCount"] = o.RetryCount - } - toSerialize["lockExpiresAt"] = o.LockExpiresAt - return toSerialize, nil -} - -func (o *LockedHeadRequest) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "id", - "uniqueKey", - "url", - "lockExpiresAt", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err; - } - - for _, requiredProperty := range(requiredProperties) { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varLockedHeadRequest := _LockedHeadRequest{} - - decoder := json.NewDecoder(bytes.NewReader(data)) - decoder.DisallowUnknownFields() - err = decoder.Decode(&varLockedHeadRequest) - - if err != nil { - return err - } - - *o = LockedHeadRequest(varLockedHeadRequest) - - return err -} - -type NullableLockedHeadRequest struct { - value *LockedHeadRequest - isSet bool -} - -func (v NullableLockedHeadRequest) Get() *LockedHeadRequest { - return v.value -} - -func (v *NullableLockedHeadRequest) Set(val *LockedHeadRequest) { - v.value = val - v.isSet = true -} - -func (v NullableLockedHeadRequest) IsSet() bool { - return v.isSet -} - -func (v *NullableLockedHeadRequest) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableLockedHeadRequest(val *LockedHeadRequest) *NullableLockedHeadRequest { - return &NullableLockedHeadRequest{value: val, isSet: true} -} - -func (v NullableLockedHeadRequest) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableLockedHeadRequest) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_locked_request_queue_head.go b/model_locked_request_queue_head.go deleted file mode 100644 index e7d3df9..0000000 --- a/model_locked_request_queue_head.go +++ /dev/null @@ -1,350 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" - "time" - "bytes" - "fmt" -) - -// checks if the LockedRequestQueueHead type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &LockedRequestQueueHead{} - -// LockedRequestQueueHead A batch of locked requests from the request queue head. -type LockedRequestQueueHead struct { - // The maximum number of requests returned. - Limit int32 `json:"limit"` - // The timestamp when the request queue was last modified. Modifications include adding, updating, or removing requests, as well as locking or unlocking requests in the request queue. - QueueModifiedAt time.Time `json:"queueModifiedAt"` - // Whether the request queue contains requests locked by any client (either the one calling the endpoint or a different one). - QueueHasLockedRequests *bool `json:"queueHasLockedRequests,omitempty"` - // The client key used for locking the requests. - ClientKey *string `json:"clientKey,omitempty"` - // Whether the request queue has been accessed by multiple different clients. - HadMultipleClients bool `json:"hadMultipleClients"` - // The number of seconds the locks will be held. - LockSecs int32 `json:"lockSecs"` - // The array of locked requests from the request queue head. - Items []LockedHeadRequest `json:"items"` -} - -type _LockedRequestQueueHead LockedRequestQueueHead - -// NewLockedRequestQueueHead instantiates a new LockedRequestQueueHead object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewLockedRequestQueueHead(limit int32, queueModifiedAt time.Time, hadMultipleClients bool, lockSecs int32, items []LockedHeadRequest) *LockedRequestQueueHead { - this := LockedRequestQueueHead{} - this.Limit = limit - this.QueueModifiedAt = queueModifiedAt - this.HadMultipleClients = hadMultipleClients - this.LockSecs = lockSecs - this.Items = items - return &this -} - -// NewLockedRequestQueueHeadWithDefaults instantiates a new LockedRequestQueueHead object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewLockedRequestQueueHeadWithDefaults() *LockedRequestQueueHead { - this := LockedRequestQueueHead{} - return &this -} - -// GetLimit returns the Limit field value -func (o *LockedRequestQueueHead) GetLimit() int32 { - if o == nil { - var ret int32 - return ret - } - - return o.Limit -} - -// GetLimitOk returns a tuple with the Limit field value -// and a boolean to check if the value has been set. -func (o *LockedRequestQueueHead) GetLimitOk() (*int32, bool) { - if o == nil { - return nil, false - } - return &o.Limit, true -} - -// SetLimit sets field value -func (o *LockedRequestQueueHead) SetLimit(v int32) { - o.Limit = v -} - -// GetQueueModifiedAt returns the QueueModifiedAt field value -func (o *LockedRequestQueueHead) GetQueueModifiedAt() time.Time { - if o == nil { - var ret time.Time - return ret - } - - return o.QueueModifiedAt -} - -// GetQueueModifiedAtOk returns a tuple with the QueueModifiedAt field value -// and a boolean to check if the value has been set. -func (o *LockedRequestQueueHead) GetQueueModifiedAtOk() (*time.Time, bool) { - if o == nil { - return nil, false - } - return &o.QueueModifiedAt, true -} - -// SetQueueModifiedAt sets field value -func (o *LockedRequestQueueHead) SetQueueModifiedAt(v time.Time) { - o.QueueModifiedAt = v -} - -// GetQueueHasLockedRequests returns the QueueHasLockedRequests field value if set, zero value otherwise. -func (o *LockedRequestQueueHead) GetQueueHasLockedRequests() bool { - if o == nil || IsNil(o.QueueHasLockedRequests) { - var ret bool - return ret - } - return *o.QueueHasLockedRequests -} - -// GetQueueHasLockedRequestsOk returns a tuple with the QueueHasLockedRequests field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *LockedRequestQueueHead) GetQueueHasLockedRequestsOk() (*bool, bool) { - if o == nil || IsNil(o.QueueHasLockedRequests) { - return nil, false - } - return o.QueueHasLockedRequests, true -} - -// HasQueueHasLockedRequests returns a boolean if a field has been set. -func (o *LockedRequestQueueHead) HasQueueHasLockedRequests() bool { - if o != nil && !IsNil(o.QueueHasLockedRequests) { - return true - } - - return false -} - -// SetQueueHasLockedRequests gets a reference to the given bool and assigns it to the QueueHasLockedRequests field. -func (o *LockedRequestQueueHead) SetQueueHasLockedRequests(v bool) { - o.QueueHasLockedRequests = &v -} - -// GetClientKey returns the ClientKey field value if set, zero value otherwise. -func (o *LockedRequestQueueHead) GetClientKey() string { - if o == nil || IsNil(o.ClientKey) { - var ret string - return ret - } - return *o.ClientKey -} - -// GetClientKeyOk returns a tuple with the ClientKey field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *LockedRequestQueueHead) GetClientKeyOk() (*string, bool) { - if o == nil || IsNil(o.ClientKey) { - return nil, false - } - return o.ClientKey, true -} - -// HasClientKey returns a boolean if a field has been set. -func (o *LockedRequestQueueHead) HasClientKey() bool { - if o != nil && !IsNil(o.ClientKey) { - return true - } - - return false -} - -// SetClientKey gets a reference to the given string and assigns it to the ClientKey field. -func (o *LockedRequestQueueHead) SetClientKey(v string) { - o.ClientKey = &v -} - -// GetHadMultipleClients returns the HadMultipleClients field value -func (o *LockedRequestQueueHead) GetHadMultipleClients() bool { - if o == nil { - var ret bool - return ret - } - - return o.HadMultipleClients -} - -// GetHadMultipleClientsOk returns a tuple with the HadMultipleClients field value -// and a boolean to check if the value has been set. -func (o *LockedRequestQueueHead) GetHadMultipleClientsOk() (*bool, bool) { - if o == nil { - return nil, false - } - return &o.HadMultipleClients, true -} - -// SetHadMultipleClients sets field value -func (o *LockedRequestQueueHead) SetHadMultipleClients(v bool) { - o.HadMultipleClients = v -} - -// GetLockSecs returns the LockSecs field value -func (o *LockedRequestQueueHead) GetLockSecs() int32 { - if o == nil { - var ret int32 - return ret - } - - return o.LockSecs -} - -// GetLockSecsOk returns a tuple with the LockSecs field value -// and a boolean to check if the value has been set. -func (o *LockedRequestQueueHead) GetLockSecsOk() (*int32, bool) { - if o == nil { - return nil, false - } - return &o.LockSecs, true -} - -// SetLockSecs sets field value -func (o *LockedRequestQueueHead) SetLockSecs(v int32) { - o.LockSecs = v -} - -// GetItems returns the Items field value -func (o *LockedRequestQueueHead) GetItems() []LockedHeadRequest { - if o == nil { - var ret []LockedHeadRequest - return ret - } - - return o.Items -} - -// GetItemsOk returns a tuple with the Items field value -// and a boolean to check if the value has been set. -func (o *LockedRequestQueueHead) GetItemsOk() ([]LockedHeadRequest, bool) { - if o == nil { - return nil, false - } - return o.Items, true -} - -// SetItems sets field value -func (o *LockedRequestQueueHead) SetItems(v []LockedHeadRequest) { - o.Items = v -} - -func (o LockedRequestQueueHead) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o LockedRequestQueueHead) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["limit"] = o.Limit - toSerialize["queueModifiedAt"] = o.QueueModifiedAt - if !IsNil(o.QueueHasLockedRequests) { - toSerialize["queueHasLockedRequests"] = o.QueueHasLockedRequests - } - if !IsNil(o.ClientKey) { - toSerialize["clientKey"] = o.ClientKey - } - toSerialize["hadMultipleClients"] = o.HadMultipleClients - toSerialize["lockSecs"] = o.LockSecs - toSerialize["items"] = o.Items - return toSerialize, nil -} - -func (o *LockedRequestQueueHead) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "limit", - "queueModifiedAt", - "hadMultipleClients", - "lockSecs", - "items", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err; - } - - for _, requiredProperty := range(requiredProperties) { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varLockedRequestQueueHead := _LockedRequestQueueHead{} - - decoder := json.NewDecoder(bytes.NewReader(data)) - decoder.DisallowUnknownFields() - err = decoder.Decode(&varLockedRequestQueueHead) - - if err != nil { - return err - } - - *o = LockedRequestQueueHead(varLockedRequestQueueHead) - - return err -} - -type NullableLockedRequestQueueHead struct { - value *LockedRequestQueueHead - isSet bool -} - -func (v NullableLockedRequestQueueHead) Get() *LockedRequestQueueHead { - return v.value -} - -func (v *NullableLockedRequestQueueHead) Set(val *LockedRequestQueueHead) { - v.value = val - v.isSet = true -} - -func (v NullableLockedRequestQueueHead) IsSet() bool { - return v.isSet -} - -func (v *NullableLockedRequestQueueHead) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableLockedRequestQueueHead(val *LockedRequestQueueHead) *NullableLockedRequestQueueHead { - return &NullableLockedRequestQueueHead{value: val, isSet: true} -} - -func (v NullableLockedRequestQueueHead) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableLockedRequestQueueHead) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_metamorph.go b/model_metamorph.go deleted file mode 100644 index f4f7bfe..0000000 --- a/model_metamorph.go +++ /dev/null @@ -1,265 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" - "time" - "bytes" - "fmt" -) - -// checks if the Metamorph type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &Metamorph{} - -// Metamorph Information about a metamorph event that occurred during the run. -type Metamorph struct { - // Time when the metamorph occurred. - CreatedAt time.Time `json:"createdAt"` - // ID of the Actor that the run was metamorphed to. - ActorId string `json:"actorId"` - // ID of the build used for the metamorphed Actor. - BuildId string `json:"buildId"` - // Key of the input record in the key-value store. - InputKey NullableString `json:"inputKey,omitempty"` -} - -type _Metamorph Metamorph - -// NewMetamorph instantiates a new Metamorph object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewMetamorph(createdAt time.Time, actorId string, buildId string) *Metamorph { - this := Metamorph{} - this.CreatedAt = createdAt - this.ActorId = actorId - this.BuildId = buildId - return &this -} - -// NewMetamorphWithDefaults instantiates a new Metamorph object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewMetamorphWithDefaults() *Metamorph { - this := Metamorph{} - return &this -} - -// GetCreatedAt returns the CreatedAt field value -func (o *Metamorph) GetCreatedAt() time.Time { - if o == nil { - var ret time.Time - return ret - } - - return o.CreatedAt -} - -// GetCreatedAtOk returns a tuple with the CreatedAt field value -// and a boolean to check if the value has been set. -func (o *Metamorph) GetCreatedAtOk() (*time.Time, bool) { - if o == nil { - return nil, false - } - return &o.CreatedAt, true -} - -// SetCreatedAt sets field value -func (o *Metamorph) SetCreatedAt(v time.Time) { - o.CreatedAt = v -} - -// GetActorId returns the ActorId field value -func (o *Metamorph) GetActorId() string { - if o == nil { - var ret string - return ret - } - - return o.ActorId -} - -// GetActorIdOk returns a tuple with the ActorId field value -// and a boolean to check if the value has been set. -func (o *Metamorph) GetActorIdOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.ActorId, true -} - -// SetActorId sets field value -func (o *Metamorph) SetActorId(v string) { - o.ActorId = v -} - -// GetBuildId returns the BuildId field value -func (o *Metamorph) GetBuildId() string { - if o == nil { - var ret string - return ret - } - - return o.BuildId -} - -// GetBuildIdOk returns a tuple with the BuildId field value -// and a boolean to check if the value has been set. -func (o *Metamorph) GetBuildIdOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.BuildId, true -} - -// SetBuildId sets field value -func (o *Metamorph) SetBuildId(v string) { - o.BuildId = v -} - -// GetInputKey returns the InputKey field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *Metamorph) GetInputKey() string { - if o == nil || IsNil(o.InputKey.Get()) { - var ret string - return ret - } - return *o.InputKey.Get() -} - -// GetInputKeyOk returns a tuple with the InputKey field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *Metamorph) GetInputKeyOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.InputKey.Get(), o.InputKey.IsSet() -} - -// HasInputKey returns a boolean if a field has been set. -func (o *Metamorph) HasInputKey() bool { - if o != nil && o.InputKey.IsSet() { - return true - } - - return false -} - -// SetInputKey gets a reference to the given NullableString and assigns it to the InputKey field. -func (o *Metamorph) SetInputKey(v string) { - o.InputKey.Set(&v) -} -// SetInputKeyNil sets the value for InputKey to be an explicit nil -func (o *Metamorph) SetInputKeyNil() { - o.InputKey.Set(nil) -} - -// UnsetInputKey ensures that no value is present for InputKey, not even an explicit nil -func (o *Metamorph) UnsetInputKey() { - o.InputKey.Unset() -} - -func (o Metamorph) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o Metamorph) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["createdAt"] = o.CreatedAt - toSerialize["actorId"] = o.ActorId - toSerialize["buildId"] = o.BuildId - if o.InputKey.IsSet() { - toSerialize["inputKey"] = o.InputKey.Get() - } - return toSerialize, nil -} - -func (o *Metamorph) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "createdAt", - "actorId", - "buildId", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err; - } - - for _, requiredProperty := range(requiredProperties) { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varMetamorph := _Metamorph{} - - decoder := json.NewDecoder(bytes.NewReader(data)) - decoder.DisallowUnknownFields() - err = decoder.Decode(&varMetamorph) - - if err != nil { - return err - } - - *o = Metamorph(varMetamorph) - - return err -} - -type NullableMetamorph struct { - value *Metamorph - isSet bool -} - -func (v NullableMetamorph) Get() *Metamorph { - return v.value -} - -func (v *NullableMetamorph) Set(val *Metamorph) { - v.value = val - v.isSet = true -} - -func (v NullableMetamorph) IsSet() bool { - return v.isSet -} - -func (v *NullableMetamorph) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableMetamorph(val *Metamorph) *NullableMetamorph { - return &NullableMetamorph{value: val, isSet: true} -} - -func (v NullableMetamorph) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableMetamorph) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_monthly_usage.go b/model_monthly_usage.go deleted file mode 100644 index ec058a7..0000000 --- a/model_monthly_usage.go +++ /dev/null @@ -1,272 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" - "bytes" - "fmt" -) - -// checks if the MonthlyUsage type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &MonthlyUsage{} - -// MonthlyUsage struct for MonthlyUsage -type MonthlyUsage struct { - UsageCycle UsageCycle `json:"usageCycle"` - // A map of usage item names (e.g., ACTOR_COMPUTE_UNITS) to their usage details. - MonthlyServiceUsage map[string]UsageItem `json:"monthlyServiceUsage"` - // - DailyServiceUsages []DailyServiceUsages `json:"dailyServiceUsages"` - TotalUsageCreditsUsdBeforeVolumeDiscount float32 `json:"totalUsageCreditsUsdBeforeVolumeDiscount"` - TotalUsageCreditsUsdAfterVolumeDiscount float32 `json:"totalUsageCreditsUsdAfterVolumeDiscount"` -} - -type _MonthlyUsage MonthlyUsage - -// NewMonthlyUsage instantiates a new MonthlyUsage object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewMonthlyUsage(usageCycle UsageCycle, monthlyServiceUsage map[string]UsageItem, dailyServiceUsages []DailyServiceUsages, totalUsageCreditsUsdBeforeVolumeDiscount float32, totalUsageCreditsUsdAfterVolumeDiscount float32) *MonthlyUsage { - this := MonthlyUsage{} - this.UsageCycle = usageCycle - this.MonthlyServiceUsage = monthlyServiceUsage - this.DailyServiceUsages = dailyServiceUsages - this.TotalUsageCreditsUsdBeforeVolumeDiscount = totalUsageCreditsUsdBeforeVolumeDiscount - this.TotalUsageCreditsUsdAfterVolumeDiscount = totalUsageCreditsUsdAfterVolumeDiscount - return &this -} - -// NewMonthlyUsageWithDefaults instantiates a new MonthlyUsage object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewMonthlyUsageWithDefaults() *MonthlyUsage { - this := MonthlyUsage{} - return &this -} - -// GetUsageCycle returns the UsageCycle field value -func (o *MonthlyUsage) GetUsageCycle() UsageCycle { - if o == nil { - var ret UsageCycle - return ret - } - - return o.UsageCycle -} - -// GetUsageCycleOk returns a tuple with the UsageCycle field value -// and a boolean to check if the value has been set. -func (o *MonthlyUsage) GetUsageCycleOk() (*UsageCycle, bool) { - if o == nil { - return nil, false - } - return &o.UsageCycle, true -} - -// SetUsageCycle sets field value -func (o *MonthlyUsage) SetUsageCycle(v UsageCycle) { - o.UsageCycle = v -} - -// GetMonthlyServiceUsage returns the MonthlyServiceUsage field value -func (o *MonthlyUsage) GetMonthlyServiceUsage() map[string]UsageItem { - if o == nil { - var ret map[string]UsageItem - return ret - } - - return o.MonthlyServiceUsage -} - -// GetMonthlyServiceUsageOk returns a tuple with the MonthlyServiceUsage field value -// and a boolean to check if the value has been set. -func (o *MonthlyUsage) GetMonthlyServiceUsageOk() (map[string]UsageItem, bool) { - if o == nil { - return map[string]UsageItem{}, false - } - return o.MonthlyServiceUsage, true -} - -// SetMonthlyServiceUsage sets field value -func (o *MonthlyUsage) SetMonthlyServiceUsage(v map[string]UsageItem) { - o.MonthlyServiceUsage = v -} - -// GetDailyServiceUsages returns the DailyServiceUsages field value -func (o *MonthlyUsage) GetDailyServiceUsages() []DailyServiceUsages { - if o == nil { - var ret []DailyServiceUsages - return ret - } - - return o.DailyServiceUsages -} - -// GetDailyServiceUsagesOk returns a tuple with the DailyServiceUsages field value -// and a boolean to check if the value has been set. -func (o *MonthlyUsage) GetDailyServiceUsagesOk() ([]DailyServiceUsages, bool) { - if o == nil { - return nil, false - } - return o.DailyServiceUsages, true -} - -// SetDailyServiceUsages sets field value -func (o *MonthlyUsage) SetDailyServiceUsages(v []DailyServiceUsages) { - o.DailyServiceUsages = v -} - -// GetTotalUsageCreditsUsdBeforeVolumeDiscount returns the TotalUsageCreditsUsdBeforeVolumeDiscount field value -func (o *MonthlyUsage) GetTotalUsageCreditsUsdBeforeVolumeDiscount() float32 { - if o == nil { - var ret float32 - return ret - } - - return o.TotalUsageCreditsUsdBeforeVolumeDiscount -} - -// GetTotalUsageCreditsUsdBeforeVolumeDiscountOk returns a tuple with the TotalUsageCreditsUsdBeforeVolumeDiscount field value -// and a boolean to check if the value has been set. -func (o *MonthlyUsage) GetTotalUsageCreditsUsdBeforeVolumeDiscountOk() (*float32, bool) { - if o == nil { - return nil, false - } - return &o.TotalUsageCreditsUsdBeforeVolumeDiscount, true -} - -// SetTotalUsageCreditsUsdBeforeVolumeDiscount sets field value -func (o *MonthlyUsage) SetTotalUsageCreditsUsdBeforeVolumeDiscount(v float32) { - o.TotalUsageCreditsUsdBeforeVolumeDiscount = v -} - -// GetTotalUsageCreditsUsdAfterVolumeDiscount returns the TotalUsageCreditsUsdAfterVolumeDiscount field value -func (o *MonthlyUsage) GetTotalUsageCreditsUsdAfterVolumeDiscount() float32 { - if o == nil { - var ret float32 - return ret - } - - return o.TotalUsageCreditsUsdAfterVolumeDiscount -} - -// GetTotalUsageCreditsUsdAfterVolumeDiscountOk returns a tuple with the TotalUsageCreditsUsdAfterVolumeDiscount field value -// and a boolean to check if the value has been set. -func (o *MonthlyUsage) GetTotalUsageCreditsUsdAfterVolumeDiscountOk() (*float32, bool) { - if o == nil { - return nil, false - } - return &o.TotalUsageCreditsUsdAfterVolumeDiscount, true -} - -// SetTotalUsageCreditsUsdAfterVolumeDiscount sets field value -func (o *MonthlyUsage) SetTotalUsageCreditsUsdAfterVolumeDiscount(v float32) { - o.TotalUsageCreditsUsdAfterVolumeDiscount = v -} - -func (o MonthlyUsage) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o MonthlyUsage) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["usageCycle"] = o.UsageCycle - toSerialize["monthlyServiceUsage"] = o.MonthlyServiceUsage - toSerialize["dailyServiceUsages"] = o.DailyServiceUsages - toSerialize["totalUsageCreditsUsdBeforeVolumeDiscount"] = o.TotalUsageCreditsUsdBeforeVolumeDiscount - toSerialize["totalUsageCreditsUsdAfterVolumeDiscount"] = o.TotalUsageCreditsUsdAfterVolumeDiscount - return toSerialize, nil -} - -func (o *MonthlyUsage) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "usageCycle", - "monthlyServiceUsage", - "dailyServiceUsages", - "totalUsageCreditsUsdBeforeVolumeDiscount", - "totalUsageCreditsUsdAfterVolumeDiscount", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err; - } - - for _, requiredProperty := range(requiredProperties) { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varMonthlyUsage := _MonthlyUsage{} - - decoder := json.NewDecoder(bytes.NewReader(data)) - decoder.DisallowUnknownFields() - err = decoder.Decode(&varMonthlyUsage) - - if err != nil { - return err - } - - *o = MonthlyUsage(varMonthlyUsage) - - return err -} - -type NullableMonthlyUsage struct { - value *MonthlyUsage - isSet bool -} - -func (v NullableMonthlyUsage) Get() *MonthlyUsage { - return v.value -} - -func (v *NullableMonthlyUsage) Set(val *MonthlyUsage) { - v.value = val - v.isSet = true -} - -func (v NullableMonthlyUsage) IsSet() bool { - return v.isSet -} - -func (v *NullableMonthlyUsage) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableMonthlyUsage(val *MonthlyUsage) *NullableMonthlyUsage { - return &NullableMonthlyUsage{value: val, isSet: true} -} - -func (v NullableMonthlyUsage) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableMonthlyUsage) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_monthly_usage_response.go b/model_monthly_usage_response.go deleted file mode 100644 index b45dc30..0000000 --- a/model_monthly_usage_response.go +++ /dev/null @@ -1,158 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" - "bytes" - "fmt" -) - -// checks if the MonthlyUsageResponse type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &MonthlyUsageResponse{} - -// MonthlyUsageResponse struct for MonthlyUsageResponse -type MonthlyUsageResponse struct { - Data MonthlyUsage `json:"data"` -} - -type _MonthlyUsageResponse MonthlyUsageResponse - -// NewMonthlyUsageResponse instantiates a new MonthlyUsageResponse object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewMonthlyUsageResponse(data MonthlyUsage) *MonthlyUsageResponse { - this := MonthlyUsageResponse{} - this.Data = data - return &this -} - -// NewMonthlyUsageResponseWithDefaults instantiates a new MonthlyUsageResponse object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewMonthlyUsageResponseWithDefaults() *MonthlyUsageResponse { - this := MonthlyUsageResponse{} - return &this -} - -// GetData returns the Data field value -func (o *MonthlyUsageResponse) GetData() MonthlyUsage { - if o == nil { - var ret MonthlyUsage - return ret - } - - return o.Data -} - -// GetDataOk returns a tuple with the Data field value -// and a boolean to check if the value has been set. -func (o *MonthlyUsageResponse) GetDataOk() (*MonthlyUsage, bool) { - if o == nil { - return nil, false - } - return &o.Data, true -} - -// SetData sets field value -func (o *MonthlyUsageResponse) SetData(v MonthlyUsage) { - o.Data = v -} - -func (o MonthlyUsageResponse) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o MonthlyUsageResponse) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["data"] = o.Data - return toSerialize, nil -} - -func (o *MonthlyUsageResponse) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "data", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err; - } - - for _, requiredProperty := range(requiredProperties) { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varMonthlyUsageResponse := _MonthlyUsageResponse{} - - decoder := json.NewDecoder(bytes.NewReader(data)) - decoder.DisallowUnknownFields() - err = decoder.Decode(&varMonthlyUsageResponse) - - if err != nil { - return err - } - - *o = MonthlyUsageResponse(varMonthlyUsageResponse) - - return err -} - -type NullableMonthlyUsageResponse struct { - value *MonthlyUsageResponse - isSet bool -} - -func (v NullableMonthlyUsageResponse) Get() *MonthlyUsageResponse { - return v.value -} - -func (v *NullableMonthlyUsageResponse) Set(val *MonthlyUsageResponse) { - v.value = val - v.isSet = true -} - -func (v NullableMonthlyUsageResponse) IsSet() bool { - return v.isSet -} - -func (v *NullableMonthlyUsageResponse) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableMonthlyUsageResponse(val *MonthlyUsageResponse) *NullableMonthlyUsageResponse { - return &NullableMonthlyUsageResponse{value: val, isSet: true} -} - -func (v NullableMonthlyUsageResponse) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableMonthlyUsageResponse) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_pagination_response.go b/model_pagination_response.go deleted file mode 100644 index 00228e8..0000000 --- a/model_pagination_response.go +++ /dev/null @@ -1,275 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" - "bytes" - "fmt" -) - -// checks if the PaginationResponse type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &PaginationResponse{} - -// PaginationResponse Common pagination fields for list responses. -type PaginationResponse struct { - // The total number of items available across all pages. - Total int32 `json:"total"` - // The starting position for this page of results. - Offset int32 `json:"offset"` - // The maximum number of items returned per page. - Limit int32 `json:"limit"` - // Whether the results are sorted in descending order. - Desc bool `json:"desc"` - // The number of items returned in this response. - Count int32 `json:"count"` -} - -type _PaginationResponse PaginationResponse - -// NewPaginationResponse instantiates a new PaginationResponse object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewPaginationResponse(total int32, offset int32, limit int32, desc bool, count int32) *PaginationResponse { - this := PaginationResponse{} - this.Total = total - this.Offset = offset - this.Limit = limit - this.Desc = desc - this.Count = count - return &this -} - -// NewPaginationResponseWithDefaults instantiates a new PaginationResponse object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewPaginationResponseWithDefaults() *PaginationResponse { - this := PaginationResponse{} - return &this -} - -// GetTotal returns the Total field value -func (o *PaginationResponse) GetTotal() int32 { - if o == nil { - var ret int32 - return ret - } - - return o.Total -} - -// GetTotalOk returns a tuple with the Total field value -// and a boolean to check if the value has been set. -func (o *PaginationResponse) GetTotalOk() (*int32, bool) { - if o == nil { - return nil, false - } - return &o.Total, true -} - -// SetTotal sets field value -func (o *PaginationResponse) SetTotal(v int32) { - o.Total = v -} - -// GetOffset returns the Offset field value -func (o *PaginationResponse) GetOffset() int32 { - if o == nil { - var ret int32 - return ret - } - - return o.Offset -} - -// GetOffsetOk returns a tuple with the Offset field value -// and a boolean to check if the value has been set. -func (o *PaginationResponse) GetOffsetOk() (*int32, bool) { - if o == nil { - return nil, false - } - return &o.Offset, true -} - -// SetOffset sets field value -func (o *PaginationResponse) SetOffset(v int32) { - o.Offset = v -} - -// GetLimit returns the Limit field value -func (o *PaginationResponse) GetLimit() int32 { - if o == nil { - var ret int32 - return ret - } - - return o.Limit -} - -// GetLimitOk returns a tuple with the Limit field value -// and a boolean to check if the value has been set. -func (o *PaginationResponse) GetLimitOk() (*int32, bool) { - if o == nil { - return nil, false - } - return &o.Limit, true -} - -// SetLimit sets field value -func (o *PaginationResponse) SetLimit(v int32) { - o.Limit = v -} - -// GetDesc returns the Desc field value -func (o *PaginationResponse) GetDesc() bool { - if o == nil { - var ret bool - return ret - } - - return o.Desc -} - -// GetDescOk returns a tuple with the Desc field value -// and a boolean to check if the value has been set. -func (o *PaginationResponse) GetDescOk() (*bool, bool) { - if o == nil { - return nil, false - } - return &o.Desc, true -} - -// SetDesc sets field value -func (o *PaginationResponse) SetDesc(v bool) { - o.Desc = v -} - -// GetCount returns the Count field value -func (o *PaginationResponse) GetCount() int32 { - if o == nil { - var ret int32 - return ret - } - - return o.Count -} - -// GetCountOk returns a tuple with the Count field value -// and a boolean to check if the value has been set. -func (o *PaginationResponse) GetCountOk() (*int32, bool) { - if o == nil { - return nil, false - } - return &o.Count, true -} - -// SetCount sets field value -func (o *PaginationResponse) SetCount(v int32) { - o.Count = v -} - -func (o PaginationResponse) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o PaginationResponse) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["total"] = o.Total - toSerialize["offset"] = o.Offset - toSerialize["limit"] = o.Limit - toSerialize["desc"] = o.Desc - toSerialize["count"] = o.Count - return toSerialize, nil -} - -func (o *PaginationResponse) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "total", - "offset", - "limit", - "desc", - "count", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err; - } - - for _, requiredProperty := range(requiredProperties) { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varPaginationResponse := _PaginationResponse{} - - decoder := json.NewDecoder(bytes.NewReader(data)) - decoder.DisallowUnknownFields() - err = decoder.Decode(&varPaginationResponse) - - if err != nil { - return err - } - - *o = PaginationResponse(varPaginationResponse) - - return err -} - -type NullablePaginationResponse struct { - value *PaginationResponse - isSet bool -} - -func (v NullablePaginationResponse) Get() *PaginationResponse { - return v.value -} - -func (v *NullablePaginationResponse) Set(val *PaginationResponse) { - v.value = val - v.isSet = true -} - -func (v NullablePaginationResponse) IsSet() bool { - return v.isSet -} - -func (v *NullablePaginationResponse) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullablePaginationResponse(val *PaginationResponse) *NullablePaginationResponse { - return &NullablePaginationResponse{value: val, isSet: true} -} - -func (v NullablePaginationResponse) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullablePaginationResponse) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_pay_per_event_actor_pricing_info.go b/model_pay_per_event_actor_pricing_info.go deleted file mode 100644 index 48921b1..0000000 --- a/model_pay_per_event_actor_pricing_info.go +++ /dev/null @@ -1,500 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" - "time" - "bytes" - "fmt" -) - -// checks if the PayPerEventActorPricingInfo type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &PayPerEventActorPricingInfo{} - -// PayPerEventActorPricingInfo struct for PayPerEventActorPricingInfo -type PayPerEventActorPricingInfo struct { - // In [0, 1], fraction of pricePerUnitUsd that goes to Apify - ApifyMarginPercentage float32 `json:"apifyMarginPercentage"` - // When this pricing info record has been created - CreatedAt time.Time `json:"createdAt"` - // Since when is this pricing info record effective for a given Actor - StartedAt time.Time `json:"startedAt"` - NotifiedAboutFutureChangeAt *time.Time `json:"notifiedAboutFutureChangeAt,omitempty"` - NotifiedAboutChangeAt *time.Time `json:"notifiedAboutChangeAt,omitempty"` - ReasonForChange *string `json:"reasonForChange,omitempty"` - IsPriceChangeNotificationSuppressed *bool `json:"isPriceChangeNotificationSuppressed,omitempty"` - ForceContainsSignificantPriceChange *bool `json:"forceContainsSignificantPriceChange,omitempty"` - PricingModel string `json:"pricingModel"` - PricingPerEvent PayPerEventActorPricingInfoAllOfPricingPerEvent `json:"pricingPerEvent"` - MinimalMaxTotalChargeUsd NullableFloat32 `json:"minimalMaxTotalChargeUsd,omitempty"` -} - -type _PayPerEventActorPricingInfo PayPerEventActorPricingInfo - -// NewPayPerEventActorPricingInfo instantiates a new PayPerEventActorPricingInfo object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewPayPerEventActorPricingInfo(apifyMarginPercentage float32, createdAt time.Time, startedAt time.Time, pricingModel string, pricingPerEvent PayPerEventActorPricingInfoAllOfPricingPerEvent) *PayPerEventActorPricingInfo { - this := PayPerEventActorPricingInfo{} - this.ApifyMarginPercentage = apifyMarginPercentage - this.CreatedAt = createdAt - this.StartedAt = startedAt - this.PricingModel = pricingModel - this.PricingPerEvent = pricingPerEvent - return &this -} - -// NewPayPerEventActorPricingInfoWithDefaults instantiates a new PayPerEventActorPricingInfo object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewPayPerEventActorPricingInfoWithDefaults() *PayPerEventActorPricingInfo { - this := PayPerEventActorPricingInfo{} - return &this -} - -// GetApifyMarginPercentage returns the ApifyMarginPercentage field value -func (o *PayPerEventActorPricingInfo) GetApifyMarginPercentage() float32 { - if o == nil { - var ret float32 - return ret - } - - return o.ApifyMarginPercentage -} - -// GetApifyMarginPercentageOk returns a tuple with the ApifyMarginPercentage field value -// and a boolean to check if the value has been set. -func (o *PayPerEventActorPricingInfo) GetApifyMarginPercentageOk() (*float32, bool) { - if o == nil { - return nil, false - } - return &o.ApifyMarginPercentage, true -} - -// SetApifyMarginPercentage sets field value -func (o *PayPerEventActorPricingInfo) SetApifyMarginPercentage(v float32) { - o.ApifyMarginPercentage = v -} - -// GetCreatedAt returns the CreatedAt field value -func (o *PayPerEventActorPricingInfo) GetCreatedAt() time.Time { - if o == nil { - var ret time.Time - return ret - } - - return o.CreatedAt -} - -// GetCreatedAtOk returns a tuple with the CreatedAt field value -// and a boolean to check if the value has been set. -func (o *PayPerEventActorPricingInfo) GetCreatedAtOk() (*time.Time, bool) { - if o == nil { - return nil, false - } - return &o.CreatedAt, true -} - -// SetCreatedAt sets field value -func (o *PayPerEventActorPricingInfo) SetCreatedAt(v time.Time) { - o.CreatedAt = v -} - -// GetStartedAt returns the StartedAt field value -func (o *PayPerEventActorPricingInfo) GetStartedAt() time.Time { - if o == nil { - var ret time.Time - return ret - } - - return o.StartedAt -} - -// GetStartedAtOk returns a tuple with the StartedAt field value -// and a boolean to check if the value has been set. -func (o *PayPerEventActorPricingInfo) GetStartedAtOk() (*time.Time, bool) { - if o == nil { - return nil, false - } - return &o.StartedAt, true -} - -// SetStartedAt sets field value -func (o *PayPerEventActorPricingInfo) SetStartedAt(v time.Time) { - o.StartedAt = v -} - -// GetNotifiedAboutFutureChangeAt returns the NotifiedAboutFutureChangeAt field value if set, zero value otherwise. -func (o *PayPerEventActorPricingInfo) GetNotifiedAboutFutureChangeAt() time.Time { - if o == nil || IsNil(o.NotifiedAboutFutureChangeAt) { - var ret time.Time - return ret - } - return *o.NotifiedAboutFutureChangeAt -} - -// GetNotifiedAboutFutureChangeAtOk returns a tuple with the NotifiedAboutFutureChangeAt field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *PayPerEventActorPricingInfo) GetNotifiedAboutFutureChangeAtOk() (*time.Time, bool) { - if o == nil || IsNil(o.NotifiedAboutFutureChangeAt) { - return nil, false - } - return o.NotifiedAboutFutureChangeAt, true -} - -// HasNotifiedAboutFutureChangeAt returns a boolean if a field has been set. -func (o *PayPerEventActorPricingInfo) HasNotifiedAboutFutureChangeAt() bool { - if o != nil && !IsNil(o.NotifiedAboutFutureChangeAt) { - return true - } - - return false -} - -// SetNotifiedAboutFutureChangeAt gets a reference to the given time.Time and assigns it to the NotifiedAboutFutureChangeAt field. -func (o *PayPerEventActorPricingInfo) SetNotifiedAboutFutureChangeAt(v time.Time) { - o.NotifiedAboutFutureChangeAt = &v -} - -// GetNotifiedAboutChangeAt returns the NotifiedAboutChangeAt field value if set, zero value otherwise. -func (o *PayPerEventActorPricingInfo) GetNotifiedAboutChangeAt() time.Time { - if o == nil || IsNil(o.NotifiedAboutChangeAt) { - var ret time.Time - return ret - } - return *o.NotifiedAboutChangeAt -} - -// GetNotifiedAboutChangeAtOk returns a tuple with the NotifiedAboutChangeAt field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *PayPerEventActorPricingInfo) GetNotifiedAboutChangeAtOk() (*time.Time, bool) { - if o == nil || IsNil(o.NotifiedAboutChangeAt) { - return nil, false - } - return o.NotifiedAboutChangeAt, true -} - -// HasNotifiedAboutChangeAt returns a boolean if a field has been set. -func (o *PayPerEventActorPricingInfo) HasNotifiedAboutChangeAt() bool { - if o != nil && !IsNil(o.NotifiedAboutChangeAt) { - return true - } - - return false -} - -// SetNotifiedAboutChangeAt gets a reference to the given time.Time and assigns it to the NotifiedAboutChangeAt field. -func (o *PayPerEventActorPricingInfo) SetNotifiedAboutChangeAt(v time.Time) { - o.NotifiedAboutChangeAt = &v -} - -// GetReasonForChange returns the ReasonForChange field value if set, zero value otherwise. -func (o *PayPerEventActorPricingInfo) GetReasonForChange() string { - if o == nil || IsNil(o.ReasonForChange) { - var ret string - return ret - } - return *o.ReasonForChange -} - -// GetReasonForChangeOk returns a tuple with the ReasonForChange field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *PayPerEventActorPricingInfo) GetReasonForChangeOk() (*string, bool) { - if o == nil || IsNil(o.ReasonForChange) { - return nil, false - } - return o.ReasonForChange, true -} - -// HasReasonForChange returns a boolean if a field has been set. -func (o *PayPerEventActorPricingInfo) HasReasonForChange() bool { - if o != nil && !IsNil(o.ReasonForChange) { - return true - } - - return false -} - -// SetReasonForChange gets a reference to the given string and assigns it to the ReasonForChange field. -func (o *PayPerEventActorPricingInfo) SetReasonForChange(v string) { - o.ReasonForChange = &v -} - -// GetIsPriceChangeNotificationSuppressed returns the IsPriceChangeNotificationSuppressed field value if set, zero value otherwise. -func (o *PayPerEventActorPricingInfo) GetIsPriceChangeNotificationSuppressed() bool { - if o == nil || IsNil(o.IsPriceChangeNotificationSuppressed) { - var ret bool - return ret - } - return *o.IsPriceChangeNotificationSuppressed -} - -// GetIsPriceChangeNotificationSuppressedOk returns a tuple with the IsPriceChangeNotificationSuppressed field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *PayPerEventActorPricingInfo) GetIsPriceChangeNotificationSuppressedOk() (*bool, bool) { - if o == nil || IsNil(o.IsPriceChangeNotificationSuppressed) { - return nil, false - } - return o.IsPriceChangeNotificationSuppressed, true -} - -// HasIsPriceChangeNotificationSuppressed returns a boolean if a field has been set. -func (o *PayPerEventActorPricingInfo) HasIsPriceChangeNotificationSuppressed() bool { - if o != nil && !IsNil(o.IsPriceChangeNotificationSuppressed) { - return true - } - - return false -} - -// SetIsPriceChangeNotificationSuppressed gets a reference to the given bool and assigns it to the IsPriceChangeNotificationSuppressed field. -func (o *PayPerEventActorPricingInfo) SetIsPriceChangeNotificationSuppressed(v bool) { - o.IsPriceChangeNotificationSuppressed = &v -} - -// GetForceContainsSignificantPriceChange returns the ForceContainsSignificantPriceChange field value if set, zero value otherwise. -func (o *PayPerEventActorPricingInfo) GetForceContainsSignificantPriceChange() bool { - if o == nil || IsNil(o.ForceContainsSignificantPriceChange) { - var ret bool - return ret - } - return *o.ForceContainsSignificantPriceChange -} - -// GetForceContainsSignificantPriceChangeOk returns a tuple with the ForceContainsSignificantPriceChange field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *PayPerEventActorPricingInfo) GetForceContainsSignificantPriceChangeOk() (*bool, bool) { - if o == nil || IsNil(o.ForceContainsSignificantPriceChange) { - return nil, false - } - return o.ForceContainsSignificantPriceChange, true -} - -// HasForceContainsSignificantPriceChange returns a boolean if a field has been set. -func (o *PayPerEventActorPricingInfo) HasForceContainsSignificantPriceChange() bool { - if o != nil && !IsNil(o.ForceContainsSignificantPriceChange) { - return true - } - - return false -} - -// SetForceContainsSignificantPriceChange gets a reference to the given bool and assigns it to the ForceContainsSignificantPriceChange field. -func (o *PayPerEventActorPricingInfo) SetForceContainsSignificantPriceChange(v bool) { - o.ForceContainsSignificantPriceChange = &v -} - -// GetPricingModel returns the PricingModel field value -func (o *PayPerEventActorPricingInfo) GetPricingModel() string { - if o == nil { - var ret string - return ret - } - - return o.PricingModel -} - -// GetPricingModelOk returns a tuple with the PricingModel field value -// and a boolean to check if the value has been set. -func (o *PayPerEventActorPricingInfo) GetPricingModelOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.PricingModel, true -} - -// SetPricingModel sets field value -func (o *PayPerEventActorPricingInfo) SetPricingModel(v string) { - o.PricingModel = v -} - -// GetPricingPerEvent returns the PricingPerEvent field value -func (o *PayPerEventActorPricingInfo) GetPricingPerEvent() PayPerEventActorPricingInfoAllOfPricingPerEvent { - if o == nil { - var ret PayPerEventActorPricingInfoAllOfPricingPerEvent - return ret - } - - return o.PricingPerEvent -} - -// GetPricingPerEventOk returns a tuple with the PricingPerEvent field value -// and a boolean to check if the value has been set. -func (o *PayPerEventActorPricingInfo) GetPricingPerEventOk() (*PayPerEventActorPricingInfoAllOfPricingPerEvent, bool) { - if o == nil { - return nil, false - } - return &o.PricingPerEvent, true -} - -// SetPricingPerEvent sets field value -func (o *PayPerEventActorPricingInfo) SetPricingPerEvent(v PayPerEventActorPricingInfoAllOfPricingPerEvent) { - o.PricingPerEvent = v -} - -// GetMinimalMaxTotalChargeUsd returns the MinimalMaxTotalChargeUsd field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *PayPerEventActorPricingInfo) GetMinimalMaxTotalChargeUsd() float32 { - if o == nil || IsNil(o.MinimalMaxTotalChargeUsd.Get()) { - var ret float32 - return ret - } - return *o.MinimalMaxTotalChargeUsd.Get() -} - -// GetMinimalMaxTotalChargeUsdOk returns a tuple with the MinimalMaxTotalChargeUsd field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *PayPerEventActorPricingInfo) GetMinimalMaxTotalChargeUsdOk() (*float32, bool) { - if o == nil { - return nil, false - } - return o.MinimalMaxTotalChargeUsd.Get(), o.MinimalMaxTotalChargeUsd.IsSet() -} - -// HasMinimalMaxTotalChargeUsd returns a boolean if a field has been set. -func (o *PayPerEventActorPricingInfo) HasMinimalMaxTotalChargeUsd() bool { - if o != nil && o.MinimalMaxTotalChargeUsd.IsSet() { - return true - } - - return false -} - -// SetMinimalMaxTotalChargeUsd gets a reference to the given NullableFloat32 and assigns it to the MinimalMaxTotalChargeUsd field. -func (o *PayPerEventActorPricingInfo) SetMinimalMaxTotalChargeUsd(v float32) { - o.MinimalMaxTotalChargeUsd.Set(&v) -} -// SetMinimalMaxTotalChargeUsdNil sets the value for MinimalMaxTotalChargeUsd to be an explicit nil -func (o *PayPerEventActorPricingInfo) SetMinimalMaxTotalChargeUsdNil() { - o.MinimalMaxTotalChargeUsd.Set(nil) -} - -// UnsetMinimalMaxTotalChargeUsd ensures that no value is present for MinimalMaxTotalChargeUsd, not even an explicit nil -func (o *PayPerEventActorPricingInfo) UnsetMinimalMaxTotalChargeUsd() { - o.MinimalMaxTotalChargeUsd.Unset() -} - -func (o PayPerEventActorPricingInfo) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o PayPerEventActorPricingInfo) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["apifyMarginPercentage"] = o.ApifyMarginPercentage - toSerialize["createdAt"] = o.CreatedAt - toSerialize["startedAt"] = o.StartedAt - if !IsNil(o.NotifiedAboutFutureChangeAt) { - toSerialize["notifiedAboutFutureChangeAt"] = o.NotifiedAboutFutureChangeAt - } - if !IsNil(o.NotifiedAboutChangeAt) { - toSerialize["notifiedAboutChangeAt"] = o.NotifiedAboutChangeAt - } - if !IsNil(o.ReasonForChange) { - toSerialize["reasonForChange"] = o.ReasonForChange - } - if !IsNil(o.IsPriceChangeNotificationSuppressed) { - toSerialize["isPriceChangeNotificationSuppressed"] = o.IsPriceChangeNotificationSuppressed - } - if !IsNil(o.ForceContainsSignificantPriceChange) { - toSerialize["forceContainsSignificantPriceChange"] = o.ForceContainsSignificantPriceChange - } - toSerialize["pricingModel"] = o.PricingModel - toSerialize["pricingPerEvent"] = o.PricingPerEvent - if o.MinimalMaxTotalChargeUsd.IsSet() { - toSerialize["minimalMaxTotalChargeUsd"] = o.MinimalMaxTotalChargeUsd.Get() - } - return toSerialize, nil -} - -func (o *PayPerEventActorPricingInfo) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "apifyMarginPercentage", - "createdAt", - "startedAt", - "pricingModel", - "pricingPerEvent", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err; - } - - for _, requiredProperty := range(requiredProperties) { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varPayPerEventActorPricingInfo := _PayPerEventActorPricingInfo{} - - decoder := json.NewDecoder(bytes.NewReader(data)) - decoder.DisallowUnknownFields() - err = decoder.Decode(&varPayPerEventActorPricingInfo) - - if err != nil { - return err - } - - *o = PayPerEventActorPricingInfo(varPayPerEventActorPricingInfo) - - return err -} - -type NullablePayPerEventActorPricingInfo struct { - value *PayPerEventActorPricingInfo - isSet bool -} - -func (v NullablePayPerEventActorPricingInfo) Get() *PayPerEventActorPricingInfo { - return v.value -} - -func (v *NullablePayPerEventActorPricingInfo) Set(val *PayPerEventActorPricingInfo) { - v.value = val - v.isSet = true -} - -func (v NullablePayPerEventActorPricingInfo) IsSet() bool { - return v.isSet -} - -func (v *NullablePayPerEventActorPricingInfo) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullablePayPerEventActorPricingInfo(val *PayPerEventActorPricingInfo) *NullablePayPerEventActorPricingInfo { - return &NullablePayPerEventActorPricingInfo{value: val, isSet: true} -} - -func (v NullablePayPerEventActorPricingInfo) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullablePayPerEventActorPricingInfo) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_pay_per_event_actor_pricing_info_all_of_pricing_per_event.go b/model_pay_per_event_actor_pricing_info_all_of_pricing_per_event.go deleted file mode 100644 index 439cf30..0000000 --- a/model_pay_per_event_actor_pricing_info_all_of_pricing_per_event.go +++ /dev/null @@ -1,126 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" -) - -// checks if the PayPerEventActorPricingInfoAllOfPricingPerEvent type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &PayPerEventActorPricingInfoAllOfPricingPerEvent{} - -// PayPerEventActorPricingInfoAllOfPricingPerEvent struct for PayPerEventActorPricingInfoAllOfPricingPerEvent -type PayPerEventActorPricingInfoAllOfPricingPerEvent struct { - ActorChargeEvents map[string]ActorChargeEvent `json:"actorChargeEvents,omitempty"` -} - -// NewPayPerEventActorPricingInfoAllOfPricingPerEvent instantiates a new PayPerEventActorPricingInfoAllOfPricingPerEvent object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewPayPerEventActorPricingInfoAllOfPricingPerEvent() *PayPerEventActorPricingInfoAllOfPricingPerEvent { - this := PayPerEventActorPricingInfoAllOfPricingPerEvent{} - return &this -} - -// NewPayPerEventActorPricingInfoAllOfPricingPerEventWithDefaults instantiates a new PayPerEventActorPricingInfoAllOfPricingPerEvent object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewPayPerEventActorPricingInfoAllOfPricingPerEventWithDefaults() *PayPerEventActorPricingInfoAllOfPricingPerEvent { - this := PayPerEventActorPricingInfoAllOfPricingPerEvent{} - return &this -} - -// GetActorChargeEvents returns the ActorChargeEvents field value if set, zero value otherwise. -func (o *PayPerEventActorPricingInfoAllOfPricingPerEvent) GetActorChargeEvents() map[string]ActorChargeEvent { - if o == nil || IsNil(o.ActorChargeEvents) { - var ret map[string]ActorChargeEvent - return ret - } - return o.ActorChargeEvents -} - -// GetActorChargeEventsOk returns a tuple with the ActorChargeEvents field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *PayPerEventActorPricingInfoAllOfPricingPerEvent) GetActorChargeEventsOk() (map[string]ActorChargeEvent, bool) { - if o == nil || IsNil(o.ActorChargeEvents) { - return map[string]ActorChargeEvent{}, false - } - return o.ActorChargeEvents, true -} - -// HasActorChargeEvents returns a boolean if a field has been set. -func (o *PayPerEventActorPricingInfoAllOfPricingPerEvent) HasActorChargeEvents() bool { - if o != nil && !IsNil(o.ActorChargeEvents) { - return true - } - - return false -} - -// SetActorChargeEvents gets a reference to the given map[string]ActorChargeEvent and assigns it to the ActorChargeEvents field. -func (o *PayPerEventActorPricingInfoAllOfPricingPerEvent) SetActorChargeEvents(v map[string]ActorChargeEvent) { - o.ActorChargeEvents = v -} - -func (o PayPerEventActorPricingInfoAllOfPricingPerEvent) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o PayPerEventActorPricingInfoAllOfPricingPerEvent) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if !IsNil(o.ActorChargeEvents) { - toSerialize["actorChargeEvents"] = o.ActorChargeEvents - } - return toSerialize, nil -} - -type NullablePayPerEventActorPricingInfoAllOfPricingPerEvent struct { - value *PayPerEventActorPricingInfoAllOfPricingPerEvent - isSet bool -} - -func (v NullablePayPerEventActorPricingInfoAllOfPricingPerEvent) Get() *PayPerEventActorPricingInfoAllOfPricingPerEvent { - return v.value -} - -func (v *NullablePayPerEventActorPricingInfoAllOfPricingPerEvent) Set(val *PayPerEventActorPricingInfoAllOfPricingPerEvent) { - v.value = val - v.isSet = true -} - -func (v NullablePayPerEventActorPricingInfoAllOfPricingPerEvent) IsSet() bool { - return v.isSet -} - -func (v *NullablePayPerEventActorPricingInfoAllOfPricingPerEvent) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullablePayPerEventActorPricingInfoAllOfPricingPerEvent(val *PayPerEventActorPricingInfoAllOfPricingPerEvent) *NullablePayPerEventActorPricingInfoAllOfPricingPerEvent { - return &NullablePayPerEventActorPricingInfoAllOfPricingPerEvent{value: val, isSet: true} -} - -func (v NullablePayPerEventActorPricingInfoAllOfPricingPerEvent) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullablePayPerEventActorPricingInfoAllOfPricingPerEvent) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_plan.go b/model_plan.go deleted file mode 100644 index 27534c6..0000000 --- a/model_plan.go +++ /dev/null @@ -1,880 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" - "bytes" - "fmt" -) - -// checks if the Plan type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &Plan{} - -// Plan struct for Plan -type Plan struct { - Id string `json:"id"` - Description string `json:"description"` - IsEnabled bool `json:"isEnabled"` - MonthlyBasePriceUsd float32 `json:"monthlyBasePriceUsd"` - MonthlyUsageCreditsUsd float32 `json:"monthlyUsageCreditsUsd"` - UsageDiscountPercent *float32 `json:"usageDiscountPercent,omitempty"` - EnabledPlatformFeatures []string `json:"enabledPlatformFeatures"` - MaxMonthlyUsageUsd float32 `json:"maxMonthlyUsageUsd"` - MaxActorMemoryGbytes float32 `json:"maxActorMemoryGbytes"` - MaxMonthlyActorComputeUnits float32 `json:"maxMonthlyActorComputeUnits"` - MaxMonthlyResidentialProxyGbytes float32 `json:"maxMonthlyResidentialProxyGbytes"` - MaxMonthlyProxySerps int32 `json:"maxMonthlyProxySerps"` - MaxMonthlyExternalDataTransferGbytes float32 `json:"maxMonthlyExternalDataTransferGbytes"` - MaxActorCount int32 `json:"maxActorCount"` - MaxActorTaskCount int32 `json:"maxActorTaskCount"` - DataRetentionDays int32 `json:"dataRetentionDays"` - // A dictionary mapping proxy group names to the number of available proxies in each group. The keys are proxy group names (e.g., \"RESIDENTIAL\", \"DATACENTER\") and values are the count of available proxies. - AvailableProxyGroups map[string]int32 `json:"availableProxyGroups"` - TeamAccountSeatCount int32 `json:"teamAccountSeatCount"` - SupportLevel string `json:"supportLevel"` - AvailableAddOns []string `json:"availableAddOns"` - Tier *string `json:"tier,omitempty"` - ApiRateLimitBoosts *int32 `json:"apiRateLimitBoosts,omitempty"` - MaxScheduleCount *int32 `json:"maxScheduleCount,omitempty"` - MaxConcurrentActorRuns *int32 `json:"maxConcurrentActorRuns,omitempty"` - // Pricing details for this plan. - PlanPricing map[string]interface{} `json:"planPricing,omitempty"` -} - -type _Plan Plan - -// NewPlan instantiates a new Plan object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewPlan(id string, description string, isEnabled bool, monthlyBasePriceUsd float32, monthlyUsageCreditsUsd float32, enabledPlatformFeatures []string, maxMonthlyUsageUsd float32, maxActorMemoryGbytes float32, maxMonthlyActorComputeUnits float32, maxMonthlyResidentialProxyGbytes float32, maxMonthlyProxySerps int32, maxMonthlyExternalDataTransferGbytes float32, maxActorCount int32, maxActorTaskCount int32, dataRetentionDays int32, availableProxyGroups map[string]int32, teamAccountSeatCount int32, supportLevel string, availableAddOns []string) *Plan { - this := Plan{} - this.Id = id - this.Description = description - this.IsEnabled = isEnabled - this.MonthlyBasePriceUsd = monthlyBasePriceUsd - this.MonthlyUsageCreditsUsd = monthlyUsageCreditsUsd - this.EnabledPlatformFeatures = enabledPlatformFeatures - this.MaxMonthlyUsageUsd = maxMonthlyUsageUsd - this.MaxActorMemoryGbytes = maxActorMemoryGbytes - this.MaxMonthlyActorComputeUnits = maxMonthlyActorComputeUnits - this.MaxMonthlyResidentialProxyGbytes = maxMonthlyResidentialProxyGbytes - this.MaxMonthlyProxySerps = maxMonthlyProxySerps - this.MaxMonthlyExternalDataTransferGbytes = maxMonthlyExternalDataTransferGbytes - this.MaxActorCount = maxActorCount - this.MaxActorTaskCount = maxActorTaskCount - this.DataRetentionDays = dataRetentionDays - this.AvailableProxyGroups = availableProxyGroups - this.TeamAccountSeatCount = teamAccountSeatCount - this.SupportLevel = supportLevel - this.AvailableAddOns = availableAddOns - return &this -} - -// NewPlanWithDefaults instantiates a new Plan object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewPlanWithDefaults() *Plan { - this := Plan{} - return &this -} - -// GetId returns the Id field value -func (o *Plan) GetId() string { - if o == nil { - var ret string - return ret - } - - return o.Id -} - -// GetIdOk returns a tuple with the Id field value -// and a boolean to check if the value has been set. -func (o *Plan) GetIdOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Id, true -} - -// SetId sets field value -func (o *Plan) SetId(v string) { - o.Id = v -} - -// GetDescription returns the Description field value -func (o *Plan) GetDescription() string { - if o == nil { - var ret string - return ret - } - - return o.Description -} - -// GetDescriptionOk returns a tuple with the Description field value -// and a boolean to check if the value has been set. -func (o *Plan) GetDescriptionOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Description, true -} - -// SetDescription sets field value -func (o *Plan) SetDescription(v string) { - o.Description = v -} - -// GetIsEnabled returns the IsEnabled field value -func (o *Plan) GetIsEnabled() bool { - if o == nil { - var ret bool - return ret - } - - return o.IsEnabled -} - -// GetIsEnabledOk returns a tuple with the IsEnabled field value -// and a boolean to check if the value has been set. -func (o *Plan) GetIsEnabledOk() (*bool, bool) { - if o == nil { - return nil, false - } - return &o.IsEnabled, true -} - -// SetIsEnabled sets field value -func (o *Plan) SetIsEnabled(v bool) { - o.IsEnabled = v -} - -// GetMonthlyBasePriceUsd returns the MonthlyBasePriceUsd field value -func (o *Plan) GetMonthlyBasePriceUsd() float32 { - if o == nil { - var ret float32 - return ret - } - - return o.MonthlyBasePriceUsd -} - -// GetMonthlyBasePriceUsdOk returns a tuple with the MonthlyBasePriceUsd field value -// and a boolean to check if the value has been set. -func (o *Plan) GetMonthlyBasePriceUsdOk() (*float32, bool) { - if o == nil { - return nil, false - } - return &o.MonthlyBasePriceUsd, true -} - -// SetMonthlyBasePriceUsd sets field value -func (o *Plan) SetMonthlyBasePriceUsd(v float32) { - o.MonthlyBasePriceUsd = v -} - -// GetMonthlyUsageCreditsUsd returns the MonthlyUsageCreditsUsd field value -func (o *Plan) GetMonthlyUsageCreditsUsd() float32 { - if o == nil { - var ret float32 - return ret - } - - return o.MonthlyUsageCreditsUsd -} - -// GetMonthlyUsageCreditsUsdOk returns a tuple with the MonthlyUsageCreditsUsd field value -// and a boolean to check if the value has been set. -func (o *Plan) GetMonthlyUsageCreditsUsdOk() (*float32, bool) { - if o == nil { - return nil, false - } - return &o.MonthlyUsageCreditsUsd, true -} - -// SetMonthlyUsageCreditsUsd sets field value -func (o *Plan) SetMonthlyUsageCreditsUsd(v float32) { - o.MonthlyUsageCreditsUsd = v -} - -// GetUsageDiscountPercent returns the UsageDiscountPercent field value if set, zero value otherwise. -func (o *Plan) GetUsageDiscountPercent() float32 { - if o == nil || IsNil(o.UsageDiscountPercent) { - var ret float32 - return ret - } - return *o.UsageDiscountPercent -} - -// GetUsageDiscountPercentOk returns a tuple with the UsageDiscountPercent field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Plan) GetUsageDiscountPercentOk() (*float32, bool) { - if o == nil || IsNil(o.UsageDiscountPercent) { - return nil, false - } - return o.UsageDiscountPercent, true -} - -// HasUsageDiscountPercent returns a boolean if a field has been set. -func (o *Plan) HasUsageDiscountPercent() bool { - if o != nil && !IsNil(o.UsageDiscountPercent) { - return true - } - - return false -} - -// SetUsageDiscountPercent gets a reference to the given float32 and assigns it to the UsageDiscountPercent field. -func (o *Plan) SetUsageDiscountPercent(v float32) { - o.UsageDiscountPercent = &v -} - -// GetEnabledPlatformFeatures returns the EnabledPlatformFeatures field value -func (o *Plan) GetEnabledPlatformFeatures() []string { - if o == nil { - var ret []string - return ret - } - - return o.EnabledPlatformFeatures -} - -// GetEnabledPlatformFeaturesOk returns a tuple with the EnabledPlatformFeatures field value -// and a boolean to check if the value has been set. -func (o *Plan) GetEnabledPlatformFeaturesOk() ([]string, bool) { - if o == nil { - return nil, false - } - return o.EnabledPlatformFeatures, true -} - -// SetEnabledPlatformFeatures sets field value -func (o *Plan) SetEnabledPlatformFeatures(v []string) { - o.EnabledPlatformFeatures = v -} - -// GetMaxMonthlyUsageUsd returns the MaxMonthlyUsageUsd field value -func (o *Plan) GetMaxMonthlyUsageUsd() float32 { - if o == nil { - var ret float32 - return ret - } - - return o.MaxMonthlyUsageUsd -} - -// GetMaxMonthlyUsageUsdOk returns a tuple with the MaxMonthlyUsageUsd field value -// and a boolean to check if the value has been set. -func (o *Plan) GetMaxMonthlyUsageUsdOk() (*float32, bool) { - if o == nil { - return nil, false - } - return &o.MaxMonthlyUsageUsd, true -} - -// SetMaxMonthlyUsageUsd sets field value -func (o *Plan) SetMaxMonthlyUsageUsd(v float32) { - o.MaxMonthlyUsageUsd = v -} - -// GetMaxActorMemoryGbytes returns the MaxActorMemoryGbytes field value -func (o *Plan) GetMaxActorMemoryGbytes() float32 { - if o == nil { - var ret float32 - return ret - } - - return o.MaxActorMemoryGbytes -} - -// GetMaxActorMemoryGbytesOk returns a tuple with the MaxActorMemoryGbytes field value -// and a boolean to check if the value has been set. -func (o *Plan) GetMaxActorMemoryGbytesOk() (*float32, bool) { - if o == nil { - return nil, false - } - return &o.MaxActorMemoryGbytes, true -} - -// SetMaxActorMemoryGbytes sets field value -func (o *Plan) SetMaxActorMemoryGbytes(v float32) { - o.MaxActorMemoryGbytes = v -} - -// GetMaxMonthlyActorComputeUnits returns the MaxMonthlyActorComputeUnits field value -func (o *Plan) GetMaxMonthlyActorComputeUnits() float32 { - if o == nil { - var ret float32 - return ret - } - - return o.MaxMonthlyActorComputeUnits -} - -// GetMaxMonthlyActorComputeUnitsOk returns a tuple with the MaxMonthlyActorComputeUnits field value -// and a boolean to check if the value has been set. -func (o *Plan) GetMaxMonthlyActorComputeUnitsOk() (*float32, bool) { - if o == nil { - return nil, false - } - return &o.MaxMonthlyActorComputeUnits, true -} - -// SetMaxMonthlyActorComputeUnits sets field value -func (o *Plan) SetMaxMonthlyActorComputeUnits(v float32) { - o.MaxMonthlyActorComputeUnits = v -} - -// GetMaxMonthlyResidentialProxyGbytes returns the MaxMonthlyResidentialProxyGbytes field value -func (o *Plan) GetMaxMonthlyResidentialProxyGbytes() float32 { - if o == nil { - var ret float32 - return ret - } - - return o.MaxMonthlyResidentialProxyGbytes -} - -// GetMaxMonthlyResidentialProxyGbytesOk returns a tuple with the MaxMonthlyResidentialProxyGbytes field value -// and a boolean to check if the value has been set. -func (o *Plan) GetMaxMonthlyResidentialProxyGbytesOk() (*float32, bool) { - if o == nil { - return nil, false - } - return &o.MaxMonthlyResidentialProxyGbytes, true -} - -// SetMaxMonthlyResidentialProxyGbytes sets field value -func (o *Plan) SetMaxMonthlyResidentialProxyGbytes(v float32) { - o.MaxMonthlyResidentialProxyGbytes = v -} - -// GetMaxMonthlyProxySerps returns the MaxMonthlyProxySerps field value -func (o *Plan) GetMaxMonthlyProxySerps() int32 { - if o == nil { - var ret int32 - return ret - } - - return o.MaxMonthlyProxySerps -} - -// GetMaxMonthlyProxySerpsOk returns a tuple with the MaxMonthlyProxySerps field value -// and a boolean to check if the value has been set. -func (o *Plan) GetMaxMonthlyProxySerpsOk() (*int32, bool) { - if o == nil { - return nil, false - } - return &o.MaxMonthlyProxySerps, true -} - -// SetMaxMonthlyProxySerps sets field value -func (o *Plan) SetMaxMonthlyProxySerps(v int32) { - o.MaxMonthlyProxySerps = v -} - -// GetMaxMonthlyExternalDataTransferGbytes returns the MaxMonthlyExternalDataTransferGbytes field value -func (o *Plan) GetMaxMonthlyExternalDataTransferGbytes() float32 { - if o == nil { - var ret float32 - return ret - } - - return o.MaxMonthlyExternalDataTransferGbytes -} - -// GetMaxMonthlyExternalDataTransferGbytesOk returns a tuple with the MaxMonthlyExternalDataTransferGbytes field value -// and a boolean to check if the value has been set. -func (o *Plan) GetMaxMonthlyExternalDataTransferGbytesOk() (*float32, bool) { - if o == nil { - return nil, false - } - return &o.MaxMonthlyExternalDataTransferGbytes, true -} - -// SetMaxMonthlyExternalDataTransferGbytes sets field value -func (o *Plan) SetMaxMonthlyExternalDataTransferGbytes(v float32) { - o.MaxMonthlyExternalDataTransferGbytes = v -} - -// GetMaxActorCount returns the MaxActorCount field value -func (o *Plan) GetMaxActorCount() int32 { - if o == nil { - var ret int32 - return ret - } - - return o.MaxActorCount -} - -// GetMaxActorCountOk returns a tuple with the MaxActorCount field value -// and a boolean to check if the value has been set. -func (o *Plan) GetMaxActorCountOk() (*int32, bool) { - if o == nil { - return nil, false - } - return &o.MaxActorCount, true -} - -// SetMaxActorCount sets field value -func (o *Plan) SetMaxActorCount(v int32) { - o.MaxActorCount = v -} - -// GetMaxActorTaskCount returns the MaxActorTaskCount field value -func (o *Plan) GetMaxActorTaskCount() int32 { - if o == nil { - var ret int32 - return ret - } - - return o.MaxActorTaskCount -} - -// GetMaxActorTaskCountOk returns a tuple with the MaxActorTaskCount field value -// and a boolean to check if the value has been set. -func (o *Plan) GetMaxActorTaskCountOk() (*int32, bool) { - if o == nil { - return nil, false - } - return &o.MaxActorTaskCount, true -} - -// SetMaxActorTaskCount sets field value -func (o *Plan) SetMaxActorTaskCount(v int32) { - o.MaxActorTaskCount = v -} - -// GetDataRetentionDays returns the DataRetentionDays field value -func (o *Plan) GetDataRetentionDays() int32 { - if o == nil { - var ret int32 - return ret - } - - return o.DataRetentionDays -} - -// GetDataRetentionDaysOk returns a tuple with the DataRetentionDays field value -// and a boolean to check if the value has been set. -func (o *Plan) GetDataRetentionDaysOk() (*int32, bool) { - if o == nil { - return nil, false - } - return &o.DataRetentionDays, true -} - -// SetDataRetentionDays sets field value -func (o *Plan) SetDataRetentionDays(v int32) { - o.DataRetentionDays = v -} - -// GetAvailableProxyGroups returns the AvailableProxyGroups field value -func (o *Plan) GetAvailableProxyGroups() map[string]int32 { - if o == nil { - var ret map[string]int32 - return ret - } - - return o.AvailableProxyGroups -} - -// GetAvailableProxyGroupsOk returns a tuple with the AvailableProxyGroups field value -// and a boolean to check if the value has been set. -func (o *Plan) GetAvailableProxyGroupsOk() (map[string]int32, bool) { - if o == nil { - return map[string]int32{}, false - } - return o.AvailableProxyGroups, true -} - -// SetAvailableProxyGroups sets field value -func (o *Plan) SetAvailableProxyGroups(v map[string]int32) { - o.AvailableProxyGroups = v -} - -// GetTeamAccountSeatCount returns the TeamAccountSeatCount field value -func (o *Plan) GetTeamAccountSeatCount() int32 { - if o == nil { - var ret int32 - return ret - } - - return o.TeamAccountSeatCount -} - -// GetTeamAccountSeatCountOk returns a tuple with the TeamAccountSeatCount field value -// and a boolean to check if the value has been set. -func (o *Plan) GetTeamAccountSeatCountOk() (*int32, bool) { - if o == nil { - return nil, false - } - return &o.TeamAccountSeatCount, true -} - -// SetTeamAccountSeatCount sets field value -func (o *Plan) SetTeamAccountSeatCount(v int32) { - o.TeamAccountSeatCount = v -} - -// GetSupportLevel returns the SupportLevel field value -func (o *Plan) GetSupportLevel() string { - if o == nil { - var ret string - return ret - } - - return o.SupportLevel -} - -// GetSupportLevelOk returns a tuple with the SupportLevel field value -// and a boolean to check if the value has been set. -func (o *Plan) GetSupportLevelOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.SupportLevel, true -} - -// SetSupportLevel sets field value -func (o *Plan) SetSupportLevel(v string) { - o.SupportLevel = v -} - -// GetAvailableAddOns returns the AvailableAddOns field value -func (o *Plan) GetAvailableAddOns() []string { - if o == nil { - var ret []string - return ret - } - - return o.AvailableAddOns -} - -// GetAvailableAddOnsOk returns a tuple with the AvailableAddOns field value -// and a boolean to check if the value has been set. -func (o *Plan) GetAvailableAddOnsOk() ([]string, bool) { - if o == nil { - return nil, false - } - return o.AvailableAddOns, true -} - -// SetAvailableAddOns sets field value -func (o *Plan) SetAvailableAddOns(v []string) { - o.AvailableAddOns = v -} - -// GetTier returns the Tier field value if set, zero value otherwise. -func (o *Plan) GetTier() string { - if o == nil || IsNil(o.Tier) { - var ret string - return ret - } - return *o.Tier -} - -// GetTierOk returns a tuple with the Tier field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Plan) GetTierOk() (*string, bool) { - if o == nil || IsNil(o.Tier) { - return nil, false - } - return o.Tier, true -} - -// HasTier returns a boolean if a field has been set. -func (o *Plan) HasTier() bool { - if o != nil && !IsNil(o.Tier) { - return true - } - - return false -} - -// SetTier gets a reference to the given string and assigns it to the Tier field. -func (o *Plan) SetTier(v string) { - o.Tier = &v -} - -// GetApiRateLimitBoosts returns the ApiRateLimitBoosts field value if set, zero value otherwise. -func (o *Plan) GetApiRateLimitBoosts() int32 { - if o == nil || IsNil(o.ApiRateLimitBoosts) { - var ret int32 - return ret - } - return *o.ApiRateLimitBoosts -} - -// GetApiRateLimitBoostsOk returns a tuple with the ApiRateLimitBoosts field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Plan) GetApiRateLimitBoostsOk() (*int32, bool) { - if o == nil || IsNil(o.ApiRateLimitBoosts) { - return nil, false - } - return o.ApiRateLimitBoosts, true -} - -// HasApiRateLimitBoosts returns a boolean if a field has been set. -func (o *Plan) HasApiRateLimitBoosts() bool { - if o != nil && !IsNil(o.ApiRateLimitBoosts) { - return true - } - - return false -} - -// SetApiRateLimitBoosts gets a reference to the given int32 and assigns it to the ApiRateLimitBoosts field. -func (o *Plan) SetApiRateLimitBoosts(v int32) { - o.ApiRateLimitBoosts = &v -} - -// GetMaxScheduleCount returns the MaxScheduleCount field value if set, zero value otherwise. -func (o *Plan) GetMaxScheduleCount() int32 { - if o == nil || IsNil(o.MaxScheduleCount) { - var ret int32 - return ret - } - return *o.MaxScheduleCount -} - -// GetMaxScheduleCountOk returns a tuple with the MaxScheduleCount field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Plan) GetMaxScheduleCountOk() (*int32, bool) { - if o == nil || IsNil(o.MaxScheduleCount) { - return nil, false - } - return o.MaxScheduleCount, true -} - -// HasMaxScheduleCount returns a boolean if a field has been set. -func (o *Plan) HasMaxScheduleCount() bool { - if o != nil && !IsNil(o.MaxScheduleCount) { - return true - } - - return false -} - -// SetMaxScheduleCount gets a reference to the given int32 and assigns it to the MaxScheduleCount field. -func (o *Plan) SetMaxScheduleCount(v int32) { - o.MaxScheduleCount = &v -} - -// GetMaxConcurrentActorRuns returns the MaxConcurrentActorRuns field value if set, zero value otherwise. -func (o *Plan) GetMaxConcurrentActorRuns() int32 { - if o == nil || IsNil(o.MaxConcurrentActorRuns) { - var ret int32 - return ret - } - return *o.MaxConcurrentActorRuns -} - -// GetMaxConcurrentActorRunsOk returns a tuple with the MaxConcurrentActorRuns field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Plan) GetMaxConcurrentActorRunsOk() (*int32, bool) { - if o == nil || IsNil(o.MaxConcurrentActorRuns) { - return nil, false - } - return o.MaxConcurrentActorRuns, true -} - -// HasMaxConcurrentActorRuns returns a boolean if a field has been set. -func (o *Plan) HasMaxConcurrentActorRuns() bool { - if o != nil && !IsNil(o.MaxConcurrentActorRuns) { - return true - } - - return false -} - -// SetMaxConcurrentActorRuns gets a reference to the given int32 and assigns it to the MaxConcurrentActorRuns field. -func (o *Plan) SetMaxConcurrentActorRuns(v int32) { - o.MaxConcurrentActorRuns = &v -} - -// GetPlanPricing returns the PlanPricing field value if set, zero value otherwise. -func (o *Plan) GetPlanPricing() map[string]interface{} { - if o == nil || IsNil(o.PlanPricing) { - var ret map[string]interface{} - return ret - } - return o.PlanPricing -} - -// GetPlanPricingOk returns a tuple with the PlanPricing field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Plan) GetPlanPricingOk() (map[string]interface{}, bool) { - if o == nil || IsNil(o.PlanPricing) { - return map[string]interface{}{}, false - } - return o.PlanPricing, true -} - -// HasPlanPricing returns a boolean if a field has been set. -func (o *Plan) HasPlanPricing() bool { - if o != nil && !IsNil(o.PlanPricing) { - return true - } - - return false -} - -// SetPlanPricing gets a reference to the given map[string]interface{} and assigns it to the PlanPricing field. -func (o *Plan) SetPlanPricing(v map[string]interface{}) { - o.PlanPricing = v -} - -func (o Plan) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o Plan) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["id"] = o.Id - toSerialize["description"] = o.Description - toSerialize["isEnabled"] = o.IsEnabled - toSerialize["monthlyBasePriceUsd"] = o.MonthlyBasePriceUsd - toSerialize["monthlyUsageCreditsUsd"] = o.MonthlyUsageCreditsUsd - if !IsNil(o.UsageDiscountPercent) { - toSerialize["usageDiscountPercent"] = o.UsageDiscountPercent - } - toSerialize["enabledPlatformFeatures"] = o.EnabledPlatformFeatures - toSerialize["maxMonthlyUsageUsd"] = o.MaxMonthlyUsageUsd - toSerialize["maxActorMemoryGbytes"] = o.MaxActorMemoryGbytes - toSerialize["maxMonthlyActorComputeUnits"] = o.MaxMonthlyActorComputeUnits - toSerialize["maxMonthlyResidentialProxyGbytes"] = o.MaxMonthlyResidentialProxyGbytes - toSerialize["maxMonthlyProxySerps"] = o.MaxMonthlyProxySerps - toSerialize["maxMonthlyExternalDataTransferGbytes"] = o.MaxMonthlyExternalDataTransferGbytes - toSerialize["maxActorCount"] = o.MaxActorCount - toSerialize["maxActorTaskCount"] = o.MaxActorTaskCount - toSerialize["dataRetentionDays"] = o.DataRetentionDays - toSerialize["availableProxyGroups"] = o.AvailableProxyGroups - toSerialize["teamAccountSeatCount"] = o.TeamAccountSeatCount - toSerialize["supportLevel"] = o.SupportLevel - toSerialize["availableAddOns"] = o.AvailableAddOns - if !IsNil(o.Tier) { - toSerialize["tier"] = o.Tier - } - if !IsNil(o.ApiRateLimitBoosts) { - toSerialize["apiRateLimitBoosts"] = o.ApiRateLimitBoosts - } - if !IsNil(o.MaxScheduleCount) { - toSerialize["maxScheduleCount"] = o.MaxScheduleCount - } - if !IsNil(o.MaxConcurrentActorRuns) { - toSerialize["maxConcurrentActorRuns"] = o.MaxConcurrentActorRuns - } - if !IsNil(o.PlanPricing) { - toSerialize["planPricing"] = o.PlanPricing - } - return toSerialize, nil -} - -func (o *Plan) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "id", - "description", - "isEnabled", - "monthlyBasePriceUsd", - "monthlyUsageCreditsUsd", - "enabledPlatformFeatures", - "maxMonthlyUsageUsd", - "maxActorMemoryGbytes", - "maxMonthlyActorComputeUnits", - "maxMonthlyResidentialProxyGbytes", - "maxMonthlyProxySerps", - "maxMonthlyExternalDataTransferGbytes", - "maxActorCount", - "maxActorTaskCount", - "dataRetentionDays", - "availableProxyGroups", - "teamAccountSeatCount", - "supportLevel", - "availableAddOns", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err; - } - - for _, requiredProperty := range(requiredProperties) { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varPlan := _Plan{} - - decoder := json.NewDecoder(bytes.NewReader(data)) - decoder.DisallowUnknownFields() - err = decoder.Decode(&varPlan) - - if err != nil { - return err - } - - *o = Plan(varPlan) - - return err -} - -type NullablePlan struct { - value *Plan - isSet bool -} - -func (v NullablePlan) Get() *Plan { - return v.value -} - -func (v *NullablePlan) Set(val *Plan) { - v.value = val - v.isSet = true -} - -func (v NullablePlan) IsSet() bool { - return v.isSet -} - -func (v *NullablePlan) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullablePlan(val *Plan) *NullablePlan { - return &NullablePlan{value: val, isSet: true} -} - -func (v NullablePlan) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullablePlan) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_price_per_dataset_item_actor_pricing_info.go b/model_price_per_dataset_item_actor_pricing_info.go deleted file mode 100644 index cbec914..0000000 --- a/model_price_per_dataset_item_actor_pricing_info.go +++ /dev/null @@ -1,529 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" - "time" - "bytes" - "fmt" -) - -// checks if the PricePerDatasetItemActorPricingInfo type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &PricePerDatasetItemActorPricingInfo{} - -// PricePerDatasetItemActorPricingInfo struct for PricePerDatasetItemActorPricingInfo -type PricePerDatasetItemActorPricingInfo struct { - // In [0, 1], fraction of pricePerUnitUsd that goes to Apify - ApifyMarginPercentage float32 `json:"apifyMarginPercentage"` - // When this pricing info record has been created - CreatedAt time.Time `json:"createdAt"` - // Since when is this pricing info record effective for a given Actor - StartedAt time.Time `json:"startedAt"` - NotifiedAboutFutureChangeAt *time.Time `json:"notifiedAboutFutureChangeAt,omitempty"` - NotifiedAboutChangeAt *time.Time `json:"notifiedAboutChangeAt,omitempty"` - ReasonForChange *string `json:"reasonForChange,omitempty"` - IsPriceChangeNotificationSuppressed *bool `json:"isPriceChangeNotificationSuppressed,omitempty"` - ForceContainsSignificantPriceChange *bool `json:"forceContainsSignificantPriceChange,omitempty"` - PricingModel string `json:"pricingModel"` - // Name of the unit that is being charged - UnitName string `json:"unitName"` - // Price per unit in USD. Mutually exclusive with `tieredPricing` - exactly one of the two is present on a pricing record. - PricePerUnitUsd *float32 `json:"pricePerUnitUsd,omitempty"` - // Tiered price-per-dataset-item pricing, keyed by subscription tier (e.g. `FREE`, `BRONZE`, `SILVER`, `GOLD`, `PLATINUM`, `DIAMOND`). The actual price applied to a run is resolved from the user's tier. - TieredPricing map[string]TieredPricingPerDatasetItemEntry `json:"tieredPricing,omitempty"` -} - -type _PricePerDatasetItemActorPricingInfo PricePerDatasetItemActorPricingInfo - -// NewPricePerDatasetItemActorPricingInfo instantiates a new PricePerDatasetItemActorPricingInfo object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewPricePerDatasetItemActorPricingInfo(apifyMarginPercentage float32, createdAt time.Time, startedAt time.Time, pricingModel string, unitName string) *PricePerDatasetItemActorPricingInfo { - this := PricePerDatasetItemActorPricingInfo{} - this.ApifyMarginPercentage = apifyMarginPercentage - this.CreatedAt = createdAt - this.StartedAt = startedAt - this.PricingModel = pricingModel - this.UnitName = unitName - return &this -} - -// NewPricePerDatasetItemActorPricingInfoWithDefaults instantiates a new PricePerDatasetItemActorPricingInfo object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewPricePerDatasetItemActorPricingInfoWithDefaults() *PricePerDatasetItemActorPricingInfo { - this := PricePerDatasetItemActorPricingInfo{} - return &this -} - -// GetApifyMarginPercentage returns the ApifyMarginPercentage field value -func (o *PricePerDatasetItemActorPricingInfo) GetApifyMarginPercentage() float32 { - if o == nil { - var ret float32 - return ret - } - - return o.ApifyMarginPercentage -} - -// GetApifyMarginPercentageOk returns a tuple with the ApifyMarginPercentage field value -// and a boolean to check if the value has been set. -func (o *PricePerDatasetItemActorPricingInfo) GetApifyMarginPercentageOk() (*float32, bool) { - if o == nil { - return nil, false - } - return &o.ApifyMarginPercentage, true -} - -// SetApifyMarginPercentage sets field value -func (o *PricePerDatasetItemActorPricingInfo) SetApifyMarginPercentage(v float32) { - o.ApifyMarginPercentage = v -} - -// GetCreatedAt returns the CreatedAt field value -func (o *PricePerDatasetItemActorPricingInfo) GetCreatedAt() time.Time { - if o == nil { - var ret time.Time - return ret - } - - return o.CreatedAt -} - -// GetCreatedAtOk returns a tuple with the CreatedAt field value -// and a boolean to check if the value has been set. -func (o *PricePerDatasetItemActorPricingInfo) GetCreatedAtOk() (*time.Time, bool) { - if o == nil { - return nil, false - } - return &o.CreatedAt, true -} - -// SetCreatedAt sets field value -func (o *PricePerDatasetItemActorPricingInfo) SetCreatedAt(v time.Time) { - o.CreatedAt = v -} - -// GetStartedAt returns the StartedAt field value -func (o *PricePerDatasetItemActorPricingInfo) GetStartedAt() time.Time { - if o == nil { - var ret time.Time - return ret - } - - return o.StartedAt -} - -// GetStartedAtOk returns a tuple with the StartedAt field value -// and a boolean to check if the value has been set. -func (o *PricePerDatasetItemActorPricingInfo) GetStartedAtOk() (*time.Time, bool) { - if o == nil { - return nil, false - } - return &o.StartedAt, true -} - -// SetStartedAt sets field value -func (o *PricePerDatasetItemActorPricingInfo) SetStartedAt(v time.Time) { - o.StartedAt = v -} - -// GetNotifiedAboutFutureChangeAt returns the NotifiedAboutFutureChangeAt field value if set, zero value otherwise. -func (o *PricePerDatasetItemActorPricingInfo) GetNotifiedAboutFutureChangeAt() time.Time { - if o == nil || IsNil(o.NotifiedAboutFutureChangeAt) { - var ret time.Time - return ret - } - return *o.NotifiedAboutFutureChangeAt -} - -// GetNotifiedAboutFutureChangeAtOk returns a tuple with the NotifiedAboutFutureChangeAt field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *PricePerDatasetItemActorPricingInfo) GetNotifiedAboutFutureChangeAtOk() (*time.Time, bool) { - if o == nil || IsNil(o.NotifiedAboutFutureChangeAt) { - return nil, false - } - return o.NotifiedAboutFutureChangeAt, true -} - -// HasNotifiedAboutFutureChangeAt returns a boolean if a field has been set. -func (o *PricePerDatasetItemActorPricingInfo) HasNotifiedAboutFutureChangeAt() bool { - if o != nil && !IsNil(o.NotifiedAboutFutureChangeAt) { - return true - } - - return false -} - -// SetNotifiedAboutFutureChangeAt gets a reference to the given time.Time and assigns it to the NotifiedAboutFutureChangeAt field. -func (o *PricePerDatasetItemActorPricingInfo) SetNotifiedAboutFutureChangeAt(v time.Time) { - o.NotifiedAboutFutureChangeAt = &v -} - -// GetNotifiedAboutChangeAt returns the NotifiedAboutChangeAt field value if set, zero value otherwise. -func (o *PricePerDatasetItemActorPricingInfo) GetNotifiedAboutChangeAt() time.Time { - if o == nil || IsNil(o.NotifiedAboutChangeAt) { - var ret time.Time - return ret - } - return *o.NotifiedAboutChangeAt -} - -// GetNotifiedAboutChangeAtOk returns a tuple with the NotifiedAboutChangeAt field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *PricePerDatasetItemActorPricingInfo) GetNotifiedAboutChangeAtOk() (*time.Time, bool) { - if o == nil || IsNil(o.NotifiedAboutChangeAt) { - return nil, false - } - return o.NotifiedAboutChangeAt, true -} - -// HasNotifiedAboutChangeAt returns a boolean if a field has been set. -func (o *PricePerDatasetItemActorPricingInfo) HasNotifiedAboutChangeAt() bool { - if o != nil && !IsNil(o.NotifiedAboutChangeAt) { - return true - } - - return false -} - -// SetNotifiedAboutChangeAt gets a reference to the given time.Time and assigns it to the NotifiedAboutChangeAt field. -func (o *PricePerDatasetItemActorPricingInfo) SetNotifiedAboutChangeAt(v time.Time) { - o.NotifiedAboutChangeAt = &v -} - -// GetReasonForChange returns the ReasonForChange field value if set, zero value otherwise. -func (o *PricePerDatasetItemActorPricingInfo) GetReasonForChange() string { - if o == nil || IsNil(o.ReasonForChange) { - var ret string - return ret - } - return *o.ReasonForChange -} - -// GetReasonForChangeOk returns a tuple with the ReasonForChange field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *PricePerDatasetItemActorPricingInfo) GetReasonForChangeOk() (*string, bool) { - if o == nil || IsNil(o.ReasonForChange) { - return nil, false - } - return o.ReasonForChange, true -} - -// HasReasonForChange returns a boolean if a field has been set. -func (o *PricePerDatasetItemActorPricingInfo) HasReasonForChange() bool { - if o != nil && !IsNil(o.ReasonForChange) { - return true - } - - return false -} - -// SetReasonForChange gets a reference to the given string and assigns it to the ReasonForChange field. -func (o *PricePerDatasetItemActorPricingInfo) SetReasonForChange(v string) { - o.ReasonForChange = &v -} - -// GetIsPriceChangeNotificationSuppressed returns the IsPriceChangeNotificationSuppressed field value if set, zero value otherwise. -func (o *PricePerDatasetItemActorPricingInfo) GetIsPriceChangeNotificationSuppressed() bool { - if o == nil || IsNil(o.IsPriceChangeNotificationSuppressed) { - var ret bool - return ret - } - return *o.IsPriceChangeNotificationSuppressed -} - -// GetIsPriceChangeNotificationSuppressedOk returns a tuple with the IsPriceChangeNotificationSuppressed field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *PricePerDatasetItemActorPricingInfo) GetIsPriceChangeNotificationSuppressedOk() (*bool, bool) { - if o == nil || IsNil(o.IsPriceChangeNotificationSuppressed) { - return nil, false - } - return o.IsPriceChangeNotificationSuppressed, true -} - -// HasIsPriceChangeNotificationSuppressed returns a boolean if a field has been set. -func (o *PricePerDatasetItemActorPricingInfo) HasIsPriceChangeNotificationSuppressed() bool { - if o != nil && !IsNil(o.IsPriceChangeNotificationSuppressed) { - return true - } - - return false -} - -// SetIsPriceChangeNotificationSuppressed gets a reference to the given bool and assigns it to the IsPriceChangeNotificationSuppressed field. -func (o *PricePerDatasetItemActorPricingInfo) SetIsPriceChangeNotificationSuppressed(v bool) { - o.IsPriceChangeNotificationSuppressed = &v -} - -// GetForceContainsSignificantPriceChange returns the ForceContainsSignificantPriceChange field value if set, zero value otherwise. -func (o *PricePerDatasetItemActorPricingInfo) GetForceContainsSignificantPriceChange() bool { - if o == nil || IsNil(o.ForceContainsSignificantPriceChange) { - var ret bool - return ret - } - return *o.ForceContainsSignificantPriceChange -} - -// GetForceContainsSignificantPriceChangeOk returns a tuple with the ForceContainsSignificantPriceChange field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *PricePerDatasetItemActorPricingInfo) GetForceContainsSignificantPriceChangeOk() (*bool, bool) { - if o == nil || IsNil(o.ForceContainsSignificantPriceChange) { - return nil, false - } - return o.ForceContainsSignificantPriceChange, true -} - -// HasForceContainsSignificantPriceChange returns a boolean if a field has been set. -func (o *PricePerDatasetItemActorPricingInfo) HasForceContainsSignificantPriceChange() bool { - if o != nil && !IsNil(o.ForceContainsSignificantPriceChange) { - return true - } - - return false -} - -// SetForceContainsSignificantPriceChange gets a reference to the given bool and assigns it to the ForceContainsSignificantPriceChange field. -func (o *PricePerDatasetItemActorPricingInfo) SetForceContainsSignificantPriceChange(v bool) { - o.ForceContainsSignificantPriceChange = &v -} - -// GetPricingModel returns the PricingModel field value -func (o *PricePerDatasetItemActorPricingInfo) GetPricingModel() string { - if o == nil { - var ret string - return ret - } - - return o.PricingModel -} - -// GetPricingModelOk returns a tuple with the PricingModel field value -// and a boolean to check if the value has been set. -func (o *PricePerDatasetItemActorPricingInfo) GetPricingModelOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.PricingModel, true -} - -// SetPricingModel sets field value -func (o *PricePerDatasetItemActorPricingInfo) SetPricingModel(v string) { - o.PricingModel = v -} - -// GetUnitName returns the UnitName field value -func (o *PricePerDatasetItemActorPricingInfo) GetUnitName() string { - if o == nil { - var ret string - return ret - } - - return o.UnitName -} - -// GetUnitNameOk returns a tuple with the UnitName field value -// and a boolean to check if the value has been set. -func (o *PricePerDatasetItemActorPricingInfo) GetUnitNameOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.UnitName, true -} - -// SetUnitName sets field value -func (o *PricePerDatasetItemActorPricingInfo) SetUnitName(v string) { - o.UnitName = v -} - -// GetPricePerUnitUsd returns the PricePerUnitUsd field value if set, zero value otherwise. -func (o *PricePerDatasetItemActorPricingInfo) GetPricePerUnitUsd() float32 { - if o == nil || IsNil(o.PricePerUnitUsd) { - var ret float32 - return ret - } - return *o.PricePerUnitUsd -} - -// GetPricePerUnitUsdOk returns a tuple with the PricePerUnitUsd field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *PricePerDatasetItemActorPricingInfo) GetPricePerUnitUsdOk() (*float32, bool) { - if o == nil || IsNil(o.PricePerUnitUsd) { - return nil, false - } - return o.PricePerUnitUsd, true -} - -// HasPricePerUnitUsd returns a boolean if a field has been set. -func (o *PricePerDatasetItemActorPricingInfo) HasPricePerUnitUsd() bool { - if o != nil && !IsNil(o.PricePerUnitUsd) { - return true - } - - return false -} - -// SetPricePerUnitUsd gets a reference to the given float32 and assigns it to the PricePerUnitUsd field. -func (o *PricePerDatasetItemActorPricingInfo) SetPricePerUnitUsd(v float32) { - o.PricePerUnitUsd = &v -} - -// GetTieredPricing returns the TieredPricing field value if set, zero value otherwise. -func (o *PricePerDatasetItemActorPricingInfo) GetTieredPricing() map[string]TieredPricingPerDatasetItemEntry { - if o == nil || IsNil(o.TieredPricing) { - var ret map[string]TieredPricingPerDatasetItemEntry - return ret - } - return o.TieredPricing -} - -// GetTieredPricingOk returns a tuple with the TieredPricing field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *PricePerDatasetItemActorPricingInfo) GetTieredPricingOk() (map[string]TieredPricingPerDatasetItemEntry, bool) { - if o == nil || IsNil(o.TieredPricing) { - return map[string]TieredPricingPerDatasetItemEntry{}, false - } - return o.TieredPricing, true -} - -// HasTieredPricing returns a boolean if a field has been set. -func (o *PricePerDatasetItemActorPricingInfo) HasTieredPricing() bool { - if o != nil && !IsNil(o.TieredPricing) { - return true - } - - return false -} - -// SetTieredPricing gets a reference to the given map[string]TieredPricingPerDatasetItemEntry and assigns it to the TieredPricing field. -func (o *PricePerDatasetItemActorPricingInfo) SetTieredPricing(v map[string]TieredPricingPerDatasetItemEntry) { - o.TieredPricing = v -} - -func (o PricePerDatasetItemActorPricingInfo) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o PricePerDatasetItemActorPricingInfo) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["apifyMarginPercentage"] = o.ApifyMarginPercentage - toSerialize["createdAt"] = o.CreatedAt - toSerialize["startedAt"] = o.StartedAt - if !IsNil(o.NotifiedAboutFutureChangeAt) { - toSerialize["notifiedAboutFutureChangeAt"] = o.NotifiedAboutFutureChangeAt - } - if !IsNil(o.NotifiedAboutChangeAt) { - toSerialize["notifiedAboutChangeAt"] = o.NotifiedAboutChangeAt - } - if !IsNil(o.ReasonForChange) { - toSerialize["reasonForChange"] = o.ReasonForChange - } - if !IsNil(o.IsPriceChangeNotificationSuppressed) { - toSerialize["isPriceChangeNotificationSuppressed"] = o.IsPriceChangeNotificationSuppressed - } - if !IsNil(o.ForceContainsSignificantPriceChange) { - toSerialize["forceContainsSignificantPriceChange"] = o.ForceContainsSignificantPriceChange - } - toSerialize["pricingModel"] = o.PricingModel - toSerialize["unitName"] = o.UnitName - if !IsNil(o.PricePerUnitUsd) { - toSerialize["pricePerUnitUsd"] = o.PricePerUnitUsd - } - if !IsNil(o.TieredPricing) { - toSerialize["tieredPricing"] = o.TieredPricing - } - return toSerialize, nil -} - -func (o *PricePerDatasetItemActorPricingInfo) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "apifyMarginPercentage", - "createdAt", - "startedAt", - "pricingModel", - "unitName", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err; - } - - for _, requiredProperty := range(requiredProperties) { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varPricePerDatasetItemActorPricingInfo := _PricePerDatasetItemActorPricingInfo{} - - decoder := json.NewDecoder(bytes.NewReader(data)) - decoder.DisallowUnknownFields() - err = decoder.Decode(&varPricePerDatasetItemActorPricingInfo) - - if err != nil { - return err - } - - *o = PricePerDatasetItemActorPricingInfo(varPricePerDatasetItemActorPricingInfo) - - return err -} - -type NullablePricePerDatasetItemActorPricingInfo struct { - value *PricePerDatasetItemActorPricingInfo - isSet bool -} - -func (v NullablePricePerDatasetItemActorPricingInfo) Get() *PricePerDatasetItemActorPricingInfo { - return v.value -} - -func (v *NullablePricePerDatasetItemActorPricingInfo) Set(val *PricePerDatasetItemActorPricingInfo) { - v.value = val - v.isSet = true -} - -func (v NullablePricePerDatasetItemActorPricingInfo) IsSet() bool { - return v.isSet -} - -func (v *NullablePricePerDatasetItemActorPricingInfo) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullablePricePerDatasetItemActorPricingInfo(val *PricePerDatasetItemActorPricingInfo) *NullablePricePerDatasetItemActorPricingInfo { - return &NullablePricePerDatasetItemActorPricingInfo{value: val, isSet: true} -} - -func (v NullablePricePerDatasetItemActorPricingInfo) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullablePricePerDatasetItemActorPricingInfo) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_price_tiers.go b/model_price_tiers.go deleted file mode 100644 index bbc940d..0000000 --- a/model_price_tiers.go +++ /dev/null @@ -1,270 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" - "bytes" - "fmt" -) - -// checks if the PriceTiers type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &PriceTiers{} - -// PriceTiers struct for PriceTiers -type PriceTiers struct { - QuantityAbove float32 `json:"quantityAbove"` - DiscountPercent float32 `json:"discountPercent"` - TierQuantity float32 `json:"tierQuantity"` - UnitPriceUsd float32 `json:"unitPriceUsd"` - PriceUsd float32 `json:"priceUsd"` -} - -type _PriceTiers PriceTiers - -// NewPriceTiers instantiates a new PriceTiers object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewPriceTiers(quantityAbove float32, discountPercent float32, tierQuantity float32, unitPriceUsd float32, priceUsd float32) *PriceTiers { - this := PriceTiers{} - this.QuantityAbove = quantityAbove - this.DiscountPercent = discountPercent - this.TierQuantity = tierQuantity - this.UnitPriceUsd = unitPriceUsd - this.PriceUsd = priceUsd - return &this -} - -// NewPriceTiersWithDefaults instantiates a new PriceTiers object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewPriceTiersWithDefaults() *PriceTiers { - this := PriceTiers{} - return &this -} - -// GetQuantityAbove returns the QuantityAbove field value -func (o *PriceTiers) GetQuantityAbove() float32 { - if o == nil { - var ret float32 - return ret - } - - return o.QuantityAbove -} - -// GetQuantityAboveOk returns a tuple with the QuantityAbove field value -// and a boolean to check if the value has been set. -func (o *PriceTiers) GetQuantityAboveOk() (*float32, bool) { - if o == nil { - return nil, false - } - return &o.QuantityAbove, true -} - -// SetQuantityAbove sets field value -func (o *PriceTiers) SetQuantityAbove(v float32) { - o.QuantityAbove = v -} - -// GetDiscountPercent returns the DiscountPercent field value -func (o *PriceTiers) GetDiscountPercent() float32 { - if o == nil { - var ret float32 - return ret - } - - return o.DiscountPercent -} - -// GetDiscountPercentOk returns a tuple with the DiscountPercent field value -// and a boolean to check if the value has been set. -func (o *PriceTiers) GetDiscountPercentOk() (*float32, bool) { - if o == nil { - return nil, false - } - return &o.DiscountPercent, true -} - -// SetDiscountPercent sets field value -func (o *PriceTiers) SetDiscountPercent(v float32) { - o.DiscountPercent = v -} - -// GetTierQuantity returns the TierQuantity field value -func (o *PriceTiers) GetTierQuantity() float32 { - if o == nil { - var ret float32 - return ret - } - - return o.TierQuantity -} - -// GetTierQuantityOk returns a tuple with the TierQuantity field value -// and a boolean to check if the value has been set. -func (o *PriceTiers) GetTierQuantityOk() (*float32, bool) { - if o == nil { - return nil, false - } - return &o.TierQuantity, true -} - -// SetTierQuantity sets field value -func (o *PriceTiers) SetTierQuantity(v float32) { - o.TierQuantity = v -} - -// GetUnitPriceUsd returns the UnitPriceUsd field value -func (o *PriceTiers) GetUnitPriceUsd() float32 { - if o == nil { - var ret float32 - return ret - } - - return o.UnitPriceUsd -} - -// GetUnitPriceUsdOk returns a tuple with the UnitPriceUsd field value -// and a boolean to check if the value has been set. -func (o *PriceTiers) GetUnitPriceUsdOk() (*float32, bool) { - if o == nil { - return nil, false - } - return &o.UnitPriceUsd, true -} - -// SetUnitPriceUsd sets field value -func (o *PriceTiers) SetUnitPriceUsd(v float32) { - o.UnitPriceUsd = v -} - -// GetPriceUsd returns the PriceUsd field value -func (o *PriceTiers) GetPriceUsd() float32 { - if o == nil { - var ret float32 - return ret - } - - return o.PriceUsd -} - -// GetPriceUsdOk returns a tuple with the PriceUsd field value -// and a boolean to check if the value has been set. -func (o *PriceTiers) GetPriceUsdOk() (*float32, bool) { - if o == nil { - return nil, false - } - return &o.PriceUsd, true -} - -// SetPriceUsd sets field value -func (o *PriceTiers) SetPriceUsd(v float32) { - o.PriceUsd = v -} - -func (o PriceTiers) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o PriceTiers) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["quantityAbove"] = o.QuantityAbove - toSerialize["discountPercent"] = o.DiscountPercent - toSerialize["tierQuantity"] = o.TierQuantity - toSerialize["unitPriceUsd"] = o.UnitPriceUsd - toSerialize["priceUsd"] = o.PriceUsd - return toSerialize, nil -} - -func (o *PriceTiers) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "quantityAbove", - "discountPercent", - "tierQuantity", - "unitPriceUsd", - "priceUsd", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err; - } - - for _, requiredProperty := range(requiredProperties) { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varPriceTiers := _PriceTiers{} - - decoder := json.NewDecoder(bytes.NewReader(data)) - decoder.DisallowUnknownFields() - err = decoder.Decode(&varPriceTiers) - - if err != nil { - return err - } - - *o = PriceTiers(varPriceTiers) - - return err -} - -type NullablePriceTiers struct { - value *PriceTiers - isSet bool -} - -func (v NullablePriceTiers) Get() *PriceTiers { - return v.value -} - -func (v *NullablePriceTiers) Set(val *PriceTiers) { - v.value = val - v.isSet = true -} - -func (v NullablePriceTiers) IsSet() bool { - return v.isSet -} - -func (v *NullablePriceTiers) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullablePriceTiers(val *PriceTiers) *NullablePriceTiers { - return &NullablePriceTiers{value: val, isSet: true} -} - -func (v NullablePriceTiers) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullablePriceTiers) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_private_user_data_response.go b/model_private_user_data_response.go deleted file mode 100644 index e782018..0000000 --- a/model_private_user_data_response.go +++ /dev/null @@ -1,158 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" - "bytes" - "fmt" -) - -// checks if the PrivateUserDataResponse type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &PrivateUserDataResponse{} - -// PrivateUserDataResponse struct for PrivateUserDataResponse -type PrivateUserDataResponse struct { - Data UserPrivateInfo `json:"data"` -} - -type _PrivateUserDataResponse PrivateUserDataResponse - -// NewPrivateUserDataResponse instantiates a new PrivateUserDataResponse object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewPrivateUserDataResponse(data UserPrivateInfo) *PrivateUserDataResponse { - this := PrivateUserDataResponse{} - this.Data = data - return &this -} - -// NewPrivateUserDataResponseWithDefaults instantiates a new PrivateUserDataResponse object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewPrivateUserDataResponseWithDefaults() *PrivateUserDataResponse { - this := PrivateUserDataResponse{} - return &this -} - -// GetData returns the Data field value -func (o *PrivateUserDataResponse) GetData() UserPrivateInfo { - if o == nil { - var ret UserPrivateInfo - return ret - } - - return o.Data -} - -// GetDataOk returns a tuple with the Data field value -// and a boolean to check if the value has been set. -func (o *PrivateUserDataResponse) GetDataOk() (*UserPrivateInfo, bool) { - if o == nil { - return nil, false - } - return &o.Data, true -} - -// SetData sets field value -func (o *PrivateUserDataResponse) SetData(v UserPrivateInfo) { - o.Data = v -} - -func (o PrivateUserDataResponse) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o PrivateUserDataResponse) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["data"] = o.Data - return toSerialize, nil -} - -func (o *PrivateUserDataResponse) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "data", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err; - } - - for _, requiredProperty := range(requiredProperties) { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varPrivateUserDataResponse := _PrivateUserDataResponse{} - - decoder := json.NewDecoder(bytes.NewReader(data)) - decoder.DisallowUnknownFields() - err = decoder.Decode(&varPrivateUserDataResponse) - - if err != nil { - return err - } - - *o = PrivateUserDataResponse(varPrivateUserDataResponse) - - return err -} - -type NullablePrivateUserDataResponse struct { - value *PrivateUserDataResponse - isSet bool -} - -func (v NullablePrivateUserDataResponse) Get() *PrivateUserDataResponse { - return v.value -} - -func (v *NullablePrivateUserDataResponse) Set(val *PrivateUserDataResponse) { - v.value = val - v.isSet = true -} - -func (v NullablePrivateUserDataResponse) IsSet() bool { - return v.isSet -} - -func (v *NullablePrivateUserDataResponse) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullablePrivateUserDataResponse(val *PrivateUserDataResponse) *NullablePrivateUserDataResponse { - return &NullablePrivateUserDataResponse{value: val, isSet: true} -} - -func (v NullablePrivateUserDataResponse) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullablePrivateUserDataResponse) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_profile.go b/model_profile.go deleted file mode 100644 index 6b3b90b..0000000 --- a/model_profile.go +++ /dev/null @@ -1,306 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" -) - -// checks if the Profile type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &Profile{} - -// Profile struct for Profile -type Profile struct { - Bio *string `json:"bio,omitempty"` - Name *string `json:"name,omitempty"` - PictureUrl *string `json:"pictureUrl,omitempty"` - GithubUsername *string `json:"githubUsername,omitempty"` - WebsiteUrl *string `json:"websiteUrl,omitempty"` - TwitterUsername *string `json:"twitterUsername,omitempty"` -} - -// NewProfile instantiates a new Profile object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewProfile() *Profile { - this := Profile{} - return &this -} - -// NewProfileWithDefaults instantiates a new Profile object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewProfileWithDefaults() *Profile { - this := Profile{} - return &this -} - -// GetBio returns the Bio field value if set, zero value otherwise. -func (o *Profile) GetBio() string { - if o == nil || IsNil(o.Bio) { - var ret string - return ret - } - return *o.Bio -} - -// GetBioOk returns a tuple with the Bio field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Profile) GetBioOk() (*string, bool) { - if o == nil || IsNil(o.Bio) { - return nil, false - } - return o.Bio, true -} - -// HasBio returns a boolean if a field has been set. -func (o *Profile) HasBio() bool { - if o != nil && !IsNil(o.Bio) { - return true - } - - return false -} - -// SetBio gets a reference to the given string and assigns it to the Bio field. -func (o *Profile) SetBio(v string) { - o.Bio = &v -} - -// GetName returns the Name field value if set, zero value otherwise. -func (o *Profile) GetName() string { - if o == nil || IsNil(o.Name) { - var ret string - return ret - } - return *o.Name -} - -// GetNameOk returns a tuple with the Name field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Profile) GetNameOk() (*string, bool) { - if o == nil || IsNil(o.Name) { - return nil, false - } - return o.Name, true -} - -// HasName returns a boolean if a field has been set. -func (o *Profile) HasName() bool { - if o != nil && !IsNil(o.Name) { - return true - } - - return false -} - -// SetName gets a reference to the given string and assigns it to the Name field. -func (o *Profile) SetName(v string) { - o.Name = &v -} - -// GetPictureUrl returns the PictureUrl field value if set, zero value otherwise. -func (o *Profile) GetPictureUrl() string { - if o == nil || IsNil(o.PictureUrl) { - var ret string - return ret - } - return *o.PictureUrl -} - -// GetPictureUrlOk returns a tuple with the PictureUrl field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Profile) GetPictureUrlOk() (*string, bool) { - if o == nil || IsNil(o.PictureUrl) { - return nil, false - } - return o.PictureUrl, true -} - -// HasPictureUrl returns a boolean if a field has been set. -func (o *Profile) HasPictureUrl() bool { - if o != nil && !IsNil(o.PictureUrl) { - return true - } - - return false -} - -// SetPictureUrl gets a reference to the given string and assigns it to the PictureUrl field. -func (o *Profile) SetPictureUrl(v string) { - o.PictureUrl = &v -} - -// GetGithubUsername returns the GithubUsername field value if set, zero value otherwise. -func (o *Profile) GetGithubUsername() string { - if o == nil || IsNil(o.GithubUsername) { - var ret string - return ret - } - return *o.GithubUsername -} - -// GetGithubUsernameOk returns a tuple with the GithubUsername field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Profile) GetGithubUsernameOk() (*string, bool) { - if o == nil || IsNil(o.GithubUsername) { - return nil, false - } - return o.GithubUsername, true -} - -// HasGithubUsername returns a boolean if a field has been set. -func (o *Profile) HasGithubUsername() bool { - if o != nil && !IsNil(o.GithubUsername) { - return true - } - - return false -} - -// SetGithubUsername gets a reference to the given string and assigns it to the GithubUsername field. -func (o *Profile) SetGithubUsername(v string) { - o.GithubUsername = &v -} - -// GetWebsiteUrl returns the WebsiteUrl field value if set, zero value otherwise. -func (o *Profile) GetWebsiteUrl() string { - if o == nil || IsNil(o.WebsiteUrl) { - var ret string - return ret - } - return *o.WebsiteUrl -} - -// GetWebsiteUrlOk returns a tuple with the WebsiteUrl field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Profile) GetWebsiteUrlOk() (*string, bool) { - if o == nil || IsNil(o.WebsiteUrl) { - return nil, false - } - return o.WebsiteUrl, true -} - -// HasWebsiteUrl returns a boolean if a field has been set. -func (o *Profile) HasWebsiteUrl() bool { - if o != nil && !IsNil(o.WebsiteUrl) { - return true - } - - return false -} - -// SetWebsiteUrl gets a reference to the given string and assigns it to the WebsiteUrl field. -func (o *Profile) SetWebsiteUrl(v string) { - o.WebsiteUrl = &v -} - -// GetTwitterUsername returns the TwitterUsername field value if set, zero value otherwise. -func (o *Profile) GetTwitterUsername() string { - if o == nil || IsNil(o.TwitterUsername) { - var ret string - return ret - } - return *o.TwitterUsername -} - -// GetTwitterUsernameOk returns a tuple with the TwitterUsername field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Profile) GetTwitterUsernameOk() (*string, bool) { - if o == nil || IsNil(o.TwitterUsername) { - return nil, false - } - return o.TwitterUsername, true -} - -// HasTwitterUsername returns a boolean if a field has been set. -func (o *Profile) HasTwitterUsername() bool { - if o != nil && !IsNil(o.TwitterUsername) { - return true - } - - return false -} - -// SetTwitterUsername gets a reference to the given string and assigns it to the TwitterUsername field. -func (o *Profile) SetTwitterUsername(v string) { - o.TwitterUsername = &v -} - -func (o Profile) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o Profile) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if !IsNil(o.Bio) { - toSerialize["bio"] = o.Bio - } - if !IsNil(o.Name) { - toSerialize["name"] = o.Name - } - if !IsNil(o.PictureUrl) { - toSerialize["pictureUrl"] = o.PictureUrl - } - if !IsNil(o.GithubUsername) { - toSerialize["githubUsername"] = o.GithubUsername - } - if !IsNil(o.WebsiteUrl) { - toSerialize["websiteUrl"] = o.WebsiteUrl - } - if !IsNil(o.TwitterUsername) { - toSerialize["twitterUsername"] = o.TwitterUsername - } - return toSerialize, nil -} - -type NullableProfile struct { - value *Profile - isSet bool -} - -func (v NullableProfile) Get() *Profile { - return v.value -} - -func (v *NullableProfile) Set(val *Profile) { - v.value = val - v.isSet = true -} - -func (v NullableProfile) IsSet() bool { - return v.isSet -} - -func (v *NullableProfile) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableProfile(val *Profile) *NullableProfile { - return &NullableProfile{value: val, isSet: true} -} - -func (v NullableProfile) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableProfile) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_prolong_request_lock_response.go b/model_prolong_request_lock_response.go deleted file mode 100644 index d885b3b..0000000 --- a/model_prolong_request_lock_response.go +++ /dev/null @@ -1,158 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" - "bytes" - "fmt" -) - -// checks if the ProlongRequestLockResponse type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &ProlongRequestLockResponse{} - -// ProlongRequestLockResponse Response containing updated lock information after prolonging a request lock. -type ProlongRequestLockResponse struct { - Data RequestLockInfo `json:"data"` -} - -type _ProlongRequestLockResponse ProlongRequestLockResponse - -// NewProlongRequestLockResponse instantiates a new ProlongRequestLockResponse object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewProlongRequestLockResponse(data RequestLockInfo) *ProlongRequestLockResponse { - this := ProlongRequestLockResponse{} - this.Data = data - return &this -} - -// NewProlongRequestLockResponseWithDefaults instantiates a new ProlongRequestLockResponse object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewProlongRequestLockResponseWithDefaults() *ProlongRequestLockResponse { - this := ProlongRequestLockResponse{} - return &this -} - -// GetData returns the Data field value -func (o *ProlongRequestLockResponse) GetData() RequestLockInfo { - if o == nil { - var ret RequestLockInfo - return ret - } - - return o.Data -} - -// GetDataOk returns a tuple with the Data field value -// and a boolean to check if the value has been set. -func (o *ProlongRequestLockResponse) GetDataOk() (*RequestLockInfo, bool) { - if o == nil { - return nil, false - } - return &o.Data, true -} - -// SetData sets field value -func (o *ProlongRequestLockResponse) SetData(v RequestLockInfo) { - o.Data = v -} - -func (o ProlongRequestLockResponse) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o ProlongRequestLockResponse) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["data"] = o.Data - return toSerialize, nil -} - -func (o *ProlongRequestLockResponse) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "data", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err; - } - - for _, requiredProperty := range(requiredProperties) { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varProlongRequestLockResponse := _ProlongRequestLockResponse{} - - decoder := json.NewDecoder(bytes.NewReader(data)) - decoder.DisallowUnknownFields() - err = decoder.Decode(&varProlongRequestLockResponse) - - if err != nil { - return err - } - - *o = ProlongRequestLockResponse(varProlongRequestLockResponse) - - return err -} - -type NullableProlongRequestLockResponse struct { - value *ProlongRequestLockResponse - isSet bool -} - -func (v NullableProlongRequestLockResponse) Get() *ProlongRequestLockResponse { - return v.value -} - -func (v *NullableProlongRequestLockResponse) Set(val *ProlongRequestLockResponse) { - v.value = val - v.isSet = true -} - -func (v NullableProlongRequestLockResponse) IsSet() bool { - return v.isSet -} - -func (v *NullableProlongRequestLockResponse) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableProlongRequestLockResponse(val *ProlongRequestLockResponse) *NullableProlongRequestLockResponse { - return &NullableProlongRequestLockResponse{value: val, isSet: true} -} - -func (v NullableProlongRequestLockResponse) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableProlongRequestLockResponse) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_proxy.go b/model_proxy.go deleted file mode 100644 index 8e4390f..0000000 --- a/model_proxy.go +++ /dev/null @@ -1,186 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" - "bytes" - "fmt" -) - -// checks if the Proxy type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &Proxy{} - -// Proxy struct for Proxy -type Proxy struct { - Password string `json:"password"` - Groups []ProxyGroup `json:"groups"` -} - -type _Proxy Proxy - -// NewProxy instantiates a new Proxy object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewProxy(password string, groups []ProxyGroup) *Proxy { - this := Proxy{} - this.Password = password - this.Groups = groups - return &this -} - -// NewProxyWithDefaults instantiates a new Proxy object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewProxyWithDefaults() *Proxy { - this := Proxy{} - return &this -} - -// GetPassword returns the Password field value -func (o *Proxy) GetPassword() string { - if o == nil { - var ret string - return ret - } - - return o.Password -} - -// GetPasswordOk returns a tuple with the Password field value -// and a boolean to check if the value has been set. -func (o *Proxy) GetPasswordOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Password, true -} - -// SetPassword sets field value -func (o *Proxy) SetPassword(v string) { - o.Password = v -} - -// GetGroups returns the Groups field value -func (o *Proxy) GetGroups() []ProxyGroup { - if o == nil { - var ret []ProxyGroup - return ret - } - - return o.Groups -} - -// GetGroupsOk returns a tuple with the Groups field value -// and a boolean to check if the value has been set. -func (o *Proxy) GetGroupsOk() ([]ProxyGroup, bool) { - if o == nil { - return nil, false - } - return o.Groups, true -} - -// SetGroups sets field value -func (o *Proxy) SetGroups(v []ProxyGroup) { - o.Groups = v -} - -func (o Proxy) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o Proxy) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["password"] = o.Password - toSerialize["groups"] = o.Groups - return toSerialize, nil -} - -func (o *Proxy) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "password", - "groups", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err; - } - - for _, requiredProperty := range(requiredProperties) { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varProxy := _Proxy{} - - decoder := json.NewDecoder(bytes.NewReader(data)) - decoder.DisallowUnknownFields() - err = decoder.Decode(&varProxy) - - if err != nil { - return err - } - - *o = Proxy(varProxy) - - return err -} - -type NullableProxy struct { - value *Proxy - isSet bool -} - -func (v NullableProxy) Get() *Proxy { - return v.value -} - -func (v *NullableProxy) Set(val *Proxy) { - v.value = val - v.isSet = true -} - -func (v NullableProxy) IsSet() bool { - return v.isSet -} - -func (v *NullableProxy) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableProxy(val *Proxy) *NullableProxy { - return &NullableProxy{value: val, isSet: true} -} - -func (v NullableProxy) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableProxy) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_proxy_group.go b/model_proxy_group.go deleted file mode 100644 index fc6880a..0000000 --- a/model_proxy_group.go +++ /dev/null @@ -1,216 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" - "bytes" - "fmt" -) - -// checks if the ProxyGroup type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &ProxyGroup{} - -// ProxyGroup struct for ProxyGroup -type ProxyGroup struct { - Name string `json:"name"` - Description NullableString `json:"description"` - AvailableCount int32 `json:"availableCount"` -} - -type _ProxyGroup ProxyGroup - -// NewProxyGroup instantiates a new ProxyGroup object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewProxyGroup(name string, description NullableString, availableCount int32) *ProxyGroup { - this := ProxyGroup{} - this.Name = name - this.Description = description - this.AvailableCount = availableCount - return &this -} - -// NewProxyGroupWithDefaults instantiates a new ProxyGroup object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewProxyGroupWithDefaults() *ProxyGroup { - this := ProxyGroup{} - return &this -} - -// GetName returns the Name field value -func (o *ProxyGroup) GetName() string { - if o == nil { - var ret string - return ret - } - - return o.Name -} - -// GetNameOk returns a tuple with the Name field value -// and a boolean to check if the value has been set. -func (o *ProxyGroup) GetNameOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Name, true -} - -// SetName sets field value -func (o *ProxyGroup) SetName(v string) { - o.Name = v -} - -// GetDescription returns the Description field value -// If the value is explicit nil, the zero value for string will be returned -func (o *ProxyGroup) GetDescription() string { - if o == nil || o.Description.Get() == nil { - var ret string - return ret - } - - return *o.Description.Get() -} - -// GetDescriptionOk returns a tuple with the Description field value -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *ProxyGroup) GetDescriptionOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.Description.Get(), o.Description.IsSet() -} - -// SetDescription sets field value -func (o *ProxyGroup) SetDescription(v string) { - o.Description.Set(&v) -} - -// GetAvailableCount returns the AvailableCount field value -func (o *ProxyGroup) GetAvailableCount() int32 { - if o == nil { - var ret int32 - return ret - } - - return o.AvailableCount -} - -// GetAvailableCountOk returns a tuple with the AvailableCount field value -// and a boolean to check if the value has been set. -func (o *ProxyGroup) GetAvailableCountOk() (*int32, bool) { - if o == nil { - return nil, false - } - return &o.AvailableCount, true -} - -// SetAvailableCount sets field value -func (o *ProxyGroup) SetAvailableCount(v int32) { - o.AvailableCount = v -} - -func (o ProxyGroup) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o ProxyGroup) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["name"] = o.Name - toSerialize["description"] = o.Description.Get() - toSerialize["availableCount"] = o.AvailableCount - return toSerialize, nil -} - -func (o *ProxyGroup) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "name", - "description", - "availableCount", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err; - } - - for _, requiredProperty := range(requiredProperties) { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varProxyGroup := _ProxyGroup{} - - decoder := json.NewDecoder(bytes.NewReader(data)) - decoder.DisallowUnknownFields() - err = decoder.Decode(&varProxyGroup) - - if err != nil { - return err - } - - *o = ProxyGroup(varProxyGroup) - - return err -} - -type NullableProxyGroup struct { - value *ProxyGroup - isSet bool -} - -func (v NullableProxyGroup) Get() *ProxyGroup { - return v.value -} - -func (v *NullableProxyGroup) Set(val *ProxyGroup) { - v.value = val - v.isSet = true -} - -func (v NullableProxyGroup) IsSet() bool { - return v.isSet -} - -func (v *NullableProxyGroup) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableProxyGroup(val *ProxyGroup) *NullableProxyGroup { - return &NullableProxyGroup{value: val, isSet: true} -} - -func (v NullableProxyGroup) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableProxyGroup) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_public_user_data_response.go b/model_public_user_data_response.go deleted file mode 100644 index b463437..0000000 --- a/model_public_user_data_response.go +++ /dev/null @@ -1,158 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" - "bytes" - "fmt" -) - -// checks if the PublicUserDataResponse type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &PublicUserDataResponse{} - -// PublicUserDataResponse struct for PublicUserDataResponse -type PublicUserDataResponse struct { - Data UserPublicInfo `json:"data"` -} - -type _PublicUserDataResponse PublicUserDataResponse - -// NewPublicUserDataResponse instantiates a new PublicUserDataResponse object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewPublicUserDataResponse(data UserPublicInfo) *PublicUserDataResponse { - this := PublicUserDataResponse{} - this.Data = data - return &this -} - -// NewPublicUserDataResponseWithDefaults instantiates a new PublicUserDataResponse object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewPublicUserDataResponseWithDefaults() *PublicUserDataResponse { - this := PublicUserDataResponse{} - return &this -} - -// GetData returns the Data field value -func (o *PublicUserDataResponse) GetData() UserPublicInfo { - if o == nil { - var ret UserPublicInfo - return ret - } - - return o.Data -} - -// GetDataOk returns a tuple with the Data field value -// and a boolean to check if the value has been set. -func (o *PublicUserDataResponse) GetDataOk() (*UserPublicInfo, bool) { - if o == nil { - return nil, false - } - return &o.Data, true -} - -// SetData sets field value -func (o *PublicUserDataResponse) SetData(v UserPublicInfo) { - o.Data = v -} - -func (o PublicUserDataResponse) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o PublicUserDataResponse) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["data"] = o.Data - return toSerialize, nil -} - -func (o *PublicUserDataResponse) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "data", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err; - } - - for _, requiredProperty := range(requiredProperties) { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varPublicUserDataResponse := _PublicUserDataResponse{} - - decoder := json.NewDecoder(bytes.NewReader(data)) - decoder.DisallowUnknownFields() - err = decoder.Decode(&varPublicUserDataResponse) - - if err != nil { - return err - } - - *o = PublicUserDataResponse(varPublicUserDataResponse) - - return err -} - -type NullablePublicUserDataResponse struct { - value *PublicUserDataResponse - isSet bool -} - -func (v NullablePublicUserDataResponse) Get() *PublicUserDataResponse { - return v.value -} - -func (v *NullablePublicUserDataResponse) Set(val *PublicUserDataResponse) { - v.value = val - v.isSet = true -} - -func (v NullablePublicUserDataResponse) IsSet() bool { - return v.isSet -} - -func (v *NullablePublicUserDataResponse) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullablePublicUserDataResponse(val *PublicUserDataResponse) *NullablePublicUserDataResponse { - return &NullablePublicUserDataResponse{value: val, isSet: true} -} - -func (v NullablePublicUserDataResponse) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullablePublicUserDataResponse) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_put_item_response_error.go b/model_put_item_response_error.go deleted file mode 100644 index 4fc6976..0000000 --- a/model_put_item_response_error.go +++ /dev/null @@ -1,158 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" - "bytes" - "fmt" -) - -// checks if the PutItemResponseError type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &PutItemResponseError{} - -// PutItemResponseError struct for PutItemResponseError -type PutItemResponseError struct { - Error DatasetSchemaValidationError `json:"error"` -} - -type _PutItemResponseError PutItemResponseError - -// NewPutItemResponseError instantiates a new PutItemResponseError object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewPutItemResponseError(error_ DatasetSchemaValidationError) *PutItemResponseError { - this := PutItemResponseError{} - this.Error = error_ - return &this -} - -// NewPutItemResponseErrorWithDefaults instantiates a new PutItemResponseError object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewPutItemResponseErrorWithDefaults() *PutItemResponseError { - this := PutItemResponseError{} - return &this -} - -// GetError returns the Error field value -func (o *PutItemResponseError) GetError() DatasetSchemaValidationError { - if o == nil { - var ret DatasetSchemaValidationError - return ret - } - - return o.Error -} - -// GetErrorOk returns a tuple with the Error field value -// and a boolean to check if the value has been set. -func (o *PutItemResponseError) GetErrorOk() (*DatasetSchemaValidationError, bool) { - if o == nil { - return nil, false - } - return &o.Error, true -} - -// SetError sets field value -func (o *PutItemResponseError) SetError(v DatasetSchemaValidationError) { - o.Error = v -} - -func (o PutItemResponseError) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o PutItemResponseError) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["error"] = o.Error - return toSerialize, nil -} - -func (o *PutItemResponseError) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "error", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err; - } - - for _, requiredProperty := range(requiredProperties) { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varPutItemResponseError := _PutItemResponseError{} - - decoder := json.NewDecoder(bytes.NewReader(data)) - decoder.DisallowUnknownFields() - err = decoder.Decode(&varPutItemResponseError) - - if err != nil { - return err - } - - *o = PutItemResponseError(varPutItemResponseError) - - return err -} - -type NullablePutItemResponseError struct { - value *PutItemResponseError - isSet bool -} - -func (v NullablePutItemResponseError) Get() *PutItemResponseError { - return v.value -} - -func (v *NullablePutItemResponseError) Set(val *PutItemResponseError) { - v.value = val - v.isSet = true -} - -func (v NullablePutItemResponseError) IsSet() bool { - return v.isSet -} - -func (v *NullablePutItemResponseError) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullablePutItemResponseError(val *PutItemResponseError) *NullablePutItemResponseError { - return &NullablePutItemResponseError{value: val, isSet: true} -} - -func (v NullablePutItemResponseError) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullablePutItemResponseError) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_request.go b/model_request.go deleted file mode 100644 index d2027b0..0000000 --- a/model_request.go +++ /dev/null @@ -1,543 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" - "time" -) - -// checks if the Request type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &Request{} - -// Request A request stored in the request queue, including its metadata and processing state. -type Request struct { - // A unique key used for request de-duplication. Requests with the same unique key are considered identical. - UniqueKey *string `json:"uniqueKey,omitempty"` - // The URL of the request. - Url *string `json:"url,omitempty"` - Method *HttpMethod `json:"method,omitempty"` - // The number of times this request has been retried. - RetryCount *int32 `json:"retryCount,omitempty"` - // The final URL that was loaded, after redirects (if any). - LoadedUrl *string `json:"loadedUrl,omitempty"` - Payload NullableRequestBasePayload `json:"payload,omitempty"` - // HTTP headers sent with the request. - Headers map[string]interface{} `json:"headers,omitempty"` - // Custom user data attached to the request. Can contain arbitrary fields. - UserData map[string]interface{} `json:"userData,omitempty"` - // Indicates whether the request should not be retried if processing fails. - NoRetry *bool `json:"noRetry,omitempty"` - // Error messages recorded from failed processing attempts. - ErrorMessages []string `json:"errorMessages,omitempty"` - // The timestamp when the request was marked as handled, if applicable. - HandledAt *time.Time `json:"handledAt,omitempty"` - // A unique identifier assigned to the request. - Id *string `json:"id,omitempty"` -} - -// NewRequest instantiates a new Request object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewRequest() *Request { - this := Request{} - return &this -} - -// NewRequestWithDefaults instantiates a new Request object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewRequestWithDefaults() *Request { - this := Request{} - return &this -} - -// GetUniqueKey returns the UniqueKey field value if set, zero value otherwise. -func (o *Request) GetUniqueKey() string { - if o == nil || IsNil(o.UniqueKey) { - var ret string - return ret - } - return *o.UniqueKey -} - -// GetUniqueKeyOk returns a tuple with the UniqueKey field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Request) GetUniqueKeyOk() (*string, bool) { - if o == nil || IsNil(o.UniqueKey) { - return nil, false - } - return o.UniqueKey, true -} - -// HasUniqueKey returns a boolean if a field has been set. -func (o *Request) HasUniqueKey() bool { - if o != nil && !IsNil(o.UniqueKey) { - return true - } - - return false -} - -// SetUniqueKey gets a reference to the given string and assigns it to the UniqueKey field. -func (o *Request) SetUniqueKey(v string) { - o.UniqueKey = &v -} - -// GetUrl returns the Url field value if set, zero value otherwise. -func (o *Request) GetUrl() string { - if o == nil || IsNil(o.Url) { - var ret string - return ret - } - return *o.Url -} - -// GetUrlOk returns a tuple with the Url field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Request) GetUrlOk() (*string, bool) { - if o == nil || IsNil(o.Url) { - return nil, false - } - return o.Url, true -} - -// HasUrl returns a boolean if a field has been set. -func (o *Request) HasUrl() bool { - if o != nil && !IsNil(o.Url) { - return true - } - - return false -} - -// SetUrl gets a reference to the given string and assigns it to the Url field. -func (o *Request) SetUrl(v string) { - o.Url = &v -} - -// GetMethod returns the Method field value if set, zero value otherwise. -func (o *Request) GetMethod() HttpMethod { - if o == nil || IsNil(o.Method) { - var ret HttpMethod - return ret - } - return *o.Method -} - -// GetMethodOk returns a tuple with the Method field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Request) GetMethodOk() (*HttpMethod, bool) { - if o == nil || IsNil(o.Method) { - return nil, false - } - return o.Method, true -} - -// HasMethod returns a boolean if a field has been set. -func (o *Request) HasMethod() bool { - if o != nil && !IsNil(o.Method) { - return true - } - - return false -} - -// SetMethod gets a reference to the given HttpMethod and assigns it to the Method field. -func (o *Request) SetMethod(v HttpMethod) { - o.Method = &v -} - -// GetRetryCount returns the RetryCount field value if set, zero value otherwise. -func (o *Request) GetRetryCount() int32 { - if o == nil || IsNil(o.RetryCount) { - var ret int32 - return ret - } - return *o.RetryCount -} - -// GetRetryCountOk returns a tuple with the RetryCount field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Request) GetRetryCountOk() (*int32, bool) { - if o == nil || IsNil(o.RetryCount) { - return nil, false - } - return o.RetryCount, true -} - -// HasRetryCount returns a boolean if a field has been set. -func (o *Request) HasRetryCount() bool { - if o != nil && !IsNil(o.RetryCount) { - return true - } - - return false -} - -// SetRetryCount gets a reference to the given int32 and assigns it to the RetryCount field. -func (o *Request) SetRetryCount(v int32) { - o.RetryCount = &v -} - -// GetLoadedUrl returns the LoadedUrl field value if set, zero value otherwise. -func (o *Request) GetLoadedUrl() string { - if o == nil || IsNil(o.LoadedUrl) { - var ret string - return ret - } - return *o.LoadedUrl -} - -// GetLoadedUrlOk returns a tuple with the LoadedUrl field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Request) GetLoadedUrlOk() (*string, bool) { - if o == nil || IsNil(o.LoadedUrl) { - return nil, false - } - return o.LoadedUrl, true -} - -// HasLoadedUrl returns a boolean if a field has been set. -func (o *Request) HasLoadedUrl() bool { - if o != nil && !IsNil(o.LoadedUrl) { - return true - } - - return false -} - -// SetLoadedUrl gets a reference to the given string and assigns it to the LoadedUrl field. -func (o *Request) SetLoadedUrl(v string) { - o.LoadedUrl = &v -} - -// GetPayload returns the Payload field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *Request) GetPayload() RequestBasePayload { - if o == nil || IsNil(o.Payload.Get()) { - var ret RequestBasePayload - return ret - } - return *o.Payload.Get() -} - -// GetPayloadOk returns a tuple with the Payload field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *Request) GetPayloadOk() (*RequestBasePayload, bool) { - if o == nil { - return nil, false - } - return o.Payload.Get(), o.Payload.IsSet() -} - -// HasPayload returns a boolean if a field has been set. -func (o *Request) HasPayload() bool { - if o != nil && o.Payload.IsSet() { - return true - } - - return false -} - -// SetPayload gets a reference to the given NullableRequestBasePayload and assigns it to the Payload field. -func (o *Request) SetPayload(v RequestBasePayload) { - o.Payload.Set(&v) -} -// SetPayloadNil sets the value for Payload to be an explicit nil -func (o *Request) SetPayloadNil() { - o.Payload.Set(nil) -} - -// UnsetPayload ensures that no value is present for Payload, not even an explicit nil -func (o *Request) UnsetPayload() { - o.Payload.Unset() -} - -// GetHeaders returns the Headers field value if set, zero value otherwise. -func (o *Request) GetHeaders() map[string]interface{} { - if o == nil || IsNil(o.Headers) { - var ret map[string]interface{} - return ret - } - return o.Headers -} - -// GetHeadersOk returns a tuple with the Headers field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Request) GetHeadersOk() (map[string]interface{}, bool) { - if o == nil || IsNil(o.Headers) { - return map[string]interface{}{}, false - } - return o.Headers, true -} - -// HasHeaders returns a boolean if a field has been set. -func (o *Request) HasHeaders() bool { - if o != nil && !IsNil(o.Headers) { - return true - } - - return false -} - -// SetHeaders gets a reference to the given map[string]interface{} and assigns it to the Headers field. -func (o *Request) SetHeaders(v map[string]interface{}) { - o.Headers = v -} - -// GetUserData returns the UserData field value if set, zero value otherwise. -func (o *Request) GetUserData() map[string]interface{} { - if o == nil || IsNil(o.UserData) { - var ret map[string]interface{} - return ret - } - return o.UserData -} - -// GetUserDataOk returns a tuple with the UserData field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Request) GetUserDataOk() (map[string]interface{}, bool) { - if o == nil || IsNil(o.UserData) { - return map[string]interface{}{}, false - } - return o.UserData, true -} - -// HasUserData returns a boolean if a field has been set. -func (o *Request) HasUserData() bool { - if o != nil && !IsNil(o.UserData) { - return true - } - - return false -} - -// SetUserData gets a reference to the given map[string]interface{} and assigns it to the UserData field. -func (o *Request) SetUserData(v map[string]interface{}) { - o.UserData = v -} - -// GetNoRetry returns the NoRetry field value if set, zero value otherwise. -func (o *Request) GetNoRetry() bool { - if o == nil || IsNil(o.NoRetry) { - var ret bool - return ret - } - return *o.NoRetry -} - -// GetNoRetryOk returns a tuple with the NoRetry field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Request) GetNoRetryOk() (*bool, bool) { - if o == nil || IsNil(o.NoRetry) { - return nil, false - } - return o.NoRetry, true -} - -// HasNoRetry returns a boolean if a field has been set. -func (o *Request) HasNoRetry() bool { - if o != nil && !IsNil(o.NoRetry) { - return true - } - - return false -} - -// SetNoRetry gets a reference to the given bool and assigns it to the NoRetry field. -func (o *Request) SetNoRetry(v bool) { - o.NoRetry = &v -} - -// GetErrorMessages returns the ErrorMessages field value if set, zero value otherwise. -func (o *Request) GetErrorMessages() []string { - if o == nil || IsNil(o.ErrorMessages) { - var ret []string - return ret - } - return o.ErrorMessages -} - -// GetErrorMessagesOk returns a tuple with the ErrorMessages field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Request) GetErrorMessagesOk() ([]string, bool) { - if o == nil || IsNil(o.ErrorMessages) { - return nil, false - } - return o.ErrorMessages, true -} - -// HasErrorMessages returns a boolean if a field has been set. -func (o *Request) HasErrorMessages() bool { - if o != nil && !IsNil(o.ErrorMessages) { - return true - } - - return false -} - -// SetErrorMessages gets a reference to the given []string and assigns it to the ErrorMessages field. -func (o *Request) SetErrorMessages(v []string) { - o.ErrorMessages = v -} - -// GetHandledAt returns the HandledAt field value if set, zero value otherwise. -func (o *Request) GetHandledAt() time.Time { - if o == nil || IsNil(o.HandledAt) { - var ret time.Time - return ret - } - return *o.HandledAt -} - -// GetHandledAtOk returns a tuple with the HandledAt field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Request) GetHandledAtOk() (*time.Time, bool) { - if o == nil || IsNil(o.HandledAt) { - return nil, false - } - return o.HandledAt, true -} - -// HasHandledAt returns a boolean if a field has been set. -func (o *Request) HasHandledAt() bool { - if o != nil && !IsNil(o.HandledAt) { - return true - } - - return false -} - -// SetHandledAt gets a reference to the given time.Time and assigns it to the HandledAt field. -func (o *Request) SetHandledAt(v time.Time) { - o.HandledAt = &v -} - -// GetId returns the Id field value if set, zero value otherwise. -func (o *Request) GetId() string { - if o == nil || IsNil(o.Id) { - var ret string - return ret - } - return *o.Id -} - -// GetIdOk returns a tuple with the Id field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Request) GetIdOk() (*string, bool) { - if o == nil || IsNil(o.Id) { - return nil, false - } - return o.Id, true -} - -// HasId returns a boolean if a field has been set. -func (o *Request) HasId() bool { - if o != nil && !IsNil(o.Id) { - return true - } - - return false -} - -// SetId gets a reference to the given string and assigns it to the Id field. -func (o *Request) SetId(v string) { - o.Id = &v -} - -func (o Request) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o Request) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if !IsNil(o.UniqueKey) { - toSerialize["uniqueKey"] = o.UniqueKey - } - if !IsNil(o.Url) { - toSerialize["url"] = o.Url - } - if !IsNil(o.Method) { - toSerialize["method"] = o.Method - } - if !IsNil(o.RetryCount) { - toSerialize["retryCount"] = o.RetryCount - } - if !IsNil(o.LoadedUrl) { - toSerialize["loadedUrl"] = o.LoadedUrl - } - if o.Payload.IsSet() { - toSerialize["payload"] = o.Payload.Get() - } - if !IsNil(o.Headers) { - toSerialize["headers"] = o.Headers - } - if !IsNil(o.UserData) { - toSerialize["userData"] = o.UserData - } - if !IsNil(o.NoRetry) { - toSerialize["noRetry"] = o.NoRetry - } - if !IsNil(o.ErrorMessages) { - toSerialize["errorMessages"] = o.ErrorMessages - } - if !IsNil(o.HandledAt) { - toSerialize["handledAt"] = o.HandledAt - } - if !IsNil(o.Id) { - toSerialize["id"] = o.Id - } - return toSerialize, nil -} - -type NullableRequest struct { - value *Request - isSet bool -} - -func (v NullableRequest) Get() *Request { - return v.value -} - -func (v *NullableRequest) Set(val *Request) { - v.value = val - v.isSet = true -} - -func (v NullableRequest) IsSet() bool { - return v.isSet -} - -func (v *NullableRequest) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableRequest(val *Request) *NullableRequest { - return &NullableRequest{value: val, isSet: true} -} - -func (v NullableRequest) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableRequest) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_request_base.go b/model_request_base.go deleted file mode 100644 index 402f737..0000000 --- a/model_request_base.go +++ /dev/null @@ -1,538 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" - "time" -) - -// checks if the RequestBase type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &RequestBase{} - -// RequestBase struct for RequestBase -type RequestBase struct { - // A unique key used for request de-duplication. Requests with the same unique key are considered identical. - UniqueKey *string `json:"uniqueKey,omitempty"` - // The URL of the request. - Url *string `json:"url,omitempty"` - Method *HttpMethod `json:"method,omitempty"` - // The number of times this request has been retried. - RetryCount *int32 `json:"retryCount,omitempty"` - // The final URL that was loaded, after redirects (if any). - LoadedUrl NullableString `json:"loadedUrl,omitempty"` - Payload NullableRequestBasePayload `json:"payload,omitempty"` - // HTTP headers sent with the request. - Headers map[string]interface{} `json:"headers,omitempty"` - // Custom user data attached to the request. Can contain arbitrary fields. - UserData map[string]interface{} `json:"userData,omitempty"` - // Indicates whether the request should not be retried if processing fails. - NoRetry NullableBool `json:"noRetry,omitempty"` - // Error messages recorded from failed processing attempts. - ErrorMessages []string `json:"errorMessages,omitempty"` - // The timestamp when the request was marked as handled, if applicable. - HandledAt NullableTime `json:"handledAt,omitempty"` -} - -// NewRequestBase instantiates a new RequestBase object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewRequestBase() *RequestBase { - this := RequestBase{} - return &this -} - -// NewRequestBaseWithDefaults instantiates a new RequestBase object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewRequestBaseWithDefaults() *RequestBase { - this := RequestBase{} - return &this -} - -// GetUniqueKey returns the UniqueKey field value if set, zero value otherwise. -func (o *RequestBase) GetUniqueKey() string { - if o == nil || IsNil(o.UniqueKey) { - var ret string - return ret - } - return *o.UniqueKey -} - -// GetUniqueKeyOk returns a tuple with the UniqueKey field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *RequestBase) GetUniqueKeyOk() (*string, bool) { - if o == nil || IsNil(o.UniqueKey) { - return nil, false - } - return o.UniqueKey, true -} - -// HasUniqueKey returns a boolean if a field has been set. -func (o *RequestBase) HasUniqueKey() bool { - if o != nil && !IsNil(o.UniqueKey) { - return true - } - - return false -} - -// SetUniqueKey gets a reference to the given string and assigns it to the UniqueKey field. -func (o *RequestBase) SetUniqueKey(v string) { - o.UniqueKey = &v -} - -// GetUrl returns the Url field value if set, zero value otherwise. -func (o *RequestBase) GetUrl() string { - if o == nil || IsNil(o.Url) { - var ret string - return ret - } - return *o.Url -} - -// GetUrlOk returns a tuple with the Url field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *RequestBase) GetUrlOk() (*string, bool) { - if o == nil || IsNil(o.Url) { - return nil, false - } - return o.Url, true -} - -// HasUrl returns a boolean if a field has been set. -func (o *RequestBase) HasUrl() bool { - if o != nil && !IsNil(o.Url) { - return true - } - - return false -} - -// SetUrl gets a reference to the given string and assigns it to the Url field. -func (o *RequestBase) SetUrl(v string) { - o.Url = &v -} - -// GetMethod returns the Method field value if set, zero value otherwise. -func (o *RequestBase) GetMethod() HttpMethod { - if o == nil || IsNil(o.Method) { - var ret HttpMethod - return ret - } - return *o.Method -} - -// GetMethodOk returns a tuple with the Method field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *RequestBase) GetMethodOk() (*HttpMethod, bool) { - if o == nil || IsNil(o.Method) { - return nil, false - } - return o.Method, true -} - -// HasMethod returns a boolean if a field has been set. -func (o *RequestBase) HasMethod() bool { - if o != nil && !IsNil(o.Method) { - return true - } - - return false -} - -// SetMethod gets a reference to the given HttpMethod and assigns it to the Method field. -func (o *RequestBase) SetMethod(v HttpMethod) { - o.Method = &v -} - -// GetRetryCount returns the RetryCount field value if set, zero value otherwise. -func (o *RequestBase) GetRetryCount() int32 { - if o == nil || IsNil(o.RetryCount) { - var ret int32 - return ret - } - return *o.RetryCount -} - -// GetRetryCountOk returns a tuple with the RetryCount field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *RequestBase) GetRetryCountOk() (*int32, bool) { - if o == nil || IsNil(o.RetryCount) { - return nil, false - } - return o.RetryCount, true -} - -// HasRetryCount returns a boolean if a field has been set. -func (o *RequestBase) HasRetryCount() bool { - if o != nil && !IsNil(o.RetryCount) { - return true - } - - return false -} - -// SetRetryCount gets a reference to the given int32 and assigns it to the RetryCount field. -func (o *RequestBase) SetRetryCount(v int32) { - o.RetryCount = &v -} - -// GetLoadedUrl returns the LoadedUrl field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *RequestBase) GetLoadedUrl() string { - if o == nil || IsNil(o.LoadedUrl.Get()) { - var ret string - return ret - } - return *o.LoadedUrl.Get() -} - -// GetLoadedUrlOk returns a tuple with the LoadedUrl field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *RequestBase) GetLoadedUrlOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.LoadedUrl.Get(), o.LoadedUrl.IsSet() -} - -// HasLoadedUrl returns a boolean if a field has been set. -func (o *RequestBase) HasLoadedUrl() bool { - if o != nil && o.LoadedUrl.IsSet() { - return true - } - - return false -} - -// SetLoadedUrl gets a reference to the given NullableString and assigns it to the LoadedUrl field. -func (o *RequestBase) SetLoadedUrl(v string) { - o.LoadedUrl.Set(&v) -} -// SetLoadedUrlNil sets the value for LoadedUrl to be an explicit nil -func (o *RequestBase) SetLoadedUrlNil() { - o.LoadedUrl.Set(nil) -} - -// UnsetLoadedUrl ensures that no value is present for LoadedUrl, not even an explicit nil -func (o *RequestBase) UnsetLoadedUrl() { - o.LoadedUrl.Unset() -} - -// GetPayload returns the Payload field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *RequestBase) GetPayload() RequestBasePayload { - if o == nil || IsNil(o.Payload.Get()) { - var ret RequestBasePayload - return ret - } - return *o.Payload.Get() -} - -// GetPayloadOk returns a tuple with the Payload field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *RequestBase) GetPayloadOk() (*RequestBasePayload, bool) { - if o == nil { - return nil, false - } - return o.Payload.Get(), o.Payload.IsSet() -} - -// HasPayload returns a boolean if a field has been set. -func (o *RequestBase) HasPayload() bool { - if o != nil && o.Payload.IsSet() { - return true - } - - return false -} - -// SetPayload gets a reference to the given NullableRequestBasePayload and assigns it to the Payload field. -func (o *RequestBase) SetPayload(v RequestBasePayload) { - o.Payload.Set(&v) -} -// SetPayloadNil sets the value for Payload to be an explicit nil -func (o *RequestBase) SetPayloadNil() { - o.Payload.Set(nil) -} - -// UnsetPayload ensures that no value is present for Payload, not even an explicit nil -func (o *RequestBase) UnsetPayload() { - o.Payload.Unset() -} - -// GetHeaders returns the Headers field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *RequestBase) GetHeaders() map[string]interface{} { - if o == nil { - var ret map[string]interface{} - return ret - } - return o.Headers -} - -// GetHeadersOk returns a tuple with the Headers field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *RequestBase) GetHeadersOk() (map[string]interface{}, bool) { - if o == nil || IsNil(o.Headers) { - return map[string]interface{}{}, false - } - return o.Headers, true -} - -// HasHeaders returns a boolean if a field has been set. -func (o *RequestBase) HasHeaders() bool { - if o != nil && !IsNil(o.Headers) { - return true - } - - return false -} - -// SetHeaders gets a reference to the given map[string]interface{} and assigns it to the Headers field. -func (o *RequestBase) SetHeaders(v map[string]interface{}) { - o.Headers = v -} - -// GetUserData returns the UserData field value if set, zero value otherwise. -func (o *RequestBase) GetUserData() map[string]interface{} { - if o == nil || IsNil(o.UserData) { - var ret map[string]interface{} - return ret - } - return o.UserData -} - -// GetUserDataOk returns a tuple with the UserData field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *RequestBase) GetUserDataOk() (map[string]interface{}, bool) { - if o == nil || IsNil(o.UserData) { - return map[string]interface{}{}, false - } - return o.UserData, true -} - -// HasUserData returns a boolean if a field has been set. -func (o *RequestBase) HasUserData() bool { - if o != nil && !IsNil(o.UserData) { - return true - } - - return false -} - -// SetUserData gets a reference to the given map[string]interface{} and assigns it to the UserData field. -func (o *RequestBase) SetUserData(v map[string]interface{}) { - o.UserData = v -} - -// GetNoRetry returns the NoRetry field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *RequestBase) GetNoRetry() bool { - if o == nil || IsNil(o.NoRetry.Get()) { - var ret bool - return ret - } - return *o.NoRetry.Get() -} - -// GetNoRetryOk returns a tuple with the NoRetry field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *RequestBase) GetNoRetryOk() (*bool, bool) { - if o == nil { - return nil, false - } - return o.NoRetry.Get(), o.NoRetry.IsSet() -} - -// HasNoRetry returns a boolean if a field has been set. -func (o *RequestBase) HasNoRetry() bool { - if o != nil && o.NoRetry.IsSet() { - return true - } - - return false -} - -// SetNoRetry gets a reference to the given NullableBool and assigns it to the NoRetry field. -func (o *RequestBase) SetNoRetry(v bool) { - o.NoRetry.Set(&v) -} -// SetNoRetryNil sets the value for NoRetry to be an explicit nil -func (o *RequestBase) SetNoRetryNil() { - o.NoRetry.Set(nil) -} - -// UnsetNoRetry ensures that no value is present for NoRetry, not even an explicit nil -func (o *RequestBase) UnsetNoRetry() { - o.NoRetry.Unset() -} - -// GetErrorMessages returns the ErrorMessages field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *RequestBase) GetErrorMessages() []string { - if o == nil { - var ret []string - return ret - } - return o.ErrorMessages -} - -// GetErrorMessagesOk returns a tuple with the ErrorMessages field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *RequestBase) GetErrorMessagesOk() ([]string, bool) { - if o == nil || IsNil(o.ErrorMessages) { - return nil, false - } - return o.ErrorMessages, true -} - -// HasErrorMessages returns a boolean if a field has been set. -func (o *RequestBase) HasErrorMessages() bool { - if o != nil && !IsNil(o.ErrorMessages) { - return true - } - - return false -} - -// SetErrorMessages gets a reference to the given []string and assigns it to the ErrorMessages field. -func (o *RequestBase) SetErrorMessages(v []string) { - o.ErrorMessages = v -} - -// GetHandledAt returns the HandledAt field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *RequestBase) GetHandledAt() time.Time { - if o == nil || IsNil(o.HandledAt.Get()) { - var ret time.Time - return ret - } - return *o.HandledAt.Get() -} - -// GetHandledAtOk returns a tuple with the HandledAt field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *RequestBase) GetHandledAtOk() (*time.Time, bool) { - if o == nil { - return nil, false - } - return o.HandledAt.Get(), o.HandledAt.IsSet() -} - -// HasHandledAt returns a boolean if a field has been set. -func (o *RequestBase) HasHandledAt() bool { - if o != nil && o.HandledAt.IsSet() { - return true - } - - return false -} - -// SetHandledAt gets a reference to the given NullableTime and assigns it to the HandledAt field. -func (o *RequestBase) SetHandledAt(v time.Time) { - o.HandledAt.Set(&v) -} -// SetHandledAtNil sets the value for HandledAt to be an explicit nil -func (o *RequestBase) SetHandledAtNil() { - o.HandledAt.Set(nil) -} - -// UnsetHandledAt ensures that no value is present for HandledAt, not even an explicit nil -func (o *RequestBase) UnsetHandledAt() { - o.HandledAt.Unset() -} - -func (o RequestBase) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o RequestBase) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if !IsNil(o.UniqueKey) { - toSerialize["uniqueKey"] = o.UniqueKey - } - if !IsNil(o.Url) { - toSerialize["url"] = o.Url - } - if !IsNil(o.Method) { - toSerialize["method"] = o.Method - } - if !IsNil(o.RetryCount) { - toSerialize["retryCount"] = o.RetryCount - } - if o.LoadedUrl.IsSet() { - toSerialize["loadedUrl"] = o.LoadedUrl.Get() - } - if o.Payload.IsSet() { - toSerialize["payload"] = o.Payload.Get() - } - if o.Headers != nil { - toSerialize["headers"] = o.Headers - } - if !IsNil(o.UserData) { - toSerialize["userData"] = o.UserData - } - if o.NoRetry.IsSet() { - toSerialize["noRetry"] = o.NoRetry.Get() - } - if o.ErrorMessages != nil { - toSerialize["errorMessages"] = o.ErrorMessages - } - if o.HandledAt.IsSet() { - toSerialize["handledAt"] = o.HandledAt.Get() - } - return toSerialize, nil -} - -type NullableRequestBase struct { - value *RequestBase - isSet bool -} - -func (v NullableRequestBase) Get() *RequestBase { - return v.value -} - -func (v *NullableRequestBase) Set(val *RequestBase) { - v.value = val - v.isSet = true -} - -func (v NullableRequestBase) IsSet() bool { - return v.isSet -} - -func (v *NullableRequestBase) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableRequestBase(val *RequestBase) *NullableRequestBase { - return &NullableRequestBase{value: val, isSet: true} -} - -func (v NullableRequestBase) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableRequestBase) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_request_base_payload.go b/model_request_base_payload.go deleted file mode 100644 index b084d1f..0000000 --- a/model_request_base_payload.go +++ /dev/null @@ -1,94 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" - "fmt" -) - - -// RequestBasePayload The request payload, typically used with POST or PUT requests. -type RequestBasePayload struct { - String *string -} - -// Unmarshal JSON data into any of the pointers in the struct -func (dst *RequestBasePayload) UnmarshalJSON(data []byte) error { - var err error - // this object is nullable so check if the payload is null or empty string - if string(data) == "" || string(data) == "{}" { - return nil - } - - // try to unmarshal JSON data into String - err = json.Unmarshal(data, &dst.String); - if err == nil { - jsonString, _ := json.Marshal(dst.String) - if string(jsonString) == "{}" { // empty struct - dst.String = nil - } else { - return nil // data stored in dst.String, return on the first match - } - } else { - dst.String = nil - } - - return fmt.Errorf("data failed to match schemas in anyOf(RequestBasePayload)") -} - -// Marshal data from the first non-nil pointers in the struct to JSON -func (src RequestBasePayload) MarshalJSON() ([]byte, error) { - if src.String != nil { - return json.Marshal(&src.String) - } - - return nil, nil // no data in anyOf schemas -} - - -type NullableRequestBasePayload struct { - value *RequestBasePayload - isSet bool -} - -func (v NullableRequestBasePayload) Get() *RequestBasePayload { - return v.value -} - -func (v *NullableRequestBasePayload) Set(val *RequestBasePayload) { - v.value = val - v.isSet = true -} - -func (v NullableRequestBasePayload) IsSet() bool { - return v.isSet -} - -func (v *NullableRequestBasePayload) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableRequestBasePayload(val *RequestBasePayload) *NullableRequestBasePayload { - return &NullableRequestBasePayload{value: val, isSet: true} -} - -func (v NullableRequestBasePayload) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableRequestBasePayload) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_request_draft.go b/model_request_draft.go deleted file mode 100644 index f1f05f0..0000000 --- a/model_request_draft.go +++ /dev/null @@ -1,261 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" - "bytes" - "fmt" -) - -// checks if the RequestDraft type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &RequestDraft{} - -// RequestDraft A request that failed to be processed during a request queue operation and can be retried. -type RequestDraft struct { - // A unique identifier assigned to the request. - Id *string `json:"id,omitempty"` - // A unique key used for request de-duplication. Requests with the same unique key are considered identical. - UniqueKey string `json:"uniqueKey"` - // The URL of the request. - Url string `json:"url"` - Method *HttpMethod `json:"method,omitempty"` -} - -type _RequestDraft RequestDraft - -// NewRequestDraft instantiates a new RequestDraft object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewRequestDraft(uniqueKey string, url string) *RequestDraft { - this := RequestDraft{} - this.UniqueKey = uniqueKey - this.Url = url - return &this -} - -// NewRequestDraftWithDefaults instantiates a new RequestDraft object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewRequestDraftWithDefaults() *RequestDraft { - this := RequestDraft{} - return &this -} - -// GetId returns the Id field value if set, zero value otherwise. -func (o *RequestDraft) GetId() string { - if o == nil || IsNil(o.Id) { - var ret string - return ret - } - return *o.Id -} - -// GetIdOk returns a tuple with the Id field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *RequestDraft) GetIdOk() (*string, bool) { - if o == nil || IsNil(o.Id) { - return nil, false - } - return o.Id, true -} - -// HasId returns a boolean if a field has been set. -func (o *RequestDraft) HasId() bool { - if o != nil && !IsNil(o.Id) { - return true - } - - return false -} - -// SetId gets a reference to the given string and assigns it to the Id field. -func (o *RequestDraft) SetId(v string) { - o.Id = &v -} - -// GetUniqueKey returns the UniqueKey field value -func (o *RequestDraft) GetUniqueKey() string { - if o == nil { - var ret string - return ret - } - - return o.UniqueKey -} - -// GetUniqueKeyOk returns a tuple with the UniqueKey field value -// and a boolean to check if the value has been set. -func (o *RequestDraft) GetUniqueKeyOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.UniqueKey, true -} - -// SetUniqueKey sets field value -func (o *RequestDraft) SetUniqueKey(v string) { - o.UniqueKey = v -} - -// GetUrl returns the Url field value -func (o *RequestDraft) GetUrl() string { - if o == nil { - var ret string - return ret - } - - return o.Url -} - -// GetUrlOk returns a tuple with the Url field value -// and a boolean to check if the value has been set. -func (o *RequestDraft) GetUrlOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Url, true -} - -// SetUrl sets field value -func (o *RequestDraft) SetUrl(v string) { - o.Url = v -} - -// GetMethod returns the Method field value if set, zero value otherwise. -func (o *RequestDraft) GetMethod() HttpMethod { - if o == nil || IsNil(o.Method) { - var ret HttpMethod - return ret - } - return *o.Method -} - -// GetMethodOk returns a tuple with the Method field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *RequestDraft) GetMethodOk() (*HttpMethod, bool) { - if o == nil || IsNil(o.Method) { - return nil, false - } - return o.Method, true -} - -// HasMethod returns a boolean if a field has been set. -func (o *RequestDraft) HasMethod() bool { - if o != nil && !IsNil(o.Method) { - return true - } - - return false -} - -// SetMethod gets a reference to the given HttpMethod and assigns it to the Method field. -func (o *RequestDraft) SetMethod(v HttpMethod) { - o.Method = &v -} - -func (o RequestDraft) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o RequestDraft) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if !IsNil(o.Id) { - toSerialize["id"] = o.Id - } - toSerialize["uniqueKey"] = o.UniqueKey - toSerialize["url"] = o.Url - if !IsNil(o.Method) { - toSerialize["method"] = o.Method - } - return toSerialize, nil -} - -func (o *RequestDraft) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "uniqueKey", - "url", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err; - } - - for _, requiredProperty := range(requiredProperties) { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varRequestDraft := _RequestDraft{} - - decoder := json.NewDecoder(bytes.NewReader(data)) - decoder.DisallowUnknownFields() - err = decoder.Decode(&varRequestDraft) - - if err != nil { - return err - } - - *o = RequestDraft(varRequestDraft) - - return err -} - -type NullableRequestDraft struct { - value *RequestDraft - isSet bool -} - -func (v NullableRequestDraft) Get() *RequestDraft { - return v.value -} - -func (v *NullableRequestDraft) Set(val *RequestDraft) { - v.value = val - v.isSet = true -} - -func (v NullableRequestDraft) IsSet() bool { - return v.isSet -} - -func (v *NullableRequestDraft) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableRequestDraft(val *RequestDraft) *NullableRequestDraft { - return &NullableRequestDraft{value: val, isSet: true} -} - -func (v NullableRequestDraft) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableRequestDraft) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_request_draft_delete.go b/model_request_draft_delete.go deleted file mode 100644 index 8b41833..0000000 --- a/model_request_draft_delete.go +++ /dev/null @@ -1,107 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" - "fmt" -) - - -// RequestDraftDelete A request that should be deleted. -type RequestDraftDelete struct { - RequestDraftDeleteById *RequestDraftDeleteById - RequestDraftDeleteByUniqueKey *RequestDraftDeleteByUniqueKey -} - -// Unmarshal JSON data into any of the pointers in the struct -func (dst *RequestDraftDelete) UnmarshalJSON(data []byte) error { - var err error - // try to unmarshal JSON data into RequestDraftDeleteById - err = json.Unmarshal(data, &dst.RequestDraftDeleteById); - if err == nil { - jsonRequestDraftDeleteById, _ := json.Marshal(dst.RequestDraftDeleteById) - if string(jsonRequestDraftDeleteById) == "{}" { // empty struct - dst.RequestDraftDeleteById = nil - } else { - return nil // data stored in dst.RequestDraftDeleteById, return on the first match - } - } else { - dst.RequestDraftDeleteById = nil - } - - // try to unmarshal JSON data into RequestDraftDeleteByUniqueKey - err = json.Unmarshal(data, &dst.RequestDraftDeleteByUniqueKey); - if err == nil { - jsonRequestDraftDeleteByUniqueKey, _ := json.Marshal(dst.RequestDraftDeleteByUniqueKey) - if string(jsonRequestDraftDeleteByUniqueKey) == "{}" { // empty struct - dst.RequestDraftDeleteByUniqueKey = nil - } else { - return nil // data stored in dst.RequestDraftDeleteByUniqueKey, return on the first match - } - } else { - dst.RequestDraftDeleteByUniqueKey = nil - } - - return fmt.Errorf("data failed to match schemas in anyOf(RequestDraftDelete)") -} - -// Marshal data from the first non-nil pointers in the struct to JSON -func (src RequestDraftDelete) MarshalJSON() ([]byte, error) { - if src.RequestDraftDeleteById != nil { - return json.Marshal(&src.RequestDraftDeleteById) - } - - if src.RequestDraftDeleteByUniqueKey != nil { - return json.Marshal(&src.RequestDraftDeleteByUniqueKey) - } - - return nil, nil // no data in anyOf schemas -} - - -type NullableRequestDraftDelete struct { - value *RequestDraftDelete - isSet bool -} - -func (v NullableRequestDraftDelete) Get() *RequestDraftDelete { - return v.value -} - -func (v *NullableRequestDraftDelete) Set(val *RequestDraftDelete) { - v.value = val - v.isSet = true -} - -func (v NullableRequestDraftDelete) IsSet() bool { - return v.isSet -} - -func (v *NullableRequestDraftDelete) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableRequestDraftDelete(val *RequestDraftDelete) *NullableRequestDraftDelete { - return &NullableRequestDraftDelete{value: val, isSet: true} -} - -func (v NullableRequestDraftDelete) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableRequestDraftDelete) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_request_draft_delete_by_id.go b/model_request_draft_delete_by_id.go deleted file mode 100644 index 0a68e56..0000000 --- a/model_request_draft_delete_by_id.go +++ /dev/null @@ -1,196 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" - "bytes" - "fmt" -) - -// checks if the RequestDraftDeleteById type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &RequestDraftDeleteById{} - -// RequestDraftDeleteById A request that should be deleted, identified by its ID. -type RequestDraftDeleteById struct { - // A unique identifier assigned to the request. - Id string `json:"id"` - // A unique key used for request de-duplication. Requests with the same unique key are considered identical. - UniqueKey *string `json:"uniqueKey,omitempty"` -} - -type _RequestDraftDeleteById RequestDraftDeleteById - -// NewRequestDraftDeleteById instantiates a new RequestDraftDeleteById object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewRequestDraftDeleteById(id string) *RequestDraftDeleteById { - this := RequestDraftDeleteById{} - this.Id = id - return &this -} - -// NewRequestDraftDeleteByIdWithDefaults instantiates a new RequestDraftDeleteById object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewRequestDraftDeleteByIdWithDefaults() *RequestDraftDeleteById { - this := RequestDraftDeleteById{} - return &this -} - -// GetId returns the Id field value -func (o *RequestDraftDeleteById) GetId() string { - if o == nil { - var ret string - return ret - } - - return o.Id -} - -// GetIdOk returns a tuple with the Id field value -// and a boolean to check if the value has been set. -func (o *RequestDraftDeleteById) GetIdOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Id, true -} - -// SetId sets field value -func (o *RequestDraftDeleteById) SetId(v string) { - o.Id = v -} - -// GetUniqueKey returns the UniqueKey field value if set, zero value otherwise. -func (o *RequestDraftDeleteById) GetUniqueKey() string { - if o == nil || IsNil(o.UniqueKey) { - var ret string - return ret - } - return *o.UniqueKey -} - -// GetUniqueKeyOk returns a tuple with the UniqueKey field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *RequestDraftDeleteById) GetUniqueKeyOk() (*string, bool) { - if o == nil || IsNil(o.UniqueKey) { - return nil, false - } - return o.UniqueKey, true -} - -// HasUniqueKey returns a boolean if a field has been set. -func (o *RequestDraftDeleteById) HasUniqueKey() bool { - if o != nil && !IsNil(o.UniqueKey) { - return true - } - - return false -} - -// SetUniqueKey gets a reference to the given string and assigns it to the UniqueKey field. -func (o *RequestDraftDeleteById) SetUniqueKey(v string) { - o.UniqueKey = &v -} - -func (o RequestDraftDeleteById) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o RequestDraftDeleteById) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["id"] = o.Id - if !IsNil(o.UniqueKey) { - toSerialize["uniqueKey"] = o.UniqueKey - } - return toSerialize, nil -} - -func (o *RequestDraftDeleteById) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "id", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err; - } - - for _, requiredProperty := range(requiredProperties) { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varRequestDraftDeleteById := _RequestDraftDeleteById{} - - decoder := json.NewDecoder(bytes.NewReader(data)) - decoder.DisallowUnknownFields() - err = decoder.Decode(&varRequestDraftDeleteById) - - if err != nil { - return err - } - - *o = RequestDraftDeleteById(varRequestDraftDeleteById) - - return err -} - -type NullableRequestDraftDeleteById struct { - value *RequestDraftDeleteById - isSet bool -} - -func (v NullableRequestDraftDeleteById) Get() *RequestDraftDeleteById { - return v.value -} - -func (v *NullableRequestDraftDeleteById) Set(val *RequestDraftDeleteById) { - v.value = val - v.isSet = true -} - -func (v NullableRequestDraftDeleteById) IsSet() bool { - return v.isSet -} - -func (v *NullableRequestDraftDeleteById) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableRequestDraftDeleteById(val *RequestDraftDeleteById) *NullableRequestDraftDeleteById { - return &NullableRequestDraftDeleteById{value: val, isSet: true} -} - -func (v NullableRequestDraftDeleteById) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableRequestDraftDeleteById) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_request_draft_delete_by_unique_key.go b/model_request_draft_delete_by_unique_key.go deleted file mode 100644 index 0ab288c..0000000 --- a/model_request_draft_delete_by_unique_key.go +++ /dev/null @@ -1,196 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" - "bytes" - "fmt" -) - -// checks if the RequestDraftDeleteByUniqueKey type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &RequestDraftDeleteByUniqueKey{} - -// RequestDraftDeleteByUniqueKey A request that should be deleted, identified by its unique key. -type RequestDraftDeleteByUniqueKey struct { - // A unique identifier assigned to the request. - Id *string `json:"id,omitempty"` - // A unique key used for request de-duplication. Requests with the same unique key are considered identical. - UniqueKey string `json:"uniqueKey"` -} - -type _RequestDraftDeleteByUniqueKey RequestDraftDeleteByUniqueKey - -// NewRequestDraftDeleteByUniqueKey instantiates a new RequestDraftDeleteByUniqueKey object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewRequestDraftDeleteByUniqueKey(uniqueKey string) *RequestDraftDeleteByUniqueKey { - this := RequestDraftDeleteByUniqueKey{} - this.UniqueKey = uniqueKey - return &this -} - -// NewRequestDraftDeleteByUniqueKeyWithDefaults instantiates a new RequestDraftDeleteByUniqueKey object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewRequestDraftDeleteByUniqueKeyWithDefaults() *RequestDraftDeleteByUniqueKey { - this := RequestDraftDeleteByUniqueKey{} - return &this -} - -// GetId returns the Id field value if set, zero value otherwise. -func (o *RequestDraftDeleteByUniqueKey) GetId() string { - if o == nil || IsNil(o.Id) { - var ret string - return ret - } - return *o.Id -} - -// GetIdOk returns a tuple with the Id field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *RequestDraftDeleteByUniqueKey) GetIdOk() (*string, bool) { - if o == nil || IsNil(o.Id) { - return nil, false - } - return o.Id, true -} - -// HasId returns a boolean if a field has been set. -func (o *RequestDraftDeleteByUniqueKey) HasId() bool { - if o != nil && !IsNil(o.Id) { - return true - } - - return false -} - -// SetId gets a reference to the given string and assigns it to the Id field. -func (o *RequestDraftDeleteByUniqueKey) SetId(v string) { - o.Id = &v -} - -// GetUniqueKey returns the UniqueKey field value -func (o *RequestDraftDeleteByUniqueKey) GetUniqueKey() string { - if o == nil { - var ret string - return ret - } - - return o.UniqueKey -} - -// GetUniqueKeyOk returns a tuple with the UniqueKey field value -// and a boolean to check if the value has been set. -func (o *RequestDraftDeleteByUniqueKey) GetUniqueKeyOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.UniqueKey, true -} - -// SetUniqueKey sets field value -func (o *RequestDraftDeleteByUniqueKey) SetUniqueKey(v string) { - o.UniqueKey = v -} - -func (o RequestDraftDeleteByUniqueKey) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o RequestDraftDeleteByUniqueKey) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if !IsNil(o.Id) { - toSerialize["id"] = o.Id - } - toSerialize["uniqueKey"] = o.UniqueKey - return toSerialize, nil -} - -func (o *RequestDraftDeleteByUniqueKey) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "uniqueKey", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err; - } - - for _, requiredProperty := range(requiredProperties) { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varRequestDraftDeleteByUniqueKey := _RequestDraftDeleteByUniqueKey{} - - decoder := json.NewDecoder(bytes.NewReader(data)) - decoder.DisallowUnknownFields() - err = decoder.Decode(&varRequestDraftDeleteByUniqueKey) - - if err != nil { - return err - } - - *o = RequestDraftDeleteByUniqueKey(varRequestDraftDeleteByUniqueKey) - - return err -} - -type NullableRequestDraftDeleteByUniqueKey struct { - value *RequestDraftDeleteByUniqueKey - isSet bool -} - -func (v NullableRequestDraftDeleteByUniqueKey) Get() *RequestDraftDeleteByUniqueKey { - return v.value -} - -func (v *NullableRequestDraftDeleteByUniqueKey) Set(val *RequestDraftDeleteByUniqueKey) { - v.value = val - v.isSet = true -} - -func (v NullableRequestDraftDeleteByUniqueKey) IsSet() bool { - return v.isSet -} - -func (v *NullableRequestDraftDeleteByUniqueKey) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableRequestDraftDeleteByUniqueKey(val *RequestDraftDeleteByUniqueKey) *NullableRequestDraftDeleteByUniqueKey { - return &NullableRequestDraftDeleteByUniqueKey{value: val, isSet: true} -} - -func (v NullableRequestDraftDeleteByUniqueKey) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableRequestDraftDeleteByUniqueKey) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_request_lock_info.go b/model_request_lock_info.go deleted file mode 100644 index 0d7ae74..0000000 --- a/model_request_lock_info.go +++ /dev/null @@ -1,160 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" - "time" - "bytes" - "fmt" -) - -// checks if the RequestLockInfo type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &RequestLockInfo{} - -// RequestLockInfo Information about a request lock. -type RequestLockInfo struct { - // The timestamp when the lock on this request expires. - LockExpiresAt time.Time `json:"lockExpiresAt"` -} - -type _RequestLockInfo RequestLockInfo - -// NewRequestLockInfo instantiates a new RequestLockInfo object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewRequestLockInfo(lockExpiresAt time.Time) *RequestLockInfo { - this := RequestLockInfo{} - this.LockExpiresAt = lockExpiresAt - return &this -} - -// NewRequestLockInfoWithDefaults instantiates a new RequestLockInfo object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewRequestLockInfoWithDefaults() *RequestLockInfo { - this := RequestLockInfo{} - return &this -} - -// GetLockExpiresAt returns the LockExpiresAt field value -func (o *RequestLockInfo) GetLockExpiresAt() time.Time { - if o == nil { - var ret time.Time - return ret - } - - return o.LockExpiresAt -} - -// GetLockExpiresAtOk returns a tuple with the LockExpiresAt field value -// and a boolean to check if the value has been set. -func (o *RequestLockInfo) GetLockExpiresAtOk() (*time.Time, bool) { - if o == nil { - return nil, false - } - return &o.LockExpiresAt, true -} - -// SetLockExpiresAt sets field value -func (o *RequestLockInfo) SetLockExpiresAt(v time.Time) { - o.LockExpiresAt = v -} - -func (o RequestLockInfo) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o RequestLockInfo) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["lockExpiresAt"] = o.LockExpiresAt - return toSerialize, nil -} - -func (o *RequestLockInfo) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "lockExpiresAt", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err; - } - - for _, requiredProperty := range(requiredProperties) { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varRequestLockInfo := _RequestLockInfo{} - - decoder := json.NewDecoder(bytes.NewReader(data)) - decoder.DisallowUnknownFields() - err = decoder.Decode(&varRequestLockInfo) - - if err != nil { - return err - } - - *o = RequestLockInfo(varRequestLockInfo) - - return err -} - -type NullableRequestLockInfo struct { - value *RequestLockInfo - isSet bool -} - -func (v NullableRequestLockInfo) Get() *RequestLockInfo { - return v.value -} - -func (v *NullableRequestLockInfo) Set(val *RequestLockInfo) { - v.value = val - v.isSet = true -} - -func (v NullableRequestLockInfo) IsSet() bool { - return v.isSet -} - -func (v *NullableRequestLockInfo) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableRequestLockInfo(val *RequestLockInfo) *NullableRequestLockInfo { - return &NullableRequestLockInfo{value: val, isSet: true} -} - -func (v NullableRequestLockInfo) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableRequestLockInfo) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_request_queue.go b/model_request_queue.go deleted file mode 100644 index dda689d..0000000 --- a/model_request_queue.go +++ /dev/null @@ -1,634 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" - "time" - "bytes" - "fmt" -) - -// checks if the RequestQueue type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &RequestQueue{} - -// RequestQueue A request queue object containing metadata and statistics. -type RequestQueue struct { - // A unique identifier assigned to the request queue. - Id string `json:"id"` - // The name of the request queue. - Name NullableString `json:"name,omitempty"` - // The ID of the user who owns the request queue. - UserId string `json:"userId"` - // The ID of the Actor that created this request queue. - ActId NullableString `json:"actId,omitempty"` - // The ID of the Actor run that created this request queue. - ActRunId NullableString `json:"actRunId,omitempty"` - // The timestamp when the request queue was created. - CreatedAt time.Time `json:"createdAt"` - // The timestamp when the request queue was last modified. Modifications include adding, updating, or removing requests, as well as locking or unlocking requests in the request queue. - ModifiedAt time.Time `json:"modifiedAt"` - // The timestamp when the request queue was last accessed. - AccessedAt time.Time `json:"accessedAt"` - // The total number of requests in the request queue. - TotalRequestCount int32 `json:"totalRequestCount"` - // The number of requests that have been handled. - HandledRequestCount int32 `json:"handledRequestCount"` - // The number of requests that are pending and have not been handled yet. - PendingRequestCount int32 `json:"pendingRequestCount"` - // Whether the request queue has been accessed by multiple different clients. - HadMultipleClients bool `json:"hadMultipleClients"` - // The URL to view the request queue in the Apify console. - ConsoleUrl string `json:"consoleUrl"` - Stats *RequestQueueStats `json:"stats,omitempty"` - GeneralAccess *GeneralAccess `json:"generalAccess,omitempty"` -} - -type _RequestQueue RequestQueue - -// NewRequestQueue instantiates a new RequestQueue object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewRequestQueue(id string, userId string, createdAt time.Time, modifiedAt time.Time, accessedAt time.Time, totalRequestCount int32, handledRequestCount int32, pendingRequestCount int32, hadMultipleClients bool, consoleUrl string) *RequestQueue { - this := RequestQueue{} - this.Id = id - this.UserId = userId - this.CreatedAt = createdAt - this.ModifiedAt = modifiedAt - this.AccessedAt = accessedAt - this.TotalRequestCount = totalRequestCount - this.HandledRequestCount = handledRequestCount - this.PendingRequestCount = pendingRequestCount - this.HadMultipleClients = hadMultipleClients - this.ConsoleUrl = consoleUrl - return &this -} - -// NewRequestQueueWithDefaults instantiates a new RequestQueue object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewRequestQueueWithDefaults() *RequestQueue { - this := RequestQueue{} - return &this -} - -// GetId returns the Id field value -func (o *RequestQueue) GetId() string { - if o == nil { - var ret string - return ret - } - - return o.Id -} - -// GetIdOk returns a tuple with the Id field value -// and a boolean to check if the value has been set. -func (o *RequestQueue) GetIdOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Id, true -} - -// SetId sets field value -func (o *RequestQueue) SetId(v string) { - o.Id = v -} - -// GetName returns the Name field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *RequestQueue) GetName() string { - if o == nil || IsNil(o.Name.Get()) { - var ret string - return ret - } - return *o.Name.Get() -} - -// GetNameOk returns a tuple with the Name field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *RequestQueue) GetNameOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.Name.Get(), o.Name.IsSet() -} - -// HasName returns a boolean if a field has been set. -func (o *RequestQueue) HasName() bool { - if o != nil && o.Name.IsSet() { - return true - } - - return false -} - -// SetName gets a reference to the given NullableString and assigns it to the Name field. -func (o *RequestQueue) SetName(v string) { - o.Name.Set(&v) -} -// SetNameNil sets the value for Name to be an explicit nil -func (o *RequestQueue) SetNameNil() { - o.Name.Set(nil) -} - -// UnsetName ensures that no value is present for Name, not even an explicit nil -func (o *RequestQueue) UnsetName() { - o.Name.Unset() -} - -// GetUserId returns the UserId field value -func (o *RequestQueue) GetUserId() string { - if o == nil { - var ret string - return ret - } - - return o.UserId -} - -// GetUserIdOk returns a tuple with the UserId field value -// and a boolean to check if the value has been set. -func (o *RequestQueue) GetUserIdOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.UserId, true -} - -// SetUserId sets field value -func (o *RequestQueue) SetUserId(v string) { - o.UserId = v -} - -// GetActId returns the ActId field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *RequestQueue) GetActId() string { - if o == nil || IsNil(o.ActId.Get()) { - var ret string - return ret - } - return *o.ActId.Get() -} - -// GetActIdOk returns a tuple with the ActId field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *RequestQueue) GetActIdOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.ActId.Get(), o.ActId.IsSet() -} - -// HasActId returns a boolean if a field has been set. -func (o *RequestQueue) HasActId() bool { - if o != nil && o.ActId.IsSet() { - return true - } - - return false -} - -// SetActId gets a reference to the given NullableString and assigns it to the ActId field. -func (o *RequestQueue) SetActId(v string) { - o.ActId.Set(&v) -} -// SetActIdNil sets the value for ActId to be an explicit nil -func (o *RequestQueue) SetActIdNil() { - o.ActId.Set(nil) -} - -// UnsetActId ensures that no value is present for ActId, not even an explicit nil -func (o *RequestQueue) UnsetActId() { - o.ActId.Unset() -} - -// GetActRunId returns the ActRunId field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *RequestQueue) GetActRunId() string { - if o == nil || IsNil(o.ActRunId.Get()) { - var ret string - return ret - } - return *o.ActRunId.Get() -} - -// GetActRunIdOk returns a tuple with the ActRunId field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *RequestQueue) GetActRunIdOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.ActRunId.Get(), o.ActRunId.IsSet() -} - -// HasActRunId returns a boolean if a field has been set. -func (o *RequestQueue) HasActRunId() bool { - if o != nil && o.ActRunId.IsSet() { - return true - } - - return false -} - -// SetActRunId gets a reference to the given NullableString and assigns it to the ActRunId field. -func (o *RequestQueue) SetActRunId(v string) { - o.ActRunId.Set(&v) -} -// SetActRunIdNil sets the value for ActRunId to be an explicit nil -func (o *RequestQueue) SetActRunIdNil() { - o.ActRunId.Set(nil) -} - -// UnsetActRunId ensures that no value is present for ActRunId, not even an explicit nil -func (o *RequestQueue) UnsetActRunId() { - o.ActRunId.Unset() -} - -// GetCreatedAt returns the CreatedAt field value -func (o *RequestQueue) GetCreatedAt() time.Time { - if o == nil { - var ret time.Time - return ret - } - - return o.CreatedAt -} - -// GetCreatedAtOk returns a tuple with the CreatedAt field value -// and a boolean to check if the value has been set. -func (o *RequestQueue) GetCreatedAtOk() (*time.Time, bool) { - if o == nil { - return nil, false - } - return &o.CreatedAt, true -} - -// SetCreatedAt sets field value -func (o *RequestQueue) SetCreatedAt(v time.Time) { - o.CreatedAt = v -} - -// GetModifiedAt returns the ModifiedAt field value -func (o *RequestQueue) GetModifiedAt() time.Time { - if o == nil { - var ret time.Time - return ret - } - - return o.ModifiedAt -} - -// GetModifiedAtOk returns a tuple with the ModifiedAt field value -// and a boolean to check if the value has been set. -func (o *RequestQueue) GetModifiedAtOk() (*time.Time, bool) { - if o == nil { - return nil, false - } - return &o.ModifiedAt, true -} - -// SetModifiedAt sets field value -func (o *RequestQueue) SetModifiedAt(v time.Time) { - o.ModifiedAt = v -} - -// GetAccessedAt returns the AccessedAt field value -func (o *RequestQueue) GetAccessedAt() time.Time { - if o == nil { - var ret time.Time - return ret - } - - return o.AccessedAt -} - -// GetAccessedAtOk returns a tuple with the AccessedAt field value -// and a boolean to check if the value has been set. -func (o *RequestQueue) GetAccessedAtOk() (*time.Time, bool) { - if o == nil { - return nil, false - } - return &o.AccessedAt, true -} - -// SetAccessedAt sets field value -func (o *RequestQueue) SetAccessedAt(v time.Time) { - o.AccessedAt = v -} - -// GetTotalRequestCount returns the TotalRequestCount field value -func (o *RequestQueue) GetTotalRequestCount() int32 { - if o == nil { - var ret int32 - return ret - } - - return o.TotalRequestCount -} - -// GetTotalRequestCountOk returns a tuple with the TotalRequestCount field value -// and a boolean to check if the value has been set. -func (o *RequestQueue) GetTotalRequestCountOk() (*int32, bool) { - if o == nil { - return nil, false - } - return &o.TotalRequestCount, true -} - -// SetTotalRequestCount sets field value -func (o *RequestQueue) SetTotalRequestCount(v int32) { - o.TotalRequestCount = v -} - -// GetHandledRequestCount returns the HandledRequestCount field value -func (o *RequestQueue) GetHandledRequestCount() int32 { - if o == nil { - var ret int32 - return ret - } - - return o.HandledRequestCount -} - -// GetHandledRequestCountOk returns a tuple with the HandledRequestCount field value -// and a boolean to check if the value has been set. -func (o *RequestQueue) GetHandledRequestCountOk() (*int32, bool) { - if o == nil { - return nil, false - } - return &o.HandledRequestCount, true -} - -// SetHandledRequestCount sets field value -func (o *RequestQueue) SetHandledRequestCount(v int32) { - o.HandledRequestCount = v -} - -// GetPendingRequestCount returns the PendingRequestCount field value -func (o *RequestQueue) GetPendingRequestCount() int32 { - if o == nil { - var ret int32 - return ret - } - - return o.PendingRequestCount -} - -// GetPendingRequestCountOk returns a tuple with the PendingRequestCount field value -// and a boolean to check if the value has been set. -func (o *RequestQueue) GetPendingRequestCountOk() (*int32, bool) { - if o == nil { - return nil, false - } - return &o.PendingRequestCount, true -} - -// SetPendingRequestCount sets field value -func (o *RequestQueue) SetPendingRequestCount(v int32) { - o.PendingRequestCount = v -} - -// GetHadMultipleClients returns the HadMultipleClients field value -func (o *RequestQueue) GetHadMultipleClients() bool { - if o == nil { - var ret bool - return ret - } - - return o.HadMultipleClients -} - -// GetHadMultipleClientsOk returns a tuple with the HadMultipleClients field value -// and a boolean to check if the value has been set. -func (o *RequestQueue) GetHadMultipleClientsOk() (*bool, bool) { - if o == nil { - return nil, false - } - return &o.HadMultipleClients, true -} - -// SetHadMultipleClients sets field value -func (o *RequestQueue) SetHadMultipleClients(v bool) { - o.HadMultipleClients = v -} - -// GetConsoleUrl returns the ConsoleUrl field value -func (o *RequestQueue) GetConsoleUrl() string { - if o == nil { - var ret string - return ret - } - - return o.ConsoleUrl -} - -// GetConsoleUrlOk returns a tuple with the ConsoleUrl field value -// and a boolean to check if the value has been set. -func (o *RequestQueue) GetConsoleUrlOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.ConsoleUrl, true -} - -// SetConsoleUrl sets field value -func (o *RequestQueue) SetConsoleUrl(v string) { - o.ConsoleUrl = v -} - -// GetStats returns the Stats field value if set, zero value otherwise. -func (o *RequestQueue) GetStats() RequestQueueStats { - if o == nil || IsNil(o.Stats) { - var ret RequestQueueStats - return ret - } - return *o.Stats -} - -// GetStatsOk returns a tuple with the Stats field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *RequestQueue) GetStatsOk() (*RequestQueueStats, bool) { - if o == nil || IsNil(o.Stats) { - return nil, false - } - return o.Stats, true -} - -// HasStats returns a boolean if a field has been set. -func (o *RequestQueue) HasStats() bool { - if o != nil && !IsNil(o.Stats) { - return true - } - - return false -} - -// SetStats gets a reference to the given RequestQueueStats and assigns it to the Stats field. -func (o *RequestQueue) SetStats(v RequestQueueStats) { - o.Stats = &v -} - -// GetGeneralAccess returns the GeneralAccess field value if set, zero value otherwise. -func (o *RequestQueue) GetGeneralAccess() GeneralAccess { - if o == nil || IsNil(o.GeneralAccess) { - var ret GeneralAccess - return ret - } - return *o.GeneralAccess -} - -// GetGeneralAccessOk returns a tuple with the GeneralAccess field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *RequestQueue) GetGeneralAccessOk() (*GeneralAccess, bool) { - if o == nil || IsNil(o.GeneralAccess) { - return nil, false - } - return o.GeneralAccess, true -} - -// HasGeneralAccess returns a boolean if a field has been set. -func (o *RequestQueue) HasGeneralAccess() bool { - if o != nil && !IsNil(o.GeneralAccess) { - return true - } - - return false -} - -// SetGeneralAccess gets a reference to the given GeneralAccess and assigns it to the GeneralAccess field. -func (o *RequestQueue) SetGeneralAccess(v GeneralAccess) { - o.GeneralAccess = &v -} - -func (o RequestQueue) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o RequestQueue) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["id"] = o.Id - if o.Name.IsSet() { - toSerialize["name"] = o.Name.Get() - } - toSerialize["userId"] = o.UserId - if o.ActId.IsSet() { - toSerialize["actId"] = o.ActId.Get() - } - if o.ActRunId.IsSet() { - toSerialize["actRunId"] = o.ActRunId.Get() - } - toSerialize["createdAt"] = o.CreatedAt - toSerialize["modifiedAt"] = o.ModifiedAt - toSerialize["accessedAt"] = o.AccessedAt - toSerialize["totalRequestCount"] = o.TotalRequestCount - toSerialize["handledRequestCount"] = o.HandledRequestCount - toSerialize["pendingRequestCount"] = o.PendingRequestCount - toSerialize["hadMultipleClients"] = o.HadMultipleClients - toSerialize["consoleUrl"] = o.ConsoleUrl - if !IsNil(o.Stats) { - toSerialize["stats"] = o.Stats - } - if !IsNil(o.GeneralAccess) { - toSerialize["generalAccess"] = o.GeneralAccess - } - return toSerialize, nil -} - -func (o *RequestQueue) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "id", - "userId", - "createdAt", - "modifiedAt", - "accessedAt", - "totalRequestCount", - "handledRequestCount", - "pendingRequestCount", - "hadMultipleClients", - "consoleUrl", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err; - } - - for _, requiredProperty := range(requiredProperties) { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varRequestQueue := _RequestQueue{} - - decoder := json.NewDecoder(bytes.NewReader(data)) - decoder.DisallowUnknownFields() - err = decoder.Decode(&varRequestQueue) - - if err != nil { - return err - } - - *o = RequestQueue(varRequestQueue) - - return err -} - -type NullableRequestQueue struct { - value *RequestQueue - isSet bool -} - -func (v NullableRequestQueue) Get() *RequestQueue { - return v.value -} - -func (v *NullableRequestQueue) Set(val *RequestQueue) { - v.value = val - v.isSet = true -} - -func (v NullableRequestQueue) IsSet() bool { - return v.isSet -} - -func (v *NullableRequestQueue) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableRequestQueue(val *RequestQueue) *NullableRequestQueue { - return &NullableRequestQueue{value: val, isSet: true} -} - -func (v NullableRequestQueue) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableRequestQueue) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_request_queue_head.go b/model_request_queue_head.go deleted file mode 100644 index c352116..0000000 --- a/model_request_queue_head.go +++ /dev/null @@ -1,247 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" - "time" - "bytes" - "fmt" -) - -// checks if the RequestQueueHead type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &RequestQueueHead{} - -// RequestQueueHead A batch of requests from the request queue head without locking. -type RequestQueueHead struct { - // The maximum number of requests returned. - Limit int32 `json:"limit"` - // The timestamp when the request queue was last modified. Modifications include adding, updating, or removing requests, as well as locking or unlocking requests in the request queue. - QueueModifiedAt time.Time `json:"queueModifiedAt"` - // Whether the request queue has been accessed by multiple different clients. - HadMultipleClients bool `json:"hadMultipleClients"` - // The array of requests from the request queue head. - Items []HeadRequest `json:"items"` -} - -type _RequestQueueHead RequestQueueHead - -// NewRequestQueueHead instantiates a new RequestQueueHead object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewRequestQueueHead(limit int32, queueModifiedAt time.Time, hadMultipleClients bool, items []HeadRequest) *RequestQueueHead { - this := RequestQueueHead{} - this.Limit = limit - this.QueueModifiedAt = queueModifiedAt - this.HadMultipleClients = hadMultipleClients - this.Items = items - return &this -} - -// NewRequestQueueHeadWithDefaults instantiates a new RequestQueueHead object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewRequestQueueHeadWithDefaults() *RequestQueueHead { - this := RequestQueueHead{} - return &this -} - -// GetLimit returns the Limit field value -func (o *RequestQueueHead) GetLimit() int32 { - if o == nil { - var ret int32 - return ret - } - - return o.Limit -} - -// GetLimitOk returns a tuple with the Limit field value -// and a boolean to check if the value has been set. -func (o *RequestQueueHead) GetLimitOk() (*int32, bool) { - if o == nil { - return nil, false - } - return &o.Limit, true -} - -// SetLimit sets field value -func (o *RequestQueueHead) SetLimit(v int32) { - o.Limit = v -} - -// GetQueueModifiedAt returns the QueueModifiedAt field value -func (o *RequestQueueHead) GetQueueModifiedAt() time.Time { - if o == nil { - var ret time.Time - return ret - } - - return o.QueueModifiedAt -} - -// GetQueueModifiedAtOk returns a tuple with the QueueModifiedAt field value -// and a boolean to check if the value has been set. -func (o *RequestQueueHead) GetQueueModifiedAtOk() (*time.Time, bool) { - if o == nil { - return nil, false - } - return &o.QueueModifiedAt, true -} - -// SetQueueModifiedAt sets field value -func (o *RequestQueueHead) SetQueueModifiedAt(v time.Time) { - o.QueueModifiedAt = v -} - -// GetHadMultipleClients returns the HadMultipleClients field value -func (o *RequestQueueHead) GetHadMultipleClients() bool { - if o == nil { - var ret bool - return ret - } - - return o.HadMultipleClients -} - -// GetHadMultipleClientsOk returns a tuple with the HadMultipleClients field value -// and a boolean to check if the value has been set. -func (o *RequestQueueHead) GetHadMultipleClientsOk() (*bool, bool) { - if o == nil { - return nil, false - } - return &o.HadMultipleClients, true -} - -// SetHadMultipleClients sets field value -func (o *RequestQueueHead) SetHadMultipleClients(v bool) { - o.HadMultipleClients = v -} - -// GetItems returns the Items field value -func (o *RequestQueueHead) GetItems() []HeadRequest { - if o == nil { - var ret []HeadRequest - return ret - } - - return o.Items -} - -// GetItemsOk returns a tuple with the Items field value -// and a boolean to check if the value has been set. -func (o *RequestQueueHead) GetItemsOk() ([]HeadRequest, bool) { - if o == nil { - return nil, false - } - return o.Items, true -} - -// SetItems sets field value -func (o *RequestQueueHead) SetItems(v []HeadRequest) { - o.Items = v -} - -func (o RequestQueueHead) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o RequestQueueHead) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["limit"] = o.Limit - toSerialize["queueModifiedAt"] = o.QueueModifiedAt - toSerialize["hadMultipleClients"] = o.HadMultipleClients - toSerialize["items"] = o.Items - return toSerialize, nil -} - -func (o *RequestQueueHead) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "limit", - "queueModifiedAt", - "hadMultipleClients", - "items", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err; - } - - for _, requiredProperty := range(requiredProperties) { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varRequestQueueHead := _RequestQueueHead{} - - decoder := json.NewDecoder(bytes.NewReader(data)) - decoder.DisallowUnknownFields() - err = decoder.Decode(&varRequestQueueHead) - - if err != nil { - return err - } - - *o = RequestQueueHead(varRequestQueueHead) - - return err -} - -type NullableRequestQueueHead struct { - value *RequestQueueHead - isSet bool -} - -func (v NullableRequestQueueHead) Get() *RequestQueueHead { - return v.value -} - -func (v *NullableRequestQueueHead) Set(val *RequestQueueHead) { - v.value = val - v.isSet = true -} - -func (v NullableRequestQueueHead) IsSet() bool { - return v.isSet -} - -func (v *NullableRequestQueueHead) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableRequestQueueHead(val *RequestQueueHead) *NullableRequestQueueHead { - return &NullableRequestQueueHead{value: val, isSet: true} -} - -func (v NullableRequestQueueHead) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableRequestQueueHead) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_request_queue_response.go b/model_request_queue_response.go deleted file mode 100644 index 9512455..0000000 --- a/model_request_queue_response.go +++ /dev/null @@ -1,158 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" - "bytes" - "fmt" -) - -// checks if the RequestQueueResponse type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &RequestQueueResponse{} - -// RequestQueueResponse Response containing request queue data. -type RequestQueueResponse struct { - Data RequestQueue `json:"data"` -} - -type _RequestQueueResponse RequestQueueResponse - -// NewRequestQueueResponse instantiates a new RequestQueueResponse object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewRequestQueueResponse(data RequestQueue) *RequestQueueResponse { - this := RequestQueueResponse{} - this.Data = data - return &this -} - -// NewRequestQueueResponseWithDefaults instantiates a new RequestQueueResponse object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewRequestQueueResponseWithDefaults() *RequestQueueResponse { - this := RequestQueueResponse{} - return &this -} - -// GetData returns the Data field value -func (o *RequestQueueResponse) GetData() RequestQueue { - if o == nil { - var ret RequestQueue - return ret - } - - return o.Data -} - -// GetDataOk returns a tuple with the Data field value -// and a boolean to check if the value has been set. -func (o *RequestQueueResponse) GetDataOk() (*RequestQueue, bool) { - if o == nil { - return nil, false - } - return &o.Data, true -} - -// SetData sets field value -func (o *RequestQueueResponse) SetData(v RequestQueue) { - o.Data = v -} - -func (o RequestQueueResponse) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o RequestQueueResponse) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["data"] = o.Data - return toSerialize, nil -} - -func (o *RequestQueueResponse) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "data", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err; - } - - for _, requiredProperty := range(requiredProperties) { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varRequestQueueResponse := _RequestQueueResponse{} - - decoder := json.NewDecoder(bytes.NewReader(data)) - decoder.DisallowUnknownFields() - err = decoder.Decode(&varRequestQueueResponse) - - if err != nil { - return err - } - - *o = RequestQueueResponse(varRequestQueueResponse) - - return err -} - -type NullableRequestQueueResponse struct { - value *RequestQueueResponse - isSet bool -} - -func (v NullableRequestQueueResponse) Get() *RequestQueueResponse { - return v.value -} - -func (v *NullableRequestQueueResponse) Set(val *RequestQueueResponse) { - v.value = val - v.isSet = true -} - -func (v NullableRequestQueueResponse) IsSet() bool { - return v.isSet -} - -func (v *NullableRequestQueueResponse) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableRequestQueueResponse(val *RequestQueueResponse) *NullableRequestQueueResponse { - return &NullableRequestQueueResponse{value: val, isSet: true} -} - -func (v NullableRequestQueueResponse) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableRequestQueueResponse) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_request_queue_short.go b/model_request_queue_short.go deleted file mode 100644 index 0761b79..0000000 --- a/model_request_queue_short.go +++ /dev/null @@ -1,653 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" - "time" - "bytes" - "fmt" -) - -// checks if the RequestQueueShort type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &RequestQueueShort{} - -// RequestQueueShort A shortened request queue object for list responses. -type RequestQueueShort struct { - // A unique identifier assigned to the request queue. - Id string `json:"id"` - // The name of the request queue. - Name string `json:"name"` - // The ID of the user who owns the request queue. - UserId string `json:"userId"` - // The username of the user who owns the request queue. - Username string `json:"username"` - // The timestamp when the request queue was created. - CreatedAt time.Time `json:"createdAt"` - // The timestamp when the request queue was last modified. Modifications include adding, updating, or removing requests, as well as locking or unlocking requests in the request queue. - ModifiedAt time.Time `json:"modifiedAt"` - // The timestamp when the request queue was last accessed. - AccessedAt time.Time `json:"accessedAt"` - // The timestamp when the request queue will expire and be deleted. - ExpireAt *time.Time `json:"expireAt,omitempty"` - // The total number of requests in the request queue. - TotalRequestCount int32 `json:"totalRequestCount"` - // The number of requests that have been handled. - HandledRequestCount int32 `json:"handledRequestCount"` - // The number of requests that are pending and have not been handled yet. - PendingRequestCount int32 `json:"pendingRequestCount"` - // The ID of the Actor that created this request queue. - ActId NullableString `json:"actId,omitempty"` - // The ID of the Actor run that created this request queue. - ActRunId NullableString `json:"actRunId,omitempty"` - // Whether the request queue has been accessed by multiple different clients. - HadMultipleClients bool `json:"hadMultipleClients"` - GeneralAccess *GeneralAccess `json:"generalAccess,omitempty"` - Stats *RequestQueueStats `json:"stats,omitempty"` -} - -type _RequestQueueShort RequestQueueShort - -// NewRequestQueueShort instantiates a new RequestQueueShort object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewRequestQueueShort(id string, name string, userId string, username string, createdAt time.Time, modifiedAt time.Time, accessedAt time.Time, totalRequestCount int32, handledRequestCount int32, pendingRequestCount int32, hadMultipleClients bool) *RequestQueueShort { - this := RequestQueueShort{} - this.Id = id - this.Name = name - this.UserId = userId - this.Username = username - this.CreatedAt = createdAt - this.ModifiedAt = modifiedAt - this.AccessedAt = accessedAt - this.TotalRequestCount = totalRequestCount - this.HandledRequestCount = handledRequestCount - this.PendingRequestCount = pendingRequestCount - this.HadMultipleClients = hadMultipleClients - return &this -} - -// NewRequestQueueShortWithDefaults instantiates a new RequestQueueShort object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewRequestQueueShortWithDefaults() *RequestQueueShort { - this := RequestQueueShort{} - return &this -} - -// GetId returns the Id field value -func (o *RequestQueueShort) GetId() string { - if o == nil { - var ret string - return ret - } - - return o.Id -} - -// GetIdOk returns a tuple with the Id field value -// and a boolean to check if the value has been set. -func (o *RequestQueueShort) GetIdOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Id, true -} - -// SetId sets field value -func (o *RequestQueueShort) SetId(v string) { - o.Id = v -} - -// GetName returns the Name field value -func (o *RequestQueueShort) GetName() string { - if o == nil { - var ret string - return ret - } - - return o.Name -} - -// GetNameOk returns a tuple with the Name field value -// and a boolean to check if the value has been set. -func (o *RequestQueueShort) GetNameOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Name, true -} - -// SetName sets field value -func (o *RequestQueueShort) SetName(v string) { - o.Name = v -} - -// GetUserId returns the UserId field value -func (o *RequestQueueShort) GetUserId() string { - if o == nil { - var ret string - return ret - } - - return o.UserId -} - -// GetUserIdOk returns a tuple with the UserId field value -// and a boolean to check if the value has been set. -func (o *RequestQueueShort) GetUserIdOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.UserId, true -} - -// SetUserId sets field value -func (o *RequestQueueShort) SetUserId(v string) { - o.UserId = v -} - -// GetUsername returns the Username field value -func (o *RequestQueueShort) GetUsername() string { - if o == nil { - var ret string - return ret - } - - return o.Username -} - -// GetUsernameOk returns a tuple with the Username field value -// and a boolean to check if the value has been set. -func (o *RequestQueueShort) GetUsernameOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Username, true -} - -// SetUsername sets field value -func (o *RequestQueueShort) SetUsername(v string) { - o.Username = v -} - -// GetCreatedAt returns the CreatedAt field value -func (o *RequestQueueShort) GetCreatedAt() time.Time { - if o == nil { - var ret time.Time - return ret - } - - return o.CreatedAt -} - -// GetCreatedAtOk returns a tuple with the CreatedAt field value -// and a boolean to check if the value has been set. -func (o *RequestQueueShort) GetCreatedAtOk() (*time.Time, bool) { - if o == nil { - return nil, false - } - return &o.CreatedAt, true -} - -// SetCreatedAt sets field value -func (o *RequestQueueShort) SetCreatedAt(v time.Time) { - o.CreatedAt = v -} - -// GetModifiedAt returns the ModifiedAt field value -func (o *RequestQueueShort) GetModifiedAt() time.Time { - if o == nil { - var ret time.Time - return ret - } - - return o.ModifiedAt -} - -// GetModifiedAtOk returns a tuple with the ModifiedAt field value -// and a boolean to check if the value has been set. -func (o *RequestQueueShort) GetModifiedAtOk() (*time.Time, bool) { - if o == nil { - return nil, false - } - return &o.ModifiedAt, true -} - -// SetModifiedAt sets field value -func (o *RequestQueueShort) SetModifiedAt(v time.Time) { - o.ModifiedAt = v -} - -// GetAccessedAt returns the AccessedAt field value -func (o *RequestQueueShort) GetAccessedAt() time.Time { - if o == nil { - var ret time.Time - return ret - } - - return o.AccessedAt -} - -// GetAccessedAtOk returns a tuple with the AccessedAt field value -// and a boolean to check if the value has been set. -func (o *RequestQueueShort) GetAccessedAtOk() (*time.Time, bool) { - if o == nil { - return nil, false - } - return &o.AccessedAt, true -} - -// SetAccessedAt sets field value -func (o *RequestQueueShort) SetAccessedAt(v time.Time) { - o.AccessedAt = v -} - -// GetExpireAt returns the ExpireAt field value if set, zero value otherwise. -func (o *RequestQueueShort) GetExpireAt() time.Time { - if o == nil || IsNil(o.ExpireAt) { - var ret time.Time - return ret - } - return *o.ExpireAt -} - -// GetExpireAtOk returns a tuple with the ExpireAt field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *RequestQueueShort) GetExpireAtOk() (*time.Time, bool) { - if o == nil || IsNil(o.ExpireAt) { - return nil, false - } - return o.ExpireAt, true -} - -// HasExpireAt returns a boolean if a field has been set. -func (o *RequestQueueShort) HasExpireAt() bool { - if o != nil && !IsNil(o.ExpireAt) { - return true - } - - return false -} - -// SetExpireAt gets a reference to the given time.Time and assigns it to the ExpireAt field. -func (o *RequestQueueShort) SetExpireAt(v time.Time) { - o.ExpireAt = &v -} - -// GetTotalRequestCount returns the TotalRequestCount field value -func (o *RequestQueueShort) GetTotalRequestCount() int32 { - if o == nil { - var ret int32 - return ret - } - - return o.TotalRequestCount -} - -// GetTotalRequestCountOk returns a tuple with the TotalRequestCount field value -// and a boolean to check if the value has been set. -func (o *RequestQueueShort) GetTotalRequestCountOk() (*int32, bool) { - if o == nil { - return nil, false - } - return &o.TotalRequestCount, true -} - -// SetTotalRequestCount sets field value -func (o *RequestQueueShort) SetTotalRequestCount(v int32) { - o.TotalRequestCount = v -} - -// GetHandledRequestCount returns the HandledRequestCount field value -func (o *RequestQueueShort) GetHandledRequestCount() int32 { - if o == nil { - var ret int32 - return ret - } - - return o.HandledRequestCount -} - -// GetHandledRequestCountOk returns a tuple with the HandledRequestCount field value -// and a boolean to check if the value has been set. -func (o *RequestQueueShort) GetHandledRequestCountOk() (*int32, bool) { - if o == nil { - return nil, false - } - return &o.HandledRequestCount, true -} - -// SetHandledRequestCount sets field value -func (o *RequestQueueShort) SetHandledRequestCount(v int32) { - o.HandledRequestCount = v -} - -// GetPendingRequestCount returns the PendingRequestCount field value -func (o *RequestQueueShort) GetPendingRequestCount() int32 { - if o == nil { - var ret int32 - return ret - } - - return o.PendingRequestCount -} - -// GetPendingRequestCountOk returns a tuple with the PendingRequestCount field value -// and a boolean to check if the value has been set. -func (o *RequestQueueShort) GetPendingRequestCountOk() (*int32, bool) { - if o == nil { - return nil, false - } - return &o.PendingRequestCount, true -} - -// SetPendingRequestCount sets field value -func (o *RequestQueueShort) SetPendingRequestCount(v int32) { - o.PendingRequestCount = v -} - -// GetActId returns the ActId field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *RequestQueueShort) GetActId() string { - if o == nil || IsNil(o.ActId.Get()) { - var ret string - return ret - } - return *o.ActId.Get() -} - -// GetActIdOk returns a tuple with the ActId field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *RequestQueueShort) GetActIdOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.ActId.Get(), o.ActId.IsSet() -} - -// HasActId returns a boolean if a field has been set. -func (o *RequestQueueShort) HasActId() bool { - if o != nil && o.ActId.IsSet() { - return true - } - - return false -} - -// SetActId gets a reference to the given NullableString and assigns it to the ActId field. -func (o *RequestQueueShort) SetActId(v string) { - o.ActId.Set(&v) -} -// SetActIdNil sets the value for ActId to be an explicit nil -func (o *RequestQueueShort) SetActIdNil() { - o.ActId.Set(nil) -} - -// UnsetActId ensures that no value is present for ActId, not even an explicit nil -func (o *RequestQueueShort) UnsetActId() { - o.ActId.Unset() -} - -// GetActRunId returns the ActRunId field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *RequestQueueShort) GetActRunId() string { - if o == nil || IsNil(o.ActRunId.Get()) { - var ret string - return ret - } - return *o.ActRunId.Get() -} - -// GetActRunIdOk returns a tuple with the ActRunId field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *RequestQueueShort) GetActRunIdOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.ActRunId.Get(), o.ActRunId.IsSet() -} - -// HasActRunId returns a boolean if a field has been set. -func (o *RequestQueueShort) HasActRunId() bool { - if o != nil && o.ActRunId.IsSet() { - return true - } - - return false -} - -// SetActRunId gets a reference to the given NullableString and assigns it to the ActRunId field. -func (o *RequestQueueShort) SetActRunId(v string) { - o.ActRunId.Set(&v) -} -// SetActRunIdNil sets the value for ActRunId to be an explicit nil -func (o *RequestQueueShort) SetActRunIdNil() { - o.ActRunId.Set(nil) -} - -// UnsetActRunId ensures that no value is present for ActRunId, not even an explicit nil -func (o *RequestQueueShort) UnsetActRunId() { - o.ActRunId.Unset() -} - -// GetHadMultipleClients returns the HadMultipleClients field value -func (o *RequestQueueShort) GetHadMultipleClients() bool { - if o == nil { - var ret bool - return ret - } - - return o.HadMultipleClients -} - -// GetHadMultipleClientsOk returns a tuple with the HadMultipleClients field value -// and a boolean to check if the value has been set. -func (o *RequestQueueShort) GetHadMultipleClientsOk() (*bool, bool) { - if o == nil { - return nil, false - } - return &o.HadMultipleClients, true -} - -// SetHadMultipleClients sets field value -func (o *RequestQueueShort) SetHadMultipleClients(v bool) { - o.HadMultipleClients = v -} - -// GetGeneralAccess returns the GeneralAccess field value if set, zero value otherwise. -func (o *RequestQueueShort) GetGeneralAccess() GeneralAccess { - if o == nil || IsNil(o.GeneralAccess) { - var ret GeneralAccess - return ret - } - return *o.GeneralAccess -} - -// GetGeneralAccessOk returns a tuple with the GeneralAccess field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *RequestQueueShort) GetGeneralAccessOk() (*GeneralAccess, bool) { - if o == nil || IsNil(o.GeneralAccess) { - return nil, false - } - return o.GeneralAccess, true -} - -// HasGeneralAccess returns a boolean if a field has been set. -func (o *RequestQueueShort) HasGeneralAccess() bool { - if o != nil && !IsNil(o.GeneralAccess) { - return true - } - - return false -} - -// SetGeneralAccess gets a reference to the given GeneralAccess and assigns it to the GeneralAccess field. -func (o *RequestQueueShort) SetGeneralAccess(v GeneralAccess) { - o.GeneralAccess = &v -} - -// GetStats returns the Stats field value if set, zero value otherwise. -func (o *RequestQueueShort) GetStats() RequestQueueStats { - if o == nil || IsNil(o.Stats) { - var ret RequestQueueStats - return ret - } - return *o.Stats -} - -// GetStatsOk returns a tuple with the Stats field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *RequestQueueShort) GetStatsOk() (*RequestQueueStats, bool) { - if o == nil || IsNil(o.Stats) { - return nil, false - } - return o.Stats, true -} - -// HasStats returns a boolean if a field has been set. -func (o *RequestQueueShort) HasStats() bool { - if o != nil && !IsNil(o.Stats) { - return true - } - - return false -} - -// SetStats gets a reference to the given RequestQueueStats and assigns it to the Stats field. -func (o *RequestQueueShort) SetStats(v RequestQueueStats) { - o.Stats = &v -} - -func (o RequestQueueShort) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o RequestQueueShort) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["id"] = o.Id - toSerialize["name"] = o.Name - toSerialize["userId"] = o.UserId - toSerialize["username"] = o.Username - toSerialize["createdAt"] = o.CreatedAt - toSerialize["modifiedAt"] = o.ModifiedAt - toSerialize["accessedAt"] = o.AccessedAt - if !IsNil(o.ExpireAt) { - toSerialize["expireAt"] = o.ExpireAt - } - toSerialize["totalRequestCount"] = o.TotalRequestCount - toSerialize["handledRequestCount"] = o.HandledRequestCount - toSerialize["pendingRequestCount"] = o.PendingRequestCount - if o.ActId.IsSet() { - toSerialize["actId"] = o.ActId.Get() - } - if o.ActRunId.IsSet() { - toSerialize["actRunId"] = o.ActRunId.Get() - } - toSerialize["hadMultipleClients"] = o.HadMultipleClients - if !IsNil(o.GeneralAccess) { - toSerialize["generalAccess"] = o.GeneralAccess - } - if !IsNil(o.Stats) { - toSerialize["stats"] = o.Stats - } - return toSerialize, nil -} - -func (o *RequestQueueShort) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "id", - "name", - "userId", - "username", - "createdAt", - "modifiedAt", - "accessedAt", - "totalRequestCount", - "handledRequestCount", - "pendingRequestCount", - "hadMultipleClients", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err; - } - - for _, requiredProperty := range(requiredProperties) { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varRequestQueueShort := _RequestQueueShort{} - - decoder := json.NewDecoder(bytes.NewReader(data)) - decoder.DisallowUnknownFields() - err = decoder.Decode(&varRequestQueueShort) - - if err != nil { - return err - } - - *o = RequestQueueShort(varRequestQueueShort) - - return err -} - -type NullableRequestQueueShort struct { - value *RequestQueueShort - isSet bool -} - -func (v NullableRequestQueueShort) Get() *RequestQueueShort { - return v.value -} - -func (v *NullableRequestQueueShort) Set(val *RequestQueueShort) { - v.value = val - v.isSet = true -} - -func (v NullableRequestQueueShort) IsSet() bool { - return v.isSet -} - -func (v *NullableRequestQueueShort) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableRequestQueueShort(val *RequestQueueShort) *NullableRequestQueueShort { - return &NullableRequestQueueShort{value: val, isSet: true} -} - -func (v NullableRequestQueueShort) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableRequestQueueShort) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_request_queue_stats.go b/model_request_queue_stats.go deleted file mode 100644 index ba799b7..0000000 --- a/model_request_queue_stats.go +++ /dev/null @@ -1,275 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" -) - -// checks if the RequestQueueStats type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &RequestQueueStats{} - -// RequestQueueStats Statistics about request queue operations and storage. -type RequestQueueStats struct { - // The number of delete operations performed on the request queue. - DeleteCount *int32 `json:"deleteCount,omitempty"` - // The number of times requests from the head were read. - HeadItemReadCount *int32 `json:"headItemReadCount,omitempty"` - // The total number of read operations performed on the request queue. - ReadCount *int32 `json:"readCount,omitempty"` - // The total storage size in bytes used by the request queue. - StorageBytes *int32 `json:"storageBytes,omitempty"` - // The total number of write operations performed on the request queue. - WriteCount *int32 `json:"writeCount,omitempty"` -} - -// NewRequestQueueStats instantiates a new RequestQueueStats object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewRequestQueueStats() *RequestQueueStats { - this := RequestQueueStats{} - return &this -} - -// NewRequestQueueStatsWithDefaults instantiates a new RequestQueueStats object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewRequestQueueStatsWithDefaults() *RequestQueueStats { - this := RequestQueueStats{} - return &this -} - -// GetDeleteCount returns the DeleteCount field value if set, zero value otherwise. -func (o *RequestQueueStats) GetDeleteCount() int32 { - if o == nil || IsNil(o.DeleteCount) { - var ret int32 - return ret - } - return *o.DeleteCount -} - -// GetDeleteCountOk returns a tuple with the DeleteCount field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *RequestQueueStats) GetDeleteCountOk() (*int32, bool) { - if o == nil || IsNil(o.DeleteCount) { - return nil, false - } - return o.DeleteCount, true -} - -// HasDeleteCount returns a boolean if a field has been set. -func (o *RequestQueueStats) HasDeleteCount() bool { - if o != nil && !IsNil(o.DeleteCount) { - return true - } - - return false -} - -// SetDeleteCount gets a reference to the given int32 and assigns it to the DeleteCount field. -func (o *RequestQueueStats) SetDeleteCount(v int32) { - o.DeleteCount = &v -} - -// GetHeadItemReadCount returns the HeadItemReadCount field value if set, zero value otherwise. -func (o *RequestQueueStats) GetHeadItemReadCount() int32 { - if o == nil || IsNil(o.HeadItemReadCount) { - var ret int32 - return ret - } - return *o.HeadItemReadCount -} - -// GetHeadItemReadCountOk returns a tuple with the HeadItemReadCount field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *RequestQueueStats) GetHeadItemReadCountOk() (*int32, bool) { - if o == nil || IsNil(o.HeadItemReadCount) { - return nil, false - } - return o.HeadItemReadCount, true -} - -// HasHeadItemReadCount returns a boolean if a field has been set. -func (o *RequestQueueStats) HasHeadItemReadCount() bool { - if o != nil && !IsNil(o.HeadItemReadCount) { - return true - } - - return false -} - -// SetHeadItemReadCount gets a reference to the given int32 and assigns it to the HeadItemReadCount field. -func (o *RequestQueueStats) SetHeadItemReadCount(v int32) { - o.HeadItemReadCount = &v -} - -// GetReadCount returns the ReadCount field value if set, zero value otherwise. -func (o *RequestQueueStats) GetReadCount() int32 { - if o == nil || IsNil(o.ReadCount) { - var ret int32 - return ret - } - return *o.ReadCount -} - -// GetReadCountOk returns a tuple with the ReadCount field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *RequestQueueStats) GetReadCountOk() (*int32, bool) { - if o == nil || IsNil(o.ReadCount) { - return nil, false - } - return o.ReadCount, true -} - -// HasReadCount returns a boolean if a field has been set. -func (o *RequestQueueStats) HasReadCount() bool { - if o != nil && !IsNil(o.ReadCount) { - return true - } - - return false -} - -// SetReadCount gets a reference to the given int32 and assigns it to the ReadCount field. -func (o *RequestQueueStats) SetReadCount(v int32) { - o.ReadCount = &v -} - -// GetStorageBytes returns the StorageBytes field value if set, zero value otherwise. -func (o *RequestQueueStats) GetStorageBytes() int32 { - if o == nil || IsNil(o.StorageBytes) { - var ret int32 - return ret - } - return *o.StorageBytes -} - -// GetStorageBytesOk returns a tuple with the StorageBytes field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *RequestQueueStats) GetStorageBytesOk() (*int32, bool) { - if o == nil || IsNil(o.StorageBytes) { - return nil, false - } - return o.StorageBytes, true -} - -// HasStorageBytes returns a boolean if a field has been set. -func (o *RequestQueueStats) HasStorageBytes() bool { - if o != nil && !IsNil(o.StorageBytes) { - return true - } - - return false -} - -// SetStorageBytes gets a reference to the given int32 and assigns it to the StorageBytes field. -func (o *RequestQueueStats) SetStorageBytes(v int32) { - o.StorageBytes = &v -} - -// GetWriteCount returns the WriteCount field value if set, zero value otherwise. -func (o *RequestQueueStats) GetWriteCount() int32 { - if o == nil || IsNil(o.WriteCount) { - var ret int32 - return ret - } - return *o.WriteCount -} - -// GetWriteCountOk returns a tuple with the WriteCount field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *RequestQueueStats) GetWriteCountOk() (*int32, bool) { - if o == nil || IsNil(o.WriteCount) { - return nil, false - } - return o.WriteCount, true -} - -// HasWriteCount returns a boolean if a field has been set. -func (o *RequestQueueStats) HasWriteCount() bool { - if o != nil && !IsNil(o.WriteCount) { - return true - } - - return false -} - -// SetWriteCount gets a reference to the given int32 and assigns it to the WriteCount field. -func (o *RequestQueueStats) SetWriteCount(v int32) { - o.WriteCount = &v -} - -func (o RequestQueueStats) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o RequestQueueStats) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if !IsNil(o.DeleteCount) { - toSerialize["deleteCount"] = o.DeleteCount - } - if !IsNil(o.HeadItemReadCount) { - toSerialize["headItemReadCount"] = o.HeadItemReadCount - } - if !IsNil(o.ReadCount) { - toSerialize["readCount"] = o.ReadCount - } - if !IsNil(o.StorageBytes) { - toSerialize["storageBytes"] = o.StorageBytes - } - if !IsNil(o.WriteCount) { - toSerialize["writeCount"] = o.WriteCount - } - return toSerialize, nil -} - -type NullableRequestQueueStats struct { - value *RequestQueueStats - isSet bool -} - -func (v NullableRequestQueueStats) Get() *RequestQueueStats { - return v.value -} - -func (v *NullableRequestQueueStats) Set(val *RequestQueueStats) { - v.value = val - v.isSet = true -} - -func (v NullableRequestQueueStats) IsSet() bool { - return v.isSet -} - -func (v *NullableRequestQueueStats) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableRequestQueueStats(val *RequestQueueStats) *NullableRequestQueueStats { - return &NullableRequestQueueStats{value: val, isSet: true} -} - -func (v NullableRequestQueueStats) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableRequestQueueStats) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_request_registration.go b/model_request_registration.go deleted file mode 100644 index 4f0688e..0000000 --- a/model_request_registration.go +++ /dev/null @@ -1,217 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" - "bytes" - "fmt" -) - -// checks if the RequestRegistration type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &RequestRegistration{} - -// RequestRegistration Result of registering a request in the request queue, either by adding a new request or updating an existing one. -type RequestRegistration struct { - // A unique identifier assigned to the request. - RequestId string `json:"requestId"` - // Indicates whether a request with the same unique key already existed in the request queue. If true, no new request was created. - WasAlreadyPresent bool `json:"wasAlreadyPresent"` - // Indicates whether a request with the same unique key has already been processed by the request queue. - WasAlreadyHandled bool `json:"wasAlreadyHandled"` -} - -type _RequestRegistration RequestRegistration - -// NewRequestRegistration instantiates a new RequestRegistration object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewRequestRegistration(requestId string, wasAlreadyPresent bool, wasAlreadyHandled bool) *RequestRegistration { - this := RequestRegistration{} - this.RequestId = requestId - this.WasAlreadyPresent = wasAlreadyPresent - this.WasAlreadyHandled = wasAlreadyHandled - return &this -} - -// NewRequestRegistrationWithDefaults instantiates a new RequestRegistration object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewRequestRegistrationWithDefaults() *RequestRegistration { - this := RequestRegistration{} - return &this -} - -// GetRequestId returns the RequestId field value -func (o *RequestRegistration) GetRequestId() string { - if o == nil { - var ret string - return ret - } - - return o.RequestId -} - -// GetRequestIdOk returns a tuple with the RequestId field value -// and a boolean to check if the value has been set. -func (o *RequestRegistration) GetRequestIdOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.RequestId, true -} - -// SetRequestId sets field value -func (o *RequestRegistration) SetRequestId(v string) { - o.RequestId = v -} - -// GetWasAlreadyPresent returns the WasAlreadyPresent field value -func (o *RequestRegistration) GetWasAlreadyPresent() bool { - if o == nil { - var ret bool - return ret - } - - return o.WasAlreadyPresent -} - -// GetWasAlreadyPresentOk returns a tuple with the WasAlreadyPresent field value -// and a boolean to check if the value has been set. -func (o *RequestRegistration) GetWasAlreadyPresentOk() (*bool, bool) { - if o == nil { - return nil, false - } - return &o.WasAlreadyPresent, true -} - -// SetWasAlreadyPresent sets field value -func (o *RequestRegistration) SetWasAlreadyPresent(v bool) { - o.WasAlreadyPresent = v -} - -// GetWasAlreadyHandled returns the WasAlreadyHandled field value -func (o *RequestRegistration) GetWasAlreadyHandled() bool { - if o == nil { - var ret bool - return ret - } - - return o.WasAlreadyHandled -} - -// GetWasAlreadyHandledOk returns a tuple with the WasAlreadyHandled field value -// and a boolean to check if the value has been set. -func (o *RequestRegistration) GetWasAlreadyHandledOk() (*bool, bool) { - if o == nil { - return nil, false - } - return &o.WasAlreadyHandled, true -} - -// SetWasAlreadyHandled sets field value -func (o *RequestRegistration) SetWasAlreadyHandled(v bool) { - o.WasAlreadyHandled = v -} - -func (o RequestRegistration) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o RequestRegistration) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["requestId"] = o.RequestId - toSerialize["wasAlreadyPresent"] = o.WasAlreadyPresent - toSerialize["wasAlreadyHandled"] = o.WasAlreadyHandled - return toSerialize, nil -} - -func (o *RequestRegistration) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "requestId", - "wasAlreadyPresent", - "wasAlreadyHandled", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err; - } - - for _, requiredProperty := range(requiredProperties) { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varRequestRegistration := _RequestRegistration{} - - decoder := json.NewDecoder(bytes.NewReader(data)) - decoder.DisallowUnknownFields() - err = decoder.Decode(&varRequestRegistration) - - if err != nil { - return err - } - - *o = RequestRegistration(varRequestRegistration) - - return err -} - -type NullableRequestRegistration struct { - value *RequestRegistration - isSet bool -} - -func (v NullableRequestRegistration) Get() *RequestRegistration { - return v.value -} - -func (v *NullableRequestRegistration) Set(val *RequestRegistration) { - v.value = val - v.isSet = true -} - -func (v NullableRequestRegistration) IsSet() bool { - return v.isSet -} - -func (v *NullableRequestRegistration) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableRequestRegistration(val *RequestRegistration) *NullableRequestRegistration { - return &NullableRequestRegistration{value: val, isSet: true} -} - -func (v NullableRequestRegistration) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableRequestRegistration) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_request_response.go b/model_request_response.go deleted file mode 100644 index 9a17448..0000000 --- a/model_request_response.go +++ /dev/null @@ -1,158 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" - "bytes" - "fmt" -) - -// checks if the RequestResponse type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &RequestResponse{} - -// RequestResponse Response containing a single request from the request queue. -type RequestResponse struct { - Data Request `json:"data"` -} - -type _RequestResponse RequestResponse - -// NewRequestResponse instantiates a new RequestResponse object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewRequestResponse(data Request) *RequestResponse { - this := RequestResponse{} - this.Data = data - return &this -} - -// NewRequestResponseWithDefaults instantiates a new RequestResponse object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewRequestResponseWithDefaults() *RequestResponse { - this := RequestResponse{} - return &this -} - -// GetData returns the Data field value -func (o *RequestResponse) GetData() Request { - if o == nil { - var ret Request - return ret - } - - return o.Data -} - -// GetDataOk returns a tuple with the Data field value -// and a boolean to check if the value has been set. -func (o *RequestResponse) GetDataOk() (*Request, bool) { - if o == nil { - return nil, false - } - return &o.Data, true -} - -// SetData sets field value -func (o *RequestResponse) SetData(v Request) { - o.Data = v -} - -func (o RequestResponse) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o RequestResponse) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["data"] = o.Data - return toSerialize, nil -} - -func (o *RequestResponse) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "data", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err; - } - - for _, requiredProperty := range(requiredProperties) { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varRequestResponse := _RequestResponse{} - - decoder := json.NewDecoder(bytes.NewReader(data)) - decoder.DisallowUnknownFields() - err = decoder.Decode(&varRequestResponse) - - if err != nil { - return err - } - - *o = RequestResponse(varRequestResponse) - - return err -} - -type NullableRequestResponse struct { - value *RequestResponse - isSet bool -} - -func (v NullableRequestResponse) Get() *RequestResponse { - return v.value -} - -func (v *NullableRequestResponse) Set(val *RequestResponse) { - v.value = val - v.isSet = true -} - -func (v NullableRequestResponse) IsSet() bool { - return v.isSet -} - -func (v *NullableRequestResponse) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableRequestResponse(val *RequestResponse) *NullableRequestResponse { - return &NullableRequestResponse{value: val, isSet: true} -} - -func (v NullableRequestResponse) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableRequestResponse) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_run.go b/model_run.go deleted file mode 100644 index bf1a1ba..0000000 --- a/model_run.go +++ /dev/null @@ -1,1247 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" - "time" - "bytes" - "fmt" -) - -// checks if the Run type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &Run{} - -// Run Represents an Actor run and its associated data. -type Run struct { - // Unique identifier of the Actor run. - Id string `json:"id"` - // ID of the Actor that was run. - ActId string `json:"actId"` - // ID of the user who started the run. - UserId string `json:"userId"` - // ID of the Actor task, if the run was started from a task. - ActorTaskId NullableString `json:"actorTaskId,omitempty"` - // Time when the Actor run started. - StartedAt time.Time `json:"startedAt"` - // Time when the Actor run finished. - FinishedAt NullableTime `json:"finishedAt,omitempty"` - // Current status of the Actor run. - Status ActorJobStatus `json:"status"` - // Detailed message about the run status. - StatusMessage NullableString `json:"statusMessage,omitempty"` - // Whether the status message is terminal (final). - IsStatusMessageTerminal NullableBool `json:"isStatusMessageTerminal,omitempty"` - // Metadata about the Actor run. - Meta RunMeta `json:"meta"` - // Pricing information for the Actor. - PricingInfo *ActorRunPricingInfo `json:"pricingInfo,omitempty"` - // Statistics of the Actor run. - Stats RunStats `json:"stats"` - // A map of charged event types to their counts. The keys are event type identifiers defined by the Actor's pricing model (pay-per-event), and the values are the number of times each event was charged during this run. - ChargedEventCounts map[string]int32 `json:"chargedEventCounts,omitempty"` - // Configuration options for the Actor run. - Options RunOptions `json:"options"` - // ID of the Actor build used for this run. - BuildId string `json:"buildId"` - // Exit code of the Actor run process. - ExitCode NullableInt32 `json:"exitCode,omitempty"` - // General access level for the Actor run. - GeneralAccess GeneralAccess `json:"generalAccess"` - // ID of the default key-value store for this run. - DefaultKeyValueStoreId string `json:"defaultKeyValueStoreId"` - // ID of the default dataset for this run. - DefaultDatasetId string `json:"defaultDatasetId"` - // ID of the default request queue for this run. - DefaultRequestQueueId string `json:"defaultRequestQueueId"` - StorageIds *RunStorageIds `json:"storageIds,omitempty"` - // Build number of the Actor build used for this run. - BuildNumber NullableString `json:"buildNumber,omitempty" validate:"regexp=^([0-9]|[1-9][0-9])\\\\.([0-9]|[1-9][0-9])(\\\\.[1-9][0-9]{0,4})$"` - // URL of the container running the Actor. - ContainerUrl *string `json:"containerUrl,omitempty"` - // Whether the container's HTTP server is ready to accept requests. - IsContainerServerReady NullableBool `json:"isContainerServerReady,omitempty"` - // Name of the git branch used for the Actor build. - GitBranchName NullableString `json:"gitBranchName,omitempty"` - // Resource usage statistics for the run. - Usage NullableRunUsage `json:"usage,omitempty"` - // Total cost in USD for this run. Represents what you actually pay. For run owners: includes platform usage (compute units) and/or event costs depending on the Actor's pricing model. For run non-owners: only available for Pay-Per-Event Actors (event costs only). Requires authentication token to access. - UsageTotalUsd NullableFloat32 `json:"usageTotalUsd,omitempty"` - // Platform usage costs breakdown in USD. Only present if you own the run AND are paying for platform usage (Pay-Per-Usage, Rental, or Pay-Per-Event with usage costs like standby Actors). Not available for standard Pay-Per-Event Actors. Requires authentication token to access. - UsageUsd NullableRunUsageUsd `json:"usageUsd,omitempty"` - // List of metamorph events that occurred during the run. - Metamorphs []Metamorph `json:"metamorphs,omitempty"` - // Indicates which party covers platform usage costs for this run. - PlatformUsageBillingModel *string `json:"platformUsageBillingModel,omitempty"` -} - -type _Run Run - -// NewRun instantiates a new Run object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewRun(id string, actId string, userId string, startedAt time.Time, status ActorJobStatus, meta RunMeta, stats RunStats, options RunOptions, buildId string, generalAccess GeneralAccess, defaultKeyValueStoreId string, defaultDatasetId string, defaultRequestQueueId string) *Run { - this := Run{} - this.Id = id - this.ActId = actId - this.UserId = userId - this.StartedAt = startedAt - this.Status = status - this.Meta = meta - this.Stats = stats - this.Options = options - this.BuildId = buildId - this.GeneralAccess = generalAccess - this.DefaultKeyValueStoreId = defaultKeyValueStoreId - this.DefaultDatasetId = defaultDatasetId - this.DefaultRequestQueueId = defaultRequestQueueId - return &this -} - -// NewRunWithDefaults instantiates a new Run object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewRunWithDefaults() *Run { - this := Run{} - return &this -} - -// GetId returns the Id field value -func (o *Run) GetId() string { - if o == nil { - var ret string - return ret - } - - return o.Id -} - -// GetIdOk returns a tuple with the Id field value -// and a boolean to check if the value has been set. -func (o *Run) GetIdOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Id, true -} - -// SetId sets field value -func (o *Run) SetId(v string) { - o.Id = v -} - -// GetActId returns the ActId field value -func (o *Run) GetActId() string { - if o == nil { - var ret string - return ret - } - - return o.ActId -} - -// GetActIdOk returns a tuple with the ActId field value -// and a boolean to check if the value has been set. -func (o *Run) GetActIdOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.ActId, true -} - -// SetActId sets field value -func (o *Run) SetActId(v string) { - o.ActId = v -} - -// GetUserId returns the UserId field value -func (o *Run) GetUserId() string { - if o == nil { - var ret string - return ret - } - - return o.UserId -} - -// GetUserIdOk returns a tuple with the UserId field value -// and a boolean to check if the value has been set. -func (o *Run) GetUserIdOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.UserId, true -} - -// SetUserId sets field value -func (o *Run) SetUserId(v string) { - o.UserId = v -} - -// GetActorTaskId returns the ActorTaskId field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *Run) GetActorTaskId() string { - if o == nil || IsNil(o.ActorTaskId.Get()) { - var ret string - return ret - } - return *o.ActorTaskId.Get() -} - -// GetActorTaskIdOk returns a tuple with the ActorTaskId field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *Run) GetActorTaskIdOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.ActorTaskId.Get(), o.ActorTaskId.IsSet() -} - -// HasActorTaskId returns a boolean if a field has been set. -func (o *Run) HasActorTaskId() bool { - if o != nil && o.ActorTaskId.IsSet() { - return true - } - - return false -} - -// SetActorTaskId gets a reference to the given NullableString and assigns it to the ActorTaskId field. -func (o *Run) SetActorTaskId(v string) { - o.ActorTaskId.Set(&v) -} -// SetActorTaskIdNil sets the value for ActorTaskId to be an explicit nil -func (o *Run) SetActorTaskIdNil() { - o.ActorTaskId.Set(nil) -} - -// UnsetActorTaskId ensures that no value is present for ActorTaskId, not even an explicit nil -func (o *Run) UnsetActorTaskId() { - o.ActorTaskId.Unset() -} - -// GetStartedAt returns the StartedAt field value -func (o *Run) GetStartedAt() time.Time { - if o == nil { - var ret time.Time - return ret - } - - return o.StartedAt -} - -// GetStartedAtOk returns a tuple with the StartedAt field value -// and a boolean to check if the value has been set. -func (o *Run) GetStartedAtOk() (*time.Time, bool) { - if o == nil { - return nil, false - } - return &o.StartedAt, true -} - -// SetStartedAt sets field value -func (o *Run) SetStartedAt(v time.Time) { - o.StartedAt = v -} - -// GetFinishedAt returns the FinishedAt field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *Run) GetFinishedAt() time.Time { - if o == nil || IsNil(o.FinishedAt.Get()) { - var ret time.Time - return ret - } - return *o.FinishedAt.Get() -} - -// GetFinishedAtOk returns a tuple with the FinishedAt field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *Run) GetFinishedAtOk() (*time.Time, bool) { - if o == nil { - return nil, false - } - return o.FinishedAt.Get(), o.FinishedAt.IsSet() -} - -// HasFinishedAt returns a boolean if a field has been set. -func (o *Run) HasFinishedAt() bool { - if o != nil && o.FinishedAt.IsSet() { - return true - } - - return false -} - -// SetFinishedAt gets a reference to the given NullableTime and assigns it to the FinishedAt field. -func (o *Run) SetFinishedAt(v time.Time) { - o.FinishedAt.Set(&v) -} -// SetFinishedAtNil sets the value for FinishedAt to be an explicit nil -func (o *Run) SetFinishedAtNil() { - o.FinishedAt.Set(nil) -} - -// UnsetFinishedAt ensures that no value is present for FinishedAt, not even an explicit nil -func (o *Run) UnsetFinishedAt() { - o.FinishedAt.Unset() -} - -// GetStatus returns the Status field value -func (o *Run) GetStatus() ActorJobStatus { - if o == nil { - var ret ActorJobStatus - return ret - } - - return o.Status -} - -// GetStatusOk returns a tuple with the Status field value -// and a boolean to check if the value has been set. -func (o *Run) GetStatusOk() (*ActorJobStatus, bool) { - if o == nil { - return nil, false - } - return &o.Status, true -} - -// SetStatus sets field value -func (o *Run) SetStatus(v ActorJobStatus) { - o.Status = v -} - -// GetStatusMessage returns the StatusMessage field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *Run) GetStatusMessage() string { - if o == nil || IsNil(o.StatusMessage.Get()) { - var ret string - return ret - } - return *o.StatusMessage.Get() -} - -// GetStatusMessageOk returns a tuple with the StatusMessage field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *Run) GetStatusMessageOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.StatusMessage.Get(), o.StatusMessage.IsSet() -} - -// HasStatusMessage returns a boolean if a field has been set. -func (o *Run) HasStatusMessage() bool { - if o != nil && o.StatusMessage.IsSet() { - return true - } - - return false -} - -// SetStatusMessage gets a reference to the given NullableString and assigns it to the StatusMessage field. -func (o *Run) SetStatusMessage(v string) { - o.StatusMessage.Set(&v) -} -// SetStatusMessageNil sets the value for StatusMessage to be an explicit nil -func (o *Run) SetStatusMessageNil() { - o.StatusMessage.Set(nil) -} - -// UnsetStatusMessage ensures that no value is present for StatusMessage, not even an explicit nil -func (o *Run) UnsetStatusMessage() { - o.StatusMessage.Unset() -} - -// GetIsStatusMessageTerminal returns the IsStatusMessageTerminal field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *Run) GetIsStatusMessageTerminal() bool { - if o == nil || IsNil(o.IsStatusMessageTerminal.Get()) { - var ret bool - return ret - } - return *o.IsStatusMessageTerminal.Get() -} - -// GetIsStatusMessageTerminalOk returns a tuple with the IsStatusMessageTerminal field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *Run) GetIsStatusMessageTerminalOk() (*bool, bool) { - if o == nil { - return nil, false - } - return o.IsStatusMessageTerminal.Get(), o.IsStatusMessageTerminal.IsSet() -} - -// HasIsStatusMessageTerminal returns a boolean if a field has been set. -func (o *Run) HasIsStatusMessageTerminal() bool { - if o != nil && o.IsStatusMessageTerminal.IsSet() { - return true - } - - return false -} - -// SetIsStatusMessageTerminal gets a reference to the given NullableBool and assigns it to the IsStatusMessageTerminal field. -func (o *Run) SetIsStatusMessageTerminal(v bool) { - o.IsStatusMessageTerminal.Set(&v) -} -// SetIsStatusMessageTerminalNil sets the value for IsStatusMessageTerminal to be an explicit nil -func (o *Run) SetIsStatusMessageTerminalNil() { - o.IsStatusMessageTerminal.Set(nil) -} - -// UnsetIsStatusMessageTerminal ensures that no value is present for IsStatusMessageTerminal, not even an explicit nil -func (o *Run) UnsetIsStatusMessageTerminal() { - o.IsStatusMessageTerminal.Unset() -} - -// GetMeta returns the Meta field value -func (o *Run) GetMeta() RunMeta { - if o == nil { - var ret RunMeta - return ret - } - - return o.Meta -} - -// GetMetaOk returns a tuple with the Meta field value -// and a boolean to check if the value has been set. -func (o *Run) GetMetaOk() (*RunMeta, bool) { - if o == nil { - return nil, false - } - return &o.Meta, true -} - -// SetMeta sets field value -func (o *Run) SetMeta(v RunMeta) { - o.Meta = v -} - -// GetPricingInfo returns the PricingInfo field value if set, zero value otherwise. -func (o *Run) GetPricingInfo() ActorRunPricingInfo { - if o == nil || IsNil(o.PricingInfo) { - var ret ActorRunPricingInfo - return ret - } - return *o.PricingInfo -} - -// GetPricingInfoOk returns a tuple with the PricingInfo field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Run) GetPricingInfoOk() (*ActorRunPricingInfo, bool) { - if o == nil || IsNil(o.PricingInfo) { - return nil, false - } - return o.PricingInfo, true -} - -// HasPricingInfo returns a boolean if a field has been set. -func (o *Run) HasPricingInfo() bool { - if o != nil && !IsNil(o.PricingInfo) { - return true - } - - return false -} - -// SetPricingInfo gets a reference to the given ActorRunPricingInfo and assigns it to the PricingInfo field. -func (o *Run) SetPricingInfo(v ActorRunPricingInfo) { - o.PricingInfo = &v -} - -// GetStats returns the Stats field value -func (o *Run) GetStats() RunStats { - if o == nil { - var ret RunStats - return ret - } - - return o.Stats -} - -// GetStatsOk returns a tuple with the Stats field value -// and a boolean to check if the value has been set. -func (o *Run) GetStatsOk() (*RunStats, bool) { - if o == nil { - return nil, false - } - return &o.Stats, true -} - -// SetStats sets field value -func (o *Run) SetStats(v RunStats) { - o.Stats = v -} - -// GetChargedEventCounts returns the ChargedEventCounts field value if set, zero value otherwise. -func (o *Run) GetChargedEventCounts() map[string]int32 { - if o == nil || IsNil(o.ChargedEventCounts) { - var ret map[string]int32 - return ret - } - return o.ChargedEventCounts -} - -// GetChargedEventCountsOk returns a tuple with the ChargedEventCounts field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Run) GetChargedEventCountsOk() (map[string]int32, bool) { - if o == nil || IsNil(o.ChargedEventCounts) { - return map[string]int32{}, false - } - return o.ChargedEventCounts, true -} - -// HasChargedEventCounts returns a boolean if a field has been set. -func (o *Run) HasChargedEventCounts() bool { - if o != nil && !IsNil(o.ChargedEventCounts) { - return true - } - - return false -} - -// SetChargedEventCounts gets a reference to the given map[string]int32 and assigns it to the ChargedEventCounts field. -func (o *Run) SetChargedEventCounts(v map[string]int32) { - o.ChargedEventCounts = v -} - -// GetOptions returns the Options field value -func (o *Run) GetOptions() RunOptions { - if o == nil { - var ret RunOptions - return ret - } - - return o.Options -} - -// GetOptionsOk returns a tuple with the Options field value -// and a boolean to check if the value has been set. -func (o *Run) GetOptionsOk() (*RunOptions, bool) { - if o == nil { - return nil, false - } - return &o.Options, true -} - -// SetOptions sets field value -func (o *Run) SetOptions(v RunOptions) { - o.Options = v -} - -// GetBuildId returns the BuildId field value -func (o *Run) GetBuildId() string { - if o == nil { - var ret string - return ret - } - - return o.BuildId -} - -// GetBuildIdOk returns a tuple with the BuildId field value -// and a boolean to check if the value has been set. -func (o *Run) GetBuildIdOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.BuildId, true -} - -// SetBuildId sets field value -func (o *Run) SetBuildId(v string) { - o.BuildId = v -} - -// GetExitCode returns the ExitCode field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *Run) GetExitCode() int32 { - if o == nil || IsNil(o.ExitCode.Get()) { - var ret int32 - return ret - } - return *o.ExitCode.Get() -} - -// GetExitCodeOk returns a tuple with the ExitCode field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *Run) GetExitCodeOk() (*int32, bool) { - if o == nil { - return nil, false - } - return o.ExitCode.Get(), o.ExitCode.IsSet() -} - -// HasExitCode returns a boolean if a field has been set. -func (o *Run) HasExitCode() bool { - if o != nil && o.ExitCode.IsSet() { - return true - } - - return false -} - -// SetExitCode gets a reference to the given NullableInt32 and assigns it to the ExitCode field. -func (o *Run) SetExitCode(v int32) { - o.ExitCode.Set(&v) -} -// SetExitCodeNil sets the value for ExitCode to be an explicit nil -func (o *Run) SetExitCodeNil() { - o.ExitCode.Set(nil) -} - -// UnsetExitCode ensures that no value is present for ExitCode, not even an explicit nil -func (o *Run) UnsetExitCode() { - o.ExitCode.Unset() -} - -// GetGeneralAccess returns the GeneralAccess field value -func (o *Run) GetGeneralAccess() GeneralAccess { - if o == nil { - var ret GeneralAccess - return ret - } - - return o.GeneralAccess -} - -// GetGeneralAccessOk returns a tuple with the GeneralAccess field value -// and a boolean to check if the value has been set. -func (o *Run) GetGeneralAccessOk() (*GeneralAccess, bool) { - if o == nil { - return nil, false - } - return &o.GeneralAccess, true -} - -// SetGeneralAccess sets field value -func (o *Run) SetGeneralAccess(v GeneralAccess) { - o.GeneralAccess = v -} - -// GetDefaultKeyValueStoreId returns the DefaultKeyValueStoreId field value -func (o *Run) GetDefaultKeyValueStoreId() string { - if o == nil { - var ret string - return ret - } - - return o.DefaultKeyValueStoreId -} - -// GetDefaultKeyValueStoreIdOk returns a tuple with the DefaultKeyValueStoreId field value -// and a boolean to check if the value has been set. -func (o *Run) GetDefaultKeyValueStoreIdOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.DefaultKeyValueStoreId, true -} - -// SetDefaultKeyValueStoreId sets field value -func (o *Run) SetDefaultKeyValueStoreId(v string) { - o.DefaultKeyValueStoreId = v -} - -// GetDefaultDatasetId returns the DefaultDatasetId field value -func (o *Run) GetDefaultDatasetId() string { - if o == nil { - var ret string - return ret - } - - return o.DefaultDatasetId -} - -// GetDefaultDatasetIdOk returns a tuple with the DefaultDatasetId field value -// and a boolean to check if the value has been set. -func (o *Run) GetDefaultDatasetIdOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.DefaultDatasetId, true -} - -// SetDefaultDatasetId sets field value -func (o *Run) SetDefaultDatasetId(v string) { - o.DefaultDatasetId = v -} - -// GetDefaultRequestQueueId returns the DefaultRequestQueueId field value -func (o *Run) GetDefaultRequestQueueId() string { - if o == nil { - var ret string - return ret - } - - return o.DefaultRequestQueueId -} - -// GetDefaultRequestQueueIdOk returns a tuple with the DefaultRequestQueueId field value -// and a boolean to check if the value has been set. -func (o *Run) GetDefaultRequestQueueIdOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.DefaultRequestQueueId, true -} - -// SetDefaultRequestQueueId sets field value -func (o *Run) SetDefaultRequestQueueId(v string) { - o.DefaultRequestQueueId = v -} - -// GetStorageIds returns the StorageIds field value if set, zero value otherwise. -func (o *Run) GetStorageIds() RunStorageIds { - if o == nil || IsNil(o.StorageIds) { - var ret RunStorageIds - return ret - } - return *o.StorageIds -} - -// GetStorageIdsOk returns a tuple with the StorageIds field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Run) GetStorageIdsOk() (*RunStorageIds, bool) { - if o == nil || IsNil(o.StorageIds) { - return nil, false - } - return o.StorageIds, true -} - -// HasStorageIds returns a boolean if a field has been set. -func (o *Run) HasStorageIds() bool { - if o != nil && !IsNil(o.StorageIds) { - return true - } - - return false -} - -// SetStorageIds gets a reference to the given RunStorageIds and assigns it to the StorageIds field. -func (o *Run) SetStorageIds(v RunStorageIds) { - o.StorageIds = &v -} - -// GetBuildNumber returns the BuildNumber field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *Run) GetBuildNumber() string { - if o == nil || IsNil(o.BuildNumber.Get()) { - var ret string - return ret - } - return *o.BuildNumber.Get() -} - -// GetBuildNumberOk returns a tuple with the BuildNumber field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *Run) GetBuildNumberOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.BuildNumber.Get(), o.BuildNumber.IsSet() -} - -// HasBuildNumber returns a boolean if a field has been set. -func (o *Run) HasBuildNumber() bool { - if o != nil && o.BuildNumber.IsSet() { - return true - } - - return false -} - -// SetBuildNumber gets a reference to the given NullableString and assigns it to the BuildNumber field. -func (o *Run) SetBuildNumber(v string) { - o.BuildNumber.Set(&v) -} -// SetBuildNumberNil sets the value for BuildNumber to be an explicit nil -func (o *Run) SetBuildNumberNil() { - o.BuildNumber.Set(nil) -} - -// UnsetBuildNumber ensures that no value is present for BuildNumber, not even an explicit nil -func (o *Run) UnsetBuildNumber() { - o.BuildNumber.Unset() -} - -// GetContainerUrl returns the ContainerUrl field value if set, zero value otherwise. -func (o *Run) GetContainerUrl() string { - if o == nil || IsNil(o.ContainerUrl) { - var ret string - return ret - } - return *o.ContainerUrl -} - -// GetContainerUrlOk returns a tuple with the ContainerUrl field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Run) GetContainerUrlOk() (*string, bool) { - if o == nil || IsNil(o.ContainerUrl) { - return nil, false - } - return o.ContainerUrl, true -} - -// HasContainerUrl returns a boolean if a field has been set. -func (o *Run) HasContainerUrl() bool { - if o != nil && !IsNil(o.ContainerUrl) { - return true - } - - return false -} - -// SetContainerUrl gets a reference to the given string and assigns it to the ContainerUrl field. -func (o *Run) SetContainerUrl(v string) { - o.ContainerUrl = &v -} - -// GetIsContainerServerReady returns the IsContainerServerReady field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *Run) GetIsContainerServerReady() bool { - if o == nil || IsNil(o.IsContainerServerReady.Get()) { - var ret bool - return ret - } - return *o.IsContainerServerReady.Get() -} - -// GetIsContainerServerReadyOk returns a tuple with the IsContainerServerReady field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *Run) GetIsContainerServerReadyOk() (*bool, bool) { - if o == nil { - return nil, false - } - return o.IsContainerServerReady.Get(), o.IsContainerServerReady.IsSet() -} - -// HasIsContainerServerReady returns a boolean if a field has been set. -func (o *Run) HasIsContainerServerReady() bool { - if o != nil && o.IsContainerServerReady.IsSet() { - return true - } - - return false -} - -// SetIsContainerServerReady gets a reference to the given NullableBool and assigns it to the IsContainerServerReady field. -func (o *Run) SetIsContainerServerReady(v bool) { - o.IsContainerServerReady.Set(&v) -} -// SetIsContainerServerReadyNil sets the value for IsContainerServerReady to be an explicit nil -func (o *Run) SetIsContainerServerReadyNil() { - o.IsContainerServerReady.Set(nil) -} - -// UnsetIsContainerServerReady ensures that no value is present for IsContainerServerReady, not even an explicit nil -func (o *Run) UnsetIsContainerServerReady() { - o.IsContainerServerReady.Unset() -} - -// GetGitBranchName returns the GitBranchName field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *Run) GetGitBranchName() string { - if o == nil || IsNil(o.GitBranchName.Get()) { - var ret string - return ret - } - return *o.GitBranchName.Get() -} - -// GetGitBranchNameOk returns a tuple with the GitBranchName field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *Run) GetGitBranchNameOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.GitBranchName.Get(), o.GitBranchName.IsSet() -} - -// HasGitBranchName returns a boolean if a field has been set. -func (o *Run) HasGitBranchName() bool { - if o != nil && o.GitBranchName.IsSet() { - return true - } - - return false -} - -// SetGitBranchName gets a reference to the given NullableString and assigns it to the GitBranchName field. -func (o *Run) SetGitBranchName(v string) { - o.GitBranchName.Set(&v) -} -// SetGitBranchNameNil sets the value for GitBranchName to be an explicit nil -func (o *Run) SetGitBranchNameNil() { - o.GitBranchName.Set(nil) -} - -// UnsetGitBranchName ensures that no value is present for GitBranchName, not even an explicit nil -func (o *Run) UnsetGitBranchName() { - o.GitBranchName.Unset() -} - -// GetUsage returns the Usage field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *Run) GetUsage() RunUsage { - if o == nil || IsNil(o.Usage.Get()) { - var ret RunUsage - return ret - } - return *o.Usage.Get() -} - -// GetUsageOk returns a tuple with the Usage field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *Run) GetUsageOk() (*RunUsage, bool) { - if o == nil { - return nil, false - } - return o.Usage.Get(), o.Usage.IsSet() -} - -// HasUsage returns a boolean if a field has been set. -func (o *Run) HasUsage() bool { - if o != nil && o.Usage.IsSet() { - return true - } - - return false -} - -// SetUsage gets a reference to the given NullableRunUsage and assigns it to the Usage field. -func (o *Run) SetUsage(v RunUsage) { - o.Usage.Set(&v) -} -// SetUsageNil sets the value for Usage to be an explicit nil -func (o *Run) SetUsageNil() { - o.Usage.Set(nil) -} - -// UnsetUsage ensures that no value is present for Usage, not even an explicit nil -func (o *Run) UnsetUsage() { - o.Usage.Unset() -} - -// GetUsageTotalUsd returns the UsageTotalUsd field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *Run) GetUsageTotalUsd() float32 { - if o == nil || IsNil(o.UsageTotalUsd.Get()) { - var ret float32 - return ret - } - return *o.UsageTotalUsd.Get() -} - -// GetUsageTotalUsdOk returns a tuple with the UsageTotalUsd field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *Run) GetUsageTotalUsdOk() (*float32, bool) { - if o == nil { - return nil, false - } - return o.UsageTotalUsd.Get(), o.UsageTotalUsd.IsSet() -} - -// HasUsageTotalUsd returns a boolean if a field has been set. -func (o *Run) HasUsageTotalUsd() bool { - if o != nil && o.UsageTotalUsd.IsSet() { - return true - } - - return false -} - -// SetUsageTotalUsd gets a reference to the given NullableFloat32 and assigns it to the UsageTotalUsd field. -func (o *Run) SetUsageTotalUsd(v float32) { - o.UsageTotalUsd.Set(&v) -} -// SetUsageTotalUsdNil sets the value for UsageTotalUsd to be an explicit nil -func (o *Run) SetUsageTotalUsdNil() { - o.UsageTotalUsd.Set(nil) -} - -// UnsetUsageTotalUsd ensures that no value is present for UsageTotalUsd, not even an explicit nil -func (o *Run) UnsetUsageTotalUsd() { - o.UsageTotalUsd.Unset() -} - -// GetUsageUsd returns the UsageUsd field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *Run) GetUsageUsd() RunUsageUsd { - if o == nil || IsNil(o.UsageUsd.Get()) { - var ret RunUsageUsd - return ret - } - return *o.UsageUsd.Get() -} - -// GetUsageUsdOk returns a tuple with the UsageUsd field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *Run) GetUsageUsdOk() (*RunUsageUsd, bool) { - if o == nil { - return nil, false - } - return o.UsageUsd.Get(), o.UsageUsd.IsSet() -} - -// HasUsageUsd returns a boolean if a field has been set. -func (o *Run) HasUsageUsd() bool { - if o != nil && o.UsageUsd.IsSet() { - return true - } - - return false -} - -// SetUsageUsd gets a reference to the given NullableRunUsageUsd and assigns it to the UsageUsd field. -func (o *Run) SetUsageUsd(v RunUsageUsd) { - o.UsageUsd.Set(&v) -} -// SetUsageUsdNil sets the value for UsageUsd to be an explicit nil -func (o *Run) SetUsageUsdNil() { - o.UsageUsd.Set(nil) -} - -// UnsetUsageUsd ensures that no value is present for UsageUsd, not even an explicit nil -func (o *Run) UnsetUsageUsd() { - o.UsageUsd.Unset() -} - -// GetMetamorphs returns the Metamorphs field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *Run) GetMetamorphs() []Metamorph { - if o == nil { - var ret []Metamorph - return ret - } - return o.Metamorphs -} - -// GetMetamorphsOk returns a tuple with the Metamorphs field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *Run) GetMetamorphsOk() ([]Metamorph, bool) { - if o == nil || IsNil(o.Metamorphs) { - return nil, false - } - return o.Metamorphs, true -} - -// HasMetamorphs returns a boolean if a field has been set. -func (o *Run) HasMetamorphs() bool { - if o != nil && !IsNil(o.Metamorphs) { - return true - } - - return false -} - -// SetMetamorphs gets a reference to the given []Metamorph and assigns it to the Metamorphs field. -func (o *Run) SetMetamorphs(v []Metamorph) { - o.Metamorphs = v -} - -// GetPlatformUsageBillingModel returns the PlatformUsageBillingModel field value if set, zero value otherwise. -func (o *Run) GetPlatformUsageBillingModel() string { - if o == nil || IsNil(o.PlatformUsageBillingModel) { - var ret string - return ret - } - return *o.PlatformUsageBillingModel -} - -// GetPlatformUsageBillingModelOk returns a tuple with the PlatformUsageBillingModel field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Run) GetPlatformUsageBillingModelOk() (*string, bool) { - if o == nil || IsNil(o.PlatformUsageBillingModel) { - return nil, false - } - return o.PlatformUsageBillingModel, true -} - -// HasPlatformUsageBillingModel returns a boolean if a field has been set. -func (o *Run) HasPlatformUsageBillingModel() bool { - if o != nil && !IsNil(o.PlatformUsageBillingModel) { - return true - } - - return false -} - -// SetPlatformUsageBillingModel gets a reference to the given string and assigns it to the PlatformUsageBillingModel field. -func (o *Run) SetPlatformUsageBillingModel(v string) { - o.PlatformUsageBillingModel = &v -} - -func (o Run) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o Run) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["id"] = o.Id - toSerialize["actId"] = o.ActId - toSerialize["userId"] = o.UserId - if o.ActorTaskId.IsSet() { - toSerialize["actorTaskId"] = o.ActorTaskId.Get() - } - toSerialize["startedAt"] = o.StartedAt - if o.FinishedAt.IsSet() { - toSerialize["finishedAt"] = o.FinishedAt.Get() - } - toSerialize["status"] = o.Status - if o.StatusMessage.IsSet() { - toSerialize["statusMessage"] = o.StatusMessage.Get() - } - if o.IsStatusMessageTerminal.IsSet() { - toSerialize["isStatusMessageTerminal"] = o.IsStatusMessageTerminal.Get() - } - toSerialize["meta"] = o.Meta - if !IsNil(o.PricingInfo) { - toSerialize["pricingInfo"] = o.PricingInfo - } - toSerialize["stats"] = o.Stats - if !IsNil(o.ChargedEventCounts) { - toSerialize["chargedEventCounts"] = o.ChargedEventCounts - } - toSerialize["options"] = o.Options - toSerialize["buildId"] = o.BuildId - if o.ExitCode.IsSet() { - toSerialize["exitCode"] = o.ExitCode.Get() - } - toSerialize["generalAccess"] = o.GeneralAccess - toSerialize["defaultKeyValueStoreId"] = o.DefaultKeyValueStoreId - toSerialize["defaultDatasetId"] = o.DefaultDatasetId - toSerialize["defaultRequestQueueId"] = o.DefaultRequestQueueId - if !IsNil(o.StorageIds) { - toSerialize["storageIds"] = o.StorageIds - } - if o.BuildNumber.IsSet() { - toSerialize["buildNumber"] = o.BuildNumber.Get() - } - if !IsNil(o.ContainerUrl) { - toSerialize["containerUrl"] = o.ContainerUrl - } - if o.IsContainerServerReady.IsSet() { - toSerialize["isContainerServerReady"] = o.IsContainerServerReady.Get() - } - if o.GitBranchName.IsSet() { - toSerialize["gitBranchName"] = o.GitBranchName.Get() - } - if o.Usage.IsSet() { - toSerialize["usage"] = o.Usage.Get() - } - if o.UsageTotalUsd.IsSet() { - toSerialize["usageTotalUsd"] = o.UsageTotalUsd.Get() - } - if o.UsageUsd.IsSet() { - toSerialize["usageUsd"] = o.UsageUsd.Get() - } - if o.Metamorphs != nil { - toSerialize["metamorphs"] = o.Metamorphs - } - if !IsNil(o.PlatformUsageBillingModel) { - toSerialize["platformUsageBillingModel"] = o.PlatformUsageBillingModel - } - return toSerialize, nil -} - -func (o *Run) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "id", - "actId", - "userId", - "startedAt", - "status", - "meta", - "stats", - "options", - "buildId", - "generalAccess", - "defaultKeyValueStoreId", - "defaultDatasetId", - "defaultRequestQueueId", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err; - } - - for _, requiredProperty := range(requiredProperties) { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varRun := _Run{} - - decoder := json.NewDecoder(bytes.NewReader(data)) - decoder.DisallowUnknownFields() - err = decoder.Decode(&varRun) - - if err != nil { - return err - } - - *o = Run(varRun) - - return err -} - -type NullableRun struct { - value *Run - isSet bool -} - -func (v NullableRun) Get() *Run { - return v.value -} - -func (v *NullableRun) Set(val *Run) { - v.value = val - v.isSet = true -} - -func (v NullableRun) IsSet() bool { - return v.isSet -} - -func (v *NullableRun) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableRun(val *Run) *NullableRun { - return &NullableRun{value: val, isSet: true} -} - -func (v NullableRun) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableRun) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_run_failed_error_detail.go b/model_run_failed_error_detail.go deleted file mode 100644 index dd97fbb..0000000 --- a/model_run_failed_error_detail.go +++ /dev/null @@ -1,164 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" -) - -// checks if the RunFailedErrorDetail type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &RunFailedErrorDetail{} - -// RunFailedErrorDetail struct for RunFailedErrorDetail -type RunFailedErrorDetail struct { - Type interface{} `json:"type,omitempty"` - // Human-readable error message describing what went wrong. - Message *string `json:"message,omitempty"` -} - -// NewRunFailedErrorDetail instantiates a new RunFailedErrorDetail object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewRunFailedErrorDetail() *RunFailedErrorDetail { - this := RunFailedErrorDetail{} - return &this -} - -// NewRunFailedErrorDetailWithDefaults instantiates a new RunFailedErrorDetail object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewRunFailedErrorDetailWithDefaults() *RunFailedErrorDetail { - this := RunFailedErrorDetail{} - return &this -} - -// GetType returns the Type field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *RunFailedErrorDetail) GetType() interface{} { - if o == nil { - var ret interface{} - return ret - } - return o.Type -} - -// GetTypeOk returns a tuple with the Type field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *RunFailedErrorDetail) GetTypeOk() (*interface{}, bool) { - if o == nil || IsNil(o.Type) { - return nil, false - } - return &o.Type, true -} - -// HasType returns a boolean if a field has been set. -func (o *RunFailedErrorDetail) HasType() bool { - if o != nil && !IsNil(o.Type) { - return true - } - - return false -} - -// SetType gets a reference to the given interface{} and assigns it to the Type field. -func (o *RunFailedErrorDetail) SetType(v interface{}) { - o.Type = v -} - -// GetMessage returns the Message field value if set, zero value otherwise. -func (o *RunFailedErrorDetail) GetMessage() string { - if o == nil || IsNil(o.Message) { - var ret string - return ret - } - return *o.Message -} - -// GetMessageOk returns a tuple with the Message field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *RunFailedErrorDetail) GetMessageOk() (*string, bool) { - if o == nil || IsNil(o.Message) { - return nil, false - } - return o.Message, true -} - -// HasMessage returns a boolean if a field has been set. -func (o *RunFailedErrorDetail) HasMessage() bool { - if o != nil && !IsNil(o.Message) { - return true - } - - return false -} - -// SetMessage gets a reference to the given string and assigns it to the Message field. -func (o *RunFailedErrorDetail) SetMessage(v string) { - o.Message = &v -} - -func (o RunFailedErrorDetail) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o RunFailedErrorDetail) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if o.Type != nil { - toSerialize["type"] = o.Type - } - if !IsNil(o.Message) { - toSerialize["message"] = o.Message - } - return toSerialize, nil -} - -type NullableRunFailedErrorDetail struct { - value *RunFailedErrorDetail - isSet bool -} - -func (v NullableRunFailedErrorDetail) Get() *RunFailedErrorDetail { - return v.value -} - -func (v *NullableRunFailedErrorDetail) Set(val *RunFailedErrorDetail) { - v.value = val - v.isSet = true -} - -func (v NullableRunFailedErrorDetail) IsSet() bool { - return v.isSet -} - -func (v *NullableRunFailedErrorDetail) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableRunFailedErrorDetail(val *RunFailedErrorDetail) *NullableRunFailedErrorDetail { - return &NullableRunFailedErrorDetail{value: val, isSet: true} -} - -func (v NullableRunFailedErrorDetail) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableRunFailedErrorDetail) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_run_meta.go b/model_run_meta.go deleted file mode 100644 index 53602b8..0000000 --- a/model_run_meta.go +++ /dev/null @@ -1,347 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" - "time" - "bytes" - "fmt" -) - -// checks if the RunMeta type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &RunMeta{} - -// RunMeta struct for RunMeta -type RunMeta struct { - Origin RunOrigin `json:"origin"` - // IP address of the client that started the run. - ClientIp NullableString `json:"clientIp,omitempty"` - // User agent of the client that started the run. - UserAgent NullableString `json:"userAgent,omitempty"` - // ID of the schedule that triggered the run. - ScheduleId NullableString `json:"scheduleId,omitempty"` - // Time when the run was scheduled. - ScheduledAt NullableTime `json:"scheduledAt,omitempty"` -} - -type _RunMeta RunMeta - -// NewRunMeta instantiates a new RunMeta object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewRunMeta(origin RunOrigin) *RunMeta { - this := RunMeta{} - this.Origin = origin - return &this -} - -// NewRunMetaWithDefaults instantiates a new RunMeta object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewRunMetaWithDefaults() *RunMeta { - this := RunMeta{} - return &this -} - -// GetOrigin returns the Origin field value -func (o *RunMeta) GetOrigin() RunOrigin { - if o == nil { - var ret RunOrigin - return ret - } - - return o.Origin -} - -// GetOriginOk returns a tuple with the Origin field value -// and a boolean to check if the value has been set. -func (o *RunMeta) GetOriginOk() (*RunOrigin, bool) { - if o == nil { - return nil, false - } - return &o.Origin, true -} - -// SetOrigin sets field value -func (o *RunMeta) SetOrigin(v RunOrigin) { - o.Origin = v -} - -// GetClientIp returns the ClientIp field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *RunMeta) GetClientIp() string { - if o == nil || IsNil(o.ClientIp.Get()) { - var ret string - return ret - } - return *o.ClientIp.Get() -} - -// GetClientIpOk returns a tuple with the ClientIp field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *RunMeta) GetClientIpOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.ClientIp.Get(), o.ClientIp.IsSet() -} - -// HasClientIp returns a boolean if a field has been set. -func (o *RunMeta) HasClientIp() bool { - if o != nil && o.ClientIp.IsSet() { - return true - } - - return false -} - -// SetClientIp gets a reference to the given NullableString and assigns it to the ClientIp field. -func (o *RunMeta) SetClientIp(v string) { - o.ClientIp.Set(&v) -} -// SetClientIpNil sets the value for ClientIp to be an explicit nil -func (o *RunMeta) SetClientIpNil() { - o.ClientIp.Set(nil) -} - -// UnsetClientIp ensures that no value is present for ClientIp, not even an explicit nil -func (o *RunMeta) UnsetClientIp() { - o.ClientIp.Unset() -} - -// GetUserAgent returns the UserAgent field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *RunMeta) GetUserAgent() string { - if o == nil || IsNil(o.UserAgent.Get()) { - var ret string - return ret - } - return *o.UserAgent.Get() -} - -// GetUserAgentOk returns a tuple with the UserAgent field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *RunMeta) GetUserAgentOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.UserAgent.Get(), o.UserAgent.IsSet() -} - -// HasUserAgent returns a boolean if a field has been set. -func (o *RunMeta) HasUserAgent() bool { - if o != nil && o.UserAgent.IsSet() { - return true - } - - return false -} - -// SetUserAgent gets a reference to the given NullableString and assigns it to the UserAgent field. -func (o *RunMeta) SetUserAgent(v string) { - o.UserAgent.Set(&v) -} -// SetUserAgentNil sets the value for UserAgent to be an explicit nil -func (o *RunMeta) SetUserAgentNil() { - o.UserAgent.Set(nil) -} - -// UnsetUserAgent ensures that no value is present for UserAgent, not even an explicit nil -func (o *RunMeta) UnsetUserAgent() { - o.UserAgent.Unset() -} - -// GetScheduleId returns the ScheduleId field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *RunMeta) GetScheduleId() string { - if o == nil || IsNil(o.ScheduleId.Get()) { - var ret string - return ret - } - return *o.ScheduleId.Get() -} - -// GetScheduleIdOk returns a tuple with the ScheduleId field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *RunMeta) GetScheduleIdOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.ScheduleId.Get(), o.ScheduleId.IsSet() -} - -// HasScheduleId returns a boolean if a field has been set. -func (o *RunMeta) HasScheduleId() bool { - if o != nil && o.ScheduleId.IsSet() { - return true - } - - return false -} - -// SetScheduleId gets a reference to the given NullableString and assigns it to the ScheduleId field. -func (o *RunMeta) SetScheduleId(v string) { - o.ScheduleId.Set(&v) -} -// SetScheduleIdNil sets the value for ScheduleId to be an explicit nil -func (o *RunMeta) SetScheduleIdNil() { - o.ScheduleId.Set(nil) -} - -// UnsetScheduleId ensures that no value is present for ScheduleId, not even an explicit nil -func (o *RunMeta) UnsetScheduleId() { - o.ScheduleId.Unset() -} - -// GetScheduledAt returns the ScheduledAt field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *RunMeta) GetScheduledAt() time.Time { - if o == nil || IsNil(o.ScheduledAt.Get()) { - var ret time.Time - return ret - } - return *o.ScheduledAt.Get() -} - -// GetScheduledAtOk returns a tuple with the ScheduledAt field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *RunMeta) GetScheduledAtOk() (*time.Time, bool) { - if o == nil { - return nil, false - } - return o.ScheduledAt.Get(), o.ScheduledAt.IsSet() -} - -// HasScheduledAt returns a boolean if a field has been set. -func (o *RunMeta) HasScheduledAt() bool { - if o != nil && o.ScheduledAt.IsSet() { - return true - } - - return false -} - -// SetScheduledAt gets a reference to the given NullableTime and assigns it to the ScheduledAt field. -func (o *RunMeta) SetScheduledAt(v time.Time) { - o.ScheduledAt.Set(&v) -} -// SetScheduledAtNil sets the value for ScheduledAt to be an explicit nil -func (o *RunMeta) SetScheduledAtNil() { - o.ScheduledAt.Set(nil) -} - -// UnsetScheduledAt ensures that no value is present for ScheduledAt, not even an explicit nil -func (o *RunMeta) UnsetScheduledAt() { - o.ScheduledAt.Unset() -} - -func (o RunMeta) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o RunMeta) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["origin"] = o.Origin - if o.ClientIp.IsSet() { - toSerialize["clientIp"] = o.ClientIp.Get() - } - if o.UserAgent.IsSet() { - toSerialize["userAgent"] = o.UserAgent.Get() - } - if o.ScheduleId.IsSet() { - toSerialize["scheduleId"] = o.ScheduleId.Get() - } - if o.ScheduledAt.IsSet() { - toSerialize["scheduledAt"] = o.ScheduledAt.Get() - } - return toSerialize, nil -} - -func (o *RunMeta) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "origin", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err; - } - - for _, requiredProperty := range(requiredProperties) { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varRunMeta := _RunMeta{} - - decoder := json.NewDecoder(bytes.NewReader(data)) - decoder.DisallowUnknownFields() - err = decoder.Decode(&varRunMeta) - - if err != nil { - return err - } - - *o = RunMeta(varRunMeta) - - return err -} - -type NullableRunMeta struct { - value *RunMeta - isSet bool -} - -func (v NullableRunMeta) Get() *RunMeta { - return v.value -} - -func (v *NullableRunMeta) Set(val *RunMeta) { - v.value = val - v.isSet = true -} - -func (v NullableRunMeta) IsSet() bool { - return v.isSet -} - -func (v *NullableRunMeta) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableRunMeta(val *RunMeta) *NullableRunMeta { - return &NullableRunMeta{value: val, isSet: true} -} - -func (v NullableRunMeta) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableRunMeta) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_run_options.go b/model_run_options.go deleted file mode 100644 index aa0d4aa..0000000 --- a/model_run_options.go +++ /dev/null @@ -1,324 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" - "bytes" - "fmt" -) - -// checks if the RunOptions type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &RunOptions{} - -// RunOptions struct for RunOptions -type RunOptions struct { - Build string `json:"build"` - TimeoutSecs int32 `json:"timeoutSecs"` - MemoryMbytes int32 `json:"memoryMbytes"` - DiskMbytes int32 `json:"diskMbytes"` - MaxItems NullableInt32 `json:"maxItems,omitempty"` - MaxTotalChargeUsd *float32 `json:"maxTotalChargeUsd,omitempty"` -} - -type _RunOptions RunOptions - -// NewRunOptions instantiates a new RunOptions object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewRunOptions(build string, timeoutSecs int32, memoryMbytes int32, diskMbytes int32) *RunOptions { - this := RunOptions{} - this.Build = build - this.TimeoutSecs = timeoutSecs - this.MemoryMbytes = memoryMbytes - this.DiskMbytes = diskMbytes - return &this -} - -// NewRunOptionsWithDefaults instantiates a new RunOptions object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewRunOptionsWithDefaults() *RunOptions { - this := RunOptions{} - return &this -} - -// GetBuild returns the Build field value -func (o *RunOptions) GetBuild() string { - if o == nil { - var ret string - return ret - } - - return o.Build -} - -// GetBuildOk returns a tuple with the Build field value -// and a boolean to check if the value has been set. -func (o *RunOptions) GetBuildOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Build, true -} - -// SetBuild sets field value -func (o *RunOptions) SetBuild(v string) { - o.Build = v -} - -// GetTimeoutSecs returns the TimeoutSecs field value -func (o *RunOptions) GetTimeoutSecs() int32 { - if o == nil { - var ret int32 - return ret - } - - return o.TimeoutSecs -} - -// GetTimeoutSecsOk returns a tuple with the TimeoutSecs field value -// and a boolean to check if the value has been set. -func (o *RunOptions) GetTimeoutSecsOk() (*int32, bool) { - if o == nil { - return nil, false - } - return &o.TimeoutSecs, true -} - -// SetTimeoutSecs sets field value -func (o *RunOptions) SetTimeoutSecs(v int32) { - o.TimeoutSecs = v -} - -// GetMemoryMbytes returns the MemoryMbytes field value -func (o *RunOptions) GetMemoryMbytes() int32 { - if o == nil { - var ret int32 - return ret - } - - return o.MemoryMbytes -} - -// GetMemoryMbytesOk returns a tuple with the MemoryMbytes field value -// and a boolean to check if the value has been set. -func (o *RunOptions) GetMemoryMbytesOk() (*int32, bool) { - if o == nil { - return nil, false - } - return &o.MemoryMbytes, true -} - -// SetMemoryMbytes sets field value -func (o *RunOptions) SetMemoryMbytes(v int32) { - o.MemoryMbytes = v -} - -// GetDiskMbytes returns the DiskMbytes field value -func (o *RunOptions) GetDiskMbytes() int32 { - if o == nil { - var ret int32 - return ret - } - - return o.DiskMbytes -} - -// GetDiskMbytesOk returns a tuple with the DiskMbytes field value -// and a boolean to check if the value has been set. -func (o *RunOptions) GetDiskMbytesOk() (*int32, bool) { - if o == nil { - return nil, false - } - return &o.DiskMbytes, true -} - -// SetDiskMbytes sets field value -func (o *RunOptions) SetDiskMbytes(v int32) { - o.DiskMbytes = v -} - -// GetMaxItems returns the MaxItems field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *RunOptions) GetMaxItems() int32 { - if o == nil || IsNil(o.MaxItems.Get()) { - var ret int32 - return ret - } - return *o.MaxItems.Get() -} - -// GetMaxItemsOk returns a tuple with the MaxItems field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *RunOptions) GetMaxItemsOk() (*int32, bool) { - if o == nil { - return nil, false - } - return o.MaxItems.Get(), o.MaxItems.IsSet() -} - -// HasMaxItems returns a boolean if a field has been set. -func (o *RunOptions) HasMaxItems() bool { - if o != nil && o.MaxItems.IsSet() { - return true - } - - return false -} - -// SetMaxItems gets a reference to the given NullableInt32 and assigns it to the MaxItems field. -func (o *RunOptions) SetMaxItems(v int32) { - o.MaxItems.Set(&v) -} -// SetMaxItemsNil sets the value for MaxItems to be an explicit nil -func (o *RunOptions) SetMaxItemsNil() { - o.MaxItems.Set(nil) -} - -// UnsetMaxItems ensures that no value is present for MaxItems, not even an explicit nil -func (o *RunOptions) UnsetMaxItems() { - o.MaxItems.Unset() -} - -// GetMaxTotalChargeUsd returns the MaxTotalChargeUsd field value if set, zero value otherwise. -func (o *RunOptions) GetMaxTotalChargeUsd() float32 { - if o == nil || IsNil(o.MaxTotalChargeUsd) { - var ret float32 - return ret - } - return *o.MaxTotalChargeUsd -} - -// GetMaxTotalChargeUsdOk returns a tuple with the MaxTotalChargeUsd field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *RunOptions) GetMaxTotalChargeUsdOk() (*float32, bool) { - if o == nil || IsNil(o.MaxTotalChargeUsd) { - return nil, false - } - return o.MaxTotalChargeUsd, true -} - -// HasMaxTotalChargeUsd returns a boolean if a field has been set. -func (o *RunOptions) HasMaxTotalChargeUsd() bool { - if o != nil && !IsNil(o.MaxTotalChargeUsd) { - return true - } - - return false -} - -// SetMaxTotalChargeUsd gets a reference to the given float32 and assigns it to the MaxTotalChargeUsd field. -func (o *RunOptions) SetMaxTotalChargeUsd(v float32) { - o.MaxTotalChargeUsd = &v -} - -func (o RunOptions) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o RunOptions) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["build"] = o.Build - toSerialize["timeoutSecs"] = o.TimeoutSecs - toSerialize["memoryMbytes"] = o.MemoryMbytes - toSerialize["diskMbytes"] = o.DiskMbytes - if o.MaxItems.IsSet() { - toSerialize["maxItems"] = o.MaxItems.Get() - } - if !IsNil(o.MaxTotalChargeUsd) { - toSerialize["maxTotalChargeUsd"] = o.MaxTotalChargeUsd - } - return toSerialize, nil -} - -func (o *RunOptions) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "build", - "timeoutSecs", - "memoryMbytes", - "diskMbytes", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err; - } - - for _, requiredProperty := range(requiredProperties) { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varRunOptions := _RunOptions{} - - decoder := json.NewDecoder(bytes.NewReader(data)) - decoder.DisallowUnknownFields() - err = decoder.Decode(&varRunOptions) - - if err != nil { - return err - } - - *o = RunOptions(varRunOptions) - - return err -} - -type NullableRunOptions struct { - value *RunOptions - isSet bool -} - -func (v NullableRunOptions) Get() *RunOptions { - return v.value -} - -func (v *NullableRunOptions) Set(val *RunOptions) { - v.value = val - v.isSet = true -} - -func (v NullableRunOptions) IsSet() bool { - return v.isSet -} - -func (v *NullableRunOptions) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableRunOptions(val *RunOptions) *NullableRunOptions { - return &NullableRunOptions{value: val, isSet: true} -} - -func (v NullableRunOptions) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableRunOptions) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_run_origin.go b/model_run_origin.go deleted file mode 100644 index 3d3b790..0000000 --- a/model_run_origin.go +++ /dev/null @@ -1,127 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" - "fmt" -) - -// RunOrigin the model 'RunOrigin' -type RunOrigin string - -// List of RunOrigin -const ( - DEVELOPMENT RunOrigin = "DEVELOPMENT" - WEB RunOrigin = "WEB" - API RunOrigin = "API" - SCHEDULER RunOrigin = "SCHEDULER" - TEST RunOrigin = "TEST" - WEBHOOK RunOrigin = "WEBHOOK" - ACTOR RunOrigin = "ACTOR" - CLI RunOrigin = "CLI" - CI RunOrigin = "CI" - STANDBY RunOrigin = "STANDBY" -) - -// All allowed values of RunOrigin enum -var AllowedRunOriginEnumValues = []RunOrigin{ - "DEVELOPMENT", - "WEB", - "API", - "SCHEDULER", - "TEST", - "WEBHOOK", - "ACTOR", - "CLI", - "CI", - "STANDBY", -} - -func (v *RunOrigin) UnmarshalJSON(src []byte) error { - var value string - err := json.Unmarshal(src, &value) - if err != nil { - return err - } - enumTypeValue := RunOrigin(value) - for _, existing := range AllowedRunOriginEnumValues { - if existing == enumTypeValue { - *v = enumTypeValue - return nil - } - } - - return fmt.Errorf("%+v is not a valid RunOrigin", value) -} - -// NewRunOriginFromValue returns a pointer to a valid RunOrigin -// for the value passed as argument, or an error if the value passed is not allowed by the enum -func NewRunOriginFromValue(v string) (*RunOrigin, error) { - ev := RunOrigin(v) - if ev.IsValid() { - return &ev, nil - } else { - return nil, fmt.Errorf("invalid value '%v' for RunOrigin: valid values are %v", v, AllowedRunOriginEnumValues) - } -} - -// IsValid return true if the value is valid for the enum, false otherwise -func (v RunOrigin) IsValid() bool { - for _, existing := range AllowedRunOriginEnumValues { - if existing == v { - return true - } - } - return false -} - -// Ptr returns reference to RunOrigin value -func (v RunOrigin) Ptr() *RunOrigin { - return &v -} - -type NullableRunOrigin struct { - value *RunOrigin - isSet bool -} - -func (v NullableRunOrigin) Get() *RunOrigin { - return v.value -} - -func (v *NullableRunOrigin) Set(val *RunOrigin) { - v.value = val - v.isSet = true -} - -func (v NullableRunOrigin) IsSet() bool { - return v.isSet -} - -func (v *NullableRunOrigin) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableRunOrigin(val *RunOrigin) *NullableRunOrigin { - return &NullableRunOrigin{value: val, isSet: true} -} - -func (v NullableRunOrigin) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableRunOrigin) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - diff --git a/model_run_response.go b/model_run_response.go deleted file mode 100644 index 9414c0d..0000000 --- a/model_run_response.go +++ /dev/null @@ -1,158 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" - "bytes" - "fmt" -) - -// checks if the RunResponse type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &RunResponse{} - -// RunResponse struct for RunResponse -type RunResponse struct { - Data Run `json:"data"` -} - -type _RunResponse RunResponse - -// NewRunResponse instantiates a new RunResponse object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewRunResponse(data Run) *RunResponse { - this := RunResponse{} - this.Data = data - return &this -} - -// NewRunResponseWithDefaults instantiates a new RunResponse object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewRunResponseWithDefaults() *RunResponse { - this := RunResponse{} - return &this -} - -// GetData returns the Data field value -func (o *RunResponse) GetData() Run { - if o == nil { - var ret Run - return ret - } - - return o.Data -} - -// GetDataOk returns a tuple with the Data field value -// and a boolean to check if the value has been set. -func (o *RunResponse) GetDataOk() (*Run, bool) { - if o == nil { - return nil, false - } - return &o.Data, true -} - -// SetData sets field value -func (o *RunResponse) SetData(v Run) { - o.Data = v -} - -func (o RunResponse) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o RunResponse) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["data"] = o.Data - return toSerialize, nil -} - -func (o *RunResponse) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "data", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err; - } - - for _, requiredProperty := range(requiredProperties) { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varRunResponse := _RunResponse{} - - decoder := json.NewDecoder(bytes.NewReader(data)) - decoder.DisallowUnknownFields() - err = decoder.Decode(&varRunResponse) - - if err != nil { - return err - } - - *o = RunResponse(varRunResponse) - - return err -} - -type NullableRunResponse struct { - value *RunResponse - isSet bool -} - -func (v NullableRunResponse) Get() *RunResponse { - return v.value -} - -func (v *NullableRunResponse) Set(val *RunResponse) { - v.value = val - v.isSet = true -} - -func (v NullableRunResponse) IsSet() bool { - return v.isSet -} - -func (v *NullableRunResponse) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableRunResponse(val *RunResponse) *NullableRunResponse { - return &NullableRunResponse{value: val, isSet: true} -} - -func (v NullableRunResponse) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableRunResponse) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_run_short.go b/model_run_short.go deleted file mode 100644 index ee60fde..0000000 --- a/model_run_short.go +++ /dev/null @@ -1,611 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" - "time" - "bytes" - "fmt" -) - -// checks if the RunShort type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &RunShort{} - -// RunShort struct for RunShort -type RunShort struct { - Id string `json:"id"` - ActId string `json:"actId"` - UserId *string `json:"userId,omitempty"` - ActorTaskId NullableString `json:"actorTaskId,omitempty"` - Status ActorJobStatus `json:"status"` - StartedAt time.Time `json:"startedAt"` - FinishedAt NullableTime `json:"finishedAt,omitempty"` - BuildId string `json:"buildId"` - BuildNumber *string `json:"buildNumber,omitempty" validate:"regexp=^([0-9]|[1-9][0-9])\\\\.([0-9]|[1-9][0-9])(\\\\.[1-9][0-9]{0,4})$"` - BuildNumberInt *int32 `json:"buildNumberInt,omitempty"` - Meta RunMeta `json:"meta"` - UsageTotalUsd float32 `json:"usageTotalUsd"` - DefaultKeyValueStoreId string `json:"defaultKeyValueStoreId"` - DefaultDatasetId string `json:"defaultDatasetId"` - DefaultRequestQueueId string `json:"defaultRequestQueueId"` -} - -type _RunShort RunShort - -// NewRunShort instantiates a new RunShort object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewRunShort(id string, actId string, status ActorJobStatus, startedAt time.Time, buildId string, meta RunMeta, usageTotalUsd float32, defaultKeyValueStoreId string, defaultDatasetId string, defaultRequestQueueId string) *RunShort { - this := RunShort{} - this.Id = id - this.ActId = actId - this.Status = status - this.StartedAt = startedAt - this.BuildId = buildId - this.Meta = meta - this.UsageTotalUsd = usageTotalUsd - this.DefaultKeyValueStoreId = defaultKeyValueStoreId - this.DefaultDatasetId = defaultDatasetId - this.DefaultRequestQueueId = defaultRequestQueueId - return &this -} - -// NewRunShortWithDefaults instantiates a new RunShort object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewRunShortWithDefaults() *RunShort { - this := RunShort{} - return &this -} - -// GetId returns the Id field value -func (o *RunShort) GetId() string { - if o == nil { - var ret string - return ret - } - - return o.Id -} - -// GetIdOk returns a tuple with the Id field value -// and a boolean to check if the value has been set. -func (o *RunShort) GetIdOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Id, true -} - -// SetId sets field value -func (o *RunShort) SetId(v string) { - o.Id = v -} - -// GetActId returns the ActId field value -func (o *RunShort) GetActId() string { - if o == nil { - var ret string - return ret - } - - return o.ActId -} - -// GetActIdOk returns a tuple with the ActId field value -// and a boolean to check if the value has been set. -func (o *RunShort) GetActIdOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.ActId, true -} - -// SetActId sets field value -func (o *RunShort) SetActId(v string) { - o.ActId = v -} - -// GetUserId returns the UserId field value if set, zero value otherwise. -func (o *RunShort) GetUserId() string { - if o == nil || IsNil(o.UserId) { - var ret string - return ret - } - return *o.UserId -} - -// GetUserIdOk returns a tuple with the UserId field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *RunShort) GetUserIdOk() (*string, bool) { - if o == nil || IsNil(o.UserId) { - return nil, false - } - return o.UserId, true -} - -// HasUserId returns a boolean if a field has been set. -func (o *RunShort) HasUserId() bool { - if o != nil && !IsNil(o.UserId) { - return true - } - - return false -} - -// SetUserId gets a reference to the given string and assigns it to the UserId field. -func (o *RunShort) SetUserId(v string) { - o.UserId = &v -} - -// GetActorTaskId returns the ActorTaskId field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *RunShort) GetActorTaskId() string { - if o == nil || IsNil(o.ActorTaskId.Get()) { - var ret string - return ret - } - return *o.ActorTaskId.Get() -} - -// GetActorTaskIdOk returns a tuple with the ActorTaskId field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *RunShort) GetActorTaskIdOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.ActorTaskId.Get(), o.ActorTaskId.IsSet() -} - -// HasActorTaskId returns a boolean if a field has been set. -func (o *RunShort) HasActorTaskId() bool { - if o != nil && o.ActorTaskId.IsSet() { - return true - } - - return false -} - -// SetActorTaskId gets a reference to the given NullableString and assigns it to the ActorTaskId field. -func (o *RunShort) SetActorTaskId(v string) { - o.ActorTaskId.Set(&v) -} -// SetActorTaskIdNil sets the value for ActorTaskId to be an explicit nil -func (o *RunShort) SetActorTaskIdNil() { - o.ActorTaskId.Set(nil) -} - -// UnsetActorTaskId ensures that no value is present for ActorTaskId, not even an explicit nil -func (o *RunShort) UnsetActorTaskId() { - o.ActorTaskId.Unset() -} - -// GetStatus returns the Status field value -func (o *RunShort) GetStatus() ActorJobStatus { - if o == nil { - var ret ActorJobStatus - return ret - } - - return o.Status -} - -// GetStatusOk returns a tuple with the Status field value -// and a boolean to check if the value has been set. -func (o *RunShort) GetStatusOk() (*ActorJobStatus, bool) { - if o == nil { - return nil, false - } - return &o.Status, true -} - -// SetStatus sets field value -func (o *RunShort) SetStatus(v ActorJobStatus) { - o.Status = v -} - -// GetStartedAt returns the StartedAt field value -func (o *RunShort) GetStartedAt() time.Time { - if o == nil { - var ret time.Time - return ret - } - - return o.StartedAt -} - -// GetStartedAtOk returns a tuple with the StartedAt field value -// and a boolean to check if the value has been set. -func (o *RunShort) GetStartedAtOk() (*time.Time, bool) { - if o == nil { - return nil, false - } - return &o.StartedAt, true -} - -// SetStartedAt sets field value -func (o *RunShort) SetStartedAt(v time.Time) { - o.StartedAt = v -} - -// GetFinishedAt returns the FinishedAt field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *RunShort) GetFinishedAt() time.Time { - if o == nil || IsNil(o.FinishedAt.Get()) { - var ret time.Time - return ret - } - return *o.FinishedAt.Get() -} - -// GetFinishedAtOk returns a tuple with the FinishedAt field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *RunShort) GetFinishedAtOk() (*time.Time, bool) { - if o == nil { - return nil, false - } - return o.FinishedAt.Get(), o.FinishedAt.IsSet() -} - -// HasFinishedAt returns a boolean if a field has been set. -func (o *RunShort) HasFinishedAt() bool { - if o != nil && o.FinishedAt.IsSet() { - return true - } - - return false -} - -// SetFinishedAt gets a reference to the given NullableTime and assigns it to the FinishedAt field. -func (o *RunShort) SetFinishedAt(v time.Time) { - o.FinishedAt.Set(&v) -} -// SetFinishedAtNil sets the value for FinishedAt to be an explicit nil -func (o *RunShort) SetFinishedAtNil() { - o.FinishedAt.Set(nil) -} - -// UnsetFinishedAt ensures that no value is present for FinishedAt, not even an explicit nil -func (o *RunShort) UnsetFinishedAt() { - o.FinishedAt.Unset() -} - -// GetBuildId returns the BuildId field value -func (o *RunShort) GetBuildId() string { - if o == nil { - var ret string - return ret - } - - return o.BuildId -} - -// GetBuildIdOk returns a tuple with the BuildId field value -// and a boolean to check if the value has been set. -func (o *RunShort) GetBuildIdOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.BuildId, true -} - -// SetBuildId sets field value -func (o *RunShort) SetBuildId(v string) { - o.BuildId = v -} - -// GetBuildNumber returns the BuildNumber field value if set, zero value otherwise. -func (o *RunShort) GetBuildNumber() string { - if o == nil || IsNil(o.BuildNumber) { - var ret string - return ret - } - return *o.BuildNumber -} - -// GetBuildNumberOk returns a tuple with the BuildNumber field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *RunShort) GetBuildNumberOk() (*string, bool) { - if o == nil || IsNil(o.BuildNumber) { - return nil, false - } - return o.BuildNumber, true -} - -// HasBuildNumber returns a boolean if a field has been set. -func (o *RunShort) HasBuildNumber() bool { - if o != nil && !IsNil(o.BuildNumber) { - return true - } - - return false -} - -// SetBuildNumber gets a reference to the given string and assigns it to the BuildNumber field. -func (o *RunShort) SetBuildNumber(v string) { - o.BuildNumber = &v -} - -// GetBuildNumberInt returns the BuildNumberInt field value if set, zero value otherwise. -func (o *RunShort) GetBuildNumberInt() int32 { - if o == nil || IsNil(o.BuildNumberInt) { - var ret int32 - return ret - } - return *o.BuildNumberInt -} - -// GetBuildNumberIntOk returns a tuple with the BuildNumberInt field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *RunShort) GetBuildNumberIntOk() (*int32, bool) { - if o == nil || IsNil(o.BuildNumberInt) { - return nil, false - } - return o.BuildNumberInt, true -} - -// HasBuildNumberInt returns a boolean if a field has been set. -func (o *RunShort) HasBuildNumberInt() bool { - if o != nil && !IsNil(o.BuildNumberInt) { - return true - } - - return false -} - -// SetBuildNumberInt gets a reference to the given int32 and assigns it to the BuildNumberInt field. -func (o *RunShort) SetBuildNumberInt(v int32) { - o.BuildNumberInt = &v -} - -// GetMeta returns the Meta field value -func (o *RunShort) GetMeta() RunMeta { - if o == nil { - var ret RunMeta - return ret - } - - return o.Meta -} - -// GetMetaOk returns a tuple with the Meta field value -// and a boolean to check if the value has been set. -func (o *RunShort) GetMetaOk() (*RunMeta, bool) { - if o == nil { - return nil, false - } - return &o.Meta, true -} - -// SetMeta sets field value -func (o *RunShort) SetMeta(v RunMeta) { - o.Meta = v -} - -// GetUsageTotalUsd returns the UsageTotalUsd field value -func (o *RunShort) GetUsageTotalUsd() float32 { - if o == nil { - var ret float32 - return ret - } - - return o.UsageTotalUsd -} - -// GetUsageTotalUsdOk returns a tuple with the UsageTotalUsd field value -// and a boolean to check if the value has been set. -func (o *RunShort) GetUsageTotalUsdOk() (*float32, bool) { - if o == nil { - return nil, false - } - return &o.UsageTotalUsd, true -} - -// SetUsageTotalUsd sets field value -func (o *RunShort) SetUsageTotalUsd(v float32) { - o.UsageTotalUsd = v -} - -// GetDefaultKeyValueStoreId returns the DefaultKeyValueStoreId field value -func (o *RunShort) GetDefaultKeyValueStoreId() string { - if o == nil { - var ret string - return ret - } - - return o.DefaultKeyValueStoreId -} - -// GetDefaultKeyValueStoreIdOk returns a tuple with the DefaultKeyValueStoreId field value -// and a boolean to check if the value has been set. -func (o *RunShort) GetDefaultKeyValueStoreIdOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.DefaultKeyValueStoreId, true -} - -// SetDefaultKeyValueStoreId sets field value -func (o *RunShort) SetDefaultKeyValueStoreId(v string) { - o.DefaultKeyValueStoreId = v -} - -// GetDefaultDatasetId returns the DefaultDatasetId field value -func (o *RunShort) GetDefaultDatasetId() string { - if o == nil { - var ret string - return ret - } - - return o.DefaultDatasetId -} - -// GetDefaultDatasetIdOk returns a tuple with the DefaultDatasetId field value -// and a boolean to check if the value has been set. -func (o *RunShort) GetDefaultDatasetIdOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.DefaultDatasetId, true -} - -// SetDefaultDatasetId sets field value -func (o *RunShort) SetDefaultDatasetId(v string) { - o.DefaultDatasetId = v -} - -// GetDefaultRequestQueueId returns the DefaultRequestQueueId field value -func (o *RunShort) GetDefaultRequestQueueId() string { - if o == nil { - var ret string - return ret - } - - return o.DefaultRequestQueueId -} - -// GetDefaultRequestQueueIdOk returns a tuple with the DefaultRequestQueueId field value -// and a boolean to check if the value has been set. -func (o *RunShort) GetDefaultRequestQueueIdOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.DefaultRequestQueueId, true -} - -// SetDefaultRequestQueueId sets field value -func (o *RunShort) SetDefaultRequestQueueId(v string) { - o.DefaultRequestQueueId = v -} - -func (o RunShort) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o RunShort) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["id"] = o.Id - toSerialize["actId"] = o.ActId - if !IsNil(o.UserId) { - toSerialize["userId"] = o.UserId - } - if o.ActorTaskId.IsSet() { - toSerialize["actorTaskId"] = o.ActorTaskId.Get() - } - toSerialize["status"] = o.Status - toSerialize["startedAt"] = o.StartedAt - if o.FinishedAt.IsSet() { - toSerialize["finishedAt"] = o.FinishedAt.Get() - } - toSerialize["buildId"] = o.BuildId - if !IsNil(o.BuildNumber) { - toSerialize["buildNumber"] = o.BuildNumber - } - if !IsNil(o.BuildNumberInt) { - toSerialize["buildNumberInt"] = o.BuildNumberInt - } - toSerialize["meta"] = o.Meta - toSerialize["usageTotalUsd"] = o.UsageTotalUsd - toSerialize["defaultKeyValueStoreId"] = o.DefaultKeyValueStoreId - toSerialize["defaultDatasetId"] = o.DefaultDatasetId - toSerialize["defaultRequestQueueId"] = o.DefaultRequestQueueId - return toSerialize, nil -} - -func (o *RunShort) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "id", - "actId", - "status", - "startedAt", - "buildId", - "meta", - "usageTotalUsd", - "defaultKeyValueStoreId", - "defaultDatasetId", - "defaultRequestQueueId", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err; - } - - for _, requiredProperty := range(requiredProperties) { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varRunShort := _RunShort{} - - decoder := json.NewDecoder(bytes.NewReader(data)) - decoder.DisallowUnknownFields() - err = decoder.Decode(&varRunShort) - - if err != nil { - return err - } - - *o = RunShort(varRunShort) - - return err -} - -type NullableRunShort struct { - value *RunShort - isSet bool -} - -func (v NullableRunShort) Get() *RunShort { - return v.value -} - -func (v *NullableRunShort) Set(val *RunShort) { - v.value = val - v.isSet = true -} - -func (v NullableRunShort) IsSet() bool { - return v.isSet -} - -func (v *NullableRunShort) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableRunShort(val *RunShort) *NullableRunShort { - return &NullableRunShort{value: val, isSet: true} -} - -func (v NullableRunShort) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableRunShort) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_run_stats.go b/model_run_stats.go deleted file mode 100644 index f2e14cf..0000000 --- a/model_run_stats.go +++ /dev/null @@ -1,728 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" - "bytes" - "fmt" -) - -// checks if the RunStats type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &RunStats{} - -// RunStats struct for RunStats -type RunStats struct { - InputBodyLen NullableInt32 `json:"inputBodyLen,omitempty"` - MigrationCount *int32 `json:"migrationCount,omitempty"` - RebootCount *int32 `json:"rebootCount,omitempty"` - RestartCount int32 `json:"restartCount"` - ResurrectCount int32 `json:"resurrectCount"` - MemAvgBytes *float32 `json:"memAvgBytes,omitempty"` - MemMaxBytes *int32 `json:"memMaxBytes,omitempty"` - MemCurrentBytes *int32 `json:"memCurrentBytes,omitempty"` - CpuAvgUsage *float32 `json:"cpuAvgUsage,omitempty"` - CpuMaxUsage *float32 `json:"cpuMaxUsage,omitempty"` - CpuCurrentUsage *float32 `json:"cpuCurrentUsage,omitempty"` - NetRxBytes *int32 `json:"netRxBytes,omitempty"` - NetTxBytes *int32 `json:"netTxBytes,omitempty"` - DurationMillis *int32 `json:"durationMillis,omitempty"` - RunTimeSecs *float32 `json:"runTimeSecs,omitempty"` - Metamorph *int32 `json:"metamorph,omitempty"` - ComputeUnits float32 `json:"computeUnits"` -} - -type _RunStats RunStats - -// NewRunStats instantiates a new RunStats object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewRunStats(restartCount int32, resurrectCount int32, computeUnits float32) *RunStats { - this := RunStats{} - this.RestartCount = restartCount - this.ResurrectCount = resurrectCount - this.ComputeUnits = computeUnits - return &this -} - -// NewRunStatsWithDefaults instantiates a new RunStats object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewRunStatsWithDefaults() *RunStats { - this := RunStats{} - return &this -} - -// GetInputBodyLen returns the InputBodyLen field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *RunStats) GetInputBodyLen() int32 { - if o == nil || IsNil(o.InputBodyLen.Get()) { - var ret int32 - return ret - } - return *o.InputBodyLen.Get() -} - -// GetInputBodyLenOk returns a tuple with the InputBodyLen field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *RunStats) GetInputBodyLenOk() (*int32, bool) { - if o == nil { - return nil, false - } - return o.InputBodyLen.Get(), o.InputBodyLen.IsSet() -} - -// HasInputBodyLen returns a boolean if a field has been set. -func (o *RunStats) HasInputBodyLen() bool { - if o != nil && o.InputBodyLen.IsSet() { - return true - } - - return false -} - -// SetInputBodyLen gets a reference to the given NullableInt32 and assigns it to the InputBodyLen field. -func (o *RunStats) SetInputBodyLen(v int32) { - o.InputBodyLen.Set(&v) -} -// SetInputBodyLenNil sets the value for InputBodyLen to be an explicit nil -func (o *RunStats) SetInputBodyLenNil() { - o.InputBodyLen.Set(nil) -} - -// UnsetInputBodyLen ensures that no value is present for InputBodyLen, not even an explicit nil -func (o *RunStats) UnsetInputBodyLen() { - o.InputBodyLen.Unset() -} - -// GetMigrationCount returns the MigrationCount field value if set, zero value otherwise. -func (o *RunStats) GetMigrationCount() int32 { - if o == nil || IsNil(o.MigrationCount) { - var ret int32 - return ret - } - return *o.MigrationCount -} - -// GetMigrationCountOk returns a tuple with the MigrationCount field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *RunStats) GetMigrationCountOk() (*int32, bool) { - if o == nil || IsNil(o.MigrationCount) { - return nil, false - } - return o.MigrationCount, true -} - -// HasMigrationCount returns a boolean if a field has been set. -func (o *RunStats) HasMigrationCount() bool { - if o != nil && !IsNil(o.MigrationCount) { - return true - } - - return false -} - -// SetMigrationCount gets a reference to the given int32 and assigns it to the MigrationCount field. -func (o *RunStats) SetMigrationCount(v int32) { - o.MigrationCount = &v -} - -// GetRebootCount returns the RebootCount field value if set, zero value otherwise. -func (o *RunStats) GetRebootCount() int32 { - if o == nil || IsNil(o.RebootCount) { - var ret int32 - return ret - } - return *o.RebootCount -} - -// GetRebootCountOk returns a tuple with the RebootCount field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *RunStats) GetRebootCountOk() (*int32, bool) { - if o == nil || IsNil(o.RebootCount) { - return nil, false - } - return o.RebootCount, true -} - -// HasRebootCount returns a boolean if a field has been set. -func (o *RunStats) HasRebootCount() bool { - if o != nil && !IsNil(o.RebootCount) { - return true - } - - return false -} - -// SetRebootCount gets a reference to the given int32 and assigns it to the RebootCount field. -func (o *RunStats) SetRebootCount(v int32) { - o.RebootCount = &v -} - -// GetRestartCount returns the RestartCount field value -func (o *RunStats) GetRestartCount() int32 { - if o == nil { - var ret int32 - return ret - } - - return o.RestartCount -} - -// GetRestartCountOk returns a tuple with the RestartCount field value -// and a boolean to check if the value has been set. -func (o *RunStats) GetRestartCountOk() (*int32, bool) { - if o == nil { - return nil, false - } - return &o.RestartCount, true -} - -// SetRestartCount sets field value -func (o *RunStats) SetRestartCount(v int32) { - o.RestartCount = v -} - -// GetResurrectCount returns the ResurrectCount field value -func (o *RunStats) GetResurrectCount() int32 { - if o == nil { - var ret int32 - return ret - } - - return o.ResurrectCount -} - -// GetResurrectCountOk returns a tuple with the ResurrectCount field value -// and a boolean to check if the value has been set. -func (o *RunStats) GetResurrectCountOk() (*int32, bool) { - if o == nil { - return nil, false - } - return &o.ResurrectCount, true -} - -// SetResurrectCount sets field value -func (o *RunStats) SetResurrectCount(v int32) { - o.ResurrectCount = v -} - -// GetMemAvgBytes returns the MemAvgBytes field value if set, zero value otherwise. -func (o *RunStats) GetMemAvgBytes() float32 { - if o == nil || IsNil(o.MemAvgBytes) { - var ret float32 - return ret - } - return *o.MemAvgBytes -} - -// GetMemAvgBytesOk returns a tuple with the MemAvgBytes field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *RunStats) GetMemAvgBytesOk() (*float32, bool) { - if o == nil || IsNil(o.MemAvgBytes) { - return nil, false - } - return o.MemAvgBytes, true -} - -// HasMemAvgBytes returns a boolean if a field has been set. -func (o *RunStats) HasMemAvgBytes() bool { - if o != nil && !IsNil(o.MemAvgBytes) { - return true - } - - return false -} - -// SetMemAvgBytes gets a reference to the given float32 and assigns it to the MemAvgBytes field. -func (o *RunStats) SetMemAvgBytes(v float32) { - o.MemAvgBytes = &v -} - -// GetMemMaxBytes returns the MemMaxBytes field value if set, zero value otherwise. -func (o *RunStats) GetMemMaxBytes() int32 { - if o == nil || IsNil(o.MemMaxBytes) { - var ret int32 - return ret - } - return *o.MemMaxBytes -} - -// GetMemMaxBytesOk returns a tuple with the MemMaxBytes field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *RunStats) GetMemMaxBytesOk() (*int32, bool) { - if o == nil || IsNil(o.MemMaxBytes) { - return nil, false - } - return o.MemMaxBytes, true -} - -// HasMemMaxBytes returns a boolean if a field has been set. -func (o *RunStats) HasMemMaxBytes() bool { - if o != nil && !IsNil(o.MemMaxBytes) { - return true - } - - return false -} - -// SetMemMaxBytes gets a reference to the given int32 and assigns it to the MemMaxBytes field. -func (o *RunStats) SetMemMaxBytes(v int32) { - o.MemMaxBytes = &v -} - -// GetMemCurrentBytes returns the MemCurrentBytes field value if set, zero value otherwise. -func (o *RunStats) GetMemCurrentBytes() int32 { - if o == nil || IsNil(o.MemCurrentBytes) { - var ret int32 - return ret - } - return *o.MemCurrentBytes -} - -// GetMemCurrentBytesOk returns a tuple with the MemCurrentBytes field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *RunStats) GetMemCurrentBytesOk() (*int32, bool) { - if o == nil || IsNil(o.MemCurrentBytes) { - return nil, false - } - return o.MemCurrentBytes, true -} - -// HasMemCurrentBytes returns a boolean if a field has been set. -func (o *RunStats) HasMemCurrentBytes() bool { - if o != nil && !IsNil(o.MemCurrentBytes) { - return true - } - - return false -} - -// SetMemCurrentBytes gets a reference to the given int32 and assigns it to the MemCurrentBytes field. -func (o *RunStats) SetMemCurrentBytes(v int32) { - o.MemCurrentBytes = &v -} - -// GetCpuAvgUsage returns the CpuAvgUsage field value if set, zero value otherwise. -func (o *RunStats) GetCpuAvgUsage() float32 { - if o == nil || IsNil(o.CpuAvgUsage) { - var ret float32 - return ret - } - return *o.CpuAvgUsage -} - -// GetCpuAvgUsageOk returns a tuple with the CpuAvgUsage field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *RunStats) GetCpuAvgUsageOk() (*float32, bool) { - if o == nil || IsNil(o.CpuAvgUsage) { - return nil, false - } - return o.CpuAvgUsage, true -} - -// HasCpuAvgUsage returns a boolean if a field has been set. -func (o *RunStats) HasCpuAvgUsage() bool { - if o != nil && !IsNil(o.CpuAvgUsage) { - return true - } - - return false -} - -// SetCpuAvgUsage gets a reference to the given float32 and assigns it to the CpuAvgUsage field. -func (o *RunStats) SetCpuAvgUsage(v float32) { - o.CpuAvgUsage = &v -} - -// GetCpuMaxUsage returns the CpuMaxUsage field value if set, zero value otherwise. -func (o *RunStats) GetCpuMaxUsage() float32 { - if o == nil || IsNil(o.CpuMaxUsage) { - var ret float32 - return ret - } - return *o.CpuMaxUsage -} - -// GetCpuMaxUsageOk returns a tuple with the CpuMaxUsage field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *RunStats) GetCpuMaxUsageOk() (*float32, bool) { - if o == nil || IsNil(o.CpuMaxUsage) { - return nil, false - } - return o.CpuMaxUsage, true -} - -// HasCpuMaxUsage returns a boolean if a field has been set. -func (o *RunStats) HasCpuMaxUsage() bool { - if o != nil && !IsNil(o.CpuMaxUsage) { - return true - } - - return false -} - -// SetCpuMaxUsage gets a reference to the given float32 and assigns it to the CpuMaxUsage field. -func (o *RunStats) SetCpuMaxUsage(v float32) { - o.CpuMaxUsage = &v -} - -// GetCpuCurrentUsage returns the CpuCurrentUsage field value if set, zero value otherwise. -func (o *RunStats) GetCpuCurrentUsage() float32 { - if o == nil || IsNil(o.CpuCurrentUsage) { - var ret float32 - return ret - } - return *o.CpuCurrentUsage -} - -// GetCpuCurrentUsageOk returns a tuple with the CpuCurrentUsage field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *RunStats) GetCpuCurrentUsageOk() (*float32, bool) { - if o == nil || IsNil(o.CpuCurrentUsage) { - return nil, false - } - return o.CpuCurrentUsage, true -} - -// HasCpuCurrentUsage returns a boolean if a field has been set. -func (o *RunStats) HasCpuCurrentUsage() bool { - if o != nil && !IsNil(o.CpuCurrentUsage) { - return true - } - - return false -} - -// SetCpuCurrentUsage gets a reference to the given float32 and assigns it to the CpuCurrentUsage field. -func (o *RunStats) SetCpuCurrentUsage(v float32) { - o.CpuCurrentUsage = &v -} - -// GetNetRxBytes returns the NetRxBytes field value if set, zero value otherwise. -func (o *RunStats) GetNetRxBytes() int32 { - if o == nil || IsNil(o.NetRxBytes) { - var ret int32 - return ret - } - return *o.NetRxBytes -} - -// GetNetRxBytesOk returns a tuple with the NetRxBytes field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *RunStats) GetNetRxBytesOk() (*int32, bool) { - if o == nil || IsNil(o.NetRxBytes) { - return nil, false - } - return o.NetRxBytes, true -} - -// HasNetRxBytes returns a boolean if a field has been set. -func (o *RunStats) HasNetRxBytes() bool { - if o != nil && !IsNil(o.NetRxBytes) { - return true - } - - return false -} - -// SetNetRxBytes gets a reference to the given int32 and assigns it to the NetRxBytes field. -func (o *RunStats) SetNetRxBytes(v int32) { - o.NetRxBytes = &v -} - -// GetNetTxBytes returns the NetTxBytes field value if set, zero value otherwise. -func (o *RunStats) GetNetTxBytes() int32 { - if o == nil || IsNil(o.NetTxBytes) { - var ret int32 - return ret - } - return *o.NetTxBytes -} - -// GetNetTxBytesOk returns a tuple with the NetTxBytes field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *RunStats) GetNetTxBytesOk() (*int32, bool) { - if o == nil || IsNil(o.NetTxBytes) { - return nil, false - } - return o.NetTxBytes, true -} - -// HasNetTxBytes returns a boolean if a field has been set. -func (o *RunStats) HasNetTxBytes() bool { - if o != nil && !IsNil(o.NetTxBytes) { - return true - } - - return false -} - -// SetNetTxBytes gets a reference to the given int32 and assigns it to the NetTxBytes field. -func (o *RunStats) SetNetTxBytes(v int32) { - o.NetTxBytes = &v -} - -// GetDurationMillis returns the DurationMillis field value if set, zero value otherwise. -func (o *RunStats) GetDurationMillis() int32 { - if o == nil || IsNil(o.DurationMillis) { - var ret int32 - return ret - } - return *o.DurationMillis -} - -// GetDurationMillisOk returns a tuple with the DurationMillis field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *RunStats) GetDurationMillisOk() (*int32, bool) { - if o == nil || IsNil(o.DurationMillis) { - return nil, false - } - return o.DurationMillis, true -} - -// HasDurationMillis returns a boolean if a field has been set. -func (o *RunStats) HasDurationMillis() bool { - if o != nil && !IsNil(o.DurationMillis) { - return true - } - - return false -} - -// SetDurationMillis gets a reference to the given int32 and assigns it to the DurationMillis field. -func (o *RunStats) SetDurationMillis(v int32) { - o.DurationMillis = &v -} - -// GetRunTimeSecs returns the RunTimeSecs field value if set, zero value otherwise. -func (o *RunStats) GetRunTimeSecs() float32 { - if o == nil || IsNil(o.RunTimeSecs) { - var ret float32 - return ret - } - return *o.RunTimeSecs -} - -// GetRunTimeSecsOk returns a tuple with the RunTimeSecs field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *RunStats) GetRunTimeSecsOk() (*float32, bool) { - if o == nil || IsNil(o.RunTimeSecs) { - return nil, false - } - return o.RunTimeSecs, true -} - -// HasRunTimeSecs returns a boolean if a field has been set. -func (o *RunStats) HasRunTimeSecs() bool { - if o != nil && !IsNil(o.RunTimeSecs) { - return true - } - - return false -} - -// SetRunTimeSecs gets a reference to the given float32 and assigns it to the RunTimeSecs field. -func (o *RunStats) SetRunTimeSecs(v float32) { - o.RunTimeSecs = &v -} - -// GetMetamorph returns the Metamorph field value if set, zero value otherwise. -func (o *RunStats) GetMetamorph() int32 { - if o == nil || IsNil(o.Metamorph) { - var ret int32 - return ret - } - return *o.Metamorph -} - -// GetMetamorphOk returns a tuple with the Metamorph field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *RunStats) GetMetamorphOk() (*int32, bool) { - if o == nil || IsNil(o.Metamorph) { - return nil, false - } - return o.Metamorph, true -} - -// HasMetamorph returns a boolean if a field has been set. -func (o *RunStats) HasMetamorph() bool { - if o != nil && !IsNil(o.Metamorph) { - return true - } - - return false -} - -// SetMetamorph gets a reference to the given int32 and assigns it to the Metamorph field. -func (o *RunStats) SetMetamorph(v int32) { - o.Metamorph = &v -} - -// GetComputeUnits returns the ComputeUnits field value -func (o *RunStats) GetComputeUnits() float32 { - if o == nil { - var ret float32 - return ret - } - - return o.ComputeUnits -} - -// GetComputeUnitsOk returns a tuple with the ComputeUnits field value -// and a boolean to check if the value has been set. -func (o *RunStats) GetComputeUnitsOk() (*float32, bool) { - if o == nil { - return nil, false - } - return &o.ComputeUnits, true -} - -// SetComputeUnits sets field value -func (o *RunStats) SetComputeUnits(v float32) { - o.ComputeUnits = v -} - -func (o RunStats) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o RunStats) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if o.InputBodyLen.IsSet() { - toSerialize["inputBodyLen"] = o.InputBodyLen.Get() - } - if !IsNil(o.MigrationCount) { - toSerialize["migrationCount"] = o.MigrationCount - } - if !IsNil(o.RebootCount) { - toSerialize["rebootCount"] = o.RebootCount - } - toSerialize["restartCount"] = o.RestartCount - toSerialize["resurrectCount"] = o.ResurrectCount - if !IsNil(o.MemAvgBytes) { - toSerialize["memAvgBytes"] = o.MemAvgBytes - } - if !IsNil(o.MemMaxBytes) { - toSerialize["memMaxBytes"] = o.MemMaxBytes - } - if !IsNil(o.MemCurrentBytes) { - toSerialize["memCurrentBytes"] = o.MemCurrentBytes - } - if !IsNil(o.CpuAvgUsage) { - toSerialize["cpuAvgUsage"] = o.CpuAvgUsage - } - if !IsNil(o.CpuMaxUsage) { - toSerialize["cpuMaxUsage"] = o.CpuMaxUsage - } - if !IsNil(o.CpuCurrentUsage) { - toSerialize["cpuCurrentUsage"] = o.CpuCurrentUsage - } - if !IsNil(o.NetRxBytes) { - toSerialize["netRxBytes"] = o.NetRxBytes - } - if !IsNil(o.NetTxBytes) { - toSerialize["netTxBytes"] = o.NetTxBytes - } - if !IsNil(o.DurationMillis) { - toSerialize["durationMillis"] = o.DurationMillis - } - if !IsNil(o.RunTimeSecs) { - toSerialize["runTimeSecs"] = o.RunTimeSecs - } - if !IsNil(o.Metamorph) { - toSerialize["metamorph"] = o.Metamorph - } - toSerialize["computeUnits"] = o.ComputeUnits - return toSerialize, nil -} - -func (o *RunStats) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "restartCount", - "resurrectCount", - "computeUnits", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err; - } - - for _, requiredProperty := range(requiredProperties) { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varRunStats := _RunStats{} - - decoder := json.NewDecoder(bytes.NewReader(data)) - decoder.DisallowUnknownFields() - err = decoder.Decode(&varRunStats) - - if err != nil { - return err - } - - *o = RunStats(varRunStats) - - return err -} - -type NullableRunStats struct { - value *RunStats - isSet bool -} - -func (v NullableRunStats) Get() *RunStats { - return v.value -} - -func (v *NullableRunStats) Set(val *RunStats) { - v.value = val - v.isSet = true -} - -func (v NullableRunStats) IsSet() bool { - return v.isSet -} - -func (v *NullableRunStats) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableRunStats(val *RunStats) *NullableRunStats { - return &NullableRunStats{value: val, isSet: true} -} - -func (v NullableRunStats) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableRunStats) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_run_storage_ids.go b/model_run_storage_ids.go deleted file mode 100644 index 76c36a5..0000000 --- a/model_run_storage_ids.go +++ /dev/null @@ -1,198 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" -) - -// checks if the RunStorageIds type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &RunStorageIds{} - -// RunStorageIds A map of aliased storage IDs associated with this run, grouped by storage type. -type RunStorageIds struct { - Datasets *RunStorageIdsDatasets `json:"datasets,omitempty"` - KeyValueStores *RunStorageIdsDatasets `json:"keyValueStores,omitempty"` - RequestQueues *RunStorageIdsDatasets `json:"requestQueues,omitempty"` -} - -// NewRunStorageIds instantiates a new RunStorageIds object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewRunStorageIds() *RunStorageIds { - this := RunStorageIds{} - return &this -} - -// NewRunStorageIdsWithDefaults instantiates a new RunStorageIds object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewRunStorageIdsWithDefaults() *RunStorageIds { - this := RunStorageIds{} - return &this -} - -// GetDatasets returns the Datasets field value if set, zero value otherwise. -func (o *RunStorageIds) GetDatasets() RunStorageIdsDatasets { - if o == nil || IsNil(o.Datasets) { - var ret RunStorageIdsDatasets - return ret - } - return *o.Datasets -} - -// GetDatasetsOk returns a tuple with the Datasets field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *RunStorageIds) GetDatasetsOk() (*RunStorageIdsDatasets, bool) { - if o == nil || IsNil(o.Datasets) { - return nil, false - } - return o.Datasets, true -} - -// HasDatasets returns a boolean if a field has been set. -func (o *RunStorageIds) HasDatasets() bool { - if o != nil && !IsNil(o.Datasets) { - return true - } - - return false -} - -// SetDatasets gets a reference to the given RunStorageIdsDatasets and assigns it to the Datasets field. -func (o *RunStorageIds) SetDatasets(v RunStorageIdsDatasets) { - o.Datasets = &v -} - -// GetKeyValueStores returns the KeyValueStores field value if set, zero value otherwise. -func (o *RunStorageIds) GetKeyValueStores() RunStorageIdsDatasets { - if o == nil || IsNil(o.KeyValueStores) { - var ret RunStorageIdsDatasets - return ret - } - return *o.KeyValueStores -} - -// GetKeyValueStoresOk returns a tuple with the KeyValueStores field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *RunStorageIds) GetKeyValueStoresOk() (*RunStorageIdsDatasets, bool) { - if o == nil || IsNil(o.KeyValueStores) { - return nil, false - } - return o.KeyValueStores, true -} - -// HasKeyValueStores returns a boolean if a field has been set. -func (o *RunStorageIds) HasKeyValueStores() bool { - if o != nil && !IsNil(o.KeyValueStores) { - return true - } - - return false -} - -// SetKeyValueStores gets a reference to the given RunStorageIdsDatasets and assigns it to the KeyValueStores field. -func (o *RunStorageIds) SetKeyValueStores(v RunStorageIdsDatasets) { - o.KeyValueStores = &v -} - -// GetRequestQueues returns the RequestQueues field value if set, zero value otherwise. -func (o *RunStorageIds) GetRequestQueues() RunStorageIdsDatasets { - if o == nil || IsNil(o.RequestQueues) { - var ret RunStorageIdsDatasets - return ret - } - return *o.RequestQueues -} - -// GetRequestQueuesOk returns a tuple with the RequestQueues field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *RunStorageIds) GetRequestQueuesOk() (*RunStorageIdsDatasets, bool) { - if o == nil || IsNil(o.RequestQueues) { - return nil, false - } - return o.RequestQueues, true -} - -// HasRequestQueues returns a boolean if a field has been set. -func (o *RunStorageIds) HasRequestQueues() bool { - if o != nil && !IsNil(o.RequestQueues) { - return true - } - - return false -} - -// SetRequestQueues gets a reference to the given RunStorageIdsDatasets and assigns it to the RequestQueues field. -func (o *RunStorageIds) SetRequestQueues(v RunStorageIdsDatasets) { - o.RequestQueues = &v -} - -func (o RunStorageIds) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o RunStorageIds) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if !IsNil(o.Datasets) { - toSerialize["datasets"] = o.Datasets - } - if !IsNil(o.KeyValueStores) { - toSerialize["keyValueStores"] = o.KeyValueStores - } - if !IsNil(o.RequestQueues) { - toSerialize["requestQueues"] = o.RequestQueues - } - return toSerialize, nil -} - -type NullableRunStorageIds struct { - value *RunStorageIds - isSet bool -} - -func (v NullableRunStorageIds) Get() *RunStorageIds { - return v.value -} - -func (v *NullableRunStorageIds) Set(val *RunStorageIds) { - v.value = val - v.isSet = true -} - -func (v NullableRunStorageIds) IsSet() bool { - return v.isSet -} - -func (v *NullableRunStorageIds) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableRunStorageIds(val *RunStorageIds) *NullableRunStorageIds { - return &NullableRunStorageIds{value: val, isSet: true} -} - -func (v NullableRunStorageIds) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableRunStorageIds) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_run_storage_ids_datasets.go b/model_run_storage_ids_datasets.go deleted file mode 100644 index dd3809d..0000000 --- a/model_run_storage_ids_datasets.go +++ /dev/null @@ -1,156 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" -) - -// checks if the RunStorageIdsDatasets type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &RunStorageIdsDatasets{} - -// RunStorageIdsDatasets Aliased dataset IDs for this run. -type RunStorageIdsDatasets struct { - // ID of the default dataset for this run. - Default *string `json:"default,omitempty"` - AdditionalProperties map[string]interface{} -} - -type _RunStorageIdsDatasets RunStorageIdsDatasets - -// NewRunStorageIdsDatasets instantiates a new RunStorageIdsDatasets object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewRunStorageIdsDatasets() *RunStorageIdsDatasets { - this := RunStorageIdsDatasets{} - return &this -} - -// NewRunStorageIdsDatasetsWithDefaults instantiates a new RunStorageIdsDatasets object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewRunStorageIdsDatasetsWithDefaults() *RunStorageIdsDatasets { - this := RunStorageIdsDatasets{} - return &this -} - -// GetDefault returns the Default field value if set, zero value otherwise. -func (o *RunStorageIdsDatasets) GetDefault() string { - if o == nil || IsNil(o.Default) { - var ret string - return ret - } - return *o.Default -} - -// GetDefaultOk returns a tuple with the Default field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *RunStorageIdsDatasets) GetDefaultOk() (*string, bool) { - if o == nil || IsNil(o.Default) { - return nil, false - } - return o.Default, true -} - -// HasDefault returns a boolean if a field has been set. -func (o *RunStorageIdsDatasets) HasDefault() bool { - if o != nil && !IsNil(o.Default) { - return true - } - - return false -} - -// SetDefault gets a reference to the given string and assigns it to the Default field. -func (o *RunStorageIdsDatasets) SetDefault(v string) { - o.Default = &v -} - -func (o RunStorageIdsDatasets) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o RunStorageIdsDatasets) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if !IsNil(o.Default) { - toSerialize["default"] = o.Default - } - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *RunStorageIdsDatasets) UnmarshalJSON(data []byte) (err error) { - varRunStorageIdsDatasets := _RunStorageIdsDatasets{} - - err = json.Unmarshal(data, &varRunStorageIdsDatasets) - - if err != nil { - return err - } - - *o = RunStorageIdsDatasets(varRunStorageIdsDatasets) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "default") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableRunStorageIdsDatasets struct { - value *RunStorageIdsDatasets - isSet bool -} - -func (v NullableRunStorageIdsDatasets) Get() *RunStorageIdsDatasets { - return v.value -} - -func (v *NullableRunStorageIdsDatasets) Set(val *RunStorageIdsDatasets) { - v.value = val - v.isSet = true -} - -func (v NullableRunStorageIdsDatasets) IsSet() bool { - return v.isSet -} - -func (v *NullableRunStorageIdsDatasets) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableRunStorageIdsDatasets(val *RunStorageIdsDatasets) *NullableRunStorageIdsDatasets { - return &NullableRunStorageIdsDatasets{value: val, isSet: true} -} - -func (v NullableRunStorageIdsDatasets) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableRunStorageIdsDatasets) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_run_timeout_exceeded_error_detail.go b/model_run_timeout_exceeded_error_detail.go deleted file mode 100644 index 630f69a..0000000 --- a/model_run_timeout_exceeded_error_detail.go +++ /dev/null @@ -1,164 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" -) - -// checks if the RunTimeoutExceededErrorDetail type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &RunTimeoutExceededErrorDetail{} - -// RunTimeoutExceededErrorDetail struct for RunTimeoutExceededErrorDetail -type RunTimeoutExceededErrorDetail struct { - Type interface{} `json:"type,omitempty"` - // Human-readable error message describing what went wrong. - Message *string `json:"message,omitempty"` -} - -// NewRunTimeoutExceededErrorDetail instantiates a new RunTimeoutExceededErrorDetail object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewRunTimeoutExceededErrorDetail() *RunTimeoutExceededErrorDetail { - this := RunTimeoutExceededErrorDetail{} - return &this -} - -// NewRunTimeoutExceededErrorDetailWithDefaults instantiates a new RunTimeoutExceededErrorDetail object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewRunTimeoutExceededErrorDetailWithDefaults() *RunTimeoutExceededErrorDetail { - this := RunTimeoutExceededErrorDetail{} - return &this -} - -// GetType returns the Type field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *RunTimeoutExceededErrorDetail) GetType() interface{} { - if o == nil { - var ret interface{} - return ret - } - return o.Type -} - -// GetTypeOk returns a tuple with the Type field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *RunTimeoutExceededErrorDetail) GetTypeOk() (*interface{}, bool) { - if o == nil || IsNil(o.Type) { - return nil, false - } - return &o.Type, true -} - -// HasType returns a boolean if a field has been set. -func (o *RunTimeoutExceededErrorDetail) HasType() bool { - if o != nil && !IsNil(o.Type) { - return true - } - - return false -} - -// SetType gets a reference to the given interface{} and assigns it to the Type field. -func (o *RunTimeoutExceededErrorDetail) SetType(v interface{}) { - o.Type = v -} - -// GetMessage returns the Message field value if set, zero value otherwise. -func (o *RunTimeoutExceededErrorDetail) GetMessage() string { - if o == nil || IsNil(o.Message) { - var ret string - return ret - } - return *o.Message -} - -// GetMessageOk returns a tuple with the Message field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *RunTimeoutExceededErrorDetail) GetMessageOk() (*string, bool) { - if o == nil || IsNil(o.Message) { - return nil, false - } - return o.Message, true -} - -// HasMessage returns a boolean if a field has been set. -func (o *RunTimeoutExceededErrorDetail) HasMessage() bool { - if o != nil && !IsNil(o.Message) { - return true - } - - return false -} - -// SetMessage gets a reference to the given string and assigns it to the Message field. -func (o *RunTimeoutExceededErrorDetail) SetMessage(v string) { - o.Message = &v -} - -func (o RunTimeoutExceededErrorDetail) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o RunTimeoutExceededErrorDetail) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if o.Type != nil { - toSerialize["type"] = o.Type - } - if !IsNil(o.Message) { - toSerialize["message"] = o.Message - } - return toSerialize, nil -} - -type NullableRunTimeoutExceededErrorDetail struct { - value *RunTimeoutExceededErrorDetail - isSet bool -} - -func (v NullableRunTimeoutExceededErrorDetail) Get() *RunTimeoutExceededErrorDetail { - return v.value -} - -func (v *NullableRunTimeoutExceededErrorDetail) Set(val *RunTimeoutExceededErrorDetail) { - v.value = val - v.isSet = true -} - -func (v NullableRunTimeoutExceededErrorDetail) IsSet() bool { - return v.isSet -} - -func (v *NullableRunTimeoutExceededErrorDetail) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableRunTimeoutExceededErrorDetail(val *RunTimeoutExceededErrorDetail) *NullableRunTimeoutExceededErrorDetail { - return &NullableRunTimeoutExceededErrorDetail{value: val, isSet: true} -} - -func (v NullableRunTimeoutExceededErrorDetail) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableRunTimeoutExceededErrorDetail) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_run_usage.go b/model_run_usage.go deleted file mode 100644 index 9c83bb8..0000000 --- a/model_run_usage.go +++ /dev/null @@ -1,642 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" -) - -// checks if the RunUsage type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &RunUsage{} - -// RunUsage struct for RunUsage -type RunUsage struct { - ACTOR_COMPUTE_UNITS NullableFloat32 `json:"ACTOR_COMPUTE_UNITS,omitempty"` - DATASET_READS NullableInt32 `json:"DATASET_READS,omitempty"` - DATASET_WRITES NullableInt32 `json:"DATASET_WRITES,omitempty"` - KEY_VALUE_STORE_READS NullableInt32 `json:"KEY_VALUE_STORE_READS,omitempty"` - KEY_VALUE_STORE_WRITES NullableInt32 `json:"KEY_VALUE_STORE_WRITES,omitempty"` - KEY_VALUE_STORE_LISTS NullableInt32 `json:"KEY_VALUE_STORE_LISTS,omitempty"` - REQUEST_QUEUE_READS NullableInt32 `json:"REQUEST_QUEUE_READS,omitempty"` - REQUEST_QUEUE_WRITES NullableInt32 `json:"REQUEST_QUEUE_WRITES,omitempty"` - DATA_TRANSFER_INTERNAL_GBYTES NullableFloat32 `json:"DATA_TRANSFER_INTERNAL_GBYTES,omitempty"` - DATA_TRANSFER_EXTERNAL_GBYTES NullableFloat32 `json:"DATA_TRANSFER_EXTERNAL_GBYTES,omitempty"` - PROXY_RESIDENTIAL_TRANSFER_GBYTES NullableFloat32 `json:"PROXY_RESIDENTIAL_TRANSFER_GBYTES,omitempty"` - PROXY_SERPS NullableInt32 `json:"PROXY_SERPS,omitempty"` -} - -// NewRunUsage instantiates a new RunUsage object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewRunUsage() *RunUsage { - this := RunUsage{} - return &this -} - -// NewRunUsageWithDefaults instantiates a new RunUsage object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewRunUsageWithDefaults() *RunUsage { - this := RunUsage{} - return &this -} - -// GetACTOR_COMPUTE_UNITS returns the ACTOR_COMPUTE_UNITS field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *RunUsage) GetACTOR_COMPUTE_UNITS() float32 { - if o == nil || IsNil(o.ACTOR_COMPUTE_UNITS.Get()) { - var ret float32 - return ret - } - return *o.ACTOR_COMPUTE_UNITS.Get() -} - -// GetACTOR_COMPUTE_UNITSOk returns a tuple with the ACTOR_COMPUTE_UNITS field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *RunUsage) GetACTOR_COMPUTE_UNITSOk() (*float32, bool) { - if o == nil { - return nil, false - } - return o.ACTOR_COMPUTE_UNITS.Get(), o.ACTOR_COMPUTE_UNITS.IsSet() -} - -// HasACTOR_COMPUTE_UNITS returns a boolean if a field has been set. -func (o *RunUsage) HasACTOR_COMPUTE_UNITS() bool { - if o != nil && o.ACTOR_COMPUTE_UNITS.IsSet() { - return true - } - - return false -} - -// SetACTOR_COMPUTE_UNITS gets a reference to the given NullableFloat32 and assigns it to the ACTOR_COMPUTE_UNITS field. -func (o *RunUsage) SetACTOR_COMPUTE_UNITS(v float32) { - o.ACTOR_COMPUTE_UNITS.Set(&v) -} -// SetACTOR_COMPUTE_UNITSNil sets the value for ACTOR_COMPUTE_UNITS to be an explicit nil -func (o *RunUsage) SetACTOR_COMPUTE_UNITSNil() { - o.ACTOR_COMPUTE_UNITS.Set(nil) -} - -// UnsetACTOR_COMPUTE_UNITS ensures that no value is present for ACTOR_COMPUTE_UNITS, not even an explicit nil -func (o *RunUsage) UnsetACTOR_COMPUTE_UNITS() { - o.ACTOR_COMPUTE_UNITS.Unset() -} - -// GetDATASET_READS returns the DATASET_READS field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *RunUsage) GetDATASET_READS() int32 { - if o == nil || IsNil(o.DATASET_READS.Get()) { - var ret int32 - return ret - } - return *o.DATASET_READS.Get() -} - -// GetDATASET_READSOk returns a tuple with the DATASET_READS field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *RunUsage) GetDATASET_READSOk() (*int32, bool) { - if o == nil { - return nil, false - } - return o.DATASET_READS.Get(), o.DATASET_READS.IsSet() -} - -// HasDATASET_READS returns a boolean if a field has been set. -func (o *RunUsage) HasDATASET_READS() bool { - if o != nil && o.DATASET_READS.IsSet() { - return true - } - - return false -} - -// SetDATASET_READS gets a reference to the given NullableInt32 and assigns it to the DATASET_READS field. -func (o *RunUsage) SetDATASET_READS(v int32) { - o.DATASET_READS.Set(&v) -} -// SetDATASET_READSNil sets the value for DATASET_READS to be an explicit nil -func (o *RunUsage) SetDATASET_READSNil() { - o.DATASET_READS.Set(nil) -} - -// UnsetDATASET_READS ensures that no value is present for DATASET_READS, not even an explicit nil -func (o *RunUsage) UnsetDATASET_READS() { - o.DATASET_READS.Unset() -} - -// GetDATASET_WRITES returns the DATASET_WRITES field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *RunUsage) GetDATASET_WRITES() int32 { - if o == nil || IsNil(o.DATASET_WRITES.Get()) { - var ret int32 - return ret - } - return *o.DATASET_WRITES.Get() -} - -// GetDATASET_WRITESOk returns a tuple with the DATASET_WRITES field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *RunUsage) GetDATASET_WRITESOk() (*int32, bool) { - if o == nil { - return nil, false - } - return o.DATASET_WRITES.Get(), o.DATASET_WRITES.IsSet() -} - -// HasDATASET_WRITES returns a boolean if a field has been set. -func (o *RunUsage) HasDATASET_WRITES() bool { - if o != nil && o.DATASET_WRITES.IsSet() { - return true - } - - return false -} - -// SetDATASET_WRITES gets a reference to the given NullableInt32 and assigns it to the DATASET_WRITES field. -func (o *RunUsage) SetDATASET_WRITES(v int32) { - o.DATASET_WRITES.Set(&v) -} -// SetDATASET_WRITESNil sets the value for DATASET_WRITES to be an explicit nil -func (o *RunUsage) SetDATASET_WRITESNil() { - o.DATASET_WRITES.Set(nil) -} - -// UnsetDATASET_WRITES ensures that no value is present for DATASET_WRITES, not even an explicit nil -func (o *RunUsage) UnsetDATASET_WRITES() { - o.DATASET_WRITES.Unset() -} - -// GetKEY_VALUE_STORE_READS returns the KEY_VALUE_STORE_READS field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *RunUsage) GetKEY_VALUE_STORE_READS() int32 { - if o == nil || IsNil(o.KEY_VALUE_STORE_READS.Get()) { - var ret int32 - return ret - } - return *o.KEY_VALUE_STORE_READS.Get() -} - -// GetKEY_VALUE_STORE_READSOk returns a tuple with the KEY_VALUE_STORE_READS field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *RunUsage) GetKEY_VALUE_STORE_READSOk() (*int32, bool) { - if o == nil { - return nil, false - } - return o.KEY_VALUE_STORE_READS.Get(), o.KEY_VALUE_STORE_READS.IsSet() -} - -// HasKEY_VALUE_STORE_READS returns a boolean if a field has been set. -func (o *RunUsage) HasKEY_VALUE_STORE_READS() bool { - if o != nil && o.KEY_VALUE_STORE_READS.IsSet() { - return true - } - - return false -} - -// SetKEY_VALUE_STORE_READS gets a reference to the given NullableInt32 and assigns it to the KEY_VALUE_STORE_READS field. -func (o *RunUsage) SetKEY_VALUE_STORE_READS(v int32) { - o.KEY_VALUE_STORE_READS.Set(&v) -} -// SetKEY_VALUE_STORE_READSNil sets the value for KEY_VALUE_STORE_READS to be an explicit nil -func (o *RunUsage) SetKEY_VALUE_STORE_READSNil() { - o.KEY_VALUE_STORE_READS.Set(nil) -} - -// UnsetKEY_VALUE_STORE_READS ensures that no value is present for KEY_VALUE_STORE_READS, not even an explicit nil -func (o *RunUsage) UnsetKEY_VALUE_STORE_READS() { - o.KEY_VALUE_STORE_READS.Unset() -} - -// GetKEY_VALUE_STORE_WRITES returns the KEY_VALUE_STORE_WRITES field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *RunUsage) GetKEY_VALUE_STORE_WRITES() int32 { - if o == nil || IsNil(o.KEY_VALUE_STORE_WRITES.Get()) { - var ret int32 - return ret - } - return *o.KEY_VALUE_STORE_WRITES.Get() -} - -// GetKEY_VALUE_STORE_WRITESOk returns a tuple with the KEY_VALUE_STORE_WRITES field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *RunUsage) GetKEY_VALUE_STORE_WRITESOk() (*int32, bool) { - if o == nil { - return nil, false - } - return o.KEY_VALUE_STORE_WRITES.Get(), o.KEY_VALUE_STORE_WRITES.IsSet() -} - -// HasKEY_VALUE_STORE_WRITES returns a boolean if a field has been set. -func (o *RunUsage) HasKEY_VALUE_STORE_WRITES() bool { - if o != nil && o.KEY_VALUE_STORE_WRITES.IsSet() { - return true - } - - return false -} - -// SetKEY_VALUE_STORE_WRITES gets a reference to the given NullableInt32 and assigns it to the KEY_VALUE_STORE_WRITES field. -func (o *RunUsage) SetKEY_VALUE_STORE_WRITES(v int32) { - o.KEY_VALUE_STORE_WRITES.Set(&v) -} -// SetKEY_VALUE_STORE_WRITESNil sets the value for KEY_VALUE_STORE_WRITES to be an explicit nil -func (o *RunUsage) SetKEY_VALUE_STORE_WRITESNil() { - o.KEY_VALUE_STORE_WRITES.Set(nil) -} - -// UnsetKEY_VALUE_STORE_WRITES ensures that no value is present for KEY_VALUE_STORE_WRITES, not even an explicit nil -func (o *RunUsage) UnsetKEY_VALUE_STORE_WRITES() { - o.KEY_VALUE_STORE_WRITES.Unset() -} - -// GetKEY_VALUE_STORE_LISTS returns the KEY_VALUE_STORE_LISTS field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *RunUsage) GetKEY_VALUE_STORE_LISTS() int32 { - if o == nil || IsNil(o.KEY_VALUE_STORE_LISTS.Get()) { - var ret int32 - return ret - } - return *o.KEY_VALUE_STORE_LISTS.Get() -} - -// GetKEY_VALUE_STORE_LISTSOk returns a tuple with the KEY_VALUE_STORE_LISTS field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *RunUsage) GetKEY_VALUE_STORE_LISTSOk() (*int32, bool) { - if o == nil { - return nil, false - } - return o.KEY_VALUE_STORE_LISTS.Get(), o.KEY_VALUE_STORE_LISTS.IsSet() -} - -// HasKEY_VALUE_STORE_LISTS returns a boolean if a field has been set. -func (o *RunUsage) HasKEY_VALUE_STORE_LISTS() bool { - if o != nil && o.KEY_VALUE_STORE_LISTS.IsSet() { - return true - } - - return false -} - -// SetKEY_VALUE_STORE_LISTS gets a reference to the given NullableInt32 and assigns it to the KEY_VALUE_STORE_LISTS field. -func (o *RunUsage) SetKEY_VALUE_STORE_LISTS(v int32) { - o.KEY_VALUE_STORE_LISTS.Set(&v) -} -// SetKEY_VALUE_STORE_LISTSNil sets the value for KEY_VALUE_STORE_LISTS to be an explicit nil -func (o *RunUsage) SetKEY_VALUE_STORE_LISTSNil() { - o.KEY_VALUE_STORE_LISTS.Set(nil) -} - -// UnsetKEY_VALUE_STORE_LISTS ensures that no value is present for KEY_VALUE_STORE_LISTS, not even an explicit nil -func (o *RunUsage) UnsetKEY_VALUE_STORE_LISTS() { - o.KEY_VALUE_STORE_LISTS.Unset() -} - -// GetREQUEST_QUEUE_READS returns the REQUEST_QUEUE_READS field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *RunUsage) GetREQUEST_QUEUE_READS() int32 { - if o == nil || IsNil(o.REQUEST_QUEUE_READS.Get()) { - var ret int32 - return ret - } - return *o.REQUEST_QUEUE_READS.Get() -} - -// GetREQUEST_QUEUE_READSOk returns a tuple with the REQUEST_QUEUE_READS field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *RunUsage) GetREQUEST_QUEUE_READSOk() (*int32, bool) { - if o == nil { - return nil, false - } - return o.REQUEST_QUEUE_READS.Get(), o.REQUEST_QUEUE_READS.IsSet() -} - -// HasREQUEST_QUEUE_READS returns a boolean if a field has been set. -func (o *RunUsage) HasREQUEST_QUEUE_READS() bool { - if o != nil && o.REQUEST_QUEUE_READS.IsSet() { - return true - } - - return false -} - -// SetREQUEST_QUEUE_READS gets a reference to the given NullableInt32 and assigns it to the REQUEST_QUEUE_READS field. -func (o *RunUsage) SetREQUEST_QUEUE_READS(v int32) { - o.REQUEST_QUEUE_READS.Set(&v) -} -// SetREQUEST_QUEUE_READSNil sets the value for REQUEST_QUEUE_READS to be an explicit nil -func (o *RunUsage) SetREQUEST_QUEUE_READSNil() { - o.REQUEST_QUEUE_READS.Set(nil) -} - -// UnsetREQUEST_QUEUE_READS ensures that no value is present for REQUEST_QUEUE_READS, not even an explicit nil -func (o *RunUsage) UnsetREQUEST_QUEUE_READS() { - o.REQUEST_QUEUE_READS.Unset() -} - -// GetREQUEST_QUEUE_WRITES returns the REQUEST_QUEUE_WRITES field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *RunUsage) GetREQUEST_QUEUE_WRITES() int32 { - if o == nil || IsNil(o.REQUEST_QUEUE_WRITES.Get()) { - var ret int32 - return ret - } - return *o.REQUEST_QUEUE_WRITES.Get() -} - -// GetREQUEST_QUEUE_WRITESOk returns a tuple with the REQUEST_QUEUE_WRITES field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *RunUsage) GetREQUEST_QUEUE_WRITESOk() (*int32, bool) { - if o == nil { - return nil, false - } - return o.REQUEST_QUEUE_WRITES.Get(), o.REQUEST_QUEUE_WRITES.IsSet() -} - -// HasREQUEST_QUEUE_WRITES returns a boolean if a field has been set. -func (o *RunUsage) HasREQUEST_QUEUE_WRITES() bool { - if o != nil && o.REQUEST_QUEUE_WRITES.IsSet() { - return true - } - - return false -} - -// SetREQUEST_QUEUE_WRITES gets a reference to the given NullableInt32 and assigns it to the REQUEST_QUEUE_WRITES field. -func (o *RunUsage) SetREQUEST_QUEUE_WRITES(v int32) { - o.REQUEST_QUEUE_WRITES.Set(&v) -} -// SetREQUEST_QUEUE_WRITESNil sets the value for REQUEST_QUEUE_WRITES to be an explicit nil -func (o *RunUsage) SetREQUEST_QUEUE_WRITESNil() { - o.REQUEST_QUEUE_WRITES.Set(nil) -} - -// UnsetREQUEST_QUEUE_WRITES ensures that no value is present for REQUEST_QUEUE_WRITES, not even an explicit nil -func (o *RunUsage) UnsetREQUEST_QUEUE_WRITES() { - o.REQUEST_QUEUE_WRITES.Unset() -} - -// GetDATA_TRANSFER_INTERNAL_GBYTES returns the DATA_TRANSFER_INTERNAL_GBYTES field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *RunUsage) GetDATA_TRANSFER_INTERNAL_GBYTES() float32 { - if o == nil || IsNil(o.DATA_TRANSFER_INTERNAL_GBYTES.Get()) { - var ret float32 - return ret - } - return *o.DATA_TRANSFER_INTERNAL_GBYTES.Get() -} - -// GetDATA_TRANSFER_INTERNAL_GBYTESOk returns a tuple with the DATA_TRANSFER_INTERNAL_GBYTES field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *RunUsage) GetDATA_TRANSFER_INTERNAL_GBYTESOk() (*float32, bool) { - if o == nil { - return nil, false - } - return o.DATA_TRANSFER_INTERNAL_GBYTES.Get(), o.DATA_TRANSFER_INTERNAL_GBYTES.IsSet() -} - -// HasDATA_TRANSFER_INTERNAL_GBYTES returns a boolean if a field has been set. -func (o *RunUsage) HasDATA_TRANSFER_INTERNAL_GBYTES() bool { - if o != nil && o.DATA_TRANSFER_INTERNAL_GBYTES.IsSet() { - return true - } - - return false -} - -// SetDATA_TRANSFER_INTERNAL_GBYTES gets a reference to the given NullableFloat32 and assigns it to the DATA_TRANSFER_INTERNAL_GBYTES field. -func (o *RunUsage) SetDATA_TRANSFER_INTERNAL_GBYTES(v float32) { - o.DATA_TRANSFER_INTERNAL_GBYTES.Set(&v) -} -// SetDATA_TRANSFER_INTERNAL_GBYTESNil sets the value for DATA_TRANSFER_INTERNAL_GBYTES to be an explicit nil -func (o *RunUsage) SetDATA_TRANSFER_INTERNAL_GBYTESNil() { - o.DATA_TRANSFER_INTERNAL_GBYTES.Set(nil) -} - -// UnsetDATA_TRANSFER_INTERNAL_GBYTES ensures that no value is present for DATA_TRANSFER_INTERNAL_GBYTES, not even an explicit nil -func (o *RunUsage) UnsetDATA_TRANSFER_INTERNAL_GBYTES() { - o.DATA_TRANSFER_INTERNAL_GBYTES.Unset() -} - -// GetDATA_TRANSFER_EXTERNAL_GBYTES returns the DATA_TRANSFER_EXTERNAL_GBYTES field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *RunUsage) GetDATA_TRANSFER_EXTERNAL_GBYTES() float32 { - if o == nil || IsNil(o.DATA_TRANSFER_EXTERNAL_GBYTES.Get()) { - var ret float32 - return ret - } - return *o.DATA_TRANSFER_EXTERNAL_GBYTES.Get() -} - -// GetDATA_TRANSFER_EXTERNAL_GBYTESOk returns a tuple with the DATA_TRANSFER_EXTERNAL_GBYTES field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *RunUsage) GetDATA_TRANSFER_EXTERNAL_GBYTESOk() (*float32, bool) { - if o == nil { - return nil, false - } - return o.DATA_TRANSFER_EXTERNAL_GBYTES.Get(), o.DATA_TRANSFER_EXTERNAL_GBYTES.IsSet() -} - -// HasDATA_TRANSFER_EXTERNAL_GBYTES returns a boolean if a field has been set. -func (o *RunUsage) HasDATA_TRANSFER_EXTERNAL_GBYTES() bool { - if o != nil && o.DATA_TRANSFER_EXTERNAL_GBYTES.IsSet() { - return true - } - - return false -} - -// SetDATA_TRANSFER_EXTERNAL_GBYTES gets a reference to the given NullableFloat32 and assigns it to the DATA_TRANSFER_EXTERNAL_GBYTES field. -func (o *RunUsage) SetDATA_TRANSFER_EXTERNAL_GBYTES(v float32) { - o.DATA_TRANSFER_EXTERNAL_GBYTES.Set(&v) -} -// SetDATA_TRANSFER_EXTERNAL_GBYTESNil sets the value for DATA_TRANSFER_EXTERNAL_GBYTES to be an explicit nil -func (o *RunUsage) SetDATA_TRANSFER_EXTERNAL_GBYTESNil() { - o.DATA_TRANSFER_EXTERNAL_GBYTES.Set(nil) -} - -// UnsetDATA_TRANSFER_EXTERNAL_GBYTES ensures that no value is present for DATA_TRANSFER_EXTERNAL_GBYTES, not even an explicit nil -func (o *RunUsage) UnsetDATA_TRANSFER_EXTERNAL_GBYTES() { - o.DATA_TRANSFER_EXTERNAL_GBYTES.Unset() -} - -// GetPROXY_RESIDENTIAL_TRANSFER_GBYTES returns the PROXY_RESIDENTIAL_TRANSFER_GBYTES field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *RunUsage) GetPROXY_RESIDENTIAL_TRANSFER_GBYTES() float32 { - if o == nil || IsNil(o.PROXY_RESIDENTIAL_TRANSFER_GBYTES.Get()) { - var ret float32 - return ret - } - return *o.PROXY_RESIDENTIAL_TRANSFER_GBYTES.Get() -} - -// GetPROXY_RESIDENTIAL_TRANSFER_GBYTESOk returns a tuple with the PROXY_RESIDENTIAL_TRANSFER_GBYTES field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *RunUsage) GetPROXY_RESIDENTIAL_TRANSFER_GBYTESOk() (*float32, bool) { - if o == nil { - return nil, false - } - return o.PROXY_RESIDENTIAL_TRANSFER_GBYTES.Get(), o.PROXY_RESIDENTIAL_TRANSFER_GBYTES.IsSet() -} - -// HasPROXY_RESIDENTIAL_TRANSFER_GBYTES returns a boolean if a field has been set. -func (o *RunUsage) HasPROXY_RESIDENTIAL_TRANSFER_GBYTES() bool { - if o != nil && o.PROXY_RESIDENTIAL_TRANSFER_GBYTES.IsSet() { - return true - } - - return false -} - -// SetPROXY_RESIDENTIAL_TRANSFER_GBYTES gets a reference to the given NullableFloat32 and assigns it to the PROXY_RESIDENTIAL_TRANSFER_GBYTES field. -func (o *RunUsage) SetPROXY_RESIDENTIAL_TRANSFER_GBYTES(v float32) { - o.PROXY_RESIDENTIAL_TRANSFER_GBYTES.Set(&v) -} -// SetPROXY_RESIDENTIAL_TRANSFER_GBYTESNil sets the value for PROXY_RESIDENTIAL_TRANSFER_GBYTES to be an explicit nil -func (o *RunUsage) SetPROXY_RESIDENTIAL_TRANSFER_GBYTESNil() { - o.PROXY_RESIDENTIAL_TRANSFER_GBYTES.Set(nil) -} - -// UnsetPROXY_RESIDENTIAL_TRANSFER_GBYTES ensures that no value is present for PROXY_RESIDENTIAL_TRANSFER_GBYTES, not even an explicit nil -func (o *RunUsage) UnsetPROXY_RESIDENTIAL_TRANSFER_GBYTES() { - o.PROXY_RESIDENTIAL_TRANSFER_GBYTES.Unset() -} - -// GetPROXY_SERPS returns the PROXY_SERPS field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *RunUsage) GetPROXY_SERPS() int32 { - if o == nil || IsNil(o.PROXY_SERPS.Get()) { - var ret int32 - return ret - } - return *o.PROXY_SERPS.Get() -} - -// GetPROXY_SERPSOk returns a tuple with the PROXY_SERPS field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *RunUsage) GetPROXY_SERPSOk() (*int32, bool) { - if o == nil { - return nil, false - } - return o.PROXY_SERPS.Get(), o.PROXY_SERPS.IsSet() -} - -// HasPROXY_SERPS returns a boolean if a field has been set. -func (o *RunUsage) HasPROXY_SERPS() bool { - if o != nil && o.PROXY_SERPS.IsSet() { - return true - } - - return false -} - -// SetPROXY_SERPS gets a reference to the given NullableInt32 and assigns it to the PROXY_SERPS field. -func (o *RunUsage) SetPROXY_SERPS(v int32) { - o.PROXY_SERPS.Set(&v) -} -// SetPROXY_SERPSNil sets the value for PROXY_SERPS to be an explicit nil -func (o *RunUsage) SetPROXY_SERPSNil() { - o.PROXY_SERPS.Set(nil) -} - -// UnsetPROXY_SERPS ensures that no value is present for PROXY_SERPS, not even an explicit nil -func (o *RunUsage) UnsetPROXY_SERPS() { - o.PROXY_SERPS.Unset() -} - -func (o RunUsage) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o RunUsage) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if o.ACTOR_COMPUTE_UNITS.IsSet() { - toSerialize["ACTOR_COMPUTE_UNITS"] = o.ACTOR_COMPUTE_UNITS.Get() - } - if o.DATASET_READS.IsSet() { - toSerialize["DATASET_READS"] = o.DATASET_READS.Get() - } - if o.DATASET_WRITES.IsSet() { - toSerialize["DATASET_WRITES"] = o.DATASET_WRITES.Get() - } - if o.KEY_VALUE_STORE_READS.IsSet() { - toSerialize["KEY_VALUE_STORE_READS"] = o.KEY_VALUE_STORE_READS.Get() - } - if o.KEY_VALUE_STORE_WRITES.IsSet() { - toSerialize["KEY_VALUE_STORE_WRITES"] = o.KEY_VALUE_STORE_WRITES.Get() - } - if o.KEY_VALUE_STORE_LISTS.IsSet() { - toSerialize["KEY_VALUE_STORE_LISTS"] = o.KEY_VALUE_STORE_LISTS.Get() - } - if o.REQUEST_QUEUE_READS.IsSet() { - toSerialize["REQUEST_QUEUE_READS"] = o.REQUEST_QUEUE_READS.Get() - } - if o.REQUEST_QUEUE_WRITES.IsSet() { - toSerialize["REQUEST_QUEUE_WRITES"] = o.REQUEST_QUEUE_WRITES.Get() - } - if o.DATA_TRANSFER_INTERNAL_GBYTES.IsSet() { - toSerialize["DATA_TRANSFER_INTERNAL_GBYTES"] = o.DATA_TRANSFER_INTERNAL_GBYTES.Get() - } - if o.DATA_TRANSFER_EXTERNAL_GBYTES.IsSet() { - toSerialize["DATA_TRANSFER_EXTERNAL_GBYTES"] = o.DATA_TRANSFER_EXTERNAL_GBYTES.Get() - } - if o.PROXY_RESIDENTIAL_TRANSFER_GBYTES.IsSet() { - toSerialize["PROXY_RESIDENTIAL_TRANSFER_GBYTES"] = o.PROXY_RESIDENTIAL_TRANSFER_GBYTES.Get() - } - if o.PROXY_SERPS.IsSet() { - toSerialize["PROXY_SERPS"] = o.PROXY_SERPS.Get() - } - return toSerialize, nil -} - -type NullableRunUsage struct { - value *RunUsage - isSet bool -} - -func (v NullableRunUsage) Get() *RunUsage { - return v.value -} - -func (v *NullableRunUsage) Set(val *RunUsage) { - v.value = val - v.isSet = true -} - -func (v NullableRunUsage) IsSet() bool { - return v.isSet -} - -func (v *NullableRunUsage) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableRunUsage(val *RunUsage) *NullableRunUsage { - return &NullableRunUsage{value: val, isSet: true} -} - -func (v NullableRunUsage) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableRunUsage) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_run_usage_usd.go b/model_run_usage_usd.go deleted file mode 100644 index 100eb02..0000000 --- a/model_run_usage_usd.go +++ /dev/null @@ -1,642 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" -) - -// checks if the RunUsageUsd type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &RunUsageUsd{} - -// RunUsageUsd Resource usage costs in USD. All values are monetary amounts in US dollars. -type RunUsageUsd struct { - ACTOR_COMPUTE_UNITS NullableFloat32 `json:"ACTOR_COMPUTE_UNITS,omitempty"` - DATASET_READS NullableFloat32 `json:"DATASET_READS,omitempty"` - DATASET_WRITES NullableFloat32 `json:"DATASET_WRITES,omitempty"` - KEY_VALUE_STORE_READS NullableFloat32 `json:"KEY_VALUE_STORE_READS,omitempty"` - KEY_VALUE_STORE_WRITES NullableFloat32 `json:"KEY_VALUE_STORE_WRITES,omitempty"` - KEY_VALUE_STORE_LISTS NullableFloat32 `json:"KEY_VALUE_STORE_LISTS,omitempty"` - REQUEST_QUEUE_READS NullableFloat32 `json:"REQUEST_QUEUE_READS,omitempty"` - REQUEST_QUEUE_WRITES NullableFloat32 `json:"REQUEST_QUEUE_WRITES,omitempty"` - DATA_TRANSFER_INTERNAL_GBYTES NullableFloat32 `json:"DATA_TRANSFER_INTERNAL_GBYTES,omitempty"` - DATA_TRANSFER_EXTERNAL_GBYTES NullableFloat32 `json:"DATA_TRANSFER_EXTERNAL_GBYTES,omitempty"` - PROXY_RESIDENTIAL_TRANSFER_GBYTES NullableFloat32 `json:"PROXY_RESIDENTIAL_TRANSFER_GBYTES,omitempty"` - PROXY_SERPS NullableFloat32 `json:"PROXY_SERPS,omitempty"` -} - -// NewRunUsageUsd instantiates a new RunUsageUsd object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewRunUsageUsd() *RunUsageUsd { - this := RunUsageUsd{} - return &this -} - -// NewRunUsageUsdWithDefaults instantiates a new RunUsageUsd object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewRunUsageUsdWithDefaults() *RunUsageUsd { - this := RunUsageUsd{} - return &this -} - -// GetACTOR_COMPUTE_UNITS returns the ACTOR_COMPUTE_UNITS field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *RunUsageUsd) GetACTOR_COMPUTE_UNITS() float32 { - if o == nil || IsNil(o.ACTOR_COMPUTE_UNITS.Get()) { - var ret float32 - return ret - } - return *o.ACTOR_COMPUTE_UNITS.Get() -} - -// GetACTOR_COMPUTE_UNITSOk returns a tuple with the ACTOR_COMPUTE_UNITS field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *RunUsageUsd) GetACTOR_COMPUTE_UNITSOk() (*float32, bool) { - if o == nil { - return nil, false - } - return o.ACTOR_COMPUTE_UNITS.Get(), o.ACTOR_COMPUTE_UNITS.IsSet() -} - -// HasACTOR_COMPUTE_UNITS returns a boolean if a field has been set. -func (o *RunUsageUsd) HasACTOR_COMPUTE_UNITS() bool { - if o != nil && o.ACTOR_COMPUTE_UNITS.IsSet() { - return true - } - - return false -} - -// SetACTOR_COMPUTE_UNITS gets a reference to the given NullableFloat32 and assigns it to the ACTOR_COMPUTE_UNITS field. -func (o *RunUsageUsd) SetACTOR_COMPUTE_UNITS(v float32) { - o.ACTOR_COMPUTE_UNITS.Set(&v) -} -// SetACTOR_COMPUTE_UNITSNil sets the value for ACTOR_COMPUTE_UNITS to be an explicit nil -func (o *RunUsageUsd) SetACTOR_COMPUTE_UNITSNil() { - o.ACTOR_COMPUTE_UNITS.Set(nil) -} - -// UnsetACTOR_COMPUTE_UNITS ensures that no value is present for ACTOR_COMPUTE_UNITS, not even an explicit nil -func (o *RunUsageUsd) UnsetACTOR_COMPUTE_UNITS() { - o.ACTOR_COMPUTE_UNITS.Unset() -} - -// GetDATASET_READS returns the DATASET_READS field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *RunUsageUsd) GetDATASET_READS() float32 { - if o == nil || IsNil(o.DATASET_READS.Get()) { - var ret float32 - return ret - } - return *o.DATASET_READS.Get() -} - -// GetDATASET_READSOk returns a tuple with the DATASET_READS field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *RunUsageUsd) GetDATASET_READSOk() (*float32, bool) { - if o == nil { - return nil, false - } - return o.DATASET_READS.Get(), o.DATASET_READS.IsSet() -} - -// HasDATASET_READS returns a boolean if a field has been set. -func (o *RunUsageUsd) HasDATASET_READS() bool { - if o != nil && o.DATASET_READS.IsSet() { - return true - } - - return false -} - -// SetDATASET_READS gets a reference to the given NullableFloat32 and assigns it to the DATASET_READS field. -func (o *RunUsageUsd) SetDATASET_READS(v float32) { - o.DATASET_READS.Set(&v) -} -// SetDATASET_READSNil sets the value for DATASET_READS to be an explicit nil -func (o *RunUsageUsd) SetDATASET_READSNil() { - o.DATASET_READS.Set(nil) -} - -// UnsetDATASET_READS ensures that no value is present for DATASET_READS, not even an explicit nil -func (o *RunUsageUsd) UnsetDATASET_READS() { - o.DATASET_READS.Unset() -} - -// GetDATASET_WRITES returns the DATASET_WRITES field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *RunUsageUsd) GetDATASET_WRITES() float32 { - if o == nil || IsNil(o.DATASET_WRITES.Get()) { - var ret float32 - return ret - } - return *o.DATASET_WRITES.Get() -} - -// GetDATASET_WRITESOk returns a tuple with the DATASET_WRITES field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *RunUsageUsd) GetDATASET_WRITESOk() (*float32, bool) { - if o == nil { - return nil, false - } - return o.DATASET_WRITES.Get(), o.DATASET_WRITES.IsSet() -} - -// HasDATASET_WRITES returns a boolean if a field has been set. -func (o *RunUsageUsd) HasDATASET_WRITES() bool { - if o != nil && o.DATASET_WRITES.IsSet() { - return true - } - - return false -} - -// SetDATASET_WRITES gets a reference to the given NullableFloat32 and assigns it to the DATASET_WRITES field. -func (o *RunUsageUsd) SetDATASET_WRITES(v float32) { - o.DATASET_WRITES.Set(&v) -} -// SetDATASET_WRITESNil sets the value for DATASET_WRITES to be an explicit nil -func (o *RunUsageUsd) SetDATASET_WRITESNil() { - o.DATASET_WRITES.Set(nil) -} - -// UnsetDATASET_WRITES ensures that no value is present for DATASET_WRITES, not even an explicit nil -func (o *RunUsageUsd) UnsetDATASET_WRITES() { - o.DATASET_WRITES.Unset() -} - -// GetKEY_VALUE_STORE_READS returns the KEY_VALUE_STORE_READS field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *RunUsageUsd) GetKEY_VALUE_STORE_READS() float32 { - if o == nil || IsNil(o.KEY_VALUE_STORE_READS.Get()) { - var ret float32 - return ret - } - return *o.KEY_VALUE_STORE_READS.Get() -} - -// GetKEY_VALUE_STORE_READSOk returns a tuple with the KEY_VALUE_STORE_READS field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *RunUsageUsd) GetKEY_VALUE_STORE_READSOk() (*float32, bool) { - if o == nil { - return nil, false - } - return o.KEY_VALUE_STORE_READS.Get(), o.KEY_VALUE_STORE_READS.IsSet() -} - -// HasKEY_VALUE_STORE_READS returns a boolean if a field has been set. -func (o *RunUsageUsd) HasKEY_VALUE_STORE_READS() bool { - if o != nil && o.KEY_VALUE_STORE_READS.IsSet() { - return true - } - - return false -} - -// SetKEY_VALUE_STORE_READS gets a reference to the given NullableFloat32 and assigns it to the KEY_VALUE_STORE_READS field. -func (o *RunUsageUsd) SetKEY_VALUE_STORE_READS(v float32) { - o.KEY_VALUE_STORE_READS.Set(&v) -} -// SetKEY_VALUE_STORE_READSNil sets the value for KEY_VALUE_STORE_READS to be an explicit nil -func (o *RunUsageUsd) SetKEY_VALUE_STORE_READSNil() { - o.KEY_VALUE_STORE_READS.Set(nil) -} - -// UnsetKEY_VALUE_STORE_READS ensures that no value is present for KEY_VALUE_STORE_READS, not even an explicit nil -func (o *RunUsageUsd) UnsetKEY_VALUE_STORE_READS() { - o.KEY_VALUE_STORE_READS.Unset() -} - -// GetKEY_VALUE_STORE_WRITES returns the KEY_VALUE_STORE_WRITES field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *RunUsageUsd) GetKEY_VALUE_STORE_WRITES() float32 { - if o == nil || IsNil(o.KEY_VALUE_STORE_WRITES.Get()) { - var ret float32 - return ret - } - return *o.KEY_VALUE_STORE_WRITES.Get() -} - -// GetKEY_VALUE_STORE_WRITESOk returns a tuple with the KEY_VALUE_STORE_WRITES field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *RunUsageUsd) GetKEY_VALUE_STORE_WRITESOk() (*float32, bool) { - if o == nil { - return nil, false - } - return o.KEY_VALUE_STORE_WRITES.Get(), o.KEY_VALUE_STORE_WRITES.IsSet() -} - -// HasKEY_VALUE_STORE_WRITES returns a boolean if a field has been set. -func (o *RunUsageUsd) HasKEY_VALUE_STORE_WRITES() bool { - if o != nil && o.KEY_VALUE_STORE_WRITES.IsSet() { - return true - } - - return false -} - -// SetKEY_VALUE_STORE_WRITES gets a reference to the given NullableFloat32 and assigns it to the KEY_VALUE_STORE_WRITES field. -func (o *RunUsageUsd) SetKEY_VALUE_STORE_WRITES(v float32) { - o.KEY_VALUE_STORE_WRITES.Set(&v) -} -// SetKEY_VALUE_STORE_WRITESNil sets the value for KEY_VALUE_STORE_WRITES to be an explicit nil -func (o *RunUsageUsd) SetKEY_VALUE_STORE_WRITESNil() { - o.KEY_VALUE_STORE_WRITES.Set(nil) -} - -// UnsetKEY_VALUE_STORE_WRITES ensures that no value is present for KEY_VALUE_STORE_WRITES, not even an explicit nil -func (o *RunUsageUsd) UnsetKEY_VALUE_STORE_WRITES() { - o.KEY_VALUE_STORE_WRITES.Unset() -} - -// GetKEY_VALUE_STORE_LISTS returns the KEY_VALUE_STORE_LISTS field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *RunUsageUsd) GetKEY_VALUE_STORE_LISTS() float32 { - if o == nil || IsNil(o.KEY_VALUE_STORE_LISTS.Get()) { - var ret float32 - return ret - } - return *o.KEY_VALUE_STORE_LISTS.Get() -} - -// GetKEY_VALUE_STORE_LISTSOk returns a tuple with the KEY_VALUE_STORE_LISTS field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *RunUsageUsd) GetKEY_VALUE_STORE_LISTSOk() (*float32, bool) { - if o == nil { - return nil, false - } - return o.KEY_VALUE_STORE_LISTS.Get(), o.KEY_VALUE_STORE_LISTS.IsSet() -} - -// HasKEY_VALUE_STORE_LISTS returns a boolean if a field has been set. -func (o *RunUsageUsd) HasKEY_VALUE_STORE_LISTS() bool { - if o != nil && o.KEY_VALUE_STORE_LISTS.IsSet() { - return true - } - - return false -} - -// SetKEY_VALUE_STORE_LISTS gets a reference to the given NullableFloat32 and assigns it to the KEY_VALUE_STORE_LISTS field. -func (o *RunUsageUsd) SetKEY_VALUE_STORE_LISTS(v float32) { - o.KEY_VALUE_STORE_LISTS.Set(&v) -} -// SetKEY_VALUE_STORE_LISTSNil sets the value for KEY_VALUE_STORE_LISTS to be an explicit nil -func (o *RunUsageUsd) SetKEY_VALUE_STORE_LISTSNil() { - o.KEY_VALUE_STORE_LISTS.Set(nil) -} - -// UnsetKEY_VALUE_STORE_LISTS ensures that no value is present for KEY_VALUE_STORE_LISTS, not even an explicit nil -func (o *RunUsageUsd) UnsetKEY_VALUE_STORE_LISTS() { - o.KEY_VALUE_STORE_LISTS.Unset() -} - -// GetREQUEST_QUEUE_READS returns the REQUEST_QUEUE_READS field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *RunUsageUsd) GetREQUEST_QUEUE_READS() float32 { - if o == nil || IsNil(o.REQUEST_QUEUE_READS.Get()) { - var ret float32 - return ret - } - return *o.REQUEST_QUEUE_READS.Get() -} - -// GetREQUEST_QUEUE_READSOk returns a tuple with the REQUEST_QUEUE_READS field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *RunUsageUsd) GetREQUEST_QUEUE_READSOk() (*float32, bool) { - if o == nil { - return nil, false - } - return o.REQUEST_QUEUE_READS.Get(), o.REQUEST_QUEUE_READS.IsSet() -} - -// HasREQUEST_QUEUE_READS returns a boolean if a field has been set. -func (o *RunUsageUsd) HasREQUEST_QUEUE_READS() bool { - if o != nil && o.REQUEST_QUEUE_READS.IsSet() { - return true - } - - return false -} - -// SetREQUEST_QUEUE_READS gets a reference to the given NullableFloat32 and assigns it to the REQUEST_QUEUE_READS field. -func (o *RunUsageUsd) SetREQUEST_QUEUE_READS(v float32) { - o.REQUEST_QUEUE_READS.Set(&v) -} -// SetREQUEST_QUEUE_READSNil sets the value for REQUEST_QUEUE_READS to be an explicit nil -func (o *RunUsageUsd) SetREQUEST_QUEUE_READSNil() { - o.REQUEST_QUEUE_READS.Set(nil) -} - -// UnsetREQUEST_QUEUE_READS ensures that no value is present for REQUEST_QUEUE_READS, not even an explicit nil -func (o *RunUsageUsd) UnsetREQUEST_QUEUE_READS() { - o.REQUEST_QUEUE_READS.Unset() -} - -// GetREQUEST_QUEUE_WRITES returns the REQUEST_QUEUE_WRITES field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *RunUsageUsd) GetREQUEST_QUEUE_WRITES() float32 { - if o == nil || IsNil(o.REQUEST_QUEUE_WRITES.Get()) { - var ret float32 - return ret - } - return *o.REQUEST_QUEUE_WRITES.Get() -} - -// GetREQUEST_QUEUE_WRITESOk returns a tuple with the REQUEST_QUEUE_WRITES field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *RunUsageUsd) GetREQUEST_QUEUE_WRITESOk() (*float32, bool) { - if o == nil { - return nil, false - } - return o.REQUEST_QUEUE_WRITES.Get(), o.REQUEST_QUEUE_WRITES.IsSet() -} - -// HasREQUEST_QUEUE_WRITES returns a boolean if a field has been set. -func (o *RunUsageUsd) HasREQUEST_QUEUE_WRITES() bool { - if o != nil && o.REQUEST_QUEUE_WRITES.IsSet() { - return true - } - - return false -} - -// SetREQUEST_QUEUE_WRITES gets a reference to the given NullableFloat32 and assigns it to the REQUEST_QUEUE_WRITES field. -func (o *RunUsageUsd) SetREQUEST_QUEUE_WRITES(v float32) { - o.REQUEST_QUEUE_WRITES.Set(&v) -} -// SetREQUEST_QUEUE_WRITESNil sets the value for REQUEST_QUEUE_WRITES to be an explicit nil -func (o *RunUsageUsd) SetREQUEST_QUEUE_WRITESNil() { - o.REQUEST_QUEUE_WRITES.Set(nil) -} - -// UnsetREQUEST_QUEUE_WRITES ensures that no value is present for REQUEST_QUEUE_WRITES, not even an explicit nil -func (o *RunUsageUsd) UnsetREQUEST_QUEUE_WRITES() { - o.REQUEST_QUEUE_WRITES.Unset() -} - -// GetDATA_TRANSFER_INTERNAL_GBYTES returns the DATA_TRANSFER_INTERNAL_GBYTES field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *RunUsageUsd) GetDATA_TRANSFER_INTERNAL_GBYTES() float32 { - if o == nil || IsNil(o.DATA_TRANSFER_INTERNAL_GBYTES.Get()) { - var ret float32 - return ret - } - return *o.DATA_TRANSFER_INTERNAL_GBYTES.Get() -} - -// GetDATA_TRANSFER_INTERNAL_GBYTESOk returns a tuple with the DATA_TRANSFER_INTERNAL_GBYTES field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *RunUsageUsd) GetDATA_TRANSFER_INTERNAL_GBYTESOk() (*float32, bool) { - if o == nil { - return nil, false - } - return o.DATA_TRANSFER_INTERNAL_GBYTES.Get(), o.DATA_TRANSFER_INTERNAL_GBYTES.IsSet() -} - -// HasDATA_TRANSFER_INTERNAL_GBYTES returns a boolean if a field has been set. -func (o *RunUsageUsd) HasDATA_TRANSFER_INTERNAL_GBYTES() bool { - if o != nil && o.DATA_TRANSFER_INTERNAL_GBYTES.IsSet() { - return true - } - - return false -} - -// SetDATA_TRANSFER_INTERNAL_GBYTES gets a reference to the given NullableFloat32 and assigns it to the DATA_TRANSFER_INTERNAL_GBYTES field. -func (o *RunUsageUsd) SetDATA_TRANSFER_INTERNAL_GBYTES(v float32) { - o.DATA_TRANSFER_INTERNAL_GBYTES.Set(&v) -} -// SetDATA_TRANSFER_INTERNAL_GBYTESNil sets the value for DATA_TRANSFER_INTERNAL_GBYTES to be an explicit nil -func (o *RunUsageUsd) SetDATA_TRANSFER_INTERNAL_GBYTESNil() { - o.DATA_TRANSFER_INTERNAL_GBYTES.Set(nil) -} - -// UnsetDATA_TRANSFER_INTERNAL_GBYTES ensures that no value is present for DATA_TRANSFER_INTERNAL_GBYTES, not even an explicit nil -func (o *RunUsageUsd) UnsetDATA_TRANSFER_INTERNAL_GBYTES() { - o.DATA_TRANSFER_INTERNAL_GBYTES.Unset() -} - -// GetDATA_TRANSFER_EXTERNAL_GBYTES returns the DATA_TRANSFER_EXTERNAL_GBYTES field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *RunUsageUsd) GetDATA_TRANSFER_EXTERNAL_GBYTES() float32 { - if o == nil || IsNil(o.DATA_TRANSFER_EXTERNAL_GBYTES.Get()) { - var ret float32 - return ret - } - return *o.DATA_TRANSFER_EXTERNAL_GBYTES.Get() -} - -// GetDATA_TRANSFER_EXTERNAL_GBYTESOk returns a tuple with the DATA_TRANSFER_EXTERNAL_GBYTES field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *RunUsageUsd) GetDATA_TRANSFER_EXTERNAL_GBYTESOk() (*float32, bool) { - if o == nil { - return nil, false - } - return o.DATA_TRANSFER_EXTERNAL_GBYTES.Get(), o.DATA_TRANSFER_EXTERNAL_GBYTES.IsSet() -} - -// HasDATA_TRANSFER_EXTERNAL_GBYTES returns a boolean if a field has been set. -func (o *RunUsageUsd) HasDATA_TRANSFER_EXTERNAL_GBYTES() bool { - if o != nil && o.DATA_TRANSFER_EXTERNAL_GBYTES.IsSet() { - return true - } - - return false -} - -// SetDATA_TRANSFER_EXTERNAL_GBYTES gets a reference to the given NullableFloat32 and assigns it to the DATA_TRANSFER_EXTERNAL_GBYTES field. -func (o *RunUsageUsd) SetDATA_TRANSFER_EXTERNAL_GBYTES(v float32) { - o.DATA_TRANSFER_EXTERNAL_GBYTES.Set(&v) -} -// SetDATA_TRANSFER_EXTERNAL_GBYTESNil sets the value for DATA_TRANSFER_EXTERNAL_GBYTES to be an explicit nil -func (o *RunUsageUsd) SetDATA_TRANSFER_EXTERNAL_GBYTESNil() { - o.DATA_TRANSFER_EXTERNAL_GBYTES.Set(nil) -} - -// UnsetDATA_TRANSFER_EXTERNAL_GBYTES ensures that no value is present for DATA_TRANSFER_EXTERNAL_GBYTES, not even an explicit nil -func (o *RunUsageUsd) UnsetDATA_TRANSFER_EXTERNAL_GBYTES() { - o.DATA_TRANSFER_EXTERNAL_GBYTES.Unset() -} - -// GetPROXY_RESIDENTIAL_TRANSFER_GBYTES returns the PROXY_RESIDENTIAL_TRANSFER_GBYTES field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *RunUsageUsd) GetPROXY_RESIDENTIAL_TRANSFER_GBYTES() float32 { - if o == nil || IsNil(o.PROXY_RESIDENTIAL_TRANSFER_GBYTES.Get()) { - var ret float32 - return ret - } - return *o.PROXY_RESIDENTIAL_TRANSFER_GBYTES.Get() -} - -// GetPROXY_RESIDENTIAL_TRANSFER_GBYTESOk returns a tuple with the PROXY_RESIDENTIAL_TRANSFER_GBYTES field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *RunUsageUsd) GetPROXY_RESIDENTIAL_TRANSFER_GBYTESOk() (*float32, bool) { - if o == nil { - return nil, false - } - return o.PROXY_RESIDENTIAL_TRANSFER_GBYTES.Get(), o.PROXY_RESIDENTIAL_TRANSFER_GBYTES.IsSet() -} - -// HasPROXY_RESIDENTIAL_TRANSFER_GBYTES returns a boolean if a field has been set. -func (o *RunUsageUsd) HasPROXY_RESIDENTIAL_TRANSFER_GBYTES() bool { - if o != nil && o.PROXY_RESIDENTIAL_TRANSFER_GBYTES.IsSet() { - return true - } - - return false -} - -// SetPROXY_RESIDENTIAL_TRANSFER_GBYTES gets a reference to the given NullableFloat32 and assigns it to the PROXY_RESIDENTIAL_TRANSFER_GBYTES field. -func (o *RunUsageUsd) SetPROXY_RESIDENTIAL_TRANSFER_GBYTES(v float32) { - o.PROXY_RESIDENTIAL_TRANSFER_GBYTES.Set(&v) -} -// SetPROXY_RESIDENTIAL_TRANSFER_GBYTESNil sets the value for PROXY_RESIDENTIAL_TRANSFER_GBYTES to be an explicit nil -func (o *RunUsageUsd) SetPROXY_RESIDENTIAL_TRANSFER_GBYTESNil() { - o.PROXY_RESIDENTIAL_TRANSFER_GBYTES.Set(nil) -} - -// UnsetPROXY_RESIDENTIAL_TRANSFER_GBYTES ensures that no value is present for PROXY_RESIDENTIAL_TRANSFER_GBYTES, not even an explicit nil -func (o *RunUsageUsd) UnsetPROXY_RESIDENTIAL_TRANSFER_GBYTES() { - o.PROXY_RESIDENTIAL_TRANSFER_GBYTES.Unset() -} - -// GetPROXY_SERPS returns the PROXY_SERPS field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *RunUsageUsd) GetPROXY_SERPS() float32 { - if o == nil || IsNil(o.PROXY_SERPS.Get()) { - var ret float32 - return ret - } - return *o.PROXY_SERPS.Get() -} - -// GetPROXY_SERPSOk returns a tuple with the PROXY_SERPS field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *RunUsageUsd) GetPROXY_SERPSOk() (*float32, bool) { - if o == nil { - return nil, false - } - return o.PROXY_SERPS.Get(), o.PROXY_SERPS.IsSet() -} - -// HasPROXY_SERPS returns a boolean if a field has been set. -func (o *RunUsageUsd) HasPROXY_SERPS() bool { - if o != nil && o.PROXY_SERPS.IsSet() { - return true - } - - return false -} - -// SetPROXY_SERPS gets a reference to the given NullableFloat32 and assigns it to the PROXY_SERPS field. -func (o *RunUsageUsd) SetPROXY_SERPS(v float32) { - o.PROXY_SERPS.Set(&v) -} -// SetPROXY_SERPSNil sets the value for PROXY_SERPS to be an explicit nil -func (o *RunUsageUsd) SetPROXY_SERPSNil() { - o.PROXY_SERPS.Set(nil) -} - -// UnsetPROXY_SERPS ensures that no value is present for PROXY_SERPS, not even an explicit nil -func (o *RunUsageUsd) UnsetPROXY_SERPS() { - o.PROXY_SERPS.Unset() -} - -func (o RunUsageUsd) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o RunUsageUsd) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if o.ACTOR_COMPUTE_UNITS.IsSet() { - toSerialize["ACTOR_COMPUTE_UNITS"] = o.ACTOR_COMPUTE_UNITS.Get() - } - if o.DATASET_READS.IsSet() { - toSerialize["DATASET_READS"] = o.DATASET_READS.Get() - } - if o.DATASET_WRITES.IsSet() { - toSerialize["DATASET_WRITES"] = o.DATASET_WRITES.Get() - } - if o.KEY_VALUE_STORE_READS.IsSet() { - toSerialize["KEY_VALUE_STORE_READS"] = o.KEY_VALUE_STORE_READS.Get() - } - if o.KEY_VALUE_STORE_WRITES.IsSet() { - toSerialize["KEY_VALUE_STORE_WRITES"] = o.KEY_VALUE_STORE_WRITES.Get() - } - if o.KEY_VALUE_STORE_LISTS.IsSet() { - toSerialize["KEY_VALUE_STORE_LISTS"] = o.KEY_VALUE_STORE_LISTS.Get() - } - if o.REQUEST_QUEUE_READS.IsSet() { - toSerialize["REQUEST_QUEUE_READS"] = o.REQUEST_QUEUE_READS.Get() - } - if o.REQUEST_QUEUE_WRITES.IsSet() { - toSerialize["REQUEST_QUEUE_WRITES"] = o.REQUEST_QUEUE_WRITES.Get() - } - if o.DATA_TRANSFER_INTERNAL_GBYTES.IsSet() { - toSerialize["DATA_TRANSFER_INTERNAL_GBYTES"] = o.DATA_TRANSFER_INTERNAL_GBYTES.Get() - } - if o.DATA_TRANSFER_EXTERNAL_GBYTES.IsSet() { - toSerialize["DATA_TRANSFER_EXTERNAL_GBYTES"] = o.DATA_TRANSFER_EXTERNAL_GBYTES.Get() - } - if o.PROXY_RESIDENTIAL_TRANSFER_GBYTES.IsSet() { - toSerialize["PROXY_RESIDENTIAL_TRANSFER_GBYTES"] = o.PROXY_RESIDENTIAL_TRANSFER_GBYTES.Get() - } - if o.PROXY_SERPS.IsSet() { - toSerialize["PROXY_SERPS"] = o.PROXY_SERPS.Get() - } - return toSerialize, nil -} - -type NullableRunUsageUsd struct { - value *RunUsageUsd - isSet bool -} - -func (v NullableRunUsageUsd) Get() *RunUsageUsd { - return v.value -} - -func (v *NullableRunUsageUsd) Set(val *RunUsageUsd) { - v.value = val - v.isSet = true -} - -func (v NullableRunUsageUsd) IsSet() bool { - return v.isSet -} - -func (v *NullableRunUsageUsd) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableRunUsageUsd(val *RunUsageUsd) *NullableRunUsageUsd { - return &NullableRunUsageUsd{value: val, isSet: true} -} - -func (v NullableRunUsageUsd) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableRunUsageUsd) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_schedule.go b/model_schedule.go deleted file mode 100644 index 6dd3734..0000000 --- a/model_schedule.go +++ /dev/null @@ -1,612 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" - "time" - "bytes" - "fmt" -) - -// checks if the Schedule type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &Schedule{} - -// Schedule struct for Schedule -type Schedule struct { - Id string `json:"id"` - UserId string `json:"userId"` - Name string `json:"name"` - CronExpression string `json:"cronExpression"` - Timezone string `json:"timezone"` - IsEnabled bool `json:"isEnabled"` - IsExclusive bool `json:"isExclusive"` - CreatedAt time.Time `json:"createdAt"` - ModifiedAt time.Time `json:"modifiedAt"` - NextRunAt *time.Time `json:"nextRunAt,omitempty"` - LastRunAt *time.Time `json:"lastRunAt,omitempty"` - Description NullableString `json:"description,omitempty"` - Title NullableString `json:"title,omitempty"` - Notifications *ScheduleNotifications `json:"notifications,omitempty"` - // - Actions []ScheduleAction `json:"actions"` -} - -type _Schedule Schedule - -// NewSchedule instantiates a new Schedule object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewSchedule(id string, userId string, name string, cronExpression string, timezone string, isEnabled bool, isExclusive bool, createdAt time.Time, modifiedAt time.Time, actions []ScheduleAction) *Schedule { - this := Schedule{} - this.Id = id - this.UserId = userId - this.Name = name - this.CronExpression = cronExpression - this.Timezone = timezone - this.IsEnabled = isEnabled - this.IsExclusive = isExclusive - this.CreatedAt = createdAt - this.ModifiedAt = modifiedAt - this.Actions = actions - return &this -} - -// NewScheduleWithDefaults instantiates a new Schedule object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewScheduleWithDefaults() *Schedule { - this := Schedule{} - return &this -} - -// GetId returns the Id field value -func (o *Schedule) GetId() string { - if o == nil { - var ret string - return ret - } - - return o.Id -} - -// GetIdOk returns a tuple with the Id field value -// and a boolean to check if the value has been set. -func (o *Schedule) GetIdOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Id, true -} - -// SetId sets field value -func (o *Schedule) SetId(v string) { - o.Id = v -} - -// GetUserId returns the UserId field value -func (o *Schedule) GetUserId() string { - if o == nil { - var ret string - return ret - } - - return o.UserId -} - -// GetUserIdOk returns a tuple with the UserId field value -// and a boolean to check if the value has been set. -func (o *Schedule) GetUserIdOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.UserId, true -} - -// SetUserId sets field value -func (o *Schedule) SetUserId(v string) { - o.UserId = v -} - -// GetName returns the Name field value -func (o *Schedule) GetName() string { - if o == nil { - var ret string - return ret - } - - return o.Name -} - -// GetNameOk returns a tuple with the Name field value -// and a boolean to check if the value has been set. -func (o *Schedule) GetNameOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Name, true -} - -// SetName sets field value -func (o *Schedule) SetName(v string) { - o.Name = v -} - -// GetCronExpression returns the CronExpression field value -func (o *Schedule) GetCronExpression() string { - if o == nil { - var ret string - return ret - } - - return o.CronExpression -} - -// GetCronExpressionOk returns a tuple with the CronExpression field value -// and a boolean to check if the value has been set. -func (o *Schedule) GetCronExpressionOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.CronExpression, true -} - -// SetCronExpression sets field value -func (o *Schedule) SetCronExpression(v string) { - o.CronExpression = v -} - -// GetTimezone returns the Timezone field value -func (o *Schedule) GetTimezone() string { - if o == nil { - var ret string - return ret - } - - return o.Timezone -} - -// GetTimezoneOk returns a tuple with the Timezone field value -// and a boolean to check if the value has been set. -func (o *Schedule) GetTimezoneOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Timezone, true -} - -// SetTimezone sets field value -func (o *Schedule) SetTimezone(v string) { - o.Timezone = v -} - -// GetIsEnabled returns the IsEnabled field value -func (o *Schedule) GetIsEnabled() bool { - if o == nil { - var ret bool - return ret - } - - return o.IsEnabled -} - -// GetIsEnabledOk returns a tuple with the IsEnabled field value -// and a boolean to check if the value has been set. -func (o *Schedule) GetIsEnabledOk() (*bool, bool) { - if o == nil { - return nil, false - } - return &o.IsEnabled, true -} - -// SetIsEnabled sets field value -func (o *Schedule) SetIsEnabled(v bool) { - o.IsEnabled = v -} - -// GetIsExclusive returns the IsExclusive field value -func (o *Schedule) GetIsExclusive() bool { - if o == nil { - var ret bool - return ret - } - - return o.IsExclusive -} - -// GetIsExclusiveOk returns a tuple with the IsExclusive field value -// and a boolean to check if the value has been set. -func (o *Schedule) GetIsExclusiveOk() (*bool, bool) { - if o == nil { - return nil, false - } - return &o.IsExclusive, true -} - -// SetIsExclusive sets field value -func (o *Schedule) SetIsExclusive(v bool) { - o.IsExclusive = v -} - -// GetCreatedAt returns the CreatedAt field value -func (o *Schedule) GetCreatedAt() time.Time { - if o == nil { - var ret time.Time - return ret - } - - return o.CreatedAt -} - -// GetCreatedAtOk returns a tuple with the CreatedAt field value -// and a boolean to check if the value has been set. -func (o *Schedule) GetCreatedAtOk() (*time.Time, bool) { - if o == nil { - return nil, false - } - return &o.CreatedAt, true -} - -// SetCreatedAt sets field value -func (o *Schedule) SetCreatedAt(v time.Time) { - o.CreatedAt = v -} - -// GetModifiedAt returns the ModifiedAt field value -func (o *Schedule) GetModifiedAt() time.Time { - if o == nil { - var ret time.Time - return ret - } - - return o.ModifiedAt -} - -// GetModifiedAtOk returns a tuple with the ModifiedAt field value -// and a boolean to check if the value has been set. -func (o *Schedule) GetModifiedAtOk() (*time.Time, bool) { - if o == nil { - return nil, false - } - return &o.ModifiedAt, true -} - -// SetModifiedAt sets field value -func (o *Schedule) SetModifiedAt(v time.Time) { - o.ModifiedAt = v -} - -// GetNextRunAt returns the NextRunAt field value if set, zero value otherwise. -func (o *Schedule) GetNextRunAt() time.Time { - if o == nil || IsNil(o.NextRunAt) { - var ret time.Time - return ret - } - return *o.NextRunAt -} - -// GetNextRunAtOk returns a tuple with the NextRunAt field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Schedule) GetNextRunAtOk() (*time.Time, bool) { - if o == nil || IsNil(o.NextRunAt) { - return nil, false - } - return o.NextRunAt, true -} - -// HasNextRunAt returns a boolean if a field has been set. -func (o *Schedule) HasNextRunAt() bool { - if o != nil && !IsNil(o.NextRunAt) { - return true - } - - return false -} - -// SetNextRunAt gets a reference to the given time.Time and assigns it to the NextRunAt field. -func (o *Schedule) SetNextRunAt(v time.Time) { - o.NextRunAt = &v -} - -// GetLastRunAt returns the LastRunAt field value if set, zero value otherwise. -func (o *Schedule) GetLastRunAt() time.Time { - if o == nil || IsNil(o.LastRunAt) { - var ret time.Time - return ret - } - return *o.LastRunAt -} - -// GetLastRunAtOk returns a tuple with the LastRunAt field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Schedule) GetLastRunAtOk() (*time.Time, bool) { - if o == nil || IsNil(o.LastRunAt) { - return nil, false - } - return o.LastRunAt, true -} - -// HasLastRunAt returns a boolean if a field has been set. -func (o *Schedule) HasLastRunAt() bool { - if o != nil && !IsNil(o.LastRunAt) { - return true - } - - return false -} - -// SetLastRunAt gets a reference to the given time.Time and assigns it to the LastRunAt field. -func (o *Schedule) SetLastRunAt(v time.Time) { - o.LastRunAt = &v -} - -// GetDescription returns the Description field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *Schedule) GetDescription() string { - if o == nil || IsNil(o.Description.Get()) { - var ret string - return ret - } - return *o.Description.Get() -} - -// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *Schedule) GetDescriptionOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.Description.Get(), o.Description.IsSet() -} - -// HasDescription returns a boolean if a field has been set. -func (o *Schedule) HasDescription() bool { - if o != nil && o.Description.IsSet() { - return true - } - - return false -} - -// SetDescription gets a reference to the given NullableString and assigns it to the Description field. -func (o *Schedule) SetDescription(v string) { - o.Description.Set(&v) -} -// SetDescriptionNil sets the value for Description to be an explicit nil -func (o *Schedule) SetDescriptionNil() { - o.Description.Set(nil) -} - -// UnsetDescription ensures that no value is present for Description, not even an explicit nil -func (o *Schedule) UnsetDescription() { - o.Description.Unset() -} - -// GetTitle returns the Title field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *Schedule) GetTitle() string { - if o == nil || IsNil(o.Title.Get()) { - var ret string - return ret - } - return *o.Title.Get() -} - -// GetTitleOk returns a tuple with the Title field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *Schedule) GetTitleOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.Title.Get(), o.Title.IsSet() -} - -// HasTitle returns a boolean if a field has been set. -func (o *Schedule) HasTitle() bool { - if o != nil && o.Title.IsSet() { - return true - } - - return false -} - -// SetTitle gets a reference to the given NullableString and assigns it to the Title field. -func (o *Schedule) SetTitle(v string) { - o.Title.Set(&v) -} -// SetTitleNil sets the value for Title to be an explicit nil -func (o *Schedule) SetTitleNil() { - o.Title.Set(nil) -} - -// UnsetTitle ensures that no value is present for Title, not even an explicit nil -func (o *Schedule) UnsetTitle() { - o.Title.Unset() -} - -// GetNotifications returns the Notifications field value if set, zero value otherwise. -func (o *Schedule) GetNotifications() ScheduleNotifications { - if o == nil || IsNil(o.Notifications) { - var ret ScheduleNotifications - return ret - } - return *o.Notifications -} - -// GetNotificationsOk returns a tuple with the Notifications field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Schedule) GetNotificationsOk() (*ScheduleNotifications, bool) { - if o == nil || IsNil(o.Notifications) { - return nil, false - } - return o.Notifications, true -} - -// HasNotifications returns a boolean if a field has been set. -func (o *Schedule) HasNotifications() bool { - if o != nil && !IsNil(o.Notifications) { - return true - } - - return false -} - -// SetNotifications gets a reference to the given ScheduleNotifications and assigns it to the Notifications field. -func (o *Schedule) SetNotifications(v ScheduleNotifications) { - o.Notifications = &v -} - -// GetActions returns the Actions field value -func (o *Schedule) GetActions() []ScheduleAction { - if o == nil { - var ret []ScheduleAction - return ret - } - - return o.Actions -} - -// GetActionsOk returns a tuple with the Actions field value -// and a boolean to check if the value has been set. -func (o *Schedule) GetActionsOk() ([]ScheduleAction, bool) { - if o == nil { - return nil, false - } - return o.Actions, true -} - -// SetActions sets field value -func (o *Schedule) SetActions(v []ScheduleAction) { - o.Actions = v -} - -func (o Schedule) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o Schedule) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["id"] = o.Id - toSerialize["userId"] = o.UserId - toSerialize["name"] = o.Name - toSerialize["cronExpression"] = o.CronExpression - toSerialize["timezone"] = o.Timezone - toSerialize["isEnabled"] = o.IsEnabled - toSerialize["isExclusive"] = o.IsExclusive - toSerialize["createdAt"] = o.CreatedAt - toSerialize["modifiedAt"] = o.ModifiedAt - if !IsNil(o.NextRunAt) { - toSerialize["nextRunAt"] = o.NextRunAt - } - if !IsNil(o.LastRunAt) { - toSerialize["lastRunAt"] = o.LastRunAt - } - if o.Description.IsSet() { - toSerialize["description"] = o.Description.Get() - } - if o.Title.IsSet() { - toSerialize["title"] = o.Title.Get() - } - if !IsNil(o.Notifications) { - toSerialize["notifications"] = o.Notifications - } - toSerialize["actions"] = o.Actions - return toSerialize, nil -} - -func (o *Schedule) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "id", - "userId", - "name", - "cronExpression", - "timezone", - "isEnabled", - "isExclusive", - "createdAt", - "modifiedAt", - "actions", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err; - } - - for _, requiredProperty := range(requiredProperties) { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varSchedule := _Schedule{} - - decoder := json.NewDecoder(bytes.NewReader(data)) - decoder.DisallowUnknownFields() - err = decoder.Decode(&varSchedule) - - if err != nil { - return err - } - - *o = Schedule(varSchedule) - - return err -} - -type NullableSchedule struct { - value *Schedule - isSet bool -} - -func (v NullableSchedule) Get() *Schedule { - return v.value -} - -func (v *NullableSchedule) Set(val *Schedule) { - v.value = val - v.isSet = true -} - -func (v NullableSchedule) IsSet() bool { - return v.isSet -} - -func (v *NullableSchedule) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableSchedule(val *Schedule) *NullableSchedule { - return &NullableSchedule{value: val, isSet: true} -} - -func (v NullableSchedule) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableSchedule) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_schedule_action.go b/model_schedule_action.go deleted file mode 100644 index 3a3fd83..0000000 --- a/model_schedule_action.go +++ /dev/null @@ -1,171 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" - "fmt" - "gopkg.in/validator.v2" -) - -// ScheduleAction - struct for ScheduleAction -type ScheduleAction struct { - ScheduleActionRunActor *ScheduleActionRunActor - ScheduleActionRunActorTask *ScheduleActionRunActorTask -} - -// ScheduleActionRunActorAsScheduleAction is a convenience function that returns ScheduleActionRunActor wrapped in ScheduleAction -func ScheduleActionRunActorAsScheduleAction(v *ScheduleActionRunActor) ScheduleAction { - return ScheduleAction{ - ScheduleActionRunActor: v, - } -} - -// ScheduleActionRunActorTaskAsScheduleAction is a convenience function that returns ScheduleActionRunActorTask wrapped in ScheduleAction -func ScheduleActionRunActorTaskAsScheduleAction(v *ScheduleActionRunActorTask) ScheduleAction { - return ScheduleAction{ - ScheduleActionRunActorTask: v, - } -} - - -// Unmarshal JSON data into one of the pointers in the struct -func (dst *ScheduleAction) UnmarshalJSON(data []byte) error { - var err error - match := 0 - // try to unmarshal data into ScheduleActionRunActor - err = newStrictDecoder(data).Decode(&dst.ScheduleActionRunActor) - if err == nil { - jsonScheduleActionRunActor, _ := json.Marshal(dst.ScheduleActionRunActor) - if string(jsonScheduleActionRunActor) == "{}" { // empty struct - dst.ScheduleActionRunActor = nil - } else { - if err = validator.Validate(dst.ScheduleActionRunActor); err != nil { - dst.ScheduleActionRunActor = nil - } else { - match++ - } - } - } else { - dst.ScheduleActionRunActor = nil - } - - // try to unmarshal data into ScheduleActionRunActorTask - err = newStrictDecoder(data).Decode(&dst.ScheduleActionRunActorTask) - if err == nil { - jsonScheduleActionRunActorTask, _ := json.Marshal(dst.ScheduleActionRunActorTask) - if string(jsonScheduleActionRunActorTask) == "{}" { // empty struct - dst.ScheduleActionRunActorTask = nil - } else { - if err = validator.Validate(dst.ScheduleActionRunActorTask); err != nil { - dst.ScheduleActionRunActorTask = nil - } else { - match++ - } - } - } else { - dst.ScheduleActionRunActorTask = nil - } - - if match > 1 { // more than 1 match - // reset to nil - dst.ScheduleActionRunActor = nil - dst.ScheduleActionRunActorTask = nil - - return fmt.Errorf("data matches more than one schema in oneOf(ScheduleAction)") - } else if match == 1 { - return nil // exactly one match - } else { // no match - return fmt.Errorf("data failed to match schemas in oneOf(ScheduleAction)") - } -} - -// Marshal data from the first non-nil pointers in the struct to JSON -func (src ScheduleAction) MarshalJSON() ([]byte, error) { - if src.ScheduleActionRunActor != nil { - return json.Marshal(&src.ScheduleActionRunActor) - } - - if src.ScheduleActionRunActorTask != nil { - return json.Marshal(&src.ScheduleActionRunActorTask) - } - - return nil, nil // no data in oneOf schemas -} - -// Get the actual instance -func (obj *ScheduleAction) GetActualInstance() (interface{}) { - if obj == nil { - return nil - } - if obj.ScheduleActionRunActor != nil { - return obj.ScheduleActionRunActor - } - - if obj.ScheduleActionRunActorTask != nil { - return obj.ScheduleActionRunActorTask - } - - // all schemas are nil - return nil -} - -// Get the actual instance value -func (obj ScheduleAction) GetActualInstanceValue() (interface{}) { - if obj.ScheduleActionRunActor != nil { - return *obj.ScheduleActionRunActor - } - - if obj.ScheduleActionRunActorTask != nil { - return *obj.ScheduleActionRunActorTask - } - - // all schemas are nil - return nil -} - -type NullableScheduleAction struct { - value *ScheduleAction - isSet bool -} - -func (v NullableScheduleAction) Get() *ScheduleAction { - return v.value -} - -func (v *NullableScheduleAction) Set(val *ScheduleAction) { - v.value = val - v.isSet = true -} - -func (v NullableScheduleAction) IsSet() bool { - return v.isSet -} - -func (v *NullableScheduleAction) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableScheduleAction(val *ScheduleAction) *NullableScheduleAction { - return &NullableScheduleAction{value: val, isSet: true} -} - -func (v NullableScheduleAction) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableScheduleAction) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_schedule_action_run_actor.go b/model_schedule_action_run_actor.go deleted file mode 100644 index 577986a..0000000 --- a/model_schedule_action_run_actor.go +++ /dev/null @@ -1,310 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" - "bytes" - "fmt" -) - -// checks if the ScheduleActionRunActor type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &ScheduleActionRunActor{} - -// ScheduleActionRunActor struct for ScheduleActionRunActor -type ScheduleActionRunActor struct { - Id string `json:"id"` - Type interface{} `json:"type"` - ActorId string `json:"actorId"` - RunInput NullableScheduleActionRunInput `json:"runInput,omitempty"` - RunOptions NullableTaskOptions `json:"runOptions,omitempty"` -} - -type _ScheduleActionRunActor ScheduleActionRunActor - -// NewScheduleActionRunActor instantiates a new ScheduleActionRunActor object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewScheduleActionRunActor(id string, type_ interface{}, actorId string) *ScheduleActionRunActor { - this := ScheduleActionRunActor{} - this.Id = id - this.Type = type_ - this.ActorId = actorId - return &this -} - -// NewScheduleActionRunActorWithDefaults instantiates a new ScheduleActionRunActor object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewScheduleActionRunActorWithDefaults() *ScheduleActionRunActor { - this := ScheduleActionRunActor{} - return &this -} - -// GetId returns the Id field value -func (o *ScheduleActionRunActor) GetId() string { - if o == nil { - var ret string - return ret - } - - return o.Id -} - -// GetIdOk returns a tuple with the Id field value -// and a boolean to check if the value has been set. -func (o *ScheduleActionRunActor) GetIdOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Id, true -} - -// SetId sets field value -func (o *ScheduleActionRunActor) SetId(v string) { - o.Id = v -} - -// GetType returns the Type field value -// If the value is explicit nil, the zero value for interface{} will be returned -func (o *ScheduleActionRunActor) GetType() interface{} { - if o == nil { - var ret interface{} - return ret - } - - return o.Type -} - -// GetTypeOk returns a tuple with the Type field value -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *ScheduleActionRunActor) GetTypeOk() (*interface{}, bool) { - if o == nil || IsNil(o.Type) { - return nil, false - } - return &o.Type, true -} - -// SetType sets field value -func (o *ScheduleActionRunActor) SetType(v interface{}) { - o.Type = v -} - -// GetActorId returns the ActorId field value -func (o *ScheduleActionRunActor) GetActorId() string { - if o == nil { - var ret string - return ret - } - - return o.ActorId -} - -// GetActorIdOk returns a tuple with the ActorId field value -// and a boolean to check if the value has been set. -func (o *ScheduleActionRunActor) GetActorIdOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.ActorId, true -} - -// SetActorId sets field value -func (o *ScheduleActionRunActor) SetActorId(v string) { - o.ActorId = v -} - -// GetRunInput returns the RunInput field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *ScheduleActionRunActor) GetRunInput() ScheduleActionRunInput { - if o == nil || IsNil(o.RunInput.Get()) { - var ret ScheduleActionRunInput - return ret - } - return *o.RunInput.Get() -} - -// GetRunInputOk returns a tuple with the RunInput field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *ScheduleActionRunActor) GetRunInputOk() (*ScheduleActionRunInput, bool) { - if o == nil { - return nil, false - } - return o.RunInput.Get(), o.RunInput.IsSet() -} - -// HasRunInput returns a boolean if a field has been set. -func (o *ScheduleActionRunActor) HasRunInput() bool { - if o != nil && o.RunInput.IsSet() { - return true - } - - return false -} - -// SetRunInput gets a reference to the given NullableScheduleActionRunInput and assigns it to the RunInput field. -func (o *ScheduleActionRunActor) SetRunInput(v ScheduleActionRunInput) { - o.RunInput.Set(&v) -} -// SetRunInputNil sets the value for RunInput to be an explicit nil -func (o *ScheduleActionRunActor) SetRunInputNil() { - o.RunInput.Set(nil) -} - -// UnsetRunInput ensures that no value is present for RunInput, not even an explicit nil -func (o *ScheduleActionRunActor) UnsetRunInput() { - o.RunInput.Unset() -} - -// GetRunOptions returns the RunOptions field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *ScheduleActionRunActor) GetRunOptions() TaskOptions { - if o == nil || IsNil(o.RunOptions.Get()) { - var ret TaskOptions - return ret - } - return *o.RunOptions.Get() -} - -// GetRunOptionsOk returns a tuple with the RunOptions field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *ScheduleActionRunActor) GetRunOptionsOk() (*TaskOptions, bool) { - if o == nil { - return nil, false - } - return o.RunOptions.Get(), o.RunOptions.IsSet() -} - -// HasRunOptions returns a boolean if a field has been set. -func (o *ScheduleActionRunActor) HasRunOptions() bool { - if o != nil && o.RunOptions.IsSet() { - return true - } - - return false -} - -// SetRunOptions gets a reference to the given NullableTaskOptions and assigns it to the RunOptions field. -func (o *ScheduleActionRunActor) SetRunOptions(v TaskOptions) { - o.RunOptions.Set(&v) -} -// SetRunOptionsNil sets the value for RunOptions to be an explicit nil -func (o *ScheduleActionRunActor) SetRunOptionsNil() { - o.RunOptions.Set(nil) -} - -// UnsetRunOptions ensures that no value is present for RunOptions, not even an explicit nil -func (o *ScheduleActionRunActor) UnsetRunOptions() { - o.RunOptions.Unset() -} - -func (o ScheduleActionRunActor) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o ScheduleActionRunActor) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["id"] = o.Id - if o.Type != nil { - toSerialize["type"] = o.Type - } - toSerialize["actorId"] = o.ActorId - if o.RunInput.IsSet() { - toSerialize["runInput"] = o.RunInput.Get() - } - if o.RunOptions.IsSet() { - toSerialize["runOptions"] = o.RunOptions.Get() - } - return toSerialize, nil -} - -func (o *ScheduleActionRunActor) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "id", - "type", - "actorId", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err; - } - - for _, requiredProperty := range(requiredProperties) { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varScheduleActionRunActor := _ScheduleActionRunActor{} - - decoder := json.NewDecoder(bytes.NewReader(data)) - decoder.DisallowUnknownFields() - err = decoder.Decode(&varScheduleActionRunActor) - - if err != nil { - return err - } - - *o = ScheduleActionRunActor(varScheduleActionRunActor) - - return err -} - -type NullableScheduleActionRunActor struct { - value *ScheduleActionRunActor - isSet bool -} - -func (v NullableScheduleActionRunActor) Get() *ScheduleActionRunActor { - return v.value -} - -func (v *NullableScheduleActionRunActor) Set(val *ScheduleActionRunActor) { - v.value = val - v.isSet = true -} - -func (v NullableScheduleActionRunActor) IsSet() bool { - return v.isSet -} - -func (v *NullableScheduleActionRunActor) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableScheduleActionRunActor(val *ScheduleActionRunActor) *NullableScheduleActionRunActor { - return &NullableScheduleActionRunActor{value: val, isSet: true} -} - -func (v NullableScheduleActionRunActor) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableScheduleActionRunActor) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_schedule_action_run_actor_task.go b/model_schedule_action_run_actor_task.go deleted file mode 100644 index 586c759..0000000 --- a/model_schedule_action_run_actor_task.go +++ /dev/null @@ -1,255 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" - "bytes" - "fmt" -) - -// checks if the ScheduleActionRunActorTask type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &ScheduleActionRunActorTask{} - -// ScheduleActionRunActorTask struct for ScheduleActionRunActorTask -type ScheduleActionRunActorTask struct { - Id string `json:"id"` - Type interface{} `json:"type"` - ActorTaskId string `json:"actorTaskId"` - Input map[string]interface{} `json:"input,omitempty"` -} - -type _ScheduleActionRunActorTask ScheduleActionRunActorTask - -// NewScheduleActionRunActorTask instantiates a new ScheduleActionRunActorTask object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewScheduleActionRunActorTask(id string, type_ interface{}, actorTaskId string) *ScheduleActionRunActorTask { - this := ScheduleActionRunActorTask{} - this.Id = id - this.Type = type_ - this.ActorTaskId = actorTaskId - return &this -} - -// NewScheduleActionRunActorTaskWithDefaults instantiates a new ScheduleActionRunActorTask object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewScheduleActionRunActorTaskWithDefaults() *ScheduleActionRunActorTask { - this := ScheduleActionRunActorTask{} - return &this -} - -// GetId returns the Id field value -func (o *ScheduleActionRunActorTask) GetId() string { - if o == nil { - var ret string - return ret - } - - return o.Id -} - -// GetIdOk returns a tuple with the Id field value -// and a boolean to check if the value has been set. -func (o *ScheduleActionRunActorTask) GetIdOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Id, true -} - -// SetId sets field value -func (o *ScheduleActionRunActorTask) SetId(v string) { - o.Id = v -} - -// GetType returns the Type field value -// If the value is explicit nil, the zero value for interface{} will be returned -func (o *ScheduleActionRunActorTask) GetType() interface{} { - if o == nil { - var ret interface{} - return ret - } - - return o.Type -} - -// GetTypeOk returns a tuple with the Type field value -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *ScheduleActionRunActorTask) GetTypeOk() (*interface{}, bool) { - if o == nil || IsNil(o.Type) { - return nil, false - } - return &o.Type, true -} - -// SetType sets field value -func (o *ScheduleActionRunActorTask) SetType(v interface{}) { - o.Type = v -} - -// GetActorTaskId returns the ActorTaskId field value -func (o *ScheduleActionRunActorTask) GetActorTaskId() string { - if o == nil { - var ret string - return ret - } - - return o.ActorTaskId -} - -// GetActorTaskIdOk returns a tuple with the ActorTaskId field value -// and a boolean to check if the value has been set. -func (o *ScheduleActionRunActorTask) GetActorTaskIdOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.ActorTaskId, true -} - -// SetActorTaskId sets field value -func (o *ScheduleActionRunActorTask) SetActorTaskId(v string) { - o.ActorTaskId = v -} - -// GetInput returns the Input field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *ScheduleActionRunActorTask) GetInput() map[string]interface{} { - if o == nil { - var ret map[string]interface{} - return ret - } - return o.Input -} - -// GetInputOk returns a tuple with the Input field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *ScheduleActionRunActorTask) GetInputOk() (map[string]interface{}, bool) { - if o == nil || IsNil(o.Input) { - return map[string]interface{}{}, false - } - return o.Input, true -} - -// HasInput returns a boolean if a field has been set. -func (o *ScheduleActionRunActorTask) HasInput() bool { - if o != nil && !IsNil(o.Input) { - return true - } - - return false -} - -// SetInput gets a reference to the given map[string]interface{} and assigns it to the Input field. -func (o *ScheduleActionRunActorTask) SetInput(v map[string]interface{}) { - o.Input = v -} - -func (o ScheduleActionRunActorTask) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o ScheduleActionRunActorTask) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["id"] = o.Id - if o.Type != nil { - toSerialize["type"] = o.Type - } - toSerialize["actorTaskId"] = o.ActorTaskId - if o.Input != nil { - toSerialize["input"] = o.Input - } - return toSerialize, nil -} - -func (o *ScheduleActionRunActorTask) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "id", - "type", - "actorTaskId", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err; - } - - for _, requiredProperty := range(requiredProperties) { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varScheduleActionRunActorTask := _ScheduleActionRunActorTask{} - - decoder := json.NewDecoder(bytes.NewReader(data)) - decoder.DisallowUnknownFields() - err = decoder.Decode(&varScheduleActionRunActorTask) - - if err != nil { - return err - } - - *o = ScheduleActionRunActorTask(varScheduleActionRunActorTask) - - return err -} - -type NullableScheduleActionRunActorTask struct { - value *ScheduleActionRunActorTask - isSet bool -} - -func (v NullableScheduleActionRunActorTask) Get() *ScheduleActionRunActorTask { - return v.value -} - -func (v *NullableScheduleActionRunActorTask) Set(val *ScheduleActionRunActorTask) { - v.value = val - v.isSet = true -} - -func (v NullableScheduleActionRunActorTask) IsSet() bool { - return v.isSet -} - -func (v *NullableScheduleActionRunActorTask) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableScheduleActionRunActorTask(val *ScheduleActionRunActorTask) *NullableScheduleActionRunActorTask { - return &NullableScheduleActionRunActorTask{value: val, isSet: true} -} - -func (v NullableScheduleActionRunActorTask) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableScheduleActionRunActorTask) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_schedule_action_run_input.go b/model_schedule_action_run_input.go deleted file mode 100644 index ac3daf1..0000000 --- a/model_schedule_action_run_input.go +++ /dev/null @@ -1,182 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" -) - -// checks if the ScheduleActionRunInput type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &ScheduleActionRunInput{} - -// ScheduleActionRunInput struct for ScheduleActionRunInput -type ScheduleActionRunInput struct { - Body NullableString `json:"body,omitempty"` - ContentType NullableString `json:"contentType,omitempty"` -} - -// NewScheduleActionRunInput instantiates a new ScheduleActionRunInput object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewScheduleActionRunInput() *ScheduleActionRunInput { - this := ScheduleActionRunInput{} - return &this -} - -// NewScheduleActionRunInputWithDefaults instantiates a new ScheduleActionRunInput object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewScheduleActionRunInputWithDefaults() *ScheduleActionRunInput { - this := ScheduleActionRunInput{} - return &this -} - -// GetBody returns the Body field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *ScheduleActionRunInput) GetBody() string { - if o == nil || IsNil(o.Body.Get()) { - var ret string - return ret - } - return *o.Body.Get() -} - -// GetBodyOk returns a tuple with the Body field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *ScheduleActionRunInput) GetBodyOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.Body.Get(), o.Body.IsSet() -} - -// HasBody returns a boolean if a field has been set. -func (o *ScheduleActionRunInput) HasBody() bool { - if o != nil && o.Body.IsSet() { - return true - } - - return false -} - -// SetBody gets a reference to the given NullableString and assigns it to the Body field. -func (o *ScheduleActionRunInput) SetBody(v string) { - o.Body.Set(&v) -} -// SetBodyNil sets the value for Body to be an explicit nil -func (o *ScheduleActionRunInput) SetBodyNil() { - o.Body.Set(nil) -} - -// UnsetBody ensures that no value is present for Body, not even an explicit nil -func (o *ScheduleActionRunInput) UnsetBody() { - o.Body.Unset() -} - -// GetContentType returns the ContentType field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *ScheduleActionRunInput) GetContentType() string { - if o == nil || IsNil(o.ContentType.Get()) { - var ret string - return ret - } - return *o.ContentType.Get() -} - -// GetContentTypeOk returns a tuple with the ContentType field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *ScheduleActionRunInput) GetContentTypeOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.ContentType.Get(), o.ContentType.IsSet() -} - -// HasContentType returns a boolean if a field has been set. -func (o *ScheduleActionRunInput) HasContentType() bool { - if o != nil && o.ContentType.IsSet() { - return true - } - - return false -} - -// SetContentType gets a reference to the given NullableString and assigns it to the ContentType field. -func (o *ScheduleActionRunInput) SetContentType(v string) { - o.ContentType.Set(&v) -} -// SetContentTypeNil sets the value for ContentType to be an explicit nil -func (o *ScheduleActionRunInput) SetContentTypeNil() { - o.ContentType.Set(nil) -} - -// UnsetContentType ensures that no value is present for ContentType, not even an explicit nil -func (o *ScheduleActionRunInput) UnsetContentType() { - o.ContentType.Unset() -} - -func (o ScheduleActionRunInput) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o ScheduleActionRunInput) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if o.Body.IsSet() { - toSerialize["body"] = o.Body.Get() - } - if o.ContentType.IsSet() { - toSerialize["contentType"] = o.ContentType.Get() - } - return toSerialize, nil -} - -type NullableScheduleActionRunInput struct { - value *ScheduleActionRunInput - isSet bool -} - -func (v NullableScheduleActionRunInput) Get() *ScheduleActionRunInput { - return v.value -} - -func (v *NullableScheduleActionRunInput) Set(val *ScheduleActionRunInput) { - v.value = val - v.isSet = true -} - -func (v NullableScheduleActionRunInput) IsSet() bool { - return v.isSet -} - -func (v *NullableScheduleActionRunInput) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableScheduleActionRunInput(val *ScheduleActionRunInput) *NullableScheduleActionRunInput { - return &NullableScheduleActionRunInput{value: val, isSet: true} -} - -func (v NullableScheduleActionRunInput) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableScheduleActionRunInput) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_schedule_action_short.go b/model_schedule_action_short.go deleted file mode 100644 index 19098ed..0000000 --- a/model_schedule_action_short.go +++ /dev/null @@ -1,171 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" - "fmt" - "gopkg.in/validator.v2" -) - -// ScheduleActionShort - struct for ScheduleActionShort -type ScheduleActionShort struct { - ScheduleActionShortRunActor *ScheduleActionShortRunActor - ScheduleActionShortRunActorTask *ScheduleActionShortRunActorTask -} - -// ScheduleActionShortRunActorAsScheduleActionShort is a convenience function that returns ScheduleActionShortRunActor wrapped in ScheduleActionShort -func ScheduleActionShortRunActorAsScheduleActionShort(v *ScheduleActionShortRunActor) ScheduleActionShort { - return ScheduleActionShort{ - ScheduleActionShortRunActor: v, - } -} - -// ScheduleActionShortRunActorTaskAsScheduleActionShort is a convenience function that returns ScheduleActionShortRunActorTask wrapped in ScheduleActionShort -func ScheduleActionShortRunActorTaskAsScheduleActionShort(v *ScheduleActionShortRunActorTask) ScheduleActionShort { - return ScheduleActionShort{ - ScheduleActionShortRunActorTask: v, - } -} - - -// Unmarshal JSON data into one of the pointers in the struct -func (dst *ScheduleActionShort) UnmarshalJSON(data []byte) error { - var err error - match := 0 - // try to unmarshal data into ScheduleActionShortRunActor - err = newStrictDecoder(data).Decode(&dst.ScheduleActionShortRunActor) - if err == nil { - jsonScheduleActionShortRunActor, _ := json.Marshal(dst.ScheduleActionShortRunActor) - if string(jsonScheduleActionShortRunActor) == "{}" { // empty struct - dst.ScheduleActionShortRunActor = nil - } else { - if err = validator.Validate(dst.ScheduleActionShortRunActor); err != nil { - dst.ScheduleActionShortRunActor = nil - } else { - match++ - } - } - } else { - dst.ScheduleActionShortRunActor = nil - } - - // try to unmarshal data into ScheduleActionShortRunActorTask - err = newStrictDecoder(data).Decode(&dst.ScheduleActionShortRunActorTask) - if err == nil { - jsonScheduleActionShortRunActorTask, _ := json.Marshal(dst.ScheduleActionShortRunActorTask) - if string(jsonScheduleActionShortRunActorTask) == "{}" { // empty struct - dst.ScheduleActionShortRunActorTask = nil - } else { - if err = validator.Validate(dst.ScheduleActionShortRunActorTask); err != nil { - dst.ScheduleActionShortRunActorTask = nil - } else { - match++ - } - } - } else { - dst.ScheduleActionShortRunActorTask = nil - } - - if match > 1 { // more than 1 match - // reset to nil - dst.ScheduleActionShortRunActor = nil - dst.ScheduleActionShortRunActorTask = nil - - return fmt.Errorf("data matches more than one schema in oneOf(ScheduleActionShort)") - } else if match == 1 { - return nil // exactly one match - } else { // no match - return fmt.Errorf("data failed to match schemas in oneOf(ScheduleActionShort)") - } -} - -// Marshal data from the first non-nil pointers in the struct to JSON -func (src ScheduleActionShort) MarshalJSON() ([]byte, error) { - if src.ScheduleActionShortRunActor != nil { - return json.Marshal(&src.ScheduleActionShortRunActor) - } - - if src.ScheduleActionShortRunActorTask != nil { - return json.Marshal(&src.ScheduleActionShortRunActorTask) - } - - return nil, nil // no data in oneOf schemas -} - -// Get the actual instance -func (obj *ScheduleActionShort) GetActualInstance() (interface{}) { - if obj == nil { - return nil - } - if obj.ScheduleActionShortRunActor != nil { - return obj.ScheduleActionShortRunActor - } - - if obj.ScheduleActionShortRunActorTask != nil { - return obj.ScheduleActionShortRunActorTask - } - - // all schemas are nil - return nil -} - -// Get the actual instance value -func (obj ScheduleActionShort) GetActualInstanceValue() (interface{}) { - if obj.ScheduleActionShortRunActor != nil { - return *obj.ScheduleActionShortRunActor - } - - if obj.ScheduleActionShortRunActorTask != nil { - return *obj.ScheduleActionShortRunActorTask - } - - // all schemas are nil - return nil -} - -type NullableScheduleActionShort struct { - value *ScheduleActionShort - isSet bool -} - -func (v NullableScheduleActionShort) Get() *ScheduleActionShort { - return v.value -} - -func (v *NullableScheduleActionShort) Set(val *ScheduleActionShort) { - v.value = val - v.isSet = true -} - -func (v NullableScheduleActionShort) IsSet() bool { - return v.isSet -} - -func (v *NullableScheduleActionShort) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableScheduleActionShort(val *ScheduleActionShort) *NullableScheduleActionShort { - return &NullableScheduleActionShort{value: val, isSet: true} -} - -func (v NullableScheduleActionShort) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableScheduleActionShort) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_schedule_action_short_run_actor.go b/model_schedule_action_short_run_actor.go deleted file mode 100644 index 3151f49..0000000 --- a/model_schedule_action_short_run_actor.go +++ /dev/null @@ -1,218 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" - "bytes" - "fmt" -) - -// checks if the ScheduleActionShortRunActor type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &ScheduleActionShortRunActor{} - -// ScheduleActionShortRunActor struct for ScheduleActionShortRunActor -type ScheduleActionShortRunActor struct { - Id string `json:"id"` - Type interface{} `json:"type"` - ActorId string `json:"actorId"` -} - -type _ScheduleActionShortRunActor ScheduleActionShortRunActor - -// NewScheduleActionShortRunActor instantiates a new ScheduleActionShortRunActor object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewScheduleActionShortRunActor(id string, type_ interface{}, actorId string) *ScheduleActionShortRunActor { - this := ScheduleActionShortRunActor{} - this.Id = id - this.Type = type_ - this.ActorId = actorId - return &this -} - -// NewScheduleActionShortRunActorWithDefaults instantiates a new ScheduleActionShortRunActor object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewScheduleActionShortRunActorWithDefaults() *ScheduleActionShortRunActor { - this := ScheduleActionShortRunActor{} - return &this -} - -// GetId returns the Id field value -func (o *ScheduleActionShortRunActor) GetId() string { - if o == nil { - var ret string - return ret - } - - return o.Id -} - -// GetIdOk returns a tuple with the Id field value -// and a boolean to check if the value has been set. -func (o *ScheduleActionShortRunActor) GetIdOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Id, true -} - -// SetId sets field value -func (o *ScheduleActionShortRunActor) SetId(v string) { - o.Id = v -} - -// GetType returns the Type field value -// If the value is explicit nil, the zero value for interface{} will be returned -func (o *ScheduleActionShortRunActor) GetType() interface{} { - if o == nil { - var ret interface{} - return ret - } - - return o.Type -} - -// GetTypeOk returns a tuple with the Type field value -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *ScheduleActionShortRunActor) GetTypeOk() (*interface{}, bool) { - if o == nil || IsNil(o.Type) { - return nil, false - } - return &o.Type, true -} - -// SetType sets field value -func (o *ScheduleActionShortRunActor) SetType(v interface{}) { - o.Type = v -} - -// GetActorId returns the ActorId field value -func (o *ScheduleActionShortRunActor) GetActorId() string { - if o == nil { - var ret string - return ret - } - - return o.ActorId -} - -// GetActorIdOk returns a tuple with the ActorId field value -// and a boolean to check if the value has been set. -func (o *ScheduleActionShortRunActor) GetActorIdOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.ActorId, true -} - -// SetActorId sets field value -func (o *ScheduleActionShortRunActor) SetActorId(v string) { - o.ActorId = v -} - -func (o ScheduleActionShortRunActor) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o ScheduleActionShortRunActor) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["id"] = o.Id - if o.Type != nil { - toSerialize["type"] = o.Type - } - toSerialize["actorId"] = o.ActorId - return toSerialize, nil -} - -func (o *ScheduleActionShortRunActor) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "id", - "type", - "actorId", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err; - } - - for _, requiredProperty := range(requiredProperties) { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varScheduleActionShortRunActor := _ScheduleActionShortRunActor{} - - decoder := json.NewDecoder(bytes.NewReader(data)) - decoder.DisallowUnknownFields() - err = decoder.Decode(&varScheduleActionShortRunActor) - - if err != nil { - return err - } - - *o = ScheduleActionShortRunActor(varScheduleActionShortRunActor) - - return err -} - -type NullableScheduleActionShortRunActor struct { - value *ScheduleActionShortRunActor - isSet bool -} - -func (v NullableScheduleActionShortRunActor) Get() *ScheduleActionShortRunActor { - return v.value -} - -func (v *NullableScheduleActionShortRunActor) Set(val *ScheduleActionShortRunActor) { - v.value = val - v.isSet = true -} - -func (v NullableScheduleActionShortRunActor) IsSet() bool { - return v.isSet -} - -func (v *NullableScheduleActionShortRunActor) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableScheduleActionShortRunActor(val *ScheduleActionShortRunActor) *NullableScheduleActionShortRunActor { - return &NullableScheduleActionShortRunActor{value: val, isSet: true} -} - -func (v NullableScheduleActionShortRunActor) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableScheduleActionShortRunActor) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_schedule_action_short_run_actor_task.go b/model_schedule_action_short_run_actor_task.go deleted file mode 100644 index ce40e59..0000000 --- a/model_schedule_action_short_run_actor_task.go +++ /dev/null @@ -1,218 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" - "bytes" - "fmt" -) - -// checks if the ScheduleActionShortRunActorTask type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &ScheduleActionShortRunActorTask{} - -// ScheduleActionShortRunActorTask struct for ScheduleActionShortRunActorTask -type ScheduleActionShortRunActorTask struct { - Id string `json:"id"` - Type interface{} `json:"type"` - ActorTaskId string `json:"actorTaskId"` -} - -type _ScheduleActionShortRunActorTask ScheduleActionShortRunActorTask - -// NewScheduleActionShortRunActorTask instantiates a new ScheduleActionShortRunActorTask object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewScheduleActionShortRunActorTask(id string, type_ interface{}, actorTaskId string) *ScheduleActionShortRunActorTask { - this := ScheduleActionShortRunActorTask{} - this.Id = id - this.Type = type_ - this.ActorTaskId = actorTaskId - return &this -} - -// NewScheduleActionShortRunActorTaskWithDefaults instantiates a new ScheduleActionShortRunActorTask object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewScheduleActionShortRunActorTaskWithDefaults() *ScheduleActionShortRunActorTask { - this := ScheduleActionShortRunActorTask{} - return &this -} - -// GetId returns the Id field value -func (o *ScheduleActionShortRunActorTask) GetId() string { - if o == nil { - var ret string - return ret - } - - return o.Id -} - -// GetIdOk returns a tuple with the Id field value -// and a boolean to check if the value has been set. -func (o *ScheduleActionShortRunActorTask) GetIdOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Id, true -} - -// SetId sets field value -func (o *ScheduleActionShortRunActorTask) SetId(v string) { - o.Id = v -} - -// GetType returns the Type field value -// If the value is explicit nil, the zero value for interface{} will be returned -func (o *ScheduleActionShortRunActorTask) GetType() interface{} { - if o == nil { - var ret interface{} - return ret - } - - return o.Type -} - -// GetTypeOk returns a tuple with the Type field value -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *ScheduleActionShortRunActorTask) GetTypeOk() (*interface{}, bool) { - if o == nil || IsNil(o.Type) { - return nil, false - } - return &o.Type, true -} - -// SetType sets field value -func (o *ScheduleActionShortRunActorTask) SetType(v interface{}) { - o.Type = v -} - -// GetActorTaskId returns the ActorTaskId field value -func (o *ScheduleActionShortRunActorTask) GetActorTaskId() string { - if o == nil { - var ret string - return ret - } - - return o.ActorTaskId -} - -// GetActorTaskIdOk returns a tuple with the ActorTaskId field value -// and a boolean to check if the value has been set. -func (o *ScheduleActionShortRunActorTask) GetActorTaskIdOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.ActorTaskId, true -} - -// SetActorTaskId sets field value -func (o *ScheduleActionShortRunActorTask) SetActorTaskId(v string) { - o.ActorTaskId = v -} - -func (o ScheduleActionShortRunActorTask) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o ScheduleActionShortRunActorTask) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["id"] = o.Id - if o.Type != nil { - toSerialize["type"] = o.Type - } - toSerialize["actorTaskId"] = o.ActorTaskId - return toSerialize, nil -} - -func (o *ScheduleActionShortRunActorTask) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "id", - "type", - "actorTaskId", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err; - } - - for _, requiredProperty := range(requiredProperties) { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varScheduleActionShortRunActorTask := _ScheduleActionShortRunActorTask{} - - decoder := json.NewDecoder(bytes.NewReader(data)) - decoder.DisallowUnknownFields() - err = decoder.Decode(&varScheduleActionShortRunActorTask) - - if err != nil { - return err - } - - *o = ScheduleActionShortRunActorTask(varScheduleActionShortRunActorTask) - - return err -} - -type NullableScheduleActionShortRunActorTask struct { - value *ScheduleActionShortRunActorTask - isSet bool -} - -func (v NullableScheduleActionShortRunActorTask) Get() *ScheduleActionShortRunActorTask { - return v.value -} - -func (v *NullableScheduleActionShortRunActorTask) Set(val *ScheduleActionShortRunActorTask) { - v.value = val - v.isSet = true -} - -func (v NullableScheduleActionShortRunActorTask) IsSet() bool { - return v.isSet -} - -func (v *NullableScheduleActionShortRunActorTask) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableScheduleActionShortRunActorTask(val *ScheduleActionShortRunActorTask) *NullableScheduleActionShortRunActorTask { - return &NullableScheduleActionShortRunActorTask{value: val, isSet: true} -} - -func (v NullableScheduleActionShortRunActorTask) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableScheduleActionShortRunActorTask) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_schedule_base.go b/model_schedule_base.go deleted file mode 100644 index 6c3f077..0000000 --- a/model_schedule_base.go +++ /dev/null @@ -1,475 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" - "time" - "bytes" - "fmt" -) - -// checks if the ScheduleBase type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &ScheduleBase{} - -// ScheduleBase struct for ScheduleBase -type ScheduleBase struct { - Id string `json:"id"` - UserId string `json:"userId"` - Name string `json:"name"` - CronExpression string `json:"cronExpression"` - Timezone string `json:"timezone"` - IsEnabled bool `json:"isEnabled"` - IsExclusive bool `json:"isExclusive"` - CreatedAt time.Time `json:"createdAt"` - ModifiedAt time.Time `json:"modifiedAt"` - NextRunAt NullableTime `json:"nextRunAt,omitempty"` - LastRunAt NullableTime `json:"lastRunAt,omitempty"` -} - -type _ScheduleBase ScheduleBase - -// NewScheduleBase instantiates a new ScheduleBase object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewScheduleBase(id string, userId string, name string, cronExpression string, timezone string, isEnabled bool, isExclusive bool, createdAt time.Time, modifiedAt time.Time) *ScheduleBase { - this := ScheduleBase{} - this.Id = id - this.UserId = userId - this.Name = name - this.CronExpression = cronExpression - this.Timezone = timezone - this.IsEnabled = isEnabled - this.IsExclusive = isExclusive - this.CreatedAt = createdAt - this.ModifiedAt = modifiedAt - return &this -} - -// NewScheduleBaseWithDefaults instantiates a new ScheduleBase object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewScheduleBaseWithDefaults() *ScheduleBase { - this := ScheduleBase{} - return &this -} - -// GetId returns the Id field value -func (o *ScheduleBase) GetId() string { - if o == nil { - var ret string - return ret - } - - return o.Id -} - -// GetIdOk returns a tuple with the Id field value -// and a boolean to check if the value has been set. -func (o *ScheduleBase) GetIdOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Id, true -} - -// SetId sets field value -func (o *ScheduleBase) SetId(v string) { - o.Id = v -} - -// GetUserId returns the UserId field value -func (o *ScheduleBase) GetUserId() string { - if o == nil { - var ret string - return ret - } - - return o.UserId -} - -// GetUserIdOk returns a tuple with the UserId field value -// and a boolean to check if the value has been set. -func (o *ScheduleBase) GetUserIdOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.UserId, true -} - -// SetUserId sets field value -func (o *ScheduleBase) SetUserId(v string) { - o.UserId = v -} - -// GetName returns the Name field value -func (o *ScheduleBase) GetName() string { - if o == nil { - var ret string - return ret - } - - return o.Name -} - -// GetNameOk returns a tuple with the Name field value -// and a boolean to check if the value has been set. -func (o *ScheduleBase) GetNameOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Name, true -} - -// SetName sets field value -func (o *ScheduleBase) SetName(v string) { - o.Name = v -} - -// GetCronExpression returns the CronExpression field value -func (o *ScheduleBase) GetCronExpression() string { - if o == nil { - var ret string - return ret - } - - return o.CronExpression -} - -// GetCronExpressionOk returns a tuple with the CronExpression field value -// and a boolean to check if the value has been set. -func (o *ScheduleBase) GetCronExpressionOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.CronExpression, true -} - -// SetCronExpression sets field value -func (o *ScheduleBase) SetCronExpression(v string) { - o.CronExpression = v -} - -// GetTimezone returns the Timezone field value -func (o *ScheduleBase) GetTimezone() string { - if o == nil { - var ret string - return ret - } - - return o.Timezone -} - -// GetTimezoneOk returns a tuple with the Timezone field value -// and a boolean to check if the value has been set. -func (o *ScheduleBase) GetTimezoneOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Timezone, true -} - -// SetTimezone sets field value -func (o *ScheduleBase) SetTimezone(v string) { - o.Timezone = v -} - -// GetIsEnabled returns the IsEnabled field value -func (o *ScheduleBase) GetIsEnabled() bool { - if o == nil { - var ret bool - return ret - } - - return o.IsEnabled -} - -// GetIsEnabledOk returns a tuple with the IsEnabled field value -// and a boolean to check if the value has been set. -func (o *ScheduleBase) GetIsEnabledOk() (*bool, bool) { - if o == nil { - return nil, false - } - return &o.IsEnabled, true -} - -// SetIsEnabled sets field value -func (o *ScheduleBase) SetIsEnabled(v bool) { - o.IsEnabled = v -} - -// GetIsExclusive returns the IsExclusive field value -func (o *ScheduleBase) GetIsExclusive() bool { - if o == nil { - var ret bool - return ret - } - - return o.IsExclusive -} - -// GetIsExclusiveOk returns a tuple with the IsExclusive field value -// and a boolean to check if the value has been set. -func (o *ScheduleBase) GetIsExclusiveOk() (*bool, bool) { - if o == nil { - return nil, false - } - return &o.IsExclusive, true -} - -// SetIsExclusive sets field value -func (o *ScheduleBase) SetIsExclusive(v bool) { - o.IsExclusive = v -} - -// GetCreatedAt returns the CreatedAt field value -func (o *ScheduleBase) GetCreatedAt() time.Time { - if o == nil { - var ret time.Time - return ret - } - - return o.CreatedAt -} - -// GetCreatedAtOk returns a tuple with the CreatedAt field value -// and a boolean to check if the value has been set. -func (o *ScheduleBase) GetCreatedAtOk() (*time.Time, bool) { - if o == nil { - return nil, false - } - return &o.CreatedAt, true -} - -// SetCreatedAt sets field value -func (o *ScheduleBase) SetCreatedAt(v time.Time) { - o.CreatedAt = v -} - -// GetModifiedAt returns the ModifiedAt field value -func (o *ScheduleBase) GetModifiedAt() time.Time { - if o == nil { - var ret time.Time - return ret - } - - return o.ModifiedAt -} - -// GetModifiedAtOk returns a tuple with the ModifiedAt field value -// and a boolean to check if the value has been set. -func (o *ScheduleBase) GetModifiedAtOk() (*time.Time, bool) { - if o == nil { - return nil, false - } - return &o.ModifiedAt, true -} - -// SetModifiedAt sets field value -func (o *ScheduleBase) SetModifiedAt(v time.Time) { - o.ModifiedAt = v -} - -// GetNextRunAt returns the NextRunAt field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *ScheduleBase) GetNextRunAt() time.Time { - if o == nil || IsNil(o.NextRunAt.Get()) { - var ret time.Time - return ret - } - return *o.NextRunAt.Get() -} - -// GetNextRunAtOk returns a tuple with the NextRunAt field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *ScheduleBase) GetNextRunAtOk() (*time.Time, bool) { - if o == nil { - return nil, false - } - return o.NextRunAt.Get(), o.NextRunAt.IsSet() -} - -// HasNextRunAt returns a boolean if a field has been set. -func (o *ScheduleBase) HasNextRunAt() bool { - if o != nil && o.NextRunAt.IsSet() { - return true - } - - return false -} - -// SetNextRunAt gets a reference to the given NullableTime and assigns it to the NextRunAt field. -func (o *ScheduleBase) SetNextRunAt(v time.Time) { - o.NextRunAt.Set(&v) -} -// SetNextRunAtNil sets the value for NextRunAt to be an explicit nil -func (o *ScheduleBase) SetNextRunAtNil() { - o.NextRunAt.Set(nil) -} - -// UnsetNextRunAt ensures that no value is present for NextRunAt, not even an explicit nil -func (o *ScheduleBase) UnsetNextRunAt() { - o.NextRunAt.Unset() -} - -// GetLastRunAt returns the LastRunAt field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *ScheduleBase) GetLastRunAt() time.Time { - if o == nil || IsNil(o.LastRunAt.Get()) { - var ret time.Time - return ret - } - return *o.LastRunAt.Get() -} - -// GetLastRunAtOk returns a tuple with the LastRunAt field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *ScheduleBase) GetLastRunAtOk() (*time.Time, bool) { - if o == nil { - return nil, false - } - return o.LastRunAt.Get(), o.LastRunAt.IsSet() -} - -// HasLastRunAt returns a boolean if a field has been set. -func (o *ScheduleBase) HasLastRunAt() bool { - if o != nil && o.LastRunAt.IsSet() { - return true - } - - return false -} - -// SetLastRunAt gets a reference to the given NullableTime and assigns it to the LastRunAt field. -func (o *ScheduleBase) SetLastRunAt(v time.Time) { - o.LastRunAt.Set(&v) -} -// SetLastRunAtNil sets the value for LastRunAt to be an explicit nil -func (o *ScheduleBase) SetLastRunAtNil() { - o.LastRunAt.Set(nil) -} - -// UnsetLastRunAt ensures that no value is present for LastRunAt, not even an explicit nil -func (o *ScheduleBase) UnsetLastRunAt() { - o.LastRunAt.Unset() -} - -func (o ScheduleBase) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o ScheduleBase) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["id"] = o.Id - toSerialize["userId"] = o.UserId - toSerialize["name"] = o.Name - toSerialize["cronExpression"] = o.CronExpression - toSerialize["timezone"] = o.Timezone - toSerialize["isEnabled"] = o.IsEnabled - toSerialize["isExclusive"] = o.IsExclusive - toSerialize["createdAt"] = o.CreatedAt - toSerialize["modifiedAt"] = o.ModifiedAt - if o.NextRunAt.IsSet() { - toSerialize["nextRunAt"] = o.NextRunAt.Get() - } - if o.LastRunAt.IsSet() { - toSerialize["lastRunAt"] = o.LastRunAt.Get() - } - return toSerialize, nil -} - -func (o *ScheduleBase) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "id", - "userId", - "name", - "cronExpression", - "timezone", - "isEnabled", - "isExclusive", - "createdAt", - "modifiedAt", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err; - } - - for _, requiredProperty := range(requiredProperties) { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varScheduleBase := _ScheduleBase{} - - decoder := json.NewDecoder(bytes.NewReader(data)) - decoder.DisallowUnknownFields() - err = decoder.Decode(&varScheduleBase) - - if err != nil { - return err - } - - *o = ScheduleBase(varScheduleBase) - - return err -} - -type NullableScheduleBase struct { - value *ScheduleBase - isSet bool -} - -func (v NullableScheduleBase) Get() *ScheduleBase { - return v.value -} - -func (v *NullableScheduleBase) Set(val *ScheduleBase) { - v.value = val - v.isSet = true -} - -func (v NullableScheduleBase) IsSet() bool { - return v.isSet -} - -func (v *NullableScheduleBase) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableScheduleBase(val *ScheduleBase) *NullableScheduleBase { - return &NullableScheduleBase{value: val, isSet: true} -} - -func (v NullableScheduleBase) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableScheduleBase) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_schedule_create.go b/model_schedule_create.go deleted file mode 100644 index 7ac540a..0000000 --- a/model_schedule_create.go +++ /dev/null @@ -1,450 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" -) - -// checks if the ScheduleCreate type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &ScheduleCreate{} - -// ScheduleCreate struct for ScheduleCreate -type ScheduleCreate struct { - Name NullableString `json:"name,omitempty"` - IsEnabled NullableBool `json:"isEnabled,omitempty"` - IsExclusive NullableBool `json:"isExclusive,omitempty"` - CronExpression NullableString `json:"cronExpression,omitempty"` - Timezone NullableString `json:"timezone,omitempty"` - Description NullableString `json:"description,omitempty"` - Title NullableString `json:"title,omitempty"` - // - Actions []ScheduleCreateAction `json:"actions,omitempty"` -} - -// NewScheduleCreate instantiates a new ScheduleCreate object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewScheduleCreate() *ScheduleCreate { - this := ScheduleCreate{} - return &this -} - -// NewScheduleCreateWithDefaults instantiates a new ScheduleCreate object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewScheduleCreateWithDefaults() *ScheduleCreate { - this := ScheduleCreate{} - return &this -} - -// GetName returns the Name field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *ScheduleCreate) GetName() string { - if o == nil || IsNil(o.Name.Get()) { - var ret string - return ret - } - return *o.Name.Get() -} - -// GetNameOk returns a tuple with the Name field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *ScheduleCreate) GetNameOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.Name.Get(), o.Name.IsSet() -} - -// HasName returns a boolean if a field has been set. -func (o *ScheduleCreate) HasName() bool { - if o != nil && o.Name.IsSet() { - return true - } - - return false -} - -// SetName gets a reference to the given NullableString and assigns it to the Name field. -func (o *ScheduleCreate) SetName(v string) { - o.Name.Set(&v) -} -// SetNameNil sets the value for Name to be an explicit nil -func (o *ScheduleCreate) SetNameNil() { - o.Name.Set(nil) -} - -// UnsetName ensures that no value is present for Name, not even an explicit nil -func (o *ScheduleCreate) UnsetName() { - o.Name.Unset() -} - -// GetIsEnabled returns the IsEnabled field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *ScheduleCreate) GetIsEnabled() bool { - if o == nil || IsNil(o.IsEnabled.Get()) { - var ret bool - return ret - } - return *o.IsEnabled.Get() -} - -// GetIsEnabledOk returns a tuple with the IsEnabled field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *ScheduleCreate) GetIsEnabledOk() (*bool, bool) { - if o == nil { - return nil, false - } - return o.IsEnabled.Get(), o.IsEnabled.IsSet() -} - -// HasIsEnabled returns a boolean if a field has been set. -func (o *ScheduleCreate) HasIsEnabled() bool { - if o != nil && o.IsEnabled.IsSet() { - return true - } - - return false -} - -// SetIsEnabled gets a reference to the given NullableBool and assigns it to the IsEnabled field. -func (o *ScheduleCreate) SetIsEnabled(v bool) { - o.IsEnabled.Set(&v) -} -// SetIsEnabledNil sets the value for IsEnabled to be an explicit nil -func (o *ScheduleCreate) SetIsEnabledNil() { - o.IsEnabled.Set(nil) -} - -// UnsetIsEnabled ensures that no value is present for IsEnabled, not even an explicit nil -func (o *ScheduleCreate) UnsetIsEnabled() { - o.IsEnabled.Unset() -} - -// GetIsExclusive returns the IsExclusive field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *ScheduleCreate) GetIsExclusive() bool { - if o == nil || IsNil(o.IsExclusive.Get()) { - var ret bool - return ret - } - return *o.IsExclusive.Get() -} - -// GetIsExclusiveOk returns a tuple with the IsExclusive field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *ScheduleCreate) GetIsExclusiveOk() (*bool, bool) { - if o == nil { - return nil, false - } - return o.IsExclusive.Get(), o.IsExclusive.IsSet() -} - -// HasIsExclusive returns a boolean if a field has been set. -func (o *ScheduleCreate) HasIsExclusive() bool { - if o != nil && o.IsExclusive.IsSet() { - return true - } - - return false -} - -// SetIsExclusive gets a reference to the given NullableBool and assigns it to the IsExclusive field. -func (o *ScheduleCreate) SetIsExclusive(v bool) { - o.IsExclusive.Set(&v) -} -// SetIsExclusiveNil sets the value for IsExclusive to be an explicit nil -func (o *ScheduleCreate) SetIsExclusiveNil() { - o.IsExclusive.Set(nil) -} - -// UnsetIsExclusive ensures that no value is present for IsExclusive, not even an explicit nil -func (o *ScheduleCreate) UnsetIsExclusive() { - o.IsExclusive.Unset() -} - -// GetCronExpression returns the CronExpression field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *ScheduleCreate) GetCronExpression() string { - if o == nil || IsNil(o.CronExpression.Get()) { - var ret string - return ret - } - return *o.CronExpression.Get() -} - -// GetCronExpressionOk returns a tuple with the CronExpression field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *ScheduleCreate) GetCronExpressionOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.CronExpression.Get(), o.CronExpression.IsSet() -} - -// HasCronExpression returns a boolean if a field has been set. -func (o *ScheduleCreate) HasCronExpression() bool { - if o != nil && o.CronExpression.IsSet() { - return true - } - - return false -} - -// SetCronExpression gets a reference to the given NullableString and assigns it to the CronExpression field. -func (o *ScheduleCreate) SetCronExpression(v string) { - o.CronExpression.Set(&v) -} -// SetCronExpressionNil sets the value for CronExpression to be an explicit nil -func (o *ScheduleCreate) SetCronExpressionNil() { - o.CronExpression.Set(nil) -} - -// UnsetCronExpression ensures that no value is present for CronExpression, not even an explicit nil -func (o *ScheduleCreate) UnsetCronExpression() { - o.CronExpression.Unset() -} - -// GetTimezone returns the Timezone field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *ScheduleCreate) GetTimezone() string { - if o == nil || IsNil(o.Timezone.Get()) { - var ret string - return ret - } - return *o.Timezone.Get() -} - -// GetTimezoneOk returns a tuple with the Timezone field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *ScheduleCreate) GetTimezoneOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.Timezone.Get(), o.Timezone.IsSet() -} - -// HasTimezone returns a boolean if a field has been set. -func (o *ScheduleCreate) HasTimezone() bool { - if o != nil && o.Timezone.IsSet() { - return true - } - - return false -} - -// SetTimezone gets a reference to the given NullableString and assigns it to the Timezone field. -func (o *ScheduleCreate) SetTimezone(v string) { - o.Timezone.Set(&v) -} -// SetTimezoneNil sets the value for Timezone to be an explicit nil -func (o *ScheduleCreate) SetTimezoneNil() { - o.Timezone.Set(nil) -} - -// UnsetTimezone ensures that no value is present for Timezone, not even an explicit nil -func (o *ScheduleCreate) UnsetTimezone() { - o.Timezone.Unset() -} - -// GetDescription returns the Description field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *ScheduleCreate) GetDescription() string { - if o == nil || IsNil(o.Description.Get()) { - var ret string - return ret - } - return *o.Description.Get() -} - -// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *ScheduleCreate) GetDescriptionOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.Description.Get(), o.Description.IsSet() -} - -// HasDescription returns a boolean if a field has been set. -func (o *ScheduleCreate) HasDescription() bool { - if o != nil && o.Description.IsSet() { - return true - } - - return false -} - -// SetDescription gets a reference to the given NullableString and assigns it to the Description field. -func (o *ScheduleCreate) SetDescription(v string) { - o.Description.Set(&v) -} -// SetDescriptionNil sets the value for Description to be an explicit nil -func (o *ScheduleCreate) SetDescriptionNil() { - o.Description.Set(nil) -} - -// UnsetDescription ensures that no value is present for Description, not even an explicit nil -func (o *ScheduleCreate) UnsetDescription() { - o.Description.Unset() -} - -// GetTitle returns the Title field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *ScheduleCreate) GetTitle() string { - if o == nil || IsNil(o.Title.Get()) { - var ret string - return ret - } - return *o.Title.Get() -} - -// GetTitleOk returns a tuple with the Title field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *ScheduleCreate) GetTitleOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.Title.Get(), o.Title.IsSet() -} - -// HasTitle returns a boolean if a field has been set. -func (o *ScheduleCreate) HasTitle() bool { - if o != nil && o.Title.IsSet() { - return true - } - - return false -} - -// SetTitle gets a reference to the given NullableString and assigns it to the Title field. -func (o *ScheduleCreate) SetTitle(v string) { - o.Title.Set(&v) -} -// SetTitleNil sets the value for Title to be an explicit nil -func (o *ScheduleCreate) SetTitleNil() { - o.Title.Set(nil) -} - -// UnsetTitle ensures that no value is present for Title, not even an explicit nil -func (o *ScheduleCreate) UnsetTitle() { - o.Title.Unset() -} - -// GetActions returns the Actions field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *ScheduleCreate) GetActions() []ScheduleCreateAction { - if o == nil { - var ret []ScheduleCreateAction - return ret - } - return o.Actions -} - -// GetActionsOk returns a tuple with the Actions field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *ScheduleCreate) GetActionsOk() ([]ScheduleCreateAction, bool) { - if o == nil || IsNil(o.Actions) { - return nil, false - } - return o.Actions, true -} - -// HasActions returns a boolean if a field has been set. -func (o *ScheduleCreate) HasActions() bool { - if o != nil && !IsNil(o.Actions) { - return true - } - - return false -} - -// SetActions gets a reference to the given []ScheduleCreateAction and assigns it to the Actions field. -func (o *ScheduleCreate) SetActions(v []ScheduleCreateAction) { - o.Actions = v -} - -func (o ScheduleCreate) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o ScheduleCreate) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if o.Name.IsSet() { - toSerialize["name"] = o.Name.Get() - } - if o.IsEnabled.IsSet() { - toSerialize["isEnabled"] = o.IsEnabled.Get() - } - if o.IsExclusive.IsSet() { - toSerialize["isExclusive"] = o.IsExclusive.Get() - } - if o.CronExpression.IsSet() { - toSerialize["cronExpression"] = o.CronExpression.Get() - } - if o.Timezone.IsSet() { - toSerialize["timezone"] = o.Timezone.Get() - } - if o.Description.IsSet() { - toSerialize["description"] = o.Description.Get() - } - if o.Title.IsSet() { - toSerialize["title"] = o.Title.Get() - } - if o.Actions != nil { - toSerialize["actions"] = o.Actions - } - return toSerialize, nil -} - -type NullableScheduleCreate struct { - value *ScheduleCreate - isSet bool -} - -func (v NullableScheduleCreate) Get() *ScheduleCreate { - return v.value -} - -func (v *NullableScheduleCreate) Set(val *ScheduleCreate) { - v.value = val - v.isSet = true -} - -func (v NullableScheduleCreate) IsSet() bool { - return v.isSet -} - -func (v *NullableScheduleCreate) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableScheduleCreate(val *ScheduleCreate) *NullableScheduleCreate { - return &NullableScheduleCreate{value: val, isSet: true} -} - -func (v NullableScheduleCreate) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableScheduleCreate) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_schedule_create_action.go b/model_schedule_create_action.go deleted file mode 100644 index aa7cb62..0000000 --- a/model_schedule_create_action.go +++ /dev/null @@ -1,171 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" - "fmt" - "gopkg.in/validator.v2" -) - -// ScheduleCreateAction - struct for ScheduleCreateAction -type ScheduleCreateAction struct { - ScheduleCreateActionRunActor *ScheduleCreateActionRunActor - ScheduleCreateActionRunActorTask *ScheduleCreateActionRunActorTask -} - -// ScheduleCreateActionRunActorAsScheduleCreateAction is a convenience function that returns ScheduleCreateActionRunActor wrapped in ScheduleCreateAction -func ScheduleCreateActionRunActorAsScheduleCreateAction(v *ScheduleCreateActionRunActor) ScheduleCreateAction { - return ScheduleCreateAction{ - ScheduleCreateActionRunActor: v, - } -} - -// ScheduleCreateActionRunActorTaskAsScheduleCreateAction is a convenience function that returns ScheduleCreateActionRunActorTask wrapped in ScheduleCreateAction -func ScheduleCreateActionRunActorTaskAsScheduleCreateAction(v *ScheduleCreateActionRunActorTask) ScheduleCreateAction { - return ScheduleCreateAction{ - ScheduleCreateActionRunActorTask: v, - } -} - - -// Unmarshal JSON data into one of the pointers in the struct -func (dst *ScheduleCreateAction) UnmarshalJSON(data []byte) error { - var err error - match := 0 - // try to unmarshal data into ScheduleCreateActionRunActor - err = newStrictDecoder(data).Decode(&dst.ScheduleCreateActionRunActor) - if err == nil { - jsonScheduleCreateActionRunActor, _ := json.Marshal(dst.ScheduleCreateActionRunActor) - if string(jsonScheduleCreateActionRunActor) == "{}" { // empty struct - dst.ScheduleCreateActionRunActor = nil - } else { - if err = validator.Validate(dst.ScheduleCreateActionRunActor); err != nil { - dst.ScheduleCreateActionRunActor = nil - } else { - match++ - } - } - } else { - dst.ScheduleCreateActionRunActor = nil - } - - // try to unmarshal data into ScheduleCreateActionRunActorTask - err = newStrictDecoder(data).Decode(&dst.ScheduleCreateActionRunActorTask) - if err == nil { - jsonScheduleCreateActionRunActorTask, _ := json.Marshal(dst.ScheduleCreateActionRunActorTask) - if string(jsonScheduleCreateActionRunActorTask) == "{}" { // empty struct - dst.ScheduleCreateActionRunActorTask = nil - } else { - if err = validator.Validate(dst.ScheduleCreateActionRunActorTask); err != nil { - dst.ScheduleCreateActionRunActorTask = nil - } else { - match++ - } - } - } else { - dst.ScheduleCreateActionRunActorTask = nil - } - - if match > 1 { // more than 1 match - // reset to nil - dst.ScheduleCreateActionRunActor = nil - dst.ScheduleCreateActionRunActorTask = nil - - return fmt.Errorf("data matches more than one schema in oneOf(ScheduleCreateAction)") - } else if match == 1 { - return nil // exactly one match - } else { // no match - return fmt.Errorf("data failed to match schemas in oneOf(ScheduleCreateAction)") - } -} - -// Marshal data from the first non-nil pointers in the struct to JSON -func (src ScheduleCreateAction) MarshalJSON() ([]byte, error) { - if src.ScheduleCreateActionRunActor != nil { - return json.Marshal(&src.ScheduleCreateActionRunActor) - } - - if src.ScheduleCreateActionRunActorTask != nil { - return json.Marshal(&src.ScheduleCreateActionRunActorTask) - } - - return nil, nil // no data in oneOf schemas -} - -// Get the actual instance -func (obj *ScheduleCreateAction) GetActualInstance() (interface{}) { - if obj == nil { - return nil - } - if obj.ScheduleCreateActionRunActor != nil { - return obj.ScheduleCreateActionRunActor - } - - if obj.ScheduleCreateActionRunActorTask != nil { - return obj.ScheduleCreateActionRunActorTask - } - - // all schemas are nil - return nil -} - -// Get the actual instance value -func (obj ScheduleCreateAction) GetActualInstanceValue() (interface{}) { - if obj.ScheduleCreateActionRunActor != nil { - return *obj.ScheduleCreateActionRunActor - } - - if obj.ScheduleCreateActionRunActorTask != nil { - return *obj.ScheduleCreateActionRunActorTask - } - - // all schemas are nil - return nil -} - -type NullableScheduleCreateAction struct { - value *ScheduleCreateAction - isSet bool -} - -func (v NullableScheduleCreateAction) Get() *ScheduleCreateAction { - return v.value -} - -func (v *NullableScheduleCreateAction) Set(val *ScheduleCreateAction) { - v.value = val - v.isSet = true -} - -func (v NullableScheduleCreateAction) IsSet() bool { - return v.isSet -} - -func (v *NullableScheduleCreateAction) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableScheduleCreateAction(val *ScheduleCreateAction) *NullableScheduleCreateAction { - return &NullableScheduleCreateAction{value: val, isSet: true} -} - -func (v NullableScheduleCreateAction) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableScheduleCreateAction) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_schedule_create_action_run_actor.go b/model_schedule_create_action_run_actor.go deleted file mode 100644 index 94ee5d7..0000000 --- a/model_schedule_create_action_run_actor.go +++ /dev/null @@ -1,282 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" - "bytes" - "fmt" -) - -// checks if the ScheduleCreateActionRunActor type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &ScheduleCreateActionRunActor{} - -// ScheduleCreateActionRunActor struct for ScheduleCreateActionRunActor -type ScheduleCreateActionRunActor struct { - Type interface{} `json:"type"` - ActorId string `json:"actorId"` - RunInput NullableScheduleActionRunInput `json:"runInput,omitempty"` - RunOptions NullableTaskOptions `json:"runOptions,omitempty"` -} - -type _ScheduleCreateActionRunActor ScheduleCreateActionRunActor - -// NewScheduleCreateActionRunActor instantiates a new ScheduleCreateActionRunActor object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewScheduleCreateActionRunActor(type_ interface{}, actorId string) *ScheduleCreateActionRunActor { - this := ScheduleCreateActionRunActor{} - this.Type = type_ - this.ActorId = actorId - return &this -} - -// NewScheduleCreateActionRunActorWithDefaults instantiates a new ScheduleCreateActionRunActor object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewScheduleCreateActionRunActorWithDefaults() *ScheduleCreateActionRunActor { - this := ScheduleCreateActionRunActor{} - return &this -} - -// GetType returns the Type field value -// If the value is explicit nil, the zero value for interface{} will be returned -func (o *ScheduleCreateActionRunActor) GetType() interface{} { - if o == nil { - var ret interface{} - return ret - } - - return o.Type -} - -// GetTypeOk returns a tuple with the Type field value -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *ScheduleCreateActionRunActor) GetTypeOk() (*interface{}, bool) { - if o == nil || IsNil(o.Type) { - return nil, false - } - return &o.Type, true -} - -// SetType sets field value -func (o *ScheduleCreateActionRunActor) SetType(v interface{}) { - o.Type = v -} - -// GetActorId returns the ActorId field value -func (o *ScheduleCreateActionRunActor) GetActorId() string { - if o == nil { - var ret string - return ret - } - - return o.ActorId -} - -// GetActorIdOk returns a tuple with the ActorId field value -// and a boolean to check if the value has been set. -func (o *ScheduleCreateActionRunActor) GetActorIdOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.ActorId, true -} - -// SetActorId sets field value -func (o *ScheduleCreateActionRunActor) SetActorId(v string) { - o.ActorId = v -} - -// GetRunInput returns the RunInput field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *ScheduleCreateActionRunActor) GetRunInput() ScheduleActionRunInput { - if o == nil || IsNil(o.RunInput.Get()) { - var ret ScheduleActionRunInput - return ret - } - return *o.RunInput.Get() -} - -// GetRunInputOk returns a tuple with the RunInput field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *ScheduleCreateActionRunActor) GetRunInputOk() (*ScheduleActionRunInput, bool) { - if o == nil { - return nil, false - } - return o.RunInput.Get(), o.RunInput.IsSet() -} - -// HasRunInput returns a boolean if a field has been set. -func (o *ScheduleCreateActionRunActor) HasRunInput() bool { - if o != nil && o.RunInput.IsSet() { - return true - } - - return false -} - -// SetRunInput gets a reference to the given NullableScheduleActionRunInput and assigns it to the RunInput field. -func (o *ScheduleCreateActionRunActor) SetRunInput(v ScheduleActionRunInput) { - o.RunInput.Set(&v) -} -// SetRunInputNil sets the value for RunInput to be an explicit nil -func (o *ScheduleCreateActionRunActor) SetRunInputNil() { - o.RunInput.Set(nil) -} - -// UnsetRunInput ensures that no value is present for RunInput, not even an explicit nil -func (o *ScheduleCreateActionRunActor) UnsetRunInput() { - o.RunInput.Unset() -} - -// GetRunOptions returns the RunOptions field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *ScheduleCreateActionRunActor) GetRunOptions() TaskOptions { - if o == nil || IsNil(o.RunOptions.Get()) { - var ret TaskOptions - return ret - } - return *o.RunOptions.Get() -} - -// GetRunOptionsOk returns a tuple with the RunOptions field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *ScheduleCreateActionRunActor) GetRunOptionsOk() (*TaskOptions, bool) { - if o == nil { - return nil, false - } - return o.RunOptions.Get(), o.RunOptions.IsSet() -} - -// HasRunOptions returns a boolean if a field has been set. -func (o *ScheduleCreateActionRunActor) HasRunOptions() bool { - if o != nil && o.RunOptions.IsSet() { - return true - } - - return false -} - -// SetRunOptions gets a reference to the given NullableTaskOptions and assigns it to the RunOptions field. -func (o *ScheduleCreateActionRunActor) SetRunOptions(v TaskOptions) { - o.RunOptions.Set(&v) -} -// SetRunOptionsNil sets the value for RunOptions to be an explicit nil -func (o *ScheduleCreateActionRunActor) SetRunOptionsNil() { - o.RunOptions.Set(nil) -} - -// UnsetRunOptions ensures that no value is present for RunOptions, not even an explicit nil -func (o *ScheduleCreateActionRunActor) UnsetRunOptions() { - o.RunOptions.Unset() -} - -func (o ScheduleCreateActionRunActor) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o ScheduleCreateActionRunActor) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if o.Type != nil { - toSerialize["type"] = o.Type - } - toSerialize["actorId"] = o.ActorId - if o.RunInput.IsSet() { - toSerialize["runInput"] = o.RunInput.Get() - } - if o.RunOptions.IsSet() { - toSerialize["runOptions"] = o.RunOptions.Get() - } - return toSerialize, nil -} - -func (o *ScheduleCreateActionRunActor) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "type", - "actorId", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err; - } - - for _, requiredProperty := range(requiredProperties) { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varScheduleCreateActionRunActor := _ScheduleCreateActionRunActor{} - - decoder := json.NewDecoder(bytes.NewReader(data)) - decoder.DisallowUnknownFields() - err = decoder.Decode(&varScheduleCreateActionRunActor) - - if err != nil { - return err - } - - *o = ScheduleCreateActionRunActor(varScheduleCreateActionRunActor) - - return err -} - -type NullableScheduleCreateActionRunActor struct { - value *ScheduleCreateActionRunActor - isSet bool -} - -func (v NullableScheduleCreateActionRunActor) Get() *ScheduleCreateActionRunActor { - return v.value -} - -func (v *NullableScheduleCreateActionRunActor) Set(val *ScheduleCreateActionRunActor) { - v.value = val - v.isSet = true -} - -func (v NullableScheduleCreateActionRunActor) IsSet() bool { - return v.isSet -} - -func (v *NullableScheduleCreateActionRunActor) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableScheduleCreateActionRunActor(val *ScheduleCreateActionRunActor) *NullableScheduleCreateActionRunActor { - return &NullableScheduleCreateActionRunActor{value: val, isSet: true} -} - -func (v NullableScheduleCreateActionRunActor) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableScheduleCreateActionRunActor) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_schedule_create_action_run_actor_task.go b/model_schedule_create_action_run_actor_task.go deleted file mode 100644 index 39f6798..0000000 --- a/model_schedule_create_action_run_actor_task.go +++ /dev/null @@ -1,227 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" - "bytes" - "fmt" -) - -// checks if the ScheduleCreateActionRunActorTask type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &ScheduleCreateActionRunActorTask{} - -// ScheduleCreateActionRunActorTask struct for ScheduleCreateActionRunActorTask -type ScheduleCreateActionRunActorTask struct { - Type interface{} `json:"type"` - ActorTaskId string `json:"actorTaskId"` - Input map[string]interface{} `json:"input,omitempty"` -} - -type _ScheduleCreateActionRunActorTask ScheduleCreateActionRunActorTask - -// NewScheduleCreateActionRunActorTask instantiates a new ScheduleCreateActionRunActorTask object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewScheduleCreateActionRunActorTask(type_ interface{}, actorTaskId string) *ScheduleCreateActionRunActorTask { - this := ScheduleCreateActionRunActorTask{} - this.Type = type_ - this.ActorTaskId = actorTaskId - return &this -} - -// NewScheduleCreateActionRunActorTaskWithDefaults instantiates a new ScheduleCreateActionRunActorTask object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewScheduleCreateActionRunActorTaskWithDefaults() *ScheduleCreateActionRunActorTask { - this := ScheduleCreateActionRunActorTask{} - return &this -} - -// GetType returns the Type field value -// If the value is explicit nil, the zero value for interface{} will be returned -func (o *ScheduleCreateActionRunActorTask) GetType() interface{} { - if o == nil { - var ret interface{} - return ret - } - - return o.Type -} - -// GetTypeOk returns a tuple with the Type field value -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *ScheduleCreateActionRunActorTask) GetTypeOk() (*interface{}, bool) { - if o == nil || IsNil(o.Type) { - return nil, false - } - return &o.Type, true -} - -// SetType sets field value -func (o *ScheduleCreateActionRunActorTask) SetType(v interface{}) { - o.Type = v -} - -// GetActorTaskId returns the ActorTaskId field value -func (o *ScheduleCreateActionRunActorTask) GetActorTaskId() string { - if o == nil { - var ret string - return ret - } - - return o.ActorTaskId -} - -// GetActorTaskIdOk returns a tuple with the ActorTaskId field value -// and a boolean to check if the value has been set. -func (o *ScheduleCreateActionRunActorTask) GetActorTaskIdOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.ActorTaskId, true -} - -// SetActorTaskId sets field value -func (o *ScheduleCreateActionRunActorTask) SetActorTaskId(v string) { - o.ActorTaskId = v -} - -// GetInput returns the Input field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *ScheduleCreateActionRunActorTask) GetInput() map[string]interface{} { - if o == nil { - var ret map[string]interface{} - return ret - } - return o.Input -} - -// GetInputOk returns a tuple with the Input field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *ScheduleCreateActionRunActorTask) GetInputOk() (map[string]interface{}, bool) { - if o == nil || IsNil(o.Input) { - return map[string]interface{}{}, false - } - return o.Input, true -} - -// HasInput returns a boolean if a field has been set. -func (o *ScheduleCreateActionRunActorTask) HasInput() bool { - if o != nil && !IsNil(o.Input) { - return true - } - - return false -} - -// SetInput gets a reference to the given map[string]interface{} and assigns it to the Input field. -func (o *ScheduleCreateActionRunActorTask) SetInput(v map[string]interface{}) { - o.Input = v -} - -func (o ScheduleCreateActionRunActorTask) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o ScheduleCreateActionRunActorTask) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if o.Type != nil { - toSerialize["type"] = o.Type - } - toSerialize["actorTaskId"] = o.ActorTaskId - if o.Input != nil { - toSerialize["input"] = o.Input - } - return toSerialize, nil -} - -func (o *ScheduleCreateActionRunActorTask) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "type", - "actorTaskId", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err; - } - - for _, requiredProperty := range(requiredProperties) { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varScheduleCreateActionRunActorTask := _ScheduleCreateActionRunActorTask{} - - decoder := json.NewDecoder(bytes.NewReader(data)) - decoder.DisallowUnknownFields() - err = decoder.Decode(&varScheduleCreateActionRunActorTask) - - if err != nil { - return err - } - - *o = ScheduleCreateActionRunActorTask(varScheduleCreateActionRunActorTask) - - return err -} - -type NullableScheduleCreateActionRunActorTask struct { - value *ScheduleCreateActionRunActorTask - isSet bool -} - -func (v NullableScheduleCreateActionRunActorTask) Get() *ScheduleCreateActionRunActorTask { - return v.value -} - -func (v *NullableScheduleCreateActionRunActorTask) Set(val *ScheduleCreateActionRunActorTask) { - v.value = val - v.isSet = true -} - -func (v NullableScheduleCreateActionRunActorTask) IsSet() bool { - return v.isSet -} - -func (v *NullableScheduleCreateActionRunActorTask) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableScheduleCreateActionRunActorTask(val *ScheduleCreateActionRunActorTask) *NullableScheduleCreateActionRunActorTask { - return &NullableScheduleCreateActionRunActorTask{value: val, isSet: true} -} - -func (v NullableScheduleCreateActionRunActorTask) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableScheduleCreateActionRunActorTask) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_schedule_invoked.go b/model_schedule_invoked.go deleted file mode 100644 index 6ee3fc6..0000000 --- a/model_schedule_invoked.go +++ /dev/null @@ -1,215 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" - "time" - "bytes" - "fmt" -) - -// checks if the ScheduleInvoked type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &ScheduleInvoked{} - -// ScheduleInvoked struct for ScheduleInvoked -type ScheduleInvoked struct { - Message string `json:"message"` - Level string `json:"level"` - CreatedAt time.Time `json:"createdAt"` -} - -type _ScheduleInvoked ScheduleInvoked - -// NewScheduleInvoked instantiates a new ScheduleInvoked object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewScheduleInvoked(message string, level string, createdAt time.Time) *ScheduleInvoked { - this := ScheduleInvoked{} - this.Message = message - this.Level = level - this.CreatedAt = createdAt - return &this -} - -// NewScheduleInvokedWithDefaults instantiates a new ScheduleInvoked object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewScheduleInvokedWithDefaults() *ScheduleInvoked { - this := ScheduleInvoked{} - return &this -} - -// GetMessage returns the Message field value -func (o *ScheduleInvoked) GetMessage() string { - if o == nil { - var ret string - return ret - } - - return o.Message -} - -// GetMessageOk returns a tuple with the Message field value -// and a boolean to check if the value has been set. -func (o *ScheduleInvoked) GetMessageOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Message, true -} - -// SetMessage sets field value -func (o *ScheduleInvoked) SetMessage(v string) { - o.Message = v -} - -// GetLevel returns the Level field value -func (o *ScheduleInvoked) GetLevel() string { - if o == nil { - var ret string - return ret - } - - return o.Level -} - -// GetLevelOk returns a tuple with the Level field value -// and a boolean to check if the value has been set. -func (o *ScheduleInvoked) GetLevelOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Level, true -} - -// SetLevel sets field value -func (o *ScheduleInvoked) SetLevel(v string) { - o.Level = v -} - -// GetCreatedAt returns the CreatedAt field value -func (o *ScheduleInvoked) GetCreatedAt() time.Time { - if o == nil { - var ret time.Time - return ret - } - - return o.CreatedAt -} - -// GetCreatedAtOk returns a tuple with the CreatedAt field value -// and a boolean to check if the value has been set. -func (o *ScheduleInvoked) GetCreatedAtOk() (*time.Time, bool) { - if o == nil { - return nil, false - } - return &o.CreatedAt, true -} - -// SetCreatedAt sets field value -func (o *ScheduleInvoked) SetCreatedAt(v time.Time) { - o.CreatedAt = v -} - -func (o ScheduleInvoked) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o ScheduleInvoked) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["message"] = o.Message - toSerialize["level"] = o.Level - toSerialize["createdAt"] = o.CreatedAt - return toSerialize, nil -} - -func (o *ScheduleInvoked) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "message", - "level", - "createdAt", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err; - } - - for _, requiredProperty := range(requiredProperties) { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varScheduleInvoked := _ScheduleInvoked{} - - decoder := json.NewDecoder(bytes.NewReader(data)) - decoder.DisallowUnknownFields() - err = decoder.Decode(&varScheduleInvoked) - - if err != nil { - return err - } - - *o = ScheduleInvoked(varScheduleInvoked) - - return err -} - -type NullableScheduleInvoked struct { - value *ScheduleInvoked - isSet bool -} - -func (v NullableScheduleInvoked) Get() *ScheduleInvoked { - return v.value -} - -func (v *NullableScheduleInvoked) Set(val *ScheduleInvoked) { - v.value = val - v.isSet = true -} - -func (v NullableScheduleInvoked) IsSet() bool { - return v.isSet -} - -func (v *NullableScheduleInvoked) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableScheduleInvoked(val *ScheduleInvoked) *NullableScheduleInvoked { - return &NullableScheduleInvoked{value: val, isSet: true} -} - -func (v NullableScheduleInvoked) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableScheduleInvoked) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_schedule_log_response.go b/model_schedule_log_response.go deleted file mode 100644 index 190802c..0000000 --- a/model_schedule_log_response.go +++ /dev/null @@ -1,159 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" - "bytes" - "fmt" -) - -// checks if the ScheduleLogResponse type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &ScheduleLogResponse{} - -// ScheduleLogResponse struct for ScheduleLogResponse -type ScheduleLogResponse struct { - // - Data []ScheduleInvoked `json:"data"` -} - -type _ScheduleLogResponse ScheduleLogResponse - -// NewScheduleLogResponse instantiates a new ScheduleLogResponse object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewScheduleLogResponse(data []ScheduleInvoked) *ScheduleLogResponse { - this := ScheduleLogResponse{} - this.Data = data - return &this -} - -// NewScheduleLogResponseWithDefaults instantiates a new ScheduleLogResponse object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewScheduleLogResponseWithDefaults() *ScheduleLogResponse { - this := ScheduleLogResponse{} - return &this -} - -// GetData returns the Data field value -func (o *ScheduleLogResponse) GetData() []ScheduleInvoked { - if o == nil { - var ret []ScheduleInvoked - return ret - } - - return o.Data -} - -// GetDataOk returns a tuple with the Data field value -// and a boolean to check if the value has been set. -func (o *ScheduleLogResponse) GetDataOk() ([]ScheduleInvoked, bool) { - if o == nil { - return nil, false - } - return o.Data, true -} - -// SetData sets field value -func (o *ScheduleLogResponse) SetData(v []ScheduleInvoked) { - o.Data = v -} - -func (o ScheduleLogResponse) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o ScheduleLogResponse) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["data"] = o.Data - return toSerialize, nil -} - -func (o *ScheduleLogResponse) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "data", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err; - } - - for _, requiredProperty := range(requiredProperties) { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varScheduleLogResponse := _ScheduleLogResponse{} - - decoder := json.NewDecoder(bytes.NewReader(data)) - decoder.DisallowUnknownFields() - err = decoder.Decode(&varScheduleLogResponse) - - if err != nil { - return err - } - - *o = ScheduleLogResponse(varScheduleLogResponse) - - return err -} - -type NullableScheduleLogResponse struct { - value *ScheduleLogResponse - isSet bool -} - -func (v NullableScheduleLogResponse) Get() *ScheduleLogResponse { - return v.value -} - -func (v *NullableScheduleLogResponse) Set(val *ScheduleLogResponse) { - v.value = val - v.isSet = true -} - -func (v NullableScheduleLogResponse) IsSet() bool { - return v.isSet -} - -func (v *NullableScheduleLogResponse) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableScheduleLogResponse(val *ScheduleLogResponse) *NullableScheduleLogResponse { - return &NullableScheduleLogResponse{value: val, isSet: true} -} - -func (v NullableScheduleLogResponse) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableScheduleLogResponse) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_schedule_notifications.go b/model_schedule_notifications.go deleted file mode 100644 index aaee9bc..0000000 --- a/model_schedule_notifications.go +++ /dev/null @@ -1,126 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" -) - -// checks if the ScheduleNotifications type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &ScheduleNotifications{} - -// ScheduleNotifications Notification settings for this schedule. -type ScheduleNotifications struct { - Email *bool `json:"email,omitempty"` -} - -// NewScheduleNotifications instantiates a new ScheduleNotifications object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewScheduleNotifications() *ScheduleNotifications { - this := ScheduleNotifications{} - return &this -} - -// NewScheduleNotificationsWithDefaults instantiates a new ScheduleNotifications object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewScheduleNotificationsWithDefaults() *ScheduleNotifications { - this := ScheduleNotifications{} - return &this -} - -// GetEmail returns the Email field value if set, zero value otherwise. -func (o *ScheduleNotifications) GetEmail() bool { - if o == nil || IsNil(o.Email) { - var ret bool - return ret - } - return *o.Email -} - -// GetEmailOk returns a tuple with the Email field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ScheduleNotifications) GetEmailOk() (*bool, bool) { - if o == nil || IsNil(o.Email) { - return nil, false - } - return o.Email, true -} - -// HasEmail returns a boolean if a field has been set. -func (o *ScheduleNotifications) HasEmail() bool { - if o != nil && !IsNil(o.Email) { - return true - } - - return false -} - -// SetEmail gets a reference to the given bool and assigns it to the Email field. -func (o *ScheduleNotifications) SetEmail(v bool) { - o.Email = &v -} - -func (o ScheduleNotifications) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o ScheduleNotifications) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if !IsNil(o.Email) { - toSerialize["email"] = o.Email - } - return toSerialize, nil -} - -type NullableScheduleNotifications struct { - value *ScheduleNotifications - isSet bool -} - -func (v NullableScheduleNotifications) Get() *ScheduleNotifications { - return v.value -} - -func (v *NullableScheduleNotifications) Set(val *ScheduleNotifications) { - v.value = val - v.isSet = true -} - -func (v NullableScheduleNotifications) IsSet() bool { - return v.isSet -} - -func (v *NullableScheduleNotifications) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableScheduleNotifications(val *ScheduleNotifications) *NullableScheduleNotifications { - return &NullableScheduleNotifications{value: val, isSet: true} -} - -func (v NullableScheduleNotifications) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableScheduleNotifications) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_schedule_response.go b/model_schedule_response.go deleted file mode 100644 index c1e350d..0000000 --- a/model_schedule_response.go +++ /dev/null @@ -1,158 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" - "bytes" - "fmt" -) - -// checks if the ScheduleResponse type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &ScheduleResponse{} - -// ScheduleResponse struct for ScheduleResponse -type ScheduleResponse struct { - Data Schedule `json:"data"` -} - -type _ScheduleResponse ScheduleResponse - -// NewScheduleResponse instantiates a new ScheduleResponse object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewScheduleResponse(data Schedule) *ScheduleResponse { - this := ScheduleResponse{} - this.Data = data - return &this -} - -// NewScheduleResponseWithDefaults instantiates a new ScheduleResponse object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewScheduleResponseWithDefaults() *ScheduleResponse { - this := ScheduleResponse{} - return &this -} - -// GetData returns the Data field value -func (o *ScheduleResponse) GetData() Schedule { - if o == nil { - var ret Schedule - return ret - } - - return o.Data -} - -// GetDataOk returns a tuple with the Data field value -// and a boolean to check if the value has been set. -func (o *ScheduleResponse) GetDataOk() (*Schedule, bool) { - if o == nil { - return nil, false - } - return &o.Data, true -} - -// SetData sets field value -func (o *ScheduleResponse) SetData(v Schedule) { - o.Data = v -} - -func (o ScheduleResponse) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o ScheduleResponse) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["data"] = o.Data - return toSerialize, nil -} - -func (o *ScheduleResponse) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "data", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err; - } - - for _, requiredProperty := range(requiredProperties) { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varScheduleResponse := _ScheduleResponse{} - - decoder := json.NewDecoder(bytes.NewReader(data)) - decoder.DisallowUnknownFields() - err = decoder.Decode(&varScheduleResponse) - - if err != nil { - return err - } - - *o = ScheduleResponse(varScheduleResponse) - - return err -} - -type NullableScheduleResponse struct { - value *ScheduleResponse - isSet bool -} - -func (v NullableScheduleResponse) Get() *ScheduleResponse { - return v.value -} - -func (v *NullableScheduleResponse) Set(val *ScheduleResponse) { - v.value = val - v.isSet = true -} - -func (v NullableScheduleResponse) IsSet() bool { - return v.isSet -} - -func (v *NullableScheduleResponse) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableScheduleResponse(val *ScheduleResponse) *NullableScheduleResponse { - return &NullableScheduleResponse{value: val, isSet: true} -} - -func (v NullableScheduleResponse) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableScheduleResponse) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_schedule_short.go b/model_schedule_short.go deleted file mode 100644 index 9ea2c5d..0000000 --- a/model_schedule_short.go +++ /dev/null @@ -1,484 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" - "time" - "bytes" - "fmt" -) - -// checks if the ScheduleShort type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &ScheduleShort{} - -// ScheduleShort struct for ScheduleShort -type ScheduleShort struct { - Id string `json:"id"` - UserId string `json:"userId"` - Name string `json:"name"` - CronExpression string `json:"cronExpression"` - Timezone string `json:"timezone"` - IsEnabled bool `json:"isEnabled"` - IsExclusive bool `json:"isExclusive"` - CreatedAt time.Time `json:"createdAt"` - ModifiedAt time.Time `json:"modifiedAt"` - NextRunAt *time.Time `json:"nextRunAt,omitempty"` - LastRunAt *time.Time `json:"lastRunAt,omitempty"` - // - Actions []ScheduleActionShort `json:"actions"` -} - -type _ScheduleShort ScheduleShort - -// NewScheduleShort instantiates a new ScheduleShort object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewScheduleShort(id string, userId string, name string, cronExpression string, timezone string, isEnabled bool, isExclusive bool, createdAt time.Time, modifiedAt time.Time, actions []ScheduleActionShort) *ScheduleShort { - this := ScheduleShort{} - this.Id = id - this.UserId = userId - this.Name = name - this.CronExpression = cronExpression - this.Timezone = timezone - this.IsEnabled = isEnabled - this.IsExclusive = isExclusive - this.CreatedAt = createdAt - this.ModifiedAt = modifiedAt - this.Actions = actions - return &this -} - -// NewScheduleShortWithDefaults instantiates a new ScheduleShort object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewScheduleShortWithDefaults() *ScheduleShort { - this := ScheduleShort{} - return &this -} - -// GetId returns the Id field value -func (o *ScheduleShort) GetId() string { - if o == nil { - var ret string - return ret - } - - return o.Id -} - -// GetIdOk returns a tuple with the Id field value -// and a boolean to check if the value has been set. -func (o *ScheduleShort) GetIdOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Id, true -} - -// SetId sets field value -func (o *ScheduleShort) SetId(v string) { - o.Id = v -} - -// GetUserId returns the UserId field value -func (o *ScheduleShort) GetUserId() string { - if o == nil { - var ret string - return ret - } - - return o.UserId -} - -// GetUserIdOk returns a tuple with the UserId field value -// and a boolean to check if the value has been set. -func (o *ScheduleShort) GetUserIdOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.UserId, true -} - -// SetUserId sets field value -func (o *ScheduleShort) SetUserId(v string) { - o.UserId = v -} - -// GetName returns the Name field value -func (o *ScheduleShort) GetName() string { - if o == nil { - var ret string - return ret - } - - return o.Name -} - -// GetNameOk returns a tuple with the Name field value -// and a boolean to check if the value has been set. -func (o *ScheduleShort) GetNameOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Name, true -} - -// SetName sets field value -func (o *ScheduleShort) SetName(v string) { - o.Name = v -} - -// GetCronExpression returns the CronExpression field value -func (o *ScheduleShort) GetCronExpression() string { - if o == nil { - var ret string - return ret - } - - return o.CronExpression -} - -// GetCronExpressionOk returns a tuple with the CronExpression field value -// and a boolean to check if the value has been set. -func (o *ScheduleShort) GetCronExpressionOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.CronExpression, true -} - -// SetCronExpression sets field value -func (o *ScheduleShort) SetCronExpression(v string) { - o.CronExpression = v -} - -// GetTimezone returns the Timezone field value -func (o *ScheduleShort) GetTimezone() string { - if o == nil { - var ret string - return ret - } - - return o.Timezone -} - -// GetTimezoneOk returns a tuple with the Timezone field value -// and a boolean to check if the value has been set. -func (o *ScheduleShort) GetTimezoneOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Timezone, true -} - -// SetTimezone sets field value -func (o *ScheduleShort) SetTimezone(v string) { - o.Timezone = v -} - -// GetIsEnabled returns the IsEnabled field value -func (o *ScheduleShort) GetIsEnabled() bool { - if o == nil { - var ret bool - return ret - } - - return o.IsEnabled -} - -// GetIsEnabledOk returns a tuple with the IsEnabled field value -// and a boolean to check if the value has been set. -func (o *ScheduleShort) GetIsEnabledOk() (*bool, bool) { - if o == nil { - return nil, false - } - return &o.IsEnabled, true -} - -// SetIsEnabled sets field value -func (o *ScheduleShort) SetIsEnabled(v bool) { - o.IsEnabled = v -} - -// GetIsExclusive returns the IsExclusive field value -func (o *ScheduleShort) GetIsExclusive() bool { - if o == nil { - var ret bool - return ret - } - - return o.IsExclusive -} - -// GetIsExclusiveOk returns a tuple with the IsExclusive field value -// and a boolean to check if the value has been set. -func (o *ScheduleShort) GetIsExclusiveOk() (*bool, bool) { - if o == nil { - return nil, false - } - return &o.IsExclusive, true -} - -// SetIsExclusive sets field value -func (o *ScheduleShort) SetIsExclusive(v bool) { - o.IsExclusive = v -} - -// GetCreatedAt returns the CreatedAt field value -func (o *ScheduleShort) GetCreatedAt() time.Time { - if o == nil { - var ret time.Time - return ret - } - - return o.CreatedAt -} - -// GetCreatedAtOk returns a tuple with the CreatedAt field value -// and a boolean to check if the value has been set. -func (o *ScheduleShort) GetCreatedAtOk() (*time.Time, bool) { - if o == nil { - return nil, false - } - return &o.CreatedAt, true -} - -// SetCreatedAt sets field value -func (o *ScheduleShort) SetCreatedAt(v time.Time) { - o.CreatedAt = v -} - -// GetModifiedAt returns the ModifiedAt field value -func (o *ScheduleShort) GetModifiedAt() time.Time { - if o == nil { - var ret time.Time - return ret - } - - return o.ModifiedAt -} - -// GetModifiedAtOk returns a tuple with the ModifiedAt field value -// and a boolean to check if the value has been set. -func (o *ScheduleShort) GetModifiedAtOk() (*time.Time, bool) { - if o == nil { - return nil, false - } - return &o.ModifiedAt, true -} - -// SetModifiedAt sets field value -func (o *ScheduleShort) SetModifiedAt(v time.Time) { - o.ModifiedAt = v -} - -// GetNextRunAt returns the NextRunAt field value if set, zero value otherwise. -func (o *ScheduleShort) GetNextRunAt() time.Time { - if o == nil || IsNil(o.NextRunAt) { - var ret time.Time - return ret - } - return *o.NextRunAt -} - -// GetNextRunAtOk returns a tuple with the NextRunAt field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ScheduleShort) GetNextRunAtOk() (*time.Time, bool) { - if o == nil || IsNil(o.NextRunAt) { - return nil, false - } - return o.NextRunAt, true -} - -// HasNextRunAt returns a boolean if a field has been set. -func (o *ScheduleShort) HasNextRunAt() bool { - if o != nil && !IsNil(o.NextRunAt) { - return true - } - - return false -} - -// SetNextRunAt gets a reference to the given time.Time and assigns it to the NextRunAt field. -func (o *ScheduleShort) SetNextRunAt(v time.Time) { - o.NextRunAt = &v -} - -// GetLastRunAt returns the LastRunAt field value if set, zero value otherwise. -func (o *ScheduleShort) GetLastRunAt() time.Time { - if o == nil || IsNil(o.LastRunAt) { - var ret time.Time - return ret - } - return *o.LastRunAt -} - -// GetLastRunAtOk returns a tuple with the LastRunAt field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ScheduleShort) GetLastRunAtOk() (*time.Time, bool) { - if o == nil || IsNil(o.LastRunAt) { - return nil, false - } - return o.LastRunAt, true -} - -// HasLastRunAt returns a boolean if a field has been set. -func (o *ScheduleShort) HasLastRunAt() bool { - if o != nil && !IsNil(o.LastRunAt) { - return true - } - - return false -} - -// SetLastRunAt gets a reference to the given time.Time and assigns it to the LastRunAt field. -func (o *ScheduleShort) SetLastRunAt(v time.Time) { - o.LastRunAt = &v -} - -// GetActions returns the Actions field value -func (o *ScheduleShort) GetActions() []ScheduleActionShort { - if o == nil { - var ret []ScheduleActionShort - return ret - } - - return o.Actions -} - -// GetActionsOk returns a tuple with the Actions field value -// and a boolean to check if the value has been set. -func (o *ScheduleShort) GetActionsOk() ([]ScheduleActionShort, bool) { - if o == nil { - return nil, false - } - return o.Actions, true -} - -// SetActions sets field value -func (o *ScheduleShort) SetActions(v []ScheduleActionShort) { - o.Actions = v -} - -func (o ScheduleShort) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o ScheduleShort) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["id"] = o.Id - toSerialize["userId"] = o.UserId - toSerialize["name"] = o.Name - toSerialize["cronExpression"] = o.CronExpression - toSerialize["timezone"] = o.Timezone - toSerialize["isEnabled"] = o.IsEnabled - toSerialize["isExclusive"] = o.IsExclusive - toSerialize["createdAt"] = o.CreatedAt - toSerialize["modifiedAt"] = o.ModifiedAt - if !IsNil(o.NextRunAt) { - toSerialize["nextRunAt"] = o.NextRunAt - } - if !IsNil(o.LastRunAt) { - toSerialize["lastRunAt"] = o.LastRunAt - } - toSerialize["actions"] = o.Actions - return toSerialize, nil -} - -func (o *ScheduleShort) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "id", - "userId", - "name", - "cronExpression", - "timezone", - "isEnabled", - "isExclusive", - "createdAt", - "modifiedAt", - "actions", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err; - } - - for _, requiredProperty := range(requiredProperties) { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varScheduleShort := _ScheduleShort{} - - decoder := json.NewDecoder(bytes.NewReader(data)) - decoder.DisallowUnknownFields() - err = decoder.Decode(&varScheduleShort) - - if err != nil { - return err - } - - *o = ScheduleShort(varScheduleShort) - - return err -} - -type NullableScheduleShort struct { - value *ScheduleShort - isSet bool -} - -func (v NullableScheduleShort) Get() *ScheduleShort { - return v.value -} - -func (v *NullableScheduleShort) Set(val *ScheduleShort) { - v.value = val - v.isSet = true -} - -func (v NullableScheduleShort) IsSet() bool { - return v.isSet -} - -func (v *NullableScheduleShort) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableScheduleShort(val *ScheduleShort) *NullableScheduleShort { - return &NullableScheduleShort{value: val, isSet: true} -} - -func (v NullableScheduleShort) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableScheduleShort) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_schema_validation_error_data.go b/model_schema_validation_error_data.go deleted file mode 100644 index 0ebbbde..0000000 --- a/model_schema_validation_error_data.go +++ /dev/null @@ -1,159 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" - "bytes" - "fmt" -) - -// checks if the SchemaValidationErrorData type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &SchemaValidationErrorData{} - -// SchemaValidationErrorData struct for SchemaValidationErrorData -type SchemaValidationErrorData struct { - // A list of invalid items in the received array of items. - InvalidItems []InvalidItem `json:"invalidItems"` -} - -type _SchemaValidationErrorData SchemaValidationErrorData - -// NewSchemaValidationErrorData instantiates a new SchemaValidationErrorData object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewSchemaValidationErrorData(invalidItems []InvalidItem) *SchemaValidationErrorData { - this := SchemaValidationErrorData{} - this.InvalidItems = invalidItems - return &this -} - -// NewSchemaValidationErrorDataWithDefaults instantiates a new SchemaValidationErrorData object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewSchemaValidationErrorDataWithDefaults() *SchemaValidationErrorData { - this := SchemaValidationErrorData{} - return &this -} - -// GetInvalidItems returns the InvalidItems field value -func (o *SchemaValidationErrorData) GetInvalidItems() []InvalidItem { - if o == nil { - var ret []InvalidItem - return ret - } - - return o.InvalidItems -} - -// GetInvalidItemsOk returns a tuple with the InvalidItems field value -// and a boolean to check if the value has been set. -func (o *SchemaValidationErrorData) GetInvalidItemsOk() ([]InvalidItem, bool) { - if o == nil { - return nil, false - } - return o.InvalidItems, true -} - -// SetInvalidItems sets field value -func (o *SchemaValidationErrorData) SetInvalidItems(v []InvalidItem) { - o.InvalidItems = v -} - -func (o SchemaValidationErrorData) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o SchemaValidationErrorData) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["invalidItems"] = o.InvalidItems - return toSerialize, nil -} - -func (o *SchemaValidationErrorData) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "invalidItems", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err; - } - - for _, requiredProperty := range(requiredProperties) { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varSchemaValidationErrorData := _SchemaValidationErrorData{} - - decoder := json.NewDecoder(bytes.NewReader(data)) - decoder.DisallowUnknownFields() - err = decoder.Decode(&varSchemaValidationErrorData) - - if err != nil { - return err - } - - *o = SchemaValidationErrorData(varSchemaValidationErrorData) - - return err -} - -type NullableSchemaValidationErrorData struct { - value *SchemaValidationErrorData - isSet bool -} - -func (v NullableSchemaValidationErrorData) Get() *SchemaValidationErrorData { - return v.value -} - -func (v *NullableSchemaValidationErrorData) Set(val *SchemaValidationErrorData) { - v.value = val - v.isSet = true -} - -func (v NullableSchemaValidationErrorData) IsSet() bool { - return v.isSet -} - -func (v *NullableSchemaValidationErrorData) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableSchemaValidationErrorData(val *SchemaValidationErrorData) *NullableSchemaValidationErrorData { - return &NullableSchemaValidationErrorData{value: val, isSet: true} -} - -func (v NullableSchemaValidationErrorData) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableSchemaValidationErrorData) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_source_code_file.go b/model_source_code_file.go deleted file mode 100644 index 3b54d86..0000000 --- a/model_source_code_file.go +++ /dev/null @@ -1,230 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" - "bytes" - "fmt" -) - -// checks if the SourceCodeFile type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &SourceCodeFile{} - -// SourceCodeFile struct for SourceCodeFile -type SourceCodeFile struct { - Format *SourceCodeFileFormat `json:"format,omitempty"` - Content *string `json:"content,omitempty"` - Name string `json:"name"` -} - -type _SourceCodeFile SourceCodeFile - -// NewSourceCodeFile instantiates a new SourceCodeFile object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewSourceCodeFile(name string) *SourceCodeFile { - this := SourceCodeFile{} - this.Name = name - return &this -} - -// NewSourceCodeFileWithDefaults instantiates a new SourceCodeFile object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewSourceCodeFileWithDefaults() *SourceCodeFile { - this := SourceCodeFile{} - return &this -} - -// GetFormat returns the Format field value if set, zero value otherwise. -func (o *SourceCodeFile) GetFormat() SourceCodeFileFormat { - if o == nil || IsNil(o.Format) { - var ret SourceCodeFileFormat - return ret - } - return *o.Format -} - -// GetFormatOk returns a tuple with the Format field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *SourceCodeFile) GetFormatOk() (*SourceCodeFileFormat, bool) { - if o == nil || IsNil(o.Format) { - return nil, false - } - return o.Format, true -} - -// HasFormat returns a boolean if a field has been set. -func (o *SourceCodeFile) HasFormat() bool { - if o != nil && !IsNil(o.Format) { - return true - } - - return false -} - -// SetFormat gets a reference to the given SourceCodeFileFormat and assigns it to the Format field. -func (o *SourceCodeFile) SetFormat(v SourceCodeFileFormat) { - o.Format = &v -} - -// GetContent returns the Content field value if set, zero value otherwise. -func (o *SourceCodeFile) GetContent() string { - if o == nil || IsNil(o.Content) { - var ret string - return ret - } - return *o.Content -} - -// GetContentOk returns a tuple with the Content field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *SourceCodeFile) GetContentOk() (*string, bool) { - if o == nil || IsNil(o.Content) { - return nil, false - } - return o.Content, true -} - -// HasContent returns a boolean if a field has been set. -func (o *SourceCodeFile) HasContent() bool { - if o != nil && !IsNil(o.Content) { - return true - } - - return false -} - -// SetContent gets a reference to the given string and assigns it to the Content field. -func (o *SourceCodeFile) SetContent(v string) { - o.Content = &v -} - -// GetName returns the Name field value -func (o *SourceCodeFile) GetName() string { - if o == nil { - var ret string - return ret - } - - return o.Name -} - -// GetNameOk returns a tuple with the Name field value -// and a boolean to check if the value has been set. -func (o *SourceCodeFile) GetNameOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Name, true -} - -// SetName sets field value -func (o *SourceCodeFile) SetName(v string) { - o.Name = v -} - -func (o SourceCodeFile) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o SourceCodeFile) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if !IsNil(o.Format) { - toSerialize["format"] = o.Format - } - if !IsNil(o.Content) { - toSerialize["content"] = o.Content - } - toSerialize["name"] = o.Name - return toSerialize, nil -} - -func (o *SourceCodeFile) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "name", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err; - } - - for _, requiredProperty := range(requiredProperties) { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varSourceCodeFile := _SourceCodeFile{} - - decoder := json.NewDecoder(bytes.NewReader(data)) - decoder.DisallowUnknownFields() - err = decoder.Decode(&varSourceCodeFile) - - if err != nil { - return err - } - - *o = SourceCodeFile(varSourceCodeFile) - - return err -} - -type NullableSourceCodeFile struct { - value *SourceCodeFile - isSet bool -} - -func (v NullableSourceCodeFile) Get() *SourceCodeFile { - return v.value -} - -func (v *NullableSourceCodeFile) Set(val *SourceCodeFile) { - v.value = val - v.isSet = true -} - -func (v NullableSourceCodeFile) IsSet() bool { - return v.isSet -} - -func (v *NullableSourceCodeFile) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableSourceCodeFile(val *SourceCodeFile) *NullableSourceCodeFile { - return &NullableSourceCodeFile{value: val, isSet: true} -} - -func (v NullableSourceCodeFile) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableSourceCodeFile) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_source_code_file_format.go b/model_source_code_file_format.go deleted file mode 100644 index 01994ff..0000000 --- a/model_source_code_file_format.go +++ /dev/null @@ -1,111 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" - "fmt" -) - -// SourceCodeFileFormat the model 'SourceCodeFileFormat' -type SourceCodeFileFormat string - -// List of SourceCodeFileFormat -const ( - BASE64 SourceCodeFileFormat = "BASE64" - TEXT SourceCodeFileFormat = "TEXT" -) - -// All allowed values of SourceCodeFileFormat enum -var AllowedSourceCodeFileFormatEnumValues = []SourceCodeFileFormat{ - "BASE64", - "TEXT", -} - -func (v *SourceCodeFileFormat) UnmarshalJSON(src []byte) error { - var value string - err := json.Unmarshal(src, &value) - if err != nil { - return err - } - enumTypeValue := SourceCodeFileFormat(value) - for _, existing := range AllowedSourceCodeFileFormatEnumValues { - if existing == enumTypeValue { - *v = enumTypeValue - return nil - } - } - - return fmt.Errorf("%+v is not a valid SourceCodeFileFormat", value) -} - -// NewSourceCodeFileFormatFromValue returns a pointer to a valid SourceCodeFileFormat -// for the value passed as argument, or an error if the value passed is not allowed by the enum -func NewSourceCodeFileFormatFromValue(v string) (*SourceCodeFileFormat, error) { - ev := SourceCodeFileFormat(v) - if ev.IsValid() { - return &ev, nil - } else { - return nil, fmt.Errorf("invalid value '%v' for SourceCodeFileFormat: valid values are %v", v, AllowedSourceCodeFileFormatEnumValues) - } -} - -// IsValid return true if the value is valid for the enum, false otherwise -func (v SourceCodeFileFormat) IsValid() bool { - for _, existing := range AllowedSourceCodeFileFormatEnumValues { - if existing == v { - return true - } - } - return false -} - -// Ptr returns reference to SourceCodeFileFormat value -func (v SourceCodeFileFormat) Ptr() *SourceCodeFileFormat { - return &v -} - -type NullableSourceCodeFileFormat struct { - value *SourceCodeFileFormat - isSet bool -} - -func (v NullableSourceCodeFileFormat) Get() *SourceCodeFileFormat { - return v.value -} - -func (v *NullableSourceCodeFileFormat) Set(val *SourceCodeFileFormat) { - v.value = val - v.isSet = true -} - -func (v NullableSourceCodeFileFormat) IsSet() bool { - return v.isSet -} - -func (v *NullableSourceCodeFileFormat) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableSourceCodeFileFormat(val *SourceCodeFileFormat) *NullableSourceCodeFileFormat { - return &NullableSourceCodeFileFormat{value: val, isSet: true} -} - -func (v NullableSourceCodeFileFormat) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableSourceCodeFileFormat) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - diff --git a/model_source_code_folder.go b/model_source_code_folder.go deleted file mode 100644 index a971abc..0000000 --- a/model_source_code_folder.go +++ /dev/null @@ -1,188 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" - "bytes" - "fmt" -) - -// checks if the SourceCodeFolder type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &SourceCodeFolder{} - -// SourceCodeFolder Represents a folder in the Actor's source code structure. Distinguished from SourceCodeFile by the presence of the `folder` property set to `true`. -type SourceCodeFolder struct { - // The folder path relative to the Actor's root directory. - Name string `json:"name"` - // Always `true` for folders. Used to distinguish folders from files. - Folder bool `json:"folder"` -} - -type _SourceCodeFolder SourceCodeFolder - -// NewSourceCodeFolder instantiates a new SourceCodeFolder object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewSourceCodeFolder(name string, folder bool) *SourceCodeFolder { - this := SourceCodeFolder{} - this.Name = name - this.Folder = folder - return &this -} - -// NewSourceCodeFolderWithDefaults instantiates a new SourceCodeFolder object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewSourceCodeFolderWithDefaults() *SourceCodeFolder { - this := SourceCodeFolder{} - return &this -} - -// GetName returns the Name field value -func (o *SourceCodeFolder) GetName() string { - if o == nil { - var ret string - return ret - } - - return o.Name -} - -// GetNameOk returns a tuple with the Name field value -// and a boolean to check if the value has been set. -func (o *SourceCodeFolder) GetNameOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Name, true -} - -// SetName sets field value -func (o *SourceCodeFolder) SetName(v string) { - o.Name = v -} - -// GetFolder returns the Folder field value -func (o *SourceCodeFolder) GetFolder() bool { - if o == nil { - var ret bool - return ret - } - - return o.Folder -} - -// GetFolderOk returns a tuple with the Folder field value -// and a boolean to check if the value has been set. -func (o *SourceCodeFolder) GetFolderOk() (*bool, bool) { - if o == nil { - return nil, false - } - return &o.Folder, true -} - -// SetFolder sets field value -func (o *SourceCodeFolder) SetFolder(v bool) { - o.Folder = v -} - -func (o SourceCodeFolder) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o SourceCodeFolder) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["name"] = o.Name - toSerialize["folder"] = o.Folder - return toSerialize, nil -} - -func (o *SourceCodeFolder) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "name", - "folder", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err; - } - - for _, requiredProperty := range(requiredProperties) { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varSourceCodeFolder := _SourceCodeFolder{} - - decoder := json.NewDecoder(bytes.NewReader(data)) - decoder.DisallowUnknownFields() - err = decoder.Decode(&varSourceCodeFolder) - - if err != nil { - return err - } - - *o = SourceCodeFolder(varSourceCodeFolder) - - return err -} - -type NullableSourceCodeFolder struct { - value *SourceCodeFolder - isSet bool -} - -func (v NullableSourceCodeFolder) Get() *SourceCodeFolder { - return v.value -} - -func (v *NullableSourceCodeFolder) Set(val *SourceCodeFolder) { - v.value = val - v.isSet = true -} - -func (v NullableSourceCodeFolder) IsSet() bool { - return v.isSet -} - -func (v *NullableSourceCodeFolder) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableSourceCodeFolder(val *SourceCodeFolder) *NullableSourceCodeFolder { - return &NullableSourceCodeFolder{value: val, isSet: true} -} - -func (v NullableSourceCodeFolder) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableSourceCodeFolder) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_storage_ownership.go b/model_storage_ownership.go deleted file mode 100644 index 5741691..0000000 --- a/model_storage_ownership.go +++ /dev/null @@ -1,111 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" - "fmt" -) - -// StorageOwnership the model 'StorageOwnership' -type StorageOwnership string - -// List of StorageOwnership -const ( - OWNED_BY_ME StorageOwnership = "ownedByMe" - SHARED_WITH_ME StorageOwnership = "sharedWithMe" -) - -// All allowed values of StorageOwnership enum -var AllowedStorageOwnershipEnumValues = []StorageOwnership{ - "ownedByMe", - "sharedWithMe", -} - -func (v *StorageOwnership) UnmarshalJSON(src []byte) error { - var value string - err := json.Unmarshal(src, &value) - if err != nil { - return err - } - enumTypeValue := StorageOwnership(value) - for _, existing := range AllowedStorageOwnershipEnumValues { - if existing == enumTypeValue { - *v = enumTypeValue - return nil - } - } - - return fmt.Errorf("%+v is not a valid StorageOwnership", value) -} - -// NewStorageOwnershipFromValue returns a pointer to a valid StorageOwnership -// for the value passed as argument, or an error if the value passed is not allowed by the enum -func NewStorageOwnershipFromValue(v string) (*StorageOwnership, error) { - ev := StorageOwnership(v) - if ev.IsValid() { - return &ev, nil - } else { - return nil, fmt.Errorf("invalid value '%v' for StorageOwnership: valid values are %v", v, AllowedStorageOwnershipEnumValues) - } -} - -// IsValid return true if the value is valid for the enum, false otherwise -func (v StorageOwnership) IsValid() bool { - for _, existing := range AllowedStorageOwnershipEnumValues { - if existing == v { - return true - } - } - return false -} - -// Ptr returns reference to StorageOwnership value -func (v StorageOwnership) Ptr() *StorageOwnership { - return &v -} - -type NullableStorageOwnership struct { - value *StorageOwnership - isSet bool -} - -func (v NullableStorageOwnership) Get() *StorageOwnership { - return v.value -} - -func (v *NullableStorageOwnership) Set(val *StorageOwnership) { - v.value = val - v.isSet = true -} - -func (v NullableStorageOwnership) IsSet() bool { - return v.isSet -} - -func (v *NullableStorageOwnership) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableStorageOwnership(val *StorageOwnership) *NullableStorageOwnership { - return &NullableStorageOwnership{value: val, isSet: true} -} - -func (v NullableStorageOwnership) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableStorageOwnership) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - diff --git a/model_store_list_actor.go b/model_store_list_actor.go deleted file mode 100644 index 5fdb1ee..0000000 --- a/model_store_list_actor.go +++ /dev/null @@ -1,802 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" - "bytes" - "fmt" -) - -// checks if the StoreListActor type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &StoreListActor{} - -// StoreListActor struct for StoreListActor -type StoreListActor struct { - Id string `json:"id"` - Title string `json:"title"` - Name string `json:"name"` - Username string `json:"username"` - UserFullName string `json:"userFullName"` - Description string `json:"description"` - Categories []string `json:"categories,omitempty"` - Notice *string `json:"notice,omitempty"` - PictureUrl NullableString `json:"pictureUrl,omitempty"` - UserPictureUrl NullableString `json:"userPictureUrl,omitempty"` - Url NullableString `json:"url,omitempty"` - Stats ActorStats `json:"stats"` - CurrentPricingInfo CurrentPricingInfo `json:"currentPricingInfo"` - // Whether the Actor is whitelisted for agentic payment processing. - IsWhiteListedForAgenticPayments NullableBool `json:"isWhiteListedForAgenticPayments,omitempty"` - ActorReviewCount *int32 `json:"actorReviewCount,omitempty"` - ActorReviewRating *float32 `json:"actorReviewRating,omitempty"` - BookmarkCount *int32 `json:"bookmarkCount,omitempty"` - Badge NullableString `json:"badge,omitempty"` - // A brief, LLM-generated readme summary - ReadmeSummary *string `json:"readmeSummary,omitempty"` -} - -type _StoreListActor StoreListActor - -// NewStoreListActor instantiates a new StoreListActor object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewStoreListActor(id string, title string, name string, username string, userFullName string, description string, stats ActorStats, currentPricingInfo CurrentPricingInfo) *StoreListActor { - this := StoreListActor{} - this.Id = id - this.Title = title - this.Name = name - this.Username = username - this.UserFullName = userFullName - this.Description = description - this.Stats = stats - this.CurrentPricingInfo = currentPricingInfo - return &this -} - -// NewStoreListActorWithDefaults instantiates a new StoreListActor object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewStoreListActorWithDefaults() *StoreListActor { - this := StoreListActor{} - return &this -} - -// GetId returns the Id field value -func (o *StoreListActor) GetId() string { - if o == nil { - var ret string - return ret - } - - return o.Id -} - -// GetIdOk returns a tuple with the Id field value -// and a boolean to check if the value has been set. -func (o *StoreListActor) GetIdOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Id, true -} - -// SetId sets field value -func (o *StoreListActor) SetId(v string) { - o.Id = v -} - -// GetTitle returns the Title field value -func (o *StoreListActor) GetTitle() string { - if o == nil { - var ret string - return ret - } - - return o.Title -} - -// GetTitleOk returns a tuple with the Title field value -// and a boolean to check if the value has been set. -func (o *StoreListActor) GetTitleOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Title, true -} - -// SetTitle sets field value -func (o *StoreListActor) SetTitle(v string) { - o.Title = v -} - -// GetName returns the Name field value -func (o *StoreListActor) GetName() string { - if o == nil { - var ret string - return ret - } - - return o.Name -} - -// GetNameOk returns a tuple with the Name field value -// and a boolean to check if the value has been set. -func (o *StoreListActor) GetNameOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Name, true -} - -// SetName sets field value -func (o *StoreListActor) SetName(v string) { - o.Name = v -} - -// GetUsername returns the Username field value -func (o *StoreListActor) GetUsername() string { - if o == nil { - var ret string - return ret - } - - return o.Username -} - -// GetUsernameOk returns a tuple with the Username field value -// and a boolean to check if the value has been set. -func (o *StoreListActor) GetUsernameOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Username, true -} - -// SetUsername sets field value -func (o *StoreListActor) SetUsername(v string) { - o.Username = v -} - -// GetUserFullName returns the UserFullName field value -func (o *StoreListActor) GetUserFullName() string { - if o == nil { - var ret string - return ret - } - - return o.UserFullName -} - -// GetUserFullNameOk returns a tuple with the UserFullName field value -// and a boolean to check if the value has been set. -func (o *StoreListActor) GetUserFullNameOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.UserFullName, true -} - -// SetUserFullName sets field value -func (o *StoreListActor) SetUserFullName(v string) { - o.UserFullName = v -} - -// GetDescription returns the Description field value -func (o *StoreListActor) GetDescription() string { - if o == nil { - var ret string - return ret - } - - return o.Description -} - -// GetDescriptionOk returns a tuple with the Description field value -// and a boolean to check if the value has been set. -func (o *StoreListActor) GetDescriptionOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Description, true -} - -// SetDescription sets field value -func (o *StoreListActor) SetDescription(v string) { - o.Description = v -} - -// GetCategories returns the Categories field value if set, zero value otherwise. -func (o *StoreListActor) GetCategories() []string { - if o == nil || IsNil(o.Categories) { - var ret []string - return ret - } - return o.Categories -} - -// GetCategoriesOk returns a tuple with the Categories field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *StoreListActor) GetCategoriesOk() ([]string, bool) { - if o == nil || IsNil(o.Categories) { - return nil, false - } - return o.Categories, true -} - -// HasCategories returns a boolean if a field has been set. -func (o *StoreListActor) HasCategories() bool { - if o != nil && !IsNil(o.Categories) { - return true - } - - return false -} - -// SetCategories gets a reference to the given []string and assigns it to the Categories field. -func (o *StoreListActor) SetCategories(v []string) { - o.Categories = v -} - -// GetNotice returns the Notice field value if set, zero value otherwise. -func (o *StoreListActor) GetNotice() string { - if o == nil || IsNil(o.Notice) { - var ret string - return ret - } - return *o.Notice -} - -// GetNoticeOk returns a tuple with the Notice field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *StoreListActor) GetNoticeOk() (*string, bool) { - if o == nil || IsNil(o.Notice) { - return nil, false - } - return o.Notice, true -} - -// HasNotice returns a boolean if a field has been set. -func (o *StoreListActor) HasNotice() bool { - if o != nil && !IsNil(o.Notice) { - return true - } - - return false -} - -// SetNotice gets a reference to the given string and assigns it to the Notice field. -func (o *StoreListActor) SetNotice(v string) { - o.Notice = &v -} - -// GetPictureUrl returns the PictureUrl field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *StoreListActor) GetPictureUrl() string { - if o == nil || IsNil(o.PictureUrl.Get()) { - var ret string - return ret - } - return *o.PictureUrl.Get() -} - -// GetPictureUrlOk returns a tuple with the PictureUrl field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *StoreListActor) GetPictureUrlOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.PictureUrl.Get(), o.PictureUrl.IsSet() -} - -// HasPictureUrl returns a boolean if a field has been set. -func (o *StoreListActor) HasPictureUrl() bool { - if o != nil && o.PictureUrl.IsSet() { - return true - } - - return false -} - -// SetPictureUrl gets a reference to the given NullableString and assigns it to the PictureUrl field. -func (o *StoreListActor) SetPictureUrl(v string) { - o.PictureUrl.Set(&v) -} -// SetPictureUrlNil sets the value for PictureUrl to be an explicit nil -func (o *StoreListActor) SetPictureUrlNil() { - o.PictureUrl.Set(nil) -} - -// UnsetPictureUrl ensures that no value is present for PictureUrl, not even an explicit nil -func (o *StoreListActor) UnsetPictureUrl() { - o.PictureUrl.Unset() -} - -// GetUserPictureUrl returns the UserPictureUrl field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *StoreListActor) GetUserPictureUrl() string { - if o == nil || IsNil(o.UserPictureUrl.Get()) { - var ret string - return ret - } - return *o.UserPictureUrl.Get() -} - -// GetUserPictureUrlOk returns a tuple with the UserPictureUrl field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *StoreListActor) GetUserPictureUrlOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.UserPictureUrl.Get(), o.UserPictureUrl.IsSet() -} - -// HasUserPictureUrl returns a boolean if a field has been set. -func (o *StoreListActor) HasUserPictureUrl() bool { - if o != nil && o.UserPictureUrl.IsSet() { - return true - } - - return false -} - -// SetUserPictureUrl gets a reference to the given NullableString and assigns it to the UserPictureUrl field. -func (o *StoreListActor) SetUserPictureUrl(v string) { - o.UserPictureUrl.Set(&v) -} -// SetUserPictureUrlNil sets the value for UserPictureUrl to be an explicit nil -func (o *StoreListActor) SetUserPictureUrlNil() { - o.UserPictureUrl.Set(nil) -} - -// UnsetUserPictureUrl ensures that no value is present for UserPictureUrl, not even an explicit nil -func (o *StoreListActor) UnsetUserPictureUrl() { - o.UserPictureUrl.Unset() -} - -// GetUrl returns the Url field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *StoreListActor) GetUrl() string { - if o == nil || IsNil(o.Url.Get()) { - var ret string - return ret - } - return *o.Url.Get() -} - -// GetUrlOk returns a tuple with the Url field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *StoreListActor) GetUrlOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.Url.Get(), o.Url.IsSet() -} - -// HasUrl returns a boolean if a field has been set. -func (o *StoreListActor) HasUrl() bool { - if o != nil && o.Url.IsSet() { - return true - } - - return false -} - -// SetUrl gets a reference to the given NullableString and assigns it to the Url field. -func (o *StoreListActor) SetUrl(v string) { - o.Url.Set(&v) -} -// SetUrlNil sets the value for Url to be an explicit nil -func (o *StoreListActor) SetUrlNil() { - o.Url.Set(nil) -} - -// UnsetUrl ensures that no value is present for Url, not even an explicit nil -func (o *StoreListActor) UnsetUrl() { - o.Url.Unset() -} - -// GetStats returns the Stats field value -func (o *StoreListActor) GetStats() ActorStats { - if o == nil { - var ret ActorStats - return ret - } - - return o.Stats -} - -// GetStatsOk returns a tuple with the Stats field value -// and a boolean to check if the value has been set. -func (o *StoreListActor) GetStatsOk() (*ActorStats, bool) { - if o == nil { - return nil, false - } - return &o.Stats, true -} - -// SetStats sets field value -func (o *StoreListActor) SetStats(v ActorStats) { - o.Stats = v -} - -// GetCurrentPricingInfo returns the CurrentPricingInfo field value -func (o *StoreListActor) GetCurrentPricingInfo() CurrentPricingInfo { - if o == nil { - var ret CurrentPricingInfo - return ret - } - - return o.CurrentPricingInfo -} - -// GetCurrentPricingInfoOk returns a tuple with the CurrentPricingInfo field value -// and a boolean to check if the value has been set. -func (o *StoreListActor) GetCurrentPricingInfoOk() (*CurrentPricingInfo, bool) { - if o == nil { - return nil, false - } - return &o.CurrentPricingInfo, true -} - -// SetCurrentPricingInfo sets field value -func (o *StoreListActor) SetCurrentPricingInfo(v CurrentPricingInfo) { - o.CurrentPricingInfo = v -} - -// GetIsWhiteListedForAgenticPayments returns the IsWhiteListedForAgenticPayments field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *StoreListActor) GetIsWhiteListedForAgenticPayments() bool { - if o == nil || IsNil(o.IsWhiteListedForAgenticPayments.Get()) { - var ret bool - return ret - } - return *o.IsWhiteListedForAgenticPayments.Get() -} - -// GetIsWhiteListedForAgenticPaymentsOk returns a tuple with the IsWhiteListedForAgenticPayments field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *StoreListActor) GetIsWhiteListedForAgenticPaymentsOk() (*bool, bool) { - if o == nil { - return nil, false - } - return o.IsWhiteListedForAgenticPayments.Get(), o.IsWhiteListedForAgenticPayments.IsSet() -} - -// HasIsWhiteListedForAgenticPayments returns a boolean if a field has been set. -func (o *StoreListActor) HasIsWhiteListedForAgenticPayments() bool { - if o != nil && o.IsWhiteListedForAgenticPayments.IsSet() { - return true - } - - return false -} - -// SetIsWhiteListedForAgenticPayments gets a reference to the given NullableBool and assigns it to the IsWhiteListedForAgenticPayments field. -func (o *StoreListActor) SetIsWhiteListedForAgenticPayments(v bool) { - o.IsWhiteListedForAgenticPayments.Set(&v) -} -// SetIsWhiteListedForAgenticPaymentsNil sets the value for IsWhiteListedForAgenticPayments to be an explicit nil -func (o *StoreListActor) SetIsWhiteListedForAgenticPaymentsNil() { - o.IsWhiteListedForAgenticPayments.Set(nil) -} - -// UnsetIsWhiteListedForAgenticPayments ensures that no value is present for IsWhiteListedForAgenticPayments, not even an explicit nil -func (o *StoreListActor) UnsetIsWhiteListedForAgenticPayments() { - o.IsWhiteListedForAgenticPayments.Unset() -} - -// GetActorReviewCount returns the ActorReviewCount field value if set, zero value otherwise. -func (o *StoreListActor) GetActorReviewCount() int32 { - if o == nil || IsNil(o.ActorReviewCount) { - var ret int32 - return ret - } - return *o.ActorReviewCount -} - -// GetActorReviewCountOk returns a tuple with the ActorReviewCount field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *StoreListActor) GetActorReviewCountOk() (*int32, bool) { - if o == nil || IsNil(o.ActorReviewCount) { - return nil, false - } - return o.ActorReviewCount, true -} - -// HasActorReviewCount returns a boolean if a field has been set. -func (o *StoreListActor) HasActorReviewCount() bool { - if o != nil && !IsNil(o.ActorReviewCount) { - return true - } - - return false -} - -// SetActorReviewCount gets a reference to the given int32 and assigns it to the ActorReviewCount field. -func (o *StoreListActor) SetActorReviewCount(v int32) { - o.ActorReviewCount = &v -} - -// GetActorReviewRating returns the ActorReviewRating field value if set, zero value otherwise. -func (o *StoreListActor) GetActorReviewRating() float32 { - if o == nil || IsNil(o.ActorReviewRating) { - var ret float32 - return ret - } - return *o.ActorReviewRating -} - -// GetActorReviewRatingOk returns a tuple with the ActorReviewRating field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *StoreListActor) GetActorReviewRatingOk() (*float32, bool) { - if o == nil || IsNil(o.ActorReviewRating) { - return nil, false - } - return o.ActorReviewRating, true -} - -// HasActorReviewRating returns a boolean if a field has been set. -func (o *StoreListActor) HasActorReviewRating() bool { - if o != nil && !IsNil(o.ActorReviewRating) { - return true - } - - return false -} - -// SetActorReviewRating gets a reference to the given float32 and assigns it to the ActorReviewRating field. -func (o *StoreListActor) SetActorReviewRating(v float32) { - o.ActorReviewRating = &v -} - -// GetBookmarkCount returns the BookmarkCount field value if set, zero value otherwise. -func (o *StoreListActor) GetBookmarkCount() int32 { - if o == nil || IsNil(o.BookmarkCount) { - var ret int32 - return ret - } - return *o.BookmarkCount -} - -// GetBookmarkCountOk returns a tuple with the BookmarkCount field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *StoreListActor) GetBookmarkCountOk() (*int32, bool) { - if o == nil || IsNil(o.BookmarkCount) { - return nil, false - } - return o.BookmarkCount, true -} - -// HasBookmarkCount returns a boolean if a field has been set. -func (o *StoreListActor) HasBookmarkCount() bool { - if o != nil && !IsNil(o.BookmarkCount) { - return true - } - - return false -} - -// SetBookmarkCount gets a reference to the given int32 and assigns it to the BookmarkCount field. -func (o *StoreListActor) SetBookmarkCount(v int32) { - o.BookmarkCount = &v -} - -// GetBadge returns the Badge field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *StoreListActor) GetBadge() string { - if o == nil || IsNil(o.Badge.Get()) { - var ret string - return ret - } - return *o.Badge.Get() -} - -// GetBadgeOk returns a tuple with the Badge field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *StoreListActor) GetBadgeOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.Badge.Get(), o.Badge.IsSet() -} - -// HasBadge returns a boolean if a field has been set. -func (o *StoreListActor) HasBadge() bool { - if o != nil && o.Badge.IsSet() { - return true - } - - return false -} - -// SetBadge gets a reference to the given NullableString and assigns it to the Badge field. -func (o *StoreListActor) SetBadge(v string) { - o.Badge.Set(&v) -} -// SetBadgeNil sets the value for Badge to be an explicit nil -func (o *StoreListActor) SetBadgeNil() { - o.Badge.Set(nil) -} - -// UnsetBadge ensures that no value is present for Badge, not even an explicit nil -func (o *StoreListActor) UnsetBadge() { - o.Badge.Unset() -} - -// GetReadmeSummary returns the ReadmeSummary field value if set, zero value otherwise. -func (o *StoreListActor) GetReadmeSummary() string { - if o == nil || IsNil(o.ReadmeSummary) { - var ret string - return ret - } - return *o.ReadmeSummary -} - -// GetReadmeSummaryOk returns a tuple with the ReadmeSummary field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *StoreListActor) GetReadmeSummaryOk() (*string, bool) { - if o == nil || IsNil(o.ReadmeSummary) { - return nil, false - } - return o.ReadmeSummary, true -} - -// HasReadmeSummary returns a boolean if a field has been set. -func (o *StoreListActor) HasReadmeSummary() bool { - if o != nil && !IsNil(o.ReadmeSummary) { - return true - } - - return false -} - -// SetReadmeSummary gets a reference to the given string and assigns it to the ReadmeSummary field. -func (o *StoreListActor) SetReadmeSummary(v string) { - o.ReadmeSummary = &v -} - -func (o StoreListActor) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o StoreListActor) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["id"] = o.Id - toSerialize["title"] = o.Title - toSerialize["name"] = o.Name - toSerialize["username"] = o.Username - toSerialize["userFullName"] = o.UserFullName - toSerialize["description"] = o.Description - if !IsNil(o.Categories) { - toSerialize["categories"] = o.Categories - } - if !IsNil(o.Notice) { - toSerialize["notice"] = o.Notice - } - if o.PictureUrl.IsSet() { - toSerialize["pictureUrl"] = o.PictureUrl.Get() - } - if o.UserPictureUrl.IsSet() { - toSerialize["userPictureUrl"] = o.UserPictureUrl.Get() - } - if o.Url.IsSet() { - toSerialize["url"] = o.Url.Get() - } - toSerialize["stats"] = o.Stats - toSerialize["currentPricingInfo"] = o.CurrentPricingInfo - if o.IsWhiteListedForAgenticPayments.IsSet() { - toSerialize["isWhiteListedForAgenticPayments"] = o.IsWhiteListedForAgenticPayments.Get() - } - if !IsNil(o.ActorReviewCount) { - toSerialize["actorReviewCount"] = o.ActorReviewCount - } - if !IsNil(o.ActorReviewRating) { - toSerialize["actorReviewRating"] = o.ActorReviewRating - } - if !IsNil(o.BookmarkCount) { - toSerialize["bookmarkCount"] = o.BookmarkCount - } - if o.Badge.IsSet() { - toSerialize["badge"] = o.Badge.Get() - } - if !IsNil(o.ReadmeSummary) { - toSerialize["readmeSummary"] = o.ReadmeSummary - } - return toSerialize, nil -} - -func (o *StoreListActor) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "id", - "title", - "name", - "username", - "userFullName", - "description", - "stats", - "currentPricingInfo", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err; - } - - for _, requiredProperty := range(requiredProperties) { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varStoreListActor := _StoreListActor{} - - decoder := json.NewDecoder(bytes.NewReader(data)) - decoder.DisallowUnknownFields() - err = decoder.Decode(&varStoreListActor) - - if err != nil { - return err - } - - *o = StoreListActor(varStoreListActor) - - return err -} - -type NullableStoreListActor struct { - value *StoreListActor - isSet bool -} - -func (v NullableStoreListActor) Get() *StoreListActor { - return v.value -} - -func (v *NullableStoreListActor) Set(val *StoreListActor) { - v.value = val - v.isSet = true -} - -func (v NullableStoreListActor) IsSet() bool { - return v.isSet -} - -func (v *NullableStoreListActor) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableStoreListActor(val *StoreListActor) *NullableStoreListActor { - return &NullableStoreListActor{value: val, isSet: true} -} - -func (v NullableStoreListActor) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableStoreListActor) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_tagged_build_info.go b/model_tagged_build_info.go deleted file mode 100644 index c8ee6b1..0000000 --- a/model_tagged_build_info.go +++ /dev/null @@ -1,249 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" - "time" -) - -// checks if the TaggedBuildInfo type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &TaggedBuildInfo{} - -// TaggedBuildInfo Information about a tagged build. -type TaggedBuildInfo struct { - // The ID of the build associated with this tag. - BuildId *string `json:"buildId,omitempty"` - // The build number/version string. - BuildNumber *string `json:"buildNumber,omitempty" validate:"regexp=^([0-9]|[1-9][0-9])\\\\.([0-9]|[1-9][0-9])(\\\\.[1-9][0-9]{0,4})$"` - // The build number encoded as a single integer. - BuildNumberInt *int32 `json:"buildNumberInt,omitempty"` - // The timestamp when the build finished. - FinishedAt NullableTime `json:"finishedAt,omitempty"` -} - -// NewTaggedBuildInfo instantiates a new TaggedBuildInfo object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewTaggedBuildInfo() *TaggedBuildInfo { - this := TaggedBuildInfo{} - return &this -} - -// NewTaggedBuildInfoWithDefaults instantiates a new TaggedBuildInfo object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewTaggedBuildInfoWithDefaults() *TaggedBuildInfo { - this := TaggedBuildInfo{} - return &this -} - -// GetBuildId returns the BuildId field value if set, zero value otherwise. -func (o *TaggedBuildInfo) GetBuildId() string { - if o == nil || IsNil(o.BuildId) { - var ret string - return ret - } - return *o.BuildId -} - -// GetBuildIdOk returns a tuple with the BuildId field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *TaggedBuildInfo) GetBuildIdOk() (*string, bool) { - if o == nil || IsNil(o.BuildId) { - return nil, false - } - return o.BuildId, true -} - -// HasBuildId returns a boolean if a field has been set. -func (o *TaggedBuildInfo) HasBuildId() bool { - if o != nil && !IsNil(o.BuildId) { - return true - } - - return false -} - -// SetBuildId gets a reference to the given string and assigns it to the BuildId field. -func (o *TaggedBuildInfo) SetBuildId(v string) { - o.BuildId = &v -} - -// GetBuildNumber returns the BuildNumber field value if set, zero value otherwise. -func (o *TaggedBuildInfo) GetBuildNumber() string { - if o == nil || IsNil(o.BuildNumber) { - var ret string - return ret - } - return *o.BuildNumber -} - -// GetBuildNumberOk returns a tuple with the BuildNumber field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *TaggedBuildInfo) GetBuildNumberOk() (*string, bool) { - if o == nil || IsNil(o.BuildNumber) { - return nil, false - } - return o.BuildNumber, true -} - -// HasBuildNumber returns a boolean if a field has been set. -func (o *TaggedBuildInfo) HasBuildNumber() bool { - if o != nil && !IsNil(o.BuildNumber) { - return true - } - - return false -} - -// SetBuildNumber gets a reference to the given string and assigns it to the BuildNumber field. -func (o *TaggedBuildInfo) SetBuildNumber(v string) { - o.BuildNumber = &v -} - -// GetBuildNumberInt returns the BuildNumberInt field value if set, zero value otherwise. -func (o *TaggedBuildInfo) GetBuildNumberInt() int32 { - if o == nil || IsNil(o.BuildNumberInt) { - var ret int32 - return ret - } - return *o.BuildNumberInt -} - -// GetBuildNumberIntOk returns a tuple with the BuildNumberInt field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *TaggedBuildInfo) GetBuildNumberIntOk() (*int32, bool) { - if o == nil || IsNil(o.BuildNumberInt) { - return nil, false - } - return o.BuildNumberInt, true -} - -// HasBuildNumberInt returns a boolean if a field has been set. -func (o *TaggedBuildInfo) HasBuildNumberInt() bool { - if o != nil && !IsNil(o.BuildNumberInt) { - return true - } - - return false -} - -// SetBuildNumberInt gets a reference to the given int32 and assigns it to the BuildNumberInt field. -func (o *TaggedBuildInfo) SetBuildNumberInt(v int32) { - o.BuildNumberInt = &v -} - -// GetFinishedAt returns the FinishedAt field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *TaggedBuildInfo) GetFinishedAt() time.Time { - if o == nil || IsNil(o.FinishedAt.Get()) { - var ret time.Time - return ret - } - return *o.FinishedAt.Get() -} - -// GetFinishedAtOk returns a tuple with the FinishedAt field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *TaggedBuildInfo) GetFinishedAtOk() (*time.Time, bool) { - if o == nil { - return nil, false - } - return o.FinishedAt.Get(), o.FinishedAt.IsSet() -} - -// HasFinishedAt returns a boolean if a field has been set. -func (o *TaggedBuildInfo) HasFinishedAt() bool { - if o != nil && o.FinishedAt.IsSet() { - return true - } - - return false -} - -// SetFinishedAt gets a reference to the given NullableTime and assigns it to the FinishedAt field. -func (o *TaggedBuildInfo) SetFinishedAt(v time.Time) { - o.FinishedAt.Set(&v) -} -// SetFinishedAtNil sets the value for FinishedAt to be an explicit nil -func (o *TaggedBuildInfo) SetFinishedAtNil() { - o.FinishedAt.Set(nil) -} - -// UnsetFinishedAt ensures that no value is present for FinishedAt, not even an explicit nil -func (o *TaggedBuildInfo) UnsetFinishedAt() { - o.FinishedAt.Unset() -} - -func (o TaggedBuildInfo) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o TaggedBuildInfo) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if !IsNil(o.BuildId) { - toSerialize["buildId"] = o.BuildId - } - if !IsNil(o.BuildNumber) { - toSerialize["buildNumber"] = o.BuildNumber - } - if !IsNil(o.BuildNumberInt) { - toSerialize["buildNumberInt"] = o.BuildNumberInt - } - if o.FinishedAt.IsSet() { - toSerialize["finishedAt"] = o.FinishedAt.Get() - } - return toSerialize, nil -} - -type NullableTaggedBuildInfo struct { - value *TaggedBuildInfo - isSet bool -} - -func (v NullableTaggedBuildInfo) Get() *TaggedBuildInfo { - return v.value -} - -func (v *NullableTaggedBuildInfo) Set(val *TaggedBuildInfo) { - v.value = val - v.isSet = true -} - -func (v NullableTaggedBuildInfo) IsSet() bool { - return v.isSet -} - -func (v *NullableTaggedBuildInfo) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableTaggedBuildInfo(val *TaggedBuildInfo) *NullableTaggedBuildInfo { - return &NullableTaggedBuildInfo{value: val, isSet: true} -} - -func (v NullableTaggedBuildInfo) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableTaggedBuildInfo) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_tagged_builds_value.go b/model_tagged_builds_value.go deleted file mode 100644 index a2cfa5a..0000000 --- a/model_tagged_builds_value.go +++ /dev/null @@ -1,94 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" - "fmt" -) - - -// TaggedBuildsValue struct for TaggedBuildsValue -type TaggedBuildsValue struct { - TaggedBuildInfo *TaggedBuildInfo -} - -// Unmarshal JSON data into any of the pointers in the struct -func (dst *TaggedBuildsValue) UnmarshalJSON(data []byte) error { - var err error - // this object is nullable so check if the payload is null or empty string - if string(data) == "" || string(data) == "{}" { - return nil - } - - // try to unmarshal JSON data into TaggedBuildInfo - err = json.Unmarshal(data, &dst.TaggedBuildInfo); - if err == nil { - jsonTaggedBuildInfo, _ := json.Marshal(dst.TaggedBuildInfo) - if string(jsonTaggedBuildInfo) == "{}" { // empty struct - dst.TaggedBuildInfo = nil - } else { - return nil // data stored in dst.TaggedBuildInfo, return on the first match - } - } else { - dst.TaggedBuildInfo = nil - } - - return fmt.Errorf("data failed to match schemas in anyOf(TaggedBuildsValue)") -} - -// Marshal data from the first non-nil pointers in the struct to JSON -func (src TaggedBuildsValue) MarshalJSON() ([]byte, error) { - if src.TaggedBuildInfo != nil { - return json.Marshal(&src.TaggedBuildInfo) - } - - return nil, nil // no data in anyOf schemas -} - - -type NullableTaggedBuildsValue struct { - value *TaggedBuildsValue - isSet bool -} - -func (v NullableTaggedBuildsValue) Get() *TaggedBuildsValue { - return v.value -} - -func (v *NullableTaggedBuildsValue) Set(val *TaggedBuildsValue) { - v.value = val - v.isSet = true -} - -func (v NullableTaggedBuildsValue) IsSet() bool { - return v.isSet -} - -func (v *NullableTaggedBuildsValue) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableTaggedBuildsValue(val *TaggedBuildsValue) *NullableTaggedBuildsValue { - return &NullableTaggedBuildsValue{value: val, isSet: true} -} - -func (v NullableTaggedBuildsValue) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableTaggedBuildsValue) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_task.go b/model_task.go deleted file mode 100644 index df66e88..0000000 --- a/model_task.go +++ /dev/null @@ -1,659 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" - "time" - "bytes" - "fmt" -) - -// checks if the Task type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &Task{} - -// Task struct for Task -type Task struct { - Id string `json:"id"` - UserId string `json:"userId"` - ActId string `json:"actId"` - Name string `json:"name"` - Username NullableString `json:"username,omitempty"` - CreatedAt time.Time `json:"createdAt"` - ModifiedAt time.Time `json:"modifiedAt"` - RemovedAt NullableTime `json:"removedAt,omitempty"` - Stats NullableTaskStats `json:"stats,omitempty"` - Options NullableTaskOptions `json:"options,omitempty"` - // The input configuration for the Actor task. This is a user-defined JSON object that will be passed to the Actor when the task is run. - Input map[string]interface{} `json:"input,omitempty"` - Title NullableString `json:"title,omitempty"` - ActorStandby NullableActorStandby `json:"actorStandby,omitempty"` - StandbyUrl NullableString `json:"standbyUrl,omitempty"` -} - -type _Task Task - -// NewTask instantiates a new Task object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewTask(id string, userId string, actId string, name string, createdAt time.Time, modifiedAt time.Time) *Task { - this := Task{} - this.Id = id - this.UserId = userId - this.ActId = actId - this.Name = name - this.CreatedAt = createdAt - this.ModifiedAt = modifiedAt - return &this -} - -// NewTaskWithDefaults instantiates a new Task object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewTaskWithDefaults() *Task { - this := Task{} - return &this -} - -// GetId returns the Id field value -func (o *Task) GetId() string { - if o == nil { - var ret string - return ret - } - - return o.Id -} - -// GetIdOk returns a tuple with the Id field value -// and a boolean to check if the value has been set. -func (o *Task) GetIdOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Id, true -} - -// SetId sets field value -func (o *Task) SetId(v string) { - o.Id = v -} - -// GetUserId returns the UserId field value -func (o *Task) GetUserId() string { - if o == nil { - var ret string - return ret - } - - return o.UserId -} - -// GetUserIdOk returns a tuple with the UserId field value -// and a boolean to check if the value has been set. -func (o *Task) GetUserIdOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.UserId, true -} - -// SetUserId sets field value -func (o *Task) SetUserId(v string) { - o.UserId = v -} - -// GetActId returns the ActId field value -func (o *Task) GetActId() string { - if o == nil { - var ret string - return ret - } - - return o.ActId -} - -// GetActIdOk returns a tuple with the ActId field value -// and a boolean to check if the value has been set. -func (o *Task) GetActIdOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.ActId, true -} - -// SetActId sets field value -func (o *Task) SetActId(v string) { - o.ActId = v -} - -// GetName returns the Name field value -func (o *Task) GetName() string { - if o == nil { - var ret string - return ret - } - - return o.Name -} - -// GetNameOk returns a tuple with the Name field value -// and a boolean to check if the value has been set. -func (o *Task) GetNameOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Name, true -} - -// SetName sets field value -func (o *Task) SetName(v string) { - o.Name = v -} - -// GetUsername returns the Username field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *Task) GetUsername() string { - if o == nil || IsNil(o.Username.Get()) { - var ret string - return ret - } - return *o.Username.Get() -} - -// GetUsernameOk returns a tuple with the Username field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *Task) GetUsernameOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.Username.Get(), o.Username.IsSet() -} - -// HasUsername returns a boolean if a field has been set. -func (o *Task) HasUsername() bool { - if o != nil && o.Username.IsSet() { - return true - } - - return false -} - -// SetUsername gets a reference to the given NullableString and assigns it to the Username field. -func (o *Task) SetUsername(v string) { - o.Username.Set(&v) -} -// SetUsernameNil sets the value for Username to be an explicit nil -func (o *Task) SetUsernameNil() { - o.Username.Set(nil) -} - -// UnsetUsername ensures that no value is present for Username, not even an explicit nil -func (o *Task) UnsetUsername() { - o.Username.Unset() -} - -// GetCreatedAt returns the CreatedAt field value -func (o *Task) GetCreatedAt() time.Time { - if o == nil { - var ret time.Time - return ret - } - - return o.CreatedAt -} - -// GetCreatedAtOk returns a tuple with the CreatedAt field value -// and a boolean to check if the value has been set. -func (o *Task) GetCreatedAtOk() (*time.Time, bool) { - if o == nil { - return nil, false - } - return &o.CreatedAt, true -} - -// SetCreatedAt sets field value -func (o *Task) SetCreatedAt(v time.Time) { - o.CreatedAt = v -} - -// GetModifiedAt returns the ModifiedAt field value -func (o *Task) GetModifiedAt() time.Time { - if o == nil { - var ret time.Time - return ret - } - - return o.ModifiedAt -} - -// GetModifiedAtOk returns a tuple with the ModifiedAt field value -// and a boolean to check if the value has been set. -func (o *Task) GetModifiedAtOk() (*time.Time, bool) { - if o == nil { - return nil, false - } - return &o.ModifiedAt, true -} - -// SetModifiedAt sets field value -func (o *Task) SetModifiedAt(v time.Time) { - o.ModifiedAt = v -} - -// GetRemovedAt returns the RemovedAt field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *Task) GetRemovedAt() time.Time { - if o == nil || IsNil(o.RemovedAt.Get()) { - var ret time.Time - return ret - } - return *o.RemovedAt.Get() -} - -// GetRemovedAtOk returns a tuple with the RemovedAt field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *Task) GetRemovedAtOk() (*time.Time, bool) { - if o == nil { - return nil, false - } - return o.RemovedAt.Get(), o.RemovedAt.IsSet() -} - -// HasRemovedAt returns a boolean if a field has been set. -func (o *Task) HasRemovedAt() bool { - if o != nil && o.RemovedAt.IsSet() { - return true - } - - return false -} - -// SetRemovedAt gets a reference to the given NullableTime and assigns it to the RemovedAt field. -func (o *Task) SetRemovedAt(v time.Time) { - o.RemovedAt.Set(&v) -} -// SetRemovedAtNil sets the value for RemovedAt to be an explicit nil -func (o *Task) SetRemovedAtNil() { - o.RemovedAt.Set(nil) -} - -// UnsetRemovedAt ensures that no value is present for RemovedAt, not even an explicit nil -func (o *Task) UnsetRemovedAt() { - o.RemovedAt.Unset() -} - -// GetStats returns the Stats field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *Task) GetStats() TaskStats { - if o == nil || IsNil(o.Stats.Get()) { - var ret TaskStats - return ret - } - return *o.Stats.Get() -} - -// GetStatsOk returns a tuple with the Stats field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *Task) GetStatsOk() (*TaskStats, bool) { - if o == nil { - return nil, false - } - return o.Stats.Get(), o.Stats.IsSet() -} - -// HasStats returns a boolean if a field has been set. -func (o *Task) HasStats() bool { - if o != nil && o.Stats.IsSet() { - return true - } - - return false -} - -// SetStats gets a reference to the given NullableTaskStats and assigns it to the Stats field. -func (o *Task) SetStats(v TaskStats) { - o.Stats.Set(&v) -} -// SetStatsNil sets the value for Stats to be an explicit nil -func (o *Task) SetStatsNil() { - o.Stats.Set(nil) -} - -// UnsetStats ensures that no value is present for Stats, not even an explicit nil -func (o *Task) UnsetStats() { - o.Stats.Unset() -} - -// GetOptions returns the Options field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *Task) GetOptions() TaskOptions { - if o == nil || IsNil(o.Options.Get()) { - var ret TaskOptions - return ret - } - return *o.Options.Get() -} - -// GetOptionsOk returns a tuple with the Options field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *Task) GetOptionsOk() (*TaskOptions, bool) { - if o == nil { - return nil, false - } - return o.Options.Get(), o.Options.IsSet() -} - -// HasOptions returns a boolean if a field has been set. -func (o *Task) HasOptions() bool { - if o != nil && o.Options.IsSet() { - return true - } - - return false -} - -// SetOptions gets a reference to the given NullableTaskOptions and assigns it to the Options field. -func (o *Task) SetOptions(v TaskOptions) { - o.Options.Set(&v) -} -// SetOptionsNil sets the value for Options to be an explicit nil -func (o *Task) SetOptionsNil() { - o.Options.Set(nil) -} - -// UnsetOptions ensures that no value is present for Options, not even an explicit nil -func (o *Task) UnsetOptions() { - o.Options.Unset() -} - -// GetInput returns the Input field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *Task) GetInput() map[string]interface{} { - if o == nil { - var ret map[string]interface{} - return ret - } - return o.Input -} - -// GetInputOk returns a tuple with the Input field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *Task) GetInputOk() (map[string]interface{}, bool) { - if o == nil || IsNil(o.Input) { - return map[string]interface{}{}, false - } - return o.Input, true -} - -// HasInput returns a boolean if a field has been set. -func (o *Task) HasInput() bool { - if o != nil && !IsNil(o.Input) { - return true - } - - return false -} - -// SetInput gets a reference to the given map[string]interface{} and assigns it to the Input field. -func (o *Task) SetInput(v map[string]interface{}) { - o.Input = v -} - -// GetTitle returns the Title field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *Task) GetTitle() string { - if o == nil || IsNil(o.Title.Get()) { - var ret string - return ret - } - return *o.Title.Get() -} - -// GetTitleOk returns a tuple with the Title field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *Task) GetTitleOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.Title.Get(), o.Title.IsSet() -} - -// HasTitle returns a boolean if a field has been set. -func (o *Task) HasTitle() bool { - if o != nil && o.Title.IsSet() { - return true - } - - return false -} - -// SetTitle gets a reference to the given NullableString and assigns it to the Title field. -func (o *Task) SetTitle(v string) { - o.Title.Set(&v) -} -// SetTitleNil sets the value for Title to be an explicit nil -func (o *Task) SetTitleNil() { - o.Title.Set(nil) -} - -// UnsetTitle ensures that no value is present for Title, not even an explicit nil -func (o *Task) UnsetTitle() { - o.Title.Unset() -} - -// GetActorStandby returns the ActorStandby field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *Task) GetActorStandby() ActorStandby { - if o == nil || IsNil(o.ActorStandby.Get()) { - var ret ActorStandby - return ret - } - return *o.ActorStandby.Get() -} - -// GetActorStandbyOk returns a tuple with the ActorStandby field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *Task) GetActorStandbyOk() (*ActorStandby, bool) { - if o == nil { - return nil, false - } - return o.ActorStandby.Get(), o.ActorStandby.IsSet() -} - -// HasActorStandby returns a boolean if a field has been set. -func (o *Task) HasActorStandby() bool { - if o != nil && o.ActorStandby.IsSet() { - return true - } - - return false -} - -// SetActorStandby gets a reference to the given NullableActorStandby and assigns it to the ActorStandby field. -func (o *Task) SetActorStandby(v ActorStandby) { - o.ActorStandby.Set(&v) -} -// SetActorStandbyNil sets the value for ActorStandby to be an explicit nil -func (o *Task) SetActorStandbyNil() { - o.ActorStandby.Set(nil) -} - -// UnsetActorStandby ensures that no value is present for ActorStandby, not even an explicit nil -func (o *Task) UnsetActorStandby() { - o.ActorStandby.Unset() -} - -// GetStandbyUrl returns the StandbyUrl field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *Task) GetStandbyUrl() string { - if o == nil || IsNil(o.StandbyUrl.Get()) { - var ret string - return ret - } - return *o.StandbyUrl.Get() -} - -// GetStandbyUrlOk returns a tuple with the StandbyUrl field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *Task) GetStandbyUrlOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.StandbyUrl.Get(), o.StandbyUrl.IsSet() -} - -// HasStandbyUrl returns a boolean if a field has been set. -func (o *Task) HasStandbyUrl() bool { - if o != nil && o.StandbyUrl.IsSet() { - return true - } - - return false -} - -// SetStandbyUrl gets a reference to the given NullableString and assigns it to the StandbyUrl field. -func (o *Task) SetStandbyUrl(v string) { - o.StandbyUrl.Set(&v) -} -// SetStandbyUrlNil sets the value for StandbyUrl to be an explicit nil -func (o *Task) SetStandbyUrlNil() { - o.StandbyUrl.Set(nil) -} - -// UnsetStandbyUrl ensures that no value is present for StandbyUrl, not even an explicit nil -func (o *Task) UnsetStandbyUrl() { - o.StandbyUrl.Unset() -} - -func (o Task) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o Task) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["id"] = o.Id - toSerialize["userId"] = o.UserId - toSerialize["actId"] = o.ActId - toSerialize["name"] = o.Name - if o.Username.IsSet() { - toSerialize["username"] = o.Username.Get() - } - toSerialize["createdAt"] = o.CreatedAt - toSerialize["modifiedAt"] = o.ModifiedAt - if o.RemovedAt.IsSet() { - toSerialize["removedAt"] = o.RemovedAt.Get() - } - if o.Stats.IsSet() { - toSerialize["stats"] = o.Stats.Get() - } - if o.Options.IsSet() { - toSerialize["options"] = o.Options.Get() - } - if o.Input != nil { - toSerialize["input"] = o.Input - } - if o.Title.IsSet() { - toSerialize["title"] = o.Title.Get() - } - if o.ActorStandby.IsSet() { - toSerialize["actorStandby"] = o.ActorStandby.Get() - } - if o.StandbyUrl.IsSet() { - toSerialize["standbyUrl"] = o.StandbyUrl.Get() - } - return toSerialize, nil -} - -func (o *Task) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "id", - "userId", - "actId", - "name", - "createdAt", - "modifiedAt", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err; - } - - for _, requiredProperty := range(requiredProperties) { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varTask := _Task{} - - decoder := json.NewDecoder(bytes.NewReader(data)) - decoder.DisallowUnknownFields() - err = decoder.Decode(&varTask) - - if err != nil { - return err - } - - *o = Task(varTask) - - return err -} - -type NullableTask struct { - value *Task - isSet bool -} - -func (v NullableTask) Get() *Task { - return v.value -} - -func (v *NullableTask) Set(val *Task) { - v.value = val - v.isSet = true -} - -func (v NullableTask) IsSet() bool { - return v.isSet -} - -func (v *NullableTask) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableTask(val *Task) *NullableTask { - return &NullableTask{value: val, isSet: true} -} - -func (v NullableTask) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableTask) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_task_options.go b/model_task_options.go deleted file mode 100644 index 661a0de..0000000 --- a/model_task_options.go +++ /dev/null @@ -1,366 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" -) - -// checks if the TaskOptions type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &TaskOptions{} - -// TaskOptions struct for TaskOptions -type TaskOptions struct { - Build NullableString `json:"build,omitempty"` - TimeoutSecs NullableInt32 `json:"timeoutSecs,omitempty"` - MemoryMbytes NullableInt32 `json:"memoryMbytes,omitempty"` - MaxItems NullableInt32 `json:"maxItems,omitempty"` - MaxTotalChargeUsd NullableFloat32 `json:"maxTotalChargeUsd,omitempty"` - RestartOnError NullableBool `json:"restartOnError,omitempty"` -} - -// NewTaskOptions instantiates a new TaskOptions object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewTaskOptions() *TaskOptions { - this := TaskOptions{} - return &this -} - -// NewTaskOptionsWithDefaults instantiates a new TaskOptions object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewTaskOptionsWithDefaults() *TaskOptions { - this := TaskOptions{} - return &this -} - -// GetBuild returns the Build field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *TaskOptions) GetBuild() string { - if o == nil || IsNil(o.Build.Get()) { - var ret string - return ret - } - return *o.Build.Get() -} - -// GetBuildOk returns a tuple with the Build field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *TaskOptions) GetBuildOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.Build.Get(), o.Build.IsSet() -} - -// HasBuild returns a boolean if a field has been set. -func (o *TaskOptions) HasBuild() bool { - if o != nil && o.Build.IsSet() { - return true - } - - return false -} - -// SetBuild gets a reference to the given NullableString and assigns it to the Build field. -func (o *TaskOptions) SetBuild(v string) { - o.Build.Set(&v) -} -// SetBuildNil sets the value for Build to be an explicit nil -func (o *TaskOptions) SetBuildNil() { - o.Build.Set(nil) -} - -// UnsetBuild ensures that no value is present for Build, not even an explicit nil -func (o *TaskOptions) UnsetBuild() { - o.Build.Unset() -} - -// GetTimeoutSecs returns the TimeoutSecs field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *TaskOptions) GetTimeoutSecs() int32 { - if o == nil || IsNil(o.TimeoutSecs.Get()) { - var ret int32 - return ret - } - return *o.TimeoutSecs.Get() -} - -// GetTimeoutSecsOk returns a tuple with the TimeoutSecs field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *TaskOptions) GetTimeoutSecsOk() (*int32, bool) { - if o == nil { - return nil, false - } - return o.TimeoutSecs.Get(), o.TimeoutSecs.IsSet() -} - -// HasTimeoutSecs returns a boolean if a field has been set. -func (o *TaskOptions) HasTimeoutSecs() bool { - if o != nil && o.TimeoutSecs.IsSet() { - return true - } - - return false -} - -// SetTimeoutSecs gets a reference to the given NullableInt32 and assigns it to the TimeoutSecs field. -func (o *TaskOptions) SetTimeoutSecs(v int32) { - o.TimeoutSecs.Set(&v) -} -// SetTimeoutSecsNil sets the value for TimeoutSecs to be an explicit nil -func (o *TaskOptions) SetTimeoutSecsNil() { - o.TimeoutSecs.Set(nil) -} - -// UnsetTimeoutSecs ensures that no value is present for TimeoutSecs, not even an explicit nil -func (o *TaskOptions) UnsetTimeoutSecs() { - o.TimeoutSecs.Unset() -} - -// GetMemoryMbytes returns the MemoryMbytes field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *TaskOptions) GetMemoryMbytes() int32 { - if o == nil || IsNil(o.MemoryMbytes.Get()) { - var ret int32 - return ret - } - return *o.MemoryMbytes.Get() -} - -// GetMemoryMbytesOk returns a tuple with the MemoryMbytes field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *TaskOptions) GetMemoryMbytesOk() (*int32, bool) { - if o == nil { - return nil, false - } - return o.MemoryMbytes.Get(), o.MemoryMbytes.IsSet() -} - -// HasMemoryMbytes returns a boolean if a field has been set. -func (o *TaskOptions) HasMemoryMbytes() bool { - if o != nil && o.MemoryMbytes.IsSet() { - return true - } - - return false -} - -// SetMemoryMbytes gets a reference to the given NullableInt32 and assigns it to the MemoryMbytes field. -func (o *TaskOptions) SetMemoryMbytes(v int32) { - o.MemoryMbytes.Set(&v) -} -// SetMemoryMbytesNil sets the value for MemoryMbytes to be an explicit nil -func (o *TaskOptions) SetMemoryMbytesNil() { - o.MemoryMbytes.Set(nil) -} - -// UnsetMemoryMbytes ensures that no value is present for MemoryMbytes, not even an explicit nil -func (o *TaskOptions) UnsetMemoryMbytes() { - o.MemoryMbytes.Unset() -} - -// GetMaxItems returns the MaxItems field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *TaskOptions) GetMaxItems() int32 { - if o == nil || IsNil(o.MaxItems.Get()) { - var ret int32 - return ret - } - return *o.MaxItems.Get() -} - -// GetMaxItemsOk returns a tuple with the MaxItems field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *TaskOptions) GetMaxItemsOk() (*int32, bool) { - if o == nil { - return nil, false - } - return o.MaxItems.Get(), o.MaxItems.IsSet() -} - -// HasMaxItems returns a boolean if a field has been set. -func (o *TaskOptions) HasMaxItems() bool { - if o != nil && o.MaxItems.IsSet() { - return true - } - - return false -} - -// SetMaxItems gets a reference to the given NullableInt32 and assigns it to the MaxItems field. -func (o *TaskOptions) SetMaxItems(v int32) { - o.MaxItems.Set(&v) -} -// SetMaxItemsNil sets the value for MaxItems to be an explicit nil -func (o *TaskOptions) SetMaxItemsNil() { - o.MaxItems.Set(nil) -} - -// UnsetMaxItems ensures that no value is present for MaxItems, not even an explicit nil -func (o *TaskOptions) UnsetMaxItems() { - o.MaxItems.Unset() -} - -// GetMaxTotalChargeUsd returns the MaxTotalChargeUsd field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *TaskOptions) GetMaxTotalChargeUsd() float32 { - if o == nil || IsNil(o.MaxTotalChargeUsd.Get()) { - var ret float32 - return ret - } - return *o.MaxTotalChargeUsd.Get() -} - -// GetMaxTotalChargeUsdOk returns a tuple with the MaxTotalChargeUsd field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *TaskOptions) GetMaxTotalChargeUsdOk() (*float32, bool) { - if o == nil { - return nil, false - } - return o.MaxTotalChargeUsd.Get(), o.MaxTotalChargeUsd.IsSet() -} - -// HasMaxTotalChargeUsd returns a boolean if a field has been set. -func (o *TaskOptions) HasMaxTotalChargeUsd() bool { - if o != nil && o.MaxTotalChargeUsd.IsSet() { - return true - } - - return false -} - -// SetMaxTotalChargeUsd gets a reference to the given NullableFloat32 and assigns it to the MaxTotalChargeUsd field. -func (o *TaskOptions) SetMaxTotalChargeUsd(v float32) { - o.MaxTotalChargeUsd.Set(&v) -} -// SetMaxTotalChargeUsdNil sets the value for MaxTotalChargeUsd to be an explicit nil -func (o *TaskOptions) SetMaxTotalChargeUsdNil() { - o.MaxTotalChargeUsd.Set(nil) -} - -// UnsetMaxTotalChargeUsd ensures that no value is present for MaxTotalChargeUsd, not even an explicit nil -func (o *TaskOptions) UnsetMaxTotalChargeUsd() { - o.MaxTotalChargeUsd.Unset() -} - -// GetRestartOnError returns the RestartOnError field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *TaskOptions) GetRestartOnError() bool { - if o == nil || IsNil(o.RestartOnError.Get()) { - var ret bool - return ret - } - return *o.RestartOnError.Get() -} - -// GetRestartOnErrorOk returns a tuple with the RestartOnError field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *TaskOptions) GetRestartOnErrorOk() (*bool, bool) { - if o == nil { - return nil, false - } - return o.RestartOnError.Get(), o.RestartOnError.IsSet() -} - -// HasRestartOnError returns a boolean if a field has been set. -func (o *TaskOptions) HasRestartOnError() bool { - if o != nil && o.RestartOnError.IsSet() { - return true - } - - return false -} - -// SetRestartOnError gets a reference to the given NullableBool and assigns it to the RestartOnError field. -func (o *TaskOptions) SetRestartOnError(v bool) { - o.RestartOnError.Set(&v) -} -// SetRestartOnErrorNil sets the value for RestartOnError to be an explicit nil -func (o *TaskOptions) SetRestartOnErrorNil() { - o.RestartOnError.Set(nil) -} - -// UnsetRestartOnError ensures that no value is present for RestartOnError, not even an explicit nil -func (o *TaskOptions) UnsetRestartOnError() { - o.RestartOnError.Unset() -} - -func (o TaskOptions) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o TaskOptions) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if o.Build.IsSet() { - toSerialize["build"] = o.Build.Get() - } - if o.TimeoutSecs.IsSet() { - toSerialize["timeoutSecs"] = o.TimeoutSecs.Get() - } - if o.MemoryMbytes.IsSet() { - toSerialize["memoryMbytes"] = o.MemoryMbytes.Get() - } - if o.MaxItems.IsSet() { - toSerialize["maxItems"] = o.MaxItems.Get() - } - if o.MaxTotalChargeUsd.IsSet() { - toSerialize["maxTotalChargeUsd"] = o.MaxTotalChargeUsd.Get() - } - if o.RestartOnError.IsSet() { - toSerialize["restartOnError"] = o.RestartOnError.Get() - } - return toSerialize, nil -} - -type NullableTaskOptions struct { - value *TaskOptions - isSet bool -} - -func (v NullableTaskOptions) Get() *TaskOptions { - return v.value -} - -func (v *NullableTaskOptions) Set(val *TaskOptions) { - v.value = val - v.isSet = true -} - -func (v NullableTaskOptions) IsSet() bool { - return v.isSet -} - -func (v *NullableTaskOptions) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableTaskOptions(val *TaskOptions) *NullableTaskOptions { - return &NullableTaskOptions{value: val, isSet: true} -} - -func (v NullableTaskOptions) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableTaskOptions) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_task_response.go b/model_task_response.go deleted file mode 100644 index 6d1845c..0000000 --- a/model_task_response.go +++ /dev/null @@ -1,158 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" - "bytes" - "fmt" -) - -// checks if the TaskResponse type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &TaskResponse{} - -// TaskResponse Response containing Actor task data. -type TaskResponse struct { - Data Task `json:"data"` -} - -type _TaskResponse TaskResponse - -// NewTaskResponse instantiates a new TaskResponse object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewTaskResponse(data Task) *TaskResponse { - this := TaskResponse{} - this.Data = data - return &this -} - -// NewTaskResponseWithDefaults instantiates a new TaskResponse object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewTaskResponseWithDefaults() *TaskResponse { - this := TaskResponse{} - return &this -} - -// GetData returns the Data field value -func (o *TaskResponse) GetData() Task { - if o == nil { - var ret Task - return ret - } - - return o.Data -} - -// GetDataOk returns a tuple with the Data field value -// and a boolean to check if the value has been set. -func (o *TaskResponse) GetDataOk() (*Task, bool) { - if o == nil { - return nil, false - } - return &o.Data, true -} - -// SetData sets field value -func (o *TaskResponse) SetData(v Task) { - o.Data = v -} - -func (o TaskResponse) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o TaskResponse) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["data"] = o.Data - return toSerialize, nil -} - -func (o *TaskResponse) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "data", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err; - } - - for _, requiredProperty := range(requiredProperties) { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varTaskResponse := _TaskResponse{} - - decoder := json.NewDecoder(bytes.NewReader(data)) - decoder.DisallowUnknownFields() - err = decoder.Decode(&varTaskResponse) - - if err != nil { - return err - } - - *o = TaskResponse(varTaskResponse) - - return err -} - -type NullableTaskResponse struct { - value *TaskResponse - isSet bool -} - -func (v NullableTaskResponse) Get() *TaskResponse { - return v.value -} - -func (v *NullableTaskResponse) Set(val *TaskResponse) { - v.value = val - v.isSet = true -} - -func (v NullableTaskResponse) IsSet() bool { - return v.isSet -} - -func (v *NullableTaskResponse) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableTaskResponse(val *TaskResponse) *NullableTaskResponse { - return &NullableTaskResponse{value: val, isSet: true} -} - -func (v NullableTaskResponse) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableTaskResponse) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_task_short.go b/model_task_short.go deleted file mode 100644 index 881c9e2..0000000 --- a/model_task_short.go +++ /dev/null @@ -1,483 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" - "time" - "bytes" - "fmt" -) - -// checks if the TaskShort type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &TaskShort{} - -// TaskShort struct for TaskShort -type TaskShort struct { - Id string `json:"id"` - UserId string `json:"userId"` - ActId string `json:"actId"` - ActName NullableString `json:"actName,omitempty"` - Name string `json:"name"` - Username NullableString `json:"username,omitempty"` - ActUsername NullableString `json:"actUsername,omitempty"` - CreatedAt time.Time `json:"createdAt"` - ModifiedAt time.Time `json:"modifiedAt"` - Stats NullableTaskStats `json:"stats,omitempty"` -} - -type _TaskShort TaskShort - -// NewTaskShort instantiates a new TaskShort object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewTaskShort(id string, userId string, actId string, name string, createdAt time.Time, modifiedAt time.Time) *TaskShort { - this := TaskShort{} - this.Id = id - this.UserId = userId - this.ActId = actId - this.Name = name - this.CreatedAt = createdAt - this.ModifiedAt = modifiedAt - return &this -} - -// NewTaskShortWithDefaults instantiates a new TaskShort object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewTaskShortWithDefaults() *TaskShort { - this := TaskShort{} - return &this -} - -// GetId returns the Id field value -func (o *TaskShort) GetId() string { - if o == nil { - var ret string - return ret - } - - return o.Id -} - -// GetIdOk returns a tuple with the Id field value -// and a boolean to check if the value has been set. -func (o *TaskShort) GetIdOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Id, true -} - -// SetId sets field value -func (o *TaskShort) SetId(v string) { - o.Id = v -} - -// GetUserId returns the UserId field value -func (o *TaskShort) GetUserId() string { - if o == nil { - var ret string - return ret - } - - return o.UserId -} - -// GetUserIdOk returns a tuple with the UserId field value -// and a boolean to check if the value has been set. -func (o *TaskShort) GetUserIdOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.UserId, true -} - -// SetUserId sets field value -func (o *TaskShort) SetUserId(v string) { - o.UserId = v -} - -// GetActId returns the ActId field value -func (o *TaskShort) GetActId() string { - if o == nil { - var ret string - return ret - } - - return o.ActId -} - -// GetActIdOk returns a tuple with the ActId field value -// and a boolean to check if the value has been set. -func (o *TaskShort) GetActIdOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.ActId, true -} - -// SetActId sets field value -func (o *TaskShort) SetActId(v string) { - o.ActId = v -} - -// GetActName returns the ActName field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *TaskShort) GetActName() string { - if o == nil || IsNil(o.ActName.Get()) { - var ret string - return ret - } - return *o.ActName.Get() -} - -// GetActNameOk returns a tuple with the ActName field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *TaskShort) GetActNameOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.ActName.Get(), o.ActName.IsSet() -} - -// HasActName returns a boolean if a field has been set. -func (o *TaskShort) HasActName() bool { - if o != nil && o.ActName.IsSet() { - return true - } - - return false -} - -// SetActName gets a reference to the given NullableString and assigns it to the ActName field. -func (o *TaskShort) SetActName(v string) { - o.ActName.Set(&v) -} -// SetActNameNil sets the value for ActName to be an explicit nil -func (o *TaskShort) SetActNameNil() { - o.ActName.Set(nil) -} - -// UnsetActName ensures that no value is present for ActName, not even an explicit nil -func (o *TaskShort) UnsetActName() { - o.ActName.Unset() -} - -// GetName returns the Name field value -func (o *TaskShort) GetName() string { - if o == nil { - var ret string - return ret - } - - return o.Name -} - -// GetNameOk returns a tuple with the Name field value -// and a boolean to check if the value has been set. -func (o *TaskShort) GetNameOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Name, true -} - -// SetName sets field value -func (o *TaskShort) SetName(v string) { - o.Name = v -} - -// GetUsername returns the Username field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *TaskShort) GetUsername() string { - if o == nil || IsNil(o.Username.Get()) { - var ret string - return ret - } - return *o.Username.Get() -} - -// GetUsernameOk returns a tuple with the Username field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *TaskShort) GetUsernameOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.Username.Get(), o.Username.IsSet() -} - -// HasUsername returns a boolean if a field has been set. -func (o *TaskShort) HasUsername() bool { - if o != nil && o.Username.IsSet() { - return true - } - - return false -} - -// SetUsername gets a reference to the given NullableString and assigns it to the Username field. -func (o *TaskShort) SetUsername(v string) { - o.Username.Set(&v) -} -// SetUsernameNil sets the value for Username to be an explicit nil -func (o *TaskShort) SetUsernameNil() { - o.Username.Set(nil) -} - -// UnsetUsername ensures that no value is present for Username, not even an explicit nil -func (o *TaskShort) UnsetUsername() { - o.Username.Unset() -} - -// GetActUsername returns the ActUsername field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *TaskShort) GetActUsername() string { - if o == nil || IsNil(o.ActUsername.Get()) { - var ret string - return ret - } - return *o.ActUsername.Get() -} - -// GetActUsernameOk returns a tuple with the ActUsername field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *TaskShort) GetActUsernameOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.ActUsername.Get(), o.ActUsername.IsSet() -} - -// HasActUsername returns a boolean if a field has been set. -func (o *TaskShort) HasActUsername() bool { - if o != nil && o.ActUsername.IsSet() { - return true - } - - return false -} - -// SetActUsername gets a reference to the given NullableString and assigns it to the ActUsername field. -func (o *TaskShort) SetActUsername(v string) { - o.ActUsername.Set(&v) -} -// SetActUsernameNil sets the value for ActUsername to be an explicit nil -func (o *TaskShort) SetActUsernameNil() { - o.ActUsername.Set(nil) -} - -// UnsetActUsername ensures that no value is present for ActUsername, not even an explicit nil -func (o *TaskShort) UnsetActUsername() { - o.ActUsername.Unset() -} - -// GetCreatedAt returns the CreatedAt field value -func (o *TaskShort) GetCreatedAt() time.Time { - if o == nil { - var ret time.Time - return ret - } - - return o.CreatedAt -} - -// GetCreatedAtOk returns a tuple with the CreatedAt field value -// and a boolean to check if the value has been set. -func (o *TaskShort) GetCreatedAtOk() (*time.Time, bool) { - if o == nil { - return nil, false - } - return &o.CreatedAt, true -} - -// SetCreatedAt sets field value -func (o *TaskShort) SetCreatedAt(v time.Time) { - o.CreatedAt = v -} - -// GetModifiedAt returns the ModifiedAt field value -func (o *TaskShort) GetModifiedAt() time.Time { - if o == nil { - var ret time.Time - return ret - } - - return o.ModifiedAt -} - -// GetModifiedAtOk returns a tuple with the ModifiedAt field value -// and a boolean to check if the value has been set. -func (o *TaskShort) GetModifiedAtOk() (*time.Time, bool) { - if o == nil { - return nil, false - } - return &o.ModifiedAt, true -} - -// SetModifiedAt sets field value -func (o *TaskShort) SetModifiedAt(v time.Time) { - o.ModifiedAt = v -} - -// GetStats returns the Stats field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *TaskShort) GetStats() TaskStats { - if o == nil || IsNil(o.Stats.Get()) { - var ret TaskStats - return ret - } - return *o.Stats.Get() -} - -// GetStatsOk returns a tuple with the Stats field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *TaskShort) GetStatsOk() (*TaskStats, bool) { - if o == nil { - return nil, false - } - return o.Stats.Get(), o.Stats.IsSet() -} - -// HasStats returns a boolean if a field has been set. -func (o *TaskShort) HasStats() bool { - if o != nil && o.Stats.IsSet() { - return true - } - - return false -} - -// SetStats gets a reference to the given NullableTaskStats and assigns it to the Stats field. -func (o *TaskShort) SetStats(v TaskStats) { - o.Stats.Set(&v) -} -// SetStatsNil sets the value for Stats to be an explicit nil -func (o *TaskShort) SetStatsNil() { - o.Stats.Set(nil) -} - -// UnsetStats ensures that no value is present for Stats, not even an explicit nil -func (o *TaskShort) UnsetStats() { - o.Stats.Unset() -} - -func (o TaskShort) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o TaskShort) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["id"] = o.Id - toSerialize["userId"] = o.UserId - toSerialize["actId"] = o.ActId - if o.ActName.IsSet() { - toSerialize["actName"] = o.ActName.Get() - } - toSerialize["name"] = o.Name - if o.Username.IsSet() { - toSerialize["username"] = o.Username.Get() - } - if o.ActUsername.IsSet() { - toSerialize["actUsername"] = o.ActUsername.Get() - } - toSerialize["createdAt"] = o.CreatedAt - toSerialize["modifiedAt"] = o.ModifiedAt - if o.Stats.IsSet() { - toSerialize["stats"] = o.Stats.Get() - } - return toSerialize, nil -} - -func (o *TaskShort) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "id", - "userId", - "actId", - "name", - "createdAt", - "modifiedAt", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err; - } - - for _, requiredProperty := range(requiredProperties) { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varTaskShort := _TaskShort{} - - decoder := json.NewDecoder(bytes.NewReader(data)) - decoder.DisallowUnknownFields() - err = decoder.Decode(&varTaskShort) - - if err != nil { - return err - } - - *o = TaskShort(varTaskShort) - - return err -} - -type NullableTaskShort struct { - value *TaskShort - isSet bool -} - -func (v NullableTaskShort) Get() *TaskShort { - return v.value -} - -func (v *NullableTaskShort) Set(val *TaskShort) { - v.value = val - v.isSet = true -} - -func (v NullableTaskShort) IsSet() bool { - return v.isSet -} - -func (v *NullableTaskShort) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableTaskShort(val *TaskShort) *NullableTaskShort { - return &NullableTaskShort{value: val, isSet: true} -} - -func (v NullableTaskShort) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableTaskShort) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_task_stats.go b/model_task_stats.go deleted file mode 100644 index 81693a7..0000000 --- a/model_task_stats.go +++ /dev/null @@ -1,126 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" -) - -// checks if the TaskStats type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &TaskStats{} - -// TaskStats struct for TaskStats -type TaskStats struct { - TotalRuns *int32 `json:"totalRuns,omitempty"` -} - -// NewTaskStats instantiates a new TaskStats object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewTaskStats() *TaskStats { - this := TaskStats{} - return &this -} - -// NewTaskStatsWithDefaults instantiates a new TaskStats object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewTaskStatsWithDefaults() *TaskStats { - this := TaskStats{} - return &this -} - -// GetTotalRuns returns the TotalRuns field value if set, zero value otherwise. -func (o *TaskStats) GetTotalRuns() int32 { - if o == nil || IsNil(o.TotalRuns) { - var ret int32 - return ret - } - return *o.TotalRuns -} - -// GetTotalRunsOk returns a tuple with the TotalRuns field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *TaskStats) GetTotalRunsOk() (*int32, bool) { - if o == nil || IsNil(o.TotalRuns) { - return nil, false - } - return o.TotalRuns, true -} - -// HasTotalRuns returns a boolean if a field has been set. -func (o *TaskStats) HasTotalRuns() bool { - if o != nil && !IsNil(o.TotalRuns) { - return true - } - - return false -} - -// SetTotalRuns gets a reference to the given int32 and assigns it to the TotalRuns field. -func (o *TaskStats) SetTotalRuns(v int32) { - o.TotalRuns = &v -} - -func (o TaskStats) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o TaskStats) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if !IsNil(o.TotalRuns) { - toSerialize["totalRuns"] = o.TotalRuns - } - return toSerialize, nil -} - -type NullableTaskStats struct { - value *TaskStats - isSet bool -} - -func (v NullableTaskStats) Get() *TaskStats { - return v.value -} - -func (v *NullableTaskStats) Set(val *TaskStats) { - v.value = val - v.isSet = true -} - -func (v NullableTaskStats) IsSet() bool { - return v.isSet -} - -func (v *NullableTaskStats) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableTaskStats(val *TaskStats) *NullableTaskStats { - return &NullableTaskStats{value: val, isSet: true} -} - -func (v NullableTaskStats) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableTaskStats) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_test_webhook_response.go b/model_test_webhook_response.go deleted file mode 100644 index 55bb35b..0000000 --- a/model_test_webhook_response.go +++ /dev/null @@ -1,158 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" - "bytes" - "fmt" -) - -// checks if the TestWebhookResponse type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &TestWebhookResponse{} - -// TestWebhookResponse struct for TestWebhookResponse -type TestWebhookResponse struct { - Data WebhookDispatch `json:"data"` -} - -type _TestWebhookResponse TestWebhookResponse - -// NewTestWebhookResponse instantiates a new TestWebhookResponse object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewTestWebhookResponse(data WebhookDispatch) *TestWebhookResponse { - this := TestWebhookResponse{} - this.Data = data - return &this -} - -// NewTestWebhookResponseWithDefaults instantiates a new TestWebhookResponse object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewTestWebhookResponseWithDefaults() *TestWebhookResponse { - this := TestWebhookResponse{} - return &this -} - -// GetData returns the Data field value -func (o *TestWebhookResponse) GetData() WebhookDispatch { - if o == nil { - var ret WebhookDispatch - return ret - } - - return o.Data -} - -// GetDataOk returns a tuple with the Data field value -// and a boolean to check if the value has been set. -func (o *TestWebhookResponse) GetDataOk() (*WebhookDispatch, bool) { - if o == nil { - return nil, false - } - return &o.Data, true -} - -// SetData sets field value -func (o *TestWebhookResponse) SetData(v WebhookDispatch) { - o.Data = v -} - -func (o TestWebhookResponse) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o TestWebhookResponse) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["data"] = o.Data - return toSerialize, nil -} - -func (o *TestWebhookResponse) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "data", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err; - } - - for _, requiredProperty := range(requiredProperties) { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varTestWebhookResponse := _TestWebhookResponse{} - - decoder := json.NewDecoder(bytes.NewReader(data)) - decoder.DisallowUnknownFields() - err = decoder.Decode(&varTestWebhookResponse) - - if err != nil { - return err - } - - *o = TestWebhookResponse(varTestWebhookResponse) - - return err -} - -type NullableTestWebhookResponse struct { - value *TestWebhookResponse - isSet bool -} - -func (v NullableTestWebhookResponse) Get() *TestWebhookResponse { - return v.value -} - -func (v *NullableTestWebhookResponse) Set(val *TestWebhookResponse) { - v.value = val - v.isSet = true -} - -func (v NullableTestWebhookResponse) IsSet() bool { - return v.isSet -} - -func (v *NullableTestWebhookResponse) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableTestWebhookResponse(val *TestWebhookResponse) *NullableTestWebhookResponse { - return &NullableTestWebhookResponse{value: val, isSet: true} -} - -func (v NullableTestWebhookResponse) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableTestWebhookResponse) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_tiered_pricing_per_dataset_item_entry.go b/model_tiered_pricing_per_dataset_item_entry.go deleted file mode 100644 index 636f800..0000000 --- a/model_tiered_pricing_per_dataset_item_entry.go +++ /dev/null @@ -1,159 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" - "bytes" - "fmt" -) - -// checks if the TieredPricingPerDatasetItemEntry type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &TieredPricingPerDatasetItemEntry{} - -// TieredPricingPerDatasetItemEntry A single tier's price-per-dataset-item entry. -type TieredPricingPerDatasetItemEntry struct { - // Price per unit in USD for this tier. - TieredPricePerUnitUsd float32 `json:"tieredPricePerUnitUsd"` -} - -type _TieredPricingPerDatasetItemEntry TieredPricingPerDatasetItemEntry - -// NewTieredPricingPerDatasetItemEntry instantiates a new TieredPricingPerDatasetItemEntry object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewTieredPricingPerDatasetItemEntry(tieredPricePerUnitUsd float32) *TieredPricingPerDatasetItemEntry { - this := TieredPricingPerDatasetItemEntry{} - this.TieredPricePerUnitUsd = tieredPricePerUnitUsd - return &this -} - -// NewTieredPricingPerDatasetItemEntryWithDefaults instantiates a new TieredPricingPerDatasetItemEntry object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewTieredPricingPerDatasetItemEntryWithDefaults() *TieredPricingPerDatasetItemEntry { - this := TieredPricingPerDatasetItemEntry{} - return &this -} - -// GetTieredPricePerUnitUsd returns the TieredPricePerUnitUsd field value -func (o *TieredPricingPerDatasetItemEntry) GetTieredPricePerUnitUsd() float32 { - if o == nil { - var ret float32 - return ret - } - - return o.TieredPricePerUnitUsd -} - -// GetTieredPricePerUnitUsdOk returns a tuple with the TieredPricePerUnitUsd field value -// and a boolean to check if the value has been set. -func (o *TieredPricingPerDatasetItemEntry) GetTieredPricePerUnitUsdOk() (*float32, bool) { - if o == nil { - return nil, false - } - return &o.TieredPricePerUnitUsd, true -} - -// SetTieredPricePerUnitUsd sets field value -func (o *TieredPricingPerDatasetItemEntry) SetTieredPricePerUnitUsd(v float32) { - o.TieredPricePerUnitUsd = v -} - -func (o TieredPricingPerDatasetItemEntry) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o TieredPricingPerDatasetItemEntry) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["tieredPricePerUnitUsd"] = o.TieredPricePerUnitUsd - return toSerialize, nil -} - -func (o *TieredPricingPerDatasetItemEntry) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "tieredPricePerUnitUsd", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err; - } - - for _, requiredProperty := range(requiredProperties) { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varTieredPricingPerDatasetItemEntry := _TieredPricingPerDatasetItemEntry{} - - decoder := json.NewDecoder(bytes.NewReader(data)) - decoder.DisallowUnknownFields() - err = decoder.Decode(&varTieredPricingPerDatasetItemEntry) - - if err != nil { - return err - } - - *o = TieredPricingPerDatasetItemEntry(varTieredPricingPerDatasetItemEntry) - - return err -} - -type NullableTieredPricingPerDatasetItemEntry struct { - value *TieredPricingPerDatasetItemEntry - isSet bool -} - -func (v NullableTieredPricingPerDatasetItemEntry) Get() *TieredPricingPerDatasetItemEntry { - return v.value -} - -func (v *NullableTieredPricingPerDatasetItemEntry) Set(val *TieredPricingPerDatasetItemEntry) { - v.value = val - v.isSet = true -} - -func (v NullableTieredPricingPerDatasetItemEntry) IsSet() bool { - return v.isSet -} - -func (v *NullableTieredPricingPerDatasetItemEntry) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableTieredPricingPerDatasetItemEntry(val *TieredPricingPerDatasetItemEntry) *NullableTieredPricingPerDatasetItemEntry { - return &NullableTieredPricingPerDatasetItemEntry{value: val, isSet: true} -} - -func (v NullableTieredPricingPerDatasetItemEntry) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableTieredPricingPerDatasetItemEntry) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_tiered_pricing_per_event_entry.go b/model_tiered_pricing_per_event_entry.go deleted file mode 100644 index 5b81cb7..0000000 --- a/model_tiered_pricing_per_event_entry.go +++ /dev/null @@ -1,159 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" - "bytes" - "fmt" -) - -// checks if the TieredPricingPerEventEntry type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &TieredPricingPerEventEntry{} - -// TieredPricingPerEventEntry A single tier's price-per-event entry. -type TieredPricingPerEventEntry struct { - // Price per event in USD for this tier. - TieredEventPriceUsd float32 `json:"tieredEventPriceUsd"` -} - -type _TieredPricingPerEventEntry TieredPricingPerEventEntry - -// NewTieredPricingPerEventEntry instantiates a new TieredPricingPerEventEntry object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewTieredPricingPerEventEntry(tieredEventPriceUsd float32) *TieredPricingPerEventEntry { - this := TieredPricingPerEventEntry{} - this.TieredEventPriceUsd = tieredEventPriceUsd - return &this -} - -// NewTieredPricingPerEventEntryWithDefaults instantiates a new TieredPricingPerEventEntry object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewTieredPricingPerEventEntryWithDefaults() *TieredPricingPerEventEntry { - this := TieredPricingPerEventEntry{} - return &this -} - -// GetTieredEventPriceUsd returns the TieredEventPriceUsd field value -func (o *TieredPricingPerEventEntry) GetTieredEventPriceUsd() float32 { - if o == nil { - var ret float32 - return ret - } - - return o.TieredEventPriceUsd -} - -// GetTieredEventPriceUsdOk returns a tuple with the TieredEventPriceUsd field value -// and a boolean to check if the value has been set. -func (o *TieredPricingPerEventEntry) GetTieredEventPriceUsdOk() (*float32, bool) { - if o == nil { - return nil, false - } - return &o.TieredEventPriceUsd, true -} - -// SetTieredEventPriceUsd sets field value -func (o *TieredPricingPerEventEntry) SetTieredEventPriceUsd(v float32) { - o.TieredEventPriceUsd = v -} - -func (o TieredPricingPerEventEntry) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o TieredPricingPerEventEntry) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["tieredEventPriceUsd"] = o.TieredEventPriceUsd - return toSerialize, nil -} - -func (o *TieredPricingPerEventEntry) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "tieredEventPriceUsd", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err; - } - - for _, requiredProperty := range(requiredProperties) { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varTieredPricingPerEventEntry := _TieredPricingPerEventEntry{} - - decoder := json.NewDecoder(bytes.NewReader(data)) - decoder.DisallowUnknownFields() - err = decoder.Decode(&varTieredPricingPerEventEntry) - - if err != nil { - return err - } - - *o = TieredPricingPerEventEntry(varTieredPricingPerEventEntry) - - return err -} - -type NullableTieredPricingPerEventEntry struct { - value *TieredPricingPerEventEntry - isSet bool -} - -func (v NullableTieredPricingPerEventEntry) Get() *TieredPricingPerEventEntry { - return v.value -} - -func (v *NullableTieredPricingPerEventEntry) Set(val *TieredPricingPerEventEntry) { - v.value = val - v.isSet = true -} - -func (v NullableTieredPricingPerEventEntry) IsSet() bool { - return v.isSet -} - -func (v *NullableTieredPricingPerEventEntry) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableTieredPricingPerEventEntry(val *TieredPricingPerEventEntry) *NullableTieredPricingPerEventEntry { - return &NullableTieredPricingPerEventEntry{value: val, isSet: true} -} - -func (v NullableTieredPricingPerEventEntry) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableTieredPricingPerEventEntry) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_unlock_requests_response.go b/model_unlock_requests_response.go deleted file mode 100644 index b1585d9..0000000 --- a/model_unlock_requests_response.go +++ /dev/null @@ -1,158 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" - "bytes" - "fmt" -) - -// checks if the UnlockRequestsResponse type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &UnlockRequestsResponse{} - -// UnlockRequestsResponse Response containing the result of unlocking requests. -type UnlockRequestsResponse struct { - Data UnlockRequestsResult `json:"data"` -} - -type _UnlockRequestsResponse UnlockRequestsResponse - -// NewUnlockRequestsResponse instantiates a new UnlockRequestsResponse object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewUnlockRequestsResponse(data UnlockRequestsResult) *UnlockRequestsResponse { - this := UnlockRequestsResponse{} - this.Data = data - return &this -} - -// NewUnlockRequestsResponseWithDefaults instantiates a new UnlockRequestsResponse object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewUnlockRequestsResponseWithDefaults() *UnlockRequestsResponse { - this := UnlockRequestsResponse{} - return &this -} - -// GetData returns the Data field value -func (o *UnlockRequestsResponse) GetData() UnlockRequestsResult { - if o == nil { - var ret UnlockRequestsResult - return ret - } - - return o.Data -} - -// GetDataOk returns a tuple with the Data field value -// and a boolean to check if the value has been set. -func (o *UnlockRequestsResponse) GetDataOk() (*UnlockRequestsResult, bool) { - if o == nil { - return nil, false - } - return &o.Data, true -} - -// SetData sets field value -func (o *UnlockRequestsResponse) SetData(v UnlockRequestsResult) { - o.Data = v -} - -func (o UnlockRequestsResponse) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o UnlockRequestsResponse) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["data"] = o.Data - return toSerialize, nil -} - -func (o *UnlockRequestsResponse) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "data", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err; - } - - for _, requiredProperty := range(requiredProperties) { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varUnlockRequestsResponse := _UnlockRequestsResponse{} - - decoder := json.NewDecoder(bytes.NewReader(data)) - decoder.DisallowUnknownFields() - err = decoder.Decode(&varUnlockRequestsResponse) - - if err != nil { - return err - } - - *o = UnlockRequestsResponse(varUnlockRequestsResponse) - - return err -} - -type NullableUnlockRequestsResponse struct { - value *UnlockRequestsResponse - isSet bool -} - -func (v NullableUnlockRequestsResponse) Get() *UnlockRequestsResponse { - return v.value -} - -func (v *NullableUnlockRequestsResponse) Set(val *UnlockRequestsResponse) { - v.value = val - v.isSet = true -} - -func (v NullableUnlockRequestsResponse) IsSet() bool { - return v.isSet -} - -func (v *NullableUnlockRequestsResponse) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableUnlockRequestsResponse(val *UnlockRequestsResponse) *NullableUnlockRequestsResponse { - return &NullableUnlockRequestsResponse{value: val, isSet: true} -} - -func (v NullableUnlockRequestsResponse) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableUnlockRequestsResponse) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_unlock_requests_result.go b/model_unlock_requests_result.go deleted file mode 100644 index 347fb60..0000000 --- a/model_unlock_requests_result.go +++ /dev/null @@ -1,159 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" - "bytes" - "fmt" -) - -// checks if the UnlockRequestsResult type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &UnlockRequestsResult{} - -// UnlockRequestsResult Result of unlocking requests in the request queue. -type UnlockRequestsResult struct { - // Number of requests that were successfully unlocked. - UnlockedCount int32 `json:"unlockedCount"` -} - -type _UnlockRequestsResult UnlockRequestsResult - -// NewUnlockRequestsResult instantiates a new UnlockRequestsResult object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewUnlockRequestsResult(unlockedCount int32) *UnlockRequestsResult { - this := UnlockRequestsResult{} - this.UnlockedCount = unlockedCount - return &this -} - -// NewUnlockRequestsResultWithDefaults instantiates a new UnlockRequestsResult object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewUnlockRequestsResultWithDefaults() *UnlockRequestsResult { - this := UnlockRequestsResult{} - return &this -} - -// GetUnlockedCount returns the UnlockedCount field value -func (o *UnlockRequestsResult) GetUnlockedCount() int32 { - if o == nil { - var ret int32 - return ret - } - - return o.UnlockedCount -} - -// GetUnlockedCountOk returns a tuple with the UnlockedCount field value -// and a boolean to check if the value has been set. -func (o *UnlockRequestsResult) GetUnlockedCountOk() (*int32, bool) { - if o == nil { - return nil, false - } - return &o.UnlockedCount, true -} - -// SetUnlockedCount sets field value -func (o *UnlockRequestsResult) SetUnlockedCount(v int32) { - o.UnlockedCount = v -} - -func (o UnlockRequestsResult) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o UnlockRequestsResult) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["unlockedCount"] = o.UnlockedCount - return toSerialize, nil -} - -func (o *UnlockRequestsResult) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "unlockedCount", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err; - } - - for _, requiredProperty := range(requiredProperties) { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varUnlockRequestsResult := _UnlockRequestsResult{} - - decoder := json.NewDecoder(bytes.NewReader(data)) - decoder.DisallowUnknownFields() - err = decoder.Decode(&varUnlockRequestsResult) - - if err != nil { - return err - } - - *o = UnlockRequestsResult(varUnlockRequestsResult) - - return err -} - -type NullableUnlockRequestsResult struct { - value *UnlockRequestsResult - isSet bool -} - -func (v NullableUnlockRequestsResult) Get() *UnlockRequestsResult { - return v.value -} - -func (v *NullableUnlockRequestsResult) Set(val *UnlockRequestsResult) { - v.value = val - v.isSet = true -} - -func (v NullableUnlockRequestsResult) IsSet() bool { - return v.isSet -} - -func (v *NullableUnlockRequestsResult) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableUnlockRequestsResult(val *UnlockRequestsResult) *NullableUnlockRequestsResult { - return &NullableUnlockRequestsResult{value: val, isSet: true} -} - -func (v NullableUnlockRequestsResult) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableUnlockRequestsResult) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_update_actor_request.go b/model_update_actor_request.go deleted file mode 100644 index d78aa9f..0000000 --- a/model_update_actor_request.go +++ /dev/null @@ -1,764 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" -) - -// checks if the UpdateActorRequest type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &UpdateActorRequest{} - -// UpdateActorRequest struct for UpdateActorRequest -type UpdateActorRequest struct { - Name *string `json:"name,omitempty"` - Description NullableString `json:"description,omitempty"` - IsPublic *bool `json:"isPublic,omitempty"` - ActorPermissionLevel NullableActorPermissionLevel `json:"actorPermissionLevel,omitempty"` - SeoTitle NullableString `json:"seoTitle,omitempty"` - SeoDescription NullableString `json:"seoDescription,omitempty"` - Title NullableString `json:"title,omitempty"` - // Deprecated - RestartOnError *bool `json:"restartOnError,omitempty"` - // - Versions []CreateOrUpdateVersionRequest `json:"versions,omitempty"` - PricingInfos []ActorRunPricingInfo `json:"pricingInfos,omitempty"` - // - Categories []string `json:"categories,omitempty"` - DefaultRunOptions NullableDefaultRunOptions `json:"defaultRunOptions,omitempty"` - // An object to modify tags on the Actor's builds. The key is the tag name (e.g., _latest_), and the value is either an object with a `buildId` or `null`. This operation is a patch; any existing tags that you omit from this object will be preserved. - **To create or reassign a tag**, provide the tag name with a `buildId`. e.g., to assign the _latest_ tag:   ```json { \"latest\": { \"buildId\": \"z2EryhbfhgSyqj6Hn\" } } ``` - **To remove a tag**, provide the tag name with a `null` value. e.g., to remove the _beta_ tag:   ```json { \"beta\": null } ``` - **To perform multiple operations**, combine them. The following reassigns _latest_ and removes _beta_, while preserving any other existing tags.   ```json { \"latest\": { \"buildId\": \"z2EryhbfhgSyqj6Hn\" }, \"beta\": null } ``` - TaggedBuilds map[string]BuildTag `json:"taggedBuilds,omitempty"` - ActorStandby NullableActorStandby `json:"actorStandby,omitempty"` - ExampleRunInput NullableExampleRunInput `json:"exampleRunInput,omitempty"` - IsDeprecated NullableBool `json:"isDeprecated,omitempty"` -} - -// NewUpdateActorRequest instantiates a new UpdateActorRequest object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewUpdateActorRequest() *UpdateActorRequest { - this := UpdateActorRequest{} - return &this -} - -// NewUpdateActorRequestWithDefaults instantiates a new UpdateActorRequest object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewUpdateActorRequestWithDefaults() *UpdateActorRequest { - this := UpdateActorRequest{} - return &this -} - -// GetName returns the Name field value if set, zero value otherwise. -func (o *UpdateActorRequest) GetName() string { - if o == nil || IsNil(o.Name) { - var ret string - return ret - } - return *o.Name -} - -// GetNameOk returns a tuple with the Name field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *UpdateActorRequest) GetNameOk() (*string, bool) { - if o == nil || IsNil(o.Name) { - return nil, false - } - return o.Name, true -} - -// HasName returns a boolean if a field has been set. -func (o *UpdateActorRequest) HasName() bool { - if o != nil && !IsNil(o.Name) { - return true - } - - return false -} - -// SetName gets a reference to the given string and assigns it to the Name field. -func (o *UpdateActorRequest) SetName(v string) { - o.Name = &v -} - -// GetDescription returns the Description field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *UpdateActorRequest) GetDescription() string { - if o == nil || IsNil(o.Description.Get()) { - var ret string - return ret - } - return *o.Description.Get() -} - -// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *UpdateActorRequest) GetDescriptionOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.Description.Get(), o.Description.IsSet() -} - -// HasDescription returns a boolean if a field has been set. -func (o *UpdateActorRequest) HasDescription() bool { - if o != nil && o.Description.IsSet() { - return true - } - - return false -} - -// SetDescription gets a reference to the given NullableString and assigns it to the Description field. -func (o *UpdateActorRequest) SetDescription(v string) { - o.Description.Set(&v) -} -// SetDescriptionNil sets the value for Description to be an explicit nil -func (o *UpdateActorRequest) SetDescriptionNil() { - o.Description.Set(nil) -} - -// UnsetDescription ensures that no value is present for Description, not even an explicit nil -func (o *UpdateActorRequest) UnsetDescription() { - o.Description.Unset() -} - -// GetIsPublic returns the IsPublic field value if set, zero value otherwise. -func (o *UpdateActorRequest) GetIsPublic() bool { - if o == nil || IsNil(o.IsPublic) { - var ret bool - return ret - } - return *o.IsPublic -} - -// GetIsPublicOk returns a tuple with the IsPublic field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *UpdateActorRequest) GetIsPublicOk() (*bool, bool) { - if o == nil || IsNil(o.IsPublic) { - return nil, false - } - return o.IsPublic, true -} - -// HasIsPublic returns a boolean if a field has been set. -func (o *UpdateActorRequest) HasIsPublic() bool { - if o != nil && !IsNil(o.IsPublic) { - return true - } - - return false -} - -// SetIsPublic gets a reference to the given bool and assigns it to the IsPublic field. -func (o *UpdateActorRequest) SetIsPublic(v bool) { - o.IsPublic = &v -} - -// GetActorPermissionLevel returns the ActorPermissionLevel field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *UpdateActorRequest) GetActorPermissionLevel() ActorPermissionLevel { - if o == nil || IsNil(o.ActorPermissionLevel.Get()) { - var ret ActorPermissionLevel - return ret - } - return *o.ActorPermissionLevel.Get() -} - -// GetActorPermissionLevelOk returns a tuple with the ActorPermissionLevel field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *UpdateActorRequest) GetActorPermissionLevelOk() (*ActorPermissionLevel, bool) { - if o == nil { - return nil, false - } - return o.ActorPermissionLevel.Get(), o.ActorPermissionLevel.IsSet() -} - -// HasActorPermissionLevel returns a boolean if a field has been set. -func (o *UpdateActorRequest) HasActorPermissionLevel() bool { - if o != nil && o.ActorPermissionLevel.IsSet() { - return true - } - - return false -} - -// SetActorPermissionLevel gets a reference to the given NullableActorPermissionLevel and assigns it to the ActorPermissionLevel field. -func (o *UpdateActorRequest) SetActorPermissionLevel(v ActorPermissionLevel) { - o.ActorPermissionLevel.Set(&v) -} -// SetActorPermissionLevelNil sets the value for ActorPermissionLevel to be an explicit nil -func (o *UpdateActorRequest) SetActorPermissionLevelNil() { - o.ActorPermissionLevel.Set(nil) -} - -// UnsetActorPermissionLevel ensures that no value is present for ActorPermissionLevel, not even an explicit nil -func (o *UpdateActorRequest) UnsetActorPermissionLevel() { - o.ActorPermissionLevel.Unset() -} - -// GetSeoTitle returns the SeoTitle field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *UpdateActorRequest) GetSeoTitle() string { - if o == nil || IsNil(o.SeoTitle.Get()) { - var ret string - return ret - } - return *o.SeoTitle.Get() -} - -// GetSeoTitleOk returns a tuple with the SeoTitle field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *UpdateActorRequest) GetSeoTitleOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.SeoTitle.Get(), o.SeoTitle.IsSet() -} - -// HasSeoTitle returns a boolean if a field has been set. -func (o *UpdateActorRequest) HasSeoTitle() bool { - if o != nil && o.SeoTitle.IsSet() { - return true - } - - return false -} - -// SetSeoTitle gets a reference to the given NullableString and assigns it to the SeoTitle field. -func (o *UpdateActorRequest) SetSeoTitle(v string) { - o.SeoTitle.Set(&v) -} -// SetSeoTitleNil sets the value for SeoTitle to be an explicit nil -func (o *UpdateActorRequest) SetSeoTitleNil() { - o.SeoTitle.Set(nil) -} - -// UnsetSeoTitle ensures that no value is present for SeoTitle, not even an explicit nil -func (o *UpdateActorRequest) UnsetSeoTitle() { - o.SeoTitle.Unset() -} - -// GetSeoDescription returns the SeoDescription field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *UpdateActorRequest) GetSeoDescription() string { - if o == nil || IsNil(o.SeoDescription.Get()) { - var ret string - return ret - } - return *o.SeoDescription.Get() -} - -// GetSeoDescriptionOk returns a tuple with the SeoDescription field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *UpdateActorRequest) GetSeoDescriptionOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.SeoDescription.Get(), o.SeoDescription.IsSet() -} - -// HasSeoDescription returns a boolean if a field has been set. -func (o *UpdateActorRequest) HasSeoDescription() bool { - if o != nil && o.SeoDescription.IsSet() { - return true - } - - return false -} - -// SetSeoDescription gets a reference to the given NullableString and assigns it to the SeoDescription field. -func (o *UpdateActorRequest) SetSeoDescription(v string) { - o.SeoDescription.Set(&v) -} -// SetSeoDescriptionNil sets the value for SeoDescription to be an explicit nil -func (o *UpdateActorRequest) SetSeoDescriptionNil() { - o.SeoDescription.Set(nil) -} - -// UnsetSeoDescription ensures that no value is present for SeoDescription, not even an explicit nil -func (o *UpdateActorRequest) UnsetSeoDescription() { - o.SeoDescription.Unset() -} - -// GetTitle returns the Title field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *UpdateActorRequest) GetTitle() string { - if o == nil || IsNil(o.Title.Get()) { - var ret string - return ret - } - return *o.Title.Get() -} - -// GetTitleOk returns a tuple with the Title field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *UpdateActorRequest) GetTitleOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.Title.Get(), o.Title.IsSet() -} - -// HasTitle returns a boolean if a field has been set. -func (o *UpdateActorRequest) HasTitle() bool { - if o != nil && o.Title.IsSet() { - return true - } - - return false -} - -// SetTitle gets a reference to the given NullableString and assigns it to the Title field. -func (o *UpdateActorRequest) SetTitle(v string) { - o.Title.Set(&v) -} -// SetTitleNil sets the value for Title to be an explicit nil -func (o *UpdateActorRequest) SetTitleNil() { - o.Title.Set(nil) -} - -// UnsetTitle ensures that no value is present for Title, not even an explicit nil -func (o *UpdateActorRequest) UnsetTitle() { - o.Title.Unset() -} - -// GetRestartOnError returns the RestartOnError field value if set, zero value otherwise. -// Deprecated -func (o *UpdateActorRequest) GetRestartOnError() bool { - if o == nil || IsNil(o.RestartOnError) { - var ret bool - return ret - } - return *o.RestartOnError -} - -// GetRestartOnErrorOk returns a tuple with the RestartOnError field value if set, nil otherwise -// and a boolean to check if the value has been set. -// Deprecated -func (o *UpdateActorRequest) GetRestartOnErrorOk() (*bool, bool) { - if o == nil || IsNil(o.RestartOnError) { - return nil, false - } - return o.RestartOnError, true -} - -// HasRestartOnError returns a boolean if a field has been set. -func (o *UpdateActorRequest) HasRestartOnError() bool { - if o != nil && !IsNil(o.RestartOnError) { - return true - } - - return false -} - -// SetRestartOnError gets a reference to the given bool and assigns it to the RestartOnError field. -// Deprecated -func (o *UpdateActorRequest) SetRestartOnError(v bool) { - o.RestartOnError = &v -} - -// GetVersions returns the Versions field value if set, zero value otherwise. -func (o *UpdateActorRequest) GetVersions() []CreateOrUpdateVersionRequest { - if o == nil || IsNil(o.Versions) { - var ret []CreateOrUpdateVersionRequest - return ret - } - return o.Versions -} - -// GetVersionsOk returns a tuple with the Versions field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *UpdateActorRequest) GetVersionsOk() ([]CreateOrUpdateVersionRequest, bool) { - if o == nil || IsNil(o.Versions) { - return nil, false - } - return o.Versions, true -} - -// HasVersions returns a boolean if a field has been set. -func (o *UpdateActorRequest) HasVersions() bool { - if o != nil && !IsNil(o.Versions) { - return true - } - - return false -} - -// SetVersions gets a reference to the given []CreateOrUpdateVersionRequest and assigns it to the Versions field. -func (o *UpdateActorRequest) SetVersions(v []CreateOrUpdateVersionRequest) { - o.Versions = v -} - -// GetPricingInfos returns the PricingInfos field value if set, zero value otherwise. -func (o *UpdateActorRequest) GetPricingInfos() []ActorRunPricingInfo { - if o == nil || IsNil(o.PricingInfos) { - var ret []ActorRunPricingInfo - return ret - } - return o.PricingInfos -} - -// GetPricingInfosOk returns a tuple with the PricingInfos field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *UpdateActorRequest) GetPricingInfosOk() ([]ActorRunPricingInfo, bool) { - if o == nil || IsNil(o.PricingInfos) { - return nil, false - } - return o.PricingInfos, true -} - -// HasPricingInfos returns a boolean if a field has been set. -func (o *UpdateActorRequest) HasPricingInfos() bool { - if o != nil && !IsNil(o.PricingInfos) { - return true - } - - return false -} - -// SetPricingInfos gets a reference to the given []ActorRunPricingInfo and assigns it to the PricingInfos field. -func (o *UpdateActorRequest) SetPricingInfos(v []ActorRunPricingInfo) { - o.PricingInfos = v -} - -// GetCategories returns the Categories field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *UpdateActorRequest) GetCategories() []string { - if o == nil { - var ret []string - return ret - } - return o.Categories -} - -// GetCategoriesOk returns a tuple with the Categories field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *UpdateActorRequest) GetCategoriesOk() ([]string, bool) { - if o == nil || IsNil(o.Categories) { - return nil, false - } - return o.Categories, true -} - -// HasCategories returns a boolean if a field has been set. -func (o *UpdateActorRequest) HasCategories() bool { - if o != nil && !IsNil(o.Categories) { - return true - } - - return false -} - -// SetCategories gets a reference to the given []string and assigns it to the Categories field. -func (o *UpdateActorRequest) SetCategories(v []string) { - o.Categories = v -} - -// GetDefaultRunOptions returns the DefaultRunOptions field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *UpdateActorRequest) GetDefaultRunOptions() DefaultRunOptions { - if o == nil || IsNil(o.DefaultRunOptions.Get()) { - var ret DefaultRunOptions - return ret - } - return *o.DefaultRunOptions.Get() -} - -// GetDefaultRunOptionsOk returns a tuple with the DefaultRunOptions field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *UpdateActorRequest) GetDefaultRunOptionsOk() (*DefaultRunOptions, bool) { - if o == nil { - return nil, false - } - return o.DefaultRunOptions.Get(), o.DefaultRunOptions.IsSet() -} - -// HasDefaultRunOptions returns a boolean if a field has been set. -func (o *UpdateActorRequest) HasDefaultRunOptions() bool { - if o != nil && o.DefaultRunOptions.IsSet() { - return true - } - - return false -} - -// SetDefaultRunOptions gets a reference to the given NullableDefaultRunOptions and assigns it to the DefaultRunOptions field. -func (o *UpdateActorRequest) SetDefaultRunOptions(v DefaultRunOptions) { - o.DefaultRunOptions.Set(&v) -} -// SetDefaultRunOptionsNil sets the value for DefaultRunOptions to be an explicit nil -func (o *UpdateActorRequest) SetDefaultRunOptionsNil() { - o.DefaultRunOptions.Set(nil) -} - -// UnsetDefaultRunOptions ensures that no value is present for DefaultRunOptions, not even an explicit nil -func (o *UpdateActorRequest) UnsetDefaultRunOptions() { - o.DefaultRunOptions.Unset() -} - -// GetTaggedBuilds returns the TaggedBuilds field value if set, zero value otherwise. -func (o *UpdateActorRequest) GetTaggedBuilds() map[string]BuildTag { - if o == nil || IsNil(o.TaggedBuilds) { - var ret map[string]BuildTag - return ret - } - return o.TaggedBuilds -} - -// GetTaggedBuildsOk returns a tuple with the TaggedBuilds field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *UpdateActorRequest) GetTaggedBuildsOk() (map[string]BuildTag, bool) { - if o == nil || IsNil(o.TaggedBuilds) { - return map[string]BuildTag{}, false - } - return o.TaggedBuilds, true -} - -// HasTaggedBuilds returns a boolean if a field has been set. -func (o *UpdateActorRequest) HasTaggedBuilds() bool { - if o != nil && !IsNil(o.TaggedBuilds) { - return true - } - - return false -} - -// SetTaggedBuilds gets a reference to the given map[string]BuildTag and assigns it to the TaggedBuilds field. -func (o *UpdateActorRequest) SetTaggedBuilds(v map[string]BuildTag) { - o.TaggedBuilds = v -} - -// GetActorStandby returns the ActorStandby field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *UpdateActorRequest) GetActorStandby() ActorStandby { - if o == nil || IsNil(o.ActorStandby.Get()) { - var ret ActorStandby - return ret - } - return *o.ActorStandby.Get() -} - -// GetActorStandbyOk returns a tuple with the ActorStandby field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *UpdateActorRequest) GetActorStandbyOk() (*ActorStandby, bool) { - if o == nil { - return nil, false - } - return o.ActorStandby.Get(), o.ActorStandby.IsSet() -} - -// HasActorStandby returns a boolean if a field has been set. -func (o *UpdateActorRequest) HasActorStandby() bool { - if o != nil && o.ActorStandby.IsSet() { - return true - } - - return false -} - -// SetActorStandby gets a reference to the given NullableActorStandby and assigns it to the ActorStandby field. -func (o *UpdateActorRequest) SetActorStandby(v ActorStandby) { - o.ActorStandby.Set(&v) -} -// SetActorStandbyNil sets the value for ActorStandby to be an explicit nil -func (o *UpdateActorRequest) SetActorStandbyNil() { - o.ActorStandby.Set(nil) -} - -// UnsetActorStandby ensures that no value is present for ActorStandby, not even an explicit nil -func (o *UpdateActorRequest) UnsetActorStandby() { - o.ActorStandby.Unset() -} - -// GetExampleRunInput returns the ExampleRunInput field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *UpdateActorRequest) GetExampleRunInput() ExampleRunInput { - if o == nil || IsNil(o.ExampleRunInput.Get()) { - var ret ExampleRunInput - return ret - } - return *o.ExampleRunInput.Get() -} - -// GetExampleRunInputOk returns a tuple with the ExampleRunInput field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *UpdateActorRequest) GetExampleRunInputOk() (*ExampleRunInput, bool) { - if o == nil { - return nil, false - } - return o.ExampleRunInput.Get(), o.ExampleRunInput.IsSet() -} - -// HasExampleRunInput returns a boolean if a field has been set. -func (o *UpdateActorRequest) HasExampleRunInput() bool { - if o != nil && o.ExampleRunInput.IsSet() { - return true - } - - return false -} - -// SetExampleRunInput gets a reference to the given NullableExampleRunInput and assigns it to the ExampleRunInput field. -func (o *UpdateActorRequest) SetExampleRunInput(v ExampleRunInput) { - o.ExampleRunInput.Set(&v) -} -// SetExampleRunInputNil sets the value for ExampleRunInput to be an explicit nil -func (o *UpdateActorRequest) SetExampleRunInputNil() { - o.ExampleRunInput.Set(nil) -} - -// UnsetExampleRunInput ensures that no value is present for ExampleRunInput, not even an explicit nil -func (o *UpdateActorRequest) UnsetExampleRunInput() { - o.ExampleRunInput.Unset() -} - -// GetIsDeprecated returns the IsDeprecated field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *UpdateActorRequest) GetIsDeprecated() bool { - if o == nil || IsNil(o.IsDeprecated.Get()) { - var ret bool - return ret - } - return *o.IsDeprecated.Get() -} - -// GetIsDeprecatedOk returns a tuple with the IsDeprecated field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *UpdateActorRequest) GetIsDeprecatedOk() (*bool, bool) { - if o == nil { - return nil, false - } - return o.IsDeprecated.Get(), o.IsDeprecated.IsSet() -} - -// HasIsDeprecated returns a boolean if a field has been set. -func (o *UpdateActorRequest) HasIsDeprecated() bool { - if o != nil && o.IsDeprecated.IsSet() { - return true - } - - return false -} - -// SetIsDeprecated gets a reference to the given NullableBool and assigns it to the IsDeprecated field. -func (o *UpdateActorRequest) SetIsDeprecated(v bool) { - o.IsDeprecated.Set(&v) -} -// SetIsDeprecatedNil sets the value for IsDeprecated to be an explicit nil -func (o *UpdateActorRequest) SetIsDeprecatedNil() { - o.IsDeprecated.Set(nil) -} - -// UnsetIsDeprecated ensures that no value is present for IsDeprecated, not even an explicit nil -func (o *UpdateActorRequest) UnsetIsDeprecated() { - o.IsDeprecated.Unset() -} - -func (o UpdateActorRequest) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o UpdateActorRequest) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if !IsNil(o.Name) { - toSerialize["name"] = o.Name - } - if o.Description.IsSet() { - toSerialize["description"] = o.Description.Get() - } - if !IsNil(o.IsPublic) { - toSerialize["isPublic"] = o.IsPublic - } - if o.ActorPermissionLevel.IsSet() { - toSerialize["actorPermissionLevel"] = o.ActorPermissionLevel.Get() - } - if o.SeoTitle.IsSet() { - toSerialize["seoTitle"] = o.SeoTitle.Get() - } - if o.SeoDescription.IsSet() { - toSerialize["seoDescription"] = o.SeoDescription.Get() - } - if o.Title.IsSet() { - toSerialize["title"] = o.Title.Get() - } - if !IsNil(o.RestartOnError) { - toSerialize["restartOnError"] = o.RestartOnError - } - if !IsNil(o.Versions) { - toSerialize["versions"] = o.Versions - } - if !IsNil(o.PricingInfos) { - toSerialize["pricingInfos"] = o.PricingInfos - } - if o.Categories != nil { - toSerialize["categories"] = o.Categories - } - if o.DefaultRunOptions.IsSet() { - toSerialize["defaultRunOptions"] = o.DefaultRunOptions.Get() - } - if !IsNil(o.TaggedBuilds) { - toSerialize["taggedBuilds"] = o.TaggedBuilds - } - if o.ActorStandby.IsSet() { - toSerialize["actorStandby"] = o.ActorStandby.Get() - } - if o.ExampleRunInput.IsSet() { - toSerialize["exampleRunInput"] = o.ExampleRunInput.Get() - } - if o.IsDeprecated.IsSet() { - toSerialize["isDeprecated"] = o.IsDeprecated.Get() - } - return toSerialize, nil -} - -type NullableUpdateActorRequest struct { - value *UpdateActorRequest - isSet bool -} - -func (v NullableUpdateActorRequest) Get() *UpdateActorRequest { - return v.value -} - -func (v *NullableUpdateActorRequest) Set(val *UpdateActorRequest) { - v.value = val - v.isSet = true -} - -func (v NullableUpdateActorRequest) IsSet() bool { - return v.isSet -} - -func (v *NullableUpdateActorRequest) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableUpdateActorRequest(val *UpdateActorRequest) *NullableUpdateActorRequest { - return &NullableUpdateActorRequest{value: val, isSet: true} -} - -func (v NullableUpdateActorRequest) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableUpdateActorRequest) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_update_dataset_request.go b/model_update_dataset_request.go deleted file mode 100644 index a9979ea..0000000 --- a/model_update_dataset_request.go +++ /dev/null @@ -1,172 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" -) - -// checks if the UpdateDatasetRequest type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &UpdateDatasetRequest{} - -// UpdateDatasetRequest struct for UpdateDatasetRequest -type UpdateDatasetRequest struct { - Name NullableString `json:"name,omitempty"` - GeneralAccess *GeneralAccess `json:"generalAccess,omitempty"` -} - -// NewUpdateDatasetRequest instantiates a new UpdateDatasetRequest object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewUpdateDatasetRequest() *UpdateDatasetRequest { - this := UpdateDatasetRequest{} - return &this -} - -// NewUpdateDatasetRequestWithDefaults instantiates a new UpdateDatasetRequest object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewUpdateDatasetRequestWithDefaults() *UpdateDatasetRequest { - this := UpdateDatasetRequest{} - return &this -} - -// GetName returns the Name field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *UpdateDatasetRequest) GetName() string { - if o == nil || IsNil(o.Name.Get()) { - var ret string - return ret - } - return *o.Name.Get() -} - -// GetNameOk returns a tuple with the Name field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *UpdateDatasetRequest) GetNameOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.Name.Get(), o.Name.IsSet() -} - -// HasName returns a boolean if a field has been set. -func (o *UpdateDatasetRequest) HasName() bool { - if o != nil && o.Name.IsSet() { - return true - } - - return false -} - -// SetName gets a reference to the given NullableString and assigns it to the Name field. -func (o *UpdateDatasetRequest) SetName(v string) { - o.Name.Set(&v) -} -// SetNameNil sets the value for Name to be an explicit nil -func (o *UpdateDatasetRequest) SetNameNil() { - o.Name.Set(nil) -} - -// UnsetName ensures that no value is present for Name, not even an explicit nil -func (o *UpdateDatasetRequest) UnsetName() { - o.Name.Unset() -} - -// GetGeneralAccess returns the GeneralAccess field value if set, zero value otherwise. -func (o *UpdateDatasetRequest) GetGeneralAccess() GeneralAccess { - if o == nil || IsNil(o.GeneralAccess) { - var ret GeneralAccess - return ret - } - return *o.GeneralAccess -} - -// GetGeneralAccessOk returns a tuple with the GeneralAccess field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *UpdateDatasetRequest) GetGeneralAccessOk() (*GeneralAccess, bool) { - if o == nil || IsNil(o.GeneralAccess) { - return nil, false - } - return o.GeneralAccess, true -} - -// HasGeneralAccess returns a boolean if a field has been set. -func (o *UpdateDatasetRequest) HasGeneralAccess() bool { - if o != nil && !IsNil(o.GeneralAccess) { - return true - } - - return false -} - -// SetGeneralAccess gets a reference to the given GeneralAccess and assigns it to the GeneralAccess field. -func (o *UpdateDatasetRequest) SetGeneralAccess(v GeneralAccess) { - o.GeneralAccess = &v -} - -func (o UpdateDatasetRequest) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o UpdateDatasetRequest) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if o.Name.IsSet() { - toSerialize["name"] = o.Name.Get() - } - if !IsNil(o.GeneralAccess) { - toSerialize["generalAccess"] = o.GeneralAccess - } - return toSerialize, nil -} - -type NullableUpdateDatasetRequest struct { - value *UpdateDatasetRequest - isSet bool -} - -func (v NullableUpdateDatasetRequest) Get() *UpdateDatasetRequest { - return v.value -} - -func (v *NullableUpdateDatasetRequest) Set(val *UpdateDatasetRequest) { - v.value = val - v.isSet = true -} - -func (v NullableUpdateDatasetRequest) IsSet() bool { - return v.isSet -} - -func (v *NullableUpdateDatasetRequest) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableUpdateDatasetRequest(val *UpdateDatasetRequest) *NullableUpdateDatasetRequest { - return &NullableUpdateDatasetRequest{value: val, isSet: true} -} - -func (v NullableUpdateDatasetRequest) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableUpdateDatasetRequest) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_update_limits_request.go b/model_update_limits_request.go deleted file mode 100644 index 3bde37a..0000000 --- a/model_update_limits_request.go +++ /dev/null @@ -1,164 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" -) - -// checks if the UpdateLimitsRequest type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &UpdateLimitsRequest{} - -// UpdateLimitsRequest struct for UpdateLimitsRequest -type UpdateLimitsRequest struct { - // If your platform usage in the billing period exceeds the prepaid usage, you will be charged extra. Setting this property you can update your hard limit on monthly platform usage to prevent accidental overage or to limit the extra charges. - MaxMonthlyUsageUsd *float32 `json:"maxMonthlyUsageUsd,omitempty"` - // Apify securely stores your ten most recent Actor runs indefinitely, ensuring they are always accessible. Unnamed storages and other Actor runs are automatically deleted after the retention period. If you're subscribed, you can change it to keep data for longer or to limit your usage. [Lear more](https://docs.apify.com/platform/storage/usage#data-retention). - DataRetentionDays *int32 `json:"dataRetentionDays,omitempty"` -} - -// NewUpdateLimitsRequest instantiates a new UpdateLimitsRequest object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewUpdateLimitsRequest() *UpdateLimitsRequest { - this := UpdateLimitsRequest{} - return &this -} - -// NewUpdateLimitsRequestWithDefaults instantiates a new UpdateLimitsRequest object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewUpdateLimitsRequestWithDefaults() *UpdateLimitsRequest { - this := UpdateLimitsRequest{} - return &this -} - -// GetMaxMonthlyUsageUsd returns the MaxMonthlyUsageUsd field value if set, zero value otherwise. -func (o *UpdateLimitsRequest) GetMaxMonthlyUsageUsd() float32 { - if o == nil || IsNil(o.MaxMonthlyUsageUsd) { - var ret float32 - return ret - } - return *o.MaxMonthlyUsageUsd -} - -// GetMaxMonthlyUsageUsdOk returns a tuple with the MaxMonthlyUsageUsd field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *UpdateLimitsRequest) GetMaxMonthlyUsageUsdOk() (*float32, bool) { - if o == nil || IsNil(o.MaxMonthlyUsageUsd) { - return nil, false - } - return o.MaxMonthlyUsageUsd, true -} - -// HasMaxMonthlyUsageUsd returns a boolean if a field has been set. -func (o *UpdateLimitsRequest) HasMaxMonthlyUsageUsd() bool { - if o != nil && !IsNil(o.MaxMonthlyUsageUsd) { - return true - } - - return false -} - -// SetMaxMonthlyUsageUsd gets a reference to the given float32 and assigns it to the MaxMonthlyUsageUsd field. -func (o *UpdateLimitsRequest) SetMaxMonthlyUsageUsd(v float32) { - o.MaxMonthlyUsageUsd = &v -} - -// GetDataRetentionDays returns the DataRetentionDays field value if set, zero value otherwise. -func (o *UpdateLimitsRequest) GetDataRetentionDays() int32 { - if o == nil || IsNil(o.DataRetentionDays) { - var ret int32 - return ret - } - return *o.DataRetentionDays -} - -// GetDataRetentionDaysOk returns a tuple with the DataRetentionDays field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *UpdateLimitsRequest) GetDataRetentionDaysOk() (*int32, bool) { - if o == nil || IsNil(o.DataRetentionDays) { - return nil, false - } - return o.DataRetentionDays, true -} - -// HasDataRetentionDays returns a boolean if a field has been set. -func (o *UpdateLimitsRequest) HasDataRetentionDays() bool { - if o != nil && !IsNil(o.DataRetentionDays) { - return true - } - - return false -} - -// SetDataRetentionDays gets a reference to the given int32 and assigns it to the DataRetentionDays field. -func (o *UpdateLimitsRequest) SetDataRetentionDays(v int32) { - o.DataRetentionDays = &v -} - -func (o UpdateLimitsRequest) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o UpdateLimitsRequest) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if !IsNil(o.MaxMonthlyUsageUsd) { - toSerialize["maxMonthlyUsageUsd"] = o.MaxMonthlyUsageUsd - } - if !IsNil(o.DataRetentionDays) { - toSerialize["dataRetentionDays"] = o.DataRetentionDays - } - return toSerialize, nil -} - -type NullableUpdateLimitsRequest struct { - value *UpdateLimitsRequest - isSet bool -} - -func (v NullableUpdateLimitsRequest) Get() *UpdateLimitsRequest { - return v.value -} - -func (v *NullableUpdateLimitsRequest) Set(val *UpdateLimitsRequest) { - v.value = val - v.isSet = true -} - -func (v NullableUpdateLimitsRequest) IsSet() bool { - return v.isSet -} - -func (v *NullableUpdateLimitsRequest) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableUpdateLimitsRequest(val *UpdateLimitsRequest) *NullableUpdateLimitsRequest { - return &NullableUpdateLimitsRequest{value: val, isSet: true} -} - -func (v NullableUpdateLimitsRequest) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableUpdateLimitsRequest) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_update_request_queue_request.go b/model_update_request_queue_request.go deleted file mode 100644 index 52e46f8..0000000 --- a/model_update_request_queue_request.go +++ /dev/null @@ -1,173 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" -) - -// checks if the UpdateRequestQueueRequest type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &UpdateRequestQueueRequest{} - -// UpdateRequestQueueRequest Request object for updating a request queue. -type UpdateRequestQueueRequest struct { - // The new name for the request queue. - Name NullableString `json:"name,omitempty"` - GeneralAccess *GeneralAccess `json:"generalAccess,omitempty"` -} - -// NewUpdateRequestQueueRequest instantiates a new UpdateRequestQueueRequest object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewUpdateRequestQueueRequest() *UpdateRequestQueueRequest { - this := UpdateRequestQueueRequest{} - return &this -} - -// NewUpdateRequestQueueRequestWithDefaults instantiates a new UpdateRequestQueueRequest object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewUpdateRequestQueueRequestWithDefaults() *UpdateRequestQueueRequest { - this := UpdateRequestQueueRequest{} - return &this -} - -// GetName returns the Name field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *UpdateRequestQueueRequest) GetName() string { - if o == nil || IsNil(o.Name.Get()) { - var ret string - return ret - } - return *o.Name.Get() -} - -// GetNameOk returns a tuple with the Name field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *UpdateRequestQueueRequest) GetNameOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.Name.Get(), o.Name.IsSet() -} - -// HasName returns a boolean if a field has been set. -func (o *UpdateRequestQueueRequest) HasName() bool { - if o != nil && o.Name.IsSet() { - return true - } - - return false -} - -// SetName gets a reference to the given NullableString and assigns it to the Name field. -func (o *UpdateRequestQueueRequest) SetName(v string) { - o.Name.Set(&v) -} -// SetNameNil sets the value for Name to be an explicit nil -func (o *UpdateRequestQueueRequest) SetNameNil() { - o.Name.Set(nil) -} - -// UnsetName ensures that no value is present for Name, not even an explicit nil -func (o *UpdateRequestQueueRequest) UnsetName() { - o.Name.Unset() -} - -// GetGeneralAccess returns the GeneralAccess field value if set, zero value otherwise. -func (o *UpdateRequestQueueRequest) GetGeneralAccess() GeneralAccess { - if o == nil || IsNil(o.GeneralAccess) { - var ret GeneralAccess - return ret - } - return *o.GeneralAccess -} - -// GetGeneralAccessOk returns a tuple with the GeneralAccess field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *UpdateRequestQueueRequest) GetGeneralAccessOk() (*GeneralAccess, bool) { - if o == nil || IsNil(o.GeneralAccess) { - return nil, false - } - return o.GeneralAccess, true -} - -// HasGeneralAccess returns a boolean if a field has been set. -func (o *UpdateRequestQueueRequest) HasGeneralAccess() bool { - if o != nil && !IsNil(o.GeneralAccess) { - return true - } - - return false -} - -// SetGeneralAccess gets a reference to the given GeneralAccess and assigns it to the GeneralAccess field. -func (o *UpdateRequestQueueRequest) SetGeneralAccess(v GeneralAccess) { - o.GeneralAccess = &v -} - -func (o UpdateRequestQueueRequest) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o UpdateRequestQueueRequest) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if o.Name.IsSet() { - toSerialize["name"] = o.Name.Get() - } - if !IsNil(o.GeneralAccess) { - toSerialize["generalAccess"] = o.GeneralAccess - } - return toSerialize, nil -} - -type NullableUpdateRequestQueueRequest struct { - value *UpdateRequestQueueRequest - isSet bool -} - -func (v NullableUpdateRequestQueueRequest) Get() *UpdateRequestQueueRequest { - return v.value -} - -func (v *NullableUpdateRequestQueueRequest) Set(val *UpdateRequestQueueRequest) { - v.value = val - v.isSet = true -} - -func (v NullableUpdateRequestQueueRequest) IsSet() bool { - return v.isSet -} - -func (v *NullableUpdateRequestQueueRequest) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableUpdateRequestQueueRequest(val *UpdateRequestQueueRequest) *NullableUpdateRequestQueueRequest { - return &NullableUpdateRequestQueueRequest{value: val, isSet: true} -} - -func (v NullableUpdateRequestQueueRequest) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableUpdateRequestQueueRequest) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_update_request_response.go b/model_update_request_response.go deleted file mode 100644 index 63273d0..0000000 --- a/model_update_request_response.go +++ /dev/null @@ -1,158 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" - "bytes" - "fmt" -) - -// checks if the UpdateRequestResponse type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &UpdateRequestResponse{} - -// UpdateRequestResponse Response containing the result of updating a request in the request queue. -type UpdateRequestResponse struct { - Data RequestRegistration `json:"data"` -} - -type _UpdateRequestResponse UpdateRequestResponse - -// NewUpdateRequestResponse instantiates a new UpdateRequestResponse object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewUpdateRequestResponse(data RequestRegistration) *UpdateRequestResponse { - this := UpdateRequestResponse{} - this.Data = data - return &this -} - -// NewUpdateRequestResponseWithDefaults instantiates a new UpdateRequestResponse object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewUpdateRequestResponseWithDefaults() *UpdateRequestResponse { - this := UpdateRequestResponse{} - return &this -} - -// GetData returns the Data field value -func (o *UpdateRequestResponse) GetData() RequestRegistration { - if o == nil { - var ret RequestRegistration - return ret - } - - return o.Data -} - -// GetDataOk returns a tuple with the Data field value -// and a boolean to check if the value has been set. -func (o *UpdateRequestResponse) GetDataOk() (*RequestRegistration, bool) { - if o == nil { - return nil, false - } - return &o.Data, true -} - -// SetData sets field value -func (o *UpdateRequestResponse) SetData(v RequestRegistration) { - o.Data = v -} - -func (o UpdateRequestResponse) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o UpdateRequestResponse) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["data"] = o.Data - return toSerialize, nil -} - -func (o *UpdateRequestResponse) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "data", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err; - } - - for _, requiredProperty := range(requiredProperties) { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varUpdateRequestResponse := _UpdateRequestResponse{} - - decoder := json.NewDecoder(bytes.NewReader(data)) - decoder.DisallowUnknownFields() - err = decoder.Decode(&varUpdateRequestResponse) - - if err != nil { - return err - } - - *o = UpdateRequestResponse(varUpdateRequestResponse) - - return err -} - -type NullableUpdateRequestResponse struct { - value *UpdateRequestResponse - isSet bool -} - -func (v NullableUpdateRequestResponse) Get() *UpdateRequestResponse { - return v.value -} - -func (v *NullableUpdateRequestResponse) Set(val *UpdateRequestResponse) { - v.value = val - v.isSet = true -} - -func (v NullableUpdateRequestResponse) IsSet() bool { - return v.isSet -} - -func (v *NullableUpdateRequestResponse) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableUpdateRequestResponse(val *UpdateRequestResponse) *NullableUpdateRequestResponse { - return &NullableUpdateRequestResponse{value: val, isSet: true} -} - -func (v NullableUpdateRequestResponse) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableUpdateRequestResponse) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_update_run_request.go b/model_update_run_request.go deleted file mode 100644 index 792707e..0000000 --- a/model_update_run_request.go +++ /dev/null @@ -1,234 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" -) - -// checks if the UpdateRunRequest type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &UpdateRunRequest{} - -// UpdateRunRequest struct for UpdateRunRequest -type UpdateRunRequest struct { - RunId *string `json:"runId,omitempty"` - StatusMessage *string `json:"statusMessage,omitempty"` - IsStatusMessageTerminal *bool `json:"isStatusMessageTerminal,omitempty"` - GeneralAccess *GeneralAccess `json:"generalAccess,omitempty"` -} - -// NewUpdateRunRequest instantiates a new UpdateRunRequest object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewUpdateRunRequest() *UpdateRunRequest { - this := UpdateRunRequest{} - return &this -} - -// NewUpdateRunRequestWithDefaults instantiates a new UpdateRunRequest object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewUpdateRunRequestWithDefaults() *UpdateRunRequest { - this := UpdateRunRequest{} - return &this -} - -// GetRunId returns the RunId field value if set, zero value otherwise. -func (o *UpdateRunRequest) GetRunId() string { - if o == nil || IsNil(o.RunId) { - var ret string - return ret - } - return *o.RunId -} - -// GetRunIdOk returns a tuple with the RunId field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *UpdateRunRequest) GetRunIdOk() (*string, bool) { - if o == nil || IsNil(o.RunId) { - return nil, false - } - return o.RunId, true -} - -// HasRunId returns a boolean if a field has been set. -func (o *UpdateRunRequest) HasRunId() bool { - if o != nil && !IsNil(o.RunId) { - return true - } - - return false -} - -// SetRunId gets a reference to the given string and assigns it to the RunId field. -func (o *UpdateRunRequest) SetRunId(v string) { - o.RunId = &v -} - -// GetStatusMessage returns the StatusMessage field value if set, zero value otherwise. -func (o *UpdateRunRequest) GetStatusMessage() string { - if o == nil || IsNil(o.StatusMessage) { - var ret string - return ret - } - return *o.StatusMessage -} - -// GetStatusMessageOk returns a tuple with the StatusMessage field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *UpdateRunRequest) GetStatusMessageOk() (*string, bool) { - if o == nil || IsNil(o.StatusMessage) { - return nil, false - } - return o.StatusMessage, true -} - -// HasStatusMessage returns a boolean if a field has been set. -func (o *UpdateRunRequest) HasStatusMessage() bool { - if o != nil && !IsNil(o.StatusMessage) { - return true - } - - return false -} - -// SetStatusMessage gets a reference to the given string and assigns it to the StatusMessage field. -func (o *UpdateRunRequest) SetStatusMessage(v string) { - o.StatusMessage = &v -} - -// GetIsStatusMessageTerminal returns the IsStatusMessageTerminal field value if set, zero value otherwise. -func (o *UpdateRunRequest) GetIsStatusMessageTerminal() bool { - if o == nil || IsNil(o.IsStatusMessageTerminal) { - var ret bool - return ret - } - return *o.IsStatusMessageTerminal -} - -// GetIsStatusMessageTerminalOk returns a tuple with the IsStatusMessageTerminal field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *UpdateRunRequest) GetIsStatusMessageTerminalOk() (*bool, bool) { - if o == nil || IsNil(o.IsStatusMessageTerminal) { - return nil, false - } - return o.IsStatusMessageTerminal, true -} - -// HasIsStatusMessageTerminal returns a boolean if a field has been set. -func (o *UpdateRunRequest) HasIsStatusMessageTerminal() bool { - if o != nil && !IsNil(o.IsStatusMessageTerminal) { - return true - } - - return false -} - -// SetIsStatusMessageTerminal gets a reference to the given bool and assigns it to the IsStatusMessageTerminal field. -func (o *UpdateRunRequest) SetIsStatusMessageTerminal(v bool) { - o.IsStatusMessageTerminal = &v -} - -// GetGeneralAccess returns the GeneralAccess field value if set, zero value otherwise. -func (o *UpdateRunRequest) GetGeneralAccess() GeneralAccess { - if o == nil || IsNil(o.GeneralAccess) { - var ret GeneralAccess - return ret - } - return *o.GeneralAccess -} - -// GetGeneralAccessOk returns a tuple with the GeneralAccess field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *UpdateRunRequest) GetGeneralAccessOk() (*GeneralAccess, bool) { - if o == nil || IsNil(o.GeneralAccess) { - return nil, false - } - return o.GeneralAccess, true -} - -// HasGeneralAccess returns a boolean if a field has been set. -func (o *UpdateRunRequest) HasGeneralAccess() bool { - if o != nil && !IsNil(o.GeneralAccess) { - return true - } - - return false -} - -// SetGeneralAccess gets a reference to the given GeneralAccess and assigns it to the GeneralAccess field. -func (o *UpdateRunRequest) SetGeneralAccess(v GeneralAccess) { - o.GeneralAccess = &v -} - -func (o UpdateRunRequest) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o UpdateRunRequest) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if !IsNil(o.RunId) { - toSerialize["runId"] = o.RunId - } - if !IsNil(o.StatusMessage) { - toSerialize["statusMessage"] = o.StatusMessage - } - if !IsNil(o.IsStatusMessageTerminal) { - toSerialize["isStatusMessageTerminal"] = o.IsStatusMessageTerminal - } - if !IsNil(o.GeneralAccess) { - toSerialize["generalAccess"] = o.GeneralAccess - } - return toSerialize, nil -} - -type NullableUpdateRunRequest struct { - value *UpdateRunRequest - isSet bool -} - -func (v NullableUpdateRunRequest) Get() *UpdateRunRequest { - return v.value -} - -func (v *NullableUpdateRunRequest) Set(val *UpdateRunRequest) { - v.value = val - v.isSet = true -} - -func (v NullableUpdateRunRequest) IsSet() bool { - return v.isSet -} - -func (v *NullableUpdateRunRequest) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableUpdateRunRequest(val *UpdateRunRequest) *NullableUpdateRunRequest { - return &NullableUpdateRunRequest{value: val, isSet: true} -} - -func (v NullableUpdateRunRequest) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableUpdateRunRequest) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_update_store_request.go b/model_update_store_request.go deleted file mode 100644 index 1b4cb82..0000000 --- a/model_update_store_request.go +++ /dev/null @@ -1,172 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" -) - -// checks if the UpdateStoreRequest type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &UpdateStoreRequest{} - -// UpdateStoreRequest struct for UpdateStoreRequest -type UpdateStoreRequest struct { - Name NullableString `json:"name,omitempty"` - GeneralAccess *GeneralAccess `json:"generalAccess,omitempty"` -} - -// NewUpdateStoreRequest instantiates a new UpdateStoreRequest object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewUpdateStoreRequest() *UpdateStoreRequest { - this := UpdateStoreRequest{} - return &this -} - -// NewUpdateStoreRequestWithDefaults instantiates a new UpdateStoreRequest object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewUpdateStoreRequestWithDefaults() *UpdateStoreRequest { - this := UpdateStoreRequest{} - return &this -} - -// GetName returns the Name field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *UpdateStoreRequest) GetName() string { - if o == nil || IsNil(o.Name.Get()) { - var ret string - return ret - } - return *o.Name.Get() -} - -// GetNameOk returns a tuple with the Name field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *UpdateStoreRequest) GetNameOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.Name.Get(), o.Name.IsSet() -} - -// HasName returns a boolean if a field has been set. -func (o *UpdateStoreRequest) HasName() bool { - if o != nil && o.Name.IsSet() { - return true - } - - return false -} - -// SetName gets a reference to the given NullableString and assigns it to the Name field. -func (o *UpdateStoreRequest) SetName(v string) { - o.Name.Set(&v) -} -// SetNameNil sets the value for Name to be an explicit nil -func (o *UpdateStoreRequest) SetNameNil() { - o.Name.Set(nil) -} - -// UnsetName ensures that no value is present for Name, not even an explicit nil -func (o *UpdateStoreRequest) UnsetName() { - o.Name.Unset() -} - -// GetGeneralAccess returns the GeneralAccess field value if set, zero value otherwise. -func (o *UpdateStoreRequest) GetGeneralAccess() GeneralAccess { - if o == nil || IsNil(o.GeneralAccess) { - var ret GeneralAccess - return ret - } - return *o.GeneralAccess -} - -// GetGeneralAccessOk returns a tuple with the GeneralAccess field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *UpdateStoreRequest) GetGeneralAccessOk() (*GeneralAccess, bool) { - if o == nil || IsNil(o.GeneralAccess) { - return nil, false - } - return o.GeneralAccess, true -} - -// HasGeneralAccess returns a boolean if a field has been set. -func (o *UpdateStoreRequest) HasGeneralAccess() bool { - if o != nil && !IsNil(o.GeneralAccess) { - return true - } - - return false -} - -// SetGeneralAccess gets a reference to the given GeneralAccess and assigns it to the GeneralAccess field. -func (o *UpdateStoreRequest) SetGeneralAccess(v GeneralAccess) { - o.GeneralAccess = &v -} - -func (o UpdateStoreRequest) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o UpdateStoreRequest) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if o.Name.IsSet() { - toSerialize["name"] = o.Name.Get() - } - if !IsNil(o.GeneralAccess) { - toSerialize["generalAccess"] = o.GeneralAccess - } - return toSerialize, nil -} - -type NullableUpdateStoreRequest struct { - value *UpdateStoreRequest - isSet bool -} - -func (v NullableUpdateStoreRequest) Get() *UpdateStoreRequest { - return v.value -} - -func (v *NullableUpdateStoreRequest) Set(val *UpdateStoreRequest) { - v.value = val - v.isSet = true -} - -func (v NullableUpdateStoreRequest) IsSet() bool { - return v.isSet -} - -func (v *NullableUpdateStoreRequest) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableUpdateStoreRequest(val *UpdateStoreRequest) *NullableUpdateStoreRequest { - return &NullableUpdateStoreRequest{value: val, isSet: true} -} - -func (v NullableUpdateStoreRequest) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableUpdateStoreRequest) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_update_task_request.go b/model_update_task_request.go deleted file mode 100644 index 928ecff..0000000 --- a/model_update_task_request.go +++ /dev/null @@ -1,302 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" -) - -// checks if the UpdateTaskRequest type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &UpdateTaskRequest{} - -// UpdateTaskRequest struct for UpdateTaskRequest -type UpdateTaskRequest struct { - Name *string `json:"name,omitempty"` - Options NullableTaskOptions `json:"options,omitempty"` - // The input configuration for the Actor task. This is a user-defined JSON object that will be passed to the Actor when the task is run. - Input map[string]interface{} `json:"input,omitempty"` - Title NullableString `json:"title,omitempty"` - ActorStandby NullableActorStandby `json:"actorStandby,omitempty"` -} - -// NewUpdateTaskRequest instantiates a new UpdateTaskRequest object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewUpdateTaskRequest() *UpdateTaskRequest { - this := UpdateTaskRequest{} - return &this -} - -// NewUpdateTaskRequestWithDefaults instantiates a new UpdateTaskRequest object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewUpdateTaskRequestWithDefaults() *UpdateTaskRequest { - this := UpdateTaskRequest{} - return &this -} - -// GetName returns the Name field value if set, zero value otherwise. -func (o *UpdateTaskRequest) GetName() string { - if o == nil || IsNil(o.Name) { - var ret string - return ret - } - return *o.Name -} - -// GetNameOk returns a tuple with the Name field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *UpdateTaskRequest) GetNameOk() (*string, bool) { - if o == nil || IsNil(o.Name) { - return nil, false - } - return o.Name, true -} - -// HasName returns a boolean if a field has been set. -func (o *UpdateTaskRequest) HasName() bool { - if o != nil && !IsNil(o.Name) { - return true - } - - return false -} - -// SetName gets a reference to the given string and assigns it to the Name field. -func (o *UpdateTaskRequest) SetName(v string) { - o.Name = &v -} - -// GetOptions returns the Options field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *UpdateTaskRequest) GetOptions() TaskOptions { - if o == nil || IsNil(o.Options.Get()) { - var ret TaskOptions - return ret - } - return *o.Options.Get() -} - -// GetOptionsOk returns a tuple with the Options field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *UpdateTaskRequest) GetOptionsOk() (*TaskOptions, bool) { - if o == nil { - return nil, false - } - return o.Options.Get(), o.Options.IsSet() -} - -// HasOptions returns a boolean if a field has been set. -func (o *UpdateTaskRequest) HasOptions() bool { - if o != nil && o.Options.IsSet() { - return true - } - - return false -} - -// SetOptions gets a reference to the given NullableTaskOptions and assigns it to the Options field. -func (o *UpdateTaskRequest) SetOptions(v TaskOptions) { - o.Options.Set(&v) -} -// SetOptionsNil sets the value for Options to be an explicit nil -func (o *UpdateTaskRequest) SetOptionsNil() { - o.Options.Set(nil) -} - -// UnsetOptions ensures that no value is present for Options, not even an explicit nil -func (o *UpdateTaskRequest) UnsetOptions() { - o.Options.Unset() -} - -// GetInput returns the Input field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *UpdateTaskRequest) GetInput() map[string]interface{} { - if o == nil { - var ret map[string]interface{} - return ret - } - return o.Input -} - -// GetInputOk returns a tuple with the Input field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *UpdateTaskRequest) GetInputOk() (map[string]interface{}, bool) { - if o == nil || IsNil(o.Input) { - return map[string]interface{}{}, false - } - return o.Input, true -} - -// HasInput returns a boolean if a field has been set. -func (o *UpdateTaskRequest) HasInput() bool { - if o != nil && !IsNil(o.Input) { - return true - } - - return false -} - -// SetInput gets a reference to the given map[string]interface{} and assigns it to the Input field. -func (o *UpdateTaskRequest) SetInput(v map[string]interface{}) { - o.Input = v -} - -// GetTitle returns the Title field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *UpdateTaskRequest) GetTitle() string { - if o == nil || IsNil(o.Title.Get()) { - var ret string - return ret - } - return *o.Title.Get() -} - -// GetTitleOk returns a tuple with the Title field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *UpdateTaskRequest) GetTitleOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.Title.Get(), o.Title.IsSet() -} - -// HasTitle returns a boolean if a field has been set. -func (o *UpdateTaskRequest) HasTitle() bool { - if o != nil && o.Title.IsSet() { - return true - } - - return false -} - -// SetTitle gets a reference to the given NullableString and assigns it to the Title field. -func (o *UpdateTaskRequest) SetTitle(v string) { - o.Title.Set(&v) -} -// SetTitleNil sets the value for Title to be an explicit nil -func (o *UpdateTaskRequest) SetTitleNil() { - o.Title.Set(nil) -} - -// UnsetTitle ensures that no value is present for Title, not even an explicit nil -func (o *UpdateTaskRequest) UnsetTitle() { - o.Title.Unset() -} - -// GetActorStandby returns the ActorStandby field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *UpdateTaskRequest) GetActorStandby() ActorStandby { - if o == nil || IsNil(o.ActorStandby.Get()) { - var ret ActorStandby - return ret - } - return *o.ActorStandby.Get() -} - -// GetActorStandbyOk returns a tuple with the ActorStandby field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *UpdateTaskRequest) GetActorStandbyOk() (*ActorStandby, bool) { - if o == nil { - return nil, false - } - return o.ActorStandby.Get(), o.ActorStandby.IsSet() -} - -// HasActorStandby returns a boolean if a field has been set. -func (o *UpdateTaskRequest) HasActorStandby() bool { - if o != nil && o.ActorStandby.IsSet() { - return true - } - - return false -} - -// SetActorStandby gets a reference to the given NullableActorStandby and assigns it to the ActorStandby field. -func (o *UpdateTaskRequest) SetActorStandby(v ActorStandby) { - o.ActorStandby.Set(&v) -} -// SetActorStandbyNil sets the value for ActorStandby to be an explicit nil -func (o *UpdateTaskRequest) SetActorStandbyNil() { - o.ActorStandby.Set(nil) -} - -// UnsetActorStandby ensures that no value is present for ActorStandby, not even an explicit nil -func (o *UpdateTaskRequest) UnsetActorStandby() { - o.ActorStandby.Unset() -} - -func (o UpdateTaskRequest) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o UpdateTaskRequest) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if !IsNil(o.Name) { - toSerialize["name"] = o.Name - } - if o.Options.IsSet() { - toSerialize["options"] = o.Options.Get() - } - if o.Input != nil { - toSerialize["input"] = o.Input - } - if o.Title.IsSet() { - toSerialize["title"] = o.Title.Get() - } - if o.ActorStandby.IsSet() { - toSerialize["actorStandby"] = o.ActorStandby.Get() - } - return toSerialize, nil -} - -type NullableUpdateTaskRequest struct { - value *UpdateTaskRequest - isSet bool -} - -func (v NullableUpdateTaskRequest) Get() *UpdateTaskRequest { - return v.value -} - -func (v *NullableUpdateTaskRequest) Set(val *UpdateTaskRequest) { - v.value = val - v.isSet = true -} - -func (v NullableUpdateTaskRequest) IsSet() bool { - return v.isSet -} - -func (v *NullableUpdateTaskRequest) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableUpdateTaskRequest(val *UpdateTaskRequest) *NullableUpdateTaskRequest { - return &NullableUpdateTaskRequest{value: val, isSet: true} -} - -func (v NullableUpdateTaskRequest) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableUpdateTaskRequest) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_usage_cycle.go b/model_usage_cycle.go deleted file mode 100644 index b7ddb75..0000000 --- a/model_usage_cycle.go +++ /dev/null @@ -1,187 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" - "time" - "bytes" - "fmt" -) - -// checks if the UsageCycle type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &UsageCycle{} - -// UsageCycle struct for UsageCycle -type UsageCycle struct { - StartAt time.Time `json:"startAt"` - EndAt time.Time `json:"endAt"` -} - -type _UsageCycle UsageCycle - -// NewUsageCycle instantiates a new UsageCycle object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewUsageCycle(startAt time.Time, endAt time.Time) *UsageCycle { - this := UsageCycle{} - this.StartAt = startAt - this.EndAt = endAt - return &this -} - -// NewUsageCycleWithDefaults instantiates a new UsageCycle object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewUsageCycleWithDefaults() *UsageCycle { - this := UsageCycle{} - return &this -} - -// GetStartAt returns the StartAt field value -func (o *UsageCycle) GetStartAt() time.Time { - if o == nil { - var ret time.Time - return ret - } - - return o.StartAt -} - -// GetStartAtOk returns a tuple with the StartAt field value -// and a boolean to check if the value has been set. -func (o *UsageCycle) GetStartAtOk() (*time.Time, bool) { - if o == nil { - return nil, false - } - return &o.StartAt, true -} - -// SetStartAt sets field value -func (o *UsageCycle) SetStartAt(v time.Time) { - o.StartAt = v -} - -// GetEndAt returns the EndAt field value -func (o *UsageCycle) GetEndAt() time.Time { - if o == nil { - var ret time.Time - return ret - } - - return o.EndAt -} - -// GetEndAtOk returns a tuple with the EndAt field value -// and a boolean to check if the value has been set. -func (o *UsageCycle) GetEndAtOk() (*time.Time, bool) { - if o == nil { - return nil, false - } - return &o.EndAt, true -} - -// SetEndAt sets field value -func (o *UsageCycle) SetEndAt(v time.Time) { - o.EndAt = v -} - -func (o UsageCycle) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o UsageCycle) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["startAt"] = o.StartAt - toSerialize["endAt"] = o.EndAt - return toSerialize, nil -} - -func (o *UsageCycle) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "startAt", - "endAt", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err; - } - - for _, requiredProperty := range(requiredProperties) { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varUsageCycle := _UsageCycle{} - - decoder := json.NewDecoder(bytes.NewReader(data)) - decoder.DisallowUnknownFields() - err = decoder.Decode(&varUsageCycle) - - if err != nil { - return err - } - - *o = UsageCycle(varUsageCycle) - - return err -} - -type NullableUsageCycle struct { - value *UsageCycle - isSet bool -} - -func (v NullableUsageCycle) Get() *UsageCycle { - return v.value -} - -func (v *NullableUsageCycle) Set(val *UsageCycle) { - v.value = val - v.isSet = true -} - -func (v NullableUsageCycle) IsSet() bool { - return v.isSet -} - -func (v *NullableUsageCycle) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableUsageCycle(val *UsageCycle) *NullableUsageCycle { - return &NullableUsageCycle{value: val, isSet: true} -} - -func (v NullableUsageCycle) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableUsageCycle) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_usage_item.go b/model_usage_item.go deleted file mode 100644 index f763ba5..0000000 --- a/model_usage_item.go +++ /dev/null @@ -1,295 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" - "bytes" - "fmt" -) - -// checks if the UsageItem type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &UsageItem{} - -// UsageItem struct for UsageItem -type UsageItem struct { - Quantity float32 `json:"quantity"` - BaseAmountUsd float32 `json:"baseAmountUsd"` - BaseUnitPriceUsd *float32 `json:"baseUnitPriceUsd,omitempty"` - AmountAfterVolumeDiscountUsd *float32 `json:"amountAfterVolumeDiscountUsd,omitempty"` - // - PriceTiers []PriceTiers `json:"priceTiers,omitempty"` -} - -type _UsageItem UsageItem - -// NewUsageItem instantiates a new UsageItem object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewUsageItem(quantity float32, baseAmountUsd float32) *UsageItem { - this := UsageItem{} - this.Quantity = quantity - this.BaseAmountUsd = baseAmountUsd - return &this -} - -// NewUsageItemWithDefaults instantiates a new UsageItem object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewUsageItemWithDefaults() *UsageItem { - this := UsageItem{} - return &this -} - -// GetQuantity returns the Quantity field value -func (o *UsageItem) GetQuantity() float32 { - if o == nil { - var ret float32 - return ret - } - - return o.Quantity -} - -// GetQuantityOk returns a tuple with the Quantity field value -// and a boolean to check if the value has been set. -func (o *UsageItem) GetQuantityOk() (*float32, bool) { - if o == nil { - return nil, false - } - return &o.Quantity, true -} - -// SetQuantity sets field value -func (o *UsageItem) SetQuantity(v float32) { - o.Quantity = v -} - -// GetBaseAmountUsd returns the BaseAmountUsd field value -func (o *UsageItem) GetBaseAmountUsd() float32 { - if o == nil { - var ret float32 - return ret - } - - return o.BaseAmountUsd -} - -// GetBaseAmountUsdOk returns a tuple with the BaseAmountUsd field value -// and a boolean to check if the value has been set. -func (o *UsageItem) GetBaseAmountUsdOk() (*float32, bool) { - if o == nil { - return nil, false - } - return &o.BaseAmountUsd, true -} - -// SetBaseAmountUsd sets field value -func (o *UsageItem) SetBaseAmountUsd(v float32) { - o.BaseAmountUsd = v -} - -// GetBaseUnitPriceUsd returns the BaseUnitPriceUsd field value if set, zero value otherwise. -func (o *UsageItem) GetBaseUnitPriceUsd() float32 { - if o == nil || IsNil(o.BaseUnitPriceUsd) { - var ret float32 - return ret - } - return *o.BaseUnitPriceUsd -} - -// GetBaseUnitPriceUsdOk returns a tuple with the BaseUnitPriceUsd field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *UsageItem) GetBaseUnitPriceUsdOk() (*float32, bool) { - if o == nil || IsNil(o.BaseUnitPriceUsd) { - return nil, false - } - return o.BaseUnitPriceUsd, true -} - -// HasBaseUnitPriceUsd returns a boolean if a field has been set. -func (o *UsageItem) HasBaseUnitPriceUsd() bool { - if o != nil && !IsNil(o.BaseUnitPriceUsd) { - return true - } - - return false -} - -// SetBaseUnitPriceUsd gets a reference to the given float32 and assigns it to the BaseUnitPriceUsd field. -func (o *UsageItem) SetBaseUnitPriceUsd(v float32) { - o.BaseUnitPriceUsd = &v -} - -// GetAmountAfterVolumeDiscountUsd returns the AmountAfterVolumeDiscountUsd field value if set, zero value otherwise. -func (o *UsageItem) GetAmountAfterVolumeDiscountUsd() float32 { - if o == nil || IsNil(o.AmountAfterVolumeDiscountUsd) { - var ret float32 - return ret - } - return *o.AmountAfterVolumeDiscountUsd -} - -// GetAmountAfterVolumeDiscountUsdOk returns a tuple with the AmountAfterVolumeDiscountUsd field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *UsageItem) GetAmountAfterVolumeDiscountUsdOk() (*float32, bool) { - if o == nil || IsNil(o.AmountAfterVolumeDiscountUsd) { - return nil, false - } - return o.AmountAfterVolumeDiscountUsd, true -} - -// HasAmountAfterVolumeDiscountUsd returns a boolean if a field has been set. -func (o *UsageItem) HasAmountAfterVolumeDiscountUsd() bool { - if o != nil && !IsNil(o.AmountAfterVolumeDiscountUsd) { - return true - } - - return false -} - -// SetAmountAfterVolumeDiscountUsd gets a reference to the given float32 and assigns it to the AmountAfterVolumeDiscountUsd field. -func (o *UsageItem) SetAmountAfterVolumeDiscountUsd(v float32) { - o.AmountAfterVolumeDiscountUsd = &v -} - -// GetPriceTiers returns the PriceTiers field value if set, zero value otherwise. -func (o *UsageItem) GetPriceTiers() []PriceTiers { - if o == nil || IsNil(o.PriceTiers) { - var ret []PriceTiers - return ret - } - return o.PriceTiers -} - -// GetPriceTiersOk returns a tuple with the PriceTiers field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *UsageItem) GetPriceTiersOk() ([]PriceTiers, bool) { - if o == nil || IsNil(o.PriceTiers) { - return nil, false - } - return o.PriceTiers, true -} - -// HasPriceTiers returns a boolean if a field has been set. -func (o *UsageItem) HasPriceTiers() bool { - if o != nil && !IsNil(o.PriceTiers) { - return true - } - - return false -} - -// SetPriceTiers gets a reference to the given []PriceTiers and assigns it to the PriceTiers field. -func (o *UsageItem) SetPriceTiers(v []PriceTiers) { - o.PriceTiers = v -} - -func (o UsageItem) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o UsageItem) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["quantity"] = o.Quantity - toSerialize["baseAmountUsd"] = o.BaseAmountUsd - if !IsNil(o.BaseUnitPriceUsd) { - toSerialize["baseUnitPriceUsd"] = o.BaseUnitPriceUsd - } - if !IsNil(o.AmountAfterVolumeDiscountUsd) { - toSerialize["amountAfterVolumeDiscountUsd"] = o.AmountAfterVolumeDiscountUsd - } - if !IsNil(o.PriceTiers) { - toSerialize["priceTiers"] = o.PriceTiers - } - return toSerialize, nil -} - -func (o *UsageItem) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "quantity", - "baseAmountUsd", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err; - } - - for _, requiredProperty := range(requiredProperties) { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varUsageItem := _UsageItem{} - - decoder := json.NewDecoder(bytes.NewReader(data)) - decoder.DisallowUnknownFields() - err = decoder.Decode(&varUsageItem) - - if err != nil { - return err - } - - *o = UsageItem(varUsageItem) - - return err -} - -type NullableUsageItem struct { - value *UsageItem - isSet bool -} - -func (v NullableUsageItem) Get() *UsageItem { - return v.value -} - -func (v *NullableUsageItem) Set(val *UsageItem) { - v.value = val - v.isSet = true -} - -func (v NullableUsageItem) IsSet() bool { - return v.isSet -} - -func (v *NullableUsageItem) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableUsageItem(val *UsageItem) *NullableUsageItem { - return &NullableUsageItem{value: val, isSet: true} -} - -func (v NullableUsageItem) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableUsageItem) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_user_private_info.go b/model_user_private_info.go deleted file mode 100644 index d5cc034..0000000 --- a/model_user_private_info.go +++ /dev/null @@ -1,383 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" - "time" - "bytes" - "fmt" -) - -// checks if the UserPrivateInfo type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &UserPrivateInfo{} - -// UserPrivateInfo struct for UserPrivateInfo -type UserPrivateInfo struct { - Id string `json:"id"` - Username string `json:"username"` - Profile Profile `json:"profile"` - Email string `json:"email"` - Proxy Proxy `json:"proxy"` - Plan Plan `json:"plan"` - EffectivePlatformFeatures EffectivePlatformFeatures `json:"effectivePlatformFeatures"` - CreatedAt time.Time `json:"createdAt"` - IsPaying bool `json:"isPaying"` -} - -type _UserPrivateInfo UserPrivateInfo - -// NewUserPrivateInfo instantiates a new UserPrivateInfo object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewUserPrivateInfo(id string, username string, profile Profile, email string, proxy Proxy, plan Plan, effectivePlatformFeatures EffectivePlatformFeatures, createdAt time.Time, isPaying bool) *UserPrivateInfo { - this := UserPrivateInfo{} - this.Id = id - this.Username = username - this.Profile = profile - this.Email = email - this.Proxy = proxy - this.Plan = plan - this.EffectivePlatformFeatures = effectivePlatformFeatures - this.CreatedAt = createdAt - this.IsPaying = isPaying - return &this -} - -// NewUserPrivateInfoWithDefaults instantiates a new UserPrivateInfo object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewUserPrivateInfoWithDefaults() *UserPrivateInfo { - this := UserPrivateInfo{} - return &this -} - -// GetId returns the Id field value -func (o *UserPrivateInfo) GetId() string { - if o == nil { - var ret string - return ret - } - - return o.Id -} - -// GetIdOk returns a tuple with the Id field value -// and a boolean to check if the value has been set. -func (o *UserPrivateInfo) GetIdOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Id, true -} - -// SetId sets field value -func (o *UserPrivateInfo) SetId(v string) { - o.Id = v -} - -// GetUsername returns the Username field value -func (o *UserPrivateInfo) GetUsername() string { - if o == nil { - var ret string - return ret - } - - return o.Username -} - -// GetUsernameOk returns a tuple with the Username field value -// and a boolean to check if the value has been set. -func (o *UserPrivateInfo) GetUsernameOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Username, true -} - -// SetUsername sets field value -func (o *UserPrivateInfo) SetUsername(v string) { - o.Username = v -} - -// GetProfile returns the Profile field value -func (o *UserPrivateInfo) GetProfile() Profile { - if o == nil { - var ret Profile - return ret - } - - return o.Profile -} - -// GetProfileOk returns a tuple with the Profile field value -// and a boolean to check if the value has been set. -func (o *UserPrivateInfo) GetProfileOk() (*Profile, bool) { - if o == nil { - return nil, false - } - return &o.Profile, true -} - -// SetProfile sets field value -func (o *UserPrivateInfo) SetProfile(v Profile) { - o.Profile = v -} - -// GetEmail returns the Email field value -func (o *UserPrivateInfo) GetEmail() string { - if o == nil { - var ret string - return ret - } - - return o.Email -} - -// GetEmailOk returns a tuple with the Email field value -// and a boolean to check if the value has been set. -func (o *UserPrivateInfo) GetEmailOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Email, true -} - -// SetEmail sets field value -func (o *UserPrivateInfo) SetEmail(v string) { - o.Email = v -} - -// GetProxy returns the Proxy field value -func (o *UserPrivateInfo) GetProxy() Proxy { - if o == nil { - var ret Proxy - return ret - } - - return o.Proxy -} - -// GetProxyOk returns a tuple with the Proxy field value -// and a boolean to check if the value has been set. -func (o *UserPrivateInfo) GetProxyOk() (*Proxy, bool) { - if o == nil { - return nil, false - } - return &o.Proxy, true -} - -// SetProxy sets field value -func (o *UserPrivateInfo) SetProxy(v Proxy) { - o.Proxy = v -} - -// GetPlan returns the Plan field value -func (o *UserPrivateInfo) GetPlan() Plan { - if o == nil { - var ret Plan - return ret - } - - return o.Plan -} - -// GetPlanOk returns a tuple with the Plan field value -// and a boolean to check if the value has been set. -func (o *UserPrivateInfo) GetPlanOk() (*Plan, bool) { - if o == nil { - return nil, false - } - return &o.Plan, true -} - -// SetPlan sets field value -func (o *UserPrivateInfo) SetPlan(v Plan) { - o.Plan = v -} - -// GetEffectivePlatformFeatures returns the EffectivePlatformFeatures field value -func (o *UserPrivateInfo) GetEffectivePlatformFeatures() EffectivePlatformFeatures { - if o == nil { - var ret EffectivePlatformFeatures - return ret - } - - return o.EffectivePlatformFeatures -} - -// GetEffectivePlatformFeaturesOk returns a tuple with the EffectivePlatformFeatures field value -// and a boolean to check if the value has been set. -func (o *UserPrivateInfo) GetEffectivePlatformFeaturesOk() (*EffectivePlatformFeatures, bool) { - if o == nil { - return nil, false - } - return &o.EffectivePlatformFeatures, true -} - -// SetEffectivePlatformFeatures sets field value -func (o *UserPrivateInfo) SetEffectivePlatformFeatures(v EffectivePlatformFeatures) { - o.EffectivePlatformFeatures = v -} - -// GetCreatedAt returns the CreatedAt field value -func (o *UserPrivateInfo) GetCreatedAt() time.Time { - if o == nil { - var ret time.Time - return ret - } - - return o.CreatedAt -} - -// GetCreatedAtOk returns a tuple with the CreatedAt field value -// and a boolean to check if the value has been set. -func (o *UserPrivateInfo) GetCreatedAtOk() (*time.Time, bool) { - if o == nil { - return nil, false - } - return &o.CreatedAt, true -} - -// SetCreatedAt sets field value -func (o *UserPrivateInfo) SetCreatedAt(v time.Time) { - o.CreatedAt = v -} - -// GetIsPaying returns the IsPaying field value -func (o *UserPrivateInfo) GetIsPaying() bool { - if o == nil { - var ret bool - return ret - } - - return o.IsPaying -} - -// GetIsPayingOk returns a tuple with the IsPaying field value -// and a boolean to check if the value has been set. -func (o *UserPrivateInfo) GetIsPayingOk() (*bool, bool) { - if o == nil { - return nil, false - } - return &o.IsPaying, true -} - -// SetIsPaying sets field value -func (o *UserPrivateInfo) SetIsPaying(v bool) { - o.IsPaying = v -} - -func (o UserPrivateInfo) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o UserPrivateInfo) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["id"] = o.Id - toSerialize["username"] = o.Username - toSerialize["profile"] = o.Profile - toSerialize["email"] = o.Email - toSerialize["proxy"] = o.Proxy - toSerialize["plan"] = o.Plan - toSerialize["effectivePlatformFeatures"] = o.EffectivePlatformFeatures - toSerialize["createdAt"] = o.CreatedAt - toSerialize["isPaying"] = o.IsPaying - return toSerialize, nil -} - -func (o *UserPrivateInfo) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "id", - "username", - "profile", - "email", - "proxy", - "plan", - "effectivePlatformFeatures", - "createdAt", - "isPaying", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err; - } - - for _, requiredProperty := range(requiredProperties) { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varUserPrivateInfo := _UserPrivateInfo{} - - decoder := json.NewDecoder(bytes.NewReader(data)) - decoder.DisallowUnknownFields() - err = decoder.Decode(&varUserPrivateInfo) - - if err != nil { - return err - } - - *o = UserPrivateInfo(varUserPrivateInfo) - - return err -} - -type NullableUserPrivateInfo struct { - value *UserPrivateInfo - isSet bool -} - -func (v NullableUserPrivateInfo) Get() *UserPrivateInfo { - return v.value -} - -func (v *NullableUserPrivateInfo) Set(val *UserPrivateInfo) { - v.value = val - v.isSet = true -} - -func (v NullableUserPrivateInfo) IsSet() bool { - return v.isSet -} - -func (v *NullableUserPrivateInfo) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableUserPrivateInfo(val *UserPrivateInfo) *NullableUserPrivateInfo { - return &NullableUserPrivateInfo{value: val, isSet: true} -} - -func (v NullableUserPrivateInfo) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableUserPrivateInfo) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_user_public_info.go b/model_user_public_info.go deleted file mode 100644 index 5da7484..0000000 --- a/model_user_public_info.go +++ /dev/null @@ -1,194 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" - "bytes" - "fmt" -) - -// checks if the UserPublicInfo type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &UserPublicInfo{} - -// UserPublicInfo struct for UserPublicInfo -type UserPublicInfo struct { - Username string `json:"username"` - Profile *Profile `json:"profile,omitempty"` -} - -type _UserPublicInfo UserPublicInfo - -// NewUserPublicInfo instantiates a new UserPublicInfo object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewUserPublicInfo(username string) *UserPublicInfo { - this := UserPublicInfo{} - this.Username = username - return &this -} - -// NewUserPublicInfoWithDefaults instantiates a new UserPublicInfo object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewUserPublicInfoWithDefaults() *UserPublicInfo { - this := UserPublicInfo{} - return &this -} - -// GetUsername returns the Username field value -func (o *UserPublicInfo) GetUsername() string { - if o == nil { - var ret string - return ret - } - - return o.Username -} - -// GetUsernameOk returns a tuple with the Username field value -// and a boolean to check if the value has been set. -func (o *UserPublicInfo) GetUsernameOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Username, true -} - -// SetUsername sets field value -func (o *UserPublicInfo) SetUsername(v string) { - o.Username = v -} - -// GetProfile returns the Profile field value if set, zero value otherwise. -func (o *UserPublicInfo) GetProfile() Profile { - if o == nil || IsNil(o.Profile) { - var ret Profile - return ret - } - return *o.Profile -} - -// GetProfileOk returns a tuple with the Profile field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *UserPublicInfo) GetProfileOk() (*Profile, bool) { - if o == nil || IsNil(o.Profile) { - return nil, false - } - return o.Profile, true -} - -// HasProfile returns a boolean if a field has been set. -func (o *UserPublicInfo) HasProfile() bool { - if o != nil && !IsNil(o.Profile) { - return true - } - - return false -} - -// SetProfile gets a reference to the given Profile and assigns it to the Profile field. -func (o *UserPublicInfo) SetProfile(v Profile) { - o.Profile = &v -} - -func (o UserPublicInfo) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o UserPublicInfo) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["username"] = o.Username - if !IsNil(o.Profile) { - toSerialize["profile"] = o.Profile - } - return toSerialize, nil -} - -func (o *UserPublicInfo) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "username", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err; - } - - for _, requiredProperty := range(requiredProperties) { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varUserPublicInfo := _UserPublicInfo{} - - decoder := json.NewDecoder(bytes.NewReader(data)) - decoder.DisallowUnknownFields() - err = decoder.Decode(&varUserPublicInfo) - - if err != nil { - return err - } - - *o = UserPublicInfo(varUserPublicInfo) - - return err -} - -type NullableUserPublicInfo struct { - value *UserPublicInfo - isSet bool -} - -func (v NullableUserPublicInfo) Get() *UserPublicInfo { - return v.value -} - -func (v *NullableUserPublicInfo) Set(val *UserPublicInfo) { - v.value = val - v.isSet = true -} - -func (v NullableUserPublicInfo) IsSet() bool { - return v.isSet -} - -func (v *NullableUserPublicInfo) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableUserPublicInfo(val *UserPublicInfo) *NullableUserPublicInfo { - return &NullableUserPublicInfo{value: val, isSet: true} -} - -func (v NullableUserPublicInfo) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableUserPublicInfo) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_validation_error.go b/model_validation_error.go deleted file mode 100644 index 79d2459..0000000 --- a/model_validation_error.go +++ /dev/null @@ -1,275 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" -) - -// checks if the ValidationError type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &ValidationError{} - -// ValidationError struct for ValidationError -type ValidationError struct { - // The path to the instance being validated. - InstancePath *string `json:"instancePath,omitempty"` - // The path to the schema that failed the validation. - SchemaPath *string `json:"schemaPath,omitempty"` - // The validation keyword that caused the error. - Keyword *string `json:"keyword,omitempty"` - // A message describing the validation error. - Message *string `json:"message,omitempty"` - // Additional parameters specific to the validation error. - Params map[string]interface{} `json:"params,omitempty"` -} - -// NewValidationError instantiates a new ValidationError object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewValidationError() *ValidationError { - this := ValidationError{} - return &this -} - -// NewValidationErrorWithDefaults instantiates a new ValidationError object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewValidationErrorWithDefaults() *ValidationError { - this := ValidationError{} - return &this -} - -// GetInstancePath returns the InstancePath field value if set, zero value otherwise. -func (o *ValidationError) GetInstancePath() string { - if o == nil || IsNil(o.InstancePath) { - var ret string - return ret - } - return *o.InstancePath -} - -// GetInstancePathOk returns a tuple with the InstancePath field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ValidationError) GetInstancePathOk() (*string, bool) { - if o == nil || IsNil(o.InstancePath) { - return nil, false - } - return o.InstancePath, true -} - -// HasInstancePath returns a boolean if a field has been set. -func (o *ValidationError) HasInstancePath() bool { - if o != nil && !IsNil(o.InstancePath) { - return true - } - - return false -} - -// SetInstancePath gets a reference to the given string and assigns it to the InstancePath field. -func (o *ValidationError) SetInstancePath(v string) { - o.InstancePath = &v -} - -// GetSchemaPath returns the SchemaPath field value if set, zero value otherwise. -func (o *ValidationError) GetSchemaPath() string { - if o == nil || IsNil(o.SchemaPath) { - var ret string - return ret - } - return *o.SchemaPath -} - -// GetSchemaPathOk returns a tuple with the SchemaPath field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ValidationError) GetSchemaPathOk() (*string, bool) { - if o == nil || IsNil(o.SchemaPath) { - return nil, false - } - return o.SchemaPath, true -} - -// HasSchemaPath returns a boolean if a field has been set. -func (o *ValidationError) HasSchemaPath() bool { - if o != nil && !IsNil(o.SchemaPath) { - return true - } - - return false -} - -// SetSchemaPath gets a reference to the given string and assigns it to the SchemaPath field. -func (o *ValidationError) SetSchemaPath(v string) { - o.SchemaPath = &v -} - -// GetKeyword returns the Keyword field value if set, zero value otherwise. -func (o *ValidationError) GetKeyword() string { - if o == nil || IsNil(o.Keyword) { - var ret string - return ret - } - return *o.Keyword -} - -// GetKeywordOk returns a tuple with the Keyword field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ValidationError) GetKeywordOk() (*string, bool) { - if o == nil || IsNil(o.Keyword) { - return nil, false - } - return o.Keyword, true -} - -// HasKeyword returns a boolean if a field has been set. -func (o *ValidationError) HasKeyword() bool { - if o != nil && !IsNil(o.Keyword) { - return true - } - - return false -} - -// SetKeyword gets a reference to the given string and assigns it to the Keyword field. -func (o *ValidationError) SetKeyword(v string) { - o.Keyword = &v -} - -// GetMessage returns the Message field value if set, zero value otherwise. -func (o *ValidationError) GetMessage() string { - if o == nil || IsNil(o.Message) { - var ret string - return ret - } - return *o.Message -} - -// GetMessageOk returns a tuple with the Message field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ValidationError) GetMessageOk() (*string, bool) { - if o == nil || IsNil(o.Message) { - return nil, false - } - return o.Message, true -} - -// HasMessage returns a boolean if a field has been set. -func (o *ValidationError) HasMessage() bool { - if o != nil && !IsNil(o.Message) { - return true - } - - return false -} - -// SetMessage gets a reference to the given string and assigns it to the Message field. -func (o *ValidationError) SetMessage(v string) { - o.Message = &v -} - -// GetParams returns the Params field value if set, zero value otherwise. -func (o *ValidationError) GetParams() map[string]interface{} { - if o == nil || IsNil(o.Params) { - var ret map[string]interface{} - return ret - } - return o.Params -} - -// GetParamsOk returns a tuple with the Params field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ValidationError) GetParamsOk() (map[string]interface{}, bool) { - if o == nil || IsNil(o.Params) { - return map[string]interface{}{}, false - } - return o.Params, true -} - -// HasParams returns a boolean if a field has been set. -func (o *ValidationError) HasParams() bool { - if o != nil && !IsNil(o.Params) { - return true - } - - return false -} - -// SetParams gets a reference to the given map[string]interface{} and assigns it to the Params field. -func (o *ValidationError) SetParams(v map[string]interface{}) { - o.Params = v -} - -func (o ValidationError) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o ValidationError) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if !IsNil(o.InstancePath) { - toSerialize["instancePath"] = o.InstancePath - } - if !IsNil(o.SchemaPath) { - toSerialize["schemaPath"] = o.SchemaPath - } - if !IsNil(o.Keyword) { - toSerialize["keyword"] = o.Keyword - } - if !IsNil(o.Message) { - toSerialize["message"] = o.Message - } - if !IsNil(o.Params) { - toSerialize["params"] = o.Params - } - return toSerialize, nil -} - -type NullableValidationError struct { - value *ValidationError - isSet bool -} - -func (v NullableValidationError) Get() *ValidationError { - return v.value -} - -func (v *NullableValidationError) Set(val *ValidationError) { - v.value = val - v.isSet = true -} - -func (v NullableValidationError) IsSet() bool { - return v.isSet -} - -func (v *NullableValidationError) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableValidationError(val *ValidationError) *NullableValidationError { - return &NullableValidationError{value: val, isSet: true} -} - -func (v NullableValidationError) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableValidationError) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_version.go b/model_version.go deleted file mode 100644 index 7ccd5f9..0000000 --- a/model_version.go +++ /dev/null @@ -1,485 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" - "bytes" - "fmt" -) - -// checks if the Version type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &Version{} - -// Version struct for Version -type Version struct { - VersionNumber string `json:"versionNumber" validate:"regexp=^([0-9]|[1-9][0-9])\\\\.([0-9]|[1-9][0-9])$"` - SourceType NullableVersionSourceType `json:"sourceType"` - // - EnvVars []EnvVar `json:"envVars,omitempty"` - ApplyEnvVarsToBuild NullableBool `json:"applyEnvVarsToBuild,omitempty"` - BuildTag *string `json:"buildTag,omitempty"` - SourceFiles []VersionSourceFilesInner `json:"sourceFiles,omitempty"` - // URL of the Git repository when sourceType is GIT_REPO. - GitRepoUrl NullableString `json:"gitRepoUrl,omitempty"` - // URL of the tarball when sourceType is TARBALL. - TarballUrl NullableString `json:"tarballUrl,omitempty"` - // URL of the GitHub Gist when sourceType is GITHUB_GIST. - GitHubGistUrl NullableString `json:"gitHubGistUrl,omitempty"` -} - -type _Version Version - -// NewVersion instantiates a new Version object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewVersion(versionNumber string, sourceType NullableVersionSourceType) *Version { - this := Version{} - this.VersionNumber = versionNumber - this.SourceType = sourceType - return &this -} - -// NewVersionWithDefaults instantiates a new Version object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewVersionWithDefaults() *Version { - this := Version{} - return &this -} - -// GetVersionNumber returns the VersionNumber field value -func (o *Version) GetVersionNumber() string { - if o == nil { - var ret string - return ret - } - - return o.VersionNumber -} - -// GetVersionNumberOk returns a tuple with the VersionNumber field value -// and a boolean to check if the value has been set. -func (o *Version) GetVersionNumberOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.VersionNumber, true -} - -// SetVersionNumber sets field value -func (o *Version) SetVersionNumber(v string) { - o.VersionNumber = v -} - -// GetSourceType returns the SourceType field value -// If the value is explicit nil, the zero value for VersionSourceType will be returned -func (o *Version) GetSourceType() VersionSourceType { - if o == nil || o.SourceType.Get() == nil { - var ret VersionSourceType - return ret - } - - return *o.SourceType.Get() -} - -// GetSourceTypeOk returns a tuple with the SourceType field value -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *Version) GetSourceTypeOk() (*VersionSourceType, bool) { - if o == nil { - return nil, false - } - return o.SourceType.Get(), o.SourceType.IsSet() -} - -// SetSourceType sets field value -func (o *Version) SetSourceType(v VersionSourceType) { - o.SourceType.Set(&v) -} - -// GetEnvVars returns the EnvVars field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *Version) GetEnvVars() []EnvVar { - if o == nil { - var ret []EnvVar - return ret - } - return o.EnvVars -} - -// GetEnvVarsOk returns a tuple with the EnvVars field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *Version) GetEnvVarsOk() ([]EnvVar, bool) { - if o == nil || IsNil(o.EnvVars) { - return nil, false - } - return o.EnvVars, true -} - -// HasEnvVars returns a boolean if a field has been set. -func (o *Version) HasEnvVars() bool { - if o != nil && !IsNil(o.EnvVars) { - return true - } - - return false -} - -// SetEnvVars gets a reference to the given []EnvVar and assigns it to the EnvVars field. -func (o *Version) SetEnvVars(v []EnvVar) { - o.EnvVars = v -} - -// GetApplyEnvVarsToBuild returns the ApplyEnvVarsToBuild field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *Version) GetApplyEnvVarsToBuild() bool { - if o == nil || IsNil(o.ApplyEnvVarsToBuild.Get()) { - var ret bool - return ret - } - return *o.ApplyEnvVarsToBuild.Get() -} - -// GetApplyEnvVarsToBuildOk returns a tuple with the ApplyEnvVarsToBuild field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *Version) GetApplyEnvVarsToBuildOk() (*bool, bool) { - if o == nil { - return nil, false - } - return o.ApplyEnvVarsToBuild.Get(), o.ApplyEnvVarsToBuild.IsSet() -} - -// HasApplyEnvVarsToBuild returns a boolean if a field has been set. -func (o *Version) HasApplyEnvVarsToBuild() bool { - if o != nil && o.ApplyEnvVarsToBuild.IsSet() { - return true - } - - return false -} - -// SetApplyEnvVarsToBuild gets a reference to the given NullableBool and assigns it to the ApplyEnvVarsToBuild field. -func (o *Version) SetApplyEnvVarsToBuild(v bool) { - o.ApplyEnvVarsToBuild.Set(&v) -} -// SetApplyEnvVarsToBuildNil sets the value for ApplyEnvVarsToBuild to be an explicit nil -func (o *Version) SetApplyEnvVarsToBuildNil() { - o.ApplyEnvVarsToBuild.Set(nil) -} - -// UnsetApplyEnvVarsToBuild ensures that no value is present for ApplyEnvVarsToBuild, not even an explicit nil -func (o *Version) UnsetApplyEnvVarsToBuild() { - o.ApplyEnvVarsToBuild.Unset() -} - -// GetBuildTag returns the BuildTag field value if set, zero value otherwise. -func (o *Version) GetBuildTag() string { - if o == nil || IsNil(o.BuildTag) { - var ret string - return ret - } - return *o.BuildTag -} - -// GetBuildTagOk returns a tuple with the BuildTag field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Version) GetBuildTagOk() (*string, bool) { - if o == nil || IsNil(o.BuildTag) { - return nil, false - } - return o.BuildTag, true -} - -// HasBuildTag returns a boolean if a field has been set. -func (o *Version) HasBuildTag() bool { - if o != nil && !IsNil(o.BuildTag) { - return true - } - - return false -} - -// SetBuildTag gets a reference to the given string and assigns it to the BuildTag field. -func (o *Version) SetBuildTag(v string) { - o.BuildTag = &v -} - -// GetSourceFiles returns the SourceFiles field value if set, zero value otherwise. -func (o *Version) GetSourceFiles() []VersionSourceFilesInner { - if o == nil || IsNil(o.SourceFiles) { - var ret []VersionSourceFilesInner - return ret - } - return o.SourceFiles -} - -// GetSourceFilesOk returns a tuple with the SourceFiles field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Version) GetSourceFilesOk() ([]VersionSourceFilesInner, bool) { - if o == nil || IsNil(o.SourceFiles) { - return nil, false - } - return o.SourceFiles, true -} - -// HasSourceFiles returns a boolean if a field has been set. -func (o *Version) HasSourceFiles() bool { - if o != nil && !IsNil(o.SourceFiles) { - return true - } - - return false -} - -// SetSourceFiles gets a reference to the given []VersionSourceFilesInner and assigns it to the SourceFiles field. -func (o *Version) SetSourceFiles(v []VersionSourceFilesInner) { - o.SourceFiles = v -} - -// GetGitRepoUrl returns the GitRepoUrl field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *Version) GetGitRepoUrl() string { - if o == nil || IsNil(o.GitRepoUrl.Get()) { - var ret string - return ret - } - return *o.GitRepoUrl.Get() -} - -// GetGitRepoUrlOk returns a tuple with the GitRepoUrl field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *Version) GetGitRepoUrlOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.GitRepoUrl.Get(), o.GitRepoUrl.IsSet() -} - -// HasGitRepoUrl returns a boolean if a field has been set. -func (o *Version) HasGitRepoUrl() bool { - if o != nil && o.GitRepoUrl.IsSet() { - return true - } - - return false -} - -// SetGitRepoUrl gets a reference to the given NullableString and assigns it to the GitRepoUrl field. -func (o *Version) SetGitRepoUrl(v string) { - o.GitRepoUrl.Set(&v) -} -// SetGitRepoUrlNil sets the value for GitRepoUrl to be an explicit nil -func (o *Version) SetGitRepoUrlNil() { - o.GitRepoUrl.Set(nil) -} - -// UnsetGitRepoUrl ensures that no value is present for GitRepoUrl, not even an explicit nil -func (o *Version) UnsetGitRepoUrl() { - o.GitRepoUrl.Unset() -} - -// GetTarballUrl returns the TarballUrl field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *Version) GetTarballUrl() string { - if o == nil || IsNil(o.TarballUrl.Get()) { - var ret string - return ret - } - return *o.TarballUrl.Get() -} - -// GetTarballUrlOk returns a tuple with the TarballUrl field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *Version) GetTarballUrlOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.TarballUrl.Get(), o.TarballUrl.IsSet() -} - -// HasTarballUrl returns a boolean if a field has been set. -func (o *Version) HasTarballUrl() bool { - if o != nil && o.TarballUrl.IsSet() { - return true - } - - return false -} - -// SetTarballUrl gets a reference to the given NullableString and assigns it to the TarballUrl field. -func (o *Version) SetTarballUrl(v string) { - o.TarballUrl.Set(&v) -} -// SetTarballUrlNil sets the value for TarballUrl to be an explicit nil -func (o *Version) SetTarballUrlNil() { - o.TarballUrl.Set(nil) -} - -// UnsetTarballUrl ensures that no value is present for TarballUrl, not even an explicit nil -func (o *Version) UnsetTarballUrl() { - o.TarballUrl.Unset() -} - -// GetGitHubGistUrl returns the GitHubGistUrl field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *Version) GetGitHubGistUrl() string { - if o == nil || IsNil(o.GitHubGistUrl.Get()) { - var ret string - return ret - } - return *o.GitHubGistUrl.Get() -} - -// GetGitHubGistUrlOk returns a tuple with the GitHubGistUrl field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *Version) GetGitHubGistUrlOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.GitHubGistUrl.Get(), o.GitHubGistUrl.IsSet() -} - -// HasGitHubGistUrl returns a boolean if a field has been set. -func (o *Version) HasGitHubGistUrl() bool { - if o != nil && o.GitHubGistUrl.IsSet() { - return true - } - - return false -} - -// SetGitHubGistUrl gets a reference to the given NullableString and assigns it to the GitHubGistUrl field. -func (o *Version) SetGitHubGistUrl(v string) { - o.GitHubGistUrl.Set(&v) -} -// SetGitHubGistUrlNil sets the value for GitHubGistUrl to be an explicit nil -func (o *Version) SetGitHubGistUrlNil() { - o.GitHubGistUrl.Set(nil) -} - -// UnsetGitHubGistUrl ensures that no value is present for GitHubGistUrl, not even an explicit nil -func (o *Version) UnsetGitHubGistUrl() { - o.GitHubGistUrl.Unset() -} - -func (o Version) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o Version) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["versionNumber"] = o.VersionNumber - toSerialize["sourceType"] = o.SourceType.Get() - if o.EnvVars != nil { - toSerialize["envVars"] = o.EnvVars - } - if o.ApplyEnvVarsToBuild.IsSet() { - toSerialize["applyEnvVarsToBuild"] = o.ApplyEnvVarsToBuild.Get() - } - if !IsNil(o.BuildTag) { - toSerialize["buildTag"] = o.BuildTag - } - if !IsNil(o.SourceFiles) { - toSerialize["sourceFiles"] = o.SourceFiles - } - if o.GitRepoUrl.IsSet() { - toSerialize["gitRepoUrl"] = o.GitRepoUrl.Get() - } - if o.TarballUrl.IsSet() { - toSerialize["tarballUrl"] = o.TarballUrl.Get() - } - if o.GitHubGistUrl.IsSet() { - toSerialize["gitHubGistUrl"] = o.GitHubGistUrl.Get() - } - return toSerialize, nil -} - -func (o *Version) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "versionNumber", - "sourceType", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err; - } - - for _, requiredProperty := range(requiredProperties) { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varVersion := _Version{} - - decoder := json.NewDecoder(bytes.NewReader(data)) - decoder.DisallowUnknownFields() - err = decoder.Decode(&varVersion) - - if err != nil { - return err - } - - *o = Version(varVersion) - - return err -} - -type NullableVersion struct { - value *Version - isSet bool -} - -func (v NullableVersion) Get() *Version { - return v.value -} - -func (v *NullableVersion) Set(val *Version) { - v.value = val - v.isSet = true -} - -func (v NullableVersion) IsSet() bool { - return v.isSet -} - -func (v *NullableVersion) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableVersion(val *Version) *NullableVersion { - return &NullableVersion{value: val, isSet: true} -} - -func (v NullableVersion) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableVersion) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_version_response.go b/model_version_response.go deleted file mode 100644 index 12cb4ae..0000000 --- a/model_version_response.go +++ /dev/null @@ -1,158 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" - "bytes" - "fmt" -) - -// checks if the VersionResponse type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &VersionResponse{} - -// VersionResponse struct for VersionResponse -type VersionResponse struct { - Data Version `json:"data"` -} - -type _VersionResponse VersionResponse - -// NewVersionResponse instantiates a new VersionResponse object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewVersionResponse(data Version) *VersionResponse { - this := VersionResponse{} - this.Data = data - return &this -} - -// NewVersionResponseWithDefaults instantiates a new VersionResponse object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewVersionResponseWithDefaults() *VersionResponse { - this := VersionResponse{} - return &this -} - -// GetData returns the Data field value -func (o *VersionResponse) GetData() Version { - if o == nil { - var ret Version - return ret - } - - return o.Data -} - -// GetDataOk returns a tuple with the Data field value -// and a boolean to check if the value has been set. -func (o *VersionResponse) GetDataOk() (*Version, bool) { - if o == nil { - return nil, false - } - return &o.Data, true -} - -// SetData sets field value -func (o *VersionResponse) SetData(v Version) { - o.Data = v -} - -func (o VersionResponse) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o VersionResponse) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["data"] = o.Data - return toSerialize, nil -} - -func (o *VersionResponse) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "data", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err; - } - - for _, requiredProperty := range(requiredProperties) { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varVersionResponse := _VersionResponse{} - - decoder := json.NewDecoder(bytes.NewReader(data)) - decoder.DisallowUnknownFields() - err = decoder.Decode(&varVersionResponse) - - if err != nil { - return err - } - - *o = VersionResponse(varVersionResponse) - - return err -} - -type NullableVersionResponse struct { - value *VersionResponse - isSet bool -} - -func (v NullableVersionResponse) Get() *VersionResponse { - return v.value -} - -func (v *NullableVersionResponse) Set(val *VersionResponse) { - v.value = val - v.isSet = true -} - -func (v NullableVersionResponse) IsSet() bool { - return v.isSet -} - -func (v *NullableVersionResponse) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableVersionResponse(val *VersionResponse) *NullableVersionResponse { - return &NullableVersionResponse{value: val, isSet: true} -} - -func (v NullableVersionResponse) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableVersionResponse) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_version_source_files_inner.go b/model_version_source_files_inner.go deleted file mode 100644 index 1db6552..0000000 --- a/model_version_source_files_inner.go +++ /dev/null @@ -1,107 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" - "fmt" -) - - -// VersionSourceFilesInner struct for VersionSourceFilesInner -type VersionSourceFilesInner struct { - SourceCodeFile *SourceCodeFile - SourceCodeFolder *SourceCodeFolder -} - -// Unmarshal JSON data into any of the pointers in the struct -func (dst *VersionSourceFilesInner) UnmarshalJSON(data []byte) error { - var err error - // try to unmarshal JSON data into SourceCodeFile - err = json.Unmarshal(data, &dst.SourceCodeFile); - if err == nil { - jsonSourceCodeFile, _ := json.Marshal(dst.SourceCodeFile) - if string(jsonSourceCodeFile) == "{}" { // empty struct - dst.SourceCodeFile = nil - } else { - return nil // data stored in dst.SourceCodeFile, return on the first match - } - } else { - dst.SourceCodeFile = nil - } - - // try to unmarshal JSON data into SourceCodeFolder - err = json.Unmarshal(data, &dst.SourceCodeFolder); - if err == nil { - jsonSourceCodeFolder, _ := json.Marshal(dst.SourceCodeFolder) - if string(jsonSourceCodeFolder) == "{}" { // empty struct - dst.SourceCodeFolder = nil - } else { - return nil // data stored in dst.SourceCodeFolder, return on the first match - } - } else { - dst.SourceCodeFolder = nil - } - - return fmt.Errorf("data failed to match schemas in anyOf(VersionSourceFilesInner)") -} - -// Marshal data from the first non-nil pointers in the struct to JSON -func (src VersionSourceFilesInner) MarshalJSON() ([]byte, error) { - if src.SourceCodeFile != nil { - return json.Marshal(&src.SourceCodeFile) - } - - if src.SourceCodeFolder != nil { - return json.Marshal(&src.SourceCodeFolder) - } - - return nil, nil // no data in anyOf schemas -} - - -type NullableVersionSourceFilesInner struct { - value *VersionSourceFilesInner - isSet bool -} - -func (v NullableVersionSourceFilesInner) Get() *VersionSourceFilesInner { - return v.value -} - -func (v *NullableVersionSourceFilesInner) Set(val *VersionSourceFilesInner) { - v.value = val - v.isSet = true -} - -func (v NullableVersionSourceFilesInner) IsSet() bool { - return v.isSet -} - -func (v *NullableVersionSourceFilesInner) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableVersionSourceFilesInner(val *VersionSourceFilesInner) *NullableVersionSourceFilesInner { - return &NullableVersionSourceFilesInner{value: val, isSet: true} -} - -func (v NullableVersionSourceFilesInner) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableVersionSourceFilesInner) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_version_source_type.go b/model_version_source_type.go deleted file mode 100644 index 2c64a20..0000000 --- a/model_version_source_type.go +++ /dev/null @@ -1,117 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" - "fmt" -) - -// VersionSourceType the model 'VersionSourceType' -type VersionSourceType string - -// List of VersionSourceType -const ( - SOURCE_FILES VersionSourceType = "SOURCE_FILES" - GIT_REPO VersionSourceType = "GIT_REPO" - TARBALL VersionSourceType = "TARBALL" - GITHUB_GIST VersionSourceType = "GITHUB_GIST" - SOURCE_CODE VersionSourceType = "SOURCE_CODE" -) - -// All allowed values of VersionSourceType enum -var AllowedVersionSourceTypeEnumValues = []VersionSourceType{ - "SOURCE_FILES", - "GIT_REPO", - "TARBALL", - "GITHUB_GIST", - "SOURCE_CODE", -} - -func (v *VersionSourceType) UnmarshalJSON(src []byte) error { - var value string - err := json.Unmarshal(src, &value) - if err != nil { - return err - } - enumTypeValue := VersionSourceType(value) - for _, existing := range AllowedVersionSourceTypeEnumValues { - if existing == enumTypeValue { - *v = enumTypeValue - return nil - } - } - - return fmt.Errorf("%+v is not a valid VersionSourceType", value) -} - -// NewVersionSourceTypeFromValue returns a pointer to a valid VersionSourceType -// for the value passed as argument, or an error if the value passed is not allowed by the enum -func NewVersionSourceTypeFromValue(v string) (*VersionSourceType, error) { - ev := VersionSourceType(v) - if ev.IsValid() { - return &ev, nil - } else { - return nil, fmt.Errorf("invalid value '%v' for VersionSourceType: valid values are %v", v, AllowedVersionSourceTypeEnumValues) - } -} - -// IsValid return true if the value is valid for the enum, false otherwise -func (v VersionSourceType) IsValid() bool { - for _, existing := range AllowedVersionSourceTypeEnumValues { - if existing == v { - return true - } - } - return false -} - -// Ptr returns reference to VersionSourceType value -func (v VersionSourceType) Ptr() *VersionSourceType { - return &v -} - -type NullableVersionSourceType struct { - value *VersionSourceType - isSet bool -} - -func (v NullableVersionSourceType) Get() *VersionSourceType { - return v.value -} - -func (v *NullableVersionSourceType) Set(val *VersionSourceType) { - v.value = val - v.isSet = true -} - -func (v NullableVersionSourceType) IsSet() bool { - return v.isSet -} - -func (v *NullableVersionSourceType) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableVersionSourceType(val *VersionSourceType) *NullableVersionSourceType { - return &NullableVersionSourceType{value: val, isSet: true} -} - -func (v NullableVersionSourceType) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableVersionSourceType) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - diff --git a/model_webhook.go b/model_webhook.go deleted file mode 100644 index 4cd1adf..0000000 --- a/model_webhook.go +++ /dev/null @@ -1,723 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" - "time" - "bytes" - "fmt" -) - -// checks if the Webhook type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &Webhook{} - -// Webhook struct for Webhook -type Webhook struct { - Id string `json:"id"` - CreatedAt time.Time `json:"createdAt"` - ModifiedAt time.Time `json:"modifiedAt"` - UserId string `json:"userId"` - IsAdHoc NullableBool `json:"isAdHoc,omitempty"` - ShouldInterpolateStrings NullableBool `json:"shouldInterpolateStrings,omitempty"` - EventTypes []WebhookEventType `json:"eventTypes"` - Condition WebhookCondition `json:"condition"` - IgnoreSslErrors bool `json:"ignoreSslErrors"` - DoNotRetry NullableBool `json:"doNotRetry,omitempty"` - RequestUrl string `json:"requestUrl"` - PayloadTemplate NullableString `json:"payloadTemplate,omitempty"` - HeadersTemplate NullableString `json:"headersTemplate,omitempty"` - Description NullableString `json:"description,omitempty"` - LastDispatch NullableExampleWebhookDispatch `json:"lastDispatch,omitempty"` - Stats NullableWebhookStats `json:"stats,omitempty"` -} - -type _Webhook Webhook - -// NewWebhook instantiates a new Webhook object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewWebhook(id string, createdAt time.Time, modifiedAt time.Time, userId string, eventTypes []WebhookEventType, condition WebhookCondition, ignoreSslErrors bool, requestUrl string) *Webhook { - this := Webhook{} - this.Id = id - this.CreatedAt = createdAt - this.ModifiedAt = modifiedAt - this.UserId = userId - this.EventTypes = eventTypes - this.Condition = condition - this.IgnoreSslErrors = ignoreSslErrors - this.RequestUrl = requestUrl - return &this -} - -// NewWebhookWithDefaults instantiates a new Webhook object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewWebhookWithDefaults() *Webhook { - this := Webhook{} - return &this -} - -// GetId returns the Id field value -func (o *Webhook) GetId() string { - if o == nil { - var ret string - return ret - } - - return o.Id -} - -// GetIdOk returns a tuple with the Id field value -// and a boolean to check if the value has been set. -func (o *Webhook) GetIdOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Id, true -} - -// SetId sets field value -func (o *Webhook) SetId(v string) { - o.Id = v -} - -// GetCreatedAt returns the CreatedAt field value -func (o *Webhook) GetCreatedAt() time.Time { - if o == nil { - var ret time.Time - return ret - } - - return o.CreatedAt -} - -// GetCreatedAtOk returns a tuple with the CreatedAt field value -// and a boolean to check if the value has been set. -func (o *Webhook) GetCreatedAtOk() (*time.Time, bool) { - if o == nil { - return nil, false - } - return &o.CreatedAt, true -} - -// SetCreatedAt sets field value -func (o *Webhook) SetCreatedAt(v time.Time) { - o.CreatedAt = v -} - -// GetModifiedAt returns the ModifiedAt field value -func (o *Webhook) GetModifiedAt() time.Time { - if o == nil { - var ret time.Time - return ret - } - - return o.ModifiedAt -} - -// GetModifiedAtOk returns a tuple with the ModifiedAt field value -// and a boolean to check if the value has been set. -func (o *Webhook) GetModifiedAtOk() (*time.Time, bool) { - if o == nil { - return nil, false - } - return &o.ModifiedAt, true -} - -// SetModifiedAt sets field value -func (o *Webhook) SetModifiedAt(v time.Time) { - o.ModifiedAt = v -} - -// GetUserId returns the UserId field value -func (o *Webhook) GetUserId() string { - if o == nil { - var ret string - return ret - } - - return o.UserId -} - -// GetUserIdOk returns a tuple with the UserId field value -// and a boolean to check if the value has been set. -func (o *Webhook) GetUserIdOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.UserId, true -} - -// SetUserId sets field value -func (o *Webhook) SetUserId(v string) { - o.UserId = v -} - -// GetIsAdHoc returns the IsAdHoc field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *Webhook) GetIsAdHoc() bool { - if o == nil || IsNil(o.IsAdHoc.Get()) { - var ret bool - return ret - } - return *o.IsAdHoc.Get() -} - -// GetIsAdHocOk returns a tuple with the IsAdHoc field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *Webhook) GetIsAdHocOk() (*bool, bool) { - if o == nil { - return nil, false - } - return o.IsAdHoc.Get(), o.IsAdHoc.IsSet() -} - -// HasIsAdHoc returns a boolean if a field has been set. -func (o *Webhook) HasIsAdHoc() bool { - if o != nil && o.IsAdHoc.IsSet() { - return true - } - - return false -} - -// SetIsAdHoc gets a reference to the given NullableBool and assigns it to the IsAdHoc field. -func (o *Webhook) SetIsAdHoc(v bool) { - o.IsAdHoc.Set(&v) -} -// SetIsAdHocNil sets the value for IsAdHoc to be an explicit nil -func (o *Webhook) SetIsAdHocNil() { - o.IsAdHoc.Set(nil) -} - -// UnsetIsAdHoc ensures that no value is present for IsAdHoc, not even an explicit nil -func (o *Webhook) UnsetIsAdHoc() { - o.IsAdHoc.Unset() -} - -// GetShouldInterpolateStrings returns the ShouldInterpolateStrings field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *Webhook) GetShouldInterpolateStrings() bool { - if o == nil || IsNil(o.ShouldInterpolateStrings.Get()) { - var ret bool - return ret - } - return *o.ShouldInterpolateStrings.Get() -} - -// GetShouldInterpolateStringsOk returns a tuple with the ShouldInterpolateStrings field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *Webhook) GetShouldInterpolateStringsOk() (*bool, bool) { - if o == nil { - return nil, false - } - return o.ShouldInterpolateStrings.Get(), o.ShouldInterpolateStrings.IsSet() -} - -// HasShouldInterpolateStrings returns a boolean if a field has been set. -func (o *Webhook) HasShouldInterpolateStrings() bool { - if o != nil && o.ShouldInterpolateStrings.IsSet() { - return true - } - - return false -} - -// SetShouldInterpolateStrings gets a reference to the given NullableBool and assigns it to the ShouldInterpolateStrings field. -func (o *Webhook) SetShouldInterpolateStrings(v bool) { - o.ShouldInterpolateStrings.Set(&v) -} -// SetShouldInterpolateStringsNil sets the value for ShouldInterpolateStrings to be an explicit nil -func (o *Webhook) SetShouldInterpolateStringsNil() { - o.ShouldInterpolateStrings.Set(nil) -} - -// UnsetShouldInterpolateStrings ensures that no value is present for ShouldInterpolateStrings, not even an explicit nil -func (o *Webhook) UnsetShouldInterpolateStrings() { - o.ShouldInterpolateStrings.Unset() -} - -// GetEventTypes returns the EventTypes field value -func (o *Webhook) GetEventTypes() []WebhookEventType { - if o == nil { - var ret []WebhookEventType - return ret - } - - return o.EventTypes -} - -// GetEventTypesOk returns a tuple with the EventTypes field value -// and a boolean to check if the value has been set. -func (o *Webhook) GetEventTypesOk() ([]WebhookEventType, bool) { - if o == nil { - return nil, false - } - return o.EventTypes, true -} - -// SetEventTypes sets field value -func (o *Webhook) SetEventTypes(v []WebhookEventType) { - o.EventTypes = v -} - -// GetCondition returns the Condition field value -func (o *Webhook) GetCondition() WebhookCondition { - if o == nil { - var ret WebhookCondition - return ret - } - - return o.Condition -} - -// GetConditionOk returns a tuple with the Condition field value -// and a boolean to check if the value has been set. -func (o *Webhook) GetConditionOk() (*WebhookCondition, bool) { - if o == nil { - return nil, false - } - return &o.Condition, true -} - -// SetCondition sets field value -func (o *Webhook) SetCondition(v WebhookCondition) { - o.Condition = v -} - -// GetIgnoreSslErrors returns the IgnoreSslErrors field value -func (o *Webhook) GetIgnoreSslErrors() bool { - if o == nil { - var ret bool - return ret - } - - return o.IgnoreSslErrors -} - -// GetIgnoreSslErrorsOk returns a tuple with the IgnoreSslErrors field value -// and a boolean to check if the value has been set. -func (o *Webhook) GetIgnoreSslErrorsOk() (*bool, bool) { - if o == nil { - return nil, false - } - return &o.IgnoreSslErrors, true -} - -// SetIgnoreSslErrors sets field value -func (o *Webhook) SetIgnoreSslErrors(v bool) { - o.IgnoreSslErrors = v -} - -// GetDoNotRetry returns the DoNotRetry field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *Webhook) GetDoNotRetry() bool { - if o == nil || IsNil(o.DoNotRetry.Get()) { - var ret bool - return ret - } - return *o.DoNotRetry.Get() -} - -// GetDoNotRetryOk returns a tuple with the DoNotRetry field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *Webhook) GetDoNotRetryOk() (*bool, bool) { - if o == nil { - return nil, false - } - return o.DoNotRetry.Get(), o.DoNotRetry.IsSet() -} - -// HasDoNotRetry returns a boolean if a field has been set. -func (o *Webhook) HasDoNotRetry() bool { - if o != nil && o.DoNotRetry.IsSet() { - return true - } - - return false -} - -// SetDoNotRetry gets a reference to the given NullableBool and assigns it to the DoNotRetry field. -func (o *Webhook) SetDoNotRetry(v bool) { - o.DoNotRetry.Set(&v) -} -// SetDoNotRetryNil sets the value for DoNotRetry to be an explicit nil -func (o *Webhook) SetDoNotRetryNil() { - o.DoNotRetry.Set(nil) -} - -// UnsetDoNotRetry ensures that no value is present for DoNotRetry, not even an explicit nil -func (o *Webhook) UnsetDoNotRetry() { - o.DoNotRetry.Unset() -} - -// GetRequestUrl returns the RequestUrl field value -func (o *Webhook) GetRequestUrl() string { - if o == nil { - var ret string - return ret - } - - return o.RequestUrl -} - -// GetRequestUrlOk returns a tuple with the RequestUrl field value -// and a boolean to check if the value has been set. -func (o *Webhook) GetRequestUrlOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.RequestUrl, true -} - -// SetRequestUrl sets field value -func (o *Webhook) SetRequestUrl(v string) { - o.RequestUrl = v -} - -// GetPayloadTemplate returns the PayloadTemplate field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *Webhook) GetPayloadTemplate() string { - if o == nil || IsNil(o.PayloadTemplate.Get()) { - var ret string - return ret - } - return *o.PayloadTemplate.Get() -} - -// GetPayloadTemplateOk returns a tuple with the PayloadTemplate field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *Webhook) GetPayloadTemplateOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.PayloadTemplate.Get(), o.PayloadTemplate.IsSet() -} - -// HasPayloadTemplate returns a boolean if a field has been set. -func (o *Webhook) HasPayloadTemplate() bool { - if o != nil && o.PayloadTemplate.IsSet() { - return true - } - - return false -} - -// SetPayloadTemplate gets a reference to the given NullableString and assigns it to the PayloadTemplate field. -func (o *Webhook) SetPayloadTemplate(v string) { - o.PayloadTemplate.Set(&v) -} -// SetPayloadTemplateNil sets the value for PayloadTemplate to be an explicit nil -func (o *Webhook) SetPayloadTemplateNil() { - o.PayloadTemplate.Set(nil) -} - -// UnsetPayloadTemplate ensures that no value is present for PayloadTemplate, not even an explicit nil -func (o *Webhook) UnsetPayloadTemplate() { - o.PayloadTemplate.Unset() -} - -// GetHeadersTemplate returns the HeadersTemplate field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *Webhook) GetHeadersTemplate() string { - if o == nil || IsNil(o.HeadersTemplate.Get()) { - var ret string - return ret - } - return *o.HeadersTemplate.Get() -} - -// GetHeadersTemplateOk returns a tuple with the HeadersTemplate field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *Webhook) GetHeadersTemplateOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.HeadersTemplate.Get(), o.HeadersTemplate.IsSet() -} - -// HasHeadersTemplate returns a boolean if a field has been set. -func (o *Webhook) HasHeadersTemplate() bool { - if o != nil && o.HeadersTemplate.IsSet() { - return true - } - - return false -} - -// SetHeadersTemplate gets a reference to the given NullableString and assigns it to the HeadersTemplate field. -func (o *Webhook) SetHeadersTemplate(v string) { - o.HeadersTemplate.Set(&v) -} -// SetHeadersTemplateNil sets the value for HeadersTemplate to be an explicit nil -func (o *Webhook) SetHeadersTemplateNil() { - o.HeadersTemplate.Set(nil) -} - -// UnsetHeadersTemplate ensures that no value is present for HeadersTemplate, not even an explicit nil -func (o *Webhook) UnsetHeadersTemplate() { - o.HeadersTemplate.Unset() -} - -// GetDescription returns the Description field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *Webhook) GetDescription() string { - if o == nil || IsNil(o.Description.Get()) { - var ret string - return ret - } - return *o.Description.Get() -} - -// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *Webhook) GetDescriptionOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.Description.Get(), o.Description.IsSet() -} - -// HasDescription returns a boolean if a field has been set. -func (o *Webhook) HasDescription() bool { - if o != nil && o.Description.IsSet() { - return true - } - - return false -} - -// SetDescription gets a reference to the given NullableString and assigns it to the Description field. -func (o *Webhook) SetDescription(v string) { - o.Description.Set(&v) -} -// SetDescriptionNil sets the value for Description to be an explicit nil -func (o *Webhook) SetDescriptionNil() { - o.Description.Set(nil) -} - -// UnsetDescription ensures that no value is present for Description, not even an explicit nil -func (o *Webhook) UnsetDescription() { - o.Description.Unset() -} - -// GetLastDispatch returns the LastDispatch field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *Webhook) GetLastDispatch() ExampleWebhookDispatch { - if o == nil || IsNil(o.LastDispatch.Get()) { - var ret ExampleWebhookDispatch - return ret - } - return *o.LastDispatch.Get() -} - -// GetLastDispatchOk returns a tuple with the LastDispatch field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *Webhook) GetLastDispatchOk() (*ExampleWebhookDispatch, bool) { - if o == nil { - return nil, false - } - return o.LastDispatch.Get(), o.LastDispatch.IsSet() -} - -// HasLastDispatch returns a boolean if a field has been set. -func (o *Webhook) HasLastDispatch() bool { - if o != nil && o.LastDispatch.IsSet() { - return true - } - - return false -} - -// SetLastDispatch gets a reference to the given NullableExampleWebhookDispatch and assigns it to the LastDispatch field. -func (o *Webhook) SetLastDispatch(v ExampleWebhookDispatch) { - o.LastDispatch.Set(&v) -} -// SetLastDispatchNil sets the value for LastDispatch to be an explicit nil -func (o *Webhook) SetLastDispatchNil() { - o.LastDispatch.Set(nil) -} - -// UnsetLastDispatch ensures that no value is present for LastDispatch, not even an explicit nil -func (o *Webhook) UnsetLastDispatch() { - o.LastDispatch.Unset() -} - -// GetStats returns the Stats field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *Webhook) GetStats() WebhookStats { - if o == nil || IsNil(o.Stats.Get()) { - var ret WebhookStats - return ret - } - return *o.Stats.Get() -} - -// GetStatsOk returns a tuple with the Stats field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *Webhook) GetStatsOk() (*WebhookStats, bool) { - if o == nil { - return nil, false - } - return o.Stats.Get(), o.Stats.IsSet() -} - -// HasStats returns a boolean if a field has been set. -func (o *Webhook) HasStats() bool { - if o != nil && o.Stats.IsSet() { - return true - } - - return false -} - -// SetStats gets a reference to the given NullableWebhookStats and assigns it to the Stats field. -func (o *Webhook) SetStats(v WebhookStats) { - o.Stats.Set(&v) -} -// SetStatsNil sets the value for Stats to be an explicit nil -func (o *Webhook) SetStatsNil() { - o.Stats.Set(nil) -} - -// UnsetStats ensures that no value is present for Stats, not even an explicit nil -func (o *Webhook) UnsetStats() { - o.Stats.Unset() -} - -func (o Webhook) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o Webhook) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["id"] = o.Id - toSerialize["createdAt"] = o.CreatedAt - toSerialize["modifiedAt"] = o.ModifiedAt - toSerialize["userId"] = o.UserId - if o.IsAdHoc.IsSet() { - toSerialize["isAdHoc"] = o.IsAdHoc.Get() - } - if o.ShouldInterpolateStrings.IsSet() { - toSerialize["shouldInterpolateStrings"] = o.ShouldInterpolateStrings.Get() - } - toSerialize["eventTypes"] = o.EventTypes - toSerialize["condition"] = o.Condition - toSerialize["ignoreSslErrors"] = o.IgnoreSslErrors - if o.DoNotRetry.IsSet() { - toSerialize["doNotRetry"] = o.DoNotRetry.Get() - } - toSerialize["requestUrl"] = o.RequestUrl - if o.PayloadTemplate.IsSet() { - toSerialize["payloadTemplate"] = o.PayloadTemplate.Get() - } - if o.HeadersTemplate.IsSet() { - toSerialize["headersTemplate"] = o.HeadersTemplate.Get() - } - if o.Description.IsSet() { - toSerialize["description"] = o.Description.Get() - } - if o.LastDispatch.IsSet() { - toSerialize["lastDispatch"] = o.LastDispatch.Get() - } - if o.Stats.IsSet() { - toSerialize["stats"] = o.Stats.Get() - } - return toSerialize, nil -} - -func (o *Webhook) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "id", - "createdAt", - "modifiedAt", - "userId", - "eventTypes", - "condition", - "ignoreSslErrors", - "requestUrl", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err; - } - - for _, requiredProperty := range(requiredProperties) { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varWebhook := _Webhook{} - - decoder := json.NewDecoder(bytes.NewReader(data)) - decoder.DisallowUnknownFields() - err = decoder.Decode(&varWebhook) - - if err != nil { - return err - } - - *o = Webhook(varWebhook) - - return err -} - -type NullableWebhook struct { - value *Webhook - isSet bool -} - -func (v NullableWebhook) Get() *Webhook { - return v.value -} - -func (v *NullableWebhook) Set(val *Webhook) { - v.value = val - v.isSet = true -} - -func (v NullableWebhook) IsSet() bool { - return v.isSet -} - -func (v *NullableWebhook) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableWebhook(val *Webhook) *NullableWebhook { - return &NullableWebhook{value: val, isSet: true} -} - -func (v NullableWebhook) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableWebhook) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_webhook_condition.go b/model_webhook_condition.go deleted file mode 100644 index 5624de2..0000000 --- a/model_webhook_condition.go +++ /dev/null @@ -1,228 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" -) - -// checks if the WebhookCondition type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &WebhookCondition{} - -// WebhookCondition struct for WebhookCondition -type WebhookCondition struct { - ActorId NullableString `json:"actorId,omitempty"` - ActorTaskId NullableString `json:"actorTaskId,omitempty"` - ActorRunId NullableString `json:"actorRunId,omitempty"` -} - -// NewWebhookCondition instantiates a new WebhookCondition object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewWebhookCondition() *WebhookCondition { - this := WebhookCondition{} - return &this -} - -// NewWebhookConditionWithDefaults instantiates a new WebhookCondition object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewWebhookConditionWithDefaults() *WebhookCondition { - this := WebhookCondition{} - return &this -} - -// GetActorId returns the ActorId field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *WebhookCondition) GetActorId() string { - if o == nil || IsNil(o.ActorId.Get()) { - var ret string - return ret - } - return *o.ActorId.Get() -} - -// GetActorIdOk returns a tuple with the ActorId field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *WebhookCondition) GetActorIdOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.ActorId.Get(), o.ActorId.IsSet() -} - -// HasActorId returns a boolean if a field has been set. -func (o *WebhookCondition) HasActorId() bool { - if o != nil && o.ActorId.IsSet() { - return true - } - - return false -} - -// SetActorId gets a reference to the given NullableString and assigns it to the ActorId field. -func (o *WebhookCondition) SetActorId(v string) { - o.ActorId.Set(&v) -} -// SetActorIdNil sets the value for ActorId to be an explicit nil -func (o *WebhookCondition) SetActorIdNil() { - o.ActorId.Set(nil) -} - -// UnsetActorId ensures that no value is present for ActorId, not even an explicit nil -func (o *WebhookCondition) UnsetActorId() { - o.ActorId.Unset() -} - -// GetActorTaskId returns the ActorTaskId field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *WebhookCondition) GetActorTaskId() string { - if o == nil || IsNil(o.ActorTaskId.Get()) { - var ret string - return ret - } - return *o.ActorTaskId.Get() -} - -// GetActorTaskIdOk returns a tuple with the ActorTaskId field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *WebhookCondition) GetActorTaskIdOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.ActorTaskId.Get(), o.ActorTaskId.IsSet() -} - -// HasActorTaskId returns a boolean if a field has been set. -func (o *WebhookCondition) HasActorTaskId() bool { - if o != nil && o.ActorTaskId.IsSet() { - return true - } - - return false -} - -// SetActorTaskId gets a reference to the given NullableString and assigns it to the ActorTaskId field. -func (o *WebhookCondition) SetActorTaskId(v string) { - o.ActorTaskId.Set(&v) -} -// SetActorTaskIdNil sets the value for ActorTaskId to be an explicit nil -func (o *WebhookCondition) SetActorTaskIdNil() { - o.ActorTaskId.Set(nil) -} - -// UnsetActorTaskId ensures that no value is present for ActorTaskId, not even an explicit nil -func (o *WebhookCondition) UnsetActorTaskId() { - o.ActorTaskId.Unset() -} - -// GetActorRunId returns the ActorRunId field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *WebhookCondition) GetActorRunId() string { - if o == nil || IsNil(o.ActorRunId.Get()) { - var ret string - return ret - } - return *o.ActorRunId.Get() -} - -// GetActorRunIdOk returns a tuple with the ActorRunId field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *WebhookCondition) GetActorRunIdOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.ActorRunId.Get(), o.ActorRunId.IsSet() -} - -// HasActorRunId returns a boolean if a field has been set. -func (o *WebhookCondition) HasActorRunId() bool { - if o != nil && o.ActorRunId.IsSet() { - return true - } - - return false -} - -// SetActorRunId gets a reference to the given NullableString and assigns it to the ActorRunId field. -func (o *WebhookCondition) SetActorRunId(v string) { - o.ActorRunId.Set(&v) -} -// SetActorRunIdNil sets the value for ActorRunId to be an explicit nil -func (o *WebhookCondition) SetActorRunIdNil() { - o.ActorRunId.Set(nil) -} - -// UnsetActorRunId ensures that no value is present for ActorRunId, not even an explicit nil -func (o *WebhookCondition) UnsetActorRunId() { - o.ActorRunId.Unset() -} - -func (o WebhookCondition) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o WebhookCondition) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if o.ActorId.IsSet() { - toSerialize["actorId"] = o.ActorId.Get() - } - if o.ActorTaskId.IsSet() { - toSerialize["actorTaskId"] = o.ActorTaskId.Get() - } - if o.ActorRunId.IsSet() { - toSerialize["actorRunId"] = o.ActorRunId.Get() - } - return toSerialize, nil -} - -type NullableWebhookCondition struct { - value *WebhookCondition - isSet bool -} - -func (v NullableWebhookCondition) Get() *WebhookCondition { - return v.value -} - -func (v *NullableWebhookCondition) Set(val *WebhookCondition) { - v.value = val - v.isSet = true -} - -func (v NullableWebhookCondition) IsSet() bool { - return v.isSet -} - -func (v *NullableWebhookCondition) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableWebhookCondition(val *WebhookCondition) *NullableWebhookCondition { - return &NullableWebhookCondition{value: val, isSet: true} -} - -func (v NullableWebhookCondition) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableWebhookCondition) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_webhook_create.go b/model_webhook_create.go deleted file mode 100644 index c7563b4..0000000 --- a/model_webhook_create.go +++ /dev/null @@ -1,582 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" - "bytes" - "fmt" -) - -// checks if the WebhookCreate type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &WebhookCreate{} - -// WebhookCreate struct for WebhookCreate -type WebhookCreate struct { - IsAdHoc NullableBool `json:"isAdHoc,omitempty"` - EventTypes []WebhookEventType `json:"eventTypes"` - Condition WebhookCondition `json:"condition"` - IdempotencyKey NullableString `json:"idempotencyKey,omitempty"` - IgnoreSslErrors NullableBool `json:"ignoreSslErrors,omitempty"` - DoNotRetry NullableBool `json:"doNotRetry,omitempty"` - RequestUrl string `json:"requestUrl"` - PayloadTemplate NullableString `json:"payloadTemplate,omitempty"` - HeadersTemplate NullableString `json:"headersTemplate,omitempty"` - Description NullableString `json:"description,omitempty"` - ShouldInterpolateStrings NullableBool `json:"shouldInterpolateStrings,omitempty"` -} - -type _WebhookCreate WebhookCreate - -// NewWebhookCreate instantiates a new WebhookCreate object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewWebhookCreate(eventTypes []WebhookEventType, condition WebhookCondition, requestUrl string) *WebhookCreate { - this := WebhookCreate{} - this.EventTypes = eventTypes - this.Condition = condition - this.RequestUrl = requestUrl - return &this -} - -// NewWebhookCreateWithDefaults instantiates a new WebhookCreate object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewWebhookCreateWithDefaults() *WebhookCreate { - this := WebhookCreate{} - return &this -} - -// GetIsAdHoc returns the IsAdHoc field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *WebhookCreate) GetIsAdHoc() bool { - if o == nil || IsNil(o.IsAdHoc.Get()) { - var ret bool - return ret - } - return *o.IsAdHoc.Get() -} - -// GetIsAdHocOk returns a tuple with the IsAdHoc field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *WebhookCreate) GetIsAdHocOk() (*bool, bool) { - if o == nil { - return nil, false - } - return o.IsAdHoc.Get(), o.IsAdHoc.IsSet() -} - -// HasIsAdHoc returns a boolean if a field has been set. -func (o *WebhookCreate) HasIsAdHoc() bool { - if o != nil && o.IsAdHoc.IsSet() { - return true - } - - return false -} - -// SetIsAdHoc gets a reference to the given NullableBool and assigns it to the IsAdHoc field. -func (o *WebhookCreate) SetIsAdHoc(v bool) { - o.IsAdHoc.Set(&v) -} -// SetIsAdHocNil sets the value for IsAdHoc to be an explicit nil -func (o *WebhookCreate) SetIsAdHocNil() { - o.IsAdHoc.Set(nil) -} - -// UnsetIsAdHoc ensures that no value is present for IsAdHoc, not even an explicit nil -func (o *WebhookCreate) UnsetIsAdHoc() { - o.IsAdHoc.Unset() -} - -// GetEventTypes returns the EventTypes field value -func (o *WebhookCreate) GetEventTypes() []WebhookEventType { - if o == nil { - var ret []WebhookEventType - return ret - } - - return o.EventTypes -} - -// GetEventTypesOk returns a tuple with the EventTypes field value -// and a boolean to check if the value has been set. -func (o *WebhookCreate) GetEventTypesOk() ([]WebhookEventType, bool) { - if o == nil { - return nil, false - } - return o.EventTypes, true -} - -// SetEventTypes sets field value -func (o *WebhookCreate) SetEventTypes(v []WebhookEventType) { - o.EventTypes = v -} - -// GetCondition returns the Condition field value -func (o *WebhookCreate) GetCondition() WebhookCondition { - if o == nil { - var ret WebhookCondition - return ret - } - - return o.Condition -} - -// GetConditionOk returns a tuple with the Condition field value -// and a boolean to check if the value has been set. -func (o *WebhookCreate) GetConditionOk() (*WebhookCondition, bool) { - if o == nil { - return nil, false - } - return &o.Condition, true -} - -// SetCondition sets field value -func (o *WebhookCreate) SetCondition(v WebhookCondition) { - o.Condition = v -} - -// GetIdempotencyKey returns the IdempotencyKey field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *WebhookCreate) GetIdempotencyKey() string { - if o == nil || IsNil(o.IdempotencyKey.Get()) { - var ret string - return ret - } - return *o.IdempotencyKey.Get() -} - -// GetIdempotencyKeyOk returns a tuple with the IdempotencyKey field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *WebhookCreate) GetIdempotencyKeyOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.IdempotencyKey.Get(), o.IdempotencyKey.IsSet() -} - -// HasIdempotencyKey returns a boolean if a field has been set. -func (o *WebhookCreate) HasIdempotencyKey() bool { - if o != nil && o.IdempotencyKey.IsSet() { - return true - } - - return false -} - -// SetIdempotencyKey gets a reference to the given NullableString and assigns it to the IdempotencyKey field. -func (o *WebhookCreate) SetIdempotencyKey(v string) { - o.IdempotencyKey.Set(&v) -} -// SetIdempotencyKeyNil sets the value for IdempotencyKey to be an explicit nil -func (o *WebhookCreate) SetIdempotencyKeyNil() { - o.IdempotencyKey.Set(nil) -} - -// UnsetIdempotencyKey ensures that no value is present for IdempotencyKey, not even an explicit nil -func (o *WebhookCreate) UnsetIdempotencyKey() { - o.IdempotencyKey.Unset() -} - -// GetIgnoreSslErrors returns the IgnoreSslErrors field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *WebhookCreate) GetIgnoreSslErrors() bool { - if o == nil || IsNil(o.IgnoreSslErrors.Get()) { - var ret bool - return ret - } - return *o.IgnoreSslErrors.Get() -} - -// GetIgnoreSslErrorsOk returns a tuple with the IgnoreSslErrors field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *WebhookCreate) GetIgnoreSslErrorsOk() (*bool, bool) { - if o == nil { - return nil, false - } - return o.IgnoreSslErrors.Get(), o.IgnoreSslErrors.IsSet() -} - -// HasIgnoreSslErrors returns a boolean if a field has been set. -func (o *WebhookCreate) HasIgnoreSslErrors() bool { - if o != nil && o.IgnoreSslErrors.IsSet() { - return true - } - - return false -} - -// SetIgnoreSslErrors gets a reference to the given NullableBool and assigns it to the IgnoreSslErrors field. -func (o *WebhookCreate) SetIgnoreSslErrors(v bool) { - o.IgnoreSslErrors.Set(&v) -} -// SetIgnoreSslErrorsNil sets the value for IgnoreSslErrors to be an explicit nil -func (o *WebhookCreate) SetIgnoreSslErrorsNil() { - o.IgnoreSslErrors.Set(nil) -} - -// UnsetIgnoreSslErrors ensures that no value is present for IgnoreSslErrors, not even an explicit nil -func (o *WebhookCreate) UnsetIgnoreSslErrors() { - o.IgnoreSslErrors.Unset() -} - -// GetDoNotRetry returns the DoNotRetry field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *WebhookCreate) GetDoNotRetry() bool { - if o == nil || IsNil(o.DoNotRetry.Get()) { - var ret bool - return ret - } - return *o.DoNotRetry.Get() -} - -// GetDoNotRetryOk returns a tuple with the DoNotRetry field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *WebhookCreate) GetDoNotRetryOk() (*bool, bool) { - if o == nil { - return nil, false - } - return o.DoNotRetry.Get(), o.DoNotRetry.IsSet() -} - -// HasDoNotRetry returns a boolean if a field has been set. -func (o *WebhookCreate) HasDoNotRetry() bool { - if o != nil && o.DoNotRetry.IsSet() { - return true - } - - return false -} - -// SetDoNotRetry gets a reference to the given NullableBool and assigns it to the DoNotRetry field. -func (o *WebhookCreate) SetDoNotRetry(v bool) { - o.DoNotRetry.Set(&v) -} -// SetDoNotRetryNil sets the value for DoNotRetry to be an explicit nil -func (o *WebhookCreate) SetDoNotRetryNil() { - o.DoNotRetry.Set(nil) -} - -// UnsetDoNotRetry ensures that no value is present for DoNotRetry, not even an explicit nil -func (o *WebhookCreate) UnsetDoNotRetry() { - o.DoNotRetry.Unset() -} - -// GetRequestUrl returns the RequestUrl field value -func (o *WebhookCreate) GetRequestUrl() string { - if o == nil { - var ret string - return ret - } - - return o.RequestUrl -} - -// GetRequestUrlOk returns a tuple with the RequestUrl field value -// and a boolean to check if the value has been set. -func (o *WebhookCreate) GetRequestUrlOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.RequestUrl, true -} - -// SetRequestUrl sets field value -func (o *WebhookCreate) SetRequestUrl(v string) { - o.RequestUrl = v -} - -// GetPayloadTemplate returns the PayloadTemplate field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *WebhookCreate) GetPayloadTemplate() string { - if o == nil || IsNil(o.PayloadTemplate.Get()) { - var ret string - return ret - } - return *o.PayloadTemplate.Get() -} - -// GetPayloadTemplateOk returns a tuple with the PayloadTemplate field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *WebhookCreate) GetPayloadTemplateOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.PayloadTemplate.Get(), o.PayloadTemplate.IsSet() -} - -// HasPayloadTemplate returns a boolean if a field has been set. -func (o *WebhookCreate) HasPayloadTemplate() bool { - if o != nil && o.PayloadTemplate.IsSet() { - return true - } - - return false -} - -// SetPayloadTemplate gets a reference to the given NullableString and assigns it to the PayloadTemplate field. -func (o *WebhookCreate) SetPayloadTemplate(v string) { - o.PayloadTemplate.Set(&v) -} -// SetPayloadTemplateNil sets the value for PayloadTemplate to be an explicit nil -func (o *WebhookCreate) SetPayloadTemplateNil() { - o.PayloadTemplate.Set(nil) -} - -// UnsetPayloadTemplate ensures that no value is present for PayloadTemplate, not even an explicit nil -func (o *WebhookCreate) UnsetPayloadTemplate() { - o.PayloadTemplate.Unset() -} - -// GetHeadersTemplate returns the HeadersTemplate field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *WebhookCreate) GetHeadersTemplate() string { - if o == nil || IsNil(o.HeadersTemplate.Get()) { - var ret string - return ret - } - return *o.HeadersTemplate.Get() -} - -// GetHeadersTemplateOk returns a tuple with the HeadersTemplate field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *WebhookCreate) GetHeadersTemplateOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.HeadersTemplate.Get(), o.HeadersTemplate.IsSet() -} - -// HasHeadersTemplate returns a boolean if a field has been set. -func (o *WebhookCreate) HasHeadersTemplate() bool { - if o != nil && o.HeadersTemplate.IsSet() { - return true - } - - return false -} - -// SetHeadersTemplate gets a reference to the given NullableString and assigns it to the HeadersTemplate field. -func (o *WebhookCreate) SetHeadersTemplate(v string) { - o.HeadersTemplate.Set(&v) -} -// SetHeadersTemplateNil sets the value for HeadersTemplate to be an explicit nil -func (o *WebhookCreate) SetHeadersTemplateNil() { - o.HeadersTemplate.Set(nil) -} - -// UnsetHeadersTemplate ensures that no value is present for HeadersTemplate, not even an explicit nil -func (o *WebhookCreate) UnsetHeadersTemplate() { - o.HeadersTemplate.Unset() -} - -// GetDescription returns the Description field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *WebhookCreate) GetDescription() string { - if o == nil || IsNil(o.Description.Get()) { - var ret string - return ret - } - return *o.Description.Get() -} - -// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *WebhookCreate) GetDescriptionOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.Description.Get(), o.Description.IsSet() -} - -// HasDescription returns a boolean if a field has been set. -func (o *WebhookCreate) HasDescription() bool { - if o != nil && o.Description.IsSet() { - return true - } - - return false -} - -// SetDescription gets a reference to the given NullableString and assigns it to the Description field. -func (o *WebhookCreate) SetDescription(v string) { - o.Description.Set(&v) -} -// SetDescriptionNil sets the value for Description to be an explicit nil -func (o *WebhookCreate) SetDescriptionNil() { - o.Description.Set(nil) -} - -// UnsetDescription ensures that no value is present for Description, not even an explicit nil -func (o *WebhookCreate) UnsetDescription() { - o.Description.Unset() -} - -// GetShouldInterpolateStrings returns the ShouldInterpolateStrings field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *WebhookCreate) GetShouldInterpolateStrings() bool { - if o == nil || IsNil(o.ShouldInterpolateStrings.Get()) { - var ret bool - return ret - } - return *o.ShouldInterpolateStrings.Get() -} - -// GetShouldInterpolateStringsOk returns a tuple with the ShouldInterpolateStrings field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *WebhookCreate) GetShouldInterpolateStringsOk() (*bool, bool) { - if o == nil { - return nil, false - } - return o.ShouldInterpolateStrings.Get(), o.ShouldInterpolateStrings.IsSet() -} - -// HasShouldInterpolateStrings returns a boolean if a field has been set. -func (o *WebhookCreate) HasShouldInterpolateStrings() bool { - if o != nil && o.ShouldInterpolateStrings.IsSet() { - return true - } - - return false -} - -// SetShouldInterpolateStrings gets a reference to the given NullableBool and assigns it to the ShouldInterpolateStrings field. -func (o *WebhookCreate) SetShouldInterpolateStrings(v bool) { - o.ShouldInterpolateStrings.Set(&v) -} -// SetShouldInterpolateStringsNil sets the value for ShouldInterpolateStrings to be an explicit nil -func (o *WebhookCreate) SetShouldInterpolateStringsNil() { - o.ShouldInterpolateStrings.Set(nil) -} - -// UnsetShouldInterpolateStrings ensures that no value is present for ShouldInterpolateStrings, not even an explicit nil -func (o *WebhookCreate) UnsetShouldInterpolateStrings() { - o.ShouldInterpolateStrings.Unset() -} - -func (o WebhookCreate) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o WebhookCreate) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if o.IsAdHoc.IsSet() { - toSerialize["isAdHoc"] = o.IsAdHoc.Get() - } - toSerialize["eventTypes"] = o.EventTypes - toSerialize["condition"] = o.Condition - if o.IdempotencyKey.IsSet() { - toSerialize["idempotencyKey"] = o.IdempotencyKey.Get() - } - if o.IgnoreSslErrors.IsSet() { - toSerialize["ignoreSslErrors"] = o.IgnoreSslErrors.Get() - } - if o.DoNotRetry.IsSet() { - toSerialize["doNotRetry"] = o.DoNotRetry.Get() - } - toSerialize["requestUrl"] = o.RequestUrl - if o.PayloadTemplate.IsSet() { - toSerialize["payloadTemplate"] = o.PayloadTemplate.Get() - } - if o.HeadersTemplate.IsSet() { - toSerialize["headersTemplate"] = o.HeadersTemplate.Get() - } - if o.Description.IsSet() { - toSerialize["description"] = o.Description.Get() - } - if o.ShouldInterpolateStrings.IsSet() { - toSerialize["shouldInterpolateStrings"] = o.ShouldInterpolateStrings.Get() - } - return toSerialize, nil -} - -func (o *WebhookCreate) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "eventTypes", - "condition", - "requestUrl", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err; - } - - for _, requiredProperty := range(requiredProperties) { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varWebhookCreate := _WebhookCreate{} - - decoder := json.NewDecoder(bytes.NewReader(data)) - decoder.DisallowUnknownFields() - err = decoder.Decode(&varWebhookCreate) - - if err != nil { - return err - } - - *o = WebhookCreate(varWebhookCreate) - - return err -} - -type NullableWebhookCreate struct { - value *WebhookCreate - isSet bool -} - -func (v NullableWebhookCreate) Get() *WebhookCreate { - return v.value -} - -func (v *NullableWebhookCreate) Set(val *WebhookCreate) { - v.value = val - v.isSet = true -} - -func (v NullableWebhookCreate) IsSet() bool { - return v.isSet -} - -func (v *NullableWebhookCreate) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableWebhookCreate(val *WebhookCreate) *NullableWebhookCreate { - return &NullableWebhookCreate{value: val, isSet: true} -} - -func (v NullableWebhookCreate) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableWebhookCreate) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_webhook_dispatch.go b/model_webhook_dispatch.go deleted file mode 100644 index c5d31e8..0000000 --- a/model_webhook_dispatch.go +++ /dev/null @@ -1,417 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" - "time" - "bytes" - "fmt" -) - -// checks if the WebhookDispatch type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &WebhookDispatch{} - -// WebhookDispatch struct for WebhookDispatch -type WebhookDispatch struct { - Id string `json:"id"` - UserId string `json:"userId"` - WebhookId string `json:"webhookId"` - CreatedAt time.Time `json:"createdAt"` - Status WebhookDispatchStatus `json:"status"` - EventType WebhookEventType `json:"eventType"` - EventData *EventData `json:"eventData,omitempty"` - Webhook NullableWebhookDispatchWebhookSummary `json:"webhook,omitempty"` - Calls []CallsInner `json:"calls,omitempty"` -} - -type _WebhookDispatch WebhookDispatch - -// NewWebhookDispatch instantiates a new WebhookDispatch object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewWebhookDispatch(id string, userId string, webhookId string, createdAt time.Time, status WebhookDispatchStatus, eventType WebhookEventType) *WebhookDispatch { - this := WebhookDispatch{} - this.Id = id - this.UserId = userId - this.WebhookId = webhookId - this.CreatedAt = createdAt - this.Status = status - this.EventType = eventType - return &this -} - -// NewWebhookDispatchWithDefaults instantiates a new WebhookDispatch object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewWebhookDispatchWithDefaults() *WebhookDispatch { - this := WebhookDispatch{} - return &this -} - -// GetId returns the Id field value -func (o *WebhookDispatch) GetId() string { - if o == nil { - var ret string - return ret - } - - return o.Id -} - -// GetIdOk returns a tuple with the Id field value -// and a boolean to check if the value has been set. -func (o *WebhookDispatch) GetIdOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Id, true -} - -// SetId sets field value -func (o *WebhookDispatch) SetId(v string) { - o.Id = v -} - -// GetUserId returns the UserId field value -func (o *WebhookDispatch) GetUserId() string { - if o == nil { - var ret string - return ret - } - - return o.UserId -} - -// GetUserIdOk returns a tuple with the UserId field value -// and a boolean to check if the value has been set. -func (o *WebhookDispatch) GetUserIdOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.UserId, true -} - -// SetUserId sets field value -func (o *WebhookDispatch) SetUserId(v string) { - o.UserId = v -} - -// GetWebhookId returns the WebhookId field value -func (o *WebhookDispatch) GetWebhookId() string { - if o == nil { - var ret string - return ret - } - - return o.WebhookId -} - -// GetWebhookIdOk returns a tuple with the WebhookId field value -// and a boolean to check if the value has been set. -func (o *WebhookDispatch) GetWebhookIdOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.WebhookId, true -} - -// SetWebhookId sets field value -func (o *WebhookDispatch) SetWebhookId(v string) { - o.WebhookId = v -} - -// GetCreatedAt returns the CreatedAt field value -func (o *WebhookDispatch) GetCreatedAt() time.Time { - if o == nil { - var ret time.Time - return ret - } - - return o.CreatedAt -} - -// GetCreatedAtOk returns a tuple with the CreatedAt field value -// and a boolean to check if the value has been set. -func (o *WebhookDispatch) GetCreatedAtOk() (*time.Time, bool) { - if o == nil { - return nil, false - } - return &o.CreatedAt, true -} - -// SetCreatedAt sets field value -func (o *WebhookDispatch) SetCreatedAt(v time.Time) { - o.CreatedAt = v -} - -// GetStatus returns the Status field value -func (o *WebhookDispatch) GetStatus() WebhookDispatchStatus { - if o == nil { - var ret WebhookDispatchStatus - return ret - } - - return o.Status -} - -// GetStatusOk returns a tuple with the Status field value -// and a boolean to check if the value has been set. -func (o *WebhookDispatch) GetStatusOk() (*WebhookDispatchStatus, bool) { - if o == nil { - return nil, false - } - return &o.Status, true -} - -// SetStatus sets field value -func (o *WebhookDispatch) SetStatus(v WebhookDispatchStatus) { - o.Status = v -} - -// GetEventType returns the EventType field value -func (o *WebhookDispatch) GetEventType() WebhookEventType { - if o == nil { - var ret WebhookEventType - return ret - } - - return o.EventType -} - -// GetEventTypeOk returns a tuple with the EventType field value -// and a boolean to check if the value has been set. -func (o *WebhookDispatch) GetEventTypeOk() (*WebhookEventType, bool) { - if o == nil { - return nil, false - } - return &o.EventType, true -} - -// SetEventType sets field value -func (o *WebhookDispatch) SetEventType(v WebhookEventType) { - o.EventType = v -} - -// GetEventData returns the EventData field value if set, zero value otherwise. -func (o *WebhookDispatch) GetEventData() EventData { - if o == nil || IsNil(o.EventData) { - var ret EventData - return ret - } - return *o.EventData -} - -// GetEventDataOk returns a tuple with the EventData field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *WebhookDispatch) GetEventDataOk() (*EventData, bool) { - if o == nil || IsNil(o.EventData) { - return nil, false - } - return o.EventData, true -} - -// HasEventData returns a boolean if a field has been set. -func (o *WebhookDispatch) HasEventData() bool { - if o != nil && !IsNil(o.EventData) { - return true - } - - return false -} - -// SetEventData gets a reference to the given EventData and assigns it to the EventData field. -func (o *WebhookDispatch) SetEventData(v EventData) { - o.EventData = &v -} - -// GetWebhook returns the Webhook field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *WebhookDispatch) GetWebhook() WebhookDispatchWebhookSummary { - if o == nil || IsNil(o.Webhook.Get()) { - var ret WebhookDispatchWebhookSummary - return ret - } - return *o.Webhook.Get() -} - -// GetWebhookOk returns a tuple with the Webhook field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *WebhookDispatch) GetWebhookOk() (*WebhookDispatchWebhookSummary, bool) { - if o == nil { - return nil, false - } - return o.Webhook.Get(), o.Webhook.IsSet() -} - -// HasWebhook returns a boolean if a field has been set. -func (o *WebhookDispatch) HasWebhook() bool { - if o != nil && o.Webhook.IsSet() { - return true - } - - return false -} - -// SetWebhook gets a reference to the given NullableWebhookDispatchWebhookSummary and assigns it to the Webhook field. -func (o *WebhookDispatch) SetWebhook(v WebhookDispatchWebhookSummary) { - o.Webhook.Set(&v) -} -// SetWebhookNil sets the value for Webhook to be an explicit nil -func (o *WebhookDispatch) SetWebhookNil() { - o.Webhook.Set(nil) -} - -// UnsetWebhook ensures that no value is present for Webhook, not even an explicit nil -func (o *WebhookDispatch) UnsetWebhook() { - o.Webhook.Unset() -} - -// GetCalls returns the Calls field value if set, zero value otherwise. -func (o *WebhookDispatch) GetCalls() []CallsInner { - if o == nil || IsNil(o.Calls) { - var ret []CallsInner - return ret - } - return o.Calls -} - -// GetCallsOk returns a tuple with the Calls field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *WebhookDispatch) GetCallsOk() ([]CallsInner, bool) { - if o == nil || IsNil(o.Calls) { - return nil, false - } - return o.Calls, true -} - -// HasCalls returns a boolean if a field has been set. -func (o *WebhookDispatch) HasCalls() bool { - if o != nil && !IsNil(o.Calls) { - return true - } - - return false -} - -// SetCalls gets a reference to the given []CallsInner and assigns it to the Calls field. -func (o *WebhookDispatch) SetCalls(v []CallsInner) { - o.Calls = v -} - -func (o WebhookDispatch) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o WebhookDispatch) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["id"] = o.Id - toSerialize["userId"] = o.UserId - toSerialize["webhookId"] = o.WebhookId - toSerialize["createdAt"] = o.CreatedAt - toSerialize["status"] = o.Status - toSerialize["eventType"] = o.EventType - if !IsNil(o.EventData) { - toSerialize["eventData"] = o.EventData - } - if o.Webhook.IsSet() { - toSerialize["webhook"] = o.Webhook.Get() - } - if !IsNil(o.Calls) { - toSerialize["calls"] = o.Calls - } - return toSerialize, nil -} - -func (o *WebhookDispatch) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "id", - "userId", - "webhookId", - "createdAt", - "status", - "eventType", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err; - } - - for _, requiredProperty := range(requiredProperties) { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varWebhookDispatch := _WebhookDispatch{} - - decoder := json.NewDecoder(bytes.NewReader(data)) - decoder.DisallowUnknownFields() - err = decoder.Decode(&varWebhookDispatch) - - if err != nil { - return err - } - - *o = WebhookDispatch(varWebhookDispatch) - - return err -} - -type NullableWebhookDispatch struct { - value *WebhookDispatch - isSet bool -} - -func (v NullableWebhookDispatch) Get() *WebhookDispatch { - return v.value -} - -func (v *NullableWebhookDispatch) Set(val *WebhookDispatch) { - v.value = val - v.isSet = true -} - -func (v NullableWebhookDispatch) IsSet() bool { - return v.isSet -} - -func (v *NullableWebhookDispatch) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableWebhookDispatch(val *WebhookDispatch) *NullableWebhookDispatch { - return &NullableWebhookDispatch{value: val, isSet: true} -} - -func (v NullableWebhookDispatch) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableWebhookDispatch) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_webhook_dispatch_response.go b/model_webhook_dispatch_response.go deleted file mode 100644 index 83857db..0000000 --- a/model_webhook_dispatch_response.go +++ /dev/null @@ -1,158 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" - "bytes" - "fmt" -) - -// checks if the WebhookDispatchResponse type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &WebhookDispatchResponse{} - -// WebhookDispatchResponse struct for WebhookDispatchResponse -type WebhookDispatchResponse struct { - Data WebhookDispatch `json:"data"` -} - -type _WebhookDispatchResponse WebhookDispatchResponse - -// NewWebhookDispatchResponse instantiates a new WebhookDispatchResponse object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewWebhookDispatchResponse(data WebhookDispatch) *WebhookDispatchResponse { - this := WebhookDispatchResponse{} - this.Data = data - return &this -} - -// NewWebhookDispatchResponseWithDefaults instantiates a new WebhookDispatchResponse object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewWebhookDispatchResponseWithDefaults() *WebhookDispatchResponse { - this := WebhookDispatchResponse{} - return &this -} - -// GetData returns the Data field value -func (o *WebhookDispatchResponse) GetData() WebhookDispatch { - if o == nil { - var ret WebhookDispatch - return ret - } - - return o.Data -} - -// GetDataOk returns a tuple with the Data field value -// and a boolean to check if the value has been set. -func (o *WebhookDispatchResponse) GetDataOk() (*WebhookDispatch, bool) { - if o == nil { - return nil, false - } - return &o.Data, true -} - -// SetData sets field value -func (o *WebhookDispatchResponse) SetData(v WebhookDispatch) { - o.Data = v -} - -func (o WebhookDispatchResponse) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o WebhookDispatchResponse) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["data"] = o.Data - return toSerialize, nil -} - -func (o *WebhookDispatchResponse) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "data", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err; - } - - for _, requiredProperty := range(requiredProperties) { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varWebhookDispatchResponse := _WebhookDispatchResponse{} - - decoder := json.NewDecoder(bytes.NewReader(data)) - decoder.DisallowUnknownFields() - err = decoder.Decode(&varWebhookDispatchResponse) - - if err != nil { - return err - } - - *o = WebhookDispatchResponse(varWebhookDispatchResponse) - - return err -} - -type NullableWebhookDispatchResponse struct { - value *WebhookDispatchResponse - isSet bool -} - -func (v NullableWebhookDispatchResponse) Get() *WebhookDispatchResponse { - return v.value -} - -func (v *NullableWebhookDispatchResponse) Set(val *WebhookDispatchResponse) { - v.value = val - v.isSet = true -} - -func (v NullableWebhookDispatchResponse) IsSet() bool { - return v.isSet -} - -func (v *NullableWebhookDispatchResponse) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableWebhookDispatchResponse(val *WebhookDispatchResponse) *NullableWebhookDispatchResponse { - return &NullableWebhookDispatchResponse{value: val, isSet: true} -} - -func (v NullableWebhookDispatchResponse) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableWebhookDispatchResponse) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_webhook_dispatch_status.go b/model_webhook_dispatch_status.go deleted file mode 100644 index b381e99..0000000 --- a/model_webhook_dispatch_status.go +++ /dev/null @@ -1,113 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" - "fmt" -) - -// WebhookDispatchStatus Status of the webhook dispatch indicating whether the HTTP request was successful. -type WebhookDispatchStatus string - -// List of WebhookDispatchStatus -const ( - ACTIVE WebhookDispatchStatus = "ACTIVE" - SUCCEEDED WebhookDispatchStatus = "SUCCEEDED" - FAILED WebhookDispatchStatus = "FAILED" -) - -// All allowed values of WebhookDispatchStatus enum -var AllowedWebhookDispatchStatusEnumValues = []WebhookDispatchStatus{ - "ACTIVE", - "SUCCEEDED", - "FAILED", -} - -func (v *WebhookDispatchStatus) UnmarshalJSON(src []byte) error { - var value string - err := json.Unmarshal(src, &value) - if err != nil { - return err - } - enumTypeValue := WebhookDispatchStatus(value) - for _, existing := range AllowedWebhookDispatchStatusEnumValues { - if existing == enumTypeValue { - *v = enumTypeValue - return nil - } - } - - return fmt.Errorf("%+v is not a valid WebhookDispatchStatus", value) -} - -// NewWebhookDispatchStatusFromValue returns a pointer to a valid WebhookDispatchStatus -// for the value passed as argument, or an error if the value passed is not allowed by the enum -func NewWebhookDispatchStatusFromValue(v string) (*WebhookDispatchStatus, error) { - ev := WebhookDispatchStatus(v) - if ev.IsValid() { - return &ev, nil - } else { - return nil, fmt.Errorf("invalid value '%v' for WebhookDispatchStatus: valid values are %v", v, AllowedWebhookDispatchStatusEnumValues) - } -} - -// IsValid return true if the value is valid for the enum, false otherwise -func (v WebhookDispatchStatus) IsValid() bool { - for _, existing := range AllowedWebhookDispatchStatusEnumValues { - if existing == v { - return true - } - } - return false -} - -// Ptr returns reference to WebhookDispatchStatus value -func (v WebhookDispatchStatus) Ptr() *WebhookDispatchStatus { - return &v -} - -type NullableWebhookDispatchStatus struct { - value *WebhookDispatchStatus - isSet bool -} - -func (v NullableWebhookDispatchStatus) Get() *WebhookDispatchStatus { - return v.value -} - -func (v *NullableWebhookDispatchStatus) Set(val *WebhookDispatchStatus) { - v.value = val - v.isSet = true -} - -func (v NullableWebhookDispatchStatus) IsSet() bool { - return v.isSet -} - -func (v *NullableWebhookDispatchStatus) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableWebhookDispatchStatus(val *WebhookDispatchStatus) *NullableWebhookDispatchStatus { - return &NullableWebhookDispatchStatus{value: val, isSet: true} -} - -func (v NullableWebhookDispatchStatus) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableWebhookDispatchStatus) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - diff --git a/model_webhook_dispatch_webhook_summary.go b/model_webhook_dispatch_webhook_summary.go deleted file mode 100644 index bcb4eee..0000000 --- a/model_webhook_dispatch_webhook_summary.go +++ /dev/null @@ -1,234 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" -) - -// checks if the WebhookDispatchWebhookSummary type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &WebhookDispatchWebhookSummary{} - -// WebhookDispatchWebhookSummary A summary of the webhook that triggered this dispatch. -type WebhookDispatchWebhookSummary struct { - ActionType *string `json:"actionType,omitempty"` - Condition *WebhookCondition `json:"condition,omitempty"` - RequestUrl *string `json:"requestUrl,omitempty"` - IsAdHoc *bool `json:"isAdHoc,omitempty"` -} - -// NewWebhookDispatchWebhookSummary instantiates a new WebhookDispatchWebhookSummary object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewWebhookDispatchWebhookSummary() *WebhookDispatchWebhookSummary { - this := WebhookDispatchWebhookSummary{} - return &this -} - -// NewWebhookDispatchWebhookSummaryWithDefaults instantiates a new WebhookDispatchWebhookSummary object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewWebhookDispatchWebhookSummaryWithDefaults() *WebhookDispatchWebhookSummary { - this := WebhookDispatchWebhookSummary{} - return &this -} - -// GetActionType returns the ActionType field value if set, zero value otherwise. -func (o *WebhookDispatchWebhookSummary) GetActionType() string { - if o == nil || IsNil(o.ActionType) { - var ret string - return ret - } - return *o.ActionType -} - -// GetActionTypeOk returns a tuple with the ActionType field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *WebhookDispatchWebhookSummary) GetActionTypeOk() (*string, bool) { - if o == nil || IsNil(o.ActionType) { - return nil, false - } - return o.ActionType, true -} - -// HasActionType returns a boolean if a field has been set. -func (o *WebhookDispatchWebhookSummary) HasActionType() bool { - if o != nil && !IsNil(o.ActionType) { - return true - } - - return false -} - -// SetActionType gets a reference to the given string and assigns it to the ActionType field. -func (o *WebhookDispatchWebhookSummary) SetActionType(v string) { - o.ActionType = &v -} - -// GetCondition returns the Condition field value if set, zero value otherwise. -func (o *WebhookDispatchWebhookSummary) GetCondition() WebhookCondition { - if o == nil || IsNil(o.Condition) { - var ret WebhookCondition - return ret - } - return *o.Condition -} - -// GetConditionOk returns a tuple with the Condition field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *WebhookDispatchWebhookSummary) GetConditionOk() (*WebhookCondition, bool) { - if o == nil || IsNil(o.Condition) { - return nil, false - } - return o.Condition, true -} - -// HasCondition returns a boolean if a field has been set. -func (o *WebhookDispatchWebhookSummary) HasCondition() bool { - if o != nil && !IsNil(o.Condition) { - return true - } - - return false -} - -// SetCondition gets a reference to the given WebhookCondition and assigns it to the Condition field. -func (o *WebhookDispatchWebhookSummary) SetCondition(v WebhookCondition) { - o.Condition = &v -} - -// GetRequestUrl returns the RequestUrl field value if set, zero value otherwise. -func (o *WebhookDispatchWebhookSummary) GetRequestUrl() string { - if o == nil || IsNil(o.RequestUrl) { - var ret string - return ret - } - return *o.RequestUrl -} - -// GetRequestUrlOk returns a tuple with the RequestUrl field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *WebhookDispatchWebhookSummary) GetRequestUrlOk() (*string, bool) { - if o == nil || IsNil(o.RequestUrl) { - return nil, false - } - return o.RequestUrl, true -} - -// HasRequestUrl returns a boolean if a field has been set. -func (o *WebhookDispatchWebhookSummary) HasRequestUrl() bool { - if o != nil && !IsNil(o.RequestUrl) { - return true - } - - return false -} - -// SetRequestUrl gets a reference to the given string and assigns it to the RequestUrl field. -func (o *WebhookDispatchWebhookSummary) SetRequestUrl(v string) { - o.RequestUrl = &v -} - -// GetIsAdHoc returns the IsAdHoc field value if set, zero value otherwise. -func (o *WebhookDispatchWebhookSummary) GetIsAdHoc() bool { - if o == nil || IsNil(o.IsAdHoc) { - var ret bool - return ret - } - return *o.IsAdHoc -} - -// GetIsAdHocOk returns a tuple with the IsAdHoc field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *WebhookDispatchWebhookSummary) GetIsAdHocOk() (*bool, bool) { - if o == nil || IsNil(o.IsAdHoc) { - return nil, false - } - return o.IsAdHoc, true -} - -// HasIsAdHoc returns a boolean if a field has been set. -func (o *WebhookDispatchWebhookSummary) HasIsAdHoc() bool { - if o != nil && !IsNil(o.IsAdHoc) { - return true - } - - return false -} - -// SetIsAdHoc gets a reference to the given bool and assigns it to the IsAdHoc field. -func (o *WebhookDispatchWebhookSummary) SetIsAdHoc(v bool) { - o.IsAdHoc = &v -} - -func (o WebhookDispatchWebhookSummary) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o WebhookDispatchWebhookSummary) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if !IsNil(o.ActionType) { - toSerialize["actionType"] = o.ActionType - } - if !IsNil(o.Condition) { - toSerialize["condition"] = o.Condition - } - if !IsNil(o.RequestUrl) { - toSerialize["requestUrl"] = o.RequestUrl - } - if !IsNil(o.IsAdHoc) { - toSerialize["isAdHoc"] = o.IsAdHoc - } - return toSerialize, nil -} - -type NullableWebhookDispatchWebhookSummary struct { - value *WebhookDispatchWebhookSummary - isSet bool -} - -func (v NullableWebhookDispatchWebhookSummary) Get() *WebhookDispatchWebhookSummary { - return v.value -} - -func (v *NullableWebhookDispatchWebhookSummary) Set(val *WebhookDispatchWebhookSummary) { - v.value = val - v.isSet = true -} - -func (v NullableWebhookDispatchWebhookSummary) IsSet() bool { - return v.isSet -} - -func (v *NullableWebhookDispatchWebhookSummary) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableWebhookDispatchWebhookSummary(val *WebhookDispatchWebhookSummary) *NullableWebhookDispatchWebhookSummary { - return &NullableWebhookDispatchWebhookSummary{value: val, isSet: true} -} - -func (v NullableWebhookDispatchWebhookSummary) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableWebhookDispatchWebhookSummary) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_webhook_event_type.go b/model_webhook_event_type.go deleted file mode 100644 index 617b8fc..0000000 --- a/model_webhook_event_type.go +++ /dev/null @@ -1,131 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" - "fmt" -) - -// WebhookEventType Type of event that triggers the webhook. -type WebhookEventType string - -// List of WebhookEventType -const ( - ACTOR_BUILD_ABORTED WebhookEventType = "ACTOR.BUILD.ABORTED" - ACTOR_BUILD_CREATED WebhookEventType = "ACTOR.BUILD.CREATED" - ACTOR_BUILD_FAILED WebhookEventType = "ACTOR.BUILD.FAILED" - ACTOR_BUILD_SUCCEEDED WebhookEventType = "ACTOR.BUILD.SUCCEEDED" - ACTOR_BUILD_TIMED_OUT WebhookEventType = "ACTOR.BUILD.TIMED_OUT" - ACTOR_RUN_ABORTED WebhookEventType = "ACTOR.RUN.ABORTED" - ACTOR_RUN_CREATED WebhookEventType = "ACTOR.RUN.CREATED" - ACTOR_RUN_FAILED WebhookEventType = "ACTOR.RUN.FAILED" - ACTOR_RUN_RESURRECTED WebhookEventType = "ACTOR.RUN.RESURRECTED" - ACTOR_RUN_SUCCEEDED WebhookEventType = "ACTOR.RUN.SUCCEEDED" - ACTOR_RUN_TIMED_OUT WebhookEventType = "ACTOR.RUN.TIMED_OUT" - TEST WebhookEventType = "TEST" -) - -// All allowed values of WebhookEventType enum -var AllowedWebhookEventTypeEnumValues = []WebhookEventType{ - "ACTOR.BUILD.ABORTED", - "ACTOR.BUILD.CREATED", - "ACTOR.BUILD.FAILED", - "ACTOR.BUILD.SUCCEEDED", - "ACTOR.BUILD.TIMED_OUT", - "ACTOR.RUN.ABORTED", - "ACTOR.RUN.CREATED", - "ACTOR.RUN.FAILED", - "ACTOR.RUN.RESURRECTED", - "ACTOR.RUN.SUCCEEDED", - "ACTOR.RUN.TIMED_OUT", - "TEST", -} - -func (v *WebhookEventType) UnmarshalJSON(src []byte) error { - var value string - err := json.Unmarshal(src, &value) - if err != nil { - return err - } - enumTypeValue := WebhookEventType(value) - for _, existing := range AllowedWebhookEventTypeEnumValues { - if existing == enumTypeValue { - *v = enumTypeValue - return nil - } - } - - return fmt.Errorf("%+v is not a valid WebhookEventType", value) -} - -// NewWebhookEventTypeFromValue returns a pointer to a valid WebhookEventType -// for the value passed as argument, or an error if the value passed is not allowed by the enum -func NewWebhookEventTypeFromValue(v string) (*WebhookEventType, error) { - ev := WebhookEventType(v) - if ev.IsValid() { - return &ev, nil - } else { - return nil, fmt.Errorf("invalid value '%v' for WebhookEventType: valid values are %v", v, AllowedWebhookEventTypeEnumValues) - } -} - -// IsValid return true if the value is valid for the enum, false otherwise -func (v WebhookEventType) IsValid() bool { - for _, existing := range AllowedWebhookEventTypeEnumValues { - if existing == v { - return true - } - } - return false -} - -// Ptr returns reference to WebhookEventType value -func (v WebhookEventType) Ptr() *WebhookEventType { - return &v -} - -type NullableWebhookEventType struct { - value *WebhookEventType - isSet bool -} - -func (v NullableWebhookEventType) Get() *WebhookEventType { - return v.value -} - -func (v *NullableWebhookEventType) Set(val *WebhookEventType) { - v.value = val - v.isSet = true -} - -func (v NullableWebhookEventType) IsSet() bool { - return v.isSet -} - -func (v *NullableWebhookEventType) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableWebhookEventType(val *WebhookEventType) *NullableWebhookEventType { - return &NullableWebhookEventType{value: val, isSet: true} -} - -func (v NullableWebhookEventType) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableWebhookEventType) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - diff --git a/model_webhook_representation.go b/model_webhook_representation.go deleted file mode 100644 index dd12907..0000000 --- a/model_webhook_representation.go +++ /dev/null @@ -1,469 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" - "bytes" - "fmt" -) - -// checks if the WebhookRepresentation type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &WebhookRepresentation{} - -// WebhookRepresentation Minimal representation of an ad-hoc webhook attached to a single Actor run or build via the `webhooks` query parameter. The query parameter value is a Base64-encoded JSON array whose items match this schema. Persistent webhook fields (e.g. `condition`) are not used here. -type WebhookRepresentation struct { - EventTypes []WebhookEventType `json:"eventTypes"` - // The URL to which the webhook sends its payload. - RequestUrl string `json:"requestUrl"` - // Optional template for the JSON payload sent by the webhook. - PayloadTemplate NullableString `json:"payloadTemplate,omitempty"` - // Optional template for the HTTP headers sent by the webhook. - HeadersTemplate NullableString `json:"headersTemplate,omitempty"` - // Flag to also interpolate `{{...}}` variables inside string values of the payload and headers templates. - ShouldInterpolateStrings NullableBool `json:"shouldInterpolateStrings,omitempty"` - // Key that prevents creating duplicate webhooks, e.g. when the run-starting request is retried. - IdempotencyKey NullableString `json:"idempotencyKey,omitempty"` - // Flag to ignore SSL errors when the webhook sends the request. - IgnoreSslErrors NullableBool `json:"ignoreSslErrors,omitempty"` - // Flag to skip retrying the webhook request on failure. - DoNotRetry NullableBool `json:"doNotRetry,omitempty"` -} - -type _WebhookRepresentation WebhookRepresentation - -// NewWebhookRepresentation instantiates a new WebhookRepresentation object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewWebhookRepresentation(eventTypes []WebhookEventType, requestUrl string) *WebhookRepresentation { - this := WebhookRepresentation{} - this.EventTypes = eventTypes - this.RequestUrl = requestUrl - return &this -} - -// NewWebhookRepresentationWithDefaults instantiates a new WebhookRepresentation object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewWebhookRepresentationWithDefaults() *WebhookRepresentation { - this := WebhookRepresentation{} - return &this -} - -// GetEventTypes returns the EventTypes field value -func (o *WebhookRepresentation) GetEventTypes() []WebhookEventType { - if o == nil { - var ret []WebhookEventType - return ret - } - - return o.EventTypes -} - -// GetEventTypesOk returns a tuple with the EventTypes field value -// and a boolean to check if the value has been set. -func (o *WebhookRepresentation) GetEventTypesOk() ([]WebhookEventType, bool) { - if o == nil { - return nil, false - } - return o.EventTypes, true -} - -// SetEventTypes sets field value -func (o *WebhookRepresentation) SetEventTypes(v []WebhookEventType) { - o.EventTypes = v -} - -// GetRequestUrl returns the RequestUrl field value -func (o *WebhookRepresentation) GetRequestUrl() string { - if o == nil { - var ret string - return ret - } - - return o.RequestUrl -} - -// GetRequestUrlOk returns a tuple with the RequestUrl field value -// and a boolean to check if the value has been set. -func (o *WebhookRepresentation) GetRequestUrlOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.RequestUrl, true -} - -// SetRequestUrl sets field value -func (o *WebhookRepresentation) SetRequestUrl(v string) { - o.RequestUrl = v -} - -// GetPayloadTemplate returns the PayloadTemplate field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *WebhookRepresentation) GetPayloadTemplate() string { - if o == nil || IsNil(o.PayloadTemplate.Get()) { - var ret string - return ret - } - return *o.PayloadTemplate.Get() -} - -// GetPayloadTemplateOk returns a tuple with the PayloadTemplate field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *WebhookRepresentation) GetPayloadTemplateOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.PayloadTemplate.Get(), o.PayloadTemplate.IsSet() -} - -// HasPayloadTemplate returns a boolean if a field has been set. -func (o *WebhookRepresentation) HasPayloadTemplate() bool { - if o != nil && o.PayloadTemplate.IsSet() { - return true - } - - return false -} - -// SetPayloadTemplate gets a reference to the given NullableString and assigns it to the PayloadTemplate field. -func (o *WebhookRepresentation) SetPayloadTemplate(v string) { - o.PayloadTemplate.Set(&v) -} -// SetPayloadTemplateNil sets the value for PayloadTemplate to be an explicit nil -func (o *WebhookRepresentation) SetPayloadTemplateNil() { - o.PayloadTemplate.Set(nil) -} - -// UnsetPayloadTemplate ensures that no value is present for PayloadTemplate, not even an explicit nil -func (o *WebhookRepresentation) UnsetPayloadTemplate() { - o.PayloadTemplate.Unset() -} - -// GetHeadersTemplate returns the HeadersTemplate field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *WebhookRepresentation) GetHeadersTemplate() string { - if o == nil || IsNil(o.HeadersTemplate.Get()) { - var ret string - return ret - } - return *o.HeadersTemplate.Get() -} - -// GetHeadersTemplateOk returns a tuple with the HeadersTemplate field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *WebhookRepresentation) GetHeadersTemplateOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.HeadersTemplate.Get(), o.HeadersTemplate.IsSet() -} - -// HasHeadersTemplate returns a boolean if a field has been set. -func (o *WebhookRepresentation) HasHeadersTemplate() bool { - if o != nil && o.HeadersTemplate.IsSet() { - return true - } - - return false -} - -// SetHeadersTemplate gets a reference to the given NullableString and assigns it to the HeadersTemplate field. -func (o *WebhookRepresentation) SetHeadersTemplate(v string) { - o.HeadersTemplate.Set(&v) -} -// SetHeadersTemplateNil sets the value for HeadersTemplate to be an explicit nil -func (o *WebhookRepresentation) SetHeadersTemplateNil() { - o.HeadersTemplate.Set(nil) -} - -// UnsetHeadersTemplate ensures that no value is present for HeadersTemplate, not even an explicit nil -func (o *WebhookRepresentation) UnsetHeadersTemplate() { - o.HeadersTemplate.Unset() -} - -// GetShouldInterpolateStrings returns the ShouldInterpolateStrings field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *WebhookRepresentation) GetShouldInterpolateStrings() bool { - if o == nil || IsNil(o.ShouldInterpolateStrings.Get()) { - var ret bool - return ret - } - return *o.ShouldInterpolateStrings.Get() -} - -// GetShouldInterpolateStringsOk returns a tuple with the ShouldInterpolateStrings field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *WebhookRepresentation) GetShouldInterpolateStringsOk() (*bool, bool) { - if o == nil { - return nil, false - } - return o.ShouldInterpolateStrings.Get(), o.ShouldInterpolateStrings.IsSet() -} - -// HasShouldInterpolateStrings returns a boolean if a field has been set. -func (o *WebhookRepresentation) HasShouldInterpolateStrings() bool { - if o != nil && o.ShouldInterpolateStrings.IsSet() { - return true - } - - return false -} - -// SetShouldInterpolateStrings gets a reference to the given NullableBool and assigns it to the ShouldInterpolateStrings field. -func (o *WebhookRepresentation) SetShouldInterpolateStrings(v bool) { - o.ShouldInterpolateStrings.Set(&v) -} -// SetShouldInterpolateStringsNil sets the value for ShouldInterpolateStrings to be an explicit nil -func (o *WebhookRepresentation) SetShouldInterpolateStringsNil() { - o.ShouldInterpolateStrings.Set(nil) -} - -// UnsetShouldInterpolateStrings ensures that no value is present for ShouldInterpolateStrings, not even an explicit nil -func (o *WebhookRepresentation) UnsetShouldInterpolateStrings() { - o.ShouldInterpolateStrings.Unset() -} - -// GetIdempotencyKey returns the IdempotencyKey field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *WebhookRepresentation) GetIdempotencyKey() string { - if o == nil || IsNil(o.IdempotencyKey.Get()) { - var ret string - return ret - } - return *o.IdempotencyKey.Get() -} - -// GetIdempotencyKeyOk returns a tuple with the IdempotencyKey field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *WebhookRepresentation) GetIdempotencyKeyOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.IdempotencyKey.Get(), o.IdempotencyKey.IsSet() -} - -// HasIdempotencyKey returns a boolean if a field has been set. -func (o *WebhookRepresentation) HasIdempotencyKey() bool { - if o != nil && o.IdempotencyKey.IsSet() { - return true - } - - return false -} - -// SetIdempotencyKey gets a reference to the given NullableString and assigns it to the IdempotencyKey field. -func (o *WebhookRepresentation) SetIdempotencyKey(v string) { - o.IdempotencyKey.Set(&v) -} -// SetIdempotencyKeyNil sets the value for IdempotencyKey to be an explicit nil -func (o *WebhookRepresentation) SetIdempotencyKeyNil() { - o.IdempotencyKey.Set(nil) -} - -// UnsetIdempotencyKey ensures that no value is present for IdempotencyKey, not even an explicit nil -func (o *WebhookRepresentation) UnsetIdempotencyKey() { - o.IdempotencyKey.Unset() -} - -// GetIgnoreSslErrors returns the IgnoreSslErrors field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *WebhookRepresentation) GetIgnoreSslErrors() bool { - if o == nil || IsNil(o.IgnoreSslErrors.Get()) { - var ret bool - return ret - } - return *o.IgnoreSslErrors.Get() -} - -// GetIgnoreSslErrorsOk returns a tuple with the IgnoreSslErrors field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *WebhookRepresentation) GetIgnoreSslErrorsOk() (*bool, bool) { - if o == nil { - return nil, false - } - return o.IgnoreSslErrors.Get(), o.IgnoreSslErrors.IsSet() -} - -// HasIgnoreSslErrors returns a boolean if a field has been set. -func (o *WebhookRepresentation) HasIgnoreSslErrors() bool { - if o != nil && o.IgnoreSslErrors.IsSet() { - return true - } - - return false -} - -// SetIgnoreSslErrors gets a reference to the given NullableBool and assigns it to the IgnoreSslErrors field. -func (o *WebhookRepresentation) SetIgnoreSslErrors(v bool) { - o.IgnoreSslErrors.Set(&v) -} -// SetIgnoreSslErrorsNil sets the value for IgnoreSslErrors to be an explicit nil -func (o *WebhookRepresentation) SetIgnoreSslErrorsNil() { - o.IgnoreSslErrors.Set(nil) -} - -// UnsetIgnoreSslErrors ensures that no value is present for IgnoreSslErrors, not even an explicit nil -func (o *WebhookRepresentation) UnsetIgnoreSslErrors() { - o.IgnoreSslErrors.Unset() -} - -// GetDoNotRetry returns the DoNotRetry field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *WebhookRepresentation) GetDoNotRetry() bool { - if o == nil || IsNil(o.DoNotRetry.Get()) { - var ret bool - return ret - } - return *o.DoNotRetry.Get() -} - -// GetDoNotRetryOk returns a tuple with the DoNotRetry field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *WebhookRepresentation) GetDoNotRetryOk() (*bool, bool) { - if o == nil { - return nil, false - } - return o.DoNotRetry.Get(), o.DoNotRetry.IsSet() -} - -// HasDoNotRetry returns a boolean if a field has been set. -func (o *WebhookRepresentation) HasDoNotRetry() bool { - if o != nil && o.DoNotRetry.IsSet() { - return true - } - - return false -} - -// SetDoNotRetry gets a reference to the given NullableBool and assigns it to the DoNotRetry field. -func (o *WebhookRepresentation) SetDoNotRetry(v bool) { - o.DoNotRetry.Set(&v) -} -// SetDoNotRetryNil sets the value for DoNotRetry to be an explicit nil -func (o *WebhookRepresentation) SetDoNotRetryNil() { - o.DoNotRetry.Set(nil) -} - -// UnsetDoNotRetry ensures that no value is present for DoNotRetry, not even an explicit nil -func (o *WebhookRepresentation) UnsetDoNotRetry() { - o.DoNotRetry.Unset() -} - -func (o WebhookRepresentation) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o WebhookRepresentation) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["eventTypes"] = o.EventTypes - toSerialize["requestUrl"] = o.RequestUrl - if o.PayloadTemplate.IsSet() { - toSerialize["payloadTemplate"] = o.PayloadTemplate.Get() - } - if o.HeadersTemplate.IsSet() { - toSerialize["headersTemplate"] = o.HeadersTemplate.Get() - } - if o.ShouldInterpolateStrings.IsSet() { - toSerialize["shouldInterpolateStrings"] = o.ShouldInterpolateStrings.Get() - } - if o.IdempotencyKey.IsSet() { - toSerialize["idempotencyKey"] = o.IdempotencyKey.Get() - } - if o.IgnoreSslErrors.IsSet() { - toSerialize["ignoreSslErrors"] = o.IgnoreSslErrors.Get() - } - if o.DoNotRetry.IsSet() { - toSerialize["doNotRetry"] = o.DoNotRetry.Get() - } - return toSerialize, nil -} - -func (o *WebhookRepresentation) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "eventTypes", - "requestUrl", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err; - } - - for _, requiredProperty := range(requiredProperties) { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varWebhookRepresentation := _WebhookRepresentation{} - - decoder := json.NewDecoder(bytes.NewReader(data)) - decoder.DisallowUnknownFields() - err = decoder.Decode(&varWebhookRepresentation) - - if err != nil { - return err - } - - *o = WebhookRepresentation(varWebhookRepresentation) - - return err -} - -type NullableWebhookRepresentation struct { - value *WebhookRepresentation - isSet bool -} - -func (v NullableWebhookRepresentation) Get() *WebhookRepresentation { - return v.value -} - -func (v *NullableWebhookRepresentation) Set(val *WebhookRepresentation) { - v.value = val - v.isSet = true -} - -func (v NullableWebhookRepresentation) IsSet() bool { - return v.isSet -} - -func (v *NullableWebhookRepresentation) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableWebhookRepresentation(val *WebhookRepresentation) *NullableWebhookRepresentation { - return &NullableWebhookRepresentation{value: val, isSet: true} -} - -func (v NullableWebhookRepresentation) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableWebhookRepresentation) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_webhook_response.go b/model_webhook_response.go deleted file mode 100644 index ae5a74d..0000000 --- a/model_webhook_response.go +++ /dev/null @@ -1,158 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" - "bytes" - "fmt" -) - -// checks if the WebhookResponse type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &WebhookResponse{} - -// WebhookResponse Response containing webhook data. -type WebhookResponse struct { - Data Webhook `json:"data"` -} - -type _WebhookResponse WebhookResponse - -// NewWebhookResponse instantiates a new WebhookResponse object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewWebhookResponse(data Webhook) *WebhookResponse { - this := WebhookResponse{} - this.Data = data - return &this -} - -// NewWebhookResponseWithDefaults instantiates a new WebhookResponse object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewWebhookResponseWithDefaults() *WebhookResponse { - this := WebhookResponse{} - return &this -} - -// GetData returns the Data field value -func (o *WebhookResponse) GetData() Webhook { - if o == nil { - var ret Webhook - return ret - } - - return o.Data -} - -// GetDataOk returns a tuple with the Data field value -// and a boolean to check if the value has been set. -func (o *WebhookResponse) GetDataOk() (*Webhook, bool) { - if o == nil { - return nil, false - } - return &o.Data, true -} - -// SetData sets field value -func (o *WebhookResponse) SetData(v Webhook) { - o.Data = v -} - -func (o WebhookResponse) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o WebhookResponse) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["data"] = o.Data - return toSerialize, nil -} - -func (o *WebhookResponse) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "data", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err; - } - - for _, requiredProperty := range(requiredProperties) { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varWebhookResponse := _WebhookResponse{} - - decoder := json.NewDecoder(bytes.NewReader(data)) - decoder.DisallowUnknownFields() - err = decoder.Decode(&varWebhookResponse) - - if err != nil { - return err - } - - *o = WebhookResponse(varWebhookResponse) - - return err -} - -type NullableWebhookResponse struct { - value *WebhookResponse - isSet bool -} - -func (v NullableWebhookResponse) Get() *WebhookResponse { - return v.value -} - -func (v *NullableWebhookResponse) Set(val *WebhookResponse) { - v.value = val - v.isSet = true -} - -func (v NullableWebhookResponse) IsSet() bool { - return v.isSet -} - -func (v *NullableWebhookResponse) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableWebhookResponse(val *WebhookResponse) *NullableWebhookResponse { - return &NullableWebhookResponse{value: val, isSet: true} -} - -func (v NullableWebhookResponse) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableWebhookResponse) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_webhook_short.go b/model_webhook_short.go deleted file mode 100644 index 5f65b7a..0000000 --- a/model_webhook_short.go +++ /dev/null @@ -1,675 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" - "time" - "bytes" - "fmt" -) - -// checks if the WebhookShort type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &WebhookShort{} - -// WebhookShort struct for WebhookShort -type WebhookShort struct { - Id string `json:"id"` - CreatedAt time.Time `json:"createdAt"` - ModifiedAt time.Time `json:"modifiedAt"` - UserId string `json:"userId"` - IsAdHoc NullableBool `json:"isAdHoc,omitempty"` - IsApifyIntegration *bool `json:"isApifyIntegration,omitempty"` - IsEnabled *bool `json:"isEnabled,omitempty"` - ActionType *string `json:"actionType,omitempty"` - ShouldInterpolateStrings NullableBool `json:"shouldInterpolateStrings,omitempty"` - EventTypes []WebhookEventType `json:"eventTypes"` - Condition WebhookCondition `json:"condition"` - IgnoreSslErrors bool `json:"ignoreSslErrors"` - DoNotRetry bool `json:"doNotRetry"` - RequestUrl string `json:"requestUrl"` - LastDispatch NullableExampleWebhookDispatch `json:"lastDispatch,omitempty"` - Stats NullableWebhookStats `json:"stats,omitempty"` -} - -type _WebhookShort WebhookShort - -// NewWebhookShort instantiates a new WebhookShort object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewWebhookShort(id string, createdAt time.Time, modifiedAt time.Time, userId string, eventTypes []WebhookEventType, condition WebhookCondition, ignoreSslErrors bool, doNotRetry bool, requestUrl string) *WebhookShort { - this := WebhookShort{} - this.Id = id - this.CreatedAt = createdAt - this.ModifiedAt = modifiedAt - this.UserId = userId - this.EventTypes = eventTypes - this.Condition = condition - this.IgnoreSslErrors = ignoreSslErrors - this.DoNotRetry = doNotRetry - this.RequestUrl = requestUrl - return &this -} - -// NewWebhookShortWithDefaults instantiates a new WebhookShort object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewWebhookShortWithDefaults() *WebhookShort { - this := WebhookShort{} - return &this -} - -// GetId returns the Id field value -func (o *WebhookShort) GetId() string { - if o == nil { - var ret string - return ret - } - - return o.Id -} - -// GetIdOk returns a tuple with the Id field value -// and a boolean to check if the value has been set. -func (o *WebhookShort) GetIdOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Id, true -} - -// SetId sets field value -func (o *WebhookShort) SetId(v string) { - o.Id = v -} - -// GetCreatedAt returns the CreatedAt field value -func (o *WebhookShort) GetCreatedAt() time.Time { - if o == nil { - var ret time.Time - return ret - } - - return o.CreatedAt -} - -// GetCreatedAtOk returns a tuple with the CreatedAt field value -// and a boolean to check if the value has been set. -func (o *WebhookShort) GetCreatedAtOk() (*time.Time, bool) { - if o == nil { - return nil, false - } - return &o.CreatedAt, true -} - -// SetCreatedAt sets field value -func (o *WebhookShort) SetCreatedAt(v time.Time) { - o.CreatedAt = v -} - -// GetModifiedAt returns the ModifiedAt field value -func (o *WebhookShort) GetModifiedAt() time.Time { - if o == nil { - var ret time.Time - return ret - } - - return o.ModifiedAt -} - -// GetModifiedAtOk returns a tuple with the ModifiedAt field value -// and a boolean to check if the value has been set. -func (o *WebhookShort) GetModifiedAtOk() (*time.Time, bool) { - if o == nil { - return nil, false - } - return &o.ModifiedAt, true -} - -// SetModifiedAt sets field value -func (o *WebhookShort) SetModifiedAt(v time.Time) { - o.ModifiedAt = v -} - -// GetUserId returns the UserId field value -func (o *WebhookShort) GetUserId() string { - if o == nil { - var ret string - return ret - } - - return o.UserId -} - -// GetUserIdOk returns a tuple with the UserId field value -// and a boolean to check if the value has been set. -func (o *WebhookShort) GetUserIdOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.UserId, true -} - -// SetUserId sets field value -func (o *WebhookShort) SetUserId(v string) { - o.UserId = v -} - -// GetIsAdHoc returns the IsAdHoc field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *WebhookShort) GetIsAdHoc() bool { - if o == nil || IsNil(o.IsAdHoc.Get()) { - var ret bool - return ret - } - return *o.IsAdHoc.Get() -} - -// GetIsAdHocOk returns a tuple with the IsAdHoc field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *WebhookShort) GetIsAdHocOk() (*bool, bool) { - if o == nil { - return nil, false - } - return o.IsAdHoc.Get(), o.IsAdHoc.IsSet() -} - -// HasIsAdHoc returns a boolean if a field has been set. -func (o *WebhookShort) HasIsAdHoc() bool { - if o != nil && o.IsAdHoc.IsSet() { - return true - } - - return false -} - -// SetIsAdHoc gets a reference to the given NullableBool and assigns it to the IsAdHoc field. -func (o *WebhookShort) SetIsAdHoc(v bool) { - o.IsAdHoc.Set(&v) -} -// SetIsAdHocNil sets the value for IsAdHoc to be an explicit nil -func (o *WebhookShort) SetIsAdHocNil() { - o.IsAdHoc.Set(nil) -} - -// UnsetIsAdHoc ensures that no value is present for IsAdHoc, not even an explicit nil -func (o *WebhookShort) UnsetIsAdHoc() { - o.IsAdHoc.Unset() -} - -// GetIsApifyIntegration returns the IsApifyIntegration field value if set, zero value otherwise. -func (o *WebhookShort) GetIsApifyIntegration() bool { - if o == nil || IsNil(o.IsApifyIntegration) { - var ret bool - return ret - } - return *o.IsApifyIntegration -} - -// GetIsApifyIntegrationOk returns a tuple with the IsApifyIntegration field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *WebhookShort) GetIsApifyIntegrationOk() (*bool, bool) { - if o == nil || IsNil(o.IsApifyIntegration) { - return nil, false - } - return o.IsApifyIntegration, true -} - -// HasIsApifyIntegration returns a boolean if a field has been set. -func (o *WebhookShort) HasIsApifyIntegration() bool { - if o != nil && !IsNil(o.IsApifyIntegration) { - return true - } - - return false -} - -// SetIsApifyIntegration gets a reference to the given bool and assigns it to the IsApifyIntegration field. -func (o *WebhookShort) SetIsApifyIntegration(v bool) { - o.IsApifyIntegration = &v -} - -// GetIsEnabled returns the IsEnabled field value if set, zero value otherwise. -func (o *WebhookShort) GetIsEnabled() bool { - if o == nil || IsNil(o.IsEnabled) { - var ret bool - return ret - } - return *o.IsEnabled -} - -// GetIsEnabledOk returns a tuple with the IsEnabled field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *WebhookShort) GetIsEnabledOk() (*bool, bool) { - if o == nil || IsNil(o.IsEnabled) { - return nil, false - } - return o.IsEnabled, true -} - -// HasIsEnabled returns a boolean if a field has been set. -func (o *WebhookShort) HasIsEnabled() bool { - if o != nil && !IsNil(o.IsEnabled) { - return true - } - - return false -} - -// SetIsEnabled gets a reference to the given bool and assigns it to the IsEnabled field. -func (o *WebhookShort) SetIsEnabled(v bool) { - o.IsEnabled = &v -} - -// GetActionType returns the ActionType field value if set, zero value otherwise. -func (o *WebhookShort) GetActionType() string { - if o == nil || IsNil(o.ActionType) { - var ret string - return ret - } - return *o.ActionType -} - -// GetActionTypeOk returns a tuple with the ActionType field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *WebhookShort) GetActionTypeOk() (*string, bool) { - if o == nil || IsNil(o.ActionType) { - return nil, false - } - return o.ActionType, true -} - -// HasActionType returns a boolean if a field has been set. -func (o *WebhookShort) HasActionType() bool { - if o != nil && !IsNil(o.ActionType) { - return true - } - - return false -} - -// SetActionType gets a reference to the given string and assigns it to the ActionType field. -func (o *WebhookShort) SetActionType(v string) { - o.ActionType = &v -} - -// GetShouldInterpolateStrings returns the ShouldInterpolateStrings field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *WebhookShort) GetShouldInterpolateStrings() bool { - if o == nil || IsNil(o.ShouldInterpolateStrings.Get()) { - var ret bool - return ret - } - return *o.ShouldInterpolateStrings.Get() -} - -// GetShouldInterpolateStringsOk returns a tuple with the ShouldInterpolateStrings field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *WebhookShort) GetShouldInterpolateStringsOk() (*bool, bool) { - if o == nil { - return nil, false - } - return o.ShouldInterpolateStrings.Get(), o.ShouldInterpolateStrings.IsSet() -} - -// HasShouldInterpolateStrings returns a boolean if a field has been set. -func (o *WebhookShort) HasShouldInterpolateStrings() bool { - if o != nil && o.ShouldInterpolateStrings.IsSet() { - return true - } - - return false -} - -// SetShouldInterpolateStrings gets a reference to the given NullableBool and assigns it to the ShouldInterpolateStrings field. -func (o *WebhookShort) SetShouldInterpolateStrings(v bool) { - o.ShouldInterpolateStrings.Set(&v) -} -// SetShouldInterpolateStringsNil sets the value for ShouldInterpolateStrings to be an explicit nil -func (o *WebhookShort) SetShouldInterpolateStringsNil() { - o.ShouldInterpolateStrings.Set(nil) -} - -// UnsetShouldInterpolateStrings ensures that no value is present for ShouldInterpolateStrings, not even an explicit nil -func (o *WebhookShort) UnsetShouldInterpolateStrings() { - o.ShouldInterpolateStrings.Unset() -} - -// GetEventTypes returns the EventTypes field value -func (o *WebhookShort) GetEventTypes() []WebhookEventType { - if o == nil { - var ret []WebhookEventType - return ret - } - - return o.EventTypes -} - -// GetEventTypesOk returns a tuple with the EventTypes field value -// and a boolean to check if the value has been set. -func (o *WebhookShort) GetEventTypesOk() ([]WebhookEventType, bool) { - if o == nil { - return nil, false - } - return o.EventTypes, true -} - -// SetEventTypes sets field value -func (o *WebhookShort) SetEventTypes(v []WebhookEventType) { - o.EventTypes = v -} - -// GetCondition returns the Condition field value -func (o *WebhookShort) GetCondition() WebhookCondition { - if o == nil { - var ret WebhookCondition - return ret - } - - return o.Condition -} - -// GetConditionOk returns a tuple with the Condition field value -// and a boolean to check if the value has been set. -func (o *WebhookShort) GetConditionOk() (*WebhookCondition, bool) { - if o == nil { - return nil, false - } - return &o.Condition, true -} - -// SetCondition sets field value -func (o *WebhookShort) SetCondition(v WebhookCondition) { - o.Condition = v -} - -// GetIgnoreSslErrors returns the IgnoreSslErrors field value -func (o *WebhookShort) GetIgnoreSslErrors() bool { - if o == nil { - var ret bool - return ret - } - - return o.IgnoreSslErrors -} - -// GetIgnoreSslErrorsOk returns a tuple with the IgnoreSslErrors field value -// and a boolean to check if the value has been set. -func (o *WebhookShort) GetIgnoreSslErrorsOk() (*bool, bool) { - if o == nil { - return nil, false - } - return &o.IgnoreSslErrors, true -} - -// SetIgnoreSslErrors sets field value -func (o *WebhookShort) SetIgnoreSslErrors(v bool) { - o.IgnoreSslErrors = v -} - -// GetDoNotRetry returns the DoNotRetry field value -func (o *WebhookShort) GetDoNotRetry() bool { - if o == nil { - var ret bool - return ret - } - - return o.DoNotRetry -} - -// GetDoNotRetryOk returns a tuple with the DoNotRetry field value -// and a boolean to check if the value has been set. -func (o *WebhookShort) GetDoNotRetryOk() (*bool, bool) { - if o == nil { - return nil, false - } - return &o.DoNotRetry, true -} - -// SetDoNotRetry sets field value -func (o *WebhookShort) SetDoNotRetry(v bool) { - o.DoNotRetry = v -} - -// GetRequestUrl returns the RequestUrl field value -func (o *WebhookShort) GetRequestUrl() string { - if o == nil { - var ret string - return ret - } - - return o.RequestUrl -} - -// GetRequestUrlOk returns a tuple with the RequestUrl field value -// and a boolean to check if the value has been set. -func (o *WebhookShort) GetRequestUrlOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.RequestUrl, true -} - -// SetRequestUrl sets field value -func (o *WebhookShort) SetRequestUrl(v string) { - o.RequestUrl = v -} - -// GetLastDispatch returns the LastDispatch field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *WebhookShort) GetLastDispatch() ExampleWebhookDispatch { - if o == nil || IsNil(o.LastDispatch.Get()) { - var ret ExampleWebhookDispatch - return ret - } - return *o.LastDispatch.Get() -} - -// GetLastDispatchOk returns a tuple with the LastDispatch field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *WebhookShort) GetLastDispatchOk() (*ExampleWebhookDispatch, bool) { - if o == nil { - return nil, false - } - return o.LastDispatch.Get(), o.LastDispatch.IsSet() -} - -// HasLastDispatch returns a boolean if a field has been set. -func (o *WebhookShort) HasLastDispatch() bool { - if o != nil && o.LastDispatch.IsSet() { - return true - } - - return false -} - -// SetLastDispatch gets a reference to the given NullableExampleWebhookDispatch and assigns it to the LastDispatch field. -func (o *WebhookShort) SetLastDispatch(v ExampleWebhookDispatch) { - o.LastDispatch.Set(&v) -} -// SetLastDispatchNil sets the value for LastDispatch to be an explicit nil -func (o *WebhookShort) SetLastDispatchNil() { - o.LastDispatch.Set(nil) -} - -// UnsetLastDispatch ensures that no value is present for LastDispatch, not even an explicit nil -func (o *WebhookShort) UnsetLastDispatch() { - o.LastDispatch.Unset() -} - -// GetStats returns the Stats field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *WebhookShort) GetStats() WebhookStats { - if o == nil || IsNil(o.Stats.Get()) { - var ret WebhookStats - return ret - } - return *o.Stats.Get() -} - -// GetStatsOk returns a tuple with the Stats field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *WebhookShort) GetStatsOk() (*WebhookStats, bool) { - if o == nil { - return nil, false - } - return o.Stats.Get(), o.Stats.IsSet() -} - -// HasStats returns a boolean if a field has been set. -func (o *WebhookShort) HasStats() bool { - if o != nil && o.Stats.IsSet() { - return true - } - - return false -} - -// SetStats gets a reference to the given NullableWebhookStats and assigns it to the Stats field. -func (o *WebhookShort) SetStats(v WebhookStats) { - o.Stats.Set(&v) -} -// SetStatsNil sets the value for Stats to be an explicit nil -func (o *WebhookShort) SetStatsNil() { - o.Stats.Set(nil) -} - -// UnsetStats ensures that no value is present for Stats, not even an explicit nil -func (o *WebhookShort) UnsetStats() { - o.Stats.Unset() -} - -func (o WebhookShort) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o WebhookShort) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["id"] = o.Id - toSerialize["createdAt"] = o.CreatedAt - toSerialize["modifiedAt"] = o.ModifiedAt - toSerialize["userId"] = o.UserId - if o.IsAdHoc.IsSet() { - toSerialize["isAdHoc"] = o.IsAdHoc.Get() - } - if !IsNil(o.IsApifyIntegration) { - toSerialize["isApifyIntegration"] = o.IsApifyIntegration - } - if !IsNil(o.IsEnabled) { - toSerialize["isEnabled"] = o.IsEnabled - } - if !IsNil(o.ActionType) { - toSerialize["actionType"] = o.ActionType - } - if o.ShouldInterpolateStrings.IsSet() { - toSerialize["shouldInterpolateStrings"] = o.ShouldInterpolateStrings.Get() - } - toSerialize["eventTypes"] = o.EventTypes - toSerialize["condition"] = o.Condition - toSerialize["ignoreSslErrors"] = o.IgnoreSslErrors - toSerialize["doNotRetry"] = o.DoNotRetry - toSerialize["requestUrl"] = o.RequestUrl - if o.LastDispatch.IsSet() { - toSerialize["lastDispatch"] = o.LastDispatch.Get() - } - if o.Stats.IsSet() { - toSerialize["stats"] = o.Stats.Get() - } - return toSerialize, nil -} - -func (o *WebhookShort) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "id", - "createdAt", - "modifiedAt", - "userId", - "eventTypes", - "condition", - "ignoreSslErrors", - "doNotRetry", - "requestUrl", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err; - } - - for _, requiredProperty := range(requiredProperties) { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varWebhookShort := _WebhookShort{} - - decoder := json.NewDecoder(bytes.NewReader(data)) - decoder.DisallowUnknownFields() - err = decoder.Decode(&varWebhookShort) - - if err != nil { - return err - } - - *o = WebhookShort(varWebhookShort) - - return err -} - -type NullableWebhookShort struct { - value *WebhookShort - isSet bool -} - -func (v NullableWebhookShort) Get() *WebhookShort { - return v.value -} - -func (v *NullableWebhookShort) Set(val *WebhookShort) { - v.value = val - v.isSet = true -} - -func (v NullableWebhookShort) IsSet() bool { - return v.isSet -} - -func (v *NullableWebhookShort) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableWebhookShort(val *WebhookShort) *NullableWebhookShort { - return &NullableWebhookShort{value: val, isSet: true} -} - -func (v NullableWebhookShort) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableWebhookShort) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_webhook_stats.go b/model_webhook_stats.go deleted file mode 100644 index 02de22c..0000000 --- a/model_webhook_stats.go +++ /dev/null @@ -1,158 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" - "bytes" - "fmt" -) - -// checks if the WebhookStats type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &WebhookStats{} - -// WebhookStats struct for WebhookStats -type WebhookStats struct { - TotalDispatches int32 `json:"totalDispatches"` -} - -type _WebhookStats WebhookStats - -// NewWebhookStats instantiates a new WebhookStats object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewWebhookStats(totalDispatches int32) *WebhookStats { - this := WebhookStats{} - this.TotalDispatches = totalDispatches - return &this -} - -// NewWebhookStatsWithDefaults instantiates a new WebhookStats object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewWebhookStatsWithDefaults() *WebhookStats { - this := WebhookStats{} - return &this -} - -// GetTotalDispatches returns the TotalDispatches field value -func (o *WebhookStats) GetTotalDispatches() int32 { - if o == nil { - var ret int32 - return ret - } - - return o.TotalDispatches -} - -// GetTotalDispatchesOk returns a tuple with the TotalDispatches field value -// and a boolean to check if the value has been set. -func (o *WebhookStats) GetTotalDispatchesOk() (*int32, bool) { - if o == nil { - return nil, false - } - return &o.TotalDispatches, true -} - -// SetTotalDispatches sets field value -func (o *WebhookStats) SetTotalDispatches(v int32) { - o.TotalDispatches = v -} - -func (o WebhookStats) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o WebhookStats) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["totalDispatches"] = o.TotalDispatches - return toSerialize, nil -} - -func (o *WebhookStats) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "totalDispatches", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err; - } - - for _, requiredProperty := range(requiredProperties) { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varWebhookStats := _WebhookStats{} - - decoder := json.NewDecoder(bytes.NewReader(data)) - decoder.DisallowUnknownFields() - err = decoder.Decode(&varWebhookStats) - - if err != nil { - return err - } - - *o = WebhookStats(varWebhookStats) - - return err -} - -type NullableWebhookStats struct { - value *WebhookStats - isSet bool -} - -func (v NullableWebhookStats) Get() *WebhookStats { - return v.value -} - -func (v *NullableWebhookStats) Set(val *WebhookStats) { - v.value = val - v.isSet = true -} - -func (v NullableWebhookStats) IsSet() bool { - return v.isSet -} - -func (v *NullableWebhookStats) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableWebhookStats(val *WebhookStats) *NullableWebhookStats { - return &NullableWebhookStats{value: val, isSet: true} -} - -func (v NullableWebhookStats) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableWebhookStats) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/model_webhook_update.go b/model_webhook_update.go deleted file mode 100644 index 3659609..0000000 --- a/model_webhook_update.go +++ /dev/null @@ -1,542 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "encoding/json" -) - -// checks if the WebhookUpdate type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &WebhookUpdate{} - -// WebhookUpdate struct for WebhookUpdate -type WebhookUpdate struct { - IsAdHoc NullableBool `json:"isAdHoc,omitempty"` - // - EventTypes []WebhookEventType `json:"eventTypes,omitempty"` - Condition NullableWebhookCondition `json:"condition,omitempty"` - IgnoreSslErrors NullableBool `json:"ignoreSslErrors,omitempty"` - DoNotRetry NullableBool `json:"doNotRetry,omitempty"` - RequestUrl NullableString `json:"requestUrl,omitempty"` - PayloadTemplate NullableString `json:"payloadTemplate,omitempty"` - HeadersTemplate NullableString `json:"headersTemplate,omitempty"` - Description NullableString `json:"description,omitempty"` - ShouldInterpolateStrings NullableBool `json:"shouldInterpolateStrings,omitempty"` -} - -// NewWebhookUpdate instantiates a new WebhookUpdate object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewWebhookUpdate() *WebhookUpdate { - this := WebhookUpdate{} - return &this -} - -// NewWebhookUpdateWithDefaults instantiates a new WebhookUpdate object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewWebhookUpdateWithDefaults() *WebhookUpdate { - this := WebhookUpdate{} - return &this -} - -// GetIsAdHoc returns the IsAdHoc field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *WebhookUpdate) GetIsAdHoc() bool { - if o == nil || IsNil(o.IsAdHoc.Get()) { - var ret bool - return ret - } - return *o.IsAdHoc.Get() -} - -// GetIsAdHocOk returns a tuple with the IsAdHoc field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *WebhookUpdate) GetIsAdHocOk() (*bool, bool) { - if o == nil { - return nil, false - } - return o.IsAdHoc.Get(), o.IsAdHoc.IsSet() -} - -// HasIsAdHoc returns a boolean if a field has been set. -func (o *WebhookUpdate) HasIsAdHoc() bool { - if o != nil && o.IsAdHoc.IsSet() { - return true - } - - return false -} - -// SetIsAdHoc gets a reference to the given NullableBool and assigns it to the IsAdHoc field. -func (o *WebhookUpdate) SetIsAdHoc(v bool) { - o.IsAdHoc.Set(&v) -} -// SetIsAdHocNil sets the value for IsAdHoc to be an explicit nil -func (o *WebhookUpdate) SetIsAdHocNil() { - o.IsAdHoc.Set(nil) -} - -// UnsetIsAdHoc ensures that no value is present for IsAdHoc, not even an explicit nil -func (o *WebhookUpdate) UnsetIsAdHoc() { - o.IsAdHoc.Unset() -} - -// GetEventTypes returns the EventTypes field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *WebhookUpdate) GetEventTypes() []WebhookEventType { - if o == nil { - var ret []WebhookEventType - return ret - } - return o.EventTypes -} - -// GetEventTypesOk returns a tuple with the EventTypes field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *WebhookUpdate) GetEventTypesOk() ([]WebhookEventType, bool) { - if o == nil || IsNil(o.EventTypes) { - return nil, false - } - return o.EventTypes, true -} - -// HasEventTypes returns a boolean if a field has been set. -func (o *WebhookUpdate) HasEventTypes() bool { - if o != nil && !IsNil(o.EventTypes) { - return true - } - - return false -} - -// SetEventTypes gets a reference to the given []WebhookEventType and assigns it to the EventTypes field. -func (o *WebhookUpdate) SetEventTypes(v []WebhookEventType) { - o.EventTypes = v -} - -// GetCondition returns the Condition field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *WebhookUpdate) GetCondition() WebhookCondition { - if o == nil || IsNil(o.Condition.Get()) { - var ret WebhookCondition - return ret - } - return *o.Condition.Get() -} - -// GetConditionOk returns a tuple with the Condition field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *WebhookUpdate) GetConditionOk() (*WebhookCondition, bool) { - if o == nil { - return nil, false - } - return o.Condition.Get(), o.Condition.IsSet() -} - -// HasCondition returns a boolean if a field has been set. -func (o *WebhookUpdate) HasCondition() bool { - if o != nil && o.Condition.IsSet() { - return true - } - - return false -} - -// SetCondition gets a reference to the given NullableWebhookCondition and assigns it to the Condition field. -func (o *WebhookUpdate) SetCondition(v WebhookCondition) { - o.Condition.Set(&v) -} -// SetConditionNil sets the value for Condition to be an explicit nil -func (o *WebhookUpdate) SetConditionNil() { - o.Condition.Set(nil) -} - -// UnsetCondition ensures that no value is present for Condition, not even an explicit nil -func (o *WebhookUpdate) UnsetCondition() { - o.Condition.Unset() -} - -// GetIgnoreSslErrors returns the IgnoreSslErrors field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *WebhookUpdate) GetIgnoreSslErrors() bool { - if o == nil || IsNil(o.IgnoreSslErrors.Get()) { - var ret bool - return ret - } - return *o.IgnoreSslErrors.Get() -} - -// GetIgnoreSslErrorsOk returns a tuple with the IgnoreSslErrors field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *WebhookUpdate) GetIgnoreSslErrorsOk() (*bool, bool) { - if o == nil { - return nil, false - } - return o.IgnoreSslErrors.Get(), o.IgnoreSslErrors.IsSet() -} - -// HasIgnoreSslErrors returns a boolean if a field has been set. -func (o *WebhookUpdate) HasIgnoreSslErrors() bool { - if o != nil && o.IgnoreSslErrors.IsSet() { - return true - } - - return false -} - -// SetIgnoreSslErrors gets a reference to the given NullableBool and assigns it to the IgnoreSslErrors field. -func (o *WebhookUpdate) SetIgnoreSslErrors(v bool) { - o.IgnoreSslErrors.Set(&v) -} -// SetIgnoreSslErrorsNil sets the value for IgnoreSslErrors to be an explicit nil -func (o *WebhookUpdate) SetIgnoreSslErrorsNil() { - o.IgnoreSslErrors.Set(nil) -} - -// UnsetIgnoreSslErrors ensures that no value is present for IgnoreSslErrors, not even an explicit nil -func (o *WebhookUpdate) UnsetIgnoreSslErrors() { - o.IgnoreSslErrors.Unset() -} - -// GetDoNotRetry returns the DoNotRetry field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *WebhookUpdate) GetDoNotRetry() bool { - if o == nil || IsNil(o.DoNotRetry.Get()) { - var ret bool - return ret - } - return *o.DoNotRetry.Get() -} - -// GetDoNotRetryOk returns a tuple with the DoNotRetry field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *WebhookUpdate) GetDoNotRetryOk() (*bool, bool) { - if o == nil { - return nil, false - } - return o.DoNotRetry.Get(), o.DoNotRetry.IsSet() -} - -// HasDoNotRetry returns a boolean if a field has been set. -func (o *WebhookUpdate) HasDoNotRetry() bool { - if o != nil && o.DoNotRetry.IsSet() { - return true - } - - return false -} - -// SetDoNotRetry gets a reference to the given NullableBool and assigns it to the DoNotRetry field. -func (o *WebhookUpdate) SetDoNotRetry(v bool) { - o.DoNotRetry.Set(&v) -} -// SetDoNotRetryNil sets the value for DoNotRetry to be an explicit nil -func (o *WebhookUpdate) SetDoNotRetryNil() { - o.DoNotRetry.Set(nil) -} - -// UnsetDoNotRetry ensures that no value is present for DoNotRetry, not even an explicit nil -func (o *WebhookUpdate) UnsetDoNotRetry() { - o.DoNotRetry.Unset() -} - -// GetRequestUrl returns the RequestUrl field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *WebhookUpdate) GetRequestUrl() string { - if o == nil || IsNil(o.RequestUrl.Get()) { - var ret string - return ret - } - return *o.RequestUrl.Get() -} - -// GetRequestUrlOk returns a tuple with the RequestUrl field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *WebhookUpdate) GetRequestUrlOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.RequestUrl.Get(), o.RequestUrl.IsSet() -} - -// HasRequestUrl returns a boolean if a field has been set. -func (o *WebhookUpdate) HasRequestUrl() bool { - if o != nil && o.RequestUrl.IsSet() { - return true - } - - return false -} - -// SetRequestUrl gets a reference to the given NullableString and assigns it to the RequestUrl field. -func (o *WebhookUpdate) SetRequestUrl(v string) { - o.RequestUrl.Set(&v) -} -// SetRequestUrlNil sets the value for RequestUrl to be an explicit nil -func (o *WebhookUpdate) SetRequestUrlNil() { - o.RequestUrl.Set(nil) -} - -// UnsetRequestUrl ensures that no value is present for RequestUrl, not even an explicit nil -func (o *WebhookUpdate) UnsetRequestUrl() { - o.RequestUrl.Unset() -} - -// GetPayloadTemplate returns the PayloadTemplate field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *WebhookUpdate) GetPayloadTemplate() string { - if o == nil || IsNil(o.PayloadTemplate.Get()) { - var ret string - return ret - } - return *o.PayloadTemplate.Get() -} - -// GetPayloadTemplateOk returns a tuple with the PayloadTemplate field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *WebhookUpdate) GetPayloadTemplateOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.PayloadTemplate.Get(), o.PayloadTemplate.IsSet() -} - -// HasPayloadTemplate returns a boolean if a field has been set. -func (o *WebhookUpdate) HasPayloadTemplate() bool { - if o != nil && o.PayloadTemplate.IsSet() { - return true - } - - return false -} - -// SetPayloadTemplate gets a reference to the given NullableString and assigns it to the PayloadTemplate field. -func (o *WebhookUpdate) SetPayloadTemplate(v string) { - o.PayloadTemplate.Set(&v) -} -// SetPayloadTemplateNil sets the value for PayloadTemplate to be an explicit nil -func (o *WebhookUpdate) SetPayloadTemplateNil() { - o.PayloadTemplate.Set(nil) -} - -// UnsetPayloadTemplate ensures that no value is present for PayloadTemplate, not even an explicit nil -func (o *WebhookUpdate) UnsetPayloadTemplate() { - o.PayloadTemplate.Unset() -} - -// GetHeadersTemplate returns the HeadersTemplate field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *WebhookUpdate) GetHeadersTemplate() string { - if o == nil || IsNil(o.HeadersTemplate.Get()) { - var ret string - return ret - } - return *o.HeadersTemplate.Get() -} - -// GetHeadersTemplateOk returns a tuple with the HeadersTemplate field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *WebhookUpdate) GetHeadersTemplateOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.HeadersTemplate.Get(), o.HeadersTemplate.IsSet() -} - -// HasHeadersTemplate returns a boolean if a field has been set. -func (o *WebhookUpdate) HasHeadersTemplate() bool { - if o != nil && o.HeadersTemplate.IsSet() { - return true - } - - return false -} - -// SetHeadersTemplate gets a reference to the given NullableString and assigns it to the HeadersTemplate field. -func (o *WebhookUpdate) SetHeadersTemplate(v string) { - o.HeadersTemplate.Set(&v) -} -// SetHeadersTemplateNil sets the value for HeadersTemplate to be an explicit nil -func (o *WebhookUpdate) SetHeadersTemplateNil() { - o.HeadersTemplate.Set(nil) -} - -// UnsetHeadersTemplate ensures that no value is present for HeadersTemplate, not even an explicit nil -func (o *WebhookUpdate) UnsetHeadersTemplate() { - o.HeadersTemplate.Unset() -} - -// GetDescription returns the Description field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *WebhookUpdate) GetDescription() string { - if o == nil || IsNil(o.Description.Get()) { - var ret string - return ret - } - return *o.Description.Get() -} - -// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *WebhookUpdate) GetDescriptionOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.Description.Get(), o.Description.IsSet() -} - -// HasDescription returns a boolean if a field has been set. -func (o *WebhookUpdate) HasDescription() bool { - if o != nil && o.Description.IsSet() { - return true - } - - return false -} - -// SetDescription gets a reference to the given NullableString and assigns it to the Description field. -func (o *WebhookUpdate) SetDescription(v string) { - o.Description.Set(&v) -} -// SetDescriptionNil sets the value for Description to be an explicit nil -func (o *WebhookUpdate) SetDescriptionNil() { - o.Description.Set(nil) -} - -// UnsetDescription ensures that no value is present for Description, not even an explicit nil -func (o *WebhookUpdate) UnsetDescription() { - o.Description.Unset() -} - -// GetShouldInterpolateStrings returns the ShouldInterpolateStrings field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *WebhookUpdate) GetShouldInterpolateStrings() bool { - if o == nil || IsNil(o.ShouldInterpolateStrings.Get()) { - var ret bool - return ret - } - return *o.ShouldInterpolateStrings.Get() -} - -// GetShouldInterpolateStringsOk returns a tuple with the ShouldInterpolateStrings field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *WebhookUpdate) GetShouldInterpolateStringsOk() (*bool, bool) { - if o == nil { - return nil, false - } - return o.ShouldInterpolateStrings.Get(), o.ShouldInterpolateStrings.IsSet() -} - -// HasShouldInterpolateStrings returns a boolean if a field has been set. -func (o *WebhookUpdate) HasShouldInterpolateStrings() bool { - if o != nil && o.ShouldInterpolateStrings.IsSet() { - return true - } - - return false -} - -// SetShouldInterpolateStrings gets a reference to the given NullableBool and assigns it to the ShouldInterpolateStrings field. -func (o *WebhookUpdate) SetShouldInterpolateStrings(v bool) { - o.ShouldInterpolateStrings.Set(&v) -} -// SetShouldInterpolateStringsNil sets the value for ShouldInterpolateStrings to be an explicit nil -func (o *WebhookUpdate) SetShouldInterpolateStringsNil() { - o.ShouldInterpolateStrings.Set(nil) -} - -// UnsetShouldInterpolateStrings ensures that no value is present for ShouldInterpolateStrings, not even an explicit nil -func (o *WebhookUpdate) UnsetShouldInterpolateStrings() { - o.ShouldInterpolateStrings.Unset() -} - -func (o WebhookUpdate) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o WebhookUpdate) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if o.IsAdHoc.IsSet() { - toSerialize["isAdHoc"] = o.IsAdHoc.Get() - } - if o.EventTypes != nil { - toSerialize["eventTypes"] = o.EventTypes - } - if o.Condition.IsSet() { - toSerialize["condition"] = o.Condition.Get() - } - if o.IgnoreSslErrors.IsSet() { - toSerialize["ignoreSslErrors"] = o.IgnoreSslErrors.Get() - } - if o.DoNotRetry.IsSet() { - toSerialize["doNotRetry"] = o.DoNotRetry.Get() - } - if o.RequestUrl.IsSet() { - toSerialize["requestUrl"] = o.RequestUrl.Get() - } - if o.PayloadTemplate.IsSet() { - toSerialize["payloadTemplate"] = o.PayloadTemplate.Get() - } - if o.HeadersTemplate.IsSet() { - toSerialize["headersTemplate"] = o.HeadersTemplate.Get() - } - if o.Description.IsSet() { - toSerialize["description"] = o.Description.Get() - } - if o.ShouldInterpolateStrings.IsSet() { - toSerialize["shouldInterpolateStrings"] = o.ShouldInterpolateStrings.Get() - } - return toSerialize, nil -} - -type NullableWebhookUpdate struct { - value *WebhookUpdate - isSet bool -} - -func (v NullableWebhookUpdate) Get() *WebhookUpdate { - return v.value -} - -func (v *NullableWebhookUpdate) Set(val *WebhookUpdate) { - v.value = val - v.isSet = true -} - -func (v NullableWebhookUpdate) IsSet() bool { - return v.isSet -} - -func (v *NullableWebhookUpdate) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableWebhookUpdate(val *WebhookUpdate) *NullableWebhookUpdate { - return &NullableWebhookUpdate{value: val, isSet: true} -} - -func (v NullableWebhookUpdate) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableWebhookUpdate) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/models.go b/models.go new file mode 100644 index 0000000..ab3a7b7 --- /dev/null +++ b/models.go @@ -0,0 +1,454 @@ +package apify + +import ( + "encoding/json" + "time" +) + +// Extra is the catch-all map of unmodelled JSON fields. Every resource model carries one +// so that additive changes to the API never break deserialization (forward compatibility). +type Extra = map[string]json.RawMessage + +// unmarshalWithExtra unmarshals data into the typed value v (which must be a pointer to a +// struct) and additionally collects any JSON keys not mapped to a struct field into extra. +// +// This gives every model forward compatibility with additive API fields without hand-writing +// an UnmarshalJSON for each one: the model's UnmarshalJSON delegates here. +func unmarshalWithExtra(data []byte, v any, known map[string]struct{}, extra *Extra) error { + // First, unmarshal the typed fields. v must be an alias that does NOT re-enter this + // model's UnmarshalJSON (callers pass a type alias to avoid infinite recursion). + if err := json.Unmarshal(data, v); err != nil { + return err + } + var raw map[string]json.RawMessage + if err := json.Unmarshal(data, &raw); err != nil { + return err + } + out := Extra{} + for k, val := range raw { + if _, ok := known[k]; !ok { + out[k] = val + } + } + if len(out) > 0 { + *extra = out + } + return nil +} + +// Actor is an Actor on the Apify platform. +type Actor struct { + // ID is the unique Actor ID. + ID string `json:"id"` + // UserID is the ID of the user who owns the Actor. + UserID string `json:"userId"` + // Name is the technical name of the Actor (used in API paths). + Name string `json:"name"` + // Username is the username of the Actor's owner. + Username string `json:"username"` + // Title is the human-readable title shown in the UI. + Title string `json:"title"` + // Description describes what the Actor does. + Description string `json:"description"` + // IsPublic reports whether the Actor is publicly available in Apify Store. + IsPublic bool `json:"isPublic"` + // CreatedAt is when the Actor was created. + CreatedAt *time.Time `json:"createdAt"` + // ModifiedAt is when the Actor was last modified. + ModifiedAt *time.Time `json:"modifiedAt"` + // Extra holds any other fields returned by the API. + Extra Extra `json:"-"` +} + +func (a *Actor) UnmarshalJSON(data []byte) error { + type alias Actor + known := knownJSONKeys(alias{}) + return unmarshalWithExtra(data, (*alias)(a), known, &a.Extra) +} + +// ActorRun is a single execution of an Actor. +type ActorRun struct { + // ID is the unique run ID. + ID string `json:"id"` + // ActID is the ID of the Actor that produced this run. + ActID string `json:"actId"` + // ActorTaskID is the ID of the task that started this run, if any. + ActorTaskID string `json:"actorTaskId"` + // UserID is the ID of the user who owns the run. + UserID string `json:"userId"` + // Status is the current run status (READY, RUNNING, SUCCEEDED, FAILED, ABORTED, TIMED-OUT). + Status string `json:"status"` + // StatusMessage is an optional human-readable status message. + StatusMessage string `json:"statusMessage"` + // StartedAt is when the run started. + StartedAt *time.Time `json:"startedAt"` + // FinishedAt is when the run finished (absent while still running). + FinishedAt *time.Time `json:"finishedAt"` + // BuildID is the ID of the build used for the run. + BuildID string `json:"buildId"` + // DefaultDatasetID is the ID of the run's default dataset. + DefaultDatasetID string `json:"defaultDatasetId"` + // DefaultKeyValueStoreID is the ID of the run's default key-value store. + DefaultKeyValueStoreID string `json:"defaultKeyValueStoreId"` + // DefaultRequestQueueID is the ID of the run's default request queue. + DefaultRequestQueueID string `json:"defaultRequestQueueId"` + // ContainerURL is the URL of the run's container (for live access). + ContainerURL string `json:"containerUrl"` + // Extra holds any other fields returned by the API. + Extra Extra `json:"-"` +} + +func (r *ActorRun) UnmarshalJSON(data []byte) error { + type alias ActorRun + known := knownJSONKeys(alias{}) + return unmarshalWithExtra(data, (*alias)(r), known, &r.Extra) +} + +// IsTerminal reports whether the run has reached a terminal (finished) status. +func (r *ActorRun) IsTerminal() bool { + return isTerminalStatus(r.Status) +} + +// Build is a single build of an Actor. +type Build struct { + // ID is the unique build ID. + ID string `json:"id"` + // ActID is the ID of the Actor this build belongs to. + ActID string `json:"actId"` + // Status is the current build status. + Status string `json:"status"` + // StartedAt is when the build started. + StartedAt *time.Time `json:"startedAt"` + // FinishedAt is when the build finished (absent while still building). + FinishedAt *time.Time `json:"finishedAt"` + // BuildNumber is the human-readable build number (e.g. "0.1.2"). + BuildNumber string `json:"buildNumber"` + // Extra holds any other fields returned by the API. + Extra Extra `json:"-"` +} + +func (b *Build) UnmarshalJSON(data []byte) error { + type alias Build + known := knownJSONKeys(alias{}) + return unmarshalWithExtra(data, (*alias)(b), known, &b.Extra) +} + +// IsTerminal reports whether the build has reached a terminal (finished) status. +func (b *Build) IsTerminal() bool { + return isTerminalStatus(b.Status) +} + +// Task is a pre-configured Actor run (an Actor task). +type Task struct { + // ID is the unique task ID. + ID string `json:"id"` + // ActID is the ID of the Actor this task runs. + ActID string `json:"actId"` + // UserID is the ID of the user who owns the task. + UserID string `json:"userId"` + // Name is the technical name of the task. + Name string `json:"name"` + // Title is the human-readable title shown in the UI. + Title string `json:"title"` + // CreatedAt is when the task was created. + CreatedAt *time.Time `json:"createdAt"` + // ModifiedAt is when the task was last modified. + ModifiedAt *time.Time `json:"modifiedAt"` + // Extra holds any other fields returned by the API. + Extra Extra `json:"-"` +} + +func (t *Task) UnmarshalJSON(data []byte) error { + type alias Task + known := knownJSONKeys(alias{}) + return unmarshalWithExtra(data, (*alias)(t), known, &t.Extra) +} + +// Dataset stores structured results from Actor runs. +type Dataset struct { + // ID is the unique dataset ID. + ID string `json:"id"` + // Name is the dataset name (nil for unnamed datasets). + Name string `json:"name"` + // UserID is the ID of the user who owns the dataset. + UserID string `json:"userId"` + // CreatedAt is when the dataset was created. + CreatedAt *time.Time `json:"createdAt"` + // ModifiedAt is when the dataset was last modified. + ModifiedAt *time.Time `json:"modifiedAt"` + // ItemCount is the number of items currently stored. + ItemCount int64 `json:"itemCount"` + // Extra holds any other fields returned by the API. + Extra Extra `json:"-"` +} + +func (d *Dataset) UnmarshalJSON(data []byte) error { + type alias Dataset + known := knownJSONKeys(alias{}) + return unmarshalWithExtra(data, (*alias)(d), known, &d.Extra) +} + +// KeyValueStore stores arbitrary data records. +type KeyValueStore struct { + // ID is the unique store ID. + ID string `json:"id"` + // Name is the store name (nil for unnamed stores). + Name string `json:"name"` + // UserID is the ID of the user who owns the store. + UserID string `json:"userId"` + // CreatedAt is when the store was created. + CreatedAt *time.Time `json:"createdAt"` + // ModifiedAt is when the store was last modified. + ModifiedAt *time.Time `json:"modifiedAt"` + // Extra holds any other fields returned by the API. + Extra Extra `json:"-"` +} + +func (k *KeyValueStore) UnmarshalJSON(data []byte) error { + type alias KeyValueStore + known := knownJSONKeys(alias{}) + return unmarshalWithExtra(data, (*alias)(k), known, &k.Extra) +} + +// KeyValueStoreKey is a single key listed from a key-value store. +type KeyValueStoreKey struct { + // Key is the record key. + Key string `json:"key"` + // Size is the record size in bytes. + Size int64 `json:"size"` + // Extra holds any other fields returned by the API. + Extra Extra `json:"-"` +} + +func (k *KeyValueStoreKey) UnmarshalJSON(data []byte) error { + type alias KeyValueStoreKey + known := knownJSONKeys(alias{}) + return unmarshalWithExtra(data, (*alias)(k), known, &k.Extra) +} + +// KeyValueStoreKeysPage is a page of keys from a key-value store. +type KeyValueStoreKeysPage struct { + // Limit is the maximum number of keys requested. + Limit int64 `json:"limit"` + // IsTruncated reports whether more keys are available. + IsTruncated bool `json:"isTruncated"` + // ExclusiveStartKey is the key the listing started after. + ExclusiveStartKey string `json:"exclusiveStartKey"` + // NextExclusiveStartKey is the key to pass to fetch the next page. + NextExclusiveStartKey string `json:"nextExclusiveStartKey"` + // Items are the listed keys. + Items []KeyValueStoreKey `json:"items"` +} + +// KeyValueStoreRecord is a single record retrieved from a key-value store. Its Value holds +// the raw bytes; callers can decode it according to ContentType. +type KeyValueStoreRecord struct { + // Key is the record key. + Key string + // Value is the raw record bytes. + Value []byte + // ContentType is the record's MIME type, as reported by the API. + ContentType string +} + +// RequestQueue stores URLs to be crawled. +type RequestQueue struct { + // ID is the unique queue ID. + ID string `json:"id"` + // Name is the queue name (nil for unnamed queues). + Name string `json:"name"` + // UserID is the ID of the user who owns the queue. + UserID string `json:"userId"` + // CreatedAt is when the queue was created. + CreatedAt *time.Time `json:"createdAt"` + // ModifiedAt is when the queue was last modified. + ModifiedAt *time.Time `json:"modifiedAt"` + // TotalRequestCount is the total number of requests ever added. + TotalRequestCount int64 `json:"totalRequestCount"` + // Extra holds any other fields returned by the API. + Extra Extra `json:"-"` +} + +func (q *RequestQueue) UnmarshalJSON(data []byte) error { + type alias RequestQueue + known := knownJSONKeys(alias{}) + return unmarshalWithExtra(data, (*alias)(q), known, &q.Extra) +} + +// RequestQueueRequest is a single request stored in a request queue. +type RequestQueueRequest struct { + // ID is the unique request ID (assigned by the API; omitted on create). + ID string `json:"id,omitempty"` + // URL is the request URL. + URL string `json:"url"` + // UniqueKey is the deduplication key for the request. + UniqueKey string `json:"uniqueKey,omitempty"` + // Method is the HTTP method (e.g. "GET", "POST"). + Method string `json:"method,omitempty"` + // UserData is arbitrary user-attached metadata. + UserData json.RawMessage `json:"userData,omitempty"` + // Extra holds any other fields returned by the API. + Extra Extra `json:"-"` +} + +func (r *RequestQueueRequest) UnmarshalJSON(data []byte) error { + type alias RequestQueueRequest + known := knownJSONKeys(alias{}) + return unmarshalWithExtra(data, (*alias)(r), known, &r.Extra) +} + +// RequestQueueOperationInfo is returned when adding or updating a request. +type RequestQueueOperationInfo struct { + // RequestID is the ID of the affected request. + RequestID string `json:"requestId"` + // WasAlreadyPresent reports whether the request was already in the queue. + WasAlreadyPresent bool `json:"wasAlreadyPresent"` + // WasAlreadyHandled reports whether the request had already been handled. + WasAlreadyHandled bool `json:"wasAlreadyHandled"` +} + +// RequestQueueHead is the head (front) of a request queue. +type RequestQueueHead struct { + // Limit is the maximum number of requests requested. + Limit int64 `json:"limit"` + // HadMultipleClients reports whether multiple clients have accessed the queue. + HadMultipleClients bool `json:"hadMultipleClients"` + // Items are the requests at the head of the queue. + Items []RequestQueueRequest `json:"items"` + // Extra holds any other fields returned by the API. + Extra Extra `json:"-"` +} + +func (h *RequestQueueHead) UnmarshalJSON(data []byte) error { + type alias RequestQueueHead + known := knownJSONKeys(alias{}) + return unmarshalWithExtra(data, (*alias)(h), known, &h.Extra) +} + +// Schedule automatically starts Actor or task runs at specified times. +type Schedule struct { + // ID is the unique schedule ID. + ID string `json:"id"` + // UserID is the ID of the user who owns the schedule. + UserID string `json:"userId"` + // Name is the schedule name. + Name string `json:"name"` + // CronExpression is the cron expression governing when the schedule fires. + CronExpression string `json:"cronExpression"` + // IsEnabled reports whether the schedule is currently active. + IsEnabled bool `json:"isEnabled"` + // Extra holds any other fields returned by the API. + Extra Extra `json:"-"` +} + +func (s *Schedule) UnmarshalJSON(data []byte) error { + type alias Schedule + known := knownJSONKeys(alias{}) + return unmarshalWithExtra(data, (*alias)(s), known, &s.Extra) +} + +// Webhook notifies an external service when specific events occur. +type Webhook struct { + // ID is the unique webhook ID. + ID string `json:"id"` + // UserID is the ID of the user who owns the webhook. + UserID string `json:"userId"` + // RequestURL is the URL the webhook posts to. + RequestURL string `json:"requestUrl"` + // EventTypes are the events that trigger the webhook. + EventTypes []string `json:"eventTypes"` + // Extra holds any other fields returned by the API. + Extra Extra `json:"-"` +} + +func (w *Webhook) UnmarshalJSON(data []byte) error { + type alias Webhook + known := knownJSONKeys(alias{}) + return unmarshalWithExtra(data, (*alias)(w), known, &w.Extra) +} + +// WebhookDispatch is a single invocation of a webhook. +type WebhookDispatch struct { + // ID is the unique dispatch ID. + ID string `json:"id"` + // WebhookID is the ID of the webhook that produced this dispatch. + WebhookID string `json:"webhookId"` + // Extra holds any other fields returned by the API. + Extra Extra `json:"-"` +} + +func (d *WebhookDispatch) UnmarshalJSON(data []byte) error { + type alias WebhookDispatch + known := knownJSONKeys(alias{}) + return unmarshalWithExtra(data, (*alias)(d), known, &d.Extra) +} + +// User is an Apify user account. +type User struct { + // ID is the unique user ID. + ID string `json:"id"` + // Username is the user's username. + Username string `json:"username"` + // Extra holds any other fields returned by the API (private details for "me"). + Extra Extra `json:"-"` +} + +func (u *User) UnmarshalJSON(data []byte) error { + type alias User + known := knownJSONKeys(alias{}) + return unmarshalWithExtra(data, (*alias)(u), known, &u.Extra) +} + +// ActorStoreListItem is an Actor as listed in the Apify Store. +type ActorStoreListItem struct { + // ID is the unique Actor ID. + ID string `json:"id"` + // Name is the technical name of the Actor. + Name string `json:"name"` + // Username is the username of the Actor's owner. + Username string `json:"username"` + // Title is the human-readable title. + Title string `json:"title"` + // Extra holds any other fields returned by the API. + Extra Extra `json:"-"` +} + +func (a *ActorStoreListItem) UnmarshalJSON(data []byte) error { + type alias ActorStoreListItem + known := knownJSONKeys(alias{}) + return unmarshalWithExtra(data, (*alias)(a), known, &a.Extra) +} + +// ActorVersion is a single version of an Actor. +type ActorVersion struct { + // VersionNumber is the version identifier (e.g. "0.1"). + VersionNumber string `json:"versionNumber"` + // SourceType is how the version's source is provided (e.g. "SOURCE_FILES"). + SourceType string `json:"sourceType"` + // Extra holds any other fields returned by the API. + Extra Extra `json:"-"` +} + +func (v *ActorVersion) UnmarshalJSON(data []byte) error { + type alias ActorVersion + known := knownJSONKeys(alias{}) + return unmarshalWithExtra(data, (*alias)(v), known, &v.Extra) +} + +// ActorEnvVar is an environment variable attached to an Actor version. +type ActorEnvVar struct { + // Name is the environment variable name. + Name string `json:"name"` + // Value is the environment variable value. + Value string `json:"value,omitempty"` + // IsSecret reports whether the value is stored as a secret. + IsSecret *bool `json:"isSecret,omitempty"` + // Extra holds any other fields returned by the API. + Extra Extra `json:"-"` +} + +func (e *ActorEnvVar) UnmarshalJSON(data []byte) error { + type alias ActorEnvVar + known := knownJSONKeys(alias{}) + return unmarshalWithExtra(data, (*alias)(e), known, &e.Extra) +} diff --git a/openapitools.json b/openapitools.json deleted file mode 100644 index f3237ad..0000000 --- a/openapitools.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "$schema": "./node_modules/@openapitools/openapi-generator-cli/config.schema.json", - "spaces": 2, - "generator-cli": { - "version": "7.23.0" - } -} diff --git a/reflect.go b/reflect.go new file mode 100644 index 0000000..1f8e31f --- /dev/null +++ b/reflect.go @@ -0,0 +1,54 @@ +package apify + +import ( + "reflect" + "strings" + "sync" +) + +// knownKeysCache memoizes the JSON key sets per struct type so the reflection cost is +// paid once per type rather than on every unmarshal. +var knownKeysCache sync.Map // map[reflect.Type]map[string]struct{} + +// knownJSONKeys returns the set of JSON object keys that the struct type of v maps to its +// fields. Used by the models' UnmarshalJSON to decide which incoming keys are "extra" +// (unmodelled) and should be collected into the Extra map. +// +// The argument is a zero value of the model's alias type; only its type is inspected. +func knownJSONKeys(v any) map[string]struct{} { + t := reflect.TypeOf(v) + if cached, ok := knownKeysCache.Load(t); ok { + return cached.(map[string]struct{}) + } + + keys := make(map[string]struct{}) + for i := 0; i < t.NumField(); i++ { + field := t.Field(i) + tag := field.Tag.Get("json") + if tag == "-" { + continue // e.g. the Extra field itself + } + name := strings.Split(tag, ",")[0] + if name == "" { + name = field.Name + } + keys[name] = struct{}{} + } + + knownKeysCache.Store(t, keys) + return keys +} + +// Terminal run/build statuses. A resource in any of these is finished and will not change. +var terminalStatuses = map[string]struct{}{ + "SUCCEEDED": {}, + "FAILED": {}, + "ABORTED": {}, + "TIMED-OUT": {}, +} + +// isTerminalStatus reports whether status is a terminal (finished) run/build status. +func isTerminalStatus(status string) bool { + _, ok := terminalStatuses[status] + return ok +} diff --git a/request_queue.go b/request_queue.go new file mode 100644 index 0000000..33cfe06 --- /dev/null +++ b/request_queue.go @@ -0,0 +1,329 @@ +package apify + +import ( + "context" + "encoding/json" + "errors" + "fmt" +) + +// ListRequestsOptions configures [RequestQueueClient.ListRequests]. +type ListRequestsOptions struct { + // Limit is the maximum number of requests to return. + Limit *int64 + // ExclusiveStartID lists requests after this ID. + ExclusiveStartID *string + // Cursor is an opaque pagination cursor (alternative to ExclusiveStartID). + Cursor *string + // Filter restricts the listing (e.g. to handled/unhandled requests). + Filter *string +} + +func (o ListRequestsOptions) apply(q *QueryParams) { + q.AddInt("limit", o.Limit). + AddString("exclusiveStartId", o.ExclusiveStartID). + AddString("cursor", o.Cursor). + AddString("filter", o.Filter) +} + +// RequestQueueClient is a client for a specific request queue (and run-nested variants). +type RequestQueueClient struct { + ctx *resourceContext + clientKey string +} + +func newRequestQueueClient(hc *httpClient, baseURL, resourcePath, id string) *RequestQueueClient { + return &RequestQueueClient{ctx: newSingleContext(hc, baseURL, resourcePath, id)} +} + +// newRequestQueueNestedClient creates a client for a run's default request queue. +func newRequestQueueNestedClient(hc *httpClient, base, subPath string) *RequestQueueClient { + return &RequestQueueClient{ctx: newCollectionContext(hc, base, subPath)} +} + +// WithClientKey returns a copy of the client that identifies its requests with clientKey. +// +// A stable client key is required to operate on locks the client itself created (e.g. to +// unlock its own requests), and lets the API detect whether multiple clients access a queue. +func (c *RequestQueueClient) WithClientKey(clientKey string) *RequestQueueClient { + clone := *c + clone.clientKey = clientKey + return &clone +} + +// withClientKey adds the client key (if set) to the given params. +func (c *RequestQueueClient) withClientKey(params *QueryParams) *QueryParams { + if c.clientKey != "" { + params.AddString("clientKey", &c.clientKey) + } + return params +} + +// Get fetches the queue metadata. The bool reports whether it exists. +func (c *RequestQueueClient) Get(ctx context.Context) (RequestQueue, bool, error) { + return getResource[RequestQueue](ctx, c.ctx, "", NewQueryParams()) +} + +// Update updates the queue metadata (e.g. name) and returns the updated object. +func (c *RequestQueueClient) Update(ctx context.Context, newFields any) (RequestQueue, error) { + return updateResource[RequestQueue](ctx, c.ctx, "", newFields) +} + +// Delete deletes the queue. +func (c *RequestQueueClient) Delete(ctx context.Context) error { + return deleteResource(ctx, c.ctx, "") +} + +// ListHead returns the requests at the head (front) of the queue, up to limit (nil for the +// server default). +func (c *RequestQueueClient) ListHead(ctx context.Context, limit *int64) (RequestQueueHead, error) { + params := NewQueryParams() + params.AddInt("limit", limit) + c.withClientKey(params) + return getResourceRequired[RequestQueueHead](ctx, c.ctx, "head", params) +} + +// AddRequest adds a request to the queue. If forefront is true, the request is added to the +// front of the queue. +func (c *RequestQueueClient) AddRequest(ctx context.Context, request RequestQueueRequest, forefront bool) (RequestQueueOperationInfo, error) { + params := NewQueryParams() + params.AddBool("forefront", &forefront) + c.withClientKey(params) + body, err := json.Marshal(request) + if err != nil { + return RequestQueueOperationInfo{}, err + } + return postWithBody[RequestQueueOperationInfo](ctx, c.ctx, "requests", params, body, contentTypeJSON) +} + +// GetRequest fetches a request by ID, or (nil, false, nil) if it does not exist. +func (c *RequestQueueClient) GetRequest(ctx context.Context, id string) (*RequestQueueRequest, bool, error) { + req, present, err := getResource[RequestQueueRequest](ctx, c.ctx, "requests/"+encodePathSegment(id), NewQueryParams()) + if err != nil || !present { + return nil, present, err + } + return &req, true, nil +} + +// UpdateRequest updates an existing request (identified by its ID field) and returns the +// operation info. If forefront is true, the request is moved to the front of the queue. +func (c *RequestQueueClient) UpdateRequest(ctx context.Context, request RequestQueueRequest, forefront bool) (RequestQueueOperationInfo, error) { + params := NewQueryParams() + params.AddBool("forefront", &forefront) + c.withClientKey(params) + url := c.ctx.mergedParams(params).applyToURL(c.ctx.subURL("requests/" + encodePathSegment(request.ID))) + body, err := json.Marshal(request) + if err != nil { + return RequestQueueOperationInfo{}, err + } + resp, err := c.ctx.http.call(ctx, "PUT", url, body, contentTypeJSON, defaultRequestTimeout) + if err != nil { + return RequestQueueOperationInfo{}, err + } + return parseDataEnvelope[RequestQueueOperationInfo](resp.body) +} + +// DeleteRequest deletes a request by ID. +func (c *RequestQueueClient) DeleteRequest(ctx context.Context, id string) error { + url := c.ctx.mergedParams(c.withClientKey(NewQueryParams())).applyToURL(c.ctx.subURL("requests/" + encodePathSegment(id))) + _, err := c.ctx.http.call(ctx, "DELETE", url, nil, "", defaultRequestTimeout) + if err != nil && !isNotFound(err) { + return err + } + return nil +} + +// ListAndLockHead atomically returns and locks up to limit requests from the head of the +// queue for lockSecs seconds. Returns the raw API response (a locked-head object). +func (c *RequestQueueClient) ListAndLockHead(ctx context.Context, lockSecs int64, limit *int64) (json.RawMessage, error) { + params := NewQueryParams() + params.AddInt("lockSecs", &lockSecs).AddInt("limit", limit) + c.withClientKey(params) + return postWithBody[json.RawMessage](ctx, c.ctx, "head/lock", params, nil, "") +} + +// maxRequestsPerBatchOperation is the API limit on requests per batch call. Larger inputs +// are split into chunks of this size, matching the reference client. +const maxRequestsPerBatchOperation = 25 + +// BatchAddResult is the typed result of [RequestQueueClient.BatchAddRequests]: the requests +// the API accepted and the ones it could not process. +type BatchAddResult struct { + // ProcessedRequests are the requests the API successfully added. + ProcessedRequests []RequestQueueOperationInfo `json:"processedRequests"` + // UnprocessedRequests are the requests the API did not process. + UnprocessedRequests []RequestQueueRequest `json:"unprocessedRequests"` +} + +// BatchAddRequests adds multiple requests to the queue. If forefront is true, they are added +// to the front of the queue. +// +// The input is automatically split into chunks of at most 25 requests (the API limit), and +// the per-chunk results are merged into a single [BatchAddResult]. Each chunk is still +// subject to the client's standard retry policy. +func (c *RequestQueueClient) BatchAddRequests(ctx context.Context, requests []RequestQueueRequest, forefront bool) (BatchAddResult, error) { + var merged BatchAddResult + for start := 0; start < len(requests); start += maxRequestsPerBatchOperation { + end := start + maxRequestsPerBatchOperation + if end > len(requests) { + end = len(requests) + } + chunkResult, err := c.batchAddChunk(ctx, requests[start:end], forefront) + if err != nil { + return merged, err + } + merged.ProcessedRequests = append(merged.ProcessedRequests, chunkResult.ProcessedRequests...) + merged.UnprocessedRequests = append(merged.UnprocessedRequests, chunkResult.UnprocessedRequests...) + } + return merged, nil +} + +// batchAddChunk sends a single batch (<= 25 requests) and parses the typed result. +func (c *RequestQueueClient) batchAddChunk(ctx context.Context, requests []RequestQueueRequest, forefront bool) (BatchAddResult, error) { + params := NewQueryParams() + params.AddBool("forefront", &forefront) + c.withClientKey(params) + body, err := json.Marshal(requests) + if err != nil { + return BatchAddResult{}, err + } + return postWithBody[BatchAddResult](ctx, c.ctx, "requests/batch", params, body, contentTypeJSON) +} + +// BatchDeleteRequests deletes multiple requests in a single call. Each entry identifies a +// request (e.g. by id or uniqueKey). Returns the raw batch result. +func (c *RequestQueueClient) BatchDeleteRequests(ctx context.Context, requests any) (json.RawMessage, error) { + params := c.withClientKey(NewQueryParams()) + return deleteWithBody[json.RawMessage](ctx, c.ctx, "requests/batch", params, requests) +} + +// Allowed values for ListRequestsOptions.Filter, as constrained by the API. +const ( + requestFilterLocked = "locked" + requestFilterPending = "pending" +) + +// validate checks the listing options for API-level constraints: ExclusiveStartID and Cursor +// are mutually exclusive, and Filter (if set) must be "locked" or "pending". +func (o ListRequestsOptions) validate() error { + if o.ExclusiveStartID != nil && o.Cursor != nil { + return errors.New("ListRequestsOptions: ExclusiveStartID and Cursor are mutually exclusive") + } + if o.Filter != nil && *o.Filter != requestFilterLocked && *o.Filter != requestFilterPending { + return fmt.Errorf("ListRequestsOptions: Filter must be %q or %q, got %q", requestFilterLocked, requestFilterPending, *o.Filter) + } + return nil +} + +// ListRequests lists the queue's requests with pagination. +func (c *RequestQueueClient) ListRequests(ctx context.Context, options ListRequestsOptions) (json.RawMessage, error) { + if err := options.validate(); err != nil { + return nil, err + } + params := NewQueryParams() + options.apply(params) + c.withClientKey(params) + return getResourceRequired[json.RawMessage](ctx, c.ctx, "requests", params) +} + +// ProlongRequestLock extends the lock on a request by lockSecs seconds. If forefront is +// true, the request is moved to the front when its lock expires. Returns the raw response. +func (c *RequestQueueClient) ProlongRequestLock(ctx context.Context, id string, lockSecs int64, forefront bool) (json.RawMessage, error) { + params := NewQueryParams() + params.AddInt("lockSecs", &lockSecs).AddBool("forefront", &forefront) + c.withClientKey(params) + url := c.ctx.mergedParams(params).applyToURL(c.ctx.subURL("requests/" + encodePathSegment(id) + "/lock")) + resp, err := c.ctx.http.call(ctx, "PUT", url, nil, "", defaultRequestTimeout) + if err != nil { + return nil, err + } + return parseDataEnvelope[json.RawMessage](resp.body) +} + +// DeleteRequestLock releases the lock on a request. If forefront is true, the request is +// moved to the front of the queue. +func (c *RequestQueueClient) DeleteRequestLock(ctx context.Context, id string, forefront bool) error { + params := NewQueryParams() + params.AddBool("forefront", &forefront) + c.withClientKey(params) + url := c.ctx.mergedParams(params).applyToURL(c.ctx.subURL("requests/" + encodePathSegment(id) + "/lock")) + _, err := c.ctx.http.call(ctx, "DELETE", url, nil, "", defaultRequestTimeout) + if err != nil && !isNotFound(err) { + return err + } + return nil +} + +// UnlockRequests releases all locks the client holds on this queue's requests. Returns the +// raw response. +func (c *RequestQueueClient) UnlockRequests(ctx context.Context) (json.RawMessage, error) { + params := c.withClientKey(NewQueryParams()) + return postWithBody[json.RawMessage](ctx, c.ctx, "requests/unlock", params, nil, "") +} + +// PaginateRequests returns a lazy iterator over all requests in the queue, fetching pages +// of up to pageLimit requests at a time (nil for the server default). +func (c *RequestQueueClient) PaginateRequests(pageLimit *int64) *RequestQueueRequestsIterator { + return &RequestQueueRequestsIterator{client: c, pageLimit: pageLimit} +} + +// RequestQueueRequestsIterator lazily iterates over a request queue's requests, fetching one +// page at a time via the cursor-based listing endpoint. +type RequestQueueRequestsIterator struct { + client *RequestQueueClient + pageLimit *int64 + + buffer []RequestQueueRequest + pos int + nextCursor string + started bool + exhausted bool +} + +// requestsPage is the shape of a paginated requests listing. +type requestsPage struct { + Items []RequestQueueRequest `json:"items"` + NextCursor *string `json:"nextCursor"` +} + +// Next returns the next request, or (nil, nil) when the iterator is exhausted. +func (it *RequestQueueRequestsIterator) Next(ctx context.Context) (*RequestQueueRequest, error) { + for it.pos >= len(it.buffer) { + if it.exhausted || (it.started && it.nextCursor == "") { + return nil, nil + } + if err := it.fetchPage(ctx); err != nil { + return nil, err + } + } + req := it.buffer[it.pos] + it.pos++ + return &req, nil +} + +// fetchPage loads the next page of requests into the buffer. +func (it *RequestQueueRequestsIterator) fetchPage(ctx context.Context) error { + params := NewQueryParams() + params.AddInt("limit", it.pageLimit) + if it.nextCursor != "" { + params.AddString("cursor", &it.nextCursor) + } + it.client.withClientKey(params) + + raw, err := getResourceRequired[requestsPage](ctx, it.client.ctx, "requests", params) + if err != nil { + return err + } + it.started = true + it.buffer = raw.Items + it.pos = 0 + if raw.NextCursor != nil { + it.nextCursor = *raw.NextCursor + } else { + it.nextCursor = "" + } + if len(raw.Items) == 0 && it.nextCursor == "" { + it.exhausted = true + } + return nil +} diff --git a/request_queue_collection.go b/request_queue_collection.go new file mode 100644 index 0000000..8d58dbe --- /dev/null +++ b/request_queue_collection.go @@ -0,0 +1,26 @@ +package apify + +import "context" + +// RequestQueueCollectionClient is a client for the request queue collection +// (GET/POST /v2/request-queues). +type RequestQueueCollectionClient struct { + ctx *resourceContext +} + +func newRequestQueueCollectionClient(hc *httpClient, baseURL string) *RequestQueueCollectionClient { + return &RequestQueueCollectionClient{ctx: newCollectionContext(hc, baseURL, "request-queues")} +} + +// List lists request queues. +func (c *RequestQueueCollectionClient) List(ctx context.Context, options StorageListOptions) (PaginationList[RequestQueue], error) { + params := NewQueryParams() + options.apply(params) + return listResource[RequestQueue](ctx, c.ctx, "", params) +} + +// GetOrCreate gets the queue with the given name, creating it if it does not exist. An +// empty name creates a new unnamed queue. +func (c *RequestQueueCollectionClient) GetOrCreate(ctx context.Context, name string) (RequestQueue, error) { + return getOrCreateNamed[RequestQueue](ctx, c.ctx, name) +} diff --git a/response.go b/response.go deleted file mode 100644 index 5f02520..0000000 --- a/response.go +++ /dev/null @@ -1,47 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "net/http" -) - -// APIResponse stores the API response returned by the server. -type APIResponse struct { - *http.Response `json:"-"` - Message string `json:"message,omitempty"` - // Operation is the name of the OpenAPI operation. - Operation string `json:"operation,omitempty"` - // RequestURL is the request URL. This value is always available, even if the - // embedded *http.Response is nil. - RequestURL string `json:"url,omitempty"` - // Method is the HTTP method used for the request. This value is always - // available, even if the embedded *http.Response is nil. - Method string `json:"method,omitempty"` - // Payload holds the contents of the response body (which may be nil or empty). - // This is provided here as the raw response.Body() reader will have already - // been drained. - Payload []byte `json:"-"` -} - -// NewAPIResponse returns a new APIResponse object. -func NewAPIResponse(r *http.Response) *APIResponse { - - response := &APIResponse{Response: r} - return response -} - -// NewAPIResponseWithError returns a new APIResponse object with the provided error message. -func NewAPIResponseWithError(errorMessage string) *APIResponse { - - response := &APIResponse{Message: errorMessage} - return response -} diff --git a/review_fixes_test.go b/review_fixes_test.go new file mode 100644 index 0000000..353b122 --- /dev/null +++ b/review_fixes_test.go @@ -0,0 +1,128 @@ +package apify + +import ( + "context" + "strings" + "testing" +) + +// okData is a constant 200 response with an empty data envelope, reused by the offline +// tests below. +func okData() []mockResponse { return constant(200, `{"data":{}}`) } + +// Charge must always send an idempotency-key header so a transport retry cannot double-charge. +func TestChargeSendsIdempotencyKey(t *testing.T) { + backend := &mockBackend{responses: okData()} + client := testClient(backend, 0) + + err := client.Run("run123").Charge(context.Background(), RunChargeOptions{EventName: "my-event"}) + if err != nil { + t.Fatalf("charge: %v", err) + } + key := backend.lastHeaders.Get("idempotency-key") + if key == "" { + t.Fatal("expected an idempotency-key header to be sent") + } + if !strings.HasPrefix(key, "run123-my-event-") { + t.Fatalf("idempotency key should embed run id and event name, got %q", key) + } + if !strings.Contains(backend.lastBody, `"eventName":"my-event"`) { + t.Fatalf("unexpected charge body: %s", backend.lastBody) + } +} + +// A caller-supplied idempotency key must be used verbatim. +func TestChargeHonorsExplicitIdempotencyKey(t *testing.T) { + backend := &mockBackend{responses: okData()} + client := testClient(backend, 0) + + err := client.Run("run123").Charge(context.Background(), RunChargeOptions{EventName: "e", IdempotencyKey: "fixed-key"}) + if err != nil { + t.Fatalf("charge: %v", err) + } + if got := backend.lastHeaders.Get("idempotency-key"); got != "fixed-key" { + t.Fatalf("expected explicit idempotency key, got %q", got) + } +} + +// GetRecord must default attachment=true (matching the reference client). +func TestGetRecordDefaultsAttachment(t *testing.T) { + backend := &mockBackend{responses: constant(200, "raw-bytes")} + client := testClient(backend, 0) + + _, _, err := client.KeyValueStore("store1").GetRecord(context.Background(), "OUTPUT") + if err != nil { + t.Fatalf("get record: %v", err) + } + if !strings.Contains(backend.lastURL, "attachment=1") { + t.Fatalf("expected attachment=1 in URL, got %q", backend.lastURL) + } +} + +// BatchAddRequests must split inputs larger than the API's 25-per-batch limit into chunks. +func TestBatchAddRequestsChunks(t *testing.T) { + backend := &mockBackend{responses: constant(200, `{"data":{"processedRequests":[],"unprocessedRequests":[]}}`)} + client := testClient(backend, 0) + + requests := make([]RequestQueueRequest, 60) // 60 -> 25 + 25 + 10 = 3 chunks + for i := range requests { + requests[i] = RequestQueueRequest{URL: "https://example.com"} + } + if _, err := client.RequestQueue("q1").BatchAddRequests(context.Background(), requests, false); err != nil { + t.Fatalf("batch add: %v", err) + } + if backend.calls != 3 { + t.Fatalf("expected 3 batch calls for 60 requests, got %d", backend.calls) + } +} + +// Run.GetWithWait must forward the waitForFinish query parameter. +func TestRunGetWithWaitForwardsParam(t *testing.T) { + backend := &mockBackend{responses: constant(200, `{"data":{"id":"r1"}}`)} + client := testClient(backend, 0) + + secs := int64(30) + if _, _, err := client.Run("r1").GetWithWait(context.Background(), &secs); err != nil { + t.Fatalf("get with wait: %v", err) + } + if !strings.Contains(backend.lastURL, "waitForFinish=30") { + t.Fatalf("expected waitForFinish=30 in URL, got %q", backend.lastURL) + } +} + +// GetStreamedLog must open a raw, streaming log request (stream=1 & raw=1). +func TestGetStreamedLogParams(t *testing.T) { + backend := &mockBackend{responses: constant(200, "live log bytes")} + client := testClient(backend, 0) + + stream, err := client.Run("r1").GetStreamedLog(context.Background()) + if err != nil { + t.Fatalf("get streamed log: %v", err) + } + defer stream.Close() + if !strings.Contains(backend.lastURL, "stream=1") { + t.Fatalf("expected stream=1 in URL, got %q", backend.lastURL) + } + if !strings.Contains(backend.lastURL, "raw=1") { + t.Fatalf("expected raw=1 in URL, got %q", backend.lastURL) + } +} + +// ListRequests must reject mutually-exclusive options and an invalid Filter before any API call. +func TestListRequestsValidation(t *testing.T) { + backend := &mockBackend{responses: okData()} + client := testClient(backend, 0) + queue := client.RequestQueue("q1") + + start, cursor := "a", "b" + if _, err := queue.ListRequests(context.Background(), ListRequestsOptions{ExclusiveStartID: &start, Cursor: &cursor}); err == nil { + t.Fatal("expected error for mutually-exclusive ExclusiveStartID and Cursor") + } + bad := "bogus" + if _, err := queue.ListRequests(context.Background(), ListRequestsOptions{Filter: &bad}); err == nil { + t.Fatal("expected error for invalid Filter value") + } + if backend.calls != 0 { + t.Fatalf("validation must short-circuit before any API call, got %d calls", backend.calls) + } +} diff --git a/run.go b/run.go new file mode 100644 index 0000000..3e4e842 --- /dev/null +++ b/run.go @@ -0,0 +1,210 @@ +package apify + +import ( + "context" + "io" + "math/rand" + "strconv" + "time" +) + +// RunResurrectOptions configures [RunClient.Resurrect]. +type RunResurrectOptions struct { + // Build is the tag or number of the build to resurrect with. + Build *string + // MemoryMbytes is the memory in megabytes to allocate. + MemoryMbytes *int64 + // TimeoutSecs is the run timeout in seconds. + TimeoutSecs *int64 + // MaxItems is the maximum number of dataset items to charge (pay-per-result Actors). + MaxItems *int64 + // MaxTotalChargeUsd is the maximum total charge in USD (pay-per-event Actors). + MaxTotalChargeUsd *float64 + // RestartOnError, if true, restarts the run if it fails. + RestartOnError *bool +} + +func (o RunResurrectOptions) apply(q *QueryParams) { + q.AddString("build", o.Build). + AddInt("memory", o.MemoryMbytes). + AddInt("timeout", o.TimeoutSecs). + AddInt("maxItems", o.MaxItems). + AddFloat("maxTotalChargeUsd", o.MaxTotalChargeUsd). + AddBool("restartOnError", o.RestartOnError) +} + +// RunChargeOptions configures [RunClient.Charge]. +type RunChargeOptions struct { + // EventName is the name of the event to charge for. Required. + EventName string + // Count is the number of times to charge the event (defaults to 1). + Count *int64 + // IdempotencyKey deduplicates the charge across retries. If empty, one is auto-generated + // as "{runId}-{eventName}-{timestampMillis}-{random}", matching the reference client. + IdempotencyKey string +} + +// RunClient is a client for a specific Actor run. +// +// It provides CRUD methods plus convenience helpers (abort, metamorph, reboot, resurrect, +// charge, wait-for-finish) and accessors for the run's default storages and log. +type RunClient struct { + root *ApifyClient + ctx *resourceContext + id string +} + +func newRunClient(root *ApifyClient, hc *httpClient, baseURL, resourcePath, id string) *RunClient { + return &RunClient{ + root: root, + ctx: newSingleContext(hc, baseURL, resourcePath, id), + id: id, + } +} + +// setStatusParam pins a `status` query parameter inherited by all calls on this client. +// Used by ActorClient.LastRun / TaskClient.LastRun to filter the "last" run by status. +func (c *RunClient) setStatusParam(status string) { + c.ctx.baseParams.addRaw("status", status) +} + +// Get fetches the run object. The bool reports whether it exists. +func (c *RunClient) Get(ctx context.Context) (ActorRun, bool, error) { + return c.GetWithWait(ctx, nil) +} + +// GetWithWait fetches the run, optionally asking the API to wait up to waitForFinishSecs +// seconds (max 60) for the run to reach a terminal state before responding. Pass nil for an +// immediate fetch. Mirrors the reference client's get({ waitForFinish }). +func (c *RunClient) GetWithWait(ctx context.Context, waitForFinishSecs *int64) (ActorRun, bool, error) { + params := NewQueryParams() + params.AddInt("waitForFinish", waitForFinishSecs) + return getResource[ActorRun](ctx, c.ctx, "", params) +} + +// Update updates the run with the given fields and returns the updated object. +func (c *RunClient) Update(ctx context.Context, newFields any) (ActorRun, error) { + return updateResource[ActorRun](ctx, c.ctx, "", newFields) +} + +// Delete deletes the run. +func (c *RunClient) Delete(ctx context.Context) error { + return deleteResource(ctx, c.ctx, "") +} + +// Abort aborts the run. If gracefully is true, the run is sent a signal so it can finish +// the current request before terminating. +func (c *RunClient) Abort(ctx context.Context, gracefully bool) (ActorRun, error) { + params := NewQueryParams() + params.AddBool("gracefully", &gracefully) + return postWithBody[ActorRun](ctx, c.ctx, "abort", params, nil, "") +} + +// MetamorphOptions configures [RunClient.Metamorph]. +type MetamorphOptions struct { + // Build optionally pins the target Actor's build (empty for default). + Build string + // ContentType is the content type of the input body. Defaults to application/json. + ContentType string +} + +// Metamorph transforms the run into a run of another Actor with a new input. +// +// targetActorID is the Actor to metamorph into. input is the new input (nil for none). +func (c *RunClient) Metamorph(ctx context.Context, targetActorID string, input any, options MetamorphOptions) (ActorRun, error) { + params := NewQueryParams() + params.AddString("targetActorId", &targetActorID) + if options.Build != "" { + params.AddString("build", &options.Build) + } + body, err := marshalInput(input) + if err != nil { + return ActorRun{}, err + } + contentType := options.ContentType + if contentType == "" { + contentType = contentTypeJSON + } + return postWithBody[ActorRun](ctx, c.ctx, "metamorph", params, body, contentType) +} + +// Reboot reboots the run (restarts its container while keeping the same run). +func (c *RunClient) Reboot(ctx context.Context) (ActorRun, error) { + return postWithBody[ActorRun](ctx, c.ctx, "reboot", NewQueryParams(), nil, "") +} + +// Resurrect resurrects a finished run, starting it again from the beginning. +func (c *RunClient) Resurrect(ctx context.Context, options RunResurrectOptions) (ActorRun, error) { + params := NewQueryParams() + options.apply(params) + return postWithBody[ActorRun](ctx, c.ctx, "resurrect", params, nil, "") +} + +// Charge charges for a pay-per-event Actor run: it records occurrences of a named event. +// Only meaningful for runs of pay-per-event Actors. +// +// An idempotency key is always sent (auto-generated if not provided), so a charge that is +// retried by the transport is applied at most once, matching the reference client. +func (c *RunClient) Charge(ctx context.Context, options RunChargeOptions) error { + count := int64(1) + if options.Count != nil { + count = *options.Count + } + idempotencyKey := options.IdempotencyKey + if idempotencyKey == "" { + idempotencyKey = c.generateIdempotencyKey(options.EventName) + } + body := mustMarshal(map[string]any{"eventName": options.EventName, "count": count}) + url := c.ctx.subURL("charge") + headers := map[string]string{chargeIdempotencyHeader: idempotencyKey} + _, err := c.ctx.http.callWithHeaders(ctx, "POST", url, body, contentTypeJSON, headers, defaultRequestTimeout) + return err +} + +// chargeIdempotencyHeader is the header the API uses to deduplicate charge requests. +const chargeIdempotencyHeader = "idempotency-key" + +// generateIdempotencyKey builds a per-charge idempotency key of the form +// "{runId}-{eventName}-{timestampMillis}-{random}", matching the reference client. It need +// not be cryptographically secure — only unique enough to avoid collisions within a request. +func (c *RunClient) generateIdempotencyKey(eventName string) string { + return c.id + "-" + eventName + "-" + + strconv.FormatInt(time.Now().UnixMilli(), 10) + "-" + + strconv.FormatInt(rand.Int63n(1_000_000), 10) +} + +// WaitForFinish polls until the run reaches a terminal state or waitSecs elapses (nil waits +// indefinitely). It returns the latest run. +func (c *RunClient) WaitForFinish(ctx context.Context, waitSecs *int64) (ActorRun, error) { + return waitForFinish[ActorRun](ctx, c.ctx, waitSecs, func(r *ActorRun) bool { return r.IsTerminal() }) +} + +// Dataset returns a client for this run's default dataset. +func (c *RunClient) Dataset() *DatasetClient { + return newDatasetNestedClient(c.ctx.http, c.ctx.subURL(""), "dataset") +} + +// KeyValueStore returns a client for this run's default key-value store. +func (c *RunClient) KeyValueStore() *KeyValueStoreClient { + return newKeyValueStoreNestedClient(c.ctx.http, c.ctx.subURL(""), "key-value-store") +} + +// RequestQueue returns a client for this run's default request queue. +func (c *RunClient) RequestQueue() *RequestQueueClient { + return newRequestQueueNestedClient(c.ctx.http, c.ctx.subURL(""), "request-queue") +} + +// Log returns a client for accessing this run's log. +func (c *RunClient) Log() *LogClient { + return newNestedLogClient(c.ctx.http, c.ctx.subURL("")) +} + +// GetStreamedLog opens a live stream of this run's raw log, for convenient log redirection. +// +// It is a convenience wrapper over Log().StreamWithOptions with raw=true (matching the +// reference client's getStreamedLog, which streams raw log content). The caller must close +// the returned reader. +func (c *RunClient) GetStreamedLog(ctx context.Context) (io.ReadCloser, error) { + raw := true + return c.Log().StreamWithOptions(ctx, LogOptions{Raw: &raw}) +} diff --git a/run_collection.go b/run_collection.go new file mode 100644 index 0000000..e4e80e1 --- /dev/null +++ b/run_collection.go @@ -0,0 +1,41 @@ +package apify + +import "context" + +// RunListOptions adds run-specific filters on top of [ListOptions] for +// [RunCollectionClient.List]. The startedAfter/startedBefore filters are only honoured by +// the Actor-scoped and task-scoped run collections. +type RunListOptions struct { + // Status filters by one or more run statuses (e.g. "SUCCEEDED", "RUNNING"). Sent as a + // comma-separated list, as the API accepts. + Status []string + // StartedAfter filters to runs started after this ISO-8601 timestamp. + StartedAfter *string + // StartedBefore filters to runs started before this ISO-8601 timestamp. + StartedBefore *string +} + +func (o RunListOptions) apply(q *QueryParams) { + q.AddCSV("status", o.Status). + AddString("startedAfter", o.StartedAfter). + AddString("startedBefore", o.StartedBefore) +} + +// RunCollectionClient is a client for a run collection: the account-wide collection +// (GET /v2/actor-runs), an Actor's runs (GET /v2/actors/{id}/runs), or a task's runs +// (GET /v2/actor-tasks/{id}/runs). +type RunCollectionClient struct { + ctx *resourceContext +} + +func newRunCollectionClient(hc *httpClient, baseURL, resourcePath string) *RunCollectionClient { + return &RunCollectionClient{ctx: newCollectionContext(hc, baseURL, resourcePath)} +} + +// List lists runs, applying the standard pagination and the run-specific filters. +func (c *RunCollectionClient) List(ctx context.Context, options ListOptions, filter RunListOptions) (PaginationList[ActorRun], error) { + params := NewQueryParams() + options.apply(params) + filter.apply(params) + return listResource[ActorRun](ctx, c.ctx, "", params) +} diff --git a/schedule.go b/schedule.go new file mode 100644 index 0000000..40ae741 --- /dev/null +++ b/schedule.go @@ -0,0 +1,61 @@ +package apify + +import "context" + +// ScheduleCollectionClient is a client for the schedule collection +// (GET/POST /v2/schedules). +type ScheduleCollectionClient struct { + ctx *resourceContext +} + +func newScheduleCollectionClient(hc *httpClient, baseURL string) *ScheduleCollectionClient { + return &ScheduleCollectionClient{ctx: newCollectionContext(hc, baseURL, "schedules")} +} + +// List lists the account's schedules. +func (c *ScheduleCollectionClient) List(ctx context.Context, options ListOptions) (PaginationList[Schedule], error) { + params := NewQueryParams() + options.apply(params) + return listResource[Schedule](ctx, c.ctx, "", params) +} + +// Create creates a new schedule. schedule is any JSON-serializable schedule definition. +func (c *ScheduleCollectionClient) Create(ctx context.Context, schedule any) (Schedule, error) { + return createResource[Schedule](ctx, c.ctx, NewQueryParams(), schedule) +} + +// ScheduleClient is a client for a specific schedule (/v2/schedules/{scheduleId}). +type ScheduleClient struct { + ctx *resourceContext +} + +func newScheduleClient(hc *httpClient, baseURL, id string) *ScheduleClient { + return &ScheduleClient{ctx: newSingleContext(hc, baseURL, "schedules", id)} +} + +// Get fetches the schedule. The bool reports whether it exists. +func (c *ScheduleClient) Get(ctx context.Context) (Schedule, bool, error) { + return getResource[Schedule](ctx, c.ctx, "", NewQueryParams()) +} + +// Update updates the schedule with the given fields and returns the updated object. +func (c *ScheduleClient) Update(ctx context.Context, newFields any) (Schedule, error) { + return updateResource[Schedule](ctx, c.ctx, "", newFields) +} + +// Delete deletes the schedule. +func (c *ScheduleClient) Delete(ctx context.Context) error { + return deleteResource(ctx, c.ctx, "") +} + +// GetLog fetches the schedule's invocation log as text, or (\"\", false, nil) if absent. +func (c *ScheduleClient) GetLog(ctx context.Context) (string, bool, error) { + resp, err := getRaw(ctx, c.ctx, "log", NewQueryParams()) + if err != nil { + return "", false, err + } + if resp == nil { + return "", false, nil + } + return string(resp.body), true, nil +} diff --git a/signature.go b/signature.go new file mode 100644 index 0000000..8beb905 --- /dev/null +++ b/signature.go @@ -0,0 +1,84 @@ +package apify + +import ( + "crypto/hmac" + "crypto/sha256" + "encoding/base64" + "encoding/hex" + "math/big" + "time" +) + +// Constants for the Apify storage-content signing scheme, matching the platform's +// @apify/utilities implementation that the reference clients rely on. +const ( + // storageContentSignatureVersion is the version tag embedded in signatures. The + // reference clients rely on the upstream default of "0". + storageContentSignatureVersion = "0" + // hmacSignatureHexLen is the number of leading hex characters of the HMAC digest used. + hmacSignatureHexLen = 30 + // base62Alphabet is the alphabet (lowercase first) used to encode the truncated HMAC. + base62Alphabet = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" +) + +// createHmacSignature computes an Apify URL-signing signature, byte-for-byte compatible +// with the platform's @apify/utilities createHmacSignature. +// +// The algorithm is HMAC-SHA256(secretKey, message) as lowercase hex, take the first 30 +// hex characters, interpret them as a big integer, then base62-encode (alphabet 0-9a-zA-Z). +func createHmacSignature(secretKey, message string) string { + mac := hmac.New(sha256.New, []byte(secretKey)) + mac.Write([]byte(message)) + digest := mac.Sum(nil) + + full := hex.EncodeToString(digest) + truncated := full[:hmacSignatureHexLen] + value := new(big.Int) + value.SetString(truncated, 16) + return toBase62(value) +} + +// toBase62 encodes a non-negative big integer in base62 using the 0-9a-zA-Z alphabet. +func toBase62(value *big.Int) string { + if value.Sign() == 0 { + return "0" + } + base := big.NewInt(int64(len(base62Alphabet))) + mod := new(big.Int) + v := new(big.Int).Set(value) + var digits []byte + for v.Sign() > 0 { + v.DivMod(v, base, mod) + digits = append(digits, base62Alphabet[mod.Int64()]) + } + // reverse + for i, j := 0, len(digits)-1; i < j; i, j = i+1, j-1 { + digits[i], digits[j] = digits[j], digits[i] + } + return string(digits) +} + +// signStorageContent builds a storage-content signature for a resource's public URL, +// byte-for-byte compatible with @apify/utilities createStorageContentSignature. +// +// It signs the message "{version}.{expiresAtMillis}.{resourceId}" (expiresAtMillis is the +// absolute expiry in ms, or 0 for a non-expiring URL) with createHmacSignature, then +// returns the base64url (no padding) encoding of "{version}.{expiresAtMillis}.{hmac}". +// +// expiresInSecs is optional (nil for a non-expiring URL). +func signStorageContent(secretKey, resourceID string, expiresInSecs *int64) string { + var expiresAtMillis int64 + if expiresInSecs != nil { + expiresAtMillis = time.Now().UnixMilli() + *expiresInSecs*1000 + } + version := storageContentSignatureVersion + message := version + "." + itoa(expiresAtMillis) + "." + resourceID + mac := createHmacSignature(secretKey, message) + envelope := version + "." + itoa(expiresAtMillis) + "." + mac + return base64.RawURLEncoding.EncodeToString([]byte(envelope)) +} + +// itoa is a tiny int64-to-string helper to keep signStorageContent readable. +func itoa(v int64) string { + return big.NewInt(v).String() +} diff --git a/signature_test.go b/signature_test.go new file mode 100644 index 0000000..f47ebba --- /dev/null +++ b/signature_test.go @@ -0,0 +1,41 @@ +package apify + +import ( + "encoding/base64" + "math/big" + "testing" +) + +// Known-answer test pinning createHmacSignature against upstream @apify/utilities: +// HMAC-SHA256 -> hex -> first 30 hex chars -> big integer -> base62 (alphabet 0-9a-zA-Z). +// For key="secret", msg="message" the upstream output is "11GYWmGxviysIBMtnQHBk". +func TestHmacSignatureMatchesUpstream(t *testing.T) { + sig := createHmacSignature("secret", "message") + if sig != "11GYWmGxviysIBMtnQHBk" { + t.Fatalf("unexpected signature %q", sig) + } +} + +func TestToBase62(t *testing.T) { + cases := map[int64]string{0: "0", 61: "Z", 62: "10"} + for in, want := range cases { + got := toBase62(big.NewInt(in)) + if got != want { + t.Fatalf("toBase62(%d) = %q, want %q", in, got, want) + } + } +} + +// A non-expiring storage-content signature uses version "0" and expiresAt 0, and is the +// base64url (no-pad) encoding of "0.0.<hmac>" where the hmac is over "0.0.RESID". +func TestStorageContentSignatureNonExpiring(t *testing.T) { + sig := signStorageContent("secret", "RESID", nil) + decoded, err := base64.RawURLEncoding.DecodeString(sig) + if err != nil { + t.Fatalf("not valid base64url: %v", err) + } + expected := "0.0." + createHmacSignature("secret", "0.0.RESID") + if string(decoded) != expected { + t.Fatalf("got %q, want %q", string(decoded), expected) + } +} diff --git a/store_collection.go b/store_collection.go new file mode 100644 index 0000000..8feb228 --- /dev/null +++ b/store_collection.go @@ -0,0 +1,109 @@ +package apify + +import "context" + +// StoreListOptions configures listing/iterating the Apify Store. +type StoreListOptions struct { + // Offset is the number of Actors to skip. + Offset *int64 + // Limit is the maximum number of Actors to return. + Limit *int64 + // Search filters Actors by a full-text search query. + Search *string + // SortBy sets the sort field (e.g. "popularity", "newest"). + SortBy *string + // Category filters Actors by category. + Category *string + // Username filters Actors by owner username. + Username *string + // PricingModel filters Actors by pricing model (e.g. "FREE", "FLAT_PRICE_PER_MONTH"). + PricingModel *string + // IncludeUnrunnableActors includes Actors the current user cannot run. + IncludeUnrunnableActors *bool + // AllowsAgenticUsers filters to Actors that allow agentic users. + AllowsAgenticUsers *bool + // ResponseFormat selects the response format. + ResponseFormat *string +} + +func (o StoreListOptions) apply(q *QueryParams) { + q.AddInt("offset", o.Offset). + AddInt("limit", o.Limit). + AddString("search", o.Search). + AddString("sortBy", o.SortBy). + AddString("category", o.Category). + AddString("username", o.Username). + AddString("pricingModel", o.PricingModel). + AddBool("includeUnrunnableActors", o.IncludeUnrunnableActors). + AddBool("allowsAgenticUsers", o.AllowsAgenticUsers). + AddString("responseFormat", o.ResponseFormat) +} + +// StoreCollectionClient is a client for browsing the Apify Store (GET /v2/store). +type StoreCollectionClient struct { + ctx *resourceContext +} + +func newStoreCollectionClient(hc *httpClient, baseURL string) *StoreCollectionClient { + return &StoreCollectionClient{ctx: newCollectionContext(hc, baseURL, "store")} +} + +// List returns a single page of Store Actors matching the options. +func (c *StoreCollectionClient) List(ctx context.Context, options StoreListOptions) (PaginationList[ActorStoreListItem], error) { + params := NewQueryParams() + options.apply(params) + return listResource[ActorStoreListItem](ctx, c.ctx, "", params) +} + +// Iterate returns a lazy iterator over all Store Actors matching the options, fetching pages +// on demand. The options' Limit (if set) is used as the per-page size. +func (c *StoreCollectionClient) Iterate(options StoreListOptions) *StoreActorIterator { + return &StoreActorIterator{client: c, options: options} +} + +// StoreActorIterator lazily iterates over Apify Store Actors, fetching one page at a time. +type StoreActorIterator struct { + client *StoreCollectionClient + options StoreListOptions + + buffer []ActorStoreListItem + pos int + offset int64 + total int64 + exhausted bool +} + +// Next returns the next Store Actor, or (nil, nil) when the iterator is exhausted. +func (it *StoreActorIterator) Next(ctx context.Context) (*ActorStoreListItem, error) { + for it.pos >= len(it.buffer) { + if it.exhausted { + return nil, nil + } + if err := it.fetchPage(ctx); err != nil { + return nil, err + } + } + item := it.buffer[it.pos] + it.pos++ + return &item, nil +} + +// fetchPage loads the next page of Store Actors into the buffer. +func (it *StoreActorIterator) fetchPage(ctx context.Context) error { + opts := it.options + opts.Offset = &it.offset + page, err := it.client.List(ctx, opts) + if err != nil { + return err + } + it.buffer = page.Items + it.pos = 0 + it.total = page.Total + it.offset += int64(len(page.Items)) + + // Exhausted when the page is empty or we have reached the reported total. + if len(page.Items) == 0 || it.offset >= it.total { + it.exhausted = true + } + return nil +} diff --git a/task.go b/task.go new file mode 100644 index 0000000..df83f4a --- /dev/null +++ b/task.go @@ -0,0 +1,138 @@ +package apify + +import ( + "context" + "encoding/json" +) + +// TaskClient is a client for a specific Actor task. +// +// Tasks are pre-configured Actor runs with stored input. The client provides CRUD methods +// plus convenience helpers to start/call the task and access its input, runs and webhooks. +type TaskClient struct { + root *ApifyClient + ctx *resourceContext +} + +func newTaskClient(root *ApifyClient, hc *httpClient, baseURL, id string) *TaskClient { + return &TaskClient{root: root, ctx: newSingleContext(hc, baseURL, "actor-tasks", id)} +} + +// Get fetches the task object. The bool reports whether it exists. +func (c *TaskClient) Get(ctx context.Context) (Task, bool, error) { + return getResource[Task](ctx, c.ctx, "", NewQueryParams()) +} + +// Update updates the task with the given fields and returns the updated object. +func (c *TaskClient) Update(ctx context.Context, newFields any) (Task, error) { + return updateResource[Task](ctx, c.ctx, "", newFields) +} + +// Delete deletes the task. +func (c *TaskClient) Delete(ctx context.Context) error { + return deleteResource(ctx, c.ctx, "") +} + +// TaskStartOptions configures starting a task run ([TaskClient.Start]/[TaskClient.Call]). +// +// It mirrors [ActorStartOptions] but omits the fields the task run endpoint does not accept +// (the Actor-only `contentType` and `forcePermissionLevel`), matching the reference client. +type TaskStartOptions struct { + // Build is the tag or number of the build to run (e.g. "latest", "0.1.2"). + Build *string + // MemoryMbytes is the memory in megabytes allocated for the run. + MemoryMbytes *int64 + // TimeoutSecs is the timeout for the run in seconds (0 means no timeout). + TimeoutSecs *int64 + // WaitForFinish is the maximum seconds to wait server-side for the run to finish (max 60). + WaitForFinish *int64 + // MaxItems is the maximum number of dataset items to charge (pay-per-result Actors). + MaxItems *int64 + // MaxTotalChargeUsd is the maximum total charge in USD (pay-per-event Actors). + MaxTotalChargeUsd *float64 + // RestartOnError, if true, restarts the run if it fails. + RestartOnError *bool + // Webhooks are ad-hoc webhooks to attach to this run (base64-encoded JSON). + Webhooks []any +} + +func (o TaskStartOptions) apply(q *QueryParams) { + q.AddString("build", o.Build). + AddInt("memory", o.MemoryMbytes). + AddInt("timeout", o.TimeoutSecs). + AddInt("waitForFinish", o.WaitForFinish). + AddInt("maxItems", o.MaxItems). + AddFloat("maxTotalChargeUsd", o.MaxTotalChargeUsd). + AddBool("restartOnError", o.RestartOnError) + if encoded := encodeWebhooks(o.Webhooks); encoded != nil { + q.AddString("webhooks", encoded) + } +} + +// Start starts the task and returns immediately with the created run. input optionally +// overrides the task's stored input (nil to use the stored input). +func (c *TaskClient) Start(ctx context.Context, input any, options TaskStartOptions) (ActorRun, error) { + params := NewQueryParams() + options.apply(params) + body, err := marshalInput(input) + if err != nil { + return ActorRun{}, err + } + return postWithBody[ActorRun](ctx, c.ctx, "runs", params, body, contentTypeJSON) +} + +// Call starts the task and waits (client-side polling) for it to finish. waitSecs bounds the +// wait; nil waits indefinitely. +func (c *TaskClient) Call(ctx context.Context, input any, options TaskStartOptions, waitSecs *int64) (ActorRun, error) { + run, err := c.Start(ctx, input, options) + if err != nil { + return ActorRun{}, err + } + return c.root.Run(run.ID).WaitForFinish(ctx, waitSecs) +} + +// GetInput fetches the task's stored input, or (nil, false, nil) if none is set. +func (c *TaskClient) GetInput(ctx context.Context) (json.RawMessage, bool, error) { + resp, err := getRaw(ctx, c.ctx, "input", NewQueryParams()) + if err != nil { + return nil, false, err + } + if resp == nil { + return nil, false, nil + } + return resp.body, true, nil +} + +// UpdateInput replaces the task's stored input and returns the updated input. +func (c *TaskClient) UpdateInput(ctx context.Context, input any) (json.RawMessage, error) { + data, err := json.Marshal(input) + if err != nil { + return nil, err + } + url := c.ctx.subURL("input") + resp, err := c.ctx.http.call(ctx, "PUT", url, data, contentTypeJSON, defaultRequestTimeout) + if err != nil { + return nil, err + } + return resp.body, nil +} + +// LastRun returns a client for the last run of this task, optionally filtered by status +// (e.g. "SUCCEEDED"). Pass an empty status for no filter. +func (c *TaskClient) LastRun(status string) *RunClient { + client := newRunClient(c.root, c.ctx.http, c.ctx.subURL(""), "runs", "last") + if status != "" { + client.setStatusParam(status) + } + return client +} + +// Runs returns a client for this task's run collection. +func (c *TaskClient) Runs() *RunCollectionClient { + return newRunCollectionClient(c.ctx.http, c.ctx.subURL(""), "runs") +} + +// Webhooks returns a client for this task's webhook collection. +func (c *TaskClient) Webhooks() *WebhookCollectionClient { + return newWebhookCollectionClientWithBase(c.ctx.http, c.ctx.subURL("")) +} diff --git a/task_collection.go b/task_collection.go new file mode 100644 index 0000000..2020e3f --- /dev/null +++ b/task_collection.go @@ -0,0 +1,25 @@ +package apify + +import "context" + +// TaskCollectionClient is a client for the Actor task collection +// (GET/POST /v2/actor-tasks). +type TaskCollectionClient struct { + ctx *resourceContext +} + +func newTaskCollectionClient(hc *httpClient, baseURL string) *TaskCollectionClient { + return &TaskCollectionClient{ctx: newCollectionContext(hc, baseURL, "actor-tasks")} +} + +// List lists the account's tasks. +func (c *TaskCollectionClient) List(ctx context.Context, options ListOptions) (PaginationList[Task], error) { + params := NewQueryParams() + options.apply(params) + return listResource[Task](ctx, c.ctx, "", params) +} + +// Create creates a new task. task is any JSON-serializable task definition. +func (c *TaskCollectionClient) Create(ctx context.Context, task any) (Task, error) { + return createResource[Task](ctx, c.ctx, NewQueryParams(), task) +} diff --git a/test/api_actor_builds_test.go b/test/api_actor_builds_test.go deleted file mode 100644 index 2b6ad31..0000000 --- a/test/api_actor_builds_test.go +++ /dev/null @@ -1,106 +0,0 @@ -/* -Apify API - -Testing ActorBuildsAPIService - -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); - -package apifyclient - -import ( - "context" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - "testing" - openapiclient "github.com/apify/apify-client-go" -) - -func Test_apifyclient_ActorBuildsAPIService(t *testing.T) { - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - - t.Run("Test ActorBuildsAPIService ActorBuildAbortPost", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var buildId string - - resp, httpRes, err := apiClient.ActorBuildsAPI.ActorBuildAbortPost(context.Background(), buildId).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test ActorBuildsAPIService ActorBuildDelete", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var buildId string - - httpRes, err := apiClient.ActorBuildsAPI.ActorBuildDelete(context.Background(), buildId).Execute() - - require.Nil(t, err) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test ActorBuildsAPIService ActorBuildGet", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var buildId string - - resp, httpRes, err := apiClient.ActorBuildsAPI.ActorBuildGet(context.Background(), buildId).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test ActorBuildsAPIService ActorBuildLogGet", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var buildId string - - resp, httpRes, err := apiClient.ActorBuildsAPI.ActorBuildLogGet(context.Background(), buildId).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test ActorBuildsAPIService ActorBuildOpenapiJsonGet", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var buildId string - - resp, httpRes, err := apiClient.ActorBuildsAPI.ActorBuildOpenapiJsonGet(context.Background(), buildId).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test ActorBuildsAPIService ActorBuildsGet", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - resp, httpRes, err := apiClient.ActorBuildsAPI.ActorBuildsGet(context.Background()).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - -} diff --git a/test/api_actor_runs_test.go b/test/api_actor_runs_test.go deleted file mode 100644 index 9ff499d..0000000 --- a/test/api_actor_runs_test.go +++ /dev/null @@ -1,162 +0,0 @@ -/* -Apify API - -Testing ActorRunsAPIService - -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); - -package apifyclient - -import ( - "context" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - "testing" - openapiclient "github.com/apify/apify-client-go" -) - -func Test_apifyclient_ActorRunsAPIService(t *testing.T) { - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - - t.Run("Test ActorRunsAPIService ActorRunAbortPost", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var runId string - - resp, httpRes, err := apiClient.ActorRunsAPI.ActorRunAbortPost(context.Background(), runId).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test ActorRunsAPIService ActorRunDelete", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var runId string - - httpRes, err := apiClient.ActorRunsAPI.ActorRunDelete(context.Background(), runId).Execute() - - require.Nil(t, err) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test ActorRunsAPIService ActorRunGet", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var runId string - - resp, httpRes, err := apiClient.ActorRunsAPI.ActorRunGet(context.Background(), runId).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test ActorRunsAPIService ActorRunLogGet", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var runId string - - resp, httpRes, err := apiClient.ActorRunsAPI.ActorRunLogGet(context.Background(), runId).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test ActorRunsAPIService ActorRunMetamorphPost", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var runId string - - resp, httpRes, err := apiClient.ActorRunsAPI.ActorRunMetamorphPost(context.Background(), runId).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test ActorRunsAPIService ActorRunPut", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var runId string - - resp, httpRes, err := apiClient.ActorRunsAPI.ActorRunPut(context.Background(), runId).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test ActorRunsAPIService ActorRunRebootPost", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var runId string - - resp, httpRes, err := apiClient.ActorRunsAPI.ActorRunRebootPost(context.Background(), runId).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test ActorRunsAPIService ActorRunsGet", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - resp, httpRes, err := apiClient.ActorRunsAPI.ActorRunsGet(context.Background()).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test ActorRunsAPIService PostChargeRun", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var runId string - - resp, httpRes, err := apiClient.ActorRunsAPI.PostChargeRun(context.Background(), runId).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test ActorRunsAPIService PostResurrectRun", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var runId string - - resp, httpRes, err := apiClient.ActorRunsAPI.PostResurrectRun(context.Background(), runId).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - -} diff --git a/test/api_actor_tasks_test.go b/test/api_actor_tasks_test.go deleted file mode 100644 index 5dded6e..0000000 --- a/test/api_actor_tasks_test.go +++ /dev/null @@ -1,231 +0,0 @@ -/* -Apify API - -Testing ActorTasksAPIService - -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); - -package apifyclient - -import ( - "context" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - "testing" - openapiclient "github.com/apify/apify-client-go" -) - -func Test_apifyclient_ActorTasksAPIService(t *testing.T) { - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - - t.Run("Test ActorTasksAPIService ActorTaskDelete", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var actorTaskId string - - resp, httpRes, err := apiClient.ActorTasksAPI.ActorTaskDelete(context.Background(), actorTaskId).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test ActorTasksAPIService ActorTaskGet", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var actorTaskId string - - resp, httpRes, err := apiClient.ActorTasksAPI.ActorTaskGet(context.Background(), actorTaskId).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test ActorTasksAPIService ActorTaskInputGet", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var actorTaskId string - - resp, httpRes, err := apiClient.ActorTasksAPI.ActorTaskInputGet(context.Background(), actorTaskId).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test ActorTasksAPIService ActorTaskInputPut", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var actorTaskId string - - resp, httpRes, err := apiClient.ActorTasksAPI.ActorTaskInputPut(context.Background(), actorTaskId).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test ActorTasksAPIService ActorTaskPut", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var actorTaskId string - - resp, httpRes, err := apiClient.ActorTasksAPI.ActorTaskPut(context.Background(), actorTaskId).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test ActorTasksAPIService ActorTaskRunSyncGet", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var actorTaskId string - - resp, httpRes, err := apiClient.ActorTasksAPI.ActorTaskRunSyncGet(context.Background(), actorTaskId).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test ActorTasksAPIService ActorTaskRunSyncGetDatasetItemsGet", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var actorTaskId string - - resp, httpRes, err := apiClient.ActorTasksAPI.ActorTaskRunSyncGetDatasetItemsGet(context.Background(), actorTaskId).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test ActorTasksAPIService ActorTaskRunSyncGetDatasetItemsPost", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var actorTaskId string - - resp, httpRes, err := apiClient.ActorTasksAPI.ActorTaskRunSyncGetDatasetItemsPost(context.Background(), actorTaskId).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test ActorTasksAPIService ActorTaskRunSyncPost", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var actorTaskId string - - resp, httpRes, err := apiClient.ActorTasksAPI.ActorTaskRunSyncPost(context.Background(), actorTaskId).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test ActorTasksAPIService ActorTaskRunsGet", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var actorTaskId string - - resp, httpRes, err := apiClient.ActorTasksAPI.ActorTaskRunsGet(context.Background(), actorTaskId).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test ActorTasksAPIService ActorTaskRunsLastGet", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var actorTaskId string - - resp, httpRes, err := apiClient.ActorTasksAPI.ActorTaskRunsLastGet(context.Background(), actorTaskId).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test ActorTasksAPIService ActorTaskRunsPost", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var actorTaskId string - - resp, httpRes, err := apiClient.ActorTasksAPI.ActorTaskRunsPost(context.Background(), actorTaskId).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test ActorTasksAPIService ActorTaskWebhooksGet", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var actorTaskId string - - resp, httpRes, err := apiClient.ActorTasksAPI.ActorTaskWebhooksGet(context.Background(), actorTaskId).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test ActorTasksAPIService ActorTasksGet", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - resp, httpRes, err := apiClient.ActorTasksAPI.ActorTasksGet(context.Background()).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test ActorTasksAPIService ActorTasksPost", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - resp, httpRes, err := apiClient.ActorTasksAPI.ActorTasksPost(context.Background()).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - -} diff --git a/test/api_actors_actor_builds_test.go b/test/api_actors_actor_builds_test.go deleted file mode 100644 index 964bd6c..0000000 --- a/test/api_actors_actor_builds_test.go +++ /dev/null @@ -1,112 +0,0 @@ -/* -Apify API - -Testing ActorsActorBuildsAPIService - -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); - -package apifyclient - -import ( - "context" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - "testing" - openapiclient "github.com/apify/apify-client-go" -) - -func Test_apifyclient_ActorsActorBuildsAPIService(t *testing.T) { - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - - t.Run("Test ActorsActorBuildsAPIService ActBuildAbortPost", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var actorId string - var buildId string - - resp, httpRes, err := apiClient.ActorsActorBuildsAPI.ActBuildAbortPost(context.Background(), actorId, buildId).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test ActorsActorBuildsAPIService ActBuildDefaultGet", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var actorId string - - resp, httpRes, err := apiClient.ActorsActorBuildsAPI.ActBuildDefaultGet(context.Background(), actorId).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test ActorsActorBuildsAPIService ActBuildGet", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var actorId string - var buildId string - - resp, httpRes, err := apiClient.ActorsActorBuildsAPI.ActBuildGet(context.Background(), actorId, buildId).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test ActorsActorBuildsAPIService ActBuildsGet", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var actorId string - - resp, httpRes, err := apiClient.ActorsActorBuildsAPI.ActBuildsGet(context.Background(), actorId).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test ActorsActorBuildsAPIService ActBuildsPost", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var actorId string - - resp, httpRes, err := apiClient.ActorsActorBuildsAPI.ActBuildsPost(context.Background(), actorId).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test ActorsActorBuildsAPIService ActOpenapiJsonGet", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var actorId string - var buildId string - - resp, httpRes, err := apiClient.ActorsActorBuildsAPI.ActOpenapiJsonGet(context.Background(), actorId, buildId).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - -} diff --git a/test/api_actors_actor_runs_test.go b/test/api_actors_actor_runs_test.go deleted file mode 100644 index 932df62..0000000 --- a/test/api_actors_actor_runs_test.go +++ /dev/null @@ -1,183 +0,0 @@ -/* -Apify API - -Testing ActorsActorRunsAPIService - -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); - -package apifyclient - -import ( - "context" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - "testing" - openapiclient "github.com/apify/apify-client-go" -) - -func Test_apifyclient_ActorsActorRunsAPIService(t *testing.T) { - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - - t.Run("Test ActorsActorRunsAPIService ActRunAbortPost", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var actorId string - var runId string - - resp, httpRes, err := apiClient.ActorsActorRunsAPI.ActRunAbortPost(context.Background(), actorId, runId).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test ActorsActorRunsAPIService ActRunGet", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var actorId string - var runId string - - resp, httpRes, err := apiClient.ActorsActorRunsAPI.ActRunGet(context.Background(), actorId, runId).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test ActorsActorRunsAPIService ActRunMetamorphPost", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var actorId string - var runId string - - resp, httpRes, err := apiClient.ActorsActorRunsAPI.ActRunMetamorphPost(context.Background(), actorId, runId).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test ActorsActorRunsAPIService ActRunResurrectPost", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var actorId string - var runId string - - resp, httpRes, err := apiClient.ActorsActorRunsAPI.ActRunResurrectPost(context.Background(), actorId, runId).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test ActorsActorRunsAPIService ActRunSyncGet", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var actorId string - - resp, httpRes, err := apiClient.ActorsActorRunsAPI.ActRunSyncGet(context.Background(), actorId).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test ActorsActorRunsAPIService ActRunSyncGetDatasetItemsGet", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var actorId string - - resp, httpRes, err := apiClient.ActorsActorRunsAPI.ActRunSyncGetDatasetItemsGet(context.Background(), actorId).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test ActorsActorRunsAPIService ActRunSyncGetDatasetItemsPost", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var actorId string - - resp, httpRes, err := apiClient.ActorsActorRunsAPI.ActRunSyncGetDatasetItemsPost(context.Background(), actorId).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test ActorsActorRunsAPIService ActRunSyncPost", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var actorId string - - resp, httpRes, err := apiClient.ActorsActorRunsAPI.ActRunSyncPost(context.Background(), actorId).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test ActorsActorRunsAPIService ActRunsGet", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var actorId string - - resp, httpRes, err := apiClient.ActorsActorRunsAPI.ActRunsGet(context.Background(), actorId).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test ActorsActorRunsAPIService ActRunsLastGet", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var actorId string - - resp, httpRes, err := apiClient.ActorsActorRunsAPI.ActRunsLastGet(context.Background(), actorId).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test ActorsActorRunsAPIService ActRunsPost", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var actorId string - - resp, httpRes, err := apiClient.ActorsActorRunsAPI.ActRunsPost(context.Background(), actorId).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - -} diff --git a/test/api_actors_actor_versions_test.go b/test/api_actors_actor_versions_test.go deleted file mode 100644 index c009cd2..0000000 --- a/test/api_actors_actor_versions_test.go +++ /dev/null @@ -1,207 +0,0 @@ -/* -Apify API - -Testing ActorsActorVersionsAPIService - -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); - -package apifyclient - -import ( - "context" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - "testing" - openapiclient "github.com/apify/apify-client-go" -) - -func Test_apifyclient_ActorsActorVersionsAPIService(t *testing.T) { - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - - t.Run("Test ActorsActorVersionsAPIService ActVersionDelete", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var actorId string - var versionNumber string - - resp, httpRes, err := apiClient.ActorsActorVersionsAPI.ActVersionDelete(context.Background(), actorId, versionNumber).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test ActorsActorVersionsAPIService ActVersionEnvVarDelete", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var actorId string - var versionNumber string - var envVarName string - - resp, httpRes, err := apiClient.ActorsActorVersionsAPI.ActVersionEnvVarDelete(context.Background(), actorId, versionNumber, envVarName).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test ActorsActorVersionsAPIService ActVersionEnvVarGet", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var actorId string - var versionNumber string - var envVarName string - - resp, httpRes, err := apiClient.ActorsActorVersionsAPI.ActVersionEnvVarGet(context.Background(), actorId, versionNumber, envVarName).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test ActorsActorVersionsAPIService ActVersionEnvVarPost", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var actorId string - var versionNumber string - var envVarName string - - resp, httpRes, err := apiClient.ActorsActorVersionsAPI.ActVersionEnvVarPost(context.Background(), actorId, versionNumber, envVarName).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test ActorsActorVersionsAPIService ActVersionEnvVarPut", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var actorId string - var versionNumber string - var envVarName string - - resp, httpRes, err := apiClient.ActorsActorVersionsAPI.ActVersionEnvVarPut(context.Background(), actorId, versionNumber, envVarName).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test ActorsActorVersionsAPIService ActVersionEnvVarsGet", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var actorId string - var versionNumber string - - resp, httpRes, err := apiClient.ActorsActorVersionsAPI.ActVersionEnvVarsGet(context.Background(), actorId, versionNumber).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test ActorsActorVersionsAPIService ActVersionEnvVarsPost", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var actorId string - var versionNumber string - - resp, httpRes, err := apiClient.ActorsActorVersionsAPI.ActVersionEnvVarsPost(context.Background(), actorId, versionNumber).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test ActorsActorVersionsAPIService ActVersionGet", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var actorId string - var versionNumber string - - resp, httpRes, err := apiClient.ActorsActorVersionsAPI.ActVersionGet(context.Background(), actorId, versionNumber).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test ActorsActorVersionsAPIService ActVersionPost", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var actorId string - var versionNumber string - - resp, httpRes, err := apiClient.ActorsActorVersionsAPI.ActVersionPost(context.Background(), actorId, versionNumber).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test ActorsActorVersionsAPIService ActVersionPut", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var actorId string - var versionNumber string - - resp, httpRes, err := apiClient.ActorsActorVersionsAPI.ActVersionPut(context.Background(), actorId, versionNumber).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test ActorsActorVersionsAPIService ActVersionsGet", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var actorId string - - resp, httpRes, err := apiClient.ActorsActorVersionsAPI.ActVersionsGet(context.Background(), actorId).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test ActorsActorVersionsAPIService ActVersionsPost", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var actorId string - - resp, httpRes, err := apiClient.ActorsActorVersionsAPI.ActVersionsPost(context.Background(), actorId).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - -} diff --git a/test/api_actors_test.go b/test/api_actors_test.go deleted file mode 100644 index 8bd3c73..0000000 --- a/test/api_actors_test.go +++ /dev/null @@ -1,105 +0,0 @@ -/* -Apify API - -Testing ActorsAPIService - -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); - -package apifyclient - -import ( - "context" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - "testing" - openapiclient "github.com/apify/apify-client-go" -) - -func Test_apifyclient_ActorsAPIService(t *testing.T) { - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - - t.Run("Test ActorsAPIService ActDelete", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var actorId string - - resp, httpRes, err := apiClient.ActorsAPI.ActDelete(context.Background(), actorId).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test ActorsAPIService ActGet", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var actorId string - - resp, httpRes, err := apiClient.ActorsAPI.ActGet(context.Background(), actorId).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test ActorsAPIService ActPut", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var actorId string - - resp, httpRes, err := apiClient.ActorsAPI.ActPut(context.Background(), actorId).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test ActorsAPIService ActValidateInputPost", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var actorId string - - resp, httpRes, err := apiClient.ActorsAPI.ActValidateInputPost(context.Background(), actorId).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test ActorsAPIService ActsGet", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - resp, httpRes, err := apiClient.ActorsAPI.ActsGet(context.Background()).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test ActorsAPIService ActsPost", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - resp, httpRes, err := apiClient.ActorsAPI.ActsPost(context.Background()).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - -} diff --git a/test/api_actors_webhook_collection_test.go b/test/api_actors_webhook_collection_test.go deleted file mode 100644 index a7b7e96..0000000 --- a/test/api_actors_webhook_collection_test.go +++ /dev/null @@ -1,39 +0,0 @@ -/* -Apify API - -Testing ActorsWebhookCollectionAPIService - -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); - -package apifyclient - -import ( - "context" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - "testing" - openapiclient "github.com/apify/apify-client-go" -) - -func Test_apifyclient_ActorsWebhookCollectionAPIService(t *testing.T) { - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - - t.Run("Test ActorsWebhookCollectionAPIService ActWebhooksGet", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var actorId string - - resp, httpRes, err := apiClient.ActorsWebhookCollectionAPI.ActWebhooksGet(context.Background(), actorId).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - -} diff --git a/test/api_default_dataset_test.go b/test/api_default_dataset_test.go deleted file mode 100644 index 96764aa..0000000 --- a/test/api_default_dataset_test.go +++ /dev/null @@ -1,108 +0,0 @@ -/* -Apify API - -Testing DefaultDatasetAPIService - -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); - -package apifyclient - -import ( - "context" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - "testing" - openapiclient "github.com/apify/apify-client-go" -) - -func Test_apifyclient_DefaultDatasetAPIService(t *testing.T) { - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - - t.Run("Test DefaultDatasetAPIService ActorRunDatasetDelete", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var runId string - - httpRes, err := apiClient.DefaultDatasetAPI.ActorRunDatasetDelete(context.Background(), runId).Execute() - - require.Nil(t, err) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test DefaultDatasetAPIService ActorRunDatasetGet", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var runId string - - resp, httpRes, err := apiClient.DefaultDatasetAPI.ActorRunDatasetGet(context.Background(), runId).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test DefaultDatasetAPIService ActorRunDatasetItemsGet", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var runId string - - resp, httpRes, err := apiClient.DefaultDatasetAPI.ActorRunDatasetItemsGet(context.Background(), runId).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test DefaultDatasetAPIService ActorRunDatasetItemsPost", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var runId string - - resp, httpRes, err := apiClient.DefaultDatasetAPI.ActorRunDatasetItemsPost(context.Background(), runId).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test DefaultDatasetAPIService ActorRunDatasetPut", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var runId string - - resp, httpRes, err := apiClient.DefaultDatasetAPI.ActorRunDatasetPut(context.Background(), runId).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test DefaultDatasetAPIService ActorRunDatasetStatisticsGet", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var runId string - - resp, httpRes, err := apiClient.DefaultDatasetAPI.ActorRunDatasetStatisticsGet(context.Background(), runId).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - -} diff --git a/test/api_default_key_value_store_test.go b/test/api_default_key_value_store_test.go deleted file mode 100644 index 6787707..0000000 --- a/test/api_default_key_value_store_test.go +++ /dev/null @@ -1,153 +0,0 @@ -/* -Apify API - -Testing DefaultKeyValueStoreAPIService - -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); - -package apifyclient - -import ( - "context" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - "testing" - openapiclient "github.com/apify/apify-client-go" -) - -func Test_apifyclient_DefaultKeyValueStoreAPIService(t *testing.T) { - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - - t.Run("Test DefaultKeyValueStoreAPIService ActorRunKeyValueStoreDelete", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var runId string - - httpRes, err := apiClient.DefaultKeyValueStoreAPI.ActorRunKeyValueStoreDelete(context.Background(), runId).Execute() - - require.Nil(t, err) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test DefaultKeyValueStoreAPIService ActorRunKeyValueStoreGet", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var runId string - - resp, httpRes, err := apiClient.DefaultKeyValueStoreAPI.ActorRunKeyValueStoreGet(context.Background(), runId).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test DefaultKeyValueStoreAPIService ActorRunKeyValueStoreKeysGet", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var runId string - - resp, httpRes, err := apiClient.DefaultKeyValueStoreAPI.ActorRunKeyValueStoreKeysGet(context.Background(), runId).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test DefaultKeyValueStoreAPIService ActorRunKeyValueStorePut", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var runId string - - resp, httpRes, err := apiClient.DefaultKeyValueStoreAPI.ActorRunKeyValueStorePut(context.Background(), runId).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test DefaultKeyValueStoreAPIService ActorRunKeyValueStoreRecordDelete", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var runId string - var recordKey string - - httpRes, err := apiClient.DefaultKeyValueStoreAPI.ActorRunKeyValueStoreRecordDelete(context.Background(), runId, recordKey).Execute() - - require.Nil(t, err) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test DefaultKeyValueStoreAPIService ActorRunKeyValueStoreRecordGet", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var runId string - var recordKey string - - resp, httpRes, err := apiClient.DefaultKeyValueStoreAPI.ActorRunKeyValueStoreRecordGet(context.Background(), runId, recordKey).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test DefaultKeyValueStoreAPIService ActorRunKeyValueStoreRecordPost", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var runId string - var recordKey string - - resp, httpRes, err := apiClient.DefaultKeyValueStoreAPI.ActorRunKeyValueStoreRecordPost(context.Background(), runId, recordKey).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test DefaultKeyValueStoreAPIService ActorRunKeyValueStoreRecordPut", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var runId string - var recordKey string - - resp, httpRes, err := apiClient.DefaultKeyValueStoreAPI.ActorRunKeyValueStoreRecordPut(context.Background(), runId, recordKey).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test DefaultKeyValueStoreAPIService ActorRunKeyValueStoreRecordsGet", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var runId string - - resp, httpRes, err := apiClient.DefaultKeyValueStoreAPI.ActorRunKeyValueStoreRecordsGet(context.Background(), runId).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - -} diff --git a/test/api_default_request_queue_test.go b/test/api_default_request_queue_test.go deleted file mode 100644 index 1e1e1bd..0000000 --- a/test/api_default_request_queue_test.go +++ /dev/null @@ -1,237 +0,0 @@ -/* -Apify API - -Testing DefaultRequestQueueAPIService - -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); - -package apifyclient - -import ( - "context" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - "testing" - openapiclient "github.com/apify/apify-client-go" -) - -func Test_apifyclient_DefaultRequestQueueAPIService(t *testing.T) { - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - - t.Run("Test DefaultRequestQueueAPIService ActorRunRequestQueueDelete", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var runId string - - httpRes, err := apiClient.DefaultRequestQueueAPI.ActorRunRequestQueueDelete(context.Background(), runId).Execute() - - require.Nil(t, err) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test DefaultRequestQueueAPIService ActorRunRequestQueueGet", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var runId string - - resp, httpRes, err := apiClient.DefaultRequestQueueAPI.ActorRunRequestQueueGet(context.Background(), runId).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test DefaultRequestQueueAPIService ActorRunRequestQueueHeadGet", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var runId string - - resp, httpRes, err := apiClient.DefaultRequestQueueAPI.ActorRunRequestQueueHeadGet(context.Background(), runId).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test DefaultRequestQueueAPIService ActorRunRequestQueueHeadLockPost", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var runId string - - resp, httpRes, err := apiClient.DefaultRequestQueueAPI.ActorRunRequestQueueHeadLockPost(context.Background(), runId).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test DefaultRequestQueueAPIService ActorRunRequestQueuePut", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var runId string - - resp, httpRes, err := apiClient.DefaultRequestQueueAPI.ActorRunRequestQueuePut(context.Background(), runId).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test DefaultRequestQueueAPIService ActorRunRequestQueueRequestDelete", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var runId string - var requestId string - - httpRes, err := apiClient.DefaultRequestQueueAPI.ActorRunRequestQueueRequestDelete(context.Background(), runId, requestId).Execute() - - require.Nil(t, err) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test DefaultRequestQueueAPIService ActorRunRequestQueueRequestGet", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var runId string - var requestId string - - resp, httpRes, err := apiClient.DefaultRequestQueueAPI.ActorRunRequestQueueRequestGet(context.Background(), runId, requestId).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test DefaultRequestQueueAPIService ActorRunRequestQueueRequestLockDelete", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var runId string - var requestId string - - httpRes, err := apiClient.DefaultRequestQueueAPI.ActorRunRequestQueueRequestLockDelete(context.Background(), runId, requestId).Execute() - - require.Nil(t, err) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test DefaultRequestQueueAPIService ActorRunRequestQueueRequestLockPut", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var runId string - var requestId string - - resp, httpRes, err := apiClient.DefaultRequestQueueAPI.ActorRunRequestQueueRequestLockPut(context.Background(), runId, requestId).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test DefaultRequestQueueAPIService ActorRunRequestQueueRequestPut", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var runId string - var requestId string - - resp, httpRes, err := apiClient.DefaultRequestQueueAPI.ActorRunRequestQueueRequestPut(context.Background(), runId, requestId).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test DefaultRequestQueueAPIService ActorRunRequestQueueRequestsBatchDelete", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var runId string - - resp, httpRes, err := apiClient.DefaultRequestQueueAPI.ActorRunRequestQueueRequestsBatchDelete(context.Background(), runId).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test DefaultRequestQueueAPIService ActorRunRequestQueueRequestsBatchPost", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var runId string - - resp, httpRes, err := apiClient.DefaultRequestQueueAPI.ActorRunRequestQueueRequestsBatchPost(context.Background(), runId).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test DefaultRequestQueueAPIService ActorRunRequestQueueRequestsGet", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var runId string - - resp, httpRes, err := apiClient.DefaultRequestQueueAPI.ActorRunRequestQueueRequestsGet(context.Background(), runId).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test DefaultRequestQueueAPIService ActorRunRequestQueueRequestsPost", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var runId string - - resp, httpRes, err := apiClient.DefaultRequestQueueAPI.ActorRunRequestQueueRequestsPost(context.Background(), runId).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test DefaultRequestQueueAPIService ActorRunRequestQueueRequestsUnlockPost", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var runId string - - resp, httpRes, err := apiClient.DefaultRequestQueueAPI.ActorRunRequestQueueRequestsUnlockPost(context.Background(), runId).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - -} diff --git a/test/api_last_actor_runs_abort_test.go b/test/api_last_actor_runs_abort_test.go deleted file mode 100644 index bfa2589..0000000 --- a/test/api_last_actor_runs_abort_test.go +++ /dev/null @@ -1,39 +0,0 @@ -/* -Apify API - -Testing LastActorRunsAbortAPIService - -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); - -package apifyclient - -import ( - "context" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - "testing" - openapiclient "github.com/apify/apify-client-go" -) - -func Test_apifyclient_LastActorRunsAbortAPIService(t *testing.T) { - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - - t.Run("Test LastActorRunsAbortAPIService ActRunsLastAbortPost", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var actorId string - - resp, httpRes, err := apiClient.LastActorRunsAbortAPI.ActRunsLastAbortPost(context.Background(), actorId).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - -} diff --git a/test/api_last_actor_runs_default_dataset_test.go b/test/api_last_actor_runs_default_dataset_test.go deleted file mode 100644 index fc37c7b..0000000 --- a/test/api_last_actor_runs_default_dataset_test.go +++ /dev/null @@ -1,108 +0,0 @@ -/* -Apify API - -Testing LastActorRunsDefaultDatasetAPIService - -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); - -package apifyclient - -import ( - "context" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - "testing" - openapiclient "github.com/apify/apify-client-go" -) - -func Test_apifyclient_LastActorRunsDefaultDatasetAPIService(t *testing.T) { - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - - t.Run("Test LastActorRunsDefaultDatasetAPIService ActRunsLastDatasetDelete", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var actorId string - - httpRes, err := apiClient.LastActorRunsDefaultDatasetAPI.ActRunsLastDatasetDelete(context.Background(), actorId).Execute() - - require.Nil(t, err) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test LastActorRunsDefaultDatasetAPIService ActRunsLastDatasetGet", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var actorId string - - resp, httpRes, err := apiClient.LastActorRunsDefaultDatasetAPI.ActRunsLastDatasetGet(context.Background(), actorId).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test LastActorRunsDefaultDatasetAPIService ActRunsLastDatasetItemsGet", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var actorId string - - resp, httpRes, err := apiClient.LastActorRunsDefaultDatasetAPI.ActRunsLastDatasetItemsGet(context.Background(), actorId).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test LastActorRunsDefaultDatasetAPIService ActRunsLastDatasetItemsPost", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var actorId string - - resp, httpRes, err := apiClient.LastActorRunsDefaultDatasetAPI.ActRunsLastDatasetItemsPost(context.Background(), actorId).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test LastActorRunsDefaultDatasetAPIService ActRunsLastDatasetPut", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var actorId string - - resp, httpRes, err := apiClient.LastActorRunsDefaultDatasetAPI.ActRunsLastDatasetPut(context.Background(), actorId).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test LastActorRunsDefaultDatasetAPIService ActRunsLastDatasetStatisticsGet", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var actorId string - - resp, httpRes, err := apiClient.LastActorRunsDefaultDatasetAPI.ActRunsLastDatasetStatisticsGet(context.Background(), actorId).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - -} diff --git a/test/api_last_actor_runs_default_key_value_store_test.go b/test/api_last_actor_runs_default_key_value_store_test.go deleted file mode 100644 index 70a9563..0000000 --- a/test/api_last_actor_runs_default_key_value_store_test.go +++ /dev/null @@ -1,153 +0,0 @@ -/* -Apify API - -Testing LastActorRunsDefaultKeyValueStoreAPIService - -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); - -package apifyclient - -import ( - "context" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - "testing" - openapiclient "github.com/apify/apify-client-go" -) - -func Test_apifyclient_LastActorRunsDefaultKeyValueStoreAPIService(t *testing.T) { - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - - t.Run("Test LastActorRunsDefaultKeyValueStoreAPIService ActRunsLastKeyValueStoreDelete", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var actorId string - - httpRes, err := apiClient.LastActorRunsDefaultKeyValueStoreAPI.ActRunsLastKeyValueStoreDelete(context.Background(), actorId).Execute() - - require.Nil(t, err) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test LastActorRunsDefaultKeyValueStoreAPIService ActRunsLastKeyValueStoreGet", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var actorId string - - resp, httpRes, err := apiClient.LastActorRunsDefaultKeyValueStoreAPI.ActRunsLastKeyValueStoreGet(context.Background(), actorId).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test LastActorRunsDefaultKeyValueStoreAPIService ActRunsLastKeyValueStoreKeysGet", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var actorId string - - resp, httpRes, err := apiClient.LastActorRunsDefaultKeyValueStoreAPI.ActRunsLastKeyValueStoreKeysGet(context.Background(), actorId).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test LastActorRunsDefaultKeyValueStoreAPIService ActRunsLastKeyValueStorePut", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var actorId string - - resp, httpRes, err := apiClient.LastActorRunsDefaultKeyValueStoreAPI.ActRunsLastKeyValueStorePut(context.Background(), actorId).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test LastActorRunsDefaultKeyValueStoreAPIService ActRunsLastKeyValueStoreRecordDelete", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var actorId string - var recordKey string - - httpRes, err := apiClient.LastActorRunsDefaultKeyValueStoreAPI.ActRunsLastKeyValueStoreRecordDelete(context.Background(), actorId, recordKey).Execute() - - require.Nil(t, err) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test LastActorRunsDefaultKeyValueStoreAPIService ActRunsLastKeyValueStoreRecordGet", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var actorId string - var recordKey string - - resp, httpRes, err := apiClient.LastActorRunsDefaultKeyValueStoreAPI.ActRunsLastKeyValueStoreRecordGet(context.Background(), actorId, recordKey).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test LastActorRunsDefaultKeyValueStoreAPIService ActRunsLastKeyValueStoreRecordPost", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var actorId string - var recordKey string - - resp, httpRes, err := apiClient.LastActorRunsDefaultKeyValueStoreAPI.ActRunsLastKeyValueStoreRecordPost(context.Background(), actorId, recordKey).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test LastActorRunsDefaultKeyValueStoreAPIService ActRunsLastKeyValueStoreRecordPut", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var actorId string - var recordKey string - - resp, httpRes, err := apiClient.LastActorRunsDefaultKeyValueStoreAPI.ActRunsLastKeyValueStoreRecordPut(context.Background(), actorId, recordKey).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test LastActorRunsDefaultKeyValueStoreAPIService ActRunsLastKeyValueStoreRecordsGet", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var actorId string - - resp, httpRes, err := apiClient.LastActorRunsDefaultKeyValueStoreAPI.ActRunsLastKeyValueStoreRecordsGet(context.Background(), actorId).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - -} diff --git a/test/api_last_actor_runs_default_request_queue_test.go b/test/api_last_actor_runs_default_request_queue_test.go deleted file mode 100644 index 989bba0..0000000 --- a/test/api_last_actor_runs_default_request_queue_test.go +++ /dev/null @@ -1,237 +0,0 @@ -/* -Apify API - -Testing LastActorRunsDefaultRequestQueueAPIService - -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); - -package apifyclient - -import ( - "context" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - "testing" - openapiclient "github.com/apify/apify-client-go" -) - -func Test_apifyclient_LastActorRunsDefaultRequestQueueAPIService(t *testing.T) { - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - - t.Run("Test LastActorRunsDefaultRequestQueueAPIService ActRunsLastRequestQueueDelete", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var actorId string - - httpRes, err := apiClient.LastActorRunsDefaultRequestQueueAPI.ActRunsLastRequestQueueDelete(context.Background(), actorId).Execute() - - require.Nil(t, err) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test LastActorRunsDefaultRequestQueueAPIService ActRunsLastRequestQueueGet", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var actorId string - - resp, httpRes, err := apiClient.LastActorRunsDefaultRequestQueueAPI.ActRunsLastRequestQueueGet(context.Background(), actorId).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test LastActorRunsDefaultRequestQueueAPIService ActRunsLastRequestQueueHeadGet", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var actorId string - - resp, httpRes, err := apiClient.LastActorRunsDefaultRequestQueueAPI.ActRunsLastRequestQueueHeadGet(context.Background(), actorId).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test LastActorRunsDefaultRequestQueueAPIService ActRunsLastRequestQueueHeadLockPost", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var actorId string - - resp, httpRes, err := apiClient.LastActorRunsDefaultRequestQueueAPI.ActRunsLastRequestQueueHeadLockPost(context.Background(), actorId).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test LastActorRunsDefaultRequestQueueAPIService ActRunsLastRequestQueuePut", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var actorId string - - resp, httpRes, err := apiClient.LastActorRunsDefaultRequestQueueAPI.ActRunsLastRequestQueuePut(context.Background(), actorId).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test LastActorRunsDefaultRequestQueueAPIService ActRunsLastRequestQueueRequestDelete", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var actorId string - var requestId string - - httpRes, err := apiClient.LastActorRunsDefaultRequestQueueAPI.ActRunsLastRequestQueueRequestDelete(context.Background(), actorId, requestId).Execute() - - require.Nil(t, err) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test LastActorRunsDefaultRequestQueueAPIService ActRunsLastRequestQueueRequestGet", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var actorId string - var requestId string - - resp, httpRes, err := apiClient.LastActorRunsDefaultRequestQueueAPI.ActRunsLastRequestQueueRequestGet(context.Background(), actorId, requestId).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test LastActorRunsDefaultRequestQueueAPIService ActRunsLastRequestQueueRequestLockDelete", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var actorId string - var requestId string - - httpRes, err := apiClient.LastActorRunsDefaultRequestQueueAPI.ActRunsLastRequestQueueRequestLockDelete(context.Background(), actorId, requestId).Execute() - - require.Nil(t, err) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test LastActorRunsDefaultRequestQueueAPIService ActRunsLastRequestQueueRequestLockPut", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var actorId string - var requestId string - - resp, httpRes, err := apiClient.LastActorRunsDefaultRequestQueueAPI.ActRunsLastRequestQueueRequestLockPut(context.Background(), actorId, requestId).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test LastActorRunsDefaultRequestQueueAPIService ActRunsLastRequestQueueRequestPut", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var actorId string - var requestId string - - resp, httpRes, err := apiClient.LastActorRunsDefaultRequestQueueAPI.ActRunsLastRequestQueueRequestPut(context.Background(), actorId, requestId).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test LastActorRunsDefaultRequestQueueAPIService ActRunsLastRequestQueueRequestsBatchDelete", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var actorId string - - resp, httpRes, err := apiClient.LastActorRunsDefaultRequestQueueAPI.ActRunsLastRequestQueueRequestsBatchDelete(context.Background(), actorId).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test LastActorRunsDefaultRequestQueueAPIService ActRunsLastRequestQueueRequestsBatchPost", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var actorId string - - resp, httpRes, err := apiClient.LastActorRunsDefaultRequestQueueAPI.ActRunsLastRequestQueueRequestsBatchPost(context.Background(), actorId).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test LastActorRunsDefaultRequestQueueAPIService ActRunsLastRequestQueueRequestsGet", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var actorId string - - resp, httpRes, err := apiClient.LastActorRunsDefaultRequestQueueAPI.ActRunsLastRequestQueueRequestsGet(context.Background(), actorId).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test LastActorRunsDefaultRequestQueueAPIService ActRunsLastRequestQueueRequestsPost", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var actorId string - - resp, httpRes, err := apiClient.LastActorRunsDefaultRequestQueueAPI.ActRunsLastRequestQueueRequestsPost(context.Background(), actorId).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test LastActorRunsDefaultRequestQueueAPIService ActRunsLastRequestQueueRequestsUnlockPost", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var actorId string - - resp, httpRes, err := apiClient.LastActorRunsDefaultRequestQueueAPI.ActRunsLastRequestQueueRequestsUnlockPost(context.Background(), actorId).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - -} diff --git a/test/api_last_actor_runs_log_test.go b/test/api_last_actor_runs_log_test.go deleted file mode 100644 index 41a3aa4..0000000 --- a/test/api_last_actor_runs_log_test.go +++ /dev/null @@ -1,39 +0,0 @@ -/* -Apify API - -Testing LastActorRunsLogAPIService - -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); - -package apifyclient - -import ( - "context" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - "testing" - openapiclient "github.com/apify/apify-client-go" -) - -func Test_apifyclient_LastActorRunsLogAPIService(t *testing.T) { - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - - t.Run("Test LastActorRunsLogAPIService ActRunsLastLogGet", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var actorId string - - resp, httpRes, err := apiClient.LastActorRunsLogAPI.ActRunsLastLogGet(context.Background(), actorId).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - -} diff --git a/test/api_last_actor_runs_metamorph_test.go b/test/api_last_actor_runs_metamorph_test.go deleted file mode 100644 index 282bf6b..0000000 --- a/test/api_last_actor_runs_metamorph_test.go +++ /dev/null @@ -1,39 +0,0 @@ -/* -Apify API - -Testing LastActorRunsMetamorphAPIService - -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); - -package apifyclient - -import ( - "context" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - "testing" - openapiclient "github.com/apify/apify-client-go" -) - -func Test_apifyclient_LastActorRunsMetamorphAPIService(t *testing.T) { - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - - t.Run("Test LastActorRunsMetamorphAPIService ActRunsLastMetamorphPost", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var actorId string - - resp, httpRes, err := apiClient.LastActorRunsMetamorphAPI.ActRunsLastMetamorphPost(context.Background(), actorId).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - -} diff --git a/test/api_last_actor_runs_reboot_test.go b/test/api_last_actor_runs_reboot_test.go deleted file mode 100644 index 7fc7677..0000000 --- a/test/api_last_actor_runs_reboot_test.go +++ /dev/null @@ -1,39 +0,0 @@ -/* -Apify API - -Testing LastActorRunsRebootAPIService - -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); - -package apifyclient - -import ( - "context" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - "testing" - openapiclient "github.com/apify/apify-client-go" -) - -func Test_apifyclient_LastActorRunsRebootAPIService(t *testing.T) { - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - - t.Run("Test LastActorRunsRebootAPIService ActRunsLastRebootPost", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var actorId string - - resp, httpRes, err := apiClient.LastActorRunsRebootAPI.ActRunsLastRebootPost(context.Background(), actorId).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - -} diff --git a/test/api_last_actor_task_runs_abort_test.go b/test/api_last_actor_task_runs_abort_test.go deleted file mode 100644 index f5c770f..0000000 --- a/test/api_last_actor_task_runs_abort_test.go +++ /dev/null @@ -1,39 +0,0 @@ -/* -Apify API - -Testing LastActorTaskRunsAbortAPIService - -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); - -package apifyclient - -import ( - "context" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - "testing" - openapiclient "github.com/apify/apify-client-go" -) - -func Test_apifyclient_LastActorTaskRunsAbortAPIService(t *testing.T) { - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - - t.Run("Test LastActorTaskRunsAbortAPIService ActorTaskRunsLastAbortPost", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var actorTaskId string - - resp, httpRes, err := apiClient.LastActorTaskRunsAbortAPI.ActorTaskRunsLastAbortPost(context.Background(), actorTaskId).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - -} diff --git a/test/api_last_actor_task_runs_default_dataset_test.go b/test/api_last_actor_task_runs_default_dataset_test.go deleted file mode 100644 index 1f719e7..0000000 --- a/test/api_last_actor_task_runs_default_dataset_test.go +++ /dev/null @@ -1,108 +0,0 @@ -/* -Apify API - -Testing LastActorTaskRunsDefaultDatasetAPIService - -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); - -package apifyclient - -import ( - "context" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - "testing" - openapiclient "github.com/apify/apify-client-go" -) - -func Test_apifyclient_LastActorTaskRunsDefaultDatasetAPIService(t *testing.T) { - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - - t.Run("Test LastActorTaskRunsDefaultDatasetAPIService ActorTaskRunsLastDatasetDelete", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var actorTaskId string - - httpRes, err := apiClient.LastActorTaskRunsDefaultDatasetAPI.ActorTaskRunsLastDatasetDelete(context.Background(), actorTaskId).Execute() - - require.Nil(t, err) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test LastActorTaskRunsDefaultDatasetAPIService ActorTaskRunsLastDatasetGet", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var actorTaskId string - - resp, httpRes, err := apiClient.LastActorTaskRunsDefaultDatasetAPI.ActorTaskRunsLastDatasetGet(context.Background(), actorTaskId).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test LastActorTaskRunsDefaultDatasetAPIService ActorTaskRunsLastDatasetItemsGet", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var actorTaskId string - - resp, httpRes, err := apiClient.LastActorTaskRunsDefaultDatasetAPI.ActorTaskRunsLastDatasetItemsGet(context.Background(), actorTaskId).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test LastActorTaskRunsDefaultDatasetAPIService ActorTaskRunsLastDatasetItemsPost", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var actorTaskId string - - resp, httpRes, err := apiClient.LastActorTaskRunsDefaultDatasetAPI.ActorTaskRunsLastDatasetItemsPost(context.Background(), actorTaskId).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test LastActorTaskRunsDefaultDatasetAPIService ActorTaskRunsLastDatasetPut", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var actorTaskId string - - resp, httpRes, err := apiClient.LastActorTaskRunsDefaultDatasetAPI.ActorTaskRunsLastDatasetPut(context.Background(), actorTaskId).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test LastActorTaskRunsDefaultDatasetAPIService ActorTaskRunsLastDatasetStatisticsGet", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var actorTaskId string - - resp, httpRes, err := apiClient.LastActorTaskRunsDefaultDatasetAPI.ActorTaskRunsLastDatasetStatisticsGet(context.Background(), actorTaskId).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - -} diff --git a/test/api_last_actor_task_runs_default_key_value_store_test.go b/test/api_last_actor_task_runs_default_key_value_store_test.go deleted file mode 100644 index 0c965f1..0000000 --- a/test/api_last_actor_task_runs_default_key_value_store_test.go +++ /dev/null @@ -1,153 +0,0 @@ -/* -Apify API - -Testing LastActorTaskRunsDefaultKeyValueStoreAPIService - -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); - -package apifyclient - -import ( - "context" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - "testing" - openapiclient "github.com/apify/apify-client-go" -) - -func Test_apifyclient_LastActorTaskRunsDefaultKeyValueStoreAPIService(t *testing.T) { - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - - t.Run("Test LastActorTaskRunsDefaultKeyValueStoreAPIService ActorTaskRunsLastKeyValueStoreDelete", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var actorTaskId string - - httpRes, err := apiClient.LastActorTaskRunsDefaultKeyValueStoreAPI.ActorTaskRunsLastKeyValueStoreDelete(context.Background(), actorTaskId).Execute() - - require.Nil(t, err) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test LastActorTaskRunsDefaultKeyValueStoreAPIService ActorTaskRunsLastKeyValueStoreGet", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var actorTaskId string - - resp, httpRes, err := apiClient.LastActorTaskRunsDefaultKeyValueStoreAPI.ActorTaskRunsLastKeyValueStoreGet(context.Background(), actorTaskId).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test LastActorTaskRunsDefaultKeyValueStoreAPIService ActorTaskRunsLastKeyValueStoreKeysGet", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var actorTaskId string - - resp, httpRes, err := apiClient.LastActorTaskRunsDefaultKeyValueStoreAPI.ActorTaskRunsLastKeyValueStoreKeysGet(context.Background(), actorTaskId).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test LastActorTaskRunsDefaultKeyValueStoreAPIService ActorTaskRunsLastKeyValueStorePut", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var actorTaskId string - - resp, httpRes, err := apiClient.LastActorTaskRunsDefaultKeyValueStoreAPI.ActorTaskRunsLastKeyValueStorePut(context.Background(), actorTaskId).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test LastActorTaskRunsDefaultKeyValueStoreAPIService ActorTaskRunsLastKeyValueStoreRecordDelete", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var actorTaskId string - var recordKey string - - httpRes, err := apiClient.LastActorTaskRunsDefaultKeyValueStoreAPI.ActorTaskRunsLastKeyValueStoreRecordDelete(context.Background(), actorTaskId, recordKey).Execute() - - require.Nil(t, err) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test LastActorTaskRunsDefaultKeyValueStoreAPIService ActorTaskRunsLastKeyValueStoreRecordGet", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var actorTaskId string - var recordKey string - - resp, httpRes, err := apiClient.LastActorTaskRunsDefaultKeyValueStoreAPI.ActorTaskRunsLastKeyValueStoreRecordGet(context.Background(), actorTaskId, recordKey).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test LastActorTaskRunsDefaultKeyValueStoreAPIService ActorTaskRunsLastKeyValueStoreRecordPost", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var actorTaskId string - var recordKey string - - resp, httpRes, err := apiClient.LastActorTaskRunsDefaultKeyValueStoreAPI.ActorTaskRunsLastKeyValueStoreRecordPost(context.Background(), actorTaskId, recordKey).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test LastActorTaskRunsDefaultKeyValueStoreAPIService ActorTaskRunsLastKeyValueStoreRecordPut", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var actorTaskId string - var recordKey string - - resp, httpRes, err := apiClient.LastActorTaskRunsDefaultKeyValueStoreAPI.ActorTaskRunsLastKeyValueStoreRecordPut(context.Background(), actorTaskId, recordKey).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test LastActorTaskRunsDefaultKeyValueStoreAPIService ActorTaskRunsLastKeyValueStoreRecordsGet", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var actorTaskId string - - resp, httpRes, err := apiClient.LastActorTaskRunsDefaultKeyValueStoreAPI.ActorTaskRunsLastKeyValueStoreRecordsGet(context.Background(), actorTaskId).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - -} diff --git a/test/api_last_actor_task_runs_default_request_queue_test.go b/test/api_last_actor_task_runs_default_request_queue_test.go deleted file mode 100644 index dff1983..0000000 --- a/test/api_last_actor_task_runs_default_request_queue_test.go +++ /dev/null @@ -1,237 +0,0 @@ -/* -Apify API - -Testing LastActorTaskRunsDefaultRequestQueueAPIService - -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); - -package apifyclient - -import ( - "context" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - "testing" - openapiclient "github.com/apify/apify-client-go" -) - -func Test_apifyclient_LastActorTaskRunsDefaultRequestQueueAPIService(t *testing.T) { - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - - t.Run("Test LastActorTaskRunsDefaultRequestQueueAPIService ActorTaskRunsLastRequestQueueDelete", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var actorTaskId string - - httpRes, err := apiClient.LastActorTaskRunsDefaultRequestQueueAPI.ActorTaskRunsLastRequestQueueDelete(context.Background(), actorTaskId).Execute() - - require.Nil(t, err) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test LastActorTaskRunsDefaultRequestQueueAPIService ActorTaskRunsLastRequestQueueGet", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var actorTaskId string - - resp, httpRes, err := apiClient.LastActorTaskRunsDefaultRequestQueueAPI.ActorTaskRunsLastRequestQueueGet(context.Background(), actorTaskId).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test LastActorTaskRunsDefaultRequestQueueAPIService ActorTaskRunsLastRequestQueueHeadGet", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var actorTaskId string - - resp, httpRes, err := apiClient.LastActorTaskRunsDefaultRequestQueueAPI.ActorTaskRunsLastRequestQueueHeadGet(context.Background(), actorTaskId).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test LastActorTaskRunsDefaultRequestQueueAPIService ActorTaskRunsLastRequestQueueHeadLockPost", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var actorTaskId string - - resp, httpRes, err := apiClient.LastActorTaskRunsDefaultRequestQueueAPI.ActorTaskRunsLastRequestQueueHeadLockPost(context.Background(), actorTaskId).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test LastActorTaskRunsDefaultRequestQueueAPIService ActorTaskRunsLastRequestQueuePut", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var actorTaskId string - - resp, httpRes, err := apiClient.LastActorTaskRunsDefaultRequestQueueAPI.ActorTaskRunsLastRequestQueuePut(context.Background(), actorTaskId).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test LastActorTaskRunsDefaultRequestQueueAPIService ActorTaskRunsLastRequestQueueRequestDelete", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var actorTaskId string - var requestId string - - httpRes, err := apiClient.LastActorTaskRunsDefaultRequestQueueAPI.ActorTaskRunsLastRequestQueueRequestDelete(context.Background(), actorTaskId, requestId).Execute() - - require.Nil(t, err) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test LastActorTaskRunsDefaultRequestQueueAPIService ActorTaskRunsLastRequestQueueRequestGet", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var actorTaskId string - var requestId string - - resp, httpRes, err := apiClient.LastActorTaskRunsDefaultRequestQueueAPI.ActorTaskRunsLastRequestQueueRequestGet(context.Background(), actorTaskId, requestId).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test LastActorTaskRunsDefaultRequestQueueAPIService ActorTaskRunsLastRequestQueueRequestLockDelete", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var actorTaskId string - var requestId string - - httpRes, err := apiClient.LastActorTaskRunsDefaultRequestQueueAPI.ActorTaskRunsLastRequestQueueRequestLockDelete(context.Background(), actorTaskId, requestId).Execute() - - require.Nil(t, err) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test LastActorTaskRunsDefaultRequestQueueAPIService ActorTaskRunsLastRequestQueueRequestLockPut", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var actorTaskId string - var requestId string - - resp, httpRes, err := apiClient.LastActorTaskRunsDefaultRequestQueueAPI.ActorTaskRunsLastRequestQueueRequestLockPut(context.Background(), actorTaskId, requestId).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test LastActorTaskRunsDefaultRequestQueueAPIService ActorTaskRunsLastRequestQueueRequestPut", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var actorTaskId string - var requestId string - - resp, httpRes, err := apiClient.LastActorTaskRunsDefaultRequestQueueAPI.ActorTaskRunsLastRequestQueueRequestPut(context.Background(), actorTaskId, requestId).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test LastActorTaskRunsDefaultRequestQueueAPIService ActorTaskRunsLastRequestQueueRequestsBatchDelete", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var actorTaskId string - - resp, httpRes, err := apiClient.LastActorTaskRunsDefaultRequestQueueAPI.ActorTaskRunsLastRequestQueueRequestsBatchDelete(context.Background(), actorTaskId).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test LastActorTaskRunsDefaultRequestQueueAPIService ActorTaskRunsLastRequestQueueRequestsBatchPost", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var actorTaskId string - - resp, httpRes, err := apiClient.LastActorTaskRunsDefaultRequestQueueAPI.ActorTaskRunsLastRequestQueueRequestsBatchPost(context.Background(), actorTaskId).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test LastActorTaskRunsDefaultRequestQueueAPIService ActorTaskRunsLastRequestQueueRequestsGet", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var actorTaskId string - - resp, httpRes, err := apiClient.LastActorTaskRunsDefaultRequestQueueAPI.ActorTaskRunsLastRequestQueueRequestsGet(context.Background(), actorTaskId).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test LastActorTaskRunsDefaultRequestQueueAPIService ActorTaskRunsLastRequestQueueRequestsPost", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var actorTaskId string - - resp, httpRes, err := apiClient.LastActorTaskRunsDefaultRequestQueueAPI.ActorTaskRunsLastRequestQueueRequestsPost(context.Background(), actorTaskId).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test LastActorTaskRunsDefaultRequestQueueAPIService ActorTaskRunsLastRequestQueueRequestsUnlockPost", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var actorTaskId string - - resp, httpRes, err := apiClient.LastActorTaskRunsDefaultRequestQueueAPI.ActorTaskRunsLastRequestQueueRequestsUnlockPost(context.Background(), actorTaskId).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - -} diff --git a/test/api_last_actor_task_runs_log_test.go b/test/api_last_actor_task_runs_log_test.go deleted file mode 100644 index 3c0cb5a..0000000 --- a/test/api_last_actor_task_runs_log_test.go +++ /dev/null @@ -1,39 +0,0 @@ -/* -Apify API - -Testing LastActorTaskRunsLogAPIService - -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); - -package apifyclient - -import ( - "context" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - "testing" - openapiclient "github.com/apify/apify-client-go" -) - -func Test_apifyclient_LastActorTaskRunsLogAPIService(t *testing.T) { - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - - t.Run("Test LastActorTaskRunsLogAPIService ActorTaskLastLogGet", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var actorTaskId string - - resp, httpRes, err := apiClient.LastActorTaskRunsLogAPI.ActorTaskLastLogGet(context.Background(), actorTaskId).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - -} diff --git a/test/api_last_actor_task_runs_metamorph_test.go b/test/api_last_actor_task_runs_metamorph_test.go deleted file mode 100644 index 946bd96..0000000 --- a/test/api_last_actor_task_runs_metamorph_test.go +++ /dev/null @@ -1,39 +0,0 @@ -/* -Apify API - -Testing LastActorTaskRunsMetamorphAPIService - -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); - -package apifyclient - -import ( - "context" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - "testing" - openapiclient "github.com/apify/apify-client-go" -) - -func Test_apifyclient_LastActorTaskRunsMetamorphAPIService(t *testing.T) { - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - - t.Run("Test LastActorTaskRunsMetamorphAPIService ActorTaskRunsLastMetamorphPost", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var actorTaskId string - - resp, httpRes, err := apiClient.LastActorTaskRunsMetamorphAPI.ActorTaskRunsLastMetamorphPost(context.Background(), actorTaskId).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - -} diff --git a/test/api_last_actor_task_runs_reboot_test.go b/test/api_last_actor_task_runs_reboot_test.go deleted file mode 100644 index 979258a..0000000 --- a/test/api_last_actor_task_runs_reboot_test.go +++ /dev/null @@ -1,39 +0,0 @@ -/* -Apify API - -Testing LastActorTaskRunsRebootAPIService - -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); - -package apifyclient - -import ( - "context" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - "testing" - openapiclient "github.com/apify/apify-client-go" -) - -func Test_apifyclient_LastActorTaskRunsRebootAPIService(t *testing.T) { - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - - t.Run("Test LastActorTaskRunsRebootAPIService ActorTaskRunsLastRebootPost", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var actorTaskId string - - resp, httpRes, err := apiClient.LastActorTaskRunsRebootAPI.ActorTaskRunsLastRebootPost(context.Background(), actorTaskId).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - -} diff --git a/test/api_logs_test.go b/test/api_logs_test.go deleted file mode 100644 index 26e927a..0000000 --- a/test/api_logs_test.go +++ /dev/null @@ -1,39 +0,0 @@ -/* -Apify API - -Testing LogsAPIService - -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); - -package apifyclient - -import ( - "context" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - "testing" - openapiclient "github.com/apify/apify-client-go" -) - -func Test_apifyclient_LogsAPIService(t *testing.T) { - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - - t.Run("Test LogsAPIService LogGet", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var buildOrRunId string - - resp, httpRes, err := apiClient.LogsAPI.LogGet(context.Background(), buildOrRunId).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - -} diff --git a/test/api_schedules_test.go b/test/api_schedules_test.go deleted file mode 100644 index fd851ba..0000000 --- a/test/api_schedules_test.go +++ /dev/null @@ -1,105 +0,0 @@ -/* -Apify API - -Testing SchedulesAPIService - -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); - -package apifyclient - -import ( - "context" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - "testing" - openapiclient "github.com/apify/apify-client-go" -) - -func Test_apifyclient_SchedulesAPIService(t *testing.T) { - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - - t.Run("Test SchedulesAPIService ScheduleDelete", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var scheduleId string - - resp, httpRes, err := apiClient.SchedulesAPI.ScheduleDelete(context.Background(), scheduleId).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test SchedulesAPIService ScheduleGet", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var scheduleId string - - resp, httpRes, err := apiClient.SchedulesAPI.ScheduleGet(context.Background(), scheduleId).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test SchedulesAPIService ScheduleLogGet", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var scheduleId string - - resp, httpRes, err := apiClient.SchedulesAPI.ScheduleLogGet(context.Background(), scheduleId).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test SchedulesAPIService SchedulePut", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var scheduleId string - - resp, httpRes, err := apiClient.SchedulesAPI.SchedulePut(context.Background(), scheduleId).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test SchedulesAPIService SchedulesGet", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - resp, httpRes, err := apiClient.SchedulesAPI.SchedulesGet(context.Background()).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test SchedulesAPIService SchedulesPost", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - resp, httpRes, err := apiClient.SchedulesAPI.SchedulesPost(context.Background()).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - -} diff --git a/test/api_storage_datasets_test.go b/test/api_storage_datasets_test.go deleted file mode 100644 index b7fc870..0000000 --- a/test/api_storage_datasets_test.go +++ /dev/null @@ -1,145 +0,0 @@ -/* -Apify API - -Testing StorageDatasetsAPIService - -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); - -package apifyclient - -import ( - "context" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - "testing" - openapiclient "github.com/apify/apify-client-go" -) - -func Test_apifyclient_StorageDatasetsAPIService(t *testing.T) { - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - - t.Run("Test StorageDatasetsAPIService DatasetDelete", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var datasetId string - - httpRes, err := apiClient.StorageDatasetsAPI.DatasetDelete(context.Background(), datasetId).Execute() - - require.Nil(t, err) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test StorageDatasetsAPIService DatasetGet", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var datasetId string - - resp, httpRes, err := apiClient.StorageDatasetsAPI.DatasetGet(context.Background(), datasetId).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test StorageDatasetsAPIService DatasetItemsGet", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var datasetId string - - resp, httpRes, err := apiClient.StorageDatasetsAPI.DatasetItemsGet(context.Background(), datasetId).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test StorageDatasetsAPIService DatasetItemsHead", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var datasetId string - - httpRes, err := apiClient.StorageDatasetsAPI.DatasetItemsHead(context.Background(), datasetId).Execute() - - require.Nil(t, err) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test StorageDatasetsAPIService DatasetItemsPost", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var datasetId string - - resp, httpRes, err := apiClient.StorageDatasetsAPI.DatasetItemsPost(context.Background(), datasetId).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test StorageDatasetsAPIService DatasetPut", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var datasetId string - - resp, httpRes, err := apiClient.StorageDatasetsAPI.DatasetPut(context.Background(), datasetId).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test StorageDatasetsAPIService DatasetStatisticsGet", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var datasetId string - - resp, httpRes, err := apiClient.StorageDatasetsAPI.DatasetStatisticsGet(context.Background(), datasetId).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test StorageDatasetsAPIService DatasetsGet", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - resp, httpRes, err := apiClient.StorageDatasetsAPI.DatasetsGet(context.Background()).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test StorageDatasetsAPIService DatasetsPost", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - resp, httpRes, err := apiClient.StorageDatasetsAPI.DatasetsPost(context.Background()).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - -} diff --git a/test/api_storage_key_value_stores_test.go b/test/api_storage_key_value_stores_test.go deleted file mode 100644 index a759837..0000000 --- a/test/api_storage_key_value_stores_test.go +++ /dev/null @@ -1,191 +0,0 @@ -/* -Apify API - -Testing StorageKeyValueStoresAPIService - -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); - -package apifyclient - -import ( - "context" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - "testing" - openapiclient "github.com/apify/apify-client-go" -) - -func Test_apifyclient_StorageKeyValueStoresAPIService(t *testing.T) { - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - - t.Run("Test StorageKeyValueStoresAPIService KeyValueStoreDelete", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var storeId string - - httpRes, err := apiClient.StorageKeyValueStoresAPI.KeyValueStoreDelete(context.Background(), storeId).Execute() - - require.Nil(t, err) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test StorageKeyValueStoresAPIService KeyValueStoreGet", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var storeId string - - resp, httpRes, err := apiClient.StorageKeyValueStoresAPI.KeyValueStoreGet(context.Background(), storeId).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test StorageKeyValueStoresAPIService KeyValueStoreKeysGet", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var storeId string - - resp, httpRes, err := apiClient.StorageKeyValueStoresAPI.KeyValueStoreKeysGet(context.Background(), storeId).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test StorageKeyValueStoresAPIService KeyValueStorePut", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var storeId string - - resp, httpRes, err := apiClient.StorageKeyValueStoresAPI.KeyValueStorePut(context.Background(), storeId).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test StorageKeyValueStoresAPIService KeyValueStoreRecordDelete", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var storeId string - var recordKey string - - httpRes, err := apiClient.StorageKeyValueStoresAPI.KeyValueStoreRecordDelete(context.Background(), storeId, recordKey).Execute() - - require.Nil(t, err) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test StorageKeyValueStoresAPIService KeyValueStoreRecordGet", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var storeId string - var recordKey string - - resp, httpRes, err := apiClient.StorageKeyValueStoresAPI.KeyValueStoreRecordGet(context.Background(), storeId, recordKey).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test StorageKeyValueStoresAPIService KeyValueStoreRecordHead", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var storeId string - var recordKey string - - httpRes, err := apiClient.StorageKeyValueStoresAPI.KeyValueStoreRecordHead(context.Background(), storeId, recordKey).Execute() - - require.Nil(t, err) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test StorageKeyValueStoresAPIService KeyValueStoreRecordPost", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var storeId string - var recordKey string - - resp, httpRes, err := apiClient.StorageKeyValueStoresAPI.KeyValueStoreRecordPost(context.Background(), storeId, recordKey).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test StorageKeyValueStoresAPIService KeyValueStoreRecordPut", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var storeId string - var recordKey string - - resp, httpRes, err := apiClient.StorageKeyValueStoresAPI.KeyValueStoreRecordPut(context.Background(), storeId, recordKey).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test StorageKeyValueStoresAPIService KeyValueStoreRecordsGet", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var storeId string - - resp, httpRes, err := apiClient.StorageKeyValueStoresAPI.KeyValueStoreRecordsGet(context.Background(), storeId).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test StorageKeyValueStoresAPIService KeyValueStoresGet", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - resp, httpRes, err := apiClient.StorageKeyValueStoresAPI.KeyValueStoresGet(context.Background()).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test StorageKeyValueStoresAPIService KeyValueStoresPost", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - resp, httpRes, err := apiClient.StorageKeyValueStoresAPI.KeyValueStoresPost(context.Background()).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - -} diff --git a/test/api_storage_request_queues_requests_locks_test.go b/test/api_storage_request_queues_requests_locks_test.go deleted file mode 100644 index dd7cf83..0000000 --- a/test/api_storage_request_queues_requests_locks_test.go +++ /dev/null @@ -1,96 +0,0 @@ -/* -Apify API - -Testing StorageRequestQueuesRequestsLocksAPIService - -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); - -package apifyclient - -import ( - "context" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - "testing" - openapiclient "github.com/apify/apify-client-go" -) - -func Test_apifyclient_StorageRequestQueuesRequestsLocksAPIService(t *testing.T) { - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - - t.Run("Test StorageRequestQueuesRequestsLocksAPIService RequestQueueHeadGet", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var queueId string - - resp, httpRes, err := apiClient.StorageRequestQueuesRequestsLocksAPI.RequestQueueHeadGet(context.Background(), queueId).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test StorageRequestQueuesRequestsLocksAPIService RequestQueueHeadLockPost", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var queueId string - - resp, httpRes, err := apiClient.StorageRequestQueuesRequestsLocksAPI.RequestQueueHeadLockPost(context.Background(), queueId).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test StorageRequestQueuesRequestsLocksAPIService RequestQueueRequestLockDelete", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var queueId string - var requestId string - - httpRes, err := apiClient.StorageRequestQueuesRequestsLocksAPI.RequestQueueRequestLockDelete(context.Background(), queueId, requestId).Execute() - - require.Nil(t, err) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test StorageRequestQueuesRequestsLocksAPIService RequestQueueRequestLockPut", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var queueId string - var requestId string - - resp, httpRes, err := apiClient.StorageRequestQueuesRequestsLocksAPI.RequestQueueRequestLockPut(context.Background(), queueId, requestId).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test StorageRequestQueuesRequestsLocksAPIService RequestQueueRequestsUnlockPost", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var queueId string - - resp, httpRes, err := apiClient.StorageRequestQueuesRequestsLocksAPI.RequestQueueRequestsUnlockPost(context.Background(), queueId).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - -} diff --git a/test/api_storage_request_queues_requests_test.go b/test/api_storage_request_queues_requests_test.go deleted file mode 100644 index b0097d8..0000000 --- a/test/api_storage_request_queues_requests_test.go +++ /dev/null @@ -1,97 +0,0 @@ -/* -Apify API - -Testing StorageRequestQueuesRequestsAPIService - -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); - -package apifyclient - -import ( - "context" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - "testing" - openapiclient "github.com/apify/apify-client-go" -) - -func Test_apifyclient_StorageRequestQueuesRequestsAPIService(t *testing.T) { - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - - t.Run("Test StorageRequestQueuesRequestsAPIService RequestQueueRequestDelete", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var queueId string - var requestId string - - httpRes, err := apiClient.StorageRequestQueuesRequestsAPI.RequestQueueRequestDelete(context.Background(), queueId, requestId).Execute() - - require.Nil(t, err) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test StorageRequestQueuesRequestsAPIService RequestQueueRequestGet", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var queueId string - var requestId string - - resp, httpRes, err := apiClient.StorageRequestQueuesRequestsAPI.RequestQueueRequestGet(context.Background(), queueId, requestId).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test StorageRequestQueuesRequestsAPIService RequestQueueRequestPut", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var queueId string - var requestId string - - resp, httpRes, err := apiClient.StorageRequestQueuesRequestsAPI.RequestQueueRequestPut(context.Background(), queueId, requestId).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test StorageRequestQueuesRequestsAPIService RequestQueueRequestsGet", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var queueId string - - resp, httpRes, err := apiClient.StorageRequestQueuesRequestsAPI.RequestQueueRequestsGet(context.Background(), queueId).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test StorageRequestQueuesRequestsAPIService RequestQueueRequestsPost", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var queueId string - - resp, httpRes, err := apiClient.StorageRequestQueuesRequestsAPI.RequestQueueRequestsPost(context.Background(), queueId).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - -} diff --git a/test/api_storage_request_queues_test.go b/test/api_storage_request_queues_test.go deleted file mode 100644 index 4711673..0000000 --- a/test/api_storage_request_queues_test.go +++ /dev/null @@ -1,118 +0,0 @@ -/* -Apify API - -Testing StorageRequestQueuesAPIService - -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); - -package apifyclient - -import ( - "context" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - "testing" - openapiclient "github.com/apify/apify-client-go" -) - -func Test_apifyclient_StorageRequestQueuesAPIService(t *testing.T) { - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - - t.Run("Test StorageRequestQueuesAPIService RequestQueueDelete", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var queueId string - - httpRes, err := apiClient.StorageRequestQueuesAPI.RequestQueueDelete(context.Background(), queueId).Execute() - - require.Nil(t, err) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test StorageRequestQueuesAPIService RequestQueueGet", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var queueId string - - resp, httpRes, err := apiClient.StorageRequestQueuesAPI.RequestQueueGet(context.Background(), queueId).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test StorageRequestQueuesAPIService RequestQueuePut", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var queueId string - - resp, httpRes, err := apiClient.StorageRequestQueuesAPI.RequestQueuePut(context.Background(), queueId).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test StorageRequestQueuesAPIService RequestQueueRequestsBatchDelete", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var queueId string - - resp, httpRes, err := apiClient.StorageRequestQueuesAPI.RequestQueueRequestsBatchDelete(context.Background(), queueId).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test StorageRequestQueuesAPIService RequestQueueRequestsBatchPost", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var queueId string - - resp, httpRes, err := apiClient.StorageRequestQueuesAPI.RequestQueueRequestsBatchPost(context.Background(), queueId).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test StorageRequestQueuesAPIService RequestQueuesGet", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - resp, httpRes, err := apiClient.StorageRequestQueuesAPI.RequestQueuesGet(context.Background()).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test StorageRequestQueuesAPIService RequestQueuesPost", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - resp, httpRes, err := apiClient.StorageRequestQueuesAPI.RequestQueuesPost(context.Background()).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - -} diff --git a/test/api_store_test.go b/test/api_store_test.go deleted file mode 100644 index fb258ee..0000000 --- a/test/api_store_test.go +++ /dev/null @@ -1,37 +0,0 @@ -/* -Apify API - -Testing StoreAPIService - -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); - -package apifyclient - -import ( - "context" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - "testing" - openapiclient "github.com/apify/apify-client-go" -) - -func Test_apifyclient_StoreAPIService(t *testing.T) { - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - - t.Run("Test StoreAPIService StoreGet", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - resp, httpRes, err := apiClient.StoreAPI.StoreGet(context.Background()).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - -} diff --git a/test/api_tools_test.go b/test/api_tools_test.go deleted file mode 100644 index 64149ff..0000000 --- a/test/api_tools_test.go +++ /dev/null @@ -1,97 +0,0 @@ -/* -Apify API - -Testing ToolsAPIService - -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); - -package apifyclient - -import ( - "context" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - "testing" - openapiclient "github.com/apify/apify-client-go" -) - -func Test_apifyclient_ToolsAPIService(t *testing.T) { - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - - t.Run("Test ToolsAPIService ToolsBrowserInfoDelete", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - resp, httpRes, err := apiClient.ToolsAPI.ToolsBrowserInfoDelete(context.Background()).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test ToolsAPIService ToolsBrowserInfoGet", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - resp, httpRes, err := apiClient.ToolsAPI.ToolsBrowserInfoGet(context.Background()).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test ToolsAPIService ToolsBrowserInfoPost", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - resp, httpRes, err := apiClient.ToolsAPI.ToolsBrowserInfoPost(context.Background()).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test ToolsAPIService ToolsBrowserInfoPut", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - resp, httpRes, err := apiClient.ToolsAPI.ToolsBrowserInfoPut(context.Background()).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test ToolsAPIService ToolsDecodeAndVerifyPost", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - resp, httpRes, err := apiClient.ToolsAPI.ToolsDecodeAndVerifyPost(context.Background()).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test ToolsAPIService ToolsEncodeAndSignPost", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - resp, httpRes, err := apiClient.ToolsAPI.ToolsEncodeAndSignPost(context.Background()).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - -} diff --git a/test/api_users_test.go b/test/api_users_test.go deleted file mode 100644 index 82635ae..0000000 --- a/test/api_users_test.go +++ /dev/null @@ -1,87 +0,0 @@ -/* -Apify API - -Testing UsersAPIService - -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); - -package apifyclient - -import ( - "context" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - "testing" - openapiclient "github.com/apify/apify-client-go" -) - -func Test_apifyclient_UsersAPIService(t *testing.T) { - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - - t.Run("Test UsersAPIService UserGet", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var userId string - - resp, httpRes, err := apiClient.UsersAPI.UserGet(context.Background(), userId).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test UsersAPIService UsersMeGet", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - resp, httpRes, err := apiClient.UsersAPI.UsersMeGet(context.Background()).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test UsersAPIService UsersMeLimitsGet", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - resp, httpRes, err := apiClient.UsersAPI.UsersMeLimitsGet(context.Background()).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test UsersAPIService UsersMeLimitsPut", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - resp, httpRes, err := apiClient.UsersAPI.UsersMeLimitsPut(context.Background()).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test UsersAPIService UsersMeUsageMonthlyGet", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - resp, httpRes, err := apiClient.UsersAPI.UsersMeUsageMonthlyGet(context.Background()).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - -} diff --git a/test/api_webhooks_webhook_dispatches_test.go b/test/api_webhooks_webhook_dispatches_test.go deleted file mode 100644 index 98d66a0..0000000 --- a/test/api_webhooks_webhook_dispatches_test.go +++ /dev/null @@ -1,51 +0,0 @@ -/* -Apify API - -Testing WebhooksWebhookDispatchesAPIService - -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); - -package apifyclient - -import ( - "context" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - "testing" - openapiclient "github.com/apify/apify-client-go" -) - -func Test_apifyclient_WebhooksWebhookDispatchesAPIService(t *testing.T) { - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - - t.Run("Test WebhooksWebhookDispatchesAPIService WebhookDispatchGet", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var dispatchId string - - resp, httpRes, err := apiClient.WebhooksWebhookDispatchesAPI.WebhookDispatchGet(context.Background(), dispatchId).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test WebhooksWebhookDispatchesAPIService WebhookDispatchesGet", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - resp, httpRes, err := apiClient.WebhooksWebhookDispatchesAPI.WebhookDispatchesGet(context.Background()).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - -} diff --git a/test/api_webhooks_webhooks_test.go b/test/api_webhooks_webhooks_test.go deleted file mode 100644 index ba76d9d..0000000 --- a/test/api_webhooks_webhooks_test.go +++ /dev/null @@ -1,119 +0,0 @@ -/* -Apify API - -Testing WebhooksWebhooksAPIService - -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); - -package apifyclient - -import ( - "context" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - "testing" - openapiclient "github.com/apify/apify-client-go" -) - -func Test_apifyclient_WebhooksWebhooksAPIService(t *testing.T) { - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - - t.Run("Test WebhooksWebhooksAPIService WebhookDelete", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var webhookId string - - resp, httpRes, err := apiClient.WebhooksWebhooksAPI.WebhookDelete(context.Background(), webhookId).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test WebhooksWebhooksAPIService WebhookGet", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var webhookId string - - resp, httpRes, err := apiClient.WebhooksWebhooksAPI.WebhookGet(context.Background(), webhookId).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test WebhooksWebhooksAPIService WebhookPut", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var webhookId string - - resp, httpRes, err := apiClient.WebhooksWebhooksAPI.WebhookPut(context.Background(), webhookId).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test WebhooksWebhooksAPIService WebhookTestPost", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var webhookId string - - resp, httpRes, err := apiClient.WebhooksWebhooksAPI.WebhookTestPost(context.Background(), webhookId).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test WebhooksWebhooksAPIService WebhookWebhookDispatchesGet", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var webhookId string - - resp, httpRes, err := apiClient.WebhooksWebhooksAPI.WebhookWebhookDispatchesGet(context.Background(), webhookId).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test WebhooksWebhooksAPIService WebhooksGet", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - resp, httpRes, err := apiClient.WebhooksWebhooksAPI.WebhooksGet(context.Background()).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test WebhooksWebhooksAPIService WebhooksPost", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - resp, httpRes, err := apiClient.WebhooksWebhooksAPI.WebhooksPost(context.Background()).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - -} diff --git a/tests/actor_run_test.go b/tests/actor_run_test.go new file mode 100644 index 0000000..22dc627 --- /dev/null +++ b/tests/actor_run_test.go @@ -0,0 +1,73 @@ +package apify_test + +import ( + "testing" + + apify "github.com/apify/apify-client-go" +) + +func TestListRuns(t *testing.T) { + client := requireClient(t) + ctx, cancel := testContext(t) + defer cancel() + + page, err := client.Runs().List(ctx, apify.ListOptions{Limit: ptr(int64(5))}, apify.RunListOptions{}) + if err != nil { + t.Fatalf("Runs().List: %v", err) + } + if page.Total < 0 { + t.Fatalf("unexpected total: %d", page.Total) + } +} + +// TestRunActorAndReadOutputs runs the public apify/hello-world Actor, waits for it to +// finish, then reads its log, default dataset, and default key-value store. +func TestRunActorAndReadOutputs(t *testing.T) { + client := requireClient(t) + ctx, cancel := testContext(t) + defer cancel() + + run, err := client.Actor("apify/hello-world").Call(ctx, nil, apify.ActorStartOptions{}, ptr(int64(120))) + if err != nil { + t.Fatalf("call hello-world: %v", err) + } + if run.Status != "SUCCEEDED" { + t.Fatalf("expected SUCCEEDED, got %q", run.Status) + } + + if _, ok, err := client.Run(run.ID).Get(ctx); err != nil || !ok { + t.Fatalf("get run: ok=%v err=%v", ok, err) + } + + if logText, ok, err := client.Run(run.ID).Log().Get(ctx); err != nil || !ok || logText == "" { + t.Fatalf("get run log: ok=%v err=%v len=%d", ok, err, len(logText)) + } + + if _, err := client.Run(run.ID).Dataset().ListItems(ctx, apify.DatasetListItemsOptions{}); err != nil { + t.Fatalf("run dataset list: %v", err) + } + + if _, _, err := client.Run(run.ID).KeyValueStore().GetRecord(ctx, "OUTPUT"); err != nil { + t.Fatalf("run kvs get record: %v", err) + } +} + +// TestLastRunAccess runs hello-world then fetches its last succeeded run via the convenience +// accessor. +func TestLastRunAccess(t *testing.T) { + client := requireClient(t) + ctx, cancel := testContext(t) + defer cancel() + + if _, err := client.Actor("apify/hello-world").Call(ctx, nil, apify.ActorStartOptions{}, ptr(int64(120))); err != nil { + t.Fatalf("call hello-world: %v", err) + } + + lastRun, ok, err := client.Actor("apify/hello-world").LastRun("SUCCEEDED").Get(ctx) + if err != nil || !ok { + t.Fatalf("last run: ok=%v err=%v", ok, err) + } + if lastRun.Status != "SUCCEEDED" { + t.Fatalf("expected last succeeded run, got %q", lastRun.Status) + } +} diff --git a/tests/actor_test.go b/tests/actor_test.go new file mode 100644 index 0000000..9d31c69 --- /dev/null +++ b/tests/actor_test.go @@ -0,0 +1,175 @@ +package apify_test + +import ( + "testing" + + apify "github.com/apify/apify-client-go" +) + +// minimalActor returns a minimal Actor definition with the given name, suitable for create. +// The API requires at least one version, so a trivial source-files version "0.0" is embedded. +func minimalActor(name string) map[string]any { + return map[string]any{ + "name": name, + "isPublic": false, + "description": "Integration test actor", + "versions": []any{ + map[string]any{ + "versionNumber": "0.0", + "sourceType": "SOURCE_FILES", + "buildTag": "latest", + "sourceFiles": []any{ + map[string]any{ + "name": "Dockerfile", + "format": "TEXT", + "content": "FROM apify/actor-node:20\nCOPY . ./\nCMD node main.js", + }, + map[string]any{ + "name": "main.js", + "format": "TEXT", + "content": "console.log('hello from go client test');", + }, + }, + }, + }, + } +} + +func TestListActors(t *testing.T) { + client := requireClient(t) + ctx, cancel := testContext(t) + defer cancel() + + page, err := client.Actors().List(ctx, apify.ActorListOptions{My: ptr(true), Limit: ptr(int64(5))}) + if err != nil { + t.Fatalf("Actors().List: %v", err) + } + if page.Total < 0 { + t.Fatalf("unexpected total: %d", page.Total) + } +} + +func TestGetActor(t *testing.T) { + client := requireClient(t) + ctx, cancel := testContext(t) + defer cancel() + + created, err := client.Actors().Create(ctx, minimalActor(uniqueName("get"))) + if err != nil { + t.Fatalf("create actor: %v", err) + } + defer func() { _ = client.Actor(created.ID).Delete(ctx) }() + + got, ok, err := client.Actor(created.ID).Get(ctx) + if err != nil { + t.Fatalf("get actor: %v", err) + } + if !ok || got.ID != created.ID { + t.Fatalf("expected to fetch created actor, got ok=%v %+v", ok, got) + } +} + +func TestActorCRUDFlow(t *testing.T) { + client := requireClient(t) + ctx, cancel := testContext(t) + defer cancel() + + created, err := client.Actors().Create(ctx, minimalActor(uniqueName("crud"))) + if err != nil { + t.Fatalf("create: %v", err) + } + defer func() { _ = client.Actor(created.ID).Delete(ctx) }() + + actor := client.Actor(created.ID) + + if _, ok, err := actor.Get(ctx); err != nil || !ok { + t.Fatalf("get: ok=%v err=%v", ok, err) + } + + updated, err := actor.Update(ctx, map[string]any{"title": "Updated Title"}) + if err != nil { + t.Fatalf("update: %v", err) + } + if updated.Title != "Updated Title" { + t.Fatalf("title not updated: %+v", updated) + } + + if _, err := actor.Builds().List(ctx, apify.ListOptions{}); err != nil { + t.Fatalf("builds list: %v", err) + } + if _, err := actor.Versions().List(ctx, apify.ListOptions{}); err != nil { + t.Fatalf("versions list: %v", err) + } +} + +func TestActorVersionCRUDFlow(t *testing.T) { + client := requireClient(t) + ctx, cancel := testContext(t) + defer cancel() + + created, err := client.Actors().Create(ctx, minimalActor(uniqueName("ver"))) + if err != nil { + t.Fatalf("create actor: %v", err) + } + defer func() { _ = client.Actor(created.ID).Delete(ctx) }() + actor := client.Actor(created.ID) + + versionDef := map[string]any{ + "versionNumber": "0.1", + "sourceType": "SOURCE_FILES", + "buildTag": "latest", + "sourceFiles": []any{}, + } + version, err := actor.Versions().Create(ctx, versionDef) + if err != nil { + t.Fatalf("create version: %v", err) + } + if version.VersionNumber != "0.1" { + t.Fatalf("unexpected version: %+v", version) + } + + if _, ok, err := actor.Version("0.1").Get(ctx); err != nil || !ok { + t.Fatalf("get version: ok=%v err=%v", ok, err) + } + if _, err := actor.Versions().List(ctx, apify.ListOptions{}); err != nil { + t.Fatalf("list versions: %v", err) + } + if _, err := actor.Version("0.1").Update(ctx, map[string]any{"buildTag": "beta", "sourceType": "SOURCE_FILES", "sourceFiles": []any{}}); err != nil { + t.Fatalf("update version: %v", err) + } + if err := actor.Version("0.1").Delete(ctx); err != nil { + t.Fatalf("delete version: %v", err) + } +} + +func TestActorEnvVarCRUDFlow(t *testing.T) { + client := requireClient(t) + ctx, cancel := testContext(t) + defer cancel() + + created, err := client.Actors().Create(ctx, minimalActor(uniqueName("env"))) + if err != nil { + t.Fatalf("create actor: %v", err) + } + defer func() { _ = client.Actor(created.ID).Delete(ctx) }() + actor := client.Actor(created.ID) + + // The actor was created with version "0.0"; attach env vars to it. + envVars := actor.Version("0.0").EnvVars() + + if _, err := envVars.Create(ctx, apify.ActorEnvVar{Name: "MY_VAR", Value: "value1"}); err != nil { + t.Fatalf("create env var: %v", err) + } + if _, ok, err := actor.Version("0.0").EnvVar("MY_VAR").Get(ctx); err != nil || !ok { + t.Fatalf("get env var: ok=%v err=%v", ok, err) + } + if _, err := envVars.List(ctx); err != nil { + t.Fatalf("list env vars: %v", err) + } + if _, err := actor.Version("0.0").EnvVar("MY_VAR").Update(ctx, apify.ActorEnvVar{Name: "MY_VAR", Value: "value2"}); err != nil { + t.Fatalf("update env var: %v", err) + } + if err := actor.Version("0.0").EnvVar("MY_VAR").Delete(ctx); err != nil { + t.Fatalf("delete env var: %v", err) + } +} diff --git a/tests/build_test.go b/tests/build_test.go new file mode 100644 index 0000000..548c0ba --- /dev/null +++ b/tests/build_test.go @@ -0,0 +1,60 @@ +package apify_test + +import ( + "testing" + + apify "github.com/apify/apify-client-go" +) + +func TestListBuilds(t *testing.T) { + client := requireClient(t) + ctx, cancel := testContext(t) + defer cancel() + + page, err := client.Builds().List(ctx, apify.ListOptions{Limit: ptr(int64(5))}) + if err != nil { + t.Fatalf("Builds().List: %v", err) + } + if page.Total < 0 { + t.Fatalf("unexpected total: %d", page.Total) + } +} + +// TestBuildActorFlow creates an Actor, builds it, waits for the build to finish, then reads +// the build, its log, and its OpenAPI definition. +func TestBuildActorFlow(t *testing.T) { + client := requireClient(t) + ctx, cancel := testContext(t) + defer cancel() + + created, err := client.Actors().Create(ctx, minimalActor(uniqueName("build"))) + if err != nil { + t.Fatalf("create actor: %v", err) + } + defer func() { _ = client.Actor(created.ID).Delete(ctx) }() + + build, err := client.Actor(created.ID).Build(ctx, "0.0", apify.ActorBuildOptions{}) + if err != nil { + t.Fatalf("start build: %v", err) + } + + finished, err := client.Build(build.ID).WaitForFinish(ctx, ptr(int64(300))) + if err != nil { + t.Fatalf("wait for finish: %v", err) + } + if !finished.IsTerminal() { + t.Fatalf("build did not finish: status=%q", finished.Status) + } + + if _, ok, err := client.Build(build.ID).Get(ctx); err != nil || !ok { + t.Fatalf("get build: ok=%v err=%v", ok, err) + } + if _, _, err := client.Build(build.ID).Log().Get(ctx); err != nil { + t.Fatalf("build log: %v", err) + } + // The OpenAPI definition may or may not be present depending on the build; only assert + // that the call itself succeeds. + if _, _, err := client.Build(build.ID).GetOpenAPIDefinition(ctx); err != nil { + t.Fatalf("openapi definition: %v", err) + } +} diff --git a/tests/config_test.go b/tests/config_test.go new file mode 100644 index 0000000..f337101 --- /dev/null +++ b/tests/config_test.go @@ -0,0 +1,18 @@ +package apify_test + +import "testing" + +func TestResolveBaseURLDefault(t *testing.T) { + if got := resolveBaseURL(""); got != "https://api.apify.com" { + t.Fatalf("expected default origin, got %q", got) + } +} + +func TestResolveBaseURLStripsV2(t *testing.T) { + if got := resolveBaseURL("https://api.example.com/v2"); got != "https://api.example.com" { + t.Fatalf("got %q", got) + } + if got := resolveBaseURL("https://api.example.com/v2/"); got != "https://api.example.com" { + t.Fatalf("trailing-slash variant: got %q", got) + } +} diff --git a/tests/dataset_test.go b/tests/dataset_test.go new file mode 100644 index 0000000..9bf9afc --- /dev/null +++ b/tests/dataset_test.go @@ -0,0 +1,109 @@ +package apify_test + +import ( + "bytes" + "encoding/json" + "testing" + + apify "github.com/apify/apify-client-go" +) + +func TestListDatasets(t *testing.T) { + client := requireClient(t) + ctx, cancel := testContext(t) + defer cancel() + + page, err := client.Datasets().List(ctx, apify.StorageListOptions{Limit: ptr(int64(5))}) + if err != nil { + t.Fatalf("Datasets().List: %v", err) + } + if page.Total < 0 { + t.Fatalf("unexpected total: %d", page.Total) + } +} + +func TestGetDataset(t *testing.T) { + client := requireClient(t) + ctx, cancel := testContext(t) + defer cancel() + + ds, err := client.Datasets().GetOrCreate(ctx, uniqueName("ds-get")) + if err != nil { + t.Fatalf("get-or-create: %v", err) + } + defer func() { _ = client.Dataset(ds.ID).Delete(ctx) }() + + got, ok, err := client.Dataset(ds.ID).Get(ctx) + if err != nil || !ok || got.ID != ds.ID { + t.Fatalf("get dataset: ok=%v err=%v", ok, err) + } +} + +func TestDatasetCRUDFlow(t *testing.T) { + client := requireClient(t) + ctx, cancel := testContext(t) + defer cancel() + + ds, err := client.Datasets().GetOrCreate(ctx, uniqueName("ds-crud")) + if err != nil { + t.Fatalf("get-or-create: %v", err) + } + defer func() { _ = client.Dataset(ds.ID).Delete(ctx) }() + dataset := client.Dataset(ds.ID) + + if _, ok, err := dataset.Get(ctx); err != nil || !ok { + t.Fatalf("get: ok=%v err=%v", ok, err) + } + + items := []map[string]any{ + {"url": "https://a.com", "n": 1}, + {"url": "https://b.com", "n": 2}, + {"url": "https://c.com", "n": 3}, + } + if err := dataset.PushItems(ctx, items); err != nil { + t.Fatalf("push items: %v", err) + } + + page, err := dataset.ListItems(ctx, apify.DatasetListItemsOptions{}) + if err != nil { + t.Fatalf("list items: %v", err) + } + // The pushed items should be readable immediately. The X-Apify-Pagination-Total header + // can lag behind under eventual consistency, so assert on the returned item count. + if page.Count != 3 || len(page.Items) != 3 { + t.Fatalf("expected 3 items, got count=%d len=%d total=%d", page.Count, len(page.Items), page.Total) + } + + csv, err := dataset.DownloadItems(ctx, apify.FormatCSV, apify.DatasetDownloadOptions{Bom: ptr(true)}) + if err != nil { + t.Fatalf("download items: %v", err) + } + if !bytes.Contains(csv, []byte("url")) { + t.Fatalf("expected CSV to contain a header, got %q", string(csv)) + } + + url, err := dataset.CreateItemsPublicURL(ctx, apify.DatasetListItemsOptions{}, nil) + if err != nil || url == "" { + t.Fatalf("public url: %q err=%v", url, err) + } + + if _, _, err := dataset.GetStatistics(ctx); err != nil { + t.Fatalf("statistics: %v", err) + } + + updated, err := dataset.Update(ctx, map[string]any{"name": uniqueName("ds-renamed")}) + if err != nil { + t.Fatalf("update: %v", err) + } + if updated.Name == "" { + t.Fatalf("expected renamed dataset, got %+v", updated) + } + + // Sanity-check that items decode into typed values. + var first struct { + N int `json:"n"` + } + if err := json.Unmarshal(page.Items[0], &first); err != nil { + t.Fatalf("decode item: %v", err) + } +} diff --git a/tests/examples_test.go b/tests/examples_test.go new file mode 100644 index 0000000..c972076 --- /dev/null +++ b/tests/examples_test.go @@ -0,0 +1,32 @@ +package apify_test + +import ( + "os" + "os/exec" + "testing" +) + +// runExample runs `go run ./examples/<name>` as a subprocess and fails the test if it does +// not exit successfully. Each documentation example is exercised this way, mirroring the +// reference clients' example smoke tests, so the docs stay runnable. +func runExample(t *testing.T, name string) { + t.Helper() + if os.Getenv("APIFY_TOKEN") == "" { + t.Skip("skipping: APIFY_TOKEN is not set") + } + cmd := exec.Command("go", "run", "./examples/"+name) + cmd.Dir = ".." // run from the module root, where examples/ lives + cmd.Env = os.Environ() + out, err := cmd.CombinedOutput() + if err != nil { + t.Fatalf("example %q failed: %v\n%s", name, err, out) + } +} + +func TestExampleGetAccount(t *testing.T) { runExample(t, "get_account") } +func TestExampleStorages(t *testing.T) { runExample(t, "storages") } +func TestExampleRunStoreActor(t *testing.T) { runExample(t, "run_store_actor") } +func TestExampleRunAndLastRunStorages(t *testing.T) { runExample(t, "run_and_last_run_storages") } +func TestExampleIterateStore(t *testing.T) { runExample(t, "iterate_store") } +func TestExampleLogRedirection(t *testing.T) { runExample(t, "log_redirection") } +func TestExampleCreateBuildRunActor(t *testing.T) { runExample(t, "create_build_run_actor") } diff --git a/tests/helpers_test.go b/tests/helpers_test.go new file mode 100644 index 0000000..9668ce1 --- /dev/null +++ b/tests/helpers_test.go @@ -0,0 +1,71 @@ +// Package apify_test holds the integration test suite for the Apify Go client. +// +// All integration tests require a valid APIFY_TOKEN for the test account. The API base URL +// is taken from APIFY_API_URL (which includes the /v2 suffix) and falls back to +// https://api.apify.com/v2. +// +// Tests are designed to run concurrently — including against the same test account from +// several language clients at once — so every test creates uniquely-named resources and +// cleans them up afterwards. +package apify_test + +import ( + "context" + "crypto/rand" + "encoding/hex" + "os" + "strings" + "testing" + "time" + + apify "github.com/apify/apify-client-go" +) + +// defaultAPIURL mirrors the integration-test contract fallback. +const defaultAPIURL = "https://api.apify.com/v2" + +// resolveBaseURL derives the client base_url from an optional APIFY_API_URL. +// +// APIFY_API_URL includes the /v2 suffix (per the integration-test contract) and falls back +// to https://api.apify.com/v2. Since the client appends /v2 itself, the suffix is stripped. +func resolveBaseURL(apiURL string) string { + if apiURL == "" { + apiURL = defaultAPIURL + } + trimmed := strings.TrimRight(apiURL, "/") + trimmed = strings.TrimSuffix(trimmed, "/v2") + return trimmed +} + +// requireClient returns a configured client, or skips the test if APIFY_TOKEN is unset. +func requireClient(t *testing.T) *apify.ApifyClient { + t.Helper() + token := os.Getenv("APIFY_TOKEN") + if token == "" { + t.Skip("skipping: APIFY_TOKEN is not set") + } + return apify.NewClientWithOptions( + apify.WithToken(token), + apify.WithBaseURL(resolveBaseURL(os.Getenv("APIFY_API_URL"))), + ) +} + +// testContext returns a context with a generous timeout for a single test. +func testContext(t *testing.T) (context.Context, context.CancelFunc) { + t.Helper() + return context.WithTimeout(context.Background(), 5*time.Minute) +} + +// uniqueName generates a collision-resistant resource name for test isolation. +// +// The name embeds the test-specific prefix and a random hex fragment, kept short enough for +// Apify's naming limits. The random component lets the same test run in parallel (across +// processes and languages) without clobbering shared state. +func uniqueName(prefix string) string { + var buf [6]byte + _, _ = rand.Read(buf[:]) + return "go-test-" + prefix + "-" + hex.EncodeToString(buf[:]) +} + +// ptr returns a pointer to v, for the *T option fields. +func ptr[T any](v T) *T { return &v } diff --git a/tests/key_value_store_test.go b/tests/key_value_store_test.go new file mode 100644 index 0000000..72d8ef3 --- /dev/null +++ b/tests/key_value_store_test.go @@ -0,0 +1,185 @@ +package apify_test + +import ( + "bytes" + "encoding/json" + "io" + "net/http" + "testing" + + apify "github.com/apify/apify-client-go" +) + +func TestListKeyValueStores(t *testing.T) { + client := requireClient(t) + ctx, cancel := testContext(t) + defer cancel() + + page, err := client.KeyValueStores().List(ctx, apify.StorageListOptions{Limit: ptr(int64(5))}) + if err != nil { + t.Fatalf("List: %v", err) + } + if page.Total < 0 { + t.Fatalf("unexpected total: %d", page.Total) + } +} + +func TestGetKeyValueStore(t *testing.T) { + client := requireClient(t) + ctx, cancel := testContext(t) + defer cancel() + + store, err := client.KeyValueStores().GetOrCreate(ctx, uniqueName("kvs-get")) + if err != nil { + t.Fatalf("get-or-create: %v", err) + } + defer func() { _ = client.KeyValueStore(store.ID).Delete(ctx) }() + + got, ok, err := client.KeyValueStore(store.ID).Get(ctx) + if err != nil || !ok || got.ID != store.ID { + t.Fatalf("get: ok=%v err=%v", ok, err) + } +} + +// TestRecordKeyWithSpecialChars validates percent-encoding of URL-reserved characters in +// record-key path segments. +func TestRecordKeyWithSpecialChars(t *testing.T) { + client := requireClient(t) + ctx, cancel := testContext(t) + defer cancel() + + store, err := client.KeyValueStores().GetOrCreate(ctx, uniqueName("kvs-special")) + if err != nil { + t.Fatalf("get-or-create: %v", err) + } + defer func() { _ = client.KeyValueStore(store.ID).Delete(ctx) }() + kvs := client.KeyValueStore(store.ID) + + // Only characters allowed by the API, but including URL-reserved ones that must be + // percent-encoded in the path segment. + key := "weird-key!'()" + if err := kvs.SetRecordJSON(ctx, key, map[string]any{"ok": true}); err != nil { + t.Fatalf("set record: %v", err) + } + exists, err := kvs.RecordExists(ctx, key) + if err != nil || !exists { + t.Fatalf("record exists: exists=%v err=%v", exists, err) + } + rec, ok, err := kvs.GetRecord(ctx, key) + if err != nil || !ok { + t.Fatalf("get record: ok=%v err=%v", ok, err) + } + var decoded map[string]any + if err := json.Unmarshal(rec.Value, &decoded); err != nil { + t.Fatalf("decode record: %v", err) + } + if err := kvs.DeleteRecord(ctx, key); err != nil { + t.Fatalf("delete record: %v", err) + } +} + +func TestGetRecordsReturnsZip(t *testing.T) { + client := requireClient(t) + ctx, cancel := testContext(t) + defer cancel() + + store, err := client.KeyValueStores().GetOrCreate(ctx, uniqueName("kvs-zip")) + if err != nil { + t.Fatalf("get-or-create: %v", err) + } + defer func() { _ = client.KeyValueStore(store.ID).Delete(ctx) }() + kvs := client.KeyValueStore(store.ID) + + if err := kvs.SetRecordJSON(ctx, "rec1", map[string]any{"a": 1}); err != nil { + t.Fatalf("set record: %v", err) + } + zip, err := kvs.GetRecords(ctx, apify.GetRecordsOptions{}) + if err != nil { + t.Fatalf("get records: %v", err) + } + if !bytes.HasPrefix(zip, []byte("PK\x03\x04")) { + t.Fatalf("expected a ZIP archive, got %d bytes with prefix %q", len(zip), zip[:min(4, len(zip))]) + } +} + +func TestKeyValueStoreCRUDFlow(t *testing.T) { + client := requireClient(t) + ctx, cancel := testContext(t) + defer cancel() + + store, err := client.KeyValueStores().GetOrCreate(ctx, uniqueName("kvs-crud")) + if err != nil { + t.Fatalf("get-or-create: %v", err) + } + defer func() { _ = client.KeyValueStore(store.ID).Delete(ctx) }() + kvs := client.KeyValueStore(store.ID) + + if _, ok, err := kvs.Get(ctx); err != nil || !ok { + t.Fatalf("get: ok=%v err=%v", ok, err) + } + if err := kvs.SetRecordJSON(ctx, "OUTPUT", map[string]any{"hello": "world"}); err != nil { + t.Fatalf("set record: %v", err) + } + exists, err := kvs.RecordExists(ctx, "OUTPUT") + if err != nil || !exists { + t.Fatalf("record exists: exists=%v err=%v", exists, err) + } + rec, ok, err := kvs.GetRecord(ctx, "OUTPUT") + if err != nil || !ok { + t.Fatalf("get record: ok=%v err=%v", ok, err) + } + var decoded map[string]any + if err := json.Unmarshal(rec.Value, &decoded); err != nil || decoded["hello"] != "world" { + t.Fatalf("unexpected record: %v err=%v", decoded, err) + } + if _, _, err := kvs.GetRecordWithOptions(ctx, "OUTPUT", apify.GetRecordOptions{Attachment: ptr(false)}); err != nil { + t.Fatalf("get record with options: %v", err) + } + keys, err := kvs.ListKeys(ctx, apify.ListKeysOptions{}) + if err != nil { + t.Fatalf("list keys: %v", err) + } + if len(keys.Items) == 0 { + t.Fatal("expected at least one key") + } + if _, err := kvs.Update(ctx, map[string]any{"name": uniqueName("kvs-renamed")}); err != nil { + t.Fatalf("update: %v", err) + } + if err := kvs.DeleteRecord(ctx, "OUTPUT"); err != nil { + t.Fatalf("delete record: %v", err) + } +} + +// TestRecordPublicURLIsFetchable verifies that the public record URL is fetchable without +// authentication. +func TestRecordPublicURLIsFetchable(t *testing.T) { + client := requireClient(t) + ctx, cancel := testContext(t) + defer cancel() + + store, err := client.KeyValueStores().GetOrCreate(ctx, uniqueName("kvs-pub")) + if err != nil { + t.Fatalf("get-or-create: %v", err) + } + defer func() { _ = client.KeyValueStore(store.ID).Delete(ctx) }() + kvs := client.KeyValueStore(store.ID) + + if err := kvs.SetRecordJSON(ctx, "OUTPUT", map[string]any{"pub": true}); err != nil { + t.Fatalf("set record: %v", err) + } + url, err := kvs.GetRecordPublicURL(ctx, "OUTPUT") + if err != nil || url == "" { + t.Fatalf("public url: %q err=%v", url, err) + } + + req, _ := http.NewRequestWithContext(ctx, http.MethodGet, url, nil) + resp, err := http.DefaultClient.Do(req) + if err != nil { + t.Fatalf("fetch public url: %v", err) + } + defer resp.Body.Close() + _, _ = io.Copy(io.Discard, resp.Body) + if resp.StatusCode >= 300 { + t.Fatalf("expected success fetching public url, got %d", resp.StatusCode) + } +} diff --git a/tests/request_queue_test.go b/tests/request_queue_test.go new file mode 100644 index 0000000..183f05d --- /dev/null +++ b/tests/request_queue_test.go @@ -0,0 +1,198 @@ +package apify_test + +import ( + "fmt" + "testing" + + apify "github.com/apify/apify-client-go" +) + +func TestListRequestQueues(t *testing.T) { + client := requireClient(t) + ctx, cancel := testContext(t) + defer cancel() + + page, err := client.RequestQueues().List(ctx, apify.StorageListOptions{Limit: ptr(int64(5))}) + if err != nil { + t.Fatalf("List: %v", err) + } + if page.Total < 0 { + t.Fatalf("unexpected total: %d", page.Total) + } +} + +func TestGetRequestQueue(t *testing.T) { + client := requireClient(t) + ctx, cancel := testContext(t) + defer cancel() + + rq, err := client.RequestQueues().GetOrCreate(ctx, uniqueName("rq-get")) + if err != nil { + t.Fatalf("get-or-create: %v", err) + } + defer func() { _ = client.RequestQueue(rq.ID).Delete(ctx) }() + + got, ok, err := client.RequestQueue(rq.ID).Get(ctx) + if err != nil || !ok || got.ID != rq.ID { + t.Fatalf("get: ok=%v err=%v", ok, err) + } +} + +func TestRequestQueueCRUDFlow(t *testing.T) { + client := requireClient(t) + ctx, cancel := testContext(t) + defer cancel() + + rq, err := client.RequestQueues().GetOrCreate(ctx, uniqueName("rq-crud")) + if err != nil { + t.Fatalf("get-or-create: %v", err) + } + defer func() { _ = client.RequestQueue(rq.ID).Delete(ctx) }() + queue := client.RequestQueue(rq.ID) + + if _, ok, err := queue.Get(ctx); err != nil || !ok { + t.Fatalf("get: ok=%v err=%v", ok, err) + } + + info, err := queue.AddRequest(ctx, apify.RequestQueueRequest{ + URL: "https://example.com", + UniqueKey: "example", + Method: "GET", + UserData: []byte(`{"label":"DETAIL"}`), + }, false) + if err != nil { + t.Fatalf("add request: %v", err) + } + if info.RequestID == "" { + t.Fatal("expected a request ID") + } + + got, ok, err := queue.GetRequest(ctx, info.RequestID) + if err != nil || !ok || got.URL != "https://example.com" { + t.Fatalf("get request: ok=%v err=%v %+v", ok, err, got) + } + + head, err := queue.ListHead(ctx, ptr(int64(10))) + if err != nil { + t.Fatalf("list head: %v", err) + } + if len(head.Items) == 0 { + t.Fatal("expected at least one request at the head") + } + + if _, err := queue.Update(ctx, map[string]any{"name": uniqueName("rq-renamed")}); err != nil { + t.Fatalf("update: %v", err) + } + if err := queue.DeleteRequest(ctx, info.RequestID); err != nil { + t.Fatalf("delete request: %v", err) + } +} + +// TestRequestQueuePaginateMultiplePages validates cursor-based pagination across pages. +func TestRequestQueuePaginateMultiplePages(t *testing.T) { + client := requireClient(t) + ctx, cancel := testContext(t) + defer cancel() + + rq, err := client.RequestQueues().GetOrCreate(ctx, uniqueName("rq-page")) + if err != nil { + t.Fatalf("get-or-create: %v", err) + } + defer func() { _ = client.RequestQueue(rq.ID).Delete(ctx) }() + queue := client.RequestQueue(rq.ID) + + const total = 5 + for i := 0; i < total; i++ { + url := fmt.Sprintf("https://example.com/%d", i) + if _, err := queue.AddRequest(ctx, apify.RequestQueueRequest{URL: url, UniqueKey: url}, false); err != nil { + t.Fatalf("add request %d: %v", i, err) + } + } + + seen := map[string]int{} + it := queue.PaginateRequests(ptr(int64(2))) // small page size forces multiple pages + for { + req, err := it.Next(ctx) + if err != nil { + t.Fatalf("iterate: %v", err) + } + if req == nil { + break + } + seen[req.URL]++ + } + if len(seen) != total { + t.Fatalf("expected %d distinct requests, saw %d (%v)", total, len(seen), seen) + } + for url, count := range seen { + if count != 1 { + t.Fatalf("request %s returned %d times (expected once)", url, count) + } + } +} + +// TestRequestQueueBatchAddRequests exercises the chunked batch-add path with more than the +// 25-per-call API limit, verifying all requests are accepted across chunks. +func TestRequestQueueBatchAddRequests(t *testing.T) { + client := requireClient(t) + ctx, cancel := testContext(t) + defer cancel() + + rq, err := client.RequestQueues().GetOrCreate(ctx, uniqueName("rq-batch")) + if err != nil { + t.Fatalf("get-or-create: %v", err) + } + defer func() { _ = client.RequestQueue(rq.ID).Delete(ctx) }() + queue := client.RequestQueue(rq.ID) + + const total = 30 // > 25, so the client must split into multiple chunks + requests := make([]apify.RequestQueueRequest, total) + for i := 0; i < total; i++ { + url := fmt.Sprintf("https://batch.example.com/%d", i) + requests[i] = apify.RequestQueueRequest{URL: url, UniqueKey: url} + } + result, err := queue.BatchAddRequests(ctx, requests, false) + if err != nil { + t.Fatalf("batch add: %v", err) + } + if len(result.ProcessedRequests) != total { + t.Fatalf("expected %d processed requests, got %d (unprocessed=%d)", + total, len(result.ProcessedRequests), len(result.UnprocessedRequests)) + } +} + +// TestRequestQueueLockLifecycle exercises the lock operations end-to-end. +func TestRequestQueueLockLifecycle(t *testing.T) { + client := requireClient(t) + ctx, cancel := testContext(t) + defer cancel() + + rq, err := client.RequestQueues().GetOrCreate(ctx, uniqueName("rq-lock")) + if err != nil { + t.Fatalf("get-or-create: %v", err) + } + defer func() { _ = client.RequestQueue(rq.ID).Delete(ctx) }() + + // A stable client key is required to unlock the client's own locks. + queue := client.RequestQueue(rq.ID).WithClientKey("go-test-client-key") + + info, err := queue.AddRequest(ctx, apify.RequestQueueRequest{URL: "https://lock.example.com", UniqueKey: "lock"}, false) + if err != nil { + t.Fatalf("add request: %v", err) + } + if _, err := queue.ListRequests(ctx, apify.ListRequestsOptions{}); err != nil { + t.Fatalf("list requests: %v", err) + } + if _, err := queue.ListAndLockHead(ctx, 60, ptr(int64(10))); err != nil { + t.Fatalf("list and lock head: %v", err) + } + if _, err := queue.ProlongRequestLock(ctx, info.RequestID, 30, false); err != nil { + t.Fatalf("prolong lock: %v", err) + } + if err := queue.DeleteRequestLock(ctx, info.RequestID, false); err != nil { + t.Fatalf("delete lock: %v", err) + } + if _, err := queue.UnlockRequests(ctx); err != nil { + t.Fatalf("unlock requests: %v", err) + } +} diff --git a/tests/schedule_test.go b/tests/schedule_test.go new file mode 100644 index 0000000..47489aa --- /dev/null +++ b/tests/schedule_test.go @@ -0,0 +1,75 @@ +package apify_test + +import ( + "testing" + + apify "github.com/apify/apify-client-go" +) + +func scheduleDef(name string) map[string]any { + return map[string]any{ + "name": name, + "cronExpression": "0 0 * * *", + "isEnabled": false, + "isExclusive": true, + "actions": []any{}, + } +} + +func TestListSchedules(t *testing.T) { + client := requireClient(t) + ctx, cancel := testContext(t) + defer cancel() + + page, err := client.Schedules().List(ctx, apify.ListOptions{Limit: ptr(int64(5))}) + if err != nil { + t.Fatalf("List: %v", err) + } + if page.Total < 0 { + t.Fatalf("unexpected total: %d", page.Total) + } +} + +func TestGetSchedule(t *testing.T) { + client := requireClient(t) + ctx, cancel := testContext(t) + defer cancel() + + sch, err := client.Schedules().Create(ctx, scheduleDef(uniqueName("sch-get"))) + if err != nil { + t.Fatalf("create: %v", err) + } + defer func() { _ = client.Schedule(sch.ID).Delete(ctx) }() + + got, ok, err := client.Schedule(sch.ID).Get(ctx) + if err != nil || !ok || got.ID != sch.ID { + t.Fatalf("get: ok=%v err=%v", ok, err) + } +} + +func TestScheduleCRUDFlow(t *testing.T) { + client := requireClient(t) + ctx, cancel := testContext(t) + defer cancel() + + sch, err := client.Schedules().Create(ctx, scheduleDef(uniqueName("sch-crud"))) + if err != nil { + t.Fatalf("create: %v", err) + } + defer func() { _ = client.Schedule(sch.ID).Delete(ctx) }() + schedule := client.Schedule(sch.ID) + + if _, ok, err := schedule.Get(ctx); err != nil || !ok { + t.Fatalf("get: ok=%v err=%v", ok, err) + } + updated, err := schedule.Update(ctx, map[string]any{"cronExpression": "0 12 * * *"}) + if err != nil { + t.Fatalf("update: %v", err) + } + if updated.CronExpression != "0 12 * * *" { + t.Fatalf("cron not updated: %+v", updated) + } + if _, _, err := schedule.GetLog(ctx); err != nil { + t.Fatalf("get log: %v", err) + } +} diff --git a/tests/store_test.go b/tests/store_test.go new file mode 100644 index 0000000..c89d1ae --- /dev/null +++ b/tests/store_test.go @@ -0,0 +1,46 @@ +package apify_test + +import ( + "testing" + + apify "github.com/apify/apify-client-go" +) + +func TestListStore(t *testing.T) { + client := requireClient(t) + ctx, cancel := testContext(t) + defer cancel() + + page, err := client.Store().List(ctx, apify.StoreListOptions{Limit: ptr(int64(5))}) + if err != nil { + t.Fatalf("Store().List: %v", err) + } + if len(page.Items) > 5 { + t.Fatalf("expected at most 5 items, got %d", len(page.Items)) + } +} + +func TestIterateStore(t *testing.T) { + client := requireClient(t) + ctx, cancel := testContext(t) + defer cancel() + + it := client.Store().Iterate(apify.StoreListOptions{Limit: ptr(int64(5))}) + count := 0 + for count < 12 { + item, err := it.Next(ctx) + if err != nil { + t.Fatalf("iterate: %v", err) + } + if item == nil { + break + } + if item.ID == "" { + t.Fatal("expected a non-empty store actor ID") + } + count++ + } + if count < 12 { + t.Fatalf("expected to iterate at least 12 store actors, got %d", count) + } +} diff --git a/tests/task_test.go b/tests/task_test.go new file mode 100644 index 0000000..3a994a1 --- /dev/null +++ b/tests/task_test.go @@ -0,0 +1,76 @@ +package apify_test + +import ( + "testing" + + apify "github.com/apify/apify-client-go" +) + +func taskDef(name string) map[string]any { + return map[string]any{ + "actId": "apify/hello-world", + "name": name, + "options": map[string]any{"build": "latest", "memoryMbytes": 256, "timeoutSecs": 60}, + "input": map[string]any{"message": "hello"}, + } +} + +func TestListTasks(t *testing.T) { + client := requireClient(t) + ctx, cancel := testContext(t) + defer cancel() + + page, err := client.Tasks().List(ctx, apify.ListOptions{Limit: ptr(int64(5))}) + if err != nil { + t.Fatalf("List: %v", err) + } + if page.Total < 0 { + t.Fatalf("unexpected total: %d", page.Total) + } +} + +func TestGetTask(t *testing.T) { + client := requireClient(t) + ctx, cancel := testContext(t) + defer cancel() + + task, err := client.Tasks().Create(ctx, taskDef(uniqueName("task-get"))) + if err != nil { + t.Fatalf("create: %v", err) + } + defer func() { _ = client.Task(task.ID).Delete(ctx) }() + + got, ok, err := client.Task(task.ID).Get(ctx) + if err != nil || !ok || got.ID != task.ID { + t.Fatalf("get: ok=%v err=%v", ok, err) + } +} + +func TestTaskCRUDFlow(t *testing.T) { + client := requireClient(t) + ctx, cancel := testContext(t) + defer cancel() + + task, err := client.Tasks().Create(ctx, taskDef(uniqueName("task-crud"))) + if err != nil { + t.Fatalf("create: %v", err) + } + defer func() { _ = client.Task(task.ID).Delete(ctx) }() + tc := client.Task(task.ID) + + if _, ok, err := tc.Get(ctx); err != nil || !ok { + t.Fatalf("get: ok=%v err=%v", ok, err) + } + if _, err := tc.UpdateInput(ctx, map[string]any{"message": "updated"}); err != nil { + t.Fatalf("update input: %v", err) + } + if _, ok, err := tc.GetInput(ctx); err != nil || !ok { + t.Fatalf("get input: ok=%v err=%v", ok, err) + } + if _, err := tc.Update(ctx, map[string]any{"name": uniqueName("task-renamed")}); err != nil { + t.Fatalf("update: %v", err) + } + if _, err := tc.Runs().List(ctx, apify.ListOptions{}, apify.RunListOptions{}); err != nil { + t.Fatalf("runs list: %v", err) + } +} diff --git a/tests/user_test.go b/tests/user_test.go new file mode 100644 index 0000000..c81fa66 --- /dev/null +++ b/tests/user_test.go @@ -0,0 +1,45 @@ +package apify_test + +import "testing" + +func TestGetOwnAccount(t *testing.T) { + client := requireClient(t) + ctx, cancel := testContext(t) + defer cancel() + + user, ok, err := client.Me().Get(ctx) + if err != nil { + t.Fatalf("Me().Get: %v", err) + } + if !ok || user.ID == "" { + t.Fatalf("expected a user with a non-empty ID, got ok=%v %+v", ok, user) + } +} + +func TestGetMonthlyUsage(t *testing.T) { + client := requireClient(t) + ctx, cancel := testContext(t) + defer cancel() + + usage, err := client.Me().MonthlyUsage(ctx) + if err != nil { + t.Fatalf("MonthlyUsage: %v", err) + } + if len(usage) == 0 { + t.Fatal("expected a non-empty monthly usage object") + } +} + +func TestGetLimits(t *testing.T) { + client := requireClient(t) + ctx, cancel := testContext(t) + defer cancel() + + limits, err := client.Me().Limits(ctx) + if err != nil { + t.Fatalf("Limits: %v", err) + } + if len(limits) == 0 { + t.Fatal("expected a non-empty limits object") + } +} diff --git a/tests/webhook_test.go b/tests/webhook_test.go new file mode 100644 index 0000000..ea9fbeb --- /dev/null +++ b/tests/webhook_test.go @@ -0,0 +1,112 @@ +package apify_test + +import ( + "testing" + + apify "github.com/apify/apify-client-go" +) + +func webhookDef(url string) map[string]any { + return map[string]any{ + "isAdHoc": true, + "eventTypes": []string{"ACTOR.RUN.SUCCEEDED"}, + "condition": map[string]any{"actorRunId": "ZZZZZZZZZZZZZZZZZ"}, + "requestUrl": url, + } +} + +func TestListWebhooks(t *testing.T) { + client := requireClient(t) + ctx, cancel := testContext(t) + defer cancel() + + page, err := client.Webhooks().List(ctx, apify.ListOptions{Limit: ptr(int64(5))}) + if err != nil { + t.Fatalf("List: %v", err) + } + if page.Total < 0 { + t.Fatalf("unexpected total: %d", page.Total) + } +} + +func TestListWebhookDispatches(t *testing.T) { + client := requireClient(t) + ctx, cancel := testContext(t) + defer cancel() + + page, err := client.WebhookDispatches().List(ctx, apify.ListOptions{Limit: ptr(int64(5))}) + if err != nil { + t.Fatalf("List: %v", err) + } + if page.Total < 0 { + t.Fatalf("unexpected total: %d", page.Total) + } +} + +func TestGetWebhook(t *testing.T) { + client := requireClient(t) + ctx, cancel := testContext(t) + defer cancel() + + wh, err := client.Webhooks().Create(ctx, webhookDef("https://example.com/webhook")) + if err != nil { + t.Fatalf("create: %v", err) + } + defer func() { _ = client.Webhook(wh.ID).Delete(ctx) }() + + got, ok, err := client.Webhook(wh.ID).Get(ctx) + if err != nil || !ok || got.ID != wh.ID { + t.Fatalf("get: ok=%v err=%v", ok, err) + } +} + +func TestGetWebhookDispatch(t *testing.T) { + client := requireClient(t) + ctx, cancel := testContext(t) + defer cancel() + + wh, err := client.Webhooks().Create(ctx, webhookDef("https://example.com/webhook")) + if err != nil { + t.Fatalf("create: %v", err) + } + defer func() { _ = client.Webhook(wh.ID).Delete(ctx) }() + + dispatch, err := client.Webhook(wh.ID).Test(ctx) + if err != nil { + t.Fatalf("test webhook: %v", err) + } + got, ok, err := client.WebhookDispatch(dispatch.ID).Get(ctx) + if err != nil || !ok || got.ID != dispatch.ID { + t.Fatalf("get dispatch: ok=%v err=%v", ok, err) + } +} + +func TestWebhookCRUDFlow(t *testing.T) { + client := requireClient(t) + ctx, cancel := testContext(t) + defer cancel() + + wh, err := client.Webhooks().Create(ctx, webhookDef("https://example.com/webhook")) + if err != nil { + t.Fatalf("create: %v", err) + } + defer func() { _ = client.Webhook(wh.ID).Delete(ctx) }() + webhook := client.Webhook(wh.ID) + + if _, ok, err := webhook.Get(ctx); err != nil || !ok { + t.Fatalf("get: ok=%v err=%v", ok, err) + } + updated, err := webhook.Update(ctx, map[string]any{"requestUrl": "https://example.com/updated"}) + if err != nil { + t.Fatalf("update: %v", err) + } + if updated.RequestURL != "https://example.com/updated" { + t.Fatalf("request url not updated: %+v", updated) + } + if _, err := webhook.Dispatches().List(ctx, apify.ListOptions{}); err != nil { + t.Fatalf("dispatches list: %v", err) + } + if _, err := webhook.Test(ctx); err != nil { + t.Fatalf("test: %v", err) + } +} diff --git a/unit_http_test.go b/unit_http_test.go new file mode 100644 index 0000000..eebfa03 --- /dev/null +++ b/unit_http_test.go @@ -0,0 +1,220 @@ +package apify + +import ( + "bytes" + "context" + "errors" + "io" + "net/http" + "sync" + "testing" + "time" +) + +// mockBackend is a deterministic HTTPBackend for offline unit tests. It serves a queue of +// scripted responses/errors and records how many times it was called. +type mockBackend struct { + mu sync.Mutex + responses []mockResponse + calls int + lastHeaders http.Header + lastURL string + lastBody string + bodies []string +} + +type mockResponse struct { + status int + body string + err error +} + +func (m *mockBackend) Do(req *http.Request) (*http.Response, error) { + m.mu.Lock() + defer m.mu.Unlock() + idx := m.calls + m.calls++ + m.lastHeaders = req.Header.Clone() + m.lastURL = req.URL.String() + if req.Body != nil { + data, _ := io.ReadAll(req.Body) + m.lastBody = string(data) + m.bodies = append(m.bodies, string(data)) + } + // If we run past the script, repeat the last entry (so "constant" behaviour is easy). + if idx >= len(m.responses) { + idx = len(m.responses) - 1 + } + r := m.responses[idx] + if r.err != nil { + return nil, r.err + } + return &http.Response{ + StatusCode: r.status, + Header: http.Header{}, + Body: io.NopCloser(bytes.NewReader([]byte(r.body))), + }, nil +} + +func constant(status int, body string) []mockResponse { + return []mockResponse{{status: status, body: body}} +} + +// testClient builds a client wired to the given backend with a tiny retry delay so tests +// are fast. +func testClient(backend HTTPBackend, maxRetries int) *ApifyClient { + return NewClientWithOptions( + WithToken("test-token"), + WithHTTPBackend(backend), + WithMaxRetries(maxRetries), + WithMinDelayBetweenRetries(time.Millisecond), + ) +} + +func TestSuccessSingleCall(t *testing.T) { + backend := &mockBackend{responses: constant(200, `{"data":{"id":"u1","username":"bob"}}`)} + client := testClient(backend, 8) + + user, ok, err := client.Me().Get(context.Background()) + if err != nil { + t.Fatalf("unexpected error: %v", err) + } + if !ok || user.ID != "u1" || user.Username != "bob" { + t.Fatalf("unexpected user: %+v ok=%v", user, ok) + } + if backend.calls != 1 { + t.Fatalf("expected exactly 1 call, got %d", backend.calls) + } +} + +func TestRateLimitIsRetried(t *testing.T) { + backend := &mockBackend{responses: constant(429, `{"error":{"type":"rate-limit-exceeded","message":"slow down"}}`)} + client := testClient(backend, 2) + + _, _, err := client.Me().Get(context.Background()) + if err == nil { + t.Fatal("expected an error") + } + apiErr, ok := AsAPIError(err) + if !ok || apiErr.StatusCode != 429 { + t.Fatalf("expected 429 APIError, got %v", err) + } + // 1 initial + 2 retries = 3 attempts. + if backend.calls != 3 { + t.Fatalf("expected 3 attempts, got %d", backend.calls) + } + if apiErr.Attempt != 3 { + t.Fatalf("expected attempt 3, got %d", apiErr.Attempt) + } +} + +func TestServerErrorIsRetried(t *testing.T) { + backend := &mockBackend{responses: constant(503, `{"error":{"type":"internal","message":"boom"}}`)} + client := testClient(backend, 1) + + _, _, err := client.Me().Get(context.Background()) + if err == nil { + t.Fatal("expected an error") + } + if backend.calls != 2 { + t.Fatalf("expected 2 attempts, got %d", backend.calls) + } +} + +func TestClientErrorNotRetried(t *testing.T) { + backend := &mockBackend{responses: constant(400, `{"error":{"type":"bad-request","message":"nope"}}`)} + client := testClient(backend, 5) + + _, _, err := client.Me().Get(context.Background()) + if err == nil { + t.Fatal("expected an error") + } + if backend.calls != 1 { + t.Fatalf("expected exactly 1 attempt for 4xx, got %d", backend.calls) + } +} + +func TestNetworkErrorIsRetried(t *testing.T) { + backend := &mockBackend{responses: []mockResponse{{err: errors.New("connection refused")}}} + client := testClient(backend, 3) + + _, _, err := client.Me().Get(context.Background()) + if err == nil { + t.Fatal("expected an error") + } + if backend.calls != 4 { + t.Fatalf("expected 4 attempts, got %d", backend.calls) + } +} + +func TestRetryThenSuccess(t *testing.T) { + backend := &mockBackend{responses: []mockResponse{ + {status: 500, body: `{"error":{"type":"internal","message":"x"}}`}, + {status: 500, body: `{"error":{"type":"internal","message":"x"}}`}, + {status: 200, body: `{"data":{"id":"ok"}}`}, + }} + client := testClient(backend, 5) + + user, ok, err := client.Me().Get(context.Background()) + if err != nil { + t.Fatalf("unexpected error: %v", err) + } + if !ok || user.ID != "ok" { + t.Fatalf("unexpected user: %+v", user) + } + if backend.calls != 3 { + t.Fatalf("expected 3 attempts, got %d", backend.calls) + } +} + +func TestNotFoundMapsToNone(t *testing.T) { + backend := &mockBackend{responses: constant(404, `{"error":{"type":"record-not-found","message":"missing"}}`)} + client := testClient(backend, 5) + + _, ok, err := client.Actor("nope").Get(context.Background()) + if err != nil { + t.Fatalf("expected nil error for not-found, got %v", err) + } + if ok { + t.Fatal("expected ok=false for missing resource") + } + if backend.calls != 1 { + t.Fatalf("expected exactly 1 attempt (no retry on 404), got %d", backend.calls) + } +} + +func TestErrorBodyIsParsed(t *testing.T) { + backend := &mockBackend{responses: constant(400, `{"error":{"type":"bad-request","message":"invalid input","data":{"field":"name"}}}`)} + client := testClient(backend, 0) + + _, _, err := client.Me().Get(context.Background()) + apiErr, ok := AsAPIError(err) + if !ok { + t.Fatalf("expected APIError, got %v", err) + } + if apiErr.StatusCode != 400 || apiErr.Type != "bad-request" || apiErr.Message != "invalid input" { + t.Fatalf("unexpected fields: %+v", apiErr) + } + if apiErr.HTTPMethod != http.MethodGet { + t.Fatalf("expected GET, got %q", apiErr.HTTPMethod) + } + if apiErr.Path == "" { + t.Fatal("expected a non-empty path") + } + if apiErr.Data["field"] == nil { + t.Fatalf("expected error data to be parsed, got %+v", apiErr.Data) + } +} + +func TestZeroRetriesSingleAttempt(t *testing.T) { + backend := &mockBackend{responses: constant(500, `{"error":{"type":"internal","message":"x"}}`)} + client := testClient(backend, 0) + + _, _, err := client.Me().Get(context.Background()) + if err == nil { + t.Fatal("expected an error") + } + if backend.calls != 1 { + t.Fatalf("expected exactly 1 attempt with max_retries=0, got %d", backend.calls) + } +} diff --git a/user.go b/user.go new file mode 100644 index 0000000..fde1d90 --- /dev/null +++ b/user.go @@ -0,0 +1,62 @@ +package apify + +import ( + "context" + "encoding/json" + "errors" +) + +// UserClient is a client for accessing user data (/v2/users/{userId} or /v2/users/me). +// +// For the current user ("me"), it also exposes account usage and limits. Those endpoints +// only exist for "me" and return an error if called on another user's client. +type UserClient struct { + ctx *resourceContext + isMe bool +} + +func newUserClient(hc *httpClient, baseURL, id string) *UserClient { + return &UserClient{ + ctx: newSingleContext(hc, baseURL, "users", id), + isMe: id == meUserPlaceholder, + } +} + +// errNotMe is returned by the me-only methods when called on another user's client. +var errNotMe = errors.New("this operation is only available for the current user (use Me())") + +// Get fetches the user. For "me" it returns private account details; for other users it +// returns the public profile. The bool reports whether the user exists. +func (c *UserClient) Get(ctx context.Context) (User, bool, error) { + return getResource[User](ctx, c.ctx, "", NewQueryParams()) +} + +// MonthlyUsage fetches the current account's monthly usage. Only available for "me". +func (c *UserClient) MonthlyUsage(ctx context.Context) (json.RawMessage, error) { + if !c.isMe { + return nil, errNotMe + } + return getResourceRequired[json.RawMessage](ctx, c.ctx, "usage/monthly", NewQueryParams()) +} + +// Limits fetches the current account's resource limits. Only available for "me". +func (c *UserClient) Limits(ctx context.Context) (json.RawMessage, error) { + if !c.isMe { + return nil, errNotMe + } + return getResourceRequired[json.RawMessage](ctx, c.ctx, "limits", NewQueryParams()) +} + +// UpdateLimits updates the current account's resource limits. Only available for "me". +func (c *UserClient) UpdateLimits(ctx context.Context, newLimits any) error { + if !c.isMe { + return errNotMe + } + data, err := json.Marshal(newLimits) + if err != nil { + return err + } + url := c.ctx.subURL("limits") + _, err = c.ctx.http.call(ctx, "PUT", url, data, contentTypeJSON, defaultRequestTimeout) + return err +} diff --git a/utils.go b/utils.go deleted file mode 100644 index a857029..0000000 --- a/utils.go +++ /dev/null @@ -1,361 +0,0 @@ -/* -Apify API - - The Apify API (version 2) provides programmatic access to the [Apify platform](https://docs.apify.com). The API is organized around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) HTTP endpoints. You can download the complete OpenAPI schema of Apify API in the [YAML](http://docs.apify.com/api/openapi.yaml) or [JSON](http://docs.apify.com/api/openapi.json) formats. The source code is also available on [GitHub](https://github.com/apify/apify-docs/tree/master/apify-api/openapi). All requests and responses (including errors) are encoded in [JSON](http://www.json.org/) format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. - To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM package](https://www.npmjs.com/package/apify-client). - To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI package](https://pypi.org/project/apify-client/). The clients' functions correspond to the API endpoints and have the same parameters. This simplifies development of apps that depend on the Apify platform. :::note Important Request Details - `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header. - Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request. ::: ## Authentication <span id=\"/introduction/authentication\"></span> **You can find your API token on the [Integrations](https://console.apify.com/settings/integrations) page in the Apify Console.** To use your token in a request, either: - Add the token to your request's `Authorization` header as `Bearer <token>`. E.g., `Authorization: Bearer xxxxxxx`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). (Recommended). - Add it as the `token` parameter to your request URL. (Less secure). Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token. **Never share your API token or password with untrusted parties!** For more information, see our [integrations](https://docs.apify.com/platform/integrations) documentation. ### Agentic payments AI agents can authenticate and pay for Actor runs without an Apify account using agentic payments. Instead of an API token, the request carries a payment credential that both authorizes and pays for the call. Apify supports the [x402 protocol](https://docs.apify.com/platform/integrations/x402) (`PAYMENT-SIGNATURE` header) and [Skyfire](https://docs.apify.com/platform/integrations/skyfire) (`skyfire-pay-id` header). ## Basic usage <span id=\"/introduction/basic-usage\"></span> To run an Actor, send a POST request to the [Run Actor](#/reference/actors/run-collection/run-actor) endpoint using either the Actor ID code (e.g. `vKg4IjxZbEYTYeW8T`) or its name (e.g. `janedoe~my-actor`): `https://api.apify.com/v2/actors/[actor_id]/runs` If the Actor is not runnable anonymously, you will receive a 401 or 403 [response code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). This means you need to add your [secret API token](https://console.apify.com/account#/integrations) to the request's `Authorization` header ([recommended](#/introduction/authentication)) or as a URL query parameter `?token=[your_token]` (less secure). Optionally, you can include the query parameters described in the [Run Actor](#/reference/actors/run-collection/run-actor) section to customize your run. If you're using Node.js, the best way to run an Actor is using the `Apify.call()` method from the [Apify SDK](https://sdk.apify.com/docs/api/apify#apifycallactid-input-options). It runs the Actor using the account you are currently logged into (determined by the [secret API token](https://console.apify.com/account#/integrations)). The result is an [Actor run object](https://sdk.apify.com/docs/typedefs/actor-run) and its output (if any). A typical workflow is as follows: 1. Run an Actor or task using the [Run Actor](#/reference/actors/run-collection/run-actor) or [Run task](#/reference/actor-tasks/run-collection/run-task) API endpoints. 2. Monitor the Actor run by periodically polling its progress using the [Get run](#/reference/actor-runs/run-object-and-its-storages/get-run) API endpoint. 3. Fetch the results from the [Get items](#/reference/datasets/item-collection/get-items) API endpoint using the `defaultDatasetId`, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the [Get record](#/reference/key-value-stores/record/get-record) API endpoint using the `defaultKeyValueStoreId` and the store's `key`. **Note**: Instead of periodic polling, you can also run your [Actor](#/reference/actors/run-actor-synchronously) or [task](#/reference/actor-tasks/runs-collection/run-task-synchronously) synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error. ## Legacy `/v2/acts/` URL prefix <span id=\"/introduction/legacy-acts-prefix\"></span> The `/v2/acts/` prefix is deprecated but still fully functional, and such endpoint routes to the same handler as its `/v2/actors/...` counterpart. New integrations should use the canonical /v2/actors/ prefix, but existing clients keep working without changes. ## Response structure <span id=\"/introduction/response-structure\"></span> Most API endpoints return a JSON object with the `data` property: ``` { \"data\": { ... } } ``` However, there are a few explicitly described exceptions, such as [Get dataset items](#/reference/datasets/item-collection/get-items) or Key-value store [Get record](#/reference/key-value-stores/record/get-record) API endpoints, which return data in other formats. In case of an error, the response has the HTTP status code in the range of 4xx or 5xx and the `data` property is replaced with `error`. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` See [Errors](#/introduction/errors) for more details. ## Pagination <span id=\"/introduction/pagination\"></span> All API endpoints that return a list of records (e.g. [Get list of Actors](#/reference/actors/actor-collection/get-list-of-actors)) enforce pagination in order to limit the size of their responses. Most of these API endpoints are paginated using the `offset` and `limit` query parameters. The only exception is [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys), which is paginated using the `exclusiveStartKey` query parameter. **IMPORTANT**: Each API endpoint that supports pagination enforces a certain maximum value for the `limit` parameter, in order to reduce the load on Apify servers. The maximum limit could change in future so you should never rely on a specific value and check the responses of these API endpoints. ### Using offset <span id=\"/introduction/pagination/using-offset\"></span> Most API endpoints that return a list of records enable pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number of items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>offset</code></td> <td>Skips a number of items from the beginning of the list, e.g. <code>offset=100</code>.</td> </tr> <tr> <td><code>desc</code></td> <td> By default, items are sorted in the order in which they were created or added to the list. This feature is useful when fetching all the items, because it ensures that items created after the client started the pagination will not be skipped. If you specify the <code>desc=1</code> parameter, the items will be returned in the reverse order, i.e. from the newest to the oldest items. </td> </tr> </table> The response of these API endpoints is always a JSON object with the following structure: ``` { \"data\": { \"total\": 2560, \"offset\": 250, \"limit\": 1000, \"count\": 1000, \"desc\": false, \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>total</code></td> <td>The total number of items available in the list.</td> </tr> <tr> <td><code>offset</code></td> <td>The number of items that were skipped at the start. This is equal to the <code>offset</code> query parameter if it was provided, otherwise it is <code>0</code>.</td> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular API endpoint, whichever is smaller.</td> </tr> <tr> <td><code>count</code></td> <td>The actual number of items returned in the HTTP response.</td> </tr> <tr> <td><code>desc</code></td> <td><code>true</code> if data were requested in descending order and <code>false</code> otherwise.</td> </tr> <tr> <td><code>items</code></td> <td>An array of requested items.</td> </tr> </table> ### Using key <span id=\"/introduction/pagination/using-key\"></span> The records in the [key-value store](https://docs.apify.com/platform/storage/key-value-store) are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the [Get list of keys](#/reference/key-value-stores/key-collection/get-list-of-keys) API endpoint only supports pagination using the following query parameters: <table> <tr> <td><code>limit</code></td> <td>Limits the response to contain a specific maximum number items, e.g. <code>limit=20</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>Skips all records with keys up to the given key including the given key, in the UTF-8 binary order.</td> </tr> </table> The response of the API endpoint is always a JSON object with following structure: ``` { \"data\": { \"limit\": 1000, \"isTruncated\": true, \"exclusiveStartKey\": \"my-key\", \"nextExclusiveStartKey\": \"some-other-key\", \"items\": [ { 1st object }, { 2nd object }, ... { 1000th object } ] } } ``` The following table describes the meaning of the response properties: <table> <tr> <th>Property</th> <th>Description</th> </tr> <tr> <td><code>limit</code></td> <td>The maximum number of items that can be returned in the HTTP response. It equals to the <code>limit</code> query parameter if it was provided or the maximum limit enforced for the particular endpoint, whichever is smaller.</td> </tr> <tr> <td><code>isTruncated</code></td> <td><code>true</code> if there are more items left to be queried. Otherwise <code>false</code>.</td> </tr> <tr> <td><code>exclusiveStartKey</code></td> <td>The last key that was skipped at the start. Is `null` for the first page.</td> </tr> <tr> <td><code>nextExclusiveStartKey</code></td> <td>The value for the <code>exclusiveStartKey</code> parameter to query the next page of items.</td> </tr> </table> ## Errors <span id=\"/introduction/errors\"></span> The Apify API uses common HTTP status codes: `2xx` range for success, `4xx` range for errors caused by the caller (invalid requests) and `5xx` range for server errors (these are rare). Each error response contains a JSON object defining the `error` property, which is an object with the `type` and `message` properties that contain the error code and a human-readable error description, respectively. For example: ``` { \"error\": { \"type\": \"record-not-found\", \"message\": \"Store was not found.\" } } ``` Here is the table of the most common errors that can occur for many API endpoints: <table> <tr> <th>status</th> <th>type</th> <th>message</th> </tr> <tr> <td><code>400</code></td> <td><code>invalid-request</code></td> <td>POST data must be a JSON object</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-value</code></td> <td>Invalid value provided: Comments required</td> </tr> <tr> <td><code>400</code></td> <td><code>invalid-record-key</code></td> <td>Record key contains invalid character</td> </tr> <tr> <td><code>401</code></td> <td><code>token-not-provided</code></td> <td>Authentication token was not provided</td> </tr> <tr> <td><code>404</code></td> <td><code>record-not-found</code></td> <td>Store was not found</td> </tr> <tr> <td><code>429</code></td> <td><code>rate-limit-exceeded</code></td> <td>You have exceeded the rate limit of ... requests per second</td> </tr> <tr> <td><code>405</code></td> <td><code>method-not-allowed</code></td> <td>This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST</td> </tr> </table> ## Rate limiting <span id=\"/introduction/rate-limiting\"></span> All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients. There are two kinds of rate limits - a global rate limit and a per-resource rate limit. ### Global rate limit <span id=\"/introduction/rate-limiting/global-rate-limit\"></span> The global rate limit is set to _250 000 requests per minute_. For [authenticated](#/introduction/authentication) requests, it is counted per user, and for unauthenticated requests, it is counted per IP address. ### Per-resource rate limit <span id=\"/introduction/rate-limiting/per-resource-rate-limit\"></span> The default per-resource rate limit is _60 requests per second per resource_, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc. The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits. Each API endpoint returns its rate limit in `X-RateLimit-Limit` header. These endpoints have a rate limit of _200 requests per second per resource_: * CRUD ([get](#/reference/key-value-stores/record/get-record), [put](#/reference/key-value-stores/record/put-record), [delete](#/reference/key-value-stores/record/delete-record)) operations on key-value store records These endpoints have a rate limit of _400 requests per second per resource_: * [Run Actor](#/reference/actors/run-collection/run-actor) * [Run Actor task asynchronously](#/reference/actor-tasks/runs-collection/run-task-asynchronously) * [Run Actor task synchronously](#/reference/actor-tasks/runs-collection/run-task-synchronously) * [Metamorph Actor run](#/reference/actors/metamorph-run/metamorph-run) * [Push items](#/reference/datasets/item-collection/put-items) to dataset * CRUD ([add](#/reference/request-queues/request-collection/add-request), [get](#/reference/request-queues/request-collection/get-request), [update](#/reference/request-queues/request-collection/update-request), [delete](#/reference/request-queues/request-collection/delete-request)) operations on requests in request queues ### Rate limit exceeded errors <span id=\"/introduction/rate-limiting/rate-limit-exceeded-errors\"></span> If the client is sending too many requests, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: ``` { \"error\": { \"type\": \"rate-limit-exceeded\", \"message\": \"You have exceeded the rate limit of ... requests per second\" } } ``` ### Retrying rate-limited requests with exponential backoff <span id=\"/introduction/rate-limiting/retrying-rate-limited-requests-with-exponential-backoff\"></span> If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as _exponential backoff_ and it can be described using the following pseudo-code: 1. Define a variable `DELAY=500` 2. Send the HTTP request to the API endpoint 3. If the response has status code not equal to `429` then you are done. Otherwise: * Wait for a period of time chosen randomly from the interval `DELAY` to `2*DELAY` milliseconds * Double the future wait period by setting `DELAY = 2*DELAY` * Continue with step 2 If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests. Note that the Apify API clients [for JavaScript](https://docs.apify.com/api/client/js) and [for Python](https://docs.apify.com/api/client/python) use the exponential backoff algorithm transparently, so that you do not need to worry about it. ## Referring to resources <span id=\"/introduction/referring-to-resources\"></span> There are three main ways to refer to a resource you're accessing via API. - the resource ID (e.g. `iKkPcIgVvwmztduf8`) - `username~resourcename` - when using this access method, you will need to use your API token, and access will only work if you have the correct permissions. - `~resourcename` - for this, you need to use an API token, and the `resourcename` refers to a resource in the API token owner's account. - -API version: v2-2026-06-16T064758Z -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apifyclient - -import ( - "bytes" - "encoding/json" - "fmt" - "reflect" - "time" -) - -// PtrBool is a helper routine that returns a pointer to given boolean value. -func PtrBool(v bool) *bool { return &v } - -// PtrInt is a helper routine that returns a pointer to given integer value. -func PtrInt(v int) *int { return &v } - -// PtrInt32 is a helper routine that returns a pointer to given integer value. -func PtrInt32(v int32) *int32 { return &v } - -// PtrInt64 is a helper routine that returns a pointer to given integer value. -func PtrInt64(v int64) *int64 { return &v } - -// PtrFloat32 is a helper routine that returns a pointer to given float value. -func PtrFloat32(v float32) *float32 { return &v } - -// PtrFloat64 is a helper routine that returns a pointer to given float value. -func PtrFloat64(v float64) *float64 { return &v } - -// PtrString is a helper routine that returns a pointer to given string value. -func PtrString(v string) *string { return &v } - -// PtrTime is helper routine that returns a pointer to given Time value. -func PtrTime(v time.Time) *time.Time { return &v } - -type NullableBool struct { - value *bool - isSet bool -} - -func (v NullableBool) Get() *bool { - return v.value -} - -func (v *NullableBool) Set(val *bool) { - v.value = val - v.isSet = true -} - -func (v NullableBool) IsSet() bool { - return v.isSet -} - -func (v *NullableBool) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableBool(val *bool) *NullableBool { - return &NullableBool{value: val, isSet: true} -} - -func (v NullableBool) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableBool) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - -type NullableInt struct { - value *int - isSet bool -} - -func (v NullableInt) Get() *int { - return v.value -} - -func (v *NullableInt) Set(val *int) { - v.value = val - v.isSet = true -} - -func (v NullableInt) IsSet() bool { - return v.isSet -} - -func (v *NullableInt) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableInt(val *int) *NullableInt { - return &NullableInt{value: val, isSet: true} -} - -func (v NullableInt) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableInt) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - -type NullableInt32 struct { - value *int32 - isSet bool -} - -func (v NullableInt32) Get() *int32 { - return v.value -} - -func (v *NullableInt32) Set(val *int32) { - v.value = val - v.isSet = true -} - -func (v NullableInt32) IsSet() bool { - return v.isSet -} - -func (v *NullableInt32) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableInt32(val *int32) *NullableInt32 { - return &NullableInt32{value: val, isSet: true} -} - -func (v NullableInt32) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableInt32) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - -type NullableInt64 struct { - value *int64 - isSet bool -} - -func (v NullableInt64) Get() *int64 { - return v.value -} - -func (v *NullableInt64) Set(val *int64) { - v.value = val - v.isSet = true -} - -func (v NullableInt64) IsSet() bool { - return v.isSet -} - -func (v *NullableInt64) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableInt64(val *int64) *NullableInt64 { - return &NullableInt64{value: val, isSet: true} -} - -func (v NullableInt64) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableInt64) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - -type NullableFloat32 struct { - value *float32 - isSet bool -} - -func (v NullableFloat32) Get() *float32 { - return v.value -} - -func (v *NullableFloat32) Set(val *float32) { - v.value = val - v.isSet = true -} - -func (v NullableFloat32) IsSet() bool { - return v.isSet -} - -func (v *NullableFloat32) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableFloat32(val *float32) *NullableFloat32 { - return &NullableFloat32{value: val, isSet: true} -} - -func (v NullableFloat32) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableFloat32) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - -type NullableFloat64 struct { - value *float64 - isSet bool -} - -func (v NullableFloat64) Get() *float64 { - return v.value -} - -func (v *NullableFloat64) Set(val *float64) { - v.value = val - v.isSet = true -} - -func (v NullableFloat64) IsSet() bool { - return v.isSet -} - -func (v *NullableFloat64) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableFloat64(val *float64) *NullableFloat64 { - return &NullableFloat64{value: val, isSet: true} -} - -func (v NullableFloat64) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableFloat64) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - -type NullableString struct { - value *string - isSet bool -} - -func (v NullableString) Get() *string { - return v.value -} - -func (v *NullableString) Set(val *string) { - v.value = val - v.isSet = true -} - -func (v NullableString) IsSet() bool { - return v.isSet -} - -func (v *NullableString) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableString(val *string) *NullableString { - return &NullableString{value: val, isSet: true} -} - -func (v NullableString) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableString) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - -type NullableTime struct { - value *time.Time - isSet bool -} - -func (v NullableTime) Get() *time.Time { - return v.value -} - -func (v *NullableTime) Set(val *time.Time) { - v.value = val - v.isSet = true -} - -func (v NullableTime) IsSet() bool { - return v.isSet -} - -func (v *NullableTime) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableTime(val *time.Time) *NullableTime { - return &NullableTime{value: val, isSet: true} -} - -func (v NullableTime) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableTime) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - -// IsNil checks if an input is nil -func IsNil(i interface{}) bool { - if i == nil { - return true - } - switch reflect.TypeOf(i).Kind() { - case reflect.Chan, reflect.Func, reflect.Map, reflect.Ptr, reflect.UnsafePointer, reflect.Interface, reflect.Slice: - return reflect.ValueOf(i).IsNil() - case reflect.Array: - return reflect.ValueOf(i).IsZero() - } - return false -} - -type MappedNullable interface { - ToMap() (map[string]interface{}, error) -} - -// A wrapper for strict JSON decoding -func newStrictDecoder(data []byte) *json.Decoder { - dec := json.NewDecoder(bytes.NewBuffer(data)) - dec.DisallowUnknownFields() - return dec -} - -// Prevent trying to import "fmt" -func reportError(format string, a ...interface{}) error { - return fmt.Errorf(format, a...) -} \ No newline at end of file diff --git a/version.go b/version.go new file mode 100644 index 0000000..09ba19c --- /dev/null +++ b/version.go @@ -0,0 +1,14 @@ +package apify + +// CLIENT_VERSION is the semantic version of this client library. +// +// It follows Semantic Versioning (https://semver.org/). Changes to the public +// interface (other than additive ones) are considered breaking changes. +const CLIENT_VERSION = "0.1.0" + +// API_SPEC_VERSION is the version of the Apify OpenAPI specification that this +// client was generated and verified against. +// +// It corresponds to the `info.version` field of the Apify OpenAPI document, e.g. +// `v2-2026-06-16T064758Z`. +const API_SPEC_VERSION = "v2-2026-06-16T064758Z" diff --git a/webhook.go b/webhook.go new file mode 100644 index 0000000..ba81302 --- /dev/null +++ b/webhook.go @@ -0,0 +1,65 @@ +package apify + +import "context" + +// WebhookCollectionClient is a client for a webhook collection: the account-wide collection +// (GET/POST /v2/webhooks) or webhooks nested under an Actor or task (read-only there). +type WebhookCollectionClient struct { + ctx *resourceContext +} + +func newWebhookCollectionClient(hc *httpClient, baseURL string) *WebhookCollectionClient { + return &WebhookCollectionClient{ctx: newCollectionContext(hc, baseURL, "webhooks")} +} + +// newWebhookCollectionClientWithBase builds a webhook collection nested under another +// resource (e.g. an Actor or task), using base as the parent URL. +func newWebhookCollectionClientWithBase(hc *httpClient, base string) *WebhookCollectionClient { + return &WebhookCollectionClient{ctx: newCollectionContext(hc, base, "webhooks")} +} + +// List lists webhooks. +func (c *WebhookCollectionClient) List(ctx context.Context, options ListOptions) (PaginationList[Webhook], error) { + params := NewQueryParams() + options.apply(params) + return listResource[Webhook](ctx, c.ctx, "", params) +} + +// Create creates a new webhook. webhook is any JSON-serializable webhook definition. +func (c *WebhookCollectionClient) Create(ctx context.Context, webhook any) (Webhook, error) { + return createResource[Webhook](ctx, c.ctx, NewQueryParams(), webhook) +} + +// WebhookClient is a client for a specific webhook (/v2/webhooks/{webhookId}). +type WebhookClient struct { + ctx *resourceContext +} + +func newWebhookClient(hc *httpClient, baseURL, id string) *WebhookClient { + return &WebhookClient{ctx: newSingleContext(hc, baseURL, "webhooks", id)} +} + +// Get fetches the webhook. The bool reports whether it exists. +func (c *WebhookClient) Get(ctx context.Context) (Webhook, bool, error) { + return getResource[Webhook](ctx, c.ctx, "", NewQueryParams()) +} + +// Update updates the webhook with the given fields and returns the updated object. +func (c *WebhookClient) Update(ctx context.Context, newFields any) (Webhook, error) { + return updateResource[Webhook](ctx, c.ctx, "", newFields) +} + +// Delete deletes the webhook. +func (c *WebhookClient) Delete(ctx context.Context) error { + return deleteResource(ctx, c.ctx, "") +} + +// Test dispatches the webhook immediately and returns the resulting dispatch. +func (c *WebhookClient) Test(ctx context.Context) (WebhookDispatch, error) { + return postWithBody[WebhookDispatch](ctx, c.ctx, "test", NewQueryParams(), nil, "") +} + +// Dispatches returns a client for this webhook's dispatch collection. +func (c *WebhookClient) Dispatches() *WebhookDispatchCollectionClient { + return newWebhookDispatchCollectionClientWithBase(c.ctx.http, c.ctx.subURL("")) +} diff --git a/webhook_dispatch.go b/webhook_dispatch.go new file mode 100644 index 0000000..8ed51d7 --- /dev/null +++ b/webhook_dispatch.go @@ -0,0 +1,41 @@ +package apify + +import "context" + +// WebhookDispatchCollectionClient is a client for a webhook dispatch collection: the +// account-wide collection (GET /v2/webhook-dispatches) or dispatches nested under a webhook. +type WebhookDispatchCollectionClient struct { + ctx *resourceContext +} + +func newWebhookDispatchCollectionClient(hc *httpClient, baseURL string) *WebhookDispatchCollectionClient { + return &WebhookDispatchCollectionClient{ctx: newCollectionContext(hc, baseURL, "webhook-dispatches")} +} + +// newWebhookDispatchCollectionClientWithBase builds a dispatch collection nested under a +// webhook, using base as the parent URL. +func newWebhookDispatchCollectionClientWithBase(hc *httpClient, base string) *WebhookDispatchCollectionClient { + return &WebhookDispatchCollectionClient{ctx: newCollectionContext(hc, base, "dispatches")} +} + +// List lists webhook dispatches. +func (c *WebhookDispatchCollectionClient) List(ctx context.Context, options ListOptions) (PaginationList[WebhookDispatch], error) { + params := NewQueryParams() + options.apply(params) + return listResource[WebhookDispatch](ctx, c.ctx, "", params) +} + +// WebhookDispatchClient is a client for a specific webhook dispatch +// (/v2/webhook-dispatches/{dispatchId}). +type WebhookDispatchClient struct { + ctx *resourceContext +} + +func newWebhookDispatchClient(hc *httpClient, baseURL, id string) *WebhookDispatchClient { + return &WebhookDispatchClient{ctx: newSingleContext(hc, baseURL, "webhook-dispatches", id)} +} + +// Get fetches the dispatch. The bool reports whether it exists. +func (c *WebhookDispatchClient) Get(ctx context.Context) (WebhookDispatch, bool, error) { + return getResource[WebhookDispatch](ctx, c.ctx, "", NewQueryParams()) +} From 520ae195082b695bbbb6092923c421137a91e5f6 Mon Sep 17 00:00:00 2001 From: Claude <noreply@anthropic.com> Date: Thu, 18 Jun 2026 17:59:38 +0000 Subject: [PATCH 3/5] fix: address review iteration 4 findings in Go client Fix waitForFinish indefinite-wait 404 hang (finite default budget, poll through 404s on a pure time bound, descriptive error on never-appearing resource); read both APIFY_IS_AT_HOME and isAtHome for User-Agent; add golangci-lint to CI with .golangci.yml; make Abort gracefully omittable; document browser-info/tools scope omission; doc/nit fixes. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> --- .github/workflows/go-integration-tests.yml | 8 ++ .golangci.yml | 22 +++++ CHANGELOG.md | 40 +++++++-- README.md | 23 ++++- base.go | 97 +++++++++++++--------- build.go | 2 +- client.go | 16 +++- client_meta_test.go | 25 +++++- common.go | 6 +- docs/runs.md | 2 +- examples/log_redirection/main.go | 2 +- http_client.go | 2 +- key_value_store.go | 5 +- log.go | 2 +- models.go | 6 +- review_fixes_test.go | 62 +++++++++++++- run.go | 12 +-- tests/key_value_store_test.go | 2 +- 18 files changed, 265 insertions(+), 69 deletions(-) create mode 100644 .golangci.yml diff --git a/.github/workflows/go-integration-tests.yml b/.github/workflows/go-integration-tests.yml index 17de82e..8c39bf9 100644 --- a/.github/workflows/go-integration-tests.yml +++ b/.github/workflows/go-integration-tests.yml @@ -42,6 +42,14 @@ jobs: - name: Vet run: go vet ./... + # The idiomatic Go linter. `go vet` only catches a narrow set of correctness issues; + # golangci-lint bundles staticcheck and other analyzers, satisfying the coding-rules + # mandate that linting/type-checking run in CI. Config lives in .golangci.yml. + - name: Lint (golangci-lint) + uses: golangci/golangci-lint-action@v6 + with: + version: latest + - name: Build run: go build ./... diff --git a/.golangci.yml b/.golangci.yml new file mode 100644 index 0000000..08fb326 --- /dev/null +++ b/.golangci.yml @@ -0,0 +1,22 @@ +# golangci-lint configuration for the Apify Go client (golangci-lint v2 schema). +# +# The coding rules require linting/type-checking to run in CI. We enable the standard, +# high-signal linters (the v2 defaults plus a few extras) rather than every available +# analyzer, to keep the signal-to-noise ratio high. +version: "2" + +run: + timeout: 5m + tests: true + +linters: + # The "standard" set bundles the high-signal analyzers: errcheck, govet, ineffassign, + # staticcheck (the idiomatic comprehensive Go linter), and unused. + default: standard + enable: + - misspell # common misspellings in comments/strings + +issues: + # Show all issues (don't cap per-linter/per-file like the defaults do). + max-issues-per-linter: 0 + max-same-issues: 0 diff --git a/CHANGELOG.md b/CHANGELOG.md index 63c1f4d..0df7de5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -43,8 +43,17 @@ specification version `v2-2026-06-16T064758Z`. - `RunClient.Charge` now always sends an `idempotency-key` header (auto-generated when not supplied), so a transport-retried charge is applied at most once — matching the reference client and preventing double-charging. -- `KeyValueStoreClient.GetRecord` now defaults `attachment=true`, matching the reference - client's record-fetch behaviour. +- `KeyValueStoreClient.GetRecord` now defaults `attachment` to the truthy form, matching the + reference client's record-fetch behaviour. (On the wire this client serialises booleans as + `1`/`0`, so the request carries `attachment=1`; functionally equivalent to the reference + client's `attachment=true`.) +- `WaitForFinish` (used by `Run.WaitForFinish`, `Build.WaitForFinish`, `Actor.Call`, + `Task.Call`) no longer hangs forever on a transient `404` during an indefinite wait + (`waitSecs == nil`). A just-started run/build can briefly return `404` because of + database-replica lag; the wait now polls through `404`s on a pure time bound (defaulting an + indefinite wait to a finite upper bound, mirroring the reference client's + `MAX_WAIT_FOR_FINISH`) and, if the resource never becomes available within the budget, + returns a descriptive error instead of spinning until the context is cancelled. ### Changed @@ -64,13 +73,34 @@ specification version `v2-2026-06-16T064758Z`. `forcePermissionLevel` fields (which the task run endpoint does not accept). - `LogClient` exposes the spec's `raw`/`download` options via `GetWithOptions`/ `StreamWithOptions`, and `RunClient.GetStreamedLog` provides a raw live-stream convenience. +- `RunClient.Abort` now takes `gracefully *bool` instead of `bool`. Passing `nil` omits the + `gracefully` query parameter entirely (letting the server apply its default, immediate + abort), matching the reference client's optional `gracefully` option; pass a pointer to + `true`/`false` to request a graceful/immediate abort explicitly. ### Notes -- Intentionally unimplemented endpoints (matching the JavaScript reference scope): the - synchronous run endpoints (`run-sync`, `run-sync-get-dataset-items`), and the keyed-POST - record aliases. Only documented endpoints are implemented. +- Intentionally unimplemented endpoints (a deliberate, parity-driven decision matching the + JavaScript reference and the Rust sibling — not an accidental gap): + - The synchronous run endpoints (`run-sync`, `run-sync-get-dataset-items`). + - The keyed-`POST` record aliases. + - The cryptographic tools `POST /v2/tools/encode-and-sign` and + `POST /v2/tools/decode-and-verify`. These are server-side conveniences for the same + HMAC-SHA256 signing this client already performs locally in `signature.go`; the reference + clients do not expose them, so the Go client omits them for cross-client parity. They can + be added alongside `signature.go` if a future requirement needs them. + - `/v2/browser-info`. Not exposed by the reference clients; omitted for parity. + Only documented endpoints are implemented; the omissions above are the conscious exceptions. +- User-Agent `isAtHome` flag: the canonical reference (JS) reads the `APIFY_IS_AT_HOME` + environment variable, while `client_requirements.md`'s worked example uses the bare name + `isAtHome`. These two same-priority requirements conflict, so the client honours **both** + variable names (either being set marks the client "at home"). The flag is rendered + lowercase (`true`/`false`) to stay byte-consistent with the JS reference; the requirements' + `True`/`False` capitalisation is treated as a cosmetic example, with JS consistency winning. - `Dataset`/`KeyValueStore` `GetOrCreate` take only a name: this spec version's create endpoints declare no request body or `schema` parameter, so a schema argument would be an undocumented extension. The `runs/last` endpoints accept only `status` (no `origin`) in this spec version. These choices favour strict OpenAPI compliance over the JS superset. +- CI runs `golangci-lint` (default high-signal analyzers — errcheck, govet, ineffassign, + staticcheck, unused — plus `misspell`) in addition to `gofmt`, `go vet`, and `go build`, + satisfying the coding-rule mandate that linting run in CI. Config in `.golangci.yml`. diff --git a/README.md b/README.md index 74de277..61c81f0 100644 --- a/README.md +++ b/README.md @@ -87,6 +87,11 @@ client := apify.NewClientWithOptions( | `WithUserAgentSuffix` | — | Suffix appended to the `User-Agent` header. | | `WithHTTPBackend` | `DefaultHTTPBackend` | Replaceable HTTP transport. | +The `User-Agent` header reports an `isAtHome` flag indicating whether the client runs on the +Apify platform. It is driven by an environment variable: the client reads **both** +`APIFY_IS_AT_HOME` (used by the JavaScript reference client) and the bare `isAtHome` name; if +either is set to a non-empty value, the flag is `true`. + ## Resource clients | Accessor | Returns | Purpose | @@ -176,9 +181,21 @@ Per-resource guides are in [`docs/`](docs): ## Scope -The client implements only documented API endpoints. Matching the JavaScript reference, the -synchronous run endpoints (`run-sync`, `run-sync-get-dataset-items`) and the keyed-POST -record aliases are intentionally not implemented. +The client implements only documented API endpoints. Matching the JavaScript reference (and +the Rust sibling) for cross-client consistency, the following documented endpoints are +**intentionally not implemented**: + +- Synchronous run endpoints (`run-sync`, `run-sync-get-dataset-items`). +- The keyed-`POST` record aliases. +- Cryptographic tools: `POST /v2/tools/encode-and-sign` and `POST /v2/tools/decode-and-verify`. + These are server-side conveniences for the same HMAC signing this client already performs + locally in `signature.go`; the reference clients do not expose them, so the Go client omits + them too for parity. (Should a future requirement need them, they can be added alongside + `signature.go`.) +- `/v2/browser-info`. Not exposed by the reference clients; omitted for parity. + +This is a deliberate, parity-driven decision, not an accidental gap. See the CHANGELOG for the +same note. ## License diff --git a/base.go b/base.go index c0f09ad..923be0b 100644 --- a/base.go +++ b/base.go @@ -3,21 +3,16 @@ package apify import ( "context" "encoding/json" + "fmt" "net/http" "strings" "time" ) -// Per-endpoint base timeouts. These mirror the reference clients' SMALL/MEDIUM/DEFAULT -// timeouts and are the single source of truth (no magic durations sprinkled in callers). -const ( - // defaultRequestTimeout is used when an endpoint does not specify its own (6 minutes). - defaultRequestTimeout = 360 * time.Second - // smallRequestTimeout is for fast, idempotent metadata operations (mirrors JS SMALL_TIMEOUT). - smallRequestTimeout = 5 * time.Second - // mediumRequestTimeout is for operations that may take a little longer (JS MEDIUM_TIMEOUT). - mediumRequestTimeout = 30 * time.Second -) +// defaultRequestTimeout is the per-request timeout applied to all API calls (6 minutes), +// matching the reference client's DEFAULT_TIMEOUT_MILLIS. It is the single source of truth +// for the request timeout (no magic durations sprinkled in callers). +const defaultRequestTimeout = 360 * time.Second // JSON content types used by the client. const ( @@ -30,6 +25,13 @@ const ( const ( waitForFinishPollInterval = 250 * time.Millisecond waitForFinishRequestSecs = int64(60) + // maxWaitForFinishSecs is the finite upper bound used when the caller asks to wait + // "indefinitely" (waitSecs == nil). The API will not accept "Infinity", and an + // unbounded client loop can spin forever if the resource keeps returning 404 (e.g. a + // just-started run whose database replica lags). 999999 seconds is more than 11 days, + // effectively indefinite while still guaranteeing termination. Mirrors the reference + // client's MAX_WAIT_FOR_FINISH. + maxWaitForFinishSecs = int64(999999) ) // resourceContext is the resolved context for a resource client: its base URL and the @@ -269,54 +271,75 @@ func putRaw(ctx context.Context, c *resourceContext, subPath string, params *Que type terminalChecker[T any] func(*T) bool // waitForFinish polls a GET endpoint with waitForFinish until the resource reaches a -// terminal state or waitSecs elapses. waitSecs nil waits indefinitely. Returns the latest -// resource (finished, or still running if the wait budget was exhausted). -func waitForFinish[T any](ctx context.Context, c *resourceContext, waitSecs *int64, isTerminal terminalChecker[T]) (T, error) { +// terminal state or the wait budget elapses. waitSecs nil means "wait indefinitely", which +// is implemented as a finite but very large bound (maxWaitForFinishSecs) so the loop always +// terminates. +// +// The budget is a pure time bound, evaluated independently of whether the resource is +// currently present. A just-started run/build can transiently return 404 (database-replica +// lag); like the reference client, we treat that as "not yet available", keep polling on the +// time bound, and only after the budget is exhausted do we decide the outcome. If the +// resource never became available within the budget, a descriptive error is returned naming +// the resource (resourceName, e.g. "run" or "build"). +func waitForFinish[T any](ctx context.Context, c *resourceContext, waitSecs *int64, resourceName string, isTerminal terminalChecker[T]) (T, error) { var zero T - start := time.Now() - var budget *time.Duration + + effectiveWaitSecs := maxWaitForFinishSecs if waitSecs != nil { - d := time.Duration(maxInt64(*waitSecs, 0)) * time.Second - budget = &d + effectiveWaitSecs = maxInt64(*waitSecs, 0) } + budget := time.Duration(effectiveWaitSecs) * time.Second + start := time.Now() + var ( + resource T + present bool + ) + + // do-while: always perform at least one fetch (matching the reference client), then + // repeat only while the pure time bound has not been reached. for { - var requestSecs int64 - if budget != nil { - elapsed := time.Since(start) - if elapsed >= *budget { - // Budget exhausted: one final immediate fetch. - params := NewQueryParams() - zeroSecs := int64(0) - params.AddInt("waitForFinish", &zeroSecs) - return getResourceRequired[T](ctx, c, "", params) - } - remaining := int64((*budget - elapsed).Seconds()) - requestSecs = minInt64(remaining, waitForFinishRequestSecs) - } else { - requestSecs = waitForFinishRequestSecs - } + elapsed := time.Since(start) + remaining := int64((budget - elapsed).Seconds()) + requestSecs := minInt64(maxInt64(remaining, 0), waitForFinishRequestSecs) params := NewQueryParams() params.AddInt("waitForFinish", &requestSecs) - resource, present, err := getResource[T](ctx, c, "", params) + res, ok, err := getResource[T](ctx, c, "", params) if err != nil { return zero, err } - if present { + // A transient 404 (ok == false) is not fatal: keep the last known state and poll + // again until the time budget runs out. + if ok { + resource, present = res, true if isTerminal(&resource) { return resource, nil } - if budget != nil && time.Since(start) >= *budget { - return resource, nil - } + } + + // Pure time bound: stop once the budget is exhausted, regardless of presence. + if time.Since(start) >= budget { + break } if !sleepWithContext(ctx, waitForFinishPollInterval) { return zero, ctx.Err() } } + + if present { + // Budget exhausted but the resource was seen at least once: return its latest state + // (e.g. still running). Mirrors the reference client returning the last fetched job. + return resource, nil + } + + // The resource never became available within the wait budget. + return zero, fmt.Errorf( + "waiting for %s to finish failed: cannot fetch %s details from the server", + resourceName, resourceName, + ) } func maxInt64(a, b int64) int64 { diff --git a/build.go b/build.go index fa59551..b9297b0 100644 --- a/build.go +++ b/build.go @@ -70,7 +70,7 @@ func (c *BuildClient) Delete(ctx context.Context) error { // WaitForFinish polls until the build reaches a terminal state or waitSecs elapses (nil // waits indefinitely). It returns the latest build. func (c *BuildClient) WaitForFinish(ctx context.Context, waitSecs *int64) (Build, error) { - return waitForFinish[Build](ctx, c.ctx, waitSecs, func(b *Build) bool { return b.IsTerminal() }) + return waitForFinish[Build](ctx, c.ctx, waitSecs, "build", func(b *Build) bool { return b.IsTerminal() }) } // GetOpenAPIDefinition returns the OpenAPI definition generated for the build, or diff --git a/client.go b/client.go index da2cfb8..c473c95 100644 --- a/client.go +++ b/client.go @@ -126,11 +126,21 @@ func withIsAtHomeFn(fn func() bool) Option { return func(c *clientConfig) { c.isAtHomeFn = fn } } +// Environment variable names that signal the client is running on the Apify platform. +// +// The canonical reference (JS) reads APIFY_IS_AT_HOME, but the client_requirements.md +// worked example uses the bare name isAtHome. These two same-priority requirements conflict, +// so the client honours BOTH: APIFY_IS_AT_HOME (JS-consistent, primary) and isAtHome (the +// literal requirement). Either being set marks the client as "at home". See CHANGELOG.md. +const ( + envIsAtHomePrimary = "APIFY_IS_AT_HOME" + envIsAtHomeLegacy = "isAtHome" +) + // defaultIsAtHome reports whether the client is running on the Apify platform, by reading -// the APIFY_IS_AT_HOME environment variable (matching the reference JS client). +// either supported environment variable (see envIsAtHomePrimary / envIsAtHomeLegacy). func defaultIsAtHome() bool { - v := os.Getenv("APIFY_IS_AT_HOME") - return v != "" + return os.Getenv(envIsAtHomePrimary) != "" || os.Getenv(envIsAtHomeLegacy) != "" } // NewClient creates a client authenticated with the given API token and default settings. diff --git a/client_meta_test.go b/client_meta_test.go index 7d180ce..e1720dc 100644 --- a/client_meta_test.go +++ b/client_meta_test.go @@ -6,7 +6,7 @@ import ( ) func TestVersionConstants(t *testing.T) { - if CLIENT_VERSION == "" || !(CLIENT_VERSION[0] >= '0' && CLIENT_VERSION[0] <= '9') { + if CLIENT_VERSION == "" || CLIENT_VERSION[0] < '0' || CLIENT_VERSION[0] > '9' { t.Fatalf("CLIENT_VERSION should start with a digit, got %q", CLIENT_VERSION) } if !strings.HasPrefix(API_SPEC_VERSION, "v2-") || !strings.HasSuffix(API_SPEC_VERSION, "Z") { @@ -28,7 +28,7 @@ func TestUserAgentFormat(t *testing.T) { } // The Go/ token must be followed by a real version digit, not empty. after := strings.SplitN(ua, "Go/", 2)[1] - if len(after) == 0 || !(after[0] >= '0' && after[0] <= '9') { + if len(after) == 0 || after[0] < '0' || after[0] > '9' { t.Fatalf("Go version must be a real version, got %q", ua) } } @@ -45,6 +45,27 @@ func TestUserAgentIsAtHomeFlag(t *testing.T) { } } +// defaultIsAtHome must honour BOTH the JS-consistent APIFY_IS_AT_HOME env var and the bare +// isAtHome name mandated by the requirements doc, resolving the two conflicting requirements. +func TestDefaultIsAtHomeReadsBothEnvVars(t *testing.T) { + t.Setenv(envIsAtHomePrimary, "") + t.Setenv(envIsAtHomeLegacy, "") + if defaultIsAtHome() { + t.Fatal("expected isAtHome=false when neither env var is set") + } + + t.Setenv(envIsAtHomePrimary, "1") + if !defaultIsAtHome() { + t.Fatalf("expected isAtHome=true when %s is set", envIsAtHomePrimary) + } + + t.Setenv(envIsAtHomePrimary, "") + t.Setenv(envIsAtHomeLegacy, "1") + if !defaultIsAtHome() { + t.Fatalf("expected isAtHome=true when %s is set", envIsAtHomeLegacy) + } +} + func TestUserAgentSuffix(t *testing.T) { client := NewClientWithOptions(WithToken("t"), WithUserAgentSuffix("MyTool/1.0")) if !strings.HasSuffix(client.UserAgent(), "; MyTool/1.0") { diff --git a/common.go b/common.go index edb24ad..f86bd48 100644 --- a/common.go +++ b/common.go @@ -201,8 +201,10 @@ type PaginationList[T any] struct { // BuildUserAgent builds the User-Agent header value mandated by the client requirements: // `ApifyClient/{version} ({os}; {language version}); isAtHome/{isAtHome}`. // -// isAtHome is driven by the platform's APIFY_IS_AT_HOME environment variable, matching the -// reference JS client (which reads it via @apify/consts). +// isAtHome is driven by the platform's APIFY_IS_AT_HOME environment variable (matching the +// reference JS client, which reads it via @apify/consts) or the bare isAtHome variable from +// the requirements doc; either being set marks the client "at home". The flag is rendered +// lowercase (true/false) to stay byte-consistent with the JS reference. See CHANGELOG.md. func BuildUserAgent(suffix string, isAtHomeFn func() bool) string { atHome := "false" if isAtHomeFn() { diff --git a/docs/runs.md b/docs/runs.md index e7dc8b4..a1eaf7a 100644 --- a/docs/runs.md +++ b/docs/runs.md @@ -21,7 +21,7 @@ Actor- and task-scoped collections). | `GetWithWait(ctx, waitForFinishSecs *int64) (ActorRun, bool, error)` | Fetch, optionally waiting server-side. | | `Update(ctx, newFields any) (ActorRun, error)` | Update the run (e.g. status message). | | `Delete(ctx) error` | Delete the run. | -| `Abort(ctx, gracefully bool) (ActorRun, error)` | Abort the run. | +| `Abort(ctx, gracefully *bool) (ActorRun, error)` | Abort the run. Pass `nil` to use the server default (immediate), or a pointer to `true`/`false` to abort gracefully/immediately. | | `Metamorph(ctx, targetActorID string, input any, MetamorphOptions) (ActorRun, error)` | Metamorph into another Actor. | | `Reboot(ctx) (ActorRun, error)` | Reboot the run. | | `Resurrect(ctx, RunResurrectOptions) (ActorRun, error)` | Resurrect a finished run. | diff --git a/examples/log_redirection/main.go b/examples/log_redirection/main.go index c2b35c4..b3b55d2 100644 --- a/examples/log_redirection/main.go +++ b/examples/log_redirection/main.go @@ -30,7 +30,7 @@ func main() { if err != nil { log.Fatalf("open log stream: %v", err) } - defer stream.Close() + defer func() { _ = stream.Close() }() if _, err := io.Copy(os.Stdout, stream); err != nil { log.Fatalf("copy log: %v", err) diff --git a/http_client.go b/http_client.go index b731639..d8e66d6 100644 --- a/http_client.go +++ b/http_client.go @@ -178,7 +178,7 @@ func (c *httpClient) doAttempt(ctx context.Context, method, url string, body []b if err != nil { return nil, err } - defer resp.Body.Close() + defer func() { _ = resp.Body.Close() }() data, err := io.ReadAll(resp.Body) if err != nil { diff --git a/key_value_store.go b/key_value_store.go index 4c7ec02..455e220 100644 --- a/key_value_store.go +++ b/key_value_store.go @@ -119,8 +119,9 @@ func (c *KeyValueStoreClient) RecordExists(ctx context.Context, key string) (boo // GetRecord fetches a record by key, or (nil, false, nil) if it does not exist. The value // holds the raw bytes; the content type is reported in the record. // -// Like the reference client, it sends attachment=true so the API returns the record's raw -// bytes directly (rather than redirecting). Use [GetRecordWithOptions] to override this. +// Like the reference client, it requests the record as an attachment (sent on the wire as +// attachment=1, the truthy form this client's bool serializer uses) so the API returns the +// record's raw bytes directly rather than redirecting. Use [GetRecordWithOptions] to override. func (c *KeyValueStoreClient) GetRecord(ctx context.Context, key string) (*KeyValueStoreRecord, bool, error) { return c.GetRecordWithOptions(ctx, key, GetRecordOptions{Attachment: ptrBool(true)}) } diff --git a/log.go b/log.go index 7e0b6ad..2d835f0 100644 --- a/log.go +++ b/log.go @@ -88,7 +88,7 @@ func (c *LogClient) StreamWithOptions(ctx context.Context, options LogOptions) ( if resp.StatusCode >= maxSuccessStatusCode { // Consume and classify the error body, then close. body, _ := io.ReadAll(resp.Body) - resp.Body.Close() + _ = resp.Body.Close() return nil, buildAPIError(resp.StatusCode, body, 1, http.MethodGet, extractPath(url)) } return resp.Body, nil diff --git a/models.go b/models.go index ab3a7b7..59bf434 100644 --- a/models.go +++ b/models.go @@ -168,7 +168,7 @@ func (t *Task) UnmarshalJSON(data []byte) error { type Dataset struct { // ID is the unique dataset ID. ID string `json:"id"` - // Name is the dataset name (nil for unnamed datasets). + // Name is the dataset name (empty for unnamed datasets). Name string `json:"name"` // UserID is the ID of the user who owns the dataset. UserID string `json:"userId"` @@ -192,7 +192,7 @@ func (d *Dataset) UnmarshalJSON(data []byte) error { type KeyValueStore struct { // ID is the unique store ID. ID string `json:"id"` - // Name is the store name (nil for unnamed stores). + // Name is the store name (empty for unnamed stores). Name string `json:"name"` // UserID is the ID of the user who owns the store. UserID string `json:"userId"` @@ -255,7 +255,7 @@ type KeyValueStoreRecord struct { type RequestQueue struct { // ID is the unique queue ID. ID string `json:"id"` - // Name is the queue name (nil for unnamed queues). + // Name is the queue name (empty for unnamed queues). Name string `json:"name"` // UserID is the ID of the user who owns the queue. UserID string `json:"userId"` diff --git a/review_fixes_test.go b/review_fixes_test.go index 353b122..d595f0e 100644 --- a/review_fixes_test.go +++ b/review_fixes_test.go @@ -4,6 +4,7 @@ import ( "context" "strings" "testing" + "time" ) // okData is a constant 200 response with an empty data envelope, reused by the offline @@ -99,7 +100,7 @@ func TestGetStreamedLogParams(t *testing.T) { if err != nil { t.Fatalf("get streamed log: %v", err) } - defer stream.Close() + defer func() { _ = stream.Close() }() if !strings.Contains(backend.lastURL, "stream=1") { t.Fatalf("expected stream=1 in URL, got %q", backend.lastURL) } @@ -108,6 +109,65 @@ func TestGetStreamedLogParams(t *testing.T) { } } +// notFound is a constant 404 response, used to simulate a resource that never becomes +// available (e.g. database-replica lag on a just-started run that never resolves). +func notFound() []mockResponse { + return constant(404, `{"error":{"type":"record-not-found","message":"missing"}}`) +} + +// A bounded WaitForFinish against a resource that stays 404 must terminate when the budget +// is exhausted and return a descriptive error (not the raw 404), matching the reference +// client's "Waiting for run to finish failed" behaviour. +func TestWaitForFinishBoundedReturnsDescriptiveErrorOn404(t *testing.T) { + backend := &mockBackend{responses: notFound()} + client := testClient(backend, 0) + + zeroSecs := int64(0) + _, err := client.Run("r1").WaitForFinish(context.Background(), &zeroSecs) + if err == nil { + t.Fatal("expected a descriptive error when the run never becomes available") + } + if !strings.Contains(err.Error(), "waiting for run to finish failed") { + t.Fatalf("expected descriptive wait error, got %q", err.Error()) + } + // 404 must not be retried by the transport, and the budget=0 path does exactly one fetch. + if backend.calls != 1 { + t.Fatalf("expected exactly 1 fetch for a zero-budget wait, got %d", backend.calls) + } +} + +// An INDEFINITE WaitForFinish (nil waitSecs) against a permanent 404 must NOT hang forever: +// it polls through 404s on a pure time bound, so a cancelled context unblocks it promptly. +// This is the regression test for the waitForFinish hang bug. +func TestWaitForFinishIndefiniteDoesNotHangOn404(t *testing.T) { + backend := &mockBackend{responses: notFound()} + client := testClient(backend, 0) + + ctx, cancel := context.WithTimeout(context.Background(), 200*time.Millisecond) + defer cancel() + + done := make(chan error, 1) + go func() { + _, err := client.Run("r1").WaitForFinish(ctx, nil) + done <- err + }() + + select { + case err := <-done: + // It must return because the context was cancelled (or, in principle, the budget), + // never spin indefinitely. + if err == nil { + t.Fatal("expected a non-nil error (context cancelled), got nil") + } + case <-time.After(5 * time.Second): + t.Fatal("WaitForFinish hung on a permanent 404 during an indefinite wait") + } + // Must have polled at least once through the 404 (proving 404 is not treated as fatal). + if backend.calls < 1 { + t.Fatalf("expected at least one poll through the 404, got %d", backend.calls) + } +} + // ListRequests must reject mutually-exclusive options and an invalid Filter before any API call. func TestListRequestsValidation(t *testing.T) { backend := &mockBackend{responses: okData()} diff --git a/run.go b/run.go index 3e4e842..711d697 100644 --- a/run.go +++ b/run.go @@ -92,11 +92,13 @@ func (c *RunClient) Delete(ctx context.Context) error { return deleteResource(ctx, c.ctx, "") } -// Abort aborts the run. If gracefully is true, the run is sent a signal so it can finish -// the current request before terminating. -func (c *RunClient) Abort(ctx context.Context, gracefully bool) (ActorRun, error) { +// Abort aborts the run. If gracefully points to true, the run is sent a signal so it can +// finish the current request before terminating; if false it is aborted immediately. Pass +// nil to omit the parameter entirely and let the server apply its default (immediate abort), +// matching the reference client's optional `gracefully` option. +func (c *RunClient) Abort(ctx context.Context, gracefully *bool) (ActorRun, error) { params := NewQueryParams() - params.AddBool("gracefully", &gracefully) + params.AddBool("gracefully", gracefully) return postWithBody[ActorRun](ctx, c.ctx, "abort", params, nil, "") } @@ -176,7 +178,7 @@ func (c *RunClient) generateIdempotencyKey(eventName string) string { // WaitForFinish polls until the run reaches a terminal state or waitSecs elapses (nil waits // indefinitely). It returns the latest run. func (c *RunClient) WaitForFinish(ctx context.Context, waitSecs *int64) (ActorRun, error) { - return waitForFinish[ActorRun](ctx, c.ctx, waitSecs, func(r *ActorRun) bool { return r.IsTerminal() }) + return waitForFinish[ActorRun](ctx, c.ctx, waitSecs, "run", func(r *ActorRun) bool { return r.IsTerminal() }) } // Dataset returns a client for this run's default dataset. diff --git a/tests/key_value_store_test.go b/tests/key_value_store_test.go index 72d8ef3..7527b9d 100644 --- a/tests/key_value_store_test.go +++ b/tests/key_value_store_test.go @@ -177,7 +177,7 @@ func TestRecordPublicURLIsFetchable(t *testing.T) { if err != nil { t.Fatalf("fetch public url: %v", err) } - defer resp.Body.Close() + defer func() { _ = resp.Body.Close() }() _, _ = io.Copy(io.Discard, resp.Body) if resp.StatusCode >= 300 { t.Fatalf("expected success fetching public url, got %d", resp.StatusCode) From 41ccc0866333483fe1273b7d367904604d56e925 Mon Sep 17 00:00:00 2001 From: Claude <noreply@anthropic.com> Date: Thu, 18 Jun 2026 18:07:30 +0000 Subject: [PATCH 4/5] ci: use golangci-lint-action@v7 with golangci-lint v2.5.0 The .golangci.yml uses the v2 config schema; the v6 action installed a v1.x binary that rejects it (additional properties version/default). Pin the v7 action + v2.5.0 to match local tooling. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> --- .github/workflows/go-integration-tests.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/go-integration-tests.yml b/.github/workflows/go-integration-tests.yml index 8c39bf9..d088c1a 100644 --- a/.github/workflows/go-integration-tests.yml +++ b/.github/workflows/go-integration-tests.yml @@ -46,9 +46,12 @@ jobs: # golangci-lint bundles staticcheck and other analyzers, satisfying the coding-rules # mandate that linting/type-checking run in CI. Config lives in .golangci.yml. - name: Lint (golangci-lint) - uses: golangci/golangci-lint-action@v6 + # Use the v7 action and pin a golangci-lint v2 release: .golangci.yml uses the + # v2 config schema, which the v6 action's v1.x binary rejects ("additional + # properties 'version'/'default' not allowed"). + uses: golangci/golangci-lint-action@v7 with: - version: latest + version: v2.5.0 - name: Build run: go build ./... From ad19cf7f28b4b7616a181630da6d825cba75ed1f Mon Sep 17 00:00:00 2001 From: Claude <noreply@anthropic.com> Date: Fri, 19 Jun 2026 07:47:54 +0000 Subject: [PATCH 5/5] docs: export apify.Ptr, document pagination/formats/NewClient token Address external-reviewer documentation hints: - Export apify.Ptr[T](v T) *T so doc snippets compile when copy-pasted; switch docs and the create_build_run_actor example to apify.Ptr. - Document PaginationList[T] fields and the Total-lag-after-write quirk. - Enumerate the DownloadItemsFormat constants (incl. the previously omitted FormatJSONL). - Note that NewClient does not auto-read APIFY_TOKEN. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> --- common.go | 11 ++++++++ docs/README.md | 36 +++++++++++++++++++++++++ docs/actors.md | 9 ++++--- docs/builds.md | 2 +- docs/misc.md | 2 +- docs/storages.md | 18 ++++++++++--- docs/tasks.md | 2 +- examples/create_build_run_actor/main.go | 6 ++--- 8 files changed, 72 insertions(+), 14 deletions(-) diff --git a/common.go b/common.go index f86bd48..7135eba 100644 --- a/common.go +++ b/common.go @@ -182,7 +182,18 @@ func (o StorageListOptions) apply(q *QueryParams) { AddString("ownership", o.Ownership) } +// Ptr returns a pointer to v. It is a convenience for setting the optional, pointer-typed +// fields on the option structs (e.g. Limit, Desc, My) without needing a named local variable: +// +// client.Actors().List(ctx, apify.ActorListOptions{My: apify.Ptr(true), Limit: apify.Ptr(int64(10))}) +func Ptr[T any](v T) *T { return &v } + // PaginationList is a single page of an offset/limit-paginated list. +// +// The pagination metadata (Total, Offset, Limit, Count, Desc) accompanies the Items slice. +// Note: Total reflects the API's reported total, which can briefly lag immediately after a +// write (e.g. right after PushItems) because the count is computed asynchronously — re-read +// after a short delay if you need an exact post-write total. type PaginationList[T any] struct { // Total is the total number of items available across all pages. Total int64 `json:"total"` diff --git a/docs/README.md b/docs/README.md index e083b05..ca78f32 100644 --- a/docs/README.md +++ b/docs/README.md @@ -12,10 +12,46 @@ client := apify.NewClient("my-api-token") ctx := context.Background() ``` +`NewClient` takes the token as an explicit argument — it does **not** read `APIFY_TOKEN` (or +any other environment variable) automatically. Read it yourself if you want that, e.g. +`apify.NewClient(os.Getenv("APIFY_TOKEN"))`. Use `apify.NewClientWithOptions(...)` for +non-default settings (base URL, retries, timeout, user-agent suffix, custom HTTP backend). + Methods that fetch a single resource return a `(value, ok, error)` triple: a missing resource is reported by `ok == false` rather than an error. API failures are returned as `*apify.APIError` (see [error handling](../README.md#error-handling)). +## Setting optional fields — `apify.Ptr` + +Optional option-struct fields are pointer-typed (so "unset" is distinguishable from a zero +value). The exported generic helper `apify.Ptr[T](v T) *T` sets them inline without a named +local: + +```go +page, err := client.Actors().List(ctx, apify.ActorListOptions{ + My: apify.Ptr(true), + Limit: apify.Ptr(int64(10)), +}) +``` + +## Pagination + +List/iterate methods return `apify.PaginationList[T]`, one page plus the API's pagination +metadata: + +| Field | Type | Meaning | +|---|---|---| +| `Items` | `[]T` | The items in this page. | +| `Total` | `int64` | Total items available across all pages. | +| `Count` | `int64` | Number of items actually returned in this page. | +| `Offset` | `int64` | Items skipped before this page. | +| `Limit` | `int64` | Max items the API would return for this request. | +| `Desc` | `bool` | Whether items are in descending order. | + +> **`Total` can lag right after a write.** The API computes the count asynchronously, so +> immediately after a `PushItems` (or other write) `Total` may not yet include the new items. +> Re-read after a short delay if you need an exact post-write total. + ## Pages - [Actors](actors.md) — Actors, versions, environment variables. diff --git a/docs/actors.md b/docs/actors.md index e96a008..736f6d2 100644 --- a/docs/actors.md +++ b/docs/actors.md @@ -14,7 +14,7 @@ Actors are the programs that run on the Apify platform. Access the Actor collect `ActorListOptions`: `Offset`, `Limit`, `Desc`, `My`, `SortBy` (all optional pointers). ```go -page, err := client.Actors().List(ctx, apify.ActorListOptions{My: ptr(true), Limit: ptr(int64(10))}) +page, err := client.Actors().List(ctx, apify.ActorListOptions{My: apify.Ptr(true), Limit: apify.Ptr(int64(10))}) ``` ## Single Actor @@ -45,7 +45,7 @@ page, err := client.Actors().List(ctx, apify.ActorListOptions{My: ptr(true), Lim waitSecs := int64(120) run, err := client.Actor("apify/hello-world").Call(ctx, map[string]any{"message": "hi"}, - apify.ActorStartOptions{MemoryMbytes: ptr(int64(512))}, + apify.ActorStartOptions{MemoryMbytes: apify.Ptr(int64(512))}, &waitSecs, ) ``` @@ -63,7 +63,8 @@ run, err := client.Actor("apify/hello-world").Call(ctx, ```go v := client.Actor(actorID).Version("0.0") -_, err := v.EnvVars().Create(ctx, apify.ActorEnvVar{Name: "API_KEY", Value: "secret", IsSecret: ptr(true)}) +_, err := v.EnvVars().Create(ctx, apify.ActorEnvVar{Name: "API_KEY", Value: "secret", IsSecret: apify.Ptr(true)}) ``` -> `ptr` is a helper returning a pointer to its argument: `func ptr[T any](v T) *T { return &v }`. +> `apify.Ptr` is an exported helper returning a pointer to its argument +> (`func Ptr[T any](v T) *T`). Use it to set the optional, pointer-typed option fields inline. diff --git a/docs/builds.md b/docs/builds.md index 7c91190..3cc1f1b 100644 --- a/docs/builds.md +++ b/docs/builds.md @@ -25,7 +25,7 @@ build, err := client.Actor(actorID).Build(ctx, "0.0", apify.ActorBuildOptions{}) if err != nil { log.Fatal(err) } -finished, err := client.Build(build.ID).WaitForFinish(ctx, ptr(int64(300))) +finished, err := client.Build(build.ID).WaitForFinish(ctx, apify.Ptr(int64(300))) if err != nil { log.Fatal(err) } diff --git a/docs/misc.md b/docs/misc.md index fa42570..0b3ea14 100644 --- a/docs/misc.md +++ b/docs/misc.md @@ -13,7 +13,7 @@ Browse public Actors with `client.Store()`: `PricingModel`, `IncludeUnrunnableActors`, `AllowsAgenticUsers`, `ResponseFormat`. ```go -it := client.Store().Iterate(apify.StoreListOptions{Limit: ptr(int64(20)), Search: ptr("scraper")}) +it := client.Store().Iterate(apify.StoreListOptions{Limit: apify.Ptr(int64(20)), Search: apify.Ptr("scraper")}) for { actor, err := it.Next(ctx) if err != nil { log.Fatal(err) } diff --git a/docs/storages.md b/docs/storages.md index 9e68d09..1a97cae 100644 --- a/docs/storages.md +++ b/docs/storages.md @@ -22,13 +22,25 @@ Single dataset: `client.Dataset(id)`: For typed item decoding use the generic helper `apify.ListDatasetItems[T](ctx, dataset, opts)`. +`DownloadItems` takes a `DownloadItemsFormat`. The exported constants are: + +| Constant | Value | +| --- | --- | +| `apify.FormatJSON` | `json` | +| `apify.FormatJSONL` | `jsonl` | +| `apify.FormatCSV` | `csv` | +| `apify.FormatXLSX` | `xlsx` | +| `apify.FormatXML` | `xml` | +| `apify.FormatRSS` | `rss` | +| `apify.FormatHTML` | `html` | + ```go ds, _ := client.Datasets().GetOrCreate(ctx, "") defer client.Dataset(ds.ID).Delete(ctx) _ = client.Dataset(ds.ID).PushItems(ctx, []map[string]any{{"x": 1}, {"x": 2}}) -page, _ := client.Dataset(ds.ID).ListItems(ctx, apify.DatasetListItemsOptions{Limit: ptr(int64(100))}) -csv, _ := client.Dataset(ds.ID).DownloadItems(ctx, apify.FormatCSV, apify.DatasetDownloadOptions{Bom: ptr(true)}) +page, _ := client.Dataset(ds.ID).ListItems(ctx, apify.DatasetListItemsOptions{Limit: apify.Ptr(int64(100))}) +csv, _ := client.Dataset(ds.ID).DownloadItems(ctx, apify.FormatCSV, apify.DatasetDownloadOptions{Bom: apify.Ptr(true)}) ``` ## Key-value stores @@ -90,7 +102,7 @@ defer client.RequestQueue(rq.ID).Delete(ctx) queue := client.RequestQueue(rq.ID) _, _ = queue.AddRequest(ctx, apify.RequestQueueRequest{URL: "https://example.com", UniqueKey: "example"}, false) -it := queue.PaginateRequests(ptr(int64(100))) +it := queue.PaginateRequests(apify.Ptr(int64(100))) for { req, err := it.Next(ctx) if err != nil { log.Fatal(err) } diff --git a/docs/tasks.md b/docs/tasks.md index c878ff8..f66c62f 100644 --- a/docs/tasks.md +++ b/docs/tasks.md @@ -35,7 +35,7 @@ task, err := client.Tasks().Create(ctx, map[string]any{ if err != nil { log.Fatal(err) } -run, err := client.Task(task.ID).Call(ctx, nil, apify.TaskStartOptions{}, ptr(int64(120))) +run, err := client.Task(task.ID).Call(ctx, nil, apify.TaskStartOptions{}, apify.Ptr(int64(120))) ``` `TaskStartOptions` mirrors `ActorStartOptions` (see [actors.md](actors.md)) but omits the diff --git a/examples/create_build_run_actor/main.go b/examples/create_build_run_actor/main.go index 98f9441..46ec6e3 100644 --- a/examples/create_build_run_actor/main.go +++ b/examples/create_build_run_actor/main.go @@ -52,13 +52,13 @@ func main() { if err != nil { log.Fatalf("start build: %v", err) } - if _, err := client.Build(build.ID).WaitForFinish(ctx, ptr(int64(300))); err != nil { + if _, err := client.Build(build.ID).WaitForFinish(ctx, apify.Ptr(int64(300))); err != nil { log.Fatalf("wait for build: %v", err) } fmt.Printf("Built actor (build %s)\n", build.ID) // Run the actor and wait for it to finish. - run, err := actor.Call(ctx, nil, apify.ActorStartOptions{}, ptr(int64(120))) + run, err := actor.Call(ctx, nil, apify.ActorStartOptions{}, apify.Ptr(int64(120))) if err != nil { log.Fatalf("run actor: %v", err) } @@ -74,5 +74,3 @@ func main() { fmt.Println(logText) } } - -func ptr[T any](v T) *T { return &v }